@opengis/filter 0.1.8 → 0.1.10

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