@opengis/partsmap 0.1.21 → 0.1.22
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 +421 -407
- package/dist/index.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as te, reactive as yt, createApp as
|
|
1
|
+
import { defineComponent as te, reactive as yt, createApp as St, h as At, createElementBlock as h, openBlock as p, createElementVNode as l, createBlock as W, resolveDynamicComponent as _e, toDisplayString as j, ref as V, watch as E, nextTick as Ee, useSlots as Oe, toRaw as De, mergeProps as pe, createSlots as $t, withCtx as Ve, renderSlot as be, unref as e, normalizeProps as jt, guardReactiveProps as zt, computed as O, createCommentVNode as B, Fragment as N, renderList as ne, normalizeClass as H, onMounted as Fe, onBeforeUnmount as Te, withKeys as st, withModifiers as je, createVNode as ee, Teleport as Qe, normalizeStyle as ze, getCurrentInstance as Xe, cloneVNode as Ft, withDirectives as le, vShow as me, createTextVNode as se, isRef as Rt, vModelText as Ae, createStaticVNode as Je, resolveDirective as Pt, vModelCheckbox as Zt } from "vue";
|
|
2
2
|
const Ne = (c, a) => {
|
|
3
3
|
const o = c.__vccOpts || c;
|
|
4
4
|
for (const [r, t] of a)
|
|
@@ -46,7 +46,7 @@ te({
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
const
|
|
49
|
+
const Kt = {}, Dt = {
|
|
50
50
|
xmlns: "http://www.w3.org/2000/svg",
|
|
51
51
|
fill: "none",
|
|
52
52
|
viewBox: "0 0 24 24",
|
|
@@ -63,7 +63,7 @@ function Et(c, a) {
|
|
|
63
63
|
}, null, -1)
|
|
64
64
|
]));
|
|
65
65
|
}
|
|
66
|
-
const Tt = /* @__PURE__ */ Ne(
|
|
66
|
+
const Tt = /* @__PURE__ */ Ne(Kt, [["render", Et]]), It = {}, Ut = {
|
|
67
67
|
xmlns: "http://www.w3.org/2000/svg",
|
|
68
68
|
fill: "none",
|
|
69
69
|
viewBox: "0 0 24 24",
|
|
@@ -161,7 +161,7 @@ const Jt = /* @__PURE__ */ Ne(Yt, [["render", Xt]]), el = { class: "rounded-md b
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
yt({ visible: !0 });
|
|
164
|
-
const
|
|
164
|
+
const We = {
|
|
165
165
|
top: "top-4 left-1/2 transform -translate-x-1/2",
|
|
166
166
|
"left-bottom": "bottom-4 left-4 transform",
|
|
167
167
|
"right-bottom": "bottom-4 right-4 transform",
|
|
@@ -175,12 +175,12 @@ const He = {
|
|
|
175
175
|
position: t = "right-bottom"
|
|
176
176
|
} = c || {};
|
|
177
177
|
let i = document.querySelector("#notify-root");
|
|
178
|
-
i || (i = document.createElement("div"), i.id = "notify-root", i.className = `fixed z-[2000] flex flex-col gap-3 ${
|
|
178
|
+
i || (i = document.createElement("div"), i.id = "notify-root", i.className = `fixed z-[2000] flex flex-col gap-3 ${We[t]} p-6 max-w-md mx-auto font-sans antialiased`, document.body.appendChild(i)), i.className.includes(We[t]) || (Object.values(We).forEach((k) => {
|
|
179
179
|
i.classList.remove(...k.split(" "));
|
|
180
|
-
}), i.classList.add(...
|
|
180
|
+
}), i.classList.add(...We[t].split(" ")));
|
|
181
181
|
const g = document.createElement("div");
|
|
182
182
|
i.appendChild(g);
|
|
183
|
-
const u =
|
|
183
|
+
const u = St({
|
|
184
184
|
render() {
|
|
185
185
|
return At(rl, {
|
|
186
186
|
type: a,
|
|
@@ -289,7 +289,7 @@ const Se = /* @__PURE__ */ Ce(cl, [["render", pl]]), fl = { class: "flex items-c
|
|
|
289
289
|
["inline", "popover"].includes(f.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",
|
|
290
290
|
{ "bg-blue-100": f.highlighted, relative: u.value }
|
|
291
291
|
]),
|
|
292
|
-
onClick:
|
|
292
|
+
onClick: je(i, ["stop", "prevent"])
|
|
293
293
|
}, [
|
|
294
294
|
u.value ? B("", !0) : (p(), h("div", {
|
|
295
295
|
key: 0,
|
|
@@ -331,7 +331,7 @@ function tt(c, a) {
|
|
|
331
331
|
}
|
|
332
332
|
const i = V(t(c.modelValue)), g = V(""), u = V(!1), f = V([]), k = V("id"), m = V("text"), v = V(!1), y = V(c.layout !== "popover" && o.length > r);
|
|
333
333
|
function b(w) {
|
|
334
|
-
const x = w.find(Boolean) ?? {}, R = ["id", "value", "code", "key"].find((
|
|
334
|
+
const x = w.find(Boolean) ?? {}, R = ["id", "value", "code", "key"].find((L) => L in x) ?? "id", z = ["text", "label", "name", "title"].find((L) => L in x) ?? "text";
|
|
335
335
|
return { autoValueKey: R, autoLabelKey: z };
|
|
336
336
|
}
|
|
337
337
|
if (o.length > 0) {
|
|
@@ -418,7 +418,7 @@ const qe = /* @__PURE__ */ Ce(Cl, [["render", Vl]]), Ml = {}, Bl = {
|
|
|
418
418
|
"stroke-linejoin": "round",
|
|
419
419
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
|
|
420
420
|
};
|
|
421
|
-
function
|
|
421
|
+
function Ll(c, a) {
|
|
422
422
|
return p(), h("svg", Bl, a[0] || (a[0] = [
|
|
423
423
|
l("path", {
|
|
424
424
|
stroke: "none",
|
|
@@ -428,7 +428,7 @@ function Sl(c, a) {
|
|
|
428
428
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
429
429
|
]));
|
|
430
430
|
}
|
|
431
|
-
const ot = /* @__PURE__ */ Ce(Ml, [["render",
|
|
431
|
+
const ot = /* @__PURE__ */ Ce(Ml, [["render", Ll]]), Sl = {
|
|
432
432
|
key: 0,
|
|
433
433
|
class: "w-full"
|
|
434
434
|
}, Al = { class: "flex flex-col items-center justify-center p-5 text-center" }, $l = {
|
|
@@ -513,7 +513,7 @@ const ot = /* @__PURE__ */ Ce(Ml, [["render", Sl]]), Ll = {
|
|
|
513
513
|
onItemClick: (R) => e(k)(x)
|
|
514
514
|
}, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
|
|
515
515
|
], 2),
|
|
516
|
-
d.type === "select" && e(u).length === 0 && !e(y) ? (p(), h("div",
|
|
516
|
+
d.type === "select" && e(u).length === 0 && !e(y) ? (p(), h("div", Sl, [
|
|
517
517
|
l("div", Al, [
|
|
518
518
|
ee(lt),
|
|
519
519
|
w[4] || (w[4] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
@@ -577,7 +577,7 @@ function xt(c, a) {
|
|
|
577
577
|
}
|
|
578
578
|
const i = V(t(c.modelValue)), g = V(""), u = V(!1), f = V([]), k = V("id"), m = V("text"), v = V(!1), y = V(c.layout !== "popover" && o.length > r);
|
|
579
579
|
function b(w) {
|
|
580
|
-
const x = w.find(Boolean) ?? {}, R = ["id", "value", "code", "key"].find((
|
|
580
|
+
const x = w.find(Boolean) ?? {}, R = ["id", "value", "code", "key"].find((L) => L in x) ?? "id", z = ["text", "label", "name", "title"].find((L) => L in x) ?? "text";
|
|
581
581
|
return { autoValueKey: R, autoLabelKey: z };
|
|
582
582
|
}
|
|
583
583
|
if (o.length > 0) {
|
|
@@ -680,7 +680,7 @@ function Me() {
|
|
|
680
680
|
const Fl = {
|
|
681
681
|
key: 0,
|
|
682
682
|
class: "w-full"
|
|
683
|
-
}, Rl = { class: "flex flex-col items-center justify-center p-5 text-center" }, Pl = { class: "max-w-sm mx-auto mt-6" },
|
|
683
|
+
}, Rl = { class: "flex flex-col items-center justify-center p-5 text-center" }, Pl = { class: "max-w-sm mx-auto mt-6" }, Zl = { class: "font-medium text-gray-800 dark:text-neutral-200" }, Kl = {
|
|
684
684
|
key: 0,
|
|
685
685
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
686
686
|
}, Dl = {
|
|
@@ -764,7 +764,7 @@ const Fl = {
|
|
|
764
764
|
l("div", Rl, [
|
|
765
765
|
ee(lt),
|
|
766
766
|
l("div", Pl, [
|
|
767
|
-
l("p",
|
|
767
|
+
l("p", Zl, j(e(r)("filter.notfound")), 1),
|
|
768
768
|
w[4] || (w[4] = l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
769
769
|
])
|
|
770
770
|
])
|
|
@@ -790,7 +790,7 @@ const Fl = {
|
|
|
790
790
|
])) : B("", !0)
|
|
791
791
|
], 64)) : B("", !0),
|
|
792
792
|
d.cleanable ? (p(), h(N, { key: 2 }, [
|
|
793
|
-
d.layout === "inline" ? (p(), h("div",
|
|
793
|
+
d.layout === "inline" ? (p(), h("div", Kl, [
|
|
794
794
|
se(j(e(g).length) + " / " + j(e(n).length) + " " + j(e(r)("filter.selected")) + " ", 1),
|
|
795
795
|
le(l("button", {
|
|
796
796
|
class: "text-gray-600 hover:text-gray-800",
|
|
@@ -939,7 +939,7 @@ const Wl = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
|
|
|
939
939
|
placeholder: r.value,
|
|
940
940
|
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-sm 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"
|
|
941
941
|
}, null, 40, Nl), [
|
|
942
|
-
[
|
|
942
|
+
[Ae, i.value]
|
|
943
943
|
])
|
|
944
944
|
], 2));
|
|
945
945
|
}
|
|
@@ -1036,7 +1036,7 @@ const Ql = {
|
|
|
1036
1036
|
"onUpdate:modelValue": b[0] || (b[0] = (s) => k.value[0] = s),
|
|
1037
1037
|
disabled: y.disabled
|
|
1038
1038
|
}, null, 10, Xl), [
|
|
1039
|
-
[
|
|
1039
|
+
[Ae, k.value[0]]
|
|
1040
1040
|
])
|
|
1041
1041
|
]),
|
|
1042
1042
|
y.layout === "vertical" ? (p(), h("label", Jl, " - ")) : B("", !0),
|
|
@@ -1053,7 +1053,7 @@ const Ql = {
|
|
|
1053
1053
|
"onUpdate:modelValue": b[1] || (b[1] = (s) => k.value[1] = s),
|
|
1054
1054
|
disabled: y.disabled
|
|
1055
1055
|
}, null, 10, to), [
|
|
1056
|
-
[
|
|
1056
|
+
[Ae, k.value[1]]
|
|
1057
1057
|
])
|
|
1058
1058
|
]),
|
|
1059
1059
|
["popover", "inline", "vertical"].includes(y.layout) ? (p(), h("button", {
|
|
@@ -1358,7 +1358,7 @@ const ao = {
|
|
|
1358
1358
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600",
|
|
1359
1359
|
disabled: C.disabled
|
|
1360
1360
|
}, null, 8, no), [
|
|
1361
|
-
[
|
|
1361
|
+
[Ae, e(m)[0]]
|
|
1362
1362
|
]),
|
|
1363
1363
|
le(l("input", {
|
|
1364
1364
|
type: "date",
|
|
@@ -1368,7 +1368,7 @@ const ao = {
|
|
|
1368
1368
|
class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-sm focus:outline-blue-600 appearance-auto",
|
|
1369
1369
|
disabled: C.disabled
|
|
1370
1370
|
}, null, 8, io), [
|
|
1371
|
-
[
|
|
1371
|
+
[Ae, e(m)[1]]
|
|
1372
1372
|
])
|
|
1373
1373
|
])) : B("", !0)
|
|
1374
1374
|
])) : B("", !0),
|
|
@@ -1387,7 +1387,7 @@ const ao = {
|
|
|
1387
1387
|
class: H(e(t)),
|
|
1388
1388
|
disabled: C.disabled
|
|
1389
1389
|
}, null, 10, uo), [
|
|
1390
|
-
[
|
|
1390
|
+
[Ae, e(m)[0]]
|
|
1391
1391
|
])
|
|
1392
1392
|
], 2),
|
|
1393
1393
|
C.layout !== "popover" ? (p(), h("label", co, " - ")) : B("", !0),
|
|
@@ -1403,7 +1403,7 @@ const ao = {
|
|
|
1403
1403
|
class: H(e(t)),
|
|
1404
1404
|
disabled: C.disabled
|
|
1405
1405
|
}, null, 10, fo), [
|
|
1406
|
-
[
|
|
1406
|
+
[Ae, e(m)[1]]
|
|
1407
1407
|
])
|
|
1408
1408
|
], 2)
|
|
1409
1409
|
], 2),
|
|
@@ -1495,7 +1495,7 @@ function ho(c, a) {
|
|
|
1495
1495
|
function z(M) {
|
|
1496
1496
|
return g && Array.isArray(f.value) ? f.value.includes(M[y.value]) : f.value && f.value === M[y.value];
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function L(M) {
|
|
1499
1499
|
if (g && !Array.isArray(f.value) && (f.value = []), g && Array.isArray(f.value)) {
|
|
1500
1500
|
const I = f.value.includes(M[y.value]);
|
|
1501
1501
|
f.value = I ? f.value.filter((q) => q !== M[y.value]) : [...f.value, M[y.value]], s.value = I ? s.value.filter((q) => q !== M[b.value]) : [...s.value, M[b.value]];
|
|
@@ -1506,28 +1506,28 @@ function ho(c, a) {
|
|
|
1506
1506
|
function F() {
|
|
1507
1507
|
g ? (f.value = [], s.value = []) : (f.value = void 0, s.value = []), a("update:modelValue", f.value), a("clear", c.name);
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function Z() {
|
|
1510
1510
|
x && clearTimeout(x), k.value = "", _.value = !1;
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function A() {
|
|
1513
1513
|
_.value = !_.value;
|
|
1514
1514
|
}
|
|
1515
|
-
|
|
1515
|
+
Te(() => {
|
|
1516
1516
|
x && clearTimeout(x);
|
|
1517
1517
|
});
|
|
1518
|
-
const
|
|
1518
|
+
const D = V(-1);
|
|
1519
1519
|
E(w, () => {
|
|
1520
|
-
|
|
1520
|
+
D.value = w.value.length > 0 ? 0 : -1;
|
|
1521
1521
|
});
|
|
1522
1522
|
function Y(M) {
|
|
1523
1523
|
const I = w.value.length;
|
|
1524
1524
|
if (M.key === "ArrowDown")
|
|
1525
|
-
M.preventDefault(),
|
|
1525
|
+
M.preventDefault(), D.value = (D.value + 1) % I;
|
|
1526
1526
|
else if (M.key === "ArrowUp")
|
|
1527
|
-
M.preventDefault(),
|
|
1528
|
-
else if (M.key === "Enter" && (M.preventDefault(),
|
|
1529
|
-
const q = w.value[
|
|
1530
|
-
|
|
1527
|
+
M.preventDefault(), D.value = (D.value - 1 + I) % I;
|
|
1528
|
+
else if (M.key === "Enter" && (M.preventDefault(), D.value >= 0 && D.value < w.value.length)) {
|
|
1529
|
+
const q = w.value[D.value];
|
|
1530
|
+
L(q);
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
function T() {
|
|
@@ -1538,17 +1538,17 @@ function ho(c, a) {
|
|
|
1538
1538
|
searchTerm: k,
|
|
1539
1539
|
filteredOptions: w,
|
|
1540
1540
|
isSelected: z,
|
|
1541
|
-
selectItem:
|
|
1541
|
+
selectItem: L,
|
|
1542
1542
|
clear: F,
|
|
1543
|
-
resetSearch:
|
|
1544
|
-
toggleShowAll:
|
|
1543
|
+
resetSearch: Z,
|
|
1544
|
+
toggleShowAll: A,
|
|
1545
1545
|
isReqProc: m,
|
|
1546
1546
|
showAll: _,
|
|
1547
1547
|
isEnableShowAll: C,
|
|
1548
1548
|
labelKey: b,
|
|
1549
1549
|
valueKey: y,
|
|
1550
1550
|
allOptions: v,
|
|
1551
|
-
highlightedIndex:
|
|
1551
|
+
highlightedIndex: D,
|
|
1552
1552
|
onKeyDown: Y,
|
|
1553
1553
|
selectedLabels: s,
|
|
1554
1554
|
totalCount: n,
|
|
@@ -1611,43 +1611,43 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1611
1611
|
highlightedIndex: x,
|
|
1612
1612
|
onKeyDown: R,
|
|
1613
1613
|
selectedLabels: z,
|
|
1614
|
-
totalCount:
|
|
1614
|
+
totalCount: L,
|
|
1615
1615
|
loadData: F
|
|
1616
1616
|
} = ho({
|
|
1617
1617
|
...t,
|
|
1618
1618
|
modelValue: t.modelValue
|
|
1619
1619
|
}, i);
|
|
1620
|
-
|
|
1620
|
+
Fe(() => {
|
|
1621
1621
|
y(), t.layout !== "inline" && (F(), g.value && t.layout === "popover" && g.value.focus());
|
|
1622
1622
|
}), E(
|
|
1623
1623
|
() => t.modelValue,
|
|
1624
|
-
(
|
|
1625
|
-
|
|
1624
|
+
(A) => {
|
|
1625
|
+
A === void 0 && (t.multi ? u.value = [] : u.value = void 0);
|
|
1626
1626
|
}
|
|
1627
1627
|
);
|
|
1628
|
-
const
|
|
1629
|
-
return E(x, (
|
|
1630
|
-
var
|
|
1631
|
-
|
|
1628
|
+
const Z = V([]);
|
|
1629
|
+
return E(x, (A) => {
|
|
1630
|
+
var D;
|
|
1631
|
+
A >= 0 && Z.value[A] && ((D = Z.value[A]) == null || D.scrollIntoView({
|
|
1632
1632
|
block: "nearest",
|
|
1633
1633
|
behavior: "smooth"
|
|
1634
1634
|
}));
|
|
1635
1635
|
}), E(f, () => {
|
|
1636
|
-
|
|
1636
|
+
Z.value = [];
|
|
1637
1637
|
}), a({
|
|
1638
1638
|
clear: v,
|
|
1639
1639
|
inputTextRef: g,
|
|
1640
1640
|
selectedLabels: z,
|
|
1641
1641
|
loadData: F
|
|
1642
|
-
}), (
|
|
1642
|
+
}), (A, D) => {
|
|
1643
1643
|
var Y, T;
|
|
1644
1644
|
return p(), h("div", {
|
|
1645
|
-
class: H([
|
|
1645
|
+
class: H([A.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
|
|
1646
1646
|
}, [
|
|
1647
1647
|
l("div", yo, [
|
|
1648
1648
|
le(l("input", {
|
|
1649
|
-
"onUpdate:modelValue":
|
|
1650
|
-
onKeydown:
|
|
1649
|
+
"onUpdate:modelValue": D[0] || (D[0] = (M) => Rt(n) ? n.value = M : null),
|
|
1650
|
+
onKeydown: D[1] || (D[1] = //@ts-ignore
|
|
1651
1651
|
(...M) => e(R) && e(R)(...M)),
|
|
1652
1652
|
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 text-gray-700",
|
|
1653
1653
|
placeholder: e(r)("filter.search"),
|
|
@@ -1655,48 +1655,48 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1655
1655
|
ref_key: "inputTextRef",
|
|
1656
1656
|
ref: g
|
|
1657
1657
|
}, null, 40, xo), [
|
|
1658
|
-
[
|
|
1658
|
+
[Ae, e(n)]
|
|
1659
1659
|
]),
|
|
1660
1660
|
ee(bt, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
|
|
1661
1661
|
e(n) != "" ? (p(), W(at, {
|
|
1662
1662
|
key: 0,
|
|
1663
|
-
onClick:
|
|
1663
|
+
onClick: D[2] || (D[2] = (M) => n.value = ""),
|
|
1664
1664
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
1665
1665
|
})) : B("", !0)
|
|
1666
1666
|
]),
|
|
1667
1667
|
l("div", {
|
|
1668
1668
|
class: H([
|
|
1669
|
-
|
|
1670
|
-
|
|
1669
|
+
A.layout === "popover" ? "flex-1 overflow-y-auto p-2" : "",
|
|
1670
|
+
A.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
|
|
1671
1671
|
])
|
|
1672
1672
|
}, [
|
|
1673
1673
|
(p(!0), h(N, null, ne(e(f), (M, I) => (p(), W(et, {
|
|
1674
|
-
layout:
|
|
1674
|
+
layout: A.layout,
|
|
1675
1675
|
count: M.count,
|
|
1676
1676
|
label: M[e(d)],
|
|
1677
1677
|
color: M.color,
|
|
1678
|
-
type:
|
|
1678
|
+
type: A.multi ? "checkbox" : "radio",
|
|
1679
1679
|
value: M[e(w)],
|
|
1680
1680
|
"is-selected": e(k)(M),
|
|
1681
1681
|
highlighted: I === e(x),
|
|
1682
1682
|
onItemClick: (q) => e(m)(M),
|
|
1683
1683
|
ref_for: !0,
|
|
1684
|
-
ref: (q) =>
|
|
1684
|
+
ref: (q) => Z.value[I] = q == null ? void 0 : q.el
|
|
1685
1685
|
}, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
|
|
1686
1686
|
], 2),
|
|
1687
|
-
|
|
1687
|
+
A.type === "select" && e(f).length === 0 && !e(_) ? (p(), h("div", bo, [
|
|
1688
1688
|
l("div", wo, [
|
|
1689
1689
|
ee(lt),
|
|
1690
1690
|
l("div", ko, [
|
|
1691
1691
|
l("p", Co, j(e(r)("filter.notfound")), 1),
|
|
1692
|
-
|
|
1692
|
+
D[7] || (D[7] = l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" }, null, -1))
|
|
1693
1693
|
])
|
|
1694
1694
|
])
|
|
1695
1695
|
])) : B("", !0),
|
|
1696
|
-
|
|
1696
|
+
A.layout !== "popover" && A.type !== "select" ? (p(), h(N, { key: 1 }, [
|
|
1697
1697
|
!e(C) && e(s) ? (p(), h("div", {
|
|
1698
1698
|
key: 0,
|
|
1699
|
-
onClick:
|
|
1699
|
+
onClick: D[3] || (D[3] = //@ts-ignore
|
|
1700
1700
|
(...M) => e(b) && e(b)(...M)),
|
|
1701
1701
|
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"
|
|
1702
1702
|
}, [
|
|
@@ -1705,7 +1705,7 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1705
1705
|
])) : B("", !0),
|
|
1706
1706
|
e(C) ? (p(), h("div", {
|
|
1707
1707
|
key: 1,
|
|
1708
|
-
onClick:
|
|
1708
|
+
onClick: D[4] || (D[4] = //@ts-ignore
|
|
1709
1709
|
(...M) => e(b) && e(b)(...M)),
|
|
1710
1710
|
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"
|
|
1711
1711
|
}, [
|
|
@@ -1713,22 +1713,22 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1713
1713
|
ee(ot)
|
|
1714
1714
|
])) : B("", !0)
|
|
1715
1715
|
], 64)) : B("", !0),
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
se(j(
|
|
1716
|
+
A.cleanable ? (p(), h(N, { key: 2 }, [
|
|
1717
|
+
A.layout === "inline" ? (p(), h("div", _o, [
|
|
1718
|
+
se(j(A.multi && Array.isArray(e(u)) ? (Y = e(u)) == null ? void 0 : Y.length : e(u) !== void 0 && (e(u) || e(u) === null) ? 1 : 0) + " / " + j(e(L)) + " " + j(e(r)("filter.selected")) + " ", 1),
|
|
1719
1719
|
le(l("button", {
|
|
1720
1720
|
class: "text-gray-600 hover:text-gray-800",
|
|
1721
|
-
onClick:
|
|
1721
|
+
onClick: D[5] || (D[5] = //@ts-ignore
|
|
1722
1722
|
(...M) => e(v) && e(v)(...M))
|
|
1723
1723
|
}, j(e(r)("filter.clear")), 513), [
|
|
1724
1724
|
[me, e(u) !== "" && e(u) !== void 0 || e(u)]
|
|
1725
1725
|
])
|
|
1726
1726
|
])) : B("", !0),
|
|
1727
|
-
|
|
1728
|
-
l("span", null, j(
|
|
1727
|
+
A.layout === "popover" ? (p(), h("div", Vo, [
|
|
1728
|
+
l("span", null, j(A.multi && Array.isArray(e(u)) ? (T = e(u)) == null ? void 0 : T.length : e(u) !== void 0 && (e(u) || e(u) === null) ? 1 : 0) + " / " + j(e(L)) + " " + j(e(r)("filter.selected")), 1),
|
|
1729
1729
|
le(l("button", {
|
|
1730
1730
|
class: "text-gray-600 hover:text-gray-800",
|
|
1731
|
-
onClick:
|
|
1731
|
+
onClick: D[6] || (D[6] = //@ts-ignore
|
|
1732
1732
|
(...M) => e(v) && e(v)(...M))
|
|
1733
1733
|
}, j(e(r)("filter.clear")), 513), [
|
|
1734
1734
|
[me, e(u) !== "" && e(u) !== void 0 || e(u)]
|
|
@@ -1738,7 +1738,7 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1738
1738
|
], 2);
|
|
1739
1739
|
};
|
|
1740
1740
|
}
|
|
1741
|
-
}), Bo = ["for", "onClick"],
|
|
1741
|
+
}), Bo = ["for", "onClick"], Lo = ["id", "name", "value"], So = { class: "block" }, Ao = {
|
|
1742
1742
|
key: 0,
|
|
1743
1743
|
class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
|
|
1744
1744
|
}, $o = {
|
|
@@ -1805,7 +1805,7 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1805
1805
|
(p(!0), h(N, null, ne(e(v), (s) => (p(), h("label", {
|
|
1806
1806
|
key: `item-${s[e(m)]}`,
|
|
1807
1807
|
for: `item-${s[e(m)]}`,
|
|
1808
|
-
onClick:
|
|
1808
|
+
onClick: je((n) => e(u)(s), ["stop", "prevent"]),
|
|
1809
1809
|
class: H([e(g)(s) ? "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-sm 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%)]"])
|
|
1810
1810
|
}, [
|
|
1811
1811
|
l("input", {
|
|
@@ -1814,8 +1814,8 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1814
1814
|
class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
|
|
1815
1815
|
name: `item-${s[e(m)]}`,
|
|
1816
1816
|
value: s[e(m)]
|
|
1817
|
-
}, null, 8,
|
|
1818
|
-
l("span",
|
|
1817
|
+
}, null, 8, Lo),
|
|
1818
|
+
l("span", So, j(s[e(k)]), 1)
|
|
1819
1819
|
], 10, Bo))), 128))
|
|
1820
1820
|
], 2),
|
|
1821
1821
|
y.cleanable ? (p(), h(N, { key: 0 }, [
|
|
@@ -1846,7 +1846,7 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1846
1846
|
}), zo = ["disabled", "title"], Fo = { class: "flex w-full items-center justify-between gap-1 overflow-hidden text-left" }, Ro = { class: "truncate text-ellipsis text-sm" }, Po = {
|
|
1847
1847
|
key: 0,
|
|
1848
1848
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-sm bg-blue-100 px-2 text-[11px] font-semibold text-blue-600"
|
|
1849
|
-
},
|
|
1849
|
+
}, Zo = { class: "w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-sm 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" }, Ko = { 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" }, rt = /* @__PURE__ */ te({
|
|
1850
1850
|
__name: "popover-field",
|
|
1851
1851
|
props: {
|
|
1852
1852
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -1868,24 +1868,24 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1868
1868
|
function k() {
|
|
1869
1869
|
const x = u.value, R = f.value;
|
|
1870
1870
|
if (!x || !R) return;
|
|
1871
|
-
const z = x.getBoundingClientRect(),
|
|
1872
|
-
let Y = z.bottom +
|
|
1873
|
-
const M = Math.max(
|
|
1874
|
-
if (T = Math.min(T, M), T = Math.max(T, 10), Y + F >
|
|
1875
|
-
const I = z.top - F -
|
|
1876
|
-
Y = I >= 10 ? I : Math.max(
|
|
1871
|
+
const z = x.getBoundingClientRect(), L = R.offsetWidth, F = R.offsetHeight, Z = window.innerWidth, A = window.innerHeight, D = 8;
|
|
1872
|
+
let Y = z.bottom + D, { left: T } = z;
|
|
1873
|
+
const M = Math.max(Z - L - 10, 10);
|
|
1874
|
+
if (T = Math.min(T, M), T = Math.max(T, 10), Y + F > A - 10) {
|
|
1875
|
+
const I = z.top - F - D;
|
|
1876
|
+
Y = I >= 10 ? I : Math.max(A - F - 10, 10);
|
|
1877
1877
|
}
|
|
1878
1878
|
Y < 10 && (Y = 10), i.value = { top: Y, left: T };
|
|
1879
1879
|
}
|
|
1880
1880
|
function m() {
|
|
1881
|
-
t.value = !t.value, t.value &&
|
|
1882
|
-
var x, R, z,
|
|
1883
|
-
k(), (x = o.fieldRef) != null && x.inputTextRef && ((
|
|
1881
|
+
t.value = !t.value, t.value && Ee(() => {
|
|
1882
|
+
var x, R, z, L, F, Z, A;
|
|
1883
|
+
k(), (x = o.fieldRef) != null && x.inputTextRef && ((L = (z = (R = o.fieldRef) == null ? void 0 : R.inputTextRef) == null ? void 0 : z.focus) == null || L.call(z)), (F = o.fieldRef) != null && F.loadData && ((A = (Z = o.fieldRef) == null ? void 0 : Z.loadData) == null || A.call(Z));
|
|
1884
1884
|
});
|
|
1885
1885
|
}
|
|
1886
1886
|
function v(x) {
|
|
1887
|
-
var R, z,
|
|
1888
|
-
!((R = g.value) != null && R.contains(x.target)) && !((z = f.value) != null && z.contains(x.target)) && !((
|
|
1887
|
+
var R, z, L;
|
|
1888
|
+
!((R = g.value) != null && R.contains(x.target)) && !((z = f.value) != null && z.contains(x.target)) && !((L = u.value) != null && L.contains(x.target)) && (t.value = !1);
|
|
1889
1889
|
}
|
|
1890
1890
|
function y(x) {
|
|
1891
1891
|
x.key === "Escape" && (t.value = !1);
|
|
@@ -1893,9 +1893,9 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1893
1893
|
const b = V(!1), _ = V("ua"), C = (x) => {
|
|
1894
1894
|
x.detail.key === "locale" && (_.value = x.detail.newValue);
|
|
1895
1895
|
};
|
|
1896
|
-
|
|
1896
|
+
Fe(() => {
|
|
1897
1897
|
b.value = !0, _.value = localStorage.locale, window.addEventListener("storage", C), document.addEventListener("click", v, !0), document.addEventListener("keydown", y), window.addEventListener("scroll", k, !0);
|
|
1898
|
-
}),
|
|
1898
|
+
}), Te(() => {
|
|
1899
1899
|
window.removeEventListener("resize", C), document.removeEventListener("click", v, !0), document.removeEventListener("keydown", y), window.removeEventListener("scroll", k, !0);
|
|
1900
1900
|
});
|
|
1901
1901
|
function s() {
|
|
@@ -1942,11 +1942,11 @@ const yo = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relat
|
|
|
1942
1942
|
ref_key: "popperRef",
|
|
1943
1943
|
ref: f,
|
|
1944
1944
|
class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
|
|
1945
|
-
style:
|
|
1945
|
+
style: ze({ top: `${i.value.top}px`, left: `${i.value.left}px` }),
|
|
1946
1946
|
"data-inside-popover": ""
|
|
1947
1947
|
}, [
|
|
1948
|
-
l("div",
|
|
1949
|
-
l("div",
|
|
1948
|
+
l("div", Zo, [
|
|
1949
|
+
l("div", Ko, [
|
|
1950
1950
|
be(x.$slots, "default")
|
|
1951
1951
|
])
|
|
1952
1952
|
])
|
|
@@ -2661,7 +2661,7 @@ const sa = { style: { display: "inline-flex", margin: "0px", width: "100%" } },
|
|
|
2661
2661
|
function Ge(c, a) {
|
|
2662
2662
|
const {
|
|
2663
2663
|
slots: o
|
|
2664
|
-
} = c, r = (n) => n ? JSON.parse(JSON.stringify(
|
|
2664
|
+
} = c, r = (n) => n ? JSON.parse(JSON.stringify(De(n))) : {}, t = V(r(c.value));
|
|
2665
2665
|
E(
|
|
2666
2666
|
() => c.value,
|
|
2667
2667
|
(n) => {
|
|
@@ -2671,11 +2671,11 @@ function Ge(c, a) {
|
|
|
2671
2671
|
);
|
|
2672
2672
|
const i = O(() => {
|
|
2673
2673
|
var n;
|
|
2674
|
-
return (
|
|
2674
|
+
return (De((n = o == null ? void 0 : o.default) == null ? void 0 : n.call(o)) ?? []).flatMap((d) => Array.isArray(d.children) ? d.children : [d]);
|
|
2675
2675
|
});
|
|
2676
2676
|
function g(n) {
|
|
2677
2677
|
delete t.value[n], a("clear", {
|
|
2678
|
-
data:
|
|
2678
|
+
data: De(t.value),
|
|
2679
2679
|
name: n
|
|
2680
2680
|
});
|
|
2681
2681
|
}
|
|
@@ -2684,7 +2684,7 @@ function Ge(c, a) {
|
|
|
2684
2684
|
...t.value,
|
|
2685
2685
|
[n]: d
|
|
2686
2686
|
}, a("change", {
|
|
2687
|
-
data:
|
|
2687
|
+
data: De(t.value),
|
|
2688
2688
|
name: n,
|
|
2689
2689
|
value: d
|
|
2690
2690
|
});
|
|
@@ -2715,7 +2715,7 @@ function Ge(c, a) {
|
|
|
2715
2715
|
);
|
|
2716
2716
|
function m(n = !1) {
|
|
2717
2717
|
t.value = {}, n || a("clearAll", {
|
|
2718
|
-
data:
|
|
2718
|
+
data: De(t.value),
|
|
2719
2719
|
name: "ALL"
|
|
2720
2720
|
});
|
|
2721
2721
|
}
|
|
@@ -2725,7 +2725,7 @@ function Ge(c, a) {
|
|
|
2725
2725
|
}), b = V();
|
|
2726
2726
|
E(v, async () => {
|
|
2727
2727
|
var n, d;
|
|
2728
|
-
await
|
|
2728
|
+
await Ee(), (d = (n = b == null ? void 0 : b.value) == null ? void 0 : n.filterRef) != null && d.inputTextRef && b.value.filterRef.inputTextRef.focus();
|
|
2729
2729
|
});
|
|
2730
2730
|
const _ = O(() => {
|
|
2731
2731
|
var n, d;
|
|
@@ -2781,18 +2781,18 @@ const ga = /* @__PURE__ */ te({
|
|
|
2781
2781
|
!((C = i.value) != null && C.contains(b.target)) && !((s = r.value) != null && s.contains(b.target)) && !_.closest("[data-inside-popover]") && (o.value = !1);
|
|
2782
2782
|
}
|
|
2783
2783
|
const v = V(!1);
|
|
2784
|
-
|
|
2784
|
+
Fe(() => {
|
|
2785
2785
|
v.value = !0;
|
|
2786
|
-
}),
|
|
2786
|
+
}), Fe(() => {
|
|
2787
2787
|
var b, _;
|
|
2788
2788
|
i.value = ((b = t.value) == null ? void 0 : b.querySelector("[data-popover-trigger]")) || null, (_ = i.value) == null || _.addEventListener("click", u), document.addEventListener("click", m), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0);
|
|
2789
|
-
}),
|
|
2789
|
+
}), Te(() => {
|
|
2790
2790
|
var b;
|
|
2791
2791
|
(b = i.value) == null || b.removeEventListener("click", u), document.removeEventListener("click", m), window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
|
|
2792
2792
|
});
|
|
2793
2793
|
const y = a;
|
|
2794
2794
|
return E(o, async (b) => {
|
|
2795
|
-
b ? (y("open"), await
|
|
2795
|
+
b ? (y("open"), await Ee(), f()) : y("close");
|
|
2796
2796
|
}), (b, _) => (p(), h("div", {
|
|
2797
2797
|
ref_key: "wrapperRef",
|
|
2798
2798
|
ref: t
|
|
@@ -2806,7 +2806,7 @@ const ga = /* @__PURE__ */ te({
|
|
|
2806
2806
|
ref_key: "popoverRef",
|
|
2807
2807
|
ref: r,
|
|
2808
2808
|
class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
|
|
2809
|
-
style:
|
|
2809
|
+
style: ze(k.value)
|
|
2810
2810
|
}, [
|
|
2811
2811
|
be(b.$slots, "default")
|
|
2812
2812
|
], 4), [
|
|
@@ -2835,7 +2835,7 @@ function xa(c, a) {
|
|
|
2835
2835
|
const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-center gap-2 overflow-hidden" }, wa = {
|
|
2836
2836
|
key: 0,
|
|
2837
2837
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-500 px-1 text-[11px] font-semibold text-white"
|
|
2838
|
-
}, ka = { class: "flex max-h-[400px]" }, Ca = { class: "w-64 border-r border-gray-200 overflow-y-auto" }, _a = { class: "p-4 border-b" }, Va = { class: "text-sm text-gray-600" }, Ma = { class: "p-2" }, Ba = ["onClick"],
|
|
2838
|
+
}, ka = { class: "flex max-h-[400px]" }, Ca = { class: "w-64 border-r border-gray-200 overflow-y-auto" }, _a = { class: "p-4 border-b" }, Va = { class: "text-sm text-gray-600" }, Ma = { class: "p-2" }, Ba = ["onClick"], La = { class: "flex items-center gap-2" }, Sa = { class: "text-sm font-medium" }, Aa = {
|
|
2839
2839
|
key: 0,
|
|
2840
2840
|
class: "inline-flex min-h-[18px] min-w-[18px] items-center justify-center rounded-[4px] bg-blue-100 px-1 text-[11px] font-semibold text-blue-600"
|
|
2841
2841
|
}, $a = ["onClick"], ja = { class: "flex items-center gap-2" }, za = { class: "text-sm font-medium" }, Fa = {
|
|
@@ -2844,10 +2844,10 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2844
2844
|
}, Ra = {
|
|
2845
2845
|
key: 0,
|
|
2846
2846
|
class: "p-2 border-t"
|
|
2847
|
-
}, Pa = { class: "flex-1 min-h-[300px] overflow-y-auto" },
|
|
2847
|
+
}, Pa = { class: "flex-1 min-h-[300px] overflow-y-auto" }, Za = {
|
|
2848
2848
|
key: 0,
|
|
2849
2849
|
class: "flex items-center justify-center h-full text-gray-500"
|
|
2850
|
-
},
|
|
2850
|
+
}, Ka = { class: "text-sm" }, Mt = /* @__PURE__ */ te({
|
|
2851
2851
|
__name: "popover-filter-layout",
|
|
2852
2852
|
props: {
|
|
2853
2853
|
badgeCount: {},
|
|
@@ -2865,7 +2865,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2865
2865
|
},
|
|
2866
2866
|
emits: ["change", "clear", "clearAll"],
|
|
2867
2867
|
setup(c, { expose: a, emit: o }) {
|
|
2868
|
-
const r = Me(), t = c, i = Ct(t.mode), g =
|
|
2868
|
+
const r = Me(), t = c, i = Ct(t.mode), g = Oe(), u = o, f = V({}), k = O(() => f != null && f.value ? t.view !== "inline" ? f == null ? void 0 : f.value : Object.fromEntries(Object.entries(f == null ? void 0 : f.value).slice(t.limit)) : {}), {
|
|
2869
2869
|
activeFilter: m,
|
|
2870
2870
|
activeFilterCount: v,
|
|
2871
2871
|
onFilterChange: y,
|
|
@@ -2880,7 +2880,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2880
2880
|
slots: g
|
|
2881
2881
|
}, u), d = O(() => t.badgeCount ?? v.value);
|
|
2882
2882
|
function w(z) {
|
|
2883
|
-
return Array.isArray(z) ? z.filter((
|
|
2883
|
+
return Array.isArray(z) ? z.filter((L) => L != null && L !== "").length : z && typeof z == "object" ? Object.values(z).filter((L) => L != null && L !== "").length : z === null || z !== void 0 && z !== "" ? 1 : 0;
|
|
2884
2884
|
}
|
|
2885
2885
|
function x(z) {
|
|
2886
2886
|
return m.value ? w(m.value[z]) : 0;
|
|
@@ -2900,9 +2900,9 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2900
2900
|
), a({
|
|
2901
2901
|
clearFilter: b,
|
|
2902
2902
|
clearAllFilters: _
|
|
2903
|
-
}), (z,
|
|
2903
|
+
}), (z, L) => (p(), W(ga, {
|
|
2904
2904
|
onOpen: R,
|
|
2905
|
-
onClose:
|
|
2905
|
+
onClose: L[5] || (L[5] = (F) => s.value = "")
|
|
2906
2906
|
}, {
|
|
2907
2907
|
trigger: Ve(() => [
|
|
2908
2908
|
l("button", {
|
|
@@ -2919,7 +2919,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2919
2919
|
}, [
|
|
2920
2920
|
l("span", ba, [
|
|
2921
2921
|
ee(Vt, { class: "h-4 w-4" }),
|
|
2922
|
-
|
|
2922
|
+
L[6] || (L[6] = l("span", { class: "text-sm font-medium" }, "Фільтр", -1))
|
|
2923
2923
|
]),
|
|
2924
2924
|
d.value > 0 ? (p(), h("span", wa, j(d.value), 1)) : B("", !0)
|
|
2925
2925
|
], 2)
|
|
@@ -2931,7 +2931,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2931
2931
|
l("p", Va, j(e(r)("filter.selectFieldHelp")), 1)
|
|
2932
2932
|
]),
|
|
2933
2933
|
l("div", Ma, [
|
|
2934
|
-
z.schema ? (p(!0), h(N, { key: 0 }, ne(Object.entries(k.value), ([F,
|
|
2934
|
+
z.schema ? (p(!0), h(N, { key: 0 }, ne(Object.entries(k.value), ([F, Z]) => (p(), h("button", {
|
|
2935
2935
|
key: F,
|
|
2936
2936
|
onClick: () => {
|
|
2937
2937
|
s.value = F;
|
|
@@ -2941,14 +2941,14 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2941
2941
|
e(s) === F ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
2942
2942
|
])
|
|
2943
2943
|
}, [
|
|
2944
|
-
l("div",
|
|
2945
|
-
l("span",
|
|
2944
|
+
l("div", La, [
|
|
2945
|
+
l("span", Sa, j(Z.label), 1)
|
|
2946
2946
|
]),
|
|
2947
2947
|
x(F) > 0 ? (p(), h("div", Aa, j(x(F)), 1)) : B("", !0)
|
|
2948
2948
|
], 10, Ba))), 128)) : B("", !0),
|
|
2949
|
-
(p(!0), h(N, null, ne(e(C), (F,
|
|
2950
|
-
key: "slot-" +
|
|
2951
|
-
onClick: (
|
|
2949
|
+
(p(!0), h(N, null, ne(e(C), (F, Z) => (p(), h("button", {
|
|
2950
|
+
key: "slot-" + Z,
|
|
2951
|
+
onClick: (A) => s.value = F.props.name,
|
|
2952
2952
|
class: H([
|
|
2953
2953
|
"flex items-center justify-between px-3 py-2 text-left transition-colors hover:bg-gray-50",
|
|
2954
2954
|
e(s) === F.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : "text-neutral-700"
|
|
@@ -2963,39 +2963,39 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
2963
2963
|
e(v) > 0 ? (p(), h("div", Ra, [
|
|
2964
2964
|
l("button", {
|
|
2965
2965
|
class: H([z.itemClass, "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors"]),
|
|
2966
|
-
onClick:
|
|
2966
|
+
onClick: L[0] || (L[0] = (F) => e(_)()),
|
|
2967
2967
|
"data-inside-popover": ""
|
|
2968
2968
|
}, " Очистити всі ", 2)
|
|
2969
2969
|
])) : B("", !0)
|
|
2970
2970
|
]),
|
|
2971
2971
|
l("div", Pa, [
|
|
2972
|
-
e(s) === "" ? (p(), h("div",
|
|
2973
|
-
l("p",
|
|
2972
|
+
e(s) === "" ? (p(), h("div", Za, [
|
|
2973
|
+
l("p", Ka, j(e(r)("filter.selectFieldHelp")), 1)
|
|
2974
2974
|
])) : B("", !0),
|
|
2975
2975
|
e(s) ? (p(), h(N, { key: 1 }, [
|
|
2976
|
-
k.value ? (p(!0), h(N, { key: 0 }, ne(Object.entries(k.value), ([F,
|
|
2976
|
+
k.value ? (p(!0), h(N, { key: 0 }, ne(Object.entries(k.value), ([F, Z]) => (p(), h(N, null, [
|
|
2977
2977
|
e(s) === F ? (p(), W(ke, pe({
|
|
2978
2978
|
key: F,
|
|
2979
2979
|
layout: "popover",
|
|
2980
2980
|
ref_for: !0,
|
|
2981
2981
|
ref_key: "filterRef",
|
|
2982
2982
|
ref: n
|
|
2983
|
-
}, { ref_for: !0 },
|
|
2984
|
-
class: [z.itemClass,
|
|
2985
|
-
"item-class": [z.itemClass,
|
|
2986
|
-
onChange:
|
|
2987
|
-
onClear:
|
|
2988
|
-
e(b)(
|
|
2983
|
+
}, { ref_for: !0 }, Z, {
|
|
2984
|
+
class: [z.itemClass, Z == null ? void 0 : Z.class],
|
|
2985
|
+
"item-class": [z.itemClass, Z == null ? void 0 : Z.itemClass].filter(Boolean).join(" ") || void 0,
|
|
2986
|
+
onChange: L[1] || (L[1] = (A) => e(y)(A.name, A.value)),
|
|
2987
|
+
onClear: L[2] || (L[2] = (A) => {
|
|
2988
|
+
e(b)(A), e(y)(A, void 0);
|
|
2989
2989
|
}),
|
|
2990
2990
|
modelValue: e(m)[F],
|
|
2991
|
-
"onUpdate:modelValue": (
|
|
2991
|
+
"onUpdate:modelValue": (A) => e(m)[F] = A,
|
|
2992
2992
|
cleanable: !0
|
|
2993
2993
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"])) : B("", !0)
|
|
2994
2994
|
], 64))), 256)) : B("", !0),
|
|
2995
|
-
(p(!0), h(N, null, ne(e(C), (F,
|
|
2996
|
-
var
|
|
2995
|
+
(p(!0), h(N, null, ne(e(C), (F, Z) => {
|
|
2996
|
+
var A, D;
|
|
2997
2997
|
return p(), h(N, {
|
|
2998
|
-
key: "slot-" +
|
|
2998
|
+
key: "slot-" + Z
|
|
2999
2999
|
}, [
|
|
3000
3000
|
e(s) === F.props.name ? (p(), W(ke, pe({
|
|
3001
3001
|
key: 0,
|
|
@@ -3004,10 +3004,10 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3004
3004
|
ref_for: !0,
|
|
3005
3005
|
ref_key: "filterRef",
|
|
3006
3006
|
ref: n,
|
|
3007
|
-
class: [z.itemClass, (
|
|
3008
|
-
"item-class": [z.itemClass, (
|
|
3009
|
-
onChange:
|
|
3010
|
-
onClear:
|
|
3007
|
+
class: [z.itemClass, (A = F.props) == null ? void 0 : A.class],
|
|
3008
|
+
"item-class": [z.itemClass, (D = F.props) == null ? void 0 : D.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3009
|
+
onChange: L[3] || (L[3] = (Y) => e(y)(Y.name, Y.value)),
|
|
3010
|
+
onClear: L[4] || (L[4] = (Y) => {
|
|
3011
3011
|
e(b)(Y), e(y)(Y, void 0);
|
|
3012
3012
|
}),
|
|
3013
3013
|
modelValue: e(m)[F.props.name],
|
|
@@ -3040,7 +3040,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3040
3040
|
},
|
|
3041
3041
|
emits: ["change", "clear", "clearAll"],
|
|
3042
3042
|
setup(c, { expose: a, emit: o }) {
|
|
3043
|
-
const r = Me(), t = c, i = o, g =
|
|
3043
|
+
const r = Me(), t = c, i = o, g = Oe(), u = V({}), f = O(() => Object.keys(t.schema).length > t.limit), {
|
|
3044
3044
|
activeFilter: k,
|
|
3045
3045
|
activeFilterCount: m,
|
|
3046
3046
|
onFilterChange: v,
|
|
@@ -3057,87 +3057,87 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3057
3057
|
},
|
|
3058
3058
|
i
|
|
3059
3059
|
);
|
|
3060
|
-
function n(
|
|
3061
|
-
return Array.isArray(
|
|
3060
|
+
function n(L) {
|
|
3061
|
+
return Array.isArray(L) ? L.some((F) => F !== "" && F !== void 0 && F !== null) : L === null ? !0 : L && typeof L == "object" ? Object.values(L).some((F) => F !== "" && F !== void 0 && F !== null) : L !== "" && L !== void 0;
|
|
3062
3062
|
}
|
|
3063
3063
|
const d = O(() => {
|
|
3064
|
-
const
|
|
3065
|
-
var
|
|
3066
|
-
return (
|
|
3067
|
-
}).filter((
|
|
3068
|
-
return /* @__PURE__ */ new Set([...
|
|
3069
|
-
}), w = O(() => Object.entries(k.value ?? {}).filter(([
|
|
3070
|
-
const
|
|
3071
|
-
return Math.max(
|
|
3064
|
+
const L = Object.keys(_.value ?? {}), F = s.value.map((Z) => {
|
|
3065
|
+
var A;
|
|
3066
|
+
return (A = Z.props) == null ? void 0 : A.name;
|
|
3067
|
+
}).filter((Z) => typeof Z == "string");
|
|
3068
|
+
return /* @__PURE__ */ new Set([...L, ...F]);
|
|
3069
|
+
}), w = O(() => Object.entries(k.value ?? {}).filter(([L, F]) => d.value.has(L) && n(F)).length), x = O(() => {
|
|
3070
|
+
const L = m.value ?? 0, F = w.value ?? 0;
|
|
3071
|
+
return Math.max(L - F, 0);
|
|
3072
3072
|
}), R = V();
|
|
3073
3073
|
function z() {
|
|
3074
3074
|
R.value && R.value.clearAllFilters(!0), b();
|
|
3075
3075
|
}
|
|
3076
3076
|
return E(
|
|
3077
3077
|
() => t.schema,
|
|
3078
|
-
(
|
|
3079
|
-
u.value =
|
|
3078
|
+
(L) => {
|
|
3079
|
+
u.value = L;
|
|
3080
3080
|
},
|
|
3081
3081
|
{ deep: !0, immediate: !0 }
|
|
3082
3082
|
), a({
|
|
3083
3083
|
clearFilter: y,
|
|
3084
3084
|
clearAllFilters: b
|
|
3085
|
-
}), (
|
|
3086
|
-
|
|
3087
|
-
key:
|
|
3088
|
-
mode:
|
|
3089
|
-
width:
|
|
3090
|
-
}, { ref_for: !0 },
|
|
3091
|
-
class: [
|
|
3092
|
-
"item-class": [
|
|
3093
|
-
onChange: F[0] || (F[0] = (
|
|
3085
|
+
}), (L, F) => (p(), h("div", Da, [
|
|
3086
|
+
L.schema ? (p(!0), h(N, { key: 0 }, ne(Object.entries(e(_)), ([Z, A]) => (p(), W(ke, pe({
|
|
3087
|
+
key: Z,
|
|
3088
|
+
mode: L.mode,
|
|
3089
|
+
width: L.width ? L.width : A == null ? void 0 : A.width
|
|
3090
|
+
}, { ref_for: !0 }, A, {
|
|
3091
|
+
class: [L.itemClass, A == null ? void 0 : A.class],
|
|
3092
|
+
"item-class": [L.itemClass, A == null ? void 0 : A.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3093
|
+
onChange: F[0] || (F[0] = (D) => e(v)(D.name, D.value)),
|
|
3094
3094
|
onClear: e(y),
|
|
3095
3095
|
layout: "inline",
|
|
3096
3096
|
cleanable: !0,
|
|
3097
|
-
modelValue: e(k)[
|
|
3098
|
-
"onUpdate:modelValue": (
|
|
3097
|
+
modelValue: e(k)[Z],
|
|
3098
|
+
"onUpdate:modelValue": (D) => e(k)[Z] = D
|
|
3099
3099
|
}), null, 16, ["mode", "width", "class", "item-class", "onClear", "modelValue", "onUpdate:modelValue"]))), 128)) : B("", !0),
|
|
3100
|
-
(p(!0), h(N, null, ne(e(s), (
|
|
3101
|
-
var
|
|
3100
|
+
(p(!0), h(N, null, ne(e(s), (Z, A) => {
|
|
3101
|
+
var D, Y;
|
|
3102
3102
|
return p(), W(ke, pe({
|
|
3103
|
-
key: "slot-" +
|
|
3103
|
+
key: "slot-" + A,
|
|
3104
3104
|
layout: "inline"
|
|
3105
|
-
}, { ref_for: !0 },
|
|
3106
|
-
class: [
|
|
3107
|
-
"item-class": [
|
|
3105
|
+
}, { ref_for: !0 }, Z.props, {
|
|
3106
|
+
class: [L.itemClass, (D = Z.props) == null ? void 0 : D.class],
|
|
3107
|
+
"item-class": [L.itemClass, (Y = Z.props) == null ? void 0 : Y.itemClass].filter(Boolean).join(" ") || void 0,
|
|
3108
3108
|
onChange: F[1] || (F[1] = (T) => e(v)(T.name, T.value)),
|
|
3109
3109
|
onClear: F[2] || (F[2] = (T) => {
|
|
3110
3110
|
e(y)(T), e(v)(T, void 0);
|
|
3111
3111
|
}),
|
|
3112
3112
|
cleanable: !0,
|
|
3113
|
-
modelValue: e(k)[
|
|
3114
|
-
"onUpdate:modelValue": (T) => e(k)[
|
|
3113
|
+
modelValue: e(k)[Z.props.name],
|
|
3114
|
+
"onUpdate:modelValue": (T) => e(k)[Z.props.name] = T
|
|
3115
3115
|
}), null, 16, ["class", "item-class", "modelValue", "onUpdate:modelValue"]);
|
|
3116
3116
|
}), 128)),
|
|
3117
3117
|
f.value ? (p(), W(Mt, pe({ key: 1 }, t, {
|
|
3118
|
-
schema:
|
|
3119
|
-
limit:
|
|
3120
|
-
onChange: F[3] || (F[3] = (
|
|
3121
|
-
onClearAll: F[4] || (F[4] = (
|
|
3122
|
-
onClear: F[5] || (F[5] = (
|
|
3123
|
-
mode:
|
|
3118
|
+
schema: L.schema,
|
|
3119
|
+
limit: L.limit,
|
|
3120
|
+
onChange: F[3] || (F[3] = (Z) => e(v)(Z.name, Z.value)),
|
|
3121
|
+
onClearAll: F[4] || (F[4] = (Z) => e(b)()),
|
|
3122
|
+
onClear: F[5] || (F[5] = (Z) => e(y)(Z.name)),
|
|
3123
|
+
mode: L.mode,
|
|
3124
3124
|
ref_key: "popoverRef",
|
|
3125
3125
|
ref: R,
|
|
3126
3126
|
cleanable: !0,
|
|
3127
3127
|
"badge-count": x.value
|
|
3128
3128
|
}), {
|
|
3129
3129
|
default: Ve(() => [
|
|
3130
|
-
(p(!0), h(N, null, ne(e(C), (
|
|
3131
|
-
key: "slot-" +
|
|
3130
|
+
(p(!0), h(N, null, ne(e(C), (Z, A) => (p(), W(_e(Z), pe({
|
|
3131
|
+
key: "slot-" + A,
|
|
3132
3132
|
layout: "popover"
|
|
3133
|
-
}, { ref_for: !0 },
|
|
3133
|
+
}, { ref_for: !0 }, Z.props, { cleanable: !0 }), null, 16))), 128))
|
|
3134
3134
|
]),
|
|
3135
3135
|
_: 1
|
|
3136
3136
|
}, 16, ["schema", "limit", "mode", "badge-count"])) : B("", !0),
|
|
3137
3137
|
e(m) > 0 ? (p(), h("button", {
|
|
3138
3138
|
key: 2,
|
|
3139
3139
|
onClick: z,
|
|
3140
|
-
class: H([
|
|
3140
|
+
class: H([L.itemClass, "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-md bg-gray-50 border text-gray-800 hover:bg-gray-200 focus:bg-gray-200"])
|
|
3141
3141
|
}, j(e(r)("filter.clear")), 3)) : B("", !0)
|
|
3142
3142
|
]));
|
|
3143
3143
|
}
|
|
@@ -3161,7 +3161,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3161
3161
|
},
|
|
3162
3162
|
emits: ["change", "clear", "clearAll"],
|
|
3163
3163
|
setup(c, { expose: a, emit: o }) {
|
|
3164
|
-
const r = c, t = o, i =
|
|
3164
|
+
const r = c, t = o, i = Oe(), {
|
|
3165
3165
|
activeFilter: g,
|
|
3166
3166
|
activeFilterCount: u,
|
|
3167
3167
|
onFilterChange: f,
|
|
@@ -3240,7 +3240,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3240
3240
|
},
|
|
3241
3241
|
emits: ["change", "clear", "clearAll"],
|
|
3242
3242
|
setup(c, { emit: a }) {
|
|
3243
|
-
const o = Me(), r = c, t = a, i = V({}), g =
|
|
3243
|
+
const o = Me(), r = c, t = a, i = V({}), g = Oe(), {
|
|
3244
3244
|
activeFilter: u,
|
|
3245
3245
|
activeFilterCount: f,
|
|
3246
3246
|
onFilterChange: k,
|
|
@@ -3264,7 +3264,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3264
3264
|
transform: "translateX(-50%)",
|
|
3265
3265
|
zIndex: 1e3
|
|
3266
3266
|
} : { display: "none" });
|
|
3267
|
-
function
|
|
3267
|
+
function L() {
|
|
3268
3268
|
C.open = !1;
|
|
3269
3269
|
}
|
|
3270
3270
|
function F() {
|
|
@@ -3272,22 +3272,22 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3272
3272
|
const T = b.value.getBoundingClientRect();
|
|
3273
3273
|
C.top = T.bottom + window.scrollY + 8, C.left = T.left + T.width / 2 + window.scrollX;
|
|
3274
3274
|
}
|
|
3275
|
-
function
|
|
3276
|
-
C.open = !C.open, C.open &&
|
|
3275
|
+
function Z() {
|
|
3276
|
+
C.open = !C.open, C.open && Ee(F);
|
|
3277
3277
|
}
|
|
3278
|
-
function
|
|
3279
|
-
n.value ||
|
|
3278
|
+
function A() {
|
|
3279
|
+
n.value || Z();
|
|
3280
3280
|
}
|
|
3281
|
-
function
|
|
3281
|
+
function D() {
|
|
3282
3282
|
C.open && F();
|
|
3283
3283
|
}
|
|
3284
3284
|
function Y() {
|
|
3285
3285
|
v();
|
|
3286
3286
|
}
|
|
3287
|
-
return
|
|
3288
|
-
window.addEventListener("resize",
|
|
3289
|
-
}),
|
|
3290
|
-
window.removeEventListener("resize",
|
|
3287
|
+
return Fe(() => {
|
|
3288
|
+
window.addEventListener("resize", D), window.addEventListener("scroll", D, !0);
|
|
3289
|
+
}), Te(() => {
|
|
3290
|
+
window.removeEventListener("resize", D), window.removeEventListener("scroll", D, !0);
|
|
3291
3291
|
}), E(
|
|
3292
3292
|
() => r.schema,
|
|
3293
3293
|
(T) => {
|
|
@@ -3309,7 +3309,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3309
3309
|
), E(
|
|
3310
3310
|
() => r.disabled,
|
|
3311
3311
|
(T) => {
|
|
3312
|
-
T &&
|
|
3312
|
+
T && L();
|
|
3313
3313
|
}
|
|
3314
3314
|
), (T, M) => (p(), h("div", {
|
|
3315
3315
|
class: "relative inline-flex",
|
|
@@ -3322,14 +3322,14 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3322
3322
|
role: "button",
|
|
3323
3323
|
tabindex: "0",
|
|
3324
3324
|
"data-popover-trigger": "",
|
|
3325
|
-
onClick:
|
|
3325
|
+
onClick: je(A, ["prevent", "stop"]),
|
|
3326
3326
|
onKeydown: [
|
|
3327
|
-
st(
|
|
3328
|
-
st(
|
|
3327
|
+
st(je(A, ["prevent", "stop"]), ["enter"]),
|
|
3328
|
+
st(je(A, ["prevent", "stop"]), ["space"])
|
|
3329
3329
|
]
|
|
3330
3330
|
}, [
|
|
3331
3331
|
be(T.$slots, "trigger", {
|
|
3332
|
-
toggle:
|
|
3332
|
+
toggle: A,
|
|
3333
3333
|
open: s.value,
|
|
3334
3334
|
disabled: n.value,
|
|
3335
3335
|
activeCount: e(f)
|
|
@@ -3339,7 +3339,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3339
3339
|
class: H(R.value),
|
|
3340
3340
|
type: "button",
|
|
3341
3341
|
disabled: n.value,
|
|
3342
|
-
onClick:
|
|
3342
|
+
onClick: je(A, ["prevent", "stop"]),
|
|
3343
3343
|
"data-popover-trigger": ""
|
|
3344
3344
|
}, [
|
|
3345
3345
|
ee(Vt, { class: "h-4 w-4" }),
|
|
@@ -3349,10 +3349,10 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3349
3349
|
s.value ? (p(), h("div", {
|
|
3350
3350
|
key: 0,
|
|
3351
3351
|
class: H(["absolute", typeof T.width == "number" ? `min-w-[${T.width + 32 + (Object.keys(d.value).length > 7 ? 20 : 0)}px]` : "min-w-[268px] "]),
|
|
3352
|
-
style:
|
|
3352
|
+
style: ze(z.value),
|
|
3353
3353
|
ref_key: "panel",
|
|
3354
3354
|
ref: _,
|
|
3355
|
-
onClick: M[4] || (M[4] =
|
|
3355
|
+
onClick: M[4] || (M[4] = je(() => {
|
|
3356
3356
|
}, ["stop"]))
|
|
3357
3357
|
}, [
|
|
3358
3358
|
l("div", Wa, [
|
|
@@ -3361,7 +3361,7 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3361
3361
|
l("button", {
|
|
3362
3362
|
type: "button",
|
|
3363
3363
|
class: "inline-flex h-6 w-6 items-center justify-center rounded-full border-0 bg-slate-300/40 text-slate-600 transition-colors hover:bg-blue-200/60 hover:text-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-200",
|
|
3364
|
-
onClick:
|
|
3364
|
+
onClick: L
|
|
3365
3365
|
}, [
|
|
3366
3366
|
l("span", Ga, [
|
|
3367
3367
|
ee(at, { class: "h-4 w-4" })
|
|
@@ -3434,16 +3434,16 @@ const Vt = /* @__PURE__ */ Ce(ha, [["render", xa]]), ba = { class: "flex items-c
|
|
|
3434
3434
|
() => r.value,
|
|
3435
3435
|
async (s) => {
|
|
3436
3436
|
var n, d;
|
|
3437
|
-
t.value = f(s ?? {}), (!s || Object.keys(s).length === 0) && (await
|
|
3437
|
+
t.value = f(s ?? {}), (!s || Object.keys(s).length === 0) && (await Ee(), (d = (n = g.value) == null ? void 0 : n.clearAllFilters) == null || d.call(n, !0));
|
|
3438
3438
|
},
|
|
3439
3439
|
{ deep: !0, immediate: !0 }
|
|
3440
3440
|
);
|
|
3441
|
-
const i = o, g = V(), u =
|
|
3441
|
+
const i = o, g = V(), u = Oe();
|
|
3442
3442
|
function f(s) {
|
|
3443
3443
|
if (Array.isArray(s))
|
|
3444
3444
|
return s.map((n) => f(n));
|
|
3445
3445
|
if (s !== null && typeof s == "object") {
|
|
3446
|
-
const n =
|
|
3446
|
+
const n = De(s), d = {};
|
|
3447
3447
|
for (const w in n)
|
|
3448
3448
|
d[w] = f(n[w]);
|
|
3449
3449
|
return d;
|
|
@@ -3743,7 +3743,7 @@ const er = { class: "flex items-center justify-between w-full gap-x-1" }, tr = {
|
|
|
3743
3743
|
])
|
|
3744
3744
|
]));
|
|
3745
3745
|
}
|
|
3746
|
-
}),
|
|
3746
|
+
}), He = (c, a) => {
|
|
3747
3747
|
const o = c.__vccOpts || c;
|
|
3748
3748
|
for (const [r, t] of a)
|
|
3749
3749
|
o[r] = t;
|
|
@@ -3761,7 +3761,7 @@ function vr(c, a) {
|
|
|
3761
3761
|
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)
|
|
3762
3762
|
])]);
|
|
3763
3763
|
}
|
|
3764
|
-
const mr = /* @__PURE__ */
|
|
3764
|
+
const mr = /* @__PURE__ */ He(pr, [["render", vr]]), gr = {}, hr = {
|
|
3765
3765
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3766
3766
|
width: "21",
|
|
3767
3767
|
height: "20",
|
|
@@ -3785,7 +3785,7 @@ function yr(c, a) {
|
|
|
3785
3785
|
l("path", { d: "M9 10l2 2l-2 2" }, null, -1)
|
|
3786
3786
|
])]);
|
|
3787
3787
|
}
|
|
3788
|
-
const xr = /* @__PURE__ */
|
|
3788
|
+
const xr = /* @__PURE__ */ He(gr, [["render", yr]]), br = {}, wr = {
|
|
3789
3789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3790
3790
|
width: "21",
|
|
3791
3791
|
height: "20",
|
|
@@ -3809,7 +3809,7 @@ function kr(c, a) {
|
|
|
3809
3809
|
l("path", { d: "M10 10l-2 2l2 2" }, null, -1)
|
|
3810
3810
|
])]);
|
|
3811
3811
|
}
|
|
3812
|
-
const Cr = /* @__PURE__ */
|
|
3812
|
+
const Cr = /* @__PURE__ */ He(br, [["render", kr]]), _r = {}, Vr = {
|
|
3813
3813
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3814
3814
|
width: "24",
|
|
3815
3815
|
height: "24",
|
|
@@ -3833,7 +3833,7 @@ function Mr(c, a) {
|
|
|
3833
3833
|
l("path", { d: "M15 7v13" }, null, -1)
|
|
3834
3834
|
])]);
|
|
3835
3835
|
}
|
|
3836
|
-
const Br = /* @__PURE__ */
|
|
3836
|
+
const Br = /* @__PURE__ */ He(_r, [["render", Mr]]), Lr = {}, Sr = {
|
|
3837
3837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3838
3838
|
width: "24",
|
|
3839
3839
|
height: "24",
|
|
@@ -3846,7 +3846,7 @@ const Br = /* @__PURE__ */ Oe(_r, [["render", Mr]]), Sr = {}, Lr = {
|
|
|
3846
3846
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-table"
|
|
3847
3847
|
};
|
|
3848
3848
|
function Ar(c, a) {
|
|
3849
|
-
return p(), h("svg",
|
|
3849
|
+
return p(), h("svg", Sr, [...a[0] || (a[0] = [
|
|
3850
3850
|
l("path", {
|
|
3851
3851
|
stroke: "none",
|
|
3852
3852
|
d: "M0 0h24v24H0z",
|
|
@@ -3857,7 +3857,7 @@ function Ar(c, a) {
|
|
|
3857
3857
|
l("path", { d: "M10 3v18" }, null, -1)
|
|
3858
3858
|
])]);
|
|
3859
3859
|
}
|
|
3860
|
-
const $r = /* @__PURE__ */
|
|
3860
|
+
const $r = /* @__PURE__ */ He(Lr, [["render", Ar]]);
|
|
3861
3861
|
function gt(c, a) {
|
|
3862
3862
|
let o;
|
|
3863
3863
|
return function(...r) {
|
|
@@ -3990,7 +3990,7 @@ const zr = [
|
|
|
3990
3990
|
], Fr = { class: "relative w-auto h-full" }, Rr = { class: "legend-panel__header flex items-center justify-between gap-2 py-[7px] pl-[10px] pr-[7px]" }, Pr = {
|
|
3991
3991
|
key: 0,
|
|
3992
3992
|
class: "text-[0.875rem] font-medium text-stone-700"
|
|
3993
|
-
},
|
|
3993
|
+
}, Zr = ["aria-label"], Kr = {
|
|
3994
3994
|
key: 0,
|
|
3995
3995
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3996
3996
|
class: "w-4 h-4",
|
|
@@ -4022,7 +4022,7 @@ const zr = [
|
|
|
4022
4022
|
}, Gr = {
|
|
4023
4023
|
class: "vs-map-slot-layers z-10 select-none",
|
|
4024
4024
|
style: { display: "flex" }
|
|
4025
|
-
}, Yr = ["title", "onClick"], Qr = ["src"], Xr = { 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" },
|
|
4025
|
+
}, Yr = ["title", "onClick"], Qr = ["src"], Xr = { 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" }, Ke = "vector-clusters", Jr = /* @__PURE__ */ te({
|
|
4026
4026
|
__name: "map",
|
|
4027
4027
|
props: {
|
|
4028
4028
|
table: {},
|
|
@@ -4039,30 +4039,31 @@ const zr = [
|
|
|
4039
4039
|
pointZoom: {},
|
|
4040
4040
|
isCollapsible: { type: Boolean },
|
|
4041
4041
|
legendTitle: {},
|
|
4042
|
-
legendWidth: {}
|
|
4042
|
+
legendWidth: {},
|
|
4043
|
+
alwaysShowPolygon: { type: Boolean }
|
|
4043
4044
|
},
|
|
4044
4045
|
emits: ["update:modelValue", "update:map"],
|
|
4045
4046
|
setup(c, { emit: a }) {
|
|
4046
4047
|
const o = c, r = a;
|
|
4047
4048
|
let t, i;
|
|
4048
4049
|
const g = Xe(), u = V(null), f = V(!1), k = V(!1), m = ["vector-circle", "vector-fill"], v = V(!0), y = O(() => {
|
|
4049
|
-
var
|
|
4050
|
-
return ((
|
|
4051
|
-
}), b = O(() => (o.layers && o.layers.length ? o.layers : y.value.length ? y.value : zr).map((
|
|
4050
|
+
var S, K;
|
|
4051
|
+
return ((K = (S = g == null ? void 0 : g.appContext.config.globalProperties) == null ? void 0 : S.$settings) == null ? void 0 : K.basemaps) || [];
|
|
4052
|
+
}), b = O(() => (o.layers && o.layers.length ? o.layers : y.value.length ? y.value : zr).map((K, G) => {
|
|
4052
4053
|
var we;
|
|
4053
|
-
const U =
|
|
4054
|
+
const U = K.id || ((we = K.name) == null ? void 0 : we.toString().toLowerCase().replace(/\s+/g, "-")) || `layer-${G}`, re = K.name || K.id || `layer-${G}`;
|
|
4054
4055
|
return {
|
|
4055
|
-
...
|
|
4056
|
+
...K,
|
|
4056
4057
|
id: U,
|
|
4057
4058
|
name: re
|
|
4058
4059
|
};
|
|
4059
|
-
})), _ = V(""), C = O(() => b.value.find((
|
|
4060
|
-
E(b, (
|
|
4061
|
-
var
|
|
4062
|
-
|
|
4060
|
+
})), _ = V(""), C = O(() => b.value.find((S) => S.id === _.value) || b.value[0]);
|
|
4061
|
+
E(b, (S) => {
|
|
4062
|
+
var K;
|
|
4063
|
+
S.length && (!_.value || !S.some((G) => G.id === _.value)) && (_.value = ((K = S[0]) == null ? void 0 : K.id) || "");
|
|
4063
4064
|
}, { immediate: !0 });
|
|
4064
|
-
function s(
|
|
4065
|
-
return
|
|
4065
|
+
function s(S) {
|
|
4066
|
+
return S ? S.replace("{x}", "2422").replace("{y}", "1400").replace("{z}", "12") : "";
|
|
4066
4067
|
}
|
|
4067
4068
|
const n = V(null), d = V(null), w = [
|
|
4068
4069
|
"#1F77B4",
|
|
@@ -4088,37 +4089,37 @@ const zr = [
|
|
|
4088
4089
|
];
|
|
4089
4090
|
let x;
|
|
4090
4091
|
const R = [30, 48];
|
|
4091
|
-
let z = null,
|
|
4092
|
+
let z = null, L = [];
|
|
4092
4093
|
function F() {
|
|
4093
4094
|
if (typeof window > "u")
|
|
4094
4095
|
return { zoom: null, center: null, hasQuery: !1 };
|
|
4095
|
-
const
|
|
4096
|
+
const S = new URLSearchParams(window.location.search), K = Number(S.get("z")), G = Number(S.get("y")), U = Number(S.get("x")), re = S.has("x") && S.has("y"), we = S.has("z");
|
|
4096
4097
|
return {
|
|
4097
|
-
zoom: we ?
|
|
4098
|
+
zoom: we ? K : null,
|
|
4098
4099
|
center: re ? [U, G] : null,
|
|
4099
4100
|
hasQuery: re || we
|
|
4100
4101
|
};
|
|
4101
4102
|
}
|
|
4102
|
-
function
|
|
4103
|
-
if (
|
|
4103
|
+
function Z(S, K) {
|
|
4104
|
+
if (!S || typeof window > "u") return;
|
|
4104
4105
|
const G = new URL(window.location.href);
|
|
4105
|
-
G.searchParams.set("z",
|
|
4106
|
+
G.searchParams.set("z", K.toFixed(2)), G.searchParams.set("x", S[0].toFixed(6)), G.searchParams.set("y", S[1].toFixed(6)), window.history.replaceState({}, "", G);
|
|
4106
4107
|
}
|
|
4107
|
-
let
|
|
4108
|
-
function
|
|
4109
|
-
if (!t || !
|
|
4110
|
-
const
|
|
4111
|
-
|
|
4108
|
+
let A = !1;
|
|
4109
|
+
function D() {
|
|
4110
|
+
if (!t || !A) return;
|
|
4111
|
+
const S = t.getCenter();
|
|
4112
|
+
Z([S.lng, S.lat], t.getZoom());
|
|
4112
4113
|
}
|
|
4113
4114
|
const Y = () => {
|
|
4114
|
-
|
|
4115
|
+
A || (A = !0), D();
|
|
4115
4116
|
};
|
|
4116
|
-
function T(
|
|
4117
|
-
return
|
|
4117
|
+
function T(S) {
|
|
4118
|
+
return S ? ["==", ["to-string", ["get", "id"]], S] : ["==", ["literal", 1], 0];
|
|
4118
4119
|
}
|
|
4119
4120
|
const M = ["in", ["geometry-type"], ["literal", ["Point", "MultiPoint"]]], I = ["in", ["geometry-type"], ["literal", ["Polygon", "MultiPolygon"]]];
|
|
4120
4121
|
function q() {
|
|
4121
|
-
const
|
|
4122
|
+
const S = T(o.modelValue), K = ["all", S, M], G = ["all", S, I];
|
|
4122
4123
|
if (!t.getLayer("vector-highlight-circle")) {
|
|
4123
4124
|
const we = (o.clusterZoom ?? 12) - 0.01;
|
|
4124
4125
|
t.addLayer({
|
|
@@ -4147,35 +4148,35 @@ const zr = [
|
|
|
4147
4148
|
"line-width": 3,
|
|
4148
4149
|
"line-opacity": 0.8
|
|
4149
4150
|
}
|
|
4150
|
-
}), t.setFilter("vector-highlight-circle",
|
|
4151
|
+
}), t.setFilter("vector-highlight-circle", K), t.setFilter("vector-highlight-fill", G);
|
|
4151
4152
|
const U = o.modelValue ? "visible" : "none";
|
|
4152
4153
|
t.setLayoutProperty("vector-highlight-circle", "visibility", U), t.setLayoutProperty("vector-highlight-fill", "visibility", U), fe();
|
|
4153
4154
|
}
|
|
4154
|
-
function oe(
|
|
4155
|
-
if (!t || !
|
|
4156
|
-
const
|
|
4155
|
+
function oe(S) {
|
|
4156
|
+
if (!t || !L.length) return;
|
|
4157
|
+
const K = "#ef4444", G = S ? [
|
|
4157
4158
|
"case",
|
|
4158
|
-
["all", ["has", "id"], ["==", ["to-string", ["get", "id"]],
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
] :
|
|
4159
|
+
["all", ["has", "id"], ["==", ["to-string", ["get", "id"]], S]],
|
|
4160
|
+
K,
|
|
4161
|
+
L
|
|
4162
|
+
] : L;
|
|
4162
4163
|
if (t.getLayer("vector-circle") && t.setPaintProperty("vector-circle", "circle-color", G), t.getLayer("vector-fill")) {
|
|
4163
|
-
const U =
|
|
4164
|
+
const U = S ? [
|
|
4164
4165
|
"case",
|
|
4165
|
-
["all", ["has", "id"], ["==", ["to-string", ["get", "id"]],
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
] :
|
|
4166
|
+
["all", ["has", "id"], ["==", ["to-string", ["get", "id"]], S]],
|
|
4167
|
+
K,
|
|
4168
|
+
L
|
|
4169
|
+
] : L;
|
|
4169
4170
|
t.setPaintProperty("vector-fill", "fill-color", U);
|
|
4170
4171
|
}
|
|
4171
4172
|
}
|
|
4172
4173
|
function fe() {
|
|
4173
4174
|
if (ge(), !o.modelValue) return;
|
|
4174
|
-
let
|
|
4175
|
+
let S = !0;
|
|
4175
4176
|
z = window.setInterval(() => {
|
|
4176
|
-
|
|
4177
|
-
const
|
|
4178
|
-
t != null && t.getLayer("vector-highlight-circle") && t.setPaintProperty("vector-highlight-circle", "circle-opacity",
|
|
4177
|
+
S = !S;
|
|
4178
|
+
const K = S ? 0.8 : 0.2;
|
|
4179
|
+
t != null && t.getLayer("vector-highlight-circle") && t.setPaintProperty("vector-highlight-circle", "circle-opacity", K), t != null && t.getLayer("vector-highlight-fill") && t.setPaintProperty("vector-highlight-fill", "line-opacity", K);
|
|
4179
4180
|
}, 600);
|
|
4180
4181
|
}
|
|
4181
4182
|
function ge() {
|
|
@@ -4184,47 +4185,52 @@ const zr = [
|
|
|
4184
4185
|
function he() {
|
|
4185
4186
|
t && (t.setCenter(o.center || R), t.setZoom(o.zoom || 5));
|
|
4186
4187
|
}
|
|
4187
|
-
function
|
|
4188
|
+
function Be() {
|
|
4188
4189
|
if (!(t != null && t.setLayerZoomRange)) return;
|
|
4189
|
-
const
|
|
4190
|
-
|
|
4190
|
+
const S = o.minZoom ?? 0, K = Math.min((o.maxZoom ?? 18) + 0.01, 24);
|
|
4191
|
+
if (o.alwaysShowPolygon)
|
|
4192
|
+
t.getLayer("vector-circle") && t.setLayerZoomRange("vector-circle", S, 0), t.getLayer("vector-highlight-circle") && t.setLayerZoomRange("vector-highlight-circle", S, 0), t.getLayer("vector-fill") && t.setLayerZoomRange("vector-fill", S, K), t.getLayer("vector-highlight-fill") && t.setLayerZoomRange("vector-highlight-fill", S, K), t.getLayer(Ke) && t.setLayerZoomRange(Ke, S, 0), t.getLayer("vector-cluster-count") && t.setLayerZoomRange("vector-cluster-count", S, 0);
|
|
4193
|
+
else {
|
|
4194
|
+
const G = o.clusterZoom ?? 12, U = G - 0.01, re = v.value ? U : K;
|
|
4195
|
+
t.getLayer("vector-circle") && t.setLayerZoomRange("vector-circle", S, re), t.getLayer("vector-highlight-circle") && t.setLayerZoomRange("vector-highlight-circle", S, re), t.getLayer("vector-fill") && t.setLayerZoomRange("vector-fill", G, K), t.getLayer("vector-highlight-fill") && t.setLayerZoomRange("vector-highlight-fill", G, K), t.getLayer(Ke) && t.setLayerZoomRange(Ke, S, U), t.getLayer("vector-cluster-count") && t.setLayerZoomRange("vector-cluster-count", S, U);
|
|
4196
|
+
}
|
|
4191
4197
|
}
|
|
4192
|
-
function
|
|
4198
|
+
function Re() {
|
|
4193
4199
|
if (t != null && t.getSource("vector")) {
|
|
4194
4200
|
try {
|
|
4195
|
-
const
|
|
4201
|
+
const K = t.querySourceFeatures("vector", { sourceLayerId: o.table }).some((G) => {
|
|
4196
4202
|
var re;
|
|
4197
4203
|
const U = (re = G.geometry) == null ? void 0 : re.type;
|
|
4198
4204
|
return U === "Polygon" || U === "MultiPolygon";
|
|
4199
4205
|
});
|
|
4200
|
-
v.value =
|
|
4206
|
+
v.value = K;
|
|
4201
4207
|
} catch {
|
|
4202
4208
|
}
|
|
4203
|
-
|
|
4209
|
+
Be();
|
|
4204
4210
|
}
|
|
4205
4211
|
}
|
|
4206
|
-
const
|
|
4207
|
-
|
|
4212
|
+
const Pe = F();
|
|
4213
|
+
A = Pe.hasQuery, Fe(async () => {
|
|
4208
4214
|
x = (await fetch(`/api/data/${o.table}/${o.colorAttr}`).then((ue) => ue.json())).rows, x.forEach((ue, ce) => {
|
|
4209
4215
|
ue.color || Object.assign(ue, { color: w[ce % 10] });
|
|
4210
4216
|
}), i = new maplibregl.Popup({
|
|
4211
4217
|
closeButton: !1,
|
|
4212
4218
|
closeOnClick: !1
|
|
4213
4219
|
});
|
|
4214
|
-
const
|
|
4215
|
-
if (!
|
|
4216
|
-
const G =
|
|
4220
|
+
const K = C.value;
|
|
4221
|
+
if (!K) return;
|
|
4222
|
+
const G = Pe.center || o.center || R, U = Pe.zoom || o.zoom || 5;
|
|
4217
4223
|
t = new maplibregl.Map({
|
|
4218
4224
|
container: u.value,
|
|
4219
4225
|
style: {
|
|
4220
4226
|
version: 8,
|
|
4221
4227
|
sources: {
|
|
4222
|
-
[
|
|
4228
|
+
[K.id]: { type: "raster", tiles: [K.url], tileSize: 256 }
|
|
4223
4229
|
},
|
|
4224
4230
|
layers: [{
|
|
4225
|
-
id:
|
|
4231
|
+
id: K.id,
|
|
4226
4232
|
type: "raster",
|
|
4227
|
-
source:
|
|
4233
|
+
source: K.id,
|
|
4228
4234
|
minzoom: 0,
|
|
4229
4235
|
maxzoom: 19
|
|
4230
4236
|
}]
|
|
@@ -4236,18 +4242,18 @@ const zr = [
|
|
|
4236
4242
|
maxZoom: o.maxZoom ?? 18,
|
|
4237
4243
|
attributionControl: !1
|
|
4238
4244
|
}), r("update:map", t), t.addControl(new maplibregl.NavigationControl(), "top-right"), t.on("zoom", () => {
|
|
4239
|
-
}), t.on("moveend", Y), t.on("zoomend", Y),
|
|
4245
|
+
}), t.on("moveend", Y), t.on("zoomend", Y), A && D(), t.on("load", () => {
|
|
4240
4246
|
t == null || t.resize(), f.value = !0;
|
|
4241
4247
|
const ue = x.filter((ae) => ae.id).reduce((ae, ve) => [ve.id, ve.color].concat(ae), []), ce = ["match", ["get", o.colorAttr], ...ue, "#808080"];
|
|
4242
|
-
|
|
4248
|
+
L = ce, jr(
|
|
4243
4249
|
o.table,
|
|
4244
4250
|
t,
|
|
4245
4251
|
ce,
|
|
4246
4252
|
o.filter,
|
|
4247
4253
|
o.clusterZoom,
|
|
4248
4254
|
o.pointZoom ?? 12
|
|
4249
|
-
), q(), oe(o.modelValue),
|
|
4250
|
-
ae.sourceId === "vector" && ae.isSourceLoaded && t.getZoom() >= (o.clusterZoom ?? 12) &&
|
|
4255
|
+
), q(), oe(o.modelValue), Be(), t.on("sourcedata", (ae) => {
|
|
4256
|
+
ae.sourceId === "vector" && ae.isSourceLoaded && t.getZoom() >= (o.clusterZoom ?? 12) && Re();
|
|
4251
4257
|
});
|
|
4252
4258
|
});
|
|
4253
4259
|
const re = (ue) => {
|
|
@@ -4257,74 +4263,76 @@ const zr = [
|
|
|
4257
4263
|
};
|
|
4258
4264
|
m.forEach((ue) => {
|
|
4259
4265
|
t.on("click", ue, re);
|
|
4260
|
-
}), t.on("click",
|
|
4261
|
-
var
|
|
4262
|
-
const ce = (
|
|
4266
|
+
}), t.on("click", Ke, (ue) => {
|
|
4267
|
+
var Le, Ie, Ue;
|
|
4268
|
+
const ce = (Le = ue.features) == null ? void 0 : Le[0];
|
|
4263
4269
|
if (!ce) return;
|
|
4264
|
-
const ae = ce.geometry, ve = (ae == null ? void 0 : ae.type) === "Point" ? ae.coordinates : (
|
|
4270
|
+
const ae = ce.geometry, ve = (ae == null ? void 0 : ae.type) === "Point" ? ae.coordinates : (Ue = (Ie = ae == null ? void 0 : ae.coordinates) == null ? void 0 : Ie[0]) == null ? void 0 : Ue[0];
|
|
4265
4271
|
if (!ve) return;
|
|
4266
|
-
const
|
|
4267
|
-
t.easeTo({ center: ve, zoom:
|
|
4268
|
-
}), [...m,
|
|
4272
|
+
const Ze = Math.min(t.getZoom() + 2, t.getMaxZoom());
|
|
4273
|
+
t.easeTo({ center: ve, zoom: Ze });
|
|
4274
|
+
}), [...m, Ke].forEach((ue) => {
|
|
4269
4275
|
t.on("mouseenter", ue, () => {
|
|
4270
4276
|
t.getCanvas().style.cursor = "pointer";
|
|
4271
4277
|
}), t.on("mouseleave", ue, () => {
|
|
4272
4278
|
t.getCanvas().style.cursor = "";
|
|
4273
4279
|
});
|
|
4274
4280
|
}), t.on("mousemove", (ue) => {
|
|
4275
|
-
var
|
|
4281
|
+
var Le;
|
|
4276
4282
|
const ce = t.queryRenderedFeatures(ue.point, { layers: m });
|
|
4277
4283
|
if (!ce || !ce.length) {
|
|
4278
4284
|
i.remove();
|
|
4279
4285
|
return;
|
|
4280
4286
|
}
|
|
4281
|
-
const ae = ce[0], { coordinates: ve } = ae.geometry,
|
|
4282
|
-
d.value = ae.properties, i.setLngLat(
|
|
4287
|
+
const ae = ce[0], { coordinates: ve } = ae.geometry, Ze = ae.geometry.type === "Point" ? ve : ve[0][0];
|
|
4288
|
+
d.value = ae.properties, i.setLngLat(Ze).setHTML((Le = n.value) == null ? void 0 : Le.innerHTML).addTo(t);
|
|
4283
4289
|
});
|
|
4284
|
-
}), E(() => o.center, (
|
|
4285
|
-
t && t.setCenter(
|
|
4286
|
-
}), E(() => o.zoom, (
|
|
4287
|
-
t && t.setZoom(
|
|
4288
|
-
}), E(() => o.minZoom, (
|
|
4289
|
-
t && (t.setMinZoom(
|
|
4290
|
-
}), E(() => o.maxZoom, (
|
|
4291
|
-
t && (t.setMaxZoom(
|
|
4290
|
+
}), E(() => o.center, (S) => {
|
|
4291
|
+
t && t.setCenter(S || R);
|
|
4292
|
+
}), E(() => o.zoom, (S) => {
|
|
4293
|
+
t && t.setZoom(S);
|
|
4294
|
+
}), E(() => o.minZoom, (S) => {
|
|
4295
|
+
t && (t.setMinZoom(S ?? 3), Be());
|
|
4296
|
+
}), E(() => o.maxZoom, (S) => {
|
|
4297
|
+
t && (t.setMaxZoom(S ?? 18), Be());
|
|
4292
4298
|
});
|
|
4293
|
-
function
|
|
4299
|
+
function $e(S, K, G) {
|
|
4294
4300
|
if (!(t != null && t.getSource("vector"))) return;
|
|
4295
4301
|
const U = Bt(
|
|
4296
4302
|
o.table,
|
|
4297
|
-
|
|
4298
|
-
|
|
4303
|
+
S ?? o.filter,
|
|
4304
|
+
K ?? o.clusterZoom ?? 12,
|
|
4299
4305
|
G ?? o.pointZoom ?? 12
|
|
4300
4306
|
);
|
|
4301
4307
|
t.getSource("vector").setTiles([U]);
|
|
4302
4308
|
}
|
|
4303
|
-
return E(() => o.filter, (
|
|
4304
|
-
|
|
4305
|
-
}), E(() => o.clusterZoom, (
|
|
4306
|
-
|
|
4307
|
-
}), E(() => o.pointZoom, (
|
|
4308
|
-
|
|
4309
|
-
}), E(() => o.
|
|
4309
|
+
return E(() => o.filter, (S) => {
|
|
4310
|
+
$e(S);
|
|
4311
|
+
}), E(() => o.clusterZoom, (S) => {
|
|
4312
|
+
$e(void 0, S), Be();
|
|
4313
|
+
}), E(() => o.pointZoom, (S) => {
|
|
4314
|
+
$e(void 0, void 0, S);
|
|
4315
|
+
}), E(() => o.alwaysShowPolygon, () => {
|
|
4316
|
+
Be(), $e();
|
|
4317
|
+
}), E(() => o.modelValue, (S) => {
|
|
4310
4318
|
if (!t) return;
|
|
4311
|
-
const
|
|
4319
|
+
const K = T(S), G = ["all", K, M], U = ["all", K, I];
|
|
4312
4320
|
if (t.getLayer("vector-highlight-circle")) {
|
|
4313
4321
|
t.setFilter("vector-highlight-circle", G);
|
|
4314
|
-
const re =
|
|
4322
|
+
const re = S ? "visible" : "none";
|
|
4315
4323
|
t.setLayoutProperty("vector-highlight-circle", "visibility", re);
|
|
4316
4324
|
}
|
|
4317
4325
|
if (t.getLayer("vector-highlight-fill")) {
|
|
4318
4326
|
t.setFilter("vector-highlight-fill", U);
|
|
4319
|
-
const re =
|
|
4327
|
+
const re = S ? "visible" : "none";
|
|
4320
4328
|
t.setLayoutProperty("vector-highlight-fill", "visibility", re);
|
|
4321
4329
|
}
|
|
4322
|
-
oe(
|
|
4323
|
-
}), E(_, (
|
|
4324
|
-
if (!t ||
|
|
4325
|
-
const G = b.value.find((re) => re.id ===
|
|
4330
|
+
oe(S), S ? fe() : ge();
|
|
4331
|
+
}), E(_, (S, K) => {
|
|
4332
|
+
if (!t || !S) return;
|
|
4333
|
+
const G = b.value.find((re) => re.id === S);
|
|
4326
4334
|
if (!G) return;
|
|
4327
|
-
t.getLayer(
|
|
4335
|
+
t.getLayer(K) && t.removeLayer(K), t.getSource(K) && t.removeSource(K), t.addSource(S, { type: "raster", tiles: [G.url], tileSize: 256 });
|
|
4328
4336
|
const U = t.getLayer("vector-clusters") ? "vector-clusters" : t.getLayer("vector-circle") ? "vector-circle" : void 0;
|
|
4329
4337
|
t.addLayer({
|
|
4330
4338
|
id: G.id,
|
|
@@ -4333,9 +4341,9 @@ const zr = [
|
|
|
4333
4341
|
minzoom: 0,
|
|
4334
4342
|
maxzoom: 19
|
|
4335
4343
|
}, U);
|
|
4336
|
-
}),
|
|
4344
|
+
}), Te(() => {
|
|
4337
4345
|
ge(), t && (t.off("moveend", Y), t.off("zoomend", Y), t.remove());
|
|
4338
|
-
}), (
|
|
4346
|
+
}), (S, K) => {
|
|
4339
4347
|
const G = Pt("tooltip");
|
|
4340
4348
|
return le((p(), h("div", Fr, [
|
|
4341
4349
|
l("div", {
|
|
@@ -4348,7 +4356,7 @@ const zr = [
|
|
|
4348
4356
|
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",
|
|
4349
4357
|
title: "Повернутися до базового вигляду",
|
|
4350
4358
|
onClick: he
|
|
4351
|
-
}, [...
|
|
4359
|
+
}, [...K[1] || (K[1] = [
|
|
4352
4360
|
l("svg", {
|
|
4353
4361
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4354
4362
|
class: "w-4 h-4",
|
|
@@ -4367,7 +4375,7 @@ const zr = [
|
|
|
4367
4375
|
]),
|
|
4368
4376
|
l("div", {
|
|
4369
4377
|
class: H(["absolute left-[20px] bottom-[74px] bg-white rounded-lg z-10 border legend-panel", { "legend-panel--has-header": o.legendTitle || o.isCollapsible }]),
|
|
4370
|
-
style:
|
|
4378
|
+
style: ze(o.legendWidth ? { width: o.legendWidth } : { maxWidth: "250px" })
|
|
4371
4379
|
}, [
|
|
4372
4380
|
o.legendTitle || o.isCollapsible ? (p(), h(N, { key: 0 }, [
|
|
4373
4381
|
l("div", Rr, [
|
|
@@ -4377,18 +4385,18 @@ const zr = [
|
|
|
4377
4385
|
type: "button",
|
|
4378
4386
|
class: "legend-panel__toggle ml-auto shrink-0 p-1.5 rounded-full hover:bg-stone-100 text-stone-600",
|
|
4379
4387
|
"aria-label": k.value ? "Згорнути легенду" : "Розгорнути легенду",
|
|
4380
|
-
onClick:
|
|
4388
|
+
onClick: K[0] || (K[0] = (U) => k.value = !k.value)
|
|
4381
4389
|
}, [
|
|
4382
|
-
k.value ? (p(), h("svg",
|
|
4390
|
+
k.value ? (p(), h("svg", Kr, [...K[2] || (K[2] = [
|
|
4383
4391
|
l("path", { d: "M6 9l6 6 6-6" }, null, -1)
|
|
4384
|
-
])])) : (p(), h("svg", Dr, [...
|
|
4392
|
+
])])) : (p(), h("svg", Dr, [...K[3] || (K[3] = [
|
|
4385
4393
|
l("path", { d: "m18 15-6-6-6 6" }, null, -1)
|
|
4386
4394
|
])]))
|
|
4387
|
-
], 8,
|
|
4395
|
+
], 8, Zr)) : B("", !0)
|
|
4388
4396
|
]),
|
|
4389
4397
|
l("div", {
|
|
4390
4398
|
class: "legend-panel__content overflow-hidden transition-all duration-200 ease-out",
|
|
4391
|
-
style:
|
|
4399
|
+
style: ze(o.isCollapsible && !k.value ? { maxHeight: "0", padding: "0", margin: "0", opacity: "0" } : {})
|
|
4392
4400
|
}, [
|
|
4393
4401
|
l("div", {
|
|
4394
4402
|
class: H(["p-[10px]", k.value && (e(x) || []).length ? "pt-0" : "pt-2"])
|
|
@@ -4400,7 +4408,7 @@ const zr = [
|
|
|
4400
4408
|
l("div", Er, [
|
|
4401
4409
|
l("div", {
|
|
4402
4410
|
class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
|
|
4403
|
-
style:
|
|
4411
|
+
style: ze("background-color:" + U.color)
|
|
4404
4412
|
}, null, 4),
|
|
4405
4413
|
l("div", Tr, [
|
|
4406
4414
|
l("span", Ir, j(U.text), 1),
|
|
@@ -4418,7 +4426,7 @@ const zr = [
|
|
|
4418
4426
|
l("div", Hr, [
|
|
4419
4427
|
l("div", {
|
|
4420
4428
|
class: "w-[15px] h-[15px] rounded-[50%] min-w-[15px]",
|
|
4421
|
-
style:
|
|
4429
|
+
style: ze("background-color:" + U.color)
|
|
4422
4430
|
}, null, 4),
|
|
4423
4431
|
l("div", Wr, [
|
|
4424
4432
|
l("span", Nr, j(U.text), 1),
|
|
@@ -4433,7 +4441,7 @@ const zr = [
|
|
|
4433
4441
|
ref: n,
|
|
4434
4442
|
style: { display: "none" }
|
|
4435
4443
|
}, [
|
|
4436
|
-
be(
|
|
4444
|
+
be(S.$slots, "default", { hoverData: d.value })
|
|
4437
4445
|
], 512),
|
|
4438
4446
|
l("div", Gr, [
|
|
4439
4447
|
(p(!0), h(N, null, ne(b.value, (U) => le((p(), h("div", {
|
|
@@ -4456,7 +4464,7 @@ const zr = [
|
|
|
4456
4464
|
]);
|
|
4457
4465
|
};
|
|
4458
4466
|
}
|
|
4459
|
-
}),
|
|
4467
|
+
}), Lt = {
|
|
4460
4468
|
mounted(c, a) {
|
|
4461
4469
|
if (typeof document > "u") return;
|
|
4462
4470
|
let o = null;
|
|
@@ -4524,67 +4532,72 @@ const zr = [
|
|
|
4524
4532
|
isCollapsible: { type: Boolean },
|
|
4525
4533
|
legendTitle: {},
|
|
4526
4534
|
legendWidth: {},
|
|
4527
|
-
polygonFitBbox: { type: Boolean }
|
|
4535
|
+
polygonFitBbox: { type: Boolean },
|
|
4536
|
+
alwaysShowPolygon: { type: Boolean }
|
|
4528
4537
|
},
|
|
4529
4538
|
emits: ["change:filter", "update:map"],
|
|
4530
4539
|
setup(c, { emit: a }) {
|
|
4531
|
-
var ce, ae, ve,
|
|
4540
|
+
var ce, ae, ve, Ze, Le, Ie, Ue;
|
|
4532
4541
|
const o = Xe();
|
|
4533
|
-
o && !(o != null && o.appContext.directives.tooltip) && (o.appContext.directives.tooltip =
|
|
4534
|
-
function r(
|
|
4535
|
-
return
|
|
4542
|
+
o && !(o != null && o.appContext.directives.tooltip) && (o.appContext.directives.tooltip = Lt);
|
|
4543
|
+
function r($) {
|
|
4544
|
+
return $ ? ($.type === "Point" ? $.coordinates : null) || ($.type.includes("Multi") ? $.coordinates[0][0][0] : $.coordinates[0][0]) : null;
|
|
4536
4545
|
}
|
|
4537
|
-
function t(
|
|
4538
|
-
switch (
|
|
4546
|
+
function t($) {
|
|
4547
|
+
switch ($ == null ? void 0 : $.type) {
|
|
4539
4548
|
case "Polygon":
|
|
4540
|
-
return
|
|
4549
|
+
return $.coordinates[0];
|
|
4541
4550
|
case "MultiPolygon":
|
|
4542
|
-
return
|
|
4551
|
+
return $.coordinates.flatMap((P) => P[0]);
|
|
4543
4552
|
case "LineString":
|
|
4544
|
-
return
|
|
4553
|
+
return $.coordinates;
|
|
4545
4554
|
case "MultiLineString":
|
|
4546
|
-
return
|
|
4555
|
+
return $.coordinates.flat();
|
|
4547
4556
|
default:
|
|
4548
4557
|
return [];
|
|
4549
4558
|
}
|
|
4550
4559
|
}
|
|
4551
|
-
function i(
|
|
4552
|
-
if (
|
|
4553
|
-
const P = t(
|
|
4560
|
+
function i($) {
|
|
4561
|
+
if (!$ || $.type === "Point" || $.type === "MultiPoint") return null;
|
|
4562
|
+
const P = t($);
|
|
4554
4563
|
if (!P.length) return null;
|
|
4555
4564
|
let X = 1 / 0, Q = 1 / 0, ye = -1 / 0, ie = -1 / 0;
|
|
4556
4565
|
return P.forEach(([J, xe]) => {
|
|
4557
4566
|
J < X && (X = J), xe < Q && (Q = xe), J > ye && (ye = J), xe > ie && (ie = xe);
|
|
4558
4567
|
}), [[X, Q], [ye, ie]];
|
|
4559
4568
|
}
|
|
4560
|
-
function g(
|
|
4561
|
-
return (
|
|
4569
|
+
function g($) {
|
|
4570
|
+
return ($ == null ? void 0 : $.type) === "Polygon" || ($ == null ? void 0 : $.type) === "MultiPolygon";
|
|
4562
4571
|
}
|
|
4563
4572
|
const u = c, f = a, k = V(0);
|
|
4564
4573
|
k.value = u.initTotal ?? ((ce = u.rows) == null ? void 0 : ce.length) ?? 0;
|
|
4565
|
-
const m = V(""), v = V(null), y = V(!0), b = V(((ae = u.rows) == null ? void 0 : ae.length) === 1), _ = V(0), C = V(u.rows), s = V(1), n = V(20), d = V(u.filters || []), w = V(""), x = V({}), R = V(((ve = u.rows) == null ? void 0 : ve.length) === 1 ? u.rows[0] : {}), z = V(((
|
|
4574
|
+
const m = V(""), v = V(null), y = V(!0), b = V(((ae = u.rows) == null ? void 0 : ae.length) === 1), _ = V(0), C = V(u.rows), s = V(1), n = V(20), d = V(u.filters || []), w = V(""), x = V({}), R = V(((ve = u.rows) == null ? void 0 : ve.length) === 1 ? u.rows[0] : {}), z = V(((Ze = u.rows) == null ? void 0 : Ze.length) === 1 ? u.rows[0].id : ""), L = V(((Le = u.rows) == null ? void 0 : Le.length) === 1 ? r((Ie = u.rows[0]) == null ? void 0 : Ie.geom) : u.center || null), F = V(((Ue = u.rows) == null ? void 0 : Ue.length) === 1 ? 14 : u.zoom || 5), Z = V(!1), A = V(!1), D = V("");
|
|
4566
4575
|
let Y = !1;
|
|
4567
4576
|
const T = V(null), M = V(null), I = O(() => {
|
|
4568
|
-
var
|
|
4569
|
-
return b.value && !((
|
|
4577
|
+
var $;
|
|
4578
|
+
return b.value && !(($ = R.value) != null && $.geom);
|
|
4570
4579
|
}), q = O({
|
|
4571
4580
|
get: () => I.value ? "" : z.value,
|
|
4572
|
-
set: (
|
|
4573
|
-
z.value =
|
|
4581
|
+
set: ($) => {
|
|
4582
|
+
z.value = $;
|
|
4574
4583
|
}
|
|
4575
4584
|
});
|
|
4576
4585
|
function oe() {
|
|
4577
4586
|
var ie, J, xe;
|
|
4587
|
+
if (u.alwaysShowPolygon) {
|
|
4588
|
+
T.value = null, M.value = null;
|
|
4589
|
+
return;
|
|
4590
|
+
}
|
|
4578
4591
|
if (!u.polygonFitBbox || !v.value || !((ie = R.value) != null && ie.geom)) {
|
|
4579
4592
|
T.value = null, M.value = null;
|
|
4580
4593
|
return;
|
|
4581
4594
|
}
|
|
4582
|
-
const { geom:
|
|
4583
|
-
if (!g(
|
|
4595
|
+
const { geom: $ } = R.value;
|
|
4596
|
+
if (!g($)) {
|
|
4584
4597
|
T.value = null, M.value = null;
|
|
4585
4598
|
return;
|
|
4586
4599
|
}
|
|
4587
|
-
const P = i(
|
|
4600
|
+
const P = i($);
|
|
4588
4601
|
if (!P) {
|
|
4589
4602
|
T.value = null, M.value = null;
|
|
4590
4603
|
return;
|
|
@@ -4596,58 +4609,58 @@ const zr = [
|
|
|
4596
4609
|
} else
|
|
4597
4610
|
T.value = null, M.value = null;
|
|
4598
4611
|
}
|
|
4599
|
-
function fe(
|
|
4600
|
-
return Object.entries(
|
|
4612
|
+
function fe($) {
|
|
4613
|
+
return Object.entries($).filter(([P, X]) => Array.isArray(X) ? X.length : X).map(([P, X]) => `${P}=${X}`).join("|");
|
|
4601
4614
|
}
|
|
4602
4615
|
function ge() {
|
|
4603
4616
|
var Q, ye, ie, J;
|
|
4604
|
-
if (!v.value || !
|
|
4605
|
-
const
|
|
4606
|
-
if (
|
|
4607
|
-
const P = (ie =
|
|
4608
|
-
!P || !X || (
|
|
4617
|
+
if (!v.value || !A.value) return;
|
|
4618
|
+
const $ = (ye = (Q = v.value).getBounds) == null ? void 0 : ye.call(Q);
|
|
4619
|
+
if (!$) return;
|
|
4620
|
+
const P = (ie = $.getSouthWest) == null ? void 0 : ie.call($), X = (J = $.getNorthEast) == null ? void 0 : J.call($);
|
|
4621
|
+
!P || !X || (D.value = `${P.lng} ${P.lat},${X.lng} ${X.lat}`);
|
|
4609
4622
|
}
|
|
4610
|
-
async function he(
|
|
4611
|
-
await
|
|
4623
|
+
async function he($ = !1) {
|
|
4624
|
+
await Ee();
|
|
4612
4625
|
const P = fe(x.value);
|
|
4613
|
-
w.value = P,
|
|
4626
|
+
w.value = P, A.value ? ge() : D.value = "";
|
|
4614
4627
|
try {
|
|
4615
4628
|
const X = {
|
|
4616
4629
|
search: m.value,
|
|
4617
4630
|
limit: n.value.toString(),
|
|
4618
4631
|
page: s.value.toString(),
|
|
4619
4632
|
filter: P,
|
|
4620
|
-
...
|
|
4633
|
+
...A.value && D.value ? { bbox: D.value } : {}
|
|
4621
4634
|
}, Q = new URL(`/api/data/${u.table}`, window.location.origin) + (z.value ? `/${z.value}` : ""), ye = new URLSearchParams(X).toString(), ie = await fetch(`${Q.toString()}?${ye}`).then((J) => J.json());
|
|
4622
4635
|
if (z.value) {
|
|
4623
4636
|
let J;
|
|
4624
|
-
if (ie.rows.length > 1 ? J = ie.rows.find((xe) => xe.id === z.value) : [J] = ie.rows, R.value = J,
|
|
4637
|
+
if (ie.rows.length > 1 ? J = ie.rows.find((xe) => xe.id === z.value) : [J] = ie.rows, R.value = J, !$ && (J != null && J.geom)) {
|
|
4625
4638
|
const xe = u.polygonFitBbox ? i(J.geom) : null;
|
|
4626
|
-
xe && v.value ? v.value.fitBounds(xe, { padding: 20, maxZoom: 16, duration: 500 }) : (
|
|
4639
|
+
xe && v.value ? v.value.fitBounds(xe, { padding: 20, maxZoom: 16, duration: 500 }) : (L.value = r(J.geom), F.value = 14);
|
|
4627
4640
|
}
|
|
4628
4641
|
oe(), b.value = !0;
|
|
4629
4642
|
} else
|
|
4630
|
-
T.value = null, M.value = null, b.value = !1,
|
|
4631
|
-
|
|
4643
|
+
T.value = null, M.value = null, b.value = !1, Z.value || (F.value = u.zoom || 5), C.value = ie == null ? void 0 : ie.rows;
|
|
4644
|
+
Z.value = !1, k.value = ie.filtered, Ja({ page: s.value, filter: P, id: z.value, filterByView: A.value });
|
|
4632
4645
|
} catch (X) {
|
|
4633
4646
|
console.error(X.message);
|
|
4634
4647
|
}
|
|
4635
4648
|
}
|
|
4636
|
-
const
|
|
4637
|
-
function Re() {
|
|
4638
|
-
!v.value || Y || !L.value || (v.value.on("moveend", Fe), v.value.on("zoomend", Fe), Y = !0);
|
|
4639
|
-
}
|
|
4649
|
+
const Be = gt(() => he(), 300), Re = gt(() => he(!0), 400);
|
|
4640
4650
|
function Pe() {
|
|
4641
|
-
!v.value ||
|
|
4651
|
+
!v.value || Y || !A.value || (v.value.on("moveend", Re), v.value.on("zoomend", Re), Y = !0);
|
|
4652
|
+
}
|
|
4653
|
+
function $e() {
|
|
4654
|
+
!v.value || !Y || (v.value.off("moveend", Re), v.value.off("zoomend", Re), Y = !1);
|
|
4642
4655
|
}
|
|
4643
|
-
function $
|
|
4644
|
-
n.value =
|
|
4656
|
+
function S($) {
|
|
4657
|
+
n.value = $, s.value = 1, he();
|
|
4645
4658
|
}
|
|
4646
|
-
function
|
|
4647
|
-
s.value =
|
|
4659
|
+
function K($) {
|
|
4660
|
+
s.value = $, he();
|
|
4648
4661
|
}
|
|
4649
|
-
function G(
|
|
4650
|
-
x.value =
|
|
4662
|
+
function G($) {
|
|
4663
|
+
x.value = $.data, s.value = 1, z.value ? z.value = "" : he(), f("change:filter", $);
|
|
4651
4664
|
}
|
|
4652
4665
|
async function U() {
|
|
4653
4666
|
if (u.filters) return;
|
|
@@ -4657,42 +4670,42 @@ const zr = [
|
|
|
4657
4670
|
function re() {
|
|
4658
4671
|
x.value = {}, m.value = "", he();
|
|
4659
4672
|
}
|
|
4660
|
-
|
|
4673
|
+
Fe(async () => {
|
|
4661
4674
|
var X, Q;
|
|
4662
4675
|
_.value = window.innerWidth, _.value < 1e3 && (y.value = !1);
|
|
4663
|
-
const
|
|
4664
|
-
s.value = Number(
|
|
4665
|
-
const P =
|
|
4666
|
-
P !== null ?
|
|
4676
|
+
const $ = new URLSearchParams(window.location.search);
|
|
4677
|
+
s.value = Number($.get("page")) || 1, n.value = Number($.get("limit")) || n.value, z.value = $.get("id") || "", b.value = !!z.value, w.value = $.get("filter") || "";
|
|
4678
|
+
const P = $.get("bbox");
|
|
4679
|
+
P !== null ? A.value = P !== "0" : A.value = !1, (Q = (X = $.get("filter")) == null ? void 0 : X.split("|")) == null || Q.forEach((ye) => {
|
|
4667
4680
|
const [ie, J] = ye.split("=");
|
|
4668
4681
|
ie && (x.value[ie] = J != null && J.includes(",") ? J.split(",") : [J]);
|
|
4669
4682
|
}), U(), !C.value && !z.value && he();
|
|
4670
|
-
}),
|
|
4671
|
-
|
|
4683
|
+
}), Te(() => {
|
|
4684
|
+
$e();
|
|
4672
4685
|
});
|
|
4673
4686
|
function we() {
|
|
4674
|
-
|
|
4687
|
+
Z.value = !0, b.value = !1, R.value = null, z.value = "", T.value = null, M.value = null;
|
|
4675
4688
|
}
|
|
4676
|
-
function ue(
|
|
4677
|
-
if (
|
|
4678
|
-
const P = u.polygonFitBbox ? i(
|
|
4679
|
-
P && v.value ? v.value.fitBounds(P, { padding: 20, maxZoom: 16, duration: 500 }) : (
|
|
4689
|
+
function ue($) {
|
|
4690
|
+
if ($ != null && $.geom) {
|
|
4691
|
+
const P = u.polygonFitBbox ? i($.geom) : null;
|
|
4692
|
+
P && v.value ? v.value.fitBounds(P, { padding: 20, maxZoom: 16, duration: 500 }) : (L.value = r($.geom), F.value = 16);
|
|
4680
4693
|
}
|
|
4681
|
-
R.value =
|
|
4694
|
+
R.value = $, z.value = $.id, oe();
|
|
4682
4695
|
}
|
|
4683
|
-
return E(v, (
|
|
4696
|
+
return E(v, ($) => {
|
|
4684
4697
|
var P;
|
|
4685
|
-
f("update:map",
|
|
4686
|
-
}), E(m, (
|
|
4687
|
-
|
|
4698
|
+
f("update:map", $), $ && A.value && Pe(), $ && u.polygonFitBbox && ((P = R.value) != null && P.geom) && oe();
|
|
4699
|
+
}), E(m, ($) => {
|
|
4700
|
+
$ || he();
|
|
4688
4701
|
}), E(z, () => {
|
|
4689
4702
|
he();
|
|
4690
|
-
}), E(
|
|
4691
|
-
|
|
4692
|
-
}), (
|
|
4703
|
+
}), E(A, () => {
|
|
4704
|
+
A.value ? Pe() : $e(), he();
|
|
4705
|
+
}), ($, P) => {
|
|
4693
4706
|
var X;
|
|
4694
4707
|
return p(), h("section", en, [
|
|
4695
|
-
be(
|
|
4708
|
+
be($.$slots, "header", {
|
|
4696
4709
|
title: u.title,
|
|
4697
4710
|
total: k.value
|
|
4698
4711
|
}),
|
|
@@ -4703,7 +4716,7 @@ const zr = [
|
|
|
4703
4716
|
"onUpdate:modelValue": P[0] || (P[0] = (Q) => m.value = Q),
|
|
4704
4717
|
name: "search",
|
|
4705
4718
|
label: "Пошук",
|
|
4706
|
-
onChange: e(
|
|
4719
|
+
onChange: e(Be)
|
|
4707
4720
|
}, null, 8, ["modelValue", "onChange"]),
|
|
4708
4721
|
d.value.length ? (p(), W(e(Ye), {
|
|
4709
4722
|
key: 0,
|
|
@@ -4748,7 +4761,7 @@ const zr = [
|
|
|
4748
4761
|
b.value ? "hidden" : ""
|
|
4749
4762
|
])
|
|
4750
4763
|
}, [
|
|
4751
|
-
(X =
|
|
4764
|
+
(X = $.$slots) != null && X.header ? B("", !0) : (p(), h("div", nn, [
|
|
4752
4765
|
l("div", null, [
|
|
4753
4766
|
l("span", sn, j(u.title), 1),
|
|
4754
4767
|
l("span", un, j(k.value), 1),
|
|
@@ -4758,15 +4771,15 @@ const zr = [
|
|
|
4758
4771
|
le(l("input", {
|
|
4759
4772
|
type: "checkbox",
|
|
4760
4773
|
class: "accent-blue-600 w-4 h-4",
|
|
4761
|
-
"onUpdate:modelValue": P[4] || (P[4] = (Q) =>
|
|
4774
|
+
"onUpdate:modelValue": P[4] || (P[4] = (Q) => A.value = Q)
|
|
4762
4775
|
}, null, 512), [
|
|
4763
|
-
[
|
|
4776
|
+
[Zt, A.value]
|
|
4764
4777
|
]),
|
|
4765
4778
|
P[11] || (P[11] = l("span", null, "В межах видимої області", -1))
|
|
4766
4779
|
])) : B("", !0)
|
|
4767
4780
|
])),
|
|
4768
4781
|
l("div", dn, [
|
|
4769
|
-
k.value >= 1 ? be(
|
|
4782
|
+
k.value >= 1 ? be($.$slots, "table", {
|
|
4770
4783
|
key: 0,
|
|
4771
4784
|
rows: C.value,
|
|
4772
4785
|
selectRow: ue
|
|
@@ -4788,8 +4801,8 @@ const zr = [
|
|
|
4788
4801
|
total: k.value,
|
|
4789
4802
|
currentPage: s.value ?? 1,
|
|
4790
4803
|
pageSize: n.value,
|
|
4791
|
-
onPageChange: P[5] || (P[5] = (Q) =>
|
|
4792
|
-
onPageSizeChange: P[6] || (P[6] = (Q) =>
|
|
4804
|
+
onPageChange: P[5] || (P[5] = (Q) => K(Q)),
|
|
4805
|
+
onPageSizeChange: P[6] || (P[6] = (Q) => S(Q))
|
|
4793
4806
|
}, null, 8, ["total", "currentPage", "pageSize"])
|
|
4794
4807
|
])
|
|
4795
4808
|
])) : B("", !0)
|
|
@@ -4801,7 +4814,7 @@ const zr = [
|
|
|
4801
4814
|
),
|
|
4802
4815
|
style: { height: "calc(100vh - 152px)" }
|
|
4803
4816
|
}, [
|
|
4804
|
-
be(
|
|
4817
|
+
be($.$slots, "details", {
|
|
4805
4818
|
table: u.table,
|
|
4806
4819
|
selectedRow: R.value,
|
|
4807
4820
|
closeObjCard: we
|
|
@@ -4817,9 +4830,10 @@ const zr = [
|
|
|
4817
4830
|
maxZoom: u.maxZoom,
|
|
4818
4831
|
colorAttr: u.colorAttr,
|
|
4819
4832
|
filter: w.value,
|
|
4820
|
-
center:
|
|
4821
|
-
clusterZoom: T.value ?? u.clusterZoom,
|
|
4822
|
-
pointZoom: M.value ?? 12,
|
|
4833
|
+
center: L.value,
|
|
4834
|
+
clusterZoom: u.alwaysShowPolygon ? 0 : T.value ?? u.clusterZoom,
|
|
4835
|
+
pointZoom: u.alwaysShowPolygon ? 0 : M.value ?? 12,
|
|
4836
|
+
alwaysShowPolygon: u.alwaysShowPolygon,
|
|
4823
4837
|
modelValue: q.value,
|
|
4824
4838
|
"onUpdate:modelValue": P[8] || (P[8] = (Q) => q.value = Q),
|
|
4825
4839
|
layers: u.layers,
|
|
@@ -4828,11 +4842,11 @@ const zr = [
|
|
|
4828
4842
|
legendWidth: u.legendWidth
|
|
4829
4843
|
}, {
|
|
4830
4844
|
default: Ve(({ hoverData: Q }) => [
|
|
4831
|
-
be(
|
|
4845
|
+
be($.$slots, "popup", { data: Q })
|
|
4832
4846
|
]),
|
|
4833
4847
|
_: 3
|
|
4834
|
-
}, 8, ["table", "map", "zoom", "minZoom", "maxZoom", "colorAttr", "filter", "center", "clusterZoom", "pointZoom", "modelValue", "layers", "isCollapsible", "legendTitle", "legendWidth"]),
|
|
4835
|
-
be(
|
|
4848
|
+
}, 8, ["table", "map", "zoom", "minZoom", "maxZoom", "colorAttr", "filter", "center", "clusterZoom", "pointZoom", "alwaysShowPolygon", "modelValue", "layers", "isCollapsible", "legendTitle", "legendWidth"]),
|
|
4849
|
+
be($.$slots, "default", {
|
|
4836
4850
|
table: u.table,
|
|
4837
4851
|
map: v.value,
|
|
4838
4852
|
selectedRow: R.value
|
|
@@ -4849,7 +4863,7 @@ const zr = [
|
|
|
4849
4863
|
}
|
|
4850
4864
|
});
|
|
4851
4865
|
ht.install = (c) => {
|
|
4852
|
-
c.component("VsPartsMap", ht), c._context.directives.tooltip || c.directive("tooltip",
|
|
4866
|
+
c.component("VsPartsMap", ht), c._context.directives.tooltip || c.directive("tooltip", Lt);
|
|
4853
4867
|
};
|
|
4854
4868
|
export {
|
|
4855
4869
|
ht as default
|