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