@opengis/partsmap 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1023 -999
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as G, ref as V, computed as N, watch as j, openBlock as f, createBlock as P, resolveDynamicComponent as be, mergeProps as ie, withCtx as xe, renderSlot as ve, createElementBlock as w, createElementVNode as l, toDisplayString as O, createCommentVNode as S, unref as t, useSlots as Fe, normalizeClass as I, createVNode as Y, createTextVNode as te, Fragment as Z, renderList as ae, toRaw as $e, onMounted as _e, onBeforeUnmount as Me, Teleport as Qe, withDirectives as E, normalizeStyle as Pe, vShow as de, cloneVNode as dt, nextTick as Re, vModelText as me, isRef as pt, withModifiers as Ge, createStaticVNode as Je, getCurrentInstance as Xe, resolveDirective as ft, vModelCheckbox as vt } from "vue";
|
|
2
2
|
const mt = { class: "flex items-center justify-between w-full text-sm" }, ht = { class: "flex items-center cursor-pointer w-full" }, gt = {
|
|
3
3
|
key: 0,
|
|
4
4
|
width: "16",
|
|
@@ -7,7 +7,7 @@ const mt = { class: "flex items-center justify-between w-full text-sm" }, ht = {
|
|
|
7
7
|
}, yt = ["value"], bt = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, xt = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, wt = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
|
|
10
|
-
},
|
|
10
|
+
}, Ke = /* @__PURE__ */ G({
|
|
11
11
|
__name: "list-item",
|
|
12
12
|
props: {
|
|
13
13
|
layout: {},
|
|
@@ -20,13 +20,13 @@ const mt = { class: "flex items-center justify-between w-full text-sm" }, ht = {
|
|
|
20
20
|
highlighted: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
emits: ["itemClick"],
|
|
23
|
-
setup(i, { expose:
|
|
24
|
-
const
|
|
23
|
+
setup(i, { expose: n, emit: o }) {
|
|
24
|
+
const r = i, e = o;
|
|
25
25
|
function c() {
|
|
26
|
-
|
|
26
|
+
e("itemClick", r.value);
|
|
27
27
|
}
|
|
28
28
|
const u = V(null);
|
|
29
|
-
return
|
|
29
|
+
return n({ el: u }), (h, m) => (f(), w("div", {
|
|
30
30
|
class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
|
|
31
31
|
ref_key: "el",
|
|
32
32
|
ref: u
|
|
@@ -35,14 +35,14 @@ const mt = { class: "flex items-center justify-between w-full text-sm" }, ht = {
|
|
|
35
35
|
l("div", ht, [
|
|
36
36
|
l("label", {
|
|
37
37
|
for: "radio-9740",
|
|
38
|
-
class:
|
|
38
|
+
class: I([
|
|
39
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
40
|
{ "bg-blue-100": h.highlighted }
|
|
41
41
|
]),
|
|
42
42
|
onClick: Ge(c, ["stop", "prevent"])
|
|
43
43
|
}, [
|
|
44
44
|
l("div", {
|
|
45
|
-
class:
|
|
45
|
+
class: I(["w-[18px] h-[18px] border flex items-center justify-center", [
|
|
46
46
|
h.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
|
|
47
47
|
h.color ? `bg-[${h.color}] border-[#ffffff]` : h.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
|
|
48
48
|
]])
|
|
@@ -65,38 +65,38 @@ const mt = { class: "flex items-center justify-between w-full text-sm" }, ht = {
|
|
|
65
65
|
], 512));
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
function et(i,
|
|
68
|
+
function et(i, n) {
|
|
69
69
|
const {
|
|
70
|
-
options:
|
|
71
|
-
limit:
|
|
70
|
+
options: o = [],
|
|
71
|
+
limit: r = 20
|
|
72
72
|
} = i;
|
|
73
|
-
function
|
|
73
|
+
function e(s) {
|
|
74
74
|
return Array.isArray(s) ? s[0] : s;
|
|
75
75
|
}
|
|
76
|
-
const c = V(
|
|
76
|
+
const c = V(e(i.modelValue)), u = V(""), h = V(!1), m = V([]), x = V("id"), g = V("text"), d = V(!1), y = V(i.layout !== "popover" && o.length > r);
|
|
77
77
|
function _(s) {
|
|
78
|
-
const k = s.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((
|
|
78
|
+
const k = s.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((L) => L in k) ?? "id", A = ["text", "label", "name", "title"].find((L) => L in k) ?? "text";
|
|
79
79
|
return { autoValueKey: B, autoLabelKey: A };
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
82
|
-
const s = _(
|
|
81
|
+
if (o.length > 0) {
|
|
82
|
+
const s = _(o);
|
|
83
83
|
x.value = s.autoValueKey, g.value = s.autoLabelKey;
|
|
84
84
|
}
|
|
85
|
-
const v =
|
|
85
|
+
const v = N(() => {
|
|
86
86
|
const s = m.value;
|
|
87
|
-
return i.layout === "popover" || d.value ? s : s.slice(0,
|
|
87
|
+
return i.layout === "popover" || d.value ? s : s.slice(0, r);
|
|
88
88
|
});
|
|
89
89
|
j(() => i.modelValue, (s) => {
|
|
90
|
-
c.value =
|
|
91
|
-
}, { immediate: !0 }), m.value = [...
|
|
90
|
+
c.value = e(s);
|
|
91
|
+
}, { immediate: !0 }), m.value = [...o].sort((s, k) => i.sort === "count" ? k.count && s.count ? k.count - s.count : 0 : i.sort === "name" ? String(s[g.value] ?? "").localeCompare(String(k[g.value] ?? "")) : 0);
|
|
92
92
|
function p(s) {
|
|
93
93
|
return c.value === s[x.value];
|
|
94
94
|
}
|
|
95
95
|
function a(s) {
|
|
96
|
-
c.value = s[x.value],
|
|
96
|
+
c.value = s[x.value], n("update:modelValue", c.value), n("change", { name: i.name, value: c.value });
|
|
97
97
|
}
|
|
98
98
|
function C() {
|
|
99
|
-
c.value = void 0,
|
|
99
|
+
c.value = void 0, n("update:modelValue", c.value), n("clear", i.name);
|
|
100
100
|
}
|
|
101
101
|
function b() {
|
|
102
102
|
d.value = !d.value;
|
|
@@ -117,23 +117,23 @@ function et(i, r) {
|
|
|
117
117
|
allOptions: m
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
for (const [
|
|
123
|
-
|
|
124
|
-
return
|
|
120
|
+
const he = (i, n) => {
|
|
121
|
+
const o = i.__vccOpts || i;
|
|
122
|
+
for (const [r, e] of n)
|
|
123
|
+
o[r] = e;
|
|
124
|
+
return o;
|
|
125
125
|
}, kt = {}, _t = {
|
|
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 Ct(i,
|
|
132
|
-
return f(), w("svg", _t,
|
|
131
|
+
function Ct(i, n) {
|
|
132
|
+
return f(), w("svg", _t, n[0] || (n[0] = [
|
|
133
133
|
Je('<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
|
|
136
|
+
const Ue = /* @__PURE__ */ he(kt, [["render", Ct]]), Vt = {}, St = {
|
|
137
137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
138
138
|
width: "24",
|
|
139
139
|
height: "24",
|
|
@@ -145,8 +145,8 @@ const Ke = /* @__PURE__ */ me(kt, [["render", Ct]]), Vt = {}, St = {
|
|
|
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 $t(i,
|
|
149
|
-
return f(), w("svg", St,
|
|
148
|
+
function $t(i, n) {
|
|
149
|
+
return f(), w("svg", St, n[0] || (n[0] = [
|
|
150
150
|
l("path", {
|
|
151
151
|
stroke: "none",
|
|
152
152
|
d: "M0 0h24v24H0z",
|
|
@@ -155,7 +155,7 @@ function $t(i, r) {
|
|
|
155
155
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
156
156
|
]));
|
|
157
157
|
}
|
|
158
|
-
const
|
|
158
|
+
const Le = /* @__PURE__ */ he(Vt, [["render", $t]]), Mt = {}, Bt = {
|
|
159
159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
160
160
|
width: "24",
|
|
161
161
|
height: "24",
|
|
@@ -167,8 +167,8 @@ const Re = /* @__PURE__ */ me(Vt, [["render", $t]]), Mt = {}, Bt = {
|
|
|
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 zt(i,
|
|
171
|
-
return f(), w("svg", Bt,
|
|
170
|
+
function zt(i, n) {
|
|
171
|
+
return f(), w("svg", Bt, n[0] || (n[0] = [
|
|
172
172
|
l("path", {
|
|
173
173
|
stroke: "none",
|
|
174
174
|
d: "M0 0h24v24H0z",
|
|
@@ -177,16 +177,16 @@ function zt(i, r) {
|
|
|
177
177
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
178
178
|
]));
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const Ie = /* @__PURE__ */ he(Mt, [["render", zt]]), At = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "w-full"
|
|
183
|
-
}, Rt = { class: "flex flex-col items-center justify-center p-5 text-center" },
|
|
183
|
+
}, Rt = { class: "flex flex-col items-center justify-center p-5 text-center" }, Lt = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
186
|
-
},
|
|
186
|
+
}, jt = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
189
|
-
},
|
|
189
|
+
}, Dt = /* @__PURE__ */ G({
|
|
190
190
|
__name: "radio",
|
|
191
191
|
props: {
|
|
192
192
|
id: {},
|
|
@@ -212,8 +212,8 @@ const Ue = /* @__PURE__ */ me(Mt, [["render", zt]]), At = {
|
|
|
212
212
|
sort: {}
|
|
213
213
|
},
|
|
214
214
|
emits: ["update:modelValue", "change", "clear"],
|
|
215
|
-
setup(i, { expose:
|
|
216
|
-
const
|
|
215
|
+
setup(i, { expose: n, emit: o }) {
|
|
216
|
+
const r = i, e = V(null), c = o, {
|
|
217
217
|
innerValue: u,
|
|
218
218
|
filteredOptions: h,
|
|
219
219
|
isSelected: m,
|
|
@@ -227,125 +227,125 @@ const Ue = /* @__PURE__ */ me(Mt, [["render", zt]]), At = {
|
|
|
227
227
|
valueKey: a,
|
|
228
228
|
allOptions: C
|
|
229
229
|
} = et({
|
|
230
|
-
...
|
|
231
|
-
modelValue:
|
|
230
|
+
...r,
|
|
231
|
+
modelValue: r.modelValue ?? r.default ?? ""
|
|
232
232
|
}, c);
|
|
233
|
-
return
|
|
233
|
+
return n({
|
|
234
234
|
clear: g,
|
|
235
|
-
inputTextRef:
|
|
235
|
+
inputTextRef: e
|
|
236
236
|
}), j(
|
|
237
|
-
() =>
|
|
237
|
+
() => r.modelValue,
|
|
238
238
|
(b) => {
|
|
239
239
|
b === void 0 && (u.value = void 0);
|
|
240
240
|
}
|
|
241
241
|
), (b, s) => (f(), w("div", {
|
|
242
|
-
class:
|
|
242
|
+
class: I([b.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
|
|
243
243
|
}, [
|
|
244
244
|
l("div", {
|
|
245
|
-
class:
|
|
245
|
+
class: I([
|
|
246
246
|
b.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
|
247
247
|
b.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
248
248
|
])
|
|
249
249
|
}, [
|
|
250
|
-
(f(!0), w(
|
|
250
|
+
(f(!0), w(Z, null, ae(t(h), (k) => (f(), P(Ke, {
|
|
251
251
|
layout: b.layout,
|
|
252
|
-
key: k[
|
|
252
|
+
key: k[t(a)],
|
|
253
253
|
count: k.count,
|
|
254
|
-
label: k[
|
|
254
|
+
label: k[t(p)],
|
|
255
255
|
color: k.color,
|
|
256
256
|
type: "radio",
|
|
257
|
-
value: k[
|
|
258
|
-
"is-selected":
|
|
259
|
-
onItemClick: (B) =>
|
|
257
|
+
value: k[t(a)],
|
|
258
|
+
"is-selected": t(m)(k),
|
|
259
|
+
onItemClick: (B) => t(x)(k)
|
|
260
260
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
|
261
261
|
], 2),
|
|
262
|
-
b.type === "select" &&
|
|
262
|
+
b.type === "select" && t(h).length === 0 && !t(y) ? (f(), w("div", At, [
|
|
263
263
|
l("div", Rt, [
|
|
264
|
-
Y(
|
|
264
|
+
Y(Ue),
|
|
265
265
|
s[4] || (s[4] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
266
266
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
267
267
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
268
268
|
], -1))
|
|
269
269
|
])
|
|
270
270
|
])) : S("", !0),
|
|
271
|
-
b.layout !== "popover" && b.type !== "select" ? (f(), w(
|
|
272
|
-
!
|
|
271
|
+
b.layout !== "popover" && b.type !== "select" ? (f(), w(Z, { key: 1 }, [
|
|
272
|
+
!t(_) && t(v) ? (f(), w("div", {
|
|
273
273
|
key: 0,
|
|
274
274
|
onClick: s[0] || (s[0] = //@ts-ignore
|
|
275
|
-
(...k) =>
|
|
275
|
+
(...k) => t(d) && t(d)(...k)),
|
|
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
|
-
s[5] || (s[5] =
|
|
279
|
-
Y(
|
|
278
|
+
s[5] || (s[5] = te(" Показати більше ", -1)),
|
|
279
|
+
Y(Le)
|
|
280
280
|
])) : S("", !0),
|
|
281
|
-
|
|
281
|
+
t(_) ? (f(), w("div", {
|
|
282
282
|
key: 1,
|
|
283
283
|
onClick: s[1] || (s[1] = //@ts-ignore
|
|
284
|
-
(...k) =>
|
|
284
|
+
(...k) => t(d) && t(d)(...k)),
|
|
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
|
-
s[6] || (s[6] =
|
|
288
|
-
Y(
|
|
287
|
+
s[6] || (s[6] = te(" Показати менше ", -1)),
|
|
288
|
+
Y(Ie)
|
|
289
289
|
])) : S("", !0)
|
|
290
290
|
], 64)) : S("", !0),
|
|
291
|
-
b.cleanable ? (f(), w(
|
|
292
|
-
b.layout === "inline" ? (f(), w("div",
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
b.cleanable ? (f(), w(Z, { key: 2 }, [
|
|
292
|
+
b.layout === "inline" ? (f(), w("div", Lt, [
|
|
293
|
+
te(O(t(u) || t(u) === null ? 1 : 0) + " з " + O(t(C).length) + " обрано ", 1),
|
|
294
|
+
E(l("button", {
|
|
295
295
|
class: "text-gray-600 hover:text-gray-800",
|
|
296
296
|
onClick: s[2] || (s[2] = //@ts-ignore
|
|
297
|
-
(...k) =>
|
|
297
|
+
(...k) => t(g) && t(g)(...k))
|
|
298
298
|
}, " Очистити ", 512), [
|
|
299
|
-
[
|
|
299
|
+
[de, t(u) !== "" && t(u) !== void 0]
|
|
300
300
|
])
|
|
301
301
|
])) : S("", !0),
|
|
302
|
-
b.layout === "popover" ? (f(), w("div",
|
|
303
|
-
l("span", null, O(
|
|
304
|
-
|
|
302
|
+
b.layout === "popover" ? (f(), w("div", jt, [
|
|
303
|
+
l("span", null, O(t(u) || t(u) === null ? 1 : 0) + " з " + O(t(C).length) + " обрано", 1),
|
|
304
|
+
E(l("button", {
|
|
305
305
|
class: "text-gray-600 hover:text-gray-800",
|
|
306
306
|
onClick: s[3] || (s[3] = //@ts-ignore
|
|
307
|
-
(...k) =>
|
|
307
|
+
(...k) => t(g) && t(g)(...k))
|
|
308
308
|
}, " Очистити ", 512), [
|
|
309
|
-
[
|
|
309
|
+
[de, t(u) !== "" && t(u) !== void 0]
|
|
310
310
|
])
|
|
311
311
|
])) : S("", !0)
|
|
312
312
|
], 64)) : S("", !0)
|
|
313
313
|
], 2));
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
|
-
function tt(i,
|
|
316
|
+
function tt(i, n) {
|
|
317
317
|
const {
|
|
318
|
-
options:
|
|
319
|
-
limit:
|
|
318
|
+
options: o = [],
|
|
319
|
+
limit: r = 20
|
|
320
320
|
} = i;
|
|
321
|
-
function
|
|
321
|
+
function e(s) {
|
|
322
322
|
return Array.isArray(s) ? s : s ? [s] : [];
|
|
323
323
|
}
|
|
324
|
-
const c = V(
|
|
324
|
+
const c = V(e(i.modelValue)), u = V(""), h = V(!1), m = V([]), x = V("id"), g = V("text"), d = V(!1), y = V(i.layout !== "popover" && o.length > r);
|
|
325
325
|
function _(s) {
|
|
326
|
-
const k = s.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((
|
|
326
|
+
const k = s.find(Boolean) ?? {}, B = ["id", "value", "code", "key"].find((L) => L in k) ?? "id", A = ["text", "label", "name", "title"].find((L) => L in k) ?? "text";
|
|
327
327
|
return { autoValueKey: B, autoLabelKey: A };
|
|
328
328
|
}
|
|
329
|
-
if (
|
|
330
|
-
const s = _(
|
|
329
|
+
if (o.length > 0) {
|
|
330
|
+
const s = _(o);
|
|
331
331
|
x.value = s.autoValueKey, g.value = s.autoLabelKey;
|
|
332
332
|
}
|
|
333
|
-
const v =
|
|
333
|
+
const v = N(() => {
|
|
334
334
|
const s = m.value;
|
|
335
|
-
return i.layout === "popover" || d.value ? s : s.slice(0,
|
|
335
|
+
return i.layout === "popover" || d.value ? s : s.slice(0, r);
|
|
336
336
|
});
|
|
337
337
|
j(() => i.modelValue, (s) => {
|
|
338
|
-
c.value =
|
|
339
|
-
}, { immediate: !0 }), m.value = [...
|
|
338
|
+
c.value = e(s);
|
|
339
|
+
}, { immediate: !0 }), m.value = [...o].sort((s, k) => i.sort === "count" ? k.count && s.count ? k.count - s.count : 0 : i.sort === "name" ? String(s[g.value]).localeCompare(String(k[g.value])) : 0);
|
|
340
340
|
function p(s) {
|
|
341
341
|
return c.value && c.value.includes(s[x.value]);
|
|
342
342
|
}
|
|
343
343
|
function a(s) {
|
|
344
344
|
const k = c.value.includes(s[x.value]);
|
|
345
|
-
c.value = k ? c.value.filter((B) => B !== s[x.value]) : [...c.value, s[x.value]],
|
|
345
|
+
c.value = k ? c.value.filter((B) => B !== s[x.value]) : [...c.value, s[x.value]], n("update:modelValue", c.value), n("change", { name: i.name, value: c.value });
|
|
346
346
|
}
|
|
347
347
|
function C() {
|
|
348
|
-
c.value = [],
|
|
348
|
+
c.value = [], n("update:modelValue", c.value), n("clear", i.name);
|
|
349
349
|
}
|
|
350
350
|
function b() {
|
|
351
351
|
d.value = !d.value;
|
|
@@ -366,7 +366,7 @@ function tt(i, r) {
|
|
|
366
366
|
allOptions: m
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
const
|
|
369
|
+
const Ft = {
|
|
370
370
|
key: 0,
|
|
371
371
|
class: "w-full"
|
|
372
372
|
}, Pt = { class: "flex flex-col items-center justify-center p-5 text-center" }, Kt = {
|
|
@@ -375,7 +375,7 @@ const Lt = {
|
|
|
375
375
|
}, Ut = {
|
|
376
376
|
key: 1,
|
|
377
377
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
378
|
-
}, He = /* @__PURE__ */
|
|
378
|
+
}, He = /* @__PURE__ */ G({
|
|
379
379
|
__name: "checkbox",
|
|
380
380
|
props: {
|
|
381
381
|
id: {},
|
|
@@ -401,8 +401,8 @@ const Lt = {
|
|
|
401
401
|
sort: {}
|
|
402
402
|
},
|
|
403
403
|
emits: ["update:modelValue", "change", "clear"],
|
|
404
|
-
setup(i, { expose:
|
|
405
|
-
const
|
|
404
|
+
setup(i, { expose: n, emit: o }) {
|
|
405
|
+
const r = i, e = o, {
|
|
406
406
|
innerValue: c,
|
|
407
407
|
filteredOptions: u,
|
|
408
408
|
isSelected: h,
|
|
@@ -416,90 +416,90 @@ const Lt = {
|
|
|
416
416
|
valueKey: p,
|
|
417
417
|
allOptions: a
|
|
418
418
|
} = tt({
|
|
419
|
-
...
|
|
420
|
-
modelValue:
|
|
421
|
-
},
|
|
419
|
+
...r,
|
|
420
|
+
modelValue: r.modelValue
|
|
421
|
+
}, e);
|
|
422
422
|
return j(
|
|
423
|
-
() =>
|
|
423
|
+
() => r.modelValue,
|
|
424
424
|
(C) => {
|
|
425
425
|
C === void 0 && (c.value = []);
|
|
426
426
|
}
|
|
427
|
-
),
|
|
427
|
+
), n({
|
|
428
428
|
clear: x
|
|
429
429
|
}), (C, b) => (f(), w("div", {
|
|
430
|
-
class:
|
|
430
|
+
class: I([C.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
431
431
|
}, [
|
|
432
432
|
l("div", {
|
|
433
|
-
class:
|
|
433
|
+
class: I([
|
|
434
434
|
C.layout === "popover" ? "flex-1 overflow-y-auto max-h-64 p-2" : "",
|
|
435
435
|
C.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
436
436
|
])
|
|
437
437
|
}, [
|
|
438
|
-
(f(!0), w(
|
|
438
|
+
(f(!0), w(Z, null, ae(t(u), (s) => (f(), P(Ke, {
|
|
439
439
|
layout: C.layout,
|
|
440
440
|
count: s.count,
|
|
441
|
-
label: s[
|
|
441
|
+
label: s[t(v)],
|
|
442
442
|
color: s.color,
|
|
443
443
|
type: "checkbox",
|
|
444
|
-
value: s[
|
|
445
|
-
"is-selected":
|
|
446
|
-
onItemClick: (k) =>
|
|
444
|
+
value: s[t(p)],
|
|
445
|
+
"is-selected": t(h)(s),
|
|
446
|
+
onItemClick: (k) => t(m)(s)
|
|
447
447
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
|
|
448
448
|
], 2),
|
|
449
|
-
C.type === "select" &&
|
|
449
|
+
C.type === "select" && t(u).length === 0 && !t(d) ? (f(), w("div", Ft, [
|
|
450
450
|
l("div", Pt, [
|
|
451
|
-
Y(
|
|
451
|
+
Y(Ue),
|
|
452
452
|
b[4] || (b[4] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
453
453
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
454
454
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
455
455
|
], -1))
|
|
456
456
|
])
|
|
457
457
|
])) : S("", !0),
|
|
458
|
-
C.layout !== "popover" && C.type !== "select" ? (f(), w(
|
|
459
|
-
!
|
|
458
|
+
C.layout !== "popover" && C.type !== "select" ? (f(), w(Z, { key: 1 }, [
|
|
459
|
+
!t(y) && t(_) ? (f(), w("div", {
|
|
460
460
|
key: 0,
|
|
461
461
|
onClick: b[0] || (b[0] = //@ts-ignore
|
|
462
|
-
(...s) =>
|
|
462
|
+
(...s) => t(g) && t(g)(...s)),
|
|
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
|
-
b[5] || (b[5] =
|
|
466
|
-
Y(
|
|
465
|
+
b[5] || (b[5] = te(" Показати більше ", -1)),
|
|
466
|
+
Y(Le)
|
|
467
467
|
])) : S("", !0),
|
|
468
|
-
|
|
468
|
+
t(y) ? (f(), w("div", {
|
|
469
469
|
key: 1,
|
|
470
470
|
onClick: b[1] || (b[1] = //@ts-ignore
|
|
471
|
-
(...s) =>
|
|
471
|
+
(...s) => t(g) && t(g)(...s)),
|
|
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
|
-
b[6] || (b[6] =
|
|
475
|
-
Y(
|
|
474
|
+
b[6] || (b[6] = te(" Показати менше ", -1)),
|
|
475
|
+
Y(Ie)
|
|
476
476
|
])) : S("", !0)
|
|
477
477
|
], 64)) : S("", !0),
|
|
478
|
-
C.cleanable ? (f(), w(
|
|
478
|
+
C.cleanable ? (f(), w(Z, { key: 2 }, [
|
|
479
479
|
C.layout === "inline" ? (f(), w("div", Kt, [
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
te(O(t(c).length) + " з " + O(t(a).length) + " обрано ", 1),
|
|
481
|
+
E(l("button", {
|
|
482
482
|
class: "text-gray-600 hover:text-gray-800",
|
|
483
483
|
onClick: b[2] || (b[2] = //@ts-ignore
|
|
484
|
-
(...s) =>
|
|
484
|
+
(...s) => t(x) && t(x)(...s))
|
|
485
485
|
}, " Очистити ", 512), [
|
|
486
|
-
[
|
|
486
|
+
[de, t(c).length !== 0]
|
|
487
487
|
])
|
|
488
488
|
])) : S("", !0),
|
|
489
489
|
C.layout === "popover" ? (f(), w("div", Ut, [
|
|
490
|
-
l("span", null, O(
|
|
491
|
-
|
|
490
|
+
l("span", null, O(t(c).length) + " з " + O(t(a).length) + " обрано", 1),
|
|
491
|
+
E(l("button", {
|
|
492
492
|
class: "text-gray-600 hover:text-gray-800",
|
|
493
493
|
onClick: b[3] || (b[3] = //@ts-ignore
|
|
494
|
-
(...s) =>
|
|
494
|
+
(...s) => t(x) && t(x)(...s))
|
|
495
495
|
}, " Очистити ", 512), [
|
|
496
|
-
[
|
|
496
|
+
[de, t(c).length !== 0]
|
|
497
497
|
])
|
|
498
498
|
])) : S("", !0)
|
|
499
499
|
], 64)) : S("", !0)
|
|
500
500
|
], 2));
|
|
501
501
|
}
|
|
502
|
-
}), It = {},
|
|
502
|
+
}), It = {}, Zt = {
|
|
503
503
|
xmlns: "http://www.w3.org/2000/svg",
|
|
504
504
|
width: "15px",
|
|
505
505
|
height: "15px",
|
|
@@ -511,8 +511,8 @@ const Lt = {
|
|
|
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 f(), w("svg",
|
|
514
|
+
function Ot(i, n) {
|
|
515
|
+
return f(), w("svg", Zt, n[0] || (n[0] = [
|
|
516
516
|
l("path", {
|
|
517
517
|
stroke: "none",
|
|
518
518
|
d: "M0 0h24v24H0z",
|
|
@@ -522,7 +522,7 @@ function Tt(i, r) {
|
|
|
522
522
|
l("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
523
523
|
]));
|
|
524
524
|
}
|
|
525
|
-
const lt = /* @__PURE__ */
|
|
525
|
+
const lt = /* @__PURE__ */ he(It, [["render", Ot]]), Tt = {}, Ht = {
|
|
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 lt = /* @__PURE__ */ me(It, [["render", Tt]]), Ht = {}, Et = {
|
|
|
534
534
|
width: "15px",
|
|
535
535
|
height: "15px"
|
|
536
536
|
};
|
|
537
|
-
function
|
|
538
|
-
return f(), w("svg",
|
|
537
|
+
function Et(i, n) {
|
|
538
|
+
return f(), w("svg", Ht, n[0] || (n[0] = [
|
|
539
539
|
l("path", {
|
|
540
540
|
stroke: "none",
|
|
541
541
|
d: "M0 0h24v24H0z",
|
|
@@ -545,13 +545,13 @@ function Nt(i, r) {
|
|
|
545
545
|
l("path", { d: "M6 6l12 12" }, null, -1)
|
|
546
546
|
]));
|
|
547
547
|
}
|
|
548
|
-
const at = /* @__PURE__ */
|
|
548
|
+
const at = /* @__PURE__ */ he(Tt, [["render", Et]]);
|
|
549
549
|
class je {
|
|
550
|
-
static getWidthClass(
|
|
551
|
-
return typeof
|
|
550
|
+
static getWidthClass(n) {
|
|
551
|
+
return typeof n == "number" ? `max-w-[${n}px]` : typeof n == "string" ? n.endsWith("%") || n.endsWith("px") ? `max-w-[${n}]` : `max-w-${n}` : "w-full";
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
const
|
|
554
|
+
const Nt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, Wt = ["placeholder"], Yt = /* @__PURE__ */ G({
|
|
555
555
|
__name: "text-input",
|
|
556
556
|
props: {
|
|
557
557
|
id: {},
|
|
@@ -577,27 +577,27 @@ const Wt = { 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 o = i, r = V((o.placeHolder || o.label || o.name || "search").toString()), e = n, c = V(o.modelValue ?? "");
|
|
582
582
|
j(
|
|
583
|
-
() =>
|
|
583
|
+
() => o.modelValue,
|
|
584
584
|
(m) => {
|
|
585
585
|
m !== c.value && (c.value = m ?? "");
|
|
586
586
|
}
|
|
587
587
|
);
|
|
588
588
|
function u() {
|
|
589
|
-
|
|
589
|
+
e("update:modelValue", c.value), e("change", { name: o.name, value: c.value });
|
|
590
590
|
}
|
|
591
591
|
function h() {
|
|
592
|
-
c.value = "",
|
|
592
|
+
c.value = "", e("update:modelValue", ""), e("clear", o.name), e("change", { name: o.name, value: null });
|
|
593
593
|
}
|
|
594
594
|
return (m, x) => (f(), w("div", {
|
|
595
|
-
class:
|
|
595
|
+
class: I([
|
|
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
|
-
m.layout === "inline" ?
|
|
597
|
+
m.layout === "inline" ? t(je).getWidthClass(m.width) : "mb-2" + (m.layout === "popover" ? " m-2" : "")
|
|
598
598
|
])
|
|
599
599
|
}, [
|
|
600
|
-
l("div",
|
|
600
|
+
l("div", Nt, [
|
|
601
601
|
Y(lt)
|
|
602
602
|
]),
|
|
603
603
|
c.value !== "" ? (f(), w("div", {
|
|
@@ -607,22 +607,22 @@ const Wt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
607
607
|
}, [
|
|
608
608
|
Y(at)
|
|
609
609
|
])) : S("", !0),
|
|
610
|
-
|
|
610
|
+
E(l("input", {
|
|
611
611
|
type: "text",
|
|
612
612
|
"onUpdate:modelValue": x[0] || (x[0] = (g) => c.value = g),
|
|
613
613
|
onInput: u,
|
|
614
|
-
placeholder:
|
|
614
|
+
placeholder: r.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
|
-
}, null, 40,
|
|
617
|
-
[
|
|
616
|
+
}, null, 40, Wt), [
|
|
617
|
+
[me, c.value]
|
|
618
618
|
])
|
|
619
619
|
], 2));
|
|
620
620
|
}
|
|
621
621
|
});
|
|
622
622
|
function ot(i = { color: "blue" }) {
|
|
623
|
-
return
|
|
624
|
-
const
|
|
625
|
-
return (i == null ? void 0 : i.size) === "sm" ? `${
|
|
623
|
+
return N(() => {
|
|
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 qt() {
|
|
@@ -643,7 +643,7 @@ const Gt = {
|
|
|
643
643
|
}, el = {
|
|
644
644
|
key: 0,
|
|
645
645
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
646
|
-
}, tl = ["placeholder", "disabled"], ll = ["disabled"], al = /* @__PURE__ */
|
|
646
|
+
}, tl = ["placeholder", "disabled"], ll = ["disabled"], al = /* @__PURE__ */ G({
|
|
647
647
|
__name: "range-input",
|
|
648
648
|
props: {
|
|
649
649
|
id: {},
|
|
@@ -669,10 +669,10 @@ const Gt = {
|
|
|
669
669
|
sort: {}
|
|
670
670
|
},
|
|
671
671
|
emits: ["update:modelValue", "change", "clear"],
|
|
672
|
-
setup(i, { expose:
|
|
673
|
-
const
|
|
672
|
+
setup(i, { expose: n, emit: o }) {
|
|
673
|
+
const r = ot(), e = qt(), c = i, u = V(
|
|
674
674
|
c.modelValue ?? c.default ?? []
|
|
675
|
-
), h =
|
|
675
|
+
), h = o, m = N({
|
|
676
676
|
get: () => c.modelValue ?? u.value,
|
|
677
677
|
set: (d) => {
|
|
678
678
|
c.modelValue !== void 0 ? h("update:modelValue", d) : u.value = d;
|
|
@@ -686,36 +686,36 @@ const Gt = {
|
|
|
686
686
|
}
|
|
687
687
|
return j(() => c.modelValue, (d) => {
|
|
688
688
|
d !== void 0 && c.layout !== "popover" ? (u.value = d, h("update:modelValue", d)) : u.value = [];
|
|
689
|
-
}),
|
|
689
|
+
}), n({
|
|
690
690
|
clear: g,
|
|
691
691
|
currentValue: m
|
|
692
692
|
}), (d, y) => {
|
|
693
693
|
var _, v;
|
|
694
|
-
return f(), w(
|
|
694
|
+
return f(), w(Z, null, [
|
|
695
695
|
l("div", null, [
|
|
696
696
|
l("div", {
|
|
697
|
-
class:
|
|
697
|
+
class: I(d.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
|
|
698
698
|
}, [
|
|
699
699
|
l("div", null, [
|
|
700
700
|
d.layout !== "vertical" ? (f(), w("label", Gt, "Від")) : S("", !0),
|
|
701
|
-
|
|
701
|
+
E(l("input", {
|
|
702
702
|
type: "number",
|
|
703
|
-
class:
|
|
703
|
+
class: I(t(r)),
|
|
704
704
|
placeholder: ((_ = d.placeHolder) == null ? void 0 : _[0]) ?? "min",
|
|
705
705
|
step: "1",
|
|
706
706
|
style: { outline: "none" },
|
|
707
707
|
"onUpdate:modelValue": y[0] || (y[0] = (p) => m.value[0] = p),
|
|
708
708
|
disabled: d.disabled
|
|
709
709
|
}, null, 10, Jt), [
|
|
710
|
-
[
|
|
710
|
+
[me, m.value[0]]
|
|
711
711
|
])
|
|
712
712
|
]),
|
|
713
713
|
d.layout === "vertical" ? (f(), w("label", Xt, " - ")) : S("", !0),
|
|
714
714
|
l("div", null, [
|
|
715
715
|
d.layout !== "vertical" ? (f(), w("label", el, "До")) : S("", !0),
|
|
716
|
-
|
|
716
|
+
E(l("input", {
|
|
717
717
|
type: "number",
|
|
718
|
-
class:
|
|
718
|
+
class: I(t(r)),
|
|
719
719
|
placeholder: ((v = d.placeHolder) == null ? void 0 : v[1]) ?? "max",
|
|
720
720
|
min: "0",
|
|
721
721
|
max: "1000000000000000",
|
|
@@ -724,19 +724,19 @@ const Gt = {
|
|
|
724
724
|
"onUpdate:modelValue": y[1] || (y[1] = (p) => m.value[1] = p),
|
|
725
725
|
disabled: d.disabled
|
|
726
726
|
}, null, 10, tl), [
|
|
727
|
-
[
|
|
727
|
+
[me, m.value[1]]
|
|
728
728
|
])
|
|
729
729
|
]),
|
|
730
730
|
["popover", "inline", "vertical"].includes(d.layout) ? (f(), w("button", {
|
|
731
731
|
key: 1,
|
|
732
732
|
onClick: x,
|
|
733
|
-
class:
|
|
733
|
+
class: I(t(e) + (d.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
|
|
734
734
|
}, O(d.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : S("", !0),
|
|
735
735
|
["popover", "inline"].includes(d.layout) ? (f(), w("button", {
|
|
736
736
|
key: 2,
|
|
737
737
|
disabled: !(m.value[0] || m.value[1]),
|
|
738
738
|
onClick: g,
|
|
739
|
-
class:
|
|
739
|
+
class: I(t(e) + " hover:bg-gray-100")
|
|
740
740
|
}, "Очистити", 10, ll)) : S("", !0)
|
|
741
741
|
], 2)
|
|
742
742
|
]),
|
|
@@ -747,7 +747,7 @@ const Gt = {
|
|
|
747
747
|
}), ol = ["disabled", "title"], rl = {
|
|
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
|
-
}, nl = { 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" }, il = { 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
|
+
}, nl = { 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" }, il = { 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" }, Ze = /* @__PURE__ */ G({
|
|
751
751
|
__name: "popover-field",
|
|
752
752
|
props: {
|
|
753
753
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -758,8 +758,8 @@ const Gt = {
|
|
|
758
758
|
mode: {},
|
|
759
759
|
layout: {}
|
|
760
760
|
},
|
|
761
|
-
setup(i, { expose:
|
|
762
|
-
const
|
|
761
|
+
setup(i, { expose: n }) {
|
|
762
|
+
const o = i, r = N(() => rt(o.mode)), e = V(!1), c = V({ top: 0, left: 0 }), u = V(null), h = V(null), m = V(null);
|
|
763
763
|
function x() {
|
|
764
764
|
const a = h.value, C = m.value;
|
|
765
765
|
if (!a || !C) return;
|
|
@@ -768,34 +768,34 @@ const Gt = {
|
|
|
768
768
|
A + s > k && (A = Math.max(k - s - 10, 10)), c.value = { top: B, left: A };
|
|
769
769
|
}
|
|
770
770
|
function g() {
|
|
771
|
-
|
|
771
|
+
e.value = !e.value, e.value && Re(() => {
|
|
772
772
|
var a, C;
|
|
773
|
-
x(), (a =
|
|
773
|
+
x(), (a = o.fieldRef) != null && a.inputTextRef && ((C = o.fieldRef) == null || C.inputTextRef.focus());
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
776
|
function d(a) {
|
|
777
777
|
var C, b;
|
|
778
|
-
!((C = u.value) != null && C.contains(a.target)) && !((b = m.value) != null && b.contains(a.target)) && (
|
|
778
|
+
!((C = u.value) != null && C.contains(a.target)) && !((b = m.value) != null && b.contains(a.target)) && (e.value = !1);
|
|
779
779
|
}
|
|
780
780
|
function y(a) {
|
|
781
|
-
a.key === "Escape" && (
|
|
781
|
+
a.key === "Escape" && (e.value = !1);
|
|
782
782
|
}
|
|
783
783
|
const _ = V(!1);
|
|
784
|
-
|
|
784
|
+
_e(() => {
|
|
785
785
|
_.value = !0;
|
|
786
|
-
}),
|
|
786
|
+
}), _e(() => {
|
|
787
787
|
document.addEventListener("click", d, !0), document.addEventListener("keydown", y), window.addEventListener("scroll", x, !0);
|
|
788
788
|
}), Me(() => {
|
|
789
789
|
document.removeEventListener("click", d, !0), document.removeEventListener("keydown", y), window.removeEventListener("scroll", x, !0);
|
|
790
790
|
});
|
|
791
791
|
function v() {
|
|
792
|
-
|
|
792
|
+
e.value = !1;
|
|
793
793
|
}
|
|
794
|
-
|
|
795
|
-
const p =
|
|
794
|
+
n({ close: v });
|
|
795
|
+
const p = N(() => {
|
|
796
796
|
var C;
|
|
797
|
-
const a = (C =
|
|
798
|
-
return a ? Array.isArray(a) ? a.length > 0 ? a.join(", ") :
|
|
797
|
+
const a = (C = o.fieldRef) == null ? void 0 : C.selectedLabels;
|
|
798
|
+
return a ? Array.isArray(a) ? a.length > 0 ? a.join(", ") : o.label ?? "" : String(a) : o.label ?? "";
|
|
799
799
|
});
|
|
800
800
|
return (a, C) => (f(), w("div", null, [
|
|
801
801
|
l("button", {
|
|
@@ -804,32 +804,32 @@ const Gt = {
|
|
|
804
804
|
ref_key: "triggerRef",
|
|
805
805
|
ref: h,
|
|
806
806
|
title: a.label,
|
|
807
|
-
class:
|
|
807
|
+
class: I(r.value + " " + (a.width ? t(je).getWidthClass(a.width) : "w-full"))
|
|
808
808
|
}, [
|
|
809
809
|
l("span", {
|
|
810
|
-
class:
|
|
810
|
+
class: I(["truncate text-ellipsis block", a.width ? t(je).getWidthClass(a.width - 50) : "w-full"])
|
|
811
811
|
}, O(p.value), 3),
|
|
812
|
-
Y(
|
|
812
|
+
Y(Le, { class: "h-4 w-4" }),
|
|
813
813
|
(Array.isArray(a.currentValue) ? a.currentValue === null || a.currentValue.length > 0 : a.currentValue === null || a.currentValue) && a.layout === "inline" ? (f(), w("span", rl)) : S("", !0)
|
|
814
814
|
], 10, ol),
|
|
815
815
|
_.value ? (f(), P(Qe, {
|
|
816
816
|
key: 0,
|
|
817
817
|
to: "body"
|
|
818
818
|
}, [
|
|
819
|
-
|
|
819
|
+
E(l("div", {
|
|
820
820
|
ref_key: "popperRef",
|
|
821
821
|
ref: m,
|
|
822
822
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
|
823
|
-
style:
|
|
823
|
+
style: Pe({ top: `${c.value.top}px`, left: `${c.value.left}px` }),
|
|
824
824
|
"data-inside-popover": ""
|
|
825
825
|
}, [
|
|
826
826
|
l("div", nl, [
|
|
827
827
|
l("div", il, [
|
|
828
|
-
|
|
828
|
+
ve(a.$slots, "default")
|
|
829
829
|
])
|
|
830
830
|
])
|
|
831
831
|
], 4), [
|
|
832
|
-
[
|
|
832
|
+
[de, e.value]
|
|
833
833
|
])
|
|
834
834
|
])) : S("", !0)
|
|
835
835
|
]));
|
|
@@ -839,68 +839,68 @@ function sl(i) {
|
|
|
839
839
|
return String(i).charAt(0).toUpperCase() + String(i).slice(1);
|
|
840
840
|
}
|
|
841
841
|
class ne {
|
|
842
|
-
static format(
|
|
843
|
-
const
|
|
844
|
-
return `${
|
|
842
|
+
static format(n) {
|
|
843
|
+
const o = n.getFullYear(), r = (n.getMonth() + 1).toString().padStart(2, "0"), e = n.getDate().toString().padStart(2, "0");
|
|
844
|
+
return `${o}-${r}-${e}`;
|
|
845
845
|
}
|
|
846
|
-
static getShiftedDay(
|
|
847
|
-
const
|
|
848
|
-
return
|
|
846
|
+
static getShiftedDay(n, o = 0) {
|
|
847
|
+
const r = n ? new Date(n) : /* @__PURE__ */ new Date();
|
|
848
|
+
return r.setDate(r.getDate() + o), this.format(r);
|
|
849
849
|
}
|
|
850
|
-
static getLastWeekRange(
|
|
851
|
-
if (
|
|
852
|
-
const x = new Date(
|
|
853
|
-
return x.setDate(x.getDate() +
|
|
850
|
+
static getLastWeekRange(n, o, r = 0) {
|
|
851
|
+
if (n && o) {
|
|
852
|
+
const x = new Date(n), g = new Date(o);
|
|
853
|
+
return x.setDate(x.getDate() + r * 7), g.setDate(g.getDate() + r * 7), [this.format(x), this.format(g)];
|
|
854
854
|
}
|
|
855
|
-
const
|
|
856
|
-
h.setDate(
|
|
855
|
+
const e = /* @__PURE__ */ new Date(), c = e.getDay(), u = c === 0 ? 13 : c - 1 + 7, h = new Date(e);
|
|
856
|
+
h.setDate(e.getDate() - u + r * 7);
|
|
857
857
|
const m = new Date(h);
|
|
858
858
|
return m.setDate(h.getDate() + 6), [this.format(h), this.format(m)];
|
|
859
859
|
}
|
|
860
|
-
static getMonthRange(
|
|
861
|
-
let
|
|
862
|
-
|
|
863
|
-
const c =
|
|
860
|
+
static getMonthRange(n, o, r = 0) {
|
|
861
|
+
let e;
|
|
862
|
+
n ? e = new Date(n) : e = /* @__PURE__ */ new Date(), e = new Date(e.getFullYear(), e.getMonth() + r, 1);
|
|
863
|
+
const c = e, u = new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
864
864
|
return [this.format(c), this.format(u)];
|
|
865
865
|
}
|
|
866
|
-
static getQuarterRange(
|
|
867
|
-
const
|
|
866
|
+
static getQuarterRange(n, o, r = 0) {
|
|
867
|
+
const e = n || o, c = e ? new Date(e) : /* @__PURE__ */ new Date();
|
|
868
868
|
let u = Math.floor(c.getMonth() / 3);
|
|
869
|
-
u +=
|
|
869
|
+
u += r;
|
|
870
870
|
const h = (u % 4 + 4) % 4 * 3, m = c.getFullYear() + Math.floor(u / 4), x = new Date(m, h, 1), g = new Date(m, h + 3, 0);
|
|
871
871
|
return [this.format(x), this.format(g)];
|
|
872
872
|
}
|
|
873
|
-
static getYear(
|
|
874
|
-
let
|
|
875
|
-
return
|
|
873
|
+
static getYear(n, o = 0) {
|
|
874
|
+
let r;
|
|
875
|
+
return n && /^\d{4}$/.test(n) ? r = parseInt(n, 10) : n ? r = new Date(n).getFullYear() : r = (/* @__PURE__ */ new Date()).getFullYear(), String(r + o);
|
|
876
876
|
}
|
|
877
|
-
static getYearRange(
|
|
878
|
-
let
|
|
879
|
-
return
|
|
880
|
-
this.format(new Date(
|
|
881
|
-
this.format(new Date(
|
|
877
|
+
static getYearRange(n, o = 0) {
|
|
878
|
+
let r;
|
|
879
|
+
return n && /^\d{4}$/.test(n) ? r = parseInt(n, 10) : n ? r = new Date(n).getFullYear() : r = (/* @__PURE__ */ new Date()).getFullYear(), [
|
|
880
|
+
this.format(new Date(r + o, 0, 1)),
|
|
881
|
+
this.format(new Date(r + o + 1, 0, 0))
|
|
882
882
|
];
|
|
883
883
|
}
|
|
884
|
-
static getRangeFromDaysBefore(
|
|
885
|
-
const
|
|
886
|
-
return
|
|
884
|
+
static getRangeFromDaysBefore(n) {
|
|
885
|
+
const o = /* @__PURE__ */ new Date(), r = new Date(o.getTime());
|
|
886
|
+
return r.setDate(o.getDate() - n), [this.format(r), this.format(o)];
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
|
-
function nt(i,
|
|
889
|
+
function nt(i, n) {
|
|
890
890
|
const {
|
|
891
|
-
popoverRef:
|
|
892
|
-
} = i,
|
|
891
|
+
popoverRef: o
|
|
892
|
+
} = i, r = V(""), e = V(
|
|
893
893
|
i.modelValue ?? i.default ?? []
|
|
894
894
|
), c = V(0);
|
|
895
895
|
function u() {
|
|
896
896
|
const p = ne.getRangeFromDaysBefore(c.value);
|
|
897
|
-
return
|
|
897
|
+
return e.value = [...p], n("change", { name: i.name, value: e.value }), n("update:modelValue", e.value), p;
|
|
898
898
|
}
|
|
899
899
|
function h(p) {
|
|
900
900
|
var C;
|
|
901
|
-
|
|
901
|
+
r.value = p, (C = o.value) == null || C.close();
|
|
902
902
|
const a = [];
|
|
903
|
-
switch (
|
|
903
|
+
switch (r.value) {
|
|
904
904
|
case "today":
|
|
905
905
|
a.push(ne.getShiftedDay()), a.push(ne.getShiftedDay());
|
|
906
906
|
break;
|
|
@@ -923,49 +923,49 @@ function nt(i, r) {
|
|
|
923
923
|
c.value = 7, a.push(...u());
|
|
924
924
|
break;
|
|
925
925
|
}
|
|
926
|
-
|
|
926
|
+
e.value = [...a], n("change", { name: i.name, value: e.value }), n("update:modelValue", e.value);
|
|
927
927
|
}
|
|
928
928
|
function m() {
|
|
929
929
|
const p = [];
|
|
930
|
-
switch (
|
|
930
|
+
switch (r.value) {
|
|
931
931
|
case "today":
|
|
932
|
-
p.push(ne.getShiftedDay(
|
|
932
|
+
p.push(ne.getShiftedDay(e.value[0], 1));
|
|
933
933
|
break;
|
|
934
934
|
case "week":
|
|
935
|
-
p.push(...ne.getLastWeekRange(
|
|
935
|
+
p.push(...ne.getLastWeekRange(e.value[0], e.value[1], 1));
|
|
936
936
|
break;
|
|
937
937
|
case "month":
|
|
938
|
-
p.push(...ne.getMonthRange(
|
|
938
|
+
p.push(...ne.getMonthRange(e.value[0], e.value[1], 1));
|
|
939
939
|
break;
|
|
940
940
|
case "quarter":
|
|
941
|
-
p.push(...ne.getQuarterRange(
|
|
941
|
+
p.push(...ne.getQuarterRange(e.value[0], e.value[1], 1));
|
|
942
942
|
break;
|
|
943
943
|
case "year":
|
|
944
|
-
p.push(...ne.getYearRange(
|
|
944
|
+
p.push(...ne.getYearRange(e.value[0], 1));
|
|
945
945
|
break;
|
|
946
946
|
}
|
|
947
|
-
|
|
947
|
+
e.value = [...p], n("change", { name: i.name, value: e.value }), n("update:modelValue", e.value);
|
|
948
948
|
}
|
|
949
949
|
function x() {
|
|
950
950
|
const p = [];
|
|
951
|
-
switch (
|
|
951
|
+
switch (r.value) {
|
|
952
952
|
case "today":
|
|
953
|
-
p.push(ne.getShiftedDay(
|
|
953
|
+
p.push(ne.getShiftedDay(e.value[0], -1));
|
|
954
954
|
break;
|
|
955
955
|
case "week":
|
|
956
|
-
p.push(...ne.getLastWeekRange(
|
|
956
|
+
p.push(...ne.getLastWeekRange(e.value[0], e.value[1], -1));
|
|
957
957
|
break;
|
|
958
958
|
case "month":
|
|
959
|
-
p.push(...ne.getMonthRange(
|
|
959
|
+
p.push(...ne.getMonthRange(e.value[0], e.value[1], -1));
|
|
960
960
|
break;
|
|
961
961
|
case "quarter":
|
|
962
|
-
p.push(...ne.getQuarterRange(
|
|
962
|
+
p.push(...ne.getQuarterRange(e.value[0], e.value[1], -1));
|
|
963
963
|
break;
|
|
964
964
|
case "year":
|
|
965
|
-
p.push(...ne.getYearRange(
|
|
965
|
+
p.push(...ne.getYearRange(e.value[0], -1));
|
|
966
966
|
break;
|
|
967
967
|
}
|
|
968
|
-
|
|
968
|
+
e.value = [...p], n("change", { name: i.name, value: e.value }), n("update:modelValue", e.value);
|
|
969
969
|
}
|
|
970
970
|
const g = [
|
|
971
971
|
"Січень",
|
|
@@ -986,7 +986,7 @@ function nt(i, r) {
|
|
|
986
986
|
return `${b}.${C}.${a}`;
|
|
987
987
|
}
|
|
988
988
|
function y(p) {
|
|
989
|
-
const { value: a } =
|
|
989
|
+
const { value: a } = e;
|
|
990
990
|
switch (p) {
|
|
991
991
|
case "today":
|
|
992
992
|
return d(a[0]);
|
|
@@ -1014,13 +1014,13 @@ function nt(i, r) {
|
|
|
1014
1014
|
return i.label ?? "";
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
const _ =
|
|
1017
|
+
const _ = N(() => r.value ? y(r.value) : i.label ?? "");
|
|
1018
1018
|
function v() {
|
|
1019
|
-
|
|
1019
|
+
r.value = "", e.value = [], n("update:modelValue", []), n("clear", i.name);
|
|
1020
1020
|
}
|
|
1021
1021
|
return {
|
|
1022
|
-
activeMode:
|
|
1023
|
-
innerValue:
|
|
1022
|
+
activeMode: r,
|
|
1023
|
+
innerValue: e,
|
|
1024
1024
|
daysBefore: c,
|
|
1025
1025
|
onDaysBeforeChange: u,
|
|
1026
1026
|
onSelectChange: h,
|
|
@@ -1048,7 +1048,7 @@ const ul = {
|
|
|
1048
1048
|
}, hl = {
|
|
1049
1049
|
key: 0,
|
|
1050
1050
|
class: "block text-xs font-medium text-gray-600 mb-1"
|
|
1051
|
-
}, gl = ["min", "disabled"], yl = { class: "flex gap-1 pt-2" }, bl = ["onClick"], xl = /* @__PURE__ */
|
|
1051
|
+
}, gl = ["min", "disabled"], yl = { class: "flex gap-1 pt-2" }, bl = ["onClick"], xl = /* @__PURE__ */ G({
|
|
1052
1052
|
__name: "date-input",
|
|
1053
1053
|
props: {
|
|
1054
1054
|
id: {},
|
|
@@ -1074,8 +1074,8 @@ const ul = {
|
|
|
1074
1074
|
sort: {}
|
|
1075
1075
|
},
|
|
1076
1076
|
emits: ["update:modelValue", "change", "clear"],
|
|
1077
|
-
setup(i, { expose:
|
|
1078
|
-
const
|
|
1077
|
+
setup(i, { expose: n, emit: o }) {
|
|
1078
|
+
const r = i, e = ot(), c = Qt(), u = o, h = V(null), {
|
|
1079
1079
|
activeMode: m,
|
|
1080
1080
|
innerValue: x,
|
|
1081
1081
|
onSelectChange: g,
|
|
@@ -1083,139 +1083,139 @@ const ul = {
|
|
|
1083
1083
|
prevClick: y,
|
|
1084
1084
|
clear: _
|
|
1085
1085
|
} = nt({
|
|
1086
|
-
...
|
|
1086
|
+
...r,
|
|
1087
1087
|
popoverRef: h
|
|
1088
1088
|
}, u);
|
|
1089
|
-
return j(() =>
|
|
1089
|
+
return j(() => r.modelValue, (v) => {
|
|
1090
1090
|
v !== void 0 ? (x.value = v, u("update:modelValue", v)) : (m.value = "", x.value = []);
|
|
1091
|
-
}),
|
|
1091
|
+
}), n({
|
|
1092
1092
|
clear: _,
|
|
1093
1093
|
popoverRef: h
|
|
1094
|
-
}), (v, p) => (f(), w(
|
|
1094
|
+
}), (v, p) => (f(), w(Z, null, [
|
|
1095
1095
|
v.layout === "inline" ? (f(), w("div", ul, [
|
|
1096
|
-
|
|
1097
|
-
|
|
1096
|
+
t(m) !== "" && t(m) === "range" ? (f(), w("div", cl, [
|
|
1097
|
+
E(l("input", {
|
|
1098
1098
|
type: "date",
|
|
1099
|
-
max:
|
|
1099
|
+
max: t(x)[1],
|
|
1100
1100
|
locale: "uk-UA",
|
|
1101
|
-
"onUpdate:modelValue": p[0] || (p[0] = (a) =>
|
|
1101
|
+
"onUpdate:modelValue": p[0] || (p[0] = (a) => t(x)[0] = a),
|
|
1102
1102
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
|
|
1103
1103
|
disabled: v.disabled
|
|
1104
1104
|
}, null, 8, dl), [
|
|
1105
|
-
[
|
|
1105
|
+
[me, t(x)[0]]
|
|
1106
1106
|
]),
|
|
1107
|
-
|
|
1107
|
+
E(l("input", {
|
|
1108
1108
|
type: "date",
|
|
1109
|
-
min:
|
|
1109
|
+
min: t(x)[0],
|
|
1110
1110
|
locale: "uk-UA",
|
|
1111
|
-
"onUpdate:modelValue": p[1] || (p[1] = (a) =>
|
|
1111
|
+
"onUpdate:modelValue": p[1] || (p[1] = (a) => t(x)[1] = a),
|
|
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
1113
|
disabled: v.disabled
|
|
1114
1114
|
}, null, 8, pl), [
|
|
1115
|
-
[
|
|
1115
|
+
[me, t(x)[1]]
|
|
1116
1116
|
])
|
|
1117
1117
|
])) : S("", !0)
|
|
1118
1118
|
])) : S("", !0),
|
|
1119
1119
|
l("div", {
|
|
1120
|
-
class:
|
|
1120
|
+
class: I(v.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
|
|
1121
1121
|
}, [
|
|
1122
1122
|
l("div", {
|
|
1123
|
-
class:
|
|
1123
|
+
class: I(v.layout !== "popover" ? "w-[48%]" : "")
|
|
1124
1124
|
}, [
|
|
1125
1125
|
v.layout === "popover" ? (f(), w("label", fl, "Від")) : S("", !0),
|
|
1126
|
-
|
|
1126
|
+
E(l("input", {
|
|
1127
1127
|
type: "date",
|
|
1128
|
-
max:
|
|
1128
|
+
max: t(x)[1],
|
|
1129
1129
|
locale: "uk-UA",
|
|
1130
|
-
"onUpdate:modelValue": p[2] || (p[2] = (a) =>
|
|
1131
|
-
class:
|
|
1130
|
+
"onUpdate:modelValue": p[2] || (p[2] = (a) => t(x)[0] = a),
|
|
1131
|
+
class: I(t(e)),
|
|
1132
1132
|
disabled: v.disabled
|
|
1133
1133
|
}, null, 10, vl), [
|
|
1134
|
-
[
|
|
1134
|
+
[me, t(x)[0]]
|
|
1135
1135
|
])
|
|
1136
1136
|
], 2),
|
|
1137
1137
|
v.layout !== "popover" ? (f(), w("label", ml, " - ")) : S("", !0),
|
|
1138
1138
|
l("div", {
|
|
1139
|
-
class:
|
|
1139
|
+
class: I(v.layout !== "popover" ? "w-[48%]" : "")
|
|
1140
1140
|
}, [
|
|
1141
1141
|
v.layout === "popover" ? (f(), w("label", hl, "До")) : S("", !0),
|
|
1142
|
-
|
|
1142
|
+
E(l("input", {
|
|
1143
1143
|
type: "date",
|
|
1144
|
-
min:
|
|
1144
|
+
min: t(x)[0],
|
|
1145
1145
|
locale: "uk-UA",
|
|
1146
|
-
"onUpdate:modelValue": p[3] || (p[3] = (a) =>
|
|
1147
|
-
class:
|
|
1146
|
+
"onUpdate:modelValue": p[3] || (p[3] = (a) => t(x)[1] = a),
|
|
1147
|
+
class: I(t(e)),
|
|
1148
1148
|
disabled: v.disabled
|
|
1149
1149
|
}, null, 10, gl), [
|
|
1150
|
-
[
|
|
1150
|
+
[me, t(x)[1]]
|
|
1151
1151
|
])
|
|
1152
1152
|
], 2)
|
|
1153
1153
|
], 2),
|
|
1154
1154
|
l("div", yl, [
|
|
1155
|
-
(f(), w(
|
|
1155
|
+
(f(), w(Z, null, ae(["today", "week", "month", "quarter", "year"], (a) => l("button", {
|
|
1156
1156
|
key: a,
|
|
1157
|
-
class:
|
|
1158
|
-
onClick: (C) =>
|
|
1159
|
-
}, O(
|
|
1157
|
+
class: I(t(c) + (t(m) === a ? " bg-blue-100" : "")),
|
|
1158
|
+
onClick: (C) => t(g)(a)
|
|
1159
|
+
}, O(t(sl)(a)), 11, bl)), 64)),
|
|
1160
1160
|
l("button", {
|
|
1161
|
-
class:
|
|
1161
|
+
class: I(t(c)),
|
|
1162
1162
|
onClick: p[4] || (p[4] = //@ts-ignore
|
|
1163
|
-
(...a) =>
|
|
1163
|
+
(...a) => t(y) && t(y)(...a))
|
|
1164
1164
|
}, " <", 2),
|
|
1165
1165
|
l("button", {
|
|
1166
|
-
class:
|
|
1166
|
+
class: I(t(c)),
|
|
1167
1167
|
onClick: p[5] || (p[5] = //@ts-ignore
|
|
1168
|
-
(...a) =>
|
|
1168
|
+
(...a) => t(d) && t(d)(...a))
|
|
1169
1169
|
}, " >", 2)
|
|
1170
1170
|
]),
|
|
1171
1171
|
(v.cleanable, S("", !0))
|
|
1172
1172
|
], 64));
|
|
1173
1173
|
}
|
|
1174
1174
|
});
|
|
1175
|
-
function wl(i,
|
|
1175
|
+
function wl(i, n) {
|
|
1176
1176
|
const {
|
|
1177
|
-
api:
|
|
1178
|
-
options:
|
|
1179
|
-
limit:
|
|
1177
|
+
api: o,
|
|
1178
|
+
options: r = [],
|
|
1179
|
+
limit: e = 20,
|
|
1180
1180
|
dataKey: c = "data"
|
|
1181
1181
|
} = i, u = i.multi;
|
|
1182
1182
|
function h(z) {
|
|
1183
1183
|
return u ? Array.isArray(z) ? z : z ? [z] : [] : Array.isArray(z) ? z[0] : z;
|
|
1184
1184
|
}
|
|
1185
|
-
const m = V(h(i.modelValue)), x = V(""), g = V(!1), d = V([]), y = V("id"), _ = V("text"), v = V(!1), p = V(i.layout !== "popover" &&
|
|
1185
|
+
const m = V(h(i.modelValue)), x = V(""), g = V(!1), d = V([]), y = V("id"), _ = V("text"), v = V(!1), p = V(i.layout !== "popover" && r.length > e), a = V([]), C = V(0);
|
|
1186
1186
|
function b(z) {
|
|
1187
|
-
const H = z.find(Boolean) ?? {},
|
|
1188
|
-
return { autoValueKey:
|
|
1187
|
+
const H = z.find(Boolean) ?? {}, X = ["id", "value", "code", "key"].find((ue) => ue in H) ?? "id", ge = ["text", "label", "name", "title"].find((ue) => ue in H) ?? "text";
|
|
1188
|
+
return { autoValueKey: X, autoLabelKey: ge };
|
|
1189
1189
|
}
|
|
1190
|
-
if (
|
|
1191
|
-
const z = b(
|
|
1190
|
+
if (r.length > 0) {
|
|
1191
|
+
const z = b(r);
|
|
1192
1192
|
y.value = z.autoValueKey, _.value = z.autoLabelKey;
|
|
1193
1193
|
}
|
|
1194
|
-
const s =
|
|
1195
|
-
if (
|
|
1194
|
+
const s = N(() => {
|
|
1195
|
+
if (o) return d.value;
|
|
1196
1196
|
const z = d.value;
|
|
1197
1197
|
if (i.layout === "popover") return z;
|
|
1198
1198
|
if (!x.value)
|
|
1199
|
-
return v.value ? z : z.slice(0,
|
|
1199
|
+
return v.value ? z : z.slice(0, e);
|
|
1200
1200
|
const H = x.value.toLowerCase();
|
|
1201
|
-
return z.filter((
|
|
1201
|
+
return z.filter((X) => X[_.value].toLowerCase().includes(H));
|
|
1202
1202
|
});
|
|
1203
1203
|
let k = null;
|
|
1204
1204
|
async function B(z) {
|
|
1205
|
-
if (
|
|
1205
|
+
if (o) {
|
|
1206
1206
|
g.value = !0;
|
|
1207
1207
|
try {
|
|
1208
|
-
const H = new URL(
|
|
1209
|
-
H.searchParams.set("json", "1"), H.searchParams.set("key", z), H.searchParams.set("limit",
|
|
1210
|
-
const
|
|
1211
|
-
if (!
|
|
1212
|
-
throw new Error(`HTTP error! status: ${
|
|
1213
|
-
const
|
|
1214
|
-
if (d.value =
|
|
1215
|
-
const
|
|
1216
|
-
y.value =
|
|
1208
|
+
const H = new URL(o, window.location.origin);
|
|
1209
|
+
H.searchParams.set("json", "1"), H.searchParams.set("key", z), H.searchParams.set("limit", e.toString());
|
|
1210
|
+
const X = await fetch(H.toString());
|
|
1211
|
+
if (!X.ok)
|
|
1212
|
+
throw new Error(`HTTP error! status: ${X.status}`);
|
|
1213
|
+
const ge = await X.json();
|
|
1214
|
+
if (d.value = ge[c], d.value.length > 0) {
|
|
1215
|
+
const ue = b(d.value);
|
|
1216
|
+
y.value = ue.autoValueKey, _.value = ue.autoLabelKey;
|
|
1217
1217
|
}
|
|
1218
|
-
C.value =
|
|
1218
|
+
C.value = ge.total;
|
|
1219
1219
|
} catch (H) {
|
|
1220
1220
|
console.error("Failed to fetch remote options:", H);
|
|
1221
1221
|
} finally {
|
|
@@ -1224,30 +1224,30 @@ function wl(i, r) {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
j(x, (z) => {
|
|
1227
|
-
|
|
1227
|
+
o && (k && clearTimeout(k), k = setTimeout(() => {
|
|
1228
1228
|
B(z);
|
|
1229
1229
|
}, 200));
|
|
1230
1230
|
}), j(() => i.modelValue, (z) => {
|
|
1231
1231
|
m.value = h(z);
|
|
1232
|
-
}, { immediate: !0 }),
|
|
1232
|
+
}, { immediate: !0 }), o ? B("") : d.value = r;
|
|
1233
1233
|
function A(z) {
|
|
1234
1234
|
return u && Array.isArray(m.value) ? m.value.includes(z[y.value]) : m.value && m.value === z[y.value];
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function L(z) {
|
|
1237
1237
|
if (u && !Array.isArray(m.value) && (m.value = []), u && Array.isArray(m.value)) {
|
|
1238
1238
|
const H = m.value.includes(z[y.value]);
|
|
1239
|
-
m.value = H ? m.value.filter((
|
|
1239
|
+
m.value = H ? m.value.filter((X) => X !== z[y.value]) : [...m.value, z[y.value]], a.value = H ? a.value.filter((X) => X !== z[_.value]) : [...a.value, z[_.value]];
|
|
1240
1240
|
} else
|
|
1241
1241
|
m.value = z[y.value], a.value = z[_.value];
|
|
1242
|
-
|
|
1242
|
+
n("update:modelValue", m.value), n("change", { name: i.name, value: m.value });
|
|
1243
1243
|
}
|
|
1244
1244
|
function T() {
|
|
1245
|
-
u ? (m.value = [], a.value = []) : (m.value = void 0, a.value = []),
|
|
1245
|
+
u ? (m.value = [], a.value = []) : (m.value = void 0, a.value = []), n("update:modelValue", m.value), n("clear", i.name);
|
|
1246
1246
|
}
|
|
1247
1247
|
function K() {
|
|
1248
1248
|
k && clearTimeout(k), x.value = "", v.value = !1;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function fe() {
|
|
1251
1251
|
v.value = !v.value;
|
|
1252
1252
|
}
|
|
1253
1253
|
Me(() => {
|
|
@@ -1257,15 +1257,15 @@ function wl(i, r) {
|
|
|
1257
1257
|
j(s, () => {
|
|
1258
1258
|
oe.value = s.value.length > 0 ? 0 : -1;
|
|
1259
1259
|
});
|
|
1260
|
-
function
|
|
1260
|
+
function F(z) {
|
|
1261
1261
|
const H = s.value.length;
|
|
1262
1262
|
if (z.key === "ArrowDown")
|
|
1263
1263
|
z.preventDefault(), oe.value = (oe.value + 1) % H;
|
|
1264
1264
|
else if (z.key === "ArrowUp")
|
|
1265
1265
|
z.preventDefault(), oe.value = (oe.value - 1 + H) % H;
|
|
1266
1266
|
else if (z.key === "Enter" && (z.preventDefault(), oe.value >= 0 && oe.value < s.value.length)) {
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1267
|
+
const X = s.value[oe.value];
|
|
1268
|
+
L(X);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
return {
|
|
@@ -1273,10 +1273,10 @@ function wl(i, r) {
|
|
|
1273
1273
|
searchTerm: x,
|
|
1274
1274
|
filteredOptions: s,
|
|
1275
1275
|
isSelected: A,
|
|
1276
|
-
selectItem:
|
|
1276
|
+
selectItem: L,
|
|
1277
1277
|
clear: T,
|
|
1278
1278
|
resetSearch: K,
|
|
1279
|
-
toggleShowAll:
|
|
1279
|
+
toggleShowAll: fe,
|
|
1280
1280
|
isReqProc: g,
|
|
1281
1281
|
showAll: v,
|
|
1282
1282
|
isEnableShowAll: p,
|
|
@@ -1284,7 +1284,7 @@ function wl(i, r) {
|
|
|
1284
1284
|
valueKey: y,
|
|
1285
1285
|
allOptions: d,
|
|
1286
1286
|
highlightedIndex: oe,
|
|
1287
|
-
onKeyDown:
|
|
1287
|
+
onKeyDown: F,
|
|
1288
1288
|
selectedLabels: a,
|
|
1289
1289
|
totalCount: C
|
|
1290
1290
|
};
|
|
@@ -1298,7 +1298,7 @@ const kl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1298
1298
|
}, Sl = {
|
|
1299
1299
|
key: 1,
|
|
1300
1300
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1301
|
-
}, $l = /* @__PURE__ */
|
|
1301
|
+
}, $l = /* @__PURE__ */ G({
|
|
1302
1302
|
__name: "select",
|
|
1303
1303
|
props: {
|
|
1304
1304
|
id: {},
|
|
@@ -1324,8 +1324,8 @@ const kl = { 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: o }) {
|
|
1328
|
+
const r = i, e = o, c = V(null), {
|
|
1329
1329
|
innerValue: u,
|
|
1330
1330
|
filteredOptions: h,
|
|
1331
1331
|
isSelected: m,
|
|
@@ -1344,122 +1344,122 @@ const kl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1344
1344
|
selectedLabels: B,
|
|
1345
1345
|
totalCount: A
|
|
1346
1346
|
} = wl({
|
|
1347
|
-
...
|
|
1348
|
-
modelValue:
|
|
1349
|
-
},
|
|
1350
|
-
|
|
1347
|
+
...r,
|
|
1348
|
+
modelValue: r.modelValue
|
|
1349
|
+
}, e);
|
|
1350
|
+
_e(() => {
|
|
1351
1351
|
d();
|
|
1352
1352
|
}), j(
|
|
1353
|
-
() =>
|
|
1353
|
+
() => r.modelValue,
|
|
1354
1354
|
(T) => {
|
|
1355
|
-
T === void 0 && (
|
|
1355
|
+
T === void 0 && (r.multi ? u.value = [] : u.value = void 0);
|
|
1356
1356
|
}
|
|
1357
1357
|
);
|
|
1358
|
-
const
|
|
1358
|
+
const L = V([]);
|
|
1359
1359
|
return j(s, (T) => {
|
|
1360
1360
|
var K;
|
|
1361
|
-
T >= 0 &&
|
|
1361
|
+
T >= 0 && L.value[T] && ((K = L.value[T]) == null || K.scrollIntoView({
|
|
1362
1362
|
block: "nearest",
|
|
1363
1363
|
behavior: "smooth"
|
|
1364
1364
|
}));
|
|
1365
1365
|
}), j(h, () => {
|
|
1366
|
-
|
|
1367
|
-
}),
|
|
1366
|
+
L.value = [];
|
|
1367
|
+
}), n({
|
|
1368
1368
|
clear: g,
|
|
1369
1369
|
inputTextRef: c,
|
|
1370
1370
|
selectedLabels: B
|
|
1371
1371
|
}), (T, K) => {
|
|
1372
|
-
var
|
|
1372
|
+
var fe, oe;
|
|
1373
1373
|
return f(), w("div", {
|
|
1374
|
-
class:
|
|
1374
|
+
class: I([T.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
1375
1375
|
}, [
|
|
1376
1376
|
l("div", kl, [
|
|
1377
|
-
|
|
1378
|
-
"onUpdate:modelValue": K[0] || (K[0] = (
|
|
1377
|
+
E(l("input", {
|
|
1378
|
+
"onUpdate:modelValue": K[0] || (K[0] = (F) => pt(a) ? a.value = F : null),
|
|
1379
1379
|
onKeydown: K[1] || (K[1] = //@ts-ignore
|
|
1380
|
-
(...
|
|
1380
|
+
(...F) => t(k) && t(k)(...F)),
|
|
1381
1381
|
class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
|
|
1382
1382
|
placeholder: "Пошук",
|
|
1383
1383
|
type: "text",
|
|
1384
1384
|
ref_key: "inputTextRef",
|
|
1385
1385
|
ref: c
|
|
1386
1386
|
}, null, 544), [
|
|
1387
|
-
[
|
|
1387
|
+
[me, t(a)]
|
|
1388
1388
|
]),
|
|
1389
1389
|
Y(lt, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
|
1390
1390
|
Y(at, {
|
|
1391
|
-
onClick: K[2] || (K[2] = (
|
|
1391
|
+
onClick: K[2] || (K[2] = (F) => a.value = ""),
|
|
1392
1392
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
1393
1393
|
})
|
|
1394
1394
|
]),
|
|
1395
1395
|
l("div", {
|
|
1396
|
-
class:
|
|
1396
|
+
class: I([
|
|
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
|
-
(f(!0), w(
|
|
1401
|
+
(f(!0), w(Z, null, ae(t(h), (F, z) => (f(), P(Ke, {
|
|
1402
1402
|
layout: T.layout,
|
|
1403
|
-
count:
|
|
1404
|
-
label:
|
|
1405
|
-
color:
|
|
1403
|
+
count: F.count,
|
|
1404
|
+
label: F[t(C)],
|
|
1405
|
+
color: F.color,
|
|
1406
1406
|
type: T.multi ? "checkbox" : "radio",
|
|
1407
|
-
value:
|
|
1408
|
-
"is-selected":
|
|
1409
|
-
highlighted: z ===
|
|
1410
|
-
onItemClick: (H) =>
|
|
1407
|
+
value: F[t(b)],
|
|
1408
|
+
"is-selected": t(m)(F),
|
|
1409
|
+
highlighted: z === t(s),
|
|
1410
|
+
onItemClick: (H) => t(x)(F),
|
|
1411
1411
|
ref_for: !0,
|
|
1412
|
-
ref: (H) =>
|
|
1412
|
+
ref: (H) => L.value[z] = H == null ? void 0 : H.el
|
|
1413
1413
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
|
1414
1414
|
], 2),
|
|
1415
|
-
T.type === "select" &&
|
|
1415
|
+
T.type === "select" && t(h).length === 0 && !t(_) ? (f(), w("div", _l, [
|
|
1416
1416
|
l("div", Cl, [
|
|
1417
|
-
Y(
|
|
1417
|
+
Y(Ue),
|
|
1418
1418
|
K[7] || (K[7] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
1419
1419
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
|
|
1420
1420
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
1421
1421
|
], -1))
|
|
1422
1422
|
])
|
|
1423
1423
|
])) : S("", !0),
|
|
1424
|
-
T.layout !== "popover" && T.type !== "select" ? (f(), w(
|
|
1425
|
-
!
|
|
1424
|
+
T.layout !== "popover" && T.type !== "select" ? (f(), w(Z, { key: 1 }, [
|
|
1425
|
+
!t(v) && t(p) ? (f(), w("div", {
|
|
1426
1426
|
key: 0,
|
|
1427
1427
|
onClick: K[3] || (K[3] = //@ts-ignore
|
|
1428
|
-
(...
|
|
1428
|
+
(...F) => t(y) && t(y)(...F)),
|
|
1429
1429
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
|
1430
1430
|
}, [
|
|
1431
|
-
K[8] || (K[8] =
|
|
1432
|
-
Y(
|
|
1431
|
+
K[8] || (K[8] = te(" Показати більше ", -1)),
|
|
1432
|
+
Y(Le)
|
|
1433
1433
|
])) : S("", !0),
|
|
1434
|
-
|
|
1434
|
+
t(v) ? (f(), w("div", {
|
|
1435
1435
|
key: 1,
|
|
1436
1436
|
onClick: K[4] || (K[4] = //@ts-ignore
|
|
1437
|
-
(...
|
|
1437
|
+
(...F) => t(y) && t(y)(...F)),
|
|
1438
1438
|
class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
|
|
1439
1439
|
}, [
|
|
1440
|
-
K[9] || (K[9] =
|
|
1441
|
-
Y(
|
|
1440
|
+
K[9] || (K[9] = te(" Показати менше ", -1)),
|
|
1441
|
+
Y(Ie)
|
|
1442
1442
|
])) : S("", !0)
|
|
1443
1443
|
], 64)) : S("", !0),
|
|
1444
|
-
T.cleanable ? (f(), w(
|
|
1444
|
+
T.cleanable ? (f(), w(Z, { key: 2 }, [
|
|
1445
1445
|
T.layout === "inline" ? (f(), w("div", Vl, [
|
|
1446
|
-
|
|
1447
|
-
|
|
1446
|
+
te(O(T.multi && Array.isArray(t(u)) ? (fe = t(u)) == null ? void 0 : fe.length : t(u) !== void 0 && (t(u) || t(u) === null) ? 1 : 0) + " з " + O(t(A)) + " обрано ", 1),
|
|
1447
|
+
E(l("button", {
|
|
1448
1448
|
class: "text-gray-600 hover:text-gray-800",
|
|
1449
1449
|
onClick: K[5] || (K[5] = //@ts-ignore
|
|
1450
|
-
(...
|
|
1450
|
+
(...F) => t(g) && t(g)(...F))
|
|
1451
1451
|
}, " Очистити ", 512), [
|
|
1452
|
-
[
|
|
1452
|
+
[de, t(u) !== "" && t(u) !== void 0 || t(u)]
|
|
1453
1453
|
])
|
|
1454
1454
|
])) : S("", !0),
|
|
1455
1455
|
T.layout === "popover" ? (f(), w("div", Sl, [
|
|
1456
|
-
l("span", null, O(T.multi && Array.isArray(
|
|
1457
|
-
|
|
1456
|
+
l("span", null, O(T.multi && Array.isArray(t(u)) ? (oe = t(u)) == null ? void 0 : oe.length : t(u) !== void 0 && (t(u) || t(u) === null) ? 1 : 0) + " з " + O(t(A)) + " обрано", 1),
|
|
1457
|
+
E(l("button", {
|
|
1458
1458
|
class: "text-gray-600 hover:text-gray-800",
|
|
1459
1459
|
onClick: K[6] || (K[6] = //@ts-ignore
|
|
1460
|
-
(...
|
|
1460
|
+
(...F) => t(g) && t(g)(...F))
|
|
1461
1461
|
}, " Очистити ", 512), [
|
|
1462
|
-
[
|
|
1462
|
+
[de, t(u) !== "" && t(u) !== void 0 || t(u)]
|
|
1463
1463
|
])
|
|
1464
1464
|
])) : S("", !0)
|
|
1465
1465
|
], 64)) : S("", !0)
|
|
@@ -1472,7 +1472,7 @@ const kl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1472
1472
|
}, Rl = {
|
|
1473
1473
|
key: 1,
|
|
1474
1474
|
class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
|
|
1475
|
-
},
|
|
1475
|
+
}, Ll = /* @__PURE__ */ G({
|
|
1476
1476
|
__name: "tag-field",
|
|
1477
1477
|
props: {
|
|
1478
1478
|
id: {},
|
|
@@ -1498,8 +1498,8 @@ const kl = { 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: o }) {
|
|
1502
|
+
const r = i, e = o, {
|
|
1503
1503
|
innerValue: c,
|
|
1504
1504
|
isSelected: u,
|
|
1505
1505
|
selectItem: h,
|
|
@@ -1507,68 +1507,68 @@ const kl = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1507
1507
|
labelKey: x,
|
|
1508
1508
|
valueKey: g,
|
|
1509
1509
|
allOptions: d
|
|
1510
|
-
} =
|
|
1511
|
-
...
|
|
1512
|
-
modelValue:
|
|
1513
|
-
},
|
|
1514
|
-
...
|
|
1515
|
-
modelValue:
|
|
1516
|
-
},
|
|
1517
|
-
return
|
|
1510
|
+
} = r.multi ? tt({
|
|
1511
|
+
...r,
|
|
1512
|
+
modelValue: r.modelValue ?? r.default ?? []
|
|
1513
|
+
}, e) : et({
|
|
1514
|
+
...r,
|
|
1515
|
+
modelValue: r.modelValue !== void 0 ? r.modelValue : r.default ?? ""
|
|
1516
|
+
}, e);
|
|
1517
|
+
return n({
|
|
1518
1518
|
clear: m
|
|
1519
1519
|
}), j(
|
|
1520
|
-
() =>
|
|
1520
|
+
() => r.modelValue,
|
|
1521
1521
|
(y) => {
|
|
1522
|
-
y === void 0 && (
|
|
1522
|
+
y === void 0 && (r.multi ? c.value = [] : c.value = void 0);
|
|
1523
1523
|
}
|
|
1524
1524
|
), (y, _) => {
|
|
1525
1525
|
var v, p;
|
|
1526
|
-
return f(), w(
|
|
1526
|
+
return f(), w(Z, null, [
|
|
1527
1527
|
l("div", {
|
|
1528
|
-
class:
|
|
1528
|
+
class: I(["grid grid-cols-3 gap-2 mx-[1px]", y.layout === "popover" ? "m-1" : "mb-1"])
|
|
1529
1529
|
}, [
|
|
1530
|
-
(f(!0), w(
|
|
1531
|
-
key: `item-${a[
|
|
1532
|
-
for: `item-${a[
|
|
1533
|
-
onClick: Ge((C) =>
|
|
1534
|
-
class:
|
|
1530
|
+
(f(!0), w(Z, null, ae(t(d), (a) => (f(), w("label", {
|
|
1531
|
+
key: `item-${a[t(g)]}`,
|
|
1532
|
+
for: `item-${a[t(g)]}`,
|
|
1533
|
+
onClick: Ge((C) => t(h)(a), ["stop", "prevent"]),
|
|
1534
|
+
class: I([t(u)(a) ? "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
|
l("input", {
|
|
1537
1537
|
type: "checkbox",
|
|
1538
|
-
id: `item-${a[
|
|
1538
|
+
id: `item-${a[t(g)]}`,
|
|
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
|
-
name: `item-${a[
|
|
1541
|
-
value: a[
|
|
1540
|
+
name: `item-${a[t(g)]}`,
|
|
1541
|
+
value: a[t(g)]
|
|
1542
1542
|
}, null, 8, Bl),
|
|
1543
|
-
l("span", zl, O(a[
|
|
1543
|
+
l("span", zl, O(a[t(x)]), 1)
|
|
1544
1544
|
], 10, Ml))), 128))
|
|
1545
1545
|
], 2),
|
|
1546
|
-
y.cleanable ? (f(), w(
|
|
1546
|
+
y.cleanable ? (f(), w(Z, { key: 0 }, [
|
|
1547
1547
|
y.layout === "inline" ? (f(), w("div", Al, [
|
|
1548
|
-
|
|
1549
|
-
|
|
1548
|
+
te(O(y.multi && Array.isArray(t(c)) ? (v = t(c)) == null ? void 0 : v.length : t(c) !== void 0 && (t(c) || t(c) === null) ? 1 : 0) + " з " + O(t(d).length) + " обрано ", 1),
|
|
1549
|
+
E(l("button", {
|
|
1550
1550
|
class: "text-gray-600 hover:text-gray-800",
|
|
1551
1551
|
onClick: _[0] || (_[0] = //@ts-ignore
|
|
1552
|
-
(...a) =>
|
|
1552
|
+
(...a) => t(m) && t(m)(...a))
|
|
1553
1553
|
}, " Очистити ", 512), [
|
|
1554
|
-
[
|
|
1554
|
+
[de, t(c) !== "" && t(c) !== void 0 || t(c)]
|
|
1555
1555
|
])
|
|
1556
1556
|
])) : S("", !0),
|
|
1557
1557
|
y.layout === "popover" ? (f(), w("div", Rl, [
|
|
1558
|
-
l("span", null, O(y.multi && Array.isArray(
|
|
1559
|
-
|
|
1558
|
+
l("span", null, O(y.multi && Array.isArray(t(c)) ? (p = t(c)) == null ? void 0 : p.length : t(c) !== void 0 && (t(c) || t(c) === null) ? 1 : 0) + " з " + O(t(d).length) + " обрано", 1),
|
|
1559
|
+
E(l("button", {
|
|
1560
1560
|
class: "text-gray-600 hover:text-gray-800",
|
|
1561
1561
|
onClick: _[1] || (_[1] = //@ts-ignore
|
|
1562
|
-
(...a) =>
|
|
1562
|
+
(...a) => t(m) && t(m)(...a))
|
|
1563
1563
|
}, " Очистити ", 512), [
|
|
1564
|
-
[
|
|
1564
|
+
[de, t(c) !== void 0 && t(c) !== "" || t(c)]
|
|
1565
1565
|
])
|
|
1566
1566
|
])) : S("", !0)
|
|
1567
1567
|
], 64)) : S("", !0)
|
|
1568
1568
|
], 64);
|
|
1569
1569
|
};
|
|
1570
1570
|
}
|
|
1571
|
-
}),
|
|
1571
|
+
}), jl = {}, Dl = {
|
|
1572
1572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1573
1573
|
width: "24",
|
|
1574
1574
|
height: "24",
|
|
@@ -1580,12 +1580,12 @@ const kl = { 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 f(), w("svg",
|
|
1583
|
+
function Fl(i, n) {
|
|
1584
|
+
return f(), w("svg", Dl, n[0] || (n[0] = [
|
|
1585
1585
|
l("path", { d: "M20 6 9 17l-5-5" }, null, -1)
|
|
1586
1586
|
]));
|
|
1587
1587
|
}
|
|
1588
|
-
const
|
|
1588
|
+
const ke = /* @__PURE__ */ he(jl, [["render", Fl]]), Pl = {}, Kl = {
|
|
1589
1589
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1590
1590
|
width: "15px",
|
|
1591
1591
|
height: "24",
|
|
@@ -1597,8 +1597,8 @@ const _e = /* @__PURE__ */ me(Dl, [["render", Ll]]), Pl = {}, Kl = {
|
|
|
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 Ul(i,
|
|
1601
|
-
return f(), w("svg", Kl,
|
|
1600
|
+
function Ul(i, n) {
|
|
1601
|
+
return f(), w("svg", Kl, n[0] || (n[0] = [
|
|
1602
1602
|
l("path", {
|
|
1603
1603
|
stroke: "none",
|
|
1604
1604
|
d: "M0 0h24v24H0z",
|
|
@@ -1607,7 +1607,7 @@ function Ul(i, r) {
|
|
|
1607
1607
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1608
1608
|
]));
|
|
1609
1609
|
}
|
|
1610
|
-
const Il = /* @__PURE__ */
|
|
1610
|
+
const Il = /* @__PURE__ */ he(Pl, [["render", Ul]]), Zl = {}, Ol = {
|
|
1611
1611
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1612
1612
|
width: "15px",
|
|
1613
1613
|
height: "24",
|
|
@@ -1619,8 +1619,8 @@ const Il = /* @__PURE__ */ me(Pl, [["render", Ul]]), Ol = {}, Tl = {
|
|
|
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
|
|
1623
|
-
return f(), w("svg",
|
|
1622
|
+
function Tl(i, n) {
|
|
1623
|
+
return f(), w("svg", Ol, n[0] || (n[0] = [
|
|
1624
1624
|
l("path", {
|
|
1625
1625
|
stroke: "none",
|
|
1626
1626
|
d: "M0 0h24v24H0z",
|
|
@@ -1629,10 +1629,10 @@ function Hl(i, r) {
|
|
|
1629
1629
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
1630
1630
|
]));
|
|
1631
1631
|
}
|
|
1632
|
-
const
|
|
1632
|
+
const Hl = /* @__PURE__ */ he(Zl, [["render", Tl]]), El = { class: "flex" }, Nl = { class: "mb-1" }, Wl = { class: "mb-1" }, Yl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, ql = { class: "inline-flex rounded-lg shrink-0 pl-1" }, Ql = {
|
|
1633
1633
|
key: 1,
|
|
1634
1634
|
class: "flex gap-1 !w-[75%] rounded-lg"
|
|
1635
|
-
}, Gl = ["max", "disabled"], Jl = ["min", "disabled"], Xl = /* @__PURE__ */
|
|
1635
|
+
}, Gl = ["max", "disabled"], Jl = ["min", "disabled"], Xl = /* @__PURE__ */ G({
|
|
1636
1636
|
__name: "date-input-inline",
|
|
1637
1637
|
props: {
|
|
1638
1638
|
id: {},
|
|
@@ -1658,8 +1658,8 @@ const El = /* @__PURE__ */ me(Ol, [["render", Hl]]), Nl = { class: "flex" }, Wl
|
|
|
1658
1658
|
sort: {}
|
|
1659
1659
|
},
|
|
1660
1660
|
emits: ["update:modelValue", "change", "clear"],
|
|
1661
|
-
setup(i, { expose:
|
|
1662
|
-
const
|
|
1661
|
+
setup(i, { expose: n, emit: o }) {
|
|
1662
|
+
const r = i, e = o, c = V(null), {
|
|
1663
1663
|
activeMode: u,
|
|
1664
1664
|
innerValue: h,
|
|
1665
1665
|
onSelectChange: m,
|
|
@@ -1668,34 +1668,34 @@ const El = /* @__PURE__ */ me(Ol, [["render", Hl]]), Nl = { class: "flex" }, Wl
|
|
|
1668
1668
|
currentLabel: d,
|
|
1669
1669
|
clear: y
|
|
1670
1670
|
} = nt({
|
|
1671
|
-
...
|
|
1671
|
+
...r,
|
|
1672
1672
|
popoverRef: c
|
|
1673
|
-
},
|
|
1674
|
-
return j(() =>
|
|
1675
|
-
_ !== void 0 ? (h.value = _,
|
|
1676
|
-
}),
|
|
1673
|
+
}, e);
|
|
1674
|
+
return j(() => r.modelValue, (_) => {
|
|
1675
|
+
_ !== void 0 ? (h.value = _, e("update:modelValue", _)) : (u.value = "", h.value = []);
|
|
1676
|
+
}), n({
|
|
1677
1677
|
clear: y,
|
|
1678
1678
|
popoverRef: c
|
|
1679
|
-
}), (_, v) => (f(), w(
|
|
1680
|
-
l("div",
|
|
1681
|
-
Y(
|
|
1679
|
+
}), (_, v) => (f(), w(Z, null, [
|
|
1680
|
+
l("div", El, [
|
|
1681
|
+
Y(Ze, {
|
|
1682
1682
|
ref_key: "popoverRef",
|
|
1683
1683
|
ref: c,
|
|
1684
|
-
label:
|
|
1685
|
-
"current-value":
|
|
1684
|
+
label: t(d),
|
|
1685
|
+
"current-value": t(h),
|
|
1686
1686
|
mode: _.mode,
|
|
1687
|
-
onClear:
|
|
1687
|
+
onClear: t(y),
|
|
1688
1688
|
layout: _.layout
|
|
1689
1689
|
}, {
|
|
1690
|
-
default:
|
|
1690
|
+
default: xe(() => [
|
|
1691
1691
|
l("div", null, [
|
|
1692
1692
|
l("button", {
|
|
1693
1693
|
type: "button",
|
|
1694
|
-
onClick: v[0] || (v[0] = (p) =>
|
|
1694
|
+
onClick: v[0] || (v[0] = (p) => t(m)("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
|
-
v[12] || (v[12] =
|
|
1698
|
-
|
|
1697
|
+
v[12] || (v[12] = te(" Період ", -1)),
|
|
1698
|
+
t(u) === "range" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1699
1699
|
])
|
|
1700
1700
|
]),
|
|
1701
1701
|
v[19] || (v[19] = l("div", null, [
|
|
@@ -1704,75 +1704,75 @@ const El = /* @__PURE__ */ me(Ol, [["render", Hl]]), Nl = { class: "flex" }, Wl
|
|
|
1704
1704
|
l("div", null, [
|
|
1705
1705
|
l("button", {
|
|
1706
1706
|
type: "button",
|
|
1707
|
-
onClick: v[1] || (v[1] = (p) =>
|
|
1707
|
+
onClick: v[1] || (v[1] = (p) => t(m)("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
|
-
v[13] || (v[13] =
|
|
1711
|
-
|
|
1710
|
+
v[13] || (v[13] = te(" Сьогодні ", -1)),
|
|
1711
|
+
t(u) === "today" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1712
1712
|
])
|
|
1713
1713
|
]),
|
|
1714
1714
|
l("div", null, [
|
|
1715
1715
|
l("button", {
|
|
1716
1716
|
type: "button",
|
|
1717
|
-
onClick: v[2] || (v[2] = (p) =>
|
|
1717
|
+
onClick: v[2] || (v[2] = (p) => t(m)("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
|
-
v[14] || (v[14] =
|
|
1721
|
-
|
|
1720
|
+
v[14] || (v[14] = te(" Тиждень ", -1)),
|
|
1721
|
+
t(u) === "week" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1722
1722
|
])
|
|
1723
1723
|
]),
|
|
1724
1724
|
l("div", null, [
|
|
1725
1725
|
l("button", {
|
|
1726
1726
|
type: "button",
|
|
1727
|
-
onClick: v[3] || (v[3] = (p) =>
|
|
1727
|
+
onClick: v[3] || (v[3] = (p) => t(m)("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
|
-
v[15] || (v[15] =
|
|
1731
|
-
|
|
1730
|
+
v[15] || (v[15] = te(" Місяць ", -1)),
|
|
1731
|
+
t(u) === "month" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1732
1732
|
])
|
|
1733
1733
|
]),
|
|
1734
1734
|
l("div", null, [
|
|
1735
1735
|
l("button", {
|
|
1736
1736
|
type: "button",
|
|
1737
|
-
onClick: v[4] || (v[4] = (p) =>
|
|
1737
|
+
onClick: v[4] || (v[4] = (p) => t(m)("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
|
-
v[16] || (v[16] =
|
|
1741
|
-
|
|
1740
|
+
v[16] || (v[16] = te(" Квартал ", -1)),
|
|
1741
|
+
t(u) === "quarter" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1742
1742
|
])
|
|
1743
1743
|
]),
|
|
1744
|
-
l("div",
|
|
1744
|
+
l("div", Nl, [
|
|
1745
1745
|
l("button", {
|
|
1746
1746
|
type: "button",
|
|
1747
|
-
onClick: v[5] || (v[5] = (p) =>
|
|
1747
|
+
onClick: v[5] || (v[5] = (p) => t(m)("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
|
-
v[17] || (v[17] =
|
|
1751
|
-
|
|
1750
|
+
v[17] || (v[17] = te(" Рік ", -1)),
|
|
1751
|
+
t(u) === "year" ? (f(), P(ke, { key: 0 })) : S("", !0)
|
|
1752
1752
|
])
|
|
1753
1753
|
]),
|
|
1754
|
-
l("div",
|
|
1754
|
+
l("div", Wl, [
|
|
1755
1755
|
l("button", {
|
|
1756
1756
|
type: "button",
|
|
1757
|
-
onClick: v[6] || (v[6] = (p) =>
|
|
1757
|
+
onClick: v[6] || (v[6] = (p) => t(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
|
-
v[18] || (v[18] =
|
|
1761
|
-
|
|
1760
|
+
v[18] || (v[18] = te(" Весь час ", -1)),
|
|
1761
|
+
t(h)[0] ? S("", !0) : (f(), P(ke, { key: 0 }))
|
|
1762
1762
|
])
|
|
1763
1763
|
])
|
|
1764
1764
|
]),
|
|
1765
1765
|
_: 1,
|
|
1766
1766
|
__: [19]
|
|
1767
1767
|
}, 8, ["label", "current-value", "mode", "onClear", "layout"]),
|
|
1768
|
-
|
|
1768
|
+
t(u) !== "" && t(u) !== "range" && t(u) !== "last_7_days" ? (f(), w(Z, { key: 0 }, [
|
|
1769
1769
|
l("div", Yl, [
|
|
1770
1770
|
l("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
1774
|
onClick: v[7] || (v[7] = //@ts-ignore
|
|
1775
|
-
(...p) =>
|
|
1775
|
+
(...p) => t(g) && t(g)(...p))
|
|
1776
1776
|
}, [
|
|
1777
1777
|
Y(Il)
|
|
1778
1778
|
])
|
|
@@ -1783,32 +1783,32 @@ const El = /* @__PURE__ */ me(Ol, [["render", Hl]]), Nl = { class: "flex" }, Wl
|
|
|
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
1785
|
onClick: v[8] || (v[8] = //@ts-ignore
|
|
1786
|
-
(...p) =>
|
|
1786
|
+
(...p) => t(x) && t(x)(...p))
|
|
1787
1787
|
}, [
|
|
1788
|
-
Y(
|
|
1788
|
+
Y(Hl)
|
|
1789
1789
|
])
|
|
1790
1790
|
])
|
|
1791
1791
|
], 64)) : S("", !0),
|
|
1792
|
-
|
|
1793
|
-
|
|
1792
|
+
t(u) !== "" && t(u) === "range" ? (f(), w("div", Ql, [
|
|
1793
|
+
E(l("input", {
|
|
1794
1794
|
type: "date",
|
|
1795
|
-
max:
|
|
1795
|
+
max: t(h)[1],
|
|
1796
1796
|
locale: "uk-UA",
|
|
1797
|
-
"onUpdate:modelValue": v[9] || (v[9] = (p) =>
|
|
1797
|
+
"onUpdate:modelValue": v[9] || (v[9] = (p) => t(h)[0] = p),
|
|
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, Gl), [
|
|
1801
|
-
[
|
|
1801
|
+
[me, t(h)[0]]
|
|
1802
1802
|
]),
|
|
1803
|
-
|
|
1803
|
+
E(l("input", {
|
|
1804
1804
|
type: "date",
|
|
1805
|
-
min:
|
|
1805
|
+
min: t(h)[0],
|
|
1806
1806
|
locale: "uk-UA",
|
|
1807
|
-
"onUpdate:modelValue": v[10] || (v[10] = (p) =>
|
|
1807
|
+
"onUpdate:modelValue": v[10] || (v[10] = (p) => t(h)[1] = p),
|
|
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, Jl), [
|
|
1811
|
-
[
|
|
1811
|
+
[me, t(h)[1]]
|
|
1812
1812
|
])
|
|
1813
1813
|
])) : S("", !0)
|
|
1814
1814
|
]),
|
|
@@ -1816,31 +1816,31 @@ const El = /* @__PURE__ */ me(Ol, [["render", Hl]]), Nl = { class: "flex" }, Wl
|
|
|
1816
1816
|
], 64));
|
|
1817
1817
|
}
|
|
1818
1818
|
}), Ee = {
|
|
1819
|
-
radio:
|
|
1819
|
+
radio: Dt,
|
|
1820
1820
|
checkbox: He,
|
|
1821
1821
|
check: He,
|
|
1822
1822
|
text: Yt,
|
|
1823
1823
|
range: al,
|
|
1824
1824
|
date: xl,
|
|
1825
1825
|
select: $l,
|
|
1826
|
-
tag:
|
|
1826
|
+
tag: Ll,
|
|
1827
1827
|
"date:inline": Xl
|
|
1828
1828
|
};
|
|
1829
|
-
function Oe(i,
|
|
1830
|
-
let
|
|
1829
|
+
function Oe(i, n) {
|
|
1830
|
+
let o;
|
|
1831
1831
|
switch (i.toLowerCase()) {
|
|
1832
1832
|
case "autocomplete":
|
|
1833
|
-
|
|
1833
|
+
o = "select";
|
|
1834
1834
|
break;
|
|
1835
1835
|
case "check":
|
|
1836
|
-
|
|
1836
|
+
o = "checkbox";
|
|
1837
1837
|
break;
|
|
1838
1838
|
default:
|
|
1839
|
-
|
|
1839
|
+
o = i == null ? void 0 : i.toString().toLowerCase();
|
|
1840
1840
|
}
|
|
1841
|
-
return
|
|
1842
|
-
component: Ee[
|
|
1843
|
-
type:
|
|
1841
|
+
return o === "date" && n && n === "inline" && (o = "date:inline"), {
|
|
1842
|
+
component: Ee[o] || Ee.text,
|
|
1843
|
+
type: o
|
|
1844
1844
|
};
|
|
1845
1845
|
}
|
|
1846
1846
|
const ea = {}, ta = {
|
|
@@ -1855,8 +1855,8 @@ const ea = {}, ta = {
|
|
|
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 la(i,
|
|
1859
|
-
return f(), w("svg", ta,
|
|
1858
|
+
function la(i, n) {
|
|
1859
|
+
return f(), w("svg", ta, n[0] || (n[0] = [
|
|
1860
1860
|
l("path", {
|
|
1861
1861
|
stroke: "none",
|
|
1862
1862
|
d: "M0 0h24v24H0z",
|
|
@@ -1866,7 +1866,7 @@ function la(i, r) {
|
|
|
1866
1866
|
l("path", { d: "M20 4v5h-5" }, null, -1)
|
|
1867
1867
|
]));
|
|
1868
1868
|
}
|
|
1869
|
-
const aa = /* @__PURE__ */
|
|
1869
|
+
const aa = /* @__PURE__ */ he(ea, [["render", la]]), oa = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, ra = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, na = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, ia = { class: "flex items-center" }, sa = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, ua = { class: "filter-layout__body" }, ca = /* @__PURE__ */ G({
|
|
1870
1870
|
__name: "vertical-layout",
|
|
1871
1871
|
props: {
|
|
1872
1872
|
id: {},
|
|
@@ -1892,31 +1892,31 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { 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: (d) =>
|
|
1895
|
+
setup(i, { expose: n, emit: o }) {
|
|
1896
|
+
const r = i, e = o, c = V(), u = Oe(r.type, r.layout), h = N({
|
|
1897
|
+
get: () => r.modelValue,
|
|
1898
|
+
set: (d) => e("update:modelValue", d)
|
|
1899
1899
|
});
|
|
1900
1900
|
function m(d) {
|
|
1901
|
-
|
|
1901
|
+
e("clear", d);
|
|
1902
1902
|
}
|
|
1903
1903
|
function x(d, y) {
|
|
1904
|
-
|
|
1904
|
+
e("change", { name: d, value: y }), r.modelValue !== void 0 && e("update:modelValue", y);
|
|
1905
1905
|
}
|
|
1906
1906
|
function g() {
|
|
1907
|
-
c.value && c.value.clear(),
|
|
1907
|
+
c.value && c.value.clear(), e("clear", r.name);
|
|
1908
1908
|
}
|
|
1909
1909
|
return j(
|
|
1910
|
-
() =>
|
|
1910
|
+
() => r.default,
|
|
1911
1911
|
(d) => {
|
|
1912
1912
|
h.value = d;
|
|
1913
1913
|
}
|
|
1914
1914
|
), j(
|
|
1915
|
-
() =>
|
|
1915
|
+
() => r.modelValue,
|
|
1916
1916
|
(d) => {
|
|
1917
1917
|
h.value = d;
|
|
1918
1918
|
}
|
|
1919
|
-
),
|
|
1919
|
+
), n({
|
|
1920
1920
|
filterRef: c
|
|
1921
1921
|
}), (d, y) => {
|
|
1922
1922
|
var _, v, p;
|
|
@@ -1932,13 +1932,13 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
1932
1932
|
})) : S("", !0)
|
|
1933
1933
|
]),
|
|
1934
1934
|
l("div", ua, [
|
|
1935
|
-
((_ =
|
|
1936
|
-
type: (p =
|
|
1935
|
+
((_ = t(u)) == null ? void 0 : _.type) !== "select" ? (f(), P(be((v = t(u)) == null ? void 0 : v.component), ie({ key: 0 }, r, {
|
|
1936
|
+
type: (p = t(u)) == null ? void 0 : p.type,
|
|
1937
1937
|
onChange: y[0] || (y[0] = (a) => x(a.name, a.value)),
|
|
1938
1938
|
onClear: y[1] || (y[1] = (a) => m(a)),
|
|
1939
1939
|
ref_key: "filterRef",
|
|
1940
1940
|
ref: c
|
|
1941
|
-
}), null, 16, ["type"])) : (f(), P(
|
|
1941
|
+
}), null, 16, ["type"])) : (f(), P(Ze, {
|
|
1942
1942
|
key: 1,
|
|
1943
1943
|
"current-value": h.value,
|
|
1944
1944
|
label: d.label,
|
|
@@ -1949,14 +1949,14 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
1949
1949
|
disabled: d.disabled,
|
|
1950
1950
|
layout: "vertical"
|
|
1951
1951
|
}, {
|
|
1952
|
-
default:
|
|
1952
|
+
default: xe(() => {
|
|
1953
1953
|
var a, C;
|
|
1954
1954
|
return [
|
|
1955
|
-
(f(), P(
|
|
1955
|
+
(f(), P(be((a = t(u)) == null ? void 0 : a.component), ie({
|
|
1956
1956
|
ref_key: "filterRef",
|
|
1957
1957
|
ref: c
|
|
1958
|
-
},
|
|
1959
|
-
type: (C =
|
|
1958
|
+
}, r, {
|
|
1959
|
+
type: (C = t(u)) == null ? void 0 : C.type,
|
|
1960
1960
|
onChange: y[2] || (y[2] = (b) => x(b.name, b.value)),
|
|
1961
1961
|
onClear: y[3] || (y[3] = (b) => m(b))
|
|
1962
1962
|
}), null, 16, ["type"]))
|
|
@@ -1969,7 +1969,7 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
1969
1969
|
]);
|
|
1970
1970
|
};
|
|
1971
1971
|
}
|
|
1972
|
-
}), Ne = /* @__PURE__ */
|
|
1972
|
+
}), Ne = /* @__PURE__ */ G({
|
|
1973
1973
|
__name: "inline-layout",
|
|
1974
1974
|
props: {
|
|
1975
1975
|
id: {},
|
|
@@ -1995,59 +1995,59 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
1995
1995
|
sort: {}
|
|
1996
1996
|
},
|
|
1997
1997
|
emits: ["update:modelValue", "change", "clear"],
|
|
1998
|
-
setup(i, { expose:
|
|
1999
|
-
const
|
|
2000
|
-
get: () =>
|
|
2001
|
-
set: (g) =>
|
|
1998
|
+
setup(i, { expose: n, emit: o }) {
|
|
1999
|
+
const r = i, e = o, c = V(), u = Oe(r.type, r.layout), h = N({
|
|
2000
|
+
get: () => r.modelValue,
|
|
2001
|
+
set: (g) => e("update:modelValue", g)
|
|
2002
2002
|
});
|
|
2003
|
-
function m(g =
|
|
2004
|
-
|
|
2003
|
+
function m(g = r.name) {
|
|
2004
|
+
e("clear", g);
|
|
2005
2005
|
}
|
|
2006
2006
|
function x(g, d) {
|
|
2007
|
-
|
|
2007
|
+
e("change", { name: g, value: d }), r.modelValue !== void 0 && e("update:modelValue", d);
|
|
2008
2008
|
}
|
|
2009
2009
|
return j(
|
|
2010
|
-
() =>
|
|
2010
|
+
() => r.default,
|
|
2011
2011
|
(g) => {
|
|
2012
2012
|
h.value = g;
|
|
2013
2013
|
}
|
|
2014
2014
|
), j(
|
|
2015
|
-
() =>
|
|
2015
|
+
() => r.modelValue,
|
|
2016
2016
|
(g) => {
|
|
2017
2017
|
h.value = g;
|
|
2018
2018
|
}
|
|
2019
|
-
),
|
|
2019
|
+
), n({
|
|
2020
2020
|
filterRef: c
|
|
2021
2021
|
}), (g, d) => {
|
|
2022
2022
|
var y, _;
|
|
2023
|
-
return ["text", "date"].includes(g.type.toLocaleLowerCase()) ? (f(), P(
|
|
2024
|
-
type: (_ =
|
|
2023
|
+
return ["text", "date"].includes(g.type.toLocaleLowerCase()) ? (f(), P(be((y = t(u)) == null ? void 0 : y.component), ie({ key: 0 }, r, {
|
|
2024
|
+
type: (_ = t(u)) == null ? void 0 : _.type,
|
|
2025
2025
|
onChange: d[0] || (d[0] = (v) => x(v.name, v.value)),
|
|
2026
2026
|
onClear: d[1] || (d[1] = (v) => m(v)),
|
|
2027
2027
|
disabled: g.disabled,
|
|
2028
2028
|
modelValue: h.value,
|
|
2029
2029
|
"onUpdate:modelValue": d[2] || (d[2] = (v) => h.value = v)
|
|
2030
|
-
}), null, 16, ["type", "disabled", "modelValue"])) : (f(), P(
|
|
2030
|
+
}), null, 16, ["type", "disabled", "modelValue"])) : (f(), P(Ze, {
|
|
2031
2031
|
key: 1,
|
|
2032
2032
|
"current-value": h.value,
|
|
2033
2033
|
label: g.label,
|
|
2034
2034
|
mode: g.mode,
|
|
2035
2035
|
onClear: m,
|
|
2036
2036
|
fieldRef: c.value,
|
|
2037
|
-
width:
|
|
2037
|
+
width: r.width,
|
|
2038
2038
|
disabled: g.disabled,
|
|
2039
2039
|
layout: "inline"
|
|
2040
2040
|
}, {
|
|
2041
|
-
default:
|
|
2041
|
+
default: xe(() => {
|
|
2042
2042
|
var v, p;
|
|
2043
2043
|
return [
|
|
2044
|
-
(f(), P(
|
|
2044
|
+
(f(), P(be((v = t(u)) == null ? void 0 : v.component), ie({
|
|
2045
2045
|
ref_key: "filterRef",
|
|
2046
2046
|
ref: c
|
|
2047
|
-
},
|
|
2047
|
+
}, r, {
|
|
2048
2048
|
modelValue: h.value,
|
|
2049
2049
|
"onUpdate:modelValue": d[3] || (d[3] = (a) => h.value = a),
|
|
2050
|
-
type: (p =
|
|
2050
|
+
type: (p = t(u)) == null ? void 0 : p.type,
|
|
2051
2051
|
onChange: d[4] || (d[4] = (a) => x(a.name, a.value)),
|
|
2052
2052
|
onClear: d[5] || (d[5] = (a) => m(a))
|
|
2053
2053
|
}), null, 16, ["modelValue", "type"]))
|
|
@@ -2057,7 +2057,7 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
2057
2057
|
}, 8, ["current-value", "label", "mode", "fieldRef", "width", "disabled"]));
|
|
2058
2058
|
};
|
|
2059
2059
|
}
|
|
2060
|
-
}), da = /* @__PURE__ */
|
|
2060
|
+
}), da = /* @__PURE__ */ G({
|
|
2061
2061
|
__name: "popover-layout",
|
|
2062
2062
|
props: {
|
|
2063
2063
|
id: {},
|
|
@@ -2083,37 +2083,37 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
2083
2083
|
sort: {}
|
|
2084
2084
|
},
|
|
2085
2085
|
emits: ["update:modelValue", "change", "clear"],
|
|
2086
|
-
setup(i, { expose:
|
|
2087
|
-
const
|
|
2088
|
-
get: () =>
|
|
2089
|
-
set: (g) =>
|
|
2086
|
+
setup(i, { expose: n, emit: o }) {
|
|
2087
|
+
const r = i, e = o, c = V(), u = V(Oe(r.type, r.layout)), h = N({
|
|
2088
|
+
get: () => r.modelValue,
|
|
2089
|
+
set: (g) => e("update:modelValue", g)
|
|
2090
2090
|
});
|
|
2091
2091
|
function m(g) {
|
|
2092
|
-
|
|
2092
|
+
e("clear", g);
|
|
2093
2093
|
}
|
|
2094
2094
|
function x(g, d) {
|
|
2095
|
-
|
|
2095
|
+
e("change", { name: g, value: d }), r.modelValue !== void 0 && e("update:modelValue", d);
|
|
2096
2096
|
}
|
|
2097
2097
|
return j(
|
|
2098
|
-
() =>
|
|
2098
|
+
() => r.default,
|
|
2099
2099
|
(g) => {
|
|
2100
2100
|
h.value = g;
|
|
2101
2101
|
}
|
|
2102
2102
|
), j(
|
|
2103
|
-
() =>
|
|
2103
|
+
() => r.modelValue,
|
|
2104
2104
|
(g) => {
|
|
2105
2105
|
h.value = g;
|
|
2106
2106
|
}
|
|
2107
2107
|
), j(
|
|
2108
|
-
() =>
|
|
2108
|
+
() => r,
|
|
2109
2109
|
(g) => {
|
|
2110
2110
|
h.value = g;
|
|
2111
2111
|
}
|
|
2112
|
-
),
|
|
2112
|
+
), n({
|
|
2113
2113
|
filterRef: c
|
|
2114
2114
|
}), (g, d) => {
|
|
2115
2115
|
var y, _;
|
|
2116
|
-
return f(), P(
|
|
2116
|
+
return f(), P(be((y = u.value) == null ? void 0 : y.component), ie(r, {
|
|
2117
2117
|
type: (_ = u.value) == null ? void 0 : _.type,
|
|
2118
2118
|
modelValue: h.value,
|
|
2119
2119
|
"onUpdate:modelValue": d[0] || (d[0] = (v) => h.value = v),
|
|
@@ -2124,7 +2124,7 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
2124
2124
|
}), null, 16, ["type", "modelValue"]);
|
|
2125
2125
|
};
|
|
2126
2126
|
}
|
|
2127
|
-
}),
|
|
2127
|
+
}), we = /* @__PURE__ */ G({
|
|
2128
2128
|
__name: "filter-field",
|
|
2129
2129
|
props: {
|
|
2130
2130
|
id: {},
|
|
@@ -2150,32 +2150,32 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { 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: () =>
|
|
2156
|
-
set: (g) =>
|
|
2153
|
+
setup(i, { expose: n, emit: o }) {
|
|
2154
|
+
const r = i, e = o, c = V(), u = N({
|
|
2155
|
+
get: () => r.modelValue,
|
|
2156
|
+
set: (g) => e("update:modelValue", g)
|
|
2157
2157
|
});
|
|
2158
2158
|
function h(g) {
|
|
2159
|
-
|
|
2159
|
+
e("clear", g);
|
|
2160
2160
|
}
|
|
2161
2161
|
function m(g, d) {
|
|
2162
|
-
|
|
2162
|
+
e("change", { name: g, value: d }), r.modelValue !== void 0 && e("update:modelValue", d);
|
|
2163
2163
|
}
|
|
2164
2164
|
j(
|
|
2165
|
-
() =>
|
|
2165
|
+
() => r.default,
|
|
2166
2166
|
(g) => {
|
|
2167
2167
|
u.value = g;
|
|
2168
2168
|
}
|
|
2169
2169
|
), j(
|
|
2170
|
-
() =>
|
|
2170
|
+
() => r.modelValue,
|
|
2171
2171
|
(g) => {
|
|
2172
2172
|
u.value = g;
|
|
2173
2173
|
}
|
|
2174
|
-
),
|
|
2174
|
+
), n({
|
|
2175
2175
|
filterRef: c
|
|
2176
2176
|
});
|
|
2177
2177
|
function x() {
|
|
2178
|
-
switch (
|
|
2178
|
+
switch (r.layout) {
|
|
2179
2179
|
case "inline":
|
|
2180
2180
|
return Ne;
|
|
2181
2181
|
case "vertical":
|
|
@@ -2186,7 +2186,7 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
2186
2186
|
return Ne;
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
|
-
return (g, d) => (f(), P(
|
|
2189
|
+
return (g, d) => (f(), P(be(x()), ie(r, {
|
|
2190
2190
|
onChange: d[0] || (d[0] = (y) => m(y.name, y.value)),
|
|
2191
2191
|
onClear: d[1] || (d[1] = (y) => h(y)),
|
|
2192
2192
|
modelValue: u.value,
|
|
@@ -2194,43 +2194,43 @@ const aa = /* @__PURE__ */ me(ea, [["render", la]]), oa = { style: { display: "i
|
|
|
2194
2194
|
}), null, 16, ["modelValue"]));
|
|
2195
2195
|
}
|
|
2196
2196
|
});
|
|
2197
|
-
function Te(i,
|
|
2197
|
+
function Te(i, n) {
|
|
2198
2198
|
const {
|
|
2199
|
-
slots:
|
|
2200
|
-
} = i,
|
|
2199
|
+
slots: o
|
|
2200
|
+
} = i, r = V(i.value ?? {}), e = N(() => {
|
|
2201
2201
|
var b;
|
|
2202
|
-
return ($e((b =
|
|
2202
|
+
return ($e((b = o == null ? void 0 : o.default) == null ? void 0 : b.call(o)) ?? []).flatMap((s) => Array.isArray(s.children) ? s.children : [s]);
|
|
2203
2203
|
});
|
|
2204
2204
|
function c(b) {
|
|
2205
|
-
delete
|
|
2206
|
-
data: $e(
|
|
2205
|
+
delete r.value[b], n("clear", {
|
|
2206
|
+
data: $e(r.value),
|
|
2207
2207
|
name: b
|
|
2208
2208
|
});
|
|
2209
2209
|
}
|
|
2210
2210
|
function u(b, s) {
|
|
2211
|
-
s === void 0 ? c(b) :
|
|
2212
|
-
...
|
|
2211
|
+
s === void 0 ? c(b) : r.value = {
|
|
2212
|
+
...r.value,
|
|
2213
2213
|
[b]: s
|
|
2214
|
-
},
|
|
2215
|
-
data: $e(
|
|
2214
|
+
}, n("change", {
|
|
2215
|
+
data: $e(r.value),
|
|
2216
2216
|
name: b,
|
|
2217
2217
|
value: s
|
|
2218
2218
|
});
|
|
2219
2219
|
}
|
|
2220
|
-
const h =
|
|
2220
|
+
const h = N(() => e.value.map((b) => {
|
|
2221
2221
|
var k;
|
|
2222
2222
|
const s = (k = b.props) == null ? void 0 : k.name;
|
|
2223
2223
|
return dt(b, {
|
|
2224
2224
|
...b.props,
|
|
2225
2225
|
layout: i.view,
|
|
2226
2226
|
showClean: !0,
|
|
2227
|
-
modelValue:
|
|
2227
|
+
modelValue: r[s],
|
|
2228
2228
|
"onUpdate:modelValue": (B) => {
|
|
2229
2229
|
u(s, B);
|
|
2230
2230
|
},
|
|
2231
2231
|
onClear: () => c(s)
|
|
2232
2232
|
});
|
|
2233
|
-
})), m =
|
|
2233
|
+
})), m = N(
|
|
2234
2234
|
() => new Map(
|
|
2235
2235
|
h.value.map((b) => {
|
|
2236
2236
|
var k;
|
|
@@ -2240,26 +2240,26 @@ function Te(i, r) {
|
|
|
2240
2240
|
)
|
|
2241
2241
|
);
|
|
2242
2242
|
function x(b = !1) {
|
|
2243
|
-
|
|
2244
|
-
data: $e(
|
|
2243
|
+
r.value = {}, b || n("clearAll", {
|
|
2244
|
+
data: $e(r.value),
|
|
2245
2245
|
name: "ALL"
|
|
2246
2246
|
});
|
|
2247
2247
|
}
|
|
2248
|
-
const g = V(""), d =
|
|
2248
|
+
const g = V(""), d = N(() => {
|
|
2249
2249
|
var b;
|
|
2250
|
-
return (b = i.schema) != null && b.value ? Object.entries(
|
|
2250
|
+
return (b = i.schema) != null && b.value ? Object.entries(r.value).filter(([s, k]) => i.schema && !(s in i.schema.value) ? !1 : Array.isArray(k) ? k.some((B) => B !== "" && B !== void 0) : k !== "" && k !== void 0).length : 0;
|
|
2251
2251
|
}), y = V();
|
|
2252
2252
|
j(g, async () => {
|
|
2253
2253
|
var b, s;
|
|
2254
|
-
await
|
|
2254
|
+
await Re(), (s = (b = y == null ? void 0 : y.value) == null ? void 0 : b.filterRef) != null && s.inputTextRef && y.value.filterRef.inputTextRef.focus();
|
|
2255
2255
|
});
|
|
2256
|
-
const _ =
|
|
2256
|
+
const _ = N(() => {
|
|
2257
2257
|
var b, s;
|
|
2258
2258
|
return (b = i.schema) != null && b.value ? Object.fromEntries(Object.entries((s = i.schema) == null ? void 0 : s.value).slice(0, i.limit)) : {};
|
|
2259
|
-
}), v =
|
|
2259
|
+
}), v = N(() => {
|
|
2260
2260
|
var b, s, k;
|
|
2261
2261
|
return (b = i.schema) != null && b.value ? i.view !== "inline" ? (s = i.schema) == null ? void 0 : s.value : Object.fromEntries(Object.entries((k = i.schema) == null ? void 0 : k.value).slice(i.limit)) : {};
|
|
2262
|
-
}), p =
|
|
2262
|
+
}), p = N(() => {
|
|
2263
2263
|
var s;
|
|
2264
2264
|
if (h.value.length === 0) return [];
|
|
2265
2265
|
let b = 0;
|
|
@@ -2268,7 +2268,7 @@ function Te(i, r) {
|
|
|
2268
2268
|
k < i.limit ? b = i.limit - k : b = 0;
|
|
2269
2269
|
}
|
|
2270
2270
|
return h.value.slice(0, b);
|
|
2271
|
-
}), a =
|
|
2271
|
+
}), a = N(() => h.value.length === 0 ? [] : i.view !== "inline" ? h.value : h.value.slice(p.value.length));
|
|
2272
2272
|
function C() {
|
|
2273
2273
|
if (v.value) {
|
|
2274
2274
|
const [b] = Object.keys(v.value);
|
|
@@ -2276,7 +2276,7 @@ function Te(i, r) {
|
|
|
2276
2276
|
} else a.value.length > 0 ? g.value = a.value[0].props.name : g.value = "";
|
|
2277
2277
|
}
|
|
2278
2278
|
return {
|
|
2279
|
-
activeFilter:
|
|
2279
|
+
activeFilter: r,
|
|
2280
2280
|
activeFilterCount: d,
|
|
2281
2281
|
onFilterChange: u,
|
|
2282
2282
|
clearFilter: c,
|
|
@@ -2292,16 +2292,16 @@ function Te(i, r) {
|
|
|
2292
2292
|
filterRef: y
|
|
2293
2293
|
};
|
|
2294
2294
|
}
|
|
2295
|
-
const pa = /* @__PURE__ */
|
|
2295
|
+
const pa = /* @__PURE__ */ G({
|
|
2296
2296
|
__name: "popover",
|
|
2297
2297
|
emits: ["open", "close"],
|
|
2298
|
-
setup(i, { emit:
|
|
2299
|
-
const
|
|
2298
|
+
setup(i, { emit: n }) {
|
|
2299
|
+
const o = V(!1), r = V(null), e = V(null), c = V(null), u = V({ top: "0px", left: "0px", position: "absolute" });
|
|
2300
2300
|
function h() {
|
|
2301
|
-
|
|
2301
|
+
o.value = !o.value;
|
|
2302
2302
|
}
|
|
2303
2303
|
function m() {
|
|
2304
|
-
const y = c.value, _ =
|
|
2304
|
+
const y = c.value, _ = r.value;
|
|
2305
2305
|
if (!y || !_) return;
|
|
2306
2306
|
const v = y.getBoundingClientRect(), p = _.offsetWidth, a = window.innerWidth - v.left;
|
|
2307
2307
|
let C = v.left + window.scrollX;
|
|
@@ -2314,39 +2314,39 @@ const pa = /* @__PURE__ */ Q({
|
|
|
2314
2314
|
function x(y) {
|
|
2315
2315
|
var v, p;
|
|
2316
2316
|
const _ = y.target;
|
|
2317
|
-
!((v = c.value) != null && v.contains(y.target)) && !((p =
|
|
2317
|
+
!((v = c.value) != null && v.contains(y.target)) && !((p = r.value) != null && p.contains(y.target)) && !_.closest("[data-inside-popover]") && (o.value = !1);
|
|
2318
2318
|
}
|
|
2319
2319
|
const g = V(!1);
|
|
2320
|
-
|
|
2320
|
+
_e(() => {
|
|
2321
2321
|
g.value = !0;
|
|
2322
|
-
}),
|
|
2322
|
+
}), _e(() => {
|
|
2323
2323
|
var y, _;
|
|
2324
|
-
c.value = ((y =
|
|
2324
|
+
c.value = ((y = e.value) == null ? void 0 : y.querySelector("[data-popover-trigger]")) || null, (_ = c.value) == null || _.addEventListener("click", h), document.addEventListener("click", x), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0);
|
|
2325
2325
|
}), Me(() => {
|
|
2326
2326
|
var y;
|
|
2327
2327
|
(y = c.value) == null || y.removeEventListener("click", h), document.removeEventListener("click", x), window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
2328
2328
|
});
|
|
2329
|
-
const d =
|
|
2330
|
-
return j(
|
|
2331
|
-
y ? (d("open"), await
|
|
2329
|
+
const d = n;
|
|
2330
|
+
return j(o, async (y) => {
|
|
2331
|
+
y ? (d("open"), await Re(), m()) : d("close");
|
|
2332
2332
|
}), (y, _) => (f(), w("div", {
|
|
2333
2333
|
ref_key: "wrapperRef",
|
|
2334
|
-
ref:
|
|
2334
|
+
ref: e
|
|
2335
2335
|
}, [
|
|
2336
|
-
|
|
2336
|
+
ve(y.$slots, "trigger"),
|
|
2337
2337
|
g.value ? (f(), P(Qe, {
|
|
2338
2338
|
key: 0,
|
|
2339
2339
|
to: "body"
|
|
2340
2340
|
}, [
|
|
2341
|
-
|
|
2341
|
+
E(l("div", {
|
|
2342
2342
|
ref_key: "popoverRef",
|
|
2343
|
-
ref:
|
|
2343
|
+
ref: r,
|
|
2344
2344
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
|
2345
|
-
style:
|
|
2345
|
+
style: Pe(u.value)
|
|
2346
2346
|
}, [
|
|
2347
|
-
|
|
2347
|
+
ve(y.$slots, "default")
|
|
2348
2348
|
], 4), [
|
|
2349
|
-
[
|
|
2349
|
+
[de, o.value]
|
|
2350
2350
|
])
|
|
2351
2351
|
])) : S("", !0)
|
|
2352
2352
|
], 512));
|
|
@@ -2363,12 +2363,12 @@ const pa = /* @__PURE__ */ Q({
|
|
|
2363
2363
|
"stroke-linejoin": "round",
|
|
2364
2364
|
class: "lucide lucide-filter h-4 w-4"
|
|
2365
2365
|
};
|
|
2366
|
-
function ma(i,
|
|
2367
|
-
return f(), w("svg", va,
|
|
2366
|
+
function ma(i, n) {
|
|
2367
|
+
return f(), w("svg", va, n[0] || (n[0] = [
|
|
2368
2368
|
l("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 ha = /* @__PURE__ */
|
|
2371
|
+
const ha = /* @__PURE__ */ he(fa, [["render", ma]]), ga = {
|
|
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
|
}, ya = { class: "flex" }, ba = { class: "w-64 border-r border-gray-200" }, xa = { class: "p-2" }, wa = ["onClick"], ka = { class: "flex items-center gap-2" }, _a = { class: "text-sm font-medium" }, Ca = {
|
|
@@ -2383,7 +2383,7 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2383
2383
|
}, za = { class: "flex-1 min-h-[300px] overflow-y-auto" }, Aa = {
|
|
2384
2384
|
key: 0,
|
|
2385
2385
|
class: "flex items-center justify-center h-full text-gray-500"
|
|
2386
|
-
}, it = /* @__PURE__ */
|
|
2386
|
+
}, it = /* @__PURE__ */ G({
|
|
2387
2387
|
__name: "popover-filter-layout",
|
|
2388
2388
|
props: {
|
|
2389
2389
|
schema: {},
|
|
@@ -2394,8 +2394,8 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
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: o }) {
|
|
2398
|
+
const r = i, e = rt(r.mode), c = Fe(), u = o, h = V({}), {
|
|
2399
2399
|
activeFilter: m,
|
|
2400
2400
|
activeFilterCount: x,
|
|
2401
2401
|
onFilterChange: g,
|
|
@@ -2407,95 +2407,95 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2407
2407
|
selectedFilter: a,
|
|
2408
2408
|
filterRef: C
|
|
2409
2409
|
} = Te({
|
|
2410
|
-
...
|
|
2410
|
+
...r,
|
|
2411
2411
|
schema: h,
|
|
2412
2412
|
slots: c
|
|
2413
2413
|
}, u);
|
|
2414
2414
|
return j(
|
|
2415
|
-
() =>
|
|
2415
|
+
() => r.schema,
|
|
2416
2416
|
(b) => {
|
|
2417
2417
|
h.value = b;
|
|
2418
2418
|
},
|
|
2419
2419
|
{ deep: !0, immediate: !0 }
|
|
2420
|
-
),
|
|
2420
|
+
), n({
|
|
2421
2421
|
clearFilter: d,
|
|
2422
2422
|
clearAllFilters: y
|
|
2423
2423
|
}), (b, s) => (f(), P(pa, {
|
|
2424
|
-
onOpen:
|
|
2424
|
+
onOpen: t(p),
|
|
2425
2425
|
onClose: s[5] || (s[5] = (k) => a.value = "")
|
|
2426
2426
|
}, {
|
|
2427
|
-
trigger:
|
|
2427
|
+
trigger: xe(() => [
|
|
2428
2428
|
l("button", {
|
|
2429
2429
|
"data-popover-trigger": "",
|
|
2430
2430
|
"aria-haspopup": "dialog",
|
|
2431
2431
|
"aria-expanded": "false",
|
|
2432
|
-
class:
|
|
2433
|
-
e
|
|
2432
|
+
class: I(
|
|
2433
|
+
t(e) + (t(x) > 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
|
Y(ha),
|
|
2438
|
-
s[6] || (s[6] =
|
|
2439
|
-
|
|
2438
|
+
s[6] || (s[6] = te(" Фільтр ", -1)),
|
|
2439
|
+
t(x) > 0 ? (f(), w("div", ga, O(t(x)), 1)) : S("", !0)
|
|
2440
2440
|
], 2)
|
|
2441
2441
|
]),
|
|
2442
|
-
default:
|
|
2442
|
+
default: xe(() => [
|
|
2443
2443
|
l("div", ya, [
|
|
2444
2444
|
l("div", ba, [
|
|
2445
2445
|
s[7] || (s[7] = l("div", { class: "p-4 border-b" }, [
|
|
2446
2446
|
l("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
|
|
2447
2447
|
], -1)),
|
|
2448
2448
|
l("div", xa, [
|
|
2449
|
-
b.schema ? (f(!0), w(
|
|
2449
|
+
b.schema ? (f(!0), w(Z, { key: 0 }, ae(Object.entries(t(_)), ([k, B]) => {
|
|
2450
2450
|
var A;
|
|
2451
2451
|
return f(), w("button", {
|
|
2452
2452
|
key: k,
|
|
2453
2453
|
onClick: () => {
|
|
2454
2454
|
a.value = k;
|
|
2455
2455
|
},
|
|
2456
|
-
class:
|
|
2456
|
+
class: I([
|
|
2457
2457
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
|
2458
|
-
|
|
2458
|
+
t(a) === k ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
|
2459
2459
|
])
|
|
2460
2460
|
}, [
|
|
2461
2461
|
l("div", ka, [
|
|
2462
2462
|
l("span", _a, O(B.label), 1)
|
|
2463
2463
|
]),
|
|
2464
|
-
(Array.isArray(
|
|
2464
|
+
(Array.isArray(t(m)[k]) ? ((A = t(m)[k]) == null ? void 0 : A.length) > 0 : t(m)[k] || t(m)[k] === null) ? (f(), w("div", Ca)) : S("", !0)
|
|
2465
2465
|
], 10, wa);
|
|
2466
2466
|
}), 128)) : S("", !0),
|
|
2467
|
-
(f(!0), w(
|
|
2467
|
+
(f(!0), w(Z, null, ae(t(v), (k, B) => {
|
|
2468
2468
|
var A;
|
|
2469
2469
|
return f(), w("button", {
|
|
2470
2470
|
key: "slot-" + B,
|
|
2471
|
-
onClick: (
|
|
2472
|
-
class:
|
|
2471
|
+
onClick: (L) => a.value = k.props.name,
|
|
2472
|
+
class: I([
|
|
2473
2473
|
"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
|
|
2474
|
-
|
|
2474
|
+
t(a) === k.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
|
|
2475
2475
|
])
|
|
2476
2476
|
}, [
|
|
2477
2477
|
l("div", Sa, [
|
|
2478
2478
|
l("span", $a, O(k.props.label), 1)
|
|
2479
2479
|
]),
|
|
2480
|
-
((A =
|
|
2480
|
+
((A = t(m)[k.props.name]) == null ? void 0 : A.length) > 0 ? (f(), w("div", Ma)) : S("", !0)
|
|
2481
2481
|
], 10, Va);
|
|
2482
2482
|
}), 128))
|
|
2483
2483
|
]),
|
|
2484
|
-
|
|
2484
|
+
t(x) > 0 ? (f(), w("div", Ba, [
|
|
2485
2485
|
l("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: s[0] || (s[0] = (k) =>
|
|
2487
|
+
onClick: s[0] || (s[0] = (k) => t(y)()),
|
|
2488
2488
|
"data-inside-popover": ""
|
|
2489
2489
|
}, " Очистити всі ")
|
|
2490
2490
|
])) : S("", !0)
|
|
2491
2491
|
]),
|
|
2492
2492
|
l("div", za, [
|
|
2493
|
-
|
|
2493
|
+
t(a) === "" ? (f(), w("div", Aa, s[8] || (s[8] = [
|
|
2494
2494
|
l("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
|
|
2495
2495
|
]))) : S("", !0),
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2496
|
+
t(a) ? (f(), w(Z, { key: 1 }, [
|
|
2497
|
+
t(_) ? (f(!0), w(Z, { key: 0 }, ae(Object.entries(t(_)), ([k, B]) => (f(), w(Z, null, [
|
|
2498
|
+
t(a) === k ? (f(), P(we, ie({
|
|
2499
2499
|
name: k,
|
|
2500
2500
|
key: k,
|
|
2501
2501
|
layout: "popover",
|
|
@@ -2503,31 +2503,31 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2503
2503
|
ref_key: "filterRef",
|
|
2504
2504
|
ref: C
|
|
2505
2505
|
}, { ref_for: !0 }, B, {
|
|
2506
|
-
onChange: s[1] || (s[1] = (A) =>
|
|
2506
|
+
onChange: s[1] || (s[1] = (A) => t(g)(A.name, A.value)),
|
|
2507
2507
|
onClear: s[2] || (s[2] = (A) => {
|
|
2508
|
-
|
|
2508
|
+
t(d)(A), t(g)(A, void 0);
|
|
2509
2509
|
}),
|
|
2510
|
-
modelValue:
|
|
2511
|
-
"onUpdate:modelValue": (A) =>
|
|
2510
|
+
modelValue: t(m)[k],
|
|
2511
|
+
"onUpdate:modelValue": (A) => t(m)[k] = A,
|
|
2512
2512
|
cleanable: !0
|
|
2513
2513
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : S("", !0)
|
|
2514
2514
|
], 64))), 256)) : S("", !0),
|
|
2515
|
-
(f(!0), w(
|
|
2515
|
+
(f(!0), w(Z, null, ae(t(v), (k, B) => (f(), w(Z, {
|
|
2516
2516
|
key: "slot-" + B
|
|
2517
2517
|
}, [
|
|
2518
|
-
|
|
2518
|
+
t(a) === k.props.name ? (f(), P(we, ie({
|
|
2519
2519
|
key: 0,
|
|
2520
2520
|
layout: "popover"
|
|
2521
2521
|
}, { ref_for: !0 }, k.props, {
|
|
2522
2522
|
ref_for: !0,
|
|
2523
2523
|
ref_key: "filterRef",
|
|
2524
2524
|
ref: C,
|
|
2525
|
-
onChange: s[3] || (s[3] = (A) =>
|
|
2525
|
+
onChange: s[3] || (s[3] = (A) => t(g)(A.name, A.value)),
|
|
2526
2526
|
onClear: s[4] || (s[4] = (A) => {
|
|
2527
|
-
|
|
2527
|
+
t(d)(A), t(g)(A, void 0);
|
|
2528
2528
|
}),
|
|
2529
|
-
modelValue:
|
|
2530
|
-
"onUpdate:modelValue": (A) =>
|
|
2529
|
+
modelValue: t(m)[k.props.name],
|
|
2530
|
+
"onUpdate:modelValue": (A) => t(m)[k.props.name] = A,
|
|
2531
2531
|
cleanable: !0
|
|
2532
2532
|
}), null, 16, ["modelValue", "onUpdate:modelValue"])) : S("", !0)
|
|
2533
2533
|
], 64))), 128))
|
|
@@ -2538,7 +2538,7 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2538
2538
|
_: 1
|
|
2539
2539
|
}, 8, ["onOpen"]));
|
|
2540
2540
|
}
|
|
2541
|
-
}), Ra = { class: "flex gap-1 items-center flex-wrap" }, We = /* @__PURE__ */
|
|
2541
|
+
}), Ra = { class: "flex gap-1 items-center flex-wrap" }, We = /* @__PURE__ */ G({
|
|
2542
2542
|
__name: "inline-filter-layout",
|
|
2543
2543
|
props: {
|
|
2544
2544
|
schema: {},
|
|
@@ -2549,8 +2549,8 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2549
2549
|
limit: { default: 3 }
|
|
2550
2550
|
},
|
|
2551
2551
|
emits: ["change", "clear", "clearAll"],
|
|
2552
|
-
setup(i, { expose:
|
|
2553
|
-
const
|
|
2552
|
+
setup(i, { expose: n, emit: o }) {
|
|
2553
|
+
const r = i, e = o, c = Fe(), u = V({}), {
|
|
2554
2554
|
activeFilter: h,
|
|
2555
2555
|
activeFilterCount: m,
|
|
2556
2556
|
onFilterChange: x,
|
|
@@ -2563,79 +2563,79 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2563
2563
|
popoverFiltersSlot: a
|
|
2564
2564
|
} = Te(
|
|
2565
2565
|
{
|
|
2566
|
-
...
|
|
2566
|
+
...r,
|
|
2567
2567
|
schema: u,
|
|
2568
2568
|
slots: c
|
|
2569
2569
|
},
|
|
2570
|
-
|
|
2570
|
+
e
|
|
2571
2571
|
), C = V();
|
|
2572
2572
|
function b() {
|
|
2573
2573
|
C.value && C.value.clearAllFilters(!0), d();
|
|
2574
2574
|
}
|
|
2575
2575
|
return j(
|
|
2576
|
-
() =>
|
|
2576
|
+
() => r.schema,
|
|
2577
2577
|
(s) => {
|
|
2578
2578
|
u.value = s;
|
|
2579
2579
|
},
|
|
2580
2580
|
{ deep: !0, immediate: !0 }
|
|
2581
|
-
),
|
|
2581
|
+
), n({
|
|
2582
2582
|
clearFilter: g,
|
|
2583
2583
|
clearAllFilters: d
|
|
2584
2584
|
}), (s, k) => (f(), w("div", Ra, [
|
|
2585
|
-
s.schema ? (f(!0), w(
|
|
2585
|
+
s.schema ? (f(!0), w(Z, { key: 0 }, ae(Object.entries(t(y)), ([B, A]) => (f(), P(we, ie({
|
|
2586
2586
|
key: B,
|
|
2587
2587
|
name: B,
|
|
2588
2588
|
mode: s.mode
|
|
2589
2589
|
}, { ref_for: !0 }, A, {
|
|
2590
|
-
onChange: k[0] || (k[0] = (
|
|
2591
|
-
onClear:
|
|
2590
|
+
onChange: k[0] || (k[0] = (L) => t(x)(L.name, L.value)),
|
|
2591
|
+
onClear: t(g),
|
|
2592
2592
|
layout: "inline",
|
|
2593
2593
|
cleanable: !0,
|
|
2594
|
-
modelValue:
|
|
2595
|
-
"onUpdate:modelValue": (
|
|
2594
|
+
modelValue: t(h)[B],
|
|
2595
|
+
"onUpdate:modelValue": (L) => t(h)[B] = L
|
|
2596
2596
|
}), null, 16, ["name", "mode", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : S("", !0),
|
|
2597
|
-
(f(!0), w(
|
|
2597
|
+
(f(!0), w(Z, null, ae(t(p), (B, A) => (f(), P(we, ie({
|
|
2598
2598
|
key: "slot-" + A,
|
|
2599
2599
|
layout: "inline"
|
|
2600
2600
|
}, { ref_for: !0 }, B.props, {
|
|
2601
|
-
onChange: k[1] || (k[1] = (
|
|
2602
|
-
onClear: k[2] || (k[2] = (
|
|
2603
|
-
|
|
2601
|
+
onChange: k[1] || (k[1] = (L) => t(x)(L.name, L.value)),
|
|
2602
|
+
onClear: k[2] || (k[2] = (L) => {
|
|
2603
|
+
t(g)(L), t(x)(L, void 0);
|
|
2604
2604
|
}),
|
|
2605
2605
|
cleanable: !0,
|
|
2606
|
-
modelValue:
|
|
2607
|
-
"onUpdate:modelValue": (
|
|
2606
|
+
modelValue: t(h)[B.props.name],
|
|
2607
|
+
"onUpdate:modelValue": (L) => t(h)[B.props.name] = L
|
|
2608
2608
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
|
|
2609
|
-
Object.entries(
|
|
2610
|
-
schema:
|
|
2609
|
+
Object.entries(t(_)).length > 0 || t(a).length > 0 ? (f(), P(it, ie({ key: 1 }, r, {
|
|
2610
|
+
schema: t(_),
|
|
2611
2611
|
limit: 0,
|
|
2612
|
-
onChange: k[3] || (k[3] = (B) =>
|
|
2613
|
-
onClearAll: k[4] || (k[4] = (B) =>
|
|
2614
|
-
onClear: k[5] || (k[5] = (B) =>
|
|
2612
|
+
onChange: k[3] || (k[3] = (B) => t(x)(B.name, B.value)),
|
|
2613
|
+
onClearAll: k[4] || (k[4] = (B) => t(d)()),
|
|
2614
|
+
onClear: k[5] || (k[5] = (B) => t(g)(B.name)),
|
|
2615
2615
|
mode: s.mode,
|
|
2616
2616
|
ref_key: "popoverRef",
|
|
2617
2617
|
ref: C,
|
|
2618
2618
|
cleanable: !0
|
|
2619
2619
|
}), {
|
|
2620
|
-
default:
|
|
2621
|
-
(f(!0), w(
|
|
2620
|
+
default: xe(() => [
|
|
2621
|
+
(f(!0), w(Z, null, ae(t(v), (B, A) => (f(), P(be(B), ie({
|
|
2622
2622
|
key: "slot-" + A,
|
|
2623
2623
|
layout: "popover"
|
|
2624
2624
|
}, { ref_for: !0 }, B.props, { cleanable: !0 }), null, 16))), 128))
|
|
2625
2625
|
]),
|
|
2626
2626
|
_: 1
|
|
2627
2627
|
}, 16, ["schema", "mode"])) : S("", !0),
|
|
2628
|
-
|
|
2628
|
+
t(m) > 0 ? (f(), w("button", {
|
|
2629
2629
|
key: 2,
|
|
2630
2630
|
onClick: b,
|
|
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
|
]));
|
|
2634
2634
|
}
|
|
2635
|
-
}),
|
|
2635
|
+
}), La = {
|
|
2636
2636
|
key: 0,
|
|
2637
2637
|
class: "p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
|
|
2638
|
-
},
|
|
2638
|
+
}, ja = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, Da = /* @__PURE__ */ G({
|
|
2639
2639
|
__name: "vertical-filter-layout",
|
|
2640
2640
|
props: {
|
|
2641
2641
|
schema: {},
|
|
@@ -2646,8 +2646,8 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
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: o }) {
|
|
2650
|
+
const r = i, e = o, c = Fe(), {
|
|
2651
2651
|
activeFilter: u,
|
|
2652
2652
|
activeFilterCount: h,
|
|
2653
2653
|
onFilterChange: m,
|
|
@@ -2655,51 +2655,51 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2655
2655
|
clearAllFilters: g,
|
|
2656
2656
|
filtersSlot: d
|
|
2657
2657
|
} = Te({
|
|
2658
|
-
...
|
|
2658
|
+
...r,
|
|
2659
2659
|
slots: c
|
|
2660
|
-
},
|
|
2661
|
-
return
|
|
2660
|
+
}, e);
|
|
2661
|
+
return n({
|
|
2662
2662
|
clearFilter: x,
|
|
2663
2663
|
clearAllFilters: g
|
|
2664
|
-
}), (y, _) => y.view === "vertical" ? (f(), w("div",
|
|
2665
|
-
l("div",
|
|
2666
|
-
|
|
2664
|
+
}), (y, _) => y.view === "vertical" ? (f(), w("div", La, [
|
|
2665
|
+
l("div", ja, [
|
|
2666
|
+
t(h) > 0 ? (f(), w("button", {
|
|
2667
2667
|
key: 0,
|
|
2668
|
-
onClick: _[0] || (_[0] = (v) =>
|
|
2668
|
+
onClick: _[0] || (_[0] = (v) => t(g)()),
|
|
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 ? (f(!0), w(
|
|
2675
|
+
y.schema ? (f(!0), w(Z, { key: 1 }, ae(Object.entries(y.schema), ([v, p]) => (f(), P(we, ie({
|
|
2676
2676
|
name: v,
|
|
2677
2677
|
layout: "vertical"
|
|
2678
2678
|
}, { ref_for: !0 }, p, {
|
|
2679
|
-
onChange: _[1] || (_[1] = (a) =>
|
|
2679
|
+
onChange: _[1] || (_[1] = (a) => t(m)(a.name, a.value)),
|
|
2680
2680
|
onClear: _[2] || (_[2] = (a) => {
|
|
2681
|
-
|
|
2681
|
+
t(x)(a), t(m)(a, void 0);
|
|
2682
2682
|
}),
|
|
2683
|
-
modelValue:
|
|
2684
|
-
"onUpdate:modelValue": (a) =>
|
|
2683
|
+
modelValue: t(u)[v],
|
|
2684
|
+
"onUpdate:modelValue": (a) => t(u)[v] = a,
|
|
2685
2685
|
showClean: !0
|
|
2686
2686
|
}), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : S("", !0),
|
|
2687
|
-
(f(!0), w(
|
|
2687
|
+
(f(!0), w(Z, null, ae(t(d), (v, p) => (f(), P(we, ie({
|
|
2688
2688
|
key: "slot-" + p,
|
|
2689
2689
|
layout: "vertical"
|
|
2690
2690
|
}, { ref_for: !0 }, v.props, {
|
|
2691
|
-
onChange: _[3] || (_[3] = (a) =>
|
|
2691
|
+
onChange: _[3] || (_[3] = (a) => t(m)(a.name, a.value)),
|
|
2692
2692
|
onClear: _[4] || (_[4] = (a) => {
|
|
2693
|
-
|
|
2693
|
+
t(x)(a), t(m)(a, void 0);
|
|
2694
2694
|
}),
|
|
2695
|
-
modelValue:
|
|
2696
|
-
"onUpdate:modelValue": (a) =>
|
|
2695
|
+
modelValue: t(u)[v.props.name],
|
|
2696
|
+
"onUpdate:modelValue": (a) => t(u)[v.props.name] = a,
|
|
2697
2697
|
showClean: !0
|
|
2698
2698
|
}), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
|
|
2699
2699
|
])
|
|
2700
2700
|
])) : S("", !0);
|
|
2701
2701
|
}
|
|
2702
|
-
}), De = /* @__PURE__ */
|
|
2702
|
+
}), De = /* @__PURE__ */ G({
|
|
2703
2703
|
__name: "filter",
|
|
2704
2704
|
props: {
|
|
2705
2705
|
schema: {},
|
|
@@ -2710,8 +2710,8 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2710
2710
|
limit: { default: 3 }
|
|
2711
2711
|
},
|
|
2712
2712
|
emits: ["change", "clear", "clearAll"],
|
|
2713
|
-
setup(i, { expose:
|
|
2714
|
-
const
|
|
2713
|
+
setup(i, { expose: n, emit: o }) {
|
|
2714
|
+
const r = i, e = V(r.value ?? {}), c = o, u = V();
|
|
2715
2715
|
function h(p) {
|
|
2716
2716
|
if (Array.isArray(p))
|
|
2717
2717
|
return p.map((a) => h(a));
|
|
@@ -2724,42 +2724,42 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2724
2724
|
return p;
|
|
2725
2725
|
}
|
|
2726
2726
|
function m(p, a) {
|
|
2727
|
-
a !== void 0 ?
|
|
2728
|
-
...
|
|
2727
|
+
a !== void 0 ? e.value = {
|
|
2728
|
+
...e.value,
|
|
2729
2729
|
[p]: a
|
|
2730
|
-
} : delete
|
|
2731
|
-
data: h(
|
|
2730
|
+
} : delete e.value[p], c("change", {
|
|
2731
|
+
data: h(e.value),
|
|
2732
2732
|
name: p,
|
|
2733
2733
|
value: h(a)
|
|
2734
2734
|
});
|
|
2735
2735
|
}
|
|
2736
2736
|
function x(p) {
|
|
2737
|
-
delete
|
|
2738
|
-
data: h(
|
|
2737
|
+
delete e.value[p], c("clear", {
|
|
2738
|
+
data: h(e.value),
|
|
2739
2739
|
name: p
|
|
2740
2740
|
}), c("change", {
|
|
2741
|
-
data: h(
|
|
2741
|
+
data: h(e.value),
|
|
2742
2742
|
name: p,
|
|
2743
2743
|
value: null
|
|
2744
2744
|
});
|
|
2745
2745
|
}
|
|
2746
2746
|
function g() {
|
|
2747
|
-
|
|
2748
|
-
data: h(
|
|
2747
|
+
e.value = {}, c("clear", {
|
|
2748
|
+
data: h(e.value),
|
|
2749
2749
|
name: "ALL"
|
|
2750
2750
|
}), c("change", {
|
|
2751
|
-
data: h(
|
|
2751
|
+
data: h(e.value),
|
|
2752
2752
|
name: "ALL",
|
|
2753
2753
|
value: null
|
|
2754
2754
|
});
|
|
2755
2755
|
}
|
|
2756
2756
|
const d = V({});
|
|
2757
2757
|
function y() {
|
|
2758
|
-
switch (
|
|
2758
|
+
switch (r.view) {
|
|
2759
2759
|
case "inline":
|
|
2760
2760
|
return We;
|
|
2761
2761
|
case "vertical":
|
|
2762
|
-
return
|
|
2762
|
+
return Da;
|
|
2763
2763
|
case "popover":
|
|
2764
2764
|
return it;
|
|
2765
2765
|
default:
|
|
@@ -2767,7 +2767,7 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
2769
|
j(
|
|
2770
|
-
() =>
|
|
2770
|
+
() => r.schema,
|
|
2771
2771
|
(p) => {
|
|
2772
2772
|
if (!p) {
|
|
2773
2773
|
d.value = {};
|
|
@@ -2789,10 +2789,10 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2789
2789
|
function v() {
|
|
2790
2790
|
u.value.clearAllFilters(), g();
|
|
2791
2791
|
}
|
|
2792
|
-
return
|
|
2792
|
+
return n({
|
|
2793
2793
|
clearAllFilters: v,
|
|
2794
2794
|
clearFilter: _
|
|
2795
|
-
}), (p, a) => (f(), P(
|
|
2795
|
+
}), (p, a) => (f(), P(be(y()), ie(r, {
|
|
2796
2796
|
schema: d.value,
|
|
2797
2797
|
onChange: a[0] || (a[0] = (C) => m(C.name, C.value)),
|
|
2798
2798
|
onClear: a[1] || (a[1] = (C) => x(C.name)),
|
|
@@ -2800,19 +2800,19 @@ const ha = /* @__PURE__ */ me(fa, [["render", ma]]), ga = {
|
|
|
2800
2800
|
ref_key: "filterRef",
|
|
2801
2801
|
ref: u
|
|
2802
2802
|
}), {
|
|
2803
|
-
default:
|
|
2804
|
-
|
|
2803
|
+
default: xe(() => [
|
|
2804
|
+
ve(p.$slots, "default")
|
|
2805
2805
|
]),
|
|
2806
2806
|
_: 3
|
|
2807
2807
|
}, 16, ["schema"]));
|
|
2808
2808
|
}
|
|
2809
2809
|
});
|
|
2810
2810
|
De.install = function(i) {
|
|
2811
|
-
i.component("Filter", De), i.component("FilterField",
|
|
2811
|
+
i.component("Filter", De), i.component("FilterField", we);
|
|
2812
2812
|
};
|
|
2813
|
-
function
|
|
2814
|
-
const { page:
|
|
2815
|
-
|
|
2813
|
+
function Fa(i) {
|
|
2814
|
+
const { page: n, id: o, filter: r, filterByView: e } = i, c = new URL(window.location.href), u = new URLSearchParams(window.location.search);
|
|
2815
|
+
n ? u.set("page", n.toString()) : u.delete("page"), o ? u.set("id", o.toString()) : u.delete("id"), r ? u.set("filter", r) : u.delete("filter"), typeof e == "boolean" ? u.set("bbox", e ? "1" : "0") : u.delete("bbox"), c.search = decodeURI(u.toString()), window.history.pushState({}, "", c);
|
|
2816
2816
|
}
|
|
2817
2817
|
const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = { class: "flex items-center" }, Ua = ["disabled"], Ia = /* @__PURE__ */ l("svg", {
|
|
2818
2818
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2832,16 +2832,16 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
2832
2832
|
fill: "none"
|
|
2833
2833
|
}),
|
|
2834
2834
|
/* @__PURE__ */ l("path", { d: "M6 9l6 6l6 -6" })
|
|
2835
|
-
], -1),
|
|
2835
|
+
], -1), Za = /* @__PURE__ */ l("span", {
|
|
2836
2836
|
"aria-hidden": "true",
|
|
2837
2837
|
class: "sr-only"
|
|
2838
|
-
}, "Previous", -1),
|
|
2838
|
+
}, "Previous", -1), Oa = [
|
|
2839
2839
|
Ia,
|
|
2840
|
-
|
|
2841
|
-
],
|
|
2840
|
+
Za
|
|
2841
|
+
], Ta = { class: "flex items-center gap-x-1" }, Ha = ["onClick"], Ea = ["disabled"], Na = /* @__PURE__ */ l("span", {
|
|
2842
2842
|
"aria-hidden": "true",
|
|
2843
2843
|
class: "sr-only"
|
|
2844
|
-
}, "Next", -1),
|
|
2844
|
+
}, "Next", -1), Wa = /* @__PURE__ */ l("svg", {
|
|
2845
2845
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2846
2846
|
viewBox: "0 0 24 24",
|
|
2847
2847
|
fill: "none",
|
|
@@ -2860,8 +2860,8 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
2860
2860
|
}),
|
|
2861
2861
|
/* @__PURE__ */ l("path", { d: "M6 9l6 6l6 -6" })
|
|
2862
2862
|
], -1), Ya = [
|
|
2863
|
-
|
|
2864
|
-
|
|
2863
|
+
Na,
|
|
2864
|
+
Wa
|
|
2865
2865
|
], qa = { class: "flex justify-center items-center gap-x-5 ml-3" }, Qa = { class: "relative" }, Ga = {
|
|
2866
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%]",
|
|
2867
2867
|
role: "menu",
|
|
@@ -2904,7 +2904,7 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
2904
2904
|
fill: "none"
|
|
2905
2905
|
}),
|
|
2906
2906
|
/* @__PURE__ */ l("path", { d: "M6 9l6 6l6 -6" })
|
|
2907
|
-
], -1), oo = /* @__PURE__ */
|
|
2907
|
+
], -1), oo = /* @__PURE__ */ G({
|
|
2908
2908
|
__name: "pagination",
|
|
2909
2909
|
props: {
|
|
2910
2910
|
total: {},
|
|
@@ -2912,69 +2912,69 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
2912
2912
|
pageSize: {}
|
|
2913
2913
|
},
|
|
2914
2914
|
emits: ["update:currentPage", "update:pageSize", "pageChange", "pageSizeChange"],
|
|
2915
|
-
setup(i, { emit:
|
|
2916
|
-
const
|
|
2917
|
-
j(() =>
|
|
2915
|
+
setup(i, { emit: n }) {
|
|
2916
|
+
const o = i, r = n, e = V(o.currentPage), c = V(o.pageSize), u = V(!1);
|
|
2917
|
+
j(() => o.pageSize, (_) => {
|
|
2918
2918
|
c.value = _;
|
|
2919
2919
|
});
|
|
2920
|
-
const h =
|
|
2920
|
+
const h = N(() => Math.ceil(o.total / o.pageSize)), m = N(() => {
|
|
2921
2921
|
const v = Math.floor(3.5);
|
|
2922
|
-
let p =
|
|
2922
|
+
let p = e.value - v, a = e.value + v;
|
|
2923
2923
|
p < 1 && (a += 1 - p, p = 1), a > h.value && (p -= a - h.value, a = h.value), p = Math.max(1, p);
|
|
2924
2924
|
const C = [];
|
|
2925
2925
|
for (let b = p; b <= a; b += 1)
|
|
2926
2926
|
C.push(b);
|
|
2927
2927
|
return C;
|
|
2928
2928
|
}), x = () => {
|
|
2929
|
-
|
|
2929
|
+
e.value > 1 && d(e.value - 1);
|
|
2930
2930
|
}, g = () => {
|
|
2931
|
-
|
|
2931
|
+
e.value < h.value && d(e.value + 1);
|
|
2932
2932
|
}, d = (_) => {
|
|
2933
|
-
|
|
2933
|
+
e.value = _, r("update:currentPage", _), r("pageChange", _);
|
|
2934
2934
|
}, y = (_ = c.value) => {
|
|
2935
|
-
c.value = _, u.value = !1,
|
|
2935
|
+
c.value = _, u.value = !1, r("update:pageSize", c.value), r("update:currentPage", 1), r("pageSizeChange", c.value);
|
|
2936
2936
|
};
|
|
2937
|
-
return j(() =>
|
|
2938
|
-
|
|
2937
|
+
return j(() => o.currentPage, (_) => {
|
|
2938
|
+
e.value = _;
|
|
2939
2939
|
}), (_, v) => (f(), w("nav", Pa, [
|
|
2940
2940
|
l("div", Ka, [
|
|
2941
2941
|
l("button", {
|
|
2942
2942
|
type: "button",
|
|
2943
2943
|
"aria-label": "Previous",
|
|
2944
2944
|
onClick: x,
|
|
2945
|
-
disabled:
|
|
2945
|
+
disabled: e.value === 1,
|
|
2946
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"
|
|
2947
|
-
},
|
|
2948
|
-
l("div",
|
|
2949
|
-
(f(!0), w(
|
|
2947
|
+
}, Oa, 8, Ua),
|
|
2948
|
+
l("div", Ta, [
|
|
2949
|
+
(f(!0), w(Z, null, ae(m.value, (p) => (f(), w("button", {
|
|
2950
2950
|
type: "button",
|
|
2951
2951
|
key: p,
|
|
2952
2952
|
onClick: (a) => d(p),
|
|
2953
|
-
class:
|
|
2954
|
-
}, O(p), 11,
|
|
2953
|
+
class: I(e.value === p ? "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
|
+
}, O(p), 11, Ha))), 128))
|
|
2955
2955
|
]),
|
|
2956
2956
|
l("button", {
|
|
2957
2957
|
type: "button",
|
|
2958
2958
|
"aria-label": "Next",
|
|
2959
2959
|
onClick: g,
|
|
2960
|
-
disabled:
|
|
2960
|
+
disabled: e.value === h.value,
|
|
2961
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"
|
|
2962
|
-
}, Ya, 8,
|
|
2962
|
+
}, Ya, 8, Ea)
|
|
2963
2963
|
]),
|
|
2964
2964
|
l("div", qa, [
|
|
2965
2965
|
l("div", Qa, [
|
|
2966
|
-
|
|
2967
|
-
(f(), w(
|
|
2966
|
+
E(l("div", Ga, [
|
|
2967
|
+
(f(), w(Z, null, ae([10, 20, 30], (p) => l("button", {
|
|
2968
2968
|
type: "button",
|
|
2969
2969
|
key: p,
|
|
2970
2970
|
onClick: (a) => y(p),
|
|
2971
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"
|
|
2972
2972
|
}, [
|
|
2973
|
-
|
|
2973
|
+
te(O(p) + " ", 1),
|
|
2974
2974
|
c.value === p ? (f(), w("svg", Xa, lo)) : S("", !0)
|
|
2975
2975
|
], 8, Ja)), 64))
|
|
2976
2976
|
], 512), [
|
|
2977
|
-
[
|
|
2977
|
+
[de, u.value]
|
|
2978
2978
|
]),
|
|
2979
2979
|
l("button", {
|
|
2980
2980
|
type: "button",
|
|
@@ -2984,18 +2984,18 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
2984
2984
|
"aria-label": "Dropdown",
|
|
2985
2985
|
onClick: v[0] || (v[0] = (p) => u.value = !u.value)
|
|
2986
2986
|
}, [
|
|
2987
|
-
|
|
2987
|
+
te(O(c.value) + " ", 1),
|
|
2988
2988
|
ao
|
|
2989
2989
|
])
|
|
2990
2990
|
])
|
|
2991
2991
|
])
|
|
2992
2992
|
]));
|
|
2993
2993
|
}
|
|
2994
|
-
}), Be = (i,
|
|
2995
|
-
const
|
|
2996
|
-
for (const [
|
|
2997
|
-
|
|
2998
|
-
return
|
|
2994
|
+
}), Be = (i, n) => {
|
|
2995
|
+
const o = i.__vccOpts || i;
|
|
2996
|
+
for (const [r, e] of n)
|
|
2997
|
+
o[r] = e;
|
|
2998
|
+
return o;
|
|
2999
2999
|
}, ro = {}, no = {
|
|
3000
3000
|
class: "w-48 mx-auto mb-4",
|
|
3001
3001
|
width: "178",
|
|
@@ -3006,7 +3006,7 @@ const Pa = { class: "flex items-center justify-between w-full gap-x-1" }, Ka = {
|
|
|
3006
3006
|
}, io = /* @__PURE__ */ Je('<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), so = [
|
|
3007
3007
|
io
|
|
3008
3008
|
];
|
|
3009
|
-
function uo(i,
|
|
3009
|
+
function uo(i, n) {
|
|
3010
3010
|
return f(), w("svg", no, so);
|
|
3011
3011
|
}
|
|
3012
3012
|
const co = /* @__PURE__ */ Be(ro, [["render", uo]]), po = {}, fo = {
|
|
@@ -3030,7 +3030,7 @@ const co = /* @__PURE__ */ Be(ro, [["render", uo]]), po = {}, fo = {
|
|
|
3030
3030
|
ho,
|
|
3031
3031
|
go
|
|
3032
3032
|
];
|
|
3033
|
-
function bo(i,
|
|
3033
|
+
function bo(i, n) {
|
|
3034
3034
|
return f(), w("svg", fo, yo);
|
|
3035
3035
|
}
|
|
3036
3036
|
const xo = /* @__PURE__ */ Be(po, [["render", bo]]), wo = {}, ko = {
|
|
@@ -3054,7 +3054,7 @@ const xo = /* @__PURE__ */ Be(po, [["render", bo]]), wo = {}, ko = {
|
|
|
3054
3054
|
Vo,
|
|
3055
3055
|
So
|
|
3056
3056
|
];
|
|
3057
|
-
function Mo(i,
|
|
3057
|
+
function Mo(i, n) {
|
|
3058
3058
|
return f(), w("svg", ko, $o);
|
|
3059
3059
|
}
|
|
3060
3060
|
const Bo = /* @__PURE__ */ Be(wo, [["render", Mo]]), zo = {}, Ao = {
|
|
@@ -3072,14 +3072,14 @@ const Bo = /* @__PURE__ */ Be(wo, [["render", Mo]]), zo = {}, Ao = {
|
|
|
3072
3072
|
stroke: "none",
|
|
3073
3073
|
d: "M0 0h24v24H0z",
|
|
3074
3074
|
fill: "none"
|
|
3075
|
-
}, null, -1),
|
|
3075
|
+
}, null, -1), Lo = /* @__PURE__ */ l("path", { d: "M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13" }, null, -1), jo = /* @__PURE__ */ l("path", { d: "M9 4v13" }, null, -1), Do = /* @__PURE__ */ l("path", { d: "M15 7v13" }, null, -1), Fo = [
|
|
3076
3076
|
Ro,
|
|
3077
|
+
Lo,
|
|
3077
3078
|
jo,
|
|
3078
|
-
Do
|
|
3079
|
-
Fo
|
|
3079
|
+
Do
|
|
3080
3080
|
];
|
|
3081
|
-
function Po(i,
|
|
3082
|
-
return f(), w("svg", Ao,
|
|
3081
|
+
function Po(i, n) {
|
|
3082
|
+
return f(), w("svg", Ao, Fo);
|
|
3083
3083
|
}
|
|
3084
3084
|
const Ko = /* @__PURE__ */ Be(zo, [["render", Po]]), Uo = {}, Io = {
|
|
3085
3085
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3092,34 +3092,34 @@ const Ko = /* @__PURE__ */ Be(zo, [["render", Po]]), Uo = {}, Io = {
|
|
|
3092
3092
|
"stroke-linecap": "round",
|
|
3093
3093
|
"stroke-linejoin": "round",
|
|
3094
3094
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-table"
|
|
3095
|
-
},
|
|
3095
|
+
}, Zo = /* @__PURE__ */ l("path", {
|
|
3096
3096
|
stroke: "none",
|
|
3097
3097
|
d: "M0 0h24v24H0z",
|
|
3098
3098
|
fill: "none"
|
|
3099
|
-
}, null, -1),
|
|
3099
|
+
}, null, -1), Oo = /* @__PURE__ */ l("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), To = /* @__PURE__ */ l("path", { d: "M3 10h18" }, null, -1), Ho = /* @__PURE__ */ l("path", { d: "M10 3v18" }, null, -1), Eo = [
|
|
3100
|
+
Zo,
|
|
3100
3101
|
Oo,
|
|
3101
3102
|
To,
|
|
3102
|
-
Ho
|
|
3103
|
-
Eo
|
|
3103
|
+
Ho
|
|
3104
3104
|
];
|
|
3105
|
-
function
|
|
3106
|
-
return f(), w("svg", Io,
|
|
3105
|
+
function No(i, n) {
|
|
3106
|
+
return f(), w("svg", Io, Eo);
|
|
3107
3107
|
}
|
|
3108
|
-
const
|
|
3109
|
-
function
|
|
3110
|
-
let
|
|
3111
|
-
return function(...
|
|
3112
|
-
clearTimeout(
|
|
3108
|
+
const Wo = /* @__PURE__ */ Be(Uo, [["render", No]]);
|
|
3109
|
+
function Ye(i, n) {
|
|
3110
|
+
let o;
|
|
3111
|
+
return function(...r) {
|
|
3112
|
+
clearTimeout(o), o = setTimeout(() => i(...r), n);
|
|
3113
3113
|
};
|
|
3114
3114
|
}
|
|
3115
|
-
function st(i,
|
|
3116
|
-
const
|
|
3117
|
-
return `${window.location.origin}/api/vtile/${i}/ua/{z}/{x}/{y}.vmt?pointZoom=12&clusterZoom=${
|
|
3115
|
+
function st(i, n, o = 12) {
|
|
3116
|
+
const r = n ?? "";
|
|
3117
|
+
return `${window.location.origin}/api/vtile/${i}/ua/{z}/{x}/{y}.vmt?pointZoom=12&clusterZoom=${o}&filter=${r}`;
|
|
3118
3118
|
}
|
|
3119
|
-
function Yo(i,
|
|
3120
|
-
if (!
|
|
3121
|
-
const c = st(i,
|
|
3122
|
-
|
|
3119
|
+
function Yo(i, n, o, r, e = 12) {
|
|
3120
|
+
if (!n) return;
|
|
3121
|
+
const c = st(i, r, e);
|
|
3122
|
+
n.addSource("vector", {
|
|
3123
3123
|
type: "vector",
|
|
3124
3124
|
tiles: [c],
|
|
3125
3125
|
minzoom: 0,
|
|
@@ -3139,7 +3139,7 @@ function Yo(i, r, n, o, t = 12) {
|
|
|
3139
3139
|
["get", "clusterCountAbbreviated"],
|
|
3140
3140
|
u
|
|
3141
3141
|
];
|
|
3142
|
-
|
|
3142
|
+
n.addLayer({
|
|
3143
3143
|
id: "vector-clusters",
|
|
3144
3144
|
type: "circle",
|
|
3145
3145
|
source: "vector",
|
|
@@ -3166,7 +3166,7 @@ function Yo(i, r, n, o, t = 12) {
|
|
|
3166
3166
|
],
|
|
3167
3167
|
"circle-opacity": 0.85
|
|
3168
3168
|
}
|
|
3169
|
-
}),
|
|
3169
|
+
}), n.addLayer({
|
|
3170
3170
|
id: "vector-cluster-count",
|
|
3171
3171
|
type: "symbol",
|
|
3172
3172
|
source: "vector",
|
|
@@ -3180,7 +3180,7 @@ function Yo(i, r, n, o, t = 12) {
|
|
|
3180
3180
|
paint: {
|
|
3181
3181
|
"text-color": "#1f2937"
|
|
3182
3182
|
}
|
|
3183
|
-
}),
|
|
3183
|
+
}), n.addLayer({
|
|
3184
3184
|
id: "vector-circle",
|
|
3185
3185
|
type: "circle",
|
|
3186
3186
|
maxzoom: 12,
|
|
@@ -3189,12 +3189,12 @@ function Yo(i, r, n, o, t = 12) {
|
|
|
3189
3189
|
// must match the layer name in the vector tile source
|
|
3190
3190
|
filter: m,
|
|
3191
3191
|
paint: {
|
|
3192
|
-
"circle-color":
|
|
3192
|
+
"circle-color": o,
|
|
3193
3193
|
"circle-stroke-color": "#eee",
|
|
3194
3194
|
"circle-stroke-width": 1,
|
|
3195
3195
|
"circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 5, 15, 12]
|
|
3196
3196
|
}
|
|
3197
|
-
}),
|
|
3197
|
+
}), n.addLayer({
|
|
3198
3198
|
id: "vector-fill",
|
|
3199
3199
|
type: "fill",
|
|
3200
3200
|
minzoom: 12,
|
|
@@ -3202,7 +3202,7 @@ function Yo(i, r, n, o, t = 12) {
|
|
|
3202
3202
|
"source-layer": i,
|
|
3203
3203
|
// must match the layer name in the vector tile source
|
|
3204
3204
|
paint: {
|
|
3205
|
-
"fill-color":
|
|
3205
|
+
"fill-color": o,
|
|
3206
3206
|
"fill-opacity": 0.6
|
|
3207
3207
|
}
|
|
3208
3208
|
});
|
|
@@ -3249,7 +3249,7 @@ const qo = [
|
|
|
3249
3249
|
], Xo = { class: "absolute left-[20px] bottom-[74px] bg-white max-w-[250px] p-[10px] rounded-lg z-10 border" }, er = { class: "flex justify-start items-center gap-2" }, tr = { class: "ml-1 text-[0.875rem]" }, lr = {
|
|
3250
3250
|
class: "vs-map-slot-layers z-10 select-none",
|
|
3251
3251
|
style: { display: "flex" }
|
|
3252
|
-
}, ar = ["title", "onClick"], or = ["src"], rr = { 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" },
|
|
3252
|
+
}, ar = ["title", "onClick"], or = ["src"], rr = { 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" }, Ae = "vector-clusters", nr = /* @__PURE__ */ G({
|
|
3253
3253
|
__name: "map",
|
|
3254
3254
|
props: {
|
|
3255
3255
|
table: {},
|
|
@@ -3258,29 +3258,31 @@ const qo = [
|
|
|
3258
3258
|
filter: {},
|
|
3259
3259
|
modelValue: {},
|
|
3260
3260
|
zoom: {},
|
|
3261
|
+
minZoom: {},
|
|
3262
|
+
maxZoom: {},
|
|
3261
3263
|
map: {},
|
|
3262
3264
|
layers: {},
|
|
3263
3265
|
clusterZoom: {}
|
|
3264
3266
|
},
|
|
3265
3267
|
emits: ["update:modelValue", "update:map"],
|
|
3266
|
-
setup(i, { emit:
|
|
3267
|
-
const
|
|
3268
|
-
let
|
|
3269
|
-
const u = Xe(), h = V(null), m = V(!1), x = ["vector-circle", "vector-fill"], g =
|
|
3270
|
-
var $,
|
|
3271
|
-
return ((
|
|
3272
|
-
}), d =
|
|
3268
|
+
setup(i, { emit: n }) {
|
|
3269
|
+
const o = i, r = n;
|
|
3270
|
+
let e, c;
|
|
3271
|
+
const u = Xe(), h = V(null), m = V(!1), x = ["vector-circle", "vector-fill"], g = N(() => {
|
|
3272
|
+
var $, R;
|
|
3273
|
+
return ((R = ($ = u == null ? void 0 : u.appContext.config.globalProperties) == null ? void 0 : $.$settings) == null ? void 0 : R.basemaps) || [];
|
|
3274
|
+
}), d = N(() => (o.layers && o.layers.length ? o.layers : g.value.length ? g.value : qo).map((R, U) => {
|
|
3273
3275
|
var ye;
|
|
3274
|
-
const q =
|
|
3276
|
+
const q = R.id || ((ye = R.name) == null ? void 0 : ye.toString().toLowerCase().replace(/\s+/g, "-")) || `layer-${U}`, pe = R.name || R.id || `layer-${U}`;
|
|
3275
3277
|
return {
|
|
3276
|
-
...
|
|
3278
|
+
...R,
|
|
3277
3279
|
id: q,
|
|
3278
|
-
name:
|
|
3280
|
+
name: pe
|
|
3279
3281
|
};
|
|
3280
|
-
})), y = V(""), _ =
|
|
3282
|
+
})), y = V(""), _ = N(() => d.value.find(($) => $.id === y.value) || d.value[0]);
|
|
3281
3283
|
j(d, ($) => {
|
|
3282
|
-
var
|
|
3283
|
-
$.length && (!y.value || !$.some((
|
|
3284
|
+
var R;
|
|
3285
|
+
$.length && (!y.value || !$.some((U) => U.id === y.value)) && (y.value = ((R = $[0]) == null ? void 0 : R.id) || "");
|
|
3284
3286
|
}, { immediate: !0 });
|
|
3285
3287
|
function v($) {
|
|
3286
3288
|
return $ ? $.replace("{x}", "2422").replace("{y}", "1400").replace("{z}", "12") : "";
|
|
@@ -3313,38 +3315,38 @@ const qo = [
|
|
|
3313
3315
|
function A() {
|
|
3314
3316
|
if (typeof window > "u")
|
|
3315
3317
|
return { zoom: null, center: null, hasQuery: !1 };
|
|
3316
|
-
const $ = new URLSearchParams(window.location.search),
|
|
3318
|
+
const $ = new URLSearchParams(window.location.search), R = Number($.get("z")), U = Number($.get("y")), q = Number($.get("x")), pe = $.has("x") && $.has("y"), ye = $.has("z");
|
|
3317
3319
|
return {
|
|
3318
|
-
zoom: ye ?
|
|
3319
|
-
center:
|
|
3320
|
-
hasQuery:
|
|
3320
|
+
zoom: ye ? R : null,
|
|
3321
|
+
center: pe ? [q, U] : null,
|
|
3322
|
+
hasQuery: pe || ye
|
|
3321
3323
|
};
|
|
3322
3324
|
}
|
|
3323
|
-
function
|
|
3325
|
+
function L($, R) {
|
|
3324
3326
|
if (!$ || typeof window > "u") return;
|
|
3325
|
-
const
|
|
3326
|
-
|
|
3327
|
+
const U = new URL(window.location.href);
|
|
3328
|
+
U.searchParams.set("z", R.toFixed(2)), U.searchParams.set("x", $[0].toFixed(6)), U.searchParams.set("y", $[1].toFixed(6)), window.history.replaceState({}, "", U);
|
|
3327
3329
|
}
|
|
3328
3330
|
let T = !1;
|
|
3329
3331
|
function K() {
|
|
3330
|
-
if (!
|
|
3331
|
-
const $ =
|
|
3332
|
-
|
|
3332
|
+
if (!e || !T) return;
|
|
3333
|
+
const $ = e.getCenter();
|
|
3334
|
+
L([$.lng, $.lat], e.getZoom());
|
|
3333
3335
|
}
|
|
3334
|
-
const
|
|
3336
|
+
const fe = () => {
|
|
3335
3337
|
T || (T = !0), K();
|
|
3336
3338
|
};
|
|
3337
3339
|
function oe($) {
|
|
3338
3340
|
return $ ? ["==", ["to-string", ["get", "id"]], $] : ["==", ["literal", 1], 0];
|
|
3339
3341
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const $ = oe(
|
|
3342
|
-
|
|
3342
|
+
function F() {
|
|
3343
|
+
const $ = oe(o.modelValue);
|
|
3344
|
+
e.getLayer("vector-highlight-circle") || e.addLayer({
|
|
3343
3345
|
id: "vector-highlight-circle",
|
|
3344
3346
|
type: "circle",
|
|
3345
|
-
maxzoom:
|
|
3347
|
+
maxzoom: Math.min((o.maxZoom ?? 18) + 0.01, 24),
|
|
3346
3348
|
source: "vector",
|
|
3347
|
-
"source-layer":
|
|
3349
|
+
"source-layer": o.table,
|
|
3348
3350
|
paint: {
|
|
3349
3351
|
"circle-color": "#ef4444",
|
|
3350
3352
|
"circle-opacity": 0.8,
|
|
@@ -3352,174 +3354,192 @@ const qo = [
|
|
|
3352
3354
|
"circle-stroke-width": 0,
|
|
3353
3355
|
"circle-radius": ["interpolate", ["linear"], ["zoom"], 10, 10, 12, 11]
|
|
3354
3356
|
}
|
|
3355
|
-
}),
|
|
3357
|
+
}), e.getLayer("vector-highlight-fill") || e.addLayer({
|
|
3356
3358
|
id: "vector-highlight-fill",
|
|
3357
3359
|
type: "line",
|
|
3358
|
-
minzoom: 12,
|
|
3360
|
+
minzoom: o.clusterZoom ?? 12,
|
|
3359
3361
|
source: "vector",
|
|
3360
|
-
"source-layer":
|
|
3362
|
+
"source-layer": o.table,
|
|
3361
3363
|
paint: {
|
|
3362
3364
|
"line-color": "#b91c1c",
|
|
3363
3365
|
"line-width": 3,
|
|
3364
3366
|
"line-opacity": 0.8
|
|
3365
3367
|
}
|
|
3366
|
-
}),
|
|
3367
|
-
const
|
|
3368
|
-
|
|
3368
|
+
}), e.setFilter("vector-highlight-circle", $), e.setFilter("vector-highlight-fill", $);
|
|
3369
|
+
const R = o.modelValue ? "visible" : "none";
|
|
3370
|
+
e.setLayoutProperty("vector-highlight-circle", "visibility", R), e.setLayoutProperty("vector-highlight-fill", "visibility", R), H();
|
|
3369
3371
|
}
|
|
3370
3372
|
function z($) {
|
|
3371
|
-
if (!
|
|
3372
|
-
const
|
|
3373
|
+
if (!e || !B.length) return;
|
|
3374
|
+
const U = [
|
|
3373
3375
|
"case",
|
|
3374
3376
|
["all", ["has", "id"], ["==", ["to-string", ["get", "id"]], $]],
|
|
3375
3377
|
"#ef4444",
|
|
3376
3378
|
B
|
|
3377
3379
|
];
|
|
3378
|
-
|
|
3380
|
+
e.getLayer("vector-circle") && e.setPaintProperty("vector-circle", "circle-color", U), e.getLayer("vector-fill") && e.setPaintProperty("vector-fill", "fill-color", U);
|
|
3379
3381
|
}
|
|
3380
3382
|
function H() {
|
|
3381
|
-
if (
|
|
3383
|
+
if (X(), !o.modelValue) return;
|
|
3382
3384
|
let $ = !0;
|
|
3383
3385
|
k = window.setInterval(() => {
|
|
3384
3386
|
$ = !$;
|
|
3385
|
-
const
|
|
3386
|
-
|
|
3387
|
+
const R = $ ? 0.8 : 0.2;
|
|
3388
|
+
e != null && e.getLayer("vector-highlight-circle") && e.setPaintProperty("vector-highlight-circle", "circle-opacity", R), e != null && e.getLayer("vector-highlight-fill") && e.setPaintProperty("vector-highlight-fill", "line-opacity", R);
|
|
3387
3389
|
}, 600);
|
|
3388
3390
|
}
|
|
3389
|
-
function
|
|
3391
|
+
function X() {
|
|
3390
3392
|
k && (clearInterval(k), k = null);
|
|
3391
3393
|
}
|
|
3392
|
-
function
|
|
3393
|
-
|
|
3394
|
+
function ge() {
|
|
3395
|
+
e && (e.setCenter(o.center || s), e.setZoom(o.zoom || 5));
|
|
3394
3396
|
}
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3397
|
+
function ue() {
|
|
3398
|
+
if (!(e != null && e.setLayerZoomRange)) return;
|
|
3399
|
+
const $ = o.minZoom ?? 0, R = Math.min((o.maxZoom ?? 18) + 0.01, 24), U = o.clusterZoom ?? 12;
|
|
3400
|
+
e.getLayer("vector-circle") && e.setLayerZoomRange("vector-circle", $, R), e.getLayer("vector-highlight-circle") && e.setLayerZoomRange("vector-highlight-circle", $, R), e.getLayer("vector-fill") && e.setLayerZoomRange("vector-fill", U, R), e.getLayer("vector-highlight-fill") && e.setLayerZoomRange("vector-highlight-fill", U, R), e.getLayer(Ae) && e.setLayerZoomRange(Ae, $, U), e.getLayer("vector-cluster-count") && e.setLayerZoomRange("vector-cluster-count", $, U);
|
|
3401
|
+
}
|
|
3402
|
+
const Se = A();
|
|
3403
|
+
T = Se.hasQuery, _e(async () => {
|
|
3404
|
+
b = (await fetch(`/api/data/${o.table}/${o.colorAttr}`).then((ee) => ee.json())).rows, b.forEach((ee, le) => {
|
|
3405
|
+
ee.color || Object.assign(ee, { color: C[le % 10] });
|
|
3399
3406
|
}), c = new maplibregl.Popup({
|
|
3400
3407
|
closeButton: !1,
|
|
3401
3408
|
closeOnClick: !1
|
|
3402
3409
|
});
|
|
3403
|
-
const
|
|
3404
|
-
if (!
|
|
3405
|
-
const
|
|
3406
|
-
|
|
3410
|
+
const R = _.value;
|
|
3411
|
+
if (!R) return;
|
|
3412
|
+
const U = Se.center || o.center || s, q = Se.zoom || o.zoom || 5;
|
|
3413
|
+
e = new maplibregl.Map({
|
|
3407
3414
|
container: h.value,
|
|
3408
3415
|
style: {
|
|
3409
3416
|
version: 8,
|
|
3410
3417
|
sources: {
|
|
3411
|
-
[
|
|
3418
|
+
[R.id]: { type: "raster", tiles: [R.url], tileSize: 256 }
|
|
3412
3419
|
},
|
|
3413
3420
|
layers: [{
|
|
3414
|
-
id:
|
|
3421
|
+
id: R.id,
|
|
3415
3422
|
type: "raster",
|
|
3416
|
-
source:
|
|
3423
|
+
source: R.id,
|
|
3417
3424
|
minzoom: 0,
|
|
3418
3425
|
maxzoom: 19
|
|
3419
3426
|
}]
|
|
3420
3427
|
},
|
|
3421
|
-
center:
|
|
3428
|
+
center: U,
|
|
3422
3429
|
// [lng, lat]
|
|
3423
3430
|
zoom: q,
|
|
3424
|
-
minZoom: 3,
|
|
3425
|
-
maxZoom: 18,
|
|
3431
|
+
minZoom: o.minZoom ?? 3,
|
|
3432
|
+
maxZoom: o.maxZoom ?? 18,
|
|
3426
3433
|
attributionControl: !1
|
|
3427
|
-
}),
|
|
3428
|
-
}),
|
|
3429
|
-
|
|
3430
|
-
const
|
|
3431
|
-
B =
|
|
3434
|
+
}), r("update:map", e), e.addControl(new maplibregl.NavigationControl(), "top-right"), e.on("zoom", () => {
|
|
3435
|
+
}), e.on("moveend", fe), e.on("zoomend", fe), T && K(), e.on("load", () => {
|
|
3436
|
+
e == null || e.resize(), m.value = !0;
|
|
3437
|
+
const ee = b.filter((J) => J.id).reduce((J, se) => [se.id, se.color].concat(J), []), le = ["match", ["get", o.colorAttr], ...ee, "#808080"];
|
|
3438
|
+
B = le, Yo(
|
|
3439
|
+
o.table,
|
|
3440
|
+
e,
|
|
3441
|
+
le,
|
|
3442
|
+
o.filter,
|
|
3443
|
+
o.clusterZoom
|
|
3444
|
+
), F(), z(o.modelValue), ue();
|
|
3432
3445
|
});
|
|
3433
|
-
const
|
|
3434
|
-
var
|
|
3435
|
-
const
|
|
3436
|
-
(se =
|
|
3446
|
+
const pe = (ee) => {
|
|
3447
|
+
var J, se;
|
|
3448
|
+
const le = (J = ee.features) == null ? void 0 : J[0];
|
|
3449
|
+
(se = le == null ? void 0 : le.properties) != null && se.id && r("update:modelValue", le.properties.id);
|
|
3437
3450
|
};
|
|
3438
|
-
x.forEach((
|
|
3439
|
-
|
|
3440
|
-
}),
|
|
3441
|
-
var
|
|
3442
|
-
const
|
|
3443
|
-
if (!
|
|
3444
|
-
const
|
|
3451
|
+
x.forEach((ee) => {
|
|
3452
|
+
e.on("click", ee, pe);
|
|
3453
|
+
}), e.on("click", Ae, (ee) => {
|
|
3454
|
+
var M, D, Q;
|
|
3455
|
+
const le = (M = ee.features) == null ? void 0 : M[0];
|
|
3456
|
+
if (!le) return;
|
|
3457
|
+
const J = le.geometry, se = (J == null ? void 0 : J.type) === "Point" ? J.coordinates : (Q = (D = J == null ? void 0 : J.coordinates) == null ? void 0 : D[0]) == null ? void 0 : Q[0];
|
|
3445
3458
|
if (!se) return;
|
|
3446
|
-
const
|
|
3447
|
-
|
|
3448
|
-
}), [...x,
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
}),
|
|
3452
|
-
|
|
3459
|
+
const Ce = Math.min(e.getZoom() + 2, e.getMaxZoom());
|
|
3460
|
+
e.easeTo({ center: se, zoom: Ce });
|
|
3461
|
+
}), [...x, Ae].forEach((ee) => {
|
|
3462
|
+
e.on("mouseenter", ee, () => {
|
|
3463
|
+
e.getCanvas().style.cursor = "pointer";
|
|
3464
|
+
}), e.on("mouseleave", ee, () => {
|
|
3465
|
+
e.getCanvas().style.cursor = "";
|
|
3453
3466
|
});
|
|
3454
|
-
}),
|
|
3455
|
-
var
|
|
3456
|
-
const
|
|
3457
|
-
if (!
|
|
3467
|
+
}), e.on("mousemove", (ee) => {
|
|
3468
|
+
var M;
|
|
3469
|
+
const le = e.queryRenderedFeatures(ee.point, { layers: x });
|
|
3470
|
+
if (!le || !le.length) {
|
|
3458
3471
|
c.remove();
|
|
3459
3472
|
return;
|
|
3460
3473
|
}
|
|
3461
|
-
const
|
|
3462
|
-
a.value =
|
|
3474
|
+
const J = le[0], { coordinates: se } = J.geometry, Ce = J.geometry.type === "Point" ? se : se[0][0];
|
|
3475
|
+
a.value = J.properties, c.setLngLat(Ce).setHTML((M = p.value) == null ? void 0 : M.innerHTML).addTo(e);
|
|
3463
3476
|
});
|
|
3464
|
-
}), j(() =>
|
|
3465
|
-
|
|
3466
|
-
}), j(() =>
|
|
3467
|
-
|
|
3477
|
+
}), j(() => o.center, ($) => {
|
|
3478
|
+
e && e.setCenter($ || s);
|
|
3479
|
+
}), j(() => o.zoom, ($) => {
|
|
3480
|
+
e && e.setZoom($);
|
|
3481
|
+
}), j(() => o.minZoom, ($) => {
|
|
3482
|
+
e && (e.setMinZoom($ ?? 3), ue());
|
|
3483
|
+
}), j(() => o.maxZoom, ($) => {
|
|
3484
|
+
e && (e.setMaxZoom($ ?? 18), ue());
|
|
3468
3485
|
});
|
|
3469
|
-
function ze($,
|
|
3470
|
-
if (!(
|
|
3471
|
-
const
|
|
3472
|
-
|
|
3473
|
-
$ ??
|
|
3474
|
-
|
|
3486
|
+
function ze($, R) {
|
|
3487
|
+
if (!(e != null && e.getSource("vector"))) return;
|
|
3488
|
+
const U = st(
|
|
3489
|
+
o.table,
|
|
3490
|
+
$ ?? o.filter,
|
|
3491
|
+
R ?? o.clusterZoom ?? 12
|
|
3475
3492
|
);
|
|
3476
|
-
|
|
3493
|
+
e.getSource("vector").setTiles([U]);
|
|
3477
3494
|
}
|
|
3478
|
-
return j(() =>
|
|
3495
|
+
return j(() => o.filter, ($) => {
|
|
3479
3496
|
ze($);
|
|
3480
|
-
}), j(() =>
|
|
3481
|
-
ze(void 0, $);
|
|
3482
|
-
}), j(() =>
|
|
3483
|
-
if (!
|
|
3484
|
-
const
|
|
3485
|
-
|
|
3486
|
-
}), j(y, ($,
|
|
3487
|
-
if (!
|
|
3488
|
-
const
|
|
3489
|
-
|
|
3490
|
-
|
|
3497
|
+
}), j(() => o.clusterZoom, ($) => {
|
|
3498
|
+
ze(void 0, $), ue();
|
|
3499
|
+
}), j(() => o.modelValue, ($) => {
|
|
3500
|
+
if (!e) return;
|
|
3501
|
+
const R = oe($);
|
|
3502
|
+
e.getLayer("vector-highlight-circle") && (e.setFilter("vector-highlight-circle", R), e.setLayoutProperty("vector-highlight-circle", "visibility", $ ? "visible" : "none")), e.getLayer("vector-highlight-fill") && (e.setFilter("vector-highlight-fill", R), e.setLayoutProperty("vector-highlight-fill", "visibility", $ ? "visible" : "none")), z($), $ ? H() : X();
|
|
3503
|
+
}), j(y, ($, R) => {
|
|
3504
|
+
if (!e || !$) return;
|
|
3505
|
+
const U = d.value.find((pe) => pe.id === $);
|
|
3506
|
+
if (!U) return;
|
|
3507
|
+
e.getLayer(R) && e.removeLayer(R), e.getSource(R) && e.removeSource(R), e.addSource($, { type: "raster", tiles: [U.url], tileSize: 256 });
|
|
3508
|
+
const q = e.getLayer("vector-clusters") ? "vector-clusters" : e.getLayer("vector-circle") ? "vector-circle" : void 0;
|
|
3509
|
+
e.addLayer({
|
|
3510
|
+
id: U.id,
|
|
3491
3511
|
type: "raster",
|
|
3492
|
-
source:
|
|
3512
|
+
source: U.id,
|
|
3493
3513
|
minzoom: 0,
|
|
3494
3514
|
maxzoom: 19
|
|
3495
|
-
},
|
|
3515
|
+
}, q);
|
|
3496
3516
|
}), Me(() => {
|
|
3497
|
-
|
|
3498
|
-
}), ($,
|
|
3499
|
-
const
|
|
3500
|
-
return
|
|
3517
|
+
X(), e && (e.off("moveend", fe), e.off("zoomend", fe), e.remove());
|
|
3518
|
+
}), ($, R) => {
|
|
3519
|
+
const U = ft("tooltip");
|
|
3520
|
+
return E((f(), w("div", Qo, [
|
|
3501
3521
|
l("div", {
|
|
3502
3522
|
ref_key: "mapContainer",
|
|
3503
3523
|
ref: h,
|
|
3504
3524
|
class: "map-container w-auto relative"
|
|
3505
3525
|
}, null, 512),
|
|
3506
|
-
|
|
3526
|
+
E((f(), w("button", {
|
|
3507
3527
|
type: "button",
|
|
3508
3528
|
class: "absolute top-25 right-2 z-20 h-8 w-8 flex items-center justify-center rounded-lg bg-white border border-gray-200 shadow-[0_8px_20px_rgba(0,0,0,0.08)] text-[18px] leading-none text-gray-700 hover:bg-gray-50",
|
|
3509
3529
|
title: "Повернутися до базового вигляду",
|
|
3510
|
-
onClick:
|
|
3530
|
+
onClick: ge
|
|
3511
3531
|
}, Jo)), [
|
|
3512
|
-
[
|
|
3532
|
+
[U, "Повернутися до базового вигляду"]
|
|
3513
3533
|
]),
|
|
3514
3534
|
l("div", Xo, [
|
|
3515
|
-
(f(!0), w(
|
|
3535
|
+
(f(!0), w(Z, null, ae(t(b), (q) => (f(), w("div", {
|
|
3516
3536
|
class: "legend-item",
|
|
3517
3537
|
key: q.id
|
|
3518
3538
|
}, [
|
|
3519
3539
|
l("div", er, [
|
|
3520
3540
|
l("div", {
|
|
3521
3541
|
class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
|
|
3522
|
-
style:
|
|
3542
|
+
style: Pe("background-color:" + q.color)
|
|
3523
3543
|
}, null, 4),
|
|
3524
3544
|
l("div", tr, O(q.text), 1)
|
|
3525
3545
|
])
|
|
@@ -3530,14 +3550,14 @@ const qo = [
|
|
|
3530
3550
|
ref: p,
|
|
3531
3551
|
style: { display: "none" }
|
|
3532
3552
|
}, [
|
|
3533
|
-
|
|
3553
|
+
ve($.$slots, "default", { hoverData: a.value })
|
|
3534
3554
|
], 512),
|
|
3535
3555
|
l("div", lr, [
|
|
3536
|
-
(f(!0), w(
|
|
3556
|
+
(f(!0), w(Z, null, ae(d.value, (q) => E((f(), w("div", {
|
|
3537
3557
|
key: q.id,
|
|
3538
3558
|
title: q.name,
|
|
3539
|
-
class:
|
|
3540
|
-
onClick: (
|
|
3559
|
+
class: I(["vs-map-slot-layers__layer relative", { focused: y.value === q.id }]),
|
|
3560
|
+
onClick: (pe) => y.value = q.id
|
|
3541
3561
|
}, [
|
|
3542
3562
|
l("img", {
|
|
3543
3563
|
src: q.preview || v(q.url),
|
|
@@ -3545,20 +3565,20 @@ const qo = [
|
|
|
3545
3565
|
}, null, 8, or),
|
|
3546
3566
|
l("div", rr, O(q.name), 1)
|
|
3547
3567
|
], 10, ar)), [
|
|
3548
|
-
[
|
|
3568
|
+
[U, q.name]
|
|
3549
3569
|
])), 128))
|
|
3550
3570
|
])
|
|
3551
3571
|
], 512)), [
|
|
3552
|
-
[
|
|
3572
|
+
[de, m.value]
|
|
3553
3573
|
]);
|
|
3554
3574
|
};
|
|
3555
3575
|
}
|
|
3556
3576
|
}), ut = {
|
|
3557
|
-
mounted(i,
|
|
3577
|
+
mounted(i, n) {
|
|
3558
3578
|
if (typeof document > "u") return;
|
|
3559
|
-
let
|
|
3560
|
-
const
|
|
3561
|
-
|
|
3579
|
+
let o = null;
|
|
3580
|
+
const r = () => {
|
|
3581
|
+
o = document.createElement("div"), o.textContent = n.value, Object.assign(o.style, {
|
|
3562
3582
|
position: "absolute",
|
|
3563
3583
|
background: "#333",
|
|
3564
3584
|
color: "#fff",
|
|
@@ -3568,18 +3588,18 @@ const qo = [
|
|
|
3568
3588
|
whiteSpace: "nowrap",
|
|
3569
3589
|
pointerEvents: "none",
|
|
3570
3590
|
zIndex: "9999"
|
|
3571
|
-
}), document.body.appendChild(
|
|
3591
|
+
}), document.body.appendChild(o);
|
|
3572
3592
|
const c = i.getBoundingClientRect();
|
|
3573
|
-
|
|
3574
|
-
},
|
|
3575
|
-
|
|
3593
|
+
o.style.left = `${c.left + window.scrollX}px`, o.style.top = `${c.top + window.scrollY - o.offsetHeight - 5}px`;
|
|
3594
|
+
}, e = () => {
|
|
3595
|
+
o && o.parentNode && (o.parentNode.removeChild(o), o = null);
|
|
3576
3596
|
};
|
|
3577
|
-
i.addEventListener("mouseenter",
|
|
3597
|
+
i.addEventListener("mouseenter", r), i.addEventListener("mouseleave", e), Object.assign(i, { tooltipHandlers: { showTooltip: r, hideTooltip: e } });
|
|
3578
3598
|
},
|
|
3579
3599
|
unmounted(i) {
|
|
3580
3600
|
if (typeof document > "u") return;
|
|
3581
|
-
const
|
|
3582
|
-
|
|
3601
|
+
const n = i.tooltipHandlers;
|
|
3602
|
+
n && (i.removeEventListener("mouseenter", n.showTooltip), i.removeEventListener("mouseleave", n.hideTooltip));
|
|
3583
3603
|
}
|
|
3584
3604
|
}, ir = { class: "pt-[20px]" }, sr = { class: "w-full gap-5 inline-flex mb-[6px] pr-3" }, ur = { class: "flex items-center" }, cr = ["title"], dr = /* @__PURE__ */ l("span", { class: "sr-only" }, "Відкрити мапу", -1), pr = { class: "max-[1000px]:flex gap-2 min-[1001px]:hidden" }, fr = { class: "flex" }, vr = {
|
|
3585
3605
|
key: 0,
|
|
@@ -3596,7 +3616,7 @@ const qo = [
|
|
|
3596
3616
|
}, kr = /* @__PURE__ */ l("h2", { class: "font-medium text-base text-gray-500 rounded-xl" }, " За вашим запитом даних не знайдено! ", -1), _r = /* @__PURE__ */ l("p", { class: "font-normal text-sm text-gray-500 rounded-xl" }, " Введіть, будь ласка, інші значення для пошуку. ", -1), Cr = { key: 1 }, Vr = {
|
|
3597
3617
|
key: 2,
|
|
3598
3618
|
class: "my-5 pr-2"
|
|
3599
|
-
}, Sr = { class: "flex justify-between" }, $r = { class: "w-full lg:w-1/2 relative" }, qe = /* @__PURE__ */
|
|
3619
|
+
}, Sr = { class: "flex justify-between" }, $r = { class: "w-full lg:w-1/2 relative" }, qe = /* @__PURE__ */ G({
|
|
3600
3620
|
__name: "vs-parts-map",
|
|
3601
3621
|
props: {
|
|
3602
3622
|
title: {},
|
|
@@ -3604,6 +3624,8 @@ const qo = [
|
|
|
3604
3624
|
map: {},
|
|
3605
3625
|
rows: {},
|
|
3606
3626
|
zoom: {},
|
|
3627
|
+
minZoom: { default: 3 },
|
|
3628
|
+
maxZoom: { default: 18 },
|
|
3607
3629
|
center: {},
|
|
3608
3630
|
initTotal: {},
|
|
3609
3631
|
colorAttr: {},
|
|
@@ -3615,122 +3637,122 @@ const qo = [
|
|
|
3615
3637
|
clusterZoom: { default: 12 }
|
|
3616
3638
|
},
|
|
3617
3639
|
emits: ["change:filter", "update:map"],
|
|
3618
|
-
setup(i, { emit:
|
|
3619
|
-
var ye,
|
|
3620
|
-
const
|
|
3621
|
-
|
|
3622
|
-
function
|
|
3640
|
+
setup(i, { emit: n }) {
|
|
3641
|
+
var pe, ye, ee, le, J, se, Ce;
|
|
3642
|
+
const o = Xe();
|
|
3643
|
+
o && !(o != null && o.appContext.directives.tooltip) && (o.appContext.directives.tooltip = ut);
|
|
3644
|
+
function r(M) {
|
|
3623
3645
|
return M ? (M.type === "Point" ? M.coordinates : null) || (M.type.includes("Multi") ? M.coordinates[0][0][0] : M.coordinates[0][0]) : null;
|
|
3624
3646
|
}
|
|
3625
|
-
const
|
|
3626
|
-
u.value =
|
|
3627
|
-
const h = V(""), m = V(null), x = V(!0), g = V(((
|
|
3647
|
+
const e = i, c = n, u = V(0);
|
|
3648
|
+
u.value = e.initTotal ?? ((pe = e.rows) == null ? void 0 : pe.length) ?? 0;
|
|
3649
|
+
const h = V(""), m = V(null), x = V(!0), g = V(((ye = e.rows) == null ? void 0 : ye.length) === 1), d = V(0), y = V(e.rows), _ = V(1), v = V(20), p = V(e.filters || []), a = V(""), C = V({}), b = V(((ee = e.rows) == null ? void 0 : ee.length) === 1 ? e.rows[0] : {}), s = V(((le = e.rows) == null ? void 0 : le.length) === 1 ? e.rows[0].id : ""), k = V(((J = e.rows) == null ? void 0 : J.length) === 1 ? r((se = e.rows[0]) == null ? void 0 : se.geom) : e.center || null), B = V(((Ce = e.rows) == null ? void 0 : Ce.length) === 1 ? 14 : e.zoom || 5), A = V(!1), L = V(!1), T = V("");
|
|
3628
3650
|
let K = !1;
|
|
3629
|
-
function
|
|
3630
|
-
return Object.entries(M).filter(([
|
|
3651
|
+
function fe(M) {
|
|
3652
|
+
return Object.entries(M).filter(([D, Q]) => Array.isArray(Q) ? Q.length : Q).map(([D, Q]) => `${D}=${Q}`).join("|");
|
|
3631
3653
|
}
|
|
3632
3654
|
function oe() {
|
|
3633
|
-
var
|
|
3634
|
-
if (!m.value || !
|
|
3635
|
-
const M = (
|
|
3655
|
+
var W, Ve, ce, re;
|
|
3656
|
+
if (!m.value || !L.value) return;
|
|
3657
|
+
const M = (Ve = (W = m.value).getBounds) == null ? void 0 : Ve.call(W);
|
|
3636
3658
|
if (!M) return;
|
|
3637
|
-
const
|
|
3638
|
-
!
|
|
3659
|
+
const D = (ce = M.getSouthWest) == null ? void 0 : ce.call(M), Q = (re = M.getNorthEast) == null ? void 0 : re.call(M);
|
|
3660
|
+
!D || !Q || (T.value = `${D.lng} ${D.lat},${Q.lng} ${Q.lat}`);
|
|
3639
3661
|
}
|
|
3640
|
-
async function
|
|
3641
|
-
await
|
|
3642
|
-
const
|
|
3643
|
-
a.value =
|
|
3662
|
+
async function F(M = !1) {
|
|
3663
|
+
await Re();
|
|
3664
|
+
const D = fe(C.value);
|
|
3665
|
+
a.value = D, L.value ? oe() : T.value = "";
|
|
3644
3666
|
try {
|
|
3645
|
-
const
|
|
3667
|
+
const Q = {
|
|
3646
3668
|
search: h.value,
|
|
3647
3669
|
limit: v.value.toString(),
|
|
3648
3670
|
page: _.value.toString(),
|
|
3649
|
-
filter:
|
|
3650
|
-
...
|
|
3651
|
-
},
|
|
3671
|
+
filter: D,
|
|
3672
|
+
...L.value && T.value ? { bbox: T.value } : {}
|
|
3673
|
+
}, W = new URL(`/api/data/${e.table}`, window.location.origin) + (s.value ? `/${s.value}` : ""), Ve = new URLSearchParams(Q).toString(), ce = await fetch(`${W.toString()}?${Ve}`).then((re) => re.json());
|
|
3652
3674
|
if (s.value) {
|
|
3653
3675
|
let re;
|
|
3654
|
-
|
|
3676
|
+
ce.rows.length > 1 ? re = ce.rows.find((ct) => ct.id === s.value) : [re] = ce.rows, b.value = re, M || (k.value = r(re == null ? void 0 : re.geom), B.value = 14), g.value = !0;
|
|
3655
3677
|
} else
|
|
3656
|
-
g.value = !1, A.value || (B.value =
|
|
3657
|
-
A.value = !1, u.value =
|
|
3658
|
-
} catch (
|
|
3659
|
-
console.error(
|
|
3678
|
+
g.value = !1, A.value || (B.value = e.zoom || 5), y.value = ce == null ? void 0 : ce.rows;
|
|
3679
|
+
A.value = !1, u.value = ce.filtered, Fa({ page: _.value, filter: D, id: s.value, filterByView: L.value });
|
|
3680
|
+
} catch (Q) {
|
|
3681
|
+
console.error(Q.message);
|
|
3660
3682
|
}
|
|
3661
3683
|
}
|
|
3662
|
-
const z =
|
|
3663
|
-
function
|
|
3664
|
-
!m.value || K || !
|
|
3684
|
+
const z = Ye(() => F(), 300), H = Ye(() => F(!0), 400);
|
|
3685
|
+
function X() {
|
|
3686
|
+
!m.value || K || !L.value || (m.value.on("moveend", H), m.value.on("zoomend", H), K = !0);
|
|
3665
3687
|
}
|
|
3666
|
-
function
|
|
3688
|
+
function ge() {
|
|
3667
3689
|
!m.value || !K || (m.value.off("moveend", H), m.value.off("zoomend", H), K = !1);
|
|
3668
3690
|
}
|
|
3669
|
-
function
|
|
3670
|
-
v.value = M, _.value = 1,
|
|
3691
|
+
function ue(M) {
|
|
3692
|
+
v.value = M, _.value = 1, F();
|
|
3671
3693
|
}
|
|
3672
|
-
function
|
|
3673
|
-
_.value = M,
|
|
3694
|
+
function Se(M) {
|
|
3695
|
+
_.value = M, F();
|
|
3674
3696
|
}
|
|
3675
|
-
function
|
|
3676
|
-
C.value = M.data, _.value = 1, s.value ? s.value = "" :
|
|
3697
|
+
function ze(M) {
|
|
3698
|
+
C.value = M.data, _.value = 1, s.value ? s.value = "" : F(), c("change:filter", M);
|
|
3677
3699
|
}
|
|
3678
|
-
async function
|
|
3679
|
-
if (
|
|
3680
|
-
const
|
|
3681
|
-
p.value =
|
|
3700
|
+
async function $() {
|
|
3701
|
+
if (e.filters) return;
|
|
3702
|
+
const D = await (await fetch(`/api/filter/${e.table}`)).json();
|
|
3703
|
+
p.value = D.list;
|
|
3682
3704
|
}
|
|
3683
|
-
function
|
|
3684
|
-
C.value = {}, h.value = "",
|
|
3705
|
+
function R() {
|
|
3706
|
+
C.value = {}, h.value = "", F();
|
|
3685
3707
|
}
|
|
3686
|
-
|
|
3687
|
-
var
|
|
3708
|
+
_e(async () => {
|
|
3709
|
+
var Q, W;
|
|
3688
3710
|
d.value = window.innerWidth, d.value < 1e3 && (x.value = !1);
|
|
3689
3711
|
const M = new URLSearchParams(window.location.search);
|
|
3690
3712
|
_.value = Number(M.get("page")) || 1, v.value = Number(M.get("limit")) || v.value, s.value = M.get("id") || "", g.value = !!s.value, a.value = M.get("filter") || "";
|
|
3691
|
-
const
|
|
3692
|
-
|
|
3693
|
-
const [
|
|
3694
|
-
|
|
3695
|
-
}),
|
|
3713
|
+
const D = M.get("bbox");
|
|
3714
|
+
D !== null ? L.value = D !== "0" : L.value = !1, (W = (Q = M.get("filter")) == null ? void 0 : Q.split("|")) == null || W.forEach((Ve) => {
|
|
3715
|
+
const [ce, re] = Ve.split("=");
|
|
3716
|
+
ce && (C.value[ce] = re != null && re.includes(",") ? re.split(",") : [re]);
|
|
3717
|
+
}), $(), !y.value && !s.value && F();
|
|
3696
3718
|
}), Me(() => {
|
|
3697
|
-
|
|
3719
|
+
ge();
|
|
3698
3720
|
});
|
|
3699
|
-
function
|
|
3721
|
+
function U() {
|
|
3700
3722
|
A.value = !0, g.value = !1, b.value = null, s.value = "";
|
|
3701
3723
|
}
|
|
3702
|
-
function
|
|
3703
|
-
M != null && M.geom && (k.value =
|
|
3724
|
+
function q(M) {
|
|
3725
|
+
M != null && M.geom && (k.value = r(M.geom), B.value = 16), b.value = M, s.value = M.id;
|
|
3704
3726
|
}
|
|
3705
3727
|
return j(m, (M) => {
|
|
3706
|
-
c("update:map", M), M &&
|
|
3728
|
+
c("update:map", M), M && L.value && X();
|
|
3707
3729
|
}), j(h, (M) => {
|
|
3708
|
-
M ||
|
|
3730
|
+
M || F();
|
|
3709
3731
|
}), j(s, () => {
|
|
3710
|
-
|
|
3711
|
-
}), j(
|
|
3712
|
-
|
|
3713
|
-
}), (M,
|
|
3714
|
-
var
|
|
3732
|
+
F();
|
|
3733
|
+
}), j(L, () => {
|
|
3734
|
+
L.value ? X() : ge(), F();
|
|
3735
|
+
}), (M, D) => {
|
|
3736
|
+
var Q;
|
|
3715
3737
|
return f(), w("section", ir, [
|
|
3716
|
-
|
|
3717
|
-
title:
|
|
3738
|
+
ve(M.$slots, "header", {
|
|
3739
|
+
title: e.title,
|
|
3718
3740
|
total: u.value
|
|
3719
3741
|
}),
|
|
3720
3742
|
l("div", sr, [
|
|
3721
|
-
Y(
|
|
3743
|
+
Y(t(we), {
|
|
3722
3744
|
type: "text",
|
|
3723
3745
|
modelValue: h.value,
|
|
3724
|
-
"onUpdate:modelValue":
|
|
3746
|
+
"onUpdate:modelValue": D[0] || (D[0] = (W) => h.value = W),
|
|
3725
3747
|
name: "search",
|
|
3726
3748
|
label: "Пошук",
|
|
3727
|
-
onChange:
|
|
3749
|
+
onChange: t(z)
|
|
3728
3750
|
}, null, 8, ["modelValue", "onChange"]),
|
|
3729
|
-
p.value.length ? (f(), P(
|
|
3751
|
+
p.value.length ? (f(), P(t(De), {
|
|
3730
3752
|
key: 0,
|
|
3731
3753
|
schema: p.value,
|
|
3732
3754
|
view: "inline",
|
|
3733
|
-
onChange:
|
|
3755
|
+
onChange: ze,
|
|
3734
3756
|
limit: 5,
|
|
3735
3757
|
value: C.value,
|
|
3736
3758
|
ref: "filterRef"
|
|
@@ -3740,20 +3762,20 @@ const qo = [
|
|
|
3740
3762
|
type: "button",
|
|
3741
3763
|
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",
|
|
3742
3764
|
title: x.value ? "Приховати карту" : "Показати карту",
|
|
3743
|
-
onClick:
|
|
3765
|
+
onClick: D[1] || (D[1] = (W) => x.value = !x.value)
|
|
3744
3766
|
}, [
|
|
3745
3767
|
x.value ? (f(), P(xo, { key: 0 })) : (f(), P(Bo, { key: 1 })),
|
|
3746
3768
|
dr
|
|
3747
3769
|
], 8, cr),
|
|
3748
3770
|
l("div", pr, [
|
|
3749
3771
|
l("button", {
|
|
3750
|
-
onClick:
|
|
3772
|
+
onClick: D[2] || (D[2] = (W) => x.value = !1),
|
|
3751
3773
|
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"
|
|
3752
3774
|
}, [
|
|
3753
|
-
Y(
|
|
3775
|
+
Y(Wo)
|
|
3754
3776
|
]),
|
|
3755
3777
|
l("button", {
|
|
3756
|
-
onClick:
|
|
3778
|
+
onClick: D[3] || (D[3] = (W) => x.value = !0),
|
|
3757
3779
|
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"
|
|
3758
3780
|
}, [
|
|
3759
3781
|
Y(Ko)
|
|
@@ -3763,34 +3785,34 @@ const qo = [
|
|
|
3763
3785
|
]),
|
|
3764
3786
|
l("div", fr, [
|
|
3765
3787
|
l("div", {
|
|
3766
|
-
class:
|
|
3788
|
+
class: I([
|
|
3767
3789
|
"relative overflow-hidden shrink-0",
|
|
3768
3790
|
x.value ? "w-2/4 mr-0" : "w-full mr-3",
|
|
3769
3791
|
g.value ? "hidden" : ""
|
|
3770
3792
|
])
|
|
3771
3793
|
}, [
|
|
3772
|
-
(
|
|
3794
|
+
(Q = M.$slots) != null && Q.header ? S("", !0) : (f(), w("div", vr, [
|
|
3773
3795
|
l("div", null, [
|
|
3774
|
-
l("span", mr, O(
|
|
3796
|
+
l("span", mr, O(e.title), 1),
|
|
3775
3797
|
l("span", hr, O(u.value), 1),
|
|
3776
3798
|
gr
|
|
3777
3799
|
]),
|
|
3778
|
-
|
|
3779
|
-
|
|
3800
|
+
e.objectsInView ? (f(), w("label", yr, [
|
|
3801
|
+
E(l("input", {
|
|
3780
3802
|
type: "checkbox",
|
|
3781
3803
|
class: "accent-blue-600 w-4 h-4",
|
|
3782
|
-
"onUpdate:modelValue":
|
|
3804
|
+
"onUpdate:modelValue": D[4] || (D[4] = (W) => L.value = W)
|
|
3783
3805
|
}, null, 512), [
|
|
3784
|
-
[vt,
|
|
3806
|
+
[vt, L.value]
|
|
3785
3807
|
]),
|
|
3786
3808
|
br
|
|
3787
3809
|
])) : S("", !0)
|
|
3788
3810
|
])),
|
|
3789
3811
|
l("div", xr, [
|
|
3790
|
-
u.value >= 1 ?
|
|
3812
|
+
u.value >= 1 ? ve(M.$slots, "table", {
|
|
3791
3813
|
key: 0,
|
|
3792
3814
|
rows: y.value,
|
|
3793
|
-
selectRow:
|
|
3815
|
+
selectRow: q
|
|
3794
3816
|
}) : (f(), w("div", wr, [
|
|
3795
3817
|
Y(co),
|
|
3796
3818
|
kr,
|
|
@@ -3798,7 +3820,7 @@ const qo = [
|
|
|
3798
3820
|
l("button", {
|
|
3799
3821
|
type: "button",
|
|
3800
3822
|
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",
|
|
3801
|
-
onClick:
|
|
3823
|
+
onClick: R
|
|
3802
3824
|
}, " Очистити дані пошуку ")
|
|
3803
3825
|
]))
|
|
3804
3826
|
]),
|
|
@@ -3809,51 +3831,53 @@ const qo = [
|
|
|
3809
3831
|
total: u.value,
|
|
3810
3832
|
currentPage: _.value ?? 1,
|
|
3811
3833
|
pageSize: v.value,
|
|
3812
|
-
onPageChange:
|
|
3813
|
-
onPageSizeChange:
|
|
3834
|
+
onPageChange: D[5] || (D[5] = (W) => Se(W)),
|
|
3835
|
+
onPageSizeChange: D[6] || (D[6] = (W) => ue(W))
|
|
3814
3836
|
}, null, 8, ["total", "currentPage", "pageSize"])
|
|
3815
3837
|
])
|
|
3816
3838
|
])) : S("", !0)
|
|
3817
3839
|
], 2),
|
|
3818
3840
|
g.value ? (f(), w("div", {
|
|
3819
3841
|
key: 0,
|
|
3820
|
-
class:
|
|
3842
|
+
class: I(
|
|
3821
3843
|
x.value ? "lg:static lg:w-1/2 mr-0 pb-5" : "pb-5 mr-3"
|
|
3822
3844
|
),
|
|
3823
3845
|
style: { height: "calc(100vh - 152px)" }
|
|
3824
3846
|
}, [
|
|
3825
|
-
|
|
3826
|
-
table:
|
|
3847
|
+
ve(M.$slots, "details", {
|
|
3848
|
+
table: e.table,
|
|
3827
3849
|
selectedRow: b.value,
|
|
3828
|
-
closeObjCard:
|
|
3850
|
+
closeObjCard: U
|
|
3829
3851
|
})
|
|
3830
3852
|
], 2)) : S("", !0),
|
|
3831
|
-
|
|
3853
|
+
E(l("div", $r, [
|
|
3832
3854
|
Y(nr, {
|
|
3833
|
-
table:
|
|
3855
|
+
table: e.table,
|
|
3834
3856
|
map: m.value,
|
|
3835
|
-
"onUpdate:map":
|
|
3857
|
+
"onUpdate:map": D[7] || (D[7] = (W) => m.value = W),
|
|
3836
3858
|
zoom: B.value,
|
|
3837
|
-
|
|
3859
|
+
minZoom: e.minZoom,
|
|
3860
|
+
maxZoom: e.maxZoom,
|
|
3861
|
+
colorAttr: e.colorAttr,
|
|
3838
3862
|
filter: a.value,
|
|
3839
3863
|
center: k.value,
|
|
3840
|
-
clusterZoom:
|
|
3864
|
+
clusterZoom: e.clusterZoom,
|
|
3841
3865
|
modelValue: s.value,
|
|
3842
|
-
"onUpdate:modelValue":
|
|
3843
|
-
layers:
|
|
3866
|
+
"onUpdate:modelValue": D[8] || (D[8] = (W) => s.value = W),
|
|
3867
|
+
layers: e.layers
|
|
3844
3868
|
}, {
|
|
3845
|
-
default:
|
|
3846
|
-
|
|
3869
|
+
default: xe(({ hoverData: W }) => [
|
|
3870
|
+
ve(M.$slots, "popup", { data: W })
|
|
3847
3871
|
]),
|
|
3848
3872
|
_: 3
|
|
3849
|
-
}, 8, ["table", "map", "zoom", "colorAttr", "filter", "center", "clusterZoom", "modelValue", "layers"]),
|
|
3850
|
-
|
|
3851
|
-
table:
|
|
3873
|
+
}, 8, ["table", "map", "zoom", "minZoom", "maxZoom", "colorAttr", "filter", "center", "clusterZoom", "modelValue", "layers"]),
|
|
3874
|
+
ve(M.$slots, "default", {
|
|
3875
|
+
table: e.table,
|
|
3852
3876
|
map: m.value,
|
|
3853
3877
|
selectedRow: b.value
|
|
3854
3878
|
})
|
|
3855
3879
|
], 512), [
|
|
3856
|
-
[
|
|
3880
|
+
[de, x.value]
|
|
3857
3881
|
])
|
|
3858
3882
|
])
|
|
3859
3883
|
]);
|