@night-owl-elite/vue-select 1.3.47 → 1.3.49

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,11 +1,11 @@
1
- import { computed as p, createElementBlock as r, openBlock as i, normalizeClass as w, createCommentVNode as m, createElementVNode as f, resolveComponent as et, normalizeStyle as be, createBlock as O, withModifiers as C, renderSlot as ue, Fragment as j, renderList as Z, withCtx as Re, ref as g, watch as xe, onMounted as tt, nextTick as R, onUnmounted as lt, withDirectives as ke, withKeys as we, toDisplayString as S, createVNode as te, vModelText as nt, vModelSelect as st, createTextVNode as de, vShow as at } from "vue";
2
- import { createPopper as Se } from "@popperjs/core";
3
- const Ce = (t, q) => {
1
+ import { computed as p, createElementBlock as r, openBlock as i, normalizeClass as k, createCommentVNode as v, createElementVNode as f, resolveComponent as dt, normalizeStyle as ke, createBlock as O, withModifiers as C, renderSlot as fe, Fragment as U, renderList as G, withCtx as Ze, ref as h, watch as ue, onMounted as ut, nextTick as K, onUnmounted as ct, withDirectives as Se, withKeys as Ce, toDisplayString as S, createVNode as le, vModelText as ft, vModelSelect as vt, createTextVNode as ce, vShow as mt } from "vue";
2
+ import { createPopper as Ve } from "@popperjs/core";
3
+ const Le = (t, W) => {
4
4
  const l = t.__vccOpts || t;
5
- for (const [h, c] of q)
6
- l[h] = c;
5
+ for (const [g, c] of W)
6
+ l[g] = c;
7
7
  return l;
8
- }, it = { key: 0 }, ot = { key: 1 }, rt = { key: 2 }, dt = { key: 3 }, ut = { key: 4 }, ct = { key: 5 }, ft = { key: 6 }, mt = { key: 7 }, vt = {
8
+ }, ht = { key: 0 }, gt = { key: 1 }, yt = { key: 2 }, pt = { key: 3 }, bt = { key: 4 }, xt = { key: 5 }, wt = { key: 6 }, kt = { key: 7 }, St = {
9
9
  __name: "SvgIcon",
10
10
  props: {
11
11
  name: {
@@ -14,53 +14,53 @@ const Ce = (t, q) => {
14
14
  }
15
15
  },
16
16
  setup(t) {
17
- const q = t, l = p(() => ({
18
- "svg-icon-spin": q.name === "spinner"
17
+ const W = t, l = p(() => ({
18
+ "svg-icon-spin": W.name === "spinner"
19
19
  }));
20
- return (h, c) => (i(), r("svg", {
20
+ return (g, c) => (i(), r("svg", {
21
21
  xmlns: "http://www.w3.org/2000/svg",
22
22
  viewBox: "0 0 24 24",
23
23
  fill: "currentColor",
24
24
  width: "1em",
25
25
  height: "1em",
26
- class: w(l.value)
26
+ class: k(l.value)
27
27
  }, [
28
- t.name === "spinner" ? (i(), r("g", it, c[0] || (c[0] = [
28
+ t.name === "spinner" ? (i(), r("g", ht, c[0] || (c[0] = [
29
29
  f("path", { d: "M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z" }, null, -1)
30
- ]))) : m("", !0),
31
- t.name === "times" ? (i(), r("g", ot, c[1] || (c[1] = [
30
+ ]))) : v("", !0),
31
+ t.name === "times" ? (i(), r("g", gt, c[1] || (c[1] = [
32
32
  f("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)
33
- ]))) : m("", !0),
34
- t.name === "chevron-down" ? (i(), r("g", rt, c[2] || (c[2] = [
33
+ ]))) : v("", !0),
34
+ t.name === "chevron-down" ? (i(), r("g", yt, c[2] || (c[2] = [
35
35
  f("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)
36
- ]))) : m("", !0),
37
- t.name === "chevron-right" ? (i(), r("g", dt, c[3] || (c[3] = [
36
+ ]))) : v("", !0),
37
+ t.name === "chevron-right" ? (i(), r("g", pt, c[3] || (c[3] = [
38
38
  f("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)
39
- ]))) : m("", !0),
40
- t.name === "search" ? (i(), r("g", ut, c[4] || (c[4] = [
39
+ ]))) : v("", !0),
40
+ t.name === "search" ? (i(), r("g", bt, c[4] || (c[4] = [
41
41
  f("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)
42
- ]))) : m("", !0),
43
- t.name === "asc" ? (i(), r("g", ct, c[5] || (c[5] = [
42
+ ]))) : v("", !0),
43
+ t.name === "asc" ? (i(), r("g", xt, c[5] || (c[5] = [
44
44
  f("path", {
45
45
  fill: "currentColor",
46
46
  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"
47
47
  }, null, -1)
48
- ]))) : m("", !0),
49
- t.name === "desc" ? (i(), r("g", ft, c[6] || (c[6] = [
48
+ ]))) : v("", !0),
49
+ t.name === "desc" ? (i(), r("g", wt, c[6] || (c[6] = [
50
50
  f("path", {
51
51
  fill: "currentColor",
52
52
  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"
53
53
  }, null, -1)
54
- ]))) : m("", !0),
55
- t.name === "info-circle" ? (i(), r("g", mt, c[7] || (c[7] = [
54
+ ]))) : v("", !0),
55
+ t.name === "info-circle" ? (i(), r("g", kt, c[7] || (c[7] = [
56
56
  f("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, null, -1)
57
- ]))) : m("", !0)
57
+ ]))) : v("", !0)
58
58
  ], 2));
59
59
  }
60
- }, A = /* @__PURE__ */ Ce(vt, [["__scopeId", "data-v-89f9b7e1"]]), ht = {
60
+ }, $ = /* @__PURE__ */ Le(St, [["__scopeId", "data-v-89f9b7e1"]]), Ct = ["data-index"], Vt = {
61
61
  key: 2,
62
62
  class: "expander-placeholder flex-shrink-0"
63
- }, yt = ["checked", ".indeterminate", "disabled"], gt = { class: "item-content text-start text-break lh-1" }, le = 0.91, pt = {
63
+ }, Lt = ["checked", ".indeterminate", "disabled"], It = { class: "item-content text-start text-break lh-1" }, ne = 0.91, Mt = {
64
64
  __name: "TreeSelectItem",
65
65
  props: {
66
66
  item: { type: Object, required: !0 },
@@ -76,67 +76,74 @@ const Ce = (t, q) => {
76
76
  disableBranchNode: { type: Boolean, default: !1 },
77
77
  displayMode: { type: String, default: "text" },
78
78
  index: { type: Number, default: 0 },
79
- siblingsCount: { type: Number, default: 1 }
79
+ siblingsCount: { type: Number, default: 1 },
80
+ highlightedIndex: {
81
+ type: Number,
82
+ default: -1
83
+ }
80
84
  },
81
85
  emits: ["select", "toggle-expand"],
82
- setup(t, { emit: q }) {
83
- const l = t, h = p(() => l.index === l.siblingsCount - 1), c = (v) => v[l.optionValue] || v.id || v.value, $ = (v) => !l.disabledKey || !v ? !1 : v.hasOwnProperty(l.disabledKey) && v[l.disabledKey] !== null, V = p(() => l.item.children && l.item.children.length > 0), k = p(() => l.expandedItems.has(c(l.item))), N = p(() => l.selectedItems.includes(c(l.item))), K = (v) => {
86
+ setup(t, { emit: W }) {
87
+ const l = t, g = p(() => l.index === l.siblingsCount - 1), c = (m) => m[l.optionValue] || m.id || m.value, B = (m) => !l.disabledKey || !m ? !1 : m.hasOwnProperty(l.disabledKey) && m[l.disabledKey] !== null, V = p(() => l.item.children && l.item.children.length > 0), w = p(() => l.expandedItems.has(c(l.item))), L = p(() => l.selectedItems.includes(c(l.item))), N = (m) => {
84
88
  let y = [];
85
- return v.children && v.children.forEach((L) => {
86
- y.push(c(L)), y.push(...K(L));
89
+ return m.children && m.children.forEach((I) => {
90
+ y.push(c(I)), y.push(...N(I));
87
91
  }), y;
88
- }, H = p(() => !l.multiple || !l.selectAll || !V.value || N.value ? !1 : K(l.item).some((y) => l.selectedItems.includes(y)));
89
- return (v, y) => {
90
- const L = et("TreeSelectItem", !0);
92
+ }, j = p(() => !l.multiple || !l.selectAll || !V.value || L.value ? !1 : N(l.item).some((y) => l.selectedItems.includes(y)));
93
+ return (m, y) => {
94
+ const I = dt("TreeSelectItem", !0);
91
95
  return i(), r("div", {
92
- class: w(["tree-select-item-wrapper", { "is-last-child": h.value }])
96
+ class: k(["tree-select-item-wrapper", {
97
+ "is-last-child": g.value
98
+ }]),
99
+ "data-index": t.index
93
100
  }, [
94
101
  f("div", {
95
- class: w(["list-group-item list-group-item-action d-flex align-items-center gap-1", {
96
- "bg-primary text-white": N.value && (t.selectMode === "highlight" || !t.multiple) && !$(t.item) && !(t.disableBranchNode && V.value),
97
- "is-disabled text-muted bg-light": $(t.item)
102
+ class: k(["list-group-item list-group-item-action d-flex align-items-center gap-1", {
103
+ "bg-primary text-white": t.highlightedIndex === t.index && t.selectMode === "highlight" || L.value && (t.selectMode === "highlight" || !t.multiple) && !B(t.item) && !(t.disableBranchNode && V.value),
104
+ "is-disabled text-muted bg-light": B(t.item)
98
105
  }]),
99
- style: be({ paddingLeft: `${t.level * le + 0.5}rem` }),
100
- onClick: y[2] || (y[2] = (B) => $(t.item) ? null : v.$emit("select", t.item))
106
+ style: ke({ paddingLeft: `${t.level * ne + 0.5}rem` }),
107
+ onClick: y[2] || (y[2] = (T) => B(t.item) ? null : m.$emit("select", t.item))
101
108
  }, [
102
109
  t.displayMode === "tree-node" && t.level > 0 ? (i(), r("div", {
103
110
  key: 0,
104
- class: w(["tree-indent", { "last-child-connector": h.value }]),
105
- style: be({
106
- left: `${(t.level - 1) * le + le / 2}rem`,
111
+ class: k(["tree-indent", { "last-child-connector": g.value }]),
112
+ style: ke({
113
+ left: `${(t.level - 1) * ne + ne / 2}rem`,
107
114
  width: "2.3rem"
108
115
  })
109
- }, null, 6)) : m("", !0),
110
- V.value ? (i(), O(A, {
116
+ }, null, 6)) : v("", !0),
117
+ V.value ? (i(), O($, {
111
118
  key: 1,
112
119
  name: "chevron-right",
113
- class: w(["expander-icon flex-shrink-0", { "rotate-90": k.value }]),
114
- onClick: y[0] || (y[0] = C((B) => v.$emit("toggle-expand", c(t.item)), ["stop"]))
115
- }, null, 8, ["class"])) : (i(), r("span", ht)),
120
+ class: k(["expander-icon flex-shrink-0", { "rotate-90": w.value }]),
121
+ onClick: y[0] || (y[0] = C((T) => m.$emit("toggle-expand", c(t.item)), ["stop"]))
122
+ }, null, 8, ["class"])) : (i(), r("span", Vt)),
116
123
  t.multiple && t.selectMode === "checkbox" && !(t.disableBranchNode && V.value) ? (i(), r("input", {
117
124
  key: 3,
118
125
  type: "checkbox",
119
126
  class: "tree-checkbox",
120
- checked: N.value,
121
- ".indeterminate": H.value,
122
- disabled: $(t.item),
123
- onClick: y[1] || (y[1] = C((B) => v.$emit("select", t.item), ["stop"]))
124
- }, null, 40, yt)) : m("", !0),
125
- f("div", gt, [
126
- ue(v.$slots, "default", {
127
+ checked: L.value,
128
+ ".indeterminate": j.value,
129
+ disabled: B(t.item),
130
+ onClick: y[1] || (y[1] = C((T) => m.$emit("select", t.item), ["stop"]))
131
+ }, null, 40, Lt)) : v("", !0),
132
+ f("div", It, [
133
+ fe(m.$slots, "default", {
127
134
  item: t.item,
128
135
  level: t.level
129
136
  }, void 0, !0)
130
137
  ])
131
138
  ], 6),
132
- V.value && k.value ? (i(), r("div", {
139
+ V.value && w.value ? (i(), r("div", {
133
140
  key: 0,
134
- class: w(["children-wrapper", { "tree-branch-guide": t.displayMode === "tree-node" && !h.value }]),
135
- style: be(t.displayMode === "tree-node" ? { marginLeft: `${t.level * le + le / 2}rem` } : {})
141
+ class: k(["children-wrapper", { "tree-branch-guide": t.displayMode === "tree-node" && !g.value }]),
142
+ style: ke(t.displayMode === "tree-node" ? { marginLeft: `${t.level * ne + ne / 2}rem` } : {})
136
143
  }, [
137
- (i(!0), r(j, null, Z(t.item.children, (B, ne) => (i(), O(L, {
138
- key: c(B),
139
- item: B,
144
+ (i(!0), r(U, null, G(t.item.children, (T, ae) => (i(), O(I, {
145
+ key: c(T),
146
+ item: T,
140
147
  level: t.level + 1,
141
148
  "selected-items": t.selectedItems,
142
149
  "expanded-items": t.expandedItems,
@@ -148,52 +155,48 @@ const Ce = (t, q) => {
148
155
  "disabled-key": t.disabledKey,
149
156
  "disable-branch-node": t.disableBranchNode,
150
157
  "display-mode": t.displayMode,
151
- index: ne,
158
+ index: ae,
152
159
  "siblings-count": t.item.children.length,
153
- onSelect: y[3] || (y[3] = (M) => v.$emit("select", M)),
154
- onToggleExpand: y[4] || (y[4] = (M) => v.$emit("toggle-expand", M))
160
+ onSelect: y[3] || (y[3] = (M) => m.$emit("select", M)),
161
+ onToggleExpand: y[4] || (y[4] = (M) => m.$emit("toggle-expand", M))
155
162
  }, {
156
- default: Re(({ item: M, level: z }) => [
157
- ue(v.$slots, "default", {
163
+ default: Ze(({ item: M, level: z }) => [
164
+ fe(m.$slots, "default", {
158
165
  item: M,
159
166
  level: z
160
167
  }, void 0, !0)
161
168
  ]),
162
169
  _: 2
163
170
  }, 1032, ["item", "level", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node", "display-mode", "index", "siblings-count"]))), 128))
164
- ], 6)) : m("", !0)
165
- ], 2);
171
+ ], 6)) : v("", !0)
172
+ ], 10, Ct);
166
173
  };
167
174
  }
168
- }, bt = /* @__PURE__ */ Ce(pt, [["__scopeId", "data-v-faaee2eb"]]), xt = ["onKeydown"], kt = { class: "tree-select-display-container" }, wt = {
175
+ }, At = /* @__PURE__ */ Le(Mt, [["__scopeId", "data-v-143cc698"]]), $t = ["onKeydown"], Bt = { class: "tree-select-display-container" }, Nt = {
169
176
  key: 0,
170
177
  class: "d-flex align-items-center justify-content-start w-100"
171
- }, St = ["title"], Ct = { key: 1 }, Vt = {
178
+ }, Tt = ["title"], Et = { key: 1 }, zt = {
172
179
  key: 0,
173
180
  class: "text-muted"
174
- }, Lt = {
181
+ }, Dt = {
175
182
  class: "chip-measure-layer",
176
183
  "aria-hidden": "true"
177
- }, Mt = { class: "chip-label" }, It = { class: "chip-label" }, At = { class: "d-flex align-items-center gap-2" }, $t = { class: "list-group list-group-flush" }, Nt = { class: "text-wrap text-start me-2" }, Bt = { class: "p-2 border-bottom d-flex flex-column gap-2" }, Tt = ["onKeydown"], zt = {
184
+ }, Kt = { class: "chip-label" }, Pt = { class: "chip-label" }, Rt = { class: "d-flex align-items-center gap-2" }, Ot = { class: "list-group list-group-flush" }, qt = { class: "text-wrap text-start me-2" }, Ft = { class: "p-2 border-bottom d-flex flex-column gap-2" }, Ht = ["onKeydown"], Wt = {
178
185
  key: 1,
179
186
  class: "d-flex align-items-center gap-2"
180
- }, Et = ["value"], Kt = ["disabled"], Dt = {
187
+ }, jt = ["value"], Zt = ["disabled"], Ut = {
181
188
  key: 0,
182
189
  class: "p-4 text-muted text-center"
183
- }, Pt = {
184
- key: 1,
185
- class: "tree-select-body",
186
- style: { "max-height": "300px", "overflow-y": "auto" }
187
- }, Rt = {
190
+ }, Gt = {
188
191
  key: 0,
189
192
  class: "list-group list-group-flush"
190
- }, Ot = {
193
+ }, Jt = {
191
194
  class: "d-flex align-items-center gap-2",
192
195
  style: { "white-space": "wrap" }
193
- }, Ft = {
196
+ }, Qt = {
194
197
  key: 1,
195
198
  class: "p-3 text-muted text-center"
196
- }, qt = { key: 0 }, Ht = { key: 0 }, Wt = { key: 1 }, jt = { key: 0 }, Zt = { key: 1 }, Ut = {
199
+ }, Xt = { key: 0 }, Yt = { key: 0 }, _t = { key: 1 }, el = { key: 0 }, tl = { key: 1 }, ll = {
197
200
  __name: "TreeSelectMain",
198
201
  props: {
199
202
  modelValue: {
@@ -325,225 +328,227 @@ const Ce = (t, q) => {
325
328
  }
326
329
  },
327
330
  emits: ["update:modelValue", "change", "clear", "deselect", "select", "focus", "blur", "add-new"],
328
- setup(t, { emit: q }) {
329
- const l = t, h = q, c = g(null), $ = g(null), V = g(null), k = g(""), N = g(!1), K = g(/* @__PURE__ */ new Set()), H = g(null), v = g(null), y = g(null), L = g(!1), B = g(null), ne = g(null), M = g(!1), z = g(l.defaultSortKey), U = g(l.defaultSortDirection), G = g(null), se = g(null), J = g(!1), ae = g(null), Ve = g(null), ce = g(0), Le = p(() => l.size === "sm" ? "btn-sm" : l.size === "lg" ? "btn-lg" : l.size === "xl" ? "btn-xl" : ""), Me = p(() => l.size === "sm" ? "form-control-sm" : l.size === "lg" ? "form-control-lg" : l.size === "xl" ? "form-control-xl" : ""), Oe = p(() => oe.value === 0 ? [] : W.value.slice(ye.value)), Q = p(() => !l.multiple || !l.excludeFromSelectedListKey ? P.value : P.value.filter((e) => {
330
- const s = D(e);
331
- return !s || !s[l.excludeFromSelectedListKey];
332
- })), Ie = p(() => {
333
- const e = Q.value;
331
+ setup(t, { emit: W }) {
332
+ const l = t, g = W, c = h(null), B = h(null), V = h(null), w = h(""), L = h(!1), N = h(/* @__PURE__ */ new Set()), j = h(null), m = h(null), y = h(null), I = h(!1), T = h(null), ae = h(null), M = h(!1), z = h(l.defaultSortKey), J = h(l.defaultSortDirection), Q = h(null), se = h(null), X = h(!1), ie = h(null), Ie = h(null), ve = h(0), q = h(-1), me = h([]), Me = h(null), Ae = p(() => l.size === "sm" ? "btn-sm" : l.size === "lg" ? "btn-lg" : l.size === "xl" ? "btn-xl" : ""), $e = p(() => l.size === "sm" ? "form-control-sm" : l.size === "lg" ? "form-control-lg" : l.size === "xl" ? "form-control-xl" : ""), Ue = p(() => re.value === 0 ? [] : Z.value.slice(be.value)), Y = p(() => !l.multiple || !l.excludeFromSelectedListKey ? R.value : R.value.filter((e) => {
333
+ const a = P(e);
334
+ return !a || !a[l.excludeFromSelectedListKey];
335
+ })), Be = p(() => {
336
+ const e = Y.value;
334
337
  if (e.length === 0) return l.placeholder;
335
338
  if (l.multiple) {
336
339
  if (e.length === 1) {
337
- const n = Y(e[0]);
340
+ const n = ee(e[0]);
338
341
  return n ? n.join(" → ") : e[0];
339
342
  }
340
343
  return `${e.length} items selected`;
341
344
  }
342
- const s = Y(e[0]);
343
- return s ? s.join(" → ") : e[0];
344
- }), Fe = p(() => l.multiple ? Array.isArray(l.modelValue) ? l.modelValue : [] : l.modelValue !== null && l.modelValue !== void 0 ? [l.modelValue] : []), qe = p(() => Fe.value.filter((e) => e === "" || e === null || e === void 0 || e === 0 ? !1 : !D(e))), Ae = async () => {
345
- await R();
346
- const e = ne.value;
347
- if (l.multiple || l.displayMode === "chips" || Q.value.length === 0 || !e) {
345
+ const a = ee(e[0]);
346
+ return a ? a.join(" → ") : e[0];
347
+ }), Ge = p(() => l.multiple ? Array.isArray(l.modelValue) ? l.modelValue : [] : l.modelValue !== null && l.modelValue !== void 0 ? [l.modelValue] : []), Je = p(() => Ge.value.filter((e) => e === "" || e === null || e === void 0 || e === 0 ? !1 : !P(e))), Ne = (e, a = 0, n = []) => (e.forEach((s) => {
348
+ n.push({ item: s, level: a }), s.children && s.children.length && N.value.has(b(s)) && Ne(s.children, a + 1, n);
349
+ }), n), Te = async () => {
350
+ await K();
351
+ const e = ae.value;
352
+ if (l.multiple || l.displayMode === "chips" || Y.value.length === 0 || !e) {
348
353
  M.value = !1;
349
354
  return;
350
355
  }
351
356
  M.value = e.scrollWidth > e.clientWidth;
352
- }, E = (e) => e && (e[l.optionLabel] || e.label || e.name) || "", b = (e) => e ? e[l.optionValue] || e.id || e.value : null, fe = (e) => !l.disabledKey || !e ? !1 : e.hasOwnProperty(l.disabledKey) && e[l.disabledKey] !== null, I = (e) => e.children && e.children.length > 0, X = (e, s) => {
353
- if (s)
354
- return s.split(".").reduce((n, a) => n && n[a], e);
355
- }, D = (e, s = l.items) => {
356
- for (const n of s) {
357
+ }, D = (e) => e && (e[l.optionLabel] || e.label || e.name) || "", b = (e) => e ? e[l.optionValue] || e.id || e.value : null, he = (e) => !l.disabledKey || !e ? !1 : e.hasOwnProperty(l.disabledKey) && e[l.disabledKey] !== null, A = (e) => e.children && e.children.length > 0, _ = (e, a) => {
358
+ if (a)
359
+ return a.split(".").reduce((n, s) => n && n[s], e);
360
+ }, P = (e, a = l.items) => {
361
+ for (const n of a) {
357
362
  if (b(n) === e) return n;
358
- if (I(n)) {
359
- const a = D(e, n.children);
360
- if (a) return a;
363
+ if (A(n)) {
364
+ const s = P(e, n.children);
365
+ if (s) return s;
361
366
  }
362
367
  }
363
368
  return null;
364
- }, me = (e) => {
365
- const s = [];
366
- return I(e) && e.children.forEach((n) => {
367
- fe(n) || (s.push(b(n)), s.push(...me(n)));
368
- }), s;
369
- }, ie = async () => {
370
- await R();
371
- const e = Ve.value;
369
+ }, ge = (e) => {
370
+ const a = [];
371
+ return A(e) && e.children.forEach((n) => {
372
+ he(n) || (a.push(b(n)), a.push(...ge(n)));
373
+ }), a;
374
+ }, oe = async () => {
375
+ await K();
376
+ const e = Ie.value;
372
377
  if (!e) return;
373
- const s = e.querySelector(".chip-measure-layer");
374
- if (!s) return;
375
- const n = Array.from(s.children);
378
+ const a = e.querySelector(".chip-measure-layer");
379
+ if (!a) return;
380
+ const n = Array.from(a.children);
376
381
  if (!n.length) {
377
- ce.value = 0;
382
+ ve.value = 0;
378
383
  return;
379
384
  }
380
- const a = e.clientWidth, o = 4, d = 40;
385
+ const s = e.clientWidth, o = 4, d = 40;
381
386
  let u = 0, x = 0;
382
- for (let T = 0; T < n.length; T++) {
383
- const Pe = n[T].offsetWidth + o, _e = T < n.length - 1 ? d : 0;
384
- if (u + Pe + _e > a)
387
+ for (let E = 0; E < n.length; E++) {
388
+ const je = n[E].offsetWidth + o, rt = E < n.length - 1 ? d : 0;
389
+ if (u + je + rt > s)
385
390
  break;
386
- u += Pe, x++;
391
+ u += je, x++;
387
392
  }
388
- ce.value = Math.max(x, 1);
389
- }, ve = (e, s = l.items, n = []) => {
390
- for (const a of s) {
391
- if (b(a) === e) return n;
392
- if (I(a)) {
393
- const o = ve(e, a.children, [...n, b(a)]);
393
+ ve.value = Math.max(x, 1);
394
+ }, ye = (e, a = l.items, n = []) => {
395
+ for (const s of a) {
396
+ if (b(s) === e) return n;
397
+ if (A(s)) {
398
+ const o = ye(e, s.children, [...n, b(s)]);
394
399
  if (o) return o;
395
400
  }
396
401
  }
397
402
  return null;
398
- }, P = p(() => {
403
+ }, R = p(() => {
399
404
  const e = new Set(Array.isArray(l.modelValue) ? l.modelValue : [l.modelValue].filter(Boolean));
400
405
  if (l.multiple && l.selectAll) {
401
- const s = (n) => {
402
- n.forEach((a) => {
403
- if (I(a)) {
404
- const o = a.children.filter((u) => !fe(u));
405
- o.length > 0 && o.every((u) => e.has(b(u))) && e.add(b(a)), s(a.children);
406
+ const a = (n) => {
407
+ n.forEach((s) => {
408
+ if (A(s)) {
409
+ const o = s.children.filter((u) => !he(u));
410
+ o.length > 0 && o.every((u) => e.has(b(u))) && e.add(b(s)), a(s.children);
406
411
  }
407
412
  });
408
413
  };
409
- s(l.items);
414
+ a(l.items);
410
415
  }
411
416
  return Array.from(e);
412
- }), Y = (e, s = l.items, n = []) => {
413
- for (const a of s) {
414
- const o = [...n, E(a)];
415
- if (b(a) === e) return o;
416
- if (I(a)) {
417
- const d = Y(e, a.children, o);
417
+ }), ee = (e, a = l.items, n = []) => {
418
+ for (const s of a) {
419
+ const o = [...n, D(s)];
420
+ if (b(s) === e) return o;
421
+ if (A(s)) {
422
+ const d = ee(e, s.children, o);
418
423
  if (d) return d;
419
424
  }
420
425
  }
421
426
  return null;
422
- }, $e = (e) => {
427
+ }, Ee = (e) => {
423
428
  if (!e || e.length === 0) return "";
424
- const s = e.join(" → ");
425
- return s.length <= 40 ? s : e.length > 2 ? `${e[0]} → ... → ${e[e.length - 1]}` : s;
426
- }, he = p(() => {
427
- const e = Q.value;
429
+ const a = e.join(" → ");
430
+ return a.length <= 40 ? a : e.length > 2 ? `${e[0]} → ... → ${e[e.length - 1]}` : a;
431
+ }, pe = p(() => {
432
+ const e = Y.value;
428
433
  if (e.length === 0) return l.placeholder;
429
434
  if (l.multiple) {
430
435
  if (e.length === 1) {
431
- const o = D(e[0]);
436
+ const o = P(e[0]);
432
437
  if (!o)
433
438
  return `${e[0]} (No longer available)`;
434
- const d = Y(e[0]);
435
- return d ? $e(d) : E(o);
439
+ const d = ee(e[0]);
440
+ return d ? Ee(d) : D(o);
436
441
  }
437
442
  return `${e.length} items selected`;
438
443
  }
439
- const s = e[0], n = D(s);
444
+ const a = e[0], n = P(a);
440
445
  if (!n)
441
- return `${s} (No longer available)`;
442
- const a = Y(s);
443
- return a ? $e(a) : E(n);
444
- }), W = p(() => {
445
- if (!l.multiple || Q.value.length === 0) return [];
446
- const e = Q.value.map((a) => {
447
- const o = D(a);
446
+ return `${a} (No longer available)`;
447
+ const s = ee(a);
448
+ return s ? Ee(s) : D(n);
449
+ }), Z = p(() => {
450
+ if (!l.multiple || Y.value.length === 0) return [];
451
+ const e = Y.value.map((s) => {
452
+ const o = P(s);
448
453
  return o || {
449
- [l.optionValue]: a,
450
- [l.optionLabel]: `${a} (No longer available)`,
454
+ [l.optionValue]: s,
455
+ [l.optionLabel]: `${s} (No longer available)`,
451
456
  __missing: !0
452
457
  };
453
458
  });
454
459
  if (!l.sortable || !z.value)
455
460
  return e;
456
- const s = z.value, n = U.value;
457
- return [...e].sort((a, o) => {
458
- if (a.__missing) return 1;
461
+ const a = z.value, n = J.value;
462
+ return [...e].sort((s, o) => {
463
+ if (s.__missing) return 1;
459
464
  if (o.__missing) return -1;
460
- const d = X(a, s), u = X(o, s);
465
+ const d = _(s, a), u = _(o, a);
461
466
  if (d == null) return 1;
462
467
  if (u == null) return -1;
463
468
  let x = 0;
464
469
  return typeof d == "string" && typeof u == "string" ? x = d.localeCompare(u) : d > u ? x = 1 : d < u && (x = -1), n === "desc" ? x * -1 : x;
465
470
  });
466
- }), Ne = p(
467
- () => W.value.slice(0, ye.value)
468
- ), ye = p(() => l.maxVisibleChipsDisplay !== null ? l.maxVisibleChipsDisplay : Math.max(ce.value, 1)), oe = p(() => {
469
- const e = W.value.length - ye.value;
471
+ }), ze = p(
472
+ () => Z.value.slice(0, be.value)
473
+ ), be = p(() => l.maxVisibleChipsDisplay !== null ? l.maxVisibleChipsDisplay : Math.max(ve.value, 1)), re = p(() => {
474
+ const e = Z.value.length - be.value;
470
475
  return e > 0 ? e : 0;
471
- }), Be = (e, s) => {
472
- const n = s.toLowerCase();
473
- return e.map((a) => {
476
+ }), De = (e, a) => {
477
+ const n = a.toLowerCase();
478
+ return e.map((s) => {
474
479
  let o = !1;
475
480
  if (l.keyFilters && l.keyFilters.length > 0)
476
481
  for (const u of l.keyFilters) {
477
- const x = X(a, u);
482
+ const x = _(s, u);
478
483
  if (x != null && String(x).toLowerCase().includes(n)) {
479
484
  o = !0;
480
485
  break;
481
486
  }
482
487
  }
483
488
  else
484
- o = E(a).toLowerCase().includes(n);
485
- if (!I(a))
486
- return o ? a : null;
487
- const d = Be(a.children, s);
488
- return o ? { ...a, children: a.children } : d.length > 0 ? { ...a, children: d } : null;
489
+ o = D(s).toLowerCase().includes(n);
490
+ if (!A(s))
491
+ return o ? s : null;
492
+ const d = De(s.children, a);
493
+ return o ? { ...s, children: s.children } : d.length > 0 ? { ...s, children: d } : null;
489
494
  }).filter(Boolean);
490
- }, Te = (e, s, n) => !e || !s ? e : [...e].sort((o, d) => {
491
- const u = X(o, s), x = X(d, s);
495
+ }, Ke = (e, a, n) => !e || !a ? e : [...e].sort((o, d) => {
496
+ const u = _(o, a), x = _(d, a);
492
497
  if (u == null) return 1;
493
498
  if (x == null) return -1;
494
- let T = 0;
495
- return typeof u == "string" && typeof x == "string" ? T = u.localeCompare(x) : u > x ? T = 1 : u < x && (T = -1), n === "desc" ? T * -1 : T;
496
- }).map((o) => I(o) ? { ...o, children: Te(o.children, s, n) } : o), _ = p(() => {
497
- const e = k.value.trim(), s = e ? Be(l.items, e) : l.items;
498
- return !l.sortable || !z.value ? s : Te(s, z.value, U.value);
499
- }), He = (e) => {
500
- if (l.disableBranchNodes && I(e)) {
499
+ let E = 0;
500
+ return typeof u == "string" && typeof x == "string" ? E = u.localeCompare(x) : u > x ? E = 1 : u < x && (E = -1), n === "desc" ? E * -1 : E;
501
+ }).map((o) => A(o) ? { ...o, children: Ke(o.children, a, n) } : o), F = p(() => {
502
+ const e = w.value.trim(), a = e ? De(l.items, e) : l.items;
503
+ return !l.sortable || !z.value ? a : Ke(a, z.value, J.value);
504
+ }), Pe = (e) => {
505
+ if (l.disableBranchNodes && A(e)) {
501
506
  const o = b(e);
502
- ze(o);
507
+ Re(o);
503
508
  return;
504
509
  }
505
- if (fe(e)) return;
506
- const s = b(e);
507
- let n = new Set(P.value);
510
+ if (he(e)) return;
511
+ const a = b(e);
512
+ let n = new Set(R.value);
508
513
  if (l.multiple) {
509
- const o = n.has(s);
510
- if (l.selectAll && I(e)) {
511
- const d = me(e);
512
- o ? (n.delete(s), h("deselect", e), l.deselectAll && d.forEach((u) => n.delete(u))) : (n.add(s), d.forEach((u) => n.add(u)), h("select", e));
514
+ const o = n.has(a);
515
+ if (l.selectAll && A(e)) {
516
+ const d = ge(e);
517
+ o ? (n.delete(a), g("deselect", e), l.deselectAll && d.forEach((u) => n.delete(u))) : (n.add(a), d.forEach((u) => n.add(u)), g("select", e));
513
518
  } else
514
- o ? (n.delete(s), l.selectAll && ve(s)?.forEach((u) => n.delete(u))) : n.add(s);
519
+ o ? (n.delete(a), l.selectAll && ye(a)?.forEach((u) => n.delete(u))) : n.add(a);
515
520
  } else {
516
521
  const o = l.modelValue, d = b(e);
517
- o === d ? (n.clear(), h("deselect", e)) : (n.clear(), n.add(d), o != null && D(o), h("select", e)), l.closeOnSelect && F(), R(() => {
522
+ o === d ? (n.clear(), g("deselect", e)) : (n.clear(), n.add(d), o != null && P(o), g("select", e)), l.closeOnSelect && H(), K(() => {
518
523
  V.value?.focus();
519
524
  });
520
525
  }
521
- let a = Array.from(n);
522
- l.multiple && l.excludeFromSelectedListKey && (a = a.filter((o) => {
523
- const d = D(o);
526
+ let s = Array.from(n);
527
+ l.multiple && l.excludeFromSelectedListKey && (s = s.filter((o) => {
528
+ const d = P(o);
524
529
  return !d || !d[l.excludeFromSelectedListKey];
525
- })), h("update:modelValue", l.multiple ? a : a[0] || null), h("change", l.multiple ? a : a[0] || null);
526
- }, ge = (e) => {
530
+ })), g("update:modelValue", l.multiple ? s : s[0] || null), g("change", l.multiple ? s : s[0] || null);
531
+ }, xe = (e) => {
527
532
  if (l.disabled || !e) return;
528
- const s = b(e), n = new Set(P.value);
529
- n.delete(s), l.selectAll && (l.deselectAll && I(e) && me(e).forEach((u) => n.delete(u)), ve(s)?.forEach((d) => n.delete(d)));
530
- const a = Array.from(n);
531
- h("update:modelValue", a), h("change", a);
532
- }, ze = (e) => {
533
- K.value.has(e) ? K.value.delete(e) : K.value.add(e);
534
- }, We = () => {
535
- U.value = U.value === "asc" ? "desc" : "asc";
536
- }, je = () => {
533
+ const a = b(e), n = new Set(R.value);
534
+ n.delete(a), l.selectAll && (l.deselectAll && A(e) && ge(e).forEach((u) => n.delete(u)), ye(a)?.forEach((d) => n.delete(d)));
535
+ const s = Array.from(n);
536
+ g("update:modelValue", s), g("change", s);
537
+ }, Re = (e) => {
538
+ N.value.has(e) ? N.value.delete(e) : N.value.add(e);
539
+ }, Qe = () => {
540
+ J.value = J.value === "asc" ? "desc" : "asc";
541
+ }, Xe = () => {
537
542
  const e = l.multiple ? [] : null;
538
- h("clear"), h("update:modelValue", e), h("change", e), ee();
539
- }, Ee = () => {
540
- !l.allowAddNew || !k.value.trim() || (h("add-new", k.value.trim()), F());
541
- }, Ze = () => {
542
- l.allowAddNew && l.addNewMode === "enter" && k.value.trim() && _.value.length === 0 && Ee();
543
- }, Ue = (e) => {
544
- h("focus", e);
545
- }, Ge = async () => {
546
- l.disabled || (ee(), N.value = !0, re(), await R(), $.value && V.value && (H.value = Se(V.value, $.value, {
543
+ g("clear"), g("update:modelValue", e), g("change", e), te();
544
+ }, Oe = () => {
545
+ !l.allowAddNew || !w.value.trim() || (g("add-new", w.value.trim()), H());
546
+ }, Ye = () => {
547
+ l.allowAddNew && l.addNewMode === "enter" && w.value.trim() && F.value.length === 0 && Oe();
548
+ }, _e = (e) => {
549
+ g("focus", e);
550
+ }, et = async () => {
551
+ l.disabled || (te(), L.value = !0, de(), await K(), B.value && V.value && (j.value = Ve(V.value, B.value, {
547
552
  placement: "bottom-start",
548
553
  strategy: "fixed",
549
554
  modifiers: [
@@ -563,253 +568,295 @@ const Ce = (t, q) => {
563
568
  }
564
569
  }
565
570
  ]
566
- })), l.searchable && (await R(), $.value?.querySelector(".tree-search-input")?.focus()));
567
- }, F = () => {
568
- N.value = !1, k.value = "", H.value?.destroy(), H.value = null, h("blur", l.modelValue);
569
- }, pe = () => N.value ? F() : Ge(), Je = async () => {
570
- F(), re(), J.value = !0, await R(), se.value && G.value && (ae.value = Se(G.value, se.value, {
571
+ })), l.searchable && (await K(), B.value?.querySelector(".tree-search-input")?.focus()));
572
+ }, H = () => {
573
+ L.value = !1, w.value = "", j.value?.destroy(), j.value = null, g("blur", l.modelValue);
574
+ }, we = () => L.value ? H() : et(), tt = async () => {
575
+ H(), de(), X.value = !0, await K(), se.value && Q.value && (ie.value = Ve(Q.value, se.value, {
571
576
  placement: "bottom-end",
572
577
  strategy: "fixed",
573
578
  modifiers: [{ name: "offset", options: { offset: [0, 4] } }]
574
579
  }));
575
- }, ee = () => {
576
- J.value = !1, ae.value?.destroy(), ae.value = null;
577
- }, Ke = () => J.value ? ee() : Je(), De = (e) => {
578
- N.value && !V.value?.contains(e.target) && !$.value?.contains(e.target) && F(), J.value && !G.value?.contains(e.target) && !se.value?.contains(e.target) && ee(), L.value && !B.value?.$el?.contains(e.target) && !v.value?.contains(e.target) && re();
579
- }, Qe = (e) => {
580
- c.value?.contains(e.relatedTarget) || F();
581
- }, Xe = async () => {
582
- !M.value || L.value || (F(), ee(), L.value = !0, await R(), v.value && B.value && (y.value = Se(B.value.$el, v.value, {
580
+ }, te = () => {
581
+ X.value = !1, ie.value?.destroy(), ie.value = null;
582
+ }, qe = () => X.value ? te() : tt(), Fe = (e) => {
583
+ L.value && !V.value?.contains(e.target) && !B.value?.contains(e.target) && H(), X.value && !Q.value?.contains(e.target) && !se.value?.contains(e.target) && te(), I.value && !T.value?.$el?.contains(e.target) && !m.value?.contains(e.target) && de();
584
+ }, lt = (e) => {
585
+ c.value?.contains(e.relatedTarget) || H();
586
+ }, nt = async (e) => {
587
+ if (console.log("keydown", e), !!L.value)
588
+ switch (e.key) {
589
+ case "ArrowDown":
590
+ e.preventDefault(), at();
591
+ break;
592
+ case "ArrowUp":
593
+ e.preventDefault(), st();
594
+ break;
595
+ case "Enter":
596
+ e.preventDefault(), He();
597
+ break;
598
+ case "Tab":
599
+ He();
600
+ break;
601
+ }
602
+ }, at = async () => {
603
+ q.value < me.value.length - 1 && (q.value++, await We());
604
+ }, st = async () => {
605
+ q.value > 0 && (q.value--, await We());
606
+ }, He = () => {
607
+ const e = me.value[q.value];
608
+ e && Pe(e.item);
609
+ }, We = async () => {
610
+ await K(), Me.value?.querySelector(
611
+ `[data-index="${q.value}"]`
612
+ )?.scrollIntoView({
613
+ block: "nearest"
614
+ });
615
+ }, it = async () => {
616
+ !M.value || I.value || (H(), te(), I.value = !0, await K(), m.value && T.value && (y.value = Ve(T.value.$el, m.value, {
583
617
  // ⬅️ 5b. USE $el
584
618
  placement: "top",
585
619
  strategy: "fixed",
586
620
  modifiers: [{ name: "offset", options: { offset: [0, 8] } }]
587
621
  })));
588
- }, Ye = () => {
589
- L.value ? re() : Xe();
590
- }, re = () => {
591
- L.value = !1, y.value?.destroy(), y.value = null;
622
+ }, ot = () => {
623
+ I.value ? de() : it();
624
+ }, de = () => {
625
+ I.value = !1, y.value?.destroy(), y.value = null;
592
626
  };
593
- return xe(k, (e) => {
627
+ return ue(
628
+ [F, N],
629
+ () => {
630
+ me.value = Ne(F.value);
631
+ },
632
+ { deep: !0, immediate: !0 }
633
+ ), ue(w, (e) => {
594
634
  if (e.trim()) {
595
- const s = (n) => {
596
- n.forEach((a) => {
597
- I(a) && (K.value.add(b(a)), s(a.children));
635
+ const a = (n) => {
636
+ n.forEach((s) => {
637
+ A(s) && (N.value.add(b(s)), a(s.children));
598
638
  });
599
639
  };
600
- s(_.value);
640
+ a(F.value);
601
641
  }
602
- }), xe(he, () => {
603
- Ae();
604
- }), xe(W, ie), tt(async () => {
605
- document.addEventListener("click", De), window.addEventListener("resize", ie), await R(), ie(), Ae();
606
- }), lt(() => {
607
- document.removeEventListener("click", De), window.removeEventListener("resize", ie), H.value?.destroy(), ae.value?.destroy(), y.value?.destroy();
608
- }), (e, s) => (i(), r("div", {
642
+ }), ue(pe, () => {
643
+ Te();
644
+ }), ue(Z, oe), ut(async () => {
645
+ document.addEventListener("click", Fe), window.addEventListener("resize", oe), await K(), oe(), Te();
646
+ }), ct(() => {
647
+ document.removeEventListener("click", Fe), window.removeEventListener("resize", oe), j.value?.destroy(), ie.value?.destroy(), y.value?.destroy();
648
+ }), (e, a) => (i(), r("div", {
609
649
  ref_key: "wrapperRef",
610
650
  ref: c,
611
651
  class: "tree-select-wrapper",
612
- onFocusin: Ue,
613
- onFocusout: Qe
652
+ onFocusin: _e,
653
+ onFocusout: lt
614
654
  }, [
615
655
  f("div", {
616
656
  ref_key: "triggerRef",
617
657
  ref: V,
618
658
  role: "button",
619
659
  tabindex: "0",
620
- class: w(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main", [
621
- Le.value,
660
+ class: k(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main", [
661
+ Ae.value,
622
662
  {
623
663
  "btn-outline-secondary": !t.isInvalid,
624
664
  "border-danger": t.isInvalid,
625
665
  disabled: t.disabled || t.isLoading,
626
666
  "is-loading": t.isLoading,
627
- "has-chips": t.multiple && t.displayMode === "chips" && P.value.length > 0
667
+ "has-chips": t.multiple && t.displayMode === "chips" && R.value.length > 0
628
668
  }
629
669
  ]]),
630
- onClick: pe,
670
+ onClick: we,
631
671
  onKeydown: [
632
- we(C(pe, ["prevent"]), ["enter"]),
633
- we(C(pe, ["prevent"]), ["space"])
672
+ Ce(C(we, ["prevent"]), ["enter"]),
673
+ Ce(C(we, ["prevent"]), ["space"])
634
674
  ]
635
675
  }, [
636
- f("div", kt, [
637
- ue(e.$slots, "display", {
638
- selectedItems: W.value,
639
- displayText: he.value,
676
+ f("div", Bt, [
677
+ fe(e.$slots, "display", {
678
+ selectedItems: Z.value,
679
+ displayText: pe.value,
640
680
  placeholder: t.placeholder,
641
681
  isLoading: t.isLoading,
642
- removeItem: ge,
643
- getItemLabel: E,
682
+ removeItem: xe,
683
+ getItemLabel: D,
644
684
  getItemValue: b,
645
- visibleChips: Ne.value,
646
- hiddenChipsCount: oe.value,
647
- toggleMorePopover: Ke,
648
- moreTriggerRef: G.value
685
+ visibleChips: ze.value,
686
+ hiddenChipsCount: re.value,
687
+ toggleMorePopover: qe,
688
+ moreTriggerRef: Q.value
649
689
  }, () => [
650
- !t.multiple || t.displayMode === "text" ? (i(), r("div", wt, [
690
+ !t.multiple || t.displayMode === "text" ? (i(), r("div", Nt, [
651
691
  f("span", {
652
692
  ref_key: "textDisplaySpanRef",
653
- ref: ne,
654
- class: w(["text-truncate", { "text-danger": qe.value.length > 0 }]),
655
- title: M.value ? Ie.value : ""
656
- }, S(t.isLoading ? "Loading data..." : he.value), 11, St),
657
- M.value && !t.isLoading ? (i(), O(A, {
693
+ ref: ae,
694
+ class: k(["text-truncate", { "text-danger": Je.value.length > 0 }]),
695
+ title: M.value ? Be.value : ""
696
+ }, S(t.isLoading ? "Loading data..." : pe.value), 11, Tt),
697
+ M.value && !t.isLoading ? (i(), O($, {
658
698
  key: 0,
659
699
  ref_key: "tooltipTriggerIconRef",
660
- ref: B,
700
+ ref: T,
661
701
  name: "info-circle",
662
702
  class: "tooltip-trigger-icon ms-2 flex-shrink-0",
663
- onClick: C(Ye, ["stop"])
664
- }, null, 512)) : m("", !0)
665
- ])) : t.multiple && t.displayMode === "chips" ? (i(), r("div", Ct, [
666
- P.value.length === 0 ? (i(), r("span", Vt, S(t.placeholder), 1)) : (i(), r("div", {
703
+ onClick: C(ot, ["stop"])
704
+ }, null, 512)) : v("", !0)
705
+ ])) : t.multiple && t.displayMode === "chips" ? (i(), r("div", Et, [
706
+ R.value.length === 0 ? (i(), r("span", zt, S(t.placeholder), 1)) : (i(), r("div", {
667
707
  key: 1,
668
708
  class: "chips-container",
669
709
  ref_key: "chipsContainerRef",
670
- ref: Ve
710
+ ref: Ie
671
711
  }, [
672
- f("div", Lt, [
673
- (i(!0), r(j, null, Z(W.value, (n) => (i(), r("span", {
712
+ f("div", Dt, [
713
+ (i(!0), r(U, null, G(Z.value, (n) => (i(), r("span", {
674
714
  key: "measure-" + b(n),
675
715
  class: "badge chip"
676
716
  }, [
677
- f("span", Mt, S(E(n)), 1),
678
- te(A, {
717
+ f("span", Kt, S(D(n)), 1),
718
+ le($, {
679
719
  name: "times",
680
720
  class: "chip-remove"
681
721
  })
682
722
  ]))), 128))
683
723
  ]),
684
- (i(!0), r(j, null, Z(Ne.value, (n) => (i(), r("span", {
724
+ (i(!0), r(U, null, G(ze.value, (n) => (i(), r("span", {
685
725
  key: b(n),
686
- class: w(["badge chip", n.__missing ? "bg-danger text-white" : "bg-primary text-white"])
726
+ class: k(["badge chip", n.__missing ? "bg-danger text-white" : "bg-primary text-white"])
687
727
  }, [
688
- f("span", It, S(E(n)), 1),
689
- te(A, {
728
+ f("span", Pt, S(D(n)), 1),
729
+ le($, {
690
730
  name: "times",
691
731
  class: "chip-remove",
692
- onClick: C((a) => ge(n), ["stop"])
732
+ onClick: C((s) => xe(n), ["stop"])
693
733
  }, null, 8, ["onClick"])
694
734
  ], 2))), 128)),
695
- oe.value > 0 ? (i(), r("button", {
735
+ re.value > 0 ? (i(), r("button", {
696
736
  key: 0,
697
737
  ref_key: "moreTriggerRef",
698
- ref: G,
738
+ ref: Q,
699
739
  type: "button",
700
740
  class: "btn btn-sm btn-light more-button",
701
- onClick: C(Ke, ["stop"])
702
- }, " +" + S(oe.value), 513)) : m("", !0)
741
+ onClick: C(qe, ["stop"])
742
+ }, " +" + S(re.value), 513)) : v("", !0)
703
743
  ], 512))
704
- ])) : m("", !0)
744
+ ])) : v("", !0)
705
745
  ], !0)
706
746
  ]),
707
- f("div", At, [
708
- t.isLoading ? (i(), O(A, {
747
+ f("div", Rt, [
748
+ t.isLoading ? (i(), O($, {
709
749
  key: 0,
710
750
  name: "spinner",
711
751
  class: "loading-icon"
712
- })) : m("", !0),
713
- t.showClearButton && P.value.length > 0 && !t.disabled && !t.isLoading ? (i(), O(A, {
752
+ })) : v("", !0),
753
+ t.showClearButton && R.value.length > 0 && !t.disabled && !t.isLoading ? (i(), O($, {
714
754
  key: 1,
715
755
  name: "times",
716
- onClick: C(je, ["stop"]),
756
+ onClick: C(Xe, ["stop"]),
717
757
  class: "clear-icon"
718
- })) : m("", !0),
719
- t.isLoading ? m("", !0) : (i(), O(A, {
758
+ })) : v("", !0),
759
+ t.isLoading ? v("", !0) : (i(), O($, {
720
760
  key: 2,
721
761
  name: "chevron-down",
722
- class: w(["transition-transform", { "rotate-180": N.value }])
762
+ class: k(["transition-transform", { "rotate-180": L.value }])
723
763
  }, null, 8, ["class"]))
724
764
  ])
725
- ], 42, xt),
726
- J.value ? (i(), r("div", {
765
+ ], 42, $t),
766
+ X.value ? (i(), r("div", {
727
767
  key: 0,
728
768
  ref_key: "morePopoverRef",
729
769
  ref: se,
730
770
  class: "card shadow-lg border-0 more-popover",
731
771
  style: { "z-index": "1060" }
732
772
  }, [
733
- f("div", $t, [
734
- (i(!0), r(j, null, Z(Oe.value, (n) => (i(), r("div", {
773
+ f("div", Ot, [
774
+ (i(!0), r(U, null, G(Ue.value, (n) => (i(), r("div", {
735
775
  key: b(n),
736
776
  class: "list-group-item d-flex justify-content-between align-items-center py-1 px-2"
737
777
  }, [
738
- f("small", Nt, S(E(n)), 1),
739
- t.disabled ? m("", !0) : (i(), O(A, {
778
+ f("small", qt, S(D(n)), 1),
779
+ t.disabled ? v("", !0) : (i(), O($, {
740
780
  key: 0,
741
781
  name: "times",
742
782
  class: "chip-remove flex-shrink-0",
743
- onClick: C((a) => ge(n), ["stop"])
783
+ onClick: C((s) => xe(n), ["stop"])
744
784
  }, null, 8, ["onClick"]))
745
785
  ]))), 128))
746
786
  ])
747
- ], 512)) : m("", !0),
748
- N.value ? (i(), r("div", {
787
+ ], 512)) : v("", !0),
788
+ L.value ? (i(), r("div", {
749
789
  key: 1,
750
790
  ref_key: "dropdownRef",
751
- ref: $,
791
+ ref: B,
752
792
  class: "tree-select-dropdown card shadow-lg border-0",
753
- onMousedown: s[2] || (s[2] = C(() => {
793
+ onMousedown: a[2] || (a[2] = C(() => {
754
794
  }, ["prevent"])),
755
- onClick: s[3] || (s[3] = C(() => {
795
+ onKeydown: nt,
796
+ onClick: a[3] || (a[3] = C(() => {
756
797
  }, ["stop"])),
757
798
  style: { "z-index": "1050" }
758
799
  }, [
759
- f("div", Bt, [
760
- t.searchable ? ke((i(), r("input", {
800
+ f("div", Ft, [
801
+ t.searchable ? Se((i(), r("input", {
761
802
  key: 0,
762
- "onUpdate:modelValue": s[0] || (s[0] = (n) => k.value = n),
803
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => w.value = n),
763
804
  type: "text",
764
- class: w(["form-control tree-search-input", Me.value]),
805
+ class: k(["form-control tree-search-input", $e.value]),
765
806
  placeholder: "Search...",
766
- onKeydown: we(C(Ze, ["prevent"]), ["enter"])
767
- }, null, 42, Tt)), [
768
- [nt, k.value]
769
- ]) : m("", !0),
770
- t.sortable && t.sortOptions.length > 0 ? (i(), r("div", zt, [
771
- ke(f("select", {
772
- "onUpdate:modelValue": s[1] || (s[1] = (n) => z.value = n),
773
- class: w(["form-select flex-grow-1", Me.value])
807
+ onKeydown: Ce(C(Ye, ["prevent"]), ["enter"])
808
+ }, null, 42, Ht)), [
809
+ [ft, w.value]
810
+ ]) : v("", !0),
811
+ t.sortable && t.sortOptions.length > 0 ? (i(), r("div", Wt, [
812
+ Se(f("select", {
813
+ "onUpdate:modelValue": a[1] || (a[1] = (n) => z.value = n),
814
+ class: k(["form-select flex-grow-1", $e.value])
774
815
  }, [
775
- s[4] || (s[4] = f("option", {
816
+ a[4] || (a[4] = f("option", {
776
817
  value: null,
777
818
  disabled: ""
778
819
  }, "Sort by...", -1)),
779
- (i(!0), r(j, null, Z(t.sortOptions, (n) => (i(), r("option", {
820
+ (i(!0), r(U, null, G(t.sortOptions, (n) => (i(), r("option", {
780
821
  key: n.value,
781
822
  value: n.value
782
- }, S(n.label), 9, Et))), 128))
823
+ }, S(n.label), 9, jt))), 128))
783
824
  ], 2), [
784
- [st, z.value]
825
+ [vt, z.value]
785
826
  ]),
786
827
  f("button", {
787
828
  type: "button",
788
- class: w(["btn btn-outline-secondary", Le.value]),
829
+ class: k(["btn btn-outline-secondary", Ae.value]),
789
830
  disabled: !z.value,
790
- onClick: We
831
+ onClick: Qe
791
832
  }, [
792
- te(A, {
793
- name: U.value === "asc" ? "asc" : "desc"
833
+ le($, {
834
+ name: J.value === "asc" ? "asc" : "desc"
794
835
  }, null, 8, ["name"])
795
- ], 10, Kt)
796
- ])) : m("", !0)
836
+ ], 10, Zt)
837
+ ])) : v("", !0)
797
838
  ]),
798
- t.isLoading ? (i(), r("div", Dt, [
799
- te(A, {
839
+ t.isLoading ? (i(), r("div", Ut, [
840
+ le($, {
800
841
  name: "spinner",
801
842
  class: "me-2"
802
843
  }),
803
- s[5] || (s[5] = f("span", null, "Loading...", -1))
804
- ])) : (i(), r("div", Pt, [
805
- _.value.length > 0 ? (i(), r("div", Rt, [
806
- (i(!0), r(j, null, Z(_.value, (n, a) => (i(), O(bt, {
844
+ a[5] || (a[5] = f("span", null, "Loading...", -1))
845
+ ])) : (i(), r("div", {
846
+ key: 1,
847
+ ref_key: "dropdownBodyRef",
848
+ ref: Me,
849
+ class: "tree-select-body",
850
+ style: { "max-height": "300px", "overflow-y": "auto" }
851
+ }, [
852
+ F.value.length > 0 ? (i(), r("div", Gt, [
853
+ (i(!0), r(U, null, G(F.value, (n, s) => (i(), O(At, {
807
854
  key: b(n),
808
855
  item: n,
809
856
  level: 0,
810
857
  "display-mode": t.displayMode,
811
- "selected-items": P.value,
812
- "expanded-items": K.value,
858
+ "selected-items": R.value,
859
+ "expanded-items": N.value,
813
860
  multiple: t.multiple,
814
861
  "select-all": t.selectAll,
815
862
  "select-mode": t.selectMode,
@@ -817,68 +864,70 @@ const Ce = (t, q) => {
817
864
  "option-value": t.optionValue,
818
865
  "disabled-key": t.disabledKey,
819
866
  "disable-branch-node": t.disableBranchNodes,
820
- index: a,
821
- "siblings-count": _.value.length,
822
- onSelect: He,
823
- onToggleExpand: ze
867
+ index: s,
868
+ "data-index": s,
869
+ "highlighted-index": q.value,
870
+ "siblings-count": F.value.length,
871
+ onSelect: Pe,
872
+ onToggleExpand: Re
824
873
  }, {
825
- default: Re(({ item: o, level: d }) => [
826
- ue(e.$slots, "default", {
874
+ default: Ze(({ item: o, level: d }) => [
875
+ fe(e.$slots, "default", {
827
876
  item: o,
828
877
  level: d
829
878
  }, () => [
830
- f("div", Ot, [
831
- de(S(E(o)) + " ", 1),
879
+ f("div", Jt, [
880
+ ce(S(D(o)) + " ", 1),
832
881
  o.icon ? (i(), r("i", {
833
882
  key: 0,
834
- class: w(o.icon)
835
- }, null, 2)) : m("", !0)
883
+ class: k(o.icon)
884
+ }, null, 2)) : v("", !0)
836
885
  ])
837
886
  ], !0)
838
887
  ]),
839
888
  _: 2
840
- }, 1032, ["item", "display-mode", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node", "index", "siblings-count"]))), 128))
841
- ])) : (i(), r("div", Ft, [
842
- t.allowAddNew ? (i(), r("div", qt, [
889
+ }, 1032, ["item", "display-mode", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node", "index", "data-index", "highlighted-index", "siblings-count"]))), 128))
890
+ ])) : (i(), r("div", Qt, [
891
+ t.allowAddNew ? (i(), r("div", Xt, [
843
892
  t.addNewMode === "button" ? (i(), r("button", {
844
893
  key: 0,
845
894
  type: "button",
846
895
  class: "btn btn-success btn-sm w-100",
847
- onClick: Ee
896
+ onClick: Oe
848
897
  }, [
849
- de(' No items found "Click" to ' + S(t.addNewLabel) + " ", 1),
850
- k.value.trim() ? (i(), r("span", Ht, ' : "' + S(k.value) + '" ', 1)) : m("", !0)
851
- ])) : t.addNewMode === "enter" ? (i(), r("span", Wt, [
852
- de(' No items found "Press Enter" to ' + S(t.addNewLabel) + " ", 1),
853
- k.value.trim() ? (i(), r("span", jt, ' : "' + S(k.value) + '" ', 1)) : m("", !0)
854
- ])) : m("", !0)
855
- ])) : (i(), r("div", Zt, [
856
- te(A, {
898
+ ce(' No items found "Click" to ' + S(t.addNewLabel) + " ", 1),
899
+ w.value.trim() ? (i(), r("span", Yt, ' : "' + S(w.value) + '" ', 1)) : v("", !0)
900
+ ])) : t.addNewMode === "enter" ? (i(), r("span", _t, [
901
+ ce(' No items found "Press Enter" to ' + S(t.addNewLabel) + " ", 1),
902
+ w.value.trim() ? (i(), r("span", el, ' : "' + S(w.value) + '" ', 1)) : v("", !0)
903
+ ])) : v("", !0)
904
+ ])) : (i(), r("div", tl, [
905
+ le($, {
857
906
  name: "search",
858
907
  class: "me-1"
859
908
  }),
860
- s[6] || (s[6] = de(" No items found ", -1))
909
+ a[6] || (a[6] = ce(" No items found ", -1))
861
910
  ]))
862
911
  ]))
863
- ]))
864
- ], 544)) : m("", !0),
865
- ke(f("div", {
912
+ ], 512))
913
+ ], 544)) : v("", !0),
914
+ Se(f("div", {
866
915
  ref_key: "tooltipRef",
867
- ref: v,
916
+ ref: m,
868
917
  class: "tree-select-tooltip card shadow-sm py-1 px-2",
869
918
  role: "tooltip",
870
919
  style: { "z-index": "1070" }
871
- }, S(Ie.value), 513), [
872
- [at, L.value]
920
+ }, S(Be.value), 513), [
921
+ [mt, I.value]
873
922
  ])
874
923
  ], 544));
875
924
  }
876
- }, Gt = /* @__PURE__ */ Ce(Ut, [["__scopeId", "data-v-880ba6da"]]), Yt = {
925
+ }, nl = /* @__PURE__ */ Le(ll, [["__scopeId", "data-v-f0ac8a94"]]), ol = {
877
926
  install(t) {
878
- t.component("VSelect", Gt);
927
+ t.component("VSelect", nl);
879
928
  }
880
929
  };
881
930
  export {
882
- Gt as VSelect,
883
- Yt as default
931
+ nl as VSelect,
932
+ ol as default
884
933
  };