@watermarkinsights/ripple 4.0.0-9 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{chartFunctions-33cb3097.js → chartFunctions-f5ded027.js} +1 -1
- package/dist/cjs/{functions-833ccc83.js → functions-e7db4a26.js} +67 -824
- package/dist/cjs/{global-d57c118b.js → global-b33cf49b.js} +1 -1
- package/dist/cjs/{intl-ab07bd0b.js → intl-9ef93563.js} +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
- package/dist/cjs/priv-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/ripple.cjs.js +3 -3
- package/dist/cjs/wm-action-menu_2.cjs.entry.js +2 -2
- package/dist/cjs/wm-button.cjs.entry.js +1 -1
- package/dist/cjs/wm-chart.cjs.entry.js +4 -4
- package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-file.cjs.entry.js +7 -4
- package/dist/cjs/wm-input.cjs.entry.js +4 -9
- package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
- package/dist/cjs/wm-modal-header.cjs.entry.js +2 -2
- package/dist/cjs/wm-modal.cjs.entry.js +1 -1
- package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +68 -119
- package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
- package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +4 -4
- package/dist/cjs/wm-search.cjs.entry.js +2 -2
- package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +2 -2
- package/dist/cjs/wm-tag-input.cjs.entry.js +521 -617
- package/dist/cjs/wm-tag-option.cjs.entry.js +43 -0
- package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/charts/wm-chart/wm-chart.css +0 -1
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-indicator.css +0 -1
- package/dist/collection/components/charts/wm-progress-monitor/wm-progress-monitor.css +9 -1
- package/dist/collection/components/wm-file/wm-file.js +23 -3
- package/dist/collection/components/wm-file/wm-file.spec.js +83 -34
- package/dist/collection/components/wm-file-list/wm-file-list.spec.js +32 -59
- package/dist/collection/components/wm-input/wm-input.js +1 -8
- package/dist/collection/components/wm-menuitem/wm-menuitem.js +1 -1
- package/dist/collection/components/wm-option/wm-option.css +6 -6
- package/dist/collection/components/wm-option/wm-option.js +47 -3
- package/dist/collection/components/wm-select/wm-select.e2e.js +60 -114
- package/dist/collection/components/wm-select/wm-select.js +80 -141
- package/dist/collection/components/wm-select/wm-select.spec.js +9 -11
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +0 -1
- package/dist/collection/components/wm-tag-input/wm-tag-input.css +19 -22
- package/dist/collection/components/wm-tag-input/wm-tag-input.e2e.js +3 -3
- package/dist/collection/components/wm-tag-input/wm-tag-input.js +597 -726
- package/dist/collection/components/wm-tag-input/wm-tag-option/wm-tag-option.js +241 -0
- package/dist/collection/components/wm-uploader/wm-uploader.e2e.js +26 -47
- package/dist/collection/components/wm-uploader/wm-uploader.js +3 -3
- package/dist/collection/components/wm-uploader/wm-uploader.spec.js +67 -140
- package/dist/collection/global/functions.js +22 -10
- package/dist/collection/global/intl.js +2 -2
- package/dist/collection/lang/lang.spec.js +2 -2
- package/dist/esm/{chartFunctions-36eb2d1a.js → chartFunctions-2a4603c6.js} +1 -1
- package/dist/esm/{functions-061ab506.js → functions-358a1a02.js} +66 -824
- package/dist/esm/{global-509460f7.js → global-ba03a879.js} +1 -1
- package/dist/esm/{intl-d698d52f.js → intl-48057c4d.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-datepicker.entry.js +1 -1
- package/dist/esm/ripple.js +3 -3
- package/dist/esm/wm-action-menu_2.entry.js +2 -2
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +4 -4
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +7 -4
- package/dist/esm/wm-input.entry.js +4 -9
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-header.entry.js +2 -2
- package/dist/esm/wm-modal.entry.js +1 -1
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +68 -119
- package/dist/esm/wm-pagination.entry.js +1 -1
- package/dist/esm/wm-progress-indicator_3.entry.js +4 -4
- package/dist/esm/wm-search.entry.js +2 -2
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-tab-item_3.entry.js +2 -2
- package/dist/esm/wm-tag-input.entry.js +522 -618
- package/dist/esm/wm-tag-option.entry.js +39 -0
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +2 -2
- package/dist/esm-es5/{chartFunctions-36eb2d1a.js → chartFunctions-2a4603c6.js} +1 -1
- package/dist/esm-es5/functions-358a1a02.js +1 -0
- package/dist/esm-es5/global-ba03a879.js +1 -0
- package/dist/esm-es5/{intl-d698d52f.js → intl-48057c4d.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-datepicker.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-header.entry.js +1 -1
- package/dist/esm-es5/wm-modal.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -0
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-3f159fa3.entry.js → p-05ef4092.entry.js} +1 -1
- package/dist/ripple/p-11d629cb.system.entry.js +1 -0
- package/dist/ripple/p-126fbcdb.entry.js +1 -0
- package/dist/ripple/p-12a140e0.system.entry.js +1 -0
- package/dist/ripple/{p-e61e2d7f.entry.js → p-191fafc6.entry.js} +1 -1
- package/dist/ripple/p-1ab62a21.system.entry.js +1 -0
- package/dist/ripple/{p-d8287161.entry.js → p-1e7e2ca4.entry.js} +1 -1
- package/dist/ripple/{p-fef28649.system.entry.js → p-1ee49e28.system.entry.js} +1 -1
- package/dist/ripple/{p-e82eae12.entry.js → p-299bf10c.entry.js} +1 -1
- package/dist/ripple/{p-c20c248a.entry.js → p-2d6bb6d7.entry.js} +1 -1
- package/dist/ripple/{p-a31e736a.entry.js → p-366a9608.entry.js} +1 -1
- package/dist/ripple/p-3a20b1ed.system.entry.js +1 -0
- package/dist/ripple/p-3bb79457.entry.js +1 -0
- package/dist/ripple/{p-1f7a67cc.system.js → p-426fa249.system.js} +1 -1
- package/dist/ripple/p-44d4705c.system.js +1 -0
- package/dist/ripple/p-492dd748.system.entry.js +1 -0
- package/dist/ripple/p-4aa8e2cf.entry.js +1 -0
- package/dist/ripple/{p-ff891d67.js → p-52f5ec85.js} +1 -1
- package/dist/ripple/{p-484d57e1.entry.js → p-546d5c1d.entry.js} +1 -1
- package/dist/ripple/{p-d231aed1.system.entry.js → p-585732f7.system.entry.js} +1 -1
- package/dist/ripple/p-6767b009.system.js +1 -0
- package/dist/ripple/{p-c6ba5d3d.system.entry.js → p-681c9539.system.entry.js} +1 -1
- package/dist/ripple/{p-d2c9264d.entry.js → p-68cade03.entry.js} +1 -1
- package/dist/ripple/{p-260fd686.system.entry.js → p-6c27afee.system.entry.js} +1 -1
- package/dist/ripple/{p-d108107c.entry.js → p-7740db9a.entry.js} +1 -1
- package/dist/ripple/{p-055d1c23.system.entry.js → p-7d005413.system.entry.js} +1 -1
- package/dist/ripple/{p-c9830db6.system.entry.js → p-7e2c2c46.system.entry.js} +1 -1
- package/dist/ripple/p-7fa84884.system.entry.js +1 -0
- package/dist/ripple/{p-9a3d8f0b.system.entry.js → p-8b143e9d.system.entry.js} +1 -1
- package/dist/ripple/{p-0790bfed.entry.js → p-8ea235b6.entry.js} +1 -1
- package/dist/ripple/{p-4eae76a6.entry.js → p-8fadf5dd.entry.js} +1 -1
- package/dist/ripple/{p-8df34bf3.system.entry.js → p-94c65a69.system.entry.js} +1 -1
- package/dist/ripple/{p-3bd6839a.entry.js → p-9690de6c.entry.js} +1 -1
- package/dist/ripple/p-acb0156f.system.entry.js +1 -0
- package/dist/ripple/p-ae7290c2.entry.js +1 -0
- package/dist/ripple/{p-030b527a.js → p-aea9a33a.js} +1 -1
- package/dist/ripple/p-b6e5408c.js +1 -0
- package/dist/ripple/p-b75c0973.system.js +1 -0
- package/dist/ripple/{p-21f73fee.system.entry.js → p-b858d526.system.entry.js} +1 -1
- package/dist/ripple/{p-40b5b7d1.system.entry.js → p-b92c2e16.system.entry.js} +1 -1
- package/dist/ripple/p-be79e95d.entry.js +1 -0
- package/dist/ripple/{p-b623fdc8.entry.js → p-bfff12b4.entry.js} +1 -1
- package/dist/ripple/{p-68d7cf2b.entry.js → p-c028f29c.entry.js} +1 -1
- package/dist/ripple/p-c19ed569.entry.js +1 -0
- package/dist/ripple/{p-f42031f5.system.js → p-c3da681d.system.js} +1 -1
- package/dist/ripple/{p-9b94467e.entry.js → p-c5105455.entry.js} +1 -1
- package/dist/ripple/{p-15457a4b.system.entry.js → p-c86a7f4d.system.entry.js} +1 -1
- package/dist/ripple/{p-b9283910.entry.js → p-db58d96b.entry.js} +1 -1
- package/dist/ripple/p-dd92850a.js +1 -0
- package/dist/ripple/p-e39e6c2b.entry.js +1 -0
- package/dist/ripple/{p-a8ea87d1.system.entry.js → p-ec831e59.system.entry.js} +1 -1
- package/dist/ripple/{p-f1029090.system.entry.js → p-ee51efe0.system.entry.js} +1 -1
- package/dist/ripple/{p-777ced5b.entry.js → p-eec01bbe.entry.js} +1 -1
- package/dist/ripple/{p-5ed1b0a2.system.entry.js → p-f339d590.system.entry.js} +1 -1
- package/dist/ripple/{p-5b593411.system.entry.js → p-f3407959.system.entry.js} +1 -1
- package/dist/ripple/{p-da727af8.system.entry.js → p-f3a374ff.system.entry.js} +1 -1
- package/dist/ripple/{p-867b20a9.system.entry.js → p-f43fda55.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-file/wm-file.d.ts +1 -1
- package/dist/types/components/wm-input/wm-input.d.ts +0 -1
- package/dist/types/components/wm-option/wm-option.d.ts +2 -0
- package/dist/types/components/wm-select/wm-select.d.ts +7 -7
- package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +65 -85
- package/dist/types/components/wm-tag-input/wm-tag-option/wm-tag-option.d.ts +18 -0
- package/dist/types/components/wm-uploader/wm-uploader.d.ts +1 -1
- package/dist/types/components.d.ts +30 -27
- package/dist/types/global/functions.d.ts +2 -1
- package/dist/types/global/intl.d.ts +2 -2
- package/package.json +1 -1
- package/dist/cjs/wm-tag-input-row.cjs.entry.js +0 -23
- package/dist/collection/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.js +0 -122
- package/dist/collection/components/wm-tag-input/wm-tag-input.spec.js +0 -1039
- package/dist/esm/wm-tag-input-row.entry.js +0 -19
- package/dist/esm-es5/functions-061ab506.js +0 -1
- package/dist/esm-es5/global-509460f7.js +0 -1
- package/dist/esm-es5/wm-tag-input-row.entry.js +0 -1
- package/dist/ripple/p-1c3ba701.system.entry.js +0 -1
- package/dist/ripple/p-4a8c95b9.system.entry.js +0 -1
- package/dist/ripple/p-5f2c09f6.entry.js +0 -1
- package/dist/ripple/p-647a4a4a.system.entry.js +0 -1
- package/dist/ripple/p-7011accc.entry.js +0 -1
- package/dist/ripple/p-707383d5.system.js +0 -1
- package/dist/ripple/p-7c2e47bc.system.entry.js +0 -1
- package/dist/ripple/p-839d7e0f.system.js +0 -1
- package/dist/ripple/p-928cc755.system.entry.js +0 -1
- package/dist/ripple/p-9888c825.js +0 -1
- package/dist/ripple/p-a5308115.js +0 -1
- package/dist/ripple/p-b45a2fc3.entry.js +0 -1
- package/dist/ripple/p-b4b57baf.system.entry.js +0 -1
- package/dist/ripple/p-c15f29e5.system.js +0 -1
- package/dist/ripple/p-d38882eb.entry.js +0 -1
- package/dist/ripple/p-d601c5a1.entry.js +0 -1
- package/dist/ripple/p-d68678d2.entry.js +0 -1
- package/dist/ripple/p-e703d9cd.entry.js +0 -1
- package/dist/ripple/p-eb0d569a.system.entry.js +0 -1
- package/dist/types/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.d.ts +0 -11
|
@@ -96,7 +96,7 @@ export class Menuitem {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
render() {
|
|
99
|
-
return (h(Host, { tabindex: -1, role: "menuitem", "aria-disabled": this.disabled ? "true" : null }, h("div", { class: `wrapper ${this.focused && this.isKeying ? "focus" : ""}`, "aria-disabled": this.disabled ? "true" : null }, h("span", { ref: (el) => (this.iconEl = el) }),
|
|
99
|
+
return (h(Host, { tabindex: -1, role: "menuitem", "aria-disabled": this.disabled ? "true" : null }, h("div", { class: `wrapper ${this.focused && this.isKeying ? "focus" : ""}`, "aria-disabled": this.disabled ? "true" : null }, h("span", { ref: (el) => (this.iconEl = el) }), this.el.textContent, this.description ? h("div", { class: "description" }, this.description) : "")));
|
|
100
100
|
}
|
|
101
101
|
static get is() { return "wm-menuitem"; }
|
|
102
102
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,12 +100,7 @@
|
|
|
100
100
|
background: unset;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
:host(.
|
|
104
|
-
:host(.filtered-out) {
|
|
105
|
-
display: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
:host(.duplicate.last) {
|
|
103
|
+
:host(.clone.last) {
|
|
109
104
|
border-bottom: 12px solid;
|
|
110
105
|
border-color: var(--wmcolor-select-option-border);
|
|
111
106
|
}
|
|
@@ -120,6 +115,11 @@
|
|
|
120
115
|
flex: none;
|
|
121
116
|
}
|
|
122
117
|
|
|
118
|
+
:host(.hidden),
|
|
119
|
+
:host(.filtered-out) {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
123
|
.subinfo {
|
|
124
124
|
font-style: italic;
|
|
125
125
|
}
|
|
@@ -69,10 +69,16 @@ export class Option {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
handleSelection() {
|
|
72
|
+
// using ev.detail because ev.target returns the wm-select for clone options
|
|
72
73
|
if (!this.disabled) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
if (this.el.classList.contains("clone")) {
|
|
75
|
+
this.intCloneClicked.emit(this.el); // used to then emit wmOptionSelected from the "real" wm-option
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this.selected
|
|
79
|
+
? this.wmOptionDeselected.emit(this.el)
|
|
80
|
+
: this.wmOptionSelected.emit(this.el);
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
handleBlur(ev) {
|
|
@@ -248,6 +254,44 @@ export class Option {
|
|
|
248
254
|
}
|
|
249
255
|
}
|
|
250
256
|
}
|
|
257
|
+
}, {
|
|
258
|
+
"method": "wmOptionDeselected",
|
|
259
|
+
"name": "wmOptionDeselected",
|
|
260
|
+
"bubbles": true,
|
|
261
|
+
"cancelable": true,
|
|
262
|
+
"composed": true,
|
|
263
|
+
"docs": {
|
|
264
|
+
"tags": [],
|
|
265
|
+
"text": ""
|
|
266
|
+
},
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "HTMLWmOptionElement",
|
|
269
|
+
"resolved": "HTMLWmOptionElement",
|
|
270
|
+
"references": {
|
|
271
|
+
"HTMLWmOptionElement": {
|
|
272
|
+
"location": "global"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}, {
|
|
277
|
+
"method": "intCloneClicked",
|
|
278
|
+
"name": "intCloneClicked",
|
|
279
|
+
"bubbles": true,
|
|
280
|
+
"cancelable": true,
|
|
281
|
+
"composed": true,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": ""
|
|
285
|
+
},
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "HTMLWmOptionElement",
|
|
288
|
+
"resolved": "HTMLWmOptionElement",
|
|
289
|
+
"references": {
|
|
290
|
+
"HTMLWmOptionElement": {
|
|
291
|
+
"location": "global"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
251
295
|
}, {
|
|
252
296
|
"method": "wmKeyUpPressed",
|
|
253
297
|
"name": "wmKeyUpPressed",
|
|
@@ -6,7 +6,7 @@ describe("wm-select", () => {
|
|
|
6
6
|
page = await newE2EPage();
|
|
7
7
|
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
8
8
|
<wm-select id='test' label="Make a selection">
|
|
9
|
-
<wm-option id='first'>First option</wm-option>
|
|
9
|
+
<wm-option id='first' selected>First option</wm-option>
|
|
10
10
|
<wm-option id='second'>Second option</wm-option>
|
|
11
11
|
<wm-option id='third'>Third option</wm-option>
|
|
12
12
|
</wm-select>
|
|
@@ -28,12 +28,7 @@ describe("wm-select", () => {
|
|
|
28
28
|
it("has the right WAI_ARIA roles, states and properties", async () => {
|
|
29
29
|
await createPageHelper();
|
|
30
30
|
const button = await page.find("wm-select >>> button");
|
|
31
|
-
const listbox = await page.find("wm-select >>> #list
|
|
32
|
-
// const first = await page.find("#first");
|
|
33
|
-
/* check aria-haspopup attribute */
|
|
34
|
-
// removed because it seems incompatible with aria-expanded (SR won't announce expanded state when haspopup is present)
|
|
35
|
-
// (tested in Chrome/NVDA)
|
|
36
|
-
// expect(button).toEqualAttribute("aria-haspopup", "listbox");
|
|
31
|
+
const listbox = await page.find("wm-select >>> #list");
|
|
37
32
|
/* check aria-expanded attribute */
|
|
38
33
|
expect(button).toEqualAttribute("aria-expanded", "false");
|
|
39
34
|
/* The listbox has tabindex="-1" */
|
|
@@ -55,22 +50,6 @@ describe("wm-select", () => {
|
|
|
55
50
|
const third = await page.find("#third");
|
|
56
51
|
expect(third).toEqualAttribute("tabIndex", "0"); // third is focused...
|
|
57
52
|
expect(first).toEqualAttribute("aria-selected", true); // ...first is still selected (default)
|
|
58
|
-
await page.keyboard.press("Enter"); // close and select
|
|
59
|
-
await page.waitForChanges();
|
|
60
|
-
expect(third).toEqualAttribute("aria-selected", true);
|
|
61
|
-
await page.waitForTimeout(500); // wait for focus to return to button (there's a timeout because SR issue)
|
|
62
|
-
await page.keyboard.press("Enter"); // re-open popup
|
|
63
|
-
await page.waitForChanges();
|
|
64
|
-
await page.keyboard.press("ArrowDown");
|
|
65
|
-
await page.waitForChanges();
|
|
66
|
-
await page.keyboard.press("ArrowDown");
|
|
67
|
-
await page.waitForChanges();
|
|
68
|
-
expect(button).toEqualAttribute("aria-expanded", "true");
|
|
69
|
-
await page.keyboard.press("Enter"); // close and select
|
|
70
|
-
await page.waitForChanges();
|
|
71
|
-
const selected = await page.find("[aria-selected='true']");
|
|
72
|
-
await page.waitForChanges();
|
|
73
|
-
expect(selected.id).toEqual("second");
|
|
74
53
|
});
|
|
75
54
|
it("switches the dropdown direction", async () => {
|
|
76
55
|
// Viewport is 800 x 600 by default
|
|
@@ -79,13 +58,13 @@ describe("wm-select", () => {
|
|
|
79
58
|
page = await newE2EPage();
|
|
80
59
|
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
81
60
|
<wm-select id='select1' label="Make a selection">
|
|
82
|
-
<wm-option id='first'>First option</wm-option>
|
|
61
|
+
<wm-option id='first' selected>First option</wm-option>
|
|
83
62
|
<wm-option id='second'>Second option</wm-option>
|
|
84
63
|
<wm-option id='third'>Third option</wm-option>
|
|
85
64
|
</wm-select>
|
|
86
65
|
<div style="height: 500px">A big block</div>
|
|
87
66
|
<wm-select id='select2' label="Make a selection">
|
|
88
|
-
<wm-option id='first'>First option</wm-option>
|
|
67
|
+
<wm-option id='first' selected>First option</wm-option>
|
|
89
68
|
<wm-option id='second'>Second option</wm-option>
|
|
90
69
|
<wm-option id='third'>Third option</wm-option>
|
|
91
70
|
</wm-select>
|
|
@@ -137,7 +116,7 @@ describe("wm-select", () => {
|
|
|
137
116
|
/* Up Arrow: Moves focus to the previous option (4). If the listbox is collapsed (5), also expands the list (6). */
|
|
138
117
|
it("handles Up and Down Arrow keys", async () => {
|
|
139
118
|
await createPageHelper();
|
|
140
|
-
const btn = await page.find("wm-select >>> #selectbtn
|
|
119
|
+
const btn = await page.find("wm-select >>> #selectbtn");
|
|
141
120
|
expect(btn.getAttribute("aria-expanded")).toEqual("false"); // 2
|
|
142
121
|
await page.keyboard.press("Tab");
|
|
143
122
|
await page.waitForChanges();
|
|
@@ -163,8 +142,6 @@ describe("wm-select", () => {
|
|
|
163
142
|
await page.waitForChanges();
|
|
164
143
|
await page.keyboard.press("ArrowUp");
|
|
165
144
|
await page.waitForChanges();
|
|
166
|
-
const x = await page.evaluate(() => document.querySelector("[tabindex='0']").id);
|
|
167
|
-
expect(x).toBe("third"); // 4
|
|
168
145
|
expect(btn.getAttribute("aria-expanded")).toEqual("true"); // 6
|
|
169
146
|
});
|
|
170
147
|
/* Home: If the listbox is displayed, moves focus to first option. */
|
|
@@ -205,32 +182,35 @@ describe("wm-select", () => {
|
|
|
205
182
|
expect(focusedEl).toEqualAttribute("tabindex", "0");
|
|
206
183
|
});
|
|
207
184
|
// OPENING / CLOSING POPUP
|
|
208
|
-
|
|
209
|
-
- If the focus is on the button, expands the listbox (1) and places focus on the currently selected option in the list (2).
|
|
210
|
-
- If focus is in the listbox, collapses the listbox (3) and keeps the currently selected option as the button label. (4) */
|
|
211
|
-
it("handles the Enter key", async () => {
|
|
185
|
+
it("Enter key opens and closes the dropdown", async () => {
|
|
212
186
|
await createPageHelper();
|
|
213
187
|
await page.keyboard.press("Tab");
|
|
214
188
|
await page.waitForChanges();
|
|
215
189
|
await page.keyboard.press("Enter");
|
|
216
190
|
await page.waitForChanges();
|
|
217
|
-
const btn = await page.find("wm-select >>> #selectbtn
|
|
191
|
+
const btn = await page.find("wm-select >>> #selectbtn");
|
|
218
192
|
await page.waitForChanges();
|
|
219
|
-
expect(btn.getAttribute("aria-expanded")).toEqual("true");
|
|
193
|
+
expect(btn.getAttribute("aria-expanded")).toEqual("true");
|
|
220
194
|
await page.keyboard.press("ArrowDown");
|
|
221
195
|
await page.waitForChanges();
|
|
222
196
|
await page.keyboard.press("Enter");
|
|
223
197
|
await page.waitForChanges();
|
|
224
|
-
|
|
198
|
+
expect(btn.getAttribute("aria-expanded")).toEqual("false");
|
|
199
|
+
});
|
|
200
|
+
it("Space key opens and closes the dropdown", async () => {
|
|
201
|
+
await createPageHelper();
|
|
202
|
+
await page.keyboard.press("Tab");
|
|
225
203
|
await page.waitForChanges();
|
|
226
|
-
|
|
227
|
-
expect(btntxt.innerText).toEqual("Second option"); // 4
|
|
228
|
-
await page.keyboard.press("Enter");
|
|
204
|
+
await page.keyboard.press("Space");
|
|
229
205
|
await page.waitForChanges();
|
|
230
|
-
|
|
231
|
-
|
|
206
|
+
const btn = await page.find("wm-select >>> #selectbtn");
|
|
207
|
+
await page.waitForChanges();
|
|
208
|
+
expect(btn.getAttribute("aria-expanded")).toEqual("true");
|
|
209
|
+
await page.keyboard.press("ArrowDown");
|
|
210
|
+
await page.waitForChanges();
|
|
211
|
+
await page.keyboard.press("Space");
|
|
232
212
|
await page.waitForChanges();
|
|
233
|
-
expect(
|
|
213
|
+
expect(btn.getAttribute("aria-expanded")).toEqual("false");
|
|
234
214
|
});
|
|
235
215
|
/* Spacebar: Should open the popup (we didn't implement, comes for free. test makes sure we don't break it) */
|
|
236
216
|
it("handles the Spacebar key", async () => {
|
|
@@ -239,7 +219,7 @@ describe("wm-select", () => {
|
|
|
239
219
|
await page.waitForChanges();
|
|
240
220
|
await page.keyboard.press("Space");
|
|
241
221
|
await page.waitForChanges();
|
|
242
|
-
const btn = await page.find("wm-select >>> #selectbtn
|
|
222
|
+
const btn = await page.find("wm-select >>> #selectbtn");
|
|
243
223
|
expect(btn.getAttribute("aria-expanded")).toEqual("true");
|
|
244
224
|
});
|
|
245
225
|
/* Escape: If the listbox is displayed, closes the popup and returns focus to the button. */
|
|
@@ -263,10 +243,34 @@ describe("wm-select", () => {
|
|
|
263
243
|
// Label
|
|
264
244
|
it("creates a label element", async () => {
|
|
265
245
|
await createPageHelper();
|
|
266
|
-
await page.waitForTimeout(500);
|
|
267
246
|
let label = await page.find("wm-select >>> label");
|
|
268
247
|
expect(label.textContent).toBe("Make a selection");
|
|
269
248
|
});
|
|
249
|
+
it("emits the proper events when option is clicked", async () => {
|
|
250
|
+
page = await newE2EPage();
|
|
251
|
+
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
252
|
+
<wm-select multiple label="Make a selection">
|
|
253
|
+
<wm-option id='first'>First option</wm-option>
|
|
254
|
+
</wm-select>
|
|
255
|
+
</main></body></html>`);
|
|
256
|
+
const wmOptionSelectedSpy = await page.spyOnEvent("wmOptionSelected");
|
|
257
|
+
const wmOptionDeselectedSpy = await page.spyOnEvent("wmOptionDeselected");
|
|
258
|
+
// Selection key
|
|
259
|
+
await page.keyboard.press("Tab");
|
|
260
|
+
await page.keyboard.press("Enter");
|
|
261
|
+
await page.waitForChanges(); // allow dropdown to open
|
|
262
|
+
await page.keyboard.press("Space");
|
|
263
|
+
await page.waitForChanges();
|
|
264
|
+
expect(wmOptionSelectedSpy).toHaveReceivedEventTimes(1);
|
|
265
|
+
expect(wmOptionDeselectedSpy).toHaveReceivedEventTimes(0);
|
|
266
|
+
// Deselection
|
|
267
|
+
const optionEl = await page.find("wm-option");
|
|
268
|
+
optionEl.setProperty("selected", true);
|
|
269
|
+
await page.waitForChanges();
|
|
270
|
+
await page.keyboard.press("Space");
|
|
271
|
+
expect(wmOptionSelectedSpy).toHaveReceivedEventTimes(1);
|
|
272
|
+
expect(wmOptionDeselectedSpy).toHaveReceivedEventTimes(1);
|
|
273
|
+
});
|
|
270
274
|
/**************
|
|
271
275
|
* MULTISELECT *
|
|
272
276
|
**************/
|
|
@@ -329,64 +333,6 @@ describe("wm-select", () => {
|
|
|
329
333
|
await page.waitForChanges();
|
|
330
334
|
expect(firstOption).toEqualAttribute("tabindex", "0");
|
|
331
335
|
});
|
|
332
|
-
/* Space: changes the selection state of the focused option */
|
|
333
|
-
it("handles the space key - multiselect", async () => {
|
|
334
|
-
page = await newE2EPage();
|
|
335
|
-
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
336
|
-
<wm-select multiple label="Make a selection">
|
|
337
|
-
<wm-option id='first'>First option</wm-option>
|
|
338
|
-
<wm-option id='second'>Second option</wm-option>
|
|
339
|
-
<wm-option id='third'>Third option</wm-option>
|
|
340
|
-
<wm-option id='fourth'>Fourth option</wm-option>
|
|
341
|
-
<wm-option id='fifth'>Fifth option</wm-option>
|
|
342
|
-
</wm-select>
|
|
343
|
-
</main></body></html>`);
|
|
344
|
-
await page.keyboard.press("Tab");
|
|
345
|
-
await page.waitForChanges();
|
|
346
|
-
await page.keyboard.press("Enter");
|
|
347
|
-
await page.waitForChanges();
|
|
348
|
-
await page.keyboard.press("Space");
|
|
349
|
-
await page.waitForChanges();
|
|
350
|
-
await page.keyboard.press("ArrowDown");
|
|
351
|
-
await page.waitForChanges();
|
|
352
|
-
await page.keyboard.press("Space");
|
|
353
|
-
await page.waitForChanges();
|
|
354
|
-
const firstItem = await page.find("#first");
|
|
355
|
-
const secondItem = await page.find("#second");
|
|
356
|
-
expect(firstItem).toEqualAttribute("aria-selected", "true");
|
|
357
|
-
expect(secondItem).toEqualAttribute("aria-selected", "true");
|
|
358
|
-
const btn = await page.find("wm-select >>> button");
|
|
359
|
-
expect(btn.getAttribute("aria-expanded")).toEqual("true");
|
|
360
|
-
});
|
|
361
|
-
/* Enter Key: Toggles selection of currently focused option, then closes dropdown. */
|
|
362
|
-
it("handles the enter key - multiselect", async () => {
|
|
363
|
-
page = await newE2EPage();
|
|
364
|
-
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
365
|
-
<wm-select multiple label="Make a selection">
|
|
366
|
-
<wm-option id='first'>First option</wm-option>
|
|
367
|
-
<wm-option id='second'>Second option</wm-option>
|
|
368
|
-
<wm-option id='third'>Third option</wm-option>
|
|
369
|
-
<wm-option id='fourth'>Fourth option</wm-option>
|
|
370
|
-
<wm-option id='fifth'>Fifth option</wm-option>
|
|
371
|
-
</wm-select>
|
|
372
|
-
</main></body></html>`);
|
|
373
|
-
await page.keyboard.press("Tab");
|
|
374
|
-
await page.waitForChanges();
|
|
375
|
-
await page.keyboard.press("Enter");
|
|
376
|
-
await page.waitForChanges();
|
|
377
|
-
await page.keyboard.press("Space");
|
|
378
|
-
await page.waitForChanges();
|
|
379
|
-
await page.keyboard.press("ArrowDown");
|
|
380
|
-
await page.waitForChanges();
|
|
381
|
-
await page.keyboard.press("Enter");
|
|
382
|
-
await page.waitForChanges();
|
|
383
|
-
const firstItem = await page.find("#first");
|
|
384
|
-
const secondItem = await page.find("#second");
|
|
385
|
-
expect(firstItem).toEqualAttribute("aria-selected", "true");
|
|
386
|
-
expect(secondItem).toEqualAttribute("aria-selected", "true");
|
|
387
|
-
const btn = await page.find("wm-select >>> button");
|
|
388
|
-
expect(btn.getAttribute("aria-expanded")).toEqual("false");
|
|
389
|
-
});
|
|
390
336
|
it("recognizes when all are selected", async () => {
|
|
391
337
|
page = await newE2EPage();
|
|
392
338
|
await page.setContent(`<html lang='en'><head><title>Page</title></head><body><main><h1>Title</h1>
|
|
@@ -511,15 +457,15 @@ describe("wm-select", () => {
|
|
|
511
457
|
selectAllBtn = await page.find("wm-select >>> .select-all");
|
|
512
458
|
expect(selectAllBtn).toBeNull();
|
|
513
459
|
});
|
|
514
|
-
it("
|
|
515
|
-
|
|
460
|
+
it("emits the proper select all deselect all events", async () => {
|
|
461
|
+
let page = await newE2EPage();
|
|
516
462
|
await page.setContent(`<wm-select multiple select-all id='test' label="make a selection">
|
|
517
463
|
<wm-option id='first'>first option</wm-option>
|
|
518
464
|
<wm-option id='second'>second option</wm-option>
|
|
519
465
|
<wm-option id='third'>third option</wm-option>
|
|
520
466
|
</wm-select>`);
|
|
521
|
-
const
|
|
522
|
-
const
|
|
467
|
+
const wmSelectAllSelectedSpy = await page.spyOnEvent("wmSelectAllSelected");
|
|
468
|
+
const wmSelectAllDeselectedSpy = await page.spyOnEvent("wmSelectAllDeselected");
|
|
523
469
|
await page.keyboard.press("Tab");
|
|
524
470
|
await page.waitForChanges();
|
|
525
471
|
await page.keyboard.press("Enter");
|
|
@@ -528,17 +474,17 @@ describe("wm-select", () => {
|
|
|
528
474
|
await page.waitForChanges();
|
|
529
475
|
await page.keyboard.press("Space");
|
|
530
476
|
await page.waitForChanges();
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
// dropdown stayed open, focus stayed on button.
|
|
537
|
-
// reactivating it should deselect
|
|
477
|
+
expect(wmSelectAllSelectedSpy).toHaveReceivedEventTimes(1);
|
|
478
|
+
expect(wmSelectAllDeselectedSpy).toHaveReceivedEventTimes(0);
|
|
479
|
+
const options = await page.findAll("wm-option");
|
|
480
|
+
options.forEach((option) => option.setProperty("selected", true));
|
|
481
|
+
await page.waitForChanges();
|
|
482
|
+
// // dropdown stayed open, focus stayed on button.
|
|
483
|
+
// // reactivating it should deselect
|
|
538
484
|
await page.keyboard.press("Enter");
|
|
539
485
|
await page.waitForChanges();
|
|
540
|
-
expect(
|
|
541
|
-
expect(
|
|
486
|
+
expect(wmSelectAllSelectedSpy).toHaveReceivedEventTimes(1);
|
|
487
|
+
expect(wmSelectAllDeselectedSpy).toHaveReceivedEventTimes(1);
|
|
542
488
|
});
|
|
543
489
|
xit("handles keyboard motion", async () => {
|
|
544
490
|
const page = await newE2EPage();
|