@spectrum-web-components/overlay 0.34.0 → 0.34.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -152
- package/custom-elements.json +1401 -541
- package/package.json +48 -22
- package/sp-overlay.d.ts +6 -0
- package/sp-overlay.dev.js +5 -0
- package/{active-overlay.dev.js.map → sp-overlay.dev.js.map} +3 -3
- package/sp-overlay.js +2 -0
- package/{active-overlay.js.map → sp-overlay.js.map} +4 -4
- package/src/Overlay.d.ts +29 -0
- package/src/Overlay.dev.js +91 -0
- package/src/Overlay.dev.js.map +7 -0
- package/src/Overlay.js +2 -0
- package/src/Overlay.js.map +7 -0
- package/src/OverlayBase.d.ts +124 -0
- package/src/OverlayBase.dev.js +744 -0
- package/src/OverlayBase.dev.js.map +7 -0
- package/src/OverlayBase.js +31 -0
- package/src/OverlayBase.js.map +7 -0
- package/src/OverlayDialog.d.ts +8 -0
- package/src/OverlayDialog.dev.js +160 -0
- package/src/OverlayDialog.dev.js.map +7 -0
- package/src/OverlayDialog.js +2 -0
- package/src/OverlayDialog.js.map +7 -0
- package/src/OverlayNoPopover.d.ts +8 -0
- package/src/OverlayNoPopover.dev.js +149 -0
- package/src/OverlayNoPopover.dev.js.map +7 -0
- package/src/OverlayNoPopover.js +2 -0
- package/src/OverlayNoPopover.js.map +7 -0
- package/src/OverlayPopover.d.ts +8 -0
- package/src/OverlayPopover.dev.js +199 -0
- package/src/OverlayPopover.dev.js.map +7 -0
- package/src/OverlayPopover.js +2 -0
- package/src/OverlayPopover.js.map +7 -0
- package/src/OverlayStack.d.ts +29 -0
- package/src/OverlayStack.dev.js +126 -0
- package/src/OverlayStack.dev.js.map +7 -0
- package/src/OverlayStack.js +2 -0
- package/src/OverlayStack.js.map +7 -0
- package/src/OverlayTrigger.d.ts +23 -31
- package/src/OverlayTrigger.dev.js +135 -245
- package/src/OverlayTrigger.dev.js.map +3 -3
- package/src/OverlayTrigger.js +52 -22
- package/src/OverlayTrigger.js.map +3 -3
- package/src/PlacementController.d.ts +36 -0
- package/src/PlacementController.dev.js +191 -0
- package/src/PlacementController.dev.js.map +7 -0
- package/src/PlacementController.js +2 -0
- package/src/PlacementController.js.map +7 -0
- package/src/VirtualTrigger.dev.js +0 -2
- package/src/VirtualTrigger.dev.js.map +2 -2
- package/src/VirtualTrigger.js +1 -1
- package/src/VirtualTrigger.js.map +3 -3
- package/src/fullSizePlugin.d.ts +12 -0
- package/src/fullSizePlugin.dev.js +39 -0
- package/src/fullSizePlugin.dev.js.map +7 -0
- package/src/fullSizePlugin.js +2 -0
- package/src/fullSizePlugin.js.map +7 -0
- package/src/index.d.ts +2 -3
- package/src/index.dev.js +2 -3
- package/src/index.dev.js.map +2 -2
- package/src/index.js +1 -1
- package/src/index.js.map +2 -2
- package/src/loader.d.ts +2 -2
- package/src/loader.dev.js +2 -19
- package/src/loader.dev.js.map +2 -2
- package/src/loader.js +1 -1
- package/src/loader.js.map +3 -3
- package/src/overlay-base.css.dev.js +9 -0
- package/src/overlay-base.css.dev.js.map +7 -0
- package/src/overlay-base.css.js +6 -0
- package/src/overlay-base.css.js.map +7 -0
- package/src/overlay-trigger.css.dev.js +1 -1
- package/src/overlay-trigger.css.dev.js.map +1 -1
- package/src/overlay-trigger.css.js +1 -1
- package/src/overlay-trigger.css.js.map +1 -1
- package/src/overlay-types.d.ts +7 -5
- package/src/overlay-types.dev.js +1 -0
- package/src/overlay-types.dev.js.map +3 -3
- package/src/overlay-types.js +1 -1
- package/src/overlay-types.js.map +3 -3
- package/src/topLayerOverTransforms.d.ts +23 -0
- package/src/topLayerOverTransforms.dev.js +170 -0
- package/src/topLayerOverTransforms.dev.js.map +7 -0
- package/src/topLayerOverTransforms.js +2 -0
- package/src/topLayerOverTransforms.js.map +7 -0
- package/stories/overlay-element.stories.js +247 -0
- package/stories/overlay-element.stories.js.map +7 -0
- package/stories/overlay-story-components.js +9 -8
- package/stories/overlay-story-components.js.map +2 -2
- package/stories/overlay.stories.js +780 -683
- package/stories/overlay.stories.js.map +2 -2
- package/sync/overlay-trigger.d.ts +4 -0
- package/sync/overlay-trigger.dev.js +1 -4
- package/sync/overlay-trigger.dev.js.map +2 -2
- package/sync/overlay-trigger.js +1 -1
- package/sync/overlay-trigger.js.map +3 -3
- package/test/benchmark/basic-test.js +1 -1
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/index.js +407 -376
- package/test/index.js.map +3 -3
- package/test/overlay-element.test-vrt.js +5 -0
- package/test/overlay-element.test-vrt.js.map +7 -0
- package/test/overlay-element.test.js +682 -0
- package/test/overlay-element.test.js.map +7 -0
- package/test/overlay-lifecycle.test.js +34 -106
- package/test/overlay-lifecycle.test.js.map +2 -2
- package/test/overlay-trigger-click.test.js +11 -5
- package/test/overlay-trigger-click.test.js.map +2 -2
- package/test/overlay-trigger-extended.test.js +1 -6
- package/test/overlay-trigger-extended.test.js.map +2 -2
- package/test/overlay-trigger-hover-click.test.js +23 -23
- package/test/overlay-trigger-hover-click.test.js.map +2 -2
- package/test/overlay-trigger-hover.test.js +40 -34
- package/test/overlay-trigger-hover.test.js.map +2 -2
- package/test/overlay-trigger-longpress.test.js +98 -80
- package/test/overlay-trigger-longpress.test.js.map +2 -2
- package/test/overlay-trigger-sync.test.js +1 -1
- package/test/overlay-trigger-sync.test.js.map +2 -2
- package/test/overlay-trigger.test.js +1 -1
- package/test/overlay-trigger.test.js.map +2 -2
- package/test/overlay-update.test.js +4 -4
- package/test/overlay-update.test.js.map +2 -2
- package/test/{overlay.test.js → overlay-v1.test.js} +267 -249
- package/test/overlay-v1.test.js.map +7 -0
- package/test/overlay-v2.test.js +720 -0
- package/test/overlay-v2.test.js.map +7 -0
- package/active-overlay.d.ts +0 -6
- package/active-overlay.dev.js +0 -5
- package/active-overlay.js +0 -2
- package/src/ActiveOverlay.d.ts +0 -84
- package/src/ActiveOverlay.dev.js +0 -517
- package/src/ActiveOverlay.dev.js.map +0 -7
- package/src/ActiveOverlay.js +0 -16
- package/src/ActiveOverlay.js.map +0 -7
- package/src/active-overlay.css.dev.js +0 -13
- package/src/active-overlay.css.dev.js.map +0 -7
- package/src/active-overlay.css.js +0 -10
- package/src/active-overlay.css.js.map +0 -7
- package/src/overlay-stack.d.ts +0 -50
- package/src/overlay-stack.dev.js +0 -515
- package/src/overlay-stack.dev.js.map +0 -7
- package/src/overlay-stack.js +0 -34
- package/src/overlay-stack.js.map +0 -7
- package/src/overlay-utils.d.ts +0 -3
- package/src/overlay-utils.dev.js +0 -31
- package/src/overlay-utils.dev.js.map +0 -7
- package/src/overlay-utils.js +0 -2
- package/src/overlay-utils.js.map +0 -7
- package/src/overlay.d.ts +0 -59
- package/src/overlay.dev.js +0 -127
- package/src/overlay.dev.js.map +0 -7
- package/src/overlay.js +0 -2
- package/src/overlay.js.map +0 -7
- package/test/overlay.test.js.map +0 -7
- /package/src/{active-overlay.css.d.ts → overlay-base.css.d.ts} +0 -0
package/src/overlay-stack.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay-stack.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 { ActiveOverlay } from './ActiveOverlay.js';\nimport type {\n OverlayOpenCloseDetail,\n OverlayOpenDetail,\n} from './overlay-types';\nimport { OverlayTimer } from './overlay-timer.js';\nimport '../active-overlay.js';\nimport {\n findOverlaysRootedInOverlay,\n parentOverlayOf,\n} from './overlay-utils.js';\nimport { OverlayCloseEvent } from './overlay-events.js';\nimport { getDeepElementFromPoint } from '@spectrum-web-components/shared/src/get-deep-element-from-point.js';\n\nfunction isLeftClick(event: MouseEvent): boolean {\n return event.button === 0;\n}\n\nfunction hasModifier(event: MouseEvent): boolean {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\ninterface ManagedOverlayContent {\n open: boolean;\n // Allow the overlaid content to do something before it is thrown.\n overlayWillOpenCallback?: (args: { trigger: HTMLElement }) => void;\n // Allow the overlaid content to do something when it has been thrown.\n overlayOpenCallback?: (args: { trigger: HTMLElement }) => void;\n // Allow the overlaid content to do something when its throw has been cancelled.\n overlayOpenCancelledCallback?: (args: { trigger: HTMLElement }) => void;\n // Allow the overlaid content to do something before it is recalled, and return `true` if it will self managing the recall.\n overlayWillCloseCallback?: (args: { trigger: HTMLElement }) => boolean;\n // Allow the overlaid content to do something when it has been recalled.\n overlayCloseCallback?: (args: { trigger: HTMLElement }) => void;\n // Surface possible LitElement lifecycle methods on the synthetically types element.\n updateComplete?: Promise<boolean>;\n}\n\nfunction nextFrame(): Promise<void> {\n return new Promise((res) => requestAnimationFrame(() => res()));\n}\n\nexport class OverlayStack {\n public overlays: ActiveOverlay[] = [];\n\n private preventMouseRootClose = false;\n private root: HTMLElement = document.body;\n private handlingResize = false;\n private overlayTimer = new OverlayTimer();\n\n private canTabTrap = true;\n private trappingInited = false;\n private tabTrapper!: HTMLElement;\n private overlayHolder!: HTMLElement;\n private _eventsAreBound = false;\n\n constructor() {\n this.initTabTrapping();\n }\n\n private initTabTrapping(): void {\n /* c8 ignore next 10 */\n if (document.readyState === 'loading') {\n document.addEventListener(\n 'readystatechange',\n () => {\n this.initTabTrapping();\n },\n { once: true }\n );\n return;\n }\n if (this.trappingInited) return;\n /* c8 ignore next 4 */\n if (this.document.body.shadowRoot) {\n this.canTabTrap = false;\n return;\n }\n this.document.body.attachShadow({ mode: 'open' });\n /* c8 ignore next 3 */\n if (!this.document.body.shadowRoot) {\n return;\n }\n this.trappingInited = true;\n const root = this.document.body.shadowRoot as ShadowRoot;\n root.innerHTML = `\n <style>\n :host {\n position: relative;\n }\n #actual {\n position: relative;\n height: calc(100% - var(--swc-body-margins-block, 0px));\n z-index: 0;\n min-height: calc(100vh - var(--swc-body-margins-block, 0px));\n min-height: calc(100dvh - var(--swc-body-margins-block, 0px));\n }\n #holder {\n display: none;\n align-items: center;\n justify-content: center;\n flex-flow: column;\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n [name=\"open\"]::slotted(*) {\n pointer-events: all;\n }\n #actual[aria-hidden] + #holder {\n display: flex;\n }\n </style>\n <div id=\"actual\"><slot></slot></div>\n <div id=\"holder\"><slot name=\"open\"></slot></div>\n `;\n this.tabTrapper = root.querySelector('#actual') as HTMLElement;\n this.overlayHolder = root.querySelector('#holder') as HTMLElement;\n this.tabTrapper.attachShadow({ mode: 'open' });\n if (this.tabTrapper.shadowRoot) {\n this.tabTrapper.shadowRoot.innerHTML = '<slot></slot>';\n }\n this.overlayHolder.addEventListener(\n 'contextmenu',\n this.forwardContextmenuEvent,\n true\n );\n requestAnimationFrame(() => {\n this.applyBodyMargins();\n const observer = new ResizeObserver(() => {\n this.applyBodyMargins();\n });\n observer.observe(document.body);\n });\n }\n\n private _bodyMarginsApplied = false;\n\n private applyBodyMargins(): void {\n const { marginLeft, marginRight, marginTop, marginBottom } =\n getComputedStyle(document.body);\n const allZero =\n parseFloat(marginLeft) === 0 &&\n parseFloat(marginRight) === 0 &&\n parseFloat(marginTop) === 0 &&\n parseFloat(marginBottom) === 0;\n if (allZero && !this._bodyMarginsApplied) {\n return;\n }\n this.tabTrapper.style.setProperty(\n '--swc-body-margins-inline',\n `calc(${marginLeft} + ${marginRight})`\n );\n this.tabTrapper.style.setProperty(\n '--swc-body-margins-block',\n `calc(${marginTop} + ${marginBottom})`\n );\n this._bodyMarginsApplied = !allZero;\n }\n\n private startTabTrapping(): void {\n this.initTabTrapping();\n /* c8 ignore next 3 */\n if (!this.canTabTrap) {\n return;\n }\n this.tabTrapper.tabIndex = -1;\n this.tabTrapper.setAttribute('aria-hidden', 'true');\n }\n\n private stopTabTrapping(): void {\n /* c8 ignore next 3 */\n if (!this.canTabTrap || !this.trappingInited) {\n return;\n }\n this.tabTrapper.removeAttribute('tabindex');\n this.tabTrapper.removeAttribute('aria-hidden');\n }\n\n private forwardContextmenuEvent = async (\n event: MouseEvent\n ): Promise<void> => {\n const topOverlay = this.overlays[this.overlays.length - 1];\n if (\n !this.trappingInited ||\n topOverlay.interaction !== 'modal' ||\n event.target !== this.overlayHolder\n ) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n await this.closeTopOverlay();\n getDeepElementFromPoint(event.clientX, event.clientY)?.dispatchEvent(\n new MouseEvent('contextmenu', event)\n );\n };\n\n private get document(): Document {\n return this.root.ownerDocument /* c8 ignore next */ || document;\n }\n\n private get topOverlay(): ActiveOverlay | undefined {\n return this.overlays.slice(-1)[0];\n }\n\n private findOverlayForContent(\n overlayContent: HTMLElement\n ): ActiveOverlay | undefined {\n for (const item of this.overlays) {\n if (overlayContent === item.overlayContent) {\n return item;\n }\n }\n return undefined;\n }\n\n private addEventListeners(): void {\n if (this._eventsAreBound) return;\n this._eventsAreBound = true;\n this.document.addEventListener('click', this.handleMouseCapture, true);\n this.document.addEventListener('click', this.handleMouse);\n this.document.addEventListener('keydown', this.handleKeydown);\n this.document.addEventListener(\n 'sp-overlay-close',\n this.handleOverlayClose as EventListener\n );\n window.addEventListener('resize', this.handleResize);\n }\n\n handleOverlayClose = (event: OverlayCloseEvent): void => {\n const { root } = event;\n if (!root) return;\n this.closeOverlaysForRoot(root);\n };\n\n private isClickOverlayActiveForTrigger(trigger: HTMLElement): boolean {\n return this.overlays.some(\n (item) => trigger === item.trigger && item.interaction === 'click'\n );\n }\n\n public async openOverlay(details: OverlayOpenDetail): Promise<boolean> {\n this.addEventListeners();\n if (this.findOverlayForContent(details.content)) {\n return false;\n }\n if (details.notImmediatelyClosable) {\n this._doesNotCloseOnFirstClick = true;\n }\n if (details.interaction === 'modal') {\n this.startTabTrapping();\n }\n\n const contentWithLifecycle =\n details.content as unknown as ManagedOverlayContent;\n const { trigger } = details;\n if (contentWithLifecycle.overlayWillOpenCallback) {\n contentWithLifecycle.overlayWillOpenCallback({ trigger });\n }\n\n if (details.delayed) {\n const cancelledPromise = this.overlayTimer.openTimer(\n details.content\n );\n const promises = [cancelledPromise];\n if (details.abortPromise) {\n promises.push(details.abortPromise);\n }\n const cancelled = await Promise.race(promises);\n if (cancelled) {\n if (contentWithLifecycle.overlayOpenCancelledCallback) {\n contentWithLifecycle.overlayOpenCancelledCallback({\n trigger,\n });\n }\n return cancelled;\n }\n }\n\n if (details.root) {\n this.closeOverlaysForRoot(details.root);\n }\n if (details.interaction === 'click') {\n this.closeAllHoverOverlays();\n } else if (\n details.interaction === 'hover' &&\n this.isClickOverlayActiveForTrigger(details.trigger)\n ) {\n // Don't show a hover popover if the click popover is already active\n return true;\n }\n\n const activeOverlay = ActiveOverlay.create(details);\n\n if (this.overlays.length) {\n const topOverlay = this.overlays[this.overlays.length - 1];\n topOverlay.obscure(activeOverlay.interaction);\n }\n\n document.body.appendChild(activeOverlay);\n\n /**\n * The following work to make the new overlay the \"top\" of the stack\n * has to happen AFTER the current call stack completes in case there\n * is work there in to remove the previous \"top\" overlay.\n */\n await nextFrame();\n this.overlays.push(activeOverlay);\n await activeOverlay.updateComplete;\n this.addOverlayEventListeners(activeOverlay);\n if (typeof contentWithLifecycle.open !== 'undefined') {\n await nextFrame();\n // Without the rAF Firefox gets here to early\n // and is not able trigger the animation.\n contentWithLifecycle.open = true;\n }\n let cb: () => Promise<void> | void = () => {\n return;\n };\n if (contentWithLifecycle.overlayOpenCallback) {\n const { trigger } = activeOverlay;\n const { overlayOpenCallback } = contentWithLifecycle;\n cb = async () => await overlayOpenCallback({ trigger });\n }\n await activeOverlay.openCallback(cb);\n return false;\n }\n\n public addOverlayEventListeners(activeOverlay: ActiveOverlay): void {\n activeOverlay.addEventListener('close', (() => {\n this.hideAndCloseOverlay(\n activeOverlay,\n true // animated?\n );\n }) as EventListener);\n switch (activeOverlay.interaction) {\n case 'replace':\n this.addReplaceOverlayEventListeners(activeOverlay);\n break;\n case 'inline':\n this.addInlineOverlayEventListeners(activeOverlay);\n break;\n }\n }\n\n public addReplaceOverlayEventListeners(activeOverlay: ActiveOverlay): void {\n activeOverlay.addEventListener('keydown', (event: KeyboardEvent) => {\n const { code } = event;\n /* c8 ignore next */\n if (code !== 'Tab') return;\n\n event.stopPropagation();\n this.closeOverlay(activeOverlay.overlayContent);\n activeOverlay.tabbingAway = true;\n activeOverlay.trigger.focus();\n activeOverlay.trigger.dispatchEvent(\n new KeyboardEvent('keydown', event)\n );\n });\n }\n\n public addInlineOverlayEventListeners(activeOverlay: ActiveOverlay): void {\n activeOverlay.trigger.addEventListener(\n 'keydown',\n activeOverlay.handleInlineTriggerKeydown\n );\n activeOverlay.addEventListener('keydown', (event: KeyboardEvent) => {\n const { code, shiftKey } = event;\n /* c8 ignore next */\n if (code !== 'Tab') return;\n\n activeOverlay.tabbingAway = true;\n if (shiftKey) {\n const returnFocusElement = document.createElement('span');\n returnFocusElement.tabIndex = -1;\n if (activeOverlay.trigger.hasAttribute('slot')) {\n returnFocusElement.slot = activeOverlay.trigger.slot;\n }\n activeOverlay.trigger.insertAdjacentElement(\n 'afterend',\n returnFocusElement\n );\n returnFocusElement.focus();\n returnFocusElement.remove();\n return;\n }\n\n event.stopPropagation();\n const triggerWithLifecycle =\n activeOverlay.trigger as unknown as ManagedOverlayContent;\n if (typeof triggerWithLifecycle.open !== 'undefined') {\n triggerWithLifecycle.open = false;\n }\n this.closeOverlay(activeOverlay.overlayContent);\n activeOverlay.trigger.focus();\n });\n }\n\n public closeOverlay(content: HTMLElement): void {\n this.overlayTimer.close(content);\n requestAnimationFrame(() => {\n const overlayFromContent = this.findOverlayForContent(content);\n const overlaysToClose = [overlayFromContent];\n overlaysToClose.push(\n ...findOverlaysRootedInOverlay(\n overlayFromContent,\n this.overlays\n )\n );\n overlaysToClose.forEach((overlay) =>\n this.hideAndCloseOverlay(overlay)\n );\n });\n }\n\n private handleMouseCapture = (event: MouseEvent): void => {\n const topOverlay = this.topOverlay;\n if (\n !event.target ||\n !topOverlay ||\n !topOverlay.overlayContent ||\n hasModifier(event) ||\n !isLeftClick(event)\n ) {\n this.preventMouseRootClose = true;\n return;\n }\n\n if (event.target instanceof Node) {\n const path = event.composedPath();\n if (path.indexOf(topOverlay.overlayContent) >= 0) {\n this.preventMouseRootClose = true;\n return;\n }\n this.preventMouseRootClose = false;\n }\n };\n\n private closeAllHoverOverlays(): void {\n for (const overlay of this.overlays) {\n if (overlay.interaction === 'hover') {\n this.hideAndCloseOverlay(overlay, false);\n }\n }\n }\n\n private closeOverlaysForRoot(root: HTMLElement): void {\n const overlaysToClose: ActiveOverlay[] = [];\n for (const overlay of this.overlays) {\n if (overlay.root && overlay.root === root) {\n overlaysToClose.push(overlay);\n overlaysToClose.push(\n ...findOverlaysRootedInOverlay(overlay, this.overlays)\n );\n }\n }\n overlaysToClose.forEach((overlay) =>\n this.hideAndCloseOverlay(overlay, true, true)\n );\n }\n\n private async manageFocusAfterCloseWhenOverlaysRemain(\n returnBeforeFocus?: boolean,\n previousTrigger?: HTMLElement\n ): Promise<void> {\n const topOverlay = this.overlays[this.overlays.length - 1];\n topOverlay.feature();\n // Push focus in the the next remaining overlay as needed when a `type=\"modal\"` overlay exists.\n if (topOverlay.interaction === 'modal' || topOverlay.hasModalRoot) {\n if (returnBeforeFocus) return;\n await (previousTrigger || topOverlay).focus();\n } else {\n this.stopTabTrapping();\n }\n }\n\n private manageFocusAfterCloseWhenLastOverlay(overlay: ActiveOverlay): void {\n this.stopTabTrapping();\n const isModal = overlay.interaction === 'modal';\n const isReceivesFocus = overlay.receivesFocus === 'auto';\n const isReplace = overlay.interaction === 'replace';\n const isInline = overlay.interaction === 'inline';\n const isTabbingAwayFromInlineOrReplace =\n (isReplace || isInline) && !overlay.tabbingAway;\n overlay.tabbingAway = false;\n if (!isModal && !isReceivesFocus && !isTabbingAwayFromInlineOrReplace) {\n return;\n }\n // Manage post closure focus when needed.\n const overlayRoot = overlay.overlayContent.getRootNode() as ShadowRoot;\n const overlayContentActiveElement = overlayRoot.activeElement;\n let triggerRoot: ShadowRoot;\n let triggerActiveElement: Element | null;\n const contentContainsActiveElement = (): boolean =>\n overlay.overlayContent.contains(overlayContentActiveElement);\n const triggerRootContainsActiveElement = (): boolean => {\n triggerRoot = overlay.trigger.getRootNode() as ShadowRoot;\n triggerActiveElement = triggerRoot.activeElement;\n return triggerRoot.contains(triggerActiveElement);\n };\n const triggerHostIsActiveElement = (): boolean =>\n triggerRoot.host && triggerRoot.host === triggerActiveElement;\n // Return focus to the trigger as long as the user hasn't actively focused\n // something outside of the current overlay interface; trigger, root, host.\n if (\n isModal ||\n contentContainsActiveElement() ||\n triggerRootContainsActiveElement() ||\n triggerHostIsActiveElement()\n ) {\n overlay.trigger.focus();\n }\n }\n\n private async hideAndCloseOverlay(\n overlay?: ActiveOverlay,\n animated?: boolean,\n returnBeforeFocus?: boolean\n ): Promise<void> {\n if (!overlay) {\n return;\n }\n const contentWithLifecycle =\n overlay.overlayContent as unknown as ManagedOverlayContent;\n if (\n typeof contentWithLifecycle.overlayWillCloseCallback !== 'undefined'\n ) {\n const { trigger } = overlay;\n if (contentWithLifecycle.overlayWillCloseCallback({ trigger })) {\n return;\n }\n }\n await overlay.hide(animated);\n if (typeof contentWithLifecycle.open !== 'undefined') {\n contentWithLifecycle.open = false;\n }\n if (contentWithLifecycle.overlayCloseCallback) {\n const { trigger } = overlay;\n await contentWithLifecycle.overlayCloseCallback({ trigger });\n }\n\n if (overlay.state != 'dispose') return;\n\n const index = this.overlays.indexOf(overlay);\n if (index >= 0) {\n this.overlays.splice(index, 1);\n }\n\n if (this.overlays.length) {\n await this.manageFocusAfterCloseWhenOverlaysRemain(\n returnBeforeFocus || overlay.interaction === 'hover',\n overlay.trigger\n );\n } else {\n this.manageFocusAfterCloseWhenLastOverlay(overlay);\n }\n\n await overlay.updateComplete;\n overlay.remove();\n overlay.dispose();\n\n overlay.trigger.dispatchEvent(\n new CustomEvent<OverlayOpenCloseDetail>('sp-closed', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n interaction: overlay.interaction,\n },\n })\n );\n }\n\n private closeTopOverlay(): Promise<void> {\n return this.hideAndCloseOverlay(this.topOverlay, true);\n }\n\n /**\n * A \"longpress\" occurs before the \"click\" that creates it has occured.\n * In that way the first click will still be part of the \"longpress\" and\n * not part of closing the overlay.\n */\n private _doesNotCloseOnFirstClick = false;\n\n private handleMouse = (event: Event): void => {\n if (this._doesNotCloseOnFirstClick) {\n this._doesNotCloseOnFirstClick = false;\n return;\n }\n if (this.preventMouseRootClose || event.defaultPrevented) {\n return;\n }\n const overlaysToClose = [];\n /**\n * Find the first overlay that should be closed by this and include it in the\n * array of overlays for closure.\n *\n * Event path dictates closure while the click event:\n * - did not occur within the overlay content of the overlay\n * AND was\n * - not triggered by something in the click event's composed path\n * OR\n * - not a \"hover\" overlay\n * Select the overlay for closure\n */\n let index = this.overlays.length;\n while (index && overlaysToClose.length === 0) {\n index -= 1;\n const overlay = this.overlays[index];\n const path = event.composedPath();\n const eventPathDictatesClosure =\n (!path.includes(overlay.trigger) ||\n overlay.interaction !== 'hover') &&\n !path.includes(overlay.overlayContent);\n if (eventPathDictatesClosure) {\n overlaysToClose.push(overlay);\n }\n }\n let root: HTMLElement | undefined = this.topOverlay?.root;\n let overlay = parentOverlayOf(root);\n while (root && overlay) {\n overlaysToClose.push(overlay);\n overlay = parentOverlayOf(root);\n root = overlay?.root;\n }\n if (overlay) {\n overlaysToClose.push(overlay);\n }\n overlaysToClose.forEach((overlay) => this.hideAndCloseOverlay(overlay));\n };\n\n private handleKeydown = (event: KeyboardEvent): void => {\n if (event.code === 'Escape') {\n this.closeTopOverlay();\n }\n };\n\n private handleResize = (): void => {\n if (this.handlingResize) return;\n\n this.handlingResize = true;\n requestAnimationFrame(async () => {\n const promises = this.overlays.map((overlay) =>\n overlay.updateOverlayPosition()\n );\n await Promise.all(promises);\n this.handlingResize = false;\n });\n };\n}\n"],
|
|
5
|
-
"mappings": "aAYA,OAAS,iBAAAA,MAAqB,qBAK9B,OAAS,gBAAAC,MAAoB,qBAC7B,MAAO,uBACP,OACI,+BAAAC,EACA,mBAAAC,MACG,qBAEP,OAAS,2BAAAC,MAA+B,qEAExC,SAASC,EAAYC,EAA4B,CAC7C,OAAOA,EAAM,SAAW,CAC5B,CAEA,SAASC,EAAYD,EAA4B,CAC7C,MAAO,CAAC,EAAEA,EAAM,SAAWA,EAAM,QAAUA,EAAM,SAAWA,EAAM,SACtE,CAkBA,SAASE,GAA2B,CAChC,OAAO,IAAI,QAASC,GAAQ,sBAAsB,IAAMA,EAAI,CAAC,CAAC,CAClE,CAEO,aAAM,YAAa,CActB,aAAc,CAbd,KAAO,SAA4B,CAAC,EAEpC,KAAQ,sBAAwB,GAChC,KAAQ,KAAoB,SAAS,KACrC,KAAQ,eAAiB,GACzB,KAAQ,aAAe,IAAIR,EAE3B,KAAQ,WAAa,GACrB,KAAQ,eAAiB,GAGzB,KAAQ,gBAAkB,GAoF1B,KAAQ,oBAAsB,GA2C9B,KAAQ,wBAA0B,MAC9BK,GACgB,CAnMxB,IAAAI,EAoMQ,MAAMC,EAAa,KAAK,SAAS,KAAK,SAAS,OAAS,CAAC,EAErD,CAAC,KAAK,gBACNA,EAAW,cAAgB,SAC3BL,EAAM,SAAW,KAAK,gBAI1BA,EAAM,gBAAgB,EACtBA,EAAM,eAAe,EACrB,MAAM,KAAK,gBAAgB,GAC3BI,EAAAN,EAAwBE,EAAM,QAASA,EAAM,OAAO,IAApD,MAAAI,EAAuD,cACnD,IAAI,WAAW,cAAeJ,CAAK,GAE3C,EAkCA,wBAAsBA,GAAmC,CACrD,KAAM,CAAE,KAAAM,CAAK,EAAIN,EACZM,GACL,KAAK,qBAAqBA,CAAI,CAClC,EAsLA,KAAQ,mBAA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6
|
-
"names": ["ActiveOverlay", "OverlayTimer", "findOverlaysRootedInOverlay", "parentOverlayOf", "getDeepElementFromPoint", "isLeftClick", "event", "hasModifier", "nextFrame", "res", "_a", "topOverlay", "root", "overlaysToClose", "index", "overlay", "path", "promises", "marginLeft", "marginRight", "marginTop", "marginBottom", "allZero", "overlayContent", "item", "trigger", "details", "contentWithLifecycle", "cancelled", "activeOverlay", "cb", "overlayOpenCallback", "code", "shiftKey", "returnFocusElement", "triggerWithLifecycle", "content", "overlayFromContent", "returnBeforeFocus", "previousTrigger", "isModal", "isReceivesFocus", "isReplace", "isInline", "isTabbingAwayFromInlineOrReplace", "overlayContentActiveElement", "triggerRoot", "triggerActiveElement", "contentContainsActiveElement", "triggerRootContainsActiveElement", "triggerHostIsActiveElement", "animated"]
|
|
7
|
-
}
|
package/src/overlay-utils.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ActiveOverlay } from './ActiveOverlay';
|
|
2
|
-
export declare const parentOverlayOf: (el?: Element) => ActiveOverlay | null;
|
|
3
|
-
export declare const findOverlaysRootedInOverlay: (rootOverlay: ActiveOverlay | undefined, activeOverlays: ActiveOverlay[]) => ActiveOverlay[];
|
package/src/overlay-utils.dev.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
export const parentOverlayOf = (el) => {
|
|
3
|
-
if (!el)
|
|
4
|
-
return null;
|
|
5
|
-
const closestOverlay = el.closest("active-overlay");
|
|
6
|
-
if (closestOverlay) {
|
|
7
|
-
return closestOverlay;
|
|
8
|
-
}
|
|
9
|
-
const rootNode = el.getRootNode();
|
|
10
|
-
if (rootNode.host) {
|
|
11
|
-
return parentOverlayOf(rootNode.host);
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
};
|
|
15
|
-
export const findOverlaysRootedInOverlay = (rootOverlay, activeOverlays) => {
|
|
16
|
-
const overlays = [];
|
|
17
|
-
if (!rootOverlay)
|
|
18
|
-
return [];
|
|
19
|
-
for (const overlay of activeOverlays) {
|
|
20
|
-
if (!overlay.root)
|
|
21
|
-
continue;
|
|
22
|
-
if (parentOverlayOf(overlay.root) === rootOverlay) {
|
|
23
|
-
overlays.push(overlay);
|
|
24
|
-
overlays.push(
|
|
25
|
-
...findOverlaysRootedInOverlay(overlay, activeOverlays)
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return overlays;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=overlay-utils.dev.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay-utils.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 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 type { ActiveOverlay } from './ActiveOverlay';\n\nexport const parentOverlayOf = (el?: Element): ActiveOverlay | null => {\n if (!el) return null;\n const closestOverlay = el.closest('active-overlay');\n if (closestOverlay) {\n return closestOverlay;\n }\n const rootNode = el.getRootNode() as ShadowRoot;\n if (rootNode.host) {\n return parentOverlayOf(rootNode.host);\n }\n return null;\n};\n\nexport const findOverlaysRootedInOverlay = (\n rootOverlay: ActiveOverlay | undefined,\n activeOverlays: ActiveOverlay[]\n): ActiveOverlay[] => {\n const overlays: ActiveOverlay[] = [];\n if (!rootOverlay) return [];\n for (const overlay of activeOverlays) {\n if (!overlay.root) continue;\n if (parentOverlayOf(overlay.root) === rootOverlay) {\n overlays.push(overlay);\n overlays.push(\n ...findOverlaysRootedInOverlay(overlay, activeOverlays)\n );\n }\n }\n return overlays;\n};\n"],
|
|
5
|
-
"mappings": ";AAcO,aAAM,kBAAkB,CAAC,OAAuC;AACnE,MAAI,CAAC;AAAI,WAAO;AAChB,QAAM,iBAAiB,GAAG,QAAQ,gBAAgB;AAClD,MAAI,gBAAgB;AAChB,WAAO;AAAA,EACX;AACA,QAAM,WAAW,GAAG,YAAY;AAChC,MAAI,SAAS,MAAM;AACf,WAAO,gBAAgB,SAAS,IAAI;AAAA,EACxC;AACA,SAAO;AACX;AAEO,aAAM,8BAA8B,CACvC,aACA,mBACkB;AAClB,QAAM,WAA4B,CAAC;AACnC,MAAI,CAAC;AAAa,WAAO,CAAC;AAC1B,aAAW,WAAW,gBAAgB;AAClC,QAAI,CAAC,QAAQ;AAAM;AACnB,QAAI,gBAAgB,QAAQ,IAAI,MAAM,aAAa;AAC/C,eAAS,KAAK,OAAO;AACrB,eAAS;AAAA,QACL,GAAG,4BAA4B,SAAS,cAAc;AAAA,MAC1D;AAAA,IACJ;AAAA,EACJ;AACA,SAAO;AACX;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/overlay-utils.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";export const parentOverlayOf=e=>{if(!e)return null;const o=e.closest("active-overlay");if(o)return o;const t=e.getRootNode();return t.host?parentOverlayOf(t.host):null},findOverlaysRootedInOverlay=(e,o)=>{const t=[];if(!e)return[];for(const r of o)r.root&&parentOverlayOf(r.root)===e&&(t.push(r),t.push(...findOverlaysRootedInOverlay(r,o)));return t};
|
|
2
|
-
//# sourceMappingURL=overlay-utils.js.map
|
package/src/overlay-utils.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay-utils.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2022 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 type { ActiveOverlay } from './ActiveOverlay';\n\nexport const parentOverlayOf = (el?: Element): ActiveOverlay | null => {\n if (!el) return null;\n const closestOverlay = el.closest('active-overlay');\n if (closestOverlay) {\n return closestOverlay;\n }\n const rootNode = el.getRootNode() as ShadowRoot;\n if (rootNode.host) {\n return parentOverlayOf(rootNode.host);\n }\n return null;\n};\n\nexport const findOverlaysRootedInOverlay = (\n rootOverlay: ActiveOverlay | undefined,\n activeOverlays: ActiveOverlay[]\n): ActiveOverlay[] => {\n const overlays: ActiveOverlay[] = [];\n if (!rootOverlay) return [];\n for (const overlay of activeOverlays) {\n if (!overlay.root) continue;\n if (parentOverlayOf(overlay.root) === rootOverlay) {\n overlays.push(overlay);\n overlays.push(\n ...findOverlaysRootedInOverlay(overlay, activeOverlays)\n );\n }\n }\n return overlays;\n};\n"],
|
|
5
|
-
"mappings": "aAcO,aAAM,gBAAmBA,GAAuC,CACnE,GAAI,CAACA,EAAI,OAAO,KAChB,MAAMC,EAAiBD,EAAG,QAAQ,gBAAgB,EAClD,GAAIC,EACA,OAAOA,EAEX,MAAMC,EAAWF,EAAG,YAAY,EAChC,OAAIE,EAAS,KACF,gBAAgBA,EAAS,IAAI,EAEjC,IACX,EAEa,4BAA8B,CACvCC,EACAC,IACkB,CAClB,MAAMC,EAA4B,CAAC,EACnC,GAAI,CAACF,EAAa,MAAO,CAAC,EAC1B,UAAWG,KAAWF,EACbE,EAAQ,MACT,gBAAgBA,EAAQ,IAAI,IAAMH,IAClCE,EAAS,KAAKC,CAAO,EACrBD,EAAS,KACL,GAAG,4BAA4BC,EAASF,CAAc,CAC1D,GAGR,OAAOC,CACX",
|
|
6
|
-
"names": ["el", "closestOverlay", "rootNode", "rootOverlay", "activeOverlays", "overlays", "overlay"]
|
|
7
|
-
}
|
package/src/overlay.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { OverlayOptions, TriggerInteractions } from './overlay-types';
|
|
2
|
-
/**
|
|
3
|
-
* This class allows access to the overlay system which allows a client to
|
|
4
|
-
* position an element in the overlay positioned relative to another node.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Overlay {
|
|
7
|
-
private static overlayStack;
|
|
8
|
-
private isOpen;
|
|
9
|
-
private overlayElement;
|
|
10
|
-
private owner;
|
|
11
|
-
private interaction;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param owner the parent element we will use to position the overlay element
|
|
15
|
-
* @param interaction the type of interaction that caused this overlay to be shown
|
|
16
|
-
* @param overlayElement the item to display as an overlay
|
|
17
|
-
*/
|
|
18
|
-
constructor(owner: HTMLElement, interaction: TriggerInteractions, overlayElement: HTMLElement);
|
|
19
|
-
/**
|
|
20
|
-
* Open an overlay
|
|
21
|
-
*
|
|
22
|
-
* @param owner the parent element we will use to position the overlay element
|
|
23
|
-
* @param interaction the type of interaction that caused this overlay to be shown
|
|
24
|
-
* @param overlayElement the item to display as an overlay
|
|
25
|
-
* @param options display parameters
|
|
26
|
-
* @param options.delayed if true delay opening of the overlay based on the global warmup/cooldown timer
|
|
27
|
-
* @param options.offset distance to offset the overlay
|
|
28
|
-
* @param options.placement side on which to position the overlay
|
|
29
|
-
* @returns an Overlay object which can be used to close the overlay
|
|
30
|
-
*/
|
|
31
|
-
static open(owner: HTMLElement, interaction: TriggerInteractions, overlayElement: HTMLElement, options: OverlayOptions): Promise<() => void>;
|
|
32
|
-
static update(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Open an overlay
|
|
35
|
-
*
|
|
36
|
-
* @param options display parameters
|
|
37
|
-
* @param options.delayed delay before opening the overlay
|
|
38
|
-
* @param options.offset distance to offset the overlay
|
|
39
|
-
* @param options.placement side on which to position the overlay
|
|
40
|
-
* @returns a Promise that resolves to true if this operation was cancelled
|
|
41
|
-
*/
|
|
42
|
-
open({ abortPromise, delayed, offset, placement, receivesFocus, notImmediatelyClosable, virtualTrigger, root, }: OverlayOptions): Promise<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* Close the overlay if it is open
|
|
45
|
-
*/
|
|
46
|
-
close(): void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Announces that an overlay-based UI element has opened
|
|
50
|
-
* @event sp-open
|
|
51
|
-
* @type {object}
|
|
52
|
-
* @property {TriggerInteractions} interaction type of interaction that triggered the opening
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* Announces that an overlay-based UI element has opened
|
|
56
|
-
* @event sp-close
|
|
57
|
-
* @type {object}
|
|
58
|
-
* @property {TriggerInteractions} interaction type of interaction that triggered the closing
|
|
59
|
-
*/
|
package/src/overlay.dev.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
import { OverlayStack } from "./overlay-stack.dev.js";
|
|
3
|
-
const _Overlay = class {
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param owner the parent element we will use to position the overlay element
|
|
7
|
-
* @param interaction the type of interaction that caused this overlay to be shown
|
|
8
|
-
* @param overlayElement the item to display as an overlay
|
|
9
|
-
*/
|
|
10
|
-
constructor(owner, interaction, overlayElement) {
|
|
11
|
-
this.isOpen = false;
|
|
12
|
-
this.owner = owner;
|
|
13
|
-
this.overlayElement = overlayElement;
|
|
14
|
-
this.interaction = interaction;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Open an overlay
|
|
18
|
-
*
|
|
19
|
-
* @param owner the parent element we will use to position the overlay element
|
|
20
|
-
* @param interaction the type of interaction that caused this overlay to be shown
|
|
21
|
-
* @param overlayElement the item to display as an overlay
|
|
22
|
-
* @param options display parameters
|
|
23
|
-
* @param options.delayed if true delay opening of the overlay based on the global warmup/cooldown timer
|
|
24
|
-
* @param options.offset distance to offset the overlay
|
|
25
|
-
* @param options.placement side on which to position the overlay
|
|
26
|
-
* @returns an Overlay object which can be used to close the overlay
|
|
27
|
-
*/
|
|
28
|
-
static async open(owner, interaction, overlayElement, options) {
|
|
29
|
-
const overlay = new _Overlay(owner, interaction, overlayElement);
|
|
30
|
-
if (true) {
|
|
31
|
-
window.__swc.warn(
|
|
32
|
-
void 0,
|
|
33
|
-
"The Overlay API is currently being refactored and there are likely to be breaking changes, deprecations and/or removals in a future release. The SWC team wants feedback from direct Overlay API consumers like you - please share your thoughts on the future of overlays here:",
|
|
34
|
-
"https://github.com/adobe/spectrum-web-components/discussions/2764",
|
|
35
|
-
{
|
|
36
|
-
type: "default",
|
|
37
|
-
level: "deprecation"
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
await overlay.open(options);
|
|
42
|
-
return () => {
|
|
43
|
-
overlay.close();
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
static update() {
|
|
47
|
-
const overlayUpdateEvent = new CustomEvent("sp-update-overlays", {
|
|
48
|
-
bubbles: true,
|
|
49
|
-
composed: true,
|
|
50
|
-
cancelable: true
|
|
51
|
-
});
|
|
52
|
-
document.dispatchEvent(overlayUpdateEvent);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Open an overlay
|
|
56
|
-
*
|
|
57
|
-
* @param options display parameters
|
|
58
|
-
* @param options.delayed delay before opening the overlay
|
|
59
|
-
* @param options.offset distance to offset the overlay
|
|
60
|
-
* @param options.placement side on which to position the overlay
|
|
61
|
-
* @returns a Promise that resolves to true if this operation was cancelled
|
|
62
|
-
*/
|
|
63
|
-
async open({
|
|
64
|
-
abortPromise,
|
|
65
|
-
delayed,
|
|
66
|
-
offset = 0,
|
|
67
|
-
placement = "top",
|
|
68
|
-
receivesFocus,
|
|
69
|
-
notImmediatelyClosable,
|
|
70
|
-
virtualTrigger,
|
|
71
|
-
root
|
|
72
|
-
}) {
|
|
73
|
-
if (this.isOpen)
|
|
74
|
-
return true;
|
|
75
|
-
if (delayed === void 0) {
|
|
76
|
-
delayed = this.overlayElement.hasAttribute("delayed");
|
|
77
|
-
}
|
|
78
|
-
const queryThemeDetail = {
|
|
79
|
-
color: void 0,
|
|
80
|
-
scale: void 0,
|
|
81
|
-
lang: void 0,
|
|
82
|
-
theme: void 0
|
|
83
|
-
};
|
|
84
|
-
const queryThemeEvent = new CustomEvent("sp-query-theme", {
|
|
85
|
-
bubbles: true,
|
|
86
|
-
composed: true,
|
|
87
|
-
detail: queryThemeDetail,
|
|
88
|
-
cancelable: true
|
|
89
|
-
});
|
|
90
|
-
this.owner.dispatchEvent(queryThemeEvent);
|
|
91
|
-
const overlayDetailQuery = {};
|
|
92
|
-
const queryOverlayDetailEvent = new CustomEvent("sp-overlay-query", {
|
|
93
|
-
bubbles: true,
|
|
94
|
-
composed: true,
|
|
95
|
-
detail: overlayDetailQuery,
|
|
96
|
-
cancelable: true
|
|
97
|
-
});
|
|
98
|
-
this.overlayElement.dispatchEvent(queryOverlayDetailEvent);
|
|
99
|
-
await _Overlay.overlayStack.openOverlay({
|
|
100
|
-
abortPromise,
|
|
101
|
-
content: this.overlayElement,
|
|
102
|
-
contentTip: overlayDetailQuery.overlayContentTipElement,
|
|
103
|
-
delayed,
|
|
104
|
-
offset,
|
|
105
|
-
placement,
|
|
106
|
-
trigger: this.owner,
|
|
107
|
-
interaction: this.interaction,
|
|
108
|
-
theme: queryThemeDetail,
|
|
109
|
-
receivesFocus,
|
|
110
|
-
root,
|
|
111
|
-
notImmediatelyClosable,
|
|
112
|
-
virtualTrigger,
|
|
113
|
-
...overlayDetailQuery
|
|
114
|
-
});
|
|
115
|
-
this.isOpen = true;
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Close the overlay if it is open
|
|
120
|
-
*/
|
|
121
|
-
close() {
|
|
122
|
-
_Overlay.overlayStack.closeOverlay(this.overlayElement);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
export let Overlay = _Overlay;
|
|
126
|
-
Overlay.overlayStack = new OverlayStack();
|
|
127
|
-
//# sourceMappingURL=overlay.dev.js.map
|
package/src/overlay.dev.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay.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 type { ThemeData } from '@spectrum-web-components/theme/src/Theme.js';\nimport type {\n OverlayDisplayQueryDetail,\n OverlayOptions,\n TriggerInteractions,\n} from './overlay-types';\nimport { OverlayStack } from './overlay-stack.dev.js'\n\n/**\n * This class allows access to the overlay system which allows a client to\n * position an element in the overlay positioned relative to another node.\n */\nexport class Overlay {\n private static overlayStack = new OverlayStack();\n\n private isOpen = false;\n private overlayElement: HTMLElement;\n private owner: HTMLElement;\n private interaction: TriggerInteractions;\n\n /**\n *\n * @param owner the parent element we will use to position the overlay element\n * @param interaction the type of interaction that caused this overlay to be shown\n * @param overlayElement the item to display as an overlay\n */\n constructor(\n owner: HTMLElement,\n interaction: TriggerInteractions,\n overlayElement: HTMLElement\n ) {\n this.owner = owner;\n this.overlayElement = overlayElement;\n this.interaction = interaction;\n }\n\n /**\n * Open an overlay\n *\n * @param owner the parent element we will use to position the overlay element\n * @param interaction the type of interaction that caused this overlay to be shown\n * @param overlayElement the item to display as an overlay\n * @param options display parameters\n * @param options.delayed if true delay opening of the overlay based on the global warmup/cooldown timer\n * @param options.offset distance to offset the overlay\n * @param options.placement side on which to position the overlay\n * @returns an Overlay object which can be used to close the overlay\n */\n public static async open(\n owner: HTMLElement,\n interaction: TriggerInteractions,\n overlayElement: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void> {\n const overlay = new Overlay(owner, interaction, overlayElement);\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n 'The Overlay API is currently being refactored and there are likely to be breaking changes, deprecations and/or removals in a future release. The SWC team wants feedback from direct Overlay API consumers like you - please share your thoughts on the future of overlays here:',\n 'https://github.com/adobe/spectrum-web-components/discussions/2764',\n {\n type: 'default',\n level: 'deprecation',\n }\n );\n }\n await overlay.open(options);\n return (): void => {\n overlay.close();\n };\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Open an overlay\n *\n * @param options display parameters\n * @param options.delayed delay before opening the overlay\n * @param options.offset distance to offset the overlay\n * @param options.placement side on which to position the overlay\n * @returns a Promise that resolves to true if this operation was cancelled\n */\n public async open({\n abortPromise,\n delayed,\n offset = 0,\n placement = 'top',\n receivesFocus,\n notImmediatelyClosable,\n virtualTrigger,\n root,\n }: OverlayOptions): Promise<boolean> {\n /* c8 ignore next */\n if (this.isOpen) return true;\n\n if (delayed === undefined) {\n delayed = this.overlayElement.hasAttribute('delayed');\n }\n\n const queryThemeDetail: ThemeData = {\n color: undefined,\n scale: undefined,\n lang: undefined,\n theme: undefined,\n };\n const queryThemeEvent = new CustomEvent<ThemeData>('sp-query-theme', {\n bubbles: true,\n composed: true,\n detail: queryThemeDetail,\n cancelable: true,\n });\n this.owner.dispatchEvent(queryThemeEvent);\n\n const overlayDetailQuery: OverlayDisplayQueryDetail = {};\n const queryOverlayDetailEvent =\n new CustomEvent<OverlayDisplayQueryDetail>('sp-overlay-query', {\n bubbles: true,\n composed: true,\n detail: overlayDetailQuery,\n cancelable: true,\n });\n this.overlayElement.dispatchEvent(queryOverlayDetailEvent);\n\n await Overlay.overlayStack.openOverlay({\n abortPromise,\n content: this.overlayElement,\n contentTip: overlayDetailQuery.overlayContentTipElement,\n delayed,\n offset: offset,\n placement: placement,\n trigger: this.owner,\n interaction: this.interaction,\n theme: queryThemeDetail,\n receivesFocus,\n root,\n notImmediatelyClosable,\n virtualTrigger,\n ...overlayDetailQuery,\n });\n this.isOpen = true;\n return true;\n }\n\n /**\n * Close the overlay if it is open\n */\n public close(): void {\n Overlay.overlayStack.closeOverlay(this.overlayElement);\n }\n}\n\n/**\n * Announces that an overlay-based UI element has opened\n * @event sp-open\n * @type {object}\n * @property {TriggerInteractions} interaction type of interaction that triggered the opening\n */\n\n/**\n * Announces that an overlay-based UI element has opened\n * @event sp-close\n * @type {object}\n * @property {TriggerInteractions} interaction type of interaction that triggered the closing\n */\n"],
|
|
5
|
-
"mappings": ";AAkBA,SAAS,oBAAoB;AAMtB,MAAM,WAAN,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcjB,YACI,OACA,aACA,gBACF;AAfF,SAAQ,SAAS;AAgBb,SAAK,QAAQ;AACb,SAAK,iBAAiB;AACtB,SAAK,cAAc;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,aAAoB,KAChB,OACA,aACA,gBACA,SACmB;AACnB,UAAM,UAAU,IAAI,SAAQ,OAAO,aAAa,cAAc;AAC9D,QAAI,MAAoB;AACpB,aAAO,MAAM;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,UACI,MAAM;AAAA,UACN,OAAO;AAAA,QACX;AAAA,MACJ;AAAA,IACJ;AACA,UAAM,QAAQ,KAAK,OAAO;AAC1B,WAAO,MAAY;AACf,cAAQ,MAAM;AAAA,IAClB;AAAA,EACJ;AAAA,EAEA,OAAc,SAAe;AACzB,UAAM,qBAAqB,IAAI,YAAY,sBAAsB;AAAA,MAC7D,SA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;AACJ;AAjJO,WAAM,UAAN;AAAM,QACM,eAAe,IAAI,aAAa;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/src/overlay.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";import{OverlayStack as y}from"./overlay-stack.js";const n=class{constructor(e,t,r){this.isOpen=!1;this.owner=e,this.overlayElement=r,this.interaction=t}static async open(e,t,r,o){const a=new n(e,t,r);return await a.open(o),()=>{a.close()}}static update(){const e=new CustomEvent("sp-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(e)}async open({abortPromise:e,delayed:t,offset:r=0,placement:o="top",receivesFocus:a,notImmediatelyClosable:l,virtualTrigger:c,root:u}){if(this.isOpen)return!0;t===void 0&&(t=this.overlayElement.hasAttribute("delayed"));const s={color:void 0,scale:void 0,lang:void 0,theme:void 0},p=new CustomEvent("sp-query-theme",{bubbles:!0,composed:!0,detail:s,cancelable:!0});this.owner.dispatchEvent(p);const i={},m=new CustomEvent("sp-overlay-query",{bubbles:!0,composed:!0,detail:i,cancelable:!0});return this.overlayElement.dispatchEvent(m),await n.overlayStack.openOverlay({abortPromise:e,content:this.overlayElement,contentTip:i.overlayContentTipElement,delayed:t,offset:r,placement:o,trigger:this.owner,interaction:this.interaction,theme:s,receivesFocus:a,root:u,notImmediatelyClosable:l,virtualTrigger:c,...i}),this.isOpen=!0,!0}close(){n.overlayStack.closeOverlay(this.overlayElement)}};export let Overlay=n;Overlay.overlayStack=new y;
|
|
2
|
-
//# sourceMappingURL=overlay.js.map
|
package/src/overlay.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay.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 type { ThemeData } from '@spectrum-web-components/theme/src/Theme.js';\nimport type {\n OverlayDisplayQueryDetail,\n OverlayOptions,\n TriggerInteractions,\n} from './overlay-types';\nimport { OverlayStack } from './overlay-stack.js';\n\n/**\n * This class allows access to the overlay system which allows a client to\n * position an element in the overlay positioned relative to another node.\n */\nexport class Overlay {\n private static overlayStack = new OverlayStack();\n\n private isOpen = false;\n private overlayElement: HTMLElement;\n private owner: HTMLElement;\n private interaction: TriggerInteractions;\n\n /**\n *\n * @param owner the parent element we will use to position the overlay element\n * @param interaction the type of interaction that caused this overlay to be shown\n * @param overlayElement the item to display as an overlay\n */\n constructor(\n owner: HTMLElement,\n interaction: TriggerInteractions,\n overlayElement: HTMLElement\n ) {\n this.owner = owner;\n this.overlayElement = overlayElement;\n this.interaction = interaction;\n }\n\n /**\n * Open an overlay\n *\n * @param owner the parent element we will use to position the overlay element\n * @param interaction the type of interaction that caused this overlay to be shown\n * @param overlayElement the item to display as an overlay\n * @param options display parameters\n * @param options.delayed if true delay opening of the overlay based on the global warmup/cooldown timer\n * @param options.offset distance to offset the overlay\n * @param options.placement side on which to position the overlay\n * @returns an Overlay object which can be used to close the overlay\n */\n public static async open(\n owner: HTMLElement,\n interaction: TriggerInteractions,\n overlayElement: HTMLElement,\n options: OverlayOptions\n ): Promise<() => void> {\n const overlay = new Overlay(owner, interaction, overlayElement);\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n undefined,\n 'The Overlay API is currently being refactored and there are likely to be breaking changes, deprecations and/or removals in a future release. The SWC team wants feedback from direct Overlay API consumers like you - please share your thoughts on the future of overlays here:',\n 'https://github.com/adobe/spectrum-web-components/discussions/2764',\n {\n type: 'default',\n level: 'deprecation',\n }\n );\n }\n await overlay.open(options);\n return (): void => {\n overlay.close();\n };\n }\n\n public static update(): void {\n const overlayUpdateEvent = new CustomEvent('sp-update-overlays', {\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n document.dispatchEvent(overlayUpdateEvent);\n }\n\n /**\n * Open an overlay\n *\n * @param options display parameters\n * @param options.delayed delay before opening the overlay\n * @param options.offset distance to offset the overlay\n * @param options.placement side on which to position the overlay\n * @returns a Promise that resolves to true if this operation was cancelled\n */\n public async open({\n abortPromise,\n delayed,\n offset = 0,\n placement = 'top',\n receivesFocus,\n notImmediatelyClosable,\n virtualTrigger,\n root,\n }: OverlayOptions): Promise<boolean> {\n /* c8 ignore next */\n if (this.isOpen) return true;\n\n if (delayed === undefined) {\n delayed = this.overlayElement.hasAttribute('delayed');\n }\n\n const queryThemeDetail: ThemeData = {\n color: undefined,\n scale: undefined,\n lang: undefined,\n theme: undefined,\n };\n const queryThemeEvent = new CustomEvent<ThemeData>('sp-query-theme', {\n bubbles: true,\n composed: true,\n detail: queryThemeDetail,\n cancelable: true,\n });\n this.owner.dispatchEvent(queryThemeEvent);\n\n const overlayDetailQuery: OverlayDisplayQueryDetail = {};\n const queryOverlayDetailEvent =\n new CustomEvent<OverlayDisplayQueryDetail>('sp-overlay-query', {\n bubbles: true,\n composed: true,\n detail: overlayDetailQuery,\n cancelable: true,\n });\n this.overlayElement.dispatchEvent(queryOverlayDetailEvent);\n\n await Overlay.overlayStack.openOverlay({\n abortPromise,\n content: this.overlayElement,\n contentTip: overlayDetailQuery.overlayContentTipElement,\n delayed,\n offset: offset,\n placement: placement,\n trigger: this.owner,\n interaction: this.interaction,\n theme: queryThemeDetail,\n receivesFocus,\n root,\n notImmediatelyClosable,\n virtualTrigger,\n ...overlayDetailQuery,\n });\n this.isOpen = true;\n return true;\n }\n\n /**\n * Close the overlay if it is open\n */\n public close(): void {\n Overlay.overlayStack.closeOverlay(this.overlayElement);\n }\n}\n\n/**\n * Announces that an overlay-based UI element has opened\n * @event sp-open\n * @type {object}\n * @property {TriggerInteractions} interaction type of interaction that triggered the opening\n */\n\n/**\n * Announces that an overlay-based UI element has opened\n * @event sp-close\n * @type {object}\n * @property {TriggerInteractions} interaction type of interaction that triggered the closing\n */\n"],
|
|
5
|
-
"mappings": "aAkBA,OAAS,gBAAAA,MAAoB,qBAMtB,MAAMC,EAAN,KAAc,CAcjB,YACIC,EACAC,EACAC,EACF,CAfF,KAAQ,OAAS,GAgBb,KAAK,MAAQF,EACb,KAAK,eAAiBE,EACtB,KAAK,YAAcD,CACvB,CAcA,aAAoB,KAChBD,EACAC,EACAC,EACAC,EACmB,CACnB,MAAMC,EAAU,IAAIL,EAAQC,EAAOC,EAAaC,CAAc,EAY9D,aAAME,EAAQ,KAAKD,CAAO,EACnB,IAAY,CACfC,EAAQ,MAAM,CAClB,CACJ,CAEA,OAAc,QAAe,CACzB,MAAMC,EAAqB,IAAI,YAAY,qBAAsB,CAC7D,QAAS,GACT,SAAU,GACV,WAAY,EAChB,CAAC,EACD,SAAS,cAAcA,CAAkB,CAC7C,CAWA,MAAa,KAAK,CACd,aAAAC,EACA,QAAAC,EACA,OAAAC,EAAS,EACT,UAAAC,EAAY,MACZ,cAAAC,EACA,uBAAAC,EACA,eAAAC,EACA,KAAAC,CACJ,EAAqC,CAEjC,GAAI,KAAK,OAAQ,MAAO,GAEpBN,IAAY,SACZA,EAAU,KAAK,eAAe,aAAa,SAAS,GAGxD,MAAMO,EAA8B,CAChC,MAAO,OACP,MAAO,OACP,KAAM,OACN,MAAO,MACX,EACMC,EAAkB,IAAI,YAAuB,iBAAkB,CACjE,QAAS,GACT,SAAU,GACV,OAAQD,EACR,WAAY,EAChB,CAAC,EACD,KAAK,MAAM,cAAcC,CAAe,EAExC,MAAMC,EAAgD,CAAC,EACjDC,EACF,IAAI,YAAuC,mBAAoB,CAC3D,QAAS,GACT,SAAU,GACV,OAAQD,EACR,WAAY,EAChB,CAAC,EACL,YAAK,eAAe,cAAcC,CAAuB,EAEzD,MAAMlB,EAAQ,aAAa,YAAY,CACnC,aAAAO,EACA,QAAS,KAAK,eACd,WAAYU,EAAmB,yBAC/B,QAAAT,EACA,OAAQC,EACR,UAAWC,EACX,QAAS,KAAK,MACd,YAAa,KAAK,YAClB,MAAOK,EACP,cAAAJ,EACA,KAAAG,EACA,uBAAAF,EACA,eAAAC,EACA,GAAGI,CACP,CAAC,EACD,KAAK,OAAS,GACP,EACX,CAKO,OAAc,CACjBjB,EAAQ,aAAa,aAAa,KAAK,cAAc,CACzD,CACJ,EAjJO,WAAM,QAANA,EAAM,QACM,aAAe,IAAID",
|
|
6
|
-
"names": ["OverlayStack", "_Overlay", "owner", "interaction", "overlayElement", "options", "overlay", "overlayUpdateEvent", "abortPromise", "delayed", "offset", "placement", "receivesFocus", "notImmediatelyClosable", "virtualTrigger", "root", "queryThemeDetail", "queryThemeEvent", "overlayDetailQuery", "queryOverlayDetailEvent"]
|
|
7
|
-
}
|
package/test/overlay.test.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["overlay.test.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*/\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport { Dialog } from '@spectrum-web-components/dialog';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { setViewport } from '@web/test-runner-commands';\nimport {\n ActiveOverlay,\n Overlay,\n OverlayTrigger,\n Placement,\n} from '@spectrum-web-components/overlay';\n\nimport { isVisible } from '../../../test/testing-helpers.js';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\nimport {\n definedOverlayElement,\n virtualElement,\n} from '../stories/overlay.stories';\nimport { PopoverContent } from '../stories/overlay-story-components.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\n\ndescribe('Overlays', () => {\n let testDiv!: HTMLDivElement;\n let openOverlays: (() => void)[] = [];\n\n beforeEach(async () => {\n testDiv = await fixture<HTMLDivElement>(\n html`\n <div id=\"top\">\n <style>\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n #top {\n margin: 100px;\n }\n\n sp-button {\n flex: none;\n }\n\n #overlay-content {\n display: none;\n }\n </style>\n <sp-button\n id=\"first-button\"\n variant=\"primary\"\n slot=\"trigger\"\n >\n Show Popover\n </sp-button>\n <div id=\"overlay-content\">\n <sp-popover\n id=\"outer-popover\"\n slot=\"click-content\"\n direction=\"bottom\"\n tip\n open\n >\n <sp-dialog class=\"options-popover-content\">\n A popover message\n </sp-dialog>\n </sp-popover>\n <div id=\"hover-1\" class=\"hover-content\">\n Hover message\n </div>\n <div id=\"hover-2\" class=\"hover-content\">\n Other hover message\n </div>\n </div>\n </div>\n `\n );\n await elementUpdated(testDiv);\n });\n\n afterEach(() => {\n openOverlays.map((close) => close());\n openOverlays = [];\n });\n\n [\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'top',\n 'top-start',\n 'top-end',\n 'left',\n 'left-start',\n 'left-end',\n 'right',\n 'right-start',\n 'right-end',\n 'none',\n ].map((direction) => {\n const placement = direction as Placement;\n it(`opens a popover - ${placement}`, async () => {\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const outerPopover = testDiv.querySelector(\n '#outer-popover'\n ) as Popover;\n\n expect(outerPopover.parentElement).to.exist;\n if (outerPopover.parentElement) {\n expect(outerPopover.parentElement.id).to.equal(\n 'overlay-content'\n );\n }\n\n expect(isVisible(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(button, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'click', outerPopover, {\n delayed: false,\n placement,\n offset: 10,\n })\n );\n await opened;\n\n expect(outerPopover.parentElement).to.exist;\n if (outerPopover.parentElement) {\n expect(outerPopover.parentElement.id).not.to.equal(\n 'overlay-content'\n );\n }\n expect(isVisible(outerPopover)).to.be.true;\n });\n });\n\n it(`updates a popover`, async () => {\n const button = testDiv.querySelector('#first-button') as HTMLElement;\n const outerPopover = testDiv.querySelector('#outer-popover') as Popover;\n\n expect(outerPopover.parentElement).to.exist;\n if (outerPopover.parentElement) {\n expect(outerPopover.parentElement.id).to.equal('overlay-content');\n }\n\n expect(isVisible(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(button, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'click', outerPopover, {\n delayed: false,\n offset: 10,\n })\n );\n await opened;\n\n expect(isVisible(outerPopover)).to.be.true;\n\n Overlay.update();\n\n expect(isVisible(outerPopover)).to.be.true;\n });\n\n it(`opens a popover w/ delay`, async () => {\n const button = testDiv.querySelector('#first-button') as HTMLElement;\n const outerPopover = testDiv.querySelector('#outer-popover') as Popover;\n\n expect(outerPopover.parentElement).to.exist;\n if (outerPopover.parentElement) {\n expect(outerPopover.parentElement.id).to.equal('overlay-content');\n }\n\n expect(isVisible(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(button, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'click', outerPopover, {\n delayed: true,\n offset: 10,\n })\n );\n await opened;\n\n expect(outerPopover.parentElement).to.exist;\n if (outerPopover.parentElement) {\n expect(outerPopover.parentElement.id).not.to.equal(\n 'overlay-content'\n );\n }\n expect(isVisible(outerPopover)).to.be.true;\n });\n\n it('opens hover overlay', async () => {\n const button = testDiv.querySelector('#first-button') as HTMLElement;\n const hoverOverlay = testDiv.querySelector('#hover-1') as HTMLElement;\n const clickOverlay = testDiv.querySelector(\n '#outer-popover'\n ) as HTMLElement;\n\n expect(isVisible(hoverOverlay)).to.be.false;\n expect(isVisible(clickOverlay)).to.be.false;\n\n let opened = oneEvent(button, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'hover', hoverOverlay, {\n delayed: false,\n placement: 'top',\n offset: 10,\n })\n );\n await opened;\n\n expect(hoverOverlay.parentElement).to.exist;\n if (hoverOverlay.parentElement) {\n expect(hoverOverlay.parentElement.id).not.to.equal(\n 'overlay-content'\n );\n }\n expect(isVisible(hoverOverlay)).to.be.true;\n\n opened = oneEvent(button, 'sp-opened');\n // Opening click overlay should close the hover overlay\n openOverlays.push(\n await Overlay.open(button, 'click', clickOverlay, {\n delayed: false,\n placement: 'bottom',\n offset: 10,\n })\n );\n await opened;\n if (hoverOverlay.parentElement) {\n expect(hoverOverlay.parentElement.id).to.equal('overlay-content');\n }\n\n expect(isVisible(hoverOverlay)).to.be.false;\n expect(isVisible(clickOverlay)).to.be.true;\n });\n\n it('opens custom overlay', async () => {\n const button = testDiv.querySelector('#first-button') as HTMLElement;\n const customOverlay = testDiv.querySelector('#hover-1') as HTMLElement;\n const clickOverlay = testDiv.querySelector(\n '#outer-popover'\n ) as HTMLElement;\n\n expect(button).to.exist;\n expect(customOverlay).to.exist;\n\n expect(isVisible(customOverlay)).to.be.false;\n expect(isVisible(clickOverlay)).to.be.false;\n\n let opened = oneEvent(button, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'custom', customOverlay, {\n delayed: false,\n placement: 'top',\n offset: 10,\n })\n );\n await opened;\n\n expect(customOverlay.parentElement).to.exist;\n if (customOverlay.parentElement) {\n expect(customOverlay.parentElement.id).not.to.equal(\n 'overlay-content'\n );\n }\n expect(isVisible(customOverlay)).to.be.true;\n\n opened = oneEvent(button, 'sp-opened');\n // Opening click overlay should close the hover overlay\n openOverlays.push(\n await Overlay.open(button, 'click', clickOverlay, {\n delayed: false,\n placement: 'bottom',\n offset: 10,\n })\n );\n await opened;\n\n expect(isVisible(customOverlay)).to.be.true;\n expect(isVisible(clickOverlay)).to.be.true;\n });\n\n it('closes via events', async () => {\n const el = await fixture<HTMLDivElement>(html`\n <div id=\"root\">\n <sp-dialog dismissable></sp-dialog>\n </div>\n `);\n\n const dialog = el.querySelector('sp-dialog') as Dialog;\n\n const opened = oneEvent(el, 'sp-opened');\n openOverlays.push(\n await Overlay.open(el, 'click', dialog, {\n delayed: false,\n placement: 'bottom',\n offset: 10,\n })\n );\n await opened;\n\n dialog.close();\n\n await waitUntil(\n () =>\n !!dialog.parentElement &&\n dialog.parentElement.tagName !== 'ACTIVE-OVERLAY',\n 'content is returned'\n );\n });\n\n it('closes an inline overlay when tabbing past the content', async () => {\n const el = await fixture<HTMLDivElement>(html`\n <div>\n <sp-button class=\"trigger\">Trigger</sp-button>\n <div class=\"content\">\n <input />\n </div>\n <input value=\"After\" id=\"after\" />\n </div>\n `);\n\n const trigger = el.querySelector('.trigger') as HTMLElement;\n const content = el.querySelector('.content') as HTMLElement;\n const input = el.querySelector('input') as HTMLInputElement;\n const after = el.querySelector('#after') as HTMLAnchorElement;\n\n openOverlays.push(await Overlay.open(trigger, 'inline', content, {}));\n\n trigger.focus();\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(input);\n expect(input.closest('active-overlay') !== null);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(trigger);\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(input);\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(after);\n await waitUntil(\n () => document.querySelector('active-overlay') === null\n );\n });\n\n it('closes an inline overlay when tabbing before the trigger', async () => {\n const el = await fixture<HTMLDivElement>(html`\n <div>\n <input value=\"Before\" id=\"before\" />\n <sp-button class=\"trigger\">Trigger</sp-button>\n <div class=\"content\">\n <label>\n Content in an inline overlay.\n <input />\n </label>\n </div>\n </div>\n `);\n\n const trigger = el.querySelector('.trigger') as HTMLElement;\n const content = el.querySelector('.content') as HTMLElement;\n const input = el.querySelector('.content input') as HTMLInputElement;\n const before = el.querySelector('#before') as HTMLAnchorElement;\n\n openOverlays.push(await Overlay.open(trigger, 'inline', content, {}));\n\n trigger.focus();\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(input);\n expect(input.closest('active-overlay') !== null);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(trigger);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(before);\n await waitUntil(\n () => document.querySelector('active-overlay') === null\n );\n });\n\n it('opens detached content', async () => {\n const textContent = 'This is a detached element that has been overlaid';\n const el = await fixture<HTMLButtonElement>(\n html`\n <button>Trigger</button>\n `\n );\n\n const content = document.createElement('div');\n content.textContent = textContent;\n\n const opened = oneEvent(el, 'sp-opened');\n const closeOverlay = await Overlay.open(el, 'click', content, {\n placement: 'bottom',\n });\n await opened;\n\n let activeOverlay = document.querySelector('active-overlay');\n\n if (activeOverlay) {\n expect(activeOverlay.textContent).to.equal(textContent);\n } else {\n expect(activeOverlay).to.not.be.null;\n }\n\n const closed = oneEvent(el, 'sp-closed');\n closeOverlay();\n await closed;\n\n activeOverlay = document.querySelector('active-overlay');\n\n expect(activeOverlay).to.be.null;\n\n content.remove();\n });\n});\ndescribe('Overlay - type=\"modal\"', () => {\n it('closes on `contextmenu` and passes that to the underlying page', async () => {\n await fixture<HTMLDivElement>(html`\n ${virtualElement({\n ...virtualElement.args,\n offset: 6,\n })}\n `);\n const width = window.innerWidth;\n const height = window.innerHeight;\n let opened = oneEvent(document, 'sp-opened');\n // Right click to open \"context menu\" overlay.\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [width / 2 + 50, height / 2],\n },\n {\n type: 'click',\n options: {\n button: 'right',\n },\n position: [width / 2 + 50, height / 2],\n },\n ],\n });\n await opened;\n const firstOverlay = document.querySelector(\n 'active-overlay'\n ) as ActiveOverlay;\n const firstHeadline = firstOverlay.querySelector(\n '[slot=\"header\"]'\n ) as HTMLSpanElement;\n expect(firstOverlay, 'first overlay').to.not.be.null;\n expect(firstOverlay.isConnected).to.be.true;\n expect(firstHeadline.textContent).to.equal('Menu source: end');\n let closed = oneEvent(document, 'sp-closed');\n opened = oneEvent(document, 'sp-opened');\n // Right click to out of the \"context menu\" overlay to both close\n // the first overlay and have the event passed to the surfacing page\n // in order to open a subsequent \"context menu\" overlay.\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [width / 4, height / 4],\n },\n {\n type: 'click',\n options: {\n button: 'right',\n },\n position: [width / 4, height / 4],\n },\n ],\n });\n await closed;\n await opened;\n const secondOverlay = document.querySelector(\n 'active-overlay'\n ) as ActiveOverlay;\n const secondHeadline = secondOverlay.querySelector(\n '[slot=\"header\"]'\n ) as HTMLSpanElement;\n expect(secondOverlay, 'second overlay').to.not.be.null;\n expect(secondOverlay).to.not.equal(firstOverlay);\n expect(firstOverlay.isConnected).to.be.false;\n expect(secondOverlay.isConnected).to.be.true;\n expect(secondHeadline.textContent).to.equal('Menu source: start');\n closed = oneEvent(document, 'sp-closed');\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [width / 8, height / 8],\n },\n {\n type: 'click',\n position: [width / 8, height / 8],\n },\n ],\n });\n await closed;\n await nextFrame();\n });\n\n it('does not open content off of the viewport', async () => {\n await fixture<HTMLDivElement>(html`\n ${virtualElement({\n ...virtualElement.args,\n offset: 6,\n })}\n `);\n\n await setViewport({ width: 360, height: 640 });\n // Allow viewport update to propagate.\n await nextFrame();\n\n const opened = oneEvent(document, 'sp-opened');\n // Right click to open \"context menu\" overlay.\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [270, 10],\n },\n {\n type: 'click',\n options: {\n button: 'right',\n },\n position: [270, 10],\n },\n ],\n });\n await opened;\n\n const activeOverlay = document.querySelector(\n 'active-overlay'\n ) as ActiveOverlay;\n\n expect(activeOverlay.placement).to.equal('right-start');\n expect(activeOverlay.getAttribute('actual-placement')).to.equal(\n 'bottom'\n );\n\n const closed = oneEvent(document, 'sp-closed');\n sendKeys({\n press: 'Escape',\n });\n await closed;\n await nextFrame();\n });\n\n it('opens children in the modal stack through shadow roots', async () => {\n const el = await fixture<OverlayTrigger>(definedOverlayElement());\n const trigger = el.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n let open = oneEvent(el, 'sp-opened');\n trigger.click();\n await open;\n const content = document.querySelector(\n 'popover-content'\n ) as PopoverContent;\n open = oneEvent(content, 'sp-opened');\n content.button.click();\n await open;\n const activeOverlays = document.querySelectorAll('active-overlay');\n activeOverlays.forEach((overlay) => {\n expect(overlay.slot).to.equal('open');\n });\n let close = oneEvent(content, 'sp-closed');\n content.trigger.removeAttribute('open');\n await close;\n close = oneEvent(el, 'sp-closed');\n el.removeAttribute('open');\n await close;\n });\n});\ndescribe('Overlay - timing', () => {\n it('manages multiple modals in a row without preventing them from closing', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <overlay-trigger>\n <sp-button slot=\"trigger\">Trigger 1</sp-button>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 1\".</p>\n </sp-popover>\n </overlay-trigger>\n <overlay-trigger>\n <sp-button slot=\"trigger\">Trigger 2</sp-button>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 2\".</p>\n </sp-popover>\n <sp-popover slot=\"click-content\">\n <p>Click contentent for \"Trigger 2\".</p>\n </sp-popover>\n </overlay-trigger>\n </div>\n `);\n\n const overlayTrigger1 = test.querySelector(\n 'overlay-trigger:first-child'\n ) as OverlayTrigger;\n const overlayTrigger2 = test.querySelector(\n 'overlay-trigger:last-child'\n ) as OverlayTrigger;\n const trigger1 = overlayTrigger1.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n const trigger2 = overlayTrigger2.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n\n const boundingRectTrigger1 = trigger1.getBoundingClientRect();\n const boundingRectTrigger2 = trigger2.getBoundingClientRect();\n const trigger1Position: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width / 2,\n boundingRectTrigger1.top + boundingRectTrigger1.height / 2,\n ];\n const outsideTrigger1: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width * 2,\n boundingRectTrigger1.top + boundingRectTrigger1.height * 2,\n ];\n const trigger2Position: [number, number] = [\n boundingRectTrigger2.left + boundingRectTrigger2.width / 2,\n boundingRectTrigger2.top + boundingRectTrigger2.height / 2,\n ];\n const outsideTrigger2: [number, number] = [\n boundingRectTrigger2.left + boundingRectTrigger2.width * 2,\n boundingRectTrigger2.top + boundingRectTrigger2.height / 2,\n ];\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger1Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: outsideTrigger1,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger2Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n const opened = oneEvent(trigger2, 'sp-opened');\n sendMouse({\n steps: [\n {\n type: 'click',\n position: trigger2Position,\n },\n ],\n });\n await opened;\n\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open')).to.be.true;\n expect(overlayTrigger2.getAttribute('open')).to.equal('click');\n\n const closed = oneEvent(overlayTrigger2, 'sp-closed');\n sendMouse({\n steps: [\n {\n type: 'click',\n position: outsideTrigger2,\n },\n ],\n });\n await closed;\n\n // sometimes safari needs to wait a few frames for the open attribute to update\n for (let i = 0; i < 3; i++) await nextFrame();\n\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open'), overlayTrigger2.open).to.be\n .false;\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAWA,OAAO;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