@spectrum-web-components/overlay 0.41.1 → 0.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +996 -314
- package/package.json +31 -7
- package/src/AbstractOverlay.d.ts +13 -3
- package/src/AbstractOverlay.dev.js +54 -19
- package/src/AbstractOverlay.dev.js.map +2 -2
- package/src/AbstractOverlay.js +1 -1
- package/src/AbstractOverlay.js.map +3 -3
- package/src/ClickController.d.ts +14 -0
- package/src/ClickController.dev.js +42 -0
- package/src/ClickController.dev.js.map +7 -0
- package/src/ClickController.js +2 -0
- package/src/ClickController.js.map +7 -0
- package/src/HoverController.d.ts +19 -0
- package/src/HoverController.dev.js +141 -0
- package/src/HoverController.dev.js.map +7 -0
- package/src/HoverController.js +2 -0
- package/src/HoverController.js.map +7 -0
- package/src/InteractionController.d.ts +23 -0
- package/src/InteractionController.dev.js +45 -0
- package/src/InteractionController.dev.js.map +7 -0
- package/src/InteractionController.js +2 -0
- package/src/InteractionController.js.map +7 -0
- package/src/LongpressController.d.ts +21 -0
- package/src/LongpressController.dev.js +157 -0
- package/src/LongpressController.dev.js.map +7 -0
- package/src/LongpressController.js +2 -0
- package/src/LongpressController.js.map +7 -0
- package/src/Overlay.d.ts +17 -50
- package/src/Overlay.dev.js +86 -363
- package/src/Overlay.dev.js.map +2 -2
- package/src/Overlay.js +10 -10
- package/src/Overlay.js.map +3 -3
- package/src/OverlayDialog.dev.js +8 -1
- package/src/OverlayDialog.dev.js.map +2 -2
- package/src/OverlayDialog.js +1 -1
- package/src/OverlayDialog.js.map +3 -3
- package/src/OverlayNoPopover.dev.js +9 -3
- package/src/OverlayNoPopover.dev.js.map +2 -2
- package/src/OverlayNoPopover.js +1 -1
- package/src/OverlayNoPopover.js.map +3 -3
- package/src/OverlayPopover.dev.js +10 -1
- package/src/OverlayPopover.dev.js.map +2 -2
- package/src/OverlayPopover.js +1 -1
- package/src/OverlayPopover.js.map +3 -3
- package/src/OverlayStack.dev.js +3 -0
- package/src/OverlayStack.dev.js.map +2 -2
- package/src/OverlayStack.js +1 -1
- package/src/OverlayStack.js.map +2 -2
- package/src/index.d.ts +1 -0
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +2 -2
- package/src/index.js +1 -1
- package/src/index.js.map +2 -2
- package/src/overlay-trigger-directive.d.ts +31 -0
- package/src/overlay-trigger-directive.dev.js +102 -0
- package/src/overlay-trigger-directive.dev.js.map +7 -0
- package/src/overlay-trigger-directive.js +2 -0
- package/src/overlay-trigger-directive.js.map +7 -0
- package/src/overlay-trigger.css.dev.js +1 -1
- package/src/overlay-trigger.css.dev.js.map +1 -1
- package/src/overlay-trigger.css.js +1 -1
- package/src/overlay-trigger.css.js.map +1 -1
- package/src/overlay-types.d.ts +7 -0
- package/src/overlay-types.dev.js.map +1 -1
- package/src/overlay-types.js.map +1 -1
- package/src/overlay.css.dev.js +1 -3
- package/src/overlay.css.dev.js.map +2 -2
- package/src/overlay.css.js +1 -3
- package/src/overlay.css.js.map +2 -2
- package/src/slottable-request-event.d.ts +7 -0
- package/src/slottable-request-event.dev.js +28 -0
- package/src/slottable-request-event.dev.js.map +7 -0
- package/src/slottable-request-event.js +2 -0
- package/src/slottable-request-event.js.map +7 -0
- package/stories/overlay-directive.stories.js +203 -0
- package/stories/overlay-directive.stories.js.map +7 -0
- package/stories/overlay-element.stories.js +44 -1
- package/stories/overlay-element.stories.js.map +2 -2
- package/stories/overlay.stories.js +9 -9
- package/stories/overlay.stories.js.map +2 -2
- package/test/benchmark/basic-test.js +24 -1
- package/test/benchmark/basic-test.js.map +2 -2
- package/test/benchmark/directive-test.js +42 -0
- package/test/benchmark/directive-test.js.map +7 -0
- package/test/benchmark/element-test.js +40 -0
- package/test/benchmark/element-test.js.map +7 -0
- package/test/benchmark/lazy-test.js +48 -0
- package/test/benchmark/lazy-test.js.map +7 -0
- package/test/index.js +11 -176
- package/test/index.js.map +2 -2
- package/test/overlay-directive.test-vrt.js +5 -0
- package/test/overlay-directive.test-vrt.js.map +7 -0
- package/test/overlay-directive.test.js +147 -0
- package/test/overlay-directive.test.js.map +7 -0
- package/test/overlay-element.test.js +152 -1
- package/test/overlay-element.test.js.map +2 -2
- package/test/overlay-trigger-directive.test.js +75 -0
- package/test/overlay-trigger-directive.test.js.map +7 -0
- package/test/overlay-trigger-extended.test.js +1 -1
- package/test/overlay-trigger-extended.test.js.map +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["overlay-directive.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*/\n\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport { html } from '@spectrum-web-components/base';\nimport {\n elementUpdated,\n expect,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport { Button } from '@spectrum-web-components/button';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { elsewhere } from '../stories/overlay-directive.stories.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { fixture } from '../../../test/testing-helpers.js';\n\ndescribe('Overlay Directive', () => {\n it('opens an Overlay after the trigger', async function () {\n const test = await fixture<HTMLElement>(html`\n <div\n style=\"width: 100%; height: 100vh; display: grid; place-content: center;\"\n >\n ${elsewhere()}\n </div>\n `);\n\n const el = test.querySelector('sp-button') as Button;\n\n await elementUpdated(el);\n let overlays = document.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n\n const rect = el.getBoundingClientRect();\n let opened = oneEvent(el, 'sp-opened');\n // Open the Tooltip via \"hover\"\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n opened = oneEvent(el, 'sp-opened');\n // Open the Popover via \"click\"\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n {\n type: 'move',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n overlays = document.querySelectorAll('sp-overlay');\n expect(overlays.length).to.be.gt(0);\n expect(overlays[0].previousElementSibling).to.equal(el);\n\n // `slottable-request` comes _after_ `sp-closed` and triggers DOM cleanup\n const closed = oneEvent(overlays[0], 'slottable-request');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n await waitUntil(() => {\n overlays = document.querySelectorAll('sp-overlay');\n return overlays.length === 0;\n }, 'not all overlays were cleaned up');\n\n expect(overlays.length).to.equal(0);\n });\n\n it('opens an Overlay in a specific part of the DOM', async function () {\n const test = await fixture<HTMLElement>(html`\n <div\n style=\"width: 100%; height: 100vh; display: grid; place-content: center;\"\n >\n ${elsewhere(elsewhere.args)}\n </div>\n `);\n\n const el = test.querySelector('sp-button') as Button;\n\n await elementUpdated(el);\n\n const otherElement = test.querySelector(\n '#other-element'\n ) as HTMLElement;\n let overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n\n const rect = el.getBoundingClientRect();\n let opened = oneEvent(el, 'sp-opened');\n // Open the Tooltip via \"hover\"\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n opened = oneEvent(el, 'sp-opened');\n // Open the Popover via \"click\"\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(1);\n\n // `slottable-request` comes _after_ `sp-closed` and triggers DOM cleanup\n const closed = oneEvent(overlays[0], 'slottable-request');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n // Wait for DOM clean up to complete\n await nextFrame();\n await nextFrame();\n\n overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,SAAS,YAAY;AACrB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AACP,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AAExB,SAAS,qBAAqB,MAAM;AAChC,KAAG,sCAAsC,iBAAkB;AACvD,UAAM,OAAO,MAAM,QAAqB;AAAA;AAAA;AAAA;AAAA,kBAI9B,UAAU,CAAC;AAAA;AAAA,SAEpB;AAED,UAAM,KAAK,KAAK,cAAc,WAAW;AAEzC,UAAM,eAAe,EAAE;AACvB,QAAI,WAAW,SAAS,iBAAiB,YAAY;AACrD,WAAO,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;AAElC,UAAM,OAAO,GAAG,sBAAsB;AACtC,QAAI,SAAS,SAAS,IAAI,WAAW;AAErC,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAEN,aAAS,SAAS,IAAI,WAAW;AAEjC,UAAM,UAAU;AAAA,M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AM,EAAE,GAAG,MAAM,CAAC;AAElC,UAAM,OAAO,GAAG,sBAAsB;AACtC,QAAI,SAAS,SAAS,IAAI,WAAW;AAErC,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAEN,aAAS,SAAS,IAAI,WAAW;AAEjC,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAEN,eAAW,aAAa,iBAAiB,YAAY;AACrD,WAAO,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;AAGlC,UAAM,SAAS,SAAS,SAAS,CAAC,GAAG,mBAAmB;AACxD,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAGN,UAAM,UAAU;AAChB,UAAM,UAAU;AAEhB,eAAW,aAAa,iBAAiB,YAAY;AACrD,WAAO,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,EACtC,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -17,6 +17,10 @@ import "@spectrum-web-components/button/sp-button.js";
|
|
|
17
17
|
import { sendMouse } from "../../../test/plugins/browser.js";
|
|
18
18
|
import { sendKeys } from "@web/test-runner-commands";
|
|
19
19
|
import { click, receivesFocus } from "../stories/overlay-element.stories.js";
|
|
20
|
+
import {
|
|
21
|
+
removeSlottableRequest
|
|
22
|
+
} from "../src/slottable-request-event.js";
|
|
23
|
+
import { stub } from "sinon";
|
|
20
24
|
const OVERLAY_TYPES = ["modal", "page", "hint", "auto", "manual"];
|
|
21
25
|
async function styledFixture(story) {
|
|
22
26
|
const test = await fixture(html`
|
|
@@ -48,6 +52,123 @@ describe("sp-overlay", () => {
|
|
|
48
52
|
expect(content.open).to.be.true;
|
|
49
53
|
});
|
|
50
54
|
}
|
|
55
|
+
describe("`slottable-request` event", () => {
|
|
56
|
+
it("dispatched before `sp-opened`", async function() {
|
|
57
|
+
this.retries(0);
|
|
58
|
+
let slottableRequestTime = 0;
|
|
59
|
+
let openedTime = 0;
|
|
60
|
+
const el = await fixture(html`
|
|
61
|
+
<sp-overlay
|
|
62
|
+
@slottable-request=${() => slottableRequestTime = performance.now()}
|
|
63
|
+
@sp-opened=${() => openedTime = performance.now()}
|
|
64
|
+
>
|
|
65
|
+
<sp-popover>test</sp-popover>
|
|
66
|
+
</sp-overlay>
|
|
67
|
+
`);
|
|
68
|
+
await elementUpdated(el);
|
|
69
|
+
const opened = oneEvent(el, "sp-opened");
|
|
70
|
+
el.open = true;
|
|
71
|
+
await opened;
|
|
72
|
+
expect(slottableRequestTime).to.be.lt(openedTime);
|
|
73
|
+
});
|
|
74
|
+
it("dispatched after `sp-closed`", async function() {
|
|
75
|
+
this.retries(0);
|
|
76
|
+
let slottableRequestTime = 0;
|
|
77
|
+
let closedTime = 0;
|
|
78
|
+
const el = await fixture(html`
|
|
79
|
+
<sp-overlay
|
|
80
|
+
@sp-closed=${() => closedTime = performance.now()}
|
|
81
|
+
@slottable-request=${() => slottableRequestTime = performance.now()}
|
|
82
|
+
>
|
|
83
|
+
<sp-popover>test</sp-popover>
|
|
84
|
+
</sp-overlay>
|
|
85
|
+
`);
|
|
86
|
+
await elementUpdated(el);
|
|
87
|
+
const opened = oneEvent(el, "sp-opened");
|
|
88
|
+
el.open = true;
|
|
89
|
+
await opened;
|
|
90
|
+
await nextFrame();
|
|
91
|
+
await nextFrame();
|
|
92
|
+
const closed = oneEvent(el, "sp-closed");
|
|
93
|
+
el.open = false;
|
|
94
|
+
await closed;
|
|
95
|
+
await nextFrame();
|
|
96
|
+
await nextFrame();
|
|
97
|
+
expect(
|
|
98
|
+
slottableRequestTime,
|
|
99
|
+
`slottable-request: ${slottableRequestTime}, sp-closed: ${closedTime}`
|
|
100
|
+
).to.be.gt(closedTime);
|
|
101
|
+
});
|
|
102
|
+
it("follows transition timing from lazily added children", async function() {
|
|
103
|
+
this.retries(0);
|
|
104
|
+
let slottableRequestTime = 0;
|
|
105
|
+
let openedTime = 0;
|
|
106
|
+
const popover = document.createElement("sp-popover");
|
|
107
|
+
popover.textContent = "Test";
|
|
108
|
+
const el = await fixture(html`
|
|
109
|
+
<sp-overlay
|
|
110
|
+
@slottable-request=${(event) => {
|
|
111
|
+
slottableRequestTime = performance.now();
|
|
112
|
+
if (event.data !== removeSlottableRequest) {
|
|
113
|
+
event.target.append(popover);
|
|
114
|
+
} else {
|
|
115
|
+
popover.remove();
|
|
116
|
+
}
|
|
117
|
+
}}
|
|
118
|
+
@sp-opened=${() => openedTime = performance.now()}
|
|
119
|
+
></sp-overlay>
|
|
120
|
+
`);
|
|
121
|
+
await elementUpdated(el);
|
|
122
|
+
const opened = oneEvent(el, "sp-opened");
|
|
123
|
+
el.open = true;
|
|
124
|
+
await opened;
|
|
125
|
+
expect(slottableRequestTime).to.be.lte(openedTime);
|
|
126
|
+
expect(openedTime - slottableRequestTime).to.be.gt(130);
|
|
127
|
+
});
|
|
128
|
+
describe("dev mode", () => {
|
|
129
|
+
let consoleWarnStub;
|
|
130
|
+
before(() => {
|
|
131
|
+
window.__swc.verbose = true;
|
|
132
|
+
consoleWarnStub = stub(console, "warn");
|
|
133
|
+
});
|
|
134
|
+
afterEach(() => {
|
|
135
|
+
consoleWarnStub.resetHistory();
|
|
136
|
+
});
|
|
137
|
+
after(() => {
|
|
138
|
+
window.__swc.verbose = false;
|
|
139
|
+
consoleWarnStub.restore();
|
|
140
|
+
});
|
|
141
|
+
it("warns that `slottable-request` events are experimental", async () => {
|
|
142
|
+
const el = await fixture(html`
|
|
143
|
+
<sp-overlay>
|
|
144
|
+
<sp-popover>test</sp-popover>
|
|
145
|
+
</sp-overlay>
|
|
146
|
+
`);
|
|
147
|
+
await elementUpdated(el);
|
|
148
|
+
const opened = oneEvent(el, "sp-opened");
|
|
149
|
+
el.open = true;
|
|
150
|
+
await opened;
|
|
151
|
+
expect(consoleWarnStub.called).to.be.true;
|
|
152
|
+
const spyCall = consoleWarnStub.getCall(0);
|
|
153
|
+
expect(
|
|
154
|
+
spyCall.args.at(0).includes(
|
|
155
|
+
"`slottable-request` events are experimental"
|
|
156
|
+
),
|
|
157
|
+
"`slottable-request`-centric message"
|
|
158
|
+
).to.be.true;
|
|
159
|
+
expect(
|
|
160
|
+
spyCall.args.at(-1),
|
|
161
|
+
"confirm `data` shape"
|
|
162
|
+
).to.deep.equal({
|
|
163
|
+
data: {
|
|
164
|
+
localName: "base",
|
|
165
|
+
type: "api",
|
|
166
|
+
level: "high"
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
51
172
|
describe('[type="modal"]', () => {
|
|
52
173
|
opensDeclaratively("modal");
|
|
53
174
|
describe("interaction with other non-ancestor overlays", function() {
|
|
@@ -691,7 +812,7 @@ describe("sp-overlay", () => {
|
|
|
691
812
|
expect(this.manual.open).to.be.true;
|
|
692
813
|
});
|
|
693
814
|
});
|
|
694
|
-
describe("only close when
|
|
815
|
+
describe("only close when manually closed", function() {
|
|
695
816
|
it("does not close when clicking away", async () => {
|
|
696
817
|
const test = await fixture(html`
|
|
697
818
|
<div>
|
|
@@ -727,6 +848,36 @@ describe("sp-overlay", () => {
|
|
|
727
848
|
expect(el === overlay).to.be.true;
|
|
728
849
|
expect(el.open).to.be.false;
|
|
729
850
|
});
|
|
851
|
+
it("does not close when pressing `Escape`", async () => {
|
|
852
|
+
const test = await fixture(html`
|
|
853
|
+
<div>
|
|
854
|
+
${click({
|
|
855
|
+
...click.args,
|
|
856
|
+
interaction: "click",
|
|
857
|
+
placement: "bottom",
|
|
858
|
+
type: "manual",
|
|
859
|
+
delayed: false,
|
|
860
|
+
receivesFocus: "auto"
|
|
861
|
+
})}
|
|
862
|
+
</div>
|
|
863
|
+
`);
|
|
864
|
+
const el = test.querySelector("sp-overlay");
|
|
865
|
+
expect(el.open).to.be.false;
|
|
866
|
+
const opened = oneEvent(el, "sp-opened");
|
|
867
|
+
el.open = true;
|
|
868
|
+
let { overlay } = await opened;
|
|
869
|
+
expect(el === overlay).to.be.true;
|
|
870
|
+
await sendKeys({
|
|
871
|
+
press: "Escape"
|
|
872
|
+
});
|
|
873
|
+
await aTimeout(200);
|
|
874
|
+
expect(el.open).to.be.true;
|
|
875
|
+
const closed = oneEvent(el, "sp-closed");
|
|
876
|
+
el.open = false;
|
|
877
|
+
({ overlay } = await closed);
|
|
878
|
+
expect(el === overlay).to.be.true;
|
|
879
|
+
expect(el.open).to.be.false;
|
|
880
|
+
});
|
|
730
881
|
});
|
|
731
882
|
});
|
|
732
883
|
});
|
|
@@ -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 type { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\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('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when mnually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,qBAAqB;AAErC,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAiC;AACzD,OAAG,cAAc,WAAW,OAAO,YAAY;AAC3C,YAAM,KAAK,MAAM,cAAuB;AAAA,wCACZ,WAAW;AAAA;AAAA;AAAA,aAGtC;AACD,YAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,UAAI,SAAS,SAAS,IAAI,WAAW;AACrC,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAC3B,YAAM,SAAS,SAAS,IAAI,WAAW;AACvC,SAAG,OAAO;AACV,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAC3B,eAAS,SAAS,IAAI,WAAW;AACjC,SAAG,OAAO;AACV,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAAA,IAC/B,CAAC;AAAA,EACL;AAEA,WAAS,kBAAkB,MAAM;AAC7B,uBAAmB,OAAO;AAC1B,aAAS,gDAAgD,WAAY;AACjE,iBAAW,iBAAkB;AACzB,aAAK,UAAU,MAAM,cA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L,CAAC;AACD,aAAS,kCAAkC,WAAY;AACnD,SAAG,qCAAqC,YAAY;AAChD,cAAM,OAAO,MAAM,QAAQ;AAAA;AAAA,0BAEjB,MAAM;AAAA,UACJ,GAAG,MAAM;AAAA,UACT,aAAa;AAAA,UACb,WAAW;AAAA,UACX,MAAM;AAAA,UACN,SAAS;AAAA,UACT,eAAe;AAAA,QACnB,CAAC,CAAC;AAAA;AAAA,iBAET;AACD,cAAM,KAAK,KAAK,cAAc,YAAY;AAE1C,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,YAAI,EAAE,QAAQ,IAAI,MAAM;AACxB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,cAAM,UAAU;AAAA,UACZ,OAAO;AAAA,YACH;AAAA,cACI,MAAM;AAAA,cACN,UAAU,CAAC,IAAI,GAAG;AAAA,YACtB;AAAA,UACJ;AAAA,QACJ,CAAC;AAED,cAAM,SAAS,GAAG;AAElB,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from '../src/slottable-request-event.js';\nimport { stub } from 'sinon';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('`slottable-request` event', () => {\n it('dispatched before `sp-opened`', async function () {\n this.retries(0);\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 this.retries(0);\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 this.retries(0);\n let slottableRequestTime = 0;\n let openedTime = 0;\n const popover = document.createElement('sp-popover');\n popover.textContent = 'Test';\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${(event: SlottableRequestEvent) => {\n slottableRequestTime = performance.now();\n if (event.data !== removeSlottableRequest) {\n (event.target as HTMLElement).append(popover);\n } else {\n popover.remove();\n }\n }}\n @sp-opened=${() => (openedTime = performance.now())}\n ></sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lte(openedTime);\n expect(openedTime - slottableRequestTime).to.be.gt(130);\n });\n\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `slottable-request` events are experimental', async () => {\n const el = await fixture<Overlay>(html`\n <sp-overlay>\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes(\n '`slottable-request` events are experimental'\n ),\n '`slottable-request`-centric message'\n ).to.be.true;\n expect(\n spyCall.args.at(-1),\n 'confirm `data` shape'\n ).to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n });\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when manually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n it('does not close when pressing `Escape`', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.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AEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,YAAI,EAAE,QAAQ,IAAI,MAAM;AACxB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,cAAM,SAAS;AAAA,UACX,OAAO;AAAA,QACX,CAAC;AAED,cAAM,SAAS,GAAG;AAElB,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { elementUpdated, expect, fixture, oneEvent } from "@open-wc/testing";
|
|
3
|
+
import { html } from "@spectrum-web-components/base";
|
|
4
|
+
import { stub } from "sinon";
|
|
5
|
+
import { trigger } from "@spectrum-web-components/overlay/src/overlay-trigger-directive.js";
|
|
6
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
7
|
+
import "@spectrum-web-components/popover/sp-popover.js";
|
|
8
|
+
import "@spectrum-web-components/dialog/sp-dialog.js";
|
|
9
|
+
import "@spectrum-web-components/slider/sp-slider.js";
|
|
10
|
+
import "@spectrum-web-components/tooltip/sp-tooltip.js";
|
|
11
|
+
describe("Overlay trigger directive", () => {
|
|
12
|
+
describe("dev mode", () => {
|
|
13
|
+
let consoleWarnStub;
|
|
14
|
+
before(() => {
|
|
15
|
+
window.__swc.verbose = true;
|
|
16
|
+
consoleWarnStub = stub(console, "warn");
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
consoleWarnStub.resetHistory();
|
|
20
|
+
});
|
|
21
|
+
after(() => {
|
|
22
|
+
window.__swc.verbose = false;
|
|
23
|
+
consoleWarnStub.restore();
|
|
24
|
+
});
|
|
25
|
+
it("warns that the trigger directive is experimental", async () => {
|
|
26
|
+
const popover = () => html`
|
|
27
|
+
<sp-popover>
|
|
28
|
+
<sp-dialog no-divider>
|
|
29
|
+
<sp-slider
|
|
30
|
+
value="5"
|
|
31
|
+
step="0.5"
|
|
32
|
+
min="0"
|
|
33
|
+
max="20"
|
|
34
|
+
label="Awesomeness"
|
|
35
|
+
></sp-slider>
|
|
36
|
+
<div id="styled-div">
|
|
37
|
+
The background of this div should be blue
|
|
38
|
+
</div>
|
|
39
|
+
<sp-button>
|
|
40
|
+
Press Me
|
|
41
|
+
<sp-tooltip self-managed delayed>
|
|
42
|
+
Click to open another popover.
|
|
43
|
+
</sp-tooltip>
|
|
44
|
+
</sp-button>
|
|
45
|
+
</sp-dialog>
|
|
46
|
+
</sp-popover>
|
|
47
|
+
`;
|
|
48
|
+
const el = await fixture(html`
|
|
49
|
+
<sp-button ${trigger(popover, { triggerInteraction: "click" })}>
|
|
50
|
+
Trigger
|
|
51
|
+
</sp-button>
|
|
52
|
+
`);
|
|
53
|
+
await elementUpdated(el);
|
|
54
|
+
const opened = oneEvent(el, "sp-opened");
|
|
55
|
+
el.click();
|
|
56
|
+
await opened;
|
|
57
|
+
expect(consoleWarnStub.called).to.be.true;
|
|
58
|
+
const spyCall = consoleWarnStub.getCall(0);
|
|
59
|
+
expect(
|
|
60
|
+
spyCall.args.at(0).includes(
|
|
61
|
+
"The Overlay Trigger Directive is experimental"
|
|
62
|
+
),
|
|
63
|
+
"Overlay Trigger Directive-centric message"
|
|
64
|
+
).to.be.true;
|
|
65
|
+
expect(spyCall.args.at(-1), "confirm `data` shape").to.deep.equal({
|
|
66
|
+
data: {
|
|
67
|
+
localName: "base",
|
|
68
|
+
type: "api",
|
|
69
|
+
level: "high"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=overlay-trigger-directive.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["overlay-trigger-directive.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*/\n\nimport { elementUpdated, expect, fixture, oneEvent } from '@open-wc/testing';\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { stub } from 'sinon';\nimport { trigger } from '@spectrum-web-components/overlay/src/overlay-trigger-directive.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/dialog/sp-dialog.js';\nimport '@spectrum-web-components/slider/sp-slider.js';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\n\ndescribe('Overlay trigger directive', () => {\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 the trigger directive is experimental', async () => {\n const popover = (): TemplateResult => html`\n <sp-popover>\n <sp-dialog no-divider>\n <sp-slider\n value=\"5\"\n step=\"0.5\"\n min=\"0\"\n max=\"20\"\n label=\"Awesomeness\"\n ></sp-slider>\n <div id=\"styled-div\">\n The background of this div should be blue\n </div>\n <sp-button>\n Press Me\n <sp-tooltip self-managed delayed>\n Click to open another popover.\n </sp-tooltip>\n </sp-button>\n </sp-dialog>\n </sp-popover>\n `;\n const el = await fixture<Overlay>(html`\n <sp-button ${trigger(popover, { triggerInteraction: 'click' })}>\n Trigger\n </sp-button>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.click();\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 'The Overlay Trigger Directive is experimental'\n ),\n 'Overlay Trigger Directive-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,gBAAgB,QAAQ,SAAS,gBAAgB;AAC1D,SAAS,YAA4B;AACrC,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAGP,SAAS,6BAA6B,MAAM;AACxC,WAAS,YAAY,MAAM;AACvB,QAAI;AACJ,WAAO,MAAM;AACT,aAAO,MAAM,UAAU;AACvB,wBAAkB,KAAK,SAAS,MAAM;AAAA,IAC1C,CAAC;AACD,cAAU,MAAM;AACZ,sBAAgB,aAAa;AAAA,IACjC,CAAC;AACD,UAAM,MAAM;AACR,aAAO,MAAM,UAAU;AACvB,sBAAgB,QAAQ;AAAA,IAC5B,CAAC;AAED,OAAG,oDAAoD,YAAY;AAC/D,YAAM,UAAU,MAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBtC,YAAM,KAAK,MAAM,QAAiB;AAAA,6BACjB,QAAQ,SAAS,EAAE,oBAAoB,QAAQ,CAAC,CAAC;AAAA;AAAA;AAAA,aAGjE;AAED,YAAM,eAAe,EAAE;AAEvB,YAAM,SAAS,SAAS,IAAI,WAAW;AACvC,SAAG,MAAM;AACT,YAAM;AAEN,aAAO,gBAAgB,MAAM,EAAE,GAAG,GAAG;AACrC,YAAM,UAAU,gBAAgB,QAAQ,CAAC;AACzC;AAAA,QACK,QAAQ,KAAK,GAAG,CAAC,EAAa;AAAA,UAC3B;AAAA,QACJ;AAAA,QACA;AAAA,MACJ,EAAE,GAAG,GAAG;AACR,aAAO,QAAQ,KAAK,GAAG,EAAE,GAAG,sBAAsB,EAAE,GAAG,KAAK,MAAM;AAAA,QAC9D,MAAM;AAAA,UACF,WAAW;AAAA,UACX,MAAM;AAAA,UACN,OAAO;AAAA,QACX;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -104,7 +104,7 @@ describe("Overlay Trigger - extended", () => {
|
|
|
104
104
|
await nextFrame();
|
|
105
105
|
expect(popover.placement).to.equal("bottom");
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
it("occludes content behind the overlay", async () => {
|
|
108
108
|
({ overlayTrigger, button, popover } = await initTest());
|
|
109
109
|
const textfield = document.createElement("sp-textfield");
|
|
110
110
|
overlayTrigger.insertAdjacentElement("afterend", textfield);
|