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