@night-owl-elite/vue-select 1.3.37 → 1.3.40
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 +398 -344
- package/dist/vue-select.umd.js +1 -1
- package/package.json +1 -1
package/dist/vue-select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes spin-89f9b7e1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-89f9b7e1]{animation:spin-89f9b7e1 1s linear infinite}.list-group-item[data-v-
|
|
1
|
+
@keyframes spin-89f9b7e1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.svg-icon-spin[data-v-89f9b7e1]{animation:spin-89f9b7e1 1s linear infinite}.list-group-item[data-v-a360276c]{cursor:pointer;border:0;border-radius:0;padding-top:.5rem;padding-bottom:.5rem}.list-group-item.is-disabled[data-v-a360276c]{cursor:not-allowed;opacity:.65}.expander-icon[data-v-a360276c]{width:1rem;height:1rem;flex-shrink:0;transition:transform .2s ease-in-out;color:#6c757d}.expander-placeholder[data-v-a360276c]{display:inline-block;width:1rem;flex-shrink:0}.rotate-90[data-v-a360276c]{transform:rotate(90deg)}.item-content[data-v-a360276c]{flex-grow:1}.tree-checkbox[data-v-a360276c]{width:16px;height:16px;min-width:16px;min-height:16px;flex-shrink:0;margin-top:2px}.tree-select-main[data-v-41032f5c]{--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-41032f5c]{flex:1;overflow:hidden}.transition-transform[data-v-41032f5c]{transition:transform .2s ease-in-out}.rotate-180[data-v-41032f5c]{transform:rotate(180deg)}.tree-select-dropdown[data-v-41032f5c]{position:absolute;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:.375rem}.is-loading[data-v-41032f5c]{cursor:wait}.loading-icon[data-v-41032f5c]{animation:spin-41032f5c 1s linear infinite}.clear-icon[data-v-41032f5c]{cursor:pointer;opacity:.6;transition:opacity .2s ease}.clear-icon[data-v-41032f5c]:hover{opacity:1}.tooltip-trigger-icon[data-v-41032f5c]{cursor:pointer;opacity:.6;transition:opacity .2s ease;width:1em;height:1em}.tooltip-trigger-icon[data-v-41032f5c]:hover{opacity:1}@keyframes spin-41032f5c{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.btn-xl[data-v-41032f5c]{padding:.75rem 1.5rem;font-size:1.25rem;border-radius:var(--bs-border-radius-lg)}.form-control-xl[data-v-41032f5c]{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-41032f5c]::-webkit-scrollbar{width:6px}.tree-select-body[data-v-41032f5c]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.tree-select-body[data-v-41032f5c]::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.tree-select-body[data-v-41032f5c]::-webkit-scrollbar-thumb:hover{background:#a8a8a8}.tree-select-main.disabled .more-button[data-v-41032f5c]{pointer-events:auto;cursor:pointer}.tree-select-main.has-chips[data-v-41032f5c]{height:auto;min-height:calc(1.5em + .5rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-lg[data-v-41032f5c]{min-height:calc(1.5em + 1rem + calc(var(--bs-border-width) * 2))}.tree-select-main.has-chips.btn-xl[data-v-41032f5c]{min-height:calc(1.5em + 1.5rem + calc(var(--bs-border-width) * 2))}.chips-container[data-v-41032f5c]{position:relative;display:flex;flex-wrap:nowrap;gap:.25rem;overflow:hidden;align-items:center}.chip[data-v-41032f5c]{flex:0 0 auto;display:flex;align-items:center;max-width:100px;padding:.2em .6em;overflow:hidden}.chip-label[data-v-41032f5c]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.chip-measure-layer[data-v-41032f5c]{position:absolute;left:0;top:0;display:flex;gap:.25rem;flex-wrap:nowrap;visibility:hidden;pointer-events:none}.chip-remove[data-v-41032f5c]{width:.8em;height:.8em;margin-left:.4em;cursor:pointer;opacity:.7;transition:opacity .2s}.chip-remove[data-v-41032f5c]:hover{opacity:1}.more-button[data-v-41032f5c]{font-size:.75em;line-height:1;padding:.3em .5em}.more-popover[data-v-41032f5c]{width:250px;max-width:80vw;max-height:200px;overflow-y:auto;font-size:.9rem}.tree-select-tooltip[data-v-41032f5c]{background-color:var(--bs-body-bg);border:var(--bs-border-width) solid var(--bs-border-color);font-size:.875rem;max-width:400px;word-wrap:break-word;pointer-events:none}@media (max-width: 576px){.tree-select-dropdown[data-v-41032f5c]{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 r, openBlock as o, normalizeClass as I, createCommentVNode as m, createElementVNode as f, resolveComponent as Ye, normalizeStyle as _e, createBlock as D, withModifiers as C, renderSlot as ue, Fragment as W, renderList as j, withCtx as Pe, ref as g, watch as ye, onMounted as et, nextTick as P, onUnmounted as tt, withDirectives as be, withKeys as ke, toDisplayString as x, createVNode as ee, vModelText as lt, vModelSelect as nt, createTextVNode as re, vShow as st } from "vue";
|
|
2
|
+
import { createPopper as we } from "@popperjs/core";
|
|
3
|
+
const xe = (t, q) => {
|
|
4
4
|
const l = t.__vccOpts || t;
|
|
5
|
-
for (const [
|
|
6
|
-
l[
|
|
5
|
+
for (const [h, c] of q)
|
|
6
|
+
l[h] = c;
|
|
7
7
|
return l;
|
|
8
|
-
},
|
|
8
|
+
}, at = { key: 0 }, ot = { key: 1 }, it = { key: 2 }, rt = { key: 3 }, ut = { key: 4 }, dt = { key: 5 }, ct = { key: 6 }, ft = { key: 7 }, mt = {
|
|
9
9
|
__name: "SvgIcon",
|
|
10
10
|
props: {
|
|
11
11
|
name: {
|
|
@@ -14,56 +14,56 @@ const ge = (t, P) => {
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
setup(t) {
|
|
17
|
-
const
|
|
18
|
-
"svg-icon-spin":
|
|
17
|
+
const q = t, l = y(() => ({
|
|
18
|
+
"svg-icon-spin": q.name === "spinner"
|
|
19
19
|
}));
|
|
20
|
-
return (
|
|
20
|
+
return (h, c) => (o(), 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: I(l.value)
|
|
27
27
|
}, [
|
|
28
|
-
t.name === "spinner" ? (o(),
|
|
29
|
-
|
|
30
|
-
]))) :
|
|
31
|
-
t.name === "times" ? (o(),
|
|
32
|
-
|
|
33
|
-
]))) :
|
|
34
|
-
t.name === "chevron-down" ? (o(),
|
|
35
|
-
|
|
36
|
-
]))) :
|
|
37
|
-
t.name === "chevron-right" ? (o(),
|
|
38
|
-
|
|
39
|
-
]))) :
|
|
40
|
-
t.name === "search" ? (o(),
|
|
41
|
-
|
|
42
|
-
]))) :
|
|
43
|
-
t.name === "asc" ? (o(),
|
|
44
|
-
|
|
28
|
+
t.name === "spinner" ? (o(), r("g", at, c[0] || (c[0] = [
|
|
29
|
+
f("path", { d: "M12,4V2A10,10,0,0,0,2,12H4A8,8,0,0,1,12,4Z" }, null, -1)
|
|
30
|
+
]))) : m("", !0),
|
|
31
|
+
t.name === "times" ? (o(), r("g", ot, c[1] || (c[1] = [
|
|
32
|
+
f("path", { d: "M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z" }, null, -1)
|
|
33
|
+
]))) : m("", !0),
|
|
34
|
+
t.name === "chevron-down" ? (o(), r("g", it, c[2] || (c[2] = [
|
|
35
|
+
f("path", { d: "M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z" }, null, -1)
|
|
36
|
+
]))) : m("", !0),
|
|
37
|
+
t.name === "chevron-right" ? (o(), r("g", rt, c[3] || (c[3] = [
|
|
38
|
+
f("path", { d: "M10.83,12l-4.24,4.24a1,1,0,0,0,1.41,1.41L13.66,12,8,6.34A1,1,0,0,0,6.59,7.76Z" }, null, -1)
|
|
39
|
+
]))) : m("", !0),
|
|
40
|
+
t.name === "search" ? (o(), r("g", ut, c[4] || (c[4] = [
|
|
41
|
+
f("path", { d: "M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z" }, null, -1)
|
|
42
|
+
]))) : m("", !0),
|
|
43
|
+
t.name === "asc" ? (o(), r("g", dt, c[5] || (c[5] = [
|
|
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" ? (o(),
|
|
50
|
-
|
|
48
|
+
]))) : m("", !0),
|
|
49
|
+
t.name === "desc" ? (o(), r("g", ct, c[6] || (c[6] = [
|
|
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" ? (o(),
|
|
56
|
-
|
|
57
|
-
]))) :
|
|
54
|
+
]))) : m("", !0),
|
|
55
|
+
t.name === "info-circle" ? (o(), r("g", ft, c[7] || (c[7] = [
|
|
56
|
+
f("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }, null, -1)
|
|
57
|
+
]))) : m("", !0)
|
|
58
58
|
], 2));
|
|
59
59
|
}
|
|
60
|
-
}, A = /* @__PURE__ */
|
|
60
|
+
}, A = /* @__PURE__ */ xe(mt, [["__scopeId", "data-v-89f9b7e1"]]), vt = { class: "tree-select-item-wrapper" }, ht = {
|
|
61
61
|
key: 1,
|
|
62
|
-
class: "expander-placeholder"
|
|
63
|
-
},
|
|
62
|
+
class: "expander-placeholder flex-shrink-0"
|
|
63
|
+
}, pt = ["checked", ".indeterminate", "disabled"], gt = { class: "item-content text-start text-break lh-sm" }, yt = {
|
|
64
64
|
key: 0,
|
|
65
65
|
class: "children-wrapper"
|
|
66
|
-
},
|
|
66
|
+
}, bt = {
|
|
67
67
|
__name: "TreeSelectItem",
|
|
68
68
|
props: {
|
|
69
69
|
item: { type: Object, required: !0 },
|
|
@@ -79,50 +79,50 @@ const ge = (t, P) => {
|
|
|
79
79
|
disableBranchNode: { type: Boolean, default: !1 }
|
|
80
80
|
},
|
|
81
81
|
emits: ["select", "toggle-expand"],
|
|
82
|
-
setup(t, { emit:
|
|
83
|
-
const l = t,
|
|
82
|
+
setup(t, { emit: q }) {
|
|
83
|
+
const l = t, h = (v) => v[l.optionValue] || v.id || v.value, c = (v) => !l.disabledKey || !v ? !1 : v.hasOwnProperty(l.disabledKey) && v[l.disabledKey] !== null, V = y(() => l.item.children && l.item.children.length > 0), z = y(() => l.expandedItems.has(h(l.item))), w = y(() => l.selectedItems.includes(h(l.item))), B = (v) => {
|
|
84
84
|
let p = [];
|
|
85
|
-
return
|
|
86
|
-
p.push(
|
|
85
|
+
return v.children && v.children.forEach((N) => {
|
|
86
|
+
p.push(h(N)), p.push(...B(N));
|
|
87
87
|
}), p;
|
|
88
|
-
},
|
|
89
|
-
return (
|
|
90
|
-
const
|
|
91
|
-
return o(),
|
|
92
|
-
|
|
93
|
-
class:
|
|
94
|
-
"bg-primary text-white":
|
|
95
|
-
"is-disabled text-muted bg-light":
|
|
88
|
+
}, R = y(() => !l.multiple || !l.selectAll || !V.value || w.value ? !1 : B(l.item).some((p) => l.selectedItems.includes(p)));
|
|
89
|
+
return (v, p) => {
|
|
90
|
+
const N = Ye("TreeSelectItem", !0);
|
|
91
|
+
return o(), r("div", vt, [
|
|
92
|
+
f("div", {
|
|
93
|
+
class: I(["list-group-item list-group-item-action d-flex align-items-start gap-2", {
|
|
94
|
+
"bg-primary text-white": w.value && (t.selectMode === "highlight" || !t.multiple) && !c(t.item) && !(t.disableBranchNode && V.value),
|
|
95
|
+
"is-disabled text-muted bg-light": c(t.item)
|
|
96
96
|
}]),
|
|
97
|
-
style:
|
|
98
|
-
onClick: p[2] || (p[2] = (
|
|
97
|
+
style: _e({ "padding-left": `${t.level * 1.5 + 1}rem` }),
|
|
98
|
+
onClick: p[2] || (p[2] = (S) => c(t.item) ? null : v.$emit("select", t.item))
|
|
99
99
|
}, [
|
|
100
|
-
V.value ? (o(),
|
|
100
|
+
V.value ? (o(), D(A, {
|
|
101
101
|
key: 0,
|
|
102
102
|
name: "chevron-right",
|
|
103
|
-
class:
|
|
104
|
-
onClick: p[0] || (p[0] = C((
|
|
105
|
-
}, null, 8, ["class"])) : (o(),
|
|
106
|
-
t.multiple && t.selectMode === "checkbox" && !(t.disableBranchNode && V.value) ? (o(),
|
|
103
|
+
class: I(["expander-icon flex-shrink-0 mt-1", { "rotate-90": z.value }]),
|
|
104
|
+
onClick: p[0] || (p[0] = C((S) => v.$emit("toggle-expand", h(t.item)), ["stop"]))
|
|
105
|
+
}, null, 8, ["class"])) : (o(), r("span", ht)),
|
|
106
|
+
t.multiple && t.selectMode === "checkbox" && !(t.disableBranchNode && V.value) ? (o(), r("input", {
|
|
107
107
|
key: 2,
|
|
108
108
|
type: "checkbox",
|
|
109
|
-
class: "
|
|
110
|
-
checked:
|
|
111
|
-
".indeterminate":
|
|
112
|
-
disabled:
|
|
113
|
-
onClick: p[1] || (p[1] = C((
|
|
114
|
-
}, null, 40,
|
|
115
|
-
|
|
116
|
-
|
|
109
|
+
class: "tree-checkbox",
|
|
110
|
+
checked: w.value,
|
|
111
|
+
".indeterminate": R.value,
|
|
112
|
+
disabled: c(t.item),
|
|
113
|
+
onClick: p[1] || (p[1] = C((S) => v.$emit("select", t.item), ["stop"]))
|
|
114
|
+
}, null, 40, pt)) : m("", !0),
|
|
115
|
+
f("div", gt, [
|
|
116
|
+
ue(v.$slots, "default", {
|
|
117
117
|
item: t.item,
|
|
118
118
|
level: t.level
|
|
119
119
|
}, void 0, !0)
|
|
120
120
|
])
|
|
121
121
|
], 6),
|
|
122
|
-
V.value &&
|
|
123
|
-
(o(!0),
|
|
124
|
-
key:
|
|
125
|
-
item:
|
|
122
|
+
V.value && z.value ? (o(), r("div", yt, [
|
|
123
|
+
(o(!0), r(W, null, j(t.item.children, (S) => (o(), D(N, {
|
|
124
|
+
key: h(S),
|
|
125
|
+
item: S,
|
|
126
126
|
level: t.level + 1,
|
|
127
127
|
"selected-items": t.selectedItems,
|
|
128
128
|
"expanded-items": t.expandedItems,
|
|
@@ -133,50 +133,50 @@ const ge = (t, P) => {
|
|
|
133
133
|
"option-value": t.optionValue,
|
|
134
134
|
"disabled-key": t.disabledKey,
|
|
135
135
|
"disable-branch-node": t.disableBranchNode,
|
|
136
|
-
onSelect: p[3] || (p[3] = (
|
|
137
|
-
onToggleExpand: p[4] || (p[4] = (
|
|
136
|
+
onSelect: p[3] || (p[3] = ($) => v.$emit("select", $)),
|
|
137
|
+
onToggleExpand: p[4] || (p[4] = ($) => v.$emit("toggle-expand", $))
|
|
138
138
|
}, {
|
|
139
|
-
default:
|
|
140
|
-
|
|
141
|
-
item:
|
|
142
|
-
level:
|
|
139
|
+
default: Pe(({ item: $, level: te }) => [
|
|
140
|
+
ue(v.$slots, "default", {
|
|
141
|
+
item: $,
|
|
142
|
+
level: te
|
|
143
143
|
}, void 0, !0)
|
|
144
144
|
]),
|
|
145
145
|
_: 2
|
|
146
146
|
}, 1032, ["item", "level", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node"]))), 128))
|
|
147
|
-
])) :
|
|
147
|
+
])) : m("", !0)
|
|
148
148
|
]);
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, kt = /* @__PURE__ */ xe(bt, [["__scopeId", "data-v-a360276c"]]), wt = ["onKeydown"], xt = { class: "tree-select-display-container" }, St = {
|
|
152
152
|
key: 0,
|
|
153
153
|
class: "d-flex align-items-center justify-content-start w-100"
|
|
154
|
-
},
|
|
154
|
+
}, Ct = ["title"], Vt = { key: 1 }, Lt = {
|
|
155
155
|
key: 0,
|
|
156
156
|
class: "text-muted"
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
},
|
|
157
|
+
}, At = {
|
|
158
|
+
class: "chip-measure-layer",
|
|
159
|
+
"aria-hidden": "true"
|
|
160
|
+
}, It = { class: "chip-label" }, $t = { class: "chip-label" }, Mt = { class: "d-flex align-items-center gap-2" }, Bt = { class: "list-group list-group-flush" }, Nt = { class: "text-wrap text-start me-2" }, Tt = { class: "p-2 border-bottom d-flex flex-column gap-2" }, zt = ["onKeydown"], Et = {
|
|
161
161
|
key: 1,
|
|
162
162
|
class: "d-flex align-items-center gap-2"
|
|
163
|
-
},
|
|
163
|
+
}, Kt = ["value"], Pt = ["disabled"], Dt = {
|
|
164
164
|
key: 0,
|
|
165
165
|
class: "p-4 text-muted text-center"
|
|
166
|
-
},
|
|
166
|
+
}, Rt = {
|
|
167
167
|
key: 1,
|
|
168
168
|
class: "tree-select-body",
|
|
169
169
|
style: { "max-height": "300px", "overflow-y": "auto" }
|
|
170
|
-
},
|
|
170
|
+
}, Ot = {
|
|
171
171
|
key: 0,
|
|
172
172
|
class: "list-group list-group-flush"
|
|
173
|
-
},
|
|
173
|
+
}, Ft = {
|
|
174
174
|
class: "d-flex align-items-center gap-2",
|
|
175
175
|
style: { "white-space": "wrap" }
|
|
176
|
-
},
|
|
176
|
+
}, qt = {
|
|
177
177
|
key: 1,
|
|
178
178
|
class: "p-3 text-muted text-center"
|
|
179
|
-
},
|
|
179
|
+
}, Ht = { key: 0 }, Wt = { key: 0 }, jt = { key: 1 }, Zt = { key: 0 }, Ut = { key: 1 }, Gt = {
|
|
180
180
|
__name: "TreeSelectMain",
|
|
181
181
|
props: {
|
|
182
182
|
modelValue: {
|
|
@@ -282,7 +282,7 @@ const ge = (t, P) => {
|
|
|
282
282
|
},
|
|
283
283
|
maxVisibleChipsDisplay: {
|
|
284
284
|
type: Number,
|
|
285
|
-
default:
|
|
285
|
+
default: null
|
|
286
286
|
},
|
|
287
287
|
closeOnSelect: {
|
|
288
288
|
type: Boolean,
|
|
@@ -308,188 +308,225 @@ const ge = (t, P) => {
|
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
310
|
emits: ["update:modelValue", "change", "clear", "deselect", "select", "focus", "blur", "add-new"],
|
|
311
|
-
setup(t, { emit:
|
|
312
|
-
const l = t,
|
|
313
|
-
const s =
|
|
311
|
+
setup(t, { emit: q }) {
|
|
312
|
+
const l = t, h = q, c = g(null), V = g(null), z = g(null), w = g(""), B = g(!1), R = g(/* @__PURE__ */ new Set()), v = g(null), p = g(null), N = g(null), S = g(!1), $ = g(null), te = g(null), Z = g(!1), O = g(l.defaultSortKey), U = g(l.defaultSortDirection), G = g(null), le = g(null), J = g(!1), ne = g(null), Se = g(null), de = g(0), Ce = y(() => l.size === "sm" ? "btn-sm" : l.size === "lg" ? "btn-lg" : l.size === "xl" ? "btn-xl" : ""), Ve = y(() => l.size === "sm" ? "form-control-sm" : l.size === "lg" ? "form-control-lg" : l.size === "xl" ? "form-control-xl" : ""), De = y(() => ae.value === 0 ? [] : H.value.slice(he.value)), Q = y(() => !l.multiple || !l.excludeFromSelectedListKey ? K.value : K.value.filter((e) => {
|
|
313
|
+
const s = E(e);
|
|
314
314
|
return !s || !s[l.excludeFromSelectedListKey];
|
|
315
|
-
})),
|
|
316
|
-
const e =
|
|
315
|
+
})), Le = y(() => {
|
|
316
|
+
const e = Q.value;
|
|
317
317
|
if (e.length === 0) return l.placeholder;
|
|
318
318
|
if (l.multiple) {
|
|
319
319
|
if (e.length === 1) {
|
|
320
|
-
const n =
|
|
320
|
+
const n = Y(e[0]);
|
|
321
321
|
return n ? n.join(" → ") : e[0];
|
|
322
322
|
}
|
|
323
323
|
return `${e.length} items selected`;
|
|
324
324
|
}
|
|
325
|
-
const s =
|
|
325
|
+
const s = Y(e[0]);
|
|
326
326
|
return s ? s.join(" → ") : e[0];
|
|
327
|
-
}),
|
|
328
|
-
await
|
|
329
|
-
const e =
|
|
330
|
-
if (l.multiple || l.displayMode === "chips" ||
|
|
331
|
-
|
|
327
|
+
}), Re = y(() => l.multiple ? Array.isArray(l.modelValue) ? l.modelValue : [] : l.modelValue !== null && l.modelValue !== void 0 ? [l.modelValue] : []), Oe = y(() => Re.value.filter((e) => !E(e))), Ae = async () => {
|
|
328
|
+
await P();
|
|
329
|
+
const e = te.value;
|
|
330
|
+
if (l.multiple || l.displayMode === "chips" || Q.value.length === 0 || !e) {
|
|
331
|
+
Z.value = !1;
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
|
|
335
|
-
},
|
|
334
|
+
Z.value = e.scrollWidth > e.clientWidth;
|
|
335
|
+
}, T = (e) => e && (e[l.optionLabel] || e.label || e.name) || "", b = (e) => e ? e[l.optionValue] || e.id || e.value : null, ce = (e) => !l.disabledKey || !e ? !1 : e.hasOwnProperty(l.disabledKey) && e[l.disabledKey] !== null, L = (e) => e.children && e.children.length > 0, X = (e, s) => {
|
|
336
336
|
if (s)
|
|
337
337
|
return s.split(".").reduce((n, a) => n && n[a], e);
|
|
338
|
-
},
|
|
338
|
+
}, E = (e, s = l.items) => {
|
|
339
339
|
for (const n of s) {
|
|
340
340
|
if (b(n) === e) return n;
|
|
341
341
|
if (L(n)) {
|
|
342
|
-
const a =
|
|
342
|
+
const a = E(e, n.children);
|
|
343
343
|
if (a) return a;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
return null;
|
|
347
|
-
},
|
|
347
|
+
}, fe = (e) => {
|
|
348
348
|
const s = [];
|
|
349
349
|
return L(e) && e.children.forEach((n) => {
|
|
350
|
-
|
|
350
|
+
ce(n) || (s.push(b(n)), s.push(...fe(n)));
|
|
351
351
|
}), s;
|
|
352
|
-
},
|
|
352
|
+
}, se = async () => {
|
|
353
|
+
await P();
|
|
354
|
+
const e = Se.value;
|
|
355
|
+
if (!e) return;
|
|
356
|
+
const s = e.querySelector(".chip-measure-layer");
|
|
357
|
+
if (!s) return;
|
|
358
|
+
const n = Array.from(s.children);
|
|
359
|
+
if (!n.length) {
|
|
360
|
+
de.value = 0;
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
const a = e.clientWidth, i = 4, u = 40;
|
|
364
|
+
let d = 0, k = 0;
|
|
365
|
+
for (let M = 0; M < n.length; M++) {
|
|
366
|
+
const Ke = n[M].offsetWidth + i, Xe = M < n.length - 1 ? u : 0;
|
|
367
|
+
if (d + Ke + Xe > a)
|
|
368
|
+
break;
|
|
369
|
+
d += Ke, k++;
|
|
370
|
+
}
|
|
371
|
+
de.value = Math.max(k, 1);
|
|
372
|
+
}, me = (e, s = l.items, n = []) => {
|
|
353
373
|
for (const a of s) {
|
|
354
374
|
if (b(a) === e) return n;
|
|
355
375
|
if (L(a)) {
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
376
|
+
const i = me(e, a.children, [...n, b(a)]);
|
|
377
|
+
if (i) return i;
|
|
358
378
|
}
|
|
359
379
|
}
|
|
360
380
|
return null;
|
|
361
|
-
},
|
|
381
|
+
}, K = y(() => {
|
|
362
382
|
const e = new Set(Array.isArray(l.modelValue) ? l.modelValue : [l.modelValue].filter(Boolean));
|
|
363
383
|
if (l.multiple && l.selectAll) {
|
|
364
384
|
const s = (n) => {
|
|
365
385
|
n.forEach((a) => {
|
|
366
386
|
if (L(a)) {
|
|
367
|
-
const
|
|
368
|
-
|
|
387
|
+
const i = a.children.filter((d) => !ce(d));
|
|
388
|
+
i.length > 0 && i.every((d) => e.has(b(d))) && e.add(b(a)), s(a.children);
|
|
369
389
|
}
|
|
370
390
|
});
|
|
371
391
|
};
|
|
372
392
|
s(l.items);
|
|
373
393
|
}
|
|
374
394
|
return Array.from(e);
|
|
375
|
-
}),
|
|
395
|
+
}), Y = (e, s = l.items, n = []) => {
|
|
376
396
|
for (const a of s) {
|
|
377
|
-
const
|
|
378
|
-
if (b(a) === e) return
|
|
397
|
+
const i = [...n, T(a)];
|
|
398
|
+
if (b(a) === e) return i;
|
|
379
399
|
if (L(a)) {
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
400
|
+
const u = Y(e, a.children, i);
|
|
401
|
+
if (u) return u;
|
|
382
402
|
}
|
|
383
403
|
}
|
|
384
404
|
return null;
|
|
385
|
-
},
|
|
405
|
+
}, Ie = (e) => {
|
|
386
406
|
if (!e || e.length === 0) return "";
|
|
387
407
|
const s = e.join(" → ");
|
|
388
408
|
return s.length <= 40 ? s : e.length > 2 ? `${e[0]} → ... → ${e[e.length - 1]}` : s;
|
|
389
|
-
},
|
|
390
|
-
const e =
|
|
409
|
+
}, ve = y(() => {
|
|
410
|
+
const e = Q.value;
|
|
391
411
|
if (e.length === 0) return l.placeholder;
|
|
392
412
|
if (l.multiple) {
|
|
393
413
|
if (e.length === 1) {
|
|
394
|
-
const
|
|
395
|
-
|
|
414
|
+
const i = E(e[0]);
|
|
415
|
+
if (!i)
|
|
416
|
+
return `${e[0]} (No longer available)`;
|
|
417
|
+
const u = Y(e[0]);
|
|
418
|
+
return u ? Ie(u) : T(i);
|
|
396
419
|
}
|
|
397
420
|
return `${e.length} items selected`;
|
|
398
421
|
}
|
|
399
|
-
const s =
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
422
|
+
const s = e[0], n = E(s);
|
|
423
|
+
if (!n)
|
|
424
|
+
return `${s} (No longer available)`;
|
|
425
|
+
const a = Y(s);
|
|
426
|
+
return a ? Ie(a) : T(n);
|
|
427
|
+
}), H = y(() => {
|
|
428
|
+
if (!l.multiple || Q.value.length === 0) return [];
|
|
429
|
+
const e = Q.value.map((a) => {
|
|
430
|
+
const i = E(a);
|
|
431
|
+
return i || {
|
|
432
|
+
[l.optionValue]: a,
|
|
433
|
+
[l.optionLabel]: `${a} (No longer available)`,
|
|
434
|
+
__missing: !0
|
|
435
|
+
};
|
|
436
|
+
});
|
|
437
|
+
if (!l.sortable || !O.value)
|
|
405
438
|
return e;
|
|
406
|
-
const s =
|
|
407
|
-
return [...e].sort((a,
|
|
408
|
-
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
439
|
+
const s = O.value, n = U.value;
|
|
440
|
+
return [...e].sort((a, i) => {
|
|
441
|
+
if (a.__missing) return 1;
|
|
442
|
+
if (i.__missing) return -1;
|
|
443
|
+
const u = X(a, s), d = X(i, s);
|
|
444
|
+
if (u == null) return 1;
|
|
445
|
+
if (d == null) return -1;
|
|
446
|
+
let k = 0;
|
|
447
|
+
return typeof u == "string" && typeof d == "string" ? k = u.localeCompare(d) : u > d ? k = 1 : u < d && (k = -1), n === "desc" ? k * -1 : k;
|
|
413
448
|
});
|
|
414
|
-
}),
|
|
415
|
-
|
|
449
|
+
}), $e = y(
|
|
450
|
+
() => H.value.slice(0, he.value)
|
|
451
|
+
), he = y(() => l.maxVisibleChipsDisplay !== null ? l.maxVisibleChipsDisplay : Math.max(de.value, 1)), ae = y(() => {
|
|
452
|
+
const e = H.value.length - he.value;
|
|
416
453
|
return e > 0 ? e : 0;
|
|
417
|
-
}),
|
|
454
|
+
}), Me = (e, s) => {
|
|
418
455
|
const n = s.toLowerCase();
|
|
419
456
|
return e.map((a) => {
|
|
420
|
-
let
|
|
457
|
+
let i = !1;
|
|
421
458
|
if (l.keyFilters && l.keyFilters.length > 0)
|
|
422
|
-
for (const
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
|
|
459
|
+
for (const d of l.keyFilters) {
|
|
460
|
+
const k = X(a, d);
|
|
461
|
+
if (k != null && String(k).toLowerCase().includes(n)) {
|
|
462
|
+
i = !0;
|
|
426
463
|
break;
|
|
427
464
|
}
|
|
428
465
|
}
|
|
429
466
|
else
|
|
430
|
-
|
|
467
|
+
i = T(a).toLowerCase().includes(n);
|
|
431
468
|
if (!L(a))
|
|
432
|
-
return
|
|
433
|
-
const
|
|
434
|
-
return
|
|
469
|
+
return i ? a : null;
|
|
470
|
+
const u = Me(a.children, s);
|
|
471
|
+
return i ? { ...a, children: a.children } : u.length > 0 ? { ...a, children: u } : null;
|
|
435
472
|
}).filter(Boolean);
|
|
436
|
-
},
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
if (
|
|
440
|
-
let
|
|
441
|
-
return typeof
|
|
442
|
-
}).map((
|
|
443
|
-
const e =
|
|
444
|
-
return !l.sortable || !
|
|
445
|
-
}),
|
|
473
|
+
}, Be = (e, s, n) => !e || !s ? e : [...e].sort((i, u) => {
|
|
474
|
+
const d = X(i, s), k = X(u, s);
|
|
475
|
+
if (d == null) return 1;
|
|
476
|
+
if (k == null) return -1;
|
|
477
|
+
let M = 0;
|
|
478
|
+
return typeof d == "string" && typeof k == "string" ? M = d.localeCompare(k) : d > k ? M = 1 : d < k && (M = -1), n === "desc" ? M * -1 : M;
|
|
479
|
+
}).map((i) => L(i) ? { ...i, children: Be(i.children, s, n) } : i), oe = y(() => {
|
|
480
|
+
const e = w.value.trim(), s = e ? Me(l.items, e) : l.items;
|
|
481
|
+
return !l.sortable || !O.value ? s : Be(s, O.value, U.value);
|
|
482
|
+
}), Fe = (e) => {
|
|
446
483
|
if (l.disableBranchNodes && L(e)) {
|
|
447
|
-
const
|
|
448
|
-
|
|
484
|
+
const i = b(e);
|
|
485
|
+
Ne(i);
|
|
449
486
|
return;
|
|
450
487
|
}
|
|
451
|
-
if (
|
|
488
|
+
if (ce(e)) return;
|
|
452
489
|
const s = b(e);
|
|
453
|
-
let n = new Set(
|
|
490
|
+
let n = new Set(K.value);
|
|
454
491
|
if (l.multiple) {
|
|
455
|
-
const
|
|
492
|
+
const i = n.has(s);
|
|
456
493
|
if (l.selectAll && L(e)) {
|
|
457
|
-
const
|
|
458
|
-
|
|
494
|
+
const u = fe(e);
|
|
495
|
+
i ? (n.delete(s), h("deselect", e), l.deselectAll && u.forEach((d) => n.delete(d))) : (n.add(s), u.forEach((d) => n.add(d)), h("select", e));
|
|
459
496
|
} else
|
|
460
|
-
|
|
497
|
+
i ? (n.delete(s), l.selectAll && me(s)?.forEach((d) => n.delete(d))) : n.add(s);
|
|
461
498
|
} else {
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
499
|
+
const i = l.modelValue, u = b(e);
|
|
500
|
+
i === u ? (n.clear(), h("deselect", e)) : (n.clear(), n.add(u), i != null && E(i), h("select", e)), l.closeOnSelect && F(), P(() => {
|
|
501
|
+
z.value?.focus();
|
|
465
502
|
});
|
|
466
503
|
}
|
|
467
504
|
let a = Array.from(n);
|
|
468
|
-
l.multiple && l.excludeFromSelectedListKey && (a = a.filter((
|
|
469
|
-
const
|
|
470
|
-
return !
|
|
471
|
-
})),
|
|
472
|
-
},
|
|
505
|
+
l.multiple && l.excludeFromSelectedListKey && (a = a.filter((i) => {
|
|
506
|
+
const u = E(i);
|
|
507
|
+
return !u || !u[l.excludeFromSelectedListKey];
|
|
508
|
+
})), h("update:modelValue", l.multiple ? a : a[0] || null), h("change", l.multiple ? a : a[0] || null);
|
|
509
|
+
}, pe = (e) => {
|
|
473
510
|
if (l.disabled || !e) return;
|
|
474
|
-
const s = b(e), n = new Set(
|
|
475
|
-
n.delete(s), l.selectAll && (l.deselectAll && L(e) &&
|
|
511
|
+
const s = b(e), n = new Set(K.value);
|
|
512
|
+
n.delete(s), l.selectAll && (l.deselectAll && L(e) && fe(e).forEach((d) => n.delete(d)), me(s)?.forEach((u) => n.delete(u)));
|
|
476
513
|
const a = Array.from(n);
|
|
477
|
-
|
|
478
|
-
},
|
|
479
|
-
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
},
|
|
514
|
+
h("update:modelValue", a), h("change", a);
|
|
515
|
+
}, Ne = (e) => {
|
|
516
|
+
R.value.has(e) ? R.value.delete(e) : R.value.add(e);
|
|
517
|
+
}, qe = () => {
|
|
518
|
+
U.value = U.value === "asc" ? "desc" : "asc";
|
|
519
|
+
}, He = () => {
|
|
483
520
|
const e = l.multiple ? [] : null;
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
!l.allowAddNew || !
|
|
487
|
-
},
|
|
488
|
-
l.allowAddNew && l.addNewMode === "enter" &&
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
l.disabled || (
|
|
521
|
+
h("clear"), h("update:modelValue", e), h("change", e), _();
|
|
522
|
+
}, Te = () => {
|
|
523
|
+
!l.allowAddNew || !w.value.trim() || (h("add-new", w.value.trim()), F());
|
|
524
|
+
}, We = () => {
|
|
525
|
+
l.allowAddNew && l.addNewMode === "enter" && w.value.trim() && oe.value.length === 0 && Te();
|
|
526
|
+
}, je = (e) => {
|
|
527
|
+
h("focus", e);
|
|
528
|
+
}, Ze = async () => {
|
|
529
|
+
l.disabled || (_(), B.value = !0, ie(), await P(), V.value && z.value && (v.value = we(z.value, V.value, {
|
|
493
530
|
placement: "bottom-start",
|
|
494
531
|
strategy: "fixed",
|
|
495
532
|
modifiers: [
|
|
@@ -509,172 +546,189 @@ const ge = (t, P) => {
|
|
|
509
546
|
}
|
|
510
547
|
}
|
|
511
548
|
]
|
|
512
|
-
})), l.searchable && (await
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
},
|
|
516
|
-
|
|
549
|
+
})), l.searchable && (await P(), V.value?.querySelector(".tree-search-input")?.focus()));
|
|
550
|
+
}, F = () => {
|
|
551
|
+
B.value = !1, w.value = "", v.value?.destroy(), v.value = null, h("blur", l.modelValue);
|
|
552
|
+
}, ge = () => B.value ? F() : Ze(), Ue = async () => {
|
|
553
|
+
F(), ie(), J.value = !0, await P(), le.value && G.value && (ne.value = we(G.value, le.value, {
|
|
517
554
|
placement: "bottom-end",
|
|
518
555
|
strategy: "fixed",
|
|
519
556
|
modifiers: [{ name: "offset", options: { offset: [0, 4] } }]
|
|
520
557
|
}));
|
|
521
|
-
},
|
|
522
|
-
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
},
|
|
526
|
-
|
|
527
|
-
},
|
|
528
|
-
!
|
|
558
|
+
}, _ = () => {
|
|
559
|
+
J.value = !1, ne.value?.destroy(), ne.value = null;
|
|
560
|
+
}, ze = () => J.value ? _() : Ue(), Ee = (e) => {
|
|
561
|
+
B.value && !z.value?.contains(e.target) && !V.value?.contains(e.target) && F(), J.value && !G.value?.contains(e.target) && !le.value?.contains(e.target) && _(), S.value && !$.value?.$el?.contains(e.target) && !p.value?.contains(e.target) && ie();
|
|
562
|
+
}, Ge = (e) => {
|
|
563
|
+
c.value?.contains(e.relatedTarget) || F();
|
|
564
|
+
}, Je = async () => {
|
|
565
|
+
!Z.value || S.value || (F(), _(), S.value = !0, await P(), p.value && $.value && (N.value = we($.value.$el, p.value, {
|
|
529
566
|
// ⬅️ 5b. USE $el
|
|
530
567
|
placement: "top",
|
|
531
568
|
strategy: "fixed",
|
|
532
569
|
modifiers: [{ name: "offset", options: { offset: [0, 8] } }]
|
|
533
570
|
})));
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
},
|
|
537
|
-
|
|
571
|
+
}, Qe = () => {
|
|
572
|
+
S.value ? ie() : Je();
|
|
573
|
+
}, ie = () => {
|
|
574
|
+
S.value = !1, N.value?.destroy(), N.value = null;
|
|
538
575
|
};
|
|
539
|
-
return
|
|
576
|
+
return ye(w, (e) => {
|
|
540
577
|
if (e.trim()) {
|
|
541
578
|
const s = (n) => {
|
|
542
579
|
n.forEach((a) => {
|
|
543
|
-
L(a) && (
|
|
580
|
+
L(a) && (R.value.add(b(a)), s(a.children));
|
|
544
581
|
});
|
|
545
582
|
};
|
|
546
|
-
s(
|
|
583
|
+
s(oe.value);
|
|
547
584
|
}
|
|
548
|
-
}),
|
|
549
|
-
|
|
550
|
-
}),
|
|
551
|
-
document.addEventListener("click",
|
|
552
|
-
}),
|
|
553
|
-
document.removeEventListener("click",
|
|
554
|
-
}), (e, s) => (o(),
|
|
585
|
+
}), ye(ve, () => {
|
|
586
|
+
Ae();
|
|
587
|
+
}), ye(H, se), et(async () => {
|
|
588
|
+
document.addEventListener("click", Ee), window.addEventListener("resize", se), await P(), se(), Ae();
|
|
589
|
+
}), tt(() => {
|
|
590
|
+
document.removeEventListener("click", Ee), window.removeEventListener("resize", se), v.value?.destroy(), ne.value?.destroy(), N.value?.destroy();
|
|
591
|
+
}), (e, s) => (o(), r("div", {
|
|
555
592
|
ref_key: "wrapperRef",
|
|
556
|
-
ref:
|
|
593
|
+
ref: c,
|
|
557
594
|
class: "tree-select-wrapper",
|
|
558
|
-
onFocusin:
|
|
559
|
-
onFocusout:
|
|
595
|
+
onFocusin: je,
|
|
596
|
+
onFocusout: Ge
|
|
560
597
|
}, [
|
|
561
|
-
|
|
598
|
+
f("div", {
|
|
562
599
|
ref_key: "triggerRef",
|
|
563
|
-
ref:
|
|
600
|
+
ref: z,
|
|
564
601
|
role: "button",
|
|
565
602
|
tabindex: "0",
|
|
566
|
-
class:
|
|
567
|
-
|
|
603
|
+
class: I(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main", [
|
|
604
|
+
Ce.value,
|
|
568
605
|
{
|
|
569
606
|
"btn-outline-secondary": !t.isInvalid,
|
|
570
607
|
"border-danger": t.isInvalid,
|
|
571
608
|
disabled: t.disabled || t.isLoading,
|
|
572
609
|
"is-loading": t.isLoading,
|
|
573
|
-
"has-chips": t.multiple && t.displayMode === "chips" &&
|
|
610
|
+
"has-chips": t.multiple && t.displayMode === "chips" && K.value.length > 0
|
|
574
611
|
}
|
|
575
612
|
]]),
|
|
576
|
-
onClick:
|
|
613
|
+
onClick: ge,
|
|
577
614
|
onKeydown: [
|
|
578
|
-
|
|
579
|
-
|
|
615
|
+
ke(C(ge, ["prevent"]), ["enter"]),
|
|
616
|
+
ke(C(ge, ["prevent"]), ["space"])
|
|
580
617
|
]
|
|
581
618
|
}, [
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
selectedItems:
|
|
585
|
-
displayText:
|
|
619
|
+
f("div", xt, [
|
|
620
|
+
ue(e.$slots, "display", {
|
|
621
|
+
selectedItems: H.value,
|
|
622
|
+
displayText: ve.value,
|
|
586
623
|
placeholder: t.placeholder,
|
|
587
624
|
isLoading: t.isLoading,
|
|
588
|
-
removeItem:
|
|
589
|
-
getItemLabel:
|
|
625
|
+
removeItem: pe,
|
|
626
|
+
getItemLabel: T,
|
|
590
627
|
getItemValue: b,
|
|
591
|
-
visibleChips:
|
|
592
|
-
hiddenChipsCount:
|
|
593
|
-
toggleMorePopover:
|
|
594
|
-
moreTriggerRef:
|
|
628
|
+
visibleChips: $e.value,
|
|
629
|
+
hiddenChipsCount: ae.value,
|
|
630
|
+
toggleMorePopover: ze,
|
|
631
|
+
moreTriggerRef: G.value
|
|
595
632
|
}, () => [
|
|
596
|
-
!t.multiple || t.displayMode === "text" ? (o(),
|
|
597
|
-
|
|
633
|
+
!t.multiple || t.displayMode === "text" ? (o(), r("div", St, [
|
|
634
|
+
f("span", {
|
|
598
635
|
ref_key: "textDisplaySpanRef",
|
|
599
|
-
ref:
|
|
600
|
-
class: "text-truncate",
|
|
601
|
-
title:
|
|
602
|
-
},
|
|
603
|
-
|
|
636
|
+
ref: te,
|
|
637
|
+
class: I(["text-truncate", { "text-danger": Oe.value.length > 0 }]),
|
|
638
|
+
title: Z.value ? Le.value : ""
|
|
639
|
+
}, x(t.isLoading ? "Loading data..." : ve.value), 11, Ct),
|
|
640
|
+
Z.value && !t.isLoading ? (o(), D(A, {
|
|
604
641
|
key: 0,
|
|
605
642
|
ref_key: "tooltipTriggerIconRef",
|
|
606
|
-
ref:
|
|
643
|
+
ref: $,
|
|
607
644
|
name: "info-circle",
|
|
608
645
|
class: "tooltip-trigger-icon ms-2 flex-shrink-0",
|
|
609
|
-
onClick: C(
|
|
610
|
-
}, null, 512)) :
|
|
611
|
-
])) : t.multiple && t.displayMode === "chips" ? (o(),
|
|
612
|
-
|
|
613
|
-
|
|
646
|
+
onClick: C(Qe, ["stop"])
|
|
647
|
+
}, null, 512)) : m("", !0)
|
|
648
|
+
])) : t.multiple && t.displayMode === "chips" ? (o(), r("div", Vt, [
|
|
649
|
+
K.value.length === 0 ? (o(), r("span", Lt, x(t.placeholder), 1)) : (o(), r("div", {
|
|
650
|
+
key: 1,
|
|
651
|
+
class: "chips-container",
|
|
652
|
+
ref_key: "chipsContainerRef",
|
|
653
|
+
ref: Se
|
|
654
|
+
}, [
|
|
655
|
+
f("div", At, [
|
|
656
|
+
(o(!0), r(W, null, j(H.value, (n) => (o(), r("span", {
|
|
657
|
+
key: "measure-" + b(n),
|
|
658
|
+
class: "badge chip"
|
|
659
|
+
}, [
|
|
660
|
+
f("span", It, x(T(n)), 1),
|
|
661
|
+
ee(A, {
|
|
662
|
+
name: "times",
|
|
663
|
+
class: "chip-remove"
|
|
664
|
+
})
|
|
665
|
+
]))), 128))
|
|
666
|
+
]),
|
|
667
|
+
(o(!0), r(W, null, j($e.value, (n) => (o(), r("span", {
|
|
614
668
|
key: b(n),
|
|
615
|
-
class: "badge text-bg-primary
|
|
669
|
+
class: I(["badge chip", n.__missing ? "bg-danger text-white" : "bg-primary text-white"])
|
|
616
670
|
}, [
|
|
617
|
-
|
|
618
|
-
|
|
671
|
+
f("span", $t, x(T(n)), 1),
|
|
672
|
+
ee(A, {
|
|
619
673
|
name: "times",
|
|
620
674
|
class: "chip-remove",
|
|
621
|
-
onClick: C((a) =>
|
|
675
|
+
onClick: C((a) => pe(n), ["stop"])
|
|
622
676
|
}, null, 8, ["onClick"])
|
|
623
|
-
]))), 128)),
|
|
624
|
-
|
|
677
|
+
], 2))), 128)),
|
|
678
|
+
ae.value > 0 ? (o(), r("button", {
|
|
625
679
|
key: 0,
|
|
626
680
|
ref_key: "moreTriggerRef",
|
|
627
|
-
ref:
|
|
681
|
+
ref: G,
|
|
628
682
|
type: "button",
|
|
629
683
|
class: "btn btn-sm btn-light more-button",
|
|
630
|
-
onClick: C(
|
|
631
|
-
}, " +" +
|
|
632
|
-
]))
|
|
633
|
-
])) :
|
|
684
|
+
onClick: C(ze, ["stop"])
|
|
685
|
+
}, " +" + x(ae.value), 513)) : m("", !0)
|
|
686
|
+
], 512))
|
|
687
|
+
])) : m("", !0)
|
|
634
688
|
], !0)
|
|
635
689
|
]),
|
|
636
|
-
|
|
637
|
-
t.isLoading ? (o(),
|
|
690
|
+
f("div", Mt, [
|
|
691
|
+
t.isLoading ? (o(), D(A, {
|
|
638
692
|
key: 0,
|
|
639
693
|
name: "spinner",
|
|
640
694
|
class: "loading-icon"
|
|
641
|
-
})) :
|
|
642
|
-
t.showClearButton &&
|
|
695
|
+
})) : m("", !0),
|
|
696
|
+
t.showClearButton && K.value.length > 0 && !t.disabled && !t.isLoading ? (o(), D(A, {
|
|
643
697
|
key: 1,
|
|
644
698
|
name: "times",
|
|
645
|
-
onClick: C(
|
|
699
|
+
onClick: C(He, ["stop"]),
|
|
646
700
|
class: "clear-icon"
|
|
647
|
-
})) :
|
|
648
|
-
t.isLoading ?
|
|
701
|
+
})) : m("", !0),
|
|
702
|
+
t.isLoading ? m("", !0) : (o(), D(A, {
|
|
649
703
|
key: 2,
|
|
650
704
|
name: "chevron-down",
|
|
651
|
-
class:
|
|
705
|
+
class: I(["transition-transform", { "rotate-180": B.value }])
|
|
652
706
|
}, null, 8, ["class"]))
|
|
653
707
|
])
|
|
654
|
-
], 42,
|
|
655
|
-
|
|
708
|
+
], 42, wt),
|
|
709
|
+
J.value ? (o(), r("div", {
|
|
656
710
|
key: 0,
|
|
657
711
|
ref_key: "morePopoverRef",
|
|
658
|
-
ref:
|
|
712
|
+
ref: le,
|
|
659
713
|
class: "card shadow-lg border-0 more-popover",
|
|
660
714
|
style: { "z-index": "1060" }
|
|
661
715
|
}, [
|
|
662
|
-
|
|
663
|
-
(o(!0),
|
|
716
|
+
f("div", Bt, [
|
|
717
|
+
(o(!0), r(W, null, j(De.value, (n) => (o(), r("div", {
|
|
664
718
|
key: b(n),
|
|
665
719
|
class: "list-group-item d-flex justify-content-between align-items-center py-1 px-2"
|
|
666
720
|
}, [
|
|
667
|
-
|
|
668
|
-
t.disabled ?
|
|
721
|
+
f("small", Nt, x(T(n)), 1),
|
|
722
|
+
t.disabled ? m("", !0) : (o(), D(A, {
|
|
669
723
|
key: 0,
|
|
670
724
|
name: "times",
|
|
671
725
|
class: "chip-remove flex-shrink-0",
|
|
672
|
-
onClick: C((a) =>
|
|
726
|
+
onClick: C((a) => pe(n), ["stop"])
|
|
673
727
|
}, null, 8, ["onClick"]))
|
|
674
728
|
]))), 128))
|
|
675
729
|
])
|
|
676
|
-
], 512)) :
|
|
677
|
-
|
|
730
|
+
], 512)) : m("", !0),
|
|
731
|
+
B.value ? (o(), r("div", {
|
|
678
732
|
key: 1,
|
|
679
733
|
ref_key: "dropdownRef",
|
|
680
734
|
ref: V,
|
|
@@ -685,59 +739,59 @@ const ge = (t, P) => {
|
|
|
685
739
|
}, ["stop"])),
|
|
686
740
|
style: { "z-index": "1050" }
|
|
687
741
|
}, [
|
|
688
|
-
|
|
689
|
-
t.searchable ?
|
|
742
|
+
f("div", Tt, [
|
|
743
|
+
t.searchable ? be((o(), r("input", {
|
|
690
744
|
key: 0,
|
|
691
|
-
"onUpdate:modelValue": s[0] || (s[0] = (n) =>
|
|
745
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => w.value = n),
|
|
692
746
|
type: "text",
|
|
693
|
-
class:
|
|
747
|
+
class: I(["form-control tree-search-input", Ve.value]),
|
|
694
748
|
placeholder: "Search...",
|
|
695
|
-
onKeydown:
|
|
696
|
-
}, null, 42,
|
|
697
|
-
[
|
|
698
|
-
]) :
|
|
699
|
-
t.sortable && t.sortOptions.length > 0 ? (o(),
|
|
700
|
-
|
|
701
|
-
"onUpdate:modelValue": s[1] || (s[1] = (n) =>
|
|
702
|
-
class:
|
|
749
|
+
onKeydown: ke(C(We, ["prevent"]), ["enter"])
|
|
750
|
+
}, null, 42, zt)), [
|
|
751
|
+
[lt, w.value]
|
|
752
|
+
]) : m("", !0),
|
|
753
|
+
t.sortable && t.sortOptions.length > 0 ? (o(), r("div", Et, [
|
|
754
|
+
be(f("select", {
|
|
755
|
+
"onUpdate:modelValue": s[1] || (s[1] = (n) => O.value = n),
|
|
756
|
+
class: I(["form-select flex-grow-1", Ve.value])
|
|
703
757
|
}, [
|
|
704
|
-
s[4] || (s[4] =
|
|
758
|
+
s[4] || (s[4] = f("option", {
|
|
705
759
|
value: null,
|
|
706
760
|
disabled: ""
|
|
707
761
|
}, "Sort by...", -1)),
|
|
708
|
-
(o(!0),
|
|
762
|
+
(o(!0), r(W, null, j(t.sortOptions, (n) => (o(), r("option", {
|
|
709
763
|
key: n.value,
|
|
710
764
|
value: n.value
|
|
711
|
-
},
|
|
765
|
+
}, x(n.label), 9, Kt))), 128))
|
|
712
766
|
], 2), [
|
|
713
|
-
[
|
|
767
|
+
[nt, O.value]
|
|
714
768
|
]),
|
|
715
|
-
|
|
769
|
+
f("button", {
|
|
716
770
|
type: "button",
|
|
717
|
-
class:
|
|
718
|
-
disabled: !
|
|
719
|
-
onClick:
|
|
771
|
+
class: I(["btn btn-outline-secondary", Ce.value]),
|
|
772
|
+
disabled: !O.value,
|
|
773
|
+
onClick: qe
|
|
720
774
|
}, [
|
|
721
|
-
|
|
722
|
-
name:
|
|
775
|
+
ee(A, {
|
|
776
|
+
name: U.value === "asc" ? "asc" : "desc"
|
|
723
777
|
}, null, 8, ["name"])
|
|
724
|
-
], 10,
|
|
725
|
-
])) :
|
|
778
|
+
], 10, Pt)
|
|
779
|
+
])) : m("", !0)
|
|
726
780
|
]),
|
|
727
|
-
t.isLoading ? (o(),
|
|
728
|
-
|
|
781
|
+
t.isLoading ? (o(), r("div", Dt, [
|
|
782
|
+
ee(A, {
|
|
729
783
|
name: "spinner",
|
|
730
784
|
class: "me-2"
|
|
731
785
|
}),
|
|
732
|
-
s[5] || (s[5] =
|
|
733
|
-
])) : (o(),
|
|
734
|
-
|
|
735
|
-
(o(!0),
|
|
786
|
+
s[5] || (s[5] = f("span", null, "Loading...", -1))
|
|
787
|
+
])) : (o(), r("div", Rt, [
|
|
788
|
+
oe.value.length > 0 ? (o(), r("div", Ot, [
|
|
789
|
+
(o(!0), r(W, null, j(oe.value, (n) => (o(), D(kt, {
|
|
736
790
|
key: b(n),
|
|
737
791
|
item: n,
|
|
738
792
|
level: 0,
|
|
739
|
-
"selected-items":
|
|
740
|
-
"expanded-items":
|
|
793
|
+
"selected-items": K.value,
|
|
794
|
+
"expanded-items": R.value,
|
|
741
795
|
multiple: t.multiple,
|
|
742
796
|
"select-all": t.selectAll,
|
|
743
797
|
"select-mode": t.selectMode,
|
|
@@ -745,66 +799,66 @@ const ge = (t, P) => {
|
|
|
745
799
|
"option-value": t.optionValue,
|
|
746
800
|
"disabled-key": t.disabledKey,
|
|
747
801
|
"disable-branch-node": t.disableBranchNodes,
|
|
748
|
-
onSelect:
|
|
749
|
-
onToggleExpand:
|
|
802
|
+
onSelect: Fe,
|
|
803
|
+
onToggleExpand: Ne
|
|
750
804
|
}, {
|
|
751
|
-
default:
|
|
752
|
-
|
|
805
|
+
default: Pe(({ item: a, level: i }) => [
|
|
806
|
+
ue(e.$slots, "default", {
|
|
753
807
|
item: a,
|
|
754
|
-
level:
|
|
808
|
+
level: i
|
|
755
809
|
}, () => [
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
a.icon ? (o(),
|
|
810
|
+
f("div", Ft, [
|
|
811
|
+
re(x(T(a)) + " ", 1),
|
|
812
|
+
a.icon ? (o(), r("i", {
|
|
759
813
|
key: 0,
|
|
760
|
-
class:
|
|
761
|
-
}, null, 2)) :
|
|
814
|
+
class: I(a.icon)
|
|
815
|
+
}, null, 2)) : m("", !0)
|
|
762
816
|
])
|
|
763
817
|
], !0)
|
|
764
818
|
]),
|
|
765
819
|
_: 2
|
|
766
820
|
}, 1032, ["item", "selected-items", "expanded-items", "multiple", "select-all", "select-mode", "option-label", "option-value", "disabled-key", "disable-branch-node"]))), 128))
|
|
767
|
-
])) : (o(),
|
|
768
|
-
t.allowAddNew ? (o(),
|
|
769
|
-
t.addNewMode === "button" ? (o(),
|
|
821
|
+
])) : (o(), r("div", qt, [
|
|
822
|
+
t.allowAddNew ? (o(), r("div", Ht, [
|
|
823
|
+
t.addNewMode === "button" ? (o(), r("button", {
|
|
770
824
|
key: 0,
|
|
771
825
|
type: "button",
|
|
772
826
|
class: "btn btn-success btn-sm w-100",
|
|
773
|
-
onClick:
|
|
827
|
+
onClick: Te
|
|
774
828
|
}, [
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
])) : t.addNewMode === "enter" ? (o(),
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
])) :
|
|
781
|
-
])) : (o(),
|
|
782
|
-
|
|
829
|
+
re(' No items found "Click" to ' + x(t.addNewLabel) + " ", 1),
|
|
830
|
+
w.value.trim() ? (o(), r("span", Wt, ' : "' + x(w.value) + '" ', 1)) : m("", !0)
|
|
831
|
+
])) : t.addNewMode === "enter" ? (o(), r("span", jt, [
|
|
832
|
+
re(' No items found "Press Enter" to ' + x(t.addNewLabel) + " ", 1),
|
|
833
|
+
w.value.trim() ? (o(), r("span", Zt, ' : "' + x(w.value) + '" ', 1)) : m("", !0)
|
|
834
|
+
])) : m("", !0)
|
|
835
|
+
])) : (o(), r("div", Ut, [
|
|
836
|
+
ee(A, {
|
|
783
837
|
name: "search",
|
|
784
838
|
class: "me-1"
|
|
785
839
|
}),
|
|
786
|
-
s[6] || (s[6] =
|
|
840
|
+
s[6] || (s[6] = re(" No items found ", -1))
|
|
787
841
|
]))
|
|
788
842
|
]))
|
|
789
843
|
]))
|
|
790
|
-
], 544)) :
|
|
791
|
-
|
|
844
|
+
], 544)) : m("", !0),
|
|
845
|
+
be(f("div", {
|
|
792
846
|
ref_key: "tooltipRef",
|
|
793
847
|
ref: p,
|
|
794
848
|
class: "tree-select-tooltip card shadow-sm py-1 px-2",
|
|
795
849
|
role: "tooltip",
|
|
796
850
|
style: { "z-index": "1070" }
|
|
797
|
-
},
|
|
798
|
-
[
|
|
851
|
+
}, x(Le.value), 513), [
|
|
852
|
+
[st, S.value]
|
|
799
853
|
])
|
|
800
854
|
], 544));
|
|
801
855
|
}
|
|
802
|
-
},
|
|
856
|
+
}, Jt = /* @__PURE__ */ xe(Gt, [["__scopeId", "data-v-41032f5c"]]), _t = {
|
|
803
857
|
install(t) {
|
|
804
|
-
t.component("VSelect",
|
|
858
|
+
t.component("VSelect", Jt);
|
|
805
859
|
}
|
|
806
860
|
};
|
|
807
861
|
export {
|
|
808
|
-
|
|
809
|
-
|
|
862
|
+
Jt as VSelect,
|
|
863
|
+
_t as default
|
|
810
864
|
};
|
package/dist/vue-select.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,Q){"use strict";const X=(l,I)=>{const n=l.__vccOpts||l;for(const[u,c]of I)n[u]=c;return n},ye={key:0},ge={key:1},ke={key:2},be={key:3},Be={key:4},we={key:5},Ve={key:6},xe={key:7},B=X({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const I=l,n=e.computed(()=>({"svg-icon-spin":I.name==="spinner"}));return(u,c)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(n.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",ye,c[0]||(c[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",ge,c[1]||(c[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",ke,c[2]||(c[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",be,c[3]||(c[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",Be,c[4]||(c[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",we,c[5]||(c[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",Ve,c[6]||(c[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),l.name==="info-circle"?(e.openBlock(),e.createElementBlock("g",xe,c[7]||(c[7]=[e.createElementVNode("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)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-89f9b7e1"]]),Se={class:"tree-select-item-wrapper"},Ce={key:1,class:"expander-placeholder"},Ee=["checked",".indeterminate","disabled"],Ne={class:"item-content"},Le={key:0,class:"children-wrapper"},Me=X({__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:I}){const n=l,u=m=>m[n.optionValue]||m.id||m.value,c=m=>!n.disabledKey||!m?!1:m.hasOwnProperty(n.disabledKey)&&m[n.disabledKey]!==null,k=e.computed(()=>n.item.children&&n.item.children.length>0),C=e.computed(()=>n.expandedItems.has(u(n.item))),p=e.computed(()=>n.selectedItems.includes(u(n.item))),x=m=>{let f=[];return m.children&&m.children.forEach(S=>{f.push(u(S)),f.push(...x(S))}),f},N=e.computed(()=>!n.multiple||!n.selectAll||!k.value||p.value?!1:x(n.item).some(f=>n.selectedItems.includes(f)));return(m,f)=>{const S=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":p.value&&(l.selectMode==="highlight"||!l.multiple)&&!c(l.item)&&!(l.disableBranchNode&&k.value),"is-disabled text-muted bg-light":c(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:f[2]||(f[2]=g=>c(l.item)?null:m.$emit("select",l.item))},[k.value?(e.openBlock(),e.createBlock(B,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon",{"rotate-90":C.value}]),onClick:f[0]||(f[0]=e.withModifiers(g=>m.$emit("toggle-expand",u(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",Ce)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&k.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"form-check-input",checked:p.value,".indeterminate":N.value,disabled:c(l.item),onClick:f[1]||(f[1]=e.withModifiers(g=>m.$emit("select",l.item),["stop"]))},null,40,Ee)):e.createCommentVNode("",!0),e.createElementVNode("div",Ne,[e.renderSlot(m.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),k.value&&C.value?(e.openBlock(),e.createElementBlock("div",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,g=>(e.openBlock(),e.createBlock(S,{key:u(g),item:g,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:f[3]||(f[3]=w=>m.$emit("select",w)),onToggleExpand:f[4]||(f[4]=w=>m.$emit("toggle-expand",w))},{default:e.withCtx(({item:w,level:j})=>[e.renderSlot(m.$slots,"default",{item:w,level:j},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-9b5a84a0"]]),Ie=["onKeydown"],Ae={class:"tree-select-display-container"},Te={key:0,class:"d-flex align-items-center justify-content-start w-100"},$e=["title"],ze={key:1},De={key:0,class:"text-muted"},Ke={key:1,class:"chips-container"},Pe={class:"d-flex align-items-center gap-2"},Fe={class:"list-group list-group-flush"},Oe={class:"text-wrap text-start me-2"},Re={class:"p-2 border-bottom d-flex flex-column gap-2"},qe=["onKeydown"],je={key:1,class:"d-flex align-items-center gap-2"},He=["value"],Ze=["disabled"],We={key:0,class:"p-4 text-muted text-center"},Ue={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},Ge={key:0,class:"list-group list-group-flush"},Je={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},Qe={key:1,class:"p-3 text-muted text-center"},Xe={key:0},Ye={key:0},ve={key:1},_e={key:0},et={key:1},ne=X({__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},canDeselect:{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},closeOnSelect:{type:Boolean,default:!0},allowAddNew:{type:Boolean,default:!1},addNewMode:{type:String,default:"button",validator:l=>["button","enter"].includes(l)},addNewLabel:{type:String,default:"Add new record"},keyFilters:{type:Array,default:()=>[]}},emits:["update:modelValue","change","clear","deselect","select","focus","blur","add-new"],setup(l,{emit:I}){const n=l,u=I,c=e.ref(null),k=e.ref(null),C=e.ref(null),p=e.ref(""),x=e.ref(!1),N=e.ref(new Set),m=e.ref(null),f=e.ref(null),S=e.ref(null),g=e.ref(!1),w=e.ref(null),j=e.ref(null),T=e.ref(!1),L=e.ref(n.defaultSortKey),$=e.ref(n.defaultSortDirection),z=e.ref(null),H=e.ref(null),D=e.ref(!1),Z=e.ref(null),oe=e.computed(()=>n.size==="sm"?"btn-sm":n.size==="lg"?"btn-lg":n.size==="xl"?"btn-xl":""),ae=e.computed(()=>n.size==="sm"?"form-control-sm":n.size==="lg"?"form-control-lg":n.size==="xl"?"form-control-xl":""),lt=e.computed(()=>U.value===0?[]:W.value.slice(n.maxVisibleChipsDisplay)),K=e.computed(()=>!n.multiple||!n.excludeFromSelectedListKey?E.value:E.value.filter(t=>{const a=F(t);return!a||!a[n.excludeFromSelectedListKey]})),re=e.computed(()=>{const t=K.value;if(t.length===0)return n.placeholder;if(n.multiple){if(t.length===1){const o=O(t[0]);return o?o.join(" → "):t[0]}return`${t.length} items selected`}const a=O(t[0]);return a?a.join(" → "):t[0]}),se=async()=>{await e.nextTick();const t=j.value;if(n.multiple||n.displayMode==="chips"||K.value.length===0||!t){T.value=!1;return}T.value=t.scrollWidth>t.clientWidth},A=t=>t&&(t[n.optionLabel]||t.label||t.name)||"",h=t=>t?t[n.optionValue]||t.id||t.value:null,Y=t=>!n.disabledKey||!t?!1:t.hasOwnProperty(n.disabledKey)&&t[n.disabledKey]!==null,b=t=>t.children&&t.children.length>0,P=(t,a)=>{if(a)return a.split(".").reduce((o,r)=>o&&o[r],t)},F=(t,a=n.items)=>{for(const o of a){if(h(o)===t)return o;if(b(o)){const r=F(t,o.children);if(r)return r}}return null},v=t=>{const a=[];return b(t)&&t.children.forEach(o=>{Y(o)||(a.push(h(o)),a.push(...v(o)))}),a},_=(t,a=n.items,o=[])=>{for(const r of a){if(h(r)===t)return o;if(b(r)){const s=_(t,r.children,[...o,h(r)]);if(s)return s}}return null},E=e.computed(()=>{const t=new Set(Array.isArray(n.modelValue)?n.modelValue:[n.modelValue].filter(Boolean));if(n.multiple&&n.selectAll){const a=o=>{o.forEach(r=>{if(b(r)){const s=r.children.filter(d=>!Y(d));s.length>0&&s.every(d=>t.has(h(d)))&&t.add(h(r)),a(r.children)}})};a(n.items)}return Array.from(t)}),O=(t,a=n.items,o=[])=>{for(const r of a){const s=[...o,A(r)];if(h(r)===t)return s;if(b(r)){const i=O(t,r.children,s);if(i)return i}}return null},ie=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},ee=e.computed(()=>{const t=K.value;if(t.length===0)return n.placeholder;if(n.multiple){if(t.length===1){const o=O(t[0]);return o?ie(o):t[0]}return`${t.length} items selected`}const a=O(t[0]);return a?ie(a):t[0]}),W=e.computed(()=>{if(!n.multiple||K.value.length===0)return[];const t=K.value.map(r=>F(r)).filter(Boolean);if(!n.sortable||!L.value)return t;const a=L.value,o=$.value;return[...t].sort((r,s)=>{const i=P(r,a),d=P(s,a);if(i==null)return 1;if(d==null)return-1;let y=0;return typeof i=="string"&&typeof d=="string"?y=i.localeCompare(d):i>d?y=1:i<d&&(y=-1),o==="desc"?y*-1:y})}),ce=e.computed(()=>W.value.slice(0,n.maxVisibleChipsDisplay)),U=e.computed(()=>{const t=W.value.length-n.maxVisibleChipsDisplay;return t>0?t:0}),de=(t,a)=>{const o=a.toLowerCase();return t.map(r=>{let s=!1;if(n.keyFilters&&n.keyFilters.length>0)for(const d of n.keyFilters){const y=P(r,d);if(y!=null&&String(y).toLowerCase().includes(o)){s=!0;break}}else s=A(r).toLowerCase().includes(o);if(!b(r))return s?r:null;const i=de(r.children,a);return s?{...r,children:r.children}:i.length>0?{...r,children:i}:null}).filter(Boolean)},me=(t,a,o)=>!t||!a?t:[...t].sort((s,i)=>{const d=P(s,a),y=P(i,a);if(d==null)return 1;if(y==null)return-1;let q=0;return typeof d=="string"&&typeof y=="string"?q=d.localeCompare(y):d>y?q=1:d<y&&(q=-1),o==="desc"?q*-1:q}).map(s=>b(s)?{...s,children:me(s.children,a,o)}:s),G=e.computed(()=>{const t=p.value.trim(),a=t?de(n.items,t):n.items;return!n.sortable||!L.value?a:me(a,L.value,$.value)}),nt=t=>{if(n.disableBranchNodes&&b(t)){const s=h(t);ue(s);return}if(Y(t))return;const a=h(t);let o=new Set(E.value);if(n.multiple){const s=o.has(a);if(n.selectAll&&b(t)){const i=v(t);s?(o.delete(a),u("deselect",t),n.deselectAll&&i.forEach(d=>o.delete(d))):(o.add(a),i.forEach(d=>o.add(d)),u("select",t))}else s?(o.delete(a),n.selectAll&&_(a)?.forEach(d=>o.delete(d))):o.add(a)}else{const s=n.modelValue,i=h(t);s===i?(o.clear(),u("deselect",t)):(o.clear(),o.add(i),s!=null&&F(s),u("select",t)),n.closeOnSelect&&M(),e.nextTick(()=>{C.value?.focus()})}let r=Array.from(o);n.multiple&&n.excludeFromSelectedListKey&&(r=r.filter(s=>{const i=F(s);return!i||!i[n.excludeFromSelectedListKey]})),u("update:modelValue",n.multiple?r:r[0]||null),u("change",n.multiple?r:r[0]||null)},te=t=>{if(n.disabled||!t)return;const a=h(t),o=new Set(E.value);o.delete(a),n.selectAll&&(n.deselectAll&&b(t)&&v(t).forEach(d=>o.delete(d)),_(a)?.forEach(i=>o.delete(i)));const r=Array.from(o);u("update:modelValue",r),u("change",r)},ue=t=>{N.value.has(t)?N.value.delete(t):N.value.add(t)},ot=()=>{$.value=$.value==="asc"?"desc":"asc"},at=()=>{const t=n.multiple?[]:null;u("clear"),u("update:modelValue",t),u("change",t),R()},fe=()=>{!n.allowAddNew||!p.value.trim()||(u("add-new",p.value.trim()),M())},rt=()=>{n.allowAddNew&&n.addNewMode==="enter"&&p.value.trim()&&G.value.length===0&&fe()},st=t=>{u("focus",t)},it=async()=>{n.disabled||(R(),x.value=!0,J(),await e.nextTick(),k.value&&C.value&&(m.value=Q.createPopper(C.value,k.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),n.searchable&&(await e.nextTick(),k.value?.querySelector(".tree-search-input")?.focus()))},M=()=>{x.value=!1,p.value="",m.value?.destroy(),m.value=null,u("blur",n.modelValue)},le=()=>x.value?M():it(),ct=async()=>{M(),J(),D.value=!0,await e.nextTick(),H.value&&z.value&&(Z.value=Q.createPopper(z.value,H.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]}))},R=()=>{D.value=!1,Z.value?.destroy(),Z.value=null},pe=()=>D.value?R():ct(),he=t=>{x.value&&!C.value?.contains(t.target)&&!k.value?.contains(t.target)&&M(),D.value&&!z.value?.contains(t.target)&&!H.value?.contains(t.target)&&R(),g.value&&!w.value?.$el?.contains(t.target)&&!f.value?.contains(t.target)&&J()},dt=t=>{c.value?.contains(t.relatedTarget)||M()},mt=async()=>{!T.value||g.value||(M(),R(),g.value=!0,await e.nextTick(),f.value&&w.value&&(S.value=Q.createPopper(w.value.$el,f.value,{placement:"top",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,8]}}]})))},ut=()=>{g.value?J():mt()},J=()=>{g.value=!1,S.value?.destroy(),S.value=null};return e.watch(p,t=>{if(t.trim()){const a=o=>{o.forEach(r=>{b(r)&&(N.value.add(h(r)),a(r.children))})};a(G.value)}}),e.watch(ee,()=>{se()}),e.onMounted(()=>{document.addEventListener("click",he),se()}),e.onUnmounted(()=>{document.removeEventListener("click",he),m.value?.destroy(),Z.value?.destroy(),S.value?.destroy()}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:c,class:"tree-select-wrapper",onFocusin:st,onFocusout:dt},[e.createElementVNode("div",{ref_key:"triggerRef",ref:C,role:"button",tabindex:"0",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[oe.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}]]),onClick:le,onKeydown:[e.withKeys(e.withModifiers(le,["prevent"]),["enter"]),e.withKeys(e.withModifiers(le,["prevent"]),["space"])]},[e.createElementVNode("div",Ae,[e.renderSlot(t.$slots,"display",{selectedItems:W.value,displayText:ee.value,placeholder:l.placeholder,isLoading:l.isLoading,removeItem:te,getItemLabel:A,getItemValue:h,visibleChips:ce.value,hiddenChipsCount:U.value,toggleMorePopover:pe,moreTriggerRef:z.value},()=>[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("div",Te,[e.createElementVNode("span",{ref_key:"textDisplaySpanRef",ref:j,class:"text-truncate",title:T.value?re.value:""},e.toDisplayString(l.isLoading?"Loading data...":ee.value),9,$e),T.value&&!l.isLoading?(e.openBlock(),e.createBlock(B,{key:0,ref_key:"tooltipTriggerIconRef",ref:w,name:"info-circle",class:"tooltip-trigger-icon ms-2 flex-shrink-0",onClick:e.withModifiers(ut,["stop"])},null,512)):e.createCommentVNode("",!0)])):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",ze,[E.value.length===0?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,o=>(e.openBlock(),e.createElementBlock("span",{key:h(o),class:"badge text-bg-primary chip bg-primary"},[e.createTextVNode(e.toDisplayString(A(o))+" ",1),e.createVNode(B,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>te(o),["stop"])},null,8,["onClick"])]))),128)),U.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:z,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(pe,["stop"])}," +"+e.toDisplayString(U.value),513)):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0)],!0)]),e.createElementVNode("div",Pe,[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(at,["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":x.value}])},null,8,["class"]))])],42,Ie),D.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:H,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,o=>(e.openBlock(),e.createElementBlock("div",{key:h(o),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",Oe,e.toDisplayString(A(o)),1),l.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(B,{key:0,name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>te(o),["stop"])},null,8,["onClick"]))]))),128))])],512)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:k,class:"tree-select-dropdown card shadow-lg border-0",onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["prevent"])),onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),style:{"z-index":"1050"}},[e.createElementVNode("div",Re,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=o=>p.value=o),type:"text",class:e.normalizeClass(["form-control tree-search-input",ae.value]),placeholder:"Search...",onKeydown:e.withKeys(e.withModifiers(rt,["prevent"]),["enter"])},null,42,qe)),[[e.vModelText,p.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",je,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=o=>L.value=o),class:e.normalizeClass(["form-select flex-grow-1",ae.value])},[a[4]||(a[4]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,o=>(e.openBlock(),e.createElementBlock("option",{key:o.value,value:o.value},e.toDisplayString(o.label),9,He))),128))],2),[[e.vModelSelect,L.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",oe.value]),disabled:!L.value,onClick:ot},[e.createVNode(B,{name:$.value==="asc"?"asc":"desc"},null,8,["name"])],10,Ze)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(B,{name:"spinner",class:"me-2"}),a[5]||(a[5]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",Ue,[G.value.length>0?(e.openBlock(),e.createElementBlock("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,o=>(e.openBlock(),e.createBlock(Me,{key:h(o),item:o,level:0,"selected-items":E.value,"expanded-items":N.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:nt,onToggleExpand:ue},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",Je,[e.createTextVNode(e.toDisplayString(A(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",Qe,[l.allowAddNew?(e.openBlock(),e.createElementBlock("div",Xe,[l.addNewMode==="button"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-success btn-sm w-100",onClick:fe},[e.createTextVNode(' No items found "Click" to '+e.toDisplayString(l.addNewLabel)+" ",1),p.value.trim()?(e.openBlock(),e.createElementBlock("span",Ye,' : "'+e.toDisplayString(p.value)+'" ',1)):e.createCommentVNode("",!0)])):l.addNewMode==="enter"?(e.openBlock(),e.createElementBlock("span",ve,[e.createTextVNode(' No items found "Press Enter" to '+e.toDisplayString(l.addNewLabel)+" ",1),p.value.trim()?(e.openBlock(),e.createElementBlock("span",_e,' : "'+e.toDisplayString(p.value)+'" ',1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(B,{name:"search",class:"me-1"}),a[6]||(a[6]=e.createTextVNode(" No items found ",-1))]))]))]))],544)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"tooltipRef",ref:f,class:"tree-select-tooltip card shadow-sm py-1 px-2",role:"tooltip",style:{"z-index":"1070"}},e.toDisplayString(re.value),513),[[e.vShow,g.value]])],544))}},[["__scopeId","data-v-5eac2267"]]),tt={install(l){l.component("VSelect",ne)}};V.VSelect=ne,V.default=tt,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(x,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):(x=typeof globalThis<"u"?globalThis:x||self,e(x.VueSelect={},x.Vue,x.Popper))})(this,(function(x,e,X){"use strict";const Y=(l,T)=>{const n=l.__vccOpts||l;for(const[u,d]of T)n[u]=d;return n},Ve={key:0},we={key:1},xe={key:2},Ce={key:3},Se={key:4},Ee={key:5},Ne={key:6},Le={key:7},k=Y({__name:"SvgIcon",props:{name:{type:String,required:!0}},setup(l){const T=l,n=e.computed(()=>({"svg-icon-spin":T.name==="spinner"}));return(u,d)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"1em",height:"1em",class:e.normalizeClass(n.value)},[l.name==="spinner"?(e.openBlock(),e.createElementBlock("g",Ve,d[0]||(d[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",we,d[1]||(d[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",xe,d[2]||(d[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",Ce,d[3]||(d[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",Se,d[4]||(d[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",Ee,d[5]||(d[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",Ne,d[6]||(d[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),l.name==="info-circle"?(e.openBlock(),e.createElementBlock("g",Le,d[7]||(d[7]=[e.createElementVNode("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)]))):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-89f9b7e1"]]),Me={class:"tree-select-item-wrapper"},Ae={key:1,class:"expander-placeholder flex-shrink-0"},Ie=["checked",".indeterminate","disabled"],$e={class:"item-content text-start text-break lh-sm"},Te={key:0,class:"children-wrapper"},ze=Y({__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:T}){const n=l,u=m=>m[n.optionValue]||m.id||m.value,d=m=>!n.disabledKey||!m?!1:m.hasOwnProperty(n.disabledKey)&&m[n.disabledKey]!==null,b=e.computed(()=>n.item.children&&n.item.children.length>0),N=e.computed(()=>n.expandedItems.has(u(n.item))),g=e.computed(()=>n.selectedItems.includes(u(n.item))),C=m=>{let f=[];return m.children&&m.children.forEach(S=>{f.push(u(S)),f.push(...C(S))}),f},A=e.computed(()=>!n.multiple||!n.selectAll||!b.value||g.value?!1:C(n.item).some(f=>n.selectedItems.includes(f)));return(m,f)=>{const S=e.resolveComponent("TreeSelectItem",!0);return e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:e.normalizeClass(["list-group-item list-group-item-action d-flex align-items-start gap-2",{"bg-primary text-white":g.value&&(l.selectMode==="highlight"||!l.multiple)&&!d(l.item)&&!(l.disableBranchNode&&b.value),"is-disabled text-muted bg-light":d(l.item)}]),style:e.normalizeStyle({"padding-left":`${l.level*1.5+1}rem`}),onClick:f[2]||(f[2]=y=>d(l.item)?null:m.$emit("select",l.item))},[b.value?(e.openBlock(),e.createBlock(k,{key:0,name:"chevron-right",class:e.normalizeClass(["expander-icon flex-shrink-0 mt-1",{"rotate-90":N.value}]),onClick:f[0]||(f[0]=e.withModifiers(y=>m.$emit("toggle-expand",u(l.item)),["stop"]))},null,8,["class"])):(e.openBlock(),e.createElementBlock("span",Ae)),l.multiple&&l.selectMode==="checkbox"&&!(l.disableBranchNode&&b.value)?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"tree-checkbox",checked:g.value,".indeterminate":A.value,disabled:d(l.item),onClick:f[1]||(f[1]=e.withModifiers(y=>m.$emit("select",l.item),["stop"]))},null,40,Ie)):e.createCommentVNode("",!0),e.createElementVNode("div",$e,[e.renderSlot(m.$slots,"default",{item:l.item,level:l.level},void 0,!0)])],6),b.value&&N.value?(e.openBlock(),e.createElementBlock("div",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.item.children,y=>(e.openBlock(),e.createBlock(S,{key:u(y),item:y,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:f[3]||(f[3]=V=>m.$emit("select",V)),onToggleExpand:f[4]||(f[4]=V=>m.$emit("toggle-expand",V))},{default:e.withCtx(({item:V,level:H})=>[e.renderSlot(m.$slots,"default",{item:V,level:H},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-a360276c"]]),De=["onKeydown"],Ke={class:"tree-select-display-container"},Pe={key:0,class:"d-flex align-items-center justify-content-start w-100"},Fe=["title"],Re={key:1},Oe={key:0,class:"text-muted"},qe={class:"chip-measure-layer","aria-hidden":"true"},je={class:"chip-label"},He={class:"chip-label"},We={class:"d-flex align-items-center gap-2"},Ze={class:"list-group list-group-flush"},Ue={class:"text-wrap text-start me-2"},Ge={class:"p-2 border-bottom d-flex flex-column gap-2"},Je=["onKeydown"],Qe={key:1,class:"d-flex align-items-center gap-2"},Xe=["value"],Ye=["disabled"],ve={key:0,class:"p-4 text-muted text-center"},_e={key:1,class:"tree-select-body",style:{"max-height":"300px","overflow-y":"auto"}},et={key:0,class:"list-group list-group-flush"},tt={class:"d-flex align-items-center gap-2",style:{"white-space":"wrap"}},lt={key:1,class:"p-3 text-muted text-center"},nt={key:0},ot={key:0},at={key:1},rt={key:0},st={key:1},re=Y({__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},canDeselect:{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:null},closeOnSelect:{type:Boolean,default:!0},allowAddNew:{type:Boolean,default:!1},addNewMode:{type:String,default:"button",validator:l=>["button","enter"].includes(l)},addNewLabel:{type:String,default:"Add new record"},keyFilters:{type:Array,default:()=>[]}},emits:["update:modelValue","change","clear","deselect","select","focus","blur","add-new"],setup(l,{emit:T}){const n=l,u=T,d=e.ref(null),b=e.ref(null),N=e.ref(null),g=e.ref(""),C=e.ref(!1),A=e.ref(new Set),m=e.ref(null),f=e.ref(null),S=e.ref(null),y=e.ref(!1),V=e.ref(null),H=e.ref(null),D=e.ref(!1),I=e.ref(n.defaultSortKey),K=e.ref(n.defaultSortDirection),P=e.ref(null),W=e.ref(null),F=e.ref(!1),Z=e.ref(null),se=e.ref(null),v=e.ref(0),ie=e.computed(()=>n.size==="sm"?"btn-sm":n.size==="lg"?"btn-lg":n.size==="xl"?"btn-xl":""),ce=e.computed(()=>n.size==="sm"?"form-control-sm":n.size==="lg"?"form-control-lg":n.size==="xl"?"form-control-xl":""),ct=e.computed(()=>G.value===0?[]:z.value.slice(ne.value)),R=e.computed(()=>!n.multiple||!n.excludeFromSelectedListKey?M.value:M.value.filter(t=>{const a=L(t);return!a||!a[n.excludeFromSelectedListKey]})),de=e.computed(()=>{const t=R.value;if(t.length===0)return n.placeholder;if(n.multiple){if(t.length===1){const o=q(t[0]);return o?o.join(" → "):t[0]}return`${t.length} items selected`}const a=q(t[0]);return a?a.join(" → "):t[0]}),dt=e.computed(()=>n.multiple?Array.isArray(n.modelValue)?n.modelValue:[]:n.modelValue!==null&&n.modelValue!==void 0?[n.modelValue]:[]),mt=e.computed(()=>dt.value.filter(t=>!L(t))),me=async()=>{await e.nextTick();const t=H.value;if(n.multiple||n.displayMode==="chips"||R.value.length===0||!t){D.value=!1;return}D.value=t.scrollWidth>t.clientWidth},E=t=>t&&(t[n.optionLabel]||t.label||t.name)||"",p=t=>t?t[n.optionValue]||t.id||t.value:null,_=t=>!n.disabledKey||!t?!1:t.hasOwnProperty(n.disabledKey)&&t[n.disabledKey]!==null,B=t=>t.children&&t.children.length>0,O=(t,a)=>{if(a)return a.split(".").reduce((o,r)=>o&&o[r],t)},L=(t,a=n.items)=>{for(const o of a){if(p(o)===t)return o;if(B(o)){const r=L(t,o.children);if(r)return r}}return null},ee=t=>{const a=[];return B(t)&&t.children.forEach(o=>{_(o)||(a.push(p(o)),a.push(...ee(o)))}),a},U=async()=>{await e.nextTick();const t=se.value;if(!t)return;const a=t.querySelector(".chip-measure-layer");if(!a)return;const o=Array.from(a.children);if(!o.length){v.value=0;return}const r=t.clientWidth,s=4,i=40;let c=0,h=0;for(let w=0;w<o.length;w++){const Be=o[w].offsetWidth+s,wt=w<o.length-1?i:0;if(c+Be+wt>r)break;c+=Be,h++}v.value=Math.max(h,1)},te=(t,a=n.items,o=[])=>{for(const r of a){if(p(r)===t)return o;if(B(r)){const s=te(t,r.children,[...o,p(r)]);if(s)return s}}return null},M=e.computed(()=>{const t=new Set(Array.isArray(n.modelValue)?n.modelValue:[n.modelValue].filter(Boolean));if(n.multiple&&n.selectAll){const a=o=>{o.forEach(r=>{if(B(r)){const s=r.children.filter(c=>!_(c));s.length>0&&s.every(c=>t.has(p(c)))&&t.add(p(r)),a(r.children)}})};a(n.items)}return Array.from(t)}),q=(t,a=n.items,o=[])=>{for(const r of a){const s=[...o,E(r)];if(p(r)===t)return s;if(B(r)){const i=q(t,r.children,s);if(i)return i}}return null},ue=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},le=e.computed(()=>{const t=R.value;if(t.length===0)return n.placeholder;if(n.multiple){if(t.length===1){const s=L(t[0]);if(!s)return`${t[0]} (No longer available)`;const i=q(t[0]);return i?ue(i):E(s)}return`${t.length} items selected`}const a=t[0],o=L(a);if(!o)return`${a} (No longer available)`;const r=q(a);return r?ue(r):E(o)}),z=e.computed(()=>{if(!n.multiple||R.value.length===0)return[];const t=R.value.map(r=>{const s=L(r);return s||{[n.optionValue]:r,[n.optionLabel]:`${r} (No longer available)`,__missing:!0}});if(!n.sortable||!I.value)return t;const a=I.value,o=K.value;return[...t].sort((r,s)=>{if(r.__missing)return 1;if(s.__missing)return-1;const i=O(r,a),c=O(s,a);if(i==null)return 1;if(c==null)return-1;let h=0;return typeof i=="string"&&typeof c=="string"?h=i.localeCompare(c):i>c?h=1:i<c&&(h=-1),o==="desc"?h*-1:h})}),fe=e.computed(()=>z.value.slice(0,ne.value)),ne=e.computed(()=>n.maxVisibleChipsDisplay!==null?n.maxVisibleChipsDisplay:Math.max(v.value,1)),G=e.computed(()=>{const t=z.value.length-ne.value;return t>0?t:0}),pe=(t,a)=>{const o=a.toLowerCase();return t.map(r=>{let s=!1;if(n.keyFilters&&n.keyFilters.length>0)for(const c of n.keyFilters){const h=O(r,c);if(h!=null&&String(h).toLowerCase().includes(o)){s=!0;break}}else s=E(r).toLowerCase().includes(o);if(!B(r))return s?r:null;const i=pe(r.children,a);return s?{...r,children:r.children}:i.length>0?{...r,children:i}:null}).filter(Boolean)},he=(t,a,o)=>!t||!a?t:[...t].sort((s,i)=>{const c=O(s,a),h=O(i,a);if(c==null)return 1;if(h==null)return-1;let w=0;return typeof c=="string"&&typeof h=="string"?w=c.localeCompare(h):c>h?w=1:c<h&&(w=-1),o==="desc"?w*-1:w}).map(s=>B(s)?{...s,children:he(s.children,a,o)}:s),J=e.computed(()=>{const t=g.value.trim(),a=t?pe(n.items,t):n.items;return!n.sortable||!I.value?a:he(a,I.value,K.value)}),ut=t=>{if(n.disableBranchNodes&&B(t)){const s=p(t);ge(s);return}if(_(t))return;const a=p(t);let o=new Set(M.value);if(n.multiple){const s=o.has(a);if(n.selectAll&&B(t)){const i=ee(t);s?(o.delete(a),u("deselect",t),n.deselectAll&&i.forEach(c=>o.delete(c))):(o.add(a),i.forEach(c=>o.add(c)),u("select",t))}else s?(o.delete(a),n.selectAll&&te(a)?.forEach(c=>o.delete(c))):o.add(a)}else{const s=n.modelValue,i=p(t);s===i?(o.clear(),u("deselect",t)):(o.clear(),o.add(i),s!=null&&L(s),u("select",t)),n.closeOnSelect&&$(),e.nextTick(()=>{N.value?.focus()})}let r=Array.from(o);n.multiple&&n.excludeFromSelectedListKey&&(r=r.filter(s=>{const i=L(s);return!i||!i[n.excludeFromSelectedListKey]})),u("update:modelValue",n.multiple?r:r[0]||null),u("change",n.multiple?r:r[0]||null)},oe=t=>{if(n.disabled||!t)return;const a=p(t),o=new Set(M.value);o.delete(a),n.selectAll&&(n.deselectAll&&B(t)&&ee(t).forEach(c=>o.delete(c)),te(a)?.forEach(i=>o.delete(i)));const r=Array.from(o);u("update:modelValue",r),u("change",r)},ge=t=>{A.value.has(t)?A.value.delete(t):A.value.add(t)},ft=()=>{K.value=K.value==="asc"?"desc":"asc"},pt=()=>{const t=n.multiple?[]:null;u("clear"),u("update:modelValue",t),u("change",t),j()},ye=()=>{!n.allowAddNew||!g.value.trim()||(u("add-new",g.value.trim()),$())},ht=()=>{n.allowAddNew&&n.addNewMode==="enter"&&g.value.trim()&&J.value.length===0&&ye()},gt=t=>{u("focus",t)},yt=async()=>{n.disabled||(j(),C.value=!0,Q(),await e.nextTick(),b.value&&N.value&&(m.value=X.createPopper(N.value,b.value,{placement:"bottom-start",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8}},{name:"flip",options:{fallbackPlacements:["top-start"]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>{t.elements.popper.style.width=`${t.elements.reference.offsetWidth}px`}}]})),n.searchable&&(await e.nextTick(),b.value?.querySelector(".tree-search-input")?.focus()))},$=()=>{C.value=!1,g.value="",m.value?.destroy(),m.value=null,u("blur",n.modelValue)},ae=()=>C.value?$():yt(),kt=async()=>{$(),Q(),F.value=!0,await e.nextTick(),W.value&&P.value&&(Z.value=X.createPopper(P.value,W.value,{placement:"bottom-end",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,4]}}]}))},j=()=>{F.value=!1,Z.value?.destroy(),Z.value=null},ke=()=>F.value?j():kt(),be=t=>{C.value&&!N.value?.contains(t.target)&&!b.value?.contains(t.target)&&$(),F.value&&!P.value?.contains(t.target)&&!W.value?.contains(t.target)&&j(),y.value&&!V.value?.$el?.contains(t.target)&&!f.value?.contains(t.target)&&Q()},bt=t=>{d.value?.contains(t.relatedTarget)||$()},Bt=async()=>{!D.value||y.value||($(),j(),y.value=!0,await e.nextTick(),f.value&&V.value&&(S.value=X.createPopper(V.value.$el,f.value,{placement:"top",strategy:"fixed",modifiers:[{name:"offset",options:{offset:[0,8]}}]})))},Vt=()=>{y.value?Q():Bt()},Q=()=>{y.value=!1,S.value?.destroy(),S.value=null};return e.watch(g,t=>{if(t.trim()){const a=o=>{o.forEach(r=>{B(r)&&(A.value.add(p(r)),a(r.children))})};a(J.value)}}),e.watch(le,()=>{me()}),e.watch(z,U),e.onMounted(async()=>{document.addEventListener("click",be),window.addEventListener("resize",U),await e.nextTick(),U(),me()}),e.onUnmounted(()=>{document.removeEventListener("click",be),window.removeEventListener("resize",U),m.value?.destroy(),Z.value?.destroy(),S.value?.destroy()}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:d,class:"tree-select-wrapper",onFocusin:gt,onFocusout:bt},[e.createElementVNode("div",{ref_key:"triggerRef",ref:N,role:"button",tabindex:"0",class:e.normalizeClass(["btn tree-select-trigger w-100 d-flex justify-content-between align-items-center tree-select-main",[ie.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"&&M.value.length>0}]]),onClick:ae,onKeydown:[e.withKeys(e.withModifiers(ae,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ae,["prevent"]),["space"])]},[e.createElementVNode("div",Ke,[e.renderSlot(t.$slots,"display",{selectedItems:z.value,displayText:le.value,placeholder:l.placeholder,isLoading:l.isLoading,removeItem:oe,getItemLabel:E,getItemValue:p,visibleChips:fe.value,hiddenChipsCount:G.value,toggleMorePopover:ke,moreTriggerRef:P.value},()=>[!l.multiple||l.displayMode==="text"?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("span",{ref_key:"textDisplaySpanRef",ref:H,class:e.normalizeClass(["text-truncate",{"text-danger":mt.value.length>0}]),title:D.value?de.value:""},e.toDisplayString(l.isLoading?"Loading data...":le.value),11,Fe),D.value&&!l.isLoading?(e.openBlock(),e.createBlock(k,{key:0,ref_key:"tooltipTriggerIconRef",ref:V,name:"info-circle",class:"tooltip-trigger-icon ms-2 flex-shrink-0",onClick:e.withModifiers(Vt,["stop"])},null,512)):e.createCommentVNode("",!0)])):l.multiple&&l.displayMode==="chips"?(e.openBlock(),e.createElementBlock("div",Re,[M.value.length===0?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(l.placeholder),1)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"chips-container",ref_key:"chipsContainerRef",ref:se},[e.createElementVNode("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,o=>(e.openBlock(),e.createElementBlock("span",{key:"measure-"+p(o),class:"badge chip"},[e.createElementVNode("span",je,e.toDisplayString(E(o)),1),e.createVNode(k,{name:"times",class:"chip-remove"})]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,o=>(e.openBlock(),e.createElementBlock("span",{key:p(o),class:e.normalizeClass(["badge chip",o.__missing?"bg-danger text-white":"bg-primary text-white"])},[e.createElementVNode("span",He,e.toDisplayString(E(o)),1),e.createVNode(k,{name:"times",class:"chip-remove",onClick:e.withModifiers(r=>oe(o),["stop"])},null,8,["onClick"])],2))),128)),G.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"moreTriggerRef",ref:P,type:"button",class:"btn btn-sm btn-light more-button",onClick:e.withModifiers(ke,["stop"])}," +"+e.toDisplayString(G.value),513)):e.createCommentVNode("",!0)],512))])):e.createCommentVNode("",!0)],!0)]),e.createElementVNode("div",We,[l.isLoading?(e.openBlock(),e.createBlock(k,{key:0,name:"spinner",class:"loading-icon"})):e.createCommentVNode("",!0),l.showClearButton&&M.value.length>0&&!l.disabled&&!l.isLoading?(e.openBlock(),e.createBlock(k,{key:1,name:"times",onClick:e.withModifiers(pt,["stop"]),class:"clear-icon"})):e.createCommentVNode("",!0),l.isLoading?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:2,name:"chevron-down",class:e.normalizeClass(["transition-transform",{"rotate-180":C.value}])},null,8,["class"]))])],42,De),F.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"morePopoverRef",ref:W,class:"card shadow-lg border-0 more-popover",style:{"z-index":"1060"}},[e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,o=>(e.openBlock(),e.createElementBlock("div",{key:p(o),class:"list-group-item d-flex justify-content-between align-items-center py-1 px-2"},[e.createElementVNode("small",Ue,e.toDisplayString(E(o)),1),l.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(k,{key:0,name:"times",class:"chip-remove flex-shrink-0",onClick:e.withModifiers(r=>oe(o),["stop"])},null,8,["onClick"]))]))),128))])],512)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"dropdownRef",ref:b,class:"tree-select-dropdown card shadow-lg border-0",onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["prevent"])),onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),style:{"z-index":"1050"}},[e.createElementVNode("div",Ge,[l.searchable?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":a[0]||(a[0]=o=>g.value=o),type:"text",class:e.normalizeClass(["form-control tree-search-input",ce.value]),placeholder:"Search...",onKeydown:e.withKeys(e.withModifiers(ht,["prevent"]),["enter"])},null,42,Je)),[[e.vModelText,g.value]]):e.createCommentVNode("",!0),l.sortable&&l.sortOptions.length>0?(e.openBlock(),e.createElementBlock("div",Qe,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=o=>I.value=o),class:e.normalizeClass(["form-select flex-grow-1",ce.value])},[a[4]||(a[4]=e.createElementVNode("option",{value:null,disabled:""},"Sort by...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.sortOptions,o=>(e.openBlock(),e.createElementBlock("option",{key:o.value,value:o.value},e.toDisplayString(o.label),9,Xe))),128))],2),[[e.vModelSelect,I.value]]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["btn btn-outline-secondary",ie.value]),disabled:!I.value,onClick:ft},[e.createVNode(k,{name:K.value==="asc"?"asc":"desc"},null,8,["name"])],10,Ye)])):e.createCommentVNode("",!0)]),l.isLoading?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(k,{name:"spinner",class:"me-2"}),a[5]||(a[5]=e.createElementVNode("span",null,"Loading...",-1))])):(e.openBlock(),e.createElementBlock("div",_e,[J.value.length>0?(e.openBlock(),e.createElementBlock("div",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,o=>(e.openBlock(),e.createBlock(ze,{key:p(o),item:o,level:0,"selected-items":M.value,"expanded-items":A.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:ut,onToggleExpand:ge},{default:e.withCtx(({item:r,level:s})=>[e.renderSlot(t.$slots,"default",{item:r,level:s},()=>[e.createElementVNode("div",tt,[e.createTextVNode(e.toDisplayString(E(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",lt,[l.allowAddNew?(e.openBlock(),e.createElementBlock("div",nt,[l.addNewMode==="button"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-success btn-sm w-100",onClick:ye},[e.createTextVNode(' No items found "Click" to '+e.toDisplayString(l.addNewLabel)+" ",1),g.value.trim()?(e.openBlock(),e.createElementBlock("span",ot,' : "'+e.toDisplayString(g.value)+'" ',1)):e.createCommentVNode("",!0)])):l.addNewMode==="enter"?(e.openBlock(),e.createElementBlock("span",at,[e.createTextVNode(' No items found "Press Enter" to '+e.toDisplayString(l.addNewLabel)+" ",1),g.value.trim()?(e.openBlock(),e.createElementBlock("span",rt,' : "'+e.toDisplayString(g.value)+'" ',1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(k,{name:"search",class:"me-1"}),a[6]||(a[6]=e.createTextVNode(" No items found ",-1))]))]))]))],544)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"tooltipRef",ref:f,class:"tree-select-tooltip card shadow-sm py-1 px-2",role:"tooltip",style:{"z-index":"1070"}},e.toDisplayString(de.value),513),[[e.vShow,y.value]])],544))}},[["__scopeId","data-v-41032f5c"]]),it={install(l){l.component("VSelect",re)}};x.VSelect=re,x.default=it,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|