@spectrum-web-components/action-menu 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-menu",
3
- "version": "1.12.0-testing.20260223092154",
3
+ "version": "1.12.0",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",
@@ -58,19 +58,19 @@
58
58
  ],
59
59
  "types": "./src/index.d.ts",
60
60
  "dependencies": {
61
- "@spectrum-web-components/action-button": "1.12.0-testing.20260223092154",
62
- "@spectrum-web-components/base": "1.12.0-testing.20260223092154",
63
- "@spectrum-web-components/field-label": "1.12.0-testing.20260223092154",
64
- "@spectrum-web-components/icon": "1.12.0-testing.20260223092154",
65
- "@spectrum-web-components/icons-workflow": "1.12.0-testing.20260223092154",
66
- "@spectrum-web-components/menu": "1.12.0-testing.20260223092154",
67
- "@spectrum-web-components/overlay": "1.12.0-testing.20260223092154",
68
- "@spectrum-web-components/picker": "1.12.0-testing.20260223092154",
69
- "@spectrum-web-components/popover": "1.12.0-testing.20260223092154",
70
- "@spectrum-web-components/progress-circle": "1.12.0-testing.20260223092154",
71
- "@spectrum-web-components/shared": "1.12.0-testing.20260223092154",
72
- "@spectrum-web-components/tooltip": "1.12.0-testing.20260223092154",
73
- "@spectrum-web-components/tray": "1.12.0-testing.20260223092154"
61
+ "@spectrum-web-components/action-button": "1.12.0",
62
+ "@spectrum-web-components/base": "1.12.0",
63
+ "@spectrum-web-components/field-label": "1.12.0",
64
+ "@spectrum-web-components/icon": "1.12.0",
65
+ "@spectrum-web-components/icons-workflow": "1.12.0",
66
+ "@spectrum-web-components/menu": "1.12.0",
67
+ "@spectrum-web-components/overlay": "1.12.0",
68
+ "@spectrum-web-components/picker": "1.12.0",
69
+ "@spectrum-web-components/popover": "1.12.0",
70
+ "@spectrum-web-components/progress-circle": "1.12.0",
71
+ "@spectrum-web-components/shared": "1.12.0",
72
+ "@spectrum-web-components/tooltip": "1.12.0",
73
+ "@spectrum-web-components/tray": "1.12.0"
74
74
  },
