@api-client/ui 0.5.24 → 0.5.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/lit-best-practices.mdc +12 -1
- package/.github/instructions/lit-best-practices.instructions.md +2 -0
- package/build/src/elements/navigation/internals/AppNavigationElement.d.ts.map +1 -1
- package/build/src/elements/navigation/internals/AppNavigationElement.js +1 -6
- package/build/src/elements/navigation/internals/AppNavigationElement.js.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.d.ts +6 -0
- package/build/src/elements/navigation/internals/NavigationItem.d.ts.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.js +26 -7
- package/build/src/elements/navigation/internals/NavigationItem.js.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.styles.d.ts.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.styles.js +18 -1
- package/build/src/elements/navigation/internals/NavigationItem.styles.js.map +1 -1
- package/build/src/md/dropdown-list/internals/UiDropdownList.d.ts.map +1 -1
- package/build/src/md/dropdown-list/internals/UiDropdownList.js +4 -3
- package/build/src/md/dropdown-list/internals/UiDropdownList.js.map +1 -1
- package/build/src/md/input/Input.d.ts +8 -4
- package/build/src/md/input/Input.d.ts.map +1 -1
- package/build/src/md/input/Input.js +8 -36
- package/build/src/md/input/Input.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +3 -1
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +9 -4
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/menu/internal/Menu.d.ts +8 -7
- package/build/src/md/menu/internal/Menu.d.ts.map +1 -1
- package/build/src/md/menu/internal/Menu.js +26 -29
- package/build/src/md/menu/internal/Menu.js.map +1 -1
- package/build/src/md/select/index.d.ts +4 -0
- package/build/src/md/select/index.d.ts.map +1 -0
- package/build/src/md/select/index.js +3 -0
- package/build/src/md/select/index.js.map +1 -0
- package/build/src/md/select/internals/Option.d.ts +125 -0
- package/build/src/md/select/internals/Option.d.ts.map +1 -0
- package/build/src/md/select/internals/Option.js +242 -0
- package/build/src/md/select/internals/Option.js.map +1 -0
- package/build/src/md/select/internals/Option.styles.d.ts +3 -0
- package/build/src/md/select/internals/Option.styles.d.ts.map +1 -0
- package/build/src/md/select/internals/Option.styles.js +139 -0
- package/build/src/md/select/internals/Option.styles.js.map +1 -0
- package/build/src/md/select/internals/Select.d.ts +250 -0
- package/build/src/md/select/internals/Select.d.ts.map +1 -0
- package/build/src/md/select/internals/Select.js +606 -0
- package/build/src/md/select/internals/Select.js.map +1 -0
- package/build/src/md/select/internals/Select.styles.d.ts +3 -0
- package/build/src/md/select/internals/Select.styles.d.ts.map +1 -0
- package/build/src/md/select/internals/Select.styles.js +22 -0
- package/build/src/md/select/internals/Select.styles.js.map +1 -0
- package/build/src/md/select/ui-option.d.ts +12 -0
- package/build/src/md/select/ui-option.d.ts.map +1 -0
- package/build/src/md/select/ui-option.js +29 -0
- package/build/src/md/select/ui-option.js.map +1 -0
- package/build/src/md/select/ui-select.d.ts +12 -0
- package/build/src/md/select/ui-select.d.ts.map +1 -0
- package/build/src/md/select/ui-select.js +27 -0
- package/build/src/md/select/ui-select.js.map +1 -0
- package/build/src/md/text-field/internals/TextField.d.ts.map +1 -1
- package/build/src/md/text-field/internals/TextField.js +1 -0
- package/build/src/md/text-field/internals/TextField.js.map +1 -1
- package/demo/elements/index.html +7 -4
- package/demo/elements/navigation/navigation-item.html +45 -0
- package/demo/elements/navigation/navigation-item.ts +112 -0
- package/demo/md/index.html +2 -0
- package/demo/md/inputs/input.ts +4 -0
- package/demo/md/select/index.html +16 -0
- package/demo/md/select/index.ts +202 -0
- package/package.json +1 -1
- package/src/elements/navigation/internals/AppNavigationElement.ts +1 -6
- package/src/elements/navigation/internals/NavigationItem.styles.ts +18 -1
- package/src/elements/navigation/internals/NavigationItem.ts +11 -5
- package/src/md/dropdown-list/internals/UiDropdownList.ts +4 -3
- package/src/md/input/Input.ts +8 -37
- package/src/md/list/internals/List.ts +12 -5
- package/src/md/menu/internal/Menu.ts +27 -18
- package/src/md/select/index.ts +3 -0
- package/src/md/select/internals/Option.styles.ts +139 -0
- package/src/md/select/internals/Option.ts +210 -0
- package/src/md/select/internals/Select.styles.ts +22 -0
- package/src/md/select/internals/Select.ts +534 -0
- package/src/md/select/ui-option.ts +18 -0
- package/src/md/select/ui-select.ts +17 -0
- package/src/md/text-field/internals/TextField.ts +1 -0
- package/test/md/menu/SubMenu.test.ts +2 -3
- package/test/md/select/Select.test.ts +667 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiDropdownList.js","sourceRoot":"","sources":["../../../../../src/md/dropdown-list/internals/UiDropdownList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAa,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAoD,MAAM,oCAAoC,CAAA;AACtH,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAA;AAE5D,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,eAAe,CAAC,CAAA;;sBA0BtB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAjC,cAAe,SAAQ,WAAU;;;oCACnD,qBAAqB,EAAE;qCAGvB,qBAAqB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;qCAG3C,KAAK,EAAE;kCAEP,KAAK,EAAE;gCAMP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCA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AU,EAAE,IAAI;iBACjB,CAAC,CACH,CAAA;YACH,CAAC;QACH,CAAC;QAEkB,MAAM;YACvB,MAAM,OAAO,GAAc;gBACzB,SAAS,EAAE,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAA;YAED,OAAO,IAAI,CAAA,gBAAgB,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,SAAS,CAAA;QACxG,CAAC;QAES,aAAa;YACrB,OAAO,IAAI,CAAA;qCACsB,IAAI,CAAC,mBAAmB,eAAe,IAAI,CAAC,qBAAqB;6BACzE,IAAI,CAAC,cAAc;;KAE3C,CAAA;QACH,CAAC;QAES,aAAa;YACrB,MAAM,aAAa,GAAG,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAA;YACnD,OAAO,IAAI,CAAA;oCACqB,QAAQ,CAAC,aAAa,CAAC;;;yBAGlC,IAAI,CAAC,eAAe;sBACvB,IAAI,CAAC,qBAAqB;oBAC5B,IAAI,CAAC,mBAAmB;oBACxB,IAAI,CAAC,mBAAmB;;;KAGvC,CAAA;QACH,CAAC;;;AAjbH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8BA8ZC","sourcesContent":["import { randomString } from '@api-client/core/lib/math/Random.js'\nimport { html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js'\nimport { StyleInfo, styleMap } from 'lit/directives/style-map.js'\nimport { positionOverlay, type HorizontalAlignment, type VerticalAlignment } from '../../../lib/ElementPositioning.js'\nimport * as ScrollHelper from '../../../lib/ScrollHelper.js'\n\nconst itemRole = ['menuitem', 'menuitemcheckbox', 'menuitemradio']\n\nexport interface UiDropdownListSelection {\n item: HTMLElement\n}\n\n/**\n * An overlay list rendered over a button.\n *\n * Examples:\n *\n * <ui-dropdown-list>\n * <ui-button color=\"filled\">Click me</ui-button>\n * <ui-list slot=\"dropdown\" role=\"menu\">\n * <ui-list-item role=\"menuitem\">Item 1</ui-list-item>\n * <ui-list-item role=\"menuitem\">Item 2</ui-list-item>\n * </ui-list>\n * </ui-dropdown-list>\n *\n * @slot - The default slot for the dropdown trigger (button)\n * @slot dropdown - The slot for the list.\n * @fires select - Custom event with the selected item on the `detail.item` when the user selected an item.\n * When the event is cancelled then there's no side effects (closing the dropdown)\n * @fires dropdownopen - An event informing other dropdowns that this one was opened and other should close.\n * @fires open - An event dispatched when the open state change through a user interaction\n */\nexport default class UiDropdownList extends LitElement {\n @queryAssignedElements()\n protected accessor triggers!: HTMLElement[]\n\n @queryAssignedElements({ slot: 'dropdown' })\n protected accessor dropdowns!: HTMLElement[]\n\n @state() protected accessor triggerId = `ui-trigger-${randomString(4)}`\n\n @state() protected accessor menuId = `ui-menu-${randomString(4)}`\n\n /**\n * Whether the menu is opened.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor open = false\n\n /**\n * The vertical (y-axis) alignment of the dropdown content.\n * - top\n * - bottom\n * - middle\n *\n * No value means the natural position according to the box model.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor verticalAlign: VerticalAlignment | undefined\n\n /**\n * The horizontal (x-axis) alignment of the dropdown content.\n * - top\n * - bottom\n * - middle\n *\n * No value means the natural position according to the box model.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor horizontalAlign: HorizontalAlignment | undefined\n\n /**\n * Affects the `horizontal` and `vertical` positioning so that the target element does not overlap with the anchor.\n * For example, when the `vertical` align is `top`, the top edge of the target will be rendered at the bottom\n * of the anchor down to the edge of the viewport.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor noOverlap: boolean | undefined\n\n /**\n * When set it closes the opened list when registering a click outside the list.\n * @attribute\n */\n @property({ type: Boolean }) accessor closeOnOutsideClick: boolean | undefined\n\n /**\n * When set it makes the drop-down to match the width of the trigger.\n * Be careful as this may crop the content when the trigger is not wide enough.\n * @attribute\n */\n @property({ type: Boolean }) accessor matchTriggerWidth: boolean | undefined\n\n /**\n * When set it closes the drop-down when `tab` button is pressed.\n * This is not a default behavior since the drop-down content can have its own logic\n * related to tab index.\n */\n @property({ type: Boolean }) accessor closeOnTab: boolean | undefined\n\n /**\n * The first element located in the default slot.\n */\n protected get trigger(): HTMLElement | null {\n const { triggers } = this\n if (!triggers || !triggers.length) {\n return null\n }\n const [button] = triggers\n return button\n }\n\n /**\n * The first element located in the \"dropdown\" slot.\n */\n protected get dropdown(): HTMLElement | null {\n const { dropdowns } = this\n if (!dropdowns || !dropdowns.length) {\n return null\n }\n const [content] = dropdowns\n return content\n }\n\n @state() protected accessor overlayPositioning: StyleInfo | undefined\n\n constructor() {\n super()\n this.dropdownOpenHandler = this.dropdownOpenHandler.bind(this)\n this.scrollHandler = this.scrollHandler.bind(this)\n this.clickHandler = this.clickHandler.bind(this)\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n window.addEventListener('dropdownopen', this.dropdownOpenHandler)\n window.addEventListener('click', this.clickHandler, { capture: true })\n ScrollHelper.addListeners(this, this.scrollHandler)\n\n this.setAttribute('aria-haspopup', 'menu')\n this.setAttribute('aria-expanded', 'false')\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n window.removeEventListener('dropdownopen', this.dropdownOpenHandler)\n window.removeEventListener('click', this.clickHandler, { capture: true })\n ScrollHelper.removeListeners(this)\n }\n\n protected dropdownOpenHandler(e: Event): void {\n if (e.composedPath()[0] === this) {\n return\n }\n this.close()\n }\n\n protected override willUpdate(cp: PropertyValues<this>): void {\n super.willUpdate(cp)\n if ((cp.has('noOverlap') || cp.has('verticalAlign') || cp.has('horizontalAlign') || cp.has('open')) && this.open) {\n this.computePositioning()\n }\n }\n\n protected override updated(cp: PropertyValues<this>): void {\n super.updated(cp)\n if (cp.has('open')) {\n this.toggleOpened()\n this.updateExpanded()\n // this.manageTabindex()\n }\n }\n\n protected updateExpanded(): void {\n this.setAttribute('aria-expanded', String(this.open))\n }\n\n protected triggerChanged(): void {\n const { trigger } = this\n if (!trigger) {\n return\n }\n this.decorateTrigger(trigger)\n }\n\n protected dropdownChanged(): void {\n const { dropdown } = this\n if (!dropdown) {\n return\n }\n this.decorateDropdown(dropdown)\n }\n\n /**\n * Decorates the trigger with aria attributes.\n */\n protected decorateTrigger(button: HTMLElement): void {\n button.setAttribute('aria-controls', this.menuId)\n button.setAttribute('tabindex', '0')\n if (button.id) {\n this.triggerId = button.id\n } else {\n button.id = this.triggerId\n }\n }\n\n protected decorateDropdown(list: HTMLElement): void {\n if (!list.hasAttribute('role')) {\n list.setAttribute('role', 'menu')\n }\n if (!list.hasAttribute('aria-labelledby')) {\n list.setAttribute('aria-labelledby', this.triggerId)\n }\n list.setAttribute('tabindex', '-1')\n list.id = this.menuId\n }\n\n protected triggerClickHandler(): void {\n this.open = !this.open\n this.notifyOpen()\n }\n\n protected triggerKeyDownHandler(e: KeyboardEvent): void {\n if (['Enter', 'Space', 'ArrowDown', 'ArrowUp'].includes(e.code)) {\n e.preventDefault()\n this.open = true\n this.notifyOpen()\n }\n }\n\n protected contentKeyDownHandler(e: KeyboardEvent): void {\n if (e.defaultPrevented) {\n return\n }\n if (e.code === 'Escape') {\n this.close()\n } else if (e.code === 'Tab') {\n if (this.closeOnTab) {\n this.close()\n }\n } else if (['Enter', 'Space'].includes(e.code)) {\n this.activate(e)\n }\n }\n\n protected contentClickHandler(e: PointerEvent): void {\n this.activate(e)\n }\n\n close(): void {\n this.open = false\n this.notifyOpen()\n }\n\n protected contentCloseHandler(e: Event): void {\n e.stopPropagation()\n this.close()\n }\n\n /**\n * Since the container for the dropdown content is positioned as fixed\n * we need to position the dropdown according to the configured rules.\n */\n protected computePositioning(): void {\n const { trigger, dropdown } = this\n if (!trigger || !dropdown) {\n return\n }\n this.overlayPositioning = positionOverlay(dropdown, trigger, {\n horizontal: this.horizontalAlign,\n vertical: this.verticalAlign,\n noOverlap: this.noOverlap,\n constrain: true,\n constrainPaddingY: 20,\n matchAnchorWidth: this.matchTriggerWidth,\n })\n }\n\n protected scrollHandler(): void {\n if (this.open) {\n this.computePositioning()\n }\n }\n\n protected clickHandler(e: Event): void {\n if (!this.open || !this.closeOnOutsideClick) {\n return\n }\n const inside = e.composedPath().some((i) => i === this)\n if (inside) {\n return\n }\n this.close()\n }\n\n protected toggleOpened(): void {\n const { open } = this\n if (open) {\n this.handleOpened()\n } else {\n this.handleClosed()\n }\n }\n\n /**\n * When set, it is the last active child of the dropdown\n * before the tabindex was removed from it. It is used to restore focus\n * when the dropdown is re-opened.\n */\n lastActiveChild?: HTMLElement\n\n /**\n * When the list is closed, the tabindex of the dropdown is removed to prevent\n * it from being focused while invisible.\n */\n protected manageTabindex(): void {\n const { dropdown } = this\n if (!dropdown) {\n return\n }\n if (this.open) {\n if (this.lastActiveChild) {\n this.lastActiveChild.setAttribute('tabindex', '0')\n this.lastActiveChild.focus()\n this.lastActiveChild = undefined\n } else {\n // If no last active child, focus the dropdown itself\n dropdown.setAttribute('tabindex', '0')\n }\n } else {\n // const activeChild = dropdown.querySelector(':focus') || dropdown\n // this.lastActiveChild = activeChild as HTMLElement\n // activeChild.removeAttribute('tabindex')\n // this.trigger?.focus()\n }\n }\n\n protected handleOpened(): void {\n const { trigger, dropdown } = this\n if (trigger) {\n trigger.removeAttribute('tabindex')\n }\n if (this.lastActiveChild) {\n this.lastActiveChild.setAttribute('tabindex', '0')\n this.lastActiveChild.focus()\n this.lastActiveChild = undefined\n } else if (dropdown) {\n dropdown.setAttribute('tabindex', '0')\n dropdown.focus()\n }\n }\n\n protected handleClosed(): void {\n const { trigger, dropdown } = this\n if (trigger) {\n trigger.setAttribute('tabindex', '0')\n trigger.focus()\n }\n if (dropdown) {\n const activeChild = dropdown.querySelector('[tabindex=\"0\"]')\n if (activeChild) {\n this.lastActiveChild = activeChild as HTMLElement\n activeChild.removeAttribute('tabindex')\n }\n dropdown.removeAttribute('tabindex')\n }\n }\n\n protected activate(e: Event): void {\n if (e.defaultPrevented) {\n return\n }\n const path = e.composedPath()\n let item: HTMLElement | undefined\n while (!item) {\n const next = path.shift() as Element\n if (next === this) {\n break\n }\n if (next.nodeType !== Node.ELEMENT_NODE) {\n continue\n }\n if (itemRole.includes(next.getAttribute('role') || '')) {\n item = next as HTMLElement\n }\n }\n if (!item) {\n return\n }\n const event = new CustomEvent<UiDropdownListSelection>('select', {\n cancelable: true,\n // composed: true,\n detail: {\n item,\n },\n })\n this.dispatchEvent(event)\n if (event.defaultPrevented) {\n return\n }\n this.close()\n }\n\n protected notifyOpen(): void {\n this.dispatchEvent(new Event('open'))\n if (this.open) {\n this.dispatchEvent(\n new Event('dropdownopen', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n )\n }\n }\n\n protected override render(): TemplateResult {\n const classes: ClassInfo = {\n container: true,\n open: this.open,\n }\n\n return html` <div class=\"${classMap(classes)}\">${this.renderTrigger()} ${this.renderContent()}</div> `\n }\n\n protected renderTrigger(): TemplateResult {\n return html`\n <div class=\"trigger\" @click=\"${this.triggerClickHandler}\" @keydown=\"${this.triggerKeyDownHandler}\">\n <slot @slotchange=\"${this.triggerChanged}\"></slot>\n </div>\n `\n }\n\n protected renderContent(): TemplateResult {\n const contentStyles = this.overlayPositioning || {}\n return html`\n <div class=\"content\" style=\"${styleMap(contentStyles)}\">\n <slot\n name=\"dropdown\"\n @slotchange=\"${this.dropdownChanged}\"\n @keydown=\"${this.contentKeyDownHandler}\"\n @click=\"${this.contentClickHandler}\"\n @close=\"${this.contentCloseHandler}\"\n ></slot>\n </div>\n `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UiDropdownList.js","sourceRoot":"","sources":["../../../../../src/md/dropdown-list/internals/UiDropdownList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,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,IAAI,CAAC,mBAAmB;oBACxB,IAAI,CAAC,mBAAmB;;;KAGvC,CAAA;QACH,CAAC;;;AAlbH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8BA+ZC","sourcesContent":["import { randomString } from '@api-client/core/lib/math/Random.js'\nimport { html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { ClassInfo, classMap } from 'lit/directives/class-map.js'\nimport { StyleInfo, styleMap } from 'lit/directives/style-map.js'\nimport { positionOverlay, type HorizontalAlignment, type VerticalAlignment } from '../../../lib/ElementPositioning.js'\nimport * as ScrollHelper from '../../../lib/ScrollHelper.js'\n\nconst itemRole = ['menuitem', 'menuitemcheckbox', 'menuitemradio']\n\nexport interface UiDropdownListSelection {\n item: HTMLElement\n}\n\n/**\n * An overlay list rendered over a button.\n *\n * Examples:\n *\n * <ui-dropdown-list>\n * <ui-button color=\"filled\">Click me</ui-button>\n * <ui-list slot=\"dropdown\" role=\"menu\">\n * <ui-list-item role=\"menuitem\">Item 1</ui-list-item>\n * <ui-list-item role=\"menuitem\">Item 2</ui-list-item>\n * </ui-list>\n * </ui-dropdown-list>\n *\n * @slot - The default slot for the dropdown trigger (button)\n * @slot dropdown - The slot for the list.\n * @fires select - Custom event with the selected item on the `detail.item` when the user selected an item.\n * When the event is cancelled then there's no side effects (closing the dropdown)\n * @fires dropdownopen - An event informing other dropdowns that this one was opened and other should close.\n * @fires open - An event dispatched when the open state change through a user interaction\n */\nexport default class UiDropdownList extends LitElement {\n @queryAssignedElements()\n protected accessor triggers!: HTMLElement[]\n\n @queryAssignedElements({ slot: 'dropdown' })\n protected accessor dropdowns!: HTMLElement[]\n\n @state() protected accessor triggerId = `ui-trigger-${randomString(4)}`\n\n @state() protected accessor menuId = `ui-menu-${randomString(4)}`\n\n /**\n * Whether the menu is opened.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor open = false\n\n /**\n * The vertical (y-axis) alignment of the dropdown content.\n * - top\n * - bottom\n * - middle\n *\n * No value means the natural position according to the box model.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor verticalAlign: VerticalAlignment | undefined\n\n /**\n * The horizontal (x-axis) alignment of the dropdown content.\n * - top\n * - bottom\n * - middle\n *\n * No value means the natural position according to the box model.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor horizontalAlign: HorizontalAlignment | undefined\n\n /**\n * Affects the `horizontal` and `vertical` positioning so that the target element does not overlap with the anchor.\n * For example, when the `vertical` align is `top`, the top edge of the target will be rendered at the bottom\n * of the anchor down to the edge of the viewport.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor noOverlap: boolean | undefined\n\n /**\n * When set it closes the opened list when registering a click outside the list.\n * @attribute\n */\n @property({ type: Boolean }) accessor closeOnOutsideClick: boolean | undefined\n\n /**\n * When set it makes the drop-down to match the width of the trigger.\n * Be careful as this may crop the content when the trigger is not wide enough.\n * @attribute\n */\n @property({ type: Boolean }) accessor matchTriggerWidth: boolean | undefined\n\n /**\n * When set it closes the drop-down when `tab` button is pressed.\n * This is not a default behavior since the drop-down content can have its own logic\n * related to tab index.\n */\n @property({ type: Boolean }) accessor closeOnTab: boolean | undefined\n\n /**\n * The first element located in the default slot.\n */\n protected get trigger(): HTMLElement | null {\n const { triggers } = this\n if (!triggers || !triggers.length) {\n return null\n }\n const [button] = triggers\n return button\n }\n\n /**\n * The first element located in the \"dropdown\" slot.\n */\n protected get dropdown(): HTMLElement | null {\n const { dropdowns } = this\n if (!dropdowns || !dropdowns.length) {\n return null\n }\n const [content] = dropdowns\n return content\n }\n\n @state() protected accessor overlayPositioning: StyleInfo | undefined\n\n constructor() {\n super()\n this.dropdownOpenHandler = this.dropdownOpenHandler.bind(this)\n this.scrollHandler = this.scrollHandler.bind(this)\n this.clickHandler = this.clickHandler.bind(this)\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n window.addEventListener('dropdownopen', this.dropdownOpenHandler)\n window.addEventListener('click', this.clickHandler, { capture: true })\n ScrollHelper.addListeners(this, this.scrollHandler)\n\n this.setAttribute('aria-haspopup', 'menu')\n this.setAttribute('aria-expanded', 'false')\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n window.removeEventListener('dropdownopen', this.dropdownOpenHandler)\n window.removeEventListener('click', this.clickHandler, { capture: true })\n ScrollHelper.removeListeners(this)\n }\n\n protected dropdownOpenHandler(e: Event): void {\n if (e.composedPath()[0] === this) {\n return\n }\n this.close()\n }\n\n protected override willUpdate(cp: PropertyValues<this>): void {\n super.willUpdate(cp)\n if ((cp.has('noOverlap') || cp.has('verticalAlign') || cp.has('horizontalAlign') || cp.has('open')) && this.open) {\n this.computePositioning()\n }\n }\n\n protected override updated(cp: PropertyValues<this>): void {\n super.updated(cp)\n if (cp.has('open')) {\n this.toggleOpened()\n this.updateExpanded()\n // this.manageTabindex()\n }\n }\n\n protected updateExpanded(): void {\n this.setAttribute('aria-expanded', String(this.open))\n }\n\n protected triggerChanged(): void {\n const { trigger } = this\n if (!trigger) {\n return\n }\n this.decorateTrigger(trigger)\n }\n\n protected dropdownChanged(): void {\n const { dropdown } = this\n if (!dropdown) {\n return\n }\n this.decorateDropdown(dropdown)\n }\n\n /**\n * Decorates the trigger with aria attributes.\n */\n protected decorateTrigger(button: HTMLElement): void {\n button.setAttribute('aria-controls', this.menuId)\n button.setAttribute('tabindex', '0')\n if (button.id) {\n this.triggerId = button.id\n } else {\n button.id = this.triggerId\n }\n }\n\n protected decorateDropdown(list: HTMLElement): void {\n if (!list.hasAttribute('role')) {\n list.setAttribute('role', 'menu')\n }\n if (!list.hasAttribute('aria-labelledby')) {\n list.setAttribute('aria-labelledby', this.triggerId)\n }\n list.setAttribute('tabindex', '-1')\n list.id = this.menuId\n }\n\n protected triggerClickHandler(): void {\n this.open = !this.open\n this.notifyOpen()\n }\n\n protected triggerKeyDownHandler(e: KeyboardEvent): void {\n if (['Enter', 'Space', 'ArrowDown', 'ArrowUp'].includes(e.code)) {\n e.preventDefault()\n this.open = true\n this.notifyOpen()\n }\n }\n\n protected contentKeyDownHandler(e: KeyboardEvent): void {\n if (e.defaultPrevented) {\n return\n }\n if (e.code === 'Escape') {\n this.close()\n } else if (e.code === 'Tab') {\n if (this.closeOnTab) {\n this.close()\n }\n } else if (['Enter', 'Space'].includes(e.code)) {\n this.activate(e)\n }\n }\n\n protected contentClickHandler(e: PointerEvent): void {\n this.activate(e)\n }\n\n close(): void {\n this.open = false\n this.notifyOpen()\n }\n\n protected contentCloseHandler(e: Event): void {\n e.stopPropagation()\n this.close()\n }\n\n /**\n * Since the container for the dropdown content is positioned as fixed\n * we need to position the dropdown according to the configured rules.\n */\n protected computePositioning(): void {\n const { trigger, dropdown } = this\n if (!trigger || !dropdown) {\n return\n }\n this.overlayPositioning = positionOverlay(dropdown, trigger, {\n horizontal: this.horizontalAlign,\n vertical: this.verticalAlign,\n noOverlap: this.noOverlap,\n constrain: true,\n constrainPaddingY: 20,\n matchAnchorWidth: this.matchTriggerWidth,\n })\n }\n\n protected scrollHandler(): void {\n if (this.open) {\n this.computePositioning()\n }\n }\n\n protected clickHandler(e: Event): void {\n if (!this.open || !this.closeOnOutsideClick) {\n return\n }\n const inside = e.composedPath().some((i) => i === this)\n if (inside) {\n return\n }\n this.close()\n }\n\n protected toggleOpened(): void {\n const { open } = this\n if (open) {\n this.handleOpened()\n } else {\n this.handleClosed()\n }\n }\n\n /**\n * When set, it is the last active child of the dropdown\n * before the tabindex was removed from it. It is used to restore focus\n * when the dropdown is re-opened.\n */\n lastActiveChild?: HTMLElement\n\n /**\n * When the list is closed, the tabindex of the dropdown is removed to prevent\n * it from being focused while invisible.\n */\n protected manageTabindex(): void {\n const { dropdown } = this\n if (!dropdown) {\n return\n }\n if (this.open) {\n if (this.lastActiveChild) {\n this.lastActiveChild.setAttribute('tabindex', '0')\n this.lastActiveChild.focus()\n this.lastActiveChild = undefined\n } else {\n // If no last active child, focus the dropdown itself\n dropdown.setAttribute('tabindex', '0')\n }\n } else {\n // const activeChild = dropdown.querySelector(':focus') || dropdown\n // this.lastActiveChild = activeChild as HTMLElement\n // activeChild.removeAttribute('tabindex')\n // this.trigger?.focus()\n }\n }\n\n protected handleOpened(): void {\n const { trigger, dropdown } = this\n if (trigger) {\n trigger.removeAttribute('tabindex')\n }\n if (this.lastActiveChild) {\n this.lastActiveChild.setAttribute('tabindex', '0')\n this.lastActiveChild.focus()\n this.lastActiveChild = undefined\n } else if (dropdown) {\n dropdown.setAttribute('tabindex', '0')\n dropdown.focus()\n }\n }\n\n protected handleClosed(): void {\n const { trigger, dropdown } = this\n if (trigger) {\n trigger.setAttribute('tabindex', '0')\n trigger.focus()\n }\n if (dropdown) {\n const activeChild = dropdown.querySelector('[tabindex=\"0\"]')\n if (activeChild) {\n this.lastActiveChild = activeChild as HTMLElement\n activeChild.removeAttribute('tabindex')\n }\n dropdown.removeAttribute('tabindex')\n }\n }\n\n protected activate(e: Event): void {\n // if (e.defaultPrevented) {\n // We now cancel the event in the menu list\n // return\n // }\n const path = e.composedPath()\n let item: HTMLElement | undefined\n while (!item) {\n const next = path.shift() as Element\n if (next === this) {\n break\n }\n if (next.nodeType !== Node.ELEMENT_NODE) {\n continue\n }\n if (itemRole.includes(next.getAttribute('role') || '')) {\n item = next as HTMLElement\n }\n }\n if (!item) {\n return\n }\n const event = new CustomEvent<UiDropdownListSelection>('select', {\n cancelable: true,\n // composed: true,\n detail: {\n item,\n },\n })\n this.dispatchEvent(event)\n if (event.defaultPrevented) {\n return\n }\n this.close()\n }\n\n protected notifyOpen(): void {\n this.dispatchEvent(new Event('open'))\n if (this.open) {\n this.dispatchEvent(\n new Event('dropdownopen', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n )\n }\n }\n\n protected override render(): TemplateResult {\n const classes: ClassInfo = {\n container: true,\n open: this.open,\n }\n\n return html` <div class=\"${classMap(classes)}\">${this.renderTrigger()} ${this.renderContent()}</div> `\n }\n\n protected renderTrigger(): TemplateResult {\n return html`\n <div class=\"trigger\" @click=\"${this.triggerClickHandler}\" @keydown=\"${this.triggerKeyDownHandler}\">\n <slot @slotchange=\"${this.triggerChanged}\"></slot>\n </div>\n `\n }\n\n protected renderContent(): TemplateResult {\n const contentStyles = this.overlayPositioning || {}\n return html`\n <div class=\"content\" style=\"${styleMap(contentStyles)}\">\n <slot\n name=\"dropdown\"\n @slotchange=\"${this.dropdownChanged}\"\n @keydown=\"${this.contentKeyDownHandler}\"\n @click=\"${this.contentClickHandler}\"\n @close=\"${this.contentCloseHandler}\"\n ></slot>\n </div>\n `\n }\n}\n"]}
|
|
@@ -10,17 +10,23 @@ import '../icons/ui-icon.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export default abstract class Input extends UiElement {
|
|
12
12
|
#private;
|
|
13
|
+
static shadowRootOptions: {
|
|
14
|
+
delegatesFocus: boolean;
|
|
15
|
+
mode: ShadowRootMode;
|
|
16
|
+
serializable?: boolean;
|
|
17
|
+
slotAssignment?: SlotAssignmentMode;
|
|
18
|
+
};
|
|
13
19
|
static readonly formAssociated = true;
|
|
14
20
|
get form(): HTMLFormElement | null;
|
|
15
21
|
/**
|
|
16
22
|
* @attribute
|
|
17
23
|
*/
|
|
18
24
|
accessor type: SupportedInputTypes;
|
|
25
|
+
get disabled(): boolean;
|
|
19
26
|
/**
|
|
20
|
-
*
|
|
27
|
+
* When set, the input is a disabled state.
|
|
21
28
|
* @attribute
|
|
22
29
|
*/
|
|
23
|
-
get disabled(): boolean;
|
|
24
30
|
set disabled(value: boolean);
|
|
25
31
|
/**
|
|
26
32
|
* The name of the form control, submitted as a pair with the control's value as part of the form data.
|
|
@@ -283,7 +289,6 @@ export default abstract class Input extends UiElement {
|
|
|
283
289
|
* to screen readers.
|
|
284
290
|
*/
|
|
285
291
|
protected accessor refreshErrorAlert: boolean;
|
|
286
|
-
protected removingTabindex: boolean;
|
|
287
292
|
get files(): FileList | null;
|
|
288
293
|
/**
|
|
289
294
|
* When set it adds a `<datalist>` element to the input.
|
|
@@ -410,7 +415,6 @@ export default abstract class Input extends UiElement {
|
|
|
410
415
|
handleClick(): void;
|
|
411
416
|
protected handleFocus(): void;
|
|
412
417
|
protected handleBlur(): void;
|
|
413
|
-
private checkNativeValidity;
|
|
414
418
|
private checkValidityAndDispatch;
|
|
415
419
|
/**
|
|
416
420
|
* @returns `true` when the label is in resting state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/md/input/Input.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/md/input/Input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAI/E,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1G,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,kCAAkC,CAAA;AACzC,OAAO,qBAAqB,CAAA;AAI5B;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,KAAM,SAAQ,SAAS;;IACnD,OAAgB,iBAAiB;;;;;MAA4D;IAK7F,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAO;IAIrC,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAED;;OAEG;IACwC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;IAE7E,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,IACI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAK1B;IAED;;;OAGG;IACyB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAE7D;;;;;OAKG;IACyB,QAAQ,CAAC,KAAK,SAAK;IAE/C;;;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AAI,OAAO;IAKhC,SAAS,CAAC,eAAe,IAAI,MAAM;IAMnC,SAAS,CAAC,iBAAiB,IAAI,MAAM;IAKrC,SAAS,CAAC,QAAQ,IAAI,OAAO;IAI7B,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAc9C,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAO9C,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B,SAAS,CAAC,cAAc,IAAI,MAAM;IAKlC,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAiBtC,SAAS,KAAK,aAAa,IAAI,mBAAmB,CAOjD;cAEkB,MAAM,IAAI,cAAc;IAsB3C,SAAS,CAAC,YAAY,IAAI,cAAc;IAUxC,SAAS,CAAC,YAAY,IAAI,cAAc;IAUxC,SAAS,CAAC,UAAU,IAAI,cAAc;IAItC,SAAS,CAAC,WAAW,IAAI,cAAc;IAQvC,SAAS,CAAC,eAAe,IAAI,cAAc;IAI3C,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,cAAc;IAEhD,SAAS,CAAC,oBAAoB,IAAI,cAAc;IAIhD,SAAS,CAAC,yBAAyB,IAAI,cAAc,GAAG,OAAO,OAAO;IAiBtE,SAAS,CAAC,aAAa,IAAI,cAAc;IAQzC,SAAS,CAAC,qBAAqB,IAAI,cAAc,GAAG,OAAO,OAAO;IAkBlE,SAAS,CAAC,cAAc,IAAI,cAAc,GAAG,OAAO,OAAO;CAO5D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
import { html, nothing } from 'lit';
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
3
|
import { property, queryAssignedElements, state } from 'lit/decorators.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
-
import { isDisabled, setDisabled } from '../../lib/disabled.js';
|
|
7
6
|
import { UiElement } from '../UiElement.js';
|
|
7
|
+
import { isDisabled, setDisabled } from '../../lib/disabled.js';
|
|
8
8
|
import '../icon-button/ui-icon-button.js';
|
|
9
9
|
import '../icons/ui-icon.js';
|
|
10
10
|
const floatTypes = ['date', 'color', 'datetime-local', 'file', 'month', 'time', 'week'];
|
|
@@ -219,6 +219,7 @@ let Input = (() => {
|
|
|
219
219
|
__esDecorate(this, null, _list_decorators, { kind: "accessor", name: "list", static: false, private: false, access: { has: obj => "list" in obj, get: obj => obj.list, set: (obj, value) => { obj.list = value; } }, metadata: _metadata }, _list_initializers, _list_extraInitializers);
|
|
220
220
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
221
221
|
}
|
|
222
|
+
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
222
223
|
#_userInteracted = __runInitializers(this, _instanceExtraInitializers);
|
|
223
224
|
// static override shadowRootOptions: ShadowRootInit = {mode: 'open', delegatesFocus: true};
|
|
224
225
|
static formAssociated = true;
|
|
@@ -232,27 +233,18 @@ let Input = (() => {
|
|
|
232
233
|
*/
|
|
233
234
|
get type() { return this.#type_accessor_storage; }
|
|
234
235
|
set type(value) { this.#type_accessor_storage = value; }
|
|
235
|
-
/**
|
|
236
|
-
* Disables the input.
|
|
237
|
-
* @attribute
|
|
238
|
-
*/
|
|
239
236
|
get disabled() {
|
|
240
237
|
return isDisabled(this);
|
|
241
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* When set, the input is a disabled state.
|
|
241
|
+
* @attribute
|
|
242
|
+
*/
|
|
242
243
|
set disabled(value) {
|
|
243
244
|
const old = isDisabled(this);
|
|
244
245
|
setDisabled(this, value);
|
|
245
246
|
this.requestUpdate('disabled', old);
|
|
246
247
|
this._updateFormValue();
|
|
247
|
-
if (value) {
|
|
248
|
-
this.dataset.tabindex = this.getAttribute('tabindex') || '0';
|
|
249
|
-
this.removeAttribute('tabindex');
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
const index = this.dataset.tabindex || '0';
|
|
253
|
-
this.setAttribute('tabindex', index);
|
|
254
|
-
this.blur();
|
|
255
|
-
}
|
|
256
248
|
}
|
|
257
249
|
#name_accessor_storage = (__runInitializers(this, _type_extraInitializers), __runInitializers(this, _name_initializers, void 0));
|
|
258
250
|
/**
|
|
@@ -760,7 +752,6 @@ let Input = (() => {
|
|
|
760
752
|
* This is private so the password can be viewed only through user interaction.
|
|
761
753
|
*/
|
|
762
754
|
#showPassword = (__runInitializers(this, _refreshErrorAlert_extraInitializers), false);
|
|
763
|
-
removingTabindex = false;
|
|
764
755
|
get files() {
|
|
765
756
|
return this.getNativeValue('files');
|
|
766
757
|
}
|
|
@@ -1038,32 +1029,13 @@ let Input = (() => {
|
|
|
1038
1029
|
return;
|
|
1039
1030
|
}
|
|
1040
1031
|
this.focused = true;
|
|
1041
|
-
this.removingTabindex = true;
|
|
1042
|
-
// Note, the input is automatically focused when form is being submitted and
|
|
1043
|
-
// it won't pass validation. In this case the form will throw an error
|
|
1044
|
-
// as the input is not focusable. In overall, this still works with forms and validation.
|
|
1045
|
-
if (this.checkNativeValidity()) {
|
|
1046
|
-
this.dataset.tabindex = this.getAttribute('tabindex') || '0';
|
|
1047
|
-
this.removeAttribute('tabindex');
|
|
1048
|
-
}
|
|
1049
|
-
input.focus();
|
|
1050
|
-
this.#_userInteracted = true;
|
|
1051
|
-
setTimeout(() => {
|
|
1052
|
-
this.removingTabindex = false;
|
|
1053
|
-
}, 1);
|
|
1054
1032
|
}
|
|
1055
1033
|
handleBlur() {
|
|
1056
|
-
if (this.matches(':focus-within')
|
|
1034
|
+
if (this.matches(':focus-within')) {
|
|
1057
1035
|
// Changing focus to another child within the text field, like a button
|
|
1058
1036
|
return;
|
|
1059
1037
|
}
|
|
1060
1038
|
this.focused = false;
|
|
1061
|
-
const index = this.dataset.tabindex || '0';
|
|
1062
|
-
delete this.dataset.tabindex;
|
|
1063
|
-
this.setAttribute('tabindex', index);
|
|
1064
|
-
}
|
|
1065
|
-
checkNativeValidity() {
|
|
1066
|
-
return this.input?.validity.valid ?? true;
|
|
1067
1039
|
}
|
|
1068
1040
|
checkValidityAndDispatch() {
|
|
1069
1041
|
const valid = this.input?.checkValidity() ?? true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/md/input/Input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAkC,MAAM,KAAK,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,kCAAkC,CAAA;AACzC,OAAO,qBAAqB,CAAA;AAE5B,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;;sBAM3C,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAvB,KAAM,SAAQ,WAAS;;;gCAgBlD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAUzC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gCAoB1C,QAAQ,CAAC,EAAE,IAAI,EAAE,M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AAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAA,8BAA8B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA,kBAAkB,CAAC,aAAa,CAAC,cAAc,CAAA;QAC9G,CAAC;;;AAx9BH;;;GAGG;AACH","sourcesContent":["import { html, nothing, PropertyValues, TemplateResult } from 'lit'\nimport { property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { SupportedAutocapitalize, SupportedAutocomplete, SupportedInputTypes } from '../../types/input.js'\nimport { ARIAAutoComplete, ARIAExpanded, ARIARole } from '../../types/role.js'\nimport { isDisabled, setDisabled } from '../../lib/disabled.js'\nimport { UiElement } from '../UiElement.js'\nimport '../icon-button/ui-icon-button.js'\nimport '../icons/ui-icon.js'\n\nconst floatTypes = ['date', 'color', 'datetime-local', 'file', 'month', 'time', 'week']\n\n/**\n * @slot prefix - A slot in which to render prefixes of the input\n * @slot suffix - A slot in which to render suffixes of the input\n */\nexport default abstract class Input extends UiElement {\n #_userInteracted: boolean\n\n // static override shadowRootOptions: ShadowRootInit = {mode: 'open', delegatesFocus: true};\n\n static readonly formAssociated = true\n\n #_internals = this.attachInternals()\n\n get form(): HTMLFormElement | null {\n return this.#_internals && this.#_internals.form\n }\n\n /**\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor type: SupportedInputTypes\n\n /**\n * Disables the input.\n * @attribute\n */\n get disabled(): boolean {\n return isDisabled(this)\n }\n\n @property({ reflect: true, type: Boolean })\n set disabled(value: boolean) {\n const old = isDisabled(this)\n setDisabled(this, value)\n this.requestUpdate('disabled', old)\n this._updateFormValue()\n if (value) {\n this.dataset.tabindex = this.getAttribute('tabindex') || '0'\n this.removeAttribute('tabindex')\n } else {\n const index = this.dataset.tabindex || '0'\n this.setAttribute('tabindex', index)\n this.blur()\n }\n }\n\n /**\n * The name of the form control, submitted as a pair with the control's value as part of the form data.\n * @attribute\n */\n @property({ type: String }) accessor name: string | undefined\n\n /**\n * When a form is submitted, only checkboxes which are currently checked are submitted to the server,\n * and the reported value is the `value` of the value attribute.\n * If the `value` is not otherwise specified, it is the string `on` by default.\n * @attribute\n */\n @property({ type: String }) accessor value = ''\n\n /**\n * Set to true to mark the input element as required.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n accessor required: boolean | undefined\n\n /**\n * While the element can be easily styled with the `:valid` and `:invalid` pseudo classes\n * it also exposes an attribute to style the element as invalid. This attribute changes\n * when the element validation is performed.\n *\n * Calling `reportValidity()` will automatically update `invalid`.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor invalid: boolean | undefined\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * Calling `reportValidity()` will automatically update `errorText` to the\n * native `validationMessage`.\n * @attribute\n */\n @property({ type: String }) accessor invalidText = ''\n\n /**\n * The label to be rendered with the input.\n * @attribute\n */\n @property({ type: String }) accessor label: string | undefined\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n * @attribute\n */\n @property({ type: Boolean }) accessor hasPrefix = false\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n * @attribute\n */\n @property({ type: Boolean }) accessor hasSuffix = false\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n * @attribute\n */\n @property({ type: String }) accessor supportingText = ''\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n * @attribute\n */\n @property({ type: String }) accessor textDirection = ''\n\n /**\n * When set the label of the input disappears after input rather than float over the input.\n * @attribute\n */\n @property({ type: Boolean }) accessor noFloating: boolean | undefined\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n * @attribute\n */\n @property({ type: String }) accessor max: number | string = ''\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n * @attribute\n */\n @property({ type: Number }) accessor maxLength = -1\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n * @attribute\n */\n @property({ type: String }) accessor min: number | string = ''\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n * @attribute\n */\n @property({ type: Number }) accessor minLength: number | undefined\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n * @attribute\n */\n @property({ type: String }) accessor pattern = ''\n\n /**\n * @attribute\n */\n @property({ type: String }) accessor placeholder = ''\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n *\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor readOnly = false\n\n /**\n * Bind the `<input>`'s `autocomplete` property.\n * @default off\n * @attribute\n */\n @property({ type: String }) accessor autocomplete: SupportedAutocomplete = 'off'\n\n /**\n * Binds this to the `<input>`'s `inputMode` property.\n * @attribute\n */\n @property({ type: String }) override accessor inputMode = ''\n\n /**\n * Binds this to the `<input>`'s `autocapitalize` property.\n *\n * Possible values are:\n *\n * - `off` or `none`: No auto-capitalization is applied (all letters default to lowercase)\n * - `on` or `sentences`: The first letter of each sentence defaults to a capital letter;\n * all other letters default to lowercase\n * - `words`: The first letter of each word defaults to a capital letter; all other letters default to lowercase\n * - `characters`: All letters should default to uppercase\n *\n * @default off\n * @attr\n */\n override autocapitalize: SupportedAutocapitalize = 'off'\n\n /**\n * Binds this to the `<input>`'s `accept` property,\n * used with type=file.\n * @attribute\n */\n @property({ type: String }) accessor accept: string | undefined\n\n /**\n * Binds this to the`<input>`'s `multiple` property,\n * used with type=file.\n * @attribute\n */\n @property({ type: Boolean }) accessor multiple: boolean | undefined\n\n /**\n * Binds this to the `<input>`'s `size` property.\n * @attribute\n */\n @property({ type: Number }) accessor size: number | undefined\n\n protected pendingSetters = new Map<keyof HTMLInputElement, unknown>()\n\n private setNativeValue(key: keyof HTMLInputElement, value: unknown): void {\n const { input } = this\n if (input) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(input as any)[key] = value\n } else {\n this.pendingSetters.set(key, value)\n }\n }\n\n private getNativeValue(key: keyof HTMLInputElement): unknown {\n const { input } = this\n if (input) {\n return input[key]\n }\n return this.pendingSetters.get(key) || null\n }\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection(): 'forward' | 'backward' | 'none' | null {\n return this.getNativeValue('selectionDirection') as 'forward' | 'backward' | 'none' | null\n }\n\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n this.setNativeValue('selectionDirection', value)\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd(): number | null {\n return this.getNativeValue('selectionEnd') as number | null\n }\n\n set selectionEnd(value: number | null) {\n this.setNativeValue('selectionEnd', value)\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart(): number | null {\n return this.getNativeValue('selectionStart') as number | null\n }\n\n set selectionStart(value: number | null) {\n this.setNativeValue('selectionStart', value)\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n * @attribute\n */\n @property({ type: Number }) accessor step = 1\n\n /**\n * Returns the native validation error message that would be displayed upon\n * calling `reportValidity()`.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage\n */\n get validationMessage(): string {\n return (this.getNativeValue('validationMessage') as string | null) ?? ''\n }\n\n /**\n * Returns a ValidityState object that represents the validity states of the\n * text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validity\n */\n get validity(): ValidityState {\n return (this.getNativeValue('validity') as ValidityState | null) ?? this.#_internals.validity\n }\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber(): number {\n return (this.getNativeValue('valueAsNumber') as number | null) ?? 0\n }\n\n set valueAsNumber(value: number) {\n this.setNativeValue('valueAsNumber', value)\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate(): Date | null {\n return this.getNativeValue('valueAsDate') as Date | null\n }\n\n set valueAsDate(value: Date | null) {\n this.setNativeValue('valueAsDate', value)\n }\n\n /**\n * Returns whether an element will successfully validate based on forms\n * validation rules and constraints.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/willValidate\n */\n get willValidate(): boolean {\n return (this.getNativeValue('willValidate') as boolean | null) ?? false\n }\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() protected accessor dirty = false\n\n @state() protected accessor focused = false\n\n get input(): HTMLInputElement | null {\n return this.shadowRoot?.querySelector('.input') ?? null\n }\n\n @queryAssignedElements({ slot: 'prefix' }) private accessor prefixes!: Element[]\n\n @queryAssignedElements({ slot: 'suffix' }) private accessor suffixes!: Element[]\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() protected accessor nativeErrorText = ''\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() protected accessor nativeError = false\n\n private readonly counterId = 'counter'\n\n private readonly supportingTextId = 'support'\n\n private readonly labelId = 'support'\n\n @property({ type: String, attribute: 'data-aria-autocomplete', noAccessor: true })\n override accessor ariaAutoComplete: ARIAAutoComplete | null = null\n\n @property({ type: String, attribute: 'data-aria-controls', noAccessor: true })\n accessor ariaControls: string | null = null\n\n @property({ type: String, attribute: 'data-aria-activedescendant', noAccessor: true })\n accessor ariaActiveDescendant: string | null = null\n\n @property({ type: String, attribute: 'data-aria-expanded', noAccessor: true })\n override accessor ariaExpanded: ARIAExpanded | null = null\n\n /**\n * The `aria-label` of the text field's input.\n */\n @property({ type: String, attribute: 'data-aria-label', noAccessor: true })\n override accessor ariaLabel!: string\n\n /**\n * The `aria-labelledby` of the text field's input.\n *\n * Note: currently only usable in SSR light DOM.\n */\n @property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true })\n accessor ariaLabelledBy!: string\n\n @property({ type: String, attribute: 'data-role', noAccessor: true })\n accessor dataRole: ARIARole | null = null\n\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() protected accessor refreshErrorAlert = false\n\n /**\n * When set is shows password in the `password` input.\n * This is private so the password can be viewed only through user interaction.\n */\n #showPassword = false\n\n protected removingTabindex = false\n\n get files(): FileList | null {\n return this.getNativeValue('files') as FileList | null\n }\n\n /**\n * When set it adds a `<datalist>` element to the input.\n */\n @property({ type: Array }) accessor list: string[] | undefined\n\n constructor() {\n super()\n this.type = 'text'\n this.#_userInteracted = false\n this.actionController.cancelKeyboardEvents = false\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('focus', this.handleFocus.bind(this))\n this.addEventListener('blur', this.handleBlur.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n if (!this.hasAttribute('tabindex') && !this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n this.handleSlotChange()\n }\n\n /**\n * When form-associated custom elements are supported in the browser it\n * is called when the form has been reset\n */\n formResetCallback(): void {\n this.value = ''\n }\n\n /**\n * When form-associated custom elements are supported in the browser it\n * is called when the form state has been restored\n *\n * @param formState Restored value\n */\n formStateRestoreCallback(formState?: string): void {\n this.value = formState ?? ''\n }\n\n protected override willUpdate(cp: PropertyValues<this>): void {\n if (cp.has('required')) {\n this._updateFormValue()\n }\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties)\n if (changedProperties.has('value')) {\n this._updateFormValue()\n }\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false\n })\n }\n }\n\n protected _updateFormValue(): void {\n const { value = '', disabled } = this\n if (!value || disabled) {\n this.#_internals.setFormValue(null)\n } else {\n this.#_internals.setFormValue(value)\n }\n this._updateValidationState()\n }\n\n protected _updateValidationState(): void {\n const { input } = this\n if (!input) {\n return\n }\n const { validationMessage, validity } = input\n if (!validity.valid) {\n this.#_internals.setValidity(\n {\n valueMissing: validity.valueMissing,\n badInput: validity.badInput,\n patternMismatch: validity.patternMismatch,\n rangeOverflow: validity.rangeOverflow,\n rangeUnderflow: validity.rangeUnderflow,\n stepMismatch: validity.stepMismatch,\n tooLong: validity.tooLong,\n tooShort: validity.tooShort,\n typeMismatch: validity.typeMismatch,\n customError: validity.customError,\n },\n validationMessage\n )\n return\n }\n\n this.#_internals.setValidity({})\n }\n\n protected invalidHandler(e: Event): void {\n this.retargetEvent(e)\n if (!this.#_userInteracted) {\n return\n }\n this.invalid = true\n }\n\n protected handleSlotChange(): void {\n this.hasPrefix = this.prefixes.length > 0\n this.hasSuffix = this.suffixes.length > 0\n }\n\n protected getInputValue(): string {\n if (this.type === 'color') {\n return this.value || '#000000'\n }\n return this.value || ''\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n checkValidity(): boolean {\n this.#_userInteracted = true\n const { valid } = this.checkValidityAndDispatch()\n this.invalid = !valid\n return valid\n }\n\n /**\n * Focuses the text field's input text.\n */\n override focus(): void {\n if (this.disabled || this.matches(':focus-within')) {\n return\n }\n this.input?.focus()\n }\n\n /**\n * Un-focuses the text field.\n */\n override blur(): void {\n this.input?.blur()\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * This method will display or clear an error text message equal to the text\n * field's `validationMessage`, unless the invalid event is canceled.\n *\n * Use `setCustomValidity()` to customize the `validationMessage`.\n *\n * This method can also be used to re-announce error messages to screen\n * readers.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n reportValidity(): boolean {\n this.#_userInteracted = true\n const { valid, canceled } = this.checkValidityAndDispatch()\n this._updateValidationState()\n if (!canceled) {\n this.invalid = !valid\n const prevMessage = this.getErrorText()\n this.nativeError = !valid\n this.nativeErrorText = this.validationMessage\n\n const needsRefresh = this.shouldErrorAnnounce() && prevMessage === this.getErrorText()\n if (needsRefresh) {\n this.refreshErrorAlert = true\n }\n }\n\n return valid\n }\n\n protected shouldErrorAnnounce(): boolean {\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n return this.getError() && !!this.getErrorText() && !this.refreshErrorAlert\n }\n\n protected getErrorText(): string {\n return this.invalidText || this.nativeErrorText\n }\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select(): void {\n this.input?.select()\n }\n\n /**\n * Sets the text field's native validation error message. This is used to\n * customize `validationMessage`.\n *\n * When the error is not an empty string, the text field is considered invalid\n * and `validity.customError` will be true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity\n *\n * @param error The error message to display.\n */\n setCustomValidity(error: string): void {\n this.input?.setCustomValidity(error)\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void\n\n setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void\n\n setRangeText(...args: unknown[]): void {\n const { input } = this\n if (!input) {\n return\n }\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n input.setRangeText(...(args as Parameters<HTMLInputElement['setRangeText']>))\n this.value = input.value\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void {\n this.input?.setSelectionRange(start, end, direction)\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number): void {\n const { input } = this\n if (!input) {\n return\n }\n input.stepDown(stepDecrement)\n this.value = input.value\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number): void {\n const { input } = this\n if (!input) {\n return\n }\n input.stepUp(stepIncrement)\n this.value = input.value\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset(): void {\n this.dirty = false\n this.value = ''\n }\n\n override handleClick(): void {\n this.focus()\n }\n\n protected handleFocus(): void {\n const { input } = this\n if (this.disabled || !input) {\n return\n }\n this.focused = true\n this.removingTabindex = true\n // Note, the input is automatically focused when form is being submitted and\n // it won't pass validation. In this case the form will throw an error\n // as the input is not focusable. In overall, this still works with forms and validation.\n if (this.checkNativeValidity()) {\n this.dataset.tabindex = this.getAttribute('tabindex') || '0'\n this.removeAttribute('tabindex')\n }\n input.focus()\n this.#_userInteracted = true\n setTimeout(() => {\n this.removingTabindex = false\n }, 1)\n }\n\n protected handleBlur(): void {\n if (this.matches(':focus-within') || this.removingTabindex) {\n // Changing focus to another child within the text field, like a button\n return\n }\n this.focused = false\n const index = this.dataset.tabindex || '0'\n delete this.dataset.tabindex\n this.setAttribute('tabindex', index)\n }\n\n private checkNativeValidity(): boolean {\n return this.input?.validity.valid ?? true\n }\n\n private checkValidityAndDispatch(): { valid: boolean; canceled: boolean } {\n const valid = this.input?.checkValidity() ?? true\n let canceled = false\n if (!valid) {\n canceled = !this.dispatchEvent(new Event('invalid', { cancelable: true }))\n }\n return { valid, canceled }\n }\n\n /**\n * @returns `true` when the label is in resting state.\n */\n protected labelResting(): boolean {\n const { value } = this\n if (!!value || String(value) === '0') {\n return false\n }\n if (floatTypes.includes(this.type || '')) {\n return false\n }\n return !this.placeholder && !this.focused\n }\n\n /**\n * @returns `true` when the label should be hidden\n */\n protected labelHidden(): boolean {\n const { noFloating } = this\n return !this.labelResting() && !!noFloating\n }\n\n protected renderLabelText(): string {\n const labelText = this.label ?? ''\n const optionalAsterisk = this.required && labelText ? '*' : ''\n return labelText + optionalAsterisk\n }\n\n protected getSupportingText(): string {\n const errorText = this.getErrorText()\n return this.getError() && errorText ? errorText : this.supportingText\n }\n\n protected getError(): boolean {\n return this.invalid || this.nativeError\n }\n\n protected retargetEvent(event: Event): boolean {\n if (event.bubbles && (!this.shadowRoot || event.composed)) {\n event.stopPropagation()\n }\n\n const copy = Reflect.construct(event.constructor, [event.type, event])\n const dispatched = this.dispatchEvent(copy)\n if (!dispatched) {\n event.preventDefault()\n }\n\n return dispatched\n }\n\n protected handleInput(event: InputEvent): void {\n this.dirty = true\n this.value = (event.target as HTMLInputElement).value\n this.retargetEvent(event)\n this.reportValidity()\n }\n\n protected hasCounter(): boolean {\n return this.maxLength > -1\n }\n\n protected getCounterText(): string {\n const { length } = this.value || ''\n return `${length} / ${this.maxLength || 0}`\n }\n\n protected getAriaDescribedBy(): string {\n const hasSupport = !!this.getSupportingText()\n if (hasSupport) {\n return this.supportingTextId\n }\n const hasCounter = this.hasCounter()\n if (hasCounter) {\n return this.counterId\n }\n return ''\n }\n\n #handlePasswordToggle(): void {\n this.#showPassword = !this.#showPassword\n this.requestUpdate()\n }\n\n protected get effectiveType(): SupportedInputTypes {\n const { type } = this\n if (type !== 'password') {\n return type\n }\n const visible = this.#showPassword\n return visible ? 'text' : 'password'\n }\n\n protected override render(): TemplateResult {\n const { pressed = false } = this\n const labelResting = this.labelResting()\n const containerClasses = classMap({\n surface: true,\n pressed,\n labelResting,\n labelActive: !labelResting,\n labelHidden: this.labelHidden(),\n })\n return html`\n <div class=\"${containerClasses}\">\n <div class=\"container\"></div>\n <div class=\"content\">\n ${this.renderPrefix()} ${this.renderBody()} ${this.renderPasswordControl()} ${this.renderSuffix()}\n ${this.renderHighlight()}\n </div>\n </div>\n ${this.renderSupportingText()} ${this.renderDataList()}\n `\n }\n\n protected renderPrefix(): TemplateResult {\n const classes = classMap({\n start: true,\n prefixed: this.hasPrefix,\n })\n return html` <div class=\"${classes}\">\n <slot name=\"prefix\" @slotchange=${this.handleSlotChange}></slot>\n </div>`\n }\n\n protected renderSuffix(): TemplateResult {\n const classes = classMap({\n end: true,\n suffixed: this.hasSuffix,\n })\n return html` <div class=\"${classes}\">\n <slot name=\"suffix\" @slotchange=${this.handleSlotChange}></slot>\n </div>`\n }\n\n protected renderBody(): TemplateResult {\n return html` <div class=\"body\">${this.renderLabel()} ${this.renderInput()}</div> `\n }\n\n protected renderLabel(): TemplateResult {\n const label = this.renderLabelText()\n if (!label) {\n return html``\n }\n return html` <span class=\"label\" id=\"${this.labelId}\" title=\"label\">${label}</span> `\n }\n\n protected renderHighlight(): TemplateResult {\n return html` <span class=\"highlight\"></span> `\n }\n\n protected abstract renderInput(): TemplateResult\n\n protected renderSupportingText(): TemplateResult {\n return html` <span class=\"supporting-text\"> ${this.renderSupportingTextValue()} ${this.renderCounter()} </span> `\n }\n\n protected renderSupportingTextValue(): TemplateResult | typeof nothing {\n const text = this.getSupportingText()\n if (!text) {\n return nothing\n }\n const shouldAlert = this.shouldErrorAnnounce()\n return html`\n <span\n class=\"supporting-text-start\"\n id=\"${this.supportingTextId}\"\n role=${ifDefined(shouldAlert ? 'alert' : undefined)}\n >\n ${text}\n </span>\n `\n }\n\n protected renderCounter(): TemplateResult {\n if (!this.hasCounter()) {\n return html``\n }\n // TODO: add aria-label and announcements\n return html`<span id=${this.counterId} class=\"supporting-text-end\">${this.getCounterText()}</span>`\n }\n\n protected renderPasswordControl(): TemplateResult | typeof nothing {\n const { type } = this\n if (type !== 'password') {\n return nothing\n }\n const visible = this.#showPassword\n const icon = visible ? 'visibilityOff' : 'visibility'\n return html`\n <ui-icon-button\n aria-label=\"Toggle password visibility\"\n @click=\"${this.#handlePasswordToggle}\"\n title=\"Shows or hides the password\"\n >\n <ui-icon icon=\"${icon}\"></ui-icon>\n </ui-icon-button>\n `\n }\n\n protected renderDataList(): TemplateResult | typeof nothing {\n const { list } = this\n if (!Array.isArray(list) || !list.length) {\n return nothing\n }\n return html` <datalist id=\"input-list\">${list.map((i) => html`<option value=\"${i}\"></option>`)}</datalist> `\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../src/md/input/Input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAkC,MAAM,KAAK,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,kCAAkC,CAAA;AACzC,OAAO,qBAAqB,CAAA;AAE5B,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,MA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AC,SAAS,gCAAgC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAA;QACrG,CAAC;QAES,qBAAqB;YAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;YACrB,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;gBACxB,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAA;YAClC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,CAAA;YACrD,OAAO,IAAI,CAAA;;;kBAGG,IAAI,CAAC,qBAAqB;;;yBAGnB,IAAI;;KAExB,CAAA;QACH,CAAC;QAES,cAAc;YACtB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACzC,OAAO,OAAO,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAA,8BAA8B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA,kBAAkB,CAAC,aAAa,CAAC,cAAc,CAAA;QAC9G,CAAC;;;AA37BH;;;GAGG;AACH","sourcesContent":["import { html, LitElement, nothing, PropertyValues, TemplateResult } from 'lit'\nimport { property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { SupportedAutocapitalize, SupportedAutocomplete, SupportedInputTypes } from '../../types/input.js'\nimport { ARIAAutoComplete, ARIAExpanded, ARIARole } from '../../types/role.js'\nimport { UiElement } from '../UiElement.js'\nimport { isDisabled, setDisabled } from '../../lib/disabled.js'\nimport '../icon-button/ui-icon-button.js'\nimport '../icons/ui-icon.js'\n\nconst floatTypes = ['date', 'color', 'datetime-local', 'file', 'month', 'time', 'week']\n\n/**\n * @slot prefix - A slot in which to render prefixes of the input\n * @slot suffix - A slot in which to render suffixes of the input\n */\nexport default abstract class Input extends UiElement {\n static override shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }\n #_userInteracted: boolean\n\n // static override shadowRootOptions: ShadowRootInit = {mode: 'open', delegatesFocus: true};\n\n static readonly formAssociated = true\n\n #_internals = this.attachInternals()\n\n get form(): HTMLFormElement | null {\n return this.#_internals && this.#_internals.form\n }\n\n /**\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor type: SupportedInputTypes\n\n get disabled(): boolean {\n return isDisabled(this)\n }\n\n /**\n * When set, the input is a disabled state.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n set disabled(value: boolean) {\n const old = isDisabled(this)\n setDisabled(this, value)\n this.requestUpdate('disabled', old)\n this._updateFormValue()\n }\n\n /**\n * The name of the form control, submitted as a pair with the control's value as part of the form data.\n * @attribute\n */\n @property({ type: String }) accessor name: string | undefined\n\n /**\n * When a form is submitted, only checkboxes which are currently checked are submitted to the server,\n * and the reported value is the `value` of the value attribute.\n * If the `value` is not otherwise specified, it is the string `on` by default.\n * @attribute\n */\n @property({ type: String }) accessor value = ''\n\n /**\n * Set to true to mark the input element as required.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n accessor required: boolean | undefined\n\n /**\n * While the element can be easily styled with the `:valid` and `:invalid` pseudo classes\n * it also exposes an attribute to style the element as invalid. This attribute changes\n * when the element validation is performed.\n *\n * Calling `reportValidity()` will automatically update `invalid`.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor invalid: boolean | undefined\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * Calling `reportValidity()` will automatically update `errorText` to the\n * native `validationMessage`.\n * @attribute\n */\n @property({ type: String }) accessor invalidText = ''\n\n /**\n * The label to be rendered with the input.\n * @attribute\n */\n @property({ type: String }) accessor label: string | undefined\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n * @attribute\n */\n @property({ type: Boolean }) accessor hasPrefix = false\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n * @attribute\n */\n @property({ type: Boolean }) accessor hasSuffix = false\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n * @attribute\n */\n @property({ type: String }) accessor supportingText = ''\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n * @attribute\n */\n @property({ type: String }) accessor textDirection = ''\n\n /**\n * When set the label of the input disappears after input rather than float over the input.\n * @attribute\n */\n @property({ type: Boolean }) accessor noFloating: boolean | undefined\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n * @attribute\n */\n @property({ type: String }) accessor max: number | string = ''\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n * @attribute\n */\n @property({ type: Number }) accessor maxLength = -1\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n * @attribute\n */\n @property({ type: String }) accessor min: number | string = ''\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n * @attribute\n */\n @property({ type: Number }) accessor minLength: number | undefined\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n * @attribute\n */\n @property({ type: String }) accessor pattern = ''\n\n /**\n * @attribute\n */\n @property({ type: String }) accessor placeholder = ''\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n *\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor readOnly = false\n\n /**\n * Bind the `<input>`'s `autocomplete` property.\n * @default off\n * @attribute\n */\n @property({ type: String }) accessor autocomplete: SupportedAutocomplete = 'off'\n\n /**\n * Binds this to the `<input>`'s `inputMode` property.\n * @attribute\n */\n @property({ type: String }) override accessor inputMode = ''\n\n /**\n * Binds this to the `<input>`'s `autocapitalize` property.\n *\n * Possible values are:\n *\n * - `off` or `none`: No auto-capitalization is applied (all letters default to lowercase)\n * - `on` or `sentences`: The first letter of each sentence defaults to a capital letter;\n * all other letters default to lowercase\n * - `words`: The first letter of each word defaults to a capital letter; all other letters default to lowercase\n * - `characters`: All letters should default to uppercase\n *\n * @default off\n * @attr\n */\n override autocapitalize: SupportedAutocapitalize = 'off'\n\n /**\n * Binds this to the `<input>`'s `accept` property,\n * used with type=file.\n * @attribute\n */\n @property({ type: String }) accessor accept: string | undefined\n\n /**\n * Binds this to the`<input>`'s `multiple` property,\n * used with type=file.\n * @attribute\n */\n @property({ type: Boolean }) accessor multiple: boolean | undefined\n\n /**\n * Binds this to the `<input>`'s `size` property.\n * @attribute\n */\n @property({ type: Number }) accessor size: number | undefined\n\n protected pendingSetters = new Map<keyof HTMLInputElement, unknown>()\n\n private setNativeValue(key: keyof HTMLInputElement, value: unknown): void {\n const { input } = this\n if (input) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(input as any)[key] = value\n } else {\n this.pendingSetters.set(key, value)\n }\n }\n\n private getNativeValue(key: keyof HTMLInputElement): unknown {\n const { input } = this\n if (input) {\n return input[key]\n }\n return this.pendingSetters.get(key) || null\n }\n\n /**\n * Gets or sets the direction in which selection occurred.\n */\n get selectionDirection(): 'forward' | 'backward' | 'none' | null {\n return this.getNativeValue('selectionDirection') as 'forward' | 'backward' | 'none' | null\n }\n\n set selectionDirection(value: 'forward' | 'backward' | 'none' | null) {\n this.setNativeValue('selectionDirection', value)\n }\n\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n get selectionEnd(): number | null {\n return this.getNativeValue('selectionEnd') as number | null\n }\n\n set selectionEnd(value: number | null) {\n this.setNativeValue('selectionEnd', value)\n }\n\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n get selectionStart(): number | null {\n return this.getNativeValue('selectionStart') as number | null\n }\n\n set selectionStart(value: number | null) {\n this.setNativeValue('selectionStart', value)\n }\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n * @attribute\n */\n @property({ type: Number }) accessor step = 1\n\n /**\n * Returns the native validation error message that would be displayed upon\n * calling `reportValidity()`.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage\n */\n get validationMessage(): string {\n return (this.getNativeValue('validationMessage') as string | null) ?? ''\n }\n\n /**\n * Returns a ValidityState object that represents the validity states of the\n * text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validity\n */\n get validity(): ValidityState {\n return (this.getNativeValue('validity') as ValidityState | null) ?? this.#_internals.validity\n }\n\n /**\n * The text field's value as a number.\n */\n get valueAsNumber(): number {\n return (this.getNativeValue('valueAsNumber') as number | null) ?? 0\n }\n\n set valueAsNumber(value: number) {\n this.setNativeValue('valueAsNumber', value)\n }\n\n /**\n * The text field's value as a Date.\n */\n get valueAsDate(): Date | null {\n return this.getNativeValue('valueAsDate') as Date | null\n }\n\n set valueAsDate(value: Date | null) {\n this.setNativeValue('valueAsDate', value)\n }\n\n /**\n * Returns whether an element will successfully validate based on forms\n * validation rules and constraints.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/willValidate\n */\n get willValidate(): boolean {\n return (this.getNativeValue('willValidate') as boolean | null) ?? false\n }\n\n /**\n * Returns true when the text field has been interacted with. Native\n * validation errors only display in response to user interactions.\n */\n @state() protected accessor dirty = false\n\n @state() protected accessor focused = false\n\n get input(): HTMLInputElement | null {\n return this.shadowRoot?.querySelector('.input') ?? null\n }\n\n @queryAssignedElements({ slot: 'prefix' }) private accessor prefixes!: Element[]\n\n @queryAssignedElements({ slot: 'suffix' }) private accessor suffixes!: Element[]\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() protected accessor nativeErrorText = ''\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() protected accessor nativeError = false\n\n private readonly counterId = 'counter'\n\n private readonly supportingTextId = 'support'\n\n private readonly labelId = 'support'\n\n @property({ type: String, attribute: 'data-aria-autocomplete', noAccessor: true })\n override accessor ariaAutoComplete: ARIAAutoComplete | null = null\n\n @property({ type: String, attribute: 'data-aria-controls', noAccessor: true })\n accessor ariaControls: string | null = null\n\n @property({ type: String, attribute: 'data-aria-activedescendant', noAccessor: true })\n accessor ariaActiveDescendant: string | null = null\n\n @property({ type: String, attribute: 'data-aria-expanded', noAccessor: true })\n override accessor ariaExpanded: ARIAExpanded | null = null\n\n /**\n * The `aria-label` of the text field's input.\n */\n @property({ type: String, attribute: 'data-aria-label', noAccessor: true })\n override accessor ariaLabel!: string\n\n /**\n * The `aria-labelledby` of the text field's input.\n *\n * Note: currently only usable in SSR light DOM.\n */\n @property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true })\n accessor ariaLabelledBy!: string\n\n @property({ type: String, attribute: 'data-role', noAccessor: true })\n accessor dataRole: ARIARole | null = null\n\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() protected accessor refreshErrorAlert = false\n\n /**\n * When set is shows password in the `password` input.\n * This is private so the password can be viewed only through user interaction.\n */\n #showPassword = false\n\n get files(): FileList | null {\n return this.getNativeValue('files') as FileList | null\n }\n\n /**\n * When set it adds a `<datalist>` element to the input.\n */\n @property({ type: Array }) accessor list: string[] | undefined\n\n constructor() {\n super()\n this.type = 'text'\n this.#_userInteracted = false\n this.actionController.cancelKeyboardEvents = false\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('focus', this.handleFocus.bind(this))\n this.addEventListener('blur', this.handleBlur.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n if (!this.hasAttribute('tabindex') && !this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n this.handleSlotChange()\n }\n\n /**\n * When form-associated custom elements are supported in the browser it\n * is called when the form has been reset\n */\n formResetCallback(): void {\n this.value = ''\n }\n\n /**\n * When form-associated custom elements are supported in the browser it\n * is called when the form state has been restored\n *\n * @param formState Restored value\n */\n formStateRestoreCallback(formState?: string): void {\n this.value = formState ?? ''\n }\n\n protected override willUpdate(cp: PropertyValues<this>): void {\n if (cp.has('required')) {\n this._updateFormValue()\n }\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties)\n if (changedProperties.has('value')) {\n this._updateFormValue()\n }\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false\n })\n }\n }\n\n protected _updateFormValue(): void {\n const { value = '', disabled } = this\n if (!value || disabled) {\n this.#_internals.setFormValue(null)\n } else {\n this.#_internals.setFormValue(value)\n }\n this._updateValidationState()\n }\n\n protected _updateValidationState(): void {\n const { input } = this\n if (!input) {\n return\n }\n const { validationMessage, validity } = input\n if (!validity.valid) {\n this.#_internals.setValidity(\n {\n valueMissing: validity.valueMissing,\n badInput: validity.badInput,\n patternMismatch: validity.patternMismatch,\n rangeOverflow: validity.rangeOverflow,\n rangeUnderflow: validity.rangeUnderflow,\n stepMismatch: validity.stepMismatch,\n tooLong: validity.tooLong,\n tooShort: validity.tooShort,\n typeMismatch: validity.typeMismatch,\n customError: validity.customError,\n },\n validationMessage\n )\n return\n }\n\n this.#_internals.setValidity({})\n }\n\n protected invalidHandler(e: Event): void {\n this.retargetEvent(e)\n if (!this.#_userInteracted) {\n return\n }\n this.invalid = true\n }\n\n protected handleSlotChange(): void {\n this.hasPrefix = this.prefixes.length > 0\n this.hasSuffix = this.suffixes.length > 0\n }\n\n protected getInputValue(): string {\n if (this.type === 'color') {\n return this.value || '#000000'\n }\n return this.value || ''\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/checkValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n checkValidity(): boolean {\n this.#_userInteracted = true\n const { valid } = this.checkValidityAndDispatch()\n this.invalid = !valid\n return valid\n }\n\n /**\n * Focuses the text field's input text.\n */\n override focus(): void {\n if (this.disabled || this.matches(':focus-within')) {\n return\n }\n this.input?.focus()\n }\n\n /**\n * Un-focuses the text field.\n */\n override blur(): void {\n this.input?.blur()\n }\n\n /**\n * Checks the text field's native validation and returns whether or not the\n * element is valid.\n *\n * If invalid, this method will dispatch the `invalid` event.\n *\n * This method will display or clear an error text message equal to the text\n * field's `validationMessage`, unless the invalid event is canceled.\n *\n * Use `setCustomValidity()` to customize the `validationMessage`.\n *\n * This method can also be used to re-announce error messages to screen\n * readers.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/reportValidity\n *\n * @return true if the text field is valid, or false if not.\n */\n reportValidity(): boolean {\n this.#_userInteracted = true\n const { valid, canceled } = this.checkValidityAndDispatch()\n this._updateValidationState()\n if (!canceled) {\n this.invalid = !valid\n const prevMessage = this.getErrorText()\n this.nativeError = !valid\n this.nativeErrorText = this.validationMessage\n\n const needsRefresh = this.shouldErrorAnnounce() && prevMessage === this.getErrorText()\n if (needsRefresh) {\n this.refreshErrorAlert = true\n }\n }\n\n return valid\n }\n\n protected shouldErrorAnnounce(): boolean {\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n return this.getError() && !!this.getErrorText() && !this.refreshErrorAlert\n }\n\n protected getErrorText(): string {\n return this.invalidText || this.nativeErrorText\n }\n\n /**\n * Selects all the text in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select\n */\n select(): void {\n this.input?.select()\n }\n\n /**\n * Sets the text field's native validation error message. This is used to\n * customize `validationMessage`.\n *\n * When the error is not an empty string, the text field is considered invalid\n * and `validity.customError` will be true.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setCustomValidity\n *\n * @param error The error message to display.\n */\n setCustomValidity(error: string): void {\n this.input?.setCustomValidity(error)\n }\n\n /**\n * Replaces a range of text with a new string.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setRangeText\n */\n setRangeText(replacement: string): void\n\n setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void\n\n setRangeText(...args: unknown[]): void {\n const { input } = this\n if (!input) {\n return\n }\n // Calling setRangeText with 1 vs 3-4 arguments has different behavior.\n // Use spread syntax and type casting to ensure correct usage.\n input.setRangeText(...(args as Parameters<HTMLInputElement['setRangeText']>))\n this.value = input.value\n }\n\n /**\n * Sets the start and end positions of a selection in the text field.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n *\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number | null, end: number | null, direction?: 'forward' | 'backward' | 'none'): void {\n this.input?.setSelectionRange(start, end, direction)\n }\n\n /**\n * Decrements the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepDown\n *\n * @param stepDecrement The number of steps to decrement, defaults to 1.\n */\n stepDown(stepDecrement?: number): void {\n const { input } = this\n if (!input) {\n return\n }\n input.stepDown(stepDecrement)\n this.value = input.value\n }\n\n /**\n * Increments the value of a numeric type text field by `step` or `n` `step`\n * number of times.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/stepUp\n *\n * @param stepIncrement The number of steps to increment, defaults to 1.\n */\n stepUp(stepIncrement?: number): void {\n const { input } = this\n if (!input) {\n return\n }\n input.stepUp(stepIncrement)\n this.value = input.value\n }\n\n /**\n * Reset the text field to its default value.\n */\n reset(): void {\n this.dirty = false\n this.value = ''\n }\n\n override handleClick(): void {\n this.focus()\n }\n\n protected handleFocus(): void {\n const { input } = this\n if (this.disabled || !input) {\n return\n }\n this.focused = true\n }\n\n protected handleBlur(): void {\n if (this.matches(':focus-within')) {\n // Changing focus to another child within the text field, like a button\n return\n }\n this.focused = false\n }\n\n private checkValidityAndDispatch(): { valid: boolean; canceled: boolean } {\n const valid = this.input?.checkValidity() ?? true\n let canceled = false\n if (!valid) {\n canceled = !this.dispatchEvent(new Event('invalid', { cancelable: true }))\n }\n return { valid, canceled }\n }\n\n /**\n * @returns `true` when the label is in resting state.\n */\n protected labelResting(): boolean {\n const { value } = this\n if (!!value || String(value) === '0') {\n return false\n }\n if (floatTypes.includes(this.type || '')) {\n return false\n }\n return !this.placeholder && !this.focused\n }\n\n /**\n * @returns `true` when the label should be hidden\n */\n protected labelHidden(): boolean {\n const { noFloating } = this\n return !this.labelResting() && !!noFloating\n }\n\n protected renderLabelText(): string {\n const labelText = this.label ?? ''\n const optionalAsterisk = this.required && labelText ? '*' : ''\n return labelText + optionalAsterisk\n }\n\n protected getSupportingText(): string {\n const errorText = this.getErrorText()\n return this.getError() && errorText ? errorText : this.supportingText\n }\n\n protected getError(): boolean {\n return this.invalid || this.nativeError\n }\n\n protected retargetEvent(event: Event): boolean {\n if (event.bubbles && (!this.shadowRoot || event.composed)) {\n event.stopPropagation()\n }\n\n const copy = Reflect.construct(event.constructor, [event.type, event])\n const dispatched = this.dispatchEvent(copy)\n if (!dispatched) {\n event.preventDefault()\n }\n\n return dispatched\n }\n\n protected handleInput(event: InputEvent): void {\n this.dirty = true\n this.value = (event.target as HTMLInputElement).value\n this.retargetEvent(event)\n this.reportValidity()\n }\n\n protected hasCounter(): boolean {\n return this.maxLength > -1\n }\n\n protected getCounterText(): string {\n const { length } = this.value || ''\n return `${length} / ${this.maxLength || 0}`\n }\n\n protected getAriaDescribedBy(): string {\n const hasSupport = !!this.getSupportingText()\n if (hasSupport) {\n return this.supportingTextId\n }\n const hasCounter = this.hasCounter()\n if (hasCounter) {\n return this.counterId\n }\n return ''\n }\n\n #handlePasswordToggle(): void {\n this.#showPassword = !this.#showPassword\n this.requestUpdate()\n }\n\n protected get effectiveType(): SupportedInputTypes {\n const { type } = this\n if (type !== 'password') {\n return type\n }\n const visible = this.#showPassword\n return visible ? 'text' : 'password'\n }\n\n protected override render(): TemplateResult {\n const { pressed = false } = this\n const labelResting = this.labelResting()\n const containerClasses = classMap({\n surface: true,\n pressed,\n labelResting,\n labelActive: !labelResting,\n labelHidden: this.labelHidden(),\n })\n return html`\n <div class=\"${containerClasses}\">\n <div class=\"container\"></div>\n <div class=\"content\">\n ${this.renderPrefix()} ${this.renderBody()} ${this.renderPasswordControl()} ${this.renderSuffix()}\n ${this.renderHighlight()}\n </div>\n </div>\n ${this.renderSupportingText()} ${this.renderDataList()}\n `\n }\n\n protected renderPrefix(): TemplateResult {\n const classes = classMap({\n start: true,\n prefixed: this.hasPrefix,\n })\n return html` <div class=\"${classes}\">\n <slot name=\"prefix\" @slotchange=${this.handleSlotChange}></slot>\n </div>`\n }\n\n protected renderSuffix(): TemplateResult {\n const classes = classMap({\n end: true,\n suffixed: this.hasSuffix,\n })\n return html` <div class=\"${classes}\">\n <slot name=\"suffix\" @slotchange=${this.handleSlotChange}></slot>\n </div>`\n }\n\n protected renderBody(): TemplateResult {\n return html` <div class=\"body\">${this.renderLabel()} ${this.renderInput()}</div> `\n }\n\n protected renderLabel(): TemplateResult {\n const label = this.renderLabelText()\n if (!label) {\n return html``\n }\n return html` <span class=\"label\" id=\"${this.labelId}\" title=\"label\">${label}</span> `\n }\n\n protected renderHighlight(): TemplateResult {\n return html` <span class=\"highlight\"></span> `\n }\n\n protected abstract renderInput(): TemplateResult\n\n protected renderSupportingText(): TemplateResult {\n return html` <span class=\"supporting-text\"> ${this.renderSupportingTextValue()} ${this.renderCounter()} </span> `\n }\n\n protected renderSupportingTextValue(): TemplateResult | typeof nothing {\n const text = this.getSupportingText()\n if (!text) {\n return nothing\n }\n const shouldAlert = this.shouldErrorAnnounce()\n return html`\n <span\n class=\"supporting-text-start\"\n id=\"${this.supportingTextId}\"\n role=${ifDefined(shouldAlert ? 'alert' : undefined)}\n >\n ${text}\n </span>\n `\n }\n\n protected renderCounter(): TemplateResult {\n if (!this.hasCounter()) {\n return html``\n }\n // TODO: add aria-label and announcements\n return html`<span id=${this.counterId} class=\"supporting-text-end\">${this.getCounterText()}</span>`\n }\n\n protected renderPasswordControl(): TemplateResult | typeof nothing {\n const { type } = this\n if (type !== 'password') {\n return nothing\n }\n const visible = this.#showPassword\n const icon = visible ? 'visibilityOff' : 'visibility'\n return html`\n <ui-icon-button\n aria-label=\"Toggle password visibility\"\n @click=\"${this.#handlePasswordToggle}\"\n title=\"Shows or hides the password\"\n >\n <ui-icon icon=\"${icon}\"></ui-icon>\n </ui-icon-button>\n `\n }\n\n protected renderDataList(): TemplateResult | typeof nothing {\n const { list } = this\n if (!Array.isArray(list) || !list.length) {\n return nothing\n }\n return html` <datalist id=\"input-list\">${list.map((i) => html`<option value=\"${i}\"></option>`)}</datalist> `\n }\n}\n"]}
|
|
@@ -12,6 +12,8 @@ export interface UiListItemsChange {
|
|
|
12
12
|
* The `event.detail` object contains the `item` and `index` properties.
|
|
13
13
|
* @fires itemschange - Dispatched when the list items change, e.g. when the slot changes.
|
|
14
14
|
* The `event.detail` object contains the `items` property with the list of items.
|
|
15
|
+
* @fires highlightchange - Dispatched when the highlighted item changes.
|
|
16
|
+
* The `event.detail` object contains the `items` property with the list of items.
|
|
15
17
|
*/
|
|
16
18
|
export default class UiList extends LitElement {
|
|
17
19
|
/**
|
|
@@ -72,7 +74,7 @@ export default class UiList extends LitElement {
|
|
|
72
74
|
highlightFirst(): void;
|
|
73
75
|
highlightLast(): void;
|
|
74
76
|
handleClick(event: MouseEvent): void;
|
|
75
|
-
|
|
77
|
+
highlightItem(item?: UiListItem | null): void;
|
|
76
78
|
/**
|
|
77
79
|
* Activates a list item from an Event.
|
|
78
80
|
* Activate means dispatches a non-bubbling CustomEvent with the item in the detail.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/md/list/internals/List.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEtE,OAAO,UAAU,MAAM,eAAe,CAAA;AActC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/md/list/internals/List.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEtE,OAAO,UAAU,MAAM,eAAe,CAAA;AActC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAC5C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,CAAK;IAEjC,cAAc,EAAE,UAAU,GAAG,IAAI,CAAO;IAExC,iBAAiB,EAAE,UAAU,GAAG,IAAI,CAAO;IAE3C;;;;OAIG;IACyB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAErD;;;OAGG;IAC0B,QAAQ,CAAC,YAAY,EAAE,OAAO,GAAG,SAAS,CAAA;IAE7B,SAAS,CAAC,QAAQ,CAA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IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI;IAiB7C;;;OAGG;IACH,SAAS,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAuB3C;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO;IAgBvD,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IASxC,MAAM,IAAI,cAAc;CAGlC"}
|
|
@@ -283,14 +283,18 @@ let UiList = (() => {
|
|
|
283
283
|
this.activateFromEvent(event);
|
|
284
284
|
}
|
|
285
285
|
highlightItem(item) {
|
|
286
|
+
if (this.highlightListItem === item) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
286
289
|
if (this.highlightListItem) {
|
|
287
290
|
this.highlightListItem.classList.remove('highlight');
|
|
288
291
|
}
|
|
289
292
|
this.highlightListItem = item || null;
|
|
290
293
|
if (this.highlightListItem) {
|
|
291
294
|
this.highlightListItem.classList.add('highlight');
|
|
292
|
-
this.highlightListItem.scrollIntoView({ block: '
|
|
295
|
+
this.highlightListItem.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'smooth' });
|
|
293
296
|
}
|
|
297
|
+
this.dispatchEvent(new CustomEvent('highlightchange', { bubbles: false, composed: false, detail: { item: this.highlightListItem } }));
|
|
294
298
|
}
|
|
295
299
|
/**
|
|
296
300
|
* Activates a list item from an Event.
|
|
@@ -315,9 +319,8 @@ let UiList = (() => {
|
|
|
315
319
|
this.manageSelection(item);
|
|
316
320
|
item.activate();
|
|
317
321
|
this.activeListItem = item;
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
this.notifySelect(item);
|
|
321
324
|
}
|
|
322
325
|
/**
|
|
323
326
|
* @param item The UiListItem that is selected.
|
|
@@ -356,6 +359,8 @@ let UiList = (() => {
|
|
|
356
359
|
* The `event.detail` object contains the `item` and `index` properties.
|
|
357
360
|
* @fires itemschange - Dispatched when the list items change, e.g. when the slot changes.
|
|
358
361
|
* The `event.detail` object contains the `items` property with the list of items.
|
|
362
|
+
* @fires highlightchange - Dispatched when the highlighted item changes.
|
|
363
|
+
* The `event.detail` object contains the `items` property with the list of items.
|
|
359
364
|
*/
|
|
360
365
|
export default UiList;
|
|
361
366
|
//# sourceMappingURL=List.js.map
|