@spectrum-web-components/overlay 0.50.0-beta.8 → 0.50.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/overlay",
3
- "version": "0.50.0-beta.8",
3
+ "version": "0.50.0-beta.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -160,11 +160,11 @@
160
160
  "dependencies": {
161
161
  "@floating-ui/dom": "^1.6.1",
162
162
  "@floating-ui/utils": "^0.2.1",
163
- "@spectrum-web-components/action-button": "^0.50.0-beta.8",
164
- "@spectrum-web-components/base": "^0.50.0-beta.8",
165
- "@spectrum-web-components/reactive-controllers": "^0.50.0-beta.8",
166
- "@spectrum-web-components/shared": "^0.50.0-beta.8",
167
- "@spectrum-web-components/theme": "^0.50.0-beta.8"
163
+ "@spectrum-web-components/action-button": "^0.50.0-beta.9",
164
+ "@spectrum-web-components/base": "^0.50.0-beta.9",
165
+ "@spectrum-web-components/reactive-controllers": "^0.50.0-beta.9",
166
+ "@spectrum-web-components/shared": "^0.50.0-beta.9",
167
+ "@spectrum-web-components/theme": "^0.50.0-beta.9"
168
168
  },
169
169
  "types": "./src/index.d.ts",
170
170
  "customElements": "custom-elements.json",
@@ -176,5 +176,5 @@
176
176
  "./stories/overlay-story-components.js",
177
177
  "./**/*.dev.js"
178
178
  ],
179
- "gitHead": "8764173251bcf2b85ddef058ec9433c0f8dfcc6c"
179
+ "gitHead": "c984cc2babbfecd14c86403ab920fbf6b0beb52c"
180
180
  }
@@ -28,7 +28,7 @@ import { stub } from "sinon";
28
28
  const OVERLAY_TYPES = ["modal", "page", "hint", "auto", "manual"];
