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

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