75
75
  "keywords": [
76
76
  "design-system",
@@ -18,10 +18,7 @@ import { ExpandableElement } from '@spectrum-web-components/picker';
18
18
  import type { Tooltip } from '@spectrum-web-components/tooltip';
19
19
  import '@spectrum-web-components/action-button/sp-action-button.js';
20
20
  import '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';
21
- declare const ActionMenu_base: typeof ExpandableElement & {
22
- new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
23
- prototype: import("@spectrum-web-components/base").SizedElementInterface;
24
- } & import("@spectrum-web-components/core/mixins").SizedElementConstructor & {
21
+ declare const ActionMenu_base: typeof ExpandableElement & import("@spectrum-web-components/base").Constructor<import("@spectrum-web-components/base").SizedElementInterface> & import("@spectrum-web-components/base").SizedElementConstructor & {
25
22
  new (...args: any[]): import("@spectrum-web-components/shared").SlotTextObservingInterface;
26
23
  prototype: import("@spectrum-web-components/shared").SlotTextObservingInterface;
27
24
  } & {
@@ -365,13 +365,15 @@ export class ActionMenu extends ObserveSlotPresence(
365
365
  * @param event - The slotchange event
366
366
  */
367
367
  handleTooltipSlotchange(event) {
368
- var _a;
369
- this.tooltipEl = event.target.assignedElements()[0];
370
- if ((_a = this.tooltipEl) == null ? void 0 : _a.selfManaged) {
368
+ const tooltipEl = event.target.assignedElements()[0];
369
+ this.tooltipEl = tooltipEl;
370
+ if (tooltipEl == null ? void 0 : tooltipEl.selfManaged) {
371
+ if (this.button) {
372
+ tooltipEl.triggerElement = this.button;
373
+ }
371
374
  this.updateComplete.then(() => {
372
- var _a2;
373
- if (((_a2 = this.tooltipEl) == null ? void 0 : _a2.overlayElement) && this.button) {
374
- this.tooltipEl.overlayElement.triggerElement = this.button;
375
+ if (tooltipEl.selfManaged && this.button) {
376
+ tooltipEl.triggerElement = this.button;
375
377
  }
376
378
  });
377
379
  }
@@ -831,12 +833,8 @@ export class ActionMenu extends ObserveSlotPresence(
831
833
  super.connectedCallback();
832
834
  this.updateComplete.then(() => {
833
835
  var _a;
834
- if (!((_a = this.tooltipEl) == null ? void 0 : _a.selfManaged)) {
835
- return;
836
- }
837
- const overlayElement = this.tooltipEl.overlayElement;
838
- if (overlayElement) {
839
- overlayElement.triggerElement = this.button;
836
+ if (((_a = this.tooltipEl) == null ? void 0 : _a.selfManaged) && this.button) {
837
+ this.tooltipEl.triggerElement = this.button;
840
838
  }
841
839
  });
842
840
  this.recentlyConnected = this.hasUpdated;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ActionMenu.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 html,\n nothing,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport {\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 type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport {\n DESCRIPTION_ID,\n ExpandableElement,\n} from '@spectrum-web-components/picker';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\n\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * An `<sp-action-menu>` is an action button with an attached menu of options.\n * Unlike a standard picker, it does not maintain a selection by default and\n * displays a \"more\" icon instead of a chevron.\n *\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for the Action Menu\n * @slot label - The label to use for the Action Menu\n * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to be applied to the Action Button\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\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 ActionMenu extends ObserveSlotPresence(\n ObserveSlotText(\n SizedMixin(ExpandableElement, { noDefaultSize: true }),\n 'label'\n ),\n '[slot=\"label-only\"]'\n) {\n /**\n * Returns the component's styles including action menu specific styles.\n */\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n /**\n * The selection mode for the action menu.\n * Unlike Picker, defaults to `undefined` (no selection management).\n * Set to `'single'` to maintain a selected item.\n */\n @property({ type: String })\n public selects: undefined | 'single' = undefined;\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 /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n /**\n * @deprecated Reference to a legacy `<sp-menu>` child element.\n * Used for backwards compatibility with older usage patterns.\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 * Applies static color styling for use on colored backgrounds.\n * - `'white'`: Use on dark backgrounds\n * - `'black'`: Use on light backgrounds\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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 /** The ARIA role for the menu list element. Uses 'menu' for action menus. */\n protected listRole: 'listbox' | 'menu' = 'menu';\n\n /** The ARIA role for individual menu items. Uses 'menuitem' for action menus. */\n protected itemRole = 'menuitem';\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 /**\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 * 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 /** Private backing field for selectedItemContent getter/setter. */\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 action button.\n * Includes the icon slot (with \"more\" icon default), label slot, and label-only slot.\n */\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? nothing\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\" size=${this.size}></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\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 action menu has an accessible label through any supported method:\n * Extends base check to include label slot content and label-only slot.\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 return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n this.hasLabel ||\n this.labelOnly\n );\n }\n\n /**\n * Logs a warning in debug mode when the action menu lacks an accessible label.\n * Provides guidance specific to action menu labeling options.\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/action-menu/#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',\n 'text content supplied in a <span> with slot=\"label\", or, text content supplied in a <span> with slot=\"label-only\"',\n '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 /**\n * Renders the action menu component.\n * Uses an action button as the trigger instead of a standard button.\n */\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static-color=${ifDefined(this.staticColor)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n <slot name=\"tooltip\" @slotchange=${this.handleTooltipSlotchange}></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n /**\n * Lifecycle callback before the component updates.\n * Transfers tabIndex from the host element to the internal button.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n if (changedProperties.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n /**\n * Handles property updates.\n * Forces the invalid property to always be false since action menus\n * don't support validation states.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\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 (changedProperties.has('disabled') && this.disabled) {\n this.close();\n }\n if (changedProperties.has('pending') && this.pending) {\n this.close();\n }\n if (changedProperties.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(changedProperties);\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 /**\n * Lifecycle callback after the component has updated.\n * Ensures the strategy has a reference to the overlay element when opened.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('open') &&\n this.overlayElement &&\n !this.strategy.overlay\n ) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Lifecycle callback after the component's first update.\n * Binds keyboard listeners and initializes the interaction strategy.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override async firstUpdated(\n changedProperties: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changedProperties);\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 /** Promise that resolves when selection management is complete. */\n private selectionPromise = Promise.resolve();\n\n /** Resolver function for the selectionPromise. */\n private selectionResolver!: () => void;\n\n /**\n * Returns a promise that resolves when the component update is complete,\n * including any pending selection management.\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 /**\n * Tracks whether the component was recently connected to the DOM.\n * Used to handle timing differences in Safari and Firefox.\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 /**\n * Lifecycle callback when the element is connected to the DOM.\n * Sets up tooltip trigger elements and focus event listeners.\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 /**\n * Sets the currently selected menu item and updates the displayed content.\n *\n * @param selectedItem - The menu item to select, or undefined to clear selection\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 /** Private backing field for selectedItem getter/setter. */\n _selectedItem?: MenuItem;\n\n /**\n * Whether the label slot has content.\n * Used to determine button layout and icon visibility.\n */\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n /**\n * Whether the label-only slot is being used.\n * When true, no icon space is reserved.\n */\n @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n /**\n * Handles slottable request events by re-dispatching them.\n * Allows parent components to intercept overlay content requests.\n *\n * @param event - The slottable request event\n */\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEE;AAAA,EACA;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAQP,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAGhC,OAAO;AACP,OAAO;AAEP,OAAO,sBAAsB;AAoBtB,aAAM,mBAAmB;AAAA,EAC9B;AAAA,IACE,WAAW,mBAAmB,EAAE,eAAe,KAAK,CAAC;AAAA,IACrD;AAAA,EACF;AAAA,EACA;AACF,EAAE;AAAA,EANK;AAAA;AAoBL,SAAO,UAAgC;AAqBvC;AAAA;AAAA;AAAA;AAAA,SAAQ,iBAA8B;AAYtC,SAAO,UAAU;AAIjB,SAAO,eAAe;AA0BtB,SAAO,QAAQ;AAIf,SAAO,QAAQ;AAGf;AAAA,SAAU,WAA+B;AAGzC;AAAA,SAAU,WAAW;AA4GrB;AAAA;AAAA;AAAA;AAAA;AAAA,SAAU,eAAe,CACvB,UACS;AACT,UAAI,MAAM,QAAQ,YA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AqB;AAC/B,WAAO,KAAK;AAAA,EACd;AAaF;AAn/BS;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAnBf,WAoBJ;AAIA;AAAA,EADN,MAAM;AAAA,GAvBI,WAwBJ;AAWP;AAAA,EADC,MAAM;AAAA,GAlCI,WAmCX;AAcO;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAhD9B,WAiDJ;AAIA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GApD/B,WAqDJ;AAIA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB,CAAC;AAAA,GAxD3C,WAyDJ;AAIA;AAAA,EADN,SAAS;AAAA,GA5DC,WA6DJ;AAQA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GApE3C,WAqEJ;AAcA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAlF/B,WAmFJ;AAIA;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAtFf,WAuFJ;AAYI;AAAA,EADV,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAlGnB,WAmGA;AAkPG;AAAA,EADb,MAAM;AAAA,GApVI,WAqVG;AAmqBF;AAAA,EADX,MAAM;AAAA,GAv/BI,WAw/BC;",
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 html,\n nothing,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport {\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 type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport {\n DESCRIPTION_ID,\n ExpandableElement,\n} from '@spectrum-web-components/picker';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\n\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * An `<sp-action-menu>` is an action button with an attached menu of options.\n * Unlike a standard picker, it does not maintain a selection by default and\n * displays a \"more\" icon instead of a chevron.\n *\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for the Action Menu\n * @slot label - The label to use for the Action Menu\n * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to be applied to the Action Button\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\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 ActionMenu extends ObserveSlotPresence(\n ObserveSlotText(\n SizedMixin(ExpandableElement, { noDefaultSize: true }),\n 'label'\n ),\n '[slot=\"label-only\"]'\n) {\n /**\n * Returns the component's styles including action menu specific styles.\n */\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n /**\n * The selection mode for the action menu.\n * Unlike Picker, defaults to `undefined` (no selection management).\n * Set to `'single'` to maintain a selected item.\n */\n @property({ type: String })\n public selects: undefined | 'single' = undefined;\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 /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n /**\n * @deprecated Reference to a legacy `<sp-menu>` child element.\n * Used for backwards compatibility with older usage patterns.\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 * Applies static color styling for use on colored backgrounds.\n * - `'white'`: Use on dark backgrounds\n * - `'black'`: Use on light backgrounds\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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 /** The ARIA role for the menu list element. Uses 'menu' for action menus. */\n protected listRole: 'listbox' | 'menu' = 'menu';\n\n /** The ARIA role for individual menu items. Uses 'menuitem' for action menus. */\n protected itemRole = 'menuitem';\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 /**\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 * 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 /** Private backing field for selectedItemContent getter/setter. */\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 action button.\n * Includes the icon slot (with \"more\" icon default), label slot, and label-only slot.\n */\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? nothing\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\" size=${this.size}></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\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 action menu has an accessible label through any supported method:\n * Extends base check to include label slot content and label-only slot.\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 return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n this.hasLabel ||\n this.labelOnly\n );\n }\n\n /**\n * Logs a warning in debug mode when the action menu lacks an accessible label.\n * Provides guidance specific to action menu labeling options.\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/action-menu/#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',\n 'text content supplied in a <span> with slot=\"label\", or, text content supplied in a <span> with slot=\"label-only\"',\n '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 /**\n * Renders the action menu component.\n * Uses an action button as the trigger instead of a standard button.\n */\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static-color=${ifDefined(this.staticColor)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n <slot name=\"tooltip\" @slotchange=${this.handleTooltipSlotchange}></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n /**\n * Lifecycle callback before the component updates.\n * Transfers tabIndex from the host element to the internal button.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n if (changedProperties.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n /**\n * Handles property updates.\n * Forces the invalid property to always be false since action menus\n * don't support validation states.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\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 (changedProperties.has('disabled') && this.disabled) {\n this.close();\n }\n if (changedProperties.has('pending') && this.pending) {\n this.close();\n }\n if (changedProperties.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(changedProperties);\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 /**\n * Lifecycle callback after the component has updated.\n * Ensures the strategy has a reference to the overlay element when opened.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('open') &&\n this.overlayElement &&\n !this.strategy.overlay\n ) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Lifecycle callback after the component's first update.\n * Binds keyboard listeners and initializes the interaction strategy.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override async firstUpdated(\n changedProperties: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changedProperties);\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 /** Promise that resolves when selection management is complete. */\n private selectionPromise = Promise.resolve();\n\n /** Resolver function for the selectionPromise. */\n private selectionResolver!: () => void;\n\n /**\n * Returns a promise that resolves when the component update is complete,\n * including any pending selection management.\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 /**\n * Tracks whether the component was recently connected to the DOM.\n * Used to handle timing differences in Safari and Firefox.\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 /**\n * Lifecycle callback when the element is connected to the DOM.\n * Sets up tooltip trigger elements and focus event listeners.\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 /**\n * Sets the currently selected menu item and updates the displayed content.\n *\n * @param selectedItem - The menu item to select, or undefined to clear selection\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 /** Private backing field for selectedItem getter/setter. */\n _selectedItem?: MenuItem;\n\n /**\n * Whether the label slot has content.\n * Used to determine button layout and icon visibility.\n */\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n /**\n * Whether the label-only slot is being used.\n * When true, no icon space is reserved.\n */\n @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n /**\n * Handles slottable request events by re-dispatching them.\n * Allows parent components to intercept overlay content requests.\n *\n * @param event - The slottable request event\n */\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEE;AAAA,EACA;AAAA,EAEA;AAAA,OAEK;AACP,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAQP,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAGhC,OAAO;AACP,OAAO;AAEP,OAAO,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AAAA,EADX,MAAM;AAAA,GAt/BI,WAu/BC;",
6
6
  "names": ["_a"]
7
7
  }
package/src/ActionMenu.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var b=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var i=(c,a,e,t)=>{for(var s=t>1?void 0:t?f(a,e):a,l=c.length-1,r;l>=0;l--)(r=c[l])&&(s=(t?r(a,e,s):r(s))||s);return t&&s&&b(a,e,s),s};import{html as n,nothing as y,SizedMixin as v}from"@spectrum-web-components/base";import{state as d}from"@spectrum-web-components/base/src/decorators.js";import{property as o}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as p,styleMap as u}from"@spectrum-web-components/base/src/directives.js";import{SlottableRequestEvent as g}from"@spectrum-web-components/overlay/src/slottable-request-event.js";import{DESCRIPTION_ID as m,ExpandableElement as w}from"@spectrum-web-components/picker";import{ObserveSlotPresence as E}from"@spectrum-web-components/shared/src/observe-slot-presence.js";import{ObserveSlotText as I}from"@spectrum-web-components/shared/src/observe-slot-text.js";import"@spectrum-web-components/action-button/sp-action-button.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";import S from"./action-menu.css.js";export class ActionMenu extends E(I(v(w,{noDefaultSize:!0}),"label"),'[slot="label-only"]'){constructor(){super(...arguments);this.selects=void 0;this.deprecatedMenu=null;this.invalid=!1;this.pendingLabel="Pending";this.quiet=!1;this.value="";this.listRole="menu";this.itemRole="menuitem";this.handleEscape=e=>{e.key==="Escape"&&this.open&&(e.stopPropagation(),e.preventDefault(),this.toggle(!1))};this.handleKeydown=e=>{if(this.focused=!0,!!["ArrowUp","ArrowDown","Enter"," ","Escape"].includes(e.key)){if(e.key==="Escape"){this.handleEscape(e);return}e.stopPropagation(),e.preventDefault(),this.keyboardOpen()}};this.applyFocusElementLabel=(e,t)=>{this.appliedLabel=e,this.labelAlignment=t.sideAligned?"inline":void 0};this.hasRenderedOverlay=!1;this.willManageSelection=!1;this.selectionPromise=Promise.resolve();this.recentlyConnected=!1;this.enterKeydownOn=null;this.handleEnterKeydown=e=>{if(e.key!=="Enter")return;const t=e==null?void 0:e.target;if(!t.open&&t.hasSubmenu){e.preventDefault();return}if(this.enterKeydownOn){e.preventDefault();return}this.enterKeydownOn=e.target,this.addEventListener("keyup",async s=>{s.key==="Enter"&&(this.enterKeydownOn=null)},{once:!0})};this.handleSlottableRequest=e=>{this.dispatchEvent(new g(e.name,e.data))}}static get styles(){return[S]}get menuItems(){return this.optionsMenu.childItems}get selfManageFocusElement(){return!0}get selectedItem(){return this._selectedItem}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.toggle()}handleButtonClick(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}handleHelperFocus(){this.focused=!0,this.button.focus()}handleFocus(){!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleChange(e){this.strategy&&(this.strategy.preventNextToggle="no");const t=e.target,[s]=t.selectedItems;e.stopPropagation(),e.cancelable?this.setValueFromItem(s,e):(this.open=!1,this.strategy&&(this.strategy.open=!1))}handleButtonFocus(e){var t;(t=this.strategy)==null||t.handleButtonFocus(e)}async keyboardOpen(){var e;!this.open||!this.strategy.open?(this.addEventListener("sp-opened",()=>{var t;return(t=this.optionsMenu)==null?void 0:t.focusOnFirstSelectedItem()},{once:!0}),this.toggle(!0)):(e=this.optionsMenu)==null||e.focusOnFirstSelectedItem()}async setValueFromItem(e,t){var h;this.open=!1;const s=this.selectedItem,l=this.value;if(this.selectedItem=e,this.value=(h=e==null?void 0:e.value)!=null?h:"",await this.updateComplete,!this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))&&this.selects){t&&t.preventDefault(),this.setMenuItemSelected(this.selectedItem,!1),s&&this.setMenuItemSelected(s,!0),this.selectedItem=s,this.value=l,this.open=!0,this.strategy&&(this.strategy.open=!0);return}else if(!this.selects){this.selectedItem=s,this.value=l;return}s&&this.setMenuItemSelected(s,!1),this.setMenuItemSelected(e,!!this.selects)}setMenuItemSelected(e,t){this.selects!=null&&(e.selected=t)}get containerStyles(){return this.isMobile.matches?{"--swc-menu-width":"100%"}:{}}get selectedItemContent(){return this._selectedItemContent||{icon:[],content:[]}}set selectedItemContent(e){if(e===this.selectedItemContent)return;const t=this.selectedItemContent;this._selectedItemContent=e,this.requestUpdate("selectedItemContent",t)}handleTooltipSlotchange(e){var t;this.tooltipEl=e.target.assignedElements()[0],(t=this.tooltipEl)!=null&&t.selfManaged&&this.updateComplete.then(()=>{var s;(s=this.tooltipEl)!=null&&s.overlayElement&&this.button&&(this.tooltipEl.overlayElement.triggerElement=this.button)})}renderLabelContent(e){return this.value&&this.selectedItem?e:n`
1
+ "use strict";var b=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var i=(h,a,e,t)=>{for(var s=t>1?void 0:t?f(a,e):a,l=h.length-1,r;l>=0;l--)(r=h[l])&&(s=(t?r(a,e,s):r(s))||s);return t&&s&&b(a,e,s),s};import{html as n,nothing as y,SizedMixin as v}from"@spectrum-web-components/base";import{state as d}from"@spectrum-web-components/base/src/decorators.js";import{property as o}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as c,styleMap as u}from"@spectrum-web-components/base/src/directives.js";import{SlottableRequestEvent as g}from"@spectrum-web-components/overlay/src/slottable-request-event.js";import{DESCRIPTION_ID as m,ExpandableElement as w}from"@spectrum-web-components/picker";import{ObserveSlotPresence as I}from"@spectrum-web-components/shared/src/observe-slot-presence.js";import{ObserveSlotText as E}from"@spectrum-web-components/shared/src/observe-slot-text.js";import"@spectrum-web-components/action-button/sp-action-button.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-more.js";import S from"./action-menu.css.js";export class ActionMenu extends I(E(v(w,{noDefaultSize:!0}),"label"),'[slot="label-only"]'){constructor(){super(...arguments);this.selects=void 0;this.deprecatedMenu=null;this.invalid=!1;this.pendingLabel="Pending";this.quiet=!1;this.value="";this.listRole="menu";this.itemRole="menuitem";this.handleEscape=e=>{e.key==="Escape"&&this.open&&(e.stopPropagation(),e.preventDefault(),this.toggle(!1))};this.handleKeydown=e=>{if(this.focused=!0,!!["ArrowUp","ArrowDown","Enter"," ","Escape"].includes(e.key)){if(e.key==="Escape"){this.handleEscape(e);return}e.stopPropagation(),e.preventDefault(),this.keyboardOpen()}};this.applyFocusElementLabel=(e,t)=>{this.appliedLabel=e,this.labelAlignment=t.sideAligned?"inline":void 0};this.hasRenderedOverlay=!1;this.willManageSelection=!1;this.selectionPromise=Promise.resolve();this.recentlyConnected=!1;this.enterKeydownOn=null;this.handleEnterKeydown=e=>{if(e.key!=="Enter")return;const t=e==null?void 0:e.target;if(!t.open&&t.hasSubmenu){e.preventDefault();return}if(this.enterKeydownOn){e.preventDefault();return}this.enterKeydownOn=e.target,this.addEventListener("keyup",async s=>{s.key==="Enter"&&(this.enterKeydownOn=null)},{once:!0})};this.handleSlottableRequest=e=>{this.dispatchEvent(new g(e.name,e.data))}}static get styles(){return[S]}get menuItems(){return this.optionsMenu.childItems}get selfManageFocusElement(){return!0}get selectedItem(){return this._selectedItem}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.toggle()}handleButtonClick(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}handleHelperFocus(){this.focused=!0,this.button.focus()}handleFocus(){!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleChange(e){this.strategy&&(this.strategy.preventNextToggle="no");const t=e.target,[s]=t.selectedItems;e.stopPropagation(),e.cancelable?this.setValueFromItem(s,e):(this.open=!1,this.strategy&&(this.strategy.open=!1))}handleButtonFocus(e){var t;(t=this.strategy)==null||t.handleButtonFocus(e)}async keyboardOpen(){var e;!this.open||!this.strategy.open?(this.addEventListener("sp-opened",()=>{var t;return(t=this.optionsMenu)==null?void 0:t.focusOnFirstSelectedItem()},{once:!0}),this.toggle(!0)):(e=this.optionsMenu)==null||e.focusOnFirstSelectedItem()}async setValueFromItem(e,t){var p;this.open=!1;const s=this.selectedItem,l=this.value;if(this.selectedItem=e,this.value=(p=e==null?void 0:e.value)!=null?p:"",await this.updateComplete,!this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))&&this.selects){t&&t.preventDefault(),this.setMenuItemSelected(this.selectedItem,!1),s&&this.setMenuItemSelected(s,!0),this.selectedItem=s,this.value=l,this.open=!0,this.strategy&&(this.strategy.open=!0);return}else if(!this.selects){this.selectedItem=s,this.value=l;return}s&&this.setMenuItemSelected(s,!1),this.setMenuItemSelected(e,!!this.selects)}setMenuItemSelected(e,t){this.selects!=null&&(e.selected=t)}get containerStyles(){return this.isMobile.matches?{"--swc-menu-width":"100%"}:{}}get selectedItemContent(){return this._selectedItemContent||{icon:[],content:[]}}set selectedItemContent(e){if(e===this.selectedItemContent)return;const t=this.selectedItemContent;this._selectedItemContent=e,this.requestUpdate("selectedItemContent",t)}handleTooltipSlotchange(e){const t=e.target.assignedElements()[0];this.tooltipEl=t,t!=null&&t.selfManaged&&(this.button&&(t.triggerElement=this.button),this.updateComplete.then(()=>{t.selfManaged&&this.button&&(t.triggerElement=this.button)}))}renderLabelContent(e){return this.value&&this.selectedItem?e:n`
2
2
  <slot name="label" id="label">
3
- <span aria-hidden=${p(this.appliedLabel?void 0:"true")}>
3
+ <span aria-hidden=${c(this.appliedLabel?void 0:"true")}>
4
4
  ${this.label}
5
5
  </span>
6
6
  </slot>
@@ -47,11 +47,11 @@
47
47
  aria-describedby=${m}
48
48
  ?quiet=${this.quiet}
49
49
  ?selected=${this.open}
50
- static-color=${p(this.staticColor)}
50
+ static-color=${c(this.staticColor)}
51
51
  aria-haspopup="true"
52
- aria-controls=${p(this.open?"menu":void 0)}
52
+ aria-controls=${c(this.open?"menu":void 0)}
53
53
  aria-expanded=${this.open?"true":"false"}
54
- aria-label=${p(this.label||void 0)}
54
+ aria-label=${c(this.label||void 0)}
55
55
  id="button"
56
56
  class="button"
57
57
  size=${this.size}
@@ -108,5 +108,5 @@
108
108
  >
109
109
  <slot @slotchange=${this.shouldScheduleManageSelection}></slot>
110
110
  </sp-menu>
111
- `;return this.hasRenderedOverlay=this.hasRenderedOverlay||this.focused||this.open||!!this.deprecatedMenu,this.hasRenderedOverlay?(this.dependencyManager.loaded&&this.dependencyManager.add("sp-overlay"),this.renderOverlay(e)):e}shouldScheduleManageSelection(e){!this.willManageSelection&&(!e||e.target.getRootNode().host===this)&&(this.willManageSelection=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.manageSelection()})}))}shouldManageSelection(){this.willManageSelection||(this.willManageSelection=!0,this.manageSelection())}async manageSelection(){if(this.selects==null)return;this.selectionPromise=new Promise(t=>this.selectionResolver=t);let e;if(await this.optionsMenu.updateComplete,this.recentlyConnected&&(await new Promise(t=>requestAnimationFrame(()=>t(!0))),this.recentlyConnected=!1),this.menuItems.forEach(t=>{this.value===t.value&&!t.disabled?e=t:t.selected=!1}),e)e.selected=!!this.selects,this.selectedItem=e;else{const t=this.menuItems.some(s=>{var l;return s.value!=null||((l=s.getAttribute)==null?void 0:l.call(s,"value"))!=null});this.menuItems.length>0&&t&&(this.value="",this.selectedItem=void 0)}this.open&&(await this.optionsMenu.updateComplete,this.optionsMenu.updateSelectedItemIndex()),this.selectionResolver(),this.willManageSelection=!1}async getUpdateComplete(){const e=await super.getUpdateComplete();return await this.selectionPromise,e}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t;if(!((t=this.tooltipEl)!=null&&t.selfManaged))return;const e=this.tooltipEl.overlayElement;e&&(e.triggerElement=this.button)}),this.recentlyConnected=this.hasUpdated,this.addEventListener("focus",this.handleFocus)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus)}set selectedItem(e){if(this.selectedItemContent=e?e.itemChildren:void 0,e===this.selectedItem)return;const t=this.selectedItem;this._selectedItem=e,this.requestUpdate("selectedItem",t)}get hasLabel(){return this.slotHasContent}get labelOnly(){return this.slotContentIsPresent}}i([o({type:String})],ActionMenu.prototype,"selects",2),i([d()],ActionMenu.prototype,"labelAlignment",2),i([d()],ActionMenu.prototype,"appliedLabel",2),i([o({type:String,reflect:!0})],ActionMenu.prototype,"icons",2),i([o({type:Boolean,reflect:!0})],ActionMenu.prototype,"invalid",2),i([o({type:String,attribute:"pending-label"})],ActionMenu.prototype,"pendingLabel",2),i([o()],ActionMenu.prototype,"label",2),i([o({reflect:!0,attribute:"static-color"})],ActionMenu.prototype,"staticColor",2),i([o({type:Boolean,reflect:!0})],ActionMenu.prototype,"quiet",2),i([o({type:String})],ActionMenu.prototype,"value",2),i([o({attribute:!1})],ActionMenu.prototype,"selectedItem",1),i([d()],ActionMenu.prototype,"selectedItemContent",1),i([d()],ActionMenu.prototype,"labelOnly",1);
111
+ `;return this.hasRenderedOverlay=this.hasRenderedOverlay||this.focused||this.open||!!this.deprecatedMenu,this.hasRenderedOverlay?(this.dependencyManager.loaded&&this.dependencyManager.add("sp-overlay"),this.renderOverlay(e)):e}shouldScheduleManageSelection(e){!this.willManageSelection&&(!e||e.target.getRootNode().host===this)&&(this.willManageSelection=!0,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.manageSelection()})}))}shouldManageSelection(){this.willManageSelection||(this.willManageSelection=!0,this.manageSelection())}async manageSelection(){if(this.selects==null)return;this.selectionPromise=new Promise(t=>this.selectionResolver=t);let e;if(await this.optionsMenu.updateComplete,this.recentlyConnected&&(await new Promise(t=>requestAnimationFrame(()=>t(!0))),this.recentlyConnected=!1),this.menuItems.forEach(t=>{this.value===t.value&&!t.disabled?e=t:t.selected=!1}),e)e.selected=!!this.selects,this.selectedItem=e;else{const t=this.menuItems.some(s=>{var l;return s.value!=null||((l=s.getAttribute)==null?void 0:l.call(s,"value"))!=null});this.menuItems.length>0&&t&&(this.value="",this.selectedItem=void 0)}this.open&&(await this.optionsMenu.updateComplete,this.optionsMenu.updateSelectedItemIndex()),this.selectionResolver(),this.willManageSelection=!1}async getUpdateComplete(){const e=await super.getUpdateComplete();return await this.selectionPromise,e}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var e;(e=this.tooltipEl)!=null&&e.selfManaged&&this.button&&(this.tooltipEl.triggerElement=this.button)}),this.recentlyConnected=this.hasUpdated,this.addEventListener("focus",this.handleFocus)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus)}set selectedItem(e){if(this.selectedItemContent=e?e.itemChildren:void 0,e===this.selectedItem)return;const t=this.selectedItem;this._selectedItem=e,this.requestUpdate("selectedItem",t)}get hasLabel(){return this.slotHasContent}get labelOnly(){return this.slotContentIsPresent}}i([o({type:String})],ActionMenu.prototype,"selects",2),i([d()],ActionMenu.prototype,"labelAlignment",2),i([d()],ActionMenu.prototype,"appliedLabel",2),i([o({type:String,reflect:!0})],ActionMenu.prototype,"icons",2),i([o({type:Boolean,reflect:!0})],ActionMenu.prototype,"invalid",2),i([o({type:String,attribute:"pending-label"})],ActionMenu.prototype,"pendingLabel",2),i([o()],ActionMenu.prototype,"label",2),i([o({reflect:!0,attribute:"static-color"})],ActionMenu.prototype,"staticColor",2),i([o({type:Boolean,reflect:!0})],ActionMenu.prototype,"quiet",2),i([o({type:String})],ActionMenu.prototype,"value",2),i([o({attribute:!1})],ActionMenu.prototype,"selectedItem",1),i([d()],ActionMenu.prototype,"selectedItemContent",1),i([d()],ActionMenu.prototype,"labelOnly",1);
112
112
  //# sourceMappingURL=ActionMenu.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ActionMenu.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 html,\n nothing,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport {\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 type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport {\n DESCRIPTION_ID,\n ExpandableElement,\n} from '@spectrum-web-components/picker';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\n\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * An `<sp-action-menu>` is an action button with an attached menu of options.\n * Unlike a standard picker, it does not maintain a selection by default and\n * displays a \"more\" icon instead of a chevron.\n *\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for the Action Menu\n * @slot label - The label to use for the Action Menu\n * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to be applied to the Action Button\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\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 ActionMenu extends ObserveSlotPresence(\n ObserveSlotText(\n SizedMixin(ExpandableElement, { noDefaultSize: true }),\n 'label'\n ),\n '[slot=\"label-only\"]'\n) {\n /**\n * Returns the component's styles including action menu specific styles.\n */\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n /**\n * The selection mode for the action menu.\n * Unlike Picker, defaults to `undefined` (no selection management).\n * Set to `'single'` to maintain a selected item.\n */\n @property({ type: String })\n public selects: undefined | 'single' = undefined;\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 /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n /**\n * @deprecated Reference to a legacy `<sp-menu>` child element.\n * Used for backwards compatibility with older usage patterns.\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 * Applies static color styling for use on colored backgrounds.\n * - `'white'`: Use on dark backgrounds\n * - `'black'`: Use on light backgrounds\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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 /** The ARIA role for the menu list element. Uses 'menu' for action menus. */\n protected listRole: 'listbox' | 'menu' = 'menu';\n\n /** The ARIA role for individual menu items. Uses 'menuitem' for action menus. */\n protected itemRole = 'menuitem';\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 /**\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 * 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 /** Private backing field for selectedItemContent getter/setter. */\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 action button.\n * Includes the icon slot (with \"more\" icon default), label slot, and label-only slot.\n */\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? nothing\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\" size=${this.size}></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\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 action menu has an accessible label through any supported method:\n * Extends base check to include label slot content and label-only slot.\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 return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n this.hasLabel ||\n this.labelOnly\n );\n }\n\n /**\n * Logs a warning in debug mode when the action menu lacks an accessible label.\n * Provides guidance specific to action menu labeling options.\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/action-menu/#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',\n 'text content supplied in a <span> with slot=\"label\", or, text content supplied in a <span> with slot=\"label-only\"',\n '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 /**\n * Renders the action menu component.\n * Uses an action button as the trigger instead of a standard button.\n */\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static-color=${ifDefined(this.staticColor)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n <slot name=\"tooltip\" @slotchange=${this.handleTooltipSlotchange}></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n /**\n * Lifecycle callback before the component updates.\n * Transfers tabIndex from the host element to the internal button.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n if (changedProperties.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n /**\n * Handles property updates.\n * Forces the invalid property to always be false since action menus\n * don't support validation states.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\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 (changedProperties.has('disabled') && this.disabled) {\n this.close();\n }\n if (changedProperties.has('pending') && this.pending) {\n this.close();\n }\n if (changedProperties.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(changedProperties);\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 /**\n * Lifecycle callback after the component has updated.\n * Ensures the strategy has a reference to the overlay element when opened.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('open') &&\n this.overlayElement &&\n !this.strategy.overlay\n ) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Lifecycle callback after the component's first update.\n * Binds keyboard listeners and initializes the interaction strategy.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override async firstUpdated(\n changedProperties: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changedProperties);\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 /** Promise that resolves when selection management is complete. */\n private selectionPromise = Promise.resolve();\n\n /** Resolver function for the selectionPromise. */\n private selectionResolver!: () => void;\n\n /**\n * Returns a promise that resolves when the component update is complete,\n * including any pending selection management.\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 /**\n * Tracks whether the component was recently connected to the DOM.\n * Used to handle timing differences in Safari and Firefox.\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 /**\n * Lifecycle callback when the element is connected to the DOM.\n * Sets up tooltip trigger elements and focus event listeners.\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 /**\n * Sets the currently selected menu item and updates the displayed content.\n *\n * @param selectedItem - The menu item to select, or undefined to clear selection\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 /** Private backing field for selectedItem getter/setter. */\n _selectedItem?: MenuItem;\n\n /**\n * Whether the label slot has content.\n * Used to determine button layout and icon visibility.\n */\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n /**\n * Whether the label-only slot is being used.\n * When true, no icon space is reserved.\n */\n @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n /**\n * Handles slottable request events by re-dispatching them.\n * Allows parent components to intercept overlay content requests.\n *\n * @param event - The slottable request event\n */\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n}\n"],
