UNPKG

3.65 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 { MDCSelectHelperTextAdapter } from './adapter';
25export declare class MDCSelectHelperTextFoundation extends MDCFoundation<MDCSelectHelperTextAdapter> {
26 static get cssClasses(): {
27 HELPER_TEXT_VALIDATION_MSG: string;
28 HELPER_TEXT_VALIDATION_MSG_PERSISTENT: string;
29 };
30 static get strings(): {
31 ARIA_HIDDEN: string;
32 ROLE: string;
33 };
34 /**
35 * See {@link MDCSelectHelperTextAdapter} for typing information on parameters and return types.
36 */
37 static get defaultAdapter(): MDCSelectHelperTextAdapter;
38 constructor(adapter?: Partial<MDCSelectHelperTextAdapter>);
39 /**
40 * @return The ID of the helper text, or null if none is set.
41 */
42 getId(): string | null;
43 /**
44 * @return Whether the helper text is currently visible.
45 */
46 isVisible(): boolean;
47 /**
48 * Sets the content of the helper text field.
49 */
50 setContent(content: string): void;
51 /**
52 * Sets the helper text to act as a validation message.
53 * By default, validation messages are hidden when the select is valid and
54 * visible when the select is invalid.
55 *
56 * @param isValidation True to make the helper text act as an error validation
57 * message.
58 */
59 setValidation(isValidation: boolean): void;
60 /**
61 * Sets the persistency of the validation helper text.
62 * This keeps the validation message visible even if the select is valid,
63 * though it will be displayed in the normal (grey) color.
64 */
65 setValidationMsgPersistent(isPersistent: boolean): void;
66 /**
67 * @return Whether the helper text acts as a validation message.
68 * By default, validation messages are hidden when the select is valid and
69 * visible when the select is invalid.
70 */
71 getIsValidation(): boolean;
72 /**
73 * @return Whether the validation helper text persists even if the input is
74 * valid. If it is, it will be displayed in the normal (grey) color.
75 */
76 getIsValidationMsgPersistent(): boolean;
77 /**
78 * When acting as a validation message, shows/hides the helper text and
79 * triggers alerts as necessary based on the select's validity.
80 */
81 setValidity(selectIsValid: boolean): void;
82 /**
83 * Makes the helper text visible to screen readers.
84 */
85 private showToScreenReader;
86 /**
87 * Hides the help text from screen readers.
88 */
89 private hide;
90}
91export default MDCSelectHelperTextFoundation;