@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.
- package/dist/vue-select.css +1 -1
- package/dist/vue-select.es.js +422 -373
- package/dist/vue-select.umd.js +1 -1
- package/package.json +1 -1
package/dist/vue-select.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as p, createElementBlock as r, openBlock as i, normalizeClass as
|
|
2
|
-
import { createPopper as
|
|
3
|
-
const
|
|
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 [
|
|
6
|
-
l[
|
|
5
|
+
for (const [g, c] of W)
|
|
6
|
+
l[g] = c;
|
|
7
7
|
return l;
|
|
8
|
-
},
|
|
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
|
|
18
|
-
"svg-icon-spin":
|
|
17
|
+
const W = t, l = p(() => ({
|
|
18
|
+
"svg-icon-spin": W.name === "spinner"
|
|
19
19
|
}));
|
|
20
|
-
return (
|
|
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:
|
|
26
|
+
class: k(l.value)
|
|
27
27
|
}, [
|
|
28
|
-
t.name === "spinner" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
31
|
-
t.name === "times" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
34
|
-
t.name === "chevron-down" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
37
|
-
t.name === "chevron-right" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
40
|
-
t.name === "search" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
43
|
-
t.name === "asc" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
49
|
-
t.name === "desc" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
55
|
-
t.name === "info-circle" ? (i(), r("g",
|
|
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
|
-
]))) :
|
|
57
|
+
]))) : v("", !0)
|
|
58
58
|
], 2));
|
|
59
59
|
}
|
|
60
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
83
|
-
const l = t,
|
|
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
|
|
86
|
-
y.push(c(
|
|
89
|
+
return m.children && m.children.forEach((I) => {
|
|
90
|
+
y.push(c(I)), y.push(...N(I));
|
|
87
91
|
}), y;
|
|
88
|
-
},
|
|
89
|
-
return (
|
|
90
|
-
const
|
|
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:
|
|
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:
|
|
96
|
-
"bg-primary text-white":
|
|
97
|
-
"is-disabled text-muted bg-light":
|
|
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:
|
|
100
|
-
onClick: y[2] || (y[2] = (
|
|
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:
|
|
105
|
-
style:
|
|
106
|
-
left: `${(t.level - 1) *
|
|
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)) :
|
|
110
|
-
V.value ? (i(), O(
|
|
116
|
+
}, null, 6)) : v("", !0),
|
|
117
|
+
V.value ? (i(), O($, {
|
|
111
118
|
key: 1,
|
|
112
119
|
name: "chevron-right",
|
|
113
|
-
class:
|
|
114
|
-
onClick: y[0] || (y[0] = C((
|
|
115
|
-
}, null, 8, ["class"])) : (i(), r("span",
|
|
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:
|
|
121
|
-
".indeterminate":
|
|
122
|
-
disabled:
|
|
123
|
-
onClick: y[1] || (y[1] = C((
|
|
124
|
-
}, null, 40,
|
|
125
|
-
f("div",
|
|
126
|
-
|
|
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 &&
|
|
139
|
+
V.value && w.value ? (i(), r("div", {
|
|
133
140
|
key: 0,
|
|
134
|
-
class:
|
|
135
|
-
style:
|
|
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(
|
|
138
|
-
key: c(
|
|
139
|
-
item:
|
|
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:
|
|
158
|
+
index: ae,
|
|
152
159
|
"siblings-count": t.item.children.length,
|
|
153
|
-
onSelect: y[3] || (y[3] = (M) =>
|
|
154
|
-
onToggleExpand: y[4] || (y[4] = (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:
|
|
157
|
-
|
|
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)) :
|
|
165
|
-
],
|
|
171
|
+
], 6)) : v("", !0)
|
|
172
|
+
], 10, Ct);
|
|
166
173
|
};
|
|
167
174
|
}
|
|
168
|
-
},
|
|
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
|
-
},
|
|
178
|
+
}, Tt = ["title"], Et = { key: 1 }, zt = {
|
|
172
179
|
key: 0,
|
|
173
180
|
class: "text-muted"
|
|
174
|
-
},
|
|
181
|
+
}, Dt = {
|
|
175
182
|
class: "chip-measure-layer",
|
|
176
183
|
"aria-hidden": "true"
|
|
177
|
-
},
|
|
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
|
-
},
|
|
187
|
+
}, jt = ["value"], Zt = ["disabled"], Ut = {
|
|
181
188
|
key: 0,
|
|
182
189
|
class: "p-4 text-muted text-center"
|
|
183
|
-
},
|
|
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
|
-
},
|
|
193
|
+
}, Jt = {
|
|
191
194
|
class: "d-flex align-items-center gap-2",
|
|
192
195
|
style: { "white-space": "wrap" }
|
|
193
|
-
},
|
|
196
|
+
}, Qt = {
|
|
194
197
|
key: 1,
|
|
195
198
|
class: "p-3 text-muted text-center"
|
|
196
|
-
},
|
|
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:
|
|
329
|
-
const l = t,
|
|
330
|
-
const
|
|
331
|
-
return !
|
|
332
|
-
})),
|
|
333
|
-
const e =
|
|
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 =
|
|
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
|
|
343
|
-
return
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
},
|
|
353
|
-
if (
|
|
354
|
-
return
|
|
355
|
-
},
|
|
356
|
-
for (const n of
|
|
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 (
|
|
359
|
-
const
|
|
360
|
-
if (
|
|
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
|
-
},
|
|
365
|
-
const
|
|
366
|
-
return
|
|
367
|
-
|
|
368
|
-
}),
|
|
369
|
-
},
|
|
370
|
-
await
|
|
371
|
-
const e =
|
|
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
|
|
374
|
-
if (!
|
|
375
|
-
const n = Array.from(
|
|
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
|
-
|
|
382
|
+
ve.value = 0;
|
|
378
383
|
return;
|
|
379
384
|
}
|
|
380
|
-
const
|
|
385
|
+
const s = e.clientWidth, o = 4, d = 40;
|
|
381
386
|
let u = 0, x = 0;
|
|
382
|
-
for (let
|
|
383
|
-
const
|
|
384
|
-
if (u +
|
|
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 +=
|
|
391
|
+
u += je, x++;
|
|
387
392
|
}
|
|
388
|
-
|
|
389
|
-
},
|
|
390
|
-
for (const
|
|
391
|
-
if (b(
|
|
392
|
-
if (
|
|
393
|
-
const o =
|
|
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
|
-
},
|
|
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
|
|
402
|
-
n.forEach((
|
|
403
|
-
if (
|
|
404
|
-
const o =
|
|
405
|
-
o.length > 0 && o.every((u) => e.has(b(u))) && e.add(b(
|
|
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
|
-
|
|
414
|
+
a(l.items);
|
|
410
415
|
}
|
|
411
416
|
return Array.from(e);
|
|
412
|
-
}),
|
|
413
|
-
for (const
|
|
414
|
-
const o = [...n,
|
|
415
|
-
if (b(
|
|
416
|
-
if (
|
|
417
|
-
const d =
|
|
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
|
-
},
|
|
427
|
+
}, Ee = (e) => {
|
|
423
428
|
if (!e || e.length === 0) return "";
|
|
424
|
-
const
|
|
425
|
-
return
|
|
426
|
-
},
|
|
427
|
-
const e =
|
|
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 =
|
|
436
|
+
const o = P(e[0]);
|
|
432
437
|
if (!o)
|
|
433
438
|
return `${e[0]} (No longer available)`;
|
|
434
|
-
const d =
|
|
435
|
-
return d ?
|
|
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
|
|
444
|
+
const a = e[0], n = P(a);
|
|
440
445
|
if (!n)
|
|
441
|
-
return `${
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
}),
|
|
445
|
-
if (!l.multiple ||
|
|
446
|
-
const e =
|
|
447
|
-
const o =
|
|
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]:
|
|
450
|
-
[l.optionLabel]: `${
|
|
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
|
|
457
|
-
return [...e].sort((
|
|
458
|
-
if (
|
|
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 =
|
|
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
|
-
}),
|
|
467
|
-
() =>
|
|
468
|
-
),
|
|
469
|
-
const e =
|
|
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
|
-
}),
|
|
472
|
-
const n =
|
|
473
|
-
return e.map((
|
|
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 =
|
|
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 =
|
|
485
|
-
if (!
|
|
486
|
-
return o ?
|
|
487
|
-
const d =
|
|
488
|
-
return o ? { ...
|
|
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
|
-
},
|
|
491
|
-
const u =
|
|
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
|
|
495
|
-
return typeof u == "string" && typeof x == "string" ?
|
|
496
|
-
}).map((o) =>
|
|
497
|
-
const e =
|
|
498
|
-
return !l.sortable || !z.value ?
|
|
499
|
-
}),
|
|
500
|
-
if (l.disableBranchNodes &&
|
|
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
|
-
|
|
507
|
+
Re(o);
|
|
503
508
|
return;
|
|
504
509
|
}
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
507
|
-
let n = new Set(
|
|
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(
|
|
510
|
-
if (l.selectAll &&
|
|
511
|
-
const d =
|
|
512
|
-
o ? (n.delete(
|
|
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(
|
|
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(),
|
|
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
|
|
522
|
-
l.multiple && l.excludeFromSelectedListKey && (
|
|
523
|
-
const d =
|
|
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
|
-
})),
|
|
526
|
-
},
|
|
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
|
|
529
|
-
n.delete(
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
},
|
|
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
|
-
|
|
539
|
-
},
|
|
540
|
-
!l.allowAddNew || !
|
|
541
|
-
},
|
|
542
|
-
l.allowAddNew && l.addNewMode === "enter" &&
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
},
|
|
546
|
-
l.disabled || (
|
|
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
|
|
567
|
-
},
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
|
|
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
|
-
},
|
|
576
|
-
|
|
577
|
-
},
|
|
578
|
-
|
|
579
|
-
},
|
|
580
|
-
c.value?.contains(e.relatedTarget) ||
|
|
581
|
-
},
|
|
582
|
-
|
|
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
|
-
},
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
|
|
622
|
+
}, ot = () => {
|
|
623
|
+
I.value ? de() : it();
|
|
624
|
+
}, de = () => {
|
|
625
|
+
I.value = !1, y.value?.destroy(), y.value = null;
|
|
592
626
|
};
|
|
593
|
-
return
|
|
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
|
|
596
|
-
n.forEach((
|
|
597
|
-
|
|
635
|
+
const a = (n) => {
|
|
636
|
+
n.forEach((s) => {
|
|
637
|
+
A(s) && (N.value.add(b(s)), a(s.children));
|
|
598
638
|
});
|
|
599
639
|
};
|
|
600
|
-
|
|
640
|
+
a(F.value);
|
|
601
641
|
}
|
|
602
|
-
}),
|
|
603
|
-
|
|
604
|
-
}),
|
|
605
|
-
document.addEventListener("click",
|
|
606
|
-
}),
|
|
607
|
-
document.removeEventListener("click",
|
|
608
|
-
}), (e,
|
|
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:
|
|
613
|
-
onFocusout:
|
|
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:
|
|
621
|
-
|
|
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" &&
|
|
667
|
+
"has-chips": t.multiple && t.displayMode === "chips" && R.value.length > 0
|
|
628
668
|
}
|
|
629
669
|
]]),
|
|
630
|
-
onClick:
|
|
670
|
+
onClick: we,
|
|
631
671
|
onKeydown: [
|
|
632
|
-
|
|
633
|
-
|
|
672
|
+
Ce(C(we, ["prevent"]), ["enter"]),
|
|
673
|
+
Ce(C(we, ["prevent"]), ["space"])
|
|
634
674
|
]
|
|
635
675
|
}, [
|
|
636
|
-
f("div",
|
|
637
|
-
|
|
638
|
-
selectedItems:
|
|
639
|
-
displayText:
|
|
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:
|
|
643
|
-
getItemLabel:
|
|
682
|
+
removeItem: xe,
|
|
683
|
+
getItemLabel: D,
|
|
644
684
|
getItemValue: b,
|
|
645
|
-
visibleChips:
|
|
646
|
-
hiddenChipsCount:
|
|
647
|
-
toggleMorePopover:
|
|
648
|
-
moreTriggerRef:
|
|
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",
|
|
690
|
+
!t.multiple || t.displayMode === "text" ? (i(), r("div", Nt, [
|
|
651
691
|
f("span", {
|
|
652
692
|
ref_key: "textDisplaySpanRef",
|
|
653
|
-
ref:
|
|
654
|
-
class:
|
|
655
|
-
title: M.value ?
|
|
656
|
-
}, S(t.isLoading ? "Loading data..." :
|
|
657
|
-
M.value && !t.isLoading ? (i(), O(
|
|
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:
|
|
700
|
+
ref: T,
|
|
661
701
|
name: "info-circle",
|
|
662
702
|
class: "tooltip-trigger-icon ms-2 flex-shrink-0",
|
|
663
|
-
onClick: C(
|
|
664
|
-
}, null, 512)) :
|
|
665
|
-
])) : t.multiple && t.displayMode === "chips" ? (i(), r("div",
|
|
666
|
-
|
|
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:
|
|
710
|
+
ref: Ie
|
|
671
711
|
}, [
|
|
672
|
-
f("div",
|
|
673
|
-
(i(!0), r(
|
|
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",
|
|
678
|
-
|
|
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(
|
|
724
|
+
(i(!0), r(U, null, G(ze.value, (n) => (i(), r("span", {
|
|
685
725
|
key: b(n),
|
|
686
|
-
class:
|
|
726
|
+
class: k(["badge chip", n.__missing ? "bg-danger text-white" : "bg-primary text-white"])
|
|
687
727
|
}, [
|
|
688
|
-
f("span",
|
|
689
|
-
|
|
728
|
+
f("span", Pt, S(D(n)), 1),
|
|
729
|
+
le($, {
|
|
690
730
|
name: "times",
|
|
691
731
|
class: "chip-remove",
|
|
692
|
-
onClick: C((
|
|
732
|
+
onClick: C((s) => xe(n), ["stop"])
|
|
693
733
|
}, null, 8, ["onClick"])
|
|
694
734
|
], 2))), 128)),
|
|
695
|
-
|
|
735
|
+
re.value > 0 ? (i(), r("button", {
|
|
696
736
|
key: 0,
|
|
697
737
|
ref_key: "moreTriggerRef",
|
|
698
|
-
ref:
|
|
738
|
+
ref: Q,
|
|
699
739
|
type: "button",
|
|
700
740
|
class: "btn btn-sm btn-light more-button",
|
|
701
|
-
onClick: C(
|
|
702
|
-
}, " +" + S(
|
|
741
|
+
onClick: C(qe, ["stop"])
|
|
742
|
+
}, " +" + S(re.value), 513)) : v("", !0)
|
|
703
743
|
], 512))
|
|
704
|
-
])) :
|
|
744
|
+
])) : v("", !0)
|
|
705
745
|
], !0)
|
|
706
746
|
]),
|
|
707
|
-
f("div",
|
|
708
|
-
t.isLoading ? (i(), O(
|
|
747
|
+
f("div", Rt, [
|
|
748
|
+
t.isLoading ? (i(), O($, {
|
|
709
749
|
key: 0,
|
|
710
750
|
name: "spinner",
|
|
711
751
|
class: "loading-icon"
|
|
712
|
-
})) :
|
|
713
|
-
t.showClearButton &&
|
|
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(
|
|
756
|
+
onClick: C(Xe, ["stop"]),
|
|
717
757
|
class: "clear-icon"
|
|
718
|
-
})) :
|
|
719
|
-
t.isLoading ?
|
|
758
|
+
})) : v("", !0),
|
|
759
|
+
t.isLoading ? v("", !0) : (i(), O($, {
|
|
720
760
|
key: 2,
|
|
721
761
|
name: "chevron-down",
|
|
722
|
-
class:
|
|
762
|
+
class: k(["transition-transform", { "rotate-180": L.value }])
|
|
723
763
|
}, null, 8, ["class"]))
|
|
724
764
|
])
|
|
725
|
-
], 42,
|
|
726
|
-
|
|
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",
|
|
734
|
-
(i(!0), r(
|
|
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",
|
|
739
|
-
t.disabled ?
|
|
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((
|
|
783
|
+
onClick: C((s) => xe(n), ["stop"])
|
|
744
784
|
}, null, 8, ["onClick"]))
|
|
745
785
|
]))), 128))
|
|
746
786
|
])
|
|
747
|
-
], 512)) :
|
|
748
|
-
|
|
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:
|
|
793
|
+
onMousedown: a[2] || (a[2] = C(() => {
|
|
754
794
|
}, ["prevent"])),
|
|
755
|
-
|
|
795
|
+
onKeydown: nt,
|
|
796
|
+
onClick: a[3] || (a[3] = C(() => {
|
|
756
797
|
}, ["stop"])),
|
|
757
798
|
style: { "z-index": "1050" }
|
|
758
799
|
}, [
|
|
759
|
-
f("div",
|
|
760
|
-
t.searchable ?
|
|
800
|
+
f("div", Ft, [
|
|
801
|
+
t.searchable ? Se((i(), r("input", {
|
|
761
802
|
key: 0,
|
|
762
|
-
"onUpdate:modelValue":
|
|
803
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => w.value = n),
|
|
763
804
|
type: "text",
|
|
764
|
-
class:
|
|
805
|
+
class: k(["form-control tree-search-input", $e.value]),
|
|
765
806
|
placeholder: "Search...",
|
|
766
|
-
onKeydown:
|
|
767
|
-
}, null, 42,
|
|
768
|
-
[
|
|
769
|
-
]) :
|
|
770
|
-
t.sortable && t.sortOptions.length > 0 ? (i(), r("div",
|
|
771
|
-
|
|
772
|
-
"onUpdate:modelValue":
|
|
773
|
-
class:
|
|
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
|
-
|
|
816
|
+
a[4] || (a[4] = f("option", {
|
|
776
817
|
value: null,
|
|
777
818
|
disabled: ""
|
|
778
819
|
}, "Sort by...", -1)),
|
|
779
|
-
(i(!0), r(
|
|
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,
|
|
823
|
+
}, S(n.label), 9, jt))), 128))
|
|
783
824
|
], 2), [
|
|
784
|
-
[
|
|
825
|
+
[vt, z.value]
|
|
785
826
|
]),
|
|
786
827
|
f("button", {
|
|
787
828
|
type: "button",
|
|
788
|
-
class:
|
|
829
|
+
class: k(["btn btn-outline-secondary", Ae.value]),
|
|
789
830
|
disabled: !z.value,
|
|
790
|
-
onClick:
|
|
831
|
+
onClick: Qe
|
|
791
832
|
}, [
|
|
792
|
-
|
|
793
|
-
name:
|
|
833
|
+
le($, {
|
|
834
|
+
name: J.value === "asc" ? "asc" : "desc"
|
|
794
835
|
}, null, 8, ["name"])
|
|
795
|
-
], 10,
|
|
796
|
-
])) :
|
|
836
|
+
], 10, Zt)
|
|
837
|
+
])) : v("", !0)
|
|
797
838
|
]),
|
|
798
|
-
t.isLoading ? (i(), r("div",
|
|
799
|
-
|
|
839
|
+
t.isLoading ? (i(), r("div", Ut, [
|
|
840
|
+
le($, {
|
|
800
841
|
name: "spinner",
|
|
801
842
|
class: "me-2"
|
|
802
843
|
}),
|
|
803
|
-
|
|
804
|
-
])) : (i(), r("div",
|
|
805
|
-
|
|
806
|
-
|
|
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":
|
|
812
|
-
"expanded-items":
|
|
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:
|
|
821
|
-
"
|
|
822
|
-
|
|
823
|
-
|
|
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:
|
|
826
|
-
|
|
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",
|
|
831
|
-
|
|
879
|
+
f("div", Jt, [
|
|
880
|
+
ce(S(D(o)) + " ", 1),
|
|
832
881
|
o.icon ? (i(), r("i", {
|
|
833
882
|
key: 0,
|
|
834
|
-
class:
|
|
835
|
-
}, null, 2)) :
|
|
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",
|
|
842
|
-
t.allowAddNew ? (i(), r("div",
|
|
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:
|
|
896
|
+
onClick: Oe
|
|
848
897
|
}, [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
])) : t.addNewMode === "enter" ? (i(), r("span",
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
])) :
|
|
855
|
-
])) : (i(), r("div",
|
|
856
|
-
|
|
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
|
-
|
|
909
|
+
a[6] || (a[6] = ce(" No items found ", -1))
|
|
861
910
|
]))
|
|
862
911
|
]))
|
|
863
|
-
]))
|
|
864
|
-
], 544)) :
|
|
865
|
-
|
|
912
|
+
], 512))
|
|
913
|
+
], 544)) : v("", !0),
|
|
914
|
+
Se(f("div", {
|
|
866
915
|
ref_key: "tooltipRef",
|
|
867
|
-
ref:
|
|
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(
|
|
872
|
-
[
|
|
920
|
+
}, S(Be.value), 513), [
|
|
921
|
+
[mt, I.value]
|
|
873
922
|
])
|
|
874
923
|
], 544));
|
|
875
924
|
}
|
|
876
|
-
},
|
|
925
|
+
}, nl = /* @__PURE__ */ Le(ll, [["__scopeId", "data-v-f0ac8a94"]]), ol = {
|
|
877
926
|
install(t) {
|
|
878
|
-
t.component("VSelect",
|
|
927
|
+
t.component("VSelect", nl);
|
|
879
928
|
}
|
|
880
929
|
};
|
|
881
930
|
export {
|
|
882
|
-
|
|
883
|
-
|
|
931
|
+
nl as VSelect,
|
|
932
|
+
ol as default
|
|
884
933
|
};
|