1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | import { MDCFoundation } from '@material/base/foundation';
|
24 | import { MDCDialogAdapter } from './adapter';
|
25 | import { DialogConfigOptions } from './types';
|
26 | export declare class MDCDialogFoundation extends MDCFoundation<MDCDialogAdapter> {
|
27 | static get cssClasses(): {
|
28 | CLOSING: string;
|
29 | OPEN: string;
|
30 | OPENING: string;
|
31 | SCROLLABLE: string;
|
32 | SCROLL_LOCK: string;
|
33 | STACKED: string;
|
34 | FULLSCREEN: string;
|
35 | SCROLL_DIVIDER_HEADER: string;
|
36 | SCROLL_DIVIDER_FOOTER: string;
|
37 | SURFACE_SCRIM_SHOWN: string;
|
38 | SURFACE_SCRIM_SHOWING: string;
|
39 | SURFACE_SCRIM_HIDING: string;
|
40 | SCRIM_HIDDEN: string;
|
41 | };
|
42 | static get strings(): {
|
43 | ACTION_ATTRIBUTE: string;
|
44 | BUTTON_DEFAULT_ATTRIBUTE: string;
|
45 | BUTTON_SELECTOR: string;
|
46 | CLOSED_EVENT: string;
|
47 | CLOSE_ACTION: string;
|
48 | CLOSING_EVENT: string;
|
49 | CONTAINER_SELECTOR: string;
|
50 | CONTENT_SELECTOR: string;
|
51 | DESTROY_ACTION: string;
|
52 | INITIAL_FOCUS_ATTRIBUTE: string;
|
53 | OPENED_EVENT: string;
|
54 | OPENING_EVENT: string;
|
55 | SCRIM_SELECTOR: string;
|
56 | SUPPRESS_DEFAULT_PRESS_SELECTOR: string;
|
57 | SURFACE_SELECTOR: string;
|
58 | };
|
59 | static get numbers(): {
|
60 | DIALOG_ANIMATION_CLOSE_TIME_MS: number;
|
61 | DIALOG_ANIMATION_OPEN_TIME_MS: number;
|
62 | };
|
63 | static get defaultAdapter(): MDCDialogAdapter;
|
64 | private dialogOpen;
|
65 | private isFullscreen;
|
66 | private animationFrame;
|
67 | private animationTimer;
|
68 | private escapeKeyAction;
|
69 | private scrimClickAction;
|
70 | private autoStackButtons;
|
71 | private areButtonsStacked;
|
72 | private suppressDefaultPressSelector;
|
73 | private readonly contentScrollHandler;
|
74 | private readonly animFrame;
|
75 | private readonly windowResizeHandler;
|
76 | private readonly windowOrientationChangeHandler;
|
77 | constructor(adapter?: Partial<MDCDialogAdapter>);
|
78 | init(): void;
|
79 | destroy(): void;
|
80 | open(dialogOptions?: DialogConfigOptions): void;
|
81 | close(action?: string): void;
|
82 | /**
|
83 | * Used only in instances of showing a secondary dialog over a full-screen
|
84 | * dialog. Shows the "surface scrim" displayed over the full-screen dialog.
|
85 | */
|
86 | showSurfaceScrim(): void;
|
87 | /**
|
88 | * Used only in instances of showing a secondary dialog over a full-screen
|
89 | * dialog. Hides the "surface scrim" displayed over the full-screen dialog.
|
90 | */
|
91 | hideSurfaceScrim(): void;
|
92 | /**
|
93 | * Handles `transitionend` event triggered when surface scrim animation is
|
94 | * finished.
|
95 | */
|
96 | handleSurfaceScrimTransitionEnd(): void;
|
97 | isOpen(): boolean;
|
98 | getEscapeKeyAction(): string;
|
99 | setEscapeKeyAction(action: string): void;
|
100 | getScrimClickAction(): string;
|
101 | setScrimClickAction(action: string): void;
|
102 | getAutoStackButtons(): boolean;
|
103 | setAutoStackButtons(autoStack: boolean): void;
|
104 | getSuppressDefaultPressSelector(): string;
|
105 | setSuppressDefaultPressSelector(selector: string): void;
|
106 | layout(): void;
|
107 | /** Handles click on the dialog root element. */
|
108 | handleClick(evt: MouseEvent): void;
|
109 | /** Handles keydown on the dialog root element. */
|
110 | handleKeydown(evt: KeyboardEvent): void;
|
111 | /** Handles keydown on the document. */
|
112 | handleDocumentKeydown(evt: KeyboardEvent): void;
|
113 | /**
|
114 | * Handles scroll event on the dialog's content element -- showing a scroll
|
115 | * divider on the header or footer based on the scroll position. This handler
|
116 | * should only be registered on full-screen dialogs with scrollable content.
|
117 | */
|
118 | private handleScrollEvent;
|
119 | private layoutInternal;
|
120 | private handleAnimationTimerEnd;
|
121 | /**
|
122 | * Runs the given logic on the next animation frame, using setTimeout to
|
123 | * factor in Firefox reflow behavior.
|
124 | */
|
125 | private runNextAnimationFrame;
|
126 | private detectStackedButtons;
|
127 | private toggleScrollableClasses;
|
128 | private toggleScrollDividerHeader;
|
129 | private toggleScrollDividerFooter;
|
130 | }
|
131 | export default MDCDialogFoundation;
|