5
- "mappings": "qNAYA,OAEE,QAAAA,EACA,WAAAC,EAEA,cAAAC,MAEK,gCACP,OAAS,SAAAC,MAAa,kDACtB,OAAS,YAAAC,MAAgB,kDACzB,OACE,aAAAC,EAEA,YAAAC,MACK,kDAQP,OAAS,yBAAAC,MAA6B,kEACtC,OACE,kBAAAC,EACA,qBAAAC,MACK,kCACP,OAAS,uBAAAC,MAA2B,+DACpC,OAAS,mBAAAC,MAAu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,EAAoC,CAK1D,GAJA,KAAK,oBAAsBA,EACvBA,EAAa,aACb,OAEAA,IAAiB,KAAK,aACxB,OAEF,MAAMX,EAAkB,KAAK,aAC7B,KAAK,cAAgBW,EACrB,KAAK,cAAc,eAAgBX,CAAe,CACpD,CASA,IAAY,UAAoB,CAC9B,OAAO,KAAK,cACd,CAOA,IAAY,WAAqB,CAC/B,OAAO,KAAK,oBACd,CAaF,CAn/BSe,EAAA,CADNjC,EAAS,CAAE,KAAM,MAAO,CAAC,GAnBf,WAoBJ,uBAIAiC,EAAA,CADNlC,EAAM,GAvBI,WAwBJ,8BAWPkC,EAAA,CADClC,EAAM,GAlCI,WAmCX,4BAcOkC,EAAA,CADNjC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAhD9B,WAiDJ,qBAIAiC,EAAA,CADNjC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GApD/B,WAqDJ,uBAIAiC,EAAA,CADNjC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GAxD3C,WAyDJ,4BAIAiC,EAAA,CADNjC,EAAS,GA5DC,WA6DJ,qBAQAiC,EAAA,CADNjC,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GApE3C,WAqEJ,2BAcAiC,EAAA,CADNjC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAlF/B,WAmFJ,qBAIAiC,EAAA,CADNjC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtFf,WAuFJ,qBAYIiC,EAAA,CADVjC,EAAS,CAAE,UAAW,EAAM,CAAC,GAlGnB,WAmGA,4BAkPGiC,EAAA,CADblC,EAAM,GApVI,WAqVG,mCAmqBFkC,EAAA,CADXlC,EAAM,GAv/BI,WAw/BC",
6
- "names": ["html", "nothing", "SizedMixin", "state", "property", "ifDefined", "styleMap", "SlottableRequestEvent", "DESCRIPTION_ID", "ExpandableElement", "ObserveSlotPresence", "ObserveSlotText", "actionMenuStyles", "event", "value", "labelElement", "target", "keyupEvent", "selected", "_a", "item", "menuChangeEvent", "oldSelectedItem", "oldValue", "selectedItemContent", "oldContent", "content", "menu", "container", "changedProperties", "_b", "accessibleMenu", "res", "selectedItem", "hasItemsWithValues", "complete", "overlayElement", "__decorateClass"]
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 html,\n nothing,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { state } from '@spectrum-web-components/base/src/decorators.js';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport {\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 type {\n Menu,\n MenuItem,\n MenuItemChildren,\n MenuItemKeydownEvent,\n} from '@spectrum-web-components/menu';\nimport { SlottableRequestEvent } from '@spectrum-web-components/overlay/src/slottable-request-event.js';\nimport {\n DESCRIPTION_ID,\n ExpandableElement,\n} from '@spectrum-web-components/picker';\nimport { ObserveSlotPresence } from '@spectrum-web-components/shared/src/observe-slot-presence.js';\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport type { Tooltip } from '@spectrum-web-components/tooltip';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\n\nimport actionMenuStyles from './action-menu.css.js';\n\n/**\n * An `<sp-action-menu>` is an action button with an attached menu of options.\n * Unlike a standard picker, it does not maintain a selection by default and\n * displays a \"more\" icon instead of a chevron.\n *\n * @element sp-action-menu\n *\n * @slot - menu items to be listed in the Action Menu\n * @slot icon - The icon to use for the Action Menu\n * @slot label - The label to use for the Action Menu\n * @slot label-only - The label to use for the Action Menu (no icon space reserved)\n * @slot tooltip - Tooltip to be applied to the Action Button\n * @attr selects - By default `sp-action-menu` does not manage a selection. If\n * you'd like for a selection to be held by the `sp-menu` that it presents in\n * its overlay, use `selects=\"single\" to activate this functionality.\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 ActionMenu extends ObserveSlotPresence(\n ObserveSlotText(\n SizedMixin(ExpandableElement, { noDefaultSize: true }),\n 'label'\n ),\n '[slot=\"label-only\"]'\n) {\n /**\n * Returns the component's styles including action menu specific styles.\n */\n public static override get styles(): CSSResultArray {\n return [actionMenuStyles];\n }\n\n /**\n * The selection mode for the action menu.\n * Unlike Picker, defaults to `undefined` (no selection management).\n * Set to `'single'` to maintain a selected item.\n */\n @property({ type: String })\n public selects: undefined | 'single' = undefined;\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 /** The label applied to the picker, typically from an associated field label. */\n @state()\n appliedLabel?: string;\n\n /**\n * @deprecated Reference to a legacy `<sp-menu>` child element.\n * Used for backwards compatibility with older usage patterns.\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 * Applies static color styling for use on colored backgrounds.\n * - `'white'`: Use on dark backgrounds\n * - `'black'`: Use on light backgrounds\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\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 /** The ARIA role for the menu list element. Uses 'menu' for action menus. */\n protected listRole: 'listbox' | 'menu' = 'menu';\n\n /** The ARIA role for individual menu items. Uses 'menuitem' for action menus. */\n protected itemRole = 'menuitem';\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 /**\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 * 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 /** Private backing field for selectedItemContent getter/setter. */\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 action button.\n * Includes the icon slot (with \"more\" icon default), label slot, and label-only slot.\n */\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n ${this.labelOnly\n ? nothing\n : html`\n <slot\n name=\"icon\"\n slot=\"icon\"\n ?icon-only=${!this.hasLabel}\n ?hidden=${this.labelOnly}\n >\n <sp-icon-more class=\"icon\" size=${this.size}></sp-icon-more>\n </slot>\n `}\n <slot name=\"label\" ?hidden=${!this.hasLabel}></slot>\n <slot name=\"label-only\"></slot>\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 action menu has an accessible label through any supported method:\n * Extends base check to include label slot content and label-only slot.\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 return (\n !!this.label ||\n !!this.getAttribute('aria-label') ||\n !!this.getAttribute('aria-labelledby') ||\n !!this.appliedLabel ||\n this.hasLabel ||\n this.labelOnly\n );\n }\n\n /**\n * Logs a warning in debug mode when the action menu lacks an accessible label.\n * Provides guidance specific to action menu labeling options.\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/action-menu/#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',\n 'text content supplied in a <span> with slot=\"label\", or, text content supplied in a <span> with slot=\"label-only\"',\n '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 /**\n * Renders the action menu component.\n * Uses an action button as the trigger instead of a standard button.\n */\n protected override render(): TemplateResult {\n if (this.tooltipEl) {\n this.tooltipEl.disabled = this.open;\n }\n return html`\n <sp-action-button\n aria-describedby=${DESCRIPTION_ID}\n ?quiet=${this.quiet}\n ?selected=${this.open}\n static-color=${ifDefined(this.staticColor)}\n aria-haspopup=\"true\"\n aria-controls=${ifDefined(this.open ? 'menu' : undefined)}\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-label=${ifDefined(this.label || undefined)}\n id=\"button\"\n class=\"button\"\n size=${this.size}\n @blur=${this.handleButtonBlur}\n @focus=${this.handleButtonFocus}\n @keydown=${{\n handleEvent: this.handleEnterKeydown,\n capture: true,\n }}\n ?disabled=${this.disabled}\n >\n ${this.buttonContent}\n </sp-action-button>\n <slot name=\"tooltip\" @slotchange=${this.handleTooltipSlotchange}></slot>\n ${this.renderMenu} ${this.renderDescriptionSlot}\n `;\n }\n\n /**\n * Lifecycle callback before the component updates.\n * Transfers tabIndex from the host element to the internal button.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n if (changedProperties.has('tabIndex') && !!this.tabIndex) {\n this.button.tabIndex = this.tabIndex;\n this.removeAttribute('tabindex');\n }\n }\n\n /**\n * Handles property updates.\n * Forces the invalid property to always be false since action menus\n * don't support validation states.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('invalid')) {\n this.invalid = false;\n }\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 (changedProperties.has('disabled') && this.disabled) {\n this.close();\n }\n if (changedProperties.has('pending') && this.pending) {\n this.close();\n }\n if (changedProperties.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(changedProperties);\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 /**\n * Lifecycle callback after the component has updated.\n * Ensures the strategy has a reference to the overlay element when opened.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n if (\n changedProperties.has('open') &&\n this.overlayElement &&\n !this.strategy.overlay\n ) {\n this.strategy.overlay = this.overlayElement;\n }\n }\n\n /**\n * Lifecycle callback after the component's first update.\n * Binds keyboard listeners and initializes the interaction strategy.\n *\n * @param changedProperties - Map of changed property names to previous values\n */\n protected override async firstUpdated(\n changedProperties: PropertyValues<this>\n ): Promise<void> {\n super.firstUpdated(changedProperties);\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 /** Promise that resolves when selection management is complete. */\n private selectionPromise = Promise.resolve();\n\n /** Resolver function for the selectionPromise. */\n private selectionResolver!: () => void;\n\n /**\n * Returns a promise that resolves when the component update is complete,\n * including any pending selection management.\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 /**\n * Tracks whether the component was recently connected to the DOM.\n * Used to handle timing differences in Safari and Firefox.\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 /**\n * Lifecycle callback when the element is connected to the DOM.\n * Sets up tooltip trigger elements and focus event listeners.\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 /**\n * Sets the currently selected menu item and updates the displayed content.\n *\n * @param selectedItem - The menu item to select, or undefined to clear selection\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 /** Private backing field for selectedItem getter/setter. */\n _selectedItem?: MenuItem;\n\n /**\n * Whether the label slot has content.\n * Used to determine button layout and icon visibility.\n */\n private get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n /**\n * Whether the label-only slot is being used.\n * When true, no icon space is reserved.\n */\n @state()\n private get labelOnly(): boolean {\n return this.slotContentIsPresent;\n }\n\n /**\n * Handles slottable request events by re-dispatching them.\n * Allows parent components to intercept overlay content requests.\n *\n * @param event - The slottable request event\n */\n public override handleSlottableRequest = (\n event: SlottableRequestEvent\n ): void => {\n this.dispatchEvent(new SlottableRequestEvent(event.name, event.data));\n };\n}\n"],
5
+ "mappings": "qNAYA,OAEE,QAAAA,EACA,WAAAC,EAEA,cAAAC,MAEK,gCACP,OAAS,SAAAC,MAAa,kDACtB,OAAS,YAAAC,MAAgB,kDACzB,OACE,aAAAC,EAEA,YAAAC,MACK,kDAQP,OAAS,yBAAAC,MAA6B,kEACtC,OACE,kBAAAC,EACA,qBAAAC,MACK,kCACP,OAAS,uBAAAC,MAA2B,+DACpC,OAAS,mBAAAC,MAAuB,2DAGhC,MAAO,6DACP,MAAO,gEAEP,OAAOC,MAAsB,uBAoBtB,aAAM,mBAAmBF,EAC9BC,EACET,EAAWO,EAAmB,CAAE,cAAe,EAAK,CAAC,EACrD,OACF,EACA,qBACF,CAAE,CANK,kCAoBL,KAAO,QAAgC,OAqBvC,KAAQ,eAA8B,KAYtC,KAAO,QAAU,GAIjB,KAAO,aAAe,UA0BtB,KAAO,MAAQ,GAIf,KAAO,MAAQ,GAGf,KAAU,SAA+B,OAGzC,KAAU,SAAW,WA4GrB,KAAU,aACRI,GACS,CACLA,EAAM,MAAQ,UAAY,KAAK,OACjCA,EAAM,gBAAgB,EACtBA,EAAM,eAAe,EACrB,KAAK,OAAO,EAAK,EAErB,EAQA,KAAU,cAAiBA,GAA+B,CAExD,GADA,KAAK,QAAU,GACX,EAAC,CAAC,UAAW,YAAa,QAAS,IAAK,QAAQ,EAAE,SAASA,EAAM,GAAG,EAGxE,IAAIA,EAAM,MAAQ,SAAU,CAC1B,KAAK,aAAaA,CAAK,EACvB,MACF,CACAA,EAAM,gBAAgB,EACtBA,EAAM,eAAe,EACrB,KAAK,aAAa,EACpB,EAkOA,4BAAyB,CAAC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iC,EAAA,CADNjC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAlF/B,WAmFJ,qBAIAiC,EAAA,CADNjC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtFf,WAuFJ,qBAYIiC,EAAA,CADVjC,EAAS,CAAE,UAAW,EAAM,CAAC,GAlGnB,WAmGA,4BAkPGiC,EAAA,CADblC,EAAM,GApVI,WAqVG,mCAkqBFkC,EAAA,CADXlC,EAAM,GAt/BI,WAu/BC",
6
+ "names": ["html", "nothing", "SizedMixin", "state", "property", "ifDefined", "styleMap", "SlottableRequestEvent", "DESCRIPTION_ID", "ExpandableElement", "ObserveSlotPresence", "ObserveSlotText", "actionMenuStyles", "event", "value", "labelElement", "target", "keyupEvent", "selected", "_a", "item", "menuChangeEvent", "oldSelectedItem", "oldValue", "selectedItemContent", "oldContent", "tooltipEl", "content", "menu", "container", "changedProperties", "_b", "accessibleMenu", "res", "selectedItem", "hasItemsWithValues", "complete", "__decorateClass"]
7
7
  }