UNPKG

44.2 kBTypeScriptView Raw
1// Generated by dts-bundle v0.7.3
2// Dependencies for this module:
3// ../../@material/menu-surface/constants
4// ../../@material/base/component
5// ../../@material/floating-label/component
6// ../../@material/line-ripple/component
7// ../../@material/menu/component
8// ../../@material/notched-outline/component
9// ../../@material/base/foundation
10// ../../@material/base/types
11
12declare module '@material/select' {
13 /**
14 * @license
15 * Copyright 2019 Google Inc.
16 *
17 * Permission is hereby granted, free of charge, to any person obtaining a copy
18 * of this software and associated documentation files (the "Software"), to deal
19 * in the Software without restriction, including without limitation the rights
20 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21 * copies of the Software, and to permit persons to whom the Software is
22 * furnished to do so, subject to the following conditions:
23 *
24 * The above copyright notice and this permission notice shall be included in
25 * all copies or substantial portions of the Software.
26 *
27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33 * THE SOFTWARE.
34 */
35 export * from '@material/select/adapter';
36 export * from '@material/select/component';
37 export * from '@material/select/constants';
38 export * from '@material/select/foundation';
39 export * from '@material/select/types';
40 export * from '@material/select/helper-text/index';
41 export * from '@material/select/icon/index';
42}
43
44declare module '@material/select/adapter' {
45 /**
46 * @license
47 * Copyright 2018 Google Inc.
48 *
49 * Permission is hereby granted, free of charge, to any person obtaining a copy
50 * of this software and associated documentation files (the "Software"), to deal
51 * in the Software without restriction, including without limitation the rights
52 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53 * copies of the Software, and to permit persons to whom the Software is
54 * furnished to do so, subject to the following conditions:
55 *
56 * The above copyright notice and this permission notice shall be included in
57 * all copies or substantial portions of the Software.
58 *
59 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
65 * THE SOFTWARE.
66 */
67 import { Corner } from '@material/menu-surface/constants';
68 /**
69 * Defines the shape of the adapter expected by the foundation.
70 * Implement this adapter for your framework of choice to delegate updates to
71 * the component in your framework of choice. See architecture documentation
72 * for more details.
73 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
74 */
75 export interface MDCSelectAdapter {
76 /**
77 * Adds class to select anchor element.
78 */
79 addClass(className: string): void;
80 /**
81 * Removes a class from the select anchor element.
82 */
83 removeClass(className: string): void;
84 /**
85 * Returns true if the select anchor element contains the given class name.
86 */
87 hasClass(className: string): boolean;
88 /**
89 * Activates the bottom line, showing a focused state.
90 */
91 activateBottomLine(): void;
92 /**
93 * Deactivates the bottom line.
94 */
95 deactivateBottomLine(): void;
96 /**
97 * Returns true if label exists, false if it doesn't.
98 */
99 hasLabel(): boolean;
100 /**
101 * Floats label determined based off of the shouldFloat argument.
102 */
103 floatLabel(shouldFloat: boolean): void;
104 /**
105 * Returns width of label in pixels, if the label exists.
106 */
107 getLabelWidth(): number;
108 /**
109 * Styles the label as required, if the label exists.
110 */
111 setLabelRequired(isRequired: boolean): void;
112 /**
113 * Returns true if outline element exists, false if it doesn't.
114 */
115 hasOutline(): boolean;
116 /**
117 * Only implement if outline element exists.
118 */
119 notchOutline(labelWidth: number): void;
120 /**
121 * Closes notch in outline element, if the outline exists.
122 */
123 closeOutline(): void;
124 /**
125 * Sets the line ripple transform origin center.
126 */
127 setRippleCenter(normalizedX: number): void;
128 /**
129 * Emits a change event when an element is selected.
130 */
131 notifyChange(value: string): void;
132 /**
133 * Sets the text content of the selectedText element to the given string.
134 */
135 setSelectedText(text: string): void;
136 /**
137 * Returns whether the select anchor is focused.
138 */
139 isSelectAnchorFocused(): boolean;
140 /**
141 * Gets the given attribute on the select anchor element.
142 */
143 getSelectAnchorAttr(attr: string): string | null;
144 /**
145 * Sets the given attribute on the select anchor element.
146 */
147 setSelectAnchorAttr(attr: string, value: string): void;
148 /**
149 * Removes the given attribute on the select anchor element.
150 */
151 removeSelectAnchorAttr(attr: string): void;
152 /**
153 * Adds class to the menu element.
154 */
155 addMenuClass(className: string): void;
156 /**
157 * Removes a class from the menu element.
158 */
159 removeMenuClass(className: string): void;
160 /**
161 * Opens the menu.
162 */
163 openMenu(): void;
164 /**
165 * Closes the menu.
166 */
167 closeMenu(): void;
168 /**
169 * Returns the select anchor element.
170 */
171 getAnchorElement(): Element | null;
172 /**
173 * Sets the menu anchor element.
174 */
175 setMenuAnchorElement(anchorEl: Element): void;
176 /**
177 * Sets the menu anchor corner.
178 */
179 setMenuAnchorCorner(anchorCorner: Corner): void;
180 /**
181 * Sets whether the menu should wrap focus.
182 */
183 setMenuWrapFocus(wrapFocus: boolean): void;
184 /**
185 * Focuses the menu item element at the given index.
186 */
187 focusMenuItemAtIndex(index: number): void;
188 /**
189 * Returns the number of menu items.
190 */
191 getMenuItemCount(): number;
192 /**
193 * Returns an array representing the VALUE_ATTR attributes of each menu item.
194 */
195 getMenuItemValues(): string[];
196 /**
197 * Gets the text content of the menu item element at the given index.
198 */
199 getMenuItemTextAtIndex(index: number): string;
200 /**
201 * Returns the selected index.
202 */
203 getSelectedIndex(): number;
204 /**
205 * Sets the selected index in the menu.
206 */
207 setSelectedIndex(index: number): void;
208 /**
209 * Returns whether typeahead is in progress in the menu.
210 */
211 isTypeaheadInProgress(): boolean;
212 /**
213 * Adds a character to the list typeahead buffer and returns index of the
214 * next item in the list matching the buffer.
215 */
216 typeaheadMatchItem(nextChar: string, startingIndex: number): number;
217 }
218}
219
220declare module '@material/select/component' {
221 /**
222 * @license
223 * Copyright 2016 Google Inc.
224 *
225 * Permission is hereby granted, free of charge, to any person obtaining a copy
226 * of this software and associated documentation files (the "Software"), to deal
227 * in the Software without restriction, including without limitation the rights
228 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
229 * copies of the Software, and to permit persons to whom the Software is
230 * furnished to do so, subject to the following conditions:
231 *
232 * The above copyright notice and this permission notice shall be included in
233 * all copies or substantial portions of the Software.
234 *
235 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
236 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
237 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
238 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
239 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
240 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
241 * THE SOFTWARE.
242 */
243 import { MDCComponent } from '@material/base/component';
244 import { MDCFloatingLabelFactory } from '@material/floating-label/component';
245 import { MDCLineRippleFactory } from '@material/line-ripple/component';
246 import { MDCMenuFactory } from '@material/menu/component';
247 import { MDCNotchedOutlineFactory } from '@material/notched-outline/component';
248 import { MDCSelectFoundation } from '@material/select/foundation';
249 import { MDCSelectHelperTextFactory } from '@material/select/helper-text/component';
250 import { MDCSelectIconFactory } from '@material/select/icon/component';
251 export class MDCSelect extends MDCComponent<MDCSelectFoundation> {
252 static attachTo(root: Element): MDCSelect;
253 initialize(labelFactory?: MDCFloatingLabelFactory, lineRippleFactory?: MDCLineRippleFactory, outlineFactory?: MDCNotchedOutlineFactory, menuFactory?: MDCMenuFactory, iconFactory?: MDCSelectIconFactory, helperTextFactory?: MDCSelectHelperTextFactory): void;
254 /**
255 * Initializes the select's event listeners and internal state based
256 * on the environment's state.
257 */
258 initialSyncWithDOM(): void;
259 destroy(): void;
260 get value(): string;
261 set value(value: string);
262 setValue(value: string, skipNotify?: boolean): void;
263 get selectedIndex(): number;
264 set selectedIndex(selectedIndex: number);
265 setSelectedIndex(selectedIndex: number, skipNotify?: boolean): void;
266 get disabled(): boolean;
267 set disabled(disabled: boolean);
268 set leadingIconAriaLabel(label: string);
269 /**
270 * Sets the text content of the leading icon.
271 */
272 set leadingIconContent(content: string);
273 /**
274 * Sets the text content of the helper text.
275 */
276 set helperTextContent(content: string);
277 /**
278 * Enables or disables the default validation scheme where a required select
279 * must be non-empty. Set to false for custom validation.
280 * @param useDefaultValidation Set this to false to ignore default
281 * validation scheme.
282 */
283 set useDefaultValidation(useDefaultValidation: boolean);
284 /**
285 * Sets the current invalid state of the select.
286 */
287 set valid(isValid: boolean);
288 /**
289 * Checks if the select is in a valid state.
290 */
291 get valid(): boolean;
292 /**
293 * Sets the control to the required state.
294 */
295 set required(isRequired: boolean);
296 /**
297 * Returns whether the select is required.
298 */
299 get required(): boolean;
300 /**
301 * Re-calculates if the notched outline should be notched and if the label
302 * should float.
303 */
304 layout(): void;
305 /**
306 * Synchronizes the list of options with the state of the foundation. Call
307 * this whenever menu options are dynamically updated.
308 */
309 layoutOptions(): void;
310 getDefaultFoundation(): MDCSelectFoundation;
311 }
312}
313
314declare module '@material/select/constants' {
315 /**
316 * @license
317 * Copyright 2016 Google Inc.
318 *
319 * Permission is hereby granted, free of charge, to any person obtaining a copy
320 * of this software and associated documentation files (the "Software"), to deal
321 * in the Software without restriction, including without limitation the rights
322 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
323 * copies of the Software, and to permit persons to whom the Software is
324 * furnished to do so, subject to the following conditions:
325 *
326 * The above copyright notice and this permission notice shall be included in
327 * all copies or substantial portions of the Software.
328 *
329 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
330 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
331 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
332 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
333 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
334 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
335 * THE SOFTWARE.
336 */
337 const cssClasses: {
338 ACTIVATED: string;
339 DISABLED: string;
340 FOCUSED: string;
341 INVALID: string;
342 MENU_INVALID: string;
343 OUTLINED: string;
344 REQUIRED: string;
345 ROOT: string;
346 WITH_LEADING_ICON: string;
347 };
348 const strings: {
349 ARIA_CONTROLS: string;
350 ARIA_DESCRIBEDBY: string;
351 ARIA_SELECTED_ATTR: string;
352 CHANGE_EVENT: string;
353 HIDDEN_INPUT_SELECTOR: string;
354 LABEL_SELECTOR: string;
355 LEADING_ICON_SELECTOR: string;
356 LINE_RIPPLE_SELECTOR: string;
357 MENU_SELECTOR: string;
358 OUTLINE_SELECTOR: string;
359 SELECTED_TEXT_SELECTOR: string;
360 SELECT_ANCHOR_SELECTOR: string;
361 VALUE_ATTR: string;
362 };
363 const numbers: {
364 LABEL_SCALE: number;
365 UNSET_INDEX: number;
366 CLICK_DEBOUNCE_TIMEOUT_MS: number;
367 };
368 export { cssClasses, strings, numbers };
369}
370
371declare module '@material/select/foundation' {
372 /**
373 * @license
374 * Copyright 2016 Google Inc.
375 *
376 * Permission is hereby granted, free of charge, to any person obtaining a copy
377 * of this software and associated documentation files (the "Software"), to deal
378 * in the Software without restriction, including without limitation the rights
379 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
380 * copies of the Software, and to permit persons to whom the Software is
381 * furnished to do so, subject to the following conditions:
382 *
383 * The above copyright notice and this permission notice shall be included in
384 * all copies or substantial portions of the Software.
385 *
386 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
387 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
388 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
389 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
390 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
391 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
392 * THE SOFTWARE.
393 */
394 import { MDCFoundation } from '@material/base/foundation';
395 import { MDCSelectAdapter } from '@material/select/adapter';
396 import { MDCSelectFoundationMap } from '@material/select/types';
397 export class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {
398 static get cssClasses(): {
399 ACTIVATED: string;
400 DISABLED: string;
401 FOCUSED: string;
402 INVALID: string;
403 MENU_INVALID: string;
404 OUTLINED: string;
405 REQUIRED: string;
406 ROOT: string;
407 WITH_LEADING_ICON: string;
408 };
409 static get numbers(): {
410 LABEL_SCALE: number;
411 UNSET_INDEX: number;
412 CLICK_DEBOUNCE_TIMEOUT_MS: number;
413 };
414 static get strings(): {
415 ARIA_CONTROLS: string;
416 ARIA_DESCRIBEDBY: string;
417 ARIA_SELECTED_ATTR: string;
418 CHANGE_EVENT: string;
419 HIDDEN_INPUT_SELECTOR: string;
420 LABEL_SELECTOR: string;
421 LEADING_ICON_SELECTOR: string;
422 LINE_RIPPLE_SELECTOR: string;
423 MENU_SELECTOR: string;
424 OUTLINE_SELECTOR: string;
425 SELECTED_TEXT_SELECTOR: string;
426 SELECT_ANCHOR_SELECTOR: string;
427 VALUE_ATTR: string;
428 };
429 /**
430 * See {@link MDCSelectAdapter} for typing information on parameters and return types.
431 */
432 static get defaultAdapter(): MDCSelectAdapter;
433 /**
434 * @param adapter
435 * @param foundationMap Map from subcomponent names to their subfoundations.
436 */
437 constructor(adapter?: Partial<MDCSelectAdapter>, foundationMap?: Partial<MDCSelectFoundationMap>);
438 /** Returns the index of the currently selected menu item, or -1 if none. */
439 getSelectedIndex(): number;
440 setSelectedIndex(index: number, closeMenu?: boolean, skipNotify?: boolean): void;
441 setValue(value: string, skipNotify?: boolean): void;
442 getValue(): string;
443 getDisabled(): boolean;
444 setDisabled(isDisabled: boolean): void;
445 /** Opens the menu. */
446 openMenu(): void;
447 /**
448 * @param content Sets the content of the helper text.
449 */
450 setHelperTextContent(content: string): void;
451 /**
452 * Re-calculates if the notched outline should be notched and if the label
453 * should float.
454 */
455 layout(): void;
456 /**
457 * Synchronizes the list of options with the state of the foundation. Call
458 * this whenever menu options are dynamically updated.
459 */
460 layoutOptions(): void;
461 handleMenuOpened(): void;
462 handleMenuClosing(): void;
463 handleMenuClosed(): void;
464 /**
465 * Handles value changes, via change event or programmatic updates.
466 */
467 handleChange(): void;
468 handleMenuItemAction(index: number): void;
469 /**
470 * Handles focus events from select element.
471 */
472 handleFocus(): void;
473 /**
474 * Handles blur events from select element.
475 */
476 handleBlur(): void;
477 handleClick(normalizedX: number): void;
478 /**
479 * Handles keydown events on select element. Depending on the type of
480 * character typed, does typeahead matching or opens menu.
481 */
482 handleKeydown(event: KeyboardEvent): void;
483 /**
484 * Opens/closes the notched outline.
485 */
486 notchOutline(openNotch: boolean): void;
487 /**
488 * Sets the aria label of the leading icon.
489 */
490 setLeadingIconAriaLabel(label: string): void;
491 /**
492 * Sets the text content of the leading icon.
493 */
494 setLeadingIconContent(content: string): void;
495 setUseDefaultValidation(useDefaultValidation: boolean): void;
496 setValid(isValid: boolean): void;
497 isValid(): boolean;
498 setRequired(isRequired: boolean): void;
499 getRequired(): boolean;
500 init(): void;
501 }
502 export default MDCSelectFoundation;
503}
504
505declare module '@material/select/types' {
506 /**
507 * @license
508 * Copyright 2019 Google Inc.
509 *
510 * Permission is hereby granted, free of charge, to any person obtaining a copy
511 * of this software and associated documentation files (the "Software"), to deal
512 * in the Software without restriction, including without limitation the rights
513 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
514 * copies of the Software, and to permit persons to whom the Software is
515 * furnished to do so, subject to the following conditions:
516 *
517 * The above copyright notice and this permission notice shall be included in
518 * all copies or substantial portions of the Software.
519 *
520 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
521 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
522 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
523 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
524 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
525 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
526 * THE SOFTWARE.
527 */
528 import { MDCSelectHelperTextFoundation } from '@material/select/helper-text/foundation';
529 import { MDCSelectIconFoundation } from '@material/select/icon/foundation';
530 export interface MDCSelectFoundationMap {
531 leadingIcon: MDCSelectIconFoundation;
532 helperText: MDCSelectHelperTextFoundation;
533 }
534 export interface MDCSelectEventDetail {
535 value: string;
536 index: number;
537 }
538 export interface MDCSelectEvent extends Event {
539 readonly detail: MDCSelectEventDetail;
540 }
541}
542
543declare module '@material/select/helper-text/index' {
544 /**
545 * @license
546 * Copyright 2019 Google Inc.
547 *
548 * Permission is hereby granted, free of charge, to any person obtaining a copy
549 * of this software and associated documentation files (the "Software"), to deal
550 * in the Software without restriction, including without limitation the rights
551 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
552 * copies of the Software, and to permit persons to whom the Software is
553 * furnished to do so, subject to the following conditions:
554 *
555 * The above copyright notice and this permission notice shall be included in
556 * all copies or substantial portions of the Software.
557 *
558 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
559 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
560 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
561 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
562 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
563 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
564 * THE SOFTWARE.
565 */
566 export * from '@material/select/helper-text/adapter';
567 export * from '@material/select/helper-text/component';
568 export * from '@material/select/helper-text/foundation';
569 export { cssClasses as helperTextCssClasses, strings as helperTextStrings } from '@material/select/helper-text/constants';
570}
571
572declare module '@material/select/icon/index' {
573 /**
574 * @license
575 * Copyright 2019 Google Inc.
576 *
577 * Permission is hereby granted, free of charge, to any person obtaining a copy
578 * of this software and associated documentation files (the "Software"), to deal
579 * in the Software without restriction, including without limitation the rights
580 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
581 * copies of the Software, and to permit persons to whom the Software is
582 * furnished to do so, subject to the following conditions:
583 *
584 * The above copyright notice and this permission notice shall be included in
585 * all copies or substantial portions of the Software.
586 *
587 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
588 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
589 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
590 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
591 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
592 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
593 * THE SOFTWARE.
594 */
595 export * from '@material/select/icon/adapter';
596 export * from '@material/select/icon/component';
597 export * from '@material/select/icon/foundation';
598 export { strings as iconStrings } from '@material/select/icon/constants';
599}
600
601declare module '@material/select/helper-text/component' {
602 /**
603 * @license
604 * Copyright 2018 Google Inc.
605 *
606 * Permission is hereby granted, free of charge, to any person obtaining a copy
607 * of this software and associated documentation files (the "Software"), to deal
608 * in the Software without restriction, including without limitation the rights
609 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
610 * copies of the Software, and to permit persons to whom the Software is
611 * furnished to do so, subject to the following conditions:
612 *
613 * The above copyright notice and this permission notice shall be included in
614 * all copies or substantial portions of the Software.
615 *
616 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
617 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
618 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
619 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
620 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
621 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
622 * THE SOFTWARE.
623 */
624 import { MDCComponent } from '@material/base/component';
625 import { MDCSelectHelperTextFoundation } from '@material/select/helper-text/foundation';
626 export type MDCSelectHelperTextFactory = (el: Element, foundation?: MDCSelectHelperTextFoundation) => MDCSelectHelperText;
627 export class MDCSelectHelperText extends MDCComponent<MDCSelectHelperTextFoundation> {
628 static attachTo(root: Element): MDCSelectHelperText;
629 get foundationForSelect(): MDCSelectHelperTextFoundation;
630 getDefaultFoundation(): MDCSelectHelperTextFoundation;
631 }
632}
633
634declare module '@material/select/icon/component' {
635 /**
636 * @license
637 * Copyright 2018 Google Inc.
638 *
639 * Permission is hereby granted, free of charge, to any person obtaining a copy
640 * of this software and associated documentation files (the "Software"), to deal
641 * in the Software without restriction, including without limitation the rights
642 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
643 * copies of the Software, and to permit persons to whom the Software is
644 * furnished to do so, subject to the following conditions:
645 *
646 * The above copyright notice and this permission notice shall be included in
647 * all copies or substantial portions of the Software.
648 *
649 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
650 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
651 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
652 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
653 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
654 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
655 * THE SOFTWARE.
656 */
657 import { MDCComponent } from '@material/base/component';
658 import { MDCSelectIconFoundation } from '@material/select/icon/foundation';
659 export type MDCSelectIconFactory = (el: Element, foundation?: MDCSelectIconFoundation) => MDCSelectIcon;
660 export class MDCSelectIcon extends MDCComponent<MDCSelectIconFoundation> {
661 static attachTo(root: Element): MDCSelectIcon;
662 get foundationForSelect(): MDCSelectIconFoundation;
663 getDefaultFoundation(): MDCSelectIconFoundation;
664 }
665}
666
667declare module '@material/select/helper-text/foundation' {
668 /**
669 * @license
670 * Copyright 2018 Google Inc.
671 *
672 * Permission is hereby granted, free of charge, to any person obtaining a copy
673 * of this software and associated documentation files (the "Software"), to deal
674 * in the Software without restriction, including without limitation the rights
675 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
676 * copies of the Software, and to permit persons to whom the Software is
677 * furnished to do so, subject to the following conditions:
678 *
679 * The above copyright notice and this permission notice shall be included in
680 * all copies or substantial portions of the Software.
681 *
682 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
683 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
684 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
685 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
686 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
687 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
688 * THE SOFTWARE.
689 */
690 import { MDCFoundation } from '@material/base/foundation';
691 import { MDCSelectHelperTextAdapter } from '@material/select/helper-text/adapter';
692 export class MDCSelectHelperTextFoundation extends MDCFoundation<MDCSelectHelperTextAdapter> {
693 static get cssClasses(): {
694 HELPER_TEXT_VALIDATION_MSG: string;
695 HELPER_TEXT_VALIDATION_MSG_PERSISTENT: string;
696 };
697 static get strings(): {
698 ARIA_HIDDEN: string;
699 ROLE: string;
700 };
701 /**
702 * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.
703 */
704 static get defaultAdapter(): MDCSelectHelperTextAdapter;
705 constructor(adapter?: Partial<MDCSelectHelperTextAdapter>);
706 /**
707 * @return The ID of the helper text, or null if none is set.
708 */
709 getId(): string | null;
710 /**
711 * @return Whether the helper text is currently visible.
712 */
713 isVisible(): boolean;
714 /**
715 * Sets the content of the helper text field.
716 */
717 setContent(content: string): void;
718 /**
719 * Sets the helper text to act as a validation message.
720 * By default, validation messages are hidden when the select is valid and
721 * visible when the select is invalid.
722 *
723 * @param isValidation True to make the helper text act as an error validation
724 * message.
725 */
726 setValidation(isValidation: boolean): void;
727 /**
728 * Sets the persistency of the validation helper text.
729 * This keeps the validation message visible even if the select is valid,
730 * though it will be displayed in the normal (grey) color.
731 */
732 setValidationMsgPersistent(isPersistent: boolean): void;
733 /**
734 * When acting as a validation message, shows/hides the helper text and
735 * triggers alerts as necessary based on the select's validity.
736 */
737 setValidity(selectIsValid: boolean): void;
738 }
739 export default MDCSelectHelperTextFoundation;
740}
741
742declare module '@material/select/icon/foundation' {
743 /**
744 * @license
745 * Copyright 2018 Google Inc.
746 *
747 * Permission is hereby granted, free of charge, to any person obtaining a copy
748 * of this software and associated documentation files (the "Software"), to deal
749 * in the Software without restriction, including without limitation the rights
750 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
751 * copies of the Software, and to permit persons to whom the Software is
752 * furnished to do so, subject to the following conditions:
753 *
754 * The above copyright notice and this permission notice shall be included in
755 * all copies or substantial portions of the Software.
756 *
757 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
758 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
759 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
760 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
761 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
762 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
763 * THE SOFTWARE.
764 */
765 import { MDCFoundation } from '@material/base/foundation';
766 import { MDCSelectIconAdapter } from '@material/select/icon/adapter';
767 export class MDCSelectIconFoundation extends MDCFoundation<MDCSelectIconAdapter> {
768 static get strings(): {
769 ICON_EVENT: string;
770 ICON_ROLE: string;
771 };
772 /**
773 * See {@link MDCSelectIconAdapter} for typing information on parameters and return types.
774 */
775 static get defaultAdapter(): MDCSelectIconAdapter;
776 constructor(adapter?: Partial<MDCSelectIconAdapter>);
777 init(): void;
778 destroy(): void;
779 setDisabled(disabled: boolean): void;
780 setAriaLabel(label: string): void;
781 setContent(content: string): void;
782 handleInteraction(evt: MouseEvent | KeyboardEvent): void;
783 }
784 export default MDCSelectIconFoundation;
785}
786
787declare module '@material/select/helper-text/adapter' {
788 /**
789 * Defines the shape of the adapter expected by the foundation.
790 * Implement this adapter for your framework of choice to delegate updates to
791 * the component in your framework of choice. See architecture documentation
792 * for more details.
793 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
794 */
795 export interface MDCSelectHelperTextAdapter {
796 /**
797 * Adds a class to the helper text element.
798 */
799 addClass(className: string): void;
800 /**
801 * Removes a class from the helper text element.
802 */
803 removeClass(className: string): void;
804 /**
805 * Returns whether or not the helper text element contains the given class.
806 */
807 hasClass(className: string): boolean;
808 /**
809 * Sets an attribute with a given value on the helper text element.
810 */
811 setAttr(attr: string, value: string): void;
812 /**
813 * Removes an attribute from the helper text element.
814 */
815 removeAttr(attr: string): void;
816 /**
817 * Gets an attribute from the helper text element.
818 */
819 getAttr(attr: string): string | null;
820 /**
821 * Sets the text content for the helper text element.
822 */
823 setContent(content: string): void;
824 }
825}
826
827declare module '@material/select/helper-text/constants' {
828 /**
829 * @license
830 * Copyright 2018 Google Inc.
831 *
832 * Permission is hereby granted, free of charge, to any person obtaining a copy
833 * of this software and associated documentation files (the "Software"), to deal
834 * in the Software without restriction, including without limitation the rights
835 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
836 * copies of the Software, and to permit persons to whom the Software is
837 * furnished to do so, subject to the following conditions:
838 *
839 * The above copyright notice and this permission notice shall be included in
840 * all copies or substantial portions of the Software.
841 *
842 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
843 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
844 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
845 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
846 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
847 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
848 * THE SOFTWARE.
849 */
850 const strings: {
851 ARIA_HIDDEN: string;
852 ROLE: string;
853 };
854 const cssClasses: {
855 HELPER_TEXT_VALIDATION_MSG: string;
856 HELPER_TEXT_VALIDATION_MSG_PERSISTENT: string;
857 };
858 export { strings, cssClasses };
859}
860
861declare module '@material/select/icon/adapter' {
862 /**
863 * @license
864 * Copyright 2018 Google Inc.
865 *
866 * Permission is hereby granted, free of charge, to any person obtaining a copy
867 * of this software and associated documentation files (the "Software"), to deal
868 * in the Software without restriction, including without limitation the rights
869 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
870 * copies of the Software, and to permit persons to whom the Software is
871 * furnished to do so, subject to the following conditions:
872 *
873 * The above copyright notice and this permission notice shall be included in
874 * all copies or substantial portions of the Software.
875 *
876 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
877 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
878 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
879 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
880 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
881 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
882 * THE SOFTWARE.
883 */
884 import { EventType, SpecificEventListener } from '@material/base/types';
885 /**
886 * Defines the shape of the adapter expected by the foundation.
887 * Implement this adapter for your framework of choice to delegate updates to
888 * the component in your framework of choice. See architecture documentation
889 * for more details.
890 * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
891 */
892 export interface MDCSelectIconAdapter {
893 /**
894 * Gets the value of an attribute on the icon element.
895 */
896 getAttr(attr: string): string | null;
897 /**
898 * Sets an attribute on the icon element.
899 */
900 setAttr(attr: string, value: string): void;
901 /**
902 * Removes an attribute from the icon element.
903 */
904 removeAttr(attr: string): void;
905 /**
906 * Sets the text content of the icon element.
907 */
908 setContent(content: string): void;
909 /**
910 * Registers an event listener on the icon element for a given event.
911 */
912 registerInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
913 /**
914 * Deregisters an event listener on the icon element for a given event.
915 */
916 deregisterInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
917 /**
918 * Emits a custom event "MDCSelect:icon" denoting a user has clicked the icon.
919 */
920 notifyIconAction(): void;
921 }
922}
923
924declare module '@material/select/icon/constants' {
925 /**
926 * @license
927 * Copyright 2018 Google Inc.
928 *
929 * Permission is hereby granted, free of charge, to any person obtaining a copy
930 * of this software and associated documentation files (the "Software"), to deal
931 * in the Software without restriction, including without limitation the rights
932 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
933 * copies of the Software, and to permit persons to whom the Software is
934 * furnished to do so, subject to the following conditions:
935 *
936 * The above copyright notice and this permission notice shall be included in
937 * all copies or substantial portions of the Software.
938 *
939 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
940 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
941 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
942 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
943 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
944 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
945 * THE SOFTWARE.
946 */
947 const strings: {
948 ICON_EVENT: string;
949 ICON_ROLE: string;
950 };
951 export { strings };
952}
953