@m3e/web 2.5.12 → 2.5.13

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.
Files changed (79) hide show
  1. package/dist/all.js +20442 -16034
  2. package/dist/all.js.map +1 -1
  3. package/dist/all.min.js +174 -62
  4. package/dist/all.min.js.map +1 -1
  5. package/dist/calendar.js +45 -9
  6. package/dist/calendar.js.map +1 -1
  7. package/dist/calendar.min.js +5 -5
  8. package/dist/calendar.min.js.map +1 -1
  9. package/dist/core-anchoring.js +19 -16
  10. package/dist/core-anchoring.js.map +1 -1
  11. package/dist/core-anchoring.min.js +1 -1
  12. package/dist/core-anchoring.min.js.map +1 -1
  13. package/dist/core.js +95 -82
  14. package/dist/core.js.map +1 -1
  15. package/dist/core.min.js +1 -1
  16. package/dist/core.min.js.map +1 -1
  17. package/dist/css-custom-data.json +50 -50
  18. package/dist/custom-elements.json +1209 -583
  19. package/dist/datepicker.js +53 -27
  20. package/dist/datepicker.js.map +1 -1
  21. package/dist/datepicker.min.js +1 -1
  22. package/dist/datepicker.min.js.map +1 -1
  23. package/dist/fab-menu.js +115 -113
  24. package/dist/fab-menu.js.map +1 -1
  25. package/dist/fab-menu.min.js +1 -1
  26. package/dist/fab-menu.min.js.map +1 -1
  27. package/dist/form-field.js +9 -6
  28. package/dist/form-field.js.map +1 -1
  29. package/dist/form-field.min.js +1 -1
  30. package/dist/form-field.min.js.map +1 -1
  31. package/dist/html-custom-data.json +29 -14
  32. package/dist/icon.js +1 -1
  33. package/dist/icon.js.map +1 -1
  34. package/dist/icon.min.js +1 -1
  35. package/dist/icon.min.js.map +1 -1
  36. package/dist/menu.js +26 -19
  37. package/dist/menu.js.map +1 -1
  38. package/dist/menu.min.js +1 -1
  39. package/dist/menu.min.js.map +1 -1
  40. package/dist/src/calendar/CalendarElement.d.ts +2 -0
  41. package/dist/src/calendar/CalendarElement.d.ts.map +1 -1
  42. package/dist/src/calendar/CalendarViewElementBase.d.ts +2 -0
  43. package/dist/src/calendar/CalendarViewElementBase.d.ts.map +1 -1
  44. package/dist/src/calendar/MonthViewElement.d.ts +1 -0
  45. package/dist/src/calendar/MonthViewElement.d.ts.map +1 -1
  46. package/dist/src/calendar/MultiYearViewElement.d.ts.map +1 -1
  47. package/dist/src/calendar/YearViewElement.d.ts.map +1 -1
  48. package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
  49. package/dist/src/core/shared/controllers/ClickOutsideController.d.ts +24 -0
  50. package/dist/src/core/shared/controllers/ClickOutsideController.d.ts.map +1 -0
  51. package/dist/src/core/shared/controllers/FocusController.d.ts +5 -11
  52. package/dist/src/core/shared/controllers/FocusController.d.ts.map +1 -1
  53. package/dist/src/core/shared/controllers/HoverController.d.ts +2 -8
  54. package/dist/src/core/shared/controllers/HoverController.d.ts.map +1 -1
  55. package/dist/src/core/shared/controllers/IntersectionController.d.ts +2 -8
  56. package/dist/src/core/shared/controllers/IntersectionController.d.ts.map +1 -1
  57. package/dist/src/core/shared/controllers/LongPressController.d.ts +2 -8
  58. package/dist/src/core/shared/controllers/LongPressController.d.ts.map +1 -1
  59. package/dist/src/core/shared/controllers/MonitorControllerBase.d.ts +4 -0
  60. package/dist/src/core/shared/controllers/MonitorControllerBase.d.ts.map +1 -1
  61. package/dist/src/core/shared/controllers/PressedController.d.ts +6 -8
  62. package/dist/src/core/shared/controllers/PressedController.d.ts.map +1 -1
  63. package/dist/src/core/shared/controllers/ResizeController.d.ts +2 -8
  64. package/dist/src/core/shared/controllers/ResizeController.d.ts.map +1 -1
  65. package/dist/src/core/shared/controllers/index.d.ts +1 -0
  66. package/dist/src/core/shared/controllers/index.d.ts.map +1 -1
  67. package/dist/src/datepicker/DatepickerElement.d.ts +1 -2
  68. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
  69. package/dist/src/fab-menu/FabMenuElement.d.ts.map +1 -1
  70. package/dist/src/form-field/FormFieldElement.d.ts +1 -0
  71. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  72. package/dist/src/menu/MenuElement.d.ts.map +1 -1
  73. package/dist/src/tooltip/RichTooltipElement.d.ts +0 -2
  74. package/dist/src/tooltip/RichTooltipElement.d.ts.map +1 -1
  75. package/dist/tooltip.js +24 -25
  76. package/dist/tooltip.js.map +1 -1
  77. package/dist/tooltip.min.js +1 -1
  78. package/dist/tooltip.min.js.map +1 -1
  79. 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(\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`&nbsp;*` : 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\">&nbsp;*</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,KAA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5BI,EAAS,CAAEC,SAAS,KAA+CrK,GAAAkK,UAAA,eAAA,GAMWF,EAAA,CAA9EI,EAAS,CAAEE,UAAW,uBAAwBC,KAAMC,QAASH,SAAS,KAAmCrK,GAAAkK,UAAA,0BAAA,GAMhDF,EAAA,CAAzDI,EAAS,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"}
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 filter: (e) => this.#ignoreEvent(e),\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(\".suffix\") private readonly _suffix!: 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 filter: (e) => this.#ignoreEvent(e),\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`&nbsp;*` : 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\">&nbsp;*</span>`\r\n : nothing}\r\n </span>\r\n </div>\r\n <div class=\"suffix\">\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 #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.#ignoreEvent(e)) return;\r\n\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 #ignoreEvent(e: Event): boolean {\r\n return e.composed && e.composedPath().includes(this._suffix);\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","filter","e","_M3eFormFieldElement_ignoreEvent","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_handleSuffixSlotChange","undefined","shouldLabelFloat","length","observe","_hint","_error","textContent","hasAssignedNodes","_prefix","style","setProperty","clientWidth","onContainerClick","focus","setTimeout","composed","composedPath","_suffix","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,KAsjB3EC,WAAAA,GACEC,oBAvEcC,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,GAAsBF,KAA1BN,OAG/CS,EAAAV,IAAAC,KAA6B,IAAIU,EAAmBV,KAAM,CACjEW,OAAQ,KACRC,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AClBF,EAAA,CAAhBG,KAAkCrK,GAAAoK,UAAA,oBAClBF,EAAA,CAAhBG,KAAiCrK,GAAAoK,UAAA,mBACjBF,EAAA,CAAhBG,KAAwCrK,GAAAoK,UAAA,6BA+B5BF,EAAA,CAA5BI,EAAS,CAAEC,SAAS,KAA+CvK,GAAAoK,UAAA,eAAA,GAMWF,EAAA,CAA9EI,EAAS,CAAEE,UAAW,uBAAwBC,KAAMC,QAASH,SAAS,KAAmCvK,GAAAoK,UAAA,0BAAA,GAMhDF,EAAA,CAAzDI,EAAS,CAAEE,UAAW,iBAAkBD,SAAS,KAAkDvK,GAAAoK,UAAA,qBAAA,GAM7CF,EAAA,CAAtDI,EAAS,CAAEE,UAAW,cAAeD,SAAS,KAA4CvK,GAAAoK,UAAA,kBAAA,GAnmBhFpK,GAAmBkK,EAAA,CAD/BS,EAAc,mBACF3K"}
@@ -845,7 +845,7 @@
845
845
  },
