1 | // Generated by dts-bundle v0.7.3
|
2 | // Dependencies for this module:
|
3 | // ../../@material/base/types
|
4 | // ../../@material/base/component
|
5 | // ../../@material/floating-label/component
|
6 | // ../../@material/line-ripple/component
|
7 | // ../../@material/notched-outline/component
|
8 | // ../../@material/ripple/component
|
9 | // ../../@material/ripple/types
|
10 | // ../../@material/base/foundation
|
11 |
|
12 | declare module '@material/textfield' {
|
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/textfield/adapter';
|
36 | export * from '@material/textfield/component';
|
37 | export * from '@material/textfield/constants';
|
38 | export * from '@material/textfield/foundation';
|
39 | export * from '@material/textfield/types';
|
40 | export * from '@material/textfield/character-counter/index';
|
41 | export * from '@material/textfield/helper-text/index';
|
42 | export * from '@material/textfield/icon/index';
|
43 | }
|
44 |
|
45 | declare module '@material/textfield/adapter' {
|
46 | /**
|
47 | * @license
|
48 | * Copyright 2017 Google Inc.
|
49 | *
|
50 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
51 | * of this software and associated documentation files (the "Software"), to deal
|
52 | * in the Software without restriction, including without limitation the rights
|
53 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
54 | * copies of the Software, and to permit persons to whom the Software is
|
55 | * furnished to do so, subject to the following conditions:
|
56 | *
|
57 | * The above copyright notice and this permission notice shall be included in
|
58 | * all copies or substantial portions of the Software.
|
59 | *
|
60 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
61 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
62 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
63 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
64 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
65 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
66 | * THE SOFTWARE.
|
67 | */
|
68 | import { EventType, SpecificEventListener } from '@material/base/types';
|
69 | import { MDCTextFieldNativeInputElement } from '@material/textfield/types';
|
70 | /**
|
71 | * Defines the shape of the adapter expected by the foundation.
|
72 | * Implement this adapter for your framework of choice to delegate updates to
|
73 | * the component in your framework of choice. See architecture documentation
|
74 | * for more details.
|
75 | * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
|
76 | */
|
77 | export interface MDCTextFieldAdapter extends MDCTextFieldRootAdapter, MDCTextFieldInputAdapter, MDCTextFieldLabelAdapter, MDCTextFieldLineRippleAdapter, MDCTextFieldOutlineAdapter {
|
78 | }
|
79 | export interface MDCTextFieldRootAdapter {
|
80 | /**
|
81 | * Adds a class to the root Element.
|
82 | */
|
83 | addClass(className: string): void;
|
84 | /**
|
85 | * Removes a class from the root Element.
|
86 | */
|
87 | removeClass(className: string): void;
|
88 | /**
|
89 | * @return true if the root element contains the given class name.
|
90 | */
|
91 | hasClass(className: string): boolean;
|
92 | /**
|
93 | * Registers an event handler on the root element for a given event.
|
94 | */
|
95 | registerTextFieldInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
96 | /**
|
97 | * Deregisters an event handler on the root element for a given event.
|
98 | */
|
99 | deregisterTextFieldInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
100 | /**
|
101 | * Registers a validation attribute change listener on the input element.
|
102 | * Handler accepts list of attribute names.
|
103 | */
|
104 | registerValidationAttributeChangeHandler(handler: (attributeNames: string[]) => void): MutationObserver;
|
105 | /**
|
106 | * Disconnects a validation attribute observer on the input element.
|
107 | */
|
108 | deregisterValidationAttributeChangeHandler(observer: MutationObserver): void;
|
109 | }
|
110 | export interface MDCTextFieldInputAdapter {
|
111 | /**
|
112 | * @return The native `<input>` element, or an object with the same shape.
|
113 | * Note that this method can return null, which the foundation will handle gracefully.
|
114 | */
|
115 | getNativeInput(): MDCTextFieldNativeInputElement | null;
|
116 | /**
|
117 | * Sets the specified attribute to the specified value on the input element.
|
118 | */
|
119 | setInputAttr(attr: string, value: string): void;
|
120 | /**
|
121 | * Removes the specified attribute from the input element.
|
122 | */
|
123 | removeInputAttr(attr: string): void;
|
124 | /**
|
125 | * @return true if the textfield is focused. We achieve this via `document.activeElement === this.root`.
|
126 | */
|
127 | isFocused(): boolean;
|
128 | /**
|
129 | * Registers an event listener on the native input element for a given event.
|
130 | */
|
131 | registerInputInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
132 | /**
|
133 | * Deregisters an event listener on the native input element for a given event.
|
134 | */
|
135 | deregisterInputInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
136 | }
|
137 | export interface MDCTextFieldLabelAdapter {
|
138 | /**
|
139 | * Only implement if label exists.
|
140 | * Shakes label if shouldShake is true.
|
141 | */
|
142 | shakeLabel(shouldShake: boolean): void;
|
143 | /**
|
144 | * Only implement if label exists.
|
145 | * Floats the label above the input element if shouldFloat is true.
|
146 | */
|
147 | floatLabel(shouldFloat: boolean): void;
|
148 | /**
|
149 | * @return true if label element exists, false if it doesn't.
|
150 | */
|
151 | hasLabel(): boolean;
|
152 | /**
|
153 | * Only implement if label exists.
|
154 | * @return width of label in pixels.
|
155 | */
|
156 | getLabelWidth(): number;
|
157 | /**
|
158 | * Only implement if label exists.
|
159 | * Styles the label as required.
|
160 | */
|
161 | setLabelRequired(isRequired: boolean): void;
|
162 | }
|
163 | export interface MDCTextFieldLineRippleAdapter {
|
164 | /**
|
165 | * Activates the line ripple.
|
166 | */
|
167 | activateLineRipple(): void;
|
168 | /**
|
169 | * Deactivates the line ripple.
|
170 | */
|
171 | deactivateLineRipple(): void;
|
172 | /**
|
173 | * Sets the transform origin of the line ripple.
|
174 | */
|
175 | setLineRippleTransformOrigin(normalizedX: number): void;
|
176 | }
|
177 | export interface MDCTextFieldOutlineAdapter {
|
178 | /**
|
179 | * @return true if outline element exists, false if it doesn't.
|
180 | */
|
181 | hasOutline(): boolean;
|
182 | /**
|
183 | * Only implement if outline element exists.
|
184 | */
|
185 | notchOutline(labelWidth: number): void;
|
186 | /**
|
187 | * Only implement if outline element exists.
|
188 | * Closes notch in outline element.
|
189 | */
|
190 | closeOutline(): void;
|
191 | }
|
192 | }
|
193 |
|
194 | declare module '@material/textfield/component' {
|
195 | /**
|
196 | * @license
|
197 | * Copyright 2016 Google Inc.
|
198 | *
|
199 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
200 | * of this software and associated documentation files (the "Software"), to deal
|
201 | * in the Software without restriction, including without limitation the rights
|
202 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
203 | * copies of the Software, and to permit persons to whom the Software is
|
204 | * furnished to do so, subject to the following conditions:
|
205 | *
|
206 | * The above copyright notice and this permission notice shall be included in
|
207 | * all copies or substantial portions of the Software.
|
208 | *
|
209 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
210 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
211 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
212 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
213 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
214 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
215 | * THE SOFTWARE.
|
216 | */
|
217 | import { MDCComponent } from '@material/base/component';
|
218 | import { MDCFloatingLabelFactory } from '@material/floating-label/component';
|
219 | import { MDCLineRippleFactory } from '@material/line-ripple/component';
|
220 | import { MDCNotchedOutlineFactory } from '@material/notched-outline/component';
|
221 | import { MDCRipple, MDCRippleFactory } from '@material/ripple/component';
|
222 | import { MDCRippleCapableSurface } from '@material/ripple/types';
|
223 | import { MDCTextFieldCharacterCounterFactory } from '@material/textfield/character-counter/component';
|
224 | import { MDCTextFieldFoundation } from '@material/textfield/foundation';
|
225 | import { MDCTextFieldHelperTextFactory } from '@material/textfield/helper-text/component';
|
226 | import { MDCTextFieldIconFactory } from '@material/textfield/icon/component';
|
227 | export class MDCTextField extends MDCComponent<MDCTextFieldFoundation> implements MDCRippleCapableSurface {
|
228 | static attachTo(root: Element): MDCTextField;
|
229 | ripple: MDCRipple | null;
|
230 | initialize(rippleFactory?: MDCRippleFactory, lineRippleFactory?: MDCLineRippleFactory, helperTextFactory?: MDCTextFieldHelperTextFactory, characterCounterFactory?: MDCTextFieldCharacterCounterFactory, iconFactory?: MDCTextFieldIconFactory, labelFactory?: MDCFloatingLabelFactory, outlineFactory?: MDCNotchedOutlineFactory): void;
|
231 | destroy(): void;
|
232 | /**
|
233 | * Initializes the Text Field's internal state based on the environment's
|
234 | * state.
|
235 | */
|
236 | initialSyncWithDOM(): void;
|
237 | get value(): string;
|
238 | /**
|
239 | * @param value The value to set on the input.
|
240 | */
|
241 | set value(value: string);
|
242 | get disabled(): boolean;
|
243 | /**
|
244 | * @param disabled Sets the Text Field disabled or enabled.
|
245 | */
|
246 | set disabled(disabled: boolean);
|
247 | get valid(): boolean;
|
248 | /**
|
249 | * @param valid Sets the Text Field valid or invalid.
|
250 | */
|
251 | set valid(valid: boolean);
|
252 | get required(): boolean;
|
253 | /**
|
254 | * @param required Sets the Text Field to required.
|
255 | */
|
256 | set required(required: boolean);
|
257 | get pattern(): string;
|
258 | /**
|
259 | * @param pattern Sets the input element's validation pattern.
|
260 | */
|
261 | set pattern(pattern: string);
|
262 | get minLength(): number;
|
263 | /**
|
264 | * @param minLength Sets the input element's minLength.
|
265 | */
|
266 | set minLength(minLength: number);
|
267 | get maxLength(): number;
|
268 | /**
|
269 | * @param maxLength Sets the input element's maxLength.
|
270 | */
|
271 | set maxLength(maxLength: number);
|
272 | get min(): string;
|
273 | /**
|
274 | * @param min Sets the input element's min.
|
275 | */
|
276 | set min(min: string);
|
277 | get max(): string;
|
278 | /**
|
279 | * @param max Sets the input element's max.
|
280 | */
|
281 | set max(max: string);
|
282 | get step(): string;
|
283 | /**
|
284 | * @param step Sets the input element's step.
|
285 | */
|
286 | set step(step: string);
|
287 | /**
|
288 | * Sets the helper text element content.
|
289 | */
|
290 | set helperTextContent(content: string);
|
291 | /**
|
292 | * Sets the aria label of the leading icon.
|
293 | */
|
294 | set leadingIconAriaLabel(label: string);
|
295 | /**
|
296 | * Sets the text content of the leading icon.
|
297 | */
|
298 | set leadingIconContent(content: string);
|
299 | /**
|
300 | * Sets the aria label of the trailing icon.
|
301 | */
|
302 | set trailingIconAriaLabel(label: string);
|
303 | /**
|
304 | * Sets the text content of the trailing icon.
|
305 | */
|
306 | set trailingIconContent(content: string);
|
307 | /**
|
308 | * Enables or disables the use of native validation. Use this for custom validation.
|
309 | * @param useNativeValidation Set this to false to ignore native input validation.
|
310 | */
|
311 | set useNativeValidation(useNativeValidation: boolean);
|
312 | /**
|
313 | * Gets the text content of the prefix, or null if it does not exist.
|
314 | */
|
315 | get prefixText(): string | null;
|
316 | /**
|
317 | * Sets the text content of the prefix, if it exists.
|
318 | */
|
319 | set prefixText(prefixText: string | null);
|
320 | /**
|
321 | * Gets the text content of the suffix, or null if it does not exist.
|
322 | */
|
323 | get suffixText(): string | null;
|
324 | /**
|
325 | * Sets the text content of the suffix, if it exists.
|
326 | */
|
327 | set suffixText(suffixText: string | null);
|
328 | /**
|
329 | * Focuses the input element.
|
330 | */
|
331 | focus(): void;
|
332 | /**
|
333 | * Recomputes the outline SVG path for the outline element.
|
334 | */
|
335 | layout(): void;
|
336 | getDefaultFoundation(): MDCTextFieldFoundation;
|
337 | }
|
338 | }
|
339 |
|
340 | declare module '@material/textfield/constants' {
|
341 | /**
|
342 | * @license
|
343 | * Copyright 2016 Google Inc.
|
344 | *
|
345 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
346 | * of this software and associated documentation files (the "Software"), to deal
|
347 | * in the Software without restriction, including without limitation the rights
|
348 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
349 | * copies of the Software, and to permit persons to whom the Software is
|
350 | * furnished to do so, subject to the following conditions:
|
351 | *
|
352 | * The above copyright notice and this permission notice shall be included in
|
353 | * all copies or substantial portions of the Software.
|
354 | *
|
355 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
356 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
357 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
358 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
359 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
360 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
361 | * THE SOFTWARE.
|
362 | */
|
363 | const strings: {
|
364 | ARIA_CONTROLS: string;
|
365 | ARIA_DESCRIBEDBY: string;
|
366 | INPUT_SELECTOR: string;
|
367 | LABEL_SELECTOR: string;
|
368 | LEADING_ICON_SELECTOR: string;
|
369 | LINE_RIPPLE_SELECTOR: string;
|
370 | OUTLINE_SELECTOR: string;
|
371 | PREFIX_SELECTOR: string;
|
372 | SUFFIX_SELECTOR: string;
|
373 | TRAILING_ICON_SELECTOR: string;
|
374 | };
|
375 | const cssClasses: {
|
376 | DISABLED: string;
|
377 | FOCUSED: string;
|
378 | HELPER_LINE: string;
|
379 | INVALID: string;
|
380 | LABEL_FLOATING: string;
|
381 | NO_LABEL: string;
|
382 | OUTLINED: string;
|
383 | ROOT: string;
|
384 | TEXTAREA: string;
|
385 | WITH_LEADING_ICON: string;
|
386 | WITH_TRAILING_ICON: string;
|
387 | };
|
388 | const numbers: {
|
389 | LABEL_SCALE: number;
|
390 | };
|
391 | /**
|
392 | * Whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
|
393 | * under the "Validation-related attributes" section.
|
394 | */
|
395 | const VALIDATION_ATTR_WHITELIST: string[];
|
396 | /**
|
397 | * Label should always float for these types as they show some UI even if value is empty.
|
398 | */
|
399 | const ALWAYS_FLOAT_TYPES: string[];
|
400 | export { cssClasses, strings, numbers, VALIDATION_ATTR_WHITELIST, ALWAYS_FLOAT_TYPES };
|
401 | }
|
402 |
|
403 | declare module '@material/textfield/foundation' {
|
404 | /**
|
405 | * @license
|
406 | * Copyright 2016 Google Inc.
|
407 | *
|
408 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
409 | * of this software and associated documentation files (the "Software"), to deal
|
410 | * in the Software without restriction, including without limitation the rights
|
411 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
412 | * copies of the Software, and to permit persons to whom the Software is
|
413 | * furnished to do so, subject to the following conditions:
|
414 | *
|
415 | * The above copyright notice and this permission notice shall be included in
|
416 | * all copies or substantial portions of the Software.
|
417 | *
|
418 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
419 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
420 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
421 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
422 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
423 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
424 | * THE SOFTWARE.
|
425 | */
|
426 | import { MDCFoundation } from '@material/base/foundation';
|
427 | import { MDCTextFieldAdapter } from '@material/textfield/adapter';
|
428 | import { MDCTextFieldFoundationMap } from '@material/textfield/types';
|
429 | export class MDCTextFieldFoundation extends MDCFoundation<MDCTextFieldAdapter> {
|
430 | static get cssClasses(): {
|
431 | DISABLED: string;
|
432 | FOCUSED: string;
|
433 | HELPER_LINE: string;
|
434 | INVALID: string;
|
435 | LABEL_FLOATING: string;
|
436 | NO_LABEL: string;
|
437 | OUTLINED: string;
|
438 | ROOT: string;
|
439 | TEXTAREA: string;
|
440 | WITH_LEADING_ICON: string;
|
441 | WITH_TRAILING_ICON: string;
|
442 | };
|
443 | static get strings(): {
|
444 | ARIA_CONTROLS: string;
|
445 | ARIA_DESCRIBEDBY: string;
|
446 | INPUT_SELECTOR: string;
|
447 | LABEL_SELECTOR: string;
|
448 | LEADING_ICON_SELECTOR: string;
|
449 | LINE_RIPPLE_SELECTOR: string;
|
450 | OUTLINE_SELECTOR: string;
|
451 | PREFIX_SELECTOR: string;
|
452 | SUFFIX_SELECTOR: string;
|
453 | TRAILING_ICON_SELECTOR: string;
|
454 | };
|
455 | static get numbers(): {
|
456 | LABEL_SCALE: number;
|
457 | };
|
458 | get shouldFloat(): boolean;
|
459 | get shouldShake(): boolean;
|
460 | /**
|
461 | * See {@link MDCTextFieldAdapter} for typing information on parameters and
|
462 | * return types.
|
463 | */
|
464 | static get defaultAdapter(): MDCTextFieldAdapter;
|
465 | /**
|
466 | * @param adapter
|
467 | * @param foundationMap Map from subcomponent names to their subfoundations.
|
468 | */
|
469 | constructor(adapter?: Partial<MDCTextFieldAdapter>, foundationMap?: Partial<MDCTextFieldFoundationMap>);
|
470 | init(): void;
|
471 | destroy(): void;
|
472 | /**
|
473 | * Handles user interactions with the Text Field.
|
474 | */
|
475 | handleTextFieldInteraction(): void;
|
476 | /**
|
477 | * Handles validation attribute changes
|
478 | */
|
479 | handleValidationAttributeChange(attributesList: string[]): void;
|
480 | /**
|
481 | * Opens/closes the notched outline.
|
482 | */
|
483 | notchOutline(openNotch: boolean): void;
|
484 | /**
|
485 | * Activates the text field focus state.
|
486 | */
|
487 | activateFocus(): void;
|
488 | /**
|
489 | * Sets the line ripple's transform origin, so that the line ripple activate
|
490 | * animation will animate out from the user's click location.
|
491 | */
|
492 | setTransformOrigin(evt: TouchEvent | MouseEvent): void;
|
493 | /**
|
494 | * Handles input change of text input and text area.
|
495 | */
|
496 | handleInput(): void;
|
497 | /**
|
498 | * Activates the Text Field's focus state in cases when the input value
|
499 | * changes without user input (e.g. programmatically).
|
500 | */
|
501 | autoCompleteFocus(): void;
|
502 | /**
|
503 | * Deactivates the Text Field's focus state.
|
504 | */
|
505 | deactivateFocus(): void;
|
506 | getValue(): string;
|
507 | /**
|
508 | * @param value The value to set on the input Element.
|
509 | */
|
510 | setValue(value: string): void;
|
511 | /**
|
512 | * @return The custom validity state, if set; otherwise, the result of a
|
513 | * native validity check.
|
514 | */
|
515 | isValid(): boolean;
|
516 | /**
|
517 | * @param isValid Sets the custom validity state of the Text Field.
|
518 | */
|
519 | setValid(isValid: boolean): void;
|
520 | /**
|
521 | * @param shouldValidate Whether or not validity should be updated on
|
522 | * value change.
|
523 | */
|
524 | setValidateOnValueChange(shouldValidate: boolean): void;
|
525 | /**
|
526 | * @return Whether or not validity should be updated on value change. `true`
|
527 | * by default.
|
528 | */
|
529 | getValidateOnValueChange(): boolean;
|
530 | /**
|
531 | * Enables or disables the use of native validation. Use this for custom
|
532 | * validation.
|
533 | * @param useNativeValidation Set this to false to ignore native input
|
534 | * validation.
|
535 | */
|
536 | setUseNativeValidation(useNativeValidation: boolean): void;
|
537 | isDisabled(): boolean;
|
538 | /**
|
539 | * @param disabled Sets the text-field disabled or enabled.
|
540 | */
|
541 | setDisabled(disabled: boolean): void;
|
542 | /**
|
543 | * @param content Sets the content of the helper text.
|
544 | */
|
545 | setHelperTextContent(content: string): void;
|
546 | /**
|
547 | * Sets the aria label of the leading icon.
|
548 | */
|
549 | setLeadingIconAriaLabel(label: string): void;
|
550 | /**
|
551 | * Sets the text content of the leading icon.
|
552 | */
|
553 | setLeadingIconContent(content: string): void;
|
554 | /**
|
555 | * Sets the aria label of the trailing icon.
|
556 | */
|
557 | setTrailingIconAriaLabel(label: string): void;
|
558 | /**
|
559 | * Sets the text content of the trailing icon.
|
560 | */
|
561 | setTrailingIconContent(content: string): void;
|
562 | }
|
563 | export default MDCTextFieldFoundation;
|
564 | }
|
565 |
|
566 | declare module '@material/textfield/types' {
|
567 | /**
|
568 | * @license
|
569 | * Copyright 2019 Google Inc.
|
570 | *
|
571 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
572 | * of this software and associated documentation files (the "Software"), to deal
|
573 | * in the Software without restriction, including without limitation the rights
|
574 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
575 | * copies of the Software, and to permit persons to whom the Software is
|
576 | * furnished to do so, subject to the following conditions:
|
577 | *
|
578 | * The above copyright notice and this permission notice shall be included in
|
579 | * all copies or substantial portions of the Software.
|
580 | *
|
581 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
582 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
583 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
584 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
585 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
586 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
587 | * THE SOFTWARE.
|
588 | */
|
589 | import { MDCTextFieldCharacterCounterFoundation } from '@material/textfield/character-counter/foundation';
|
590 | import { MDCTextFieldHelperTextFoundation } from '@material/textfield/helper-text/foundation';
|
591 | import { MDCTextFieldIconFoundation } from '@material/textfield/icon/foundation';
|
592 | export type MDCTextFieldNativeInputElement = Pick<HTMLInputElement, 'disabled' | 'maxLength' | 'type' | 'value' | 'required'> & {
|
593 | validity: Pick<ValidityState, 'badInput' | 'valid'>;
|
594 | };
|
595 | export interface MDCTextFieldFoundationMap {
|
596 | helperText: MDCTextFieldHelperTextFoundation;
|
597 | characterCounter: MDCTextFieldCharacterCounterFoundation;
|
598 | leadingIcon: MDCTextFieldIconFoundation;
|
599 | trailingIcon: MDCTextFieldIconFoundation;
|
600 | }
|
601 | }
|
602 |
|
603 | declare module '@material/textfield/character-counter/index' {
|
604 | /**
|
605 | * @license
|
606 | * Copyright 2019 Google Inc.
|
607 | *
|
608 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
609 | * of this software and associated documentation files (the "Software"), to deal
|
610 | * in the Software without restriction, including without limitation the rights
|
611 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
612 | * copies of the Software, and to permit persons to whom the Software is
|
613 | * furnished to do so, subject to the following conditions:
|
614 | *
|
615 | * The above copyright notice and this permission notice shall be included in
|
616 | * all copies or substantial portions of the Software.
|
617 | *
|
618 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
619 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
620 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
621 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
622 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
623 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
624 | * THE SOFTWARE.
|
625 | */
|
626 | export * from '@material/textfield/character-counter/adapter';
|
627 | export * from '@material/textfield/character-counter/component';
|
628 | export * from '@material/textfield/character-counter/foundation';
|
629 | export { cssClasses as characterCountCssClasses, strings as characterCountStrings } from '@material/textfield/character-counter/constants';
|
630 | }
|
631 |
|
632 | declare module '@material/textfield/helper-text/index' {
|
633 | /**
|
634 | * @license
|
635 | * Copyright 2019 Google Inc.
|
636 | *
|
637 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
638 | * of this software and associated documentation files (the "Software"), to deal
|
639 | * in the Software without restriction, including without limitation the rights
|
640 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
641 | * copies of the Software, and to permit persons to whom the Software is
|
642 | * furnished to do so, subject to the following conditions:
|
643 | *
|
644 | * The above copyright notice and this permission notice shall be included in
|
645 | * all copies or substantial portions of the Software.
|
646 | *
|
647 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
648 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
649 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
650 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
651 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
652 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
653 | * THE SOFTWARE.
|
654 | */
|
655 | export * from '@material/textfield/helper-text/adapter';
|
656 | export * from '@material/textfield/helper-text/component';
|
657 | export * from '@material/textfield/helper-text/foundation';
|
658 | export { cssClasses as helperTextCssClasses, strings as helperTextStrings } from '@material/textfield/helper-text/constants';
|
659 | }
|
660 |
|
661 | declare module '@material/textfield/icon/index' {
|
662 | /**
|
663 | * @license
|
664 | * Copyright 2019 Google Inc.
|
665 | *
|
666 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
667 | * of this software and associated documentation files (the "Software"), to deal
|
668 | * in the Software without restriction, including without limitation the rights
|
669 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
670 | * copies of the Software, and to permit persons to whom the Software is
|
671 | * furnished to do so, subject to the following conditions:
|
672 | *
|
673 | * The above copyright notice and this permission notice shall be included in
|
674 | * all copies or substantial portions of the Software.
|
675 | *
|
676 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
677 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
678 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
679 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
680 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
681 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
682 | * THE SOFTWARE.
|
683 | */
|
684 | export * from '@material/textfield/icon/adapter';
|
685 | export * from '@material/textfield/icon/component';
|
686 | export * from '@material/textfield/icon/foundation';
|
687 | export { cssClasses as iconCssClasses, strings as iconStrings } from '@material/textfield/icon/constants';
|
688 | }
|
689 |
|
690 | declare module '@material/textfield/character-counter/component' {
|
691 | /**
|
692 | * @license
|
693 | * Copyright 2019 Google Inc.
|
694 | *
|
695 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
696 | * of this software and associated documentation files (the "Software"), to deal
|
697 | * in the Software without restriction, including without limitation the rights
|
698 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
699 | * copies of the Software, and to permit persons to whom the Software is
|
700 | * furnished to do so, subject to the following conditions:
|
701 | *
|
702 | * The above copyright notice and this permission notice shall be included in
|
703 | * all copies or substantial portions of the Software.
|
704 | *
|
705 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
706 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
707 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
708 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
709 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
710 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
711 | * THE SOFTWARE.
|
712 | */
|
713 | import { MDCComponent } from '@material/base/component';
|
714 | import { MDCTextFieldCharacterCounterFoundation } from '@material/textfield/character-counter/foundation';
|
715 | export type MDCTextFieldCharacterCounterFactory = (el: Element, foundation?: MDCTextFieldCharacterCounterFoundation) => MDCTextFieldCharacterCounter;
|
716 | export class MDCTextFieldCharacterCounter extends MDCComponent<MDCTextFieldCharacterCounterFoundation> {
|
717 | static attachTo(root: Element): MDCTextFieldCharacterCounter;
|
718 | get foundationForTextField(): MDCTextFieldCharacterCounterFoundation;
|
719 | getDefaultFoundation(): MDCTextFieldCharacterCounterFoundation;
|
720 | }
|
721 | }
|
722 |
|
723 | declare module '@material/textfield/helper-text/component' {
|
724 | /**
|
725 | * @license
|
726 | * Copyright 2017 Google Inc.
|
727 | *
|
728 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
729 | * of this software and associated documentation files (the "Software"), to deal
|
730 | * in the Software without restriction, including without limitation the rights
|
731 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
732 | * copies of the Software, and to permit persons to whom the Software is
|
733 | * furnished to do so, subject to the following conditions:
|
734 | *
|
735 | * The above copyright notice and this permission notice shall be included in
|
736 | * all copies or substantial portions of the Software.
|
737 | *
|
738 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
739 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
740 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
741 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
742 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
743 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
744 | * THE SOFTWARE.
|
745 | */
|
746 | import { MDCComponent } from '@material/base/component';
|
747 | import { MDCTextFieldHelperTextFoundation } from '@material/textfield/helper-text/foundation';
|
748 | export type MDCTextFieldHelperTextFactory = (el: Element, foundation?: MDCTextFieldHelperTextFoundation) => MDCTextFieldHelperText;
|
749 | export class MDCTextFieldHelperText extends MDCComponent<MDCTextFieldHelperTextFoundation> {
|
750 | static attachTo(root: Element): MDCTextFieldHelperText;
|
751 | get foundationForTextField(): MDCTextFieldHelperTextFoundation;
|
752 | getDefaultFoundation(): MDCTextFieldHelperTextFoundation;
|
753 | }
|
754 | }
|
755 |
|
756 | declare module '@material/textfield/icon/component' {
|
757 | /**
|
758 | * @license
|
759 | * Copyright 2017 Google Inc.
|
760 | *
|
761 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
762 | * of this software and associated documentation files (the "Software"), to deal
|
763 | * in the Software without restriction, including without limitation the rights
|
764 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
765 | * copies of the Software, and to permit persons to whom the Software is
|
766 | * furnished to do so, subject to the following conditions:
|
767 | *
|
768 | * The above copyright notice and this permission notice shall be included in
|
769 | * all copies or substantial portions of the Software.
|
770 | *
|
771 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
772 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
773 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
774 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
775 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
776 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
777 | * THE SOFTWARE.
|
778 | */
|
779 | import { MDCComponent } from '@material/base/component';
|
780 | import { MDCTextFieldIconFoundation } from '@material/textfield/icon/foundation';
|
781 | export type MDCTextFieldIconFactory = (el: Element, foundation?: MDCTextFieldIconFoundation) => MDCTextFieldIcon;
|
782 | export class MDCTextFieldIcon extends MDCComponent<MDCTextFieldIconFoundation> {
|
783 | static attachTo(root: Element): MDCTextFieldIcon;
|
784 | get foundationForTextField(): MDCTextFieldIconFoundation;
|
785 | getDefaultFoundation(): MDCTextFieldIconFoundation;
|
786 | }
|
787 | }
|
788 |
|
789 | declare module '@material/textfield/character-counter/foundation' {
|
790 | /**
|
791 | * @license
|
792 | * Copyright 2019 Google Inc.
|
793 | *
|
794 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
795 | * of this software and associated documentation files (the "Software"), to deal
|
796 | * in the Software without restriction, including without limitation the rights
|
797 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
798 | * copies of the Software, and to permit persons to whom the Software is
|
799 | * furnished to do so, subject to the following conditions:
|
800 | *
|
801 | * The above copyright notice and this permission notice shall be included in
|
802 | * all copies or substantial portions of the Software.
|
803 | *
|
804 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
805 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
806 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
807 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
808 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
809 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
810 | * THE SOFTWARE.
|
811 | */
|
812 | import { MDCFoundation } from '@material/base/foundation';
|
813 | import { MDCTextFieldCharacterCounterAdapter } from '@material/textfield/character-counter/adapter';
|
814 | export class MDCTextFieldCharacterCounterFoundation extends MDCFoundation<MDCTextFieldCharacterCounterAdapter> {
|
815 | static get cssClasses(): {
|
816 | ROOT: string;
|
817 | };
|
818 | static get strings(): {
|
819 | ROOT_SELECTOR: string;
|
820 | };
|
821 | /**
|
822 | * See {@link MDCTextFieldCharacterCounterAdapter} for typing information on parameters and return types.
|
823 | */
|
824 | static get defaultAdapter(): MDCTextFieldCharacterCounterAdapter;
|
825 | constructor(adapter?: Partial<MDCTextFieldCharacterCounterAdapter>);
|
826 | setCounterValue(currentLength: number, maxLength: number): void;
|
827 | }
|
828 | export default MDCTextFieldCharacterCounterFoundation;
|
829 | }
|
830 |
|
831 | declare module '@material/textfield/helper-text/foundation' {
|
832 | /**
|
833 | * @license
|
834 | * Copyright 2017 Google Inc.
|
835 | *
|
836 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
837 | * of this software and associated documentation files (the "Software"), to deal
|
838 | * in the Software without restriction, including without limitation the rights
|
839 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
840 | * copies of the Software, and to permit persons to whom the Software is
|
841 | * furnished to do so, subject to the following conditions:
|
842 | *
|
843 | * The above copyright notice and this permission notice shall be included in
|
844 | * all copies or substantial portions of the Software.
|
845 | *
|
846 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
847 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
848 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
849 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
850 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
851 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
852 | * THE SOFTWARE.
|
853 | */
|
854 | import { MDCFoundation } from '@material/base/foundation';
|
855 | import { MDCTextFieldHelperTextAdapter } from '@material/textfield/helper-text/adapter';
|
856 | export class MDCTextFieldHelperTextFoundation extends MDCFoundation<MDCTextFieldHelperTextAdapter> {
|
857 | static get cssClasses(): {
|
858 | HELPER_TEXT_PERSISTENT: string;
|
859 | HELPER_TEXT_VALIDATION_MSG: string;
|
860 | ROOT: string;
|
861 | };
|
862 | static get strings(): {
|
863 | ARIA_HIDDEN: string;
|
864 | ROLE: string;
|
865 | ROOT_SELECTOR: string;
|
866 | };
|
867 | /**
|
868 | * See {@link MDCTextFieldHelperTextAdapter} for typing information on parameters and return types.
|
869 | */
|
870 | static get defaultAdapter(): MDCTextFieldHelperTextAdapter;
|
871 | constructor(adapter?: Partial<MDCTextFieldHelperTextAdapter>);
|
872 | getId(): string | null;
|
873 | isVisible(): boolean;
|
874 | /**
|
875 | * Sets the content of the helper text field.
|
876 | */
|
877 | setContent(content: string): void;
|
878 | isPersistent(): boolean;
|
879 | /**
|
880 | * @param isPersistent Sets the persistency of the helper text.
|
881 | */
|
882 | setPersistent(isPersistent: boolean): void;
|
883 | /**
|
884 | * @return whether the helper text acts as an error validation message.
|
885 | */
|
886 | isValidation(): boolean;
|
887 | /**
|
888 | * @param isValidation True to make the helper text act as an error validation message.
|
889 | */
|
890 | setValidation(isValidation: boolean): void;
|
891 | /**
|
892 | * Makes the helper text visible to the screen reader.
|
893 | */
|
894 | showToScreenReader(): void;
|
895 | /**
|
896 | * Sets the validity of the helper text based on the input validity.
|
897 | */
|
898 | setValidity(inputIsValid: boolean): void;
|
899 | }
|
900 | export default MDCTextFieldHelperTextFoundation;
|
901 | }
|
902 |
|
903 | declare module '@material/textfield/icon/foundation' {
|
904 | /**
|
905 | * @license
|
906 | * Copyright 2017 Google Inc.
|
907 | *
|
908 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
909 | * of this software and associated documentation files (the "Software"), to deal
|
910 | * in the Software without restriction, including without limitation the rights
|
911 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
912 | * copies of the Software, and to permit persons to whom the Software is
|
913 | * furnished to do so, subject to the following conditions:
|
914 | *
|
915 | * The above copyright notice and this permission notice shall be included in
|
916 | * all copies or substantial portions of the Software.
|
917 | *
|
918 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
919 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
920 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
921 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
922 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
923 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
924 | * THE SOFTWARE.
|
925 | */
|
926 | import { MDCFoundation } from '@material/base/foundation';
|
927 | import { MDCTextFieldIconAdapter } from '@material/textfield/icon/adapter';
|
928 | export class MDCTextFieldIconFoundation extends MDCFoundation<MDCTextFieldIconAdapter> {
|
929 | static get strings(): {
|
930 | ICON_EVENT: string;
|
931 | ICON_ROLE: string;
|
932 | };
|
933 | static get cssClasses(): {
|
934 | ROOT: string;
|
935 | };
|
936 | /**
|
937 | * See {@link MDCTextFieldIconAdapter} for typing information on parameters and return types.
|
938 | */
|
939 | static get defaultAdapter(): MDCTextFieldIconAdapter;
|
940 | constructor(adapter?: Partial<MDCTextFieldIconAdapter>);
|
941 | init(): void;
|
942 | destroy(): void;
|
943 | setDisabled(disabled: boolean): void;
|
944 | setAriaLabel(label: string): void;
|
945 | setContent(content: string): void;
|
946 | handleInteraction(evt: MouseEvent | KeyboardEvent): void;
|
947 | }
|
948 | export default MDCTextFieldIconFoundation;
|
949 | }
|
950 |
|
951 | declare module '@material/textfield/character-counter/adapter' {
|
952 | /**
|
953 | * Defines the shape of the adapter expected by the foundation.
|
954 | * Implement this adapter for your framework of choice to delegate updates to
|
955 | * the component in your framework of choice. See architecture documentation
|
956 | * for more details.
|
957 | * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
|
958 | */
|
959 | export interface MDCTextFieldCharacterCounterAdapter {
|
960 | /**
|
961 | * Sets the text content of character counter element.
|
962 | */
|
963 | setContent(content: string): void;
|
964 | }
|
965 | }
|
966 |
|
967 | declare module '@material/textfield/character-counter/constants' {
|
968 | /**
|
969 | * @license
|
970 | * Copyright 2019 Google Inc.
|
971 | *
|
972 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
973 | * of this software and associated documentation files (the "Software"), to deal
|
974 | * in the Software without restriction, including without limitation the rights
|
975 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
976 | * copies of the Software, and to permit persons to whom the Software is
|
977 | * furnished to do so, subject to the following conditions:
|
978 | *
|
979 | * The above copyright notice and this permission notice shall be included in
|
980 | * all copies or substantial portions of the Software.
|
981 | *
|
982 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
983 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
984 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
985 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
986 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
987 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
988 | * THE SOFTWARE.
|
989 | */
|
990 | const cssClasses: {
|
991 | ROOT: string;
|
992 | };
|
993 | const strings: {
|
994 | ROOT_SELECTOR: string;
|
995 | };
|
996 | export { strings, cssClasses };
|
997 | }
|
998 |
|
999 | declare module '@material/textfield/helper-text/adapter' {
|
1000 | /**
|
1001 | * Defines the shape of the adapter expected by the foundation.
|
1002 | * Implement this adapter for your framework of choice to delegate updates to
|
1003 | * the component in your framework of choice. See architecture documentation
|
1004 | * for more details.
|
1005 | * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
|
1006 | */
|
1007 | export interface MDCTextFieldHelperTextAdapter {
|
1008 | /**
|
1009 | * Adds a class to the helper text element.
|
1010 | */
|
1011 | addClass(className: string): void;
|
1012 | /**
|
1013 | * Removes a class from the helper text element.
|
1014 | */
|
1015 | removeClass(className: string): void;
|
1016 | /**
|
1017 | * Returns whether or not the helper text element contains the given class.
|
1018 | */
|
1019 | hasClass(className: string): boolean;
|
1020 | /**
|
1021 | * @return the specified attribute's value on the helper text element.
|
1022 | */
|
1023 | getAttr(attr: string): string | null;
|
1024 | /**
|
1025 | * Sets an attribute with a given value on the helper text element.
|
1026 | */
|
1027 | setAttr(attr: string, value: string): void;
|
1028 | /**
|
1029 | * Removes an attribute from the helper text element.
|
1030 | */
|
1031 | removeAttr(attr: string): void;
|
1032 | /**
|
1033 | * Sets the text content for the helper text element.
|
1034 | */
|
1035 | setContent(content: string): void;
|
1036 | }
|
1037 | }
|
1038 |
|
1039 | declare module '@material/textfield/helper-text/constants' {
|
1040 | /**
|
1041 | * @license
|
1042 | * Copyright 2016 Google Inc.
|
1043 | *
|
1044 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
1045 | * of this software and associated documentation files (the "Software"), to deal
|
1046 | * in the Software without restriction, including without limitation the rights
|
1047 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1048 | * copies of the Software, and to permit persons to whom the Software is
|
1049 | * furnished to do so, subject to the following conditions:
|
1050 | *
|
1051 | * The above copyright notice and this permission notice shall be included in
|
1052 | * all copies or substantial portions of the Software.
|
1053 | *
|
1054 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1055 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1056 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1057 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1058 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1059 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1060 | * THE SOFTWARE.
|
1061 | */
|
1062 | const cssClasses: {
|
1063 | HELPER_TEXT_PERSISTENT: string;
|
1064 | HELPER_TEXT_VALIDATION_MSG: string;
|
1065 | ROOT: string;
|
1066 | };
|
1067 | const strings: {
|
1068 | ARIA_HIDDEN: string;
|
1069 | ROLE: string;
|
1070 | ROOT_SELECTOR: string;
|
1071 | };
|
1072 | export { strings, cssClasses };
|
1073 | }
|
1074 |
|
1075 | declare module '@material/textfield/icon/adapter' {
|
1076 | /**
|
1077 | * @license
|
1078 | * Copyright 2017 Google Inc.
|
1079 | *
|
1080 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
1081 | * of this software and associated documentation files (the "Software"), to deal
|
1082 | * in the Software without restriction, including without limitation the rights
|
1083 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1084 | * copies of the Software, and to permit persons to whom the Software is
|
1085 | * furnished to do so, subject to the following conditions:
|
1086 | *
|
1087 | * The above copyright notice and this permission notice shall be included in
|
1088 | * all copies or substantial portions of the Software.
|
1089 | *
|
1090 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1091 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1092 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1093 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1094 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1095 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1096 | * THE SOFTWARE.
|
1097 | */
|
1098 | import { EventType, SpecificEventListener } from '@material/base/types';
|
1099 | /**
|
1100 | * Defines the shape of the adapter expected by the foundation.
|
1101 | * Implement this adapter for your framework of choice to delegate updates to
|
1102 | * the component in your framework of choice. See architecture documentation
|
1103 | * for more details.
|
1104 | * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
|
1105 | */
|
1106 | export interface MDCTextFieldIconAdapter {
|
1107 | /**
|
1108 | * Gets the value of an attribute on the icon element.
|
1109 | */
|
1110 | getAttr(attr: string): string | null;
|
1111 | /**
|
1112 | * Sets an attribute on the icon element.
|
1113 | */
|
1114 | setAttr(attr: string, value: string): void;
|
1115 | /**
|
1116 | * Removes an attribute from the icon element.
|
1117 | */
|
1118 | removeAttr(attr: string): void;
|
1119 | /**
|
1120 | * Sets the text content of the icon element.
|
1121 | */
|
1122 | setContent(content: string): void;
|
1123 | /**
|
1124 | * Registers an event listener on the icon element for a given event.
|
1125 | */
|
1126 | registerInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
1127 | /**
|
1128 | * Deregisters an event listener on the icon element for a given event.
|
1129 | */
|
1130 | deregisterInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
|
1131 | /**
|
1132 | * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
|
1133 | */
|
1134 | notifyIconAction(): void;
|
1135 | }
|
1136 | }
|
1137 |
|
1138 | declare module '@material/textfield/icon/constants' {
|
1139 | /**
|
1140 | * @license
|
1141 | * Copyright 2016 Google Inc.
|
1142 | *
|
1143 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
1144 | * of this software and associated documentation files (the "Software"), to deal
|
1145 | * in the Software without restriction, including without limitation the rights
|
1146 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
1147 | * copies of the Software, and to permit persons to whom the Software is
|
1148 | * furnished to do so, subject to the following conditions:
|
1149 | *
|
1150 | * The above copyright notice and this permission notice shall be included in
|
1151 | * all copies or substantial portions of the Software.
|
1152 | *
|
1153 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
1154 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
1155 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1156 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
1157 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
1158 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
1159 | * THE SOFTWARE.
|
1160 | */
|
1161 | const strings: {
|
1162 | ICON_EVENT: string;
|
1163 | ICON_ROLE: string;
|
1164 | };
|
1165 | const cssClasses: {
|
1166 | ROOT: string;
|
1167 | };
|
1168 | export { strings, cssClasses };
|
1169 | }
|
1170 |
|