@opengis/filter 0.1.7 → 0.1.9

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