@opengis/filter 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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 _e, normalizeClass as D, createCommentVNode as V, toDisplayString as F, computed as I, watch as M, createStaticVNode as Le, Fragment as R, renderList as W, unref as e, createBlock as S, createVNode as N, createTextVNode as z, withDirectives as T, vShow as X, onBeforeUnmount as ce, vModelText as G, onMounted as ae, Teleport as $e, normalizeStyle as Ae, renderSlot as ue, nextTick as fe, isRef as Ee, withCtx as le, resolveDynamicComponent as ee, mergeProps as P, toRaw as Z, cloneVNode as Ie, useSlots as pe } from "vue";
2
+ const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = { class: "flex items-center cursor-pointer w-full" }, Ue = {
3
3
  key: 0,
4
4
  width: "16",
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
+ }, ze = ["value"], Ne = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, He = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, Ye = {
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(f, { expose: a, emit: v }) {
24
+ const t = f, 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", Te, [
35
+ u("div", Oe, [
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: _e(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", Ue)) : 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, ze),
58
+ u("div", Ne, [
59
+ u("span", He, F(m.label ?? "Відсутні данні"), 1),
60
+ m.count ? (c(), w("div", Ye, " (" + F(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 Be(f, a) {
69
69
  const {
70
- options: y = [],
70
+ options: v = [],
71
71
  limit: t = 20
72
- } = p;
73
- function g(o) {
72
+ } = f;
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(f.modelValue)), i = _(""), m = _(!1), d = _([]), h = _("id"), p = _("text"), n = _(!1), l = _(f.layout !== "popover" && v.length > t);
77
+ function b(o) {
78
+ const x = o.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in x) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in x) ?? "text";
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, p.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 f.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(() => f.modelValue, (o) => {
90
+ r.value = s(o);
91
+ }, { immediate: !0 }), d.value = [...v].sort((o, x) => f.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : f.sort === "name" ? String(o[p.value] ?? "").localeCompare(String(x[p.value] ?? "")) : 0);
92
+ function k(o) {
93
+ return r.value === o[h.value];
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: f.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", f.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,
115
- labelKey: f,
116
- valueKey: b,
117
- allOptions: l
113
+ showAll: n,
114
+ isEnableShowAll: l,
115
+ labelKey: p,
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 = (f, a) => {
121
+ const v = f.__vccOpts || f;
122
+ for (const [t, s] of a)
123
+ v[t] = s;
124
+ return v;
125
+ }, Pe = {}, We = {
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 qe(f, a) {
132
+ return c(), w("svg", We, a[0] || (a[0] = [
133
+ Le('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
134
134
  ]));
135
135
  }
136
- const ve = /* @__PURE__ */ X(Ne, [["render", Ye]]), We = {}, Pe = {
136
+ const ve = /* @__PURE__ */ J(Pe, [["render", qe]]), Qe = {}, Ge = {
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 Xe(f, a) {
149
+ return c(), w("svg", Ge, 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", Xe]]), Je = {}, Ze = {
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 et(f, a) {
171
+ return c(), w("svg", Ze, 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(Je, [["render", et]]), tt = {
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
+ }, lt = { class: "flex flex-col items-center justify-center p-5 text-center" }, ot = {
184
184
  key: 0,
185
185
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
186
- }, tt = {
186
+ }, nt = {
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
+ }, at = /* @__PURE__ */ O({
190
190
  __name: "radio",
191
191
  props: {
192
192
  id: {},
@@ -212,234 +212,234 @@ 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(f, { expose: a, emit: v }) {
216
+ const t = f, s = _(null), r = v, {
217
+ innerValue: i,
218
218
  filteredOptions: m,
219
- isSelected: l,
220
- selectItem: b,
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({
219
+ isSelected: d,
220
+ selectItem: h,
221
+ clear: p,
222
+ toggleShowAll: n,
223
+ isReqProc: l,
224
+ showAll: b,
225
+ isEnableShowAll: y,
226
+ labelKey: k,
227
+ valueKey: g,
228
+ allOptions: $
229
+ } = Be({
230
230
  ...t,
231
231
  modelValue: t.modelValue ?? t.default ?? ""
232
- }, s);
233
- return r({
234
- clear: f,
235
- inputTextRef: g
236
- }), F(
232
+ }, r);
233
+ return a({
234
+ clear: p,
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", tt, [
263
+ u("div", lt, [
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", ot, [
293
+ z(F(e(i) || e(i) === null ? 1 : 0) + " з " + F(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(p) && e(p)(...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", nt, [
303
+ u("span", null, F(e(i) || e(i) === null ? 1 : 0) + " з " + F(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(p) && e(p)(...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 Se(f, 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
+ } = f, i = f.multi;
323
+ function m(B) {
324
+ return i ? Array.isArray(B) ? B : B ? [B] : [] : B !== void 0 ? B : "";
325
+ }
326
+ const d = _(m(f.modelValue)), h = _(""), p = _(!1), n = _([]), l = _("id"), b = _("text"), y = _(!1), k = _(f.layout !== "popover" && t.length > s), g = _([]), $ = _(0);
327
+ function C(B) {
328
+ const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in U) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in U) ?? "text";
329
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 (f.layout === "popover") return B;
339
+ if (!h.value)
340
+ return y.value ? B : B.slice(0, s);
341
+ const U = h.value.toLowerCase();
342
+ return B.filter((q) => q[b.value].toLowerCase().includes(U));
343
343
  });
344
- let u = null;
345
- async function v(D) {
346
- if (y) {
347
- f.value = !0;
344
+ let x = null;
345
+ async function K(B) {
346
+ if (v) {
347
+ p.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 {
363
- f.value = !1;
363
+ p.value = !1;
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(() => f.modelValue, (B) => {
372
+ d.value = m(B);
373
+ }, { immediate: !0 }), v ? K("") : n.value = t;
374
+ function A(B) {
375
+ return i && Array.isArray(d.value) ? d.value.includes(B[l.value]) : d.value === B[l.value];
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: f.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", f.name);
387
387
  }
388
- function E() {
389
- u && clearTimeout(u), b.value = "", $.value = !1;
388
+ function j() {
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,
421
- isReqProc: f,
422
- showAll: $,
423
- isEnableShowAll: S,
424
- labelKey: k,
425
- valueKey: n,
426
- allOptions: a,
419
+ resetSearch: j,
420
+ toggleShowAll: E,
421
+ isReqProc: p,
422
+ showAll: y,
423
+ isEnableShowAll: k,
424
+ labelKey: b,
425
+ valueKey: l,
426
+ allOptions: n,
427
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 rt = {
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
+ }, st = { class: "flex flex-col items-center justify-center p-5 text-center" }, ut = {
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
+ }, it = {
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(f, { expose: a, emit: v }) {
469
+ const t = f, s = v, {
470
+ innerValue: r,
471
+ filteredOptions: i,
472
472
  isSelected: m,
473
- selectItem: l,
474
- clear: b,
475
- toggleShowAll: f,
476
- isReqProc: a,
477
- showAll: n,
478
- isEnableShowAll: k,
479
- labelKey: $,
480
- valueKey: S,
481
- allOptions: C
482
- } = Ae({
473
+ selectItem: d,
474
+ clear: h,
475
+ toggleShowAll: p,
476
+ isReqProc: n,
477
+ showAll: l,
478
+ isEnableShowAll: b,
479
+ labelKey: y,
480
+ valueKey: k,
481
+ allOptions: g
482
+ } = Se({
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", rt, [
514
+ u("div", st, [
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
526
- (...o) => e(f) && e(f)(...o)),
525
+ onClick: C[0] || (C[0] = //@ts-ignore
526
+ (...o) => e(p) && e(p)(...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
535
- (...o) => e(f) && e(f)(...o)),
534
+ onClick: C[1] || (C[1] = //@ts-ignore
535
+ (...o) => e(p) && e(p)(...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", ut, [
544
+ z(F(e(r).length) + " з " + F(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", it, [
554
+ u("span", null, F(e(r).length) + " з " + F(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
+ }), dt = {}, ct = {
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 ft(f, a) {
579
+ return c(), w("svg", ct, 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 De = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
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 vt(f, a) {
602
+ return c(), w("svg", mt, 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 Re = /* @__PURE__ */ J(pt, [["render", vt]]);
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 gt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, yt = ["placeholder"], bt = /* @__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(f, { emit: a }) {
645
+ const v = f, 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, [
664
+ u("div", gt, [
665
665
  N(De)
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(Re)
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] = (p) => r.value = p),
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, yt), [
681
+ [G, r.value]
682
682
  ])
683
683
  ], 2));
684
684
  }
685
685
  });
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]`;
686
+ function Me(f = { color: "blue" }) {
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-${f.color}-500 focus:border-transparent`;
689
+ return f?.size === "sm" ? `${v}h-[32px]` : `${v}h-[38px]`;
690
690
  });
691
691
  }
692
- function gt() {
692
+ function ht() {
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 xt() {
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 Ke(f) {
699
+ return f === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : f === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
700
700
  }
701
- const ht = {
701
+ const kt = {
702
702
  key: 0,
703
703
  class: "block text-xs font-medium text-gray-600 mb-1"
704
- }, xt = ["placeholder", "disabled"], kt = {
704
+ }, wt = ["placeholder", "disabled"], Ct = {
705
705
  key: 0,
706
706
  class: "block text-xs font-medium text-gray-600 mb-1"
707
- }, wt = {
707
+ }, Vt = {
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
+ }, _t = ["placeholder", "disabled"], $t = ["disabled"];
711
+ const At = /* @__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(f, { expose: a, emit: v }) {
738
+ const t = Me(), s = ht(), r = f, 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
- function f() {
750
- c.value = [], l.value = c.value, m("clear", s.name);
749
+ function p() {
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({
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")
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
+ clear: p,
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", kt, "Від")) : 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, wt), [
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", Ct, " - ")) : V("", !0),
777
+ u("div", null, [
778
+ n.layout !== "vertical" ? (c(), w("label", Vt, "До")) : 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, _t), [
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
+ }, F(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]),
801
- onClick: f,
802
- class: R(e(g) + " hover:bg-gray-100")
803
- }, "Очистити", 10, Vt)) : w("", !0)
800
+ disabled: !(d.value[0] || d.value[1]),
801
+ onClick: p,
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
+ }), Bt = ["disabled", "title"], St = {
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
+ }, Dt = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Rt = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, ye = /* @__PURE__ */ O({
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(f, { expose: a }) {
824
+ const v = f, t = I(() => Ke(v.mode)), s = _(!1), r = _({ top: 0, left: 0 }), i = _(null), m = _(null), d = _(null);
825
+ function h() {
826
+ const g = m.value, $ = d.value;
827
+ if (!g || !$) return;
828
+ const C = g.getBoundingClientRect(), o = $.offsetWidth, x = window.innerWidth, K = C.bottom + 8;
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
- function f() {
833
- g.value = !g.value, g.value && fe(() => {
834
- b(), y.fieldRef?.inputTextRef && y.fieldRef?.inputTextRef.focus();
832
+ function p() {
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", {
861
- onClick: f,
862
- disabled: C.disabled,
859
+ return (g, $) => (c(), w("div", null, [
860
+ u("button", {
861
+ onClick: p,
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
+ }, F(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", St)) : V("", !0)
873
+ ], 10, Bt),
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: Ae({ 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", Dt, [
886
+ u("div", Rt, [
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 Mt(f) {
898
+ return String(f).charAt(0).toUpperCase() + String(f).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), p = new Date(v);
912
+ return h.setDate(h.getDate() + t * 7), p.setDate(p.getDate() + t * 7), [this.format(h), this.format(p)];
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), p = new Date(d, m + 3, 0);
930
+ return [this.format(h), this.format(p)];
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 Fe(f, a) {
949
+ const {
950
+ popoverRef: v
951
+ } = f, t = _(""), s = _(
952
+ f.modelValue ?? f.default ?? []
953
+ ), r = _(0);
954
+ function i() {
955
+ const k = H.getRangeFromDaysBefore(r.value);
956
+ return s.value = [...k], a("change", { name: f.name, value: s.value }), a("update:modelValue", s.value), k;
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: f.name, value: s.value }), 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: f.name, value: s.value }), 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: f.name, value: s.value }), a("update:modelValue", s.value);
1027
+ }
1028
+ const p = [
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 `${p[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 f.label ?? "";
1073
+ }
1074
+ }
1075
+ const b = I(() => t.value ? l(t.value) : f.label ?? "");
1076
+ function y() {
1077
+ t.value = "", s.value = [], a("update:modelValue", []), a("clear", f.name);
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: p,
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 Kt = {
1095
+ key: 0,
1096
+ class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
1097
+ }, Ft = {
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"], Lt = ["min", "disabled"], Et = {
1014
1101
  key: 0,
1015
1102
  class: "block text-xs font-medium text-gray-600 mb-1"
1016
- }, Gt = ["max", "disabled"], Xt = {
1103
+ }, It = ["max", "disabled"], Tt = {
1017
1104
  key: 0,
1018
1105
  class: "block text-xs font-medium text-gray-600 mb-1"
1019
- }, Jt = {
1106
+ }, Ot = {
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
+ }, Ut = ["min", "disabled"], zt = { class: "flex gap-1 pt-2" }, Nt = ["onClick"];
1110
+ const Ht = /* @__PURE__ */ O({
1024
1111
  __name: "date-input",
1025
1112
  props: {
1026
1113
  id: {},
@@ -1046,377 +1133,113 @@ 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(f, { expose: a, emit: v }) {
1137
+ const t = f, s = Me(), r = xt(), i = v, m = _(null), {
1138
+ activeMode: d,
1139
+ innerValue: h,
1140
+ onSelectChange: p,
1141
+ nextClick: n,
1142
+ prevClick: l,
1143
+ clear: b
1144
+ } = Fe({
1145
+ ...t,
1217
1146
  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", {
1147
+ }, i);
1148
+ return M(() => t.modelValue, (y) => {
1149
+ y !== void 0 ? (h.value = y, i("update:modelValue", y)) : (d.value = "", h.value = []);
1150
+ }), a({
1151
+ clear: b,
1152
+ popoverRef: m
1153
+ }), (y, k) => (c(), w(R, null, [
1154
+ y.layout === "inline" ? (c(), w("div", Kt, [
1155
+ e(d) !== "" && e(d) === "range" ? (c(), w("div", Ft, [
1156
+ T(u("input", {
1334
1157
  type: "date",
1335
- max: l.value[1],
1158
+ max: e(h)[1],
1336
1159
  locale: "uk-UA",
1337
- "onUpdate:modelValue": v[7] || (v[7] = (V) => l.value[0] = V),
1160
+ "onUpdate:modelValue": k[0] || (k[0] = (g) => e(h)[0] = g),
1338
1161
  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]]
1162
+ disabled: y.disabled
1163
+ }, null, 8, jt), [
1164
+ [G, e(h)[0]]
1342
1165
  ]),
1343
- H(i("input", {
1166
+ T(u("input", {
1344
1167
  type: "date",
1345
- min: l.value[0],
1168
+ min: e(h)[0],
1346
1169
  locale: "uk-UA",
1347
- "onUpdate:modelValue": v[8] || (v[8] = (V) => l.value[1] = V),
1170
+ "onUpdate:modelValue": k[1] || (k[1] = (g) => e(h)[1] = g),
1348
1171
  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]]
1172
+ disabled: y.disabled
1173
+ }, null, 8, Lt), [
1174
+ [G, e(h)[1]]
1352
1175
  ])
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")
1176
+ ])) : V("", !0)
1177
+ ])) : V("", !0),
1178
+ u("div", {
1179
+ class: D(y.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1180
+ }, [
1181
+ u("div", {
1182
+ class: D(y.layout !== "popover" ? "w-[48%]" : "")
1358
1183
  }, [
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)
1184
+ y.layout === "popover" ? (c(), w("label", Et, "Від")) : V("", !0),
1185
+ T(u("input", {
1186
+ type: "date",
1187
+ max: e(h)[1],
1188
+ locale: "uk-UA",
1189
+ "onUpdate:modelValue": k[2] || (k[2] = (g) => e(h)[0] = g),
1190
+ class: D(e(s)),
1191
+ disabled: y.disabled
1192
+ }, null, 10, It), [
1193
+ [G, e(h)[0]]
1194
+ ])
1390
1195
  ], 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))
1196
+ y.layout !== "popover" ? (c(), w("label", Tt, " - ")) : V("", !0),
1197
+ u("div", {
1198
+ class: D(y.layout !== "popover" ? "w-[48%]" : "")
1199
+ }, [
1200
+ y.layout === "popover" ? (c(), w("label", Ot, "До")) : V("", !0),
1201
+ T(u("input", {
1202
+ type: "date",
1203
+ min: e(h)[0],
1204
+ locale: "uk-UA",
1205
+ "onUpdate:modelValue": k[3] || (k[3] = (g) => e(h)[1] = g),
1206
+ class: D(e(s)),
1207
+ disabled: y.disabled
1208
+ }, null, 10, Ut), [
1209
+ [G, e(h)[1]]
1210
+ ])
1211
+ ], 2)
1212
+ ], 2),
1213
+ u("div", zt, [
1214
+ (c(), w(R, null, W(["today", "week", "month", "quarter", "year"], (g) => u("button", {
1215
+ key: g,
1216
+ class: D(e(r) + (e(d) === g ? " bg-blue-100" : "")),
1217
+ onClick: ($) => e(p)(g)
1218
+ }, F(e(Mt)(g)), 11, Nt)), 64)),
1219
+ u("button", {
1220
+ class: D(e(r)),
1221
+ onClick: k[4] || (k[4] = //@ts-ignore
1222
+ (...g) => e(l) && e(l)(...g))
1223
+ }, " <", 2),
1224
+ u("button", {
1225
+ class: D(e(r)),
1226
+ onClick: k[5] || (k[5] = //@ts-ignore
1227
+ (...g) => e(n) && e(n)(...g))
1228
+ }, " >", 2)
1229
+ ]),
1230
+ (y.cleanable, V("", !0))
1408
1231
  ], 64));
1409
1232
  }
1410
- }), ol = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, al = {
1233
+ }), Yt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, Pt = {
1411
1234
  key: 0,
1412
1235
  class: "w-full"
1413
- }, nl = { class: "flex flex-col items-center justify-center p-5 text-center" }, rl = {
1236
+ }, Wt = { class: "flex flex-col items-center justify-center p-5 text-center" }, qt = {
1414
1237
  key: 0,
1415
1238
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1416
- }, sl = {
1239
+ }, Qt = {
1417
1240
  key: 1,
1418
1241
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1419
- }, ul = /* @__PURE__ */ Y({
1242
+ }, Gt = /* @__PURE__ */ O({
1420
1243
  __name: "select",
1421
1244
  props: {
1422
1245
  id: {},
@@ -1442,205 +1265,205 @@ const ll = /* @__PURE__ */ Y({
1442
1265
  sort: {}
1443
1266
  },
1444
1267
  emits: ["update:modelValue", "change", "clear"],
1445
- setup(p, { expose: r, emit: y }) {
1446
- const t = p, g = y, s = _(null), {
1447
- innerValue: c,
1268
+ setup(f, { expose: a, emit: v }) {
1269
+ const t = f, s = v, r = _(null), {
1270
+ innerValue: i,
1448
1271
  filteredOptions: m,
1449
- isSelected: l,
1450
- selectItem: b,
1451
- 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,
1272
+ isSelected: d,
1273
+ selectItem: h,
1274
+ clear: p,
1275
+ resetSearch: n,
1276
+ toggleShowAll: l,
1277
+ isReqProc: b,
1278
+ showAll: y,
1279
+ isEnableShowAll: k,
1280
+ searchTerm: g,
1281
+ labelKey: $,
1282
+ valueKey: C,
1460
1283
  highlightedIndex: o,
1461
- onKeyDown: u,
1462
- selectedLabels: v,
1463
- totalCount: V
1464
- } = Ae({
1284
+ onKeyDown: x,
1285
+ selectedLabels: K,
1286
+ totalCount: A
1287
+ } = Se({
1465
1288
  ...t,
1466
1289
  modelValue: t.modelValue
1467
- }, g);
1468
- ne(() => {
1469
- a();
1470
- }), F(
1290
+ }, s);
1291
+ ae(() => {
1292
+ n();
1293
+ }), M(
1471
1294
  () => t.modelValue,
1472
1295
  (L) => {
1473
- L === void 0 && (t.multi ? c.value = [] : c.value = void 0);
1296
+ L === void 0 && (t.multi ? i.value = [] : i.value = void 0);
1474
1297
  }
1475
1298
  );
1476
- const M = _([]);
1477
- return F(o, (L) => {
1478
- L >= 0 && M.value[L] && M.value[L]?.scrollIntoView({
1299
+ const Y = _([]);
1300
+ return M(o, (L) => {
1301
+ L >= 0 && Y.value[L] && Y.value[L]?.scrollIntoView({
1479
1302
  block: "nearest",
1480
1303
  behavior: "smooth"
1481
1304
  });
1482
- }), F(m, () => {
1483
- M.value = [];
1484
- }), r({
1485
- 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"])
1305
+ }), M(m, () => {
1306
+ Y.value = [];
1307
+ }), a({
1308
+ clear: p,
1309
+ inputTextRef: r,
1310
+ selectedLabels: K
1311
+ }), (L, j) => (c(), w("div", {
1312
+ class: D([L.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
1490
1313
  }, [
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)),
1314
+ u("div", Yt, [
1315
+ T(u("input", {
1316
+ "onUpdate:modelValue": j[0] || (j[0] = (E) => Ee(g) ? g.value = E : null),
1317
+ onKeydown: j[1] || (j[1] = //@ts-ignore
1318
+ (...E) => e(x) && e(x)(...E)),
1496
1319
  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
1320
  placeholder: "Пошук",
1498
1321
  type: "text",
1499
1322
  ref_key: "inputTextRef",
1500
- ref: s
1323
+ ref: r
1501
1324
  }, null, 544), [
1502
- [Z, e(C)]
1325
+ [G, e(g)]
1503
1326
  ]),
1504
1327
  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 = ""),
1328
+ N(Re, {
1329
+ onClick: j[2] || (j[2] = (E) => g.value = ""),
1507
1330
  class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
1508
1331
  })
1509
1332
  ]),
1510
- i("div", {
1511
- class: R([
1333
+ u("div", {
1334
+ class: D([
1512
1335
  L.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
1513
1336
  L.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
1514
1337
  ])
1515
1338
  }, [
1516
- (d(!0), x(K, null, P(e(m), (T, Q) => (d(), B(me, {
1339
+ (c(!0), w(R, null, W(e(m), (E, Q) => (c(), S(me, {
1517
1340
  layout: L.layout,
1518
- count: T.count,
1519
- label: T[e(A)],
1520
- color: T.color,
1341
+ count: E.count,
1342
+ label: E[e($)],
1343
+ color: E.color,
1521
1344
  type: L.multi ? "checkbox" : "radio",
1522
- value: T[e(h)],
1523
- "is-selected": e(l)(T),
1345
+ value: E[e(C)],
1346
+ "is-selected": e(d)(E),
1524
1347
  highlighted: Q === e(o),
1525
- onItemClick: (re) => e(b)(T),
1348
+ onItemClick: (re) => e(h)(E),
1526
1349
  ref_for: !0,
1527
- ref: (re) => M.value[Q] = re?.el
1350
+ ref: (re) => Y.value[Q] = re?.el
1528
1351
  }, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
1529
1352
  ], 2),
1530
- L.type === "select" && e(m).length === 0 && !e(k) ? (d(), x("div", al, [
1531
- i("div", nl, [
1353
+ L.type === "select" && e(m).length === 0 && !e(b) ? (c(), w("div", Pt, [
1354
+ u("div", Wt, [
1532
1355
  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" })
1356
+ j[7] || (j[7] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
1357
+ u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
1358
+ u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
1536
1359
  ], -1))
1537
1360
  ])
1538
- ])) : w("", !0),
1539
- L.layout !== "popover" && L.type !== "select" ? (d(), x(K, { key: 1 }, [
1540
- !e($) && e(S) ? (d(), x("div", {
1361
+ ])) : V("", !0),
1362
+ L.layout !== "popover" && L.type !== "select" ? (c(), w(R, { key: 1 }, [
1363
+ !e(y) && e(k) ? (c(), w("div", {
1541
1364
  key: 0,
1542
- onClick: E[3] || (E[3] = //@ts-ignore
1543
- (...T) => e(n) && e(n)(...T)),
1365
+ onClick: j[3] || (j[3] = //@ts-ignore
1366
+ (...E) => e(l) && e(l)(...E)),
1544
1367
  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
1368
  }, [
1546
- E[8] || (E[8] = z(" Показати більше ")),
1369
+ j[8] || (j[8] = z(" Показати більше ", -1)),
1547
1370
  N(ie)
1548
- ])) : w("", !0),
1549
- e($) ? (d(), x("div", {
1371
+ ])) : V("", !0),
1372
+ e(y) ? (c(), w("div", {
1550
1373
  key: 1,
1551
- onClick: E[4] || (E[4] = //@ts-ignore
1552
- (...T) => e(n) && e(n)(...T)),
1374
+ onClick: j[4] || (j[4] = //@ts-ignore
1375
+ (...E) => e(l) && e(l)(...E)),
1553
1376
  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
1377
  }, [
1555
- E[9] || (E[9] = z(" Показати менше ")),
1378
+ j[9] || (j[9] = z(" Показати менше ", -1)),
1556
1379
  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", {
1380
+ ])) : V("", !0)
1381
+ ], 64)) : V("", !0),
1382
+ L.cleanable ? (c(), w(R, { key: 2 }, [
1383
+ L.layout === "inline" ? (c(), w("div", qt, [
1384
+ z(F(L.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано ", 1),
1385
+ T(u("button", {
1563
1386
  class: "text-gray-600 hover:text-gray-800",
1564
- onClick: E[5] || (E[5] = //@ts-ignore
1565
- (...T) => e(f) && e(f)(...T))
1387
+ onClick: j[5] || (j[5] = //@ts-ignore
1388
+ (...E) => e(p) && e(p)(...E))
1566
1389
  }, " Очистити ", 512), [
1567
- [G, e(c) !== "" && e(c) !== void 0 || e(c) && e(c)?.length !== 0]
1390
+ [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1568
1391
  ])
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", {
1392
+ ])) : V("", !0),
1393
+ L.layout === "popover" ? (c(), w("div", Qt, [
1394
+ u("span", null, F(L.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано", 1),
1395
+ T(u("button", {
1573
1396
  class: "text-gray-600 hover:text-gray-800",
1574
- onClick: E[6] || (E[6] = //@ts-ignore
1575
- (...T) => e(f) && e(f)(...T))
1397
+ onClick: j[6] || (j[6] = //@ts-ignore
1398
+ (...E) => e(p) && e(p)(...E))
1576
1399
  }, " Очистити ", 512), [
1577
- [G, e(c) !== "" && e(c) !== void 0 || e(c) && e(c)?.length !== 0]
1400
+ [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1578
1401
  ])
1579
- ])) : w("", !0)
1580
- ], 64)) : w("", !0)
1402
+ ])) : V("", !0)
1403
+ ], 64)) : V("", !0)
1581
1404
  ], 2));
1582
1405
  }
1583
1406
  });
1584
- function il(p, r) {
1407
+ function Xt(f, a) {
1585
1408
  const {
1586
- options: y = [],
1409
+ options: v = [],
1587
1410
  limit: t = 20
1588
- } = p;
1589
- function g(o) {
1411
+ } = f;
1412
+ function s(o) {
1590
1413
  return Array.isArray(o) ? o : o ? [o] : [];
1591
1414
  }
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 };
1415
+ const r = _(s(f.modelValue)), i = _(""), m = _(!1), d = _([]), h = _("id"), p = _("text"), n = _(!1), l = _(f.layout !== "popover" && v.length > t);
1416
+ function b(o) {
1417
+ const x = o.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in x) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in x) ?? "text";
1418
+ return { autoValueKey: K, autoLabelKey: A };
1596
1419
  }
1597
- if (y.length > 0) {
1598
- const o = k(y);
1599
- b.value = o.autoValueKey, f.value = o.autoLabelKey;
1420
+ if (v.length > 0) {
1421
+ const o = b(v);
1422
+ h.value = o.autoValueKey, p.value = o.autoLabelKey;
1600
1423
  }
1601
- const $ = O(() => {
1602
- const o = l.value;
1603
- return p.layout === "popover" || a.value ? o : o.slice(0, t);
1424
+ const y = I(() => {
1425
+ const o = d.value;
1426
+ return f.layout === "popover" || n.value ? o : o.slice(0, t);
1604
1427
  });
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]);
1428
+ M(() => f.modelValue, (o) => {
1429
+ r.value = s(o);
1430
+ }, { immediate: !0 }), d.value = [...v].sort((o, x) => f.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : f.sort === "name" ? String(o[p.value]).localeCompare(String(x[p.value])) : 0);
1431
+ function k(o) {
1432
+ return r.value && r.value.includes(o[h.value]);
1610
1433
  }
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 });
1434
+ function g(o) {
1435
+ const x = r.value.includes(o[h.value]);
1436
+ r.value = x ? r.value.filter((K) => K !== o[h.value]) : [...r.value, o[h.value]], a("update:modelValue", r.value), a("change", { name: f.name, value: r.value });
1614
1437
  }
1615
- function A() {
1616
- s.value = [], r("update:modelValue", s.value), r("clear", p.name);
1438
+ function $() {
1439
+ r.value = [], a("update:modelValue", r.value), a("clear", f.name);
1617
1440
  }
1618
- function h() {
1619
- a.value = !a.value;
1441
+ function C() {
1442
+ n.value = !n.value;
1620
1443
  }
1621
1444
  return {
1622
- innerValue: s,
1623
- searchTerm: c,
1624
- filteredOptions: $,
1625
- isSelected: S,
1626
- selectItem: C,
1627
- clear: A,
1628
- toggleShowAll: h,
1445
+ innerValue: r,
1446
+ searchTerm: i,
1447
+ filteredOptions: y,
1448
+ isSelected: k,
1449
+ selectItem: g,
1450
+ clear: $,
1451
+ toggleShowAll: C,
1629
1452
  isReqProc: m,
1630
- showAll: a,
1631
- isEnableShowAll: n,
1632
- labelKey: f,
1633
- valueKey: b,
1634
- allOptions: l
1453
+ showAll: n,
1454
+ isEnableShowAll: l,
1455
+ labelKey: p,
1456
+ valueKey: h,
1457
+ allOptions: d
1635
1458
  };
1636
1459
  }
1637
- const dl = ["for", "onClick"], cl = ["id", "name", "value"], fl = { class: "block" }, pl = {
1460
+ const Jt = ["for", "onClick"], Zt = ["id", "name", "value"], el = { class: "block" }, tl = {
1638
1461
  key: 0,
1639
1462
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1640
- }, ml = {
1463
+ }, ll = {
1641
1464
  key: 1,
1642
1465
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1643
- }, vl = /* @__PURE__ */ Y({
1466
+ }, ol = /* @__PURE__ */ O({
1644
1467
  __name: "tag-field",
1645
1468
  props: {
1646
1469
  id: {},
@@ -1666,101 +1489,350 @@ const dl = ["for", "onClick"], cl = ["id", "name", "value"], fl = { class: "bloc
1666
1489
  sort: {}
1667
1490
  },
1668
1491
  emits: ["update:modelValue", "change", "clear"],
1669
- setup(p, { expose: r, emit: y }) {
1670
- const t = p, g = y, {
1671
- innerValue: s,
1672
- isSelected: c,
1492
+ setup(f, { expose: a, emit: v }) {
1493
+ const t = f, s = v, {
1494
+ innerValue: r,
1495
+ isSelected: i,
1673
1496
  selectItem: m,
1674
- clear: l,
1675
- labelKey: b,
1676
- valueKey: f,
1677
- allOptions: a
1678
- } = t.multi ? il({
1497
+ clear: d,
1498
+ labelKey: h,
1499
+ valueKey: p,
1500
+ allOptions: n
1501
+ } = t.multi ? Xt({
1679
1502
  ...t,
1680
1503
  modelValue: t.modelValue ?? t.default ?? []
1681
- }, g) : Se({
1504
+ }, s) : Be({
1682
1505
  ...t,
1683
1506
  modelValue: t.modelValue !== void 0 ? t.modelValue : t.default ?? ""
1684
- }, g);
1685
- return r({
1686
- clear: l
1687
- }), F(
1507
+ }, s);
1508
+ return a({
1509
+ clear: d
1510
+ }), M(
1688
1511
  () => t.modelValue,
1689
- (n) => {
1690
- n === void 0 && (t.multi ? s.value = [] : s.value = void 0);
1512
+ (l) => {
1513
+ l === void 0 && (t.multi ? r.value = [] : r.value = void 0);
1691
1514
  }
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"])
1515
+ ), (l, b) => (c(), w(R, null, [
1516
+ u("div", {
1517
+ class: D(["grid grid-cols-3 gap-2 mx-[1px]", l.layout === "popover" ? "m-1" : "mb-1"])
1695
1518
  }, [
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%)]"])
1519
+ (c(!0), w(R, null, W(e(n), (y) => (c(), w("label", {
1520
+ key: `item-${y[e(p)]}`,
1521
+ for: `item-${y[e(p)]}`,
1522
+ onClick: _e((k) => e(m)(y), ["stop", "prevent"]),
1523
+ class: D([e(i)(y) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1701
1524
  }, [
1702
- i("input", {
1525
+ u("input", {
1703
1526
  type: "checkbox",
1704
- id: `item-${$[e(f)]}`,
1527
+ id: `item-${y[e(p)]}`,
1705
1528
  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))
1529
+ name: `item-${y[e(p)]}`,
1530
+ value: y[e(p)]
1531
+ }, null, 8, Zt),
1532
+ u("span", el, F(y[e(h)]), 1)
1533
+ ], 10, Jt))), 128))
1711
1534
  ], 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", {
1535
+ l.cleanable ? (c(), w(R, { key: 0 }, [
1536
+ l.layout === "inline" ? (c(), w("div", tl, [
1537
+ z(F(l.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(n).length) + " обрано ", 1),
1538
+ T(u("button", {
1716
1539
  class: "text-gray-600 hover:text-gray-800",
1717
- onClick: k[0] || (k[0] = //@ts-ignore
1718
- (...$) => e(l) && e(l)(...$))
1540
+ onClick: b[0] || (b[0] = //@ts-ignore
1541
+ (...y) => e(d) && e(d)(...y))
1719
1542
  }, " Очистити ", 512), [
1720
- [G, e(s) !== "" && e(s) !== void 0 || e(s) && e(s)?.length !== 0]
1543
+ [X, e(r) !== "" && e(r) !== void 0 || e(r)]
1721
1544
  ])
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", {
1545
+ ])) : V("", !0),
1546
+ l.layout === "popover" ? (c(), w("div", ll, [
1547
+ u("span", null, F(l.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(n).length) + " обрано", 1),
1548
+ T(u("button", {
1726
1549
  class: "text-gray-600 hover:text-gray-800",
1727
- onClick: k[1] || (k[1] = //@ts-ignore
1728
- (...$) => e(l) && e(l)(...$))
1550
+ onClick: b[1] || (b[1] = //@ts-ignore
1551
+ (...y) => e(d) && e(d)(...y))
1729
1552
  }, " Очистити ", 512), [
1730
- [G, e(s) !== void 0 && e(s) !== "" || e(s) && e(s)?.length !== 0]
1553
+ [X, e(r) !== void 0 && e(r) !== "" || e(r)]
1554
+ ])
1555
+ ])) : V("", !0)
1556
+ ], 64)) : V("", !0)
1557
+ ], 64));
1558
+ }
1559
+ }), nl = {}, al = {
1560
+ xmlns: "http://www.w3.org/2000/svg",
1561
+ width: "24",
1562
+ height: "24",
1563
+ viewBox: "0 0 24 24",
1564
+ fill: "none",
1565
+ stroke: "currentColor",
1566
+ "stroke-width": "2",
1567
+ "stroke-linecap": "round",
1568
+ "stroke-linejoin": "round",
1569
+ class: "text-blue-600 w-[16px] h-[16px]"
1570
+ };
1571
+ function rl(f, a) {
1572
+ return c(), w("svg", al, a[0] || (a[0] = [
1573
+ u("path", { d: "M20 6 9 17l-5-5" }, null, -1)
1574
+ ]));
1575
+ }
1576
+ const te = /* @__PURE__ */ J(nl, [["render", rl]]), sl = {}, ul = {
1577
+ xmlns: "http://www.w3.org/2000/svg",
1578
+ width: "15px",
1579
+ height: "24",
1580
+ viewBox: "0 0 24 24",
1581
+ fill: "none",
1582
+ stroke: "currentColor",
1583
+ "stroke-width": "2",
1584
+ "stroke-linecap": "round",
1585
+ "stroke-linejoin": "round",
1586
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
1587
+ };
1588
+ function il(f, a) {
1589
+ return c(), w("svg", ul, a[0] || (a[0] = [
1590
+ u("path", {
1591
+ stroke: "none",
1592
+ d: "M0 0h24v24H0z",
1593
+ fill: "none"
1594
+ }, null, -1),
1595
+ u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1596
+ ]));
1597
+ }
1598
+ const dl = /* @__PURE__ */ J(sl, [["render", il]]), cl = {}, fl = {
1599
+ xmlns: "http://www.w3.org/2000/svg",
1600
+ width: "15px",
1601
+ height: "24",
1602
+ viewBox: "0 0 24 24",
1603
+ fill: "none",
1604
+ stroke: "currentColor",
1605
+ "stroke-width": "2",
1606
+ "stroke-linecap": "round",
1607
+ "stroke-linejoin": "round",
1608
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
1609
+ };
1610
+ function pl(f, a) {
1611
+ return c(), w("svg", fl, a[0] || (a[0] = [
1612
+ u("path", {
1613
+ stroke: "none",
1614
+ d: "M0 0h24v24H0z",
1615
+ fill: "none"
1616
+ }, null, -1),
1617
+ u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1618
+ ]));
1619
+ }
1620
+ const ml = /* @__PURE__ */ J(cl, [["render", pl]]), vl = { class: "flex" }, gl = { class: "mb-1" }, yl = { class: "mb-1" }, bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, hl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, xl = {
1621
+ key: 1,
1622
+ class: "flex gap-1 !w-[75%] rounded-lg"
1623
+ }, kl = ["max", "disabled"], wl = ["min", "disabled"];
1624
+ const Cl = /* @__PURE__ */ O({
1625
+ __name: "date-input-inline",
1626
+ props: {
1627
+ id: {},
1628
+ name: {},
1629
+ type: {},
1630
+ label: {},
1631
+ width: {},
1632
+ options: {},
1633
+ placeHolder: {},
1634
+ api: {},
1635
+ data: {},
1636
+ default: {},
1637
+ modelValue: {},
1638
+ disabled: { type: Boolean },
1639
+ layout: { default: "inline" },
1640
+ cleanable: { type: Boolean },
1641
+ limit: {},
1642
+ multi: { type: Boolean },
1643
+ dataKey: {},
1644
+ valueKey: {},
1645
+ mode: {},
1646
+ labelKey: {},
1647
+ sort: {}
1648
+ },
1649
+ emits: ["update:modelValue", "change", "clear"],
1650
+ setup(f, { expose: a, emit: v }) {
1651
+ const t = f, s = v, r = _(null), {
1652
+ activeMode: i,
1653
+ innerValue: m,
1654
+ onSelectChange: d,
1655
+ nextClick: h,
1656
+ prevClick: p,
1657
+ currentLabel: n,
1658
+ clear: l
1659
+ } = Fe({
1660
+ ...t,
1661
+ popoverRef: r
1662
+ }, s);
1663
+ return M(() => t.modelValue, (b) => {
1664
+ b !== void 0 ? (m.value = b, s("update:modelValue", b)) : (i.value = "", m.value = []);
1665
+ }), a({
1666
+ clear: l,
1667
+ popoverRef: r
1668
+ }), (b, y) => (c(), w(R, null, [
1669
+ u("div", vl, [
1670
+ N(ye, {
1671
+ ref_key: "popoverRef",
1672
+ ref: r,
1673
+ label: e(n),
1674
+ "current-value": e(m),
1675
+ mode: b.mode,
1676
+ onClear: e(l),
1677
+ layout: b.layout
1678
+ }, {
1679
+ default: le(() => [
1680
+ u("div", null, [
1681
+ u("button", {
1682
+ type: "button",
1683
+ onClick: y[0] || (y[0] = (k) => e(d)("range")),
1684
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1685
+ }, [
1686
+ y[12] || (y[12] = z(" Період ", -1)),
1687
+ e(i) === "range" ? (c(), S(te, { key: 0 })) : V("", !0)
1688
+ ])
1689
+ ]),
1690
+ y[19] || (y[19] = u("div", null, [
1691
+ u("div", { class: "pt-1 mt-1 border-t" })
1692
+ ], -1)),
1693
+ u("div", null, [
1694
+ u("button", {
1695
+ type: "button",
1696
+ onClick: y[1] || (y[1] = (k) => e(d)("today")),
1697
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1698
+ }, [
1699
+ y[13] || (y[13] = z(" Сьогодні ", -1)),
1700
+ e(i) === "today" ? (c(), S(te, { key: 0 })) : V("", !0)
1701
+ ])
1702
+ ]),
1703
+ u("div", null, [
1704
+ u("button", {
1705
+ type: "button",
1706
+ onClick: y[2] || (y[2] = (k) => e(d)("week")),
1707
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1708
+ }, [
1709
+ y[14] || (y[14] = z(" Тиждень ", -1)),
1710
+ e(i) === "week" ? (c(), S(te, { key: 0 })) : V("", !0)
1711
+ ])
1712
+ ]),
1713
+ u("div", null, [
1714
+ u("button", {
1715
+ type: "button",
1716
+ onClick: y[3] || (y[3] = (k) => e(d)("month")),
1717
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1718
+ }, [
1719
+ y[15] || (y[15] = z(" Місяць ", -1)),
1720
+ e(i) === "month" ? (c(), S(te, { key: 0 })) : V("", !0)
1721
+ ])
1722
+ ]),
1723
+ u("div", null, [
1724
+ u("button", {
1725
+ type: "button",
1726
+ onClick: y[4] || (y[4] = (k) => e(d)("quarter")),
1727
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1728
+ }, [
1729
+ y[16] || (y[16] = z(" Квартал ", -1)),
1730
+ e(i) === "quarter" ? (c(), S(te, { key: 0 })) : V("", !0)
1731
+ ])
1732
+ ]),
1733
+ u("div", gl, [
1734
+ u("button", {
1735
+ type: "button",
1736
+ onClick: y[5] || (y[5] = (k) => e(d)("year")),
1737
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1738
+ }, [
1739
+ y[17] || (y[17] = z(" Рік ", -1)),
1740
+ e(i) === "year" ? (c(), S(te, { key: 0 })) : V("", !0)
1741
+ ])
1742
+ ]),
1743
+ u("div", yl, [
1744
+ u("button", {
1745
+ type: "button",
1746
+ onClick: y[6] || (y[6] = (k) => e(l)()),
1747
+ class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1748
+ }, [
1749
+ y[18] || (y[18] = z(" Весь час ", -1)),
1750
+ e(m)[0] ? V("", !0) : (c(), S(te, { key: 0 }))
1751
+ ])
1752
+ ])
1753
+ ]),
1754
+ _: 1,
1755
+ __: [19]
1756
+ }, 8, ["label", "current-value", "mode", "onClear", "layout"]),
1757
+ e(i) !== "" && e(i) !== "range" && e(i) !== "last_7_days" ? (c(), w(R, { key: 0 }, [
1758
+ u("div", bl, [
1759
+ u("button", {
1760
+ type: "button",
1761
+ title: "Попередній період",
1762
+ class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1763
+ onClick: y[7] || (y[7] = //@ts-ignore
1764
+ (...k) => e(p) && e(p)(...k))
1765
+ }, [
1766
+ N(dl)
1767
+ ])
1768
+ ]),
1769
+ u("div", hl, [
1770
+ u("button", {
1771
+ type: "button",
1772
+ title: "Наступний період",
1773
+ class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1774
+ onClick: y[8] || (y[8] = //@ts-ignore
1775
+ (...k) => e(h) && e(h)(...k))
1776
+ }, [
1777
+ N(ml)
1778
+ ])
1779
+ ])
1780
+ ], 64)) : V("", !0),
1781
+ e(i) !== "" && e(i) === "range" ? (c(), w("div", xl, [
1782
+ T(u("input", {
1783
+ type: "date",
1784
+ max: e(m)[1],
1785
+ locale: "uk-UA",
1786
+ "onUpdate:modelValue": y[9] || (y[9] = (k) => e(m)[0] = k),
1787
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1788
+ disabled: b.disabled
1789
+ }, null, 8, kl), [
1790
+ [G, e(m)[0]]
1791
+ ]),
1792
+ T(u("input", {
1793
+ type: "date",
1794
+ min: e(m)[0],
1795
+ locale: "uk-UA",
1796
+ "onUpdate:modelValue": y[10] || (y[10] = (k) => e(m)[1] = k),
1797
+ class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1798
+ disabled: b.disabled
1799
+ }, null, 8, wl), [
1800
+ [G, e(m)[1]]
1731
1801
  ])
1732
- ])) : w("", !0)
1733
- ], 64)) : w("", !0)
1802
+ ])) : V("", !0)
1803
+ ]),
1804
+ (b.cleanable, V("", !0))
1734
1805
  ], 64));
1735
1806
  }
1736
1807
  }), ke = {
1737
- radio: lt,
1808
+ radio: at,
1738
1809
  checkbox: xe,
1739
1810
  check: xe,
1740
- text: vt,
1741
- range: _t,
1742
- date: ll,
1743
- select: ul,
1744
- tag: vl
1811
+ text: bt,
1812
+ range: At,
1813
+ date: Ht,
1814
+ select: Gt,
1815
+ tag: ol,
1816
+ "date:inline": Cl
1745
1817
  };
1746
- function be(p) {
1747
- let r;
1748
- switch (p.toLowerCase()) {
1818
+ function be(f, a) {
1819
+ let v;
1820
+ switch (f.toLowerCase()) {
1749
1821
  case "autocomplete":
1750
- r = "select";
1822
+ v = "select";
1751
1823
  break;
1752
1824
  case "check":
1753
- r = "checkbox";
1825
+ v = "checkbox";
1754
1826
  break;
1755
1827
  default:
1756
- r = p?.toString().toLowerCase();
1828
+ v = f?.toString().toLowerCase();
1757
1829
  }
1758
- return {
1759
- component: ke[r] || ke.text,
1760
- type: r
1830
+ return v === "date" && a && a === "inline" && (v = "date:inline"), {
1831
+ component: ke[v] || ke.text,
1832
+ type: v
1761
1833
  };
1762
1834
  }
1763
- const gl = {}, yl = {
1835
+ const Vl = {}, _l = {
1764
1836
  xmlns: "http://www.w3.org/2000/svg",
1765
1837
  width: "15px",
1766
1838
  height: "24",
@@ -1772,18 +1844,18 @@ const gl = {}, yl = {
1772
1844
  "stroke-linejoin": "round",
1773
1845
  class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
1774
1846
  };
1775
- function bl(p, r) {
1776
- return d(), x("svg", yl, r[0] || (r[0] = [
1777
- i("path", {
1847
+ function $l(f, a) {
1848
+ return c(), w("svg", _l, a[0] || (a[0] = [
1849
+ u("path", {
1778
1850
  stroke: "none",
1779
1851
  d: "M0 0h24v24H0z",
1780
1852
  fill: "none"
1781
1853
  }, 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)
1854
+ 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),
1855
+ u("path", { d: "M20 4v5h-5" }, null, -1)
1784
1856
  ]));
1785
1857
  }
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({
1858
+ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Sl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Dl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Rl = { class: "flex items-center" }, Ml = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Kl = { class: "filter-layout__body" }, Fl = /* @__PURE__ */ O({
1787
1859
  __name: "vertical-layout",
1788
1860
  props: {
1789
1861
  id: {},
@@ -1809,69 +1881,69 @@ const hl = /* @__PURE__ */ X(gl, [["render", bl]]), xl = { style: { display: "in
1809
1881
  sort: {}
1810
1882
  },
1811
1883
  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({
1884
+ setup(f, { expose: a, emit: v }) {
1885
+ const t = f, s = v, r = _(), i = be(t.type, t.layout), m = I({
1814
1886
  get: () => t.modelValue,
1815
- set: (a) => g("update:modelValue", a)
1887
+ set: (n) => s("update:modelValue", n)
1816
1888
  });
1817
- function l(a) {
1818
- g("clear", a);
1889
+ function d(n) {
1890
+ s("clear", n);
1819
1891
  }
1820
- function b(a, n) {
1821
- g("change", { name: a, value: n }), t.modelValue !== void 0 && g("update:modelValue", n);
1892
+ function h(n, l) {
1893
+ s("change", { name: n, value: l }), t.modelValue !== void 0 && s("update:modelValue", l);
1822
1894
  }
1823
- function f() {
1824
- s.value && s.value.clear(), g("clear", t.name);
1895
+ function p() {
1896
+ r.value && r.value.clear(), s("clear", t.name);
1825
1897
  }
1826
- return F(
1898
+ return M(
1827
1899
  () => t.default,
1828
- (a) => {
1829
- m.value = a;
1900
+ (n) => {
1901
+ m.value = n;
1830
1902
  }
1831
- ), F(
1903
+ ), M(
1832
1904
  () => t.modelValue,
1833
- (a) => {
1834
- m.value = a;
1905
+ (n) => {
1906
+ m.value = n;
1835
1907
  }
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)
1908
+ ), a({
1909
+ filterRef: r
1910
+ }), (n, l) => (c(), w("div", Bl, [
1911
+ u("div", Sl, [
1912
+ u("div", Dl, [
1913
+ u("div", Rl, [
1914
+ u("span", Ml, F(n.label), 1)
1843
1915
  ]),
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, {
1916
+ typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((b) => b !== void 0) || m.value === null ? (c(), S(Al, {
1845
1917
  key: 0,
1846
- onClick: f
1847
- })) : w("", !0)
1918
+ onClick: p
1919
+ })) : V("", !0)
1848
1920
  ]),
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)),
1921
+ u("div", Kl, [
1922
+ e(i)?.type !== "select" ? (c(), S(ee(e(i)?.component), P({ key: 0 }, t, {
1923
+ type: e(i)?.type,
1924
+ onChange: l[0] || (l[0] = (b) => h(b.name, b.value)),
1925
+ onClear: l[1] || (l[1] = (b) => d(b)),
1854
1926
  ref_key: "filterRef",
1855
- ref: s
1856
- }), null, 16, ["type"])) : (d(), B(ye, {
1927
+ ref: r
1928
+ }), null, 16, ["type"])) : (c(), S(ye, {
1857
1929
  key: 1,
1858
1930
  "current-value": m.value,
1859
- label: a.label,
1860
- mode: a.mode,
1861
- onClear: f,
1862
- fieldRef: s.value,
1931
+ label: n.label,
1932
+ mode: n.mode,
1933
+ onClear: p,
1934
+ fieldRef: r.value,
1863
1935
  width: void 0,
1864
- disabled: a.disabled,
1936
+ disabled: n.disabled,
1865
1937
  layout: "vertical"
1866
1938
  }, {
1867
1939
  default: le(() => [
1868
- (d(), B(ee(e(c)?.component), W({
1940
+ (c(), S(ee(e(i)?.component), P({
1869
1941
  ref_key: "filterRef",
1870
- ref: s
1942
+ ref: r
1871
1943
  }, 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))
1944
+ type: e(i)?.type,
1945
+ onChange: l[2] || (l[2] = (b) => h(b.name, b.value)),
1946
+ onClear: l[3] || (l[3] = (b) => d(b))
1875
1947
  }), null, 16, ["type"]))
1876
1948
  ]),
1877
1949
  _: 1
@@ -1880,7 +1952,7 @@ const hl = /* @__PURE__ */ X(gl, [["render", bl]]), xl = { style: { display: "in
1880
1952
  ])
1881
1953
  ]));
1882
1954
  }
1883
- }), we = /* @__PURE__ */ Y({
1955
+ }), we = /* @__PURE__ */ O({
1884
1956
  __name: "inline-layout",
1885
1957
  props: {
1886
1958
  id: {},
@@ -1906,66 +1978,66 @@ const hl = /* @__PURE__ */ X(gl, [["render", bl]]), xl = { style: { display: "in
1906
1978
  sort: {}
1907
1979
  },
1908
1980
  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({
1981
+ setup(f, { expose: a, emit: v }) {
1982
+ const t = f, s = v, r = _(), i = be(t.type, t.layout), m = I({
1911
1983
  get: () => t.modelValue,
1912
- set: (a) => g("update:modelValue", a)
1984
+ set: (n) => s("update:modelValue", n)
1913
1985
  });
1914
- function l(a) {
1915
- g("clear", a);
1986
+ function d(n) {
1987
+ s("clear", n);
1916
1988
  }
1917
- function b(a, n) {
1918
- g("change", { name: a, value: n }), t.modelValue !== void 0 && g("update:modelValue", n);
1989
+ function h(n, l) {
1990
+ s("change", { name: n, value: l }), t.modelValue !== void 0 && s("update:modelValue", l);
1919
1991
  }
1920
- function f() {
1921
- s.value && s.value.clear(), g("clear", t.name);
1992
+ function p() {
1993
+ r.value && r.value.clear(), s("clear", t.name);
1922
1994
  }
1923
- return F(
1995
+ return M(
1924
1996
  () => t.default,
1925
- (a) => {
1926
- m.value = a;
1997
+ (n) => {
1998
+ m.value = n;
1927
1999
  }
1928
- ), F(
2000
+ ), M(
1929
2001
  () => t.modelValue,
1930
- (a) => {
1931
- m.value = a;
2002
+ (n) => {
2003
+ m.value = n;
1932
2004
  }
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,
2005
+ ), a({
2006
+ filterRef: r
2007
+ }), (n, l) => ["text", "date"].includes(n.type.toLocaleLowerCase()) ? (c(), S(ee(e(i)?.component), P({ key: 0 }, t, {
2008
+ type: e(i)?.type,
2009
+ onChange: l[0] || (l[0] = (b) => h(b.name, b.value)),
2010
+ onClear: l[1] || (l[1] = (b) => d(b)),
2011
+ disabled: n.disabled,
1940
2012
  modelValue: m.value,
1941
- "onUpdate:modelValue": n[2] || (n[2] = (k) => m.value = k)
1942
- }), null, 16, ["type", "disabled", "modelValue"])) : (d(), B(ye, {
2013
+ "onUpdate:modelValue": l[2] || (l[2] = (b) => m.value = b)
2014
+ }), null, 16, ["type", "disabled", "modelValue"])) : (c(), S(ye, {
1943
2015
  key: 1,
1944
2016
  "current-value": m.value,
1945
- label: a.label,
1946
- mode: a.mode,
1947
- onClear: f,
1948
- fieldRef: s.value,
2017
+ label: n.label,
2018
+ mode: n.mode,
2019
+ onClear: p,
2020
+ fieldRef: r.value,
1949
2021
  width: t.width,
1950
- disabled: a.disabled,
2022
+ disabled: n.disabled,
1951
2023
  layout: "inline"
1952
2024
  }, {
1953
2025
  default: le(() => [
1954
- (d(), B(ee(e(c)?.component), W({
2026
+ (c(), S(ee(e(i)?.component), P({
1955
2027
  ref_key: "filterRef",
1956
- ref: s
2028
+ ref: r
1957
2029
  }, t, {
1958
2030
  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))
2031
+ "onUpdate:modelValue": l[3] || (l[3] = (b) => m.value = b),
2032
+ type: e(i)?.type,
2033
+ onChange: l[4] || (l[4] = (b) => h(b.name, b.value)),
2034
+ onClear: l[5] || (l[5] = (b) => d(b))
1963
2035
  }), null, 16, ["modelValue", "type"]))
1964
2036
  ]),
1965
2037
  _: 1
1966
2038
  }, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
1967
2039
  }
1968
- }), Sl = /* @__PURE__ */ Y({
2040
+ }), jl = /* @__PURE__ */ O({
1969
2041
  __name: "popover-layout",
1970
2042
  props: {
1971
2043
  id: {},
@@ -1991,45 +2063,45 @@ const hl = /* @__PURE__ */ X(gl, [["render", bl]]), xl = { style: { display: "in
1991
2063
  sort: {}
1992
2064
  },
1993
2065
  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({
2066
+ setup(f, { expose: a, emit: v }) {
2067
+ const t = f, s = v, r = _(), i = _(be(t.type, t.layout)), m = I({
1996
2068
  get: () => t.modelValue,
1997
- set: (f) => g("update:modelValue", f)
2069
+ set: (p) => s("update:modelValue", p)
1998
2070
  });
1999
- function l(f) {
2000
- g("clear", f);
2071
+ function d(p) {
2072
+ s("clear", p);
2001
2073
  }
2002
- function b(f, a) {
2003
- g("change", { name: f, value: a }), t.modelValue !== void 0 && g("update:modelValue", a);
2074
+ function h(p, n) {
2075
+ s("change", { name: p, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2004
2076
  }
2005
- return F(
2077
+ return M(
2006
2078
  () => t.default,
2007
- (f) => {
2008
- m.value = f;
2079
+ (p) => {
2080
+ m.value = p;
2009
2081
  }
2010
- ), F(
2082
+ ), M(
2011
2083
  () => t.modelValue,
2012
- (f) => {
2013
- m.value = f;
2084
+ (p) => {
2085
+ m.value = p;
2014
2086
  }
2015
- ), F(
2087
+ ), M(
2016
2088
  () => t,
2017
- (f) => {
2018
- m.value = f;
2089
+ (p) => {
2090
+ m.value = p;
2019
2091
  }
2020
- ), r({
2021
- filterRef: s
2022
- }), (f, a) => (d(), B(ee(c.value?.component), W(t, {
2023
- type: c.value?.type,
2092
+ ), a({
2093
+ filterRef: r
2094
+ }), (p, n) => (c(), S(ee(i.value?.component), P(t, {
2095
+ type: i.value?.type,
2024
2096
  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)),
2097
+ "onUpdate:modelValue": n[0] || (n[0] = (l) => m.value = l),
2098
+ onChange: n[1] || (n[1] = (l) => h(l.name, l.value)),
2099
+ onClear: n[2] || (n[2] = (l) => d(l)),
2028
2100
  ref_key: "filterRef",
2029
- ref: s
2101
+ ref: r
2030
2102
  }), null, 16, ["type", "modelValue"]));
2031
2103
  }
2032
- }), oe = /* @__PURE__ */ Y({
2104
+ }), ne = /* @__PURE__ */ O({
2033
2105
  __name: "filter-field",
2034
2106
  props: {
2035
2107
  id: {},
@@ -2055,195 +2127,195 @@ const hl = /* @__PURE__ */ X(gl, [["render", bl]]), xl = { style: { display: "in
2055
2127
  sort: { default: "count" }
2056
2128
  },
2057
2129
  emits: ["update:modelValue", "change", "clear"],
2058
- setup(p, { expose: r, emit: y }) {
2059
- const t = p, g = y, s = _(), c = O({
2130
+ setup(f, { expose: a, emit: v }) {
2131
+ const t = f, s = v, r = _(), i = I({
2060
2132
  get: () => t.modelValue,
2061
- set: (f) => g("update:modelValue", f)
2133
+ set: (p) => s("update:modelValue", p)
2062
2134
  });
2063
- function m(f) {
2064
- g("clear", f);
2135
+ function m(p) {
2136
+ s("clear", p);
2065
2137
  }
2066
- function l(f, a) {
2067
- g("change", { name: f, value: a }), t.modelValue !== void 0 && g("update:modelValue", a);
2138
+ function d(p, n) {
2139
+ s("change", { name: p, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2068
2140
  }
2069
- F(
2141
+ M(
2070
2142
  () => t.default,
2071
- (f) => {
2072
- c.value = f;
2143
+ (p) => {
2144
+ i.value = p;
2073
2145
  }
2074
- ), F(
2146
+ ), M(
2075
2147
  () => t.modelValue,
2076
- (f) => {
2077
- c.value = f;
2148
+ (p) => {
2149
+ i.value = p;
2078
2150
  }
2079
- ), r({
2080
- filterRef: s
2151
+ ), a({
2152
+ filterRef: r
2081
2153
  });
2082
- function b() {
2154
+ function h() {
2083
2155
  switch (t.layout) {
2084
2156
  case "inline":
2085
2157
  return we;
2086
2158
  case "vertical":
2087
- return $l;
2159
+ return Fl;
2088
2160
  case "popover":
2089
- return Sl;
2161
+ return jl;
2090
2162
  default:
2091
2163
  return we;
2092
2164
  }
2093
2165
  }
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)
2166
+ return (p, n) => (c(), S(ee(h()), P(t, {
2167
+ onChange: n[0] || (n[0] = (l) => d(l.name, l.value)),
2168
+ onClear: n[1] || (n[1] = (l) => m(l)),
2169
+ modelValue: i.value,
2170
+ "onUpdate:modelValue": n[2] || (n[2] = (l) => i.value = l)
2099
2171
  }), null, 16, ["modelValue"]));
2100
2172
  }
2101
2173
  });
2102
- function he(p, r) {
2174
+ function he(f, a) {
2103
2175
  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
2176
+ slots: v
2177
+ } = f, t = _(f.value ?? {}), s = I(() => (Z(v?.default?.()) ?? []).flatMap((o) => Array.isArray(o.children) ? o.children : [o]));
2178
+ function r(C) {
2179
+ delete t.value[C], a("clear", {
2180
+ data: Z(t.value),
2181
+ name: C
2110
2182
  });
2111
2183
  }
2112
- function c(h, o) {
2113
- o === void 0 ? (s(h), r("change", {
2114
- data: J(t.value),
2115
- name: h,
2184
+ function i(C, o) {
2185
+ o === void 0 ? (r(C), a("change", {
2186
+ data: Z(t.value),
2187
+ name: C,
2116
2188
  undefined: void 0
2117
2189
  })) : t.value = {
2118
2190
  ...t.value,
2119
- [h]: o
2120
- }, r("change", {
2121
- data: J(t.value),
2122
- name: h,
2191
+ [C]: o
2192
+ }, a("change", {
2193
+ data: Z(t.value),
2194
+ name: C,
2123
2195
  value: o
2124
2196
  });
2125
2197
  }
2126
- const m = O(() => g.value.map((h) => {
2127
- const o = h.props?.name;
2128
- return je(h, {
2129
- ...h.props,
2130
- layout: p.view,
2198
+ const m = I(() => s.value.map((C) => {
2199
+ const o = C.props?.name;
2200
+ return Ie(C, {
2201
+ ...C.props,
2202
+ layout: f.view,
2131
2203
  showClean: !0,
2132
2204
  modelValue: t[o],
2133
- "onUpdate:modelValue": (u) => {
2134
- c(o, u);
2205
+ "onUpdate:modelValue": (x) => {
2206
+ i(o, x);
2135
2207
  },
2136
- onClear: () => s(o)
2208
+ onClear: () => r(o)
2137
2209
  });
2138
- })), l = O(
2210
+ })), d = I(
2139
2211
  () => new Map(
2140
- m.value.map((h) => {
2141
- const o = h.props?.name;
2142
- return o ? [o, h] : null;
2143
- }).filter((h) => h !== null)
2212
+ m.value.map((C) => {
2213
+ const o = C.props?.name;
2214
+ return o ? [o, C] : null;
2215
+ }).filter((C) => C !== null)
2144
2216
  )
2145
2217
  );
2146
- function b() {
2147
- t.value = {}, r("clearAll", {
2148
- data: J(t.value),
2218
+ function h() {
2219
+ t.value = {}, a("clearAll", {
2220
+ data: Z(t.value),
2149
2221
  name: "ALL"
2150
2222
  });
2151
2223
  }
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();
2224
+ const p = _(""), n = I(
2225
+ () => Object.values(t.value).filter((C) => Array.isArray(C) ? C.some((o) => o !== "" && o !== void 0) : C !== "" && C !== void 0).length
2226
+ ), l = _();
2227
+ M(p, async () => {
2228
+ await fe(), l?.value?.filterRef?.inputTextRef && l.value.filterRef.inputTextRef.focus();
2157
2229
  });
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(() => {
2230
+ const b = I(() => f.schema?.value ? Object.fromEntries(Object.entries(f.schema?.value).slice(0, f.limit)) : {}), y = I(() => f.schema?.value ? f.view !== "inline" ? f.schema?.value : Object.fromEntries(Object.entries(f.schema?.value).slice(f.limit)) : {}), k = I(() => {
2159
2231
  if (m.value.length === 0) return [];
2160
- let h = 0;
2161
- if (p.schema?.value) {
2162
- const o = Object.entries(p.schema.value).length;
2163
- o < p.limit ? h = p.limit - o : h = 0;
2232
+ let C = 0;
2233
+ if (f.schema?.value) {
2234
+ const o = Object.entries(f.schema.value).length;
2235
+ o < f.limit ? C = f.limit - o : C = 0;
2164
2236
  }
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 = "";
2237
+ return m.value.slice(0, C);
2238
+ }), g = I(() => m.value.length === 0 ? [] : f.view !== "inline" ? m.value : m.value.slice(k.value.length));
2239
+ function $() {
2240
+ if (y.value) {
2241
+ const [C] = Object.keys(y.value);
2242
+ p.value = C;
2243
+ } else g.value.length > 0 ? p.value = g.value[0].props.name : p.value = "";
2172
2244
  }
2173
2245
  return {
2174
2246
  activeFilter: t,
2175
- activeFilterCount: a,
2176
- onFilterChange: c,
2177
- clearFilter: s,
2178
- clearAllFilters: b,
2179
- limitedSchema: k,
2180
- popoverSchema: $,
2247
+ activeFilterCount: n,
2248
+ onFilterChange: i,
2249
+ clearFilter: r,
2250
+ clearAllFilters: h,
2251
+ limitedSchema: b,
2252
+ popoverSchema: y,
2181
2253
  filtersSlot: m,
2182
- limitedFiltersSlot: S,
2183
- popoverFiltersSlot: C,
2184
- vnodeMap: l,
2185
- onPopoverOpen: A,
2186
- selectedFilter: f,
2187
- filterRef: n
2254
+ limitedFiltersSlot: k,
2255
+ popoverFiltersSlot: g,
2256
+ vnodeMap: d,
2257
+ onPopoverOpen: $,
2258
+ selectedFilter: p,
2259
+ filterRef: l
2188
2260
  };
2189
2261
  }
2190
- const Al = /* @__PURE__ */ Y({
2262
+ const Ll = /* @__PURE__ */ O({
2191
2263
  __name: "popover",
2192
2264
  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" });
2265
+ setup(f, { emit: a }) {
2266
+ const v = _(!1), t = _(null), s = _(null), r = _(null), i = _({ top: "0px", left: "0px", position: "absolute" });
2195
2267
  function m() {
2196
- y.value = !y.value;
2268
+ v.value = !v.value;
2197
2269
  }
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 = {
2270
+ function d() {
2271
+ const l = r.value, b = t.value;
2272
+ if (!l || !b) return;
2273
+ const y = l.getBoundingClientRect(), k = b.offsetWidth, g = window.innerWidth - y.left;
2274
+ let $ = y.left + window.scrollX;
2275
+ k > g && ($ = window.innerWidth - k - 8, $ < 8 && ($ = 8)), i.value = {
2204
2276
  position: "absolute",
2205
- top: `${$.bottom + window.scrollY + 8}px`,
2206
- left: `${A}px`
2277
+ top: `${y.bottom + window.scrollY + 8}px`,
2278
+ left: `${$}px`
2207
2279
  };
2208
2280
  }
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);
2281
+ function h(l) {
2282
+ const b = l.target;
2283
+ !r.value?.contains(l.target) && !t.value?.contains(l.target) && !b.closest("[data-inside-popover]") && (v.value = !1);
2212
2284
  }
2213
- const f = _(!1);
2214
- ne(() => {
2215
- 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);
2285
+ const p = _(!1);
2286
+ ae(() => {
2287
+ p.value = !0;
2288
+ }), ae(() => {
2289
+ r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click", h), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
2218
2290
  }), ce(() => {
2219
- s.value?.removeEventListener("click", m), document.removeEventListener("click", b), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
2291
+ r.value?.removeEventListener("click", m), document.removeEventListener("click", h), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
2220
2292
  });
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", {
2293
+ const n = a;
2294
+ return M(v, async (l) => {
2295
+ l ? (n("open"), await fe(), d()) : n("close");
2296
+ }), (l, b) => (c(), w("div", {
2225
2297
  ref_key: "wrapperRef",
2226
- ref: g
2298
+ ref: s
2227
2299
  }, [
2228
- ue(n.$slots, "trigger"),
2229
- f.value ? (d(), B(_e, {
2300
+ ue(l.$slots, "trigger"),
2301
+ p.value ? (c(), S($e, {
2230
2302
  key: 0,
2231
2303
  to: "body"
2232
2304
  }, [
2233
- H(i("div", {
2305
+ T(u("div", {
2234
2306
  ref_key: "popoverRef",
2235
2307
  ref: t,
2236
2308
  class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
2237
- style: $e(c.value)
2309
+ style: Ae(i.value)
2238
2310
  }, [
2239
- ue(n.$slots, "default")
2311
+ ue(l.$slots, "default")
2240
2312
  ], 4), [
2241
- [G, y.value]
2313
+ [X, v.value]
2242
2314
  ])
2243
- ])) : w("", !0)
2315
+ ])) : V("", !0)
2244
2316
  ], 512));
2245
2317
  }
2246
- }), Dl = {}, Bl = {
2318
+ }), El = {}, Il = {
2247
2319
  xmlns: "http://www.w3.org/2000/svg",
2248
2320
  width: "24",
2249
2321
  height: "24",
@@ -2255,27 +2327,27 @@ const Al = /* @__PURE__ */ Y({
2255
2327
  "stroke-linejoin": "round",
2256
2328
  class: "lucide lucide-filter h-4 w-4"
2257
2329
  };
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)
2330
+ function Tl(f, a) {
2331
+ return c(), w("svg", Il, a[0] || (a[0] = [
2332
+ u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2261
2333
  ]));
2262
2334
  }
2263
- const Ml = /* @__PURE__ */ X(Dl, [["render", Rl]]), Kl = {
2335
+ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2264
2336
  key: 0,
2265
2337
  class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5 py-0.5"
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 = {
2338
+ }, zl = { class: "flex" }, Nl = { class: "w-64 border-r border-gray-200" }, Hl = { class: "p-2" }, Yl = ["onClick"], Pl = { class: "flex items-center gap-2" }, Wl = { class: "text-sm font-medium" }, ql = {
2267
2339
  key: 0,
2268
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-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 = {
2341
+ }, Ql = ["onClick"], Gl = { class: "flex items-center gap-2" }, Xl = { class: "text-sm font-medium" }, Jl = {
2270
2342
  key: 0,
2271
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"
2272
- }, Yl = {
2344
+ }, Zl = {
2273
2345
  key: 0,
2274
2346
  class: "p-2 border-t"
2275
- }, Wl = { class: "flex-1 min-h-[300px] overflow-y-auto" }, Pl = {
2347
+ }, eo = { class: "flex-1 min-h-[300px] overflow-y-auto" }, to = {
2276
2348
  key: 0,
2277
2349
  class: "flex items-center justify-center h-full text-gray-500"
2278
- }, Me = /* @__PURE__ */ Y({
2350
+ }, je = /* @__PURE__ */ O({
2279
2351
  __name: "popover-filter-layout",
2280
2352
  props: {
2281
2353
  schema: {},
@@ -2286,147 +2358,146 @@ const Ml = /* @__PURE__ */ X(Dl, [["render", Rl]]), Kl = {
2286
2358
  limit: { default: 3 }
2287
2359
  },
2288
2360
  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
2361
+ setup(f, { expose: a, emit: v }) {
2362
+ const t = f, s = Ke(t.mode), r = pe(), i = v, m = _({}), {
2363
+ activeFilter: d,
2364
+ activeFilterCount: h,
2365
+ onFilterChange: p,
2366
+ clearFilter: n,
2367
+ clearAllFilters: l,
2368
+ popoverSchema: b,
2369
+ popoverFiltersSlot: y,
2370
+ onPopoverOpen: k,
2371
+ selectedFilter: g,
2372
+ filterRef: $
2301
2373
  } = he({
2302
2374
  ...t,
2303
- schema: c,
2304
- slots: g
2305
- }, s);
2306
- return F(
2375
+ schema: m,
2376
+ slots: r
2377
+ }, i);
2378
+ return M(
2307
2379
  () => t.schema,
2308
- (A) => {
2309
- c.value = A;
2380
+ (C) => {
2381
+ m.value = C;
2310
2382
  },
2311
2383
  { 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 = "")
2384
+ ), a({
2385
+ clearFilter: n,
2386
+ clearAllFilters: l
2387
+ }), (C, o) => (c(), S(Ll, {
2388
+ onOpen: e(k),
2389
+ onClose: o[5] || (o[5] = (x) => g.value = "")
2318
2390
  }, {
2319
2391
  trigger: le(() => [
2320
- i("button", {
2392
+ u("button", {
2321
2393
  "data-popover-trigger": "",
2322
2394
  "aria-haspopup": "dialog",
2323
2395
  "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
- ]),
2396
+ class: D(
2397
+ e(s) + (e(h) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2398
+ ),
2328
2399
  type: "button"
2329
2400
  }, [
2330
- N(Ml),
2331
- h[6] || (h[6] = z(" Фільтр ")),
2332
- e(l) > 0 ? (d(), x("div", Kl, j(e(l)), 1)) : w("", !0)
2401
+ N(Ol),
2402
+ o[6] || (o[6] = z(" Фільтр ", -1)),
2403
+ e(h) > 0 ? (c(), w("div", Ul, F(e(h)), 1)) : V("", !0)
2333
2404
  ], 2)
2334
2405
  ]),
2335
2406
  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.")
2407
+ u("div", zl, [
2408
+ u("div", Nl, [
2409
+ o[7] || (o[7] = u("div", { class: "p-4 border-b" }, [
2410
+ u("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
2340
2411
  ], -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,
2412
+ u("div", Hl, [
2413
+ C.schema ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(b)), ([x, K]) => (c(), w("button", {
2414
+ key: x,
2344
2415
  onClick: () => {
2345
- S.value = o;
2416
+ g.value = x;
2346
2417
  },
2347
- class: R([
2418
+ class: D([
2348
2419
  "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" : ""
2420
+ e(g) === x ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2350
2421
  ])
2351
2422
  }, [
2352
- i("div", Il, [
2353
- i("span", Tl, j(u.label), 1)
2423
+ u("div", Pl, [
2424
+ u("span", Wl, F(K.label), 1)
2354
2425
  ]),
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([
2426
+ (Array.isArray(e(d)[x]) ? e(d)[x]?.length > 0 : e(d)[x] || e(d)[x] === null) ? (c(), w("div", ql)) : V("", !0)
2427
+ ], 10, Yl))), 128)) : V("", !0),
2428
+ (c(!0), w(R, null, W(e(y), (x, K) => (c(), w("button", {
2429
+ key: "slot-" + K,
2430
+ onClick: (A) => g.value = x.props.name,
2431
+ class: D([
2361
2432
  "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" : ""
2433
+ e(g) === x.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2363
2434
  ])
2364
2435
  }, [
2365
- i("div", zl, [
2366
- i("span", Nl, j(o.props.label), 1)
2436
+ u("div", Gl, [
2437
+ u("span", Xl, F(x.props.label), 1)
2367
2438
  ]),
2368
- e(m)[o.props.name]?.length > 0 ? (d(), x("div", Hl)) : w("", !0)
2369
- ], 10, Ul))), 128))
2439
+ e(d)[x.props.name]?.length > 0 ? (c(), w("div", Jl)) : V("", !0)
2440
+ ], 10, Ql))), 128))
2370
2441
  ]),
2371
- e(l) > 0 ? (d(), x("div", Yl, [
2372
- i("button", {
2442
+ e(h) > 0 ? (c(), w("div", Zl, [
2443
+ u("button", {
2373
2444
  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)),
2445
+ onClick: o[0] || (o[0] = //@ts-ignore
2446
+ (...x) => e(l) && e(l)(...x)),
2376
2447
  "data-inside-popover": ""
2377
2448
  }, " Очистити всі ")
2378
- ])) : w("", !0)
2449
+ ])) : V("", !0)
2379
2450
  ]),
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,
2451
+ u("div", eo, [
2452
+ e(g) === "" ? (c(), w("div", to, o[8] || (o[8] = [
2453
+ u("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
2454
+ ]))) : V("", !0),
2455
+ e(g) ? (c(), w(R, { key: 1 }, [
2456
+ e(b) ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(b)), ([x, K]) => (c(), w(R, null, [
2457
+ e(g) === x ? (c(), S(ne, P({
2458
+ name: x,
2459
+ key: x,
2389
2460
  layout: "popover",
2390
2461
  ref_for: !0,
2391
2462
  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);
2463
+ ref: $
2464
+ }, { ref_for: !0 }, K, {
2465
+ onChange: o[1] || (o[1] = (A) => e(p)(A.name, A.value)),
2466
+ onClear: o[2] || (o[2] = (A) => {
2467
+ e(n)(A), e(p)(A, void 0);
2397
2468
  }),
2398
- modelValue: e(m)[o],
2399
- "onUpdate:modelValue": (v) => e(m)[o] = v,
2469
+ modelValue: e(d)[x],
2470
+ "onUpdate:modelValue": (A) => e(d)[x] = A,
2400
2471
  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
2472
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : V("", !0)
2473
+ ], 64))), 256)) : V("", !0),
2474
+ (c(!0), w(R, null, W(e(y), (x, K) => (c(), w(R, {
2475
+ key: "slot-" + K
2405
2476
  }, [
2406
- e(S) === o.props.name ? (d(), B(oe, W({
2477
+ e(g) === x.props.name ? (c(), S(ne, P({
2407
2478
  key: 0,
2408
2479
  layout: "popover"
2409
- }, { ref_for: !0 }, o.props, {
2480
+ }, { ref_for: !0 }, x.props, {
2410
2481
  ref_for: !0,
2411
2482
  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);
2483
+ ref: $,
2484
+ onChange: o[3] || (o[3] = (A) => e(p)(A.name, A.value)),
2485
+ onClear: o[4] || (o[4] = (A) => {
2486
+ e(n)(A), e(p)(A, void 0);
2416
2487
  }),
2417
- modelValue: e(m)[o.props.name],
2418
- "onUpdate:modelValue": (v) => e(m)[o.props.name] = v,
2488
+ modelValue: e(d)[x.props.name],
2489
+ "onUpdate:modelValue": (A) => e(d)[x.props.name] = A,
2419
2490
  cleanable: !0
2420
- }), null, 16, ["modelValue", "onUpdate:modelValue"])) : w("", !0)
2491
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])) : V("", !0)
2421
2492
  ], 64))), 128))
2422
- ], 64)) : w("", !0)
2493
+ ], 64)) : V("", !0)
2423
2494
  ])
2424
2495
  ])
2425
2496
  ]),
2426
2497
  _: 1
2427
2498
  }, 8, ["onOpen"]));
2428
2499
  }
2429
- }), ql = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ Y({
2500
+ }), lo = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ O({
2430
2501
  __name: "inline-filter-layout",
2431
2502
  props: {
2432
2503
  schema: {},
@@ -2437,89 +2508,90 @@ const Ml = /* @__PURE__ */ X(Dl, [["render", Rl]]), Kl = {
2437
2508
  limit: { default: 3 }
2438
2509
  },
2439
2510
  emits: ["change", "clear", "clearAll"],
2440
- setup(p, { emit: r }) {
2441
- const y = p, t = r, g = pe(), s = _({}), {
2442
- activeFilter: c,
2511
+ setup(f, { emit: a }) {
2512
+ const v = f, t = a, s = pe(), r = _({}), {
2513
+ activeFilter: i,
2443
2514
  activeFilterCount: m,
2444
- onFilterChange: l,
2445
- clearFilter: b,
2446
- clearAllFilters: f,
2447
- limitedSchema: a,
2448
- popoverSchema: n,
2449
- filtersSlot: k,
2450
- limitedFiltersSlot: $,
2451
- popoverFiltersSlot: S
2515
+ onFilterChange: d,
2516
+ clearFilter: h,
2517
+ clearAllFilters: p,
2518
+ limitedSchema: n,
2519
+ popoverSchema: l,
2520
+ filtersSlot: b,
2521
+ limitedFiltersSlot: y,
2522
+ popoverFiltersSlot: k
2452
2523
  } = he(
2453
2524
  {
2454
- ...y,
2455
- schema: s,
2456
- slots: g
2525
+ ...v,
2526
+ schema: r,
2527
+ slots: s
2457
2528
  },
2458
2529
  t
2459
- ), C = _();
2460
- function A() {
2461
- C.value && C.value.clearAllFilters(), f();
2530
+ ), g = _();
2531
+ function $() {
2532
+ g.value && g.value.clearAllFilters(), p();
2462
2533
  }
2463
- return F(
2464
- () => y.schema,
2465
- (h) => {
2466
- s.value = h;
2534
+ return M(
2535
+ () => v.schema,
2536
+ (C) => {
2537
+ r.value = C;
2467
2538
  },
2468
2539
  { 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);
2540
+ ), (C, o) => (c(), w("div", lo, [
2541
+ C.schema ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(n)), ([x, K]) => (c(), S(ne, P({
2542
+ key: x,
2543
+ name: x,
2544
+ mode: C.mode
2545
+ }, { ref_for: !0 }, K, {
2546
+ onChange: o[0] || (o[0] = (A) => e(d)(A.name, A.value)),
2547
+ onClear: o[1] || (o[1] = (A) => {
2548
+ e(h)(A), e(d)(A, void 0);
2478
2549
  }),
2479
2550
  layout: "inline",
2480
2551
  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,
2552
+ modelValue: e(i)[x],
2553
+ "onUpdate:modelValue": (A) => e(i)[x] = A
2554
+ }), null, 16, ["name", "mode", "modelValue", "onUpdate:modelValue"]))), 128)) : V("", !0),
2555
+ (c(!0), w(R, null, W(e(y), (x, K) => (c(), S(ne, P({
2556
+ key: "slot-" + K,
2486
2557
  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);
2558
+ }, { ref_for: !0 }, x.props, {
2559
+ onChange: o[2] || (o[2] = (A) => e(d)(A.name, A.value)),
2560
+ onClear: o[3] || (o[3] = (A) => {
2561
+ e(h)(A), e(d)(A, void 0);
2491
2562
  }),
2492
2563
  cleanable: !0,
2493
- modelValue: e(c)[u.props.name],
2494
- "onUpdate:modelValue": (V) => e(c)[u.props.name] = V
2564
+ modelValue: e(i)[x.props.name],
2565
+ "onUpdate:modelValue": (A) => e(i)[x.props.name] = A
2495
2566
  }), 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)),
2498
- onClearAll: e(f),
2499
- onClear: o[5] || (o[5] = (u) => e(b)(u.name)),
2567
+ Object.entries(e(l)).length > 0 || e(k).length > 0 ? (c(), S(je, P({ key: 1 }, v, {
2568
+ onChange: o[4] || (o[4] = (x) => e(d)(x.name, x.value)),
2569
+ onClearAll: e(p),
2570
+ onClear: o[5] || (o[5] = (x) => e(h)(x.name)),
2571
+ mode: C.mode,
2500
2572
  ref_key: "popoverRef",
2501
- ref: C,
2573
+ ref: g,
2502
2574
  cleanable: !0
2503
2575
  }), {
2504
2576
  default: le(() => [
2505
- (d(!0), x(K, null, P(e(k), (u, v) => (d(), B(ee(u), W({
2506
- key: "slot-" + v,
2577
+ (c(!0), w(R, null, W(e(b), (x, K) => (c(), S(ee(x), P({
2578
+ key: "slot-" + K,
2507
2579
  layout: "inline"
2508
- }, { ref_for: !0 }, u.props, { cleanable: !0 }), null, 16))), 128))
2580
+ }, { ref_for: !0 }, x.props, { cleanable: !0 }), null, 16))), 128))
2509
2581
  ]),
2510
2582
  _: 1
2511
- }, 16, ["onClearAll"])) : w("", !0),
2512
- e(m) > 0 ? (d(), x("button", {
2583
+ }, 16, ["onClearAll", "mode"])) : V("", !0),
2584
+ e(m) > 0 ? (c(), w("button", {
2513
2585
  key: 2,
2514
- onClick: A,
2586
+ onClick: $,
2515
2587
  class: "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"
2516
- }, " Очистити ")) : w("", !0)
2588
+ }, " Очистити ")) : V("", !0)
2517
2589
  ]));
2518
2590
  }
2519
- }), Ql = {
2591
+ }), oo = {
2520
2592
  key: 0,
2521
2593
  class: "p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
2522
- }, Gl = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, Xl = /* @__PURE__ */ Y({
2594
+ }, no = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, ao = /* @__PURE__ */ O({
2523
2595
  __name: "vertical-filter-layout",
2524
2596
  props: {
2525
2597
  schema: {},
@@ -2530,58 +2602,58 @@ const Ml = /* @__PURE__ */ X(Dl, [["render", Rl]]), Kl = {
2530
2602
  limit: { default: 3 }
2531
2603
  },
2532
2604
  emits: ["change", "clear", "clearAll"],
2533
- setup(p, { emit: r }) {
2534
- const y = p, t = r, g = pe(), {
2535
- activeFilter: s,
2536
- activeFilterCount: c,
2605
+ setup(f, { emit: a }) {
2606
+ const v = f, t = a, s = pe(), {
2607
+ activeFilter: r,
2608
+ activeFilterCount: i,
2537
2609
  onFilterChange: m,
2538
- clearFilter: l,
2539
- clearAllFilters: b,
2540
- filtersSlot: f
2610
+ clearFilter: d,
2611
+ clearAllFilters: h,
2612
+ filtersSlot: p
2541
2613
  } = he({
2542
- ...y,
2543
- slots: g
2614
+ ...v,
2615
+ slots: s
2544
2616
  }, t);
2545
- return (a, n) => a.view === "vertical" ? (d(), x("div", Ql, [
2546
- i("div", Gl, [
2547
- e(c) > 0 ? (d(), x("button", {
2617
+ return (n, l) => n.view === "vertical" ? (c(), w("div", oo, [
2618
+ u("div", no, [
2619
+ e(i) > 0 ? (c(), w("button", {
2548
2620
  key: 0,
2549
- onClick: n[0] || (n[0] = //@ts-ignore
2550
- (...k) => e(b) && e(b)(...k)),
2621
+ onClick: l[0] || (l[0] = //@ts-ignore
2622
+ (...b) => e(h) && e(h)(...b)),
2551
2623
  "data-popover-trigger": "",
2552
2624
  "aria-haspopup": "dialog",
2553
2625
  "aria-expanded": "false",
2554
2626
  class: "w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",
2555
2627
  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,
2628
+ }, " Очистити ")) : V("", !0),
2629
+ n.schema ? (c(!0), w(R, { key: 1 }, W(Object.entries(n.schema), ([b, y]) => (c(), S(ne, P({
2630
+ name: b,
2559
2631
  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);
2632
+ }, { ref_for: !0 }, y, {
2633
+ onChange: l[1] || (l[1] = (k) => e(m)(k.name, k.value)),
2634
+ onClear: l[2] || (l[2] = (k) => {
2635
+ e(d)(k), e(m)(k, void 0);
2564
2636
  }),
2565
- modelValue: e(s)[k],
2566
- "onUpdate:modelValue": (S) => e(s)[k] = S,
2637
+ modelValue: e(r)[b],
2638
+ "onUpdate:modelValue": (k) => e(r)[b] = k,
2567
2639
  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-" + $,
2640
+ }), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : V("", !0),
2641
+ (c(!0), w(R, null, W(e(p), (b, y) => (c(), S(ne, P({
2642
+ key: "slot-" + y,
2571
2643
  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);
2644
+ }, { ref_for: !0 }, b.props, {
2645
+ onChange: l[3] || (l[3] = (k) => e(m)(k.name, k.value)),
2646
+ onClear: l[4] || (l[4] = (k) => {
2647
+ e(d)(k), e(m)(k, void 0);
2576
2648
  }),
2577
- modelValue: e(s)[k.props.name],
2578
- "onUpdate:modelValue": (S) => e(s)[k.props.name] = S,
2649
+ modelValue: e(r)[b.props.name],
2650
+ "onUpdate:modelValue": (k) => e(r)[b.props.name] = k,
2579
2651
  showClean: !0
2580
2652
  }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
2581
2653
  ])
2582
- ])) : w("", !0);
2654
+ ])) : V("", !0);
2583
2655
  }
2584
- }), Jl = /* @__PURE__ */ Y({
2656
+ }), Ve = /* @__PURE__ */ O({
2585
2657
  __name: "filter",
2586
2658
  props: {
2587
2659
  schema: {},
@@ -2592,82 +2664,81 @@ const Ml = /* @__PURE__ */ X(Dl, [["render", Rl]]), Kl = {
2592
2664
  limit: { default: 3 }
2593
2665
  },
2594
2666
  emits: ["change", "clear", "clearAll"],
2595
- setup(p, { emit: r }) {
2596
- const y = p, t = _(y.value ?? {}), g = r;
2597
- function s(f, a) {
2667
+ setup(f, { emit: a }) {
2668
+ const v = f, t = _(v.value ?? {}), s = a;
2669
+ function r(p, n) {
2598
2670
  t.value = {
2599
2671
  ...t.value,
2600
- [f]: a
2601
- }, g("change", {
2602
- data: J(t.value),
2603
- name: f,
2604
- value: a
2672
+ [p]: n
2673
+ }, s("change", {
2674
+ data: Z(t.value),
2675
+ name: p,
2676
+ value: n
2605
2677
  });
2606
2678
  }
2607
- function c(f) {
2608
- delete t.value[f], g("clear", {
2609
- data: J(t.value),
2610
- name: f
2679
+ function i(p) {
2680
+ delete t.value[p], s("clear", {
2681
+ data: Z(t.value),
2682
+ name: p
2611
2683
  });
2612
2684
  }
2613
2685
  function m() {
2614
- t.value = {}, g("clear", {
2615
- data: J(t.value),
2686
+ t.value = {}, s("clear", {
2687
+ data: Z(t.value),
2616
2688
  name: "ALL"
2617
- }), g("change", {
2618
- data: J(t.value),
2689
+ }), s("change", {
2690
+ data: Z(t.value),
2619
2691
  name: "ALL",
2620
2692
  value: null
2621
2693
  });
2622
2694
  }
2623
- const l = _({});
2624
- function b() {
2625
- switch (y.view) {
2695
+ const d = _({});
2696
+ function h() {
2697
+ switch (v.view) {
2626
2698
  case "inline":
2627
2699
  return Ce;
2628
2700
  case "vertical":
2629
- return Xl;
2701
+ return ao;
2630
2702
  case "popover":
2631
- return Me;
2703
+ return je;
2632
2704
  default:
2633
2705
  return Ce;
2634
2706
  }
2635
2707
  }
2636
- return F(
2637
- () => y.schema,
2638
- (f) => {
2639
- if (!f) {
2640
- l.value = {};
2708
+ return M(
2709
+ () => v.schema,
2710
+ (p) => {
2711
+ if (!p) {
2712
+ d.value = {};
2641
2713
  return;
2642
2714
  }
2643
- if (Array.isArray(f) && !f.length) {
2644
- l.value = {};
2715
+ if (Array.isArray(p) && !p.length) {
2716
+ d.value = {};
2645
2717
  return;
2646
2718
  }
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 });
2719
+ Array.isArray(p) ? d.value = p.filter((n) => n.type).reduce((n, l) => (Object.assign(l, { name: l.id || l.name, type: l.type.toLowerCase() }), n[l.name] = l, l.data && !l.api && !l.options && Object.assign(l, { api: `/api/suggest/${l.data}` }), n), {}) : (Object.entries(p).forEach(([n, l]) => {
2720
+ Object.assign(l, { name: n || l.name || l.id, type: l.type.toLowerCase() });
2721
+ }), d.value = { ...p });
2650
2722
  },
2651
2723
  { 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)),
2724
+ ), (p, n) => (c(), S(ee(h()), P(v, {
2725
+ schema: d.value,
2726
+ onChange: n[0] || (n[0] = (l) => r(l.name, l.value)),
2727
+ onClear: n[1] || (n[1] = (l) => i(l.name)),
2656
2728
  onClearAll: m
2657
2729
  }), {
2658
2730
  default: le(() => [
2659
- ue(f.$slots, "default")
2731
+ ue(p.$slots, "default")
2660
2732
  ]),
2661
2733
  _: 3
2662
2734
  }, 16, ["schema"]));
2663
2735
  }
2664
- }), eo = {
2665
- install(p) {
2666
- p.component("Filter", Jl), p.component("FilterField", oe);
2667
- }
2736
+ });
2737
+ Ve.install = function(a) {
2738
+ a.component("VsFilter", Ve);
2668
2739
  };
2669
2740
  export {
2670
- Jl as Filter,
2671
- oe as FilterField,
2672
- eo as default
2741
+ Ve as Filter,
2742
+ ne as FilterField,
2743
+ Ve as default
2673
2744
  };