@spectrum-web-components/menu 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/custom-elements.json +4 -10
- package/package.json +12 -12
- package/src/Menu.d.ts +1 -1
- package/src/Menu.dev.js +9 -9
- package/src/Menu.dev.js.map +2 -2
- package/src/Menu.js +2 -2
- package/src/Menu.js.map +2 -2
- package/src/menu-divider.css.dev.js +1 -1
- package/src/menu-divider.css.dev.js.map +1 -1
- package/src/menu-divider.css.js +1 -1
- package/src/menu-divider.css.js.map +1 -1
- package/src/menu-group.css.dev.js +1 -1
- package/src/menu-group.css.dev.js.map +1 -1
- package/src/menu-group.css.js +1 -1
- package/src/menu-group.css.js.map +1 -1
- package/src/menu-item.css.dev.js +1 -1
- package/src/menu-item.css.dev.js.map +1 -1
- package/src/menu-item.css.js +1 -1
- package/src/menu-item.css.js.map +1 -1
- package/src/menu.css.dev.js +1 -1
- package/src/menu.css.dev.js.map +1 -1
- package/src/menu.css.js +1 -1
- package/src/menu.css.js.map +1 -1
- package/src/spectrum-checkmark.css.dev.js +1 -1
- package/src/spectrum-checkmark.css.dev.js.map +1 -1
- package/src/spectrum-checkmark.css.js +1 -1
- package/src/spectrum-checkmark.css.js.map +1 -1
- package/src/spectrum-chevron.css.dev.js +1 -1
- package/src/spectrum-chevron.css.dev.js.map +1 -1
- package/src/spectrum-chevron.css.js +1 -1
- package/src/spectrum-chevron.css.js.map +1 -1
- package/src/spectrum-menu-divider.css.dev.js +1 -1
- package/src/spectrum-menu-divider.css.dev.js.map +1 -1
- package/src/spectrum-menu-divider.css.js +1 -1
- package/src/spectrum-menu-divider.css.js.map +1 -1
- package/src/spectrum-menu-item.css.dev.js +1 -1
- 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/src/spectrum-menu-sectionHeading.css.dev.js +1 -1
- package/src/spectrum-menu-sectionHeading.css.dev.js.map +1 -1
- package/src/spectrum-menu-sectionHeading.css.js +1 -1
- package/src/spectrum-menu-sectionHeading.css.js.map +1 -1
- package/src/spectrum-menu.css.dev.js +1 -1
- package/src/spectrum-menu.css.dev.js.map +1 -1
- package/src/spectrum-menu.css.js +1 -1
- package/src/spectrum-menu.css.js.map +1 -1
- package/test/menu.test.js +62 -0
- package/test/menu.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 if (this !== item.menuData.selectionRoot) {\n return;\n }\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<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 this.willSynthesizeClick = 0;\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 this.willSynthesizeClick = 0;\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 { key } = event;\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n const direction = key === '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 { key } = event;\n event.stopPropagation();\n const shouldOpenSubmenu =\n (this.isLTR && key === 'ArrowRight') ||\n (!this.isLTR && key === 'ArrowLeft');\n const shouldCloseSelfAsSubmenu =\n (this.isLTR && key === 'ArrowLeft') ||\n (!this.isLTR && key === 'ArrowRight');\n if (shouldOpenSubmenu) {\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 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 { key } = 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 (key === 'Tab') {\n this.prepareToCleanUp();\n return;\n }\n if (key === ' ') {\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 (key === ' ' || key === '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 (key === 'ArrowDown' || key === '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 assignedElements = target.assignedElements({\n flatten: true,\n }) as MenuItem[];\n if (this.childItems.length !== assignedElements.length) {\n assignedElements.forEach((item) => {\n if (typeof item.triggerUpdate !== 'undefined') {\n item.triggerUpdate();\n } else if (\n typeof (item as unknown as Menu).childItems !== 'undefined'\n ) {\n (item as unknown as Menu).childItems.forEach((child) => {\n child.triggerUpdate();\n });\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\n public override disconnectedCallback(): void {\n this.cachedChildItems = undefined;\n this.selectedItems = [];\n this.selectedItemsMap.clear();\n this.childItemSet.clear();\n this.descendentOverlays = new Map<Overlay, Overlay>();\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,CA6OpE,aAAc,CACjB,MAAM,EApOV,KAAO,MAAQ,GAGf,KAAO,OAAS,GAMhB,KAAO,MAAQ,GAKf,KAAO,eAAiB,IA6BxB,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,EAuG9B,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,EAAM,aAAa,EAAE,CAAC,EAC9B,cACH,IAAI,MAAM,yBAA0B,CAChC,QAAS,GACT,SAAU,EACd,CAAC,CACL,EACA,MAAMC,EAAc,KAAK,WAAW,KAAK,gBAAgB,EACrDA,IACAA,EAAY,QAAU,IAE1B,MAAMC,EAAaF,EACd,aAAa,EACb,KAAMF,GAAO,KAAK,aAAa,IAAIA,CAAc,CAAC,EAEvD,GAAI,CAACI,EAAY,OACjB,MAAMC,EAAkB,KAAK,WAAW,QAAQD,CAAsB,EACt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M,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,wBA4BJ6D,EAAA,CADN7D,EAAS,CAAE,UAAW,EAAM,CAAC,GAvDrB,KAwDF,6BAGA6D,EAAA,CADN5D,EAAM,kBAAkB,GA1DhB,KA2DF",
|
|
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 if (this !== item.menuData.selectionRoot) {\n return;\n }\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<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 // if the click and pointerup events are on the same target, we should not\n // handle the click event.\n private pointerUpTarget = null as EventTarget | null;\n\n private handleClick(event: Event): void {\n if (this.pointerUpTarget === event.target) {\n this.pointerUpTarget = null;\n return;\n }\n this.handlePointerBasedSelection(event);\n }\n\n private handlePointerup(event: Event): void {\n this.pointerUpTarget = event.target;\n this.handlePointerBasedSelection(event);\n }\n\n private handlePointerBasedSelection(event: Event): void {\n // Only handle left clicks\n if (event instanceof MouseEvent && event.button !== 0) {\n return;\n }\n\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 { key } = event;\n const lastFocusedItem = this.childItems[this.focusedItemIndex];\n const direction = key === '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 { key } = event;\n event.stopPropagation();\n const shouldOpenSubmenu =\n (this.isLTR && key === 'ArrowRight') ||\n (!this.isLTR && key === 'ArrowLeft');\n const shouldCloseSelfAsSubmenu =\n (this.isLTR && key === 'ArrowLeft') ||\n (!this.isLTR && key === 'ArrowRight');\n if (shouldOpenSubmenu) {\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 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 { key } = 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 (key === 'Tab') {\n this.prepareToCleanUp();\n return;\n }\n if (key === ' ') {\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 (key === ' ' || key === '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 (key === 'ArrowDown' || key === '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 assignedElements = target.assignedElements({\n flatten: true,\n }) as MenuItem[];\n if (this.childItems.length !== assignedElements.length) {\n assignedElements.forEach((item) => {\n if (typeof item.triggerUpdate !== 'undefined') {\n item.triggerUpdate();\n } else if (\n typeof (item as unknown as Menu).childItems !== 'undefined'\n ) {\n (item as unknown as Menu).childItems.forEach((child) => {\n child.triggerUpdate();\n });\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\n public override disconnectedCallback(): void {\n this.cachedChildItems = undefined;\n this.selectedItems = [];\n this.selectedItemsMap.clear();\n this.childItemSet.clear();\n this.descendentOverlays = new Map<Overlay, Overlay>();\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,CA6OpE,aAAc,CACjB,MAAM,EApOV,KAAO,MAAQ,GAGf,KAAO,OAAS,GAMhB,KAAO,MAAQ,GAKf,KAAO,eAAiB,IA6BxB,KAAU,UAAY,CAAC,EAGvB,KAAO,cAAgB,CAAC,EAKxB,KAAQ,aAAe,IAAI,IAC3B,KAAO,iBAAmB,EAC1B,KAAO,iBAAmB,EAE1B,KAAQ,iBAAmB,IAAI,IA4N/B,KAAQ,gBAAkB,KAwG1B,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,EAAM,aAAa,EAAE,CAAC,EAC9B,cACH,IAAI,MAAM,yBAA0B,CAChC,QAAS,GACT,SAAU,EACd,CAAC,CACL,EACA,MAAMC,EAAc,KAAK,WAAW,KAAK,gBAAgB,EACrDA,IACAA,EAAY,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,kBACX,MAAM,KAAK,aACJA,CACX,CACJ,CA52BWC,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,wBA4BJ6D,EAAA,CADN7D,EAAS,CAAE,UAAW,EAAM,CAAC,GAvDrB,KAwDF,6BAGA6D,EAAA,CADN5D,EAAM,kBAAkB,GA1DhB,KA2DF",
|
|
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", "key", "lastFocusedItem", "direction", "itemToFocus", "shouldOpenSubmenu", "shouldCloseSelfAsSubmenu", "replaceTabindex", "step", "availableItems", "firstOrFirstSelectedIndex", "selectedItemsMap", "itemIndex", "res", "focusInItem", "overlay", "focused", "assignedElements", "changed", "updates", "changes", "complete", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
:host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));
|
|
4
|
+
:host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);inline-size:auto;margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));overflow:visible}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-shrink:0;display:block}
|
|
5
5
|
`;
|
|
6
6
|
export default styles;
|
|
7
7
|
//# sourceMappingURL=menu-divider.css.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-divider.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 :host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));
|
|
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 :host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);inline-size:auto;margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));overflow:visible}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-shrink:0;display:block}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/menu-divider.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";import{css as e}from"@spectrum-web-components/base";const i=e`
|
|
2
|
-
:host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));
|
|
2
|
+
:host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);inline-size:auto;margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));overflow:visible}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-shrink:0;display:block}
|
|
3
3
|
`;export default i;
|
|
4
4
|
//# sourceMappingURL=menu-divider.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-divider.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 :host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));
|
|
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 :host{--spectrum-menu-divider-thickness:var(--spectrum-divider-thickness-medium);inline-size:auto;margin-block:var(--mod-menu-section-divider-margin-block,max(0px,( var(--spectrum-menu-item-section-divider-height) - var(--spectrum-menu-divider-thickness))/2));margin-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));overflow:visible}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-shrink:0;display:block}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:
|
|
4
|
+
.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-back .header{padding:0}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-direction:column;margin:0;display:inline-flex;overflow:visible}[hidden]{display:none!important}
|
|
5
5
|
`;
|
|
6
6
|
export default styles;
|
|
7
7
|
//# sourceMappingURL=menu-group.css.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-group.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(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:
|
|
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(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-back .header{padding:0}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-direction:column;margin:0;display:inline-flex;overflow:visible}[hidden]{display:none!important}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/menu-group.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";import{css as e}from"@spectrum-web-components/base";const n=e`
|
|
2
|
-
.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:
|
|
2
|
+
.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-back .header{padding:0}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-direction:column;margin:0;display:inline-flex;overflow:visible}[hidden]{display:none!important}
|
|
3
3
|
`;export default n;
|
|
4
4
|
//# sourceMappingURL=menu-group.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-group.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(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:
|
|
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(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-section-header-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));min-inline-size:var(--mod-menu-section-header-min-width,var(--spectrum-menu-section-header-min-width));padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-back .header{padding:0}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host{flex-direction:column;margin:0;display:inline-flex;overflow:visible}[hidden]{display:none!important}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/src/menu-item.css.dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
.checkmark{block-size:var(--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height));inline-size:var(--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width));grid-area:e;align-self:start;margin-block-start:calc(var(--mod-menu-item-top-to-checkmark,var(--spectrum-menu-item-top-to-checkmark)) - var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.chevron{block-size:var(--spectrum-menu-item-checkmark-height);inline-size:var(--spectrum-menu-item-checkmark-width);grid-area:o;align-self:center;margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.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(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)))}.checkmark{display:var(--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display));fill:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));opacity:1;align-self:center}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)));line-height:var(--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height));min-block-size:var(--mod-menu-item-min-height,var(--spectrum-menu-item-min-height));padding-block-start:var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text));padding-block-end:var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;position:relative}.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-start:var(--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox));margin-block-end:0;margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-start:var(--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action));margin-block-end:0}:host{grid-template:".a.b c. . ."1fr"d a e f g h i j"". . . .k. . ."". . . .l. . ."/auto auto auto auto 1fr auto auto auto;display:grid}#label{grid-area:m}:host([focused]),:host(:focus){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)))}:host([focused])>.icon:not(.chevron,.checkmark),:host(:focus)>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)))}:host([focused])>.chevron,:host(:focus)>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)))}:host([focused]) .spectrum-Menu-back,:host([focused]){box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}:host:dir(rtl),:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:is(:active,[active])){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)))}:host(:is(:active,[active]))>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)))}::slotted([slot=icon]){grid-area:f;align-self:start}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:b}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:e}.checkmark{grid-area:e;align-self:start}.spectrum-Menu-itemSelection{grid-area:d}#label{font-size:var(--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)));grid-area:g}::slotted([slot=value]){grid-area:h}.spectrum-Menu-itemActions{grid-area:i;align-self:start;margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing))}.chevron{block-size:var(--spectrum-menu-item-checkmark-height);inline-size:var(--spectrum-menu-item-checkmark-width);grid-area:o;align-self:center}.spectrum-Menu-item--collapsible .chevron{grid-area:a}[name=description]::slotted(*){grid-area:k}:host([has-submenu]) .chevron{grid-area:j}.icon:not(.chevron,.checkmark){block-size:var(--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height));inline-size:var(--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width))}.checkmark{block-size:var(--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height));inline-size:var(--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width));margin-block-start:calc(var(--mod-menu-item-top-to-checkmark,var(--spectrum-menu-item-top-to-checkmark)) - var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}::slotted([slot=icon]){margin-inline-end:var(--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual))}.chevron{margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)));font-size:var(--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size));line-height:var(--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height));margin-block-start:var(--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing))}[name=description]::slotted(*),#label{hyphens:auto;overflow-wrap:break-word}::slotted([slot=value]){color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)));font-size:var(--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size));place-self:start end;margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}:host([focused]) .spectrum-Menu-item--collapsible.is-open,:host(:is(:active,[active])) .spectrum-Menu-item--collapsible.is-open,.spectrum-Menu-item--collapsible.is-open:focus{background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)))}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)))}.chevron:dir(rtl),:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)));margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing));margin-inline-end:0}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(--highcontrast-menu-item-selected-background-color,var(--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)))}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)))}:host([has-submenu]) .is-open .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)))}:host([has-submenu]) .is-open .checkmark{fill:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)))}:host([has-submenu][focused]) .chevron,:host([has-submenu]:focus) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)))}:host([has-submenu]:is(:active,[active])) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)));color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}@media (hover:hover){:host(:hover){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)))}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)))}:host(:hover)>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host(:hover)>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)))}.spectrum-Menu-item--collapsible.is-open:hover{background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)))}:host([has-submenu]:hover) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)));color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}: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(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*),:host([has-submenu][disabled]) .chevron{color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}#button{position:absolute;inset:0}: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]){width:max-content;max-width:100%}:host([no-wrap]) #label{display:block}
|
|
4
|
+
.checkmark{display:var(--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display));fill:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));opacity:1;align-self:center}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.checkmark{block-size:var(--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height));inline-size:var(--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width));grid-area:checkmarkArea;align-self:start;margin-block-start:calc(var(--mod-menu-item-top-to-checkmark,var(--spectrum-menu-item-top-to-checkmark)) - var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}.spectrum-Menu-back:focus-visible{box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}.chevron{block-size:var(--spectrum-menu-item-checkmark-height);inline-size:var(--spectrum-menu-item-checkmark-width);grid-area:chevronArea;align-self:center;margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.chevron:dir(rtl),:host([dir=rtl]) .chevron{transform:rotate(-180deg)}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}.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-backHeading{color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-icon-color-default,var(--spectrum-menu-item-label-icon-color-default)))}.checkmark{display:var(--mod-menu-checkmark-display,var(--spectrum-menu-checkmark-display));fill:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-default,var(--spectrum-menu-checkmark-icon-color-default)));opacity:1;align-self:center}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)));line-height:var(--mod-menu-item-label-line-height,var(--spectrum-menu-item-label-line-height));min-block-size:var(--mod-menu-item-min-height,var(--spectrum-menu-item-min-height));padding-block-start:var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text));padding-block-end:var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text));padding-inline:var(--mod-menu-item-label-inline-edge-to-content,var(--spectrum-menu-item-label-inline-edge-to-content));align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;position:relative}.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-start:var(--mod-menu-item-top-to-checkbox,var(--spectrum-menu-item-top-to-checkbox));margin-block-end:0;margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}.spectrum-Menu-itemSwitch{min-block-size:0}.spectrum-Menu-itemSwitch .spectrum-Switch-switch{margin-block-start:var(--mod-menu-item-top-to-action,var(--spectrum-menu-item-top-to-action));margin-block-end:0}:host{grid-template:".chevronAreaCollapsible.headingIconArea sectionHeadingArea. . ."1fr"selectedArea chevronAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea chevronAreaDrillIn"". . . .descriptionArea. . ."". . . .submenuArea. . ."/auto auto auto auto 1fr auto auto auto;display:grid}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]),:host(:focus){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-key-focus,var(--spectrum-menu-item-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-focus,var(--spectrum-menu-item-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-focus,var(--spectrum-menu-item-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-focus,var(--spectrum-menu-item-value-color-focus)))}:host([focused])>.icon:not(.chevron,.checkmark),:host(:focus)>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-focus,var(--spectrum-menu-item-label-icon-color-focus)))}:host([focused])>.chevron,:host(:focus)>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-focus,var(--spectrum-menu-checkmark-icon-color-focus)))}:host([focused]) .spectrum-Menu-back,:host([focused]){box-shadow:inset calc(var(--mod-menu-item-focus-indicator-width,var(--spectrum-menu-item-focus-indicator-width))*var(--spectrum-menu-item-focus-indicator-direction-scalar,1))0 0 0 var(--highcontrast-menu-item-focus-indicator-color,var(--mod-menu-item-focus-indicator-color,var(--spectrum-menu-item-focus-indicator-color)))}:host:dir(rtl),:host([dir=rtl]){--spectrum-menu-item-focus-indicator-direction-scalar:-1}:host(:is(:active,[active])){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-down,var(--spectrum-menu-item-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-down,var(--spectrum-menu-item-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-down,var(--spectrum-menu-item-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-down,var(--spectrum-menu-item-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-down,var(--spectrum-menu-item-label-icon-color-down)))}:host(:is(:active,[active]))>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-down,var(--spectrum-menu-checkmark-icon-color-down)))}::slotted([slot=icon]){grid-area:iconArea;align-self:start}.spectrum-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .spectrum-Menu-itemCheckbox{grid-area:checkmarkArea}.checkmark{grid-area:checkmarkArea;align-self:start}.spectrum-Menu-itemSelection{grid-area:selectedArea}#label{font-size:var(--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-label-content-color-default,var(--spectrum-menu-item-label-content-color-default)));grid-area:labelArea}::slotted([slot=value]){grid-area:valueArea}.spectrum-Menu-itemActions{grid-area:actionsArea;align-self:start;margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing))}.chevron{block-size:var(--spectrum-menu-item-checkmark-height);inline-size:var(--spectrum-menu-item-checkmark-width);grid-area:chevronArea;align-self:center}.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(--mod-menu-item-icon-height,var(--spectrum-menu-item-icon-height));inline-size:var(--mod-menu-item-icon-width,var(--spectrum-menu-item-icon-width))}.checkmark{block-size:var(--mod-menu-item-checkmark-height,var(--spectrum-menu-item-checkmark-height));inline-size:var(--mod-menu-item-checkmark-width,var(--spectrum-menu-item-checkmark-width));margin-block-start:calc(var(--mod-menu-item-top-to-checkmark,var(--spectrum-menu-item-top-to-checkmark)) - var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}::slotted([slot=icon]){margin-inline-end:var(--mod-menu-item-label-text-to-visual,var(--spectrum-menu-item-label-text-to-visual))}.chevron{margin-inline-end:var(--mod-menu-item-text-to-control,var(--spectrum-menu-item-text-to-control))}[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-description-color-default,var(--spectrum-menu-item-description-color-default)));font-size:var(--mod-menu-item-description-font-size,var(--spectrum-menu-item-description-font-size));line-height:var(--mod-menu-item-description-line-height,var(--spectrum-menu-item-description-line-height));margin-block-start:var(--mod-menu-item-label-to-description-spacing,var(--spectrum-menu-item-label-to-description-spacing))}[name=description]::slotted(*),#label{hyphens:auto;overflow-wrap:break-word}::slotted([slot=value]){color:var(--highcontrast-menu-item-color-default,var(--mod-menu-item-value-color-default,var(--spectrum-menu-item-value-color-default)));font-size:var(--mod-menu-item-label-font-size,var(--spectrum-menu-item-label-font-size));place-self:start end;margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.spectrum-Menu-item--collapsible.is-open{padding-block-end:0}.spectrum-Menu-item--collapsible.is-open .chevron{transform:rotate(90deg)}:host([focused]) .spectrum-Menu-item--collapsible.is-open,:host(:is(:active,[active])) .spectrum-Menu-item--collapsible.is-open,.spectrum-Menu-item--collapsible.is-open:focus{background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)))}.spectrum-Menu-item--collapsible>::slotted([slot=icon]){padding-block-start:var(--mod-menu-section-header-top-edge-to-text,var(--mod-menu-item-top-edge-to-text,var(--spectrum-menu-item-top-edge-to-text)));padding-block-end:var(--mod-menu-section-header-bottom-edge-to-text,var(--mod-menu-item-bottom-edge-to-text,var(--spectrum-menu-item-bottom-edge-to-text)))}.chevron:dir(rtl),:host([dir=rtl]) .chevron{transform:rotate(-180deg)}:host([has-submenu]) .chevron{fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-drillin-icon-color-default,var(--spectrum-menu-drillin-icon-color-default)));margin-inline-start:var(--mod-menu-item-label-to-value-area-min-spacing,var(--spectrum-menu-item-label-to-value-area-min-spacing));margin-inline-end:0}:host([has-submenu]) .is-open{--spectrum-menu-item-background-color-default:var(--highcontrast-menu-item-selected-background-color,var(--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)))}:host([has-submenu]) .is-open .icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)))}:host([has-submenu]) .is-open .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)))}:host([has-submenu]) .is-open .checkmark{fill:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-checkmark-icon-color-default,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)))}:host([has-submenu][focused]) .chevron,:host([has-submenu]:focus) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-focus,var(--spectrum-menu-drillin-icon-color-focus)))}:host([has-submenu]:is(:active,[active])) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-down,var(--spectrum-menu-drillin-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)));color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}@media (hover:hover){:host(:hover){background-color:var(--highcontrast-menu-item-background-color-focus,var(--mod-menu-item-background-color-hover,var(--spectrum-menu-item-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-content-color-hover,var(--spectrum-menu-item-label-content-color-hover)))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-description-color-hover,var(--spectrum-menu-item-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-value-color-hover,var(--spectrum-menu-item-value-color-hover)))}:host(:hover)>.icon:not(.chevron,.checkmark){fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-item-label-icon-color-hover,var(--spectrum-menu-item-label-icon-color-hover)))}:host(:hover)>.chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-collapsible-icon-color,var(--spectrum-menu-collapsible-icon-color)))}:host(:hover)>.checkmark{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-checkmark-icon-color-hover,var(--spectrum-menu-checkmark-icon-color-hover)))}.spectrum-Menu-item--collapsible.is-open:hover{background-color:var(--highcontrast-menu-item-background-color-default,var(--mod-menu-item-background-color-default,var(--spectrum-menu-item-background-color-default)))}:host([has-submenu]:hover) .chevron{fill:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus,var(--mod-menu-drillin-icon-color-hover,var(--spectrum-menu-drillin-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-content-color-disabled,var(--spectrum-menu-item-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-description-color-disabled,var(--spectrum-menu-item-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)));color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}}.spectrum-Menu-back{padding-inline:var(--mod-menu-back-padding-inline-start,0)var(--mod-menu-back-padding-inline-end,var(--spectrum-menu-item-label-inline-edge-to-content));padding-block:var(--mod-menu-back-padding-block-start,0)var(--mod-menu-back-padding-block-end,0);flex-flow:wrap;align-items:center;display:flex}.spectrum-Menu-backButton{cursor:pointer;background:0 0;border:0;margin:0;padding:0;display:inline-flex}: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(--highcontrast-menu-item-color-default,var(--mod-menu-back-heading-color,var(--spectrum-menu-section-header-color)));font-size:var(--mod-menu-section-header-font-size,var(--spectrum-menu-section-header-font-size));font-weight:var(--mod-menu-section-header-font-weight,var(--spectrum-menu-section-header-font-weight));line-height:var(--mod-menu-section-header-line-height,var(--spectrum-menu-section-header-line-height));display:block}.spectrum-Menu-backIcon{margin-block:var(--mod-menu-back-icon-margin-block,var(--spectrum-menu-back-icon-margin));margin-inline:var(--mod-menu-back-icon-margin-inline,var(--spectrum-menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default));color:var(--highcontrast-menu-item-color-default,var(--mod-menu-back-icon-color-default))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}:host([has-submenu][disabled]) .chevron{color:var(--highcontrast-menu-item-color-disabled,var(--mod-menu-item-label-icon-color-disabled,var(--spectrum-menu-item-label-icon-color-disabled)))}#button{position:absolute;inset:0}: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]){width:max-content;max-width:100%}:host([no-wrap]) #label{display:block}
|
|
5
5
|
`;
|
|
6
6
|
export default styles;
|
|
7
7
|
//# sourceMappingURL=menu-item.css.dev.js.map
|