@opengis/partsmap 0.1.4 → 0.1.5
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/index.js +1261 -1255
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { defineComponent as Y, ref as V,
|
1
|
+
import { defineComponent as Y, ref as V, computed as E, watch as D, openBlock as p, createBlock as z, resolveDynamicComponent as ie, mergeProps as Z, withCtx as se, renderSlot as te, createElementBlock as k, createElementVNode as a, toDisplayString as K, createCommentVNode as S, unref as e, useSlots as we, normalizeClass as j, createVNode as I, createTextVNode as W, Fragment as F, renderList as N, toRaw as ve, onMounted as pe, onBeforeUnmount as ge, Teleport as Ie, withDirectives as P, normalizeStyle as ke, vShow as X, cloneVNode as Je, nextTick as _e, vModelText as le, isRef as Xe, withModifiers as Pe, createStaticVNode as Te, resolveDirective as et, getCurrentInstance as tt } from "vue";
|
2
2
|
const lt = { class: "flex items-center justify-between w-full text-sm" }, at = { class: "flex items-center cursor-pointer w-full" }, ot = {
|
3
3
|
key: 0,
|
4
4
|
width: "16",
|
5
5
|
height: "auto",
|
6
6
|
src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
|
7
|
-
},
|
7
|
+
}, nt = ["value"], rt = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, it = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, st = {
|
8
8
|
key: 0,
|
9
9
|
class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
|
10
|
-
},
|
10
|
+
}, Ce = /* @__PURE__ */ Y({
|
11
11
|
__name: "list-item",
|
12
12
|
props: {
|
13
13
|
layout: {},
|
@@ -20,13 +20,13 @@ const lt = { class: "flex items-center justify-between w-full text-sm" }, at = {
|
|
20
20
|
highlighted: { type: Boolean }
|
21
21
|
},
|
22
22
|
emits: ["itemClick"],
|
23
|
-
setup(i, { expose:
|
24
|
-
const
|
23
|
+
setup(i, { expose: n, emit: u }) {
|
24
|
+
const o = i, t = u;
|
25
25
|
function s() {
|
26
|
-
t("itemClick",
|
26
|
+
t("itemClick", o.value);
|
27
27
|
}
|
28
28
|
const v = V(null);
|
29
|
-
return
|
29
|
+
return n({ el: v }), (h, b) => (p(), k("div", {
|
30
30
|
class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
|
31
31
|
ref_key: "el",
|
32
32
|
ref: v
|
@@ -35,29 +35,29 @@ const lt = { class: "flex items-center justify-between w-full text-sm" }, at = {
|
|
35
35
|
a("div", at, [
|
36
36
|
a("label", {
|
37
37
|
for: "radio-9740",
|
38
|
-
class:
|
39
|
-
["inline", "popover"].includes(
|
40
|
-
{ "bg-blue-100":
|
38
|
+
class: j([
|
39
|
+
["inline", "popover"].includes(h.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": h.highlighted }
|
41
41
|
]),
|
42
42
|
onClick: Pe(s, ["stop", "prevent"])
|
43
43
|
}, [
|
44
44
|
a("div", {
|
45
|
-
class:
|
46
|
-
|
47
|
-
|
45
|
+
class: j(["w-[18px] h-[18px] border flex items-center justify-center", [
|
46
|
+
h.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
|
47
|
+
h.color ? `bg-[${h.color}] border-[#ffffff]` : h.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
48
48
|
]])
|
49
49
|
}, [
|
50
|
-
|
50
|
+
h.isSelected ? (p(), k("img", ot)) : S("", !0)
|
51
51
|
], 2),
|
52
52
|
a("input", {
|
53
53
|
type: "checkbox",
|
54
54
|
class: "hidden",
|
55
55
|
id: "radio-9740",
|
56
|
-
value:
|
57
|
-
}, null, 8,
|
58
|
-
a("div",
|
59
|
-
a("span", it,
|
60
|
-
|
56
|
+
value: h.value
|
57
|
+
}, null, 8, nt),
|
58
|
+
a("div", rt, [
|
59
|
+
a("span", it, K(h.label ?? "Відсутні данні"), 1),
|
60
|
+
h.count ? (p(), k("div", st, " (" + K(h.count) + ") ", 1)) : S("", !0)
|
61
61
|
])
|
62
62
|
], 2)
|
63
63
|
])
|
@@ -65,75 +65,75 @@ const lt = { class: "flex items-center justify-between w-full text-sm" }, at = {
|
|
65
65
|
], 512));
|
66
66
|
}
|
67
67
|
});
|
68
|
-
function He(i,
|
68
|
+
function He(i, n) {
|
69
69
|
const {
|
70
|
-
options:
|
71
|
-
limit:
|
70
|
+
options: u = [],
|
71
|
+
limit: o = 20
|
72
72
|
} = i;
|
73
|
-
function t(
|
74
|
-
return Array.isArray(
|
73
|
+
function t(r) {
|
74
|
+
return Array.isArray(r) ? r[0] : r;
|
75
75
|
}
|
76
|
-
const s = V(t(i.modelValue)), v = V(""),
|
77
|
-
function _(
|
78
|
-
const C =
|
79
|
-
return { autoValueKey:
|
76
|
+
const s = V(t(i.modelValue)), v = V(""), h = V(!1), b = V([]), w = V("id"), m = V("text"), d = V(!1), y = V(i.layout !== "popover" && u.length > o);
|
77
|
+
function _(r) {
|
78
|
+
const C = r.find(Boolean) ?? {}, $ = ["id", "value", "code", "key"].find((A) => A in C) ?? "id", B = ["text", "label", "name", "title"].find((A) => A in C) ?? "text";
|
79
|
+
return { autoValueKey: $, autoLabelKey: B };
|
80
80
|
}
|
81
|
-
if (
|
82
|
-
const
|
83
|
-
w.value =
|
81
|
+
if (u.length > 0) {
|
82
|
+
const r = _(u);
|
83
|
+
w.value = r.autoValueKey, m.value = r.autoLabelKey;
|
84
84
|
}
|
85
|
-
const
|
86
|
-
const
|
87
|
-
return i.layout === "popover" ||
|
85
|
+
const f = E(() => {
|
86
|
+
const r = b.value;
|
87
|
+
return i.layout === "popover" || d.value ? r : r.slice(0, o);
|
88
88
|
});
|
89
|
-
D(() => i.modelValue, (
|
90
|
-
s.value = t(
|
91
|
-
}, { immediate: !0 }), b.value = [...
|
92
|
-
function
|
93
|
-
return s.value ===
|
89
|
+
D(() => i.modelValue, (r) => {
|
90
|
+
s.value = t(r);
|
91
|
+
}, { immediate: !0 }), b.value = [...u].sort((r, C) => i.sort === "count" ? C.count && r.count ? C.count - r.count : 0 : i.sort === "name" ? String(r[m.value] ?? "").localeCompare(String(C[m.value] ?? "")) : 0);
|
92
|
+
function c(r) {
|
93
|
+
return s.value === r[w.value];
|
94
94
|
}
|
95
|
-
function l(
|
96
|
-
s.value =
|
95
|
+
function l(r) {
|
96
|
+
s.value = r[w.value], n("update:modelValue", s.value), n("change", { name: i.name, value: s.value });
|
97
97
|
}
|
98
98
|
function x() {
|
99
|
-
s.value = void 0,
|
99
|
+
s.value = void 0, n("update:modelValue", s.value), n("clear", i.name);
|
100
100
|
}
|
101
|
-
function
|
102
|
-
|
101
|
+
function g() {
|
102
|
+
d.value = !d.value;
|
103
103
|
}
|
104
104
|
return {
|
105
105
|
innerValue: s,
|
106
106
|
searchTerm: v,
|
107
|
-
filteredOptions:
|
108
|
-
isSelected:
|
107
|
+
filteredOptions: f,
|
108
|
+
isSelected: c,
|
109
109
|
selectItem: l,
|
110
110
|
clear: x,
|
111
|
-
toggleShowAll:
|
112
|
-
isReqProc:
|
113
|
-
showAll:
|
111
|
+
toggleShowAll: g,
|
112
|
+
isReqProc: h,
|
113
|
+
showAll: d,
|
114
114
|
isEnableShowAll: y,
|
115
115
|
labelKey: m,
|
116
116
|
valueKey: w,
|
117
117
|
allOptions: b
|
118
118
|
};
|
119
119
|
}
|
120
|
-
const
|
121
|
-
const
|
122
|
-
for (const [
|
123
|
-
|
124
|
-
return
|
125
|
-
}, ut = {},
|
120
|
+
const ae = (i, n) => {
|
121
|
+
const u = i.__vccOpts || i;
|
122
|
+
for (const [o, t] of n)
|
123
|
+
u[o] = t;
|
124
|
+
return u;
|
125
|
+
}, ut = {}, ct = {
|
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
|
132
|
-
return p(), k("svg",
|
131
|
+
function dt(i, n) {
|
132
|
+
return p(), k("svg", ct, n[0] || (n[0] = [
|
133
133
|
Te('<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
|
}
|
136
|
-
const Ve = /* @__PURE__ */
|
136
|
+
const Ve = /* @__PURE__ */ ae(ut, [["render", dt]]), pt = {}, ft = {
|
137
137
|
xmlns: "http://www.w3.org/2000/svg",
|
138
138
|
width: "24",
|
139
139
|
height: "24",
|
@@ -145,8 +145,8 @@ const Ve = /* @__PURE__ */ le(ut, [["render", ct]]), pt = {}, ft = {
|
|
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 vt(i,
|
149
|
-
return p(), k("svg", ft,
|
148
|
+
function vt(i, n) {
|
149
|
+
return p(), k("svg", ft, n[0] || (n[0] = [
|
150
150
|
a("path", {
|
151
151
|
stroke: "none",
|
152
152
|
d: "M0 0h24v24H0z",
|
@@ -155,7 +155,7 @@ function vt(i, o) {
|
|
155
155
|
a("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
156
156
|
]));
|
157
157
|
}
|
158
|
-
const be = /* @__PURE__ */
|
158
|
+
const be = /* @__PURE__ */ ae(pt, [["render", vt]]), mt = {}, ht = {
|
159
159
|
xmlns: "http://www.w3.org/2000/svg",
|
160
160
|
width: "24",
|
161
161
|
height: "24",
|
@@ -167,8 +167,8 @@ const be = /* @__PURE__ */ le(pt, [["render", vt]]), mt = {}, gt = {
|
|
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
|
171
|
-
return p(), k("svg",
|
170
|
+
function gt(i, n) {
|
171
|
+
return p(), k("svg", ht, n[0] || (n[0] = [
|
172
172
|
a("path", {
|
173
173
|
stroke: "none",
|
174
174
|
d: "M0 0h24v24H0z",
|
@@ -177,7 +177,7 @@ function ht(i, o) {
|
|
177
177
|
a("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
178
178
|
]));
|
179
179
|
}
|
180
|
-
const Se = /* @__PURE__ */
|
180
|
+
const Se = /* @__PURE__ */ ae(mt, [["render", gt]]), bt = {
|
181
181
|
key: 0,
|
182
182
|
class: "w-full"
|
183
183
|
}, yt = { class: "flex flex-col items-center justify-center p-5 text-center" }, xt = {
|
@@ -212,98 +212,98 @@ const Se = /* @__PURE__ */ le(mt, [["render", ht]]), bt = {
|
|
212
212
|
sort: {}
|
213
213
|
},
|
214
214
|
emits: ["update:modelValue", "change", "clear"],
|
215
|
-
setup(i, { expose:
|
216
|
-
const
|
215
|
+
setup(i, { expose: n, emit: u }) {
|
216
|
+
const o = i, t = V(null), s = u, {
|
217
217
|
innerValue: v,
|
218
|
-
filteredOptions:
|
218
|
+
filteredOptions: h,
|
219
219
|
isSelected: b,
|
220
220
|
selectItem: w,
|
221
221
|
clear: m,
|
222
|
-
toggleShowAll:
|
222
|
+
toggleShowAll: d,
|
223
223
|
isReqProc: y,
|
224
224
|
showAll: _,
|
225
|
-
isEnableShowAll:
|
226
|
-
labelKey:
|
225
|
+
isEnableShowAll: f,
|
226
|
+
labelKey: c,
|
227
227
|
valueKey: l,
|
228
228
|
allOptions: x
|
229
229
|
} = He({
|
230
|
-
...
|
231
|
-
modelValue:
|
230
|
+
...o,
|
231
|
+
modelValue: o.modelValue ?? o.default ?? ""
|
232
232
|
}, s);
|
233
|
-
return
|
233
|
+
return n({
|
234
234
|
clear: m,
|
235
235
|
inputTextRef: t
|
236
236
|
}), D(
|
237
|
-
() =>
|
238
|
-
(
|
239
|
-
|
237
|
+
() => o.modelValue,
|
238
|
+
(g) => {
|
239
|
+
g === void 0 && (v.value = void 0);
|
240
240
|
}
|
241
|
-
), (
|
242
|
-
class:
|
241
|
+
), (g, r) => (p(), k("div", {
|
242
|
+
class: j([g.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
|
243
243
|
}, [
|
244
244
|
a("div", {
|
245
|
-
class:
|
246
|
-
|
247
|
-
|
245
|
+
class: j([
|
246
|
+
g.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
247
|
+
g.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
248
248
|
])
|
249
249
|
}, [
|
250
|
-
(p(!0), k(
|
251
|
-
layout:
|
250
|
+
(p(!0), k(F, null, N(e(h), (C) => (p(), z(Ce, {
|
251
|
+
layout: g.layout,
|
252
252
|
key: C[e(l)],
|
253
253
|
count: C.count,
|
254
|
-
label: C[e(
|
254
|
+
label: C[e(c)],
|
255
255
|
color: C.color,
|
256
256
|
type: "radio",
|
257
257
|
value: C[e(l)],
|
258
258
|
"is-selected": e(b)(C),
|
259
|
-
onItemClick: (
|
259
|
+
onItemClick: ($) => e(w)(C)
|
260
260
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
261
261
|
], 2),
|
262
|
-
|
262
|
+
g.type === "select" && e(h).length === 0 && !e(y) ? (p(), k("div", bt, [
|
263
263
|
a("div", yt, [
|
264
264
|
I(Ve),
|
265
|
-
|
265
|
+
r[4] || (r[4] = a("div", { class: "max-w-sm mx-auto mt-6" }, [
|
266
266
|
a("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
267
267
|
a("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
268
268
|
], -1))
|
269
269
|
])
|
270
270
|
])) : S("", !0),
|
271
|
-
|
272
|
-
!e(_) && e(
|
271
|
+
g.layout !== "popover" && g.type !== "select" ? (p(), k(F, { key: 1 }, [
|
272
|
+
!e(_) && e(f) ? (p(), k("div", {
|
273
273
|
key: 0,
|
274
|
-
onClick:
|
275
|
-
(...C) => e(
|
274
|
+
onClick: r[0] || (r[0] = //@ts-ignore
|
275
|
+
(...C) => e(d) && e(d)(...C)),
|
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
|
-
|
278
|
+
r[5] || (r[5] = W(" Показати більше ", -1)),
|
279
279
|
I(be)
|
280
280
|
])) : S("", !0),
|
281
281
|
e(_) ? (p(), k("div", {
|
282
282
|
key: 1,
|
283
|
-
onClick:
|
284
|
-
(...C) => e(
|
283
|
+
onClick: r[1] || (r[1] = //@ts-ignore
|
284
|
+
(...C) => e(d) && e(d)(...C)),
|
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
|
-
|
287
|
+
r[6] || (r[6] = W(" Показати менше ", -1)),
|
288
288
|
I(Se)
|
289
289
|
])) : S("", !0)
|
290
290
|
], 64)) : S("", !0),
|
291
|
-
|
292
|
-
|
293
|
-
W(
|
291
|
+
g.cleanable ? (p(), k(F, { key: 2 }, [
|
292
|
+
g.layout === "inline" ? (p(), k("div", xt, [
|
293
|
+
W(K(e(v) || e(v) === null ? 1 : 0) + " з " + K(e(x).length) + " обрано ", 1),
|
294
294
|
P(a("button", {
|
295
295
|
class: "text-gray-600 hover:text-gray-800",
|
296
|
-
onClick:
|
296
|
+
onClick: r[2] || (r[2] = //@ts-ignore
|
297
297
|
(...C) => e(m) && e(m)(...C))
|
298
298
|
}, " Очистити ", 512), [
|
299
299
|
[X, e(v) !== "" && e(v) !== void 0]
|
300
300
|
])
|
301
301
|
])) : S("", !0),
|
302
|
-
|
303
|
-
a("span", null,
|
302
|
+
g.layout === "popover" ? (p(), k("div", wt, [
|
303
|
+
a("span", null, K(e(v) || e(v) === null ? 1 : 0) + " з " + K(e(x).length) + " обрано", 1),
|
304
304
|
P(a("button", {
|
305
305
|
class: "text-gray-600 hover:text-gray-800",
|
306
|
-
onClick:
|
306
|
+
onClick: r[3] || (r[3] = //@ts-ignore
|
307
307
|
(...C) => e(m) && e(m)(...C))
|
308
308
|
}, " Очистити ", 512), [
|
309
309
|
[X, e(v) !== "" && e(v) !== void 0]
|
@@ -313,63 +313,63 @@ const Se = /* @__PURE__ */ le(mt, [["render", ht]]), bt = {
|
|
313
313
|
], 2));
|
314
314
|
}
|
315
315
|
});
|
316
|
-
function Ee(i,
|
316
|
+
function Ee(i, n) {
|
317
317
|
const {
|
318
|
-
options:
|
319
|
-
limit:
|
318
|
+
options: u = [],
|
319
|
+
limit: o = 20
|
320
320
|
} = i;
|
321
|
-
function t(
|
322
|
-
return Array.isArray(
|
321
|
+
function t(r) {
|
322
|
+
return Array.isArray(r) ? r : r ? [r] : [];
|
323
323
|
}
|
324
|
-
const s = V(t(i.modelValue)), v = V(""),
|
325
|
-
function _(
|
326
|
-
const C =
|
327
|
-
return { autoValueKey:
|
324
|
+
const s = V(t(i.modelValue)), v = V(""), h = V(!1), b = V([]), w = V("id"), m = V("text"), d = V(!1), y = V(i.layout !== "popover" && u.length > o);
|
325
|
+
function _(r) {
|
326
|
+
const C = r.find(Boolean) ?? {}, $ = ["id", "value", "code", "key"].find((A) => A in C) ?? "id", B = ["text", "label", "name", "title"].find((A) => A in C) ?? "text";
|
327
|
+
return { autoValueKey: $, autoLabelKey: B };
|
328
328
|
}
|
329
|
-
if (
|
330
|
-
const
|
331
|
-
w.value =
|
329
|
+
if (u.length > 0) {
|
330
|
+
const r = _(u);
|
331
|
+
w.value = r.autoValueKey, m.value = r.autoLabelKey;
|
332
332
|
}
|
333
|
-
const
|
334
|
-
const
|
335
|
-
return i.layout === "popover" ||
|
333
|
+
const f = E(() => {
|
334
|
+
const r = b.value;
|
335
|
+
return i.layout === "popover" || d.value ? r : r.slice(0, o);
|
336
336
|
});
|
337
|
-
D(() => i.modelValue, (
|
338
|
-
s.value = t(
|
339
|
-
}, { immediate: !0 }), b.value = [...
|
340
|
-
function
|
341
|
-
return s.value && s.value.includes(
|
337
|
+
D(() => i.modelValue, (r) => {
|
338
|
+
s.value = t(r);
|
339
|
+
}, { immediate: !0 }), b.value = [...u].sort((r, C) => i.sort === "count" ? C.count && r.count ? C.count - r.count : 0 : i.sort === "name" ? String(r[m.value]).localeCompare(String(C[m.value])) : 0);
|
340
|
+
function c(r) {
|
341
|
+
return s.value && s.value.includes(r[w.value]);
|
342
342
|
}
|
343
|
-
function l(
|
344
|
-
const C = s.value.includes(
|
345
|
-
s.value = C ? s.value.filter((
|
343
|
+
function l(r) {
|
344
|
+
const C = s.value.includes(r[w.value]);
|
345
|
+
s.value = C ? s.value.filter(($) => $ !== r[w.value]) : [...s.value, r[w.value]], n("update:modelValue", s.value), n("change", { name: i.name, value: s.value });
|
346
346
|
}
|
347
347
|
function x() {
|
348
|
-
s.value = [],
|
348
|
+
s.value = [], n("update:modelValue", s.value), n("clear", i.name);
|
349
349
|
}
|
350
|
-
function
|
351
|
-
|
350
|
+
function g() {
|
351
|
+
d.value = !d.value;
|
352
352
|
}
|
353
353
|
return {
|
354
354
|
innerValue: s,
|
355
355
|
searchTerm: v,
|
356
|
-
filteredOptions:
|
357
|
-
isSelected:
|
356
|
+
filteredOptions: f,
|
357
|
+
isSelected: c,
|
358
358
|
selectItem: l,
|
359
359
|
clear: x,
|
360
|
-
toggleShowAll:
|
361
|
-
isReqProc:
|
362
|
-
showAll:
|
360
|
+
toggleShowAll: g,
|
361
|
+
isReqProc: h,
|
362
|
+
showAll: d,
|
363
363
|
isEnableShowAll: y,
|
364
364
|
labelKey: m,
|
365
365
|
valueKey: w,
|
366
366
|
allOptions: b
|
367
367
|
};
|
368
368
|
}
|
369
|
-
const
|
369
|
+
const _t = {
|
370
370
|
key: 0,
|
371
371
|
class: "w-full"
|
372
|
-
},
|
372
|
+
}, Ct = { class: "flex flex-col items-center justify-center p-5 text-center" }, Vt = {
|
373
373
|
key: 0,
|
374
374
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
375
375
|
}, St = {
|
@@ -401,97 +401,97 @@ const Ct = {
|
|
401
401
|
sort: {}
|
402
402
|
},
|
403
403
|
emits: ["update:modelValue", "change", "clear"],
|
404
|
-
setup(i, { expose:
|
405
|
-
const
|
404
|
+
setup(i, { expose: n, emit: u }) {
|
405
|
+
const o = i, t = u, {
|
406
406
|
innerValue: s,
|
407
407
|
filteredOptions: v,
|
408
|
-
isSelected:
|
408
|
+
isSelected: h,
|
409
409
|
selectItem: b,
|
410
410
|
clear: w,
|
411
411
|
toggleShowAll: m,
|
412
|
-
isReqProc:
|
412
|
+
isReqProc: d,
|
413
413
|
showAll: y,
|
414
414
|
isEnableShowAll: _,
|
415
|
-
labelKey:
|
416
|
-
valueKey:
|
415
|
+
labelKey: f,
|
416
|
+
valueKey: c,
|
417
417
|
allOptions: l
|
418
418
|
} = Ee({
|
419
|
-
...
|
420
|
-
modelValue:
|
419
|
+
...o,
|
420
|
+
modelValue: o.modelValue
|
421
421
|
}, t);
|
422
422
|
return D(
|
423
|
-
() =>
|
423
|
+
() => o.modelValue,
|
424
424
|
(x) => {
|
425
425
|
x === void 0 && (s.value = []);
|
426
426
|
}
|
427
|
-
),
|
427
|
+
), n({
|
428
428
|
clear: w
|
429
|
-
}), (x,
|
430
|
-
class:
|
429
|
+
}), (x, g) => (p(), k("div", {
|
430
|
+
class: j([x.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
431
431
|
}, [
|
432
432
|
a("div", {
|
433
|
-
class:
|
433
|
+
class: j([
|
434
434
|
x.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
435
435
|
x.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
436
436
|
])
|
437
437
|
}, [
|
438
|
-
(p(!0), k(
|
438
|
+
(p(!0), k(F, null, N(e(v), (r) => (p(), z(Ce, {
|
439
439
|
layout: x.layout,
|
440
|
-
count:
|
441
|
-
label:
|
442
|
-
color:
|
440
|
+
count: r.count,
|
441
|
+
label: r[e(f)],
|
442
|
+
color: r.color,
|
443
443
|
type: "checkbox",
|
444
|
-
value:
|
445
|
-
"is-selected": e(
|
446
|
-
onItemClick: (C) => e(b)(
|
444
|
+
value: r[e(c)],
|
445
|
+
"is-selected": e(h)(r),
|
446
|
+
onItemClick: (C) => e(b)(r)
|
447
447
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
448
448
|
], 2),
|
449
|
-
x.type === "select" && e(v).length === 0 && !e(
|
450
|
-
a("div",
|
449
|
+
x.type === "select" && e(v).length === 0 && !e(d) ? (p(), k("div", _t, [
|
450
|
+
a("div", Ct, [
|
451
451
|
I(Ve),
|
452
|
-
|
452
|
+
g[4] || (g[4] = a("div", { class: "max-w-sm mx-auto mt-6" }, [
|
453
453
|
a("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
454
454
|
a("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
455
455
|
], -1))
|
456
456
|
])
|
457
457
|
])) : S("", !0),
|
458
|
-
x.layout !== "popover" && x.type !== "select" ? (p(), k(
|
458
|
+
x.layout !== "popover" && x.type !== "select" ? (p(), k(F, { key: 1 }, [
|
459
459
|
!e(y) && e(_) ? (p(), k("div", {
|
460
460
|
key: 0,
|
461
|
-
onClick:
|
462
|
-
(...
|
461
|
+
onClick: g[0] || (g[0] = //@ts-ignore
|
462
|
+
(...r) => e(m) && e(m)(...r)),
|
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
|
-
|
465
|
+
g[5] || (g[5] = W(" Показати більше ", -1)),
|
466
466
|
I(be)
|
467
467
|
])) : S("", !0),
|
468
468
|
e(y) ? (p(), k("div", {
|
469
469
|
key: 1,
|
470
|
-
onClick:
|
471
|
-
(...
|
470
|
+
onClick: g[1] || (g[1] = //@ts-ignore
|
471
|
+
(...r) => e(m) && e(m)(...r)),
|
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
|
-
|
474
|
+
g[6] || (g[6] = W(" Показати менше ", -1)),
|
475
475
|
I(Se)
|
476
476
|
])) : S("", !0)
|
477
477
|
], 64)) : S("", !0),
|
478
|
-
x.cleanable ? (p(), k(
|
478
|
+
x.cleanable ? (p(), k(F, { key: 2 }, [
|
479
479
|
x.layout === "inline" ? (p(), k("div", Vt, [
|
480
|
-
W(
|
480
|
+
W(K(e(s).length) + " з " + K(e(l).length) + " обрано ", 1),
|
481
481
|
P(a("button", {
|
482
482
|
class: "text-gray-600 hover:text-gray-800",
|
483
|
-
onClick:
|
484
|
-
(...
|
483
|
+
onClick: g[2] || (g[2] = //@ts-ignore
|
484
|
+
(...r) => e(w) && e(w)(...r))
|
485
485
|
}, " Очистити ", 512), [
|
486
486
|
[X, e(s).length !== 0]
|
487
487
|
])
|
488
488
|
])) : S("", !0),
|
489
489
|
x.layout === "popover" ? (p(), k("div", St, [
|
490
|
-
a("span", null,
|
490
|
+
a("span", null, K(e(s).length) + " з " + K(e(l).length) + " обрано", 1),
|
491
491
|
P(a("button", {
|
492
492
|
class: "text-gray-600 hover:text-gray-800",
|
493
|
-
onClick:
|
494
|
-
(...
|
493
|
+
onClick: g[3] || (g[3] = //@ts-ignore
|
494
|
+
(...r) => e(w) && e(w)(...r))
|
495
495
|
}, " Очистити ", 512), [
|
496
496
|
[X, e(s).length !== 0]
|
497
497
|
])
|
@@ -499,7 +499,7 @@ const Ct = {
|
|
499
499
|
], 64)) : S("", !0)
|
500
500
|
], 2));
|
501
501
|
}
|
502
|
-
}),
|
502
|
+
}), $t = {}, Mt = {
|
503
503
|
xmlns: "http://www.w3.org/2000/svg",
|
504
504
|
width: "15px",
|
505
505
|
height: "15px",
|
@@ -511,8 +511,8 @@ const Ct = {
|
|
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
|
515
|
-
return p(), k("svg",
|
514
|
+
function Bt(i, n) {
|
515
|
+
return p(), k("svg", Mt, n[0] || (n[0] = [
|
516
516
|
a("path", {
|
517
517
|
stroke: "none",
|
518
518
|
d: "M0 0h24v24H0z",
|
@@ -522,7 +522,7 @@ function $t(i, o) {
|
|
522
522
|
a("path", { d: "M21 21l-6 -6" }, null, -1)
|
523
523
|
]));
|
524
524
|
}
|
525
|
-
const Ye = /* @__PURE__ */
|
525
|
+
const Ye = /* @__PURE__ */ ae($t, [["render", Bt]]), At = {}, Rt = {
|
526
526
|
xmlns: "http://www.w3.org/2000/svg",
|
527
527
|
viewBox: "0 0 24 24",
|
528
528
|
fill: "none",
|
@@ -534,8 +534,8 @@ const Ye = /* @__PURE__ */ le(Mt, [["render", $t]]), At = {}, Rt = {
|
|
534
534
|
width: "15px",
|
535
535
|
height: "15px"
|
536
536
|
};
|
537
|
-
function Dt(i,
|
538
|
-
return p(), k("svg", Rt,
|
537
|
+
function Dt(i, n) {
|
538
|
+
return p(), k("svg", Rt, n[0] || (n[0] = [
|
539
539
|
a("path", {
|
540
540
|
stroke: "none",
|
541
541
|
d: "M0 0h24v24H0z",
|
@@ -545,10 +545,10 @@ function Dt(i, o) {
|
|
545
545
|
a("path", { d: "M6 6l12 12" }, null, -1)
|
546
546
|
]));
|
547
547
|
}
|
548
|
-
const We = /* @__PURE__ */
|
548
|
+
const We = /* @__PURE__ */ ae(At, [["render", Dt]]);
|
549
549
|
class ye {
|
550
|
-
static getWidthClass(
|
551
|
-
return typeof
|
550
|
+
static getWidthClass(n) {
|
551
|
+
return typeof n == "number" ? `max-w-[${n}px]` : typeof n == "string" ? n.endsWith("%") || n.endsWith("px") ? `max-w-[${n}]` : `max-w-${n}` : "w-full";
|
552
552
|
}
|
553
553
|
}
|
554
554
|
const zt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, jt = ["placeholder"], Ft = /* @__PURE__ */ Y({
|
@@ -577,22 +577,22 @@ const zt = { 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(i, { emit:
|
581
|
-
const
|
580
|
+
setup(i, { emit: n }) {
|
581
|
+
const u = i, o = V((u.placeHolder || u.label || u.name || "search").toString()), t = n, s = V(u.modelValue ?? "");
|
582
582
|
D(
|
583
|
-
() =>
|
583
|
+
() => u.modelValue,
|
584
584
|
(b) => {
|
585
585
|
b !== s.value && (s.value = b ?? "");
|
586
586
|
}
|
587
587
|
);
|
588
588
|
function v() {
|
589
|
-
t("update:modelValue", s.value), t("change", { name:
|
589
|
+
t("update:modelValue", s.value), t("change", { name: u.name, value: s.value });
|
590
590
|
}
|
591
|
-
function
|
592
|
-
s.value = "", t("update:modelValue", ""), t("clear",
|
591
|
+
function h() {
|
592
|
+
s.value = "", t("update:modelValue", ""), t("clear", u.name), t("change", { name: u.name, value: null });
|
593
593
|
}
|
594
594
|
return (b, w) => (p(), k("div", {
|
595
|
-
class:
|
595
|
+
class: j([
|
596
596
|
"vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",
|
597
597
|
b.layout === "inline" ? e(ye).getWidthClass(b.width) : "mb-2" + (b.layout === "popover" ? " m-2" : "")
|
598
598
|
])
|
@@ -602,7 +602,7 @@ const zt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
602
602
|
]),
|
603
603
|
s.value !== "" ? (p(), k("div", {
|
604
604
|
key: 0,
|
605
|
-
onClick:
|
605
|
+
onClick: h,
|
606
606
|
class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
|
607
607
|
}, [
|
608
608
|
I(We)
|
@@ -611,18 +611,18 @@ const zt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
611
611
|
type: "text",
|
612
612
|
"onUpdate:modelValue": w[0] || (w[0] = (m) => s.value = m),
|
613
613
|
onInput: v,
|
614
|
-
placeholder:
|
614
|
+
placeholder: o.value,
|
615
615
|
class: "!pr-7 !pl-8 bg-white h-[38px] min-w-[100px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
616
616
|
}, null, 40, jt), [
|
617
|
-
[
|
617
|
+
[le, s.value]
|
618
618
|
])
|
619
619
|
], 2));
|
620
620
|
}
|
621
621
|
});
|
622
622
|
function qe(i = { color: "blue" }) {
|
623
623
|
return E(() => {
|
624
|
-
const
|
625
|
-
return (i == null ? void 0 : i.size) === "sm" ? `${
|
624
|
+
const n = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${i.color}-500 focus:border-transparent`;
|
625
|
+
return (i == null ? void 0 : i.size) === "sm" ? `${n}h-[32px]` : `${n}h-[38px]`;
|
626
626
|
});
|
627
627
|
}
|
628
628
|
function Kt() {
|
@@ -669,85 +669,85 @@ const Ut = {
|
|
669
669
|
sort: {}
|
670
670
|
},
|
671
671
|
emits: ["update:modelValue", "change", "clear"],
|
672
|
-
setup(i, { expose:
|
673
|
-
const
|
672
|
+
setup(i, { expose: n, emit: u }) {
|
673
|
+
const o = qe(), t = Kt(), s = i, v = V(
|
674
674
|
s.modelValue ?? s.default ?? []
|
675
|
-
),
|
675
|
+
), h = u, b = E({
|
676
676
|
get: () => s.modelValue ?? v.value,
|
677
|
-
set: (
|
678
|
-
s.modelValue !== void 0 ?
|
677
|
+
set: (d) => {
|
678
|
+
s.modelValue !== void 0 ? h("update:modelValue", d) : v.value = d;
|
679
679
|
}
|
680
680
|
});
|
681
681
|
function w() {
|
682
|
-
|
682
|
+
h("change", { name: s.name, value: b.value || v.value });
|
683
683
|
}
|
684
684
|
function m() {
|
685
|
-
v.value = [], b.value = v.value,
|
685
|
+
v.value = [], b.value = v.value, h("clear", s.name);
|
686
686
|
}
|
687
|
-
return D(() => s.modelValue, (
|
688
|
-
|
689
|
-
}),
|
687
|
+
return D(() => s.modelValue, (d) => {
|
688
|
+
d !== void 0 && s.layout !== "popover" ? (v.value = d, h("update:modelValue", d)) : v.value = [];
|
689
|
+
}), n({
|
690
690
|
clear: m,
|
691
691
|
currentValue: b
|
692
|
-
}), (
|
693
|
-
var _,
|
694
|
-
return p(), k(
|
692
|
+
}), (d, y) => {
|
693
|
+
var _, f;
|
694
|
+
return p(), k(F, null, [
|
695
695
|
a("div", null, [
|
696
696
|
a("div", {
|
697
|
-
class:
|
697
|
+
class: j(d.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
698
698
|
}, [
|
699
699
|
a("div", null, [
|
700
|
-
|
700
|
+
d.layout !== "vertical" ? (p(), k("label", Ut, "Від")) : S("", !0),
|
701
701
|
P(a("input", {
|
702
702
|
type: "number",
|
703
|
-
class:
|
704
|
-
placeholder: ((_ =
|
703
|
+
class: j(e(o)),
|
704
|
+
placeholder: ((_ = d.placeHolder) == null ? void 0 : _[0]) ?? "min",
|
705
705
|
step: "1",
|
706
706
|
style: { outline: "none" },
|
707
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
708
|
-
disabled:
|
707
|
+
"onUpdate:modelValue": y[0] || (y[0] = (c) => b.value[0] = c),
|
708
|
+
disabled: d.disabled
|
709
709
|
}, null, 10, Ot), [
|
710
|
-
[
|
710
|
+
[le, b.value[0]]
|
711
711
|
])
|
712
712
|
]),
|
713
|
-
|
713
|
+
d.layout === "vertical" ? (p(), k("label", It, " - ")) : S("", !0),
|
714
714
|
a("div", null, [
|
715
|
-
|
715
|
+
d.layout !== "vertical" ? (p(), k("label", Pt, "До")) : S("", !0),
|
716
716
|
P(a("input", {
|
717
717
|
type: "number",
|
718
|
-
class:
|
719
|
-
placeholder: ((
|
718
|
+
class: j(e(o)),
|
719
|
+
placeholder: ((f = d.placeHolder) == null ? void 0 : f[1]) ?? "max",
|
720
720
|
min: "0",
|
721
721
|
max: "1000000000000000",
|
722
722
|
step: "1",
|
723
723
|
style: { outline: "none" },
|
724
|
-
"onUpdate:modelValue": y[1] || (y[1] = (
|
725
|
-
disabled:
|
724
|
+
"onUpdate:modelValue": y[1] || (y[1] = (c) => b.value[1] = c),
|
725
|
+
disabled: d.disabled
|
726
726
|
}, null, 10, Tt), [
|
727
|
-
[
|
727
|
+
[le, b.value[1]]
|
728
728
|
])
|
729
729
|
]),
|
730
|
-
["popover", "inline", "vertical"].includes(
|
730
|
+
["popover", "inline", "vertical"].includes(d.layout) ? (p(), k("button", {
|
731
731
|
key: 1,
|
732
732
|
onClick: w,
|
733
|
-
class:
|
734
|
-
},
|
735
|
-
["popover", "inline"].includes(
|
733
|
+
class: j(e(t) + (d.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
734
|
+
}, K(d.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : S("", !0),
|
735
|
+
["popover", "inline"].includes(d.layout) ? (p(), k("button", {
|
736
736
|
key: 2,
|
737
737
|
disabled: !(b.value[0] || b.value[1]),
|
738
738
|
onClick: m,
|
739
|
-
class:
|
739
|
+
class: j(e(t) + " hover:bg-gray-100")
|
740
740
|
}, "Очистити", 10, Ht)) : S("", !0)
|
741
741
|
], 2)
|
742
742
|
]),
|
743
|
-
(
|
743
|
+
(d.cleanable && v.value.length, S("", !0))
|
744
744
|
], 64);
|
745
745
|
};
|
746
746
|
}
|
747
747
|
}), Yt = ["disabled", "title"], Wt = {
|
748
748
|
key: 0,
|
749
749
|
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"
|
750
|
-
}, qt = { 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" }, Nt = { 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" },
|
750
|
+
}, qt = { 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" }, Nt = { 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" }, $e = /* @__PURE__ */ Y({
|
751
751
|
__name: "popover-field",
|
752
752
|
props: {
|
753
753
|
disabled: { type: Boolean, default: !1 },
|
@@ -758,61 +758,61 @@ const Ut = {
|
|
758
758
|
mode: {},
|
759
759
|
layout: {}
|
760
760
|
},
|
761
|
-
setup(i, { expose:
|
762
|
-
const
|
761
|
+
setup(i, { expose: n }) {
|
762
|
+
const u = i, o = E(() => Ne(u.mode)), t = V(!1), s = V({ top: 0, left: 0 }), v = V(null), h = V(null), b = V(null);
|
763
763
|
function w() {
|
764
|
-
const l =
|
764
|
+
const l = h.value, x = b.value;
|
765
765
|
if (!l || !x) return;
|
766
|
-
const
|
767
|
-
let { left:
|
768
|
-
|
766
|
+
const g = l.getBoundingClientRect(), r = x.offsetWidth, C = window.innerWidth, $ = g.bottom + 8;
|
767
|
+
let { left: B } = g;
|
768
|
+
B + r > C && (B = Math.max(C - r - 10, 10)), s.value = { top: $, left: B };
|
769
769
|
}
|
770
770
|
function m() {
|
771
|
-
t.value = !t.value, t.value &&
|
771
|
+
t.value = !t.value, t.value && _e(() => {
|
772
772
|
var l, x;
|
773
|
-
w(), (l =
|
773
|
+
w(), (l = u.fieldRef) != null && l.inputTextRef && ((x = u.fieldRef) == null || x.inputTextRef.focus());
|
774
774
|
});
|
775
775
|
}
|
776
|
-
function
|
777
|
-
var x,
|
778
|
-
!((x = v.value) != null && x.contains(l.target)) && !((
|
776
|
+
function d(l) {
|
777
|
+
var x, g;
|
778
|
+
!((x = v.value) != null && x.contains(l.target)) && !((g = b.value) != null && g.contains(l.target)) && (t.value = !1);
|
779
779
|
}
|
780
780
|
function y(l) {
|
781
781
|
l.key === "Escape" && (t.value = !1);
|
782
782
|
}
|
783
783
|
const _ = V(!1);
|
784
|
-
|
784
|
+
pe(() => {
|
785
785
|
_.value = !0;
|
786
|
-
}),
|
787
|
-
document.addEventListener("click",
|
788
|
-
}),
|
789
|
-
document.removeEventListener("click",
|
786
|
+
}), pe(() => {
|
787
|
+
document.addEventListener("click", d, !0), document.addEventListener("keydown", y), window.addEventListener("scroll", w, !0);
|
788
|
+
}), ge(() => {
|
789
|
+
document.removeEventListener("click", d, !0), document.removeEventListener("keydown", y), window.removeEventListener("scroll", w, !0);
|
790
790
|
});
|
791
|
-
function
|
791
|
+
function f() {
|
792
792
|
t.value = !1;
|
793
793
|
}
|
794
|
-
|
795
|
-
const
|
794
|
+
n({ close: f });
|
795
|
+
const c = E(() => {
|
796
796
|
var x;
|
797
|
-
const l = (x =
|
798
|
-
return l ? Array.isArray(l) ? l.length > 0 ? l.join(", ") :
|
797
|
+
const l = (x = u.fieldRef) == null ? void 0 : x.selectedLabels;
|
798
|
+
return l ? Array.isArray(l) ? l.length > 0 ? l.join(", ") : u.label ?? "" : String(l) : u.label ?? "";
|
799
799
|
});
|
800
800
|
return (l, x) => (p(), k("div", null, [
|
801
801
|
a("button", {
|
802
802
|
onClick: m,
|
803
803
|
disabled: l.disabled,
|
804
804
|
ref_key: "triggerRef",
|
805
|
-
ref:
|
805
|
+
ref: h,
|
806
806
|
title: l.label,
|
807
|
-
class:
|
807
|
+
class: j(o.value + " " + (l.width ? e(ye).getWidthClass(l.width) : "w-full"))
|
808
808
|
}, [
|
809
809
|
a("span", {
|
810
|
-
class:
|
811
|
-
},
|
810
|
+
class: j(["truncate text-ellipsis block", l.width ? e(ye).getWidthClass(l.width - 50) : "w-full"])
|
811
|
+
}, K(c.value), 3),
|
812
812
|
I(be, { class: "h-4 w-4" }),
|
813
813
|
(Array.isArray(l.currentValue) ? l.currentValue === null || l.currentValue.length > 0 : l.currentValue === null || l.currentValue) && l.layout === "inline" ? (p(), k("span", Wt)) : S("", !0)
|
814
814
|
], 10, Yt),
|
815
|
-
_.value ? (p(),
|
815
|
+
_.value ? (p(), z(Ie, {
|
816
816
|
key: 0,
|
817
817
|
to: "body"
|
818
818
|
}, [
|
@@ -820,12 +820,12 @@ const Ut = {
|
|
820
820
|
ref_key: "popperRef",
|
821
821
|
ref: b,
|
822
822
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
823
|
-
style:
|
823
|
+
style: ke({ top: `${s.value.top}px`, left: `${s.value.left}px` }),
|
824
824
|
"data-inside-popover": ""
|
825
825
|
}, [
|
826
826
|
a("div", qt, [
|
827
827
|
a("div", Nt, [
|
828
|
-
|
828
|
+
te(l.$slots, "default")
|
829
829
|
])
|
830
830
|
])
|
831
831
|
], 4), [
|
@@ -838,83 +838,83 @@ const Ut = {
|
|
838
838
|
function Gt(i) {
|
839
839
|
return String(i).charAt(0).toUpperCase() + String(i).slice(1);
|
840
840
|
}
|
841
|
-
class
|
842
|
-
static format(
|
843
|
-
const
|
844
|
-
return `${
|
845
|
-
}
|
846
|
-
static getShiftedDay(
|
847
|
-
const
|
848
|
-
return
|
849
|
-
}
|
850
|
-
static getLastWeekRange(
|
851
|
-
if (
|
852
|
-
const w = new Date(
|
853
|
-
return w.setDate(w.getDate() +
|
841
|
+
class G {
|
842
|
+
static format(n) {
|
843
|
+
const u = n.getFullYear(), o = (n.getMonth() + 1).toString().padStart(2, "0"), t = n.getDate().toString().padStart(2, "0");
|
844
|
+
return `${u}-${o}-${t}`;
|
845
|
+
}
|
846
|
+
static getShiftedDay(n, u = 0) {
|
847
|
+
const o = n ? new Date(n) : /* @__PURE__ */ new Date();
|
848
|
+
return o.setDate(o.getDate() + u), this.format(o);
|
849
|
+
}
|
850
|
+
static getLastWeekRange(n, u, o = 0) {
|
851
|
+
if (n && u) {
|
852
|
+
const w = new Date(n), m = new Date(u);
|
853
|
+
return w.setDate(w.getDate() + o * 7), m.setDate(m.getDate() + o * 7), [this.format(w), this.format(m)];
|
854
854
|
}
|
855
|
-
const t = /* @__PURE__ */ new Date(), s = t.getDay(), v = s === 0 ? 13 : s - 1 + 7,
|
856
|
-
|
857
|
-
const b = new Date(
|
858
|
-
return b.setDate(
|
855
|
+
const t = /* @__PURE__ */ new Date(), s = t.getDay(), v = s === 0 ? 13 : s - 1 + 7, h = new Date(t);
|
856
|
+
h.setDate(t.getDate() - v + o * 7);
|
857
|
+
const b = new Date(h);
|
858
|
+
return b.setDate(h.getDate() + 6), [this.format(h), this.format(b)];
|
859
859
|
}
|
860
|
-
static getMonthRange(
|
860
|
+
static getMonthRange(n, u, o = 0) {
|
861
861
|
let t;
|
862
|
-
|
862
|
+
n ? t = new Date(n) : t = /* @__PURE__ */ new Date(), t = new Date(t.getFullYear(), t.getMonth() + o, 1);
|
863
863
|
const s = t, v = new Date(t.getFullYear(), t.getMonth() + 1, 0);
|
864
864
|
return [this.format(s), this.format(v)];
|
865
865
|
}
|
866
|
-
static getQuarterRange(
|
867
|
-
const t =
|
866
|
+
static getQuarterRange(n, u, o = 0) {
|
867
|
+
const t = n || u, s = t ? new Date(t) : /* @__PURE__ */ new Date();
|
868
868
|
let v = Math.floor(s.getMonth() / 3);
|
869
|
-
v +=
|
870
|
-
const
|
869
|
+
v += o;
|
870
|
+
const h = (v % 4 + 4) % 4 * 3, b = s.getFullYear() + Math.floor(v / 4), w = new Date(b, h, 1), m = new Date(b, h + 3, 0);
|
871
871
|
return [this.format(w), this.format(m)];
|
872
872
|
}
|
873
|
-
static getYear(
|
874
|
-
let
|
875
|
-
return
|
873
|
+
static getYear(n, u = 0) {
|
874
|
+
let o;
|
875
|
+
return n && /^\d{4}$/.test(n) ? o = parseInt(n, 10) : n ? o = new Date(n).getFullYear() : o = (/* @__PURE__ */ new Date()).getFullYear(), String(o + u);
|
876
876
|
}
|
877
|
-
static getYearRange(
|
878
|
-
let
|
879
|
-
return
|
880
|
-
this.format(new Date(
|
881
|
-
this.format(new Date(
|
877
|
+
static getYearRange(n, u = 0) {
|
878
|
+
let o;
|
879
|
+
return n && /^\d{4}$/.test(n) ? o = parseInt(n, 10) : n ? o = new Date(n).getFullYear() : o = (/* @__PURE__ */ new Date()).getFullYear(), [
|
880
|
+
this.format(new Date(o + u, 0, 1)),
|
881
|
+
this.format(new Date(o + u + 1, 0, 0))
|
882
882
|
];
|
883
883
|
}
|
884
|
-
static getRangeFromDaysBefore(
|
885
|
-
const
|
886
|
-
return
|
884
|
+
static getRangeFromDaysBefore(n) {
|
885
|
+
const u = /* @__PURE__ */ new Date(), o = new Date(u.getTime());
|
886
|
+
return o.setDate(u.getDate() - n), [this.format(o), this.format(u)];
|
887
887
|
}
|
888
888
|
}
|
889
|
-
function Ge(i,
|
889
|
+
function Ge(i, n) {
|
890
890
|
const {
|
891
|
-
popoverRef:
|
892
|
-
} = i,
|
891
|
+
popoverRef: u
|
892
|
+
} = i, o = V(""), t = V(
|
893
893
|
i.modelValue ?? i.default ?? []
|
894
894
|
), s = V(0);
|
895
895
|
function v() {
|
896
|
-
const
|
897
|
-
return t.value = [...
|
896
|
+
const c = G.getRangeFromDaysBefore(s.value);
|
897
|
+
return t.value = [...c], n("change", { name: i.name, value: t.value }), n("update:modelValue", t.value), c;
|
898
898
|
}
|
899
|
-
function
|
899
|
+
function h(c) {
|
900
900
|
var x;
|
901
|
-
|
901
|
+
o.value = c, (x = u.value) == null || x.close();
|
902
902
|
const l = [];
|
903
|
-
switch (
|
903
|
+
switch (o.value) {
|
904
904
|
case "today":
|
905
|
-
l.push(
|
905
|
+
l.push(G.getShiftedDay()), l.push(G.getShiftedDay());
|
906
906
|
break;
|
907
907
|
case "week":
|
908
|
-
l.push(...
|
908
|
+
l.push(...G.getLastWeekRange());
|
909
909
|
break;
|
910
910
|
case "month":
|
911
|
-
l.push(...
|
911
|
+
l.push(...G.getMonthRange());
|
912
912
|
break;
|
913
913
|
case "quarter":
|
914
|
-
l.push(...
|
914
|
+
l.push(...G.getQuarterRange());
|
915
915
|
break;
|
916
916
|
case "year":
|
917
|
-
l.push(...
|
917
|
+
l.push(...G.getYearRange());
|
918
918
|
break;
|
919
919
|
case "last_7_days":
|
920
920
|
s.value = 7, v();
|
@@ -923,49 +923,49 @@ function Ge(i, o) {
|
|
923
923
|
s.value = 7, l.push(...v());
|
924
924
|
break;
|
925
925
|
}
|
926
|
-
t.value = [...l],
|
926
|
+
t.value = [...l], n("change", { name: i.name, value: t.value }), n("update:modelValue", t.value);
|
927
927
|
}
|
928
928
|
function b() {
|
929
|
-
const
|
930
|
-
switch (
|
929
|
+
const c = [];
|
930
|
+
switch (o.value) {
|
931
931
|
case "today":
|
932
|
-
|
932
|
+
c.push(G.getShiftedDay(t.value[0], 1));
|
933
933
|
break;
|
934
934
|
case "week":
|
935
|
-
|
935
|
+
c.push(...G.getLastWeekRange(t.value[0], t.value[1], 1));
|
936
936
|
break;
|
937
937
|
case "month":
|
938
|
-
|
938
|
+
c.push(...G.getMonthRange(t.value[0], t.value[1], 1));
|
939
939
|
break;
|
940
940
|
case "quarter":
|
941
|
-
|
941
|
+
c.push(...G.getQuarterRange(t.value[0], t.value[1], 1));
|
942
942
|
break;
|
943
943
|
case "year":
|
944
|
-
|
944
|
+
c.push(...G.getYearRange(t.value[0], 1));
|
945
945
|
break;
|
946
946
|
}
|
947
|
-
t.value = [...
|
947
|
+
t.value = [...c], n("change", { name: i.name, value: t.value }), n("update:modelValue", t.value);
|
948
948
|
}
|
949
949
|
function w() {
|
950
|
-
const
|
951
|
-
switch (
|
950
|
+
const c = [];
|
951
|
+
switch (o.value) {
|
952
952
|
case "today":
|
953
|
-
|
953
|
+
c.push(G.getShiftedDay(t.value[0], -1));
|
954
954
|
break;
|
955
955
|
case "week":
|
956
|
-
|
956
|
+
c.push(...G.getLastWeekRange(t.value[0], t.value[1], -1));
|
957
957
|
break;
|
958
958
|
case "month":
|
959
|
-
|
959
|
+
c.push(...G.getMonthRange(t.value[0], t.value[1], -1));
|
960
960
|
break;
|
961
961
|
case "quarter":
|
962
|
-
|
962
|
+
c.push(...G.getQuarterRange(t.value[0], t.value[1], -1));
|
963
963
|
break;
|
964
964
|
case "year":
|
965
|
-
|
965
|
+
c.push(...G.getYearRange(t.value[0], -1));
|
966
966
|
break;
|
967
967
|
}
|
968
|
-
t.value = [...
|
968
|
+
t.value = [...c], n("change", { name: i.name, value: t.value }), n("update:modelValue", t.value);
|
969
969
|
}
|
970
970
|
const m = [
|
971
971
|
"Січень",
|
@@ -981,29 +981,29 @@ function Ge(i, o) {
|
|
981
981
|
"Листопад",
|
982
982
|
"Грудень"
|
983
983
|
];
|
984
|
-
function
|
985
|
-
const [l, x,
|
986
|
-
return `${
|
984
|
+
function d(c) {
|
985
|
+
const [l, x, g] = c.split("-");
|
986
|
+
return `${g}.${x}.${l}`;
|
987
987
|
}
|
988
|
-
function y(
|
988
|
+
function y(c) {
|
989
989
|
const { value: l } = t;
|
990
|
-
switch (
|
990
|
+
switch (c) {
|
991
991
|
case "today":
|
992
|
-
return
|
992
|
+
return d(l[0]);
|
993
993
|
case "range":
|
994
994
|
return "Період";
|
995
995
|
case "week":
|
996
|
-
return l[0] && l[1] ? `${
|
996
|
+
return l[0] && l[1] ? `${d(l[0])} – ${d(l[1])}` : "";
|
997
997
|
case "quarter":
|
998
998
|
if (l[0]) {
|
999
|
-
const x = new Date(l[0]),
|
1000
|
-
return `${Math.floor(
|
999
|
+
const x = new Date(l[0]), g = x.getFullYear(), r = x.getMonth();
|
1000
|
+
return `${Math.floor(r / 3) + 1} квартал ${g}`;
|
1001
1001
|
}
|
1002
1002
|
return "";
|
1003
1003
|
case "month":
|
1004
1004
|
if (l[0]) {
|
1005
|
-
const [x,
|
1006
|
-
return `${m[parseInt(
|
1005
|
+
const [x, g] = l[0].split("-");
|
1006
|
+
return `${m[parseInt(g, 10) - 1]} ${x}`;
|
1007
1007
|
}
|
1008
1008
|
return "";
|
1009
1009
|
case "year":
|
@@ -1014,23 +1014,23 @@ function Ge(i, o) {
|
|
1014
1014
|
return i.label ?? "";
|
1015
1015
|
}
|
1016
1016
|
}
|
1017
|
-
const _ = E(() =>
|
1018
|
-
function
|
1019
|
-
|
1017
|
+
const _ = E(() => o.value ? y(o.value) : i.label ?? "");
|
1018
|
+
function f() {
|
1019
|
+
o.value = "", t.value = [], n("update:modelValue", []), n("clear", i.name);
|
1020
1020
|
}
|
1021
1021
|
return {
|
1022
|
-
activeMode:
|
1022
|
+
activeMode: o,
|
1023
1023
|
innerValue: t,
|
1024
1024
|
daysBefore: s,
|
1025
1025
|
onDaysBeforeChange: v,
|
1026
|
-
onSelectChange:
|
1026
|
+
onSelectChange: h,
|
1027
1027
|
nextClick: b,
|
1028
1028
|
prevClick: w,
|
1029
1029
|
ukMonths: m,
|
1030
|
-
formatDisplayDate:
|
1030
|
+
formatDisplayDate: d,
|
1031
1031
|
getModeLabel: y,
|
1032
1032
|
currentLabel: _,
|
1033
|
-
clear:
|
1033
|
+
clear: f
|
1034
1034
|
};
|
1035
1035
|
}
|
1036
1036
|
const Qt = {
|
@@ -1048,7 +1048,7 @@ const Qt = {
|
|
1048
1048
|
}, al = {
|
1049
1049
|
key: 0,
|
1050
1050
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
1051
|
-
}, ol = ["min", "disabled"],
|
1051
|
+
}, ol = ["min", "disabled"], nl = { class: "flex gap-1 pt-2" }, rl = ["onClick"], il = /* @__PURE__ */ Y({
|
1052
1052
|
__name: "date-input",
|
1053
1053
|
props: {
|
1054
1054
|
id: {},
|
@@ -1074,148 +1074,148 @@ const Qt = {
|
|
1074
1074
|
sort: {}
|
1075
1075
|
},
|
1076
1076
|
emits: ["update:modelValue", "change", "clear"],
|
1077
|
-
setup(i, { expose:
|
1078
|
-
const
|
1077
|
+
setup(i, { expose: n, emit: u }) {
|
1078
|
+
const o = i, t = qe(), s = Lt(), v = u, h = V(null), {
|
1079
1079
|
activeMode: b,
|
1080
1080
|
innerValue: w,
|
1081
1081
|
onSelectChange: m,
|
1082
|
-
nextClick:
|
1082
|
+
nextClick: d,
|
1083
1083
|
prevClick: y,
|
1084
1084
|
clear: _
|
1085
1085
|
} = Ge({
|
1086
|
-
...
|
1087
|
-
popoverRef:
|
1086
|
+
...o,
|
1087
|
+
popoverRef: h
|
1088
1088
|
}, v);
|
1089
|
-
return D(() =>
|
1090
|
-
|
1091
|
-
}),
|
1089
|
+
return D(() => o.modelValue, (f) => {
|
1090
|
+
f !== void 0 ? (w.value = f, v("update:modelValue", f)) : (b.value = "", w.value = []);
|
1091
|
+
}), n({
|
1092
1092
|
clear: _,
|
1093
|
-
popoverRef:
|
1094
|
-
}), (
|
1095
|
-
|
1093
|
+
popoverRef: h
|
1094
|
+
}), (f, c) => (p(), k(F, null, [
|
1095
|
+
f.layout === "inline" ? (p(), k("div", Qt, [
|
1096
1096
|
e(b) !== "" && e(b) === "range" ? (p(), k("div", Zt, [
|
1097
1097
|
P(a("input", {
|
1098
1098
|
type: "date",
|
1099
1099
|
max: e(w)[1],
|
1100
1100
|
locale: "uk-UA",
|
1101
|
-
"onUpdate:modelValue":
|
1101
|
+
"onUpdate:modelValue": c[0] || (c[0] = (l) => e(w)[0] = l),
|
1102
1102
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
1103
|
-
disabled:
|
1103
|
+
disabled: f.disabled
|
1104
1104
|
}, null, 8, Jt), [
|
1105
|
-
[
|
1105
|
+
[le, e(w)[0]]
|
1106
1106
|
]),
|
1107
1107
|
P(a("input", {
|
1108
1108
|
type: "date",
|
1109
1109
|
min: e(w)[0],
|
1110
1110
|
locale: "uk-UA",
|
1111
|
-
"onUpdate:modelValue":
|
1111
|
+
"onUpdate:modelValue": c[1] || (c[1] = (l) => e(w)[1] = l),
|
1112
1112
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
1113
|
-
disabled:
|
1113
|
+
disabled: f.disabled
|
1114
1114
|
}, null, 8, Xt), [
|
1115
|
-
[
|
1115
|
+
[le, e(w)[1]]
|
1116
1116
|
])
|
1117
1117
|
])) : S("", !0)
|
1118
1118
|
])) : S("", !0),
|
1119
1119
|
a("div", {
|
1120
|
-
class:
|
1120
|
+
class: j(f.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
1121
1121
|
}, [
|
1122
1122
|
a("div", {
|
1123
|
-
class:
|
1123
|
+
class: j(f.layout !== "popover" ? "w-[48%]" : "")
|
1124
1124
|
}, [
|
1125
|
-
|
1125
|
+
f.layout === "popover" ? (p(), k("label", el, "Від")) : S("", !0),
|
1126
1126
|
P(a("input", {
|
1127
1127
|
type: "date",
|
1128
1128
|
max: e(w)[1],
|
1129
1129
|
locale: "uk-UA",
|
1130
|
-
"onUpdate:modelValue":
|
1131
|
-
class:
|
1132
|
-
disabled:
|
1130
|
+
"onUpdate:modelValue": c[2] || (c[2] = (l) => e(w)[0] = l),
|
1131
|
+
class: j(e(t)),
|
1132
|
+
disabled: f.disabled
|
1133
1133
|
}, null, 10, tl), [
|
1134
|
-
[
|
1134
|
+
[le, e(w)[0]]
|
1135
1135
|
])
|
1136
1136
|
], 2),
|
1137
|
-
|
1137
|
+
f.layout !== "popover" ? (p(), k("label", ll, " - ")) : S("", !0),
|
1138
1138
|
a("div", {
|
1139
|
-
class:
|
1139
|
+
class: j(f.layout !== "popover" ? "w-[48%]" : "")
|
1140
1140
|
}, [
|
1141
|
-
|
1141
|
+
f.layout === "popover" ? (p(), k("label", al, "До")) : S("", !0),
|
1142
1142
|
P(a("input", {
|
1143
1143
|
type: "date",
|
1144
1144
|
min: e(w)[0],
|
1145
1145
|
locale: "uk-UA",
|
1146
|
-
"onUpdate:modelValue":
|
1147
|
-
class:
|
1148
|
-
disabled:
|
1146
|
+
"onUpdate:modelValue": c[3] || (c[3] = (l) => e(w)[1] = l),
|
1147
|
+
class: j(e(t)),
|
1148
|
+
disabled: f.disabled
|
1149
1149
|
}, null, 10, ol), [
|
1150
|
-
[
|
1150
|
+
[le, e(w)[1]]
|
1151
1151
|
])
|
1152
1152
|
], 2)
|
1153
1153
|
], 2),
|
1154
|
-
a("div",
|
1155
|
-
(p(), k(
|
1154
|
+
a("div", nl, [
|
1155
|
+
(p(), k(F, null, N(["today", "week", "month", "quarter", "year"], (l) => a("button", {
|
1156
1156
|
key: l,
|
1157
|
-
class:
|
1157
|
+
class: j(e(s) + (e(b) === l ? " bg-blue-100" : "")),
|
1158
1158
|
onClick: (x) => e(m)(l)
|
1159
|
-
},
|
1159
|
+
}, K(e(Gt)(l)), 11, rl)), 64)),
|
1160
1160
|
a("button", {
|
1161
|
-
class:
|
1162
|
-
onClick:
|
1161
|
+
class: j(e(s)),
|
1162
|
+
onClick: c[4] || (c[4] = //@ts-ignore
|
1163
1163
|
(...l) => e(y) && e(y)(...l))
|
1164
1164
|
}, " <", 2),
|
1165
1165
|
a("button", {
|
1166
|
-
class:
|
1167
|
-
onClick:
|
1168
|
-
(...l) => e(
|
1166
|
+
class: j(e(s)),
|
1167
|
+
onClick: c[5] || (c[5] = //@ts-ignore
|
1168
|
+
(...l) => e(d) && e(d)(...l))
|
1169
1169
|
}, " >", 2)
|
1170
1170
|
]),
|
1171
|
-
(
|
1171
|
+
(f.cleanable, S("", !0))
|
1172
1172
|
], 64));
|
1173
1173
|
}
|
1174
1174
|
});
|
1175
|
-
function sl(i,
|
1175
|
+
function sl(i, n) {
|
1176
1176
|
const {
|
1177
|
-
api:
|
1178
|
-
options:
|
1177
|
+
api: u,
|
1178
|
+
options: o = [],
|
1179
1179
|
limit: t = 20,
|
1180
1180
|
dataKey: s = "data"
|
1181
1181
|
} = i, v = i.multi;
|
1182
|
-
function
|
1183
|
-
return v ? Array.isArray(
|
1184
|
-
}
|
1185
|
-
const b = V(
|
1186
|
-
function
|
1187
|
-
const O =
|
1188
|
-
return { autoValueKey: Q, autoLabelKey:
|
1189
|
-
}
|
1190
|
-
if (
|
1191
|
-
const
|
1192
|
-
y.value =
|
1193
|
-
}
|
1194
|
-
const
|
1195
|
-
if (
|
1196
|
-
const
|
1197
|
-
if (i.layout === "popover") return
|
1182
|
+
function h(M) {
|
1183
|
+
return v ? Array.isArray(M) ? M : M ? [M] : [] : Array.isArray(M) ? M[0] : M;
|
1184
|
+
}
|
1185
|
+
const b = V(h(i.modelValue)), w = V(""), m = V(!1), d = V([]), y = V("id"), _ = V("text"), f = V(!1), c = V(i.layout !== "popover" && o.length > t), l = V([]), x = V(0);
|
1186
|
+
function g(M) {
|
1187
|
+
const O = M.find(Boolean) ?? {}, Q = ["id", "value", "code", "key"].find((oe) => oe in O) ?? "id", ce = ["text", "label", "name", "title"].find((oe) => oe in O) ?? "text";
|
1188
|
+
return { autoValueKey: Q, autoLabelKey: ce };
|
1189
|
+
}
|
1190
|
+
if (o.length > 0) {
|
1191
|
+
const M = g(o);
|
1192
|
+
y.value = M.autoValueKey, _.value = M.autoLabelKey;
|
1193
|
+
}
|
1194
|
+
const r = E(() => {
|
1195
|
+
if (u) return d.value;
|
1196
|
+
const M = d.value;
|
1197
|
+
if (i.layout === "popover") return M;
|
1198
1198
|
if (!w.value)
|
1199
|
-
return
|
1199
|
+
return f.value ? M : M.slice(0, t);
|
1200
1200
|
const O = w.value.toLowerCase();
|
1201
|
-
return
|
1201
|
+
return M.filter((Q) => Q[_.value].toLowerCase().includes(O));
|
1202
1202
|
});
|
1203
1203
|
let C = null;
|
1204
|
-
async function M
|
1205
|
-
if (
|
1204
|
+
async function $(M) {
|
1205
|
+
if (u) {
|
1206
1206
|
m.value = !0;
|
1207
1207
|
try {
|
1208
|
-
const O = new URL(
|
1209
|
-
O.searchParams.set("json", "1"), O.searchParams.set("key",
|
1208
|
+
const O = new URL(u, window.location.origin);
|
1209
|
+
O.searchParams.set("json", "1"), O.searchParams.set("key", M), O.searchParams.set("limit", t.toString());
|
1210
1210
|
const Q = await fetch(O.toString());
|
1211
1211
|
if (!Q.ok)
|
1212
1212
|
throw new Error(`HTTP error! status: ${Q.status}`);
|
1213
|
-
const
|
1214
|
-
if (
|
1215
|
-
const
|
1216
|
-
y.value =
|
1213
|
+
const ce = await Q.json();
|
1214
|
+
if (d.value = ce[s], d.value.length > 0) {
|
1215
|
+
const oe = g(d.value);
|
1216
|
+
y.value = oe.autoValueKey, _.value = oe.autoLabelKey;
|
1217
1217
|
}
|
1218
|
-
x.value =
|
1218
|
+
x.value = ce.total;
|
1219
1219
|
} catch (O) {
|
1220
1220
|
console.error("Failed to fetch remote options:", O);
|
1221
1221
|
} finally {
|
@@ -1223,76 +1223,76 @@ function sl(i, o) {
|
|
1223
1223
|
}
|
1224
1224
|
}
|
1225
1225
|
}
|
1226
|
-
D(w, (
|
1227
|
-
|
1228
|
-
M
|
1226
|
+
D(w, (M) => {
|
1227
|
+
u && (C && clearTimeout(C), C = setTimeout(() => {
|
1228
|
+
$(M);
|
1229
1229
|
}, 200));
|
1230
|
-
}), D(() => i.modelValue, (
|
1231
|
-
b.value =
|
1232
|
-
}, { immediate: !0 }),
|
1233
|
-
function
|
1234
|
-
return v && Array.isArray(b.value) ? b.value.includes(
|
1230
|
+
}), D(() => i.modelValue, (M) => {
|
1231
|
+
b.value = h(M);
|
1232
|
+
}, { immediate: !0 }), u ? $("") : d.value = o;
|
1233
|
+
function B(M) {
|
1234
|
+
return v && Array.isArray(b.value) ? b.value.includes(M[y.value]) : b.value && b.value === M[y.value];
|
1235
1235
|
}
|
1236
|
-
function A(
|
1236
|
+
function A(M) {
|
1237
1237
|
if (v && !Array.isArray(b.value) && (b.value = []), v && Array.isArray(b.value)) {
|
1238
|
-
const O = b.value.includes(
|
1239
|
-
b.value = O ? b.value.filter((Q) => Q !==
|
1238
|
+
const O = b.value.includes(M[y.value]);
|
1239
|
+
b.value = O ? b.value.filter((Q) => Q !== M[y.value]) : [...b.value, M[y.value]], l.value = O ? l.value.filter((Q) => Q !== M[_.value]) : [...l.value, M[_.value]];
|
1240
1240
|
} else
|
1241
|
-
b.value =
|
1242
|
-
|
1241
|
+
b.value = M[y.value], l.value = M[_.value];
|
1242
|
+
n("update:modelValue", b.value), n("change", { name: i.name, value: b.value });
|
1243
1243
|
}
|
1244
1244
|
function T() {
|
1245
|
-
v ? (b.value = [], l.value = []) : (b.value = void 0, l.value = []),
|
1245
|
+
v ? (b.value = [], l.value = []) : (b.value = void 0, l.value = []), n("update:modelValue", b.value), n("clear", i.name);
|
1246
1246
|
}
|
1247
1247
|
function U() {
|
1248
|
-
C && clearTimeout(C), w.value = "",
|
1248
|
+
C && clearTimeout(C), w.value = "", f.value = !1;
|
1249
1249
|
}
|
1250
|
-
function
|
1251
|
-
|
1250
|
+
function fe() {
|
1251
|
+
f.value = !f.value;
|
1252
1252
|
}
|
1253
|
-
|
1253
|
+
ge(() => {
|
1254
1254
|
C && clearTimeout(C);
|
1255
1255
|
});
|
1256
1256
|
const J = V(-1);
|
1257
|
-
D(
|
1258
|
-
J.value =
|
1257
|
+
D(r, () => {
|
1258
|
+
J.value = r.value.length > 0 ? 0 : -1;
|
1259
1259
|
});
|
1260
|
-
function H(
|
1261
|
-
const O =
|
1262
|
-
if (
|
1263
|
-
|
1264
|
-
else if (
|
1265
|
-
|
1266
|
-
else if (
|
1267
|
-
const Q =
|
1260
|
+
function H(M) {
|
1261
|
+
const O = r.value.length;
|
1262
|
+
if (M.key === "ArrowDown")
|
1263
|
+
M.preventDefault(), J.value = (J.value + 1) % O;
|
1264
|
+
else if (M.key === "ArrowUp")
|
1265
|
+
M.preventDefault(), J.value = (J.value - 1 + O) % O;
|
1266
|
+
else if (M.key === "Enter" && (M.preventDefault(), J.value >= 0 && J.value < r.value.length)) {
|
1267
|
+
const Q = r.value[J.value];
|
1268
1268
|
A(Q);
|
1269
1269
|
}
|
1270
1270
|
}
|
1271
1271
|
return {
|
1272
1272
|
innerValue: b,
|
1273
1273
|
searchTerm: w,
|
1274
|
-
filteredOptions:
|
1275
|
-
isSelected:
|
1274
|
+
filteredOptions: r,
|
1275
|
+
isSelected: B,
|
1276
1276
|
selectItem: A,
|
1277
1277
|
clear: T,
|
1278
1278
|
resetSearch: U,
|
1279
|
-
toggleShowAll:
|
1279
|
+
toggleShowAll: fe,
|
1280
1280
|
isReqProc: m,
|
1281
|
-
showAll:
|
1282
|
-
isEnableShowAll:
|
1281
|
+
showAll: f,
|
1282
|
+
isEnableShowAll: c,
|
1283
1283
|
labelKey: _,
|
1284
1284
|
valueKey: y,
|
1285
|
-
allOptions:
|
1285
|
+
allOptions: d,
|
1286
1286
|
highlightedIndex: J,
|
1287
1287
|
onKeyDown: H,
|
1288
1288
|
selectedLabels: l,
|
1289
1289
|
totalCount: x
|
1290
1290
|
};
|
1291
1291
|
}
|
1292
|
-
const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" },
|
1292
|
+
const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, cl = {
|
1293
1293
|
key: 0,
|
1294
1294
|
class: "w-full"
|
1295
|
-
},
|
1295
|
+
}, dl = { class: "flex flex-col items-center justify-center p-5 text-center" }, pl = {
|
1296
1296
|
key: 0,
|
1297
1297
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
1298
1298
|
}, fl = {
|
@@ -1324,54 +1324,54 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1324
1324
|
sort: {}
|
1325
1325
|
},
|
1326
1326
|
emits: ["update:modelValue", "change", "clear"],
|
1327
|
-
setup(i, { expose:
|
1328
|
-
const
|
1327
|
+
setup(i, { expose: n, emit: u }) {
|
1328
|
+
const o = i, t = u, s = V(null), {
|
1329
1329
|
innerValue: v,
|
1330
|
-
filteredOptions:
|
1330
|
+
filteredOptions: h,
|
1331
1331
|
isSelected: b,
|
1332
1332
|
selectItem: w,
|
1333
1333
|
clear: m,
|
1334
|
-
resetSearch:
|
1334
|
+
resetSearch: d,
|
1335
1335
|
toggleShowAll: y,
|
1336
1336
|
isReqProc: _,
|
1337
|
-
showAll:
|
1338
|
-
isEnableShowAll:
|
1337
|
+
showAll: f,
|
1338
|
+
isEnableShowAll: c,
|
1339
1339
|
searchTerm: l,
|
1340
1340
|
labelKey: x,
|
1341
|
-
valueKey:
|
1342
|
-
highlightedIndex:
|
1341
|
+
valueKey: g,
|
1342
|
+
highlightedIndex: r,
|
1343
1343
|
onKeyDown: C,
|
1344
|
-
selectedLabels:
|
1345
|
-
totalCount:
|
1344
|
+
selectedLabels: $,
|
1345
|
+
totalCount: B
|
1346
1346
|
} = sl({
|
1347
|
-
...
|
1348
|
-
modelValue:
|
1347
|
+
...o,
|
1348
|
+
modelValue: o.modelValue
|
1349
1349
|
}, t);
|
1350
|
-
|
1351
|
-
|
1350
|
+
pe(() => {
|
1351
|
+
d();
|
1352
1352
|
}), D(
|
1353
|
-
() =>
|
1353
|
+
() => o.modelValue,
|
1354
1354
|
(T) => {
|
1355
|
-
T === void 0 && (
|
1355
|
+
T === void 0 && (o.multi ? v.value = [] : v.value = void 0);
|
1356
1356
|
}
|
1357
1357
|
);
|
1358
1358
|
const A = V([]);
|
1359
|
-
return D(
|
1359
|
+
return D(r, (T) => {
|
1360
1360
|
var U;
|
1361
1361
|
T >= 0 && A.value[T] && ((U = A.value[T]) == null || U.scrollIntoView({
|
1362
1362
|
block: "nearest",
|
1363
1363
|
behavior: "smooth"
|
1364
1364
|
}));
|
1365
|
-
}), D(
|
1365
|
+
}), D(h, () => {
|
1366
1366
|
A.value = [];
|
1367
|
-
}),
|
1367
|
+
}), n({
|
1368
1368
|
clear: m,
|
1369
1369
|
inputTextRef: s,
|
1370
|
-
selectedLabels:
|
1370
|
+
selectedLabels: $
|
1371
1371
|
}), (T, U) => {
|
1372
|
-
var
|
1372
|
+
var fe, J;
|
1373
1373
|
return p(), k("div", {
|
1374
|
-
class:
|
1374
|
+
class: j([T.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
1375
1375
|
}, [
|
1376
1376
|
a("div", ul, [
|
1377
1377
|
P(a("input", {
|
@@ -1384,7 +1384,7 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1384
1384
|
ref_key: "inputTextRef",
|
1385
1385
|
ref: s
|
1386
1386
|
}, null, 544), [
|
1387
|
-
[
|
1387
|
+
[le, e(l)]
|
1388
1388
|
]),
|
1389
1389
|
I(Ye, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
1390
1390
|
I(We, {
|
@@ -1393,27 +1393,27 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1393
1393
|
})
|
1394
1394
|
]),
|
1395
1395
|
a("div", {
|
1396
|
-
class:
|
1396
|
+
class: j([
|
1397
1397
|
T.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
1398
1398
|
T.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
1399
1399
|
])
|
1400
1400
|
}, [
|
1401
|
-
(p(!0), k(
|
1401
|
+
(p(!0), k(F, null, N(e(h), (H, M) => (p(), z(Ce, {
|
1402
1402
|
layout: T.layout,
|
1403
1403
|
count: H.count,
|
1404
1404
|
label: H[e(x)],
|
1405
1405
|
color: H.color,
|
1406
1406
|
type: T.multi ? "checkbox" : "radio",
|
1407
|
-
value: H[e(
|
1407
|
+
value: H[e(g)],
|
1408
1408
|
"is-selected": e(b)(H),
|
1409
|
-
highlighted:
|
1409
|
+
highlighted: M === e(r),
|
1410
1410
|
onItemClick: (O) => e(w)(H),
|
1411
1411
|
ref_for: !0,
|
1412
|
-
ref: (O) => A.value[
|
1412
|
+
ref: (O) => A.value[M] = O == null ? void 0 : O.el
|
1413
1413
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
1414
1414
|
], 2),
|
1415
|
-
T.type === "select" && e(
|
1416
|
-
a("div",
|
1415
|
+
T.type === "select" && e(h).length === 0 && !e(_) ? (p(), k("div", cl, [
|
1416
|
+
a("div", dl, [
|
1417
1417
|
I(Ve),
|
1418
1418
|
U[7] || (U[7] = a("div", { class: "max-w-sm mx-auto mt-6" }, [
|
1419
1419
|
a("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
@@ -1421,8 +1421,8 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1421
1421
|
], -1))
|
1422
1422
|
])
|
1423
1423
|
])) : S("", !0),
|
1424
|
-
T.layout !== "popover" && T.type !== "select" ? (p(), k(
|
1425
|
-
!e(
|
1424
|
+
T.layout !== "popover" && T.type !== "select" ? (p(), k(F, { key: 1 }, [
|
1425
|
+
!e(f) && e(c) ? (p(), k("div", {
|
1426
1426
|
key: 0,
|
1427
1427
|
onClick: U[3] || (U[3] = //@ts-ignore
|
1428
1428
|
(...H) => e(y) && e(y)(...H)),
|
@@ -1431,7 +1431,7 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1431
1431
|
U[8] || (U[8] = W(" Показати більше ", -1)),
|
1432
1432
|
I(be)
|
1433
1433
|
])) : S("", !0),
|
1434
|
-
e(
|
1434
|
+
e(f) ? (p(), k("div", {
|
1435
1435
|
key: 1,
|
1436
1436
|
onClick: U[4] || (U[4] = //@ts-ignore
|
1437
1437
|
(...H) => e(y) && e(y)(...H)),
|
@@ -1441,9 +1441,9 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1441
1441
|
I(Se)
|
1442
1442
|
])) : S("", !0)
|
1443
1443
|
], 64)) : S("", !0),
|
1444
|
-
T.cleanable ? (p(), k(
|
1444
|
+
T.cleanable ? (p(), k(F, { key: 2 }, [
|
1445
1445
|
T.layout === "inline" ? (p(), k("div", pl, [
|
1446
|
-
W(
|
1446
|
+
W(K(T.multi && Array.isArray(e(v)) ? (fe = e(v)) == null ? void 0 : fe.length : e(v) !== void 0 && (e(v) || e(v) === null) ? 1 : 0) + " з " + K(e(B)) + " обрано ", 1),
|
1447
1447
|
P(a("button", {
|
1448
1448
|
class: "text-gray-600 hover:text-gray-800",
|
1449
1449
|
onClick: U[5] || (U[5] = //@ts-ignore
|
@@ -1453,7 +1453,7 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1453
1453
|
])
|
1454
1454
|
])) : S("", !0),
|
1455
1455
|
T.layout === "popover" ? (p(), k("div", fl, [
|
1456
|
-
a("span", null,
|
1456
|
+
a("span", null, K(T.multi && Array.isArray(e(v)) ? (J = e(v)) == null ? void 0 : J.length : e(v) !== void 0 && (e(v) || e(v) === null) ? 1 : 0) + " з " + K(e(B)) + " обрано", 1),
|
1457
1457
|
P(a("button", {
|
1458
1458
|
class: "text-gray-600 hover:text-gray-800",
|
1459
1459
|
onClick: U[6] || (U[6] = //@ts-ignore
|
@@ -1466,7 +1466,7 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1466
1466
|
], 2);
|
1467
1467
|
};
|
1468
1468
|
}
|
1469
|
-
}), ml = ["for", "onClick"],
|
1469
|
+
}), ml = ["for", "onClick"], hl = ["id", "name", "value"], gl = { class: "block" }, bl = {
|
1470
1470
|
key: 0,
|
1471
1471
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
1472
1472
|
}, yl = {
|
@@ -1498,40 +1498,40 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1498
1498
|
sort: {}
|
1499
1499
|
},
|
1500
1500
|
emits: ["update:modelValue", "change", "clear"],
|
1501
|
-
setup(i, { expose:
|
1502
|
-
const
|
1501
|
+
setup(i, { expose: n, emit: u }) {
|
1502
|
+
const o = i, t = u, {
|
1503
1503
|
innerValue: s,
|
1504
1504
|
isSelected: v,
|
1505
|
-
selectItem:
|
1505
|
+
selectItem: h,
|
1506
1506
|
clear: b,
|
1507
1507
|
labelKey: w,
|
1508
1508
|
valueKey: m,
|
1509
|
-
allOptions:
|
1510
|
-
} =
|
1511
|
-
...
|
1512
|
-
modelValue:
|
1509
|
+
allOptions: d
|
1510
|
+
} = o.multi ? Ee({
|
1511
|
+
...o,
|
1512
|
+
modelValue: o.modelValue ?? o.default ?? []
|
1513
1513
|
}, t) : He({
|
1514
|
-
...
|
1515
|
-
modelValue:
|
1514
|
+
...o,
|
1515
|
+
modelValue: o.modelValue !== void 0 ? o.modelValue : o.default ?? ""
|
1516
1516
|
}, t);
|
1517
|
-
return
|
1517
|
+
return n({
|
1518
1518
|
clear: b
|
1519
1519
|
}), D(
|
1520
|
-
() =>
|
1520
|
+
() => o.modelValue,
|
1521
1521
|
(y) => {
|
1522
|
-
y === void 0 && (
|
1522
|
+
y === void 0 && (o.multi ? s.value = [] : s.value = void 0);
|
1523
1523
|
}
|
1524
1524
|
), (y, _) => {
|
1525
|
-
var
|
1526
|
-
return p(), k(
|
1525
|
+
var f, c;
|
1526
|
+
return p(), k(F, null, [
|
1527
1527
|
a("div", {
|
1528
|
-
class:
|
1528
|
+
class: j(["grid grid-cols-3 gap-2 mx-[1px]", y.layout === "popover" ? "m-1" : "mb-1"])
|
1529
1529
|
}, [
|
1530
|
-
(p(!0), k(
|
1530
|
+
(p(!0), k(F, null, N(e(d), (l) => (p(), k("label", {
|
1531
1531
|
key: `item-${l[e(m)]}`,
|
1532
1532
|
for: `item-${l[e(m)]}`,
|
1533
|
-
onClick: Pe((x) => e(
|
1534
|
-
class:
|
1533
|
+
onClick: Pe((x) => e(h)(l), ["stop", "prevent"]),
|
1534
|
+
class: j([e(v)(l) ? "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%)]"])
|
1535
1535
|
}, [
|
1536
1536
|
a("input", {
|
1537
1537
|
type: "checkbox",
|
@@ -1539,13 +1539,13 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1539
1539
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
1540
1540
|
name: `item-${l[e(m)]}`,
|
1541
1541
|
value: l[e(m)]
|
1542
|
-
}, null, 8,
|
1543
|
-
a("span",
|
1542
|
+
}, null, 8, hl),
|
1543
|
+
a("span", gl, K(l[e(w)]), 1)
|
1544
1544
|
], 10, ml))), 128))
|
1545
1545
|
], 2),
|
1546
|
-
y.cleanable ? (p(), k(
|
1546
|
+
y.cleanable ? (p(), k(F, { key: 0 }, [
|
1547
1547
|
y.layout === "inline" ? (p(), k("div", bl, [
|
1548
|
-
W(
|
1548
|
+
W(K(y.multi && Array.isArray(e(s)) ? (f = e(s)) == null ? void 0 : f.length : e(s) !== void 0 && (e(s) || e(s) === null) ? 1 : 0) + " з " + K(e(d).length) + " обрано ", 1),
|
1549
1549
|
P(a("button", {
|
1550
1550
|
class: "text-gray-600 hover:text-gray-800",
|
1551
1551
|
onClick: _[0] || (_[0] = //@ts-ignore
|
@@ -1555,7 +1555,7 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1555
1555
|
])
|
1556
1556
|
])) : S("", !0),
|
1557
1557
|
y.layout === "popover" ? (p(), k("div", yl, [
|
1558
|
-
a("span", null,
|
1558
|
+
a("span", null, K(y.multi && Array.isArray(e(s)) ? (c = e(s)) == null ? void 0 : c.length : e(s) !== void 0 && (e(s) || e(s) === null) ? 1 : 0) + " з " + K(e(d).length) + " обрано", 1),
|
1559
1559
|
P(a("button", {
|
1560
1560
|
class: "text-gray-600 hover:text-gray-800",
|
1561
1561
|
onClick: _[1] || (_[1] = //@ts-ignore
|
@@ -1580,12 +1580,12 @@ const ul = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
1580
1580
|
"stroke-linejoin": "round",
|
1581
1581
|
class: "text-blue-600 w-[16px] h-[16px]"
|
1582
1582
|
};
|
1583
|
-
function
|
1584
|
-
return p(), k("svg", kl,
|
1583
|
+
function _l(i, n) {
|
1584
|
+
return p(), k("svg", kl, n[0] || (n[0] = [
|
1585
1585
|
a("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
1586
1586
|
]));
|
1587
1587
|
}
|
1588
|
-
const
|
1588
|
+
const de = /* @__PURE__ */ ae(wl, [["render", _l]]), Cl = {}, Vl = {
|
1589
1589
|
xmlns: "http://www.w3.org/2000/svg",
|
1590
1590
|
width: "15px",
|
1591
1591
|
height: "24",
|
@@ -1597,8 +1597,8 @@ const se = /* @__PURE__ */ le(wl, [["render", Cl]]), _l = {}, Vl = {
|
|
1597
1597
|
"stroke-linejoin": "round",
|
1598
1598
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
|
1599
1599
|
};
|
1600
|
-
function Sl(i,
|
1601
|
-
return p(), k("svg", Vl,
|
1600
|
+
function Sl(i, n) {
|
1601
|
+
return p(), k("svg", Vl, n[0] || (n[0] = [
|
1602
1602
|
a("path", {
|
1603
1603
|
stroke: "none",
|
1604
1604
|
d: "M0 0h24v24H0z",
|
@@ -1607,7 +1607,7 @@ function Sl(i, o) {
|
|
1607
1607
|
a("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
1608
1608
|
]));
|
1609
1609
|
}
|
1610
|
-
const
|
1610
|
+
const $l = /* @__PURE__ */ ae(Cl, [["render", Sl]]), Ml = {}, Bl = {
|
1611
1611
|
xmlns: "http://www.w3.org/2000/svg",
|
1612
1612
|
width: "15px",
|
1613
1613
|
height: "24",
|
@@ -1619,8 +1619,8 @@ const Ml = /* @__PURE__ */ le(_l, [["render", Sl]]), Bl = {}, $l = {
|
|
1619
1619
|
"stroke-linejoin": "round",
|
1620
1620
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
|
1621
1621
|
};
|
1622
|
-
function Al(i,
|
1623
|
-
return p(), k("svg",
|
1622
|
+
function Al(i, n) {
|
1623
|
+
return p(), k("svg", Bl, n[0] || (n[0] = [
|
1624
1624
|
a("path", {
|
1625
1625
|
stroke: "none",
|
1626
1626
|
d: "M0 0h24v24H0z",
|
@@ -1629,7 +1629,7 @@ function Al(i, o) {
|
|
1629
1629
|
a("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
1630
1630
|
]));
|
1631
1631
|
}
|
1632
|
-
const Rl = /* @__PURE__ */
|
1632
|
+
const Rl = /* @__PURE__ */ ae(Ml, [["render", Al]]), Dl = { class: "flex" }, zl = { class: "mb-1" }, jl = { class: "mb-1" }, Fl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Kl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Ll = {
|
1633
1633
|
key: 1,
|
1634
1634
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
1635
1635
|
}, Ul = ["max", "disabled"], Ol = ["min", "disabled"], Il = /* @__PURE__ */ Y({
|
@@ -1658,123 +1658,123 @@ const Rl = /* @__PURE__ */ le(Bl, [["render", Al]]), Dl = { class: "flex" }, zl
|
|
1658
1658
|
sort: {}
|
1659
1659
|
},
|
1660
1660
|
emits: ["update:modelValue", "change", "clear"],
|
1661
|
-
setup(i, { expose:
|
1662
|
-
const
|
1661
|
+
setup(i, { expose: n, emit: u }) {
|
1662
|
+
const o = i, t = u, s = V(null), {
|
1663
1663
|
activeMode: v,
|
1664
|
-
innerValue:
|
1664
|
+
innerValue: h,
|
1665
1665
|
onSelectChange: b,
|
1666
1666
|
nextClick: w,
|
1667
1667
|
prevClick: m,
|
1668
|
-
currentLabel:
|
1668
|
+
currentLabel: d,
|
1669
1669
|
clear: y
|
1670
1670
|
} = Ge({
|
1671
|
-
...
|
1671
|
+
...o,
|
1672
1672
|
popoverRef: s
|
1673
1673
|
}, t);
|
1674
|
-
return D(() =>
|
1675
|
-
_ !== void 0 ? (
|
1676
|
-
}),
|
1674
|
+
return D(() => o.modelValue, (_) => {
|
1675
|
+
_ !== void 0 ? (h.value = _, t("update:modelValue", _)) : (v.value = "", h.value = []);
|
1676
|
+
}), n({
|
1677
1677
|
clear: y,
|
1678
1678
|
popoverRef: s
|
1679
|
-
}), (_,
|
1679
|
+
}), (_, f) => (p(), k(F, null, [
|
1680
1680
|
a("div", Dl, [
|
1681
|
-
I(
|
1681
|
+
I($e, {
|
1682
1682
|
ref_key: "popoverRef",
|
1683
1683
|
ref: s,
|
1684
|
-
label: e(
|
1685
|
-
"current-value": e(
|
1684
|
+
label: e(d),
|
1685
|
+
"current-value": e(h),
|
1686
1686
|
mode: _.mode,
|
1687
1687
|
onClear: e(y),
|
1688
1688
|
layout: _.layout
|
1689
1689
|
}, {
|
1690
|
-
default:
|
1690
|
+
default: se(() => [
|
1691
1691
|
a("div", null, [
|
1692
1692
|
a("button", {
|
1693
1693
|
type: "button",
|
1694
|
-
onClick:
|
1694
|
+
onClick: f[0] || (f[0] = (c) => e(b)("range")),
|
1695
1695
|
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"
|
1696
1696
|
}, [
|
1697
|
-
|
1698
|
-
e(v) === "range" ? (p(),
|
1697
|
+
f[12] || (f[12] = W(" Період ", -1)),
|
1698
|
+
e(v) === "range" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1699
1699
|
])
|
1700
1700
|
]),
|
1701
|
-
|
1701
|
+
f[19] || (f[19] = a("div", null, [
|
1702
1702
|
a("div", { class: "pt-1 mt-1 border-t" })
|
1703
1703
|
], -1)),
|
1704
1704
|
a("div", null, [
|
1705
1705
|
a("button", {
|
1706
1706
|
type: "button",
|
1707
|
-
onClick:
|
1707
|
+
onClick: f[1] || (f[1] = (c) => e(b)("today")),
|
1708
1708
|
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"
|
1709
1709
|
}, [
|
1710
|
-
|
1711
|
-
e(v) === "today" ? (p(),
|
1710
|
+
f[13] || (f[13] = W(" Сьогодні ", -1)),
|
1711
|
+
e(v) === "today" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1712
1712
|
])
|
1713
1713
|
]),
|
1714
1714
|
a("div", null, [
|
1715
1715
|
a("button", {
|
1716
1716
|
type: "button",
|
1717
|
-
onClick:
|
1717
|
+
onClick: f[2] || (f[2] = (c) => e(b)("week")),
|
1718
1718
|
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"
|
1719
1719
|
}, [
|
1720
|
-
|
1721
|
-
e(v) === "week" ? (p(),
|
1720
|
+
f[14] || (f[14] = W(" Тиждень ", -1)),
|
1721
|
+
e(v) === "week" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1722
1722
|
])
|
1723
1723
|
]),
|
1724
1724
|
a("div", null, [
|
1725
1725
|
a("button", {
|
1726
1726
|
type: "button",
|
1727
|
-
onClick:
|
1727
|
+
onClick: f[3] || (f[3] = (c) => e(b)("month")),
|
1728
1728
|
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"
|
1729
1729
|
}, [
|
1730
|
-
|
1731
|
-
e(v) === "month" ? (p(),
|
1730
|
+
f[15] || (f[15] = W(" Місяць ", -1)),
|
1731
|
+
e(v) === "month" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1732
1732
|
])
|
1733
1733
|
]),
|
1734
1734
|
a("div", null, [
|
1735
1735
|
a("button", {
|
1736
1736
|
type: "button",
|
1737
|
-
onClick:
|
1737
|
+
onClick: f[4] || (f[4] = (c) => e(b)("quarter")),
|
1738
1738
|
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"
|
1739
1739
|
}, [
|
1740
|
-
|
1741
|
-
e(v) === "quarter" ? (p(),
|
1740
|
+
f[16] || (f[16] = W(" Квартал ", -1)),
|
1741
|
+
e(v) === "quarter" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1742
1742
|
])
|
1743
1743
|
]),
|
1744
1744
|
a("div", zl, [
|
1745
1745
|
a("button", {
|
1746
1746
|
type: "button",
|
1747
|
-
onClick:
|
1747
|
+
onClick: f[5] || (f[5] = (c) => e(b)("year")),
|
1748
1748
|
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"
|
1749
1749
|
}, [
|
1750
|
-
|
1751
|
-
e(v) === "year" ? (p(),
|
1750
|
+
f[17] || (f[17] = W(" Рік ", -1)),
|
1751
|
+
e(v) === "year" ? (p(), z(de, { key: 0 })) : S("", !0)
|
1752
1752
|
])
|
1753
1753
|
]),
|
1754
1754
|
a("div", jl, [
|
1755
1755
|
a("button", {
|
1756
1756
|
type: "button",
|
1757
|
-
onClick:
|
1757
|
+
onClick: f[6] || (f[6] = (c) => e(y)()),
|
1758
1758
|
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"
|
1759
1759
|
}, [
|
1760
|
-
|
1761
|
-
e(
|
1760
|
+
f[18] || (f[18] = W(" Весь час ", -1)),
|
1761
|
+
e(h)[0] ? S("", !0) : (p(), z(de, { key: 0 }))
|
1762
1762
|
])
|
1763
1763
|
])
|
1764
1764
|
]),
|
1765
1765
|
_: 1,
|
1766
1766
|
__: [19]
|
1767
1767
|
}, 8, ["label", "current-value", "mode", "onClear", "layout"]),
|
1768
|
-
e(v) !== "" && e(v) !== "range" && e(v) !== "last_7_days" ? (p(), k(
|
1768
|
+
e(v) !== "" && e(v) !== "range" && e(v) !== "last_7_days" ? (p(), k(F, { key: 0 }, [
|
1769
1769
|
a("div", Fl, [
|
1770
1770
|
a("button", {
|
1771
1771
|
type: "button",
|
1772
1772
|
title: "Попередній період",
|
1773
1773
|
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",
|
1774
|
-
onClick:
|
1775
|
-
(...
|
1774
|
+
onClick: f[7] || (f[7] = //@ts-ignore
|
1775
|
+
(...c) => e(m) && e(m)(...c))
|
1776
1776
|
}, [
|
1777
|
-
I(
|
1777
|
+
I($l)
|
1778
1778
|
])
|
1779
1779
|
]),
|
1780
1780
|
a("div", Kl, [
|
@@ -1782,8 +1782,8 @@ const Rl = /* @__PURE__ */ le(Bl, [["render", Al]]), Dl = { class: "flex" }, zl
|
|
1782
1782
|
type: "button",
|
1783
1783
|
title: "Наступний період",
|
1784
1784
|
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",
|
1785
|
-
onClick:
|
1786
|
-
(...
|
1785
|
+
onClick: f[8] || (f[8] = //@ts-ignore
|
1786
|
+
(...c) => e(w) && e(w)(...c))
|
1787
1787
|
}, [
|
1788
1788
|
I(Rl)
|
1789
1789
|
])
|
@@ -1792,23 +1792,23 @@ const Rl = /* @__PURE__ */ le(Bl, [["render", Al]]), Dl = { class: "flex" }, zl
|
|
1792
1792
|
e(v) !== "" && e(v) === "range" ? (p(), k("div", Ll, [
|
1793
1793
|
P(a("input", {
|
1794
1794
|
type: "date",
|
1795
|
-
max: e(
|
1795
|
+
max: e(h)[1],
|
1796
1796
|
locale: "uk-UA",
|
1797
|
-
"onUpdate:modelValue":
|
1797
|
+
"onUpdate:modelValue": f[9] || (f[9] = (c) => e(h)[0] = c),
|
1798
1798
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
1799
1799
|
disabled: _.disabled
|
1800
1800
|
}, null, 8, Ul), [
|
1801
|
-
[
|
1801
|
+
[le, e(h)[0]]
|
1802
1802
|
]),
|
1803
1803
|
P(a("input", {
|
1804
1804
|
type: "date",
|
1805
|
-
min: e(
|
1805
|
+
min: e(h)[0],
|
1806
1806
|
locale: "uk-UA",
|
1807
|
-
"onUpdate:modelValue":
|
1807
|
+
"onUpdate:modelValue": f[10] || (f[10] = (c) => e(h)[1] = c),
|
1808
1808
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
|
1809
1809
|
disabled: _.disabled
|
1810
1810
|
}, null, 8, Ol), [
|
1811
|
-
[
|
1811
|
+
[le, e(h)[1]]
|
1812
1812
|
])
|
1813
1813
|
])) : S("", !0)
|
1814
1814
|
]),
|
@@ -1826,21 +1826,21 @@ const Rl = /* @__PURE__ */ le(Bl, [["render", Al]]), Dl = { class: "flex" }, zl
|
|
1826
1826
|
tag: xl,
|
1827
1827
|
"date:inline": Il
|
1828
1828
|
};
|
1829
|
-
function
|
1830
|
-
let
|
1829
|
+
function Me(i, n) {
|
1830
|
+
let u;
|
1831
1831
|
switch (i.toLowerCase()) {
|
1832
1832
|
case "autocomplete":
|
1833
|
-
|
1833
|
+
u = "select";
|
1834
1834
|
break;
|
1835
1835
|
case "check":
|
1836
|
-
|
1836
|
+
u = "checkbox";
|
1837
1837
|
break;
|
1838
1838
|
default:
|
1839
|
-
|
1839
|
+
u = i == null ? void 0 : i.toString().toLowerCase();
|
1840
1840
|
}
|
1841
|
-
return
|
1842
|
-
component: Ke[
|
1843
|
-
type:
|
1841
|
+
return u === "date" && n && n === "inline" && (u = "date:inline"), {
|
1842
|
+
component: Ke[u] || Ke.text,
|
1843
|
+
type: u
|
1844
1844
|
};
|
1845
1845
|
}
|
1846
1846
|
const Pl = {}, Tl = {
|
@@ -1855,8 +1855,8 @@ const Pl = {}, Tl = {
|
|
1855
1855
|
"stroke-linejoin": "round",
|
1856
1856
|
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"
|
1857
1857
|
};
|
1858
|
-
function Hl(i,
|
1859
|
-
return p(), k("svg", Tl,
|
1858
|
+
function Hl(i, n) {
|
1859
|
+
return p(), k("svg", Tl, n[0] || (n[0] = [
|
1860
1860
|
a("path", {
|
1861
1861
|
stroke: "none",
|
1862
1862
|
d: "M0 0h24v24H0z",
|
@@ -1866,7 +1866,7 @@ function Hl(i, o) {
|
|
1866
1866
|
a("path", { d: "M20 4v5h-5" }, null, -1)
|
1867
1867
|
]));
|
1868
1868
|
}
|
1869
|
-
const El = /* @__PURE__ */
|
1869
|
+
const El = /* @__PURE__ */ ae(Pl, [["render", Hl]]), Yl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Wl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, ql = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Nl = { class: "flex items-center" }, Gl = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Ql = { class: "filter-layout__body" }, Zl = /* @__PURE__ */ Y({
|
1870
1870
|
__name: "vertical-layout",
|
1871
1871
|
props: {
|
1872
1872
|
id: {},
|
@@ -1892,73 +1892,73 @@ const El = /* @__PURE__ */ le(Pl, [["render", Hl]]), Yl = { style: { display: "i
|
|
1892
1892
|
sort: {}
|
1893
1893
|
},
|
1894
1894
|
emits: ["update:modelValue", "change", "clear"],
|
1895
|
-
setup(i, { expose:
|
1896
|
-
const
|
1897
|
-
get: () =>
|
1898
|
-
set: (
|
1895
|
+
setup(i, { expose: n, emit: u }) {
|
1896
|
+
const o = i, t = u, s = V(), v = Me(o.type, o.layout), h = E({
|
1897
|
+
get: () => o.modelValue,
|
1898
|
+
set: (d) => t("update:modelValue", d)
|
1899
1899
|
});
|
1900
|
-
function b(
|
1901
|
-
t("clear",
|
1900
|
+
function b(d) {
|
1901
|
+
t("clear", d);
|
1902
1902
|
}
|
1903
|
-
function w(
|
1904
|
-
t("change", { name:
|
1903
|
+
function w(d, y) {
|
1904
|
+
t("change", { name: d, value: y }), o.modelValue !== void 0 && t("update:modelValue", y);
|
1905
1905
|
}
|
1906
1906
|
function m() {
|
1907
|
-
s.value && s.value.clear(), t("clear",
|
1907
|
+
s.value && s.value.clear(), t("clear", o.name);
|
1908
1908
|
}
|
1909
1909
|
return D(
|
1910
|
-
() =>
|
1911
|
-
(
|
1912
|
-
|
1910
|
+
() => o.default,
|
1911
|
+
(d) => {
|
1912
|
+
h.value = d;
|
1913
1913
|
}
|
1914
1914
|
), D(
|
1915
|
-
() =>
|
1916
|
-
(
|
1917
|
-
|
1915
|
+
() => o.modelValue,
|
1916
|
+
(d) => {
|
1917
|
+
h.value = d;
|
1918
1918
|
}
|
1919
|
-
),
|
1919
|
+
), n({
|
1920
1920
|
filterRef: s
|
1921
|
-
}), (
|
1922
|
-
var _,
|
1921
|
+
}), (d, y) => {
|
1922
|
+
var _, f, c;
|
1923
1923
|
return p(), k("div", Yl, [
|
1924
1924
|
a("div", Wl, [
|
1925
1925
|
a("div", ql, [
|
1926
1926
|
a("div", Nl, [
|
1927
|
-
a("span", Gl,
|
1927
|
+
a("span", Gl, K(d.label), 1)
|
1928
1928
|
]),
|
1929
|
-
typeof
|
1929
|
+
typeof h.value == "string" && h.value.trim() !== "" || Array.isArray(h.value) && h.value.length > 0 && h.value.some((l) => l !== void 0) || h.value === null ? (p(), z(El, {
|
1930
1930
|
key: 0,
|
1931
1931
|
onClick: m
|
1932
1932
|
})) : S("", !0)
|
1933
1933
|
]),
|
1934
1934
|
a("div", Ql, [
|
1935
|
-
((_ = e(v)) == null ? void 0 : _.type) !== "select" ? (p(),
|
1936
|
-
type: (
|
1935
|
+
((_ = e(v)) == null ? void 0 : _.type) !== "select" ? (p(), z(ie((f = e(v)) == null ? void 0 : f.component), Z({ key: 0 }, o, {
|
1936
|
+
type: (c = e(v)) == null ? void 0 : c.type,
|
1937
1937
|
onChange: y[0] || (y[0] = (l) => w(l.name, l.value)),
|
1938
1938
|
onClear: y[1] || (y[1] = (l) => b(l)),
|
1939
1939
|
ref_key: "filterRef",
|
1940
1940
|
ref: s
|
1941
|
-
}), null, 16, ["type"])) : (p(),
|
1941
|
+
}), null, 16, ["type"])) : (p(), z($e, {
|
1942
1942
|
key: 1,
|
1943
|
-
"current-value":
|
1944
|
-
label:
|
1945
|
-
mode:
|
1943
|
+
"current-value": h.value,
|
1944
|
+
label: d.label,
|
1945
|
+
mode: d.mode,
|
1946
1946
|
onClear: m,
|
1947
1947
|
fieldRef: s.value,
|
1948
1948
|
width: void 0,
|
1949
|
-
disabled:
|
1949
|
+
disabled: d.disabled,
|
1950
1950
|
layout: "vertical"
|
1951
1951
|
}, {
|
1952
|
-
default:
|
1952
|
+
default: se(() => {
|
1953
1953
|
var l, x;
|
1954
1954
|
return [
|
1955
|
-
(p(),
|
1955
|
+
(p(), z(ie((l = e(v)) == null ? void 0 : l.component), Z({
|
1956
1956
|
ref_key: "filterRef",
|
1957
1957
|
ref: s
|
1958
|
-
},
|
1958
|
+
}, o, {
|
1959
1959
|
type: (x = e(v)) == null ? void 0 : x.type,
|
1960
|
-
onChange: y[2] || (y[2] = (
|
1961
|
-
onClear: y[3] || (y[3] = (
|
1960
|
+
onChange: y[2] || (y[2] = (g) => w(g.name, g.value)),
|
1961
|
+
onClear: y[3] || (y[3] = (g) => b(g))
|
1962
1962
|
}), null, 16, ["type"]))
|
1963
1963
|
];
|
1964
1964
|
}),
|
@@ -1995,61 +1995,61 @@ const El = /* @__PURE__ */ le(Pl, [["render", Hl]]), Yl = { style: { display: "i
|
|
1995
1995
|
sort: {}
|
1996
1996
|
},
|
1997
1997
|
emits: ["update:modelValue", "change", "clear"],
|
1998
|
-
setup(i, { expose:
|
1999
|
-
const
|
2000
|
-
get: () =>
|
1998
|
+
setup(i, { expose: n, emit: u }) {
|
1999
|
+
const o = i, t = u, s = V(), v = Me(o.type, o.layout), h = E({
|
2000
|
+
get: () => o.modelValue,
|
2001
2001
|
set: (m) => t("update:modelValue", m)
|
2002
2002
|
});
|
2003
|
-
function b(m =
|
2003
|
+
function b(m = o.name) {
|
2004
2004
|
t("clear", m);
|
2005
2005
|
}
|
2006
|
-
function w(m,
|
2007
|
-
t("change", { name: m, value:
|
2006
|
+
function w(m, d) {
|
2007
|
+
t("change", { name: m, value: d }), o.modelValue !== void 0 && t("update:modelValue", d);
|
2008
2008
|
}
|
2009
2009
|
return D(
|
2010
|
-
() =>
|
2010
|
+
() => o.default,
|
2011
2011
|
(m) => {
|
2012
|
-
|
2012
|
+
h.value = m;
|
2013
2013
|
}
|
2014
2014
|
), D(
|
2015
|
-
() =>
|
2015
|
+
() => o.modelValue,
|
2016
2016
|
(m) => {
|
2017
|
-
|
2017
|
+
h.value = m;
|
2018
2018
|
}
|
2019
|
-
),
|
2019
|
+
), n({
|
2020
2020
|
filterRef: s
|
2021
|
-
}), (m,
|
2021
|
+
}), (m, d) => {
|
2022
2022
|
var y, _;
|
2023
|
-
return ["text", "date"].includes(m.type.toLocaleLowerCase()) ? (p(),
|
2023
|
+
return ["text", "date"].includes(m.type.toLocaleLowerCase()) ? (p(), z(ie((y = e(v)) == null ? void 0 : y.component), Z({ key: 0 }, o, {
|
2024
2024
|
type: (_ = e(v)) == null ? void 0 : _.type,
|
2025
|
-
onChange:
|
2026
|
-
onClear:
|
2025
|
+
onChange: d[0] || (d[0] = (f) => w(f.name, f.value)),
|
2026
|
+
onClear: d[1] || (d[1] = (f) => b(f)),
|
2027
2027
|
disabled: m.disabled,
|
2028
|
-
modelValue:
|
2029
|
-
"onUpdate:modelValue":
|
2030
|
-
}), null, 16, ["type", "disabled", "modelValue"])) : (p(),
|
2028
|
+
modelValue: h.value,
|
2029
|
+
"onUpdate:modelValue": d[2] || (d[2] = (f) => h.value = f)
|
2030
|
+
}), null, 16, ["type", "disabled", "modelValue"])) : (p(), z($e, {
|
2031
2031
|
key: 1,
|
2032
|
-
"current-value":
|
2032
|
+
"current-value": h.value,
|
2033
2033
|
label: m.label,
|
2034
2034
|
mode: m.mode,
|
2035
2035
|
onClear: b,
|
2036
2036
|
fieldRef: s.value,
|
2037
|
-
width:
|
2037
|
+
width: o.width,
|
2038
2038
|
disabled: m.disabled,
|
2039
2039
|
layout: "inline"
|
2040
2040
|
}, {
|
2041
|
-
default:
|
2042
|
-
var
|
2041
|
+
default: se(() => {
|
2042
|
+
var f, c;
|
2043
2043
|
return [
|
2044
|
-
(p(),
|
2044
|
+
(p(), z(ie((f = e(v)) == null ? void 0 : f.component), Z({
|
2045
2045
|
ref_key: "filterRef",
|
2046
2046
|
ref: s
|
2047
|
-
},
|
2048
|
-
modelValue:
|
2049
|
-
"onUpdate:modelValue":
|
2050
|
-
type: (
|
2051
|
-
onChange:
|
2052
|
-
onClear:
|
2047
|
+
}, o, {
|
2048
|
+
modelValue: h.value,
|
2049
|
+
"onUpdate:modelValue": d[3] || (d[3] = (l) => h.value = l),
|
2050
|
+
type: (c = e(v)) == null ? void 0 : c.type,
|
2051
|
+
onChange: d[4] || (d[4] = (l) => w(l.name, l.value)),
|
2052
|
+
onClear: d[5] || (d[5] = (l) => b(l))
|
2053
2053
|
}), null, 16, ["modelValue", "type"]))
|
2054
2054
|
];
|
2055
2055
|
}),
|
@@ -2083,48 +2083,48 @@ const El = /* @__PURE__ */ le(Pl, [["render", Hl]]), Yl = { style: { display: "i
|
|
2083
2083
|
sort: {}
|
2084
2084
|
},
|
2085
2085
|
emits: ["update:modelValue", "change", "clear"],
|
2086
|
-
setup(i, { expose:
|
2087
|
-
const
|
2088
|
-
get: () =>
|
2086
|
+
setup(i, { expose: n, emit: u }) {
|
2087
|
+
const o = i, t = u, s = V(), v = V(Me(o.type, o.layout)), h = E({
|
2088
|
+
get: () => o.modelValue,
|
2089
2089
|
set: (m) => t("update:modelValue", m)
|
2090
2090
|
});
|
2091
2091
|
function b(m) {
|
2092
2092
|
t("clear", m);
|
2093
2093
|
}
|
2094
|
-
function w(m,
|
2095
|
-
t("change", { name: m, value:
|
2094
|
+
function w(m, d) {
|
2095
|
+
t("change", { name: m, value: d }), o.modelValue !== void 0 && t("update:modelValue", d);
|
2096
2096
|
}
|
2097
2097
|
return D(
|
2098
|
-
() =>
|
2098
|
+
() => o.default,
|
2099
2099
|
(m) => {
|
2100
|
-
|
2100
|
+
h.value = m;
|
2101
2101
|
}
|
2102
2102
|
), D(
|
2103
|
-
() =>
|
2103
|
+
() => o.modelValue,
|
2104
2104
|
(m) => {
|
2105
|
-
|
2105
|
+
h.value = m;
|
2106
2106
|
}
|
2107
2107
|
), D(
|
2108
|
-
() =>
|
2108
|
+
() => o,
|
2109
2109
|
(m) => {
|
2110
|
-
|
2110
|
+
h.value = m;
|
2111
2111
|
}
|
2112
|
-
),
|
2112
|
+
), n({
|
2113
2113
|
filterRef: s
|
2114
|
-
}), (m,
|
2114
|
+
}), (m, d) => {
|
2115
2115
|
var y, _;
|
2116
|
-
return p(),
|
2116
|
+
return p(), z(ie((y = v.value) == null ? void 0 : y.component), Z(o, {
|
2117
2117
|
type: (_ = v.value) == null ? void 0 : _.type,
|
2118
|
-
modelValue:
|
2119
|
-
"onUpdate:modelValue":
|
2120
|
-
onChange:
|
2121
|
-
onClear:
|
2118
|
+
modelValue: h.value,
|
2119
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => h.value = f),
|
2120
|
+
onChange: d[1] || (d[1] = (f) => w(f.name, f.value)),
|
2121
|
+
onClear: d[2] || (d[2] = (f) => b(f)),
|
2122
2122
|
ref_key: "filterRef",
|
2123
2123
|
ref: s
|
2124
2124
|
}), null, 16, ["type", "modelValue"]);
|
2125
2125
|
};
|
2126
2126
|
}
|
2127
|
-
}),
|
2127
|
+
}), ue = /* @__PURE__ */ Y({
|
2128
2128
|
__name: "filter-field",
|
2129
2129
|
props: {
|
2130
2130
|
id: {},
|
@@ -2150,32 +2150,32 @@ const El = /* @__PURE__ */ le(Pl, [["render", Hl]]), Yl = { style: { display: "i
|
|
2150
2150
|
sort: { default: "name" }
|
2151
2151
|
},
|
2152
2152
|
emits: ["update:modelValue", "change", "clear"],
|
2153
|
-
setup(i, { expose:
|
2154
|
-
const
|
2155
|
-
get: () =>
|
2153
|
+
setup(i, { expose: n, emit: u }) {
|
2154
|
+
const o = i, t = u, s = V(), v = E({
|
2155
|
+
get: () => o.modelValue,
|
2156
2156
|
set: (m) => t("update:modelValue", m)
|
2157
2157
|
});
|
2158
|
-
function
|
2158
|
+
function h(m) {
|
2159
2159
|
t("clear", m);
|
2160
2160
|
}
|
2161
|
-
function b(m,
|
2162
|
-
t("change", { name: m, value:
|
2161
|
+
function b(m, d) {
|
2162
|
+
t("change", { name: m, value: d }), o.modelValue !== void 0 && t("update:modelValue", d);
|
2163
2163
|
}
|
2164
2164
|
D(
|
2165
|
-
() =>
|
2165
|
+
() => o.default,
|
2166
2166
|
(m) => {
|
2167
2167
|
v.value = m;
|
2168
2168
|
}
|
2169
2169
|
), D(
|
2170
|
-
() =>
|
2170
|
+
() => o.modelValue,
|
2171
2171
|
(m) => {
|
2172
2172
|
v.value = m;
|
2173
2173
|
}
|
2174
|
-
),
|
2174
|
+
), n({
|
2175
2175
|
filterRef: s
|
2176
2176
|
});
|
2177
2177
|
function w() {
|
2178
|
-
switch (
|
2178
|
+
switch (o.layout) {
|
2179
2179
|
case "inline":
|
2180
2180
|
return Le;
|
2181
2181
|
case "vertical":
|
@@ -2186,105 +2186,105 @@ const El = /* @__PURE__ */ le(Pl, [["render", Hl]]), Yl = { style: { display: "i
|
|
2186
2186
|
return Le;
|
2187
2187
|
}
|
2188
2188
|
}
|
2189
|
-
return (m,
|
2190
|
-
onChange:
|
2191
|
-
onClear:
|
2189
|
+
return (m, d) => (p(), z(ie(w()), Z(o, {
|
2190
|
+
onChange: d[0] || (d[0] = (y) => b(y.name, y.value)),
|
2191
|
+
onClear: d[1] || (d[1] = (y) => h(y)),
|
2192
2192
|
modelValue: v.value,
|
2193
|
-
"onUpdate:modelValue":
|
2193
|
+
"onUpdate:modelValue": d[2] || (d[2] = (y) => v.value = y)
|
2194
2194
|
}), null, 16, ["modelValue"]));
|
2195
2195
|
}
|
2196
2196
|
});
|
2197
|
-
function
|
2197
|
+
function Be(i, n) {
|
2198
2198
|
const {
|
2199
|
-
slots:
|
2200
|
-
} = i,
|
2201
|
-
var
|
2202
|
-
return (ve((
|
2199
|
+
slots: u
|
2200
|
+
} = i, o = V(i.value ?? {}), t = E(() => {
|
2201
|
+
var g;
|
2202
|
+
return (ve((g = u == null ? void 0 : u.default) == null ? void 0 : g.call(u)) ?? []).flatMap((r) => Array.isArray(r.children) ? r.children : [r]);
|
2203
2203
|
});
|
2204
|
-
function s(
|
2205
|
-
delete
|
2206
|
-
data: ve(
|
2207
|
-
name:
|
2204
|
+
function s(g) {
|
2205
|
+
delete o.value[g], n("clear", {
|
2206
|
+
data: ve(o.value),
|
2207
|
+
name: g
|
2208
2208
|
});
|
2209
2209
|
}
|
2210
|
-
function v(
|
2211
|
-
|
2212
|
-
...
|
2213
|
-
[
|
2214
|
-
},
|
2215
|
-
data: ve(
|
2216
|
-
name:
|
2217
|
-
value:
|
2210
|
+
function v(g, r) {
|
2211
|
+
r === void 0 ? s(g) : o.value = {
|
2212
|
+
...o.value,
|
2213
|
+
[g]: r
|
2214
|
+
}, n("change", {
|
2215
|
+
data: ve(o.value),
|
2216
|
+
name: g,
|
2217
|
+
value: r
|
2218
2218
|
});
|
2219
2219
|
}
|
2220
|
-
const
|
2220
|
+
const h = E(() => t.value.map((g) => {
|
2221
2221
|
var C;
|
2222
|
-
const
|
2223
|
-
return Je(
|
2224
|
-
...
|
2222
|
+
const r = (C = g.props) == null ? void 0 : C.name;
|
2223
|
+
return Je(g, {
|
2224
|
+
...g.props,
|
2225
2225
|
layout: i.view,
|
2226
2226
|
showClean: !0,
|
2227
|
-
modelValue: r
|
2228
|
-
"onUpdate:modelValue": (
|
2229
|
-
v(
|
2227
|
+
modelValue: o[r],
|
2228
|
+
"onUpdate:modelValue": ($) => {
|
2229
|
+
v(r, $);
|
2230
2230
|
},
|
2231
|
-
onClear: () => s(
|
2231
|
+
onClear: () => s(r)
|
2232
2232
|
});
|
2233
2233
|
})), b = E(
|
2234
2234
|
() => new Map(
|
2235
|
-
|
2235
|
+
h.value.map((g) => {
|
2236
2236
|
var C;
|
2237
|
-
const
|
2238
|
-
return
|
2239
|
-
}).filter((
|
2237
|
+
const r = (C = g.props) == null ? void 0 : C.name;
|
2238
|
+
return r ? [r, g] : null;
|
2239
|
+
}).filter((g) => g !== null)
|
2240
2240
|
)
|
2241
2241
|
);
|
2242
|
-
function w(
|
2243
|
-
|
2244
|
-
data: ve(
|
2242
|
+
function w(g = !1) {
|
2243
|
+
o.value = {}, g || n("clearAll", {
|
2244
|
+
data: ve(o.value),
|
2245
2245
|
name: "ALL"
|
2246
2246
|
});
|
2247
2247
|
}
|
2248
|
-
const m = V(""),
|
2249
|
-
var
|
2250
|
-
return (
|
2248
|
+
const m = V(""), d = E(() => {
|
2249
|
+
var g;
|
2250
|
+
return (g = i.schema) != null && g.value ? Object.entries(o.value).filter(([r, C]) => i.schema && !(r in i.schema.value) ? !1 : Array.isArray(C) ? C.some(($) => $ !== "" && $ !== void 0) : C !== "" && C !== void 0).length : 0;
|
2251
2251
|
}), y = V();
|
2252
2252
|
D(m, async () => {
|
2253
|
-
var
|
2254
|
-
await
|
2253
|
+
var g, r;
|
2254
|
+
await _e(), (r = (g = y == null ? void 0 : y.value) == null ? void 0 : g.filterRef) != null && r.inputTextRef && y.value.filterRef.inputTextRef.focus();
|
2255
2255
|
});
|
2256
2256
|
const _ = E(() => {
|
2257
|
-
var
|
2258
|
-
return (
|
2257
|
+
var g, r;
|
2258
|
+
return (g = i.schema) != null && g.value ? Object.fromEntries(Object.entries((r = i.schema) == null ? void 0 : r.value).slice(0, i.limit)) : {};
|
2259
|
+
}), f = E(() => {
|
2260
|
+
var g, r, C;
|
2261
|
+
return (g = i.schema) != null && g.value ? i.view !== "inline" ? (r = i.schema) == null ? void 0 : r.value : Object.fromEntries(Object.entries((C = i.schema) == null ? void 0 : C.value).slice(i.limit)) : {};
|
2259
2262
|
}), c = E(() => {
|
2260
|
-
var
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
if (g.value.length === 0) return [];
|
2265
|
-
let h = 0;
|
2266
|
-
if ((n = i.schema) != null && n.value) {
|
2263
|
+
var r;
|
2264
|
+
if (h.value.length === 0) return [];
|
2265
|
+
let g = 0;
|
2266
|
+
if ((r = i.schema) != null && r.value) {
|
2267
2267
|
const C = Object.entries(i.schema.value).length;
|
2268
|
-
C < i.limit ?
|
2268
|
+
C < i.limit ? g = i.limit - C : g = 0;
|
2269
2269
|
}
|
2270
|
-
return
|
2271
|
-
}), l = E(() =>
|
2270
|
+
return h.value.slice(0, g);
|
2271
|
+
}), l = E(() => h.value.length === 0 ? [] : i.view !== "inline" ? h.value : h.value.slice(c.value.length));
|
2272
2272
|
function x() {
|
2273
|
-
if (
|
2274
|
-
const [
|
2275
|
-
m.value =
|
2273
|
+
if (f.value) {
|
2274
|
+
const [g] = Object.keys(f.value);
|
2275
|
+
m.value = g;
|
2276
2276
|
} else l.value.length > 0 ? m.value = l.value[0].props.name : m.value = "";
|
2277
2277
|
}
|
2278
2278
|
return {
|
2279
|
-
activeFilter:
|
2280
|
-
activeFilterCount:
|
2279
|
+
activeFilter: o,
|
2280
|
+
activeFilterCount: d,
|
2281
2281
|
onFilterChange: v,
|
2282
2282
|
clearFilter: s,
|
2283
2283
|
clearAllFilters: w,
|
2284
2284
|
limitedSchema: _,
|
2285
|
-
popoverSchema:
|
2286
|
-
filtersSlot:
|
2287
|
-
limitedFiltersSlot:
|
2285
|
+
popoverSchema: f,
|
2286
|
+
filtersSlot: h,
|
2287
|
+
limitedFiltersSlot: c,
|
2288
2288
|
popoverFiltersSlot: l,
|
2289
2289
|
vnodeMap: b,
|
2290
2290
|
onPopoverOpen: x,
|
@@ -2295,58 +2295,58 @@ function $e(i, o) {
|
|
2295
2295
|
const Xl = /* @__PURE__ */ Y({
|
2296
2296
|
__name: "popover",
|
2297
2297
|
emits: ["open", "close"],
|
2298
|
-
setup(i, { emit:
|
2299
|
-
const
|
2300
|
-
function
|
2301
|
-
|
2298
|
+
setup(i, { emit: n }) {
|
2299
|
+
const u = V(!1), o = V(null), t = V(null), s = V(null), v = V({ top: "0px", left: "0px", position: "absolute" });
|
2300
|
+
function h() {
|
2301
|
+
u.value = !u.value;
|
2302
2302
|
}
|
2303
2303
|
function b() {
|
2304
|
-
const y = s.value, _ =
|
2304
|
+
const y = s.value, _ = o.value;
|
2305
2305
|
if (!y || !_) return;
|
2306
|
-
const
|
2307
|
-
let x =
|
2308
|
-
|
2306
|
+
const f = y.getBoundingClientRect(), c = _.offsetWidth, l = window.innerWidth - f.left;
|
2307
|
+
let x = f.left + window.scrollX;
|
2308
|
+
c > l && (x = window.innerWidth - c - 8, x < 8 && (x = 8)), v.value = {
|
2309
2309
|
position: "absolute",
|
2310
|
-
top: `${
|
2310
|
+
top: `${f.bottom + window.scrollY + 8}px`,
|
2311
2311
|
left: `${x}px`
|
2312
2312
|
};
|
2313
2313
|
}
|
2314
2314
|
function w(y) {
|
2315
|
-
var
|
2315
|
+
var f, c;
|
2316
2316
|
const _ = y.target;
|
2317
|
-
!((
|
2317
|
+
!((f = s.value) != null && f.contains(y.target)) && !((c = o.value) != null && c.contains(y.target)) && !_.closest("[data-inside-popover]") && (u.value = !1);
|
2318
2318
|
}
|
2319
2319
|
const m = V(!1);
|
2320
|
-
|
2320
|
+
pe(() => {
|
2321
2321
|
m.value = !0;
|
2322
|
-
}),
|
2322
|
+
}), pe(() => {
|
2323
2323
|
var y, _;
|
2324
|
-
s.value = ((y = t.value) == null ? void 0 : y.querySelector("[data-popover-trigger]")) || null, (_ = s.value) == null || _.addEventListener("click",
|
2325
|
-
}),
|
2324
|
+
s.value = ((y = t.value) == null ? void 0 : y.querySelector("[data-popover-trigger]")) || null, (_ = s.value) == null || _.addEventListener("click", h), document.addEventListener("click", w), window.addEventListener("resize", b), window.addEventListener("scroll", b, !0);
|
2325
|
+
}), ge(() => {
|
2326
2326
|
var y;
|
2327
|
-
(y = s.value) == null || y.removeEventListener("click",
|
2327
|
+
(y = s.value) == null || y.removeEventListener("click", h), document.removeEventListener("click", w), window.removeEventListener("resize", b), window.removeEventListener("scroll", b, !0);
|
2328
2328
|
});
|
2329
|
-
const
|
2330
|
-
return D(
|
2331
|
-
y ? (
|
2329
|
+
const d = n;
|
2330
|
+
return D(u, async (y) => {
|
2331
|
+
y ? (d("open"), await _e(), b()) : d("close");
|
2332
2332
|
}), (y, _) => (p(), k("div", {
|
2333
2333
|
ref_key: "wrapperRef",
|
2334
2334
|
ref: t
|
2335
2335
|
}, [
|
2336
|
-
|
2337
|
-
m.value ? (p(),
|
2336
|
+
te(y.$slots, "trigger"),
|
2337
|
+
m.value ? (p(), z(Ie, {
|
2338
2338
|
key: 0,
|
2339
2339
|
to: "body"
|
2340
2340
|
}, [
|
2341
2341
|
P(a("div", {
|
2342
2342
|
ref_key: "popoverRef",
|
2343
|
-
ref:
|
2343
|
+
ref: o,
|
2344
2344
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
2345
|
-
style:
|
2345
|
+
style: ke(v.value)
|
2346
2346
|
}, [
|
2347
|
-
|
2347
|
+
te(y.$slots, "default")
|
2348
2348
|
], 4), [
|
2349
|
-
[X,
|
2349
|
+
[X, u.value]
|
2350
2350
|
])
|
2351
2351
|
])) : S("", !0)
|
2352
2352
|
], 512));
|
@@ -2363,24 +2363,24 @@ const Xl = /* @__PURE__ */ Y({
|
|
2363
2363
|
"stroke-linejoin": "round",
|
2364
2364
|
class: "lucide lucide-filter h-4 w-4"
|
2365
2365
|
};
|
2366
|
-
function la(i,
|
2367
|
-
return p(), k("svg", ta,
|
2366
|
+
function la(i, n) {
|
2367
|
+
return p(), k("svg", ta, n[0] || (n[0] = [
|
2368
2368
|
a("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
|
2369
2369
|
]));
|
2370
2370
|
}
|
2371
|
-
const aa = /* @__PURE__ */
|
2371
|
+
const aa = /* @__PURE__ */ ae(ea, [["render", la]]), oa = {
|
2372
2372
|
key: 0,
|
2373
2373
|
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"
|
2374
|
-
},
|
2374
|
+
}, na = { class: "flex" }, ra = { class: "w-64 border-r border-gray-200" }, ia = { class: "p-2" }, sa = ["onClick"], ua = { class: "flex items-center gap-2" }, ca = { class: "text-sm font-medium" }, da = {
|
2375
2375
|
key: 0,
|
2376
2376
|
class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
|
2377
2377
|
}, pa = ["onClick"], fa = { class: "flex items-center gap-2" }, va = { class: "text-sm font-medium" }, ma = {
|
2378
2378
|
key: 0,
|
2379
2379
|
class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
|
2380
|
-
},
|
2380
|
+
}, ha = {
|
2381
2381
|
key: 0,
|
2382
2382
|
class: "p-2 border-t"
|
2383
|
-
},
|
2383
|
+
}, ga = { class: "flex-1 min-h-[300px] overflow-y-auto" }, ba = {
|
2384
2384
|
key: 0,
|
2385
2385
|
class: "flex items-center justify-center h-full text-gray-500"
|
2386
2386
|
}, Qe = /* @__PURE__ */ Y({
|
@@ -2394,140 +2394,140 @@ const aa = /* @__PURE__ */ le(ea, [["render", la]]), oa = {
|
|
2394
2394
|
limit: { default: 3 }
|
2395
2395
|
},
|
2396
2396
|
emits: ["change", "clear", "clearAll"],
|
2397
|
-
setup(i, { expose:
|
2398
|
-
const
|
2397
|
+
setup(i, { expose: n, emit: u }) {
|
2398
|
+
const o = i, t = Ne(o.mode), s = we(), v = u, h = V({}), {
|
2399
2399
|
activeFilter: b,
|
2400
2400
|
activeFilterCount: w,
|
2401
2401
|
onFilterChange: m,
|
2402
|
-
clearFilter:
|
2402
|
+
clearFilter: d,
|
2403
2403
|
clearAllFilters: y,
|
2404
2404
|
popoverSchema: _,
|
2405
|
-
popoverFiltersSlot:
|
2406
|
-
onPopoverOpen:
|
2405
|
+
popoverFiltersSlot: f,
|
2406
|
+
onPopoverOpen: c,
|
2407
2407
|
selectedFilter: l,
|
2408
2408
|
filterRef: x
|
2409
|
-
} =
|
2410
|
-
...
|
2411
|
-
schema:
|
2409
|
+
} = Be({
|
2410
|
+
...o,
|
2411
|
+
schema: h,
|
2412
2412
|
slots: s
|
2413
2413
|
}, v);
|
2414
2414
|
return D(
|
2415
|
-
() =>
|
2416
|
-
(
|
2417
|
-
|
2415
|
+
() => o.schema,
|
2416
|
+
(g) => {
|
2417
|
+
h.value = g;
|
2418
2418
|
},
|
2419
2419
|
{ deep: !0, immediate: !0 }
|
2420
|
-
),
|
2421
|
-
clearFilter:
|
2420
|
+
), n({
|
2421
|
+
clearFilter: d,
|
2422
2422
|
clearAllFilters: y
|
2423
|
-
}), (
|
2424
|
-
onOpen: e(
|
2425
|
-
onClose:
|
2423
|
+
}), (g, r) => (p(), z(Xl, {
|
2424
|
+
onOpen: e(c),
|
2425
|
+
onClose: r[5] || (r[5] = (C) => l.value = "")
|
2426
2426
|
}, {
|
2427
|
-
trigger:
|
2427
|
+
trigger: se(() => [
|
2428
2428
|
a("button", {
|
2429
2429
|
"data-popover-trigger": "",
|
2430
2430
|
"aria-haspopup": "dialog",
|
2431
2431
|
"aria-expanded": "false",
|
2432
|
-
class:
|
2432
|
+
class: j(
|
2433
2433
|
e(t) + (e(w) > 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")
|
2434
2434
|
),
|
2435
2435
|
type: "button"
|
2436
2436
|
}, [
|
2437
2437
|
I(aa),
|
2438
|
-
|
2439
|
-
e(w) > 0 ? (p(), k("div", oa,
|
2438
|
+
r[6] || (r[6] = W(" Фільтр ", -1)),
|
2439
|
+
e(w) > 0 ? (p(), k("div", oa, K(e(w)), 1)) : S("", !0)
|
2440
2440
|
], 2)
|
2441
2441
|
]),
|
2442
|
-
default:
|
2443
|
-
a("div",
|
2444
|
-
a("div",
|
2445
|
-
|
2442
|
+
default: se(() => [
|
2443
|
+
a("div", na, [
|
2444
|
+
a("div", ra, [
|
2445
|
+
r[7] || (r[7] = a("div", { class: "p-4 border-b" }, [
|
2446
2446
|
a("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
|
2447
2447
|
], -1)),
|
2448
2448
|
a("div", ia, [
|
2449
|
-
|
2450
|
-
var
|
2449
|
+
g.schema ? (p(!0), k(F, { key: 0 }, N(Object.entries(e(_)), ([C, $]) => {
|
2450
|
+
var B;
|
2451
2451
|
return p(), k("button", {
|
2452
2452
|
key: C,
|
2453
2453
|
onClick: () => {
|
2454
2454
|
l.value = C;
|
2455
2455
|
},
|
2456
|
-
class:
|
2456
|
+
class: j([
|
2457
2457
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
2458
2458
|
e(l) === C ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
2459
2459
|
])
|
2460
2460
|
}, [
|
2461
2461
|
a("div", ua, [
|
2462
|
-
a("span",
|
2462
|
+
a("span", ca, K($.label), 1)
|
2463
2463
|
]),
|
2464
|
-
(Array.isArray(e(b)[C]) ? ((
|
2464
|
+
(Array.isArray(e(b)[C]) ? ((B = e(b)[C]) == null ? void 0 : B.length) > 0 : e(b)[C] || e(b)[C] === null) ? (p(), k("div", da)) : S("", !0)
|
2465
2465
|
], 10, sa);
|
2466
2466
|
}), 128)) : S("", !0),
|
2467
|
-
(p(!0), k(
|
2468
|
-
var
|
2467
|
+
(p(!0), k(F, null, N(e(f), (C, $) => {
|
2468
|
+
var B;
|
2469
2469
|
return p(), k("button", {
|
2470
|
-
key: "slot-" +
|
2470
|
+
key: "slot-" + $,
|
2471
2471
|
onClick: (A) => l.value = C.props.name,
|
2472
|
-
class:
|
2472
|
+
class: j([
|
2473
2473
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
2474
2474
|
e(l) === C.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
2475
2475
|
])
|
2476
2476
|
}, [
|
2477
2477
|
a("div", fa, [
|
2478
|
-
a("span", va,
|
2478
|
+
a("span", va, K(C.props.label), 1)
|
2479
2479
|
]),
|
2480
|
-
((
|
2480
|
+
((B = e(b)[C.props.name]) == null ? void 0 : B.length) > 0 ? (p(), k("div", ma)) : S("", !0)
|
2481
2481
|
], 10, pa);
|
2482
2482
|
}), 128))
|
2483
2483
|
]),
|
2484
|
-
e(w) > 0 ? (p(), k("div",
|
2484
|
+
e(w) > 0 ? (p(), k("div", ha, [
|
2485
2485
|
a("button", {
|
2486
2486
|
class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
|
2487
|
-
onClick:
|
2487
|
+
onClick: r[0] || (r[0] = (C) => e(y)()),
|
2488
2488
|
"data-inside-popover": ""
|
2489
2489
|
}, " Очистити всі ")
|
2490
2490
|
])) : S("", !0)
|
2491
2491
|
]),
|
2492
|
-
a("div",
|
2493
|
-
e(l) === "" ? (p(), k("div", ba,
|
2492
|
+
a("div", ga, [
|
2493
|
+
e(l) === "" ? (p(), k("div", ba, r[8] || (r[8] = [
|
2494
2494
|
a("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
|
2495
2495
|
]))) : S("", !0),
|
2496
|
-
e(l) ? (p(), k(
|
2497
|
-
e(_) ? (p(!0), k(
|
2498
|
-
e(l) === C ? (p(),
|
2496
|
+
e(l) ? (p(), k(F, { key: 1 }, [
|
2497
|
+
e(_) ? (p(!0), k(F, { key: 0 }, N(Object.entries(e(_)), ([C, $]) => (p(), k(F, null, [
|
2498
|
+
e(l) === C ? (p(), z(ue, Z({
|
2499
2499
|
name: C,
|
2500
2500
|
key: C,
|
2501
2501
|
layout: "popover",
|
2502
2502
|
ref_for: !0,
|
2503
2503
|
ref_key: "filterRef",
|
2504
2504
|
ref: x
|
2505
|
-
}, { ref_for: !0 },
|
2506
|
-
onChange:
|
2507
|
-
onClear:
|
2508
|
-
e(
|
2505
|
+
}, { ref_for: !0 }, $, {
|
2506
|
+
onChange: r[1] || (r[1] = (B) => e(m)(B.name, B.value)),
|
2507
|
+
onClear: r[2] || (r[2] = (B) => {
|
2508
|
+
e(d)(B), e(m)(B, void 0);
|
2509
2509
|
}),
|
2510
2510
|
modelValue: e(b)[C],
|
2511
|
-
"onUpdate:modelValue": (
|
2511
|
+
"onUpdate:modelValue": (B) => e(b)[C] = B,
|
2512
2512
|
cleanable: !0
|
2513
2513
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : S("", !0)
|
2514
2514
|
], 64))), 256)) : S("", !0),
|
2515
|
-
(p(!0), k(
|
2516
|
-
key: "slot-" +
|
2515
|
+
(p(!0), k(F, null, N(e(f), (C, $) => (p(), k(F, {
|
2516
|
+
key: "slot-" + $
|
2517
2517
|
}, [
|
2518
|
-
e(l) === C.props.name ? (p(),
|
2518
|
+
e(l) === C.props.name ? (p(), z(ue, Z({
|
2519
2519
|
key: 0,
|
2520
2520
|
layout: "popover"
|
2521
2521
|
}, { ref_for: !0 }, C.props, {
|
2522
2522
|
ref_for: !0,
|
2523
2523
|
ref_key: "filterRef",
|
2524
2524
|
ref: x,
|
2525
|
-
onChange:
|
2526
|
-
onClear:
|
2527
|
-
e(
|
2525
|
+
onChange: r[3] || (r[3] = (B) => e(m)(B.name, B.value)),
|
2526
|
+
onClear: r[4] || (r[4] = (B) => {
|
2527
|
+
e(d)(B), e(m)(B, void 0);
|
2528
2528
|
}),
|
2529
2529
|
modelValue: e(b)[C.props.name],
|
2530
|
-
"onUpdate:modelValue": (
|
2530
|
+
"onUpdate:modelValue": (B) => e(b)[C.props.name] = B,
|
2531
2531
|
cleanable: !0
|
2532
2532
|
}), null, 16, ["modelValue", "onUpdate:modelValue"])) : S("", !0)
|
2533
2533
|
], 64))), 128))
|
@@ -2549,85 +2549,85 @@ const aa = /* @__PURE__ */ le(ea, [["render", la]]), oa = {
|
|
2549
2549
|
limit: { default: 3 }
|
2550
2550
|
},
|
2551
2551
|
emits: ["change", "clear", "clearAll"],
|
2552
|
-
setup(i, { expose:
|
2553
|
-
const
|
2554
|
-
activeFilter:
|
2552
|
+
setup(i, { expose: n, emit: u }) {
|
2553
|
+
const o = i, t = u, s = we(), v = V({}), {
|
2554
|
+
activeFilter: h,
|
2555
2555
|
activeFilterCount: b,
|
2556
2556
|
onFilterChange: w,
|
2557
2557
|
clearFilter: m,
|
2558
|
-
clearAllFilters:
|
2558
|
+
clearAllFilters: d,
|
2559
2559
|
limitedSchema: y,
|
2560
2560
|
popoverSchema: _,
|
2561
|
-
filtersSlot:
|
2562
|
-
limitedFiltersSlot:
|
2561
|
+
filtersSlot: f,
|
2562
|
+
limitedFiltersSlot: c,
|
2563
2563
|
popoverFiltersSlot: l
|
2564
|
-
} =
|
2564
|
+
} = Be(
|
2565
2565
|
{
|
2566
|
-
...
|
2566
|
+
...o,
|
2567
2567
|
schema: v,
|
2568
2568
|
slots: s
|
2569
2569
|
},
|
2570
2570
|
t
|
2571
2571
|
), x = V();
|
2572
|
-
function
|
2573
|
-
x.value && x.value.clearAllFilters(!0),
|
2572
|
+
function g() {
|
2573
|
+
x.value && x.value.clearAllFilters(!0), d();
|
2574
2574
|
}
|
2575
2575
|
return D(
|
2576
|
-
() =>
|
2577
|
-
(
|
2578
|
-
v.value =
|
2576
|
+
() => o.schema,
|
2577
|
+
(r) => {
|
2578
|
+
v.value = r;
|
2579
2579
|
},
|
2580
2580
|
{ deep: !0, immediate: !0 }
|
2581
|
-
),
|
2581
|
+
), n({
|
2582
2582
|
clearFilter: m,
|
2583
|
-
clearAllFilters:
|
2584
|
-
}), (
|
2585
|
-
|
2586
|
-
key:
|
2587
|
-
name:
|
2588
|
-
mode:
|
2589
|
-
}, { ref_for: !0 },
|
2583
|
+
clearAllFilters: d
|
2584
|
+
}), (r, C) => (p(), k("div", ya, [
|
2585
|
+
r.schema ? (p(!0), k(F, { key: 0 }, N(Object.entries(e(y)), ([$, B]) => (p(), z(ue, Z({
|
2586
|
+
key: $,
|
2587
|
+
name: $,
|
2588
|
+
mode: r.mode
|
2589
|
+
}, { ref_for: !0 }, B, {
|
2590
2590
|
onChange: C[0] || (C[0] = (A) => e(w)(A.name, A.value)),
|
2591
2591
|
onClear: e(m),
|
2592
2592
|
layout: "inline",
|
2593
2593
|
cleanable: !0,
|
2594
|
-
modelValue: e(
|
2595
|
-
"onUpdate:modelValue": (A) => e(
|
2594
|
+
modelValue: e(h)[$],
|
2595
|
+
"onUpdate:modelValue": (A) => e(h)[$] = A
|
2596
2596
|
}), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : S("", !0),
|
2597
|
-
(p(!0), k(
|
2598
|
-
key: "slot-" +
|
2597
|
+
(p(!0), k(F, null, N(e(c), ($, B) => (p(), z(ue, Z({
|
2598
|
+
key: "slot-" + B,
|
2599
2599
|
layout: "inline"
|
2600
|
-
}, { ref_for: !0 },
|
2600
|
+
}, { ref_for: !0 }, $.props, {
|
2601
2601
|
onChange: C[1] || (C[1] = (A) => e(w)(A.name, A.value)),
|
2602
2602
|
onClear: C[2] || (C[2] = (A) => {
|
2603
2603
|
e(m)(A), e(w)(A, void 0);
|
2604
2604
|
}),
|
2605
2605
|
cleanable: !0,
|
2606
|
-
modelValue: e(
|
2607
|
-
"onUpdate:modelValue": (A) => e(
|
2606
|
+
modelValue: e(h)[$.props.name],
|
2607
|
+
"onUpdate:modelValue": (A) => e(h)[$.props.name] = A
|
2608
2608
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
|
2609
|
-
Object.entries(e(_)).length > 0 || e(l).length > 0 ? (p(),
|
2609
|
+
Object.entries(e(_)).length > 0 || e(l).length > 0 ? (p(), z(Qe, Z({ key: 1 }, o, {
|
2610
2610
|
schema: e(_),
|
2611
2611
|
limit: 0,
|
2612
|
-
onChange: C[3] || (C[3] = (
|
2613
|
-
onClearAll: C[4] || (C[4] = (
|
2614
|
-
onClear: C[5] || (C[5] = (
|
2615
|
-
mode:
|
2612
|
+
onChange: C[3] || (C[3] = ($) => e(w)($.name, $.value)),
|
2613
|
+
onClearAll: C[4] || (C[4] = ($) => e(d)()),
|
2614
|
+
onClear: C[5] || (C[5] = ($) => e(m)($.name)),
|
2615
|
+
mode: r.mode,
|
2616
2616
|
ref_key: "popoverRef",
|
2617
2617
|
ref: x,
|
2618
2618
|
cleanable: !0
|
2619
2619
|
}), {
|
2620
|
-
default:
|
2621
|
-
(p(!0), k(
|
2622
|
-
key: "slot-" +
|
2620
|
+
default: se(() => [
|
2621
|
+
(p(!0), k(F, null, N(e(f), ($, B) => (p(), z(ie($), Z({
|
2622
|
+
key: "slot-" + B,
|
2623
2623
|
layout: "popover"
|
2624
|
-
}, { ref_for: !0 },
|
2624
|
+
}, { ref_for: !0 }, $.props, { cleanable: !0 }), null, 16))), 128))
|
2625
2625
|
]),
|
2626
2626
|
_: 1
|
2627
2627
|
}, 16, ["schema", "mode"])) : S("", !0),
|
2628
2628
|
e(b) > 0 ? (p(), k("button", {
|
2629
2629
|
key: 2,
|
2630
|
-
onClick:
|
2630
|
+
onClick: g,
|
2631
2631
|
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"
|
2632
2632
|
}, " Очистити ")) : S("", !0)
|
2633
2633
|
]));
|
@@ -2646,54 +2646,54 @@ const aa = /* @__PURE__ */ le(ea, [["render", la]]), oa = {
|
|
2646
2646
|
limit: { default: 3 }
|
2647
2647
|
},
|
2648
2648
|
emits: ["change", "clear", "clearAll"],
|
2649
|
-
setup(i, { expose:
|
2650
|
-
const
|
2649
|
+
setup(i, { expose: n, emit: u }) {
|
2650
|
+
const o = i, t = u, s = we(), {
|
2651
2651
|
activeFilter: v,
|
2652
|
-
activeFilterCount:
|
2652
|
+
activeFilterCount: h,
|
2653
2653
|
onFilterChange: b,
|
2654
2654
|
clearFilter: w,
|
2655
2655
|
clearAllFilters: m,
|
2656
|
-
filtersSlot:
|
2657
|
-
} =
|
2658
|
-
...
|
2656
|
+
filtersSlot: d
|
2657
|
+
} = Be({
|
2658
|
+
...o,
|
2659
2659
|
slots: s
|
2660
2660
|
}, t);
|
2661
|
-
return
|
2661
|
+
return n({
|
2662
2662
|
clearFilter: w,
|
2663
2663
|
clearAllFilters: m
|
2664
2664
|
}), (y, _) => y.view === "vertical" ? (p(), k("div", xa, [
|
2665
2665
|
a("div", wa, [
|
2666
|
-
e(
|
2666
|
+
e(h) > 0 ? (p(), k("button", {
|
2667
2667
|
key: 0,
|
2668
|
-
onClick: _[0] || (_[0] = (
|
2668
|
+
onClick: _[0] || (_[0] = (f) => e(m)()),
|
2669
2669
|
"data-popover-trigger": "",
|
2670
2670
|
"aria-haspopup": "dialog",
|
2671
2671
|
"aria-expanded": "false",
|
2672
2672
|
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",
|
2673
2673
|
type: "button"
|
2674
2674
|
}, " Очистити ")) : S("", !0),
|
2675
|
-
y.schema ? (p(!0), k(
|
2676
|
-
name:
|
2675
|
+
y.schema ? (p(!0), k(F, { key: 1 }, N(Object.entries(y.schema), ([f, c]) => (p(), z(ue, Z({
|
2676
|
+
name: f,
|
2677
2677
|
layout: "vertical"
|
2678
|
-
}, { ref_for: !0 },
|
2678
|
+
}, { ref_for: !0 }, c, {
|
2679
2679
|
onChange: _[1] || (_[1] = (l) => e(b)(l.name, l.value)),
|
2680
2680
|
onClear: _[2] || (_[2] = (l) => {
|
2681
2681
|
e(w)(l), e(b)(l, void 0);
|
2682
2682
|
}),
|
2683
|
-
modelValue: e(v)[
|
2684
|
-
"onUpdate:modelValue": (l) => e(v)[
|
2683
|
+
modelValue: e(v)[f],
|
2684
|
+
"onUpdate:modelValue": (l) => e(v)[f] = l,
|
2685
2685
|
showClean: !0
|
2686
2686
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : S("", !0),
|
2687
|
-
(p(!0), k(
|
2688
|
-
key: "slot-" +
|
2687
|
+
(p(!0), k(F, null, N(e(d), (f, c) => (p(), z(ue, Z({
|
2688
|
+
key: "slot-" + c,
|
2689
2689
|
layout: "vertical"
|
2690
|
-
}, { ref_for: !0 },
|
2690
|
+
}, { ref_for: !0 }, f.props, {
|
2691
2691
|
onChange: _[3] || (_[3] = (l) => e(b)(l.name, l.value)),
|
2692
2692
|
onClear: _[4] || (_[4] = (l) => {
|
2693
2693
|
e(w)(l), e(b)(l, void 0);
|
2694
2694
|
}),
|
2695
|
-
modelValue: e(v)[
|
2696
|
-
"onUpdate:modelValue": (l) => e(v)[
|
2695
|
+
modelValue: e(v)[f.props.name],
|
2696
|
+
"onUpdate:modelValue": (l) => e(v)[f.props.name] = l,
|
2697
2697
|
showClean: !0
|
2698
2698
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
|
2699
2699
|
])
|
@@ -2710,52 +2710,52 @@ const aa = /* @__PURE__ */ le(ea, [["render", la]]), oa = {
|
|
2710
2710
|
limit: { default: 3 }
|
2711
2711
|
},
|
2712
2712
|
emits: ["change", "clear", "clearAll"],
|
2713
|
-
setup(i, { expose:
|
2714
|
-
const
|
2715
|
-
function
|
2716
|
-
if (Array.isArray(
|
2717
|
-
return
|
2718
|
-
if (
|
2719
|
-
const l = ve(
|
2720
|
-
for (const
|
2721
|
-
x[
|
2713
|
+
setup(i, { expose: n, emit: u }) {
|
2714
|
+
const o = i, t = V(o.value ?? {}), s = u, v = V();
|
2715
|
+
function h(c) {
|
2716
|
+
if (Array.isArray(c))
|
2717
|
+
return c.map((l) => h(l));
|
2718
|
+
if (c !== null && typeof c == "object") {
|
2719
|
+
const l = ve(c), x = {};
|
2720
|
+
for (const g in l)
|
2721
|
+
x[g] = h(l[g]);
|
2722
2722
|
return x;
|
2723
2723
|
}
|
2724
|
-
return
|
2724
|
+
return c;
|
2725
2725
|
}
|
2726
|
-
function b(
|
2726
|
+
function b(c, l) {
|
2727
2727
|
l !== void 0 ? t.value = {
|
2728
2728
|
...t.value,
|
2729
|
-
[
|
2730
|
-
} : delete t.value[
|
2731
|
-
data:
|
2732
|
-
name:
|
2733
|
-
value:
|
2729
|
+
[c]: l
|
2730
|
+
} : delete t.value[c], s("change", {
|
2731
|
+
data: h(t.value),
|
2732
|
+
name: c,
|
2733
|
+
value: h(l)
|
2734
2734
|
});
|
2735
2735
|
}
|
2736
|
-
function w(
|
2737
|
-
delete t.value[
|
2738
|
-
data:
|
2739
|
-
name:
|
2736
|
+
function w(c) {
|
2737
|
+
delete t.value[c], s("clear", {
|
2738
|
+
data: h(t.value),
|
2739
|
+
name: c
|
2740
2740
|
}), s("change", {
|
2741
|
-
data:
|
2742
|
-
name:
|
2741
|
+
data: h(t.value),
|
2742
|
+
name: c,
|
2743
2743
|
value: null
|
2744
2744
|
});
|
2745
2745
|
}
|
2746
2746
|
function m() {
|
2747
2747
|
t.value = {}, s("clear", {
|
2748
|
-
data:
|
2748
|
+
data: h(t.value),
|
2749
2749
|
name: "ALL"
|
2750
2750
|
}), s("change", {
|
2751
|
-
data:
|
2751
|
+
data: h(t.value),
|
2752
2752
|
name: "ALL",
|
2753
2753
|
value: null
|
2754
2754
|
});
|
2755
2755
|
}
|
2756
|
-
const
|
2756
|
+
const d = V({});
|
2757
2757
|
function y() {
|
2758
|
-
switch (
|
2758
|
+
switch (o.view) {
|
2759
2759
|
case "inline":
|
2760
2760
|
return Ue;
|
2761
2761
|
case "vertical":
|
@@ -2767,59 +2767,107 @@ const aa = /* @__PURE__ */ le(ea, [["render", la]]), oa = {
|
|
2767
2767
|
}
|
2768
2768
|
}
|
2769
2769
|
D(
|
2770
|
-
() =>
|
2771
|
-
(
|
2772
|
-
if (!
|
2773
|
-
|
2770
|
+
() => o.schema,
|
2771
|
+
(c) => {
|
2772
|
+
if (!c) {
|
2773
|
+
d.value = {};
|
2774
2774
|
return;
|
2775
2775
|
}
|
2776
|
-
if (Array.isArray(
|
2777
|
-
|
2776
|
+
if (Array.isArray(c) && !c.length) {
|
2777
|
+
d.value = {};
|
2778
2778
|
return;
|
2779
2779
|
}
|
2780
|
-
Array.isArray(
|
2780
|
+
Array.isArray(c) ? d.value = c.filter((l) => l.type).reduce((l, x) => (Object.assign(x, { name: x.id || x.name, type: x.type.toLowerCase() }), l[x.name] = x, x.data && !x.api && !x.options && Object.assign(x, { api: `/api/suggest/${x.data}` }), l), {}) : (Object.entries(c).forEach(([l, x]) => {
|
2781
2781
|
Object.assign(x, { name: l || x.name || x.id, type: x.type.toLowerCase() });
|
2782
|
-
}),
|
2782
|
+
}), d.value = { ...c });
|
2783
2783
|
},
|
2784
2784
|
{ immediate: !0, deep: !0 }
|
2785
2785
|
);
|
2786
|
-
function _(
|
2787
|
-
v.value.clearFilter(
|
2786
|
+
function _(c) {
|
2787
|
+
v.value.clearFilter(c), w(c);
|
2788
2788
|
}
|
2789
|
-
function
|
2789
|
+
function f() {
|
2790
2790
|
v.value.clearAllFilters(), m();
|
2791
2791
|
}
|
2792
|
-
return
|
2793
|
-
clearAllFilters:
|
2792
|
+
return n({
|
2793
|
+
clearAllFilters: f,
|
2794
2794
|
clearFilter: _
|
2795
|
-
}), (
|
2796
|
-
schema:
|
2795
|
+
}), (c, l) => (p(), z(ie(y()), Z(o, {
|
2796
|
+
schema: d.value,
|
2797
2797
|
onChange: l[0] || (l[0] = (x) => b(x.name, x.value)),
|
2798
2798
|
onClear: l[1] || (l[1] = (x) => w(x.name)),
|
2799
2799
|
onClearAll: m,
|
2800
2800
|
ref_key: "filterRef",
|
2801
2801
|
ref: v
|
2802
2802
|
}), {
|
2803
|
-
default:
|
2804
|
-
|
2803
|
+
default: se(() => [
|
2804
|
+
te(c.$slots, "default")
|
2805
2805
|
]),
|
2806
2806
|
_: 3
|
2807
2807
|
}, 16, ["schema"]));
|
2808
2808
|
}
|
2809
2809
|
});
|
2810
2810
|
xe.install = function(i) {
|
2811
|
-
i.component("Filter", xe), i.component("FilterField",
|
2811
|
+
i.component("Filter", xe), i.component("FilterField", ue);
|
2812
2812
|
};
|
2813
|
-
function
|
2814
|
-
const { page:
|
2815
|
-
|
2813
|
+
function _a(i) {
|
2814
|
+
const { page: n, id: u, filter: o } = i, t = new URL(window.location.href), s = new URLSearchParams(window.location.search);
|
2815
|
+
n ? s.set("page", n.toString()) : s.delete("page"), u ? s.set("id", u.toString()) : s.delete("id"), o ? s.set("filter", o) : s.delete("filter"), t.search = decodeURI(s.toString()), window.history.pushState({}, "", t);
|
2816
2816
|
}
|
2817
|
-
const
|
2817
|
+
const Ca = { class: "flex items-center justify-between w-full gap-x-1" }, Va = { class: "flex items-center" }, Sa = ["disabled"], $a = /* @__PURE__ */ a("svg", {
|
2818
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2819
|
+
viewBox: "0 0 24 24",
|
2820
|
+
fill: "none",
|
2821
|
+
stroke: "currentColor",
|
2822
|
+
"stroke-width": "2",
|
2823
|
+
"stroke-linecap": "round",
|
2824
|
+
"stroke-linejoin": "round",
|
2825
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down rotate-90",
|
2826
|
+
height: "16",
|
2827
|
+
width: "16"
|
2828
|
+
}, [
|
2829
|
+
/* @__PURE__ */ a("path", {
|
2830
|
+
stroke: "none",
|
2831
|
+
d: "M0 0h24v24H0z",
|
2832
|
+
fill: "none"
|
2833
|
+
}),
|
2834
|
+
/* @__PURE__ */ a("path", { d: "M6 9l6 6l6 -6" })
|
2835
|
+
], -1), Ma = /* @__PURE__ */ a("span", {
|
2836
|
+
"aria-hidden": "true",
|
2837
|
+
class: "sr-only"
|
2838
|
+
}, "Previous", -1), Ba = [
|
2839
|
+
$a,
|
2840
|
+
Ma
|
2841
|
+
], Aa = { class: "flex items-center gap-x-1" }, Ra = ["onClick"], Da = ["disabled"], za = /* @__PURE__ */ a("span", {
|
2842
|
+
"aria-hidden": "true",
|
2843
|
+
class: "sr-only"
|
2844
|
+
}, "Next", -1), ja = /* @__PURE__ */ a("svg", {
|
2845
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2846
|
+
viewBox: "0 0 24 24",
|
2847
|
+
fill: "none",
|
2848
|
+
stroke: "currentColor",
|
2849
|
+
"stroke-width": "2",
|
2850
|
+
"stroke-linecap": "round",
|
2851
|
+
"stroke-linejoin": "round",
|
2852
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down -rotate-90",
|
2853
|
+
height: "16",
|
2854
|
+
width: "16"
|
2855
|
+
}, [
|
2856
|
+
/* @__PURE__ */ a("path", {
|
2857
|
+
stroke: "none",
|
2858
|
+
d: "M0 0h24v24H0z",
|
2859
|
+
fill: "none"
|
2860
|
+
}),
|
2861
|
+
/* @__PURE__ */ a("path", { d: "M6 9l6 6l6 -6" })
|
2862
|
+
], -1), Fa = [
|
2863
|
+
za,
|
2864
|
+
ja
|
2865
|
+
], Ka = { class: "flex justify-center items-center gap-x-5 ml-3" }, La = { class: "relative" }, Ua = {
|
2818
2866
|
class: "hs-dropdown-menu z-50 bg-white shadow-md rounded-lg p-1 space-y-0.5 dark:bg-neutral-800 dark:border dark:border-neutral-700 right-0 dark:divide-neutral-700 absolute bottom-[100%]",
|
2819
2867
|
role: "menu",
|
2820
2868
|
"aria-orientation": "vertical",
|
2821
2869
|
"aria-labelledby": "dropdown-button"
|
2822
|
-
},
|
2870
|
+
}, Oa = ["onClick"], Ia = {
|
2823
2871
|
key: 0,
|
2824
2872
|
xmlns: "http://www.w3.org/2000/svg",
|
2825
2873
|
viewBox: "0 0 24 24",
|
@@ -2831,7 +2879,32 @@ const _a = { class: "flex items-center justify-between w-full gap-x-1" }, Va = {
|
|
2831
2879
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check text-blue-600",
|
2832
2880
|
width: "14",
|
2833
2881
|
height: "14"
|
2834
|
-
},
|
2882
|
+
}, Pa = /* @__PURE__ */ a("path", {
|
2883
|
+
stroke: "none",
|
2884
|
+
d: "M0 0h24v24H0z",
|
2885
|
+
fill: "none"
|
2886
|
+
}, null, -1), Ta = /* @__PURE__ */ a("path", { d: "M5 12l5 5l10 -10" }, null, -1), Ha = [
|
2887
|
+
Pa,
|
2888
|
+
Ta
|
2889
|
+
], Ea = /* @__PURE__ */ a("svg", {
|
2890
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2891
|
+
viewBox: "0 0 24 24",
|
2892
|
+
fill: "none",
|
2893
|
+
stroke: "currentColor",
|
2894
|
+
"stroke-width": "2",
|
2895
|
+
"stroke-linecap": "round",
|
2896
|
+
"stroke-linejoin": "round",
|
2897
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down",
|
2898
|
+
height: "16",
|
2899
|
+
width: "16"
|
2900
|
+
}, [
|
2901
|
+
/* @__PURE__ */ a("path", {
|
2902
|
+
stroke: "none",
|
2903
|
+
d: "M0 0h24v24H0z",
|
2904
|
+
fill: "none"
|
2905
|
+
}),
|
2906
|
+
/* @__PURE__ */ a("path", { d: "M6 9l6 6l6 -6" })
|
2907
|
+
], -1), Ya = /* @__PURE__ */ Y({
|
2835
2908
|
__name: "pagination",
|
2836
2909
|
props: {
|
2837
2910
|
total: {},
|
@@ -2839,29 +2912,31 @@ const _a = { class: "flex items-center justify-between w-full gap-x-1" }, Va = {
|
|
2839
2912
|
pageSize: {}
|
2840
2913
|
},
|
2841
2914
|
emits: ["update:currentPage", "update:pageSize", "pageChange", "pageSizeChange"],
|
2842
|
-
setup(i, { emit:
|
2843
|
-
const
|
2844
|
-
D(() =>
|
2915
|
+
setup(i, { emit: n }) {
|
2916
|
+
const u = i, o = n, t = V(u.currentPage), s = V(u.pageSize), v = V(!1);
|
2917
|
+
D(() => u.pageSize, (_) => {
|
2845
2918
|
s.value = _;
|
2846
2919
|
});
|
2847
|
-
const
|
2848
|
-
const
|
2849
|
-
let
|
2850
|
-
|
2920
|
+
const h = E(() => Math.ceil(u.total / u.pageSize)), b = E(() => {
|
2921
|
+
const f = Math.floor(3.5);
|
2922
|
+
let c = t.value - f, l = t.value + f;
|
2923
|
+
c < 1 && (l += 1 - c, c = 1), l > h.value && (c -= l - h.value, l = h.value), c = Math.max(1, c);
|
2851
2924
|
const x = [];
|
2852
|
-
for (let
|
2853
|
-
x.push(
|
2925
|
+
for (let g = c; g <= l; g += 1)
|
2926
|
+
x.push(g);
|
2854
2927
|
return x;
|
2855
2928
|
}), w = () => {
|
2856
|
-
t.value > 1 && (t.value
|
2929
|
+
t.value > 1 && d(t.value - 1);
|
2857
2930
|
}, m = () => {
|
2858
|
-
t.value <
|
2859
|
-
},
|
2860
|
-
t.value = _,
|
2931
|
+
t.value < h.value && d(t.value + 1);
|
2932
|
+
}, d = (_) => {
|
2933
|
+
t.value = _, o("update:currentPage", _), o("pageChange", _);
|
2861
2934
|
}, y = (_ = s.value) => {
|
2862
|
-
s.value = _, v.value = !1,
|
2935
|
+
s.value = _, v.value = !1, o("update:pageSize", s.value), o("update:currentPage", 1), o("pageSizeChange", s.value);
|
2863
2936
|
};
|
2864
|
-
return (
|
2937
|
+
return D(() => u.currentPage, (_) => {
|
2938
|
+
t.value = _;
|
2939
|
+
}), (_, f) => (p(), k("nav", Ca, [
|
2865
2940
|
a("div", Va, [
|
2866
2941
|
a("button", {
|
2867
2942
|
type: "button",
|
@@ -2869,90 +2944,35 @@ const _a = { class: "flex items-center justify-between w-full gap-x-1" }, Va = {
|
|
2869
2944
|
onClick: w,
|
2870
2945
|
disabled: t.value === 1,
|
2871
2946
|
class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
|
2872
|
-
},
|
2873
|
-
|
2874
|
-
|
2875
|
-
viewBox: "0 0 24 24",
|
2876
|
-
fill: "none",
|
2877
|
-
stroke: "currentColor",
|
2878
|
-
"stroke-width": "2",
|
2879
|
-
"stroke-linecap": "round",
|
2880
|
-
"stroke-linejoin": "round",
|
2881
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down rotate-90",
|
2882
|
-
height: "16",
|
2883
|
-
width: "16"
|
2884
|
-
}, [
|
2885
|
-
a("path", {
|
2886
|
-
stroke: "none",
|
2887
|
-
d: "M0 0h24v24H0z",
|
2888
|
-
fill: "none"
|
2889
|
-
}),
|
2890
|
-
a("path", { d: "M6 9l6 6l6 -6" })
|
2891
|
-
], -1),
|
2892
|
-
a("span", {
|
2893
|
-
"aria-hidden": "true",
|
2894
|
-
class: "sr-only"
|
2895
|
-
}, "Previous", -1)
|
2896
|
-
]), 8, Sa),
|
2897
|
-
a("div", Ma, [
|
2898
|
-
(p(!0), k(K, null, q(b.value, (u) => (p(), k("button", {
|
2947
|
+
}, Ba, 8, Sa),
|
2948
|
+
a("div", Aa, [
|
2949
|
+
(p(!0), k(F, null, N(b.value, (c) => (p(), k("button", {
|
2899
2950
|
type: "button",
|
2900
|
-
key:
|
2901
|
-
onClick: (l) =>
|
2902
|
-
class:
|
2903
|
-
},
|
2951
|
+
key: c,
|
2952
|
+
onClick: (l) => d(c),
|
2953
|
+
class: j(t.value === c ? "flex justify-center items-center rounded-lg text-sm dark:text-neutral-300 py-2 px-3 focus:outline-none disabled:opacity-50 disabled:pointer-events-none bg-[#e5e7eb] dark:bg-[#242424] border border-gray-200 text-base h-[38px] min-w-[38px]" : "flex justify-center items-center rounded-lg text-sm dark:text-neutral-400 hover:bg-gray-100 py-2 px-3 focus:outline-none focus:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:hover:bg-neutral-800 dark:focus:bg-neutral-800 text-base h-[38px] min-w-[38px]")
|
2954
|
+
}, K(c), 11, Ra))), 128))
|
2904
2955
|
]),
|
2905
2956
|
a("button", {
|
2906
2957
|
type: "button",
|
2907
2958
|
"aria-label": "Next",
|
2908
2959
|
onClick: m,
|
2909
|
-
disabled: t.value ===
|
2960
|
+
disabled: t.value === h.value,
|
2910
2961
|
class: "border-white last:rounded-e-lg text-base h-[38px] min-w-[38px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 border text-sm rounded-lg bg-white text-gray-800 hover:shadow-sm hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-700 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 py-2"
|
2911
|
-
},
|
2912
|
-
a("span", {
|
2913
|
-
"aria-hidden": "true",
|
2914
|
-
class: "sr-only"
|
2915
|
-
}, "Next", -1),
|
2916
|
-
a("svg", {
|
2917
|
-
xmlns: "http://www.w3.org/2000/svg",
|
2918
|
-
viewBox: "0 0 24 24",
|
2919
|
-
fill: "none",
|
2920
|
-
stroke: "currentColor",
|
2921
|
-
"stroke-width": "2",
|
2922
|
-
"stroke-linecap": "round",
|
2923
|
-
"stroke-linejoin": "round",
|
2924
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down -rotate-90",
|
2925
|
-
height: "16",
|
2926
|
-
width: "16"
|
2927
|
-
}, [
|
2928
|
-
a("path", {
|
2929
|
-
stroke: "none",
|
2930
|
-
d: "M0 0h24v24H0z",
|
2931
|
-
fill: "none"
|
2932
|
-
}),
|
2933
|
-
a("path", { d: "M6 9l6 6l6 -6" })
|
2934
|
-
], -1)
|
2935
|
-
]), 8, $a)
|
2962
|
+
}, Fa, 8, Da)
|
2936
2963
|
]),
|
2937
|
-
a("div",
|
2938
|
-
a("div",
|
2939
|
-
P(a("div",
|
2940
|
-
(p(), k(
|
2964
|
+
a("div", Ka, [
|
2965
|
+
a("div", La, [
|
2966
|
+
P(a("div", Ua, [
|
2967
|
+
(p(), k(F, null, N([10, 20, 30], (c) => a("button", {
|
2941
2968
|
type: "button",
|
2942
|
-
key:
|
2943
|
-
onClick: (l) => y(
|
2969
|
+
key: c,
|
2970
|
+
onClick: (l) => y(c),
|
2944
2971
|
class: "w-full flex items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-400 dark:hover:bg-neutral-700 dark:hover:text-neutral-300 dark:focus:bg-neutral-700"
|
2945
2972
|
}, [
|
2946
|
-
W(
|
2947
|
-
s.value ===
|
2948
|
-
|
2949
|
-
stroke: "none",
|
2950
|
-
d: "M0 0h24v24H0z",
|
2951
|
-
fill: "none"
|
2952
|
-
}, null, -1),
|
2953
|
-
a("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
2954
|
-
]))) : S("", !0)
|
2955
|
-
], 8, za)), 64))
|
2973
|
+
W(K(c) + " ", 1),
|
2974
|
+
s.value === c ? (p(), k("svg", Ia, Ha)) : S("", !0)
|
2975
|
+
], 8, Oa)), 64))
|
2956
2976
|
], 512), [
|
2957
2977
|
[X, v.value]
|
2958
2978
|
]),
|
@@ -2962,52 +2982,34 @@ const _a = { class: "flex items-center justify-between w-full gap-x-1" }, Va = {
|
|
2962
2982
|
"aria-haspopup": "menu",
|
2963
2983
|
"aria-expanded": "false",
|
2964
2984
|
"aria-label": "Dropdown",
|
2965
|
-
onClick:
|
2985
|
+
onClick: f[0] || (f[0] = (c) => v.value = !v.value)
|
2966
2986
|
}, [
|
2967
|
-
W(
|
2968
|
-
|
2969
|
-
xmlns: "http://www.w3.org/2000/svg",
|
2970
|
-
viewBox: "0 0 24 24",
|
2971
|
-
fill: "none",
|
2972
|
-
stroke: "currentColor",
|
2973
|
-
"stroke-width": "2",
|
2974
|
-
"stroke-linecap": "round",
|
2975
|
-
"stroke-linejoin": "round",
|
2976
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down",
|
2977
|
-
height: "16",
|
2978
|
-
width: "16"
|
2979
|
-
}, [
|
2980
|
-
a("path", {
|
2981
|
-
stroke: "none",
|
2982
|
-
d: "M0 0h24v24H0z",
|
2983
|
-
fill: "none"
|
2984
|
-
}),
|
2985
|
-
a("path", { d: "M6 9l6 6l6 -6" })
|
2986
|
-
], -1))
|
2987
|
+
W(K(s.value) + " ", 1),
|
2988
|
+
Ea
|
2987
2989
|
])
|
2988
2990
|
])
|
2989
2991
|
])
|
2990
2992
|
]));
|
2991
2993
|
}
|
2992
|
-
}), me = (i,
|
2993
|
-
const
|
2994
|
-
for (const [
|
2995
|
-
|
2996
|
-
return
|
2997
|
-
},
|
2994
|
+
}), me = (i, n) => {
|
2995
|
+
const u = i.__vccOpts || i;
|
2996
|
+
for (const [o, t] of n)
|
2997
|
+
u[o] = t;
|
2998
|
+
return u;
|
2999
|
+
}, Wa = {}, qa = {
|
2998
3000
|
class: "w-48 mx-auto mb-4",
|
2999
3001
|
width: "178",
|
3000
3002
|
height: "90",
|
3001
3003
|
viewBox: "0 0 178 90",
|
3002
3004
|
fill: "none",
|
3003
3005
|
xmlns: "http://www.w3.org/2000/svg"
|
3004
|
-
}
|
3005
|
-
|
3006
|
-
|
3007
|
-
|
3008
|
-
|
3006
|
+
}, Na = /* @__PURE__ */ Te('<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-stone-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-stone-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-stone-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-stone-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter2)"><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-stone-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-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-stone-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter2" 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), Ga = [
|
3007
|
+
Na
|
3008
|
+
];
|
3009
|
+
function Qa(i, n) {
|
3010
|
+
return p(), k("svg", qa, Ga);
|
3009
3011
|
}
|
3010
|
-
const
|
3012
|
+
const Za = /* @__PURE__ */ me(Wa, [["render", Qa]]), Ja = {}, Xa = {
|
3011
3013
|
xmlns: "http://www.w3.org/2000/svg",
|
3012
3014
|
width: "21",
|
3013
3015
|
height: "20",
|
@@ -3018,20 +3020,20 @@ const Oa = /* @__PURE__ */ me(Ka, [["render", Ua]]), Ia = {}, Pa = {
|
|
3018
3020
|
"stroke-linecap": "round",
|
3019
3021
|
"stroke-linejoin": "round",
|
3020
3022
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-collapse"
|
3021
|
-
}
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3023
|
+
}, eo = /* @__PURE__ */ a("path", {
|
3024
|
+
stroke: "none",
|
3025
|
+
d: "M0 0h24v24H0z",
|
3026
|
+
fill: "none"
|
3027
|
+
}, null, -1), to = /* @__PURE__ */ a("path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1), lo = /* @__PURE__ */ a("path", { d: "M15 4v16" }, null, -1), ao = /* @__PURE__ */ a("path", { d: "M9 10l2 2l-2 2" }, null, -1), oo = [
|
3028
|
+
eo,
|
3029
|
+
to,
|
3030
|
+
lo,
|
3031
|
+
ao
|
3032
|
+
];
|
3033
|
+
function no(i, n) {
|
3034
|
+
return p(), k("svg", Xa, oo);
|
3033
3035
|
}
|
3034
|
-
const
|
3036
|
+
const ro = /* @__PURE__ */ me(Ja, [["render", no]]), io = {}, so = {
|
3035
3037
|
xmlns: "http://www.w3.org/2000/svg",
|
3036
3038
|
width: "21",
|
3037
3039
|
height: "20",
|
@@ -3042,20 +3044,20 @@ const Ha = /* @__PURE__ */ me(Ia, [["render", Ta]]), Ea = {}, Ya = {
|
|
3042
3044
|
"stroke-linecap": "round",
|
3043
3045
|
"stroke-linejoin": "round",
|
3044
3046
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-layout-sidebar-right-expand"
|
3045
|
-
}
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
3049
|
-
|
3050
|
-
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3047
|
+
}, uo = /* @__PURE__ */ a("path", {
|
3048
|
+
stroke: "none",
|
3049
|
+
d: "M0 0h24v24H0z",
|
3050
|
+
fill: "none"
|
3051
|
+
}, null, -1), co = /* @__PURE__ */ a("path", { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" }, null, -1), po = /* @__PURE__ */ a("path", { d: "M15 4v16" }, null, -1), fo = /* @__PURE__ */ a("path", { d: "M10 10l-2 2l2 2" }, null, -1), vo = [
|
3052
|
+
uo,
|
3053
|
+
co,
|
3054
|
+
po,
|
3055
|
+
fo
|
3056
|
+
];
|
3057
|
+
function mo(i, n) {
|
3058
|
+
return p(), k("svg", so, vo);
|
3057
3059
|
}
|
3058
|
-
const
|
3060
|
+
const ho = /* @__PURE__ */ me(io, [["render", mo]]), go = {}, bo = {
|
3059
3061
|
xmlns: "http://www.w3.org/2000/svg",
|
3060
3062
|
width: "24",
|
3061
3063
|
height: "24",
|
@@ -3066,20 +3068,20 @@ const qa = /* @__PURE__ */ me(Ea, [["render", Wa]]), Na = {}, Ga = {
|
|
3066
3068
|
"stroke-linecap": "round",
|
3067
3069
|
"stroke-linejoin": "round",
|
3068
3070
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map"
|
3069
|
-
}
|
3070
|
-
|
3071
|
-
|
3072
|
-
|
3073
|
-
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
3079
|
-
|
3080
|
-
|
3071
|
+
}, yo = /* @__PURE__ */ a("path", {
|
3072
|
+
stroke: "none",
|
3073
|
+
d: "M0 0h24v24H0z",
|
3074
|
+
fill: "none"
|
3075
|
+
}, null, -1), xo = /* @__PURE__ */ a("path", { d: "M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13" }, null, -1), wo = /* @__PURE__ */ a("path", { d: "M9 4v13" }, null, -1), ko = /* @__PURE__ */ a("path", { d: "M15 7v13" }, null, -1), _o = [
|
3076
|
+
yo,
|
3077
|
+
xo,
|
3078
|
+
wo,
|
3079
|
+
ko
|
3080
|
+
];
|
3081
|
+
function Co(i, n) {
|
3082
|
+
return p(), k("svg", bo, _o);
|
3081
3083
|
}
|
3082
|
-
const
|
3084
|
+
const Vo = /* @__PURE__ */ me(go, [["render", Co]]), So = {}, $o = {
|
3083
3085
|
xmlns: "http://www.w3.org/2000/svg",
|
3084
3086
|
width: "24",
|
3085
3087
|
height: "24",
|
@@ -3090,35 +3092,35 @@ const Za = /* @__PURE__ */ me(Na, [["render", Qa]]), Ja = {}, Xa = {
|
|
3090
3092
|
"stroke-linecap": "round",
|
3091
3093
|
"stroke-linejoin": "round",
|
3092
3094
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-table"
|
3093
|
-
}
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3095
|
+
}, Mo = /* @__PURE__ */ a("path", {
|
3096
|
+
stroke: "none",
|
3097
|
+
d: "M0 0h24v24H0z",
|
3098
|
+
fill: "none"
|
3099
|
+
}, null, -1), Bo = /* @__PURE__ */ a("path", { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, null, -1), Ao = /* @__PURE__ */ a("path", { d: "M3 10h18" }, null, -1), Ro = /* @__PURE__ */ a("path", { d: "M10 3v18" }, null, -1), Do = [
|
3100
|
+
Mo,
|
3101
|
+
Bo,
|
3102
|
+
Ao,
|
3103
|
+
Ro
|
3104
|
+
];
|
3105
|
+
function zo(i, n) {
|
3106
|
+
return p(), k("svg", $o, Do);
|
3105
3107
|
}
|
3106
|
-
const
|
3107
|
-
function
|
3108
|
-
let
|
3109
|
-
return function(...
|
3110
|
-
clearTimeout(
|
3108
|
+
const jo = /* @__PURE__ */ me(So, [["render", zo]]);
|
3109
|
+
function Fo(i, n) {
|
3110
|
+
let u;
|
3111
|
+
return function(...o) {
|
3112
|
+
clearTimeout(u), u = setTimeout(() => i(...o), n);
|
3111
3113
|
};
|
3112
3114
|
}
|
3113
|
-
function
|
3114
|
-
|
3115
|
+
function Ko(i, n, u, o) {
|
3116
|
+
n && (n.addSource("vector", {
|
3115
3117
|
type: "vector",
|
3116
3118
|
tiles: [
|
3117
|
-
`http://${window.location.host}/api/vtile/${i}/ua/{z}/{x}/{y}.vmt?pointZoom=12`
|
3119
|
+
`http://${window.location.host}/api/vtile/${i}/ua/{z}/{x}/{y}.vmt?pointZoom=12` + (o ? `&filter=${o}` : "")
|
3118
3120
|
],
|
3119
3121
|
minzoom: 0,
|
3120
3122
|
maxzoom: 12
|
3121
|
-
}),
|
3123
|
+
}), n.addLayer({
|
3122
3124
|
id: "vector-circle",
|
3123
3125
|
type: "circle",
|
3124
3126
|
maxzoom: 12,
|
@@ -3126,12 +3128,12 @@ function ao(i, o, d) {
|
|
3126
3128
|
"source-layer": i,
|
3127
3129
|
// must match the layer name in the vector tile source
|
3128
3130
|
paint: {
|
3129
|
-
"circle-color":
|
3131
|
+
"circle-color": u,
|
3130
3132
|
"circle-stroke-color": "#eee",
|
3131
3133
|
"circle-stroke-width": 1,
|
3132
3134
|
"circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 5, 15, 12]
|
3133
3135
|
}
|
3134
|
-
}),
|
3136
|
+
}), n.addLayer({
|
3135
3137
|
id: "vector-fill",
|
3136
3138
|
type: "fill",
|
3137
3139
|
minzoom: 12,
|
@@ -3139,12 +3141,12 @@ function ao(i, o, d) {
|
|
3139
3141
|
"source-layer": i,
|
3140
3142
|
// must match the layer name in the vector tile source
|
3141
3143
|
paint: {
|
3142
|
-
"fill-color":
|
3144
|
+
"fill-color": u,
|
3143
3145
|
"fill-opacity": 0.6
|
3144
3146
|
}
|
3145
3147
|
}));
|
3146
3148
|
}
|
3147
|
-
const
|
3149
|
+
const he = [
|
3148
3150
|
{
|
3149
3151
|
name: "voyager",
|
3150
3152
|
label: "Базова карта (voyager)",
|
@@ -3169,10 +3171,10 @@ const ge = [
|
|
3169
3171
|
url: "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
3170
3172
|
preview: "https://mt1.google.com/vt/lyrs=s&x=2422&y=1400&z=12"
|
3171
3173
|
}
|
3172
|
-
],
|
3174
|
+
], Lo = { class: "relative w-auto h-full" }, Uo = { class: "absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border" }, Oo = { class: "flex justify-start items-center gap-2" }, Io = { class: "ml-1 text-[0.875rem]" }, Po = {
|
3173
3175
|
class: "vs-map-slot-layers z-10 select-none",
|
3174
3176
|
style: { display: "flex" }
|
3175
|
-
},
|
3177
|
+
}, To = ["title", "onClick"], Ho = ["src"], Eo = { class: "absolute py-2 px-4 text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg top-[-46px] hidden whitespace-nowrap left-1/2 -translate-x-1/2" }, Yo = /* @__PURE__ */ Y({
|
3176
3178
|
__name: "map",
|
3177
3179
|
props: {
|
3178
3180
|
table: {},
|
@@ -3184,10 +3186,10 @@ const ge = [
|
|
3184
3186
|
map: {}
|
3185
3187
|
},
|
3186
3188
|
emits: ["update:modelValue", "update:map"],
|
3187
|
-
setup(i, { emit:
|
3188
|
-
const
|
3189
|
+
setup(i, { emit: n }) {
|
3190
|
+
const u = i, o = n;
|
3189
3191
|
let t, s;
|
3190
|
-
const v = V(null),
|
3192
|
+
const v = V(null), h = V(!1), b = V(he[0].name), w = he[0], m = V(null), d = V(null), y = [
|
3191
3193
|
"#2563EB",
|
3192
3194
|
// Primary Blue
|
3193
3195
|
"#60A5FA",
|
@@ -3210,9 +3212,9 @@ const ge = [
|
|
3210
3212
|
// Light Gray
|
3211
3213
|
];
|
3212
3214
|
let _;
|
3213
|
-
const
|
3214
|
-
return
|
3215
|
-
_ = (await fetch(`/api/data/${
|
3215
|
+
const f = [30, 48];
|
3216
|
+
return pe(async () => {
|
3217
|
+
_ = (await fetch(`/api/data/${u.table}/${u.colorAttr}`).then((l) => l.json())).rows, _.forEach((l, x) => {
|
3216
3218
|
l.color || Object.assign(l, { color: y[x % 10] });
|
3217
3219
|
}), s = new maplibregl.Popup({
|
3218
3220
|
closeButton: !1,
|
@@ -3232,69 +3234,69 @@ const ge = [
|
|
3232
3234
|
maxzoom: 19
|
3233
3235
|
}]
|
3234
3236
|
},
|
3235
|
-
center:
|
3237
|
+
center: u.center || f,
|
3236
3238
|
// [lng, lat] → Paris
|
3237
|
-
zoom:
|
3239
|
+
zoom: u.zoom || 5,
|
3238
3240
|
minZoom: 3,
|
3239
3241
|
maxZoom: 18,
|
3240
3242
|
attributionControl: !1
|
3241
|
-
}),
|
3243
|
+
}), o("update:map", t), t.addControl(new maplibregl.NavigationControl(), "top-right"), t.on("zoom", () => {
|
3242
3244
|
console.log("Zoom is changing:", t.getZoom());
|
3243
3245
|
}), t.on("load", () => {
|
3244
|
-
t == null || t.resize(),
|
3245
|
-
const l = _.filter((
|
3246
|
-
|
3246
|
+
t == null || t.resize(), h.value = !0;
|
3247
|
+
const l = _.filter((g) => g.id).reduce((g, r) => [r.id, r.color].concat(g), []), x = ["match", ["get", u.colorAttr], ...l, "#808080"];
|
3248
|
+
Ko(u.table, t, x, u.filter);
|
3247
3249
|
}), t.on("click", (l) => {
|
3248
3250
|
const x = t.queryRenderedFeatures(l.point);
|
3249
|
-
x.length &&
|
3251
|
+
x.length && o("update:modelValue", x[0].properties.id);
|
3250
3252
|
}), t.on("mousemove", (l) => {
|
3251
|
-
var
|
3253
|
+
var $;
|
3252
3254
|
const x = t.queryRenderedFeatures(l.point);
|
3253
3255
|
if (!x || !x.length) {
|
3254
3256
|
s.remove(), t.getCanvas().style.cursor = "";
|
3255
3257
|
return;
|
3256
3258
|
}
|
3257
3259
|
t.getCanvas().style.cursor = "pointer";
|
3258
|
-
const
|
3259
|
-
|
3260
|
+
const g = x[0], { coordinates: r } = g.geometry, C = g.geometry.type === "Point" ? r : r[0][0];
|
3261
|
+
d.value = g.properties, s.setLngLat(C).setHTML(($ = m.value) == null ? void 0 : $.innerHTML).addTo(t);
|
3260
3262
|
});
|
3261
|
-
}), D(() =>
|
3262
|
-
t && t.setCenter(
|
3263
|
-
}), D(() =>
|
3264
|
-
t && t.setZoom(
|
3265
|
-
}), D(() =>
|
3266
|
-
const l = `http://${window.location.host}/api/vtile/${
|
3267
|
-
t.getSource("vector").setTiles([l]);
|
3268
|
-
}), D(b, (
|
3269
|
-
const x =
|
3270
|
-
x && (t.removeLayer(l), t.removeSource(l), t.addSource(
|
3263
|
+
}), D(() => u.center, (c) => {
|
3264
|
+
t && t.setCenter(c || f);
|
3265
|
+
}), D(() => u.zoom, (c) => {
|
3266
|
+
t && t.setZoom(c);
|
3267
|
+
}), D(() => u.filter, (c) => {
|
3268
|
+
const l = `http://${window.location.host}/api/vtile/${u.table}/ua/{z}/{x}/{y}.vmt?pointZoom=12&filter=${c}`;
|
3269
|
+
t != null && t.getSource("vector") && t.getSource("vector").setTiles([l]);
|
3270
|
+
}), D(b, (c, l) => {
|
3271
|
+
const x = he.find((g) => g.name === c);
|
3272
|
+
x && (t.removeLayer(l), t.removeSource(l), t.addSource(c, { type: "raster", tiles: [x.url], tileSize: 256 }), t.addLayer({
|
3271
3273
|
id: x.name,
|
3272
3274
|
type: "raster",
|
3273
3275
|
source: x.name,
|
3274
3276
|
minzoom: 0,
|
3275
3277
|
maxzoom: 19
|
3276
3278
|
}, "vector-circle"));
|
3277
|
-
}),
|
3279
|
+
}), ge(() => {
|
3278
3280
|
t && t.remove();
|
3279
|
-
}), (
|
3281
|
+
}), (c, l) => {
|
3280
3282
|
const x = et("tooltip");
|
3281
|
-
return P((p(), k("div",
|
3283
|
+
return P((p(), k("div", Lo, [
|
3282
3284
|
a("div", {
|
3283
3285
|
ref_key: "mapContainer",
|
3284
3286
|
ref: v,
|
3285
3287
|
class: "map-container w-auto relative"
|
3286
3288
|
}, null, 512),
|
3287
|
-
a("div",
|
3288
|
-
(p(!0), k(
|
3289
|
+
a("div", Uo, [
|
3290
|
+
(p(!0), k(F, null, N(e(_), (g) => (p(), k("div", {
|
3289
3291
|
class: "legend-item",
|
3290
|
-
key:
|
3292
|
+
key: g.id
|
3291
3293
|
}, [
|
3292
|
-
a("div",
|
3294
|
+
a("div", Oo, [
|
3293
3295
|
a("div", {
|
3294
3296
|
class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
|
3295
|
-
style:
|
3297
|
+
style: ke("background-color:" + g.color)
|
3296
3298
|
}, null, 4),
|
3297
|
-
a("div",
|
3299
|
+
a("div", Io, K(g.text), 1)
|
3298
3300
|
])
|
3299
3301
|
]))), 128))
|
3300
3302
|
]),
|
@@ -3303,35 +3305,35 @@ const ge = [
|
|
3303
3305
|
ref: m,
|
3304
3306
|
style: { display: "none" }
|
3305
3307
|
}, [
|
3306
|
-
|
3308
|
+
te(c.$slots, "default", { hoverData: d.value })
|
3307
3309
|
], 512),
|
3308
|
-
a("div",
|
3309
|
-
(p(!0), k(
|
3310
|
-
key:
|
3311
|
-
title:
|
3312
|
-
class:
|
3313
|
-
onClick: (
|
3310
|
+
a("div", Po, [
|
3311
|
+
(p(!0), k(F, null, N(e(he), (g) => P((p(), k("div", {
|
3312
|
+
key: g.name,
|
3313
|
+
title: g.label || g.name,
|
3314
|
+
class: j(["vs-map-slot-layers__layer relative", { focused: b.value === g.name }]),
|
3315
|
+
onClick: (r) => b.value = g.name
|
3314
3316
|
}, [
|
3315
3317
|
a("img", {
|
3316
|
-
src:
|
3318
|
+
src: g.preview,
|
3317
3319
|
class: "vs-map-slot-layers__image"
|
3318
|
-
}, null, 8,
|
3319
|
-
a("div",
|
3320
|
-
], 10,
|
3321
|
-
[x,
|
3320
|
+
}, null, 8, Ho),
|
3321
|
+
a("div", Eo, K(g.label), 1)
|
3322
|
+
], 10, To)), [
|
3323
|
+
[x, g.label || g.name]
|
3322
3324
|
])), 128))
|
3323
3325
|
])
|
3324
3326
|
], 512)), [
|
3325
|
-
[X,
|
3327
|
+
[X, h.value]
|
3326
3328
|
]);
|
3327
3329
|
};
|
3328
3330
|
}
|
3329
3331
|
}), Ze = {
|
3330
|
-
mounted(i,
|
3332
|
+
mounted(i, n) {
|
3331
3333
|
if (typeof document > "u") return;
|
3332
|
-
let
|
3333
|
-
const
|
3334
|
-
|
3334
|
+
let u = null;
|
3335
|
+
const o = () => {
|
3336
|
+
u = document.createElement("div"), u.textContent = n.value, Object.assign(u.style, {
|
3335
3337
|
position: "absolute",
|
3336
3338
|
background: "#333",
|
3337
3339
|
color: "#fff",
|
@@ -3341,32 +3343,32 @@ const ge = [
|
|
3341
3343
|
whiteSpace: "nowrap",
|
3342
3344
|
pointerEvents: "none",
|
3343
3345
|
zIndex: "9999"
|
3344
|
-
}), document.body.appendChild(
|
3346
|
+
}), document.body.appendChild(u);
|
3345
3347
|
const s = i.getBoundingClientRect();
|
3346
|
-
|
3348
|
+
u.style.left = `${s.left + window.scrollX}px`, u.style.top = `${s.top + window.scrollY - u.offsetHeight - 5}px`;
|
3347
3349
|
}, t = () => {
|
3348
|
-
|
3350
|
+
u && u.parentNode && (u.parentNode.removeChild(u), u = null);
|
3349
3351
|
};
|
3350
|
-
i.addEventListener("mouseenter",
|
3352
|
+
i.addEventListener("mouseenter", o), i.addEventListener("mouseleave", t), Object.assign(i, { tooltipHandlers: { showTooltip: o, hideTooltip: t } });
|
3351
3353
|
},
|
3352
3354
|
unmounted(i) {
|
3353
3355
|
if (typeof document > "u") return;
|
3354
|
-
const
|
3355
|
-
|
3356
|
+
const n = i.tooltipHandlers;
|
3357
|
+
n && (i.removeEventListener("mouseenter", n.showTooltip), i.removeEventListener("mouseleave", n.hideTooltip));
|
3356
3358
|
}
|
3357
|
-
},
|
3359
|
+
}, Wo = { class: "pt-[20px]" }, qo = { class: "w-full gap-5 inline-flex mb-[6px] pr-3" }, No = { class: "flex items-center" }, Go = ["title"], Qo = /* @__PURE__ */ a("span", { class: "sr-only" }, "Відкрити мапу", -1), Zo = { class: "max-[1000px]:flex gap-2 min-[1001px]:hidden" }, Jo = { class: "flex" }, Xo = {
|
3358
3360
|
key: 0,
|
3359
3361
|
class: "py-[15px] pb-[24px] pl-2"
|
3360
|
-
},
|
3362
|
+
}, en = { class: "font-bold text-2xl mr-[10px]" }, tn = { class: "text-sm text-stone-500 font-medium" }, ln = /* @__PURE__ */ a("span", { class: "text-sm text-stone-500 font-medium" }, " об'єктів", -1), an = {
|
3361
3363
|
class: "wrapperTable flex flex-col",
|
3362
3364
|
style: { height: "calc(100vh - 302px)" }
|
3363
|
-
},
|
3365
|
+
}, on = {
|
3364
3366
|
key: 1,
|
3365
3367
|
class: "text-center py-28"
|
3366
|
-
},
|
3368
|
+
}, nn = /* @__PURE__ */ a("h2", { class: "font-medium text-base text-gray-500 rounded-xl" }, " За вашим запитом даних не знайдено! ", -1), rn = /* @__PURE__ */ a("p", { class: "font-normal text-sm text-gray-500 rounded-xl" }, " Введіть, будь ласка, інші значення для пошуку. ", -1), sn = { key: 1 }, un = {
|
3367
3369
|
key: 2,
|
3368
3370
|
class: "my-5 pr-2"
|
3369
|
-
},
|
3371
|
+
}, cn = { class: "flex justify-between" }, dn = { class: "w-full lg:w-1/2 relative" }, Oe = /* @__PURE__ */ Y({
|
3370
3372
|
__name: "vs-parts-map",
|
3371
3373
|
props: {
|
3372
3374
|
title: {},
|
@@ -3382,201 +3384,205 @@ const ge = [
|
|
3382
3384
|
history: { type: Boolean }
|
3383
3385
|
},
|
3384
3386
|
emits: ["change:filter", "update:map"],
|
3385
|
-
setup(i, { emit:
|
3386
|
-
var
|
3387
|
-
const
|
3388
|
-
|
3389
|
-
function
|
3387
|
+
setup(i, { emit: n }) {
|
3388
|
+
var ce, oe, Ae, Re, De, ze, je;
|
3389
|
+
const u = tt();
|
3390
|
+
u && !(u != null && u.appContext.directives.tooltip) && (console.log("init tooltip"), u.appContext.directives.tooltip = Ze);
|
3391
|
+
function o(R) {
|
3390
3392
|
return R ? (R.type === "Point" ? R.coordinates : null) || (R.type.includes("Multi") ? R.coordinates[0][0][0] : R.coordinates[0][0]) : null;
|
3391
3393
|
}
|
3392
|
-
const t = i, s =
|
3393
|
-
v.value = t.initTotal ?? ((
|
3394
|
-
const
|
3395
|
-
function
|
3396
|
-
return Object.entries(R).filter(([,
|
3394
|
+
const t = i, s = n, v = V(0);
|
3395
|
+
v.value = t.initTotal ?? ((ce = t.rows) == null ? void 0 : ce.length) ?? 0;
|
3396
|
+
const h = V(""), b = V(null), w = V(!0), m = V(((oe = t.rows) == null ? void 0 : oe.length) === 1), d = V(0), y = V(t.rows), _ = V(1), f = V(20), c = V(t.filters || []), l = V(""), x = V({}), g = V(((Ae = t.rows) == null ? void 0 : Ae.length) === 1 ? t.rows[0] : {}), r = V(((Re = t.rows) == null ? void 0 : Re.length) === 1 ? t.rows[0].id : ""), C = V(((De = t.rows) == null ? void 0 : De.length) === 1 ? o((ze = t.rows[0]) == null ? void 0 : ze.geom) : t.center || null), $ = V(((je = t.rows) == null ? void 0 : je.length) === 1 ? 14 : t.zoom || 5);
|
3397
|
+
function B(R) {
|
3398
|
+
return Object.entries(R).filter(([, L]) => L).map(([L, ne]) => `${L}=${ne}`).join("|");
|
3397
3399
|
}
|
3398
3400
|
async function A() {
|
3399
|
-
const R =
|
3401
|
+
const R = B(x.value);
|
3400
3402
|
l.value = R;
|
3401
3403
|
try {
|
3402
|
-
const
|
3403
|
-
search:
|
3404
|
-
limit:
|
3404
|
+
const L = {
|
3405
|
+
search: h.value,
|
3406
|
+
limit: f.value.toString(),
|
3405
3407
|
page: _.value.toString(),
|
3406
3408
|
filter: R
|
3407
|
-
},
|
3408
|
-
if (
|
3409
|
-
const [
|
3410
|
-
|
3409
|
+
}, ne = new URL(`/api/data/${t.table}`, window.location.origin) + (r.value ? `/${r.value}` : ""), q = new URLSearchParams(L).toString(), re = await fetch(`${ne.toString()}?${q}`).then((ee) => ee.json());
|
3410
|
+
if (r.value) {
|
3411
|
+
const [ee] = re.rows;
|
3412
|
+
g.value = ee, C.value = o(ee == null ? void 0 : ee.geom), $.value = 14, m.value = !0;
|
3411
3413
|
} else
|
3412
|
-
m.value = !1,
|
3413
|
-
v.value =
|
3414
|
-
} catch (
|
3415
|
-
console.error(
|
3414
|
+
m.value = !1, $.value = t.zoom || 5, y.value = re == null ? void 0 : re.rows;
|
3415
|
+
v.value = re.filtered, _a({ page: _.value, filter: R, id: r.value });
|
3416
|
+
} catch (L) {
|
3417
|
+
console.error(L.message);
|
3416
3418
|
}
|
3417
3419
|
}
|
3418
|
-
const T =
|
3420
|
+
const T = Fo(A, 300);
|
3419
3421
|
function U(R) {
|
3420
|
-
|
3422
|
+
f.value = R, _.value = 1, A();
|
3421
3423
|
}
|
3422
|
-
function
|
3424
|
+
function fe(R) {
|
3423
3425
|
_.value = R, A();
|
3424
3426
|
}
|
3425
3427
|
function J(R) {
|
3426
|
-
x.value = R.data, _.value = 1,
|
3428
|
+
x.value = R.data, _.value = 1, r.value ? r.value = "" : A(), s("change:filter", R);
|
3427
3429
|
}
|
3428
3430
|
async function H() {
|
3429
3431
|
if (t.filters) return;
|
3430
|
-
const
|
3431
|
-
|
3432
|
+
const L = await (await fetch(`/api/filter/${t.table}`)).json();
|
3433
|
+
c.value = L.list;
|
3432
3434
|
}
|
3433
|
-
function
|
3434
|
-
x.value = {},
|
3435
|
+
function M() {
|
3436
|
+
x.value = {}, h.value = "", A();
|
3435
3437
|
}
|
3436
|
-
|
3437
|
-
|
3438
|
+
pe(async () => {
|
3439
|
+
var L, ne;
|
3440
|
+
d.value = window.innerWidth, d.value < 1e3 && (w.value = !1);
|
3438
3441
|
const R = new URLSearchParams(window.location.search);
|
3439
|
-
_.value = Number(R.get("page")) || 1,
|
3442
|
+
_.value = Number(R.get("page")) || 1, f.value = Number(R.get("limit")) || f.value, r.value = R.get("id") || "", m.value = !!r.value, l.value = R.get("filter") || "", (ne = (L = R.get("filter")) == null ? void 0 : L.split("|")) == null || ne.forEach((q) => {
|
3443
|
+
const [re, ee] = q.split("=");
|
3444
|
+
re && (x.value[re] = ee != null && ee.includes(",") ? ee.split(",") : [ee]);
|
3445
|
+
}), H(), !y.value && !r.value && A();
|
3440
3446
|
});
|
3441
3447
|
function O() {
|
3442
|
-
m.value = !1,
|
3448
|
+
m.value = !1, g.value = null, r.value = "", A();
|
3443
3449
|
}
|
3444
3450
|
function Q(R) {
|
3445
|
-
|
3451
|
+
r.value = R.id;
|
3446
3452
|
}
|
3447
3453
|
return D(b, (R) => {
|
3448
3454
|
s("update:map", R);
|
3449
|
-
}), D(
|
3455
|
+
}), D(h, (R) => {
|
3450
3456
|
R || A();
|
3451
|
-
}), D(
|
3457
|
+
}), D(r, () => {
|
3452
3458
|
A();
|
3453
|
-
}), (R,
|
3454
|
-
var
|
3455
|
-
return p(), k("section",
|
3456
|
-
|
3459
|
+
}), (R, L) => {
|
3460
|
+
var ne;
|
3461
|
+
return p(), k("section", Wo, [
|
3462
|
+
te(R.$slots, "header", {
|
3457
3463
|
title: t.title,
|
3458
3464
|
total: v.value
|
3459
3465
|
}),
|
3460
|
-
a("div",
|
3461
|
-
I(e(
|
3466
|
+
a("div", qo, [
|
3467
|
+
I(e(ue), {
|
3462
3468
|
type: "text",
|
3463
|
-
modelValue:
|
3464
|
-
"onUpdate:modelValue":
|
3469
|
+
modelValue: h.value,
|
3470
|
+
"onUpdate:modelValue": L[0] || (L[0] = (q) => h.value = q),
|
3465
3471
|
name: "search",
|
3466
3472
|
label: "Пошук",
|
3467
3473
|
onChange: e(T)
|
3468
3474
|
}, null, 8, ["modelValue", "onChange"]),
|
3469
|
-
|
3475
|
+
c.value.length ? (p(), z(e(xe), {
|
3470
3476
|
key: 0,
|
3471
|
-
schema:
|
3477
|
+
schema: c.value,
|
3472
3478
|
view: "inline",
|
3473
3479
|
onChange: J,
|
3474
3480
|
limit: 5,
|
3475
3481
|
value: x.value,
|
3476
3482
|
ref: "filterRef"
|
3477
3483
|
}, null, 8, ["schema", "value"])) : S("", !0),
|
3478
|
-
a("div",
|
3484
|
+
a("div", No, [
|
3479
3485
|
a("button", {
|
3480
3486
|
type: "button",
|
3481
3487
|
class: "map-visible-button py-2 px-2 hidden min-[1001px]:inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100",
|
3482
3488
|
title: w.value ? "Приховати карту" : "Показати карту",
|
3483
|
-
onClick:
|
3489
|
+
onClick: L[1] || (L[1] = (q) => w.value = !w.value)
|
3484
3490
|
}, [
|
3485
|
-
w.value ? (p(),
|
3486
|
-
|
3487
|
-
], 8,
|
3488
|
-
a("div",
|
3491
|
+
w.value ? (p(), z(ro, { key: 0 })) : (p(), z(ho, { key: 1 })),
|
3492
|
+
Qo
|
3493
|
+
], 8, Go),
|
3494
|
+
a("div", Zo, [
|
3489
3495
|
a("button", {
|
3490
|
-
onClick:
|
3496
|
+
onClick: L[2] || (L[2] = (q) => w.value = !1),
|
3491
3497
|
class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
|
3492
3498
|
}, [
|
3493
|
-
I(
|
3499
|
+
I(jo)
|
3494
3500
|
]),
|
3495
3501
|
a("button", {
|
3496
|
-
onClick:
|
3502
|
+
onClick: L[3] || (L[3] = (q) => w.value = !0),
|
3497
3503
|
class: "py-2 px-2 h-[38px] inline-flex items-center gap-x-1.5 text-sm rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100"
|
3498
3504
|
}, [
|
3499
|
-
I(
|
3505
|
+
I(Vo)
|
3500
3506
|
])
|
3501
3507
|
])
|
3502
3508
|
])
|
3503
3509
|
]),
|
3504
|
-
a("div",
|
3510
|
+
a("div", Jo, [
|
3505
3511
|
a("div", {
|
3506
|
-
class:
|
3512
|
+
class: j([
|
3507
3513
|
"relative overflow-hidden shrink-0",
|
3508
3514
|
w.value ? "w-2/4 mr-0" : "w-full mr-3",
|
3509
3515
|
m.value ? "hidden" : ""
|
3510
3516
|
])
|
3511
3517
|
}, [
|
3512
|
-
(
|
3513
|
-
a("span",
|
3514
|
-
a("span",
|
3515
|
-
|
3518
|
+
(ne = R.$slots) != null && ne.header ? S("", !0) : (p(), k("h1", Xo, [
|
3519
|
+
a("span", en, K(t.title), 1),
|
3520
|
+
a("span", tn, K(v.value), 1),
|
3521
|
+
ln
|
3516
3522
|
])),
|
3517
|
-
a("div",
|
3518
|
-
v.value >= 1 ?
|
3523
|
+
a("div", an, [
|
3524
|
+
v.value >= 1 ? te(R.$slots, "table", {
|
3519
3525
|
key: 0,
|
3520
3526
|
rows: y.value,
|
3521
3527
|
selectRow: Q
|
3522
|
-
}) : (p(), k("div",
|
3523
|
-
I(
|
3524
|
-
|
3525
|
-
|
3528
|
+
}) : (p(), k("div", on, [
|
3529
|
+
I(Za),
|
3530
|
+
nn,
|
3531
|
+
rn,
|
3526
3532
|
a("button", {
|
3527
3533
|
type: "button",
|
3528
3534
|
class: "mt-[10px] py-2 px-2.5 inline-flex items-center gap-x-1.5 text-xs rounded-lg border border-stone-200 bg-white text-stone-800 shadow-sm hover:bg-stone-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100",
|
3529
|
-
onClick:
|
3535
|
+
onClick: M
|
3530
3536
|
}, " Очистити дані пошуку ")
|
3531
3537
|
]))
|
3532
3538
|
]),
|
3533
|
-
v.value >= 1 ? (p(), k("hr",
|
3534
|
-
v.value >= 1 ? (p(), k("div",
|
3535
|
-
a("div",
|
3536
|
-
I(
|
3539
|
+
v.value >= 1 ? (p(), k("hr", sn)) : S("", !0),
|
3540
|
+
v.value >= 1 ? (p(), k("div", un, [
|
3541
|
+
a("div", cn, [
|
3542
|
+
I(Ya, {
|
3537
3543
|
total: v.value,
|
3538
3544
|
currentPage: _.value ?? 1,
|
3539
|
-
pageSize:
|
3540
|
-
onPageChange:
|
3541
|
-
onPageSizeChange:
|
3545
|
+
pageSize: f.value,
|
3546
|
+
onPageChange: L[4] || (L[4] = (q) => fe(q)),
|
3547
|
+
onPageSizeChange: L[5] || (L[5] = (q) => U(q))
|
3542
3548
|
}, null, 8, ["total", "currentPage", "pageSize"])
|
3543
3549
|
])
|
3544
3550
|
])) : S("", !0)
|
3545
3551
|
], 2),
|
3546
3552
|
m.value ? (p(), k("div", {
|
3547
3553
|
key: 0,
|
3548
|
-
class:
|
3554
|
+
class: j(
|
3549
3555
|
w.value ? "lg:static lg:w-1/2 mr-0 pb-5" : "pb-5 mr-3"
|
3550
3556
|
),
|
3551
3557
|
style: { height: "calc(100vh - 152px)" }
|
3552
3558
|
}, [
|
3553
|
-
|
3559
|
+
te(R.$slots, "details", {
|
3554
3560
|
table: t.table,
|
3555
|
-
selectedRow:
|
3561
|
+
selectedRow: g.value,
|
3556
3562
|
closeObjCard: O
|
3557
3563
|
})
|
3558
3564
|
], 2)) : S("", !0),
|
3559
|
-
P(a("div",
|
3560
|
-
I(
|
3565
|
+
P(a("div", dn, [
|
3566
|
+
I(Yo, {
|
3561
3567
|
table: t.table,
|
3562
3568
|
map: b.value,
|
3563
|
-
"onUpdate:map":
|
3564
|
-
zoom:
|
3569
|
+
"onUpdate:map": L[6] || (L[6] = (q) => b.value = q),
|
3570
|
+
zoom: $.value,
|
3565
3571
|
colorAttr: t.colorAttr,
|
3566
3572
|
filter: l.value,
|
3567
3573
|
center: C.value,
|
3568
|
-
modelValue:
|
3569
|
-
"onUpdate:modelValue":
|
3574
|
+
modelValue: r.value,
|
3575
|
+
"onUpdate:modelValue": L[7] || (L[7] = (q) => r.value = q)
|
3570
3576
|
}, {
|
3571
|
-
default:
|
3572
|
-
|
3577
|
+
default: se(({ hoverData: q }) => [
|
3578
|
+
te(R.$slots, "popup", { data: q })
|
3573
3579
|
]),
|
3574
3580
|
_: 3
|
3575
3581
|
}, 8, ["table", "map", "zoom", "colorAttr", "filter", "center", "modelValue"]),
|
3576
|
-
|
3582
|
+
te(R.$slots, "default", {
|
3577
3583
|
table: t.table,
|
3578
3584
|
map: b.value,
|
3579
|
-
selectedRow:
|
3585
|
+
selectedRow: g.value
|
3580
3586
|
})
|
3581
3587
|
], 512), [
|
3582
3588
|
[X, w.value]
|