wcs-core 7.2.1 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/wcs-select_2.cjs.entry.js +8 -6
- package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/select/select.e2e.js +52 -0
- package/dist/collection/components/select/select.e2e.js.map +1 -1
- package/dist/collection/components/select/select.js +8 -6
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +8 -6
- package/dist/esm/wcs-select_2.entry.js.map +1 -1
- package/dist/types/components/select/select.d.ts +1 -0
- package/dist/wcs/{p-d27d4a53.entry.js → p-b94a09b6.entry.js} +2 -2
- package/dist/wcs/p-b94a09b6.entry.js.map +1 -0
- package/dist/wcs/wcs.esm.js +1 -1
- package/package.json +1 -1
- package/dist/wcs/p-d27d4a53.entry.js.map +0 -1
|
@@ -5960,7 +5960,7 @@ const Select = class {
|
|
|
5960
5960
|
onAutocompleteInputEvent(e) {
|
|
5961
5961
|
var _a;
|
|
5962
5962
|
const filter = (_a = this.autocompleteInput.value) !== null && _a !== void 0 ? _a : '';
|
|
5963
|
-
this.setAutocompleteValue(filter);
|
|
5963
|
+
this.setAutocompleteValue(filter, false, true); // fromUserInteraction = true
|
|
5964
5964
|
// Avoid the inputEvent event to bubble and be emitted, we rather use wcsFilterChange in this case :
|
|
5965
5965
|
e.stopPropagation();
|
|
5966
5966
|
}
|
|
@@ -5968,13 +5968,15 @@ const Select = class {
|
|
|
5968
5968
|
* Set the autocomplete value and open the select if needed.
|
|
5969
5969
|
* @param filter - The new filter value
|
|
5970
5970
|
* @param isReset - If true, the filter is reset and the select is closed
|
|
5971
|
+
* @param fromUserInteraction - If true, the change comes from user interaction (typing), if false it's programmatic
|
|
5971
5972
|
* @private
|
|
5972
5973
|
*/
|
|
5973
|
-
setAutocompleteValue(filter, isReset = false) {
|
|
5974
|
+
setAutocompleteValue(filter, isReset = false, fromUserInteraction = false) {
|
|
5974
5975
|
var _a, _b;
|
|
5975
5976
|
this.clearHighlightOnLastHighlightedOption();
|
|
5976
5977
|
const newValueIsDifferentFromLastModifiedOption = this.lastModifiedOptionElement == null || ((_a = this.lastModifiedOptionElement) === null || _a === void 0 ? void 0 : _a.textContent) !== this.autocompleteValue;
|
|
5977
|
-
|
|
5978
|
+
// Only open the select automatically when the change comes from user interaction
|
|
5979
|
+
if (!this.expanded && newValueIsDifferentFromLastModifiedOption && !isReset && fromUserInteraction) {
|
|
5978
5980
|
this.open();
|
|
5979
5981
|
}
|
|
5980
5982
|
// Prevents client-side filtering logic from being applied when serverMode is enabled.
|
|
@@ -6043,14 +6045,14 @@ const Select = class {
|
|
|
6043
6045
|
var _a;
|
|
6044
6046
|
const ariaLabelValue = `${this.labelElement ? this.labelElement.innerText : ''} ${this.hasValue ? this.displayText : ''}`.trimEnd();
|
|
6045
6047
|
const noResultContainerId = 'no-result-container';
|
|
6046
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
6048
|
+
return (index.h(index.Host, Object.assign({ key: '71154caab9c0b2244716f5c5626cc0de3ed7d327', class: this.expanded ? 'expanded ' : '', overlayDirection: this.overlayDirection }, this.focusedAttributes(), { role: !this.autocomplete ? "combobox" : null, "aria-haspopup": !this.autocomplete ? "listbox" : null, "aria-owns": !this.autocomplete ? this.optionsId : null, "aria-controls": !this.autocomplete ? this.optionsId : null, "aria-disabled": !this.autocomplete ? (this.disabled ? 'true' : null) : null, "aria-required": !this.autocomplete ? (this.required ? 'true' : 'false') : null, "aria-expanded": !this.autocomplete ? (this.expanded ? 'true' : 'false') : null, "aria-multiselectable": !this.autocomplete ? (this.multiple ? 'true' : 'false') : null, "aria-label": !this.autocomplete ? ariaLabelValue : null }), index.h("div", { key: '2dff342eb864a28ac960583102de88cfd7f63d98', class: "wcs-select-control" }, index.h("div", { key: '0f2028f2eb8245fa08da06ccebbfbac880d0e090', class: "wcs-select-value-container" }, this.hasValue
|
|
6047
6049
|
?
|
|
6048
6050
|
(this.chips ?
|
|
6049
6051
|
this.values.map((option) => index.h(SelectChips, { disabled: this.disabled, option: option, onRemove: this.removeChip.bind(this) }))
|
|
6050
6052
|
: (!this.autocomplete || this.autocomplete && this.multiple) &&
|
|
6051
6053
|
index.h("label", { class: "wcs-select-value" }, this.displayText))
|
|
6052
|
-
: !this.autocomplete && index.h("label", { class: "wcs-select-placeholder" }, this.placeholder), this.autocomplete && index.h("input", Object.assign({ key: '
|
|
6053
|
-
index.h("div", { key: '
|
|
6054
|
+
: !this.autocomplete && index.h("label", { class: "wcs-select-placeholder" }, this.placeholder), this.autocomplete && index.h("input", Object.assign({ key: '000f05300690b402f77b210b4e6808e73647d607', class: "autocomplete-field", value: this.autocompleteValue, role: "combobox", "aria-haspopup": "listbox", "aria-label": ariaLabelValue, "aria-describedby": noResultContainerId, "aria-disabled": this.disabled ? 'true' : null, "aria-expanded": this.expanded ? 'true' : 'false', "aria-controls": this.optionsId, "aria-owns": this.optionsId, "aria-multiselectable": this.multiple ? 'true' : 'false', "aria-autocomplete": "list", autocomplete: "off", disabled: this.disabled, required: this.required, onBlur: (e) => this.onAutocompleteFieldBlur(e), placeholder: ((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) ? null : this.placeholder, onInput: (e) => this.onAutocompleteInputEvent(e), ref: el => this.autocompleteInput = el }, this.inheritedAttributes))), index.h(selectArrow.SelectArrow, { key: 'cbbb2ef8b0c49b69c2a3509e6444f52d114efd23', up: this.expanded })), index.h("div", { key: '9330811ed0b8e0a2380692cdca34f2196b087466', class: "wcs-select-options", id: this.optionsId, role: "listbox" }, index.h("slot", { key: '9efd1b1d83e7bc1af1733909060854025c21df07', name: "options", onSlotchange: this.onSlotchange.bind(this) }), (this.autocomplete && this.showNoResultFoundLabel) &&
|
|
6055
|
+
index.h("div", { key: 'a8438df62c26f1d4cfcd25c43d5636031138c71f', role: "alert", id: noResultContainerId, class: "noresult-container" }, index.h("slot", { key: '95397947cdef93512fec2c168ca42893500950ba', name: "filter-no-result" }, index.h("span", { key: 'd5fc78e9ba099a017f6ed3116b23aa929c34dcb9' }, "Aucun r\u00E9sultat"))))));
|
|
6054
6056
|
}
|
|
6055
6057
|
get el() { return index.getElement(this); }
|
|
6056
6058
|
static get watchers() { return {
|