@spectrum-web-components/menu 0.40.3 → 0.40.4
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/custom-elements.json +102 -0
- package/package.json +11 -11
- package/src/Menu.d.ts +3 -0
- package/src/Menu.dev.js +17 -0
- package/src/Menu.dev.js.map +2 -2
- package/src/Menu.js +1 -1
- package/src/Menu.js.map +2 -2
- package/src/menu-item.css.dev.js +3 -3
- package/src/menu-item.css.dev.js.map +1 -1
- package/src/menu-item.css.js +5 -5
- package/src/menu-item.css.js.map +1 -1
- package/src/spectrum-config.js +23 -0
- package/src/spectrum-menu-item.css.dev.js +3 -3
- package/src/spectrum-menu-item.css.dev.js.map +1 -1
- package/src/spectrum-menu-item.css.js +3 -3
- package/src/spectrum-menu-item.css.js.map +1 -1
- package/test/menu-selects.test.js +24 -41
- package/test/menu-selects.test.js.map +2 -2
- package/test/submenu.test.js +30 -68
- package/test/submenu.test.js.map +2 -2
package/src/Menu.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Menu.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport { MenuItem } from './MenuItem.js';\nimport type { MenuItemAddedOrUpdatedEvent } from './MenuItem.js';\nimport type { Overlay } from '@spectrum-web-components/overlay';\nimport menuStyles from './menu.css.js';\n\nexport interface MenuChildItem {\n menuItem: MenuItem;\n managed: boolean;\n active: boolean;\n focusable: boolean;\n focusRoot: Menu;\n}\n\ntype SelectsType = 'none' | 'ignore' | 'inherit' | 'multiple' | 'single';\ntype RoleType = 'group' | 'menu' | 'listbox' | 'none';\n\nfunction elementIsOrContains(\n el: Node,\n isOrContains: Node | undefined | null\n): boolean {\n return !!isOrContains && (el === isOrContains || el.contains(isOrContains));\n}\n\n/**\n * Spectrum Menu Component\n * @element sp-menu\n *\n * @slot - menu items to be listed in the menu\n * @fires change - Announces that the `value` of the element has changed\n * @attr selects - whether the element has a specific selection algorithm that it applies\n * to its item descendants. `single` allows only one descendent to be selected at a time.\n * `multiple` allows many descendants to be selected. `inherit` will be applied dynamically\n * when an ancestor of this element is actively managing the selection of its descendents.\n * When the `selects` attribute is not present a `value` will not be maintained and the Menu\n * Item children of this Menu will not have their `selected` state managed.\n */\nexport class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [menuStyles];\n }\n\n private get isSubmenu(): boolean {\n return this.slot === 'submenu';\n }\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public ignore = false;\n\n @property({ type: String, reflect: true })\n public selects: undefined | 'inherit' | 'single' | 'multiple';\n\n @property({ type: String })\n public value = '';\n\n // For the multiple select case, we'll join the value strings together\n // for the value property with this separator\n @property({ type: String, attribute: 'value-separator' })\n public valueSeparator = ',';\n\n // TODO: which of these to keep?\n @property({ attribute: false })\n public get selected(): string[] {\n return this._selected;\n }\n\n public set selected(selected: string[]) {\n if (selected === this.selected) {\n return;\n }\n const old = this.selected;\n this._selected = selected;\n this.selectedItems = [];\n this.selectedItemsMap.clear();\n this.childItems.forEach((item) => {\n item.selected = this.selected.includes(item.value);\n if (item.selected) {\n this.selectedItems.push(item);\n this.selectedItemsMap.set(item, true);\n }\n });\n this.requestUpdate('selected', old);\n }\n\n protected _selected = [] as string[];\n\n @property({ attribute: false })\n public selectedItems = [] as MenuItem[];\n\n @query('slot:not([name])')\n public menuSlot!: HTMLSlotElement;\n\n private childItemSet = new Set<MenuItem>();\n public focusedItemIndex = 0;\n public focusInItemIndex = 0;\n\n private selectedItemsMap = new Map() as Map<MenuItem, boolean>;\n\n public get childItems(): MenuItem[] {\n if (!this.cachedChildItems) {\n this.cachedChildItems = this.updateCachedMenuItems();\n }\n return this.cachedChildItems;\n }\n\n private cachedChildItems: MenuItem[] | undefined;\n\n private updateCachedMenuItems(): MenuItem[] {\n this.cachedChildItems = [];\n\n if (!this.menuSlot) {\n return [];\n }\n\n const slottedElements = this.menuSlot.assignedElements({\n flatten: true,\n }) as HTMLElement[];\n // Recursively flatten <slot> and non-<sp-menu-item> elements assigned to the menu into a single array.\n for (const [i, slottedElement] of slottedElements.entries()) {\n if (this.childItemSet.has(slottedElement as MenuItem)) {\n // Assign <sp-menu-item> members of the array that are in this.childItemSet to this.chachedChildItems.\n this.cachedChildItems.push(slottedElement as MenuItem);\n continue;\n }\n const isHTMLSlotElement = slottedElement.localName === 'slot';\n const flattenedChildren = isHTMLSlotElement\n ? (slottedElement as HTMLSlotElement).assignedElements({\n flatten: true,\n })\n : [...slottedElement.querySelectorAll(`:scope > *`)];\n slottedElements.splice(\n i,\n 1,\n slottedElement,\n ...(flattenedChildren as HTMLElement[])\n );\n }\n\n return this.cachedChildItems;\n }\n\n /**\n * Hide this getter from web-component-analyzer until\n * https://github.com/runem/web-component-analyzer/issues/131\n * has been addressed.\n *\n * @private\n */\n public get childRole(): string {\n if (this.resolvedRole === 'listbox') {\n return 'option';\n }\n switch (this.resolvedSelects) {\n case 'single':\n return 'menuitemradio';\n case 'multiple':\n return 'menuitemcheckbox';\n default:\n return 'menuitem';\n }\n }\n\n protected get ownRole(): string {\n return 'menu';\n }\n\n private resolvedSelects?: SelectsType;\n private resolvedRole?: RoleType;\n\n /**\n * When a descendant `<sp-menu-item>` element is added or updated it will dispatch\n * this event to announce its presence in the DOM. During the CAPTURE phase the first\n * Menu based element that the event encounters will manage the focus state of the\n * dispatching `<sp-menu-item>` element.\n * @param event\n */\n private onFocusableItemAddedOrUpdated(\n event: MenuItemAddedOrUpdatedEvent\n ): void {\n event.menuCascade.set(this, {\n hadFocusRoot: !!event.item.menuData.focusRoot,\n ancestorWithSelects: event.currentAncestorWithSelects,\n });\n if (this.selects) {\n event.currentAncestorWithSelects = this;\n }\n event.item.menuData.focusRoot = event.item.menuData.focusRoot || this;\n }\n\n /**\n * When a descendant `<sp-menu-item>` element is added or updated it will dispatch\n * this event to announce its presence in the DOM. During the BUBBLE phase the first\n * Menu based element that the event encounters that does not inherit selection will\n * manage the selection state of the dispatching `<sp-menu-item>` element.\n * @param event\n */\n private onSelectableItemAddedOrUpdated(\n event: MenuItemAddedOrUpdatedEvent\n ): void {\n const cascadeData = event.menuCascade.get(this);\n /* c8 ignore next 1 */\n if (!cascadeData) return;\n\n event.item.menuData.parentMenu = event.item.menuData.parentMenu || this;\n if (cascadeData.hadFocusRoot && !this.ignore) {\n // Only have one tab stop per Menu tree\n this.tabIndex = -1;\n }\n this.addChildItem(event.item);\n\n if (this.selects === 'inherit') {\n this.resolvedSelects = 'inherit';\n const ignoreMenu = event.currentAncestorWithSelects?.ignore;\n this.resolvedRole = ignoreMenu\n ? 'none'\n : ((event.currentAncestorWithSelects?.getAttribute('role') ||\n this.getAttribute('role') ||\n undefined) as RoleType);\n } else if (this.selects) {\n this.resolvedRole = this.ignore\n ? 'none'\n : ((this.getAttribute('role') || undefined) as RoleType);\n this.resolvedSelects = this.selects;\n } else {\n this.resolvedRole = this.ignore\n ? 'none'\n : ((this.getAttribute('role') || undefined) as RoleType);\n this.resolvedSelects =\n this.resolvedRole === 'none' ? 'ignore' : 'none';\n }\n\n const selects =\n this.resolvedSelects === 'single' ||\n this.resolvedSelects === 'multiple';\n event.item.menuData.cleanupSteps.push((item: MenuItem) =>\n this.removeChildItem(item)\n );\n if (\n (selects || (!this.selects && this.resolvedSelects !== 'ignore')) &&\n !event.item.menuData.selectionRoot\n ) {\n event.item.setRole(this.childRole);\n event.item.menuData.selectionRoot =\n event.item.menuData.selectionRoot || this;\n if (event.item.selected) {\n this.selectedItemsMap.set(event.item, true);\n this.selectedItems = [...this.selectedItems, event.item];\n this._selected = [...this.selected, event.item.value];\n this.value = this.selected.join(this.valueSeparator);\n }\n }\n }\n\n private addChildItem(item: MenuItem): void {\n this.childItemSet.add(item);\n this.handleItemsChanged();\n }\n\n private async removeChildItem(item: MenuItem): Promise<void> {\n this.childItemSet.delete(item);\n this.cachedChildItems = undefined;\n if (item.focused) {\n this.handleItemsChanged();\n await this.updateComplete;\n this.focus();\n }\n }\n\n public constructor() {\n super();\n\n this.addEventListener(\n 'sp-menu-item-added-or-updated',\n this.onSelectableItemAddedOrUpdated\n );\n this.addEventListener(\n 'sp-menu-item-added-or-updated',\n this.onFocusableItemAddedOrUpdated,\n {\n capture: true,\n }\n );\n\n this.addEventListener('click', this.handleClick);\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('sp-opened', this.handleSubmenuOpened);\n this.addEventListener('sp-closed', this.handleSubmenuClosed);\n }\n\n public override focus({ preventScroll }: FocusOptions = {}): void {\n if (\n !this.childItems.length ||\n this.childItems.every((childItem) => childItem.disabled)\n ) {\n return;\n }\n if (\n this.childItems.some(\n (childItem) => childItem.menuData.focusRoot !== this\n )\n ) {\n super.focus({ preventScroll });\n return;\n }\n this.focusMenuItemByOffset(0);\n super.focus({ preventScroll });\n const selectedItem = this.selectedItems[0];\n if (selectedItem && !preventScroll) {\n selectedItem.scrollIntoView({ block: 'nearest' });\n }\n }\n\n private handleClick(event: Event): void {\n const path = event.composedPath();\n const target = path.find((el) => {\n /* c8 ignore next 3 */\n if (!(el instanceof Element)) {\n return false;\n }\n return el.getAttribute('role') === this.childRole;\n }) as MenuItem;\n if (event.defaultPrevented) {\n const index = this.childItems.indexOf(target);\n if (target?.menuData.focusRoot === this && index > -1) {\n this.focusedItemIndex = index;\n }\n return;\n }\n if (target?.href && target.href.length) {\n // This event will NOT ALLOW CANCELATION as link action\n // cancelation should occur on the `<sp-menu-item>` itself.\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n return;\n } else if (\n target?.menuData.selectionRoot === this &&\n this.childItems.length\n ) {\n event.preventDefault();\n if (target.hasSubmenu || target.open) {\n return;\n }\n this.selectOrToggleItem(target);\n } else {\n return;\n }\n this.prepareToCleanUp();\n }\n\n public handleFocusin(event: FocusEvent): void {\n if (\n this.childItems.some(\n (childItem) => childItem.menuData.focusRoot !== this\n )\n ) {\n return;\n }\n const activeElement = (this.getRootNode() as Document).activeElement as\n | MenuItem\n | Menu;\n const selectionRoot =\n this.childItems[this.focusedItemIndex]?.menuData.selectionRoot ||\n this;\n if (activeElement !== selectionRoot || event.target !== this) {\n selectionRoot.focus({ preventScroll: true });\n if (activeElement && this.focusedItemIndex === 0) {\n const offset = this.childItems.findIndex(\n (childItem) => childItem === activeElement\n );\n this.focusMenuItemByOffset(Math.max(offset, 0));\n }\n }\n this.startListeningToKeyboard();\n }\n\n public startListeningToKeyboard(): void {\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n public handleBlur(event: FocusEvent): void {\n if (elementIsOrContains(this, event.relatedTarget as Node)) {\n return;\n }\n this.stopListeningToKeyboard();\n this.childItems.forEach((child) => (child.focused = false));\n this.removeAttribute('aria-activedescendant');\n }\n\n public stopListeningToKeyboard(): void {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n\n private descendentOverlays = new Map<Overlay, Overlay>();\n\n protected handleDescendentOverlayOpened(event: Event): void {\n const target = event.composedPath()[0] as MenuItem;\n /* c8 ignore next 1 */\n if (!target.overlayElement) return;\n this.descendentOverlays.set(\n target.overlayElement,\n target.overlayElement\n );\n }\n\n protected handleDescendentOverlayClosed(event: Event): void {\n const target = event.composedPath()[0] as MenuItem;\n /* c8 ignore next 1 */\n if (!target.overlayElement) return;\n this.descendentOverlays.delete(target.overlayElement);\n }\n\n public handleSubmenuClosed = (event: Event): void => {\n event.stopPropagation();\n const target = event.composedPath()[0] as Overlay;\n target.dispatchEvent(\n new Event('sp-menu-submenu-closed', {\n bubbles: true,\n composed: true,\n })\n );\n };\n\n public handleSubmenuOpened = (event: Event): void => {\n event.stopPropagation();\n const target = event.composedPath()[0] as Overlay;\n target.dispatchEvent(\n new Event('sp-menu-submenu-opened', {\n bubbles: true,\n composed: true,\n })\n );\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n }\n const openedItem = event\n .composedPath()\n .find((el) => this.childItemSet.has(el as MenuItem));\n /* c8 ignore next 1 */\n if (!openedItem) return;\n const openedItemIndex = this.childItems.indexOf(openedItem as MenuItem);\n this.focusedItemIndex = openedItemIndex;\n this.focusInItemIndex = openedItemIndex;\n };\n\n public async selectOrToggleItem(targetItem: MenuItem): Promise<void> {\n const resolvedSelects = this.resolvedSelects;\n const oldSelectedItemsMap = new Map(this.selectedItemsMap);\n const oldSelected = this.selected.slice();\n const oldSelectedItems = this.selectedItems.slice();\n const oldValue = this.value;\n const focusedChild = this.childItems[this.focusedItemIndex];\n if (focusedChild) {\n focusedChild.focused = false;\n focusedChild.active = false;\n }\n this.focusedItemIndex = this.childItems.indexOf(targetItem);\n this.forwardFocusVisibleToItem(targetItem);\n\n if (resolvedSelects === 'multiple') {\n if (this.selectedItemsMap.has(targetItem)) {\n this.selectedItemsMap.delete(targetItem);\n } else {\n this.selectedItemsMap.set(targetItem, true);\n }\n\n // Match HTML select and set the first selected\n // item as the value. Also set the selected array\n // in the order of the menu items.\n const selected: string[] = [];\n const selectedItems: MenuItem[] = [];\n\n this.childItemSet.forEach((childItem) => {\n if (childItem.menuData.selectionRoot !== this) return;\n\n if (this.selectedItemsMap.has(childItem)) {\n selected.push(childItem.value);\n selectedItems.push(childItem);\n }\n });\n this._selected = selected;\n this.selectedItems = selectedItems;\n this.value = this.selected.join(this.valueSeparator);\n } else {\n this.selectedItemsMap.clear();\n this.selectedItemsMap.set(targetItem, true);\n this.value = targetItem.value;\n this._selected = [targetItem.value];\n this.selectedItems = [targetItem];\n }\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n cancelable: true,\n bubbles: true,\n composed: true,\n })\n );\n if (!applyDefault) {\n // Cancel the event & don't apply the selection\n this._selected = oldSelected;\n this.selectedItems = oldSelectedItems;\n this.selectedItemsMap = oldSelectedItemsMap;\n this.value = oldValue;\n return;\n }\n // Apply the selection changes to the menu items\n if (resolvedSelects === 'single') {\n for (const oldItem of oldSelectedItemsMap.keys()) {\n if (oldItem !== targetItem) {\n oldItem.selected = false;\n }\n }\n targetItem.selected = true;\n } else if (resolvedSelects === 'multiple') {\n targetItem.selected = !targetItem.selected;\n }\n }\n\n protected navigateWithinMenu(event: KeyboardEvent): void {\n const { code } = event;\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n const direction = code === 'ArrowDown' ? 1 : -1;\n const itemToFocus = this.focusMenuItemByOffset(direction);\n if (itemToFocus === lastFocusedItem) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n itemToFocus.scrollIntoView({ block: 'nearest' });\n }\n\n protected navigateBetweenRelatedMenus(event: KeyboardEvent): void {\n const { code } = event;\n const shouldOpenSubmenu =\n (this.isLTR && code === 'ArrowRight') ||\n (!this.isLTR && code === 'ArrowLeft');\n const shouldCloseSelfAsSubmenu =\n (this.isLTR && code === 'ArrowLeft') ||\n (!this.isLTR && code === 'ArrowRight');\n if (shouldOpenSubmenu) {\n event.stopPropagation();\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n if (lastFocusedItem?.hasSubmenu) {\n // Remove focus while opening overlay from keyboard or the visible focus\n // will slip back to the first item in the menu.\n lastFocusedItem.openOverlay();\n }\n } else if (shouldCloseSelfAsSubmenu && this.isSubmenu) {\n event.stopPropagation();\n this.dispatchEvent(new Event('close', { bubbles: true }));\n this.updateSelectedItemIndex();\n }\n }\n\n public handleKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented) {\n return;\n }\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n if (lastFocusedItem) {\n lastFocusedItem.focused = true;\n }\n const { code } = event;\n if (\n event.shiftKey &&\n event.target !== this &&\n this.hasAttribute('tabindex')\n ) {\n this.removeAttribute('tabindex');\n const replaceTabindex = (\n event: FocusEvent | KeyboardEvent\n ): void => {\n if (\n !(event as KeyboardEvent).shiftKey &&\n !this.hasAttribute('tabindex')\n ) {\n this.tabIndex = 0;\n document.removeEventListener('keyup', replaceTabindex);\n this.removeEventListener('focusout', replaceTabindex);\n }\n };\n document.addEventListener('keyup', replaceTabindex);\n this.addEventListener('focusout', replaceTabindex);\n }\n if (code === 'Tab') {\n this.prepareToCleanUp();\n return;\n }\n if (code === 'Space') {\n if (lastFocusedItem?.hasSubmenu) {\n // Remove focus while opening overlay from keyboard or the visible focus\n // will slip back to the first item in the menu.\n // this.blur();\n lastFocusedItem.openOverlay();\n return;\n }\n }\n if (code === 'Space' || code === 'Enter') {\n const childItem = this.childItems[this.focusedItemIndex];\n if (\n childItem &&\n childItem.menuData.selectionRoot === event.target\n ) {\n childItem.click();\n }\n return;\n }\n if (code === 'ArrowDown' || code === 'ArrowUp') {\n const childItem = this.childItems[this.focusedItemIndex];\n if (\n childItem &&\n childItem.menuData.selectionRoot === event.target\n ) {\n this.navigateWithinMenu(event);\n }\n return;\n }\n this.navigateBetweenRelatedMenus(event);\n }\n\n public focusMenuItemByOffset(offset: number): MenuItem {\n const step = offset || 1;\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n // Remain active while a submenu is opened.\n focusedItem.active = focusedItem.open;\n }\n this.focusedItemIndex =\n (this.childItems.length + this.focusedItemIndex + offset) %\n this.childItems.length;\n let itemToFocus = this.childItems[this.focusedItemIndex];\n let availableItems = this.childItems.length;\n // cycle through the available items in the directions of the offset to find the next non-disabled item\n while (itemToFocus?.disabled && availableItems) {\n availableItems -= 1;\n this.focusedItemIndex =\n (this.childItems.length + this.focusedItemIndex + step) %\n this.childItems.length;\n itemToFocus = this.childItems[this.focusedItemIndex];\n }\n // if there are no non-disabled items, skip the work to focus a child\n if (!itemToFocus?.disabled) {\n this.forwardFocusVisibleToItem(itemToFocus);\n }\n return itemToFocus;\n }\n\n private prepareToCleanUp(): void {\n document.addEventListener(\n 'focusout',\n () => {\n requestAnimationFrame(() => {\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n this.updateSelectedItemIndex();\n }\n });\n },\n { once: true }\n );\n }\n\n private _hasUpdatedSelectedItemIndex = false;\n\n public updateSelectedItemIndex(): void {\n let firstOrFirstSelectedIndex = 0;\n const selectedItemsMap = new Map<MenuItem, boolean>();\n const selected: string[] = [];\n const selectedItems: MenuItem[] = [];\n let itemIndex = this.childItems.length;\n while (itemIndex) {\n itemIndex -= 1;\n const childItem = this.childItems[itemIndex];\n if (childItem.menuData.selectionRoot === this) {\n if (\n childItem.selected ||\n (!this._hasUpdatedSelectedItemIndex &&\n this.selected.includes(childItem.value))\n ) {\n firstOrFirstSelectedIndex = itemIndex;\n selectedItemsMap.set(childItem, true);\n selected.unshift(childItem.value);\n selectedItems.unshift(childItem);\n }\n // Remove \"focused\" from non-\"selected\" items ONLY\n // Preserve \"focused\" on index===0 when no selection\n if (itemIndex !== firstOrFirstSelectedIndex) {\n childItem.focused = false;\n }\n }\n }\n selectedItems.map((item, i) => {\n // When there is more than one \"selected\" item,\n // ensure only the first one can be \"focused\"\n if (i > 0) {\n item.focused = false;\n }\n });\n this.selectedItemsMap = selectedItemsMap;\n this._selected = selected;\n this.selectedItems = selectedItems;\n this.value = this.selected.join(this.valueSeparator);\n this.focusedItemIndex = firstOrFirstSelectedIndex;\n this.focusInItemIndex = firstOrFirstSelectedIndex;\n }\n\n private _willUpdateItems = false;\n\n private handleItemsChanged(): void {\n this.cachedChildItems = undefined;\n if (!this._willUpdateItems) {\n this._willUpdateItems = true;\n this.cacheUpdated = this.updateCache();\n }\n }\n\n private async updateCache(): Promise<void> {\n if (!this.hasUpdated) {\n await Promise.all([\n new Promise((res) => requestAnimationFrame(() => res(true))),\n this.updateComplete,\n ]);\n } else {\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n }\n if (this.cachedChildItems === undefined) {\n this.updateSelectedItemIndex();\n this.updateItemFocus();\n }\n this._willUpdateItems = false;\n }\n\n private updateItemFocus(): void {\n if (this.childItems.length == 0) {\n return;\n }\n const focusInItem = this.childItems[this.focusInItemIndex];\n if (\n (this.getRootNode() as Document).activeElement ===\n focusInItem.menuData.focusRoot\n ) {\n this.forwardFocusVisibleToItem(focusInItem);\n }\n }\n\n public closeDescendentOverlays(): void {\n this.descendentOverlays.forEach((overlay) => {\n overlay.open = false;\n });\n this.descendentOverlays = new Map<Overlay, Overlay>();\n }\n\n private forwardFocusVisibleToItem(item: MenuItem): void {\n if (!item || item.menuData.focusRoot !== this) {\n return;\n }\n this.closeDescendentOverlays();\n const focused =\n this.hasVisibleFocusInTree() ||\n !!this.childItems.find((child) => {\n return child.hasVisibleFocusInTree();\n });\n item.focused = focused;\n this.setAttribute('aria-activedescendant', item.id);\n if (\n item.menuData.selectionRoot &&\n item.menuData.selectionRoot !== this\n ) {\n item.menuData.selectionRoot.focus();\n }\n }\n\n private handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n const assignedElement = target.assignedElements({\n flatten: true,\n }) as MenuItem[];\n if (this.childItems.length !== assignedElement.length) {\n assignedElement.forEach((item) => {\n if (typeof item.triggerUpdate !== 'undefined') {\n item.triggerUpdate();\n }\n });\n }\n }\n\n protected renderMenuItemSlot(): TemplateResult {\n return html`\n <slot\n @sp-menu-submenu-opened=${this.handleDescendentOverlayOpened}\n @sp-menu-submenu-closed=${this.handleDescendentOverlayClosed}\n @slotchange=${this.handleSlotchange}\n ></slot>\n `;\n }\n\n public override render(): TemplateResult {\n return this.renderMenuItemSlot();\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n if (!this.hasAttribute('tabindex') && !this.ignore) {\n const role = this.getAttribute('role');\n if (role === 'group') {\n this.tabIndex = -1;\n } else {\n this.tabIndex = 0;\n }\n }\n const updates: Promise<unknown>[] = [\n new Promise((res) => requestAnimationFrame(() => res(true))),\n ];\n [...this.children].forEach((item) => {\n if ((item as MenuItem).localName === 'sp-menu-item') {\n updates.push((item as MenuItem).updateComplete);\n }\n });\n this.childItemsUpdated = Promise.all(updates);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('selects') && this.hasUpdated) {\n this.selectsChanged();\n }\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label) {\n this.setAttribute('aria-label', this.label);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n protected selectsChanged(): void {\n const updates: Promise<unknown>[] = [\n new Promise((res) => requestAnimationFrame(() => res(true))),\n ];\n this.childItemSet.forEach((childItem) => {\n updates.push(childItem.triggerUpdate());\n });\n this.childItemsUpdated = Promise.all(updates);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute('role') && !this.ignore) {\n this.setAttribute('role', this.ownRole);\n }\n this.updateComplete.then(() => this.updateItemFocus());\n }\n public override disconnectedCallback(): void {\n this.cachedChildItems = undefined;\n super.disconnectedCallback();\n }\n\n protected childItemsUpdated!: Promise<unknown[]>;\n protected cacheUpdated = Promise.resolve();\n /* c8 ignore next 3 */\n protected resolveCacheUpdated = (): void => {\n return;\n };\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.childItemsUpdated;\n await this.cacheUpdated;\n return complete;\n }\n}\n"],
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,EACA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA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,CAEgB,mBAA0B,CACtC,MAAM,kBAAkB,EACpB,CAAC,KAAK,aAAa,MAAM,GAAK,CAAC,KAAK,QACpC,KAAK,aAAa,OAAQ,KAAK,OAAO,EAE1C,KAAK,eAAe,KAAK,IAAM,KAAK,gBAAgB,CAAC,CACzD,CACgB,sBAA6B,CACzC,KAAK,iBAAmB,OACxB,MAAM,qBAAqB,CAC/B,CASA,MAAyB,mBAAsC,CAC3D,MAAME,EAAY,MAAM,MAAM,kBAAkB,EAChD,aAAM,KAAK,kBACX,MAAM,KAAK,aACJA,CACX,CACJ,CAv0BWC,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAThC,KAUF,qBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAZjC,KAaF,sBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAfhC,KAgBF,uBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,MAAO,CAAC,GAlBjB,KAmBF,qBAKA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,UAAW,iBAAkB,CAAC,GAvB/C,KAwBF,8BAII6D,EAAA,CADV7D,EAAS,CAAE,UAAW,EAAM,CAAC,GA3BrB,KA4BE,wBAyBJ6D,EAAA,CADN7D,EAAS,CAAE,UAAW,EAAM,CAAC,GApDrB,KAqDF,6BAGA6D,EAAA,CADN5D,EAAM,kBAAkB,GAvDhB,KAwDF",
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport { MenuItem } from './MenuItem.js';\nimport type { MenuItemAddedOrUpdatedEvent } from './MenuItem.js';\nimport type { Overlay } from '@spectrum-web-components/overlay';\nimport menuStyles from './menu.css.js';\n\nexport interface MenuChildItem {\n menuItem: MenuItem;\n managed: boolean;\n active: boolean;\n focusable: boolean;\n focusRoot: Menu;\n}\n\ntype SelectsType = 'none' | 'ignore' | 'inherit' | 'multiple' | 'single';\ntype RoleType = 'group' | 'menu' | 'listbox' | 'none';\n\nfunction elementIsOrContains(\n el: Node,\n isOrContains: Node | undefined | null\n): boolean {\n return !!isOrContains && (el === isOrContains || el.contains(isOrContains));\n}\n\n/**\n * Spectrum Menu Component\n * @element sp-menu\n *\n * @slot - menu items to be listed in the menu\n * @fires change - Announces that the `value` of the element has changed\n * @attr selects - whether the element has a specific selection algorithm that it applies\n * to its item descendants. `single` allows only one descendent to be selected at a time.\n * `multiple` allows many descendants to be selected. `inherit` will be applied dynamically\n * when an ancestor of this element is actively managing the selection of its descendents.\n * When the `selects` attribute is not present a `value` will not be maintained and the Menu\n * Item children of this Menu will not have their `selected` state managed.\n */\nexport class Menu extends SizedMixin(SpectrumElement, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [menuStyles];\n }\n\n private get isSubmenu(): boolean {\n return this.slot === 'submenu';\n }\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public ignore = false;\n\n @property({ type: String, reflect: true })\n public selects: undefined | 'inherit' | 'single' | 'multiple';\n\n @property({ type: String })\n public value = '';\n\n // For the multiple select case, we'll join the value strings together\n // for the value property with this separator\n @property({ type: String, attribute: 'value-separator' })\n public valueSeparator = ',';\n\n // TODO: which of these to keep?\n @property({ attribute: false })\n public get selected(): string[] {\n return this._selected;\n }\n\n public set selected(selected: string[]) {\n if (selected === this.selected) {\n return;\n }\n const old = this.selected;\n this._selected = selected;\n this.selectedItems = [];\n this.selectedItemsMap.clear();\n this.childItems.forEach((item) => {\n item.selected = this.selected.includes(item.value);\n if (item.selected) {\n this.selectedItems.push(item);\n this.selectedItemsMap.set(item, true);\n }\n });\n this.requestUpdate('selected', old);\n }\n\n protected _selected = [] as string[];\n\n @property({ attribute: false })\n public selectedItems = [] as MenuItem[];\n\n @query('slot:not([name])')\n public menuSlot!: HTMLSlotElement;\n\n private childItemSet = new Set<MenuItem>();\n public focusedItemIndex = 0;\n public focusInItemIndex = 0;\n\n private selectedItemsMap = new Map() as Map<MenuItem, boolean>;\n\n public get childItems(): MenuItem[] {\n if (!this.cachedChildItems) {\n this.cachedChildItems = this.updateCachedMenuItems();\n }\n return this.cachedChildItems;\n }\n\n private cachedChildItems: MenuItem[] | undefined;\n\n private updateCachedMenuItems(): MenuItem[] {\n this.cachedChildItems = [];\n\n if (!this.menuSlot) {\n return [];\n }\n\n const slottedElements = this.menuSlot.assignedElements({\n flatten: true,\n }) as HTMLElement[];\n // Recursively flatten <slot> and non-<sp-menu-item> elements assigned to the menu into a single array.\n for (const [i, slottedElement] of slottedElements.entries()) {\n if (this.childItemSet.has(slottedElement as MenuItem)) {\n // Assign <sp-menu-item> members of the array that are in this.childItemSet to this.chachedChildItems.\n this.cachedChildItems.push(slottedElement as MenuItem);\n continue;\n }\n const isHTMLSlotElement = slottedElement.localName === 'slot';\n const flattenedChildren = isHTMLSlotElement\n ? (slottedElement as HTMLSlotElement).assignedElements({\n flatten: true,\n })\n : [...slottedElement.querySelectorAll(`:scope > *`)];\n slottedElements.splice(\n i,\n 1,\n slottedElement,\n ...(flattenedChildren as HTMLElement[])\n );\n }\n\n return this.cachedChildItems;\n }\n\n /**\n * Hide this getter from web-component-analyzer until\n * https://github.com/runem/web-component-analyzer/issues/131\n * has been addressed.\n *\n * @private\n */\n public get childRole(): string {\n if (this.resolvedRole === 'listbox') {\n return 'option';\n }\n switch (this.resolvedSelects) {\n case 'single':\n return 'menuitemradio';\n case 'multiple':\n return 'menuitemcheckbox';\n default:\n return 'menuitem';\n }\n }\n\n protected get ownRole(): string {\n return 'menu';\n }\n\n private resolvedSelects?: SelectsType;\n private resolvedRole?: RoleType;\n\n /**\n * When a descendant `<sp-menu-item>` element is added or updated it will dispatch\n * this event to announce its presence in the DOM. During the CAPTURE phase the first\n * Menu based element that the event encounters will manage the focus state of the\n * dispatching `<sp-menu-item>` element.\n * @param event\n */\n private onFocusableItemAddedOrUpdated(\n event: MenuItemAddedOrUpdatedEvent\n ): void {\n event.menuCascade.set(this, {\n hadFocusRoot: !!event.item.menuData.focusRoot,\n ancestorWithSelects: event.currentAncestorWithSelects,\n });\n if (this.selects) {\n event.currentAncestorWithSelects = this;\n }\n event.item.menuData.focusRoot = event.item.menuData.focusRoot || this;\n }\n\n /**\n * When a descendant `<sp-menu-item>` element is added or updated it will dispatch\n * this event to announce its presence in the DOM. During the BUBBLE phase the first\n * Menu based element that the event encounters that does not inherit selection will\n * manage the selection state of the dispatching `<sp-menu-item>` element.\n * @param event\n */\n private onSelectableItemAddedOrUpdated(\n event: MenuItemAddedOrUpdatedEvent\n ): void {\n const cascadeData = event.menuCascade.get(this);\n /* c8 ignore next 1 */\n if (!cascadeData) return;\n\n event.item.menuData.parentMenu = event.item.menuData.parentMenu || this;\n if (cascadeData.hadFocusRoot && !this.ignore) {\n // Only have one tab stop per Menu tree\n this.tabIndex = -1;\n }\n this.addChildItem(event.item);\n\n if (this.selects === 'inherit') {\n this.resolvedSelects = 'inherit';\n const ignoreMenu = event.currentAncestorWithSelects?.ignore;\n this.resolvedRole = ignoreMenu\n ? 'none'\n : ((event.currentAncestorWithSelects?.getAttribute('role') ||\n this.getAttribute('role') ||\n undefined) as RoleType);\n } else if (this.selects) {\n this.resolvedRole = this.ignore\n ? 'none'\n : ((this.getAttribute('role') || undefined) as RoleType);\n this.resolvedSelects = this.selects;\n } else {\n this.resolvedRole = this.ignore\n ? 'none'\n : ((this.getAttribute('role') || undefined) as RoleType);\n this.resolvedSelects =\n this.resolvedRole === 'none' ? 'ignore' : 'none';\n }\n\n const selects =\n this.resolvedSelects === 'single' ||\n this.resolvedSelects === 'multiple';\n event.item.menuData.cleanupSteps.push((item: MenuItem) =>\n this.removeChildItem(item)\n );\n if (\n (selects || (!this.selects && this.resolvedSelects !== 'ignore')) &&\n !event.item.menuData.selectionRoot\n ) {\n event.item.setRole(this.childRole);\n event.item.menuData.selectionRoot =\n event.item.menuData.selectionRoot || this;\n if (event.item.selected) {\n this.selectedItemsMap.set(event.item, true);\n this.selectedItems = [...this.selectedItems, event.item];\n this._selected = [...this.selected, event.item.value];\n this.value = this.selected.join(this.valueSeparator);\n }\n }\n }\n\n private addChildItem(item: MenuItem): void {\n this.childItemSet.add(item);\n this.handleItemsChanged();\n }\n\n private async removeChildItem(item: MenuItem): Promise<void> {\n this.childItemSet.delete(item);\n this.cachedChildItems = undefined;\n if (item.focused) {\n this.handleItemsChanged();\n await this.updateComplete;\n this.focus();\n }\n }\n\n public constructor() {\n super();\n\n this.addEventListener(\n 'sp-menu-item-added-or-updated',\n this.onSelectableItemAddedOrUpdated\n );\n this.addEventListener(\n 'sp-menu-item-added-or-updated',\n this.onFocusableItemAddedOrUpdated,\n {\n capture: true,\n }\n );\n\n this.addEventListener('click', this.handleClick);\n this.addEventListener('pointerup', this.handlePointerup);\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('sp-opened', this.handleSubmenuOpened);\n this.addEventListener('sp-closed', this.handleSubmenuClosed);\n }\n\n public override focus({ preventScroll }: FocusOptions = {}): void {\n if (\n !this.childItems.length ||\n this.childItems.every((childItem) => childItem.disabled)\n ) {\n return;\n }\n if (\n this.childItems.some(\n (childItem) => childItem.menuData.focusRoot !== this\n )\n ) {\n super.focus({ preventScroll });\n return;\n }\n this.focusMenuItemByOffset(0);\n super.focus({ preventScroll });\n const selectedItem = this.selectedItems[0];\n if (selectedItem && !preventScroll) {\n selectedItem.scrollIntoView({ block: 'nearest' });\n }\n }\n\n private willSynthesizeClick = 0;\n\n private handleClick(event: Event): void {\n if (this.willSynthesizeClick) {\n cancelAnimationFrame(this.willSynthesizeClick);\n return;\n }\n this.handlePointerBasedSelection(event);\n }\n\n private handlePointerup(event: Event): void {\n this.willSynthesizeClick = requestAnimationFrame(() => {\n event.target?.dispatchEvent(new Event('click'));\n });\n this.handlePointerBasedSelection(event);\n }\n\n private handlePointerBasedSelection(event: Event): void {\n const path = event.composedPath();\n const target = path.find((el) => {\n /* c8 ignore next 3 */\n if (!(el instanceof Element)) {\n return false;\n }\n return el.getAttribute('role') === this.childRole;\n }) as MenuItem;\n if (event.defaultPrevented) {\n const index = this.childItems.indexOf(target);\n if (target?.menuData.focusRoot === this && index > -1) {\n this.focusedItemIndex = index;\n }\n return;\n }\n if (target?.href && target.href.length) {\n // This event will NOT ALLOW CANCELATION as link action\n // cancelation should occur on the `<sp-menu-item>` itself.\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n return;\n } else if (\n target?.menuData.selectionRoot === this &&\n this.childItems.length\n ) {\n event.preventDefault();\n if (target.hasSubmenu || target.open) {\n return;\n }\n this.selectOrToggleItem(target);\n } else {\n return;\n }\n this.prepareToCleanUp();\n }\n\n public handleFocusin(event: FocusEvent): void {\n if (\n this.childItems.some(\n (childItem) => childItem.menuData.focusRoot !== this\n )\n ) {\n return;\n }\n const activeElement = (this.getRootNode() as Document).activeElement as\n | MenuItem\n | Menu;\n const selectionRoot =\n this.childItems[this.focusedItemIndex]?.menuData.selectionRoot ||\n this;\n if (activeElement !== selectionRoot || event.target !== this) {\n selectionRoot.focus({ preventScroll: true });\n if (activeElement && this.focusedItemIndex === 0) {\n const offset = this.childItems.findIndex(\n (childItem) => childItem === activeElement\n );\n this.focusMenuItemByOffset(Math.max(offset, 0));\n }\n }\n this.startListeningToKeyboard();\n }\n\n public startListeningToKeyboard(): void {\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n public handleBlur(event: FocusEvent): void {\n if (elementIsOrContains(this, event.relatedTarget as Node)) {\n return;\n }\n this.stopListeningToKeyboard();\n this.childItems.forEach((child) => (child.focused = false));\n this.removeAttribute('aria-activedescendant');\n }\n\n public stopListeningToKeyboard(): void {\n this.removeEventListener('keydown', this.handleKeydown);\n }\n\n private descendentOverlays = new Map<Overlay, Overlay>();\n\n protected handleDescendentOverlayOpened(event: Event): void {\n const target = event.composedPath()[0] as MenuItem;\n /* c8 ignore next 1 */\n if (!target.overlayElement) return;\n this.descendentOverlays.set(\n target.overlayElement,\n target.overlayElement\n );\n }\n\n protected handleDescendentOverlayClosed(event: Event): void {\n const target = event.composedPath()[0] as MenuItem;\n /* c8 ignore next 1 */\n if (!target.overlayElement) return;\n this.descendentOverlays.delete(target.overlayElement);\n }\n\n public handleSubmenuClosed = (event: Event): void => {\n event.stopPropagation();\n const target = event.composedPath()[0] as Overlay;\n target.dispatchEvent(\n new Event('sp-menu-submenu-closed', {\n bubbles: true,\n composed: true,\n })\n );\n };\n\n public handleSubmenuOpened = (event: Event): void => {\n event.stopPropagation();\n const target = event.composedPath()[0] as Overlay;\n target.dispatchEvent(\n new Event('sp-menu-submenu-opened', {\n bubbles: true,\n composed: true,\n })\n );\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n }\n const openedItem = event\n .composedPath()\n .find((el) => this.childItemSet.has(el as MenuItem));\n /* c8 ignore next 1 */\n if (!openedItem) return;\n const openedItemIndex = this.childItems.indexOf(openedItem as MenuItem);\n this.focusedItemIndex = openedItemIndex;\n this.focusInItemIndex = openedItemIndex;\n };\n\n public async selectOrToggleItem(targetItem: MenuItem): Promise<void> {\n const resolvedSelects = this.resolvedSelects;\n const oldSelectedItemsMap = new Map(this.selectedItemsMap);\n const oldSelected = this.selected.slice();\n const oldSelectedItems = this.selectedItems.slice();\n const oldValue = this.value;\n const focusedChild = this.childItems[this.focusedItemIndex];\n if (focusedChild) {\n focusedChild.focused = false;\n focusedChild.active = false;\n }\n this.focusedItemIndex = this.childItems.indexOf(targetItem);\n this.forwardFocusVisibleToItem(targetItem);\n\n if (resolvedSelects === 'multiple') {\n if (this.selectedItemsMap.has(targetItem)) {\n this.selectedItemsMap.delete(targetItem);\n } else {\n this.selectedItemsMap.set(targetItem, true);\n }\n\n // Match HTML select and set the first selected\n // item as the value. Also set the selected array\n // in the order of the menu items.\n const selected: string[] = [];\n const selectedItems: MenuItem[] = [];\n\n this.childItemSet.forEach((childItem) => {\n if (childItem.menuData.selectionRoot !== this) return;\n\n if (this.selectedItemsMap.has(childItem)) {\n selected.push(childItem.value);\n selectedItems.push(childItem);\n }\n });\n this._selected = selected;\n this.selectedItems = selectedItems;\n this.value = this.selected.join(this.valueSeparator);\n } else {\n this.selectedItemsMap.clear();\n this.selectedItemsMap.set(targetItem, true);\n this.value = targetItem.value;\n this._selected = [targetItem.value];\n this.selectedItems = [targetItem];\n }\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n cancelable: true,\n bubbles: true,\n composed: true,\n })\n );\n if (!applyDefault) {\n // Cancel the event & don't apply the selection\n this._selected = oldSelected;\n this.selectedItems = oldSelectedItems;\n this.selectedItemsMap = oldSelectedItemsMap;\n this.value = oldValue;\n return;\n }\n // Apply the selection changes to the menu items\n if (resolvedSelects === 'single') {\n for (const oldItem of oldSelectedItemsMap.keys()) {\n if (oldItem !== targetItem) {\n oldItem.selected = false;\n }\n }\n targetItem.selected = true;\n } else if (resolvedSelects === 'multiple') {\n targetItem.selected = !targetItem.selected;\n }\n }\n\n protected navigateWithinMenu(event: KeyboardEvent): void {\n const { code } = event;\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n const direction = code === 'ArrowDown' ? 1 : -1;\n const itemToFocus = this.focusMenuItemByOffset(direction);\n if (itemToFocus === lastFocusedItem) {\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n itemToFocus.scrollIntoView({ block: 'nearest' });\n }\n\n protected navigateBetweenRelatedMenus(event: KeyboardEvent): void {\n const { code } = event;\n const shouldOpenSubmenu =\n (this.isLTR && code === 'ArrowRight') ||\n (!this.isLTR && code === 'ArrowLeft');\n const shouldCloseSelfAsSubmenu =\n (this.isLTR && code === 'ArrowLeft') ||\n (!this.isLTR && code === 'ArrowRight');\n if (shouldOpenSubmenu) {\n event.stopPropagation();\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n if (lastFocusedItem?.hasSubmenu) {\n // Remove focus while opening overlay from keyboard or the visible focus\n // will slip back to the first item in the menu.\n lastFocusedItem.openOverlay();\n }\n } else if (shouldCloseSelfAsSubmenu && this.isSubmenu) {\n event.stopPropagation();\n this.dispatchEvent(new Event('close', { bubbles: true }));\n this.updateSelectedItemIndex();\n }\n }\n\n public handleKeydown(event: KeyboardEvent): void {\n if (event.defaultPrevented) {\n return;\n }\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n if (lastFocusedItem) {\n lastFocusedItem.focused = true;\n }\n const { code } = event;\n if (\n event.shiftKey &&\n event.target !== this &&\n this.hasAttribute('tabindex')\n ) {\n this.removeAttribute('tabindex');\n const replaceTabindex = (\n event: FocusEvent | KeyboardEvent\n ): void => {\n if (\n !(event as KeyboardEvent).shiftKey &&\n !this.hasAttribute('tabindex')\n ) {\n this.tabIndex = 0;\n document.removeEventListener('keyup', replaceTabindex);\n this.removeEventListener('focusout', replaceTabindex);\n }\n };\n document.addEventListener('keyup', replaceTabindex);\n this.addEventListener('focusout', replaceTabindex);\n }\n if (code === 'Tab') {\n this.prepareToCleanUp();\n return;\n }\n if (code === 'Space') {\n if (lastFocusedItem?.hasSubmenu) {\n // Remove focus while opening overlay from keyboard or the visible focus\n // will slip back to the first item in the menu.\n // this.blur();\n lastFocusedItem.openOverlay();\n return;\n }\n }\n if (code === 'Space' || code === 'Enter') {\n const childItem = this.childItems[this.focusedItemIndex];\n if (\n childItem &&\n childItem.menuData.selectionRoot === event.target\n ) {\n event.preventDefault();\n childItem.click();\n }\n return;\n }\n if (code === 'ArrowDown' || code === 'ArrowUp') {\n const childItem = this.childItems[this.focusedItemIndex];\n if (\n childItem &&\n childItem.menuData.selectionRoot === event.target\n ) {\n this.navigateWithinMenu(event);\n }\n return;\n }\n this.navigateBetweenRelatedMenus(event);\n }\n\n public focusMenuItemByOffset(offset: number): MenuItem {\n const step = offset || 1;\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n // Remain active while a submenu is opened.\n focusedItem.active = focusedItem.open;\n }\n this.focusedItemIndex =\n (this.childItems.length + this.focusedItemIndex + offset) %\n this.childItems.length;\n let itemToFocus = this.childItems[this.focusedItemIndex];\n let availableItems = this.childItems.length;\n // cycle through the available items in the directions of the offset to find the next non-disabled item\n while (itemToFocus?.disabled && availableItems) {\n availableItems -= 1;\n this.focusedItemIndex =\n (this.childItems.length + this.focusedItemIndex + step) %\n this.childItems.length;\n itemToFocus = this.childItems[this.focusedItemIndex];\n }\n // if there are no non-disabled items, skip the work to focus a child\n if (!itemToFocus?.disabled) {\n this.forwardFocusVisibleToItem(itemToFocus);\n }\n return itemToFocus;\n }\n\n private prepareToCleanUp(): void {\n document.addEventListener(\n 'focusout',\n () => {\n requestAnimationFrame(() => {\n const focusedItem = this.childItems[this.focusedItemIndex];\n if (focusedItem) {\n focusedItem.focused = false;\n this.updateSelectedItemIndex();\n }\n });\n },\n { once: true }\n );\n }\n\n private _hasUpdatedSelectedItemIndex = false;\n\n public updateSelectedItemIndex(): void {\n let firstOrFirstSelectedIndex = 0;\n const selectedItemsMap = new Map<MenuItem, boolean>();\n const selected: string[] = [];\n const selectedItems: MenuItem[] = [];\n let itemIndex = this.childItems.length;\n while (itemIndex) {\n itemIndex -= 1;\n const childItem = this.childItems[itemIndex];\n if (childItem.menuData.selectionRoot === this) {\n if (\n childItem.selected ||\n (!this._hasUpdatedSelectedItemIndex &&\n this.selected.includes(childItem.value))\n ) {\n firstOrFirstSelectedIndex = itemIndex;\n selectedItemsMap.set(childItem, true);\n selected.unshift(childItem.value);\n selectedItems.unshift(childItem);\n }\n // Remove \"focused\" from non-\"selected\" items ONLY\n // Preserve \"focused\" on index===0 when no selection\n if (itemIndex !== firstOrFirstSelectedIndex) {\n childItem.focused = false;\n }\n }\n }\n selectedItems.map((item, i) => {\n // When there is more than one \"selected\" item,\n // ensure only the first one can be \"focused\"\n if (i > 0) {\n item.focused = false;\n }\n });\n this.selectedItemsMap = selectedItemsMap;\n this._selected = selected;\n this.selectedItems = selectedItems;\n this.value = this.selected.join(this.valueSeparator);\n this.focusedItemIndex = firstOrFirstSelectedIndex;\n this.focusInItemIndex = firstOrFirstSelectedIndex;\n }\n\n private _willUpdateItems = false;\n\n private handleItemsChanged(): void {\n this.cachedChildItems = undefined;\n if (!this._willUpdateItems) {\n this._willUpdateItems = true;\n this.cacheUpdated = this.updateCache();\n }\n }\n\n private async updateCache(): Promise<void> {\n if (!this.hasUpdated) {\n await Promise.all([\n new Promise((res) => requestAnimationFrame(() => res(true))),\n this.updateComplete,\n ]);\n } else {\n await new Promise((res) => requestAnimationFrame(() => res(true)));\n }\n if (this.cachedChildItems === undefined) {\n this.updateSelectedItemIndex();\n this.updateItemFocus();\n }\n this._willUpdateItems = false;\n }\n\n private updateItemFocus(): void {\n if (this.childItems.length == 0) {\n return;\n }\n const focusInItem = this.childItems[this.focusInItemIndex];\n if (\n (this.getRootNode() as Document).activeElement ===\n focusInItem.menuData.focusRoot\n ) {\n this.forwardFocusVisibleToItem(focusInItem);\n }\n }\n\n public closeDescendentOverlays(): void {\n this.descendentOverlays.forEach((overlay) => {\n overlay.open = false;\n });\n this.descendentOverlays = new Map<Overlay, Overlay>();\n }\n\n private forwardFocusVisibleToItem(item: MenuItem): void {\n if (!item || item.menuData.focusRoot !== this) {\n return;\n }\n this.closeDescendentOverlays();\n const focused =\n this.hasVisibleFocusInTree() ||\n !!this.childItems.find((child) => {\n return child.hasVisibleFocusInTree();\n });\n item.focused = focused;\n this.setAttribute('aria-activedescendant', item.id);\n if (\n item.menuData.selectionRoot &&\n item.menuData.selectionRoot !== this\n ) {\n item.menuData.selectionRoot.focus();\n }\n }\n\n private handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n const assignedElement = target.assignedElements({\n flatten: true,\n }) as MenuItem[];\n if (this.childItems.length !== assignedElement.length) {\n assignedElement.forEach((item) => {\n if (typeof item.triggerUpdate !== 'undefined') {\n item.triggerUpdate();\n }\n });\n }\n }\n\n protected renderMenuItemSlot(): TemplateResult {\n return html`\n <slot\n @sp-menu-submenu-opened=${this.handleDescendentOverlayOpened}\n @sp-menu-submenu-closed=${this.handleDescendentOverlayClosed}\n @slotchange=${this.handleSlotchange}\n ></slot>\n `;\n }\n\n public override render(): TemplateResult {\n return this.renderMenuItemSlot();\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n if (!this.hasAttribute('tabindex') && !this.ignore) {\n const role = this.getAttribute('role');\n if (role === 'group') {\n this.tabIndex = -1;\n } else {\n this.tabIndex = 0;\n }\n }\n const updates: Promise<unknown>[] = [\n new Promise((res) => requestAnimationFrame(() => res(true))),\n ];\n [...this.children].forEach((item) => {\n if ((item as MenuItem).localName === 'sp-menu-item') {\n updates.push((item as MenuItem).updateComplete);\n }\n });\n this.childItemsUpdated = Promise.all(updates);\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('selects') && this.hasUpdated) {\n this.selectsChanged();\n }\n if (\n changes.has('label') &&\n (this.label || typeof changes.get('label') !== 'undefined')\n ) {\n if (this.label) {\n this.setAttribute('aria-label', this.label);\n /* c8 ignore next 3 */\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n protected selectsChanged(): void {\n const updates: Promise<unknown>[] = [\n new Promise((res) => requestAnimationFrame(() => res(true))),\n ];\n this.childItemSet.forEach((childItem) => {\n updates.push(childItem.triggerUpdate());\n });\n this.childItemsUpdated = Promise.all(updates);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute('role') && !this.ignore) {\n this.setAttribute('role', this.ownRole);\n }\n this.updateComplete.then(() => this.updateItemFocus());\n }\n public override disconnectedCallback(): void {\n this.cachedChildItems = undefined;\n super.disconnectedCallback();\n }\n\n protected childItemsUpdated!: Promise<unknown[]>;\n protected cacheUpdated = Promise.resolve();\n /* c8 ignore next 3 */\n protected resolveCacheUpdated = (): void => {\n return;\n };\n\n protected override async getUpdateComplete(): Promise<boolean> {\n const complete = (await super.getUpdateComplete()) as boolean;\n await this.childItemsUpdated;\n await this.cacheUpdated;\n return complete;\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,EACA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDAKP,OAAOC,MAAgB,gBAavB,SAASC,EACLC,EACAC,EACO,CACP,MAAO,CAAC,CAACA,IAAiBD,IAAOC,GAAgBD,EAAG,SAASC,CAAY,EAC7E,CAeO,aAAM,aAAaP,EAAWC,EAAiB,CAAE,cAAe,EAAK,CAAC,CAAE,CA0OpE,aAAc,CACjB,MAAM,EAjOV,KAAO,MAAQ,GAGf,KAAO,OAAS,GAMhB,KAAO,MAAQ,GAKf,KAAO,eAAiB,IA0BxB,KAAU,UAAY,CAAC,EAGvB,KAAO,cAAgB,CAAC,EAKxB,KAAQ,aAAe,IAAI,IAC3B,KAAO,iBAAmB,EAC1B,KAAO,iBAAmB,EAE1B,KAAQ,iBAAmB,IAAI,IA0N/B,KAAQ,oBAAsB,EAqG9B,KAAQ,mBAAqB,IAAI,IAmBjC,KAAO,oBAAuBO,GAAuB,CACjDA,EAAM,gBAAgB,EACPA,EAAM,aAAa,EAAE,CAAC,EAC9B,cACH,IAAI,MAAM,yBAA0B,CAChC,QAAS,GACT,SAAU,EACd,CAAC,CACL,CACJ,EAEA,KAAO,oBAAuBA,GAAuB,CACjDA,EAAM,gBAAgB,EACPA,EA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AK,aACJA,CACX,CACJ,CA11BWC,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAThC,KAUF,qBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAZjC,KAaF,sBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAfhC,KAgBF,uBAGA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,MAAO,CAAC,GAlBjB,KAmBF,qBAKA6D,EAAA,CADN7D,EAAS,CAAE,KAAM,OAAQ,UAAW,iBAAkB,CAAC,GAvB/C,KAwBF,8BAII6D,EAAA,CADV7D,EAAS,CAAE,UAAW,EAAM,CAAC,GA3BrB,KA4BE,wBAyBJ6D,EAAA,CADN7D,EAAS,CAAE,UAAW,EAAM,CAAC,GApDrB,KAqDF,6BAGA6D,EAAA,CADN5D,EAAM,kBAAkB,GAvDhB,KAwDF",
|
|
6
6
|
"names": ["html", "SizedMixin", "SpectrumElement", "property", "query", "menuStyles", "elementIsOrContains", "el", "isOrContains", "event", "focusedItem", "openedItem", "openedItemIndex", "selected", "old", "item", "slottedElements", "i", "slottedElement", "flattenedChildren", "_a", "_b", "cascadeData", "ignoreMenu", "selects", "preventScroll", "childItem", "selectedItem", "target", "index", "activeElement", "selectionRoot", "offset", "child", "targetItem", "resolvedSelects", "oldSelectedItemsMap", "oldSelected", "oldSelectedItems", "oldValue", "focusedChild", "selectedItems", "oldItem", "code", "lastFocusedItem", "direction", "itemToFocus", "shouldOpenSubmenu", "shouldCloseSelfAsSubmenu", "replaceTabindex", "step", "availableItems", "firstOrFirstSelectedIndex", "selectedItemsMap", "itemIndex", "res", "focusInItem", "overlay", "focused", "assignedElement", "changed", "updates", "changes", "complete", "__decorateClass"]
|
|
7
7
|
}
|
package/src/menu-item.css.dev.js
CHANGED
|
@@ -53,7 +53,7 @@ var(--spectrum-menu-item-focus-indicator-width)
|
|
|
53
53
|
--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)
|
|
54
54
|
)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(
|
|
55
55
|
--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)
|
|
56
|
-
)}:host{display:grid;grid-template:". chevronAreaCollapsible .
|
|
56
|
+
)}:host{display:grid;grid-template:". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . ." 1fr "selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn" ". . . . descriptionArea . . ." ". . . . submenuArea . . ."/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(
|
|
57
57
|
--highcontrast-menu-item-background-color-focus,var(
|
|
58
58
|
--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)
|
|
59
59
|
)
|
|
@@ -180,11 +180,11 @@ var(--spectrum-menu-item-focus-indicator-width)
|
|
|
180
180
|
--highcontrast-menu-item-color-focus,var(
|
|
181
181
|
--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)
|
|
182
182
|
)
|
|
183
|
-
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{
|
|
183
|
+
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{color:var(
|
|
184
184
|
--highcontrast-menu-item-color-default,var(
|
|
185
185
|
--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)
|
|
186
186
|
)
|
|
187
|
-
);
|
|
187
|
+
);font-size:var(
|
|
188
188
|
--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)
|
|
189
189
|
);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(
|
|
190
190
|
--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-item.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.spectrum-Menu-back.focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-backButton.focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backButton:focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n)}.checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);align-self:center;color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);display:var(\n--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display)\n);opacity:1}:host{align-items:center;background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n);box-sizing:border-box;cursor:pointer;line-height:var(\n--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height)\n);margin:0;min-block-size:var(\n--mod-menu-item-min-height,var(--spectrum-menu-item-min-height)\n);padding-block-end:var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n);padding-block-start:var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n);padding-inline:var(\n--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content)\n);position:relative;-webkit-text-decoration:none;text-decoration:none}.spectrum-Menu-itemCheckbox{--mod-checkbox-top-to-text:0;--mod-checkbox-text-to-control:0;min-block-size:0}.spectrum-Menu-itemCheckbox .spectrum-Checkbox-box{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox)\n);margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)\n)}:host{display:grid;grid-template:\". chevronAreaCollapsible . iconArea sectionHeadingArea . . .\" 1fr \"selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn\" \". . . . descriptionArea . . .\" \". . . . submenuArea . . .\"/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)\n)\n);outline:none}:host(:focus)>#label,:host([focused])>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)\n)\n)}:host(:focus)>[name=description]::slotted(*),:host([focused])>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)\n)\n)}:host(:focus)>::slotted([slot=value]),:host([focused])>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)\n)\n)}:host(:focus)>.icon:not(.chevron,.checkmark),:host([focused])>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n)}:host(:focus)>.chevron,:host([focused])>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:focus)>.checkmark,:host([focused])>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n)}:host([focused]),:host([focused]) .spectrum-Menu-back{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:hover){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host(:hover)>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)\n)\n)}:host(:hover)>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)\n)\n)}:host(:hover)>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)\n)\n)}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host(:hover)>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:hover)>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host:active{background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)\n)\n)}:host:active>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)\n)\n)}:host:active>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)\n)\n)}:host:active>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)\n)\n)}:host:active>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n)}:host:active>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host:active>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{align-items:flex-start;color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)\n)\n);display:flex;font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}.chevron{align-self:center;block-size:var(--spectrum-menu-item-checkmark-height);grid-area:chevronArea;inline-size:var(--spectrum-menu-item-checkmark-width)}.spectrum-Menu-item--collapsible .chevron{grid-area:chevronAreaCollapsible}[name=description]::slotted(*){grid-area:descriptionArea}:host([has-submenu]) .chevron{grid-area:chevronAreaDrillIn}.icon:not(.chevron,.checkmark){block-size:var(\n--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height)\n);inline-size:var(\n--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width)\n)}.checkmark{block-size:var(\n--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height)\n);inline-size:var(\n--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width)\n);margin-block-start:calc(var(\n--mod-menu-item-top-to-checkmark,\nvar(--spectrum-menu-item-top-to-checkmark)\n) - var(\n--mod-menu-item-top-edge-to-text,\nvar(--spectrum-menu-item-top-edge-to-text)\n));margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}::slotted([slot=icon]){margin-inline-end:var(\n--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual)\n)}.chevron{margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)\n)\n);font-size:var(\n--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size)\n);hyphens:auto;line-height:var(\n--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height)\n);margin-block-start:var(\n--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing)\n);overflow-wrap:break-word}::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n);place-self:start end}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}.spectrum-Menu-item--collapsible.is-open:active,.spectrum-Menu-item--collapsible.is-open:focus,.spectrum-Menu-item--collapsible.is-open:hover,:host([focused]) .spectrum-Menu-item--collapsible.is-open{background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n)}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-end:var(\n--mod-menu-section-header-bottom-edge-to-text,var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n)\n);padding-block-start:var(\n--mod-menu-section-header-top-edge-to-text,var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n)\n)}:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);margin-inline-end:0;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(\n--highcontrast-menu-item-selected-background-color,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host([has-submenu]:hover) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]:focus) .chevron,:host([has-submenu][focused]) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n)}:host([has-submenu]):active .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n)}:host([aria-disabled=true]),:host([disabled]){background-color:#0000}:host([aria-disabled=true]) #label,:host([disabled]) #label{color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)\n)\n)}:host([aria-disabled=true]) [name=description]::slotted(*),:host([disabled]) [name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)\n)\n)}:host([aria-disabled=true]) ::slotted([slot=icon]),:host([disabled]) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}:host([aria-disabled=true]:hover),:host([disabled]:hover){cursor:default}:host([aria-disabled=true]:hover) ::slotted([slot=icon]),:host([disabled]:hover) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}.spectrum-Menu-back{align-items:center;display:flex;flex-flow:wrap;padding-block:var(--mod-menu-back-padding-block-start,0) var(--mod-menu-back-padding-block-end,0);padding-inline:var(--mod-menu-back-padding-inline-start,0) var(\n--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content)\n)}.spectrum-Menu-backButton{background:none;border:0;cursor:pointer;display:inline-flex;margin:0;padding:0}:host([focused]) .spectrum-Menu-backButton{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backHeading{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)\n)\n);display:block;font-size:var(\n--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size)\n);font-weight:var(\n--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight)\n);line-height:var(\n--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height)\n)}.spectrum-Menu-backIcon{fill:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);color:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);margin-block:var(\n--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin)\n);margin-inline:var(\n--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin)\n)}#label{flex:1 1 auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}::slotted([slot=submenu]){max-width:100%;width:max-content}:host([no-wrap]) #label{display:block}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.spectrum-Menu-back.focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-backButton.focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backButton:focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n)}.checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);align-self:center;color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);display:var(\n--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display)\n);opacity:1}:host{align-items:center;background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n);box-sizing:border-box;cursor:pointer;line-height:var(\n--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height)\n);margin:0;min-block-size:var(\n--mod-menu-item-min-height,var(--spectrum-menu-item-min-height)\n);padding-block-end:var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n);padding-block-start:var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n);padding-inline:var(\n--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content)\n);position:relative;-webkit-text-decoration:none;text-decoration:none}.spectrum-Menu-itemCheckbox{--mod-checkbox-top-to-text:0;--mod-checkbox-text-to-control:0;min-block-size:0}.spectrum-Menu-itemCheckbox .spectrum-Checkbox-box{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox)\n);margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)\n)}:host{display:grid;grid-template:\". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . .\" 1fr \"selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn\" \". . . . descriptionArea . . .\" \". . . . submenuArea . . .\"/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)\n)\n);outline:none}:host(:focus)>#label,:host([focused])>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)\n)\n)}:host(:focus)>[name=description]::slotted(*),:host([focused])>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)\n)\n)}:host(:focus)>::slotted([slot=value]),:host([focused])>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)\n)\n)}:host(:focus)>.icon:not(.chevron,.checkmark),:host([focused])>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n)}:host(:focus)>.chevron,:host([focused])>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:focus)>.checkmark,:host([focused])>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n)}:host([focused]),:host([focused]) .spectrum-Menu-back{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:hover){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host(:hover)>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)\n)\n)}:host(:hover)>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)\n)\n)}:host(:hover)>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)\n)\n)}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host(:hover)>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:hover)>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host:active{background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)\n)\n)}:host:active>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)\n)\n)}:host:active>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)\n)\n)}:host:active>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)\n)\n)}:host:active>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n)}:host:active>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host:active>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}.chevron{align-self:center;block-size:var(--spectrum-menu-item-checkmark-height);grid-area:chevronArea;inline-size:var(--spectrum-menu-item-checkmark-width)}.spectrum-Menu-item--collapsible .chevron{grid-area:chevronAreaCollapsible}[name=description]::slotted(*){grid-area:descriptionArea}:host([has-submenu]) .chevron{grid-area:chevronAreaDrillIn}.icon:not(.chevron,.checkmark){block-size:var(\n--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height)\n);inline-size:var(\n--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width)\n)}.checkmark{block-size:var(\n--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height)\n);inline-size:var(\n--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width)\n);margin-block-start:calc(var(\n--mod-menu-item-top-to-checkmark,\nvar(--spectrum-menu-item-top-to-checkmark)\n) - var(\n--mod-menu-item-top-edge-to-text,\nvar(--spectrum-menu-item-top-edge-to-text)\n));margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}::slotted([slot=icon]){margin-inline-end:var(\n--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual)\n)}.chevron{margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)\n)\n);font-size:var(\n--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size)\n);hyphens:auto;line-height:var(\n--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height)\n);margin-block-start:var(\n--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing)\n);overflow-wrap:break-word}::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n);place-self:start end}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}.spectrum-Menu-item--collapsible.is-open:active,.spectrum-Menu-item--collapsible.is-open:focus,.spectrum-Menu-item--collapsible.is-open:hover,:host([focused]) .spectrum-Menu-item--collapsible.is-open{background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n)}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-end:var(\n--mod-menu-section-header-bottom-edge-to-text,var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n)\n);padding-block-start:var(\n--mod-menu-section-header-top-edge-to-text,var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n)\n)}:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);margin-inline-end:0;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(\n--highcontrast-menu-item-selected-background-color,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host([has-submenu]:hover) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]:focus) .chevron,:host([has-submenu][focused]) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n)}:host([has-submenu]):active .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n)}:host([aria-disabled=true]),:host([disabled]){background-color:#0000}:host([aria-disabled=true]) #label,:host([disabled]) #label{color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)\n)\n)}:host([aria-disabled=true]) [name=description]::slotted(*),:host([disabled]) [name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)\n)\n)}:host([aria-disabled=true]) ::slotted([slot=icon]),:host([disabled]) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}:host([aria-disabled=true]:hover),:host([disabled]:hover){cursor:default}:host([aria-disabled=true]:hover) ::slotted([slot=icon]),:host([disabled]:hover) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}.spectrum-Menu-back{align-items:center;display:flex;flex-flow:wrap;padding-block:var(--mod-menu-back-padding-block-start,0) var(--mod-menu-back-padding-block-end,0);padding-inline:var(--mod-menu-back-padding-inline-start,0) var(\n--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content)\n)}.spectrum-Menu-backButton{background:none;border:0;cursor:pointer;display:inline-flex;margin:0;padding:0}:host([focused]) .spectrum-Menu-backButton{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backHeading{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)\n)\n);display:block;font-size:var(\n--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size)\n);font-weight:var(\n--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight)\n);line-height:var(\n--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height)\n)}.spectrum-Menu-backIcon{fill:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);color:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);margin-block:var(\n--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin)\n);margin-inline:var(\n--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin)\n)}#label{flex:1 1 auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}::slotted([slot=submenu]){max-width:100%;width:max-content}:host([no-wrap]) #label{display:block}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";import{css as
|
|
1
|
+
"use strict";import{css as e}from"@spectrum-web-components/base";const o=e`
|
|
2
2
|
.spectrum-Menu-back.focus-visible{box-shadow:inset calc(var(
|
|
3
3
|
--mod-menu-item-focus-indicator-width,
|
|
4
4
|
var(--spectrum-menu-item-focus-indicator-width)
|
|
@@ -51,7 +51,7 @@ var(--spectrum-menu-item-focus-indicator-width)
|
|
|
51
51
|
--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)
|
|
52
52
|
)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(
|
|
53
53
|
--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)
|
|
54
|
-
)}:host{display:grid;grid-template:". chevronAreaCollapsible .
|
|
54
|
+
)}:host{display:grid;grid-template:". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . ." 1fr "selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn" ". . . . descriptionArea . . ." ". . . . submenuArea . . ."/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(
|
|
55
55
|
--highcontrast-menu-item-background-color-focus,var(
|
|
56
56
|
--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)
|
|
57
57
|
)
|
|
@@ -178,11 +178,11 @@ var(--spectrum-menu-item-focus-indicator-width)
|
|
|
178
178
|
--highcontrast-menu-item-color-focus,var(
|
|
179
179
|
--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)
|
|
180
180
|
)
|
|
181
|
-
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{
|
|
181
|
+
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{color:var(
|
|
182
182
|
--highcontrast-menu-item-color-default,var(
|
|
183
183
|
--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)
|
|
184
184
|
)
|
|
185
|
-
);
|
|
185
|
+
);font-size:var(
|
|
186
186
|
--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)
|
|
187
187
|
);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(
|
|
188
188
|
--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)
|
|
@@ -343,5 +343,5 @@ var(--spectrum-menu-item-top-edge-to-text)
|
|
|
343
343
|
);margin-inline:var(
|
|
344
344
|
--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin)
|
|
345
345
|
)}#label{flex:1 1 auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}::slotted([slot=submenu]){max-width:100%;width:max-content}:host([no-wrap]) #label{display:block}
|
|
346
|
-
`;export default
|
|
346
|
+
`;export default o;
|
|
347
347
|
//# sourceMappingURL=menu-item.css.js.map
|
package/src/menu-item.css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-item.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.spectrum-Menu-back.focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-backButton.focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backButton:focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n)}.checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);align-self:center;color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);display:var(\n--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display)\n);opacity:1}:host{align-items:center;background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n);box-sizing:border-box;cursor:pointer;line-height:var(\n--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height)\n);margin:0;min-block-size:var(\n--mod-menu-item-min-height,var(--spectrum-menu-item-min-height)\n);padding-block-end:var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n);padding-block-start:var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n);padding-inline:var(\n--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content)\n);position:relative;-webkit-text-decoration:none;text-decoration:none}.spectrum-Menu-itemCheckbox{--mod-checkbox-top-to-text:0;--mod-checkbox-text-to-control:0;min-block-size:0}.spectrum-Menu-itemCheckbox .spectrum-Checkbox-box{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox)\n);margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)\n)}:host{display:grid;grid-template:\". chevronAreaCollapsible . iconArea sectionHeadingArea . . .\" 1fr \"selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn\" \". . . . descriptionArea . . .\" \". . . . submenuArea . . .\"/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)\n)\n);outline:none}:host(:focus)>#label,:host([focused])>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)\n)\n)}:host(:focus)>[name=description]::slotted(*),:host([focused])>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)\n)\n)}:host(:focus)>::slotted([slot=value]),:host([focused])>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)\n)\n)}:host(:focus)>.icon:not(.chevron,.checkmark),:host([focused])>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n)}:host(:focus)>.chevron,:host([focused])>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:focus)>.checkmark,:host([focused])>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n)}:host([focused]),:host([focused]) .spectrum-Menu-back{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:hover){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host(:hover)>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)\n)\n)}:host(:hover)>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)\n)\n)}:host(:hover)>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)\n)\n)}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host(:hover)>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:hover)>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host:active{background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)\n)\n)}:host:active>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)\n)\n)}:host:active>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)\n)\n)}:host:active>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)\n)\n)}:host:active>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n)}:host:active>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host:active>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{align-items:flex-start;color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)\n)\n);display:flex;font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}.chevron{align-self:center;block-size:var(--spectrum-menu-item-checkmark-height);grid-area:chevronArea;inline-size:var(--spectrum-menu-item-checkmark-width)}.spectrum-Menu-item--collapsible .chevron{grid-area:chevronAreaCollapsible}[name=description]::slotted(*){grid-area:descriptionArea}:host([has-submenu]) .chevron{grid-area:chevronAreaDrillIn}.icon:not(.chevron,.checkmark){block-size:var(\n--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height)\n);inline-size:var(\n--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width)\n)}.checkmark{block-size:var(\n--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height)\n);inline-size:var(\n--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width)\n);margin-block-start:calc(var(\n--mod-menu-item-top-to-checkmark,\nvar(--spectrum-menu-item-top-to-checkmark)\n) - var(\n--mod-menu-item-top-edge-to-text,\nvar(--spectrum-menu-item-top-edge-to-text)\n));margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}::slotted([slot=icon]){margin-inline-end:var(\n--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual)\n)}.chevron{margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)\n)\n);font-size:var(\n--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size)\n);hyphens:auto;line-height:var(\n--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height)\n);margin-block-start:var(\n--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing)\n);overflow-wrap:break-word}::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n);place-self:start end}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}.spectrum-Menu-item--collapsible.is-open:active,.spectrum-Menu-item--collapsible.is-open:focus,.spectrum-Menu-item--collapsible.is-open:hover,:host([focused]) .spectrum-Menu-item--collapsible.is-open{background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n)}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-end:var(\n--mod-menu-section-header-bottom-edge-to-text,var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n)\n);padding-block-start:var(\n--mod-menu-section-header-top-edge-to-text,var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n)\n)}:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);margin-inline-end:0;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(\n--highcontrast-menu-item-selected-background-color,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host([has-submenu]:hover) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]:focus) .chevron,:host([has-submenu][focused]) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n)}:host([has-submenu]):active .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n)}:host([aria-disabled=true]),:host([disabled]){background-color:#0000}:host([aria-disabled=true]) #label,:host([disabled]) #label{color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)\n)\n)}:host([aria-disabled=true]) [name=description]::slotted(*),:host([disabled]) [name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)\n)\n)}:host([aria-disabled=true]) ::slotted([slot=icon]),:host([disabled]) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}:host([aria-disabled=true]:hover),:host([disabled]:hover){cursor:default}:host([aria-disabled=true]:hover) ::slotted([slot=icon]),:host([disabled]:hover) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}.spectrum-Menu-back{align-items:center;display:flex;flex-flow:wrap;padding-block:var(--mod-menu-back-padding-block-start,0) var(--mod-menu-back-padding-block-end,0);padding-inline:var(--mod-menu-back-padding-inline-start,0) var(\n--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content)\n)}.spectrum-Menu-backButton{background:none;border:0;cursor:pointer;display:inline-flex;margin:0;padding:0}:host([focused]) .spectrum-Menu-backButton{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backHeading{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)\n)\n);display:block;font-size:var(\n--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size)\n);font-weight:var(\n--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight)\n);line-height:var(\n--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height)\n)}.spectrum-Menu-backIcon{fill:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);color:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);margin-block:var(\n--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin)\n);margin-inline:var(\n--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin)\n)}#label{flex:1 1 auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}::slotted([slot=submenu]){max-width:100%;width:max-content}:host([no-wrap]) #label{display:block}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n.spectrum-Menu-back.focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}.spectrum-Menu-backButton.focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backButton:focus-visible{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)\n)\n)}.checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);align-self:center;color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)\n)\n);display:var(\n--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display)\n);opacity:1}:host{align-items:center;background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n);box-sizing:border-box;cursor:pointer;line-height:var(\n--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height)\n);margin:0;min-block-size:var(\n--mod-menu-item-min-height,var(--spectrum-menu-item-min-height)\n);padding-block-end:var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n);padding-block-start:var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n);padding-inline:var(\n--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content)\n);position:relative;-webkit-text-decoration:none;text-decoration:none}.spectrum-Menu-itemCheckbox{--mod-checkbox-top-to-text:0;--mod-checkbox-text-to-control:0;min-block-size:0}.spectrum-Menu-itemCheckbox .spectrum-Checkbox-box{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox)\n);margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(\n--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)\n)}:host{display:grid;grid-template:\". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . .\" 1fr \"selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn\" \". . . . descriptionArea . . .\" \". . . . submenuArea . . .\"/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)\n)\n);outline:none}:host(:focus)>#label,:host([focused])>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)\n)\n)}:host(:focus)>[name=description]::slotted(*),:host([focused])>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)\n)\n)}:host(:focus)>::slotted([slot=value]),:host([focused])>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)\n)\n)}:host(:focus)>.icon:not(.chevron,.checkmark),:host([focused])>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)\n)\n)}:host(:focus)>.chevron,:host([focused])>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:focus)>.checkmark,:host([focused])>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)\n)\n)}:host([focused]),:host([focused]) .spectrum-Menu-back{box-shadow:inset calc(var(\n--mod-menu-item-focus-indicator-width,\nvar(--spectrum-menu-item-focus-indicator-width)\n)*var(--spectrum-menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(\n--highcontrast-menu-item-focus-indicator-color,var(\n--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)\n)\n)}:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:hover){background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host(:hover)>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)\n)\n)}:host(:hover)>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)\n)\n)}:host(:hover)>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)\n)\n)}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host(:hover)>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host(:hover)>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host:active{background-color:var(\n--highcontrast-menu-item-background-color-focus,var(\n--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)\n)\n)}:host:active>#label{color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)\n)\n)}:host:active>[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)\n)\n)}:host:active>::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)\n)\n)}:host:active>.icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)\n)\n)}:host:active>.chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)\n)\n)}:host:active>.checkmark{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)\n)\n)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}.chevron{align-self:center;block-size:var(--spectrum-menu-item-checkmark-height);grid-area:chevronArea;inline-size:var(--spectrum-menu-item-checkmark-width)}.spectrum-Menu-item--collapsible .chevron{grid-area:chevronAreaCollapsible}[name=description]::slotted(*){grid-area:descriptionArea}:host([has-submenu]) .chevron{grid-area:chevronAreaDrillIn}.icon:not(.chevron,.checkmark){block-size:var(\n--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height)\n);inline-size:var(\n--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width)\n)}.checkmark{block-size:var(\n--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height)\n);inline-size:var(\n--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width)\n);margin-block-start:calc(var(\n--mod-menu-item-top-to-checkmark,\nvar(--spectrum-menu-item-top-to-checkmark)\n) - var(\n--mod-menu-item-top-edge-to-text,\nvar(--spectrum-menu-item-top-edge-to-text)\n));margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}::slotted([slot=icon]){margin-inline-end:var(\n--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual)\n)}.chevron{margin-inline-end:var(\n--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)\n)}[name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)\n)\n);font-size:var(\n--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size)\n);hyphens:auto;line-height:var(\n--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height)\n);margin-block-start:var(\n--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing)\n);overflow-wrap:break-word}::slotted([slot=value]){color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)\n)\n);font-size:var(\n--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)\n);margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n);place-self:start end}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}.spectrum-Menu-item--collapsible.is-open:active,.spectrum-Menu-item--collapsible.is-open:focus,.spectrum-Menu-item--collapsible.is-open:hover,:host([focused]) .spectrum-Menu-item--collapsible.is-open{background-color:var(\n--highcontrast-menu-item-background-color-default,var(\n--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)\n)\n)}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-end:var(\n--mod-menu-section-header-bottom-edge-to-text,var(\n--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)\n)\n);padding-block-start:var(\n--mod-menu-section-header-top-edge-to-text,var(\n--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)\n)\n)}:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)\n)\n);margin-inline-end:0;margin-inline-start:var(\n--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)\n)}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(\n--highcontrast-menu-item-selected-background-color,var(\n--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)\n)\n)}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]) .is-open .checkmark{fill:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-checkmark-icon-color-default,var(\n--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)\n)\n)}:host([has-submenu]:hover) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)\n)\n)}:host([has-submenu]:focus) .chevron,:host([has-submenu][focused]) .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)\n)\n)}:host([has-submenu]):active .chevron{fill:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n);color:var(\n--highcontrast-menu-item-color-focus,var(\n--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)\n)\n)}:host([aria-disabled=true]),:host([disabled]){background-color:#0000}:host([aria-disabled=true]) #label,:host([disabled]) #label{color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)\n)\n)}:host([aria-disabled=true]) [name=description]::slotted(*),:host([disabled]) [name=description]::slotted(*){color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)\n)\n)}:host([aria-disabled=true]) ::slotted([slot=icon]),:host([disabled]) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}:host([aria-disabled=true]:hover),:host([disabled]:hover){cursor:default}:host([aria-disabled=true]:hover) ::slotted([slot=icon]),:host([disabled]:hover) ::slotted([slot=icon]){fill:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n);color:var(\n--highcontrast-menu-item-color-disabled,var(\n--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)\n)\n)}.spectrum-Menu-back{align-items:center;display:flex;flex-flow:wrap;padding-block:var(--mod-menu-back-padding-block-start,0) var(--mod-menu-back-padding-block-end,0);padding-inline:var(--mod-menu-back-padding-inline-start,0) var(\n--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content)\n)}.spectrum-Menu-backButton{background:none;border:0;cursor:pointer;display:inline-flex;margin:0;padding:0}:host([focused]) .spectrum-Menu-backButton{outline:var(--spectrum-focus-indicator-thickness) solid var(--spectrum-focus-indicator-color);outline-offset:calc((var(--spectrum-focus-indicator-thickness) + 1px)*-1)}.spectrum-Menu-backHeading{color:var(\n--highcontrast-menu-item-color-default,var(\n--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)\n)\n);display:block;font-size:var(\n--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size)\n);font-weight:var(\n--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight)\n);line-height:var(\n--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height)\n)}.spectrum-Menu-backIcon{fill:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);color:var(\n--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default)\n);margin-block:var(\n--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin)\n);margin-inline:var(\n--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin)\n)}#label{flex:1 1 auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors:active){:host{forced-color-adjust:none}}::slotted([slot=submenu]){max-width:100%;width:max-content}:host([no-wrap]) #label{display:block}\n`;\nexport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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0Vf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/src/spectrum-config.js
CHANGED
|
@@ -159,6 +159,29 @@ const config = {
|
|
|
159
159
|
},
|
|
160
160
|
],
|
|
161
161
|
},
|
|
162
|
+
{
|
|
163
|
+
find: [builder.class('spectrum-Menu-itemLabel--truncate')],
|
|
164
|
+
replace: [
|
|
165
|
+
{
|
|
166
|
+
replace: {
|
|
167
|
+
type: 'pseudo-class',
|
|
168
|
+
kind: 'host',
|
|
169
|
+
selectors: [
|
|
170
|
+
{
|
|
171
|
+
type: 'attribute',
|
|
172
|
+
name: 'no-wrap',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
replace: builder.combinator(' '),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
replace: builder.id('label'),
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
},
|
|
162
185
|
{
|
|
163
186
|
collapseSelector: true,
|
|
164
187
|
find: {
|
|
@@ -39,7 +39,7 @@ const styles = css`
|
|
|
39
39
|
--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control)
|
|
40
40
|
)}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-end:0;margin-block-start:var(
|
|
41
41
|
--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action)
|
|
42
|
-
)}:host{display:grid;grid-template:". chevronAreaCollapsible .
|
|
42
|
+
)}:host{display:grid;grid-template:". chevronAreaCollapsible . headingIconArea sectionHeadingArea . . ." 1fr "selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn" ". . . . descriptionArea . . ." ". . . . submenuArea . . ."/auto auto auto auto 1fr auto auto auto}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host(:focus),:host([focused]){background-color:var(
|
|
43
43
|
--highcontrast-menu-item-background-color-focus,var(
|
|
44
44
|
--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)
|
|
45
45
|
)
|
|
@@ -166,11 +166,11 @@ var(--spectrum-menu-item-focus-indicator-width)
|
|
|
166
166
|
--highcontrast-menu-item-color-focus,var(
|
|
167
167
|
--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)
|
|
168
168
|
)
|
|
169
|
-
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{
|
|
169
|
+
)}::slotted([slot=icon]){align-self:start;grid-area:iconArea}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:iconArea}.checkmark{align-self:start;grid-area:checkmarkArea}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{color:var(
|
|
170
170
|
--highcontrast-menu-item-color-default,var(
|
|
171
171
|
--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)
|
|
172
172
|
)
|
|
173
|
-
);
|
|
173
|
+
);font-size:var(
|
|
174
174
|
--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size)
|
|
175
175
|
);grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{align-self:start;grid-area:actionsArea;margin-inline-start:var(
|
|
176
176
|
--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing)
|