slim-select 4.1.0 → 4.2.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/README.md +3 -0
- package/dist/react/index.js +71 -34
- package/dist/react/index.umd.js +1 -1
- package/dist/render.d.ts +7 -1
- package/dist/settings.d.ts +3 -0
- package/dist/slimselect.cjs.js +1 -1
- package/dist/slimselect.cjs.js.map +1 -1
- package/dist/slimselect.css +1 -1
- package/dist/slimselect.css.map +1 -1
- package/dist/slimselect.es.js +71 -34
- package/dist/slimselect.es.js.map +1 -1
- package/dist/slimselect.iife.js +1 -1
- package/dist/slimselect.iife.js.map +1 -1
- package/dist/slimselect.js +1 -1
- package/dist/slimselect.js.map +1 -1
- package/dist/vue/index.js +71 -34
- package/dist/vue/index.umd.js +1 -1
- package/package.json +7 -7
- package/src/slim-select/slimselect.scss +81 -49
package/README.md
CHANGED
|
@@ -190,6 +190,9 @@ new SlimSelect({
|
|
|
190
190
|
maxValuesShown: 20,
|
|
191
191
|
maxValuesMessage: '{number} selected',
|
|
192
192
|
addableText: 'Press "Enter" to add {value}',
|
|
193
|
+
selectAll: false, // Multi-select: checkbox next to search
|
|
194
|
+
selectAllText: 'Select All',
|
|
195
|
+
unselectAllText: 'Unselect All',
|
|
193
196
|
modal: 'mobile', // 'off' | 'on' | 'mobile'
|
|
194
197
|
modalTitle: '' // Header above the option list in modal view
|
|
195
198
|
}
|
package/dist/react/index.js
CHANGED
|
@@ -53,7 +53,7 @@ var o = class {
|
|
|
53
53
|
constructor(e) {
|
|
54
54
|
e ||= {};
|
|
55
55
|
let t = (e = "", t = "") => `${e} ${t}`.trim();
|
|
56
|
-
this.main = t("ss-main", e.main), this.placeholder = t("ss-placeholder", e.placeholder), this.values = t("ss-values", e.values), this.single = t("ss-single", e.single), this.multiString = t("ss-multi-string", e.multiString), this.max = t("ss-max", e.max), this.value = t("ss-value", e.value), this.valueText = t("ss-value-text", e.valueText), this.valueDelete = t("ss-value-delete", e.valueDelete), this.valueOut = t("ss-value-out", e.valueOut), this.deselect = t("ss-deselect", e.deselect), this.deselectPath = e.deselectPath || "M10,10 L90,90 M10,90 L90,10", this.arrow = t("ss-arrow", e.arrow), this.arrowClose = e.arrowClose || "M10,30 L50,70 L90,30", this.arrowOpen = e.arrowOpen || "M10,70 L50,30 L90,70", this.content = t("ss-content", e.content), this.contentOpen = t("ss-open", e.contentOpen), this.dirAbove = t("ss-dir-above", e.dirAbove), this.dirBelow = t("ss-dir-below", e.dirBelow), this.search = t("ss-search", e.search), this.searchHighlighter = t("ss-search-highlight", e.searchHighlighter), this.searching = t("ss-searching", e.searching), this.status = t("ss-status", e.status), this.addable = t("ss-addable", e.addable), this.addablePath = e.addablePath || "M50,10 L50,90 M10,50 L90,50", this.list = t("ss-list", e.list), this.optgroup = t("ss-optgroup", e.optgroup), this.optgroupLabel = t("ss-optgroup-label", e.optgroupLabel), this.optgroupLabelText = t("ss-optgroup-label-text", e.optgroupLabelText), this.optgroupActions = t("ss-optgroup-actions", e.optgroupActions), this.optgroupSelectAll = t("ss-selectall", e.optgroupSelectAll), this.optgroupSelectAllBox = e.optgroupSelectAllBox || "
|
|
56
|
+
this.main = t("ss-main", e.main), this.placeholder = t("ss-placeholder", e.placeholder), this.values = t("ss-values", e.values), this.single = t("ss-single", e.single), this.multiString = t("ss-multi-string", e.multiString), this.max = t("ss-max", e.max), this.value = t("ss-value", e.value), this.valueText = t("ss-value-text", e.valueText), this.valueDelete = t("ss-value-delete", e.valueDelete), this.valueOut = t("ss-value-out", e.valueOut), this.deselect = t("ss-deselect", e.deselect), this.deselectPath = e.deselectPath || "M10,10 L90,90 M10,90 L90,10", this.arrow = t("ss-arrow", e.arrow), this.arrowClose = e.arrowClose || "M10,30 L50,70 L90,30", this.arrowOpen = e.arrowOpen || "M10,70 L50,30 L90,70", this.content = t("ss-content", e.content), this.contentOpen = t("ss-open", e.contentOpen), this.dirAbove = t("ss-dir-above", e.dirAbove), this.dirBelow = t("ss-dir-below", e.dirBelow), this.search = t("ss-search", e.search), this.searchHighlighter = t("ss-search-highlight", e.searchHighlighter), this.searching = t("ss-searching", e.searching), this.status = t("ss-status", e.status), this.addable = t("ss-addable", e.addable), this.addablePath = e.addablePath || "M50,10 L50,90 M10,50 L90,50", this.list = t("ss-list", e.list), this.optgroup = t("ss-optgroup", e.optgroup), this.optgroupLabel = t("ss-optgroup-label", e.optgroupLabel), this.optgroupLabelText = t("ss-optgroup-label-text", e.optgroupLabelText), this.optgroupActions = t("ss-optgroup-actions", e.optgroupActions), this.optgroupSelectAll = t("ss-selectall", e.optgroupSelectAll), this.optgroupSelectAllBox = e.optgroupSelectAllBox || "M15,15 L85,15 L85,85 L15,85 Z", this.optgroupSelectAllCheck = e.optgroupSelectAllCheck || "M25,50 L42,68 L75,32", this.optgroupClosable = t("ss-closable", e.optgroupClosable), this.option = t("ss-option", e.option), this.optionDelete = e.optionDelete || "M10,10 L90,90 M10,90 L90,10", this.highlighted = t("ss-highlighted", e.highlighted), this.modalOverlay = t("ss-modal-overlay", e.modalOverlay), this.modalDialog = t("ss-modal-dialog", e.modalDialog), this.modalTitle = t("ss-modal-title", e.modalTitle), this.modalClose = t("ss-modal-close", e.modalClose), this.modalContent = t("ss-modal-content", e.modalContent), this.mainOpen = t("ss-open", e.mainOpen), this.close = t("ss-close", e.close), this.selected = t("ss-selected", e.selected), this.error = t("ss-error", e.error), this.disabled = t("ss-disabled", e.disabled), this.hide = t("ss-hide", e.hide);
|
|
57
57
|
}
|
|
58
58
|
getFirst(e) {
|
|
59
59
|
return this[e].split(" ")[0];
|
|
@@ -147,10 +147,13 @@ var g = class {
|
|
|
147
147
|
maxValuesShown;
|
|
148
148
|
maxValuesMessage;
|
|
149
149
|
addableText;
|
|
150
|
+
selectAll;
|
|
151
|
+
selectAllText;
|
|
152
|
+
unselectAllText;
|
|
150
153
|
modal;
|
|
151
154
|
modalTitle;
|
|
152
155
|
constructor(e) {
|
|
153
|
-
e ||= {}, this.id = "ss-" + b(), this.style = e.style || "", this.class = e.class || [], this.disabled = e.disabled !== void 0 && e.disabled, this.alwaysOpen = e.alwaysOpen !== void 0 && e.alwaysOpen, this.showSearch = e.showSearch === void 0 || e.showSearch, this.focusSearch = e.focusSearch === void 0 || e.focusSearch, this.keepSearch = e.keepSearch !== void 0 && e.keepSearch, this.ariaLabel = e.ariaLabel || "Combobox", this.searchPlaceholder = e.searchPlaceholder || "Search...", this.searchText = e.searchText || "No Results", this.searchingText = e.searchingText || "Searching...", this.resultsText = e.resultsText || "{count} results available", this.deselectText = e.deselectText || "Clear", this.removeText = e.removeText || "Remove", this.searchHighlight = e.searchHighlight !== void 0 && e.searchHighlight, this.closeOnSelect = e.closeOnSelect === void 0 || e.closeOnSelect, this.contentLocation = e.contentLocation || document.body, this.contentPosition = e.contentPosition || "absolute", this.contentWidth = e.contentWidth || "", this.openPosition = e.openPosition || "auto", this.placeholderText = e.placeholderText === void 0 ? "Select Value" : e.placeholderText, this.allowDeselect = e.allowDeselect !== void 0 && e.allowDeselect, this.hideSelected = e.hideSelected !== void 0 && e.hideSelected, this.multiString = e.multiString !== void 0 && e.multiString, this.keepOrder = e.keepOrder !== void 0 && e.keepOrder, this.showOptionTooltips = e.showOptionTooltips !== void 0 && e.showOptionTooltips, this.minSelected = e.minSelected || 0, this.maxSelected = e.maxSelected || 1e3, this.timeoutDelay = e.timeoutDelay || 200, this.maxValuesShown = e.maxValuesShown || 20, this.maxValuesMessage = e.maxValuesMessage || "{number} selected", this.addableText = e.addableText || "Press \"Enter\" to add {value}", this.modal = e.modal || "mobile", this.modalTitle = e.modalTitle || "";
|
|
156
|
+
e ||= {}, this.id = "ss-" + b(), this.style = e.style || "", this.class = e.class || [], this.disabled = e.disabled !== void 0 && e.disabled, this.alwaysOpen = e.alwaysOpen !== void 0 && e.alwaysOpen, this.showSearch = e.showSearch === void 0 || e.showSearch, this.focusSearch = e.focusSearch === void 0 || e.focusSearch, this.keepSearch = e.keepSearch !== void 0 && e.keepSearch, this.ariaLabel = e.ariaLabel || "Combobox", this.searchPlaceholder = e.searchPlaceholder || "Search...", this.searchText = e.searchText || "No Results", this.searchingText = e.searchingText || "Searching...", this.resultsText = e.resultsText || "{count} results available", this.deselectText = e.deselectText || "Clear", this.removeText = e.removeText || "Remove", this.searchHighlight = e.searchHighlight !== void 0 && e.searchHighlight, this.closeOnSelect = e.closeOnSelect === void 0 || e.closeOnSelect, this.contentLocation = e.contentLocation || document.body, this.contentPosition = e.contentPosition || "absolute", this.contentWidth = e.contentWidth || "", this.openPosition = e.openPosition || "auto", this.placeholderText = e.placeholderText === void 0 ? "Select Value" : e.placeholderText, this.allowDeselect = e.allowDeselect !== void 0 && e.allowDeselect, this.hideSelected = e.hideSelected !== void 0 && e.hideSelected, this.multiString = e.multiString !== void 0 && e.multiString, this.keepOrder = e.keepOrder !== void 0 && e.keepOrder, this.showOptionTooltips = e.showOptionTooltips !== void 0 && e.showOptionTooltips, this.minSelected = e.minSelected || 0, this.maxSelected = e.maxSelected || 1e3, this.timeoutDelay = e.timeoutDelay || 200, this.maxValuesShown = e.maxValuesShown || 20, this.maxValuesMessage = e.maxValuesMessage || "{number} selected", this.addableText = e.addableText || "Press \"Enter\" to add {value}", this.selectAll = e.selectAll !== void 0 && e.selectAll, this.selectAllText = e.selectAllText || "Select All", this.unselectAllText = e.unselectAllText || "Unselect All", this.modal = e.modal || "mobile", this.modalTitle = e.modalTitle || "";
|
|
154
157
|
}
|
|
155
158
|
};
|
|
156
159
|
//#endregion
|
|
@@ -983,13 +986,13 @@ var N = class {
|
|
|
983
986
|
let r = {
|
|
984
987
|
main: e,
|
|
985
988
|
input: t
|
|
986
|
-
};
|
|
987
|
-
this.settings.showSearch || (this.addClasses(
|
|
988
|
-
let
|
|
989
|
+
}, i = this.settings.selectAll && this.settings.isMultiple;
|
|
990
|
+
this.settings.showSearch || (t.readOnly = !0, i ? this.addClasses(t, this.classes.hide) : this.addClasses(e, this.classes.hide)), t.type = "search", t.id = `${this.settings.id}-search`, t.placeholder = this.settings.searchPlaceholder, t.tabIndex = -1, t.setAttribute("aria-label", this.settings.searchPlaceholder), t.setAttribute("aria-autocomplete", "list"), t.setAttribute("autocapitalize", "off"), t.setAttribute("autocomplete", "off"), t.setAttribute("autocorrect", "off"), t.setAttribute("aria-hidden", "true");
|
|
991
|
+
let a = S(() => {
|
|
989
992
|
this.callbacks.search(t.value);
|
|
990
993
|
}, 100);
|
|
991
994
|
if (t.oninput = (e) => {
|
|
992
|
-
e.target.value !== "" && this.clearValueChipHighlight(),
|
|
995
|
+
e.target.value !== "" && this.clearValueChipHighlight(), a();
|
|
993
996
|
}, t.onkeydown = (e) => {
|
|
994
997
|
switch (e.key) {
|
|
995
998
|
case "ArrowUp":
|
|
@@ -1005,7 +1008,11 @@ var N = class {
|
|
|
1005
1008
|
return r ? (r.click(), !1) : !this.callbacks.addable || (n.click(), !1);
|
|
1006
1009
|
}
|
|
1007
1010
|
return e.key.length === 1 && this.clearValueChipHighlight(), !0;
|
|
1008
|
-
}, e.appendChild(t),
|
|
1011
|
+
}, e.appendChild(t), i) {
|
|
1012
|
+
let t = this.createSelectAllControl(() => this.toggleGlobalSelectAll());
|
|
1013
|
+
e.appendChild(t), r.selectAll = t;
|
|
1014
|
+
}
|
|
1015
|
+
if (this.callbacks.addable) {
|
|
1009
1016
|
this.addClasses(n, this.classes.addable);
|
|
1010
1017
|
let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1011
1018
|
t.setAttribute("viewBox", "0 0 100 100");
|
|
@@ -1133,35 +1140,24 @@ var N = class {
|
|
|
1133
1140
|
this.addClasses(i, this.classes.optgroupLabelText), i.textContent = n.label, r.appendChild(i);
|
|
1134
1141
|
let a = document.createElement("div");
|
|
1135
1142
|
if (this.addClasses(a, this.classes.optgroupActions), r.appendChild(a), this.settings.isMultiple && n.selectAll) {
|
|
1136
|
-
let e =
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
let r = document.createElement("span");
|
|
1141
|
-
r.textContent = this.optgroupSelectAllLabel(t), e.appendChild(r);
|
|
1142
|
-
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1143
|
-
i.setAttribute("viewBox", "0 0 100 100"), e.appendChild(i);
|
|
1144
|
-
let o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1145
|
-
o.setAttribute("d", this.classes.optgroupSelectAllBox), i.appendChild(o);
|
|
1146
|
-
let s = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1147
|
-
s.setAttribute("d", this.classes.optgroupSelectAllCheck), i.appendChild(s), e.addEventListener("click", (e) => {
|
|
1148
|
-
e.preventDefault(), e.stopPropagation();
|
|
1149
|
-
let t = this.store.getSelected();
|
|
1150
|
-
if (this.isOptgroupAllSelected(n.options, new Set(t))) {
|
|
1151
|
-
let e = t.filter((e) => {
|
|
1143
|
+
let e = this.createSelectAllControl(() => {
|
|
1144
|
+
let e = this.store.getSelected();
|
|
1145
|
+
if (this.isOptgroupAllSelected(n.options, new Set(e))) {
|
|
1146
|
+
let t = e.filter((e) => {
|
|
1152
1147
|
for (let t of n.options) if (e === t.id) return !1;
|
|
1153
1148
|
return !0;
|
|
1154
1149
|
});
|
|
1155
|
-
this.callbacks.setSelected(
|
|
1150
|
+
this.callbacks.setSelected(t, !0);
|
|
1156
1151
|
return;
|
|
1157
1152
|
}
|
|
1158
1153
|
{
|
|
1159
|
-
let
|
|
1154
|
+
let t = n.options.map((e) => e.id).filter((e) => e !== void 0), r = e.concat(t);
|
|
1160
1155
|
for (let e of n.options) e.id && !this.store.getOptionByID(e.id) && this.callbacks.addOption(new F(e));
|
|
1161
1156
|
this.callbacks.setSelected(r, !0);
|
|
1162
1157
|
return;
|
|
1163
1158
|
}
|
|
1164
|
-
}
|
|
1159
|
+
}, this.isOptgroupAllSelected(n.options));
|
|
1160
|
+
a.appendChild(e);
|
|
1165
1161
|
}
|
|
1166
1162
|
if (n.closable !== "off") {
|
|
1167
1163
|
let t = document.createElement("div");
|
|
@@ -1178,7 +1174,7 @@ var N = class {
|
|
|
1178
1174
|
}
|
|
1179
1175
|
n instanceof F && t.appendChild(this.option(n));
|
|
1180
1176
|
}
|
|
1181
|
-
this.content.list.appendChild(t), this.setOptionsListFullData(e), this.announce(this.settings.resultsText.replace("{count}", String(this.lastRenderedOptions.length)));
|
|
1177
|
+
this.content.list.appendChild(t), this.setOptionsListFullData(e), this.announce(this.settings.resultsText.replace("{count}", String(this.lastRenderedOptions.length))), this.updateGlobalSelectAllState();
|
|
1182
1178
|
}
|
|
1183
1179
|
canFilterOptionsInPlace() {
|
|
1184
1180
|
return this.optionsListIsFullData ? this.content.list.querySelector("." + this.classes.getFirst("option")) !== null : !1;
|
|
@@ -1199,7 +1195,7 @@ var N = class {
|
|
|
1199
1195
|
let o = a.placeholder || !a.display || a.selected && this.settings.hideSelected, s = t(a, n);
|
|
1200
1196
|
o || !s ? (this.addClasses(e, this.classes.hide), this.removeClasses(e, this.classes.highlighted)) : (this.removeClasses(e, this.classes.hide), this.setOptionElementContent(e, a, n), r.push(a)), a.selected ? (this.addClasses(e, this.classes.selected), e.setAttribute("aria-selected", "true")) : (this.removeClasses(e, this.classes.selected), e.setAttribute("aria-selected", "false"));
|
|
1201
1197
|
}
|
|
1202
|
-
this.lastRenderedOptions = r, this.updateOptgroupVisibilityAfterSearch(n), r.length === 0 ? this.updateSearchResultsMessage(0, n) : (this.removeListSearchMessage(), this.announce(this.settings.resultsText.replace("{count}", String(r.length)))), this.updateOptgroupSelectAllStates();
|
|
1198
|
+
this.lastRenderedOptions = r, this.updateOptgroupVisibilityAfterSearch(n), r.length === 0 ? this.updateSearchResultsMessage(0, n) : (this.removeListSearchMessage(), this.announce(this.settings.resultsText.replace("{count}", String(r.length)))), this.updateOptgroupSelectAllStates(), this.updateGlobalSelectAllState();
|
|
1203
1199
|
}
|
|
1204
1200
|
setOptionsListFullData(e) {
|
|
1205
1201
|
let t = this.store.getDataOptions(!1), n = e.map((e) => e instanceof F ? [e] : e.options.map((e) => new F(e))).flat();
|
|
@@ -1271,7 +1267,48 @@ var N = class {
|
|
|
1271
1267
|
let a = e.has(t);
|
|
1272
1268
|
a ? (this.addClasses(r, this.classes.selected), r.setAttribute("aria-selected", "true"), n = r) : (this.removeClasses(r, this.classes.selected), r.setAttribute("aria-selected", "false")), this.settings.hideSelected && (a ? this.addClasses(r, this.classes.hide) : (this.removeClasses(r, this.classes.hide), i.display || this.addClasses(r, this.classes.hide)));
|
|
1273
1269
|
}
|
|
1274
|
-
!this.settings.isMultiple && n ? this.main.main.setAttribute("aria-activedescendant", n.id) : !this.settings.isMultiple && e.size === 0 && this.main.main.removeAttribute("aria-activedescendant"), this.updateOptgroupSelectAllStates();
|
|
1270
|
+
!this.settings.isMultiple && n ? this.main.main.setAttribute("aria-activedescendant", n.id) : !this.settings.isMultiple && e.size === 0 && this.main.main.removeAttribute("aria-activedescendant"), this.updateOptgroupSelectAllStates(), this.updateGlobalSelectAllState();
|
|
1271
|
+
}
|
|
1272
|
+
createSelectAllControl(e, t = !1) {
|
|
1273
|
+
let n = document.createElement("div");
|
|
1274
|
+
this.addClasses(n, this.classes.optgroupSelectAll), n.setAttribute("role", "checkbox"), n.setAttribute("aria-checked", t ? "true" : "false"), n.setAttribute("aria-label", this.selectAllLabel(t)), n.tabIndex = -1, t && this.addClasses(n, this.classes.selected);
|
|
1275
|
+
let r = document.createElement("span");
|
|
1276
|
+
r.textContent = this.selectAllLabel(t), n.appendChild(r);
|
|
1277
|
+
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1278
|
+
i.setAttribute("viewBox", "0 0 100 100"), i.setAttribute("aria-hidden", "true"), n.appendChild(i);
|
|
1279
|
+
let a = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1280
|
+
a.setAttribute("d", this.classes.optgroupSelectAllBox), i.appendChild(a);
|
|
1281
|
+
let o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1282
|
+
return o.setAttribute("d", this.classes.optgroupSelectAllCheck), i.appendChild(o), n.addEventListener("click", (t) => {
|
|
1283
|
+
t.preventDefault(), t.stopPropagation(), e();
|
|
1284
|
+
}), n;
|
|
1285
|
+
}
|
|
1286
|
+
getSelectableOptions() {
|
|
1287
|
+
return this.store.getDataOptions(!1).filter((e) => !e.disabled && !e.placeholder && e.display);
|
|
1288
|
+
}
|
|
1289
|
+
isGlobalAllSelected(e) {
|
|
1290
|
+
let t = this.getSelectableOptions();
|
|
1291
|
+
if (t.length === 0) return !1;
|
|
1292
|
+
let n = e || new Set(this.store.getSelected());
|
|
1293
|
+
for (let e of t) if (!n.has(e.id)) return !1;
|
|
1294
|
+
return !0;
|
|
1295
|
+
}
|
|
1296
|
+
toggleGlobalSelectAll() {
|
|
1297
|
+
let e = this.getSelectableOptions(), t = new Set(this.store.getSelected());
|
|
1298
|
+
if (this.isGlobalAllSelected(t)) {
|
|
1299
|
+
let t = new Set(e.map((e) => e.id)), n = this.store.getSelected().filter((e) => !t.has(e));
|
|
1300
|
+
this.callbacks.setSelected(n, !0);
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
this.callbacks.setSelected(e.map((e) => e.id), !0);
|
|
1304
|
+
}
|
|
1305
|
+
updateGlobalSelectAllState() {
|
|
1306
|
+
let e = this.content.search.selectAll;
|
|
1307
|
+
if (!e || !this.settings.isMultiple || !this.settings.selectAll) return;
|
|
1308
|
+
let t = this.isGlobalAllSelected();
|
|
1309
|
+
t ? this.addClasses(e, this.classes.selected) : this.removeClasses(e, this.classes.selected), e.setAttribute("aria-checked", t ? "true" : "false"), e.setAttribute("aria-label", this.selectAllLabel(t));
|
|
1310
|
+
let n = e.querySelector("span");
|
|
1311
|
+
n && (n.textContent = this.selectAllLabel(t));
|
|
1275
1312
|
}
|
|
1276
1313
|
updateOptgroupSelectAllStates() {
|
|
1277
1314
|
if (!this.settings.isMultiple) return;
|
|
@@ -1287,13 +1324,13 @@ var N = class {
|
|
|
1287
1324
|
break;
|
|
1288
1325
|
}
|
|
1289
1326
|
}
|
|
1290
|
-
i ? this.addClasses(t, this.classes.selected) : this.removeClasses(t, this.classes.selected);
|
|
1327
|
+
i ? this.addClasses(t, this.classes.selected) : this.removeClasses(t, this.classes.selected), t.setAttribute("aria-checked", i ? "true" : "false"), t.setAttribute("aria-label", this.selectAllLabel(i));
|
|
1291
1328
|
let a = t.querySelector("span");
|
|
1292
|
-
a && (a.textContent = this.
|
|
1329
|
+
a && (a.textContent = this.selectAllLabel(i));
|
|
1293
1330
|
}
|
|
1294
1331
|
}
|
|
1295
|
-
|
|
1296
|
-
return e ?
|
|
1332
|
+
selectAllLabel(e) {
|
|
1333
|
+
return e ? this.settings.unselectAllText : this.settings.selectAllText;
|
|
1297
1334
|
}
|
|
1298
1335
|
isOptgroupAllSelected(e, t) {
|
|
1299
1336
|
if (e.length === 0) return !1;
|
|
@@ -1867,7 +1904,7 @@ var U = class {
|
|
|
1867
1904
|
e.events && e.events.error && e.events.error(/* @__PURE__ */ Error("Element isnt of type select"));
|
|
1868
1905
|
return;
|
|
1869
1906
|
}
|
|
1870
|
-
this.selectEl.dataset.ssid && this.destroy(), this.settings = new g(e.settings), this.cssClasses = new o(e.cssClasses);
|
|
1907
|
+
this.selectEl.dataset.ssid && this.destroy(), this.settings = new g(e.settings), e.settings?.selectAll === void 0 && this.selectEl.dataset.selectall === "true" && (this.settings.selectAll = !0), this.cssClasses = new o(e.cssClasses);
|
|
1871
1908
|
let t = [
|
|
1872
1909
|
"beforeOpen",
|
|
1873
1910
|
"afterOpen",
|