29
29
  async function styledFixture(story) {
30
30
  const test = await fixture(html`
31
- <sp-theme theme="spectrum" scale="medium" color="light">
31
+ <sp-theme system="spectrum" scale="medium" color="light">
32
32
  ${story}
33
33
  </sp-theme>
34
34
  `);
@@ -720,18 +720,32 @@ describe("sp-overlay", () => {
720
720
  expect(el.open).to.be.true;
721
721
  expect(slider.value).to.equal(5);
722
722
  const sliderRect = track.getBoundingClientRect();
723
- await sendMouse({
724
- steps: [
725
- {
726
- type: "click",
727
- position: [
728
- sliderRect.left + sliderRect.width - 5,
729
- sliderRect.top + sliderRect.height / 2
730
- ]
731
- }
732
- ]
733
- });
734
- await aTimeout(500);
723
+ let pointerId = -1;
724
+ slider.track.setPointerCapture = (id) => pointerId = id;
725
+ slider.track.releasePointerCapture = (id) => pointerId = id;
726
+ expect(pointerId).to.equal(-1);
727
+ track.dispatchEvent(
728
+ new PointerEvent("pointerdown", {
729
+ clientX: sliderRect.left + sliderRect.width - 5,
730
+ clientY: sliderRect.top + sliderRect.height / 2,
731
+ pointerId: 1,
732
+ cancelable: true,
733
+ bubbles: true,
734
+ composed: true,
735
+ button: 0
736
+ })
737
+ );
738
+ await elementUpdated(slider);
739
+ track.dispatchEvent(
740
+ new PointerEvent("pointerup", {
741
+ pointerId: 1,
742
+ cancelable: true,
743
+ bubbles: true,
744
+ composed: true
745
+ })
746
+ );
747
+ await elementUpdated(slider);
748
+ await aTimeout(1500);
735
749
  expect(slider.value).to.equal(19.5);
736
750
  expect(el.open).to.be.true;
737
751
  });
@@ -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 {\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,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAA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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;",
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 system=\"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 let pointerId = -1;\n slider.track.setPointerCapture = (id: number) => (pointerId = id);\n slider.track.releasePointerCapture = (id: number) =>\n (pointerId = id);\n expect(pointerId).to.equal(-1);\n track.dispatchEvent(\n new PointerEvent('pointerdown', {\n clientX: sliderRect.left + sliderRect.width - 5,\n clientY: sliderRect.top + sliderRect.height / 2,\n pointerId: 1,\n cancelable: true,\n bubbles: true,\n composed: true,\n button: 0,\n })\n );\n await elementUpdated(slider);\n\n track.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n cancelable: true,\n bubbles: true,\n composed: true,\n })\n );\n await elementUpdated(slider);\n\n await aTimeout(1500);\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,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ACX,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
  }
@@ -25,7 +25,7 @@ import {
25
25
  ignoreResizeObserverLoopError(before, after);
26
26
  async function styledFixture(story) {
27
27
  const test = await fixture(html`
28
- <sp-theme theme="spectrum" scale="medium" color="light">
28
+ <sp-theme system="spectrum" scale="medium" color="light">
29
29
  ${story}
30
30
  </sp-theme>
31
31
  `);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay-trigger-hover.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 elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport { spy } from 'sinon';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { Button } from '@spectrum-web-components/button';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\n\nignoreResizeObserverLoopError(before, after);\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('Overlay Trigger - Hover', () => {\n it('displays `hover` declaratively', async () => {\n const openedSpy = spy();\n const closedSpy = spy();\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger\n placement=\"right-start\"\n open=\"hover\"\n @sp-opened=${() => openedSpy()}\n @sp-closed=${() => closedSpy()}\n >\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n await waitUntil(\n () => openedSpy.calledOnce,\n 'hover content projected to overlay',\n { timeout: 2000 }\n );\n\n el.removeAttribute('open');\n await elementUpdated(el);\n\n await waitUntil(() => closedSpy.calledOnce, 'hover content returned', {\n timeout: 2000,\n });\n });\n describe('\"tooltip\" mouse interactions', () => {\n let el: OverlayTrigger;\n let button: ActionButton;\n let tooltip: Tooltip;\n beforeEach(async () => {\n el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-tooltip slot=\"hover-content\" tip>\n Magnify\n </sp-tooltip>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n button = el.querySelector('sp-action-button') as ActionButton;\n tooltip = el.querySelector('sp-tooltip') as Tooltip;\n });\n it('allows pointer to enter the \"tooltip\" without closing the \"tooltip\"', async () => {\n const opened = oneEvent(button, 'sp-opened');\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n expect(tooltip.open).to.be.true;\n\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n tooltip.dispatchEvent(\n new MouseEvent('pointerleave', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(button, 'sp-closed');\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: null,\n bubbles: true,\n composed: true,\n })\n );\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n it('closes the \"tooltip\" when leaving the \"tooltip\"', async () => {\n const opened = oneEvent(button, 'sp-opened');\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: tooltip,\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(button, 'sp-closed');\n tooltip.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: null,\n bubbles: true,\n composed: true,\n })\n );\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n });\n it('persists hover content', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n trigger.click();\n\n await elementUpdated(el);\n\n expect(el.open).to.equal('hover');\n });\n it('closes persistent hover content on `longpress`', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n <sp-popover slot=\"longpress-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n let opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('pointerenter', {\n bubbles: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('longpress', {\n bubbles: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('longpress');\n });\n it('closes `hover` overlay when [type=\"modal\"]', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\" type=\"modal\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n const input = document.createElement('input');\n el.insertAdjacentElement('beforebegin', input);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n const opened = oneEvent(el, 'sp-opened');\n input.focus();\n await sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(el, 'sp-closed');\n trigger.blur();\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n it('will not return focus to a \"modal\" parent', async () => {\n const el = await styledFixture<OverlayTrigger>(html`\n <overlay-trigger type=\"modal\">\n <sp-button slot=\"trigger\">Toggle Dialog</sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\" id=\"button-${index}\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `);\n await elementUpdated(el);\n\n const button = el.querySelector('sp-button') as Button;\n const dialog = el.querySelector('sp-dialog-wrapper') as HTMLElement;\n const button1 = dialog.querySelector('#button-1') as Button;\n const button2 = dialog.querySelector('#button-2') as Button;\n const button3 = dialog.querySelector('#button-3') as Button;\n await elementUpdated(button);\n await elementUpdated(dialog);\n\n let opened = oneEvent(button, 'sp-opened');\n const openedHint = oneEvent(button1, 'sp-opened');\n button.dispatchEvent(new Event('click', { bubbles: true }));\n await opened;\n await openedHint;\n\n expect(button1 === document.activeElement).to.be.true;\n\n opened = oneEvent(button2, 'sp-opened');\n sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(button2 === document.activeElement).to.be.true;\n\n opened = oneEvent(button3, 'sp-opened');\n sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(button3 === document.activeElement).to.be.true;\n });\n});\n"],
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 elementUpdated,\n expect,\n html,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/dialog/sp-dialog-wrapper.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport { spy } from 'sinon';\nimport { ActionButton } from '@spectrum-web-components/action-button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { Button } from '@spectrum-web-components/button';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport {\n fixture,\n ignoreResizeObserverLoopError,\n} from '../../../test/testing-helpers.js';\n\nignoreResizeObserverLoopError(before, after);\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme system=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Overlay Trigger - Hover', () => {\n it('displays `hover` declaratively', async () => {\n const openedSpy = spy();\n const closedSpy = spy();\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger\n placement=\"right-start\"\n open=\"hover\"\n @sp-opened=${() => openedSpy()}\n @sp-closed=${() => closedSpy()}\n >\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n await waitUntil(\n () => openedSpy.calledOnce,\n 'hover content projected to overlay',\n { timeout: 2000 }\n );\n\n el.removeAttribute('open');\n await elementUpdated(el);\n\n await waitUntil(() => closedSpy.calledOnce, 'hover content returned', {\n timeout: 2000,\n });\n });\n describe('\"tooltip\" mouse interactions', () => {\n let el: OverlayTrigger;\n let button: ActionButton;\n let tooltip: Tooltip;\n beforeEach(async () => {\n el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-tooltip slot=\"hover-content\" tip>\n Magnify\n </sp-tooltip>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n button = el.querySelector('sp-action-button') as ActionButton;\n tooltip = el.querySelector('sp-tooltip') as Tooltip;\n });\n it('allows pointer to enter the \"tooltip\" without closing the \"tooltip\"', async () => {\n const opened = oneEvent(button, 'sp-opened');\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n expect(tooltip.open).to.be.true;\n\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n tooltip.dispatchEvent(\n new MouseEvent('pointerleave', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(button, 'sp-closed');\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: null,\n bubbles: true,\n composed: true,\n })\n );\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n it('closes the \"tooltip\" when leaving the \"tooltip\"', async () => {\n const opened = oneEvent(button, 'sp-opened');\n button.dispatchEvent(\n new MouseEvent('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await nextFrame();\n button.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: tooltip,\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(button, 'sp-closed');\n tooltip.dispatchEvent(\n new MouseEvent('pointerleave', {\n relatedTarget: null,\n bubbles: true,\n composed: true,\n })\n );\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n });\n it('persists hover content', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('pointerenter', {\n bubbles: true,\n composed: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n trigger.click();\n\n await elementUpdated(el);\n\n expect(el.open).to.equal('hover');\n });\n it('closes persistent hover content on `longpress`', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n <sp-popover slot=\"longpress-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n let opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('pointerenter', {\n bubbles: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('hover');\n\n opened = oneEvent(trigger, 'sp-opened');\n trigger.dispatchEvent(\n new Event('longpress', {\n bubbles: true,\n })\n );\n await opened;\n\n expect(el.open).to.equal('longpress');\n });\n it('closes `hover` overlay when [type=\"modal\"]', async () => {\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger placement=\"right-start\" type=\"modal\">\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"hover-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n await elementUpdated(el);\n const input = document.createElement('input');\n el.insertAdjacentElement('beforebegin', input);\n\n expect(el.open).to.be.undefined;\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as ActionButton;\n const opened = oneEvent(el, 'sp-opened');\n input.focus();\n await sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(el.open).to.equal('hover');\n\n const closed = oneEvent(el, 'sp-closed');\n trigger.blur();\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n it('will not return focus to a \"modal\" parent', async () => {\n const el = await styledFixture<OverlayTrigger>(html`\n <overlay-trigger type=\"modal\">\n <sp-button slot=\"trigger\">Toggle Dialog</sp-button>\n <sp-dialog-wrapper\n slot=\"click-content\"\n headline=\"Dialog title\"\n size=\"s\"\n >\n ${[1, 2, 3, 4].map(\n (index) => html`\n <overlay-trigger>\n <sp-button slot=\"trigger\" id=\"button-${index}\">\n Button with Tooltip ${index}\n </sp-button>\n <sp-tooltip slot=\"hover-content\">\n Tooltip ${index}\n </sp-tooltip>\n </overlay-trigger>\n `\n )}\n </sp-dialog-wrapper>\n </overlay-trigger>\n `);\n await elementUpdated(el);\n\n const button = el.querySelector('sp-button') as Button;\n const dialog = el.querySelector('sp-dialog-wrapper') as HTMLElement;\n const button1 = dialog.querySelector('#button-1') as Button;\n const button2 = dialog.querySelector('#button-2') as Button;\n const button3 = dialog.querySelector('#button-3') as Button;\n await elementUpdated(button);\n await elementUpdated(dialog);\n\n let opened = oneEvent(button, 'sp-opened');\n const openedHint = oneEvent(button1, 'sp-opened');\n button.dispatchEvent(new Event('click', { bubbles: true }));\n await opened;\n await openedHint;\n\n expect(button1 === document.activeElement).to.be.true;\n\n opened = oneEvent(button2, 'sp-opened');\n sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(button2 === document.activeElement).to.be.true;\n\n opened = oneEvent(button3, 'sp-opened');\n sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(button3 === document.activeElement).to.be.true;\n });\n});\n"],
5
5
  "mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,WAAW;AAEpB,SAAS,gBAAgB;AAEzB,OAAO;AACP,OAAO;AAIP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,8BAA8B,QAAQ,KAAK;AAE3C,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,2BAA2B,MAAM;AACtC,KAAG,kCAAkC,YAAY;AAC7C,UAAM,YAAY,IAAI;AACtB,UAAM,YAAY,IAAI;AACtB,UAAM,KAAK,MAAM;AAAA,OACZ,MAAM;AAAA;AAAA;AAAA;AAAA,iCAIc,MAAM,UAAU,CA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W;AACtC,aAAS;AAAA,MACL,OAAO;AAAA,IACX,CAAC;AACD,UAAM;AAEN,WAAO,YAAY,SAAS,aAAa,EAAE,GAAG,GAAG;AAEjD,aAAS,SAAS,SAAS,WAAW;AACtC,aAAS;AAAA,MACL,OAAO;AAAA,IACX,CAAC;AACD,UAAM;AAEN,WAAO,YAAY,SAAS,aAAa,EAAE,GAAG,GAAG;AAAA,EACrD,CAAC;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -32,7 +32,7 @@ import {
32
32
  } from "../../../test/testing-helpers.js";
33
33
  async function styledFixture(story) {
34
34
  const test = await fixture(html`
35
- <sp-theme theme="spectrum" scale="medium" color="dark">
35
+ <sp-theme system="spectrum" scale="medium" color="dark">
36
36
  ${story}
37
37
  </sp-theme>
38
38
  `);
@@ -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>(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 id=\"outer-popover\" direction=\"bottom\" tip>\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 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>(html`\n <button>Trigger</button>\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"],
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 system=\"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>(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 id=\"outer-popover\" direction=\"bottom\" tip>\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 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>(html`\n <button>Trigger</button>\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
5
  "mappings": ";AAWA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAEP,SAAS,mBAAmB;AAC5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,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;",
6
6
  "names": ["after", "before"]
7
7
  }
@@ -34,7 +34,7 @@ import {
34
34
  } from "../../../test/testing-helpers.js";
35
35
  async function styledFixture(story) {
36
36
  const test = await fixture(html`
37
- <sp-theme theme="spectrum" scale="medium" color="dark">
37
+ <sp-theme system="spectrum" scale="medium" color="dark">
38
38
  ${story}
39
39
  </sp-theme>
40
40
  `);
@@ -45,58 +45,52 @@ describe("Overlays", () => {
45
45
  let openOverlays = [];
46
46
  describe("shared fixture", () => {
47
47
  beforeEach(async () => {
48
- testDiv = await styledFixture(
49
- html`
50
- <div id="top">
51
- <style>
52
- body {
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
56
- }
48
+ testDiv = await styledFixture(html`
49
+ <div id="top">
50
+ <style>
51
+ body {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ }
57
56
 
58
- #top {
59
- margin: 100px;
60
- }
57
+ #top {
58
+ margin: 100px;
59
+ }
61
60
 
62
- sp-button {
63
- flex: none;
64
- }
61
+ sp-button {
62
+ flex: none;
63
+ }
65
64
 
66
- #overlay-content {
67
- display: none;
68
- }
69
- </style>
70
- <sp-button id="first-button" variant="primary">
71
- Show Popover
72
- </sp-button>
73
- <div id="overlay-content">
74
- <sp-popover
75
- id="outer-popover"
76
- direction="bottom"
77
- tip
78
- >
79
- <sp-dialog no-divider>
80
- <div class="options-popover-content">
81
- A popover message
82
- </div>
83
- <sp-button id="outer-focus-target">
84
- Test 1
85
- </sp-button>
86
- <sp-button>Test 2</sp-button>
87
- <sp-button>Test 3</sp-button>
88
- </sp-dialog>
89
- </sp-popover>
90
- <sp-tooltip id="hover-1" class="hover-content">
91
- Hover message
92
- </sp-tooltip>
93
- <sp-tooltip id="hover-2" class="hover-content">
94
- Other hover message
95
- </sp-tooltip>
96
- </div>
65
+ #overlay-content {
66
+ display: none;
67
+ }
68
+ </style>
69
+ <sp-button id="first-button" variant="primary">
70
+ Show Popover
71
+ </sp-button>
72
+ <div id="overlay-content">
73
+ <sp-popover id="outer-popover" direction="bottom" tip>
74
+ <sp-dialog no-divider>
75
+ <div class="options-popover-content">
76
+ A popover message
77
+ </div>
78
+ <sp-button id="outer-focus-target">
79
+ Test 1
80
+ </sp-button>
81
+ <sp-button>Test 2</sp-button>
82
+ <sp-button>Test 3</sp-button>
83
+ </sp-dialog>
84
+ </sp-popover>
85
+ <sp-tooltip id="hover-1" class="hover-content">
86
+ Hover message
87
+ </sp-tooltip>
88
+ <sp-tooltip id="hover-2" class="hover-content">
89
+ Other hover message
90
+ </sp-tooltip>
97
91
  </div>
98
- `
99
- );
92
+ </div>
93
+ `);
100
94
  await elementUpdated(testDiv);
101
95
  });
102
96
  afterEach(() => {
@@ -497,11 +491,9 @@ describe("Overlays", () => {
497
491
  });
498
492
  it("opens detached content", async () => {
499
493
  const textContent = "This is a detached element that has been overlaid";
500
- const el = await fixture(
501
- html`
502
- <button>Trigger</button>
503
- `
504
- );
494
+ const el = await fixture(html`
495
+ <button>Trigger</button>
496
+ `);
505
497
  const content = document.createElement("sp-popover");
506
498
  content.textContent = textContent;
507
499
  const opened = oneEvent(content, "sp-opened");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["overlay.test.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport '@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 VirtualTrigger,\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 virtualElement,\n} from '../stories/overlay.stories';\nimport { PopoverContent } from '../stories/overlay-story-components.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { spy } from 'sinon';\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', () => {\n let testDiv!: HTMLDivElement;\n let openOverlays: Overlay[] = [];\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((overlay) => (overlay.open = false));\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 ].map((direction) => {\n const placement = direction as Placement;\n it(`opens a popover - ${placement}`, async () => {\n const clickSpy = spy();\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const outerPopover = testDiv.querySelector(\n '#outer-popover'\n ) as Popover;\n outerPopover.addEventListener('click', () => {\n clickSpy();\n });\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(outerPopover, {\n trigger: button,\n type: 'auto',\n delayed: false,\n placement,\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n type: 'auto',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n type: 'auto',\n delayed: true,\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(hoverOverlay, {\n trigger: button,\n type: 'hint',\n placement: 'top',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(clickOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(customOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'top',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(clickOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(el, {\n trigger: test,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n test.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\n await opened;\n expect(await isInteractive(el)).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n dialog.close();\n await closed;\n expect(await isInteractive(el)).to.be.false;\n });\n\n it('positions with a VirtualTrigger', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <sp-popover id=\"root\" placement=\"right\">\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 trigger = new VirtualTrigger(100, 100);\n\n const opened = oneEvent(el, 'sp-opened');\n openOverlays.push(\n await Overlay.open(el, {\n trigger,\n type: 'auto',\n placement: 'right',\n offset: 10,\n })\n );\n test.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\n await opened;\n expect(await isInteractive(el)).to.be.true;\n\n const initial = el.getBoundingClientRect();\n trigger.updateBoundingClientRect(500, 500);\n await nextFrame();\n await nextFrame();\n const final = el.getBoundingClientRect();\n expect(initial.x).to.not.equal(8);\n expect(initial.y).to.not.equal(8);\n expect(initial.x).to.not.equal(final.x);\n expect(initial.y).to.not.equal(final.y);\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(content, {\n trigger,\n type: 'auto',\n receivesFocus: 'auto',\n })\n );\n trigger.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(\n await Overlay.open(content, {\n trigger,\n type: 'auto',\n })\n );\n trigger.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\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 overlay = await Overlay.open(content, {\n trigger: el,\n type: 'auto',\n placement: 'bottom',\n });\n el.insertAdjacentElement('afterend', overlay);\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n\n const closed = oneEvent(content, 'sp-closed');\n overlay.open = false;\n await closed;\n\n expect(await isInteractive(content)).to.be.false;\n\n content.remove();\n });\n});\ndescribe('Overlay - type=\"modal\"', () => {\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 ${virtualElement({\n ...virtualElement.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 ${virtualElement({\n ...virtualElement.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});\ndescribe('Overlay - timing', () => {\n it('manages multiple modals in a row without preventing them from closing', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <overlay-trigger id=\"test-1\" placement=\"bottom\">\n <sp-button slot=\"trigger\">Trigger 1</sp-button>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 1\".</p>\n </sp-popover>\n </overlay-trigger>\n <overlay-trigger id=\"test-2\" placement=\"right\">\n <sp-button slot=\"trigger\">Trigger 2</sp-button>\n <sp-popover slot=\"click-content\">\n <p>Click contentent for \"Trigger 2\".</p>\n </sp-popover>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 2\".</p>\n </sp-popover>\n </overlay-trigger>\n </div>\n `);\n\n const overlayTrigger1 = test.querySelector('#test-1') as OverlayTrigger;\n const overlayTrigger2 = test.querySelector('#test-2') as OverlayTrigger;\n const trigger1 = overlayTrigger1.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n const trigger2 = overlayTrigger2.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n\n const boundingRectTrigger1 = trigger1.getBoundingClientRect();\n const boundingRectTrigger2 = trigger2.getBoundingClientRect();\n const trigger1Position: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width / 2,\n boundingRectTrigger1.top + boundingRectTrigger1.height / 2,\n ];\n const outsideTriggers: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width / 2,\n 300,\n ];\n const trigger2Position: [number, number] = [\n boundingRectTrigger2.left + boundingRectTrigger2.width / 2,\n boundingRectTrigger2.top + boundingRectTrigger2.height / 4,\n ];\n\n // Move pointer over \"Trigger 1\", should _start_ to open \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger1Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n\n // Move pointer out of \"Trigger 1\", should _start_ to close \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: outsideTriggers,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n // Move pointer over \"Trigger 2\", should _start_ to open \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger2Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n\n const opened = oneEvent(trigger2, 'sp-opened');\n // Click \"Trigger 2\", should _start_ to open \"click\" content and _start_ to close \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: trigger2Position,\n },\n ],\n });\n await opened;\n await nextFrame();\n await nextFrame();\n\n // \"click\" content for \"Trigger 2\", _only_, open.\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open')).to.be.true;\n expect(overlayTrigger2.getAttribute('open')).to.equal('click');\n\n const closed = oneEvent(overlayTrigger2, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: outsideTriggers,\n },\n ],\n });\n await closed;\n\n // Both overlays are closed.\n // Neither trigger received \"focus\" because the pointer \"clicked\" away, redirecting focus to <body>\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open')).to.be.false;\n });\n});\n"],
5
- "mappings": ";AAWA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAEP,SAAS,mBAAmB;AAC5B;AAAA,EACI;AAAA,EAGA;AAAA,OACG;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,SAAS,WAAW;AACpB,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,KAA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B,aAAa,MAAM,CAAC,EAAE,GAAG,GAAG;AACnD,WAAO,gBAAgB,aAAa,MAAM,CAAC,EAAE,GAAG,GAAG;AACnD,WAAO,gBAAgB,aAAa,MAAM,CAAC,EAAE,GAAG,MAAM,OAAO;AAE7D,UAAM,SAAS,SAAS,iBAAiB,WAAW;AACpD,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,QACd;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAIN,WAAO,gBAAgB,aAAa,MAAM,CAAC,EAAE,GAAG,GAAG;AACnD,WAAO,gBAAgB,aAAa,MAAM,CAAC,EAAE,GAAG,GAAG;AAAA,EACvD,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 VirtualTrigger,\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 virtualElement,\n} from '../stories/overlay.stories';\nimport { PopoverContent } from '../stories/overlay-story-components.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { spy } from 'sinon';\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 system=\"spectrum\" scale=\"medium\" color=\"dark\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('Overlays', () => {\n let testDiv!: HTMLDivElement;\n let openOverlays: Overlay[] = [];\n\n describe('shared fixture', () => {\n beforeEach(async () => {\n testDiv = await styledFixture<HTMLDivElement>(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 id=\"outer-popover\" direction=\"bottom\" tip>\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 await elementUpdated(testDiv);\n });\n\n afterEach(() => {\n openOverlays.map((overlay) => (overlay.open = false));\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 ].map((direction) => {\n const placement = direction as Placement;\n it(`opens a popover - ${placement}`, async () => {\n const clickSpy = spy();\n const button = testDiv.querySelector(\n '#first-button'\n ) as HTMLElement;\n const outerPopover = testDiv.querySelector(\n '#outer-popover'\n ) as Popover;\n outerPopover.addEventListener('click', () => {\n clickSpy();\n });\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(outerPopover, {\n trigger: button,\n type: 'auto',\n delayed: false,\n placement,\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n type: 'auto',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(outerPopover, {\n trigger: button,\n type: 'auto',\n delayed: true,\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(hoverOverlay, {\n trigger: button,\n type: 'hint',\n placement: 'top',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(clickOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(customOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'top',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(clickOverlay, {\n trigger: button,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n button.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(el, {\n trigger: test,\n type: 'auto',\n placement: 'bottom',\n offset: 10,\n })\n );\n test.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\n await opened;\n expect(await isInteractive(el)).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n dialog.close();\n await closed;\n expect(await isInteractive(el)).to.be.false;\n });\n\n it('positions with a VirtualTrigger', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <sp-popover id=\"root\" placement=\"right\">\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 trigger = new VirtualTrigger(100, 100);\n\n const opened = oneEvent(el, 'sp-opened');\n openOverlays.push(\n await Overlay.open(el, {\n trigger,\n type: 'auto',\n placement: 'right',\n offset: 10,\n })\n );\n test.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\n await opened;\n expect(await isInteractive(el)).to.be.true;\n\n const initial = el.getBoundingClientRect();\n trigger.updateBoundingClientRect(500, 500);\n await nextFrame();\n await nextFrame();\n const final = el.getBoundingClientRect();\n expect(initial.x).to.not.equal(8);\n expect(initial.y).to.not.equal(8);\n expect(initial.x).to.not.equal(final.x);\n expect(initial.y).to.not.equal(final.y);\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(content, {\n trigger,\n type: 'auto',\n receivesFocus: 'auto',\n })\n );\n trigger.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\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(\n await Overlay.open(content, {\n trigger,\n type: 'auto',\n })\n );\n trigger.insertAdjacentElement(\n 'afterend',\n openOverlays.at(-1) as HTMLElement\n );\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>(html`\n <button>Trigger</button>\n `);\n\n const content = document.createElement('sp-popover');\n content.textContent = textContent;\n\n const opened = oneEvent(content, 'sp-opened');\n const overlay = await Overlay.open(content, {\n trigger: el,\n type: 'auto',\n placement: 'bottom',\n });\n el.insertAdjacentElement('afterend', overlay);\n await opened;\n\n expect(await isInteractive(content)).to.be.true;\n\n const closed = oneEvent(content, 'sp-closed');\n overlay.open = false;\n await closed;\n\n expect(await isInteractive(content)).to.be.false;\n\n content.remove();\n });\n});\ndescribe('Overlay - type=\"modal\"', () => {\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 ${virtualElement({\n ...virtualElement.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 ${virtualElement({\n ...virtualElement.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});\ndescribe('Overlay - timing', () => {\n it('manages multiple modals in a row without preventing them from closing', async () => {\n const test = await fixture<HTMLDivElement>(html`\n <div>\n <overlay-trigger id=\"test-1\" placement=\"bottom\">\n <sp-button slot=\"trigger\">Trigger 1</sp-button>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 1\".</p>\n </sp-popover>\n </overlay-trigger>\n <overlay-trigger id=\"test-2\" placement=\"right\">\n <sp-button slot=\"trigger\">Trigger 2</sp-button>\n <sp-popover slot=\"click-content\">\n <p>Click contentent for \"Trigger 2\".</p>\n </sp-popover>\n <sp-popover slot=\"hover-content\">\n <p>Hover contentent for \"Trigger 2\".</p>\n </sp-popover>\n </overlay-trigger>\n </div>\n `);\n\n const overlayTrigger1 = test.querySelector('#test-1') as OverlayTrigger;\n const overlayTrigger2 = test.querySelector('#test-2') as OverlayTrigger;\n const trigger1 = overlayTrigger1.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n const trigger2 = overlayTrigger2.querySelector(\n '[slot=\"trigger\"]'\n ) as HTMLButtonElement;\n\n const boundingRectTrigger1 = trigger1.getBoundingClientRect();\n const boundingRectTrigger2 = trigger2.getBoundingClientRect();\n const trigger1Position: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width / 2,\n boundingRectTrigger1.top + boundingRectTrigger1.height / 2,\n ];\n const outsideTriggers: [number, number] = [\n boundingRectTrigger1.left + boundingRectTrigger1.width / 2,\n 300,\n ];\n const trigger2Position: [number, number] = [\n boundingRectTrigger2.left + boundingRectTrigger2.width / 2,\n boundingRectTrigger2.top + boundingRectTrigger2.height / 4,\n ];\n\n // Move pointer over \"Trigger 1\", should _start_ to open \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger1Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n\n // Move pointer out of \"Trigger 1\", should _start_ to close \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: outsideTriggers,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n // Move pointer over \"Trigger 2\", should _start_ to open \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: trigger2Position,\n },\n ],\n });\n await nextFrame();\n await nextFrame();\n\n const opened = oneEvent(trigger2, 'sp-opened');\n // Click \"Trigger 2\", should _start_ to open \"click\" content and _start_ to close \"hover\" content.\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: trigger2Position,\n },\n ],\n });\n await opened;\n await nextFrame();\n await nextFrame();\n\n // \"click\" content for \"Trigger 2\", _only_, open.\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open')).to.be.true;\n expect(overlayTrigger2.getAttribute('open')).to.equal('click');\n\n const closed = oneEvent(overlayTrigger2, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: outsideTriggers,\n },\n ],\n });\n await closed;\n\n // Both overlays are closed.\n // Neither trigger received \"focus\" because the pointer \"clicked\" away, redirecting focus to <body>\n expect(overlayTrigger1.hasAttribute('open')).to.be.false;\n expect(overlayTrigger2.hasAttribute('open')).to.be.false;\n });\n});\n"],
5
+ "mappings": ";AAWA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAEP,SAAS,mBAAmB;AAC5B;AAAA,EACI;AAAA,EAGA;AAAA,OACG;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,iBAA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