@material/web 2.1.1-nightly.a9ee4f5.0 → 2.2.1-nightly.1bdcbd3.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.
@@ -48,7 +48,11 @@ export let MdBrandedFab = class MdBrandedFab extends Fab {
48
48
  };
49
49
  }
50
50
  };
51
- MdBrandedFab.styles = [sharedStyles, styles, forcedColors];
51
+ MdBrandedFab.styles = [
52
+ sharedStyles,
53
+ styles,
54
+ forcedColors,
55
+ ];
52
56
  MdBrandedFab = __decorate([
53
57
  customElement('md-branded-fab')
54
58
  ], MdBrandedFab);
@@ -1 +1 @@
1
- {"version":3,"file":"branded-fab.js","sourceRoot":"","sources":["branded-fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAa,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,WAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,GAAG;IAM1B,gBAAgB;QACvB,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;;AACe,mBAAM,GAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,AAA5D,CAA6D;AAfxE,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAgBxB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Fab, FabVariant} from './internal/fab.js';\nimport {styles} from './internal/fab-branded-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-branded-fab': MdBrandedFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small. Branded\n * FABs are used to specifically call attention to branded logo icons.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-branded-fab')\nexport class MdBrandedFab extends Fab {\n /**\n * Branded FABs have no variants\n */\n override variant!: FabVariant;\n\n override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'primary': false,\n 'secondary': false,\n 'tertiary': false,\n 'small': false,\n };\n }\n static override styles: CSSResultOrNative[] = [sharedStyles, styles, forcedColors];\n}\n"]}
1
+ {"version":3,"file":"branded-fab.js","sourceRoot":"","sources":["branded-fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAa,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,WAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,GAAG;IAM1B,gBAAgB;QACvB,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;;AACe,mBAAM,GAAwB;IAC5C,YAAY;IACZ,MAAM;IACN,YAAY;CACb,AAJqB,CAIpB;AAnBS,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAoBxB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Fab, FabVariant} from './internal/fab.js';\nimport {styles} from './internal/fab-branded-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-branded-fab': MdBrandedFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small. Branded\n * FABs are used to specifically call attention to branded logo icons.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-branded-fab')\nexport class MdBrandedFab extends Fab {\n /**\n * Branded FABs have no variants\n */\n declare variant: FabVariant;\n\n override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'primary': false,\n 'secondary': false,\n 'tertiary': false,\n 'small': false,\n };\n }\n static override styles: CSSResultOrNative[] = [\n sharedStyles,\n styles,\n forcedColors,\n ];\n}\n"]}
@@ -72,6 +72,17 @@
72
72
  pointer-events: none;
73
73
  }
74
74
 
75
+ slot[name='container'] {
76
+ border-radius: inherit;
77
+ }
78
+
79
+ slot[name='container']::slotted(*) {
80
+ border-radius: inherit;
81
+ inset: 0;
82
+ pointer-events: none;
83
+ position: absolute;
84
+ }
85
+
75
86
  @include content.styles;
76
87
  @include label.styles;
77
88
  @include supporting-text.styles;
