bitboss-ui 3.0.0-beta.64 → 3.0.0-beta.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/changelog.json +82 -4
- package/dist/ai/components.json +2 -2
- package/dist/ai/composables/useBbConfig.md +8 -1
- package/dist/ai/guides/inertia-helpers.md +1127 -275
- package/dist/ai/guides/migration/v2-to-v3.md +48 -0
- package/dist/ai/guides/passthrough.md +4 -2
- package/dist/ai/helpers/inertia/manifest.json +145 -62
- package/dist/ai/helpers/inertia/messages.ts +33 -0
- package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +116 -16
- package/dist/ai/helpers/inertia/useHasChanged.ts +34 -16
- package/dist/ai/helpers/inertia/useLazyProp.ts +102 -36
- package/dist/ai/helpers/inertia/useLazyPropGetter.ts +3 -1
- package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +129 -24
- package/dist/ai/helpers/inertia/usePromiseForm.ts +121 -14
- package/dist/ai/helpers/inertia/useQuery.ts +133 -11
- package/dist/ai/helpers/inertia/useQueryObject.ts +74 -67
- package/dist/ai/helpers/inertia/useResourceContext.ts +60 -14
- package/dist/ai/helpers/inertia/useRouteQuery.ts +29 -24
- package/dist/ai/helpers/inertia/useScreenSizes.ts +9 -7
- package/dist/ai/helpers/inertia/useTableContext.ts +5 -2
- package/dist/ai/helpers/inertia/utils.ts +14 -0
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/recipes/inertia/approvals-inbox.md +1 -1
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/ownership-atlas.md +1 -1
- package/dist/ai/recipes/inertia/records-workspace.md +1 -1
- package/dist/ai/recipes/inertia/upload-center.md +1 -1
- package/dist/ai/source/BbSelectPopover.md +25 -1
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +306 -294
- package/dist/composables/useBbConfig.d.ts +1 -0
- package/dist/composables/useBbConfig.js +11 -7
- package/dist/llms-full.txt +1192 -283
- package/dist/styles.css +1 -1
- package/dist/utils/versionCheck.js +1 -1
- package/package.json +3 -2
- package/scripts/lib/helpers-add.mjs +26 -2
package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -279,10 +279,10 @@ var wt = {
|
|
|
279
279
|
}
|
|
280
280
|
}), sn = l(() => p({ class: "bb-select-popover__panel" }, X.value ? {} : T.panel ?? {})), cn = l(() => p({
|
|
281
281
|
class: ["bb-select-popover bb-select-popover--sheet", {
|
|
282
|
-
"bb-select-popover--errors":
|
|
283
|
-
"bb-select-popover--warnings":
|
|
282
|
+
"bb-select-popover--errors": fi.value,
|
|
283
|
+
"bb-select-popover--warnings": pi.value,
|
|
284
284
|
"bb-select-popover--loading": J.value,
|
|
285
|
-
"bb-select-popover--reloading":
|
|
285
|
+
"bb-select-popover--reloading": ui.value,
|
|
286
286
|
"bb-select-popover--clearable-active": Qt.value
|
|
287
287
|
}],
|
|
288
288
|
tabindex: -1
|
|
@@ -302,21 +302,21 @@ var wt = {
|
|
|
302
302
|
let e = document.activeElement;
|
|
303
303
|
return e === Lt.value || !!E.value?.contains(e);
|
|
304
304
|
}, mn = (e) => {
|
|
305
|
-
w("focus", e),
|
|
305
|
+
w("focus", e), aa();
|
|
306
306
|
}, hn = (e) => {
|
|
307
|
-
w("blur", e),
|
|
307
|
+
w("blur", e), la();
|
|
308
308
|
}, gn = (e) => {
|
|
309
309
|
w("change", e);
|
|
310
310
|
}, _n = (e) => {
|
|
311
|
-
|
|
311
|
+
aa();
|
|
312
312
|
}, vn = (e) => {
|
|
313
|
-
w("input", e),
|
|
314
|
-
let t =
|
|
315
|
-
Promise.resolve(
|
|
313
|
+
w("input", e), Er();
|
|
314
|
+
let t = yr;
|
|
315
|
+
Promise.resolve(Gn(() => (t = yr, [
|
|
316
316
|
j.value,
|
|
317
317
|
"search",
|
|
318
318
|
C.modelValue
|
|
319
|
-
]))).then((e) =>
|
|
319
|
+
]))).then((e) => _i(t, "search", e));
|
|
320
320
|
}, yn = (e) => {
|
|
321
321
|
zt.value = e;
|
|
322
322
|
}, bn = async (e) => {
|
|
@@ -325,8 +325,8 @@ var wt = {
|
|
|
325
325
|
let n = Bt.value?.contains(t), r = !!t.closest(".bb-common-popover");
|
|
326
326
|
if (n || r || e.type === "focusin" && Bt.value && t.contains(Bt.value)) return;
|
|
327
327
|
let i = t instanceof HTMLLabelElement ? t : t.closest("label");
|
|
328
|
-
i?.control && Bt.value?.contains(i.control) || (await $(),
|
|
329
|
-
}, xn = l(() => !(C.readonly || C.disabled || J.value && !
|
|
328
|
+
i?.control && Bt.value?.contains(i.control) || (await $(), oa());
|
|
329
|
+
}, xn = l(() => !(C.readonly || C.disabled || J.value && !Jn.value.length)), Sn = new AbortController(), Cn = async () => se(() => !!D.value, {
|
|
330
330
|
interval: 100,
|
|
331
331
|
signal: Sn.signal
|
|
332
332
|
}), wn = () => {
|
|
@@ -345,7 +345,7 @@ var wt = {
|
|
|
345
345
|
D.value?.focusLastSelected();
|
|
346
346
|
}, En = null, Dn = (e) => {
|
|
347
347
|
let t = (async () => {
|
|
348
|
-
await
|
|
348
|
+
await ea({ focusPopoverContent: !1 }), await Cn(), await pe(C.transitionDuration), e();
|
|
349
349
|
})();
|
|
350
350
|
En = t;
|
|
351
351
|
let n = () => {
|
|
@@ -355,22 +355,34 @@ var wt = {
|
|
|
355
355
|
}, On = async () => {
|
|
356
356
|
for (; En;) await En.catch(() => void 0);
|
|
357
357
|
}, kn = async () => {
|
|
358
|
-
xn.value && (await On(), Y.value ? (
|
|
358
|
+
xn.value && (await On(), Y.value ? (Zi(), D.value?.focusPrevious()) : await Dn(Tn));
|
|
359
359
|
}, An = async () => {
|
|
360
|
-
xn.value && (await On(), Y.value ? (
|
|
360
|
+
xn.value && (await On(), Y.value ? (Zi(), D.value?.focusNext()) : await Dn(wn));
|
|
361
361
|
}, jn = async (e) => {
|
|
362
|
-
xn.value && (await On(), Y.value || await Dn(() => void 0),
|
|
362
|
+
xn.value && (await On(), Y.value || await Dn(() => void 0), Zi(), e === "first" ? D.value?.focusFirst() : D.value?.focusLast());
|
|
363
363
|
}, Mn = () => jn("first"), Nn = () => jn("last"), Pn = Te({
|
|
364
|
-
candidates: () => (C.groupBy ?
|
|
364
|
+
candidates: () => (C.groupBy ? Bi.value.flatMap((e) => e.options) : Li.value).filter((e) => !e.disabled),
|
|
365
365
|
getTokens: (e) => [we(String(e.text ?? ""), Mt.locale)],
|
|
366
366
|
getCurrent: () => D.value?.getHighlighted() ?? void 0,
|
|
367
367
|
onMatch: (e) => {
|
|
368
|
-
|
|
368
|
+
Zi(), D.value?.focusByHash(e.valueHash);
|
|
369
369
|
},
|
|
370
370
|
locale: () => Mt.locale
|
|
371
371
|
}), Fn = async (e) => {
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
e.preventDefault(), await On();
|
|
373
|
+
let t = Lt.value;
|
|
374
|
+
if (!(t instanceof HTMLInputElement) || document.activeElement !== t) return;
|
|
375
|
+
let n = t.value.length;
|
|
376
|
+
t.setRangeText(e.key, t.selectionStart ?? n, t.selectionEnd ?? n, "end"), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
377
|
+
}, In = async (e) => {
|
|
378
|
+
if (Ce(e)) {
|
|
379
|
+
if (O.value) {
|
|
380
|
+
En && await Fn(e);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
xn.value && (e.preventDefault(), Y.value || (await ea({ focusPopoverContent: !1 }), await Cn(), await pe(C.transitionDuration)), Pn.onKeydown(e));
|
|
384
|
+
}
|
|
385
|
+
}, Ln = async () => {
|
|
374
386
|
if (!xn.value) return;
|
|
375
387
|
if (await On(), !Y.value) {
|
|
376
388
|
await Dn(() => {
|
|
@@ -383,56 +395,56 @@ var wt = {
|
|
|
383
395
|
}
|
|
384
396
|
if (!O.value) return;
|
|
385
397
|
let e = j.value.trim();
|
|
386
|
-
|
|
387
|
-
},
|
|
398
|
+
Dr(e) || (w("option:add", e), j.value = "");
|
|
399
|
+
}, Rn = async () => {
|
|
388
400
|
Y.value && (await $(), A());
|
|
389
|
-
},
|
|
401
|
+
}, zn = {
|
|
390
402
|
ArrowDown: () => An(),
|
|
391
403
|
ArrowUp: () => kn(),
|
|
392
404
|
Down: () => An(),
|
|
393
|
-
Enter: () =>
|
|
394
|
-
Esc: () =>
|
|
395
|
-
Escape: () =>
|
|
405
|
+
Enter: () => Ln(),
|
|
406
|
+
Esc: () => Rn(),
|
|
407
|
+
Escape: () => Rn(),
|
|
396
408
|
Up: () => kn()
|
|
397
|
-
},
|
|
409
|
+
}, Bn = (e) => {
|
|
398
410
|
if (ye(e)) return;
|
|
399
|
-
let t =
|
|
411
|
+
let t = zn[e.key];
|
|
400
412
|
t && (e.stopPropagation(), e.preventDefault(), t());
|
|
401
|
-
},
|
|
402
|
-
!Y.value || e.key !== "Escape" || c(
|
|
403
|
-
}, j = g(""),
|
|
413
|
+
}, Vn = Symbol("bb-select-popover-escape"), Hn = (e) => {
|
|
414
|
+
!Y.value || e.key !== "Escape" || c(Vn) && (e.stopImmediatePropagation(), e.preventDefault(), Rn());
|
|
415
|
+
}, j = g(""), Un = g(!1), { getter: Wn, debouncedGetter: Gn, clientReproducible: Kn, hydratedFromSsr: qn, items: Jn, loading: Yn, error: M, ssrMarker: Xn, startedArgs: Zn, settledArgs: Qn, settledCount: $n, inFlight: er, discard: tr, discardScheduled: nr } = Me({
|
|
404
416
|
items: v(C, "items"),
|
|
405
417
|
debounce: C.queryDebounceTime,
|
|
406
418
|
marker: !0
|
|
407
|
-
}), { array:
|
|
419
|
+
}), { array: rr, add: ir, remove: ar, set: or } = Ae(), sr = l(() => C.multiple ? !!C.modelValue?.length : !t(C.modelValue)), { getOptionValue: cr } = Pe(), { getOptionText: lr } = Ne(), ur = $e();
|
|
408
420
|
Qe(null);
|
|
409
|
-
let
|
|
410
|
-
let e = Xe(
|
|
421
|
+
let dr = () => C.knownItems === void 0 ? ur?.rows() : C.knownItems, fr = /* @__PURE__ */ new WeakSet(), N = (e) => typeof e == "object" && !!e && fr.has(e), pr = /* @__PURE__ */ new Map(), P = l(() => {
|
|
422
|
+
let e = Xe(dr()), t = /* @__PURE__ */ new Map();
|
|
411
423
|
for (let [n, r] of e) {
|
|
412
|
-
let i = o(r), a =
|
|
424
|
+
let i = o(r), a = pr.get(n), s = a?.contents === i ? a.row : r;
|
|
413
425
|
e.set(n, s), t.set(n, {
|
|
414
426
|
row: s,
|
|
415
427
|
contents: i
|
|
416
|
-
}),
|
|
428
|
+
}), fr.add(s);
|
|
417
429
|
}
|
|
418
|
-
return
|
|
419
|
-
}),
|
|
420
|
-
alreadyLoaded:
|
|
421
|
-
clientReproducible:
|
|
422
|
-
trigger: l(() => Array.isArray(C.items) || C.prefill === !0 || C.enforceCoherence &&
|
|
430
|
+
return pr = t, e;
|
|
431
|
+
}), mr = (e) => o(N(e) ? e.value : cr(e, C.itemValue)), hr = l(() => o([...P.value.values()])), gr = l(() => P.value.size > 0), _r = l(() => dr() != null), vr = l(() => Ze(P.value, C.modelValue, C.multiple)), F = g("none"), yr = 0, br = l(() => F.value === "none" && vr.value), xr = l(() => C.prefill === !1 && !Array.isArray(C.items) && O.value && (!sr.value || vr.value)), Sr = l(() => M.value === null ? xr.value && !j.value ? Xt("select.searchToStart").value : C.emptyText : C.failedText || Xt("common.failedText").value), { hasPrefilled: I, isPrefilling: Cr, canLoad: wr, prefill: Tr, markPrefilled: Er } = Ke({
|
|
432
|
+
alreadyLoaded: qn,
|
|
433
|
+
clientReproducible: Kn,
|
|
434
|
+
trigger: l(() => Array.isArray(C.items) || C.prefill === !0 || C.enforceCoherence && sr.value && !br.value || C.prefill === "interaction" && Un.value),
|
|
423
435
|
currentValue: void 0,
|
|
424
436
|
multiple: !1,
|
|
425
437
|
fn: async () => {
|
|
426
|
-
await
|
|
438
|
+
await vi(j.value, "initial", C.modelValue) === "applied" && (C.stash && ir(...G.value.filter((e) => e.selected).map((e) => e.item)), oi());
|
|
427
439
|
}
|
|
428
|
-
}), L = l(() => C.multiple ? [].concat(C.modelValue) : [C.modelValue]), { data: R, get:
|
|
440
|
+
}), L = l(() => C.multiple ? [].concat(C.modelValue) : [C.modelValue]), { data: R, get: Dr } = Ue({ items: L }), z = ht(/* @__PURE__ */ new Map()), B = /* @__PURE__ */ new Map(), Or = /* @__PURE__ */ new Map(), kr = l(() => !!C.stash || gr.value), Ar = l(() => {
|
|
429
441
|
let e = /* @__PURE__ */ new Map();
|
|
430
|
-
for (let t of
|
|
431
|
-
let n = o(
|
|
442
|
+
for (let t of rr.value) {
|
|
443
|
+
let n = o(cr(t, C.itemValue));
|
|
432
444
|
e.has(n) || e.set(n, t);
|
|
433
445
|
}
|
|
434
446
|
return e;
|
|
435
|
-
}),
|
|
447
|
+
}), jr = l(() => vr.value || wr.value || Un.value), Mr = (e) => z.value.get(e) ?? (jr.value ? P.value.get(e) : void 0) ?? Ar.value.get(e), Nr = {
|
|
436
448
|
disabled: v(C, "disabled"),
|
|
437
449
|
itemText: C.itemText,
|
|
438
450
|
itemProps: v(C, "itemProps"),
|
|
@@ -441,43 +453,43 @@ var wt = {
|
|
|
441
453
|
max: v(C, "max"),
|
|
442
454
|
selectable: v(C, "selectable"),
|
|
443
455
|
selectedIndexedByHash: R
|
|
444
|
-
},
|
|
445
|
-
...
|
|
446
|
-
items:
|
|
447
|
-
}),
|
|
456
|
+
}, Pr = We({
|
|
457
|
+
...Nr,
|
|
458
|
+
items: Jn
|
|
459
|
+
}), Fr = l(() => {
|
|
448
460
|
let e = /* @__PURE__ */ new Map();
|
|
449
|
-
return
|
|
461
|
+
return Pr.baseOptions.value.forEach((t, n) => {
|
|
450
462
|
e.has(t.valueHash) || e.set(t.valueHash, n);
|
|
451
463
|
}), e;
|
|
452
464
|
}), V = l(() => {
|
|
453
465
|
let e = /* @__PURE__ */ new Map();
|
|
454
|
-
for (let t of
|
|
466
|
+
for (let t of Pr.baseOptions.value) e.has(t.valueHash) || e.set(t.valueHash, t.item);
|
|
455
467
|
return e;
|
|
456
|
-
}),
|
|
468
|
+
}), Ir = (e) => {
|
|
457
469
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
458
470
|
for (let r of L.value) {
|
|
459
471
|
let i = o(r);
|
|
460
472
|
if (n.has(i)) continue;
|
|
461
473
|
n.add(i);
|
|
462
|
-
let a =
|
|
474
|
+
let a = Mr(i);
|
|
463
475
|
a === void 0 || e().has(i) || t.push(a);
|
|
464
476
|
}
|
|
465
477
|
return t;
|
|
466
|
-
},
|
|
467
|
-
let t =
|
|
468
|
-
return t.length ? e && e.length === t.length && e.every((e, n) => e === t[n]) ? e : t :
|
|
469
|
-
}), H = ht([]), U = [],
|
|
470
|
-
let t = Z.value ?
|
|
478
|
+
}, Lr = /* @__PURE__ */ new Map(), Rr = [], zr = g(!1), Br = (e, t) => t.length ? e && e.length === t.length && e.every((e, n) => e === t[n]) ? e : t : Rr, Vr = l((e) => Br(e, Ir(() => Lr))), Hr = l((e) => {
|
|
479
|
+
let t = Ir(() => V.value);
|
|
480
|
+
return t.length ? e && e.length === t.length && e.every((e, n) => e === t[n]) ? e : t : Rr;
|
|
481
|
+
}), H = ht([]), U = [], Ur = ({ keepSticky: e = !0 } = {}) => {
|
|
482
|
+
let t = Z.value ? Ir(() => Lr) : Hr.value, n = [], r = /* @__PURE__ */ new Set(), i = R.value;
|
|
471
483
|
if (e && typeof C.items == "function") for (let e of U) {
|
|
472
484
|
if (i[e] === void 0) continue;
|
|
473
|
-
let t = V.value.get(e) ??
|
|
485
|
+
let t = V.value.get(e) ?? Mr(e);
|
|
474
486
|
t !== void 0 && (n.push({
|
|
475
487
|
valueHash: e,
|
|
476
488
|
row: t
|
|
477
489
|
}), r.add(e));
|
|
478
490
|
}
|
|
479
491
|
for (let e of t) {
|
|
480
|
-
let t =
|
|
492
|
+
let t = mr(e);
|
|
481
493
|
r.has(t) || (r.add(t), n.push({
|
|
482
494
|
valueHash: t,
|
|
483
495
|
row: e
|
|
@@ -488,22 +500,22 @@ var wt = {
|
|
|
488
500
|
return;
|
|
489
501
|
}
|
|
490
502
|
U = typeof C.items == "function" ? n.map(({ valueHash: e }) => e) : [];
|
|
491
|
-
}, W = !1,
|
|
492
|
-
let e =
|
|
503
|
+
}, W = !1, Wr = () => {
|
|
504
|
+
let e = Qn();
|
|
493
505
|
if (!(M.value === null && !e?.[0] && e?.[1] !== "search")) return;
|
|
494
506
|
let t = new Set(U);
|
|
495
507
|
H.value = H.value.filter(({ valueHash: e }) => P.value.has(e) || t.has(e) || K.has(e) || !V.value.has(e)), typeof C.items == "function" && (U = H.value.map(({ valueHash: e }) => e));
|
|
496
|
-
},
|
|
508
|
+
}, Gr = (e) => {
|
|
497
509
|
let t = H.value.filter(({ valueHash: t }) => e.has(t) || V.value.has(t));
|
|
498
510
|
t.length !== H.value.length && (H.value = t);
|
|
499
|
-
},
|
|
500
|
-
let t = [...
|
|
501
|
-
for (let { valueHash: e, row: n } of H.value)
|
|
502
|
-
return
|
|
503
|
-
}),
|
|
504
|
-
...
|
|
505
|
-
itemValue: (e) => N(e) ? e.value :
|
|
506
|
-
itemText: (e) => N(e) ? e.label :
|
|
511
|
+
}, Kr = l((e) => {
|
|
512
|
+
let t = [...Vr.value];
|
|
513
|
+
for (let { valueHash: e, row: n } of H.value) Fr.value.has(e) || t.push(Mr(e) ?? n);
|
|
514
|
+
return Br(e, t);
|
|
515
|
+
}), qr = We({
|
|
516
|
+
...Nr,
|
|
517
|
+
itemValue: (e) => N(e) ? e.value : cr(e, C.itemValue),
|
|
518
|
+
itemText: (e) => N(e) ? e.label : lr(e, C.itemText),
|
|
507
519
|
itemProps: l(() => {
|
|
508
520
|
if (!C.itemProps) return C.itemProps;
|
|
509
521
|
let { all: e } = Fe(C.itemProps);
|
|
@@ -513,13 +525,13 @@ var wt = {
|
|
|
513
525
|
let e = C.selectable;
|
|
514
526
|
return typeof e == "function" ? (t) => N(t) || e(t) : e;
|
|
515
527
|
}),
|
|
516
|
-
items:
|
|
517
|
-
}),
|
|
518
|
-
let e =
|
|
528
|
+
items: Kr
|
|
529
|
+
}), Jr = l(() => new Set(Vr.value.map(mr))), G = l(() => {
|
|
530
|
+
let e = Pr.options.value, t = qr.options.value, n = zr.value && !j.value;
|
|
519
531
|
if (!t.length && !(n && H.value.length)) return e;
|
|
520
|
-
let r =
|
|
532
|
+
let r = Fr.value;
|
|
521
533
|
if (!n) {
|
|
522
|
-
let n = t.filter((e) => !r.has(e.valueHash) &&
|
|
534
|
+
let n = t.filter((e) => !r.has(e.valueHash) && Jr.value.has(e.valueHash));
|
|
523
535
|
return n.length ? [...e, ...n] : e;
|
|
524
536
|
}
|
|
525
537
|
let i = new Map(t.map((e) => [e.valueHash, e])), a = [], o = /* @__PURE__ */ new Set(), s = !Z.value;
|
|
@@ -529,25 +541,25 @@ var wt = {
|
|
|
529
541
|
let c = n === void 0 ? i.get(t) : e[n];
|
|
530
542
|
!c || o.has(t) || (a.push(c), o.add(t));
|
|
531
543
|
}
|
|
532
|
-
for (let e of t) r.has(e.valueHash) || o.has(e.valueHash) ||
|
|
544
|
+
for (let e of t) r.has(e.valueHash) || o.has(e.valueHash) || Jr.value.has(e.valueHash) && (a.push(e), o.add(e.valueHash));
|
|
533
545
|
return a.length ? [...a, ...e.filter((e) => !o.has(e.valueHash))] : e;
|
|
534
|
-
}), K = /* @__PURE__ */ new Set(),
|
|
546
|
+
}), K = /* @__PURE__ */ new Set(), Yr = () => {
|
|
535
547
|
if (!U.length) return;
|
|
536
548
|
let e = R.value;
|
|
537
549
|
U = U.filter((t) => e[t] !== void 0);
|
|
538
|
-
},
|
|
539
|
-
if (!Y.value || !
|
|
540
|
-
let t = new Set(
|
|
550
|
+
}, Xr = () => Z.value || !j.value, Zr = (e) => {
|
|
551
|
+
if (!Y.value || !Xr()) return;
|
|
552
|
+
let t = new Set(Li.value.map((e) => e.valueHash));
|
|
541
553
|
for (let n of e) {
|
|
542
554
|
let e = o(n);
|
|
543
|
-
t.has(e) && (K.add(e),
|
|
555
|
+
t.has(e) && (K.add(e), Qr(e));
|
|
544
556
|
}
|
|
545
|
-
},
|
|
557
|
+
}, Qr = (e) => {
|
|
546
558
|
let t = new Set(H.value.map((e) => e.valueHash));
|
|
547
559
|
if (t.has(e) || V.value.has(e)) return;
|
|
548
560
|
let n = [];
|
|
549
|
-
for (let r of
|
|
550
|
-
let i =
|
|
561
|
+
for (let r of Hr.value) {
|
|
562
|
+
let i = mr(r);
|
|
551
563
|
if (!t.has(i) && (n.push({
|
|
552
564
|
valueHash: i,
|
|
553
565
|
row: r
|
|
@@ -557,14 +569,14 @@ var wt = {
|
|
|
557
569
|
}
|
|
558
570
|
}
|
|
559
571
|
};
|
|
560
|
-
|
|
561
|
-
let
|
|
572
|
+
ur && (ur.userUnpick = Zr, ur.isKnown = N);
|
|
573
|
+
let $r = (e) => ({
|
|
562
574
|
...e,
|
|
563
575
|
loading: J.value,
|
|
564
576
|
known: N(e.item)
|
|
565
577
|
});
|
|
566
578
|
b(R, (e) => {
|
|
567
|
-
if (Y.value ||
|
|
579
|
+
if (Y.value || Yr(), H.value.length) {
|
|
568
580
|
let t = H.value.filter(({ valueHash: t }) => e[t] !== void 0 || K.has(t));
|
|
569
581
|
t.length !== H.value.length && (H.value = t);
|
|
570
582
|
}
|
|
@@ -574,23 +586,23 @@ var wt = {
|
|
|
574
586
|
for (let n of z.value.keys()) e[n] !== void 0 || P.value.has(n) || (t ??= new Map(z.value), t.delete(n));
|
|
575
587
|
t && (z.value = t);
|
|
576
588
|
}
|
|
577
|
-
!C.stash || !
|
|
589
|
+
!C.stash || !rr.value.length || ar((t) => e[o(cr(t, C.itemValue))] !== void 0);
|
|
578
590
|
});
|
|
579
|
-
let { data:
|
|
591
|
+
let { data: ei } = Ue({
|
|
580
592
|
items: G,
|
|
581
593
|
key: "valueHash"
|
|
582
594
|
});
|
|
583
|
-
b(() =>
|
|
595
|
+
b(() => kr.value && (gr.value || rr.value.length) ? ei.value : null, (e) => {
|
|
584
596
|
if (!e) return;
|
|
585
|
-
let t =
|
|
597
|
+
let t = gr.value ? [.../* @__PURE__ */ new Set([...Object.keys(R.value), ...P.value.keys()])] : [...Ar.value.keys()], n = null;
|
|
586
598
|
for (let r of t) {
|
|
587
599
|
let t = e[r]?.item;
|
|
588
600
|
if (t === void 0) continue;
|
|
589
601
|
let i = z.value.get(r);
|
|
590
|
-
if (!(t === P.value.get(r) || t ===
|
|
591
|
-
let e =
|
|
592
|
-
if (e?.rows ===
|
|
593
|
-
|
|
602
|
+
if (!(t === P.value.get(r) || t === Ar.value.get(r) || t === i)) {
|
|
603
|
+
let e = Or.get(r);
|
|
604
|
+
if (e?.rows === Jn.value && e.row === t) continue;
|
|
605
|
+
Or.delete(r), B.set(r, t);
|
|
594
606
|
continue;
|
|
595
607
|
}
|
|
596
608
|
let a = B.get(r);
|
|
@@ -598,101 +610,101 @@ var wt = {
|
|
|
598
610
|
}
|
|
599
611
|
n && (z.value = n);
|
|
600
612
|
});
|
|
601
|
-
let { coherent:
|
|
613
|
+
let { coherent: ti } = Ge({
|
|
602
614
|
modelValue: v(C, "modelValue"),
|
|
603
615
|
multiple: C.multiple,
|
|
604
|
-
iteratee: (e) =>
|
|
605
|
-
}),
|
|
616
|
+
iteratee: (e) => !!ei.value[o(e)]
|
|
617
|
+
}), ni = l(() => new Set(Jn.value.map((e) => o(cr(e, C.itemValue))))), { coherent: ri, coherentValue: ii } = Ge({
|
|
606
618
|
modelValue: v(C, "modelValue"),
|
|
607
619
|
multiple: C.multiple,
|
|
608
620
|
iteratee: (e) => {
|
|
609
621
|
let t = o(e);
|
|
610
|
-
return
|
|
622
|
+
return ni.value.has(t) || typeof C.items == "function" && F.value !== "revoked" && P.value.has(t);
|
|
611
623
|
}
|
|
612
|
-
}),
|
|
613
|
-
if (!C.enforceCoherence ||
|
|
624
|
+
}), ai, oi = () => {
|
|
625
|
+
if (!C.enforceCoherence || ri.value) return !1;
|
|
614
626
|
let e = o(C.modelValue);
|
|
615
|
-
if (e ===
|
|
616
|
-
|
|
617
|
-
|
|
627
|
+
if (e === ai) return !1;
|
|
628
|
+
ai = e, ut(() => {
|
|
629
|
+
ai === e && (ai = void 0);
|
|
618
630
|
});
|
|
619
|
-
let t =
|
|
620
|
-
return
|
|
621
|
-
}, q = l(() => L.value.map((e) =>
|
|
631
|
+
let t = ii.value;
|
|
632
|
+
return Gr(new Set((C.multiple ? [].concat(t) : [t]).map((e) => o(e)))), w("update:modelValue", t), !0;
|
|
633
|
+
}, q = l(() => L.value.map((e) => ei.value[o(e)]).filter(Boolean)), si = l(() => M.value === null ? q.value : L.value.map((e) => {
|
|
622
634
|
let t = o(e);
|
|
623
|
-
return
|
|
635
|
+
return ei.value[t] ?? {
|
|
624
636
|
value: e,
|
|
625
637
|
valueHash: t,
|
|
626
638
|
text: Re(e),
|
|
627
639
|
unresolved: !0
|
|
628
640
|
};
|
|
629
|
-
})),
|
|
641
|
+
})), ci = (e) => ({
|
|
630
642
|
item: e.item,
|
|
631
643
|
text: e.text,
|
|
632
644
|
value: e.value,
|
|
633
645
|
selected: e.selected ?? !0,
|
|
634
646
|
disabled: e.disabled ?? !1
|
|
635
|
-
}),
|
|
636
|
-
function
|
|
637
|
-
return !C.enforceCoherence || F.value === "none" || !
|
|
647
|
+
}), li = l(() => q.value.map(ci)), J = l(() => !!(Yn.value || C.loading)), ui = l(() => J.value && !Z.value && !di.value && G.value.length > 0), di = l(() => J.value && Li.value.length > 0 && (Z.value || gr.value && !Jn.value.length)), fi = l(() => !!C.hasErrors), pi = l(() => !!C.hasWarnings && !fi.value), mi = l(() => si.value.map((e) => e.text).filter(Boolean).join(", ") || ""), hi = ht(/* @__PURE__ */ new Set());
|
|
648
|
+
function gi() {
|
|
649
|
+
return !C.enforceCoherence || F.value === "none" || !gr.value || typeof C.items != "function" ? !1 : L.value.some((e) => {
|
|
638
650
|
let t = o(e);
|
|
639
|
-
return P.value.has(t) && !
|
|
651
|
+
return P.value.has(t) && !hi.value.has(t);
|
|
640
652
|
});
|
|
641
653
|
}
|
|
642
|
-
let
|
|
643
|
-
if (!(n !== "applied" || e !==
|
|
644
|
-
if (typeof C.items == "function" && (
|
|
645
|
-
let e = new Set(
|
|
654
|
+
let _i = (e, t, n) => {
|
|
655
|
+
if (!(n !== "applied" || e !== yr)) {
|
|
656
|
+
if (typeof C.items == "function" && (_r.value || F.value !== "none")) {
|
|
657
|
+
let e = new Set(hi.value);
|
|
646
658
|
for (let t of V.value.keys()) e.add(t);
|
|
647
|
-
|
|
659
|
+
hi.value = e;
|
|
648
660
|
}
|
|
649
|
-
t !== "search" && F.value === "pending" && (F.value = "revoked",
|
|
661
|
+
t !== "search" && F.value === "pending" && (F.value = "revoked", Gr(new Set(Object.keys(R.value))));
|
|
650
662
|
}
|
|
651
663
|
};
|
|
652
|
-
async function
|
|
653
|
-
let r =
|
|
654
|
-
return
|
|
664
|
+
async function vi(e, t, n) {
|
|
665
|
+
let r = yr, i = await Wn(e, t, n);
|
|
666
|
+
return _i(r, t, i), i;
|
|
655
667
|
}
|
|
656
|
-
function
|
|
657
|
-
|
|
668
|
+
function yi() {
|
|
669
|
+
bi = !1, Yi = !1, W && (W = !1, Wr()), Z.value = !1;
|
|
658
670
|
}
|
|
659
|
-
let
|
|
660
|
-
if (!
|
|
661
|
-
if (
|
|
662
|
-
|
|
671
|
+
let bi = !1, xi = !1, Si = () => {
|
|
672
|
+
if (!sr.value || ti.value) return;
|
|
673
|
+
if (er()) {
|
|
674
|
+
Zn()?.[1] === "search" && (xi = !0);
|
|
663
675
|
return;
|
|
664
676
|
}
|
|
665
677
|
let e = I.value ? "model" : "initial";
|
|
666
|
-
e === "initial" &&
|
|
667
|
-
e === "applied" &&
|
|
678
|
+
e === "initial" && Er(), vi(j.value, e, C.modelValue).then((e) => {
|
|
679
|
+
e === "applied" && oi();
|
|
668
680
|
});
|
|
669
|
-
},
|
|
670
|
-
b(
|
|
671
|
-
|
|
681
|
+
}, Ci = xt(Si, C.depsDebounceTime);
|
|
682
|
+
b($n, () => {
|
|
683
|
+
xi && (xi = !1, Si());
|
|
672
684
|
});
|
|
673
|
-
let
|
|
674
|
-
if (typeof C.items != "function" || (Z.value = !0,
|
|
685
|
+
let wi = () => {
|
|
686
|
+
if (typeof C.items != "function" || (Z.value = !0, Ur(), xr.value && !j.value)) return;
|
|
675
687
|
let e = j.value ? "search" : "initial";
|
|
676
|
-
|
|
677
|
-
t === "applied" && e !== "search" &&
|
|
688
|
+
vi(j.value, e, C.modelValue).then((t) => {
|
|
689
|
+
t === "applied" && e !== "search" && oi();
|
|
678
690
|
});
|
|
679
|
-
},
|
|
691
|
+
}, Ti = () => new Map([...P.value].map(([e, t]) => [e, o(t)])), Ei = Ti(), Di = /* @__PURE__ */ new WeakMap(), Oi = 0, ki = (e) => typeof e == "function" ? e : Array.isArray(e) ? (Di.has(e) || Di.set(e, ++Oi), `array:${Di.get(e)}`) : e, Ai = l(() => o([C.dependencies, ki(C.items)])), ji = l(() => o(C.modelValue)), Mi, Ni;
|
|
680
692
|
b([
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
693
|
+
Ai,
|
|
694
|
+
hr,
|
|
695
|
+
ji
|
|
684
696
|
], ([e, t, n], [r, i, a]) => {
|
|
685
697
|
let o = e !== r, s = t !== i, c = n !== a;
|
|
686
698
|
if (s) {
|
|
687
|
-
let e =
|
|
699
|
+
let e = Ti();
|
|
688
700
|
if (z.value.size || B.size) {
|
|
689
701
|
let t = null;
|
|
690
702
|
for (let [n, r] of e) {
|
|
691
|
-
if (
|
|
703
|
+
if (Ei.get(n) === r) continue;
|
|
692
704
|
B.delete(n);
|
|
693
705
|
let e = V.value.get(n);
|
|
694
|
-
e !== void 0 &&
|
|
695
|
-
rows:
|
|
706
|
+
e !== void 0 && Or.set(n, {
|
|
707
|
+
rows: Jn.value,
|
|
696
708
|
row: e
|
|
697
709
|
}), z.value.has(n) && (t ??= new Map(z.value), t.delete(n));
|
|
698
710
|
}
|
|
@@ -700,57 +712,57 @@ var wt = {
|
|
|
700
712
|
}
|
|
701
713
|
if (z.value.size || B.size) {
|
|
702
714
|
let t = R.value, n = null;
|
|
703
|
-
for (let r of
|
|
715
|
+
for (let r of Ei.keys()) e.has(r) || t[r] !== void 0 || (B.delete(r), z.value.has(r) && (n ??= new Map(z.value), n.delete(r)));
|
|
704
716
|
n && (z.value = n);
|
|
705
717
|
}
|
|
706
|
-
|
|
718
|
+
Ei = e;
|
|
707
719
|
}
|
|
708
|
-
if (o && Array.isArray(C.items) &&
|
|
709
|
-
if (F.value = "none",
|
|
710
|
-
let t = I.value ||
|
|
711
|
-
|
|
720
|
+
if (o && Array.isArray(C.items) && yi(), o && s && c && vr.value) {
|
|
721
|
+
if (F.value = "none", hi.value = /* @__PURE__ */ new Set(), yr++, Mi = e, typeof C.items != "function") return;
|
|
722
|
+
let t = I.value || er();
|
|
723
|
+
tr(), Y.value ? wi() : t && (bi = !0);
|
|
712
724
|
return;
|
|
713
725
|
}
|
|
714
726
|
if (o) {
|
|
715
|
-
F.value = "pending",
|
|
727
|
+
F.value = "pending", hi.value = /* @__PURE__ */ new Set(), yr++, Mi = void 0, c && (Ni = n);
|
|
716
728
|
return;
|
|
717
729
|
}
|
|
718
|
-
c && (
|
|
730
|
+
c && (Ni = void 0), s && !c && !vr.value && Ci();
|
|
719
731
|
}, { flush: "pre" }), Le(() => C.modelValue, async () => {
|
|
720
|
-
if (!
|
|
721
|
-
let e =
|
|
722
|
-
if (!(!(Array.isArray(C.items) && C.enforceCoherence &&
|
|
732
|
+
if (!wr.value) return;
|
|
733
|
+
let e = gi() && ji.value !== Ni;
|
|
734
|
+
if (!(!(Array.isArray(C.items) && C.enforceCoherence && gr.value && L.value.some((e) => {
|
|
723
735
|
let t = o(e);
|
|
724
736
|
return P.value.has(t) && !V.value.has(t);
|
|
725
|
-
})) &&
|
|
737
|
+
})) && ti.value) || e) {
|
|
726
738
|
let e = I.value ? "model" : "initial";
|
|
727
|
-
if (e === "initial" &&
|
|
728
|
-
|
|
739
|
+
if (e === "initial" && Er(), await vi(j.value, e, C.modelValue) !== "applied") return;
|
|
740
|
+
oi() && D.value?.blur();
|
|
729
741
|
}
|
|
730
742
|
}, { debounce: C.modelValueDebounceTime }), Le(() => [C.dependencies, C.items], async () => {
|
|
731
|
-
if (
|
|
732
|
-
let e =
|
|
733
|
-
if (!
|
|
734
|
-
let t = I.value ||
|
|
735
|
-
I.value ||
|
|
743
|
+
if (Ai.value === Mi && typeof C.items == "function") return;
|
|
744
|
+
let e = _r.value && C.enforceCoherence && sr.value;
|
|
745
|
+
if (!wr.value && !e) return;
|
|
746
|
+
let t = I.value || _r.value ? "dependencies" : "initial";
|
|
747
|
+
I.value || Er(), await vi(j.value, t, C.modelValue) === "applied" && (Gr(new Set(Object.keys(R.value))), oi() && D.value?.blur());
|
|
736
748
|
}, { debounce: C.depsDebounceTime });
|
|
737
|
-
let
|
|
749
|
+
let Pi = async (e) => {
|
|
738
750
|
let t = pn();
|
|
739
751
|
if (!C.multiple) for (let e of Object.keys(R.value)) K.add(e);
|
|
740
|
-
K.delete(e.valueHash), C.multiple ? (w("update:modelValue", [...C.modelValue, e.value]), C.stash &&
|
|
741
|
-
},
|
|
752
|
+
K.delete(e.valueHash), C.multiple ? (w("update:modelValue", [...C.modelValue, e.value]), C.stash && ir(e.item)) : (C.stash && or(e.item), w("update:modelValue", e.value), await ut()), C.multiple && O.value && Y.value ? t && un() : A(), C.multiple || $();
|
|
753
|
+
}, Fi = async (e) => {
|
|
742
754
|
let t = pn();
|
|
743
755
|
if (!C.multiple) {
|
|
744
756
|
A(), $();
|
|
745
757
|
return;
|
|
746
758
|
}
|
|
747
|
-
|
|
759
|
+
Xr() && (K.add(e.valueHash), Qr(e.valueHash));
|
|
748
760
|
let n = { ...R.value };
|
|
749
761
|
delete n[e.valueHash], w("update:modelValue", Object.values(n)), O.value && Y.value ? t && un() : A();
|
|
750
|
-
},
|
|
762
|
+
}, Ii = l(() => {
|
|
751
763
|
let e = Ie(C.itemProps, "description");
|
|
752
764
|
return e === void 0 ? G.value.some((e) => e.description !== void 0) : e;
|
|
753
|
-
}),
|
|
765
|
+
}), Li = l(() => {
|
|
754
766
|
if (Z.value) {
|
|
755
767
|
if (!H.value.length) return [];
|
|
756
768
|
let e = new Set(H.value.map(({ valueHash: e }) => e));
|
|
@@ -759,13 +771,13 @@ var wt = {
|
|
|
759
771
|
if (!j.value || !C.multiple && q.value.some((e) => e.text === j.value) || C.filterBy === !1) return G.value;
|
|
760
772
|
let e = j.value.trim(), t = C.filterBy;
|
|
761
773
|
return Array.isArray(t) && t.length ? G.value.filter((n) => be(n.item, t, e)) : G.value.filter((t) => be(t, t.description == null ? ["text"] : ["text", "description"], e));
|
|
762
|
-
}),
|
|
763
|
-
if (t(C.groupBy)) return
|
|
774
|
+
}), Ri = Symbol("default"), zi = (e) => {
|
|
775
|
+
if (t(C.groupBy)) return Ri;
|
|
764
776
|
if (!N(e.item)) return typeof C.groupBy == "function" ? C.groupBy(e.item) : me(e.item, C.groupBy);
|
|
765
|
-
},
|
|
766
|
-
let e = j.value ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([...H.value.map(({ valueHash: e }) => e).filter((e) => Z.value || !
|
|
767
|
-
return
|
|
768
|
-
let a =
|
|
777
|
+
}, Bi = l(() => {
|
|
778
|
+
let e = j.value ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([...H.value.map(({ valueHash: e }) => e).filter((e) => Z.value || !Fr.value.has(e)), ...zr.value ? Hr.value.map(mr) : []]), t = [], n = {};
|
|
779
|
+
return Li.value.forEach((r, i) => {
|
|
780
|
+
let a = zi(r), s = o(a), c = n[s];
|
|
769
781
|
c || (c = n[s] = {
|
|
770
782
|
id: s,
|
|
771
783
|
data: a ?? null,
|
|
@@ -782,129 +794,129 @@ var wt = {
|
|
|
782
794
|
options: [...r, ...n]
|
|
783
795
|
})).filter((e) => e.options.length);
|
|
784
796
|
}), Y = g(!1);
|
|
785
|
-
b(Y, (e) =>
|
|
786
|
-
let
|
|
797
|
+
b(Y, (e) => zr.value = e, { flush: "sync" });
|
|
798
|
+
let Vi = ne(Y), Hi = fe(Y, () => C.transitionDuration), Ui = () => (C.adaptive ?? Mt.adaptive) && Wt.value ? "canvas" : "popover", Wi = g(Ui()), X = l(() => Wi.value === "canvas");
|
|
787
799
|
b([
|
|
788
800
|
() => C.adaptive,
|
|
789
801
|
Wt,
|
|
790
802
|
Y
|
|
791
803
|
], () => {
|
|
792
|
-
Y.value || (
|
|
804
|
+
Y.value || (Wi.value = Ui());
|
|
793
805
|
}), de(X);
|
|
794
|
-
let
|
|
806
|
+
let Gi = Ye();
|
|
795
807
|
Je(null), Se({
|
|
796
808
|
active: () => Y.value && X.value,
|
|
797
809
|
input: () => Lt.value
|
|
798
810
|
});
|
|
799
|
-
let
|
|
811
|
+
let Ki = {
|
|
800
812
|
onShow: () => w("show"),
|
|
801
813
|
onShown: () => w("shown"),
|
|
802
814
|
onHide: () => w("hide"),
|
|
803
815
|
onHidden: () => w("hidden")
|
|
804
|
-
},
|
|
805
|
-
...
|
|
816
|
+
}, qi = {
|
|
817
|
+
...Ki,
|
|
806
818
|
onHidden: () => {
|
|
807
|
-
|
|
819
|
+
na(), w("hidden");
|
|
808
820
|
}
|
|
809
|
-
},
|
|
821
|
+
}, Ji = l(() => ({
|
|
810
822
|
side: "bottom",
|
|
811
823
|
size: "auto",
|
|
812
824
|
draggable: !0,
|
|
813
825
|
focusTarget: ".bb-select-popover--sheet",
|
|
814
826
|
hideClose: !0,
|
|
815
827
|
transitionDuration: C.transitionDuration,
|
|
816
|
-
...C.offCanvasProps?.title ? {} : { "aria-label":
|
|
828
|
+
...C.offCanvasProps?.title ? {} : { "aria-label": ma.value },
|
|
817
829
|
...r(C.offCanvasProps)
|
|
818
|
-
})),
|
|
819
|
-
b(
|
|
820
|
-
Z.value = !1, W && (W = !1,
|
|
821
|
-
let e =
|
|
822
|
-
|
|
830
|
+
})), Yi = !1, Z = g(!1);
|
|
831
|
+
b($n, () => {
|
|
832
|
+
Z.value = !1, W && (W = !1, Wr());
|
|
833
|
+
let e = Qn();
|
|
834
|
+
Xi && Y.value && !j.value && e?.[0] === "" && M.value === null && (Xi = !1, Ur({ keepSticky: !1 }));
|
|
823
835
|
});
|
|
824
|
-
let
|
|
836
|
+
let Xi = !1;
|
|
825
837
|
b(j, (e, t) => {
|
|
826
|
-
Y.value && t && !e && (
|
|
838
|
+
Y.value && t && !e && (Xi = !0);
|
|
827
839
|
}), b(j, () => {
|
|
828
840
|
Q = !1, Y.value && D.value?.scrollToTop();
|
|
829
841
|
}, { flush: "post" });
|
|
830
|
-
let Q = !1,
|
|
842
|
+
let Q = !1, Zi = () => {
|
|
831
843
|
Q = !1;
|
|
832
844
|
};
|
|
833
|
-
b(
|
|
834
|
-
!Q || !Y.value || j.value ||
|
|
845
|
+
b($n, async () => {
|
|
846
|
+
!Q || !Y.value || j.value || Qn()?.[0] === "" && (Q = !1, await ut(), Y.value && D.value?.scrollToSelected());
|
|
835
847
|
}, { flush: "post" });
|
|
836
|
-
let
|
|
837
|
-
if (
|
|
848
|
+
let Qi = () => {
|
|
849
|
+
if (nr(), typeof C.items != "function") return;
|
|
838
850
|
let e = (e) => !!e?.[0];
|
|
839
|
-
(e(
|
|
840
|
-
},
|
|
841
|
-
if (!
|
|
842
|
-
let e =
|
|
843
|
-
|
|
844
|
-
e === "applied" &&
|
|
851
|
+
(e(Qn()) || er() && e(Zn())) && (Yi = !0, tr());
|
|
852
|
+
}, $i = () => {
|
|
853
|
+
if (!Yi && !bi) return;
|
|
854
|
+
let e = bi ? "initial" : "reopen";
|
|
855
|
+
Yi = !1, bi = !1, Er(), Z.value = !0, !xr.value && vi("", e, C.modelValue).then((e) => {
|
|
856
|
+
e === "applied" && oi();
|
|
845
857
|
});
|
|
846
|
-
},
|
|
858
|
+
}, ea = async ({ focusPopoverContent: e = !0 } = {}) => {
|
|
847
859
|
if (C.disabled || C.readonly || Y.value) return;
|
|
848
|
-
|
|
849
|
-
let t = !I.value && !
|
|
850
|
-
await
|
|
851
|
-
},
|
|
852
|
-
await ut(), Y.value && (X.value || (nn = !0, rn(), ee(
|
|
860
|
+
Wi.value = Ui(), Jt.value = qt(), Un.value = !0, $i(), Ur(), Q = typeof C.items == "function" && !xr.value && (Z.value || er() || !I.value), Y.value = !0;
|
|
861
|
+
let t = !I.value && !Cr.value && !xr.value ? Tr() : void 0;
|
|
862
|
+
await ta(e), await t;
|
|
863
|
+
}, ta = async (e) => {
|
|
864
|
+
await ut(), Y.value && (X.value || (nn = !0, rn(), ee(Vn, { element: () => {
|
|
853
865
|
let e = D.value?.$el;
|
|
854
866
|
return e instanceof Element ? e.closest(".bb-common-popover") : null;
|
|
855
|
-
} }), document.addEventListener("click", bn, { capture: !0 }), document.addEventListener("focusin", bn, { capture: !0 }), document.addEventListener("keydown",
|
|
867
|
+
} }), document.addEventListener("click", bn, { capture: !0 }), document.addEventListener("focusin", bn, { capture: !0 }), document.addEventListener("keydown", Hn, { capture: !0 }), e && (await pe(0), Y.value && (O.value ? un() : dn()))));
|
|
856
868
|
}, $ = async () => {
|
|
857
|
-
Y.value && (Y.value = !1, D.value?.blur(), zt.value = void 0, j.value = "", Q = !1,
|
|
858
|
-
},
|
|
859
|
-
D.value?.blur(), zt.value = void 0, j.value = "", Q = !1,
|
|
860
|
-
},
|
|
861
|
-
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
},
|
|
869
|
+
Y.value && (Y.value = !1, D.value?.blur(), zt.value = void 0, j.value = "", Q = !1, Qi(), H.value = [], K.clear(), Xi = !1, W = !1, Yr(), !X.value && (an(), te(Vn), document.removeEventListener("click", bn, { capture: !0 }), document.removeEventListener("focusin", bn, { capture: !0 }), document.removeEventListener("keydown", Hn, { capture: !0 })));
|
|
870
|
+
}, na = () => {
|
|
871
|
+
D.value?.blur(), zt.value = void 0, j.value = "", Q = !1, Qi(), H.value = [], K.clear(), Xi = !1, W = !1, Yr(), oa(), A();
|
|
872
|
+
}, ra = () => Y.value ? $() : ea(), ia = g(!1), aa = () => {
|
|
873
|
+
ia.value || (ia.value = !0, w("active"));
|
|
874
|
+
}, oa = () => {
|
|
875
|
+
ia.value && (ia.value = !1, w("inactive"));
|
|
876
|
+
}, sa = (e) => {
|
|
865
877
|
if (!(e instanceof Node)) return !1;
|
|
866
878
|
let t = !!E.value?.contains(e), n = D.value?.$el, r = n instanceof Element && !!n.closest(".bb-common-popover")?.contains(e);
|
|
867
879
|
return t || r;
|
|
868
|
-
},
|
|
869
|
-
clearTimeout(
|
|
880
|
+
}, ca, la = () => {
|
|
881
|
+
clearTimeout(ca), ca = setTimeout(() => {
|
|
870
882
|
if (Y.value) {
|
|
871
|
-
|
|
883
|
+
aa();
|
|
872
884
|
return;
|
|
873
885
|
}
|
|
874
|
-
if (
|
|
875
|
-
|
|
886
|
+
if (sa(document.activeElement)) {
|
|
887
|
+
aa();
|
|
876
888
|
return;
|
|
877
889
|
}
|
|
878
|
-
|
|
890
|
+
oa();
|
|
879
891
|
}, 0);
|
|
880
|
-
}, la = () => {
|
|
881
|
-
Xr(L.value), w("update:modelValue", C.multiple ? [] : null);
|
|
882
892
|
}, ua = () => {
|
|
883
|
-
|
|
884
|
-
}, da =
|
|
893
|
+
Zr(L.value), w("update:modelValue", C.multiple ? [] : null);
|
|
894
|
+
}, da = () => {
|
|
895
|
+
j.value = "", ua();
|
|
896
|
+
}, fa = l(() => ({
|
|
885
897
|
close: $,
|
|
886
|
-
clear:
|
|
898
|
+
clear: ua,
|
|
887
899
|
focus: fn,
|
|
888
900
|
query: j.value,
|
|
889
|
-
selectedOptions:
|
|
901
|
+
selectedOptions: li.value,
|
|
890
902
|
titleId: `${k}_title`
|
|
891
|
-
})),
|
|
903
|
+
})), pa = null, ma = g();
|
|
892
904
|
b(Y, (e) => {
|
|
893
|
-
e && (
|
|
905
|
+
e && (ma.value = ke(E.value));
|
|
894
906
|
}, {
|
|
895
907
|
immediate: !0,
|
|
896
908
|
flush: "sync"
|
|
897
909
|
});
|
|
898
|
-
let
|
|
910
|
+
let ha = l(() => {
|
|
899
911
|
let e = E.value;
|
|
900
912
|
return e ? e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby") : !1;
|
|
901
|
-
}),
|
|
913
|
+
}), ga = l(() => Xt("select.triggerLabel").value), _a = g(), va = g();
|
|
902
914
|
return b(E, (e) => {
|
|
903
|
-
if (
|
|
915
|
+
if (pa &&= (pa(), null), !e) return;
|
|
904
916
|
e.setAttribute("role", "combobox"), e.setAttribute("aria-haspopup", "listbox");
|
|
905
917
|
let t = !e.id;
|
|
906
918
|
t && (e.id = `${k}_activator`);
|
|
907
|
-
let n =
|
|
919
|
+
let n = ha.value, r = async (e) => {
|
|
908
920
|
if (w("click", e), !C.disabled) {
|
|
909
921
|
if (e.preventDefault(), C.readonly) {
|
|
910
922
|
A();
|
|
@@ -914,10 +926,10 @@ var wt = {
|
|
|
914
926
|
await $(), A();
|
|
915
927
|
return;
|
|
916
928
|
}
|
|
917
|
-
await
|
|
929
|
+
await ea();
|
|
918
930
|
}
|
|
919
931
|
}, i = (e) => {
|
|
920
|
-
!C.readonly || C.disabled || (e.preventDefault(),
|
|
932
|
+
!C.readonly || C.disabled || (e.preventDefault(), aa(), A());
|
|
921
933
|
}, a = (e) => {
|
|
922
934
|
switch (e.key) {
|
|
923
935
|
case "ArrowDown":
|
|
@@ -933,40 +945,40 @@ var wt = {
|
|
|
933
945
|
e.preventDefault(), Nn();
|
|
934
946
|
break;
|
|
935
947
|
default:
|
|
936
|
-
|
|
948
|
+
In(e);
|
|
937
949
|
break;
|
|
938
950
|
case "Enter":
|
|
939
|
-
e.preventDefault(),
|
|
951
|
+
e.preventDefault(), Ln();
|
|
940
952
|
break;
|
|
941
953
|
case "Escape":
|
|
942
|
-
Y.value && (e.preventDefault(),
|
|
954
|
+
Y.value && (e.preventDefault(), Rn());
|
|
943
955
|
break;
|
|
944
956
|
}
|
|
945
957
|
}, o = (e) => {
|
|
946
|
-
w("focus", e),
|
|
958
|
+
w("focus", e), aa();
|
|
947
959
|
}, s = (e) => {
|
|
948
|
-
w("blur", e),
|
|
960
|
+
w("blur", e), la();
|
|
949
961
|
};
|
|
950
|
-
e.addEventListener("click", r), e.addEventListener("pointerdown", i), e.addEventListener("keydown", a), e.addEventListener("focus", o), e.addEventListener("blur", s),
|
|
962
|
+
e.addEventListener("click", r), e.addEventListener("pointerdown", i), e.addEventListener("keydown", a), e.addEventListener("focus", o), e.addEventListener("blur", s), pa = () => {
|
|
951
963
|
e.removeEventListener("click", r), e.removeEventListener("pointerdown", i), e.removeEventListener("keydown", a), e.removeEventListener("focus", o), e.removeEventListener("blur", s), e.removeAttribute("role"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-activedescendant"), n || e.removeAttribute("aria-label"), t && e.removeAttribute("id");
|
|
952
964
|
};
|
|
953
965
|
}, { immediate: !0 }), b([
|
|
954
966
|
E,
|
|
955
967
|
Y,
|
|
956
|
-
|
|
968
|
+
Vi,
|
|
957
969
|
en,
|
|
958
970
|
tn,
|
|
959
971
|
zt,
|
|
960
|
-
|
|
961
|
-
|
|
972
|
+
ha,
|
|
973
|
+
ga
|
|
962
974
|
], ([e, t, n, r, i, a, o, s]) => {
|
|
963
|
-
e && (e.setAttribute("aria-expanded", String(t)), o || e.setAttribute("aria-label", s),
|
|
975
|
+
e && (e.setAttribute("aria-expanded", String(t)), o || e.setAttribute("aria-label", s), _a.value = e.getAttribute("aria-labelledby") ?? void 0, va.value = e.getAttribute("aria-label") ?? void 0, r == null ? e.removeAttribute("aria-invalid") : e.setAttribute("aria-invalid", r), n ? e.setAttribute("aria-controls", `${k}_listbox`) : e.removeAttribute("aria-controls"), i == null ? e.removeAttribute("aria-describedby") : e.setAttribute("aria-describedby", i), t && a ? e.setAttribute("aria-activedescendant", a) : e.removeAttribute("aria-activedescendant"));
|
|
964
976
|
}, { immediate: !0 }), ft(() => {
|
|
965
|
-
clearTimeout(
|
|
977
|
+
clearTimeout(ca), pa?.(), Sn.abort(), te(Vn), document.removeEventListener("click", bn, { capture: !0 }), document.removeEventListener("focusin", bn, { capture: !0 }), document.removeEventListener("keydown", Hn, { capture: !0 });
|
|
966
978
|
}), pt(() => {
|
|
967
979
|
$();
|
|
968
980
|
}), (e, t) => (h(), u(nt, null, [
|
|
969
|
-
d(y(je), { value: y(
|
|
981
|
+
d(y(je), { value: y(Xn) }, null, 8, ["value"]),
|
|
970
982
|
Ht.value ? it("", !0) : _(e.$slots, "activator", m(p({ key: 0 }, {
|
|
971
983
|
props: { ref: Ut },
|
|
972
984
|
shown: Y.value,
|
|
@@ -974,13 +986,13 @@ var wt = {
|
|
|
974
986
|
readonly: e.readonly,
|
|
975
987
|
loading: J.value,
|
|
976
988
|
query: j.value,
|
|
977
|
-
selectedOptions:
|
|
978
|
-
text:
|
|
979
|
-
clear:
|
|
989
|
+
selectedOptions: li.value,
|
|
990
|
+
text: mi.value,
|
|
991
|
+
clear: ua,
|
|
980
992
|
focus: fn,
|
|
981
|
-
open:
|
|
993
|
+
open: ea,
|
|
982
994
|
close: $,
|
|
983
|
-
toggle:
|
|
995
|
+
toggle: ra
|
|
984
996
|
}))),
|
|
985
997
|
d(y(Nt), null, {
|
|
986
998
|
default: x(() => [O.value ? (h(), u("div", wt, [
|
|
@@ -990,7 +1002,7 @@ var wt = {
|
|
|
990
1002
|
ref: Lt,
|
|
991
1003
|
"onUpdate:modelValue": t[0] ||= (e) => j.value = e,
|
|
992
1004
|
"aria-activedescendant": zt.value,
|
|
993
|
-
"aria-controls": y(
|
|
1005
|
+
"aria-controls": y(Vi) ? `${y(k)}_listbox` : void 0,
|
|
994
1006
|
"aria-describedby": tn.value,
|
|
995
1007
|
"aria-invalid": en.value,
|
|
996
1008
|
"aria-label": Zt.value,
|
|
@@ -1005,7 +1017,7 @@ var wt = {
|
|
|
1005
1017
|
onChange: S(gn, ["stop"]),
|
|
1006
1018
|
onFocus: S(mn, ["stop"]),
|
|
1007
1019
|
onInput: S(vn, ["stop"]),
|
|
1008
|
-
onKeydown:
|
|
1020
|
+
onKeydown: Bn
|
|
1009
1021
|
}, y(T).input), null, 16, Tt), [[_t, j.value]]),
|
|
1010
1022
|
d(ve, {
|
|
1011
1023
|
"aria-hidden": "true",
|
|
@@ -1027,10 +1039,10 @@ var wt = {
|
|
|
1027
1039
|
key: 0,
|
|
1028
1040
|
class: "bb-select-popover__clear",
|
|
1029
1041
|
tabindex: Qt.value && Y.value ? 0 : -1,
|
|
1030
|
-
onClick: S(
|
|
1042
|
+
onClick: S(da, ["stop"]),
|
|
1031
1043
|
onMousedown: t[1] ||= S(() => {}, ["prevent"])
|
|
1032
1044
|
}, y(T).clear), null, 16, ["tabindex"])) : it("", !0),
|
|
1033
|
-
|
|
1045
|
+
ui.value ? (h(), u("div", Et)) : it("", !0)
|
|
1034
1046
|
])) : (h(), u("button", {
|
|
1035
1047
|
key: 1,
|
|
1036
1048
|
ref_key: "popoverFocusProxy",
|
|
@@ -1047,11 +1059,11 @@ var wt = {
|
|
|
1047
1059
|
type: "button",
|
|
1048
1060
|
onFocus: _n,
|
|
1049
1061
|
onKeydown: [
|
|
1050
|
-
|
|
1062
|
+
In,
|
|
1051
1063
|
yt(S(An, ["stop", "prevent"]), ["down"]),
|
|
1052
1064
|
yt(S(Nn, ["stop", "prevent"]), ["end"]),
|
|
1053
|
-
yt(S(
|
|
1054
|
-
yt(S(
|
|
1065
|
+
yt(S(Ln, ["stop", "prevent"]), ["enter"]),
|
|
1066
|
+
yt(S(Rn, ["stop", "prevent"]), ["esc"]),
|
|
1055
1067
|
yt(S(Mn, ["stop", "prevent"]), ["home"]),
|
|
1056
1068
|
yt(S(kn, ["stop", "prevent"]), ["up"])
|
|
1057
1069
|
]
|
|
@@ -1064,27 +1076,27 @@ var wt = {
|
|
|
1064
1076
|
ref_key: "optionsContainer",
|
|
1065
1077
|
ref: D,
|
|
1066
1078
|
compact: e.compact,
|
|
1067
|
-
described:
|
|
1068
|
-
"empty-text":
|
|
1069
|
-
"failed-text": y(M) === null ? void 0 :
|
|
1070
|
-
groups: e.groupBy ?
|
|
1079
|
+
described: Ii.value,
|
|
1080
|
+
"empty-text": Sr.value,
|
|
1081
|
+
"failed-text": y(M) === null ? void 0 : Sr.value,
|
|
1082
|
+
groups: e.groupBy ? Bi.value : void 0,
|
|
1071
1083
|
"header-height": e.headerHeight,
|
|
1072
|
-
"list-label": X.value ?
|
|
1073
|
-
"list-labelledby": X.value ? void 0 :
|
|
1084
|
+
"list-label": X.value ? ma.value : va.value,
|
|
1085
|
+
"list-labelledby": X.value ? void 0 : _a.value,
|
|
1074
1086
|
loading: J.value,
|
|
1075
|
-
"loading-below":
|
|
1087
|
+
"loading-below": di.value,
|
|
1076
1088
|
"loading-text": e.loadingText,
|
|
1077
1089
|
multiple: e.multiple,
|
|
1078
1090
|
open: Y.value,
|
|
1079
1091
|
"option-height": e.itemHeight,
|
|
1080
|
-
options: e.groupBy ? void 0 :
|
|
1092
|
+
options: e.groupBy ? void 0 : Li.value,
|
|
1081
1093
|
passthrough: y(T),
|
|
1082
1094
|
"onFocused:change": yn,
|
|
1083
|
-
"onOption:selected":
|
|
1084
|
-
"onOption:unselected":
|
|
1085
|
-
onPointerdown:
|
|
1086
|
-
onTouchmovePassive:
|
|
1087
|
-
onWheelPassive:
|
|
1095
|
+
"onOption:selected": Pi,
|
|
1096
|
+
"onOption:unselected": Fi,
|
|
1097
|
+
onPointerdown: Zi,
|
|
1098
|
+
onTouchmovePassive: Zi,
|
|
1099
|
+
onWheelPassive: Zi
|
|
1088
1100
|
}, ot({
|
|
1089
1101
|
loading: x(() => [_(e.$slots, "loading", { query: j.value })]),
|
|
1090
1102
|
empty: x(() => [_(e.$slots, "empty", {
|
|
@@ -1096,7 +1108,7 @@ var wt = {
|
|
|
1096
1108
|
_: 2
|
|
1097
1109
|
}, [e.$slots.option ? {
|
|
1098
1110
|
name: "option",
|
|
1099
|
-
fn: x((t) => [_(e.$slots, "option", m(f(
|
|
1111
|
+
fn: x((t) => [_(e.$slots, "option", m(f($r(t))))]),
|
|
1100
1112
|
key: "0"
|
|
1101
1113
|
} : void 0]), 1032, [
|
|
1102
1114
|
"id",
|
|
@@ -1130,17 +1142,17 @@ var wt = {
|
|
|
1130
1142
|
panel: "root",
|
|
1131
1143
|
sheet: "root"
|
|
1132
1144
|
}, y(Ee).states, () => e.offCanvasProps?.pt)
|
|
1133
|
-
}, p(
|
|
1145
|
+
}, p(Ji.value, qi, y(n)(e.$attrs))), ot({
|
|
1134
1146
|
default: x(() => [at("div", m(f(cn.value)), [
|
|
1135
|
-
e.multiple &&
|
|
1147
|
+
e.multiple && si.value.length ? (h(), u("div", Ot, [at("div", kt, [(h(!0), u(nt, null, mt(si.value, (n) => (h(), rt(_e, p({
|
|
1136
1148
|
key: n.valueHash,
|
|
1137
1149
|
class: "bb-select-popover__sheet-chip",
|
|
1138
1150
|
clearable: !e.disabled && !e.readonly,
|
|
1139
1151
|
size: "xl",
|
|
1140
1152
|
variant: "secondary",
|
|
1141
1153
|
ref_for: !0
|
|
1142
|
-
}, n.unresolved ? void 0 : y(
|
|
1143
|
-
"onClick:clear": (e) =>
|
|
1154
|
+
}, n.unresolved ? void 0 : y(Gi)?.(n.item), {
|
|
1155
|
+
"onClick:clear": (e) => Fi(n),
|
|
1144
1156
|
onMousedown: t[2] ||= S(() => {}, ["prevent"])
|
|
1145
1157
|
}), {
|
|
1146
1158
|
default: x(() => [st(gt(n.text), 1)]),
|
|
@@ -1156,27 +1168,27 @@ var wt = {
|
|
|
1156
1168
|
}, [e.$slots.header ? {
|
|
1157
1169
|
name: "header",
|
|
1158
1170
|
fn: x(({ titleId: t }) => [_(e.$slots, "header", m(f({
|
|
1159
|
-
...
|
|
1171
|
+
...fa.value,
|
|
1160
1172
|
titleId: t
|
|
1161
1173
|
})))]),
|
|
1162
1174
|
key: "0"
|
|
1163
1175
|
} : void 0, e.$slots.footer ? {
|
|
1164
1176
|
name: "footer",
|
|
1165
|
-
fn: x(() => [_(e.$slots, "footer", m(f(
|
|
1177
|
+
fn: x(() => [_(e.$slots, "footer", m(f(fa.value)))]),
|
|
1166
1178
|
key: "1"
|
|
1167
1179
|
} : void 0]), 1040, ["modelValue", "pt"])) : (h(), rt(le, p({
|
|
1168
1180
|
key: 2,
|
|
1169
1181
|
modelValue: Y.value,
|
|
1170
1182
|
"onUpdate:modelValue": t[4] ||= (e) => Y.value = e,
|
|
1171
1183
|
anchor: Bt.value,
|
|
1172
|
-
"aria-hidden": y(
|
|
1184
|
+
"aria-hidden": y(Hi) || void 0,
|
|
1173
1185
|
boundary: e.boundary,
|
|
1174
1186
|
"bubble-attrs": sn.value,
|
|
1175
1187
|
class: ["bb-select-popover", {
|
|
1176
|
-
"bb-select-popover--errors":
|
|
1177
|
-
"bb-select-popover--warnings":
|
|
1188
|
+
"bb-select-popover--errors": fi.value,
|
|
1189
|
+
"bb-select-popover--warnings": pi.value,
|
|
1178
1190
|
"bb-select-popover--loading": J.value,
|
|
1179
|
-
"bb-select-popover--reloading":
|
|
1191
|
+
"bb-select-popover--reloading": ui.value,
|
|
1180
1192
|
"bb-select-popover--clearable-active": Qt.value
|
|
1181
1193
|
}],
|
|
1182
1194
|
"disable-flip": e.disableFlip,
|
|
@@ -1187,20 +1199,20 @@ var wt = {
|
|
|
1187
1199
|
style: ln.value,
|
|
1188
1200
|
tag: "span",
|
|
1189
1201
|
"transition-duration": e.transitionDuration
|
|
1190
|
-
}, p(
|
|
1202
|
+
}, p(Ki, e.$attrs, y(T).root)), {
|
|
1191
1203
|
default: x(() => [
|
|
1192
1204
|
e.$slots.header ? (h(), u("div", p({
|
|
1193
1205
|
key: 0,
|
|
1194
1206
|
class: "bb-select-popover__header",
|
|
1195
|
-
inert: y(
|
|
1196
|
-
}, y(T).header), [_(e.$slots, "header", m(f(
|
|
1207
|
+
inert: y(Hi)
|
|
1208
|
+
}, y(T).header), [_(e.$slots, "header", m(f(fa.value)))], 16, At)) : it("", !0),
|
|
1197
1209
|
d(y(Pt)),
|
|
1198
1210
|
d(y(It)),
|
|
1199
1211
|
e.$slots.footer ? (h(), u("div", p({
|
|
1200
1212
|
key: 1,
|
|
1201
1213
|
class: "bb-select-popover__footer",
|
|
1202
|
-
inert: y(
|
|
1203
|
-
}, y(T).footer), [_(e.$slots, "footer", m(f(
|
|
1214
|
+
inert: y(Hi)
|
|
1215
|
+
}, y(T).footer), [_(e.$slots, "footer", m(f(fa.value)))], 16, jt)) : it("", !0)
|
|
1204
1216
|
]),
|
|
1205
1217
|
_: 3
|
|
1206
1218
|
}, 16, [
|