@opengis/filter 0.1.7 → 0.1.8

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