@night-owl-elite/vue-select 1.3.16 → 1.3.17

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.
@@ -1 +1 @@
1
- @keyframes spin-d347d13a{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-d347d13a]{animation:spin-d347d13a 1s linear infinite}.list-group-item[data-v-9766821f]{cursor:pointer;border:0;border-radius:0;padding-top:.5rem;padding-bottom:.5rem}.list-group-item.is-disabled[data-v-9766821f]{cursor:not-allowed;opacity:.65}.expander-icon[data-v-9766821f]{width:1rem;height:1rem;flex-shrink:0;transition:transform .2s ease-in-out;color:#6c757d}.expander-placeholder[data-v-9766821f]{display:inline-block;width:1rem;flex-shrink:0}.rotate-90[data-v-9766821f]{transform:rotate(90deg)}.item-content[data-v-9766821f]{flex-grow:1}.tree-select-main[data-v-a9a04e35]{--bs-form-select-bg-img: none;display:block;width:100%;font-weight:400;line-height:1.5;color:var(--bs-body-color);appearance:none;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;text-align:left}.tree-select-display-container[data-v-a9a04e35]{flex:1;overflow:hidden}.clear-icon[data-v-a9a04e35]{cursor:pointer;opacity:.6;transition:opacity .2s ease}.clear-icon[data-v-a9a04e35]:hover{opacity:1}.transition-transform[data-v-a9a04e35]{transition:transform .2s ease-in-out}.rotate-180[data-v-a9a04e35]{transform:rotate(180deg)}.tree-select-dropdown[data-v-a9a04e35]{position:absolute;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.375rem}.is-loading[data-v-a9a04e35]{cursor:wait}.loading-icon[data-v-a9a04e35]{animation:spin-a9a04e35 1s linear infinite}@keyframes spin-a9a04e35{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.btn-xl[data-v-a9a04e35]{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.form-control-xl[data-v-a9a04e35]{min-height:calc(1.5em + 1.5rem + (var(--bs-border-width) * 2));padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.tree-select-body[data-v-a9a04e35]::-webkit-scrollbar{width:6px}.tree-select-body[data-v-a9a04e35]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.tree-select-body[data-v-a9a04e35]::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.tree-select-body[data-v-a9a04e35]::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.tree-select-main.has-chips[data-v-a9a04e35]{height:auto;min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-lg[data-v-a9a04e35]{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-xl[data-v-a9a04e35]{min-height:calc(1.5em + 1.5rem + calc(var(--bs-border-width) * 2))}.chips-container[data-v-a9a04e35]{display:flex;flex-wrap:wrap;gap:.25rem;max-height:8rem;overflow-y:auto}.chip[data-v-a9a04e35]{display:inline-flex;align-items:center;padding:.2em .6em}.chip-remove[data-v-a9a04e35]{width:.8em;height:.8em;margin-left:.4em;cursor:pointer;opacity:.7;transition:opacity .2s}.chip-remove[data-v-a9a04e35]:hover{opacity:1}.more-button[data-v-a9a04e35]{font-size:.75em;line-height:1;padding:.3em .5em}.more-popover[data-v-a9a04e35]{width:250px;max-width:80vw;max-height:200px;overflow-y:auto;font-size:.9rem}@media (max-width: 576px){.tree-select-dropdown[data-v-a9a04e35]{max-width:90vw;left:0!important;right:0!important;margin:0 auto}}
1
+ @keyframes spin-d347d13a{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-d347d13a]{animation:spin-d347d13a 1s linear infinite}.list-group-item[data-v-9766821f]{cursor:pointer;border:0;border-radius:0;padding-top:.5rem;padding-bottom:.5rem}.list-group-item.is-disabled[data-v-9766821f]{cursor:not-allowed;opacity:.65}.expander-icon[data-v-9766821f]{width:1rem;height:1rem;flex-shrink:0;transition:transform .2s ease-in-out;color:#6c757d}.expander-placeholder[data-v-9766821f]{display:inline-block;width:1rem;flex-shrink:0}.rotate-90[data-v-9766821f]{transform:rotate(90deg)}.item-content[data-v-9766821f]{flex-grow:1}.tree-select-main[data-v-35cfd6c4]{--bs-form-select-bg-img: none;display:block;width:100%;font-weight:400;line-height:1.5;color:var(--bs-body-color);appearance:none;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;text-align:left}.tree-select-display-container[data-v-35cfd6c4]{flex:1;overflow:hidden}.clear-icon[data-v-35cfd6c4]{cursor:pointer;opacity:.6;transition:opacity .2s ease}.clear-icon[data-v-35cfd6c4]:hover{opacity:1}.transition-transform[data-v-35cfd6c4]{transition:transform .2s ease-in-out}.rotate-180[data-v-35cfd6c4]{transform:rotate(180deg)}.tree-select-dropdown[data-v-35cfd6c4]{position:absolute;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.375rem}.is-loading[data-v-35cfd6c4]{cursor:wait}.loading-icon[data-v-35cfd6c4]{animation:spin-35cfd6c4 1s linear infinite}@keyframes spin-35cfd6c4{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.btn-xl[data-v-35cfd6c4]{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.form-control-xl[data-v-35cfd6c4]{min-height:calc(1.5em + 1.5rem + (var(--bs-border-width) * 2));padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.tree-select-body[data-v-35cfd6c4]::-webkit-scrollbar{width:6px}.tree-select-body[data-v-35cfd6c4]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.tree-select-body[data-v-35cfd6c4]::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.tree-select-body[data-v-35cfd6c4]::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.tree-select-main.has-chips[data-v-35cfd6c4]{height:auto;min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-lg[data-v-35cfd6c4]{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-xl[data-v-35cfd6c4]{min-height:calc(1.5em + 1.5rem + calc(var(--bs-border-width) * 2))}.chips-container[data-v-35cfd6c4]{display:flex;flex-wrap:wrap;gap:.25rem;max-height:8rem;overflow-y:auto}.chip[data-v-35cfd6c4]{display:inline-flex;align-items:center;padding:.2em .6em}.chip-remove[data-v-35cfd6c4]{width:.8em;height:.8em;margin-left:.4em;cursor:pointer;opacity:.7;transition:opacity .2s}.chip-remove[data-v-35cfd6c4]:hover{opacity:1}.more-button[data-v-35cfd6c4]{font-size:.75em;line-height:1;padding:.3em .5em}.more-popover[data-v-35cfd6c4]{width:250px;max-width:80vw;max-height:200px;overflow-y:auto;font-size:.9rem}@media (max-width: 576px){.tree-select-dropdown[data-v-35cfd6c4]{max-width:90vw;left:0!important;right:0!important;margin:0 auto}}
@@ -1,10 +1,10 @@
1
1
  import { computed as y, createElementBlock as o, openBlock as i, normalizeClass as B, createCommentVNode as m, createElementVNode as f, resolveComponent as Ce, normalizeStyle as Ve, createBlock as P, withModifiers as K, renderSlot as _, Fragment as O, renderList as R, withCtx as ve, ref as b, onMounted as Le, onUnmounted as Ie, watch as $e, toDisplayString as A, createTextVNode as X, createVNode as H, withDirectives as fe, vModelText as Be, vModelSelect as Me, nextTick as Y } from "vue";
2
2
  import { createPopper as me } from "@popperjs/core";
3
3
  const ee = (t, z) => {
4
- const l = t.__vccOpts || t;
4
+ const n = t.__vccOpts || t;
5
5
  for (const [v, d] of z)
6
- l[v] = d;
7
- return l;
6
+ n[v] = d;
7
+ return n;
8
8
  }, Ae = { key: 0 }, ze = { key: 1 }, Ee = { key: 2 }, Ne = { key: 3 }, Pe = { key: 4 }, Ke = { key: 5 }, De = { key: 6 }, Te = {
9
9
  __name: "SvgIcon",
10
10
  props: {
@@ -14,7 +14,7 @@ const ee = (t, z) => {
14
14
  }
15
15
  },
16
16
  setup(t) {
17
- const z = t, l = y(() => ({
17
+ const z = t, n = y(() => ({
18
18
  "svg-icon-spin": z.name === "spinner"
19
19
  }));
20
20
  return (v, d) => (i(), o("svg", {
@@ -23,7 +23,7 @@ const ee = (t, z) => {
23
23
  fill: "currentColor",
24
24
  width: "1em",
25
25
  height: "1em",
26
- class: B(l.value)
26
+ class: B(n.value)
27
27
  }, [
28
28
  t.name === "spinner" ? (i(), o("g", Ae, d[0] || (d[0] = [
29
29
  f("path", { d: "M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z" }, null, -1)
@@ -77,12 +77,12 @@ const ee = (t, z) => {
77
77
  },
78
78
  emits: ["select", "toggle-expand"],
79
79
  setup(t, { emit: z }) {
80
- const l = t, v = (u) => u[l.optionValue] || u.id || u.value, d = (u) => !l.disabledKey || !u ? !1 : u.hasOwnProperty(l.disabledKey) && u[l.disabledKey] !== null, x = y(() => l.item.children && l.item.children.length > 0), C = y(() => l.expandedItems.has(v(l.item))), S = y(() => l.selectedItems.includes(v(l.item))), M = (u) => {
80
+ const n = t, v = (u) => u[n.optionValue] || u.id || u.value, d = (u) => !n.disabledKey || !u ? !1 : u.hasOwnProperty(n.disabledKey) && u[n.disabledKey] !== null, x = y(() => n.item.children && n.item.children.length > 0), C = y(() => n.expandedItems.has(v(n.item))), S = y(() => n.selectedItems.includes(v(n.item))), M = (u) => {
81
81
  let c = [];
82
82
  return u.children && u.children.forEach((V) => {
83
83
  c.push(v(V)), c.push(...M(V));
84
84
  }), c;
85
- }, E = y(() => !l.multiple || !l.selectAll || !x.value || S.value ? !1 : M(l.item).some((c) => l.selectedItems.includes(c)));
85
+ }, E = y(() => !n.multiple || !n.selectAll || !x.value || S.value ? !1 : M(n.item).some((c) => n.selectedItems.includes(c)));
86
86
  return (u, c) => {
87
87
  const V = Ce("TreeSelectItem", !0);
88
88
  return i(), o("div", qe, [
@@ -276,49 +276,49 @@ const ee = (t, z) => {
276
276
  },
277
277
  emits: ["update:modelValue", "change"],
278
278
  setup(t, { emit: z }) {
279
- const l = t, v = z, d = b(null), x = b(null), C = b(""), S = b(!1), M = b(/* @__PURE__ */ new Set()), E = b(null), u = b(l.defaultSortKey), c = b(l.defaultSortDirection), V = b(null), w = b(null), k = b(!1), N = b(null), te = y(() => l.size === "sm" ? "btn-sm" : l.size === "lg" ? "btn-lg" : l.size === "xl" ? "btn-xl" : ""), le = y(() => l.size === "sm" ? "form-control-sm" : l.size === "lg" ? "form-control-lg" : l.size === "xl" ? "form-control-xl" : ""), D = (e) => e && (e[l.optionLabel] || e.label || e.name) || "", p = (e) => e ? e[l.optionValue] || e.id || e.value : null, j = (e) => !l.disabledKey || !e ? !1 : e.hasOwnProperty(l.disabledKey) && e[l.disabledKey] !== null, L = (e) => e.children && e.children.length > 0, ne = (e, s) => {
279
+ const n = t, v = z, d = b(null), x = b(null), C = b(""), S = b(!1), M = b(/* @__PURE__ */ new Set()), E = b(null), u = b(n.defaultSortKey), c = b(n.defaultSortDirection), V = b(null), w = b(null), k = b(!1), N = b(null), te = y(() => n.size === "sm" ? "btn-sm" : n.size === "lg" ? "btn-lg" : n.size === "xl" ? "btn-xl" : ""), le = y(() => n.size === "sm" ? "form-control-sm" : n.size === "lg" ? "form-control-lg" : n.size === "xl" ? "form-control-xl" : ""), D = (e) => e && (e[n.optionLabel] || e.label || e.name) || "", p = (e) => e ? e[n.optionValue] || e.id || e.value : null, j = (e) => !n.disabledKey || !e ? !1 : e.hasOwnProperty(n.disabledKey) && e[n.disabledKey] !== null, L = (e) => e.children && e.children.length > 0, ne = (e, s) => {
280
280
  if (s)
281
- return s.split(".").reduce((n, a) => n && n[a], e);
282
- }, F = (e, s = l.items) => {
283
- for (const n of s) {
284
- if (p(n) === e) return n;
285
- if (L(n)) {
286
- const a = F(e, n.children);
281
+ return s.split(".").reduce((l, a) => l && l[a], e);
282
+ }, F = (e, s = n.items) => {
283
+ for (const l of s) {
284
+ if (p(l) === e) return l;
285
+ if (L(l)) {
286
+ const a = F(e, l.children);
287
287
  if (a) return a;
288
288
  }
289
289
  }
290
290
  return null;
291
291
  }, se = (e) => {
292
292
  const s = [];
293
- return L(e) && e.children.forEach((n) => {
294
- j(n) || (s.push(p(n)), s.push(...se(n)));
293
+ return L(e) && e.children.forEach((l) => {
294
+ j(l) || (s.push(p(l)), s.push(...se(l)));
295
295
  }), s;
296
- }, U = (e, s = l.items, n = []) => {
296
+ }, U = (e, s = n.items, l = []) => {
297
297
  for (const a of s) {
298
- if (p(a) === e) return n;
298
+ if (p(a) === e) return l;
299
299
  if (L(a)) {
300
- const r = U(e, a.children, [...n, p(a)]);
300
+ const r = U(e, a.children, [...l, p(a)]);
301
301
  if (r) return r;
302
302
  }
303
303
  }
304
304
  return null;
305
305
  }, I = y(() => {
306
- const e = new Set(Array.isArray(l.modelValue) ? l.modelValue : [l.modelValue].filter(Boolean));
307
- if (l.multiple && l.selectAll) {
308
- const s = (n) => {
309
- n.forEach((a) => {
306
+ const e = new Set(Array.isArray(n.modelValue) ? n.modelValue : [n.modelValue].filter(Boolean));
307
+ if (n.multiple && n.selectAll) {
308
+ const s = (l) => {
309
+ l.forEach((a) => {
310
310
  if (L(a)) {
311
311
  const r = a.children.filter((h) => !j(h));
312
312
  r.length > 0 && r.every((h) => e.has(p(h))) && e.add(p(a)), s(a.children);
313
313
  }
314
314
  });
315
315
  };
316
- s(l.items);
316
+ s(n.items);
317
317
  }
318
318
  return Array.from(e);
319
- }), W = (e, s = l.items, n = []) => {
319
+ }), W = (e, s = n.items, l = []) => {
320
320
  for (const a of s) {
321
- const r = [...n, D(a)];
321
+ const r = [...l, D(a)];
322
322
  if (p(a) === e) return r;
323
323
  if (L(a)) {
324
324
  const g = W(e, a.children, r);
@@ -332,70 +332,72 @@ const ee = (t, z) => {
332
332
  return s.length <= 40 ? s : e.length > 2 ? `${e[0]} → ... → ${e[e.length - 1]}` : s;
333
333
  }, he = y(() => {
334
334
  const e = I.value;
335
- if (e.length === 0) return l.placeholder;
336
- if (l.multiple) {
335
+ if (e.length === 0) return n.placeholder;
336
+ if (n.multiple) {
337
337
  if (e.length === 1) {
338
- const n = W(e[0]);
339
- return n ? ae(n) : e[0];
338
+ const l = W(e[0]);
339
+ return l ? ae(l) : e[0];
340
340
  }
341
341
  return `${e.length} items selected`;
342
342
  }
343
343
  const s = W(e[0]);
344
344
  return s ? ae(s) : e[0];
345
- }), G = y(() => !l.multiple || I.value.length === 0 ? [] : I.value.map((e) => F(e)).filter(Boolean)), ge = y(() => G.value.slice(0, l.maxVisibleChipsDisplay)), ie = y(() => {
346
- const e = G.value.length - l.maxVisibleChipsDisplay;
345
+ }), G = y(() => !n.multiple || I.value.length === 0 ? [] : I.value.map((e) => F(e)).filter(Boolean)), ge = y(() => G.value.slice(0, n.maxVisibleChipsDisplay)), ie = y(() => {
346
+ const e = G.value.length - n.maxVisibleChipsDisplay;
347
347
  return e > 0 ? e : 0;
348
- }), oe = (e, s) => e.map((n) => {
349
- const a = D(n).toLowerCase().includes(s);
350
- let r = [];
351
- return L(n) && (r = oe(n.children, s)), a || r.length > 0 ? { ...n, children: r } : null;
352
- }).filter(Boolean), re = (e, s, n) => !e || !s ? e : [...e].sort((r, g) => {
348
+ }), oe = (e, s) => e.map((l) => {
349
+ const a = D(l).toLowerCase().includes(s);
350
+ if (!L(l))
351
+ return a ? l : null;
352
+ const r = oe(l.children, s);
353
+ return a ? { ...l, children: l.children } : r.length > 0 ? { ...l, children: r } : null;
354
+ }).filter(Boolean), re = (e, s, l) => !e || !s ? e : [...e].sort((r, g) => {
353
355
  const h = ne(r, s), T = ne(g, s);
354
356
  if (h == null) return 1;
355
357
  if (T == null) return -1;
356
358
  let q = 0;
357
- return typeof h == "string" && typeof T == "string" ? q = h.localeCompare(T) : h > T ? q = 1 : h < T && (q = -1), n === "desc" ? q * -1 : q;
358
- }).map((r) => L(r) ? { ...r, children: re(r.children, s, n) } : r), J = y(() => {
359
- const e = C.value.trim() ? oe(l.items, C.value.toLowerCase()) : l.items;
360
- return !l.sortable || !u.value ? e : re(e, u.value, c.value);
359
+ return typeof h == "string" && typeof T == "string" ? q = h.localeCompare(T) : h > T ? q = 1 : h < T && (q = -1), l === "desc" ? q * -1 : q;
360
+ }).map((r) => L(r) ? { ...r, children: re(r.children, s, l) } : r), J = y(() => {
361
+ const e = C.value.trim() ? oe(n.items, C.value.toLowerCase()) : n.items;
362
+ return !n.sortable || !u.value ? e : re(e, u.value, c.value);
361
363
  }), pe = (e) => {
362
- if (l.disableBranchNodes && e.children && e.children.length > 0) {
363
- const r = e[l.optionValue] || e.id || e.value;
364
+ if (n.disableBranchNodes && e.children && e.children.length > 0) {
365
+ const r = e[n.optionValue] || e.id || e.value;
364
366
  ue(r);
365
367
  return;
366
368
  }
367
369
  if (j(e)) return;
368
370
  const s = p(e);
369
- let n = new Set(I.value);
370
- if (l.multiple) {
371
- const r = n.has(s);
372
- if (l.selectAll && L(e)) {
371
+ let l = new Set(I.value);
372
+ if (n.multiple) {
373
+ const r = l.has(s);
374
+ if (n.selectAll && L(e)) {
373
375
  const g = se(e);
374
- r ? (n.delete(s), g.forEach((h) => n.delete(h))) : (n.add(s), g.forEach((h) => n.add(h)));
376
+ r ? (l.delete(s), g.forEach((h) => l.delete(h))) : (l.add(s), g.forEach((h) => l.add(h)));
375
377
  } else
376
- r ? (n.delete(s), l.selectAll && U(s)?.forEach((h) => n.delete(h))) : n.add(s);
378
+ r ? (l.delete(s), n.selectAll && U(s)?.forEach((h) => l.delete(h))) : l.add(s);
377
379
  } else
378
- n = /* @__PURE__ */ new Set([s]), Q();
379
- let a = Array.from(n);
380
- l.multiple && l.excludeFromSelectedListKey && (a = a.filter((r) => {
380
+ l = /* @__PURE__ */ new Set([s]), Q();
381
+ let a = Array.from(l);
382
+ n.multiple && n.excludeFromSelectedListKey && (a = a.filter((r) => {
381
383
  const g = F(r);
382
- return !g || !g[l.excludeFromSelectedListKey];
383
- })), v("update:modelValue", l.multiple ? a : a[0] || null), v("change", l.multiple ? a : a[0] || null);
384
+ return !g || !g[n.excludeFromSelectedListKey];
385
+ })), v("update:modelValue", n.multiple ? a : a[0] || null), v("change", n.multiple ? a : a[0] || null);
384
386
  }, de = (e) => {
385
- if (l.disabled || !e) return;
386
- const s = p(e), n = new Set(I.value);
387
- n.delete(s), l.selectAll && U(s)?.forEach((g) => n.delete(g));
388
- const a = Array.from(n);
387
+ if (n.disabled || !e) return;
388
+ const s = p(e), l = new Set(I.value);
389
+ l.delete(s), n.selectAll && U(s)?.forEach((g) => l.delete(g));
390
+ const a = Array.from(l);
389
391
  v("update:modelValue", a), v("change", a);
390
392
  }, ue = (e) => {
391
393
  M.value.has(e) ? M.value.delete(e) : M.value.add(e);
392
394
  }, ye = () => {
393
395
  c.value = c.value === "asc" ? "desc" : "asc";
394
396
  }, be = () => {
395
- const e = l.multiple ? [] : null;
397
+ const e = n.multiple ? [] : null;
396
398
  v("update:modelValue", e), v("change", e), Z();
397
399
  }, xe = async () => {
398
- l.disabled || (Z(), S.value = !0, await Y(), d.value && x.value && (E.value = me(x.value, d.value, {
400
+ n.disabled || (Z(), S.value = !0, await Y(), d.value && x.value && (E.value = me(x.value, d.value, {
399
401
  placement: "bottom-start",
400
402
  strategy: "fixed",
401
403
  modifiers: [
@@ -415,11 +417,11 @@ const ee = (t, z) => {
415
417
  }
416
418
  }
417
419
  ]
418
- })), l.searchable && (await Y(), d.value?.querySelector(".tree-search-input")?.focus()));
420
+ })), n.searchable && (await Y(), d.value?.querySelector(".tree-search-input")?.focus()));
419
421
  }, Q = () => {
420
422
  S.value = !1, C.value = "", E.value?.destroy(), E.value = null;
421
423
  }, ke = () => S.value ? Q() : xe(), Se = async () => {
422
- l.disabled || (k.value = !0, await Y(), w.value && V.value && (N.value = me(V.value, w.value, {
424
+ n.disabled || (k.value = !0, await Y(), w.value && V.value && (N.value = me(V.value, w.value, {
423
425
  placement: "bottom-end",
424
426
  strategy: "fixed",
425
427
  modifiers: [{ name: "offset", options: { offset: [0, 4] } }]
@@ -433,8 +435,8 @@ const ee = (t, z) => {
433
435
  document.removeEventListener("click", ce), E.value?.destroy(), N.value?.destroy();
434
436
  }), $e(C, (e) => {
435
437
  if (e.trim()) {
436
- const s = (n) => {
437
- n.forEach((a) => {
438
+ const s = (l) => {
439
+ l.forEach((a) => {
438
440
  L(a) && (M.value.add(p(a)), s(a.children));
439
441
  });
440
442
  };
@@ -461,15 +463,15 @@ const ee = (t, z) => {
461
463
  f("div", Ge, [
462
464
  !t.multiple || t.displayMode === "text" ? (i(), o("span", Je, A(t.isLoading ? "Loading data..." : he.value), 1)) : t.multiple && t.displayMode === "chips" ? (i(), o("div", Qe, [
463
465
  I.value.length === 0 ? (i(), o("span", Xe, A(t.placeholder), 1)) : (i(), o("div", Ye, [
464
- (i(!0), o(O, null, R(ge.value, (n) => (i(), o("span", {
465
- key: p(n),
466
+ (i(!0), o(O, null, R(ge.value, (l) => (i(), o("span", {
467
+ key: p(l),
466
468
  class: "badge text-bg-primary chip bg-primary"
467
469
  }, [
468
- X(A(D(n)) + " ", 1),
470
+ X(A(D(l)) + " ", 1),
469
471
  H($, {
470
472
  name: "times",
471
473
  class: "chip-remove",
472
- onClick: K((a) => de(n), ["stop"])
474
+ onClick: K((a) => de(l), ["stop"])
473
475
  }, null, 8, ["onClick"])
474
476
  ]))), 128)),
475
477
  ie.value > 0 ? (i(), o("button", {
@@ -510,15 +512,15 @@ const ee = (t, z) => {
510
512
  style: { "z-index": "1060" }
511
513
  }, [
512
514
  f("div", et, [
513
- (i(!0), o(O, null, R(G.value, (n) => (i(), o("div", {
514
- key: p(n),
515
+ (i(!0), o(O, null, R(G.value, (l) => (i(), o("div", {
516
+ key: p(l),
515
517
  class: "list-group-item d-flex justify-content-between align-items-center py-1 px-2"
516
518
  }, [
517
- f("small", tt, A(D(n)), 1),
519
+ f("small", tt, A(D(l)), 1),
518
520
  H($, {
519
521
  name: "times",
520
522
  class: "chip-remove flex-shrink-0",
521
- onClick: K((a) => de(n), ["stop"])
523
+ onClick: K((a) => de(l), ["stop"])
522
524
  }, null, 8, ["onClick"])
523
525
  ]))), 128))
524
526
  ])
@@ -533,7 +535,7 @@ const ee = (t, z) => {
533
535
  f("div", lt, [
534
536
  t.searchable ? fe((i(), o("input", {
535
537
  key: 0,
536
- "onUpdate:modelValue": s[0] || (s[0] = (n) => C.value = n),
538
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => C.value = l),
537
539
  type: "text",
538
540
  class: B(["form-control tree-search-input", le.value]),
539
541
  placeholder: "Search..."
@@ -542,17 +544,17 @@ const ee = (t, z) => {
542
544
  ]) : m("", !0),
543
545
  t.sortable && t.sortOptions.length > 0 ? (i(), o("div", nt, [
544
546
  fe(f("select", {
545
- "onUpdate:modelValue": s[1] || (s[1] = (n) => u.value = n),
547
+ "onUpdate:modelValue": s[1] || (s[1] = (l) => u.value = l),
546
548
  class: B(["form-select flex-grow-1", le.value])
547
549
  }, [
548
550
  s[2] || (s[2] = f("option", {
549
551
  value: null,
550
552
  disabled: ""
551
553
  }, "Sort by...", -1)),
552
- (i(!0), o(O, null, R(t.sortOptions, (n) => (i(), o("option", {
553
- key: n.value,
554
- value: n.value
555
- }, A(n.label), 9, st))), 128))
554
+ (i(!0), o(O, null, R(t.sortOptions, (l) => (i(), o("option", {
555
+ key: l.value,
556
+ value: l.value
557
+ }, A(l.label), 9, st))), 128))
556
558
  ], 2), [
557
559
  [Me, u.value]
558
560
  ]),
@@ -576,9 +578,9 @@ const ee = (t, z) => {
576
578
  s[3] || (s[3] = f("span", null, "Loading...", -1))
577
579
  ])) : (i(), o("div", ot, [
578
580
  J.value.length > 0 ? (i(), o("div", rt, [
579
- (i(!0), o(O, null, R(J.value, (n) => (i(), P(Fe, {
580
- key: p(n),
581
- item: n,
581
+ (i(!0), o(O, null, R(J.value, (l) => (i(), P(Fe, {
582
+ key: p(l),
583
+ item: l,
582
584
  level: 0,
583
585
  "selected-items": I.value,
584
586
  "expanded-items": M.value,
@@ -619,7 +621,7 @@ const ee = (t, z) => {
619
621
  ], 512)) : m("", !0)
620
622
  ]));
621
623
  }
622
- }, ft = /* @__PURE__ */ ee(ct, [["__scopeId", "data-v-a9a04e35"]]), ht = {
624
+ }, ft = /* @__PURE__ */ ee(ct, [["__scopeId", "data-v-35cfd6c4"]]), ht = {
623
625
  install(t) {
624
626
  t.component("VSelect", ft);
625
627
  }
@@ -1 +1 @@
1
- (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.VueSelect={},b.Vue,b.Popper))})(this,(function(b,e,R){"use strict";const A=(l,N)=>{const n=l.__vccOpts||l;for(const[m,i]of N)n[m]=i;return n},ee={key:0},te={key:1},le={key:2},ne={key:3},oe={key:4},ae={key:5},re={key:6},B=A({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const N=l,n=e.computed(()=>({"svg-icon-spin":N.name==="spinner"}));return(m,i)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(n.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",ee,i[0]||(i[0]=[e.createElementVNode("path",{d:"M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="times"?(e.openBlock(),e.createElementBlock("g",te,i[1]||(i[1]=[e.createElementVNode("path",{d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-down"?(e.openBlock(),e.createElementBlock("g",le,i[2]||(i[2]=[e.createElementVNode("path",{d:"M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-right"?(e.openBlock(),e.createElementBlock("g",ne,i[3]||(i[3]=[e.createElementVNode("path",{d:"M10.83,12l-4.24,4.24a1,1,0,0,0,1.41,1.41L13.66,12,8,6.34A1,1,0,0,0,6.59,7.76Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="search"?(e.openBlock(),e.createElementBlock("g",oe,i[4]||(i[4]=[e.createElementVNode("path",{d:"M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="asc"?(e.openBlock(),e.createElementBlock("g",ae,i[5]||(i[5]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm12.9 8V3h-2v13h-3l4 5l4-5zm-8-3H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="desc"?(e.openBlock(),e.createElementBlock("g",re,i[6]||(i[6]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm15.9 0l-4-5l-4 5h3v13h2V8zm-11 5H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-d347d13a"]]),se={class:"tree-select-item-wrapper"},ie={key:1,class:"expander-placeholder"},ce=["checked",".indeterminate","disabled"],de={class:"item-content"},me={key:0,class:"children-wrapper"},ue=A({__name:"TreeSelectItem",props:{item:{type:Object,required:!0},level:{type:Number,required:!0},selectedItems:{type:Array,required:!0},expandedItems:{type:Set,required:!0},multiple:{type:Boolean,required:!0},selectAll:{type:Boolean,required:!0},selectMode:{type:String,required:!0},optionLabel:{type:String,required:!0},optionValue:{type:String,required:!0},disabledKey:{type:String,default:null},disableBranchNode:{type:Boolean,default:!1}},emits:["select","toggle-expand"],setup(l,{emit:N}){const n=l,m=c=>c[n.optionValue]||c.id||c.value,i=c=>!n.disabledKey||!c?!1:c.hasOwnProperty(n.disabledKey)&&c[n.disabledKey]!==null,h=e.computed(()=>n.item.children&&n.item.children.length>0),V=e.computed(()=>n.expandedItems.has(m(n.item))),y=e.computed(()=>n.selectedItems.includes(m(n.item))),C=c=>{let d=[];return c.children&&c.children.forEach(x=>{d.push(m(x)),d.push(...C(x))}),d},w=e.computed(()=>!n.multiple||!n.selectAll||!h.value||y.value?!1:C(n.item).some(d=>n.selectedItems.includes(d)));return(c,d)=>{const x=e.resolveComponent("TreeSelectItem",!0);return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{class:e.normalizeClass(["list-group-item list-group-item-action d-flex align-items-center gap-2",{"bg-primary text-white":y.value&&(l.selectMode==="highlight"||!l.multiple)&&!i(l.item)&&!(l.disableBranchNode&&h.value),"is-disabled text-muted bg-light":i(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:d[2]||(d[2]=k=>i(l.item)||l.disableBranchNode&&h.value?null:c.$emit("select",l.item))},[h.value?(e.openBlock(),e.createBlock(B,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon",{"rotate-90":V.value}]),onClick:d[0]||(d[0]=e.withModifiers(k=>c.$emit("toggle-expand",m(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",ie)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&h.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"form-check-input",checked:y.value,".indeterminate":w.value,disabled:i(l.item),onClick:d[1]||(d[1]=e.withModifiers(k=>c.$emit("select",l.item),["stop"]))},null,40,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.renderSlot(c.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),h.value&&V.value?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,k=>(e.openBlock(),e.createBlock(x,{key:m(k),item:k,level:l.level+1,"selected-items":l.selectedItems,"expanded-items":l.expandedItems,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNode,onSelect:d[3]||(d[3]=g=>c.$emit("select",g)),onToggleExpand:d[4]||(d[4]=g=>c.$emit("toggle-expand",g))},{default:e.withCtx(({item:g,level:L})=>[e.renderSlot(c.$slots,"default",{item:g,level:L},void 0,!0)]),_:2},1032,["item","level","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-9766821f"]]),fe={class:"tree-select-wrapper"},pe=["disabled"],he={class:"tree-select-display-container"},ge={key:0,class:"text-truncate"},ye={key:1},ke={key:0,class:"text-muted"},be={key:1,class:"chips-container"},Be={class:"d-flex align-items-center gap-2"},Ve={class:"list-group list-group-flush"},xe={class:"text-truncate me-2"},Se={class:"p-2 border-bottom d-flex flex-column gap-2"},Ee={key:1,class:"d-flex align-items-center gap-2"},Ce=["value"],Ne=["disabled"],we={key:0,class:"p-4 text-muted text-center"},Le={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},Ie={key:0,class:"list-group list-group-flush"},Me={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},$e={key:1,class:"p-3 text-muted text-center"},j=A({__name:"TreeSelectMain",props:{modelValue:{type:[String,Number,Array],default:null},displayMode:{type:String,default:"text",validator:l=>["text","chips"].includes(l)},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},selectMode:{type:String,default:"checkbox",validator:l=>["checkbox","highlight"].includes(l)},placeholder:{type:String,default:"Select item..."},isInvalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},isLoading:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!1},optionLabel:{type:String,default:"value"},optionValue:{type:String,default:"code"},disabledKey:{type:String,default:null},excludeFromSelectedListKey:{type:String,default:null},disableBranchNodes:{type:Boolean,default:!1},size:{type:String,default:"sm",validator:l=>["sm","md","lg","xl"].includes(l)},sortable:{type:Boolean,default:!1},sortOptions:{type:Array,default:()=>[]},defaultSortKey:{type:String,default:null},defaultSortDirection:{type:String,default:"asc",validator:l=>["asc","desc"].includes(l)},maxVisibleChipsDisplay:{type:Number,default:3}},emits:["update:modelValue","change"],setup(l,{emit:N}){const n=l,m=N,i=e.ref(null),h=e.ref(null),V=e.ref(""),y=e.ref(!1),C=e.ref(new Set),w=e.ref(null),c=e.ref(n.defaultSortKey),d=e.ref(n.defaultSortDirection),x=e.ref(null),k=e.ref(null),g=e.ref(!1),L=e.ref(null),F=e.computed(()=>n.size==="sm"?"btn-sm":n.size==="lg"?"btn-lg":n.size==="xl"?"btn-xl":""),Z=e.computed(()=>n.size==="sm"?"form-control-sm":n.size==="lg"?"form-control-lg":n.size==="xl"?"form-control-xl":""),I=t=>t&&(t[n.optionLabel]||t.label||t.name)||"",p=t=>t?t[n.optionValue]||t.id||t.value:null,D=t=>!n.disabledKey||!t?!1:t.hasOwnProperty(n.disabledKey)&&t[n.disabledKey]!==null,S=t=>t.children&&t.children.length>0,U=(t,a)=>{if(a)return a.split(".").reduce((o,r)=>o&&o[r],t)},T=(t,a=n.items)=>{for(const o of a){if(p(o)===t)return o;if(S(o)){const r=T(t,o.children);if(r)return r}}return null},W=t=>{const a=[];return S(t)&&t.children.forEach(o=>{D(o)||(a.push(p(o)),a.push(...W(o)))}),a},P=(t,a=n.items,o=[])=>{for(const r of a){if(p(r)===t)return o;if(S(r)){const s=P(t,r.children,[...o,p(r)]);if(s)return s}}return null},E=e.computed(()=>{const t=new Set(Array.isArray(n.modelValue)?n.modelValue:[n.modelValue].filter(Boolean));if(n.multiple&&n.selectAll){const a=o=>{o.forEach(r=>{if(S(r)){const s=r.children.filter(u=>!D(u));s.length>0&&s.every(u=>t.has(p(u)))&&t.add(p(r)),a(r.children)}})};a(n.items)}return Array.from(t)}),K=(t,a=n.items,o=[])=>{for(const r of a){const s=[...o,I(r)];if(p(r)===t)return s;if(S(r)){const f=K(t,r.children,s);if(f)return f}}return null},G=t=>{if(!t||t.length===0)return"";const a=t.join(" → ");return a.length<=40?a:t.length>2?`${t[0]} → ... → ${t[t.length-1]}`:a},Ae=e.computed(()=>{const t=E.value;if(t.length===0)return n.placeholder;if(n.multiple){if(t.length===1){const o=K(t[0]);return o?G(o):t[0]}return`${t.length} items selected`}const a=K(t[0]);return a?G(a):t[0]}),q=e.computed(()=>!n.multiple||E.value.length===0?[]:E.value.map(t=>T(t)).filter(Boolean)),De=e.computed(()=>q.value.slice(0,n.maxVisibleChipsDisplay)),J=e.computed(()=>{const t=q.value.length-n.maxVisibleChipsDisplay;return t>0?t:0}),Q=(t,a)=>t.map(o=>{const r=I(o).toLowerCase().includes(a);let s=[];return S(o)&&(s=Q(o.children,a)),r||s.length>0?{...o,children:s}:null}).filter(Boolean),X=(t,a,o)=>!t||!a?t:[...t].sort((s,f)=>{const u=U(s,a),M=U(f,a);if(u==null)return 1;if(M==null)return-1;let $=0;return typeof u=="string"&&typeof M=="string"?$=u.localeCompare(M):u>M?$=1:u<M&&($=-1),o==="desc"?$*-1:$}).map(s=>S(s)?{...s,children:X(s.children,a,o)}:s),O=e.computed(()=>{const t=V.value.trim()?Q(n.items,V.value.toLowerCase()):n.items;return!n.sortable||!c.value?t:X(t,c.value,d.value)}),Te=t=>{if(n.disableBranchNodes&&t.children&&t.children.length>0){const s=t[n.optionValue]||t.id||t.value;v(s);return}if(D(t))return;const a=p(t);let o=new Set(E.value);if(n.multiple){const s=o.has(a);if(n.selectAll&&S(t)){const f=W(t);s?(o.delete(a),f.forEach(u=>o.delete(u))):(o.add(a),f.forEach(u=>o.add(u)))}else s?(o.delete(a),n.selectAll&&P(a)?.forEach(u=>o.delete(u))):o.add(a)}else o=new Set([a]),H();let r=Array.from(o);n.multiple&&n.excludeFromSelectedListKey&&(r=r.filter(s=>{const f=T(s);return!f||!f[n.excludeFromSelectedListKey]})),m("update:modelValue",n.multiple?r:r[0]||null),m("change",n.multiple?r:r[0]||null)},Y=t=>{if(n.disabled||!t)return;const a=p(t),o=new Set(E.value);o.delete(a),n.selectAll&&P(a)?.forEach(f=>o.delete(f));const r=Array.from(o);m("update:modelValue",r),m("change",r)},v=t=>{C.value.has(t)?C.value.delete(t):C.value.add(t)},Pe=()=>{d.value=d.value==="asc"?"desc":"asc"},Ke=()=>{const t=n.multiple?[]:null;m("update:modelValue",t),m("change",t),z()},qe=async()=>{n.disabled||(z(),y.value=!0,await e.nextTick(),i.value&&h.value&&(w.value=R.createPopper(h.value,i.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),n.searchable&&(await e.nextTick(),i.value?.querySelector(".tree-search-input")?.focus()))},H=()=>{y.value=!1,V.value="",w.value?.destroy(),w.value=null},Oe=()=>y.value?H():qe(),He=async()=>{n.disabled||(g.value=!0,await e.nextTick(),k.value&&x.value&&(L.value=R.createPopper(x.value,k.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]})))},z=()=>{g.value=!1,L.value?.destroy(),L.value=null},Re=()=>g.value?z():He(),_=t=>{y.value&&!h.value?.contains(t.target)&&!i.value?.contains(t.target)&&H(),g.value&&!x.value?.contains(t.target)&&!k.value?.contains(t.target)&&z()};return e.onMounted(()=>document.addEventListener("click",_)),e.onUnmounted(()=>{document.removeEventListener("click",_),w.value?.destroy(),L.value?.destroy()}),e.watch(V,t=>{if(t.trim()){const a=o=>{o.forEach(r=>{S(r)&&(C.value.add(p(r)),a(r.children))})};a(O.value)}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("button",{ref_key:"triggerRef",ref:h,type:"button",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[F.value,{"btn-outline-secondary":!l.isInvalid,"border-danger":l.isInvalid,disabled:l.disabled||l.isLoading,"is-loading":l.isLoading,"has-chips":l.multiple&&l.displayMode==="chips"&&E.value.length>0}]]),disabled:l.disabled||l.isLoading,onClick:Oe},[e.createElementVNode("div",he,[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(l.isLoading?"Loading data...":Ae.value),1)):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",ye,[E.value.length===0?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,o=>(e.openBlock(),e.createElementBlock("span",{key:p(o),class:"badge text-bg-primary chip bg-primary"},[e.createTextVNode(e.toDisplayString(I(o))+" ",1),e.createVNode(B,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>Y(o),["stop"])},null,8,["onClick"])]))),128)),J.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:x,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(Re,["stop"])}," +"+e.toDisplayString(J.value),513)):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Be,[l.isLoading?(e.openBlock(),e.createBlock(B,{key:0,name:"spinner",class:"loading-icon"})):e.createCommentVNode("",!0),l.showClearButton&&E.value.length>0&&!l.disabled&&!l.isLoading?(e.openBlock(),e.createBlock(B,{key:1,name:"times",onClick:e.withModifiers(Ke,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0),l.isLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(B,{key:2,name:"chevron-down",class:e.normalizeClass(["transition-transform",{"rotate-180":y.value}])},null,8,["class"]))])],10,pe),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:k,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,o=>(e.openBlock(),e.createElementBlock("div",{key:p(o),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",xe,e.toDisplayString(I(o)),1),e.createVNode(B,{name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>Y(o),["stop"])},null,8,["onClick"])]))),128))])],512)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:i,class:"tree-select-dropdown card shadow-lg border-0",style:{"z-index":"1050"}},[e.createElementVNode("div",Se,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=o=>V.value=o),type:"text",class:e.normalizeClass(["form-control tree-search-input",Z.value]),placeholder:"Search..."},null,2)),[[e.vModelText,V.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",Ee,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=o=>c.value=o),class:e.normalizeClass(["form-select flex-grow-1",Z.value])},[a[2]||(a[2]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,o=>(e.openBlock(),e.createElementBlock("option",{key:o.value,value:o.value},e.toDisplayString(o.label),9,Ce))),128))],2),[[e.vModelSelect,c.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",F.value]),disabled:!c.value,onClick:Pe},[e.createVNode(B,{name:d.value==="asc"?"asc":"desc"},null,8,["name"])],10,Ne)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(B,{name:"spinner",class:"me-2"}),a[3]||(a[3]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",Le,[O.value.length>0?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,o=>(e.openBlock(),e.createBlock(ue,{key:p(o),item:o,level:0,"selected-items":E.value,"expanded-items":C.value,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNodes,onSelect:Te,onToggleExpand:v},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",Me,[e.createTextVNode(e.toDisplayString(I(r))+" ",1),r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(r.icon)},null,2)):e.createCommentVNode("",!0)])],!0)]),_:2},1032,["item","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(B,{name:"search",class:"me-1"}),a[4]||(a[4]=e.createTextVNode(" No items found ",-1))]))]))],512)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a9a04e35"]]),ze={install(l){l.component("VSelect",j)}};b.VSelect=j,b.default=ze,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.VueSelect={},b.Vue,b.Popper))})(this,(function(b,e,R){"use strict";const A=(l,N)=>{const o=l.__vccOpts||l;for(const[m,i]of N)o[m]=i;return o},ee={key:0},te={key:1},le={key:2},ne={key:3},oe={key:4},ae={key:5},re={key:6},B=A({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const N=l,o=e.computed(()=>({"svg-icon-spin":N.name==="spinner"}));return(m,i)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(o.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",ee,i[0]||(i[0]=[e.createElementVNode("path",{d:"M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="times"?(e.openBlock(),e.createElementBlock("g",te,i[1]||(i[1]=[e.createElementVNode("path",{d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-down"?(e.openBlock(),e.createElementBlock("g",le,i[2]||(i[2]=[e.createElementVNode("path",{d:"M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-right"?(e.openBlock(),e.createElementBlock("g",ne,i[3]||(i[3]=[e.createElementVNode("path",{d:"M10.83,12l-4.24,4.24a1,1,0,0,0,1.41,1.41L13.66,12,8,6.34A1,1,0,0,0,6.59,7.76Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="search"?(e.openBlock(),e.createElementBlock("g",oe,i[4]||(i[4]=[e.createElementVNode("path",{d:"M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="asc"?(e.openBlock(),e.createElementBlock("g",ae,i[5]||(i[5]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm12.9 8V3h-2v13h-3l4 5l4-5zm-8-3H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="desc"?(e.openBlock(),e.createElementBlock("g",re,i[6]||(i[6]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm15.9 0l-4-5l-4 5h3v13h2V8zm-11 5H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-d347d13a"]]),se={class:"tree-select-item-wrapper"},ie={key:1,class:"expander-placeholder"},ce=["checked",".indeterminate","disabled"],de={class:"item-content"},me={key:0,class:"children-wrapper"},ue=A({__name:"TreeSelectItem",props:{item:{type:Object,required:!0},level:{type:Number,required:!0},selectedItems:{type:Array,required:!0},expandedItems:{type:Set,required:!0},multiple:{type:Boolean,required:!0},selectAll:{type:Boolean,required:!0},selectMode:{type:String,required:!0},optionLabel:{type:String,required:!0},optionValue:{type:String,required:!0},disabledKey:{type:String,default:null},disableBranchNode:{type:Boolean,default:!1}},emits:["select","toggle-expand"],setup(l,{emit:N}){const o=l,m=c=>c[o.optionValue]||c.id||c.value,i=c=>!o.disabledKey||!c?!1:c.hasOwnProperty(o.disabledKey)&&c[o.disabledKey]!==null,h=e.computed(()=>o.item.children&&o.item.children.length>0),V=e.computed(()=>o.expandedItems.has(m(o.item))),y=e.computed(()=>o.selectedItems.includes(m(o.item))),C=c=>{let d=[];return c.children&&c.children.forEach(x=>{d.push(m(x)),d.push(...C(x))}),d},w=e.computed(()=>!o.multiple||!o.selectAll||!h.value||y.value?!1:C(o.item).some(d=>o.selectedItems.includes(d)));return(c,d)=>{const x=e.resolveComponent("TreeSelectItem",!0);return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{class:e.normalizeClass(["list-group-item list-group-item-action d-flex align-items-center gap-2",{"bg-primary text-white":y.value&&(l.selectMode==="highlight"||!l.multiple)&&!i(l.item)&&!(l.disableBranchNode&&h.value),"is-disabled text-muted bg-light":i(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:d[2]||(d[2]=k=>i(l.item)||l.disableBranchNode&&h.value?null:c.$emit("select",l.item))},[h.value?(e.openBlock(),e.createBlock(B,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon",{"rotate-90":V.value}]),onClick:d[0]||(d[0]=e.withModifiers(k=>c.$emit("toggle-expand",m(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",ie)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&h.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"form-check-input",checked:y.value,".indeterminate":w.value,disabled:i(l.item),onClick:d[1]||(d[1]=e.withModifiers(k=>c.$emit("select",l.item),["stop"]))},null,40,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.renderSlot(c.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),h.value&&V.value?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,k=>(e.openBlock(),e.createBlock(x,{key:m(k),item:k,level:l.level+1,"selected-items":l.selectedItems,"expanded-items":l.expandedItems,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNode,onSelect:d[3]||(d[3]=g=>c.$emit("select",g)),onToggleExpand:d[4]||(d[4]=g=>c.$emit("toggle-expand",g))},{default:e.withCtx(({item:g,level:L})=>[e.renderSlot(c.$slots,"default",{item:g,level:L},void 0,!0)]),_:2},1032,["item","level","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-9766821f"]]),fe={class:"tree-select-wrapper"},pe=["disabled"],he={class:"tree-select-display-container"},ge={key:0,class:"text-truncate"},ye={key:1},ke={key:0,class:"text-muted"},be={key:1,class:"chips-container"},Be={class:"d-flex align-items-center gap-2"},Ve={class:"list-group list-group-flush"},xe={class:"text-truncate me-2"},Se={class:"p-2 border-bottom d-flex flex-column gap-2"},Ee={key:1,class:"d-flex align-items-center gap-2"},Ce=["value"],Ne=["disabled"],we={key:0,class:"p-4 text-muted text-center"},Le={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},Ie={key:0,class:"list-group list-group-flush"},Me={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},$e={key:1,class:"p-3 text-muted text-center"},j=A({__name:"TreeSelectMain",props:{modelValue:{type:[String,Number,Array],default:null},displayMode:{type:String,default:"text",validator:l=>["text","chips"].includes(l)},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},selectMode:{type:String,default:"checkbox",validator:l=>["checkbox","highlight"].includes(l)},placeholder:{type:String,default:"Select item..."},isInvalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},isLoading:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!1},optionLabel:{type:String,default:"value"},optionValue:{type:String,default:"code"},disabledKey:{type:String,default:null},excludeFromSelectedListKey:{type:String,default:null},disableBranchNodes:{type:Boolean,default:!1},size:{type:String,default:"sm",validator:l=>["sm","md","lg","xl"].includes(l)},sortable:{type:Boolean,default:!1},sortOptions:{type:Array,default:()=>[]},defaultSortKey:{type:String,default:null},defaultSortDirection:{type:String,default:"asc",validator:l=>["asc","desc"].includes(l)},maxVisibleChipsDisplay:{type:Number,default:3}},emits:["update:modelValue","change"],setup(l,{emit:N}){const o=l,m=N,i=e.ref(null),h=e.ref(null),V=e.ref(""),y=e.ref(!1),C=e.ref(new Set),w=e.ref(null),c=e.ref(o.defaultSortKey),d=e.ref(o.defaultSortDirection),x=e.ref(null),k=e.ref(null),g=e.ref(!1),L=e.ref(null),F=e.computed(()=>o.size==="sm"?"btn-sm":o.size==="lg"?"btn-lg":o.size==="xl"?"btn-xl":""),Z=e.computed(()=>o.size==="sm"?"form-control-sm":o.size==="lg"?"form-control-lg":o.size==="xl"?"form-control-xl":""),I=t=>t&&(t[o.optionLabel]||t.label||t.name)||"",p=t=>t?t[o.optionValue]||t.id||t.value:null,D=t=>!o.disabledKey||!t?!1:t.hasOwnProperty(o.disabledKey)&&t[o.disabledKey]!==null,S=t=>t.children&&t.children.length>0,U=(t,a)=>{if(a)return a.split(".").reduce((n,r)=>n&&n[r],t)},T=(t,a=o.items)=>{for(const n of a){if(p(n)===t)return n;if(S(n)){const r=T(t,n.children);if(r)return r}}return null},W=t=>{const a=[];return S(t)&&t.children.forEach(n=>{D(n)||(a.push(p(n)),a.push(...W(n)))}),a},P=(t,a=o.items,n=[])=>{for(const r of a){if(p(r)===t)return n;if(S(r)){const s=P(t,r.children,[...n,p(r)]);if(s)return s}}return null},E=e.computed(()=>{const t=new Set(Array.isArray(o.modelValue)?o.modelValue:[o.modelValue].filter(Boolean));if(o.multiple&&o.selectAll){const a=n=>{n.forEach(r=>{if(S(r)){const s=r.children.filter(u=>!D(u));s.length>0&&s.every(u=>t.has(p(u)))&&t.add(p(r)),a(r.children)}})};a(o.items)}return Array.from(t)}),K=(t,a=o.items,n=[])=>{for(const r of a){const s=[...n,I(r)];if(p(r)===t)return s;if(S(r)){const f=K(t,r.children,s);if(f)return f}}return null},G=t=>{if(!t||t.length===0)return"";const a=t.join(" → ");return a.length<=40?a:t.length>2?`${t[0]} → ... → ${t[t.length-1]}`:a},Ae=e.computed(()=>{const t=E.value;if(t.length===0)return o.placeholder;if(o.multiple){if(t.length===1){const n=K(t[0]);return n?G(n):t[0]}return`${t.length} items selected`}const a=K(t[0]);return a?G(a):t[0]}),q=e.computed(()=>!o.multiple||E.value.length===0?[]:E.value.map(t=>T(t)).filter(Boolean)),De=e.computed(()=>q.value.slice(0,o.maxVisibleChipsDisplay)),J=e.computed(()=>{const t=q.value.length-o.maxVisibleChipsDisplay;return t>0?t:0}),Q=(t,a)=>t.map(n=>{const r=I(n).toLowerCase().includes(a);if(!S(n))return r?n:null;const s=Q(n.children,a);return r?{...n,children:n.children}:s.length>0?{...n,children:s}:null}).filter(Boolean),X=(t,a,n)=>!t||!a?t:[...t].sort((s,f)=>{const u=U(s,a),M=U(f,a);if(u==null)return 1;if(M==null)return-1;let $=0;return typeof u=="string"&&typeof M=="string"?$=u.localeCompare(M):u>M?$=1:u<M&&($=-1),n==="desc"?$*-1:$}).map(s=>S(s)?{...s,children:X(s.children,a,n)}:s),O=e.computed(()=>{const t=V.value.trim()?Q(o.items,V.value.toLowerCase()):o.items;return!o.sortable||!c.value?t:X(t,c.value,d.value)}),Te=t=>{if(o.disableBranchNodes&&t.children&&t.children.length>0){const s=t[o.optionValue]||t.id||t.value;v(s);return}if(D(t))return;const a=p(t);let n=new Set(E.value);if(o.multiple){const s=n.has(a);if(o.selectAll&&S(t)){const f=W(t);s?(n.delete(a),f.forEach(u=>n.delete(u))):(n.add(a),f.forEach(u=>n.add(u)))}else s?(n.delete(a),o.selectAll&&P(a)?.forEach(u=>n.delete(u))):n.add(a)}else n=new Set([a]),H();let r=Array.from(n);o.multiple&&o.excludeFromSelectedListKey&&(r=r.filter(s=>{const f=T(s);return!f||!f[o.excludeFromSelectedListKey]})),m("update:modelValue",o.multiple?r:r[0]||null),m("change",o.multiple?r:r[0]||null)},Y=t=>{if(o.disabled||!t)return;const a=p(t),n=new Set(E.value);n.delete(a),o.selectAll&&P(a)?.forEach(f=>n.delete(f));const r=Array.from(n);m("update:modelValue",r),m("change",r)},v=t=>{C.value.has(t)?C.value.delete(t):C.value.add(t)},Pe=()=>{d.value=d.value==="asc"?"desc":"asc"},Ke=()=>{const t=o.multiple?[]:null;m("update:modelValue",t),m("change",t),z()},qe=async()=>{o.disabled||(z(),y.value=!0,await e.nextTick(),i.value&&h.value&&(w.value=R.createPopper(h.value,i.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),o.searchable&&(await e.nextTick(),i.value?.querySelector(".tree-search-input")?.focus()))},H=()=>{y.value=!1,V.value="",w.value?.destroy(),w.value=null},Oe=()=>y.value?H():qe(),He=async()=>{o.disabled||(g.value=!0,await e.nextTick(),k.value&&x.value&&(L.value=R.createPopper(x.value,k.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]})))},z=()=>{g.value=!1,L.value?.destroy(),L.value=null},Re=()=>g.value?z():He(),_=t=>{y.value&&!h.value?.contains(t.target)&&!i.value?.contains(t.target)&&H(),g.value&&!x.value?.contains(t.target)&&!k.value?.contains(t.target)&&z()};return e.onMounted(()=>document.addEventListener("click",_)),e.onUnmounted(()=>{document.removeEventListener("click",_),w.value?.destroy(),L.value?.destroy()}),e.watch(V,t=>{if(t.trim()){const a=n=>{n.forEach(r=>{S(r)&&(C.value.add(p(r)),a(r.children))})};a(O.value)}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("button",{ref_key:"triggerRef",ref:h,type:"button",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[F.value,{"btn-outline-secondary":!l.isInvalid,"border-danger":l.isInvalid,disabled:l.disabled||l.isLoading,"is-loading":l.isLoading,"has-chips":l.multiple&&l.displayMode==="chips"&&E.value.length>0}]]),disabled:l.disabled||l.isLoading,onClick:Oe},[e.createElementVNode("div",he,[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(l.isLoading?"Loading data...":Ae.value),1)):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",ye,[E.value.length===0?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,n=>(e.openBlock(),e.createElementBlock("span",{key:p(n),class:"badge text-bg-primary chip bg-primary"},[e.createTextVNode(e.toDisplayString(I(n))+" ",1),e.createVNode(B,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>Y(n),["stop"])},null,8,["onClick"])]))),128)),J.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:x,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(Re,["stop"])}," +"+e.toDisplayString(J.value),513)):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Be,[l.isLoading?(e.openBlock(),e.createBlock(B,{key:0,name:"spinner",class:"loading-icon"})):e.createCommentVNode("",!0),l.showClearButton&&E.value.length>0&&!l.disabled&&!l.isLoading?(e.openBlock(),e.createBlock(B,{key:1,name:"times",onClick:e.withModifiers(Ke,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0),l.isLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(B,{key:2,name:"chevron-down",class:e.normalizeClass(["transition-transform",{"rotate-180":y.value}])},null,8,["class"]))])],10,pe),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:k,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,n=>(e.openBlock(),e.createElementBlock("div",{key:p(n),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",xe,e.toDisplayString(I(n)),1),e.createVNode(B,{name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>Y(n),["stop"])},null,8,["onClick"])]))),128))])],512)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:i,class:"tree-select-dropdown card shadow-lg border-0",style:{"z-index":"1050"}},[e.createElementVNode("div",Se,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=n=>V.value=n),type:"text",class:e.normalizeClass(["form-control tree-search-input",Z.value]),placeholder:"Search..."},null,2)),[[e.vModelText,V.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",Ee,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=n=>c.value=n),class:e.normalizeClass(["form-select flex-grow-1",Z.value])},[a[2]||(a[2]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,n=>(e.openBlock(),e.createElementBlock("option",{key:n.value,value:n.value},e.toDisplayString(n.label),9,Ce))),128))],2),[[e.vModelSelect,c.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",F.value]),disabled:!c.value,onClick:Pe},[e.createVNode(B,{name:d.value==="asc"?"asc":"desc"},null,8,["name"])],10,Ne)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(B,{name:"spinner",class:"me-2"}),a[3]||(a[3]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",Le,[O.value.length>0?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,n=>(e.openBlock(),e.createBlock(ue,{key:p(n),item:n,level:0,"selected-items":E.value,"expanded-items":C.value,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNodes,onSelect:Te,onToggleExpand:v},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",Me,[e.createTextVNode(e.toDisplayString(I(r))+" ",1),r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(r.icon)},null,2)):e.createCommentVNode("",!0)])],!0)]),_:2},1032,["item","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(B,{name:"search",class:"me-1"}),a[4]||(a[4]=e.createTextVNode(" No items found ",-1))]))]))],512)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-35cfd6c4"]]),ze={install(l){l.component("VSelect",j)}};b.VSelect=j,b.default=ze,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@night-owl-elite/vue-select",
3
3
  "private": false,
4
- "version": "1.3.16",
4
+ "version": "1.3.17",
5
5
  "type": "module",
6
6
  "main": "./dist/vue-select.umd.js",
7
7
  "module": "./dist/vue-select.es.js",