Skip to content

Commit 4491f15

Browse files
committed
docs: Minor modal & message updates
1 parent ae87f33 commit 4491f15

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

components/modal/active-modal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export class ActiveModal<T, U, V> implements SuiActiveModal<T, U, V> {
2222
return this.componentRef.instance;
2323
}
2424

25-
constructor(instance:ModalConfig<T, U, V>, componentRef:ComponentRef<SuiModal<U, V>>) {
26-
this.config = instance;
25+
constructor(config:ModalConfig<T, U, V>, componentRef:ComponentRef<SuiModal<U, V>>) {
26+
this.config = config;
2727
this.componentRef = componentRef;
2828

2929
// Automatically destroy the modal component when it has been dismissed.

components/modal/modal.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SuiDimmerModule } from "../dimmer/dimmer.module";
44
import { SuiTransitionModule } from "../transition/transition.module";
55
import { SuiUtilityModule } from "../util/util.module";
66
import { SuiModalService } from "./modal.service";
7-
import { SuiModal } from "./modal";
7+
import { SuiModal, IModal } from "./modal";
88
import { Modal, ModalResult, ModalControls } from "./modal-controls";
99
import { ActiveModal, SuiActiveModal } from "./active-modal";
1010
import { ModalConfig, TemplateModalConfig, ComponentModalConfig, ModalSize } from "./modal-config";
@@ -35,6 +35,7 @@ export class SuiModalModule {}
3535
export {
3636
SuiModalService,
3737
Modal as SuiModal,
38+
IModal,
3839
ModalResult,
3940
ModalControls,
4041
SuiActiveModal,

components/modal/modal.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { KeyCode, parseBooleanAttribute, getDocumentFontSize } from "../util/uti
88
import { ModalControls, ModalResult } from "./modal-controls";
99
import { ModalConfig, ModalSize } from "./modal-config";
1010

11+
export interface IModal<T, U> {
12+
approve(result:T):void;
13+
deny(result:U):void;
14+
}
15+
1116
@Component({
1217
selector: "sui-modal",
1318
template: `
@@ -44,7 +49,7 @@ import { ModalConfig, ModalSize } from "./modal-config";
4449
}
4550
`]
4651
})
47-
export class SuiModal<T, U> implements OnInit, AfterViewInit {
52+
export class SuiModal<T, U> implements IModal<T, U>, OnInit, AfterViewInit {
4853
@Input()
4954
// Determines whether the modal can be closed with a close button, clicking outside, or the escape key.
5055
public isClosable:boolean;

demo/src/app/pages/message/message.page.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export class MessagePage {
5555
name: "dismiss",
5656
type: "void",
5757
description: "Fires when the message is dismissed by the user."
58+
},
59+
{
60+
name: "click",
61+
type: "void",
62+
description: "Fires when the message is clicked by the user."
5863
}
5964
]
6065
}

demo/src/app/pages/popup/popup.page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class PopupPage {
127127
"right bottom"
128128
];
129129

130-
public position:string = "right bottom";
130+
public position:string = "top right";
131131

132132
public manualPopupMarkup:string = `
133133
<div class="ui segment" suiPopup popupText="Manual" popupTrigger="manual" #popup="suiPopup">
@@ -198,7 +198,7 @@ export class PopupExampleTemplate {}
198198
})
199199
export class PopupExamplePlacement {
200200
@Input()
201-
public position:string = "right bottom";
201+
public position:string = "top right";
202202
}
203203

204204
export const PopupPageComponents = [PopupPage, PopupExampleStandard, PopupExampleTemplate, PopupExamplePlacement];

0 commit comments

Comments
 (0)