@opengis/filter 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/filter.js +1418 -1377
  2. package/filter.umd.cjs +1 -1
  3. package/package.json +1 -1
package/filter.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as O, ref as _, createElementBlock as w, openBlock as f, createElementVNode as u, withModifiers as _e, normalizeClass as D, createCommentVNode as V, toDisplayString as F, computed as I, watch as M, createStaticVNode as Le, Fragment as R, renderList as W, unref as e, createBlock as S, createVNode as N, createTextVNode as z, withDirectives as T, vShow as X, vModelText as G, onMounted as ae, onBeforeUnmount as ce, Teleport as $e, normalizeStyle as Ae, renderSlot as ue, nextTick as fe, isRef as Ee, withCtx as le, resolveDynamicComponent as ee, mergeProps as P, toRaw as Z, cloneVNode as Ie, useSlots as pe } from "vue";
2
- const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = { class: "flex items-center cursor-pointer w-full" }, Ue = {
1
+ import { defineComponent as U, ref as _, createElementBlock as k, openBlock as f, createElementVNode as d, withModifiers as $e, normalizeClass as M, createCommentVNode as $, toDisplayString as j, computed as I, watch as D, createStaticVNode as Le, Fragment as F, renderList as W, unref as e, createBlock as R, createVNode as Y, createTextVNode as N, withDirectives as O, vShow as X, vModelText as G, onMounted as ae, onBeforeUnmount as ce, Teleport as _e, normalizeStyle as Ae, renderSlot as ie, nextTick as fe, isRef as Ee, withCtx as te, resolveDynamicComponent as Z, mergeProps as P, toRaw as ne, cloneVNode as Te, useSlots as pe } from "vue";
2
+ const Ie = { class: "flex items-center justify-between w-full text-sm" }, Oe = { class: "flex items-center cursor-pointer w-full" }, Ue = {
3
3
  key: 0,
4
4
  width: "16",
5
5
  height: "auto",
@@ -7,7 +7,7 @@ const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = {
7
7
  }, ze = ["value"], Ne = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, He = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, Ye = {
8
8
  key: 0,
9
9
  class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
10
- }, me = /* @__PURE__ */ O({
10
+ }, me = /* @__PURE__ */ U({
11
11
  __name: "list-item",
12
12
  props: {
13
13
  layout: {},
@@ -20,44 +20,44 @@ const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = {
20
20
  highlighted: { type: Boolean }
21
21
  },
22
22
  emits: ["itemClick"],
23
- setup(i, { expose: a, emit: v }) {
24
- const t = i, s = v;
23
+ setup(c, { expose: n, emit: b }) {
24
+ const t = c, a = b;
25
25
  function r() {
26
- s("itemClick", t.value);
26
+ a("itemClick", t.value);
27
27
  }
28
- const c = _(null);
29
- return a({ el: c }), (m, d) => (f(), w("div", {
28
+ const i = _(null);
29
+ return n({ el: i }), (p, v) => (f(), k("div", {
30
30
  class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
31
31
  ref_key: "el",
32
- ref: c
32
+ ref: i
33
33
  }, [
34
- u("div", Te, [
35
- u("div", Oe, [
36
- u("label", {
34
+ d("div", Ie, [
35
+ d("div", Oe, [
36
+ d("label", {
37
37
  for: "radio-9740",
38
- class: D([
39
- ["inline", "popover"].includes(m.layout) ? "text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center" : "flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",
40
- { "bg-blue-100": m.highlighted }
38
+ class: M([
39
+ ["inline", "popover"].includes(p.layout) ? "text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center" : "flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",
40
+ { "bg-blue-100": p.highlighted }
41
41
  ]),
42
- onClick: _e(r, ["stop", "prevent"])
42
+ onClick: $e(r, ["stop", "prevent"])
43
43
  }, [
44
- u("div", {
45
- class: D(["w-[18px] h-[18px] border flex items-center justify-center", [
46
- m.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
47
- m.color ? `bg-[${m.color}] border-[#ffffff]` : m.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
44
+ d("div", {
45
+ class: M(["w-[18px] h-[18px] border flex items-center justify-center", [
46
+ p.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
47
+ p.color ? `bg-[${p.color}] border-[#ffffff]` : p.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
48
48
  ]])
49
49
  }, [
50
- m.isSelected ? (f(), w("img", Ue)) : V("", !0)
50
+ p.isSelected ? (f(), k("img", Ue)) : $("", !0)
51
51
  ], 2),
52
- u("input", {
52
+ d("input", {
53
53
  type: "checkbox",
54
54
  class: "hidden",
55
55
  id: "radio-9740",
56
- value: m.value
56
+ value: p.value
57
57
  }, null, 8, ze),
58
- u("div", Ne, [
59
- u("span", He, F(m.label ?? "Відсутні данні"), 1),
60
- m.count ? (f(), w("div", Ye, " (" + F(m.count) + ") ", 1)) : V("", !0)
58
+ d("div", Ne, [
59
+ d("span", He, j(p.label ?? "Відсутні данні"), 1),
60
+ p.count ? (f(), k("div", Ye, " (" + j(p.count) + ") ", 1)) : $("", !0)
61
61
  ])
62
62
  ], 2)
63
63
  ])
@@ -65,71 +65,71 @@ const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = {
65
65
  ], 512));
66
66
  }
67
67
  });
68
- function Be(i, a) {
68
+ function Se(c, n) {
69
69
  const {
70
- options: v = [],
70
+ options: b = [],
71
71
  limit: t = 20
72
- } = i;
73
- function s(l) {
74
- return Array.isArray(l) ? l[0] : l;
75
- }
76
- const r = _(s(i.modelValue)), c = _(""), m = _(!1), d = _([]), x = _("id"), p = _("text"), n = _(!1), o = _(i.layout !== "popover" && v.length > t);
77
- function h(l) {
78
- const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
79
- return { autoValueKey: K, autoLabelKey: A };
80
- }
81
- if (v.length > 0) {
82
- const l = h(v);
83
- x.value = l.autoValueKey, p.value = l.autoLabelKey;
84
- }
85
- const g = I(() => {
86
- const l = d.value;
87
- return i.layout === "popover" || n.value ? l : l.slice(0, t);
72
+ } = c;
73
+ function a(o) {
74
+ return Array.isArray(o) ? o[0] : o;
75
+ }
76
+ const r = _(a(c.modelValue)), i = _(""), p = _(!1), v = _([]), h = _("id"), u = _("text"), s = _(!1), m = _(c.layout !== "popover" && b.length > t);
77
+ function C(o) {
78
+ const x = o.find(Boolean) ?? {}, S = ["id", "value", "code", "key"].find((K) => K in x) ?? "id", B = ["text", "label", "name", "title"].find((K) => K in x) ?? "text";
79
+ return { autoValueKey: S, autoLabelKey: B };
80
+ }
81
+ if (b.length > 0) {
82
+ const o = C(b);
83
+ h.value = o.autoValueKey, u.value = o.autoLabelKey;
84
+ }
85
+ const y = I(() => {
86
+ const o = v.value;
87
+ return c.layout === "popover" || s.value ? o : o.slice(0, t);
88
88
  });
89
- M(() => i.modelValue, (l) => {
90
- r.value = s(l);
91
- }, { immediate: !0 }), d.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value] ?? "").localeCompare(String(b[p.value] ?? "")) : 0);
92
- function k(l) {
93
- return r.value === l[x.value];
89
+ D(() => c.modelValue, (o) => {
90
+ r.value = a(o);
91
+ }, { immediate: !0 }), v.value = [...b].sort((o, x) => c.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : c.sort === "name" ? String(o[u.value] ?? "").localeCompare(String(x[u.value] ?? "")) : 0);
92
+ function g(o) {
93
+ return r.value === o[h.value];
94
94
  }
95
- function y(l) {
96
- r.value = l[x.value], a("update:modelValue", r.value), a("change", { name: i.name, value: r.value });
95
+ function l(o) {
96
+ r.value = o[h.value], n("update:modelValue", r.value), n("change", { name: c.name, value: r.value });
97
97
  }
98
- function $() {
99
- r.value = void 0, a("update:modelValue", r.value), a("clear", i.name);
98
+ function V() {
99
+ r.value = void 0, n("update:modelValue", r.value), n("clear", c.name);
100
100
  }
101
- function C() {
102
- n.value = !n.value;
101
+ function w() {
102
+ s.value = !s.value;
103
103
  }
104
104
  return {
105
105
  innerValue: r,
106
- searchTerm: c,
107
- filteredOptions: g,
108
- isSelected: k,
109
- selectItem: y,
110
- clear: $,
111
- toggleShowAll: C,
112
- isReqProc: m,
113
- showAll: n,
114
- isEnableShowAll: o,
115
- labelKey: p,
116
- valueKey: x,
117
- allOptions: d
106
+ searchTerm: i,
107
+ filteredOptions: y,
108
+ isSelected: g,
109
+ selectItem: l,
110
+ clear: V,
111
+ toggleShowAll: w,
112
+ isReqProc: p,
113
+ showAll: s,
114
+ isEnableShowAll: m,
115
+ labelKey: u,
116
+ valueKey: h,
117
+ allOptions: v
118
118
  };
119
119
  }
120
- const J = (i, a) => {
121
- const v = i.__vccOpts || i;
122
- for (const [t, s] of a)
123
- v[t] = s;
124
- return v;
120
+ const J = (c, n) => {
121
+ const b = c.__vccOpts || c;
122
+ for (const [t, a] of n)
123
+ b[t] = a;
124
+ return b;
125
125
  }, Pe = {}, We = {
126
126
  class: "w-48 mx-auto",
127
127
  viewBox: "0 0 178 90",
128
128
  fill: "none",
129
129
  xmlns: "http://www.w3.org/2000/svg"
130
130
  };
131
- function qe(i, a) {
132
- return f(), w("svg", We, a[0] || (a[0] = [
131
+ function qe(c, n) {
132
+ return f(), k("svg", We, n[0] || (n[0] = [
133
133
  Le('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
134
134
  ]));
135
135
  }
@@ -145,17 +145,17 @@ const ve = /* @__PURE__ */ J(Pe, [["render", qe]]), Qe = {}, Ge = {
145
145
  "stroke-linejoin": "round",
146
146
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
147
147
  };
148
- function Xe(i, a) {
149
- return f(), w("svg", Ge, a[0] || (a[0] = [
150
- u("path", {
148
+ function Xe(c, n) {
149
+ return f(), k("svg", Ge, n[0] || (n[0] = [
150
+ d("path", {
151
151
  stroke: "none",
152
152
  d: "M0 0h24v24H0z",
153
153
  fill: "none"
154
154
  }, null, -1),
155
- u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
155
+ d("path", { d: "M6 9l6 6l6 -6" }, null, -1)
156
156
  ]));
157
157
  }
158
- const ie = /* @__PURE__ */ J(Qe, [["render", Xe]]), Je = {}, Ze = {
158
+ const ue = /* @__PURE__ */ J(Qe, [["render", Xe]]), Je = {}, Ze = {
159
159
  xmlns: "http://www.w3.org/2000/svg",
160
160
  width: "24",
161
161
  height: "24",
@@ -167,14 +167,14 @@ const ie = /* @__PURE__ */ J(Qe, [["render", Xe]]), Je = {}, Ze = {
167
167
  "stroke-linejoin": "round",
168
168
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
169
169
  };
170
- function et(i, a) {
171
- return f(), w("svg", Ze, a[0] || (a[0] = [
172
- u("path", {
170
+ function et(c, n) {
171
+ return f(), k("svg", Ze, n[0] || (n[0] = [
172
+ d("path", {
173
173
  stroke: "none",
174
174
  d: "M0 0h24v24H0z",
175
175
  fill: "none"
176
176
  }, null, -1),
177
- u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
177
+ d("path", { d: "M6 9l6 6l6 -6" }, null, -1)
178
178
  ]));
179
179
  }
180
180
  const ye = /* @__PURE__ */ J(Je, [["render", et]]), tt = {
@@ -186,7 +186,7 @@ const ye = /* @__PURE__ */ J(Je, [["render", et]]), tt = {
186
186
  }, nt = {
187
187
  key: 1,
188
188
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
189
- }, at = /* @__PURE__ */ O({
189
+ }, at = /* @__PURE__ */ U({
190
190
  __name: "radio",
191
191
  props: {
192
192
  id: {},
@@ -212,170 +212,170 @@ const ye = /* @__PURE__ */ J(Je, [["render", et]]), tt = {
212
212
  sort: {}
213
213
  },
214
214
  emits: ["update:modelValue", "change", "clear"],
215
- setup(i, { expose: a, emit: v }) {
216
- const t = i, s = _(null), r = v, {
217
- innerValue: c,
218
- filteredOptions: m,
219
- isSelected: d,
220
- selectItem: x,
221
- clear: p,
222
- toggleShowAll: n,
223
- isReqProc: o,
224
- showAll: h,
225
- isEnableShowAll: g,
226
- labelKey: k,
227
- valueKey: y,
228
- allOptions: $
229
- } = Be({
215
+ setup(c, { expose: n, emit: b }) {
216
+ const t = c, a = _(null), r = b, {
217
+ innerValue: i,
218
+ filteredOptions: p,
219
+ isSelected: v,
220
+ selectItem: h,
221
+ clear: u,
222
+ toggleShowAll: s,
223
+ isReqProc: m,
224
+ showAll: C,
225
+ isEnableShowAll: y,
226
+ labelKey: g,
227
+ valueKey: l,
228
+ allOptions: V
229
+ } = Se({
230
230
  ...t,
231
231
  modelValue: t.modelValue ?? t.default ?? ""
232
232
  }, r);
233
- return a({
234
- clear: p,
235
- inputTextRef: s
236
- }), M(
233
+ return n({
234
+ clear: u,
235
+ inputTextRef: a
236
+ }), D(
237
237
  () => t.modelValue,
238
- (C) => {
239
- C === void 0 && (c.value = void 0);
238
+ (w) => {
239
+ w === void 0 && (i.value = void 0);
240
240
  }
241
- ), (C, l) => (f(), w("div", {
242
- class: D([C.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
241
+ ), (w, o) => (f(), k("div", {
242
+ class: M([w.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
243
243
  }, [
244
- u("div", {
245
- class: D([
246
- C.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
247
- C.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
244
+ d("div", {
245
+ class: M([
246
+ w.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
247
+ w.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
248
248
  ])
249
249
  }, [
250
- (f(!0), w(R, null, W(e(m), (b) => (f(), S(me, {
251
- layout: C.layout,
252
- key: b[e(y)],
253
- count: b.count,
254
- label: b[e(k)],
255
- color: b.color,
250
+ (f(!0), k(F, null, W(e(p), (x) => (f(), R(me, {
251
+ layout: w.layout,
252
+ key: x[e(l)],
253
+ count: x.count,
254
+ label: x[e(g)],
255
+ color: x.color,
256
256
  type: "radio",
257
- value: b[e(y)],
258
- "is-selected": e(d)(b),
259
- onItemClick: (K) => e(x)(b)
257
+ value: x[e(l)],
258
+ "is-selected": e(v)(x),
259
+ onItemClick: (S) => e(h)(x)
260
260
  }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
261
261
  ], 2),
262
- C.type === "select" && e(m).length === 0 && !e(o) ? (f(), w("div", tt, [
263
- u("div", lt, [
264
- N(ve),
265
- l[4] || (l[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
266
- u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
267
- u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
262
+ w.type === "select" && e(p).length === 0 && !e(m) ? (f(), k("div", tt, [
263
+ d("div", lt, [
264
+ Y(ve),
265
+ o[4] || (o[4] = d("div", { class: "max-w-sm mx-auto mt-6" }, [
266
+ d("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
267
+ d("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
268
268
  ], -1))
269
269
  ])
270
- ])) : V("", !0),
271
- C.layout !== "popover" && C.type !== "select" ? (f(), w(R, { key: 1 }, [
272
- !e(h) && e(g) ? (f(), w("div", {
270
+ ])) : $("", !0),
271
+ w.layout !== "popover" && w.type !== "select" ? (f(), k(F, { key: 1 }, [
272
+ !e(C) && e(y) ? (f(), k("div", {
273
273
  key: 0,
274
- onClick: l[0] || (l[0] = //@ts-ignore
275
- (...b) => e(n) && e(n)(...b)),
274
+ onClick: o[0] || (o[0] = //@ts-ignore
275
+ (...x) => e(s) && e(s)(...x)),
276
276
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
277
277
  }, [
278
- l[5] || (l[5] = z(" Показати більше ", -1)),
279
- N(ie)
280
- ])) : V("", !0),
281
- e(h) ? (f(), w("div", {
278
+ o[5] || (o[5] = N(" Показати більше ", -1)),
279
+ Y(ue)
280
+ ])) : $("", !0),
281
+ e(C) ? (f(), k("div", {
282
282
  key: 1,
283
- onClick: l[1] || (l[1] = //@ts-ignore
284
- (...b) => e(n) && e(n)(...b)),
283
+ onClick: o[1] || (o[1] = //@ts-ignore
284
+ (...x) => e(s) && e(s)(...x)),
285
285
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
286
286
  }, [
287
- l[6] || (l[6] = z(" Показати менше ", -1)),
288
- N(ye)
289
- ])) : V("", !0)
290
- ], 64)) : V("", !0),
291
- C.cleanable ? (f(), w(R, { key: 2 }, [
292
- C.layout === "inline" ? (f(), w("div", ot, [
293
- z(F(e(c) || e(c) === null ? 1 : 0) + " з " + F(e($).length) + " обрано ", 1),
294
- T(u("button", {
287
+ o[6] || (o[6] = N(" Показати менше ", -1)),
288
+ Y(ye)
289
+ ])) : $("", !0)
290
+ ], 64)) : $("", !0),
291
+ w.cleanable ? (f(), k(F, { key: 2 }, [
292
+ w.layout === "inline" ? (f(), k("div", ot, [
293
+ N(j(e(i) || e(i) === null ? 1 : 0) + " з " + j(e(V).length) + " обрано ", 1),
294
+ O(d("button", {
295
295
  class: "text-gray-600 hover:text-gray-800",
296
- onClick: l[2] || (l[2] = //@ts-ignore
297
- (...b) => e(p) && e(p)(...b))
296
+ onClick: o[2] || (o[2] = //@ts-ignore
297
+ (...x) => e(u) && e(u)(...x))
298
298
  }, " Очистити ", 512), [
299
- [X, e(c) !== "" && e(c) !== void 0]
299
+ [X, e(i) !== "" && e(i) !== void 0]
300
300
  ])
301
- ])) : V("", !0),
302
- C.layout === "popover" ? (f(), w("div", nt, [
303
- u("span", null, F(e(c) || e(c) === null ? 1 : 0) + " з " + F(e($).length) + " обрано", 1),
304
- T(u("button", {
301
+ ])) : $("", !0),
302
+ w.layout === "popover" ? (f(), k("div", nt, [
303
+ d("span", null, j(e(i) || e(i) === null ? 1 : 0) + " з " + j(e(V).length) + " обрано", 1),
304
+ O(d("button", {
305
305
  class: "text-gray-600 hover:text-gray-800",
306
- onClick: l[3] || (l[3] = //@ts-ignore
307
- (...b) => e(p) && e(p)(...b))
306
+ onClick: o[3] || (o[3] = //@ts-ignore
307
+ (...x) => e(u) && e(u)(...x))
308
308
  }, " Очистити ", 512), [
309
- [X, e(c) !== "" && e(c) !== void 0]
309
+ [X, e(i) !== "" && e(i) !== void 0]
310
310
  ])
311
- ])) : V("", !0)
312
- ], 64)) : V("", !0)
311
+ ])) : $("", !0)
312
+ ], 64)) : $("", !0)
313
313
  ], 2));
314
314
  }
315
315
  });
316
- function Se(i, a) {
316
+ function Be(c, n) {
317
317
  const {
318
- options: v = [],
318
+ options: b = [],
319
319
  limit: t = 20
320
- } = i;
321
- function s(l) {
322
- return Array.isArray(l) ? l : l ? [l] : [];
323
- }
324
- const r = _(s(i.modelValue)), c = _(""), m = _(!1), d = _([]), x = _("id"), p = _("text"), n = _(!1), o = _(i.layout !== "popover" && v.length > t);
325
- function h(l) {
326
- const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
327
- return { autoValueKey: K, autoLabelKey: A };
328
- }
329
- if (v.length > 0) {
330
- const l = h(v);
331
- x.value = l.autoValueKey, p.value = l.autoLabelKey;
332
- }
333
- const g = I(() => {
334
- const l = d.value;
335
- return i.layout === "popover" || n.value ? l : l.slice(0, t);
320
+ } = c;
321
+ function a(o) {
322
+ return Array.isArray(o) ? o : o ? [o] : [];
323
+ }
324
+ const r = _(a(c.modelValue)), i = _(""), p = _(!1), v = _([]), h = _("id"), u = _("text"), s = _(!1), m = _(c.layout !== "popover" && b.length > t);
325
+ function C(o) {
326
+ const x = o.find(Boolean) ?? {}, S = ["id", "value", "code", "key"].find((K) => K in x) ?? "id", B = ["text", "label", "name", "title"].find((K) => K in x) ?? "text";
327
+ return { autoValueKey: S, autoLabelKey: B };
328
+ }
329
+ if (b.length > 0) {
330
+ const o = C(b);
331
+ h.value = o.autoValueKey, u.value = o.autoLabelKey;
332
+ }
333
+ const y = I(() => {
334
+ const o = v.value;
335
+ return c.layout === "popover" || s.value ? o : o.slice(0, t);
336
336
  });
337
- M(() => i.modelValue, (l) => {
338
- r.value = s(l);
339
- }, { immediate: !0 }), d.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value]).localeCompare(String(b[p.value])) : 0);
340
- function k(l) {
341
- return r.value && r.value.includes(l[x.value]);
337
+ D(() => c.modelValue, (o) => {
338
+ r.value = a(o);
339
+ }, { immediate: !0 }), v.value = [...b].sort((o, x) => c.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : c.sort === "name" ? String(o[u.value]).localeCompare(String(x[u.value])) : 0);
340
+ function g(o) {
341
+ return r.value && r.value.includes(o[h.value]);
342
342
  }
343
- function y(l) {
344
- const b = r.value.includes(l[x.value]);
345
- r.value = b ? r.value.filter((K) => K !== l[x.value]) : [...r.value, l[x.value]], a("update:modelValue", r.value), a("change", { name: i.name, value: r.value });
343
+ function l(o) {
344
+ const x = r.value.includes(o[h.value]);
345
+ r.value = x ? r.value.filter((S) => S !== o[h.value]) : [...r.value, o[h.value]], n("update:modelValue", r.value), n("change", { name: c.name, value: r.value });
346
346
  }
347
- function $() {
348
- r.value = [], a("update:modelValue", r.value), a("clear", i.name);
347
+ function V() {
348
+ r.value = [], n("update:modelValue", r.value), n("clear", c.name);
349
349
  }
350
- function C() {
351
- n.value = !n.value;
350
+ function w() {
351
+ s.value = !s.value;
352
352
  }
353
353
  return {
354
354
  innerValue: r,
355
- searchTerm: c,
356
- filteredOptions: g,
357
- isSelected: k,
358
- selectItem: y,
359
- clear: $,
360
- toggleShowAll: C,
361
- isReqProc: m,
362
- showAll: n,
363
- isEnableShowAll: o,
364
- labelKey: p,
365
- valueKey: x,
366
- allOptions: d
355
+ searchTerm: i,
356
+ filteredOptions: y,
357
+ isSelected: g,
358
+ selectItem: l,
359
+ clear: V,
360
+ toggleShowAll: w,
361
+ isReqProc: p,
362
+ showAll: s,
363
+ isEnableShowAll: m,
364
+ labelKey: u,
365
+ valueKey: h,
366
+ allOptions: v
367
367
  };
368
368
  }
369
369
  const rt = {
370
370
  key: 0,
371
371
  class: "w-full"
372
- }, st = { class: "flex flex-col items-center justify-center p-5 text-center" }, ut = {
372
+ }, st = { class: "flex flex-col items-center justify-center p-5 text-center" }, it = {
373
373
  key: 0,
374
374
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
375
- }, it = {
375
+ }, ut = {
376
376
  key: 1,
377
377
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
378
- }, xe = /* @__PURE__ */ O({
378
+ }, xe = /* @__PURE__ */ U({
379
379
  __name: "checkbox",
380
380
  props: {
381
381
  id: {},
@@ -401,102 +401,102 @@ const rt = {
401
401
  sort: {}
402
402
  },
403
403
  emits: ["update:modelValue", "change", "clear"],
404
- setup(i, { expose: a, emit: v }) {
405
- const t = i, s = v, {
404
+ setup(c, { expose: n, emit: b }) {
405
+ const t = c, a = b, {
406
406
  innerValue: r,
407
- filteredOptions: c,
408
- isSelected: m,
409
- selectItem: d,
410
- clear: x,
411
- toggleShowAll: p,
412
- isReqProc: n,
413
- showAll: o,
414
- isEnableShowAll: h,
415
- labelKey: g,
416
- valueKey: k,
417
- allOptions: y
418
- } = Se({
407
+ filteredOptions: i,
408
+ isSelected: p,
409
+ selectItem: v,
410
+ clear: h,
411
+ toggleShowAll: u,
412
+ isReqProc: s,
413
+ showAll: m,
414
+ isEnableShowAll: C,
415
+ labelKey: y,
416
+ valueKey: g,
417
+ allOptions: l
418
+ } = Be({
419
419
  ...t,
420
420
  modelValue: t.modelValue
421
- }, s);
422
- return M(
421
+ }, a);
422
+ return D(
423
423
  () => t.modelValue,
424
- ($) => {
425
- $ === void 0 && (r.value = []);
424
+ (V) => {
425
+ V === void 0 && (r.value = []);
426
426
  }
427
- ), a({
428
- clear: x
429
- }), ($, C) => (f(), w("div", {
430
- class: D([$.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
427
+ ), n({
428
+ clear: h
429
+ }), (V, w) => (f(), k("div", {
430
+ class: M([V.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
431
431
  }, [
432
- u("div", {
433
- class: D([
434
- $.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
435
- $.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
432
+ d("div", {
433
+ class: M([
434
+ V.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
435
+ V.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
436
436
  ])
437
437
  }, [
438
- (f(!0), w(R, null, W(e(c), (l) => (f(), S(me, {
439
- layout: $.layout,
440
- count: l.count,
441
- label: l[e(g)],
442
- color: l.color,
438
+ (f(!0), k(F, null, W(e(i), (o) => (f(), R(me, {
439
+ layout: V.layout,
440
+ count: o.count,
441
+ label: o[e(y)],
442
+ color: o.color,
443
443
  type: "checkbox",
444
- value: l[e(k)],
445
- "is-selected": e(m)(l),
446
- onItemClick: (b) => e(d)(l)
444
+ value: o[e(g)],
445
+ "is-selected": e(p)(o),
446
+ onItemClick: (x) => e(v)(o)
447
447
  }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
448
448
  ], 2),
449
- $.type === "select" && e(c).length === 0 && !e(n) ? (f(), w("div", rt, [
450
- u("div", st, [
451
- N(ve),
452
- C[4] || (C[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
453
- u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
454
- u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
449
+ V.type === "select" && e(i).length === 0 && !e(s) ? (f(), k("div", rt, [
450
+ d("div", st, [
451
+ Y(ve),
452
+ w[4] || (w[4] = d("div", { class: "max-w-sm mx-auto mt-6" }, [
453
+ d("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
454
+ d("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
455
455
  ], -1))
456
456
  ])
457
- ])) : V("", !0),
458
- $.layout !== "popover" && $.type !== "select" ? (f(), w(R, { key: 1 }, [
459
- !e(o) && e(h) ? (f(), w("div", {
457
+ ])) : $("", !0),
458
+ V.layout !== "popover" && V.type !== "select" ? (f(), k(F, { key: 1 }, [
459
+ !e(m) && e(C) ? (f(), k("div", {
460
460
  key: 0,
461
- onClick: C[0] || (C[0] = //@ts-ignore
462
- (...l) => e(p) && e(p)(...l)),
461
+ onClick: w[0] || (w[0] = //@ts-ignore
462
+ (...o) => e(u) && e(u)(...o)),
463
463
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
464
464
  }, [
465
- C[5] || (C[5] = z(" Показати більше ", -1)),
466
- N(ie)
467
- ])) : V("", !0),
468
- e(o) ? (f(), w("div", {
465
+ w[5] || (w[5] = N(" Показати більше ", -1)),
466
+ Y(ue)
467
+ ])) : $("", !0),
468
+ e(m) ? (f(), k("div", {
469
469
  key: 1,
470
- onClick: C[1] || (C[1] = //@ts-ignore
471
- (...l) => e(p) && e(p)(...l)),
470
+ onClick: w[1] || (w[1] = //@ts-ignore
471
+ (...o) => e(u) && e(u)(...o)),
472
472
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
473
473
  }, [
474
- C[6] || (C[6] = z(" Показати менше ", -1)),
475
- N(ye)
476
- ])) : V("", !0)
477
- ], 64)) : V("", !0),
478
- $.cleanable ? (f(), w(R, { key: 2 }, [
479
- $.layout === "inline" ? (f(), w("div", ut, [
480
- z(F(e(r).length) + " з " + F(e(y).length) + " обрано ", 1),
481
- T(u("button", {
474
+ w[6] || (w[6] = N(" Показати менше ", -1)),
475
+ Y(ye)
476
+ ])) : $("", !0)
477
+ ], 64)) : $("", !0),
478
+ V.cleanable ? (f(), k(F, { key: 2 }, [
479
+ V.layout === "inline" ? (f(), k("div", it, [
480
+ N(j(e(r).length) + " з " + j(e(l).length) + " обрано ", 1),
481
+ O(d("button", {
482
482
  class: "text-gray-600 hover:text-gray-800",
483
- onClick: C[2] || (C[2] = //@ts-ignore
484
- (...l) => e(x) && e(x)(...l))
483
+ onClick: w[2] || (w[2] = //@ts-ignore
484
+ (...o) => e(h) && e(h)(...o))
485
485
  }, " Очистити ", 512), [
486
486
  [X, e(r).length !== 0]
487
487
  ])
488
- ])) : V("", !0),
489
- $.layout === "popover" ? (f(), w("div", it, [
490
- u("span", null, F(e(r).length) + " з " + F(e(y).length) + " обрано", 1),
491
- T(u("button", {
488
+ ])) : $("", !0),
489
+ V.layout === "popover" ? (f(), k("div", ut, [
490
+ d("span", null, j(e(r).length) + " з " + j(e(l).length) + " обрано", 1),
491
+ O(d("button", {
492
492
  class: "text-gray-600 hover:text-gray-800",
493
- onClick: C[3] || (C[3] = //@ts-ignore
494
- (...l) => e(x) && e(x)(...l))
493
+ onClick: w[3] || (w[3] = //@ts-ignore
494
+ (...o) => e(h) && e(h)(...o))
495
495
  }, " Очистити ", 512), [
496
496
  [X, e(r).length !== 0]
497
497
  ])
498
- ])) : V("", !0)
499
- ], 64)) : V("", !0)
498
+ ])) : $("", !0)
499
+ ], 64)) : $("", !0)
500
500
  ], 2));
501
501
  }
502
502
  }), dt = {}, ct = {
@@ -511,18 +511,18 @@ const rt = {
511
511
  "stroke-linejoin": "round",
512
512
  class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
513
513
  };
514
- function ft(i, a) {
515
- return f(), w("svg", ct, a[0] || (a[0] = [
516
- u("path", {
514
+ function ft(c, n) {
515
+ return f(), k("svg", ct, n[0] || (n[0] = [
516
+ d("path", {
517
517
  stroke: "none",
518
518
  d: "M0 0h24v24H0z",
519
519
  fill: "none"
520
520
  }, null, -1),
521
- u("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1),
522
- u("path", { d: "M21 21l-6 -6" }, null, -1)
521
+ d("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1),
522
+ d("path", { d: "M21 21l-6 -6" }, null, -1)
523
523
  ]));
524
524
  }
525
- const De = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
525
+ const Re = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
526
526
  xmlns: "http://www.w3.org/2000/svg",
527
527
  viewBox: "0 0 24 24",
528
528
  fill: "none",
@@ -534,24 +534,24 @@ const De = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
534
534
  width: "15px",
535
535
  height: "15px"
536
536
  };
537
- function vt(i, a) {
538
- return f(), w("svg", mt, a[0] || (a[0] = [
539
- u("path", {
537
+ function vt(c, n) {
538
+ return f(), k("svg", mt, n[0] || (n[0] = [
539
+ d("path", {
540
540
  stroke: "none",
541
541
  d: "M0 0h24v24H0z",
542
542
  fill: "none"
543
543
  }, null, -1),
544
- u("path", { d: "M18 6l-12 12" }, null, -1),
545
- u("path", { d: "M6 6l12 12" }, null, -1)
544
+ d("path", { d: "M18 6l-12 12" }, null, -1),
545
+ d("path", { d: "M6 6l12 12" }, null, -1)
546
546
  ]));
547
547
  }
548
- const Re = /* @__PURE__ */ J(pt, [["render", vt]]);
548
+ const De = /* @__PURE__ */ J(pt, [["render", vt]]);
549
549
  class de {
550
- static getWidthClass(a) {
551
- return typeof a == "number" ? `max-w-[${a}px]` : typeof a == "string" ? a.endsWith("%") || a.endsWith("px") ? `max-w-[${a}]` : `max-w-${a}` : "w-full";
550
+ static getWidthClass(n) {
551
+ return typeof n == "number" ? `max-w-[${n}px]` : typeof n == "string" ? n.endsWith("%") || n.endsWith("px") ? `max-w-[${n}]` : `max-w-${n}` : "w-full";
552
552
  }
553
553
  }
554
- const yt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, gt = ["placeholder"], bt = /* @__PURE__ */ O({
554
+ const yt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, gt = ["placeholder"], bt = /* @__PURE__ */ U({
555
555
  __name: "text-input",
556
556
  props: {
557
557
  id: {},
@@ -577,52 +577,59 @@ const yt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
577
577
  sort: {}
578
578
  },
579
579
  emits: ["update:modelValue", "change", "clear"],
580
- setup(i, { emit: a }) {
581
- const v = i, t = _((v.placeHolder || v.label || v.name).toString()), s = a, r = _(v.modelValue ?? "");
582
- M(
583
- () => v.modelValue,
584
- (d) => {
585
- d !== r.value && (r.value = d ?? "");
580
+ setup(c, { emit: n }) {
581
+ const b = c, t = _((b.placeHolder || b.label || b.name || "search").toString()), a = n, r = _(b.modelValue?.toString() ?? "");
582
+ D(
583
+ () => b.modelValue,
584
+ (h) => {
585
+ h !== r.value && (r.value = h?.toString() ?? "");
586
586
  }
587
587
  );
588
- function c() {
589
- s("update:modelValue", r.value), s("change", { name: v.name, value: r.value });
588
+ let i = null;
589
+ function p() {
590
+ if (r.value = r.value.trimStart(), r.value.length === 0) {
591
+ v();
592
+ return;
593
+ }
594
+ i && clearTimeout(i), i = setTimeout(() => {
595
+ a("update:modelValue", r.value), a("change", { name: b.name, value: r.value });
596
+ }, 300);
590
597
  }
591
- function m() {
592
- r.value = "", s("update:modelValue", ""), s("clear", v.name);
598
+ function v() {
599
+ r.value = "", a("update:modelValue", ""), a("clear", b.name);
593
600
  }
594
- return (d, x) => (f(), w("div", {
595
- class: D([
601
+ return (h, u) => (f(), k("div", {
602
+ class: M([
596
603
  "vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",
597
- d.layout === "inline" ? e(de).getWidthClass(d.width) : "mb-2" + (d.layout === "popover" ? " m-2" : "")
604
+ h.layout === "inline" ? e(de).getWidthClass(h.width) : "mb-2" + (h.layout === "popover" ? " m-2" : "")
598
605
  ])
599
606
  }, [
600
- u("div", yt, [
601
- N(De)
607
+ d("div", yt, [
608
+ Y(Re)
602
609
  ]),
603
- r.value !== "" ? (f(), w("div", {
610
+ r.value !== "" ? (f(), k("div", {
604
611
  key: 0,
605
- onClick: m,
612
+ onClick: v,
606
613
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
607
614
  }, [
608
- N(Re)
609
- ])) : V("", !0),
610
- T(u("input", {
615
+ Y(De)
616
+ ])) : $("", !0),
617
+ O(d("input", {
611
618
  type: "text",
612
- "onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
613
- onInput: c,
619
+ "onUpdate:modelValue": u[0] || (u[0] = (s) => r.value = s),
620
+ onInput: p,
614
621
  placeholder: t.value,
615
- class: "!pr-7 !pl-8 bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
622
+ class: "!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
616
623
  }, null, 40, gt), [
617
624
  [G, r.value]
618
625
  ])
619
626
  ], 2));
620
627
  }
621
628
  });
622
- function Me(i = { color: "blue" }) {
629
+ function Me(c = { color: "blue" }) {
623
630
  return I(() => {
624
- const v = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${i.color}-500 focus:border-transparent`;
625
- return i?.size === "sm" ? `${v}h-[32px]` : `${v}h-[38px]`;
631
+ const b = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${c.color}-500 focus:border-transparent`;
632
+ return c?.size === "sm" ? `${b}h-[32px]` : `${b}h-[38px]`;
626
633
  });
627
634
  }
628
635
  function ht() {
@@ -631,8 +638,8 @@ function ht() {
631
638
  function xt() {
632
639
  return "font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100";
633
640
  }
634
- function Ke(i) {
635
- return i === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : i === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
641
+ function Fe(c) {
642
+ return c === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : c === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
636
643
  }
637
644
  const kt = {
638
645
  key: 0,
@@ -643,8 +650,8 @@ const kt = {
643
650
  }, Vt = {
644
651
  key: 0,
645
652
  class: "block text-xs font-medium text-gray-600 mb-1"
646
- }, _t = ["placeholder", "disabled"], $t = ["disabled"];
647
- const At = /* @__PURE__ */ O({
653
+ }, $t = ["placeholder", "disabled"], _t = ["disabled"];
654
+ const At = /* @__PURE__ */ U({
648
655
  __name: "range-input",
649
656
  props: {
650
657
  id: {},
@@ -670,82 +677,82 @@ const At = /* @__PURE__ */ O({
670
677
  sort: {}
671
678
  },
672
679
  emits: ["update:modelValue", "change", "clear"],
673
- setup(i, { expose: a, emit: v }) {
674
- const t = Me(), s = ht(), r = i, c = _(
680
+ setup(c, { expose: n, emit: b }) {
681
+ const t = Me(), a = ht(), r = c, i = _(
675
682
  r.modelValue ?? r.default ?? []
676
- ), m = v, d = I({
677
- get: () => r.modelValue ?? c.value,
678
- set: (n) => {
679
- r.modelValue !== void 0 ? m("update:modelValue", n) : c.value = n;
683
+ ), p = b, v = I({
684
+ get: () => r.modelValue ?? i.value,
685
+ set: (s) => {
686
+ r.modelValue !== void 0 ? p("update:modelValue", s) : i.value = s;
680
687
  }
681
688
  });
682
- function x() {
683
- m("change", { name: r.name, value: d.value || c.value });
689
+ function h() {
690
+ p("change", { name: r.name, value: v.value || i.value });
684
691
  }
685
- function p() {
686
- c.value = [], d.value = c.value, m("clear", r.name);
692
+ function u() {
693
+ i.value = [], v.value = i.value, p("clear", r.name);
687
694
  }
688
- return M(() => r.modelValue, (n) => {
689
- n !== void 0 && r.layout !== "popover" ? (c.value = n, m("update:modelValue", n)) : c.value = [];
690
- }), a({
691
- clear: p,
692
- currentValue: d
693
- }), (n, o) => (f(), w(R, null, [
694
- u("div", null, [
695
- u("div", {
696
- class: D(n.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
695
+ return D(() => r.modelValue, (s) => {
696
+ s !== void 0 && r.layout !== "popover" ? (i.value = s, p("update:modelValue", s)) : i.value = [];
697
+ }), n({
698
+ clear: u,
699
+ currentValue: v
700
+ }), (s, m) => (f(), k(F, null, [
701
+ d("div", null, [
702
+ d("div", {
703
+ class: M(s.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
697
704
  }, [
698
- u("div", null, [
699
- n.layout !== "vertical" ? (f(), w("label", kt, "Від")) : V("", !0),
700
- T(u("input", {
705
+ d("div", null, [
706
+ s.layout !== "vertical" ? (f(), k("label", kt, "Від")) : $("", !0),
707
+ O(d("input", {
701
708
  type: "number",
702
- class: D(e(t)),
703
- placeholder: n.placeHolder?.[0] ?? "min",
709
+ class: M(e(t)),
710
+ placeholder: s.placeHolder?.[0] ?? "min",
704
711
  step: "1",
705
712
  style: { outline: "none" },
706
- "onUpdate:modelValue": o[0] || (o[0] = (h) => d.value[0] = h),
707
- disabled: n.disabled
713
+ "onUpdate:modelValue": m[0] || (m[0] = (C) => v.value[0] = C),
714
+ disabled: s.disabled
708
715
  }, null, 10, wt), [
709
- [G, d.value[0]]
716
+ [G, v.value[0]]
710
717
  ])
711
718
  ]),
712
- n.layout === "vertical" ? (f(), w("label", Ct, " - ")) : V("", !0),
713
- u("div", null, [
714
- n.layout !== "vertical" ? (f(), w("label", Vt, "До")) : V("", !0),
715
- T(u("input", {
719
+ s.layout === "vertical" ? (f(), k("label", Ct, " - ")) : $("", !0),
720
+ d("div", null, [
721
+ s.layout !== "vertical" ? (f(), k("label", Vt, "До")) : $("", !0),
722
+ O(d("input", {
716
723
  type: "number",
717
- class: D(e(t)),
718
- placeholder: n.placeHolder?.[1] ?? "max",
724
+ class: M(e(t)),
725
+ placeholder: s.placeHolder?.[1] ?? "max",
719
726
  min: "0",
720
727
  max: "1000000000000000",
721
728
  step: "1",
722
729
  style: { outline: "none" },
723
- "onUpdate:modelValue": o[1] || (o[1] = (h) => d.value[1] = h),
724
- disabled: n.disabled
725
- }, null, 10, _t), [
726
- [G, d.value[1]]
730
+ "onUpdate:modelValue": m[1] || (m[1] = (C) => v.value[1] = C),
731
+ disabled: s.disabled
732
+ }, null, 10, $t), [
733
+ [G, v.value[1]]
727
734
  ])
728
735
  ]),
729
- ["popover", "inline", "vertical"].includes(n.layout) ? (f(), w("button", {
736
+ ["popover", "inline", "vertical"].includes(s.layout) ? (f(), k("button", {
730
737
  key: 1,
731
- onClick: x,
732
- class: D(e(s) + (n.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
733
- }, F(n.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : V("", !0),
734
- ["popover", "inline"].includes(n.layout) ? (f(), w("button", {
738
+ onClick: h,
739
+ class: M(e(a) + (s.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
740
+ }, j(s.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : $("", !0),
741
+ ["popover", "inline"].includes(s.layout) ? (f(), k("button", {
735
742
  key: 2,
736
- disabled: !(d.value[0] || d.value[1]),
737
- onClick: p,
738
- class: D(e(s) + " hover:bg-gray-100")
739
- }, "Очистити", 10, $t)) : V("", !0)
743
+ disabled: !(v.value[0] || v.value[1]),
744
+ onClick: u,
745
+ class: M(e(a) + " hover:bg-gray-100")
746
+ }, "Очистити", 10, _t)) : $("", !0)
740
747
  ], 2)
741
748
  ]),
742
- (n.cleanable && c.value.length, V("", !0))
749
+ (s.cleanable && i.value.length, $("", !0))
743
750
  ], 64));
744
751
  }
745
- }), Bt = ["disabled", "title"], St = {
752
+ }), St = ["disabled", "title"], Bt = {
746
753
  key: 0,
747
754
  class: "absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"
748
- }, Dt = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Rt = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, ge = /* @__PURE__ */ O({
755
+ }, Rt = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Dt = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, ge = /* @__PURE__ */ U({
749
756
  __name: "popover-field",
750
757
  props: {
751
758
  disabled: { type: Boolean, default: !1 },
@@ -756,212 +763,212 @@ const At = /* @__PURE__ */ O({
756
763
  mode: {},
757
764
  layout: {}
758
765
  },
759
- setup(i, { expose: a }) {
760
- const v = i, t = I(() => Ke(v.mode)), s = _(!1), r = _({ top: 0, left: 0 }), c = _(null), m = _(null), d = _(null);
761
- function x() {
762
- const y = m.value, $ = d.value;
763
- if (!y || !$) return;
764
- const C = y.getBoundingClientRect(), l = $.offsetWidth, b = window.innerWidth, K = C.bottom + 8;
765
- let { left: A } = C;
766
- A + l > b && (A = Math.max(b - l - 10, 10)), r.value = { top: K, left: A };
766
+ setup(c, { expose: n }) {
767
+ const b = c, t = I(() => Fe(b.mode)), a = _(!1), r = _({ top: 0, left: 0 }), i = _(null), p = _(null), v = _(null);
768
+ function h() {
769
+ const l = p.value, V = v.value;
770
+ if (!l || !V) return;
771
+ const w = l.getBoundingClientRect(), o = V.offsetWidth, x = window.innerWidth, S = w.bottom + 8;
772
+ let { left: B } = w;
773
+ B + o > x && (B = Math.max(x - o - 10, 10)), r.value = { top: S, left: B };
767
774
  }
768
- function p() {
769
- s.value = !s.value, s.value && fe(() => {
770
- x(), v.fieldRef?.inputTextRef && v.fieldRef?.inputTextRef.focus();
775
+ function u() {
776
+ a.value = !a.value, a.value && fe(() => {
777
+ h(), b.fieldRef?.inputTextRef && b.fieldRef?.inputTextRef.focus();
771
778
  });
772
779
  }
773
- function n(y) {
774
- !c.value?.contains(y.target) && !d.value?.contains(y.target) && (s.value = !1);
780
+ function s(l) {
781
+ !i.value?.contains(l.target) && !v.value?.contains(l.target) && (a.value = !1);
775
782
  }
776
- function o(y) {
777
- y.key === "Escape" && (s.value = !1);
783
+ function m(l) {
784
+ l.key === "Escape" && (a.value = !1);
778
785
  }
779
- const h = _(!1);
786
+ const C = _(!1);
780
787
  ae(() => {
781
- h.value = !0;
788
+ C.value = !0;
782
789
  }), ae(() => {
783
- document.addEventListener("click", n, !0), document.addEventListener("keydown", o), window.addEventListener("scroll", x, !0);
790
+ document.addEventListener("click", s, !0), document.addEventListener("keydown", m), window.addEventListener("scroll", h, !0);
784
791
  }), ce(() => {
785
- document.removeEventListener("click", n, !0), document.removeEventListener("keydown", o), window.removeEventListener("scroll", x, !0);
792
+ document.removeEventListener("click", s, !0), document.removeEventListener("keydown", m), window.removeEventListener("scroll", h, !0);
786
793
  });
787
- function g() {
788
- s.value = !1;
794
+ function y() {
795
+ a.value = !1;
789
796
  }
790
- a({ close: g });
791
- const k = I(() => {
792
- const y = v.fieldRef?.selectedLabels;
793
- return y ? Array.isArray(y) ? y.length > 0 ? y.join(", ") : v.label ?? "" : String(y) : v.label ?? "";
797
+ n({ close: y });
798
+ const g = I(() => {
799
+ const l = b.fieldRef?.selectedLabels;
800
+ return l ? Array.isArray(l) ? l.length > 0 ? l.join(", ") : b.label ?? "" : String(l) : b.label ?? "";
794
801
  });
795
- return (y, $) => (f(), w("div", null, [
796
- u("button", {
797
- onClick: p,
798
- disabled: y.disabled,
802
+ return (l, V) => (f(), k("div", null, [
803
+ d("button", {
804
+ onClick: u,
805
+ disabled: l.disabled,
799
806
  ref_key: "triggerRef",
800
- ref: m,
801
- title: y.label,
802
- class: D(t.value + " " + (y.width ? e(de).getWidthClass(y.width) : "w-full"))
807
+ ref: p,
808
+ title: l.label,
809
+ class: M(t.value + " " + (l.width ? e(de).getWidthClass(l.width) : "w-full"))
803
810
  }, [
804
- u("span", {
805
- class: D(["truncate text-ellipsis block", y.width ? e(de).getWidthClass(y.width - 50) : "w-full"])
806
- }, F(k.value), 3),
807
- N(ie, { class: "h-4 w-4" }),
808
- (Array.isArray(y.currentValue) ? y.currentValue === null || y.currentValue.length > 0 : y.currentValue === null || y.currentValue) && y.layout === "inline" ? (f(), w("span", St)) : V("", !0)
809
- ], 10, Bt),
810
- h.value ? (f(), S($e, {
811
+ d("span", {
812
+ class: M(["truncate text-ellipsis block", l.width ? e(de).getWidthClass(l.width - 50) : "w-full"])
813
+ }, j(g.value), 3),
814
+ Y(ue, { class: "h-4 w-4" }),
815
+ (Array.isArray(l.currentValue) ? l.currentValue === null || l.currentValue.length > 0 : l.currentValue === null || l.currentValue) && l.layout === "inline" ? (f(), k("span", Bt)) : $("", !0)
816
+ ], 10, St),
817
+ C.value ? (f(), R(_e, {
811
818
  key: 0,
812
819
  to: "body"
813
820
  }, [
814
- T(u("div", {
821
+ O(d("div", {
815
822
  ref_key: "popperRef",
816
- ref: d,
823
+ ref: v,
817
824
  class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
818
825
  style: Ae({ top: `${r.value.top}px`, left: `${r.value.left}px` }),
819
826
  "data-inside-popover": ""
820
827
  }, [
821
- u("div", Dt, [
822
- u("div", Rt, [
823
- ue(y.$slots, "default")
828
+ d("div", Rt, [
829
+ d("div", Dt, [
830
+ ie(l.$slots, "default")
824
831
  ])
825
832
  ])
826
833
  ], 4), [
827
- [X, s.value]
834
+ [X, a.value]
828
835
  ])
829
- ])) : V("", !0)
836
+ ])) : $("", !0)
830
837
  ]));
831
838
  }
832
839
  });
833
- function Mt(i) {
834
- return String(i).charAt(0).toUpperCase() + String(i).slice(1);
840
+ function Mt(c) {
841
+ return String(c).charAt(0).toUpperCase() + String(c).slice(1);
835
842
  }
836
843
  class H {
837
- static format(a) {
838
- const v = a.getFullYear(), t = (a.getMonth() + 1).toString().padStart(2, "0"), s = a.getDate().toString().padStart(2, "0");
839
- return `${v}-${t}-${s}`;
840
- }
841
- static getShiftedDay(a, v = 0) {
842
- const t = a ? new Date(a) : /* @__PURE__ */ new Date();
843
- return t.setDate(t.getDate() + v), this.format(t);
844
- }
845
- static getLastWeekRange(a, v, t = 0) {
846
- if (a && v) {
847
- const x = new Date(a), p = new Date(v);
848
- return x.setDate(x.getDate() + t * 7), p.setDate(p.getDate() + t * 7), [this.format(x), this.format(p)];
844
+ static format(n) {
845
+ const b = n.getFullYear(), t = (n.getMonth() + 1).toString().padStart(2, "0"), a = n.getDate().toString().padStart(2, "0");
846
+ return `${b}-${t}-${a}`;
847
+ }
848
+ static getShiftedDay(n, b = 0) {
849
+ const t = n ? new Date(n) : /* @__PURE__ */ new Date();
850
+ return t.setDate(t.getDate() + b), this.format(t);
851
+ }
852
+ static getLastWeekRange(n, b, t = 0) {
853
+ if (n && b) {
854
+ const h = new Date(n), u = new Date(b);
855
+ return h.setDate(h.getDate() + t * 7), u.setDate(u.getDate() + t * 7), [this.format(h), this.format(u)];
849
856
  }
850
- const s = /* @__PURE__ */ new Date(), r = s.getDay(), c = r === 0 ? 13 : r - 1 + 7, m = new Date(s);
851
- m.setDate(s.getDate() - c + t * 7);
852
- const d = new Date(m);
853
- return d.setDate(m.getDate() + 6), [this.format(m), this.format(d)];
854
- }
855
- static getMonthRange(a, v, t = 0) {
856
- let s;
857
- a ? s = new Date(a) : s = /* @__PURE__ */ new Date(), s = new Date(s.getFullYear(), s.getMonth() + t, 1);
858
- const r = s, c = new Date(s.getFullYear(), s.getMonth() + 1, 0);
859
- return [this.format(r), this.format(c)];
860
- }
861
- static getQuarterRange(a, v, t = 0) {
862
- const s = a || v, r = s ? new Date(s) : /* @__PURE__ */ new Date();
863
- let c = Math.floor(r.getMonth() / 3);
864
- c += t;
865
- const m = (c % 4 + 4) % 4 * 3, d = r.getFullYear() + Math.floor(c / 4), x = new Date(d, m, 1), p = new Date(d, m + 3, 0);
866
- return [this.format(x), this.format(p)];
867
- }
868
- static getYear(a, v = 0) {
857
+ const a = /* @__PURE__ */ new Date(), r = a.getDay(), i = r === 0 ? 13 : r - 1 + 7, p = new Date(a);
858
+ p.setDate(a.getDate() - i + t * 7);
859
+ const v = new Date(p);
860
+ return v.setDate(p.getDate() + 6), [this.format(p), this.format(v)];
861
+ }
862
+ static getMonthRange(n, b, t = 0) {
863
+ let a;
864
+ n ? a = new Date(n) : a = /* @__PURE__ */ new Date(), a = new Date(a.getFullYear(), a.getMonth() + t, 1);
865
+ const r = a, i = new Date(a.getFullYear(), a.getMonth() + 1, 0);
866
+ return [this.format(r), this.format(i)];
867
+ }
868
+ static getQuarterRange(n, b, t = 0) {
869
+ const a = n || b, r = a ? new Date(a) : /* @__PURE__ */ new Date();
870
+ let i = Math.floor(r.getMonth() / 3);
871
+ i += t;
872
+ const p = (i % 4 + 4) % 4 * 3, v = r.getFullYear() + Math.floor(i / 4), h = new Date(v, p, 1), u = new Date(v, p + 3, 0);
873
+ return [this.format(h), this.format(u)];
874
+ }
875
+ static getYear(n, b = 0) {
869
876
  let t;
870
- return a && /^\d{4}$/.test(a) ? t = parseInt(a, 10) : a ? t = new Date(a).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), String(t + v);
877
+ return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), String(t + b);
871
878
  }
872
- static getYearRange(a, v = 0) {
879
+ static getYearRange(n, b = 0) {
873
880
  let t;
874
- return a && /^\d{4}$/.test(a) ? t = parseInt(a, 10) : a ? t = new Date(a).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), [
875
- this.format(new Date(t + v, 0, 1)),
876
- this.format(new Date(t + v + 1, 0, 0))
881
+ return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), [
882
+ this.format(new Date(t + b, 0, 1)),
883
+ this.format(new Date(t + b + 1, 0, 0))
877
884
  ];
878
885
  }
879
- static getRangeFromDaysBefore(a) {
880
- const v = /* @__PURE__ */ new Date(), t = new Date(v.getTime());
881
- return t.setDate(v.getDate() - a), [this.format(t), this.format(v)];
886
+ static getRangeFromDaysBefore(n) {
887
+ const b = /* @__PURE__ */ new Date(), t = new Date(b.getTime());
888
+ return t.setDate(b.getDate() - n), [this.format(t), this.format(b)];
882
889
  }
883
890
  }
884
- function Fe(i, a) {
891
+ function Ke(c, n) {
885
892
  const {
886
- popoverRef: v
887
- } = i, t = _(""), s = _(
888
- i.modelValue ?? i.default ?? []
893
+ popoverRef: b
894
+ } = c, t = _(""), a = _(
895
+ c.modelValue ?? c.default ?? []
889
896
  ), r = _(0);
890
- function c() {
891
- const k = H.getRangeFromDaysBefore(r.value);
892
- return s.value = [...k], a("change", { name: i.name, value: s.value }), a("update:modelValue", s.value), k;
897
+ function i() {
898
+ const g = H.getRangeFromDaysBefore(r.value);
899
+ return a.value = [...g], n("change", { name: c.name, value: a.value }), n("update:modelValue", a.value), g;
893
900
  }
894
- function m(k) {
895
- t.value = k, v.value?.close();
896
- const y = [];
901
+ function p(g) {
902
+ t.value = g, b.value?.close();
903
+ const l = [];
897
904
  switch (t.value) {
898
905
  case "today":
899
- y.push(H.getShiftedDay()), y.push(H.getShiftedDay());
906
+ l.push(H.getShiftedDay()), l.push(H.getShiftedDay());
900
907
  break;
901
908
  case "week":
902
- y.push(...H.getLastWeekRange());
909
+ l.push(...H.getLastWeekRange());
903
910
  break;
904
911
  case "month":
905
- y.push(...H.getMonthRange());
912
+ l.push(...H.getMonthRange());
906
913
  break;
907
914
  case "quarter":
908
- y.push(...H.getQuarterRange());
915
+ l.push(...H.getQuarterRange());
909
916
  break;
910
917
  case "year":
911
- y.push(...H.getYearRange());
918
+ l.push(...H.getYearRange());
912
919
  break;
913
920
  case "last_7_days":
914
- r.value = 7, c();
921
+ r.value = 7, i();
915
922
  break;
916
923
  case "range":
917
- r.value = 7, y.push(...c());
924
+ r.value = 7, l.push(...i());
918
925
  break;
919
926
  }
920
- s.value = [...y], a("change", { name: i.name, value: s.value }), a("update:modelValue", s.value);
927
+ a.value = [...l], n("change", { name: c.name, value: a.value }), n("update:modelValue", a.value);
921
928
  }
922
- function d() {
923
- const k = [];
929
+ function v() {
930
+ const g = [];
924
931
  switch (t.value) {
925
932
  case "today":
926
- k.push(H.getShiftedDay(s.value[0], 1));
933
+ g.push(H.getShiftedDay(a.value[0], 1));
927
934
  break;
928
935
  case "week":
929
- k.push(...H.getLastWeekRange(s.value[0], s.value[1], 1));
936
+ g.push(...H.getLastWeekRange(a.value[0], a.value[1], 1));
930
937
  break;
931
938
  case "month":
932
- k.push(...H.getMonthRange(s.value[0], s.value[1], 1));
939
+ g.push(...H.getMonthRange(a.value[0], a.value[1], 1));
933
940
  break;
934
941
  case "quarter":
935
- k.push(...H.getQuarterRange(s.value[0], s.value[1], 1));
942
+ g.push(...H.getQuarterRange(a.value[0], a.value[1], 1));
936
943
  break;
937
944
  case "year":
938
- k.push(...H.getYearRange(s.value[0], 1));
945
+ g.push(...H.getYearRange(a.value[0], 1));
939
946
  break;
940
947
  }
941
- s.value = [...k], a("change", { name: i.name, value: s.value }), a("update:modelValue", s.value);
948
+ a.value = [...g], n("change", { name: c.name, value: a.value }), n("update:modelValue", a.value);
942
949
  }
943
- function x() {
944
- const k = [];
950
+ function h() {
951
+ const g = [];
945
952
  switch (t.value) {
946
953
  case "today":
947
- k.push(H.getShiftedDay(s.value[0], -1));
954
+ g.push(H.getShiftedDay(a.value[0], -1));
948
955
  break;
949
956
  case "week":
950
- k.push(...H.getLastWeekRange(s.value[0], s.value[1], -1));
957
+ g.push(...H.getLastWeekRange(a.value[0], a.value[1], -1));
951
958
  break;
952
959
  case "month":
953
- k.push(...H.getMonthRange(s.value[0], s.value[1], -1));
960
+ g.push(...H.getMonthRange(a.value[0], a.value[1], -1));
954
961
  break;
955
962
  case "quarter":
956
- k.push(...H.getQuarterRange(s.value[0], s.value[1], -1));
963
+ g.push(...H.getQuarterRange(a.value[0], a.value[1], -1));
957
964
  break;
958
965
  case "year":
959
- k.push(...H.getYearRange(s.value[0], -1));
966
+ g.push(...H.getYearRange(a.value[0], -1));
960
967
  break;
961
968
  }
962
- s.value = [...k], a("change", { name: i.name, value: s.value }), a("update:modelValue", s.value);
969
+ a.value = [...g], n("change", { name: c.name, value: a.value }), n("update:modelValue", a.value);
963
970
  }
964
- const p = [
971
+ const u = [
965
972
  "Січень",
966
973
  "Лютий",
967
974
  "Березень",
@@ -975,75 +982,75 @@ function Fe(i, a) {
975
982
  "Листопад",
976
983
  "Грудень"
977
984
  ];
978
- function n(k) {
979
- const [y, $, C] = k.split("-");
980
- return `${C}.${$}.${y}`;
985
+ function s(g) {
986
+ const [l, V, w] = g.split("-");
987
+ return `${w}.${V}.${l}`;
981
988
  }
982
- function o(k) {
983
- const { value: y } = s;
984
- switch (k) {
989
+ function m(g) {
990
+ const { value: l } = a;
991
+ switch (g) {
985
992
  case "today":
986
- return n(y[0]);
993
+ return s(l[0]);
987
994
  case "range":
988
995
  return "Період";
989
996
  case "week":
990
- return y[0] && y[1] ? `${n(y[0])} – ${n(y[1])}` : "";
997
+ return l[0] && l[1] ? `${s(l[0])} – ${s(l[1])}` : "";
991
998
  case "quarter":
992
- if (y[0]) {
993
- const $ = new Date(y[0]), C = $.getFullYear(), l = $.getMonth();
994
- return `${Math.floor(l / 3) + 1} квартал ${C}`;
999
+ if (l[0]) {
1000
+ const V = new Date(l[0]), w = V.getFullYear(), o = V.getMonth();
1001
+ return `${Math.floor(o / 3) + 1} квартал ${w}`;
995
1002
  }
996
1003
  return "";
997
1004
  case "month":
998
- if (y[0]) {
999
- const [$, C] = y[0].split("-");
1000
- return `${p[parseInt(C, 10) - 1]} ${$}`;
1005
+ if (l[0]) {
1006
+ const [V, w] = l[0].split("-");
1007
+ return `${u[parseInt(w, 10) - 1]} ${V}`;
1001
1008
  }
1002
1009
  return "";
1003
1010
  case "year":
1004
- return y[0] || "";
1011
+ return l[0] || "";
1005
1012
  case "last_7_days":
1006
1013
  return "За останні дні";
1007
1014
  default:
1008
- return i.label ?? "";
1015
+ return c.label ?? "";
1009
1016
  }
1010
1017
  }
1011
- const h = I(() => t.value ? o(t.value) : i.label ?? "");
1012
- function g() {
1013
- t.value = "", s.value = [], a("update:modelValue", []), a("clear", i.name);
1018
+ const C = I(() => t.value ? m(t.value) : c.label ?? "");
1019
+ function y() {
1020
+ t.value = "", a.value = [], n("update:modelValue", []), n("clear", c.name);
1014
1021
  }
1015
1022
  return {
1016
1023
  activeMode: t,
1017
- innerValue: s,
1024
+ innerValue: a,
1018
1025
  daysBefore: r,
1019
- onDaysBeforeChange: c,
1020
- onSelectChange: m,
1021
- nextClick: d,
1022
- prevClick: x,
1023
- ukMonths: p,
1024
- formatDisplayDate: n,
1025
- getModeLabel: o,
1026
- currentLabel: h,
1027
- clear: g
1026
+ onDaysBeforeChange: i,
1027
+ onSelectChange: p,
1028
+ nextClick: v,
1029
+ prevClick: h,
1030
+ ukMonths: u,
1031
+ formatDisplayDate: s,
1032
+ getModeLabel: m,
1033
+ currentLabel: C,
1034
+ clear: y
1028
1035
  };
1029
1036
  }
1030
- const Kt = {
1037
+ const Ft = {
1031
1038
  key: 0,
1032
1039
  class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
1033
- }, Ft = {
1040
+ }, Kt = {
1034
1041
  key: 0,
1035
1042
  class: "flex gap-1 !w-[75%] rounded-lg"
1036
1043
  }, jt = ["max", "disabled"], Lt = ["min", "disabled"], Et = {
1037
1044
  key: 0,
1038
1045
  class: "block text-xs font-medium text-gray-600 mb-1"
1039
- }, It = ["max", "disabled"], Tt = {
1046
+ }, Tt = ["max", "disabled"], It = {
1040
1047
  key: 0,
1041
1048
  class: "block text-xs font-medium text-gray-600 mb-1"
1042
1049
  }, Ot = {
1043
1050
  key: 0,
1044
1051
  class: "block text-xs font-medium text-gray-600 mb-1"
1045
1052
  }, Ut = ["min", "disabled"], zt = { class: "flex gap-1 pt-2" }, Nt = ["onClick"];
1046
- const Ht = /* @__PURE__ */ O({
1053
+ const Ht = /* @__PURE__ */ U({
1047
1054
  __name: "date-input",
1048
1055
  props: {
1049
1056
  id: {},
@@ -1069,219 +1076,219 @@ const Ht = /* @__PURE__ */ O({
1069
1076
  sort: {}
1070
1077
  },
1071
1078
  emits: ["update:modelValue", "change", "clear"],
1072
- setup(i, { expose: a, emit: v }) {
1073
- const t = i, s = Me(), r = xt(), c = v, m = _(null), {
1074
- activeMode: d,
1075
- innerValue: x,
1076
- onSelectChange: p,
1077
- nextClick: n,
1078
- prevClick: o,
1079
- clear: h
1080
- } = Fe({
1079
+ setup(c, { expose: n, emit: b }) {
1080
+ const t = c, a = Me(), r = xt(), i = b, p = _(null), {
1081
+ activeMode: v,
1082
+ innerValue: h,
1083
+ onSelectChange: u,
1084
+ nextClick: s,
1085
+ prevClick: m,
1086
+ clear: C
1087
+ } = Ke({
1081
1088
  ...t,
1082
- popoverRef: m
1083
- }, c);
1084
- return M(() => t.modelValue, (g) => {
1085
- g !== void 0 ? (x.value = g, c("update:modelValue", g)) : (d.value = "", x.value = []);
1086
- }), a({
1087
- clear: h,
1088
- popoverRef: m
1089
- }), (g, k) => (f(), w(R, null, [
1090
- g.layout === "inline" ? (f(), w("div", Kt, [
1091
- e(d) !== "" && e(d) === "range" ? (f(), w("div", Ft, [
1092
- T(u("input", {
1089
+ popoverRef: p
1090
+ }, i);
1091
+ return D(() => t.modelValue, (y) => {
1092
+ y !== void 0 ? (h.value = y, i("update:modelValue", y)) : (v.value = "", h.value = []);
1093
+ }), n({
1094
+ clear: C,
1095
+ popoverRef: p
1096
+ }), (y, g) => (f(), k(F, null, [
1097
+ y.layout === "inline" ? (f(), k("div", Ft, [
1098
+ e(v) !== "" && e(v) === "range" ? (f(), k("div", Kt, [
1099
+ O(d("input", {
1093
1100
  type: "date",
1094
- max: e(x)[1],
1101
+ max: e(h)[1],
1095
1102
  locale: "uk-UA",
1096
- "onUpdate:modelValue": k[0] || (k[0] = (y) => e(x)[0] = y),
1103
+ "onUpdate:modelValue": g[0] || (g[0] = (l) => e(h)[0] = l),
1097
1104
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1098
- disabled: g.disabled
1105
+ disabled: y.disabled
1099
1106
  }, null, 8, jt), [
1100
- [G, e(x)[0]]
1107
+ [G, e(h)[0]]
1101
1108
  ]),
1102
- T(u("input", {
1109
+ O(d("input", {
1103
1110
  type: "date",
1104
- min: e(x)[0],
1111
+ min: e(h)[0],
1105
1112
  locale: "uk-UA",
1106
- "onUpdate:modelValue": k[1] || (k[1] = (y) => e(x)[1] = y),
1113
+ "onUpdate:modelValue": g[1] || (g[1] = (l) => e(h)[1] = l),
1107
1114
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1108
- disabled: g.disabled
1115
+ disabled: y.disabled
1109
1116
  }, null, 8, Lt), [
1110
- [G, e(x)[1]]
1117
+ [G, e(h)[1]]
1111
1118
  ])
1112
- ])) : V("", !0)
1113
- ])) : V("", !0),
1114
- u("div", {
1115
- class: D(g.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1119
+ ])) : $("", !0)
1120
+ ])) : $("", !0),
1121
+ d("div", {
1122
+ class: M(y.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1116
1123
  }, [
1117
- u("div", {
1118
- class: D(g.layout !== "popover" ? "w-[48%]" : "")
1124
+ d("div", {
1125
+ class: M(y.layout !== "popover" ? "w-[48%]" : "")
1119
1126
  }, [
1120
- g.layout === "popover" ? (f(), w("label", Et, "Від")) : V("", !0),
1121
- T(u("input", {
1127
+ y.layout === "popover" ? (f(), k("label", Et, "Від")) : $("", !0),
1128
+ O(d("input", {
1122
1129
  type: "date",
1123
- max: e(x)[1],
1130
+ max: e(h)[1],
1124
1131
  locale: "uk-UA",
1125
- "onUpdate:modelValue": k[2] || (k[2] = (y) => e(x)[0] = y),
1126
- class: D(e(s)),
1127
- disabled: g.disabled
1128
- }, null, 10, It), [
1129
- [G, e(x)[0]]
1132
+ "onUpdate:modelValue": g[2] || (g[2] = (l) => e(h)[0] = l),
1133
+ class: M(e(a)),
1134
+ disabled: y.disabled
1135
+ }, null, 10, Tt), [
1136
+ [G, e(h)[0]]
1130
1137
  ])
1131
1138
  ], 2),
1132
- g.layout !== "popover" ? (f(), w("label", Tt, " - ")) : V("", !0),
1133
- u("div", {
1134
- class: D(g.layout !== "popover" ? "w-[48%]" : "")
1139
+ y.layout !== "popover" ? (f(), k("label", It, " - ")) : $("", !0),
1140
+ d("div", {
1141
+ class: M(y.layout !== "popover" ? "w-[48%]" : "")
1135
1142
  }, [
1136
- g.layout === "popover" ? (f(), w("label", Ot, "До")) : V("", !0),
1137
- T(u("input", {
1143
+ y.layout === "popover" ? (f(), k("label", Ot, "До")) : $("", !0),
1144
+ O(d("input", {
1138
1145
  type: "date",
1139
- min: e(x)[0],
1146
+ min: e(h)[0],
1140
1147
  locale: "uk-UA",
1141
- "onUpdate:modelValue": k[3] || (k[3] = (y) => e(x)[1] = y),
1142
- class: D(e(s)),
1143
- disabled: g.disabled
1148
+ "onUpdate:modelValue": g[3] || (g[3] = (l) => e(h)[1] = l),
1149
+ class: M(e(a)),
1150
+ disabled: y.disabled
1144
1151
  }, null, 10, Ut), [
1145
- [G, e(x)[1]]
1152
+ [G, e(h)[1]]
1146
1153
  ])
1147
1154
  ], 2)
1148
1155
  ], 2),
1149
- u("div", zt, [
1150
- (f(), w(R, null, W(["today", "week", "month", "quarter", "year"], (y) => u("button", {
1151
- key: y,
1152
- class: D(e(r) + (e(d) === y ? " bg-blue-100" : "")),
1153
- onClick: ($) => e(p)(y)
1154
- }, F(e(Mt)(y)), 11, Nt)), 64)),
1155
- u("button", {
1156
- class: D(e(r)),
1157
- onClick: k[4] || (k[4] = //@ts-ignore
1158
- (...y) => e(o) && e(o)(...y))
1156
+ d("div", zt, [
1157
+ (f(), k(F, null, W(["today", "week", "month", "quarter", "year"], (l) => d("button", {
1158
+ key: l,
1159
+ class: M(e(r) + (e(v) === l ? " bg-blue-100" : "")),
1160
+ onClick: (V) => e(u)(l)
1161
+ }, j(e(Mt)(l)), 11, Nt)), 64)),
1162
+ d("button", {
1163
+ class: M(e(r)),
1164
+ onClick: g[4] || (g[4] = //@ts-ignore
1165
+ (...l) => e(m) && e(m)(...l))
1159
1166
  }, " <", 2),
1160
- u("button", {
1161
- class: D(e(r)),
1162
- onClick: k[5] || (k[5] = //@ts-ignore
1163
- (...y) => e(n) && e(n)(...y))
1167
+ d("button", {
1168
+ class: M(e(r)),
1169
+ onClick: g[5] || (g[5] = //@ts-ignore
1170
+ (...l) => e(s) && e(s)(...l))
1164
1171
  }, " >", 2)
1165
1172
  ]),
1166
- (g.cleanable, V("", !0))
1173
+ (y.cleanable, $("", !0))
1167
1174
  ], 64));
1168
1175
  }
1169
1176
  });
1170
- function Yt(i, a) {
1177
+ function Yt(c, n) {
1171
1178
  const {
1172
- api: v,
1179
+ api: b,
1173
1180
  options: t = [],
1174
- limit: s = 20,
1181
+ limit: a = 20,
1175
1182
  dataKey: r = "data"
1176
- } = i, c = i.multi;
1177
- function m(B) {
1178
- return c ? Array.isArray(B) ? B : B ? [B] : [] : Array.isArray(B) ? B[0] : B;
1183
+ } = c, i = c.multi;
1184
+ function p(A) {
1185
+ return i ? Array.isArray(A) ? A : A ? [A] : [] : Array.isArray(A) ? A[0] : A;
1179
1186
  }
1180
- const d = _(m(i.modelValue)), x = _(""), p = _(!1), n = _([]), o = _("id"), h = _("text"), g = _(!1), k = _(i.layout !== "popover" && t.length > s), y = _([]), $ = _(0);
1181
- function C(B) {
1182
- const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((ne) => ne in U) ?? "id", se = ["text", "label", "name", "title"].find((ne) => ne in U) ?? "text";
1187
+ const v = _(p(c.modelValue)), h = _(""), u = _(!1), s = _([]), m = _("id"), C = _("text"), y = _(!1), g = _(c.layout !== "popover" && t.length > a), l = _([]), V = _(0);
1188
+ function w(A) {
1189
+ const z = A.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in z) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in z) ?? "text";
1183
1190
  return { autoValueKey: q, autoLabelKey: se };
1184
1191
  }
1185
1192
  if (t.length > 0) {
1186
- const B = C(t);
1187
- o.value = B.autoValueKey, h.value = B.autoLabelKey;
1188
- }
1189
- const l = I(() => {
1190
- if (v) return n.value;
1191
- const B = n.value;
1192
- if (i.layout === "popover") return B;
1193
- if (!x.value)
1194
- return g.value ? B : B.slice(0, s);
1195
- const U = x.value.toLowerCase();
1196
- return B.filter((q) => q[h.value].toLowerCase().includes(U));
1193
+ const A = w(t);
1194
+ m.value = A.autoValueKey, C.value = A.autoLabelKey;
1195
+ }
1196
+ const o = I(() => {
1197
+ if (b) return s.value;
1198
+ const A = s.value;
1199
+ if (c.layout === "popover") return A;
1200
+ if (!h.value)
1201
+ return y.value ? A : A.slice(0, a);
1202
+ const z = h.value.toLowerCase();
1203
+ return A.filter((q) => q[C.value].toLowerCase().includes(z));
1197
1204
  });
1198
- let b = null;
1199
- async function K(B) {
1200
- if (v) {
1201
- p.value = !0;
1205
+ let x = null;
1206
+ async function S(A) {
1207
+ if (b) {
1208
+ u.value = !0;
1202
1209
  try {
1203
- const U = new URL(v, window.location.origin);
1204
- U.searchParams.set("json", "1"), U.searchParams.set("key", B), U.searchParams.set("limit", s.toString());
1205
- const q = await fetch(U.toString());
1210
+ const z = new URL(b, window.location.origin);
1211
+ z.searchParams.set("json", "1"), z.searchParams.set("key", A), z.searchParams.set("limit", a.toString());
1212
+ const q = await fetch(z.toString());
1206
1213
  if (!q.ok)
1207
1214
  throw new Error(`HTTP error! status: ${q.status}`);
1208
1215
  const se = await q.json();
1209
- if (n.value = se[r], n.value.length > 0) {
1210
- const ne = C(n.value);
1211
- o.value = ne.autoValueKey, h.value = ne.autoLabelKey;
1216
+ if (s.value = se[r], s.value.length > 0) {
1217
+ const oe = w(s.value);
1218
+ m.value = oe.autoValueKey, C.value = oe.autoLabelKey;
1212
1219
  }
1213
- $.value = se.total;
1214
- } catch (U) {
1215
- console.error("Failed to fetch remote options:", U);
1220
+ V.value = se.total;
1221
+ } catch (z) {
1222
+ console.error("Failed to fetch remote options:", z);
1216
1223
  } finally {
1217
- p.value = !1;
1224
+ u.value = !1;
1218
1225
  }
1219
1226
  }
1220
1227
  }
1221
- M(x, (B) => {
1222
- v && (b && clearTimeout(b), b = setTimeout(() => {
1223
- K(B);
1228
+ D(h, (A) => {
1229
+ b && (x && clearTimeout(x), x = setTimeout(() => {
1230
+ S(A);
1224
1231
  }, 200));
1225
- }), M(() => i.modelValue, (B) => {
1226
- d.value = m(B);
1227
- }, { immediate: !0 }), v ? K("") : n.value = t;
1228
- function A(B) {
1229
- return c && Array.isArray(d.value) ? d.value.includes(B[o.value]) : d.value && d.value === B[o.value];
1230
- }
1231
- function Y(B) {
1232
- if (c && !Array.isArray(d.value) && (d.value = []), c && Array.isArray(d.value)) {
1233
- const U = d.value.includes(B[o.value]);
1234
- d.value = U ? d.value.filter((q) => q !== B[o.value]) : [...d.value, B[o.value]], y.value = U ? y.value.filter((q) => q !== B[h.value]) : [...y.value, B[h.value]];
1232
+ }), D(() => c.modelValue, (A) => {
1233
+ v.value = p(A);
1234
+ }, { immediate: !0 }), b ? S("") : s.value = t;
1235
+ function B(A) {
1236
+ return i && Array.isArray(v.value) ? v.value.includes(A[m.value]) : v.value && v.value === A[m.value];
1237
+ }
1238
+ function K(A) {
1239
+ if (i && !Array.isArray(v.value) && (v.value = []), i && Array.isArray(v.value)) {
1240
+ const z = v.value.includes(A[m.value]);
1241
+ v.value = z ? v.value.filter((q) => q !== A[m.value]) : [...v.value, A[m.value]], l.value = z ? l.value.filter((q) => q !== A[C.value]) : [...l.value, A[C.value]];
1235
1242
  } else
1236
- d.value = B[o.value], y.value = B[h.value];
1237
- a("update:modelValue", d.value), a("change", { name: i.name, value: d.value });
1243
+ v.value = A[m.value], l.value = A[C.value];
1244
+ n("update:modelValue", v.value), n("change", { name: c.name, value: v.value });
1238
1245
  }
1239
- function L() {
1240
- c ? (d.value = [], y.value = []) : (d.value = void 0, y.value = []), a("update:modelValue", d.value), a("clear", i.name);
1246
+ function E() {
1247
+ i ? (v.value = [], l.value = []) : (v.value = void 0, l.value = []), n("update:modelValue", v.value), n("clear", c.name);
1241
1248
  }
1242
- function j() {
1243
- b && clearTimeout(b), x.value = "", g.value = !1;
1249
+ function L() {
1250
+ x && clearTimeout(x), h.value = "", y.value = !1;
1244
1251
  }
1245
- function E() {
1246
- g.value = !g.value;
1252
+ function T() {
1253
+ y.value = !y.value;
1247
1254
  }
1248
1255
  ce(() => {
1249
- b && clearTimeout(b);
1256
+ x && clearTimeout(x);
1250
1257
  });
1251
1258
  const Q = _(-1);
1252
- M(l, () => {
1253
- Q.value = l.value.length > 0 ? 0 : -1;
1259
+ D(o, () => {
1260
+ Q.value = o.value.length > 0 ? 0 : -1;
1254
1261
  });
1255
- function re(B) {
1256
- const U = l.value.length;
1257
- if (B.key === "ArrowDown")
1258
- B.preventDefault(), Q.value = (Q.value + 1) % U;
1259
- else if (B.key === "ArrowUp")
1260
- B.preventDefault(), Q.value = (Q.value - 1 + U) % U;
1261
- else if (B.key === "Enter" && (B.preventDefault(), Q.value >= 0 && Q.value < l.value.length)) {
1262
- const q = l.value[Q.value];
1263
- Y(q);
1262
+ function re(A) {
1263
+ const z = o.value.length;
1264
+ if (A.key === "ArrowDown")
1265
+ A.preventDefault(), Q.value = (Q.value + 1) % z;
1266
+ else if (A.key === "ArrowUp")
1267
+ A.preventDefault(), Q.value = (Q.value - 1 + z) % z;
1268
+ else if (A.key === "Enter" && (A.preventDefault(), Q.value >= 0 && Q.value < o.value.length)) {
1269
+ const q = o.value[Q.value];
1270
+ K(q);
1264
1271
  }
1265
1272
  }
1266
1273
  return {
1267
- innerValue: d,
1268
- searchTerm: x,
1269
- filteredOptions: l,
1270
- isSelected: A,
1271
- selectItem: Y,
1272
- clear: L,
1273
- resetSearch: j,
1274
- toggleShowAll: E,
1275
- isReqProc: p,
1276
- showAll: g,
1277
- isEnableShowAll: k,
1278
- labelKey: h,
1279
- valueKey: o,
1280
- allOptions: n,
1274
+ innerValue: v,
1275
+ searchTerm: h,
1276
+ filteredOptions: o,
1277
+ isSelected: B,
1278
+ selectItem: K,
1279
+ clear: E,
1280
+ resetSearch: L,
1281
+ toggleShowAll: T,
1282
+ isReqProc: u,
1283
+ showAll: y,
1284
+ isEnableShowAll: g,
1285
+ labelKey: C,
1286
+ valueKey: m,
1287
+ allOptions: s,
1281
1288
  highlightedIndex: Q,
1282
1289
  onKeyDown: re,
1283
- selectedLabels: y,
1284
- totalCount: $
1290
+ selectedLabels: l,
1291
+ totalCount: V
1285
1292
  };
1286
1293
  }
1287
1294
  const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, Wt = {
@@ -1293,7 +1300,7 @@ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
1293
1300
  }, Gt = {
1294
1301
  key: 1,
1295
1302
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1296
- }, Xt = /* @__PURE__ */ O({
1303
+ }, Xt = /* @__PURE__ */ U({
1297
1304
  __name: "select",
1298
1305
  props: {
1299
1306
  id: {},
@@ -1319,142 +1326,143 @@ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
1319
1326
  sort: {}
1320
1327
  },
1321
1328
  emits: ["update:modelValue", "change", "clear"],
1322
- setup(i, { expose: a, emit: v }) {
1323
- const t = i, s = v, r = _(null), {
1324
- innerValue: c,
1325
- filteredOptions: m,
1326
- isSelected: d,
1327
- selectItem: x,
1328
- clear: p,
1329
- resetSearch: n,
1330
- toggleShowAll: o,
1331
- isReqProc: h,
1332
- showAll: g,
1333
- isEnableShowAll: k,
1334
- searchTerm: y,
1335
- labelKey: $,
1336
- valueKey: C,
1337
- highlightedIndex: l,
1338
- onKeyDown: b,
1339
- selectedLabels: K,
1340
- totalCount: A
1329
+ setup(c, { expose: n, emit: b }) {
1330
+ const t = c, a = b, r = _(null), {
1331
+ innerValue: i,
1332
+ filteredOptions: p,
1333
+ isSelected: v,
1334
+ selectItem: h,
1335
+ clear: u,
1336
+ resetSearch: s,
1337
+ toggleShowAll: m,
1338
+ isReqProc: C,
1339
+ showAll: y,
1340
+ isEnableShowAll: g,
1341
+ searchTerm: l,
1342
+ labelKey: V,
1343
+ valueKey: w,
1344
+ highlightedIndex: o,
1345
+ onKeyDown: x,
1346
+ selectedLabels: S,
1347
+ totalCount: B
1341
1348
  } = Yt({
1342
1349
  ...t,
1343
1350
  modelValue: t.modelValue
1344
- }, s);
1351
+ }, a);
1345
1352
  ae(() => {
1346
- n();
1347
- }), M(
1353
+ s();
1354
+ }), D(
1348
1355
  () => t.modelValue,
1349
- (L) => {
1350
- L === void 0 && (t.multi ? c.value = [] : c.value = void 0);
1356
+ (E) => {
1357
+ E === void 0 && (t.multi ? i.value = [] : i.value = void 0);
1351
1358
  }
1352
1359
  );
1353
- const Y = _([]);
1354
- return M(l, (L) => {
1355
- L >= 0 && Y.value[L] && Y.value[L]?.scrollIntoView({
1360
+ const K = _([]);
1361
+ return D(o, (E) => {
1362
+ E >= 0 && K.value[E] && K.value[E]?.scrollIntoView({
1356
1363
  block: "nearest",
1357
1364
  behavior: "smooth"
1358
1365
  });
1359
- }), M(m, () => {
1360
- Y.value = [];
1361
- }), a({
1362
- clear: p,
1366
+ }), D(p, () => {
1367
+ K.value = [];
1368
+ }), n({
1369
+ clear: u,
1363
1370
  inputTextRef: r,
1364
- selectedLabels: K
1365
- }), (L, j) => (f(), w("div", {
1366
- class: D([L.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
1371
+ selectedLabels: S
1372
+ }), (E, L) => (f(), k("div", {
1373
+ class: M([E.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
1367
1374
  }, [
1368
- u("div", Pt, [
1369
- T(u("input", {
1370
- "onUpdate:modelValue": j[0] || (j[0] = (E) => Ee(y) ? y.value = E : null),
1371
- onKeydown: j[1] || (j[1] = //@ts-ignore
1372
- (...E) => e(b) && e(b)(...E)),
1375
+ d("div", Pt, [
1376
+ O(d("input", {
1377
+ "onUpdate:modelValue": L[0] || (L[0] = (T) => Ee(l) ? l.value = T : null),
1378
+ onKeydown: L[1] || (L[1] = //@ts-ignore
1379
+ (...T) => e(x) && e(x)(...T)),
1373
1380
  class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
1374
1381
  placeholder: "Пошук",
1375
1382
  type: "text",
1376
1383
  ref_key: "inputTextRef",
1377
1384
  ref: r
1378
1385
  }, null, 544), [
1379
- [G, e(y)]
1386
+ [G, e(l)]
1380
1387
  ]),
1381
- N(De, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
1382
- N(Re, {
1383
- onClick: j[2] || (j[2] = (E) => y.value = ""),
1388
+ Y(Re, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
1389
+ e(l) != "" ? (f(), R(De, {
1390
+ key: 0,
1391
+ onClick: L[2] || (L[2] = (T) => l.value = ""),
1384
1392
  class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
1385
- })
1393
+ })) : $("", !0)
1386
1394
  ]),
1387
- u("div", {
1388
- class: D([
1389
- L.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
1390
- L.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
1395
+ d("div", {
1396
+ class: M([
1397
+ E.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
1398
+ E.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
1391
1399
  ])
1392
1400
  }, [
1393
- (f(!0), w(R, null, W(e(m), (E, Q) => (f(), S(me, {
1394
- layout: L.layout,
1395
- count: E.count,
1396
- label: E[e($)],
1397
- color: E.color,
1398
- type: L.multi ? "checkbox" : "radio",
1399
- value: E[e(C)],
1400
- "is-selected": e(d)(E),
1401
- highlighted: Q === e(l),
1402
- onItemClick: (re) => e(x)(E),
1401
+ (f(!0), k(F, null, W(e(p), (T, Q) => (f(), R(me, {
1402
+ layout: E.layout,
1403
+ count: T.count,
1404
+ label: T[e(V)],
1405
+ color: T.color,
1406
+ type: E.multi ? "checkbox" : "radio",
1407
+ value: T[e(w)],
1408
+ "is-selected": e(v)(T),
1409
+ highlighted: Q === e(o),
1410
+ onItemClick: (re) => e(h)(T),
1403
1411
  ref_for: !0,
1404
- ref: (re) => Y.value[Q] = re?.el
1412
+ ref: (re) => K.value[Q] = re?.el
1405
1413
  }, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
1406
1414
  ], 2),
1407
- L.type === "select" && e(m).length === 0 && !e(h) ? (f(), w("div", Wt, [
1408
- u("div", qt, [
1409
- N(ve),
1410
- j[7] || (j[7] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
1411
- u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
1412
- u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
1415
+ E.type === "select" && e(p).length === 0 && !e(C) ? (f(), k("div", Wt, [
1416
+ d("div", qt, [
1417
+ Y(ve),
1418
+ L[7] || (L[7] = d("div", { class: "max-w-sm mx-auto mt-6" }, [
1419
+ d("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
1420
+ d("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
1413
1421
  ], -1))
1414
1422
  ])
1415
- ])) : V("", !0),
1416
- L.layout !== "popover" && L.type !== "select" ? (f(), w(R, { key: 1 }, [
1417
- !e(g) && e(k) ? (f(), w("div", {
1423
+ ])) : $("", !0),
1424
+ E.layout !== "popover" && E.type !== "select" ? (f(), k(F, { key: 1 }, [
1425
+ !e(y) && e(g) ? (f(), k("div", {
1418
1426
  key: 0,
1419
- onClick: j[3] || (j[3] = //@ts-ignore
1420
- (...E) => e(o) && e(o)(...E)),
1427
+ onClick: L[3] || (L[3] = //@ts-ignore
1428
+ (...T) => e(m) && e(m)(...T)),
1421
1429
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1422
1430
  }, [
1423
- j[8] || (j[8] = z(" Показати більше ", -1)),
1424
- N(ie)
1425
- ])) : V("", !0),
1426
- e(g) ? (f(), w("div", {
1431
+ L[8] || (L[8] = N(" Показати більше ", -1)),
1432
+ Y(ue)
1433
+ ])) : $("", !0),
1434
+ e(y) ? (f(), k("div", {
1427
1435
  key: 1,
1428
- onClick: j[4] || (j[4] = //@ts-ignore
1429
- (...E) => e(o) && e(o)(...E)),
1436
+ onClick: L[4] || (L[4] = //@ts-ignore
1437
+ (...T) => e(m) && e(m)(...T)),
1430
1438
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1431
1439
  }, [
1432
- j[9] || (j[9] = z(" Показати менше ", -1)),
1433
- N(ye)
1434
- ])) : V("", !0)
1435
- ], 64)) : V("", !0),
1436
- L.cleanable ? (f(), w(R, { key: 2 }, [
1437
- L.layout === "inline" ? (f(), w("div", Qt, [
1438
- z(F(L.multi && Array.isArray(e(c)) ? e(c)?.length : e(c) !== void 0 && (e(c) || e(c) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано ", 1),
1439
- T(u("button", {
1440
+ L[9] || (L[9] = N(" Показати менше ", -1)),
1441
+ Y(ye)
1442
+ ])) : $("", !0)
1443
+ ], 64)) : $("", !0),
1444
+ E.cleanable ? (f(), k(F, { key: 2 }, [
1445
+ E.layout === "inline" ? (f(), k("div", Qt, [
1446
+ N(j(E.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + j(e(B)) + " обрано ", 1),
1447
+ O(d("button", {
1440
1448
  class: "text-gray-600 hover:text-gray-800",
1441
- onClick: j[5] || (j[5] = //@ts-ignore
1442
- (...E) => e(p) && e(p)(...E))
1449
+ onClick: L[5] || (L[5] = //@ts-ignore
1450
+ (...T) => e(u) && e(u)(...T))
1443
1451
  }, " Очистити ", 512), [
1444
- [X, e(c) !== "" && e(c) !== void 0 || e(c)]
1452
+ [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1445
1453
  ])
1446
- ])) : V("", !0),
1447
- L.layout === "popover" ? (f(), w("div", Gt, [
1448
- u("span", null, F(L.multi && Array.isArray(e(c)) ? e(c)?.length : e(c) !== void 0 && (e(c) || e(c) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано", 1),
1449
- T(u("button", {
1454
+ ])) : $("", !0),
1455
+ E.layout === "popover" ? (f(), k("div", Gt, [
1456
+ d("span", null, j(E.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + j(e(B)) + " обрано", 1),
1457
+ O(d("button", {
1450
1458
  class: "text-gray-600 hover:text-gray-800",
1451
- onClick: j[6] || (j[6] = //@ts-ignore
1452
- (...E) => e(p) && e(p)(...E))
1459
+ onClick: L[6] || (L[6] = //@ts-ignore
1460
+ (...T) => e(u) && e(u)(...T))
1453
1461
  }, " Очистити ", 512), [
1454
- [X, e(c) !== "" && e(c) !== void 0 || e(c)]
1462
+ [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1455
1463
  ])
1456
- ])) : V("", !0)
1457
- ], 64)) : V("", !0)
1464
+ ])) : $("", !0)
1465
+ ], 64)) : $("", !0)
1458
1466
  ], 2));
1459
1467
  }
1460
1468
  }), Jt = ["for", "onClick"], Zt = ["id", "name", "value"], el = { class: "block" }, tl = {
@@ -1463,7 +1471,7 @@ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
1463
1471
  }, ll = {
1464
1472
  key: 1,
1465
1473
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1466
- }, ol = /* @__PURE__ */ O({
1474
+ }, ol = /* @__PURE__ */ U({
1467
1475
  __name: "tag-field",
1468
1476
  props: {
1469
1477
  id: {},
@@ -1489,71 +1497,71 @@ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
1489
1497
  sort: {}
1490
1498
  },
1491
1499
  emits: ["update:modelValue", "change", "clear"],
1492
- setup(i, { expose: a, emit: v }) {
1493
- const t = i, s = v, {
1500
+ setup(c, { expose: n, emit: b }) {
1501
+ const t = c, a = b, {
1494
1502
  innerValue: r,
1495
- isSelected: c,
1496
- selectItem: m,
1497
- clear: d,
1498
- labelKey: x,
1499
- valueKey: p,
1500
- allOptions: n
1501
- } = t.multi ? Se({
1503
+ isSelected: i,
1504
+ selectItem: p,
1505
+ clear: v,
1506
+ labelKey: h,
1507
+ valueKey: u,
1508
+ allOptions: s
1509
+ } = t.multi ? Be({
1502
1510
  ...t,
1503
1511
  modelValue: t.modelValue ?? t.default ?? []
1504
- }, s) : Be({
1512
+ }, a) : Se({
1505
1513
  ...t,
1506
1514
  modelValue: t.modelValue !== void 0 ? t.modelValue : t.default ?? ""
1507
- }, s);
1508
- return a({
1509
- clear: d
1510
- }), M(
1515
+ }, a);
1516
+ return n({
1517
+ clear: v
1518
+ }), D(
1511
1519
  () => t.modelValue,
1512
- (o) => {
1513
- o === void 0 && (t.multi ? r.value = [] : r.value = void 0);
1520
+ (m) => {
1521
+ m === void 0 && (t.multi ? r.value = [] : r.value = void 0);
1514
1522
  }
1515
- ), (o, h) => (f(), w(R, null, [
1516
- u("div", {
1517
- class: D(["grid grid-cols-3 gap-2 mx-[1px]", o.layout === "popover" ? "m-1" : "mb-1"])
1523
+ ), (m, C) => (f(), k(F, null, [
1524
+ d("div", {
1525
+ class: M(["grid grid-cols-3 gap-2 mx-[1px]", m.layout === "popover" ? "m-1" : "mb-1"])
1518
1526
  }, [
1519
- (f(!0), w(R, null, W(e(n), (g) => (f(), w("label", {
1520
- key: `item-${g[e(p)]}`,
1521
- for: `item-${g[e(p)]}`,
1522
- onClick: _e((k) => e(m)(g), ["stop", "prevent"]),
1523
- class: D([e(c)(g) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1527
+ (f(!0), k(F, null, W(e(s), (y) => (f(), k("label", {
1528
+ key: `item-${y[e(u)]}`,
1529
+ for: `item-${y[e(u)]}`,
1530
+ onClick: $e((g) => e(p)(y), ["stop", "prevent"]),
1531
+ class: M([e(i)(y) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1524
1532
  }, [
1525
- u("input", {
1533
+ d("input", {
1526
1534
  type: "checkbox",
1527
- id: `item-${g[e(p)]}`,
1535
+ id: `item-${y[e(u)]}`,
1528
1536
  class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
1529
- name: `item-${g[e(p)]}`,
1530
- value: g[e(p)]
1537
+ name: `item-${y[e(u)]}`,
1538
+ value: y[e(u)]
1531
1539
  }, null, 8, Zt),
1532
- u("span", el, F(g[e(x)]), 1)
1540
+ d("span", el, j(y[e(h)]), 1)
1533
1541
  ], 10, Jt))), 128))
1534
1542
  ], 2),
1535
- o.cleanable ? (f(), w(R, { key: 0 }, [
1536
- o.layout === "inline" ? (f(), w("div", tl, [
1537
- z(F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(n).length) + " обрано ", 1),
1538
- T(u("button", {
1543
+ m.cleanable ? (f(), k(F, { key: 0 }, [
1544
+ m.layout === "inline" ? (f(), k("div", tl, [
1545
+ N(j(m.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + j(e(s).length) + " обрано ", 1),
1546
+ O(d("button", {
1539
1547
  class: "text-gray-600 hover:text-gray-800",
1540
- onClick: h[0] || (h[0] = //@ts-ignore
1541
- (...g) => e(d) && e(d)(...g))
1548
+ onClick: C[0] || (C[0] = //@ts-ignore
1549
+ (...y) => e(v) && e(v)(...y))
1542
1550
  }, " Очистити ", 512), [
1543
1551
  [X, e(r) !== "" && e(r) !== void 0 || e(r)]
1544
1552
  ])
1545
- ])) : V("", !0),
1546
- o.layout === "popover" ? (f(), w("div", ll, [
1547
- u("span", null, F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(n).length) + " обрано", 1),
1548
- T(u("button", {
1553
+ ])) : $("", !0),
1554
+ m.layout === "popover" ? (f(), k("div", ll, [
1555
+ d("span", null, j(m.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + j(e(s).length) + " обрано", 1),
1556
+ O(d("button", {
1549
1557
  class: "text-gray-600 hover:text-gray-800",
1550
- onClick: h[1] || (h[1] = //@ts-ignore
1551
- (...g) => e(d) && e(d)(...g))
1558
+ onClick: C[1] || (C[1] = //@ts-ignore
1559
+ (...y) => e(v) && e(v)(...y))
1552
1560
  }, " Очистити ", 512), [
1553
1561
  [X, e(r) !== void 0 && e(r) !== "" || e(r)]
1554
1562
  ])
1555
- ])) : V("", !0)
1556
- ], 64)) : V("", !0)
1563
+ ])) : $("", !0)
1564
+ ], 64)) : $("", !0)
1557
1565
  ], 64));
1558
1566
  }
1559
1567
  }), nl = {}, al = {
@@ -1568,12 +1576,12 @@ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
1568
1576
  "stroke-linejoin": "round",
1569
1577
  class: "text-blue-600 w-[16px] h-[16px]"
1570
1578
  };
1571
- function rl(i, a) {
1572
- return f(), w("svg", al, a[0] || (a[0] = [
1573
- u("path", { d: "M20 6 9 17l-5-5" }, null, -1)
1579
+ function rl(c, n) {
1580
+ return f(), k("svg", al, n[0] || (n[0] = [
1581
+ d("path", { d: "M20 6 9 17l-5-5" }, null, -1)
1574
1582
  ]));
1575
1583
  }
1576
- const te = /* @__PURE__ */ J(nl, [["render", rl]]), sl = {}, ul = {
1584
+ const ee = /* @__PURE__ */ J(nl, [["render", rl]]), sl = {}, il = {
1577
1585
  xmlns: "http://www.w3.org/2000/svg",
1578
1586
  width: "15px",
1579
1587
  height: "24",
@@ -1585,17 +1593,17 @@ const te = /* @__PURE__ */ J(nl, [["render", rl]]), sl = {}, ul = {
1585
1593
  "stroke-linejoin": "round",
1586
1594
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
1587
1595
  };
1588
- function il(i, a) {
1589
- return f(), w("svg", ul, a[0] || (a[0] = [
1590
- u("path", {
1596
+ function ul(c, n) {
1597
+ return f(), k("svg", il, n[0] || (n[0] = [
1598
+ d("path", {
1591
1599
  stroke: "none",
1592
1600
  d: "M0 0h24v24H0z",
1593
1601
  fill: "none"
1594
1602
  }, null, -1),
1595
- u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1603
+ d("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1596
1604
  ]));
1597
1605
  }
1598
- const dl = /* @__PURE__ */ J(sl, [["render", il]]), cl = {}, fl = {
1606
+ const dl = /* @__PURE__ */ J(sl, [["render", ul]]), cl = {}, fl = {
1599
1607
  xmlns: "http://www.w3.org/2000/svg",
1600
1608
  width: "15px",
1601
1609
  height: "24",
@@ -1607,21 +1615,21 @@ const dl = /* @__PURE__ */ J(sl, [["render", il]]), cl = {}, fl = {
1607
1615
  "stroke-linejoin": "round",
1608
1616
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
1609
1617
  };
1610
- function pl(i, a) {
1611
- return f(), w("svg", fl, a[0] || (a[0] = [
1612
- u("path", {
1618
+ function pl(c, n) {
1619
+ return f(), k("svg", fl, n[0] || (n[0] = [
1620
+ d("path", {
1613
1621
  stroke: "none",
1614
1622
  d: "M0 0h24v24H0z",
1615
1623
  fill: "none"
1616
1624
  }, null, -1),
1617
- u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1625
+ d("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1618
1626
  ]));
1619
1627
  }
1620
1628
  const ml = /* @__PURE__ */ J(cl, [["render", pl]]), vl = { class: "flex" }, yl = { class: "mb-1" }, gl = { class: "mb-1" }, bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, hl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, xl = {
1621
1629
  key: 1,
1622
1630
  class: "flex gap-1 !w-[75%] rounded-lg"
1623
1631
  }, kl = ["max", "disabled"], wl = ["min", "disabled"];
1624
- const Cl = /* @__PURE__ */ O({
1632
+ const Cl = /* @__PURE__ */ U({
1625
1633
  __name: "date-input-inline",
1626
1634
  props: {
1627
1635
  id: {},
@@ -1647,161 +1655,161 @@ const Cl = /* @__PURE__ */ O({
1647
1655
  sort: {}
1648
1656
  },
1649
1657
  emits: ["update:modelValue", "change", "clear"],
1650
- setup(i, { expose: a, emit: v }) {
1651
- const t = i, s = v, r = _(null), {
1652
- activeMode: c,
1653
- innerValue: m,
1654
- onSelectChange: d,
1655
- nextClick: x,
1656
- prevClick: p,
1657
- currentLabel: n,
1658
- clear: o
1659
- } = Fe({
1658
+ setup(c, { expose: n, emit: b }) {
1659
+ const t = c, a = b, r = _(null), {
1660
+ activeMode: i,
1661
+ innerValue: p,
1662
+ onSelectChange: v,
1663
+ nextClick: h,
1664
+ prevClick: u,
1665
+ currentLabel: s,
1666
+ clear: m
1667
+ } = Ke({
1660
1668
  ...t,
1661
1669
  popoverRef: r
1662
- }, s);
1663
- return M(() => t.modelValue, (h) => {
1664
- h !== void 0 ? (m.value = h, s("update:modelValue", h)) : (c.value = "", m.value = []);
1665
- }), a({
1666
- clear: o,
1670
+ }, a);
1671
+ return D(() => t.modelValue, (C) => {
1672
+ C !== void 0 ? (p.value = C, a("update:modelValue", C)) : (i.value = "", p.value = []);
1673
+ }), n({
1674
+ clear: m,
1667
1675
  popoverRef: r
1668
- }), (h, g) => (f(), w(R, null, [
1669
- u("div", vl, [
1670
- N(ge, {
1676
+ }), (C, y) => (f(), k(F, null, [
1677
+ d("div", vl, [
1678
+ Y(ge, {
1671
1679
  ref_key: "popoverRef",
1672
1680
  ref: r,
1673
- label: e(n),
1674
- "current-value": e(m),
1675
- mode: h.mode,
1676
- onClear: e(o),
1677
- layout: h.layout
1681
+ label: e(s),
1682
+ "current-value": e(p),
1683
+ mode: C.mode,
1684
+ onClear: e(m),
1685
+ layout: C.layout
1678
1686
  }, {
1679
- default: le(() => [
1680
- u("div", null, [
1681
- u("button", {
1687
+ default: te(() => [
1688
+ d("div", null, [
1689
+ d("button", {
1682
1690
  type: "button",
1683
- onClick: g[0] || (g[0] = (k) => e(d)("range")),
1691
+ onClick: y[0] || (y[0] = (g) => e(v)("range")),
1684
1692
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1685
1693
  }, [
1686
- g[12] || (g[12] = z(" Період ", -1)),
1687
- e(c) === "range" ? (f(), S(te, { key: 0 })) : V("", !0)
1694
+ y[12] || (y[12] = N(" Період ", -1)),
1695
+ e(i) === "range" ? (f(), R(ee, { key: 0 })) : $("", !0)
1688
1696
  ])
1689
1697
  ]),
1690
- g[19] || (g[19] = u("div", null, [
1691
- u("div", { class: "pt-1 mt-1 border-t" })
1698
+ y[19] || (y[19] = d("div", null, [
1699
+ d("div", { class: "pt-1 mt-1 border-t" })
1692
1700
  ], -1)),
1693
- u("div", null, [
1694
- u("button", {
1701
+ d("div", null, [
1702
+ d("button", {
1695
1703
  type: "button",
1696
- onClick: g[1] || (g[1] = (k) => e(d)("today")),
1704
+ onClick: y[1] || (y[1] = (g) => e(v)("today")),
1697
1705
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1698
1706
  }, [
1699
- g[13] || (g[13] = z(" Сьогодні ", -1)),
1700
- e(c) === "today" ? (f(), S(te, { key: 0 })) : V("", !0)
1707
+ y[13] || (y[13] = N(" Сьогодні ", -1)),
1708
+ e(i) === "today" ? (f(), R(ee, { key: 0 })) : $("", !0)
1701
1709
  ])
1702
1710
  ]),
1703
- u("div", null, [
1704
- u("button", {
1711
+ d("div", null, [
1712
+ d("button", {
1705
1713
  type: "button",
1706
- onClick: g[2] || (g[2] = (k) => e(d)("week")),
1714
+ onClick: y[2] || (y[2] = (g) => e(v)("week")),
1707
1715
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1708
1716
  }, [
1709
- g[14] || (g[14] = z(" Тиждень ", -1)),
1710
- e(c) === "week" ? (f(), S(te, { key: 0 })) : V("", !0)
1717
+ y[14] || (y[14] = N(" Тиждень ", -1)),
1718
+ e(i) === "week" ? (f(), R(ee, { key: 0 })) : $("", !0)
1711
1719
  ])
1712
1720
  ]),
1713
- u("div", null, [
1714
- u("button", {
1721
+ d("div", null, [
1722
+ d("button", {
1715
1723
  type: "button",
1716
- onClick: g[3] || (g[3] = (k) => e(d)("month")),
1724
+ onClick: y[3] || (y[3] = (g) => e(v)("month")),
1717
1725
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1718
1726
  }, [
1719
- g[15] || (g[15] = z(" Місяць ", -1)),
1720
- e(c) === "month" ? (f(), S(te, { key: 0 })) : V("", !0)
1727
+ y[15] || (y[15] = N(" Місяць ", -1)),
1728
+ e(i) === "month" ? (f(), R(ee, { key: 0 })) : $("", !0)
1721
1729
  ])
1722
1730
  ]),
1723
- u("div", null, [
1724
- u("button", {
1731
+ d("div", null, [
1732
+ d("button", {
1725
1733
  type: "button",
1726
- onClick: g[4] || (g[4] = (k) => e(d)("quarter")),
1734
+ onClick: y[4] || (y[4] = (g) => e(v)("quarter")),
1727
1735
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1728
1736
  }, [
1729
- g[16] || (g[16] = z(" Квартал ", -1)),
1730
- e(c) === "quarter" ? (f(), S(te, { key: 0 })) : V("", !0)
1737
+ y[16] || (y[16] = N(" Квартал ", -1)),
1738
+ e(i) === "quarter" ? (f(), R(ee, { key: 0 })) : $("", !0)
1731
1739
  ])
1732
1740
  ]),
1733
- u("div", yl, [
1734
- u("button", {
1741
+ d("div", yl, [
1742
+ d("button", {
1735
1743
  type: "button",
1736
- onClick: g[5] || (g[5] = (k) => e(d)("year")),
1744
+ onClick: y[5] || (y[5] = (g) => e(v)("year")),
1737
1745
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1738
1746
  }, [
1739
- g[17] || (g[17] = z(" Рік ", -1)),
1740
- e(c) === "year" ? (f(), S(te, { key: 0 })) : V("", !0)
1747
+ y[17] || (y[17] = N(" Рік ", -1)),
1748
+ e(i) === "year" ? (f(), R(ee, { key: 0 })) : $("", !0)
1741
1749
  ])
1742
1750
  ]),
1743
- u("div", gl, [
1744
- u("button", {
1751
+ d("div", gl, [
1752
+ d("button", {
1745
1753
  type: "button",
1746
- onClick: g[6] || (g[6] = (k) => e(o)()),
1754
+ onClick: y[6] || (y[6] = (g) => e(m)()),
1747
1755
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1748
1756
  }, [
1749
- g[18] || (g[18] = z(" Весь час ", -1)),
1750
- e(m)[0] ? V("", !0) : (f(), S(te, { key: 0 }))
1757
+ y[18] || (y[18] = N(" Весь час ", -1)),
1758
+ e(p)[0] ? $("", !0) : (f(), R(ee, { key: 0 }))
1751
1759
  ])
1752
1760
  ])
1753
1761
  ]),
1754
1762
  _: 1,
1755
1763
  __: [19]
1756
1764
  }, 8, ["label", "current-value", "mode", "onClear", "layout"]),
1757
- e(c) !== "" && e(c) !== "range" && e(c) !== "last_7_days" ? (f(), w(R, { key: 0 }, [
1758
- u("div", bl, [
1759
- u("button", {
1765
+ e(i) !== "" && e(i) !== "range" && e(i) !== "last_7_days" ? (f(), k(F, { key: 0 }, [
1766
+ d("div", bl, [
1767
+ d("button", {
1760
1768
  type: "button",
1761
1769
  title: "Попередній період",
1762
1770
  class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1763
- onClick: g[7] || (g[7] = //@ts-ignore
1764
- (...k) => e(p) && e(p)(...k))
1771
+ onClick: y[7] || (y[7] = //@ts-ignore
1772
+ (...g) => e(u) && e(u)(...g))
1765
1773
  }, [
1766
- N(dl)
1774
+ Y(dl)
1767
1775
  ])
1768
1776
  ]),
1769
- u("div", hl, [
1770
- u("button", {
1777
+ d("div", hl, [
1778
+ d("button", {
1771
1779
  type: "button",
1772
1780
  title: "Наступний період",
1773
1781
  class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1774
- onClick: g[8] || (g[8] = //@ts-ignore
1775
- (...k) => e(x) && e(x)(...k))
1782
+ onClick: y[8] || (y[8] = //@ts-ignore
1783
+ (...g) => e(h) && e(h)(...g))
1776
1784
  }, [
1777
- N(ml)
1785
+ Y(ml)
1778
1786
  ])
1779
1787
  ])
1780
- ], 64)) : V("", !0),
1781
- e(c) !== "" && e(c) === "range" ? (f(), w("div", xl, [
1782
- T(u("input", {
1788
+ ], 64)) : $("", !0),
1789
+ e(i) !== "" && e(i) === "range" ? (f(), k("div", xl, [
1790
+ O(d("input", {
1783
1791
  type: "date",
1784
- max: e(m)[1],
1792
+ max: e(p)[1],
1785
1793
  locale: "uk-UA",
1786
- "onUpdate:modelValue": g[9] || (g[9] = (k) => e(m)[0] = k),
1794
+ "onUpdate:modelValue": y[9] || (y[9] = (g) => e(p)[0] = g),
1787
1795
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1788
- disabled: h.disabled
1796
+ disabled: C.disabled
1789
1797
  }, null, 8, kl), [
1790
- [G, e(m)[0]]
1798
+ [G, e(p)[0]]
1791
1799
  ]),
1792
- T(u("input", {
1800
+ O(d("input", {
1793
1801
  type: "date",
1794
- min: e(m)[0],
1802
+ min: e(p)[0],
1795
1803
  locale: "uk-UA",
1796
- "onUpdate:modelValue": g[10] || (g[10] = (k) => e(m)[1] = k),
1804
+ "onUpdate:modelValue": y[10] || (y[10] = (g) => e(p)[1] = g),
1797
1805
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1798
- disabled: h.disabled
1806
+ disabled: C.disabled
1799
1807
  }, null, 8, wl), [
1800
- [G, e(m)[1]]
1808
+ [G, e(p)[1]]
1801
1809
  ])
1802
- ])) : V("", !0)
1810
+ ])) : $("", !0)
1803
1811
  ]),
1804
- (h.cleanable, V("", !0))
1812
+ (C.cleanable, $("", !0))
1805
1813
  ], 64));
1806
1814
  }
1807
1815
  }), ke = {
@@ -1815,24 +1823,24 @@ const Cl = /* @__PURE__ */ O({
1815
1823
  tag: ol,
1816
1824
  "date:inline": Cl
1817
1825
  };
1818
- function be(i, a) {
1819
- let v;
1820
- switch (i.toLowerCase()) {
1826
+ function be(c, n) {
1827
+ let b;
1828
+ switch (c.toLowerCase()) {
1821
1829
  case "autocomplete":
1822
- v = "select";
1830
+ b = "select";
1823
1831
  break;
1824
1832
  case "check":
1825
- v = "checkbox";
1833
+ b = "checkbox";
1826
1834
  break;
1827
1835
  default:
1828
- v = i?.toString().toLowerCase();
1836
+ b = c?.toString().toLowerCase();
1829
1837
  }
1830
- return v === "date" && a && a === "inline" && (v = "date:inline"), {
1831
- component: ke[v] || ke.text,
1832
- type: v
1838
+ return b === "date" && n && n === "inline" && (b = "date:inline"), {
1839
+ component: ke[b] || ke.text,
1840
+ type: b
1833
1841
  };
1834
1842
  }
1835
- const Vl = {}, _l = {
1843
+ const Vl = {}, $l = {
1836
1844
  xmlns: "http://www.w3.org/2000/svg",
1837
1845
  width: "15px",
1838
1846
  height: "24",
@@ -1844,18 +1852,18 @@ const Vl = {}, _l = {
1844
1852
  "stroke-linejoin": "round",
1845
1853
  class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
1846
1854
  };
1847
- function $l(i, a) {
1848
- return f(), w("svg", _l, a[0] || (a[0] = [
1849
- u("path", {
1855
+ function _l(c, n) {
1856
+ return f(), k("svg", $l, n[0] || (n[0] = [
1857
+ d("path", {
1850
1858
  stroke: "none",
1851
1859
  d: "M0 0h24v24H0z",
1852
1860
  fill: "none"
1853
1861
  }, null, -1),
1854
- u("path", { d: "M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747" }, null, -1),
1855
- u("path", { d: "M20 4v5h-5" }, null, -1)
1862
+ d("path", { d: "M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747" }, null, -1),
1863
+ d("path", { d: "M20 4v5h-5" }, null, -1)
1856
1864
  ]));
1857
1865
  }
1858
- const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Sl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Dl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Rl = { class: "flex items-center" }, Ml = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Kl = { class: "filter-layout__body" }, Fl = /* @__PURE__ */ O({
1866
+ const Al = /* @__PURE__ */ J(Vl, [["render", _l]]), Sl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Bl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Rl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Dl = { class: "flex items-center" }, Ml = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Fl = { class: "filter-layout__body" }, Kl = /* @__PURE__ */ U({
1859
1867
  __name: "vertical-layout",
1860
1868
  props: {
1861
1869
  id: {},
@@ -1881,69 +1889,69 @@ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "in
1881
1889
  sort: {}
1882
1890
  },
1883
1891
  emits: ["update:modelValue", "change", "clear"],
1884
- setup(i, { expose: a, emit: v }) {
1885
- const t = i, s = v, r = _(), c = be(t.type, t.layout), m = I({
1892
+ setup(c, { expose: n, emit: b }) {
1893
+ const t = c, a = b, r = _(), i = be(t.type, t.layout), p = I({
1886
1894
  get: () => t.modelValue,
1887
- set: (n) => s("update:modelValue", n)
1895
+ set: (s) => a("update:modelValue", s)
1888
1896
  });
1889
- function d(n) {
1890
- s("clear", n);
1897
+ function v(s) {
1898
+ a("clear", s);
1891
1899
  }
1892
- function x(n, o) {
1893
- s("change", { name: n, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
1900
+ function h(s, m) {
1901
+ a("change", { name: s, value: m }), t.modelValue !== void 0 && a("update:modelValue", m);
1894
1902
  }
1895
- function p() {
1896
- r.value && r.value.clear(), s("clear", t.name);
1903
+ function u() {
1904
+ r.value && r.value.clear(), a("clear", t.name);
1897
1905
  }
1898
- return M(
1906
+ return D(
1899
1907
  () => t.default,
1900
- (n) => {
1901
- m.value = n;
1908
+ (s) => {
1909
+ p.value = s;
1902
1910
  }
1903
- ), M(
1911
+ ), D(
1904
1912
  () => t.modelValue,
1905
- (n) => {
1906
- m.value = n;
1913
+ (s) => {
1914
+ p.value = s;
1907
1915
  }
1908
- ), a({
1916
+ ), n({
1909
1917
  filterRef: r
1910
- }), (n, o) => (f(), w("div", Bl, [
1911
- u("div", Sl, [
1912
- u("div", Dl, [
1913
- u("div", Rl, [
1914
- u("span", Ml, F(n.label), 1)
1918
+ }), (s, m) => (f(), k("div", Sl, [
1919
+ d("div", Bl, [
1920
+ d("div", Rl, [
1921
+ d("div", Dl, [
1922
+ d("span", Ml, j(s.label), 1)
1915
1923
  ]),
1916
- typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((h) => h !== void 0) || m.value === null ? (f(), S(Al, {
1924
+ typeof p.value == "string" && p.value.trim() !== "" || Array.isArray(p.value) && p.value.length > 0 && p.value.some((C) => C !== void 0) || p.value === null ? (f(), R(Al, {
1917
1925
  key: 0,
1918
- onClick: p
1919
- })) : V("", !0)
1926
+ onClick: u
1927
+ })) : $("", !0)
1920
1928
  ]),
1921
- u("div", Kl, [
1922
- e(c)?.type !== "select" ? (f(), S(ee(e(c)?.component), P({ key: 0 }, t, {
1923
- type: e(c)?.type,
1924
- onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
1925
- onClear: o[1] || (o[1] = (h) => d(h)),
1929
+ d("div", Fl, [
1930
+ e(i)?.type !== "select" ? (f(), R(Z(e(i)?.component), P({ key: 0 }, t, {
1931
+ type: e(i)?.type,
1932
+ onChange: m[0] || (m[0] = (C) => h(C.name, C.value)),
1933
+ onClear: m[1] || (m[1] = (C) => v(C)),
1926
1934
  ref_key: "filterRef",
1927
1935
  ref: r
1928
- }), null, 16, ["type"])) : (f(), S(ge, {
1936
+ }), null, 16, ["type"])) : (f(), R(ge, {
1929
1937
  key: 1,
1930
- "current-value": m.value,
1931
- label: n.label,
1932
- mode: n.mode,
1933
- onClear: p,
1938
+ "current-value": p.value,
1939
+ label: s.label,
1940
+ mode: s.mode,
1941
+ onClear: u,
1934
1942
  fieldRef: r.value,
1935
1943
  width: void 0,
1936
- disabled: n.disabled,
1944
+ disabled: s.disabled,
1937
1945
  layout: "vertical"
1938
1946
  }, {
1939
- default: le(() => [
1940
- (f(), S(ee(e(c)?.component), P({
1947
+ default: te(() => [
1948
+ (f(), R(Z(e(i)?.component), P({
1941
1949
  ref_key: "filterRef",
1942
1950
  ref: r
1943
1951
  }, t, {
1944
- type: e(c)?.type,
1945
- onChange: o[2] || (o[2] = (h) => x(h.name, h.value)),
1946
- onClear: o[3] || (o[3] = (h) => d(h))
1952
+ type: e(i)?.type,
1953
+ onChange: m[2] || (m[2] = (C) => h(C.name, C.value)),
1954
+ onClear: m[3] || (m[3] = (C) => v(C))
1947
1955
  }), null, 16, ["type"]))
1948
1956
  ]),
1949
1957
  _: 1
@@ -1952,7 +1960,7 @@ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "in
1952
1960
  ])
1953
1961
  ]));
1954
1962
  }
1955
- }), we = /* @__PURE__ */ O({
1963
+ }), we = /* @__PURE__ */ U({
1956
1964
  __name: "inline-layout",
1957
1965
  props: {
1958
1966
  id: {},
@@ -1978,66 +1986,63 @@ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "in
1978
1986
  sort: {}
1979
1987
  },
1980
1988
  emits: ["update:modelValue", "change", "clear"],
1981
- setup(i, { expose: a, emit: v }) {
1982
- const t = i, s = v, r = _(), c = be(t.type, t.layout), m = I({
1989
+ setup(c, { expose: n, emit: b }) {
1990
+ const t = c, a = b, r = _(), i = be(t.type, t.layout), p = I({
1983
1991
  get: () => t.modelValue,
1984
- set: (n) => s("update:modelValue", n)
1992
+ set: (u) => a("update:modelValue", u)
1985
1993
  });
1986
- function d(n) {
1987
- s("clear", n);
1994
+ function v(u = t.name) {
1995
+ a("clear", u);
1988
1996
  }
1989
- function x(n, o) {
1990
- s("change", { name: n, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
1997
+ function h(u, s) {
1998
+ a("change", { name: u, value: s }), t.modelValue !== void 0 && a("update:modelValue", s);
1991
1999
  }
1992
- function p() {
1993
- r.value && r.value.clear(), s("clear", t.name);
1994
- }
1995
- return M(
2000
+ return D(
1996
2001
  () => t.default,
1997
- (n) => {
1998
- m.value = n;
2002
+ (u) => {
2003
+ p.value = u;
1999
2004
  }
2000
- ), M(
2005
+ ), D(
2001
2006
  () => t.modelValue,
2002
- (n) => {
2003
- m.value = n;
2007
+ (u) => {
2008
+ p.value = u;
2004
2009
  }
2005
- ), a({
2010
+ ), n({
2006
2011
  filterRef: r
2007
- }), (n, o) => ["text", "date"].includes(n.type.toLocaleLowerCase()) ? (f(), S(ee(e(c)?.component), P({ key: 0 }, t, {
2008
- type: e(c)?.type,
2009
- onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
2010
- onClear: o[1] || (o[1] = (h) => d(h)),
2011
- disabled: n.disabled,
2012
- modelValue: m.value,
2013
- "onUpdate:modelValue": o[2] || (o[2] = (h) => m.value = h)
2014
- }), null, 16, ["type", "disabled", "modelValue"])) : (f(), S(ge, {
2012
+ }), (u, s) => ["text", "date"].includes(u.type.toLocaleLowerCase()) ? (f(), R(Z(e(i)?.component), P({ key: 0 }, t, {
2013
+ type: e(i)?.type,
2014
+ onChange: s[0] || (s[0] = (m) => h(m.name, m.value)),
2015
+ onClear: s[1] || (s[1] = (m) => v(m)),
2016
+ disabled: u.disabled,
2017
+ modelValue: p.value,
2018
+ "onUpdate:modelValue": s[2] || (s[2] = (m) => p.value = m)
2019
+ }), null, 16, ["type", "disabled", "modelValue"])) : (f(), R(ge, {
2015
2020
  key: 1,
2016
- "current-value": m.value,
2017
- label: n.label,
2018
- mode: n.mode,
2019
- onClear: p,
2021
+ "current-value": p.value,
2022
+ label: u.label,
2023
+ mode: u.mode,
2024
+ onClear: v,
2020
2025
  fieldRef: r.value,
2021
2026
  width: t.width,
2022
- disabled: n.disabled,
2027
+ disabled: u.disabled,
2023
2028
  layout: "inline"
2024
2029
  }, {
2025
- default: le(() => [
2026
- (f(), S(ee(e(c)?.component), P({
2030
+ default: te(() => [
2031
+ (f(), R(Z(e(i)?.component), P({
2027
2032
  ref_key: "filterRef",
2028
2033
  ref: r
2029
2034
  }, t, {
2030
- modelValue: m.value,
2031
- "onUpdate:modelValue": o[3] || (o[3] = (h) => m.value = h),
2032
- type: e(c)?.type,
2033
- onChange: o[4] || (o[4] = (h) => x(h.name, h.value)),
2034
- onClear: o[5] || (o[5] = (h) => d(h))
2035
+ modelValue: p.value,
2036
+ "onUpdate:modelValue": s[3] || (s[3] = (m) => p.value = m),
2037
+ type: e(i)?.type,
2038
+ onChange: s[4] || (s[4] = (m) => h(m.name, m.value)),
2039
+ onClear: s[5] || (s[5] = (m) => v(m))
2035
2040
  }), null, 16, ["modelValue", "type"]))
2036
2041
  ]),
2037
2042
  _: 1
2038
2043
  }, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
2039
2044
  }
2040
- }), jl = /* @__PURE__ */ O({
2045
+ }), jl = /* @__PURE__ */ U({
2041
2046
  __name: "popover-layout",
2042
2047
  props: {
2043
2048
  id: {},
@@ -2063,45 +2068,45 @@ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "in
2063
2068
  sort: {}
2064
2069
  },
2065
2070
  emits: ["update:modelValue", "change", "clear"],
2066
- setup(i, { expose: a, emit: v }) {
2067
- const t = i, s = v, r = _(), c = _(be(t.type, t.layout)), m = I({
2071
+ setup(c, { expose: n, emit: b }) {
2072
+ const t = c, a = b, r = _(), i = _(be(t.type, t.layout)), p = I({
2068
2073
  get: () => t.modelValue,
2069
- set: (p) => s("update:modelValue", p)
2074
+ set: (u) => a("update:modelValue", u)
2070
2075
  });
2071
- function d(p) {
2072
- s("clear", p);
2076
+ function v(u) {
2077
+ a("clear", u);
2073
2078
  }
2074
- function x(p, n) {
2075
- s("change", { name: p, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2079
+ function h(u, s) {
2080
+ a("change", { name: u, value: s }), t.modelValue !== void 0 && a("update:modelValue", s);
2076
2081
  }
2077
- return M(
2082
+ return D(
2078
2083
  () => t.default,
2079
- (p) => {
2080
- m.value = p;
2084
+ (u) => {
2085
+ p.value = u;
2081
2086
  }
2082
- ), M(
2087
+ ), D(
2083
2088
  () => t.modelValue,
2084
- (p) => {
2085
- m.value = p;
2089
+ (u) => {
2090
+ p.value = u;
2086
2091
  }
2087
- ), M(
2092
+ ), D(
2088
2093
  () => t,
2089
- (p) => {
2090
- m.value = p;
2094
+ (u) => {
2095
+ p.value = u;
2091
2096
  }
2092
- ), a({
2097
+ ), n({
2093
2098
  filterRef: r
2094
- }), (p, n) => (f(), S(ee(c.value?.component), P(t, {
2095
- type: c.value?.type,
2096
- modelValue: m.value,
2097
- "onUpdate:modelValue": n[0] || (n[0] = (o) => m.value = o),
2098
- onChange: n[1] || (n[1] = (o) => x(o.name, o.value)),
2099
- onClear: n[2] || (n[2] = (o) => d(o)),
2099
+ }), (u, s) => (f(), R(Z(i.value?.component), P(t, {
2100
+ type: i.value?.type,
2101
+ modelValue: p.value,
2102
+ "onUpdate:modelValue": s[0] || (s[0] = (m) => p.value = m),
2103
+ onChange: s[1] || (s[1] = (m) => h(m.name, m.value)),
2104
+ onClear: s[2] || (s[2] = (m) => v(m)),
2100
2105
  ref_key: "filterRef",
2101
2106
  ref: r
2102
2107
  }), null, 16, ["type", "modelValue"]));
2103
2108
  }
2104
- }), oe = /* @__PURE__ */ O({
2109
+ }), le = /* @__PURE__ */ U({
2105
2110
  __name: "filter-field",
2106
2111
  props: {
2107
2112
  id: {},
@@ -2127,193 +2132,189 @@ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "in
2127
2132
  sort: { default: "name" }
2128
2133
  },
2129
2134
  emits: ["update:modelValue", "change", "clear"],
2130
- setup(i, { expose: a, emit: v }) {
2131
- const t = i, s = v, r = _(), c = I({
2135
+ setup(c, { expose: n, emit: b }) {
2136
+ const t = c, a = b, r = _(), i = I({
2132
2137
  get: () => t.modelValue,
2133
- set: (p) => s("update:modelValue", p)
2138
+ set: (u) => a("update:modelValue", u)
2134
2139
  });
2135
- function m(p) {
2136
- s("clear", p);
2140
+ function p(u) {
2141
+ a("clear", u);
2137
2142
  }
2138
- function d(p, n) {
2139
- s("change", { name: p, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2143
+ function v(u, s) {
2144
+ a("change", { name: u, value: s }), t.modelValue !== void 0 && a("update:modelValue", s);
2140
2145
  }
2141
- M(
2146
+ D(
2142
2147
  () => t.default,
2143
- (p) => {
2144
- c.value = p;
2148
+ (u) => {
2149
+ i.value = u;
2145
2150
  }
2146
- ), M(
2151
+ ), D(
2147
2152
  () => t.modelValue,
2148
- (p) => {
2149
- c.value = p;
2153
+ (u) => {
2154
+ i.value = u;
2150
2155
  }
2151
- ), a({
2156
+ ), n({
2152
2157
  filterRef: r
2153
2158
  });
2154
- function x() {
2159
+ function h() {
2155
2160
  switch (t.layout) {
2156
2161
  case "inline":
2157
2162
  return we;
2158
2163
  case "vertical":
2159
- return Fl;
2164
+ return Kl;
2160
2165
  case "popover":
2161
2166
  return jl;
2162
2167
  default:
2163
2168
  return we;
2164
2169
  }
2165
2170
  }
2166
- return (p, n) => (f(), S(ee(x()), P(t, {
2167
- onChange: n[0] || (n[0] = (o) => d(o.name, o.value)),
2168
- onClear: n[1] || (n[1] = (o) => m(o)),
2169
- modelValue: c.value,
2170
- "onUpdate:modelValue": n[2] || (n[2] = (o) => c.value = o)
2171
+ return (u, s) => (f(), R(Z(h()), P(t, {
2172
+ onChange: s[0] || (s[0] = (m) => v(m.name, m.value)),
2173
+ onClear: s[1] || (s[1] = (m) => p(m)),
2174
+ modelValue: i.value,
2175
+ "onUpdate:modelValue": s[2] || (s[2] = (m) => i.value = m)
2171
2176
  }), null, 16, ["modelValue"]));
2172
2177
  }
2173
2178
  });
2174
- function he(i, a) {
2179
+ function he(c, n) {
2175
2180
  const {
2176
- slots: v
2177
- } = i, t = _(i.value ?? {}), s = I(() => (Z(v?.default?.()) ?? []).flatMap((l) => Array.isArray(l.children) ? l.children : [l]));
2178
- function r(C) {
2179
- delete t.value[C], a("clear", {
2180
- data: Z(t.value),
2181
- name: C
2181
+ slots: b
2182
+ } = c, t = _(c.value ?? {}), a = I(() => (ne(b?.default?.()) ?? []).flatMap((o) => Array.isArray(o.children) ? o.children : [o]));
2183
+ function r(w) {
2184
+ delete t.value[w], n("clear", {
2185
+ data: ne(t.value),
2186
+ name: w
2182
2187
  });
2183
2188
  }
2184
- function c(C, l) {
2185
- l === void 0 ? (r(C), a("change", {
2186
- data: Z(t.value),
2187
- name: C,
2188
- undefined: void 0
2189
- })) : t.value = {
2189
+ function i(w, o) {
2190
+ o === void 0 ? r(w) : t.value = {
2190
2191
  ...t.value,
2191
- [C]: l
2192
- }, a("change", {
2193
- data: Z(t.value),
2194
- name: C,
2195
- value: l
2192
+ [w]: o
2193
+ }, n("change", {
2194
+ data: ne(t.value),
2195
+ name: w,
2196
+ value: o
2196
2197
  });
2197
2198
  }
2198
- const m = I(() => s.value.map((C) => {
2199
- const l = C.props?.name;
2200
- return Ie(C, {
2201
- ...C.props,
2202
- layout: i.view,
2199
+ const p = I(() => a.value.map((w) => {
2200
+ const o = w.props?.name;
2201
+ return Te(w, {
2202
+ ...w.props,
2203
+ layout: c.view,
2203
2204
  showClean: !0,
2204
- modelValue: t[l],
2205
- "onUpdate:modelValue": (b) => {
2206
- c(l, b);
2205
+ modelValue: t[o],
2206
+ "onUpdate:modelValue": (x) => {
2207
+ i(o, x);
2207
2208
  },
2208
- onClear: () => r(l)
2209
+ onClear: () => r(o)
2209
2210
  });
2210
- })), d = I(
2211
+ })), v = I(
2211
2212
  () => new Map(
2212
- m.value.map((C) => {
2213
- const l = C.props?.name;
2214
- return l ? [l, C] : null;
2215
- }).filter((C) => C !== null)
2213
+ p.value.map((w) => {
2214
+ const o = w.props?.name;
2215
+ return o ? [o, w] : null;
2216
+ }).filter((w) => w !== null)
2216
2217
  )
2217
2218
  );
2218
- function x() {
2219
- t.value = {}, a("clearAll", {
2220
- data: Z(t.value),
2219
+ function h(w = !1) {
2220
+ t.value = {}, w || n("clearAll", {
2221
+ data: ne(t.value),
2221
2222
  name: "ALL"
2222
2223
  });
2223
2224
  }
2224
- const p = _(""), n = I(() => i.schema?.value ? Object.entries(t.value).filter(([C, l]) => i.schema && !(C in i.schema.value) ? !1 : Array.isArray(l) ? l.some((b) => b !== "" && b !== void 0) : l !== "" && l !== void 0).length : 0), o = _();
2225
- M(p, async () => {
2226
- await fe(), o?.value?.filterRef?.inputTextRef && o.value.filterRef.inputTextRef.focus();
2225
+ const u = _(""), s = I(() => c.schema?.value ? Object.entries(t.value).filter(([w, o]) => c.schema && !(w in c.schema.value) ? !1 : Array.isArray(o) ? o.some((x) => x !== "" && x !== void 0) : o !== "" && o !== void 0).length : 0), m = _();
2226
+ D(u, async () => {
2227
+ await fe(), m?.value?.filterRef?.inputTextRef && m.value.filterRef.inputTextRef.focus();
2227
2228
  });
2228
- const h = I(() => i.schema?.value ? Object.fromEntries(Object.entries(i.schema?.value).slice(0, i.limit)) : {}), g = I(() => i.schema?.value ? i.view !== "inline" ? i.schema?.value : Object.fromEntries(Object.entries(i.schema?.value).slice(i.limit)) : {}), k = I(() => {
2229
- if (m.value.length === 0) return [];
2230
- let C = 0;
2231
- if (i.schema?.value) {
2232
- const l = Object.entries(i.schema.value).length;
2233
- l < i.limit ? C = i.limit - l : C = 0;
2229
+ const C = I(() => c.schema?.value ? Object.fromEntries(Object.entries(c.schema?.value).slice(0, c.limit)) : {}), y = I(() => c.schema?.value ? c.view !== "inline" ? c.schema?.value : Object.fromEntries(Object.entries(c.schema?.value).slice(c.limit)) : {}), g = I(() => {
2230
+ if (p.value.length === 0) return [];
2231
+ let w = 0;
2232
+ if (c.schema?.value) {
2233
+ const o = Object.entries(c.schema.value).length;
2234
+ o < c.limit ? w = c.limit - o : w = 0;
2234
2235
  }
2235
- return m.value.slice(0, C);
2236
- }), y = I(() => m.value.length === 0 ? [] : i.view !== "inline" ? m.value : m.value.slice(k.value.length));
2237
- function $() {
2238
- if (g.value) {
2239
- const [C] = Object.keys(g.value);
2240
- p.value = C;
2241
- } else y.value.length > 0 ? p.value = y.value[0].props.name : p.value = "";
2236
+ return p.value.slice(0, w);
2237
+ }), l = I(() => p.value.length === 0 ? [] : c.view !== "inline" ? p.value : p.value.slice(g.value.length));
2238
+ function V() {
2239
+ if (y.value) {
2240
+ const [w] = Object.keys(y.value);
2241
+ u.value = w;
2242
+ } else l.value.length > 0 ? u.value = l.value[0].props.name : u.value = "";
2242
2243
  }
2243
2244
  return {
2244
2245
  activeFilter: t,
2245
- activeFilterCount: n,
2246
- onFilterChange: c,
2246
+ activeFilterCount: s,
2247
+ onFilterChange: i,
2247
2248
  clearFilter: r,
2248
- clearAllFilters: x,
2249
- limitedSchema: h,
2250
- popoverSchema: g,
2251
- filtersSlot: m,
2252
- limitedFiltersSlot: k,
2253
- popoverFiltersSlot: y,
2254
- vnodeMap: d,
2255
- onPopoverOpen: $,
2256
- selectedFilter: p,
2257
- filterRef: o
2249
+ clearAllFilters: h,
2250
+ limitedSchema: C,
2251
+ popoverSchema: y,
2252
+ filtersSlot: p,
2253
+ limitedFiltersSlot: g,
2254
+ popoverFiltersSlot: l,
2255
+ vnodeMap: v,
2256
+ onPopoverOpen: V,
2257
+ selectedFilter: u,
2258
+ filterRef: m
2258
2259
  };
2259
2260
  }
2260
- const Ll = /* @__PURE__ */ O({
2261
+ const Ll = /* @__PURE__ */ U({
2261
2262
  __name: "popover",
2262
2263
  emits: ["open", "close"],
2263
- setup(i, { emit: a }) {
2264
- const v = _(!1), t = _(null), s = _(null), r = _(null), c = _({ top: "0px", left: "0px", position: "absolute" });
2265
- function m() {
2266
- v.value = !v.value;
2264
+ setup(c, { emit: n }) {
2265
+ const b = _(!1), t = _(null), a = _(null), r = _(null), i = _({ top: "0px", left: "0px", position: "absolute" });
2266
+ function p() {
2267
+ b.value = !b.value;
2267
2268
  }
2268
- function d() {
2269
- const o = r.value, h = t.value;
2270
- if (!o || !h) return;
2271
- const g = o.getBoundingClientRect(), k = h.offsetWidth, y = window.innerWidth - g.left;
2272
- let $ = g.left + window.scrollX;
2273
- k > y && ($ = window.innerWidth - k - 8, $ < 8 && ($ = 8)), c.value = {
2269
+ function v() {
2270
+ const m = r.value, C = t.value;
2271
+ if (!m || !C) return;
2272
+ const y = m.getBoundingClientRect(), g = C.offsetWidth, l = window.innerWidth - y.left;
2273
+ let V = y.left + window.scrollX;
2274
+ g > l && (V = window.innerWidth - g - 8, V < 8 && (V = 8)), i.value = {
2274
2275
  position: "absolute",
2275
- top: `${g.bottom + window.scrollY + 8}px`,
2276
- left: `${$}px`
2276
+ top: `${y.bottom + window.scrollY + 8}px`,
2277
+ left: `${V}px`
2277
2278
  };
2278
2279
  }
2279
- function x(o) {
2280
- const h = o.target;
2281
- !r.value?.contains(o.target) && !t.value?.contains(o.target) && !h.closest("[data-inside-popover]") && (v.value = !1);
2280
+ function h(m) {
2281
+ const C = m.target;
2282
+ !r.value?.contains(m.target) && !t.value?.contains(m.target) && !C.closest("[data-inside-popover]") && (b.value = !1);
2282
2283
  }
2283
- const p = _(!1);
2284
+ const u = _(!1);
2284
2285
  ae(() => {
2285
- p.value = !0;
2286
+ u.value = !0;
2286
2287
  }), ae(() => {
2287
- r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click", x), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
2288
+ r.value = a.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", p), document.addEventListener("click", h), window.addEventListener("resize", v), window.addEventListener("scroll", v, !0);
2288
2289
  }), ce(() => {
2289
- r.value?.removeEventListener("click", m), document.removeEventListener("click", x), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
2290
+ r.value?.removeEventListener("click", p), document.removeEventListener("click", h), window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0);
2290
2291
  });
2291
- const n = a;
2292
- return M(v, async (o) => {
2293
- o ? (n("open"), await fe(), d()) : n("close");
2294
- }), (o, h) => (f(), w("div", {
2292
+ const s = n;
2293
+ return D(b, async (m) => {
2294
+ m ? (s("open"), await fe(), v()) : s("close");
2295
+ }), (m, C) => (f(), k("div", {
2295
2296
  ref_key: "wrapperRef",
2296
- ref: s
2297
+ ref: a
2297
2298
  }, [
2298
- ue(o.$slots, "trigger"),
2299
- p.value ? (f(), S($e, {
2299
+ ie(m.$slots, "trigger"),
2300
+ u.value ? (f(), R(_e, {
2300
2301
  key: 0,
2301
2302
  to: "body"
2302
2303
  }, [
2303
- T(u("div", {
2304
+ O(d("div", {
2304
2305
  ref_key: "popoverRef",
2305
2306
  ref: t,
2306
2307
  class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
2307
- style: Ae(c.value)
2308
+ style: Ae(i.value)
2308
2309
  }, [
2309
- ue(o.$slots, "default")
2310
+ ie(m.$slots, "default")
2310
2311
  ], 4), [
2311
- [X, v.value]
2312
+ [X, b.value]
2312
2313
  ])
2313
- ])) : V("", !0)
2314
+ ])) : $("", !0)
2314
2315
  ], 512));
2315
2316
  }
2316
- }), El = {}, Il = {
2317
+ }), El = {}, Tl = {
2317
2318
  xmlns: "http://www.w3.org/2000/svg",
2318
2319
  width: "24",
2319
2320
  height: "24",
@@ -2325,12 +2326,12 @@ const Ll = /* @__PURE__ */ O({
2325
2326
  "stroke-linejoin": "round",
2326
2327
  class: "lucide lucide-filter h-4 w-4"
2327
2328
  };
2328
- function Tl(i, a) {
2329
- return f(), w("svg", Il, a[0] || (a[0] = [
2330
- u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2329
+ function Il(c, n) {
2330
+ return f(), k("svg", Tl, n[0] || (n[0] = [
2331
+ d("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2331
2332
  ]));
2332
2333
  }
2333
- const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2334
+ const Ol = /* @__PURE__ */ J(El, [["render", Il]]), Ul = {
2334
2335
  key: 0,
2335
2336
  class: "inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"
2336
2337
  }, zl = { class: "flex" }, Nl = { class: "w-64 border-r border-gray-200" }, Hl = { class: "p-2" }, Yl = ["onClick"], Pl = { class: "flex items-center gap-2" }, Wl = { class: "text-sm font-medium" }, ql = {
@@ -2345,7 +2346,7 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2345
2346
  }, eo = { class: "flex-1 min-h-[300px] overflow-y-auto" }, to = {
2346
2347
  key: 0,
2347
2348
  class: "flex items-center justify-center h-full text-gray-500"
2348
- }, je = /* @__PURE__ */ O({
2349
+ }, je = /* @__PURE__ */ U({
2349
2350
  __name: "popover-filter-layout",
2350
2351
  props: {
2351
2352
  schema: {},
@@ -2356,146 +2357,145 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2356
2357
  limit: { default: 3 }
2357
2358
  },
2358
2359
  emits: ["change", "clear", "clearAll"],
2359
- setup(i, { expose: a, emit: v }) {
2360
- const t = i, s = Ke(t.mode), r = pe(), c = v, m = _({}), {
2361
- activeFilter: d,
2362
- activeFilterCount: x,
2363
- onFilterChange: p,
2364
- clearFilter: n,
2365
- clearAllFilters: o,
2366
- popoverSchema: h,
2367
- popoverFiltersSlot: g,
2368
- onPopoverOpen: k,
2369
- selectedFilter: y,
2370
- filterRef: $
2360
+ setup(c, { expose: n, emit: b }) {
2361
+ const t = c, a = Fe(t.mode), r = pe(), i = b, p = _({}), {
2362
+ activeFilter: v,
2363
+ activeFilterCount: h,
2364
+ onFilterChange: u,
2365
+ clearFilter: s,
2366
+ clearAllFilters: m,
2367
+ popoverSchema: C,
2368
+ popoverFiltersSlot: y,
2369
+ onPopoverOpen: g,
2370
+ selectedFilter: l,
2371
+ filterRef: V
2371
2372
  } = he({
2372
2373
  ...t,
2373
- schema: m,
2374
+ schema: p,
2374
2375
  slots: r
2375
- }, c);
2376
- return M(
2376
+ }, i);
2377
+ return D(
2377
2378
  () => t.schema,
2378
- (C) => {
2379
- m.value = C;
2379
+ (w) => {
2380
+ p.value = w;
2380
2381
  },
2381
2382
  { deep: !0, immediate: !0 }
2382
- ), a({
2383
- clearFilter: n,
2384
- clearAllFilters: o
2385
- }), (C, l) => (f(), S(Ll, {
2386
- onOpen: e(k),
2387
- onClose: l[5] || (l[5] = (b) => y.value = "")
2383
+ ), n({
2384
+ clearFilter: s,
2385
+ clearAllFilters: m
2386
+ }), (w, o) => (f(), R(Ll, {
2387
+ onOpen: e(g),
2388
+ onClose: o[5] || (o[5] = (x) => l.value = "")
2388
2389
  }, {
2389
- trigger: le(() => [
2390
- u("button", {
2390
+ trigger: te(() => [
2391
+ d("button", {
2391
2392
  "data-popover-trigger": "",
2392
2393
  "aria-haspopup": "dialog",
2393
2394
  "aria-expanded": "false",
2394
- class: D(
2395
- e(s) + (e(x) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2395
+ class: M(
2396
+ e(a) + (e(h) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2396
2397
  ),
2397
2398
  type: "button"
2398
2399
  }, [
2399
- N(Ol),
2400
- l[6] || (l[6] = z(" Фільтр ", -1)),
2401
- e(x) > 0 ? (f(), w("div", Ul, F(e(x)), 1)) : V("", !0)
2400
+ Y(Ol),
2401
+ o[6] || (o[6] = N(" Фільтр ", -1)),
2402
+ e(h) > 0 ? (f(), k("div", Ul, j(e(h)), 1)) : $("", !0)
2402
2403
  ], 2)
2403
2404
  ]),
2404
- default: le(() => [
2405
- u("div", zl, [
2406
- u("div", Nl, [
2407
- l[7] || (l[7] = u("div", { class: "p-4 border-b" }, [
2408
- u("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
2405
+ default: te(() => [
2406
+ d("div", zl, [
2407
+ d("div", Nl, [
2408
+ o[7] || (o[7] = d("div", { class: "p-4 border-b" }, [
2409
+ d("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
2409
2410
  ], -1)),
2410
- u("div", Hl, [
2411
- C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w("button", {
2412
- key: b,
2411
+ d("div", Hl, [
2412
+ w.schema ? (f(!0), k(F, { key: 0 }, W(Object.entries(e(C)), ([x, S]) => (f(), k("button", {
2413
+ key: x,
2413
2414
  onClick: () => {
2414
- y.value = b;
2415
+ l.value = x;
2415
2416
  },
2416
- class: D([
2417
+ class: M([
2417
2418
  "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2418
- e(y) === b ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2419
+ e(l) === x ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2419
2420
  ])
2420
2421
  }, [
2421
- u("div", Pl, [
2422
- u("span", Wl, F(K.label), 1)
2422
+ d("div", Pl, [
2423
+ d("span", Wl, j(S.label), 1)
2423
2424
  ]),
2424
- (Array.isArray(e(d)[b]) ? e(d)[b]?.length > 0 : e(d)[b] || e(d)[b] === null) ? (f(), w("div", ql)) : V("", !0)
2425
- ], 10, Yl))), 128)) : V("", !0),
2426
- (f(!0), w(R, null, W(e(g), (b, K) => (f(), w("button", {
2427
- key: "slot-" + K,
2428
- onClick: (A) => y.value = b.props.name,
2429
- class: D([
2425
+ (Array.isArray(e(v)[x]) ? e(v)[x]?.length > 0 : e(v)[x] || e(v)[x] === null) ? (f(), k("div", ql)) : $("", !0)
2426
+ ], 10, Yl))), 128)) : $("", !0),
2427
+ (f(!0), k(F, null, W(e(y), (x, S) => (f(), k("button", {
2428
+ key: "slot-" + S,
2429
+ onClick: (B) => l.value = x.props.name,
2430
+ class: M([
2430
2431
  "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2431
- e(y) === b.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2432
+ e(l) === x.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2432
2433
  ])
2433
2434
  }, [
2434
- u("div", Gl, [
2435
- u("span", Xl, F(b.props.label), 1)
2435
+ d("div", Gl, [
2436
+ d("span", Xl, j(x.props.label), 1)
2436
2437
  ]),
2437
- e(d)[b.props.name]?.length > 0 ? (f(), w("div", Jl)) : V("", !0)
2438
+ e(v)[x.props.name]?.length > 0 ? (f(), k("div", Jl)) : $("", !0)
2438
2439
  ], 10, Ql))), 128))
2439
2440
  ]),
2440
- e(x) > 0 ? (f(), w("div", Zl, [
2441
- u("button", {
2441
+ e(h) > 0 ? (f(), k("div", Zl, [
2442
+ d("button", {
2442
2443
  class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
2443
- onClick: l[0] || (l[0] = //@ts-ignore
2444
- (...b) => e(o) && e(o)(...b)),
2444
+ onClick: o[0] || (o[0] = (x) => e(m)()),
2445
2445
  "data-inside-popover": ""
2446
2446
  }, " Очистити всі ")
2447
- ])) : V("", !0)
2447
+ ])) : $("", !0)
2448
2448
  ]),
2449
- u("div", eo, [
2450
- e(y) === "" ? (f(), w("div", to, l[8] || (l[8] = [
2451
- u("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
2452
- ]))) : V("", !0),
2453
- e(y) ? (f(), w(R, { key: 1 }, [
2454
- e(h) ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w(R, null, [
2455
- e(y) === b ? (f(), S(oe, P({
2456
- name: b,
2457
- key: b,
2449
+ d("div", eo, [
2450
+ e(l) === "" ? (f(), k("div", to, o[8] || (o[8] = [
2451
+ d("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
2452
+ ]))) : $("", !0),
2453
+ e(l) ? (f(), k(F, { key: 1 }, [
2454
+ e(C) ? (f(!0), k(F, { key: 0 }, W(Object.entries(e(C)), ([x, S]) => (f(), k(F, null, [
2455
+ e(l) === x ? (f(), R(le, P({
2456
+ name: x,
2457
+ key: x,
2458
2458
  layout: "popover",
2459
2459
  ref_for: !0,
2460
2460
  ref_key: "filterRef",
2461
- ref: $
2462
- }, { ref_for: !0 }, K, {
2463
- onChange: l[1] || (l[1] = (A) => e(p)(A.name, A.value)),
2464
- onClear: l[2] || (l[2] = (A) => {
2465
- e(n)(A), e(p)(A, void 0);
2461
+ ref: V
2462
+ }, { ref_for: !0 }, S, {
2463
+ onChange: o[1] || (o[1] = (B) => e(u)(B.name, B.value)),
2464
+ onClear: o[2] || (o[2] = (B) => {
2465
+ e(s)(B), e(u)(B, void 0);
2466
2466
  }),
2467
- modelValue: e(d)[b],
2468
- "onUpdate:modelValue": (A) => e(d)[b] = A,
2467
+ modelValue: e(v)[x],
2468
+ "onUpdate:modelValue": (B) => e(v)[x] = B,
2469
2469
  cleanable: !0
2470
- }), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : V("", !0)
2471
- ], 64))), 256)) : V("", !0),
2472
- (f(!0), w(R, null, W(e(g), (b, K) => (f(), w(R, {
2473
- key: "slot-" + K
2470
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : $("", !0)
2471
+ ], 64))), 256)) : $("", !0),
2472
+ (f(!0), k(F, null, W(e(y), (x, S) => (f(), k(F, {
2473
+ key: "slot-" + S
2474
2474
  }, [
2475
- e(y) === b.props.name ? (f(), S(oe, P({
2475
+ e(l) === x.props.name ? (f(), R(le, P({
2476
2476
  key: 0,
2477
2477
  layout: "popover"
2478
- }, { ref_for: !0 }, b.props, {
2478
+ }, { ref_for: !0 }, x.props, {
2479
2479
  ref_for: !0,
2480
2480
  ref_key: "filterRef",
2481
- ref: $,
2482
- onChange: l[3] || (l[3] = (A) => e(p)(A.name, A.value)),
2483
- onClear: l[4] || (l[4] = (A) => {
2484
- e(n)(A), e(p)(A, void 0);
2481
+ ref: V,
2482
+ onChange: o[3] || (o[3] = (B) => e(u)(B.name, B.value)),
2483
+ onClear: o[4] || (o[4] = (B) => {
2484
+ e(s)(B), e(u)(B, void 0);
2485
2485
  }),
2486
- modelValue: e(d)[b.props.name],
2487
- "onUpdate:modelValue": (A) => e(d)[b.props.name] = A,
2486
+ modelValue: e(v)[x.props.name],
2487
+ "onUpdate:modelValue": (B) => e(v)[x.props.name] = B,
2488
2488
  cleanable: !0
2489
- }), null, 16, ["modelValue", "onUpdate:modelValue"])) : V("", !0)
2489
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])) : $("", !0)
2490
2490
  ], 64))), 128))
2491
- ], 64)) : V("", !0)
2491
+ ], 64)) : $("", !0)
2492
2492
  ])
2493
2493
  ])
2494
2494
  ]),
2495
2495
  _: 1
2496
2496
  }, 8, ["onOpen"]));
2497
2497
  }
2498
- }), lo = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ O({
2498
+ }), lo = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ U({
2499
2499
  __name: "inline-filter-layout",
2500
2500
  props: {
2501
2501
  schema: {},
@@ -2506,92 +2506,93 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2506
2506
  limit: { default: 3 }
2507
2507
  },
2508
2508
  emits: ["change", "clear", "clearAll"],
2509
- setup(i, { emit: a }) {
2510
- const v = i, t = a, s = pe(), r = _({}), {
2511
- activeFilter: c,
2512
- activeFilterCount: m,
2513
- onFilterChange: d,
2514
- clearFilter: x,
2515
- clearAllFilters: p,
2516
- limitedSchema: n,
2517
- popoverSchema: o,
2518
- filtersSlot: h,
2509
+ setup(c, { expose: n, emit: b }) {
2510
+ const t = c, a = b, r = pe(), i = _({}), {
2511
+ activeFilter: p,
2512
+ activeFilterCount: v,
2513
+ onFilterChange: h,
2514
+ clearFilter: u,
2515
+ clearAllFilters: s,
2516
+ limitedSchema: m,
2517
+ popoverSchema: C,
2518
+ filtersSlot: y,
2519
2519
  limitedFiltersSlot: g,
2520
- popoverFiltersSlot: k
2520
+ popoverFiltersSlot: l
2521
2521
  } = he(
2522
2522
  {
2523
- ...v,
2524
- schema: r,
2525
- slots: s
2523
+ ...t,
2524
+ schema: i,
2525
+ slots: r
2526
2526
  },
2527
- t
2528
- ), y = _();
2529
- function $() {
2530
- y.value && y.value.clearAllFilters(), p();
2527
+ a
2528
+ ), V = _();
2529
+ function w() {
2530
+ V.value && V.value.clearAllFilters(!0), s();
2531
2531
  }
2532
- return M(
2533
- () => v.schema,
2534
- (C) => {
2535
- r.value = C;
2532
+ return D(
2533
+ () => t.schema,
2534
+ (o) => {
2535
+ i.value = o;
2536
2536
  },
2537
2537
  { deep: !0, immediate: !0 }
2538
- ), (C, l) => (f(), w("div", lo, [
2539
- C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(n)), ([b, K]) => (f(), S(oe, P({
2540
- key: b,
2541
- name: b,
2542
- mode: C.mode
2543
- }, { ref_for: !0 }, K, {
2544
- onChange: l[0] || (l[0] = (A) => e(d)(A.name, A.value)),
2545
- onClear: l[1] || (l[1] = (A) => {
2546
- e(x)(A), e(d)(A, void 0);
2547
- }),
2538
+ ), n({
2539
+ clearFilter: u,
2540
+ clearAllFilters: s
2541
+ }), (o, x) => (f(), k("div", lo, [
2542
+ o.schema ? (f(!0), k(F, { key: 0 }, W(Object.entries(e(m)), ([S, B]) => (f(), R(le, P({
2543
+ key: S,
2544
+ name: S,
2545
+ mode: o.mode
2546
+ }, { ref_for: !0 }, B, {
2547
+ onChange: x[0] || (x[0] = (K) => e(h)(K.name, K.value)),
2548
+ onClear: e(u),
2548
2549
  layout: "inline",
2549
2550
  cleanable: !0,
2550
- modelValue: e(c)[b],
2551
- "onUpdate:modelValue": (A) => e(c)[b] = A
2552
- }), null, 16, ["name", "mode", "modelValue", "onUpdate:modelValue"]))), 128)) : V("", !0),
2553
- (f(!0), w(R, null, W(e(g), (b, K) => (f(), S(oe, P({
2554
- key: "slot-" + K,
2551
+ modelValue: e(p)[S],
2552
+ "onUpdate:modelValue": (K) => e(p)[S] = K
2553
+ }), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : $("", !0),
2554
+ (f(!0), k(F, null, W(e(g), (S, B) => (f(), R(le, P({
2555
+ key: "slot-" + B,
2555
2556
  layout: "inline"
2556
- }, { ref_for: !0 }, b.props, {
2557
- onChange: l[2] || (l[2] = (A) => e(d)(A.name, A.value)),
2558
- onClear: l[3] || (l[3] = (A) => {
2559
- e(x)(A), e(d)(A, void 0);
2557
+ }, { ref_for: !0 }, S.props, {
2558
+ onChange: x[1] || (x[1] = (K) => e(h)(K.name, K.value)),
2559
+ onClear: x[2] || (x[2] = (K) => {
2560
+ e(u)(K), e(h)(K, void 0);
2560
2561
  }),
2561
2562
  cleanable: !0,
2562
- modelValue: e(c)[b.props.name],
2563
- "onUpdate:modelValue": (A) => e(c)[b.props.name] = A
2563
+ modelValue: e(p)[S.props.name],
2564
+ "onUpdate:modelValue": (K) => e(p)[S.props.name] = K
2564
2565
  }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
2565
- Object.entries(e(o)).length > 0 || e(k).length > 0 ? (f(), S(je, P({ key: 1 }, v, {
2566
- schema: e(o),
2566
+ Object.entries(e(C)).length > 0 || e(l).length > 0 ? (f(), R(je, P({ key: 1 }, t, {
2567
+ schema: e(C),
2567
2568
  limit: 0,
2568
- onChange: l[4] || (l[4] = (b) => e(d)(b.name, b.value)),
2569
- onClearAll: e(p),
2570
- onClear: l[5] || (l[5] = (b) => e(x)(b.name)),
2571
- mode: C.mode,
2569
+ onChange: x[3] || (x[3] = (S) => e(h)(S.name, S.value)),
2570
+ onClearAll: x[4] || (x[4] = (S) => e(s)()),
2571
+ onClear: x[5] || (x[5] = (S) => e(u)(S.name)),
2572
+ mode: o.mode,
2572
2573
  ref_key: "popoverRef",
2573
- ref: y,
2574
+ ref: V,
2574
2575
  cleanable: !0
2575
2576
  }), {
2576
- default: le(() => [
2577
- (f(!0), w(R, null, W(e(h), (b, K) => (f(), S(ee(b), P({
2578
- key: "slot-" + K,
2577
+ default: te(() => [
2578
+ (f(!0), k(F, null, W(e(y), (S, B) => (f(), R(Z(S), P({
2579
+ key: "slot-" + B,
2579
2580
  layout: "popover"
2580
- }, { ref_for: !0 }, b.props, { cleanable: !0 }), null, 16))), 128))
2581
+ }, { ref_for: !0 }, S.props, { cleanable: !0 }), null, 16))), 128))
2581
2582
  ]),
2582
2583
  _: 1
2583
- }, 16, ["schema", "onClearAll", "mode"])) : V("", !0),
2584
- e(m) > 0 ? (f(), w("button", {
2584
+ }, 16, ["schema", "mode"])) : $("", !0),
2585
+ e(v) > 0 ? (f(), k("button", {
2585
2586
  key: 2,
2586
- onClick: $,
2587
+ onClick: w,
2587
2588
  class: "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"
2588
- }, " Очистити ")) : V("", !0)
2589
+ }, " Очистити ")) : $("", !0)
2589
2590
  ]));
2590
2591
  }
2591
2592
  }), oo = {
2592
2593
  key: 0,
2593
2594
  class: "p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
2594
- }, no = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, ao = /* @__PURE__ */ O({
2595
+ }, no = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, ao = /* @__PURE__ */ U({
2595
2596
  __name: "vertical-filter-layout",
2596
2597
  props: {
2597
2598
  schema: {},
@@ -2602,58 +2603,60 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2602
2603
  limit: { default: 3 }
2603
2604
  },
2604
2605
  emits: ["change", "clear", "clearAll"],
2605
- setup(i, { emit: a }) {
2606
- const v = i, t = a, s = pe(), {
2607
- activeFilter: r,
2608
- activeFilterCount: c,
2609
- onFilterChange: m,
2610
- clearFilter: d,
2611
- clearAllFilters: x,
2612
- filtersSlot: p
2606
+ setup(c, { expose: n, emit: b }) {
2607
+ const t = c, a = b, r = pe(), {
2608
+ activeFilter: i,
2609
+ activeFilterCount: p,
2610
+ onFilterChange: v,
2611
+ clearFilter: h,
2612
+ clearAllFilters: u,
2613
+ filtersSlot: s
2613
2614
  } = he({
2614
- ...v,
2615
- slots: s
2616
- }, t);
2617
- return (n, o) => n.view === "vertical" ? (f(), w("div", oo, [
2618
- u("div", no, [
2619
- e(c) > 0 ? (f(), w("button", {
2615
+ ...t,
2616
+ slots: r
2617
+ }, a);
2618
+ return n({
2619
+ clearFilter: h,
2620
+ clearAllFilters: u
2621
+ }), (m, C) => m.view === "vertical" ? (f(), k("div", oo, [
2622
+ d("div", no, [
2623
+ e(p) > 0 ? (f(), k("button", {
2620
2624
  key: 0,
2621
- onClick: o[0] || (o[0] = //@ts-ignore
2622
- (...h) => e(x) && e(x)(...h)),
2625
+ onClick: C[0] || (C[0] = (y) => e(u)()),
2623
2626
  "data-popover-trigger": "",
2624
2627
  "aria-haspopup": "dialog",
2625
2628
  "aria-expanded": "false",
2626
2629
  class: "w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",
2627
2630
  type: "button"
2628
- }, " Очистити ")) : V("", !0),
2629
- n.schema ? (f(!0), w(R, { key: 1 }, W(Object.entries(n.schema), ([h, g]) => (f(), S(oe, P({
2630
- name: h,
2631
+ }, " Очистити ")) : $("", !0),
2632
+ m.schema ? (f(!0), k(F, { key: 1 }, W(Object.entries(m.schema), ([y, g]) => (f(), R(le, P({
2633
+ name: y,
2631
2634
  layout: "vertical"
2632
2635
  }, { ref_for: !0 }, g, {
2633
- onChange: o[1] || (o[1] = (k) => e(m)(k.name, k.value)),
2634
- onClear: o[2] || (o[2] = (k) => {
2635
- e(d)(k), e(m)(k, void 0);
2636
+ onChange: C[1] || (C[1] = (l) => e(v)(l.name, l.value)),
2637
+ onClear: C[2] || (C[2] = (l) => {
2638
+ e(h)(l), e(v)(l, void 0);
2636
2639
  }),
2637
- modelValue: e(r)[h],
2638
- "onUpdate:modelValue": (k) => e(r)[h] = k,
2640
+ modelValue: e(i)[y],
2641
+ "onUpdate:modelValue": (l) => e(i)[y] = l,
2639
2642
  showClean: !0
2640
- }), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : V("", !0),
2641
- (f(!0), w(R, null, W(e(p), (h, g) => (f(), S(oe, P({
2643
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : $("", !0),
2644
+ (f(!0), k(F, null, W(e(s), (y, g) => (f(), R(le, P({
2642
2645
  key: "slot-" + g,
2643
2646
  layout: "vertical"
2644
- }, { ref_for: !0 }, h.props, {
2645
- onChange: o[3] || (o[3] = (k) => e(m)(k.name, k.value)),
2646
- onClear: o[4] || (o[4] = (k) => {
2647
- e(d)(k), e(m)(k, void 0);
2647
+ }, { ref_for: !0 }, y.props, {
2648
+ onChange: C[3] || (C[3] = (l) => e(v)(l.name, l.value)),
2649
+ onClear: C[4] || (C[4] = (l) => {
2650
+ e(h)(l), e(v)(l, void 0);
2648
2651
  }),
2649
- modelValue: e(r)[h.props.name],
2650
- "onUpdate:modelValue": (k) => e(r)[h.props.name] = k,
2652
+ modelValue: e(i)[y.props.name],
2653
+ "onUpdate:modelValue": (l) => e(i)[y.props.name] = l,
2651
2654
  showClean: !0
2652
2655
  }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
2653
2656
  ])
2654
- ])) : V("", !0);
2657
+ ])) : $("", !0);
2655
2658
  }
2656
- }), Ve = /* @__PURE__ */ O({
2659
+ }), Ve = /* @__PURE__ */ U({
2657
2660
  __name: "filter",
2658
2661
  props: {
2659
2662
  schema: {},
@@ -2664,37 +2667,52 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2664
2667
  limit: { default: 3 }
2665
2668
  },
2666
2669
  emits: ["change", "clear", "clearAll"],
2667
- setup(i, { emit: a }) {
2668
- const v = i, t = _(v.value ?? {}), s = a;
2669
- function r(p, n) {
2670
- t.value = {
2671
- ...t.value,
2672
- [p]: n
2673
- }, s("change", {
2674
- data: Z(t.value),
2675
- name: p,
2676
- value: n
2670
+ setup(c, { expose: n, emit: b }) {
2671
+ const t = c, a = _(t.value ?? {}), r = b, i = _();
2672
+ function p(g) {
2673
+ if (Array.isArray(g))
2674
+ return g.map((l) => p(l));
2675
+ if (g !== null && typeof g == "object") {
2676
+ const l = ne(g), V = {};
2677
+ for (const w in l)
2678
+ V[w] = p(l[w]);
2679
+ return V;
2680
+ }
2681
+ return g;
2682
+ }
2683
+ function v(g, l) {
2684
+ l !== void 0 ? a.value = {
2685
+ ...a.value,
2686
+ [g]: l
2687
+ } : delete a.value[g], r("change", {
2688
+ data: p(a.value),
2689
+ name: g,
2690
+ value: p(l)
2677
2691
  });
2678
2692
  }
2679
- function c(p) {
2680
- delete t.value[p], s("clear", {
2681
- data: Z(t.value),
2682
- name: p
2693
+ function h(g) {
2694
+ delete a.value[g], r("clear", {
2695
+ data: p(a.value),
2696
+ name: g
2697
+ }), r("change", {
2698
+ data: p(a.value),
2699
+ name: g,
2700
+ value: null
2683
2701
  });
2684
2702
  }
2685
- function m() {
2686
- t.value = {}, s("clear", {
2687
- data: Z(t.value),
2703
+ function u() {
2704
+ a.value = {}, r("clear", {
2705
+ data: p(a.value),
2688
2706
  name: "ALL"
2689
- }), s("change", {
2690
- data: Z(t.value),
2707
+ }), r("change", {
2708
+ data: p(a.value),
2691
2709
  name: "ALL",
2692
2710
  value: null
2693
2711
  });
2694
2712
  }
2695
- const d = _({});
2696
- function x() {
2697
- switch (v.view) {
2713
+ const s = _({});
2714
+ function m() {
2715
+ switch (t.view) {
2698
2716
  case "inline":
2699
2717
  return Ce;
2700
2718
  case "vertical":
@@ -2705,40 +2723,63 @@ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2705
2723
  return Ce;
2706
2724
  }
2707
2725
  }
2708
- return M(
2709
- () => v.schema,
2710
- (p) => {
2711
- if (!p) {
2712
- d.value = {};
2726
+ D(
2727
+ () => t.schema,
2728
+ (g) => {
2729
+ if (!g) {
2730
+ s.value = {};
2713
2731
  return;
2714
2732
  }
2715
- if (Array.isArray(p) && !p.length) {
2716
- d.value = {};
2733
+ if (Array.isArray(g) && !g.length) {
2734
+ s.value = {};
2717
2735
  return;
2718
2736
  }
2719
- Array.isArray(p) ? d.value = p.filter((n) => n.type).reduce((n, o) => (Object.assign(o, { name: o.id || o.name, type: o.type.toLowerCase() }), n[o.name] = o, o.data && !o.api && !o.options && Object.assign(o, { api: `/api/suggest/${o.data}` }), n), {}) : (Object.entries(p).forEach(([n, o]) => {
2720
- Object.assign(o, { name: n || o.name || o.id, type: o.type.toLowerCase() });
2721
- }), d.value = { ...p });
2737
+ Array.isArray(g) ? s.value = g.filter((l) => l.type).reduce((l, V) => (Object.assign(V, { name: V.id || V.name, type: V.type.toLowerCase() }), l[V.name] = V, V.data && !V.api && !V.options && Object.assign(V, { api: `/api/suggest/${V.data}` }), l), {}) : (Object.entries(g).forEach(([l, V]) => {
2738
+ Object.assign(V, { name: l || V.name || V.id, type: V.type.toLowerCase() });
2739
+ }), s.value = { ...g });
2722
2740
  },
2723
2741
  { immediate: !0, deep: !0 }
2724
- ), (p, n) => (f(), S(ee(x()), P(v, {
2725
- schema: d.value,
2726
- onChange: n[0] || (n[0] = (o) => r(o.name, o.value)),
2727
- onClear: n[1] || (n[1] = (o) => c(o.name)),
2728
- onClearAll: m
2742
+ );
2743
+ function C(g) {
2744
+ i.value.clearFilter(g), h(g);
2745
+ }
2746
+ function y() {
2747
+ i.value.clearAllFilters(), u();
2748
+ }
2749
+ return D(
2750
+ () => a.value,
2751
+ (g) => {
2752
+ if (t.history) {
2753
+ const l = new URL(window.location.href), V = new URLSearchParams(window.location.search);
2754
+ Object.keys(g).length > 0 ? V.set(
2755
+ "filter",
2756
+ Object.entries(g).filter(([, w]) => w).map(([w, o]) => `${w}=${o}`).join("|")
2757
+ ) : V.delete("filter"), l.search = decodeURI(V.toString()), window.history.pushState({}, "", l);
2758
+ }
2759
+ }
2760
+ ), n({
2761
+ clearAllFilters: y,
2762
+ clearFilter: C
2763
+ }), (g, l) => (f(), R(Z(m()), P(t, {
2764
+ schema: s.value,
2765
+ onChange: l[0] || (l[0] = (V) => v(V.name, V.value)),
2766
+ onClear: l[1] || (l[1] = (V) => h(V.name)),
2767
+ onClearAll: u,
2768
+ ref_key: "filterRef",
2769
+ ref: i
2729
2770
  }), {
2730
- default: le(() => [
2731
- ue(p.$slots, "default")
2771
+ default: te(() => [
2772
+ ie(g.$slots, "default")
2732
2773
  ]),
2733
2774
  _: 3
2734
2775
  }, 16, ["schema"]));
2735
2776
  }
2736
2777
  });
2737
- Ve.install = function(a) {
2738
- a.component("Filter", Ve), a.component("FilterField", oe);
2778
+ Ve.install = function(n) {
2779
+ n.component("Filter", Ve), n.component("FilterField", le);
2739
2780
  };
2740
2781
  export {
2741
2782
  Ve as Filter,
2742
- oe as FilterField,
2783
+ le as FilterField,
2743
2784
  Ve as default
2744
2785
  };