@spectrum-web-components/overlay 0.42.2 → 0.42.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/custom-elements.json +285 -114
  2. package/package.json +15 -7
  3. package/src/AbstractOverlay.d.ts +2 -30
  4. package/src/AbstractOverlay.dev.js +0 -37
  5. package/src/AbstractOverlay.dev.js.map +2 -2
  6. package/src/AbstractOverlay.js +1 -1
  7. package/src/AbstractOverlay.js.map +3 -3
  8. package/src/ClickController.dev.js +2 -2
  9. package/src/ClickController.dev.js.map +2 -2
  10. package/src/ClickController.js +1 -1
  11. package/src/ClickController.js.map +2 -2
  12. package/src/HoverController.d.ts +1 -0
  13. package/src/HoverController.dev.js +26 -20
  14. package/src/HoverController.dev.js.map +2 -2
  15. package/src/HoverController.js +1 -1
  16. package/src/HoverController.js.map +2 -2
  17. package/src/InteractionController.d.ts +18 -4
  18. package/src/InteractionController.dev.js +46 -5
  19. package/src/InteractionController.dev.js.map +2 -2
  20. package/src/InteractionController.js +1 -1
  21. package/src/InteractionController.js.map +3 -3
  22. package/src/LongpressController.dev.js +15 -16
  23. package/src/LongpressController.dev.js.map +2 -2
  24. package/src/LongpressController.js +1 -1
  25. package/src/LongpressController.js.map +3 -3
  26. package/src/Overlay.d.ts +3 -8
  27. package/src/Overlay.dev.js +18 -34
  28. package/src/Overlay.dev.js.map +2 -2
  29. package/src/Overlay.js +2 -2
  30. package/src/Overlay.js.map +3 -3
  31. package/src/OverlayDialog.dev.js +2 -3
  32. package/src/OverlayDialog.dev.js.map +2 -2
  33. package/src/OverlayDialog.js +1 -1
  34. package/src/OverlayDialog.js.map +3 -3
  35. package/src/OverlayNoPopover.dev.js +5 -3
  36. package/src/OverlayNoPopover.dev.js.map +2 -2
  37. package/src/OverlayNoPopover.js +1 -1
  38. package/src/OverlayNoPopover.js.map +3 -3
  39. package/src/OverlayPopover.dev.js +5 -3
  40. package/src/OverlayPopover.dev.js.map +2 -2
  41. package/src/OverlayPopover.js +1 -1
  42. package/src/OverlayPopover.js.map +3 -3
  43. package/src/OverlayStack.dev.js +7 -15
  44. package/src/OverlayStack.dev.js.map +2 -2
  45. package/src/OverlayStack.js +1 -1
  46. package/src/OverlayStack.js.map +3 -3
  47. package/src/OverlayTrigger.d.ts +1 -1
  48. package/src/OverlayTrigger.dev.js +1 -2
  49. package/src/OverlayTrigger.dev.js.map +2 -2
  50. package/src/OverlayTrigger.js.map +1 -1
  51. package/src/PlacementController.d.ts +1 -1
  52. package/src/PlacementController.dev.js +3 -6
  53. package/src/PlacementController.dev.js.map +1 -1
  54. package/src/events.d.ts +23 -0
  55. package/src/events.dev.js +39 -0
  56. package/src/events.dev.js.map +7 -0
  57. package/src/events.js +2 -0
  58. package/src/events.js.map +7 -0
  59. package/src/overlay-events.js +1 -1
  60. package/src/overlay-trigger-directive.d.ts +5 -6
  61. package/src/overlay-trigger-directive.dev.js +12 -11
  62. package/src/overlay-trigger-directive.dev.js.map +2 -2
  63. package/src/overlay-trigger-directive.js +1 -1
  64. package/src/overlay-trigger-directive.js.map +3 -3
  65. package/src/overlay-types.d.ts +10 -10
  66. package/src/slottable-request-directive.d.ts +1 -1
  67. package/src/slottable-request-directive.dev.js +7 -4
  68. package/src/slottable-request-directive.dev.js.map +2 -2
  69. package/src/slottable-request-directive.js +1 -1
  70. package/src/slottable-request-directive.js.map +2 -2
  71. package/src/slottable-request-event.js +1 -1
  72. package/src/strategies.d.ts +8 -0
  73. package/src/strategies.dev.js +10 -0
  74. package/src/strategies.dev.js.map +7 -0
  75. package/src/strategies.js +2 -0
  76. package/src/strategies.js.map +7 -0
  77. package/stories/overlay-element.stories.js +22 -0
  78. package/stories/overlay-element.stories.js.map +2 -2
  79. package/stories/overlay-story-components.js +6 -12
  80. package/stories/overlay-story-components.js.map +1 -1
  81. package/stories/overlay.stories.js +3 -4
  82. package/stories/overlay.stories.js.map +2 -2
  83. package/test/index.js +10 -10
  84. package/test/index.js.map +2 -2
  85. package/test/overlay-element.test.js +69 -28
  86. package/test/overlay-element.test.js.map +2 -2
  87. package/test/overlay-memory.test.js +10 -0
  88. package/test/overlay-memory.test.js.map +7 -0
  89. package/test/overlay-update.test.js +1 -0
  90. package/test/overlay-update.test.js.map +2 -2
  91. package/test/overlay-v1.test.js +2 -1
  92. package/test/overlay-v1.test.js.map +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-element.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 {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from '../src/slottable-request-event.js';\nimport { stub } from 'sinon';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('`slottable-request` event', () => {\n it('dispatched before `sp-opened`', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n @sp-opened=${() => (openedTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lt(openedTime);\n });\n it('dispatched after `sp-closed`', async function () {\n let slottableRequestTime = 0;\n let closedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @sp-closed=${() => (closedTime = performance.now())}\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n await nextFrame();\n await nextFrame();\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n await nextFrame();\n await nextFrame();\n\n expect(\n slottableRequestTime,\n `slottable-request: ${slottableRequestTime}, sp-closed: ${closedTime}`\n ).to.be.gt(closedTime);\n });\n it('follows transition timing from lazily added children', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const popover = document.createElement('sp-popover');\n popover.textContent = 'Test';\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${(event: SlottableRequestEvent) => {\n slottableRequestTime = performance.now();\n if (event.data !== removeSlottableRequest) {\n (event.target as HTMLElement).append(popover);\n } else {\n popover.remove();\n }\n }}\n @sp-opened=${() => (openedTime = performance.now())}\n ></sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lte(openedTime);\n expect(openedTime - slottableRequestTime).to.be.gt(130);\n });\n\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `slottable-request` events are experimental', async () => {\n const el = await fixture<Overlay>(html`\n <sp-overlay>\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes(\n '`slottable-request` events are experimental'\n ),\n '`slottable-request`-centric message'\n ).to.be.true;\n expect(\n spyCall.args.at(-1),\n 'confirm `data` shape'\n ).to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n });\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when manually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n it('does not close when pressing `Escape`', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
5
- "mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,qBAAqB;AACrC;AAAA,EACI;AAAA,OAEG;AACP,SAAS,YAAY;AAErB,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAiC;AACzD,OAAG,cAAc,WAAW,OAAO,YAAY;AAC3C,YAAM,KAAK,MAAM,cAAuB;AAAA,wCACZ,WAAW;AAAA;AAAA;AAAA,aAGtC;AAC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I,WAAW;AACvC,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AACD,SAAG,yCAAyC,YAAY;AACpD,cAAM,OAAO,MAAM,QAAQ;AAAA;AAAA,0BAEjB,MAAM;AAAA,UACJ,GAAG,MAAM;AAAA,UACT,aAAa;AAAA,UACb,WAAW;AAAA,UACX,MAAM;AAAA,UACN,SAAS;AAAA,UACT,eAAe;AAAA,QACnB,CAAC,CAAC;AAAA;AAAA,iBAET;AACD,cAAM,KAAK,KAAK,cAAc,YAAY;AAE1C,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,YAAI,EAAE,QAAQ,IAAI,MAAM;AACxB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,cAAM,SAAS;AAAA,UACX,OAAO;AAAA,QACX,CAAC;AAED,cAAM,SAAS,GAAG;AAElB,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
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 {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport {\n click,\n receivesFocus,\n withSlider,\n} from '../stories/overlay-element.stories.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from '../src/slottable-request-event.js';\nimport { stub } from 'sinon';\nimport { OverlayStateEvent } from '@spectrum-web-components/overlay/src/events.js';\nimport { Slider } from '@spectrum-web-components/slider/src/Slider.js';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = (typeof OVERLAY_TYPES)[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('`slottable-request` event', () => {\n it('dispatched before `sp-opened`', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n @sp-opened=${() => (openedTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lt(openedTime);\n });\n it('dispatched after `sp-closed`', async function () {\n let slottableRequestTime = 0;\n let closedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @sp-closed=${() => (closedTime = performance.now())}\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n await nextFrame();\n await nextFrame();\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n await nextFrame();\n await nextFrame();\n\n expect(\n slottableRequestTime,\n `slottable-request: ${slottableRequestTime}, sp-closed: ${closedTime}`\n ).to.be.gt(closedTime);\n });\n it('follows transition timing from lazily added children', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const popover = document.createElement('sp-popover');\n popover.textContent = 'Test';\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${(event: SlottableRequestEvent) => {\n slottableRequestTime = performance.now();\n if (event.data !== removeSlottableRequest) {\n (event.target as HTMLElement).append(popover);\n } else {\n popover.remove();\n }\n }}\n @sp-opened=${() => (openedTime = performance.now())}\n ></sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lte(openedTime);\n expect(openedTime - slottableRequestTime).to.be.gt(130);\n });\n\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `slottable-request` events are experimental', async () => {\n const el = await fixture<Overlay>(html`\n <sp-overlay>\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes(\n '`slottable-request` events are experimental'\n ),\n '`slottable-request`-centric message'\n ).to.be.true;\n expect(\n spyCall.args.at(-1),\n 'confirm `data` shape'\n ).to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n });\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(html`\n <div>\n <sp-button id=\"test-button\">This is a button.</sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `);\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `);\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n it('does not close when clicking a Slider track in the Overlay', async function () {\n const test = await fixture(html`\n <div>${withSlider()}</div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n const button = test.querySelector('sp-button') as Button;\n const slider = el.querySelector('sp-slider') as Slider;\n const track = slider.shadowRoot.querySelector(\n '#track'\n ) as HTMLDivElement;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n const buttonRect = button.getBoundingClientRect();\n sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n buttonRect.left + buttonRect.width / 2,\n buttonRect.top + buttonRect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n expect(slider.value).to.equal(5);\n\n const sliderRect = track.getBoundingClientRect();\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n sliderRect.left + sliderRect.width - 5,\n sliderRect.top + sliderRect.height / 2,\n ],\n },\n ],\n });\n\n await aTimeout(500);\n\n expect(slider.value).to.equal(19.5);\n expect(el.open).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when manually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent<OverlayStateEvent>(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent<OverlayStateEvent>(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n it('does not close when pressing `Escape`', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent<OverlayStateEvent>(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent<OverlayStateEvent>(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
5
+ "mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP;AAAA,EACI;AAAA,OAEG;AACP,SAAS,YAAY;AAIrB,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,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AM,SAAS,SAA4B,IAAI,WAAW;AAC1D,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AACD,SAAG,yCAAyC,YAAY;AACpD,cAAM,OAAO,MAAM,QAAQ;AAAA;AAAA,0BAEjB,MAAM;AAAA,UACJ,GAAG,MAAM;AAAA,UACT,aAAa;AAAA,UACb,WAAW;AAAA,UACX,MAAM;AAAA,UACN,SAAS;AAAA,UACT,eAAe;AAAA,QACnB,CAAC,CAAC;AAAA;AAAA,iBAET;AACD,cAAM,KAAK,KAAK,cAAc,YAAY;AAE1C,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAA4B,IAAI,WAAW;AAC1D,WAAG,OAAO;AACV,YAAI,EAAE,QAAQ,IAAI,MAAM;AACxB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,cAAM,SAAS;AAAA,UACX,OAAO;AAAA,QACX,CAAC;AAED,cAAM,SAAS,GAAG;AAElB,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAA4B,IAAI,WAAW;AAC1D,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ import { Default } from "../stories/overlay.stories.js";
3
+ import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
4
+ testForMemoryLeaks(
5
+ Default({
6
+ placement: "bottom",
7
+ offset: 0
8
+ })
9
+ );
10
+ //# sourceMappingURL=overlay-memory.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["overlay-memory.test.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\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 { Default } from '../stories/overlay.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\n// Defualt Overlay\ntestForMemoryLeaks(\n Default({\n placement: 'bottom',\n offset: 0,\n })\n);\n"],
5
+ "mappings": ";AAWA,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAGnC;AAAA,EACI,QAAQ;AAAA,IACJ,WAAW;AAAA,IACX,QAAQ;AAAA,EACZ,CAAC;AACL;",
6
+ "names": []
7
+ }
@@ -14,6 +14,7 @@ describe("sp-update-overlays event", () => {
14
14
  '[label="Other things"]'
15
15
  );
16
16
  el.content = "click";
17
+ await elementUpdated(item);
17
18
  const opened = oneEvent(el, "sp-opened");
18
19
  el.open = "click";
19
20
  await opened;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-update.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 { elementUpdated, expect, oneEvent } from '@open-wc/testing';\nimport { AccordionItem } from '@spectrum-web-components/accordion/src/AccordionItem.js';\nimport { OverlayTrigger } from '../src/OverlayTrigger.js';\nimport { accordion } from '../stories/overlay.stories.js';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\n\ndescribe('sp-update-overlays event', () => {\n ignoreResizeObserverLoopError(before, after);\n it('updates overlay height', async () => {\n const el = await fixture<OverlayTrigger>(accordion());\n const container = el.querySelector('sp-popover') as HTMLElement;\n const item = el.querySelector(\n '[label=\"Other things\"]'\n ) as AccordionItem;\n\n el.content = 'click';\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = 'click';\n await opened;\n\n const height1 = container.getBoundingClientRect().height;\n item.click();\n await elementUpdated(item);\n\n const height2 = container.getBoundingClientRect().height;\n expect(height1).to.be.lessThan(height2);\n });\n});\n"],
5
- "mappings": ";AAWA,SAAS,gBAAgB,QAAQ,gBAAgB;AAGjD,SAAS,iBAAiB;AAC1B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,SAAS,4BAA4B,MAAM;AACvC,gCAA8B,QAAQ,KAAK;AAC3C,KAAG,0BAA0B,YAAY;AACrC,UAAM,KAAK,MAAM,QAAwB,UAAU,CAAC;AACpD,UAAM,YAAY,GAAG,cAAc,YAAY;AAC/C,UAAM,OAAO,GAAG;AAAA,MACZ;AAAA,IACJ;AAEA,OAAG,UAAU;AAEb,UAAM,SAAS,SAAS,IAAI,WAAW;AACvC,OAAG,OAAO;AACV,UAAM;AAEN,UAAM,UAAU,UAAU,sBAAsB,EAAE;AAClD,SAAK,MAAM;AACX,UAAM,eAAe,IAAI;AAEzB,UAAM,UAAU,UAAU,sBAAsB,EAAE;AAClD,WAAO,OAAO,EAAE,GAAG,GAAG,SAAS,OAAO;AAAA,EAC1C,CAAC;AACL,CAAC;",
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 { elementUpdated, expect, oneEvent } from '@open-wc/testing';\nimport { AccordionItem } from '@spectrum-web-components/accordion/src/AccordionItem.js';\nimport { OverlayTrigger } from '../src/OverlayTrigger.js';\nimport { accordion } from '../stories/overlay.stories.js';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\n\ndescribe('sp-update-overlays event', () => {\n ignoreResizeObserverLoopError(before, after);\n it('updates overlay height', async () => {\n const el = await fixture<OverlayTrigger>(accordion());\n const container = el.querySelector('sp-popover') as HTMLElement;\n const item = el.querySelector(\n '[label=\"Other things\"]'\n ) as AccordionItem;\n\n el.content = 'click';\n await elementUpdated(item);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = 'click';\n await opened;\n\n const height1 = container.getBoundingClientRect().height;\n item.click();\n await elementUpdated(item);\n\n const height2 = container.getBoundingClientRect().height;\n expect(height1).to.be.lessThan(height2);\n });\n});\n"],
5
+ "mappings": ";AAWA,SAAS,gBAAgB,QAAQ,gBAAgB;AAGjD,SAAS,iBAAiB;AAC1B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,SAAS,4BAA4B,MAAM;AACvC,gCAA8B,QAAQ,KAAK;AAC3C,KAAG,0BAA0B,YAAY;AACrC,UAAM,KAAK,MAAM,QAAwB,UAAU,CAAC;AACpD,UAAM,YAAY,GAAG,cAAc,YAAY;AAC/C,UAAM,OAAO,GAAG;AAAA,MACZ;AAAA,IACJ;AAEA,OAAG,UAAU;AACb,UAAM,eAAe,IAAI;AAEzB,UAAM,SAAS,SAAS,IAAI,WAAW;AACvC,OAAG,OAAO;AACV,UAAM;AAEN,UAAM,UAAU,UAAU,sBAAsB,EAAE;AAClD,SAAK,MAAM;AACX,UAAM,eAAe,IAAI;AAEzB,UAAM,UAAU,UAAU,sBAAsB,EAAE;AAClD,WAAO,OAAO,EAAE,GAAG,GAAG,SAAS,OAAO;AAAA,EAC1C,CAAC;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -300,7 +300,8 @@ describe("Overlays, v1", () => {
300
300
  expect(await isOnTopLayer(clickOverlay), "click content open").to.be.true;
301
301
  });
302
302
  });
303
- it("closes via events", async () => {
303
+ it("closes via events", async function() {
304
+ this.retries(0);
304
305
  const test = await fixture(html`
305
306
  <div>
306
307
  <sp-popover id="root">
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-v1.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 '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.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 Overlay,\n OverlayTrigger,\n Placement,\n} from '@spectrum-web-components/overlay';\n\nimport {\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\nimport {\n definedOverlayElement,\n virtualElementV1,\n} from '../stories/overlay.stories';\nimport { PopoverContent } from '../stories/overlay-story-components.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { render, TemplateResult } from '@spectrum-web-components/base';\nimport {\n fixture,\n isInteractive,\n isOnTopLayer,\n} from '../../../test/testing-helpers.js';\nimport { Menu } from '@spectrum-web-components/menu';\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Overlays, v1', () => {\n let testDiv!: HTMLDivElement;\n let openOverlays: (() => void)[] = [];\n\n describe('shared fixture', () => {\n beforeEach(async () => {\n testDiv = await styledFixture<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 id=\"first-button\" variant=\"primary\">\n Show Popover\n </sp-button>\n <div id=\"overlay-content\">\n <sp-popover\n id=\"outer-popover\"\n direction=\"bottom\"\n tip\n >\n <sp-dialog no-divider>\n <div class=\"options-popover-content\">\n A popover message\n </div>\n <sp-button id=\"outer-focus-target\">\n Test 1\n </sp-button>\n <sp-button>Test 2</sp-button>\n <sp-button>Test 3</sp-button>\n </sp-dialog>\n </sp-popover>\n <sp-tooltip id=\"hover-1\" class=\"hover-content\">\n Hover message\n </sp-tooltip>\n <sp-tooltip id=\"hover-2\" class=\"hover-content\">\n Other hover message\n </sp-tooltip>\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(await isInteractive(outerPopover)).to.be.false;\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, '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 expect(await isInteractive(outerPopover)).to.be.true;\n });\n });\n\n it(`opens a modal dialog`, 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(await isInteractive(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'modal', outerPopover, {\n delayed: false,\n })\n );\n await opened;\n\n const firstFocused = outerPopover.querySelector(\n '#outer-focus-target'\n ) as HTMLElement;\n expect(document.activeElement === firstFocused).to.be.true;\n\n /**\n * Tab cycle is awkward in the headless browser, forward tab to just before the known end of the page\n * and the backward tab past the known beginning of the page. Test that you never focused the button\n * that triggered the dialog and is outside of the modal. A test that was able to cycle would be better.\n */\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n });\n\n it(`updates a popover`, 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(await isInteractive(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, '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(await isInteractive(outerPopover)).to.be.true;\n\n Overlay.update();\n\n expect(await isInteractive(outerPopover)).to.be.true;\n });\n\n it(`opens a popover w/ delay`, 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(await isInteractive(outerPopover)).to.be.false;\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, 'sp-opened');\n const start = performance.now();\n openOverlays.push(\n await Overlay.open(button, 'click', outerPopover, {\n delayed: true,\n offset: 10,\n })\n );\n await opened;\n const end = performance.now();\n expect(await isInteractive(outerPopover)).to.be.true;\n expect(end - start).to.be.greaterThan(1000);\n });\n\n it('opens hover overlay', async () => {\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const hoverOverlay = testDiv.querySelector(\n '#hover-1'\n ) as HTMLElement;\n const clickOverlay = testDiv.querySelector(\n '#outer-popover'\n ) as HTMLElement;\n\n expect(await isOnTopLayer(hoverOverlay)).to.be.false;\n expect(await isOnTopLayer(clickOverlay)).to.be.false;\n\n let opened = oneEvent(hoverOverlay, '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 expect(await isOnTopLayer(hoverOverlay)).to.be.true;\n\n opened = oneEvent(clickOverlay, 'sp-opened');\n const closed = oneEvent(hoverOverlay, 'sp-closed');\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 await closed;\n expect(\n await isInteractive(clickOverlay),\n 'click overlay not interactive'\n ).to.be.true;\n expect(\n await isOnTopLayer(hoverOverlay),\n 'hover overlay interactive'\n ).to.be.false;\n });\n\n it('opens custom overlay', async () => {\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const customOverlay = testDiv.querySelector(\n '#hover-1'\n ) 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(await isOnTopLayer(customOverlay)).to.be.false;\n expect(await isOnTopLayer(clickOverlay)).to.be.false;\n\n let opened = oneEvent(customOverlay, '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 expect(await isOnTopLayer(customOverlay)).to.be.true;\n\n opened = oneEvent(clickOverlay, 'sp-opened');\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 expect(await isOnTopLayer(clickOverlay), 'click content open').to.be\n .true;\n });\n });\n\n it('closes via events', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <sp-popover id=\"root\">\n <sp-dialog dismissable>\n Some Content for the Dialog.\n </sp-dialog>\n </sp-popover>\n </div>\n `);\n\n const el = test.querySelector('sp-popover') as Popover;\n const dialog = el.querySelector('sp-dialog') as Dialog;\n\n const opened = oneEvent(el, 'sp-opened');\n openOverlays.push(\n await Overlay.open(test, 'click', el, {\n delayed: false,\n placement: 'bottom',\n offset: 10,\n })\n );\n await opened;\n expect(await isOnTopLayer(el)).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n dialog.close();\n await closed;\n expect(await isOnTopLayer(el)).to.be.false;\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 <sp-popover class=\"content\">\n <input />\n </sp-popover>\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 const opened = oneEvent(content, 'sp-opened');\n openOverlays.push(\n await Overlay.open(trigger, 'inline', content, {\n receivesFocus: 'auto',\n })\n );\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n expect(document.activeElement).to.equal(input);\n\n const closed = oneEvent(content, 'sp-closed');\n await sendKeys({\n press: 'Shift+Tab',\n });\n await closed;\n\n expect(document.activeElement).to.equal(trigger);\n\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement).to.equal(after);\n expect(await isInteractive(content)).to.be.false;\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 const open = oneEvent(trigger, 'sp-opened');\n openOverlays.push(await Overlay.open(trigger, 'inline', content, {}));\n await open;\n\n expect(document.activeElement).to.equal(input);\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 });\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('sp-popover');\n content.textContent = textContent;\n\n const opened = oneEvent(content, 'sp-opened');\n const closeOverlay = await Overlay.open(el, 'click', content, {\n placement: 'bottom',\n });\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n\n const closed = oneEvent(content, 'sp-closed');\n closeOverlay();\n await closed;\n\n expect(await isInteractive(content)).to.be.false;\n\n content.remove();\n });\n});\ndescribe('Overlay - type=\"modal\", v1', () => {\n describe('handle multiple separate `contextmenu` events', async () => {\n let width = 0;\n let height = 0;\n let firstMenu: Popover;\n let firstRect: DOMRect;\n let secondMenu: Popover;\n let secondRect: DOMRect;\n before(async () => {\n render(\n html`\n <sp-theme color=\"light\" scale=\"large\">\n ${virtualElementV1({\n ...virtualElementV1.args,\n offset: 6,\n })}\n </sp-theme>\n `,\n document.body\n );\n\n width = window.innerWidth;\n height = window.innerHeight;\n });\n after(() => {\n document.querySelector('sp-theme')?.remove();\n });\n it('opens the first \"contextmenu\" overlay', async () => {\n const opened = oneEvent(document, 'sp-opened');\n // Right click to open \"context menu\" overlay.\n await 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 firstMenu = document.querySelector('sp-popover') as Popover;\n expect(firstMenu.textContent).to.include('Menu source: end');\n firstRect = firstMenu.getBoundingClientRect();\n expect(firstMenu).to.not.be.null;\n });\n it('closes the first \"contextmenu\" when opening a second', async () => {\n const closed = oneEvent(document, 'sp-closed');\n const opened = oneEvent(document, 'sp-opened');\n /**\n * Right click 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 *\n * Using `sendMouse` here triggers the light dismiss for some reason while\n * manual interacting in this way does not...\n */\n const trigger = document.querySelector(\n 'start-end-contextmenu'\n ) as HTMLElement;\n trigger.shadowRoot?.querySelector('#start')?.dispatchEvent(\n new Event('contextmenu', {\n composed: true,\n })\n );\n await nextFrame();\n trigger.shadowRoot?.querySelector('#start')?.dispatchEvent(\n new Event('pointerup', {\n composed: true,\n bubbles: true,\n })\n );\n await closed;\n await opened;\n secondMenu = document.querySelector('sp-popover') as Popover;\n expect(secondMenu.textContent).to.include('Menu source: start');\n secondRect = secondMenu.getBoundingClientRect();\n expect(secondMenu).to.not.be.null;\n });\n it('closes the second \"contextmenu\" when clicking away', async () => {\n const closed = oneEvent(document, 'sp-closed');\n sendMouse({\n steps: [\n {\n type: 'click',\n position: [width - width / 8, height - height / 8],\n },\n ],\n });\n await closed;\n expect(firstRect.top).to.not.equal(secondRect.top);\n expect(firstRect.left).to.not.equal(secondRect.left);\n });\n });\n\n it('does not open content off of the viewport', async () => {\n before(async () => {\n await setViewport({ width: 360, height: 640 });\n // Allow viewport update to propagate.\n await nextFrame();\n });\n after(async () => {\n await setViewport({ width: 800, height: 600 });\n // Allow viewport update to propagate.\n await nextFrame();\n });\n\n await fixture<HTMLDivElement>(html`\n ${virtualElementV1({\n ...virtualElementV1.args,\n offset: 6,\n })}\n `);\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 firstMenu = document.querySelector('sp-menu') as Menu;\n expect(firstMenu).to.not.be.null;\n expect(await isInteractive(firstMenu)).to.be.true;\n\n const closed = oneEvent(document, 'sp-closed');\n sendKeys({\n press: 'Escape',\n });\n await closed;\n\n expect(await isInteractive(firstMenu)).to.be.false;\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 expect(el.open).to.equal('click');\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 expect(content.trigger.open).to.equal('click');\n let close = oneEvent(content, 'sp-closed');\n content.trigger.removeAttribute('open');\n await close;\n expect(content.trigger.open).to.be.null;\n close = oneEvent(el, 'sp-closed');\n el.removeAttribute('open');\n await close;\n expect(el.open).to.be.null;\n });\n});\n"],
5
- "mappings": ";AAWA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAEP,SAAS,mBAAmB;AAC5B;AAAA,EACI;AAAA,OAGG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AAEP,SAAS,cAA8B;AACvC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,gBAAgB,MAAM;AAC3B,MAAI;AACJ,MAAI,eAA+B,CAAC;AAEpC,WAAS,kBAAkB,MAAM;AAC7B,eAAW,YAAY;AACnB,gBAAU,MAAM;AAAA,QACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAkDJ;AACA,YAAM,eAAe,OAAO;AAAA,IAChC,CAAC;AAED,cAAU,MAAM;AACZ,mBAAa,IAAI,CAAC,UAAU,MAAM,CAAC;AACnC,qBAAe,CAAC;AAAA,IACpB,CAAC;AAED;AAAA,MACI;AAAA,MACA;A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AM;AAEN,UAAM,YAAY,SAAS,cAAc,SAAS;AAClD,WAAO,SAAS,EAAE,GAAG,IAAI,GAAG;AAC5B,WAAO,MAAM,cAAc,SAAS,CAAC,EAAE,GAAG,GAAG;AAE7C,UAAM,SAAS,SAAS,UAAU,WAAW;AAC7C,aAAS;AAAA,MACL,OAAO;AAAA,IACX,CAAC;AACD,UAAM;AAEN,WAAO,MAAM,cAAc,SAAS,CAAC,EAAE,GAAG,GAAG;AAAA,EACjD,CAAC;AAED,KAAG,0DAA0D,YAAY;AACrE,UAAM,KAAK,MAAM,QAAwB,sBAAsB,CAAC;AAChE,UAAM,UAAU,GAAG;AAAA,MACf;AAAA,IACJ;AACA,QAAI,OAAO,SAAS,IAAI,WAAW;AACnC,YAAQ,MAAM;AACd,UAAM;AACN,WAAO,GAAG,IAAI,EAAE,GAAG,MAAM,OAAO;AAChC,UAAM,UAAU,SAAS;AAAA,MACrB;AAAA,IACJ;AACA,WAAO,SAAS,SAAS,WAAW;AACpC,YAAQ,OAAO,MAAM;AACrB,UAAM;AACN,WAAO,QAAQ,QAAQ,IAAI,EAAE,GAAG,MAAM,OAAO;AAC7C,QAAI,QAAQ,SAAS,SAAS,WAAW;AACzC,YAAQ,QAAQ,gBAAgB,MAAM;AACtC,UAAM;AACN,WAAO,QAAQ,QAAQ,IAAI,EAAE,GAAG,GAAG;AACnC,YAAQ,SAAS,IAAI,WAAW;AAChC,OAAG,gBAAgB,MAAM;AACzB,UAAM;AACN,WAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,EAC1B,CAAC;AACL,CAAC;",
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 '@spectrum-web-components/overlay/sp-overlay.js';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.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 Overlay,\n OverlayTrigger,\n Placement,\n} from '@spectrum-web-components/overlay';\n\nimport {\n elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\nimport {\n definedOverlayElement,\n virtualElementV1,\n} from '../stories/overlay.stories';\nimport { PopoverContent } from '../stories/overlay-story-components.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { render, TemplateResult } from '@spectrum-web-components/base';\nimport {\n fixture,\n isInteractive,\n isOnTopLayer,\n} from '../../../test/testing-helpers.js';\nimport { Menu } from '@spectrum-web-components/menu';\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Overlays, v1', () => {\n let testDiv!: HTMLDivElement;\n let openOverlays: (() => void)[] = [];\n\n describe('shared fixture', () => {\n beforeEach(async () => {\n testDiv = await styledFixture<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 id=\"first-button\" variant=\"primary\">\n Show Popover\n </sp-button>\n <div id=\"overlay-content\">\n <sp-popover\n id=\"outer-popover\"\n direction=\"bottom\"\n tip\n >\n <sp-dialog no-divider>\n <div class=\"options-popover-content\">\n A popover message\n </div>\n <sp-button id=\"outer-focus-target\">\n Test 1\n </sp-button>\n <sp-button>Test 2</sp-button>\n <sp-button>Test 3</sp-button>\n </sp-dialog>\n </sp-popover>\n <sp-tooltip id=\"hover-1\" class=\"hover-content\">\n Hover message\n </sp-tooltip>\n <sp-tooltip id=\"hover-2\" class=\"hover-content\">\n Other hover message\n </sp-tooltip>\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(await isInteractive(outerPopover)).to.be.false;\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, '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 expect(await isInteractive(outerPopover)).to.be.true;\n });\n });\n\n it(`opens a modal dialog`, 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(await isInteractive(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, 'sp-opened');\n openOverlays.push(\n await Overlay.open(button, 'modal', outerPopover, {\n delayed: false,\n })\n );\n await opened;\n\n const firstFocused = outerPopover.querySelector(\n '#outer-focus-target'\n ) as HTMLElement;\n expect(document.activeElement === firstFocused).to.be.true;\n\n /**\n * Tab cycle is awkward in the headless browser, forward tab to just before the known end of the page\n * and the backward tab past the known beginning of the page. Test that you never focused the button\n * that triggered the dialog and is outside of the modal. A test that was able to cycle would be better.\n */\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement === button).to.be.false;\n });\n\n it(`updates a popover`, 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(await isInteractive(outerPopover)).to.be.false;\n\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, '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(await isInteractive(outerPopover)).to.be.true;\n\n Overlay.update();\n\n expect(await isInteractive(outerPopover)).to.be.true;\n });\n\n it(`opens a popover w/ delay`, 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(await isInteractive(outerPopover)).to.be.false;\n expect(button).to.exist;\n\n const opened = oneEvent(outerPopover, 'sp-opened');\n const start = performance.now();\n openOverlays.push(\n await Overlay.open(button, 'click', outerPopover, {\n delayed: true,\n offset: 10,\n })\n );\n await opened;\n const end = performance.now();\n expect(await isInteractive(outerPopover)).to.be.true;\n expect(end - start).to.be.greaterThan(1000);\n });\n\n it('opens hover overlay', async () => {\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const hoverOverlay = testDiv.querySelector(\n '#hover-1'\n ) as HTMLElement;\n const clickOverlay = testDiv.querySelector(\n '#outer-popover'\n ) as HTMLElement;\n\n expect(await isOnTopLayer(hoverOverlay)).to.be.false;\n expect(await isOnTopLayer(clickOverlay)).to.be.false;\n\n let opened = oneEvent(hoverOverlay, '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 expect(await isOnTopLayer(hoverOverlay)).to.be.true;\n\n opened = oneEvent(clickOverlay, 'sp-opened');\n const closed = oneEvent(hoverOverlay, 'sp-closed');\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 await closed;\n expect(\n await isInteractive(clickOverlay),\n 'click overlay not interactive'\n ).to.be.true;\n expect(\n await isOnTopLayer(hoverOverlay),\n 'hover overlay interactive'\n ).to.be.false;\n });\n\n it('opens custom overlay', async () => {\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const customOverlay = testDiv.querySelector(\n '#hover-1'\n ) 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(await isOnTopLayer(customOverlay)).to.be.false;\n expect(await isOnTopLayer(clickOverlay)).to.be.false;\n\n let opened = oneEvent(customOverlay, '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 expect(await isOnTopLayer(customOverlay)).to.be.true;\n\n opened = oneEvent(clickOverlay, 'sp-opened');\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 expect(await isOnTopLayer(clickOverlay), 'click content open').to.be\n .true;\n });\n });\n\n it('closes via events', async function () {\n this.retries(0);\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <sp-popover id=\"root\">\n <sp-dialog dismissable>\n Some Content for the Dialog.\n </sp-dialog>\n </sp-popover>\n </div>\n `);\n\n const el = test.querySelector('sp-popover') as Popover;\n const dialog = el.querySelector('sp-dialog') as Dialog;\n\n const opened = oneEvent(el, 'sp-opened');\n openOverlays.push(\n await Overlay.open(test, 'click', el, {\n delayed: false,\n placement: 'bottom',\n offset: 10,\n })\n );\n await opened;\n expect(await isOnTopLayer(el)).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n dialog.close();\n await closed;\n expect(await isOnTopLayer(el)).to.be.false;\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 <sp-popover class=\"content\">\n <input />\n </sp-popover>\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 const opened = oneEvent(content, 'sp-opened');\n openOverlays.push(\n await Overlay.open(trigger, 'inline', content, {\n receivesFocus: 'auto',\n })\n );\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n expect(document.activeElement).to.equal(input);\n\n const closed = oneEvent(content, 'sp-closed');\n await sendKeys({\n press: 'Shift+Tab',\n });\n await closed;\n\n expect(document.activeElement).to.equal(trigger);\n\n await sendKeys({\n press: 'Tab',\n });\n expect(document.activeElement).to.equal(after);\n expect(await isInteractive(content)).to.be.false;\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 const open = oneEvent(trigger, 'sp-opened');\n openOverlays.push(await Overlay.open(trigger, 'inline', content, {}));\n await open;\n\n expect(document.activeElement).to.equal(input);\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 });\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('sp-popover');\n content.textContent = textContent;\n\n const opened = oneEvent(content, 'sp-opened');\n const closeOverlay = await Overlay.open(el, 'click', content, {\n placement: 'bottom',\n });\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n\n const closed = oneEvent(content, 'sp-closed');\n closeOverlay();\n await closed;\n\n expect(await isInteractive(content)).to.be.false;\n\n content.remove();\n });\n});\ndescribe('Overlay - type=\"modal\", v1', () => {\n describe('handle multiple separate `contextmenu` events', async () => {\n let width = 0;\n let height = 0;\n let firstMenu: Popover;\n let firstRect: DOMRect;\n let secondMenu: Popover;\n let secondRect: DOMRect;\n before(async () => {\n render(\n html`\n <sp-theme color=\"light\" scale=\"large\">\n ${virtualElementV1({\n ...virtualElementV1.args,\n offset: 6,\n })}\n </sp-theme>\n `,\n document.body\n );\n\n width = window.innerWidth;\n height = window.innerHeight;\n });\n after(() => {\n document.querySelector('sp-theme')?.remove();\n });\n it('opens the first \"contextmenu\" overlay', async () => {\n const opened = oneEvent(document, 'sp-opened');\n // Right click to open \"context menu\" overlay.\n await 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 firstMenu = document.querySelector('sp-popover') as Popover;\n expect(firstMenu.textContent).to.include('Menu source: end');\n firstRect = firstMenu.getBoundingClientRect();\n expect(firstMenu).to.not.be.null;\n });\n it('closes the first \"contextmenu\" when opening a second', async () => {\n const closed = oneEvent(document, 'sp-closed');\n const opened = oneEvent(document, 'sp-opened');\n /**\n * Right click 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 *\n * Using `sendMouse` here triggers the light dismiss for some reason while\n * manual interacting in this way does not...\n */\n const trigger = document.querySelector(\n 'start-end-contextmenu'\n ) as HTMLElement;\n trigger.shadowRoot?.querySelector('#start')?.dispatchEvent(\n new Event('contextmenu', {\n composed: true,\n })\n );\n await nextFrame();\n trigger.shadowRoot?.querySelector('#start')?.dispatchEvent(\n new Event('pointerup', {\n composed: true,\n bubbles: true,\n })\n );\n await closed;\n await opened;\n secondMenu = document.querySelector('sp-popover') as Popover;\n expect(secondMenu.textContent).to.include('Menu source: start');\n secondRect = secondMenu.getBoundingClientRect();\n expect(secondMenu).to.not.be.null;\n });\n it('closes the second \"contextmenu\" when clicking away', async () => {\n const closed = oneEvent(document, 'sp-closed');\n sendMouse({\n steps: [\n {\n type: 'click',\n position: [width - width / 8, height - height / 8],\n },\n ],\n });\n await closed;\n expect(firstRect.top).to.not.equal(secondRect.top);\n expect(firstRect.left).to.not.equal(secondRect.left);\n });\n });\n\n it('does not open content off of the viewport', async () => {\n before(async () => {\n await setViewport({ width: 360, height: 640 });\n // Allow viewport update to propagate.\n await nextFrame();\n });\n after(async () => {\n await setViewport({ width: 800, height: 600 });\n // Allow viewport update to propagate.\n await nextFrame();\n });\n\n await fixture<HTMLDivElement>(html`\n ${virtualElementV1({\n ...virtualElementV1.args,\n offset: 6,\n })}\n `);\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 firstMenu = document.querySelector('sp-menu') as Menu;\n expect(firstMenu).to.not.be.null;\n expect(await isInteractive(firstMenu)).to.be.true;\n\n const closed = oneEvent(document, 'sp-closed');\n sendKeys({\n press: 'Escape',\n });\n await closed;\n\n expect(await isInteractive(firstMenu)).to.be.false;\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 expect(el.open).to.equal('click');\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 expect(content.trigger.open).to.equal('click');\n let close = oneEvent(content, 'sp-closed');\n content.trigger.removeAttribute('open');\n await close;\n expect(content.trigger.open).to.be.null;\n close = oneEvent(el, 'sp-closed');\n el.removeAttribute('open');\n await close;\n expect(el.open).to.be.null;\n });\n});\n"],
5
+ "mappings": ";AAWA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAEP,SAAS,mBAAmB;AAC5B;AAAA,EACI;AAAA,OAGG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AAEP,SAAS,cAA8B;AACvC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,gBAAgB,MAAM;AAC3B,MAAI;AACJ,MAAI,eAA+B,CAAC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