@keenmate/web-multiselect 2.2.0-rc02 → 2.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 +9 -16
- package/custom-elements.json +77 -0
- package/dist/index.d.ts +152 -36
- package/dist/multiselect.js +468 -397
- package/dist/multiselect.umd.js +11 -11
- package/package.json +1 -1
- package/web-types.json +1 -1
package/dist/multiselect.js
CHANGED
|
@@ -179,9 +179,9 @@ const so = {
|
|
|
179
179
|
}, Yo = { mobile: 640, tablet: 1024, desktop: 1 / 0 };
|
|
180
180
|
let xt = oo(Yo);
|
|
181
181
|
const rt = /* @__PURE__ */ new Set(), nt = /* @__PURE__ */ new Set();
|
|
182
|
-
let
|
|
182
|
+
let Me = null, It = [], _t = !1;
|
|
183
183
|
const Is = 30;
|
|
184
|
-
let
|
|
184
|
+
let ze, kt = 0;
|
|
185
185
|
function oo(s) {
|
|
186
186
|
return Object.entries(s).sort((e, t) => e[1] - t[1]);
|
|
187
187
|
}
|
|
@@ -222,19 +222,19 @@ let ei;
|
|
|
222
222
|
function ti() {
|
|
223
223
|
return ei ?? (ei = Qo());
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Xe(s) {
|
|
226
226
|
return gs() && window.matchMedia(s).matches;
|
|
227
227
|
}
|
|
228
228
|
function bs() {
|
|
229
229
|
if (!gs())
|
|
230
230
|
return { ...so };
|
|
231
|
-
const s =
|
|
231
|
+
const s = Xe("(any-pointer: coarse)"), e = Xe("(pointer: coarse)"), t = Xe("(pointer: fine)"), o = Xe("(hover: hover)"), i = e ? "coarse" : t ? "fine" : "none", r = window.innerWidth, n = window.innerHeight, a = ti();
|
|
232
232
|
return {
|
|
233
233
|
pointer: i,
|
|
234
234
|
hasCoarsePointer: s,
|
|
235
235
|
canHover: o,
|
|
236
236
|
isTouchPrimary: e && !o,
|
|
237
|
-
orientation:
|
|
237
|
+
orientation: Xe("(orientation: portrait)") ? "portrait" : "landscape",
|
|
238
238
|
viewportWidth: r,
|
|
239
239
|
viewportHeight: n,
|
|
240
240
|
breakpoint: Zo(r),
|
|
@@ -250,27 +250,27 @@ function oi(s, e) {
|
|
|
250
250
|
return s.viewportWidth === e.viewportWidth && s.viewportHeight === e.viewportHeight;
|
|
251
251
|
}
|
|
252
252
|
function Ot() {
|
|
253
|
-
const s = bs(), e =
|
|
254
|
-
if (
|
|
253
|
+
const s = bs(), e = Me;
|
|
254
|
+
if (Me = s, !e || !si(e, s))
|
|
255
255
|
for (const t of [...rt])
|
|
256
256
|
t(s);
|
|
257
257
|
nt.size > 0 && (!e || !oi(e, s)) && ii();
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
const s =
|
|
259
|
+
function Ms() {
|
|
260
|
+
const s = Me;
|
|
261
261
|
if (s)
|
|
262
262
|
for (const e of [...nt])
|
|
263
263
|
e(s);
|
|
264
264
|
}
|
|
265
265
|
function ii() {
|
|
266
|
-
if (
|
|
266
|
+
if (ze !== void 0)
|
|
267
267
|
return;
|
|
268
268
|
const s = Date.now() - kt;
|
|
269
|
-
s >= Is ? (kt = Date.now(),
|
|
270
|
-
|
|
269
|
+
s >= Is ? (kt = Date.now(), Ms()) : ze = setTimeout(() => {
|
|
270
|
+
ze = void 0, kt = Date.now(), Ms();
|
|
271
271
|
}, Is - s);
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const Mt = () => Ot(), io = () => {
|
|
274
274
|
if (typeof requestAnimationFrame == "function") {
|
|
275
275
|
if (_t)
|
|
276
276
|
return;
|
|
@@ -281,14 +281,14 @@ const Pt = () => Ot(), io = () => {
|
|
|
281
281
|
Ot();
|
|
282
282
|
};
|
|
283
283
|
function ri(s) {
|
|
284
|
-
typeof s.addEventListener == "function" ? s.addEventListener("change",
|
|
284
|
+
typeof s.addEventListener == "function" ? s.addEventListener("change", Mt) : typeof s.addListener == "function" && s.addListener(Mt);
|
|
285
285
|
}
|
|
286
286
|
function ni(s) {
|
|
287
|
-
typeof s.removeEventListener == "function" ? s.removeEventListener("change",
|
|
287
|
+
typeof s.removeEventListener == "function" ? s.removeEventListener("change", Mt) : typeof s.removeListener == "function" && s.removeListener(Mt);
|
|
288
288
|
}
|
|
289
289
|
function ro() {
|
|
290
290
|
if (!gs()) {
|
|
291
|
-
|
|
291
|
+
Me = { ...so };
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
294
|
It = [
|
|
@@ -300,33 +300,33 @@ function ro() {
|
|
|
300
300
|
];
|
|
301
301
|
for (const s of It)
|
|
302
302
|
ri(s);
|
|
303
|
-
typeof window.addEventListener == "function" && window.addEventListener("resize", io),
|
|
303
|
+
typeof window.addEventListener == "function" && window.addEventListener("resize", io), Me = bs();
|
|
304
304
|
}
|
|
305
305
|
function no() {
|
|
306
306
|
for (const s of It)
|
|
307
307
|
ni(s);
|
|
308
|
-
It = [], typeof window < "u" && typeof window.removeEventListener == "function" && window.removeEventListener("resize", io), _t = !1,
|
|
308
|
+
It = [], typeof window < "u" && typeof window.removeEventListener == "function" && window.removeEventListener("resize", io), _t = !1, ze !== void 0 && (clearTimeout(ze), ze = void 0), kt = 0, Me = null;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Pt() {
|
|
311
311
|
return rt.size + nt.size;
|
|
312
312
|
}
|
|
313
313
|
function Lt() {
|
|
314
|
-
return
|
|
314
|
+
return Me ?? bs();
|
|
315
315
|
}
|
|
316
316
|
function ai(s, e = {}) {
|
|
317
|
-
const t =
|
|
317
|
+
const t = Pt() === 0;
|
|
318
318
|
rt.add(s), t && ro(), e.immediate !== !1 && s(Lt());
|
|
319
319
|
let o = !0;
|
|
320
320
|
return () => {
|
|
321
|
-
o && (o = !1, rt.delete(s),
|
|
321
|
+
o && (o = !1, rt.delete(s), Pt() === 0 && no());
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
function li(s, e = {}) {
|
|
325
|
-
const t =
|
|
325
|
+
const t = Pt() === 0;
|
|
326
326
|
nt.add(s), t && ro(), e.immediate !== !1 && s(Lt());
|
|
327
327
|
let o = !0;
|
|
328
328
|
return () => {
|
|
329
|
-
o && (o = !1, nt.delete(s),
|
|
329
|
+
o && (o = !1, nt.delete(s), Pt() === 0 && no());
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
332
|
function Sn(s) {
|
|
@@ -356,11 +356,11 @@ function pi(s, e) {
|
|
|
356
356
|
if (mi(s.lastFired, e) || (s.pendingSize = e, s.timer !== void 0))
|
|
357
357
|
return;
|
|
358
358
|
const t = Date.now() - s.lastNotify;
|
|
359
|
-
t >= s.throttleMs ? (s.lastNotify = Date.now(),
|
|
360
|
-
s.timer = void 0, s.lastNotify = Date.now(),
|
|
359
|
+
t >= s.throttleMs ? (s.lastNotify = Date.now(), Ps(s)) : s.timer = setTimeout(() => {
|
|
360
|
+
s.timer = void 0, s.lastNotify = Date.now(), Ps(s);
|
|
361
361
|
}, s.throttleMs - t);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Ps(s) {
|
|
364
364
|
const e = s.pendingSize;
|
|
365
365
|
e && (s.lastFired = e, s.cb(e, s.el));
|
|
366
366
|
}
|
|
@@ -444,29 +444,29 @@ function Ti(s) {
|
|
|
444
444
|
const Ii = typeof HTMLElement < "u" ? HTMLElement : class {
|
|
445
445
|
}, Ls = /* @__PURE__ */ new WeakSet();
|
|
446
446
|
let Oi = 0;
|
|
447
|
-
const
|
|
447
|
+
const Mi = { trace() {
|
|
448
448
|
}, debug() {
|
|
449
449
|
}, info() {
|
|
450
450
|
}, warn() {
|
|
451
451
|
}, error() {
|
|
452
|
-
} },
|
|
453
|
-
var
|
|
454
|
-
const
|
|
452
|
+
} }, Pi = new Proxy({}, { get: () => Mi });
|
|
453
|
+
var pe, ct, ke, dt, Ce, ht, Bt, Se, fe, Te, Ie, $e, Ve, De, Re, Be, He, Ht, ie, Fe, M, co, ho, uo, Z, mo, po, es, ts, tt, ss, fo;
|
|
454
|
+
const _e = class _e extends Ii {
|
|
455
455
|
constructor() {
|
|
456
456
|
super();
|
|
457
|
-
L(this,
|
|
458
|
-
L(this,
|
|
457
|
+
L(this, M);
|
|
458
|
+
L(this, pe, {});
|
|
459
459
|
L(this, ct, /* @__PURE__ */ new Map());
|
|
460
|
-
L(this,
|
|
460
|
+
L(this, ke, /* @__PURE__ */ new Map());
|
|
461
461
|
L(this, dt, /* @__PURE__ */ new Map());
|
|
462
462
|
/** Live handler currently bound via each managed `on<Name>` property, keyed by event name. */
|
|
463
|
-
L(this,
|
|
463
|
+
L(this, Ce, /* @__PURE__ */ new Map());
|
|
464
464
|
L(this, ht, Jo());
|
|
465
|
-
L(this, Bt, () => b(this,
|
|
466
|
-
L(this,
|
|
467
|
-
L(this,
|
|
468
|
-
L(this,
|
|
469
|
-
L(this,
|
|
465
|
+
L(this, Bt, () => b(this, M, ss).call(this));
|
|
466
|
+
L(this, Se, null);
|
|
467
|
+
L(this, fe, !1);
|
|
468
|
+
L(this, Te, []);
|
|
469
|
+
L(this, Ie, !1);
|
|
470
470
|
/**
|
|
471
471
|
* configKeys that carried a value assigned BEFORE the element was upgraded
|
|
472
472
|
* (`el.foo = …` before its class was defined). The browser fires the initial
|
|
@@ -476,25 +476,25 @@ const xe = class xe extends Ii {
|
|
|
476
476
|
* guarantee); post-connect attribute changes react normally. Cleared on first
|
|
477
477
|
* connect.
|
|
478
478
|
*/
|
|
479
|
-
L(this,
|
|
480
|
-
L(this,
|
|
479
|
+
L(this, $e, null);
|
|
480
|
+
L(this, Ve, !1);
|
|
481
481
|
/** Unsubscribe from the environment observable; set only while connected AND `environmentChanged` is overridden. */
|
|
482
|
-
L(this, Ve);
|
|
483
|
-
/** Unsubscribe from the throttled viewport observable; set only while connected AND `viewportChanged` is overridden. */
|
|
484
482
|
L(this, De);
|
|
485
|
-
/** Unsubscribe from the
|
|
483
|
+
/** Unsubscribe from the throttled viewport observable; set only while connected AND `viewportChanged` is overridden. */
|
|
486
484
|
L(this, Re);
|
|
485
|
+
/** Unsubscribe from the per-element ResizeObserver; set only while connected AND `resized` is overridden. */
|
|
487
486
|
L(this, Be);
|
|
487
|
+
L(this, He);
|
|
488
488
|
L(this, Ht);
|
|
489
489
|
L(this, ie);
|
|
490
|
-
L(this,
|
|
490
|
+
L(this, Fe);
|
|
491
491
|
const t = this.constructor, o = t.inputs ?? [], i = Ti(t.events);
|
|
492
|
-
b(this,
|
|
492
|
+
b(this, M, uo).call(this, o, i);
|
|
493
493
|
for (const r of o)
|
|
494
|
-
h(this, ct).set(r.configKey, r), r.attribute && h(this,
|
|
494
|
+
h(this, ct).set(r.configKey, r), r.attribute && h(this, ke).set(r.attribute, r);
|
|
495
495
|
for (const r of i)
|
|
496
496
|
h(this, dt).set(r.name, r);
|
|
497
|
-
b(this,
|
|
497
|
+
b(this, M, co).call(this, o), b(this, M, mo).call(this, o), b(this, M, po).call(this, i);
|
|
498
498
|
}
|
|
499
499
|
static get observedAttributes() {
|
|
500
500
|
const t = (this.inputs ?? []).filter((o) => o.attribute).map((o) => o.attribute);
|
|
@@ -503,42 +503,42 @@ const xe = class xe extends Ii {
|
|
|
503
503
|
// ── lifecycle ──────────────────────────────────────────────────────────
|
|
504
504
|
attributeChangedCallback(t, o, i) {
|
|
505
505
|
var a;
|
|
506
|
-
if (h(this,
|
|
506
|
+
if (h(this, Ve))
|
|
507
507
|
return;
|
|
508
|
-
if (t === "dir" && !h(this,
|
|
509
|
-
h(this,
|
|
508
|
+
if (t === "dir" && !h(this, ke).has("dir")) {
|
|
509
|
+
h(this, Ie) && this.directionChanged(this.isRTL);
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
const r = h(this,
|
|
513
|
-
if (!r || !h(this,
|
|
512
|
+
const r = h(this, ke).get(t);
|
|
513
|
+
if (!r || !h(this, Ie) && ((a = h(this, $e)) != null && a.has(r.configKey)))
|
|
514
514
|
return;
|
|
515
515
|
let n;
|
|
516
516
|
try {
|
|
517
517
|
n = qo(r, i, this);
|
|
518
518
|
} catch (l) {
|
|
519
|
-
b(this,
|
|
519
|
+
b(this, M, Z).call(this, `converter for "${r.configKey}" threw parsing attribute ${t}="${i}"; using default`, l), n = b(this, M, ho).call(this, r);
|
|
520
520
|
}
|
|
521
|
-
b(this,
|
|
521
|
+
b(this, M, ts).call(this, n);
|
|
522
522
|
}
|
|
523
523
|
connectedCallback() {
|
|
524
|
-
vi(this.localName, this), h(this,
|
|
524
|
+
vi(this.localName, this), h(this, Ie) || (I(this, Ie, !0), I(this, $e, null), I(this, fe, !0)), b(this, M, tt).call(this), this.connect(), this.environmentChanged !== _e.prototype.environmentChanged && I(this, De, ai((t) => this.environmentChanged(t))), this.viewportChanged !== _e.prototype.viewportChanged && I(this, Re, li((t) => this.viewportChanged(t))), this.resized !== _e.prototype.resized && I(this, Be, bi(this, (t) => this.resized(t), { immediate: !1 }));
|
|
525
525
|
}
|
|
526
526
|
disconnectedCallback() {
|
|
527
527
|
var t, o, i;
|
|
528
|
-
wi(this.localName, this), (t = h(this,
|
|
528
|
+
wi(this.localName, this), (t = h(this, De)) == null || t.call(this), I(this, De, void 0), (o = h(this, Re)) == null || o.call(this), I(this, Re, void 0), (i = h(this, Be)) == null || i.call(this), I(this, Be, void 0), this.disconnect();
|
|
529
529
|
}
|
|
530
530
|
// ── public batching API ─────────────────────────────────────────────────
|
|
531
531
|
/** Apply many inputs (by `configKey` or attribute name) as ONE reinit/update. */
|
|
532
532
|
setAttributes(t) {
|
|
533
533
|
for (const [o, i] of Object.entries(t)) {
|
|
534
|
-
const r = h(this, ct).get(o) ?? h(this,
|
|
535
|
-
r && b(this,
|
|
534
|
+
const r = h(this, ct).get(o) ?? h(this, ke).get(o);
|
|
535
|
+
r && b(this, M, es).call(this, r, i);
|
|
536
536
|
}
|
|
537
|
-
b(this,
|
|
537
|
+
b(this, M, tt).call(this);
|
|
538
538
|
}
|
|
539
539
|
/** Run `fn` and coalesce every input change it makes into a single reinit/update. */
|
|
540
540
|
batch(t) {
|
|
541
|
-
t(), b(this,
|
|
541
|
+
t(), b(this, M, tt).call(this);
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
544
544
|
* Apply any pending input writes **synchronously, now** — running the
|
|
@@ -554,7 +554,7 @@ const xe = class xe extends Ii {
|
|
|
554
554
|
* `await whenSettled()` between the two.
|
|
555
555
|
*/
|
|
556
556
|
flush() {
|
|
557
|
-
b(this,
|
|
557
|
+
b(this, M, tt).call(this);
|
|
558
558
|
}
|
|
559
559
|
/**
|
|
560
560
|
* Resolves once the element is **settled** — i.e. every staged input change
|
|
@@ -572,12 +572,12 @@ const xe = class xe extends Ii {
|
|
|
572
572
|
* flush — not before the change is actually applied.
|
|
573
573
|
*/
|
|
574
574
|
whenSettled() {
|
|
575
|
-
return !h(this,
|
|
575
|
+
return !h(this, Se) && !h(this, fe) ? Promise.resolve() : new Promise((t) => h(this, Te).push(t));
|
|
576
576
|
}
|
|
577
577
|
// ── subclass surface ─────────────────────────────────────────────────────
|
|
578
578
|
/** The current validated config. */
|
|
579
579
|
get config() {
|
|
580
|
-
return h(this,
|
|
580
|
+
return h(this, pe);
|
|
581
581
|
}
|
|
582
582
|
/**
|
|
583
583
|
* Instance-scoped loggers, one per category of the bundle this component
|
|
@@ -590,13 +590,13 @@ const xe = class xe extends Ii {
|
|
|
590
590
|
* loggers inside a component.
|
|
591
591
|
*/
|
|
592
592
|
get log() {
|
|
593
|
-
if (h(this,
|
|
594
|
-
return h(this,
|
|
593
|
+
if (h(this, Fe))
|
|
594
|
+
return h(this, Fe);
|
|
595
595
|
const t = _i(this.localName);
|
|
596
596
|
if (!t)
|
|
597
|
-
return
|
|
597
|
+
return Pi;
|
|
598
598
|
const o = h(this, Ht) ?? I(this, Ht, `${this.localName}#${this.id || ++Oi}`);
|
|
599
|
-
return I(this,
|
|
599
|
+
return I(this, Fe, t.forInstance(o, () => h(this, ie)));
|
|
600
600
|
}
|
|
601
601
|
/**
|
|
602
602
|
* Turn on verbose logging for THIS element only (default `debug`), independent
|
|
@@ -727,12 +727,12 @@ const xe = class xe extends Ii {
|
|
|
727
727
|
* instead (e.g. `this.internals?.setFormValue(value)`).
|
|
728
728
|
*/
|
|
729
729
|
get internals() {
|
|
730
|
-
if (h(this,
|
|
731
|
-
return h(this,
|
|
730
|
+
if (h(this, He))
|
|
731
|
+
return h(this, He);
|
|
732
732
|
if (typeof this.attachInternals != "function")
|
|
733
733
|
return null;
|
|
734
734
|
try {
|
|
735
|
-
return I(this,
|
|
735
|
+
return I(this, He, this.attachInternals());
|
|
736
736
|
} catch {
|
|
737
737
|
return null;
|
|
738
738
|
}
|
|
@@ -789,7 +789,7 @@ const xe = class xe extends Ii {
|
|
|
789
789
|
* lives here once.
|
|
790
790
|
*/
|
|
791
791
|
async runHook(t, o, i) {
|
|
792
|
-
const r = h(this,
|
|
792
|
+
const r = h(this, pe)[t];
|
|
793
793
|
if (typeof r != "function")
|
|
794
794
|
return i.whenUnset;
|
|
795
795
|
try {
|
|
@@ -801,7 +801,7 @@ const xe = class xe extends Ii {
|
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
|
-
|
|
804
|
+
pe = new WeakMap(), ct = new WeakMap(), ke = new WeakMap(), dt = new WeakMap(), Ce = new WeakMap(), ht = new WeakMap(), Bt = new WeakMap(), Se = new WeakMap(), fe = new WeakMap(), Te = new WeakMap(), Ie = new WeakMap(), $e = new WeakMap(), Ve = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), Be = new WeakMap(), He = new WeakMap(), Ht = new WeakMap(), ie = new WeakMap(), Fe = new WeakMap(), M = new WeakSet(), // ── internals ─────────────────────────────────────────────────────────────
|
|
805
805
|
co = function(t) {
|
|
806
806
|
var o;
|
|
807
807
|
for (const i of t) {
|
|
@@ -810,9 +810,9 @@ co = function(t) {
|
|
|
810
810
|
try {
|
|
811
811
|
r = i.converter.fromAttribute(null, this, i.attribute ?? i.configKey);
|
|
812
812
|
} catch (n) {
|
|
813
|
-
b(this,
|
|
813
|
+
b(this, M, Z).call(this, `converter for "${i.configKey}" threw computing its default; using \`default\``, n), r = i.default;
|
|
814
814
|
}
|
|
815
|
-
h(this,
|
|
815
|
+
h(this, pe)[i.configKey] = r, i.field && (this[i.field] = r);
|
|
816
816
|
}
|
|
817
817
|
}, ho = function(t) {
|
|
818
818
|
return { configKey: t.configKey, field: t.field, value: t.default, on: t.on ?? "update" };
|
|
@@ -825,10 +825,10 @@ uo = function(t, o) {
|
|
|
825
825
|
Ls.add(i);
|
|
826
826
|
const r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
827
827
|
for (const c of t)
|
|
828
|
-
r.has(c.configKey) && b(this,
|
|
828
|
+
r.has(c.configKey) && b(this, M, Z).call(this, `invalid input table: duplicate configKey "${c.configKey}"`), r.add(c.configKey), c.attribute && (n.has(c.attribute) && b(this, M, Z).call(this, `invalid input table: duplicate attribute "${c.attribute}"`), n.add(c.attribute)), c.reflect && !c.attribute && b(this, M, Z).call(this, `invalid input table: "${c.configKey}" has reflect:true but no attribute to reflect to`), c.reflect && !((l = c.converter) != null && l.toAttribute) && b(this, M, Z).call(this, `invalid input table: "${c.configKey}" has reflect:true but its converter has no toAttribute`);
|
|
829
829
|
const a = /* @__PURE__ */ new Set();
|
|
830
830
|
for (const c of o)
|
|
831
|
-
a.has(c.name) && b(this,
|
|
831
|
+
a.has(c.name) && b(this, M, Z).call(this, `invalid event table: duplicate event "${c.name}"`), a.add(c.name), /^[a-z][a-z0-9-]*$/.test(c.name) || b(this, M, Z).call(this, `invalid event table: event "${c.name}" should be lowercase kebab-case (e.g. "date-select")`), c.property && r.has(c.property) && b(this, M, Z).call(this, `invalid event table: event "${c.name}" property "${c.property}" collides with an input configKey`);
|
|
832
832
|
}, /**
|
|
833
833
|
* Always-on console warning for input validation failures. Deliberately uses
|
|
834
834
|
* `console.warn` directly — NOT the (future) categorized logger — so rejected
|
|
@@ -842,9 +842,9 @@ Z = function(t, ...o) {
|
|
|
842
842
|
r && delete this[i], Object.defineProperty(this, i, {
|
|
843
843
|
configurable: !0,
|
|
844
844
|
enumerable: !0,
|
|
845
|
-
get: () => h(this,
|
|
846
|
-
set: (a) => b(this,
|
|
847
|
-
}), r && ((h(this,
|
|
845
|
+
get: () => h(this, pe)[i],
|
|
846
|
+
set: (a) => b(this, M, es).call(this, o, a)
|
|
847
|
+
}), r && ((h(this, $e) ?? I(this, $e, /* @__PURE__ */ new Set())).add(i), this[i] = n);
|
|
848
848
|
}
|
|
849
849
|
}, /**
|
|
850
850
|
* Install a managed `on<Name>` handler property per event. Assigning it
|
|
@@ -860,14 +860,14 @@ po = function(t) {
|
|
|
860
860
|
n && delete this[i], Object.defineProperty(this, i, {
|
|
861
861
|
configurable: !0,
|
|
862
862
|
enumerable: !0,
|
|
863
|
-
get: () => h(this,
|
|
863
|
+
get: () => h(this, Ce).get(r) ?? null,
|
|
864
864
|
set: (l) => {
|
|
865
|
-
const c = h(this,
|
|
865
|
+
const c = h(this, Ce).get(r);
|
|
866
866
|
if (c && this.removeEventListener(r, c), typeof l == "function") {
|
|
867
867
|
const d = l;
|
|
868
|
-
h(this,
|
|
868
|
+
h(this, Ce).set(r, d), this.addEventListener(r, d);
|
|
869
869
|
} else
|
|
870
|
-
h(this,
|
|
870
|
+
h(this, Ce).delete(r);
|
|
871
871
|
}
|
|
872
872
|
}), n && (this[i] = a);
|
|
873
873
|
}
|
|
@@ -875,44 +875,44 @@ po = function(t) {
|
|
|
875
875
|
var r;
|
|
876
876
|
const i = Xo(t, o);
|
|
877
877
|
if (!i) {
|
|
878
|
-
b(this,
|
|
878
|
+
b(this, M, Z).call(this, `rejected invalid value for property "${t.configKey}"; keeping previous value`, o);
|
|
879
879
|
return;
|
|
880
880
|
}
|
|
881
|
-
if (b(this,
|
|
881
|
+
if (b(this, M, ts).call(this, i), t.reflect && t.attribute && ((r = t.converter) != null && r.toAttribute)) {
|
|
882
882
|
const n = t.converter.toAttribute(i.value);
|
|
883
|
-
I(this,
|
|
883
|
+
I(this, Ve, !0);
|
|
884
884
|
try {
|
|
885
885
|
n === null ? this.removeAttribute(t.attribute) : this.setAttribute(t.attribute, n);
|
|
886
886
|
} finally {
|
|
887
|
-
I(this,
|
|
887
|
+
I(this, Ve, !1);
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
}, ts = function(t) {
|
|
891
|
-
h(this,
|
|
891
|
+
h(this, pe)[t.configKey] = t.value, t.field && (this[t.field] = t.value), t.on !== "none" && (t.on === "reinit" && I(this, fe, !0), (h(this, Se) ?? I(this, Se, {}))[t.configKey] = t.value, h(this, ht).schedule(h(this, Bt)));
|
|
892
892
|
}, /** Cancel any queued microtask and flush pending changes synchronously now. */
|
|
893
893
|
tt = function() {
|
|
894
|
-
h(this, ht).cancel(), b(this,
|
|
894
|
+
h(this, ht).cancel(), b(this, M, ss).call(this);
|
|
895
895
|
}, ss = function() {
|
|
896
896
|
if (!this.isConnected)
|
|
897
897
|
return;
|
|
898
|
-
const t = h(this,
|
|
899
|
-
I(this,
|
|
898
|
+
const t = h(this, fe), o = h(this, Se);
|
|
899
|
+
I(this, fe, !1), I(this, Se, null), t ? this.reinit() : o && Object.keys(o).length > 0 && this.update(o), b(this, M, fo).call(this);
|
|
900
900
|
}, /** Resolve everyone awaiting {@link whenSettled} for the flush that just ran. */
|
|
901
901
|
fo = function() {
|
|
902
|
-
if (h(this,
|
|
902
|
+
if (h(this, Te).length === 0)
|
|
903
903
|
return;
|
|
904
|
-
const t = h(this,
|
|
905
|
-
I(this,
|
|
904
|
+
const t = h(this, Te);
|
|
905
|
+
I(this, Te, []);
|
|
906
906
|
for (const o of t)
|
|
907
907
|
o();
|
|
908
908
|
}, /** The opt-in input table. Subclasses set this to enable attribute/property reactivity. */
|
|
909
|
-
m(
|
|
909
|
+
m(_e, "inputs"), /**
|
|
910
910
|
* The opt-in event table (SPEC §12.5). Each entry (a bare name, or an
|
|
911
911
|
* {@link EventDef} for overrides) declares an outward notification that
|
|
912
912
|
* {@link emit} can fire and installs a managed `on<Name>` handler property.
|
|
913
913
|
*/
|
|
914
|
-
m(
|
|
915
|
-
let Qt =
|
|
914
|
+
m(_e, "events");
|
|
915
|
+
let Qt = _e;
|
|
916
916
|
function Es(s, e, t) {
|
|
917
917
|
typeof customElements > "u" || customElements.get(s) || customElements.define(s, e, t);
|
|
918
918
|
}
|
|
@@ -1035,7 +1035,7 @@ function Hi(s, e, t = {}) {
|
|
|
1035
1035
|
const o = di(e);
|
|
1036
1036
|
return t[o] ?? Bi[o];
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function he(s) {
|
|
1039
1039
|
return {
|
|
1040
1040
|
presentation: s,
|
|
1041
1041
|
isFullscreen: s === "fullscreen",
|
|
@@ -1132,7 +1132,7 @@ function Ze(s) {
|
|
|
1132
1132
|
return e;
|
|
1133
1133
|
throw new TypeError(`setLevel() called with an invalid level: ${String(s)}`);
|
|
1134
1134
|
}
|
|
1135
|
-
let
|
|
1135
|
+
let me;
|
|
1136
1136
|
const $t = {};
|
|
1137
1137
|
class vo {
|
|
1138
1138
|
constructor(e, t) {
|
|
@@ -1152,7 +1152,7 @@ class vo {
|
|
|
1152
1152
|
m(this, "defaultLevel", null);
|
|
1153
1153
|
/** Optional user-set level; overrides default. */
|
|
1154
1154
|
m(this, "userLevel", null);
|
|
1155
|
-
this.name = e, this.methodFactory = t, this.inheritedLevel = Ze(
|
|
1155
|
+
this.name = e, this.methodFactory = t, this.inheritedLevel = Ze(me ? me.getLevel() : "WARN");
|
|
1156
1156
|
const o = this.getPersistedLevel();
|
|
1157
1157
|
o != null && (this.userLevel = Ze(o)), this.replaceLoggingMethods();
|
|
1158
1158
|
}
|
|
@@ -1214,17 +1214,17 @@ class vo {
|
|
|
1214
1214
|
this.setLevel(G.SILENT, e);
|
|
1215
1215
|
}
|
|
1216
1216
|
rebuild() {
|
|
1217
|
-
if (
|
|
1217
|
+
if (me && me !== this && (this.inheritedLevel = Ze(me.getLevel())), this.replaceLoggingMethods(), me === this)
|
|
1218
1218
|
for (const e in $t)
|
|
1219
1219
|
$t[e].rebuild();
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
|
-
|
|
1222
|
+
me = new vo(void 0, Zi);
|
|
1223
1223
|
function Qi(s) {
|
|
1224
1224
|
if (typeof s != "string" || s === "")
|
|
1225
1225
|
throw new TypeError("You must supply a non-empty name when creating a logger.");
|
|
1226
1226
|
let e = $t[s];
|
|
1227
|
-
return e || (e = $t[s] = new vo(s,
|
|
1227
|
+
return e || (e = $t[s] = new vo(s, me.methodFactory)), e;
|
|
1228
1228
|
}
|
|
1229
1229
|
const er = ["INIT", "DATA", "UI"], tr = "debug", Vs = [
|
|
1230
1230
|
"#4c8bf5",
|
|
@@ -1309,7 +1309,7 @@ function nr(s, e = er) {
|
|
|
1309
1309
|
}
|
|
1310
1310
|
};
|
|
1311
1311
|
}
|
|
1312
|
-
const
|
|
1312
|
+
const ve = Math.min, ne = Math.max, Vt = Math.round, vt = Math.floor, ae = (s) => ({
|
|
1313
1313
|
x: s,
|
|
1314
1314
|
y: s
|
|
1315
1315
|
}), ar = {
|
|
@@ -1319,15 +1319,15 @@ const be = Math.min, ne = Math.max, Vt = Math.round, vt = Math.floor, ae = (s) =
|
|
|
1319
1319
|
top: "bottom"
|
|
1320
1320
|
};
|
|
1321
1321
|
function wo(s, e, t) {
|
|
1322
|
-
return ne(s,
|
|
1322
|
+
return ne(s, ve(e, t));
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function Ge(s, e) {
|
|
1325
1325
|
return typeof s == "function" ? s(e) : s;
|
|
1326
1326
|
}
|
|
1327
1327
|
function Pe(s) {
|
|
1328
1328
|
return s.split("-")[0];
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function Ue(s) {
|
|
1331
1331
|
return s.split("-")[1];
|
|
1332
1332
|
}
|
|
1333
1333
|
function yo(s) {
|
|
@@ -1345,7 +1345,7 @@ function xs(s) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
function lr(s, e, t) {
|
|
1347
1347
|
t === void 0 && (t = !1);
|
|
1348
|
-
const o =
|
|
1348
|
+
const o = Ue(s), i = xs(s), r = ys(i);
|
|
1349
1349
|
let n = i === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
1350
1350
|
return e.reference[r] > e.floating[r] && (n = Dt(n)), [n, Dt(n)];
|
|
1351
1351
|
}
|
|
@@ -1370,7 +1370,7 @@ function ur(s, e, t) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
}
|
|
1372
1372
|
function mr(s, e, t, o) {
|
|
1373
|
-
const i =
|
|
1373
|
+
const i = Ue(s);
|
|
1374
1374
|
let r = ur(Pe(s), t === "start", o);
|
|
1375
1375
|
return i && (r = r.map((n) => n + "-" + i), e && (r = r.concat(r.map(os)))), r;
|
|
1376
1376
|
}
|
|
@@ -1451,7 +1451,7 @@ function Hs(s, e, t) {
|
|
|
1451
1451
|
y: o.y
|
|
1452
1452
|
};
|
|
1453
1453
|
}
|
|
1454
|
-
const g =
|
|
1454
|
+
const g = Ue(e);
|
|
1455
1455
|
return g && (p[n] += f * (g === "end" ? 1 : -1) * (t && c ? -1 : 1)), p;
|
|
1456
1456
|
}
|
|
1457
1457
|
async function fr(s, e) {
|
|
@@ -1470,30 +1470,30 @@ async function fr(s, e) {
|
|
|
1470
1470
|
elementContext: u = "floating",
|
|
1471
1471
|
altBoundary: f = !1,
|
|
1472
1472
|
padding: p = 0
|
|
1473
|
-
} =
|
|
1474
|
-
element: (t = await (r.isElement == null ? void 0 : r.isElement(
|
|
1473
|
+
} = Ge(e, s), g = xo(p), _ = a[f ? u === "floating" ? "reference" : "floating" : u], v = Rt(await r.getClippingRect({
|
|
1474
|
+
element: (t = await (r.isElement == null ? void 0 : r.isElement(_))) == null || t ? _ : _.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(a.floating)),
|
|
1475
1475
|
boundary: c,
|
|
1476
1476
|
rootBoundary: d,
|
|
1477
1477
|
strategy: l
|
|
1478
|
-
})),
|
|
1478
|
+
})), y = u === "floating" ? {
|
|
1479
1479
|
x: o,
|
|
1480
1480
|
y: i,
|
|
1481
1481
|
width: n.floating.width,
|
|
1482
1482
|
height: n.floating.height
|
|
1483
|
-
} : n.reference, k = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)),
|
|
1483
|
+
} : n.reference, k = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a.floating)), O = await (r.isElement == null ? void 0 : r.isElement(k)) && await (r.getScale == null ? void 0 : r.getScale(k)) || {
|
|
1484
1484
|
x: 1,
|
|
1485
1485
|
y: 1
|
|
1486
1486
|
}, $ = Rt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
1487
1487
|
elements: a,
|
|
1488
|
-
rect:
|
|
1488
|
+
rect: y,
|
|
1489
1489
|
offsetParent: k,
|
|
1490
1490
|
strategy: l
|
|
1491
|
-
}) :
|
|
1491
|
+
}) : y);
|
|
1492
1492
|
return {
|
|
1493
|
-
top: (v.top - $.top + g.top) /
|
|
1494
|
-
bottom: ($.bottom - v.bottom + g.bottom) /
|
|
1495
|
-
left: (v.left - $.left + g.left) /
|
|
1496
|
-
right: ($.right - v.right + g.right) /
|
|
1493
|
+
top: (v.top - $.top + g.top) / O.y,
|
|
1494
|
+
bottom: ($.bottom - v.bottom + g.bottom) / O.y,
|
|
1495
|
+
left: (v.left - $.left + g.left) / O.x,
|
|
1496
|
+
right: ($.right - v.right + g.right) / O.x
|
|
1497
1497
|
};
|
|
1498
1498
|
}
|
|
1499
1499
|
const gr = 50, br = async (s, e, t) => {
|
|
@@ -1516,18 +1516,18 @@ const gr = 50, br = async (s, e, t) => {
|
|
|
1516
1516
|
} = Hs(c, o, l), f = o, p = 0;
|
|
1517
1517
|
const g = {};
|
|
1518
1518
|
for (let w = 0; w < r.length; w++) {
|
|
1519
|
-
const
|
|
1520
|
-
if (!
|
|
1519
|
+
const _ = r[w];
|
|
1520
|
+
if (!_)
|
|
1521
1521
|
continue;
|
|
1522
1522
|
const {
|
|
1523
1523
|
name: v,
|
|
1524
|
-
fn:
|
|
1525
|
-
} =
|
|
1524
|
+
fn: y
|
|
1525
|
+
} = _, {
|
|
1526
1526
|
x: k,
|
|
1527
|
-
y:
|
|
1527
|
+
y: O,
|
|
1528
1528
|
data: $,
|
|
1529
1529
|
reset: D
|
|
1530
|
-
} = await
|
|
1530
|
+
} = await y({
|
|
1531
1531
|
x: d,
|
|
1532
1532
|
y: u,
|
|
1533
1533
|
initialPlacement: o,
|
|
@@ -1541,7 +1541,7 @@ const gr = 50, br = async (s, e, t) => {
|
|
|
1541
1541
|
floating: e
|
|
1542
1542
|
}
|
|
1543
1543
|
});
|
|
1544
|
-
d = k ?? d, u =
|
|
1544
|
+
d = k ?? d, u = O ?? u, g[v] = {
|
|
1545
1545
|
...g[v],
|
|
1546
1546
|
...$
|
|
1547
1547
|
}, D && p < gr && (p++, typeof D == "object" && (D.placement && (f = D.placement), D.rects && (c = D.rects === !0 ? await n.getElementRects({
|
|
@@ -1575,16 +1575,16 @@ const gr = 50, br = async (s, e, t) => {
|
|
|
1575
1575
|
} = e, {
|
|
1576
1576
|
element: c,
|
|
1577
1577
|
padding: d = 0
|
|
1578
|
-
} =
|
|
1578
|
+
} = Ge(s, e) || {};
|
|
1579
1579
|
if (c == null)
|
|
1580
1580
|
return {};
|
|
1581
1581
|
const u = xo(d), f = {
|
|
1582
1582
|
x: t,
|
|
1583
1583
|
y: o
|
|
1584
|
-
}, p = xs(i), g = ys(p), w = await n.getDimensions(c),
|
|
1584
|
+
}, p = xs(i), g = ys(p), w = await n.getDimensions(c), _ = p === "y", v = _ ? "top" : "left", y = _ ? "bottom" : "right", k = _ ? "clientHeight" : "clientWidth", O = r.reference[g] + r.reference[p] - f[p] - r.floating[g], $ = f[p] - r.reference[p], D = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
|
|
1585
1585
|
let j = D ? D[k] : 0;
|
|
1586
1586
|
(!j || !await (n.isElement == null ? void 0 : n.isElement(D))) && (j = a.floating[k] || r.floating[g]);
|
|
1587
|
-
const q =
|
|
1587
|
+
const q = O / 2 - $ / 2, V = j / 2 - w[g] / 2 - 1, S = ve(u[v], V), P = ve(u[y], V), z = j - w[g] - P, B = j / 2 - w[g] / 2 + q, T = wo(S, B, z), F = !l.arrow && Ue(i) != null && B !== T && r.reference[g] / 2 - (B < S ? S : P) - w[g] / 2 < 0, se = F ? B < S ? B - S : B - z : 0;
|
|
1588
1588
|
return {
|
|
1589
1589
|
[p]: f[p] + se,
|
|
1590
1590
|
data: {
|
|
@@ -1617,27 +1617,27 @@ const gr = 50, br = async (s, e, t) => {
|
|
|
1617
1617
|
fallbackStrategy: p = "bestFit",
|
|
1618
1618
|
fallbackAxisSideDirection: g = "none",
|
|
1619
1619
|
flipAlignment: w = !0,
|
|
1620
|
-
...
|
|
1621
|
-
} =
|
|
1620
|
+
..._
|
|
1621
|
+
} = Ge(s, e);
|
|
1622
1622
|
if ((t = r.arrow) != null && t.alignmentOffset)
|
|
1623
1623
|
return {};
|
|
1624
|
-
const v = Pe(i),
|
|
1625
|
-
!f && D && $.push(...mr(a, w, g,
|
|
1626
|
-
const j = [a, ...$], q = await l.detectOverflow(e,
|
|
1624
|
+
const v = Pe(i), y = re(a), k = Pe(a) === a, O = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), $ = f || (k || !w ? [Dt(a)] : cr(a)), D = g !== "none";
|
|
1625
|
+
!f && D && $.push(...mr(a, w, g, O));
|
|
1626
|
+
const j = [a, ...$], q = await l.detectOverflow(e, _), V = [];
|
|
1627
1627
|
let S = ((o = r.flip) == null ? void 0 : o.overflows) || [];
|
|
1628
1628
|
if (d && V.push(q[v]), u) {
|
|
1629
|
-
const T = lr(i, n,
|
|
1629
|
+
const T = lr(i, n, O);
|
|
1630
1630
|
V.push(q[T[0]], q[T[1]]);
|
|
1631
1631
|
}
|
|
1632
1632
|
if (S = [...S, {
|
|
1633
1633
|
placement: i,
|
|
1634
1634
|
overflows: V
|
|
1635
1635
|
}], !V.every((T) => T <= 0)) {
|
|
1636
|
-
var
|
|
1637
|
-
const T = (((
|
|
1638
|
-
if (F && (!(u === "alignment" ?
|
|
1636
|
+
var P, z;
|
|
1637
|
+
const T = (((P = r.flip) == null ? void 0 : P.index) || 0) + 1, F = j[T];
|
|
1638
|
+
if (F && (!(u === "alignment" ? y !== re(F) : !1) || // We leave the current main axis only if every placement on that axis
|
|
1639
1639
|
// overflows the main axis.
|
|
1640
|
-
S.every((J) => re(J.placement) ===
|
|
1640
|
+
S.every((J) => re(J.placement) === y ? J.overflows[0] > 0 : !0)))
|
|
1641
1641
|
return {
|
|
1642
1642
|
data: {
|
|
1643
1643
|
index: T,
|
|
@@ -1647,21 +1647,21 @@ const gr = 50, br = async (s, e, t) => {
|
|
|
1647
1647
|
placement: F
|
|
1648
1648
|
}
|
|
1649
1649
|
};
|
|
1650
|
-
let se = (z = S.filter((
|
|
1650
|
+
let se = (z = S.filter((ye) => ye.overflows[0] <= 0).sort((ye, J) => ye.overflows[1] - J.overflows[1])[0]) == null ? void 0 : z.placement;
|
|
1651
1651
|
if (!se)
|
|
1652
1652
|
switch (p) {
|
|
1653
1653
|
case "bestFit": {
|
|
1654
1654
|
var B;
|
|
1655
|
-
const
|
|
1655
|
+
const ye = (B = S.filter((J) => {
|
|
1656
1656
|
if (D) {
|
|
1657
1657
|
const de = re(J.placement);
|
|
1658
|
-
return de ===
|
|
1658
|
+
return de === y || // Create a bias to the `y` side axis due to horizontal
|
|
1659
1659
|
// reading directions favoring greater width.
|
|
1660
1660
|
de === "y";
|
|
1661
1661
|
}
|
|
1662
1662
|
return !0;
|
|
1663
1663
|
}).map((J) => [J.placement, J.overflows.filter((de) => de > 0).reduce((de, Bo) => de + Bo, 0)]).sort((J, de) => J[1] - de[1])[0]) == null ? void 0 : B[0];
|
|
1664
|
-
|
|
1664
|
+
ye && (se = ye);
|
|
1665
1665
|
break;
|
|
1666
1666
|
}
|
|
1667
1667
|
case "initialPlacement":
|
|
@@ -1684,7 +1684,7 @@ async function xr(s, e) {
|
|
|
1684
1684
|
placement: t,
|
|
1685
1685
|
platform: o,
|
|
1686
1686
|
elements: i
|
|
1687
|
-
} = s, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), n = Pe(t), a =
|
|
1687
|
+
} = s, r = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), n = Pe(t), a = Ue(t), l = re(t) === "y", c = yr.has(n) ? -1 : 1, d = r && l ? -1 : 1, u = Ge(e, s);
|
|
1688
1688
|
let {
|
|
1689
1689
|
mainAxis: f,
|
|
1690
1690
|
crossAxis: p,
|
|
@@ -1742,25 +1742,25 @@ const _r = function(s) {
|
|
|
1742
1742
|
mainAxis: n = !0,
|
|
1743
1743
|
crossAxis: a = !1,
|
|
1744
1744
|
limiter: l = {
|
|
1745
|
-
fn: (
|
|
1745
|
+
fn: (y) => {
|
|
1746
1746
|
let {
|
|
1747
1747
|
x: k,
|
|
1748
|
-
y:
|
|
1749
|
-
} =
|
|
1748
|
+
y: O
|
|
1749
|
+
} = y;
|
|
1750
1750
|
return {
|
|
1751
1751
|
x: k,
|
|
1752
|
-
y:
|
|
1752
|
+
y: O
|
|
1753
1753
|
};
|
|
1754
1754
|
}
|
|
1755
1755
|
},
|
|
1756
1756
|
...c
|
|
1757
|
-
} =
|
|
1757
|
+
} = Ge(s, e), d = {
|
|
1758
1758
|
x: t,
|
|
1759
1759
|
y: o
|
|
1760
1760
|
}, u = await r.detectOverflow(e, c), f = re(i), p = yo(f);
|
|
1761
1761
|
let g = d[p], w = d[f];
|
|
1762
|
-
const
|
|
1763
|
-
n && (g =
|
|
1762
|
+
const _ = (y, k) => wo(k + u[y === "y" ? "top" : "left"], k, k - u[y === "y" ? "bottom" : "right"]);
|
|
1763
|
+
n && (g = _(p, g)), a && (w = _(f, w));
|
|
1764
1764
|
const v = l.fn({
|
|
1765
1765
|
...e,
|
|
1766
1766
|
[p]: g,
|
|
@@ -1793,15 +1793,15 @@ const _r = function(s) {
|
|
|
1793
1793
|
apply: n = () => {
|
|
1794
1794
|
},
|
|
1795
1795
|
...a
|
|
1796
|
-
} =
|
|
1796
|
+
} = Ge(s, e), l = await i.detectOverflow(e, a), c = Pe(t), d = Ue(t), u = re(t) === "y", {
|
|
1797
1797
|
width: f,
|
|
1798
1798
|
height: p
|
|
1799
1799
|
} = o.floating;
|
|
1800
1800
|
let g, w;
|
|
1801
1801
|
c === "top" || c === "bottom" ? (g = c, w = d === (await (i.isRTL == null ? void 0 : i.isRTL(r.floating)) ? "start" : "end") ? "left" : "right") : (w = c, g = d === "end" ? "top" : "bottom");
|
|
1802
|
-
const
|
|
1803
|
-
let D =
|
|
1804
|
-
|
|
1802
|
+
const _ = p - l.top - l.bottom, v = f - l.left - l.right, y = ve(p - l[g], _), k = ve(f - l[w], v), O = e.middlewareData.shift, $ = !O;
|
|
1803
|
+
let D = y, j = k;
|
|
1804
|
+
O != null && O.enabled.x && (j = v), O != null && O.enabled.y && (D = _), $ && !d && (u ? j = f - 2 * ne(l.left, l.right) : D = p - 2 * ne(l.top, l.bottom)), await n({
|
|
1805
1805
|
...e,
|
|
1806
1806
|
availableWidth: j,
|
|
1807
1807
|
availableHeight: D
|
|
@@ -1818,7 +1818,7 @@ const _r = function(s) {
|
|
|
1818
1818
|
function Ft() {
|
|
1819
1819
|
return typeof window < "u";
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1821
|
+
function qe(s) {
|
|
1822
1822
|
return _o(s) ? (s.nodeName || "").toLowerCase() : "#document";
|
|
1823
1823
|
}
|
|
1824
1824
|
function U(s) {
|
|
@@ -1835,7 +1835,7 @@ function _o(s) {
|
|
|
1835
1835
|
function ee(s) {
|
|
1836
1836
|
return Ft() ? s instanceof Element || s instanceof U(s).Element : !1;
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function we(s) {
|
|
1839
1839
|
return Ft() ? s instanceof HTMLElement || s instanceof U(s).HTMLElement : !1;
|
|
1840
1840
|
}
|
|
1841
1841
|
function Fs(s) {
|
|
@@ -1851,7 +1851,7 @@ function Kt(s) {
|
|
|
1851
1851
|
return /auto|scroll|overlay|hidden|clip/.test(e + o + t) && i !== "inline" && i !== "contents";
|
|
1852
1852
|
}
|
|
1853
1853
|
function Sr(s) {
|
|
1854
|
-
return /^(table|td|th)$/.test(
|
|
1854
|
+
return /^(table|td|th)$/.test(qe(s));
|
|
1855
1855
|
}
|
|
1856
1856
|
function Wt(s) {
|
|
1857
1857
|
try {
|
|
@@ -1865,20 +1865,20 @@ function Wt(s) {
|
|
|
1865
1865
|
return !1;
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
|
-
const Tr = /transform|translate|scale|rotate|perspective|filter/, Ir = /paint|layout|strict|content/,
|
|
1868
|
+
const Tr = /transform|translate|scale|rotate|perspective|filter/, Ir = /paint|layout|strict|content/, xe = (s) => !!s && s !== "none";
|
|
1869
1869
|
let Xt;
|
|
1870
1870
|
function _s(s) {
|
|
1871
1871
|
const e = ee(s) ? te(s) : s;
|
|
1872
|
-
return
|
|
1872
|
+
return xe(e.transform) || xe(e.translate) || xe(e.scale) || xe(e.rotate) || xe(e.perspective) || !ks() && (xe(e.backdropFilter) || xe(e.filter)) || Tr.test(e.willChange || "") || Ir.test(e.contain || "");
|
|
1873
1873
|
}
|
|
1874
1874
|
function Or(s) {
|
|
1875
|
-
let e =
|
|
1876
|
-
for (;
|
|
1875
|
+
let e = Le(s);
|
|
1876
|
+
for (; we(e) && !at(e); ) {
|
|
1877
1877
|
if (_s(e))
|
|
1878
1878
|
return e;
|
|
1879
1879
|
if (Wt(e))
|
|
1880
1880
|
return null;
|
|
1881
|
-
e =
|
|
1881
|
+
e = Le(e);
|
|
1882
1882
|
}
|
|
1883
1883
|
return null;
|
|
1884
1884
|
}
|
|
@@ -1886,7 +1886,7 @@ function ks() {
|
|
|
1886
1886
|
return Xt == null && (Xt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Xt;
|
|
1887
1887
|
}
|
|
1888
1888
|
function at(s) {
|
|
1889
|
-
return /^(html|body|#document)$/.test(
|
|
1889
|
+
return /^(html|body|#document)$/.test(qe(s));
|
|
1890
1890
|
}
|
|
1891
1891
|
function te(s) {
|
|
1892
1892
|
return U(s).getComputedStyle(s);
|
|
@@ -1900,8 +1900,8 @@ function jt(s) {
|
|
|
1900
1900
|
scrollTop: s.scrollY
|
|
1901
1901
|
};
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1904
|
-
if (
|
|
1903
|
+
function Le(s) {
|
|
1904
|
+
if (qe(s) === "html")
|
|
1905
1905
|
return s;
|
|
1906
1906
|
const e = (
|
|
1907
1907
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -1913,8 +1913,8 @@ function Me(s) {
|
|
|
1913
1913
|
return Fs(e) ? e.host : e;
|
|
1914
1914
|
}
|
|
1915
1915
|
function ko(s) {
|
|
1916
|
-
const e =
|
|
1917
|
-
return at(e) ? (s.ownerDocument || s).body :
|
|
1916
|
+
const e = Le(s);
|
|
1917
|
+
return at(e) ? (s.ownerDocument || s).body : we(e) && Kt(e) ? e : ko(e);
|
|
1918
1918
|
}
|
|
1919
1919
|
function lt(s, e, t) {
|
|
1920
1920
|
var o;
|
|
@@ -1932,7 +1932,7 @@ function is(s) {
|
|
|
1932
1932
|
function Co(s) {
|
|
1933
1933
|
const e = te(s);
|
|
1934
1934
|
let t = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
|
|
1935
|
-
const i =
|
|
1935
|
+
const i = we(s), r = i ? s.offsetWidth : t, n = i ? s.offsetHeight : o, a = Vt(t) !== r || Vt(o) !== n;
|
|
1936
1936
|
return a && (t = r, o = n), {
|
|
1937
1937
|
width: t,
|
|
1938
1938
|
height: o,
|
|
@@ -1942,9 +1942,9 @@ function Co(s) {
|
|
|
1942
1942
|
function Cs(s) {
|
|
1943
1943
|
return ee(s) ? s : s.contextElement;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1945
|
+
function Ne(s) {
|
|
1946
1946
|
const e = Cs(s);
|
|
1947
|
-
if (!
|
|
1947
|
+
if (!we(e))
|
|
1948
1948
|
return ae(1);
|
|
1949
1949
|
const t = e.getBoundingClientRect(), {
|
|
1950
1950
|
width: o,
|
|
@@ -1957,30 +1957,30 @@ function ze(s) {
|
|
|
1957
1957
|
y: a
|
|
1958
1958
|
};
|
|
1959
1959
|
}
|
|
1960
|
-
const
|
|
1960
|
+
const Mr = /* @__PURE__ */ ae(0);
|
|
1961
1961
|
function So(s) {
|
|
1962
1962
|
const e = U(s);
|
|
1963
|
-
return !ks() || !e.visualViewport ?
|
|
1963
|
+
return !ks() || !e.visualViewport ? Mr : {
|
|
1964
1964
|
x: e.visualViewport.offsetLeft,
|
|
1965
1965
|
y: e.visualViewport.offsetTop
|
|
1966
1966
|
};
|
|
1967
1967
|
}
|
|
1968
|
-
function
|
|
1968
|
+
function Pr(s, e, t) {
|
|
1969
1969
|
return e === void 0 && (e = !1), !!t && e && t === U(s);
|
|
1970
1970
|
}
|
|
1971
|
-
function
|
|
1971
|
+
function Ee(s, e, t, o) {
|
|
1972
1972
|
e === void 0 && (e = !1), t === void 0 && (t = !1);
|
|
1973
1973
|
const i = s.getBoundingClientRect(), r = Cs(s);
|
|
1974
1974
|
let n = ae(1);
|
|
1975
|
-
e && (o ? ee(o) && (n =
|
|
1976
|
-
const a =
|
|
1975
|
+
e && (o ? ee(o) && (n = Ne(o)) : n = Ne(s));
|
|
1976
|
+
const a = Pr(r, t, o) ? So(r) : ae(0);
|
|
1977
1977
|
let l = (i.left + a.x) / n.x, c = (i.top + a.y) / n.y, d = i.width / n.x, u = i.height / n.y;
|
|
1978
1978
|
if (r && o) {
|
|
1979
1979
|
const f = U(r), p = ee(o) ? U(o) : o;
|
|
1980
1980
|
let g = f, w = is(g);
|
|
1981
1981
|
for (; w && p !== g; ) {
|
|
1982
|
-
const
|
|
1983
|
-
l *=
|
|
1982
|
+
const _ = Ne(w), v = w.getBoundingClientRect(), y = te(w), k = v.left + (w.clientLeft + parseFloat(y.paddingLeft)) * _.x, O = v.top + (w.clientTop + parseFloat(y.paddingTop)) * _.y;
|
|
1983
|
+
l *= _.x, c *= _.y, d *= _.x, u *= _.y, l += k, c += O, g = U(w), w = is(g);
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
return Rt({
|
|
@@ -1992,7 +1992,7 @@ function Le(s, e, t, o) {
|
|
|
1992
1992
|
}
|
|
1993
1993
|
function Gt(s, e) {
|
|
1994
1994
|
const t = jt(s).scrollLeft;
|
|
1995
|
-
return e ? e.left + t :
|
|
1995
|
+
return e ? e.left + t : Ee(le(s)).left + t;
|
|
1996
1996
|
}
|
|
1997
1997
|
function To(s, e) {
|
|
1998
1998
|
const t = s.getBoundingClientRect(), o = t.left + e.scrollLeft - Gt(s, t), i = t.top + e.scrollTop;
|
|
@@ -2015,10 +2015,10 @@ function Lr(s) {
|
|
|
2015
2015
|
scrollLeft: 0,
|
|
2016
2016
|
scrollTop: 0
|
|
2017
2017
|
}, c = ae(1);
|
|
2018
|
-
const d = ae(0), u =
|
|
2019
|
-
if ((u || !r) && ((
|
|
2020
|
-
const p =
|
|
2021
|
-
c =
|
|
2018
|
+
const d = ae(0), u = we(o);
|
|
2019
|
+
if ((u || !r) && ((qe(o) !== "body" || Kt(n)) && (l = jt(o)), u)) {
|
|
2020
|
+
const p = Ee(o);
|
|
2021
|
+
c = Ne(o), d.x = p.x + o.clientLeft, d.y = p.y + o.clientTop;
|
|
2022
2022
|
}
|
|
2023
2023
|
const f = n && !u && !r ? To(n, l) : ae(0);
|
|
2024
2024
|
return {
|
|
@@ -2052,7 +2052,7 @@ function Nr(s, e, t) {
|
|
|
2052
2052
|
o ? f || (c = -n.offsetLeft, d = -n.offsetTop) : (a = n.width, l = n.height, f && (c = n.offsetLeft, d = n.offsetTop));
|
|
2053
2053
|
}
|
|
2054
2054
|
if (Gt(r) <= 0) {
|
|
2055
|
-
const f = r.ownerDocument, p = f.body, g = getComputedStyle(p), w = f.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0,
|
|
2055
|
+
const f = r.ownerDocument, p = f.body, g = getComputedStyle(p), w = f.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, _ = Math.abs(r.clientWidth - p.clientWidth - w), v = getComputedStyle(r).scrollbarGutter === "stable both-edges" ? _ / 2 : _;
|
|
2056
2056
|
v <= zr && (a -= v);
|
|
2057
2057
|
}
|
|
2058
2058
|
return {
|
|
@@ -2063,7 +2063,7 @@ function Nr(s, e, t) {
|
|
|
2063
2063
|
};
|
|
2064
2064
|
}
|
|
2065
2065
|
function $r(s, e) {
|
|
2066
|
-
const t =
|
|
2066
|
+
const t = Ee(s, !0, e === "fixed"), o = t.top + s.clientTop, i = t.left + s.clientLeft, r = Ne(s), n = s.clientWidth * r.x, a = s.clientHeight * r.y, l = i * r.x, c = o * r.y;
|
|
2067
2067
|
return {
|
|
2068
2068
|
width: n,
|
|
2069
2069
|
height: a,
|
|
@@ -2094,12 +2094,12 @@ function Vr(s, e) {
|
|
|
2094
2094
|
const t = e.get(s);
|
|
2095
2095
|
if (t)
|
|
2096
2096
|
return t;
|
|
2097
|
-
let o = lt(s, [], !1).filter((a) => ee(a) &&
|
|
2097
|
+
let o = lt(s, [], !1).filter((a) => ee(a) && qe(a) !== "body"), i = null;
|
|
2098
2098
|
const r = te(s).position === "fixed";
|
|
2099
|
-
let n = r ?
|
|
2099
|
+
let n = r ? Le(s) : s;
|
|
2100
2100
|
for (; ee(n) && !at(n); ) {
|
|
2101
2101
|
const a = te(n), l = _s(n), c = i ? i.position : r ? "fixed" : "";
|
|
2102
|
-
!l && (c === "fixed" || c === "absolute" && a.position === "static") ? o = o.filter((u) => u !== n) : i = a, n =
|
|
2102
|
+
!l && (c === "fixed" || c === "absolute" && a.position === "static") ? o = o.filter((u) => u !== n) : i = a, n = Le(n);
|
|
2103
2103
|
}
|
|
2104
2104
|
return e.set(s, o), o;
|
|
2105
2105
|
}
|
|
@@ -2114,7 +2114,7 @@ function Dr(s) {
|
|
|
2114
2114
|
let l = a.top, c = a.right, d = a.bottom, u = a.left;
|
|
2115
2115
|
for (let f = 1; f < n.length; f++) {
|
|
2116
2116
|
const p = Ks(e, n[f], i);
|
|
2117
|
-
l = ne(p.top, l), c =
|
|
2117
|
+
l = ne(p.top, l), c = ve(p.right, c), d = ve(p.bottom, d), u = ne(p.left, u);
|
|
2118
2118
|
}
|
|
2119
2119
|
return {
|
|
2120
2120
|
width: c - u,
|
|
@@ -2134,14 +2134,14 @@ function Rr(s) {
|
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
2136
|
function Br(s, e, t) {
|
|
2137
|
-
const o =
|
|
2137
|
+
const o = we(e), i = le(e), r = t === "fixed", n = Ee(s, !0, r, e);
|
|
2138
2138
|
let a = {
|
|
2139
2139
|
scrollLeft: 0,
|
|
2140
2140
|
scrollTop: 0
|
|
2141
2141
|
};
|
|
2142
2142
|
const l = ae(0);
|
|
2143
|
-
if ((o || !r) && ((
|
|
2144
|
-
const f =
|
|
2143
|
+
if ((o || !r) && ((qe(e) !== "body" || Kt(i)) && (a = jt(e)), o)) {
|
|
2144
|
+
const f = Ee(e, !0, r, e);
|
|
2145
2145
|
l.x = f.x + e.clientLeft, l.y = f.y + e.clientTop;
|
|
2146
2146
|
}
|
|
2147
2147
|
!o && i && (l.x = Gt(i));
|
|
@@ -2157,7 +2157,7 @@ function Jt(s) {
|
|
|
2157
2157
|
return te(s).position === "static";
|
|
2158
2158
|
}
|
|
2159
2159
|
function Ws(s, e) {
|
|
2160
|
-
if (!
|
|
2160
|
+
if (!we(s) || te(s).position === "fixed")
|
|
2161
2161
|
return null;
|
|
2162
2162
|
if (e)
|
|
2163
2163
|
return e(s);
|
|
@@ -2168,12 +2168,12 @@ function Io(s, e) {
|
|
|
2168
2168
|
const t = U(s);
|
|
2169
2169
|
if (Wt(s))
|
|
2170
2170
|
return t;
|
|
2171
|
-
if (!
|
|
2172
|
-
let i =
|
|
2171
|
+
if (!we(s)) {
|
|
2172
|
+
let i = Le(s);
|
|
2173
2173
|
for (; i && !at(i); ) {
|
|
2174
2174
|
if (ee(i) && !Jt(i))
|
|
2175
2175
|
return i;
|
|
2176
|
-
i =
|
|
2176
|
+
i = Le(i);
|
|
2177
2177
|
}
|
|
2178
2178
|
return t;
|
|
2179
2179
|
}
|
|
@@ -2205,11 +2205,11 @@ const Oo = {
|
|
|
2205
2205
|
getElementRects: Hr,
|
|
2206
2206
|
getClientRects: Er,
|
|
2207
2207
|
getDimensions: Rr,
|
|
2208
|
-
getScale:
|
|
2208
|
+
getScale: Ne,
|
|
2209
2209
|
isElement: ee,
|
|
2210
2210
|
isRTL: Fr
|
|
2211
2211
|
};
|
|
2212
|
-
function
|
|
2212
|
+
function Mo(s, e) {
|
|
2213
2213
|
return s.x === e.x && s.y === e.y && s.width === e.width && s.height === e.height;
|
|
2214
2214
|
}
|
|
2215
2215
|
function Kr(s, e, t) {
|
|
@@ -2225,18 +2225,18 @@ function Kr(s, e, t) {
|
|
|
2225
2225
|
left: p,
|
|
2226
2226
|
top: g,
|
|
2227
2227
|
width: w,
|
|
2228
|
-
height:
|
|
2228
|
+
height: _
|
|
2229
2229
|
} = f;
|
|
2230
|
-
if (d || e(), !w || !
|
|
2230
|
+
if (d || e(), !w || !_)
|
|
2231
2231
|
return;
|
|
2232
|
-
const v = vt(g),
|
|
2233
|
-
rootMargin: -v + "px " + -
|
|
2234
|
-
threshold: ne(0,
|
|
2232
|
+
const v = vt(g), y = vt(r.clientWidth - (p + w)), k = vt(r.clientHeight - (g + _)), O = vt(p), D = {
|
|
2233
|
+
rootMargin: -v + "px " + -y + "px " + -k + "px " + -O + "px",
|
|
2234
|
+
threshold: ne(0, ve(1, u)) || 1
|
|
2235
2235
|
};
|
|
2236
2236
|
let j = !0;
|
|
2237
2237
|
function q(V) {
|
|
2238
2238
|
const S = V[0].intersectionRatio;
|
|
2239
|
-
if (!
|
|
2239
|
+
if (!Mo(f, s.getBoundingClientRect()))
|
|
2240
2240
|
return a();
|
|
2241
2241
|
if (S !== u) {
|
|
2242
2242
|
if (!j)
|
|
@@ -2278,22 +2278,22 @@ function Wr(s, e, t, o) {
|
|
|
2278
2278
|
const u = c && a ? Kr(c, t, r) : null;
|
|
2279
2279
|
let f = -1, p = null;
|
|
2280
2280
|
n && (p = new ResizeObserver((v) => {
|
|
2281
|
-
let [
|
|
2282
|
-
|
|
2281
|
+
let [y] = v;
|
|
2282
|
+
y && y.target === c && p && e && (p.unobserve(e), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
2283
2283
|
var k;
|
|
2284
2284
|
(k = p) == null || k.observe(e);
|
|
2285
2285
|
})), t();
|
|
2286
2286
|
}), c && !l && p.observe(c), e && p.observe(e));
|
|
2287
|
-
let g, w = l ?
|
|
2288
|
-
l &&
|
|
2289
|
-
function
|
|
2290
|
-
const v =
|
|
2291
|
-
w && !
|
|
2287
|
+
let g, w = l ? Ee(s) : null;
|
|
2288
|
+
l && _();
|
|
2289
|
+
function _() {
|
|
2290
|
+
const v = Ee(s);
|
|
2291
|
+
w && !Mo(w, v) && t(), w = v, g = requestAnimationFrame(_);
|
|
2292
2292
|
}
|
|
2293
2293
|
return t(), () => {
|
|
2294
2294
|
var v;
|
|
2295
|
-
d.forEach((
|
|
2296
|
-
i &&
|
|
2295
|
+
d.forEach((y) => {
|
|
2296
|
+
i && y.removeEventListener("scroll", t), r && y.removeEventListener("resize", t);
|
|
2297
2297
|
}), u == null || u(), (v = p) == null || v.disconnect(), p = null, l && cancelAnimationFrame(g);
|
|
2298
2298
|
};
|
|
2299
2299
|
}
|
|
@@ -2339,7 +2339,7 @@ function Yr(s, e, t) {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
return null;
|
|
2341
2341
|
}
|
|
2342
|
-
function
|
|
2342
|
+
function Po(s) {
|
|
2343
2343
|
const e = getComputedStyle(s), t = [];
|
|
2344
2344
|
e.transform !== "none" && t.push(`transform: ${e.transform}`), e.perspective !== "none" && t.push(`perspective: ${e.perspective}`), e.filter !== "none" && t.push(`filter: ${e.filter}`);
|
|
2345
2345
|
const o = e.backdropFilter;
|
|
@@ -2367,7 +2367,7 @@ function Qr(s) {
|
|
|
2367
2367
|
driftY: n,
|
|
2368
2368
|
culprit: a,
|
|
2369
2369
|
culpritDescription: a ? Zr(a) : "an ancestor element (could not auto-identify)",
|
|
2370
|
-
culpritCss: a ?
|
|
2370
|
+
culpritCss: a ? Po(a) : ""
|
|
2371
2371
|
};
|
|
2372
2372
|
}
|
|
2373
2373
|
function en(s, e) {
|
|
@@ -2431,10 +2431,10 @@ function ot(s, e, t = {}) {
|
|
|
2431
2431
|
strategy: o,
|
|
2432
2432
|
middleware: n,
|
|
2433
2433
|
...d ? { platform: d } : {}
|
|
2434
|
-
}).then(({ x: g, y: w, placement:
|
|
2435
|
-
var
|
|
2436
|
-
if (s.style.left = `${g}px`, s.style.top = `${w}px`, t.arrow && sn(t.arrow.element,
|
|
2437
|
-
const
|
|
2434
|
+
}).then(({ x: g, y: w, placement: _, middlewareData: v }) => {
|
|
2435
|
+
var y, k;
|
|
2436
|
+
if (s.style.left = `${g}px`, s.style.top = `${w}px`, t.arrow && sn(t.arrow.element, _, v.arrow), a && !l && (l = !0, i = _, r = !1, n = js(t, !1)), (y = t.onPlaced) == null || y.call(t, _), (k = t.onComputed) == null || k.call(t, { x: g, y: w, placement: _ }), t.onDrift && e instanceof Element) {
|
|
2437
|
+
const O = c ? ns(s) : window, $ = Qr({ panel: s, reference: e, expectedX: g, expectedY: w, offsetParent: O });
|
|
2438
2438
|
$ && t.onDrift($);
|
|
2439
2439
|
}
|
|
2440
2440
|
});
|
|
@@ -2457,8 +2457,8 @@ function rn(s) {
|
|
|
2457
2457
|
const u = {
|
|
2458
2458
|
getBoundingClientRect: () => d ?? s.trigger.getBoundingClientRect(),
|
|
2459
2459
|
contextElement: s.trigger
|
|
2460
|
-
}, f = (
|
|
2461
|
-
d = new DOMRect(
|
|
2460
|
+
}, f = (y) => {
|
|
2461
|
+
d = new DOMRect(y.clientX, y.clientY, 0, 0), n == null || n.update();
|
|
2462
2462
|
}, p = () => {
|
|
2463
2463
|
l && clearTimeout(l), c && clearTimeout(c), l = c = void 0;
|
|
2464
2464
|
}, g = () => {
|
|
@@ -2466,8 +2466,8 @@ function rn(s) {
|
|
|
2466
2466
|
if (p(), a)
|
|
2467
2467
|
return;
|
|
2468
2468
|
(k = s.onBeforeShow) == null || k.call(s), a = !0, e.append(r);
|
|
2469
|
-
const
|
|
2470
|
-
n = ot(r,
|
|
2469
|
+
const y = s.followCursor ? u : s.trigger;
|
|
2470
|
+
n = ot(r, y, {
|
|
2471
2471
|
placement: t,
|
|
2472
2472
|
strategy: s.strategy,
|
|
2473
2473
|
offset: s.offset ?? 8,
|
|
@@ -2475,12 +2475,12 @@ function rn(s) {
|
|
|
2475
2475
|
}), s.followCursor && s.trigger.addEventListener("mousemove", f), r.classList.add(o);
|
|
2476
2476
|
}, w = () => {
|
|
2477
2477
|
p(), a && (a = !1, r.classList.remove(o), s.followCursor && s.trigger.removeEventListener("mousemove", f), n == null || n.destroy(), n = void 0, r.remove());
|
|
2478
|
-
},
|
|
2478
|
+
}, _ = () => {
|
|
2479
2479
|
p(), i.show > 0 ? l = setTimeout(g, i.show) : g();
|
|
2480
2480
|
}, v = () => {
|
|
2481
2481
|
p(), i.hide > 0 ? c = setTimeout(w, i.hide) : w();
|
|
2482
2482
|
};
|
|
2483
|
-
return s.trigger.addEventListener("mouseenter",
|
|
2483
|
+
return s.trigger.addEventListener("mouseenter", _), s.trigger.addEventListener("mouseleave", v), s.trigger.addEventListener("focusin", _), s.trigger.addEventListener("focusout", v), {
|
|
2484
2484
|
element: r,
|
|
2485
2485
|
get isVisible() {
|
|
2486
2486
|
return a;
|
|
@@ -2488,7 +2488,7 @@ function rn(s) {
|
|
|
2488
2488
|
show: g,
|
|
2489
2489
|
hide: w,
|
|
2490
2490
|
destroy() {
|
|
2491
|
-
s.trigger.removeEventListener("mouseenter",
|
|
2491
|
+
s.trigger.removeEventListener("mouseenter", _), s.trigger.removeEventListener("mouseleave", v), s.trigger.removeEventListener("focusin", _), s.trigger.removeEventListener("focusout", v), w();
|
|
2492
2492
|
}
|
|
2493
2493
|
};
|
|
2494
2494
|
}
|
|
@@ -2534,10 +2534,10 @@ function In() {
|
|
|
2534
2534
|
function On() {
|
|
2535
2535
|
ce.disableLogging();
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2537
|
+
function Mn(s) {
|
|
2538
2538
|
ce.setLogLevel(s);
|
|
2539
2539
|
}
|
|
2540
|
-
function
|
|
2540
|
+
function Pn(s, e) {
|
|
2541
2541
|
const t = s.includes(":") ? s.split(":").pop() : s;
|
|
2542
2542
|
ce.setCategoryLevel(t, e);
|
|
2543
2543
|
}
|
|
@@ -2703,56 +2703,56 @@ function Xs(s, e = 0, t = 1, o = ".") {
|
|
|
2703
2703
|
function ln(s, e) {
|
|
2704
2704
|
return s.split(e).length;
|
|
2705
2705
|
}
|
|
2706
|
-
function
|
|
2706
|
+
function ue(s, e) {
|
|
2707
2707
|
return s[e];
|
|
2708
2708
|
}
|
|
2709
2709
|
function cn(s = {}) {
|
|
2710
|
-
const e = s.idMember, t = s.pathMember, o = s.getPathCallback, i = s.parentPathMember, r = s.levelMember, n = s.hasChildrenMember, a = s.isSelectableMember, l = s.getIsSelectableCallback, c = s.treeId || "multiselect-tree", d = s.orderMember, u = s.getDisplayValueCallback, f = st(i), p = st(r), g = st(n), w = st(a),
|
|
2711
|
-
let k = 0,
|
|
2712
|
-
const $ = (V) => o ? o(V) : t ?
|
|
2710
|
+
const e = s.idMember, t = s.pathMember, o = s.getPathCallback, i = s.parentPathMember, r = s.levelMember, n = s.hasChildrenMember, a = s.isSelectableMember, l = s.getIsSelectableCallback, c = s.treeId || "multiselect-tree", d = s.orderMember, u = s.getDisplayValueCallback, f = st(i), p = st(r), g = st(n), w = st(a), _ = "x", v = s.treePathSeparator || ".", y = Us();
|
|
2711
|
+
let k = 0, O = null;
|
|
2712
|
+
const $ = (V) => o ? o(V) : t ? ue(V, t) : void 0, D = {
|
|
2713
2713
|
treePathSeparator: v,
|
|
2714
|
-
root:
|
|
2714
|
+
root: y,
|
|
2715
2715
|
get tree() {
|
|
2716
|
-
return Object.values(
|
|
2716
|
+
return Object.values(y.children);
|
|
2717
2717
|
},
|
|
2718
2718
|
/**
|
|
2719
2719
|
* Every node in depth-first render order (a parent immediately precedes
|
|
2720
2720
|
* its subtree). Computed once per `insertArray` and cached.
|
|
2721
2721
|
*/
|
|
2722
2722
|
get flatNodes() {
|
|
2723
|
-
if (
|
|
2724
|
-
const V = [], S = s.isSorted ?? !1,
|
|
2723
|
+
if (O) return O;
|
|
2724
|
+
const V = [], S = s.isSorted ?? !1, P = s.sortCallback;
|
|
2725
2725
|
function z(B) {
|
|
2726
2726
|
let T = Object.values(B.children);
|
|
2727
|
-
S &&
|
|
2727
|
+
S && P && T.length > 0 && (T = P(T));
|
|
2728
2728
|
for (const F of T)
|
|
2729
2729
|
V.push(F), F.hasChildren && z(F);
|
|
2730
2730
|
}
|
|
2731
|
-
return z(
|
|
2731
|
+
return z(y), O = V, V;
|
|
2732
2732
|
},
|
|
2733
2733
|
insertArray(V) {
|
|
2734
|
-
V = V || [],
|
|
2734
|
+
V = V || [], y.children = {}, k = 0, O = null;
|
|
2735
2735
|
const S = [];
|
|
2736
|
-
let
|
|
2736
|
+
let P = V.map((z, B) => {
|
|
2737
2737
|
const T = Us();
|
|
2738
|
-
T.treeId = c, T.id = e ?
|
|
2738
|
+
T.treeId = c, T.id = e ? ue(z, e) : void 0;
|
|
2739
2739
|
const F = $(z);
|
|
2740
|
-
return F == null || F === "" || typeof F != "string" ? (S.push(`index ${B}`), null) : (T.path = F, (T.id === void 0 || T.id === -1) && (T.id = F), f ? T.parentPath = an(T.path, v) : T.parentPath =
|
|
2740
|
+
return F == null || F === "" || typeof F != "string" ? (S.push(`index ${B}`), null) : (T.path = F, (T.id === void 0 || T.id === -1) && (T.id = F), f ? T.parentPath = an(T.path, v) : T.parentPath = ue(z, i), T.pathSegment = Xs(
|
|
2741
2741
|
qs(T.path, T.parentPath ?? "", v),
|
|
2742
2742
|
0,
|
|
2743
2743
|
1,
|
|
2744
2744
|
v
|
|
2745
|
-
), p ? T.level = ln(T.path, v) : T.level =
|
|
2745
|
+
), p ? T.level = ln(T.path, v) : T.level = ue(z, r), g || (T.hasChildren = ue(z, n)), T.data = z, T);
|
|
2746
2746
|
}).filter((z) => z !== null);
|
|
2747
|
-
s.isSorted || (s.sortCallback ?
|
|
2748
|
-
for (const z of
|
|
2747
|
+
s.isSorted || (s.sortCallback ? P = s.sortCallback(P) : P = q(P));
|
|
2748
|
+
for (const z of P)
|
|
2749
2749
|
j(z.parentPath ?? "", z);
|
|
2750
2750
|
if (l || !w)
|
|
2751
|
-
for (const z of
|
|
2751
|
+
for (const z of P)
|
|
2752
2752
|
if (l)
|
|
2753
2753
|
z.isSelectable = l(z) !== !1;
|
|
2754
2754
|
else {
|
|
2755
|
-
const B =
|
|
2755
|
+
const B = ue(z.data, a);
|
|
2756
2756
|
z.isSelectable = B == null ? !0 : !!B;
|
|
2757
2757
|
}
|
|
2758
2758
|
S.length > 0 && console.warn(
|
|
@@ -2760,38 +2760,38 @@ function cn(s = {}) {
|
|
|
2760
2760
|
);
|
|
2761
2761
|
},
|
|
2762
2762
|
getNodeByPath(V, S) {
|
|
2763
|
-
let
|
|
2763
|
+
let P = S || y;
|
|
2764
2764
|
if (V) {
|
|
2765
2765
|
const z = V.split(v);
|
|
2766
2766
|
for (let B = 0; B < z.length; B++) {
|
|
2767
|
-
const T =
|
|
2768
|
-
if (!
|
|
2767
|
+
const T = _ + z[B];
|
|
2768
|
+
if (!P.children.hasOwnProperty(T))
|
|
2769
2769
|
return null;
|
|
2770
|
-
|
|
2770
|
+
P = P.children[T];
|
|
2771
2771
|
}
|
|
2772
2772
|
}
|
|
2773
|
-
return
|
|
2773
|
+
return P;
|
|
2774
2774
|
}
|
|
2775
2775
|
};
|
|
2776
2776
|
function j(V, S) {
|
|
2777
|
-
const
|
|
2778
|
-
if (!
|
|
2777
|
+
const P = D.getNodeByPath(V);
|
|
2778
|
+
if (!P)
|
|
2779
2779
|
return `Node: ${S.path} - Could not find parent node: ${V}`;
|
|
2780
|
-
p && (S.level = (
|
|
2781
|
-
const z =
|
|
2782
|
-
return
|
|
2780
|
+
p && (S.level = (P.level || 0) + 1);
|
|
2781
|
+
const z = _ + Xs(qs(S.path, V, v), 0, 1, v);
|
|
2782
|
+
return P.children.hasOwnProperty(z) || (P.children[z] = S, g && !P.hasChildren && (P.hasChildren = !0), k = Math.max(k, S.level || 0)), null;
|
|
2783
2783
|
}
|
|
2784
2784
|
function q(V) {
|
|
2785
|
-
return V.sort((S,
|
|
2786
|
-
const z = S.level || 0, B =
|
|
2785
|
+
return V.sort((S, P) => {
|
|
2786
|
+
const z = S.level || 0, B = P.level || 0;
|
|
2787
2787
|
if (z !== B) return z - B;
|
|
2788
|
-
if (S.parentPath !==
|
|
2789
|
-
return S.parentPath ?
|
|
2790
|
-
if (d && S.data &&
|
|
2791
|
-
const T =
|
|
2788
|
+
if (S.parentPath !== P.parentPath)
|
|
2789
|
+
return S.parentPath ? P.parentPath ? S.parentPath.localeCompare(P.parentPath) : 1 : -1;
|
|
2790
|
+
if (d && S.data && P.data) {
|
|
2791
|
+
const T = ue(S.data, d) ?? 0, F = ue(P.data, d) ?? 0;
|
|
2792
2792
|
if (T !== F) return T - F;
|
|
2793
2793
|
}
|
|
2794
|
-
return u ? u(S).localeCompare(u(
|
|
2794
|
+
return u ? u(S).localeCompare(u(P)) : S.path.localeCompare(P.path);
|
|
2795
2795
|
});
|
|
2796
2796
|
}
|
|
2797
2797
|
return D;
|
|
@@ -3103,11 +3103,11 @@ class hn {
|
|
|
3103
3103
|
* Badge display falls back to the regular display value rather than '[N/A]', so consumers can override badge
|
|
3104
3104
|
* text independently. Doesn't fit the extractField shape (no tuple/member layer of its own).
|
|
3105
3105
|
*/
|
|
3106
|
-
getItemBadgeDisplayValue(e) {
|
|
3107
|
-
if (this.options.getBadgeDisplayCallback) return this.options.getBadgeDisplayCallback(e);
|
|
3106
|
+
getItemBadgeDisplayValue(e, t) {
|
|
3107
|
+
if (this.options.getBadgeDisplayCallback) return this.options.getBadgeDisplayCallback(e, t);
|
|
3108
3108
|
if (this.options.isBadgeFullTitleShown) {
|
|
3109
|
-
const
|
|
3110
|
-
if (
|
|
3109
|
+
const o = this.getItemFullTitle(e);
|
|
3110
|
+
if (o) return o;
|
|
3111
3111
|
}
|
|
3112
3112
|
return this.getItemDisplayValue(e);
|
|
3113
3113
|
}
|
|
@@ -3599,26 +3599,26 @@ class hn {
|
|
|
3599
3599
|
const d = this.isGroupCascadeActive();
|
|
3600
3600
|
Object.keys(l).forEach((u) => {
|
|
3601
3601
|
if (t += '<div class="ms__group">', u !== "__ungrouped__") {
|
|
3602
|
-
const f = ` data-group="${this.escapeHtml(u)}"`, p = d ? ' data-group-select="cascade"' : "", g = this.groupSelectionInfo(l[u]), w = d ? this.groupCheckboxHtml(g.checkState) : "",
|
|
3602
|
+
const f = ` data-group="${this.escapeHtml(u)}"`, p = d ? ' data-group-select="cascade"' : "", g = this.groupSelectionInfo(l[u]), w = d ? this.groupCheckboxHtml(g.checkState) : "", _ = d ? "ms__group-label ms__group-label--selectable" : "ms__group-label";
|
|
3603
3603
|
if (this.options.renderGroupLabelContentCallback) {
|
|
3604
3604
|
const v = {
|
|
3605
|
-
...
|
|
3605
|
+
...he(this.presentationMode),
|
|
3606
3606
|
groupName: u,
|
|
3607
3607
|
...g
|
|
3608
|
-
},
|
|
3609
|
-
if (
|
|
3608
|
+
}, y = this.options.renderGroupLabelContentCallback(u, v);
|
|
3609
|
+
if (y instanceof HTMLElement) {
|
|
3610
3610
|
const k = document.createElement("div");
|
|
3611
|
-
if (k.className =
|
|
3611
|
+
if (k.className = _, k.dataset.group = u, d) {
|
|
3612
3612
|
k.dataset.groupSelect = "cascade";
|
|
3613
|
-
const
|
|
3614
|
-
|
|
3613
|
+
const O = document.createElement("template");
|
|
3614
|
+
O.innerHTML = w, O.content.firstChild && k.appendChild(O.content.firstChild);
|
|
3615
3615
|
}
|
|
3616
|
-
k.appendChild(
|
|
3616
|
+
k.appendChild(y), t += k.outerHTML;
|
|
3617
3617
|
} else
|
|
3618
|
-
t += `<div class="${
|
|
3618
|
+
t += `<div class="${_}"${f}${p}>${w}${y}</div>`;
|
|
3619
3619
|
} else {
|
|
3620
|
-
const v = this.groupCountHtml(g.selectedCount, g.memberCount),
|
|
3621
|
-
t += `<div class="${
|
|
3620
|
+
const v = this.groupCountHtml(g.selectedCount, g.memberCount), y = v ? `${_} ms__group-label--has-count` : _;
|
|
3621
|
+
t += `<div class="${y}"${f}${p}>${w}${this.escapeHtml(u)}${v}</div>`;
|
|
3622
3622
|
}
|
|
3623
3623
|
}
|
|
3624
3624
|
l[u].forEach((f) => {
|
|
@@ -3718,17 +3718,18 @@ class hn {
|
|
|
3718
3718
|
if (!this.options.isMultipleEnabled || !e || e.length === 0) return "";
|
|
3719
3719
|
const t = this.options.actionsPosition === "bottom" ? "bottom" : "top", o = this.options.actionsAlign ?? "stretch", i = ` ms__actions--${t}`, r = this.options.isActionsSticky ? " ms__actions--sticky" : "", n = this.options.actionsLayout === "wrap" ? " ms__actions--wrap" : "", a = ` ms__actions--align-${o}`, l = /* @__PURE__ */ new Map();
|
|
3720
3720
|
if (e.forEach((d, u) => {
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3721
|
+
const f = this.buildActionContext(d);
|
|
3722
|
+
if (!(d.getIsVisibleCallback ? d.getIsVisibleCallback(this, f) : d.isVisible ?? !0)) return;
|
|
3723
|
+
let g;
|
|
3724
|
+
d.getIsDisabledCallback ? g = d.getIsDisabledCallback(this, f) : d.isDisabled !== void 0 ? g = d.isDisabled : g = this.getBuiltInActionDisabled(d.action);
|
|
3725
|
+
const w = g ? " disabled" : "", _ = d.getTextCallback ? d.getTextCallback(this, f) : d.text;
|
|
3726
|
+
let v = "";
|
|
3726
3727
|
if (d.getClassCallback) {
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3729
|
-
} else d.cssClass && (
|
|
3730
|
-
const
|
|
3731
|
-
l.has(
|
|
3728
|
+
const O = this.classSuffix(d.getClassCallback(this, f));
|
|
3729
|
+
O && (v = ` ${O}`);
|
|
3730
|
+
} else d.cssClass && (v = ` ${d.cssClass}`);
|
|
3731
|
+
const y = Math.max(1, Math.floor(d.row ?? 1)), k = `<button type="button"${w} class="ms__action-btn${v}" data-action="${d.action}" data-button-index="${u}">${_}</button>`;
|
|
3732
|
+
l.has(y) || l.set(y, []), l.get(y).push(k);
|
|
3732
3733
|
}), l.size === 0) return "";
|
|
3733
3734
|
const c = Array.from(l.keys()).sort((d, u) => d - u).map((d) => `<div class="ms__actions-row" data-row="${d}">${l.get(d).join("")}</div>`).join("");
|
|
3734
3735
|
return `<div class="ms__actions${i}${r}${n}${a}">${c}</div>`;
|
|
@@ -3745,7 +3746,7 @@ class hn {
|
|
|
3745
3746
|
isFocused: c,
|
|
3746
3747
|
isMatched: d,
|
|
3747
3748
|
isDisabled: a,
|
|
3748
|
-
...
|
|
3749
|
+
...he(this.presentationMode),
|
|
3749
3750
|
isTreeNode: !1
|
|
3750
3751
|
};
|
|
3751
3752
|
p += this.toHtml(this.options.renderOptionContentCallback(e, g));
|
|
@@ -3772,10 +3773,10 @@ class hn {
|
|
|
3772
3773
|
* chevron/toggle — every node is just a normal, selectable option.
|
|
3773
3774
|
*/
|
|
3774
3775
|
renderTreeNode(e, t) {
|
|
3775
|
-
const o = e.data, i = this.getItemValue(o), r = this.getItemDisplayValue(o), n = this.getItemIcon(o), a = this.getItemSubtitle(o), l = this.getItemDisabled(o), c = this.isCascadeMode() && this.cascadeIndex, d = c ? Ss(this.cascadeIndex, e, this.cascadeCheckedAtoms) : null, u = c ? d === "checked" : this.selectedValues.has(String(i)), f = d === "indeterminate", p = t === this.focusedIndex, g = this.matchingIndices.has(t), w = e.isSelectable !== !1,
|
|
3776
|
-
|
|
3777
|
-
const k = this.options.checkboxAlign && this.options.checkboxAlign !== "center" ? ` data-checkbox-align="${this.options.checkboxAlign}"` : "",
|
|
3778
|
-
let $ = `<div class="${
|
|
3776
|
+
const o = e.data, i = this.getItemValue(o), r = this.getItemDisplayValue(o), n = this.getItemIcon(o), a = this.getItemSubtitle(o), l = this.getItemDisabled(o), c = this.isCascadeMode() && this.cascadeIndex, d = c ? Ss(this.cascadeIndex, e, this.cascadeCheckedAtoms) : null, u = c ? d === "checked" : this.selectedValues.has(String(i)), f = d === "indeterminate", p = t === this.focusedIndex, g = this.matchingIndices.has(t), w = e.isSelectable !== !1, _ = e.level ?? 1, v = Math.max(0, _ - 1), y = ["ms__option", "ms__option--tree"];
|
|
3777
|
+
y.push(e.hasChildren ? "ms__option--tree-branch" : "ms__option--tree-leaf"), u && y.push("ms__option--selected"), f && y.push("ms__option--indeterminate"), p && y.push("ms__option--focused"), g && y.push("ms__option--matched"), l && y.push("ms__option--disabled"), w || y.push("ms__option--tree-unselectable");
|
|
3778
|
+
const k = this.options.checkboxAlign && this.options.checkboxAlign !== "center" ? ` data-checkbox-align="${this.options.checkboxAlign}"` : "", O = w ? "" : ' data-selectable="false"';
|
|
3779
|
+
let $ = `<div class="${y.join(" ")}" data-value="${i}" data-index="${t}" data-path="${e.path}" data-level="${_}" style="--ms-tree-depth: ${v};"${k}${O}>`;
|
|
3779
3780
|
if (this.options.isCheckboxesShown && this.options.isMultipleEnabled && w && ($ += this.checkboxHtml({ checked: u, indeterminate: f, disabled: l })), $ += '<div class="ms__option-content">', this.options.renderOptionContentCallback) {
|
|
3780
3781
|
const D = {
|
|
3781
3782
|
index: t,
|
|
@@ -3783,14 +3784,14 @@ class hn {
|
|
|
3783
3784
|
isFocused: p,
|
|
3784
3785
|
isMatched: g,
|
|
3785
3786
|
isDisabled: l,
|
|
3786
|
-
...
|
|
3787
|
+
...he(this.presentationMode),
|
|
3787
3788
|
// Tree metadata — lets the callback branch on depth / branch-vs-leaf /
|
|
3788
3789
|
// tristate without re-deriving any of it from the raw data item.
|
|
3789
3790
|
isTreeNode: !0,
|
|
3790
3791
|
isBranch: e.hasChildren,
|
|
3791
3792
|
isLeaf: !e.hasChildren,
|
|
3792
3793
|
childCount: Object.keys(e.children).length,
|
|
3793
|
-
level:
|
|
3794
|
+
level: _,
|
|
3794
3795
|
depth: v,
|
|
3795
3796
|
path: e.path,
|
|
3796
3797
|
isSelectable: w,
|
|
@@ -3881,7 +3882,7 @@ class hn {
|
|
|
3881
3882
|
let r;
|
|
3882
3883
|
e[0] && (this.options.renderSelectedContentCallback ? r = this.options.renderSelectedContentCallback(
|
|
3883
3884
|
e[0],
|
|
3884
|
-
|
|
3885
|
+
he(this.presentationMode)
|
|
3885
3886
|
) : r = this.getItemDisplayValue(e[0])), !h(this, N) && t > 0 && e.length > 0 ? this.input.value = r : h(this, N) || (this.input.value = "");
|
|
3886
3887
|
return;
|
|
3887
3888
|
}
|
|
@@ -4141,7 +4142,7 @@ class hn {
|
|
|
4141
4142
|
d && this.handleAddNew(d);
|
|
4142
4143
|
} else if (c === "custom") {
|
|
4143
4144
|
const d = parseInt(o.dataset.buttonIndex || "-1"), u = (n = this.options.actionButtons) == null ? void 0 : n[d];
|
|
4144
|
-
u != null && u.onClick && u.onClick(this);
|
|
4145
|
+
u != null && u.onClick && u.onClick(this, this.buildActionContext(u));
|
|
4145
4146
|
}
|
|
4146
4147
|
return;
|
|
4147
4148
|
}
|
|
@@ -4271,6 +4272,27 @@ class hn {
|
|
|
4271
4272
|
* same private actions the built-in key handling uses, so consumer shortcuts behave identically. */
|
|
4272
4273
|
getKeyboardController() {
|
|
4273
4274
|
return this.keyboardController ? this.keyboardController : (this.keyboardController = {
|
|
4275
|
+
// ── shared MultiSelectController surface (also used by ActionContext) ──
|
|
4276
|
+
getSelected: () => this.getSelected(),
|
|
4277
|
+
getValue: () => this.getValue(),
|
|
4278
|
+
getOptions: () => this.allOptions,
|
|
4279
|
+
setSelected: (e, t) => this.setSelected(e, t),
|
|
4280
|
+
selectAll: () => this.selectAll(),
|
|
4281
|
+
clearAll: () => this.clearAll(),
|
|
4282
|
+
toggle: () => this.toggle(),
|
|
4283
|
+
search: (e) => this.search(e),
|
|
4284
|
+
scrollToValue: (e) => {
|
|
4285
|
+
this.scrollToValue(e);
|
|
4286
|
+
},
|
|
4287
|
+
scrollToGroup: (e) => {
|
|
4288
|
+
this.scrollToGroup(e);
|
|
4289
|
+
},
|
|
4290
|
+
scrollToIndex: (e) => {
|
|
4291
|
+
this.scrollToIndex(e);
|
|
4292
|
+
},
|
|
4293
|
+
showMessage: (e, t) => this.showMessage(e, t),
|
|
4294
|
+
hideMessage: () => this.hideMessage(),
|
|
4295
|
+
// ── keyboard-navigation surface ──
|
|
4274
4296
|
focusNext: () => this.focusNext(),
|
|
4275
4297
|
focusPrevious: () => this.focusPrevious(),
|
|
4276
4298
|
focusFirst: () => this.focusFirst(),
|
|
@@ -4305,6 +4327,35 @@ class hn {
|
|
|
4305
4327
|
clearSearch: () => this.clearSearch()
|
|
4306
4328
|
}, this.keyboardController);
|
|
4307
4329
|
}
|
|
4330
|
+
/**
|
|
4331
|
+
* The host custom element — `this.element` is the internal `.ms` mount (inside the shadow
|
|
4332
|
+
* root), so the host is its root node's `host` when shadowed, else the mount itself. Used as
|
|
4333
|
+
* the {@link ActionContext} escape hatch (and where a wrapper hangs a server bridge).
|
|
4334
|
+
*/
|
|
4335
|
+
hostEl() {
|
|
4336
|
+
const e = this.element.getRootNode();
|
|
4337
|
+
return e instanceof ShadowRoot ? e.host : this.element;
|
|
4338
|
+
}
|
|
4339
|
+
/**
|
|
4340
|
+
* Build the {@link ActionContext} passed (as the additive 2nd arg) to every action-button
|
|
4341
|
+
* callback and the `onClick` event: a snapshot of live state plus the shared controller.
|
|
4342
|
+
*/
|
|
4343
|
+
buildActionContext(e) {
|
|
4344
|
+
const t = this.getSelected();
|
|
4345
|
+
return {
|
|
4346
|
+
button: e,
|
|
4347
|
+
selectedValues: t.map((o) => this.getItemValue(o)),
|
|
4348
|
+
selectedOptions: t,
|
|
4349
|
+
options: this.allOptions,
|
|
4350
|
+
selectedCount: t.length,
|
|
4351
|
+
optionCount: this.allOptions.length,
|
|
4352
|
+
isOpen: this.isOpen,
|
|
4353
|
+
searchTerm: this.searchTerm,
|
|
4354
|
+
controller: this.getKeyboardController(),
|
|
4355
|
+
element: this.hostEl(),
|
|
4356
|
+
...he(this.presentationMode)
|
|
4357
|
+
};
|
|
4358
|
+
}
|
|
4308
4359
|
/** Clear the search box (both the main input and the fullscreen search) and reset the visible
|
|
4309
4360
|
* list. Shared by Escape and the keyboard controller. */
|
|
4310
4361
|
/**
|
|
@@ -4698,7 +4749,7 @@ class hn {
|
|
|
4698
4749
|
const e = ns(this.dropdown);
|
|
4699
4750
|
if (e === window) return;
|
|
4700
4751
|
this.fullscreenContainingBlockWarned = !0;
|
|
4701
|
-
const t = e, o = t.id ? `#${t.id}` : "", i = t.classList.length ? `.${Array.from(t.classList).join(".")}` : "", r = `<${t.tagName.toLowerCase()}${o}${i}>`, n =
|
|
4752
|
+
const t = e, o = t.id ? `#${t.id}` : "", i = t.classList.length ? `.${Array.from(t.classList).join(".")}` : "", r = `<${t.tagName.toLowerCase()}${o}${i}>`, n = Po(t);
|
|
4702
4753
|
console.warn(
|
|
4703
4754
|
`[@keenmate/web-multiselect] Fullscreen overlay is anchored to an ancestor ${r}` + (n ? ` (has ${n})` : "") + ` instead of the viewport, so it may not cover the screen (offset, clipped, or mis-sized).
|
|
4704
4755
|
An ancestor of <web-multiselect> establishes a fixed-positioning containing block (transform / perspective / filter / backdrop-filter / will-change). Fix on your side: move the component out of that ancestor's subtree, OR remove/replace that property. If neither is acceptable, please file an issue at https://github.com/keenmate/web-multiselect/issues with the ancestor's computed CSS.`
|
|
@@ -5116,6 +5167,18 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
5116
5167
|
classSuffix(e) {
|
|
5117
5168
|
return (e == null ? [] : Array.isArray(e) ? e : [e]).filter(Boolean).join(" ");
|
|
5118
5169
|
}
|
|
5170
|
+
/**
|
|
5171
|
+
* Build the {@link BadgeContentRenderContext} handed to the sibling `get*` callbacks
|
|
5172
|
+
* (badge display / class / tooltip), so they see the same context the `render*` badge
|
|
5173
|
+
* callbacks get: `displayMode`, `isInPopover`, plus the shared presentation fields.
|
|
5174
|
+
*/
|
|
5175
|
+
badgeRenderContext(e) {
|
|
5176
|
+
return {
|
|
5177
|
+
displayMode: this.options.badgesDisplayMode ?? "badges",
|
|
5178
|
+
isInPopover: e,
|
|
5179
|
+
...he(this.presentationMode)
|
|
5180
|
+
};
|
|
5181
|
+
}
|
|
5119
5182
|
/**
|
|
5120
5183
|
* Render a removable badge for a selected option (used by the badges/partial display modes
|
|
5121
5184
|
* and by the selected-items popover).
|
|
@@ -5128,7 +5191,7 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
5128
5191
|
renderBadgeHTML(e, t) {
|
|
5129
5192
|
const o = this.getItemValue(e), i = {
|
|
5130
5193
|
...t,
|
|
5131
|
-
...
|
|
5194
|
+
...he(this.presentationMode)
|
|
5132
5195
|
};
|
|
5133
5196
|
if (!t.isInPopover && this.options.renderBadgeCallback) {
|
|
5134
5197
|
const d = this.toHtml(this.options.renderBadgeCallback(e, i));
|
|
@@ -5136,7 +5199,7 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
5136
5199
|
const u = this.options.getBadgeClassCallback;
|
|
5137
5200
|
let f = "ms__badge ms__badge--custom";
|
|
5138
5201
|
if (u) {
|
|
5139
|
-
const p = this.classSuffix(u(e));
|
|
5202
|
+
const p = this.classSuffix(u(e, i));
|
|
5140
5203
|
p && (f += " " + p);
|
|
5141
5204
|
}
|
|
5142
5205
|
return `<div class="${f}" data-value="${o}">${d}</div>`;
|
|
@@ -5144,14 +5207,14 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
5144
5207
|
}
|
|
5145
5208
|
let r;
|
|
5146
5209
|
const n = t.isInPopover ? this.options.renderSelectedItemContentCallback : void 0;
|
|
5147
|
-
n ? r = this.toHtml(n(e, i)) : this.options.renderBadgeContentCallback ? r = this.toHtml(this.options.renderBadgeContentCallback(e, i)) : r = this.getItemBadgeDisplayValue(e);
|
|
5210
|
+
n ? r = this.toHtml(n(e, i)) : this.options.renderBadgeContentCallback ? r = this.toHtml(this.options.renderBadgeContentCallback(e, i)) : r = this.getItemBadgeDisplayValue(e, i);
|
|
5148
5211
|
const a = t.isInPopover ? this.options.getSelectedItemClassCallback || this.options.getBadgeClassCallback : this.options.getBadgeClassCallback;
|
|
5149
5212
|
let l = "ms__badge";
|
|
5150
5213
|
if (a) {
|
|
5151
|
-
const d = this.classSuffix(a(e));
|
|
5214
|
+
const d = this.classSuffix(a(e, i));
|
|
5152
5215
|
d && (l += " " + d);
|
|
5153
5216
|
}
|
|
5154
|
-
const c = this.getItemBadgeDisplayValue(e);
|
|
5217
|
+
const c = this.getItemBadgeDisplayValue(e, i);
|
|
5155
5218
|
return `
|
|
5156
5219
|
<div class="${l}">
|
|
5157
5220
|
<span class="ms__badge-text">${r}</span>
|
|
@@ -5321,59 +5384,59 @@ An ancestor of <web-multiselect> establishes a fixed-positioning containing bloc
|
|
|
5321
5384
|
this.tooltips.forEach((e) => e.destroy()), this.tooltips.clear();
|
|
5322
5385
|
}
|
|
5323
5386
|
/** Build the badge-text tooltip content (callback overrides; default = displayValue + optional subtitle on next line). */
|
|
5324
|
-
buildBadgeTooltipContent(e) {
|
|
5325
|
-
if (this.options.getBadgeTooltipCallback) return this.options.getBadgeTooltipCallback(e);
|
|
5326
|
-
const
|
|
5327
|
-
return
|
|
5328
|
-
${
|
|
5387
|
+
buildBadgeTooltipContent(e, t) {
|
|
5388
|
+
if (this.options.getBadgeTooltipCallback) return this.options.getBadgeTooltipCallback(e, t);
|
|
5389
|
+
const o = this.getItemBadgeDisplayValue(e, t), i = this.getItemSubtitle(e);
|
|
5390
|
+
return i ? `${o}
|
|
5391
|
+
${i}` : o;
|
|
5329
5392
|
}
|
|
5330
5393
|
/** Build the remove-button tooltip text (callback > format string with {0} > "Remove {name}"). */
|
|
5331
|
-
buildRemoveButtonTooltipText(e, t) {
|
|
5332
|
-
return t && this.options.getRemoveButtonTooltipCallback ? this.options.getRemoveButtonTooltipCallback(t) : this.options.removeButtonTooltipText ? this.options.removeButtonTooltipText.replace("{0}", e) : `Remove ${e}`;
|
|
5394
|
+
buildRemoveButtonTooltipText(e, t, o) {
|
|
5395
|
+
return t && this.options.getRemoveButtonTooltipCallback ? this.options.getRemoveButtonTooltipCallback(t, o) : this.options.removeButtonTooltipText ? this.options.removeButtonTooltipText.replace("{0}", e) : `Remove ${e}`;
|
|
5333
5396
|
}
|
|
5334
5397
|
attachBadgeTooltips(e) {
|
|
5335
5398
|
if (!this.options.isBadgeTooltipsEnabled) return;
|
|
5336
|
-
const t = !!e, o = e || this.badgesContainer,
|
|
5337
|
-
if (
|
|
5338
|
-
const
|
|
5339
|
-
if (!
|
|
5340
|
-
const
|
|
5341
|
-
if (!
|
|
5342
|
-
const
|
|
5343
|
-
|
|
5344
|
-
id:
|
|
5345
|
-
trigger:
|
|
5346
|
-
content: this.buildBadgeTooltipContent(
|
|
5399
|
+
const t = !!e, o = this.badgeRenderContext(t), i = e || this.badgesContainer, r = t ? "popover-" : "";
|
|
5400
|
+
if (i.querySelectorAll(".ms__badge:not(.ms__badge--more)").forEach((a) => {
|
|
5401
|
+
const l = a.querySelector(".ms__badge-remove");
|
|
5402
|
+
if (!l) return;
|
|
5403
|
+
const c = l.dataset.value, d = this.selectedOptions.get(c);
|
|
5404
|
+
if (!d) return;
|
|
5405
|
+
const u = `${r}${c}`, f = `${r}${c}-remove`, p = a.querySelector(".ms__badge-text");
|
|
5406
|
+
p && this.spawnTooltip({
|
|
5407
|
+
id: u,
|
|
5408
|
+
trigger: p,
|
|
5409
|
+
content: this.buildBadgeTooltipContent(d, o)
|
|
5347
5410
|
});
|
|
5348
|
-
const
|
|
5411
|
+
const g = this.getItemBadgeDisplayValue(d, o);
|
|
5349
5412
|
this.spawnTooltip({
|
|
5350
|
-
id:
|
|
5351
|
-
trigger:
|
|
5352
|
-
content: this.buildRemoveButtonTooltipText(
|
|
5413
|
+
id: f,
|
|
5414
|
+
trigger: l,
|
|
5415
|
+
content: this.buildRemoveButtonTooltipText(g, d, o),
|
|
5353
5416
|
// Keep parent badge tooltip from overlapping the remove-button tooltip.
|
|
5354
5417
|
onBeforeShow: () => {
|
|
5355
|
-
var
|
|
5356
|
-
return (
|
|
5418
|
+
var w;
|
|
5419
|
+
return (w = this.tooltips.get(u)) == null ? void 0 : w.hide();
|
|
5357
5420
|
}
|
|
5358
5421
|
});
|
|
5359
5422
|
}), !t) {
|
|
5360
|
-
const
|
|
5361
|
-
if (
|
|
5362
|
-
const
|
|
5423
|
+
const a = this.badgesContainer.querySelector(".ms__badge--more"), l = a == null ? void 0 : a.querySelector(".ms__badge-remove");
|
|
5424
|
+
if (l && l.dataset.action === "remove-hidden") {
|
|
5425
|
+
const c = this.options.badgesMaxVisible || 3, d = this.selectedOptions.size - c;
|
|
5363
5426
|
this.spawnTooltip({
|
|
5364
5427
|
id: "more-badge-remove",
|
|
5365
|
-
trigger:
|
|
5366
|
-
content: this.buildRemoveButtonTooltipText(`${
|
|
5428
|
+
trigger: l,
|
|
5429
|
+
content: this.buildRemoveButtonTooltipText(`${d} hidden items`)
|
|
5367
5430
|
});
|
|
5368
5431
|
}
|
|
5369
5432
|
}
|
|
5370
5433
|
}
|
|
5371
5434
|
/** Build the option tooltip content (callback overrides; default = displayValue + optional subtitle on next line). */
|
|
5372
|
-
buildOptionTooltipContent(e) {
|
|
5373
|
-
if (this.options.getOptionTooltipCallback) return this.options.getOptionTooltipCallback(e);
|
|
5374
|
-
const
|
|
5375
|
-
return
|
|
5376
|
-
${
|
|
5435
|
+
buildOptionTooltipContent(e, t) {
|
|
5436
|
+
if (this.options.getOptionTooltipCallback) return this.options.getOptionTooltipCallback(e, t);
|
|
5437
|
+
const o = this.getItemDisplayValue(e), i = this.getItemSubtitle(e);
|
|
5438
|
+
return i ? `${o}
|
|
5439
|
+
${i}` : o;
|
|
5377
5440
|
}
|
|
5378
5441
|
/**
|
|
5379
5442
|
* Attach hover tooltips to the currently rendered dropdown options. Prunes existing option
|
|
@@ -5388,11 +5451,19 @@ ${o}` : t;
|
|
|
5388
5451
|
if (i < 0) return;
|
|
5389
5452
|
const r = this.filteredOptions[i];
|
|
5390
5453
|
if (!r) return;
|
|
5391
|
-
const n = this.
|
|
5392
|
-
|
|
5454
|
+
const n = this.getItemValue(r), a = {
|
|
5455
|
+
index: i,
|
|
5456
|
+
isSelected: this.selectedValues.has(String(n)),
|
|
5457
|
+
isFocused: i === this.focusedIndex,
|
|
5458
|
+
isMatched: this.matchingIndices.has(i),
|
|
5459
|
+
isDisabled: this.getItemDisabled(r),
|
|
5460
|
+
...he(this.presentationMode),
|
|
5461
|
+
isTreeNode: !1
|
|
5462
|
+
}, l = this.buildOptionTooltipContent(r, a);
|
|
5463
|
+
l && this.spawnTooltip({
|
|
5393
5464
|
id: `option-${i}`,
|
|
5394
5465
|
trigger: o,
|
|
5395
|
-
content:
|
|
5466
|
+
content: l,
|
|
5396
5467
|
// Default to `top-start` (anchored to the row's start edge) so the tooltip doesn't
|
|
5397
5468
|
// center on a full-width row. Falls through to the badge settings for delay/offset.
|
|
5398
5469
|
placement: this.options.optionTooltipPlacement ?? "top-start",
|
|
@@ -5525,7 +5596,7 @@ ${o}` : t;
|
|
|
5525
5596
|
if (!i) return;
|
|
5526
5597
|
const r = parseInt(o.dataset.buttonIndex || "-1"), n = r >= 0 ? (c = this.options.actionButtons) == null ? void 0 : c[r] : (d = this.options.actionButtons) == null ? void 0 : d.find((u) => u.action === i);
|
|
5527
5598
|
if (!n) return;
|
|
5528
|
-
const a = n.getTooltipCallback ? n.getTooltipCallback(this) : n.tooltip;
|
|
5599
|
+
const a = n.getTooltipCallback ? n.getTooltipCallback(this, this.buildActionContext(n)) : n.tooltip;
|
|
5529
5600
|
if (!a) return;
|
|
5530
5601
|
const l = `action-${r >= 0 ? r : i}`;
|
|
5531
5602
|
this.spawnTooltip({ id: l, trigger: o, content: a });
|
|
@@ -5864,32 +5935,32 @@ const kn = [
|
|
|
5864
5935
|
{ key: "subtitleMember", member: "subtitle", callbackKey: "getSubtitleCallback" },
|
|
5865
5936
|
{ key: "disabledMember", member: "disabled", callbackKey: "getDisabledCallback" }
|
|
5866
5937
|
];
|
|
5867
|
-
var Q, C,
|
|
5938
|
+
var Q, C, ge, ut, Ke, mt, pt, ft, We, je, Oe, x, as, Ct, be, St, ls, cs, ds, Tt, Ao, zo, No, Ae, hs, us, $o, Vo, ms, Do, Ro, ps, fs;
|
|
5868
5939
|
class it extends Qt {
|
|
5869
5940
|
constructor() {
|
|
5870
5941
|
super();
|
|
5871
|
-
L(this,
|
|
5942
|
+
L(this, x);
|
|
5872
5943
|
L(this, Q);
|
|
5873
5944
|
L(this, C);
|
|
5874
|
-
L(this,
|
|
5945
|
+
L(this, ge);
|
|
5875
5946
|
// The `initial-values` JSON applied at the last build. Lets a rebuild (reinit)
|
|
5876
5947
|
// tell an explicit `initial-values` change (honour the new values) apart from a
|
|
5877
5948
|
// cosmetic/structural reinit (preserve the user's runtime selection). See #buildPicker.
|
|
5878
5949
|
L(this, ut);
|
|
5879
5950
|
// Render gate (`defer`): true once released via ready() / attribute removal /
|
|
5880
5951
|
// the first build. Latched — the gate never re-closes. See #renderHeld().
|
|
5881
|
-
L(this,
|
|
5952
|
+
L(this, Ke, !1);
|
|
5882
5953
|
L(this, mt, null);
|
|
5883
5954
|
// Dev-mode customStylesCallback lint: unknown --ms-* names already warned about.
|
|
5884
5955
|
L(this, pt, /* @__PURE__ */ new Set());
|
|
5885
5956
|
// Declarative <option>/<optgroup> state (parsed once from light DOM).
|
|
5886
5957
|
L(this, ft, !1);
|
|
5887
|
-
L(this,
|
|
5888
|
-
L(this,
|
|
5889
|
-
L(this,
|
|
5958
|
+
L(this, We, !1);
|
|
5959
|
+
L(this, je);
|
|
5960
|
+
L(this, Oe);
|
|
5890
5961
|
// ── container-responsive badge collapse (core §12.9 `resized`) ─────────────
|
|
5891
5962
|
/** Whether the live picker is currently forced to the collapsed count view. */
|
|
5892
|
-
L(this,
|
|
5963
|
+
L(this, be, !1);
|
|
5893
5964
|
I(this, Q, this.attachShadow({ mode: "open" })), zi(h(this, Q), Eo), typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => this.setAttribute("data-placeholder-ready", "")) : this.setAttribute("data-placeholder-ready", "");
|
|
5894
5965
|
}
|
|
5895
5966
|
/**
|
|
@@ -5911,19 +5982,19 @@ class it extends Qt {
|
|
|
5911
5982
|
}
|
|
5912
5983
|
/** Structural change (or first connect): mirror CSS vars, then (re)build the picker. */
|
|
5913
5984
|
reinit() {
|
|
5914
|
-
b(this,
|
|
5985
|
+
b(this, x, $o).call(this), this.isConnected && !b(this, x, as).call(this) && b(this, x, ds).call(this);
|
|
5915
5986
|
}
|
|
5916
5987
|
/** Cosmetic change: mirror CSS vars / custom styles / debug, patch the picker in place. */
|
|
5917
5988
|
update(t) {
|
|
5918
|
-
b(this,
|
|
5989
|
+
b(this, x, Vo).call(this, t), ("customStylesCallback" in t || "customStyles" in t) && b(this, x, hs).call(this), "showDebugInfo" in t && b(this, x, ps).call(this);
|
|
5919
5990
|
const o = {};
|
|
5920
5991
|
for (const [i, r] of Object.entries(t))
|
|
5921
5992
|
to.has(i) || (o[i] = r === null ? void 0 : r);
|
|
5922
|
-
h(this, C) && Object.keys(o).length > 0 && (h(this, C).updateOptions(o) || b(this,
|
|
5993
|
+
h(this, C) && Object.keys(o).length > 0 && (h(this, C).updateOptions(o) || b(this, x, ds).call(this)), "mobilePresentation" in t && b(this, x, Ct).call(this, Lt()), "collapseBadgesBelow" in t && b(this, x, St).call(this, this.getBoundingClientRect().width);
|
|
5923
5994
|
}
|
|
5924
5995
|
/** Activate: ensure the picker exists (a DOM move destroyed it in disconnect()). */
|
|
5925
5996
|
connect() {
|
|
5926
|
-
!h(this, C) && !b(this,
|
|
5997
|
+
!h(this, C) && !b(this, x, as).call(this) && b(this, x, Tt).call(this);
|
|
5927
5998
|
}
|
|
5928
5999
|
/** Deactivate: tear the picker down (rebuilt on the next connect). */
|
|
5929
6000
|
disconnect() {
|
|
@@ -5939,7 +6010,7 @@ class it extends Qt {
|
|
|
5939
6010
|
* set before the dropdown can open.
|
|
5940
6011
|
*/
|
|
5941
6012
|
environmentChanged(t) {
|
|
5942
|
-
b(this,
|
|
6013
|
+
b(this, x, Ct).call(this, t);
|
|
5943
6014
|
}
|
|
5944
6015
|
/**
|
|
5945
6016
|
* This element's own border box changed (core §12.9 `resized`). Overriding the
|
|
@@ -5950,7 +6021,7 @@ class it extends Qt {
|
|
|
5950
6021
|
* below` is set; otherwise it's a cheap no-op.
|
|
5951
6022
|
*/
|
|
5952
6023
|
resized({ width: t }) {
|
|
5953
|
-
b(this,
|
|
6024
|
+
b(this, x, St).call(this, t);
|
|
5954
6025
|
}
|
|
5955
6026
|
// ── non-input public API ──────────────────────────────────────────────────
|
|
5956
6027
|
/** Form field name (mirrors the `name` attribute → `formFieldId`). */
|
|
@@ -6082,22 +6153,22 @@ class it extends Qt {
|
|
|
6082
6153
|
* gate never re-closes. Fires the `ready` event on the first build.
|
|
6083
6154
|
*/
|
|
6084
6155
|
ready() {
|
|
6085
|
-
I(this,
|
|
6156
|
+
I(this, Ke, !0), this.flush(), this.isConnected && !h(this, C) && b(this, x, Tt).call(this);
|
|
6086
6157
|
}
|
|
6087
6158
|
/** Whether the picker has been built (the `ready` event has fired). False while a `defer` gate is still held. */
|
|
6088
6159
|
get isReady() {
|
|
6089
6160
|
return this.hasAttribute("is-ready");
|
|
6090
6161
|
}
|
|
6091
6162
|
}
|
|
6092
|
-
Q = new WeakMap(), C = new WeakMap(),
|
|
6163
|
+
Q = new WeakMap(), C = new WeakMap(), ge = new WeakMap(), ut = new WeakMap(), Ke = new WeakMap(), mt = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), We = new WeakMap(), je = new WeakMap(), Oe = new WeakMap(), x = new WeakSet(), /** Whether the initial render is being held by the `defer` gate (not yet released). */
|
|
6093
6164
|
as = function() {
|
|
6094
|
-
return this.config.deferRender === !0 && !h(this,
|
|
6165
|
+
return this.config.deferRender === !0 && !h(this, Ke);
|
|
6095
6166
|
}, /** Resolve `mobile-presentation` against `env` and relay it to the live picker. */
|
|
6096
6167
|
Ct = function(t) {
|
|
6097
6168
|
var r;
|
|
6098
6169
|
const o = this.config.mobilePresentation ?? "auto", i = Hi(o, t);
|
|
6099
6170
|
(r = h(this, C)) == null || r.setPresentation(i === "modal" ? "fullscreen" : i);
|
|
6100
|
-
},
|
|
6171
|
+
}, be = new WeakMap(), /**
|
|
6101
6172
|
* Resolve `collapse-badges-below` against `width` and relay the decision to the
|
|
6102
6173
|
* live picker. The override is pushed via `updateOptions` (never written back to
|
|
6103
6174
|
* `this.config`), so `this.config.badgesDisplayMode` stays the consumer's truth
|
|
@@ -6107,15 +6178,15 @@ Ct = function(t) {
|
|
|
6107
6178
|
St = function(t) {
|
|
6108
6179
|
const o = this.config.collapseBadgesBelow;
|
|
6109
6180
|
if (o == null) {
|
|
6110
|
-
h(this,
|
|
6181
|
+
h(this, be) && (I(this, be, !1), b(this, x, ls).call(this));
|
|
6111
6182
|
return;
|
|
6112
6183
|
}
|
|
6113
6184
|
const i = t > 0 && t < o;
|
|
6114
|
-
i !== h(this,
|
|
6185
|
+
i !== h(this, be) && (I(this, be, i), i ? b(this, x, cs).call(this, "count") : b(this, x, ls).call(this));
|
|
6115
6186
|
}, /** Re-assert the consumer's configured badges mode from the pristine base config. */
|
|
6116
6187
|
ls = function() {
|
|
6117
6188
|
const t = this.config.badgesDisplayMode ?? "badges";
|
|
6118
|
-
b(this,
|
|
6189
|
+
b(this, x, cs).call(this, t);
|
|
6119
6190
|
}, /** Relay a badges-display-mode override to the live picker (never written to `this.config`). */
|
|
6120
6191
|
cs = function(t) {
|
|
6121
6192
|
var o;
|
|
@@ -6123,16 +6194,16 @@ cs = function(t) {
|
|
|
6123
6194
|
}, // ── picker lifecycle ──────────────────────────────────────────────────────
|
|
6124
6195
|
ds = function() {
|
|
6125
6196
|
var o;
|
|
6126
|
-
const t = h(this, C) ? b(this,
|
|
6127
|
-
(o = h(this, C)) == null || o.destroy(), I(this, C, void 0), b(this,
|
|
6197
|
+
const t = h(this, C) ? b(this, x, Ae).call(this) : void 0;
|
|
6198
|
+
(o = h(this, C)) == null || o.destroy(), I(this, C, void 0), b(this, x, Tt).call(this, t);
|
|
6128
6199
|
}, Tt = function(t) {
|
|
6129
|
-
b(this,
|
|
6130
|
-
const o = b(this,
|
|
6131
|
-
I(this, ut, r), a && a.length > 0 ? h(this,
|
|
6200
|
+
b(this, x, Ao).call(this), b(this, x, Do).call(this);
|
|
6201
|
+
const o = b(this, x, zo).call(this), i = b(this, x, No).call(this), r = JSON.stringify(i ?? null), a = t !== void 0 && t.length > 0 && r === h(this, ut) ? t : i;
|
|
6202
|
+
I(this, ut, r), a && a.length > 0 ? h(this, ge).dataset.initialValues = JSON.stringify(a) : delete h(this, ge).dataset.initialValues, I(this, C, new hn(h(this, ge), o)), b(this, x, hs).call(this), b(this, x, ps).call(this), b(this, x, Ct).call(this, Lt()), I(this, be, !1), b(this, x, St).call(this, this.getBoundingClientRect().width), this.hasAttribute("is-ready") || (I(this, Ke, !0), this.setAttribute("is-ready", ""), this.emit("ready"));
|
|
6132
6203
|
}, Ao = function() {
|
|
6133
|
-
if (h(this,
|
|
6204
|
+
if (h(this, ge)) return;
|
|
6134
6205
|
const t = document.createElement("div");
|
|
6135
|
-
t.setAttribute("data-multiselect", ""), this.className && (t.className = this.className), h(this, Q).appendChild(t), I(this, mt, Ni(h(this, Q), { position: "first", className: "ms-custom-styles" })), I(this,
|
|
6206
|
+
t.setAttribute("data-multiselect", ""), this.className && (t.className = this.className), h(this, Q).appendChild(t), I(this, mt, Ni(h(this, Q), { position: "first", className: "ms-custom-styles" })), I(this, ge, t);
|
|
6136
6207
|
}, /**
|
|
6137
6208
|
* Build the picker config from the merged `this.config`, minus the keys the
|
|
6138
6209
|
* picker doesn't own, plus the runtime wiring (event bridges, container, host,
|
|
@@ -6144,8 +6215,8 @@ zo = function() {
|
|
|
6144
6215
|
for (const i of Object.keys(t))
|
|
6145
6216
|
t[i] === null && delete t[i];
|
|
6146
6217
|
let o = t.options;
|
|
6147
|
-
if (h(this,
|
|
6148
|
-
o && o.length > 0 && W.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), o = h(this,
|
|
6218
|
+
if (h(this, We) && h(this, je))
|
|
6219
|
+
o && o.length > 0 && W.warn("[MultiSelectElement] Both declarative <option> elements and programmatic .options detected. Using declarative options."), o = h(this, je);
|
|
6149
6220
|
else if (!o || o.length === 0) {
|
|
6150
6221
|
const i = this.config.optionsSource;
|
|
6151
6222
|
if (i != null) {
|
|
@@ -6156,7 +6227,7 @@ zo = function() {
|
|
|
6156
6227
|
a && W.error(`[MultiSelectElement] ${a}`), o = n;
|
|
6157
6228
|
}
|
|
6158
6229
|
}
|
|
6159
|
-
if (t.options = o, h(this,
|
|
6230
|
+
if (t.options = o, h(this, We))
|
|
6160
6231
|
for (const { key: i, member: r, callbackKey: n } of kn)
|
|
6161
6232
|
t[i] === void 0 && !t[n] && (t[i] = r);
|
|
6162
6233
|
return t.getCounterCallback || (t.getCounterCallback = (i, r) => r !== void 0 ? `+${r} more` : `${i} selected`), t.onSelect = (i) => {
|
|
@@ -6164,19 +6235,19 @@ zo = function() {
|
|
|
6164
6235
|
this.emit("select", {
|
|
6165
6236
|
option: i,
|
|
6166
6237
|
selectedOptions: ((r = h(this, C)) == null ? void 0 : r.getSelected()) ?? [],
|
|
6167
|
-
selectedValues: b(this,
|
|
6238
|
+
selectedValues: b(this, x, Ae).call(this)
|
|
6168
6239
|
});
|
|
6169
6240
|
}, t.onDeselect = (i) => {
|
|
6170
6241
|
var r;
|
|
6171
6242
|
this.emit("deselect", {
|
|
6172
6243
|
option: i,
|
|
6173
6244
|
selectedOptions: ((r = h(this, C)) == null ? void 0 : r.getSelected()) ?? [],
|
|
6174
|
-
selectedValues: b(this,
|
|
6245
|
+
selectedValues: b(this, x, Ae).call(this)
|
|
6175
6246
|
});
|
|
6176
6247
|
}, t.onChange = (i) => {
|
|
6177
6248
|
this.emit("change", {
|
|
6178
6249
|
selectedOptions: i,
|
|
6179
|
-
selectedValues: b(this,
|
|
6250
|
+
selectedValues: b(this, x, Ae).call(this)
|
|
6180
6251
|
});
|
|
6181
6252
|
}, t.onAddNew = (i) => {
|
|
6182
6253
|
var r;
|
|
@@ -6184,15 +6255,15 @@ zo = function() {
|
|
|
6184
6255
|
value: i.value,
|
|
6185
6256
|
option: i.option,
|
|
6186
6257
|
selectedOptions: ((r = h(this, C)) == null ? void 0 : r.getSelected()) ?? [],
|
|
6187
|
-
selectedValues: b(this,
|
|
6258
|
+
selectedValues: b(this, x, Ae).call(this)
|
|
6188
6259
|
});
|
|
6189
6260
|
}, t.container = h(this, Q), t.hostElement = this, t;
|
|
6190
6261
|
}, No = function() {
|
|
6191
|
-
if (h(this,
|
|
6192
|
-
return h(this,
|
|
6262
|
+
if (h(this, Oe) && h(this, Oe).length > 0)
|
|
6263
|
+
return h(this, Oe);
|
|
6193
6264
|
const t = this.config.initialValues;
|
|
6194
6265
|
return t && t.length > 0 ? t : void 0;
|
|
6195
|
-
},
|
|
6266
|
+
}, Ae = function() {
|
|
6196
6267
|
var o;
|
|
6197
6268
|
const t = (o = h(this, C)) == null ? void 0 : o.getValue();
|
|
6198
6269
|
return t == null ? [] : Array.isArray(t) ? t : [t];
|
|
@@ -6202,12 +6273,12 @@ hs = function() {
|
|
|
6202
6273
|
if (!t) return;
|
|
6203
6274
|
const o = this.config.customStylesCallback, i = this.config.customStyles ?? null;
|
|
6204
6275
|
if (typeof o != "function") {
|
|
6205
|
-
t.set(i), i && b(this,
|
|
6276
|
+
t.set(i), i && b(this, x, us).call(this, i);
|
|
6206
6277
|
return;
|
|
6207
6278
|
}
|
|
6208
6279
|
try {
|
|
6209
6280
|
const r = o();
|
|
6210
|
-
t.set(r), r && b(this,
|
|
6281
|
+
t.set(r), r && b(this, x, us).call(this, r);
|
|
6211
6282
|
} catch (r) {
|
|
6212
6283
|
W.warn("[MultiSelectElement] customStylesCallback threw", r), t.set(i);
|
|
6213
6284
|
}
|
|
@@ -6229,18 +6300,18 @@ us = function(t) {
|
|
|
6229
6300
|
));
|
|
6230
6301
|
}, // ── CSS-var sugar ─────────────────────────────────────────────────────────
|
|
6231
6302
|
$o = function() {
|
|
6232
|
-
for (const t of Object.keys(yt)) b(this,
|
|
6303
|
+
for (const t of Object.keys(yt)) b(this, x, ms).call(this, yt[t], this.config[t]);
|
|
6233
6304
|
}, Vo = function(t) {
|
|
6234
6305
|
for (const o of Object.keys(yt))
|
|
6235
|
-
o in t && b(this,
|
|
6306
|
+
o in t && b(this, x, ms).call(this, yt[o], t[o]);
|
|
6236
6307
|
}, ms = function(t, o) {
|
|
6237
6308
|
o == null || o === "" ? this.style.removeProperty(t) : this.style.setProperty(t, String(o));
|
|
6238
6309
|
}, // ── declarative <option> parsing (light DOM, once) ────────────────────────
|
|
6239
6310
|
Do = function() {
|
|
6240
6311
|
if (h(this, ft)) return;
|
|
6241
6312
|
I(this, ft, !0);
|
|
6242
|
-
const t = b(this,
|
|
6243
|
-
t && (I(this,
|
|
6313
|
+
const t = b(this, x, Ro).call(this);
|
|
6314
|
+
t && (I(this, je, t), I(this, We, !0));
|
|
6244
6315
|
}, Ro = function() {
|
|
6245
6316
|
const t = Array.from(this.children);
|
|
6246
6317
|
if (t.length === 0) return null;
|
|
@@ -6252,7 +6323,7 @@ Do = function() {
|
|
|
6252
6323
|
value: n.value || ((c = n.textContent) == null ? void 0 : c.trim()) || "",
|
|
6253
6324
|
label: ((d = n.textContent) == null ? void 0 : d.trim()) || n.value || ""
|
|
6254
6325
|
};
|
|
6255
|
-
a && (l.group = a), n.hasAttribute("selected") && (h(this,
|
|
6326
|
+
a && (l.group = a), n.hasAttribute("selected") && (h(this, Oe) ?? I(this, Oe, [])).push(l.value), n.hasAttribute("disabled") && (l.disabled = !0), n.hasAttribute("data-icon") && (l.icon = n.getAttribute("data-icon")), n.hasAttribute("data-subtitle") && (l.subtitle = n.getAttribute("data-subtitle")), o.push(l), i = !0;
|
|
6256
6327
|
};
|
|
6257
6328
|
for (const n of t)
|
|
6258
6329
|
if (n.tagName === "OPTION")
|
|
@@ -6276,12 +6347,12 @@ ps = function() {
|
|
|
6276
6347
|
const i = document.createElement("details"), r = document.createElement("summary");
|
|
6277
6348
|
r.textContent = "Debug Info";
|
|
6278
6349
|
const n = document.createElement("div");
|
|
6279
|
-
n.className = "ms__debug-stats", i.appendChild(r), i.appendChild(n), o.appendChild(i), h(this, Q).appendChild(o), b(this,
|
|
6350
|
+
n.className = "ms__debug-stats", i.appendChild(r), i.appendChild(n), o.appendChild(i), h(this, Q).appendChild(o), b(this, x, fs).call(this);
|
|
6280
6351
|
}, fs = function() {
|
|
6281
6352
|
var l, c, d, u;
|
|
6282
6353
|
const t = h(this, Q).querySelector(".ms__debug-stats");
|
|
6283
6354
|
if (!t || !h(this, C)) return;
|
|
6284
|
-
const o = "2.2.0
|
|
6355
|
+
const o = "2.2.0", i = typeof window < "u" && ((c = (l = window.components) == null ? void 0 : l["web-multiselect"]) == null ? void 0 : c.getInstances().length) || 0, r = h(this, C).getSelected().length, n = ((d = this.config.options) == null ? void 0 : d.length) || 0, a = h(this, C);
|
|
6285
6356
|
t.innerHTML = `
|
|
6286
6357
|
<span>Version: ${o}</span>
|
|
6287
6358
|
<span>Total Instances: ${i}</span>
|
|
@@ -6292,7 +6363,7 @@ ps = function() {
|
|
|
6292
6363
|
<span>Search: ${a.searchTerm || "none"}</span>
|
|
6293
6364
|
<span>Loading: ${a.isLoading ? "Yes" : "No"}</span>
|
|
6294
6365
|
`, setTimeout(() => {
|
|
6295
|
-
this.config.showDebugInfo && b(this,
|
|
6366
|
+
this.config.showDebugInfo && b(this, x, fs).call(this);
|
|
6296
6367
|
}, 500);
|
|
6297
6368
|
}, // Opt into the form-associated custom element lifecycle so form.reset() and
|
|
6298
6369
|
// form.elements see the control.
|
|
@@ -6301,7 +6372,7 @@ typeof customElements < "u" && !customElements.get("web-multiselect") && customE
|
|
|
6301
6372
|
Ei("web-multiselect", it, {
|
|
6302
6373
|
config: {
|
|
6303
6374
|
name: "@keenmate/web-multiselect",
|
|
6304
|
-
version: "2.2.0
|
|
6375
|
+
version: "2.2.0",
|
|
6305
6376
|
author: "Keenmate s.r.o.",
|
|
6306
6377
|
license: "MIT",
|
|
6307
6378
|
repository: "git+https://github.com/keenmate/web-multiselect.git",
|
|
@@ -6326,7 +6397,7 @@ export {
|
|
|
6326
6397
|
ai as observeEnvironment,
|
|
6327
6398
|
li as observeViewport,
|
|
6328
6399
|
pn as parseOptionsData,
|
|
6329
|
-
|
|
6330
|
-
|
|
6400
|
+
Pn as setCategoryLevel,
|
|
6401
|
+
Mn as setLogLevel,
|
|
6331
6402
|
Y as uiLogger
|
|
6332
6403
|
};
|