@opengis/filter 0.0.10 → 0.0.12

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