1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import '@material/mwc-notched-outline/mwc-notched-outline.js';
|
7 | import { MDCFloatingLabelFoundation } from '@material/floating-label/foundation.js';
|
8 | import { MDCLineRippleFoundation } from '@material/line-ripple/foundation.js';
|
9 | import { FormElement } from '@material/mwc-base/form-element.js';
|
10 | import { FloatingLabel } from '@material/mwc-floating-label/mwc-floating-label-directive.js';
|
11 | import { LineRipple } from '@material/mwc-line-ripple/mwc-line-ripple-directive.js';
|
12 | import { NotchedOutline } from '@material/mwc-notched-outline/mwc-notched-outline.js';
|
13 | import { MDCTextFieldAdapter, MDCTextFieldInputAdapter, MDCTextFieldLabelAdapter, MDCTextFieldLineRippleAdapter, MDCTextFieldOutlineAdapter, MDCTextFieldRootAdapter } from '@material/textfield/adapter.js';
|
14 | import MDCTextFieldFoundation from '@material/textfield/foundation.js';
|
15 | import { PropertyValues, TemplateResult } from 'lit';
|
16 | declare global {
|
17 | interface HTMLElement {
|
18 | floatingLabelFoundation?: MDCFloatingLabelFoundation;
|
19 | lineRippleFoundation?: MDCLineRippleFoundation;
|
20 | }
|
21 | interface Element {
|
22 | floatingLabelFoundation?: MDCFloatingLabelFoundation;
|
23 | lineRippleFoundation?: MDCLineRippleFoundation;
|
24 | }
|
25 | }
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export declare type TextFieldType = 'text' | 'search' | 'tel' | 'url' | 'email' | 'password' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'color';
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export declare type TextFieldInputMode = 'verbatim' | 'latin' | 'latin-name' | 'latin-prose' | 'full-width-latin' | 'kana' | 'kana-name' | 'katakana' | 'numeric' | 'tel' | 'email' | 'url';
|
36 | export declare type TextAreaCharCounter = 'external' | 'internal';
|
37 |
|
38 | export declare abstract class TextFieldBase extends FormElement {
|
39 | protected mdcFoundation: MDCTextFieldFoundation;
|
40 | protected readonly mdcFoundationClass: typeof MDCTextFieldFoundation;
|
41 | protected mdcRoot: HTMLElement;
|
42 | protected formElement: HTMLInputElement;
|
43 | protected labelElement: FloatingLabel | null;
|
44 | protected lineRippleElement: LineRipple | null;
|
45 | protected outlineElement: NotchedOutline | null;
|
46 | protected notchElement: HTMLElement;
|
47 | value: string;
|
48 | type: TextFieldType;
|
49 | placeholder: string;
|
50 | label: string;
|
51 | icon: string;
|
52 | iconTrailing: string;
|
53 | disabled: boolean;
|
54 | required: boolean;
|
55 | minLength: number;
|
56 | maxLength: number;
|
57 | outlined: boolean;
|
58 | helper: string;
|
59 | validateOnInitialRender: boolean;
|
60 | validationMessage: string;
|
61 | autoValidate: boolean;
|
62 | pattern: string;
|
63 | min: number | string;
|
64 | max: number | string;
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | step: number | 'any' | null;
|
72 | size: number | null;
|
73 | helperPersistent: boolean;
|
74 | charCounter: boolean | TextAreaCharCounter;
|
75 | endAligned: boolean;
|
76 | prefix: string;
|
77 | suffix: string;
|
78 | name: string;
|
79 | inputMode: TextFieldInputMode;
|
80 | readOnly: boolean;
|
81 | autocapitalize: string;
|
82 | protected outlineOpen: boolean;
|
83 | protected outlineWidth: number;
|
84 | protected isUiValid: boolean;
|
85 | protected focused: boolean;
|
86 | protected _validity: ValidityState;
|
87 | get validity(): ValidityState;
|
88 | get willValidate(): boolean;
|
89 | get selectionStart(): number | null;
|
90 | get selectionEnd(): number | null;
|
91 | validityTransform: ((value: string, nativeValidity: ValidityState) => Partial<ValidityState>) | null;
|
92 | focus(): void;
|
93 | blur(): void;
|
94 | select(): void;
|
95 | setSelectionRange(selectionStart: number, selectionEnd: number, selectionDirection?: 'forward' | 'backward' | 'none'): void;
|
96 | update(changedProperties: PropertyValues): void;
|
97 | protected setFormData(formData: FormData): void;
|
98 | /** @soyTemplate */
|
99 | render(): TemplateResult;
|
100 | updated(changedProperties: PropertyValues): void;
|
101 | /** @soyTemplate */
|
102 | protected renderRipple(): TemplateResult | string;
|
103 | /** @soyTemplate */
|
104 | protected renderOutline(): TemplateResult | string;
|
105 | /** @soyTemplate */
|
106 | protected renderLabel(): TemplateResult | string;
|
107 | /** @soyTemplate */
|
108 | protected renderLeadingIcon(): TemplateResult | string;
|
109 | /** @soyTemplate */
|
110 | protected renderTrailingIcon(): TemplateResult | string;
|
111 | /** @soyTemplate */
|
112 | protected renderIcon(icon: string, isTrailingIcon?: boolean): TemplateResult;
|
113 | /** @soyTemplate */
|
114 | protected renderPrefix(): TemplateResult | string;
|
115 | /** @soyTemplate */
|
116 | protected renderSuffix(): TemplateResult | string;
|
117 | /** @soyTemplate */
|
118 | protected renderAffix(content: string, isSuffix?: boolean): TemplateResult | string;
|
119 | /** @soyTemplate */
|
120 | protected renderInput(shouldRenderHelperText: boolean): TemplateResult;
|
121 | /** @soyTemplate */
|
122 | protected renderLineRipple(): TemplateResult | string;
|
123 | /** @soyTemplate */
|
124 | protected renderHelperText(shouldRenderHelperText: boolean, shouldRenderCharCounter: boolean): TemplateResult | string;
|
125 | /** @soyTemplate */
|
126 | protected renderCharCounter(shouldRenderCharCounter: boolean): TemplateResult | string;
|
127 | protected onInputFocus(): void;
|
128 | protected onInputBlur(): void;
|
129 | checkValidity(): boolean;
|
130 | reportValidity(): boolean;
|
131 | protected _checkValidity(value: string): boolean;
|
132 | setCustomValidity(message: string): void;
|
133 | protected handleInputChange(): void;
|
134 | protected createAdapter(): MDCTextFieldAdapter;
|
135 | protected getRootAdapterMethods(): MDCTextFieldRootAdapter;
|
136 | protected getInputAdapterMethods(): MDCTextFieldInputAdapter;
|
137 | protected getLabelAdapterMethods(): MDCTextFieldLabelAdapter;
|
138 | protected getLineRippleAdapterMethods(): MDCTextFieldLineRippleAdapter;
|
139 | protected getUpdateComplete(): Promise<boolean>;
|
140 | firstUpdated(): void;
|
141 | protected getOutlineAdapterMethods(): MDCTextFieldOutlineAdapter;
|
142 | layout(): Promise<void>;
|
143 | }
|
144 |
|
\ | No newline at end of file |