846
846
  {
847
847
  "name": "m3e-rich-tooltip",
848
- "description": "Provides contextual details for a control, such as explaining the value or purpose of a feature.\n---\n\n\n### **Events:**\n - **beforetoggle** - Dispatched before the toggle state changes.\n- **toggle** - Dispatched after the toggle state has changed.\n\n### **Methods:**\n - **show(): _Promise<void>_** - Manually shows the tooltip.\n- **hide(restoreFocus): _void_** - Manually hides the tooltip.\n- **attach(control: _HTMLElement_): _void_** - Attaches the element to an interactive control.\n- **detach(): _void_** - Detaches the element from its current interactive control.\n\n### **Slots:**\n - _default_ - The main supporting text of the tooltip.\n- **subhead** - Optional subhead text displayed above the supporting content.\n- **actions** - Optional action elements displayed at the bottom of the tooltip.\n\n### **CSS Properties:**\n - **--m3e-rich-tooltip-padding-top** - Top padding of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-padding-bottom** - Bottom padding of the tooltip container (when no actions are present). _(default: undefined)_\n- **--m3e-rich-tooltip-padding-inline** - Horizontal padding of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-max-width** - Maximum width of the tooltip surface. _(default: undefined)_\n- **--m3e-rich-tooltip-shape** - Border‑radius of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-container-color** - Background color of the tooltip surface. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-color** - Color of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-font-size** - Font size of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-font-weight** - Font weight of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-line-height** - Line height of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-tracking** - Letter‑spacing of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-bottom-space** - Space below the subhead before the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-color** - Color of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-font-size** - Font size of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-font-weight** - Font weight of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-line-height** - Line height of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-tracking** - Letter‑spacing of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-padding-inline** - Horizontal padding applied to the actions slot area. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-top-space** - Space above the actions slot. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-bottom-space** - Space below the actions slot. _(default: undefined)_",
848
+ "description": "Provides contextual details for a control, such as explaining the value or purpose of a feature.\n---\n\n\n### **Events:**\n - **beforetoggle** - Dispatched before the toggle state changes.\n- **toggle** - Dispatched after the toggle state has changed.\n\n### **Methods:**\n - **hide(restoreFocus): _void_** - Manually hides the tooltip.\n- **attach(control: _HTMLElement_): _void_** - Attaches the element to an interactive control.\n- **detach(): _void_** - Detaches the element from its current interactive control.\n- **show(): _Promise<void>_** - Manually shows the tooltip.\n\n### **Slots:**\n - _default_ - The main supporting text of the tooltip.\n- **subhead** - Optional subhead text displayed above the supporting content.\n- **actions** - Optional action elements displayed at the bottom of the tooltip.\n\n### **CSS Properties:**\n - **--m3e-rich-tooltip-padding-top** - Top padding of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-padding-bottom** - Bottom padding of the tooltip container (when no actions are present). _(default: undefined)_\n- **--m3e-rich-tooltip-padding-inline** - Horizontal padding of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-max-width** - Maximum width of the tooltip surface. _(default: undefined)_\n- **--m3e-rich-tooltip-shape** - Border‑radius of the tooltip container. _(default: undefined)_\n- **--m3e-rich-tooltip-container-color** - Background color of the tooltip surface. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-color** - Color of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-font-size** - Font size of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-font-weight** - Font weight of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-line-height** - Line height of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-tracking** - Letter‑spacing of the subhead text. _(default: undefined)_\n- **--m3e-rich-tooltip-subhead-bottom-space** - Space below the subhead before the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-color** - Color of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-font-size** - Font size of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-font-weight** - Font weight of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-line-height** - Line height of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-supporting-text-tracking** - Letter‑spacing of the supporting text. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-padding-inline** - Horizontal padding applied to the actions slot area. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-top-space** - Space above the actions slot. _(default: undefined)_\n- **--m3e-rich-tooltip-actions-bottom-space** - Space below the actions slot. _(default: undefined)_",
849
849
  "attributes": [
850
850
  {
851
851
  "name": "disabled",
@@ -931,6 +931,11 @@
931
931
  "description": "End of a date range.",
932
932
  "values": [{ "name": "Date" }]
933
933
  },
934
+ {
935
+ "name": "active",
936
+ "description": "Whether the view is active.",
937
+ "values": []
938
+ },
934
939
  {
935
940
  "name": "today",
936
941
  "description": "Today's date.",
@@ -963,6 +968,11 @@
963
968
  "name": "m3e-multi-year-view",
964
969
  "description": "An internal component used to display a year selector in a calendar.\n---\n\n\n### **Events:**\n - **change**\n- **active-change**\n\n### **Methods:**\n - **focusActiveCell(): _Promise<void>_** - Asynchronously focuses the active date.",
965
970
  "attributes": [
971
+ {
972
+ "name": "active",
973
+ "description": "Whether the view is active.",
974
+ "values": []
975
+ },
966
976
  {
967
977
  "name": "today",
968
978
  "description": "Today's date.",
@@ -995,6 +1005,11 @@
995
1005
  "name": "m3e-year-view",
996
1006
  "description": "An internal component used to display a single year in a calendar.\n---\n\n\n### **Events:**\n - **change**\n- **active-change**\n\n### **Methods:**\n - **focusActiveCell(): _Promise<void>_** - Asynchronously focuses the active date.",
997
1007
  "attributes": [
1008
+ {
1009
+ "name": "active",
1010
+ "description": "Whether the view is active.",
1011
+ "values": []
1012
+ },
998
1013
  {
999
1014
  "name": "today",
1000
1015
  "description": "Today's date.",
@@ -1025,7 +1040,7 @@
1025
1040
  },
1026
1041
  {
1027
1042
  "name": "m3e-calendar",
1028
- "description": "A calendar used to select a date.\n---\n\n\n### **Events:**\n - **change** - Dispatched when the selected date changes.\n\n### **Methods:**\n - **focusActiveCell(): _Promise<void>_** - Asynchronously focuses the active date.\n- **updateTodayDate(): _void_** - Updates today's date.\n- **movePreviousPeriod(): _Promise<void>_** - Moves the calendar to the previous period.\n- **moveNextPeriod(): _Promise<void>_** - Moves the calendar to the next period.\n- **togglePeriod(): _Promise<void>_** - Toggles the current period.\n\n### **Slots:**\n - **header** - Renders the header of the calendar.\n\n### **CSS Properties:**\n - **--m3e-calendar-container-color** - Background color of the container surface. _(default: undefined)_\n- **--m3e-calendar-container-elevation** - Elevation shadow applied to the container surface. _(default: undefined)_\n- **--m3e-calendar-container-shape** - Corner radius of the container surface. _(default: undefined)_\n- **--m3e-calendar-padding** - Padding applied to the calendar header and body. _(default: undefined)_\n- **--m3e-calendar-period-button-text-color** - Text color used for the period‑navigation buttons in the header. _(default: undefined)_\n- **--m3e-calendar-weekday-font-size** - Font size of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-font-weight** - Font weight of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-line-height** - Line height of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-tracking** - Letter spacing of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-color** - Text color for weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-size** - Font size of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-weight** - Font weight of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-line-height** - Line height of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-tracking** - Letter spacing of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-item-font-size** - Font size of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-font-weight** - Font weight of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-line-height** - Line height of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-tracking** - Letter spacing of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-color** - Text color for date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-color** - Text color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-container-color** - Background color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-ripple-color** - Ripple color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-hover-color** - Hover color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-focus-color** - Focus color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-thickness** - Outline thickness used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-color** - Outline color used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-special-color** - Text color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-container-color** - Background color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-ripple-color** - Ripple color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-hover-color** - Hover color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-focus-color** - Focus color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-range-container-color** - Background color applied to the selected date range. _(default: undefined)_\n- **--m3e-calendar-range-color** - Text color for dates within a selected range. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color** - Color used for disabled date items. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color-opacity** - Opacity applied to the disabled item color. _(default: undefined)_\n- **--m3e-calendar-slide-animation-duration** - Duration of slide transitions between calendar views. _(default: undefined)_",
1043
+ "description": "A calendar used to select a date.\n---\n\n\n### **Events:**\n - **change** - Dispatched when the selected date changes.\n\n### **Methods:**\n - **focusActiveCell(): _Promise<void>_** - Asynchronously focuses the active date.\n- **updateTodayDate(): _void_** - Updates today's date.\n- **resetActiveView(): _void_** - Resets the active view.\n- **movePreviousPeriod(): _Promise<void>_** - Moves the calendar to the previous period.\n- **moveNextPeriod(): _Promise<void>_** - Moves the calendar to the next period.\n- **togglePeriod(): _Promise<void>_** - Toggles the current period.\n\n### **Slots:**\n - **header** - Renders the header of the calendar.\n\n### **CSS Properties:**\n - **--m3e-calendar-container-color** - Background color of the container surface. _(default: undefined)_\n- **--m3e-calendar-container-elevation** - Elevation shadow applied to the container surface. _(default: undefined)_\n- **--m3e-calendar-container-shape** - Corner radius of the container surface. _(default: undefined)_\n- **--m3e-calendar-padding** - Padding applied to the calendar header and body. _(default: undefined)_\n- **--m3e-calendar-period-button-text-color** - Text color used for the period‑navigation buttons in the header. _(default: undefined)_\n- **--m3e-calendar-weekday-font-size** - Font size of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-font-weight** - Font weight of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-line-height** - Line height of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-tracking** - Letter spacing of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-color** - Text color for weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-size** - Font size of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-weight** - Font weight of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-line-height** - Line height of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-tracking** - Letter spacing of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-item-font-size** - Font size of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-font-weight** - Font weight of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-line-height** - Line height of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-tracking** - Letter spacing of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-color** - Text color for date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-color** - Text color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-container-color** - Background color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-ripple-color** - Ripple color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-hover-color** - Hover color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-focus-color** - Focus color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-thickness** - Outline thickness used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-color** - Outline color used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-special-color** - Text color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-container-color** - Background color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-ripple-color** - Ripple color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-hover-color** - Hover color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-focus-color** - Focus color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-range-container-color** - Background color applied to the selected date range. _(default: undefined)_\n- **--m3e-calendar-range-color** - Text color for dates within a selected range. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color** - Color used for disabled date items. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color-opacity** - Opacity applied to the disabled item color. _(default: undefined)_\n- **--m3e-calendar-slide-animation-duration** - Duration of slide transitions between calendar views. _(default: undefined)_",
1029
1044
  "attributes": [
1030
1045
  {
1031
1046
  "name": "date",
@@ -1880,6 +1895,18 @@
1880
1895
  ],
1881
1896
  "references": []
1882
1897
  },
1898
+ {
1899
+ "name": "m3e-fab-menu",
1900
+ "description": "A menu, opened from a floating action button (FAB), used to display multiple related actions.\n---\n\n\n### **Events:**\n - **beforetoggle** - Dispatched before the toggle state changes.\n- **toggle** - Dispatched after the toggle state has changed.\n\n### **Methods:**\n - **show(trigger: _HTMLElement_): _Promise<void>_** - Opens the menu.\n- **hide(restoreFocus: _boolean_): _void_** - Hides the menu.\n- **toggle(trigger: _HTMLElement_): _Promise<void>_** - Toggles the menu.\n\n### **Slots:**\n - _default_ - Renders the contents of the menu.\n\n### **CSS Properties:**\n - **--m3e-fab-menu-spacing** - Vertical gap between menu items. _(default: undefined)_\n- **--m3e-fab-menu-max-width** - Maximum width of the menu. _(default: undefined)_\n- **--m3e-primary-fab-color** - Foreground color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-container-color** - Container color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-hover-color** - Hover background color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-focus-color** - Focus background color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-ripple-color** - Ripple color for primary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-color** - Foreground color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-container-color** - Container color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-hover-color** - Hover background color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-focus-color** - Focus background color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-ripple-color** - Ripple color for secondary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-color** - Foreground color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-container-color** - Container color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-hover-color** - Hover background color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-focus-color** - Focus background color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-ripple-color** - Ripple color for tertiary variant items. _(default: undefined)_",
1901
+ "attributes": [
1902
+ {
1903
+ "name": "variant",
1904
+ "description": "The appearance variant of the menu.",
1905
+ "values": [{ "name": "FabMenuVariant" }]
1906
+ }
1907
+ ],
1908
+ "references": []
1909
+ },
1883
1910
  {
1884
1911
  "name": "m3e-menu-item",
1885
1912
  "description": "An item of a floating action button (FAB) menu.\n---\n\n\n### **Events:**\n - **click** - Dispatched when the element is clicked.\n\n### **Slots:**\n - _default_ - Renders the label of the item.\n- **icon** - Renders an icon before the items's label.\n\n### **CSS Properties:**\n - **--m3e-fab-menu-item-height** - Height of the menu item. _(default: undefined)_\n- **--m3e-fab-menu-item-font-size** - Font size of the menu item label. _(default: undefined)_\n- **--m3e-fab-menu-item-font-weight** - Font weight of the menu item label. _(default: undefined)_\n- **--m3e-fab-menu-item-line-height** - Line height of the menu item label. _(default: undefined)_\n- **--m3e-fab-menu-item-tracking** - Letter spacing of the menu item label. _(default: undefined)_\n- **--m3e-fab-menu-item-shape** - Border radius of the menu item. _(default: undefined)_\n- **--m3e-fab-menu-item-leading-space** - Padding at the start of the menu item. _(default: undefined)_\n- **--m3e-fab-menu-item-trailing-space** - Padding at the end of the menu item. _(default: undefined)_\n- **--m3e-fab-menu-item-spacing** - Gap between icon and label. _(default: undefined)_\n- **--m3e-fab-menu-item-icon-size** - Size of the icon in the menu item. _(default: undefined)_",
@@ -1912,18 +1939,6 @@
1912
1939
  ],
1913
1940
  "references": []
1914
1941
  },
1915
- {
1916
- "name": "m3e-fab-menu",
1917
- "description": "A menu, opened from a floating action button (FAB), used to display multiple related actions.\n---\n\n\n### **Events:**\n - **beforetoggle** - Dispatched before the toggle state changes.\n- **toggle** - Dispatched after the toggle state has changed.\n\n### **Methods:**\n - **show(trigger: _HTMLElement_): _Promise<void>_** - Opens the menu.\n- **hide(restoreFocus: _boolean_): _void_** - Hides the menu.\n- **toggle(trigger: _HTMLElement_): _Promise<void>_** - Toggles the menu.\n\n### **Slots:**\n - _default_ - Renders the contents of the menu.\n\n### **CSS Properties:**\n - **--m3e-fab-menu-spacing** - Vertical gap between menu items. _(default: undefined)_\n- **--m3e-fab-menu-max-width** - Maximum width of the menu. _(default: undefined)_\n- **--m3e-primary-fab-color** - Foreground color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-container-color** - Container color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-hover-color** - Hover background color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-focus-color** - Focus background color for primary variant items. _(default: undefined)_\n- **--m3e-primary-fab-ripple-color** - Ripple color for primary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-color** - Foreground color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-container-color** - Container color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-hover-color** - Hover background color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-focus-color** - Focus background color for secondary variant items. _(default: undefined)_\n- **--m3e-secondary-fab-ripple-color** - Ripple color for secondary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-color** - Foreground color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-container-color** - Container color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-hover-color** - Hover background color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-focus-color** - Focus background color for tertiary variant items. _(default: undefined)_\n- **--m3e-tertiary-fab-ripple-color** - Ripple color for tertiary variant items. _(default: undefined)_",
1918
- "attributes": [
1919
- {
1920
- "name": "variant",
1921
- "description": "The appearance variant of the menu.",
1922
- "values": [{ "name": "FabMenuVariant" }]
1923
- }
1924
- ],
1925
- "references": []
1926
- },
1927
1942
  {
1928
1943
  "name": "m3e-fab-menu-trigger",
1929
1944
  "description": "An element, nested within a clickable element, used to open a floating action button (FAB) menu.\n---\n\n\n### **Methods:**\n - **attach(control: _HTMLElement_): _void_** - Attaches the element to an interactive control.\n- **detach(): _void_** - Detaches the element from its current interactive control.\n",
package/dist/icon.js CHANGED
@@ -227,7 +227,7 @@ let M3eIconElement = class M3eIconElement extends Role(LitElement, "img") {
227
227
  }
228
228
  /** @inheritdoc */
229
229
  render() {
230
- return IconRegistry.isIconRegistered(this.name, this.variant) ? IconRegistry.renderIcon(this.name, this.variant, this.filled) : html`<div class="icon" aria-hidden="true">${this.name}</div>`;
230
+ return IconRegistry.isIconRegistered(this.name, this.variant) ? IconRegistry.renderIcon(this.name, this.variant, this.filled) : html`<div class="icon" aria-hidden="true" translate="no">${this.name}</div>`;
231
231
  }
232
232
  };
233
233
  _M3eIconElement_iconRegistryUnobserve = new WeakMap();
package/dist/icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n fill: currentColor;\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","_a","_IconRegistry_validateSvgIconInfo","call","window","undefined","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement","registerIcon"],"mappings":";;;;;;;;;;;AAIA;AAAgB,MAAMA,iBAAiB,GAAG,mCAAmC;AAC7E;AAAgB,MAAMC,gBAAgB,GAAG,iEAAiE;AAoB1G;;;AAGG;MACUC,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,EAAA,OAAOC,OAAOA,CAACC,IAAY,EAAEC,OAAoB,EAAEC,OAAuB,EAAA;AACxE,IAAA,MAAMC,oBAAoB,GAAG,OAAOD,OAAO,CAACE,QAAQ,KAAK,QAAQ;AACjE,IAAA,MAAMC,kBAAkB,GAAG,OAAOH,OAAO,CAACI,MAAM,KAAK,QAAQ;AAE7D,IAAA,IAAI,OAAOJ,OAAO,CAACE,QAAQ,KAAK,QAAQ,EAAE;MACxCF,OAAO,CAACE,QAAQ,GAAG;AACjBG,QAAAA,OAAO,EAAE,gBAAgB;QACzBC,IAAI,EAAEN,OAAO,CAACE;OACf;AACH,IAAA;AACA,IAAA,IAAI,OAAOF,OAAO,CAACI,MAAM,KAAK,QAAQ,EAAE;MACtCJ,OAAO,CAACI,MAAM,GAAG;AACfC,QAAAA,OAAO,EAAE,gBAAgB;QACzBC,IAAI,EAAEN,OAAO,CAACI;OACf;AACH,IAAA;IAEAG,sBAAA,CAAA,IAAI,EAAAC,EAAA,EAAA,GAAA,EAAAC,iCAAA,CAAqB,CAAAC,IAAA,CAAzB,IAAI,EAAsBZ,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAACE,QAAQ,EAAED,oBAAoB,CAAC;IAChFM,sBAAA,CAAA,IAAI,EAAAC,EAAA,EAAA,GAAA,EAAAC,iCAAA,CAAqB,CAAAC,IAAA,CAAzB,IAAI,EAAsBZ,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAACI,MAAM,EAAED,kBAAkB,CAAC;IAE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A,CAAXG,QAAQ,EAAE,CAA6B,EAAA3B,cAAA,CAAA0B,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMZF,UAAA,CAAA,CAA3BG,QAAQ,CAAC;AAAEE,EAAAA,IAAI,EAAEE;CAAQ,CAAC,CAA0B,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMEF,UAAA,CAAA,CAAtDG,QAAQ,CAAC;AAAEK,EAAAA,SAAS,EAAE,cAAc;AAAEH,EAAAA,IAAI,EAAEE;AAAM,CAAE,CAAC,CAAkB,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAnF7D1B,cAAc,GAAAwB,UAAA,CAAA,CAD1BS,aAAa,CAAC,UAAU,CAAC,CACb,EAAAjC,cAAc,CAiJ1B;;ACzLD;;;;;AAKG;SACakC,YAAYA,CAC1B7E,IAAY,EACZC,OAAoB,EACpB0B,IAAoD,EAAA;EAEpD7B,YAAY,CAACC,OAAO,CAACC,IAAI,EAAEC,OAAO,EAAE0B,IAAI,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"icon.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n fill: currentColor;\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\" translate=\"no\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","_a","_IconRegistry_validateSvgIconInfo","call","window","undefined","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement","registerIcon"],"mappings":";;;;;;;;;;;AAIA;AAAg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A0B,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMEF,UAAA,CAAA,CAAtDG,QAAQ,CAAC;AAAEK,EAAAA,SAAS,EAAE,cAAc;AAAEH,EAAAA,IAAI,EAAEE;AAAM,CAAE,CAAC,CAAkB,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAnF7D1B,cAAc,GAAAwB,UAAA,CAAA,CAD1BS,aAAa,CAAC,UAAU,CAAC,CACb,EAAAjC,cAAc,CAiJ1B;;ACzLD;;;;;AAKG;SACakC,YAAYA,CAC1B7E,IAAY,EACZC,OAAoB,EACpB0B,IAAoD,EAAA;EAEpD7B,YAAY,CAACC,OAAO,CAACC,IAAI,EAAEC,OAAO,EAAE0B,IAAI,CAAC;AAC3C;;;;"}
package/dist/icon.min.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * Copyright (c) 2025–2026 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{__classPrivateFieldGet as t,__classPrivateFieldSet as i,__decorate as e}from"tslib";import{svg as o,LitElement as s,html as a,css as n}from"lit";import{query as r,property as l}from"lit/decorators.js";import{Role as h,customElement as d}from"@m3e/web/core";var c,f,p,v,m;const g=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\s-]+$/,u=/^-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?$/;class w{static addIcon(i,e,s){const a="string"==typeof s.outlined,n="string"==typeof s.filled;if("string"==typeof s.outlined&&(s.outlined={viewBox:"0 -960 960 960",path:s.outlined}),"string"==typeof s.filled&&(s.filled={viewBox:"0 -960 960 960",path:s.filled}),t(this,c,"m",m).call(this,i,e,s.outlined,a),t(this,c,"m",m).call(this,i,e,s.filled,n),void 0!==window){const a=t(this,c,"m",v).call(this,i,e);t(this,c,"f",f).set(a,{outlined:o`<svg viewBox="${s.outlined.viewBox}"><path d="${s.outlined.path}"/></svg>`,filled:o`<svg viewBox="${s.filled.viewBox}"><path d="${s.filled.path}"/></svg>`}),t(this,c,"f",p).get(a)?.forEach(t=>t())}}static isIconRegistered(i,e){return void 0!==window&&t(this,c,"f",f).has(t(this,c,"m",v).call(this,i,e))}static renderIcon(i,e,o){const s=t(this,c,"f",f).get(t(this,c,"m",v).call(this,i,e));return o?s?.filled:s?.outlined}static observe(i,e,o){if(void 0===window)return()=>{};const s=t(this,c,"m",v).call(this,i,e);return t(this,c,"f",p).has(s)?t(this,c,"f",p).get(s)?.push(o):t(this,c,"f",p).set(s,[o]),()=>{const i=t(this,c,"f",p).get(s);if(i){const e=i.indexOf(o);e>=0&&i.splice(e,1),0==i.length&&t(this,c,"f",p).delete(s)}}}}var y;c=w,v=function(t,i){return`${i}-${t}`},m=function(t,i,e,o=!1){if(!o&&!u.test(e.viewBox))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid viewbox data.`);if(!g.test(e.path))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid path data.`)},f={value:new Map},p={value:new Map};let b=class extends(h(s,"img")){constructor(){super(...arguments),y.set(this,void 0),this.name="",this.variant="outlined",this.filled=!1,this.grade="medium",this.weight=400,this.opticalSize=24}connectedCallback(){this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-hidden")||(this.ariaHidden="true"),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),t(this,y,"f")?.call(this)}willUpdate(e){super.willUpdate(e),e.has("name")&&!w.isIconRegistered(this.name,this.variant)&&i(this,y,w.observe(this.name,this.variant,()=>{this.requestUpdate(),t(this,y,"f")?.call(this),i(this,y,void 0,"f")}),"f")}updated(t){super.updated(t),t.has("filled")&&this._icon?.style.setProperty("--_icon-fill",this.filled?"1":"0"),t.has("grade")&&this._icon?.style.setProperty("--_icon-grade","low"===this.grade?"-25":"high"===this.grade?"200":"0"),t.has("weight")&&this._icon?.style.setProperty("--_icon-weight",`${this.weight}`),t.has("opticalSize")&&this._icon?.style.setProperty("--_icon-optical-size",`${this.opticalSize}`)}render(){return w.isIconRegistered(this.name,this.variant)?w.renderIcon(this.name,this.variant,this.filled):a`<div class="icon" aria-hidden="true">${this.name}</div>`}};function $(t,i,e){w.addIcon(t,i,e)}y=new WeakMap,b.styles=n`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { fill: currentColor; font-size: inherit; width: 1em; height: 1em; }`,e([r(".icon")],b.prototype,"_icon",void 0),e([l()],b.prototype,"name",void 0),e([l({reflect:!0})],b.prototype,"variant",void 0),e([l({type:Boolean,reflect:!0})],b.prototype,"filled",void 0),e([l()],b.prototype,"grade",void 0),e([l({type:Number})],b.prototype,"weight",void 0),e([l({attribute:"optical-size",type:Number})],b.prototype,"opticalSize",void 0),b=e([d("m3e-icon")],b);export{b as M3eIconElement,$ as registerIcon};
6
+ import{__classPrivateFieldGet as t,__classPrivateFieldSet as i,__decorate as e}from"tslib";import{svg as o,LitElement as s,html as a,css as n}from"lit";import{query as r,property as l}from"lit/decorators.js";import{Role as h,customElement as d}from"@m3e/web/core";var c,f,p,v,m;const g=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\s-]+$/,u=/^-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?$/;class w{static addIcon(i,e,s){const a="string"==typeof s.outlined,n="string"==typeof s.filled;if("string"==typeof s.outlined&&(s.outlined={viewBox:"0 -960 960 960",path:s.outlined}),"string"==typeof s.filled&&(s.filled={viewBox:"0 -960 960 960",path:s.filled}),t(this,c,"m",m).call(this,i,e,s.outlined,a),t(this,c,"m",m).call(this,i,e,s.filled,n),void 0!==window){const a=t(this,c,"m",v).call(this,i,e);t(this,c,"f",f).set(a,{outlined:o`<svg viewBox="${s.outlined.viewBox}"><path d="${s.outlined.path}"/></svg>`,filled:o`<svg viewBox="${s.filled.viewBox}"><path d="${s.filled.path}"/></svg>`}),t(this,c,"f",p).get(a)?.forEach(t=>t())}}static isIconRegistered(i,e){return void 0!==window&&t(this,c,"f",f).has(t(this,c,"m",v).call(this,i,e))}static renderIcon(i,e,o){const s=t(this,c,"f",f).get(t(this,c,"m",v).call(this,i,e));return o?s?.filled:s?.outlined}static observe(i,e,o){if(void 0===window)return()=>{};const s=t(this,c,"m",v).call(this,i,e);return t(this,c,"f",p).has(s)?t(this,c,"f",p).get(s)?.push(o):t(this,c,"f",p).set(s,[o]),()=>{const i=t(this,c,"f",p).get(s);if(i){const e=i.indexOf(o);e>=0&&i.splice(e,1),0==i.length&&t(this,c,"f",p).delete(s)}}}}var y;c=w,v=function(t,i){return`${i}-${t}`},m=function(t,i,e,o=!1){if(!o&&!u.test(e.viewBox))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid viewbox data.`);if(!g.test(e.path))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid path data.`)},f={value:new Map},p={value:new Map};let b=class extends(h(s,"img")){constructor(){super(...arguments),y.set(this,void 0),this.name="",this.variant="outlined",this.filled=!1,this.grade="medium",this.weight=400,this.opticalSize=24}connectedCallback(){this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-hidden")||(this.ariaHidden="true"),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),t(this,y,"f")?.call(this)}willUpdate(e){super.willUpdate(e),e.has("name")&&!w.isIconRegistered(this.name,this.variant)&&i(this,y,w.observe(this.name,this.variant,()=>{this.requestUpdate(),t(this,y,"f")?.call(this),i(this,y,void 0,"f")}),"f")}updated(t){super.updated(t),t.has("filled")&&this._icon?.style.setProperty("--_icon-fill",this.filled?"1":"0"),t.has("grade")&&this._icon?.style.setProperty("--_icon-grade","low"===this.grade?"-25":"high"===this.grade?"200":"0"),t.has("weight")&&this._icon?.style.setProperty("--_icon-weight",`${this.weight}`),t.has("opticalSize")&&this._icon?.style.setProperty("--_icon-optical-size",`${this.opticalSize}`)}render(){return w.isIconRegistered(this.name,this.variant)?w.renderIcon(this.name,this.variant,this.filled):a`<div class="icon" aria-hidden="true" translate="no">${this.name}</div>`}};function $(t,i,e){w.addIcon(t,i,e)}y=new WeakMap,b.styles=n`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { fill: currentColor; font-size: inherit; width: 1em; height: 1em; }`,e([r(".icon")],b.prototype,"_icon",void 0),e([l()],b.prototype,"name",void 0),e([l({reflect:!0})],b.prototype,"variant",void 0),e([l({type:Boolean,reflect:!0})],b.prototype,"filled",void 0),e([l()],b.prototype,"grade",void 0),e([l({type:Number})],b.prototype,"weight",void 0),e([l({attribute:"optical-size",type:Number})],b.prototype,"opticalSize",void 0),b=e([d("m3e-icon")],b);export{b as M3eIconElement,$ as registerIcon};
7
7
  //# sourceMappingURL=icon.min.js.map