@spectrum-web-components/overlay 0.19.6-overlay.18 → 0.30.1-overlay.30
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/overlay-trigger.dev.js +2 -1
- package/overlay-trigger.dev.js.map +2 -2
- package/overlay-trigger.js +1 -1
- package/overlay-trigger.js.map +3 -3
- package/package.json +7 -7
- package/sp-overlay.dev.js +2 -1
- package/sp-overlay.dev.js.map +2 -2
- package/sp-overlay.js +1 -1
- package/sp-overlay.js.map +3 -3
- package/src/Overlay.js.map +1 -1
- package/src/OverlayBase.d.ts +11 -1
- package/src/OverlayBase.dev.js +141 -91
- package/src/OverlayBase.dev.js.map +2 -2
- package/src/OverlayBase.js +6 -7
- package/src/OverlayBase.js.map +3 -3
- package/src/OverlayDialog.js.map +1 -1
- package/src/OverlayNoPopover.js.map +1 -1
- package/src/OverlayPopover.dev.js +22 -2
- 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 +18 -8
- package/src/OverlayStack.dev.js.map +2 -2
- package/src/OverlayStack.js +1 -1
- package/src/OverlayStack.js.map +3 -3
- package/src/OverlayTrigger.dev.js +1 -0
- package/src/OverlayTrigger.dev.js.map +2 -2
- package/src/OverlayTrigger.js +1 -0
- package/src/OverlayTrigger.js.map +2 -2
- package/src/PlacementController.js.map +1 -1
- package/src/overlay-base.css.dev.js +1 -1
- package/src/overlay-base.css.dev.js.map +1 -1
- package/src/overlay-base.css.js +1 -1
- package/src/overlay-base.css.js.map +1 -1
- package/src/placement.js.map +1 -1
- package/src/topLayerOverTransforms.dev.js +4 -0
- package/src/topLayerOverTransforms.dev.js.map +2 -2
- package/src/topLayerOverTransforms.js +1 -1
- package/src/topLayerOverTransforms.js.map +2 -2
- package/test/index.js +113 -106
- package/test/index.js.map +2 -2
- package/test/overlay-element.test.js +345 -411
- package/test/overlay-element.test.js.map +2 -2
- package/test/overlay-lifecycle.test.js +1 -33
- package/test/overlay-lifecycle.test.js.map +2 -2
- package/test/overlay-trigger-extended.test.js +1 -1
- package/test/overlay-trigger-extended.test.js.map +2 -2
- package/test/overlay-trigger-hover-click.test.js +23 -23
- package/test/overlay-trigger-hover-click.test.js.map +2 -2
- package/test/overlay-trigger-hover.test.js +42 -36
- package/test/overlay-trigger-hover.test.js.map +2 -2
- package/test/overlay-trigger-longpress.test.js +51 -51
- package/test/overlay-trigger-longpress.test.js.map +2 -2
- package/test/overlay.test.js +8 -12
- package/test/overlay.test.js.map +2 -2
|
@@ -46,296 +46,244 @@ describe("sp-overlay", () => {
|
|
|
46
46
|
}
|
|
47
47
|
describe('[type="modal"]', () => {
|
|
48
48
|
opensDeclaratively("modal");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<sp-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
expect(hint.open).to.be.false;
|
|
167
|
-
expect(auto.open).to.be.false;
|
|
168
|
-
expect(manual.open).to.be.false;
|
|
169
|
-
await nextFrame();
|
|
170
|
-
opened = oneEvent(manual, "sp-opened");
|
|
171
|
-
manual.open = true;
|
|
172
|
-
await opened;
|
|
173
|
-
await elementUpdated(manual);
|
|
174
|
-
expect(modal.open).to.be.false;
|
|
175
|
-
expect(page.open).to.be.false;
|
|
176
|
-
expect(hint.open).to.be.false;
|
|
177
|
-
expect(auto.open).to.be.false;
|
|
178
|
-
expect(manual.open).to.be.true;
|
|
179
|
-
await nextFrame();
|
|
180
|
-
opened = oneEvent(modal, "sp-opened");
|
|
181
|
-
closed = oneEvent(manual, "sp-closed");
|
|
182
|
-
modal.open = true;
|
|
183
|
-
await opened;
|
|
184
|
-
await closed;
|
|
185
|
-
await elementUpdated(page);
|
|
186
|
-
await elementUpdated(manual);
|
|
187
|
-
expect(modal.open).to.be.true;
|
|
188
|
-
expect(page.open).to.be.false;
|
|
189
|
-
expect(hint.open).to.be.false;
|
|
190
|
-
expect(auto.open).to.be.false;
|
|
191
|
-
expect(manual.open).to.be.false;
|
|
49
|
+
describe("interaction with other non-ancestor overlays", function() {
|
|
50
|
+
beforeEach(async function() {
|
|
51
|
+
this.fixture = await styledFixture(html`
|
|
52
|
+
<div>
|
|
53
|
+
${OVERLAY_TYPES.map(
|
|
54
|
+
(type) => html`
|
|
55
|
+
<sp-overlay type=${type}>
|
|
56
|
+
<sp-tooltip>${type} Content</sp-tooltip>
|
|
57
|
+
</sp-overlay>
|
|
58
|
+
`
|
|
59
|
+
)}
|
|
60
|
+
</div>
|
|
61
|
+
`);
|
|
62
|
+
this.modal = this.fixture.querySelector(
|
|
63
|
+
'[type="modal"]'
|
|
64
|
+
);
|
|
65
|
+
this.page = this.fixture.querySelector(
|
|
66
|
+
'[type="page"]'
|
|
67
|
+
);
|
|
68
|
+
this.hint = this.fixture.querySelector(
|
|
69
|
+
'[type="hint"]'
|
|
70
|
+
);
|
|
71
|
+
this.auto = this.fixture.querySelector(
|
|
72
|
+
'[type="auto"]'
|
|
73
|
+
);
|
|
74
|
+
this.manual = this.fixture.querySelector(
|
|
75
|
+
'[type="manual"]'
|
|
76
|
+
);
|
|
77
|
+
expect(this.modal.open).to.be.false;
|
|
78
|
+
expect(this.page.open).to.be.false;
|
|
79
|
+
expect(this.hint.open).to.be.false;
|
|
80
|
+
expect(this.auto.open).to.be.false;
|
|
81
|
+
expect(this.manual.open).to.be.false;
|
|
82
|
+
});
|
|
83
|
+
afterEach(async function() {
|
|
84
|
+
const closed = oneEvent(this.modal, "sp-closed");
|
|
85
|
+
this.modal.open = false;
|
|
86
|
+
await closed;
|
|
87
|
+
});
|
|
88
|
+
it('closes "page" overlays when opening', async function() {
|
|
89
|
+
let opened = oneEvent(this.page, "sp-opened");
|
|
90
|
+
this.page.open = true;
|
|
91
|
+
await opened;
|
|
92
|
+
expect(this.modal.open).to.be.false;
|
|
93
|
+
expect(this.page.open).to.be.true;
|
|
94
|
+
expect(this.hint.open).to.be.false;
|
|
95
|
+
expect(this.auto.open).to.be.false;
|
|
96
|
+
expect(this.manual.open).to.be.false;
|
|
97
|
+
opened = oneEvent(this.modal, "sp-opened");
|
|
98
|
+
const closed = oneEvent(this.page, "sp-closed");
|
|
99
|
+
this.modal.open = true;
|
|
100
|
+
await opened;
|
|
101
|
+
await closed;
|
|
102
|
+
expect(this.modal.open).to.be.true;
|
|
103
|
+
expect(this.page.open).to.be.false;
|
|
104
|
+
expect(this.hint.open).to.be.false;
|
|
105
|
+
expect(this.auto.open).to.be.false;
|
|
106
|
+
expect(this.manual.open).to.be.false;
|
|
107
|
+
});
|
|
108
|
+
it('closes "hint" overlays when opening', async function() {
|
|
109
|
+
let opened = oneEvent(this.hint, "sp-opened");
|
|
110
|
+
this.hint.open = true;
|
|
111
|
+
await opened;
|
|
112
|
+
expect(this.modal.open).to.be.false;
|
|
113
|
+
expect(this.page.open).to.be.false;
|
|
114
|
+
expect(this.hint.open).to.be.true;
|
|
115
|
+
expect(this.auto.open).to.be.false;
|
|
116
|
+
expect(this.manual.open).to.be.false;
|
|
117
|
+
opened = oneEvent(this.modal, "sp-opened");
|
|
118
|
+
const closed = oneEvent(this.hint, "sp-closed");
|
|
119
|
+
this.modal.open = true;
|
|
120
|
+
await opened;
|
|
121
|
+
await closed;
|
|
122
|
+
expect(this.modal.open).to.be.true;
|
|
123
|
+
expect(this.page.open).to.be.false;
|
|
124
|
+
expect(this.hint.open).to.be.false;
|
|
125
|
+
expect(this.auto.open).to.be.false;
|
|
126
|
+
expect(this.manual.open).to.be.false;
|
|
127
|
+
});
|
|
128
|
+
it('closes "auto" overlays when opening', async function() {
|
|
129
|
+
let opened = oneEvent(this.auto, "sp-opened");
|
|
130
|
+
this.auto.open = true;
|
|
131
|
+
await opened;
|
|
132
|
+
expect(this.modal.open).to.be.false;
|
|
133
|
+
expect(this.page.open).to.be.false;
|
|
134
|
+
expect(this.hint.open).to.be.false;
|
|
135
|
+
expect(this.auto.open).to.be.true;
|
|
136
|
+
expect(this.manual.open).to.be.false;
|
|
137
|
+
opened = oneEvent(this.modal, "sp-opened");
|
|
138
|
+
const closed = oneEvent(this.auto, "sp-closed");
|
|
139
|
+
this.modal.open = true;
|
|
140
|
+
await opened;
|
|
141
|
+
await closed;
|
|
142
|
+
expect(this.modal.open).to.be.true;
|
|
143
|
+
expect(this.page.open).to.be.false;
|
|
144
|
+
expect(this.hint.open).to.be.false;
|
|
145
|
+
expect(this.auto.open).to.be.false;
|
|
146
|
+
expect(this.manual.open).to.be.false;
|
|
147
|
+
});
|
|
148
|
+
it('does not close "manual" overlays when opening', async function() {
|
|
149
|
+
let opened = oneEvent(this.manual, "sp-opened");
|
|
150
|
+
this.manual.open = true;
|
|
151
|
+
await opened;
|
|
152
|
+
expect(this.modal.open).to.be.false;
|
|
153
|
+
expect(this.page.open).to.be.false;
|
|
154
|
+
expect(this.hint.open).to.be.false;
|
|
155
|
+
expect(this.auto.open).to.be.false;
|
|
156
|
+
expect(this.manual.open).to.be.true;
|
|
157
|
+
opened = oneEvent(this.modal, "sp-opened");
|
|
158
|
+
this.modal.open = true;
|
|
159
|
+
await opened;
|
|
160
|
+
expect(this.modal.open).to.be.true;
|
|
161
|
+
expect(this.page.open).to.be.false;
|
|
162
|
+
expect(this.hint.open).to.be.false;
|
|
163
|
+
expect(this.auto.open).to.be.false;
|
|
164
|
+
expect(this.manual.open).to.be.true;
|
|
165
|
+
});
|
|
192
166
|
});
|
|
193
167
|
});
|
|
194
168
|
describe('[type="page"]', () => {
|
|
195
169
|
opensDeclaratively("page");
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<sp-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
expect(hint.open).to.be.false;
|
|
314
|
-
expect(auto.open).to.be.false;
|
|
315
|
-
expect(manual.open).to.be.false;
|
|
316
|
-
await nextFrame();
|
|
317
|
-
opened = oneEvent(manual, "sp-opened");
|
|
318
|
-
manual.open = true;
|
|
319
|
-
await opened;
|
|
320
|
-
await elementUpdated(manual);
|
|
321
|
-
expect(modal.open).to.be.false;
|
|
322
|
-
expect(page.open).to.be.false;
|
|
323
|
-
expect(hint.open).to.be.false;
|
|
324
|
-
expect(auto.open).to.be.false;
|
|
325
|
-
expect(manual.open).to.be.true;
|
|
326
|
-
await nextFrame();
|
|
327
|
-
opened = oneEvent(page, "sp-opened");
|
|
328
|
-
closed = oneEvent(manual, "sp-closed");
|
|
329
|
-
page.open = true;
|
|
330
|
-
await opened;
|
|
331
|
-
await closed;
|
|
332
|
-
await elementUpdated(page);
|
|
333
|
-
await elementUpdated(manual);
|
|
334
|
-
expect(modal.open).to.be.false;
|
|
335
|
-
expect(page.open).to.be.true;
|
|
336
|
-
expect(hint.open).to.be.false;
|
|
337
|
-
expect(auto.open).to.be.false;
|
|
338
|
-
expect(manual.open).to.be.false;
|
|
170
|
+
describe("interaction with other non-ancestor overlays", function() {
|
|
171
|
+
beforeEach(async function() {
|
|
172
|
+
this.fixture = await styledFixture(html`
|
|
173
|
+
<div>
|
|
174
|
+
${OVERLAY_TYPES.map(
|
|
175
|
+
(type) => html`
|
|
176
|
+
<sp-overlay type=${type}>
|
|
177
|
+
<sp-tooltip>${type} Content</sp-tooltip>
|
|
178
|
+
</sp-overlay>
|
|
179
|
+
`
|
|
180
|
+
)}
|
|
181
|
+
</div>
|
|
182
|
+
`);
|
|
183
|
+
this.modal = this.fixture.querySelector(
|
|
184
|
+
'[type="modal"]'
|
|
185
|
+
);
|
|
186
|
+
this.page = this.fixture.querySelector(
|
|
187
|
+
'[type="page"]'
|
|
188
|
+
);
|
|
189
|
+
this.hint = this.fixture.querySelector(
|
|
190
|
+
'[type="hint"]'
|
|
191
|
+
);
|
|
192
|
+
this.auto = this.fixture.querySelector(
|
|
193
|
+
'[type="auto"]'
|
|
194
|
+
);
|
|
195
|
+
this.manual = this.fixture.querySelector(
|
|
196
|
+
'[type="manual"]'
|
|
197
|
+
);
|
|
198
|
+
expect(this.modal.open).to.be.false;
|
|
199
|
+
expect(this.page.open).to.be.false;
|
|
200
|
+
expect(this.hint.open).to.be.false;
|
|
201
|
+
expect(this.auto.open).to.be.false;
|
|
202
|
+
expect(this.manual.open).to.be.false;
|
|
203
|
+
});
|
|
204
|
+
afterEach(async function() {
|
|
205
|
+
const closed = oneEvent(this.page, "sp-closed");
|
|
206
|
+
this.page.open = false;
|
|
207
|
+
await closed;
|
|
208
|
+
});
|
|
209
|
+
it('closes "page" overlays when opening', async function() {
|
|
210
|
+
let opened = oneEvent(this.modal, "sp-opened");
|
|
211
|
+
this.modal.open = true;
|
|
212
|
+
await opened;
|
|
213
|
+
expect(this.modal.open).to.be.true;
|
|
214
|
+
expect(this.page.open).to.be.false;
|
|
215
|
+
expect(this.hint.open).to.be.false;
|
|
216
|
+
expect(this.auto.open).to.be.false;
|
|
217
|
+
expect(this.manual.open).to.be.false;
|
|
218
|
+
opened = oneEvent(this.page, "sp-opened");
|
|
219
|
+
const closed = oneEvent(this.modal, "sp-closed");
|
|
220
|
+
this.page.open = true;
|
|
221
|
+
await opened;
|
|
222
|
+
await closed;
|
|
223
|
+
expect(this.modal.open).to.be.false;
|
|
224
|
+
expect(this.page.open).to.be.true;
|
|
225
|
+
expect(this.hint.open).to.be.false;
|
|
226
|
+
expect(this.auto.open).to.be.false;
|
|
227
|
+
expect(this.manual.open).to.be.false;
|
|
228
|
+
});
|
|
229
|
+
it('closes "hint" overlays when opening', async function() {
|
|
230
|
+
let opened = oneEvent(this.hint, "sp-opened");
|
|
231
|
+
this.hint.open = true;
|
|
232
|
+
await opened;
|
|
233
|
+
expect(this.modal.open).to.be.false;
|
|
234
|
+
expect(this.page.open).to.be.false;
|
|
235
|
+
expect(this.hint.open).to.be.true;
|
|
236
|
+
expect(this.auto.open).to.be.false;
|
|
237
|
+
expect(this.manual.open).to.be.false;
|
|
238
|
+
opened = oneEvent(this.page, "sp-opened");
|
|
239
|
+
const closed = oneEvent(this.hint, "sp-closed");
|
|
240
|
+
this.page.open = true;
|
|
241
|
+
await opened;
|
|
242
|
+
await closed;
|
|
243
|
+
expect(this.modal.open).to.be.false;
|
|
244
|
+
expect(this.page.open).to.be.true;
|
|
245
|
+
expect(this.hint.open).to.be.false;
|
|
246
|
+
expect(this.auto.open).to.be.false;
|
|
247
|
+
expect(this.manual.open).to.be.false;
|
|
248
|
+
});
|
|
249
|
+
it('closes "auto" overlays when opening', async function() {
|
|
250
|
+
let opened = oneEvent(this.auto, "sp-opened");
|
|
251
|
+
this.auto.open = true;
|
|
252
|
+
await opened;
|
|
253
|
+
expect(this.modal.open).to.be.false;
|
|
254
|
+
expect(this.page.open).to.be.false;
|
|
255
|
+
expect(this.hint.open).to.be.false;
|
|
256
|
+
expect(this.auto.open).to.be.true;
|
|
257
|
+
expect(this.manual.open).to.be.false;
|
|
258
|
+
opened = oneEvent(this.page, "sp-opened");
|
|
259
|
+
const closed = oneEvent(this.auto, "sp-closed");
|
|
260
|
+
this.page.open = true;
|
|
261
|
+
await opened;
|
|
262
|
+
await closed;
|
|
263
|
+
expect(this.modal.open).to.be.false;
|
|
264
|
+
expect(this.page.open).to.be.true;
|
|
265
|
+
expect(this.hint.open).to.be.false;
|
|
266
|
+
expect(this.auto.open).to.be.false;
|
|
267
|
+
expect(this.manual.open).to.be.false;
|
|
268
|
+
});
|
|
269
|
+
it('does not close "manual" overlays when opening', async function() {
|
|
270
|
+
let opened = oneEvent(this.manual, "sp-opened");
|
|
271
|
+
this.manual.open = true;
|
|
272
|
+
await opened;
|
|
273
|
+
expect(this.modal.open).to.be.false;
|
|
274
|
+
expect(this.page.open).to.be.false;
|
|
275
|
+
expect(this.hint.open).to.be.false;
|
|
276
|
+
expect(this.auto.open).to.be.false;
|
|
277
|
+
expect(this.manual.open).to.be.true;
|
|
278
|
+
opened = oneEvent(this.page, "sp-opened");
|
|
279
|
+
this.page.open = true;
|
|
280
|
+
await opened;
|
|
281
|
+
expect(this.modal.open).to.be.false;
|
|
282
|
+
expect(this.page.open).to.be.true;
|
|
283
|
+
expect(this.hint.open).to.be.false;
|
|
284
|
+
expect(this.auto.open).to.be.false;
|
|
285
|
+
expect(this.manual.open).to.be.true;
|
|
286
|
+
});
|
|
339
287
|
});
|
|
340
288
|
});
|
|
341
289
|
describe('[type="hint"]', () => {
|
|
@@ -599,131 +547,117 @@ describe("sp-overlay", () => {
|
|
|
599
547
|
});
|
|
600
548
|
describe('[type="manual"]', () => {
|
|
601
549
|
opensDeclaratively("manual");
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
<sp-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
await opened;
|
|
714
|
-
expect(modal.open).to.be.false;
|
|
715
|
-
expect(page.open).to.be.false;
|
|
716
|
-
expect(hint.open).to.be.false;
|
|
717
|
-
expect(auto.open).to.be.true;
|
|
718
|
-
expect(manual.open).to.be.false;
|
|
719
|
-
opened = oneEvent(manual, "sp-opened");
|
|
720
|
-
manual.open = true;
|
|
721
|
-
await opened;
|
|
722
|
-
expect(modal.open).to.be.false;
|
|
723
|
-
expect(page.open).to.be.false;
|
|
724
|
-
expect(hint.open).to.be.false;
|
|
725
|
-
expect(auto.open).to.be.true;
|
|
726
|
-
expect(manual.open).to.be.true;
|
|
550
|
+
describe("interaction with other non-ancestor overlays", function() {
|
|
551
|
+
beforeEach(async function() {
|
|
552
|
+
this.fixture = await styledFixture(html`
|
|
553
|
+
<div>
|
|
554
|
+
${OVERLAY_TYPES.map(
|
|
555
|
+
(type) => html`
|
|
556
|
+
<sp-overlay type=${type}>
|
|
557
|
+
<sp-tooltip>${type} Content</sp-tooltip>
|
|
558
|
+
</sp-overlay>
|
|
559
|
+
`
|
|
560
|
+
)}
|
|
561
|
+
</div>
|
|
562
|
+
`);
|
|
563
|
+
this.modal = this.fixture.querySelector(
|
|
564
|
+
'[type="modal"]'
|
|
565
|
+
);
|
|
566
|
+
this.page = this.fixture.querySelector(
|
|
567
|
+
'[type="page"]'
|
|
568
|
+
);
|
|
569
|
+
this.hint = this.fixture.querySelector(
|
|
570
|
+
'[type="hint"]'
|
|
571
|
+
);
|
|
572
|
+
this.auto = this.fixture.querySelector(
|
|
573
|
+
'[type="auto"]'
|
|
574
|
+
);
|
|
575
|
+
this.manual = this.fixture.querySelector(
|
|
576
|
+
'[type="manual"]'
|
|
577
|
+
);
|
|
578
|
+
expect(this.modal.open).to.be.false;
|
|
579
|
+
expect(this.page.open).to.be.false;
|
|
580
|
+
expect(this.hint.open).to.be.false;
|
|
581
|
+
expect(this.auto.open).to.be.false;
|
|
582
|
+
expect(this.manual.open).to.be.false;
|
|
583
|
+
});
|
|
584
|
+
afterEach(async function() {
|
|
585
|
+
const closed = oneEvent(this.manual, "sp-closed");
|
|
586
|
+
this.manual.open = false;
|
|
587
|
+
await closed;
|
|
588
|
+
});
|
|
589
|
+
it('does not close "modal" overlays when opening', async function() {
|
|
590
|
+
let opened = oneEvent(this.modal, "sp-opened");
|
|
591
|
+
this.modal.open = true;
|
|
592
|
+
await opened;
|
|
593
|
+
expect(this.modal.open).to.be.true;
|
|
594
|
+
expect(this.page.open).to.be.false;
|
|
595
|
+
expect(this.hint.open).to.be.false;
|
|
596
|
+
expect(this.auto.open).to.be.false;
|
|
597
|
+
expect(this.manual.open).to.be.false;
|
|
598
|
+
opened = oneEvent(this.manual, "sp-opened");
|
|
599
|
+
this.manual.open = true;
|
|
600
|
+
await opened;
|
|
601
|
+
expect(this.modal.open).to.be.true;
|
|
602
|
+
expect(this.page.open).to.be.false;
|
|
603
|
+
expect(this.hint.open).to.be.false;
|
|
604
|
+
expect(this.auto.open).to.be.false;
|
|
605
|
+
expect(this.manual.open).to.be.true;
|
|
606
|
+
});
|
|
607
|
+
it('does not close "modal" overlays when opening', async function() {
|
|
608
|
+
let opened = oneEvent(this.page, "sp-opened");
|
|
609
|
+
this.page.open = true;
|
|
610
|
+
await opened;
|
|
611
|
+
expect(this.modal.open).to.be.false;
|
|
612
|
+
expect(this.page.open).to.be.true;
|
|
613
|
+
expect(this.hint.open).to.be.false;
|
|
614
|
+
expect(this.auto.open).to.be.false;
|
|
615
|
+
expect(this.manual.open).to.be.false;
|
|
616
|
+
opened = oneEvent(this.manual, "sp-opened");
|
|
617
|
+
this.manual.open = true;
|
|
618
|
+
await opened;
|
|
619
|
+
expect(this.modal.open).to.be.false;
|
|
620
|
+
expect(this.page.open).to.be.true;
|
|
621
|
+
expect(this.hint.open).to.be.false;
|
|
622
|
+
expect(this.auto.open).to.be.false;
|
|
623
|
+
expect(this.manual.open).to.be.true;
|
|
624
|
+
});
|
|
625
|
+
it('does not close "hint" overlays when opening', async function() {
|
|
626
|
+
let opened = oneEvent(this.hint, "sp-opened");
|
|
627
|
+
this.hint.open = true;
|
|
628
|
+
await opened;
|
|
629
|
+
expect(this.modal.open).to.be.false;
|
|
630
|
+
expect(this.page.open).to.be.false;
|
|
631
|
+
expect(this.hint.open).to.be.true;
|
|
632
|
+
expect(this.auto.open).to.be.false;
|
|
633
|
+
expect(this.manual.open).to.be.false;
|
|
634
|
+
opened = oneEvent(this.manual, "sp-opened");
|
|
635
|
+
this.manual.open = true;
|
|
636
|
+
await opened;
|
|
637
|
+
expect(this.modal.open).to.be.false;
|
|
638
|
+
expect(this.page.open).to.be.false;
|
|
639
|
+
expect(this.hint.open).to.be.true;
|
|
640
|
+
expect(this.auto.open).to.be.false;
|
|
641
|
+
expect(this.manual.open).to.be.true;
|
|
642
|
+
});
|
|
643
|
+
it('does not close "auto" overlays when opening', async function() {
|
|
644
|
+
let opened = oneEvent(this.auto, "sp-opened");
|
|
645
|
+
this.auto.open = true;
|
|
646
|
+
await opened;
|
|
647
|
+
expect(this.modal.open).to.be.false;
|
|
648
|
+
expect(this.page.open).to.be.false;
|
|
649
|
+
expect(this.hint.open).to.be.false;
|
|
650
|
+
expect(this.auto.open).to.be.true;
|
|
651
|
+
expect(this.manual.open).to.be.false;
|
|
652
|
+
opened = oneEvent(this.manual, "sp-opened");
|
|
653
|
+
this.manual.open = true;
|
|
654
|
+
await opened;
|
|
655
|
+
expect(this.modal.open).to.be.false;
|
|
656
|
+
expect(this.page.open).to.be.false;
|
|
657
|
+
expect(this.hint.open).to.be.false;
|
|
658
|
+
expect(this.auto.open).to.be.true;
|
|
659
|
+
expect(this.manual.open).to.be.true;
|
|
660
|
+
});
|
|
727
661
|
});
|
|
728
662
|
});
|
|
729
663
|
});
|