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 { MDCSelectAdapter } from './adapter';
|
25 | import { MDCSelectFoundationMap } from './types';
|
26 | export declare class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {
|
27 | static get cssClasses(): {
|
28 | ACTIVATED: string;
|
29 | DISABLED: string;
|
30 | FOCUSED: string;
|
31 | INVALID: string;
|
32 | MENU_INVALID: string;
|
33 | OUTLINED: string;
|
34 | REQUIRED: string;
|
35 | ROOT: string;
|
36 | WITH_LEADING_ICON: string;
|
37 | };
|
38 | static get numbers(): {
|
39 | LABEL_SCALE: number;
|
40 | UNSET_INDEX: number;
|
41 | CLICK_DEBOUNCE_TIMEOUT_MS: number;
|
42 | };
|
43 | static get strings(): {
|
44 | ARIA_CONTROLS: string;
|
45 | ARIA_DESCRIBEDBY: string;
|
46 | ARIA_SELECTED_ATTR: string;
|
47 | CHANGE_EVENT: string;
|
48 | HIDDEN_INPUT_SELECTOR: string;
|
49 | LABEL_SELECTOR: string;
|
50 | LEADING_ICON_SELECTOR: string;
|
51 | LINE_RIPPLE_SELECTOR: string;
|
52 | MENU_SELECTOR: string;
|
53 | OUTLINE_SELECTOR: string;
|
54 | SELECTED_TEXT_SELECTOR: string;
|
55 | SELECT_ANCHOR_SELECTOR: string;
|
56 | VALUE_ATTR: string;
|
57 | };
|
58 | |
59 |
|
60 |
|
61 | static get defaultAdapter(): MDCSelectAdapter;
|
62 | private readonly leadingIcon;
|
63 | private readonly helperText;
|
64 | private disabled;
|
65 | private isMenuOpen;
|
66 | private useDefaultValidation;
|
67 | private customValidity;
|
68 | private lastSelectedIndex;
|
69 | private clickDebounceTimeout;
|
70 | private recentlyClicked;
|
71 | |
72 |
|
73 |
|
74 |
|
75 | constructor(adapter?: Partial<MDCSelectAdapter>, foundationMap?: Partial<MDCSelectFoundationMap>);
|
76 | /** Returns the index of the currently selected menu item, or -1 if none. */
|
77 | getSelectedIndex(): number;
|
78 | setSelectedIndex(index: number, closeMenu?: boolean, skipNotify?: boolean): void;
|
79 | setValue(value: string, skipNotify?: boolean): void;
|
80 | getValue(): string;
|
81 | getDisabled(): boolean;
|
82 | setDisabled(isDisabled: boolean): void;
|
83 | /** Opens the menu. */
|
84 | openMenu(): void;
|
85 | /**
|
86 | * @param content Sets the content of the helper text.
|
87 | */
|
88 | setHelperTextContent(content: string): void;
|
89 | /**
|
90 | * Re-calculates if the notched outline should be notched and if the label
|
91 | * should float.
|
92 | */
|
93 | layout(): void;
|
94 | /**
|
95 | * Synchronizes the list of options with the state of the foundation. Call
|
96 | * this whenever menu options are dynamically updated.
|
97 | */
|
98 | layoutOptions(): void;
|
99 | handleMenuOpened(): void;
|
100 | handleMenuClosing(): void;
|
101 | handleMenuClosed(): void;
|
102 | /**
|
103 | * Handles value changes, via change event or programmatic updates.
|
104 | */
|
105 | handleChange(): void;
|
106 | handleMenuItemAction(index: number): void;
|
107 | /**
|
108 | * Handles focus events from select element.
|
109 | */
|
110 | handleFocus(): void;
|
111 | /**
|
112 | * Handles blur events from select element.
|
113 | */
|
114 | handleBlur(): void;
|
115 | handleClick(normalizedX: number): void;
|
116 | /**
|
117 | * Handles keydown events on select element. Depending on the type of
|
118 | * character typed, does typeahead matching or opens menu.
|
119 | */
|
120 | handleKeydown(event: KeyboardEvent): void;
|
121 | /**
|
122 | * Opens/closes the notched outline.
|
123 | */
|
124 | notchOutline(openNotch: boolean): void;
|
125 | /**
|
126 | * Sets the aria label of the leading icon.
|
127 | */
|
128 | setLeadingIconAriaLabel(label: string): void;
|
129 | /**
|
130 | * Sets the text content of the leading icon.
|
131 | */
|
132 | setLeadingIconContent(content: string): void;
|
133 | getUseDefaultValidation(): boolean;
|
134 | setUseDefaultValidation(useDefaultValidation: boolean): void;
|
135 | setValid(isValid: boolean): void;
|
136 | isValid(): boolean;
|
137 | setRequired(isRequired: boolean): void;
|
138 | getRequired(): boolean;
|
139 | init(): void;
|
140 | /**
|
141 | * Unfocuses the select component.
|
142 | */
|
143 | private blur;
|
144 | private syncHelperTextValidity;
|
145 | private setClickDebounceTimeout;
|
146 | }
|
147 | export default MDCSelectFoundation;
|