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