@watermarkinsights/ripple 5.19.0-alpha.11 → 5.19.0-alpha.14
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/{app-globals-d86fc316.js → app-globals-b7025caf.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-option-list.cjs.entry.js +2 -4
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-file.cjs.entry.js +1 -1
- package/dist/cjs/wm-option_2.cjs.entry.js +94 -137
- package/dist/cjs/wm-uploader.cjs.entry.js +15 -11
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +2 -4
- package/dist/collection/components/selects/wm-select/wm-select.css +16 -18
- package/dist/collection/components/selects/wm-select/wm-select.js +94 -149
- package/dist/collection/components/wm-file/wm-file.css +1 -1
- package/dist/collection/components/wm-uploader/wm-uploader.js +15 -11
- package/dist/collection/dev/uploader.js +4 -4
- package/dist/esm/{app-globals-c069a17b.js → app-globals-edff5d27.js} +1 -1
- package/dist/esm/{chartFunctions-3a54f8ac.js → chartFunctions-613e9c87.js} +1 -1
- package/dist/esm/{functions-669184a6.js → functions-38e392cb.js} +1 -1
- package/dist/esm/{intl-7906e2d7.js → intl-0b8f342e.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +4 -6
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +2 -2
- package/dist/esm/wm-flyout.entry.js +2 -2
- package/dist/esm/wm-input.entry.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +2 -2
- package/dist/esm/wm-modal_3.entry.js +2 -2
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +2 -2
- package/dist/esm/wm-optgroup.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +96 -139
- package/dist/esm/wm-pagination.entry.js +2 -2
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/wm-tag-input.entry.js +2 -2
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +2 -2
- 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 +17 -13
- package/dist/esm-es5/{app-globals-c069a17b.js → app-globals-edff5d27.js} +1 -1
- package/dist/esm-es5/{chartFunctions-3a54f8ac.js → chartFunctions-613e9c87.js} +1 -1
- package/dist/esm-es5/{functions-669184a6.js → functions-38e392cb.js} +1 -1
- package/dist/esm-es5/{intl-7906e2d7.js → intl-0b8f342e.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.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-date-range.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-flyout.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-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.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-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.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 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- 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-6d32911c.system.entry.js → p-00eaa361.system.entry.js} +1 -1
- package/dist/ripple/{p-c85dae6b.entry.js → p-0825151e.entry.js} +1 -1
- package/dist/ripple/{p-c70fa14f.entry.js → p-0bce3f83.entry.js} +1 -1
- package/dist/ripple/{p-69b38da5.entry.js → p-118093e1.entry.js} +1 -1
- package/dist/ripple/{p-1eb2ec31.system.entry.js → p-1de87de8.system.entry.js} +1 -1
- package/dist/ripple/{p-ec9f782e.entry.js → p-26667070.entry.js} +1 -1
- package/dist/ripple/p-2773d645.entry.js +1 -0
- package/dist/ripple/{p-55cdfcb4.system.entry.js → p-2b7259cb.system.entry.js} +1 -1
- package/dist/ripple/{p-ff6b7376.system.entry.js → p-2db6573e.system.entry.js} +1 -1
- package/dist/ripple/{p-6bf103b8.system.entry.js → p-303bf140.system.entry.js} +1 -1
- package/dist/ripple/{p-1efa25b5.system.entry.js → p-3133ce3c.system.entry.js} +1 -1
- package/dist/ripple/{p-9ac6957b.entry.js → p-31bac55d.entry.js} +1 -1
- package/dist/ripple/{p-57f9c7c3.entry.js → p-35d93c19.entry.js} +1 -1
- package/dist/ripple/{p-21c100d8.entry.js → p-39a4934f.entry.js} +1 -1
- package/dist/ripple/p-4006f9ed.entry.js +1 -0
- package/dist/ripple/{p-7a21aa55.entry.js → p-4496888c.entry.js} +1 -1
- package/dist/ripple/{p-c8dfc321.system.entry.js → p-44cc05f6.system.entry.js} +1 -1
- package/dist/ripple/{p-c73882de.system.entry.js → p-4602304a.system.entry.js} +1 -1
- package/dist/ripple/{p-bb364d6b.entry.js → p-4b8f7d1e.entry.js} +1 -1
- package/dist/ripple/{p-b55883ee.entry.js → p-4d0abf7a.entry.js} +1 -1
- package/dist/ripple/{p-26ab5004.system.entry.js → p-5405df80.system.entry.js} +1 -1
- package/dist/ripple/{p-88a7ccee.system.js → p-608971f2.system.js} +1 -1
- package/dist/ripple/{p-6ec4129b.entry.js → p-60e16c79.entry.js} +1 -1
- package/dist/ripple/{p-95f19440.system.js → p-65abcbb4.system.js} +1 -1
- package/dist/ripple/{p-65d3f9c4.system.entry.js → p-667fdcbb.system.entry.js} +1 -1
- package/dist/ripple/{p-68e90b50.system.entry.js → p-6a70dc0b.system.entry.js} +1 -1
- package/dist/ripple/{p-7394f4e9.system.entry.js → p-7134a305.system.entry.js} +1 -1
- package/dist/ripple/p-78e8372a.system.entry.js +1 -0
- package/dist/ripple/{p-047e510d.entry.js → p-7c3bf608.entry.js} +1 -1
- package/dist/ripple/{p-176dcfc0.system.js → p-7edd25f7.system.js} +1 -1
- package/dist/ripple/{p-4175c4b0.system.entry.js → p-830cbcb9.system.entry.js} +1 -1
- package/dist/ripple/{p-ebfa5876.entry.js → p-86a61a2a.entry.js} +1 -1
- package/dist/ripple/{p-009a6e5a.entry.js → p-8e2f3a45.entry.js} +1 -1
- package/dist/ripple/{p-a0ef456d.entry.js → p-8ec6ec53.entry.js} +1 -1
- package/dist/ripple/{p-71cc21a4.entry.js → p-908057b2.entry.js} +1 -1
- package/dist/ripple/{p-dbc3a44d.entry.js → p-9202d9e9.entry.js} +1 -1
- package/dist/ripple/{p-0ae9b6d3.js → p-92c8361f.js} +1 -1
- package/dist/ripple/p-93ad859e.system.js +1 -0
- package/dist/ripple/{p-ad10664f.entry.js → p-957f13fb.entry.js} +1 -1
- package/dist/ripple/{p-1ad6c15b.entry.js → p-9609d8e7.entry.js} +1 -1
- package/dist/ripple/{p-3c9972a6.system.entry.js → p-960d2cf0.system.entry.js} +1 -1
- package/dist/ripple/{p-22d4c7e0.system.entry.js → p-96f86eb4.system.entry.js} +1 -1
- package/dist/ripple/{p-350f9314.system.entry.js → p-98445d43.system.entry.js} +1 -1
- package/dist/ripple/{p-561d1898.system.entry.js → p-9ba75821.system.entry.js} +1 -1
- package/dist/ripple/{p-ea10c498.entry.js → p-9e89655f.entry.js} +1 -1
- package/dist/ripple/{p-f8fd7172.system.entry.js → p-a14dee02.system.entry.js} +1 -1
- package/dist/ripple/{p-95ce8c39.entry.js → p-a593d847.entry.js} +1 -1
- package/dist/ripple/{p-222624ae.entry.js → p-a5c5c64c.entry.js} +1 -1
- package/dist/ripple/{p-dfa30c3d.entry.js → p-a7cde3fc.entry.js} +1 -1
- package/dist/ripple/{p-acb4d87c.system.entry.js → p-abcdd7be.system.entry.js} +1 -1
- package/dist/ripple/{p-6a40014e.system.entry.js → p-b1fb99e4.system.entry.js} +1 -1
- package/dist/ripple/{p-91669f66.js → p-b511ebfd.js} +1 -1
- package/dist/ripple/{p-b40454d2.entry.js → p-bc7e26c4.entry.js} +1 -1
- package/dist/ripple/{p-138491c8.system.entry.js → p-c5ec6fa0.system.entry.js} +1 -1
- package/dist/ripple/{p-c0f4f1ea.system.entry.js → p-c7f3ef7f.system.entry.js} +1 -1
- package/dist/ripple/{p-8e694216.entry.js → p-d5f154f8.entry.js} +1 -1
- package/dist/ripple/{p-a6f4dd01.system.entry.js → p-d746b9c2.system.entry.js} +1 -1
- package/dist/ripple/{p-1806e50b.js → p-d815809f.js} +1 -1
- package/dist/ripple/{p-f3539bb3.js → p-dd56e6b5.js} +1 -1
- package/dist/ripple/{p-fb61a10e.system.entry.js → p-e5c34af5.system.entry.js} +1 -1
- package/dist/ripple/{p-e1a15515.system.entry.js → p-e660d0b8.system.entry.js} +1 -1
- package/dist/ripple/{p-66489ded.entry.js → p-ecd1c2ba.entry.js} +1 -1
- package/dist/ripple/{p-69ba61b7.entry.js → p-edb265f7.entry.js} +1 -1
- package/dist/ripple/{p-1e37706b.system.js → p-ee1bb3a1.system.js} +1 -1
- package/dist/ripple/{p-d32a9831.system.entry.js → p-f1a193f0.system.entry.js} +1 -1
- package/dist/ripple/{p-5bf2eb50.system.entry.js → p-f4390a0a.system.entry.js} +1 -1
- package/dist/ripple/{p-ae2520e4.entry.js → p-f91fc18d.entry.js} +1 -1
- package/dist/ripple/{p-1841c319.system.entry.js → p-f9bbb123.system.entry.js} +1 -1
- package/dist/ripple/{p-25c17efe.system.entry.js → p-fbad04d7.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/selects/wm-select/wm-select.d.ts +8 -14
- package/package.json +2 -2
- package/dist/ripple/p-02a15884.entry.js +0 -1
- package/dist/ripple/p-1d209974.system.js +0 -1
- package/dist/ripple/p-6238044b.system.entry.js +0 -1
- package/dist/ripple/p-7180e24a.entry.js +0 -1
|
@@ -173,24 +173,28 @@ const Uploader = class {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
handleProgressUpdate(mutationRecord) {
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
const uploadCount = this.inProgressFileEls.length;
|
|
177
|
+
if (uploadCount !== 0) {
|
|
178
|
+
const changeInUploadingFiles = this.prevUploadCount !== uploadCount;
|
|
178
179
|
changeInUploadingFiles &&
|
|
179
|
-
this.announce(intl.uploaderMessages.getFilesUploading(
|
|
180
|
-
this.notif = intl.uploaderMessages.getFilesUploading(
|
|
181
|
-
this.prevUploadCount =
|
|
180
|
+
this.announce(intl.uploaderMessages.getFilesUploading(uploadCount), this.assertiveLiveRegionEl);
|
|
181
|
+
this.notif = intl.uploaderMessages.getFilesUploading(uploadCount);
|
|
182
|
+
this.prevUploadCount = uploadCount;
|
|
183
|
+
if (this.batchCount < uploadCount) {
|
|
184
|
+
this.batchCount = uploadCount;
|
|
185
|
+
}
|
|
182
186
|
if (!this.srProgress) {
|
|
183
187
|
this.srProgress = setInterval(() => {
|
|
184
188
|
const aggregate = this.fileEls.reduce((avg, item) => (item.progress ? avg + item.progress : avg), 0);
|
|
185
|
-
this.
|
|
189
|
+
const percentage = this.batchCount > 0 ? Math.floor(aggregate / this.batchCount) : 0;
|
|
190
|
+
this.announce(intl.uploaderMessages.getUploadProgress(percentage), this.assertiveLiveRegionEl);
|
|
186
191
|
}, 5000);
|
|
187
192
|
}
|
|
188
193
|
}
|
|
189
|
-
else if (
|
|
190
|
-
mutationRecord.oldValue &&
|
|
191
|
-
parseInt(mutationRecord.oldValue) < 100) {
|
|
194
|
+
else if (uploadCount === 0 && mutationRecord.oldValue && parseInt(mutationRecord.oldValue) < 100) {
|
|
192
195
|
// if final file progress completes
|
|
193
196
|
this.uploadButtonEl.value = "";
|
|
197
|
+
this.batchCount = 0;
|
|
194
198
|
this.notif = intl.uploaderMessages.finishedUploading;
|
|
195
199
|
this.announce(intl.uploaderMessages.finishedUploading, this.assertiveLiveRegionEl);
|
|
196
200
|
clearInterval(this.srProgress);
|
|
@@ -319,9 +323,9 @@ const Uploader = class {
|
|
|
319
323
|
return (index.h("div", { class: `drop-area -${this.dropArea}`, ref: (el) => (this.dropAreaEl = el), onDragEnter: (ev) => this.handleDragEnter(ev), onDragOver: (ev) => this.handleDragOver(ev), onDragLeave: (ev) => this.handleDragLeave(ev), onDrop: (ev) => this.handleDrop(ev) }, this.dropArea == "page" && (index.h("div", { ref: (el) => (this.dropOverlayEl = el), class: "drop-overlay", popover: "manual" }, index.h("span", { class: "upload-arrow" }), index.h("span", null, "Drop to Upload")))));
|
|
320
324
|
}
|
|
321
325
|
render() {
|
|
322
|
-
return (index.h(index.Host, { key: '
|
|
326
|
+
return (index.h(index.Host, { key: '99be303c7fdecf7fed30bb597f312c792ab0dbd5', class: `-${this.dropArea}` }, this.uploaderType == "drop" && this.renderDropArea(), this.label && this.renderLabel(), this.renderHeader(), this.renderListContainer(), index.h("div", { key: 'd4fd6720967d4a5eed7b9d0231a5fe8203ed98b8', ref: (el) => (this.assertiveLiveRegionEl = el), class: "live-region sr-only", "aria-live": "assertive" // since it's directly linked to the action the user took, it should be read in priority. With polite, some messages get dismissed in favor of the page title
|
|
323
327
|
,
|
|
324
|
-
"aria-atomic": "true" }), index.h("div", { key: '
|
|
328
|
+
"aria-atomic": "true" }), index.h("div", { key: '06cfeee56f1cb84a616324cbc8d736e79bf1f258', ref: (el) => (this.politeLiveRegionEl = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" })));
|
|
325
329
|
}
|
|
326
330
|
static get delegatesFocus() { return true; }
|
|
327
331
|
get el() { return index.getElement(this); }
|
|
@@ -349,9 +349,7 @@ export class PrivOptionList {
|
|
|
349
349
|
: selectMessages.optgroupSingleSelectionCount())))));
|
|
350
350
|
}
|
|
351
351
|
renderSearchField() {
|
|
352
|
-
return (h("div", { class: "search" }, h("div", { class: "searchfield-wrapper", ref: (el) => (this.searchFieldWrapperEl = el) }, h("div", { class: "svg-icon svg-search" }), h("input", { ref: (el) => (this.searchFieldEl = el), class: "searchfield", role: "combobox", "aria-controls": "list",
|
|
353
|
-
// aria-expanded={this.isExpanded ? "true" : "false"}
|
|
354
|
-
onKeyDown: (ev) => this.handleKeyDown(ev), onFocus: () => this.searchFieldWrapperEl.classList.add("focus"), onBlur: (ev) => this.handleSearchFieldBlur(ev), onInput: () => this.debouncedSearch(), placeholder: this.searchPlaceholder }))));
|
|
352
|
+
return (h("div", { class: "search" }, h("div", { class: "searchfield-wrapper", ref: (el) => (this.searchFieldWrapperEl = el) }, h("div", { class: "svg-icon svg-search" }), h("input", { ref: (el) => (this.searchFieldEl = el), class: "searchfield", role: "combobox", "aria-controls": "list", onKeyDown: (ev) => this.handleKeyDown(ev), onFocus: () => this.searchFieldWrapperEl.classList.add("focus"), onBlur: (ev) => this.handleSearchFieldBlur(ev), onInput: () => this.debouncedSearch(), placeholder: this.searchPlaceholder }))));
|
|
355
353
|
}
|
|
356
354
|
renderSearchFailedMessage() {
|
|
357
355
|
return h("div", { class: "search-results-message" }, selectMessages.noSearchResults);
|
|
@@ -369,7 +367,7 @@ export class PrivOptionList {
|
|
|
369
367
|
return (h("div", { class: "non-options-wrapper" }, this.isInNestedSelect && this.renderReturnBtn(), this.search && this.renderSearchField(), this.visibleSelectAllButton && this.renderSelectAllButton()));
|
|
370
368
|
}
|
|
371
369
|
render() {
|
|
372
|
-
return (h("div", { key: '
|
|
370
|
+
return (h("div", { key: '9f19650526738eefcf2e2de58b812d9d0d3a21af', class: "list-wrapper" }, (this.isInNestedSelect || this.search || this.visibleSelectAllButton) && this.renderNonOptions(), h("div", { key: '381b60f8cb2dc58f7c268e75e6d0e78879393f0d', id: "list", class: "options-wrapper", tabindex: -1, role: "listbox", "aria-multiselectable": this.multiple ? "true" : null, "aria-labelledby": "label", ref: (el) => (this.listboxEl = el), style: { "--max-height": this.effectiveMaxHeight } }, this.searchTerm && this.filteredOptions.length === 0 && this.renderSearchFailedMessage(), this.multiple && this.renderCloneOptions(), h("slot", { key: '6a99161cdb2d3c4b6b1bfbe9b4af333daa4704de' })), h("div", { key: '8cee667df6aa79c7db5511858a73f68e911cc566', id: "optionlist-announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)));
|
|
373
371
|
}
|
|
374
372
|
static get is() { return "priv-option-list"; }
|
|
375
373
|
static get originalStyleUrls() {
|
|
@@ -878,8 +878,7 @@
|
|
|
878
878
|
--wmcolor-select-selectall-border: var(--wmcolor-select-option-border);
|
|
879
879
|
--wmcolor-select-selectall-text: var(--wmcolor-interactive);
|
|
880
880
|
--wmcolor-select-text: var(--wmcolor-interactive);
|
|
881
|
-
--
|
|
882
|
-
--offset-y: 0px;
|
|
881
|
+
--button-width: auto;
|
|
883
882
|
position: relative;
|
|
884
883
|
display: block;
|
|
885
884
|
box-sizing: border-box;
|
|
@@ -985,6 +984,7 @@
|
|
|
985
984
|
min-width: 8.75rem;
|
|
986
985
|
}
|
|
987
986
|
.wrapper .button-wrapper .displayedoption {
|
|
987
|
+
anchor-name: --select-button;
|
|
988
988
|
-webkit-border-radius: 3px;
|
|
989
989
|
-moz-border-radius: 3px;
|
|
990
990
|
-ms-border-radius: 3px;
|
|
@@ -1103,19 +1103,15 @@
|
|
|
1103
1103
|
-webkit-transform: scale(1, 1);
|
|
1104
1104
|
-moz-transform: scale(1, 1);
|
|
1105
1105
|
transform: scale(1, 1);
|
|
1106
|
+
position: absolute;
|
|
1107
|
+
position-anchor: --select-button;
|
|
1106
1108
|
margin: 0;
|
|
1109
|
+
padding: 0;
|
|
1107
1110
|
width: unset;
|
|
1108
1111
|
top: anchor(bottom);
|
|
1109
1112
|
left: anchor(left);
|
|
1110
1113
|
right: anchor(right);
|
|
1111
|
-
|
|
1112
|
-
.wrapper .button-wrapper > .dropdown:popover-open.upwards {
|
|
1113
|
-
top: unset;
|
|
1114
|
-
bottom: anchor(top);
|
|
1115
|
-
-ms-transform-origin: center bottom;
|
|
1116
|
-
-webkit-transform-origin: center bottom;
|
|
1117
|
-
-moz-transform-origin: center bottom;
|
|
1118
|
-
transform-origin: center bottom;
|
|
1114
|
+
position-try-fallbacks: --try-top;
|
|
1119
1115
|
}
|
|
1120
1116
|
.wrapper.invalid .button-wrapper .displayedoption {
|
|
1121
1117
|
-webkit-box-shadow: 0 0 0 1px var(--wmcolor-border-error);
|
|
@@ -1164,16 +1160,18 @@
|
|
|
1164
1160
|
left: 0.5625rem;
|
|
1165
1161
|
}
|
|
1166
1162
|
|
|
1163
|
+
@position-try --try-top {
|
|
1164
|
+
top: unset;
|
|
1165
|
+
bottom: anchor(top);
|
|
1166
|
+
-ms-transform-origin: center bottom;
|
|
1167
|
+
-webkit-transform-origin: center bottom;
|
|
1168
|
+
-moz-transform-origin: center bottom;
|
|
1169
|
+
transform-origin: center bottom;
|
|
1170
|
+
}
|
|
1167
1171
|
@supports not (top: anchor(bottom)) {
|
|
1168
|
-
|
|
1169
|
-
position: relative;
|
|
1170
|
-
}
|
|
1171
|
-
:host .button-wrapper {
|
|
1172
|
-
position: unset;
|
|
1173
|
-
}
|
|
1174
|
-
:host .button-wrapper .dropdown {
|
|
1172
|
+
.dropdown {
|
|
1175
1173
|
z-index: 30;
|
|
1176
1174
|
inset: auto;
|
|
1177
|
-
|
|
1175
|
+
width: var(--button-width, auto) !important;
|
|
1178
1176
|
}
|
|
1179
1177
|
}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { forceUpdate } from "@stencil/core";
|
|
3
|
-
import { getTextDir,
|
|
3
|
+
import { getTextDir, toBool, handleDisabledAttribute, showTooltip, hideTooltip, debounce, } from "../../../global/functions";
|
|
4
4
|
import { globalMessages, selectMessages } from "../../../global/intl";
|
|
5
5
|
export class Select {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.
|
|
8
|
-
this.openUp = false;
|
|
7
|
+
this.returnFocus = false;
|
|
9
8
|
//////////////////////////////////////
|
|
10
9
|
// for multiselect button text
|
|
11
10
|
this.overflowCount = 0;
|
|
12
11
|
this.displayedOptions = [];
|
|
13
|
-
this.
|
|
14
|
-
const { x, y } = getCumulativeScrollOffset(this.el);
|
|
15
|
-
this.el.style.setProperty("--offset-x", "-" + x + "px");
|
|
16
|
-
this.el.style.setProperty("--offset-y", "-" + y + "px");
|
|
17
|
-
this.isHidden = false;
|
|
18
|
-
}, 100);
|
|
12
|
+
this.previousDisplayedOptions = [];
|
|
19
13
|
this.debouncedResize = debounce(() => {
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
// Set the dropdown width to match the button width
|
|
15
|
+
const buttonWidth = this.buttonEl.getBoundingClientRect().width;
|
|
16
|
+
this.el.style.setProperty("--button-width", buttonWidth + "px");
|
|
17
|
+
}, 10);
|
|
22
18
|
this.disabled = false;
|
|
23
19
|
this.maxHeight = "200px";
|
|
24
20
|
this.label = undefined;
|
|
@@ -31,15 +27,12 @@ export class Select {
|
|
|
31
27
|
this.placeholder = selectMessages.multiPlaceholder;
|
|
32
28
|
this.searchPlaceholder = selectMessages.searchPlaceholder;
|
|
33
29
|
this.allSelectedMessage = selectMessages.allSelected;
|
|
34
|
-
this.
|
|
30
|
+
this.isExpanded = false;
|
|
35
31
|
this.announcement = "";
|
|
36
32
|
}
|
|
37
33
|
get childOptions() {
|
|
38
34
|
return Array.from(this.el.querySelectorAll("wm-option"));
|
|
39
35
|
}
|
|
40
|
-
get isExpanded() {
|
|
41
|
-
return this.dropdownEl && this.dropdownEl.matches(":popover-open");
|
|
42
|
-
}
|
|
43
36
|
get isDisabled() {
|
|
44
37
|
// string "false" needs to be treated as bool False because react wrappers convert bool to string.
|
|
45
38
|
return toBool(this.disabled);
|
|
@@ -53,53 +46,79 @@ export class Select {
|
|
|
53
46
|
//////////////////////////////////////
|
|
54
47
|
handleOptionSelection() {
|
|
55
48
|
if (!this.multiple) {
|
|
56
|
-
this.
|
|
49
|
+
this.returnFocus = true;
|
|
50
|
+
this.dropdownEl.hidePopover();
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
handleChildEnter() {
|
|
60
54
|
// only occurs for multiselects. handle the click, then close
|
|
61
|
-
this.
|
|
55
|
+
this.returnFocus = true;
|
|
56
|
+
this.dropdownEl.hidePopover();
|
|
62
57
|
}
|
|
63
|
-
|
|
64
|
-
this.
|
|
58
|
+
closeDropdownOnEscape() {
|
|
59
|
+
this.returnFocus = true;
|
|
60
|
+
this.dropdownEl.hidePopover();
|
|
65
61
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// keeps our component's blur events accurate, and closes when focusing browser address bar
|
|
69
|
-
if (!isElOrChild(this.el, ev.detail.relatedTarget)) {
|
|
70
|
-
const event = new CustomEvent("blur");
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
event.relatedTarget = ev.detail.relatedTarget;
|
|
73
|
-
this.el.dispatchEvent(event);
|
|
74
|
-
}
|
|
62
|
+
handleToggle(ev) {
|
|
63
|
+
ev.newState === "open" ? this.open() : this.close();
|
|
75
64
|
}
|
|
76
|
-
|
|
77
|
-
if (!
|
|
78
|
-
this.
|
|
65
|
+
open() {
|
|
66
|
+
if (!this.isDisabled) {
|
|
67
|
+
this.isExpanded = true;
|
|
68
|
+
// polyfill for browsers without anchor() support (FF)
|
|
69
|
+
if (!CSS.supports("top", "anchor(bottom)")) {
|
|
70
|
+
// Set the dropdown width to match the button width
|
|
71
|
+
const buttonWidth = this.buttonEl.getBoundingClientRect().width;
|
|
72
|
+
this.el.style.setProperty("--button-width", buttonWidth + "px");
|
|
73
|
+
}
|
|
74
|
+
window.requestAnimationFrame(() => {
|
|
75
|
+
this.optionListEl.handleInitialFocus(this.elToFocus);
|
|
76
|
+
this.elToFocus = undefined;
|
|
77
|
+
});
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
close() {
|
|
81
|
+
if (this.isExpanded) {
|
|
82
|
+
this.isExpanded = false;
|
|
83
|
+
this.optionListEl.unfocusAll();
|
|
84
|
+
window.setTimeout(() => {
|
|
85
|
+
if (this.optionListEl.multiple) {
|
|
86
|
+
this.optionListEl.updateOptionVisibility();
|
|
87
|
+
}
|
|
88
|
+
// clear search field, reset filtered / bolded state of wm-options
|
|
89
|
+
if (this.search) {
|
|
90
|
+
this.optionListEl.clearSearch();
|
|
91
|
+
}
|
|
92
|
+
}, 150);
|
|
93
|
+
if (this.returnFocus) {
|
|
94
|
+
requestAnimationFrame(() => {
|
|
95
|
+
this.buttonEl.focus();
|
|
96
|
+
this.returnFocus = false;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
85
99
|
}
|
|
86
100
|
}
|
|
87
101
|
handleKey(ev) {
|
|
88
102
|
switch (ev.key) {
|
|
89
103
|
case "Tab":
|
|
90
104
|
// if tabbing backwards, close and return focus to button. Otherwise, close but do not redirect focus.
|
|
91
|
-
this.
|
|
105
|
+
if (this.isExpanded && ev.shiftKey) {
|
|
106
|
+
this.returnFocus = true;
|
|
107
|
+
}
|
|
108
|
+
this.dropdownEl.hidePopover();
|
|
92
109
|
break;
|
|
93
110
|
case "ArrowDown":
|
|
94
111
|
if (this.isExpanded === false) {
|
|
95
112
|
ev.preventDefault();
|
|
96
|
-
this.
|
|
113
|
+
this.elToFocus = "next";
|
|
114
|
+
this.dropdownEl.showPopover();
|
|
97
115
|
}
|
|
98
116
|
break;
|
|
99
117
|
case "ArrowUp":
|
|
100
118
|
if (this.isExpanded === false) {
|
|
101
119
|
ev.preventDefault();
|
|
102
|
-
this.
|
|
120
|
+
this.elToFocus = "previous";
|
|
121
|
+
this.dropdownEl.showPopover();
|
|
103
122
|
}
|
|
104
123
|
break;
|
|
105
124
|
}
|
|
@@ -126,8 +145,6 @@ export class Select {
|
|
|
126
145
|
});
|
|
127
146
|
}
|
|
128
147
|
handleChildChange() {
|
|
129
|
-
// on update of children or children selected state, reset button text and rerender
|
|
130
|
-
this.setButtonText();
|
|
131
148
|
forceUpdate(this.el);
|
|
132
149
|
if (this.multiple) {
|
|
133
150
|
// update state of clone options
|
|
@@ -136,58 +153,6 @@ export class Select {
|
|
|
136
153
|
}
|
|
137
154
|
componentDidLoad() {
|
|
138
155
|
this.wmSelectDidLoad.emit();
|
|
139
|
-
this.setButtonText();
|
|
140
|
-
if (!CSS.supports("top", "anchor(bottom)")) {
|
|
141
|
-
this.scrollableParents = findAllScrollableParents(this.el);
|
|
142
|
-
// Add scroll listeners to all scrollable parents
|
|
143
|
-
this.scrollableParents.forEach((parent) => {
|
|
144
|
-
if (parent === document.documentElement) {
|
|
145
|
-
// For document element, listen to window scroll event
|
|
146
|
-
window.addEventListener("scroll", () => this.handleScroll());
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
// For regular elements, listen to their scroll event
|
|
150
|
-
parent.addEventListener("scroll", () => this.handleScroll());
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
open(optionToSelect) {
|
|
156
|
-
if (!this.isDisabled) {
|
|
157
|
-
this.openUp = shouldOpenUp(this.el, this.dropdownEl.clientHeight, this.labelEl.clientHeight);
|
|
158
|
-
// handling scroll offset for older browsers (currently FF and Safari)
|
|
159
|
-
if (!CSS.supports("top", "anchor(bottom)")) {
|
|
160
|
-
const { x, y } = getCumulativeScrollOffset(this.buttonEl);
|
|
161
|
-
this.el.style.setProperty("--offset-x", "-" + x + "px");
|
|
162
|
-
this.el.style.setProperty("--offset-y", "-" + y + "px");
|
|
163
|
-
}
|
|
164
|
-
this.isHidden = false;
|
|
165
|
-
window.requestAnimationFrame(() => {
|
|
166
|
-
this.optionListEl.handleInitialFocus(optionToSelect);
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
close(returnFocus = true) {
|
|
171
|
-
if (this.isExpanded) {
|
|
172
|
-
this.optionListEl.unfocusAll();
|
|
173
|
-
window.setTimeout(() => {
|
|
174
|
-
this.isHidden = true;
|
|
175
|
-
if (this.optionListEl.multiple) {
|
|
176
|
-
this.optionListEl.updateOptionVisibility();
|
|
177
|
-
}
|
|
178
|
-
// clear search field, reset filtered / bolded state of wm-options
|
|
179
|
-
if (this.search) {
|
|
180
|
-
this.optionListEl.clearSearch();
|
|
181
|
-
}
|
|
182
|
-
// Returns focus to button after popup closes (no need if user is tabbing)
|
|
183
|
-
// Delay is necessary for screenreader to get new expanded state before focus
|
|
184
|
-
// window.requestAnimationFrame is probably enough, but since we are already using setTimeout it may as well be here
|
|
185
|
-
// also UX wise, it makes sense for the button to only be focused after the animation is complete
|
|
186
|
-
if (returnFocus) {
|
|
187
|
-
this.buttonEl.focus();
|
|
188
|
-
}
|
|
189
|
-
}, 150);
|
|
190
|
-
}
|
|
191
156
|
}
|
|
192
157
|
announceError() {
|
|
193
158
|
if (this.errorMessage) {
|
|
@@ -200,7 +165,6 @@ export class Select {
|
|
|
200
165
|
handleComponentBlur(ev) {
|
|
201
166
|
// Do not close or emit custom blur event when blurring to an element inside (wm-option)
|
|
202
167
|
if (!this.el.contains(ev.relatedTarget)) {
|
|
203
|
-
this.close(false);
|
|
204
168
|
this.wmSelectBlurred.emit();
|
|
205
169
|
}
|
|
206
170
|
}
|
|
@@ -210,35 +174,6 @@ export class Select {
|
|
|
210
174
|
showTooltip("right", ev.target, this.label);
|
|
211
175
|
}
|
|
212
176
|
}
|
|
213
|
-
handleScroll() {
|
|
214
|
-
if (this.isExpanded) {
|
|
215
|
-
if (!this.isHidden)
|
|
216
|
-
this.isHidden = true;
|
|
217
|
-
this.debouncedReveal();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
setButtonText() {
|
|
221
|
-
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
222
|
-
// handle overflow + counter for multiselect
|
|
223
|
-
if (this.multiple) {
|
|
224
|
-
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
225
|
-
const overflowCounterWidth = 38;
|
|
226
|
-
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
227
|
-
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
228
|
-
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
229
|
-
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
230
|
-
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
231
|
-
this.overflowCount = 0;
|
|
232
|
-
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
233
|
-
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
234
|
-
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
235
|
-
this.overflowCount++;
|
|
236
|
-
this.displayedOptions.pop();
|
|
237
|
-
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
238
|
-
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
177
|
announce(message) {
|
|
243
178
|
// \u00A0 is a non-breaking space character, which causes the message to be read as a new one
|
|
244
179
|
if (this.liveRegionEl.textContent === message) {
|
|
@@ -247,6 +182,7 @@ export class Select {
|
|
|
247
182
|
this.announcement = message;
|
|
248
183
|
}
|
|
249
184
|
renderButtonText() {
|
|
185
|
+
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
250
186
|
if (this.multiple && this.displayedOptions.length < 1) {
|
|
251
187
|
return h("span", null, this.placeholder);
|
|
252
188
|
}
|
|
@@ -254,6 +190,28 @@ export class Select {
|
|
|
254
190
|
return this.allSelectedMessage;
|
|
255
191
|
}
|
|
256
192
|
else {
|
|
193
|
+
// handle overflow + counter for multiselect
|
|
194
|
+
// only bother if things have changed
|
|
195
|
+
const hasChanged = this.displayedOptions !== this.previousDisplayedOptions;
|
|
196
|
+
if (this.multiple && hasChanged) {
|
|
197
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
198
|
+
const overflowCounterWidth = 38;
|
|
199
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
200
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
201
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
202
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
203
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
204
|
+
this.overflowCount = 0;
|
|
205
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
206
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
207
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
208
|
+
this.overflowCount++;
|
|
209
|
+
this.displayedOptions.pop();
|
|
210
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
211
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
212
|
+
}
|
|
213
|
+
this.previousDisplayedOptions = this.displayedOptions;
|
|
214
|
+
}
|
|
257
215
|
return this.displayedOptions.map((x, idx) => (h("span", null, idx > 0 ? ", " : "", x.textContent)));
|
|
258
216
|
}
|
|
259
217
|
}
|
|
@@ -264,20 +222,19 @@ export class Select {
|
|
|
264
222
|
}
|
|
265
223
|
render() {
|
|
266
224
|
const showSubinfo = !this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo;
|
|
267
|
-
|
|
268
|
-
id: "selectbtn",
|
|
269
|
-
["disabled"]: this.isDisabled,
|
|
270
|
-
["aria-controls"]: "list",
|
|
271
|
-
["aria-labelledby"]: "label selectbtn",
|
|
272
|
-
["aria-describedby"]: "error",
|
|
273
|
-
["aria-expanded"]: this.isExpanded ? "true" : "false",
|
|
274
|
-
["popovertarget"]: "dropdown",
|
|
275
|
-
["popovertargetaction"]: "toggle",
|
|
276
|
-
onClick: () => (this.isExpanded ? this.close() : this.open()),
|
|
277
|
-
};
|
|
278
|
-
return (h(Host, { key: '330408045b96bb9d56e5998d50706e74b2b094a7', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '82b457ba9b22107a26359d5f7f63c56333f33e46', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '9cfa0597409bd864b747b89ac2b843de0b085ca7', ref: (el) => (this.labelEl = el), class: "label-wrapper" }, h("label", { key: '7d0c9f4a985b6ab59a239d0cafa69d932125b91b', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
|
|
225
|
+
return (h(Host, { key: '21d95492d43ab9d1069bf1742d93071df9985dfe', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'eb131f027fcc63a0d7196f647ad6f8952bbc13de', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '41ce7e3027abf28c20927a3f4ad0efa2f8d79ffb', class: "label-wrapper" }, h("label", { key: 'deabf9ba353e261bb1f3d7dbf87be2ddd5d805f2', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
|
|
279
226
|
// we can't use aria-required because the listbox is in a sub-component and it is not announced
|
|
280
|
-
this.requiredField && (h("span", { key: '
|
|
227
|
+
this.requiredField && (h("span", { key: '44ee2795454f9f3bee95ecc4f260b9d56527a108', class: "required" }, h("span", { key: 'defe21df63827aac177d52074e1242c32e98bcb3', class: "sr-only" }, globalMessages.requiredField), h("span", { key: 'a10f31be028d79e347d38b6226e64d11e67bcee4', "aria-hidden": "true" }, "*")))), h("div", { key: 'a7910f2d9180bb148b71ff30d91a4b32814720ab', class: "button-wrapper" }, h("button", { key: 'e346214e6aa3087126f48e831a1f4cf8ad47b374', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, h("span", { key: '6774b180ebc5831316af4364e82b09811a040681', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: '70e0cc7710e6ca4eac93025dfc8c7c5241f5483d', class: "button-text" }, this.renderButtonText()), showSubinfo && h("span", { key: '451817c953223b0443999e1414808d430a1cfd7a', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: '86db46ffc2455ec67a5a70f9a4e7a88541487473', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: '150324e049b4f37405c13b866edb6a09d13866b5', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: 'e0aeb5622be16c1bc89c03b10eb0c9bc71e6321c', class: "dropdown", id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el),
|
|
228
|
+
// @ts-ignore -- don't tell typescript but we're in the future
|
|
229
|
+
onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: '79f20c45531d18790a8527694fda90f26f84c4e6', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
|
|
230
|
+
this.dropdownEl.hidePopover();
|
|
231
|
+
}, onOptionListAllSelected: () => {
|
|
232
|
+
this.returnFocus = true;
|
|
233
|
+
this.wmSelectAllSelected.emit();
|
|
234
|
+
}, onOptionListAllDeselected: () => {
|
|
235
|
+
this.returnFocus = true;
|
|
236
|
+
this.wmSelectAllDeselected.emit();
|
|
237
|
+
} }, h("slot", { key: '04942d335177161673a0cb0e62bd509f418390a8' }))), h("div", { key: '2304a7f6e9f40a62a7a7d9b0ebe408dbfbb0c81d', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: '78bea4db879582d61cee9b5bf24bfa7b6286926e', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
281
238
|
}
|
|
282
239
|
static get is() { return "wm-select"; }
|
|
283
240
|
static get encapsulation() { return "shadow"; }
|
|
@@ -512,7 +469,7 @@ export class Select {
|
|
|
512
469
|
}
|
|
513
470
|
static get states() {
|
|
514
471
|
return {
|
|
515
|
-
"
|
|
472
|
+
"isExpanded": {},
|
|
516
473
|
"announcement": {}
|
|
517
474
|
};
|
|
518
475
|
}
|
|
@@ -604,22 +561,10 @@ export class Select {
|
|
|
604
561
|
"passive": false
|
|
605
562
|
}, {
|
|
606
563
|
"name": "wmEscKeyPressed",
|
|
607
|
-
"method": "
|
|
608
|
-
"target": undefined,
|
|
609
|
-
"capture": false,
|
|
610
|
-
"passive": false
|
|
611
|
-
}, {
|
|
612
|
-
"name": "wmOptionBlurred",
|
|
613
|
-
"method": "handleOptionBlur",
|
|
564
|
+
"method": "closeDropdownOnEscape",
|
|
614
565
|
"target": undefined,
|
|
615
566
|
"capture": false,
|
|
616
567
|
"passive": false
|
|
617
|
-
}, {
|
|
618
|
-
"name": "click",
|
|
619
|
-
"method": "handleClick",
|
|
620
|
-
"target": "document",
|
|
621
|
-
"capture": true,
|
|
622
|
-
"passive": false
|
|
623
568
|
}, {
|
|
624
569
|
"name": "keydown",
|
|
625
570
|
"method": "handleKey",
|
|
@@ -915,7 +915,7 @@
|
|
|
915
915
|
min-inline-size: 0;
|
|
916
916
|
flex-grow: 1;
|
|
917
917
|
}
|
|
918
|
-
.file-wrapper .file .left-group:has(.-truncated) {
|
|
918
|
+
.file-wrapper .file .left-group:has(#file-details:not([open]) .-truncated) {
|
|
919
919
|
min-inline-size: fit-content;
|
|
920
920
|
}
|
|
921
921
|
.file-wrapper .file .right-group {
|
|
@@ -163,24 +163,28 @@ export class Uploader {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
handleProgressUpdate(mutationRecord) {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
const uploadCount = this.inProgressFileEls.length;
|
|
167
|
+
if (uploadCount !== 0) {
|
|
168
|
+
const changeInUploadingFiles = this.prevUploadCount !== uploadCount;
|
|
168
169
|
changeInUploadingFiles &&
|
|
169
|
-
this.announce(uploaderMessages.getFilesUploading(
|
|
170
|
-
this.notif = uploaderMessages.getFilesUploading(
|
|
171
|
-
this.prevUploadCount =
|
|
170
|
+
this.announce(uploaderMessages.getFilesUploading(uploadCount), this.assertiveLiveRegionEl);
|
|
171
|
+
this.notif = uploaderMessages.getFilesUploading(uploadCount);
|
|
172
|
+
this.prevUploadCount = uploadCount;
|
|
173
|
+
if (this.batchCount < uploadCount) {
|
|
174
|
+
this.batchCount = uploadCount;
|
|
175
|
+
}
|
|
172
176
|
if (!this.srProgress) {
|
|
173
177
|
this.srProgress = setInterval(() => {
|
|
174
178
|
const aggregate = this.fileEls.reduce((avg, item) => (item.progress ? avg + item.progress : avg), 0);
|
|
175
|
-
this.
|
|
179
|
+
const percentage = this.batchCount > 0 ? Math.floor(aggregate / this.batchCount) : 0;
|
|
180
|
+
this.announce(uploaderMessages.getUploadProgress(percentage), this.assertiveLiveRegionEl);
|
|
176
181
|
}, 5000);
|
|
177
182
|
}
|
|
178
183
|
}
|
|
179
|
-
else if (
|
|
180
|
-
mutationRecord.oldValue &&
|
|
181
|
-
parseInt(mutationRecord.oldValue) < 100) {
|
|
184
|
+
else if (uploadCount === 0 && mutationRecord.oldValue && parseInt(mutationRecord.oldValue) < 100) {
|
|
182
185
|
// if final file progress completes
|
|
183
186
|
this.uploadButtonEl.value = "";
|
|
187
|
+
this.batchCount = 0;
|
|
184
188
|
this.notif = uploaderMessages.finishedUploading;
|
|
185
189
|
this.announce(uploaderMessages.finishedUploading, this.assertiveLiveRegionEl);
|
|
186
190
|
clearInterval(this.srProgress);
|
|
@@ -309,9 +313,9 @@ export class Uploader {
|
|
|
309
313
|
return (h("div", { class: `drop-area -${this.dropArea}`, ref: (el) => (this.dropAreaEl = el), onDragEnter: (ev) => this.handleDragEnter(ev), onDragOver: (ev) => this.handleDragOver(ev), onDragLeave: (ev) => this.handleDragLeave(ev), onDrop: (ev) => this.handleDrop(ev) }, this.dropArea == "page" && (h("div", { ref: (el) => (this.dropOverlayEl = el), class: "drop-overlay", popover: "manual" }, h("span", { class: "upload-arrow" }), h("span", null, "Drop to Upload")))));
|
|
310
314
|
}
|
|
311
315
|
render() {
|
|
312
|
-
return (h(Host, { key: '
|
|
316
|
+
return (h(Host, { key: '99be303c7fdecf7fed30bb597f312c792ab0dbd5', class: `-${this.dropArea}` }, this.uploaderType == "drop" && this.renderDropArea(), this.label && this.renderLabel(), this.renderHeader(), this.renderListContainer(), h("div", { key: 'd4fd6720967d4a5eed7b9d0231a5fe8203ed98b8', ref: (el) => (this.assertiveLiveRegionEl = el), class: "live-region sr-only", "aria-live": "assertive" // since it's directly linked to the action the user took, it should be read in priority. With polite, some messages get dismissed in favor of the page title
|
|
313
317
|
,
|
|
314
|
-
"aria-atomic": "true" }), h("div", { key: '
|
|
318
|
+
"aria-atomic": "true" }), h("div", { key: '06cfeee56f1cb84a616324cbc8d736e79bf1f258', ref: (el) => (this.politeLiveRegionEl = el), class: "live-region sr-only", "aria-live": "polite", "aria-atomic": "true" })));
|
|
315
319
|
}
|
|
316
320
|
static get is() { return "wm-uploader"; }
|
|
317
321
|
static get encapsulation() { return "shadow"; }
|
|
@@ -89,10 +89,10 @@ function handleFilesSelected(ev) {
|
|
|
89
89
|
addFile(upl, newFile);
|
|
90
90
|
|
|
91
91
|
// mock series of upload progress updates
|
|
92
|
-
setTimeout(() => updateUploadProgress(upl, fileId,
|
|
93
|
-
setTimeout(() => updateUploadProgress(upl, fileId,
|
|
94
|
-
setTimeout(() => updateUploadProgress(upl, fileId, 75), 3250 + uploadStagger);
|
|
95
|
-
setTimeout(() => updateUploadProgress(upl, fileId, 100), 3500 + uploadStagger);
|
|
92
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 0.00), 1000 + 3000);
|
|
93
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 25), 3000 + uploadStagger + 6000);
|
|
94
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 75.5), 3250 + uploadStagger + 15000);
|
|
95
|
+
setTimeout(() => updateUploadProgress(upl, fileId, 100), 3500 + uploadStagger + 20000);
|
|
96
96
|
} else {
|
|
97
97
|
addError(upl, newFile, fileError);
|
|
98
98
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from './index-130e07bb.js';
|
|
2
|
-
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-
|
|
2
|
+
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-38e392cb.js';
|
|
3
3
|
|
|
4
4
|
const colors = {
|
|
5
5
|
salmon: "#ff5f4e",
|
|
@@ -10585,4 +10585,4 @@ const weekdays = [
|
|
|
10585
10585
|
intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
|
|
10586
10586
|
];
|
|
10587
10587
|
|
|
10588
|
-
export { findPrev as A, getTextDir as B,
|
|
10588
|
+
export { findPrev as A, getTextDir as B, throttle as C, getContextMeasurements as D, dateFind as E, calendar_months as F, findParentWithHiddenOverflow as G, transposeMatrix as H, wrapAround as I, getSmallestSkipInterval as J, calcPercentageInRange as K, isElOrChild as L, makeISO as M, getMonthLength as N, weekdays as O, handleDisabledAttribute as a, triggerFormSubmit as b, checkForActiveElInShadow as c, debounce as d, safeMultiplyFloat as e, getPosition as f, generateId as g, hideTooltip as h, intl as i, findAllScrollableParents as j, dateToISO as k, shouldOpenUp as l, hasRoomRight as m, truncateText as n, getLastFocusableDescendant as o, csvToArray as p, snakeCaseToCamelCase as q, getNewIndexToFocus as r, showTooltip as s, toBool as t, getCumulativeScrollOffset as u, shouldOpenDown as v, shouldShiftRight as w, shouldShiftLeft as x, measureText as y, findNext as z };
|