@night-owl-elite/vue-select 1.3.20 → 1.3.22
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 +265 -243
- package/dist/vue-select.umd.js +1 -1
- package/package.json +1 -1
package/dist/vue-select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes spin-d347d13a{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-d347d13a]{animation:spin-d347d13a 1s linear infinite}.list-group-item[data-v-9766821f]{cursor:pointer;border:0;border-radius:0;padding-top:.5rem;padding-bottom:.5rem}.list-group-item.is-disabled[data-v-9766821f]{cursor:not-allowed;opacity:.65}.expander-icon[data-v-9766821f]{width:1rem;height:1rem;flex-shrink:0;transition:transform .2s ease-in-out;color:#6c757d}.expander-placeholder[data-v-9766821f]{display:inline-block;width:1rem;flex-shrink:0}.rotate-90[data-v-9766821f]{transform:rotate(90deg)}.item-content[data-v-9766821f]{flex-grow:1}.tree-select-main[data-v-
|
|
1
|
+
@keyframes spin-d347d13a{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-d347d13a]{animation:spin-d347d13a 1s linear infinite}.list-group-item[data-v-9766821f]{cursor:pointer;border:0;border-radius:0;padding-top:.5rem;padding-bottom:.5rem}.list-group-item.is-disabled[data-v-9766821f]{cursor:not-allowed;opacity:.65}.expander-icon[data-v-9766821f]{width:1rem;height:1rem;flex-shrink:0;transition:transform .2s ease-in-out;color:#6c757d}.expander-placeholder[data-v-9766821f]{display:inline-block;width:1rem;flex-shrink:0}.rotate-90[data-v-9766821f]{transform:rotate(90deg)}.item-content[data-v-9766821f]{flex-grow:1}.tree-select-main[data-v-5f3fdb15]{--bs-form-select-bg-img: none;display:block;width:100%;font-weight:400;line-height:1.5;color:var(--bs-body-color);appearance:none;background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;text-align:left}.tree-select-display-container[data-v-5f3fdb15]{flex:1;overflow:hidden}.clear-icon[data-v-5f3fdb15]{cursor:pointer;opacity:.6;transition:opacity .2s ease}.clear-icon[data-v-5f3fdb15]:hover{opacity:1}.transition-transform[data-v-5f3fdb15]{transition:transform .2s ease-in-out}.rotate-180[data-v-5f3fdb15]{transform:rotate(180deg)}.tree-select-dropdown[data-v-5f3fdb15]{position:absolute;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.375rem}.is-loading[data-v-5f3fdb15]{cursor:wait}.loading-icon[data-v-5f3fdb15]{animation:spin-5f3fdb15 1s linear infinite}@keyframes spin-5f3fdb15{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.btn-xl[data-v-5f3fdb15]{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.form-control-xl[data-v-5f3fdb15]{min-height:calc(1.5em + 1.5rem + (var(--bs-border-width) * 2));padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.tree-select-body[data-v-5f3fdb15]::-webkit-scrollbar{width:6px}.tree-select-body[data-v-5f3fdb15]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.tree-select-body[data-v-5f3fdb15]::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.tree-select-body[data-v-5f3fdb15]::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.tree-select-main.disabled .more-button[data-v-5f3fdb15]{pointer-events:auto;cursor:pointer}.tree-select-main.has-chips[data-v-5f3fdb15]{height:auto;min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-lg[data-v-5f3fdb15]{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-xl[data-v-5f3fdb15]{min-height:calc(1.5em + 1.5rem + calc(var(--bs-border-width) * 2))}.chips-container[data-v-5f3fdb15]{display:flex;flex-wrap:wrap;gap:.25rem;max-height:8rem;overflow-y:auto}.chip[data-v-5f3fdb15]{display:inline-flex;align-items:center;padding:.2em .6em}.chip-remove[data-v-5f3fdb15]{width:.8em;height:.8em;margin-left:.4em;cursor:pointer;opacity:.7;transition:opacity .2s}.chip-remove[data-v-5f3fdb15]:hover{opacity:1}.more-button[data-v-5f3fdb15]{font-size:.75em;line-height:1;padding:.3em .5em}.more-popover[data-v-5f3fdb15]{width:250px;max-width:80vw;max-height:200px;overflow-y:auto;font-size:.9rem}@media (max-width: 576px){.tree-select-dropdown[data-v-5f3fdb15]{max-width:90vw;left:0!important;right:0!important;margin:0 auto}}
|
package/dist/vue-select.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { createPopper as
|
|
3
|
-
const
|
|
1
|
+
import { computed as y, createElementBlock as o, openBlock as i, normalizeClass as A, createCommentVNode as v, createElementVNode as h, resolveComponent as Le, normalizeStyle as Ie, createBlock as K, withModifiers as z, renderSlot as ne, Fragment as H, renderList as O, withCtx as pe, ref as b, onMounted as Be, onUnmounted as $e, watch as Ae, withKeys as me, toDisplayString as E, createTextVNode as te, createVNode as j, withDirectives as ve, vModelText as Me, vModelSelect as ze, nextTick as le } from "vue";
|
|
2
|
+
import { createPopper as he } from "@popperjs/core";
|
|
3
|
+
const se = (t, N) => {
|
|
4
4
|
const n = t.__vccOpts || t;
|
|
5
|
-
for (const [
|
|
6
|
-
n[
|
|
5
|
+
for (const [p, d] of N)
|
|
6
|
+
n[p] = d;
|
|
7
7
|
return n;
|
|
8
|
-
},
|
|
8
|
+
}, Ee = { key: 0 }, Ke = { key: 1 }, Ne = { key: 2 }, Pe = { key: 3 }, De = { key: 4 }, qe = { key: 5 }, Te = { key: 6 }, He = {
|
|
9
9
|
__name: "SvgIcon",
|
|
10
10
|
props: {
|
|
11
11
|
name: {
|
|
@@ -14,53 +14,53 @@ const te = (t, z) => {
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
setup(t) {
|
|
17
|
-
const
|
|
18
|
-
"svg-icon-spin":
|
|
17
|
+
const N = t, n = y(() => ({
|
|
18
|
+
"svg-icon-spin": N.name === "spinner"
|
|
19
19
|
}));
|
|
20
|
-
return (
|
|
20
|
+
return (p, d) => (i(), o("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: A(n.value)
|
|
27
27
|
}, [
|
|
28
|
-
t.name === "spinner" ? (i(), o("g",
|
|
29
|
-
|
|
30
|
-
]))) :
|
|
31
|
-
t.name === "times" ? (i(), o("g",
|
|
32
|
-
|
|
33
|
-
]))) :
|
|
28
|
+
t.name === "spinner" ? (i(), o("g", Ee, d[0] || (d[0] = [
|
|
29
|
+
h("path", { d: "M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z" }, null, -1)
|
|
30
|
+
]))) : v("", !0),
|
|
31
|
+
t.name === "times" ? (i(), o("g", Ke, d[1] || (d[1] = [
|
|
32
|
+
h("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
|
+
]))) : v("", !0),
|
|
34
34
|
t.name === "chevron-down" ? (i(), o("g", Ne, d[2] || (d[2] = [
|
|
35
|
-
|
|
36
|
-
]))) :
|
|
35
|
+
h("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
|
+
]))) : v("", !0),
|
|
37
37
|
t.name === "chevron-right" ? (i(), o("g", Pe, d[3] || (d[3] = [
|
|
38
|
-
|
|
39
|
-
]))) :
|
|
38
|
+
h("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
|
+
]))) : v("", !0),
|
|
40
40
|
t.name === "search" ? (i(), o("g", De, d[4] || (d[4] = [
|
|
41
|
-
|
|
42
|
-
]))) :
|
|
43
|
-
t.name === "asc" ? (i(), o("g",
|
|
44
|
-
|
|
41
|
+
h("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
|
+
]))) : v("", !0),
|
|
43
|
+
t.name === "asc" ? (i(), o("g", qe, d[5] || (d[5] = [
|
|
44
|
+
h("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
|
-
]))) :
|
|
48
|
+
]))) : v("", !0),
|
|
49
49
|
t.name === "desc" ? (i(), o("g", Te, d[6] || (d[6] = [
|
|
50
|
-
|
|
50
|
+
h("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
|
-
]))) :
|
|
54
|
+
]))) : v("", !0)
|
|
55
55
|
], 2));
|
|
56
56
|
}
|
|
57
|
-
}, $ = /* @__PURE__ */
|
|
57
|
+
}, $ = /* @__PURE__ */ se(He, [["__scopeId", "data-v-d347d13a"]]), Oe = { class: "tree-select-item-wrapper" }, Re = {
|
|
58
58
|
key: 1,
|
|
59
59
|
class: "expander-placeholder"
|
|
60
|
-
},
|
|
60
|
+
}, Ze = ["checked", ".indeterminate", "disabled"], je = { class: "item-content" }, Fe = {
|
|
61
61
|
key: 0,
|
|
62
62
|
class: "children-wrapper"
|
|
63
|
-
},
|
|
63
|
+
}, Ue = {
|
|
64
64
|
__name: "TreeSelectItem",
|
|
65
65
|
props: {
|
|
66
66
|
item: { type: Object, required: !0 },
|
|
@@ -76,50 +76,50 @@ const te = (t, z) => {
|
|
|
76
76
|
disableBranchNode: { type: Boolean, default: !1 }
|
|
77
77
|
},
|
|
78
78
|
emits: ["select", "toggle-expand"],
|
|
79
|
-
setup(t, { emit:
|
|
80
|
-
const n = t,
|
|
81
|
-
let
|
|
82
|
-
return u.children && u.children.forEach((
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
},
|
|
86
|
-
return (u,
|
|
87
|
-
const
|
|
88
|
-
return i(), o("div",
|
|
89
|
-
|
|
90
|
-
class:
|
|
91
|
-
"bg-primary text-white":
|
|
79
|
+
setup(t, { emit: N }) {
|
|
80
|
+
const n = t, p = (u) => u[n.optionValue] || u.id || u.value, d = (u) => !n.disabledKey || !u ? !1 : u.hasOwnProperty(n.disabledKey) && u[n.disabledKey] !== null, x = y(() => n.item.children && n.item.children.length > 0), L = y(() => n.expandedItems.has(p(n.item))), C = y(() => n.selectedItems.includes(p(n.item))), M = (u) => {
|
|
81
|
+
let f = [];
|
|
82
|
+
return u.children && u.children.forEach((I) => {
|
|
83
|
+
f.push(p(I)), f.push(...M(I));
|
|
84
|
+
}), f;
|
|
85
|
+
}, P = y(() => !n.multiple || !n.selectAll || !x.value || C.value ? !1 : M(n.item).some((f) => n.selectedItems.includes(f)));
|
|
86
|
+
return (u, f) => {
|
|
87
|
+
const I = Le("TreeSelectItem", !0);
|
|
88
|
+
return i(), o("div", Oe, [
|
|
89
|
+
h("div", {
|
|
90
|
+
class: A(["list-group-item list-group-item-action d-flex align-items-center gap-2", {
|
|
91
|
+
"bg-primary text-white": C.value && (t.selectMode === "highlight" || !t.multiple) && !d(t.item) && !(t.disableBranchNode && x.value),
|
|
92
92
|
"is-disabled text-muted bg-light": d(t.item)
|
|
93
93
|
}]),
|
|
94
|
-
style:
|
|
95
|
-
onClick:
|
|
94
|
+
style: Ie({ "padding-left": `${t.level * 1.5 + 1}rem` }),
|
|
95
|
+
onClick: f[2] || (f[2] = (V) => d(t.item) || t.disableBranchNode && x.value ? null : u.$emit("select", t.item))
|
|
96
96
|
}, [
|
|
97
|
-
x.value ? (i(),
|
|
97
|
+
x.value ? (i(), K($, {
|
|
98
98
|
key: 0,
|
|
99
99
|
name: "chevron-right",
|
|
100
|
-
class:
|
|
101
|
-
onClick:
|
|
102
|
-
}, null, 8, ["class"])) : (i(), o("span",
|
|
100
|
+
class: A(["expander-icon", { "rotate-90": L.value }]),
|
|
101
|
+
onClick: f[0] || (f[0] = z((V) => u.$emit("toggle-expand", p(t.item)), ["stop"]))
|
|
102
|
+
}, null, 8, ["class"])) : (i(), o("span", Re)),
|
|
103
103
|
t.multiple && t.selectMode === "checkbox" && !(t.disableBranchNode && x.value) ? (i(), o("input", {
|
|
104
104
|
key: 2,
|
|
105
105
|
type: "checkbox",
|
|
106
106
|
class: "form-check-input",
|
|
107
|
-
checked:
|
|
108
|
-
".indeterminate":
|
|
107
|
+
checked: C.value,
|
|
108
|
+
".indeterminate": P.value,
|
|
109
109
|
disabled: d(t.item),
|
|
110
|
-
onClick:
|
|
111
|
-
}, null, 40,
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
onClick: f[1] || (f[1] = z((V) => u.$emit("select", t.item), ["stop"]))
|
|
111
|
+
}, null, 40, Ze)) : v("", !0),
|
|
112
|
+
h("div", je, [
|
|
113
|
+
ne(u.$slots, "default", {
|
|
114
114
|
item: t.item,
|
|
115
115
|
level: t.level
|
|
116
116
|
}, void 0, !0)
|
|
117
117
|
])
|
|
118
118
|
], 6),
|
|
119
|
-
x.value &&
|
|
120
|
-
(i(!0), o(
|
|
121
|
-
key:
|
|
122
|
-
item:
|
|
119
|
+
x.value && L.value ? (i(), o("div", Fe, [
|
|
120
|
+
(i(!0), o(H, null, O(t.item.children, (V) => (i(), K(I, {
|
|
121
|
+
key: p(V),
|
|
122
|
+
item: V,
|
|
123
123
|
level: t.level + 1,
|
|
124
124
|
"selected-items": t.selectedItems,
|
|
125
125
|
"expanded-items": t.expandedItems,
|
|
@@ -130,50 +130,50 @@ const te = (t, z) => {
|
|
|
130
130
|
"option-value": t.optionValue,
|
|
131
131
|
"disabled-key": t.disabledKey,
|
|
132
132
|
"disable-branch-node": t.disableBranchNode,
|
|
133
|
-
onSelect:
|
|
134
|
-
onToggleExpand:
|
|
133
|
+
onSelect: f[3] || (f[3] = (k) => u.$emit("select", k)),
|
|
134
|
+
onToggleExpand: f[4] || (f[4] = (k) => u.$emit("toggle-expand", k))
|
|
135
135
|
}, {
|
|
136
|
-
default:
|
|
137
|
-
|
|
136
|
+
default: pe(({ item: k, level: D }) => [
|
|
137
|
+
ne(u.$slots, "default", {
|
|
138
138
|
item: k,
|
|
139
|
-
level:
|
|
139
|
+
level: D
|
|
140
140
|
}, void 0, !0)
|
|
141
141
|
]),
|
|
142
142
|
_: 2
|
|
143
143
|
}, 1032, ["item", "level", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node"]))), 128))
|
|
144
|
-
])) :
|
|
144
|
+
])) : v("", !0)
|
|
145
145
|
]);
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
},
|
|
148
|
+
}, We = /* @__PURE__ */ se(Ue, [["__scopeId", "data-v-9766821f"]]), Ge = { class: "tree-select-wrapper" }, Je = ["onKeydown"], Qe = { class: "tree-select-display-container" }, Xe = {
|
|
149
149
|
key: 0,
|
|
150
150
|
class: "text-truncate"
|
|
151
|
-
},
|
|
151
|
+
}, Ye = { key: 1 }, _e = {
|
|
152
152
|
key: 0,
|
|
153
153
|
class: "text-muted"
|
|
154
|
-
},
|
|
154
|
+
}, et = {
|
|
155
155
|
key: 1,
|
|
156
156
|
class: "chips-container"
|
|
157
|
-
},
|
|
157
|
+
}, tt = { class: "d-flex align-items-center gap-2" }, lt = { class: "list-group list-group-flush" }, nt = { class: "text-wrap text-start me-2" }, st = { class: "p-2 border-bottom d-flex flex-column gap-2" }, at = {
|
|
158
158
|
key: 1,
|
|
159
159
|
class: "d-flex align-items-center gap-2"
|
|
160
|
-
},
|
|
160
|
+
}, it = ["value"], ot = ["disabled"], rt = {
|
|
161
161
|
key: 0,
|
|
162
162
|
class: "p-4 text-muted text-center"
|
|
163
|
-
},
|
|
163
|
+
}, dt = {
|
|
164
164
|
key: 1,
|
|
165
165
|
class: "tree-select-body",
|
|
166
166
|
style: { "max-height": "300px", "overflow-y": "auto" }
|
|
167
|
-
},
|
|
167
|
+
}, ut = {
|
|
168
168
|
key: 0,
|
|
169
169
|
class: "list-group list-group-flush"
|
|
170
|
-
},
|
|
170
|
+
}, ct = {
|
|
171
171
|
class: "d-flex align-items-center gap-2",
|
|
172
172
|
style: { "white-space": "wrap" }
|
|
173
|
-
},
|
|
173
|
+
}, ft = {
|
|
174
174
|
key: 1,
|
|
175
175
|
class: "p-3 text-muted text-center"
|
|
176
|
-
},
|
|
176
|
+
}, mt = {
|
|
177
177
|
__name: "TreeSelectMain",
|
|
178
178
|
props: {
|
|
179
179
|
modelValue: {
|
|
@@ -226,6 +226,10 @@ const te = (t, z) => {
|
|
|
226
226
|
type: Boolean,
|
|
227
227
|
default: !1
|
|
228
228
|
},
|
|
229
|
+
deselectAll: {
|
|
230
|
+
type: Boolean,
|
|
231
|
+
default: !0
|
|
232
|
+
},
|
|
229
233
|
optionLabel: {
|
|
230
234
|
type: String,
|
|
231
235
|
default: "value"
|
|
@@ -275,129 +279,142 @@ const te = (t, z) => {
|
|
|
275
279
|
}
|
|
276
280
|
},
|
|
277
281
|
emits: ["update:modelValue", "change"],
|
|
278
|
-
setup(t, { emit:
|
|
279
|
-
const n = t,
|
|
282
|
+
setup(t, { emit: N }) {
|
|
283
|
+
const n = t, p = N, d = b(null), x = b(null), L = b(""), C = b(!1), M = b(/* @__PURE__ */ new Set()), P = b(null), u = b(n.defaultSortKey), f = b(n.defaultSortDirection), I = b(null), V = b(null), k = b(!1), D = b(null), ae = y(() => n.size === "sm" ? "btn-sm" : n.size === "lg" ? "btn-lg" : n.size === "xl" ? "btn-xl" : ""), ie = y(() => n.size === "sm" ? "form-control-sm" : n.size === "lg" ? "form-control-lg" : n.size === "xl" ? "form-control-xl" : ""), ge = y(() => X.value === 0 ? [] : Q.value.slice(n.maxVisibleChipsDisplay)), q = (e) => e && (e[n.optionLabel] || e.label || e.name) || "", g = (e) => e ? e[n.optionValue] || e.id || e.value : null, F = (e) => !n.disabledKey || !e ? !1 : e.hasOwnProperty(n.disabledKey) && e[n.disabledKey] !== null, S = (e) => e.children && e.children.length > 0, R = (e, s) => {
|
|
280
284
|
if (s)
|
|
281
285
|
return s.split(".").reduce((l, a) => l && l[a], e);
|
|
282
|
-
},
|
|
286
|
+
}, U = (e, s = n.items) => {
|
|
283
287
|
for (const l of s) {
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
const a =
|
|
288
|
+
if (g(l) === e) return l;
|
|
289
|
+
if (S(l)) {
|
|
290
|
+
const a = U(e, l.children);
|
|
287
291
|
if (a) return a;
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
return null;
|
|
291
|
-
},
|
|
295
|
+
}, W = (e) => {
|
|
292
296
|
const s = [];
|
|
293
|
-
return
|
|
294
|
-
|
|
297
|
+
return S(e) && e.children.forEach((l) => {
|
|
298
|
+
F(l) || (s.push(g(l)), s.push(...W(l)));
|
|
295
299
|
}), s;
|
|
296
|
-
},
|
|
300
|
+
}, G = (e, s = n.items, l = []) => {
|
|
297
301
|
for (const a of s) {
|
|
298
|
-
if (
|
|
299
|
-
if (
|
|
300
|
-
const r =
|
|
302
|
+
if (g(a) === e) return l;
|
|
303
|
+
if (S(a)) {
|
|
304
|
+
const r = G(e, a.children, [...l, g(a)]);
|
|
301
305
|
if (r) return r;
|
|
302
306
|
}
|
|
303
307
|
}
|
|
304
308
|
return null;
|
|
305
|
-
},
|
|
309
|
+
}, B = y(() => {
|
|
306
310
|
const e = new Set(Array.isArray(n.modelValue) ? n.modelValue : [n.modelValue].filter(Boolean));
|
|
307
311
|
if (n.multiple && n.selectAll) {
|
|
308
312
|
const s = (l) => {
|
|
309
313
|
l.forEach((a) => {
|
|
310
|
-
if (
|
|
311
|
-
const r = a.children.filter((
|
|
312
|
-
r.length > 0 && r.every((
|
|
314
|
+
if (S(a)) {
|
|
315
|
+
const r = a.children.filter((c) => !F(c));
|
|
316
|
+
r.length > 0 && r.every((c) => e.has(g(c))) && e.add(g(a)), s(a.children);
|
|
313
317
|
}
|
|
314
318
|
});
|
|
315
319
|
};
|
|
316
320
|
s(n.items);
|
|
317
321
|
}
|
|
318
322
|
return Array.from(e);
|
|
319
|
-
}),
|
|
323
|
+
}), J = (e, s = n.items, l = []) => {
|
|
320
324
|
for (const a of s) {
|
|
321
|
-
const r = [...l,
|
|
322
|
-
if (
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
325
|
+
const r = [...l, q(a)];
|
|
326
|
+
if (g(a) === e) return r;
|
|
327
|
+
if (S(a)) {
|
|
328
|
+
const m = J(e, a.children, r);
|
|
329
|
+
if (m) return m;
|
|
326
330
|
}
|
|
327
331
|
}
|
|
328
332
|
return null;
|
|
329
|
-
},
|
|
333
|
+
}, oe = (e) => {
|
|
330
334
|
if (!e || e.length === 0) return "";
|
|
331
335
|
const s = e.join(" → ");
|
|
332
336
|
return s.length <= 40 ? s : e.length > 2 ? `${e[0]} → ... → ${e[e.length - 1]}` : s;
|
|
333
|
-
},
|
|
334
|
-
const e =
|
|
337
|
+
}, ye = y(() => {
|
|
338
|
+
const e = B.value;
|
|
335
339
|
if (e.length === 0) return n.placeholder;
|
|
336
340
|
if (n.multiple) {
|
|
337
341
|
if (e.length === 1) {
|
|
338
|
-
const l =
|
|
339
|
-
return l ?
|
|
342
|
+
const l = J(e[0]);
|
|
343
|
+
return l ? oe(l) : e[0];
|
|
340
344
|
}
|
|
341
345
|
return `${e.length} items selected`;
|
|
342
346
|
}
|
|
343
|
-
const s =
|
|
344
|
-
return s ?
|
|
345
|
-
}),
|
|
346
|
-
|
|
347
|
+
const s = J(e[0]);
|
|
348
|
+
return s ? oe(s) : e[0];
|
|
349
|
+
}), Q = y(() => {
|
|
350
|
+
if (!n.multiple || B.value.length === 0) return [];
|
|
351
|
+
const e = B.value.map((a) => U(a)).filter(Boolean);
|
|
352
|
+
if (!n.sortable || !u.value)
|
|
353
|
+
return e;
|
|
354
|
+
const s = u.value, l = f.value;
|
|
355
|
+
return [...e].sort((a, r) => {
|
|
356
|
+
const m = R(a, s), c = R(r, s);
|
|
357
|
+
if (m == null) return 1;
|
|
358
|
+
if (c == null) return -1;
|
|
359
|
+
let w = 0;
|
|
360
|
+
return typeof m == "string" && typeof c == "string" ? w = m.localeCompare(c) : m > c ? w = 1 : m < c && (w = -1), l === "desc" ? w * -1 : w;
|
|
361
|
+
});
|
|
362
|
+
}), be = y(() => Q.value.slice(0, n.maxVisibleChipsDisplay)), X = y(() => {
|
|
363
|
+
const e = Q.value.length - n.maxVisibleChipsDisplay;
|
|
347
364
|
return e > 0 ? e : 0;
|
|
348
|
-
}),
|
|
349
|
-
const a =
|
|
350
|
-
if (!
|
|
365
|
+
}), re = (e, s) => e.map((l) => {
|
|
366
|
+
const a = q(l).toLowerCase().includes(s);
|
|
367
|
+
if (!S(l))
|
|
351
368
|
return a ? l : null;
|
|
352
|
-
const r =
|
|
369
|
+
const r = re(l.children, s);
|
|
353
370
|
return a ? { ...l, children: l.children } : r.length > 0 ? { ...l, children: r } : null;
|
|
354
|
-
}).filter(Boolean),
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
if (
|
|
358
|
-
let
|
|
359
|
-
return typeof
|
|
360
|
-
}).map((r) =>
|
|
361
|
-
const e =
|
|
362
|
-
return !n.sortable || !u.value ? e :
|
|
363
|
-
}),
|
|
364
|
-
if (n.disableBranchNodes && e
|
|
365
|
-
const r = e
|
|
366
|
-
|
|
371
|
+
}).filter(Boolean), de = (e, s, l) => !e || !s ? e : [...e].sort((r, m) => {
|
|
372
|
+
const c = R(r, s), w = R(m, s);
|
|
373
|
+
if (c == null) return 1;
|
|
374
|
+
if (w == null) return -1;
|
|
375
|
+
let T = 0;
|
|
376
|
+
return typeof c == "string" && typeof w == "string" ? T = c.localeCompare(w) : c > w ? T = 1 : c < w && (T = -1), l === "desc" ? T * -1 : T;
|
|
377
|
+
}).map((r) => S(r) ? { ...r, children: de(r.children, s, l) } : r), Y = y(() => {
|
|
378
|
+
const e = L.value.trim() ? re(n.items, L.value.toLowerCase()) : n.items;
|
|
379
|
+
return !n.sortable || !u.value ? e : de(e, u.value, f.value);
|
|
380
|
+
}), xe = (e) => {
|
|
381
|
+
if (n.disableBranchNodes && S(e)) {
|
|
382
|
+
const r = g(e);
|
|
383
|
+
ce(r);
|
|
367
384
|
return;
|
|
368
385
|
}
|
|
369
|
-
if (
|
|
370
|
-
const s =
|
|
371
|
-
let l = new Set(
|
|
386
|
+
if (F(e)) return;
|
|
387
|
+
const s = g(e);
|
|
388
|
+
let l = new Set(B.value);
|
|
372
389
|
if (n.multiple) {
|
|
373
390
|
const r = l.has(s);
|
|
374
|
-
if (n.selectAll &&
|
|
375
|
-
const
|
|
376
|
-
r ? (l.delete(s),
|
|
391
|
+
if (n.selectAll && S(e)) {
|
|
392
|
+
const m = W(e);
|
|
393
|
+
r ? (l.delete(s), n.deselectAll && m.forEach((c) => l.delete(c))) : (l.add(s), m.forEach((c) => l.add(c)));
|
|
377
394
|
} else
|
|
378
|
-
r ? (l.delete(s), n.selectAll &&
|
|
395
|
+
r ? (l.delete(s), n.selectAll && G(s)?.forEach((c) => l.delete(c))) : l.add(s);
|
|
379
396
|
} else
|
|
380
|
-
l = /* @__PURE__ */ new Set([s]),
|
|
397
|
+
l = /* @__PURE__ */ new Set([s]), _();
|
|
381
398
|
let a = Array.from(l);
|
|
382
399
|
n.multiple && n.excludeFromSelectedListKey && (a = a.filter((r) => {
|
|
383
|
-
const
|
|
384
|
-
return !
|
|
385
|
-
})),
|
|
386
|
-
},
|
|
400
|
+
const m = U(r);
|
|
401
|
+
return !m || !m[n.excludeFromSelectedListKey];
|
|
402
|
+
})), p("update:modelValue", n.multiple ? a : a[0] || null), p("change", n.multiple ? a : a[0] || null);
|
|
403
|
+
}, ue = (e) => {
|
|
387
404
|
if (n.disabled || !e) return;
|
|
388
|
-
const s =
|
|
389
|
-
l.delete(s), n.selectAll &&
|
|
405
|
+
const s = g(e), l = new Set(B.value);
|
|
406
|
+
l.delete(s), n.selectAll && (n.deselectAll && S(e) && W(e).forEach((c) => l.delete(c)), G(s)?.forEach((m) => l.delete(m)));
|
|
390
407
|
const a = Array.from(l);
|
|
391
|
-
|
|
392
|
-
},
|
|
408
|
+
p("update:modelValue", a), p("change", a);
|
|
409
|
+
}, ce = (e) => {
|
|
393
410
|
M.value.has(e) ? M.value.delete(e) : M.value.add(e);
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
},
|
|
411
|
+
}, ke = () => {
|
|
412
|
+
f.value = f.value === "asc" ? "desc" : "asc";
|
|
413
|
+
}, Se = () => {
|
|
397
414
|
const e = n.multiple ? [] : null;
|
|
398
|
-
|
|
399
|
-
},
|
|
400
|
-
n.disabled || (Z(),
|
|
415
|
+
p("update:modelValue", e), p("change", e), Z();
|
|
416
|
+
}, we = async () => {
|
|
417
|
+
n.disabled || (Z(), C.value = !0, await le(), d.value && x.value && (P.value = he(x.value, d.value, {
|
|
401
418
|
placement: "bottom-start",
|
|
402
419
|
strategy: "fixed",
|
|
403
420
|
modifiers: [
|
|
@@ -417,172 +434,177 @@ const te = (t, z) => {
|
|
|
417
434
|
}
|
|
418
435
|
}
|
|
419
436
|
]
|
|
420
|
-
})), n.searchable && (await
|
|
421
|
-
},
|
|
422
|
-
|
|
423
|
-
},
|
|
424
|
-
|
|
437
|
+
})), n.searchable && (await le(), d.value?.querySelector(".tree-search-input")?.focus()));
|
|
438
|
+
}, _ = () => {
|
|
439
|
+
C.value = !1, L.value = "", P.value?.destroy(), P.value = null;
|
|
440
|
+
}, ee = () => C.value ? _() : we(), Ce = async () => {
|
|
441
|
+
k.value = !0, await le(), V.value && I.value && (D.value = he(I.value, V.value, {
|
|
425
442
|
placement: "bottom-end",
|
|
426
443
|
strategy: "fixed",
|
|
427
444
|
modifiers: [{ name: "offset", options: { offset: [0, 4] } }]
|
|
428
|
-
}))
|
|
445
|
+
}));
|
|
429
446
|
}, Z = () => {
|
|
430
|
-
k.value = !1,
|
|
431
|
-
},
|
|
432
|
-
|
|
447
|
+
k.value = !1, D.value?.destroy(), D.value = null;
|
|
448
|
+
}, Ve = () => k.value ? Z() : Ce(), fe = (e) => {
|
|
449
|
+
C.value && !x.value?.contains(e.target) && !d.value?.contains(e.target) && _(), k.value && !I.value?.contains(e.target) && !V.value?.contains(e.target) && Z();
|
|
433
450
|
};
|
|
434
|
-
return
|
|
435
|
-
document.removeEventListener("click",
|
|
436
|
-
}),
|
|
451
|
+
return Be(() => document.addEventListener("click", fe)), $e(() => {
|
|
452
|
+
document.removeEventListener("click", fe), P.value?.destroy(), D.value?.destroy();
|
|
453
|
+
}), Ae(L, (e) => {
|
|
437
454
|
if (e.trim()) {
|
|
438
455
|
const s = (l) => {
|
|
439
456
|
l.forEach((a) => {
|
|
440
|
-
|
|
457
|
+
S(a) && (M.value.add(g(a)), s(a.children));
|
|
441
458
|
});
|
|
442
459
|
};
|
|
443
|
-
s(
|
|
460
|
+
s(Y.value);
|
|
444
461
|
}
|
|
445
|
-
}), (e, s) => (i(), o("div",
|
|
446
|
-
|
|
462
|
+
}), (e, s) => (i(), o("div", Ge, [
|
|
463
|
+
h("div", {
|
|
447
464
|
ref_key: "triggerRef",
|
|
448
465
|
ref: x,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
466
|
+
role: "button",
|
|
467
|
+
tabindex: "0",
|
|
468
|
+
class: A(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main", [
|
|
469
|
+
ae.value,
|
|
452
470
|
{
|
|
453
471
|
"btn-outline-secondary": !t.isInvalid,
|
|
454
472
|
"border-danger": t.isInvalid,
|
|
455
473
|
disabled: t.disabled || t.isLoading,
|
|
456
474
|
"is-loading": t.isLoading,
|
|
457
|
-
"has-chips": t.multiple && t.displayMode === "chips" &&
|
|
475
|
+
"has-chips": t.multiple && t.displayMode === "chips" && B.value.length > 0
|
|
458
476
|
}
|
|
459
477
|
]]),
|
|
460
|
-
|
|
461
|
-
|
|
478
|
+
onClick: ee,
|
|
479
|
+
onKeydown: [
|
|
480
|
+
me(z(ee, ["prevent"]), ["enter"]),
|
|
481
|
+
me(z(ee, ["prevent"]), ["space"])
|
|
482
|
+
]
|
|
462
483
|
}, [
|
|
463
|
-
|
|
464
|
-
!t.multiple || t.displayMode === "text" ? (i(), o("span",
|
|
465
|
-
|
|
466
|
-
(i(!0), o(
|
|
467
|
-
key:
|
|
484
|
+
h("div", Qe, [
|
|
485
|
+
!t.multiple || t.displayMode === "text" ? (i(), o("span", Xe, E(t.isLoading ? "Loading data..." : ye.value), 1)) : t.multiple && t.displayMode === "chips" ? (i(), o("div", Ye, [
|
|
486
|
+
B.value.length === 0 ? (i(), o("span", _e, E(t.placeholder), 1)) : (i(), o("div", et, [
|
|
487
|
+
(i(!0), o(H, null, O(be.value, (l) => (i(), o("span", {
|
|
488
|
+
key: g(l),
|
|
468
489
|
class: "badge text-bg-primary chip bg-primary"
|
|
469
490
|
}, [
|
|
470
|
-
|
|
471
|
-
|
|
491
|
+
te(E(q(l)) + " ", 1),
|
|
492
|
+
j($, {
|
|
472
493
|
name: "times",
|
|
473
494
|
class: "chip-remove",
|
|
474
|
-
onClick:
|
|
495
|
+
onClick: z((a) => ue(l), ["stop"])
|
|
475
496
|
}, null, 8, ["onClick"])
|
|
476
497
|
]))), 128)),
|
|
477
|
-
|
|
498
|
+
X.value > 0 ? (i(), o("button", {
|
|
478
499
|
key: 0,
|
|
479
500
|
ref_key: "moreTriggerRef",
|
|
480
|
-
ref:
|
|
501
|
+
ref: I,
|
|
481
502
|
type: "button",
|
|
482
503
|
class: "btn btn-sm btn-light more-button",
|
|
483
|
-
onClick:
|
|
484
|
-
}, " +" +
|
|
504
|
+
onClick: z(Ve, ["stop"])
|
|
505
|
+
}, " +" + E(X.value), 513)) : v("", !0)
|
|
485
506
|
]))
|
|
486
|
-
])) :
|
|
507
|
+
])) : v("", !0)
|
|
487
508
|
]),
|
|
488
|
-
|
|
489
|
-
t.isLoading ? (i(),
|
|
509
|
+
h("div", tt, [
|
|
510
|
+
t.isLoading ? (i(), K($, {
|
|
490
511
|
key: 0,
|
|
491
512
|
name: "spinner",
|
|
492
513
|
class: "loading-icon"
|
|
493
|
-
})) :
|
|
494
|
-
t.showClearButton &&
|
|
514
|
+
})) : v("", !0),
|
|
515
|
+
t.showClearButton && B.value.length > 0 && !t.disabled && !t.isLoading ? (i(), K($, {
|
|
495
516
|
key: 1,
|
|
496
517
|
name: "times",
|
|
497
|
-
onClick:
|
|
518
|
+
onClick: z(Se, ["stop"]),
|
|
498
519
|
class: "clear-icon"
|
|
499
|
-
})) :
|
|
500
|
-
t.isLoading ?
|
|
520
|
+
})) : v("", !0),
|
|
521
|
+
t.isLoading ? v("", !0) : (i(), K($, {
|
|
501
522
|
key: 2,
|
|
502
523
|
name: "chevron-down",
|
|
503
|
-
class:
|
|
524
|
+
class: A(["transition-transform", { "rotate-180": C.value }])
|
|
504
525
|
}, null, 8, ["class"]))
|
|
505
526
|
])
|
|
506
|
-
],
|
|
527
|
+
], 42, Je),
|
|
507
528
|
k.value ? (i(), o("div", {
|
|
508
529
|
key: 0,
|
|
509
530
|
ref_key: "morePopoverRef",
|
|
510
|
-
ref:
|
|
531
|
+
ref: V,
|
|
511
532
|
class: "card shadow-lg border-0 more-popover",
|
|
512
533
|
style: { "z-index": "1060" }
|
|
513
534
|
}, [
|
|
514
|
-
|
|
515
|
-
(i(!0), o(
|
|
516
|
-
key:
|
|
535
|
+
h("div", lt, [
|
|
536
|
+
(i(!0), o(H, null, O(ge.value, (l) => (i(), o("div", {
|
|
537
|
+
key: g(l),
|
|
517
538
|
class: "list-group-item d-flex justify-content-between align-items-center py-1 px-2"
|
|
518
539
|
}, [
|
|
519
|
-
|
|
520
|
-
|
|
540
|
+
h("small", nt, E(q(l)), 1),
|
|
541
|
+
t.disabled ? v("", !0) : (i(), K($, {
|
|
542
|
+
key: 0,
|
|
521
543
|
name: "times",
|
|
522
544
|
class: "chip-remove flex-shrink-0",
|
|
523
|
-
onClick:
|
|
524
|
-
}, null, 8, ["onClick"])
|
|
545
|
+
onClick: z((a) => ue(l), ["stop"])
|
|
546
|
+
}, null, 8, ["onClick"]))
|
|
525
547
|
]))), 128))
|
|
526
548
|
])
|
|
527
|
-
], 512)) :
|
|
528
|
-
|
|
549
|
+
], 512)) : v("", !0),
|
|
550
|
+
C.value ? (i(), o("div", {
|
|
529
551
|
key: 1,
|
|
530
552
|
ref_key: "dropdownRef",
|
|
531
553
|
ref: d,
|
|
532
554
|
class: "tree-select-dropdown card shadow-lg border-0",
|
|
533
555
|
style: { "z-index": "1050" }
|
|
534
556
|
}, [
|
|
535
|
-
|
|
536
|
-
t.searchable ?
|
|
557
|
+
h("div", st, [
|
|
558
|
+
t.searchable ? ve((i(), o("input", {
|
|
537
559
|
key: 0,
|
|
538
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
560
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => L.value = l),
|
|
539
561
|
type: "text",
|
|
540
|
-
class:
|
|
562
|
+
class: A(["form-control tree-search-input", ie.value]),
|
|
541
563
|
placeholder: "Search..."
|
|
542
564
|
}, null, 2)), [
|
|
543
|
-
[Me,
|
|
544
|
-
]) :
|
|
545
|
-
t.sortable && t.sortOptions.length > 0 ? (i(), o("div",
|
|
546
|
-
|
|
565
|
+
[Me, L.value]
|
|
566
|
+
]) : v("", !0),
|
|
567
|
+
t.sortable && t.sortOptions.length > 0 ? (i(), o("div", at, [
|
|
568
|
+
ve(h("select", {
|
|
547
569
|
"onUpdate:modelValue": s[1] || (s[1] = (l) => u.value = l),
|
|
548
|
-
class:
|
|
570
|
+
class: A(["form-select flex-grow-1", ie.value])
|
|
549
571
|
}, [
|
|
550
|
-
s[2] || (s[2] =
|
|
572
|
+
s[2] || (s[2] = h("option", {
|
|
551
573
|
value: null,
|
|
552
574
|
disabled: ""
|
|
553
575
|
}, "Sort by...", -1)),
|
|
554
|
-
(i(!0), o(
|
|
576
|
+
(i(!0), o(H, null, O(t.sortOptions, (l) => (i(), o("option", {
|
|
555
577
|
key: l.value,
|
|
556
578
|
value: l.value
|
|
557
|
-
},
|
|
579
|
+
}, E(l.label), 9, it))), 128))
|
|
558
580
|
], 2), [
|
|
559
|
-
[
|
|
581
|
+
[ze, u.value]
|
|
560
582
|
]),
|
|
561
|
-
|
|
583
|
+
h("button", {
|
|
562
584
|
type: "button",
|
|
563
|
-
class:
|
|
585
|
+
class: A(["btn btn-outline-secondary", ae.value]),
|
|
564
586
|
disabled: !u.value,
|
|
565
|
-
onClick:
|
|
587
|
+
onClick: ke
|
|
566
588
|
}, [
|
|
567
|
-
|
|
568
|
-
name:
|
|
589
|
+
j($, {
|
|
590
|
+
name: f.value === "asc" ? "asc" : "desc"
|
|
569
591
|
}, null, 8, ["name"])
|
|
570
|
-
], 10,
|
|
571
|
-
])) :
|
|
592
|
+
], 10, ot)
|
|
593
|
+
])) : v("", !0)
|
|
572
594
|
]),
|
|
573
|
-
t.isLoading ? (i(), o("div",
|
|
574
|
-
|
|
595
|
+
t.isLoading ? (i(), o("div", rt, [
|
|
596
|
+
j($, {
|
|
575
597
|
name: "spinner",
|
|
576
598
|
class: "me-2"
|
|
577
599
|
}),
|
|
578
|
-
s[3] || (s[3] =
|
|
579
|
-
])) : (i(), o("div",
|
|
580
|
-
|
|
581
|
-
(i(!0), o(
|
|
582
|
-
key:
|
|
600
|
+
s[3] || (s[3] = h("span", null, "Loading...", -1))
|
|
601
|
+
])) : (i(), o("div", dt, [
|
|
602
|
+
Y.value.length > 0 ? (i(), o("div", ut, [
|
|
603
|
+
(i(!0), o(H, null, O(Y.value, (l) => (i(), K(We, {
|
|
604
|
+
key: g(l),
|
|
583
605
|
item: l,
|
|
584
606
|
level: 0,
|
|
585
|
-
"selected-items":
|
|
607
|
+
"selected-items": B.value,
|
|
586
608
|
"expanded-items": M.value,
|
|
587
609
|
multiple: t.multiple,
|
|
588
610
|
"select-all": t.selectAll,
|
|
@@ -591,42 +613,42 @@ const te = (t, z) => {
|
|
|
591
613
|
"option-value": t.optionValue,
|
|
592
614
|
"disabled-key": t.disabledKey,
|
|
593
615
|
"disable-branch-node": t.disableBranchNodes,
|
|
594
|
-
onSelect:
|
|
595
|
-
onToggleExpand:
|
|
616
|
+
onSelect: xe,
|
|
617
|
+
onToggleExpand: ce
|
|
596
618
|
}, {
|
|
597
|
-
default:
|
|
598
|
-
|
|
619
|
+
default: pe(({ item: a, level: r }) => [
|
|
620
|
+
ne(e.$slots, "default", {
|
|
599
621
|
item: a,
|
|
600
622
|
level: r
|
|
601
623
|
}, () => [
|
|
602
|
-
|
|
603
|
-
|
|
624
|
+
h("div", ct, [
|
|
625
|
+
te(E(q(a)) + " ", 1),
|
|
604
626
|
a.icon ? (i(), o("i", {
|
|
605
627
|
key: 0,
|
|
606
|
-
class:
|
|
607
|
-
}, null, 2)) :
|
|
628
|
+
class: A(a.icon)
|
|
629
|
+
}, null, 2)) : v("", !0)
|
|
608
630
|
])
|
|
609
631
|
], !0)
|
|
610
632
|
]),
|
|
611
633
|
_: 2
|
|
612
634
|
}, 1032, ["item", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node"]))), 128))
|
|
613
|
-
])) : (i(), o("div",
|
|
614
|
-
|
|
635
|
+
])) : (i(), o("div", ft, [
|
|
636
|
+
j($, {
|
|
615
637
|
name: "search",
|
|
616
638
|
class: "me-1"
|
|
617
639
|
}),
|
|
618
|
-
s[4] || (s[4] =
|
|
640
|
+
s[4] || (s[4] = te(" No items found ", -1))
|
|
619
641
|
]))
|
|
620
642
|
]))
|
|
621
|
-
], 512)) :
|
|
643
|
+
], 512)) : v("", !0)
|
|
622
644
|
]));
|
|
623
645
|
}
|
|
624
|
-
},
|
|
646
|
+
}, vt = /* @__PURE__ */ se(mt, [["__scopeId", "data-v-5f3fdb15"]]), gt = {
|
|
625
647
|
install(t) {
|
|
626
|
-
t.component("VSelect",
|
|
648
|
+
t.component("VSelect", vt);
|
|
627
649
|
}
|
|
628
650
|
};
|
|
629
651
|
export {
|
|
630
|
-
|
|
652
|
+
vt as VSelect,
|
|
631
653
|
gt as default
|
|
632
654
|
};
|
package/dist/vue-select.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.VueSelect={},b.Vue,b.Popper))})(this,(function(b,e,j){"use strict";const A=(l,w)=>{const o=l.__vccOpts||l;for(const[m,i]of w)o[m]=i;return o},ee={key:0},te={key:1},le={key:2},ne={key:3},oe={key:4},ae={key:5},re={key:6},B=A({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const w=l,o=e.computed(()=>({"svg-icon-spin":w.name==="spinner"}));return(m,i)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(o.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",ee,i[0]||(i[0]=[e.createElementVNode("path",{d:"M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="times"?(e.openBlock(),e.createElementBlock("g",te,i[1]||(i[1]=[e.createElementVNode("path",{d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-down"?(e.openBlock(),e.createElementBlock("g",le,i[2]||(i[2]=[e.createElementVNode("path",{d:"M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-right"?(e.openBlock(),e.createElementBlock("g",ne,i[3]||(i[3]=[e.createElementVNode("path",{d:"M10.83,12l-4.24,4.24a1,1,0,0,0,1.41,1.41L13.66,12,8,6.34A1,1,0,0,0,6.59,7.76Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="search"?(e.openBlock(),e.createElementBlock("g",oe,i[4]||(i[4]=[e.createElementVNode("path",{d:"M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="asc"?(e.openBlock(),e.createElementBlock("g",ae,i[5]||(i[5]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm12.9 8V3h-2v13h-3l4 5l4-5zm-8-3H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="desc"?(e.openBlock(),e.createElementBlock("g",re,i[6]||(i[6]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm15.9 0l-4-5l-4 5h3v13h2V8zm-11 5H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-d347d13a"]]),se={class:"tree-select-item-wrapper"},ie={key:1,class:"expander-placeholder"},ce=["checked",".indeterminate","disabled"],de={class:"item-content"},me={key:0,class:"children-wrapper"},ue=A({__name:"TreeSelectItem",props:{item:{type:Object,required:!0},level:{type:Number,required:!0},selectedItems:{type:Array,required:!0},expandedItems:{type:Set,required:!0},multiple:{type:Boolean,required:!0},selectAll:{type:Boolean,required:!0},selectMode:{type:String,required:!0},optionLabel:{type:String,required:!0},optionValue:{type:String,required:!0},disabledKey:{type:String,default:null},disableBranchNode:{type:Boolean,default:!1}},emits:["select","toggle-expand"],setup(l,{emit:w}){const o=l,m=c=>c[o.optionValue]||c.id||c.value,i=c=>!o.disabledKey||!c?!1:c.hasOwnProperty(o.disabledKey)&&c[o.disabledKey]!==null,h=e.computed(()=>o.item.children&&o.item.children.length>0),V=e.computed(()=>o.expandedItems.has(m(o.item))),y=e.computed(()=>o.selectedItems.includes(m(o.item))),C=c=>{let d=[];return c.children&&c.children.forEach(x=>{d.push(m(x)),d.push(...C(x))}),d},N=e.computed(()=>!o.multiple||!o.selectAll||!h.value||y.value?!1:C(o.item).some(d=>o.selectedItems.includes(d)));return(c,d)=>{const x=e.resolveComponent("TreeSelectItem",!0);return e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",{class:e.normalizeClass(["list-group-item list-group-item-action d-flex align-items-center gap-2",{"bg-primary text-white":y.value&&(l.selectMode==="highlight"||!l.multiple)&&!i(l.item)&&!(l.disableBranchNode&&h.value),"is-disabled text-muted bg-light":i(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:d[2]||(d[2]=k=>i(l.item)||l.disableBranchNode&&h.value?null:c.$emit("select",l.item))},[h.value?(e.openBlock(),e.createBlock(B,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon",{"rotate-90":V.value}]),onClick:d[0]||(d[0]=e.withModifiers(k=>c.$emit("toggle-expand",m(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",ie)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&h.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"form-check-input",checked:y.value,".indeterminate":N.value,disabled:i(l.item),onClick:d[1]||(d[1]=e.withModifiers(k=>c.$emit("select",l.item),["stop"]))},null,40,ce)):e.createCommentVNode("",!0),e.createElementVNode("div",de,[e.renderSlot(c.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),h.value&&V.value?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,k=>(e.openBlock(),e.createBlock(x,{key:m(k),item:k,level:l.level+1,"selected-items":l.selectedItems,"expanded-items":l.expandedItems,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNode,onSelect:d[3]||(d[3]=g=>c.$emit("select",g)),onToggleExpand:d[4]||(d[4]=g=>c.$emit("toggle-expand",g))},{default:e.withCtx(({item:g,level:L})=>[e.renderSlot(c.$slots,"default",{item:g,level:L},void 0,!0)]),_:2},1032,["item","level","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-9766821f"]]),fe={class:"tree-select-wrapper"},pe=["disabled"],he={class:"tree-select-display-container"},ge={key:0,class:"text-truncate"},ye={key:1},ke={key:0,class:"text-muted"},be={key:1,class:"chips-container"},Be={class:"d-flex align-items-center gap-2"},Ve={class:"list-group list-group-flush"},xe={class:"text-wrap text-start me-2"},Se={class:"p-2 border-bottom d-flex flex-column gap-2"},Ee={key:1,class:"d-flex align-items-center gap-2"},Ce=["value"],we=["disabled"],Ne={key:0,class:"p-4 text-muted text-center"},Le={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},Ie={key:0,class:"list-group list-group-flush"},Me={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},$e={key:1,class:"p-3 text-muted text-center"},F=A({__name:"TreeSelectMain",props:{modelValue:{type:[String,Number,Array],default:null},displayMode:{type:String,default:"text",validator:l=>["text","chips"].includes(l)},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},selectMode:{type:String,default:"checkbox",validator:l=>["checkbox","highlight"].includes(l)},placeholder:{type:String,default:"Select item..."},isInvalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},isLoading:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!1},optionLabel:{type:String,default:"value"},optionValue:{type:String,default:"code"},disabledKey:{type:String,default:null},excludeFromSelectedListKey:{type:String,default:null},disableBranchNodes:{type:Boolean,default:!1},size:{type:String,default:"sm",validator:l=>["sm","md","lg","xl"].includes(l)},sortable:{type:Boolean,default:!1},sortOptions:{type:Array,default:()=>[]},defaultSortKey:{type:String,default:null},defaultSortDirection:{type:String,default:"asc",validator:l=>["asc","desc"].includes(l)},maxVisibleChipsDisplay:{type:Number,default:3}},emits:["update:modelValue","change"],setup(l,{emit:w}){const o=l,m=w,i=e.ref(null),h=e.ref(null),V=e.ref(""),y=e.ref(!1),C=e.ref(new Set),N=e.ref(null),c=e.ref(o.defaultSortKey),d=e.ref(o.defaultSortDirection),x=e.ref(null),k=e.ref(null),g=e.ref(!1),L=e.ref(null),Z=e.computed(()=>o.size==="sm"?"btn-sm":o.size==="lg"?"btn-lg":o.size==="xl"?"btn-xl":""),U=e.computed(()=>o.size==="sm"?"form-control-sm":o.size==="lg"?"form-control-lg":o.size==="xl"?"form-control-xl":""),Ae=e.computed(()=>O.value===0?[]:q.value.slice(o.maxVisibleChipsDisplay)),I=t=>t&&(t[o.optionLabel]||t.label||t.name)||"",p=t=>t?t[o.optionValue]||t.id||t.value:null,D=t=>!o.disabledKey||!t?!1:t.hasOwnProperty(o.disabledKey)&&t[o.disabledKey]!==null,S=t=>t.children&&t.children.length>0,W=(t,a)=>{if(a)return a.split(".").reduce((n,r)=>n&&n[r],t)},T=(t,a=o.items)=>{for(const n of a){if(p(n)===t)return n;if(S(n)){const r=T(t,n.children);if(r)return r}}return null},G=t=>{const a=[];return S(t)&&t.children.forEach(n=>{D(n)||(a.push(p(n)),a.push(...G(n)))}),a},P=(t,a=o.items,n=[])=>{for(const r of a){if(p(r)===t)return n;if(S(r)){const s=P(t,r.children,[...n,p(r)]);if(s)return s}}return null},E=e.computed(()=>{const t=new Set(Array.isArray(o.modelValue)?o.modelValue:[o.modelValue].filter(Boolean));if(o.multiple&&o.selectAll){const a=n=>{n.forEach(r=>{if(S(r)){const s=r.children.filter(u=>!D(u));s.length>0&&s.every(u=>t.has(p(u)))&&t.add(p(r)),a(r.children)}})};a(o.items)}return Array.from(t)}),K=(t,a=o.items,n=[])=>{for(const r of a){const s=[...n,I(r)];if(p(r)===t)return s;if(S(r)){const f=K(t,r.children,s);if(f)return f}}return null},J=t=>{if(!t||t.length===0)return"";const a=t.join(" → ");return a.length<=40?a:t.length>2?`${t[0]} → ... → ${t[t.length-1]}`:a},De=e.computed(()=>{const t=E.value;if(t.length===0)return o.placeholder;if(o.multiple){if(t.length===1){const n=K(t[0]);return n?J(n):t[0]}return`${t.length} items selected`}const a=K(t[0]);return a?J(a):t[0]}),q=e.computed(()=>!o.multiple||E.value.length===0?[]:E.value.map(t=>T(t)).filter(Boolean)),Te=e.computed(()=>q.value.slice(0,o.maxVisibleChipsDisplay)),O=e.computed(()=>{const t=q.value.length-o.maxVisibleChipsDisplay;return t>0?t:0}),Q=(t,a)=>t.map(n=>{const r=I(n).toLowerCase().includes(a);if(!S(n))return r?n:null;const s=Q(n.children,a);return r?{...n,children:n.children}:s.length>0?{...n,children:s}:null}).filter(Boolean),X=(t,a,n)=>!t||!a?t:[...t].sort((s,f)=>{const u=W(s,a),M=W(f,a);if(u==null)return 1;if(M==null)return-1;let $=0;return typeof u=="string"&&typeof M=="string"?$=u.localeCompare(M):u>M?$=1:u<M&&($=-1),n==="desc"?$*-1:$}).map(s=>S(s)?{...s,children:X(s.children,a,n)}:s),H=e.computed(()=>{const t=V.value.trim()?Q(o.items,V.value.toLowerCase()):o.items;return!o.sortable||!c.value?t:X(t,c.value,d.value)}),Pe=t=>{if(o.disableBranchNodes&&t.children&&t.children.length>0){const s=t[o.optionValue]||t.id||t.value;v(s);return}if(D(t))return;const a=p(t);let n=new Set(E.value);if(o.multiple){const s=n.has(a);if(o.selectAll&&S(t)){const f=G(t);s?(n.delete(a),f.forEach(u=>n.delete(u))):(n.add(a),f.forEach(u=>n.add(u)))}else s?(n.delete(a),o.selectAll&&P(a)?.forEach(u=>n.delete(u))):n.add(a)}else n=new Set([a]),R();let r=Array.from(n);o.multiple&&o.excludeFromSelectedListKey&&(r=r.filter(s=>{const f=T(s);return!f||!f[o.excludeFromSelectedListKey]})),m("update:modelValue",o.multiple?r:r[0]||null),m("change",o.multiple?r:r[0]||null)},Y=t=>{if(o.disabled||!t)return;const a=p(t),n=new Set(E.value);n.delete(a),o.selectAll&&P(a)?.forEach(f=>n.delete(f));const r=Array.from(n);m("update:modelValue",r),m("change",r)},v=t=>{C.value.has(t)?C.value.delete(t):C.value.add(t)},Ke=()=>{d.value=d.value==="asc"?"desc":"asc"},qe=()=>{const t=o.multiple?[]:null;m("update:modelValue",t),m("change",t),z()},Oe=async()=>{o.disabled||(z(),y.value=!0,await e.nextTick(),i.value&&h.value&&(N.value=j.createPopper(h.value,i.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),o.searchable&&(await e.nextTick(),i.value?.querySelector(".tree-search-input")?.focus()))},R=()=>{y.value=!1,V.value="",N.value?.destroy(),N.value=null},He=()=>y.value?R():Oe(),Re=async()=>{o.disabled||(g.value=!0,await e.nextTick(),k.value&&x.value&&(L.value=j.createPopper(x.value,k.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]})))},z=()=>{g.value=!1,L.value?.destroy(),L.value=null},je=()=>g.value?z():Re(),_=t=>{y.value&&!h.value?.contains(t.target)&&!i.value?.contains(t.target)&&R(),g.value&&!x.value?.contains(t.target)&&!k.value?.contains(t.target)&&z()};return e.onMounted(()=>document.addEventListener("click",_)),e.onUnmounted(()=>{document.removeEventListener("click",_),N.value?.destroy(),L.value?.destroy()}),e.watch(V,t=>{if(t.trim()){const a=n=>{n.forEach(r=>{S(r)&&(C.value.add(p(r)),a(r.children))})};a(H.value)}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("button",{ref_key:"triggerRef",ref:h,type:"button",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[Z.value,{"btn-outline-secondary":!l.isInvalid,"border-danger":l.isInvalid,disabled:l.disabled||l.isLoading,"is-loading":l.isLoading,"has-chips":l.multiple&&l.displayMode==="chips"&&E.value.length>0}]]),disabled:l.disabled||l.isLoading,onClick:He},[e.createElementVNode("div",he,[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("span",ge,e.toDisplayString(l.isLoading?"Loading data...":De.value),1)):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",ye,[E.value.length===0?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,n=>(e.openBlock(),e.createElementBlock("span",{key:p(n),class:"badge text-bg-primary chip bg-primary"},[e.createTextVNode(e.toDisplayString(I(n))+" ",1),e.createVNode(B,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>Y(n),["stop"])},null,8,["onClick"])]))),128)),O.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:x,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(je,["stop"])}," +"+e.toDisplayString(O.value),513)):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Be,[l.isLoading?(e.openBlock(),e.createBlock(B,{key:0,name:"spinner",class:"loading-icon"})):e.createCommentVNode("",!0),l.showClearButton&&E.value.length>0&&!l.disabled&&!l.isLoading?(e.openBlock(),e.createBlock(B,{key:1,name:"times",onClick:e.withModifiers(qe,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0),l.isLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(B,{key:2,name:"chevron-down",class:e.normalizeClass(["transition-transform",{"rotate-180":y.value}])},null,8,["class"]))])],10,pe),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:k,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,n=>(e.openBlock(),e.createElementBlock("div",{key:p(n),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",xe,e.toDisplayString(I(n)),1),e.createVNode(B,{name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>Y(n),["stop"])},null,8,["onClick"])]))),128))])],512)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:i,class:"tree-select-dropdown card shadow-lg border-0",style:{"z-index":"1050"}},[e.createElementVNode("div",Se,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=n=>V.value=n),type:"text",class:e.normalizeClass(["form-control tree-search-input",U.value]),placeholder:"Search..."},null,2)),[[e.vModelText,V.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",Ee,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=n=>c.value=n),class:e.normalizeClass(["form-select flex-grow-1",U.value])},[a[2]||(a[2]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,n=>(e.openBlock(),e.createElementBlock("option",{key:n.value,value:n.value},e.toDisplayString(n.label),9,Ce))),128))],2),[[e.vModelSelect,c.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",Z.value]),disabled:!c.value,onClick:Ke},[e.createVNode(B,{name:d.value==="asc"?"asc":"desc"},null,8,["name"])],10,we)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(B,{name:"spinner",class:"me-2"}),a[3]||(a[3]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",Le,[H.value.length>0?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,n=>(e.openBlock(),e.createBlock(ue,{key:p(n),item:n,level:0,"selected-items":E.value,"expanded-items":C.value,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNodes,onSelect:Pe,onToggleExpand:v},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",Me,[e.createTextVNode(e.toDisplayString(I(r))+" ",1),r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(r.icon)},null,2)):e.createCommentVNode("",!0)])],!0)]),_:2},1032,["item","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(B,{name:"search",class:"me-1"}),a[4]||(a[4]=e.createTextVNode(" No items found ",-1))]))]))],512)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-35c2a85c"]]),ze={install(l){l.component("VSelect",F)}};b.VSelect=F,b.default=ze,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V.VueSelect={},V.Vue,V.Popper))})(this,(function(V,e,U){"use strict";const D=(l,N)=>{const o=l.__vccOpts||l;for(const[f,i]of N)o[f]=i;return o},te={key:0},le={key:1},ne={key:2},oe={key:3},ae={key:4},re={key:5},se={key:6},x=D({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const N=l,o=e.computed(()=>({"svg-icon-spin":N.name==="spinner"}));return(f,i)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(o.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",te,i[0]||(i[0]=[e.createElementVNode("path",{d:"M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="times"?(e.openBlock(),e.createElementBlock("g",le,i[1]||(i[1]=[e.createElementVNode("path",{d:"M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-down"?(e.openBlock(),e.createElementBlock("g",ne,i[2]||(i[2]=[e.createElementVNode("path",{d:"M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="chevron-right"?(e.openBlock(),e.createElementBlock("g",oe,i[3]||(i[3]=[e.createElementVNode("path",{d:"M10.83,12l-4.24,4.24a1,1,0,0,0,1.41,1.41L13.66,12,8,6.34A1,1,0,0,0,6.59,7.76Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="search"?(e.openBlock(),e.createElementBlock("g",ae,i[4]||(i[4]=[e.createElementVNode("path",{d:"M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="asc"?(e.openBlock(),e.createElementBlock("g",re,i[5]||(i[5]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm12.9 8V3h-2v13h-3l4 5l4-5zm-8-3H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0),l.name==="desc"?(e.openBlock(),e.createElementBlock("g",se,i[6]||(i[6]=[e.createElementVNode("path",{fill:"currentColor",d:"M4.869 11H2.667L6 3h2l3.333 8H9.131l-.41-1H5.28zm1.23-3h1.803L7 5.8zm15.9 0l-4-5l-4 5h3v13h2V8zm-11 5H3v2h4.855L3 19v2h8v-2H6.146L11 15z"},null,-1)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-d347d13a"]]),ie={class:"tree-select-item-wrapper"},ce={key:1,class:"expander-placeholder"},de=["checked",".indeterminate","disabled"],me={class:"item-content"},ue={key:0,class:"children-wrapper"},fe=D({__name:"TreeSelectItem",props:{item:{type:Object,required:!0},level:{type:Number,required:!0},selectedItems:{type:Array,required:!0},expandedItems:{type:Set,required:!0},multiple:{type:Boolean,required:!0},selectAll:{type:Boolean,required:!0},selectMode:{type:String,required:!0},optionLabel:{type:String,required:!0},optionValue:{type:String,required:!0},disabledKey:{type:String,default:null},disableBranchNode:{type:Boolean,default:!1}},emits:["select","toggle-expand"],setup(l,{emit:N}){const o=l,f=c=>c[o.optionValue]||c.id||c.value,i=c=>!o.disabledKey||!c?!1:c.hasOwnProperty(o.disabledKey)&&c[o.disabledKey]!==null,h=e.computed(()=>o.item.children&&o.item.children.length>0),E=e.computed(()=>o.expandedItems.has(f(o.item))),b=e.computed(()=>o.selectedItems.includes(f(o.item))),w=c=>{let m=[];return c.children&&c.children.forEach(S=>{m.push(f(S)),m.push(...w(S))}),m},L=e.computed(()=>!o.multiple||!o.selectAll||!h.value||b.value?!1:w(o.item).some(m=>o.selectedItems.includes(m)));return(c,m)=>{const S=e.resolveComponent("TreeSelectItem",!0);return e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",{class:e.normalizeClass(["list-group-item list-group-item-action d-flex align-items-center gap-2",{"bg-primary text-white":b.value&&(l.selectMode==="highlight"||!l.multiple)&&!i(l.item)&&!(l.disableBranchNode&&h.value),"is-disabled text-muted bg-light":i(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:m[2]||(m[2]=B=>i(l.item)||l.disableBranchNode&&h.value?null:c.$emit("select",l.item))},[h.value?(e.openBlock(),e.createBlock(x,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon",{"rotate-90":E.value}]),onClick:m[0]||(m[0]=e.withModifiers(B=>c.$emit("toggle-expand",f(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",ce)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&h.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"form-check-input",checked:b.value,".indeterminate":L.value,disabled:i(l.item),onClick:m[1]||(m[1]=e.withModifiers(B=>c.$emit("select",l.item),["stop"]))},null,40,de)):e.createCommentVNode("",!0),e.createElementVNode("div",me,[e.renderSlot(c.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),h.value&&E.value?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,B=>(e.openBlock(),e.createBlock(S,{key:f(B),item:B,level:l.level+1,"selected-items":l.selectedItems,"expanded-items":l.expandedItems,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNode,onSelect:m[3]||(m[3]=g=>c.$emit("select",g)),onToggleExpand:m[4]||(m[4]=g=>c.$emit("toggle-expand",g))},{default:e.withCtx(({item:g,level:M})=>[e.renderSlot(c.$slots,"default",{item:g,level:M},void 0,!0)]),_:2},1032,["item","level","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-9766821f"]]),pe={class:"tree-select-wrapper"},he=["onKeydown"],ge={class:"tree-select-display-container"},ye={key:0,class:"text-truncate"},ke={key:1},be={key:0,class:"text-muted"},Be={key:1,class:"chips-container"},Ve={class:"d-flex align-items-center gap-2"},xe={class:"list-group list-group-flush"},Ee={class:"text-wrap text-start me-2"},Se={class:"p-2 border-bottom d-flex flex-column gap-2"},Ce={key:1,class:"d-flex align-items-center gap-2"},we=["value"],Ne=["disabled"],Le={key:0,class:"p-4 text-muted text-center"},Me={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},Ie={key:0,class:"list-group list-group-flush"},$e={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},Ae={key:1,class:"p-3 text-muted text-center"},W=D({__name:"TreeSelectMain",props:{modelValue:{type:[String,Number,Array],default:null},displayMode:{type:String,default:"text",validator:l=>["text","chips"].includes(l)},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},selectMode:{type:String,default:"checkbox",validator:l=>["checkbox","highlight"].includes(l)},placeholder:{type:String,default:"Select item..."},isInvalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},isLoading:{type:Boolean,default:!1},showClearButton:{type:Boolean,default:!0},selectAll:{type:Boolean,default:!1},deselectAll:{type:Boolean,default:!0},optionLabel:{type:String,default:"value"},optionValue:{type:String,default:"code"},disabledKey:{type:String,default:null},excludeFromSelectedListKey:{type:String,default:null},disableBranchNodes:{type:Boolean,default:!1},size:{type:String,default:"sm",validator:l=>["sm","md","lg","xl"].includes(l)},sortable:{type:Boolean,default:!1},sortOptions:{type:Array,default:()=>[]},defaultSortKey:{type:String,default:null},defaultSortDirection:{type:String,default:"asc",validator:l=>["asc","desc"].includes(l)},maxVisibleChipsDisplay:{type:Number,default:3}},emits:["update:modelValue","change"],setup(l,{emit:N}){const o=l,f=N,i=e.ref(null),h=e.ref(null),E=e.ref(""),b=e.ref(!1),w=e.ref(new Set),L=e.ref(null),c=e.ref(o.defaultSortKey),m=e.ref(o.defaultSortDirection),S=e.ref(null),B=e.ref(null),g=e.ref(!1),M=e.ref(null),G=e.computed(()=>o.size==="sm"?"btn-sm":o.size==="lg"?"btn-lg":o.size==="xl"?"btn-xl":""),J=e.computed(()=>o.size==="sm"?"form-control-sm":o.size==="lg"?"form-control-lg":o.size==="xl"?"form-control-xl":""),De=e.computed(()=>j.value===0?[]:H.value.slice(o.maxVisibleChipsDisplay)),I=t=>t&&(t[o.optionLabel]||t.label||t.name)||"",p=t=>t?t[o.optionValue]||t.id||t.value:null,K=t=>!o.disabledKey||!t?!1:t.hasOwnProperty(o.disabledKey)&&t[o.disabledKey]!==null,y=t=>t.children&&t.children.length>0,A=(t,a)=>{if(a)return a.split(".").reduce((n,r)=>n&&n[r],t)},P=(t,a=o.items)=>{for(const n of a){if(p(n)===t)return n;if(y(n)){const r=P(t,n.children);if(r)return r}}return null},T=t=>{const a=[];return y(t)&&t.children.forEach(n=>{K(n)||(a.push(p(n)),a.push(...T(n)))}),a},q=(t,a=o.items,n=[])=>{for(const r of a){if(p(r)===t)return n;if(y(r)){const s=q(t,r.children,[...n,p(r)]);if(s)return s}}return null},C=e.computed(()=>{const t=new Set(Array.isArray(o.modelValue)?o.modelValue:[o.modelValue].filter(Boolean));if(o.multiple&&o.selectAll){const a=n=>{n.forEach(r=>{if(y(r)){const s=r.children.filter(d=>!K(d));s.length>0&&s.every(d=>t.has(p(d)))&&t.add(p(r)),a(r.children)}})};a(o.items)}return Array.from(t)}),O=(t,a=o.items,n=[])=>{for(const r of a){const s=[...n,I(r)];if(p(r)===t)return s;if(y(r)){const u=O(t,r.children,s);if(u)return u}}return null},Q=t=>{if(!t||t.length===0)return"";const a=t.join(" → ");return a.length<=40?a:t.length>2?`${t[0]} → ... → ${t[t.length-1]}`:a},Ke=e.computed(()=>{const t=C.value;if(t.length===0)return o.placeholder;if(o.multiple){if(t.length===1){const n=O(t[0]);return n?Q(n):t[0]}return`${t.length} items selected`}const a=O(t[0]);return a?Q(a):t[0]}),H=e.computed(()=>{if(!o.multiple||C.value.length===0)return[];const t=C.value.map(r=>P(r)).filter(Boolean);if(!o.sortable||!c.value)return t;const a=c.value,n=m.value;return[...t].sort((r,s)=>{const u=A(r,a),d=A(s,a);if(u==null)return 1;if(d==null)return-1;let k=0;return typeof u=="string"&&typeof d=="string"?k=u.localeCompare(d):u>d?k=1:u<d&&(k=-1),n==="desc"?k*-1:k})}),Pe=e.computed(()=>H.value.slice(0,o.maxVisibleChipsDisplay)),j=e.computed(()=>{const t=H.value.length-o.maxVisibleChipsDisplay;return t>0?t:0}),X=(t,a)=>t.map(n=>{const r=I(n).toLowerCase().includes(a);if(!y(n))return r?n:null;const s=X(n.children,a);return r?{...n,children:n.children}:s.length>0?{...n,children:s}:null}).filter(Boolean),Y=(t,a,n)=>!t||!a?t:[...t].sort((s,u)=>{const d=A(s,a),k=A(u,a);if(d==null)return 1;if(k==null)return-1;let $=0;return typeof d=="string"&&typeof k=="string"?$=d.localeCompare(k):d>k?$=1:d<k&&($=-1),n==="desc"?$*-1:$}).map(s=>y(s)?{...s,children:Y(s.children,a,n)}:s),F=e.computed(()=>{const t=E.value.trim()?X(o.items,E.value.toLowerCase()):o.items;return!o.sortable||!c.value?t:Y(t,c.value,m.value)}),Te=t=>{if(o.disableBranchNodes&&y(t)){const s=p(t);_(s);return}if(K(t))return;const a=p(t);let n=new Set(C.value);if(o.multiple){const s=n.has(a);if(o.selectAll&&y(t)){const u=T(t);s?(n.delete(a),o.deselectAll&&u.forEach(d=>n.delete(d))):(n.add(a),u.forEach(d=>n.add(d)))}else s?(n.delete(a),o.selectAll&&q(a)?.forEach(d=>n.delete(d))):n.add(a)}else n=new Set([a]),R();let r=Array.from(n);o.multiple&&o.excludeFromSelectedListKey&&(r=r.filter(s=>{const u=P(s);return!u||!u[o.excludeFromSelectedListKey]})),f("update:modelValue",o.multiple?r:r[0]||null),f("change",o.multiple?r:r[0]||null)},v=t=>{if(o.disabled||!t)return;const a=p(t),n=new Set(C.value);n.delete(a),o.selectAll&&(o.deselectAll&&y(t)&&T(t).forEach(d=>n.delete(d)),q(a)?.forEach(u=>n.delete(u)));const r=Array.from(n);f("update:modelValue",r),f("change",r)},_=t=>{w.value.has(t)?w.value.delete(t):w.value.add(t)},qe=()=>{m.value=m.value==="asc"?"desc":"asc"},Oe=()=>{const t=o.multiple?[]:null;f("update:modelValue",t),f("change",t),z()},He=async()=>{o.disabled||(z(),b.value=!0,await e.nextTick(),i.value&&h.value&&(L.value=U.createPopper(h.value,i.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),o.searchable&&(await e.nextTick(),i.value?.querySelector(".tree-search-input")?.focus()))},R=()=>{b.value=!1,E.value="",L.value?.destroy(),L.value=null},Z=()=>b.value?R():He(),je=async()=>{g.value=!0,await e.nextTick(),B.value&&S.value&&(M.value=U.createPopper(S.value,B.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]}))},z=()=>{g.value=!1,M.value?.destroy(),M.value=null},Fe=()=>g.value?z():je(),ee=t=>{b.value&&!h.value?.contains(t.target)&&!i.value?.contains(t.target)&&R(),g.value&&!S.value?.contains(t.target)&&!B.value?.contains(t.target)&&z()};return e.onMounted(()=>document.addEventListener("click",ee)),e.onUnmounted(()=>{document.removeEventListener("click",ee),L.value?.destroy(),M.value?.destroy()}),e.watch(E,t=>{if(t.trim()){const a=n=>{n.forEach(r=>{y(r)&&(w.value.add(p(r)),a(r.children))})};a(F.value)}}),(t,a)=>(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{ref_key:"triggerRef",ref:h,role:"button",tabindex:"0",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[G.value,{"btn-outline-secondary":!l.isInvalid,"border-danger":l.isInvalid,disabled:l.disabled||l.isLoading,"is-loading":l.isLoading,"has-chips":l.multiple&&l.displayMode==="chips"&&C.value.length>0}]]),onClick:Z,onKeydown:[e.withKeys(e.withModifiers(Z,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Z,["prevent"]),["space"])]},[e.createElementVNode("div",ge,[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("span",ye,e.toDisplayString(l.isLoading?"Loading data...":Ke.value),1)):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",ke,[C.value.length===0?(e.openBlock(),e.createElementBlock("span",be,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,n=>(e.openBlock(),e.createElementBlock("span",{key:p(n),class:"badge text-bg-primary chip bg-primary"},[e.createTextVNode(e.toDisplayString(I(n))+" ",1),e.createVNode(x,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>v(n),["stop"])},null,8,["onClick"])]))),128)),j.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:S,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(Fe,["stop"])}," +"+e.toDisplayString(j.value),513)):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ve,[l.isLoading?(e.openBlock(),e.createBlock(x,{key:0,name:"spinner",class:"loading-icon"})):e.createCommentVNode("",!0),l.showClearButton&&C.value.length>0&&!l.disabled&&!l.isLoading?(e.openBlock(),e.createBlock(x,{key:1,name:"times",onClick:e.withModifiers(Oe,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0),l.isLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(x,{key:2,name:"chevron-down",class:e.normalizeClass(["transition-transform",{"rotate-180":b.value}])},null,8,["class"]))])],42,he),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:B,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,n=>(e.openBlock(),e.createElementBlock("div",{key:p(n),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",Ee,e.toDisplayString(I(n)),1),l.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(x,{key:0,name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>v(n),["stop"])},null,8,["onClick"]))]))),128))])],512)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:i,class:"tree-select-dropdown card shadow-lg border-0",style:{"z-index":"1050"}},[e.createElementVNode("div",Se,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=n=>E.value=n),type:"text",class:e.normalizeClass(["form-control tree-search-input",J.value]),placeholder:"Search..."},null,2)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",Ce,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=n=>c.value=n),class:e.normalizeClass(["form-select flex-grow-1",J.value])},[a[2]||(a[2]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,n=>(e.openBlock(),e.createElementBlock("option",{key:n.value,value:n.value},e.toDisplayString(n.label),9,we))),128))],2),[[e.vModelSelect,c.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",G.value]),disabled:!c.value,onClick:qe},[e.createVNode(x,{name:m.value==="asc"?"asc":"desc"},null,8,["name"])],10,Ne)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(x,{name:"spinner",class:"me-2"}),a[3]||(a[3]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",Me,[F.value.length>0?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,n=>(e.openBlock(),e.createBlock(fe,{key:p(n),item:n,level:0,"selected-items":C.value,"expanded-items":w.value,multiple:l.multiple,"select-all":l.selectAll,"select-mode":l.selectMode,"option-label":l.optionLabel,"option-value":l.optionValue,"disabled-key":l.disabledKey,"disable-branch-node":l.disableBranchNodes,onSelect:Te,onToggleExpand:_},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",$e,[e.createTextVNode(e.toDisplayString(I(r))+" ",1),r.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(r.icon)},null,2)):e.createCommentVNode("",!0)])],!0)]),_:2},1032,["item","selected-items","expanded-items","multiple","select-all","select-mode","option-label","option-value","disabled-key","disable-branch-node"]))),128))])):(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(x,{name:"search",class:"me-1"}),a[4]||(a[4]=e.createTextVNode(" No items found ",-1))]))]))],512)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-5f3fdb15"]]),ze={install(l){l.component("VSelect",W)}};V.VSelect=W,V.default=ze,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|