@@ -55,6 +55,7 @@ export declare class Field extends LitElement {
55
55
  protected render(): TemplateResult<1>;
56
56
  protected updated(changed: PropertyValues<Field>): void;
57
57
  protected renderBackground?(): TemplateResult;
58
+ protected renderStateLayer?(): TemplateResult;
58
59
  protected renderIndicator?(): TemplateResult;
59
60
  protected renderOutline?(floatingLabel: unknown): TemplateResult;
60
61
  private renderSupportingText;
@@ -104,7 +104,9 @@ export class Field extends LitElement {
104
104
  return html `
105
105
  <div class="field ${classMap(classes)}">
106
106
  <div class="container-overflow">
107
- ${this.renderBackground?.()} ${this.renderIndicator?.()} ${outline}
107
+ ${this.renderBackground?.()}
108
+ <slot name="container"></slot>
109
+ ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}
108
110
  <div class="container">
109
111
  <div class="start">
110
112
  <slot name="start"></slot>
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GAEP,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,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;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAmB;AACH;IAAzC,QAAQ,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAC,CAAC;6CAAqB;AACzB;IAApC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;wCAAgB;AAC1B;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;oCAAY;AACX;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kCAAU;AAKgB;IAAlD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAC,CAAC;uCAAkB;AAKnB;IAAhD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC;qCAAgB;AAG/C;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC;qDACM;AAmBvC;IAAhB,KAAK,EAAE;0CAA6B;AAOpB;IAAhB,KAAK,EAAE;gDAAmC;AAC1B;IAAhB,KAAK,EAAE;iDAAoC;AAE3B;IADhB,KAAK,CAAC,iBAAiB,CAAC;8CAC6B;AACZ;IAAzC,KAAK,CAAC,gBAAgB,CAAC;6CAAsD;AACxC;IAArC,KAAK,CAAC,YAAY,CAAC;0CAAmD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n html,\n LitElement,\n nothing,\n PropertyValues,\n render,\n TemplateResult,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(),\n {duration: 150, easing: EASING.STANDARD},\n );\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GAEP,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,oCAAoC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAC/B,UAAK,GAAG,EAAE,CAAC;QAC8B,eAAU,GAAG,KAAK,CAAC;QAC7C,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QACH,mBAAc,GAAG,EAAE,CAAC;QACzB,cAAS,GAAG,EAAE,CAAC;QAC1B,UAAK,GAAG,CAAC,CAAC,CAAC;QACX,QAAG,GAAG,CAAC,CAAC,CAAC;QAEnC;;WAEG;QACgD,aAAQ,GAAG,KAAK,CAAC;QAEpE;;WAEG;QAC8C,WAAM,GAAG,KAAK,CAAC;QAsB/C,gBAAW,GAAG,KAAK,CAAC;QAErC;;;;WAIG;QACc,sBAAiB,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IAAhB,KAAK,EAAE;iDAAoC;AAE3B;IADhB,KAAK,CAAC,iBAAiB,CAAC;8CAC6B;AACZ;IAAzC,KAAK,CAAC,gBAAgB,CAAC;6CAAsD;AACxC;IAArC,KAAK,CAAC,YAAY,CAAC;0CAAmD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n html,\n LitElement,\n nothing,\n PropertyValues,\n render,\n TemplateResult,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()}\n <slot name=\"container\"></slot>\n ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderStateLayer?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(),\n {duration: 150, easing: EASING.STANDARD},\n );\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
@@ -9,5 +9,6 @@ import { Field } from './field.js';
9
9
  */
10
10
  export declare class FilledField extends Field {
11
11
  protected renderBackground(): import("lit-html").TemplateResult<1>;
12
+ protected renderStateLayer(): import("lit-html").TemplateResult<1>;
12
13
  protected renderIndicator(): import("lit-html").TemplateResult<1>;
13
14
  }
@@ -10,10 +10,10 @@ import { Field } from './field.js';
10
10
  */
11
11
  export class FilledField extends Field {
12
12
  renderBackground() {
13
- return html `
14
- <div class="background"></div>
15
- <div class="state-layer"></div>
16
- `;
13
+ return html ` <div class="background"></div> `;
14
+ }
15
+ renderStateLayer() {
16
+ return html ` <div class="state-layer"></div> `;
17
17
  }
18
18
  renderIndicator() {
19
19
  return html `<div class="active-indicator"></div>`;
@@ -1 +1 @@
1
- {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACjB,gBAAgB;QACjC,OAAO,IAAI,CAAA;;;KAGV,CAAC;IACJ,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA,sCAAsC,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * A filled field component.\n */\nexport class FilledField extends Field {\n protected override renderBackground() {\n return html`\n <div class=\"background\"></div>\n <div class=\"state-layer\"></div>\n `;\n }\n\n protected override renderIndicator() {\n return html`<div class=\"active-indicator\"></div>`;\n }\n}\n"]}
1
+ {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IACjB,gBAAgB;QACjC,OAAO,IAAI,CAAA,kCAAkC,CAAC;IAChD,CAAC;IAEkB,gBAAgB;QACjC,OAAO,IAAI,CAAA,mCAAmC,CAAC;IACjD,CAAC;IAEkB,eAAe;QAChC,OAAO,IAAI,CAAA,sCAAsC,CAAC;IACpD,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html} from 'lit';\n\nimport {Field} from './field.js';\n\n/**\n * A filled field component.\n */\nexport class FilledField extends Field {\n protected override renderBackground() {\n return html` <div class=\"background\"></div> `;\n }\n\n protected override renderStateLayer() {\n return html` <div class=\"state-layer\"></div> `;\n }\n\n protected override renderIndicator() {\n return html`<div class=\"active-indicator\"></div>`;\n }\n}\n"]}
@@ -1 +1 @@
1
- :host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}/*# sourceMappingURL=shared-styles.css.map */
1
+ :host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}/*# sourceMappingURL=shared-styles.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["_shared.scss","_content.scss","_label.scss","_supporting-text.scss"],"names":[],"mappings":"AAeE,MACE,oBACA,YAGF,OACE,aACA,OACA,sBAGA,2BACA,eAMF,oBACE,8DACA,0DACA,sDACA,0DACA,aACA,YACA,kBAGF,WACE,mBACA,sBACA,aACA,OACA,gBACA,gBACA,sBACA,kBAGF,2BAEE,eAGF,qCAGE,eAKA,gBAGF,UACE,oBChDF,cACE,oBAGE,aACA,sBACA,YAGA,kBAGF,OACE,oCAGF,KACE,qCAGF,YAEE,mBACA,uBAGF,mBACE,+EAIF,eACE,iFAIF,QACE,oBAQA,oBACA,OAGF,SACE,4BACA,aACA,OACA,UACA,mDAIF,yDAGE,UACA,iBAjES,KAoEX,6CACE,gBAGF,sBACE,UAGA,mBACA,iCACA,+BACA,wCACA,mCACA,WAEA,qBACA,mBAGF,mCACE,8BACA,oCAGF,6BAEE,6BACA,mCAGF,gBACE,kCAGF,cACE,0CAGF,YACE,2CAGF,kBACE,kCAGF,gBACE,0CAGF,cACE,2CAGF,mBACE,qCAGF,oFAGE,yCAGF,iBACE,6CACA,iDAGF,eACE,8CACA,kDAGF,gBACE,kCAGF,cACE,0CAGF,YACE,2CAGF,sBACE,wCAGF,oBACE,gDAGF,kBACE,iDAGF,wBACE,wCAGF,sBACE,gDAGF,oBACE,kDAIJ,WACE,8BACE,oCACE,eACA,YCrMN,cACE,OACE,sBACA,+BACA,gBACA,eACA,uBACA,mBACA,UACA,oCACA,kCACA,2CACA,sCACA,kBAGF,eACE,QAOA,oBACA,kBAGF,eACE,kBACA,sBAGF,gBACE,4CACA,qDACA,0BAGF,cACE,UAGF,iBACE,aAMF,eACE,QACA,kBAGA,mBAGF,cACE,qCAGF,gBACE,qCAGF,iBACE,wCAGF,8BACE,4CAGF,cACE,qCAGF,oBACE,2CAGF,sBACE,4CAIJ,WACE,8BACE,8BACE,eACA,YC3FN,cACE,iBACE,oCACA,aACA,yCACA,uCACA,gDACA,2CACA,SACA,8BACA,2DACA,0DACA,8CAIF,+BACE,cAGF,wBACE,0CAGF,wBACE,0CAGF,2BACE,6CACA,iDAGF,wBACE,0CAGF,8BACE,gDAGF,8BACE,iDAIJ,WACE,8BACE,2BACE,eACA","file":"shared-styles.css"}
1
+ {"version":3,"sourceRoot":"","sources":["_shared.scss","_content.scss","_label.scss","_supporting-text.scss"],"names":[],"mappings":"AAeE,MACE,oBACA,YAGF,OACE,aACA,OACA,sBAGA,2BACA,eAMF,oBACE,8DACA,0DACA,sDACA,0DACA,aACA,YACA,kBAGF,WACE,mBACA,sBACA,aACA,OACA,gBACA,gBACA,sBACA,kBAGF,2BAEE,eAGF,qCAGE,eAKA,gBAGF,UACE,oBAGF,qBACE,sBAGF,iCACE,sBACA,QACA,oBACA,kBC3DF,cACE,oBAGE,aACA,sBACA,YAGA,kBAGF,OACE,oCAGF,KACE,qCAGF,YAEE,mBACA,uBAGF,mBACE,+EAIF,eACE,iFAIF,QACE,oBAQA,oBACA,OAGF,SACE,4BACA,aACA,OACA,UACA,mDAIF,yDAGE,UACA,iBAjES,KAoEX,6CACE,gBAGF,sBACE,UAGA,mBACA,iCACA,+BACA,wCACA,mCACA,WAEA,qBACA,mBAGF,mCACE,8BACA,oCAGF,6BAEE,6BACA,mCAGF,gBACE,kCAGF,cACE,0CAGF,YACE,2CAGF,kBACE,kCAGF,gBACE,0CAGF,cACE,2CAGF,mBACE,qCAGF,oFAGE,yCAGF,iBACE,6CACA,iDAGF,eACE,8CACA,kDAGF,gBACE,kCAGF,cACE,0CAGF,YACE,2CAGF,sBACE,wCAGF,oBACE,gDAGF,kBACE,iDAGF,wBACE,wCAGF,sBACE,gDAGF,oBACE,kDAIJ,WACE,8BACE,oCACE,eACA,YCrMN,cACE,OACE,sBACA,+BACA,gBACA,eACA,uBACA,mBACA,UACA,oCACA,kCACA,2CACA,sCACA,kBAGF,eACE,QAOA,oBACA,kBAGF,eACE,kBACA,sBAGF,gBACE,4CACA,qDACA,0BAGF,cACE,UAGF,iBACE,aAMF,eACE,QACA,kBAGA,mBAGF,cACE,qCAGF,gBACE,qCAGF,iBACE,wCAGF,8BACE,4CAGF,cACE,qCAGF,oBACE,2CAGF,sBACE,4CAIJ,WACE,8BACE,8BACE,eACA,YC3FN,cACE,iBACE,oCACA,aACA,yCACA,uCACA,gDACA,2CACA,SACA,8BACA,2DACA,0DACA,8CAIF,+BACE,cAGF,wBACE,0CAGF,wBACE,0CAGF,2BACE,6CACA,iDAGF,wBACE,0CAGF,8BACE,gDAGF,8BACE,iDAIJ,WACE,8BACE,2BACE,eACA","file":"shared-styles.css"}
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // Generated stylesheet for ./field/internal/shared-styles.css.
7
7
  import { css } from 'lit';
8
- export const styles = css `:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}
8
+ export const styles = css `:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}
9
9
  `;
10
10
  //# sourceMappingURL=shared-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-styles.js","sourceRoot":"","sources":["shared-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+DAA+D;AAC/D,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./field/internal/shared-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}\n`;\n"]}
1
+ {"version":3,"file":"shared-styles.js","sourceRoot":"","sources":["shared-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+DAA+D;AAC/D,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./field/internal/shared-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@material/web",
3
- "version": "2.1.1-nightly.a9ee4f5.0",
3
+ "version": "2.2.1-nightly.1bdcbd3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sourceRoot":"","sources":["radio.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gDAAgD,CAAC;AACjF,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAC,cAAc,EAAC,MAAM,mCAAmC,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,oDAAoD,CAAC;AAElF,OAAO,EAAC,yBAAyB,EAAC,MAAM,kCAAkC,CAAC;AAE3E,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAClC,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,wCAAwC;AACxC,MAAM,cAAc,GAAG,yBAAyB,CAC9C,mBAAmB,CAAC,qBAAqB,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CACvE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,OAAO,KAAM,SA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AM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAEQ,iBAAiB;QACxB,0EAA0E;QAC1E,mDAAmD;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAEQ,wBAAwB,CAAC,KAAa;QAC7C,IAAI,CAAC,OAAO,GAAG,KAAK,KAAK,MAAM,CAAC;IAClC,CAAC;IAED,CAAC,eAAe,CAAC;QACf,OAAO,IAAI,cAAc,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC7B,sEAAsE;gBACtE,2DAA2D;gBAC3D,OAAO,CAAC,IAAI,CAAC,CAAC;aACf;YAED,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAA+B,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,CAAC,iBAAiB,CAAC;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA9IC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oCAGzB;AAkB0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCAAkB;AAKhC;IAAX,QAAQ,EAAE;oCAAc;AAEa;IAArC,KAAK,CAAC,YAAY,CAAC;wCAA0C","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {isActivationClick} from '../../internal/events/form-label-activation.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\nimport {mixinFocusable} from '../../labs/behaviors/focusable.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {RadioValidator} from '../../labs/behaviors/validators/radio-validator.js';\n\nimport {SingleSelectionController} from './single-selection-controller.js';\n\nconst CHECKED = Symbol('checked');\nlet maskId = 0;\n\n// Separate variable needed for closure.\nconst radioBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(mixinFocusable(LitElement))),\n);\n\n/**\n * A radio component.\n *\n * @fires input {InputEvent} Dispatched when the value changes from user\n * interaction. --bubbles\n * @fires change {Event} Dispatched when the value changes from user\n * interaction. --bubbles --composed\n */\nexport class Radio extends radioBaseClass {\n // Unique maskId is required because of a Safari bug that fail to persist\n // reference to the mask. This should be removed once the bug is fixed.\n private readonly maskId = `cutout${++maskId}`;\n\n /**\n * Whether or not the radio is selected.\n */\n @property({type: Boolean})\n get checked() {\n return this[CHECKED];\n }\n set checked(checked: boolean) {\n const wasChecked = this.checked;\n if (wasChecked === checked) {\n return;\n }\n\n this[CHECKED] = checked;\n this.requestUpdate('checked', wasChecked);\n this.selectionController.handleCheckedChange();\n }\n\n [CHECKED] = false;\n\n /**\n * Whether or not the radio is required. If any radio is required in a group,\n * all radios are implicitly required.\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @query('.container') private readonly container!: HTMLElement;\n private readonly selectionController = new SingleSelectionController(this);\n\n constructor() {\n super();\n this.addController(this.selectionController);\n if (!isServer) {\n this[internals].role = 'radio';\n this.addEventListener('click', this.handleClick.bind(this));\n this.addEventListener('keydown', this.handleKeydown.bind(this));\n }\n }\n\n protected override render() {\n const classes = {'checked': this.checked};\n return html`\n <div class=\"container ${classMap(classes)}\" aria-hidden=\"true\">\n <md-ripple\n part=\"ripple\"\n .control=${this}\n ?disabled=${this.disabled}></md-ripple>\n <md-focus-ring part=\"focus-ring\" .control=${this}></md-focus-ring>\n <svg class=\"icon\" viewBox=\"0 0 20 20\">\n <mask id=\"${this.maskId}\">\n <rect width=\"100%\" height=\"100%\" fill=\"white\" />\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"black\" />\n </mask>\n <circle\n class=\"outer circle\"\n cx=\"10\"\n cy=\"10\"\n r=\"10\"\n mask=\"url(#${this.maskId})\" />\n <circle class=\"inner circle\" cx=\"10\" cy=\"10\" r=\"5\" />\n </svg>\n\n <div class=\"touch-target\"></div>\n </div>\n `;\n }\n\n protected override updated() {\n this[internals].ariaChecked = String(this.checked);\n }\n\n private async handleClick(event: Event) {\n if (this.disabled) {\n return;\n }\n\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.defaultPrevented) {\n return;\n }\n\n if (isActivationClick(event)) {\n this.focus();\n }\n\n // Per spec, clicking on a radio input always selects it.\n this.checked = true;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n }\n\n private async handleKeydown(event: KeyboardEvent) {\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.key !== ' ' || event.defaultPrevented) {\n return;\n }\n\n this.click();\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.checked ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.checked);\n }\n\n override formResetCallback() {\n // The checked property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.checked = this.hasAttribute('checked');\n }\n\n override formStateRestoreCallback(state: string) {\n this.checked = state === 'true';\n }\n\n [createValidator]() {\n return new RadioValidator(() => {\n if (!this.selectionController) {\n // Validation runs on superclass construction, so selection controller\n // might not actually be ready until this class constructs.\n return [this];\n }\n\n return this.selectionController.controls as [Radio, ...Radio[]];\n });\n }\n\n [getValidityAnchor]() {\n return this.container;\n }\n}\n"]}
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["radio.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OA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ACxB,OAAO,IAAI,cAAc,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC7B,sEAAsE;gBACtE,2DAA2D;gBAC3D,OAAO,CAAC,IAAI,CAAC,CAAC;aACf;YAED,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAA+B,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAEQ,CAAC,iBAAiB,CAAC;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA9IC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oCAGzB;AAkB0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCAAkB;AAKhC;IAAX,QAAQ,EAAE;oCAAc;AAEa;IAArC,KAAK,CAAC,YAAY,CAAC;wCAA0C","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {isActivationClick} from '../../internal/events/form-label-activation.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\nimport {mixinFocusable} from '../../labs/behaviors/focusable.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {RadioValidator} from '../../labs/behaviors/validators/radio-validator.js';\n\nimport {SingleSelectionController} from './single-selection-controller.js';\n\nconst CHECKED = Symbol('checked');\nlet maskId = 0;\n\n// Separate variable needed for closure.\nconst radioBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(mixinFocusable(LitElement))),\n);\n\n/**\n * A radio component.\n *\n * @fires input {InputEvent} Dispatched when the value changes from user\n * interaction. --bubbles\n * @fires change {Event} Dispatched when the value changes from user\n * interaction. --bubbles --composed\n */\nexport class Radio extends radioBaseClass {\n // Unique maskId is required because of a Safari bug that fail to persist\n // reference to the mask. This should be removed once the bug is fixed.\n private readonly maskId = `cutout${++maskId}`;\n\n /**\n * Whether or not the radio is selected.\n */\n @property({type: Boolean})\n get checked() {\n return this[CHECKED];\n }\n set checked(checked: boolean) {\n const wasChecked = this.checked;\n if (wasChecked === checked) {\n return;\n }\n\n this[CHECKED] = checked;\n this.requestUpdate('checked', wasChecked);\n this.selectionController.handleCheckedChange();\n }\n\n [CHECKED] = false;\n\n /**\n * Whether or not the radio is required. If any radio is required in a group,\n * all radios are implicitly required.\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @query('.container') private readonly container!: HTMLElement;\n private readonly selectionController = new SingleSelectionController(this);\n\n constructor() {\n super();\n this.addController(this.selectionController);\n if (!isServer) {\n this[internals].role = 'radio';\n this.addEventListener('click', this.handleClick.bind(this));\n this.addEventListener('keydown', this.handleKeydown.bind(this));\n }\n }\n\n protected override render() {\n const classes = {'checked': this.checked};\n return html`\n <div class=\"container ${classMap(classes)}\" aria-hidden=\"true\">\n <md-ripple\n part=\"ripple\"\n .control=${this}\n ?disabled=${this.disabled}></md-ripple>\n <md-focus-ring part=\"focus-ring\" .control=${this}></md-focus-ring>\n <svg class=\"icon\" viewBox=\"0 0 20 20\">\n <mask id=\"${this.maskId}\">\n <rect width=\"100%\" height=\"100%\" fill=\"white\" />\n <circle cx=\"10\" cy=\"10\" r=\"8\" fill=\"black\" />\n </mask>\n <circle\n class=\"outer circle\"\n cx=\"10\"\n cy=\"10\"\n r=\"10\"\n mask=\"url(#${this.maskId})\" />\n <circle class=\"inner circle\" cx=\"10\" cy=\"10\" r=\"5\" />\n </svg>\n\n <div class=\"touch-target\"></div>\n </div>\n `;\n }\n\n protected override updated() {\n this[internals].ariaChecked = String(this.checked);\n }\n\n private async handleClick(event: Event) {\n if (this.disabled) {\n return;\n }\n\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.defaultPrevented) {\n return;\n }\n\n if (isActivationClick(event)) {\n this.focus();\n }\n\n // Per spec, clicking on a radio input always selects it.\n this.checked = true;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n }\n\n private async handleKeydown(event: KeyboardEvent) {\n // allow event to propagate to user code after a microtask.\n await 0;\n if (event.key !== ' ' || event.defaultPrevented) {\n return;\n }\n\n this.click();\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.checked ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.checked);\n }\n\n override formResetCallback() {\n // The checked property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.checked = this.hasAttribute('checked');\n }\n\n override formStateRestoreCallback(state: string) {\n this.checked = state === 'true';\n }\n\n override [createValidator]() {\n return new RadioValidator(() => {\n if (!this.selectionController) {\n // Validation runs on superclass construction, so selection controller\n // might not actually be ready until this class constructs.\n return [this];\n }\n\n return this.selectionController.controls as [Radio, ...Radio[]];\n });\n }\n\n override [getValidityAnchor]() {\n return this.container;\n }\n}\n"]}
@@ -288,6 +288,7 @@ export class Select extends selectBaseClass {
288
288
  };
