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