|
113 | 113 | {updateInvalid}
|
114 | 114 | on:blur={() => (focused = false)}
|
115 | 115 | on:focus={() => (focused = true)}
|
116 |
| - on:blur |
117 |
| - on:focus |
| 116 | + on:blur={(event) => dispatch(element, 'blur', event)} |
| 117 | + on:focus={(event) => dispatch(element, 'focus', event)} |
118 | 118 | aria-controls={helperId}
|
119 | 119 | aria-describedby={helperId}
|
120 | 120 | {...prefixFilter($$restProps, 'input$')}
|
|
138 | 138 | {updateInvalid}
|
139 | 139 | on:blur={() => (focused = false)}
|
140 | 140 | on:focus={() => (focused = true)}
|
141 |
| - on:blur |
142 |
| - on:focus |
| 141 | + on:blur={(event) => dispatch(element, 'blur', event)} |
| 142 | + on:focus={(event) => dispatch(element, 'focus', event)} |
143 | 143 | aria-controls={helperId}
|
144 | 144 | aria-describedby={helperId}
|
145 | 145 | {...noLabel && label != null ? { placeholder: label } : {}}
|
|
250 | 250 | prefixFilter,
|
251 | 251 | useActions,
|
252 | 252 | ActionArray,
|
| 253 | + dispatch, |
253 | 254 | } from '@smui/common/internal/index.js';
|
254 | 255 | import { ContextFragment } from '@smui/common';
|
255 | 256 | import Ripple from '@smui/ripple';
|
|
289 | 290 | export let type = 'text';
|
290 | 291 |
|
291 | 292 | // Some trickery to detect uninitialized values but also have the right types.
|
292 |
| - export let value: |
293 |
| - | string |
294 |
| - | number |
295 |
| - | null |
296 |
| - | undefined = (uninitializedValue as unknown) as undefined; |
297 |
| - export let files: FileList | null = (uninitializedValue as unknown) as null; |
| 293 | + export let value: string | number | null | undefined = |
| 294 | + uninitializedValue as unknown as undefined; |
| 295 | + export let files: FileList | null = uninitializedValue as unknown as null; |
298 | 296 | const valued = !isUninitializedValue(value) || !isUninitializedValue(files);
|
299 | 297 | if (isUninitializedValue(value)) {
|
300 | 298 | value = undefined;
|
|
303 | 301 | files = null;
|
304 | 302 | }
|
305 | 303 |
|
306 |
| - export let invalid: boolean = (uninitializedValue as unknown) as boolean; |
| 304 | + export let invalid: boolean = uninitializedValue as unknown as boolean; |
307 | 305 | export let updateInvalid: boolean = isUninitializedValue(invalid);
|
308 | 306 | if (isUninitializedValue(invalid)) {
|
309 | 307 | invalid = false;
|
|
313 | 311 | export let dirty = false;
|
314 | 312 | export let prefix: string | undefined = undefined;
|
315 | 313 | export let suffix: string | undefined = undefined;
|
316 |
| - export let validateOnValueChange: |
317 |
| - | UninitializedValue |
318 |
| - | boolean = updateInvalid; |
| 314 | + export let validateOnValueChange: UninitializedValue | boolean = |
| 315 | + updateInvalid; |
319 | 316 | export let useNativeValidation: UninitializedValue | boolean = updateInvalid;
|
320 | 317 | export let withLeadingIcon: UninitializedValue | boolean = uninitializedValue;
|
321 |
| - export let withTrailingIcon: |
322 |
| - | UninitializedValue |
323 |
| - | boolean = uninitializedValue; |
| 318 | + export let withTrailingIcon: UninitializedValue | boolean = |
| 319 | + uninitializedValue; |
324 | 320 |
|
325 | 321 | // Components
|
326 | 322 | export let input: Input | Textarea | undefined = undefined;
|
|
346 | 342 | let leadingIcon: MDCTextFieldIconFoundation | undefined = undefined;
|
347 | 343 | let trailingIcon: MDCTextFieldIconFoundation | undefined = undefined;
|
348 | 344 | let helperText: MDCTextFieldHelperTextFoundation | undefined = undefined;
|
349 |
| - let characterCounter: |
350 |
| - | MDCTextFieldCharacterCounterFoundation |
351 |
| - | undefined = undefined; |
| 345 | + let characterCounter: MDCTextFieldCharacterCounterFoundation | undefined = |
| 346 | + undefined; |
352 | 347 |
|
353 | 348 | $: inputElement = input && input.getElement();
|
354 | 349 |
|
|
0 commit comments