289
289
  }
290
290
  renderField() {
291
+ const ariaLabel = this.ariaLabel || this.label;
291
292
  return staticHtml `
292
293
  <${this.fieldTag}
293
294
  aria-haspopup="listbox"
@@ -295,7 +296,7 @@ export class Select extends selectBaseClass {
295
296
  part="field"
296
297
  id="field"
297
298
  tabindex=${this.disabled ? '-1' : '0'}
298
- aria-label=${this.ariaLabel || nothing}
299
+ aria-label=${ariaLabel || nothing}
299
300
  aria-describedby="description"
300
301
  aria-expanded=${this.open ? 'true' : 'false'}
301
302
  aria-controls="listbox"
@@ -1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CAAC;yCAAsC;AAS1E;IADC,QAAQ,EAAE;mCAGV;AAuBD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAC,CAAC;2CAKrD;AAwCgB;IAAhB,KAAK,EAAE;2CAA6B;AAMpB;IAAhB,KAAK,EAAE;+CAA8B;AAKrB;IAAhB,KAAK,EAAE;uCAAyB;AAChB;IAAhB,KAAK,EAAE;oCAAsB;AACb;IAAhB,KAAK,EAAE;4CAAoD;AAC1B;IAAjC,KAAK,CAAC,QAAQ,CAAC;qCAAuC;AACpB;IAAlC,KAAK,CAAC,SAAS,CAAC;oCAAqC;AACpB;IAAjC,KAAK,CAAC,QAAQ,CAAC;uCAAwC;AAEvC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CACnB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../menu/menu.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.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 {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 {SelectValidator} from '../../labs/behaviors/validators/select-validator.js';\nimport {getActiveItem} from '../../list/internal/list-navigation-helpers.js';\nimport {\n CloseMenuEvent,\n FocusState,\n isElementInSubtree,\n isSelectableKey,\n} from '../../menu/internal/controllers/shared.js';\nimport {TYPEAHEAD_RECORD} from '../../menu/internal/controllers/typeaheadController.js';\nimport {DEFAULT_TYPEAHEAD_BUFFER_TIME, Menu} from '../../menu/internal/menu.js';\nimport {SelectOption} from './selectoption/select-option.js';\nimport {\n createRequestDeselectionEvent,\n createRequestSelectionEvent,\n} from './selectoption/selectOptionController.js';\nimport {getSelectedItems, SelectOptionRecord} from './shared.js';\n\nconst VALUE = Symbol('value');\n\n// Separate variable needed for closure.\nconst selectBaseClass = mixinDelegatesAria(\n mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n ),\n);\n\n/**\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 * @fires opening {Event} Fired when the select's menu is about to open.\n * @fires opened {Event} Fired when the select's menu has finished animations\n * and opened.\n * @fires closing {Event} Fired when the select's menu is about to close.\n * @fires closed {Event} Fired when the select's menu has finished animations\n * and closed.\n */\nexport abstract class Select extends selectBaseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Opens the menu synchronously with no animation.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Whether or not the select is required.\n */\n @property({type: Boolean}) required = 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({type: String, attribute: 'error-text'}) errorText = '';\n\n /**\n * The floating label for the field.\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the select is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Conveys additional information below the select, such as how it should\n * be used.\n */\n @property({type: String, attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Gets or sets whether or not the select 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 * Whether or not the underlying md-menu should be position: fixed to display\n * in a top-level manner, or position: absolute.\n *\n * position:fixed is useful for cases where select is inside of another\n * element with stacking context and hidden overflows such as `md-dialog`.\n */\n @property({attribute: 'menu-positioning'})\n menuPositioning: 'absolute' | 'fixed' | 'popover' = 'popover';\n\n /**\n * Clamps the menu-width to the width of the select.\n */\n @property({type: Boolean, attribute: 'clamp-menu-width'})\n clampMenuWidth = false;\n\n /**\n * The max time between the keystrokes of the typeahead select / menu behavior\n * before it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\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 * Text to display in the field. Only set for SSR.\n */\n @property({attribute: 'display-text'}) displayText = '';\n\n /**\n * Whether the menu should be aligned to the start or the end of the select's\n * textbox.\n */\n @property({attribute: 'menu-align'}) menuAlign: 'start' | 'end' = 'start';\n\n /**\n * The value of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `value` setting `value` will incur a DOM query.\n */\n @property()\n get value(): string {\n return this[VALUE];\n }\n\n set value(value: string) {\n if (isServer) return;\n this.lastUserSetValue = value;\n this.select(value);\n }\n\n [VALUE] = '';\n\n get options() {\n // NOTE: this does a DOM query.\n return (this.menu?.items ?? []) as SelectOption[];\n }\n\n /**\n * The index of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `selectedIndex` setting `selectedIndex` will incur a\n * DOM query.\n */\n @property({type: Number, attribute: 'selected-index'})\n get selectedIndex(): number {\n // tslint:disable-next-line:enforce-name-casing\n const [_option, index] = (this.getSelectedOptions() ?? [])[0] ?? [];\n return index ?? -1;\n }\n\n set selectedIndex(index: number) {\n this.lastUserSetSelectedIndex = index;\n this.selectIndex(index);\n }\n\n /**\n * Returns an array of selected options.\n *\n * NOTE: md-select only supports single selection.\n */\n get selectedOptions() {\n return (this.getSelectedOptions() ?? []).map(([option]) => option);\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Used for initializing select when the user sets the `value` directly.\n */\n private lastUserSetValue: string | null = null;\n\n /**\n * Used for initializing select when the user sets the `selectedIndex`\n * directly.\n */\n private lastUserSetSelectedIndex: number | null = null;\n\n /**\n * Used for `input` and `change` event change detection.\n */\n private lastSelectedOption: SelectOption | null = null;\n\n // tslint:disable-next-line:enforce-name-casing\n private lastSelectedOptionRecords: SelectOptionRecord[] = [];\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @state() private focused = false;\n @state() private open = false;\n @state() private defaultFocus: FocusState = FocusState.NONE;\n @query('.field') private readonly field!: Field | null;\n @query('md-menu') private readonly menu!: Menu | null;\n @query('#label') private readonly labelEl!: HTMLElement;\n @queryAssignedElements({slot: 'leading-icon', flatten: true})\n private readonly leadingIcons!: Element[];\n // Have to keep track of previous open because it's state and private and thus\n // cannot be tracked in PropertyValues<this> map.\n private prevOpen = this.open;\n private selectWidth = 0;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n this.addEventListener('focus', this.handleFocus.bind(this));\n this.addEventListener('blur', this.handleBlur.bind(this));\n }\n\n /**\n * Selects an option given the value of the option, and updates MdSelect's\n * value.\n */\n select(value: string) {\n const optionToSelect = this.options.find(\n (option) => option.value === value,\n );\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Selects an option given the index of the option, and updates MdSelect's\n * value.\n */\n selectIndex(index: number) {\n const optionToSelect = this.options[index];\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Reset the select to its default value.\n */\n reset() {\n for (const option of this.options) {\n option.selected = option.hasAttribute('selected');\n }\n\n this.updateValueAndDisplayText();\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\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 protected override update(changed: PropertyValues<Select>) {\n // In SSR the options will be ready to query, so try to figure out what\n // the value and display text should be.\n if (!this.hasUpdated) {\n this.initUserSelection();\n }\n\n // We have just opened the menu.\n // We are only able to check for the select's rect in `update()` instead of\n // having to wait for `updated()` because the menu can never be open on\n // first render since it is not settable and Lit SSR does not support click\n // events which would open the menu.\n if (this.prevOpen !== this.open && this.open) {\n const selectRect = this.getBoundingClientRect();\n this.selectWidth = selectRect.width;\n }\n\n this.prevOpen = this.open;\n super.update(changed);\n }\n\n protected override render() {\n return html`\n <span\n class=\"select ${classMap(this.getRenderClasses())}\"\n @focusout=${this.handleFocusout}>\n ${this.renderField()} ${this.renderMenu()}\n </span>\n `;\n }\n\n protected override async firstUpdated(changed: PropertyValues<Select>) {\n await this.menu?.updateComplete;\n // If this has been handled on update already due to SSR, try again.\n if (!this.lastSelectedOptionRecords.length) {\n this.initUserSelection();\n }\n\n // Case for when the DOM is streaming, there are no children, and a child\n // has [selected] set on it, we need to wait for DOM to render something.\n if (\n !this.lastSelectedOptionRecords.length &&\n !isServer &&\n !this.options.length\n ) {\n setTimeout(() => {\n this.updateValueAndDisplayText();\n });\n }\n\n super.firstUpdated(changed);\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'disabled': this.disabled,\n 'error': this.error,\n 'open': this.open,\n };\n }\n\n private renderField() {\n return staticHtml`\n <${this.fieldTag}\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n part=\"field\"\n id=\"field\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${(this as ARIAMixinStrict).ariaLabel || nothing}\n aria-describedby=\"description\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"listbox\"\n class=\"field\"\n label=${this.label}\n ?no-asterisk=${this.noAsterisk}\n .focused=${this.focused || this.open}\n .populated=${!!this.displayText}\n .disabled=${this.disabled}\n .required=${this.required}\n .error=${this.hasError}\n ?has-start=${this.hasLeadingIcon}\n has-end\n supporting-text=${this.supportingText}\n error-text=${this.getErrorText()}\n @keydown=${this.handleKeydown}\n @click=${this.handleClick}>\n ${this.renderFieldContent()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderFieldContent() {\n return [\n this.renderLeadingIcon(),\n this.renderLabel(),\n this.renderTrailingIcon(),\n ];\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}>\n <svg height=\"5\" viewBox=\"7 10 10 5\" focusable=\"false\">\n <polygon\n class=\"down\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"></polygon>\n <polygon\n class=\"up\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 15 12 10 17 15\"></polygon>\n </svg>\n </slot>\n </span>\n `;\n }\n\n private renderLabel() {\n // need to render &nbsp; so that line-height can apply and give it a\n // non-zero height\n return html`<div id=\"label\">${this.displayText || html`&nbsp;`}</div>`;\n }\n\n private renderMenu() {\n const ariaLabel = this.label || (this as ARIAMixinStrict).ariaLabel;\n return html`<div class=\"menu-wrapper\">\n <md-menu\n id=\"listbox\"\n .defaultFocus=${this.defaultFocus}\n role=\"listbox\"\n tabindex=\"-1\"\n aria-label=${ariaLabel || nothing}\n stay-open-on-focusout\n part=\"menu\"\n exportparts=\"focus-ring: menu-focus-ring\"\n anchor=\"field\"\n style=${styleMap({\n '--__menu-min-width': `${this.selectWidth}px`,\n '--__menu-max-width': this.clampMenuWidth\n ? `${this.selectWidth}px`\n : undefined,\n })}\n no-navigation-wrap\n .open=${this.open}\n .quick=${this.quick}\n .positioning=${this.menuPositioning}\n .typeaheadDelay=${this.typeaheadDelay}\n .anchorCorner=${this.menuAlign === 'start' ? 'end-start' : 'end-end'}\n .menuCorner=${this.menuAlign === 'start' ? 'start-start' : 'start-end'}\n @opening=${this.handleOpening}\n @opened=${this.redispatchEvent}\n @closing=${this.redispatchEvent}\n @closed=${this.handleClosed}\n @close-menu=${this.handleCloseMenu}\n @request-selection=${this.handleRequestSelection}\n @request-deselection=${this.handleRequestDeselection}>\n ${this.renderMenuContent()}\n </md-menu>\n </div>`;\n }\n\n private renderMenuContent() {\n return html`<slot></slot>`;\n }\n\n /**\n * Handles opening the select on keydown and typahead selection when the menu\n * is closed.\n */\n private handleKeydown(event: KeyboardEvent) {\n if (this.open || this.disabled || !this.menu) {\n return;\n }\n\n const typeaheadController = this.menu.typeaheadController;\n const isOpenKey =\n event.code === 'Space' ||\n event.code === 'ArrowDown' ||\n event.code === 'ArrowUp' ||\n event.code === 'End' ||\n event.code === 'Home' ||\n event.code === 'Enter';\n\n // Do not open if currently typing ahead because the user may be typing the\n // spacebar to match a word with a space\n if (!typeaheadController.isTypingAhead && isOpenKey) {\n event.preventDefault();\n this.open = true;\n\n // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/#kbd_label\n switch (event.code) {\n case 'Space':\n case 'ArrowDown':\n case 'Enter':\n // We will handle focusing last selected item in this.handleOpening()\n this.defaultFocus = FocusState.NONE;\n break;\n case 'End':\n this.defaultFocus = FocusState.LAST_ITEM;\n break;\n case 'ArrowUp':\n case 'Home':\n this.defaultFocus = FocusState.FIRST_ITEM;\n break;\n default:\n break;\n }\n return;\n }\n\n const isPrintableKey = event.key.length === 1;\n\n // Handles typing ahead when the menu is closed by delegating the event to\n // the underlying menu's typeaheadController\n if (isPrintableKey) {\n typeaheadController.onKeydown(event);\n event.preventDefault();\n\n const {lastActiveRecord} = typeaheadController;\n\n if (!lastActiveRecord) {\n return;\n }\n\n this.labelEl?.setAttribute?.('aria-live', 'polite');\n const hasChanged = this.selectItem(\n lastActiveRecord[TYPEAHEAD_RECORD.ITEM] as SelectOption,\n );\n\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n }\n\n private handleClick() {\n this.open = !this.open;\n }\n\n private handleFocus() {\n this.focused = true;\n }\n\n private handleBlur() {\n this.focused = false;\n }\n\n /**\n * Handles closing the menu when the focus leaves the select's subtree.\n */\n private handleFocusout(event: FocusEvent) {\n // Don't close the menu if we are switching focus between menu,\n // select-option, and field\n if (event.relatedTarget && isElementInSubtree(event.relatedTarget, this)) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Gets a list of all selected select options as a list item record array.\n *\n * @return An array of selected list option records.\n */\n private getSelectedOptions() {\n if (!this.menu) {\n this.lastSelectedOptionRecords = [];\n return null;\n }\n\n const items = this.menu.items as SelectOption[];\n this.lastSelectedOptionRecords = getSelectedItems(items);\n return this.lastSelectedOptionRecords;\n }\n\n override async getUpdateComplete() {\n await this.menu?.updateComplete;\n return super.getUpdateComplete();\n }\n\n /**\n * Gets the selected options from the DOM, and updates the value and display\n * text to the first selected option's value and headline respectively.\n *\n * @return Whether or not the selected option has changed since last update.\n */\n private updateValueAndDisplayText() {\n const selectedOptions = this.getSelectedOptions() ?? [];\n // Used to determine whether or not we need to fire an input / change event\n // which fire whenever the option element changes (value or selectedIndex)\n // on user interaction.\n let hasSelectedOptionChanged = false;\n\n if (selectedOptions.length) {\n const [firstSelectedOption] = selectedOptions[0];\n hasSelectedOptionChanged =\n this.lastSelectedOption !== firstSelectedOption;\n this.lastSelectedOption = firstSelectedOption;\n this[VALUE] = firstSelectedOption.value;\n this.displayText = firstSelectedOption.displayText;\n } else {\n hasSelectedOptionChanged = this.lastSelectedOption !== null;\n this.lastSelectedOption = null;\n this[VALUE] = '';\n this.displayText = '';\n }\n\n return hasSelectedOptionChanged;\n }\n\n /**\n * Focuses and activates the last selected item upon opening, and resets other\n * active items.\n */\n private async handleOpening(e: Event) {\n this.labelEl?.removeAttribute?.('aria-live');\n this.redispatchEvent(e);\n\n // FocusState.NONE means we want to handle focus ourselves and focus the\n // last selected item.\n if (this.defaultFocus !== FocusState.NONE) {\n return;\n }\n\n const items = this.menu!.items as SelectOption[];\n const activeItem = getActiveItem(items)?.item;\n let [selectedItem] = this.lastSelectedOptionRecords[0] ?? [null];\n\n // This is true if the user keys through the list but clicks out of the menu\n // thus no close-menu event is fired by an item and we can't clean up in\n // handleCloseMenu.\n if (activeItem && activeItem !== selectedItem) {\n activeItem.tabIndex = -1;\n }\n\n // in the case that nothing is selected, focus the first item\n selectedItem = selectedItem ?? items[0];\n\n if (selectedItem) {\n selectedItem.tabIndex = 0;\n selectedItem.focus();\n }\n }\n\n private redispatchEvent(e: Event) {\n redispatchEvent(this, e);\n }\n\n private handleClosed(e: Event) {\n this.open = false;\n this.redispatchEvent(e);\n }\n\n /**\n * Determines the reason for closing, and updates the UI accordingly.\n */\n private handleCloseMenu(event: CloseMenuEvent) {\n const reason = event.detail.reason;\n const item = event.detail.itemPath[0] as SelectOption;\n this.open = false;\n let hasChanged = false;\n\n if (reason.kind === 'click-selection') {\n hasChanged = this.selectItem(item);\n } else if (reason.kind === 'keydown' && isSelectableKey(reason.key)) {\n hasChanged = this.selectItem(item);\n } else {\n // This can happen on ESC being pressed\n item.tabIndex = -1;\n item.blur();\n }\n\n // Dispatch interaction events since selection has been made via keyboard\n // or mouse.\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n\n /**\n * Selects a given option, deselects other options, and updates the UI.\n *\n * @return Whether the last selected option has changed.\n */\n private selectItem(item: SelectOption) {\n const selectedOptions = this.getSelectedOptions() ?? [];\n selectedOptions.forEach(([option]) => {\n if (item !== option) {\n option.selected = false;\n }\n });\n item.selected = true;\n\n return this.updateValueAndDisplayText();\n }\n\n /**\n * Handles updating selection when an option element requests selection via\n * property / attribute change.\n */\n private handleRequestSelection(\n event: ReturnType<typeof createRequestSelectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is already selected.\n if (\n this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.selectItem(requestingOptionEl);\n }\n\n /**\n * Handles updating selection when an option element requests deselection via\n * property / attribute change.\n */\n private handleRequestDeselection(\n event: ReturnType<typeof createRequestDeselectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is not even in the list of tracked selected items.\n if (\n !this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.updateValueAndDisplayText();\n }\n\n /**\n * Attempts to initialize the selected option from user-settable values like\n * SSR, setting `value`, or `selectedIndex` at startup.\n */\n private initUserSelection() {\n // User has set `.value` directly, but internals have not yet booted up.\n if (this.lastUserSetValue && !this.lastSelectedOptionRecords.length) {\n this.select(this.lastUserSetValue);\n\n // User has set `.selectedIndex` directly, but internals have not yet\n // booted up.\n } else if (\n this.lastUserSetSelectedIndex !== null &&\n !this.lastSelectedOptionRecords.length\n ) {\n this.selectIndex(this.lastUserSetSelectedIndex);\n\n // Regular boot up!\n } else {\n this.updateValueAndDisplayText();\n }\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n }\n\n /**\n * Dispatches the `input` and `change` events.\n */\n private dispatchInteractionEvents() {\n this.dispatchEvent(new Event('input', {bubbles: true, composed: true}));\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\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 click() {\n this.field?.click();\n }\n\n [createValidator]() {\n return new SelectValidator(() => this);\n }\n\n [getValidityAnchor]() {\n return this.field;\n }\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,IAAI,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,eAAe,EAAC,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,qDAAqD,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kB,EAAC,CAAC;+CACoB;AAM9D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAC,CAAC;8CAClC;AAOvB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAC,CAAC;8CACR;AAM/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAC,CAAC;8CAClC;AAKgB;IAAtC,QAAQ,CAAC,EAAC,SAAS,EAAE,cAAc,EAAC,CAAC;2CAAkB;AAMnB;IAApC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;yCAAsC;AAS1E;IADC,QAAQ,EAAE;mCAGV;AAuBD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAC,CAAC;2CAKrD;AAwCgB;IAAhB,KAAK,EAAE;2CAA6B;AAMpB;IAAhB,KAAK,EAAE;+CAA8B;AAKrB;IAAhB,KAAK,EAAE;uCAAyB;AAChB;IAAhB,KAAK,EAAE;oCAAsB;AACb;IAAhB,KAAK,EAAE;4CAAoD;AAC1B;IAAjC,KAAK,CAAC,QAAQ,CAAC;qCAAuC;AACpB;IAAlC,KAAK,CAAC,SAAS,CAAC;oCAAqC;AACpB;IAAjC,KAAK,CAAC,QAAQ,CAAC;uCAAwC;AAEvC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CACnB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../menu/menu.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.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 {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 {SelectValidator} from '../../labs/behaviors/validators/select-validator.js';\nimport {getActiveItem} from '../../list/internal/list-navigation-helpers.js';\nimport {\n CloseMenuEvent,\n FocusState,\n isElementInSubtree,\n isSelectableKey,\n} from '../../menu/internal/controllers/shared.js';\nimport {TYPEAHEAD_RECORD} from '../../menu/internal/controllers/typeaheadController.js';\nimport {DEFAULT_TYPEAHEAD_BUFFER_TIME, Menu} from '../../menu/internal/menu.js';\nimport {SelectOption} from './selectoption/select-option.js';\nimport {\n createRequestDeselectionEvent,\n createRequestSelectionEvent,\n} from './selectoption/selectOptionController.js';\nimport {getSelectedItems, SelectOptionRecord} from './shared.js';\n\nconst VALUE = Symbol('value');\n\n// Separate variable needed for closure.\nconst selectBaseClass = mixinDelegatesAria(\n mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n ),\n);\n\n/**\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 * @fires opening {Event} Fired when the select's menu is about to open.\n * @fires opened {Event} Fired when the select's menu has finished animations\n * and opened.\n * @fires closing {Event} Fired when the select's menu is about to close.\n * @fires closed {Event} Fired when the select's menu has finished animations\n * and closed.\n */\nexport abstract class Select extends selectBaseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Opens the menu synchronously with no animation.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Whether or not the select is required.\n */\n @property({type: Boolean}) required = 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({type: String, attribute: 'error-text'}) errorText = '';\n\n /**\n * The floating label for the field.\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the select is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Conveys additional information below the select, such as how it should\n * be used.\n */\n @property({type: String, attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Gets or sets whether or not the select 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 * Whether or not the underlying md-menu should be position: fixed to display\n * in a top-level manner, or position: absolute.\n *\n * position:fixed is useful for cases where select is inside of another\n * element with stacking context and hidden overflows such as `md-dialog`.\n */\n @property({attribute: 'menu-positioning'})\n menuPositioning: 'absolute' | 'fixed' | 'popover' = 'popover';\n\n /**\n * Clamps the menu-width to the width of the select.\n */\n @property({type: Boolean, attribute: 'clamp-menu-width'})\n clampMenuWidth = false;\n\n /**\n * The max time between the keystrokes of the typeahead select / menu behavior\n * before it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\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 * Text to display in the field. Only set for SSR.\n */\n @property({attribute: 'display-text'}) displayText = '';\n\n /**\n * Whether the menu should be aligned to the start or the end of the select's\n * textbox.\n */\n @property({attribute: 'menu-align'}) menuAlign: 'start' | 'end' = 'start';\n\n /**\n * The value of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `value` setting `value` will incur a DOM query.\n */\n @property()\n get value(): string {\n return this[VALUE];\n }\n\n set value(value: string) {\n if (isServer) return;\n this.lastUserSetValue = value;\n this.select(value);\n }\n\n [VALUE] = '';\n\n get options() {\n // NOTE: this does a DOM query.\n return (this.menu?.items ?? []) as SelectOption[];\n }\n\n /**\n * The index of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `selectedIndex` setting `selectedIndex` will incur a\n * DOM query.\n */\n @property({type: Number, attribute: 'selected-index'})\n get selectedIndex(): number {\n // tslint:disable-next-line:enforce-name-casing\n const [_option, index] = (this.getSelectedOptions() ?? [])[0] ?? [];\n return index ?? -1;\n }\n\n set selectedIndex(index: number) {\n this.lastUserSetSelectedIndex = index;\n this.selectIndex(index);\n }\n\n /**\n * Returns an array of selected options.\n *\n * NOTE: md-select only supports single selection.\n */\n get selectedOptions() {\n return (this.getSelectedOptions() ?? []).map(([option]) => option);\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Used for initializing select when the user sets the `value` directly.\n */\n private lastUserSetValue: string | null = null;\n\n /**\n * Used for initializing select when the user sets the `selectedIndex`\n * directly.\n */\n private lastUserSetSelectedIndex: number | null = null;\n\n /**\n * Used for `input` and `change` event change detection.\n */\n private lastSelectedOption: SelectOption | null = null;\n\n // tslint:disable-next-line:enforce-name-casing\n private lastSelectedOptionRecords: SelectOptionRecord[] = [];\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @state() private focused = false;\n @state() private open = false;\n @state() private defaultFocus: FocusState = FocusState.NONE;\n @query('.field') private readonly field!: Field | null;\n @query('md-menu') private readonly menu!: Menu | null;\n @query('#label') private readonly labelEl!: HTMLElement;\n @queryAssignedElements({slot: 'leading-icon', flatten: true})\n private readonly leadingIcons!: Element[];\n // Have to keep track of previous open because it's state and private and thus\n // cannot be tracked in PropertyValues<this> map.\n private prevOpen = this.open;\n private selectWidth = 0;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n this.addEventListener('focus', this.handleFocus.bind(this));\n this.addEventListener('blur', this.handleBlur.bind(this));\n }\n\n /**\n * Selects an option given the value of the option, and updates MdSelect's\n * value.\n */\n select(value: string) {\n const optionToSelect = this.options.find(\n (option) => option.value === value,\n );\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Selects an option given the index of the option, and updates MdSelect's\n * value.\n */\n selectIndex(index: number) {\n const optionToSelect = this.options[index];\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Reset the select to its default value.\n */\n reset() {\n for (const option of this.options) {\n option.selected = option.hasAttribute('selected');\n }\n\n this.updateValueAndDisplayText();\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n override [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\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 protected override update(changed: PropertyValues<Select>) {\n // In SSR the options will be ready to query, so try to figure out what\n // the value and display text should be.\n if (!this.hasUpdated) {\n this.initUserSelection();\n }\n\n // We have just opened the menu.\n // We are only able to check for the select's rect in `update()` instead of\n // having to wait for `updated()` because the menu can never be open on\n // first render since it is not settable and Lit SSR does not support click\n // events which would open the menu.\n if (this.prevOpen !== this.open && this.open) {\n const selectRect = this.getBoundingClientRect();\n this.selectWidth = selectRect.width;\n }\n\n this.prevOpen = this.open;\n super.update(changed);\n }\n\n protected override render() {\n return html`\n <span\n class=\"select ${classMap(this.getRenderClasses())}\"\n @focusout=${this.handleFocusout}>\n ${this.renderField()} ${this.renderMenu()}\n </span>\n `;\n }\n\n protected override async firstUpdated(changed: PropertyValues<Select>) {\n await this.menu?.updateComplete;\n // If this has been handled on update already due to SSR, try again.\n if (!this.lastSelectedOptionRecords.length) {\n this.initUserSelection();\n }\n\n // Case for when the DOM is streaming, there are no children, and a child\n // has [selected] set on it, we need to wait for DOM to render something.\n if (\n !this.lastSelectedOptionRecords.length &&\n !isServer &&\n !this.options.length\n ) {\n setTimeout(() => {\n this.updateValueAndDisplayText();\n });\n }\n\n super.firstUpdated(changed);\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'disabled': this.disabled,\n 'error': this.error,\n 'open': this.open,\n };\n }\n\n private renderField() {\n const ariaLabel = (this as ARIAMixinStrict).ariaLabel || this.label;\n return staticHtml`\n <${this.fieldTag}\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n part=\"field\"\n id=\"field\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${ariaLabel || nothing}\n aria-describedby=\"description\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"listbox\"\n class=\"field\"\n label=${this.label}\n ?no-asterisk=${this.noAsterisk}\n .focused=${this.focused || this.open}\n .populated=${!!this.displayText}\n .disabled=${this.disabled}\n .required=${this.required}\n .error=${this.hasError}\n ?has-start=${this.hasLeadingIcon}\n has-end\n supporting-text=${this.supportingText}\n error-text=${this.getErrorText()}\n @keydown=${this.handleKeydown}\n @click=${this.handleClick}>\n ${this.renderFieldContent()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderFieldContent() {\n return [\n this.renderLeadingIcon(),\n this.renderLabel(),\n this.renderTrailingIcon(),\n ];\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}>\n <svg height=\"5\" viewBox=\"7 10 10 5\" focusable=\"false\">\n <polygon\n class=\"down\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"></polygon>\n <polygon\n class=\"up\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 15 12 10 17 15\"></polygon>\n </svg>\n </slot>\n </span>\n `;\n }\n\n private renderLabel() {\n // need to render &nbsp; so that line-height can apply and give it a\n // non-zero height\n return html`<div id=\"label\">${this.displayText || html`&nbsp;`}</div>`;\n }\n\n private renderMenu() {\n const ariaLabel = this.label || (this as ARIAMixinStrict).ariaLabel;\n return html`<div class=\"menu-wrapper\">\n <md-menu\n id=\"listbox\"\n .defaultFocus=${this.defaultFocus}\n role=\"listbox\"\n tabindex=\"-1\"\n aria-label=${ariaLabel || nothing}\n stay-open-on-focusout\n part=\"menu\"\n exportparts=\"focus-ring: menu-focus-ring\"\n anchor=\"field\"\n style=${styleMap({\n '--__menu-min-width': `${this.selectWidth}px`,\n '--__menu-max-width': this.clampMenuWidth\n ? `${this.selectWidth}px`\n : undefined,\n })}\n no-navigation-wrap\n .open=${this.open}\n .quick=${this.quick}\n .positioning=${this.menuPositioning}\n .typeaheadDelay=${this.typeaheadDelay}\n .anchorCorner=${this.menuAlign === 'start' ? 'end-start' : 'end-end'}\n .menuCorner=${this.menuAlign === 'start' ? 'start-start' : 'start-end'}\n @opening=${this.handleOpening}\n @opened=${this.redispatchEvent}\n @closing=${this.redispatchEvent}\n @closed=${this.handleClosed}\n @close-menu=${this.handleCloseMenu}\n @request-selection=${this.handleRequestSelection}\n @request-deselection=${this.handleRequestDeselection}>\n ${this.renderMenuContent()}\n </md-menu>\n </div>`;\n }\n\n private renderMenuContent() {\n return html`<slot></slot>`;\n }\n\n /**\n * Handles opening the select on keydown and typahead selection when the menu\n * is closed.\n */\n private handleKeydown(event: KeyboardEvent) {\n if (this.open || this.disabled || !this.menu) {\n return;\n }\n\n const typeaheadController = this.menu.typeaheadController;\n const isOpenKey =\n event.code === 'Space' ||\n event.code === 'ArrowDown' ||\n event.code === 'ArrowUp' ||\n event.code === 'End' ||\n event.code === 'Home' ||\n event.code === 'Enter';\n\n // Do not open if currently typing ahead because the user may be typing the\n // spacebar to match a word with a space\n if (!typeaheadController.isTypingAhead && isOpenKey) {\n event.preventDefault();\n this.open = true;\n\n // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/#kbd_label\n switch (event.code) {\n case 'Space':\n case 'ArrowDown':\n case 'Enter':\n // We will handle focusing last selected item in this.handleOpening()\n this.defaultFocus = FocusState.NONE;\n break;\n case 'End':\n this.defaultFocus = FocusState.LAST_ITEM;\n break;\n case 'ArrowUp':\n case 'Home':\n this.defaultFocus = FocusState.FIRST_ITEM;\n break;\n default:\n break;\n }\n return;\n }\n\n const isPrintableKey = event.key.length === 1;\n\n // Handles typing ahead when the menu is closed by delegating the event to\n // the underlying menu's typeaheadController\n if (isPrintableKey) {\n typeaheadController.onKeydown(event);\n event.preventDefault();\n\n const {lastActiveRecord} = typeaheadController;\n\n if (!lastActiveRecord) {\n return;\n }\n\n this.labelEl?.setAttribute?.('aria-live', 'polite');\n const hasChanged = this.selectItem(\n lastActiveRecord[TYPEAHEAD_RECORD.ITEM] as SelectOption,\n );\n\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n }\n\n private handleClick() {\n this.open = !this.open;\n }\n\n private handleFocus() {\n this.focused = true;\n }\n\n private handleBlur() {\n this.focused = false;\n }\n\n /**\n * Handles closing the menu when the focus leaves the select's subtree.\n */\n private handleFocusout(event: FocusEvent) {\n // Don't close the menu if we are switching focus between menu,\n // select-option, and field\n if (event.relatedTarget && isElementInSubtree(event.relatedTarget, this)) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Gets a list of all selected select options as a list item record array.\n *\n * @return An array of selected list option records.\n */\n private getSelectedOptions() {\n if (!this.menu) {\n this.lastSelectedOptionRecords = [];\n return null;\n }\n\n const items = this.menu.items as SelectOption[];\n this.lastSelectedOptionRecords = getSelectedItems(items);\n return this.lastSelectedOptionRecords;\n }\n\n override async getUpdateComplete() {\n await this.menu?.updateComplete;\n return super.getUpdateComplete();\n }\n\n /**\n * Gets the selected options from the DOM, and updates the value and display\n * text to the first selected option's value and headline respectively.\n *\n * @return Whether or not the selected option has changed since last update.\n */\n private updateValueAndDisplayText() {\n const selectedOptions = this.getSelectedOptions() ?? [];\n // Used to determine whether or not we need to fire an input / change event\n // which fire whenever the option element changes (value or selectedIndex)\n // on user interaction.\n let hasSelectedOptionChanged = false;\n\n if (selectedOptions.length) {\n const [firstSelectedOption] = selectedOptions[0];\n hasSelectedOptionChanged =\n this.lastSelectedOption !== firstSelectedOption;\n this.lastSelectedOption = firstSelectedOption;\n this[VALUE] = firstSelectedOption.value;\n this.displayText = firstSelectedOption.displayText;\n } else {\n hasSelectedOptionChanged = this.lastSelectedOption !== null;\n this.lastSelectedOption = null;\n this[VALUE] = '';\n this.displayText = '';\n }\n\n return hasSelectedOptionChanged;\n }\n\n /**\n * Focuses and activates the last selected item upon opening, and resets other\n * active items.\n */\n private async handleOpening(e: Event) {\n this.labelEl?.removeAttribute?.('aria-live');\n this.redispatchEvent(e);\n\n // FocusState.NONE means we want to handle focus ourselves and focus the\n // last selected item.\n if (this.defaultFocus !== FocusState.NONE) {\n return;\n }\n\n const items = this.menu!.items as SelectOption[];\n const activeItem = getActiveItem(items)?.item;\n let [selectedItem] = this.lastSelectedOptionRecords[0] ?? [null];\n\n // This is true if the user keys through the list but clicks out of the menu\n // thus no close-menu event is fired by an item and we can't clean up in\n // handleCloseMenu.\n if (activeItem && activeItem !== selectedItem) {\n activeItem.tabIndex = -1;\n }\n\n // in the case that nothing is selected, focus the first item\n selectedItem = selectedItem ?? items[0];\n\n if (selectedItem) {\n selectedItem.tabIndex = 0;\n selectedItem.focus();\n }\n }\n\n private redispatchEvent(e: Event) {\n redispatchEvent(this, e);\n }\n\n private handleClosed(e: Event) {\n this.open = false;\n this.redispatchEvent(e);\n }\n\n /**\n * Determines the reason for closing, and updates the UI accordingly.\n */\n private handleCloseMenu(event: CloseMenuEvent) {\n const reason = event.detail.reason;\n const item = event.detail.itemPath[0] as SelectOption;\n this.open = false;\n let hasChanged = false;\n\n if (reason.kind === 'click-selection') {\n hasChanged = this.selectItem(item);\n } else if (reason.kind === 'keydown' && isSelectableKey(reason.key)) {\n hasChanged = this.selectItem(item);\n } else {\n // This can happen on ESC being pressed\n item.tabIndex = -1;\n item.blur();\n }\n\n // Dispatch interaction events since selection has been made via keyboard\n // or mouse.\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n\n /**\n * Selects a given option, deselects other options, and updates the UI.\n *\n * @return Whether the last selected option has changed.\n */\n private selectItem(item: SelectOption) {\n const selectedOptions = this.getSelectedOptions() ?? [];\n selectedOptions.forEach(([option]) => {\n if (item !== option) {\n option.selected = false;\n }\n });\n item.selected = true;\n\n return this.updateValueAndDisplayText();\n }\n\n /**\n * Handles updating selection when an option element requests selection via\n * property / attribute change.\n */\n private handleRequestSelection(\n event: ReturnType<typeof createRequestSelectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is already selected.\n if (\n this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.selectItem(requestingOptionEl);\n }\n\n /**\n * Handles updating selection when an option element requests deselection via\n * property / attribute change.\n */\n private handleRequestDeselection(\n event: ReturnType<typeof createRequestDeselectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is not even in the list of tracked selected items.\n if (\n !this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.updateValueAndDisplayText();\n }\n\n /**\n * Attempts to initialize the selected option from user-settable values like\n * SSR, setting `value`, or `selectedIndex` at startup.\n */\n private initUserSelection() {\n // User has set `.value` directly, but internals have not yet booted up.\n if (this.lastUserSetValue && !this.lastSelectedOptionRecords.length) {\n this.select(this.lastUserSetValue);\n\n // User has set `.selectedIndex` directly, but internals have not yet\n // booted up.\n } else if (\n this.lastUserSetSelectedIndex !== null &&\n !this.lastSelectedOptionRecords.length\n ) {\n this.selectIndex(this.lastUserSetSelectedIndex);\n\n // Regular boot up!\n } else {\n this.updateValueAndDisplayText();\n }\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n }\n\n /**\n * Dispatches the `input` and `change` events.\n */\n private dispatchInteractionEvents() {\n this.dispatchEvent(new Event('input', {bubbles: true, composed: true}));\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\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 click() {\n this.field?.click();\n }\n\n override [createValidator]() {\n return new SelectValidator(() => this);\n }\n\n override [getValidityAnchor]() {\n return this.field;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAi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AC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAEQ,wBAAwB,CAAC,KAAa;QAC7C,IAAI,CAAC,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACnC,CAAC;IAED,CAAC,eAAe,CAAC;QACf,OAAO,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,CAAC,iBAAiB,CAAC;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AA1MD,kBAAkB;AACF,wBAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAMyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAKjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qCAAe;AAOzC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;oDACnC;AAQF;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAMhC;IAAX,QAAQ,EAAE;qCAAc;AAEQ;IAAhC,KAAK,CAAC,OAAO,CAAC;qCAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../internal/events/dispatch-hooks.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinDelegatesAria(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n // This click listener does not currently need dispatch hooks since it does\n // not check `event.defaultPrevented`.\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n\n // Add the aria keyboard interaction pattern for switch and the Enter key.\n // See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.\n setupDispatchHooks(this, 'keydown');\n this.addEventListener('keydown', (event: KeyboardEvent) => {\n afterDispatch(event, () => {\n const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';\n if (ignoreEvent || this.disabled || !this.input) {\n return;\n }\n\n this.input.click();\n });\n });\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @input=${this.handleInput}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleInput(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n // <input> 'input' event bubbles and is composed, don't re-dispatch it.\n }\n\n private handleChange(event: Event) {\n // <input> 'change' event is not composed, re-dispatch it.\n redispatchEvent(this, event);\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.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n [getValidityAnchor]() {\n return this.input;\n }\n}\n"]}
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE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/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../internal/events/dispatch-hooks.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinDelegatesAria(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n // This click listener does not currently need dispatch hooks since it does\n // not check `event.defaultPrevented`.\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n\n // Add the aria keyboard interaction pattern for switch and the Enter key.\n // See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.\n setupDispatchHooks(this, 'keydown');\n this.addEventListener('keydown', (event: KeyboardEvent) => {\n afterDispatch(event, () => {\n const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';\n if (ignoreEvent || this.disabled || !this.input) {\n return;\n }\n\n this.input.click();\n });\n });\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @input=${this.handleInput}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleInput(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n // <input> 'input' event bubbles and is composed, don't re-dispatch it.\n }\n\n private handleChange(event: Event) {\n // <input> 'change' event is not composed, re-dispatch it.\n redispatchEvent(this, event);\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.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n override [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n override [getValidityAnchor]() {\n return this.input;\n }\n}\n"]}
@@ -44,6 +44,10 @@
44
44
  resize: inherit;
45
45
  }
