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