UNPKG

3.28 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2018 Google Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23import { MDCFoundation } from '@material/base/foundation';
24import { MDCDrawerAdapter } from '../adapter';
25export declare class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> {
26 static get strings(): {
27 APP_CONTENT_SELECTOR: string;
28 CLOSE_EVENT: string;
29 OPEN_EVENT: string;
30 SCRIM_SELECTOR: string;
31 LIST_SELECTOR: string;
32 LIST_ITEM_ACTIVATED_SELECTOR: string;
33 };
34 static get cssClasses(): {
35 ANIMATE: string;
36 CLOSING: string;
37 DISMISSIBLE: string;
38 MODAL: string;
39 OPEN: string;
40 OPENING: string;
41 ROOT: string;
42 };
43 static get defaultAdapter(): MDCDrawerAdapter;
44 private animationFrame;
45 private animationTimer;
46 constructor(adapter?: Partial<MDCDrawerAdapter>);
47 destroy(): void;
48 /**
49 * Opens the drawer from the closed state.
50 */
51 open(): void;
52 /**
53 * Closes the drawer from the open state.
54 */
55 close(): void;
56 /**
57 * Returns true if the drawer is in the open position.
58 * @return true if drawer is in open state.
59 */
60 isOpen(): boolean;
61 /**
62 * Returns true if the drawer is animating open.
63 * @return true if drawer is animating open.
64 */
65 isOpening(): boolean;
66 /**
67 * Returns true if the drawer is animating closed.
68 * @return true if drawer is animating closed.
69 */
70 isClosing(): boolean;
71 /**
72 * Keydown handler to close drawer when key is escape.
73 */
74 handleKeydown(evt: KeyboardEvent): void;
75 /**
76 * Handles the `transitionend` event when the drawer finishes opening/closing.
77 */
78 handleTransitionEnd(evt: TransitionEvent): void;
79 /**
80 * Extension point for when drawer finishes open animation.
81 */
82 protected opened(): void;
83 /**
84 * Extension point for when drawer finishes close animation.
85 */
86 protected closed(): void;
87 /**
88 * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
89 */
90 private runNextAnimationFrame;
91 private isElement;
92}
93export default MDCDismissibleDrawerFoundation;