@material/web 1.0.2-nightly.f7a66a8.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/internal/checkbox.d.ts +1 -0
- package/checkbox/internal/checkbox.js +6 -1
- package/checkbox/internal/checkbox.js.map +1 -1
- package/chips/internal/_shared.scss +16 -3
- package/chips/internal/_trailing-icon.scss +2 -1
- package/chips/internal/assist-styles.css.js +1 -1
- package/chips/internal/assist-styles.css.js.map +1 -1
- package/chips/internal/chip-set.js +2 -6
- package/chips/internal/chip-set.js.map +1 -1
- package/chips/internal/chip.d.ts +8 -0
- package/chips/internal/chip.js +17 -2
- package/chips/internal/chip.js.map +1 -1
- package/chips/internal/filter-chip.d.ts +8 -0
- package/chips/internal/filter-chip.js +17 -4
- package/chips/internal/filter-chip.js.map +1 -1
- package/chips/internal/filter-styles.css.js +1 -1
- package/chips/internal/filter-styles.css.js.map +1 -1
- package/chips/internal/input-styles.css.js +1 -1
- package/chips/internal/input-styles.css.js.map +1 -1
- package/chips/internal/shared-styles.css.js +1 -1
- package/chips/internal/shared-styles.css.js.map +1 -1
- package/chips/internal/suggestion-styles.css.js +1 -1
- package/chips/internal/suggestion-styles.css.js.map +1 -1
- package/chips/internal/trailing-icon-styles.css.js +1 -1
- package/chips/internal/trailing-icon-styles.css.js.map +1 -1
- package/chips/internal/trailing-icons.js +8 -4
- package/chips/internal/trailing-icons.js.map +1 -1
- package/fab/internal/_shared.scss +1 -0
- package/fab/internal/shared-styles.css.js +1 -1
- package/fab/internal/shared-styles.css.js.map +1 -1
- package/field/internal/_content.scss +3 -1
- package/field/internal/shared-styles.css.js +1 -1
- package/field/internal/shared-styles.css.js.map +1 -1
- package/internal/aria/aria.d.ts +0 -29
- package/internal/aria/aria.js +0 -141
- package/internal/aria/aria.js.map +1 -1
- package/internal/controller/form-submitter.js +2 -2
- package/internal/controller/form-submitter.js.map +1 -1
- package/labs/behaviors/constraint-validation.d.ts +2 -2
- package/labs/behaviors/constraint-validation.js +18 -1
- package/labs/behaviors/constraint-validation.js.map +1 -1
- package/labs/behaviors/element-internals.js +1 -5
- package/labs/behaviors/element-internals.js.map +1 -1
- package/labs/behaviors/focusable.js +20 -7
- package/labs/behaviors/focusable.js.map +1 -1
- package/labs/behaviors/on-report-validity.d.ts +70 -0
- package/labs/behaviors/on-report-validity.js +185 -0
- package/labs/behaviors/on-report-validity.js.map +1 -0
- package/labs/behaviors/validators/checkbox-validator.d.ts +6 -3
- package/labs/behaviors/validators/checkbox-validator.js.map +1 -1
- package/labs/behaviors/validators/radio-validator.d.ts +38 -0
- package/labs/behaviors/validators/radio-validator.js +65 -0
- package/labs/behaviors/validators/radio-validator.js.map +1 -0
- package/labs/behaviors/validators/select-validator.d.ts +35 -0
- package/labs/behaviors/validators/select-validator.js +33 -0
- package/labs/behaviors/validators/select-validator.js.map +1 -0
- package/labs/behaviors/validators/text-field-validator.d.ts +110 -0
- package/labs/behaviors/validators/text-field-validator.js +146 -0
- package/labs/behaviors/validators/text-field-validator.js.map +1 -0
- package/labs/behaviors/validators/validator.d.ts +4 -0
- package/labs/behaviors/validators/validator.js.map +1 -1
- package/labs/card/internal/_outlined-card.scss +1 -1
- package/labs/card/internal/_shared.scss +10 -2
- package/labs/card/internal/outlined-styles.css.js +1 -1
- package/labs/card/internal/outlined-styles.css.js.map +1 -1
- package/labs/card/internal/shared-styles.css.js +1 -1
- package/labs/card/internal/shared-styles.css.js.map +1 -1
- package/labs/segmentedbutton/internal/_shared.scss +1 -0
- package/labs/segmentedbutton/internal/shared-styles.css.js +1 -1
- package/labs/segmentedbutton/internal/shared-styles.css.js.map +1 -1
- package/list/internal/list.js +2 -6
- package/list/internal/list.js.map +1 -1
- package/list/internal/listitem/_list-item.scss +2 -0
- package/list/internal/listitem/list-item-styles.css.js +1 -1
- package/list/internal/listitem/list-item-styles.css.js.map +1 -1
- package/menu/internal/controllers/menuItemController.d.ts +13 -1
- package/menu/internal/controllers/menuItemController.js +32 -6
- package/menu/internal/controllers/menuItemController.js.map +1 -1
- package/menu/internal/menu.js +7 -8
- package/menu/internal/menu.js.map +1 -1
- package/menu/internal/menuitem/menu-item.d.ts +2 -0
- package/menu/internal/menuitem/menu-item.js +13 -1
- package/menu/internal/menuitem/menu-item.js.map +1 -1
- package/package.json +1 -1
- package/radio/internal/radio.d.ts +11 -1
- package/radio/internal/radio.js +28 -2
- package/radio/internal/radio.js.map +1 -1
- package/radio/internal/single-selection-controller.d.ts +5 -5
- package/radio/internal/single-selection-controller.js +16 -14
- package/radio/internal/single-selection-controller.js.map +1 -1
- package/select/internal/_shared.scss +5 -0
- package/select/internal/select.d.ts +21 -72
- package/select/internal/select.js +106 -184
- package/select/internal/select.js.map +1 -1
- package/select/internal/selectoption/select-option.d.ts +2 -0
- package/select/internal/selectoption/select-option.js +13 -1
- package/select/internal/selectoption/select-option.js.map +1 -1
- package/select/internal/selectoption/selectOptionController.d.ts +7 -3
- package/select/internal/selectoption/selectOptionController.js +8 -11
- package/select/internal/selectoption/selectOptionController.js.map +1 -1
- package/select/internal/shared-styles.css.js +1 -1
- package/select/internal/shared-styles.css.js.map +1 -1
- package/switch/internal/_icon.scss +14 -10
- package/switch/internal/switch-styles.css.js +1 -1
- package/switch/internal/switch-styles.css.js.map +1 -1
- package/switch/internal/switch.js +12 -8
- package/switch/internal/switch.js.map +1 -1
- package/tabs/internal/tab.js +2 -6
- package/tabs/internal/tab.js.map +1 -1
- package/tabs/internal/tabs.js +2 -6
- package/tabs/internal/tabs.js.map +1 -1
- package/textfield/internal/text-field.d.ts +9 -74
- package/textfield/internal/text-field.js +34 -150
- package/textfield/internal/text-field.js.map +1 -1
- package/tokens/_md-comp-assist-chip.scss +11 -0
- package/tokens/_md-comp-filter-chip.scss +14 -0
- package/tokens/_md-comp-input-chip.scss +14 -0
- package/tokens/_md-comp-suggestion-chip.scss +11 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
|
-
import {
|
|
7
|
+
import { LitElement, html, nothing } from 'lit';
|
|
8
8
|
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
10
|
import { live } from 'lit/directives/live.js';
|
|
@@ -13,10 +13,13 @@ import { html as staticHtml } from 'lit/static-html.js';
|
|
|
13
13
|
import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
|
|
14
14
|
import { redispatchEvent } from '../../internal/controller/events.js';
|
|
15
15
|
import { stringConverter } from '../../internal/controller/string-converter.js';
|
|
16
|
-
import {
|
|
16
|
+
import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../labs/behaviors/constraint-validation.js';
|
|
17
|
+
import { mixinElementInternals } from '../../labs/behaviors/element-internals.js';
|
|
17
18
|
import { getFormValue, mixinFormAssociated, } from '../../labs/behaviors/form-associated.js';
|
|
19
|
+
import { mixinOnReportValidity, onReportValidity, } from '../../labs/behaviors/on-report-validity.js';
|
|
20
|
+
import { TextFieldValidator } from '../../labs/behaviors/validators/text-field-validator.js';
|
|
18
21
|
// Separate variable needed for closure.
|
|
19
|
-
const textFieldBaseClass = mixinFormAssociated(mixinElementInternals(LitElement));
|
|
22
|
+
const textFieldBaseClass = mixinOnReportValidity(mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(LitElement))));
|
|
20
23
|
/**
|
|
21
24
|
* A text field component.
|
|
22
25
|
*
|
|
@@ -189,17 +192,6 @@ export class TextField extends textFieldBaseClass {
|
|
|
189
192
|
* `reportValidity()`.
|
|
190
193
|
*/
|
|
191
194
|
this.nativeErrorText = '';
|
|
192
|
-
this.isCheckingValidity = false;
|
|
193
|
-
this.isReportingValidity = false;
|
|
194
|
-
// Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432
|
|
195
|
-
// Replace with this[internals].validity.customError when resolved.
|
|
196
|
-
this.hasCustomValidityError = false;
|
|
197
|
-
this.onInvalid = (invalidEvent) => {
|
|
198
|
-
if (this.isCheckingValidity || this.isReportingValidity) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
this.showErrorMessage(false, invalidEvent);
|
|
202
|
-
};
|
|
203
195
|
}
|
|
204
196
|
/**
|
|
205
197
|
* Gets or sets the direction in which selection occurred.
|
|
@@ -228,25 +220,6 @@ export class TextField extends textFieldBaseClass {
|
|
|
228
220
|
set selectionStart(value) {
|
|
229
221
|
this.getInputOrTextarea().selectionStart = value;
|
|
230
222
|
}
|
|
231
|
-
/**
|
|
232
|
-
* Returns the text field's validation error message.
|
|
233
|
-
*
|
|
234
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation
|
|
235
|
-
*/
|
|
236
|
-
get validationMessage() {
|
|
237
|
-
this.syncValidity();
|
|
238
|
-
return this[internals].validationMessage;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Returns a `ValidityState` object that represents the validity states of the
|
|
242
|
-
* text field.
|
|
243
|
-
*
|
|
244
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/ValidityState
|
|
245
|
-
*/
|
|
246
|
-
get validity() {
|
|
247
|
-
this.syncValidity();
|
|
248
|
-
return this[internals].validity;
|
|
249
|
-
}
|
|
250
223
|
/**
|
|
251
224
|
* The text field's value as a number.
|
|
252
225
|
*/
|
|
@@ -283,77 +256,9 @@ export class TextField extends textFieldBaseClass {
|
|
|
283
256
|
input.valueAsDate = value;
|
|
284
257
|
this.value = input.value;
|
|
285
258
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Returns whether an element will successfully validate based on forms
|
|
288
|
-
* validation rules and constraints.
|
|
289
|
-
*
|
|
290
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate
|
|
291
|
-
*/
|
|
292
|
-
get willValidate() {
|
|
293
|
-
this.syncValidity();
|
|
294
|
-
return this[internals].willValidate;
|
|
295
|
-
}
|
|
296
259
|
get hasError() {
|
|
297
260
|
return this.error || this.nativeError;
|
|
298
261
|
}
|
|
299
|
-
/**
|
|
300
|
-
* Checks the text field's native validation and returns whether or not the
|
|
301
|
-
* element is valid.
|
|
302
|
-
*
|
|
303
|
-
* If invalid, this method will dispatch the `invalid` event.
|
|
304
|
-
*
|
|
305
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity
|
|
306
|
-
*
|
|
307
|
-
* @return true if the text field is valid, or false if not.
|
|
308
|
-
*/
|
|
309
|
-
checkValidity() {
|
|
310
|
-
this.isCheckingValidity = true;
|
|
311
|
-
this.syncValidity();
|
|
312
|
-
const isValid = this[internals].checkValidity();
|
|
313
|
-
this.isCheckingValidity = false;
|
|
314
|
-
return isValid;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Checks the text field's native validation and returns whether or not the
|
|
318
|
-
* element is valid.
|
|
319
|
-
*
|
|
320
|
-
* If invalid, this method will dispatch the `invalid` event.
|
|
321
|
-
*
|
|
322
|
-
* This method will display or clear an error text message equal to the text
|
|
323
|
-
* field's `validationMessage`, unless the invalid event is canceled.
|
|
324
|
-
*
|
|
325
|
-
* Use `setCustomValidity()` to customize the `validationMessage`.
|
|
326
|
-
*
|
|
327
|
-
* This method can also be used to re-announce error messages to screen
|
|
328
|
-
* readers.
|
|
329
|
-
*
|
|
330
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity
|
|
331
|
-
*
|
|
332
|
-
* @return true if the text field is valid, or false if not.
|
|
333
|
-
*/
|
|
334
|
-
reportValidity() {
|
|
335
|
-
this.isReportingValidity = true;
|
|
336
|
-
let invalidEvent;
|
|
337
|
-
this.addEventListener('invalid', (event) => {
|
|
338
|
-
invalidEvent = event;
|
|
339
|
-
}, { once: true });
|
|
340
|
-
const valid = this.checkValidity();
|
|
341
|
-
this.showErrorMessage(valid, invalidEvent);
|
|
342
|
-
this.isReportingValidity = false;
|
|
343
|
-
return valid;
|
|
344
|
-
}
|
|
345
|
-
showErrorMessage(valid, invalidEvent) {
|
|
346
|
-
if (invalidEvent?.defaultPrevented) {
|
|
347
|
-
return valid;
|
|
348
|
-
}
|
|
349
|
-
const prevMessage = this.getErrorText();
|
|
350
|
-
this.nativeError = !valid;
|
|
351
|
-
this.nativeErrorText = this.validationMessage;
|
|
352
|
-
if (prevMessage === this.getErrorText()) {
|
|
353
|
-
this.field?.reannounceError();
|
|
354
|
-
}
|
|
355
|
-
return valid;
|
|
356
|
-
}
|
|
357
262
|
/**
|
|
358
263
|
* Selects all the text in the text field.
|
|
359
264
|
*
|
|
@@ -362,21 +267,6 @@ export class TextField extends textFieldBaseClass {
|
|
|
362
267
|
select() {
|
|
363
268
|
this.getInputOrTextarea().select();
|
|
364
269
|
}
|
|
365
|
-
/**
|
|
366
|
-
* Sets a custom validation error message for the text field. Use this for
|
|
367
|
-
* custom error message.
|
|
368
|
-
*
|
|
369
|
-
* When the error is not an empty string, the text field is considered invalid
|
|
370
|
-
* and `validity.customError` will be true.
|
|
371
|
-
*
|
|
372
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity
|
|
373
|
-
*
|
|
374
|
-
* @param error The error message to display.
|
|
375
|
-
*/
|
|
376
|
-
setCustomValidity(error) {
|
|
377
|
-
this.hasCustomValidityError = !!error;
|
|
378
|
-
this[internals].setValidity({ customError: !!error }, error, this.getInputOrTextarea());
|
|
379
|
-
}
|
|
380
270
|
setRangeText(...args) {
|
|
381
271
|
// Calling setRangeText with 1 vs 3-4 arguments has different behavior.
|
|
382
272
|
// Use spread syntax and type casting to ensure correct usage.
|
|
@@ -467,9 +357,6 @@ export class TextField extends textFieldBaseClass {
|
|
|
467
357
|
// before checking its value.
|
|
468
358
|
this.value = value;
|
|
469
359
|
}
|
|
470
|
-
// Sync validity when properties change, since validation properties may
|
|
471
|
-
// have changed.
|
|
472
|
-
this.syncValidity();
|
|
473
360
|
}
|
|
474
361
|
renderField() {
|
|
475
362
|
return staticHtml `<${this.fieldTag}
|
|
@@ -509,7 +396,7 @@ export class TextField extends textFieldBaseClass {
|
|
|
509
396
|
`;
|
|
510
397
|
}
|
|
511
398
|
renderInputOrTextarea() {
|
|
512
|
-
const style = { direction: this.textDirection };
|
|
399
|
+
const style = { 'direction': this.textDirection };
|
|
513
400
|
const ariaLabel = this.ariaLabel || this.label || nothing;
|
|
514
401
|
// lit-anaylzer `autocomplete` types are too strict
|
|
515
402
|
// tslint:disable-next-line:no-any
|
|
@@ -532,7 +419,7 @@ export class TextField extends textFieldBaseClass {
|
|
|
532
419
|
rows=${this.rows}
|
|
533
420
|
cols=${this.cols}
|
|
534
421
|
.value=${live(this.value)}
|
|
535
|
-
@change=${this.
|
|
422
|
+
@change=${this.redispatchEvent}
|
|
536
423
|
@focusin=${this.handleFocusin}
|
|
537
424
|
@focusout=${this.handleFocusout}
|
|
538
425
|
@input=${this.handleInput}
|
|
@@ -606,13 +493,6 @@ export class TextField extends textFieldBaseClass {
|
|
|
606
493
|
handleInput(event) {
|
|
607
494
|
this.dirty = true;
|
|
608
495
|
this.value = event.target.value;
|
|
609
|
-
// Sync validity so that clients can check validity on input.
|
|
610
|
-
this.syncValidity();
|
|
611
|
-
}
|
|
612
|
-
handleChange(event) {
|
|
613
|
-
// Sync validity so that clients can check validity on change.
|
|
614
|
-
this.syncValidity();
|
|
615
|
-
this.redispatchEvent(event);
|
|
616
496
|
}
|
|
617
497
|
redispatchEvent(event) {
|
|
618
498
|
redispatchEvent(this, event);
|
|
@@ -641,32 +521,10 @@ export class TextField extends textFieldBaseClass {
|
|
|
641
521
|
}
|
|
642
522
|
return this.getInputOrTextarea();
|
|
643
523
|
}
|
|
644
|
-
syncValidity() {
|
|
645
|
-
// Sync the internal <input>'s validity and the host's ElementInternals
|
|
646
|
-
// validity. We do this to re-use native `<input>` validation messages.
|
|
647
|
-
const input = this.getInputOrTextarea();
|
|
648
|
-
if (this.hasCustomValidityError) {
|
|
649
|
-
input.setCustomValidity(this[internals].validationMessage);
|
|
650
|
-
}
|
|
651
|
-
else {
|
|
652
|
-
input.setCustomValidity('');
|
|
653
|
-
}
|
|
654
|
-
this[internals].setValidity(input.validity, input.validationMessage, this.getInputOrTextarea());
|
|
655
|
-
}
|
|
656
524
|
handleIconChange() {
|
|
657
525
|
this.hasLeadingIcon = this.leadingIcons.length > 0;
|
|
658
526
|
this.hasTrailingIcon = this.trailingIcons.length > 0;
|
|
659
527
|
}
|
|
660
|
-
connectedCallback() {
|
|
661
|
-
super.connectedCallback();
|
|
662
|
-
// Handles the case where the user submits the form and native validation
|
|
663
|
-
// error pops up. We want the error styles to show.
|
|
664
|
-
this.addEventListener('invalid', this.onInvalid);
|
|
665
|
-
}
|
|
666
|
-
disconnectedCallback() {
|
|
667
|
-
super.disconnectedCallback();
|
|
668
|
-
this.removeEventListener('invalid', this.onInvalid);
|
|
669
|
-
}
|
|
670
528
|
[getFormValue]() {
|
|
671
529
|
return this.value;
|
|
672
530
|
}
|
|
@@ -681,6 +539,32 @@ export class TextField extends textFieldBaseClass {
|
|
|
681
539
|
// leading icon slot such as an iconbutton due to how delegatesFocus works.
|
|
682
540
|
this.getInputOrTextarea().focus();
|
|
683
541
|
}
|
|
542
|
+
[createValidator]() {
|
|
543
|
+
return new TextFieldValidator(() => ({
|
|
544
|
+
state: this,
|
|
545
|
+
renderedControl: this.inputOrTextarea,
|
|
546
|
+
}));
|
|
547
|
+
}
|
|
548
|
+
[getValidityAnchor]() {
|
|
549
|
+
return this.inputOrTextarea;
|
|
550
|
+
}
|
|
551
|
+
[onReportValidity](invalidEvent) {
|
|
552
|
+
if (invalidEvent?.defaultPrevented) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (invalidEvent) {
|
|
556
|
+
// Prevent default pop-up behavior. This also prevents focusing, so we
|
|
557
|
+
// manually focus.
|
|
558
|
+
invalidEvent.preventDefault();
|
|
559
|
+
this.focus();
|
|
560
|
+
}
|
|
561
|
+
const prevMessage = this.getErrorText();
|
|
562
|
+
this.nativeError = !!invalidEvent;
|
|
563
|
+
this.nativeErrorText = this.validationMessage;
|
|
564
|
+
if (prevMessage === this.getErrorText()) {
|
|
565
|
+
this.field?.reannounceError();
|
|
566
|
+
}
|
|
567
|
+
}
|
|
684
568
|
}
|
|
685
569
|
(() => {
|
|
686
570
|
requestUpdateOnAriaChange(TextField);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,IAAI,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AAwCjD,wCAAwC;AACxC,MAAM,kBAAkB,GAAG,mBAAmB,CAC5C,qBAAqB,CAAC,UAAU,CAAC,CAClC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,SAAU,SAAQ,kBAAkB;IAA1D;;QAWE;;;;;WAKG;QACuC,UAAK,GAAG,KAAK,CAAC;QAExD;;;;;;;WAOG;QACkC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C;2CAAkB;AAsC/C;IAAX,QAAQ,EAAE;uCAAW;AAsBtB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAC8B;AAQ7B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAmB;AAkF5B;IAAhB,KAAK,EAAE;wCAAuB;AACd;IAAhB,KAAK,EAAE;0CAAyB;AAIhB;IAAhB,KAAK,EAAE;8CAA6B;AAKpB;IAAhB,KAAK,EAAE;kDAA8B;AAOrB;IADhB,KAAK,CAAC,QAAQ,CAAC;kDAIP;AACyB;IAAjC,KAAK,CAAC,QAAQ,CAAC;wCAAuC;AAEtC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;+CACJ;AAEzB;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;gDACJ","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {live} from 'lit/directives/live.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/controller/events.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\n\n/**\n * Input types that are compatible with the text field.\n */\nexport type TextFieldType =\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'textarea';\n\n/**\n * Input types that are not fully supported for the text field.\n */\nexport type UnsupportedTextFieldType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'file'\n | 'month'\n | 'time'\n | 'week';\n\n/**\n * Input types that are incompatible with the text field.\n */\nexport type InvalidTextFieldType =\n | 'button'\n | 'checkbox'\n | 'hidden'\n | 'image'\n | 'radio'\n | 'range'\n | 'reset'\n | 'submit';\n\n// Separate variable needed for closure.\nconst textFieldBaseClass = mixinFormAssociated(\n mixinElementInternals(LitElement),\n);\n\n/**\n * A text field component.\n *\n * @fires select {Event} The native `select` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event)\n * --bubbles\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n */\nexport abstract class TextField extends textFieldBaseClass {\n static {\n requestUpdateOnAriaChange(TextField);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({attribute: 'error-text'}) errorText = '';\n\n @property() label = '';\n\n @property({type: Boolean, reflect: true}) required = false;\n\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n\n /**\n * An optional prefix to display before the input value.\n */\n @property({attribute: 'prefix-text'}) prefixText = '';\n\n /**\n * An optional suffix to display after the input value.\n */\n @property({attribute: 'suffix-text'}) suffixText = '';\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-trailing-icon'})\n hasTrailingIcon = false;\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({attribute: 'text-direction'}) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({type: Number}) rows = 2;\n\n /**\n * The number of cols to display for a `type=\"textarea\"` text field.\n * Defaults to 20.\n */\n @property({type: Number}) cols = 20;\n\n // <input> properties\n @property({reflect: true}) override inputMode = '';\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({type: Number}) maxLength = -1;\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({type: Number}) minLength = -1;\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n\n @property({reflect: true, converter: stringConverter}) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({type: Boolean, reflect: true}) readOnly = false;\n\n /**\n * Indicates that input accepts multiple email addresses.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple\n */\n @property({type: Boolean, reflect: true}) multiple = false;\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection() {\n return this.getInputOrTextarea().selectionDirection;\n }\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n this.getInputOrTextarea().selectionDirection = value;\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd() {\n return this.getInputOrTextarea().selectionEnd;\n }\n set selectionEnd(value: number | null) {\n this.getInputOrTextarea().selectionEnd = value;\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart() {\n return this.getInputOrTextarea().selectionStart;\n }\n set selectionStart(value: number | null) {\n this.getInputOrTextarea().selectionStart = value;\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({reflect: true})\n type: TextFieldType | UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({reflect: true}) autocomplete = '';\n\n /**\n * Returns the text field's validation error message.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation\n */\n get validationMessage() {\n this.syncValidity();\n return this[internals].validationMessage;\n }\n\n /**\n * Returns a `ValidityState` object that represents the validity states of the\n * text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ValidityState\n */\n get validity() {\n this.syncValidity();\n return this[internals].validity;\n }\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber() {\n const input = this.getInput();\n if (!input) {\n return NaN;\n }\n\n return input.valueAsNumber;\n }\n set valueAsNumber(value: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsNumber = value;\n this.value = input.value;\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate() {\n const input = this.getInput();\n if (!input) {\n return null;\n }\n\n return input.valueAsDate;\n }\n set valueAsDate(value: Date | null) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsDate = value;\n this.value = input.value;\n }\n\n /**\n * Returns whether an element will successfully validate based on forms\n * validation rules and constraints.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate\n */\n get willValidate() {\n this.syncValidity();\n return this[internals].willValidate;\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n @state() private focused = false;\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @query('.input')\n private readonly inputOrTextarea?:\n | HTMLInputElement\n | HTMLTextAreaElement\n | null;\n @query('.field') private readonly field?: Field | null;\n @queryAssignedElements({slot: 'leading-icon'})\n private readonly leadingIcons!: Element[];\n @queryAssignedElements({slot: 'trailing-icon'})\n private readonly trailingIcons!: Element[];\n private isCheckingValidity = false;\n private isReportingValidity = false;\n // Needed for Safari, see https://bugs.webkit.org/show_bug.cgi?id=261432\n // Replace with this[internals].validity.customError when resolved.\n private hasCustomValidityError = false;\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n checkValidity() {\n this.isCheckingValidity = true;\n this.syncValidity();\n const isValid = this[internals].checkValidity();\n this.isCheckingValidity = false;\n return isValid;\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * This method will display or clear an error text message equal to the text\n * field's `validationMessage`, unless the invalid event is canceled.\n *\n * Use `setCustomValidity()` to customize the `validationMessage`.\n *\n * This method can also be used to re-announce error messages to screen\n * readers.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n reportValidity() {\n this.isReportingValidity = true;\n let invalidEvent: Event | undefined;\n this.addEventListener(\n 'invalid',\n (event) => {\n invalidEvent = event;\n },\n {once: true},\n );\n\n const valid = this.checkValidity();\n this.showErrorMessage(valid, invalidEvent);\n\n this.isReportingValidity = false;\n\n return valid;\n }\n\n private showErrorMessage(valid: boolean, invalidEvent: Event | undefined) {\n if (invalidEvent?.defaultPrevented) {\n return valid;\n }\n\n const prevMessage = this.getErrorText();\n this.nativeError = !valid;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n\n return valid;\n }\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select() {\n this.getInputOrTextarea().select();\n }\n\n /**\n * Sets a custom validation error message for the text field. Use this for\n * custom error message.\n *\n * When the error is not an empty string, the text field is considered invalid\n * and `validity.customError` will be true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity\n *\n * @param error The error message to display.\n */\n setCustomValidity(error: string) {\n this.hasCustomValidityError = !!error;\n this[internals].setValidity(\n {customError: !!error},\n error,\n this.getInputOrTextarea(),\n );\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void;\n setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectionMode?: SelectionMode,\n ): void;\n setRangeText(...args: unknown[]) {\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n this.getInputOrTextarea().setRangeText(\n ...(args as Parameters<HTMLInputElement['setRangeText']>),\n );\n this.value = this.getInputOrTextarea().value;\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(\n start: number | null,\n end: number | null,\n direction?: 'forward' | 'backward' | 'none',\n ) {\n this.getInputOrTextarea().setSelectionRange(start, end, direction);\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepDown(stepDecrement);\n this.value = input.value;\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepUp(stepIncrement);\n this.value = input.value;\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.dirty = false;\n this.value = this.getAttribute('value') ?? '';\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string,\n newValue: string | null,\n oldValue: string | null,\n ) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n protected override render() {\n const classes = {\n 'disabled': this.disabled,\n 'error': !this.disabled && this.hasError,\n 'textarea': this.type === 'textarea',\n };\n\n return html`\n <span class=\"text-field ${classMap(classes)}\">\n ${this.renderField()}\n </span>\n `;\n }\n\n protected override updated(changedProperties: PropertyValues) {\n // Keep changedProperties arg so that subclasses may call it\n\n // If a property such as `type` changes and causes the internal <input>\n // value to change without dispatching an event, re-sync it.\n const value = this.getInputOrTextarea().value;\n if (this.value !== value) {\n // Note this is typically inefficient in updated() since it schedules\n // another update. However, it is needed for the <input> to fully render\n // before checking its value.\n this.value = value;\n }\n\n // Sync validity when properties change, since validation properties may\n // have changed.\n this.syncValidity();\n }\n\n private renderField() {\n return staticHtml`<${this.fieldTag}\n class=\"field\"\n count=${this.value.length}\n ?disabled=${this.disabled}\n ?error=${this.hasError}\n error-text=${this.getErrorText()}\n ?focused=${this.focused}\n ?has-end=${this.hasTrailingIcon}\n ?has-start=${this.hasLeadingIcon}\n label=${this.label}\n max=${this.maxLength}\n ?populated=${!!this.value}\n ?required=${this.required}\n ?resizable=${this.type === 'textarea'}\n supporting-text=${this.supportingText}\n >\n ${this.renderLeadingIcon()}\n ${this.renderInputOrTextarea()}\n ${this.renderTrailingIcon()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderInputOrTextarea() {\n const style = {direction: this.textDirection};\n const ariaLabel =\n (this as ARIAMixinStrict).ariaLabel || this.label || nothing;\n // lit-anaylzer `autocomplete` types are too strict\n // tslint:disable-next-line:no-any\n const autocomplete = this.autocomplete as any;\n\n if (this.type === 'textarea') {\n return html`\n <textarea\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n rows=${this.rows}\n cols=${this.cols}\n .value=${live(this.value)}\n @change=${this.handleChange}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent}></textarea>\n `;\n }\n\n const prefix = this.renderPrefix();\n const suffix = this.renderSuffix();\n\n // TODO(b/243805848): remove `as unknown as number` and `as any` once lit\n // analyzer is fixed\n // tslint:disable-next-line:no-any\n const inputMode = this.inputMode as any;\n return html`\n <div class=\"input-wrapper\">\n ${prefix}\n <input\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n pattern=${this.pattern || nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n ?multiple=${this.multiple}\n step=${(this.step || nothing) as unknown as number}\n type=${this.type}\n .value=${live(this.value)}\n @change=${this.redispatchEvent}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent} />\n ${suffix}\n </div>\n `;\n }\n\n private renderPrefix() {\n return this.renderAffix(this.prefixText, /* isSuffix */ false);\n }\n\n private renderSuffix() {\n return this.renderAffix(this.suffixText, /* isSuffix */ true);\n }\n\n private renderAffix(text: string, isSuffix: boolean) {\n if (!text) {\n return nothing;\n }\n\n const classes = {\n 'suffix': isSuffix,\n 'prefix': !isSuffix,\n };\n\n return html`<span class=\"${classMap(classes)}\">${text}</span>`;\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private handleFocusin() {\n this.focused = true;\n }\n\n private handleFocusout() {\n this.focused = false;\n }\n\n private handleInput(event: InputEvent) {\n this.dirty = true;\n this.value = (event.target as HTMLInputElement).value;\n // Sync validity so that clients can check validity on input.\n this.syncValidity();\n }\n\n private handleChange(event: Event) {\n // Sync validity so that clients can check validity on change.\n this.syncValidity();\n this.redispatchEvent(event);\n }\n\n private redispatchEvent(event: Event) {\n redispatchEvent(this, event);\n }\n\n private getInputOrTextarea() {\n if (!this.inputOrTextarea) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.inputOrTextarea!;\n }\n\n private getInput() {\n if (this.type === 'textarea') {\n return null;\n }\n\n return this.getInputOrTextarea() as HTMLInputElement;\n }\n\n private syncValidity() {\n // Sync the internal <input>'s validity and the host's ElementInternals\n // validity. We do this to re-use native `<input>` validation messages.\n const input = this.getInputOrTextarea();\n if (this.hasCustomValidityError) {\n input.setCustomValidity(this[internals].validationMessage);\n } else {\n input.setCustomValidity('');\n }\n\n this[internals].setValidity(\n input.validity,\n input.validationMessage,\n this.getInputOrTextarea(),\n );\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n this.hasTrailingIcon = this.trailingIcons.length > 0;\n }\n\n private readonly onInvalid = (invalidEvent: Event) => {\n if (this.isCheckingValidity || this.isReportingValidity) {\n return;\n }\n\n this.showErrorMessage(false, invalidEvent);\n };\n\n override connectedCallback() {\n super.connectedCallback();\n\n // Handles the case where the user submits the form and native validation\n // error pops up. We want the error styles to show.\n this.addEventListener('invalid', this.onInvalid);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('invalid', this.onInvalid);\n }\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formResetCallback() {\n this.reset();\n }\n\n override formStateRestoreCallback(state: string) {\n this.value = state;\n }\n\n override focus() {\n // Required for the case that the user slots a focusable element into the\n // leading icon slot such as an iconbutton due to how delegatesFocus works.\n this.getInputOrTextarea().focus();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"text-field.js","sourceRoot":"","sources":["text-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAc,IAAI,IAAI,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,+CAA+C,CAAC;AAC9E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,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AX,QAAQ,EAAE;sCAAU;AAQK;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CAAgB;AAO7B;IAAX,QAAQ,EAAE;sCAAU;AAQK;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CAAgB;AAQ7B;IAAX,QAAQ,EAAE;0CAAc;AAE8B;IAAtD,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAC,CAAC;8CAAkB;AAQ9B;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAOjB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAkB;AAsC/C;IAAX,QAAQ,EAAE;uCAAW;AAsBtB;IADC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAC8B;AAQ7B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;+CAAmB;AAkD5B;IAAhB,KAAK,EAAE;wCAAuB;AACd;IAAhB,KAAK,EAAE;0CAAyB;AAIhB;IAAhB,KAAK,EAAE;8CAA6B;AAKpB;IAAhB,KAAK,EAAE;kDAA8B;AAOrB;IADhB,KAAK,CAAC,QAAQ,CAAC;kDAIP;AACyB;IAAjC,KAAK,CAAC,QAAQ,CAAC;wCAAuC;AAEtC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;+CACJ;AAEzB;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,eAAe,EAAC,CAAC;gDACJ","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {LitElement, PropertyValues, html, nothing} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {live} from 'lit/directives/live.js';\nimport {StyleInfo, styleMap} from 'lit/directives/style-map.js';\nimport {StaticValue, html as staticHtml} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/controller/events.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {\n mixinOnReportValidity,\n onReportValidity,\n} from '../../labs/behaviors/on-report-validity.js';\nimport {TextFieldValidator} from '../../labs/behaviors/validators/text-field-validator.js';\nimport {Validator} from '../../labs/behaviors/validators/validator.js';\n\n/**\n * Input types that are compatible with the text field.\n */\nexport type TextFieldType =\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'textarea';\n\n/**\n * Input types that are not fully supported for the text field.\n */\nexport type UnsupportedTextFieldType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'file'\n | 'month'\n | 'time'\n | 'week';\n\n/**\n * Input types that are incompatible with the text field.\n */\nexport type InvalidTextFieldType =\n | 'button'\n | 'checkbox'\n | 'hidden'\n | 'image'\n | 'radio'\n | 'range'\n | 'reset'\n | 'submit';\n\n// Separate variable needed for closure.\nconst textFieldBaseClass = mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n);\n\n/**\n * A text field component.\n *\n * @fires select {Event} The native `select` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select_event)\n * --bubbles\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n */\nexport abstract class TextField extends textFieldBaseClass {\n static {\n requestUpdateOnAriaChange(TextField);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({attribute: 'error-text'}) errorText = '';\n\n @property() label = '';\n\n @property({type: Boolean, reflect: true}) required = false;\n\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n\n /**\n * An optional prefix to display before the input value.\n */\n @property({attribute: 'prefix-text'}) prefixText = '';\n\n /**\n * An optional suffix to display after the input value.\n */\n @property({attribute: 'suffix-text'}) suffixText = '';\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-trailing-icon'})\n hasTrailingIcon = false;\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({attribute: 'text-direction'}) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({type: Number}) rows = 2;\n\n /**\n * The number of cols to display for a `type=\"textarea\"` text field.\n * Defaults to 20.\n */\n @property({type: Number}) cols = 20;\n\n // <input> properties\n @property({reflect: true}) override inputMode = '';\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({type: Number}) maxLength = -1;\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({type: Number}) minLength = -1;\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n\n @property({reflect: true, converter: stringConverter}) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({type: Boolean, reflect: true}) readOnly = false;\n\n /**\n * Indicates that input accepts multiple email addresses.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple\n */\n @property({type: Boolean, reflect: true}) multiple = false;\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection() {\n return this.getInputOrTextarea().selectionDirection;\n }\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n this.getInputOrTextarea().selectionDirection = value;\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd() {\n return this.getInputOrTextarea().selectionEnd;\n }\n set selectionEnd(value: number | null) {\n this.getInputOrTextarea().selectionEnd = value;\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart() {\n return this.getInputOrTextarea().selectionStart;\n }\n set selectionStart(value: number | null) {\n this.getInputOrTextarea().selectionStart = value;\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({reflect: true})\n type: TextFieldType | UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({reflect: true}) autocomplete = '';\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber() {\n const input = this.getInput();\n if (!input) {\n return NaN;\n }\n\n return input.valueAsNumber;\n }\n set valueAsNumber(value: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsNumber = value;\n this.value = input.value;\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate() {\n const input = this.getInput();\n if (!input) {\n return null;\n }\n\n return input.valueAsDate;\n }\n set valueAsDate(value: Date | null) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.valueAsDate = value;\n this.value = input.value;\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() private dirty = false;\n @state() private focused = false;\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @query('.input')\n private readonly inputOrTextarea!:\n | HTMLInputElement\n | HTMLTextAreaElement\n | null;\n @query('.field') private readonly field!: Field | null;\n @queryAssignedElements({slot: 'leading-icon'})\n private readonly leadingIcons!: Element[];\n @queryAssignedElements({slot: 'trailing-icon'})\n private readonly trailingIcons!: Element[];\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select() {\n this.getInputOrTextarea().select();\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void;\n setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectionMode?: SelectionMode,\n ): void;\n setRangeText(...args: unknown[]) {\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n this.getInputOrTextarea().setRangeText(\n ...(args as Parameters<HTMLInputElement['setRangeText']>),\n );\n this.value = this.getInputOrTextarea().value;\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(\n start: number | null,\n end: number | null,\n direction?: 'forward' | 'backward' | 'none',\n ) {\n this.getInputOrTextarea().setSelectionRange(start, end, direction);\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepDown(stepDecrement);\n this.value = input.value;\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number) {\n const input = this.getInput();\n if (!input) {\n return;\n }\n\n input.stepUp(stepIncrement);\n this.value = input.value;\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset() {\n this.dirty = false;\n this.value = this.getAttribute('value') ?? '';\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override attributeChangedCallback(\n attribute: string,\n newValue: string | null,\n oldValue: string | null,\n ) {\n if (attribute === 'value' && this.dirty) {\n // After user input, changing the value attribute no longer updates the\n // text field's value (until reset). This matches native <input> behavior.\n return;\n }\n\n super.attributeChangedCallback(attribute, newValue, oldValue);\n }\n\n protected override render() {\n const classes = {\n 'disabled': this.disabled,\n 'error': !this.disabled && this.hasError,\n 'textarea': this.type === 'textarea',\n };\n\n return html`\n <span class=\"text-field ${classMap(classes)}\">\n ${this.renderField()}\n </span>\n `;\n }\n\n protected override updated(changedProperties: PropertyValues) {\n // Keep changedProperties arg so that subclasses may call it\n\n // If a property such as `type` changes and causes the internal <input>\n // value to change without dispatching an event, re-sync it.\n const value = this.getInputOrTextarea().value;\n if (this.value !== value) {\n // Note this is typically inefficient in updated() since it schedules\n // another update. However, it is needed for the <input> to fully render\n // before checking its value.\n this.value = value;\n }\n }\n\n private renderField() {\n return staticHtml`<${this.fieldTag}\n class=\"field\"\n count=${this.value.length}\n ?disabled=${this.disabled}\n ?error=${this.hasError}\n error-text=${this.getErrorText()}\n ?focused=${this.focused}\n ?has-end=${this.hasTrailingIcon}\n ?has-start=${this.hasLeadingIcon}\n label=${this.label}\n max=${this.maxLength}\n ?populated=${!!this.value}\n ?required=${this.required}\n ?resizable=${this.type === 'textarea'}\n supporting-text=${this.supportingText}\n >\n ${this.renderLeadingIcon()}\n ${this.renderInputOrTextarea()}\n ${this.renderTrailingIcon()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderInputOrTextarea() {\n const style: StyleInfo = {'direction': this.textDirection};\n const ariaLabel =\n (this as ARIAMixinStrict).ariaLabel || this.label || nothing;\n // lit-anaylzer `autocomplete` types are too strict\n // tslint:disable-next-line:no-any\n const autocomplete = this.autocomplete as any;\n\n if (this.type === 'textarea') {\n return html`\n <textarea\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n rows=${this.rows}\n cols=${this.cols}\n .value=${live(this.value)}\n @change=${this.redispatchEvent}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent}></textarea>\n `;\n }\n\n const prefix = this.renderPrefix();\n const suffix = this.renderSuffix();\n\n // TODO(b/243805848): remove `as unknown as number` and `as any` once lit\n // analyzer is fixed\n // tslint:disable-next-line:no-any\n const inputMode = this.inputMode as any;\n return html`\n <div class=\"input-wrapper\">\n ${prefix}\n <input\n class=\"input\"\n style=${styleMap(style)}\n aria-describedby=\"description\"\n aria-invalid=${this.hasError}\n aria-label=${ariaLabel}\n autocomplete=${autocomplete || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${this.maxLength > -1 ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${this.minLength > -1 ? this.minLength : nothing}\n pattern=${this.pattern || nothing}\n placeholder=${this.placeholder || nothing}\n ?readonly=${this.readOnly}\n ?required=${this.required}\n ?multiple=${this.multiple}\n step=${(this.step || nothing) as unknown as number}\n type=${this.type}\n .value=${live(this.value)}\n @change=${this.redispatchEvent}\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n @input=${this.handleInput}\n @select=${this.redispatchEvent} />\n ${suffix}\n </div>\n `;\n }\n\n private renderPrefix() {\n return this.renderAffix(this.prefixText, /* isSuffix */ false);\n }\n\n private renderSuffix() {\n return this.renderAffix(this.suffixText, /* isSuffix */ true);\n }\n\n private renderAffix(text: string, isSuffix: boolean) {\n if (!text) {\n return nothing;\n }\n\n const classes = {\n 'suffix': isSuffix,\n 'prefix': !isSuffix,\n };\n\n return html`<span class=\"${classMap(classes)}\">${text}</span>`;\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n private handleFocusin() {\n this.focused = true;\n }\n\n private handleFocusout() {\n this.focused = false;\n }\n\n private handleInput(event: InputEvent) {\n this.dirty = true;\n this.value = (event.target as HTMLInputElement).value;\n }\n\n private redispatchEvent(event: Event) {\n redispatchEvent(this, event);\n }\n\n private getInputOrTextarea() {\n if (!this.inputOrTextarea) {\n // If the input is not yet defined, synchronously render.\n // e.g.\n // const textField = document.createElement('md-outlined-text-field');\n // document.body.appendChild(textField);\n // textField.focus(); // synchronously render\n this.connectedCallback();\n this.scheduleUpdate();\n }\n\n if (this.isUpdatePending) {\n // If there are pending updates, synchronously perform them. This ensures\n // that constraint validation properties (like `required`) are synced\n // before interacting with input APIs that depend on them.\n this.scheduleUpdate();\n }\n\n return this.inputOrTextarea!;\n }\n\n private getInput() {\n if (this.type === 'textarea') {\n return null;\n }\n\n return this.getInputOrTextarea() as HTMLInputElement;\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n this.hasTrailingIcon = this.trailingIcons.length > 0;\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formResetCallback() {\n this.reset();\n }\n\n override formStateRestoreCallback(state: string) {\n this.value = state;\n }\n\n override focus() {\n // Required for the case that the user slots a focusable element into the\n // leading icon slot such as an iconbutton due to how delegatesFocus works.\n this.getInputOrTextarea().focus();\n }\n\n [createValidator](): Validator<unknown> {\n return new TextFieldValidator(() => ({\n state: this,\n renderedControl: this.inputOrTextarea,\n }));\n }\n\n [getValidityAnchor](): HTMLElement | null {\n return this.inputOrTextarea;\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n if (invalidEvent?.defaultPrevented) {\n return;\n }\n\n if (invalidEvent) {\n // Prevent default pop-up behavior. This also prevents focusing, so we\n // manually focus.\n invalidEvent.preventDefault();\n this.focus();\n }\n\n const prevMessage = this.getErrorText();\n this.nativeError = !!invalidEvent;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n }\n}\n"]}
|
|
@@ -42,6 +42,7 @@ $supported-tokens: (
|
|
|
42
42
|
'hover-leading-icon-color',
|
|
43
43
|
'hover-state-layer-color',
|
|
44
44
|
'hover-state-layer-opacity',
|
|
45
|
+
'icon-label-space',
|
|
45
46
|
'icon-size',
|
|
46
47
|
'label-text-color',
|
|
47
48
|
'label-text-font',
|
|
@@ -49,12 +50,15 @@ $supported-tokens: (
|
|
|
49
50
|
'label-text-size',
|
|
50
51
|
'label-text-weight',
|
|
51
52
|
'leading-icon-color',
|
|
53
|
+
'leading-space',
|
|
52
54
|
'outline-color',
|
|
53
55
|
'outline-width',
|
|
54
56
|
'pressed-label-text-color',
|
|
55
57
|
'pressed-leading-icon-color',
|
|
56
58
|
'pressed-state-layer-color',
|
|
57
59
|
'pressed-state-layer-opacity',
|
|
60
|
+
'trailing-space',
|
|
61
|
+
'with-leading-icon-leading-space',
|
|
58
62
|
// go/keep-sorted end
|
|
59
63
|
);
|
|
60
64
|
|
|
@@ -86,6 +90,13 @@ $_default: (
|
|
|
86
90
|
md-comp-assist-chip.values($deps, $exclude-hardcoded-values),
|
|
87
91
|
$supported-tokens: $supported-tokens,
|
|
88
92
|
$unsupported-tokens: $unsupported-tokens,
|
|
93
|
+
$new-tokens: (
|
|
94
|
+
'leading-space': if($exclude-hardcoded-values, null, 16px),
|
|
95
|
+
'trailing-space': if($exclude-hardcoded-values, null, 16px),
|
|
96
|
+
'icon-label-space': if($exclude-hardcoded-values, null, 8px),
|
|
97
|
+
'with-leading-icon-leading-space':
|
|
98
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
99
|
+
),
|
|
89
100
|
$renamed-tokens: (
|
|
90
101
|
// Remove "flat-*" prefix (b/275577569)
|
|
91
102
|
'flat-container-elevation': 'container-elevation',
|
|
@@ -49,6 +49,7 @@ $supported-tokens: (
|
|
|
49
49
|
'hover-state-layer-color',
|
|
50
50
|
'hover-state-layer-opacity',
|
|
51
51
|
'hover-trailing-icon-color',
|
|
52
|
+
'icon-label-space',
|
|
52
53
|
'icon-size',
|
|
53
54
|
'label-text-color',
|
|
54
55
|
'label-text-font',
|
|
@@ -56,6 +57,7 @@ $supported-tokens: (
|
|
|
56
57
|
'label-text-size',
|
|
57
58
|
'label-text-weight',
|
|
58
59
|
'leading-icon-color',
|
|
60
|
+
'leading-space',
|
|
59
61
|
'outline-color',
|
|
60
62
|
'outline-width',
|
|
61
63
|
'pressed-label-text-color',
|
|
@@ -82,6 +84,9 @@ $supported-tokens: (
|
|
|
82
84
|
'selected-pressed-trailing-icon-color',
|
|
83
85
|
'selected-trailing-icon-color',
|
|
84
86
|
'trailing-icon-color',
|
|
87
|
+
'trailing-space',
|
|
88
|
+
'with-leading-icon-leading-space',
|
|
89
|
+
'with-trailing-icon-trailing-space',
|
|
85
90
|
// go/keep-sorted end
|
|
86
91
|
);
|
|
87
92
|
|
|
@@ -127,6 +132,15 @@ $_default: (
|
|
|
127
132
|
md-comp-filter-chip.values($deps, $exclude-hardcoded-values),
|
|
128
133
|
$supported-tokens: $supported-tokens,
|
|
129
134
|
$unsupported-tokens: $unsupported-tokens,
|
|
135
|
+
$new-tokens: (
|
|
136
|
+
'leading-space': if($exclude-hardcoded-values, null, 16px),
|
|
137
|
+
'trailing-space': if($exclude-hardcoded-values, null, 16px),
|
|
138
|
+
'icon-label-space': if($exclude-hardcoded-values, null, 8px),
|
|
139
|
+
'with-leading-icon-leading-space':
|
|
140
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
141
|
+
'with-trailing-icon-trailing-space':
|
|
142
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
143
|
+
),
|
|
130
144
|
$renamed-tokens: (
|
|
131
145
|
// Remove "unselected-*" and "flat-*" prefix (b/275577569)
|
|
132
146
|
'elevated-unselected-container-color': 'elevated-container-color',
|
|
@@ -42,6 +42,7 @@ $supported-tokens: (
|
|
|
42
42
|
'hover-state-layer-color',
|
|
43
43
|
'hover-state-layer-opacity',
|
|
44
44
|
'hover-trailing-icon-color',
|
|
45
|
+
'icon-label-space',
|
|
45
46
|
'icon-size',
|
|
46
47
|
'label-text-color',
|
|
47
48
|
'label-text-font',
|
|
@@ -49,6 +50,7 @@ $supported-tokens: (
|
|
|
49
50
|
'label-text-size',
|
|
50
51
|
'label-text-weight',
|
|
51
52
|
'leading-icon-color',
|
|
53
|
+
'leading-space',
|
|
52
54
|
'outline-color',
|
|
53
55
|
'outline-width',
|
|
54
56
|
'pressed-label-text-color',
|
|
@@ -75,6 +77,9 @@ $supported-tokens: (
|
|
|
75
77
|
'selected-pressed-trailing-icon-color',
|
|
76
78
|
'selected-trailing-icon-color',
|
|
77
79
|
'trailing-icon-color',
|
|
80
|
+
'trailing-space',
|
|
81
|
+
'with-leading-icon-leading-space',
|
|
82
|
+
'with-trailing-icon-trailing-space',
|
|
78
83
|
// go/keep-sorted end
|
|
79
84
|
);
|
|
80
85
|
|
|
@@ -115,6 +120,15 @@ $_default: (
|
|
|
115
120
|
md-comp-input-chip.values($deps, $exclude-hardcoded-values),
|
|
116
121
|
$supported-tokens: $supported-tokens,
|
|
117
122
|
$unsupported-tokens: $unsupported-tokens,
|
|
123
|
+
$new-tokens: (
|
|
124
|
+
'leading-space': if($exclude-hardcoded-values, null, 16px),
|
|
125
|
+
'trailing-space': if($exclude-hardcoded-values, null, 16px),
|
|
126
|
+
'icon-label-space': if($exclude-hardcoded-values, null, 8px),
|
|
127
|
+
'with-leading-icon-leading-space':
|
|
128
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
129
|
+
'with-trailing-icon-trailing-space':
|
|
130
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
131
|
+
),
|
|
118
132
|
$renamed-tokens: (
|
|
119
133
|
// Remove "unselected-*" prefix (b/275577569)
|
|
120
134
|
'disabled-unselected-outline-color': 'disabled-outline-color',
|
|
@@ -42,6 +42,7 @@ $supported-tokens: (
|
|
|
42
42
|
'hover-leading-icon-color',
|
|
43
43
|
'hover-state-layer-color',
|
|
44
44
|
'hover-state-layer-opacity',
|
|
45
|
+
'icon-label-space',
|
|
45
46
|
'icon-size',
|
|
46
47
|
'label-text-color',
|
|
47
48
|
'label-text-font',
|
|
@@ -49,12 +50,15 @@ $supported-tokens: (
|
|
|
49
50
|
'label-text-size',
|
|
50
51
|
'label-text-weight',
|
|
51
52
|
'leading-icon-color',
|
|
53
|
+
'leading-space',
|
|
52
54
|
'outline-color',
|
|
53
55
|
'outline-width',
|
|
54
56
|
'pressed-label-text-color',
|
|
55
57
|
'pressed-leading-icon-color',
|
|
56
58
|
'pressed-state-layer-color',
|
|
57
59
|
'pressed-state-layer-opacity',
|
|
60
|
+
'trailing-space',
|
|
61
|
+
'with-leading-icon-leading-space',
|
|
58
62
|
// go/keep-sorted end
|
|
59
63
|
);
|
|
60
64
|
|
|
@@ -86,6 +90,13 @@ $_default: (
|
|
|
86
90
|
md-comp-suggestion-chip.values($deps, $exclude-hardcoded-values),
|
|
87
91
|
$supported-tokens: $supported-tokens,
|
|
88
92
|
$unsupported-tokens: $unsupported-tokens,
|
|
93
|
+
$new-tokens: (
|
|
94
|
+
'leading-space': if($exclude-hardcoded-values, null, 16px),
|
|
95
|
+
'trailing-space': if($exclude-hardcoded-values, null, 16px),
|
|
96
|
+
'icon-label-space': if($exclude-hardcoded-values, null, 8px),
|
|
97
|
+
'with-leading-icon-leading-space':
|
|
98
|
+
if($exclude-hardcoded-values, null, 8px),
|
|
99
|
+
),
|
|
89
100
|
$renamed-tokens: (
|
|
90
101
|
// Remove "flat-*" prefix (b/275577569)
|
|
91
102
|
'flat-container-elevation': 'container-elevation',
|