46
46
 
47
+ slot[name='container'] {
48
+ border-radius: inherit;
49
+ }
50
+
47
51
  @include icon.styles;
48
52
  @include input.styles;
49
53
  }
@@ -1 +1 @@
1
- :host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */
1
+ :host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["_shared.scss","_icon.scss","_input.scss"],"names":[],"mappings":"AAcE,MACE,oBACA,aACA,YAEA,iBACA,0CAGF,mBAEE,WAGF,YACE,oBAGF,OACE,YAGF,iBACE,eAGF,6BAGE,eCrCF,MACE,mBACA,aACA,mBACA,uBACA,kBACA,kBAGF,mBAEE,aAIA,kBAGF,0BACE,oCACA,iCACA,gCAGF,yBACE,qCACA,kCACA,iCC3BF,eACE,aAGF,iBAIE,YACA,UAGF,OACE,gCAEA,kBACA,mBAEA,oBACE,mBACA,UAIF,0CACE,aAIF,uEAEE,aAGF,8BAtBF,OAuBI,iBAMF,4FAEE,aAGF,gCACE,0BAIJ,qBACE,sCAGF,2BACE,4CAGF,mCACE,sCAGF,mCACE,sCAGF,+CACE,2CAGF,gBAEE,iBACA,kBAGF,QACE,4DAGF,QACE","file":"shared-styles.css"}
1
+ {"version":3,"sourceRoot":"","sources":["_shared.scss","_icon.scss","_input.scss"],"names":[],"mappings":"AAcE,MACE,oBACA,aACA,YAEA,iBACA,0CAGF,mBAEE,WAGF,YACE,oBAGF,OACE,YAGF,iBACE,eAGF,6BAGE,eAGF,qBACE,sBCzCF,MACE,mBACA,aACA,mBACA,uBACA,kBACA,kBAGF,mBAEE,aAIA,kBAGF,0BACE,oCACA,iCACA,gCAGF,yBACE,qCACA,kCACA,iCC3BF,eACE,aAGF,iBAIE,YACA,UAGF,OACE,gCAEA,kBACA,mBAEA,oBACE,mBACA,UAIF,0CACE,aAIF,uEAEE,aAGF,8BAtBF,OAuBI,iBAMF,4FAEE,aAGF,gCACE,0BAIJ,qBACE,sCAGF,2BACE,4CAGF,mCACE,sCAGF,mCACE,sCAGF,+CACE,2CAGF,gBAEE,iBACA,kBAGF,QACE,4DAGF,QACE","file":"shared-styles.css"}
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // Generated stylesheet for ./textfield/internal/shared-styles.css.
7
7
  import { css } from 'lit';
