@opengis/filter 0.1.21 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createElementBlock as w, openBlock as i, createElementVNode as u, defineComponent as q, ref as A, computed as O, withModifiers as se, normalizeClass as L, createCommentVNode as
|
|
1
|
+
import { createElementBlock as w, openBlock as i, createElementVNode as u, defineComponent as q, ref as A, computed as O, withModifiers as se, normalizeClass as L, createCommentVNode as _, toDisplayString as S, createVNode as Q, watch as E, createStaticVNode as Ne, Fragment as U, renderList as X, unref as e, createBlock as I, createTextVNode as G, withDirectives as W, vShow as Z, getCurrentInstance as Pe, vModelText as ee, onBeforeUnmount as me, onMounted as ce, isRef as Ye, Teleport as ge, normalizeStyle as be, renderSlot as de, nextTick as fe, withCtx as ne, resolveDynamicComponent as re, mergeProps as J, toRaw as ue, cloneVNode as We, useSlots as pe, reactive as qe, withKeys as $e, createSlots as Qe, normalizeProps as He, guardReactiveProps as Ge } from "vue";
|
|
2
2
|
import { notify as Ae } from "@opengis/core";
|
|
3
|
-
const te = (
|
|
4
|
-
const y =
|
|
3
|
+
const te = (m, o) => {
|
|
4
|
+
const y = m.__vccOpts || m;
|
|
5
5
|
for (const [t, a] of o)
|
|
6
6
|
y[t] = a;
|
|
7
7
|
return y;
|
|
@@ -17,7 +17,7 @@ const te = (p, o) => {
|
|
|
17
17
|
"stroke-linejoin": "round",
|
|
18
18
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
|
|
19
19
|
};
|
|
20
|
-
function Ze(
|
|
20
|
+
function Ze(m, o) {
|
|
21
21
|
return i(), w("svg", Je, o[0] || (o[0] = [
|
|
22
22
|
u("path", {
|
|
23
23
|
stroke: "none",
|
|
@@ -40,7 +40,7 @@ const et = /* @__PURE__ */ te(Xe, [["render", Ze]]), tt = {}, lt = {
|
|
|
40
40
|
"stroke-linejoin": "round",
|
|
41
41
|
class: "text-blue-600 w-[16px] h-[16px]"
|
|
42
42
|
};
|
|
43
|
-
function ot(
|
|
43
|
+
function ot(m, o) {
|
|
44
44
|
return i(), w("svg", lt, o[0] || (o[0] = [
|
|
45
45
|
u("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
|
46
46
|
]));
|
|
@@ -69,12 +69,12 @@ const ae = /* @__PURE__ */ te(tt, [["render", ot]]), at = { class: "flex items-c
|
|
|
69
69
|
highlighted: { type: Boolean }
|
|
70
70
|
},
|
|
71
71
|
emits: ["itemClick"],
|
|
72
|
-
setup(
|
|
73
|
-
const t =
|
|
72
|
+
setup(m, { expose: o, emit: y }) {
|
|
73
|
+
const t = m, a = y;
|
|
74
74
|
function l() {
|
|
75
75
|
a("itemClick", t.value);
|
|
76
76
|
}
|
|
77
|
-
const g = A(null),
|
|
77
|
+
const g = A(null), p = O(() => t.layout === "inline" && t.type === "radio");
|
|
78
78
|
return o({ el: g }), (n, x) => (i(), w("div", {
|
|
79
79
|
class: "flex items-center w-full rounded-sm group hover:bg-gray-100",
|
|
80
80
|
ref_key: "el",
|
|
@@ -86,18 +86,18 @@ const ae = /* @__PURE__ */ te(tt, [["render", ot]]), at = { class: "flex items-c
|
|
|
86
86
|
for: "radio-9740",
|
|
87
87
|
class: L([
|
|
88
88
|
["inline", "popover"].includes(n.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",
|
|
89
|
-
{ "bg-blue-100": n.highlighted, relative:
|
|
89
|
+
{ "bg-blue-100": n.highlighted, relative: p.value }
|
|
90
90
|
]),
|
|
91
91
|
onClick: se(l, ["stop", "prevent"])
|
|
92
92
|
}, [
|
|
93
|
-
|
|
93
|
+
p.value ? _("", !0) : (i(), w("div", {
|
|
94
94
|
key: 0,
|
|
95
95
|
class: L(["w-[18px] h-[18px] border flex items-center justify-center", [
|
|
96
96
|
n.type === "checkbox" ? "rounded-[4px]" : "rounded-full",
|
|
97
97
|
n.color ? `bg-[${n.color}] border-[#ffffff]` : n.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
|
98
98
|
]])
|
|
99
99
|
}, [
|
|
100
|
-
n.isSelected ? (i(), w("img", rt)) :
|
|
100
|
+
n.isSelected ? (i(), w("img", rt)) : _("", !0)
|
|
101
101
|
], 2)),
|
|
102
102
|
u("input", {
|
|
103
103
|
type: "checkbox",
|
|
@@ -106,52 +106,52 @@ const ae = /* @__PURE__ */ te(tt, [["render", ot]]), at = { class: "flex items-c
|
|
|
106
106
|
value: n.value
|
|
107
107
|
}, null, 8, st),
|
|
108
108
|
u("div", {
|
|
109
|
-
class: L(["flex flex-1 flex-row items-center justify-between",
|
|
109
|
+
class: L(["flex flex-1 flex-row items-center justify-between", p.value ? "pl-1 pr-6" : "w-[calc(100%-18px)] pl-[10px]"])
|
|
110
110
|
}, [
|
|
111
111
|
u("span", it, S(n.label ?? "Відсутні дані"), 1),
|
|
112
|
-
n.count ? (i(), w("div", ut, " (" + S(n.count) + ") ", 1)) :
|
|
112
|
+
n.count ? (i(), w("div", ut, " (" + S(n.count) + ") ", 1)) : _("", !0)
|
|
113
113
|
], 2),
|
|
114
|
-
|
|
114
|
+
p.value && n.isSelected ? (i(), w("span", dt, [
|
|
115
115
|
Q(ae)
|
|
116
|
-
])) :
|
|
116
|
+
])) : _("", !0)
|
|
117
117
|
], 2)
|
|
118
118
|
])
|
|
119
119
|
])
|
|
120
120
|
], 512));
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
-
function xe(
|
|
123
|
+
function xe(m, o) {
|
|
124
124
|
const {
|
|
125
125
|
options: y = [],
|
|
126
126
|
limit: t = 20
|
|
127
|
-
} =
|
|
127
|
+
} = m;
|
|
128
128
|
function a(b) {
|
|
129
129
|
return Array.isArray(b) ? b[0] : b;
|
|
130
130
|
}
|
|
131
|
-
const l = A(a(
|
|
131
|
+
const l = A(a(m.modelValue)), g = A(""), p = A(!1), n = A([]), x = A("id"), d = A("text"), v = A(!1), c = A(m.layout !== "popover" && y.length > t);
|
|
132
132
|
function k(b) {
|
|
133
133
|
const h = b.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find(($) => $ in h) ?? "id", M = ["text", "label", "name", "title"].find(($) => $ in h) ?? "text";
|
|
134
134
|
return { autoValueKey: K, autoLabelKey: M };
|
|
135
135
|
}
|
|
136
136
|
if (y.length > 0) {
|
|
137
137
|
const b = k(y);
|
|
138
|
-
x.value = b.autoValueKey,
|
|
138
|
+
x.value = b.autoValueKey, d.value = b.autoLabelKey;
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const V = O(() => {
|
|
141
141
|
const b = n.value;
|
|
142
|
-
return
|
|
142
|
+
return m.layout === "popover" || v.value ? b : b.slice(0, t);
|
|
143
143
|
});
|
|
144
|
-
|
|
144
|
+
E(() => m.modelValue, (b) => {
|
|
145
145
|
l.value = a(b);
|
|
146
|
-
}, { immediate: !0 }), n.value = [...y].sort((b, h) =>
|
|
146
|
+
}, { immediate: !0 }), n.value = [...y].sort((b, h) => m.sort === "count" ? h.count && b.count ? h.count - b.count : 0 : m.sort === "name" ? String(b[d.value] ?? "").localeCompare(String(h[d.value] ?? "")) : 0);
|
|
147
147
|
function C(b) {
|
|
148
148
|
return l.value === b[x.value];
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
l.value = b[x.value], o("update:modelValue", l.value), o("change", { name:
|
|
150
|
+
function f(b) {
|
|
151
|
+
l.value = b[x.value], o("update:modelValue", l.value), o("change", { name: m.name, value: l.value });
|
|
152
152
|
}
|
|
153
153
|
function r() {
|
|
154
|
-
l.value = void 0, o("update:modelValue", l.value), o("clear",
|
|
154
|
+
l.value = void 0, o("update:modelValue", l.value), o("clear", m.name);
|
|
155
155
|
}
|
|
156
156
|
function s() {
|
|
157
157
|
v.value = !v.value;
|
|
@@ -159,15 +159,15 @@ function xe(p, o) {
|
|
|
159
159
|
return {
|
|
160
160
|
innerValue: l,
|
|
161
161
|
searchTerm: g,
|
|
162
|
-
filteredOptions:
|
|
162
|
+
filteredOptions: V,
|
|
163
163
|
isSelected: C,
|
|
164
|
-
selectItem:
|
|
164
|
+
selectItem: f,
|
|
165
165
|
clear: r,
|
|
166
166
|
toggleShowAll: s,
|
|
167
|
-
isReqProc:
|
|
167
|
+
isReqProc: p,
|
|
168
168
|
showAll: v,
|
|
169
|
-
isEnableShowAll:
|
|
170
|
-
labelKey:
|
|
169
|
+
isEnableShowAll: c,
|
|
170
|
+
labelKey: d,
|
|
171
171
|
valueKey: x,
|
|
172
172
|
allOptions: n
|
|
173
173
|
};
|
|
@@ -178,7 +178,7 @@ const ct = {}, ft = {
|
|
|
178
178
|
fill: "none",
|
|
179
179
|
xmlns: "http://www.w3.org/2000/svg"
|
|
180
180
|
};
|
|
181
|
-
function pt(
|
|
181
|
+
function pt(m, o) {
|
|
182
182
|
return i(), w("svg", ft, o[0] || (o[0] = [
|
|
183
183
|
Ne('<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)
|
|
184
184
|
]));
|
|
@@ -195,7 +195,7 @@ const we = /* @__PURE__ */ te(ct, [["render", pt]]), mt = {}, vt = {
|
|
|
195
195
|
"stroke-linejoin": "round",
|
|
196
196
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
|
|
197
197
|
};
|
|
198
|
-
function yt(
|
|
198
|
+
function yt(m, o) {
|
|
199
199
|
return i(), w("svg", vt, o[0] || (o[0] = [
|
|
200
200
|
u("path", {
|
|
201
201
|
stroke: "none",
|
|
@@ -217,7 +217,7 @@ const ve = /* @__PURE__ */ te(mt, [["render", yt]]), gt = {}, bt = {
|
|
|
217
217
|
"stroke-linejoin": "round",
|
|
218
218
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
|
|
219
219
|
};
|
|
220
|
-
function ht(
|
|
220
|
+
function ht(m, o) {
|
|
221
221
|
return i(), w("svg", bt, o[0] || (o[0] = [
|
|
222
222
|
u("path", {
|
|
223
223
|
stroke: "none",
|
|
@@ -236,7 +236,7 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
236
236
|
}, Ct = {
|
|
237
237
|
key: 1,
|
|
238
238
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
239
|
-
},
|
|
239
|
+
}, Vt = /* @__PURE__ */ q({
|
|
240
240
|
__name: "radio",
|
|
241
241
|
props: {
|
|
242
242
|
id: {},
|
|
@@ -265,28 +265,28 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
265
265
|
itemClass: {}
|
|
266
266
|
},
|
|
267
267
|
emits: ["update:modelValue", "change", "clear"],
|
|
268
|
-
setup(
|
|
269
|
-
const t =
|
|
268
|
+
setup(m, { expose: o, emit: y }) {
|
|
269
|
+
const t = m, a = A(null), l = y, {
|
|
270
270
|
innerValue: g,
|
|
271
|
-
filteredOptions:
|
|
271
|
+
filteredOptions: p,
|
|
272
272
|
isSelected: n,
|
|
273
273
|
selectItem: x,
|
|
274
|
-
clear:
|
|
274
|
+
clear: d,
|
|
275
275
|
toggleShowAll: v,
|
|
276
|
-
isReqProc:
|
|
276
|
+
isReqProc: c,
|
|
277
277
|
showAll: k,
|
|
278
|
-
isEnableShowAll:
|
|
278
|
+
isEnableShowAll: V,
|
|
279
279
|
labelKey: C,
|
|
280
|
-
valueKey:
|
|
280
|
+
valueKey: f,
|
|
281
281
|
allOptions: r
|
|
282
282
|
} = xe({
|
|
283
283
|
...t,
|
|
284
284
|
modelValue: t.modelValue ?? t.default ?? ""
|
|
285
285
|
}, l);
|
|
286
286
|
return o({
|
|
287
|
-
clear:
|
|
287
|
+
clear: d,
|
|
288
288
|
inputTextRef: a
|
|
289
|
-
}),
|
|
289
|
+
}), E(
|
|
290
290
|
() => t.modelValue,
|
|
291
291
|
(s) => {
|
|
292
292
|
s === void 0 && (g.value = void 0);
|
|
@@ -300,19 +300,19 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
300
300
|
s.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
301
301
|
])
|
|
302
302
|
}, [
|
|
303
|
-
(i(!0), w(U, null, X(e(
|
|
303
|
+
(i(!0), w(U, null, X(e(p), (h) => (i(), I(he, {
|
|
304
304
|
layout: s.layout,
|
|
305
|
-
key: h[e(
|
|
305
|
+
key: h[e(f)],
|
|
306
306
|
count: h.count,
|
|
307
307
|
label: h[e(C)],
|
|
308
308
|
color: h.color,
|
|
309
309
|
type: "radio",
|
|
310
|
-
value: h[e(
|
|
310
|
+
value: h[e(f)],
|
|
311
311
|
"is-selected": e(n)(h),
|
|
312
312
|
onItemClick: (K) => e(x)(h)
|
|
313
313
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
|
314
314
|
], 2),
|
|
315
|
-
s.type === "select" && e(
|
|
315
|
+
s.type === "select" && e(p).length === 0 && !e(c) ? (i(), w("div", xt, [
|
|
316
316
|
u("div", wt, [
|
|
317
317
|
Q(we),
|
|
318
318
|
b[4] || (b[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
@@ -320,9 +320,9 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
320
320
|
u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
321
321
|
], -1))
|
|
322
322
|
])
|
|
323
|
-
])) :
|
|
323
|
+
])) : _("", !0),
|
|
324
324
|
s.layout !== "popover" && s.type !== "select" ? (i(), w(U, { key: 1 }, [
|
|
325
|
-
!e(k) && e(
|
|
325
|
+
!e(k) && e(V) ? (i(), w("div", {
|
|
326
326
|
key: 0,
|
|
327
327
|
onClick: b[0] || (b[0] = //@ts-ignore
|
|
328
328
|
(...h) => e(v) && e(v)(...h)),
|
|
@@ -330,7 +330,7 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
330
330
|
}, [
|
|
331
331
|
b[5] || (b[5] = G(" Показати більше ", -1)),
|
|
332
332
|
Q(ve)
|
|
333
|
-
])) :
|
|
333
|
+
])) : _("", !0),
|
|
334
334
|
e(k) ? (i(), w("div", {
|
|
335
335
|
key: 1,
|
|
336
336
|
onClick: b[1] || (b[1] = //@ts-ignore
|
|
@@ -339,66 +339,66 @@ const ke = /* @__PURE__ */ te(gt, [["render", ht]]), xt = {
|
|
|
339
339
|
}, [
|
|
340
340
|
b[6] || (b[6] = G(" Показати менше ", -1)),
|
|
341
341
|
Q(ke)
|
|
342
|
-
])) :
|
|
343
|
-
], 64)) :
|
|
342
|
+
])) : _("", !0)
|
|
343
|
+
], 64)) : _("", !0),
|
|
344
344
|
s.cleanable ? (i(), w(U, { key: 2 }, [
|
|
345
345
|
s.layout === "inline" ? (i(), w("div", kt, [
|
|
346
346
|
G(S(e(g) || e(g) === null ? 1 : 0) + " з " + S(e(r).length) + " обрано ", 1),
|
|
347
347
|
W(u("button", {
|
|
348
348
|
class: "text-gray-600 hover:text-gray-800",
|
|
349
349
|
onClick: b[2] || (b[2] = //@ts-ignore
|
|
350
|
-
(...h) => e(
|
|
350
|
+
(...h) => e(d) && e(d)(...h))
|
|
351
351
|
}, " Очистити ", 512), [
|
|
352
352
|
[Z, e(g) !== "" && e(g) !== void 0]
|
|
353
353
|
])
|
|
354
|
-
])) :
|
|
354
|
+
])) : _("", !0),
|
|
355
355
|
s.layout === "popover" ? (i(), w("div", Ct, [
|
|
356
356
|
u("span", null, S(e(g) || e(g) === null ? 1 : 0) + " з " + S(e(r).length) + " обрано", 1),
|
|
357
357
|
W(u("button", {
|
|
358
358
|
class: "text-gray-600 hover:text-gray-800",
|
|
359
359
|
onClick: b[3] || (b[3] = //@ts-ignore
|
|
360
|
-
(...h) => e(
|
|
360
|
+
(...h) => e(d) && e(d)(...h))
|
|
361
361
|
}, " Очистити ", 512), [
|
|
362
362
|
[Z, e(g) !== "" && e(g) !== void 0]
|
|
363
363
|
])
|
|
364
|
-
])) :
|
|
365
|
-
], 64)) :
|
|
364
|
+
])) : _("", !0)
|
|
365
|
+
], 64)) : _("", !0)
|
|
366
366
|
], 2));
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
|
-
function Me(
|
|
369
|
+
function Me(m, o) {
|
|
370
370
|
const {
|
|
371
371
|
options: y = [],
|
|
372
372
|
limit: t = 20
|
|
373
|
-
} =
|
|
373
|
+
} = m;
|
|
374
374
|
function a(b) {
|
|
375
375
|
return Array.isArray(b) ? b : b ? [b] : [];
|
|
376
376
|
}
|
|
377
|
-
const l = A(a(
|
|
377
|
+
const l = A(a(m.modelValue)), g = A(""), p = A(!1), n = A([]), x = A("id"), d = A("text"), v = A(!1), c = A(m.layout !== "popover" && y.length > t);
|
|
378
378
|
function k(b) {
|
|
379
379
|
const h = b.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find(($) => $ in h) ?? "id", M = ["text", "label", "name", "title"].find(($) => $ in h) ?? "text";
|
|
380
380
|
return { autoValueKey: K, autoLabelKey: M };
|
|
381
381
|
}
|
|
382
382
|
if (y.length > 0) {
|
|
383
383
|
const b = k(y);
|
|
384
|
-
x.value = b.autoValueKey,
|
|
384
|
+
x.value = b.autoValueKey, d.value = b.autoLabelKey;
|
|
385
385
|
}
|
|
386
|
-
const
|
|
386
|
+
const V = O(() => {
|
|
387
387
|
const b = n.value;
|
|
388
|
-
return
|
|
388
|
+
return m.layout === "popover" || v.value ? b : b.slice(0, t);
|
|
389
389
|
});
|
|
390
|
-
|
|
390
|
+
E(() => m.modelValue, (b) => {
|
|
391
391
|
l.value = a(b);
|
|
392
|
-
}, { immediate: !0 }), n.value = [...y].sort((b, h) =>
|
|
392
|
+
}, { immediate: !0 }), n.value = [...y].sort((b, h) => m.sort === "count" ? h.count && b.count ? h.count - b.count : 0 : m.sort === "name" ? String(b[d.value]).localeCompare(String(h[d.value])) : 0);
|
|
393
393
|
function C(b) {
|
|
394
394
|
return l.value && l.value.includes(b[x.value]);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function f(b) {
|
|
397
397
|
const h = l.value.includes(b[x.value]);
|
|
398
|
-
l.value = h ? l.value.filter((K) => K !== b[x.value]) : [...l.value, b[x.value]], o("update:modelValue", l.value), o("change", { name:
|
|
398
|
+
l.value = h ? l.value.filter((K) => K !== b[x.value]) : [...l.value, b[x.value]], o("update:modelValue", l.value), o("change", { name: m.name, value: l.value });
|
|
399
399
|
}
|
|
400
400
|
function r() {
|
|
401
|
-
l.value = [], o("update:modelValue", l.value), o("clear",
|
|
401
|
+
l.value = [], o("update:modelValue", l.value), o("clear", m.name);
|
|
402
402
|
}
|
|
403
403
|
function s() {
|
|
404
404
|
v.value = !v.value;
|
|
@@ -406,15 +406,15 @@ function Me(p, o) {
|
|
|
406
406
|
return {
|
|
407
407
|
innerValue: l,
|
|
408
408
|
searchTerm: g,
|
|
409
|
-
filteredOptions:
|
|
409
|
+
filteredOptions: V,
|
|
410
410
|
isSelected: C,
|
|
411
|
-
selectItem:
|
|
411
|
+
selectItem: f,
|
|
412
412
|
clear: r,
|
|
413
413
|
toggleShowAll: s,
|
|
414
|
-
isReqProc:
|
|
414
|
+
isReqProc: p,
|
|
415
415
|
showAll: v,
|
|
416
|
-
isEnableShowAll:
|
|
417
|
-
labelKey:
|
|
416
|
+
isEnableShowAll: c,
|
|
417
|
+
labelKey: d,
|
|
418
418
|
valueKey: x,
|
|
419
419
|
allOptions: n
|
|
420
420
|
};
|
|
@@ -459,20 +459,20 @@ const Se = {
|
|
|
459
459
|
selectFieldHelp: "Оберіть поле, щоб розпочати створення фільтра."
|
|
460
460
|
}
|
|
461
461
|
};
|
|
462
|
-
function Be(
|
|
463
|
-
const o =
|
|
462
|
+
function Be(m) {
|
|
463
|
+
const o = m.split(".")[1], y = typeof window < "u" && window.localStorage ? localStorage.locale : null;
|
|
464
464
|
return (Se[y || navigator.language] || Se.uk)[o];
|
|
465
465
|
}
|
|
466
466
|
function oe() {
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
469
|
-
const o =
|
|
467
|
+
const m = Pe();
|
|
468
|
+
if (!m.appContext.config.globalProperties.$i18n) return Be;
|
|
469
|
+
const o = m.appContext.config.globalProperties.$t;
|
|
470
470
|
return (y) => {
|
|
471
471
|
const t = o(y);
|
|
472
472
|
return t === y ? Be(y) : t;
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const _t = {
|
|
476
476
|
key: 0,
|
|
477
477
|
class: "w-full"
|
|
478
478
|
}, $t = { class: "flex flex-col items-center justify-center p-5 text-center" }, At = { class: "max-w-sm mx-auto mt-6" }, St = { class: "font-medium text-gray-800 dark:text-neutral-200" }, Bt = {
|
|
@@ -510,31 +510,31 @@ const Vt = {
|
|
|
510
510
|
itemClass: {}
|
|
511
511
|
},
|
|
512
512
|
emits: ["update:modelValue", "change", "clear"],
|
|
513
|
-
setup(
|
|
514
|
-
const t = oe(), a =
|
|
513
|
+
setup(m, { expose: o, emit: y }) {
|
|
514
|
+
const t = oe(), a = m, l = y, {
|
|
515
515
|
innerValue: g,
|
|
516
|
-
filteredOptions:
|
|
516
|
+
filteredOptions: p,
|
|
517
517
|
isSelected: n,
|
|
518
518
|
selectItem: x,
|
|
519
|
-
clear:
|
|
519
|
+
clear: d,
|
|
520
520
|
toggleShowAll: v,
|
|
521
|
-
isReqProc:
|
|
521
|
+
isReqProc: c,
|
|
522
522
|
showAll: k,
|
|
523
|
-
isEnableShowAll:
|
|
523
|
+
isEnableShowAll: V,
|
|
524
524
|
labelKey: C,
|
|
525
|
-
valueKey:
|
|
525
|
+
valueKey: f,
|
|
526
526
|
allOptions: r
|
|
527
527
|
} = Me({
|
|
528
528
|
...a,
|
|
529
529
|
modelValue: a.modelValue
|
|
530
530
|
}, l);
|
|
531
|
-
return
|
|
531
|
+
return E(
|
|
532
532
|
() => a.modelValue,
|
|
533
533
|
(s) => {
|
|
534
534
|
s === void 0 && (g.value = []);
|
|
535
535
|
}
|
|
536
536
|
), o({
|
|
537
|
-
clear:
|
|
537
|
+
clear: d
|
|
538
538
|
}), (s, b) => (i(), w("div", {
|
|
539
539
|
class: L([s.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
540
540
|
}, [
|
|
@@ -544,18 +544,18 @@ const Vt = {
|
|
|
544
544
|
s.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
545
545
|
])
|
|
546
546
|
}, [
|
|
547
|
-
(i(!0), w(U, null, X(e(
|
|
547
|
+
(i(!0), w(U, null, X(e(p), (h) => (i(), I(he, {
|
|
548
548
|
layout: s.layout,
|
|
549
549
|
count: h.count,
|
|
550
550
|
label: h[e(C)],
|
|
551
551
|
color: h.color,
|
|
552
552
|
type: "checkbox",
|
|
553
|
-
value: h[e(
|
|
553
|
+
value: h[e(f)],
|
|
554
554
|
"is-selected": e(n)(h),
|
|
555
555
|
onItemClick: (K) => e(x)(h)
|
|
556
556
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
|
557
557
|
], 2),
|
|
558
|
-
s.type === "select" && e(
|
|
558
|
+
s.type === "select" && e(p).length === 0 && !e(c) ? (i(), w("div", _t, [
|
|
559
559
|
u("div", $t, [
|
|
560
560
|
Q(we),
|
|
561
561
|
u("div", At, [
|
|
@@ -563,9 +563,9 @@ const Vt = {
|
|
|
563
563
|
b[4] || (b[4] = u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
564
564
|
])
|
|
565
565
|
])
|
|
566
|
-
])) :
|
|
566
|
+
])) : _("", !0),
|
|
567
567
|
s.layout !== "popover" && s.type !== "select" ? (i(), w(U, { key: 1 }, [
|
|
568
|
-
!e(k) && e(
|
|
568
|
+
!e(k) && e(V) ? (i(), w("div", {
|
|
569
569
|
key: 0,
|
|
570
570
|
onClick: b[0] || (b[0] = //@ts-ignore
|
|
571
571
|
(...h) => e(v) && e(v)(...h)),
|
|
@@ -573,7 +573,7 @@ const Vt = {
|
|
|
573
573
|
}, [
|
|
574
574
|
G(S(e(t)("filter.more")) + " ", 1),
|
|
575
575
|
Q(ve)
|
|
576
|
-
])) :
|
|
576
|
+
])) : _("", !0),
|
|
577
577
|
e(k) ? (i(), w("div", {
|
|
578
578
|
key: 1,
|
|
579
579
|
onClick: b[1] || (b[1] = //@ts-ignore
|
|
@@ -582,30 +582,30 @@ const Vt = {
|
|
|
582
582
|
}, [
|
|
583
583
|
G(S(e(t)("filter.less")) + " ", 1),
|
|
584
584
|
Q(ke)
|
|
585
|
-
])) :
|
|
586
|
-
], 64)) :
|
|
585
|
+
])) : _("", !0)
|
|
586
|
+
], 64)) : _("", !0),
|
|
587
587
|
s.cleanable ? (i(), w(U, { key: 2 }, [
|
|
588
588
|
s.layout === "inline" ? (i(), w("div", Bt, [
|
|
589
589
|
G(S(e(g).length) + " / " + S(e(r).length) + " " + S(e(t)("filter.selected")) + " ", 1),
|
|
590
590
|
W(u("button", {
|
|
591
591
|
class: "text-gray-600 hover:text-gray-800",
|
|
592
592
|
onClick: b[2] || (b[2] = //@ts-ignore
|
|
593
|
-
(...h) => e(
|
|
593
|
+
(...h) => e(d) && e(d)(...h))
|
|
594
594
|
}, S(e(t)("filter.clear")), 513), [
|
|
595
595
|
[Z, e(g).length !== 0]
|
|
596
596
|
])
|
|
597
|
-
])) :
|
|
597
|
+
])) : _("", !0),
|
|
598
598
|
s.layout === "popover" ? (i(), w("div", jt, [
|
|
599
599
|
u("span", null, S(e(g).length) + " / " + S(e(r).length) + " " + S(e(t)("filter.selected")), 1),
|
|
600
600
|
W(u("button", {
|
|
601
601
|
class: "text-gray-600 hover:text-gray-800",
|
|
602
602
|
onClick: b[3] || (b[3] = //@ts-ignore
|
|
603
|
-
(...h) => e(
|
|
603
|
+
(...h) => e(d) && e(d)(...h))
|
|
604
604
|
}, S(e(t)("filter.clear")), 513), [
|
|
605
605
|
[Z, e(g).length !== 0]
|
|
606
606
|
])
|
|
607
|
-
])) :
|
|
608
|
-
], 64)) :
|
|
607
|
+
])) : _("", !0)
|
|
608
|
+
], 64)) : _("", !0)
|
|
609
609
|
], 2));
|
|
610
610
|
}
|
|
611
611
|
}), Dt = {}, Rt = {
|
|
@@ -620,7 +620,7 @@ const Vt = {
|
|
|
620
620
|
"stroke-linejoin": "round",
|
|
621
621
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
622
622
|
};
|
|
623
|
-
function Ft(
|
|
623
|
+
function Ft(m, o) {
|
|
624
624
|
return i(), w("svg", Rt, o[0] || (o[0] = [
|
|
625
625
|
u("path", {
|
|
626
626
|
stroke: "none",
|
|
@@ -643,7 +643,7 @@ const Le = /* @__PURE__ */ te(Dt, [["render", Ft]]), Kt = {}, Mt = {
|
|
|
643
643
|
width: "15px",
|
|
644
644
|
height: "15px"
|
|
645
645
|
};
|
|
646
|
-
function Lt(
|
|
646
|
+
function Lt(m, o) {
|
|
647
647
|
return i(), w("svg", Mt, o[0] || (o[0] = [
|
|
648
648
|
u("path", {
|
|
649
649
|
stroke: "none",
|
|
@@ -689,16 +689,16 @@ const Ot = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
689
689
|
itemClass: {}
|
|
690
690
|
},
|
|
691
691
|
emits: ["update:modelValue", "change", "clear"],
|
|
692
|
-
setup(
|
|
693
|
-
const y =
|
|
694
|
-
|
|
692
|
+
setup(m, { emit: o }) {
|
|
693
|
+
const y = m, t = A((y.placeholder || y.label || y.title || y.name || "search").toString()), a = o, l = A(y.modelValue?.toString() ?? "");
|
|
694
|
+
E(
|
|
695
695
|
() => y.modelValue,
|
|
696
696
|
(x) => {
|
|
697
697
|
x !== l.value && (l.value = x?.toString() ?? "");
|
|
698
698
|
}
|
|
699
699
|
);
|
|
700
700
|
let g = null;
|
|
701
|
-
function
|
|
701
|
+
function p() {
|
|
702
702
|
if (l.value = l.value.trimStart(), l.value.length === 0) {
|
|
703
703
|
n();
|
|
704
704
|
return;
|
|
@@ -710,7 +710,7 @@ const Ot = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
710
710
|
function n() {
|
|
711
711
|
l.value = "", a("update:modelValue", ""), a("clear", y.name);
|
|
712
712
|
}
|
|
713
|
-
return (x,
|
|
713
|
+
return (x, d) => (i(), w("div", {
|
|
714
714
|
class: L([
|
|
715
715
|
"vs-form-text relative bg-white rounded-sm [&>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-sm [&>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",
|
|
716
716
|
x.layout === "inline" ? e(Oe).getWidthClass(x.width) : "mb-2" + (x.layout === "popover" ? " m-2" : "")
|
|
@@ -725,11 +725,11 @@ const Ot = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
725
725
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
|
|
726
726
|
}, [
|
|
727
727
|
Q(Ce)
|
|
728
|
-
])) :
|
|
728
|
+
])) : _("", !0),
|
|
729
729
|
W(u("input", {
|
|
730
730
|
type: "text",
|
|
731
|
-
"onUpdate:modelValue":
|
|
732
|
-
onInput:
|
|
731
|
+
"onUpdate:modelValue": d[0] || (d[0] = (v) => l.value = v),
|
|
732
|
+
onInput: p,
|
|
733
733
|
placeholder: t.value,
|
|
734
734
|
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-sm 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"
|
|
735
735
|
}, null, 40, Et), [
|
|
@@ -738,11 +738,11 @@ const Ot = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
738
738
|
], 2));
|
|
739
739
|
}
|
|
740
740
|
});
|
|
741
|
-
function Ee(
|
|
741
|
+
function Ee(m = { color: "blue" }) {
|
|
742
742
|
return O(() => {
|
|
743
|
-
const y = `w-full px-3 py-2 border-solid border text-black border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${
|
|
743
|
+
const y = `w-full px-3 py-2 border-solid border text-black border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${m.color}-500 focus:border-transparent
|
|
744
744
|
text-gray-800 bg-white dark:text-neutral-300 dark:bg-neutral-800 dark:border-neutral-600`;
|
|
745
|
-
return
|
|
745
|
+
return m?.size === "sm" ? `${y}h-[32px]` : `${y}h-[38px]`;
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
function It() {
|
|
@@ -751,8 +751,8 @@ function It() {
|
|
|
751
751
|
function Ut() {
|
|
752
752
|
return "font-medium border border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 h-7 rounded-md text-xs px-2 py-1 text-gray-800 bg-white hover:bg-gray-100 dark:text-neutral-300 dark:bg-neutral-800 dark:hover:bg-neutral-700 dark:border-neutral-600";
|
|
753
753
|
}
|
|
754
|
-
function Te(
|
|
755
|
-
return
|
|
754
|
+
function Te(m) {
|
|
755
|
+
return m === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : m === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-sm border bg-white-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-1 bg-transparent h-[38px]";
|
|
756
756
|
}
|
|
757
757
|
const zt = {
|
|
758
758
|
key: 0,
|
|
@@ -793,76 +793,76 @@ const Qt = /* @__PURE__ */ q({
|
|
|
793
793
|
itemClass: {}
|
|
794
794
|
},
|
|
795
795
|
emits: ["update:modelValue", "change", "clear"],
|
|
796
|
-
setup(
|
|
797
|
-
const t = Ee(), a = It(), l = oe(), g =
|
|
796
|
+
setup(m, { expose: o, emit: y }) {
|
|
797
|
+
const t = Ee(), a = It(), l = oe(), g = m, p = A(
|
|
798
798
|
g.modelValue ?? g.default ?? []
|
|
799
799
|
), n = y, x = O({
|
|
800
|
-
get: () => g.modelValue ??
|
|
801
|
-
set: (
|
|
802
|
-
g.modelValue !== void 0 ? n("update:modelValue",
|
|
800
|
+
get: () => g.modelValue ?? p.value,
|
|
801
|
+
set: (c) => {
|
|
802
|
+
g.modelValue !== void 0 ? n("update:modelValue", c) : p.value = c;
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
|
-
function
|
|
806
|
-
n("change", { name: g.name, value: x.value ||
|
|
805
|
+
function d() {
|
|
806
|
+
n("change", { name: g.name, value: x.value || p.value });
|
|
807
807
|
}
|
|
808
808
|
function v() {
|
|
809
|
-
|
|
809
|
+
p.value = [], x.value = p.value, n("clear", g.name);
|
|
810
810
|
}
|
|
811
|
-
return
|
|
812
|
-
|
|
811
|
+
return E(() => g.modelValue, (c) => {
|
|
812
|
+
c !== void 0 && g.layout !== "popover" ? (p.value = c, n("update:modelValue", c)) : p.value = [];
|
|
813
813
|
}), o({
|
|
814
814
|
clear: v,
|
|
815
815
|
currentValue: x
|
|
816
|
-
}), (
|
|
816
|
+
}), (c, k) => (i(), w(U, null, [
|
|
817
817
|
u("div", null, [
|
|
818
818
|
u("div", {
|
|
819
|
-
class: L(
|
|
819
|
+
class: L(c.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
|
820
820
|
}, [
|
|
821
821
|
u("div", null, [
|
|
822
|
-
|
|
822
|
+
c.layout !== "vertical" ? (i(), w("label", zt, S(e(l)("filter.from")), 1)) : _("", !0),
|
|
823
823
|
W(u("input", {
|
|
824
824
|
type: "number",
|
|
825
825
|
class: L(e(t)),
|
|
826
|
-
placeholder:
|
|
826
|
+
placeholder: c.placeholder?.[0] ?? "min",
|
|
827
827
|
step: "1",
|
|
828
828
|
style: { outline: "none" },
|
|
829
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
830
|
-
disabled:
|
|
829
|
+
"onUpdate:modelValue": k[0] || (k[0] = (V) => x.value[0] = V),
|
|
830
|
+
disabled: c.disabled
|
|
831
831
|
}, null, 10, Nt), [
|
|
832
832
|
[ee, x.value[0]]
|
|
833
833
|
])
|
|
834
834
|
]),
|
|
835
|
-
|
|
835
|
+
c.layout === "vertical" ? (i(), w("label", Pt, " - ")) : _("", !0),
|
|
836
836
|
u("div", null, [
|
|
837
|
-
|
|
837
|
+
c.layout !== "vertical" ? (i(), w("label", Yt, S(e(l)("filter.to")), 1)) : _("", !0),
|
|
838
838
|
W(u("input", {
|
|
839
839
|
type: "number",
|
|
840
840
|
class: L(e(t)),
|
|
841
|
-
placeholder:
|
|
841
|
+
placeholder: c.placeholder?.[1] ?? "max",
|
|
842
842
|
min: "0",
|
|
843
843
|
max: "1000000000000000",
|
|
844
844
|
step: "1",
|
|
845
845
|
style: { outline: "none" },
|
|
846
|
-
"onUpdate:modelValue": k[1] || (k[1] = (
|
|
847
|
-
disabled:
|
|
846
|
+
"onUpdate:modelValue": k[1] || (k[1] = (V) => x.value[1] = V),
|
|
847
|
+
disabled: c.disabled
|
|
848
848
|
}, null, 10, Wt), [
|
|
849
849
|
[ee, x.value[1]]
|
|
850
850
|
])
|
|
851
851
|
]),
|
|
852
|
-
["popover", "inline", "vertical"].includes(
|
|
852
|
+
["popover", "inline", "vertical"].includes(c.layout) ? (i(), w("button", {
|
|
853
853
|
key: 1,
|
|
854
|
-
onClick:
|
|
855
|
-
class: L(e(a) + (
|
|
856
|
-
}, S(
|
|
857
|
-
["popover", "inline"].includes(
|
|
854
|
+
onClick: d,
|
|
855
|
+
class: L(e(a) + (c.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
|
856
|
+
}, S(c.layout === "vertical" ? "Ok" : e(l)("filter.apply")), 3)) : _("", !0),
|
|
857
|
+
["popover", "inline"].includes(c.layout) ? (i(), w("button", {
|
|
858
858
|
key: 2,
|
|
859
859
|
disabled: !(x.value[0] || x.value[1]),
|
|
860
860
|
onClick: v,
|
|
861
861
|
class: L(e(a) + " hover:bg-gray-100")
|
|
862
|
-
}, S(e(l)("filter.clear")), 11, qt)) :
|
|
862
|
+
}, S(e(l)("filter.clear")), 11, qt)) : _("", !0)
|
|
863
863
|
], 2)
|
|
864
864
|
]),
|
|
865
|
-
(
|
|
865
|
+
(c.cleanable && p.value.length, _("", !0))
|
|
866
866
|
], 64));
|
|
867
867
|
}
|
|
868
868
|
});
|
|
@@ -877,13 +877,13 @@ class H {
|
|
|
877
877
|
}
|
|
878
878
|
static getLastWeekRange(o, y, t = 0) {
|
|
879
879
|
if (o && y) {
|
|
880
|
-
const x = new Date(o),
|
|
881
|
-
return x.setDate(x.getDate() + t * 7),
|
|
880
|
+
const x = new Date(o), d = new Date(y);
|
|
881
|
+
return x.setDate(x.getDate() + t * 7), d.setDate(d.getDate() + t * 7), [this.format(x), this.format(d)];
|
|
882
882
|
}
|
|
883
|
-
const a = /* @__PURE__ */ new Date(), l = a.getDay(), g = l === 0 ? 13 : l - 1 + 7,
|
|
884
|
-
|
|
885
|
-
const n = new Date(
|
|
886
|
-
return n.setDate(
|
|
883
|
+
const a = /* @__PURE__ */ new Date(), l = a.getDay(), g = l === 0 ? 13 : l - 1 + 7, p = new Date(a);
|
|
884
|
+
p.setDate(a.getDate() - g + t * 7);
|
|
885
|
+
const n = new Date(p);
|
|
886
|
+
return n.setDate(p.getDate() + 6), [this.format(p), this.format(n)];
|
|
887
887
|
}
|
|
888
888
|
static getMonthRange(o, y, t = 0) {
|
|
889
889
|
let a;
|
|
@@ -895,8 +895,8 @@ class H {
|
|
|
895
895
|
const a = o || y, l = a ? new Date(a) : /* @__PURE__ */ new Date();
|
|
896
896
|
let g = Math.floor(l.getMonth() / 3);
|
|
897
897
|
g += t;
|
|
898
|
-
const
|
|
899
|
-
return [this.format(x), this.format(
|
|
898
|
+
const p = (g % 4 + 4) % 4 * 3, n = l.getFullYear() + Math.floor(g / 4), x = new Date(n, p, 1), d = new Date(n, p + 3, 0);
|
|
899
|
+
return [this.format(x), this.format(d)];
|
|
900
900
|
}
|
|
901
901
|
static getYear(o, y = 0) {
|
|
902
902
|
let t;
|
|
@@ -914,15 +914,15 @@ class H {
|
|
|
914
914
|
return t.setDate(y.getDate() - o), [this.format(t), this.format(y)];
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
|
-
function Ie(
|
|
917
|
+
function Ie(m, o) {
|
|
918
918
|
const {
|
|
919
919
|
popoverRef: y
|
|
920
|
-
} =
|
|
921
|
-
|
|
920
|
+
} = m, t = oe(), a = A(""), l = A(
|
|
921
|
+
m.modelValue ?? m.default ?? []
|
|
922
922
|
), g = A(0);
|
|
923
|
-
function
|
|
923
|
+
function p() {
|
|
924
924
|
const r = H.getRangeFromDaysBefore(g.value);
|
|
925
|
-
return l.value = [...r], o("change", { name:
|
|
925
|
+
return l.value = [...r], o("change", { name: m.name, value: l.value }), o("update:modelValue", l.value), r;
|
|
926
926
|
}
|
|
927
927
|
function n(r) {
|
|
928
928
|
a.value = r, y.value?.close();
|
|
@@ -944,13 +944,13 @@ function Ie(p, o) {
|
|
|
944
944
|
s.push(...H.getYearRange());
|
|
945
945
|
break;
|
|
946
946
|
case "last_7_days":
|
|
947
|
-
g.value = 7,
|
|
947
|
+
g.value = 7, p();
|
|
948
948
|
break;
|
|
949
949
|
case "range":
|
|
950
|
-
g.value = 7, s.push(...
|
|
950
|
+
g.value = 7, s.push(...p());
|
|
951
951
|
break;
|
|
952
952
|
}
|
|
953
|
-
l.value = [...s], o("change", { name:
|
|
953
|
+
l.value = [...s], o("change", { name: m.name, value: l.value }), o("update:modelValue", l.value);
|
|
954
954
|
}
|
|
955
955
|
function x() {
|
|
956
956
|
const r = [];
|
|
@@ -971,9 +971,9 @@ function Ie(p, o) {
|
|
|
971
971
|
r.push(...H.getYearRange(l.value[0], 1));
|
|
972
972
|
break;
|
|
973
973
|
}
|
|
974
|
-
l.value = [...r], o("change", { name:
|
|
974
|
+
l.value = [...r], o("change", { name: m.name, value: l.value }), o("update:modelValue", l.value);
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function d() {
|
|
977
977
|
const r = [];
|
|
978
978
|
switch (a.value) {
|
|
979
979
|
case "today":
|
|
@@ -992,7 +992,7 @@ function Ie(p, o) {
|
|
|
992
992
|
r.push(...H.getYearRange(l.value[0], -1));
|
|
993
993
|
break;
|
|
994
994
|
}
|
|
995
|
-
l.value = [...r], o("change", { name:
|
|
995
|
+
l.value = [...r], o("change", { name: m.name, value: l.value }), o("update:modelValue", l.value);
|
|
996
996
|
}
|
|
997
997
|
const v = [
|
|
998
998
|
"Січень",
|
|
@@ -1008,7 +1008,7 @@ function Ie(p, o) {
|
|
|
1008
1008
|
"Листопад",
|
|
1009
1009
|
"Грудень"
|
|
1010
1010
|
];
|
|
1011
|
-
function
|
|
1011
|
+
function c(r) {
|
|
1012
1012
|
const [s, b, h] = r.split("-");
|
|
1013
1013
|
return `${h}.${b}.${s}`;
|
|
1014
1014
|
}
|
|
@@ -1016,15 +1016,15 @@ function Ie(p, o) {
|
|
|
1016
1016
|
const b = new Date(Date.UTC(2e3, r - 1, 1));
|
|
1017
1017
|
return new Intl.DateTimeFormat(localStorage.locale, { month: s, timeZone: "UTC" }).format(b);
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1019
|
+
function V(r) {
|
|
1020
1020
|
const { value: s } = l;
|
|
1021
1021
|
switch (r) {
|
|
1022
1022
|
case "today":
|
|
1023
|
-
return
|
|
1023
|
+
return c(s[0]);
|
|
1024
1024
|
case "range":
|
|
1025
1025
|
return "Період";
|
|
1026
1026
|
case "week":
|
|
1027
|
-
return s[0] && s[1] ? `${
|
|
1027
|
+
return s[0] && s[1] ? `${c(s[0])} – ${c(s[1])}` : "";
|
|
1028
1028
|
case "quarter":
|
|
1029
1029
|
if (s[0]) {
|
|
1030
1030
|
const b = new Date(s[0]), h = b.getFullYear(), K = b.getMonth();
|
|
@@ -1042,26 +1042,26 @@ function Ie(p, o) {
|
|
|
1042
1042
|
case "last_7_days":
|
|
1043
1043
|
return "За останні дні";
|
|
1044
1044
|
default:
|
|
1045
|
-
return
|
|
1045
|
+
return m.label ?? "";
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
const C = O(() => a.value ?
|
|
1049
|
-
function
|
|
1050
|
-
a.value = "", l.value = [], o("update:modelValue", []), o("clear",
|
|
1048
|
+
const C = O(() => a.value ? V(a.value) : m.label ?? "");
|
|
1049
|
+
function f() {
|
|
1050
|
+
a.value = "", l.value = [], o("update:modelValue", []), o("clear", m.name);
|
|
1051
1051
|
}
|
|
1052
1052
|
return {
|
|
1053
1053
|
activeMode: a,
|
|
1054
1054
|
innerValue: l,
|
|
1055
1055
|
daysBefore: g,
|
|
1056
|
-
onDaysBeforeChange:
|
|
1056
|
+
onDaysBeforeChange: p,
|
|
1057
1057
|
onSelectChange: n,
|
|
1058
1058
|
nextClick: x,
|
|
1059
|
-
prevClick:
|
|
1059
|
+
prevClick: d,
|
|
1060
1060
|
ukMonths: v,
|
|
1061
|
-
formatDisplayDate:
|
|
1062
|
-
getModeLabel:
|
|
1061
|
+
formatDisplayDate: c,
|
|
1062
|
+
getModeLabel: V,
|
|
1063
1063
|
currentLabel: C,
|
|
1064
|
-
clear:
|
|
1064
|
+
clear: f
|
|
1065
1065
|
};
|
|
1066
1066
|
}
|
|
1067
1067
|
const Ht = {
|
|
@@ -1109,80 +1109,92 @@ const rl = /* @__PURE__ */ q({
|
|
|
1109
1109
|
itemClass: {}
|
|
1110
1110
|
},
|
|
1111
1111
|
emits: ["update:modelValue", "change", "clear"],
|
|
1112
|
-
setup(
|
|
1113
|
-
const t =
|
|
1112
|
+
setup(m, { expose: o, emit: y }) {
|
|
1113
|
+
const t = m, a = Ee(), l = Ut(), g = oe(), p = y, n = A(null), {
|
|
1114
1114
|
activeMode: x,
|
|
1115
|
-
innerValue:
|
|
1115
|
+
innerValue: d,
|
|
1116
1116
|
onSelectChange: v,
|
|
1117
|
-
nextClick:
|
|
1117
|
+
nextClick: c,
|
|
1118
1118
|
prevClick: k,
|
|
1119
|
-
clear:
|
|
1120
|
-
} = Ie(
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1119
|
+
clear: V
|
|
1120
|
+
} = Ie(
|
|
1121
|
+
{
|
|
1122
|
+
...t,
|
|
1123
|
+
popoverRef: n
|
|
1124
|
+
},
|
|
1125
|
+
p
|
|
1126
|
+
);
|
|
1127
|
+
return E(
|
|
1128
|
+
() => t.modelValue,
|
|
1129
|
+
(C) => {
|
|
1130
|
+
C !== void 0 ? (d.value = C, p("update:modelValue", C)) : (x.value = "", d.value = []);
|
|
1131
|
+
}
|
|
1132
|
+
), E(
|
|
1133
|
+
d,
|
|
1134
|
+
(C) => {
|
|
1135
|
+
p("update:modelValue", C), p("change", { name: t.name, value: C });
|
|
1136
|
+
},
|
|
1137
|
+
{ deep: !0 }
|
|
1138
|
+
), o({
|
|
1139
|
+
clear: V,
|
|
1128
1140
|
popoverRef: n
|
|
1129
|
-
}), (C,
|
|
1141
|
+
}), (C, f) => (i(), w(U, null, [
|
|
1130
1142
|
C.layout === "inline" ? (i(), w("div", Ht, [
|
|
1131
1143
|
e(x) !== "" && e(x) === "range" ? (i(), w("div", Gt, [
|
|
1132
1144
|
W(u("input", {
|
|
1133
1145
|
type: "date",
|
|
1134
|
-
max: e(
|
|
1146
|
+
max: e(d)[1],
|
|
1135
1147
|
locale: "uk-UA",
|
|
1136
|
-
"onUpdate:modelValue":
|
|
1148
|
+
"onUpdate:modelValue": f[0] || (f[0] = (r) => e(d)[0] = r),
|
|
1137
1149
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",
|
|
1138
1150
|
disabled: C.disabled
|
|
1139
1151
|
}, null, 8, Xt), [
|
|
1140
|
-
[ee, e(
|
|
1152
|
+
[ee, e(d)[0]]
|
|
1141
1153
|
]),
|
|
1142
1154
|
W(u("input", {
|
|
1143
1155
|
type: "date",
|
|
1144
|
-
min: e(
|
|
1156
|
+
min: e(d)[0],
|
|
1145
1157
|
locale: "uk-UA",
|
|
1146
|
-
"onUpdate:modelValue":
|
|
1158
|
+
"onUpdate:modelValue": f[1] || (f[1] = (r) => e(d)[1] = r),
|
|
1147
1159
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",
|
|
1148
1160
|
disabled: C.disabled
|
|
1149
1161
|
}, null, 8, Jt), [
|
|
1150
|
-
[ee, e(
|
|
1162
|
+
[ee, e(d)[1]]
|
|
1151
1163
|
])
|
|
1152
|
-
])) :
|
|
1153
|
-
])) :
|
|
1164
|
+
])) : _("", !0)
|
|
1165
|
+
])) : _("", !0),
|
|
1154
1166
|
u("div", {
|
|
1155
1167
|
class: L(C.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
|
1156
1168
|
}, [
|
|
1157
1169
|
u("div", {
|
|
1158
1170
|
class: L(C.layout !== "popover" ? "w-[48%]" : "")
|
|
1159
1171
|
}, [
|
|
1160
|
-
C.layout === "popover" ? (i(), w("label", Zt, S(e(g)("filter.from")), 1)) :
|
|
1172
|
+
C.layout === "popover" ? (i(), w("label", Zt, S(e(g)("filter.from")), 1)) : _("", !0),
|
|
1161
1173
|
W(u("input", {
|
|
1162
1174
|
type: "date",
|
|
1163
|
-
max: e(
|
|
1175
|
+
max: e(d)[1],
|
|
1164
1176
|
locale: "uk-UA",
|
|
1165
|
-
"onUpdate:modelValue":
|
|
1177
|
+
"onUpdate:modelValue": f[2] || (f[2] = (r) => e(d)[0] = r),
|
|
1166
1178
|
class: L(e(a)),
|
|
1167
1179
|
disabled: C.disabled
|
|
1168
1180
|
}, null, 10, el), [
|
|
1169
|
-
[ee, e(
|
|
1181
|
+
[ee, e(d)[0]]
|
|
1170
1182
|
])
|
|
1171
1183
|
], 2),
|
|
1172
|
-
C.layout !== "popover" ? (i(), w("label", tl, " - ")) :
|
|
1184
|
+
C.layout !== "popover" ? (i(), w("label", tl, " - ")) : _("", !0),
|
|
1173
1185
|
u("div", {
|
|
1174
1186
|
class: L(C.layout !== "popover" ? "w-[48%]" : "")
|
|
1175
1187
|
}, [
|
|
1176
|
-
C.layout === "popover" ? (i(), w("label", ll, S(e(g)("filter.to")), 1)) :
|
|
1188
|
+
C.layout === "popover" ? (i(), w("label", ll, S(e(g)("filter.to")), 1)) : _("", !0),
|
|
1177
1189
|
W(u("input", {
|
|
1178
1190
|
type: "date",
|
|
1179
|
-
min: e(
|
|
1191
|
+
min: e(d)[0],
|
|
1180
1192
|
locale: "uk-UA",
|
|
1181
|
-
"onUpdate:modelValue":
|
|
1193
|
+
"onUpdate:modelValue": f[3] || (f[3] = (r) => e(d)[1] = r),
|
|
1182
1194
|
class: L(e(a)),
|
|
1183
1195
|
disabled: C.disabled
|
|
1184
1196
|
}, null, 10, ol), [
|
|
1185
|
-
[ee, e(
|
|
1197
|
+
[ee, e(d)[1]]
|
|
1186
1198
|
])
|
|
1187
1199
|
], 2)
|
|
1188
1200
|
], 2),
|
|
@@ -1194,55 +1206,55 @@ const rl = /* @__PURE__ */ q({
|
|
|
1194
1206
|
}, S(e(g)("filter." + r)), 11, nl)), 64)),
|
|
1195
1207
|
u("button", {
|
|
1196
1208
|
class: L(e(l)),
|
|
1197
|
-
onClick:
|
|
1209
|
+
onClick: f[4] || (f[4] = //@ts-ignore
|
|
1198
1210
|
(...r) => e(k) && e(k)(...r))
|
|
1199
|
-
}, "
|
|
1211
|
+
}, "<", 2),
|
|
1200
1212
|
u("button", {
|
|
1201
1213
|
class: L(e(l)),
|
|
1202
|
-
onClick:
|
|
1203
|
-
(...r) => e(
|
|
1204
|
-
}, "
|
|
1214
|
+
onClick: f[5] || (f[5] = //@ts-ignore
|
|
1215
|
+
(...r) => e(c) && e(c)(...r))
|
|
1216
|
+
}, ">", 2)
|
|
1205
1217
|
]),
|
|
1206
|
-
(C.cleanable,
|
|
1218
|
+
(C.cleanable, _("", !0))
|
|
1207
1219
|
], 64));
|
|
1208
1220
|
}
|
|
1209
1221
|
});
|
|
1210
|
-
function sl(
|
|
1222
|
+
function sl(m, o) {
|
|
1211
1223
|
const {
|
|
1212
1224
|
api: y,
|
|
1213
1225
|
options: t = [],
|
|
1214
1226
|
limit: a = 20,
|
|
1215
1227
|
dataKey: l = "data"
|
|
1216
|
-
} =
|
|
1217
|
-
function
|
|
1228
|
+
} = m, g = m.multi;
|
|
1229
|
+
function p(j) {
|
|
1218
1230
|
return g ? Array.isArray(j) ? j : j ? [j] : [] : Array.isArray(j) ? j[0] : j;
|
|
1219
1231
|
}
|
|
1220
|
-
const n = A(m
|
|
1232
|
+
const n = A(p(m.modelValue)), x = A(""), d = A(!1), v = A(t), c = A("id"), k = A("text"), V = A(!1), C = A(m.layout !== "popover" && t.length > a), f = A([]), r = A(0);
|
|
1221
1233
|
function s(j) {
|
|
1222
|
-
const
|
|
1234
|
+
const T = j.find(Boolean) ?? {}, P = ["id", "value", "code", "key"].find((ie) => ie in T) ?? "id", Y = ["text", "label", "name", "title"].find((ie) => ie in T) ?? "text";
|
|
1223
1235
|
return { autoValueKey: P, autoLabelKey: Y };
|
|
1224
1236
|
}
|
|
1225
1237
|
if (t.length > 0) {
|
|
1226
1238
|
const j = s(t);
|
|
1227
|
-
|
|
1239
|
+
c.value = j.autoValueKey, k.value = j.autoLabelKey;
|
|
1228
1240
|
}
|
|
1229
1241
|
const b = O(() => {
|
|
1230
1242
|
if (y) return v.value;
|
|
1231
1243
|
const j = v.value;
|
|
1232
|
-
if (
|
|
1244
|
+
if (m.layout === "popover") return j;
|
|
1233
1245
|
if (!x.value)
|
|
1234
|
-
return
|
|
1235
|
-
const
|
|
1236
|
-
return j.filter((P) => P[k.value].toLowerCase().includes(
|
|
1246
|
+
return V.value ? j : j.slice(0, a);
|
|
1247
|
+
const T = x.value.toLowerCase();
|
|
1248
|
+
return j.filter((P) => P[k.value].toLowerCase().includes(T));
|
|
1237
1249
|
});
|
|
1238
1250
|
let h = null;
|
|
1239
1251
|
async function K(j) {
|
|
1240
1252
|
if (y) {
|
|
1241
|
-
|
|
1253
|
+
d.value = !0;
|
|
1242
1254
|
try {
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1245
|
-
const P = await fetch(
|
|
1255
|
+
const T = new URL(y, window.location.origin);
|
|
1256
|
+
T.searchParams.set("json", "1"), T.searchParams.set("key", j), T.searchParams.set("limit", a.toString());
|
|
1257
|
+
const P = await fetch(T.toString());
|
|
1246
1258
|
if (!P.ok) {
|
|
1247
1259
|
Ae({ type: "error", title: "Error", message: "Failed to fetch remote options" }), v.value = [];
|
|
1248
1260
|
return;
|
|
@@ -1254,56 +1266,56 @@ function sl(p, o) {
|
|
|
1254
1266
|
}
|
|
1255
1267
|
if (v.value = Y[l], v.value.length > 0) {
|
|
1256
1268
|
const ie = s(v.value);
|
|
1257
|
-
|
|
1269
|
+
c.value = ie.autoValueKey, k.value = ie.autoLabelKey;
|
|
1258
1270
|
}
|
|
1259
1271
|
r.value = Y.total;
|
|
1260
|
-
} catch (
|
|
1261
|
-
console.error("Failed to fetch remote options:",
|
|
1272
|
+
} catch (T) {
|
|
1273
|
+
console.error("Failed to fetch remote options:", T);
|
|
1262
1274
|
} finally {
|
|
1263
|
-
|
|
1275
|
+
d.value = !1;
|
|
1264
1276
|
}
|
|
1265
1277
|
}
|
|
1266
1278
|
}
|
|
1267
|
-
|
|
1279
|
+
E(x, (j) => {
|
|
1268
1280
|
y && (h && clearTimeout(h), h = setTimeout(() => {
|
|
1269
1281
|
K(j);
|
|
1270
1282
|
}, 200));
|
|
1271
|
-
}),
|
|
1272
|
-
n.value =
|
|
1283
|
+
}), E(() => m.modelValue, (j) => {
|
|
1284
|
+
n.value = p(j);
|
|
1273
1285
|
}, { immediate: !0 });
|
|
1274
1286
|
function M(j) {
|
|
1275
|
-
return g && Array.isArray(n.value) ? n.value.includes(j[
|
|
1287
|
+
return g && Array.isArray(n.value) ? n.value.includes(j[c.value]) : n.value && n.value === j[c.value];
|
|
1276
1288
|
}
|
|
1277
1289
|
function $(j) {
|
|
1278
1290
|
if (g && !Array.isArray(n.value) && (n.value = []), g && Array.isArray(n.value)) {
|
|
1279
|
-
const
|
|
1280
|
-
n.value =
|
|
1291
|
+
const T = n.value.includes(j[c.value]);
|
|
1292
|
+
n.value = T ? n.value.filter((P) => P !== j[c.value]) : [...n.value, j[c.value]], f.value = T ? f.value.filter((P) => P !== j[k.value]) : [...f.value, j[k.value]];
|
|
1281
1293
|
} else
|
|
1282
|
-
n.value = j[
|
|
1283
|
-
o("update:modelValue", n.value), o("change", { name:
|
|
1294
|
+
n.value = j[c.value], f.value = j[k.value];
|
|
1295
|
+
o("update:modelValue", n.value), o("change", { name: m.name, value: n.value });
|
|
1284
1296
|
}
|
|
1285
1297
|
function B() {
|
|
1286
|
-
g ? (n.value = [],
|
|
1298
|
+
g ? (n.value = [], f.value = []) : (n.value = void 0, f.value = []), o("update:modelValue", n.value), o("clear", m.name);
|
|
1287
1299
|
}
|
|
1288
1300
|
function F() {
|
|
1289
|
-
h && clearTimeout(h), x.value = "",
|
|
1301
|
+
h && clearTimeout(h), x.value = "", V.value = !1;
|
|
1290
1302
|
}
|
|
1291
1303
|
function D() {
|
|
1292
|
-
|
|
1304
|
+
V.value = !V.value;
|
|
1293
1305
|
}
|
|
1294
1306
|
me(() => {
|
|
1295
1307
|
h && clearTimeout(h);
|
|
1296
1308
|
});
|
|
1297
1309
|
const R = A(-1);
|
|
1298
|
-
|
|
1310
|
+
E(b, () => {
|
|
1299
1311
|
R.value = b.value.length > 0 ? 0 : -1;
|
|
1300
1312
|
});
|
|
1301
1313
|
function N(j) {
|
|
1302
|
-
const
|
|
1314
|
+
const T = b.value.length;
|
|
1303
1315
|
if (j.key === "ArrowDown")
|
|
1304
|
-
j.preventDefault(), R.value = (R.value + 1) %
|
|
1316
|
+
j.preventDefault(), R.value = (R.value + 1) % T;
|
|
1305
1317
|
else if (j.key === "ArrowUp")
|
|
1306
|
-
j.preventDefault(), R.value = (R.value - 1 +
|
|
1318
|
+
j.preventDefault(), R.value = (R.value - 1 + T) % T;
|
|
1307
1319
|
else if (j.key === "Enter" && (j.preventDefault(), R.value >= 0 && R.value < b.value.length)) {
|
|
1308
1320
|
const P = b.value[R.value];
|
|
1309
1321
|
$(P);
|
|
@@ -1321,15 +1333,15 @@ function sl(p, o) {
|
|
|
1321
1333
|
clear: B,
|
|
1322
1334
|
resetSearch: F,
|
|
1323
1335
|
toggleShowAll: D,
|
|
1324
|
-
isReqProc:
|
|
1325
|
-
showAll:
|
|
1336
|
+
isReqProc: d,
|
|
1337
|
+
showAll: V,
|
|
1326
1338
|
isEnableShowAll: C,
|
|
1327
1339
|
labelKey: k,
|
|
1328
|
-
valueKey:
|
|
1340
|
+
valueKey: c,
|
|
1329
1341
|
allOptions: v,
|
|
1330
1342
|
highlightedIndex: R,
|
|
1331
1343
|
onKeyDown: N,
|
|
1332
|
-
selectedLabels:
|
|
1344
|
+
selectedLabels: f,
|
|
1333
1345
|
totalCount: r,
|
|
1334
1346
|
loadData: z
|
|
1335
1347
|
};
|
|
@@ -1372,18 +1384,18 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1372
1384
|
itemClass: {}
|
|
1373
1385
|
},
|
|
1374
1386
|
emits: ["update:modelValue", "change", "clear"],
|
|
1375
|
-
setup(
|
|
1376
|
-
const t = oe(), a =
|
|
1377
|
-
innerValue:
|
|
1387
|
+
setup(m, { expose: o, emit: y }) {
|
|
1388
|
+
const t = oe(), a = m, l = y, g = A(null), {
|
|
1389
|
+
innerValue: p,
|
|
1378
1390
|
filteredOptions: n,
|
|
1379
1391
|
isSelected: x,
|
|
1380
|
-
selectItem:
|
|
1392
|
+
selectItem: d,
|
|
1381
1393
|
clear: v,
|
|
1382
|
-
resetSearch:
|
|
1394
|
+
resetSearch: c,
|
|
1383
1395
|
toggleShowAll: k,
|
|
1384
|
-
isReqProc:
|
|
1396
|
+
isReqProc: V,
|
|
1385
1397
|
showAll: C,
|
|
1386
|
-
isEnableShowAll:
|
|
1398
|
+
isEnableShowAll: f,
|
|
1387
1399
|
searchTerm: r,
|
|
1388
1400
|
labelKey: s,
|
|
1389
1401
|
valueKey: b,
|
|
@@ -1397,20 +1409,20 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1397
1409
|
modelValue: a.modelValue
|
|
1398
1410
|
}, l);
|
|
1399
1411
|
ce(() => {
|
|
1400
|
-
|
|
1401
|
-
}),
|
|
1412
|
+
c(), a.layout !== "inline" && (B(), g.value && a.layout === "popover" && g.value.focus());
|
|
1413
|
+
}), E(
|
|
1402
1414
|
() => a.modelValue,
|
|
1403
1415
|
(D) => {
|
|
1404
|
-
D === void 0 && (a.multi ?
|
|
1416
|
+
D === void 0 && (a.multi ? p.value = [] : p.value = void 0);
|
|
1405
1417
|
}
|
|
1406
1418
|
);
|
|
1407
1419
|
const F = A([]);
|
|
1408
|
-
return
|
|
1420
|
+
return E(h, (D) => {
|
|
1409
1421
|
D >= 0 && F.value[D] && F.value[D]?.scrollIntoView({
|
|
1410
1422
|
block: "nearest",
|
|
1411
1423
|
behavior: "smooth"
|
|
1412
1424
|
});
|
|
1413
|
-
}),
|
|
1425
|
+
}), E(n, () => {
|
|
1414
1426
|
F.value = [];
|
|
1415
1427
|
}), o({
|
|
1416
1428
|
clear: v,
|
|
@@ -1434,11 +1446,11 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1434
1446
|
[ee, e(r)]
|
|
1435
1447
|
]),
|
|
1436
1448
|
Q(Le, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
|
1437
|
-
e(r) != "" ? (i(),
|
|
1449
|
+
e(r) != "" ? (i(), I(Ce, {
|
|
1438
1450
|
key: 0,
|
|
1439
1451
|
onClick: R[2] || (R[2] = (N) => r.value = ""),
|
|
1440
1452
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
1441
|
-
})) :
|
|
1453
|
+
})) : _("", !0)
|
|
1442
1454
|
]),
|
|
1443
1455
|
u("div", {
|
|
1444
1456
|
class: L([
|
|
@@ -1446,7 +1458,7 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1446
1458
|
D.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
1447
1459
|
])
|
|
1448
1460
|
}, [
|
|
1449
|
-
(i(!0), w(U, null, X(e(n), (N, z) => (i(),
|
|
1461
|
+
(i(!0), w(U, null, X(e(n), (N, z) => (i(), I(he, {
|
|
1450
1462
|
layout: D.layout,
|
|
1451
1463
|
count: N.count,
|
|
1452
1464
|
label: N[e(s)],
|
|
@@ -1455,12 +1467,12 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1455
1467
|
value: N[e(b)],
|
|
1456
1468
|
"is-selected": e(x)(N),
|
|
1457
1469
|
highlighted: z === e(h),
|
|
1458
|
-
onItemClick: (j) => e(
|
|
1470
|
+
onItemClick: (j) => e(d)(N),
|
|
1459
1471
|
ref_for: !0,
|
|
1460
1472
|
ref: (j) => F.value[z] = j?.el
|
|
1461
1473
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
|
1462
1474
|
], 2),
|
|
1463
|
-
D.type === "select" && e(n).length === 0 && !e(
|
|
1475
|
+
D.type === "select" && e(n).length === 0 && !e(V) ? (i(), w("div", dl, [
|
|
1464
1476
|
u("div", cl, [
|
|
1465
1477
|
Q(we),
|
|
1466
1478
|
u("div", fl, [
|
|
@@ -1468,9 +1480,9 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1468
1480
|
R[7] || (R[7] = u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
1469
1481
|
])
|
|
1470
1482
|
])
|
|
1471
|
-
])) :
|
|
1483
|
+
])) : _("", !0),
|
|
1472
1484
|
D.layout !== "popover" && D.type !== "select" ? (i(), w(U, { key: 1 }, [
|
|
1473
|
-
!e(C) && e(
|
|
1485
|
+
!e(C) && e(f) ? (i(), w("div", {
|
|
1474
1486
|
key: 0,
|
|
1475
1487
|
onClick: R[3] || (R[3] = //@ts-ignore
|
|
1476
1488
|
(...N) => e(k) && e(k)(...N)),
|
|
@@ -1478,7 +1490,7 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1478
1490
|
}, [
|
|
1479
1491
|
G(S(e(t)("filter.more")) + " ", 1),
|
|
1480
1492
|
Q(ve)
|
|
1481
|
-
])) :
|
|
1493
|
+
])) : _("", !0),
|
|
1482
1494
|
e(C) ? (i(), w("div", {
|
|
1483
1495
|
key: 1,
|
|
1484
1496
|
onClick: R[4] || (R[4] = //@ts-ignore
|
|
@@ -1487,30 +1499,30 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1487
1499
|
}, [
|
|
1488
1500
|
G(S(e(t)("filter.less")) + " ", 1),
|
|
1489
1501
|
Q(ke)
|
|
1490
|
-
])) :
|
|
1491
|
-
], 64)) :
|
|
1502
|
+
])) : _("", !0)
|
|
1503
|
+
], 64)) : _("", !0),
|
|
1492
1504
|
D.cleanable ? (i(), w(U, { key: 2 }, [
|
|
1493
1505
|
D.layout === "inline" ? (i(), w("div", ml, [
|
|
1494
|
-
G(S(D.multi && Array.isArray(e(
|
|
1506
|
+
G(S(D.multi && Array.isArray(e(p)) ? e(p)?.length : e(p) !== void 0 && (e(p) || e(p) === null) ? 1 : 0) + " / " + S(e($)) + " " + S(e(t)("filter.selected")) + " ", 1),
|
|
1495
1507
|
W(u("button", {
|
|
1496
1508
|
class: "text-gray-600 hover:text-gray-800",
|
|
1497
1509
|
onClick: R[5] || (R[5] = //@ts-ignore
|
|
1498
1510
|
(...N) => e(v) && e(v)(...N))
|
|
1499
1511
|
}, S(e(t)("filter.clear")), 513), [
|
|
1500
|
-
[Z, e(
|
|
1512
|
+
[Z, e(p) !== "" && e(p) !== void 0 || e(p)]
|
|
1501
1513
|
])
|
|
1502
|
-
])) :
|
|
1514
|
+
])) : _("", !0),
|
|
1503
1515
|
D.layout === "popover" ? (i(), w("div", vl, [
|
|
1504
|
-
u("span", null, S(D.multi && Array.isArray(e(
|
|
1516
|
+
u("span", null, S(D.multi && Array.isArray(e(p)) ? e(p)?.length : e(p) !== void 0 && (e(p) || e(p) === null) ? 1 : 0) + " / " + S(e($)) + " " + S(e(t)("filter.selected")), 1),
|
|
1505
1517
|
W(u("button", {
|
|
1506
1518
|
class: "text-gray-600 hover:text-gray-800",
|
|
1507
1519
|
onClick: R[6] || (R[6] = //@ts-ignore
|
|
1508
1520
|
(...N) => e(v) && e(v)(...N))
|
|
1509
1521
|
}, S(e(t)("filter.clear")), 513), [
|
|
1510
|
-
[Z, e(
|
|
1522
|
+
[Z, e(p) !== "" && e(p) !== void 0 || e(p)]
|
|
1511
1523
|
])
|
|
1512
|
-
])) :
|
|
1513
|
-
], 64)) :
|
|
1524
|
+
])) : _("", !0)
|
|
1525
|
+
], 64)) : _("", !0)
|
|
1514
1526
|
], 2));
|
|
1515
1527
|
}
|
|
1516
1528
|
}), gl = ["for", "onClick"], bl = ["id", "name", "value"], hl = { class: "block" }, xl = {
|
|
@@ -1548,14 +1560,14 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1548
1560
|
itemClass: {}
|
|
1549
1561
|
},
|
|
1550
1562
|
emits: ["update:modelValue", "change", "clear"],
|
|
1551
|
-
setup(
|
|
1552
|
-
const t =
|
|
1563
|
+
setup(m, { expose: o, emit: y }) {
|
|
1564
|
+
const t = m, a = y, {
|
|
1553
1565
|
innerValue: l,
|
|
1554
1566
|
isSelected: g,
|
|
1555
|
-
selectItem:
|
|
1567
|
+
selectItem: p,
|
|
1556
1568
|
clear: n,
|
|
1557
1569
|
labelKey: x,
|
|
1558
|
-
valueKey:
|
|
1570
|
+
valueKey: d,
|
|
1559
1571
|
allOptions: v
|
|
1560
1572
|
} = t.multi ? Me({
|
|
1561
1573
|
...t,
|
|
@@ -1566,59 +1578,59 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1566
1578
|
}, a);
|
|
1567
1579
|
return o({
|
|
1568
1580
|
clear: n
|
|
1569
|
-
}),
|
|
1581
|
+
}), E(
|
|
1570
1582
|
() => t.modelValue,
|
|
1571
|
-
(
|
|
1572
|
-
|
|
1583
|
+
(c) => {
|
|
1584
|
+
c === void 0 && (t.multi ? l.value = [] : l.value = void 0);
|
|
1573
1585
|
}
|
|
1574
|
-
), (
|
|
1586
|
+
), (c, k) => (i(), w(U, null, [
|
|
1575
1587
|
u("div", {
|
|
1576
|
-
class: L(["grid grid-cols-3 gap-2 mx-[1px]",
|
|
1588
|
+
class: L(["grid grid-cols-3 gap-2 mx-[1px]", c.layout === "popover" ? "m-1" : "mb-1"])
|
|
1577
1589
|
}, [
|
|
1578
|
-
(i(!0), w(U, null, X(e(v), (
|
|
1579
|
-
key: `item-${
|
|
1580
|
-
for: `item-${
|
|
1581
|
-
onClick: se((C) => e(
|
|
1582
|
-
class: L([e(g)(
|
|
1590
|
+
(i(!0), w(U, null, X(e(v), (V) => (i(), w("label", {
|
|
1591
|
+
key: `item-${V[e(d)]}`,
|
|
1592
|
+
for: `item-${V[e(d)]}`,
|
|
1593
|
+
onClick: se((C) => e(p)(V), ["stop", "prevent"]),
|
|
1594
|
+
class: L([e(g)(V) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-sm 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%)]"])
|
|
1583
1595
|
}, [
|
|
1584
1596
|
u("input", {
|
|
1585
1597
|
type: "checkbox",
|
|
1586
|
-
id: `item-${
|
|
1598
|
+
id: `item-${V[e(d)]}`,
|
|
1587
1599
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
|
1588
|
-
name: `item-${
|
|
1589
|
-
value:
|
|
1600
|
+
name: `item-${V[e(d)]}`,
|
|
1601
|
+
value: V[e(d)]
|
|
1590
1602
|
}, null, 8, bl),
|
|
1591
|
-
u("span", hl, S(
|
|
1603
|
+
u("span", hl, S(V[e(x)]), 1)
|
|
1592
1604
|
], 10, gl))), 128))
|
|
1593
1605
|
], 2),
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
G(S(
|
|
1606
|
+
c.cleanable ? (i(), w(U, { key: 0 }, [
|
|
1607
|
+
c.layout === "inline" ? (i(), w("div", xl, [
|
|
1608
|
+
G(S(c.multi && Array.isArray(e(l)) ? e(l)?.length : e(l) !== void 0 && (e(l) || e(l) === null) ? 1 : 0) + " з " + S(e(v).length) + " обрано ", 1),
|
|
1597
1609
|
W(u("button", {
|
|
1598
1610
|
class: "text-gray-600 hover:text-gray-800",
|
|
1599
1611
|
onClick: k[0] || (k[0] = //@ts-ignore
|
|
1600
|
-
(...
|
|
1612
|
+
(...V) => e(n) && e(n)(...V))
|
|
1601
1613
|
}, " Очистити ", 512), [
|
|
1602
1614
|
[Z, e(l) !== "" && e(l) !== void 0 || e(l)]
|
|
1603
1615
|
])
|
|
1604
|
-
])) :
|
|
1605
|
-
|
|
1606
|
-
u("span", null, S(
|
|
1616
|
+
])) : _("", !0),
|
|
1617
|
+
c.layout === "popover" ? (i(), w("div", wl, [
|
|
1618
|
+
u("span", null, S(c.multi && Array.isArray(e(l)) ? e(l)?.length : e(l) !== void 0 && (e(l) || e(l) === null) ? 1 : 0) + " з " + S(e(v).length) + " обрано", 1),
|
|
1607
1619
|
W(u("button", {
|
|
1608
1620
|
class: "text-gray-600 hover:text-gray-800",
|
|
1609
1621
|
onClick: k[1] || (k[1] = //@ts-ignore
|
|
1610
|
-
(...
|
|
1622
|
+
(...V) => e(n) && e(n)(...V))
|
|
1611
1623
|
}, " Очистити ", 512), [
|
|
1612
1624
|
[Z, e(l) !== void 0 && e(l) !== "" || e(l)]
|
|
1613
1625
|
])
|
|
1614
|
-
])) :
|
|
1615
|
-
], 64)) :
|
|
1626
|
+
])) : _("", !0)
|
|
1627
|
+
], 64)) : _("", !0)
|
|
1616
1628
|
], 64));
|
|
1617
1629
|
}
|
|
1618
|
-
}), Cl = ["disabled", "title"],
|
|
1630
|
+
}), Cl = ["disabled", "title"], Vl = { class: "flex w-full items-center justify-between gap-1 overflow-hidden text-left" }, _l = { class: "truncate text-ellipsis text-sm" }, $l = {
|
|
1619
1631
|
key: 0,
|
|
1620
1632
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-sm bg-blue-100 px-2 text-[11px] font-semibold text-blue-600"
|
|
1621
|
-
}, Al = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-sm 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" }, Sl = { 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" },
|
|
1633
|
+
}, Al = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-sm 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" }, Sl = { 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" }, Ve = /* @__PURE__ */ q({
|
|
1622
1634
|
__name: "popover-field",
|
|
1623
1635
|
props: {
|
|
1624
1636
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -1635,38 +1647,38 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1635
1647
|
mode: {},
|
|
1636
1648
|
layout: {}
|
|
1637
1649
|
},
|
|
1638
|
-
setup(
|
|
1639
|
-
const y =
|
|
1650
|
+
setup(m, { expose: o }) {
|
|
1651
|
+
const y = m, t = O(() => Te(y.mode)), a = A(!1), l = A({ top: 0, left: 0 }), g = A(null), p = A(null), n = A(null);
|
|
1640
1652
|
function x() {
|
|
1641
|
-
const h =
|
|
1653
|
+
const h = p.value, K = n.value;
|
|
1642
1654
|
if (!h || !K) return;
|
|
1643
1655
|
const M = h.getBoundingClientRect(), $ = K.offsetWidth, B = window.innerWidth, F = M.bottom + 8;
|
|
1644
1656
|
let { left: D } = M;
|
|
1645
1657
|
D + $ > B && (D = Math.max(B - $ - 10, 10)), l.value = { top: F, left: D };
|
|
1646
1658
|
}
|
|
1647
|
-
function
|
|
1659
|
+
function d() {
|
|
1648
1660
|
a.value = !a.value, a.value && fe(() => {
|
|
1649
1661
|
x(), y.fieldRef?.inputTextRef && y.fieldRef?.inputTextRef?.focus?.(), y.fieldRef?.loadData && y.fieldRef?.loadData?.();
|
|
1650
1662
|
});
|
|
1651
1663
|
}
|
|
1652
1664
|
function v(h) {
|
|
1653
|
-
!g.value?.contains(h.target) && !n.value?.contains(h.target) && !
|
|
1665
|
+
!g.value?.contains(h.target) && !n.value?.contains(h.target) && !p.value?.contains(h.target) && (a.value = !1);
|
|
1654
1666
|
}
|
|
1655
|
-
function
|
|
1667
|
+
function c(h) {
|
|
1656
1668
|
h.key === "Escape" && (a.value = !1);
|
|
1657
1669
|
}
|
|
1658
|
-
const k = A(!1),
|
|
1659
|
-
h.detail.key === "locale" && (
|
|
1670
|
+
const k = A(!1), V = A("ua"), C = (h) => {
|
|
1671
|
+
h.detail.key === "locale" && (V.value = h.detail.newValue);
|
|
1660
1672
|
};
|
|
1661
1673
|
ce(() => {
|
|
1662
|
-
k.value = !0,
|
|
1674
|
+
k.value = !0, V.value = localStorage.locale, window.addEventListener("storage", C), document.addEventListener("click", v, !0), document.addEventListener("keydown", c), window.addEventListener("scroll", x, !0);
|
|
1663
1675
|
}), me(() => {
|
|
1664
|
-
window.removeEventListener("resize", C), document.removeEventListener("click", v, !0), document.removeEventListener("keydown",
|
|
1676
|
+
window.removeEventListener("resize", C), document.removeEventListener("click", v, !0), document.removeEventListener("keydown", c), window.removeEventListener("scroll", x, !0);
|
|
1665
1677
|
});
|
|
1666
|
-
function
|
|
1678
|
+
function f() {
|
|
1667
1679
|
a.value = !1;
|
|
1668
1680
|
}
|
|
1669
|
-
o({ close:
|
|
1681
|
+
o({ close: f });
|
|
1670
1682
|
function r(h) {
|
|
1671
1683
|
return Array.isArray(h) ? h.filter((K) => K != null && K !== "").length : h && typeof h == "object" ? Object.values(h).filter((K) => K != null && K !== "").length : typeof h == "string" ? h.trim() === "" ? 0 : 1 : typeof h == "number" ? Number.isNaN(h) ? 0 : 1 : h === null || h !== void 0 ? 1 : 0;
|
|
1672
1684
|
}
|
|
@@ -1675,14 +1687,14 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1675
1687
|
return K > 0 ? K : r(y.currentValue);
|
|
1676
1688
|
}), b = O(() => {
|
|
1677
1689
|
const h = y.fieldRef?.selectedLabels;
|
|
1678
|
-
return !h || ["inline"].includes(y.layout || "") ? y[
|
|
1690
|
+
return !h || ["inline"].includes(y.layout || "") ? y[V.value] || (y.label ?? "") : Array.isArray(h) ? h.length > 0 ? h.join(", ") : y.label ?? "" : String(h);
|
|
1679
1691
|
});
|
|
1680
1692
|
return (h, K) => (i(), w("div", null, [
|
|
1681
1693
|
u("button", {
|
|
1682
|
-
onClick:
|
|
1694
|
+
onClick: d,
|
|
1683
1695
|
disabled: h.disabled,
|
|
1684
1696
|
ref_key: "triggerRef",
|
|
1685
|
-
ref:
|
|
1697
|
+
ref: p,
|
|
1686
1698
|
title: h.label,
|
|
1687
1699
|
class: L([
|
|
1688
1700
|
t.value,
|
|
@@ -1691,13 +1703,13 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1691
1703
|
]),
|
|
1692
1704
|
type: "button"
|
|
1693
1705
|
}, [
|
|
1694
|
-
u("span",
|
|
1695
|
-
u("span",
|
|
1696
|
-
h.layout === "inline" && s.value > 0 ? (i(), w("span", $l, S(s.value), 1)) :
|
|
1706
|
+
u("span", Vl, [
|
|
1707
|
+
u("span", _l, S(b.value), 1),
|
|
1708
|
+
h.layout === "inline" && s.value > 0 ? (i(), w("span", $l, S(s.value), 1)) : _("", !0)
|
|
1697
1709
|
]),
|
|
1698
1710
|
Q(ve, { class: "h-4 w-4 text-neutral-500" })
|
|
1699
1711
|
], 10, Cl),
|
|
1700
|
-
k.value ? (i(),
|
|
1712
|
+
k.value ? (i(), I(ge, {
|
|
1701
1713
|
key: 0,
|
|
1702
1714
|
to: "body"
|
|
1703
1715
|
}, [
|
|
@@ -1716,7 +1728,7 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1716
1728
|
], 4), [
|
|
1717
1729
|
[Z, a.value]
|
|
1718
1730
|
])
|
|
1719
|
-
])) :
|
|
1731
|
+
])) : _("", !0)
|
|
1720
1732
|
]));
|
|
1721
1733
|
}
|
|
1722
1734
|
}), Bl = {}, jl = {
|
|
@@ -1731,7 +1743,7 @@ const il = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1731
1743
|
"stroke-linejoin": "round",
|
|
1732
1744
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
|
|
1733
1745
|
};
|
|
1734
|
-
function Dl(
|
|
1746
|
+
function Dl(m, o) {
|
|
1735
1747
|
return i(), w("svg", jl, o[0] || (o[0] = [
|
|
1736
1748
|
u("path", {
|
|
1737
1749
|
stroke: "none",
|
|
@@ -1753,7 +1765,7 @@ const Rl = /* @__PURE__ */ te(Bl, [["render", Dl]]), Fl = {}, Kl = {
|
|
|
1753
1765
|
"stroke-linejoin": "round",
|
|
1754
1766
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
|
|
1755
1767
|
};
|
|
1756
|
-
function Ml(
|
|
1768
|
+
function Ml(m, o) {
|
|
1757
1769
|
return i(), w("svg", Kl, o[0] || (o[0] = [
|
|
1758
1770
|
u("path", {
|
|
1759
1771
|
stroke: "none",
|
|
@@ -1796,46 +1808,52 @@ const ql = /* @__PURE__ */ q({
|
|
|
1796
1808
|
itemClass: {}
|
|
1797
1809
|
},
|
|
1798
1810
|
emits: ["update:modelValue", "change", "clear"],
|
|
1799
|
-
setup(
|
|
1800
|
-
const t = oe(), a =
|
|
1801
|
-
activeMode:
|
|
1811
|
+
setup(m, { expose: o, emit: y }) {
|
|
1812
|
+
const t = oe(), a = m, l = y, g = A(null), {
|
|
1813
|
+
activeMode: p,
|
|
1802
1814
|
innerValue: n,
|
|
1803
1815
|
onSelectChange: x,
|
|
1804
|
-
nextClick:
|
|
1816
|
+
nextClick: d,
|
|
1805
1817
|
prevClick: v,
|
|
1806
|
-
currentLabel:
|
|
1818
|
+
currentLabel: c,
|
|
1807
1819
|
clear: k
|
|
1808
1820
|
} = Ie({
|
|
1809
1821
|
...a,
|
|
1810
1822
|
popoverRef: g
|
|
1811
1823
|
}, l);
|
|
1812
|
-
return
|
|
1813
|
-
|
|
1814
|
-
}),
|
|
1824
|
+
return E(() => a.modelValue, (V) => {
|
|
1825
|
+
V !== void 0 ? (n.value = V, l("update:modelValue", V)) : (p.value = "", n.value = []);
|
|
1826
|
+
}), E(
|
|
1827
|
+
n,
|
|
1828
|
+
(V) => {
|
|
1829
|
+
l("update:modelValue", V), l("change", { name: a.name, value: V });
|
|
1830
|
+
},
|
|
1831
|
+
{ deep: !0 }
|
|
1832
|
+
), o({
|
|
1815
1833
|
clear: k,
|
|
1816
1834
|
popoverRef: g
|
|
1817
|
-
}), (
|
|
1835
|
+
}), (V, C) => (i(), w(U, null, [
|
|
1818
1836
|
u("div", Ol, [
|
|
1819
|
-
Q(
|
|
1837
|
+
Q(Ve, {
|
|
1820
1838
|
ref_key: "popoverRef",
|
|
1821
1839
|
ref: g,
|
|
1822
|
-
label: e(
|
|
1840
|
+
label: e(c),
|
|
1823
1841
|
"current-value": e(n),
|
|
1824
|
-
mode:
|
|
1825
|
-
width: typeof
|
|
1842
|
+
mode: V.mode,
|
|
1843
|
+
width: typeof V.width == "number" && e(n).length ? V.width - 70 : V.width,
|
|
1826
1844
|
onClear: e(k),
|
|
1827
|
-
layout:
|
|
1828
|
-
class: L(
|
|
1845
|
+
layout: V.layout,
|
|
1846
|
+
class: L(V.itemClass)
|
|
1829
1847
|
}, {
|
|
1830
1848
|
default: ne(() => [
|
|
1831
1849
|
u("div", null, [
|
|
1832
1850
|
u("button", {
|
|
1833
1851
|
type: "button",
|
|
1834
|
-
onClick: C[0] || (C[0] = (
|
|
1852
|
+
onClick: C[0] || (C[0] = (f) => e(x)("range")),
|
|
1835
1853
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1836
1854
|
}, [
|
|
1837
1855
|
G(S(e(t)("filter.period")) + " ", 1),
|
|
1838
|
-
e(
|
|
1856
|
+
e(p) === "range" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1839
1857
|
])
|
|
1840
1858
|
]),
|
|
1841
1859
|
C[12] || (C[12] = u("div", null, [
|
|
@@ -1844,75 +1862,75 @@ const ql = /* @__PURE__ */ q({
|
|
|
1844
1862
|
u("div", null, [
|
|
1845
1863
|
u("button", {
|
|
1846
1864
|
type: "button",
|
|
1847
|
-
onClick: C[1] || (C[1] = (
|
|
1865
|
+
onClick: C[1] || (C[1] = (f) => e(x)("today")),
|
|
1848
1866
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1849
1867
|
}, [
|
|
1850
1868
|
G(S(e(t)("filter.today")) + " ", 1),
|
|
1851
|
-
e(
|
|
1869
|
+
e(p) === "today" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1852
1870
|
])
|
|
1853
1871
|
]),
|
|
1854
1872
|
u("div", null, [
|
|
1855
1873
|
u("button", {
|
|
1856
1874
|
type: "button",
|
|
1857
|
-
onClick: C[2] || (C[2] = (
|
|
1875
|
+
onClick: C[2] || (C[2] = (f) => e(x)("week")),
|
|
1858
1876
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1859
1877
|
}, [
|
|
1860
1878
|
G(S(e(t)("filter.week")) + " ", 1),
|
|
1861
|
-
e(
|
|
1879
|
+
e(p) === "week" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1862
1880
|
])
|
|
1863
1881
|
]),
|
|
1864
1882
|
u("div", null, [
|
|
1865
1883
|
u("button", {
|
|
1866
1884
|
type: "button",
|
|
1867
|
-
onClick: C[3] || (C[3] = (
|
|
1885
|
+
onClick: C[3] || (C[3] = (f) => e(x)("month")),
|
|
1868
1886
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1869
1887
|
}, [
|
|
1870
1888
|
G(S(e(t)("filter.month")) + " ", 1),
|
|
1871
|
-
e(
|
|
1889
|
+
e(p) === "month" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1872
1890
|
])
|
|
1873
1891
|
]),
|
|
1874
1892
|
u("div", null, [
|
|
1875
1893
|
u("button", {
|
|
1876
1894
|
type: "button",
|
|
1877
|
-
onClick: C[4] || (C[4] = (
|
|
1895
|
+
onClick: C[4] || (C[4] = (f) => e(x)("quarter")),
|
|
1878
1896
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1879
1897
|
}, [
|
|
1880
1898
|
G(S(e(t)("filter.quarter")) + " ", 1),
|
|
1881
|
-
e(
|
|
1899
|
+
e(p) === "quarter" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1882
1900
|
])
|
|
1883
1901
|
]),
|
|
1884
1902
|
u("div", El, [
|
|
1885
1903
|
u("button", {
|
|
1886
1904
|
type: "button",
|
|
1887
|
-
onClick: C[5] || (C[5] = (
|
|
1905
|
+
onClick: C[5] || (C[5] = (f) => e(x)("year")),
|
|
1888
1906
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1889
1907
|
}, [
|
|
1890
1908
|
G(S(e(t)("filter.year")) + " ", 1),
|
|
1891
|
-
e(
|
|
1909
|
+
e(p) === "year" ? (i(), I(ae, { key: 0 })) : _("", !0)
|
|
1892
1910
|
])
|
|
1893
1911
|
]),
|
|
1894
1912
|
u("div", Tl, [
|
|
1895
1913
|
u("button", {
|
|
1896
1914
|
type: "button",
|
|
1897
|
-
onClick: C[6] || (C[6] = (
|
|
1915
|
+
onClick: C[6] || (C[6] = (f) => e(k)()),
|
|
1898
1916
|
class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-sm cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
|
|
1899
1917
|
}, [
|
|
1900
1918
|
G(S(e(t)("filter.alltime")) + " ", 1),
|
|
1901
|
-
e(n)[0] ?
|
|
1919
|
+
e(n)[0] ? _("", !0) : (i(), I(ae, { key: 0 }))
|
|
1902
1920
|
])
|
|
1903
1921
|
])
|
|
1904
1922
|
]),
|
|
1905
1923
|
_: 1,
|
|
1906
1924
|
__: [12]
|
|
1907
1925
|
}, 8, ["label", "current-value", "mode", "width", "onClear", "layout", "class"]),
|
|
1908
|
-
e(
|
|
1926
|
+
e(p) !== "" && e(p) !== "range" && e(p) !== "last_7_days" ? (i(), w(U, { key: 0 }, [
|
|
1909
1927
|
u("div", Il, [
|
|
1910
1928
|
u("button", {
|
|
1911
1929
|
type: "button",
|
|
1912
1930
|
title: e(t)("filter.prev"),
|
|
1913
1931
|
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",
|
|
1914
1932
|
onClick: C[7] || (C[7] = //@ts-ignore
|
|
1915
|
-
(...
|
|
1933
|
+
(...f) => e(v) && e(v)(...f))
|
|
1916
1934
|
}, [
|
|
1917
1935
|
Q(Rl)
|
|
1918
1936
|
], 8, Ul)
|
|
@@ -1923,20 +1941,20 @@ const ql = /* @__PURE__ */ q({
|
|
|
1923
1941
|
title: e(t)("filter.next"),
|
|
1924
1942
|
class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
|
|
1925
1943
|
onClick: C[8] || (C[8] = //@ts-ignore
|
|
1926
|
-
(...
|
|
1944
|
+
(...f) => e(d) && e(d)(...f))
|
|
1927
1945
|
}, [
|
|
1928
1946
|
Q(Ll)
|
|
1929
1947
|
], 8, Nl)
|
|
1930
1948
|
])
|
|
1931
|
-
], 64)) :
|
|
1932
|
-
e(
|
|
1949
|
+
], 64)) : _("", !0),
|
|
1950
|
+
e(p) !== "" && e(p) === "range" ? (i(), w("div", Pl, [
|
|
1933
1951
|
W(u("input", {
|
|
1934
1952
|
type: "date",
|
|
1935
1953
|
max: e(n)[1],
|
|
1936
1954
|
locale: "uk-UA",
|
|
1937
|
-
"onUpdate:modelValue": C[9] || (C[9] = (
|
|
1955
|
+
"onUpdate:modelValue": C[9] || (C[9] = (f) => e(n)[0] = f),
|
|
1938
1956
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",
|
|
1939
|
-
disabled:
|
|
1957
|
+
disabled: V.disabled
|
|
1940
1958
|
}, null, 8, Yl), [
|
|
1941
1959
|
[ee, e(n)[0]]
|
|
1942
1960
|
]),
|
|
@@ -1944,15 +1962,15 @@ const ql = /* @__PURE__ */ q({
|
|
|
1944
1962
|
type: "date",
|
|
1945
1963
|
min: e(n)[0],
|
|
1946
1964
|
locale: "uk-UA",
|
|
1947
|
-
"onUpdate:modelValue": C[10] || (C[10] = (
|
|
1965
|
+
"onUpdate:modelValue": C[10] || (C[10] = (f) => e(n)[1] = f),
|
|
1948
1966
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",
|
|
1949
|
-
disabled:
|
|
1967
|
+
disabled: V.disabled
|
|
1950
1968
|
}, null, 8, Wl), [
|
|
1951
1969
|
[ee, e(n)[1]]
|
|
1952
1970
|
])
|
|
1953
|
-
])) :
|
|
1971
|
+
])) : _("", !0)
|
|
1954
1972
|
]),
|
|
1955
|
-
(
|
|
1973
|
+
(V.cleanable, _("", !0))
|
|
1956
1974
|
], 64));
|
|
1957
1975
|
}
|
|
1958
1976
|
}), Ql = { class: "flex flex-wrap items-center gap-2" }, Hl = ["disabled", "onClick"], Gl = {
|
|
@@ -1987,56 +2005,56 @@ const ql = /* @__PURE__ */ q({
|
|
|
1987
2005
|
itemClass: {}
|
|
1988
2006
|
},
|
|
1989
2007
|
emits: ["update:modelValue", "change", "clear"],
|
|
1990
|
-
setup(
|
|
1991
|
-
const t =
|
|
2008
|
+
setup(m, { expose: o, emit: y }) {
|
|
2009
|
+
const t = m, a = y, {
|
|
1992
2010
|
innerValue: l,
|
|
1993
2011
|
isSelected: g,
|
|
1994
|
-
selectItem:
|
|
2012
|
+
selectItem: p,
|
|
1995
2013
|
clear: n,
|
|
1996
2014
|
labelKey: x,
|
|
1997
|
-
valueKey:
|
|
2015
|
+
valueKey: d,
|
|
1998
2016
|
allOptions: v
|
|
1999
2017
|
} = xe({
|
|
2000
2018
|
...t,
|
|
2001
2019
|
modelValue: t.modelValue ?? t.default ?? ""
|
|
2002
|
-
}, a),
|
|
2003
|
-
function
|
|
2004
|
-
return g(
|
|
2020
|
+
}, a), c = O(() => l.value !== void 0 && !(typeof l.value == "string" && l.value === "")), k = O(() => c.value ? 1 : 0);
|
|
2021
|
+
function V(f) {
|
|
2022
|
+
return g(f) ? ["bg-blue-600 text-white"].filter((r) => typeof r == "string" && r.trim().length > 0).join(" ") : ["text-gray-700 hover:bg-gray-200 bg-gray-50 "].filter((r) => typeof r == "string" && r.trim().length > 0).join(" ");
|
|
2005
2023
|
}
|
|
2006
|
-
function C(
|
|
2007
|
-
t.disabled ||
|
|
2024
|
+
function C(f) {
|
|
2025
|
+
t.disabled || p(f);
|
|
2008
2026
|
}
|
|
2009
2027
|
return o({
|
|
2010
2028
|
clear: n
|
|
2011
|
-
}),
|
|
2029
|
+
}), E(
|
|
2012
2030
|
() => t.modelValue,
|
|
2013
|
-
(
|
|
2014
|
-
|
|
2031
|
+
(f) => {
|
|
2032
|
+
f === void 0 && (l.value = void 0);
|
|
2015
2033
|
}
|
|
2016
|
-
), (
|
|
2034
|
+
), (f, r) => (i(), w(U, null, [
|
|
2017
2035
|
u("div", Ql, [
|
|
2018
2036
|
(i(!0), w(U, null, X(e(v), (s) => (i(), w("button", {
|
|
2019
|
-
key: s[e(
|
|
2037
|
+
key: s[e(d)],
|
|
2020
2038
|
type: "button",
|
|
2021
|
-
class: L(["px-3 py-2 text-sm font-medium rounded-md transition-colors",
|
|
2022
|
-
disabled:
|
|
2039
|
+
class: L(["px-3 py-2 text-sm font-medium rounded-md transition-colors", V(s)]),
|
|
2040
|
+
disabled: f.disabled,
|
|
2023
2041
|
onClick: (b) => C(s)
|
|
2024
2042
|
}, S(s[e(x)]), 11, Hl))), 128))
|
|
2025
2043
|
]),
|
|
2026
|
-
|
|
2044
|
+
f.cleanable && f.layout === "popover" ? (i(), w("div", Gl, [
|
|
2027
2045
|
u("span", null, S(k.value) + " з " + S(e(v).length) + " обрано", 1),
|
|
2028
2046
|
W(u("button", {
|
|
2029
2047
|
class: "text-gray-600 hover:text-gray-800",
|
|
2030
2048
|
onClick: r[0] || (r[0] = //@ts-ignore
|
|
2031
2049
|
(...s) => e(n) && e(n)(...s))
|
|
2032
2050
|
}, " Очистити ", 512), [
|
|
2033
|
-
[Z,
|
|
2051
|
+
[Z, c.value]
|
|
2034
2052
|
])
|
|
2035
|
-
])) :
|
|
2053
|
+
])) : _("", !0)
|
|
2036
2054
|
], 64));
|
|
2037
2055
|
}
|
|
2038
2056
|
}), De = {
|
|
2039
|
-
radio:
|
|
2057
|
+
radio: Vt,
|
|
2040
2058
|
checkbox: je,
|
|
2041
2059
|
check: je,
|
|
2042
2060
|
text: Tt,
|
|
@@ -2047,9 +2065,9 @@ const ql = /* @__PURE__ */ q({
|
|
|
2047
2065
|
button: Xl,
|
|
2048
2066
|
"date:inline": ql
|
|
2049
2067
|
};
|
|
2050
|
-
function
|
|
2068
|
+
function _e(m, o) {
|
|
2051
2069
|
let y;
|
|
2052
|
-
switch (
|
|
2070
|
+
switch (m.toLowerCase()) {
|
|
2053
2071
|
case "autocomplete":
|
|
2054
2072
|
y = "select";
|
|
2055
2073
|
break;
|
|
@@ -2057,7 +2075,7 @@ function Ve(p, o) {
|
|
|
2057
2075
|
y = "checkbox";
|
|
2058
2076
|
break;
|
|
2059
2077
|
default:
|
|
2060
|
-
y =
|
|
2078
|
+
y = m?.toString().toLowerCase();
|
|
2061
2079
|
}
|
|
2062
2080
|
return y === "date" && o && o === "inline" && (y = "date:inline"), {
|
|
2063
2081
|
component: De[y] || De.text,
|
|
@@ -2093,71 +2111,71 @@ const Jl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2093
2111
|
itemClass: {}
|
|
2094
2112
|
},
|
|
2095
2113
|
emits: ["update:modelValue", "change", "clear"],
|
|
2096
|
-
setup(
|
|
2097
|
-
const t =
|
|
2114
|
+
setup(m, { expose: o, emit: y }) {
|
|
2115
|
+
const t = m, a = y, l = A(), g = _e(t.type, t.layout), p = O({
|
|
2098
2116
|
get: () => t.modelValue,
|
|
2099
2117
|
set: (v) => a("update:modelValue", v)
|
|
2100
2118
|
});
|
|
2101
2119
|
function n(v) {
|
|
2102
2120
|
a("clear", v);
|
|
2103
2121
|
}
|
|
2104
|
-
function x(v,
|
|
2105
|
-
a("change", { name: v, value:
|
|
2122
|
+
function x(v, c) {
|
|
2123
|
+
a("change", { name: v, value: c }), t.modelValue !== void 0 && a("update:modelValue", c);
|
|
2106
2124
|
}
|
|
2107
|
-
function
|
|
2125
|
+
function d() {
|
|
2108
2126
|
a("clear", t.name);
|
|
2109
2127
|
}
|
|
2110
|
-
return
|
|
2128
|
+
return E(
|
|
2111
2129
|
() => t.default,
|
|
2112
2130
|
(v) => {
|
|
2113
|
-
|
|
2131
|
+
p.value = v;
|
|
2114
2132
|
}
|
|
2115
|
-
),
|
|
2133
|
+
), E(
|
|
2116
2134
|
() => t.modelValue,
|
|
2117
2135
|
(v) => {
|
|
2118
|
-
|
|
2136
|
+
p.value = v;
|
|
2119
2137
|
}
|
|
2120
2138
|
), o({
|
|
2121
2139
|
filterRef: l
|
|
2122
|
-
}), (v,
|
|
2140
|
+
}), (v, c) => (i(), w("div", Jl, [
|
|
2123
2141
|
u("div", Zl, [
|
|
2124
2142
|
u("div", eo, [
|
|
2125
2143
|
u("div", to, [
|
|
2126
2144
|
u("span", lo, S(v.label), 1)
|
|
2127
2145
|
]),
|
|
2128
|
-
typeof
|
|
2146
|
+
typeof p.value == "string" && p.value.trim() !== "" || Array.isArray(p.value) && p.value.length > 0 && p.value.some((k) => k !== void 0) || p.value === null ? (i(), I(et, {
|
|
2129
2147
|
key: 0,
|
|
2130
|
-
onClick:
|
|
2131
|
-
})) :
|
|
2148
|
+
onClick: d
|
|
2149
|
+
})) : _("", !0)
|
|
2132
2150
|
]),
|
|
2133
2151
|
u("div", oo, [
|
|
2134
|
-
e(g)?.type !== "select" ? (i(),
|
|
2152
|
+
e(g)?.type !== "select" ? (i(), I(re(e(g)?.component), J({ key: 0 }, t, {
|
|
2135
2153
|
type: e(g)?.type,
|
|
2136
2154
|
class: t.itemClass,
|
|
2137
|
-
onChange:
|
|
2138
|
-
onClear:
|
|
2155
|
+
onChange: c[0] || (c[0] = (k) => x(k.name, k.value)),
|
|
2156
|
+
onClear: c[1] || (c[1] = (k) => n(k)),
|
|
2139
2157
|
ref_key: "filterRef",
|
|
2140
2158
|
ref: l
|
|
2141
|
-
}), null, 16, ["type", "class"])) : (i(),
|
|
2159
|
+
}), null, 16, ["type", "class"])) : (i(), I(Ve, {
|
|
2142
2160
|
key: 1,
|
|
2143
|
-
"current-value":
|
|
2161
|
+
"current-value": p.value,
|
|
2144
2162
|
label: v.label,
|
|
2145
2163
|
mode: v.mode,
|
|
2146
|
-
onClear:
|
|
2164
|
+
onClear: d,
|
|
2147
2165
|
fieldRef: l.value,
|
|
2148
2166
|
width: void 0,
|
|
2149
2167
|
disabled: v.disabled,
|
|
2150
2168
|
layout: "vertical"
|
|
2151
2169
|
}, {
|
|
2152
2170
|
default: ne(() => [
|
|
2153
|
-
(i(),
|
|
2171
|
+
(i(), I(re(e(g)?.component), J({
|
|
2154
2172
|
ref_key: "filterRef",
|
|
2155
2173
|
ref: l
|
|
2156
2174
|
}, t, {
|
|
2157
2175
|
type: e(g)?.type,
|
|
2158
2176
|
class: t.itemClass,
|
|
2159
|
-
onChange:
|
|
2160
|
-
onClear:
|
|
2177
|
+
onChange: c[2] || (c[2] = (k) => x(k.name, k.value)),
|
|
2178
|
+
onClear: c[3] || (c[3] = (k) => n(k))
|
|
2161
2179
|
}), null, 16, ["type", "class"]))
|
|
2162
2180
|
]),
|
|
2163
2181
|
_: 1
|
|
@@ -2195,59 +2213,59 @@ const Jl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2195
2213
|
itemClass: {}
|
|
2196
2214
|
},
|
|
2197
2215
|
emits: ["update:modelValue", "change", "clear"],
|
|
2198
|
-
setup(
|
|
2199
|
-
const t =
|
|
2216
|
+
setup(m, { expose: o, emit: y }) {
|
|
2217
|
+
const t = m, a = y, l = A(), g = _e(t.type, t.layout), p = O({
|
|
2200
2218
|
get: () => t.modelValue,
|
|
2201
|
-
set: (
|
|
2219
|
+
set: (d) => a("update:modelValue", d)
|
|
2202
2220
|
});
|
|
2203
|
-
function n(
|
|
2204
|
-
a("clear",
|
|
2221
|
+
function n(d = t.name) {
|
|
2222
|
+
a("clear", d);
|
|
2205
2223
|
}
|
|
2206
|
-
function x(
|
|
2207
|
-
a("change", { name:
|
|
2224
|
+
function x(d, v) {
|
|
2225
|
+
a("change", { name: d, value: v }), t.modelValue !== void 0 && a("update:modelValue", v);
|
|
2208
2226
|
}
|
|
2209
|
-
return
|
|
2227
|
+
return E(
|
|
2210
2228
|
() => t.default,
|
|
2211
|
-
(
|
|
2212
|
-
|
|
2229
|
+
(d) => {
|
|
2230
|
+
p.value = d;
|
|
2213
2231
|
}
|
|
2214
|
-
),
|
|
2232
|
+
), E(
|
|
2215
2233
|
() => t.modelValue,
|
|
2216
|
-
(
|
|
2217
|
-
|
|
2234
|
+
(d) => {
|
|
2235
|
+
p.value = d;
|
|
2218
2236
|
}
|
|
2219
2237
|
), o({
|
|
2220
2238
|
filterRef: l
|
|
2221
|
-
}), (
|
|
2239
|
+
}), (d, v) => ["text", "date", "button"].includes(d.type.toLocaleLowerCase()) ? (i(), I(re(e(g)?.component), J({ key: 0 }, t, {
|
|
2222
2240
|
type: e(g)?.type,
|
|
2223
|
-
class:
|
|
2224
|
-
onChange: v[0] || (v[0] = (
|
|
2225
|
-
onClear: v[1] || (v[1] = (
|
|
2226
|
-
disabled:
|
|
2227
|
-
modelValue:
|
|
2228
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
2229
|
-
}), null, 16, ["type", "class", "disabled", "modelValue"])) : (i(),
|
|
2241
|
+
class: d.itemClass,
|
|
2242
|
+
onChange: v[0] || (v[0] = (c) => x(c.name, c.value)),
|
|
2243
|
+
onClear: v[1] || (v[1] = (c) => n(c)),
|
|
2244
|
+
disabled: d.disabled,
|
|
2245
|
+
modelValue: p.value,
|
|
2246
|
+
"onUpdate:modelValue": v[2] || (v[2] = (c) => p.value = c)
|
|
2247
|
+
}), null, 16, ["type", "class", "disabled", "modelValue"])) : (i(), I(Ve, {
|
|
2230
2248
|
key: 1,
|
|
2231
|
-
"current-value":
|
|
2232
|
-
label:
|
|
2233
|
-
mode:
|
|
2249
|
+
"current-value": p.value,
|
|
2250
|
+
label: d.label,
|
|
2251
|
+
mode: d.mode,
|
|
2234
2252
|
onClear: n,
|
|
2235
2253
|
fieldRef: l.value,
|
|
2236
2254
|
width: t.width,
|
|
2237
|
-
disabled:
|
|
2255
|
+
disabled: d.disabled,
|
|
2238
2256
|
layout: "inline"
|
|
2239
2257
|
}, {
|
|
2240
2258
|
default: ne(() => [
|
|
2241
|
-
(i(),
|
|
2259
|
+
(i(), I(re(e(g)?.component), J({
|
|
2242
2260
|
ref_key: "filterRef",
|
|
2243
2261
|
ref: l
|
|
2244
2262
|
}, t, {
|
|
2245
|
-
modelValue:
|
|
2246
|
-
"onUpdate:modelValue": v[3] || (v[3] = (
|
|
2263
|
+
modelValue: p.value,
|
|
2264
|
+
"onUpdate:modelValue": v[3] || (v[3] = (c) => p.value = c),
|
|
2247
2265
|
type: e(g)?.type,
|
|
2248
2266
|
class: t.itemClass,
|
|
2249
|
-
onChange: v[4] || (v[4] = (
|
|
2250
|
-
onClear: v[5] || (v[5] = (
|
|
2267
|
+
onChange: v[4] || (v[4] = (c) => x(c.name, c.value)),
|
|
2268
|
+
onClear: v[5] || (v[5] = (c) => n(c))
|
|
2251
2269
|
}), null, 16, ["modelValue", "type", "class"]))
|
|
2252
2270
|
]),
|
|
2253
2271
|
_: 1
|
|
@@ -2282,41 +2300,41 @@ const Jl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2282
2300
|
itemClass: {}
|
|
2283
2301
|
},
|
|
2284
2302
|
emits: ["update:modelValue", "change", "clear"],
|
|
2285
|
-
setup(
|
|
2286
|
-
const t =
|
|
2303
|
+
setup(m, { expose: o, emit: y }) {
|
|
2304
|
+
const t = m, a = y, l = A(), g = A(_e(t.type, t.layout)), p = O({
|
|
2287
2305
|
get: () => t.modelValue,
|
|
2288
|
-
set: (
|
|
2306
|
+
set: (d) => a("update:modelValue", d)
|
|
2289
2307
|
});
|
|
2290
|
-
function n(
|
|
2291
|
-
a("clear",
|
|
2308
|
+
function n(d) {
|
|
2309
|
+
a("clear", d);
|
|
2292
2310
|
}
|
|
2293
|
-
function x(
|
|
2294
|
-
a("change", { name:
|
|
2311
|
+
function x(d, v) {
|
|
2312
|
+
a("change", { name: d, value: v }), t.modelValue !== void 0 && a("update:modelValue", v);
|
|
2295
2313
|
}
|
|
2296
|
-
return
|
|
2314
|
+
return E(
|
|
2297
2315
|
() => t.default,
|
|
2298
|
-
(
|
|
2299
|
-
|
|
2316
|
+
(d) => {
|
|
2317
|
+
p.value = d;
|
|
2300
2318
|
}
|
|
2301
|
-
),
|
|
2319
|
+
), E(
|
|
2302
2320
|
() => t.modelValue,
|
|
2303
|
-
(
|
|
2304
|
-
|
|
2321
|
+
(d) => {
|
|
2322
|
+
p.value = d;
|
|
2305
2323
|
}
|
|
2306
|
-
),
|
|
2324
|
+
), E(
|
|
2307
2325
|
() => t,
|
|
2308
|
-
(
|
|
2309
|
-
|
|
2326
|
+
(d) => {
|
|
2327
|
+
p.value = d;
|
|
2310
2328
|
}
|
|
2311
2329
|
), o({
|
|
2312
2330
|
filterRef: l
|
|
2313
|
-
}), (
|
|
2331
|
+
}), (d, v) => (i(), I(re(g.value?.component), J(t, {
|
|
2314
2332
|
type: g.value?.type,
|
|
2315
2333
|
class: t.itemClass,
|
|
2316
|
-
modelValue:
|
|
2317
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
2318
|
-
onChange: v[1] || (v[1] = (
|
|
2319
|
-
onClear: v[2] || (v[2] = (
|
|
2334
|
+
modelValue: p.value,
|
|
2335
|
+
"onUpdate:modelValue": v[0] || (v[0] = (c) => p.value = c),
|
|
2336
|
+
onChange: v[1] || (v[1] = (c) => x(c.name, c.value)),
|
|
2337
|
+
onClear: v[2] || (v[2] = (c) => n(c)),
|
|
2320
2338
|
ref_key: "filterRef",
|
|
2321
2339
|
ref: l
|
|
2322
2340
|
}), null, 16, ["type", "class", "modelValue"]));
|
|
@@ -2350,26 +2368,26 @@ const Jl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2350
2368
|
itemClass: {}
|
|
2351
2369
|
},
|
|
2352
2370
|
emits: ["update:modelValue", "change", "clear"],
|
|
2353
|
-
setup(
|
|
2354
|
-
const t =
|
|
2371
|
+
setup(m, { expose: o, emit: y }) {
|
|
2372
|
+
const t = m, a = y, l = A(), g = O({
|
|
2355
2373
|
get: () => t.modelValue,
|
|
2356
|
-
set: (
|
|
2374
|
+
set: (d) => a("update:modelValue", d)
|
|
2357
2375
|
});
|
|
2358
|
-
function
|
|
2359
|
-
a("clear",
|
|
2376
|
+
function p(d) {
|
|
2377
|
+
a("clear", d);
|
|
2360
2378
|
}
|
|
2361
|
-
function n(
|
|
2362
|
-
a("change", { name:
|
|
2379
|
+
function n(d, v) {
|
|
2380
|
+
a("change", { name: d, value: v }), t.modelValue !== void 0 && a("update:modelValue", v);
|
|
2363
2381
|
}
|
|
2364
|
-
|
|
2382
|
+
E(
|
|
2365
2383
|
() => t.default,
|
|
2366
|
-
(
|
|
2367
|
-
g.value =
|
|
2384
|
+
(d) => {
|
|
2385
|
+
g.value = d;
|
|
2368
2386
|
}
|
|
2369
|
-
),
|
|
2387
|
+
), E(
|
|
2370
2388
|
() => t.modelValue,
|
|
2371
|
-
(
|
|
2372
|
-
g.value =
|
|
2389
|
+
(d) => {
|
|
2390
|
+
g.value = d;
|
|
2373
2391
|
}
|
|
2374
2392
|
), o({
|
|
2375
2393
|
filterRef: l
|
|
@@ -2386,20 +2404,20 @@ const Jl = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2386
2404
|
return Re;
|
|
2387
2405
|
}
|
|
2388
2406
|
}
|
|
2389
|
-
return (
|
|
2390
|
-
onChange: v[0] || (v[0] = (
|
|
2391
|
-
onClear: v[1] || (v[1] = (
|
|
2407
|
+
return (d, v) => (i(), I(re(x()), J(t, {
|
|
2408
|
+
onChange: v[0] || (v[0] = (c) => n(c.name, c.value)),
|
|
2409
|
+
onClear: v[1] || (v[1] = (c) => p(c)),
|
|
2392
2410
|
modelValue: g.value,
|
|
2393
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
2411
|
+
"onUpdate:modelValue": v[2] || (v[2] = (c) => g.value = c)
|
|
2394
2412
|
}), null, 16, ["modelValue"]));
|
|
2395
2413
|
}
|
|
2396
2414
|
});
|
|
2397
|
-
function ye(
|
|
2415
|
+
function ye(m, o) {
|
|
2398
2416
|
const {
|
|
2399
2417
|
slots: y
|
|
2400
|
-
} =
|
|
2401
|
-
|
|
2402
|
-
() =>
|
|
2418
|
+
} = m, t = (r) => r ? JSON.parse(JSON.stringify(ue(r))) : {}, a = A(t(m.value));
|
|
2419
|
+
E(
|
|
2420
|
+
() => m.value,
|
|
2403
2421
|
(r) => {
|
|
2404
2422
|
a.value = t(r);
|
|
2405
2423
|
},
|
|
@@ -2412,7 +2430,7 @@ function ye(p, o) {
|
|
|
2412
2430
|
name: r
|
|
2413
2431
|
});
|
|
2414
2432
|
}
|
|
2415
|
-
function
|
|
2433
|
+
function p(r, s) {
|
|
2416
2434
|
s === void 0 ? g(r) : a.value = {
|
|
2417
2435
|
...a.value,
|
|
2418
2436
|
[r]: s
|
|
@@ -2426,15 +2444,15 @@ function ye(p, o) {
|
|
|
2426
2444
|
const s = r.props?.name;
|
|
2427
2445
|
return We(r, {
|
|
2428
2446
|
...r.props,
|
|
2429
|
-
layout:
|
|
2447
|
+
layout: m.view,
|
|
2430
2448
|
showClean: !0,
|
|
2431
2449
|
modelValue: a.value[s],
|
|
2432
2450
|
"onUpdate:modelValue": (b) => {
|
|
2433
|
-
|
|
2451
|
+
p(s, b);
|
|
2434
2452
|
},
|
|
2435
2453
|
onClear: () => g(s),
|
|
2436
|
-
class: [
|
|
2437
|
-
itemClass: [
|
|
2454
|
+
class: [m.itemClass, r.props?.class],
|
|
2455
|
+
itemClass: [m.itemClass, r.props?.itemClass].filter((b) => typeof b == "string" && b.trim().length > 0).join(" ") || void 0
|
|
2438
2456
|
});
|
|
2439
2457
|
})), x = O(
|
|
2440
2458
|
() => new Map(
|
|
@@ -2444,35 +2462,35 @@ function ye(p, o) {
|
|
|
2444
2462
|
}).filter((r) => r !== null)
|
|
2445
2463
|
)
|
|
2446
2464
|
);
|
|
2447
|
-
function
|
|
2465
|
+
function d(r = !1) {
|
|
2448
2466
|
a.value = {}, r || o("clearAll", {
|
|
2449
2467
|
data: ue(a.value),
|
|
2450
2468
|
name: "ALL"
|
|
2451
2469
|
});
|
|
2452
2470
|
}
|
|
2453
|
-
const v = A(""),
|
|
2454
|
-
|
|
2471
|
+
const v = A(""), c = O(() => m.schema?.value ? Object.entries(a.value).filter(([r, s]) => m.schema && !(r in m.schema.value) ? !1 : Array.isArray(s) ? s.some((b) => b !== "" && b !== void 0) : s !== "" && s !== void 0).length : 0), k = A();
|
|
2472
|
+
E(v, async () => {
|
|
2455
2473
|
await fe(), k?.value?.filterRef?.inputTextRef && k.value.filterRef.inputTextRef.focus();
|
|
2456
2474
|
});
|
|
2457
|
-
const
|
|
2475
|
+
const V = O(() => m.schema?.value ? Object.fromEntries(Object.entries(m.schema?.value).slice(0, m.limit)) : {}), C = O(() => {
|
|
2458
2476
|
if (n.value.length === 0) return [];
|
|
2459
2477
|
let r = 0;
|
|
2460
|
-
if (
|
|
2461
|
-
const s = Object.entries(
|
|
2462
|
-
|
|
2478
|
+
if (m.schema?.value) {
|
|
2479
|
+
const s = Object.entries(m.schema.value).length;
|
|
2480
|
+
m.limit && s < m.limit ? r = m.limit - s : r = 0;
|
|
2463
2481
|
}
|
|
2464
2482
|
return n.value.slice(0, r);
|
|
2465
|
-
}),
|
|
2483
|
+
}), f = O(() => n.value.length === 0 ? [] : m.view !== "inline" ? n.value : n.value.slice(C.value.length));
|
|
2466
2484
|
return {
|
|
2467
2485
|
activeFilter: a,
|
|
2468
|
-
activeFilterCount:
|
|
2469
|
-
onFilterChange:
|
|
2486
|
+
activeFilterCount: c,
|
|
2487
|
+
onFilterChange: p,
|
|
2470
2488
|
clearFilter: g,
|
|
2471
|
-
clearAllFilters:
|
|
2472
|
-
limitedSchema:
|
|
2489
|
+
clearAllFilters: d,
|
|
2490
|
+
limitedSchema: V,
|
|
2473
2491
|
filtersSlot: n,
|
|
2474
2492
|
limitedFiltersSlot: C,
|
|
2475
|
-
popoverFiltersSlot:
|
|
2493
|
+
popoverFiltersSlot: f,
|
|
2476
2494
|
vnodeMap: x,
|
|
2477
2495
|
selectedFilter: v,
|
|
2478
2496
|
filterRef: k
|
|
@@ -2481,44 +2499,44 @@ function ye(p, o) {
|
|
|
2481
2499
|
const ro = /* @__PURE__ */ q({
|
|
2482
2500
|
__name: "popover",
|
|
2483
2501
|
emits: ["open", "close"],
|
|
2484
|
-
setup(
|
|
2502
|
+
setup(m, { emit: o }) {
|
|
2485
2503
|
const y = A(!1), t = A(null), a = A(null), l = A(null), g = A({ top: "0px", left: "0px", position: "absolute" });
|
|
2486
|
-
function
|
|
2504
|
+
function p() {
|
|
2487
2505
|
y.value = !y.value;
|
|
2488
2506
|
}
|
|
2489
2507
|
function n() {
|
|
2490
|
-
const k = l.value,
|
|
2491
|
-
if (!k || !
|
|
2492
|
-
const C = k.getBoundingClientRect(),
|
|
2508
|
+
const k = l.value, V = t.value;
|
|
2509
|
+
if (!k || !V) return;
|
|
2510
|
+
const C = k.getBoundingClientRect(), f = V.offsetWidth, r = window.innerWidth - C.left;
|
|
2493
2511
|
let s = C.left + window.scrollX;
|
|
2494
|
-
|
|
2512
|
+
f > r && (s = window.innerWidth - f - 8, s < 8 && (s = 8)), g.value = {
|
|
2495
2513
|
position: "absolute",
|
|
2496
2514
|
top: `${C.bottom + window.scrollY + 8}px`,
|
|
2497
2515
|
left: `${s}px`
|
|
2498
2516
|
};
|
|
2499
2517
|
}
|
|
2500
2518
|
const x = O(() => Object.entries(g.value).map((k) => k.join(":")).join(";"));
|
|
2501
|
-
function
|
|
2502
|
-
const
|
|
2503
|
-
!l.value?.contains(k.target) && !t.value?.contains(k.target) && !
|
|
2519
|
+
function d(k) {
|
|
2520
|
+
const V = k.target;
|
|
2521
|
+
!l.value?.contains(k.target) && !t.value?.contains(k.target) && !V.closest("[data-inside-popover]") && (y.value = !1);
|
|
2504
2522
|
}
|
|
2505
2523
|
const v = A(!1);
|
|
2506
2524
|
ce(() => {
|
|
2507
2525
|
v.value = !0;
|
|
2508
2526
|
}), ce(() => {
|
|
2509
|
-
l.value = a.value?.querySelector("[data-popover-trigger]") || null, l.value?.addEventListener("click",
|
|
2527
|
+
l.value = a.value?.querySelector("[data-popover-trigger]") || null, l.value?.addEventListener("click", p), document.addEventListener("click", d), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0);
|
|
2510
2528
|
}), me(() => {
|
|
2511
|
-
l.value?.removeEventListener("click",
|
|
2529
|
+
l.value?.removeEventListener("click", p), document.removeEventListener("click", d), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
2512
2530
|
});
|
|
2513
|
-
const
|
|
2514
|
-
return
|
|
2515
|
-
k ? (
|
|
2516
|
-
}), (k,
|
|
2531
|
+
const c = o;
|
|
2532
|
+
return E(y, async (k) => {
|
|
2533
|
+
k ? (c("open"), await fe(), n()) : c("close");
|
|
2534
|
+
}), (k, V) => (i(), w("div", {
|
|
2517
2535
|
ref_key: "wrapperRef",
|
|
2518
2536
|
ref: a
|
|
2519
2537
|
}, [
|
|
2520
2538
|
de(k.$slots, "trigger"),
|
|
2521
|
-
v.value ? (i(),
|
|
2539
|
+
v.value ? (i(), I(ge, {
|
|
2522
2540
|
key: 0,
|
|
2523
2541
|
to: "body"
|
|
2524
2542
|
}, [
|
|
@@ -2532,7 +2550,7 @@ const ro = /* @__PURE__ */ q({
|
|
|
2532
2550
|
], 4), [
|
|
2533
2551
|
[Z, y.value]
|
|
2534
2552
|
])
|
|
2535
|
-
])) :
|
|
2553
|
+
])) : _("", !0)
|
|
2536
2554
|
], 512));
|
|
2537
2555
|
}
|
|
2538
2556
|
}), so = {}, io = {
|
|
@@ -2547,7 +2565,7 @@ const ro = /* @__PURE__ */ q({
|
|
|
2547
2565
|
"stroke-linejoin": "round",
|
|
2548
2566
|
class: "lucide lucide-filter h-4 w-4"
|
|
2549
2567
|
};
|
|
2550
|
-
function uo(
|
|
2568
|
+
function uo(m, o) {
|
|
2551
2569
|
return i(), w("svg", io, o[0] || (o[0] = [
|
|
2552
2570
|
u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
|
|
2553
2571
|
]));
|
|
@@ -2558,7 +2576,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2558
2576
|
}, po = { class: "flex max-h-[400px]" }, mo = { class: "w-64 border-r border-gray-200 overflow-y-auto" }, vo = { class: "p-4 border-b" }, yo = { class: "text-sm text-gray-600" }, go = { class: "p-2" }, bo = ["onClick"], ho = { class: "flex items-center gap-2" }, xo = { class: "text-sm font-medium" }, wo = {
|
|
2559
2577
|
key: 0,
|
|
2560
2578
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-1 text-[11px] font-semibold text-blue-600"
|
|
2561
|
-
}, ko = ["onClick"], Co = { class: "flex items-center gap-2" },
|
|
2579
|
+
}, ko = ["onClick"], Co = { class: "flex items-center gap-2" }, Vo = { class: "text-sm font-medium" }, _o = {
|
|
2562
2580
|
key: 0,
|
|
2563
2581
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-1 text-[11px] font-semibold text-blue-600"
|
|
2564
2582
|
}, $o = {
|
|
@@ -2584,34 +2602,34 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2584
2602
|
itemClass: {}
|
|
2585
2603
|
},
|
|
2586
2604
|
emits: ["change", "clear", "clearAll"],
|
|
2587
|
-
setup(
|
|
2588
|
-
const t = oe(), a =
|
|
2589
|
-
activeFilter:
|
|
2605
|
+
setup(m, { expose: o, emit: y }) {
|
|
2606
|
+
const t = oe(), a = m, l = Te(a.mode), g = pe(), p = y, n = A({}), x = O(() => n?.value ? a.view !== "inline" ? n?.value : Object.fromEntries(Object.entries(n?.value).slice(a.limit)) : {}), {
|
|
2607
|
+
activeFilter: d,
|
|
2590
2608
|
activeFilterCount: v,
|
|
2591
|
-
onFilterChange:
|
|
2609
|
+
onFilterChange: c,
|
|
2592
2610
|
clearFilter: k,
|
|
2593
|
-
clearAllFilters:
|
|
2611
|
+
clearAllFilters: V,
|
|
2594
2612
|
popoverFiltersSlot: C,
|
|
2595
|
-
selectedFilter:
|
|
2613
|
+
selectedFilter: f,
|
|
2596
2614
|
filterRef: r
|
|
2597
2615
|
} = ye({
|
|
2598
2616
|
...a,
|
|
2599
2617
|
schema: n,
|
|
2600
2618
|
slots: g
|
|
2601
|
-
},
|
|
2619
|
+
}, p), s = O(() => a.badgeCount ?? v.value);
|
|
2602
2620
|
function b(M) {
|
|
2603
2621
|
return Array.isArray(M) ? M.filter(($) => $ != null && $ !== "").length : M && typeof M == "object" ? Object.values(M).filter(($) => $ != null && $ !== "").length : M === null || M !== void 0 && M !== "" ? 1 : 0;
|
|
2604
2622
|
}
|
|
2605
2623
|
function h(M) {
|
|
2606
|
-
return
|
|
2624
|
+
return d.value ? b(d.value[M]) : 0;
|
|
2607
2625
|
}
|
|
2608
2626
|
function K() {
|
|
2609
2627
|
if (x.value) {
|
|
2610
2628
|
const [M] = Object.keys(x.value);
|
|
2611
|
-
|
|
2612
|
-
} else C.value.length > 0 ?
|
|
2629
|
+
f.value = M;
|
|
2630
|
+
} else C.value.length > 0 ? f.value = C.value[0].props.name : f.value = "";
|
|
2613
2631
|
}
|
|
2614
|
-
return
|
|
2632
|
+
return E(
|
|
2615
2633
|
() => a.schema,
|
|
2616
2634
|
(M) => {
|
|
2617
2635
|
n.value = M ?? {};
|
|
@@ -2619,10 +2637,10 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2619
2637
|
{ deep: !0, immediate: !0 }
|
|
2620
2638
|
), o({
|
|
2621
2639
|
clearFilter: k,
|
|
2622
|
-
clearAllFilters:
|
|
2623
|
-
}), (M, $) => (i(),
|
|
2640
|
+
clearAllFilters: V
|
|
2641
|
+
}), (M, $) => (i(), I(ro, {
|
|
2624
2642
|
onOpen: K,
|
|
2625
|
-
onClose: $[5] || ($[5] = (B) =>
|
|
2643
|
+
onClose: $[5] || ($[5] = (B) => f.value = "")
|
|
2626
2644
|
}, {
|
|
2627
2645
|
trigger: ne(() => [
|
|
2628
2646
|
u("button", {
|
|
@@ -2641,7 +2659,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2641
2659
|
Q(Ue, { class: "h-4 w-4" }),
|
|
2642
2660
|
$[6] || ($[6] = u("span", { class: "text-sm font-medium" }, "Фільтр", -1))
|
|
2643
2661
|
]),
|
|
2644
|
-
s.value > 0 ? (i(), w("span", fo, S(s.value), 1)) :
|
|
2662
|
+
s.value > 0 ? (i(), w("span", fo, S(s.value), 1)) : _("", !0)
|
|
2645
2663
|
], 2)
|
|
2646
2664
|
]),
|
|
2647
2665
|
default: ne(() => [
|
|
@@ -2654,47 +2672,47 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2654
2672
|
M.schema ? (i(!0), w(U, { key: 0 }, X(Object.entries(x.value), ([B, F]) => (i(), w("button", {
|
|
2655
2673
|
key: B,
|
|
2656
2674
|
onClick: () => {
|
|
2657
|
-
|
|
2675
|
+
f.value = B;
|
|
2658
2676
|
},
|
|
2659
2677
|
class: L([
|
|
2660
2678
|
"flex w-full items-center justify-between px-3 py-2 text-left transition-colors hover:bg-gray-50",
|
|
2661
|
-
e(
|
|
2679
|
+
e(f) === B ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
2662
2680
|
])
|
|
2663
2681
|
}, [
|
|
2664
2682
|
u("div", ho, [
|
|
2665
2683
|
u("span", xo, S(F.label), 1)
|
|
2666
2684
|
]),
|
|
2667
|
-
h(B) > 0 ? (i(), w("div", wo, S(h(B)), 1)) :
|
|
2668
|
-
], 10, bo))), 128)) :
|
|
2685
|
+
h(B) > 0 ? (i(), w("div", wo, S(h(B)), 1)) : _("", !0)
|
|
2686
|
+
], 10, bo))), 128)) : _("", !0),
|
|
2669
2687
|
(i(!0), w(U, null, X(e(C), (B, F) => (i(), w("button", {
|
|
2670
2688
|
key: "slot-" + F,
|
|
2671
|
-
onClick: (D) =>
|
|
2689
|
+
onClick: (D) => f.value = B.props.name,
|
|
2672
2690
|
class: L([
|
|
2673
2691
|
"flex items-center justify-between px-3 py-2 text-left transition-colors hover:bg-gray-50",
|
|
2674
|
-
e(
|
|
2692
|
+
e(f) === B.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
2675
2693
|
])
|
|
2676
2694
|
}, [
|
|
2677
2695
|
u("div", Co, [
|
|
2678
|
-
u("span",
|
|
2696
|
+
u("span", Vo, S(B.props.label), 1)
|
|
2679
2697
|
]),
|
|
2680
|
-
h(B.props.name) > 0 ? (i(), w("div",
|
|
2698
|
+
h(B.props.name) > 0 ? (i(), w("div", _o, S(h(B.props.name)), 1)) : _("", !0)
|
|
2681
2699
|
], 10, ko))), 128))
|
|
2682
2700
|
]),
|
|
2683
2701
|
e(v) > 0 ? (i(), w("div", $o, [
|
|
2684
2702
|
u("button", {
|
|
2685
2703
|
class: L([M.itemClass, "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors"]),
|
|
2686
|
-
onClick: $[0] || ($[0] = (B) => e(
|
|
2704
|
+
onClick: $[0] || ($[0] = (B) => e(V)()),
|
|
2687
2705
|
"data-inside-popover": ""
|
|
2688
2706
|
}, " Очистити всі ", 2)
|
|
2689
|
-
])) :
|
|
2707
|
+
])) : _("", !0)
|
|
2690
2708
|
]),
|
|
2691
2709
|
u("div", Ao, [
|
|
2692
|
-
e(
|
|
2710
|
+
e(f) === "" ? (i(), w("div", So, [
|
|
2693
2711
|
u("p", Bo, S(e(t)("filter.selectFieldHelp")), 1)
|
|
2694
|
-
])) :
|
|
2695
|
-
e(
|
|
2712
|
+
])) : _("", !0),
|
|
2713
|
+
e(f) ? (i(), w(U, { key: 1 }, [
|
|
2696
2714
|
x.value ? (i(!0), w(U, { key: 0 }, X(Object.entries(x.value), ([B, F]) => (i(), w(U, null, [
|
|
2697
|
-
e(
|
|
2715
|
+
e(f) === B ? (i(), I(le, J({
|
|
2698
2716
|
key: B,
|
|
2699
2717
|
layout: "popover",
|
|
2700
2718
|
ref_for: !0,
|
|
@@ -2703,19 +2721,19 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2703
2721
|
}, { ref_for: !0 }, F, {
|
|
2704
2722
|
class: [M.itemClass, F?.class],
|
|
2705
2723
|
"item-class": [M.itemClass, F?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2706
|
-
onChange: $[1] || ($[1] = (D) => e(
|
|
2724
|
+
onChange: $[1] || ($[1] = (D) => e(c)(D.name, D.value)),
|
|
2707
2725
|
onClear: $[2] || ($[2] = (D) => {
|
|
2708
|
-
e(k)(D), e(
|
|
2726
|
+
e(k)(D), e(c)(D, void 0);
|
|
2709
2727
|
}),
|
|
2710
|
-
modelValue: e(
|
|
2711
|
-
"onUpdate:modelValue": (D) => e(
|
|
2728
|
+
modelValue: e(d)[B],
|
|
2729
|
+
"onUpdate:modelValue": (D) => e(d)[B] = D,
|
|
2712
2730
|
cleanable: !0
|
|
2713
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) :
|
|
2714
|
-
], 64))), 256)) :
|
|
2731
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) : _("", !0)
|
|
2732
|
+
], 64))), 256)) : _("", !0),
|
|
2715
2733
|
(i(!0), w(U, null, X(e(C), (B, F) => (i(), w(U, {
|
|
2716
2734
|
key: "slot-" + F
|
|
2717
2735
|
}, [
|
|
2718
|
-
e(
|
|
2736
|
+
e(f) === B.props.name ? (i(), I(le, J({
|
|
2719
2737
|
key: 0,
|
|
2720
2738
|
layout: "popover"
|
|
2721
2739
|
}, { ref_for: !0 }, B.props, {
|
|
@@ -2724,16 +2742,16 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2724
2742
|
ref: r,
|
|
2725
2743
|
class: [M.itemClass, B.props?.class],
|
|
2726
2744
|
"item-class": [M.itemClass, B.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2727
|
-
onChange: $[3] || ($[3] = (D) => e(
|
|
2745
|
+
onChange: $[3] || ($[3] = (D) => e(c)(D.name, D.value)),
|
|
2728
2746
|
onClear: $[4] || ($[4] = (D) => {
|
|
2729
|
-
e(k)(D), e(
|
|
2747
|
+
e(k)(D), e(c)(D, void 0);
|
|
2730
2748
|
}),
|
|
2731
|
-
modelValue: e(
|
|
2732
|
-
"onUpdate:modelValue": (D) => e(
|
|
2749
|
+
modelValue: e(d)[B.props.name],
|
|
2750
|
+
"onUpdate:modelValue": (D) => e(d)[B.props.name] = D,
|
|
2733
2751
|
cleanable: !0
|
|
2734
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) :
|
|
2752
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) : _("", !0)
|
|
2735
2753
|
], 64))), 128))
|
|
2736
|
-
], 64)) :
|
|
2754
|
+
], 64)) : _("", !0)
|
|
2737
2755
|
])
|
|
2738
2756
|
])
|
|
2739
2757
|
]),
|
|
@@ -2756,20 +2774,20 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2756
2774
|
itemClass: {}
|
|
2757
2775
|
},
|
|
2758
2776
|
emits: ["change", "clear", "clearAll"],
|
|
2759
|
-
setup(
|
|
2760
|
-
const t = oe(), a =
|
|
2777
|
+
setup(m, { expose: o, emit: y }) {
|
|
2778
|
+
const t = oe(), a = m, l = y, g = pe(), p = A({}), n = O(() => Object.keys(a.schema).length > a.limit), {
|
|
2761
2779
|
activeFilter: x,
|
|
2762
|
-
activeFilterCount:
|
|
2780
|
+
activeFilterCount: d,
|
|
2763
2781
|
onFilterChange: v,
|
|
2764
|
-
clearFilter:
|
|
2782
|
+
clearFilter: c,
|
|
2765
2783
|
clearAllFilters: k,
|
|
2766
|
-
limitedSchema:
|
|
2784
|
+
limitedSchema: V,
|
|
2767
2785
|
filtersSlot: C,
|
|
2768
|
-
limitedFiltersSlot:
|
|
2786
|
+
limitedFiltersSlot: f
|
|
2769
2787
|
} = ye(
|
|
2770
2788
|
{
|
|
2771
2789
|
...a,
|
|
2772
|
-
schema:
|
|
2790
|
+
schema: p,
|
|
2773
2791
|
slots: g
|
|
2774
2792
|
},
|
|
2775
2793
|
l
|
|
@@ -2778,26 +2796,26 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2778
2796
|
return Array.isArray($) ? $.some((B) => B !== "" && B !== void 0 && B !== null) : $ === null ? !0 : $ && typeof $ == "object" ? Object.values($).some((B) => B !== "" && B !== void 0 && B !== null) : $ !== "" && $ !== void 0;
|
|
2779
2797
|
}
|
|
2780
2798
|
const s = O(() => {
|
|
2781
|
-
const $ = Object.keys(
|
|
2799
|
+
const $ = Object.keys(V.value ?? {}), B = f.value.map((F) => F.props?.name).filter((F) => typeof F == "string");
|
|
2782
2800
|
return /* @__PURE__ */ new Set([...$, ...B]);
|
|
2783
2801
|
}), b = O(() => Object.entries(x.value ?? {}).filter(([$, B]) => s.value.has($) && r(B)).length), h = O(() => {
|
|
2784
|
-
const $ =
|
|
2802
|
+
const $ = d.value ?? 0, B = b.value ?? 0;
|
|
2785
2803
|
return Math.max($ - B, 0);
|
|
2786
2804
|
}), K = A();
|
|
2787
2805
|
function M() {
|
|
2788
2806
|
K.value && K.value.clearAllFilters(!0), k();
|
|
2789
2807
|
}
|
|
2790
|
-
return
|
|
2808
|
+
return E(
|
|
2791
2809
|
() => a.schema,
|
|
2792
2810
|
($) => {
|
|
2793
|
-
|
|
2811
|
+
p.value = $;
|
|
2794
2812
|
},
|
|
2795
2813
|
{ deep: !0, immediate: !0 }
|
|
2796
2814
|
), o({
|
|
2797
|
-
clearFilter:
|
|
2815
|
+
clearFilter: c,
|
|
2798
2816
|
clearAllFilters: k
|
|
2799
2817
|
}), ($, B) => (i(), w("div", jo, [
|
|
2800
|
-
$.schema ? (i(!0), w(U, { key: 0 }, X(Object.entries(e(
|
|
2818
|
+
$.schema ? (i(!0), w(U, { key: 0 }, X(Object.entries(e(V)), ([F, D]) => (i(), I(le, J({
|
|
2801
2819
|
key: F,
|
|
2802
2820
|
mode: $.mode,
|
|
2803
2821
|
width: $.width ? $.width : D?.width
|
|
@@ -2805,13 +2823,13 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2805
2823
|
class: [$.itemClass, D?.class],
|
|
2806
2824
|
"item-class": [$.itemClass, D?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2807
2825
|
onChange: B[0] || (B[0] = (R) => e(v)(R.name, R.value)),
|
|
2808
|
-
onClear: e(
|
|
2826
|
+
onClear: e(c),
|
|
2809
2827
|
layout: "inline",
|
|
2810
2828
|
cleanable: !0,
|
|
2811
2829
|
modelValue: e(x)[F],
|
|
2812
2830
|
"onUpdate:modelValue": (R) => e(x)[F] = R
|
|
2813
|
-
}), null, 16, ["mode", "width", "class", "item-class", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) :
|
|
2814
|
-
(i(!0), w(U, null, X(e(
|
|
2831
|
+
}), null, 16, ["mode", "width", "class", "item-class", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : _("", !0),
|
|
2832
|
+
(i(!0), w(U, null, X(e(f), (F, D) => (i(), I(le, J({
|
|
2815
2833
|
key: "slot-" + D,
|
|
2816
2834
|
layout: "inline"
|
|
2817
2835
|
}, { ref_for: !0 }, F.props, {
|
|
@@ -2819,18 +2837,18 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2819
2837
|
"item-class": [$.itemClass, F.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2820
2838
|
onChange: B[1] || (B[1] = (R) => e(v)(R.name, R.value)),
|
|
2821
2839
|
onClear: B[2] || (B[2] = (R) => {
|
|
2822
|
-
e(
|
|
2840
|
+
e(c)(R), e(v)(R, void 0);
|
|
2823
2841
|
}),
|
|
2824
2842
|
cleanable: !0,
|
|
2825
2843
|
modelValue: e(x)[F.props.name],
|
|
2826
2844
|
"onUpdate:modelValue": (R) => e(x)[F.props.name] = R
|
|
2827
2845
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)),
|
|
2828
|
-
n.value ? (i(),
|
|
2846
|
+
n.value ? (i(), I(ze, J({ key: 1 }, a, {
|
|
2829
2847
|
schema: $.schema,
|
|
2830
2848
|
limit: $.limit,
|
|
2831
2849
|
onChange: B[3] || (B[3] = (F) => e(v)(F.name, F.value)),
|
|
2832
2850
|
onClearAll: B[4] || (B[4] = (F) => e(k)()),
|
|
2833
|
-
onClear: B[5] || (B[5] = (F) => e(
|
|
2851
|
+
onClear: B[5] || (B[5] = (F) => e(c)(F.name)),
|
|
2834
2852
|
mode: $.mode,
|
|
2835
2853
|
ref_key: "popoverRef",
|
|
2836
2854
|
ref: K,
|
|
@@ -2838,18 +2856,18 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2838
2856
|
"badge-count": h.value
|
|
2839
2857
|
}), {
|
|
2840
2858
|
default: ne(() => [
|
|
2841
|
-
(i(!0), w(U, null, X(e(C), (F, D) => (i(),
|
|
2859
|
+
(i(!0), w(U, null, X(e(C), (F, D) => (i(), I(re(F), J({
|
|
2842
2860
|
key: "slot-" + D,
|
|
2843
2861
|
layout: "popover"
|
|
2844
2862
|
}, { ref_for: !0 }, F.props, { cleanable: !0 }), null, 16))), 128))
|
|
2845
2863
|
]),
|
|
2846
2864
|
_: 1
|
|
2847
|
-
}, 16, ["schema", "limit", "mode", "badge-count"])) :
|
|
2848
|
-
e(
|
|
2865
|
+
}, 16, ["schema", "limit", "mode", "badge-count"])) : _("", !0),
|
|
2866
|
+
e(d) > 0 ? (i(), w("button", {
|
|
2849
2867
|
key: 2,
|
|
2850
2868
|
onClick: M,
|
|
2851
2869
|
class: L([$.itemClass, "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-md bg-gray-50 border text-gray-800 hover:bg-gray-200 focus:bg-gray-200"])
|
|
2852
|
-
}, S(e(t)("filter.clear")), 3)) :
|
|
2870
|
+
}, S(e(t)("filter.clear")), 3)) : _("", !0)
|
|
2853
2871
|
]));
|
|
2854
2872
|
}
|
|
2855
2873
|
}), Do = {
|
|
@@ -2871,13 +2889,13 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2871
2889
|
itemClass: {}
|
|
2872
2890
|
},
|
|
2873
2891
|
emits: ["change", "clear", "clearAll"],
|
|
2874
|
-
setup(
|
|
2875
|
-
const t =
|
|
2892
|
+
setup(m, { expose: o, emit: y }) {
|
|
2893
|
+
const t = m, a = y, l = pe(), {
|
|
2876
2894
|
activeFilter: g,
|
|
2877
|
-
activeFilterCount:
|
|
2895
|
+
activeFilterCount: p,
|
|
2878
2896
|
onFilterChange: n,
|
|
2879
2897
|
clearFilter: x,
|
|
2880
|
-
clearAllFilters:
|
|
2898
|
+
clearAllFilters: d,
|
|
2881
2899
|
filtersSlot: v
|
|
2882
2900
|
} = ye({
|
|
2883
2901
|
...t,
|
|
@@ -2885,45 +2903,45 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2885
2903
|
}, a);
|
|
2886
2904
|
return o({
|
|
2887
2905
|
clearFilter: x,
|
|
2888
|
-
clearAllFilters:
|
|
2889
|
-
}), (
|
|
2906
|
+
clearAllFilters: d
|
|
2907
|
+
}), (c, k) => c.view === "vertical" ? (i(), w("div", Do, [
|
|
2890
2908
|
u("div", Ro, [
|
|
2891
|
-
e(
|
|
2909
|
+
e(p) > 0 ? (i(), w("button", {
|
|
2892
2910
|
key: 0,
|
|
2893
|
-
onClick: k[0] || (k[0] = (
|
|
2911
|
+
onClick: k[0] || (k[0] = (V) => e(d)()),
|
|
2894
2912
|
"data-popover-trigger": "",
|
|
2895
2913
|
"aria-haspopup": "dialog",
|
|
2896
2914
|
"aria-expanded": "false",
|
|
2897
|
-
class: L([
|
|
2915
|
+
class: L([c.itemClass, "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"]),
|
|
2898
2916
|
type: "button"
|
|
2899
|
-
}, " Очистити ", 2)) :
|
|
2900
|
-
|
|
2901
|
-
class: [
|
|
2902
|
-
"item-class": [
|
|
2903
|
-
onChange: k[1] || (k[1] = (
|
|
2904
|
-
onClear: k[2] || (k[2] = (
|
|
2905
|
-
e(x)(
|
|
2917
|
+
}, " Очистити ", 2)) : _("", !0),
|
|
2918
|
+
c.schema ? (i(!0), w(U, { key: 1 }, X(Object.entries(c.schema), ([V, C]) => (i(), I(le, J({ layout: "vertical" }, { ref_for: !0 }, C, {
|
|
2919
|
+
class: [c.itemClass, C?.class],
|
|
2920
|
+
"item-class": [c.itemClass, C?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2921
|
+
onChange: k[1] || (k[1] = (f) => e(n)(f.name, f.value)),
|
|
2922
|
+
onClear: k[2] || (k[2] = (f) => {
|
|
2923
|
+
e(x)(f), e(n)(f, void 0);
|
|
2906
2924
|
}),
|
|
2907
|
-
modelValue: e(g)[
|
|
2908
|
-
"onUpdate:modelValue": (
|
|
2925
|
+
modelValue: e(g)[V],
|
|
2926
|
+
"onUpdate:modelValue": (f) => e(g)[V] = f,
|
|
2909
2927
|
showClean: !0
|
|
2910
|
-
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 256)) :
|
|
2911
|
-
(i(!0), w(U, null, X(e(v), (
|
|
2928
|
+
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 256)) : _("", !0),
|
|
2929
|
+
(i(!0), w(U, null, X(e(v), (V, C) => (i(), I(le, J({
|
|
2912
2930
|
key: "slot-" + C,
|
|
2913
2931
|
layout: "vertical"
|
|
2914
|
-
}, { ref_for: !0 },
|
|
2915
|
-
class: [
|
|
2916
|
-
"item-class": [
|
|
2917
|
-
onChange: k[3] || (k[3] = (
|
|
2918
|
-
onClear: k[4] || (k[4] = (
|
|
2919
|
-
e(x)(
|
|
2932
|
+
}, { ref_for: !0 }, V.props, {
|
|
2933
|
+
class: [c.itemClass, V.props?.class],
|
|
2934
|
+
"item-class": [c.itemClass, V.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2935
|
+
onChange: k[3] || (k[3] = (f) => e(n)(f.name, f.value)),
|
|
2936
|
+
onClear: k[4] || (k[4] = (f) => {
|
|
2937
|
+
e(x)(f), e(n)(f, void 0);
|
|
2920
2938
|
}),
|
|
2921
|
-
modelValue: e(g)[
|
|
2922
|
-
"onUpdate:modelValue": (
|
|
2939
|
+
modelValue: e(g)[V.props.name],
|
|
2940
|
+
"onUpdate:modelValue": (f) => e(g)[V.props.name] = f,
|
|
2923
2941
|
showClean: !0
|
|
2924
2942
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128))
|
|
2925
2943
|
])
|
|
2926
|
-
])) :
|
|
2944
|
+
])) : _("", !0);
|
|
2927
2945
|
}
|
|
2928
2946
|
}), Ko = ["onKeydown"], Mo = ["disabled"], Lo = {
|
|
2929
2947
|
key: 0,
|
|
@@ -2947,14 +2965,14 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2947
2965
|
itemClass: {}
|
|
2948
2966
|
},
|
|
2949
2967
|
emits: ["change", "clear", "clearAll"],
|
|
2950
|
-
setup(
|
|
2951
|
-
const y = oe(), t =
|
|
2952
|
-
activeFilter:
|
|
2968
|
+
setup(m, { emit: o }) {
|
|
2969
|
+
const y = oe(), t = m, a = o, l = A({}), g = pe(), {
|
|
2970
|
+
activeFilter: p,
|
|
2953
2971
|
activeFilterCount: n,
|
|
2954
2972
|
onFilterChange: x,
|
|
2955
|
-
clearFilter:
|
|
2973
|
+
clearFilter: d,
|
|
2956
2974
|
clearAllFilters: v,
|
|
2957
|
-
filtersSlot:
|
|
2975
|
+
filtersSlot: c
|
|
2958
2976
|
} = ye(
|
|
2959
2977
|
{
|
|
2960
2978
|
...t,
|
|
@@ -2962,7 +2980,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2962
2980
|
slots: g
|
|
2963
2981
|
},
|
|
2964
2982
|
a
|
|
2965
|
-
), k = A(null),
|
|
2983
|
+
), k = A(null), V = A(null), C = qe({ open: !1, top: 0, left: 0 }), f = O(() => C.open), r = O(() => !!t.disabled), s = O(() => l.value || {}), b = O(() => t.title ?? "Фільтр"), h = O(() => !!g.trigger), K = O(() => [
|
|
2966
2984
|
"inline-flex h-9 items-center justify-center gap-2 rounded-lg border border-transparent bg-slate-200/70 px-3 text-sm font-medium text-slate-700 transition-colors hover:bg-blue-100 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-slate-200/70 disabled:hover:text-slate-700",
|
|
2967
2985
|
r.value ? "cursor-not-allowed opacity-60" : "cursor-pointer"
|
|
2968
2986
|
]), M = O(() => C.open ? {
|
|
@@ -2996,7 +3014,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
2996
3014
|
window.addEventListener("resize", R), window.addEventListener("scroll", R, !0);
|
|
2997
3015
|
}), me(() => {
|
|
2998
3016
|
window.removeEventListener("resize", R), window.removeEventListener("scroll", R, !0);
|
|
2999
|
-
}),
|
|
3017
|
+
}), E(
|
|
3000
3018
|
() => t.schema,
|
|
3001
3019
|
(z) => {
|
|
3002
3020
|
if (!z) {
|
|
@@ -3004,9 +3022,9 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3004
3022
|
return;
|
|
3005
3023
|
}
|
|
3006
3024
|
if (Array.isArray(z)) {
|
|
3007
|
-
const j = z.filter((
|
|
3008
|
-
const P =
|
|
3009
|
-
return [P, { ...
|
|
3025
|
+
const j = z.filter((T) => T && (T.name || T.id)).map((T) => {
|
|
3026
|
+
const P = T.name || T.id;
|
|
3027
|
+
return [P, { ...T, name: P }];
|
|
3010
3028
|
});
|
|
3011
3029
|
l.value = Object.fromEntries(j);
|
|
3012
3030
|
return;
|
|
@@ -3014,7 +3032,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3014
3032
|
l.value = z;
|
|
3015
3033
|
},
|
|
3016
3034
|
{ deep: !0, immediate: !0 }
|
|
3017
|
-
),
|
|
3035
|
+
), E(
|
|
3018
3036
|
() => t.disabled,
|
|
3019
3037
|
(z) => {
|
|
3020
3038
|
z && $();
|
|
@@ -3038,7 +3056,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3038
3056
|
}, [
|
|
3039
3057
|
de(z.$slots, "trigger", {
|
|
3040
3058
|
toggle: D,
|
|
3041
|
-
open:
|
|
3059
|
+
open: f.value,
|
|
3042
3060
|
disabled: r.value,
|
|
3043
3061
|
activeCount: e(n)
|
|
3044
3062
|
})
|
|
@@ -3051,15 +3069,15 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3051
3069
|
"data-popover-trigger": ""
|
|
3052
3070
|
}, [
|
|
3053
3071
|
Q(Ue, { class: "h-4 w-4" }),
|
|
3054
|
-
e(n) > 0 ? (i(), w("div", Lo, S(e(n)), 1)) :
|
|
3072
|
+
e(n) > 0 ? (i(), w("div", Lo, S(e(n)), 1)) : _("", !0)
|
|
3055
3073
|
], 10, Mo)),
|
|
3056
|
-
(i(),
|
|
3057
|
-
|
|
3074
|
+
(i(), I(ge, { to: "body" }, [
|
|
3075
|
+
f.value ? (i(), w("div", {
|
|
3058
3076
|
key: 0,
|
|
3059
3077
|
class: L(["absolute", typeof z.width == "number" ? `min-w-[${z.width + 32 + (Object.keys(s.value).length > 7 ? 20 : 0)}px]` : "min-w-[268px] "]),
|
|
3060
3078
|
style: be(M.value),
|
|
3061
3079
|
ref_key: "panel",
|
|
3062
|
-
ref:
|
|
3080
|
+
ref: V,
|
|
3063
3081
|
onClick: j[4] || (j[4] = se(() => {
|
|
3064
3082
|
}, ["stop"]))
|
|
3065
3083
|
}, [
|
|
@@ -3078,30 +3096,30 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3078
3096
|
])
|
|
3079
3097
|
]),
|
|
3080
3098
|
u("div", Uo, [
|
|
3081
|
-
Object.keys(s.value).length ? (i(!0), w(U, { key: 0 }, X(Object.entries(s.value), ([
|
|
3099
|
+
Object.keys(s.value).length ? (i(!0), w(U, { key: 0 }, X(Object.entries(s.value), ([T, P]) => (i(), I(le, J({ key: T }, { ref_for: !0 }, { ...P, layout: "inline" }, {
|
|
3082
3100
|
width: z.width ? z.width : P?.width,
|
|
3083
3101
|
class: [z.itemClass, P?.class],
|
|
3084
3102
|
"item-class": [z.itemClass, P?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3085
3103
|
cleanable: !0,
|
|
3086
|
-
modelValue: e(
|
|
3087
|
-
"onUpdate:modelValue": (Y) => e(
|
|
3104
|
+
modelValue: e(p)[T],
|
|
3105
|
+
"onUpdate:modelValue": (Y) => e(p)[T] = Y,
|
|
3088
3106
|
onChange: j[0] || (j[0] = (Y) => e(x)(Y.name, Y.value)),
|
|
3089
3107
|
onClear: j[1] || (j[1] = (Y) => {
|
|
3090
|
-
e(
|
|
3108
|
+
e(d)(Y), e(x)(Y, void 0);
|
|
3091
3109
|
})
|
|
3092
|
-
}), null, 16, ["width", "class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)) :
|
|
3093
|
-
(i(!0), w(U, null, X(e(
|
|
3110
|
+
}), null, 16, ["width", "class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128)) : _("", !0),
|
|
3111
|
+
(i(!0), w(U, null, X(e(c), (T, P) => (i(), I(le, J({
|
|
3094
3112
|
key: "slot-" + P,
|
|
3095
3113
|
ref_for: !0
|
|
3096
|
-
}, { ...
|
|
3097
|
-
class: [z.itemClass,
|
|
3098
|
-
"item-class": [z.itemClass,
|
|
3114
|
+
}, { ...T.props, layout: "inline" }, {
|
|
3115
|
+
class: [z.itemClass, T.props?.class],
|
|
3116
|
+
"item-class": [z.itemClass, T.props?.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3099
3117
|
cleanable: !0,
|
|
3100
|
-
modelValue: e(
|
|
3101
|
-
"onUpdate:modelValue": (Y) => e(
|
|
3118
|
+
modelValue: e(p)[T.props.name],
|
|
3119
|
+
"onUpdate:modelValue": (Y) => e(p)[T.props.name] = Y,
|
|
3102
3120
|
onChange: j[2] || (j[2] = (Y) => e(x)(Y.name, Y.value)),
|
|
3103
3121
|
onClear: j[3] || (j[3] = (Y) => {
|
|
3104
|
-
e(
|
|
3122
|
+
e(d)(Y), e(x)(Y, void 0);
|
|
3105
3123
|
})
|
|
3106
3124
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]))), 128))
|
|
3107
3125
|
]),
|
|
@@ -3111,9 +3129,9 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3111
3129
|
class: L([z.itemClass, "text-sm font-semibold text-blue-600 transition-colors hover:text-blue-700 focus:outline-none"]),
|
|
3112
3130
|
onClick: N
|
|
3113
3131
|
}, S(e(y)("filter.clear")), 3)
|
|
3114
|
-
])) :
|
|
3132
|
+
])) : _("", !0)
|
|
3115
3133
|
])
|
|
3116
|
-
], 6)) :
|
|
3134
|
+
], 6)) : _("", !0)
|
|
3117
3135
|
]))
|
|
3118
3136
|
], 512));
|
|
3119
3137
|
}
|
|
@@ -3133,44 +3151,44 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3133
3151
|
itemClass: {}
|
|
3134
3152
|
},
|
|
3135
3153
|
emits: ["change", "clear", "clearAll"],
|
|
3136
|
-
setup(
|
|
3137
|
-
const t =
|
|
3138
|
-
|
|
3154
|
+
setup(m, { expose: o, emit: y }) {
|
|
3155
|
+
const t = m, a = A(n(t.value ?? {}));
|
|
3156
|
+
E(
|
|
3139
3157
|
() => t.value,
|
|
3140
|
-
async (
|
|
3141
|
-
a.value = n(
|
|
3158
|
+
async (f) => {
|
|
3159
|
+
a.value = n(f ?? {}), (!f || Object.keys(f).length === 0) && (await fe(), g.value?.clearAllFilters?.(!0));
|
|
3142
3160
|
},
|
|
3143
3161
|
{ deep: !0, immediate: !0 }
|
|
3144
3162
|
);
|
|
3145
|
-
const l = y, g = A(),
|
|
3146
|
-
function n(
|
|
3147
|
-
if (Array.isArray(
|
|
3148
|
-
return
|
|
3149
|
-
if (
|
|
3150
|
-
const r = ue(
|
|
3163
|
+
const l = y, g = A(), p = pe();
|
|
3164
|
+
function n(f) {
|
|
3165
|
+
if (Array.isArray(f))
|
|
3166
|
+
return f.map((r) => n(r));
|
|
3167
|
+
if (f !== null && typeof f == "object") {
|
|
3168
|
+
const r = ue(f), s = {};
|
|
3151
3169
|
for (const b in r)
|
|
3152
3170
|
s[b] = n(r[b]);
|
|
3153
3171
|
return s;
|
|
3154
3172
|
}
|
|
3155
|
-
return
|
|
3173
|
+
return f;
|
|
3156
3174
|
}
|
|
3157
|
-
function x(
|
|
3175
|
+
function x(f, r) {
|
|
3158
3176
|
r !== void 0 ? a.value = {
|
|
3159
3177
|
...a.value,
|
|
3160
|
-
[
|
|
3161
|
-
} : delete a.value[
|
|
3178
|
+
[f]: r
|
|
3179
|
+
} : delete a.value[f], l("change", {
|
|
3162
3180
|
data: n(a.value),
|
|
3163
|
-
name:
|
|
3181
|
+
name: f,
|
|
3164
3182
|
value: n(r)
|
|
3165
3183
|
});
|
|
3166
3184
|
}
|
|
3167
|
-
function f
|
|
3168
|
-
delete a.value[
|
|
3185
|
+
function d(f) {
|
|
3186
|
+
delete a.value[f], l("clear", {
|
|
3169
3187
|
data: n(a.value),
|
|
3170
|
-
name:
|
|
3188
|
+
name: f
|
|
3171
3189
|
}), l("change", {
|
|
3172
3190
|
data: n(a.value),
|
|
3173
|
-
name:
|
|
3191
|
+
name: f,
|
|
3174
3192
|
value: null
|
|
3175
3193
|
});
|
|
3176
3194
|
}
|
|
@@ -3184,7 +3202,7 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3184
3202
|
value: null
|
|
3185
3203
|
});
|
|
3186
3204
|
}
|
|
3187
|
-
const
|
|
3205
|
+
const c = A({});
|
|
3188
3206
|
function k() {
|
|
3189
3207
|
switch (t.view) {
|
|
3190
3208
|
case "inline":
|
|
@@ -3199,64 +3217,64 @@ const Ue = /* @__PURE__ */ te(so, [["render", uo]]), co = { class: "flex items-c
|
|
|
3199
3217
|
return Fe;
|
|
3200
3218
|
}
|
|
3201
3219
|
}
|
|
3202
|
-
|
|
3220
|
+
E(
|
|
3203
3221
|
() => t.schema,
|
|
3204
|
-
(
|
|
3205
|
-
if (!
|
|
3206
|
-
|
|
3222
|
+
(f) => {
|
|
3223
|
+
if (!f) {
|
|
3224
|
+
c.value = {};
|
|
3207
3225
|
return;
|
|
3208
3226
|
}
|
|
3209
|
-
if (Array.isArray(
|
|
3210
|
-
|
|
3227
|
+
if (Array.isArray(f) && !f.length) {
|
|
3228
|
+
c.value = {};
|
|
3211
3229
|
return;
|
|
3212
3230
|
}
|
|
3213
|
-
Array.isArray(
|
|
3231
|
+
Array.isArray(f) ? c.value = f.filter((r) => r.type).reduce((r, s) => (Object.assign(s, {
|
|
3214
3232
|
name: s.id || s.name,
|
|
3215
3233
|
type: { datepicker: "date" }[s.type.toLowerCase()] || s.type.toLowerCase(),
|
|
3216
3234
|
label: s.label || s.ua
|
|
3217
|
-
}), r[s.name] = s, s.data && !s.api && !s.options && Object.assign(s, { api: `/api/suggest/${s.data}` }), r), {}) : (Object.entries(
|
|
3235
|
+
}), r[s.name] = s, s.data && !s.api && !s.options && Object.assign(s, { api: `/api/suggest/${s.data}` }), r), {}) : (Object.entries(f).forEach(([r, s]) => {
|
|
3218
3236
|
Object.assign(s, { name: r || s.name || s.id, type: s.type.toLowerCase() });
|
|
3219
|
-
}),
|
|
3237
|
+
}), c.value = { ...f });
|
|
3220
3238
|
},
|
|
3221
3239
|
{ immediate: !0, deep: !0 }
|
|
3222
3240
|
);
|
|
3223
|
-
function
|
|
3224
|
-
g.value.clearFilter(
|
|
3241
|
+
function V(f) {
|
|
3242
|
+
g.value.clearFilter(f), d(f);
|
|
3225
3243
|
}
|
|
3226
3244
|
function C() {
|
|
3227
3245
|
g.value.clearAllFilters(), v();
|
|
3228
3246
|
}
|
|
3229
|
-
return
|
|
3247
|
+
return E(
|
|
3230
3248
|
() => a.value,
|
|
3231
|
-
(
|
|
3249
|
+
(f) => {
|
|
3232
3250
|
if (t.history) {
|
|
3233
3251
|
const r = new URL(window.location.href), s = new URLSearchParams(window.location.search);
|
|
3234
|
-
Object.keys(
|
|
3252
|
+
Object.keys(f).length > 0 ? s.set(
|
|
3235
3253
|
"filter",
|
|
3236
|
-
Object.entries(
|
|
3254
|
+
Object.entries(f).filter(([, b]) => b).map(([b, h]) => `${b}=${h}`).join("|")
|
|
3237
3255
|
) : s.delete("filter"), r.search = decodeURI(s.toString()), window.history.pushState({}, "", r);
|
|
3238
3256
|
}
|
|
3239
3257
|
}
|
|
3240
3258
|
), o({
|
|
3241
3259
|
clearAllFilters: C,
|
|
3242
|
-
clearFilter:
|
|
3243
|
-
}), (
|
|
3244
|
-
schema:
|
|
3260
|
+
clearFilter: V
|
|
3261
|
+
}), (f, r) => (i(), I(re(k()), J(t, {
|
|
3262
|
+
schema: c.value,
|
|
3245
3263
|
onChange: r[0] || (r[0] = (s) => x(s.name, s.value)),
|
|
3246
|
-
onClear: r[1] || (r[1] = (s) =>
|
|
3264
|
+
onClear: r[1] || (r[1] = (s) => d(s.name)),
|
|
3247
3265
|
onClearAll: v,
|
|
3248
3266
|
ref_key: "filterRef",
|
|
3249
3267
|
ref: g
|
|
3250
3268
|
}), Qe({
|
|
3251
3269
|
default: ne(() => [
|
|
3252
|
-
de(
|
|
3270
|
+
de(f.$slots, "default")
|
|
3253
3271
|
]),
|
|
3254
3272
|
_: 2
|
|
3255
3273
|
}, [
|
|
3256
|
-
e(
|
|
3274
|
+
e(p).trigger ? {
|
|
3257
3275
|
name: "trigger",
|
|
3258
3276
|
fn: ne((s) => [
|
|
3259
|
-
de(
|
|
3277
|
+
de(f.$slots, "trigger", He(Ge(s)))
|
|
3260
3278
|
]),
|
|
3261
3279
|
key: "0"
|
|
3262
3280
|
} : void 0
|