UNPKG

3.99 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2016 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 { MDCRippleAdapter } from './adapter';
25export declare class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {
26 static get cssClasses(): {
27 BG_FOCUSED: string;
28 FG_ACTIVATION: string;
29 FG_DEACTIVATION: string;
30 ROOT: string;
31 UNBOUNDED: string;
32 };
33 static get strings(): {
34 VAR_FG_SCALE: string;
35 VAR_FG_SIZE: string;
36 VAR_FG_TRANSLATE_END: string;
37 VAR_FG_TRANSLATE_START: string;
38 VAR_LEFT: string;
39 VAR_TOP: string;
40 };
41 static get numbers(): {
42 DEACTIVATION_TIMEOUT_MS: number;
43 FG_DEACTIVATION_MS: number;
44 INITIAL_ORIGIN_SCALE: number;
45 PADDING: number;
46 TAP_DELAY_MS: number;
47 };
48 static get defaultAdapter(): MDCRippleAdapter;
49 private activationAnimationHasEnded;
50 private activationState;
51 private activationTimer;
52 private fgDeactivationRemovalTimer;
53 private fgScale;
54 private frame;
55 private initialSize;
56 private layoutFrame;
57 private maxRadius;
58 private unboundedCoords;
59 private readonly activationTimerCallback;
60 private readonly activateHandler;
61 private readonly deactivateHandler;
62 private readonly focusHandler;
63 private readonly blurHandler;
64 private readonly resizeHandler;
65 private previousActivationEvent?;
66 constructor(adapter?: Partial<MDCRippleAdapter>);
67 init(): void;
68 destroy(): void;
69 /**
70 * @param evt Optional event containing position information.
71 */
72 activate(evt?: Event): void;
73 deactivate(): void;
74 layout(): void;
75 setUnbounded(unbounded: boolean): void;
76 handleFocus(): void;
77 handleBlur(): void;
78 /**
79 * We compute this property so that we are not querying information about the client
80 * until the point in time where the foundation requests it. This prevents scenarios where
81 * client-side feature-detection may happen too early, such as when components are rendered on the server
82 * and then initialized at mount time on the client.
83 */
84 private supportsPressRipple;
85 private defaultActivationState;
86 /**
87 * supportsPressRipple Passed from init to save a redundant function call
88 */
89 private registerRootHandlers;
90 private registerDeactivationHandlers;
91 private deregisterRootHandlers;
92 private deregisterDeactivationHandlers;
93 private removeCssVars;
94 private activateImpl;
95 private checkElementMadeActive;
96 private animateActivation;
97 private getFgTranslationCoordinates;
98 private runDeactivationUXLogicIfReady;
99 private rmBoundedActivationClasses;
100 private resetActivationState;
101 private deactivateImpl;
102 private animateDeactivation;
103 private layoutInternal;
104 private updateLayoutCssVars;
105}
106export default MDCRippleFoundation;