8
- export const styles = css `:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}
8
+ export const styles = css `:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}
9
9
  `;
10
10
  //# sourceMappingURL=shared-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-styles.js","sourceRoot":"","sources":["shared-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mEAAmE;AACnE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./textfield/internal/shared-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}\n`;\n"]}
1
+ {"version":3,"file":"shared-styles.js","sourceRoot":"","sources":["shared-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mEAAmE;AACnE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./textfield/internal/shared-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}\n`;\n"]}
@@ -416,6 +416,7 @@ export class TextField extends textFieldBaseClass {
416
416
  ${this.renderInputOrTextarea()}
417
417
  ${this.renderTrailingIcon()}
418
418
  <div id="description" slot="aria-describedby"></div>
419
+ <slot name="container" slot="container"></slot>
419
420
  </${this.fieldTag}>`;
420
421
  }
421
422
  renderLeadingIcon() {
@@ -1 +1 @@
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,6B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AI,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 {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 = mixinDelegatesAria(\n mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\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 /** @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 /**\n * The floating Material label of the textfield component. It informs the user\n * about what information is requested for a text field. It is aligned with\n * the input text, is always visible, and it floats when focused or when text\n * is entered into the textfield. This label also sets accessibilty labels,\n * but the accessible label is overriden by `aria-label`.\n *\n * Learn more about floating labels from the Material Design guidelines:\n * https://m3.material.io/components/text-fields/guidelines\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the text field is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Indicates that the user must specify a value for the input before the\n * owning form can be submitted and will render an error state when\n * `reportValidity()` is invoked when value is empty. Additionally the\n * floating label will render an asterisk `\"*\"` when true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required\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 * When true, hide the spinner for `type=\"number\"` text fields.\n */\n @property({type: Boolean, attribute: 'no-spinner'}) noSpinner = false;\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 /**\n * Defines the text displayed in the textfield when it has no value. Provides\n * a brief hint to the user as to the expected type of data that should be\n * entered into the control. Unlike `label`, the placeholder is not visible\n * and does not float when the textfield has a value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\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 'no-spinner': this.noSpinner,\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 ?no-asterisk=${this.noAsterisk}\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 // These properties may be set to null if the attribute is removed, and\n // `null > -1` is incorrectly `true`.\n const hasMaxLength = (this.maxLength ?? -1) > -1;\n const hasMinLength = (this.minLength ?? -1) > -1;\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 name=${this.name || nothing}\n ?disabled=${this.disabled}\n maxlength=${hasMaxLength ? this.maxLength : nothing}\n minlength=${hasMinLength ? 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 @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\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 name=${this.name || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${hasMaxLength ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${hasMinLength ? 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 @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\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 handleFocusChange() {\n // When calling focus() or reportValidity() during change, it's possible\n // for blur to be called after the new focus event. Rather than set\n // `this.focused` to true/false on focus/blur, we always set it to whether\n // or not the input itself is focused.\n this.focused = this.inputOrTextarea?.matches(':focus') ?? 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 // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\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"]}
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;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AQ,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 {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {stringConverter} from '../../internal/controller/string-converter.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.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 = mixinDelegatesAria(\n mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\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 /** @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 /**\n * The floating Material label of the textfield component. It informs the user\n * about what information is requested for a text field. It is aligned with\n * the input text, is always visible, and it floats when focused or when text\n * is entered into the textfield. This label also sets accessibilty labels,\n * but the accessible label is overriden by `aria-label`.\n *\n * Learn more about floating labels from the Material Design guidelines:\n * https://m3.material.io/components/text-fields/guidelines\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the text field is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Indicates that the user must specify a value for the input before the\n * owning form can be submitted and will render an error state when\n * `reportValidity()` is invoked when value is empty. Additionally the\n * floating label will render an asterisk `\"*\"` when true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required\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 * When true, hide the spinner for `type=\"number\"` text fields.\n */\n @property({type: Boolean, attribute: 'no-spinner'}) noSpinner = false;\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 /**\n * Defines the text displayed in the textfield when it has no value. Provides\n * a brief hint to the user as to the expected type of data that should be\n * entered into the control. Unlike `label`, the placeholder is not visible\n * and does not float when the textfield has a value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\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 'no-spinner': this.noSpinner,\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 ?no-asterisk=${this.noAsterisk}\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 <slot name=\"container\" slot=\"container\"></slot>\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 // These properties may be set to null if the attribute is removed, and\n // `null > -1` is incorrectly `true`.\n const hasMaxLength = (this.maxLength ?? -1) > -1;\n const hasMinLength = (this.minLength ?? -1) > -1;\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 name=${this.name || nothing}\n ?disabled=${this.disabled}\n maxlength=${hasMaxLength ? this.maxLength : nothing}\n minlength=${hasMinLength ? 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 @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\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 name=${this.name || nothing}\n ?disabled=${this.disabled}\n inputmode=${inputMode || nothing}\n max=${(this.max || nothing) as unknown as number}\n maxlength=${hasMaxLength ? this.maxLength : nothing}\n min=${(this.min || nothing) as unknown as number}\n minlength=${hasMinLength ? 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 @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\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 handleFocusChange() {\n // When calling focus() or reportValidity() during change, it's possible\n // for blur to be called after the new focus event. Rather than set\n // `this.focused` to true/false on focus/blur, we always set it to whether\n // or not the input itself is focused.\n this.focused = this.inputOrTextarea?.matches(':focus') ?? 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 override [createValidator](): Validator<unknown> {\n return new TextFieldValidator(() => ({\n state: this,\n renderedControl: this.inputOrTextarea,\n }));\n }\n\n override [getValidityAnchor](): HTMLElement | null {\n return this.inputOrTextarea;\n }\n\n override [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\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"]}