@spectrum-web-components/menu 0.31.1-overlay.29 → 0.31.1-react.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +2206 -0
- package/package.json +10 -10
- package/src/Menu.d.ts +3 -11
- package/src/Menu.dev.js +60 -139
- package/src/Menu.dev.js.map +2 -2
- package/src/Menu.js +3 -6
- package/src/Menu.js.map +3 -3
- package/src/MenuGroup.dev.js +7 -2
- package/src/MenuGroup.dev.js.map +2 -2
- package/src/MenuGroup.js +5 -3
- package/src/MenuGroup.js.map +2 -2
- package/src/MenuItem.d.ts +4 -19
- package/src/MenuItem.dev.js +96 -121
- package/src/MenuItem.dev.js.map +3 -3
- package/src/MenuItem.js +15 -36
- package/src/MenuItem.js.map +3 -3
- 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/stories/submenu.stories.js +20 -26
- package/stories/submenu.stories.js.map +3 -3
- package/test/menu-group.test.js +1 -14
- package/test/menu-group.test.js.map +2 -2
- package/test/menu-selects.test.js +1 -3
- package/test/menu-selects.test.js.map +2 -2
- package/test/menu.test.js +0 -7
- package/test/menu.test.js.map +2 -2
- package/test/submenu.test.js +83 -198
- package/test/submenu.test.js.map +2 -2
package/src/MenuItem.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["MenuItem.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 TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\n\nimport menuItemStyles from './menu-item.css.js';\nimport checkmarkStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport type { Menu } from './Menu.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { OverlayBase } from 'overlay/src/OverlayBase.js';\n\n/**\n * Duration during which a pointing device can leave an `<sp-menu-item>` element\n * and return to it or to the submenu opened from it before closing that submenu.\n **/\nconst POINTERLEAVE_TIMEOUT = 100;\n\nexport class MenuItemRemovedEvent extends Event {\n constructor() {\n super('sp-menu-item-removed', {\n bubbles: true,\n composed: true,\n });\n }\n get item(): MenuItem {\n return this._item;\n }\n _item!: MenuItem;\n focused = false;\n reset(item: MenuItem): void {\n this._item = item;\n }\n}\n\nexport class MenuItemAddedOrUpdatedEvent extends Event {\n constructor() {\n super('sp-menu-item-added-or-updated', {\n bubbles: true,\n composed: true,\n });\n }\n menuCascade = new WeakMap<\n HTMLElement,\n {\n hadFocusRoot: boolean;\n ancestorWithSelects?: HTMLElement;\n }\n >();\n set focusRoot(root: Menu | undefined) {\n this.item.menuData.focusRoot = this.item.menuData.focusRoot || root;\n }\n set parentMenu(menu: Menu | undefined) {\n this.item.menuData.parentMenu = this.item.menuData.parentMenu || menu;\n }\n set selectionRoot(root: Menu) {\n this.item.menuData.selectionRoot =\n this.item.menuData.selectionRoot || root;\n }\n get item(): MenuItem {\n return this._item;\n }\n _item!: MenuItem;\n set currentAncestorWithSelects(ancestor: Menu | undefined) {\n this._currentAncestorWithSelects = ancestor;\n }\n get currentAncestorWithSelects(): Menu | undefined {\n return this._currentAncestorWithSelects;\n }\n _currentAncestorWithSelects?: Menu;\n reset(item: MenuItem): void {\n this._item = item;\n this._currentAncestorWithSelects = undefined;\n item.menuData = {\n focusRoot: undefined,\n selectionRoot: undefined,\n };\n }\n}\n\nexport type MenuItemChildren = { icon: Element[]; content: Node[] };\n\nconst addOrUpdateEvent = new MenuItemAddedOrUpdatedEvent();\nconst removeEvent = new MenuItemRemovedEvent();\n\n/**\n * @element sp-menu-item\n *\n * @slot - text content to display within the Menu Item\n * @slot icon - icon element to be placed at the start of the Menu Item\n * @slot value - content placed at the end of the Menu Item like values, keyboard shortcuts, etc.\n * @slot submenu - content placed in a submenu\n * @fires sp-menu-item-added - announces the item has been added so a parent menu can take ownerships\n * @fires sp-menu-item-removed - announces when removed from the DOM so the parent menu can remove ownership and update selected state\n */\nexport class MenuItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [menuItemStyles, checkmarkStyles, chevronStyles];\n }\n\n static instanceCount = 0;\n\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public get value(): string {\n return this._value || this.itemText;\n }\n\n public set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value || '';\n if (this._value) {\n this.setAttribute('value', this._value);\n } else {\n this.removeAttribute('value');\n }\n }\n\n private _value = '';\n\n /**\n * @private\n */\n public get itemText(): string {\n return this.itemChildren.content.reduce(\n (acc, node) => acc + (node.textContent || '').trim(),\n ''\n );\n }\n\n @property({ type: Boolean })\n public hasSubmenu = false;\n\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'no-wrap',\n hasChanged() {\n return false;\n },\n })\n public noWrap = false;\n\n @query('.anchor')\n private anchorElement!: HTMLAnchorElement;\n\n @query('sp-overlay')\n public overlayElement!: OverlayBase;\n\n public override get focusElement(): HTMLElement {\n return this;\n }\n\n public get itemChildren(): MenuItemChildren {\n if (this._itemChildren) {\n return this._itemChildren;\n }\n\n const iconSlot = this.shadowRoot?.querySelector(\n 'slot[name=\"icon\"]'\n ) as HTMLSlotElement;\n const icon = !iconSlot\n ? []\n : iconSlot.assignedElements().map((element) => {\n const newElement = element.cloneNode(true) as HTMLElement;\n newElement.removeAttribute('slot');\n newElement.classList.toggle('icon');\n return newElement;\n });\n const contentSlot = this.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement;\n const content = !contentSlot\n ? []\n : contentSlot.assignedNodes().map((node) => node.cloneNode(true));\n this._itemChildren = { icon, content };\n\n return this._itemChildren;\n }\n\n private _itemChildren?: MenuItemChildren;\n\n constructor() {\n super();\n this.addEventListener('click', this.handleClickCapture, {\n capture: true,\n });\n\n new MutationController(this, {\n config: {\n characterData: true,\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.breakItemChildrenCache();\n },\n });\n }\n\n @property({ type: Boolean })\n public open = false;\n\n public override click(): void {\n if (this.disabled) {\n return;\n }\n\n if (this.shouldProxyClick()) {\n return;\n }\n\n super.click();\n }\n\n private handleClickCapture(event: Event): void | boolean {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n return false;\n }\n }\n\n private proxyFocus = (): void => {\n this.focus();\n }\n\n private shouldProxyClick(): boolean {\n let handled = false;\n if (this.anchorElement) {\n this.anchorElement.click();\n handled = true;\n }\n return handled;\n }\n\n protected breakItemChildrenCache(): void {\n this._itemChildren = undefined;\n this.triggerUpdate();\n }\n\n protected renderSubmenu(): TemplateResult {\n const slot = html`\n <slot\n name=\"submenu\"\n @slotchange=${this.manageSubmenu}\n @sp-menu-item-removed=${(event: Event) => {\n event.stopPropagation();\n }}\n @sp-menu-item-added-or-updated=${{\n handleEvent: (\n event: MenuItemAddedOrUpdatedEvent\n ) => {\n event.reset(event.item);\n },\n capture: true,\n }}\n @focusin=${(event: Event) => event.stopPropagation()}\n ></slot>\n `;\n if (!this.hasSubmenu) {\n return slot;\n }\n return html`\n<sp-overlay\n .triggerElement=${this as HTMLElement}\n ?disabled=${!this.hasSubmenu}\n ?open=${this.hasSubmenu && this.open}\n .placement=${this.isLTR ? 'right-start' : 'left-start'}\n .offset=${[-10, -5] as [number, number]}\n .type=${'auto'}\n @close=${(event: Event) => event.stopPropagation()}\n >\n <sp-popover\n @change=${(event: Event) => {\n this.handleSubmenuChange(event);\n this.open = false;\n }}\n @pointerenter=${this.handleSubmenuPointerenter}\n @pointerleave=${this.handleSubmenuPointerleave}\n @sp-menu-item-added-or-updated=${(event: Event) =>\n event.stopPropagation()}\n >\n ${slot}\n </sp-popover>\n </sp-overlay>\n <sp-icon-chevron100\n class=\"spectrum-UIIcon-ChevronRight100 chevron icon\"\n ></sp-icon-chevron100>\n `;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot name=\"icon\"></slot>\n <div id=\"label\">\n <slot id=\"slot\"></slot>\n </div>\n <slot name=\"value\"></slot>\n ${this.selected\n ? html`\n <sp-icon-checkmark100\n id=\"selected\"\n class=\"spectrum-UIIcon-Checkmark100 icon checkmark\"\n ></sp-icon-checkmark100>\n `\n : html``}\n ${this.href && this.href.length > 0\n ? super.renderAnchor({\n id: 'button',\n ariaHidden: true,\n className: 'button anchor hidden',\n })\n : html``}\n ${this.renderSubmenu()}\n `;\n }\n\n protected manageSubmenu(event: Event & { target: HTMLSlotElement }): void {\n const assignedElements = event.target.assignedElements({\n flatten: true,\n });\n this.hasSubmenu = !!assignedElements.length;\n }\n\n private handleRemoveActive(): void {\n if (this.open) {\n return;\n }\n this.active = false;\n }\n\n private handlePointerdown(): void {\n this.active = true;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('tabindex', '-1');\n this.addEventListener('pointerdown', this.handlePointerdown);\n this.addEventListener('pointerenter', this.closeOverlaysForRoot);\n if (!this.hasAttribute('id')) {\n this.id = `sp-menu-item-${MenuItem.instanceCount++}`;\n }\n }\n\n protected closeOverlaysForRoot(): void {\n if (this.open) return;\n this.menuData.parentMenu?.closeDescendentOverlays();\n }\n\n public closeOverlay?: () => Promise<void>;\n\n protected handleSubmenuClick(event: Event): void {\n if (event.composedPath().includes(this.overlayElement)) {\n return;\n }\n this.openOverlay();\n }\n\n protected handlePointerenter(): void {\n if (this.leaveTimeout) {\n clearTimeout(this.leaveTimeout);\n delete this.leaveTimeout;\n return;\n }\n this.openOverlay();\n }\n\n protected leaveTimeout?: ReturnType<typeof setTimeout>;\n protected recentlyLeftChild = false;\n\n protected handlePointerleave(): void {\n if (this.open && !this.recentlyLeftChild) {\n this.leaveTimeout = setTimeout(() => {\n delete this.leaveTimeout;\n this.open = false;\n }, POINTERLEAVE_TIMEOUT);\n }\n }\n\n /**\n * When there is a `change` event in the submenu for this item\n * then we \"click\" this item to cascade the selection up the\n * menu tree allowing all submenus between the initial selection\n * and the root of the tree to have their selection changes and\n * be closed.\n */\n protected handleSubmenuChange(event: Event): void {\n event.stopPropagation();\n this.menuData.selectionRoot?.selectOrToggleItem(this);\n }\n\n protected handleSubmenuPointerenter(): void {\n this.recentlyLeftChild = true;\n }\n\n protected async handleSubmenuPointerleave(): Promise<void> {\n requestAnimationFrame(() => {\n this.recentlyLeftChild = false;\n });\n }\n\n protected handleSubmenuOpen(event: Event): void {\n this.focused = false;\n const parentOverlay = event.composedPath().find((el) => {\n return (\n el !== this.overlayElement &&\n (el as HTMLElement).localName === 'sp-overlay'\n );\n }) as OverlayBase;\n this.overlayElement.parentOverlayToForceClose = parentOverlay;\n }\n\n public async openOverlay(): Promise<void> {\n if (!this.hasSubmenu || this.open || this.disabled) {\n return;\n }\n this.open = true;\n this.active = true;\n const cleanup = (event: Event): void => {\n event.stopPropagation();\n this.open = false;\n this.active = false;\n };\n this.addEventListener('sp-closed', cleanup as EventListener, {\n once: true,\n });\n }\n\n updateAriaSelected(): void {\n const role = this.getAttribute('role');\n if (role === 'option') {\n this.setAttribute(\n 'aria-selected',\n this.selected ? 'true' : 'false'\n );\n } else if (role === 'menuitemcheckbox' || role === 'menuitemradio') {\n this.setAttribute('aria-checked', this.selected ? 'true' : 'false');\n }\n }\n\n public setRole(role: string): void {\n this.setAttribute('role', role);\n this.updateAriaSelected();\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('label') && (this.label || typeof changes.get('label') !== 'undefined')) {\n this.setAttribute('aria-label', this.label || '');\n }\n if (changes.has('active') && (this.active || typeof changes.get('active') !== 'undefined')) {\n if (this.active) {\n this.menuData.selectionRoot?.closeDescendentOverlays();\n this.addEventListener('pointerup', this.handleRemoveActive);\n this.addEventListener('pointerleave', this.handleRemoveActive);\n this.addEventListener('pointercancel', this.handleRemoveActive);\n } else {\n this.removeEventListener('pointerup', this.handleRemoveActive);\n this.removeEventListener(\n 'pointerleave',\n this.handleRemoveActive\n );\n this.removeEventListener(\n 'pointercancel',\n this.handleRemoveActive\n );\n }\n }\n if (this.anchorElement) {\n this.anchorElement.addEventListener('focus', this.proxyFocus);\n this.anchorElement.tabIndex = -1;\n }\n if (changes.has('selected')) {\n this.updateAriaSelected();\n }\n if (changes.has('hasSubmenu') && (this.hasSubmenu || typeof changes.get('hasSubmenu') !== 'undefined')) {\n if (this.hasSubmenu) {\n this.addEventListener('click', this.handleSubmenuClick);\n this.addEventListener('pointerenter', this.handlePointerenter);\n this.addEventListener('pointerleave', this.handlePointerleave);\n this.addEventListener('sp-opened', this.handleSubmenuOpen);\n } else if (!this.closeOverlay) {\n this.removeEventListener('click', this.handleSubmenuClick);\n this.removeEventListener(\n 'pointerenter',\n this.handlePointerenter\n );\n this.removeEventListener(\n 'pointerleave',\n this.handlePointerleave\n );\n this.removeEventListener('sp-opened', this.handleSubmenuOpen);\n }\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.menuDataUpdated = new Promise(\n (res) => (this.resolveMenuDataUpdated = res)\n );\n this.triggerUpdate();\n }\n\n _parentElement!: HTMLElement;\n\n public override disconnectedCallback(): void {\n removeEvent.reset(this);\n this._parentElement?.dispatchEvent(removeEvent);\n super.disconnectedCallback();\n }\n\n private willTriggerUpdate = false;\n\n public async triggerUpdate(): Promise<void> {\n if (this.willTriggerUpdate) {\n return;\n }\n this.willTriggerUpdate = true;\n await new Promise((ready) => requestAnimationFrame(ready));\n addOrUpdateEvent.reset(this);\n this.dispatchEvent(addOrUpdateEvent);\n this._parentElement =\n this.assignedSlot || (this.parentElement as HTMLElement);\n if (!!this.menuData.focusRoot) {\n this.resolveMenuDataUpdated();\n }\n this.willTriggerUpdate = false;\n }\n\n protected menuDataUpdated!: Promise<void>;\n protected resolveMenuDataUpdated = (): void => {\n return;\n };\n\n public menuData: {\n focusRoot?: Menu;\n parentMenu?: Menu;\n selectionRoot?: Menu;\n } = {\n focusRoot: undefined,\n parentMenu: undefined,\n selectionRoot: undefined,\n };\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-menu-item-added-or-updated': MenuItemAddedOrUpdatedEvent;\n 'sp-menu-item-removed': MenuItemRemovedEvent;\n }\n}\n"],
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,MAAO,kEACP,OAAS,cAAAC,MAAkB,qDAC3B,OAAS,aAAAC,MAAiB,mDAC1B,MAAO,gEACP,OAAOC,MAAmB,
|
|
6
|
-
"names": ["html", "property", "query", "LikeAnchor", "Focusable", "chevronStyles", "menuItemStyles", "checkmarkStyles", "MutationController", "POINTERLEAVE_TIMEOUT", "item", "root", "
|
|
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 TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-checkmark100.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron100.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport { openOverlay } from '@spectrum-web-components/overlay/src/loader.js';\nimport { OverlayCloseEvent } from '@spectrum-web-components/overlay/src/overlay-events.js';\n\nimport menuItemStyles from './menu-item.css.js';\nimport checkmarkStyles from '@spectrum-web-components/icon/src/spectrum-icon-checkmark.css.js';\nimport type { Menu } from './Menu.js';\nimport type { OverlayOpenCloseDetail } from '@spectrum-web-components/overlay';\nimport { reparentChildren } from '@spectrum-web-components/shared/src/reparent-children.js';\nimport { MutationController } from '@lit-labs/observers/mutation-controller.js';\n\n/**\n * Duration during which a pointing device can leave an `<sp-menu-item>` element\n * and return to it or to the submenu opened from it before closing that submenu.\n **/\nconst POINTERLEAVE_TIMEOUT = 100;\n\nexport class MenuItemRemovedEvent extends Event {\n constructor() {\n super('sp-menu-item-removed', {\n bubbles: true,\n composed: true,\n });\n }\n get item(): MenuItem {\n return this._item;\n }\n _item!: MenuItem;\n focused = false;\n reset(item: MenuItem): void {\n this._item = item;\n }\n}\n\nexport class MenuItemAddedOrUpdatedEvent extends Event {\n constructor() {\n super('sp-menu-item-added-or-updated', {\n bubbles: true,\n composed: true,\n });\n }\n set focusRoot(root: Menu | undefined) {\n this.item.menuData.focusRoot = this.item.menuData.focusRoot || root;\n }\n set selectionRoot(root: Menu) {\n this.item.menuData.selectionRoot =\n this.item.menuData.selectionRoot || root;\n }\n get item(): MenuItem {\n return this._item;\n }\n _item!: MenuItem;\n set currentAncestorWithSelects(ancestor: Menu | undefined) {\n this._currentAncestorWithSelects = ancestor;\n }\n get currentAncestorWithSelects(): Menu | undefined {\n return this._currentAncestorWithSelects;\n }\n _currentAncestorWithSelects?: Menu;\n reset(item: MenuItem): void {\n this._item = item;\n this._currentAncestorWithSelects = undefined;\n item.menuData = {\n focusRoot: undefined,\n selectionRoot: undefined,\n };\n }\n}\n\nexport type MenuItemChildren = { icon: Element[]; content: Node[] };\n\nconst addOrUpdateEvent = new MenuItemAddedOrUpdatedEvent();\nconst removeEvent = new MenuItemRemovedEvent();\n\n/**\n * @element sp-menu-item\n *\n * @slot - text content to display within the Menu Item\n * @slot icon - icon element to be placed at the start of the Menu Item\n * @slot value - content placed at the end of the Menu Item like values, keyboard shortcuts, etc.\n * @slot submenu - content placed in a submenu\n * @fires sp-menu-item-added - announces the item has been added so a parent menu can take ownerships\n * @fires sp-menu-item-removed - announces when removed from the DOM so the parent menu can remove ownership and update selected state\n */\nexport class MenuItem extends LikeAnchor(Focusable) {\n public static override get styles(): CSSResultArray {\n return [menuItemStyles, checkmarkStyles, chevronStyles];\n }\n\n static instanceCount = 0;\n\n private isInSubmenu = false;\n\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public get value(): string {\n return this._value || this.itemText;\n }\n\n public set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value || '';\n if (this._value) {\n this.setAttribute('value', this._value);\n } else {\n this.removeAttribute('value');\n }\n }\n\n private _value = '';\n\n /**\n * @private\n */\n public get itemText(): string {\n return this.itemChildren.content.reduce(\n (acc, node) => acc + (node.textContent || '').trim(),\n ''\n );\n }\n\n @property({ type: Boolean })\n public hasSubmenu = false;\n\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'no-wrap',\n hasChanged() {\n return false;\n },\n })\n public noWrap = false;\n\n @query('.anchor')\n private anchorElement!: HTMLAnchorElement;\n\n public override get focusElement(): HTMLElement {\n return this;\n }\n\n public get itemChildren(): MenuItemChildren {\n if (this._itemChildren) {\n return this._itemChildren;\n }\n\n const iconSlot = this.shadowRoot?.querySelector(\n 'slot[name=\"icon\"]'\n ) as HTMLSlotElement;\n const icon = !iconSlot\n ? []\n : iconSlot.assignedElements().map((element) => {\n const newElement = element.cloneNode(true) as HTMLElement;\n newElement.removeAttribute('slot');\n newElement.classList.toggle('icon');\n return newElement;\n });\n const contentSlot = this.shadowRoot?.querySelector(\n 'slot:not([name])'\n ) as HTMLSlotElement;\n const content = !contentSlot\n ? []\n : contentSlot.assignedNodes().map((node) => node.cloneNode(true));\n this._itemChildren = { icon, content };\n\n return this._itemChildren;\n }\n\n private _itemChildren?: MenuItemChildren;\n\n constructor() {\n super();\n this.proxyFocus = this.proxyFocus.bind(this);\n\n this.addEventListener('click', this.handleClickCapture, {\n capture: true,\n });\n\n new MutationController(this, {\n config: {\n characterData: true,\n childList: true,\n subtree: true,\n },\n callback: () => {\n this.breakItemChildrenCache();\n },\n });\n }\n\n @property({ type: Boolean })\n public open = false;\n\n public override click(): void {\n if (this.disabled) {\n return;\n }\n\n if (this.shouldProxyClick()) {\n return;\n }\n\n super.click();\n }\n\n private handleClickCapture(event: Event): void | boolean {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n return false;\n }\n }\n\n private proxyFocus(): void {\n this.focus();\n }\n\n private shouldProxyClick(): boolean {\n let handled = false;\n if (this.anchorElement) {\n this.anchorElement.click();\n handled = true;\n }\n return handled;\n }\n\n protected breakItemChildrenCache(): void {\n this._itemChildren = undefined;\n this.triggerUpdate();\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot name=\"icon\"></slot>\n <div id=\"label\">\n <slot id=\"slot\"></slot>\n </div>\n <slot name=\"value\"></slot>\n ${this.selected\n ? html`\n <sp-icon-checkmark100\n id=\"selected\"\n class=\"spectrum-UIIcon-Checkmark100 icon checkmark\"\n ></sp-icon-checkmark100>\n `\n : html``}\n ${this.href && this.href.length > 0\n ? super.renderAnchor({\n id: 'button',\n ariaHidden: true,\n className: 'button anchor hidden',\n })\n : html``}\n <slot\n hidden\n name=\"submenu\"\n @slotchange=${this.manageSubmenu}\n ></slot>\n ${this.hasSubmenu\n ? html`\n <sp-icon-chevron100\n class=\"spectrum-UIIcon-ChevronRight100 chevron icon\"\n ></sp-icon-chevron100>\n `\n : html``}\n `;\n }\n\n protected manageSubmenu(event: Event & { target: HTMLSlotElement }): void {\n const assignedElements = event.target.assignedElements({\n flatten: true,\n });\n this.hasSubmenu = this.open || !!assignedElements.length;\n }\n\n private handleRemoveActive(event: Event): void {\n if (\n (event.type === 'pointerleave' && this.hasSubmenu) ||\n this.hasSubmenu ||\n this.open\n ) {\n return;\n }\n this.active = false;\n }\n\n private handlePointerdown(): void {\n this.active = true;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('tabindex', '-1');\n this.addEventListener('pointerdown', this.handlePointerdown);\n if (!this.hasAttribute('id')) {\n this.id = `sp-menu-item-${MenuItem.instanceCount++}`;\n }\n this.addEventListener('pointerenter', this.closeOverlaysForRoot);\n }\n\n protected closeOverlaysForRoot(): void {\n if (this.open) return;\n const overalyCloseEvent = new OverlayCloseEvent({\n root: this.menuData.focusRoot,\n });\n this.dispatchEvent(overalyCloseEvent);\n }\n\n public closeOverlay?: () => Promise<void>;\n\n protected handleSubmenuClick(): void {\n this.openOverlay();\n }\n\n protected handlePointerenter(): void {\n if (this.leaveTimeout) {\n clearTimeout(this.leaveTimeout);\n delete this.leaveTimeout;\n return;\n }\n this.openOverlay();\n }\n\n protected leaveTimeout?: ReturnType<typeof setTimeout>;\n\n protected handlePointerleave(): void {\n if (this.hasSubmenu && this.open) {\n this.leaveTimeout = setTimeout(() => {\n delete this.leaveTimeout;\n if (this.closeOverlay) this.closeOverlay();\n }, POINTERLEAVE_TIMEOUT);\n }\n }\n\n /**\n * When there is a `change` event in the submenu for this item\n * then we \"click\" this item to cascade the selection up the\n * menu tree allowing all submenus between the initial selection\n * and the root of the tree to have their selection changes and\n * be closed.\n */\n protected handleSubmenuChange = (): void => {\n this.menuData.selectionRoot?.selectOrToggleItem(this);\n };\n\n protected handleSubmenuPointerenter = (): void => {\n if (this.leaveTimeout) {\n clearTimeout(this.leaveTimeout);\n delete this.leaveTimeout;\n }\n };\n\n public async openOverlay(): Promise<void> {\n if (!this.hasSubmenu || this.open || this.disabled) {\n return;\n }\n this.open = true;\n this.active = true;\n const submenu = (\n this.shadowRoot.querySelector(\n 'slot[name=\"submenu\"]'\n ) as HTMLSlotElement\n ).assignedElements()[0] as Menu;\n submenu.addEventListener(\n 'pointerenter',\n this.handleSubmenuPointerenter\n );\n submenu.addEventListener('change', this.handleSubmenuChange);\n const popover = document.createElement('sp-popover');\n const returnSubmenu = reparentChildren([submenu], popover, {\n position: 'beforeend',\n prepareCallback: (el) => {\n const slotName = el.slot;\n el.tabIndex = 0;\n el.removeAttribute('slot');\n el.isSubmenu = true;\n return (el) => {\n el.tabIndex = -1;\n el.slot = slotName;\n el.isSubmenu = false;\n };\n },\n });\n const closeOverlay = openOverlay(this, 'click', popover, {\n placement: this.isLTR ? 'right-start' : 'left-start',\n receivesFocus: 'auto',\n root: this.menuData.focusRoot,\n });\n const closeSubmenu = async (): Promise<void> => {\n delete this.closeOverlay;\n (await closeOverlay)();\n };\n this.closeOverlay = closeSubmenu;\n const cleanup = (event: CustomEvent<OverlayOpenCloseDetail>): void => {\n event.stopPropagation();\n delete this.closeOverlay;\n returnSubmenu();\n this.open = false;\n this.active = false;\n };\n this.addEventListener('sp-closed', cleanup as EventListener, {\n once: true,\n });\n popover.addEventListener('change', closeSubmenu);\n }\n\n updateAriaSelected(): void {\n const role = this.getAttribute('role');\n if (role === 'option') {\n this.setAttribute(\n 'aria-selected',\n this.selected ? 'true' : 'false'\n );\n } else if (role === 'menuitemcheckbox' || role === 'menuitemradio') {\n this.setAttribute('aria-checked', this.selected ? 'true' : 'false');\n }\n }\n\n public setRole(role: string): void {\n this.setAttribute('role', role);\n this.updateAriaSelected();\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n super.updated(changes);\n if (changes.has('label')) {\n this.setAttribute('aria-label', this.label || '');\n }\n if (changes.has('active')) {\n if (this.active) {\n this.addEventListener('pointerup', this.handleRemoveActive);\n this.addEventListener('pointerleave', this.handleRemoveActive);\n this.addEventListener('pointercancel', this.handleRemoveActive);\n } else {\n this.removeEventListener('pointerup', this.handleRemoveActive);\n this.removeEventListener(\n 'pointerleave',\n this.handleRemoveActive\n );\n this.removeEventListener(\n 'pointercancel',\n this.handleRemoveActive\n );\n }\n }\n if (this.anchorElement) {\n this.anchorElement.addEventListener('focus', this.proxyFocus);\n this.anchorElement.tabIndex = -1;\n }\n if (changes.has('selected')) {\n this.updateAriaSelected();\n }\n if (changes.has('hasSubmenu')) {\n if (this.hasSubmenu) {\n this.addEventListener('click', this.handleSubmenuClick);\n this.addEventListener('pointerenter', this.handlePointerenter);\n this.addEventListener('pointerleave', this.handlePointerleave);\n } else if (!this.closeOverlay) {\n this.removeEventListener('click', this.handleSubmenuClick);\n this.removeEventListener(\n 'pointerenter',\n this.handlePointerenter\n );\n this.removeEventListener(\n 'pointerleave',\n this.handlePointerleave\n );\n }\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.isInSubmenu = !!this.closest('[slot=\"submenu\"]');\n if (this.isInSubmenu) {\n return;\n }\n addOrUpdateEvent.reset(this);\n this.dispatchEvent(addOrUpdateEvent);\n this._parentElement = this.parentElement as HTMLElement;\n }\n\n _parentElement!: HTMLElement;\n\n public override disconnectedCallback(): void {\n removeEvent.reset(this);\n if (!this.isInSubmenu) {\n this._parentElement?.dispatchEvent(removeEvent);\n }\n this.isInSubmenu = false;\n super.disconnectedCallback();\n }\n\n public async triggerUpdate(): Promise<void> {\n if (this.isInSubmenu) {\n return;\n }\n await new Promise((ready) => requestAnimationFrame(ready));\n addOrUpdateEvent.reset(this);\n this.dispatchEvent(addOrUpdateEvent);\n }\n\n public menuData: {\n focusRoot?: Menu;\n selectionRoot?: Menu;\n } = {\n focusRoot: undefined,\n selectionRoot: undefined,\n };\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n 'sp-menu-item-added-or-updated': MenuItemAddedOrUpdatedEvent;\n 'sp-menu-item-removed': MenuItemRemovedEvent;\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,MAGG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,MAAO,kEACP,OAAS,cAAAC,MAAkB,qDAC3B,OAAS,aAAAC,MAAiB,mDAC1B,MAAO,gEACP,OAAOC,MAAmB,iEAC1B,OAAS,eAAAC,MAAmB,iDAC5B,OAAS,qBAAAC,MAAyB,yDAElC,OAAOC,MAAoB,qBAC3B,OAAOC,MAAqB,mEAG5B,OAAS,oBAAAC,MAAwB,2DACjC,OAAS,sBAAAC,MAA0B,6CAMnC,MAAMC,EAAuB,IAEtB,aAAM,6BAA6B,KAAM,CAC5C,aAAc,CACV,MAAM,uBAAwB,CAC1B,QAAS,GACT,SAAU,EACd,CAAC,EAML,aAAU,EALV,CACA,IAAI,MAAiB,CACjB,OAAO,KAAK,KAChB,CAGA,MAAMC,EAAsB,CACxB,KAAK,MAAQA,CACjB,CACJ,CAEO,aAAM,oCAAoC,KAAM,CACnD,aAAc,CACV,MAAM,gCAAiC,CACnC,QAAS,GACT,SAAU,EACd,CAAC,CACL,CACA,IAAI,UAAUC,EAAwB,CAClC,KAAK,KAAK,SAAS,UAAY,KAAK,KAAK,SAAS,WAAa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K,cACNE,EAAA,KAAK,iBAAL,MAAAA,EAAqB,cAAcF,GAEvC,KAAK,YAAc,GACnB,MAAM,qBAAqB,CAC/B,CAEA,MAAa,eAA+B,CACpC,KAAK,cAGT,MAAM,IAAI,QAAS2B,GAAU,sBAAsBA,CAAK,CAAC,EACzD5B,EAAiB,MAAM,IAAI,EAC3B,KAAK,cAAcA,CAAgB,EACvC,CASJ,EApbO,WAAM,SAANE,EAAM,SAKF,cAAgB,EAKhB2B,EAAA,CADN5C,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GATjC,SAUF,sBAGA4C,EAAA,CADN5C,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAZjC,SAaF,uBAGA4C,EAAA,CADN5C,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAfjC,SAgBF,wBAGI4C,EAAA,CADV5C,EAAS,CAAE,KAAM,MAAO,CAAC,GAlBjB,SAmBE,qBA6BJ4C,EAAA,CADN5C,EAAS,CAAE,KAAM,OAAQ,CAAC,GA/ClB,SAgDF,0BAUA4C,EAAA,CARN5C,EAAS,CACN,KAAM,QACN,QAAS,GACT,UAAW,UACX,YAAa,CACT,MAAO,EACX,CACJ,CAAC,GAzDQ,SA0DF,sBAGC4C,EAAA,CADP3C,EAAM,SAAS,GA5DP,SA6DD,6BAwDD2C,EAAA,CADN5C,EAAS,CAAE,KAAM,OAAQ,CAAC,GApHlB,SAqHF",
|
|
6
|
+
"names": ["html", "property", "query", "LikeAnchor", "Focusable", "chevronStyles", "openOverlay", "OverlayCloseEvent", "menuItemStyles", "checkmarkStyles", "reparentChildren", "MutationController", "POINTERLEAVE_TIMEOUT", "item", "root", "ancestor", "addOrUpdateEvent", "removeEvent", "_MenuItem", "_a", "value", "acc", "node", "_b", "iconSlot", "icon", "element", "newElement", "contentSlot", "content", "event", "handled", "assignedElements", "changes", "overalyCloseEvent", "submenu", "popover", "returnSubmenu", "el", "slotName", "closeOverlay", "closeSubmenu", "cleanup", "role", "ready", "__decorateClass"]
|
|
7
7
|
}
|
package/src/menu-item.css.dev.js
CHANGED
|
@@ -60,7 +60,7 @@ var(--spectrum-global-dimension-size-225)
|
|
|
60
60
|
--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)
|
|
61
61
|
);color:var(
|
|
62
62
|
--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)
|
|
63
|
-
)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}
|
|
63
|
+
)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}
|
|
64
64
|
`;
|
|
65
65
|
export default styles;
|
|
66
66
|
//# sourceMappingURL=menu-item.css.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-item.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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.checkmark{align-self:flex-start;display:none;opacity:1;transform:scale(1)}:host([dir=ltr]) .checkmark{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.checkmark{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.chevron{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]){border-left:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host([dir=rtl]){border-right:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:var(--spectrum-listitem-texticon-text-size);font-style:normal;font-weight:var(--spectrum-listitem-texticon-text-font-weight);margin:0;min-height:var(--spectrum-listitem-texticon-height);padding:var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-right) var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-left);position:relative;-webkit-text-decoration:none;text-decoration:none}:host(:focus){outline:none}:host([dir=ltr][selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([selected]) .checkmark{display:block}.icon,::slotted([slot=icon]){align-self:flex-start;flex-shrink:0}:host([dir=ltr]) .icon+#label,:host([dir=ltr]) [name=icon]+#label{margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .icon+#label,:host([dir=rtl]) [name=icon]+#label{margin-right:var(--spectrum-listitem-texticon-icon-gap)}.icon+#label,[name=icon]+#label{width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap) - var(--spectrum-listitem-textthumbnail-padding-left) - var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n))}#label{flex:auto}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([dir=ltr]) .checkmark,:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark,:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{transform:matrix(-1,0,0,1,0,0)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-listitem-m-texticon-text-color,var(--spectrum-alias-component-text-color-default)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr]:focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl]:focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host .is-highlighted,:host .is-open,:host(:focus),:host(:hover){background-color:var(\n--spectrum-listitem-m-texticon-background-color-hover,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-hover,var(--spectrum-alias-component-text-color-hover)\n)}:host([selected]){color:var(\n--spectrum-listitem-m-texticon-text-color-selected,var(--spectrum-alias-component-text-color-default)\n)}:host([selected]) .checkmark{color:var(\n--spectrum-listitem-m-texticon-ui-icon-color-selected,var(--spectrum-alias-icon-color-selected)\n)}:host([active]),:host:active{background-color:var(\n--spectrum-listitem-m-texticon-background-color-down,var(--spectrum-alias-background-color-hover-overlay)\n)}:host([disabled]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);background-image:none;color:var(\n--spectrum-listitem-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n);cursor:default}@media (forced-colors:active){:host{--spectrum-listheading-text-color:ButtonText;--spectrum-listitem-m-texticon-background-color:ButtonFace;--spectrum-listitem-m-texticon-background-color-disabled:ButtonFace;--spectrum-listitem-m-texticon-background-color-down:ButtonFace;--spectrum-listitem-m-texticon-background-color-hover:Highlight;--spectrum-listitem-m-texticon-background-color-key-focus:Highlight;--spectrum-listitem-m-texticon-focus-indicator-color:Highlight;--spectrum-listitem-m-texticon-text-color:ButtonText;--spectrum-listitem-m-texticon-text-color-disabled:GrayText;--spectrum-listitem-m-texticon-text-color-hover:HighlightText;--spectrum-listitem-m-texticon-text-color-key-focus:HighlightText;--spectrum-listitem-m-texticon-text-color-selected:ButtonText;--spectrum-listitem-m-texticon-ui-icon-color-selected:Highlight;forced-color-adjust:none}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]).focus-visible),:host(:not([disabled]):focus),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]):focus),:host(:not([disabled]):focus-visible),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}::slotted([slot=submenu]){max-width:100%;width:max-content}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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.checkmark{align-self:flex-start;display:none;opacity:1;transform:scale(1)}:host([dir=ltr]) .checkmark{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.checkmark{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.chevron{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]){border-left:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host([dir=rtl]){border-right:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:var(--spectrum-listitem-texticon-text-size);font-style:normal;font-weight:var(--spectrum-listitem-texticon-text-font-weight);margin:0;min-height:var(--spectrum-listitem-texticon-height);padding:var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-right) var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-left);position:relative;-webkit-text-decoration:none;text-decoration:none}:host(:focus){outline:none}:host([dir=ltr][selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([selected]) .checkmark{display:block}.icon,::slotted([slot=icon]){align-self:flex-start;flex-shrink:0}:host([dir=ltr]) .icon+#label,:host([dir=ltr]) [name=icon]+#label{margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .icon+#label,:host([dir=rtl]) [name=icon]+#label{margin-right:var(--spectrum-listitem-texticon-icon-gap)}.icon+#label,[name=icon]+#label{width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap) - var(--spectrum-listitem-textthumbnail-padding-left) - var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n))}#label{flex:auto}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([dir=ltr]) .checkmark,:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark,:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{transform:matrix(-1,0,0,1,0,0)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-listitem-m-texticon-text-color,var(--spectrum-alias-component-text-color-default)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr]:focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl]:focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host .is-highlighted,:host .is-open,:host(:focus),:host(:hover){background-color:var(\n--spectrum-listitem-m-texticon-background-color-hover,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-hover,var(--spectrum-alias-component-text-color-hover)\n)}:host([selected]){color:var(\n--spectrum-listitem-m-texticon-text-color-selected,var(--spectrum-alias-component-text-color-default)\n)}:host([selected]) .checkmark{color:var(\n--spectrum-listitem-m-texticon-ui-icon-color-selected,var(--spectrum-alias-icon-color-selected)\n)}:host([active]),:host:active{background-color:var(\n--spectrum-listitem-m-texticon-background-color-down,var(--spectrum-alias-background-color-hover-overlay)\n)}:host([disabled]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);background-image:none;color:var(\n--spectrum-listitem-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n);cursor:default}@media (forced-colors:active){:host{--spectrum-listheading-text-color:ButtonText;--spectrum-listitem-m-texticon-background-color:ButtonFace;--spectrum-listitem-m-texticon-background-color-disabled:ButtonFace;--spectrum-listitem-m-texticon-background-color-down:ButtonFace;--spectrum-listitem-m-texticon-background-color-hover:Highlight;--spectrum-listitem-m-texticon-background-color-key-focus:Highlight;--spectrum-listitem-m-texticon-focus-indicator-color:Highlight;--spectrum-listitem-m-texticon-text-color:ButtonText;--spectrum-listitem-m-texticon-text-color-disabled:GrayText;--spectrum-listitem-m-texticon-text-color-hover:HighlightText;--spectrum-listitem-m-texticon-text-color-key-focus:HighlightText;--spectrum-listitem-m-texticon-text-color-selected:ButtonText;--spectrum-listitem-m-texticon-ui-icon-color-selected:Highlight;forced-color-adjust:none}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]).focus-visible),:host(:not([disabled]):focus),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]):focus),:host(:not([disabled]):focus-visible),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8Df,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/menu-item.css.js
CHANGED
|
@@ -58,6 +58,6 @@ var(--spectrum-global-dimension-size-225)
|
|
|
58
58
|
--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)
|
|
59
59
|
);color:var(
|
|
60
60
|
--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)
|
|
61
|
-
)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}
|
|
61
|
+
)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}
|
|
62
62
|
`;export default o;
|
|
63
63
|
//# sourceMappingURL=menu-item.css.js.map
|
package/src/menu-item.css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu-item.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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.checkmark{align-self:flex-start;display:none;opacity:1;transform:scale(1)}:host([dir=ltr]) .checkmark{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.checkmark{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.chevron{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]){border-left:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host([dir=rtl]){border-right:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:var(--spectrum-listitem-texticon-text-size);font-style:normal;font-weight:var(--spectrum-listitem-texticon-text-font-weight);margin:0;min-height:var(--spectrum-listitem-texticon-height);padding:var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-right) var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-left);position:relative;-webkit-text-decoration:none;text-decoration:none}:host(:focus){outline:none}:host([dir=ltr][selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([selected]) .checkmark{display:block}.icon,::slotted([slot=icon]){align-self:flex-start;flex-shrink:0}:host([dir=ltr]) .icon+#label,:host([dir=ltr]) [name=icon]+#label{margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .icon+#label,:host([dir=rtl]) [name=icon]+#label{margin-right:var(--spectrum-listitem-texticon-icon-gap)}.icon+#label,[name=icon]+#label{width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap) - var(--spectrum-listitem-textthumbnail-padding-left) - var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n))}#label{flex:auto}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([dir=ltr]) .checkmark,:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark,:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{transform:matrix(-1,0,0,1,0,0)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-listitem-m-texticon-text-color,var(--spectrum-alias-component-text-color-default)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr]:focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl]:focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host .is-highlighted,:host .is-open,:host(:focus),:host(:hover){background-color:var(\n--spectrum-listitem-m-texticon-background-color-hover,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-hover,var(--spectrum-alias-component-text-color-hover)\n)}:host([selected]){color:var(\n--spectrum-listitem-m-texticon-text-color-selected,var(--spectrum-alias-component-text-color-default)\n)}:host([selected]) .checkmark{color:var(\n--spectrum-listitem-m-texticon-ui-icon-color-selected,var(--spectrum-alias-icon-color-selected)\n)}:host([active]),:host:active{background-color:var(\n--spectrum-listitem-m-texticon-background-color-down,var(--spectrum-alias-background-color-hover-overlay)\n)}:host([disabled]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);background-image:none;color:var(\n--spectrum-listitem-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n);cursor:default}@media (forced-colors:active){:host{--spectrum-listheading-text-color:ButtonText;--spectrum-listitem-m-texticon-background-color:ButtonFace;--spectrum-listitem-m-texticon-background-color-disabled:ButtonFace;--spectrum-listitem-m-texticon-background-color-down:ButtonFace;--spectrum-listitem-m-texticon-background-color-hover:Highlight;--spectrum-listitem-m-texticon-background-color-key-focus:Highlight;--spectrum-listitem-m-texticon-focus-indicator-color:Highlight;--spectrum-listitem-m-texticon-text-color:ButtonText;--spectrum-listitem-m-texticon-text-color-disabled:GrayText;--spectrum-listitem-m-texticon-text-color-hover:HighlightText;--spectrum-listitem-m-texticon-text-color-key-focus:HighlightText;--spectrum-listitem-m-texticon-text-color-selected:ButtonText;--spectrum-listitem-m-texticon-ui-icon-color-selected:Highlight;forced-color-adjust:none}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]).focus-visible),:host(:not([disabled]):focus),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]):focus),:host(:not([disabled]):focus-visible),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}::slotted([slot=submenu]){max-width:100%;width:max-content}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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.checkmark{align-self:flex-start;display:none;opacity:1;transform:scale(1)}:host([dir=ltr]) .checkmark{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.checkmark{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}.chevron{flex-grow:0;margin-top:calc(var(--spectrum-listitem-texticon-ui-icon-margin-top) - var(--spectrum-listitem-texticon-padding-y) + 1px)}:host([dir=ltr]){border-left:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host([dir=rtl]){border-right:var(--spectrum-listitem-texticon-focus-indicator-size) solid transparent}:host{align-items:center;box-sizing:border-box;cursor:pointer;display:flex;font-size:var(--spectrum-listitem-texticon-text-size);font-style:normal;font-weight:var(--spectrum-listitem-texticon-text-font-weight);margin:0;min-height:var(--spectrum-listitem-texticon-height);padding:var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-right) var(--spectrum-listitem-texticon-padding-y) var(--spectrum-listitem-texticon-padding-left);position:relative;-webkit-text-decoration:none;text-decoration:none}:host(:focus){outline:none}:host([dir=ltr][selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([selected]) .checkmark{display:block}.icon,::slotted([slot=icon]){align-self:flex-start;flex-shrink:0}:host([dir=ltr]) .icon+#label,:host([dir=ltr]) [name=icon]+#label{margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .icon+#label,:host([dir=rtl]) [name=icon]+#label{margin-right:var(--spectrum-listitem-texticon-icon-gap)}.icon+#label,[name=icon]+#label{width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap) - var(--spectrum-listitem-textthumbnail-padding-left) - var(\n--spectrum-alias-workflow-icon-size-m,\nvar(--spectrum-global-dimension-size-225)\n))}#label{flex:auto}:host([no-wrap]) #label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([dir=ltr]) .checkmark,:host([dir=ltr]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .checkmark,:host([dir=rtl]) .chevron{padding-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) .chevron{transform:matrix(-1,0,0,1,0,0)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-listitem-m-texticon-text-color,var(--spectrum-alias-component-text-color-default)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr].focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=ltr]:focus-visible),:host([dir=ltr][focused]){border-left-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl].focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host([dir=rtl]:focus-visible),:host([dir=rtl][focused]){border-right-color:var(\n--spectrum-listitem-m-texticon-focus-indicator-color,var(--spectrum-alias-border-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(.focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:focus-visible),:host([focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host .is-highlighted,:host .is-open,:host(:focus),:host(:hover){background-color:var(\n--spectrum-listitem-m-texticon-background-color-hover,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-hover,var(--spectrum-alias-component-text-color-hover)\n)}:host([selected]){color:var(\n--spectrum-listitem-m-texticon-text-color-selected,var(--spectrum-alias-component-text-color-default)\n)}:host([selected]) .checkmark{color:var(\n--spectrum-listitem-m-texticon-ui-icon-color-selected,var(--spectrum-alias-icon-color-selected)\n)}:host([active]),:host:active{background-color:var(\n--spectrum-listitem-m-texticon-background-color-down,var(--spectrum-alias-background-color-hover-overlay)\n)}:host([disabled]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-disabled,var(--spectrum-alias-background-color-transparent)\n);background-image:none;color:var(\n--spectrum-listitem-m-texticon-text-color-disabled,var(--spectrum-alias-component-text-color-disabled)\n);cursor:default}@media (forced-colors:active){:host{--spectrum-listheading-text-color:ButtonText;--spectrum-listitem-m-texticon-background-color:ButtonFace;--spectrum-listitem-m-texticon-background-color-disabled:ButtonFace;--spectrum-listitem-m-texticon-background-color-down:ButtonFace;--spectrum-listitem-m-texticon-background-color-hover:Highlight;--spectrum-listitem-m-texticon-background-color-key-focus:Highlight;--spectrum-listitem-m-texticon-focus-indicator-color:Highlight;--spectrum-listitem-m-texticon-text-color:ButtonText;--spectrum-listitem-m-texticon-text-color-disabled:GrayText;--spectrum-listitem-m-texticon-text-color-hover:HighlightText;--spectrum-listitem-m-texticon-text-color-key-focus:HighlightText;--spectrum-listitem-m-texticon-text-color-selected:ButtonText;--spectrum-listitem-m-texticon-ui-icon-color-selected:Highlight;forced-color-adjust:none}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]).focus-visible),:host(:not([disabled]):focus),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled])) .is-highlighted,:host(:not([disabled])) .is-open,:host(:not([disabled]):focus),:host(:not([disabled]):focus-visible),:host(:not([disabled]):hover),:host(:not([disabled])[focused]){background-color:var(\n--spectrum-listitem-m-texticon-background-color-key-focus,var(--spectrum-alias-background-color-hover-overlay)\n);color:var(\n--spectrum-listitem-m-texticon-text-color-key-focus,var(--spectrum-alias-component-text-color-key-focus)\n)}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]).focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}:host(:not([disabled]):focus-visible[selected]) .checkmark,:host(:not([disabled])[focused][selected]) .checkmark,:host(:not([disabled])[selected]) .is-highlighted .checkmark,:host(:not([disabled])[selected]) .is-open .checkmark,:host(:not([disabled])[selected]:focus) .checkmark,:host(:not([disabled])[selected]:hover) .checkmark{color:HighlightText}}#label{flex:1 1 auto;-webkit-hyphens:auto;hyphens:auto;line-height:var(--spectrum-listitem-texticon-label-line-height);overflow-wrap:break-word;width:calc(100% - var(--spectrum-listitem-texticon-ui-icon-width) - var(--spectrum-listitem-texticon-icon-gap))}.spectrum-Menu-itemLabel--wrapping{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([hidden]){display:none}:host([disabled]){pointer-events:none}#button{inset:0;position:absolute}::slotted([slot=value]){align-self:start}:host([dir=ltr]) ::slotted([slot=value]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=value]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}:host([dir=ltr]) ::slotted([slot=icon]){margin-right:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) ::slotted([slot=icon]){margin-left:var(--spectrum-listitem-texticon-icon-gap)}:host([dir=rtl]) slot[name=icon]+#label{margin-right:0}:host([dir=ltr]) slot[name=icon]+#label{margin-left:0}:host([dir=rtl]) .chevron{padding-left:var(--spectrum-listitem-texticon-icon-gap);padding-right:0}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8Df,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/src/menu.css.dev.js
CHANGED
|
@@ -48,7 +48,7 @@ var(--spectrum-alias-border-size-thin)
|
|
|
48
48
|
var(--spectrum-alias-border-size-thin)
|
|
49
49
|
))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(
|
|
50
50
|
--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)
|
|
51
|
-
)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column}:host(:focus){outline:none}::slotted(*){flex-shrink:0}
|
|
51
|
+
)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column;width:var(--swc-menu-width)}:host(:focus){outline:none}::slotted(*){--swc-menu-width:100%;flex-shrink:0}
|
|
52
52
|
`;
|
|
53
53
|
export default styles;
|
|
54
54
|
//# sourceMappingURL=menu.css.dev.js.map
|
package/src/menu.css.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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-margin-x:var(--spectrum-global-dimension-size-40);--spectrum-listitem-texticon-heading-text-size:var(\n--spectrum-global-dimension-font-size-50\n);--spectrum-listitem-texticon-heading-text-font-weight:400;--spectrum-listitem-texticon-heading-text-transform:uppercase;--spectrum-listitem-texticon-heading-letter-spacing:0.06em;--spectrum-listitem-texticon-heading-margin:var(\n--spectrum-global-dimension-size-75\n) 0 0 0;--spectrum-listitem-texticon-heading-padding:0 var(--spectrum-global-dimension-size-450) 0 var(--spectrum-global-dimension-size-150);--spectrum-listitem-texticon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-listitem-texticon-selectable-padding-right:calc(var(--spectrum-listitem-texticon-ui-icon-width) + var(--spectrum-listitem-texticon-ui-icon-gap) + var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n));--spectrum-listitem-texticon-label-line-height:1.3;--spectrum-listitem-texticon-heading-line-height:var(\n--spectrum-alias-body-text-line-height,var(--spectrum-global-font-line-height-medium)\n)}:host{--spectrum-listitem-texticon-padding-left:var(\n--spectrum-listitem-m-texticon-padding-left\n);--spectrum-listitem-textthumbnail-padding-left:var(\n--spectrum-listitem-m-textthumbnail-padding-left\n);--spectrum-listitem-texticon-text-size:var(\n--spectrum-listitem-m-texticon-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-listitem-texticon-text-font-weight:var(\n--spectrum-listitem-m-texticon-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);--spectrum-listitem-texticon-icon-gap:var(\n--spectrum-listitem-m-texticon-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-divider-padding:var(\n--spectrum-listitem-m-texticon-divider-padding,var(--spectrum-global-dimension-static-size-40)\n);--spectrum-listitem-texticon-ui-icon-margin-top:var(\n--spectrum-listitem-m-texticon-ui-icon-margin-top,var(--spectrum-global-dimension-size-125)\n);--spectrum-listitem-texticon-ui-icon-width:var(\n--spectrum-listitem-m-texticon-ui-icon-width,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-listitem-texticon-ui-icon-gap:var(\n--spectrum-listitem-m-texticon-ui-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-padding-right:var(\n--spectrum-listitem-m-texticon-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-listitem-texticon-focus-indicator-size:var(\n--spectrum-listitem-m-texticon-focus-indicator-size,var(--spectrum-alias-border-size-thick)\n);--spectrum-listitem-texticon-height:var(\n--spectrum-listitem-m-texticon-height,var(--spectrum-global-dimension-size-400)\n)}:host{box-sizing:border-box;display:inline-block;list-style-type:none;margin-bottom:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);overflow:auto;padding:0}:host([dir=ltr][selects]) ::slotted(sp-menu-item){padding-right:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=rtl][selects]) ::slotted(sp-menu-item){padding-left:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=ltr][selects]) ::slotted(sp-menu-item[selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selects]) ::slotted(sp-menu-item[selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column}:host(:focus){outline:none}::slotted(*){flex-shrink:0}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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-margin-x:var(--spectrum-global-dimension-size-40);--spectrum-listitem-texticon-heading-text-size:var(\n--spectrum-global-dimension-font-size-50\n);--spectrum-listitem-texticon-heading-text-font-weight:400;--spectrum-listitem-texticon-heading-text-transform:uppercase;--spectrum-listitem-texticon-heading-letter-spacing:0.06em;--spectrum-listitem-texticon-heading-margin:var(\n--spectrum-global-dimension-size-75\n) 0 0 0;--spectrum-listitem-texticon-heading-padding:0 var(--spectrum-global-dimension-size-450) 0 var(--spectrum-global-dimension-size-150);--spectrum-listitem-texticon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-listitem-texticon-selectable-padding-right:calc(var(--spectrum-listitem-texticon-ui-icon-width) + var(--spectrum-listitem-texticon-ui-icon-gap) + var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n));--spectrum-listitem-texticon-label-line-height:1.3;--spectrum-listitem-texticon-heading-line-height:var(\n--spectrum-alias-body-text-line-height,var(--spectrum-global-font-line-height-medium)\n)}:host{--spectrum-listitem-texticon-padding-left:var(\n--spectrum-listitem-m-texticon-padding-left\n);--spectrum-listitem-textthumbnail-padding-left:var(\n--spectrum-listitem-m-textthumbnail-padding-left\n);--spectrum-listitem-texticon-text-size:var(\n--spectrum-listitem-m-texticon-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-listitem-texticon-text-font-weight:var(\n--spectrum-listitem-m-texticon-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);--spectrum-listitem-texticon-icon-gap:var(\n--spectrum-listitem-m-texticon-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-divider-padding:var(\n--spectrum-listitem-m-texticon-divider-padding,var(--spectrum-global-dimension-static-size-40)\n);--spectrum-listitem-texticon-ui-icon-margin-top:var(\n--spectrum-listitem-m-texticon-ui-icon-margin-top,var(--spectrum-global-dimension-size-125)\n);--spectrum-listitem-texticon-ui-icon-width:var(\n--spectrum-listitem-m-texticon-ui-icon-width,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-listitem-texticon-ui-icon-gap:var(\n--spectrum-listitem-m-texticon-ui-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-padding-right:var(\n--spectrum-listitem-m-texticon-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-listitem-texticon-focus-indicator-size:var(\n--spectrum-listitem-m-texticon-focus-indicator-size,var(--spectrum-alias-border-size-thick)\n);--spectrum-listitem-texticon-height:var(\n--spectrum-listitem-m-texticon-height,var(--spectrum-global-dimension-size-400)\n)}:host{box-sizing:border-box;display:inline-block;list-style-type:none;margin-bottom:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);overflow:auto;padding:0}:host([dir=ltr][selects]) ::slotted(sp-menu-item){padding-right:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=rtl][selects]) ::slotted(sp-menu-item){padding-left:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=ltr][selects]) ::slotted(sp-menu-item[selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selects]) ::slotted(sp-menu-item[selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column;width:var(--swc-menu-width)}:host(:focus){outline:none}::slotted(*){--swc-menu-width:100%;flex-shrink:0}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkDf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/menu.css.js
CHANGED
|
@@ -46,6 +46,6 @@ var(--spectrum-alias-border-size-thin)
|
|
|
46
46
|
var(--spectrum-alias-border-size-thin)
|
|
47
47
|
))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(
|
|
48
48
|
--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)
|
|
49
|
-
)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column}:host(:focus){outline:none}::slotted(*){flex-shrink:0}
|
|
49
|
+
)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column;width:var(--swc-menu-width)}:host(:focus){outline:none}::slotted(*){--swc-menu-width:100%;flex-shrink:0}
|
|
50
50
|
`;export default i;
|
|
51
51
|
//# sourceMappingURL=menu.css.js.map
|
package/src/menu.css.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["menu.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 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-margin-x:var(--spectrum-global-dimension-size-40);--spectrum-listitem-texticon-heading-text-size:var(\n--spectrum-global-dimension-font-size-50\n);--spectrum-listitem-texticon-heading-text-font-weight:400;--spectrum-listitem-texticon-heading-text-transform:uppercase;--spectrum-listitem-texticon-heading-letter-spacing:0.06em;--spectrum-listitem-texticon-heading-margin:var(\n--spectrum-global-dimension-size-75\n) 0 0 0;--spectrum-listitem-texticon-heading-padding:0 var(--spectrum-global-dimension-size-450) 0 var(--spectrum-global-dimension-size-150);--spectrum-listitem-texticon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-listitem-texticon-selectable-padding-right:calc(var(--spectrum-listitem-texticon-ui-icon-width) + var(--spectrum-listitem-texticon-ui-icon-gap) + var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n));--spectrum-listitem-texticon-label-line-height:1.3;--spectrum-listitem-texticon-heading-line-height:var(\n--spectrum-alias-body-text-line-height,var(--spectrum-global-font-line-height-medium)\n)}:host{--spectrum-listitem-texticon-padding-left:var(\n--spectrum-listitem-m-texticon-padding-left\n);--spectrum-listitem-textthumbnail-padding-left:var(\n--spectrum-listitem-m-textthumbnail-padding-left\n);--spectrum-listitem-texticon-text-size:var(\n--spectrum-listitem-m-texticon-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-listitem-texticon-text-font-weight:var(\n--spectrum-listitem-m-texticon-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);--spectrum-listitem-texticon-icon-gap:var(\n--spectrum-listitem-m-texticon-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-divider-padding:var(\n--spectrum-listitem-m-texticon-divider-padding,var(--spectrum-global-dimension-static-size-40)\n);--spectrum-listitem-texticon-ui-icon-margin-top:var(\n--spectrum-listitem-m-texticon-ui-icon-margin-top,var(--spectrum-global-dimension-size-125)\n);--spectrum-listitem-texticon-ui-icon-width:var(\n--spectrum-listitem-m-texticon-ui-icon-width,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-listitem-texticon-ui-icon-gap:var(\n--spectrum-listitem-m-texticon-ui-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-padding-right:var(\n--spectrum-listitem-m-texticon-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-listitem-texticon-focus-indicator-size:var(\n--spectrum-listitem-m-texticon-focus-indicator-size,var(--spectrum-alias-border-size-thick)\n);--spectrum-listitem-texticon-height:var(\n--spectrum-listitem-m-texticon-height,var(--spectrum-global-dimension-size-400)\n)}:host{box-sizing:border-box;display:inline-block;list-style-type:none;margin-bottom:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);overflow:auto;padding:0}:host([dir=ltr][selects]) ::slotted(sp-menu-item){padding-right:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=rtl][selects]) ::slotted(sp-menu-item){padding-left:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=ltr][selects]) ::slotted(sp-menu-item[selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selects]) ::slotted(sp-menu-item[selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column}:host(:focus){outline:none}::slotted(*){flex-shrink:0}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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-margin-x:var(--spectrum-global-dimension-size-40);--spectrum-listitem-texticon-heading-text-size:var(\n--spectrum-global-dimension-font-size-50\n);--spectrum-listitem-texticon-heading-text-font-weight:400;--spectrum-listitem-texticon-heading-text-transform:uppercase;--spectrum-listitem-texticon-heading-letter-spacing:0.06em;--spectrum-listitem-texticon-heading-margin:var(\n--spectrum-global-dimension-size-75\n) 0 0 0;--spectrum-listitem-texticon-heading-padding:0 var(--spectrum-global-dimension-size-450) 0 var(--spectrum-global-dimension-size-150);--spectrum-listitem-texticon-padding-y:var(\n--spectrum-global-dimension-size-85\n);--spectrum-listitem-texticon-selectable-padding-right:calc(var(--spectrum-listitem-texticon-ui-icon-width) + var(--spectrum-listitem-texticon-ui-icon-gap) + var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n));--spectrum-listitem-texticon-label-line-height:1.3;--spectrum-listitem-texticon-heading-line-height:var(\n--spectrum-alias-body-text-line-height,var(--spectrum-global-font-line-height-medium)\n)}:host{--spectrum-listitem-texticon-padding-left:var(\n--spectrum-listitem-m-texticon-padding-left\n);--spectrum-listitem-textthumbnail-padding-left:var(\n--spectrum-listitem-m-textthumbnail-padding-left\n);--spectrum-listitem-texticon-text-size:var(\n--spectrum-listitem-m-texticon-text-size,var(--spectrum-global-dimension-font-size-100)\n);--spectrum-listitem-texticon-text-font-weight:var(\n--spectrum-listitem-m-texticon-text-font-weight,var(--spectrum-alias-body-text-font-weight)\n);--spectrum-listitem-texticon-icon-gap:var(\n--spectrum-listitem-m-texticon-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-divider-padding:var(\n--spectrum-listitem-m-texticon-divider-padding,var(--spectrum-global-dimension-static-size-40)\n);--spectrum-listitem-texticon-ui-icon-margin-top:var(\n--spectrum-listitem-m-texticon-ui-icon-margin-top,var(--spectrum-global-dimension-size-125)\n);--spectrum-listitem-texticon-ui-icon-width:var(\n--spectrum-listitem-m-texticon-ui-icon-width,var(--spectrum-alias-ui-icon-checkmark-size-100)\n);--spectrum-listitem-texticon-ui-icon-gap:var(\n--spectrum-listitem-m-texticon-ui-icon-gap,var(--spectrum-global-dimension-size-100)\n);--spectrum-listitem-texticon-padding-right:var(\n--spectrum-listitem-m-texticon-padding-right,var(--spectrum-global-dimension-size-150)\n);--spectrum-listitem-texticon-focus-indicator-size:var(\n--spectrum-listitem-m-texticon-focus-indicator-size,var(--spectrum-alias-border-size-thick)\n);--spectrum-listitem-texticon-height:var(\n--spectrum-listitem-m-texticon-height,var(--spectrum-global-dimension-size-400)\n)}:host{box-sizing:border-box;display:inline-block;list-style-type:none;margin-bottom:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);margin-left:0;margin-right:0;margin-top:var(\n--spectrum-popover-padding-y,var(--spectrum-global-dimension-size-50)\n);overflow:auto;padding:0}:host([dir=ltr][selects]) ::slotted(sp-menu-item){padding-right:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=rtl][selects]) ::slotted(sp-menu-item){padding-left:var(--spectrum-listitem-texticon-selectable-padding-right)}:host([dir=ltr][selects]) ::slotted(sp-menu-item[selected]){padding-right:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host([dir=rtl][selects]) ::slotted(sp-menu-item[selected]){padding-left:calc(var(--spectrum-listitem-texticon-padding-right) - var(\n--spectrum-popover-border-size,\nvar(--spectrum-alias-border-size-thin)\n))}:host{--spectrum-listheading-text-color:var(--spectrum-global-color-gray-700)}:host{background-color:var(\n--spectrum-listitem-m-texticon-background-color,var(--spectrum-alias-background-color-transparent)\n)}:host{--spectrum-listitem-selectable-padding-right:calc(var(--spectrum-global-dimension-size-100) + var(--spectrum-icon-checkmark-medium-width) + var(--spectrum-listitem-icon-gap));display:inline-flex;flex-direction:column;width:var(--swc-menu-width)}:host(:focus){outline:none}::slotted(*){--swc-menu-width:100%;flex-shrink:0}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkDf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { html, render } from "@spectrum-web-components/base";
|
|
3
3
|
import "@spectrum-web-components/action-menu/sp-action-menu.js";
|
|
4
|
-
import "@spectrum-web-components/menu/sp-menu.js";
|
|
5
4
|
import "@spectrum-web-components/menu/sp-menu-item.js";
|
|
6
5
|
import "@spectrum-web-components/menu/sp-menu-divider.js";
|
|
7
6
|
import "@spectrum-web-components/menu/sp-menu-group.js";
|
|
@@ -19,37 +18,34 @@ class SubmenuReady extends HTMLElement {
|
|
|
19
18
|
constructor() {
|
|
20
19
|
super();
|
|
21
20
|
this.handleMenuOpened = async (event) => {
|
|
22
|
-
this.menu.removeEventListener("sp-opened", this.handleMenuOpened);
|
|
23
21
|
await nextFrame();
|
|
24
22
|
await event.target.updateComplete;
|
|
25
|
-
|
|
26
|
-
if (!
|
|
23
|
+
const submenu2 = document.querySelector("#submenu-item-1");
|
|
24
|
+
if (!submenu2) {
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
submenu2.addEventListener("sp-opened", this.handleSubmenuOpened, {
|
|
28
|
+
once: true
|
|
29
|
+
});
|
|
30
|
+
submenu2.dispatchEvent(
|
|
31
|
+
new PointerEvent("pointerenter", { bubbles: true, composed: true })
|
|
32
|
+
);
|
|
31
33
|
};
|
|
32
34
|
this.handleSubmenuOpened = async (event) => {
|
|
33
|
-
this.submenu.removeEventListener("sp-opened", this.handleSubmenuOpened);
|
|
34
35
|
await nextFrame();
|
|
35
36
|
await event.target.updateComplete;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
);
|
|
39
|
-
if (!this.submenuChild) {
|
|
37
|
+
const submenu2 = document.querySelector("#submenu-item-2");
|
|
38
|
+
if (!submenu2) {
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
submenu2.addEventListener("sp-opened", this.handleSubmenuChildOpened, {
|
|
42
|
+
once: true
|
|
43
|
+
});
|
|
44
|
+
submenu2.dispatchEvent(
|
|
45
|
+
new PointerEvent("pointerenter", { bubbles: true, composed: true })
|
|
45
46
|
);
|
|
46
|
-
this.submenuChild.click();
|
|
47
47
|
};
|
|
48
48
|
this.handleSubmenuChildOpened = async (event) => {
|
|
49
|
-
this.submenuChild.removeEventListener(
|
|
50
|
-
"sp-opened",
|
|
51
|
-
this.handleSubmenuChildOpened
|
|
52
|
-
);
|
|
53
49
|
await nextFrame();
|
|
54
50
|
await event.target.updateComplete;
|
|
55
51
|
this.ready(true);
|
|
@@ -62,9 +58,11 @@ class SubmenuReady extends HTMLElement {
|
|
|
62
58
|
}
|
|
63
59
|
async setup() {
|
|
64
60
|
await nextFrame();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
const menu = document.querySelector(`sp-action-menu`);
|
|
62
|
+
menu.addEventListener("sp-opened", this.handleMenuOpened, {
|
|
63
|
+
once: true
|
|
64
|
+
});
|
|
65
|
+
menu.open = true;
|
|
68
66
|
}
|
|
69
67
|
get updateComplete() {
|
|
70
68
|
return this.readyPromise;
|
|
@@ -268,12 +266,8 @@ export const contextMenu = () => {
|
|
|
268
266
|
valueEls.first.textContent = "";
|
|
269
267
|
};
|
|
270
268
|
const handleRootChange = (event) => {
|
|
271
|
-
var _a;
|
|
272
269
|
const valueEls = getValueEls();
|
|
273
270
|
valueEls.root.textContent = event.target.value;
|
|
274
|
-
(_a = event.target.parentElement) == null ? void 0 : _a.dispatchEvent(
|
|
275
|
-
new Event("close", { bubbles: true })
|
|
276
|
-
);
|
|
277
271
|
};
|
|
278
272
|
const handleFirstDescendantChange = (event) => {
|
|
279
273
|
const valueEls = getValueEls();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["submenu.stories.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 { html, render, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport { openOverlay, VirtualTrigger } from '@spectrum-web-components/overlay';\nimport type { Popover } from '@spectrum-web-components/popover';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\nimport type { ActionMenu } from '@spectrum-web-components/action-menu';\nimport type { Menu, MenuItem } from '@spectrum-web-components/menu';\n\nexport default {\n component: 'sp-menu',\n title: 'Menu/Submenu',\n};\n\nfunction nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\nclass SubmenuReady extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n constructor() {\n super();\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n this.setup();\n });\n }\n\n menu!: ActionMenu;\n submenu!: MenuItem;\n submenuChild!: MenuItem;\n\n async setup(): Promise<void> {\n await nextFrame();\n\n this.menu = document.querySelector(`sp-action-menu`) as ActionMenu;\n this.menu.addEventListener('sp-opened', this.handleMenuOpened);\n this.menu.open = true;\n }\n\n handleMenuOpened = async (event: Event): Promise<void> => {\n this.menu.removeEventListener('sp-opened', this.handleMenuOpened);\n await nextFrame();\n await (event.target as ActionMenu).updateComplete;\n\n this.submenu = document.querySelector('#submenu-item-1') as MenuItem;\n if (!this.submenu) {\n return;\n }\n\n this.submenu.addEventListener('sp-opened', this.handleSubmenuOpened);\n this.submenu.click();\n };\n\n handleSubmenuOpened = async (event: Event): Promise<void> => {\n this.submenu.removeEventListener('sp-opened', this.handleSubmenuOpened);\n await nextFrame();\n await (event.target as MenuItem).updateComplete;\n\n this.submenuChild = document.querySelector(\n '#submenu-item-2'\n ) as MenuItem;\n if (!this.submenuChild) {\n return;\n }\n this.submenuChild.addEventListener(\n 'sp-opened',\n this.handleSubmenuChildOpened\n );\n this.submenuChild.click();\n };\n\n handleSubmenuChildOpened = async (event: Event): Promise<void> => {\n this.submenuChild.removeEventListener(\n 'sp-opened',\n this.handleSubmenuChildOpened\n );\n await nextFrame();\n await (event.target as MenuItem).updateComplete;\n\n this.ready(true);\n };\n\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('submenu-ready', SubmenuReady);\n\nconst submenuDecorator = (story: () => TemplateResult): TemplateResult => {\n return html`\n ${story()}\n <submenu-ready></submenu-ready>\n `;\n};\n\nexport const submenu = (): TemplateResult => {\n const getValueEls = (): {\n root: HTMLElement;\n first: HTMLElement;\n second: HTMLElement;\n } => {\n return {\n root: document.querySelector('#root-value') as HTMLElement,\n first: document.querySelector('#first-value') as HTMLElement,\n second: document.querySelector('#second-value') as HTMLElement,\n };\n };\n const clearValues = (): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = '';\n valueEls.first.textContent = '';\n valueEls.second.textContent = '';\n };\n const handleRootChange = (event: Event & { target: ActionMenu }): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = event.target.value;\n };\n const handleFirstDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.first.textContent = event.target.selected[0] || '';\n };\n const handleSecondDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.second.textContent = event.target.selected[0] || '';\n };\n return html`\n <sp-action-menu @change=${handleRootChange} @sp-opened=${clearValues}>\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group\n @change=${() => console.log('group change')}\n role=\"none\"\n >\n <span slot=\"header\">New York</span>\n <sp-menu-item>Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu\n slot=\"submenu\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu\n slot=\"submenu\"\n @change=${handleSecondDescendantChange}\n >\n <sp-menu-item>S. Oxford St</sp-menu-item>\n <sp-menu-item>S. Portland Ave</sp-menu-item>\n <sp-menu-item>S. Elliot Pl</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item>Williamsburg</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>\n Manhattan\n <sp-menu\n slot=\"submenu\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu\n slot=\"submenu\"\n @change=${handleSecondDescendantChange}\n >\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n <div>\n Root value:\n <span id=\"root-value\"></span>\n <br />\n First descendant value:\n <span id=\"first-value\"></span>\n <br />\n Second descendant value:\n <span id=\"second-value\"></span>\n <br />\n </div>\n `;\n};\n\nsubmenu.decorators = [submenuDecorator];\n\nexport const contextMenu = (): TemplateResult => {\n const contextMenuTemplate = (): TemplateResult => html`\n <sp-popover\n style=\"max-width: 33vw;\"\n @click=${(event: Event) =>\n event.target?.dispatchEvent(\n new Event('close', { bubbles: true })\n )}\n >\n <sp-menu @change=${handleRootChange}>\n <sp-menu-group>\n <span slot=\"header\">Options</span>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>\n <sp-menu-item>\n Paste\n <span slot=\"value\">\u2318\u200BP</span>\n </sp-menu-item>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Select layer\n <sp-menu\n slot=\"submenu\"\n selects=\"single\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item selected>Ellipse 1</sp-menu-item>\n <sp-menu-item>Rectangle</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>\n Group\n <span slot=\"value\">\u2318\u200BG</span>\n </sp-menu-item>\n <sp-menu-item>\n Unlock\n <span slot=\"value\">\u2318\u200BL</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Bring to front\n <span slot=\"value\">\u21E7\u200B\u2318\u200B\u200B]</span>\n </sp-menu-item>\n <sp-menu-item>\n Bring forward\n <span slot=\"value\">\u2318\u200B\u200B]</span>\n </sp-menu-item>\n <sp-menu-item>\n Send backward\n <span slot=\"value\">\u2318\u200B\u200B[</span>\n </sp-menu-item>\n <sp-menu-item>\n Send to back\n <span slot=\"value\">\u21E7\u200B\u2318\u200B\u200B[</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Delete\n <span slot=\"value\">DEL</span>\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n const pointerenter = async (event: PointerEvent): Promise<void> => {\n event.preventDefault();\n const trigger = event.target as HTMLElement;\n const virtualTrigger = new VirtualTrigger(event.clientX, event.clientY);\n const fragment = document.createDocumentFragment();\n render(contextMenuTemplate(), fragment);\n const popover = fragment.querySelector('sp-popover') as Popover;\n clearValues();\n openOverlay(trigger, 'modal', popover, {\n placement: 'right-start',\n receivesFocus: 'auto',\n virtualTrigger,\n });\n };\n const getValueEls = (): { root: HTMLElement; first: HTMLElement } => {\n return {\n root: document.querySelector('#root-value') as HTMLElement,\n first: document.querySelector('#first-value') as HTMLElement,\n };\n };\n const clearValues = (): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = '';\n valueEls.first.textContent = '';\n };\n const handleRootChange = (event: Event & { target: ActionMenu }): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = event.target.value;\n event.target.parentElement?.dispatchEvent(\n new Event('close', { bubbles: true })\n );\n };\n const handleFirstDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.first.textContent = event.target.selected[0] || '';\n };\n return html`\n <style>\n .app-root {\n position: absolute;\n inset: 0;\n }\n active-overlay::part(theme) {\n --swc-menu-width: 200px;\n }\n </style>\n <div class=\"app-root\" @contextmenu=${pointerenter}>\n <div>\n Root value:\n <span id=\"root-value\"></span>\n <br />\n First descendant value:\n <span id=\"first-value\"></span>\n <br />\n </div>\n </div>\n `;\n};\n"],
|
|
5
|
-
"mappings": ";AAYA,SAAS,MAAM,cAA8B;AAE7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,
|
|
6
|
-
"names": []
|
|
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 { html, render, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/action-menu/sp-action-menu.js';\nimport '@spectrum-web-components/menu/sp-menu-item.js';\nimport '@spectrum-web-components/menu/sp-menu-divider.js';\nimport '@spectrum-web-components/menu/sp-menu-group.js';\nimport { openOverlay, VirtualTrigger } from '@spectrum-web-components/overlay';\nimport type { Popover } from '@spectrum-web-components/popover';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-show-menu.js';\nimport type { ActionMenu } from '@spectrum-web-components/action-menu';\nimport type { Menu, MenuItem } from '@spectrum-web-components/menu';\n\nexport default {\n component: 'sp-menu',\n title: 'Menu/Submenu',\n};\n\nfunction nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\nclass SubmenuReady extends HTMLElement {\n ready!: (value: boolean | PromiseLike<boolean>) => void;\n\n constructor() {\n super();\n this.readyPromise = new Promise((res) => {\n this.ready = res;\n this.setup();\n });\n }\n\n async setup(): Promise<void> {\n await nextFrame();\n\n const menu = document.querySelector(`sp-action-menu`) as ActionMenu;\n menu.addEventListener('sp-opened', this.handleMenuOpened, {\n once: true,\n });\n menu.open = true;\n }\n\n handleMenuOpened = async (event: Event): Promise<void> => {\n await nextFrame();\n await (event.target as ActionMenu).updateComplete;\n\n const submenu = document.querySelector('#submenu-item-1') as MenuItem;\n if (!submenu) {\n return;\n }\n submenu.addEventListener('sp-opened', this.handleSubmenuOpened, {\n once: true,\n });\n submenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true, composed: true })\n );\n };\n\n handleSubmenuOpened = async (event: Event): Promise<void> => {\n await nextFrame();\n await (event.target as MenuItem).updateComplete;\n\n const submenu = document.querySelector('#submenu-item-2') as MenuItem;\n if (!submenu) {\n return;\n }\n submenu.addEventListener('sp-opened', this.handleSubmenuChildOpened, {\n once: true,\n });\n submenu.dispatchEvent(\n new PointerEvent('pointerenter', { bubbles: true, composed: true })\n );\n };\n\n handleSubmenuChildOpened = async (event: Event): Promise<void> => {\n await nextFrame();\n await (event.target as MenuItem).updateComplete;\n\n this.ready(true);\n };\n\n private readyPromise: Promise<boolean> = Promise.resolve(false);\n\n get updateComplete(): Promise<boolean> {\n return this.readyPromise;\n }\n}\n\ncustomElements.define('submenu-ready', SubmenuReady);\n\nconst submenuDecorator = (story: () => TemplateResult): TemplateResult => {\n return html`\n ${story()}\n <submenu-ready></submenu-ready>\n `;\n};\n\nexport const submenu = (): TemplateResult => {\n const getValueEls = (): {\n root: HTMLElement;\n first: HTMLElement;\n second: HTMLElement;\n } => {\n return {\n root: document.querySelector('#root-value') as HTMLElement,\n first: document.querySelector('#first-value') as HTMLElement,\n second: document.querySelector('#second-value') as HTMLElement,\n };\n };\n const clearValues = (): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = '';\n valueEls.first.textContent = '';\n valueEls.second.textContent = '';\n };\n const handleRootChange = (event: Event & { target: ActionMenu }): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = event.target.value;\n };\n const handleFirstDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.first.textContent = event.target.selected[0] || '';\n };\n const handleSecondDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.second.textContent = event.target.selected[0] || '';\n };\n return html`\n <sp-action-menu @change=${handleRootChange} @sp-opened=${clearValues}>\n <sp-icon-show-menu slot=\"icon\"></sp-icon-show-menu>\n <sp-menu-group\n @change=${() => console.log('group change')}\n role=\"none\"\n >\n <span slot=\"header\">New York</span>\n <sp-menu-item>Bronx</sp-menu-item>\n <sp-menu-item id=\"submenu-item-1\">\n Brooklyn\n <sp-menu\n slot=\"submenu\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item id=\"submenu-item-2\">\n Ft. Greene\n <sp-menu\n slot=\"submenu\"\n @change=${handleSecondDescendantChange}\n >\n <sp-menu-item>S. Oxford St</sp-menu-item>\n <sp-menu-item>S. Portland Ave</sp-menu-item>\n <sp-menu-item>S. Elliot Pl</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item disabled>Park Slope</sp-menu-item>\n <sp-menu-item>Williamsburg</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>\n Manhattan\n <sp-menu\n slot=\"submenu\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item disabled>SoHo</sp-menu-item>\n <sp-menu-item>\n Union Square\n <sp-menu\n slot=\"submenu\"\n @change=${handleSecondDescendantChange}\n >\n <sp-menu-item>14th St</sp-menu-item>\n <sp-menu-item>Broadway</sp-menu-item>\n <sp-menu-item>Park Ave</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>Upper East Side</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n </sp-menu-group>\n </sp-action-menu>\n <div>\n Root value:\n <span id=\"root-value\"></span>\n <br />\n First descendant value:\n <span id=\"first-value\"></span>\n <br />\n Second descendant value:\n <span id=\"second-value\"></span>\n <br />\n </div>\n `;\n};\n\nsubmenu.decorators = [submenuDecorator];\n\nexport const contextMenu = (): TemplateResult => {\n const contextMenuTemplate = (): TemplateResult => html`\n <sp-popover\n style=\"max-width: 33vw;\"\n @click=${(event: Event) =>\n event.target?.dispatchEvent(\n new Event('close', { bubbles: true })\n )}\n >\n <sp-menu @change=${handleRootChange}>\n <sp-menu-group>\n <span slot=\"header\">Options</span>\n <sp-menu-item>\n Copy\n <span slot=\"value\">\u2318\u200BS</span>\n </sp-menu-item>\n <sp-menu-item>\n Paste\n <span slot=\"value\">\u2318\u200BP</span>\n </sp-menu-item>\n <sp-menu-item>\n Cut\n <span slot=\"value\">\u2318\u200BX</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Select layer\n <sp-menu\n slot=\"submenu\"\n selects=\"single\"\n @change=${handleFirstDescendantChange}\n >\n <sp-menu-item selected>Ellipse 1</sp-menu-item>\n <sp-menu-item>Rectangle</sp-menu-item>\n </sp-menu>\n </sp-menu-item>\n <sp-menu-item>\n Group\n <span slot=\"value\">\u2318\u200BG</span>\n </sp-menu-item>\n <sp-menu-item>\n Unlock\n <span slot=\"value\">\u2318\u200BL</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Bring to front\n <span slot=\"value\">\u21E7\u200B\u2318\u200B\u200B]</span>\n </sp-menu-item>\n <sp-menu-item>\n Bring forward\n <span slot=\"value\">\u2318\u200B\u200B]</span>\n </sp-menu-item>\n <sp-menu-item>\n Send backward\n <span slot=\"value\">\u2318\u200B\u200B[</span>\n </sp-menu-item>\n <sp-menu-item>\n Send to back\n <span slot=\"value\">\u21E7\u200B\u2318\u200B\u200B[</span>\n </sp-menu-item>\n <sp-menu-divider></sp-menu-divider>\n <sp-menu-item>\n Delete\n <span slot=\"value\">DEL</span>\n </sp-menu-item>\n </sp-menu-group>\n </sp-menu>\n </sp-popover>\n `;\n const pointerenter = async (event: PointerEvent): Promise<void> => {\n event.preventDefault();\n const trigger = event.target as HTMLElement;\n const virtualTrigger = new VirtualTrigger(event.clientX, event.clientY);\n const fragment = document.createDocumentFragment();\n render(contextMenuTemplate(), fragment);\n const popover = fragment.querySelector('sp-popover') as Popover;\n clearValues();\n openOverlay(trigger, 'modal', popover, {\n placement: 'right-start',\n receivesFocus: 'auto',\n virtualTrigger,\n });\n };\n const getValueEls = (): { root: HTMLElement; first: HTMLElement } => {\n return {\n root: document.querySelector('#root-value') as HTMLElement,\n first: document.querySelector('#first-value') as HTMLElement,\n };\n };\n const clearValues = (): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = '';\n valueEls.first.textContent = '';\n };\n const handleRootChange = (event: Event & { target: ActionMenu }): void => {\n const valueEls = getValueEls();\n valueEls.root.textContent = event.target.value;\n };\n const handleFirstDescendantChange = (\n event: Event & { target: Menu }\n ): void => {\n const valueEls = getValueEls();\n valueEls.first.textContent = event.target.selected[0] || '';\n };\n return html`\n <style>\n .app-root {\n position: absolute;\n inset: 0;\n }\n active-overlay::part(theme) {\n --swc-menu-width: 200px;\n }\n </style>\n <div class=\"app-root\" @contextmenu=${pointerenter}>\n <div>\n Root value:\n <span id=\"root-value\"></span>\n <br />\n First descendant value:\n <span id=\"first-value\"></span>\n <br />\n </div>\n </div>\n `;\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,MAAM,cAA8B;AAE7C,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,aAAa,sBAAsB;AAE5C,OAAO;AACP,OAAO;AAIP,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,SAAS,YAA2B;AAChC,SAAO,IAAI,QAAQ,CAAC,QAAQ,sBAAsB,MAAM,IAAI,CAAC,CAAC;AAClE;AAEA,MAAM,qBAAqB,YAAY;AAAA,EAGnC,cAAc;AACV,UAAM;AAiBV,4BAAmB,OAAO,UAAgC;AACtD,YAAM,UAAU;AAChB,YAAO,MAAM,OAAsB;AAEnC,YAAMA,WAAU,SAAS,cAAc,iBAAiB;AACxD,UAAI,CAACA,UAAS;AACV;AAAA,MACJ;AACA,MAAAA,SAAQ,iBAAiB,aAAa,KAAK,qBAAqB;AAAA,QAC5D,MAAM;AAAA,MACV,CAAC;AACD,MAAAA,SAAQ;AAAA,QACJ,IAAI,aAAa,gBAAgB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,MACtE;AAAA,IACJ;AAEA,+BAAsB,OAAO,UAAgC;AACzD,YAAM,UAAU;AAChB,YAAO,MAAM,OAAoB;AAEjC,YAAMA,WAAU,SAAS,cAAc,iBAAiB;AACxD,UAAI,CAACA,UAAS;AACV;AAAA,MACJ;AACA,MAAAA,SAAQ,iBAAiB,aAAa,KAAK,0BAA0B;AAAA,QACjE,MAAM;AAAA,MACV,CAAC;AACD,MAAAA,SAAQ;AAAA,QACJ,IAAI,aAAa,gBAAgB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,MACtE;AAAA,IACJ;AAEA,oCAA2B,OAAO,UAAgC;AAC9D,YAAM,UAAU;AAChB,YAAO,MAAM,O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