@m3e/web 2.5.11 → 2.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.js +92 -42
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +56 -56
- package/dist/all.min.js.map +1 -1
- package/dist/autocomplete.js +23 -5
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.min.js +1 -1
- package/dist/autocomplete.min.js.map +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/breadcrumb.min.js +1 -1
- package/dist/breadcrumb.min.js.map +1 -1
- package/dist/core.js +27 -23
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/core.min.js.map +1 -1
- package/dist/custom-elements.json +74 -42
- package/dist/fab.js +1 -1
- package/dist/fab.js.map +1 -1
- package/dist/fab.min.js +1 -1
- package/dist/fab.min.js.map +1 -1
- package/dist/form-field.js +1 -1
- package/dist/form-field.js.map +1 -1
- package/dist/form-field.min.js +2 -2
- package/dist/form-field.min.js.map +1 -1
- package/dist/option.js +12 -2
- package/dist/option.js.map +1 -1
- package/dist/option.min.js +1 -1
- package/dist/option.min.js.map +1 -1
- package/dist/select.js +18 -2
- package/dist/select.js.map +1 -1
- package/dist/select.min.js +1 -1
- package/dist/select.min.js.map +1 -1
- package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/LinkButton.d.ts.map +1 -1
- package/dist/src/core/shared/tokens/DesignToken.d.ts +3 -0
- package/dist/src/core/shared/tokens/DesignToken.d.ts.map +1 -1
- package/dist/src/core/shared/tokens/MeasurementToken.d.ts +13 -7
- package/dist/src/core/shared/tokens/MeasurementToken.d.ts.map +1 -1
- package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
- package/dist/src/option/OptionElement.d.ts.map +1 -1
- package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
- package/dist/src/select/SelectElement.d.ts.map +1 -1
- package/dist/src/theme/ThemeElement.d.ts.map +1 -1
- package/dist/theme.js +10 -7
- package/dist/theme.js.map +1 -1
- package/dist/theme.min.js +6 -6
- package/dist/theme.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.min.js","sources":["../../src/form-field/FormFieldControl.ts","../../src/form-field/FormFieldElement.ts"],"sourcesContent":["/**\r\n * Adapted from Angular Material Form Field Control\r\n * Source: https://github.com/angular/components/blob/main/src/material/form-field/form-field-control.ts\r\n *\r\n * @license MIT\r\n * Copyright (c) 2025 Google LLC\r\n * See LICENSE file in the project root for full license text.\r\n */\r\n\r\n/** An interface which allows a control to work inside of a `M3eFormField`. */\r\nexport interface FormFieldControl extends HTMLElement {\r\n /** A value indicating whether the control is disabled. */\r\n disabled: boolean;\r\n\r\n /** The value of the control. */\r\n value?: unknown;\r\n\r\n /** A value indicating whether the control is required. */\r\n required?: boolean;\r\n\r\n /** A value indicated whether the content of the control is read-only. */\r\n readonly?: boolean;\r\n\r\n /** A value indicating whether the form field's label should try to float. */\r\n readonly shouldLabelFloat?: boolean;\r\n\r\n /** The error message that would be displayed if the user submits the form, or an empty string if no error message. */\r\n readonly validationMessage?: string;\r\n\r\n /** The `HTMLFormElement` associated with this element. */\r\n readonly form?: HTMLFormElement | null;\r\n\r\n /**\r\n * Handles the click event on the control's container.\r\n * @param {MouseEvent} event The `MouseEvent`.\r\n */\r\n onContainerClick?: (event: MouseEvent) => void;\r\n\r\n /**\r\n * Returns `true` if the element has no validity problems; otherwise,\r\n * returns `false`, fires an invalid event.\r\n */\r\n checkValidity?: () => boolean;\r\n}\r\n\r\nconst KNOWN_FORM_FIELD_TAGS = [\"m3e-input-chip-set\", \"m3e-select\"];\r\n\r\n/**\r\n * Determines whether a value is a `FormFieldControl`.\r\n * @param {unknown} value The value to test.\r\n * @returns {value is FormFieldControl} A value indicating whether `value` is a `FormFieldControl`.\r\n */\r\nexport function isFormFieldControl(value: unknown): value is FormFieldControl {\r\n return (\r\n value instanceof HTMLElement &&\r\n (value instanceof HTMLInputElement ||\r\n value instanceof HTMLTextAreaElement ||\r\n value instanceof HTMLSelectElement ||\r\n KNOWN_FORM_FIELD_TAGS.includes(value.tagName.toLowerCase()))\r\n );\r\n}\r\n\r\n/**\r\n * Locates the first `FormFieldControl` in a given slot.\r\n * @param {HTMLSlotElement} slot The slot in which to locate a `FormFieldControl`.\r\n * @returns {FormFieldControl | null} The `FormFieldControl` located in `slot`.\r\n */\r\nexport function findFormFieldControl(slot: HTMLSlotElement): FormFieldControl | null {\r\n for (const element of slot.assignedElements({ flatten: true })) {\r\n if (isFormFieldControl(element)) {\r\n return element;\r\n }\r\n\r\n const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);\r\n while (walker.nextNode()) {\r\n if (isFormFieldControl(walker.currentNode)) {\r\n return walker.currentNode;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","/**\r\n * Adapted from Angular Material Form Field\r\n * Source: https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts\r\n *\r\n * @license MIT\r\n * Copyright (c) 2025 Google LLC\r\n * See LICENSE file in the project root for full license text.\r\n */\r\n\r\nimport { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n FocusController,\r\n getTextContent,\r\n hasAssignedNodes,\r\n hasCustomState,\r\n HoverController,\r\n interceptProperty,\r\n isReadOnlyMixin,\r\n MutationController,\r\n PressedController,\r\n ReconnectedCallback,\r\n registerStyleSheet,\r\n ResizeController,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { M3eAriaDescriber } from \"@m3e/web/core/a11y\";\r\n\r\nimport { findFormFieldControl, FormFieldControl } from \"./FormFieldControl\";\r\nimport { FormFieldVariant } from \"./FormFieldVariant\";\r\nimport { HideSubscriptType } from \"./HideSubscriptType\";\r\nimport { FloatLabelType } from \"./FloatLabelType\";\r\n\r\n/**\r\n * A container for form controls that applies Material Design styling and behavior.\r\n *\r\n * @description\r\n * The `m3e-form-field` component is a semantic, expressive container for form controls that anchors\r\n * label behavior, subscript messaging, and variant-specific layout. Designed according to Material Design 3\r\n * guidelines, it supports two visual variants—`outlined` and `filled`—each with dynamic elevation,\r\n * shape transitions, and adaptive color theming. The component responds to control state changes\r\n * (focus, hover, press, disabled, invalid) with smooth motion and semantic clarity, ensuring\r\n * visual hierarchy and emotional resonance.\r\n\r\n * The component is accessible by default, with ARIA annotations, contrast-safe color tokens,\r\n * and dynamic descriptions for hint and error messaging. It supports prefix and suffix content,\r\n * floating labels, and adaptive subscript visibility. When hosting a control with validation,\r\n * error messages are surfaced with `aria-invalid` and described for assistive technology.\r\n\r\n * Native form controls may not expose full state or messaging on their own. `m3e-form-field` bridges\r\n * these gaps by coordinating label floating, container styling, and subscript feedback.\r\n *\r\n * @example\r\n * The following example illustrates a basic usage of the `m3e-form-field`.\r\n * ```html\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"field\">Text field</label>\r\n * <input id=\"field\" />\r\n * </m3e-form-field>\r\n * ```\r\n * \r\n * @tag m3e-form-field\r\n *\r\n * @slot - Renders the control of the field.\r\n * @slot prefix - Renders content before the fields's control.\r\n * @slot prefix-text - Renders text before the fields's control.\r\n * @slot suffix - Renders content after the fields's control.\r\n * @slot suffix-text - Renders text after the fields's control.\r\n * @slot hint - Renders hint text in the fields's subscript, when the control is valid.\r\n * @slot error - Renders error text in the fields's subscript, when the control is invalid.\r\n *\r\n * @attr float-label - Specifies whether the label should float always or only when necessary.\r\n * @attr hide-required-marker - Whether the required marker should be hidden.\r\n * @attr hide-subscript - Whether subscript content is hidden.\r\n * @attr variant - The appearance variant of the field.\r\n *\r\n * @cssprop --m3e-form-field-font-size - Font size for the form field container text.\r\n * @cssprop --m3e-form-field-font-weight - Font weight for the form field container text.\r\n * @cssprop --m3e-form-field-line-height - Line height for the form field container text.\r\n * @cssprop --m3e-form-field-tracking - Letter spacing for the form field container text.\r\n * @cssprop --m3e-form-field-label-font-size - Font size for the floating label.\r\n * @cssprop --m3e-form-field-label-font-weight - Font weight for the floating label.\r\n * @cssprop --m3e-form-field-label-line-height - Line height for the floating label.\r\n * @cssprop --m3e-form-field-label-tracking - Letter spacing for the floating label.\r\n * @cssprop --m3e-form-field-subscript-font-size - Font size for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-font-weight - Font weight for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-line-height - Line height for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-tracking - Letter spacing for hint and error text.\r\n * @cssprop --m3e-form-field-color - Text color for the form field container.\r\n * @cssprop --m3e-form-field-subscript-color - Color for hint and error text.\r\n * @cssprop --m3e-form-field-invalid-color - Color used when the control is invalid.\r\n * @cssprop --m3e-form-field-focused-outline-color - Outline color when focused.\r\n * @cssprop --m3e-form-field-focused-color - Label color when focused.\r\n * @cssprop --m3e-form-field-outline-color - Outline color in outlined variant.\r\n * @cssprop --m3e-form-field-container-color - Background color in filled variant.\r\n * @cssprop --m3e-form-field-hover-container-color - Hover background color in filled variant.\r\n * @cssprop --m3e-form-field-width - Width of the form field container.\r\n * @cssprop --m3e-form-field-icon-size - Size of prefix and suffix icons.\r\n * @cssprop --m3e-outlined-form-field-container-shape - Corner radius for outlined container.\r\n * @cssprop --m3e-form-field-container-shape - Corner radius for filled container.\r\n * @cssprop --m3e-form-field-hover-container-opacity - Opacity for hover background in filled variant.\r\n * @cssprop --m3e-form-field-disabled-opacity - Opacity for disabled text.\r\n * @cssprop --m3e-form-field-disabled-container-opacity - Opacity for disabled container background.\r\n */\r\n@customElement(\"m3e-form-field\")\r\nexport class M3eFormFieldElement extends ReconnectedCallback(AttachInternals(LitElement)) {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-form-field input::placeholder,\r\n m3e-form-field textarea::placeholder {\r\n user-select: none;\r\n color: currentColor;\r\n transition: opacity ${DesignToken.motion.duration.extraLong1};\r\n }\r\n m3e-form-field[float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(\r\n :state(--with-label),\r\n :--with-label\r\n )\r\n input::placeholder,\r\n m3e-form-field[float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(\r\n :state(--with-label),\r\n :--with-label\r\n )\r\n textarea::placeholder {\r\n opacity: 0;\r\n transition: opacity 0s;\r\n }\r\n m3e-form-field[variant=\"outlined\"] m3e-input-chip-set {\r\n margin-block: calc(calc(3.5rem + ${DesignToken.density.calc(-3)}) / 4);\r\n }\r\n @media (prefers-reduced-motion) {\r\n m3e-form-field input::placeholder,\r\n m3e-form-field textarea::placeholder {\r\n transition: none !important;\r\n }\r\n }\r\n `);\r\n }\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-flex;\r\n flex-direction: column;\r\n vertical-align: middle;\r\n font-size: var(--m3e-form-field-font-size, ${DesignToken.typescale.standard.body.large.fontSize});\r\n font-weight: var(--m3e-form-field-font-weight, ${DesignToken.typescale.standard.body.large.fontWeight});\r\n line-height: var(--m3e-form-field-line-height, ${DesignToken.typescale.standard.body.large.lineHeight});\r\n letter-spacing: var(--m3e-form-field-tracking, ${DesignToken.typescale.standard.body.large.tracking});\r\n width: var(--m3e-form-field-width, 14.5rem);\r\n color: var(--_form-field-color);\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled))) .base {\r\n cursor: var(--_form-field-cursor);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n min-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n --_form-field-label-line-height: var(\r\n --m3e-form-field-label-line-height,\r\n ${DesignToken.typescale.standard.body.small.lineHeight}\r\n );\r\n }\r\n .content {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n min-height: var(--m3e-form-field-icon-size, 1.5rem);\r\n }\r\n .prefix,\r\n .suffix {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n user-select: none;\r\n flex: none;\r\n font-size: var(--m3e-form-field-icon-size, 1.5rem);\r\n }\r\n .prefix-text,\r\n .suffix-text {\r\n opacity: 1;\r\n transition: opacity ${DesignToken.motion.duration.extraLong1};\r\n user-select: none;\r\n flex: none;\r\n }\r\n .input {\r\n display: inline-flex;\r\n flex-wrap: wrap;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n }\r\n .label {\r\n display: flex;\r\n position: absolute;\r\n pointer-events: none;\r\n user-select: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n font-size: var(--m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-form-field-label-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-form-field-label-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-form-field-label-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n color: var(--_form-field-label-color, inherit);\r\n transition: ${unsafeCSS(\r\n `top ${DesignToken.motion.duration.short4}, \r\n font-size ${DesignToken.motion.duration.short4}, \r\n line-height ${DesignToken.motion.duration.short4}`,\r\n )};\r\n }\r\n :host(:is(:state(--with-select), :--with-select)) .label {\r\n margin-inline-end: 1.5rem;\r\n }\r\n ::slotted([slot=\"label\"]) {\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n .subscript {\r\n display: inline-flex;\r\n width: 100%;\r\n margin-top: 0.25rem;\r\n font-size: var(--m3e-form-field-subscript-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-form-field-subscript-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-form-field-subscript-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n min-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n color: var(--m3e-form-field-subscript-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n .error,\r\n .hint {\r\n flex: 1 1 auto;\r\n }\r\n :host([hide-subscript=\"always\"]) .subscript {\r\n display: none;\r\n }\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid))) .subscript {\r\n opacity: 0;\r\n margin-top: 0.25rem;\r\n transform: translateY(-0.25rem);\r\n transition: ${unsafeCSS(\r\n `opacity ${DesignToken.motion.duration.short4}, \r\n transform ${DesignToken.motion.duration.short4}`,\r\n )};\r\n }\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid)):focus-within) .subscript,\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid)):is(:state(--pressed), :--pressed))\r\n .subscript {\r\n opacity: 1;\r\n transform: translateY(0);\r\n }\r\n :host(:is(:state(--invalid), :--invalid)) .hint {\r\n display: none;\r\n }\r\n :host(:not(:is(:state(--invalid), :--invalid))) .error {\r\n display: none;\r\n }\r\n ::slotted(input),\r\n ::slotted(textarea),\r\n ::slotted(select) {\r\n outline: unset;\r\n border: unset;\r\n background-color: transparent;\r\n box-shadow: none;\r\n font-family: inherit;\r\n font-size: inherit;\r\n line-height: inherit;\r\n letter-spacing: inherit;\r\n color: var(--_form-field-input-color, inherit);\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n padding: unset;\r\n }\r\n ::slotted(textarea) {\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n }\r\n ::slotted(m3e-select),\r\n ::slotted(m3e-input-chip-set) {\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n }\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(:is(:state(--pressed), :--pressed)))\r\n .label {\r\n font-size: inherit;\r\n }\r\n\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(:state(--with-label), :--with-label))\r\n .prefix-text,\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(:state(--with-label), :--with-label))\r\n .suffix-text {\r\n opacity: 0;\r\n transition: opacity 0s;\r\n }\r\n .prefix {\r\n margin-inline-start: 1rem;\r\n }\r\n :host(:is(:state(--with-prefix), :--with-prefix)) .prefix {\r\n margin-inline-end: 1rem;\r\n margin-inline-start: 0.75rem;\r\n }\r\n .suffix {\r\n margin-inline-end: 1rem;\r\n }\r\n :host(:is(:state(--with-suffix), :--with-suffix)) .suffix {\r\n margin-inline-start: 0.25rem;\r\n margin-inline-end: 0.5rem;\r\n }\r\n :host(:is(:state(--with-suffix), :--with-suffix):is(:state(--with-select), :--with-select)) .suffix {\r\n margin-inline-start: unset;\r\n }\r\n :host(:is(:state(--with-select), :--with-select)) .suffix-text {\r\n display: none;\r\n }\r\n :host([variant=\"outlined\"]) .label {\r\n margin-top: calc(0px - var(--_form-field-label-line-height) / 2);\r\n }\r\n :host([variant=\"outlined\"]) .outline {\r\n position: absolute;\r\n display: flex;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n }\r\n :host([variant=\"outlined\"]) .pseudo-label {\r\n visibility: hidden;\r\n margin-inline-end: 0.5rem;\r\n font-size: var(--_form-field-label-font-size);\r\n line-height: var(--_form-field-label-line-height);\r\n letter-spacing: var(--_form-field-label-tracking);\r\n max-width: 100%;\r\n transition-property: max-width, margin-inline-end;\r\n transition-duration: 1ms;\r\n }\r\n :host([variant=\"outlined\"]:is(:state(--required), :--required):not([hide-required-marker])) .pseudo-label {\r\n margin-inline-end: 0.25rem;\r\n }\r\n :host(\r\n [variant=\"outlined\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .pseudo-label {\r\n max-width: 0;\r\n margin-inline-end: 0px;\r\n transition-delay: ${DesignToken.motion.duration.short2};\r\n }\r\n :host([variant=\"outlined\"]) .outline-start,\r\n :host([variant=\"outlined\"]) .outline-notch,\r\n :host([variant=\"outlined\"]) .outline-end {\r\n box-sizing: border-box;\r\n border-width: var(--_form-field-outline-size, 1px);\r\n border-color: var(--_form-field-outline-color);\r\n transition: border-color ${DesignToken.motion.duration.short4};\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--with-label), :--with-label))) .outline-notch {\r\n display: none;\r\n }\r\n :host([variant=\"outlined\"]) .outline-start {\r\n min-width: 0.75rem;\r\n border-top-style: solid;\r\n border-inline-start-style: solid;\r\n border-bottom-style: solid;\r\n border-start-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n border-end-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n }\r\n :host([variant=\"outlined\"]) .outline-notch {\r\n border-bottom-style: solid;\r\n }\r\n :host([variant=\"outlined\"]) .outline-end {\r\n flex-grow: 1;\r\n min-width: 1rem;\r\n border-top-style: solid;\r\n border-inline-end-style: solid;\r\n border-bottom-style: solid;\r\n border-start-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n border-end-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n }\r\n :host([variant=\"outlined\"]:is(:state(--with-prefix), :--with-prefix)) .outline-start {\r\n min-width: calc(1.25rem + var(--_prefix-width, 0px) + 0.25rem);\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled))) .base:hover .outline,\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):focus-within) .outline,\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):is(:state(--pressed), :--pressed)) .outline {\r\n --_form-field-outline-size: 2px;\r\n }\r\n :host([variant=\"outlined\"]) .subscript {\r\n margin-inline: 1rem;\r\n width: calc(100% - 2rem);\r\n }\r\n :host([variant=\"outlined\"]) .content {\r\n min-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host(\r\n [variant=\"outlined\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .label {\r\n margin-top: unset;\r\n line-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host([variant=\"filled\"]) .base {\r\n --_select-arrow-margin-top: calc(\r\n 0px - calc(1rem / max(calc(0 - calc(var(--md-sys-density-scale, 0) + var(--md-sys-density-scale, 0))), 1))\r\n );\r\n }\r\n :host([variant=\"filled\"]) .base::before {\r\n content: \"\";\r\n box-sizing: border-box;\r\n position: absolute;\r\n pointer-events: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n border-bottom-style: solid;\r\n border-width: 1px;\r\n border-radius: var(--m3e-form-field-container-shape, ${DesignToken.shape.corner.extraSmallTop});\r\n border-color: var(--_form-field-outline-color);\r\n background-color: var(--_form-field-container-color);\r\n }\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled))) .base:hover::before,\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):focus-within) .base::before,\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):is(:state(--pressed), :--pressed))\r\n .base::before {\r\n border-width: 3px;\r\n }\r\n :host([variant=\"filled\"]) .base::after {\r\n content: \"\";\r\n box-sizing: border-box;\r\n position: absolute;\r\n pointer-events: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: var(--_form-field-hover-container-color);\r\n transition: background-color ${DesignToken.motion.duration.short4};\r\n }\r\n :host([variant=\"filled\"]) .subscript {\r\n margin-inline: 1rem;\r\n width: calc(100% - 2rem);\r\n }\r\n :host([variant=\"filled\"]) .content {\r\n padding-top: calc(1.5rem + ${DesignToken.density.calc(-3)});\r\n margin-bottom: 0.5rem;\r\n }\r\n :host([variant=\"filled\"]) .label {\r\n top: max(0px, calc(0.5rem + ${DesignToken.density.calc(-3)}));\r\n }\r\n :host(\r\n [variant=\"filled\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .label {\r\n top: 0px;\r\n line-height: calc(3.5rem + ${DesignToken.density.calc(-3)} - 0.0625rem);\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):not(:focus-within):not(:is(:state(--pressed), :--pressed)))\r\n .base:hover {\r\n --_form-field-hover-container-color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-hover-container-color, ${DesignToken.color.onSurface})\r\n var(--m3e-form-field-hover-container-opacity, 8%),\r\n transparent\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid))) {\r\n color: var(--m3e-form-field-color, ${DesignToken.color.onSurface});\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)))\r\n .base {\r\n --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.outline});\r\n }\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid))) .base {\r\n --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(\r\n [variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(\r\n :is(:state(--invalid), :--invalid)\r\n ):focus-within\r\n )\r\n .base,\r\n :host(\r\n [variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)):is(\r\n :state(--pressed),\r\n :--pressed\r\n )\r\n )\r\n .base,\r\n :host(\r\n [variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(\r\n :is(:state(--invalid), :--invalid)\r\n ):focus-within\r\n )\r\n .base,\r\n :host(\r\n [variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)):is(\r\n :state(--pressed),\r\n :--pressed\r\n )\r\n )\r\n .base {\r\n --_form-field-outline-color: var(--m3e-form-field-focused-outline-color, ${DesignToken.color.primary});\r\n --_form-field-label-color: var(--m3e-form-field-focused-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled))) .base {\r\n --_form-field-container-color: var(\r\n --m3e-form-field-container-color,\r\n ${DesignToken.color.surfaceContainerHighest}\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):is(:state(--invalid), :--invalid)) .base {\r\n --_form-field-label-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n --_form-field-outline-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):is(:state(--invalid), :--invalid)) .subscript {\r\n color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-form-field-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) .base {\r\n --_form-field-container-color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-disabled-container-color, ${DesignToken.color.onSurface})\r\n var(--m3e-form-field-disabled-container-opacity, 4%),\r\n transparent\r\n );\r\n }\r\n :host(:is(:state(--no-animate), :--no-animate)) *,\r\n :host(:is(:state(--no-animate), :--no-animate)) *::before,\r\n :host(:is(:state(--no-animate), :--no-animate)) *::after {\r\n transition: none !important;\r\n }\r\n @media (forced-colors: active) {\r\n :host([variant=\"filled\"]) .base::after {\r\n transition: none;\r\n }\r\n :host {\r\n --_form-field-outline-color: CanvasText;\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) {\r\n --_form-field-input-color: GrayText;\r\n --_form-field-color: GrayText;\r\n --_form-field-label-color: GrayText;\r\n --_form-field-outline-color: GrayText;\r\n }\r\n }\r\n @media (prefers-reduced-motion) {\r\n .base::before,\r\n .prefix-text,\r\n .suffix-text,\r\n .label,\r\n .subscript,\r\n .outline-start,\r\n .outline-notch,\r\n .outline-end,\r\n .pseudo-label {\r\n transition: none !important;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #control: FormFieldControl | null = null;\r\n /** @private */ #removeValueInterceptor?: () => void;\r\n /** @private */ readonly #formResetHandler = () => this.#handleFormReset();\r\n /** @private */ readonly #controlInvalidHandler = () => this.#handleControlInvalid();\r\n\r\n /** @private */\r\n readonly #controlMutationController = new MutationController(this, {\r\n target: null,\r\n config: { attributeFilter: [\"disabled\", \"readonly\", \"required\"] },\r\n callback: () => this.notifyControlStateChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: () => this.#handlePrefixResize(),\r\n });\r\n\r\n /** @private */\r\n readonly #focusController = new FocusController(this, {\r\n target: null,\r\n callback: (focused) => {\r\n focused = focused && !(this.#control?.disabled ?? true);\r\n setCustomState(this, \"--no-animate\", false);\r\n this.#focused = focused;\r\n if (focused) {\r\n setCustomState(this, \"--float-label\", true);\r\n } else {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n this.notifyControlStateChange();\r\n }\r\n },\r\n });\r\n\r\n /** @private */ @query(\".base\") private readonly _base!: HTMLElement;\r\n /** @private */ @query(\".prefix\") private readonly _prefix!: HTMLElement;\r\n /** @private */ @query(\".error\") private readonly _error!: HTMLElement;\r\n /** @private */ @query(\".hint\") private readonly _hint!: HTMLElement;\r\n\r\n /** @private */\r\n readonly #hintMutationController = new MutationController(this, {\r\n target: null,\r\n config: { childList: true, subtree: true },\r\n callback: () => this.#handleHintChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #errorMutationController = new MutationController(this, {\r\n target: null,\r\n config: { childList: true, subtree: true },\r\n callback: () => this.#handleErrorChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #pressedController = new PressedController(this, {\r\n target: null,\r\n callback: (pressed) => setCustomState(this, \"--pressed\", pressed && !(this.#control?.disabled ?? true)),\r\n });\r\n\r\n /** @private */ #focused = false;\r\n /** @private */ @state() private _pseudoLabel = \"\";\r\n /** @private */ @state() private _required = false;\r\n /** @private */ @state() private _invalid = false;\r\n /** @private */ @state() private _validationMessage = \"\";\r\n /** @private */ #hintText = \"\";\r\n /** @private */ #errorText = \"\";\r\n\r\n constructor() {\r\n super();\r\n\r\n new HoverController(this, { callback: () => setCustomState(this, \"--no-animate\", false) });\r\n }\r\n\r\n /** @private */\r\n get #shouldFloatLabel(): boolean {\r\n return this.#control?.shouldLabelFloat !== undefined\r\n ? this.#control.shouldLabelFloat === true\r\n : typeof this.#control?.value == \"string\" && this.#control.value.length > 0;\r\n }\r\n\r\n /** A reference to the element used to anchor dropdown menus. */\r\n get menuAnchor() {\r\n return this._base;\r\n }\r\n\r\n /** A reference to the hosted form field control. */\r\n get control() {\r\n return this.#control;\r\n }\r\n\r\n /**\r\n * The appearance variant of the field.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: FormFieldVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the required marker should be hidden.\r\n * @default false\r\n */\r\n @property({ attribute: \"hide-required-marker\", type: Boolean, reflect: true }) hideRequiredMarker = false;\r\n\r\n /**\r\n * Whether subscript content is hidden.\r\n * @default \"auto\"\r\n */\r\n @property({ attribute: \"hide-subscript\", reflect: true }) hideSubscript: HideSubscriptType = \"auto\";\r\n\r\n /**\r\n * Specifies whether the label should float always or only when necessary.\r\n * @default \"auto\"\r\n */\r\n @property({ attribute: \"float-label\", reflect: true }) floatLabel: FloatLabelType = \"auto\";\r\n\r\n /**\r\n * Notifies the form field that the state of the hosted `control` has changed.\r\n * @param {boolean} [checkValidity=false] Whether to check validity.\r\n */\r\n notifyControlStateChange(checkValidity: boolean = false): void {\r\n this._required = this.#control?.required === true;\r\n setCustomState(this, \"--required\", this._required);\r\n setCustomState(this, \"--disabled\", this.#control?.disabled === true);\r\n setCustomState(this, \"--readonly\", isReadOnlyMixin(this.#control) && this.#control.readOnly === true);\r\n if (this.floatLabel === \"auto\") {\r\n setCustomState(this, \"--float-label\", this.#shouldFloatLabel || this.#focused);\r\n }\r\n\r\n if (checkValidity) {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n }\r\n\r\n setCustomState(this, \"--invalid\", this._invalid);\r\n\r\n this._validationMessage = this.#control?.validationMessage ?? \"\";\r\n if (!this.isUpdatePending) {\r\n this.performUpdate();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n // Label animations are disabled on initial paint.\r\n setCustomState(this, \"--no-animate\", true);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.#changeControl(null);\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initialize();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues): void {\r\n super.firstUpdated(_changedProperties);\r\n this.#initialize();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"_invalid\") && this.#control) {\r\n this.#control.ariaInvalid = this._invalid ? \"true\" : null;\r\n\r\n if (this.#errorText) {\r\n if (this._invalid) {\r\n M3eAriaDescriber.describe(this.#control, this.#errorText);\r\n } else {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" @click=\"${this.#handleContainerClick}\">\r\n ${this.variant === \"outlined\"\r\n ? html`<div class=\"outline\" aria-hidden=\"true\">\r\n <div class=\"outline-start\"></div>\r\n <div class=\"outline-notch\">\r\n <div class=\"pseudo-label\">\r\n ${this._pseudoLabel} ${!this.hideRequiredMarker && this._required ? html` *` : nothing}\r\n </div>\r\n </div>\r\n <div class=\"outline-end\"></div>\r\n </div>`\r\n : nothing}\r\n <div class=\"prefix\">\r\n <slot name=\"prefix\" @slotchange=\"${this.#handlePrefixSlotChange}\"></slot>\r\n </div>\r\n <div class=\"content\">\r\n <span class=\"prefix-text\"><slot name=\"prefix-text\"></slot></span>\r\n <span class=\"input\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\" @change=\"${this.#handleControlChange}\"></slot>\r\n </span>\r\n <span class=\"suffix-text\"><slot name=\"suffix-text\"></slot></span>\r\n <span class=\"label\">\r\n <slot name=\"label\" @slotchange=\"${this.#handleLabelSlotChange}\"></slot>\r\n ${!this.hideRequiredMarker && this._required\r\n ? html`<span class=\"required-marker\" aria-hidden=\"true\"> *</span>`\r\n : nothing}\r\n </span>\r\n </div>\r\n <div\r\n class=\"suffix\"\r\n @click=\"${this.#stopPropagation}\"\r\n @focusin=\"${this.#stopPropagation}\"\r\n @focusout=\"${this.#stopPropagation}\"\r\n @pointerdown=\"${this.#stopPropagation}\"\r\n @keydown=\"${this.#stopPropagation}\"\r\n @keyup=\"${this.#stopPropagation}\"\r\n >\r\n <slot name=\"suffix\" @slotchange=\"${this.#handleSuffixSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n <span class=\"subscript\" aria-hidden=\"true\">\r\n <span class=\"error\"><slot name=\"error\">${this._validationMessage}</slot></span>\r\n <span class=\"hint\"><slot name=\"hint\"></slot></span>\r\n </span>`;\r\n }\r\n\r\n /** @private */\r\n #initialize(): void {\r\n this.#focusController.observe(this._base);\r\n this.#pressedController.observe(this._base);\r\n\r\n this.#hintMutationController.observe(this._hint);\r\n this.#handleHintChange();\r\n\r\n this.#errorMutationController.observe(this._error);\r\n this.#handleErrorChange();\r\n }\r\n\r\n /** @private */\r\n #stopPropagation(e: Event): void {\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n /** @private */\r\n #handleLabelSlotChange(e: Event): void {\r\n const assignedElements = (<HTMLSlotElement>e.target).assignedElements({ flatten: true });\r\n setCustomState(this, \"--with-label\", assignedElements.length > 0);\r\n this._pseudoLabel = assignedElements[0]?.textContent ?? \"\";\r\n }\r\n\r\n /** @private */\r\n #handlePrefixSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-prefix\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n this.#resizeController.observe(this._prefix);\r\n }\r\n\r\n /** @private */\r\n #handleSuffixSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-suffix\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handlePrefixResize(): void {\r\n if (this.variant === \"outlined\") {\r\n this._base.style.setProperty(\"--_prefix-width\", `${this._prefix.clientWidth}px`);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n this.#changeControl(findFormFieldControl(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleContainerClick(e: MouseEvent): void {\r\n if (this.#control && !this.#focused && !this.#control.disabled) {\r\n if (this.#control.onContainerClick) {\r\n this.#control.onContainerClick(e);\r\n } else {\r\n this.#control.focus();\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleControlInvalid(): void {\r\n this._invalid = true;\r\n this.notifyControlStateChange();\r\n }\r\n\r\n /** @private */\r\n #handleControlChange(): void {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n this.notifyControlStateChange();\r\n }\r\n\r\n /** @private */\r\n #handleFormReset(): void {\r\n this._invalid = false;\r\n setTimeout(() => this.notifyControlStateChange());\r\n }\r\n\r\n /** @private */\r\n #changeControl(control: FormFieldControl | null): void {\r\n if (this.#control === control) return;\r\n if (this.#control) {\r\n if (this.#hintText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#hintText);\r\n }\r\n if (this.#errorText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n\r\n this.#controlMutationController.unobserve(this.#control);\r\n this.#control.removeEventListener(\"invalid\", this.#controlInvalidHandler);\r\n this.#control.form?.removeEventListener(\"reset\", this.#formResetHandler);\r\n this.#removeValueInterceptor?.();\r\n this.#removeValueInterceptor = undefined;\r\n }\r\n this.#control = control;\r\n\r\n if ([\"INPUT\", \"TEXTAREA\"].includes(this.#control?.tagName ?? \"\")) {\r\n this._base.style.setProperty(\"--_form-field-cursor\", \"text\");\r\n } else {\r\n this._base.style.removeProperty(\"--_form-field-cursor\");\r\n }\r\n\r\n setCustomState(this, \"--with-select\", this.#control?.tagName === \"M3E-SELECT\");\r\n if (hasCustomState(this, \"--with-select\")) {\r\n this._base.style.setProperty(\"--_form-field-cursor\", \"pointer\");\r\n }\r\n\r\n if (this.#control) {\r\n this.#controlMutationController.observe(this.#control);\r\n this.#control.addEventListener(\"invalid\", this.#controlInvalidHandler);\r\n this.#control.form?.addEventListener(\"reset\", this.#formResetHandler);\r\n this.#control.removeAttribute(\"aria-invalid\");\r\n\r\n if (this.#hintText) {\r\n M3eAriaDescriber.describe(this.#control, this.#hintText);\r\n }\r\n\r\n this.notifyControlStateChange();\r\n\r\n const tagname = this.#control.tagName.toLowerCase();\r\n if (tagname.startsWith(\"m3e-\") && !customElements.get(tagname)) {\r\n customElements.whenDefined(tagname).then(() => this.#bindValueInterceptor());\r\n } else {\r\n this.#bindValueInterceptor();\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #bindValueInterceptor(): void {\r\n if (!this.#control) return;\r\n this.#removeValueInterceptor = interceptProperty(this.#control, \"value\", {\r\n set: (value, setter) => {\r\n setter(value);\r\n this.notifyControlStateChange(true);\r\n },\r\n });\r\n }\r\n\r\n /** @private */\r\n #handleHintChange(): void {\r\n const hintText = getTextContent(this._hint, true);\r\n if (hintText === this.#hintText) return;\r\n\r\n if (this.#control && this.#hintText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#hintText);\r\n }\r\n\r\n this.#hintText = hintText;\r\n\r\n if (this.#control && this.#hintText) {\r\n M3eAriaDescriber.describe(this.#control, this.#hintText);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleErrorChange(): void {\r\n const errorText = getTextContent(this._error, true);\r\n if (errorText === this.#errorText) return;\r\n\r\n if (this.#control && this.#errorText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n\r\n this.#errorText = errorText;\r\n\r\n if (this.#control && this.#errorText && this._invalid) {\r\n M3eAriaDescriber.describe(this.#control, this.#errorText);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-form-field\": M3eFormFieldElement;\r\n }\r\n}\r\n"],"names":["KNOWN_FORM_FIELD_TAGS","isFormFieldControl","value","HTMLElement","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","includes","tagName","toLowerCase","findFormFieldControl","slot","element","assignedElements","flatten","walker","document","createTreeWalker","NodeFilter","SHOW_ELEMENT","nextNode","currentNode","M3eFormFieldElement","ReconnectedCallback","AttachInternals","LitElement","constructor","super","_M3eFormFieldElement_control","set","this","_M3eFormFieldElement_removeValueInterceptor","_M3eFormFieldElement_formResetHandler","__classPrivateFieldGet","_M3eFormFieldElement_instances","_M3eFormFieldElement_handleFormReset","call","_M3eFormFieldElement_controlInvalidHandler","_M3eFormFieldElement_handleControlInvalid","_M3eFormFieldElement_controlMutationController","MutationController","target","config","attributeFilter","callback","notifyControlStateChange","_M3eFormFieldElement_resizeController","ResizeController","_M3eFormFieldElement_handlePrefixResize","_M3eFormFieldElement_focusController","FocusController","focused","disabled","setCustomState","__classPrivateFieldSet","_M3eFormFieldElement_focused","_invalid","checkValidity","_M3eFormFieldElement_hintMutationController","childList","subtree","_M3eFormFieldElement_handleHintChange","_M3eFormFieldElement_errorMutationController","_M3eFormFieldElement_handleErrorChange","_M3eFormFieldElement_pressedController","PressedController","pressed","_pseudoLabel","_required","_validationMessage","_M3eFormFieldElement_hintText","_M3eFormFieldElement_errorText","variant","hideRequiredMarker","hideSubscript","floatLabel","HoverController","menuAnchor","_base","control","required","isReadOnlyMixin","readOnly","_M3eFormFieldElement_shouldFloatLabel_get","validationMessage","isUpdatePending","performUpdate","connectedCallback","disconnectedCallback","_M3eFormFieldElement_changeControl","reconnectedCallback","_M3eFormFieldElement_initialize","firstUpdated","_changedProperties","update","changedProperties","has","ariaInvalid","M3eAriaDescriber","describe","removeDescription","render","html","_M3eFormFieldElement_handleContainerClick","nothing","_M3eFormFieldElement_handlePrefixSlotChange","_M3eFormFieldElement_handleSlotChange","_M3eFormFieldElement_handleControlChange","_M3eFormFieldElement_handleLabelSlotChange","_M3eFormFieldElement_stopPropagation","_M3eFormFieldElement_handleSuffixSlotChange","undefined","shouldLabelFloat","length","observe","_hint","_error","e","stopImmediatePropagation","stopPropagation","textContent","hasAssignedNodes","_prefix","style","setProperty","clientWidth","onContainerClick","focus","setTimeout","unobserve","removeEventListener","form","removeProperty","hasCustomState","addEventListener","removeAttribute","tagname","startsWith","customElements","get","whenDefined","then","_M3eFormFieldElement_bindValueInterceptor","interceptProperty","setter","hintText","getTextContent","errorText","registerStyleSheet","css","DesignToken","motion","duration","extraLong1","density","calc","styles","typescale","standard","body","large","fontSize","fontWeight","lineHeight","tracking","small","unsafeCSS","short4","color","onSurfaceVariant","scrollbar","thinWidth","short2","shape","corner","extraSmall","extraSmallTop","onSurface","outline","primary","surfaceContainerHighest","error","__decorate","query","prototype","state","property","reflect","attribute","type","Boolean","customElement"],"mappings":";;;;;;;;;;;;;GA6CA,MAAMA,EAAwB,CAAC,qBAAsB,cAO/C,SAAUC,EAAmBC,GACjC,OACEA,aAAiBC,cAChBD,aAAiBE,kBAChBF,aAAiBG,qBACjBH,aAAiBI,mBACjBN,EAAsBO,SAASL,EAAMM,QAAQC,eAEnD,CAOM,SAAUC,EAAqBC,GACnC,IAAK,MAAMC,KAAWD,EAAKE,iBAAiB,CAAEC,SAAS,IAAS,CAC9D,GAAIb,EAAmBW,GACrB,OAAOA,EAGT,MAAMG,EAASC,SAASC,iBAAiBL,EAASM,WAAWC,cAC7D,KAAOJ,EAAOK,YACZ,GAAInB,EAAmBc,EAAOM,aAC5B,OAAON,EAAOM,WAGpB,CAEA,OAAO,IACT;;;;;;;;0EC4BO,IAAMC,GAAN,cAAkCC,EAAoBC,EAAgBC,KAyiB3EC,WAAAA,GACEC,oBApEcC,EAAAC,IAAAC,KAAoC,MACpCC,EAAAF,IAAAC,aACSE,EAAAH,IAAAC,KAAoB,IAAMG,EAAAH,KAAII,EAAA,IAAAC,IAAiBC,KAArBN,OAC1BO,EAAAR,IAAAC,KAAyB,IAAMG,EAAAH,KAAII,EAAA,IAAAI,IAAsBF,KAA1BN,OAG/CS,EAAAV,IAAAC,KAA6B,IAAIU,EAAmBV,KAAM,CACjEW,OAAQ,KACRC,OAAQ,CAAEC,gBAAiB,CAAC,WAAY,WAAY,aACpDC,SAAUA,IAAMd,KAAKe,8BAIdC,EAAAjB,IAAAC,KAAoB,IAAIiB,EAAiBjB,KAAM,CACtDW,OAAQ,KACRG,SAAUA,IAAMX,EAAAH,KAAII,EAAA,IAAAc,GAAoBZ,KAAxBN,SAITmB,EAAApB,IAAAC,KAAmB,IAAIoB,EAAgBpB,KAAM,CACpDW,OAAQ,KACRG,SAAWO,IACTA,EAAUA,KAAalB,EAAAH,KAAIF,EAAA,MAAWwB,UAAY,GAClDC,EAAevB,KAA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SAAS,KAA4CrK,GAAAkK,UAAA,kBAAA,GAtlBhFlK,GAAmBgK,EAAA,CAD/BS,EAAc,mBACFzK"}
|
|
1
|
+
{"version":3,"file":"form-field.min.js","sources":["../../src/form-field/FormFieldControl.ts","../../src/form-field/FormFieldElement.ts"],"sourcesContent":["/**\r\n * Adapted from Angular Material Form Field Control\r\n * Source: https://github.com/angular/components/blob/main/src/material/form-field/form-field-control.ts\r\n *\r\n * @license MIT\r\n * Copyright (c) 2025 Google LLC\r\n * See LICENSE file in the project root for full license text.\r\n */\r\n\r\n/** An interface which allows a control to work inside of a `M3eFormField`. */\r\nexport interface FormFieldControl extends HTMLElement {\r\n /** A value indicating whether the control is disabled. */\r\n disabled: boolean;\r\n\r\n /** The value of the control. */\r\n value?: unknown;\r\n\r\n /** A value indicating whether the control is required. */\r\n required?: boolean;\r\n\r\n /** A value indicated whether the content of the control is read-only. */\r\n readonly?: boolean;\r\n\r\n /** A value indicating whether the form field's label should try to float. */\r\n readonly shouldLabelFloat?: boolean;\r\n\r\n /** The error message that would be displayed if the user submits the form, or an empty string if no error message. */\r\n readonly validationMessage?: string;\r\n\r\n /** The `HTMLFormElement` associated with this element. */\r\n readonly form?: HTMLFormElement | null;\r\n\r\n /**\r\n * Handles the click event on the control's container.\r\n * @param {MouseEvent} event The `MouseEvent`.\r\n */\r\n onContainerClick?: (event: MouseEvent) => void;\r\n\r\n /**\r\n * Returns `true` if the element has no validity problems; otherwise,\r\n * returns `false`, fires an invalid event.\r\n */\r\n checkValidity?: () => boolean;\r\n}\r\n\r\nconst KNOWN_FORM_FIELD_TAGS = [\"m3e-input-chip-set\", \"m3e-select\"];\r\n\r\n/**\r\n * Determines whether a value is a `FormFieldControl`.\r\n * @param {unknown} value The value to test.\r\n * @returns {value is FormFieldControl} A value indicating whether `value` is a `FormFieldControl`.\r\n */\r\nexport function isFormFieldControl(value: unknown): value is FormFieldControl {\r\n return (\r\n value instanceof HTMLElement &&\r\n (value instanceof HTMLInputElement ||\r\n value instanceof HTMLTextAreaElement ||\r\n value instanceof HTMLSelectElement ||\r\n KNOWN_FORM_FIELD_TAGS.includes(value.tagName.toLowerCase()))\r\n );\r\n}\r\n\r\n/**\r\n * Locates the first `FormFieldControl` in a given slot.\r\n * @param {HTMLSlotElement} slot The slot in which to locate a `FormFieldControl`.\r\n * @returns {FormFieldControl | null} The `FormFieldControl` located in `slot`.\r\n */\r\nexport function findFormFieldControl(slot: HTMLSlotElement): FormFieldControl | null {\r\n for (const element of slot.assignedElements({ flatten: true })) {\r\n if (isFormFieldControl(element)) {\r\n return element;\r\n }\r\n\r\n const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT);\r\n while (walker.nextNode()) {\r\n if (isFormFieldControl(walker.currentNode)) {\r\n return walker.currentNode;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","/**\r\n * Adapted from Angular Material Form Field\r\n * Source: https://github.com/angular/components/blob/main/src/material/form-field/form-field.ts\r\n *\r\n * @license MIT\r\n * Copyright (c) 2025 Google LLC\r\n * See LICENSE file in the project root for full license text.\r\n */\r\n\r\nimport { css, CSSResultGroup, html, LitElement, nothing, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query, state } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n FocusController,\r\n getTextContent,\r\n hasAssignedNodes,\r\n hasCustomState,\r\n HoverController,\r\n interceptProperty,\r\n isReadOnlyMixin,\r\n MutationController,\r\n PressedController,\r\n ReconnectedCallback,\r\n registerStyleSheet,\r\n ResizeController,\r\n setCustomState,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { M3eAriaDescriber } from \"@m3e/web/core/a11y\";\r\n\r\nimport { findFormFieldControl, FormFieldControl } from \"./FormFieldControl\";\r\nimport { FormFieldVariant } from \"./FormFieldVariant\";\r\nimport { HideSubscriptType } from \"./HideSubscriptType\";\r\nimport { FloatLabelType } from \"./FloatLabelType\";\r\n\r\n/**\r\n * A container for form controls that applies Material Design styling and behavior.\r\n *\r\n * @description\r\n * The `m3e-form-field` component is a semantic, expressive container for form controls that anchors\r\n * label behavior, subscript messaging, and variant-specific layout. Designed according to Material Design 3\r\n * guidelines, it supports two visual variants—`outlined` and `filled`—each with dynamic elevation,\r\n * shape transitions, and adaptive color theming. The component responds to control state changes\r\n * (focus, hover, press, disabled, invalid) with smooth motion and semantic clarity, ensuring\r\n * visual hierarchy and emotional resonance.\r\n\r\n * The component is accessible by default, with ARIA annotations, contrast-safe color tokens,\r\n * and dynamic descriptions for hint and error messaging. It supports prefix and suffix content,\r\n * floating labels, and adaptive subscript visibility. When hosting a control with validation,\r\n * error messages are surfaced with `aria-invalid` and described for assistive technology.\r\n\r\n * Native form controls may not expose full state or messaging on their own. `m3e-form-field` bridges\r\n * these gaps by coordinating label floating, container styling, and subscript feedback.\r\n *\r\n * @example\r\n * The following example illustrates a basic usage of the `m3e-form-field`.\r\n * ```html\r\n * <m3e-form-field>\r\n * <label slot=\"label\" for=\"field\">Text field</label>\r\n * <input id=\"field\" />\r\n * </m3e-form-field>\r\n * ```\r\n * \r\n * @tag m3e-form-field\r\n *\r\n * @slot - Renders the control of the field.\r\n * @slot prefix - Renders content before the fields's control.\r\n * @slot prefix-text - Renders text before the fields's control.\r\n * @slot suffix - Renders content after the fields's control.\r\n * @slot suffix-text - Renders text after the fields's control.\r\n * @slot hint - Renders hint text in the fields's subscript, when the control is valid.\r\n * @slot error - Renders error text in the fields's subscript, when the control is invalid.\r\n *\r\n * @attr float-label - Specifies whether the label should float always or only when necessary.\r\n * @attr hide-required-marker - Whether the required marker should be hidden.\r\n * @attr hide-subscript - Whether subscript content is hidden.\r\n * @attr variant - The appearance variant of the field.\r\n *\r\n * @cssprop --m3e-form-field-font-size - Font size for the form field container text.\r\n * @cssprop --m3e-form-field-font-weight - Font weight for the form field container text.\r\n * @cssprop --m3e-form-field-line-height - Line height for the form field container text.\r\n * @cssprop --m3e-form-field-tracking - Letter spacing for the form field container text.\r\n * @cssprop --m3e-form-field-label-font-size - Font size for the floating label.\r\n * @cssprop --m3e-form-field-label-font-weight - Font weight for the floating label.\r\n * @cssprop --m3e-form-field-label-line-height - Line height for the floating label.\r\n * @cssprop --m3e-form-field-label-tracking - Letter spacing for the floating label.\r\n * @cssprop --m3e-form-field-subscript-font-size - Font size for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-font-weight - Font weight for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-line-height - Line height for hint and error text.\r\n * @cssprop --m3e-form-field-subscript-tracking - Letter spacing for hint and error text.\r\n * @cssprop --m3e-form-field-color - Text color for the form field container.\r\n * @cssprop --m3e-form-field-subscript-color - Color for hint and error text.\r\n * @cssprop --m3e-form-field-invalid-color - Color used when the control is invalid.\r\n * @cssprop --m3e-form-field-focused-outline-color - Outline color when focused.\r\n * @cssprop --m3e-form-field-focused-color - Label color when focused.\r\n * @cssprop --m3e-form-field-outline-color - Outline color in outlined variant.\r\n * @cssprop --m3e-form-field-container-color - Background color in filled variant.\r\n * @cssprop --m3e-form-field-hover-container-color - Hover background color in filled variant.\r\n * @cssprop --m3e-form-field-width - Width of the form field container.\r\n * @cssprop --m3e-form-field-icon-size - Size of prefix and suffix icons.\r\n * @cssprop --m3e-outlined-form-field-container-shape - Corner radius for outlined container.\r\n * @cssprop --m3e-form-field-container-shape - Corner radius for filled container.\r\n * @cssprop --m3e-form-field-hover-container-opacity - Opacity for hover background in filled variant.\r\n * @cssprop --m3e-form-field-disabled-opacity - Opacity for disabled text.\r\n * @cssprop --m3e-form-field-disabled-container-opacity - Opacity for disabled container background.\r\n */\r\n@customElement(\"m3e-form-field\")\r\nexport class M3eFormFieldElement extends ReconnectedCallback(AttachInternals(LitElement)) {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-form-field input::placeholder,\r\n m3e-form-field textarea::placeholder {\r\n user-select: none;\r\n color: currentColor;\r\n transition: opacity ${DesignToken.motion.duration.extraLong1};\r\n }\r\n m3e-form-field[float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(\r\n :state(--with-label),\r\n :--with-label\r\n )\r\n input::placeholder,\r\n m3e-form-field[float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(\r\n :state(--with-label),\r\n :--with-label\r\n )\r\n textarea::placeholder {\r\n opacity: 0;\r\n transition: opacity 0s;\r\n }\r\n m3e-form-field[variant=\"outlined\"] m3e-input-chip-set {\r\n margin-block: calc(calc(3.5rem + ${DesignToken.density.calc(-3)}) / 4);\r\n }\r\n @media (prefers-reduced-motion) {\r\n m3e-form-field input::placeholder,\r\n m3e-form-field textarea::placeholder {\r\n transition: none !important;\r\n }\r\n }\r\n `);\r\n }\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-flex;\r\n flex-direction: column;\r\n vertical-align: middle;\r\n font-size: var(--m3e-form-field-font-size, ${DesignToken.typescale.standard.body.large.fontSize});\r\n font-weight: var(--m3e-form-field-font-weight, ${DesignToken.typescale.standard.body.large.fontWeight});\r\n line-height: var(--m3e-form-field-line-height, ${DesignToken.typescale.standard.body.large.lineHeight});\r\n letter-spacing: var(--m3e-form-field-tracking, ${DesignToken.typescale.standard.body.large.tracking});\r\n width: var(--m3e-form-field-width, 14.5rem);\r\n color: var(--_form-field-color);\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled))) .base {\r\n cursor: var(--_form-field-cursor);\r\n }\r\n .base {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n min-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n --_form-field-label-line-height: var(\r\n --m3e-form-field-label-line-height,\r\n ${DesignToken.typescale.standard.body.small.lineHeight}\r\n );\r\n }\r\n .content {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n min-height: var(--m3e-form-field-icon-size, 1.5rem);\r\n }\r\n .prefix,\r\n .suffix {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n user-select: none;\r\n flex: none;\r\n font-size: var(--m3e-form-field-icon-size, 1.5rem);\r\n }\r\n .prefix-text,\r\n .suffix-text {\r\n opacity: 1;\r\n transition: opacity ${DesignToken.motion.duration.extraLong1};\r\n user-select: none;\r\n flex: none;\r\n }\r\n .input {\r\n display: inline-flex;\r\n flex-wrap: wrap;\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n }\r\n .label {\r\n display: flex;\r\n position: absolute;\r\n pointer-events: none;\r\n user-select: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n font-size: var(--m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-form-field-label-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-form-field-label-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-form-field-label-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n color: var(--_form-field-label-color, inherit);\r\n transition: ${unsafeCSS(\r\n `top ${DesignToken.motion.duration.short4}, \r\n font-size ${DesignToken.motion.duration.short4}, \r\n line-height ${DesignToken.motion.duration.short4}`,\r\n )};\r\n }\r\n :host(:is(:state(--with-select), :--with-select)) .label {\r\n margin-inline-end: 1.5rem;\r\n }\r\n ::slotted([slot=\"label\"]) {\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n .subscript {\r\n display: inline-flex;\r\n width: 100%;\r\n margin-top: 0.25rem;\r\n font-size: var(--m3e-form-field-subscript-font-size, ${DesignToken.typescale.standard.body.small.fontSize});\r\n font-weight: var(--m3e-form-field-subscript-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight});\r\n line-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n letter-spacing: var(--m3e-form-field-subscript-tracking, ${DesignToken.typescale.standard.body.small.tracking});\r\n min-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight});\r\n color: var(--m3e-form-field-subscript-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n .error,\r\n .hint {\r\n flex: 1 1 auto;\r\n }\r\n :host([hide-subscript=\"always\"]) .subscript {\r\n display: none;\r\n }\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid))) .subscript {\r\n opacity: 0;\r\n margin-top: 0.25rem;\r\n transform: translateY(-0.25rem);\r\n transition: ${unsafeCSS(\r\n `opacity ${DesignToken.motion.duration.short4}, \r\n transform ${DesignToken.motion.duration.short4}`,\r\n )};\r\n }\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid)):focus-within) .subscript,\r\n :host([hide-subscript=\"auto\"]:not(:is(:state(--invalid), :--invalid)):is(:state(--pressed), :--pressed))\r\n .subscript {\r\n opacity: 1;\r\n transform: translateY(0);\r\n }\r\n :host(:is(:state(--invalid), :--invalid)) .hint {\r\n display: none;\r\n }\r\n :host(:not(:is(:state(--invalid), :--invalid))) .error {\r\n display: none;\r\n }\r\n ::slotted(input),\r\n ::slotted(textarea),\r\n ::slotted(select) {\r\n outline: unset;\r\n border: unset;\r\n background-color: transparent;\r\n box-shadow: none;\r\n font-family: inherit;\r\n font-size: inherit;\r\n line-height: inherit;\r\n letter-spacing: inherit;\r\n color: var(--_form-field-input-color, inherit);\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n padding: unset;\r\n }\r\n ::slotted(textarea) {\r\n scrollbar-width: ${DesignToken.scrollbar.thinWidth};\r\n scrollbar-color: ${DesignToken.scrollbar.color};\r\n }\r\n ::slotted(m3e-select),\r\n ::slotted(m3e-input-chip-set) {\r\n flex: 1 1 auto;\r\n min-width: 0;\r\n }\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(:is(:state(--pressed), :--pressed)))\r\n .label {\r\n font-size: inherit;\r\n }\r\n\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(:state(--with-label), :--with-label))\r\n .prefix-text,\r\n :host([float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):is(:state(--with-label), :--with-label))\r\n .suffix-text {\r\n opacity: 0;\r\n transition: opacity 0s;\r\n }\r\n .prefix {\r\n margin-inline-start: 1rem;\r\n }\r\n :host(:is(:state(--with-prefix), :--with-prefix)) .prefix {\r\n margin-inline-end: 1rem;\r\n margin-inline-start: 0.75rem;\r\n }\r\n .suffix {\r\n margin-inline-end: 1rem;\r\n }\r\n :host(:is(:state(--with-suffix), :--with-suffix)) .suffix {\r\n margin-inline-start: 0.25rem;\r\n margin-inline-end: 0.5rem;\r\n }\r\n :host(:is(:state(--with-suffix), :--with-suffix):is(:state(--with-select), :--with-select)) .suffix {\r\n margin-inline-start: unset;\r\n }\r\n :host(:is(:state(--with-select), :--with-select)) .suffix-text {\r\n display: none;\r\n }\r\n :host([variant=\"outlined\"]) .label {\r\n margin-top: calc(0px - var(--_form-field-label-line-height) / 2);\r\n }\r\n :host([variant=\"outlined\"]) .outline {\r\n position: absolute;\r\n display: flex;\r\n pointer-events: none;\r\n left: 0;\r\n top: 0;\r\n bottom: 0;\r\n right: 0;\r\n }\r\n :host([variant=\"outlined\"]) .pseudo-label {\r\n visibility: hidden;\r\n margin-inline-end: 0.5rem;\r\n font-size: var(--_form-field-label-font-size);\r\n line-height: var(--_form-field-label-line-height);\r\n letter-spacing: var(--_form-field-label-tracking);\r\n max-width: 100%;\r\n transition-property: max-width, margin-inline-end;\r\n transition-duration: 1ms;\r\n }\r\n :host(\r\n :is(:state(--required), :--required):not([hide-required-marker]):not(:is(:state(--with-label), :--with-label))\r\n )\r\n .pseudo-label,\r\n :host(\r\n :is(:state(--required), :--required):not([hide-required-marker]):not(:is(:state(--with-label), :--with-label))\r\n )\r\n .required-marker {\r\n display: none;\r\n }\r\n :host([variant=\"outlined\"]:is(:state(--required), :--required):not([hide-required-marker])) .pseudo-label {\r\n margin-inline-end: 0.25rem;\r\n }\r\n :host(\r\n [variant=\"outlined\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .pseudo-label {\r\n max-width: 0;\r\n margin-inline-end: 0px;\r\n transition-delay: ${DesignToken.motion.duration.short2};\r\n }\r\n :host([variant=\"outlined\"]) .outline-start,\r\n :host([variant=\"outlined\"]) .outline-notch,\r\n :host([variant=\"outlined\"]) .outline-end {\r\n box-sizing: border-box;\r\n border-width: var(--_form-field-outline-size, 1px);\r\n border-color: var(--_form-field-outline-color);\r\n transition: border-color ${DesignToken.motion.duration.short4};\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--with-label), :--with-label))) .outline-notch {\r\n display: none;\r\n }\r\n :host([variant=\"outlined\"]) .outline-start {\r\n min-width: 0.75rem;\r\n border-top-style: solid;\r\n border-inline-start-style: solid;\r\n border-bottom-style: solid;\r\n border-start-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n border-end-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n }\r\n :host([variant=\"outlined\"]) .outline-notch {\r\n border-bottom-style: solid;\r\n }\r\n :host([variant=\"outlined\"]) .outline-end {\r\n flex-grow: 1;\r\n min-width: 1rem;\r\n border-top-style: solid;\r\n border-inline-end-style: solid;\r\n border-bottom-style: solid;\r\n border-start-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n border-end-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall});\r\n }\r\n :host([variant=\"outlined\"]:is(:state(--with-prefix), :--with-prefix)) .outline-start {\r\n min-width: calc(1.25rem + var(--_prefix-width, 0px) + 0.25rem);\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled))) .base:hover .outline,\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):focus-within) .outline,\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):is(:state(--pressed), :--pressed)) .outline {\r\n --_form-field-outline-size: 2px;\r\n }\r\n :host([variant=\"outlined\"]) .subscript {\r\n margin-inline: 1rem;\r\n width: calc(100% - 2rem);\r\n }\r\n :host([variant=\"outlined\"]) .content {\r\n min-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host(\r\n [variant=\"outlined\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .label {\r\n margin-top: unset;\r\n line-height: calc(3.5rem + ${DesignToken.density.calc(-3)});\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host([variant=\"filled\"]) .base {\r\n --_select-arrow-margin-top: calc(\r\n 0px - calc(1rem / max(calc(0 - calc(var(--md-sys-density-scale, 0) + var(--md-sys-density-scale, 0))), 1))\r\n );\r\n }\r\n :host([variant=\"filled\"]) .base::before {\r\n content: \"\";\r\n box-sizing: border-box;\r\n position: absolute;\r\n pointer-events: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n border-bottom-style: solid;\r\n border-width: 1px;\r\n border-radius: var(--m3e-form-field-container-shape, ${DesignToken.shape.corner.extraSmallTop});\r\n border-color: var(--_form-field-outline-color);\r\n background-color: var(--_form-field-container-color);\r\n }\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled))) .base:hover::before,\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):focus-within) .base::before,\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):is(:state(--pressed), :--pressed))\r\n .base::before {\r\n border-width: 3px;\r\n }\r\n :host([variant=\"filled\"]) .base::after {\r\n content: \"\";\r\n box-sizing: border-box;\r\n position: absolute;\r\n pointer-events: none;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: var(--_form-field-hover-container-color);\r\n transition: background-color ${DesignToken.motion.duration.short4};\r\n }\r\n :host([variant=\"filled\"]) .subscript {\r\n margin-inline: 1rem;\r\n width: calc(100% - 2rem);\r\n }\r\n :host([variant=\"filled\"]) .content {\r\n padding-top: calc(1.5rem + ${DesignToken.density.calc(-3)});\r\n margin-bottom: 0.5rem;\r\n }\r\n :host([variant=\"filled\"]) .label {\r\n top: max(0px, calc(0.5rem + ${DesignToken.density.calc(-3)}));\r\n }\r\n :host(\r\n [variant=\"filled\"][float-label=\"auto\"]:not(:is(:state(--float-label), :--float-label)):not(\r\n :is(:state(--pressed), :--pressed)\r\n )\r\n )\r\n .label {\r\n top: 0px;\r\n line-height: calc(3.5rem + ${DesignToken.density.calc(-3)} - 0.0625rem);\r\n --_form-field-label-font-size: var(\r\n --m3e-form-field-label-font-size,\r\n ${DesignToken.typescale.standard.body.small.fontSize}\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):not(:focus-within):not(:is(:state(--pressed), :--pressed)))\r\n .base:hover {\r\n --_form-field-hover-container-color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-hover-container-color, ${DesignToken.color.onSurface})\r\n var(--m3e-form-field-hover-container-opacity, 8%),\r\n transparent\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid))) {\r\n color: var(--m3e-form-field-color, ${DesignToken.color.onSurface});\r\n }\r\n :host([variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)))\r\n .base {\r\n --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.outline});\r\n }\r\n :host([variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid))) .base {\r\n --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.onSurfaceVariant});\r\n }\r\n :host(\r\n [variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(\r\n :is(:state(--invalid), :--invalid)\r\n ):focus-within\r\n )\r\n .base,\r\n :host(\r\n [variant=\"outlined\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)):is(\r\n :state(--pressed),\r\n :--pressed\r\n )\r\n )\r\n .base,\r\n :host(\r\n [variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(\r\n :is(:state(--invalid), :--invalid)\r\n ):focus-within\r\n )\r\n .base,\r\n :host(\r\n [variant=\"filled\"]:not(:is(:state(--disabled), :--disabled)):not(:is(:state(--invalid), :--invalid)):is(\r\n :state(--pressed),\r\n :--pressed\r\n )\r\n )\r\n .base {\r\n --_form-field-outline-color: var(--m3e-form-field-focused-outline-color, ${DesignToken.color.primary});\r\n --_form-field-label-color: var(--m3e-form-field-focused-color, ${DesignToken.color.primary});\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled))) .base {\r\n --_form-field-container-color: var(\r\n --m3e-form-field-container-color,\r\n ${DesignToken.color.surfaceContainerHighest}\r\n );\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):is(:state(--invalid), :--invalid)) .base {\r\n --_form-field-label-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n --_form-field-outline-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n }\r\n :host(:not(:is(:state(--disabled), :--disabled)):is(:state(--invalid), :--invalid)) .subscript {\r\n color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error});\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-form-field-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) .base {\r\n --_form-field-container-color: color-mix(\r\n in srgb,\r\n var(--m3e-form-field-disabled-container-color, ${DesignToken.color.onSurface})\r\n var(--m3e-form-field-disabled-container-opacity, 4%),\r\n transparent\r\n );\r\n }\r\n :host(:is(:state(--no-animate), :--no-animate)) *,\r\n :host(:is(:state(--no-animate), :--no-animate)) *::before,\r\n :host(:is(:state(--no-animate), :--no-animate)) *::after {\r\n transition: none !important;\r\n }\r\n @media (forced-colors: active) {\r\n :host([variant=\"filled\"]) .base::after {\r\n transition: none;\r\n }\r\n :host {\r\n --_form-field-outline-color: CanvasText;\r\n }\r\n :host(:is(:state(--disabled), :--disabled)) {\r\n --_form-field-input-color: GrayText;\r\n --_form-field-color: GrayText;\r\n --_form-field-label-color: GrayText;\r\n --_form-field-outline-color: GrayText;\r\n }\r\n }\r\n @media (prefers-reduced-motion) {\r\n .base::before,\r\n .prefix-text,\r\n .suffix-text,\r\n .label,\r\n .subscript,\r\n .outline-start,\r\n .outline-notch,\r\n .outline-end,\r\n .pseudo-label {\r\n transition: none !important;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #control: FormFieldControl | null = null;\r\n /** @private */ #removeValueInterceptor?: () => void;\r\n /** @private */ readonly #formResetHandler = () => this.#handleFormReset();\r\n /** @private */ readonly #controlInvalidHandler = () => this.#handleControlInvalid();\r\n\r\n /** @private */\r\n readonly #controlMutationController = new MutationController(this, {\r\n target: null,\r\n config: { attributeFilter: [\"disabled\", \"readonly\", \"required\"] },\r\n callback: () => this.notifyControlStateChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #resizeController = new ResizeController(this, {\r\n target: null,\r\n callback: () => this.#handlePrefixResize(),\r\n });\r\n\r\n /** @private */\r\n readonly #focusController = new FocusController(this, {\r\n target: null,\r\n callback: (focused) => {\r\n focused = focused && !(this.#control?.disabled ?? true);\r\n setCustomState(this, \"--no-animate\", false);\r\n this.#focused = focused;\r\n if (focused) {\r\n setCustomState(this, \"--float-label\", true);\r\n } else {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n this.notifyControlStateChange();\r\n }\r\n },\r\n });\r\n\r\n /** @private */ @query(\".base\") private readonly _base!: HTMLElement;\r\n /** @private */ @query(\".prefix\") private readonly _prefix!: HTMLElement;\r\n /** @private */ @query(\".error\") private readonly _error!: HTMLElement;\r\n /** @private */ @query(\".hint\") private readonly _hint!: HTMLElement;\r\n\r\n /** @private */\r\n readonly #hintMutationController = new MutationController(this, {\r\n target: null,\r\n config: { childList: true, subtree: true },\r\n callback: () => this.#handleHintChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #errorMutationController = new MutationController(this, {\r\n target: null,\r\n config: { childList: true, subtree: true },\r\n callback: () => this.#handleErrorChange(),\r\n });\r\n\r\n /** @private */\r\n readonly #pressedController = new PressedController(this, {\r\n target: null,\r\n callback: (pressed) => setCustomState(this, \"--pressed\", pressed && !(this.#control?.disabled ?? true)),\r\n });\r\n\r\n /** @private */ #focused = false;\r\n /** @private */ @state() private _pseudoLabel = \"\";\r\n /** @private */ @state() private _required = false;\r\n /** @private */ @state() private _invalid = false;\r\n /** @private */ @state() private _validationMessage = \"\";\r\n /** @private */ #hintText = \"\";\r\n /** @private */ #errorText = \"\";\r\n\r\n constructor() {\r\n super();\r\n\r\n new HoverController(this, { callback: () => setCustomState(this, \"--no-animate\", false) });\r\n }\r\n\r\n /** @private */\r\n get #shouldFloatLabel(): boolean {\r\n return this.#control?.shouldLabelFloat !== undefined\r\n ? this.#control.shouldLabelFloat === true\r\n : typeof this.#control?.value == \"string\" && this.#control.value.length > 0;\r\n }\r\n\r\n /** A reference to the element used to anchor dropdown menus. */\r\n get menuAnchor() {\r\n return this._base;\r\n }\r\n\r\n /** A reference to the hosted form field control. */\r\n get control() {\r\n return this.#control;\r\n }\r\n\r\n /**\r\n * The appearance variant of the field.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: FormFieldVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the required marker should be hidden.\r\n * @default false\r\n */\r\n @property({ attribute: \"hide-required-marker\", type: Boolean, reflect: true }) hideRequiredMarker = false;\r\n\r\n /**\r\n * Whether subscript content is hidden.\r\n * @default \"auto\"\r\n */\r\n @property({ attribute: \"hide-subscript\", reflect: true }) hideSubscript: HideSubscriptType = \"auto\";\r\n\r\n /**\r\n * Specifies whether the label should float always or only when necessary.\r\n * @default \"auto\"\r\n */\r\n @property({ attribute: \"float-label\", reflect: true }) floatLabel: FloatLabelType = \"auto\";\r\n\r\n /**\r\n * Notifies the form field that the state of the hosted `control` has changed.\r\n * @param {boolean} [checkValidity=false] Whether to check validity.\r\n */\r\n notifyControlStateChange(checkValidity: boolean = false): void {\r\n this._required = this.#control?.required === true;\r\n setCustomState(this, \"--required\", this._required);\r\n setCustomState(this, \"--disabled\", this.#control?.disabled === true);\r\n setCustomState(this, \"--readonly\", isReadOnlyMixin(this.#control) && this.#control.readOnly === true);\r\n if (this.floatLabel === \"auto\") {\r\n setCustomState(this, \"--float-label\", this.#shouldFloatLabel || this.#focused);\r\n }\r\n\r\n if (checkValidity) {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n }\r\n\r\n setCustomState(this, \"--invalid\", this._invalid);\r\n\r\n this._validationMessage = this.#control?.validationMessage ?? \"\";\r\n if (!this.isUpdatePending) {\r\n this.performUpdate();\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n // Label animations are disabled on initial paint.\r\n setCustomState(this, \"--no-animate\", true);\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n this.#changeControl(null);\r\n }\r\n\r\n /** @inheritdoc */\r\n override reconnectedCallback(): void {\r\n super.reconnectedCallback();\r\n this.#initialize();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues): void {\r\n super.firstUpdated(_changedProperties);\r\n this.#initialize();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"_invalid\") && this.#control) {\r\n this.#control.ariaInvalid = this._invalid ? \"true\" : null;\r\n\r\n if (this.#errorText) {\r\n if (this._invalid) {\r\n M3eAriaDescriber.describe(this.#control, this.#errorText);\r\n } else {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" @click=\"${this.#handleContainerClick}\">\r\n ${this.variant === \"outlined\"\r\n ? html`<div class=\"outline\" aria-hidden=\"true\">\r\n <div class=\"outline-start\"></div>\r\n <div class=\"outline-notch\">\r\n <div class=\"pseudo-label\">\r\n ${this._pseudoLabel} ${!this.hideRequiredMarker && this._required ? html` *` : nothing}\r\n </div>\r\n </div>\r\n <div class=\"outline-end\"></div>\r\n </div>`\r\n : nothing}\r\n <div class=\"prefix\">\r\n <slot name=\"prefix\" @slotchange=\"${this.#handlePrefixSlotChange}\"></slot>\r\n </div>\r\n <div class=\"content\">\r\n <span class=\"prefix-text\"><slot name=\"prefix-text\"></slot></span>\r\n <span class=\"input\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\" @change=\"${this.#handleControlChange}\"></slot>\r\n </span>\r\n <span class=\"suffix-text\"><slot name=\"suffix-text\"></slot></span>\r\n <span class=\"label\">\r\n <slot name=\"label\" @slotchange=\"${this.#handleLabelSlotChange}\"></slot>\r\n ${!this.hideRequiredMarker && this._required\r\n ? html`<span class=\"required-marker\" aria-hidden=\"true\"> *</span>`\r\n : nothing}\r\n </span>\r\n </div>\r\n <div\r\n class=\"suffix\"\r\n @click=\"${this.#stopPropagation}\"\r\n @focusin=\"${this.#stopPropagation}\"\r\n @focusout=\"${this.#stopPropagation}\"\r\n @pointerdown=\"${this.#stopPropagation}\"\r\n @keydown=\"${this.#stopPropagation}\"\r\n @keyup=\"${this.#stopPropagation}\"\r\n >\r\n <slot name=\"suffix\" @slotchange=\"${this.#handleSuffixSlotChange}\"></slot>\r\n </div>\r\n </div>\r\n <span class=\"subscript\" aria-hidden=\"true\">\r\n <span class=\"error\"><slot name=\"error\">${this._validationMessage}</slot></span>\r\n <span class=\"hint\"><slot name=\"hint\"></slot></span>\r\n </span>`;\r\n }\r\n\r\n /** @private */\r\n #initialize(): void {\r\n this.#focusController.observe(this._base);\r\n this.#pressedController.observe(this._base);\r\n\r\n this.#hintMutationController.observe(this._hint);\r\n this.#handleHintChange();\r\n\r\n this.#errorMutationController.observe(this._error);\r\n this.#handleErrorChange();\r\n }\r\n\r\n /** @private */\r\n #stopPropagation(e: Event): void {\r\n e.stopImmediatePropagation();\r\n e.stopPropagation();\r\n }\r\n\r\n /** @private */\r\n #handleLabelSlotChange(e: Event): void {\r\n const assignedElements = (<HTMLSlotElement>e.target).assignedElements({ flatten: true });\r\n setCustomState(this, \"--with-label\", assignedElements.length > 0);\r\n this._pseudoLabel = assignedElements[0]?.textContent ?? \"\";\r\n }\r\n\r\n /** @private */\r\n #handlePrefixSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-prefix\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n this.#resizeController.observe(this._prefix);\r\n }\r\n\r\n /** @private */\r\n #handleSuffixSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-suffix\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handlePrefixResize(): void {\r\n if (this.variant === \"outlined\") {\r\n this._base.style.setProperty(\"--_prefix-width\", `${this._prefix.clientWidth}px`);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n this.#changeControl(findFormFieldControl(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleContainerClick(e: MouseEvent): void {\r\n if (this.#control && !this.#focused && !this.#control.disabled) {\r\n if (this.#control.onContainerClick) {\r\n this.#control.onContainerClick(e);\r\n } else {\r\n this.#control.focus();\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleControlInvalid(): void {\r\n this._invalid = true;\r\n this.notifyControlStateChange();\r\n }\r\n\r\n /** @private */\r\n #handleControlChange(): void {\r\n this._invalid = !(this.#control?.checkValidity?.() ?? true);\r\n this.notifyControlStateChange();\r\n }\r\n\r\n /** @private */\r\n #handleFormReset(): void {\r\n this._invalid = false;\r\n setTimeout(() => this.notifyControlStateChange());\r\n }\r\n\r\n /** @private */\r\n #changeControl(control: FormFieldControl | null): void {\r\n if (this.#control === control) return;\r\n if (this.#control) {\r\n if (this.#hintText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#hintText);\r\n }\r\n if (this.#errorText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n\r\n this.#controlMutationController.unobserve(this.#control);\r\n this.#control.removeEventListener(\"invalid\", this.#controlInvalidHandler);\r\n this.#control.form?.removeEventListener(\"reset\", this.#formResetHandler);\r\n this.#removeValueInterceptor?.();\r\n this.#removeValueInterceptor = undefined;\r\n }\r\n this.#control = control;\r\n\r\n if ([\"INPUT\", \"TEXTAREA\"].includes(this.#control?.tagName ?? \"\")) {\r\n this._base.style.setProperty(\"--_form-field-cursor\", \"text\");\r\n } else {\r\n this._base.style.removeProperty(\"--_form-field-cursor\");\r\n }\r\n\r\n setCustomState(this, \"--with-select\", this.#control?.tagName === \"M3E-SELECT\");\r\n if (hasCustomState(this, \"--with-select\")) {\r\n this._base.style.setProperty(\"--_form-field-cursor\", \"pointer\");\r\n }\r\n\r\n if (this.#control) {\r\n this.#controlMutationController.observe(this.#control);\r\n this.#control.addEventListener(\"invalid\", this.#controlInvalidHandler);\r\n this.#control.form?.addEventListener(\"reset\", this.#formResetHandler);\r\n this.#control.removeAttribute(\"aria-invalid\");\r\n\r\n if (this.#hintText) {\r\n M3eAriaDescriber.describe(this.#control, this.#hintText);\r\n }\r\n\r\n this.notifyControlStateChange();\r\n\r\n const tagname = this.#control.tagName.toLowerCase();\r\n if (tagname.startsWith(\"m3e-\") && !customElements.get(tagname)) {\r\n customElements.whenDefined(tagname).then(() => this.#bindValueInterceptor());\r\n } else {\r\n this.#bindValueInterceptor();\r\n }\r\n }\r\n }\r\n\r\n /** @private */\r\n #bindValueInterceptor(): void {\r\n if (!this.#control) return;\r\n this.#removeValueInterceptor = interceptProperty(this.#control, \"value\", {\r\n set: (value, setter) => {\r\n setter(value);\r\n this.notifyControlStateChange(true);\r\n },\r\n });\r\n }\r\n\r\n /** @private */\r\n #handleHintChange(): void {\r\n const hintText = getTextContent(this._hint, true);\r\n if (hintText === this.#hintText) return;\r\n\r\n if (this.#control && this.#hintText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#hintText);\r\n }\r\n\r\n this.#hintText = hintText;\r\n\r\n if (this.#control && this.#hintText) {\r\n M3eAriaDescriber.describe(this.#control, this.#hintText);\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleErrorChange(): void {\r\n const errorText = getTextContent(this._error, true);\r\n if (errorText === this.#errorText) return;\r\n\r\n if (this.#control && this.#errorText) {\r\n M3eAriaDescriber.removeDescription(this.#control, this.#errorText);\r\n }\r\n\r\n this.#errorText = errorText;\r\n\r\n if (this.#control && this.#errorText && this._invalid) {\r\n M3eAriaDescriber.describe(this.#control, this.#errorText);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-form-field\": M3eFormFieldElement;\r\n }\r\n}\r\n"],"names":["KNOWN_FORM_FIELD_TAGS","isFormFieldControl","value","HTMLElement","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","includes","tagName","toLowerCase","findFormFieldControl","slot","element","assignedElements","flatten","walker","document","createTreeWalker","NodeFilter","SHOW_ELEMENT","nextNode","currentNode","M3eFormFieldElement","ReconnectedCallback","AttachInternals","LitElement","constructor","super","_M3eFormFieldElement_control","set","this","_M3eFormFieldElement_removeValueInterceptor","_M3eFormFieldElement_formResetHandler","__classPrivateFieldGet","_M3eFormFieldElement_instances","_M3eFormFieldElement_handleFormReset","call","_M3eFormFieldElement_controlInvalidHandler","_M3eFormFieldElement_handleControlInvalid","_M3eFormFieldElement_controlMutationController","MutationController","target","config","attributeFilter","callback","notifyControlStateChange","_M3eFormFieldElement_resizeController","ResizeController","_M3eFormFieldElement_handlePrefixResize","_M3eFormFieldElement_focusController","FocusController","focused","disabled","setCustomState","__classPrivateFieldSet","_M3eFormFieldElement_focused","_invalid","checkValidity","_M3eFormFieldElement_hintMutationController","childList","subtree","_M3eFormFieldElement_handleHintChange","_M3eFormFieldElement_errorMutationController","_M3eFormFieldElement_handleErrorChange","_M3eFormFieldElement_pressedController","PressedController","pressed","_pseudoLabel","_required","_validationMessage","_M3eFormFieldElement_hintText","_M3eFormFieldElement_errorText","variant","hideRequiredMarker","hideSubscript","floatLabel","HoverController","menuAnchor","_base","control","required","isReadOnlyMixin","readOnly","_M3eFormFieldElement_shouldFloatLabel_get","validationMessage","isUpdatePending","performUpdate","connectedCallback","disconnectedCallback","_M3eFormFieldElement_changeControl","reconnectedCallback","_M3eFormFieldElement_initialize","firstUpdated","_changedProperties","update","changedProperties","has","ariaInvalid","M3eAriaDescriber","describe","removeDescription","render","html","_M3eFormFieldElement_handleContainerClick","nothing","_M3eFormFieldElement_handlePrefixSlotChange","_M3eFormFieldElement_handleSlotChange","_M3eFormFieldElement_handleControlChange","_M3eFormFieldElement_handleLabelSlotChange","_M3eFormFieldElement_stopPropagation","_M3eFormFieldElement_handleSuffixSlotChange","undefined","shouldLabelFloat","length","observe","_hint","_error","e","stopImmediatePropagation","stopPropagation","textContent","hasAssignedNodes","_prefix","style","setProperty","clientWidth","onContainerClick","focus","setTimeout","unobserve","removeEventListener","form","removeProperty","hasCustomState","addEventListener","removeAttribute","tagname","startsWith","customElements","get","whenDefined","then","_M3eFormFieldElement_bindValueInterceptor","interceptProperty","setter","hintText","getTextContent","errorText","registerStyleSheet","css","DesignToken","motion","duration","extraLong1","density","calc","styles","typescale","standard","body","large","fontSize","fontWeight","lineHeight","tracking","small","unsafeCSS","short4","color","onSurfaceVariant","scrollbar","thinWidth","short2","shape","corner","extraSmall","extraSmallTop","onSurface","outline","primary","surfaceContainerHighest","error","__decorate","query","prototype","state","property","reflect","attribute","type","Boolean","customElement"],"mappings":";;;;;;;;;;;;;GA6CA,MAAMA,EAAwB,CAAC,qBAAsB,cAO/C,SAAUC,EAAmBC,GACjC,OACEA,aAAiBC,cAChBD,aAAiBE,kBAChBF,aAAiBG,qBACjBH,aAAiBI,mBACjBN,EAAsBO,SAASL,EAAMM,QAAQC,eAEnD,CAOM,SAAUC,EAAqBC,GACnC,IAAK,MAAMC,KAAWD,EAAKE,iBAAiB,CAAEC,SAAS,IAAS,CAC9D,GAAIb,EAAmBW,GACrB,OAAOA,EAGT,MAAMG,EAASC,SAASC,iBAAiBL,EAASM,WAAWC,cAC7D,KAAOJ,EAAOK,YACZ,GAAInB,EAAmBc,EAAOM,aAC5B,OAAON,EAAOM,WAGpB,CAEA,OAAO,IACT;;;;;;;;0EC4BO,IAAMC,GAAN,cAAkCC,EAAoBC,EAAgBC,KAmjB3EC,WAAAA,GACEC,oBApEcC,EAAAC,IAAAC,KAAoC,MACpCC,EAAAF,IAAAC,aACSE,EAAAH,IAAAC,KAAoB,IAAMG,EAAAH,KAAII,EAAA,IAAAC,IAAiBC,KAArBN,OAC1BO,EAAAR,IAAAC,KAAyB,IAAMG,EAAAH,KAAII,EAAA,IAAAI,IAAsBF,KAA1BN,OAG/CS,EAAAV,IAAAC,KAA6B,IAAIU,EAAmBV,KAAM,CACjEW,OAAQ,KACRC,OAAQ,CAAEC,gBAAiB,CAAC,WAAY,WAAY,aACpDC,SAAUA,IAAMd,KAAKe,8BAIdC,EAAAjB,IAAAC,KAAoB,IAAIiB,EAAiBjB,KAAM,CACtDW,OAAQ,KACRG,SAAUA,IAAMX,EAAAH,KAAII,EAAA,IAAAc,GAAoBZ,KAAxBN,SAITmB,EAAApB,IAAAC,KAAmB,IAAIoB,EAAgB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S,CAAEE,UAAW,iBAAkBD,SAAS,KAAkDrK,GAAAkK,UAAA,qBAAA,GAM7CF,EAAA,CAAtDI,EAAS,CAAEE,UAAW,cAAeD,SAAS,KAA4CrK,GAAAkK,UAAA,kBAAA,GAhmBhFlK,GAAmBgK,EAAA,CAD/BS,EAAc,mBACFzK"}
|
package/dist/option.js
CHANGED
|
@@ -124,6 +124,11 @@ let M3eOptionElement = class M3eOptionElement extends Selected(Disabled(AttachIn
|
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
+
if (changedProperties.has("selected") || changedProperties.has("disabled")) {
|
|
128
|
+
this["dispatchEvent"](new CustomEvent("state-change", {
|
|
129
|
+
bubbles: true
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
127
132
|
}
|
|
128
133
|
/** @inheritdoc */
|
|
129
134
|
render() {
|
|
@@ -220,7 +225,7 @@ M3eOptGroupElement.styles = css`:host { display: block; --_option-padding-start:
|
|
|
220
225
|
M3eOptGroupElement.__nextId = 0;
|
|
221
226
|
M3eOptGroupElement = M3eOptGroupElement_1 = __decorate([customElement("m3e-optgroup")], M3eOptGroupElement);
|
|
222
227
|
|
|
223
|
-
var _M3eOptionPanelElement_instances, _M3eOptionPanelElement_handleNoDataSlotChange, _M3eOptionPanelElement_handleLoadingSlotChange, _M3eOptionPanelElement_handleMutation;
|
|
228
|
+
var _M3eOptionPanelElement_instances, _M3eOptionPanelElement_handleOptionStateChange, _M3eOptionPanelElement_handleNoDataSlotChange, _M3eOptionPanelElement_handleLoadingSlotChange, _M3eOptionPanelElement_handleMutation;
|
|
224
229
|
/**
|
|
225
230
|
* Presents a list of options on a temporary surface.
|
|
226
231
|
*
|
|
@@ -273,10 +278,15 @@ let M3eOptionPanelElement = class M3eOptionPanelElement extends Role(M3eFloating
|
|
|
273
278
|
}
|
|
274
279
|
/** @inheritdoc */
|
|
275
280
|
render() {
|
|
276
|
-
return html`<div class="base"><slot></slot><div class="no-data" aria-hidden="true"><slot name="no-data" @slotchange="${__classPrivateFieldGet(this, _M3eOptionPanelElement_instances, "m", _M3eOptionPanelElement_handleNoDataSlotChange)}"></slot></div><div class="loading" aria-hidden="true"><slot name="loading" @slotchange="${__classPrivateFieldGet(this, _M3eOptionPanelElement_instances, "m", _M3eOptionPanelElement_handleLoadingSlotChange)}"></slot></div></div>`;
|
|
281
|
+
return html`<div class="base" @state-change="${__classPrivateFieldGet(this, _M3eOptionPanelElement_instances, "m", _M3eOptionPanelElement_handleOptionStateChange)}"><slot></slot><div class="no-data" aria-hidden="true"><slot name="no-data" @slotchange="${__classPrivateFieldGet(this, _M3eOptionPanelElement_instances, "m", _M3eOptionPanelElement_handleNoDataSlotChange)}"></slot></div><div class="loading" aria-hidden="true"><slot name="loading" @slotchange="${__classPrivateFieldGet(this, _M3eOptionPanelElement_instances, "m", _M3eOptionPanelElement_handleLoadingSlotChange)}"></slot></div></div>`;
|
|
277
282
|
}
|
|
278
283
|
};
|
|
279
284
|
_M3eOptionPanelElement_instances = new WeakSet();
|
|
285
|
+
_M3eOptionPanelElement_handleOptionStateChange = function _M3eOptionPanelElement_handleOptionStateChange(e) {
|
|
286
|
+
if (e.target instanceof M3eOptionElement) {
|
|
287
|
+
e.stopImmediatePropagation();
|
|
288
|
+
}
|
|
289
|
+
};
|
|
280
290
|
_M3eOptionPanelElement_handleNoDataSlotChange = function _M3eOptionPanelElement_handleNoDataSlotChange(e) {
|
|
281
291
|
setCustomState(this, "--with-no-data", hasAssignedNodes(e.target));
|
|
282
292
|
};
|
package/dist/option.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option.js","sources":["../../src/option/OptionElement.ts","../../src/option/OptGroupElement.ts","../../src/option/OptionPanelElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n getTextContent,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n TextHighlightMode,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { typeaheadLabel } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * An option that can be selected.\r\n *\r\n * @description\r\n * The `m3e-option` component represents an individual selectable item within an option list,\r\n * adhering to Material Design 3 specifications. It provides visual feedback through state layers and ripple effects,\r\n * supports single and multiple selection modes, and includes comprehensive accessibility features including\r\n * keyboard navigation and focus management. The component automatically manages its visual appearance based on\r\n * selection and disabled states, with configurable styling for interactive and non-interactive variants.\r\n *\r\n * @tag m3e-option\r\n *\r\n * @slot - Renders the label of the option.\r\n *\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr disable-highlight - Whether text highlighting is disabled.\r\n * @attr highlight-mode - The mode in which to highlight a term.\r\n * @attr selected - Whether the element is selected.\r\n * @attr term - The search term to highlight.\r\n * @attr value - A string representing the value of the option.\r\n *\r\n * @cssprop --m3e-option-container-height - The height of the option container.\r\n * @cssprop --m3e-option-color - The text color of the option.\r\n * @cssprop --m3e-option-container-hover-color - The color for the hover state layer.\r\n * @cssprop --m3e-option-container-focus-color - The color for the focus state layer.\r\n * @cssprop --m3e-option-ripple-color - The color of the ripple effect.\r\n * @cssprop --m3e-option-selected-color - The text color when the option is selected.\r\n * @cssprop --m3e-option-selected-container-color - The background color when the option is selected.\r\n * @cssprop --m3e-option-selected-container-hover-color - The hover color for the selected state layer.\r\n * @cssprop --m3e-option-selected-container-focus-color - The focus color for the selected state layer.\r\n * @cssprop --m3e-option-selected-ripple-color - The ripple color when the option is selected.\r\n * @cssprop --m3e-option-disabled-color - The text color when the option is disabled.\r\n * @cssprop --m3e-option-disabled-opacity - The opacity level applied to the disabled text color.\r\n * @cssprop --m3e-option-icon-label-space - The spacing between the icon and label.\r\n * @cssprop --m3e-option-padding-start - The left padding of the option content.\r\n * @cssprop --m3e-option-padding-end - The right padding of the option content.\r\n * @cssprop --m3e-option-label-text-font-size - The font size of the option label.\r\n * @cssprop --m3e-option-label-text-font-weight - The font weight of the option label.\r\n * @cssprop --m3e-option-label-text-line-height - The line height of the option label.\r\n * @cssprop --m3e-option-label-text-tracking - The letter spacing of the option label.\r\n * @cssprop --m3e-option-focus-ring-shape - The corner radius of the focus ring.\r\n * @cssprop --m3e-option-icon-size - The size of the option icons.\r\n * @cssprop --m3e-option-shape - Base shape of the option.\r\n * @cssprop --m3e-option-selected-shape - Shape used for a selected option.\r\n * @cssprop --m3e-option-first-child-shape - Shape for the first option in a list.\r\n * @cssprop --m3e-option-last-child-shape - Shape for the last option in a list.\r\n */\r\n@customElement(\"m3e-option\")\r\nexport class M3eOptionElement extends Selected(Disabled(AttachInternals(Role(LitElement, \"option\")))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n user-select: none;\r\n flex: none;\r\n height: calc(var(--m3e-option-container-height, 2.75rem) + ${DesignToken.density.calc(-3)});\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host(:not([aria-disabled=\"true\"])) .base {\r\n color: var(--m3e-option-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-hover-color: var(--m3e-option-container-hover-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-focus-color: var(--m3e-option-container-focus-color, ${DesignToken.color.onSurface});\r\n --m3e-ripple-color: var(--m3e-option-ripple-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not(:is(:state(--empty), :--empty))[selected]) .base {\r\n color: var(--m3e-option-selected-color, ${DesignToken.color.onTertiaryContainer});\r\n background-color: var(--m3e-option-selected-container-color, ${DesignToken.color.tertiaryContainer});\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-option-selected-container-hover-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-option-selected-container-focus-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-ripple-color: var(--m3e-option-selected-ripple-color, ${DesignToken.color.onTertiaryContainer});\r\n }\r\n :host(:not([aria-disabled=\"true\"])) {\r\n cursor: pointer;\r\n }\r\n :host([aria-disabled=\"true\"]) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-option-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-option-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .base {\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n position: relative;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: var(--m3e-option-shape, ${DesignToken.shape.corner.extraSmall});\r\n transition: ${unsafeCSS(`border-radius ${DesignToken.motion.spring.fastEffects}`)};\r\n }\r\n :host([selected]:not(:is(:state(--first), :--first))) .base {\r\n border-top-left-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n border-top-right-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([selected]:not(:is(:state(--last), :--last))) .base {\r\n border-bottom-left-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n border-bottom-right-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host(:is(:state(--first), :--first)) .base {\r\n border-top-left-radius: var(--m3e-option-first-child-shape, ${DesignToken.shape.corner.medium});\r\n border-top-right-radius: var(--m3e-option-first-child-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host(:is(:state(--last), :--last)) .base {\r\n border-bottom-left-radius: var(--m3e-option-last-child-shape, ${DesignToken.shape.corner.medium});\r\n border-bottom-right-radius: var(--m3e-option-last-child-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n .touch {\r\n position: absolute;\r\n height: calc(\r\n var(--m3e-option-container-height, 2.75rem) + calc(var(--m3e-option-panel-gap, 0.125rem) * 2) +\r\n ${DesignToken.density.calc(-3)}\r\n );\r\n left: 0;\r\n right: 0;\r\n }\r\n .wrapper {\r\n flex: 1 1 auto;\r\n display: inline-flex;\r\n align-items: center;\r\n width: 100%;\r\n overflow: hidden;\r\n column-gap: var(--m3e-option-icon-label-space, 0.5rem);\r\n padding-inline-start: var(--_option-padding-start, var(--m3e-option-padding-start, 0.75rem));\r\n padding-inline-end: var(--m3e-option-padding-end, 0.75rem);\r\n font-size: var(--m3e-option-label-text-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(--m3e-option-label-text-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});\r\n line-height: var(--m3e-option-label-text-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});\r\n letter-spacing: var(--m3e-option-label-text-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n .focus-ring {\r\n border-radius: var(--m3e-option-focus-ring-shape, inherit);\r\n }\r\n .icon {\r\n margin-inline-start: calc(0px - var(--m3e-option-icon-label-space, 0.5rem));\r\n transition: ${unsafeCSS(\r\n `margin-inline-start ${DesignToken.motion.spring.fastEffects}, width ${DesignToken.motion.spring.fastEffects}`,\r\n )};\r\n }\r\n :host([selected]) .icon {\r\n margin-inline-start: 0;\r\n width: var(--m3e-option-icon-size, 1.25rem);\r\n }\r\n .icon {\r\n flex: none;\r\n width: 0px;\r\n font-size: var(--m3e-option-icon-size, 1.25rem);\r\n }\r\n :host(:is(:state(--empty), :--empty)) .icon,\r\n :host(:is(:state(--hide-selection-indicator), :--hide-selection-indicator)) .icon,\r\n :host(:not([selected])) .check {\r\n display: none;\r\n }\r\n @media (forced-colors: active) {\r\n .base {\r\n background-color: Menu;\r\n color: MenuText;\r\n }\r\n :host([aria-disabled=\"true\"]) .base {\r\n color: GrayText;\r\n }\r\n }\r\n @media (prefers-reduced-motion) {\r\n .icon,\r\n .base {\r\n transition: none;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #value?: string;\r\n /** @private */ #textContent = \"\";\r\n\r\n /** @internal */ @query(\".focus-ring\") readonly focusRing?: M3eFocusRingElement;\r\n /** @internal */ @query(\".state-layer\") readonly stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n\r\n /** A string representing the value of the option. */\r\n @property() get value() {\r\n return this.#value ?? this.#textContent;\r\n }\r\n set value(value: string) {\r\n this.#value = value;\r\n }\r\n\r\n /**\r\n * The search term to highlight.\r\n * @default \"\"\r\n */\r\n @property() term = \"\";\r\n\r\n /**\r\n * The mode in which to highlight a term.\r\n * @default \"contains\"\r\n */\r\n @property({ attribute: \"highlight-mode\" }) highlightMode: TextHighlightMode = \"contains\";\r\n\r\n /**\r\n * Whether text highlighting is disabled.\r\n * @default false\r\n */\r\n @property({ attribute: \"disable-highlight\", type: Boolean }) disableHighlight = false;\r\n\r\n /** The textual label of the option. */\r\n get label() {\r\n return this.#textContent;\r\n }\r\n\r\n /** @internal */\r\n [typeaheadLabel](): string {\r\n return this.label;\r\n }\r\n\r\n /** Whether the option represents an empty option. */\r\n get isEmpty() {\r\n return this.value === \"\";\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n [this.focusRing, this.stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this.focusRing, this.stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\") && this.selected) {\r\n const panel = this.closest(\"[role='listbox']\") ?? this.closest(\"m3e-autocomplete\") ?? this.closest(\"m3e-select\");\r\n if (panel && panel.ariaMultiSelectable !== \"true\" && !panel.hasAttribute(\"multi\")) {\r\n panel.querySelectorAll(\"m3e-option\").forEach((x) => {\r\n if (x !== this && x.selected) {\r\n x.selected = false;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override render(): unknown {\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"wrapper\">\r\n <div class=\"icon\" aria-hidden=\"true\">\r\n <svg class=\"check\" viewBox=\"0 -960 960 960\">\r\n <path fill=\"currentColor\" d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\r\n </svg>\r\n </div>\r\n <m3e-text-overflow class=\"label\">\r\n <m3e-text-highlight term=\"${this.term}\" mode=\"${this.highlightMode}\" ?disabled=\"${this.disableHighlight}\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-highlight>\r\n </m3e-text-overflow>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n this.#textContent = getTextContent(<HTMLSlotElement>e.target);\r\n setCustomState(this, \"--empty\", this.isEmpty);\r\n\r\n if (this.selected) {\r\n this.closest<LitElement>(\"m3e-select\")?.requestUpdate?.();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-option\": M3eOptionElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\n\r\nimport { customElement, DesignToken, Role } from \"@m3e/web/core\";\r\nimport { addAriaReferencedId, removeAriaReferencedId } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * Groups options under a subheading.\r\n *\r\n * @description\r\n * The `m3e-optgroup` component organizes related options within an option list,\r\n * providing visual and semantic grouping through a customizable label. It manages `aria-labelledby`\r\n * associations automatically and applies Material Design 3 typography and spacing conventions to\r\n * the group label. The component maintains proper semantic structure by utilizing the ARIA `group` role,\r\n * ensuring that assistive technologies correctly interpret the hierarchical relationship between the label\r\n * and contained options.\r\n *\r\n * @tag m3e-optgroup\r\n *\r\n * @slot - Renders the options of the group.\r\n * @slot label - Renders the label of the group.\r\n *\r\n * @cssprop --m3e-option-height - The height of the group label container.\r\n * @cssprop --m3e-option-font-size - The font size of the group label.\r\n * @cssprop --m3e-option-font-weight - The font weight of the group label.\r\n * @cssprop --m3e-option-line-height - The line height of the group label.\r\n * @cssprop --m3e-option-tracking - The letter spacing of the group label.\r\n * @cssprop --m3e-option-padding-end - The right padding of the label.\r\n * @cssprop --m3e-option-padding-start - The left padding of the label.\r\n * @cssprop --m3e-option-color - The text color of the group label.\r\n */\r\n@customElement(\"m3e-optgroup\")\r\nexport class M3eOptGroupElement extends Role(LitElement, \"group\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n --_option-padding-start: calc(var(--m3e-option-padding-start, 0.75rem) * 2);\r\n }\r\n .label {\r\n height: var(--m3e-option-height, 3rem);\r\n font-size: var(--m3e-option-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(--m3e-option-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});\r\n line-height: var(--m3e-option-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});\r\n letter-spacing: var(--m3e-option-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n padding-inline-end: var(--m3e-option-padding-end, 0.75rem);\r\n padding-inline-start: var(--m3e-option-padding-start, 0.75rem);\r\n color: var(--m3e-option-color, ${DesignToken.color.onSurface});\r\n flex: none;\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\r\n /** @private */ #labelId = `m3e-optgroup-label-${M3eOptGroupElement.__nextId++}`;\r\n /** @private */ #label?: Element;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<m3e-text-overflow class=\"label\">\r\n <slot name=\"label\" @slotchange=\"${this.#handleLabelSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n <slot></slot>`;\r\n }\r\n\r\n /** @private */\r\n #handleLabelSlotChange(e: Event): void {\r\n const label = (<HTMLSlotElement>e.target).assignedElements({ flatten: true })[0] ?? undefined;\r\n if (label === this.#label) return;\r\n\r\n if (this.#label?.id) {\r\n removeAriaReferencedId(this, \"aria-labelledby\", this.#label.id);\r\n if (this.#label.id === this.#labelId) {\r\n this.#label.id = \"\";\r\n }\r\n }\r\n\r\n this.#label = label;\r\n\r\n if (this.#label) {\r\n this.#label.id = this.#label.id || this.#labelId;\r\n addAriaReferencedId(this, \"aria-labelledby\", this.#label.id);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-optgroup\": M3eOptGroupElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html } from \"lit\";\r\n\r\nimport {\r\n DesignToken,\r\n Role,\r\n customElement,\r\n MutationController,\r\n deleteCustomState,\r\n addCustomState,\r\n setCustomState,\r\n hasAssignedNodes,\r\n registerStyleSheet,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { M3eFloatingPanelElement } from \"@m3e/web/core/anchoring\";\r\n\r\nimport { M3eOptGroupElement } from \"./OptGroupElement\";\r\nimport { M3eOptionElement } from \"./OptionElement\";\r\nimport { property } from \"lit/decorators.js\";\r\nimport { OptionPanelState } from \"./OptionPanelState\";\r\n\r\n/**\r\n * Presents a list of options on a temporary surface.\r\n *\r\n * @description\r\n * The `m3e-option-panel` component renders a scrollable container for displaying selectable options\r\n * as a Material Design 3 menu surface. It provides dynamic positioning and anchoring to trigger elements,\r\n * automatic viewport boundary detection with intelligent repositioning, and smooth enter/exit animations.\r\n *\r\n * @tag m3e-option-panel\r\n *\r\n * @slot - Renders the contents of the list.\r\n *\r\n * @fires beforetoggle - Dispatched before the toggle state changes.\r\n * @fires toggle - Dispatched after the toggle state has changed.\r\n *\r\n * @cssprop --m3e-option-panel-container-shape - Corner radius of the panel container.\r\n * @cssprop --m3e-option-panel-container-min-width - Minimum width of the panel container.\r\n * @cssprop --m3e-option-panel-container-max-width - Maximum width of the panel container.\r\n * @cssprop --m3e-option-panel-container-max-height - Maximum height of the panel container.\r\n * @cssprop --m3e-option-panel-container-padding-block - Vertical padding inside the panel container.\r\n * @cssprop --m3e-option-panel-container-padding-inline - Horizontal padding inside the panel container.\r\n * @cssprop --m3e-option-panel-container-color - Background color of the panel container.\r\n * @cssprop --m3e-option-panel-container-elevation - Box shadow elevation of the panel container.\r\n * @cssprop --m3e-option-panel-gap - Vertical spacing between option items.\r\n * @cssprop --m3e-option-panel-divider-spacing - Vertical spacing around slotted `m3e-divider` elements.\r\n * @cssprop --m3e-option-panel-text-highlight-container-color - Background color used for text highlight matches.\r\n * @cssprop --m3e-option-panel-text-highlight-color - Text color used for text highlight matches.\r\n */\r\n@customElement(\"m3e-option-panel\")\r\nexport class M3eOptionPanelElement extends Role(M3eFloatingPanelElement, \"listbox\") {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-option-panel > m3e-divider {\r\n margin-block: var(--m3e-option-panel-divider-spacing, 0.5rem);\r\n }\r\n m3e-option-panel m3e-option[hidden],\r\n m3e-option-panel m3e-optgroup[hidden] {\r\n display: none;\r\n }\r\n `);\r\n }\r\n\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = [\r\n M3eFloatingPanelElement.styles,\r\n css`\r\n :host {\r\n --m3e-floating-panel-container-shape: var(\r\n --m3e-option-panel-container-shape,\r\n ${DesignToken.shape.corner.large}\r\n );\r\n --m3e-floating-panel-container-min-width: var(--m3e-option-panel-container-min-width, 7rem);\r\n --m3e-floating-panel-container-max-width: var(--m3e-option-panel-container-max-width, 17.5rem);\r\n --m3e-floating-panel-container-max-height: var(--m3e-option-panel-container-max-height, 17.5rem);\r\n --m3e-floating-panel-container-color: var(\r\n --m3e-option-panel-container-color,\r\n ${DesignToken.color.surfaceContainer}\r\n );\r\n --m3e-floating-panel-container-elevation: var(\r\n --m3e-option-panel-container-elevation,\r\n ${DesignToken.elevation.level3}\r\n );\r\n --m3e-floating-panel-container-padding-inline: var(--m3e-option-panel-container-padding-inline, 0.25rem);\r\n --m3e-floating-panel-container-padding-block: var(--m3e-option-panel-container-padding-block, 0.25rem);\r\n }\r\n .base {\r\n row-gap: var(--m3e-option-panel-gap, 0.125rem);\r\n --m3e-text-highlight-container-color: var(\r\n --m3e-option-panel-text-highlight-container-color,\r\n ${DesignToken.color.tertiaryContainer}\r\n );\r\n --m3e-text-highlight-color: var(\r\n --m3e-option-panel-text-highlight-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-focus-ring-outward-offset: 0px;\r\n --m3e-focus-ring-growth-factor: 1.5;\r\n }\r\n .no-data {\r\n display: flex;\r\n align-items: center;\r\n box-sizing: border-box;\r\n min-height: var(--m3e-option-panel-no-data-container-height, 2.75rem);\r\n padding: var(--m3e-option-panel-no-data-container-padding, 0.75rem);\r\n color: var(--m3e-option-panel-no-data-color, ${DesignToken.color.onSurfaceVariant});\r\n font-size: var(--m3e-option-panel-no-data-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-option-panel-no-data-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-option-panel-no-data-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(\r\n --m3e-option-panel-no-data-tracking,\r\n ${DesignToken.typescale.standard.label.large.tracking}\r\n );\r\n }\r\n .loading {\r\n display: flex;\r\n align-items: center;\r\n box-sizing: border-box;\r\n min-height: var(--m3e-option-panel-loading-container-height, 2.75rem);\r\n padding: var(--m3e-option-panel-loading-container-padding, 0.75rem);\r\n color: var(--m3e-option-panel-loading-color, ${DesignToken.color.onSurfaceVariant});\r\n font-size: var(--m3e-option-panel-loading-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-option-panel-loading-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-option-panel-loading-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(\r\n --m3e-option-panel-loading-tracking,\r\n ${DesignToken.typescale.standard.label.large.tracking}\r\n );\r\n }\r\n :host(:is(:state(--no-data), :--no-data)) slot:not([name]),\r\n :host(:is(:state(--loading), :--loading)) slot:not([name]),\r\n :host(:is(:state(--loading), :--loading)) .no-data,\r\n :host(:not(:is(:state(--no-data), :--no-data))) .no-data,\r\n :host(:not(:is(:state(--with-no-data), :--with-no-data))) .no-data,\r\n :host(:not(:is(:state(--loading), :--loading))) .loading,\r\n :host(:not(:is(:state(--with-loading), :--with-loading))) .loading {\r\n display: none;\r\n }\r\n :host(:is(:state(--no-data), :--no-data)) .base,\r\n :host(:is(:state(--loading), :--loading)) .base {\r\n overflow-y: hidden;\r\n }\r\n :host(:is(:state(--with-loading-indicator), :--with-loading-indicator)) .loading {\r\n padding: 0;\r\n justify-content: center;\r\n }\r\n `,\r\n ];\r\n\r\n constructor() {\r\n super();\r\n\r\n new MutationController(this, {\r\n config: {\r\n childList: true,\r\n subtree: true,\r\n },\r\n callback: () => this.#handleMutation(),\r\n });\r\n }\r\n\r\n /**\r\n * The state for which to present content.\r\n * @default \"content\"\r\n */\r\n @property({ reflect: true }) state: OptionPanelState = \"content\";\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.#handleMutation();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\">\r\n <slot></slot>\r\n <div class=\"no-data\" aria-hidden=\"true\">\r\n <slot name=\"no-data\" @slotchange=\"${this.#handleNoDataSlotChange}\"></slot>\r\n </div>\r\n <div class=\"loading\" aria-hidden=\"true\">\r\n <slot name=\"loading\" @slotchange=\"${this.#handleLoadingSlotChange}\"> </slot>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleNoDataSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-no-data\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleLoadingSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-loading\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n setCustomState(\r\n this,\r\n \"--with-loading-indicator\",\r\n this.querySelector(\"m3e-loading-indicator[slot='loading'], m3e-circular-progress-indicator[slot='loading']\") !==\r\n null,\r\n );\r\n }\r\n\r\n /** @private */\r\n #handleMutation(): void {\r\n const options = this.querySelectorAll(\"m3e-option\");\r\n let first = false;\r\n let last: M3eOptionElement | undefined;\r\n\r\n for (let i = 0; i < options.length; i++) {\r\n const option = options[i];\r\n if (option.hidden === true) {\r\n deleteCustomState(option, \"--first\");\r\n deleteCustomState(option, \"--last\");\r\n } else if (!first && !(option.parentElement instanceof M3eOptGroupElement)) {\r\n addCustomState(option, \"--first\");\r\n first = true;\r\n addCustomState(option, \"--last\");\r\n last = option;\r\n } else {\r\n deleteCustomState(option, \"--first\");\r\n if (last) {\r\n deleteCustomState(last, \"--last\");\r\n }\r\n addCustomState(option, \"--last\");\r\n last = option;\r\n }\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-option-panel\": M3eOptionPanelElement;\r\n }\r\n}\r\n"],"names":["M3eOptionElement","Selected","Disabled","AttachInternals","Role","LitElement","constructor","_M3eOptionElement_value","set","_M3eOptionElement_textContent","term","highlightMode","disableHighlight","value","__classPrivateFieldGet","__classPrivateFieldSet","label","WeakMap","_M3eOptionElement_instances","WeakSet","typeaheadLabel","isEmpty","connectedCallback","focusRing","stateLayer","_ripple","forEach","x","attach","firstUpdated","_changedProperties","update","changedProperties","has","selected","panel","closest","ariaMultiSelectable","hasAttribute","querySelectorAll","render","html","disabled","_M3eOptionElement_handleSlotChange","e","getTextContent","target","setCustomState","requestUpdate","styles","css","DesignToken","density","calc","color","onSurface","onTertiaryContainer","tertiaryContainer","shape","corner","extraSmall","unsafeCSS","motion","spring","fastEffects","medium","typescale","standard","large","fontSize","fontWeight","lineHeight","tracking","__decorate","query","prototype","property","attribute","type","Boolean","customElement","M3eOptGroupElement","M3eOptGroupElement_1","_M3eOptGroupElement_labelId","__nextId","_M3eOptGroupElement_label","_M3eOptGroupElement_instances","_M3eOptGroupElement_handleLabelSlotChange","assignedElements","flatten","undefined","id","removeAriaReferencedId","addAriaReferencedId","M3eOptionPanelElement","M3eFloatingPanelElement","state","MutationController","config","childList","subtree","callback","_M3eOptionPanelElement_instances","_M3eOptionPanelElement_handleMutation","call","_M3eOptionPanelElement_handleNoDataSlotChange","_M3eOptionPanelElement_handleLoadingSlotChange","hasAssignedNodes","querySelector","options","first","last","i","length","option","hidden","deleteCustomState","parentElement","addCustomState","registerStyleSheet","surfaceContainer","elevation","level3","onSurfaceVariant","reflect"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CG;AAEI,IAAMA,gBAAgB,GAAtB,MAAMA,gBAAiB,SAAQC,QAAQ,CAACC,QAAQ,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AAA9FC,EAAAA,WAAAA,GAAA;;;AAkIL;AAAgBC,IAAAA,uBAAA,CAAAC,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAChB;AAAgBC,IAAAA,6BAAA,CAAAD,GAAA,CAAA,IAAA,EAAe,EAAE,CAAA;AAcjC;;;AAGG;IACS,IAAA,CAAAE,IAAI,GAAG,EAAE;AAErB;;;AAGG;IACwC,IAAA,CAAAC,aAAa,GAAsB,UAAU;AAExF;;;AAGG;IAC0D,IAAA,CAAAC,gBAAgB,GAAG,KAAK;AA4EvF,EAAA;AApGE;EACY,IAAIC,KAAKA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C,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACG,UAAU,CAAA,8DAAA,EAIrDpB,WAAW,CAACe,SAAS,CAACC,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACI,QAAQ,CAAA,sQAAA,EASRrB,WAAW,CAACG,KAAK,CAACqE,gBAAgB,CAAA,wDAAA,EAC1BxE,WAAW,CAACe,SAAS,CAACC,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACC,QAAQ,CAAA,6DAAA,EAGtGlB,WAAW,CAACe,SAAS,CAACC,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACE,UAAU,CAAA,8DAAA,EAIrDnB,WAAW,CAACe,SAAS,CAACC,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACG,UAAU,CAAA,8DAAA,EAIrDpB,WAAW,CAACe,SAAS,CAACC,QAAQ,CAACnD,KAAK,CAACoD,KAAK,CAACI,QAAQ,orBAoB1D,CA9FmB;AAiHOC,UAAA,CAAA,CAA5BG,QAAQ,CAAC;AAAEgD,EAAAA,OAAO,EAAE;CAAM,CAAC,CAAqC,EAAA9B,qBAAA,CAAAnB,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AA/HtDmB,qBAAqB,GAAArB,UAAA,CAAA,CADjCO,aAAa,CAAC,kBAAkB,CAAC,CACrB,EAAAc,qBAAqB,CA8LjC;;;;"}
|
|
1
|
+
{"version":3,"file":"option.js","sources":["../../src/option/OptionElement.ts","../../src/option/OptGroupElement.ts","../../src/option/OptionPanelElement.ts"],"sourcesContent":["import { css, CSSResultGroup, html, LitElement, PropertyValues, unsafeCSS } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport {\r\n AttachInternals,\r\n customElement,\r\n DesignToken,\r\n Disabled,\r\n getTextContent,\r\n M3eFocusRingElement,\r\n M3eRippleElement,\r\n M3eStateLayerElement,\r\n Role,\r\n Selected,\r\n setCustomState,\r\n TextHighlightMode,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { typeaheadLabel } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * An option that can be selected.\r\n *\r\n * @description\r\n * The `m3e-option` component represents an individual selectable item within an option list,\r\n * adhering to Material Design 3 specifications. It provides visual feedback through state layers and ripple effects,\r\n * supports single and multiple selection modes, and includes comprehensive accessibility features including\r\n * keyboard navigation and focus management. The component automatically manages its visual appearance based on\r\n * selection and disabled states, with configurable styling for interactive and non-interactive variants.\r\n *\r\n * @tag m3e-option\r\n *\r\n * @slot - Renders the label of the option.\r\n *\r\n * @attr disabled - Whether the element is disabled.\r\n * @attr disable-highlight - Whether text highlighting is disabled.\r\n * @attr highlight-mode - The mode in which to highlight a term.\r\n * @attr selected - Whether the element is selected.\r\n * @attr term - The search term to highlight.\r\n * @attr value - A string representing the value of the option.\r\n *\r\n * @cssprop --m3e-option-container-height - The height of the option container.\r\n * @cssprop --m3e-option-color - The text color of the option.\r\n * @cssprop --m3e-option-container-hover-color - The color for the hover state layer.\r\n * @cssprop --m3e-option-container-focus-color - The color for the focus state layer.\r\n * @cssprop --m3e-option-ripple-color - The color of the ripple effect.\r\n * @cssprop --m3e-option-selected-color - The text color when the option is selected.\r\n * @cssprop --m3e-option-selected-container-color - The background color when the option is selected.\r\n * @cssprop --m3e-option-selected-container-hover-color - The hover color for the selected state layer.\r\n * @cssprop --m3e-option-selected-container-focus-color - The focus color for the selected state layer.\r\n * @cssprop --m3e-option-selected-ripple-color - The ripple color when the option is selected.\r\n * @cssprop --m3e-option-disabled-color - The text color when the option is disabled.\r\n * @cssprop --m3e-option-disabled-opacity - The opacity level applied to the disabled text color.\r\n * @cssprop --m3e-option-icon-label-space - The spacing between the icon and label.\r\n * @cssprop --m3e-option-padding-start - The left padding of the option content.\r\n * @cssprop --m3e-option-padding-end - The right padding of the option content.\r\n * @cssprop --m3e-option-label-text-font-size - The font size of the option label.\r\n * @cssprop --m3e-option-label-text-font-weight - The font weight of the option label.\r\n * @cssprop --m3e-option-label-text-line-height - The line height of the option label.\r\n * @cssprop --m3e-option-label-text-tracking - The letter spacing of the option label.\r\n * @cssprop --m3e-option-focus-ring-shape - The corner radius of the focus ring.\r\n * @cssprop --m3e-option-icon-size - The size of the option icons.\r\n * @cssprop --m3e-option-shape - Base shape of the option.\r\n * @cssprop --m3e-option-selected-shape - Shape used for a selected option.\r\n * @cssprop --m3e-option-first-child-shape - Shape for the first option in a list.\r\n * @cssprop --m3e-option-last-child-shape - Shape for the last option in a list.\r\n */\r\n@customElement(\"m3e-option\")\r\nexport class M3eOptionElement extends Selected(Disabled(AttachInternals(Role(LitElement, \"option\")))) {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n outline: none;\r\n user-select: none;\r\n flex: none;\r\n height: calc(var(--m3e-option-container-height, 2.75rem) + ${DesignToken.density.calc(-3)});\r\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\r\n }\r\n :host(:not([aria-disabled=\"true\"])) .base {\r\n color: var(--m3e-option-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-hover-color: var(--m3e-option-container-hover-color, ${DesignToken.color.onSurface});\r\n --m3e-state-layer-focus-color: var(--m3e-option-container-focus-color, ${DesignToken.color.onSurface});\r\n --m3e-ripple-color: var(--m3e-option-ripple-color, ${DesignToken.color.onSurface});\r\n }\r\n :host(:not([aria-disabled=\"true\"]):not(:is(:state(--empty), :--empty))[selected]) .base {\r\n color: var(--m3e-option-selected-color, ${DesignToken.color.onTertiaryContainer});\r\n background-color: var(--m3e-option-selected-container-color, ${DesignToken.color.tertiaryContainer});\r\n --m3e-state-layer-hover-color: var(\r\n --m3e-option-selected-container-hover-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-state-layer-focus-color: var(\r\n --m3e-option-selected-container-focus-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-ripple-color: var(--m3e-option-selected-ripple-color, ${DesignToken.color.onTertiaryContainer});\r\n }\r\n :host(:not([aria-disabled=\"true\"])) {\r\n cursor: pointer;\r\n }\r\n :host([aria-disabled=\"true\"]) .base {\r\n color: color-mix(\r\n in srgb,\r\n var(--m3e-option-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-option-disabled-opacity, 38%),\r\n transparent\r\n );\r\n }\r\n .base {\r\n box-sizing: border-box;\r\n vertical-align: middle;\r\n display: inline-flex;\r\n align-items: center;\r\n position: relative;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: var(--m3e-option-shape, ${DesignToken.shape.corner.extraSmall});\r\n transition: ${unsafeCSS(`border-radius ${DesignToken.motion.spring.fastEffects}`)};\r\n }\r\n :host([selected]:not(:is(:state(--first), :--first))) .base {\r\n border-top-left-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n border-top-right-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host([selected]:not(:is(:state(--last), :--last))) .base {\r\n border-bottom-left-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n border-bottom-right-radius: var(--m3e-option-selected-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host(:is(:state(--first), :--first)) .base {\r\n border-top-left-radius: var(--m3e-option-first-child-shape, ${DesignToken.shape.corner.medium});\r\n border-top-right-radius: var(--m3e-option-first-child-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n :host(:is(:state(--last), :--last)) .base {\r\n border-bottom-left-radius: var(--m3e-option-last-child-shape, ${DesignToken.shape.corner.medium});\r\n border-bottom-right-radius: var(--m3e-option-last-child-shape, ${DesignToken.shape.corner.medium});\r\n }\r\n .touch {\r\n position: absolute;\r\n height: calc(\r\n var(--m3e-option-container-height, 2.75rem) + calc(var(--m3e-option-panel-gap, 0.125rem) * 2) +\r\n ${DesignToken.density.calc(-3)}\r\n );\r\n left: 0;\r\n right: 0;\r\n }\r\n .wrapper {\r\n flex: 1 1 auto;\r\n display: inline-flex;\r\n align-items: center;\r\n width: 100%;\r\n overflow: hidden;\r\n column-gap: var(--m3e-option-icon-label-space, 0.5rem);\r\n padding-inline-start: var(--_option-padding-start, var(--m3e-option-padding-start, 0.75rem));\r\n padding-inline-end: var(--m3e-option-padding-end, 0.75rem);\r\n font-size: var(--m3e-option-label-text-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(--m3e-option-label-text-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});\r\n line-height: var(--m3e-option-label-text-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});\r\n letter-spacing: var(--m3e-option-label-text-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n }\r\n .focus-ring {\r\n border-radius: var(--m3e-option-focus-ring-shape, inherit);\r\n }\r\n .icon {\r\n margin-inline-start: calc(0px - var(--m3e-option-icon-label-space, 0.5rem));\r\n transition: ${unsafeCSS(\r\n `margin-inline-start ${DesignToken.motion.spring.fastEffects}, width ${DesignToken.motion.spring.fastEffects}`,\r\n )};\r\n }\r\n :host([selected]) .icon {\r\n margin-inline-start: 0;\r\n width: var(--m3e-option-icon-size, 1.25rem);\r\n }\r\n .icon {\r\n flex: none;\r\n width: 0px;\r\n font-size: var(--m3e-option-icon-size, 1.25rem);\r\n }\r\n :host(:is(:state(--empty), :--empty)) .icon,\r\n :host(:is(:state(--hide-selection-indicator), :--hide-selection-indicator)) .icon,\r\n :host(:not([selected])) .check {\r\n display: none;\r\n }\r\n @media (forced-colors: active) {\r\n .base {\r\n background-color: Menu;\r\n color: MenuText;\r\n }\r\n :host([aria-disabled=\"true\"]) .base {\r\n color: GrayText;\r\n }\r\n }\r\n @media (prefers-reduced-motion) {\r\n .icon,\r\n .base {\r\n transition: none;\r\n }\r\n }\r\n `;\r\n\r\n /** @private */ #value?: string;\r\n /** @private */ #textContent = \"\";\r\n\r\n /** @internal */ @query(\".focus-ring\") readonly focusRing?: M3eFocusRingElement;\r\n /** @internal */ @query(\".state-layer\") readonly stateLayer?: M3eStateLayerElement;\r\n /** @private */ @query(\".ripple\") private readonly _ripple?: M3eRippleElement;\r\n\r\n /** A string representing the value of the option. */\r\n @property() get value() {\r\n return this.#value ?? this.#textContent;\r\n }\r\n set value(value: string) {\r\n this.#value = value;\r\n }\r\n\r\n /**\r\n * The search term to highlight.\r\n * @default \"\"\r\n */\r\n @property() term = \"\";\r\n\r\n /**\r\n * The mode in which to highlight a term.\r\n * @default \"contains\"\r\n */\r\n @property({ attribute: \"highlight-mode\" }) highlightMode: TextHighlightMode = \"contains\";\r\n\r\n /**\r\n * Whether text highlighting is disabled.\r\n * @default false\r\n */\r\n @property({ attribute: \"disable-highlight\", type: Boolean }) disableHighlight = false;\r\n\r\n /** The textual label of the option. */\r\n get label() {\r\n return this.#textContent;\r\n }\r\n\r\n /** @internal */\r\n [typeaheadLabel](): string {\r\n return this.label;\r\n }\r\n\r\n /** Whether the option represents an empty option. */\r\n get isEmpty() {\r\n return this.value === \"\";\r\n }\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n [this.focusRing, this.stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override firstUpdated(_changedProperties: PropertyValues<this>): void {\r\n super.firstUpdated(_changedProperties);\r\n [this.focusRing, this.stateLayer, this._ripple].forEach((x) => x?.attach(this));\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override update(changedProperties: PropertyValues<this>): void {\r\n super.update(changedProperties);\r\n\r\n if (changedProperties.has(\"selected\") && this.selected) {\r\n const panel = this.closest(\"[role='listbox']\") ?? this.closest(\"m3e-autocomplete\") ?? this.closest(\"m3e-select\");\r\n if (panel && panel.ariaMultiSelectable !== \"true\" && !panel.hasAttribute(\"multi\")) {\r\n panel.querySelectorAll(\"m3e-option\").forEach((x) => {\r\n if (x !== this && x.selected) {\r\n x.selected = false;\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (changedProperties.has(\"selected\") || changedProperties.has(\"disabled\")) {\r\n this[\"dispatchEvent\"](new CustomEvent(\"state-change\", { bubbles: true }));\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n override render(): unknown {\r\n return html`<div class=\"base\">\r\n <m3e-state-layer class=\"state-layer\" ?disabled=\"${this.disabled}\"></m3e-state-layer>\r\n <m3e-focus-ring class=\"focus-ring\" ?disabled=\"${this.disabled}\"></m3e-focus-ring>\r\n <m3e-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></m3e-ripple>\r\n <div class=\"touch\" aria-hidden=\"true\"></div>\r\n <div class=\"wrapper\">\r\n <div class=\"icon\" aria-hidden=\"true\">\r\n <svg class=\"check\" viewBox=\"0 -960 960 960\">\r\n <path fill=\"currentColor\" d=\"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z\" />\r\n </svg>\r\n </div>\r\n <m3e-text-overflow class=\"label\">\r\n <m3e-text-highlight term=\"${this.term}\" mode=\"${this.highlightMode}\" ?disabled=\"${this.disableHighlight}\">\r\n <slot @slotchange=\"${this.#handleSlotChange}\"></slot>\r\n </m3e-text-highlight>\r\n </m3e-text-overflow>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleSlotChange(e: Event): void {\r\n this.#textContent = getTextContent(<HTMLSlotElement>e.target);\r\n setCustomState(this, \"--empty\", this.isEmpty);\r\n\r\n if (this.selected) {\r\n this.closest<LitElement>(\"m3e-select\")?.requestUpdate?.();\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-option\": M3eOptionElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement } from \"lit\";\r\n\r\nimport { customElement, DesignToken, Role } from \"@m3e/web/core\";\r\nimport { addAriaReferencedId, removeAriaReferencedId } from \"@m3e/web/core/a11y\";\r\n\r\n/**\r\n * Groups options under a subheading.\r\n *\r\n * @description\r\n * The `m3e-optgroup` component organizes related options within an option list,\r\n * providing visual and semantic grouping through a customizable label. It manages `aria-labelledby`\r\n * associations automatically and applies Material Design 3 typography and spacing conventions to\r\n * the group label. The component maintains proper semantic structure by utilizing the ARIA `group` role,\r\n * ensuring that assistive technologies correctly interpret the hierarchical relationship between the label\r\n * and contained options.\r\n *\r\n * @tag m3e-optgroup\r\n *\r\n * @slot - Renders the options of the group.\r\n * @slot label - Renders the label of the group.\r\n *\r\n * @cssprop --m3e-option-height - The height of the group label container.\r\n * @cssprop --m3e-option-font-size - The font size of the group label.\r\n * @cssprop --m3e-option-font-weight - The font weight of the group label.\r\n * @cssprop --m3e-option-line-height - The line height of the group label.\r\n * @cssprop --m3e-option-tracking - The letter spacing of the group label.\r\n * @cssprop --m3e-option-padding-end - The right padding of the label.\r\n * @cssprop --m3e-option-padding-start - The left padding of the label.\r\n * @cssprop --m3e-option-color - The text color of the group label.\r\n */\r\n@customElement(\"m3e-optgroup\")\r\nexport class M3eOptGroupElement extends Role(LitElement, \"group\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: block;\r\n --_option-padding-start: calc(var(--m3e-option-padding-start, 0.75rem) * 2);\r\n }\r\n .label {\r\n height: var(--m3e-option-height, 3rem);\r\n font-size: var(--m3e-option-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(--m3e-option-font-weight, ${DesignToken.typescale.standard.label.large.fontWeight});\r\n line-height: var(--m3e-option-line-height, ${DesignToken.typescale.standard.label.large.lineHeight});\r\n letter-spacing: var(--m3e-option-tracking, ${DesignToken.typescale.standard.label.large.tracking});\r\n padding-inline-end: var(--m3e-option-padding-end, 0.75rem);\r\n padding-inline-start: var(--m3e-option-padding-start, 0.75rem);\r\n color: var(--m3e-option-color, ${DesignToken.color.onSurface});\r\n flex: none;\r\n }\r\n `;\r\n\r\n /** @private */ private static __nextId = 0;\r\n /** @private */ #labelId = `m3e-optgroup-label-${M3eOptGroupElement.__nextId++}`;\r\n /** @private */ #label?: Element;\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<m3e-text-overflow class=\"label\">\r\n <slot name=\"label\" @slotchange=\"${this.#handleLabelSlotChange}\"></slot>\r\n </m3e-text-overflow>\r\n <slot></slot>`;\r\n }\r\n\r\n /** @private */\r\n #handleLabelSlotChange(e: Event): void {\r\n const label = (<HTMLSlotElement>e.target).assignedElements({ flatten: true })[0] ?? undefined;\r\n if (label === this.#label) return;\r\n\r\n if (this.#label?.id) {\r\n removeAriaReferencedId(this, \"aria-labelledby\", this.#label.id);\r\n if (this.#label.id === this.#labelId) {\r\n this.#label.id = \"\";\r\n }\r\n }\r\n\r\n this.#label = label;\r\n\r\n if (this.#label) {\r\n this.#label.id = this.#label.id || this.#labelId;\r\n addAriaReferencedId(this, \"aria-labelledby\", this.#label.id);\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-optgroup\": M3eOptGroupElement;\r\n }\r\n}\r\n","import { css, CSSResultGroup, html } from \"lit\";\r\n\r\nimport {\r\n DesignToken,\r\n Role,\r\n customElement,\r\n MutationController,\r\n deleteCustomState,\r\n addCustomState,\r\n setCustomState,\r\n hasAssignedNodes,\r\n registerStyleSheet,\r\n} from \"@m3e/web/core\";\r\n\r\nimport { M3eFloatingPanelElement } from \"@m3e/web/core/anchoring\";\r\n\r\nimport { M3eOptGroupElement } from \"./OptGroupElement\";\r\nimport { M3eOptionElement } from \"./OptionElement\";\r\nimport { property } from \"lit/decorators.js\";\r\nimport { OptionPanelState } from \"./OptionPanelState\";\r\n\r\n/**\r\n * Presents a list of options on a temporary surface.\r\n *\r\n * @description\r\n * The `m3e-option-panel` component renders a scrollable container for displaying selectable options\r\n * as a Material Design 3 menu surface. It provides dynamic positioning and anchoring to trigger elements,\r\n * automatic viewport boundary detection with intelligent repositioning, and smooth enter/exit animations.\r\n *\r\n * @tag m3e-option-panel\r\n *\r\n * @slot - Renders the contents of the list.\r\n *\r\n * @fires beforetoggle - Dispatched before the toggle state changes.\r\n * @fires toggle - Dispatched after the toggle state has changed.\r\n *\r\n * @cssprop --m3e-option-panel-container-shape - Corner radius of the panel container.\r\n * @cssprop --m3e-option-panel-container-min-width - Minimum width of the panel container.\r\n * @cssprop --m3e-option-panel-container-max-width - Maximum width of the panel container.\r\n * @cssprop --m3e-option-panel-container-max-height - Maximum height of the panel container.\r\n * @cssprop --m3e-option-panel-container-padding-block - Vertical padding inside the panel container.\r\n * @cssprop --m3e-option-panel-container-padding-inline - Horizontal padding inside the panel container.\r\n * @cssprop --m3e-option-panel-container-color - Background color of the panel container.\r\n * @cssprop --m3e-option-panel-container-elevation - Box shadow elevation of the panel container.\r\n * @cssprop --m3e-option-panel-gap - Vertical spacing between option items.\r\n * @cssprop --m3e-option-panel-divider-spacing - Vertical spacing around slotted `m3e-divider` elements.\r\n * @cssprop --m3e-option-panel-text-highlight-container-color - Background color used for text highlight matches.\r\n * @cssprop --m3e-option-panel-text-highlight-color - Text color used for text highlight matches.\r\n */\r\n@customElement(\"m3e-option-panel\")\r\nexport class M3eOptionPanelElement extends Role(M3eFloatingPanelElement, \"listbox\") {\r\n static {\r\n registerStyleSheet(css`\r\n m3e-option-panel > m3e-divider {\r\n margin-block: var(--m3e-option-panel-divider-spacing, 0.5rem);\r\n }\r\n m3e-option-panel m3e-option[hidden],\r\n m3e-option-panel m3e-optgroup[hidden] {\r\n display: none;\r\n }\r\n `);\r\n }\r\n\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = [\r\n M3eFloatingPanelElement.styles,\r\n css`\r\n :host {\r\n --m3e-floating-panel-container-shape: var(\r\n --m3e-option-panel-container-shape,\r\n ${DesignToken.shape.corner.large}\r\n );\r\n --m3e-floating-panel-container-min-width: var(--m3e-option-panel-container-min-width, 7rem);\r\n --m3e-floating-panel-container-max-width: var(--m3e-option-panel-container-max-width, 17.5rem);\r\n --m3e-floating-panel-container-max-height: var(--m3e-option-panel-container-max-height, 17.5rem);\r\n --m3e-floating-panel-container-color: var(\r\n --m3e-option-panel-container-color,\r\n ${DesignToken.color.surfaceContainer}\r\n );\r\n --m3e-floating-panel-container-elevation: var(\r\n --m3e-option-panel-container-elevation,\r\n ${DesignToken.elevation.level3}\r\n );\r\n --m3e-floating-panel-container-padding-inline: var(--m3e-option-panel-container-padding-inline, 0.25rem);\r\n --m3e-floating-panel-container-padding-block: var(--m3e-option-panel-container-padding-block, 0.25rem);\r\n }\r\n .base {\r\n row-gap: var(--m3e-option-panel-gap, 0.125rem);\r\n --m3e-text-highlight-container-color: var(\r\n --m3e-option-panel-text-highlight-container-color,\r\n ${DesignToken.color.tertiaryContainer}\r\n );\r\n --m3e-text-highlight-color: var(\r\n --m3e-option-panel-text-highlight-color,\r\n ${DesignToken.color.onTertiaryContainer}\r\n );\r\n --m3e-focus-ring-outward-offset: 0px;\r\n --m3e-focus-ring-growth-factor: 1.5;\r\n }\r\n .no-data {\r\n display: flex;\r\n align-items: center;\r\n box-sizing: border-box;\r\n min-height: var(--m3e-option-panel-no-data-container-height, 2.75rem);\r\n padding: var(--m3e-option-panel-no-data-container-padding, 0.75rem);\r\n color: var(--m3e-option-panel-no-data-color, ${DesignToken.color.onSurfaceVariant});\r\n font-size: var(--m3e-option-panel-no-data-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-option-panel-no-data-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-option-panel-no-data-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(\r\n --m3e-option-panel-no-data-tracking,\r\n ${DesignToken.typescale.standard.label.large.tracking}\r\n );\r\n }\r\n .loading {\r\n display: flex;\r\n align-items: center;\r\n box-sizing: border-box;\r\n min-height: var(--m3e-option-panel-loading-container-height, 2.75rem);\r\n padding: var(--m3e-option-panel-loading-container-padding, 0.75rem);\r\n color: var(--m3e-option-panel-loading-color, ${DesignToken.color.onSurfaceVariant});\r\n font-size: var(--m3e-option-panel-loading-font-size, ${DesignToken.typescale.standard.label.large.fontSize});\r\n font-weight: var(\r\n --m3e-option-panel-loading-font-weight,\r\n ${DesignToken.typescale.standard.label.large.fontWeight}\r\n );\r\n line-height: var(\r\n --m3e-option-panel-loading-line-height,\r\n ${DesignToken.typescale.standard.label.large.lineHeight}\r\n );\r\n letter-spacing: var(\r\n --m3e-option-panel-loading-tracking,\r\n ${DesignToken.typescale.standard.label.large.tracking}\r\n );\r\n }\r\n :host(:is(:state(--no-data), :--no-data)) slot:not([name]),\r\n :host(:is(:state(--loading), :--loading)) slot:not([name]),\r\n :host(:is(:state(--loading), :--loading)) .no-data,\r\n :host(:not(:is(:state(--no-data), :--no-data))) .no-data,\r\n :host(:not(:is(:state(--with-no-data), :--with-no-data))) .no-data,\r\n :host(:not(:is(:state(--loading), :--loading))) .loading,\r\n :host(:not(:is(:state(--with-loading), :--with-loading))) .loading {\r\n display: none;\r\n }\r\n :host(:is(:state(--no-data), :--no-data)) .base,\r\n :host(:is(:state(--loading), :--loading)) .base {\r\n overflow-y: hidden;\r\n }\r\n :host(:is(:state(--with-loading-indicator), :--with-loading-indicator)) .loading {\r\n padding: 0;\r\n justify-content: center;\r\n }\r\n `,\r\n ];\r\n\r\n constructor() {\r\n super();\r\n\r\n new MutationController(this, {\r\n config: {\r\n childList: true,\r\n subtree: true,\r\n },\r\n callback: () => this.#handleMutation(),\r\n });\r\n }\r\n\r\n /**\r\n * The state for which to present content.\r\n * @default \"content\"\r\n */\r\n @property({ reflect: true }) state: OptionPanelState = \"content\";\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n super.connectedCallback();\r\n this.#handleMutation();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return html`<div class=\"base\" @state-change=\"${this.#handleOptionStateChange}\">\r\n <slot></slot>\r\n <div class=\"no-data\" aria-hidden=\"true\">\r\n <slot name=\"no-data\" @slotchange=\"${this.#handleNoDataSlotChange}\"></slot>\r\n </div>\r\n <div class=\"loading\" aria-hidden=\"true\">\r\n <slot name=\"loading\" @slotchange=\"${this.#handleLoadingSlotChange}\"> </slot>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n /** @private */\r\n #handleOptionStateChange(e: Event): void {\r\n if (e.target instanceof M3eOptionElement) {\r\n e.stopImmediatePropagation();\r\n }\r\n }\r\n\r\n /** @private */\r\n #handleNoDataSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-no-data\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n }\r\n\r\n /** @private */\r\n #handleLoadingSlotChange(e: Event): void {\r\n setCustomState(this, \"--with-loading\", hasAssignedNodes(<HTMLSlotElement>e.target));\r\n setCustomState(\r\n this,\r\n \"--with-loading-indicator\",\r\n this.querySelector(\"m3e-loading-indicator[slot='loading'], m3e-circular-progress-indicator[slot='loading']\") !==\r\n null,\r\n );\r\n }\r\n\r\n /** @private */\r\n #handleMutation(): void {\r\n const options = this.querySelectorAll(\"m3e-option\");\r\n let first = false;\r\n let last: M3eOptionElement | undefined;\r\n\r\n for (let i = 0; i < options.length; i++) {\r\n const option = options[i];\r\n if (option.hidden === true) {\r\n deleteCustomState(option, \"--first\");\r\n deleteCustomState(option, \"--last\");\r\n } else if (!first && !(option.parentElement instanceof M3eOptGroupElement)) {\r\n addCustomState(option, \"--first\");\r\n first = true;\r\n addCustomState(option, \"--last\");\r\n last = option;\r\n } else {\r\n deleteCustomState(option, \"--first\");\r\n if (last) {\r\n deleteCustomState(last, \"--last\");\r\n }\r\n addCustomState(option, \"--last\");\r\n last = option;\r\n }\r\n }\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-option-panel\": M3eOptionPanelElement;\r\n }\r\n}\r\n"],"names":["M3eOptionElement","Selected","Disabled","AttachInternals","Role","LitElement","constructor","_M3eOptionElement_value","set","_M3eOptionElement_textContent","term","highlightMode","disableHighlight","value","__classPrivateFieldGet","__classPrivateFieldSet","label","WeakMap","_M3eOptionElement_instances","WeakSet","typeaheadLabel","isEmpty","connectedCallback","focusRing","stateLayer","_ripple","forEach","x","attach","firstUpdated","_changedProperties","update","changedProperties","has","selected","panel","closest","ariaMultiSelectable","hasAttribute","querySelectorAll","CustomEvent","bubbles","render","html","disabled","_M3eOptionElement_handleSlotChange","e","getTextContent","target","setCustomState","requestUpdate","styles","css","DesignToken","density","calc","color","onSurface","onTertiaryContainer","tertiaryContainer","shape","corner","extraSmall","unsafeCSS","motion","spring","fastEffects","medium","typescale","standard","large","fontSize","fontWeight","lineHeight","tracking","__decorate","query","prototype","property","attribute","type","Boolean","customElement","M3eOptGroupElement","M3eOptGroupElement_1","_M3eOptGroupElement_labelId","__nextId","_M3eOptGroupElement_label","_M3eOptGroupElement_instances","_M3eOptGroupElement_handleLabelSlotChange","assignedElements","flatten","undefined","id","removeAriaReferencedId","addAriaReferencedId","M3eOptionPanelElement","M3eFloatingPanelElement","state","MutationController","config","childList","subtree","callback","_M3eOptionPanelElement_instances","_M3eOptionPanelElement_handleMutation","call","_M3eOptionPanelElement_handleOptionStateChange","_M3eOptionPanelElement_handleNoDataSlotChange","_M3eOptionPanelElement_handleLoadingSlotChange","stopImmediatePropagation","hasAssignedNodes","querySelector","options","first","last","i","length","option","hidden","deleteCustomState","parentElement","addCustomState","registerStyleSheet","surfaceContainer","elevation","level3","onSurfaceVariant","reflect"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CG;AAEI,IAAMA,gBAAgB,GAAtB,MAAMA,gBAAiB,SAAQC,QAAQ,CAACC,QAAQ,CAACC,eAAe,CAACC,IAAI,CAACC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;AAA9FC,EAAAA,WAAAA,GAAA;;;AAkIL;AAAgBC,IAAAA,uBAAA,CAAAC,GAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AAChB;AAAgBC,IAAAA,6BAAA,CAAAD,GAAA,CAAA,IAAA,EAAe,EAAE,CAAA;AAcjC;;;AAGG;IACS,IAAA,CAAAE,IAAI,GA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