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