@spectrum-web-components/picker 1.12.0-testing.20260223092154 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +15 -15
- package/src/Picker.d.ts +2 -8
- package/src/Picker.dev.js +21 -30
- package/src/Picker.dev.js.map +2 -2
- package/src/Picker.js +6 -6
- package/src/Picker.js.map +3 -3
package/src/Picker.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Picker.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n nothing,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport {\n classMap,\n ifDefined,\n StyleInfo,\n styleMap,\n} from '@spectrum-web-components/base/src/directives.js';\nimport type { FieldLabel } from '@spectrum-web-components/field-label';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { Placement } from '@spectrum-web-components/overlay';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport type { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport { DependencyManagerController } from '@spectrum-web-components/reactive-controllers/src/DependencyManger.js';\nimport {\n IS_MOBILE,\n IS_TOUCH_DEVICE,\n MatchMediaController,\n} from '@spectrum-web-components/reactive-controllers/src/MatchMedia.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\n\nimport { DesktopController } from './DesktopController.js';\nimport { MobileController } from './MobileController.js';\nimport pickerStyles from './picker.css.js';\nimport { strategies } from './strategies.js';\n\nconst chevronClass = {\n s: 'spectrum-UIIcon-ChevronDown75',\n m: 'spectrum-UIIcon-ChevronDown100',\n l: 'spectrum-UIIcon-ChevronDown200',\n xl: 'spectrum-UIIcon-ChevronDown300',\n};\n\nexport const DESCRIPTION_ID = 'option-picker';\n\n/**\n * Base class for expandable picker-like components with overlay functionality.\n * Provides common properties and methods for managing an overlay menu,\n * device-specific interaction strategies, and focus management.\n *\n * Extended by Picker, ActionMenu, and other components that display\n * a menu overlay triggered by a button.\n */\nexport class ExpandableElement extends SpectrumElement {\n /**\n * Shadow root configuration with delegatesFocus enabled.\n * Allows focus to be delegated to focusable children within the shadow root.\n */\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Controller that tracks whether the device is mobile. */\n public isMobile = new MatchMediaController(this, IS_MOBILE);\n\n /** Controller that tracks whether the device supports touch input. */\n public isTouchDevice = new MatchMediaController(this, IS_TOUCH_DEVICE);\n\n /** The interaction strategy controller (desktop or mobile) managing pointer and keyboard events. */\n public strategy!: DesktopController | MobileController;\n\n /** Reference to the component's trigger button element. */\n @query('#button')\n public button!: HTMLButtonElement;\n\n /** Controller that manages lazy-loading of overlay dependencies. */\n public dependencyManager = new DependencyManagerController(this);\n\n /** Whether the component is disabled. When disabled, the component cannot be interacted with. */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /** Whether the component currently has visible focus. */\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n /** Whether the component is read-only. When read-only, the component displays its value but cannot be changed. */\n @property({ type: Boolean, reflect: true })\n public readonly = false;\n\n /** Whether the items are currently loading. */\n @property({ type: Boolean, reflect: true })\n public pending = false;\n\n /**\n * Forces the component to render as a popover on mobile instead of a tray.\n */\n @property({ type: Boolean, reflect: true, attribute: 'force-popover' })\n public forcePopover = false;\n\n /** Whether the component's menu overlay is currently open. */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /** Reference to the component's internal menu element. */\n @query('sp-menu')\n public optionsMenu!: Menu;\n\n /** Reference to the component's overlay element. */\n @query('sp-overlay')\n public overlayElement!: Overlay;\n\n /**\n * The preferred placement of the component's overlay relative to the trigger button.\n *\n * @type {\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\"}\n * @attr\n */\n\n @property()\n public placement: Placement = 'bottom-start';\n\n /**\n * Returns the element that should receive focus.\n * When open, returns the options menu; otherwise returns the trigger button.\n */\n public get focusElement(): HTMLElement {\n if (this.open) {\n return this.optionsMenu;\n }\n return this.button;\n }\n\n /**\n * Focuses the appropriate element (button or menu) based on the picker's state.\n *\n * @param options - Standard focus options\n */\n public override focus(options?: FocusOptions): void {\n this.focusElement?.focus(options);\n }\n\n /**\n * Closes the component's overlay.\n * Has no effect when the component is readonly.\n */\n public close(): void {\n if (this.readonly) {\n return;\n }\n if (this.strategy) {\n this.open = false;\n this.strategy.open = false;\n }\n }\n\n /**\n * Toggles the component's open state.\n * Has no effect when the component is readonly, pending, or disabled.\n *\n * @param target - Optional explicit open state. If not provided, toggles the current state.\n */\n public toggle(target?: boolean): void {\n if (this.readonly || this.pending || this.disabled) {\n return;\n }\n const open = typeof target !== 'undefined' ? target : !this.open;\n\n this.open = open;\n if (this.strategy) {\n this.strategy.open = this.open;\n }\n }\n\n /**\n * Handles slottable request events from the overlay.\n * Override in subclasses to customize slottable behavior.\n *\n * @param _event - The slottable request event\n */\n public handleSlottableRequest = (_event: SlottableRequestEvent): void => {};\n\n /**\n * Handles the overlay's beforetoggle event.\n * Manages overlay state and prevents unwanted closures during interaction.\n *\n * @param event - The beforetoggle event with the new state\n */\n protected handleBeforetoggle = (\n event: Event & {\n target: Overlay;\n newState: 'open' | 'closed';\n }\n ): void => {\n if (event.composedPath()[0] !== event.target) {\n return;\n }\n if (event.newState === 'closed') {\n // Track if we should restore focus before the overlay fully closes.\n // This must happen now (in beforetoggle) because by the time sp-closed fires,\n // the overlay animation will be complete and focus will have moved elsewhere.\n const shouldRestoreFocus =\n this.optionsMenu?.matches(':focus-within') &&\n !this.button?.matches(':focus');\n\n // Handle three cases:\n // 1. open was already set to false externally (e.g., via setValueFromItem\n // from a programmatic click) - allow overlay to close\n // 2. preventNextToggle is 'no' - normal close, set open to false\n // 3. Otherwise, prevent browser-driven closure while opening\n if (!this.open) {\n // Already closed externally, sync controller state if present\n if (this.strategy) {\n this.strategy.open = false;\n }\n } else if (this.strategy?.preventNextToggle === 'no') {\n this.open = false;\n } else if (!this.strategy?.pointerdownState) {\n // Prevent browser driven closure while opening the Picker\n // and the expected event series has not completed.\n this.overlayElement?.manuallyKeepOpen();\n }\n\n // Restore focus to the button if focus was in the menu.\n if (shouldRestoreFocus && !this.open) {\n this.button?.focus();\n }\n }\n if (!this.open) {\n this.optionsMenu?.updateSelectedItemIndex();\n this.optionsMenu?.closeDescendentOverlays();\n }\n };\n\n /**\n * Binds the appropriate interaction strategy (desktop or mobile) based on device type.\n * Aborts any existing strategy before creating a new one.\n */\n public bindEvents(): void {\n this.strategy?.abort();\n if (this.isMobile.matches) {\n this.strategy = new strategies['mobile'](\n this.button,\n this as ExpandableElement\n );\n } else {\n this.strategy = new strategies['desktop'](\n this.button,\n this as ExpandableElement\n );\n }\n }\n\n /**\n * Lifecycle callback when the element is disconnected from the DOM.\n * Closes the overlay and releases strategy resources.\n */\n public override disconnectedCallback(): void {\n this.close();\n this.strategy?.releaseDescription();\n super.disconnectedCallback();\n }\n}\n\n/**\n * @slot label - The placeholder content for the Picker\n * @slot description - The description content for the Picker\n * @slot tooltip - Tooltip to to be applied to the the Picker Button\n * @slot - menu items to be listed in the Picker\n * @fires change - Announces that the `value` of the element has changed\n * @fires sp-opened - Announces that the overlay has been opened\n * @fires sp-closed - Announces that the overlay has been closed\n * @deprecated This class is deprecated and will be removed in a future major release. Use the ExpandableElement base class instead.\n * @see https://opensource.adobe.com/spectrum-web-components/components/picker/#deprecation\n */\nexport class PickerBase extends SizedMixin(ExpandableElement, {\n noDefaultSize: true,\n}) {\n /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n private deprecatedMenu: Menu | null = null;\n\n /**\n * Controls how icons are displayed in the picker button.\n * - `'only'`: Shows only the icon, hiding the label visually.\n * - `'none'`: Hides the icon entirely.\n */\n @property({ type: String, reflect: true })\n public icons?: 'only' | 'none';\n\n /** Whether the picker is in an invalid state. Displays a validation icon when true. */\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n /** Defines a string value that labels the Picker while it is in pending state. */\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n /** The placeholder label displayed when no item is selected. */\n @property()\n public label?: string;\n\n /**\n * The selection mode for the picker's menu.\n * Always forced to `'single'` for standard picker behavior.\n */\n public selects: undefined | 'single' = 'single';\n\n /** The alignment of the associated label, set by an external field label component. */\n @state()\n public labelAlignment?: 'inline';\n\n /**\n * Returns the list of menu items contained in the picker's options menu.\n */\n protected get menuItems(): MenuItem[] {\n return this.optionsMenu.childItems;\n }\n\n /**\n * @deprecated This property always returns true and will be removed in a future version.\n */\n public get selfManageFocusElement(): boolean {\n return true;\n }\n\n /** Reference to the tooltip element, if one is slotted. */\n protected tooltipEl?: Tooltip;\n\n /** Whether to render the picker in quiet mode with minimal visual styling. */\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /** The current value of the picker, corresponding to the selected menu item's value. */\n @property({ type: String })\n public value = '';\n\n /**\n * The currently selected menu item, or undefined if no item is selected.\n */\n @property({ attribute: false })\n public get selectedItem(): MenuItem | undefined {\n return this._selectedItem;\n }\n\n public set selectedItem(selectedItem: MenuItem | undefined) {\n this.selectedItemContent = selectedItem\n ? selectedItem.itemChildren\n : undefined;\n\n if (selectedItem === this.selectedItem) {\n return;\n }\n const oldSelectedItem = this.selectedItem;\n this._selectedItem = selectedItem;\n this.requestUpdate('selectedItem', oldSelectedItem);\n }\n\n _selectedItem?: MenuItem;\n\n /** The ARIA role for the menu list element. */\n protected listRole: 'listbox' | 'menu' = 'listbox';\n\n /** The ARIA role for individual menu items. */\n protected itemRole = 'option';\n\n /**\n * Programmatically applies visible focus styling to the picker.\n * Has no effect when the picker is disabled.\n */\n public forceFocusVisible(): void {\n if (this.disabled) {\n return;\n }\n\n this.focused = true;\n }\n\n /**\n * Toggles the picker's open state when called programmatically.\n * Note: Pointer events are handled by the interaction controller.\n */\n public override click(): void {\n this.toggle();\n }\n\n /**\n * Handles click events on the trigger button.\n * Note: Pointer events are typically handled by the interaction controller;\n * this method is called when `this.button.click()` is invoked programmatically.\n */\n public handleButtonClick(): void {\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n /**\n * Handles blur events on the trigger button, removing focus styling.\n */\n public handleButtonBlur(): void {\n this.focused = false;\n }\n\n public override focus(options?: FocusOptions): void {\n this.focusElement?.focus(options);\n }\n\n /**\n * @deprecated Use `focus()` instead.\n * Focuses the picker button and applies focus styling.\n */\n public handleHelperFocus(): void {\n // set focused to true here instead of handleButtonFocus so clicks don't flash a focus outline\n this.focused = true;\n this.button.focus();\n }\n\n /**\n * Handles focus events on the picker, applying visible focus styling\n * only when focus is visible in the tree.\n */\n public handleFocus(): void {\n if (!this.disabled && this.focusElement) {\n this.focused = this.hasVisibleFocusInTree();\n }\n }\n\n /**\n * Handles change events from the menu, updating the selected value.\n * Dispatches a `change` event that can be prevented to cancel the selection.\n *\n * @param event - The change event from the menu\n */\n public handleChange(event: Event): void {\n if (this.strategy) {\n this.strategy.preventNextToggle = 'no';\n }\n const target = event.target as Menu;\n const [selected] = target.selectedItems;\n event.stopPropagation();\n if (event.cancelable) {\n this.setValueFromItem(selected, event);\n } else {\n // Non-cancelable \"change\" events announce a selection with no value\n // change that should close the Picker element.\n this.open = false;\n if (this.strategy) {\n this.strategy.open = false;\n }\n }\n }\n\n /**\n * Handles focus events on the trigger button, delegating to the interaction strategy.\n *\n * @param event - The focus event\n */\n public handleButtonFocus(event: FocusEvent): void {\n this.strategy?.handleButtonFocus(event);\n }\n\n /**\n * Handles Escape key press to close the picker overlay.\n *\n * @param event - The keyboard event\n */\n protected handleEscape = (\n event: MenuItemKeydownEvent | KeyboardEvent\n ): void => {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n event.preventDefault();\n this.toggle(false);\n }\n };\n\n /**\n * Handles keyboard navigation on the picker button.\n * Opens the menu on Arrow keys, Enter, or Space.\n *\n * @param event - The keyboard event\n */\n protected handleKeydown = (event: KeyboardEvent): void => {\n this.focused = true;\n if (!['ArrowUp', 'ArrowDown', 'Enter', ' ', 'Escape'].includes(event.key)) {\n return;\n }\n if (event.key === 'Escape') {\n this.handleEscape(event);\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.keyboardOpen();\n };\n\n /**\n * Opens the picker via keyboard interaction and focuses the first selected item.\n * If already open, focuses the first selected item in the menu.\n */\n protected async keyboardOpen(): Promise<void> {\n // if the menu is not open, we need to toggle it and wait for it to open to focus on the first selected item\n if (!this.open || !this.strategy.open) {\n this.addEventListener(\n 'sp-opened',\n () => this.optionsMenu?.focusOnFirstSelectedItem(),\n {\n once: true,\n }\n );\n this.toggle(true);\n } else {\n // if the menu is already open, we need to focus on the first selected item\n this.optionsMenu?.focusOnFirstSelectedItem();\n }\n }\n\n /**\n * Sets the picker's value from a menu item selection.\n * Dispatches a cancelable `change` event and reverts the selection if prevented.\n *\n * @param item - The menu item to select\n * @param menuChangeEvent - The original menu change event, if any\n */\n protected async setValueFromItem(\n item: MenuItem,\n menuChangeEvent?: Event\n ): Promise<void> {\n this.open = false;\n // should always close when \"setting\" a value\n const oldSelectedItem = this.selectedItem;\n const oldValue = this.value;\n\n // Set a value.\n this.selectedItem = item;\n this.value = item?.value ?? '';\n await this.updateComplete;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n // Allow it to be prevented.\n cancelable: true,\n composed: true,\n })\n );\n if (!applyDefault && this.selects) {\n if (menuChangeEvent) {\n menuChangeEvent.preventDefault();\n }\n this.setMenuItemSelected(this.selectedItem as MenuItem, false);\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, true);\n }\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n this.open = true;\n if (this.strategy) {\n this.strategy.open = true;\n }\n return;\n } else if (!this.selects) {\n // Unset the value if not carrying a selection\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n return;\n }\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, false);\n }\n this.setMenuItemSelected(item, !!this.selects);\n }\n\n /**\n * Updates the selected state of a menu item.\n *\n * @param item - The menu item to update\n * @param value - Whether the item should be selected\n */\n protected setMenuItemSelected(item: MenuItem, value: boolean): void {\n // matches null | undefined\n if (this.selects == null) {\n return;\n }\n item.selected = value;\n }\n\n /**\n * Returns inline styles for the overlay container.\n * On mobile, sets full width; on desktop, returns empty styles.\n */\n protected get containerStyles(): StyleInfo {\n // @todo: test in mobile\n /* c8 ignore next 5 */\n if (this.isMobile.matches) {\n return {\n '--swc-menu-width': '100%',\n };\n }\n return {};\n }\n\n /**\n * The content (icon and text) of the currently selected menu item.\n * Used to render the selected item's display in the picker button.\n */\n @state()\n protected get selectedItemContent(): MenuItemChildren {\n return this._selectedItemContent || { icon: [], content: [] };\n }\n\n protected set selectedItemContent(\n selectedItemContent: MenuItemChildren | undefined\n ) {\n if (selectedItemContent === this.selectedItemContent) {\n return;\n }\n\n const oldContent = this.selectedItemContent;\n this._selectedItemContent = selectedItemContent;\n this.requestUpdate('selectedItemContent', oldContent);\n }\n\n _selectedItemContent?: MenuItemChildren;\n\n /**\n * Handles slotchange events for the tooltip slot.\n * Sets up the trigger element for self-managed tooltips.\n *\n * @param event - The slotchange event\n */\n protected handleTooltipSlotchange(\n event: Event & { target: HTMLSlotElement }\n ): void {\n this.tooltipEl = event.target.assignedElements()[0] as Tooltip | undefined;\n\n // Set up trigger element for self-managed tooltips\n if (this.tooltipEl?.selfManaged) {\n // Wait for the tooltip to be fully initialized\n this.updateComplete.then(() => {\n if (this.tooltipEl?.overlayElement && this.button) {\n this.tooltipEl.overlayElement.triggerElement = this.button;\n }\n });\n }\n }\n\n /**\n * Renders the label content for the picker button.\n * Shows the selected item's content if available, otherwise renders the placeholder label.\n *\n * @param content - The content nodes from the selected item\n * @returns The rendered label content\n */\n protected renderLabelContent(content: Node[]): TemplateResult | Node[] {\n if (this.value && this.selectedItem) {\n return content;\n }\n return html`\n <slot name=\"label\" id=\"label\">\n <span aria-hidden=${ifDefined(this.appliedLabel ? undefined : 'true')}>\n ${this.label}\n </span>\n </slot>\n `;\n }\n\n /**\n * Renders the loading indicator shown during pending state.\n * Dynamically imports the progress-circle component.\n *\n * @returns The rendered progress circle template\n */\n protected renderLoader(): TemplateResult {\n import('@spectrum-web-components/progress-circle/sp-progress-circle.js');\n return html`\n <sp-progress-circle\n size=\"s\"\n indeterminate\n role=\"presentation\"\n class=\"progress-circle\"\n ></sp-progress-circle>\n `;\n }\n\n /**\n * Returns the content to render inside the picker button,\n * including the icon, label, validation icon, and chevron.\n */\n protected get buttonContent(): TemplateResult[] {\n const labelClasses = {\n 'visually-hidden': this.icons === 'only' && !!this.value,\n placeholder: !this.value,\n label: true,\n };\n const appliedLabel = this.appliedLabel || this.label;\n return [\n html`\n <span id=\"icon\" ?hidden=${this.icons === 'none'}>\n ${this.selectedItemContent.icon}\n </span>\n <span\n id=${ifDefined(this.value && this.selectedItem ? 'label' : undefined)}\n class=${classMap(labelClasses)}\n >\n ${this.renderLabelContent(this.selectedItemContent.content)}\n </span>\n ${this.value && this.selectedItem\n ? html`\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"applied-label\"\n >\n ${appliedLabel}\n <slot name=\"label\"></slot>\n </span>\n `\n : html`\n <span hidden id=\"applied-label\">${appliedLabel}</span>\n `}\n ${this.invalid && !this.pending\n ? html`\n <sp-icon-alert class=\"validation-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.pending\n ? html`\n ${this.renderLoader()}\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"pending-label\"\n >\n ${this.pendingLabel}\n </span>\n `\n : nothing}\n <sp-icon-chevron100\n class=\"picker ${chevronClass[this.size as DefaultElementSize]}\"\n ></sp-icon-chevron100>\n `,\n ];\n }\n\n /**\n * Callback invoked by an associated field label to apply its label value.\n * Sets the applied label and determines label alignment based on the field label's configuration.\n *\n * @param value - The label text value\n * @param labelElement - The field label element providing the label\n */\n applyFocusElementLabel = (value: string, labelElement: FieldLabel): void => {\n this.appliedLabel = value;\n this.labelAlignment = labelElement.sideAligned ? 'inline' : undefined;\n };\n\n /**\n * Checks whether the picker has an accessible label through any supported method:\n * - `label` attribute\n * - `aria-label` attribute\n * - `aria-labelledby` attribute\n * - Applied label from a field label\n * - Slotted label content\n *\n * @returns True if an accessible label is present\n */\n protected hasAccessibleLabel(): boolean {\n const slotContent =\n this.querySelector('[slot=\"label\"]')?.textContent &&\n this.querySelector('[slot=\"label\"]')?.textContent?.trim() !== '';\n const slotAlt =\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() &&\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() !== '';\n return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n !!slotContent ||\n !!slotAlt\n );\n }\n\n /**\n * Logs a warning in debug mode when the picker lacks an accessible label.\n * Provides guidance on how to make the picker accessible.\n */\n protected warnNoLabel(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> needs one of the following to be accessible:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#accessibility',\n {\n type: 'accessibility',\n issues: [\n `an <sp-field-label> element with a \\`for\\` attribute referencing the \\`id\\` of the \\`<${this.localName}>\\`, or`,\n 'value supplied to the \"label\" attribute, which will be displayed visually as placeholder text, or',\n 'text content supplied in a <span> with slot=\"label\", which will also be displayed visually as placeholder text.',\n ],\n }\n );\n }\n }\n\n /**\n * Renders the overlay element containing the menu.\n * Configures the overlay with appropriate placement, type, and event handlers.\n *\n * @param menu - The menu template to render inside the overlay\n * @returns The rendered overlay template\n */\n protected renderOverlay(menu: TemplateResult): TemplateResult {\n const container = this.renderContainer(menu);\n this.dependencyManager.add('sp-overlay');\n import('@spectrum-web-components/overlay/sp-overlay.js');\n return html`\n <sp-overlay\n @slottable-request=${this.handleSlottableRequest}\n @beforetoggle=${this.handleBeforetoggle}\n .triggerElement=${this as HTMLElement}\n .offset=${0}\n ?open=${this.open && this.dependencyManager.loaded}\n .placement=${this.isMobile.matches && !this.forcePopover\n ? undefined\n : this.placement}\n .type=${this.isMobile.matches && !this.forcePopover ? 'modal' : 'auto'}\n .receivesFocus=${'false'}\n .willPreventClose=${this.strategy?.preventNextToggle !== 'no' &&\n this.open &&\n this.dependencyManager.loaded}\n >\n ${container}\n </sp-overlay>\n `;\n }\n\n /**\n * Renders the description slot for additional picker context.\n * Content is referenced by aria-describedby for accessibility.\n */\n protected get renderDescriptionSlot(): TemplateResult {\n return html`\n <div id=${DESCRIPTION_ID}>\n <slot name=\"description\"></slot>\n </div>\n `;\n }\n\n // a helper to throw focus to the button is needed because Safari\n // won't include buttons in the tab order even with tabindex=\"0\"\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <button\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-describedby=\"tooltip ${DESCRIPTION_ID}\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-haspopup=\"true\"\n aria-labelledby=\"icon label applied-label pending-label\"\n id=\"button\"\n class=${ifDefined(\n this.labelAlignment ? `label-${this.labelAlignment}` : undefined\n )}\n @focus=${this.handleButtonFocus}\n @blur=${this.handleButtonBlur}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </button>\n <slot\n aria-hidden=\"true\"\n name=\"tooltip\"\n id=\"tooltip\"\n @keydown=${this.handleKeydown}\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override willUpdate(changes: PropertyValues<this>): void {\n super.willUpdate(changes);\n if (changes.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (this.selects) {\n // Always force `selects` to \"single\" when set.\n // @todo: Add support functionally and visually for \"multiple\"\n this.selects = 'single';\n }\n if (changes.has('disabled') && this.disabled) {\n this.close();\n }\n if (changes.has('pending') && this.pending) {\n this.close();\n }\n if (changes.has('value')) {\n // MenuItems update a frame late for <slot> management,\n // await the same here.\n this.shouldScheduleManageSelection();\n }\n // Maybe it's finally time to remove this support?\n if (!this.hasUpdated) {\n this.deprecatedMenu = this.querySelector(':scope > sp-menu');\n this.deprecatedMenu?.toggleAttribute('ignore', true);\n this.deprecatedMenu?.setAttribute('selects', 'inherit');\n }\n if (window.__swc?.DEBUG) {\n if (!this.hasUpdated && this.querySelector(':scope > sp-menu')) {\n const { localName } = this;\n window.__swc.warn(\n this,\n `You no longer need to provide an <sp-menu> child to ${localName}. Any styling or attributes on the <sp-menu> will be ignored.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#sizes',\n { level: 'deprecation' }\n );\n }\n this.updateComplete.then(async () => {\n // Attributes should be user supplied, making them available before first update.\n // However, `appliesLabel` is applied by external elements that must be update complete as well to be bound appropriately.\n await new Promise((res) => requestAnimationFrame(res));\n await new Promise((res) => requestAnimationFrame(res));\n if (!this.hasAccessibleLabel()) {\n this.warnNoLabel();\n }\n });\n }\n super.update(changes);\n }\n\n /**\n * Binds the keydown event listener to the trigger button.\n * Called during first update to enable keyboard navigation.\n */\n protected bindButtonKeydownListener(): void {\n this.button.addEventListener('keydown', this.handleKeydown);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('open') && this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n protected override async firstUpdated(\n changes: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changes);\n this.bindButtonKeydownListener();\n this.bindEvents();\n\n await this.updateComplete;\n if (this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Renders a visually hidden dismiss button for accessibility.\n * Allows screen reader users to dismiss the overlay.\n */\n protected get dismissHelper(): TemplateResult {\n return html`\n <div class=\"visually-hidden\">\n <button\n tabindex=\"-1\"\n aria-label=\"Dismiss\"\n @click=${this.close}\n ></button>\n </div>\n `;\n }\n\n /**\n * Renders the overlay container (popover or tray) based on device type.\n * On mobile, uses a tray; on desktop, uses a popover.\n *\n * @param menu - The menu template to wrap in the container\n * @returns The rendered container template\n */\n protected renderContainer(menu: TemplateResult): TemplateResult {\n const accessibleMenu = html`\n ${this.dismissHelper} ${menu} ${this.dismissHelper}\n `;\n // @todo: test in mobile\n if (this.isMobile.matches && !this.forcePopover) {\n this.dependencyManager.add('sp-tray');\n import('@spectrum-web-components/tray/sp-tray.js');\n return html`\n <sp-tray\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n >\n ${accessibleMenu}\n </sp-tray>\n `;\n }\n this.dependencyManager.add('sp-popover');\n import('@spectrum-web-components/popover/sp-popover.js');\n return html`\n <sp-popover\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n placement=${this.placement}\n >\n ${accessibleMenu}\n </sp-popover>\n `;\n }\n\n /** Tracks whether the overlay has been rendered at least once. */\n protected hasRenderedOverlay = false;\n\n /**\n * Dispatches a scroll event when the menu is scrolled.\n * Allows parent components to react to menu scroll events.\n */\n private onScroll(): void {\n this.dispatchEvent(\n new Event('scroll', {\n cancelable: true,\n composed: true,\n })\n );\n }\n\n /**\n * Renders the menu and overlay structure.\n * Lazily renders the overlay only after the picker has been focused or opened.\n */\n protected get renderMenu(): TemplateResult {\n const menu = html`\n <sp-menu\n aria-labelledby=\"applied-label\"\n @change=${this.handleChange}\n id=\"menu\"\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n @scroll=${this.onScroll}\n role=${this.listRole}\n .selects=${this.selects}\n .selected=${this.value ? [this.value] : []}\n .shouldSupportDragAndSelect=${!this.isTouchDevice.matches}\n size=${this.size}\n @sp-menu-item-keydown=${this.handleEscape}\n @sp-menu-item-added-or-updated=${this.shouldManageSelection}\n >\n <slot @slotchange=${this.shouldScheduleManageSelection}></slot>\n </sp-menu>\n `;\n this.hasRenderedOverlay =\n this.hasRenderedOverlay ||\n this.focused ||\n this.open ||\n !!this.deprecatedMenu;\n if (this.hasRenderedOverlay) {\n if (this.dependencyManager.loaded) {\n this.dependencyManager.add('sp-overlay');\n }\n return this.renderOverlay(menu);\n }\n return menu;\n }\n\n /** Tracks whether a selection change is already scheduled for the next frame. */\n public willManageSelection = false;\n\n /**\n * Schedules selection management for the next animation frame.\n * Called when the value changes or menu slot content changes.\n * Prevents duplicate scheduling if already pending.\n *\n * @param event - Optional event that triggered the scheduling\n */\n protected shouldScheduleManageSelection(event?: Event): void {\n if (\n !this.willManageSelection &&\n (!event ||\n ((event.target as HTMLElement).getRootNode() as ShadowRoot).host ===\n this)\n ) {\n this.willManageSelection = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.manageSelection();\n });\n });\n }\n }\n\n /**\n * Immediately manages selection when a menu item is added or updated.\n * Skips if selection management is already scheduled.\n */\n protected shouldManageSelection(): void {\n if (this.willManageSelection) {\n return;\n }\n this.willManageSelection = true;\n this.manageSelection();\n }\n\n /**\n * Synchronizes the menu selection state with the picker's current value.\n * Finds and selects the menu item matching the current value,\n * and deselects all other items.\n */\n protected async manageSelection(): Promise<void> {\n if (this.selects == null) {\n return;\n }\n\n this.selectionPromise = new Promise(\n (res) => (this.selectionResolver = res)\n );\n let selectedItem: MenuItem | undefined;\n await this.optionsMenu.updateComplete;\n if (this.recentlyConnected) {\n // Work around for attach timing differences in Safari and Firefox.\n // Remove when refactoring to Menu passthrough wrapper.\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n this.recentlyConnected = false;\n }\n this.menuItems.forEach((item) => {\n if (this.value === item.value && !item.disabled) {\n selectedItem = item;\n } else {\n item.selected = false;\n }\n });\n if (selectedItem) {\n selectedItem.selected = !!this.selects;\n this.selectedItem = selectedItem;\n } else {\n // Only clear value when items exist with real values but none match.\n // Preserve value if items are pending (lazy loaded, async render, incomplete upgrade).\n const hasItemsWithValues = this.menuItems.some(\n (item) => item.value != null || item.getAttribute?.('value') != null\n );\n if (this.menuItems.length > 0 && hasItemsWithValues) {\n this.value = '';\n this.selectedItem = undefined;\n }\n }\n if (this.open) {\n await this.optionsMenu.updateComplete;\n this.optionsMenu.updateSelectedItemIndex();\n }\n this.selectionResolver();\n this.willManageSelection = false;\n }\n\n private selectionPromise = Promise.resolve();\n private selectionResolver!: () => void;\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.selectionPromise;\n return complete;\n }\n\n private recentlyConnected = false;\n\n /** Tracks the target of an active Enter keydown to prevent double-activation. */\n private enterKeydownOn: EventTarget | null = null;\n\n /**\n * Handles Enter key events to prevent double-activation of menu items.\n * Tracks keydown state and clears it on keyup.\n * Also prevents Enter from triggering submenus that aren't open.\n *\n * @param event - The keyboard event\n */\n protected handleEnterKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Enter') {\n return;\n }\n const target = event?.target as MenuItem;\n if (!target.open && target.hasSubmenu) {\n event.preventDefault();\n return;\n }\n\n if (this.enterKeydownOn) {\n event.preventDefault();\n return;\n }\n this.enterKeydownOn = event.target;\n this.addEventListener(\n 'keyup',\n async (keyupEvent: KeyboardEvent) => {\n if (keyupEvent.key !== 'Enter') {\n return;\n }\n this.enterKeydownOn = null;\n },\n { once: true }\n );\n };\n\n public override connectedCallback(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `PickerBase class is deprecated and will be removed in a future release. Use the ExpandableElement base class instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#deprecation',\n { level: 'deprecation' }\n );\n }\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (!this.tooltipEl?.selfManaged) {\n return;\n }\n const overlayElement = this.tooltipEl.overlayElement;\n if (overlayElement) {\n overlayElement.triggerElement = this.button;\n }\n });\n\n this.recentlyConnected = this.hasUpdated;\n this.addEventListener('focus', this.handleFocus);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this.handleFocus);\n }\n}\n\n/**\n * An `<sp-picker>` is a dropdown selection component that allows users to choose\n * a single option from a list of menu items. It supports keyboard navigation,\n * including arrow keys to cycle through options without opening the menu.\n *\n * @element sp-picker\n *\n * @slot label - The placeholder content for the Picker\n * @slot description - The description content for the Picker\n * @slot tooltip - Tooltip to to be applied to the the Picker Button\n * @slot - menu items to be listed in the Picker\n * @fires change - Announces that the `value` of the element has changed\n * @fires sp-opened - Announces that the overlay has been opened\n * @fires sp-closed - Announces that the overlay has been closed\n */\nexport class Picker extends SizedMixin(ExpandableElement, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [pickerStyles, chevronStyles];\n }\n\n /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n private deprecatedMenu: Menu | null = null;\n\n /**\n * Controls how icons are displayed in the picker button.\n * - `'only'`: Shows only the icon, hiding the label visually.\n * - `'none'`: Hides the icon entirely.\n */\n @property({ type: String, reflect: true })\n public icons?: 'only' | 'none';\n\n /** Whether the picker is in an invalid state. Displays a validation icon when true. */\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n /** Defines a string value that labels the Picker while it is in pending state. */\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n /** The placeholder label displayed when no item is selected. */\n @property()\n public label?: string;\n\n /**\n * The selection mode for the picker's menu.\n * Always forced to `'single'` for standard picker behavior.\n */\n public selects: undefined | 'single' = 'single';\n\n /** The alignment of the associated label, set by an external field label component. */\n @state()\n public labelAlignment?: 'inline';\n\n /**\n * Returns the list of menu items contained in the picker's options menu.\n */\n protected get menuItems(): MenuItem[] {\n return this.optionsMenu.childItems;\n }\n\n /**\n * @deprecated This property always returns true and will be removed in a future version.\n */\n public get selfManageFocusElement(): boolean {\n return true;\n }\n\n /** Reference to the tooltip element, if one is slotted. */\n protected tooltipEl?: Tooltip;\n\n /** Whether to render the picker in quiet mode with minimal visual styling. */\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /** The current value of the picker, corresponding to the selected menu item's value. */\n @property({ type: String })\n public value = '';\n\n /**\n * The currently selected menu item, or undefined if no item is selected.\n */\n @property({ attribute: false })\n public get selectedItem(): MenuItem | undefined {\n return this._selectedItem;\n }\n\n public set selectedItem(selectedItem: MenuItem | undefined) {\n this.selectedItemContent = selectedItem\n ? selectedItem.itemChildren\n : undefined;\n\n if (selectedItem === this.selectedItem) {\n return;\n }\n const oldSelectedItem = this.selectedItem;\n this._selectedItem = selectedItem;\n this.requestUpdate('selectedItem', oldSelectedItem);\n }\n\n _selectedItem?: MenuItem;\n\n /** The ARIA role for the menu list element. */\n protected listRole: 'listbox' | 'menu' = 'listbox';\n\n /** The ARIA role for individual menu items. */\n protected itemRole = 'option';\n\n /**\n * Programmatically applies visible focus styling to the picker.\n * Has no effect when the picker is disabled.\n */\n public forceFocusVisible(): void {\n if (this.disabled) {\n return;\n }\n\n this.focused = true;\n }\n\n /**\n * Toggles the picker's open state when called programmatically.\n * Note: Pointer events are handled by the interaction controller.\n */\n public override click(): void {\n this.toggle();\n }\n\n /**\n * Handles click events on the trigger button.\n * Note: Pointer events are typically handled by the interaction controller;\n * this method is called when `this.button.click()` is invoked programmatically.\n */\n public handleButtonClick(): void {\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n /**\n * Handles blur events on the trigger button, removing focus styling.\n */\n public handleButtonBlur(): void {\n this.focused = false;\n }\n\n /**\n * @deprecated Use `focus()` instead.\n * Focuses the picker button and applies focus styling.\n */\n public handleHelperFocus(): void {\n // set focused to true here instead of handleButtonFocus so clicks don't flash a focus outline\n this.focused = true;\n this.button.focus();\n }\n\n /**\n * Handles focus events on the picker, applying visible focus styling\n * only when focus is visible in the tree.\n */\n public handleFocus(): void {\n if (!this.disabled && this.focusElement) {\n this.focused = this.hasVisibleFocusInTree();\n }\n }\n\n /**\n * Handles change events from the menu, updating the selected value.\n * Dispatches a `change` event that can be prevented to cancel the selection.\n *\n * @param event - The change event from the menu\n */\n public handleChange(event: Event): void {\n if (this.strategy) {\n this.strategy.preventNextToggle = 'no';\n }\n const target = event.target as Menu;\n const [selected] = target.selectedItems;\n event.stopPropagation();\n if (event.cancelable) {\n this.setValueFromItem(selected, event);\n } else {\n // Non-cancelable \"change\" events announce a selection with no value\n // change that should close the Picker element.\n this.open = false;\n if (this.strategy) {\n this.strategy.open = false;\n }\n }\n }\n\n /**\n * Handles focus events on the trigger button, delegating to the interaction strategy.\n *\n * @param event - The focus event\n */\n public handleButtonFocus(event: FocusEvent): void {\n this.strategy?.handleButtonFocus(event);\n }\n\n /**\n * Handles Escape key press to close the picker overlay.\n *\n * @param event - The keyboard event\n */\n protected handleEscape = (\n event: MenuItemKeydownEvent | KeyboardEvent\n ): void => {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n event.preventDefault();\n this.toggle(false);\n }\n };\n\n /**\n * Enhanced keyboard handler that supports arrow key navigation to cycle\n * through options without opening the menu (in addition to base navigation).\n *\n * @param event - The keyboard event\n */\n protected handleKeydown = (event: KeyboardEvent): void => {\n const { key } = event;\n const handledKeys = [\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n ' ',\n 'Escape',\n ].includes(key);\n const openKeys = ['ArrowUp', 'ArrowDown', 'Enter', ' '].includes(key);\n const arrowKeys = [\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n ].includes(key);\n this.focused = true;\n if ('Escape' === key) {\n this.handleEscape(event);\n return;\n }\n if (!handledKeys || this.readonly || this.pending) {\n return;\n }\n if (openKeys) {\n this.keyboardOpen();\n event.preventDefault();\n if (arrowKeys) {\n event.stopPropagation();\n }\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n const nextItem = this.optionsMenu?.getNeighboringFocusableElement(\n this.selectedItem,\n key === 'ArrowLeft'\n );\n if (!this.value || nextItem !== this.selectedItem) {\n // updates picker text but does not fire change event until action is completed\n if (nextItem) {\n this.setValueFromItem(nextItem as MenuItem);\n }\n }\n };\n\n /**\n * Opens the picker via keyboard interaction and focuses the first selected item.\n * If already open, focuses the first selected item in the menu.\n */\n protected async keyboardOpen(): Promise<void> {\n // if the menu is not open, we need to toggle it and wait for it to open to focus on the first selected item\n if (!this.open || !this.strategy.open) {\n this.addEventListener(\n 'sp-opened',\n () => this.optionsMenu?.focusOnFirstSelectedItem(),\n {\n once: true,\n }\n );\n this.toggle(true);\n } else {\n // if the menu is already open, we need to focus on the first selected item\n this.optionsMenu?.focusOnFirstSelectedItem();\n }\n }\n\n /**\n * Sets the picker's value from a menu item selection.\n * Dispatches a cancelable `change` event and reverts the selection if prevented.\n *\n * @param item - The menu item to select\n * @param menuChangeEvent - The original menu change event, if any\n */\n protected async setValueFromItem(\n item: MenuItem,\n menuChangeEvent?: Event\n ): Promise<void> {\n this.open = false;\n // should always close when \"setting\" a value\n const oldSelectedItem = this.selectedItem;\n const oldValue = this.value;\n\n // Set a value.\n this.selectedItem = item;\n this.value = item?.value ?? '';\n await this.updateComplete;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n // Allow it to be prevented.\n cancelable: true,\n composed: true,\n })\n );\n if (!applyDefault && this.selects) {\n if (menuChangeEvent) {\n menuChangeEvent.preventDefault();\n }\n this.setMenuItemSelected(this.selectedItem as MenuItem, false);\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, true);\n }\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n this.open = true;\n if (this.strategy) {\n this.strategy.open = true;\n }\n return;\n } else if (!this.selects) {\n // Unset the value if not carrying a selection\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n return;\n }\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, false);\n }\n this.setMenuItemSelected(item, !!this.selects);\n }\n\n /**\n * Updates the selected state of a menu item.\n *\n * @param item - The menu item to update\n * @param value - Whether the item should be selected\n */\n protected setMenuItemSelected(item: MenuItem, value: boolean): void {\n // matches null | undefined\n if (this.selects == null) {\n return;\n }\n item.selected = value;\n }\n\n /**\n * Returns inline styles for the overlay container.\n * On mobile, sets full width; on desktop, returns empty styles.\n */\n protected get containerStyles(): StyleInfo {\n const styles: StyleInfo = {};\n if (!this.quiet) {\n styles['min-width'] = `${this.offsetWidth}px`;\n }\n // @todo test in mobile\n /* c8 ignore next 5 */\n if (this.isMobile.matches) {\n styles['--swc-menu-width'] = '100%';\n }\n return styles;\n }\n\n /**\n * The content (icon and text) of the currently selected menu item.\n * Used to render the selected item's display in the picker button.\n */\n @state()\n protected get selectedItemContent(): MenuItemChildren {\n return this._selectedItemContent || { icon: [], content: [] };\n }\n\n protected set selectedItemContent(\n selectedItemContent: MenuItemChildren | undefined\n ) {\n if (selectedItemContent === this.selectedItemContent) {\n return;\n }\n\n const oldContent = this.selectedItemContent;\n this._selectedItemContent = selectedItemContent;\n this.requestUpdate('selectedItemContent', oldContent);\n }\n\n _selectedItemContent?: MenuItemChildren;\n\n /**\n * Handles slotchange events for the tooltip slot.\n * Sets up the trigger element for self-managed tooltips.\n *\n * @param event - The slotchange event\n */\n protected handleTooltipSlotchange(\n event: Event & { target: HTMLSlotElement }\n ): void {\n this.tooltipEl = event.target.assignedElements()[0] as Tooltip | undefined;\n\n // Set up trigger element for self-managed tooltips\n if (this.tooltipEl?.selfManaged) {\n // Wait for the tooltip to be fully initialized\n this.updateComplete.then(() => {\n if (this.tooltipEl?.overlayElement && this.button) {\n this.tooltipEl.overlayElement.triggerElement = this.button;\n }\n });\n }\n }\n\n /**\n * Renders the label content for the picker button.\n * Shows the selected item's content if available, otherwise renders the placeholder label.\n *\n * @param content - The content nodes from the selected item\n * @returns The rendered label content\n */\n protected renderLabelContent(content: Node[]): TemplateResult | Node[] {\n if (this.value && this.selectedItem) {\n return content;\n }\n return html`\n <slot name=\"label\" id=\"label\">\n <span aria-hidden=${ifDefined(this.appliedLabel ? undefined : 'true')}>\n ${this.label}\n </span>\n </slot>\n `;\n }\n\n /**\n * Renders the loading indicator shown during pending state.\n * Dynamically imports the progress-circle component.\n *\n * @returns The rendered progress circle template\n */\n protected renderLoader(): TemplateResult {\n import('@spectrum-web-components/progress-circle/sp-progress-circle.js');\n return html`\n <sp-progress-circle\n size=\"s\"\n indeterminate\n role=\"presentation\"\n class=\"progress-circle\"\n ></sp-progress-circle>\n `;\n }\n\n /**\n * Returns the content to render inside the picker button,\n * including the icon, label, validation icon, and chevron.\n */\n protected get buttonContent(): TemplateResult[] {\n const labelClasses = {\n 'visually-hidden': this.icons === 'only' && !!this.value,\n placeholder: !this.value,\n label: true,\n };\n const appliedLabel = this.appliedLabel || this.label;\n return [\n html`\n <span id=\"icon\" ?hidden=${this.icons === 'none'}>\n ${this.selectedItemContent.icon}\n </span>\n <span\n id=${ifDefined(this.value && this.selectedItem ? 'label' : undefined)}\n class=${classMap(labelClasses)}\n >\n ${this.renderLabelContent(this.selectedItemContent.content)}\n </span>\n ${this.value && this.selectedItem\n ? html`\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"applied-label\"\n >\n ${appliedLabel}\n <slot name=\"label\"></slot>\n </span>\n `\n : html`\n <span hidden id=\"applied-label\">${appliedLabel}</span>\n `}\n ${this.invalid && !this.pending\n ? html`\n <sp-icon-alert class=\"validation-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.pending\n ? html`\n ${this.renderLoader()}\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"pending-label\"\n >\n ${this.pendingLabel}\n </span>\n `\n : nothing}\n <sp-icon-chevron100\n class=\"picker ${chevronClass[this.size as DefaultElementSize]}\"\n ></sp-icon-chevron100>\n `,\n ];\n }\n\n /**\n * Callback invoked by an associated field label to apply its label value.\n * Sets the applied label and determines label alignment based on the field label's configuration.\n *\n * @param value - The label text value\n * @param labelElement - The field label element providing the label\n */\n applyFocusElementLabel = (value: string, labelElement: FieldLabel): void => {\n this.appliedLabel = value;\n this.labelAlignment = labelElement.sideAligned ? 'inline' : undefined;\n };\n\n /**\n * Checks whether the picker has an accessible label through any supported method:\n * - `label` attribute\n * - `aria-label` attribute\n * - `aria-labelledby` attribute\n * - Applied label from a field label\n * - Slotted label content\n *\n * @returns True if an accessible label is present\n */\n protected hasAccessibleLabel(): boolean {\n const slotContent =\n this.querySelector('[slot=\"label\"]')?.textContent &&\n this.querySelector('[slot=\"label\"]')?.textContent?.trim() !== '';\n const slotAlt =\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() &&\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() !== '';\n return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n !!slotContent ||\n !!slotAlt\n );\n }\n\n /**\n * Logs a warning in debug mode when the picker lacks an accessible label.\n * Provides guidance on how to make the picker accessible.\n */\n protected warnNoLabel(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> needs one of the following to be accessible:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#accessibility',\n {\n type: 'accessibility',\n issues: [\n `an <sp-field-label> element with a \\`for\\` attribute referencing the \\`id\\` of the \\`<${this.localName}>\\`, or`,\n 'value supplied to the \"label\" attribute, which will be displayed visually as placeholder text, or',\n 'text content supplied in a <span> with slot=\"label\", which will also be displayed visually as placeholder text.',\n ],\n }\n );\n }\n }\n\n /**\n * Renders the overlay element containing the menu.\n * Configures the overlay with appropriate placement, type, and event handlers.\n *\n * @param menu - The menu template to render inside the overlay\n * @returns The rendered overlay template\n */\n protected renderOverlay(menu: TemplateResult): TemplateResult {\n const container = this.renderContainer(menu);\n this.dependencyManager.add('sp-overlay');\n import('@spectrum-web-components/overlay/sp-overlay.js');\n return html`\n <sp-overlay\n @slottable-request=${this.handleSlottableRequest}\n @beforetoggle=${this.handleBeforetoggle}\n .triggerElement=${this as HTMLElement}\n .offset=${0}\n ?open=${this.open && this.dependencyManager.loaded}\n .placement=${this.isMobile.matches && !this.forcePopover\n ? undefined\n : this.placement}\n .type=${this.isMobile.matches && !this.forcePopover ? 'modal' : 'auto'}\n .receivesFocus=${'false'}\n .willPreventClose=${this.strategy?.preventNextToggle !== 'no' &&\n this.open &&\n this.dependencyManager.loaded}\n >\n ${container}\n </sp-overlay>\n `;\n }\n\n /**\n * Renders the description slot for additional picker context.\n * Content is referenced by aria-describedby for accessibility.\n */\n protected get renderDescriptionSlot(): TemplateResult {\n return html`\n <div id=${DESCRIPTION_ID}>\n <slot name=\"description\"></slot>\n </div>\n `;\n }\n // a helper to throw focus to the button is needed because Safari\n // won't include buttons in the tab order even with tabindex=\"0\"\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <button\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-describedby=\"tooltip ${DESCRIPTION_ID}\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-haspopup=\"true\"\n aria-labelledby=\"icon label applied-label pending-label\"\n id=\"button\"\n class=${ifDefined(\n this.labelAlignment ? `label-${this.labelAlignment}` : undefined\n )}\n @focus=${this.handleButtonFocus}\n @blur=${this.handleButtonBlur}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </button>\n <slot\n aria-hidden=\"true\"\n name=\"tooltip\"\n id=\"tooltip\"\n @keydown=${this.handleKeydown}\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override willUpdate(changes: PropertyValues<this>): void {\n super.willUpdate(changes);\n if (changes.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (this.selects) {\n /**\n * Always force `selects` to \"single\" when set.\n *\n * @todo Add support functionally and visually for \"multiple\"\n */\n this.selects = 'single';\n }\n if (changes.has('disabled') && this.disabled) {\n this.close();\n }\n if (changes.has('pending') && this.pending) {\n this.close();\n }\n if (changes.has('value')) {\n // MenuItems update a frame late for <slot> management,\n // await the same here.\n this.shouldScheduleManageSelection();\n }\n // Maybe it's finally time to remove this support?\n if (!this.hasUpdated) {\n this.deprecatedMenu = this.querySelector(':scope > sp-menu');\n this.deprecatedMenu?.toggleAttribute('ignore', true);\n this.deprecatedMenu?.setAttribute('selects', 'inherit');\n }\n if (window.__swc?.DEBUG) {\n if (!this.hasUpdated && this.querySelector(':scope > sp-menu')) {\n const { localName } = this;\n window.__swc.warn(\n this,\n `You no longer need to provide an <sp-menu> child to ${localName}. Any styling or attributes on the <sp-menu> will be ignored.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#sizes',\n { level: 'deprecation' }\n );\n }\n this.updateComplete.then(async () => {\n // Attributes should be user supplied, making them available before first update.\n // However, `appliesLabel` is applied by external elements that must be update complete as well to be bound appropriately.\n await new Promise((res) => requestAnimationFrame(res));\n await new Promise((res) => requestAnimationFrame(res));\n if (!this.hasAccessibleLabel()) {\n this.warnNoLabel();\n }\n });\n }\n super.update(changes);\n }\n\n /**\n * Binds the keydown event listener to the trigger button.\n * Called during first update to enable keyboard navigation.\n */\n protected bindButtonKeydownListener(): void {\n this.button.addEventListener('keydown', this.handleKeydown);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('open') && this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n protected override async firstUpdated(\n changes: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changes);\n this.bindButtonKeydownListener();\n this.bindEvents();\n\n await this.updateComplete;\n if (this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Renders a visually hidden dismiss button for accessibility.\n * Allows screen reader users to dismiss the overlay.\n */\n protected get dismissHelper(): TemplateResult {\n return html`\n <div class=\"visually-hidden\">\n <button\n tabindex=\"-1\"\n aria-label=\"Dismiss\"\n @click=${this.close}\n ></button>\n </div>\n `;\n }\n\n /**\n * Renders the overlay container (popover or tray) based on device type.\n * On mobile, uses a tray; on desktop, uses a popover.\n *\n * @param menu - The menu template to wrap in the container\n * @returns The rendered container template\n */\n protected renderContainer(menu: TemplateResult): TemplateResult {\n const accessibleMenu = html`\n ${this.dismissHelper} ${menu} ${this.dismissHelper}\n `;\n // @todo: test in mobile\n if (this.isMobile.matches && !this.forcePopover) {\n this.dependencyManager.add('sp-tray');\n import('@spectrum-web-components/tray/sp-tray.js');\n return html`\n <sp-tray\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n >\n ${accessibleMenu}\n </sp-tray>\n `;\n }\n this.dependencyManager.add('sp-popover');\n import('@spectrum-web-components/popover/sp-popover.js');\n return html`\n <sp-popover\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n placement=${this.placement}\n >\n ${accessibleMenu}\n </sp-popover>\n `;\n }\n\n /** Tracks whether the overlay has been rendered at least once. */\n protected hasRenderedOverlay = false;\n\n /**\n * Dispatches a scroll event when the menu is scrolled.\n * Allows parent components to react to menu scroll events.\n */\n private onScroll(): void {\n this.dispatchEvent(\n new Event('scroll', {\n cancelable: true,\n composed: true,\n })\n );\n }\n\n /**\n * Renders the menu and overlay structure.\n * Lazily renders the overlay only after the picker has been focused or opened.\n */\n protected get renderMenu(): TemplateResult {\n const menu = html`\n <sp-menu\n aria-labelledby=\"applied-label\"\n @change=${this.handleChange}\n id=\"menu\"\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n @scroll=${this.onScroll}\n role=${this.listRole}\n .selects=${this.selects}\n .selected=${this.value ? [this.value] : []}\n .shouldSupportDragAndSelect=${!this.isTouchDevice.matches}\n size=${this.size}\n @sp-menu-item-keydown=${this.handleEscape}\n @sp-menu-item-added-or-updated=${this.shouldManageSelection}\n >\n <slot @slotchange=${this.shouldScheduleManageSelection}></slot>\n </sp-menu>\n `;\n this.hasRenderedOverlay =\n this.hasRenderedOverlay ||\n this.focused ||\n this.open ||\n !!this.deprecatedMenu;\n if (this.hasRenderedOverlay) {\n if (this.dependencyManager.loaded) {\n this.dependencyManager.add('sp-overlay');\n }\n return this.renderOverlay(menu);\n }\n return menu;\n }\n\n /** Tracks whether a selection change is already scheduled for the next frame. */\n public willManageSelection = false;\n\n /**\n * Schedules selection management for the next animation frame.\n * Called when the value changes or menu slot content changes.\n * Prevents duplicate scheduling if already pending.\n *\n * @param event - Optional event that triggered the scheduling\n */\n protected shouldScheduleManageSelection(event?: Event): void {\n if (\n !this.willManageSelection &&\n (!event ||\n ((event.target as HTMLElement).getRootNode() as ShadowRoot).host ===\n this)\n ) {\n this.willManageSelection = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.manageSelection();\n });\n });\n }\n }\n\n /**\n * Immediately manages selection when a menu item is added or updated.\n * Skips if selection management is already scheduled.\n */\n protected shouldManageSelection(): void {\n if (this.willManageSelection) {\n return;\n }\n this.willManageSelection = true;\n this.manageSelection();\n }\n\n /**\n * Synchronizes the menu selection state with the picker's current value.\n * Finds and selects the menu item matching the current value,\n * and deselects all other items.\n */\n protected async manageSelection(): Promise<void> {\n if (this.selects == null) {\n return;\n }\n\n this.selectionPromise = new Promise(\n (res) => (this.selectionResolver = res)\n );\n let selectedItem: MenuItem | undefined;\n await this.optionsMenu.updateComplete;\n if (this.recentlyConnected) {\n // Work around for attach timing differences in Safari and Firefox.\n // Remove when refactoring to Menu passthrough wrapper.\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n this.recentlyConnected = false;\n }\n this.menuItems.forEach((item) => {\n if (this.value === item.value && !item.disabled) {\n selectedItem = item;\n } else {\n item.selected = false;\n }\n });\n if (selectedItem) {\n selectedItem.selected = !!this.selects;\n this.selectedItem = selectedItem;\n } else {\n // Only clear value when items exist with real values but none match.\n // Preserve value if items are pending (lazy loaded, async render, incomplete upgrade).\n const hasItemsWithValues = this.menuItems.some(\n (item) => item.value != null || item.getAttribute?.('value') != null\n );\n if (this.menuItems.length > 0 && hasItemsWithValues) {\n this.value = '';\n this.selectedItem = undefined;\n }\n }\n if (this.open) {\n await this.optionsMenu.updateComplete;\n this.optionsMenu.updateSelectedItemIndex();\n }\n this.selectionResolver();\n this.willManageSelection = false;\n }\n\n private selectionPromise = Promise.resolve();\n private selectionResolver!: () => void;\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.selectionPromise;\n return complete;\n }\n\n private recentlyConnected = false;\n\n /** Tracks the target of an active Enter keydown to prevent double-activation. */\n private enterKeydownOn: EventTarget | null = null;\n\n /**\n * Handles Enter key events to prevent double-activation of menu items.\n * Tracks keydown state and clears it on keyup.\n * Also prevents Enter from triggering submenus that aren't open.\n *\n * @param event - The keyboard event\n */\n protected handleEnterKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Enter') {\n return;\n }\n const target = event?.target as MenuItem;\n if (!target.open && target.hasSubmenu) {\n event.preventDefault();\n return;\n }\n\n if (this.enterKeydownOn) {\n event.preventDefault();\n return;\n }\n this.enterKeydownOn = event.target;\n this.addEventListener(\n 'keyup',\n async (keyupEvent: KeyboardEvent) => {\n if (keyupEvent.key !== 'Enter') {\n return;\n }\n this.enterKeydownOn = null;\n },\n { once: true }\n );\n };\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (!this.tooltipEl?.selfManaged) {\n return;\n }\n const overlayElement = this.tooltipEl.overlayElement;\n if (overlayElement) {\n overlayElement.triggerElement = this.button;\n }\n });\n\n this.recentlyConnected = this.hasUpdated;\n this.addEventListener('focus', this.handleFocus);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this.handleFocus);\n }\n}\n"],
|
|
5
|
-
"mappings": "qNAYA,OAGE,QAAAA,EACA,WAAAC,EAEA,cAAAC,EACA,mBAAAC,MAEK,gCACP,OACE,YAAAC,EACA,SAAAC,EACA,SAAAC,MACK,kDACP,OACE,YAAAC,EACA,aAAAC,EAEA,YAAAC,MACK,kDAEP,OAAOC,MAAmB,iEAU1B,OAAS,+BAAAC,MAAmC,wEAC5C,OACE,aAAAC,EACA,mBAAAC,EACA,wBAAAC,MACK,kEAGP,MAAO,gEACP,MAAO,iEACP,MAAO,2CAIP,OAAOC,MAAkB,kBACzB,OAAS,cAAAC,MAAkB,kBAE3B,MAAMC,EAAe,CACnB,EAAG,gCACH,EAAG,iCACH,EAAG,iCACH,GAAI,gCACN,EAEO,aAAM,eAAiB,gBAUvB,aAAM,0BAA0Bd,CAAgB,CAAhD,kCAWL,KAAO,SAAW,IAAIW,EAAqB,KAAMF,CAAS,EAG1D,KAAO,cAAgB,IAAIE,EAAqB,KAAMD,CAAe,EAUrE,KAAO,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OAuEA,4BA2SG4B,EAAA,CADb1B,EAAM,GAjXI,OAkXG",
|
|
6
|
-
"names": ["html", "nothing", "SizedMixin", "SpectrumElement", "property", "query", "state", "classMap", "ifDefined", "styleMap", "chevronStyles", "DependencyManagerController", "IS_MOBILE", "IS_TOUCH_DEVICE", "MatchMediaController", "pickerStyles", "strategies", "chevronClass", "_event", "event", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "shouldRestoreFocus", "options", "target", "open", "__decorateClass", "value", "labelElement", "keyupEvent", "selectedItem", "oldSelectedItem", "selected", "item", "menuChangeEvent", "oldValue", "selectedItemContent", "oldContent", "content", "labelClasses", "appliedLabel", "slotContent", "slotAlt", "menu", "container", "changes", "accessibleMenu", "res", "hasItemsWithValues", "complete", "
|
|
4
|
+
"sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n DefaultElementSize,\n html,\n nothing,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport {\n classMap,\n ifDefined,\n StyleInfo,\n styleMap,\n} from '@spectrum-web-components/base/src/directives.js';\nimport type { FieldLabel } from '@spectrum-web-components/field-label';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { Placement } from '@spectrum-web-components/overlay';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport type { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport { DependencyManagerController } from '@spectrum-web-components/reactive-controllers/src/DependencyManger.js';\nimport {\n IS_MOBILE,\n IS_TOUCH_DEVICE,\n MatchMediaController,\n} from '@spectrum-web-components/reactive-controllers/src/MatchMedia.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-alert.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\n\nimport { DesktopController } from './DesktopController.js';\nimport { MobileController } from './MobileController.js';\nimport pickerStyles from './picker.css.js';\nimport { strategies } from './strategies.js';\n\nconst chevronClass = {\n s: 'spectrum-UIIcon-ChevronDown75',\n m: 'spectrum-UIIcon-ChevronDown100',\n l: 'spectrum-UIIcon-ChevronDown200',\n xl: 'spectrum-UIIcon-ChevronDown300',\n};\n\nexport const DESCRIPTION_ID = 'option-picker';\n\n/**\n * Base class for expandable picker-like components with overlay functionality.\n * Provides common properties and methods for managing an overlay menu,\n * device-specific interaction strategies, and focus management.\n *\n * Extended by Picker, ActionMenu, and other components that display\n * a menu overlay triggered by a button.\n */\nexport class ExpandableElement extends SpectrumElement {\n /**\n * Shadow root configuration with delegatesFocus enabled.\n * Allows focus to be delegated to focusable children within the shadow root.\n */\n static override shadowRootOptions = {\n ...SpectrumElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /** Controller that tracks whether the device is mobile. */\n public isMobile = new MatchMediaController(this, IS_MOBILE);\n\n /** Controller that tracks whether the device supports touch input. */\n public isTouchDevice = new MatchMediaController(this, IS_TOUCH_DEVICE);\n\n /** The interaction strategy controller (desktop or mobile) managing pointer and keyboard events. */\n public strategy!: DesktopController | MobileController;\n\n /** Reference to the component's trigger button element. */\n @query('#button')\n public button!: HTMLButtonElement;\n\n /** Controller that manages lazy-loading of overlay dependencies. */\n public dependencyManager = new DependencyManagerController(this);\n\n /** Whether the component is disabled. When disabled, the component cannot be interacted with. */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /** Whether the component currently has visible focus. */\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n /** Whether the component is read-only. When read-only, the component displays its value but cannot be changed. */\n @property({ type: Boolean, reflect: true })\n public readonly = false;\n\n /** Whether the items are currently loading. */\n @property({ type: Boolean, reflect: true })\n public pending = false;\n\n /**\n * Forces the component to render as a popover on mobile instead of a tray.\n */\n @property({ type: Boolean, reflect: true, attribute: 'force-popover' })\n public forcePopover = false;\n\n /** Whether the component's menu overlay is currently open. */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /** Reference to the component's internal menu element. */\n @query('sp-menu')\n public optionsMenu!: Menu;\n\n /** Reference to the component's overlay element. */\n @query('sp-overlay')\n public overlayElement!: Overlay;\n\n /**\n * The preferred placement of the component's overlay relative to the trigger button.\n *\n * @type {\"top\" | \"top-start\" | \"top-end\" | \"right\" | \"right-start\" | \"right-end\" | \"bottom\" | \"bottom-start\" | \"bottom-end\" | \"left\" | \"left-start\" | \"left-end\"}\n * @attr\n */\n\n @property()\n public placement: Placement = 'bottom-start';\n\n /**\n * Returns the element that should receive focus.\n * When open, returns the options menu; otherwise returns the trigger button.\n */\n public get focusElement(): HTMLElement {\n if (this.open) {\n return this.optionsMenu;\n }\n return this.button;\n }\n\n /**\n * Focuses the appropriate element (button or menu) based on the picker's state.\n *\n * @param options - Standard focus options\n */\n public override focus(options?: FocusOptions): void {\n this.focusElement?.focus(options);\n }\n\n /**\n * Closes the component's overlay.\n * Has no effect when the component is readonly.\n */\n public close(): void {\n if (this.readonly) {\n return;\n }\n if (this.strategy) {\n this.open = false;\n this.strategy.open = false;\n }\n }\n\n /**\n * Toggles the component's open state.\n * Has no effect when the component is readonly, pending, or disabled.\n *\n * @param target - Optional explicit open state. If not provided, toggles the current state.\n */\n public toggle(target?: boolean): void {\n if (this.readonly || this.pending || this.disabled) {\n return;\n }\n const open = typeof target !== 'undefined' ? target : !this.open;\n\n this.open = open;\n if (this.strategy) {\n this.strategy.open = this.open;\n }\n }\n\n /**\n * Handles slottable request events from the overlay.\n * Override in subclasses to customize slottable behavior.\n *\n * @param _event - The slottable request event\n */\n public handleSlottableRequest = (_event: SlottableRequestEvent): void => {};\n\n /**\n * Handles the overlay's beforetoggle event.\n * Manages overlay state and prevents unwanted closures during interaction.\n *\n * @param event - The beforetoggle event with the new state\n */\n protected handleBeforetoggle = (\n event: Event & {\n target: Overlay;\n newState: 'open' | 'closed';\n }\n ): void => {\n if (event.composedPath()[0] !== event.target) {\n return;\n }\n if (event.newState === 'closed') {\n // Track if we should restore focus before the overlay fully closes.\n // This must happen now (in beforetoggle) because by the time sp-closed fires,\n // the overlay animation will be complete and focus will have moved elsewhere.\n const shouldRestoreFocus =\n this.optionsMenu?.matches(':focus-within') &&\n !this.button?.matches(':focus');\n\n // Handle three cases:\n // 1. open was already set to false externally (e.g., via setValueFromItem\n // from a programmatic click) - allow overlay to close\n // 2. preventNextToggle is 'no' - normal close, set open to false\n // 3. Otherwise, prevent browser-driven closure while opening\n if (!this.open) {\n // Already closed externally, sync controller state if present\n if (this.strategy) {\n this.strategy.open = false;\n }\n } else if (this.strategy?.preventNextToggle === 'no') {\n this.open = false;\n } else if (!this.strategy?.pointerdownState) {\n // Prevent browser driven closure while opening the Picker\n // and the expected event series has not completed.\n this.overlayElement?.manuallyKeepOpen();\n }\n\n // Restore focus to the button if focus was in the menu.\n if (shouldRestoreFocus && !this.open) {\n this.button?.focus();\n }\n }\n if (!this.open) {\n this.optionsMenu?.updateSelectedItemIndex();\n this.optionsMenu?.closeDescendentOverlays();\n }\n };\n\n /**\n * Binds the appropriate interaction strategy (desktop or mobile) based on device type.\n * Aborts any existing strategy before creating a new one.\n */\n public bindEvents(): void {\n this.strategy?.abort();\n if (this.isMobile.matches) {\n this.strategy = new strategies['mobile'](\n this.button,\n this as ExpandableElement\n );\n } else {\n this.strategy = new strategies['desktop'](\n this.button,\n this as ExpandableElement\n );\n }\n }\n\n /**\n * Lifecycle callback when the element is disconnected from the DOM.\n * Closes the overlay and releases strategy resources.\n */\n public override disconnectedCallback(): void {\n this.close();\n this.strategy?.releaseDescription();\n super.disconnectedCallback();\n }\n}\n\n/**\n * @slot label - The placeholder content for the Picker\n * @slot description - The description content for the Picker\n * @slot tooltip - Tooltip to to be applied to the the Picker Button\n * @slot - menu items to be listed in the Picker\n * @fires change - Announces that the `value` of the element has changed\n * @fires sp-opened - Announces that the overlay has been opened\n * @fires sp-closed - Announces that the overlay has been closed\n * @deprecated This class is deprecated and will be removed in a future major release. Use the ExpandableElement base class instead.\n * @see https://opensource.adobe.com/spectrum-web-components/components/picker/#deprecation\n */\nexport class PickerBase extends SizedMixin(ExpandableElement, {\n noDefaultSize: true,\n}) {\n /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n private deprecatedMenu: Menu | null = null;\n\n /**\n * Controls how icons are displayed in the picker button.\n * - `'only'`: Shows only the icon, hiding the label visually.\n * - `'none'`: Hides the icon entirely.\n */\n @property({ type: String, reflect: true })\n public icons?: 'only' | 'none';\n\n /** Whether the picker is in an invalid state. Displays a validation icon when true. */\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n /** Defines a string value that labels the Picker while it is in pending state. */\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n /** The placeholder label displayed when no item is selected. */\n @property()\n public label?: string;\n\n /**\n * The selection mode for the picker's menu.\n * Always forced to `'single'` for standard picker behavior.\n */\n public selects: undefined | 'single' = 'single';\n\n /** The alignment of the associated label, set by an external field label component. */\n @state()\n public labelAlignment?: 'inline';\n\n /**\n * Returns the list of menu items contained in the picker's options menu.\n */\n protected get menuItems(): MenuItem[] {\n return this.optionsMenu.childItems;\n }\n\n /**\n * @deprecated This property always returns true and will be removed in a future version.\n */\n public get selfManageFocusElement(): boolean {\n return true;\n }\n\n /** Reference to the tooltip element, if one is slotted. */\n protected tooltipEl?: Tooltip;\n\n /** Whether to render the picker in quiet mode with minimal visual styling. */\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /** The current value of the picker, corresponding to the selected menu item's value. */\n @property({ type: String })\n public value = '';\n\n /**\n * The currently selected menu item, or undefined if no item is selected.\n */\n @property({ attribute: false })\n public get selectedItem(): MenuItem | undefined {\n return this._selectedItem;\n }\n\n public set selectedItem(selectedItem: MenuItem | undefined) {\n this.selectedItemContent = selectedItem\n ? selectedItem.itemChildren\n : undefined;\n\n if (selectedItem === this.selectedItem) {\n return;\n }\n const oldSelectedItem = this.selectedItem;\n this._selectedItem = selectedItem;\n this.requestUpdate('selectedItem', oldSelectedItem);\n }\n\n _selectedItem?: MenuItem;\n\n /** The ARIA role for the menu list element. */\n protected listRole: 'listbox' | 'menu' = 'listbox';\n\n /** The ARIA role for individual menu items. */\n protected itemRole = 'option';\n\n /**\n * Programmatically applies visible focus styling to the picker.\n * Has no effect when the picker is disabled.\n */\n public forceFocusVisible(): void {\n if (this.disabled) {\n return;\n }\n\n this.focused = true;\n }\n\n /**\n * Toggles the picker's open state when called programmatically.\n * Note: Pointer events are handled by the interaction controller.\n */\n public override click(): void {\n this.toggle();\n }\n\n /**\n * Handles click events on the trigger button.\n * Note: Pointer events are typically handled by the interaction controller;\n * this method is called when `this.button.click()` is invoked programmatically.\n */\n public handleButtonClick(): void {\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n /**\n * Handles blur events on the trigger button, removing focus styling.\n */\n public handleButtonBlur(): void {\n this.focused = false;\n }\n\n public override focus(options?: FocusOptions): void {\n this.focusElement?.focus(options);\n }\n\n /**\n * @deprecated Use `focus()` instead.\n * Focuses the picker button and applies focus styling.\n */\n public handleHelperFocus(): void {\n // set focused to true here instead of handleButtonFocus so clicks don't flash a focus outline\n this.focused = true;\n this.button.focus();\n }\n\n /**\n * Handles focus events on the picker, applying visible focus styling\n * only when focus is visible in the tree.\n */\n public handleFocus(): void {\n if (!this.disabled && this.focusElement) {\n this.focused = this.hasVisibleFocusInTree();\n }\n }\n\n /**\n * Handles change events from the menu, updating the selected value.\n * Dispatches a `change` event that can be prevented to cancel the selection.\n *\n * @param event - The change event from the menu\n */\n public handleChange(event: Event): void {\n if (this.strategy) {\n this.strategy.preventNextToggle = 'no';\n }\n const target = event.target as Menu;\n const [selected] = target.selectedItems;\n event.stopPropagation();\n if (event.cancelable) {\n this.setValueFromItem(selected, event);\n } else {\n // Non-cancelable \"change\" events announce a selection with no value\n // change that should close the Picker element.\n this.open = false;\n if (this.strategy) {\n this.strategy.open = false;\n }\n }\n }\n\n /**\n * Handles focus events on the trigger button, delegating to the interaction strategy.\n *\n * @param event - The focus event\n */\n public handleButtonFocus(event: FocusEvent): void {\n this.strategy?.handleButtonFocus(event);\n }\n\n /**\n * Handles Escape key press to close the picker overlay.\n *\n * @param event - The keyboard event\n */\n protected handleEscape = (\n event: MenuItemKeydownEvent | KeyboardEvent\n ): void => {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n event.preventDefault();\n this.toggle(false);\n }\n };\n\n /**\n * Handles keyboard navigation on the picker button.\n * Opens the menu on Arrow keys, Enter, or Space.\n *\n * @param event - The keyboard event\n */\n protected handleKeydown = (event: KeyboardEvent): void => {\n this.focused = true;\n if (!['ArrowUp', 'ArrowDown', 'Enter', ' ', 'Escape'].includes(event.key)) {\n return;\n }\n if (event.key === 'Escape') {\n this.handleEscape(event);\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.keyboardOpen();\n };\n\n /**\n * Opens the picker via keyboard interaction and focuses the first selected item.\n * If already open, focuses the first selected item in the menu.\n */\n protected async keyboardOpen(): Promise<void> {\n // if the menu is not open, we need to toggle it and wait for it to open to focus on the first selected item\n if (!this.open || !this.strategy.open) {\n this.addEventListener(\n 'sp-opened',\n () => this.optionsMenu?.focusOnFirstSelectedItem(),\n {\n once: true,\n }\n );\n this.toggle(true);\n } else {\n // if the menu is already open, we need to focus on the first selected item\n this.optionsMenu?.focusOnFirstSelectedItem();\n }\n }\n\n /**\n * Sets the picker's value from a menu item selection.\n * Dispatches a cancelable `change` event and reverts the selection if prevented.\n *\n * @param item - The menu item to select\n * @param menuChangeEvent - The original menu change event, if any\n */\n protected async setValueFromItem(\n item: MenuItem,\n menuChangeEvent?: Event\n ): Promise<void> {\n this.open = false;\n // should always close when \"setting\" a value\n const oldSelectedItem = this.selectedItem;\n const oldValue = this.value;\n\n // Set a value.\n this.selectedItem = item;\n this.value = item?.value ?? '';\n await this.updateComplete;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n // Allow it to be prevented.\n cancelable: true,\n composed: true,\n })\n );\n if (!applyDefault && this.selects) {\n if (menuChangeEvent) {\n menuChangeEvent.preventDefault();\n }\n this.setMenuItemSelected(this.selectedItem as MenuItem, false);\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, true);\n }\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n this.open = true;\n if (this.strategy) {\n this.strategy.open = true;\n }\n return;\n } else if (!this.selects) {\n // Unset the value if not carrying a selection\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n return;\n }\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, false);\n }\n this.setMenuItemSelected(item, !!this.selects);\n }\n\n /**\n * Updates the selected state of a menu item.\n *\n * @param item - The menu item to update\n * @param value - Whether the item should be selected\n */\n protected setMenuItemSelected(item: MenuItem, value: boolean): void {\n // matches null | undefined\n if (this.selects == null) {\n return;\n }\n item.selected = value;\n }\n\n /**\n * Returns inline styles for the overlay container.\n * On mobile, sets full width; on desktop, returns empty styles.\n */\n protected get containerStyles(): StyleInfo {\n // @todo: test in mobile\n /* c8 ignore next 5 */\n if (this.isMobile.matches) {\n return {\n '--swc-menu-width': '100%',\n };\n }\n return {};\n }\n\n /**\n * The content (icon and text) of the currently selected menu item.\n * Used to render the selected item's display in the picker button.\n */\n @state()\n protected get selectedItemContent(): MenuItemChildren {\n return this._selectedItemContent || { icon: [], content: [] };\n }\n\n protected set selectedItemContent(\n selectedItemContent: MenuItemChildren | undefined\n ) {\n if (selectedItemContent === this.selectedItemContent) {\n return;\n }\n\n const oldContent = this.selectedItemContent;\n this._selectedItemContent = selectedItemContent;\n this.requestUpdate('selectedItemContent', oldContent);\n }\n\n _selectedItemContent?: MenuItemChildren;\n\n /**\n * Handles slotchange events for the tooltip slot.\n * Sets up the trigger element for self-managed tooltips.\n *\n * @param event - The slotchange event\n */\n protected handleTooltipSlotchange(\n event: Event & { target: HTMLSlotElement }\n ): void {\n const tooltipEl = event.target.assignedElements()[0] as Tooltip | undefined;\n this.tooltipEl = tooltipEl;\n\n // Set up trigger element for self-managed tooltips\n if (tooltipEl?.selfManaged) {\n if (this.button) {\n tooltipEl.triggerElement = this.button;\n }\n this.updateComplete.then(() => {\n if (tooltipEl.selfManaged && this.button) {\n tooltipEl.triggerElement = this.button;\n }\n });\n }\n }\n\n /**\n * Renders the label content for the picker button.\n * Shows the selected item's content if available, otherwise renders the placeholder label.\n *\n * @param content - The content nodes from the selected item\n * @returns The rendered label content\n */\n protected renderLabelContent(content: Node[]): TemplateResult | Node[] {\n if (this.value && this.selectedItem) {\n return content;\n }\n return html`\n <slot name=\"label\" id=\"label\">\n <span aria-hidden=${ifDefined(this.appliedLabel ? undefined : 'true')}>\n ${this.label}\n </span>\n </slot>\n `;\n }\n\n /**\n * Renders the loading indicator shown during pending state.\n * Dynamically imports the progress-circle component.\n *\n * @returns The rendered progress circle template\n */\n protected renderLoader(): TemplateResult {\n import('@spectrum-web-components/progress-circle/sp-progress-circle.js');\n return html`\n <sp-progress-circle\n size=\"s\"\n indeterminate\n role=\"presentation\"\n class=\"progress-circle\"\n ></sp-progress-circle>\n `;\n }\n\n /**\n * Returns the content to render inside the picker button,\n * including the icon, label, validation icon, and chevron.\n */\n protected get buttonContent(): TemplateResult[] {\n const labelClasses = {\n 'visually-hidden': this.icons === 'only' && !!this.value,\n placeholder: !this.value,\n label: true,\n };\n const appliedLabel = this.appliedLabel || this.label;\n return [\n html`\n <span id=\"icon\" ?hidden=${this.icons === 'none'}>\n ${this.selectedItemContent.icon}\n </span>\n <span\n id=${ifDefined(this.value && this.selectedItem ? 'label' : undefined)}\n class=${classMap(labelClasses)}\n >\n ${this.renderLabelContent(this.selectedItemContent.content)}\n </span>\n ${this.value && this.selectedItem\n ? html`\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"applied-label\"\n >\n ${appliedLabel}\n <slot name=\"label\"></slot>\n </span>\n `\n : html`\n <span hidden id=\"applied-label\">${appliedLabel}</span>\n `}\n ${this.invalid && !this.pending\n ? html`\n <sp-icon-alert class=\"validation-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.pending\n ? html`\n ${this.renderLoader()}\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"pending-label\"\n >\n ${this.pendingLabel}\n </span>\n `\n : nothing}\n <sp-icon-chevron100\n class=\"picker ${chevronClass[this.size as DefaultElementSize]}\"\n ></sp-icon-chevron100>\n `,\n ];\n }\n\n /**\n * Callback invoked by an associated field label to apply its label value.\n * Sets the applied label and determines label alignment based on the field label's configuration.\n *\n * @param value - The label text value\n * @param labelElement - The field label element providing the label\n */\n applyFocusElementLabel = (value: string, labelElement: FieldLabel): void => {\n this.appliedLabel = value;\n this.labelAlignment = labelElement.sideAligned ? 'inline' : undefined;\n };\n\n /**\n * Checks whether the picker has an accessible label through any supported method:\n * - `label` attribute\n * - `aria-label` attribute\n * - `aria-labelledby` attribute\n * - Applied label from a field label\n * - Slotted label content\n *\n * @returns True if an accessible label is present\n */\n protected hasAccessibleLabel(): boolean {\n const slotContent =\n this.querySelector('[slot=\"label\"]')?.textContent &&\n this.querySelector('[slot=\"label\"]')?.textContent?.trim() !== '';\n const slotAlt =\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() &&\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() !== '';\n return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n !!slotContent ||\n !!slotAlt\n );\n }\n\n /**\n * Logs a warning in debug mode when the picker lacks an accessible label.\n * Provides guidance on how to make the picker accessible.\n */\n protected warnNoLabel(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> needs one of the following to be accessible:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#accessibility',\n {\n type: 'accessibility',\n issues: [\n `an <sp-field-label> element with a \\`for\\` attribute referencing the \\`id\\` of the \\`<${this.localName}>\\`, or`,\n 'value supplied to the \"label\" attribute, which will be displayed visually as placeholder text, or',\n 'text content supplied in a <span> with slot=\"label\", which will also be displayed visually as placeholder text.',\n ],\n }\n );\n }\n }\n\n /**\n * Renders the overlay element containing the menu.\n * Configures the overlay with appropriate placement, type, and event handlers.\n *\n * @param menu - The menu template to render inside the overlay\n * @returns The rendered overlay template\n */\n protected renderOverlay(menu: TemplateResult): TemplateResult {\n const container = this.renderContainer(menu);\n this.dependencyManager.add('sp-overlay');\n import('@spectrum-web-components/overlay/sp-overlay.js');\n return html`\n <sp-overlay\n @slottable-request=${this.handleSlottableRequest}\n @beforetoggle=${this.handleBeforetoggle}\n .triggerElement=${this as HTMLElement}\n .offset=${0}\n ?open=${this.open && this.dependencyManager.loaded}\n .placement=${this.isMobile.matches && !this.forcePopover\n ? undefined\n : this.placement}\n .type=${this.isMobile.matches && !this.forcePopover ? 'modal' : 'auto'}\n .receivesFocus=${'false'}\n .willPreventClose=${this.strategy?.preventNextToggle !== 'no' &&\n this.open &&\n this.dependencyManager.loaded}\n >\n ${container}\n </sp-overlay>\n `;\n }\n\n /**\n * Renders the description slot for additional picker context.\n * Content is referenced by aria-describedby for accessibility.\n */\n protected get renderDescriptionSlot(): TemplateResult {\n return html`\n <div id=${DESCRIPTION_ID}>\n <slot name=\"description\"></slot>\n </div>\n `;\n }\n\n // a helper to throw focus to the button is needed because Safari\n // won't include buttons in the tab order even with tabindex=\"0\"\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <button\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-describedby=\"tooltip ${DESCRIPTION_ID}\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-haspopup=\"true\"\n aria-labelledby=\"icon label applied-label pending-label\"\n id=\"button\"\n class=${ifDefined(\n this.labelAlignment ? `label-${this.labelAlignment}` : undefined\n )}\n @focus=${this.handleButtonFocus}\n @blur=${this.handleButtonBlur}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </button>\n <slot\n aria-hidden=\"true\"\n name=\"tooltip\"\n id=\"tooltip\"\n @keydown=${this.handleKeydown}\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override willUpdate(changes: PropertyValues<this>): void {\n super.willUpdate(changes);\n if (changes.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (this.selects) {\n // Always force `selects` to \"single\" when set.\n // @todo: Add support functionally and visually for \"multiple\"\n this.selects = 'single';\n }\n if (changes.has('disabled') && this.disabled) {\n this.close();\n }\n if (changes.has('pending') && this.pending) {\n this.close();\n }\n if (changes.has('value')) {\n // MenuItems update a frame late for <slot> management,\n // await the same here.\n this.shouldScheduleManageSelection();\n }\n // Maybe it's finally time to remove this support?\n if (!this.hasUpdated) {\n this.deprecatedMenu = this.querySelector(':scope > sp-menu');\n this.deprecatedMenu?.toggleAttribute('ignore', true);\n this.deprecatedMenu?.setAttribute('selects', 'inherit');\n }\n if (window.__swc?.DEBUG) {\n if (!this.hasUpdated && this.querySelector(':scope > sp-menu')) {\n const { localName } = this;\n window.__swc.warn(\n this,\n `You no longer need to provide an <sp-menu> child to ${localName}. Any styling or attributes on the <sp-menu> will be ignored.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#sizes',\n { level: 'deprecation' }\n );\n }\n this.updateComplete.then(async () => {\n // Attributes should be user supplied, making them available before first update.\n // However, `appliesLabel` is applied by external elements that must be update complete as well to be bound appropriately.\n await new Promise((res) => requestAnimationFrame(res));\n await new Promise((res) => requestAnimationFrame(res));\n if (!this.hasAccessibleLabel()) {\n this.warnNoLabel();\n }\n });\n }\n super.update(changes);\n }\n\n /**\n * Binds the keydown event listener to the trigger button.\n * Called during first update to enable keyboard navigation.\n */\n protected bindButtonKeydownListener(): void {\n this.button.addEventListener('keydown', this.handleKeydown);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('open') && this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n protected override async firstUpdated(\n changes: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changes);\n this.bindButtonKeydownListener();\n this.bindEvents();\n\n await this.updateComplete;\n if (this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Renders a visually hidden dismiss button for accessibility.\n * Allows screen reader users to dismiss the overlay.\n */\n protected get dismissHelper(): TemplateResult {\n return html`\n <div class=\"visually-hidden\">\n <button\n tabindex=\"-1\"\n aria-label=\"Dismiss\"\n @click=${this.close}\n ></button>\n </div>\n `;\n }\n\n /**\n * Renders the overlay container (popover or tray) based on device type.\n * On mobile, uses a tray; on desktop, uses a popover.\n *\n * @param menu - The menu template to wrap in the container\n * @returns The rendered container template\n */\n protected renderContainer(menu: TemplateResult): TemplateResult {\n const accessibleMenu = html`\n ${this.dismissHelper} ${menu} ${this.dismissHelper}\n `;\n // @todo: test in mobile\n if (this.isMobile.matches && !this.forcePopover) {\n this.dependencyManager.add('sp-tray');\n import('@spectrum-web-components/tray/sp-tray.js');\n return html`\n <sp-tray\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n >\n ${accessibleMenu}\n </sp-tray>\n `;\n }\n this.dependencyManager.add('sp-popover');\n import('@spectrum-web-components/popover/sp-popover.js');\n return html`\n <sp-popover\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n placement=${this.placement}\n >\n ${accessibleMenu}\n </sp-popover>\n `;\n }\n\n /** Tracks whether the overlay has been rendered at least once. */\n protected hasRenderedOverlay = false;\n\n /**\n * Dispatches a scroll event when the menu is scrolled.\n * Allows parent components to react to menu scroll events.\n */\n private onScroll(): void {\n this.dispatchEvent(\n new Event('scroll', {\n cancelable: true,\n composed: true,\n })\n );\n }\n\n /**\n * Renders the menu and overlay structure.\n * Lazily renders the overlay only after the picker has been focused or opened.\n */\n protected get renderMenu(): TemplateResult {\n const menu = html`\n <sp-menu\n aria-labelledby=\"applied-label\"\n @change=${this.handleChange}\n id=\"menu\"\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n @scroll=${this.onScroll}\n role=${this.listRole}\n .selects=${this.selects}\n .selected=${this.value ? [this.value] : []}\n .shouldSupportDragAndSelect=${!this.isTouchDevice.matches}\n size=${this.size}\n @sp-menu-item-keydown=${this.handleEscape}\n @sp-menu-item-added-or-updated=${this.shouldManageSelection}\n >\n <slot @slotchange=${this.shouldScheduleManageSelection}></slot>\n </sp-menu>\n `;\n this.hasRenderedOverlay =\n this.hasRenderedOverlay ||\n this.focused ||\n this.open ||\n !!this.deprecatedMenu;\n if (this.hasRenderedOverlay) {\n if (this.dependencyManager.loaded) {\n this.dependencyManager.add('sp-overlay');\n }\n return this.renderOverlay(menu);\n }\n return menu;\n }\n\n /** Tracks whether a selection change is already scheduled for the next frame. */\n public willManageSelection = false;\n\n /**\n * Schedules selection management for the next animation frame.\n * Called when the value changes or menu slot content changes.\n * Prevents duplicate scheduling if already pending.\n *\n * @param event - Optional event that triggered the scheduling\n */\n protected shouldScheduleManageSelection(event?: Event): void {\n if (\n !this.willManageSelection &&\n (!event ||\n ((event.target as HTMLElement).getRootNode() as ShadowRoot).host ===\n this)\n ) {\n this.willManageSelection = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.manageSelection();\n });\n });\n }\n }\n\n /**\n * Immediately manages selection when a menu item is added or updated.\n * Skips if selection management is already scheduled.\n */\n protected shouldManageSelection(): void {\n if (this.willManageSelection) {\n return;\n }\n this.willManageSelection = true;\n this.manageSelection();\n }\n\n /**\n * Synchronizes the menu selection state with the picker's current value.\n * Finds and selects the menu item matching the current value,\n * and deselects all other items.\n */\n protected async manageSelection(): Promise<void> {\n if (this.selects == null) {\n return;\n }\n\n this.selectionPromise = new Promise(\n (res) => (this.selectionResolver = res)\n );\n let selectedItem: MenuItem | undefined;\n await this.optionsMenu.updateComplete;\n if (this.recentlyConnected) {\n // Work around for attach timing differences in Safari and Firefox.\n // Remove when refactoring to Menu passthrough wrapper.\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n this.recentlyConnected = false;\n }\n this.menuItems.forEach((item) => {\n if (this.value === item.value && !item.disabled) {\n selectedItem = item;\n } else {\n item.selected = false;\n }\n });\n if (selectedItem) {\n selectedItem.selected = !!this.selects;\n this.selectedItem = selectedItem;\n } else {\n // Only clear value when items exist with real values but none match.\n // Preserve value if items are pending (lazy loaded, async render, incomplete upgrade).\n const hasItemsWithValues = this.menuItems.some(\n (item) => item.value != null || item.getAttribute?.('value') != null\n );\n if (this.menuItems.length > 0 && hasItemsWithValues) {\n this.value = '';\n this.selectedItem = undefined;\n }\n }\n if (this.open) {\n await this.optionsMenu.updateComplete;\n this.optionsMenu.updateSelectedItemIndex();\n }\n this.selectionResolver();\n this.willManageSelection = false;\n }\n\n private selectionPromise = Promise.resolve();\n private selectionResolver!: () => void;\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.selectionPromise;\n return complete;\n }\n\n private recentlyConnected = false;\n\n /** Tracks the target of an active Enter keydown to prevent double-activation. */\n private enterKeydownOn: EventTarget | null = null;\n\n /**\n * Handles Enter key events to prevent double-activation of menu items.\n * Tracks keydown state and clears it on keyup.\n * Also prevents Enter from triggering submenus that aren't open.\n *\n * @param event - The keyboard event\n */\n protected handleEnterKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Enter') {\n return;\n }\n const target = event?.target as MenuItem;\n if (!target.open && target.hasSubmenu) {\n event.preventDefault();\n return;\n }\n\n if (this.enterKeydownOn) {\n event.preventDefault();\n return;\n }\n this.enterKeydownOn = event.target;\n this.addEventListener(\n 'keyup',\n async (keyupEvent: KeyboardEvent) => {\n if (keyupEvent.key !== 'Enter') {\n return;\n }\n this.enterKeydownOn = null;\n },\n { once: true }\n );\n };\n\n public override connectedCallback(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `PickerBase class is deprecated and will be removed in a future release. Use the ExpandableElement base class instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#deprecation',\n { level: 'deprecation' }\n );\n }\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (this.tooltipEl?.selfManaged && this.button) {\n this.tooltipEl.triggerElement = this.button;\n }\n });\n\n this.recentlyConnected = this.hasUpdated;\n this.addEventListener('focus', this.handleFocus);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this.handleFocus);\n }\n}\n\n/**\n * An `<sp-picker>` is a dropdown selection component that allows users to choose\n * a single option from a list of menu items. It supports keyboard navigation,\n * including arrow keys to cycle through options without opening the menu.\n *\n * @element sp-picker\n *\n * @slot label - The placeholder content for the Picker\n * @slot description - The description content for the Picker\n * @slot tooltip - Tooltip to to be applied to the the Picker Button\n * @slot - menu items to be listed in the Picker\n * @fires change - Announces that the `value` of the element has changed\n * @fires sp-opened - Announces that the overlay has been opened\n * @fires sp-closed - Announces that the overlay has been closed\n */\nexport class Picker extends SizedMixin(ExpandableElement, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [pickerStyles, chevronStyles];\n }\n\n /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n private deprecatedMenu: Menu | null = null;\n\n /**\n * Controls how icons are displayed in the picker button.\n * - `'only'`: Shows only the icon, hiding the label visually.\n * - `'none'`: Hides the icon entirely.\n */\n @property({ type: String, reflect: true })\n public icons?: 'only' | 'none';\n\n /** Whether the picker is in an invalid state. Displays a validation icon when true. */\n @property({ type: Boolean, reflect: true })\n public invalid = false;\n\n /** Defines a string value that labels the Picker while it is in pending state. */\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n /** The placeholder label displayed when no item is selected. */\n @property()\n public label?: string;\n\n /**\n * The selection mode for the picker's menu.\n * Always forced to `'single'` for standard picker behavior.\n */\n public selects: undefined | 'single' = 'single';\n\n /** The alignment of the associated label, set by an external field label component. */\n @state()\n public labelAlignment?: 'inline';\n\n /**\n * Returns the list of menu items contained in the picker's options menu.\n */\n protected get menuItems(): MenuItem[] {\n return this.optionsMenu.childItems;\n }\n\n /**\n * @deprecated This property always returns true and will be removed in a future version.\n */\n public get selfManageFocusElement(): boolean {\n return true;\n }\n\n /** Reference to the tooltip element, if one is slotted. */\n protected tooltipEl?: Tooltip;\n\n /** Whether to render the picker in quiet mode with minimal visual styling. */\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n /** The current value of the picker, corresponding to the selected menu item's value. */\n @property({ type: String })\n public value = '';\n\n /**\n * The currently selected menu item, or undefined if no item is selected.\n */\n @property({ attribute: false })\n public get selectedItem(): MenuItem | undefined {\n return this._selectedItem;\n }\n\n public set selectedItem(selectedItem: MenuItem | undefined) {\n this.selectedItemContent = selectedItem\n ? selectedItem.itemChildren\n : undefined;\n\n if (selectedItem === this.selectedItem) {\n return;\n }\n const oldSelectedItem = this.selectedItem;\n this._selectedItem = selectedItem;\n this.requestUpdate('selectedItem', oldSelectedItem);\n }\n\n _selectedItem?: MenuItem;\n\n /** The ARIA role for the menu list element. */\n protected listRole: 'listbox' | 'menu' = 'listbox';\n\n /** The ARIA role for individual menu items. */\n protected itemRole = 'option';\n\n /**\n * Programmatically applies visible focus styling to the picker.\n * Has no effect when the picker is disabled.\n */\n public forceFocusVisible(): void {\n if (this.disabled) {\n return;\n }\n\n this.focused = true;\n }\n\n /**\n * Toggles the picker's open state when called programmatically.\n * Note: Pointer events are handled by the interaction controller.\n */\n public override click(): void {\n this.toggle();\n }\n\n /**\n * Handles click events on the trigger button.\n * Note: Pointer events are typically handled by the interaction controller;\n * this method is called when `this.button.click()` is invoked programmatically.\n */\n public handleButtonClick(): void {\n if (this.disabled) {\n return;\n }\n this.toggle();\n }\n\n /**\n * Handles blur events on the trigger button, removing focus styling.\n */\n public handleButtonBlur(): void {\n this.focused = false;\n }\n\n /**\n * @deprecated Use `focus()` instead.\n * Focuses the picker button and applies focus styling.\n */\n public handleHelperFocus(): void {\n // set focused to true here instead of handleButtonFocus so clicks don't flash a focus outline\n this.focused = true;\n this.button.focus();\n }\n\n /**\n * Handles focus events on the picker, applying visible focus styling\n * only when focus is visible in the tree.\n */\n public handleFocus(): void {\n if (!this.disabled && this.focusElement) {\n this.focused = this.hasVisibleFocusInTree();\n }\n }\n\n /**\n * Handles change events from the menu, updating the selected value.\n * Dispatches a `change` event that can be prevented to cancel the selection.\n *\n * @param event - The change event from the menu\n */\n public handleChange(event: Event): void {\n if (this.strategy) {\n this.strategy.preventNextToggle = 'no';\n }\n const target = event.target as Menu;\n const [selected] = target.selectedItems;\n event.stopPropagation();\n if (event.cancelable) {\n this.setValueFromItem(selected, event);\n } else {\n // Non-cancelable \"change\" events announce a selection with no value\n // change that should close the Picker element.\n this.open = false;\n if (this.strategy) {\n this.strategy.open = false;\n }\n }\n }\n\n /**\n * Handles focus events on the trigger button, delegating to the interaction strategy.\n *\n * @param event - The focus event\n */\n public handleButtonFocus(event: FocusEvent): void {\n this.strategy?.handleButtonFocus(event);\n }\n\n /**\n * Handles Escape key press to close the picker overlay.\n *\n * @param event - The keyboard event\n */\n protected handleEscape = (\n event: MenuItemKeydownEvent | KeyboardEvent\n ): void => {\n if (event.key === 'Escape' && this.open) {\n event.stopPropagation();\n event.preventDefault();\n this.toggle(false);\n }\n };\n\n /**\n * Enhanced keyboard handler that supports arrow key navigation to cycle\n * through options without opening the menu (in addition to base navigation).\n *\n * @param event - The keyboard event\n */\n protected handleKeydown = (event: KeyboardEvent): void => {\n const { key } = event;\n const handledKeys = [\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n ' ',\n 'Escape',\n ].includes(key);\n const openKeys = ['ArrowUp', 'ArrowDown', 'Enter', ' '].includes(key);\n const arrowKeys = [\n 'ArrowUp',\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n ].includes(key);\n this.focused = true;\n if ('Escape' === key) {\n this.handleEscape(event);\n return;\n }\n if (!handledKeys || this.readonly || this.pending) {\n return;\n }\n if (openKeys) {\n this.keyboardOpen();\n event.preventDefault();\n if (arrowKeys) {\n event.stopPropagation();\n }\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n const nextItem = this.optionsMenu?.getNeighboringFocusableElement(\n this.selectedItem,\n key === 'ArrowLeft'\n );\n if (!this.value || nextItem !== this.selectedItem) {\n // updates picker text but does not fire change event until action is completed\n if (nextItem) {\n this.setValueFromItem(nextItem as MenuItem);\n }\n }\n };\n\n /**\n * Opens the picker via keyboard interaction and focuses the first selected item.\n * If already open, focuses the first selected item in the menu.\n */\n protected async keyboardOpen(): Promise<void> {\n // if the menu is not open, we need to toggle it and wait for it to open to focus on the first selected item\n if (!this.open || !this.strategy.open) {\n this.addEventListener(\n 'sp-opened',\n () => this.optionsMenu?.focusOnFirstSelectedItem(),\n {\n once: true,\n }\n );\n this.toggle(true);\n } else {\n // if the menu is already open, we need to focus on the first selected item\n this.optionsMenu?.focusOnFirstSelectedItem();\n }\n }\n\n /**\n * Sets the picker's value from a menu item selection.\n * Dispatches a cancelable `change` event and reverts the selection if prevented.\n *\n * @param item - The menu item to select\n * @param menuChangeEvent - The original menu change event, if any\n */\n protected async setValueFromItem(\n item: MenuItem,\n menuChangeEvent?: Event\n ): Promise<void> {\n this.open = false;\n // should always close when \"setting\" a value\n const oldSelectedItem = this.selectedItem;\n const oldValue = this.value;\n\n // Set a value.\n this.selectedItem = item;\n this.value = item?.value ?? '';\n await this.updateComplete;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n // Allow it to be prevented.\n cancelable: true,\n composed: true,\n })\n );\n if (!applyDefault && this.selects) {\n if (menuChangeEvent) {\n menuChangeEvent.preventDefault();\n }\n this.setMenuItemSelected(this.selectedItem as MenuItem, false);\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, true);\n }\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n this.open = true;\n if (this.strategy) {\n this.strategy.open = true;\n }\n return;\n } else if (!this.selects) {\n // Unset the value if not carrying a selection\n this.selectedItem = oldSelectedItem;\n this.value = oldValue;\n return;\n }\n if (oldSelectedItem) {\n this.setMenuItemSelected(oldSelectedItem, false);\n }\n this.setMenuItemSelected(item, !!this.selects);\n }\n\n /**\n * Updates the selected state of a menu item.\n *\n * @param item - The menu item to update\n * @param value - Whether the item should be selected\n */\n protected setMenuItemSelected(item: MenuItem, value: boolean): void {\n // matches null | undefined\n if (this.selects == null) {\n return;\n }\n item.selected = value;\n }\n\n /**\n * Returns inline styles for the overlay container.\n * On mobile, sets full width; on desktop, returns empty styles.\n */\n protected get containerStyles(): StyleInfo {\n const styles: StyleInfo = {};\n if (!this.quiet) {\n styles['min-width'] = `${this.offsetWidth}px`;\n }\n // @todo test in mobile\n /* c8 ignore next 5 */\n if (this.isMobile.matches) {\n styles['--swc-menu-width'] = '100%';\n }\n return styles;\n }\n\n /**\n * The content (icon and text) of the currently selected menu item.\n * Used to render the selected item's display in the picker button.\n */\n @state()\n protected get selectedItemContent(): MenuItemChildren {\n return this._selectedItemContent || { icon: [], content: [] };\n }\n\n protected set selectedItemContent(\n selectedItemContent: MenuItemChildren | undefined\n ) {\n if (selectedItemContent === this.selectedItemContent) {\n return;\n }\n\n const oldContent = this.selectedItemContent;\n this._selectedItemContent = selectedItemContent;\n this.requestUpdate('selectedItemContent', oldContent);\n }\n\n _selectedItemContent?: MenuItemChildren;\n\n /**\n * Handles slotchange events for the tooltip slot.\n * Sets up the trigger element for self-managed tooltips.\n *\n * @param event - The slotchange event\n */\n protected handleTooltipSlotchange(\n event: Event & { target: HTMLSlotElement }\n ): void {\n const tooltipEl = event.target.assignedElements()[0] as Tooltip | undefined;\n this.tooltipEl = tooltipEl;\n\n // Set up trigger element for self-managed tooltips\n if (tooltipEl?.selfManaged) {\n if (this.button) {\n tooltipEl.triggerElement = this.button;\n }\n this.updateComplete.then(() => {\n if (tooltipEl.selfManaged && this.button) {\n tooltipEl.triggerElement = this.button;\n }\n });\n }\n }\n\n /**\n * Renders the label content for the picker button.\n * Shows the selected item's content if available, otherwise renders the placeholder label.\n *\n * @param content - The content nodes from the selected item\n * @returns The rendered label content\n */\n protected renderLabelContent(content: Node[]): TemplateResult | Node[] {\n if (this.value && this.selectedItem) {\n return content;\n }\n return html`\n <slot name=\"label\" id=\"label\">\n <span aria-hidden=${ifDefined(this.appliedLabel ? undefined : 'true')}>\n ${this.label}\n </span>\n </slot>\n `;\n }\n\n /**\n * Renders the loading indicator shown during pending state.\n * Dynamically imports the progress-circle component.\n *\n * @returns The rendered progress circle template\n */\n protected renderLoader(): TemplateResult {\n import('@spectrum-web-components/progress-circle/sp-progress-circle.js');\n return html`\n <sp-progress-circle\n size=\"s\"\n indeterminate\n role=\"presentation\"\n class=\"progress-circle\"\n ></sp-progress-circle>\n `;\n }\n\n /**\n * Returns the content to render inside the picker button,\n * including the icon, label, validation icon, and chevron.\n */\n protected get buttonContent(): TemplateResult[] {\n const labelClasses = {\n 'visually-hidden': this.icons === 'only' && !!this.value,\n placeholder: !this.value,\n label: true,\n };\n const appliedLabel = this.appliedLabel || this.label;\n return [\n html`\n <span id=\"icon\" ?hidden=${this.icons === 'none'}>\n ${this.selectedItemContent.icon}\n </span>\n <span\n id=${ifDefined(this.value && this.selectedItem ? 'label' : undefined)}\n class=${classMap(labelClasses)}\n >\n ${this.renderLabelContent(this.selectedItemContent.content)}\n </span>\n ${this.value && this.selectedItem\n ? html`\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"applied-label\"\n >\n ${appliedLabel}\n <slot name=\"label\"></slot>\n </span>\n `\n : html`\n <span hidden id=\"applied-label\">${appliedLabel}</span>\n `}\n ${this.invalid && !this.pending\n ? html`\n <sp-icon-alert class=\"validation-icon\"></sp-icon-alert>\n `\n : nothing}\n ${this.pending\n ? html`\n ${this.renderLoader()}\n <span\n aria-hidden=\"true\"\n class=\"visually-hidden\"\n id=\"pending-label\"\n >\n ${this.pendingLabel}\n </span>\n `\n : nothing}\n <sp-icon-chevron100\n class=\"picker ${chevronClass[this.size as DefaultElementSize]}\"\n ></sp-icon-chevron100>\n `,\n ];\n }\n\n /**\n * Callback invoked by an associated field label to apply its label value.\n * Sets the applied label and determines label alignment based on the field label's configuration.\n *\n * @param value - The label text value\n * @param labelElement - The field label element providing the label\n */\n applyFocusElementLabel = (value: string, labelElement: FieldLabel): void => {\n this.appliedLabel = value;\n this.labelAlignment = labelElement.sideAligned ? 'inline' : undefined;\n };\n\n /**\n * Checks whether the picker has an accessible label through any supported method:\n * - `label` attribute\n * - `aria-label` attribute\n * - `aria-labelledby` attribute\n * - Applied label from a field label\n * - Slotted label content\n *\n * @returns True if an accessible label is present\n */\n protected hasAccessibleLabel(): boolean {\n const slotContent =\n this.querySelector('[slot=\"label\"]')?.textContent &&\n this.querySelector('[slot=\"label\"]')?.textContent?.trim() !== '';\n const slotAlt =\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() &&\n this.querySelector('[slot=\"label\"]')?.getAttribute('alt')?.trim() !== '';\n return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n !!slotContent ||\n !!slotAlt\n );\n }\n\n /**\n * Logs a warning in debug mode when the picker lacks an accessible label.\n * Provides guidance on how to make the picker accessible.\n */\n protected warnNoLabel(): void {\n if (window.__swc?.DEBUG) {\n window.__swc.warn(\n this,\n `<${this.localName}> needs one of the following to be accessible:`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#accessibility',\n {\n type: 'accessibility',\n issues: [\n `an <sp-field-label> element with a \\`for\\` attribute referencing the \\`id\\` of the \\`<${this.localName}>\\`, or`,\n 'value supplied to the \"label\" attribute, which will be displayed visually as placeholder text, or',\n 'text content supplied in a <span> with slot=\"label\", which will also be displayed visually as placeholder text.',\n ],\n }\n );\n }\n }\n\n /**\n * Renders the overlay element containing the menu.\n * Configures the overlay with appropriate placement, type, and event handlers.\n *\n * @param menu - The menu template to render inside the overlay\n * @returns The rendered overlay template\n */\n protected renderOverlay(menu: TemplateResult): TemplateResult {\n const container = this.renderContainer(menu);\n this.dependencyManager.add('sp-overlay');\n import('@spectrum-web-components/overlay/sp-overlay.js');\n return html`\n <sp-overlay\n @slottable-request=${this.handleSlottableRequest}\n @beforetoggle=${this.handleBeforetoggle}\n .triggerElement=${this as HTMLElement}\n .offset=${0}\n ?open=${this.open && this.dependencyManager.loaded}\n .placement=${this.isMobile.matches && !this.forcePopover\n ? undefined\n : this.placement}\n .type=${this.isMobile.matches && !this.forcePopover ? 'modal' : 'auto'}\n .receivesFocus=${'false'}\n .willPreventClose=${this.strategy?.preventNextToggle !== 'no' &&\n this.open &&\n this.dependencyManager.loaded}\n >\n ${container}\n </sp-overlay>\n `;\n }\n\n /**\n * Renders the description slot for additional picker context.\n * Content is referenced by aria-describedby for accessibility.\n */\n protected get renderDescriptionSlot(): TemplateResult {\n return html`\n <div id=${DESCRIPTION_ID}>\n <slot name=\"description\"></slot>\n </div>\n `;\n }\n // a helper to throw focus to the button is needed because Safari\n // won't include buttons in the tab order even with tabindex=\"0\"\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <button\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-describedby=\"tooltip ${DESCRIPTION_ID}\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-haspopup=\"true\"\n aria-labelledby=\"icon label applied-label pending-label\"\n id=\"button\"\n class=${ifDefined(\n this.labelAlignment ? `label-${this.labelAlignment}` : undefined\n )}\n @focus=${this.handleButtonFocus}\n @blur=${this.handleButtonBlur}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </button>\n <slot\n aria-hidden=\"true\"\n name=\"tooltip\"\n id=\"tooltip\"\n @keydown=${this.handleKeydown}\n @slotchange=${this.handleTooltipSlotchange}\n ></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n protected override willUpdate(changes: PropertyValues<this>): void {\n super.willUpdate(changes);\n if (changes.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n protected override update(changes: PropertyValues<this>): void {\n if (this.selects) {\n /**\n * Always force `selects` to \"single\" when set.\n *\n * @todo Add support functionally and visually for \"multiple\"\n */\n this.selects = 'single';\n }\n if (changes.has('disabled') && this.disabled) {\n this.close();\n }\n if (changes.has('pending') && this.pending) {\n this.close();\n }\n if (changes.has('value')) {\n // MenuItems update a frame late for <slot> management,\n // await the same here.\n this.shouldScheduleManageSelection();\n }\n // Maybe it's finally time to remove this support?\n if (!this.hasUpdated) {\n this.deprecatedMenu = this.querySelector(':scope > sp-menu');\n this.deprecatedMenu?.toggleAttribute('ignore', true);\n this.deprecatedMenu?.setAttribute('selects', 'inherit');\n }\n if (window.__swc?.DEBUG) {\n if (!this.hasUpdated && this.querySelector(':scope > sp-menu')) {\n const { localName } = this;\n window.__swc.warn(\n this,\n `You no longer need to provide an <sp-menu> child to ${localName}. Any styling or attributes on the <sp-menu> will be ignored.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/picker/#sizes',\n { level: 'deprecation' }\n );\n }\n this.updateComplete.then(async () => {\n // Attributes should be user supplied, making them available before first update.\n // However, `appliesLabel` is applied by external elements that must be update complete as well to be bound appropriately.\n await new Promise((res) => requestAnimationFrame(res));\n await new Promise((res) => requestAnimationFrame(res));\n if (!this.hasAccessibleLabel()) {\n this.warnNoLabel();\n }\n });\n }\n super.update(changes);\n }\n\n /**\n * Binds the keydown event listener to the trigger button.\n * Called during first update to enable keyboard navigation.\n */\n protected bindButtonKeydownListener(): void {\n this.button.addEventListener('keydown', this.handleKeydown);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('open') && this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n protected override async firstUpdated(\n changes: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changes);\n this.bindButtonKeydownListener();\n this.bindEvents();\n\n await this.updateComplete;\n if (this.overlayElement && !this.strategy.overlay) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Renders a visually hidden dismiss button for accessibility.\n * Allows screen reader users to dismiss the overlay.\n */\n protected get dismissHelper(): TemplateResult {\n return html`\n <div class=\"visually-hidden\">\n <button\n tabindex=\"-1\"\n aria-label=\"Dismiss\"\n @click=${this.close}\n ></button>\n </div>\n `;\n }\n\n /**\n * Renders the overlay container (popover or tray) based on device type.\n * On mobile, uses a tray; on desktop, uses a popover.\n *\n * @param menu - The menu template to wrap in the container\n * @returns The rendered container template\n */\n protected renderContainer(menu: TemplateResult): TemplateResult {\n const accessibleMenu = html`\n ${this.dismissHelper} ${menu} ${this.dismissHelper}\n `;\n // @todo: test in mobile\n if (this.isMobile.matches && !this.forcePopover) {\n this.dependencyManager.add('sp-tray');\n import('@spectrum-web-components/tray/sp-tray.js');\n return html`\n <sp-tray\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n >\n ${accessibleMenu}\n </sp-tray>\n `;\n }\n this.dependencyManager.add('sp-popover');\n import('@spectrum-web-components/popover/sp-popover.js');\n return html`\n <sp-popover\n id=\"popover\"\n role=\"presentation\"\n style=${styleMap(this.containerStyles)}\n placement=${this.placement}\n >\n ${accessibleMenu}\n </sp-popover>\n `;\n }\n\n /** Tracks whether the overlay has been rendered at least once. */\n protected hasRenderedOverlay = false;\n\n /**\n * Dispatches a scroll event when the menu is scrolled.\n * Allows parent components to react to menu scroll events.\n */\n private onScroll(): void {\n this.dispatchEvent(new Event('scroll'));\n }\n\n /**\n * Renders the menu and overlay structure.\n * Lazily renders the overlay only after the picker has been focused or opened.\n */\n protected get renderMenu(): TemplateResult {\n const menu = html`\n <sp-menu\n aria-labelledby=\"applied-label\"\n @change=${this.handleChange}\n id=\"menu\"\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n @scroll=${this.onScroll}\n role=${this.listRole}\n .selects=${this.selects}\n .selected=${this.value ? [this.value] : []}\n .shouldSupportDragAndSelect=${!this.isTouchDevice.matches}\n size=${this.size}\n @sp-menu-item-keydown=${this.handleEscape}\n @sp-menu-item-added-or-updated=${this.shouldManageSelection}\n >\n <slot @slotchange=${this.shouldScheduleManageSelection}></slot>\n </sp-menu>\n `;\n this.hasRenderedOverlay =\n this.hasRenderedOverlay ||\n this.focused ||\n this.open ||\n !!this.deprecatedMenu;\n if (this.hasRenderedOverlay) {\n if (this.dependencyManager.loaded) {\n this.dependencyManager.add('sp-overlay');\n }\n return this.renderOverlay(menu);\n }\n return menu;\n }\n\n /** Tracks whether a selection change is already scheduled for the next frame. */\n public willManageSelection = false;\n\n /**\n * Schedules selection management for the next animation frame.\n * Called when the value changes or menu slot content changes.\n * Prevents duplicate scheduling if already pending.\n *\n * @param event - Optional event that triggered the scheduling\n */\n protected shouldScheduleManageSelection(event?: Event): void {\n if (\n !this.willManageSelection &&\n (!event ||\n ((event.target as HTMLElement).getRootNode() as ShadowRoot).host ===\n this)\n ) {\n this.willManageSelection = true;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.manageSelection();\n });\n });\n }\n }\n\n /**\n * Immediately manages selection when a menu item is added or updated.\n * Skips if selection management is already scheduled.\n */\n protected shouldManageSelection(): void {\n if (this.willManageSelection) {\n return;\n }\n this.willManageSelection = true;\n this.manageSelection();\n }\n\n /**\n * Synchronizes the menu selection state with the picker's current value.\n * Finds and selects the menu item matching the current value,\n * and deselects all other items.\n */\n protected async manageSelection(): Promise<void> {\n if (this.selects == null) {\n return;\n }\n\n this.selectionPromise = new Promise(\n (res) => (this.selectionResolver = res)\n );\n let selectedItem: MenuItem | undefined;\n await this.optionsMenu.updateComplete;\n if (this.recentlyConnected) {\n // Work around for attach timing differences in Safari and Firefox.\n // Remove when refactoring to Menu passthrough wrapper.\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n this.recentlyConnected = false;\n }\n this.menuItems.forEach((item) => {\n if (this.value === item.value && !item.disabled) {\n selectedItem = item;\n } else {\n item.selected = false;\n }\n });\n if (selectedItem) {\n selectedItem.selected = !!this.selects;\n this.selectedItem = selectedItem;\n } else {\n // Only clear value when items exist with real values but none match.\n // Preserve value if items are pending (lazy loaded, async render, incomplete upgrade).\n const hasItemsWithValues = this.menuItems.some(\n (item) => item.value != null || item.getAttribute?.('value') != null\n );\n if (this.menuItems.length > 0 && hasItemsWithValues) {\n this.value = '';\n this.selectedItem = undefined;\n }\n }\n if (this.open) {\n await this.optionsMenu.updateComplete;\n this.optionsMenu.updateSelectedItemIndex();\n }\n this.selectionResolver();\n this.willManageSelection = false;\n }\n\n private selectionPromise = Promise.resolve();\n private selectionResolver!: () => void;\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.selectionPromise;\n return complete;\n }\n\n private recentlyConnected = false;\n\n /** Tracks the target of an active Enter keydown to prevent double-activation. */\n private enterKeydownOn: EventTarget | null = null;\n\n /**\n * Handles Enter key events to prevent double-activation of menu items.\n * Tracks keydown state and clears it on keyup.\n * Also prevents Enter from triggering submenus that aren't open.\n *\n * @param event - The keyboard event\n */\n protected handleEnterKeydown = (event: KeyboardEvent): void => {\n if (event.key !== 'Enter') {\n return;\n }\n const target = event?.target as MenuItem;\n if (!target.open && target.hasSubmenu) {\n event.preventDefault();\n return;\n }\n\n if (this.enterKeydownOn) {\n event.preventDefault();\n return;\n }\n this.enterKeydownOn = event.target;\n this.addEventListener(\n 'keyup',\n async (keyupEvent: KeyboardEvent) => {\n if (keyupEvent.key !== 'Enter') {\n return;\n }\n this.enterKeydownOn = null;\n },\n { once: true }\n );\n };\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n if (this.tooltipEl?.selfManaged && this.button) {\n this.tooltipEl.triggerElement = this.button;\n }\n });\n\n this.recentlyConnected = this.hasUpdated;\n this.addEventListener('focus', this.handleFocus);\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('focus', this.handleFocus);\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAGE,QAAAA,EACA,WAAAC,EAEA,cAAAC,EACA,mBAAAC,MAEK,gCACP,OACE,YAAAC,EACA,SAAAC,EACA,SAAAC,MACK,kDACP,OACE,YAAAC,EACA,aAAAC,EAEA,YAAAC,MACK,kDAEP,OAAOC,MAAmB,iEAU1B,OAAS,+BAAAC,MAAmC,wEAC5C,OACE,aAAAC,EACA,mBAAAC,EACA,wBAAAC,MACK,kEAGP,MAAO,gEACP,MAAO,iEACP,MAAO,2CAIP,OAAOC,MAAkB,kBACzB,OAAS,cAAAC,MAAkB,kBAE3B,MAAMC,EAAe,CACnB,EAAG,gCACH,EAAG,iCACH,EAAG,iCACH,GAAI,gCACN,EAEO,aAAM,eAAiB,gBAUvB,aAAM,0BAA0Bd,CAAgB,CAAhD,kCAWL,KAAO,SAAW,IAAIW,EAAqB,KAAMF,CAAS,EAG1D,KAAO,cAAgB,IAAIE,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evronStyles", "DependencyManagerController", "IS_MOBILE", "IS_TOUCH_DEVICE", "MatchMediaController", "pickerStyles", "strategies", "chevronClass", "_event", "event", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "shouldRestoreFocus", "options", "target", "open", "__decorateClass", "value", "labelElement", "keyupEvent", "selectedItem", "oldSelectedItem", "selected", "item", "menuChangeEvent", "oldValue", "selectedItemContent", "oldContent", "tooltipEl", "content", "labelClasses", "appliedLabel", "slotContent", "slotAlt", "menu", "container", "changes", "accessibleMenu", "res", "hasItemsWithValues", "complete", "key", "handledKeys", "openKeys", "arrowKeys", "nextItem", "styles"]
|
|
7
7
|
}
|