UNPKG

2.97 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2017 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 { MDCToolbarAdapter } from './adapter';
25export declare class MDCToolbarFoundation extends MDCFoundation<MDCToolbarAdapter> {
26 static readonly cssClasses: {
27 FIXED: string;
28 FIXED_AT_LAST_ROW: string;
29 FIXED_LASTROW: string;
30 FLEXIBLE_DEFAULT_BEHAVIOR: string;
31 FLEXIBLE_MAX: string;
32 FLEXIBLE_MIN: string;
33 TOOLBAR_ROW_FLEXIBLE: string;
34 };
35 static readonly strings: {
36 CHANGE_EVENT: string;
37 FIRST_ROW_SELECTOR: string;
38 ICON_SELECTOR: string;
39 TITLE_SELECTOR: string;
40 };
41 static readonly numbers: {
42 MAX_TITLE_SIZE: number; /** The ratio of max scrollTop that we should listen to to row height. */
43 MIN_TITLE_SIZE: number;
44 TOOLBAR_MOBILE_BREAKPOINT: number;
45 TOOLBAR_ROW_HEIGHT: number;
46 TOOLBAR_ROW_MOBILE_HEIGHT: number;
47 };
48 static readonly defaultAdapter: MDCToolbarAdapter;
49 private checkRowHeightFrame_;
50 private scrollFrame_;
51 private executedLastChange_;
52 private isFixed_;
53 private isFixedLastRow_;
54 private hasFlexibleFirstRow_;
55 private useFlexDefaultBehavior_;
56 private calculations_;
57 private resizeHandler_;
58 private scrollHandler_;
59 constructor(adapter?: Partial<MDCToolbarAdapter>);
60 init(): void;
61 destroy(): void;
62 updateAdjustElementStyles(): void;
63 private getFlexibleExpansionRatio_;
64 private checkRowHeight_;
65 private setKeyHeights_;
66 private updateToolbarStyles_;
67 private scrolledOutOfThreshold_;
68 private initKeyRatio_;
69 private getRowHeight_;
70 private updateToolbarFlexibleState_;
71 private updateToolbarFixedState_;
72 private updateFlexibleRowElementStyles_;
73 private updateElementStylesDefaultBehavior_;
74}
75export default MDCToolbarFoundation;