@keenmate/web-multiselect 2.0.0-rc01 → 2.0.0-rc02
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 +41 -0
- package/custom-elements.json +0 -8
- package/dist/multiselect.js +156 -127
- package/dist/multiselect.umd.js +7 -7
- package/package.json +2 -2
- package/web-types.json +1 -1
package/dist/multiselect.js
CHANGED
|
@@ -164,17 +164,17 @@ function Go() {
|
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
|
-
const
|
|
167
|
+
const Ze = /* @__PURE__ */ new Map();
|
|
168
168
|
function qo(o, e) {
|
|
169
|
-
let t =
|
|
170
|
-
t ||
|
|
169
|
+
let t = Ze.get(o);
|
|
170
|
+
t || Ze.set(o, t = /* @__PURE__ */ new Set()), t.add(e);
|
|
171
171
|
}
|
|
172
172
|
function Jo(o, e) {
|
|
173
173
|
var t;
|
|
174
|
-
(t =
|
|
174
|
+
(t = Ze.get(o)) == null || t.delete(e);
|
|
175
175
|
}
|
|
176
176
|
function Xo(o) {
|
|
177
|
-
return Array.from(
|
|
177
|
+
return Array.from(Ze.get(o) ?? []);
|
|
178
178
|
}
|
|
179
179
|
const no = /* @__PURE__ */ new Map();
|
|
180
180
|
function Yo(o, e) {
|
|
@@ -212,19 +212,19 @@ const rs = { trace() {
|
|
|
212
212
|
}, warn() {
|
|
213
213
|
}, error() {
|
|
214
214
|
} }, ns = new Proxy({}, { get: () => rs });
|
|
215
|
-
var de,
|
|
215
|
+
var de, He, Se, Fe, be, We, st, ve, he, ye, Te, Ie, Oe, Pe, it, te, Me, P, ao, lo, co, J, ho, po, ft, gt, ze, bt, mo;
|
|
216
216
|
class ut extends ss {
|
|
217
217
|
constructor() {
|
|
218
218
|
super();
|
|
219
219
|
V(this, P);
|
|
220
220
|
V(this, de, {});
|
|
221
|
-
V(this, Ke, /* @__PURE__ */ new Map());
|
|
222
|
-
V(this, Se, /* @__PURE__ */ new Map());
|
|
223
221
|
V(this, He, /* @__PURE__ */ new Map());
|
|
222
|
+
V(this, Se, /* @__PURE__ */ new Map());
|
|
223
|
+
V(this, Fe, /* @__PURE__ */ new Map());
|
|
224
224
|
/** Live handler currently bound via each managed `on<Name>` property, keyed by event name. */
|
|
225
225
|
V(this, be, /* @__PURE__ */ new Map());
|
|
226
|
-
V(this,
|
|
227
|
-
V(this,
|
|
226
|
+
V(this, We, Go());
|
|
227
|
+
V(this, st, () => C(this, P, bt).call(this));
|
|
228
228
|
V(this, ve, null);
|
|
229
229
|
V(this, he, !1);
|
|
230
230
|
V(this, ye, []);
|
|
@@ -240,15 +240,16 @@ class ut extends ss {
|
|
|
240
240
|
*/
|
|
241
241
|
V(this, Ie, null);
|
|
242
242
|
V(this, Oe, !1);
|
|
243
|
-
V(this, st);
|
|
244
|
-
V(this, te);
|
|
245
243
|
V(this, Pe);
|
|
244
|
+
V(this, it);
|
|
245
|
+
V(this, te);
|
|
246
|
+
V(this, Me);
|
|
246
247
|
const t = this.constructor, s = t.inputs ?? [], i = os(t.events);
|
|
247
248
|
C(this, P, co).call(this, s, i);
|
|
248
249
|
for (const r of s)
|
|
249
|
-
f(this,
|
|
250
|
+
f(this, He).set(r.configKey, r), r.attribute && f(this, Se).set(r.attribute, r);
|
|
250
251
|
for (const r of i)
|
|
251
|
-
f(this,
|
|
252
|
+
f(this, Fe).set(r.name, r);
|
|
252
253
|
C(this, P, ao).call(this, s), C(this, P, ho).call(this, s), C(this, P, po).call(this, i);
|
|
253
254
|
}
|
|
254
255
|
static get observedAttributes() {
|
|
@@ -271,7 +272,7 @@ class ut extends ss {
|
|
|
271
272
|
C(this, P, gt).call(this, n);
|
|
272
273
|
}
|
|
273
274
|
connectedCallback() {
|
|
274
|
-
qo(this.localName, this), f(this, Te) || (z(this, Te, !0), z(this, Ie, null), z(this, he, !0)), C(this, P,
|
|
275
|
+
qo(this.localName, this), f(this, Te) || (z(this, Te, !0), z(this, Ie, null), z(this, he, !0)), C(this, P, ze).call(this), this.connect();
|
|
275
276
|
}
|
|
276
277
|
disconnectedCallback() {
|
|
277
278
|
Jo(this.localName, this), this.disconnect();
|
|
@@ -280,14 +281,14 @@ class ut extends ss {
|
|
|
280
281
|
/** Apply many inputs (by `configKey` or attribute name) as ONE reinit/update. */
|
|
281
282
|
setAttributes(t) {
|
|
282
283
|
for (const [s, i] of Object.entries(t)) {
|
|
283
|
-
const r = f(this,
|
|
284
|
+
const r = f(this, He).get(s) ?? f(this, Se).get(s);
|
|
284
285
|
r && C(this, P, ft).call(this, r, i);
|
|
285
286
|
}
|
|
286
|
-
C(this, P,
|
|
287
|
+
C(this, P, ze).call(this);
|
|
287
288
|
}
|
|
288
289
|
/** Run `fn` and coalesce every input change it makes into a single reinit/update. */
|
|
289
290
|
batch(t) {
|
|
290
|
-
t(), C(this, P,
|
|
291
|
+
t(), C(this, P, ze).call(this);
|
|
291
292
|
}
|
|
292
293
|
/**
|
|
293
294
|
* Apply any pending input writes **synchronously, now** — running the
|
|
@@ -303,7 +304,7 @@ class ut extends ss {
|
|
|
303
304
|
* `await whenSettled()` between the two.
|
|
304
305
|
*/
|
|
305
306
|
flush() {
|
|
306
|
-
C(this, P,
|
|
307
|
+
C(this, P, ze).call(this);
|
|
307
308
|
}
|
|
308
309
|
/**
|
|
309
310
|
* Resolves once the element is **settled** — i.e. every staged input change
|
|
@@ -339,13 +340,13 @@ class ut extends ss {
|
|
|
339
340
|
* loggers inside a component.
|
|
340
341
|
*/
|
|
341
342
|
get log() {
|
|
342
|
-
if (f(this,
|
|
343
|
-
return f(this,
|
|
343
|
+
if (f(this, Me))
|
|
344
|
+
return f(this, Me);
|
|
344
345
|
const t = Qo(this.localName);
|
|
345
346
|
if (!t)
|
|
346
347
|
return ns;
|
|
347
|
-
const s = f(this,
|
|
348
|
-
return z(this,
|
|
348
|
+
const s = f(this, it) ?? z(this, it, `${this.localName}#${this.id || ++is}`);
|
|
349
|
+
return z(this, Me, t.forInstance(s, () => f(this, te)));
|
|
349
350
|
}
|
|
350
351
|
/**
|
|
351
352
|
* Turn on verbose logging for THIS element only (default `debug`), independent
|
|
@@ -395,6 +396,40 @@ class ut extends ss {
|
|
|
395
396
|
*/
|
|
396
397
|
disconnect() {
|
|
397
398
|
}
|
|
399
|
+
// ── form association ──────────────────────────────────────────────────────
|
|
400
|
+
/**
|
|
401
|
+
* This element's {@link ElementInternals}, lazily attached on first access and
|
|
402
|
+
* memoized. Available to form-associated components (`static formAssociated =
|
|
403
|
+
* true`); returns `null` when `attachInternals` is unavailable (SSR, older
|
|
404
|
+
* jsdom) or the element opts out. Because `attachInternals()` may be called at
|
|
405
|
+
* most once per element, a subclass must NOT call it itself — read this getter
|
|
406
|
+
* instead (e.g. `this.internals?.setFormValue(value)`).
|
|
407
|
+
*/
|
|
408
|
+
get internals() {
|
|
409
|
+
if (f(this, Pe))
|
|
410
|
+
return f(this, Pe);
|
|
411
|
+
if (typeof this.attachInternals != "function")
|
|
412
|
+
return null;
|
|
413
|
+
try {
|
|
414
|
+
return z(this, Pe, this.attachInternals());
|
|
415
|
+
} catch {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* The `<form>` this element is associated with, or `null`. A form-associated
|
|
421
|
+
* custom element (`static formAssociated = true`) participates in its form, but
|
|
422
|
+
* — unlike a native control — gets NO `.form` property for free: the browser
|
|
423
|
+
* records the association only inside {@link ElementInternals}. This re-exposes
|
|
424
|
+
* it so `el.form` and `event.target.form` resolve like a native input. Host
|
|
425
|
+
* frameworks that route form changes by reading `target.form` (e.g. Phoenix
|
|
426
|
+
* LiveView's `phx-change` delegation) depend on it. Unlike `closest('form')`,
|
|
427
|
+
* `ElementInternals.form` honours shadow-DOM boundaries and `form=` association.
|
|
428
|
+
*/
|
|
429
|
+
get form() {
|
|
430
|
+
var t;
|
|
431
|
+
return ((t = this.internals) == null ? void 0 : t.form) ?? null;
|
|
432
|
+
}
|
|
398
433
|
// ── events & callbacks (SPEC §12.5) ───────────────────────────────────────
|
|
399
434
|
/**
|
|
400
435
|
* Fire an outward notification: dispatch a typed `CustomEvent`. `name` and
|
|
@@ -406,7 +441,7 @@ class ut extends ss {
|
|
|
406
441
|
* `emit` does not call it separately.
|
|
407
442
|
*/
|
|
408
443
|
emit(t, s, i) {
|
|
409
|
-
const r = f(this,
|
|
444
|
+
const r = f(this, Fe).get(t);
|
|
410
445
|
return Zo(this, t, s, {
|
|
411
446
|
bubbles: (i == null ? void 0 : i.bubbles) ?? (r == null ? void 0 : r.bubbles),
|
|
412
447
|
composed: (i == null ? void 0 : i.composed) ?? (r == null ? void 0 : r.composed),
|
|
@@ -445,7 +480,7 @@ class ut extends ss {
|
|
|
445
480
|
}
|
|
446
481
|
}
|
|
447
482
|
}
|
|
448
|
-
de = new WeakMap(),
|
|
483
|
+
de = new WeakMap(), He = new WeakMap(), Se = new WeakMap(), Fe = new WeakMap(), be = new WeakMap(), We = new WeakMap(), st = new WeakMap(), ve = new WeakMap(), he = new WeakMap(), ye = new WeakMap(), Te = new WeakMap(), Ie = new WeakMap(), Oe = new WeakMap(), Pe = new WeakMap(), it = new WeakMap(), te = new WeakMap(), Me = new WeakMap(), P = new WeakSet(), // ── internals ─────────────────────────────────────────────────────────────
|
|
449
484
|
ao = function(t) {
|
|
450
485
|
var s;
|
|
451
486
|
for (const i of t) {
|
|
@@ -532,10 +567,10 @@ po = function(t) {
|
|
|
532
567
|
}
|
|
533
568
|
}
|
|
534
569
|
}, gt = function(t) {
|
|
535
|
-
f(this, de)[t.configKey] = t.value, t.field && (this[t.field] = t.value), t.on !== "none" && (t.on === "reinit" && z(this, he, !0), (f(this, ve) ?? z(this, ve, {}))[t.configKey] = t.value, f(this,
|
|
570
|
+
f(this, de)[t.configKey] = t.value, t.field && (this[t.field] = t.value), t.on !== "none" && (t.on === "reinit" && z(this, he, !0), (f(this, ve) ?? z(this, ve, {}))[t.configKey] = t.value, f(this, We).schedule(f(this, st)));
|
|
536
571
|
}, /** Cancel any queued microtask and flush pending changes synchronously now. */
|
|
537
|
-
|
|
538
|
-
f(this,
|
|
572
|
+
ze = function() {
|
|
573
|
+
f(this, We).cancel(), C(this, P, bt).call(this);
|
|
539
574
|
}, bt = function() {
|
|
540
575
|
if (!this.isConnected)
|
|
541
576
|
return;
|
|
@@ -581,17 +616,17 @@ function ls(o, e, t) {
|
|
|
581
616
|
return typeof window < "u" && ((window.components ?? (window.components = {}))[o] = n), r && Dt(o, e), n;
|
|
582
617
|
}
|
|
583
618
|
const zt = /* @__PURE__ */ new Map(), Nt = /* @__PURE__ */ new WeakMap();
|
|
584
|
-
let
|
|
619
|
+
let qe;
|
|
585
620
|
function cs(o) {
|
|
586
621
|
if (typeof CSSStyleSheet > "u" || !("adoptedStyleSheets" in o))
|
|
587
622
|
return !1;
|
|
588
|
-
if (
|
|
623
|
+
if (qe === void 0)
|
|
589
624
|
try {
|
|
590
|
-
new CSSStyleSheet().replaceSync(""),
|
|
625
|
+
new CSSStyleSheet().replaceSync(""), qe = !0;
|
|
591
626
|
} catch {
|
|
592
|
-
|
|
627
|
+
qe = !1;
|
|
593
628
|
}
|
|
594
|
-
return
|
|
629
|
+
return qe;
|
|
595
630
|
}
|
|
596
631
|
function ds(o, ...e) {
|
|
597
632
|
if (typeof document > "u")
|
|
@@ -897,7 +932,7 @@ function ks(o, e = bs) {
|
|
|
897
932
|
}
|
|
898
933
|
};
|
|
899
934
|
}
|
|
900
|
-
const me = Math.min, ie = Math.max,
|
|
935
|
+
const me = Math.min, ie = Math.max, et = Math.round, Je = Math.floor, re = (o) => ({
|
|
901
936
|
x: o,
|
|
902
937
|
y: o
|
|
903
938
|
}), Cs = {
|
|
@@ -909,13 +944,13 @@ const me = Math.min, ie = Math.max, Ze = Math.round, qe = Math.floor, re = (o) =
|
|
|
909
944
|
function go(o, e, t) {
|
|
910
945
|
return ie(o, me(e, t));
|
|
911
946
|
}
|
|
912
|
-
function
|
|
947
|
+
function Ee(o, e) {
|
|
913
948
|
return typeof o == "function" ? o(e) : o;
|
|
914
949
|
}
|
|
915
950
|
function xe(o) {
|
|
916
951
|
return o.split("-")[0];
|
|
917
952
|
}
|
|
918
|
-
function
|
|
953
|
+
function $e(o) {
|
|
919
954
|
return o.split("-")[1];
|
|
920
955
|
}
|
|
921
956
|
function bo(o) {
|
|
@@ -933,12 +968,12 @@ function Pt(o) {
|
|
|
933
968
|
}
|
|
934
969
|
function Ss(o, e, t) {
|
|
935
970
|
t === void 0 && (t = !1);
|
|
936
|
-
const s =
|
|
971
|
+
const s = $e(o), i = Pt(o), r = Ot(i);
|
|
937
972
|
let n = i === "x" ? s === (t ? "end" : "start") ? "right" : "left" : s === "start" ? "bottom" : "top";
|
|
938
|
-
return e.reference[r] > e.floating[r] && (n =
|
|
973
|
+
return e.reference[r] > e.floating[r] && (n = tt(n)), [n, tt(n)];
|
|
939
974
|
}
|
|
940
975
|
function Ts(o) {
|
|
941
|
-
const e =
|
|
976
|
+
const e = tt(o);
|
|
942
977
|
return [vt(o), e, vt(e)];
|
|
943
978
|
}
|
|
944
979
|
function vt(o) {
|
|
@@ -958,11 +993,11 @@ function Ps(o, e, t) {
|
|
|
958
993
|
}
|
|
959
994
|
}
|
|
960
995
|
function Ms(o, e, t, s) {
|
|
961
|
-
const i =
|
|
996
|
+
const i = $e(o);
|
|
962
997
|
let r = Ps(xe(o), t === "start", s);
|
|
963
998
|
return i && (r = r.map((n) => n + "-" + i), e && (r = r.concat(r.map(vt)))), r;
|
|
964
999
|
}
|
|
965
|
-
function
|
|
1000
|
+
function tt(o) {
|
|
966
1001
|
const e = xe(o);
|
|
967
1002
|
return Cs[e] + o.slice(e.length);
|
|
968
1003
|
}
|
|
@@ -983,7 +1018,7 @@ function vo(o) {
|
|
|
983
1018
|
left: o
|
|
984
1019
|
};
|
|
985
1020
|
}
|
|
986
|
-
function
|
|
1021
|
+
function ot(o) {
|
|
987
1022
|
const {
|
|
988
1023
|
x: e,
|
|
989
1024
|
y: t,
|
|
@@ -1039,7 +1074,7 @@ function Ft(o, e, t) {
|
|
|
1039
1074
|
y: s.y
|
|
1040
1075
|
};
|
|
1041
1076
|
}
|
|
1042
|
-
const b =
|
|
1077
|
+
const b = $e(e);
|
|
1043
1078
|
return b && (m[n] += g * (b === "end" ? 1 : -1) * (t && c ? -1 : 1)), m;
|
|
1044
1079
|
}
|
|
1045
1080
|
async function Ls(o, e) {
|
|
@@ -1058,7 +1093,7 @@ async function Ls(o, e) {
|
|
|
1058
1093
|
elementContext: h = "floating",
|
|
1059
1094
|
altBoundary: g = !1,
|
|
1060
1095
|
padding: m = 0
|
|
1061
|
-
} =
|
|
1096
|
+
} = Ee(e, o), b = vo(m), v = a[g ? h === "floating" ? "reference" : "floating" : h], p = ot(await r.getClippingRect({
|
|
1062
1097
|
element: (t = await (r.isElement == null ? void 0 : r.isElement(v))) == null || t ? v : v.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
1063
1098
|
boundary: c,
|
|
1064
1099
|
rootBoundary: d,
|
|
@@ -1071,7 +1106,7 @@ async function Ls(o, e) {
|
|
|
1071
1106
|
} : n.reference, S = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)), k = await (r.isElement == null ? void 0 : r.isElement(S)) && await (r.getScale == null ? void 0 : r.getScale(S)) || {
|
|
1072
1107
|
x: 1,
|
|
1073
1108
|
y: 1
|
|
1074
|
-
}, A =
|
|
1109
|
+
}, A = ot(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1075
1110
|
elements: a,
|
|
1076
1111
|
rect: x,
|
|
1077
1112
|
offsetParent: S,
|
|
@@ -1163,7 +1198,7 @@ const Es = 50, $s = async (o, e, t) => {
|
|
|
1163
1198
|
} = e, {
|
|
1164
1199
|
element: c,
|
|
1165
1200
|
padding: d = 0
|
|
1166
|
-
} =
|
|
1201
|
+
} = Ee(o, e) || {};
|
|
1167
1202
|
if (c == null)
|
|
1168
1203
|
return {};
|
|
1169
1204
|
const h = vo(d), g = {
|
|
@@ -1172,7 +1207,7 @@ const Es = 50, $s = async (o, e, t) => {
|
|
|
1172
1207
|
}, m = Pt(i), b = Ot(m), u = await n.getDimensions(c), v = m === "y", p = v ? "top" : "left", x = v ? "bottom" : "right", S = v ? "clientHeight" : "clientWidth", k = r.reference[b] + r.reference[m] - g[m] - r.floating[b], A = g[m] - r.reference[m], L = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
|
|
1173
1208
|
let B = L ? L[S] : 0;
|
|
1174
1209
|
(!B || !await (n.isElement == null ? void 0 : n.isElement(L))) && (B = a.floating[S] || r.floating[b]);
|
|
1175
|
-
const F = k / 2 - A / 2, M = B / 2 - u[b] / 2 - 1, T = me(h[p], M), w = me(h[x], M), _ = B - u[b] - w, $ = B / 2 - u[b] / 2 + F, I = go(T, $, _), R = !l.arrow &&
|
|
1210
|
+
const F = k / 2 - A / 2, M = B / 2 - u[b] / 2 - 1, T = me(h[p], M), w = me(h[x], M), _ = B - u[b] - w, $ = B / 2 - u[b] / 2 + F, I = go(T, $, _), R = !l.arrow && $e(i) != null && $ !== I && r.reference[b] / 2 - ($ < T ? T : w) - u[b] / 2 < 0, ee = R ? $ < T ? $ - T : $ - _ : 0;
|
|
1176
1211
|
return {
|
|
1177
1212
|
[m]: g[m] + ee,
|
|
1178
1213
|
data: {
|
|
@@ -1206,10 +1241,10 @@ const Es = 50, $s = async (o, e, t) => {
|
|
|
1206
1241
|
fallbackAxisSideDirection: b = "none",
|
|
1207
1242
|
flipAlignment: u = !0,
|
|
1208
1243
|
...v
|
|
1209
|
-
} =
|
|
1244
|
+
} = Ee(o, e);
|
|
1210
1245
|
if ((t = r.arrow) != null && t.alignmentOffset)
|
|
1211
1246
|
return {};
|
|
1212
|
-
const p = xe(i), x = se(a), S = xe(a) === a, k = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), A = g || (S || !u ? [
|
|
1247
|
+
const p = xe(i), x = se(a), S = xe(a) === a, k = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), A = g || (S || !u ? [tt(a)] : Ts(a)), L = b !== "none";
|
|
1213
1248
|
!g && L && A.push(...Ms(a, u, b, k));
|
|
1214
1249
|
const B = [a, ...A], F = await l.detectOverflow(e, v), M = [];
|
|
1215
1250
|
let T = ((s = r.flip) == null ? void 0 : s.overflows) || [];
|
|
@@ -1272,7 +1307,7 @@ async function Ns(o, e) {
|
|
|
1272
1307
|
placement: t,
|
|
1273
1308
|
platform: s,
|
|
1274
1309
|
elements: i
|
|
1275
|
-
} = o, r = await (s.isRTL == null ? void 0 : s.isRTL(i.floating)), n = xe(t), a =
|
|
1310
|
+
} = o, r = await (s.isRTL == null ? void 0 : s.isRTL(i.floating)), n = xe(t), a = $e(t), l = se(t) === "y", c = zs.has(n) ? -1 : 1, d = r && l ? -1 : 1, h = Ee(e, o);
|
|
1276
1311
|
let {
|
|
1277
1312
|
mainAxis: g,
|
|
1278
1313
|
crossAxis: m,
|
|
@@ -1342,7 +1377,7 @@ const Rs = function(o) {
|
|
|
1342
1377
|
}
|
|
1343
1378
|
},
|
|
1344
1379
|
...c
|
|
1345
|
-
} =
|
|
1380
|
+
} = Ee(o, e), d = {
|
|
1346
1381
|
x: t,
|
|
1347
1382
|
y: s
|
|
1348
1383
|
}, h = await r.detectOverflow(e, c), g = se(i), m = bo(g);
|
|
@@ -1381,7 +1416,7 @@ const Rs = function(o) {
|
|
|
1381
1416
|
apply: n = () => {
|
|
1382
1417
|
},
|
|
1383
1418
|
...a
|
|
1384
|
-
} =
|
|
1419
|
+
} = Ee(o, e), l = await i.detectOverflow(e, a), c = xe(t), d = $e(t), h = se(t) === "y", {
|
|
1385
1420
|
width: g,
|
|
1386
1421
|
height: m
|
|
1387
1422
|
} = s.floating;
|
|
@@ -1406,7 +1441,7 @@ const Rs = function(o) {
|
|
|
1406
1441
|
function rt() {
|
|
1407
1442
|
return typeof window < "u";
|
|
1408
1443
|
}
|
|
1409
|
-
function
|
|
1444
|
+
function Ve(o) {
|
|
1410
1445
|
return yo(o) ? (o.nodeName || "").toLowerCase() : "#document";
|
|
1411
1446
|
}
|
|
1412
1447
|
function U(o) {
|
|
@@ -1439,7 +1474,7 @@ function nt(o) {
|
|
|
1439
1474
|
return /auto|scroll|overlay|hidden|clip/.test(e + s + t) && i !== "inline" && i !== "contents";
|
|
1440
1475
|
}
|
|
1441
1476
|
function Hs(o) {
|
|
1442
|
-
return /^(table|td|th)$/.test(
|
|
1477
|
+
return /^(table|td|th)$/.test(Ve(o));
|
|
1443
1478
|
}
|
|
1444
1479
|
function at(o) {
|
|
1445
1480
|
try {
|
|
@@ -1461,7 +1496,7 @@ function Mt(o) {
|
|
|
1461
1496
|
}
|
|
1462
1497
|
function js(o) {
|
|
1463
1498
|
let e = _e(o);
|
|
1464
|
-
for (; ue(e) && !
|
|
1499
|
+
for (; ue(e) && !Be(e); ) {
|
|
1465
1500
|
if (Mt(e))
|
|
1466
1501
|
return e;
|
|
1467
1502
|
if (at(e))
|
|
@@ -1473,8 +1508,8 @@ function js(o) {
|
|
|
1473
1508
|
function At() {
|
|
1474
1509
|
return ht == null && (ht = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), ht;
|
|
1475
1510
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return /^(html|body|#document)$/.test(
|
|
1511
|
+
function Be(o) {
|
|
1512
|
+
return /^(html|body|#document)$/.test(Ve(o));
|
|
1478
1513
|
}
|
|
1479
1514
|
function Z(o) {
|
|
1480
1515
|
return U(o).getComputedStyle(o);
|
|
@@ -1489,7 +1524,7 @@ function lt(o) {
|
|
|
1489
1524
|
};
|
|
1490
1525
|
}
|
|
1491
1526
|
function _e(o) {
|
|
1492
|
-
if (
|
|
1527
|
+
if (Ve(o) === "html")
|
|
1493
1528
|
return o;
|
|
1494
1529
|
const e = (
|
|
1495
1530
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -1502,17 +1537,17 @@ function _e(o) {
|
|
|
1502
1537
|
}
|
|
1503
1538
|
function wo(o) {
|
|
1504
1539
|
const e = _e(o);
|
|
1505
|
-
return
|
|
1540
|
+
return Be(e) ? (o.ownerDocument || o).body : ue(e) && nt(e) ? e : wo(e);
|
|
1506
1541
|
}
|
|
1507
|
-
function
|
|
1542
|
+
function Ke(o, e, t) {
|
|
1508
1543
|
var s;
|
|
1509
1544
|
e === void 0 && (e = []), t === void 0 && (t = !0);
|
|
1510
1545
|
const i = wo(o), r = i === ((s = o.ownerDocument) == null ? void 0 : s.body), n = U(i);
|
|
1511
1546
|
if (r) {
|
|
1512
1547
|
const a = yt(n);
|
|
1513
|
-
return e.concat(n, n.visualViewport || [], nt(i) ? i : [], a && t ?
|
|
1548
|
+
return e.concat(n, n.visualViewport || [], nt(i) ? i : [], a && t ? Ke(a) : []);
|
|
1514
1549
|
} else
|
|
1515
|
-
return e.concat(i,
|
|
1550
|
+
return e.concat(i, Ke(i, [], t));
|
|
1516
1551
|
}
|
|
1517
1552
|
function yt(o) {
|
|
1518
1553
|
return o.parent && Object.getPrototypeOf(o.parent) ? o.frameElement : null;
|
|
@@ -1520,7 +1555,7 @@ function yt(o) {
|
|
|
1520
1555
|
function xo(o) {
|
|
1521
1556
|
const e = Z(o);
|
|
1522
1557
|
let t = parseFloat(e.width) || 0, s = parseFloat(e.height) || 0;
|
|
1523
|
-
const i = ue(o), r = i ? o.offsetWidth : t, n = i ? o.offsetHeight : s, a =
|
|
1558
|
+
const i = ue(o), r = i ? o.offsetWidth : t, n = i ? o.offsetHeight : s, a = et(t) !== r || et(s) !== n;
|
|
1524
1559
|
return a && (t = r, s = n), {
|
|
1525
1560
|
width: t,
|
|
1526
1561
|
height: s,
|
|
@@ -1539,7 +1574,7 @@ function Ce(o) {
|
|
|
1539
1574
|
height: i,
|
|
1540
1575
|
$: r
|
|
1541
1576
|
} = xo(e);
|
|
1542
|
-
let n = (r ?
|
|
1577
|
+
let n = (r ? et(t.width) : t.width) / s, a = (r ? et(t.height) : t.height) / i;
|
|
1543
1578
|
return (!n || !Number.isFinite(n)) && (n = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
1544
1579
|
x: n,
|
|
1545
1580
|
y: a
|
|
@@ -1571,7 +1606,7 @@ function ke(o, e, t, s) {
|
|
|
1571
1606
|
l *= v.x, c *= v.y, d *= v.x, h *= v.y, l += S, c += k, b = U(u), u = yt(b);
|
|
1572
1607
|
}
|
|
1573
1608
|
}
|
|
1574
|
-
return
|
|
1609
|
+
return ot({
|
|
1575
1610
|
width: d,
|
|
1576
1611
|
height: h,
|
|
1577
1612
|
x: l,
|
|
@@ -1604,7 +1639,7 @@ function qs(o) {
|
|
|
1604
1639
|
scrollTop: 0
|
|
1605
1640
|
}, c = re(1);
|
|
1606
1641
|
const d = re(0), h = ue(s);
|
|
1607
|
-
if ((h || !r) && ((
|
|
1642
|
+
if ((h || !r) && ((Ve(s) !== "body" || nt(n)) && (l = lt(s)), h)) {
|
|
1608
1643
|
const m = ke(s);
|
|
1609
1644
|
c = Ce(s), d.x = m.x + s.clientLeft, d.y = m.y + s.clientTop;
|
|
1610
1645
|
}
|
|
@@ -1676,16 +1711,16 @@ function jt(o, e, t) {
|
|
|
1676
1711
|
height: e.height
|
|
1677
1712
|
};
|
|
1678
1713
|
}
|
|
1679
|
-
return
|
|
1714
|
+
return ot(s);
|
|
1680
1715
|
}
|
|
1681
1716
|
function ei(o, e) {
|
|
1682
1717
|
const t = e.get(o);
|
|
1683
1718
|
if (t)
|
|
1684
1719
|
return t;
|
|
1685
|
-
let s =
|
|
1720
|
+
let s = Ke(o, [], !1).filter((a) => Q(a) && Ve(a) !== "body"), i = null;
|
|
1686
1721
|
const r = Z(o).position === "fixed";
|
|
1687
1722
|
let n = r ? _e(o) : o;
|
|
1688
|
-
for (; Q(n) && !
|
|
1723
|
+
for (; Q(n) && !Be(n); ) {
|
|
1689
1724
|
const a = Z(n), l = Mt(n), c = i ? i.position : r ? "fixed" : "";
|
|
1690
1725
|
!l && (c === "fixed" || c === "absolute" && a.position === "static") ? s = s.filter((h) => h !== n) : i = a, n = _e(n);
|
|
1691
1726
|
}
|
|
@@ -1728,7 +1763,7 @@ function si(o, e, t) {
|
|
|
1728
1763
|
scrollTop: 0
|
|
1729
1764
|
};
|
|
1730
1765
|
const l = re(0);
|
|
1731
|
-
if ((s || !r) && ((
|
|
1766
|
+
if ((s || !r) && ((Ve(e) !== "body" || nt(i)) && (a = lt(e)), s)) {
|
|
1732
1767
|
const g = ke(e, !0, r, e);
|
|
1733
1768
|
l.x = g.x + e.clientLeft, l.y = g.y + e.clientTop;
|
|
1734
1769
|
}
|
|
@@ -1758,7 +1793,7 @@ function Co(o, e) {
|
|
|
1758
1793
|
return t;
|
|
1759
1794
|
if (!ue(o)) {
|
|
1760
1795
|
let i = _e(o);
|
|
1761
|
-
for (; i && !
|
|
1796
|
+
for (; i && !Be(i); ) {
|
|
1762
1797
|
if (Q(i) && !pt(i))
|
|
1763
1798
|
return i;
|
|
1764
1799
|
i = _e(i);
|
|
@@ -1768,7 +1803,7 @@ function Co(o, e) {
|
|
|
1768
1803
|
let s = Ut(o, e);
|
|
1769
1804
|
for (; s && Hs(s) && pt(s); )
|
|
1770
1805
|
s = Ut(s, e);
|
|
1771
|
-
return s &&
|
|
1806
|
+
return s && Be(s) && pt(s) && !Mt(s) ? t : s || js(o) || t;
|
|
1772
1807
|
}
|
|
1773
1808
|
const ii = async function(o) {
|
|
1774
1809
|
const e = this.getOffsetParent || Co, t = this.getDimensions, s = await t(o.floating);
|
|
@@ -1817,7 +1852,7 @@ function ni(o, e, t) {
|
|
|
1817
1852
|
} = g;
|
|
1818
1853
|
if (d || e(), !u || !v)
|
|
1819
1854
|
return;
|
|
1820
|
-
const p =
|
|
1855
|
+
const p = Je(b), x = Je(r.clientWidth - (m + u)), S = Je(r.clientHeight - (b + v)), k = Je(m), L = {
|
|
1821
1856
|
rootMargin: -p + "px " + -x + "px " + -S + "px " + -k + "px",
|
|
1822
1857
|
threshold: ie(0, me(1, h)) || 1
|
|
1823
1858
|
};
|
|
@@ -1859,7 +1894,7 @@ function ai(o, e, t, s) {
|
|
|
1859
1894
|
elementResize: n = typeof ResizeObserver == "function",
|
|
1860
1895
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
1861
1896
|
animationFrame: l = !1
|
|
1862
|
-
} = s, c = Lt(o), d = i || r ? [...c ?
|
|
1897
|
+
} = s, c = Lt(o), d = i || r ? [...c ? Ke(c) : [], ...e ? Ke(e) : []] : [];
|
|
1863
1898
|
d.forEach((p) => {
|
|
1864
1899
|
i && p.addEventListener("scroll", t), r && p.addEventListener("resize", t);
|
|
1865
1900
|
});
|
|
@@ -2071,7 +2106,7 @@ function _i(o) {
|
|
|
2071
2106
|
}
|
|
2072
2107
|
};
|
|
2073
2108
|
}
|
|
2074
|
-
const Io = ["INIT", "DATA", "UI", "INTERACTION"], ae = ks("MULTISELECT", Io),
|
|
2109
|
+
const Io = ["INIT", "DATA", "UI", "INTERACTION"], ae = ks("MULTISELECT", Io), Xe = ae.loggers.INIT, H = ae.loggers.DATA, Y = ae.loggers.UI, j = ae.loggers.INTERACTION, Ki = Io.map((o) => `MULTISELECT:${o}`);
|
|
2075
2110
|
function Hi() {
|
|
2076
2111
|
ae.enableLogging();
|
|
2077
2112
|
}
|
|
@@ -2222,14 +2257,14 @@ function Yt(o) {
|
|
|
2222
2257
|
...o
|
|
2223
2258
|
};
|
|
2224
2259
|
}
|
|
2225
|
-
const
|
|
2260
|
+
const Ne = (o) => !o || typeof o == "string" && o.trim() === "";
|
|
2226
2261
|
function ki(o, e = ".") {
|
|
2227
2262
|
if (!o || typeof o != "string") return null;
|
|
2228
2263
|
const t = o.lastIndexOf(e);
|
|
2229
2264
|
return t === -1 ? "" : o.substring(0, t);
|
|
2230
2265
|
}
|
|
2231
2266
|
function Qt(o, e, t = ".") {
|
|
2232
|
-
return
|
|
2267
|
+
return Ne(e) ? o : o.startsWith(e + t) ? o.substring(e.length + t.length) : o;
|
|
2233
2268
|
}
|
|
2234
2269
|
function Zt(o, e = 0, t = 1, s = ".") {
|
|
2235
2270
|
return o.split(s).slice(e, e + t).join(s);
|
|
@@ -2241,7 +2276,7 @@ function ce(o, e) {
|
|
|
2241
2276
|
return o[e];
|
|
2242
2277
|
}
|
|
2243
2278
|
function Si(o = {}) {
|
|
2244
|
-
const e = o.idMember, t = o.pathMember, s = o.getPathCallback, i = o.parentPathMember, r = o.levelMember, n = o.hasChildrenMember, a = o.isSelectableMember, l = o.getIsSelectableCallback, c = o.treeId || "multiselect-tree", d = o.orderMember, h = o.getDisplayValueCallback, g =
|
|
2279
|
+
const e = o.idMember, t = o.pathMember, s = o.getPathCallback, i = o.parentPathMember, r = o.levelMember, n = o.hasChildrenMember, a = o.isSelectableMember, l = o.getIsSelectableCallback, c = o.treeId || "multiselect-tree", d = o.orderMember, h = o.getDisplayValueCallback, g = Ne(i), m = Ne(r), b = Ne(n), u = Ne(a), v = "x", p = o.treePathSeparator || ".", x = Yt();
|
|
2245
2280
|
let S = 0, k = null;
|
|
2246
2281
|
const A = (M) => s ? s(M) : t ? ce(M, t) : void 0, L = {
|
|
2247
2282
|
treePathSeparator: p,
|
|
@@ -2349,7 +2384,7 @@ function Et(o, e, t) {
|
|
|
2349
2384
|
for (const r of s) t.has(r) && i++;
|
|
2350
2385
|
return i === 0 ? "unchecked" : i === s.length ? "checked" : "indeterminate";
|
|
2351
2386
|
}
|
|
2352
|
-
function
|
|
2387
|
+
function De(o, e) {
|
|
2353
2388
|
const t = /* @__PURE__ */ new Set();
|
|
2354
2389
|
for (const s of e) {
|
|
2355
2390
|
const i = o.nodeByValue.get(String(s));
|
|
@@ -2630,7 +2665,7 @@ class Ii {
|
|
|
2630
2665
|
return i ? i.isSelectable !== !1 : !0;
|
|
2631
2666
|
}
|
|
2632
2667
|
init() {
|
|
2633
|
-
this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(),
|
|
2668
|
+
this.parseOptions(), this.buildHTML(), this.attachEvents(), this.parseInitialSelection(), Xe.debug(`Initialized [${this.instanceId}] with options:`, {
|
|
2634
2669
|
placeholder: this.options.searchPlaceholder,
|
|
2635
2670
|
totalOptions: this.allOptions.length,
|
|
2636
2671
|
isCloseOnSelect: this.options.isCloseOnSelect,
|
|
@@ -2684,7 +2719,7 @@ class Ii {
|
|
|
2684
2719
|
}
|
|
2685
2720
|
/** Refresh the derived checked-atom set from the emitted `selectedValues`. */
|
|
2686
2721
|
refreshCascadeAtoms() {
|
|
2687
|
-
this.isCascadeMode() && this.cascadeIndex && (this.cascadeCheckedAtoms =
|
|
2722
|
+
this.isCascadeMode() && this.cascadeIndex && (this.cascadeCheckedAtoms = De(this.cascadeIndex, this.selectedValues));
|
|
2688
2723
|
}
|
|
2689
2724
|
/**
|
|
2690
2725
|
* Toggle a tree node in cascade mode: flip its whole subtree, re-project the
|
|
@@ -2692,7 +2727,7 @@ class Ii {
|
|
|
2692
2727
|
* so badges / form / change events reflect the policy (rolled-up branches, etc.).
|
|
2693
2728
|
*/
|
|
2694
2729
|
toggleTreeCascade(e) {
|
|
2695
|
-
const t = this.cascadeIndex, s =
|
|
2730
|
+
const t = this.cascadeIndex, s = De(t, this.selectedValues), { checkedAtoms: i } = Ti(t, e, s);
|
|
2696
2731
|
this.commitCascadeAtoms(i);
|
|
2697
2732
|
}
|
|
2698
2733
|
/**
|
|
@@ -2811,14 +2846,14 @@ class Ii {
|
|
|
2811
2846
|
}
|
|
2812
2847
|
buildHTML() {
|
|
2813
2848
|
const e = this.options.container || document.body, t = this.element.getRootNode(), s = t instanceof ShadowRoot ? t.host : this.element, i = s.getAttribute("dir") === "rtl", r = s.closest('[dir="rtl"]') !== null;
|
|
2814
|
-
this.isRTL = i || r,
|
|
2849
|
+
this.isRTL = i || r, Xe.debug(`[${this.instanceId}] RTL Debug:`, {
|
|
2815
2850
|
isShadowRoot: t instanceof ShadowRoot,
|
|
2816
2851
|
hostElement: s,
|
|
2817
2852
|
elementDir: s.getAttribute("dir"),
|
|
2818
2853
|
hasElementDir: i,
|
|
2819
2854
|
hasAncestorDir: r,
|
|
2820
2855
|
isRTL: this.isRTL
|
|
2821
|
-
}), this.effectiveBadgesPosition = this.options.badgesPosition || "bottom", this.isRTL && (this.effectiveBadgesPosition === "left" ? this.effectiveBadgesPosition = "right" : this.effectiveBadgesPosition === "right" && (this.effectiveBadgesPosition = "left")), this.element.classList.add("ms"), this.isRTL && (this.element.classList.add("ms--rtl"),
|
|
2856
|
+
}), this.effectiveBadgesPosition = this.options.badgesPosition || "bottom", this.isRTL && (this.effectiveBadgesPosition === "left" ? this.effectiveBadgesPosition = "right" : this.effectiveBadgesPosition === "right" && (this.effectiveBadgesPosition = "left")), this.element.classList.add("ms"), this.isRTL && (this.element.classList.add("ms--rtl"), Xe.debug(`[${this.instanceId}] Added ms--rtl class to element`)), (!this.options.isCheckboxesShown || !this.options.isMultipleEnabled) && this.element.classList.add("ms--no-checkboxes");
|
|
2822
2857
|
const n = document.createElement("div");
|
|
2823
2858
|
n.className = "ms__input-wrapper", this.input = document.createElement("input"), this.input.type = "text", this.input.className = "ms__input", this.input.placeholder = this.getPlaceholderText(), this.input.autocomplete = "off", this.options.searchInputMode === "readonly" ? this.input.readOnly = !0 : this.options.searchInputMode === "hidden" && (this.input.style.display = "none");
|
|
2824
2859
|
const a = document.createElement("span");
|
|
@@ -3440,7 +3475,7 @@ class Ii {
|
|
|
3440
3475
|
if (this.isCascadeMode() && this.cascadeIndex) {
|
|
3441
3476
|
const i = this.cascadeIndex.nodeByValue.get(s);
|
|
3442
3477
|
if (i) {
|
|
3443
|
-
const r = this.cascadeIndex.atomsUnder.get(i.path) ?? [], n = new Set(
|
|
3478
|
+
const r = this.cascadeIndex.atomsUnder.get(i.path) ?? [], n = new Set(De(this.cascadeIndex, this.selectedValues));
|
|
3444
3479
|
for (const a of r) n.delete(a);
|
|
3445
3480
|
this.commitCascadeAtoms(n);
|
|
3446
3481
|
return;
|
|
@@ -3450,7 +3485,7 @@ class Ii {
|
|
|
3450
3485
|
}
|
|
3451
3486
|
selectAll() {
|
|
3452
3487
|
if (this.isCascadeMode() && this.cascadeIndex) {
|
|
3453
|
-
const t = this.cascadeIndex, s = new Set(
|
|
3488
|
+
const t = this.cascadeIndex, s = new Set(De(t, this.selectedValues));
|
|
3454
3489
|
for (const i of this.treeNodes)
|
|
3455
3490
|
t.atomPaths.has(i.path) && (this.getItemDisabled(i.data) || s.add(String(this.getItemValue(i.data))));
|
|
3456
3491
|
this.commitCascadeAtoms(s);
|
|
@@ -3760,7 +3795,7 @@ class Ii {
|
|
|
3760
3795
|
Object.assign(this.options, e);
|
|
3761
3796
|
const i = "pathMember" in e || "getPathCallback" in e || "parentPathMember" in e || "levelMember" in e || "hasChildrenMember" in e || "treePathSeparator" in e || "isTreeEnabled" in e || "isSelectableMember" in e || "getIsSelectableCallback" in e;
|
|
3762
3797
|
if ("options" in e && e.options !== void 0 ? (this.allOptions = e.options, this.reconcileSelectedOptions(), this.isTreeMode() ? this.buildTree() : this.filteredOptions = this.searchTerm ? this.filteredOptions : [...this.allOptions]) : i && (this.isTreeMode() ? this.buildTree() : this.filteredOptions = this.searchTerm ? this.filteredOptions : [...this.allOptions]), ("checkboxMode" in e || "cascadeSelectPolicy" in e) && !i && !("options" in e) && this.isTreeMode() && (this.cascadeIndex = this.isCascadeMode() ? eo(this.tree, (a) => String(this.getItemValue(a))) : null, this.isCascadeMode() && this.cascadeIndex)) {
|
|
3763
|
-
this.cascadeCheckedAtoms =
|
|
3798
|
+
this.cascadeCheckedAtoms = De(this.cascadeIndex, this.selectedValues);
|
|
3764
3799
|
const a = mt(
|
|
3765
3800
|
this.cascadeIndex,
|
|
3766
3801
|
this.cascadeCheckedAtoms,
|
|
@@ -3973,7 +4008,7 @@ ${s}` : t;
|
|
|
3973
4008
|
// PUBLIC API
|
|
3974
4009
|
// ========================================================================
|
|
3975
4010
|
destroy() {
|
|
3976
|
-
this.destroyAllTooltips(), this.searchDebounceTimer && (clearTimeout(this.searchDebounceTimer), this.searchDebounceTimer = void 0), this.abortInFlightSearch(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.documentClickHandler && (document.removeEventListener("click", this.documentClickHandler), this.documentClickHandler = null), this.documentKeydownHandler && (document.removeEventListener("keydown", this.documentKeydownHandler), this.documentKeydownHandler = null), this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ms", "ms--open", "ms--no-checkboxes"),
|
|
4011
|
+
this.destroyAllTooltips(), this.searchDebounceTimer && (clearTimeout(this.searchDebounceTimer), this.searchDebounceTimer = void 0), this.abortInFlightSearch(), this.dropdownCleanup && this.dropdownCleanup(), this.hintCleanup && this.hintCleanup(), this.selectedPopoverCleanup && this.selectedPopoverCleanup(), this.documentClickHandler && (document.removeEventListener("click", this.documentClickHandler), this.documentClickHandler = null), this.documentKeydownHandler && (document.removeEventListener("keydown", this.documentKeydownHandler), this.documentKeydownHandler = null), this.virtualScroll && (this.virtualScroll.destroy(), this.virtualScroll = null), this.dropdown && this.dropdown.remove(), this.hint && this.hint.remove(), this.selectedPopover && this.selectedPopover.remove(), this.element.innerHTML = "", this.element.classList.remove("ms", "ms--open", "ms--no-checkboxes"), Xe.info(`[${this.instanceId}] Component destroyed`);
|
|
3977
4012
|
}
|
|
3978
4013
|
}
|
|
3979
4014
|
function Oi() {
|
|
@@ -4209,7 +4244,7 @@ const Oo = `@layer variables,component,overrides;@layer variables{:host{display:
|
|
|
4209
4244
|
{ name: "select", description: "An option was selected. `detail.option` is the selected option; `detail.selectedOptions`/`detail.selectedValues` are the full selection." },
|
|
4210
4245
|
{ name: "deselect", description: "An option was removed from the selection. `detail.option` is that option." },
|
|
4211
4246
|
{ name: "change", description: "The selection changed. `detail.selectedOptions`/`detail.selectedValues` are the full selection." }
|
|
4212
|
-
], ro = /* @__PURE__ */ new Set(["dropdownWidth", "selectedPopoverWidth", "showDebugInfo", "initialValues", "optionsSource", "optionsFormat", "optionsSplitter", "optionsRowSplitter"]),
|
|
4247
|
+
], ro = /* @__PURE__ */ new Set(["dropdownWidth", "selectedPopoverWidth", "showDebugInfo", "initialValues", "optionsSource", "optionsFormat", "optionsSplitter", "optionsRowSplitter"]), Ye = {
|
|
4213
4248
|
dropdownWidth: "--ms-dropdown-width",
|
|
4214
4249
|
selectedPopoverWidth: "--ms-selected-popover-width"
|
|
4215
4250
|
};
|
|
@@ -4225,29 +4260,23 @@ const Ri = [
|
|
|
4225
4260
|
{ key: "subtitleMember", member: "subtitle", callbackKey: "getSubtitleCallback" },
|
|
4226
4261
|
{ key: "disabledMember", member: "disabled", callbackKey: "getDisabledCallback" }
|
|
4227
4262
|
];
|
|
4228
|
-
var X, N, pe,
|
|
4229
|
-
class
|
|
4263
|
+
var X, N, pe, je, Ue, Ge, Ae, Le, we, O, _t, kt, Po, Mo, Ao, Qe, Ct, Lo, Eo, $o, St, Vo, Do, Tt, It;
|
|
4264
|
+
class Re extends ut {
|
|
4230
4265
|
constructor() {
|
|
4231
4266
|
super();
|
|
4232
4267
|
V(this, O);
|
|
4233
4268
|
V(this, X);
|
|
4234
4269
|
V(this, N);
|
|
4235
4270
|
V(this, pe);
|
|
4236
|
-
V(this,
|
|
4237
|
-
V(this, We, null);
|
|
4271
|
+
V(this, je, null);
|
|
4238
4272
|
// Dev-mode customStylesCallback lint: unknown --ms-* names already warned about.
|
|
4239
|
-
V(this,
|
|
4273
|
+
V(this, Ue, /* @__PURE__ */ new Set());
|
|
4240
4274
|
// Declarative <option>/<optgroup> state (parsed once from light DOM).
|
|
4241
|
-
V(this,
|
|
4242
|
-
V(this,
|
|
4243
|
-
V(this,
|
|
4275
|
+
V(this, Ge, !1);
|
|
4276
|
+
V(this, Ae, !1);
|
|
4277
|
+
V(this, Le);
|
|
4244
4278
|
V(this, we);
|
|
4245
|
-
|
|
4246
|
-
try {
|
|
4247
|
-
z(this, it, this.attachInternals());
|
|
4248
|
-
} catch {
|
|
4249
|
-
}
|
|
4250
|
-
ds(f(this, X), Oo), typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => this.setAttribute("data-ready", "")) : this.setAttribute("data-ready", "");
|
|
4279
|
+
z(this, X, this.attachShadow({ mode: "open" })), ds(f(this, X), Oo), typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => this.setAttribute("data-ready", "")) : this.setAttribute("data-ready", "");
|
|
4251
4280
|
}
|
|
4252
4281
|
/**
|
|
4253
4282
|
* Called by the browser when the surrounding <form> is reset. Clears the
|
|
@@ -4310,7 +4339,7 @@ class Ne extends ut {
|
|
|
4310
4339
|
(t = f(this, N)) == null || t.destroy();
|
|
4311
4340
|
}
|
|
4312
4341
|
}
|
|
4313
|
-
X = new WeakMap(), N = new WeakMap(), pe = new WeakMap(),
|
|
4342
|
+
X = new WeakMap(), N = new WeakMap(), pe = new WeakMap(), je = new WeakMap(), Ue = new WeakMap(), Ge = new WeakMap(), Ae = new WeakMap(), Le = new WeakMap(), we = new WeakMap(), O = new WeakSet(), // ── picker lifecycle ──────────────────────────────────────────────────────
|
|
4314
4343
|
_t = function() {
|
|
4315
4344
|
var t;
|
|
4316
4345
|
(t = f(this, N)) == null || t.destroy(), z(this, N, void 0), C(this, O, kt).call(this);
|
|
@@ -4321,7 +4350,7 @@ _t = function() {
|
|
|
4321
4350
|
}, Po = function() {
|
|
4322
4351
|
if (f(this, pe)) return;
|
|
4323
4352
|
const t = document.createElement("div");
|
|
4324
|
-
t.setAttribute("data-multiselect", ""), this.className && (t.className = this.className), f(this, X).appendChild(t), z(this,
|
|
4353
|
+
t.setAttribute("data-multiselect", ""), this.className && (t.className = this.className), f(this, X).appendChild(t), z(this, je, hs(f(this, X), { position: "first", className: "ms-custom-styles" })), z(this, pe, t);
|
|
4325
4354
|
}, /**
|
|
4326
4355
|
* Build the picker config from the merged `this.config`, minus the keys the
|
|
4327
4356
|
* picker doesn't own, plus the runtime wiring (event bridges, container, host,
|
|
@@ -4333,8 +4362,8 @@ Mo = function() {
|
|
|
4333
4362
|
for (const i of Object.keys(t))
|
|
4334
4363
|
t[i] === null && delete t[i];
|
|
4335
4364
|
let s = t.options;
|
|
4336
|
-
if (f(this,
|
|
4337
|
-
s && s.length > 0 && H.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), s = f(this,
|
|
4365
|
+
if (f(this, Ae) && f(this, Le))
|
|
4366
|
+
s && s.length > 0 && H.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), s = f(this, Le);
|
|
4338
4367
|
else if (!s || s.length === 0) {
|
|
4339
4368
|
const i = this.config.optionsSource;
|
|
4340
4369
|
if (i != null) {
|
|
@@ -4345,7 +4374,7 @@ Mo = function() {
|
|
|
4345
4374
|
a && H.error(`[MultiSelectElement] ${a}`), s = n;
|
|
4346
4375
|
}
|
|
4347
4376
|
}
|
|
4348
|
-
if (t.options = s, f(this,
|
|
4377
|
+
if (t.options = s, f(this, Ae))
|
|
4349
4378
|
for (const { key: i, member: r, callbackKey: n } of Ri)
|
|
4350
4379
|
t[i] === void 0 && !t[n] && (t[i] = r);
|
|
4351
4380
|
return t.getCounterCallback || (t.getCounterCallback = (i, r) => r !== void 0 ? `+${r} more` : `${i} selected`), t.onSelect = (i) => {
|
|
@@ -4353,19 +4382,19 @@ Mo = function() {
|
|
|
4353
4382
|
this.emit("select", {
|
|
4354
4383
|
option: i,
|
|
4355
4384
|
selectedOptions: ((r = f(this, N)) == null ? void 0 : r.getSelected()) ?? [],
|
|
4356
|
-
selectedValues: C(this, O,
|
|
4385
|
+
selectedValues: C(this, O, Qe).call(this)
|
|
4357
4386
|
});
|
|
4358
4387
|
}, t.onDeselect = (i) => {
|
|
4359
4388
|
var r;
|
|
4360
4389
|
this.emit("deselect", {
|
|
4361
4390
|
option: i,
|
|
4362
4391
|
selectedOptions: ((r = f(this, N)) == null ? void 0 : r.getSelected()) ?? [],
|
|
4363
|
-
selectedValues: C(this, O,
|
|
4392
|
+
selectedValues: C(this, O, Qe).call(this)
|
|
4364
4393
|
});
|
|
4365
4394
|
}, t.onChange = (i) => {
|
|
4366
4395
|
this.emit("change", {
|
|
4367
4396
|
selectedOptions: i,
|
|
4368
|
-
selectedValues: C(this, O,
|
|
4397
|
+
selectedValues: C(this, O, Qe).call(this)
|
|
4369
4398
|
});
|
|
4370
4399
|
}, t.container = f(this, X), t.hostElement = this, t;
|
|
4371
4400
|
}, Ao = function() {
|
|
@@ -4373,13 +4402,13 @@ Mo = function() {
|
|
|
4373
4402
|
return f(this, we);
|
|
4374
4403
|
const t = this.config.initialValues;
|
|
4375
4404
|
return t && t.length > 0 ? t : void 0;
|
|
4376
|
-
},
|
|
4405
|
+
}, Qe = function() {
|
|
4377
4406
|
var s;
|
|
4378
4407
|
const t = (s = f(this, N)) == null ? void 0 : s.getValue();
|
|
4379
4408
|
return t == null ? [] : Array.isArray(t) ? t : [t];
|
|
4380
4409
|
}, // ── §12.8 custom styles ───────────────────────────────────────────────────
|
|
4381
4410
|
Ct = function() {
|
|
4382
|
-
const t = f(this,
|
|
4411
|
+
const t = f(this, je);
|
|
4383
4412
|
if (!t) return;
|
|
4384
4413
|
const s = this.config.customStylesCallback;
|
|
4385
4414
|
if (typeof s != "function") {
|
|
@@ -4405,23 +4434,23 @@ Lo = function(t) {
|
|
|
4405
4434
|
const s = Ni();
|
|
4406
4435
|
if (s.size !== 0)
|
|
4407
4436
|
for (const { name: i, suggestions: r } of fs(t, { prefix: "--ms-", consumed: s }))
|
|
4408
|
-
f(this,
|
|
4437
|
+
f(this, Ue).has(i) || (f(this, Ue).add(i), console.warn(
|
|
4409
4438
|
`[web-multiselect] customStylesCallback sets "${i}", which no web-multiselect style consumes — it will have no effect.` + (r.length ? ` Did you mean: ${r.join(", ")}?` : "") + " (If it's for your own custom-rendered content, ignore this.)"
|
|
4410
4439
|
));
|
|
4411
4440
|
}, // ── CSS-var sugar ─────────────────────────────────────────────────────────
|
|
4412
4441
|
Eo = function() {
|
|
4413
|
-
for (const t of Object.keys(
|
|
4442
|
+
for (const t of Object.keys(Ye)) C(this, O, St).call(this, Ye[t], this.config[t]);
|
|
4414
4443
|
}, $o = function(t) {
|
|
4415
|
-
for (const s of Object.keys(
|
|
4416
|
-
s in t && C(this, O, St).call(this,
|
|
4444
|
+
for (const s of Object.keys(Ye))
|
|
4445
|
+
s in t && C(this, O, St).call(this, Ye[s], t[s]);
|
|
4417
4446
|
}, St = function(t, s) {
|
|
4418
4447
|
s == null || s === "" ? this.style.removeProperty(t) : this.style.setProperty(t, String(s));
|
|
4419
4448
|
}, // ── declarative <option> parsing (light DOM, once) ────────────────────────
|
|
4420
4449
|
Vo = function() {
|
|
4421
|
-
if (f(this,
|
|
4422
|
-
z(this,
|
|
4450
|
+
if (f(this, Ge)) return;
|
|
4451
|
+
z(this, Ge, !0);
|
|
4423
4452
|
const t = C(this, O, Do).call(this);
|
|
4424
|
-
t && (z(this,
|
|
4453
|
+
t && (z(this, Le, t), z(this, Ae, !0));
|
|
4425
4454
|
}, Do = function() {
|
|
4426
4455
|
const t = Array.from(this.children);
|
|
4427
4456
|
if (t.length === 0) return null;
|
|
@@ -4462,7 +4491,7 @@ Tt = function() {
|
|
|
4462
4491
|
var l, c, d, h;
|
|
4463
4492
|
const t = f(this, X).querySelector(".ms__debug-stats");
|
|
4464
4493
|
if (!t || !f(this, N)) return;
|
|
4465
|
-
const s = "2.0.0-
|
|
4494
|
+
const s = "2.0.0-rc02", i = typeof window < "u" && ((c = (l = window.components) == null ? void 0 : l["web-multiselect"]) == null ? void 0 : c.getInstances().length) || 0, r = f(this, N).getSelected().length, n = ((d = this.config.options) == null ? void 0 : d.length) || 0, a = f(this, N);
|
|
4466
4495
|
t.innerHTML = `
|
|
4467
4496
|
<span>Version: ${s}</span>
|
|
4468
4497
|
<span>Total Instances: ${i}</span>
|
|
@@ -4477,12 +4506,12 @@ Tt = function() {
|
|
|
4477
4506
|
}, 500);
|
|
4478
4507
|
}, // Opt into the form-associated custom element lifecycle so form.reset() and
|
|
4479
4508
|
// form.elements see the control.
|
|
4480
|
-
y(
|
|
4481
|
-
typeof customElements < "u" && !customElements.get("web-multiselect") && customElements.define("web-multiselect",
|
|
4482
|
-
ls("web-multiselect",
|
|
4509
|
+
y(Re, "formAssociated", !0), y(Re, "inputs", Vi), y(Re, "events", Di);
|
|
4510
|
+
typeof customElements < "u" && !customElements.get("web-multiselect") && customElements.define("web-multiselect", Re);
|
|
4511
|
+
ls("web-multiselect", Re, {
|
|
4483
4512
|
config: {
|
|
4484
4513
|
name: "@keenmate/web-multiselect",
|
|
4485
|
-
version: "2.0.0-
|
|
4514
|
+
version: "2.0.0-rc02",
|
|
4486
4515
|
author: "Keenmate",
|
|
4487
4516
|
license: "MIT",
|
|
4488
4517
|
repository: "git+https://github.com/keenmate/web-multiselect.git",
|
|
@@ -4492,13 +4521,13 @@ ls("web-multiselect", Ne, {
|
|
|
4492
4521
|
});
|
|
4493
4522
|
export {
|
|
4494
4523
|
Ki as LOGGING_CATEGORIES,
|
|
4495
|
-
|
|
4524
|
+
Re as MultiSelectElement,
|
|
4496
4525
|
Pi as OPTIONS_FORMATS,
|
|
4497
4526
|
Ii as WebMultiSelect,
|
|
4498
4527
|
H as dataLogger,
|
|
4499
4528
|
Fi as disableLogging,
|
|
4500
4529
|
Hi as enableLogging,
|
|
4501
|
-
|
|
4530
|
+
Xe as initLogger,
|
|
4502
4531
|
j as interactionLogger,
|
|
4503
4532
|
Mi as parseOptionsData,
|
|
4504
4533
|
ji as setCategoryLevel,
|