@opengis/form 0.0.187 → 0.0.189
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.
|
@@ -22,16 +22,16 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
22
22
|
const t = e, n = D(!1), l = D({ top: "0px", left: "0px" });
|
|
23
23
|
function a(i) {
|
|
24
24
|
if (!t.text) return;
|
|
25
|
-
const
|
|
25
|
+
const r = i.currentTarget.getBoundingClientRect();
|
|
26
26
|
l.value = {
|
|
27
|
-
top: `${
|
|
28
|
-
left: `${Math.min(
|
|
27
|
+
top: `${r.bottom + 4}px`,
|
|
28
|
+
left: `${Math.min(r.left, window.innerWidth - 230)}px`
|
|
29
29
|
}, n.value = !0;
|
|
30
30
|
}
|
|
31
31
|
function o() {
|
|
32
32
|
n.value = !1;
|
|
33
33
|
}
|
|
34
|
-
return (i,
|
|
34
|
+
return (i, r) => (u(), m(Ae, null, [
|
|
35
35
|
c("span", {
|
|
36
36
|
class: "inline-flex items-center",
|
|
37
37
|
onMouseenter: a,
|
|
@@ -81,14 +81,14 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
81
81
|
columns: {}
|
|
82
82
|
},
|
|
83
83
|
setup(e) {
|
|
84
|
-
const t = e, n = y(() => typeof t.item?.label == "string" && t.item.label ? t.item.label : t.item?.ua || t.label || t.ua), l = y(() => !!n.value), a = y(() => !!t.item?.rules?.includes("required")), o = y(() => t.item?.info || ""), i = ut("schema-by-name"),
|
|
84
|
+
const t = e, n = y(() => typeof t.item?.label == "string" && t.item.label ? t.item.label : t.item?.ua || t.label || t.ua), l = y(() => !!n.value), a = y(() => !!t.item?.rules?.includes("required")), o = y(() => t.item?.info || ""), i = ut("schema-by-name"), r = {
|
|
85
85
|
en: Il?.form?.autofillFrom,
|
|
86
86
|
uk: Tl?.form?.autofillFrom
|
|
87
87
|
}, d = y(() => {
|
|
88
88
|
const p = t.item?.__autoMeta;
|
|
89
89
|
if (!p || p?.source !== "parent-auto" || !p?.parentField) return "";
|
|
90
90
|
const x = String(t.item?.__locale || "uk"), b = String(p.parentField), _ = i?.value?.[b], w = _?.[`label:${x}`] || (x !== "uk" ? _?.[x] : void 0) || _?.label || _?.ua || _?.en || b;
|
|
91
|
-
return `${
|
|
91
|
+
return `${r[x] || r.uk}: ${w}`;
|
|
92
92
|
});
|
|
93
93
|
return (p, x) => (u(), m("div", Zo, [
|
|
94
94
|
l.value ? (u(), m("div", Jo, [
|
|
@@ -138,15 +138,15 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
138
138
|
if (!_ || _?.source !== "parent-auto" || !_?.parentField) return "";
|
|
139
139
|
const w = String(t.item?.__locale || "uk"), g = String(_.parentField), $ = a?.value?.[g], v = $?.[`label:${w}`] || (w !== "uk" ? $?.[w] : void 0) || $?.label || $?.ua || $?.en || g;
|
|
140
140
|
return `${o[w] || o.uk}: ${v}`;
|
|
141
|
-
}),
|
|
142
|
-
const { container: _, label: w } =
|
|
141
|
+
}), r = y(() => t.columns ?? { container: 12, label: 3 }), d = y(() => {
|
|
142
|
+
const { container: _, label: w } = r.value;
|
|
143
143
|
return !_ || _ <= 0 ? 0 : Math.min(Math.max(w ?? 0, 0), _) / _;
|
|
144
144
|
}), p = y(() => t.item?.type === "html" || d.value <= 0 ? !1 : !!n.value), x = y(() => {
|
|
145
145
|
if (!p.value) return {};
|
|
146
146
|
const _ = `${d.value * 100}%`;
|
|
147
147
|
return { flexBasis: _, maxWidth: _ };
|
|
148
148
|
}), b = y(() => {
|
|
149
|
-
const { container: _, label: w } =
|
|
149
|
+
const { container: _, label: w } = r.value;
|
|
150
150
|
if (!_ || _ <= 0) return {};
|
|
151
151
|
if (t.item?.type === "html") return { flexBasis: "100%", maxWidth: "100%" };
|
|
152
152
|
if (!p.value) return { flexBasis: "100%", maxWidth: "100%" };
|
|
@@ -228,8 +228,8 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
228
228
|
const t = e, n = D("uk");
|
|
229
229
|
y(() => (t.item ?? {})?.[n.value] ?? t.ua ?? t.label ?? "");
|
|
230
230
|
const l = y(() => t.item?.description ?? ""), a = y(() => Array.isArray(t.item?.rules) && t.item.rules.includes("required")), o = y(() => (typeof t.error == "string" ? t.error : "") ?? ""), i = () => {
|
|
231
|
-
const
|
|
232
|
-
n.value =
|
|
231
|
+
const r = typeof localStorage < "u" ? localStorage.getItem("locale") : null;
|
|
232
|
+
n.value = r || "uk";
|
|
233
233
|
};
|
|
234
234
|
return lt(() => {
|
|
235
235
|
try {
|
|
@@ -239,7 +239,7 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
239
239
|
window.addEventListener("storage", i);
|
|
240
240
|
}), fn(() => {
|
|
241
241
|
window.removeEventListener("storage", i);
|
|
242
|
-
}), (
|
|
242
|
+
}), (r, d) => (u(), m("div", {
|
|
243
243
|
class: ie(["w-full relative", { "opacity-60": e.item?.disabled }])
|
|
244
244
|
}, [
|
|
245
245
|
c("div", {
|
|
@@ -259,7 +259,7 @@ const Ta = /* @__PURE__ */ ve({
|
|
|
259
259
|
c("div", {
|
|
260
260
|
class: ie(["w-full", ["select", "native-select"].includes(e.item.type) ? "md:w-[30%]" : "md:w-auto"])
|
|
261
261
|
}, [
|
|
262
|
-
dt(
|
|
262
|
+
dt(r.$slots, "default", Cl(Ml(r.$attrs)))
|
|
263
263
|
], 2)
|
|
264
264
|
], 2),
|
|
265
265
|
o.value ? (u(), m("p", yr, de(o.value), 1)) : K("", !0)
|
|
@@ -298,9 +298,9 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
298
298
|
emits: ["update:modelValue"],
|
|
299
299
|
setup(e) {
|
|
300
300
|
const t = e, { inputClass: n } = ht(t.style), l = Ke(e, "modelValue"), a = y(() => !!t.disabled), o = y(() => t.placeholder ?? "");
|
|
301
|
-
return (i,
|
|
301
|
+
return (i, r) => Re((u(), m("input", {
|
|
302
302
|
type: "password",
|
|
303
|
-
"onUpdate:modelValue":
|
|
303
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => l.value = d),
|
|
304
304
|
placeholder: o.value,
|
|
305
305
|
disabled: a.value,
|
|
306
306
|
class: ie(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(n), { "!border-red-600": e.error }]]),
|
|
@@ -329,7 +329,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
329
329
|
}),
|
|
330
330
|
emits: ["update:modelValue"],
|
|
331
331
|
setup(e) {
|
|
332
|
-
const t = e, { inputClass: n } = ht(t.style), l = Ke(e, "modelValue"), a = y(() => !!t.disabled), o = y(() => t.placeholder ?? ""), i = y(() => t.maxlength ?? void 0),
|
|
332
|
+
const t = e, { inputClass: n } = ht(t.style), l = Ke(e, "modelValue"), a = y(() => !!t.disabled), o = y(() => t.placeholder ?? ""), i = y(() => t.maxlength ?? void 0), r = y(() => t.minlength ?? void 0);
|
|
333
333
|
function d() {
|
|
334
334
|
typeof l.value == "string" && (l.value = l.value.trim());
|
|
335
335
|
}
|
|
@@ -339,7 +339,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
339
339
|
placeholder: o.value,
|
|
340
340
|
disabled: a.value,
|
|
341
341
|
maxlength: i.value,
|
|
342
|
-
minlength:
|
|
342
|
+
minlength: r.value,
|
|
343
343
|
onBlur: d,
|
|
344
344
|
class: ie(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [e.customClass, q(n), { "!border-red-600": e.error }]]),
|
|
345
345
|
style: { border: "1px solid #CFD9E0" }
|
|
@@ -384,7 +384,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
384
384
|
if (x == null || x === "") return;
|
|
385
385
|
const b = typeof x == "string" ? x.trim().replace(",", ".") : x, _ = Number(b);
|
|
386
386
|
return Number.isFinite(_) ? _ : void 0;
|
|
387
|
-
},
|
|
387
|
+
}, r = y(() => i(t.min ?? l.min)), d = y(() => i(t.max ?? l.max)), p = y(() => {
|
|
388
388
|
if (t.step !== void 0 && t.step !== null && t.step !== "") return t.step;
|
|
389
389
|
const x = l.step;
|
|
390
390
|
return typeof x == "number" || typeof x == "string" ? x : "any";
|
|
@@ -399,7 +399,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
399
399
|
style: {
|
|
400
400
|
border: "1px solid #CFD9E0"
|
|
401
401
|
},
|
|
402
|
-
min:
|
|
402
|
+
min: r.value,
|
|
403
403
|
max: d.value
|
|
404
404
|
}, null, 10, $r)), [
|
|
405
405
|
[at, a.value]
|
|
@@ -434,7 +434,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
434
434
|
const n = t, l = e, a = y({
|
|
435
435
|
get: () => l.modelValue,
|
|
436
436
|
set: (w) => n("update:modelValue", w)
|
|
437
|
-
}), o = y(() => !!l.disabled), i = y(() => Sn(l.option)),
|
|
437
|
+
}), o = y(() => !!l.disabled), i = y(() => Sn(l.option)), r = y(() => Cn(l.option)), d = y(() => Qt(l.option)), p = y(() => !!(d.value && !i.value && !r.value)), x = y(() => !!(i.value && d.value)), b = y(() => d.value ? { color: d.value } : void 0), _ = y(() => {
|
|
438
438
|
if (!(!i.value || !d.value))
|
|
439
439
|
return {
|
|
440
440
|
backgroundColor: d.value,
|
|
@@ -489,7 +489,7 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
489
489
|
width: "16",
|
|
490
490
|
src: i.value,
|
|
491
491
|
alt: "icon"
|
|
492
|
-
}, null, 8, Vr)) :
|
|
492
|
+
}, null, 8, Vr)) : r.value ? (u(), we($t(r.value), {
|
|
493
493
|
key: 3,
|
|
494
494
|
class: "h-4 w-4",
|
|
495
495
|
style: Oe(b.value)
|
|
@@ -528,12 +528,12 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
528
528
|
set: ($) => {
|
|
529
529
|
l("update:modelValue", $);
|
|
530
530
|
}
|
|
531
|
-
}), o = y(() => Array.isArray(a.value) ? a.value.includes(n.value) : a.value === !0 || a.value === n.value), i = y(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs"),
|
|
531
|
+
}), o = y(() => Array.isArray(a.value) ? a.value.includes(n.value) : a.value === !0 || a.value === n.value), i = y(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs"), r = y(() => ({
|
|
532
532
|
...n.option ?? {},
|
|
533
533
|
icon: n.option?.icon ?? n.icon,
|
|
534
534
|
imgUrl: n.option?.imgUrl ?? n.imgUrl,
|
|
535
535
|
color: n.option?.color
|
|
536
|
-
})), d = y(() => Sn(
|
|
536
|
+
})), d = y(() => Sn(r.value)), p = y(() => Cn(r.value)), x = y(() => Qt(r.value)), b = y(() => !!(x.value && !d.value && !p.value)), _ = y(() => !!(d.value && x.value)), w = y(() => x.value ? { color: x.value } : void 0), g = y(() => {
|
|
537
537
|
if (!(!d.value || !x.value))
|
|
538
538
|
return {
|
|
539
539
|
backgroundColor: x.value,
|
|
@@ -613,15 +613,15 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
613
613
|
setup(e, { emit: t }) {
|
|
614
614
|
const n = e, l = t, a = `radio-${Math.floor(Math.random() * 1e4)}`, o = y({
|
|
615
615
|
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
616
|
-
set: (
|
|
616
|
+
set: (r) => {
|
|
617
617
|
if (Array.isArray(n.modelValue)) {
|
|
618
618
|
let d = [...n.modelValue];
|
|
619
|
-
|
|
619
|
+
r ? d.includes(n.value) || d.push(n.value) : d = d.filter((p) => p !== n.value), l("update:modelValue", d);
|
|
620
620
|
} else
|
|
621
|
-
l("update:modelValue",
|
|
621
|
+
l("update:modelValue", r);
|
|
622
622
|
}
|
|
623
623
|
}), i = D(`vs-checkbox-${n.view || "default"}`);
|
|
624
|
-
return (
|
|
624
|
+
return (r, d) => (u(), m("div", Br, [
|
|
625
625
|
(u(), we($t(i.value === "vs-checkbox-buttons" ? q(Or) : q(Dr)), {
|
|
626
626
|
value: e.value,
|
|
627
627
|
label: e.label,
|
|
@@ -747,8 +747,8 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
747
747
|
setup(e) {
|
|
748
748
|
const t = e, { inputClass: n } = ht(t.style), l = Ke(e, "modelValue"), a = D(null);
|
|
749
749
|
let o = null;
|
|
750
|
-
function i(
|
|
751
|
-
const d =
|
|
750
|
+
function i(r) {
|
|
751
|
+
const d = r == null ? "" : String(r), p = {
|
|
752
752
|
9: /[0-9]/,
|
|
753
753
|
A: /[a-zA-Z]/,
|
|
754
754
|
"*": /[a-zA-Z0-9]/
|
|
@@ -769,8 +769,8 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
769
769
|
}
|
|
770
770
|
return lt(async () => {
|
|
771
771
|
if (a.value) {
|
|
772
|
-
const { default:
|
|
773
|
-
o =
|
|
772
|
+
const { default: r } = await import("./index-W-qQIppj.js"), d = i(t.mask || "");
|
|
773
|
+
o = r(a.value, d), o.on("accept", () => {
|
|
774
774
|
l.value = t.unmask ? o.unmaskedValue : o.value;
|
|
775
775
|
}), o.on("complete", () => {
|
|
776
776
|
l.value = t.unmask ? o.unmaskedValue : o.value;
|
|
@@ -778,14 +778,14 @@ const xr = ["placeholder", "disabled"], wr = /* @__PURE__ */ ve({
|
|
|
778
778
|
}
|
|
779
779
|
}), It(() => {
|
|
780
780
|
o?.destroy();
|
|
781
|
-
}), ge(() => t.mask, (
|
|
781
|
+
}), ge(() => t.mask, (r) => {
|
|
782
782
|
if (o) {
|
|
783
|
-
const d = i(
|
|
783
|
+
const d = i(r || "");
|
|
784
784
|
o.updateOptions(d);
|
|
785
785
|
}
|
|
786
|
-
}), ge(l, (
|
|
787
|
-
o && o.unmaskedValue !==
|
|
788
|
-
}), (
|
|
786
|
+
}), ge(l, (r) => {
|
|
787
|
+
o && o.unmaskedValue !== r && (o.value = r != null ? String(r) : "");
|
|
788
|
+
}), (r, d) => (u(), m("input", {
|
|
789
789
|
type: "text",
|
|
790
790
|
ref_key: "inputEl",
|
|
791
791
|
ref: a,
|
|
@@ -875,7 +875,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
875
875
|
setup(e) {
|
|
876
876
|
const t = e, n = y(() => `^\\+[1-9]\\d{${(Zt(t.mask || Wt) || Zt(Wt)) - 1}}$`), { inputClass: l } = ht(t.style), a = Ke(e, "modelValue"), o = D(null);
|
|
877
877
|
let i = null;
|
|
878
|
-
function
|
|
878
|
+
function r(x) {
|
|
879
879
|
const b = {
|
|
880
880
|
9: /[0-9]/,
|
|
881
881
|
A: /[a-zA-Z]/,
|
|
@@ -908,14 +908,14 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
908
908
|
}
|
|
909
909
|
return lt(async () => {
|
|
910
910
|
if (!o.value) return;
|
|
911
|
-
const { default: x } = await import("./index-W-qQIppj.js"), b =
|
|
911
|
+
const { default: x } = await import("./index-W-qQIppj.js"), b = r(t.mask || "");
|
|
912
912
|
i = x(o.value, b), i.on("accept", p), i.on("complete", p);
|
|
913
913
|
const _ = d(a.value);
|
|
914
914
|
i.unmaskedValue = _;
|
|
915
915
|
}), It(() => {
|
|
916
916
|
i?.destroy(), i = null;
|
|
917
917
|
}), ge(() => t.mask, (x) => {
|
|
918
|
-
i && i.updateOptions(
|
|
918
|
+
i && i.updateOptions(r(x || ""));
|
|
919
919
|
}), ge(() => t.disabled, (x) => {
|
|
920
920
|
i && i.updateOptions({ disabled: x });
|
|
921
921
|
}), ge(a, (x) => {
|
|
@@ -968,7 +968,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
968
968
|
}),
|
|
969
969
|
emits: ["update:modelValue"],
|
|
970
970
|
setup(e) {
|
|
971
|
-
const t = e, n = Ke(e, "modelValue"), l = y(() => !!t.disabled), a = y(() => Sn(t.option)), o = y(() => Cn(t.option)), i = y(() => Qt(t.option)),
|
|
971
|
+
const t = e, n = Ke(e, "modelValue"), l = y(() => !!t.disabled), a = y(() => Sn(t.option)), o = y(() => Cn(t.option)), i = y(() => Qt(t.option)), r = y(() => !!(i.value && !a.value && !o.value)), d = y(() => !!(a.value && i.value)), p = y(() => i.value ? { color: i.value } : void 0), x = y(() => {
|
|
972
972
|
if (!(!a.value || !i.value))
|
|
973
973
|
return {
|
|
974
974
|
backgroundColor: i.value,
|
|
@@ -1010,7 +1010,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1010
1010
|
class: "w-full",
|
|
1011
1011
|
innerHTML: t.html
|
|
1012
1012
|
}, null, 8, Jr)) : (u(), m("div", Qr, [
|
|
1013
|
-
|
|
1013
|
+
r.value ? (u(), m("span", {
|
|
1014
1014
|
key: 0,
|
|
1015
1015
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
1016
1016
|
style: Oe({ background: i.value })
|
|
@@ -1060,7 +1060,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1060
1060
|
}),
|
|
1061
1061
|
emits: ["update:modelValue"],
|
|
1062
1062
|
setup(e) {
|
|
1063
|
-
const t = e, n = Ke(e, "modelValue"), l = y(() => !!t.disabled), a = y(() => Sn(t.option)), o = y(() => Cn(t.option)), i = y(() => Qt(t.option)),
|
|
1063
|
+
const t = e, n = Ke(e, "modelValue"), l = y(() => !!t.disabled), a = y(() => Sn(t.option)), o = y(() => Cn(t.option)), i = y(() => Qt(t.option)), r = y(() => !!(i.value && !a.value && !o.value)), d = y(() => !!(a.value && i.value)), p = y(() => i.value ? { color: i.value } : void 0), x = y(() => {
|
|
1064
1064
|
if (!(!a.value || !i.value))
|
|
1065
1065
|
return {
|
|
1066
1066
|
backgroundColor: i.value,
|
|
@@ -1095,7 +1095,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1095
1095
|
class: "w-full",
|
|
1096
1096
|
innerHTML: t.html
|
|
1097
1097
|
}, null, 8, as)) : (u(), m("div", os, [
|
|
1098
|
-
|
|
1098
|
+
r.value ? (u(), m("span", {
|
|
1099
1099
|
key: 0,
|
|
1100
1100
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
1101
1101
|
style: Oe({ background: i.value })
|
|
@@ -1134,8 +1134,8 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1134
1134
|
try {
|
|
1135
1135
|
const o = new URLSearchParams();
|
|
1136
1136
|
o.set("json", "1"), l && o.set("key", l), a.parentValue !== void 0 && a.parentValue !== null && a.parentValue !== "" && o.set("parent", String(a.parentValue)), a.start === 1 && o.set("start", "1");
|
|
1137
|
-
const
|
|
1138
|
-
return oa(
|
|
1137
|
+
const r = await (await fetch(`${ra(a)}?${o.toString()}`)).json();
|
|
1138
|
+
return oa(r);
|
|
1139
1139
|
} catch {
|
|
1140
1140
|
return [];
|
|
1141
1141
|
}
|
|
@@ -1149,8 +1149,8 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1149
1149
|
try {
|
|
1150
1150
|
const o = new URLSearchParams();
|
|
1151
1151
|
o.set("json", "1"), o.set("val", String(l)), a.parentValue !== void 0 && a.parentValue !== null && a.parentValue !== "" && o.set("parent", String(a.parentValue)), a.start === 1 && o.set("start", "1");
|
|
1152
|
-
const
|
|
1153
|
-
return oa(
|
|
1152
|
+
const r = await (await fetch(`${ra(a)}?${o.toString()}`)).json();
|
|
1153
|
+
return oa(r)[0] ?? null;
|
|
1154
1154
|
} catch {
|
|
1155
1155
|
return null;
|
|
1156
1156
|
}
|
|
@@ -1171,7 +1171,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1171
1171
|
host: e.host,
|
|
1172
1172
|
start: e.start,
|
|
1173
1173
|
parentValue: a.value
|
|
1174
|
-
})),
|
|
1174
|
+
})), r = async (d = "") => {
|
|
1175
1175
|
const p = e.data ? await o(d) : e.options ? [...e.options] : [];
|
|
1176
1176
|
return l.value = p, l.value;
|
|
1177
1177
|
};
|
|
@@ -1184,7 +1184,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1184
1184
|
parentValue: a,
|
|
1185
1185
|
fetchOptions: o,
|
|
1186
1186
|
fetchOptionByValue: i,
|
|
1187
|
-
loadOptions:
|
|
1187
|
+
loadOptions: r
|
|
1188
1188
|
};
|
|
1189
1189
|
}, ds = /\{\{\s*([^}]+?)\s*\}\}/g, fs = (e) => (e ? String(e) : "").replace(/<[^>]*>/g, "").trim(), ps = (e, t) => t.split(".").reduce((n, l) => n == null ? n : n[l.trim()], e), tl = (e, t) => {
|
|
1190
1190
|
if (!e) return "";
|
|
@@ -1225,7 +1225,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1225
1225
|
}),
|
|
1226
1226
|
emits: ["update:modelValue"],
|
|
1227
1227
|
setup(e) {
|
|
1228
|
-
const t = e, n = Ke(e, "modelValue"), l = y(() => us[`vs-input-radio-${t.view}`]), a = y(() => t.slot ?? t?.optionTemplate ?? ""), o = y(() => Qn(a.value)), i = (w) => tl(w, a.value),
|
|
1228
|
+
const t = e, n = Ke(e, "modelValue"), l = y(() => us[`vs-input-radio-${t.view}`]), a = y(() => t.slot ?? t?.optionTemplate ?? ""), o = y(() => Qn(a.value)), i = (w) => tl(w, a.value), r = (w) => nl(w, a.value), d = y(() => t.position === "horizontal" ? "flex w-full flex-row flex-wrap gap-[10px]" : "flex w-full flex-col gap-2"), p = y(() => {
|
|
1229
1229
|
if (t.position === "horizontal" && t.customClass?.includes("50%"))
|
|
1230
1230
|
return {
|
|
1231
1231
|
flex: "0 0 calc(50% - 5px)"
|
|
@@ -1245,7 +1245,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1245
1245
|
style: Oe(p.value)
|
|
1246
1246
|
}, [
|
|
1247
1247
|
(u(), we($t(l.value), Jt({
|
|
1248
|
-
text:
|
|
1248
|
+
text: r($),
|
|
1249
1249
|
html: o.value ? i($) : "",
|
|
1250
1250
|
option: $,
|
|
1251
1251
|
value: $.id.toString(),
|
|
@@ -1292,7 +1292,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1292
1292
|
},
|
|
1293
1293
|
emits: ["update:modelValue"],
|
|
1294
1294
|
setup(e, { emit: t }) {
|
|
1295
|
-
const n = e, l = t, a = Ll({}), o = ut("values", null), { optionsList: i, loadOptions:
|
|
1295
|
+
const n = e, l = t, a = Ll({}), o = ut("values", null), { optionsList: i, loadOptions: r } = el({
|
|
1296
1296
|
props: {
|
|
1297
1297
|
...n,
|
|
1298
1298
|
options: n.options
|
|
@@ -1364,7 +1364,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1364
1364
|
},
|
|
1365
1365
|
{ deep: !0 }
|
|
1366
1366
|
), lt(async () => {
|
|
1367
|
-
if (await
|
|
1367
|
+
if (await r(), typeof n.modelValue == "boolean" && d.value.length === 1) {
|
|
1368
1368
|
const C = p(d.value[0]);
|
|
1369
1369
|
a[C] = n.modelValue;
|
|
1370
1370
|
} else if (Array.isArray(n.modelValue)) {
|
|
@@ -1576,27 +1576,27 @@ function ca(e, t) {
|
|
|
1576
1576
|
if (!l) return null;
|
|
1577
1577
|
switch (t) {
|
|
1578
1578
|
case "yyyy-MM-dd": {
|
|
1579
|
-
const [, a, o, i] = l,
|
|
1580
|
-
return gt(
|
|
1579
|
+
const [, a, o, i] = l, r = new Date(Number(a), Number(o) - 1, Number(i));
|
|
1580
|
+
return gt(r) ? r : null;
|
|
1581
1581
|
}
|
|
1582
1582
|
case "dd.MM.yyyy": {
|
|
1583
|
-
const [, a, o, i] = l,
|
|
1584
|
-
return gt(
|
|
1583
|
+
const [, a, o, i] = l, r = new Date(Number(i), Number(o) - 1, Number(a));
|
|
1584
|
+
return gt(r) ? r : null;
|
|
1585
1585
|
}
|
|
1586
1586
|
case "dd.MM.yyyy HH:mm": {
|
|
1587
|
-
const [, a, o, i,
|
|
1587
|
+
const [, a, o, i, r, d, p] = l, x = new Date(
|
|
1588
1588
|
Number(i),
|
|
1589
1589
|
Number(o) - 1,
|
|
1590
1590
|
Number(a),
|
|
1591
|
-
Number(
|
|
1591
|
+
Number(r),
|
|
1592
1592
|
Number(d),
|
|
1593
1593
|
Number(p || 0)
|
|
1594
1594
|
);
|
|
1595
1595
|
return gt(x) ? x : null;
|
|
1596
1596
|
}
|
|
1597
1597
|
case "HH:mm": {
|
|
1598
|
-
const [, a, o, i] = l,
|
|
1599
|
-
return
|
|
1598
|
+
const [, a, o, i] = l, r = /* @__PURE__ */ new Date();
|
|
1599
|
+
return r.setHours(Number(a), Number(o), Number(i || 0), 0), r;
|
|
1600
1600
|
}
|
|
1601
1601
|
case "MM.yyyy": {
|
|
1602
1602
|
const [, a, o] = l;
|
|
@@ -1682,7 +1682,7 @@ const Rs = ["year", "month", "day", "time", "custom"], Ns = ve({
|
|
|
1682
1682
|
class: "p-datepicker-buttonbar mt-2 pt-2 border-t border-slate-200 flex items-center justify-between"
|
|
1683
1683
|
};
|
|
1684
1684
|
function Ks(e, t, n, l, a, o) {
|
|
1685
|
-
const i = vt("ChevronLeft"),
|
|
1685
|
+
const i = vt("ChevronLeft"), r = vt("ChevronRight");
|
|
1686
1686
|
return u(), m("div", {
|
|
1687
1687
|
class: ie([
|
|
1688
1688
|
"p-datepicker-panel p-component text-center text-slate-700 overflow-x-hidden bg-white border border-slate-200 rounded-xl shadow-[0_4px_12px_rgba(0,0,0,0.1)] p-2",
|
|
@@ -1722,7 +1722,7 @@ function Ks(e, t, n, l, a, o) {
|
|
|
1722
1722
|
onClick: t[2] || (t[2] = Ee((d) => e.$emit("right"), ["stop", "prevent"]))
|
|
1723
1723
|
}, [
|
|
1724
1724
|
dt(e.$slots, "arrow-right", {}, () => [
|
|
1725
|
-
Y(
|
|
1725
|
+
Y(r, { class: "h-3.5 w-3.5" })
|
|
1726
1726
|
])
|
|
1727
1727
|
], 8, Us)
|
|
1728
1728
|
])),
|
|
@@ -1819,7 +1819,7 @@ const al = /* @__PURE__ */ Xe(Ns, [["render", Ks]]), Ys = ve({
|
|
|
1819
1819
|
)), i = y(() => {
|
|
1820
1820
|
const b = At(n.value), _ = At(l.value);
|
|
1821
1821
|
return `${b} - ${_}`;
|
|
1822
|
-
}),
|
|
1822
|
+
}), r = y(
|
|
1823
1823
|
() => e.lowerLimit && (En(e.lowerLimit) === En(e.pageDate) || $n(e.pageDate, e.lowerLimit))
|
|
1824
1824
|
), d = y(
|
|
1825
1825
|
() => e.upperLimit && (En(e.upperLimit) === En(e.pageDate) || _n(e.pageDate, e.upperLimit))
|
|
@@ -1827,7 +1827,7 @@ const al = /* @__PURE__ */ Xe(Ns, [["render", Ks]]), Ys = ve({
|
|
|
1827
1827
|
return {
|
|
1828
1828
|
years: o,
|
|
1829
1829
|
heading: i,
|
|
1830
|
-
leftDisabled:
|
|
1830
|
+
leftDisabled: r,
|
|
1831
1831
|
rightDisabled: d,
|
|
1832
1832
|
previousPage: () => t("update:pageDate", Oa(e.pageDate, 10)),
|
|
1833
1833
|
nextPage: () => t("update:pageDate", ll(e.pageDate, 10))
|
|
@@ -1844,7 +1844,7 @@ function Gs(e, t, n, l, a, o) {
|
|
|
1844
1844
|
viewMode: "year",
|
|
1845
1845
|
onLeft: e.previousPage,
|
|
1846
1846
|
onRight: e.nextPage,
|
|
1847
|
-
onElementClick: t[0] || (t[0] = (
|
|
1847
|
+
onElementClick: t[0] || (t[0] = (r) => e.$emit("select", r))
|
|
1848
1848
|
}, {
|
|
1849
1849
|
heading: ft(() => [
|
|
1850
1850
|
nt(de(e.heading), 1)
|
|
@@ -1901,14 +1901,14 @@ const Xs = /* @__PURE__ */ Xe(Ys, [["render", Gs]]), Zs = ve({
|
|
|
1901
1901
|
selected: !!e.selected && $l(e.selected, _),
|
|
1902
1902
|
disabled: !o(_, e.lowerLimit, e.upperLimit)
|
|
1903
1903
|
})
|
|
1904
|
-
)),
|
|
1904
|
+
)), r = y(() => At(n.value)), d = y(
|
|
1905
1905
|
() => e.lowerLimit && (ia(e.lowerLimit, e.pageDate) || $n(e.pageDate, e.lowerLimit))
|
|
1906
1906
|
), p = y(
|
|
1907
1907
|
() => e.upperLimit && (ia(e.upperLimit, e.pageDate) || _n(e.pageDate, e.upperLimit))
|
|
1908
1908
|
);
|
|
1909
1909
|
return {
|
|
1910
1910
|
months: i,
|
|
1911
|
-
heading:
|
|
1911
|
+
heading: r,
|
|
1912
1912
|
leftDisabled: d,
|
|
1913
1913
|
rightDisabled: p,
|
|
1914
1914
|
previousPage: () => t("update:pageDate", Oa(e.pageDate, 1)),
|
|
@@ -1927,8 +1927,8 @@ function Js(e, t, n, l, a, o) {
|
|
|
1927
1927
|
viewMode: "month",
|
|
1928
1928
|
onLeft: e.previousPage,
|
|
1929
1929
|
onRight: e.nextPage,
|
|
1930
|
-
onHeading: t[0] || (t[0] = (
|
|
1931
|
-
onElementClick: t[1] || (t[1] = (
|
|
1930
|
+
onHeading: t[0] || (t[0] = (r) => e.$emit("back")),
|
|
1931
|
+
onElementClick: t[1] || (t[1] = (r) => e.$emit("select", r))
|
|
1932
1932
|
}, {
|
|
1933
1933
|
heading: ft(() => [
|
|
1934
1934
|
nt(de(e.heading), 1)
|
|
@@ -2008,8 +2008,8 @@ const Qs = /* @__PURE__ */ Xe(Zs, [["render", Js]]), ei = ve({
|
|
|
2008
2008
|
})), i = y(() => ({
|
|
2009
2009
|
start: Bl(l.value, e.weekStartsOn),
|
|
2010
2010
|
end: As(a.value, e.weekStartsOn)
|
|
2011
|
-
})),
|
|
2012
|
-
const v = e.weekStartsOn, M =
|
|
2011
|
+
})), r = y(() => e.customWeekdays?.length === 7 ? e.customWeekdays : null), d = y(() => {
|
|
2012
|
+
const v = e.weekStartsOn, M = r.value;
|
|
2013
2013
|
if (M)
|
|
2014
2014
|
return Array.from({ length: 7 }).map((V, A) => M[(v + A) % 7]);
|
|
2015
2015
|
const C = n.value(e.weekdayFormat);
|
|
@@ -2058,19 +2058,19 @@ function ti(e, t, n, l, a, o) {
|
|
|
2058
2058
|
viewMode: "day",
|
|
2059
2059
|
onLeft: e.previousPage,
|
|
2060
2060
|
onRight: e.nextPage,
|
|
2061
|
-
onHeading: t[0] || (t[0] = (
|
|
2062
|
-
onElementClick: t[1] || (t[1] = (
|
|
2063
|
-
onToday: t[2] || (t[2] = (
|
|
2064
|
-
onClear: t[3] || (t[3] = (
|
|
2061
|
+
onHeading: t[0] || (t[0] = (r) => e.$emit("back")),
|
|
2062
|
+
onElementClick: t[1] || (t[1] = (r) => e.$emit("select", r)),
|
|
2063
|
+
onToday: t[2] || (t[2] = (r) => e.$emit("today")),
|
|
2064
|
+
onClear: t[3] || (t[3] = (r) => e.$emit("clear"))
|
|
2065
2065
|
}, Ca({
|
|
2066
2066
|
heading: ft(() => [
|
|
2067
2067
|
nt(de(e.heading), 1)
|
|
2068
2068
|
]),
|
|
2069
2069
|
subheading: ft(() => [
|
|
2070
|
-
(u(!0), m(Ae, null, Be(e.weekDays, (
|
|
2071
|
-
key:
|
|
2070
|
+
(u(!0), m(Ae, null, Be(e.weekDays, (r, d) => (u(), m("span", {
|
|
2071
|
+
key: r,
|
|
2072
2072
|
class: ie(`v3dp__subheading__weekday__${d}`)
|
|
2073
|
-
}, de(
|
|
2073
|
+
}, de(r), 3))), 128))
|
|
2074
2074
|
]),
|
|
2075
2075
|
_: 2
|
|
2076
2076
|
}, [
|
|
@@ -2131,7 +2131,7 @@ const ni = /* @__PURE__ */ Xe(ei, [["render", ti]]), li = ve({
|
|
|
2131
2131
|
seconds: 0
|
|
2132
2132
|
});
|
|
2133
2133
|
b($) && (l.value = w, a.value = g, t("select", $));
|
|
2134
|
-
}, i = (w, g) => w < 0 ? g : w > g ? 0 : w,
|
|
2134
|
+
}, i = (w, g) => w < 0 ? g : w > g ? 0 : w, r = () => o(i(l.value + 1, 23), a.value), d = () => o(i(l.value - 1, 23), a.value), p = () => o(l.value, i(a.value + 1, 59)), x = () => o(l.value, i(a.value - 1, 59)), b = (w) => !(e.disabledTime?.dates?.some(
|
|
2135
2135
|
(g) => Na(w, g) && Ds(w, g)
|
|
2136
2136
|
) || e.disabledTime?.predicate?.(w));
|
|
2137
2137
|
return {
|
|
@@ -2139,7 +2139,7 @@ const ni = /* @__PURE__ */ Xe(ei, [["render", ti]]), li = ve({
|
|
|
2139
2139
|
minutes: a,
|
|
2140
2140
|
padStartZero: (w) => `0${w}`.substr(-2),
|
|
2141
2141
|
isEnabled: b,
|
|
2142
|
-
incrementHours:
|
|
2142
|
+
incrementHours: r,
|
|
2143
2143
|
decrementHours: d,
|
|
2144
2144
|
incrementMinutes: p,
|
|
2145
2145
|
decrementMinutes: x
|
|
@@ -2150,7 +2150,7 @@ const ni = /* @__PURE__ */ Xe(ei, [["render", ti]]), li = ve({
|
|
|
2150
2150
|
class: "p-datepicker-time-picker mt-2 pt-2 border-t border-slate-200 flex items-center justify-center gap-2 py-1"
|
|
2151
2151
|
}, oi = { class: "p-datepicker-hour-picker flex flex-col items-center gap-1" }, ri = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, si = { class: "p-datepicker-minute-picker flex flex-col items-center gap-1" }, ii = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, ui = { class: "col-span-2" }, ci = { class: "p-datepicker-time-picker flex items-center justify-center gap-2 py-1" }, di = { class: "p-datepicker-hour-picker flex flex-col items-center gap-1" }, fi = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, pi = { class: "p-datepicker-minute-picker flex flex-col items-center gap-1" }, mi = { class: "min-w-8 text-center text-sm font-medium text-slate-700" };
|
|
2152
2152
|
function vi(e, t, n, l, a, o) {
|
|
2153
|
-
const i = vt("ChevronUp"),
|
|
2153
|
+
const i = vt("ChevronUp"), r = vt("ChevronDown"), d = vt("picker-popup");
|
|
2154
2154
|
return e.embedded ? (u(), m("div", ai, [
|
|
2155
2155
|
c("div", oi, [
|
|
2156
2156
|
c("button", {
|
|
@@ -2166,7 +2166,7 @@ function vi(e, t, n, l, a, o) {
|
|
|
2166
2166
|
class: "p-datepicker-decrement-button inline-flex size-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 disabled:text-slate-300",
|
|
2167
2167
|
onClick: t[1] || (t[1] = Ee((...p) => e.decrementHours && e.decrementHours(...p), ["stop", "prevent"]))
|
|
2168
2168
|
}, [
|
|
2169
|
-
Y(
|
|
2169
|
+
Y(r, { class: "h-3.5 w-3.5" })
|
|
2170
2170
|
])
|
|
2171
2171
|
]),
|
|
2172
2172
|
t[8] || (t[8] = c("div", { class: "text-base font-medium text-slate-500" }, ":", -1)),
|
|
@@ -2184,7 +2184,7 @@ function vi(e, t, n, l, a, o) {
|
|
|
2184
2184
|
class: "p-datepicker-decrement-button inline-flex size-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 disabled:text-slate-300",
|
|
2185
2185
|
onClick: t[3] || (t[3] = Ee((...p) => e.decrementMinutes && e.decrementMinutes(...p), ["stop", "prevent"]))
|
|
2186
2186
|
}, [
|
|
2187
|
-
Y(
|
|
2187
|
+
Y(r, { class: "h-3.5 w-3.5" })
|
|
2188
2188
|
])
|
|
2189
2189
|
])
|
|
2190
2190
|
])) : (u(), we(d, {
|
|
@@ -2210,7 +2210,7 @@ function vi(e, t, n, l, a, o) {
|
|
|
2210
2210
|
class: "p-datepicker-decrement-button inline-flex size-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 disabled:text-slate-300",
|
|
2211
2211
|
onClick: t[5] || (t[5] = Ee((...p) => e.decrementHours && e.decrementHours(...p), ["stop", "prevent"]))
|
|
2212
2212
|
}, [
|
|
2213
|
-
Y(
|
|
2213
|
+
Y(r, { class: "h-3.5 w-3.5" })
|
|
2214
2214
|
])
|
|
2215
2215
|
]),
|
|
2216
2216
|
t[9] || (t[9] = c("div", { class: "text-base font-medium text-slate-500" }, ":", -1)),
|
|
@@ -2228,7 +2228,7 @@ function vi(e, t, n, l, a, o) {
|
|
|
2228
2228
|
class: "p-datepicker-decrement-button inline-flex size-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 disabled:text-slate-300",
|
|
2229
2229
|
onClick: t[7] || (t[7] = Ee((...p) => e.decrementMinutes && e.decrementMinutes(...p), ["stop", "prevent"]))
|
|
2230
2230
|
}, [
|
|
2231
|
-
Y(
|
|
2231
|
+
Y(r, { class: "h-3.5 w-3.5" })
|
|
2232
2232
|
])
|
|
2233
2233
|
])
|
|
2234
2234
|
])
|
|
@@ -2421,7 +2421,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), Pn = ["time", "day", "month
|
|
|
2421
2421
|
closed: () => !0
|
|
2422
2422
|
},
|
|
2423
2423
|
setup(e, { emit: t }) {
|
|
2424
|
-
const n = D("none"), l = D(e.startingViewDate), a = D(null), o = D(null), i = D(null),
|
|
2424
|
+
const n = D("none"), l = D(e.startingViewDate), a = D(null), o = D(null), i = D(null), r = D({}), d = D(!1), p = D(!1);
|
|
2425
2425
|
let x = null;
|
|
2426
2426
|
const b = D(""), _ = (ue) => {
|
|
2427
2427
|
const oe = ue.replace(/[a-zA-Z]/g, "0");
|
|
@@ -2535,7 +2535,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), Pn = ["time", "day", "month
|
|
|
2535
2535
|
let O = Le.left;
|
|
2536
2536
|
O + L > W - oe && (O = W - oe - L), O < oe && (O = oe);
|
|
2537
2537
|
const me = z ? Math.max(120, Le.top - ue - oe) : Math.max(120, le - Le.bottom - ue - oe);
|
|
2538
|
-
|
|
2538
|
+
r.value = {
|
|
2539
2539
|
position: "absolute",
|
|
2540
2540
|
top: `${Math.round(k + xe)}px`,
|
|
2541
2541
|
left: `${Math.round(O + ae)}px`,
|
|
@@ -2543,7 +2543,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), Pn = ["time", "day", "month
|
|
|
2543
2543
|
overflowX: "hidden",
|
|
2544
2544
|
overflowY: "auto",
|
|
2545
2545
|
zIndex: "2147483000"
|
|
2546
|
-
}, F.value && n.value === "day" && (
|
|
2546
|
+
}, F.value && n.value === "day" && (r.value.minWidth = "345px");
|
|
2547
2547
|
}, Ie = (ue, oe) => ue.bottom > oe.top && ue.top < oe.bottom && ue.right > oe.left && ue.left < oe.right, Ve = (ue) => {
|
|
2548
2548
|
const oe = [];
|
|
2549
2549
|
let Le = ue.parentElement;
|
|
@@ -2612,7 +2612,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), Pn = ["time", "day", "month
|
|
|
2612
2612
|
clearModelValue: Q,
|
|
2613
2613
|
initialView: fe,
|
|
2614
2614
|
log: (ue) => console.log(ue),
|
|
2615
|
-
popupAnchorStyle:
|
|
2615
|
+
popupAnchorStyle: r,
|
|
2616
2616
|
popupRef: i
|
|
2617
2617
|
};
|
|
2618
2618
|
}
|
|
@@ -2621,7 +2621,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), Pn = ["time", "day", "month
|
|
|
2621
2621
|
class: "relative"
|
|
2622
2622
|
}, xi = { class: "p-datepicker p-component p-inputwrapper relative" }, wi = ["readonly", "value", "placeholder", "disabled", "tabindex"], ki = { class: "p-datepicker-input-icon-container absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400" }, $i = { class: "absolute right-8 top-1/2 -translate-y-1/2" };
|
|
2623
2623
|
function _i(e, t, n, l, a, o) {
|
|
2624
|
-
const i = vt("Clock3"),
|
|
2624
|
+
const i = vt("Clock3"), r = vt("CalendarDays"), d = vt("X"), p = vt("year-picker"), x = vt("month-picker"), b = vt("time-picker"), _ = vt("day-picker");
|
|
2625
2625
|
return u(), m("div", bi, [
|
|
2626
2626
|
c("div", xi, [
|
|
2627
2627
|
c("input", Jt({
|
|
@@ -2644,7 +2644,7 @@ function _i(e, t, n, l, a, o) {
|
|
|
2644
2644
|
e.isTimeOnlyMode ? (u(), we(i, {
|
|
2645
2645
|
key: 0,
|
|
2646
2646
|
class: "h-4 w-4"
|
|
2647
|
-
})) : (u(), we(
|
|
2647
|
+
})) : (u(), we(r, {
|
|
2648
2648
|
key: 1,
|
|
2649
2649
|
class: "h-4 w-4"
|
|
2650
2650
|
}))
|
|
@@ -2768,7 +2768,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
2768
2768
|
},
|
|
2769
2769
|
emits: ["update:modelValue"],
|
|
2770
2770
|
setup(e, { emit: t }) {
|
|
2771
|
-
const n = e, l = t, { inputClass: a } = ht(n.style), o = Gn(), i = y(() => n.mode ? n.mode : n.time ? "datetime" : "date"),
|
|
2771
|
+
const n = e, l = t, { inputClass: a } = ht(n.style), o = Gn(), i = y(() => n.mode ? n.mode : n.time ? "datetime" : "date"), r = y(() => [
|
|
2772
2772
|
"py-1.5 px-3 block w-full placeholder:text-[#767f8f] bg-white",
|
|
2773
2773
|
a.value,
|
|
2774
2774
|
n.customClass,
|
|
@@ -2980,7 +2980,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
2980
2980
|
"input-format": V.value,
|
|
2981
2981
|
"upper-limit": w.value,
|
|
2982
2982
|
name: n.name,
|
|
2983
|
-
class: ie(
|
|
2983
|
+
class: ie(r.value)
|
|
2984
2984
|
}, null, 8, ["modelValue", "placeholder", "disabled", "clearable", "typeable", "week-day-names", "week-starts-on", "starting-view", "minimum-view", "input-format", "upper-limit", "name", "class"])
|
|
2985
2985
|
], 2));
|
|
2986
2986
|
}
|
|
@@ -2988,8 +2988,8 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
2988
2988
|
if (!t || !Object.keys(t).length)
|
|
2989
2989
|
return e;
|
|
2990
2990
|
const [n, l = ""] = e.split("?"), a = new URLSearchParams(l);
|
|
2991
|
-
Object.entries(t).forEach(([i,
|
|
2992
|
-
|
|
2991
|
+
Object.entries(t).forEach(([i, r]) => {
|
|
2992
|
+
r == null || r === "" || a.set(i, String(r));
|
|
2993
2993
|
});
|
|
2994
2994
|
const o = a.toString();
|
|
2995
2995
|
return o ? `${n}?${o}` : n;
|
|
@@ -3002,8 +3002,8 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3002
3002
|
id: a = "1",
|
|
3003
3003
|
form: o = "form",
|
|
3004
3004
|
table: i = "table",
|
|
3005
|
-
customParams:
|
|
3006
|
-
} = t, d = l || `/file/upload/uploads?id=${a || ""}&form=${o || ""}&table=${i || ""}`, p = Li(d,
|
|
3005
|
+
customParams: r
|
|
3006
|
+
} = t, d = l || `/file/upload/uploads?id=${a || ""}&form=${o || ""}&table=${i || ""}`, p = Li(d, r);
|
|
3007
3007
|
return (await fetch(
|
|
3008
3008
|
p,
|
|
3009
3009
|
{
|
|
@@ -3030,8 +3030,8 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3030
3030
|
const t = await fetch(`/file/download/${e}`);
|
|
3031
3031
|
if (!t.ok)
|
|
3032
3032
|
throw new Error(`Download failed with status ${t.status}`);
|
|
3033
|
-
const n = await t.blob(), a = (t.headers.get("content-disposition") || "").match(/filename\*?=(?:UTF-8''|")?([^\";]+)/i), o = a?.[1] ? decodeURIComponent(a[1].replace(/"/g, "").trim()) : "", i = e.split("/").filter(Boolean).pop() || "download",
|
|
3034
|
-
d.setAttribute("download",
|
|
3033
|
+
const n = await t.blob(), a = (t.headers.get("content-disposition") || "").match(/filename\*?=(?:UTF-8''|")?([^\";]+)/i), o = a?.[1] ? decodeURIComponent(a[1].replace(/"/g, "").trim()) : "", i = e.split("/").filter(Boolean).pop() || "download", r = o || i, d = document.createElement("a");
|
|
3034
|
+
d.setAttribute("download", r), d.href = window.URL.createObjectURL(n), d.click(), window.URL.revokeObjectURL(d.href);
|
|
3035
3035
|
} catch (t) {
|
|
3036
3036
|
console.error(t.message);
|
|
3037
3037
|
}
|
|
@@ -3080,11 +3080,11 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3080
3080
|
}),
|
|
3081
3081
|
emits: /* @__PURE__ */ ze(["click"], ["update:value", "update:item"]),
|
|
3082
3082
|
setup(e, { emit: t }) {
|
|
3083
|
-
const n = Ke(e, "value"), l = Ke(e, "item"), a = t, o = e, i = y(() => o.action),
|
|
3084
|
-
const w =
|
|
3083
|
+
const n = Ke(e, "value"), l = Ke(e, "item"), a = t, o = e, i = y(() => o.action), r = y(() => l.value ? typeof l.value == "string" ? l.value : l.value.file_path : ""), d = y(() => o.disabled ? "opacity-50 cursor-not-allowed" : o.isUploading ? "cursor-default text-blue-500" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"), p = (w) => typeof w == "string" ? w : w?.file_path || "", x = () => {
|
|
3084
|
+
const w = r.value;
|
|
3085
3085
|
Vi(w), o.multiple && Array.isArray(n.value) ? n.value = n.value.filter((g) => p(g) !== w) : n.value = "";
|
|
3086
3086
|
}, b = () => {
|
|
3087
|
-
|
|
3087
|
+
r.value && window.open(r.value, "_blank");
|
|
3088
3088
|
}, _ = () => {
|
|
3089
3089
|
o.disabled || o.isUploading || a("click");
|
|
3090
3090
|
};
|
|
@@ -3103,14 +3103,14 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3103
3103
|
}))
|
|
3104
3104
|
], 10, Ti)) : (u(), m("div", {
|
|
3105
3105
|
key: 1,
|
|
3106
|
-
title:
|
|
3106
|
+
title: r.value,
|
|
3107
3107
|
class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"
|
|
3108
3108
|
}, [
|
|
3109
|
-
(u(), we($t(q(Ii)(
|
|
3110
|
-
src:
|
|
3109
|
+
(u(), we($t(q(Ii)(r.value)), {
|
|
3110
|
+
src: r.value,
|
|
3111
3111
|
alt: "file",
|
|
3112
3112
|
class: "w-full h-full object-cover cursor-pointer",
|
|
3113
|
-
onClick: g[0] || (g[0] = ($) => q(da)(
|
|
3113
|
+
onClick: g[0] || (g[0] = ($) => q(da)(r.value))
|
|
3114
3114
|
}, null, 8, ["src"])),
|
|
3115
3115
|
c("div", Pi, [
|
|
3116
3116
|
c("button", {
|
|
@@ -3129,7 +3129,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3129
3129
|
]),
|
|
3130
3130
|
c("button", {
|
|
3131
3131
|
type: "button",
|
|
3132
|
-
onClick: g[1] || (g[1] = ($) => q(da)(
|
|
3132
|
+
onClick: g[1] || (g[1] = ($) => q(da)(r.value)),
|
|
3133
3133
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
3134
3134
|
}, [
|
|
3135
3135
|
Y(q(Dl), { class: "w-4 h-4" })
|
|
@@ -3158,7 +3158,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3158
3158
|
const a = t?.value ?? {};
|
|
3159
3159
|
return e.forEach((o) => {
|
|
3160
3160
|
if (!o) return;
|
|
3161
|
-
const [i,
|
|
3161
|
+
const [i, r] = o.split("="), d = i?.trim(), p = r?.trim();
|
|
3162
3162
|
if (!d || !p) return;
|
|
3163
3163
|
const x = a[p];
|
|
3164
3164
|
if (x == null || x === "") {
|
|
@@ -3199,7 +3199,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3199
3199
|
}),
|
|
3200
3200
|
emits: /* @__PURE__ */ ze(["change"], ["update:modelValue"]),
|
|
3201
3201
|
setup(e, { emit: t }) {
|
|
3202
|
-
const n = e, l = Ke(e, "modelValue"), a = t, o = D(null), i = D(!1),
|
|
3202
|
+
const n = e, l = Ke(e, "modelValue"), a = t, o = D(null), i = D(!1), r = D([]), d = ut("values"), p = y(() => Wa(l.value, !!n.multiple)), x = y(() => qa(l.value, !!n.multiple)), b = y(() => ja(n.format)), _ = y(() => Ha(n.customParams, d)), w = (U) => {
|
|
3203
3203
|
Te({
|
|
3204
3204
|
type: "error",
|
|
3205
3205
|
title: "Помилка завантаження",
|
|
@@ -3214,7 +3214,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3214
3214
|
customParams: Object.keys(_.value.params).length ? _.value.params : void 0
|
|
3215
3215
|
}, F = await Ai(U, te);
|
|
3216
3216
|
return F?.file_path ? F.file_path : null;
|
|
3217
|
-
}, v = y(() =>
|
|
3217
|
+
}, v = y(() => r.value.filter((U) => U.status !== "done")), M = y(() => v.value[0] || null), C = (U) => typeof U == "string" ? U : U?.file_path || "", V = (U, te) => ({
|
|
3218
3218
|
key: `${Date.now()}-${te}-${U.name}`,
|
|
3219
3219
|
file: U,
|
|
3220
3220
|
size: U.size,
|
|
@@ -3239,12 +3239,12 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3239
3239
|
o.value && (o.value.value = "");
|
|
3240
3240
|
return;
|
|
3241
3241
|
}
|
|
3242
|
-
i.value = !0,
|
|
3242
|
+
i.value = !0, r.value = n.multiple ? F.map((B, P) => V(B, P)) : [];
|
|
3243
3243
|
try {
|
|
3244
3244
|
if (n.multiple) {
|
|
3245
3245
|
const J = await Promise.all(
|
|
3246
3246
|
F.map(async (ee, Z) => {
|
|
3247
|
-
const Q =
|
|
3247
|
+
const Q = r.value[Z];
|
|
3248
3248
|
Q.status = "uploading", Q.progressPercent = 0;
|
|
3249
3249
|
const G = await $(ee);
|
|
3250
3250
|
return G ? (Q.status = "done", Q.path = G, Q.uploaded = Q.size, Q.progressPercent = 100) : (Q.status = "error", Q.error = "Помилка при завантаженні"), G;
|
|
@@ -3268,7 +3268,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3268
3268
|
} catch (B) {
|
|
3269
3269
|
w(B?.message || void 0);
|
|
3270
3270
|
} finally {
|
|
3271
|
-
i.value = !1,
|
|
3271
|
+
i.value = !1, r.value = [], o.value && (o.value.value = "");
|
|
3272
3272
|
}
|
|
3273
3273
|
};
|
|
3274
3274
|
return (U, te) => (u(), m("div", Bi, [
|
|
@@ -3356,10 +3356,10 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3356
3356
|
}),
|
|
3357
3357
|
emits: ["update:modelValue"],
|
|
3358
3358
|
setup(e) {
|
|
3359
|
-
const t = e, n = Ke(e, "modelValue"), l = D(null), a = D(!1), o = D(""), i = D([]),
|
|
3359
|
+
const t = e, n = Ke(e, "modelValue"), l = D(null), a = D(!1), o = D(""), i = D([]), r = ut("values"), d = y(() => !!t.multiple), p = y(() => ja(t.format)), x = y(() => {
|
|
3360
3360
|
if (p.value.length)
|
|
3361
3361
|
return p.value.map((j) => `.${j}`).join(",");
|
|
3362
|
-
}), b = y(() => Wa(n.value, d.value)), _ = y(() => qa(n.value, d.value)), w = y(() => Ha(t.customParams,
|
|
3362
|
+
}), b = y(() => Wa(n.value, d.value)), _ = y(() => qa(n.value, d.value)), w = y(() => Ha(t.customParams, r)), g = y(() => i.value.filter((j) => j.status !== "done")), $ = y(() => d.value ? null : g.value[0] || null), v = y(() => {
|
|
3363
3363
|
const j = g.value, B = j.reduce((J, pe) => J + pe.size, 0);
|
|
3364
3364
|
if (!B) return 0;
|
|
3365
3365
|
const P = j.reduce((J, pe) => J + Math.min(pe.uploaded, pe.size), 0);
|
|
@@ -3583,7 +3583,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3583
3583
|
const _ = document.createElement("a");
|
|
3584
3584
|
_.setAttribute("download", b?.uploaded_name), _.href = b?.file_path, _.click();
|
|
3585
3585
|
}
|
|
3586
|
-
function
|
|
3586
|
+
function r(b) {
|
|
3587
3587
|
b?.file_path && window.open(b.file_path, "_blank");
|
|
3588
3588
|
}
|
|
3589
3589
|
async function d() {
|
|
@@ -3634,7 +3634,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3634
3634
|
c("div", ou, [
|
|
3635
3635
|
c("button", {
|
|
3636
3636
|
class: "inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
|
|
3637
|
-
onClick: _[1] || (_[1] = (w) =>
|
|
3637
|
+
onClick: _[1] || (_[1] = (w) => r(e.item))
|
|
3638
3638
|
}, [
|
|
3639
3639
|
Y(q(La), { class: "h-4 w-4" })
|
|
3640
3640
|
])
|
|
@@ -3684,7 +3684,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3684
3684
|
},
|
|
3685
3685
|
emits: ["update"],
|
|
3686
3686
|
setup(e, { emit: t }) {
|
|
3687
|
-
const n = e, l = ut("form"), a = y(() => l.value.formId), o = D(!1), i = D(0),
|
|
3687
|
+
const n = e, l = ut("form"), a = y(() => l.value.formId), o = D(!1), i = D(0), r = t, d = D(!1), p = D({}), x = D([]), b = D(""), _ = y(() => Array.isArray(x.value) ? x.value.filter((V) => V.ext === "jpg" || V.ext === "png").map((V) => V?.file_path) : []), w = y(() => b.value === "" ? x.value : x.value.filter((V) => V?.uploaded_name?.includes(b.value))), g = (V) => {
|
|
3688
3688
|
const A = _.value.findIndex((U) => U === V.item.file_path);
|
|
3689
3689
|
A !== -1 && (o.value = !0, i.value = A);
|
|
3690
3690
|
}, $ = async () => {
|
|
@@ -3701,7 +3701,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", _i]]), Ci = /* @__PURE__ */ ve({
|
|
|
3701
3701
|
U.append("file", A);
|
|
3702
3702
|
try {
|
|
3703
3703
|
const te = `${n.prefix}/widget/file/${a.value}`, F = await fetch(te, { method: "POST", body: U });
|
|
3704
|
-
return F.ok ? (
|
|
3704
|
+
return F.ok ? (r("update", "file-list"), A) : (Te({
|
|
3705
3705
|
type: F.status >= 400 && F.status < 500 ? "warning" : "error",
|
|
3706
3706
|
title: "Error",
|
|
3707
3707
|
message: `Error code: ${F.status}`
|
|
@@ -3988,21 +3988,21 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
3988
3988
|
}
|
|
3989
3989
|
},
|
|
3990
3990
|
setup(e) {
|
|
3991
|
-
const t = e, n = ut("values", D({})), l = ut("form"), a = y(() => t.schema?.filter((
|
|
3991
|
+
const t = e, n = ut("values", D({})), l = ut("form"), a = y(() => t.schema?.filter((r) => Ka(
|
|
3992
3992
|
n.value,
|
|
3993
|
-
|
|
3993
|
+
r?.conditions,
|
|
3994
3994
|
t.name || void 0
|
|
3995
3995
|
))), o = y(() => Du[t.view]), i = y(() => {
|
|
3996
3996
|
if (n.value || (n.value = {}), !t.name) return n.value;
|
|
3997
|
-
const
|
|
3998
|
-
if (
|
|
3997
|
+
const r = n.value[t.name];
|
|
3998
|
+
if (r) return r;
|
|
3999
3999
|
const d = {};
|
|
4000
4000
|
return n.value = {
|
|
4001
4001
|
...n.value,
|
|
4002
4002
|
[t.name]: d
|
|
4003
4003
|
}, d;
|
|
4004
4004
|
});
|
|
4005
|
-
return (
|
|
4005
|
+
return (r, d) => e.schema?.length ? (u(), we($t(o.value), {
|
|
4006
4006
|
key: 0,
|
|
4007
4007
|
title: e.title,
|
|
4008
4008
|
style: Oe(e.style)
|
|
@@ -4029,10 +4029,10 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4029
4029
|
modelValue: a,
|
|
4030
4030
|
onCreated: o
|
|
4031
4031
|
}) => {
|
|
4032
|
-
const i = D(!1),
|
|
4032
|
+
const i = D(!1), r = D({}), d = D([]), p = D(null), x = y(() => e.add?.title || "Додати"), b = y(() => e.add?.token || e.add?.model || ""), _ = y(() => e.add?.pk || "id");
|
|
4033
4033
|
return {
|
|
4034
4034
|
isOpenAdd: i,
|
|
4035
|
-
addData:
|
|
4035
|
+
addData: r,
|
|
4036
4036
|
addSchema: d,
|
|
4037
4037
|
addForm: p,
|
|
4038
4038
|
addTitle: x,
|
|
@@ -4042,7 +4042,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4042
4042
|
const v = e.add?.api ?? `/api/table/${b.value}`, M = await fetch(v, {
|
|
4043
4043
|
method: "POST",
|
|
4044
4044
|
headers: { "Content-Type": "application/json" },
|
|
4045
|
-
body: JSON.stringify(
|
|
4045
|
+
body: JSON.stringify(r.value)
|
|
4046
4046
|
}), C = await M.json().catch(() => ({})), V = C?.error || C?.message, A = Number(C?.code) >= 400;
|
|
4047
4047
|
if (!M.ok || A) {
|
|
4048
4048
|
Te({
|
|
@@ -4074,7 +4074,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4074
4074
|
onAddValue: async () => {
|
|
4075
4075
|
if (!e.add) return null;
|
|
4076
4076
|
const $ = await fetch(`/api/template/form/${e.add.form}`).then((v) => v.json());
|
|
4077
|
-
return d.value = $.schema,
|
|
4077
|
+
return d.value = $.schema, r.value = {}, i.value = !0, null;
|
|
4078
4078
|
}
|
|
4079
4079
|
};
|
|
4080
4080
|
}, qu = ["aria-expanded", "data-focus"], Ku = { class: "vs-input-select__value-area relative flex flex-1 items-center gap-1 py-0.5 pl-1 pr-0 overflow-hidden h-full min-w-0" }, Yu = {
|
|
@@ -4141,51 +4141,51 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4141
4141
|
"aria-expanded": e.isOpen,
|
|
4142
4142
|
"aria-haspopup": "listbox",
|
|
4143
4143
|
onKeydown: i[10] || (i[10] = //@ts-ignore
|
|
4144
|
-
(...
|
|
4144
|
+
(...r) => e.onControlKeydown && e.onControlKeydown(...r)),
|
|
4145
4145
|
onClick: i[11] || (i[11] = //@ts-ignore
|
|
4146
|
-
(...
|
|
4146
|
+
(...r) => e.onControlClick && e.onControlClick(...r)),
|
|
4147
4147
|
"data-focus": e.isOpen || e.inputFocus ? "true" : "false",
|
|
4148
4148
|
ref: e.setTriggerRef
|
|
4149
4149
|
}, [
|
|
4150
4150
|
c("div", Ku, [
|
|
4151
4151
|
e.isMulti ? (u(), m("div", Yu, [
|
|
4152
|
-
(u(!0), m(Ae, null, Be(e.selectedOptions, (
|
|
4153
|
-
key:
|
|
4152
|
+
(u(!0), m(Ae, null, Be(e.selectedOptions, (r) => (u(), m("div", {
|
|
4153
|
+
key: r.id,
|
|
4154
4154
|
class: "flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full"
|
|
4155
4155
|
}, [
|
|
4156
4156
|
c("div", Gu, [
|
|
4157
|
-
e.shouldShowColorDot(
|
|
4157
|
+
e.shouldShowColorDot(r) ? (u(), m("span", {
|
|
4158
4158
|
key: 0,
|
|
4159
4159
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",
|
|
4160
|
-
style: Oe({ backgroundColor:
|
|
4160
|
+
style: Oe({ backgroundColor: r?.color })
|
|
4161
4161
|
}, null, 4)) : K("", !0),
|
|
4162
|
-
!e.optionTemplate && e.optionHasIcon(
|
|
4162
|
+
!e.optionTemplate && e.optionHasIcon(r) ? (u(), m("span", {
|
|
4163
4163
|
key: 1,
|
|
4164
4164
|
class: ie(e.iconWrapperClass),
|
|
4165
|
-
style: Oe(e.getIconColorStyle(
|
|
4165
|
+
style: Oe(e.getIconColorStyle(r)),
|
|
4166
4166
|
"aria-hidden": "true"
|
|
4167
4167
|
}, [
|
|
4168
|
-
(u(), we($t(e.resolveOptionIcon(
|
|
4168
|
+
(u(), we($t(e.resolveOptionIcon(r)), {
|
|
4169
4169
|
class: "w-full h-full",
|
|
4170
4170
|
focusable: "false"
|
|
4171
4171
|
}))
|
|
4172
4172
|
], 6)) : K("", !0),
|
|
4173
4173
|
c("div", {
|
|
4174
4174
|
class: "truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",
|
|
4175
|
-
title: e.getLabel(
|
|
4175
|
+
title: e.getLabel(r)
|
|
4176
4176
|
}, [
|
|
4177
4177
|
e.optionTemplate ? (u(), m("div", {
|
|
4178
4178
|
key: 0,
|
|
4179
|
-
innerHTML: e.renderTemplate(
|
|
4179
|
+
innerHTML: e.renderTemplate(r)
|
|
4180
4180
|
}, null, 8, Zu)) : (u(), m(Ae, { key: 1 }, [
|
|
4181
|
-
nt(de(
|
|
4181
|
+
nt(de(r.text), 1)
|
|
4182
4182
|
], 64))
|
|
4183
4183
|
], 8, Xu)
|
|
4184
4184
|
]),
|
|
4185
4185
|
c("div", {
|
|
4186
4186
|
role: "button",
|
|
4187
4187
|
class: "flex items-center rounded-sm px-1 box-border text-[#172b4d] hover:bg-[rgb(255,189,173)] hover:text-[rgb(222,53,11)] flex-shrink-0",
|
|
4188
|
-
onClick: Ee((d) => e.onRemoveSelected(
|
|
4188
|
+
onClick: Ee((d) => e.onRemoveSelected(r.id), ["stop"])
|
|
4189
4189
|
}, [
|
|
4190
4190
|
Y(q(Ct), {
|
|
4191
4191
|
"aria-hidden": "true",
|
|
@@ -4207,13 +4207,13 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4207
4207
|
tabindex: "0",
|
|
4208
4208
|
"aria-autocomplete": "list",
|
|
4209
4209
|
placeholder: e.selectedIds.length ? " " : e.placeholder,
|
|
4210
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
4210
|
+
"onUpdate:modelValue": i[0] || (i[0] = (r) => a.value = r),
|
|
4211
4211
|
onFocus: i[1] || (i[1] = //@ts-ignore
|
|
4212
|
-
(...
|
|
4212
|
+
(...r) => e.onInputFocus && e.onInputFocus(...r)),
|
|
4213
4213
|
onBlur: i[2] || (i[2] = //@ts-ignore
|
|
4214
|
-
(...
|
|
4214
|
+
(...r) => e.onInputBlur && e.onInputBlur(...r)),
|
|
4215
4215
|
onKeydown: i[3] || (i[3] = //@ts-ignore
|
|
4216
|
-
(...
|
|
4216
|
+
(...r) => e.onInputKeydown && e.onInputKeydown(...r))
|
|
4217
4217
|
}, null, 40, ec)), [
|
|
4218
4218
|
[at, a.value]
|
|
4219
4219
|
]) : K("", !0)
|
|
@@ -4257,13 +4257,13 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4257
4257
|
tabindex: "0",
|
|
4258
4258
|
"aria-autocomplete": "list",
|
|
4259
4259
|
placeholder: e.selectedOptionLabel ? " " : e.placeholder,
|
|
4260
|
-
"onUpdate:modelValue": i[4] || (i[4] = (
|
|
4260
|
+
"onUpdate:modelValue": i[4] || (i[4] = (r) => a.value = r),
|
|
4261
4261
|
onFocus: i[5] || (i[5] = //@ts-ignore
|
|
4262
|
-
(...
|
|
4262
|
+
(...r) => e.onInputFocus && e.onInputFocus(...r)),
|
|
4263
4263
|
onBlur: i[6] || (i[6] = //@ts-ignore
|
|
4264
|
-
(...
|
|
4264
|
+
(...r) => e.onInputBlur && e.onInputBlur(...r)),
|
|
4265
4265
|
onKeydown: i[7] || (i[7] = //@ts-ignore
|
|
4266
|
-
(...
|
|
4266
|
+
(...r) => e.onInputKeydown && e.onInputKeydown(...r))
|
|
4267
4267
|
}, null, 40, oc), [
|
|
4268
4268
|
[at, a.value]
|
|
4269
4269
|
])
|
|
@@ -4278,7 +4278,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4278
4278
|
disabled: e.disabled,
|
|
4279
4279
|
onClick: i[8] || (i[8] = Ee(
|
|
4280
4280
|
//@ts-ignore
|
|
4281
|
-
(...
|
|
4281
|
+
(...r) => e.onClearSelected && e.onClearSelected(...r),
|
|
4282
4282
|
["stop"]
|
|
4283
4283
|
))
|
|
4284
4284
|
}, [
|
|
@@ -4292,7 +4292,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4292
4292
|
disabled: e.disabled,
|
|
4293
4293
|
onClick: i[9] || (i[9] = Ee(
|
|
4294
4294
|
//@ts-ignore
|
|
4295
|
-
(...
|
|
4295
|
+
(...r) => e.onToggleSelect && e.onToggleSelect(...r),
|
|
4296
4296
|
["stop"]
|
|
4297
4297
|
)),
|
|
4298
4298
|
title: e.isOpen ? "Закрити список" : "Відкрити список"
|
|
@@ -4416,11 +4416,11 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4416
4416
|
setup(e, { emit: t }) {
|
|
4417
4417
|
const n = e, l = t, a = y(() => n.multiple), o = y(() => n.disabled), i = y(() => n.search);
|
|
4418
4418
|
ht(n.style);
|
|
4419
|
-
const
|
|
4419
|
+
const r = y({
|
|
4420
4420
|
get: () => n.modelValue,
|
|
4421
4421
|
set: (N) => l("update:modelValue", N)
|
|
4422
4422
|
});
|
|
4423
|
-
!
|
|
4423
|
+
!r.value && n.defaultValue && (r.value = n.defaultValue);
|
|
4424
4424
|
const d = D(null), p = D(null), x = D(null), b = D(null), _ = D(!1), w = D(!1), g = D(null), $ = D(-1), v = D([]), M = D(""), C = D(null), V = (N) => {
|
|
4425
4425
|
p.value = N;
|
|
4426
4426
|
}, A = (N) => {
|
|
@@ -4435,7 +4435,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4435
4435
|
if (!B.value.length) return [];
|
|
4436
4436
|
const N = Ve.value, re = new Map(N.map((Se) => [Se.id?.toString(), Se]));
|
|
4437
4437
|
return B.value.map((Se) => re.get(Se?.toString())).filter((Se) => !!Se);
|
|
4438
|
-
}), J = y(() => n.placeholder || "Select..."), pe = y(() => ye(g.value)), _e = y(() => o.value ? !1 : a.value ? B.value.length > 0 : !!
|
|
4438
|
+
}), J = y(() => n.placeholder || "Select..."), pe = y(() => ye(g.value)), _e = y(() => o.value ? !1 : a.value ? B.value.length > 0 : !!r.value), X = (N) => a.value ? B.value.some((re) => re?.toString() === N?.toString()) : r.value?.toString() === N?.toString(), ee = y(() => {
|
|
4439
4439
|
let N = Ve.value ?? [];
|
|
4440
4440
|
if (!n.data && M.value.trim() !== "") {
|
|
4441
4441
|
const re = M.value.toLowerCase();
|
|
@@ -4576,11 +4576,11 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4576
4576
|
await ae();
|
|
4577
4577
|
}
|
|
4578
4578
|
}, We = () => {
|
|
4579
|
-
a.value ? (B.value = [],
|
|
4579
|
+
a.value ? (B.value = [], r.value = [], l("change", []), z(null, [])) : (g.value = null, r.value = null, l("change", null), z(null, null)), Ie(null), Me(null), M.value = "", xe(), et(() => {
|
|
4580
4580
|
C.value?.focus();
|
|
4581
4581
|
});
|
|
4582
4582
|
}, qe = (N) => {
|
|
4583
|
-
a.value && (B.value = B.value.filter((re) => re?.toString() !== N?.toString()),
|
|
4583
|
+
a.value && (B.value = B.value.filter((re) => re?.toString() !== N?.toString()), r.value = [...B.value], l("change", r.value), z(null), et(() => C.value?.focus()));
|
|
4584
4584
|
}, z = (N, re) => {
|
|
4585
4585
|
const Se = re ?? (a.value ? [...B.value] : N?.id ?? null);
|
|
4586
4586
|
l("value-selected", {
|
|
@@ -4589,9 +4589,9 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4589
4589
|
option: N
|
|
4590
4590
|
});
|
|
4591
4591
|
}, k = (N, re = "manual") => {
|
|
4592
|
-
a.value ? (X(N.id) || (B.value = [...B.value, N.id],
|
|
4592
|
+
a.value ? (X(N.id) || (B.value = [...B.value, N.id], r.value = [...B.value], l("change", r.value), z(N)), M.value = "", et(() => {
|
|
4593
4593
|
C.value?.focus(), $.value = Math.min($.value, ee.value.length - 1);
|
|
4594
|
-
}), Ie(null)) : (g.value = N,
|
|
4594
|
+
}), Ie(null)) : (g.value = N, r.value = N.id, l("change", r.value), z(N), M.value = "", xe(), Ie(N), re === "parent-auto" && Me({
|
|
4595
4595
|
source: re,
|
|
4596
4596
|
parentField: n.parent ?? null,
|
|
4597
4597
|
parentValue: He.value ?? null
|
|
@@ -4652,7 +4652,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4652
4652
|
N.preventDefault();
|
|
4653
4653
|
const Se = ee.value[$.value];
|
|
4654
4654
|
Se && k(Se), C.value?.blur();
|
|
4655
|
-
} else re === "Escape" ? (N.preventDefault(), xe()) : re === "Backspace" ? a.value && M.value === "" && B.value.length && (B.value = B.value.slice(0, -1),
|
|
4655
|
+
} else re === "Escape" ? (N.preventDefault(), xe()) : re === "Backspace" ? a.value && M.value === "" && B.value.length && (B.value = B.value.slice(0, -1), r.value = [...B.value], l("change", r.value)) : re === "Home" ? ($.value = 0, O(v.value[0], x.value)) : re === "End" ? ($.value = ee.value.length - 1, O(v.value[$.value], x.value)) : re === "Tab" && xe();
|
|
4656
4656
|
}, pt = () => {
|
|
4657
4657
|
o.value || (w.value = !0);
|
|
4658
4658
|
}, bt = () => {
|
|
@@ -4671,16 +4671,16 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4671
4671
|
};
|
|
4672
4672
|
async function Lt() {
|
|
4673
4673
|
if (a.value)
|
|
4674
|
-
Array.isArray(
|
|
4674
|
+
Array.isArray(r.value) ? B.value = [...r.value] : (B.value = r.value == null ? [] : [r.value], r.value = [...B.value]), n.data && B.value.length && (await W(B.value), await et());
|
|
4675
4675
|
else {
|
|
4676
|
-
if (Array.isArray(
|
|
4677
|
-
const N =
|
|
4678
|
-
|
|
4676
|
+
if (Array.isArray(r.value)) {
|
|
4677
|
+
const N = r.value[0] ?? null;
|
|
4678
|
+
r.value = N ?? null;
|
|
4679
4679
|
}
|
|
4680
|
-
|
|
4680
|
+
r.value != null && r.value !== "" ? g.value = await ct(r.value) : g.value = null, Ie(g.value ?? null);
|
|
4681
4681
|
}
|
|
4682
4682
|
}
|
|
4683
|
-
ge(
|
|
4683
|
+
ge(r, () => {
|
|
4684
4684
|
Lt();
|
|
4685
4685
|
}), lt(async () => {
|
|
4686
4686
|
if (addEventListener("keydown", wt), addEventListener("scroll", he, !0), addEventListener("resize", mt), document.addEventListener("click", E, !0), p.value && me(p.value).addEventListener("scroll", Bt, !0), n.options?.length && !n.data)
|
|
@@ -4706,7 +4706,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4706
4706
|
fetchOptionByValue: Je,
|
|
4707
4707
|
optionsList: Ve,
|
|
4708
4708
|
selectedOption: g,
|
|
4709
|
-
modelValue:
|
|
4709
|
+
modelValue: r
|
|
4710
4710
|
});
|
|
4711
4711
|
function An(N, re = 200) {
|
|
4712
4712
|
let Se;
|
|
@@ -4725,7 +4725,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4725
4725
|
}, { immediate: !0 });
|
|
4726
4726
|
const vn = D(!0);
|
|
4727
4727
|
return ge(He, async () => {
|
|
4728
|
-
if (n.data && (vn.value || (a.value ? (B.value = [],
|
|
4728
|
+
if (n.data && (vn.value || (a.value ? (B.value = [], r.value = [], l("change", [])) : (g.value = null, r.value = null, l("change", null))), await Ye(), n.auto === 1 && He.value && Ve.value.length > 0)) {
|
|
4729
4729
|
const N = Ve.value[0];
|
|
4730
4730
|
N && k(N, "parent-auto");
|
|
4731
4731
|
}
|
|
@@ -4882,7 +4882,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4882
4882
|
set: (se) => l("update:modelValue", se)
|
|
4883
4883
|
});
|
|
4884
4884
|
a.value == null && n.defaultValue != null && (a.value = n.defaultValue);
|
|
4885
|
-
const o = ut("values"), i = ut("field-props"),
|
|
4885
|
+
const o = ut("values"), i = ut("field-props"), r = y(() => !!n.disabled), d = D(null), p = D(!1), x = D(null), b = D(null), _ = D(null), w = D({}), g = `vs-input-inline-select-${Rl()}`, $ = y(() => n.placeholder || "Оберіть значення"), v = y(() => U(d.value) || n.placeholder || "Оберіть значення"), M = y(() => n.slot ?? ""), C = y(() => Qn(M.value)), V = y(() => n.teleport || "body"), A = /^#(?:[\da-fA-F]{3}|[\da-fA-F]{6}|[\da-fA-F]{8})$/, U = (se) => nl(se, M.value), te = (se) => !!(!C.value && Qt(se)), F = y(() => {
|
|
4886
4886
|
const se = Qt(d.value).trim();
|
|
4887
4887
|
return se ? A.test(se) ? `bg-[${se}] border-[${se}]` : `bg-${se.toLowerCase()}-500 border-${se.toLowerCase()}-500` : "";
|
|
4888
4888
|
}), {
|
|
@@ -4951,7 +4951,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4951
4951
|
}
|
|
4952
4952
|
d.value = await J(a.value), X(d.value ?? null);
|
|
4953
4953
|
}, ke = async () => {
|
|
4954
|
-
|
|
4954
|
+
r.value || (p.value = !0, await et(), Z(), await Q(), await et(), Z());
|
|
4955
4955
|
}, ye = () => {
|
|
4956
4956
|
p.value = !1;
|
|
4957
4957
|
}, T = async () => {
|
|
@@ -4995,7 +4995,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
4995
4995
|
ref_key: "triggerRef",
|
|
4996
4996
|
ref: b,
|
|
4997
4997
|
type: "button",
|
|
4998
|
-
disabled:
|
|
4998
|
+
disabled: r.value,
|
|
4999
4999
|
"aria-expanded": p.value ? "true" : "false",
|
|
5000
5000
|
"aria-haspopup": "menu",
|
|
5001
5001
|
class: ie([
|
|
@@ -5076,7 +5076,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
5076
5076
|
function i() {
|
|
5077
5077
|
typeof l.value == "string" && (l.value = l.value.trim());
|
|
5078
5078
|
}
|
|
5079
|
-
return (
|
|
5079
|
+
return (r, d) => Re((u(), m("textarea", {
|
|
5080
5080
|
"onUpdate:modelValue": d[0] || (d[0] = (p) => l.value = p),
|
|
5081
5081
|
placeholder: o.value,
|
|
5082
5082
|
disabled: a.value,
|
|
@@ -5110,7 +5110,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
5110
5110
|
}),
|
|
5111
5111
|
emits: ["update:modelValue"],
|
|
5112
5112
|
setup(e) {
|
|
5113
|
-
const t = Mo(() => import("./vs-richtext-
|
|
5113
|
+
const t = Mo(() => import("./vs-richtext-BTZtoBcL.js")), n = e, { inputClass: l } = ht(n.style), a = Ke(e, "modelValue"), o = y(() => !!n.disabled), i = y(() => n.placeholder ?? ""), r = y(() => ({
|
|
5114
5114
|
height: n.richtextProps.height || "300px",
|
|
5115
5115
|
format: n.format,
|
|
5116
5116
|
...n.richtextProps
|
|
@@ -5123,7 +5123,7 @@ const Wu = /* @__PURE__ */ ve({
|
|
|
5123
5123
|
modelValue: a.value,
|
|
5124
5124
|
"onUpdate:modelValue": p[0] || (p[0] = (x) => a.value = x),
|
|
5125
5125
|
placeholder: i.value
|
|
5126
|
-
},
|
|
5126
|
+
}, r.value), null, 16, ["modelValue", "placeholder"])
|
|
5127
5127
|
], 6));
|
|
5128
5128
|
}
|
|
5129
5129
|
}), Pc = {}, Oc = {
|
|
@@ -5181,7 +5181,7 @@ const Rc = /* @__PURE__ */ Xe(Pc, [["render", Bc]]), Nc = { class: "bg-white rou
|
|
|
5181
5181
|
}),
|
|
5182
5182
|
emits: ["update:modelValue"],
|
|
5183
5183
|
setup(e) {
|
|
5184
|
-
const t = e, n = Lo(), l = (W) => t.actions === void 0 ? !0 : t.actions.includes(W), a = ["search", "import", "export", "add"], o = y(() => a.some((W) => l(W))), i = Ke(e, "modelValue"),
|
|
5184
|
+
const t = e, n = Lo(), l = (W) => t.actions === void 0 ? !0 : t.actions.includes(W), a = ["search", "import", "export", "add"], o = y(() => a.some((W) => l(W))), i = Ke(e, "modelValue"), r = D({}), d = D(""), p = D(null), x = D("asc"), b = y(() => {
|
|
5185
5185
|
const W = i.value ?? [], le = d.value ? W.filter((Ce) => _.value?.some((Ne) => {
|
|
5186
5186
|
const We = Ne.key || Ne.name;
|
|
5187
5187
|
if (!We) return !1;
|
|
@@ -5304,7 +5304,7 @@ const Rc = /* @__PURE__ */ Xe(Pc, [["render", Bc]]), Nc = { class: "bg-white rou
|
|
|
5304
5304
|
const We = Ce.map(encodeURIComponent).join(",");
|
|
5305
5305
|
try {
|
|
5306
5306
|
const z = await (await fetch(ee(le.data, We))).json();
|
|
5307
|
-
|
|
5307
|
+
r.value[ae] = z?.data ?? z;
|
|
5308
5308
|
} catch (qe) {
|
|
5309
5309
|
console.error("Failed to fetch column values", qe);
|
|
5310
5310
|
}
|
|
@@ -5360,7 +5360,7 @@ const Rc = /* @__PURE__ */ Xe(Pc, [["render", Bc]]), Nc = { class: "bg-white rou
|
|
|
5360
5360
|
return W == null || W === "" ? "-" : Array.isArray(W) ? W.map((le) => typeof le == "object" ? le?.text ?? le?.id ?? "-" : le).join(", ") : typeof W == "object" ? W?.text ?? W?.id ?? "-" : W;
|
|
5361
5361
|
}
|
|
5362
5362
|
function oe(W, le) {
|
|
5363
|
-
const ae = le.key || le.name, xe = W?.[ae], Ce =
|
|
5363
|
+
const ae = le.key || le.name, xe = W?.[ae], Ce = r.value[ae];
|
|
5364
5364
|
if (!xe) return "-";
|
|
5365
5365
|
if (Array.isArray(xe)) {
|
|
5366
5366
|
const We = xe.map((qe) => je(Ce, qe)).filter(Boolean);
|
|
@@ -5641,10 +5641,10 @@ function Cd(e, t) {
|
|
|
5641
5641
|
}
|
|
5642
5642
|
const Md = /* @__PURE__ */ Xe(_d, [["render", Cd]]);
|
|
5643
5643
|
function Ld(e, t, n) {
|
|
5644
|
-
const l = Math.max(0, Math.min(22, Math.floor(n))), a = 2 ** l, o = Math.floor((e + 180) / 360 * a), i = t * Math.PI / 180,
|
|
5644
|
+
const l = Math.max(0, Math.min(22, Math.floor(n))), a = 2 ** l, o = Math.floor((e + 180) / 360 * a), i = t * Math.PI / 180, r = Math.floor(
|
|
5645
5645
|
(1 - Math.log(Math.tan(i) + 1 / Math.cos(i)) / Math.PI) / 2 * a
|
|
5646
5646
|
);
|
|
5647
|
-
return { z: l, x: o, y:
|
|
5647
|
+
return { z: l, x: o, y: r };
|
|
5648
5648
|
}
|
|
5649
5649
|
function Ad(e, t) {
|
|
5650
5650
|
if (typeof e != "string" || !e.trim() || !/\{z\}/i.test(e)) return;
|
|
@@ -5704,7 +5704,7 @@ const Dd = ["title", "aria-expanded"], Id = ["src"], Td = { class: "map-layers__
|
|
|
5704
5704
|
},
|
|
5705
5705
|
emits: ["onLayerChange", "onOverlayToggle", "onVectorOverlayToggle"],
|
|
5706
5706
|
setup(e, { emit: t }) {
|
|
5707
|
-
const n = e, l = t, a = 10 * Bn, o = 400 * Bn, i = 400 * Bn,
|
|
5707
|
+
const n = e, l = t, a = 10 * Bn, o = 400 * Bn, i = 400 * Bn, r = 320 * Bn, d = D(null), p = D(null), x = D(null), b = D(!1), _ = D({}), w = y(() => Object.keys(n.basemaps || {}).length > 0), g = y(() => Object.keys(n.tileOverlays || {}).length > 0), $ = y(() => n.vectorOverlays ?? []), v = y(() => $.value.length > 0), M = y(
|
|
5708
5708
|
() => w.value || g.value || v.value
|
|
5709
5709
|
), C = y(() => n.basemaps?.[n.activeBaseKey]?.name || n.activeBaseKey || "Шари"), V = y(() => U(n.basemaps)), A = y(() => U(n.tileOverlays || {}));
|
|
5710
5710
|
function U(G) {
|
|
@@ -5732,7 +5732,7 @@ const Dd = ["title", "aria-expanded"], Id = ["src"], Td = { class: "map-layers__
|
|
|
5732
5732
|
const ke = G.getBoundingClientRect(), ye = Math.min(o, window.innerWidth - 16);
|
|
5733
5733
|
let T = ke.left;
|
|
5734
5734
|
T + ye > window.innerWidth - 8 && (T = window.innerWidth - ye - 8), T = Math.max(8, T);
|
|
5735
|
-
const ne = ke.top - a - 8, R = n.compact ?
|
|
5735
|
+
const ne = ke.top - a - 8, R = n.compact ? r : i, fe = Math.min(R, Math.max(96, ne));
|
|
5736
5736
|
_.value = {
|
|
5737
5737
|
position: "fixed",
|
|
5738
5738
|
left: `${T}px`,
|
|
@@ -5933,9 +5933,9 @@ function Qd(e, t, n) {
|
|
|
5933
5933
|
}
|
|
5934
5934
|
]
|
|
5935
5935
|
};
|
|
5936
|
-
const
|
|
5936
|
+
const r = [...o];
|
|
5937
5937
|
let d = !1;
|
|
5938
|
-
return ha(
|
|
5938
|
+
return ha(r[0], r[r.length - 1]) || (r.push(r[0]), d = !0), lf(r) ? {
|
|
5939
5939
|
ok: !1,
|
|
5940
5940
|
errors: [
|
|
5941
5941
|
{
|
|
@@ -5945,7 +5945,7 @@ function Qd(e, t, n) {
|
|
|
5945
5945
|
]
|
|
5946
5946
|
} : {
|
|
5947
5947
|
ok: !0,
|
|
5948
|
-
ring:
|
|
5948
|
+
ring: r,
|
|
5949
5949
|
wasClosedAutomatically: d
|
|
5950
5950
|
};
|
|
5951
5951
|
}
|
|
@@ -5984,8 +5984,8 @@ function tf(e, t, n) {
|
|
|
5984
5984
|
ok: !1,
|
|
5985
5985
|
errors: [{ line: t, message: "Не вдалося розпізнати десяткові координати." }]
|
|
5986
5986
|
};
|
|
5987
|
-
const
|
|
5988
|
-
return (
|
|
5987
|
+
const r = n === "lat-lon" ? o : i, d = n === "lat-lon" ? i : o;
|
|
5988
|
+
return (r < -90 || r > 90) && l.push({ line: t, message: "Широта поза діапазоном (-90..90)." }), (d < -180 || d > 180) && l.push({ line: t, message: "Довгота поза діапазоном (-180..180)." }), l.length ? { ok: !1, errors: l } : { ok: !0, point: [d, r] };
|
|
5989
5989
|
}
|
|
5990
5990
|
function Xa(e, t, n) {
|
|
5991
5991
|
Rn.lastIndex = 0;
|
|
@@ -6005,8 +6005,8 @@ function Xa(e, t, n) {
|
|
|
6005
6005
|
ok: !1,
|
|
6006
6006
|
errors: [{ line: t, message: "У рядку виявлено зайві символи або значення." }]
|
|
6007
6007
|
};
|
|
6008
|
-
const o = ya(l[0], t, n === "lat-lon" ? "lat" : "lon"), i = ya(l[1], t, n === "lat-lon" ? "lon" : "lat"),
|
|
6009
|
-
if (o.ok ||
|
|
6008
|
+
const o = ya(l[0], t, n === "lat-lon" ? "lat" : "lon"), i = ya(l[1], t, n === "lat-lon" ? "lon" : "lat"), r = [];
|
|
6009
|
+
if (o.ok || r.push(o.error), i.ok || r.push(i.error), r.length) return { ok: !1, errors: r };
|
|
6010
6010
|
const d = n === "lat-lon" ? o.value : i.value;
|
|
6011
6011
|
return { ok: !0, point: [n === "lat-lon" ? i.value : o.value, d] };
|
|
6012
6012
|
}
|
|
@@ -6065,8 +6065,8 @@ function lf(e) {
|
|
|
6065
6065
|
return !1;
|
|
6066
6066
|
}
|
|
6067
6067
|
function af(e, t, n, l) {
|
|
6068
|
-
const a = Nn(e, t, n), o = Nn(e, t, l), i = Nn(n, l, e),
|
|
6069
|
-
return !!(a !== o && i !==
|
|
6068
|
+
const a = Nn(e, t, n), o = Nn(e, t, l), i = Nn(n, l, e), r = Nn(n, l, t);
|
|
6069
|
+
return !!(a !== o && i !== r || a === 0 && jn(e, n, t) || o === 0 && jn(e, l, t) || i === 0 && jn(n, e, l) || r === 0 && jn(n, t, l));
|
|
6070
6070
|
}
|
|
6071
6071
|
function Nn(e, t, n) {
|
|
6072
6072
|
const l = (t[1] - e[1]) * (n[0] - t[0]) - (t[0] - e[0]) * (n[1] - t[1]);
|
|
@@ -6125,7 +6125,7 @@ const of = ["title"], rf = {
|
|
|
6125
6125
|
function i() {
|
|
6126
6126
|
return typeof globalThis < "u" && globalThis.proxy ? globalThis.proxy : typeof window < "u" && window.proxy ? window.proxy : null;
|
|
6127
6127
|
}
|
|
6128
|
-
function
|
|
6128
|
+
function r() {
|
|
6129
6129
|
const k = o?.appContext.config.globalProperties?.$settings?.map?.searchViewbox;
|
|
6130
6130
|
if (k)
|
|
6131
6131
|
return Array.isArray(k) ? k.join(",") : String(k);
|
|
@@ -6147,7 +6147,7 @@ const of = ["title"], rf = {
|
|
|
6147
6147
|
const L = i(), O = L?.map?.cadastreSuggest ?? L?.map?.parcelSuggest ?? L?.map?.parcelSearch;
|
|
6148
6148
|
if (typeof O == "string" && O.trim()) return O.trim();
|
|
6149
6149
|
}
|
|
6150
|
-
const x = !!d(), b = !!
|
|
6150
|
+
const x = !!d(), b = !!r(), _ = y(() => {
|
|
6151
6151
|
const z = ["nominatim", "xy", "parcel"];
|
|
6152
6152
|
return x && z.unshift("address"), b ? z : z.filter((k) => k !== "nominatim");
|
|
6153
6153
|
}), w = y(() => {
|
|
@@ -6378,7 +6378,7 @@ const of = ["title"], rf = {
|
|
|
6378
6378
|
async function le(z) {
|
|
6379
6379
|
const k = new URL(bf);
|
|
6380
6380
|
k.searchParams.set("format", "geojson"), k.searchParams.set("q", z), k.searchParams.set("addressdetails", "1"), k.searchParams.set("bounded", "1");
|
|
6381
|
-
const L =
|
|
6381
|
+
const L = r();
|
|
6382
6382
|
L && k.searchParams.set("viewbox", L);
|
|
6383
6383
|
const O = await fetch(k.toString());
|
|
6384
6384
|
if (!O.ok) throw new Error(`HTTP ${O.status}`);
|
|
@@ -6662,7 +6662,7 @@ const of = ["title"], rf = {
|
|
|
6662
6662
|
return;
|
|
6663
6663
|
const d = o(l.value, -90, 90), p = o(a.value, -180, 180);
|
|
6664
6664
|
n("submit", { lat: d, lng: p }), l.value = null, a.value = null;
|
|
6665
|
-
},
|
|
6665
|
+
}, r = () => {
|
|
6666
6666
|
l.value = null, a.value = null, n("cancel");
|
|
6667
6667
|
};
|
|
6668
6668
|
return (d, p) => (u(), m("div", kf, [
|
|
@@ -6705,7 +6705,7 @@ const of = ["title"], rf = {
|
|
|
6705
6705
|
c("button", {
|
|
6706
6706
|
class: "px-2 py-1 bg-gray-200 hover:bg-gray-300 text-gray-700 text-xs font-medium rounded transition-colors",
|
|
6707
6707
|
type: "button",
|
|
6708
|
-
onClick:
|
|
6708
|
+
onClick: r
|
|
6709
6709
|
}, " Скасувати ")
|
|
6710
6710
|
])
|
|
6711
6711
|
])
|
|
@@ -6783,20 +6783,20 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6783
6783
|
setup(e, { emit: t }) {
|
|
6784
6784
|
const n = e, l = t, a = y(
|
|
6785
6785
|
() => `${n.coords.lat.toFixed(4)}°, ${n.coords.lng.toFixed(4)}°`
|
|
6786
|
-
), o = D(!1), i = D(n.coords.lat),
|
|
6786
|
+
), o = D(!1), i = D(n.coords.lat), r = D(n.coords.lng);
|
|
6787
6787
|
ge(
|
|
6788
6788
|
() => n.coords,
|
|
6789
6789
|
(_) => {
|
|
6790
|
-
i.value = _.lat,
|
|
6790
|
+
i.value = _.lat, r.value = _.lng;
|
|
6791
6791
|
},
|
|
6792
6792
|
{ deep: !0, immediate: !0 }
|
|
6793
6793
|
);
|
|
6794
6794
|
const d = (_, w, g) => Math.min(Math.max(_, w), g), p = () => {
|
|
6795
6795
|
o.value = !0;
|
|
6796
6796
|
}, x = () => {
|
|
6797
|
-
if (!Number.isFinite(i.value) || !Number.isFinite(
|
|
6797
|
+
if (!Number.isFinite(i.value) || !Number.isFinite(r.value))
|
|
6798
6798
|
return;
|
|
6799
|
-
const _ = d(i.value, -90, 90), w = d(
|
|
6799
|
+
const _ = d(i.value, -90, 90), w = d(r.value, -180, 180);
|
|
6800
6800
|
l("update", { id: n.id, coords: { lat: _, lng: w } }), o.value = !1;
|
|
6801
6801
|
}, b = () => {
|
|
6802
6802
|
l("delete", n.id);
|
|
@@ -6825,7 +6825,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6825
6825
|
]
|
|
6826
6826
|
]),
|
|
6827
6827
|
Re(c("input", {
|
|
6828
|
-
"onUpdate:modelValue": w[1] || (w[1] = (g) =>
|
|
6828
|
+
"onUpdate:modelValue": w[1] || (w[1] = (g) => r.value = g),
|
|
6829
6829
|
type: "number",
|
|
6830
6830
|
step: "0.0001",
|
|
6831
6831
|
min: "-180",
|
|
@@ -6835,7 +6835,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6835
6835
|
}, null, 512), [
|
|
6836
6836
|
[
|
|
6837
6837
|
at,
|
|
6838
|
-
|
|
6838
|
+
r.value,
|
|
6839
6839
|
void 0,
|
|
6840
6840
|
{ number: !0 }
|
|
6841
6841
|
]
|
|
@@ -6913,7 +6913,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6913
6913
|
U * U + Math.cos(V) * Math.cos(A) * te * te
|
|
6914
6914
|
)
|
|
6915
6915
|
));
|
|
6916
|
-
},
|
|
6916
|
+
}, r = y(() => {
|
|
6917
6917
|
if (t.points.length < 2) return 0;
|
|
6918
6918
|
let g = 0;
|
|
6919
6919
|
for (let $ = 1; $ < t.points.length; $ += 1)
|
|
@@ -6922,7 +6922,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6922
6922
|
t.points[t.points.length - 1].coords,
|
|
6923
6923
|
t.points[0].coords
|
|
6924
6924
|
)), g;
|
|
6925
|
-
}), d = y(() =>
|
|
6925
|
+
}), d = y(() => r.value >= 1e3 ? `${tn(r.value / 1e3)} км` : `${tn(r.value)} м`);
|
|
6926
6926
|
function p(g) {
|
|
6927
6927
|
if (g.length < 3) return 0;
|
|
6928
6928
|
const $ = g[0].lat, v = g[0].lng, M = (V, A) => {
|
|
@@ -7052,7 +7052,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7052
7052
|
setup(e) {
|
|
7053
7053
|
const t = e;
|
|
7054
7054
|
function n(o, i) {
|
|
7055
|
-
const
|
|
7055
|
+
const r = (w) => w * Math.PI / 180, d = r(i.lat - o.lat), p = r(i.lng - o.lng), x = r(o.lat), b = r(i.lat);
|
|
7056
7056
|
return 6371e3 * (2 * Math.asin(
|
|
7057
7057
|
Math.sqrt(
|
|
7058
7058
|
Math.sin(d / 2) ** 2 + Math.cos(x) * Math.cos(b) * Math.sin(p / 2) ** 2
|
|
@@ -7065,12 +7065,12 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7065
7065
|
const a = y(() => {
|
|
7066
7066
|
const o = [], i = t.points;
|
|
7067
7067
|
if (i.length < 2) return o;
|
|
7068
|
-
for (let
|
|
7069
|
-
const d =
|
|
7068
|
+
for (let r = 0; r < i.length; r++) {
|
|
7069
|
+
const d = r === i.length - 1 && t.isShapeClosed ? 0 : r + 1;
|
|
7070
7070
|
if (d >= i.length) break;
|
|
7071
|
-
const p = n(i[
|
|
7071
|
+
const p = n(i[r].coords, i[d].coords);
|
|
7072
7072
|
o.push({
|
|
7073
|
-
from:
|
|
7073
|
+
from: r + 1,
|
|
7074
7074
|
to: d + 1,
|
|
7075
7075
|
label: l(p)
|
|
7076
7076
|
});
|
|
@@ -7080,12 +7080,12 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7080
7080
|
return (o, i) => (u(), m("div", Qf, [
|
|
7081
7081
|
i[0] || (i[0] = c("p", { class: "text-xs font-medium text-gray-600 mb-1.5" }, "Відстань між точками:", -1)),
|
|
7082
7082
|
c("div", ep, [
|
|
7083
|
-
(u(!0), m(Ae, null, Be(a.value, (
|
|
7083
|
+
(u(!0), m(Ae, null, Be(a.value, (r, d) => (u(), m("div", {
|
|
7084
7084
|
key: d,
|
|
7085
7085
|
class: "flex items-center justify-between text-xs py-1 px-2 rounded bg-gray-50"
|
|
7086
7086
|
}, [
|
|
7087
|
-
c("span", tp, "Точка " + de(
|
|
7088
|
-
c("span", np, de(
|
|
7087
|
+
c("span", tp, "Точка " + de(r.from) + " → Точка " + de(r.to), 1),
|
|
7088
|
+
c("span", np, de(r.label), 1)
|
|
7089
7089
|
]))), 128))
|
|
7090
7090
|
])
|
|
7091
7091
|
]));
|
|
@@ -7108,7 +7108,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7108
7108
|
"shape-closed-change"
|
|
7109
7109
|
],
|
|
7110
7110
|
setup(e, { expose: t, emit: n }) {
|
|
7111
|
-
const l = n, a = D([]), o = y(() => a.value.length > 0), i = D(!1),
|
|
7111
|
+
const l = n, a = D([]), o = y(() => a.value.length > 0), i = D(!1), r = D(!1), d = D("general");
|
|
7112
7112
|
function p(P) {
|
|
7113
7113
|
d.value = P, l("tab-change", P);
|
|
7114
7114
|
}
|
|
@@ -7116,11 +7116,11 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7116
7116
|
l("tab-change", d.value);
|
|
7117
7117
|
});
|
|
7118
7118
|
const x = y(
|
|
7119
|
-
() => a.value.length >= 3 && !
|
|
7119
|
+
() => a.value.length >= 3 && !r.value
|
|
7120
7120
|
);
|
|
7121
7121
|
let b = 1;
|
|
7122
7122
|
const _ = () => a.value.map((P) => ({ id: P.id, coords: { ...P.coords } })), w = () => {
|
|
7123
|
-
a.value.length < 3 &&
|
|
7123
|
+
a.value.length < 3 && r.value && (r.value = !1, l("shape-closed-change", !1)), l("points-change", _());
|
|
7124
7124
|
}, g = () => {
|
|
7125
7125
|
const P = b;
|
|
7126
7126
|
return b += 1, P;
|
|
@@ -7140,7 +7140,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7140
7140
|
}, M = (P) => {
|
|
7141
7141
|
a.value = a.value.filter((J) => J.id !== P), w();
|
|
7142
7142
|
}, C = () => {
|
|
7143
|
-
a.value = [],
|
|
7143
|
+
a.value = [], r.value && (r.value = !1, l("shape-closed-change", !1)), w();
|
|
7144
7144
|
}, V = (P) => {
|
|
7145
7145
|
v(P);
|
|
7146
7146
|
}, A = (P) => {
|
|
@@ -7152,7 +7152,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7152
7152
|
}, F = () => {
|
|
7153
7153
|
i.value = !1;
|
|
7154
7154
|
}, j = () => {
|
|
7155
|
-
x.value && (
|
|
7155
|
+
x.value && (r.value = !0, l("complete"), l("shape-closed-change", !0));
|
|
7156
7156
|
}, B = () => {
|
|
7157
7157
|
C(), i.value = !1, l("close");
|
|
7158
7158
|
};
|
|
@@ -7206,7 +7206,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7206
7206
|
o.value ? (u(), we(Gf, {
|
|
7207
7207
|
key: 1,
|
|
7208
7208
|
points: a.value,
|
|
7209
|
-
"is-shape-closed":
|
|
7209
|
+
"is-shape-closed": r.value,
|
|
7210
7210
|
onUpdatePoint: V,
|
|
7211
7211
|
onDeletePoint: A
|
|
7212
7212
|
}, null, 8, ["points", "is-shape-closed"])) : (u(), we(Jf, { key: 0 }))
|
|
@@ -7214,7 +7214,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7214
7214
|
o.value ? (u(), we(lp, {
|
|
7215
7215
|
key: 0,
|
|
7216
7216
|
points: a.value,
|
|
7217
|
-
"is-shape-closed":
|
|
7217
|
+
"is-shape-closed": r.value
|
|
7218
7218
|
}, null, 8, ["points", "is-shape-closed"])) : (u(), m("p", dp, "Додайте точки на карті, щоб бачити відстані між ними."))
|
|
7219
7219
|
])),
|
|
7220
7220
|
c("div", fp, [
|
|
@@ -7309,7 +7309,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7309
7309
|
}
|
|
7310
7310
|
return { type: "FeatureCollection", features: v };
|
|
7311
7311
|
}
|
|
7312
|
-
function
|
|
7312
|
+
function r(g, $) {
|
|
7313
7313
|
if (g.length < 2) return a();
|
|
7314
7314
|
const v = g.map((M) => [M.coords.lng, M.coords.lat]);
|
|
7315
7315
|
return $ && v.push(v[0]), {
|
|
@@ -7423,7 +7423,7 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7423
7423
|
const $ = g.getSource(St), v = g.getSource(zt), M = g.getSource(Ut), C = g.getSource(Ht), V = l.points, A = l.labelMode ?? "general";
|
|
7424
7424
|
$ && $.setData(
|
|
7425
7425
|
o(V, l.isShapeClosed, A)
|
|
7426
|
-
), v && v.setData(
|
|
7426
|
+
), v && v.setData(r(V, l.isShapeClosed)), M && M.setData(d(V)), C && C.setData(
|
|
7427
7427
|
A === "topoint" ? i(V, l.isShapeClosed) : a()
|
|
7428
7428
|
);
|
|
7429
7429
|
}
|
|
@@ -7447,9 +7447,9 @@ const Af = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7447
7447
|
function gp(e = {}) {
|
|
7448
7448
|
const t = D(!1), n = D([]), l = D(!1), a = D("general"), o = D(null);
|
|
7449
7449
|
function i() {
|
|
7450
|
-
t.value ?
|
|
7450
|
+
t.value ? r() : (t.value = !0, e.onActivate?.());
|
|
7451
7451
|
}
|
|
7452
|
-
function
|
|
7452
|
+
function r() {
|
|
7453
7453
|
t.value = !1, n.value = [], l.value = !1, o.value?.clearPoints(), e.onDeactivate?.();
|
|
7454
7454
|
}
|
|
7455
7455
|
function d(w) {
|
|
@@ -7473,7 +7473,7 @@ function gp(e = {}) {
|
|
|
7473
7473
|
rulerPanelRef: o,
|
|
7474
7474
|
hasRulerPoints: _,
|
|
7475
7475
|
toggleRuler: i,
|
|
7476
|
-
closeRuler:
|
|
7476
|
+
closeRuler: r,
|
|
7477
7477
|
onRulerPointsChange: d,
|
|
7478
7478
|
onRulerTabChange: p,
|
|
7479
7479
|
onRulerShapeClosedChange: x,
|
|
@@ -7598,9 +7598,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7598
7598
|
emits: ["update:modelValue", "valueSelected"],
|
|
7599
7599
|
setup(e, { emit: t }) {
|
|
7600
7600
|
const n = e, l = t, a = $a(), o = typeof document < "u" && document.querySelector("#modal") ? "#modal" : "body", i = y(() => {
|
|
7601
|
-
const
|
|
7602
|
-
return !!n.multi || !!n.multiple || h(f) || h(
|
|
7603
|
-
}),
|
|
7601
|
+
const s = a?.multiple, f = a?.multi, h = (S) => S === "" || S === !0 || S === "true" || S === 1 || S === "1";
|
|
7602
|
+
return !!n.multi || !!n.multiple || h(f) || h(s);
|
|
7603
|
+
}), r = y(() => !!n.disabled), d = D(!1), p = D(null), x = D(0), b = D(""), _ = D(null), w = D([]), g = D(null), $ = D(null), v = gp({
|
|
7604
7604
|
onActivate() {
|
|
7605
7605
|
if (he)
|
|
7606
7606
|
try {
|
|
@@ -7616,24 +7616,24 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7616
7616
|
v.toggleRuler();
|
|
7617
7617
|
}
|
|
7618
7618
|
const C = Gn(), V = C?.appContext?.config?.globalProperties?.$settings ?? {}, A = V?.map ?? {}, U = y(() => {
|
|
7619
|
-
const
|
|
7620
|
-
return Array.isArray(
|
|
7619
|
+
const s = A.layerPresets;
|
|
7620
|
+
return Array.isArray(s) ? s : [];
|
|
7621
7621
|
}), te = C?.vnode?.props ?? {};
|
|
7622
|
-
function F(
|
|
7623
|
-
return Object.prototype.hasOwnProperty.call(te,
|
|
7622
|
+
function F(s) {
|
|
7623
|
+
return Object.prototype.hasOwnProperty.call(te, s) || Object.prototype.hasOwnProperty.call(
|
|
7624
7624
|
te,
|
|
7625
|
-
|
|
7625
|
+
s.replace(/[A-Z]/g, (f) => `-${f.toLowerCase()}`)
|
|
7626
7626
|
);
|
|
7627
7627
|
}
|
|
7628
7628
|
const j = Array.isArray(A.center) && A.center.length === 2 ? A.center : Array.isArray(V.center) && V.center.length === 2 ? V.center : [30, 50], B = typeof A.zoom == "number" ? A.zoom : typeof V.zoom == "number" ? V.zoom : typeof V.defaultZoom == "number" ? V.defaultZoom : 10;
|
|
7629
|
-
function P(
|
|
7630
|
-
if (
|
|
7631
|
-
if (Array.isArray(
|
|
7632
|
-
const f = Number(
|
|
7629
|
+
function P(s) {
|
|
7630
|
+
if (s != null) {
|
|
7631
|
+
if (Array.isArray(s) && s.length >= 2) {
|
|
7632
|
+
const f = Number(s[0]), h = Number(s[1]);
|
|
7633
7633
|
return !Number.isFinite(f) || !Number.isFinite(h) ? void 0 : [f, h];
|
|
7634
7634
|
}
|
|
7635
|
-
if (typeof
|
|
7636
|
-
const f =
|
|
7635
|
+
if (typeof s == "object") {
|
|
7636
|
+
const f = s, h = f.geom;
|
|
7637
7637
|
if (f.type === "Point" && Array.isArray(f.coordinates)) {
|
|
7638
7638
|
const H = f.coordinates, ce = Number(H[0]), $e = Number(H[1]);
|
|
7639
7639
|
if (Number.isFinite(ce) && Number.isFinite($e)) return [ce, $e];
|
|
@@ -7650,8 +7650,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7650
7650
|
}
|
|
7651
7651
|
}
|
|
7652
7652
|
const J = y(() => {
|
|
7653
|
-
const
|
|
7654
|
-
if (
|
|
7653
|
+
const s = P(n.center);
|
|
7654
|
+
if (s) return s;
|
|
7655
7655
|
if (!F("center"))
|
|
7656
7656
|
return P(A.center) ?? P(V.center);
|
|
7657
7657
|
}), pe = y(
|
|
@@ -7664,23 +7664,23 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7664
7664
|
typeof pe.value == "number" ? pe.value : B
|
|
7665
7665
|
), G = D(null);
|
|
7666
7666
|
let ke = null;
|
|
7667
|
-
function ye(
|
|
7668
|
-
const f = typeof
|
|
7667
|
+
function ye(s) {
|
|
7668
|
+
const f = typeof s == "number" && Number.isFinite(s) ? s : Q.value;
|
|
7669
7669
|
return Math.min(
|
|
7670
7670
|
dm,
|
|
7671
7671
|
Math.max(cm, Math.round(f))
|
|
7672
7672
|
);
|
|
7673
7673
|
}
|
|
7674
|
-
function T(
|
|
7675
|
-
if (!Number.isFinite(
|
|
7676
|
-
const S = Ld(
|
|
7674
|
+
function T(s, f, h) {
|
|
7675
|
+
if (!Number.isFinite(s) || !Number.isFinite(f)) return;
|
|
7676
|
+
const S = Ld(s, f, ye(h)), I = G.value;
|
|
7677
7677
|
I && I.z === S.z && I.x === S.x && I.y === S.y || (G.value = S);
|
|
7678
7678
|
}
|
|
7679
7679
|
function ne() {
|
|
7680
7680
|
if (E) {
|
|
7681
|
-
const
|
|
7682
|
-
if (
|
|
7683
|
-
T(
|
|
7681
|
+
const s = E.getCenter?.(), f = E.getZoom?.();
|
|
7682
|
+
if (s && Number.isFinite(f)) {
|
|
7683
|
+
T(s.lng, s.lat, f);
|
|
7684
7684
|
return;
|
|
7685
7685
|
}
|
|
7686
7686
|
}
|
|
@@ -7723,7 +7723,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7723
7723
|
};
|
|
7724
7724
|
let je = !1, ue = !1;
|
|
7725
7725
|
const oe = Ll({}), Le = D([]), Pe = y(
|
|
7726
|
-
() => Le.value.map((
|
|
7726
|
+
() => Le.value.map((s) => oe[s]).filter(Boolean)
|
|
7727
7727
|
), Ye = D(null), ct = y(() => Ye.value?.entries ?? []), W = y(() => {
|
|
7728
7728
|
if (Ye.value)
|
|
7729
7729
|
return {
|
|
@@ -7732,10 +7732,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7732
7732
|
};
|
|
7733
7733
|
}), le = y(() => {
|
|
7734
7734
|
if (Array.isArray(n.tools) && n.tools.length) return n.tools;
|
|
7735
|
-
const
|
|
7736
|
-
return Array.isArray(
|
|
7735
|
+
const s = a?.tools;
|
|
7736
|
+
return Array.isArray(s) ? s.map((f) => String(f)) : typeof s == "string" ? s.split(",").map((f) => f.trim()).filter(Boolean) : [];
|
|
7737
7737
|
}), ae = y(() => {
|
|
7738
|
-
const
|
|
7738
|
+
const s = {
|
|
7739
7739
|
search: !1,
|
|
7740
7740
|
import: !1,
|
|
7741
7741
|
export: !1,
|
|
@@ -7747,7 +7747,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7747
7747
|
};
|
|
7748
7748
|
if (!le.value.length)
|
|
7749
7749
|
return {
|
|
7750
|
-
...
|
|
7750
|
+
...s,
|
|
7751
7751
|
import: !0,
|
|
7752
7752
|
export: !0,
|
|
7753
7753
|
point: !0,
|
|
@@ -7767,17 +7767,17 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7767
7767
|
ruler: f.has("ruler")
|
|
7768
7768
|
};
|
|
7769
7769
|
});
|
|
7770
|
-
function xe(
|
|
7771
|
-
const f = typeof
|
|
7770
|
+
function xe(s) {
|
|
7771
|
+
const f = typeof s == "string" ? s.trim() : "";
|
|
7772
7772
|
if (!f) return "";
|
|
7773
7773
|
if (/^https?:\/\//i.test(f)) return f;
|
|
7774
7774
|
const h = window?.location?.origin ?? "", S = f.replace(/^\/+/, "");
|
|
7775
7775
|
return S ? h ? `${h}/${S}` : `/${S}` : h;
|
|
7776
7776
|
}
|
|
7777
7777
|
function Ce() {
|
|
7778
|
-
const
|
|
7779
|
-
if (Array.isArray(
|
|
7780
|
-
const h =
|
|
7778
|
+
const s = Array.isArray(A.basemaps) && A.basemaps.length ? A.basemaps : V.basemaps;
|
|
7779
|
+
if (Array.isArray(s) && s.length) {
|
|
7780
|
+
const h = s.map((S, I) => {
|
|
7781
7781
|
const H = String(S?.key ?? S?.id ?? S?.name ?? `b${I}`), ce = xe(String(S?.url ?? ""));
|
|
7782
7782
|
if (!ce) return null;
|
|
7783
7783
|
const $e = typeof S?.preview == "string" && S.preview ? xe(S.preview) : "";
|
|
@@ -7810,8 +7810,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7810
7810
|
}
|
|
7811
7811
|
const Ne = Ce(), We = Object.keys(Ne), qe = D(We.length ? We[0] : "");
|
|
7812
7812
|
function z() {
|
|
7813
|
-
const
|
|
7814
|
-
return !Array.isArray(
|
|
7813
|
+
const s = Array.isArray(A.overlays) && A.overlays.length ? A.overlays : V.overlays;
|
|
7814
|
+
return !Array.isArray(s) || !s.length ? {} : s.map((h, S) => {
|
|
7815
7815
|
const H = (typeof h?.name == "string" ? h.name.trim() : "") || `o${S}`, ce = xe(String(h?.url ?? ""));
|
|
7816
7816
|
if (!ce) return null;
|
|
7817
7817
|
const $e = typeof h?.preview == "string" && h.preview ? xe(h.preview) : "";
|
|
@@ -7824,26 +7824,26 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7824
7824
|
);
|
|
7825
7825
|
}
|
|
7826
7826
|
const k = z(), L = D(
|
|
7827
|
-
Object.keys(k).filter((
|
|
7827
|
+
Object.keys(k).filter((s) => !!k[s]?.visible)
|
|
7828
7828
|
), O = y(
|
|
7829
7829
|
() => ae.value.point || ae.value.line || ae.value.polygon || ae.value.rectangle
|
|
7830
7830
|
), me = y(
|
|
7831
|
-
() => Pe.value.filter((
|
|
7832
|
-
id:
|
|
7833
|
-
label: String(
|
|
7834
|
-
visible:
|
|
7831
|
+
() => Pe.value.filter((s) => s.config?.overlay !== !1).map((s) => ({
|
|
7832
|
+
id: s.id,
|
|
7833
|
+
label: String(s.config.title || s.config.name || s.id),
|
|
7834
|
+
visible: s.visible
|
|
7835
7835
|
}))
|
|
7836
7836
|
);
|
|
7837
|
-
function De(
|
|
7838
|
-
return `${pm}${
|
|
7837
|
+
function De(s) {
|
|
7838
|
+
return `${pm}${s}`;
|
|
7839
7839
|
}
|
|
7840
|
-
function Qe(
|
|
7841
|
-
return `${mm}${
|
|
7840
|
+
function Qe(s) {
|
|
7841
|
+
return `${mm}${s}`;
|
|
7842
7842
|
}
|
|
7843
7843
|
async function Ge() {
|
|
7844
7844
|
if (typeof window > "u") return null;
|
|
7845
|
-
const
|
|
7846
|
-
if (
|
|
7845
|
+
const s = window;
|
|
7846
|
+
if (s[zn]) return s[zn];
|
|
7847
7847
|
const f = (H) => {
|
|
7848
7848
|
if (Array.from(document.styleSheets).some((Fe) => Fe?.href?.includes(H))) return;
|
|
7849
7849
|
const $e = document.createElement("link");
|
|
@@ -7862,16 +7862,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7862
7862
|
if (!ce) throw new Error("MapboxDraw not available after load");
|
|
7863
7863
|
return xp(H), { maplibregl: H, MapboxDraw: ce };
|
|
7864
7864
|
})().catch((H) => {
|
|
7865
|
-
throw delete
|
|
7865
|
+
throw delete s[zn], H;
|
|
7866
7866
|
});
|
|
7867
|
-
return
|
|
7867
|
+
return s[zn] = I, I;
|
|
7868
7868
|
}
|
|
7869
|
-
function pt(
|
|
7869
|
+
function pt(s) {
|
|
7870
7870
|
return {
|
|
7871
7871
|
version: 8,
|
|
7872
7872
|
glyphs: vm,
|
|
7873
7873
|
sources: {
|
|
7874
|
-
rasterSource: bl(
|
|
7874
|
+
rasterSource: bl(s, void 0, { safe: !1 })
|
|
7875
7875
|
},
|
|
7876
7876
|
layers: [
|
|
7877
7877
|
{
|
|
@@ -7886,7 +7886,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7886
7886
|
function ol() {
|
|
7887
7887
|
return {
|
|
7888
7888
|
onSetup() {
|
|
7889
|
-
const
|
|
7889
|
+
const s = this.newFeature({
|
|
7890
7890
|
type: "Feature",
|
|
7891
7891
|
properties: {},
|
|
7892
7892
|
geometry: {
|
|
@@ -7902,16 +7902,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7902
7902
|
]
|
|
7903
7903
|
}
|
|
7904
7904
|
});
|
|
7905
|
-
return this.addFeature(
|
|
7906
|
-
rectangle:
|
|
7905
|
+
return this.addFeature(s), this.clearSelectedFeatures(), this.updateUIClasses({ mouse: "add" }), this.setActionableState({ trash: !0 }), {
|
|
7906
|
+
rectangle: s,
|
|
7907
7907
|
startPoint: null,
|
|
7908
7908
|
hasCoordinates: !1
|
|
7909
7909
|
};
|
|
7910
7910
|
},
|
|
7911
|
-
onMouseMove(
|
|
7912
|
-
if (!
|
|
7913
|
-
const [h, S] =
|
|
7914
|
-
|
|
7911
|
+
onMouseMove(s, f) {
|
|
7912
|
+
if (!s.startPoint) return;
|
|
7913
|
+
const [h, S] = s.startPoint, I = f.lngLat.lng, H = f.lngLat.lat;
|
|
7914
|
+
s.rectangle.setCoordinates([
|
|
7915
7915
|
[
|
|
7916
7916
|
[h, S],
|
|
7917
7917
|
[I, S],
|
|
@@ -7921,9 +7921,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7921
7921
|
]
|
|
7922
7922
|
]);
|
|
7923
7923
|
},
|
|
7924
|
-
onClick(
|
|
7925
|
-
if (!
|
|
7926
|
-
|
|
7924
|
+
onClick(s, f) {
|
|
7925
|
+
if (!s.startPoint) {
|
|
7926
|
+
s.startPoint = [f.lngLat.lng, f.lngLat.lat], s.hasCoordinates = !0, s.rectangle.setCoordinates([
|
|
7927
7927
|
[
|
|
7928
7928
|
[f.lngLat.lng, f.lngLat.lat],
|
|
7929
7929
|
[f.lngLat.lng, f.lngLat.lat],
|
|
@@ -7934,8 +7934,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7934
7934
|
]);
|
|
7935
7935
|
return;
|
|
7936
7936
|
}
|
|
7937
|
-
const [h, S] =
|
|
7938
|
-
return Math.abs(h - I) > 0 && Math.abs(S - H) > 0 ? (
|
|
7937
|
+
const [h, S] = s.startPoint, I = f.lngLat.lng, H = f.lngLat.lat;
|
|
7938
|
+
return Math.abs(h - I) > 0 && Math.abs(S - H) > 0 ? (s.rectangle.setCoordinates([
|
|
7939
7939
|
[
|
|
7940
7940
|
[h, S],
|
|
7941
7941
|
[I, S],
|
|
@@ -7943,16 +7943,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
7943
7943
|
[h, H],
|
|
7944
7944
|
[h, S]
|
|
7945
7945
|
]
|
|
7946
|
-
]), this.map.fire("draw.create", { features: [
|
|
7946
|
+
]), this.map.fire("draw.create", { features: [s.rectangle.toGeoJSON()] }), this.changeMode("simple_select", { featureIds: [s.rectangle.id] })) : (this.deleteFeature([s.rectangle.id], { silent: !0 }), s.hasCoordinates = !1, this.changeMode("simple_select"));
|
|
7947
7947
|
},
|
|
7948
7948
|
onStop() {
|
|
7949
7949
|
},
|
|
7950
|
-
onTrash(
|
|
7951
|
-
this.deleteFeature([
|
|
7950
|
+
onTrash(s) {
|
|
7951
|
+
this.deleteFeature([s.rectangle.id], { silent: !0 }), this.changeMode("simple_select");
|
|
7952
7952
|
},
|
|
7953
|
-
toDisplayFeatures(
|
|
7954
|
-
const S = f.properties.id ===
|
|
7955
|
-
S && !
|
|
7953
|
+
toDisplayFeatures(s, f, h) {
|
|
7954
|
+
const S = f.properties.id === s.rectangle.id;
|
|
7955
|
+
S && !s.hasCoordinates || (f.properties.active = S ? "true" : "false", h(f));
|
|
7956
7956
|
}
|
|
7957
7957
|
};
|
|
7958
7958
|
}
|
|
@@ -8086,29 +8086,29 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8086
8086
|
}
|
|
8087
8087
|
];
|
|
8088
8088
|
function An() {
|
|
8089
|
-
const
|
|
8090
|
-
return !
|
|
8089
|
+
const s = qe.value;
|
|
8090
|
+
return !s || !Ne[s]?.url ? "" : Ne[s].url;
|
|
8091
8091
|
}
|
|
8092
|
-
function rl(
|
|
8093
|
-
return
|
|
8092
|
+
function rl(s, f) {
|
|
8093
|
+
return s?.id ? String(s.id) : s?.url ? `${s.url}-${f}` : `layer-${f}`;
|
|
8094
8094
|
}
|
|
8095
|
-
function vn(
|
|
8096
|
-
const f = String(
|
|
8095
|
+
function vn(s) {
|
|
8096
|
+
const f = String(s?.url ?? "").trim();
|
|
8097
8097
|
if (!f) return "";
|
|
8098
8098
|
if (/^https?:\/\//i.test(f)) return f;
|
|
8099
8099
|
const h = window.location?.origin ?? "", S = f.replace(/^\/+/, "");
|
|
8100
8100
|
return `${h}/${S}`;
|
|
8101
8101
|
}
|
|
8102
|
-
function N(
|
|
8103
|
-
|
|
8102
|
+
function N(s) {
|
|
8103
|
+
s && Ye.value?.layerId !== s || (Ye.value = null);
|
|
8104
8104
|
}
|
|
8105
|
-
function re(
|
|
8106
|
-
if (
|
|
8105
|
+
function re(s, f = {}) {
|
|
8106
|
+
if (s.popup === !1) return [];
|
|
8107
8107
|
const h = Number(f?.point_count);
|
|
8108
8108
|
if (Number.isFinite(h) && h > 1)
|
|
8109
8109
|
return [{ key: "Об'єктів у кластері", value: String(h) }];
|
|
8110
|
-
const S = vn(
|
|
8111
|
-
return Array.isArray(
|
|
8110
|
+
const S = vn(s), I = wl(s, S, U.value);
|
|
8111
|
+
return Array.isArray(s.popup) ? s.popup.length ? s.popup.map((H) => {
|
|
8112
8112
|
const ce = H?.field || H?.name;
|
|
8113
8113
|
if (!ce) return null;
|
|
8114
8114
|
const $e = f[ce];
|
|
@@ -8117,25 +8117,25 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8117
8117
|
return { key: H.label || ce, value: Fe };
|
|
8118
8118
|
}).filter(Boolean) : [] : Object.entries(f).slice(0, 5).map(([H, ce]) => ({ key: H, value: ce == null ? "—" : String(ce) }));
|
|
8119
8119
|
}
|
|
8120
|
-
function Se(
|
|
8121
|
-
if (!Array.isArray(
|
|
8120
|
+
function Se(s) {
|
|
8121
|
+
if (!Array.isArray(s)) return [];
|
|
8122
8122
|
const f = (S) => Array.isArray(S) && S.length >= 2 && Number.isFinite(Number(S[0])) && Number.isFinite(Number(S[1])), h = (S) => {
|
|
8123
8123
|
if (!S.length) return S;
|
|
8124
8124
|
const I = S[0], H = S[S.length - 1];
|
|
8125
8125
|
return !H || I[0] !== H[0] || I[1] !== H[1] ? [...S, I] : S;
|
|
8126
8126
|
};
|
|
8127
|
-
if (
|
|
8128
|
-
const S =
|
|
8127
|
+
if (s.length && f(s[0])) {
|
|
8128
|
+
const S = s.map((I) => [Number(I[0]), Number(I[1])]).filter(f);
|
|
8129
8129
|
return S.length ? [h(S)] : [];
|
|
8130
8130
|
}
|
|
8131
|
-
return
|
|
8131
|
+
return s.length && Array.isArray(s[0]) && f(s[0][0]) ? s.map(
|
|
8132
8132
|
(I) => Array.isArray(I) ? I.map((H) => [Number(H[0]), Number(H[1])]) : []
|
|
8133
|
-
).filter((I) => I.length).map(h) :
|
|
8133
|
+
).filter((I) => I.length).map(h) : s.length && Array.isArray(s[0]) && Array.isArray(s[0][0]) && f(s[0][0][0]) ? s.flatMap((I) => Array.isArray(I) ? I : []).map(
|
|
8134
8134
|
(I) => Array.isArray(I) ? I.map((H) => [Number(H[0]), Number(H[1])]) : []
|
|
8135
8135
|
).filter((I) => I.length).map(h) : [];
|
|
8136
8136
|
}
|
|
8137
|
-
function Ue(
|
|
8138
|
-
const f =
|
|
8137
|
+
function Ue(s) {
|
|
8138
|
+
const f = s.style ?? {}, h = f.color ?? "#3b82f6";
|
|
8139
8139
|
if (!f.colorAttr || !f.colorSet) return h;
|
|
8140
8140
|
const S = Object.keys(f.colorSet);
|
|
8141
8141
|
if (!S.length) return h;
|
|
@@ -8144,29 +8144,29 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8144
8144
|
I.push(String(H), f.colorSet?.[H] ?? h);
|
|
8145
8145
|
}), I.push(h), I;
|
|
8146
8146
|
}
|
|
8147
|
-
function ot(
|
|
8147
|
+
function ot(s) {
|
|
8148
8148
|
if (!E) return;
|
|
8149
8149
|
const f = E.getStyle()?.layers;
|
|
8150
8150
|
Array.isArray(f) && [...f].reverse().forEach((h) => {
|
|
8151
|
-
h.source ===
|
|
8151
|
+
h.source === s && E.getLayer(h.id) && E.removeLayer(h.id);
|
|
8152
8152
|
});
|
|
8153
8153
|
}
|
|
8154
|
-
function it(
|
|
8154
|
+
function it(s) {
|
|
8155
8155
|
if (!E) return;
|
|
8156
|
-
|
|
8156
|
+
s.handlers.forEach((S) => {
|
|
8157
8157
|
try {
|
|
8158
8158
|
E.off(S.type, S.layerId, S.handler);
|
|
8159
8159
|
} catch {
|
|
8160
8160
|
}
|
|
8161
|
-
}),
|
|
8161
|
+
}), s.handlers = [], [...s.layerIds, ...s.boundsIds].forEach((S) => {
|
|
8162
8162
|
E.getLayer(S) && E.removeLayer(S);
|
|
8163
|
-
}), ot(
|
|
8164
|
-
const f = `vs-ov-bounds-src-${
|
|
8165
|
-
E.getLayer(h) && E.removeLayer(h), E.getSource(f) && E.removeSource(f), N(
|
|
8163
|
+
}), ot(s.sourceId), E.getSource(s.sourceId) && E.removeSource(s.sourceId);
|
|
8164
|
+
const f = `vs-ov-bounds-src-${s.id}`, h = `vs-ov-bounds-line-${s.id}`;
|
|
8165
|
+
E.getLayer(h) && E.removeLayer(h), E.getSource(f) && E.removeSource(f), N(s.id);
|
|
8166
8166
|
}
|
|
8167
|
-
function rt(
|
|
8167
|
+
function rt(s, f) {
|
|
8168
8168
|
if (!E) return [];
|
|
8169
|
-
const h = `vs-ov-bounds-src-${f}`, S = `vs-ov-bounds-line-${f}`, I =
|
|
8169
|
+
const h = `vs-ov-bounds-src-${f}`, S = `vs-ov-bounds-line-${f}`, I = s.bounds ?? ee.value ?? Me.value, H = Se(I);
|
|
8170
8170
|
if (!H.length) return [];
|
|
8171
8171
|
const ce = {
|
|
8172
8172
|
type: "FeatureCollection",
|
|
@@ -8181,9 +8181,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8181
8181
|
type: "line",
|
|
8182
8182
|
source: h,
|
|
8183
8183
|
paint: {
|
|
8184
|
-
"line-color":
|
|
8185
|
-
"line-width":
|
|
8186
|
-
"line-opacity":
|
|
8184
|
+
"line-color": s.style?.stroke ?? s.style?.color ?? "#2563eb",
|
|
8185
|
+
"line-width": s.style?.width ?? 2,
|
|
8186
|
+
"line-opacity": s.style?.opacity ?? 0.8,
|
|
8187
8187
|
"line-dasharray": [2, 2]
|
|
8188
8188
|
}
|
|
8189
8189
|
}), [S];
|
|
@@ -8191,9 +8191,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8191
8191
|
function kt() {
|
|
8192
8192
|
return sn || b.value === "marker" || b.value === "polyline" || b.value === "polygon" || b.value === "rectangle";
|
|
8193
8193
|
}
|
|
8194
|
-
function Tt(
|
|
8194
|
+
function Tt(s, f) {
|
|
8195
8195
|
if (!E) return;
|
|
8196
|
-
|
|
8196
|
+
s.handlers.forEach((S) => {
|
|
8197
8197
|
try {
|
|
8198
8198
|
E.off(S.type, S.layerId, S.handler);
|
|
8199
8199
|
} catch {
|
|
@@ -8204,74 +8204,74 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8204
8204
|
const I = (ce) => {
|
|
8205
8205
|
if (kt()) return;
|
|
8206
8206
|
if (!ce?.features?.length) {
|
|
8207
|
-
N(
|
|
8207
|
+
N(s.id);
|
|
8208
8208
|
return;
|
|
8209
8209
|
}
|
|
8210
|
-
const $e = ce.features[0]?.properties ?? {}, Fe = re(
|
|
8210
|
+
const $e = ce.features[0]?.properties ?? {}, Fe = re(s.config, $e);
|
|
8211
8211
|
if (!Fe.length) {
|
|
8212
|
-
N(
|
|
8212
|
+
N(s.id);
|
|
8213
8213
|
return;
|
|
8214
8214
|
}
|
|
8215
8215
|
Ye.value = {
|
|
8216
|
-
layerId:
|
|
8216
|
+
layerId: s.id,
|
|
8217
8217
|
entries: Fe,
|
|
8218
8218
|
point: { x: ce.point.x, y: ce.point.y }
|
|
8219
8219
|
};
|
|
8220
|
-
}, H = () => N(
|
|
8220
|
+
}, H = () => N(s.id);
|
|
8221
8221
|
E.on("mousemove", S, I), E.on("mouseleave", S, H), h.push(
|
|
8222
8222
|
{ layerId: S, type: "mousemove", handler: I },
|
|
8223
8223
|
{ layerId: S, type: "mouseleave", handler: H }
|
|
8224
8224
|
);
|
|
8225
|
-
}),
|
|
8225
|
+
}), s.handlers = h;
|
|
8226
8226
|
}
|
|
8227
|
-
function _t(
|
|
8227
|
+
function _t(s, f) {
|
|
8228
8228
|
if (!E) return;
|
|
8229
|
-
|
|
8230
|
-
const h =
|
|
8231
|
-
[...
|
|
8229
|
+
s.layerIds = f, s.boundsIds = rt(s.config, s.id), Tt(s, f);
|
|
8230
|
+
const h = s.visible ? "visible" : "none";
|
|
8231
|
+
[...s.layerIds, ...s.boundsIds].forEach((S) => {
|
|
8232
8232
|
E.getLayer(S) && E.setLayoutProperty(S, "visibility", h);
|
|
8233
8233
|
}), Et();
|
|
8234
8234
|
}
|
|
8235
|
-
function xt(
|
|
8235
|
+
function xt(s) {
|
|
8236
8236
|
if (!E) return;
|
|
8237
|
-
it(
|
|
8238
|
-
const f =
|
|
8237
|
+
it(s), s.renderToken = (s.renderToken ?? 0) + 1;
|
|
8238
|
+
const f = s.renderToken, h = s.config, S = vn(h);
|
|
8239
8239
|
if (!S) return;
|
|
8240
8240
|
const I = [], H = /\.v(?:m)?t(?:\?|$|\/)/i.test(S) || /\.pbf(?:\?|$)/i.test(S) || /\/vtile(?:\/|\?|$)/i.test(S) || String(h?.service ?? "").toLowerCase() === "vector" || String(h?.format ?? "").toLowerCase() === "mvt", ce = wl(h, S, U.value);
|
|
8241
8241
|
if (H && ce) {
|
|
8242
8242
|
const $e = h.sourceLayer || h.layer || h.service_layer || h.dataset?.layer || h.id;
|
|
8243
|
-
E.addSource(
|
|
8243
|
+
E.addSource(s.sourceId, {
|
|
8244
8244
|
type: "vector",
|
|
8245
8245
|
tiles: [S],
|
|
8246
8246
|
minzoom: typeof h.minzoom == "number" ? h.minzoom : 0,
|
|
8247
8247
|
maxzoom: typeof h.maxzoom == "number" ? h.maxzoom : 22
|
|
8248
8248
|
}), (async () => {
|
|
8249
8249
|
try {
|
|
8250
|
-
if (!E || !E.getSource(
|
|
8250
|
+
if (!E || !E.getSource(s.sourceId) || s.renderToken !== f) return;
|
|
8251
8251
|
const Fe = await ce.render({
|
|
8252
8252
|
map: E,
|
|
8253
|
-
overlayId:
|
|
8254
|
-
sourceId:
|
|
8253
|
+
overlayId: s.id,
|
|
8254
|
+
sourceId: s.sourceId,
|
|
8255
8255
|
sourceLayer: $e,
|
|
8256
8256
|
url: S,
|
|
8257
8257
|
config: h
|
|
8258
8258
|
});
|
|
8259
|
-
if (!E || !E.getSource(
|
|
8259
|
+
if (!E || !E.getSource(s.sourceId) || s.renderToken !== f) {
|
|
8260
8260
|
Fe.forEach((tt) => {
|
|
8261
8261
|
E.getLayer(tt) && E.removeLayer(tt);
|
|
8262
8262
|
});
|
|
8263
8263
|
return;
|
|
8264
8264
|
}
|
|
8265
|
-
_t(
|
|
8265
|
+
_t(s, Fe);
|
|
8266
8266
|
} catch (Fe) {
|
|
8267
|
-
|
|
8267
|
+
s.renderToken === f && console.error(`Failed to render map layer preset "${ce.id}"`, Fe);
|
|
8268
8268
|
}
|
|
8269
8269
|
})();
|
|
8270
8270
|
return;
|
|
8271
8271
|
}
|
|
8272
8272
|
if (H) {
|
|
8273
8273
|
const $e = h.sourceLayer || h.layer || h.service_layer || h.dataset?.layer || h.id;
|
|
8274
|
-
E.addSource(
|
|
8274
|
+
E.addSource(s.sourceId, {
|
|
8275
8275
|
type: "vector",
|
|
8276
8276
|
tiles: [S],
|
|
8277
8277
|
minzoom: typeof h.minzoom == "number" ? h.minzoom : 0,
|
|
@@ -8279,11 +8279,11 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8279
8279
|
});
|
|
8280
8280
|
const Fe = Array.isArray(h.style?.types) ? h.style.types.map((jt) => String(jt).toLowerCase()) : [String(h.style?.type ?? "polygon").toLowerCase()], tt = Ue(h), Nt = h.style?.opacity ?? 0.5, gl = (jt) => {
|
|
8281
8281
|
if (jt === "point") {
|
|
8282
|
-
const bn = `vs-ov-point-${
|
|
8282
|
+
const bn = `vs-ov-point-${s.id}`;
|
|
8283
8283
|
E.addLayer({
|
|
8284
8284
|
id: bn,
|
|
8285
8285
|
type: "circle",
|
|
8286
|
-
source:
|
|
8286
|
+
source: s.sourceId,
|
|
8287
8287
|
"source-layer": $e,
|
|
8288
8288
|
paint: {
|
|
8289
8289
|
"circle-color": tt,
|
|
@@ -8294,11 +8294,11 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8294
8294
|
return;
|
|
8295
8295
|
}
|
|
8296
8296
|
if (jt === "polyline" || jt === "line") {
|
|
8297
|
-
const bn = `vs-ov-line-${
|
|
8297
|
+
const bn = `vs-ov-line-${s.id}`;
|
|
8298
8298
|
E.addLayer({
|
|
8299
8299
|
id: bn,
|
|
8300
8300
|
type: "line",
|
|
8301
|
-
source:
|
|
8301
|
+
source: s.sourceId,
|
|
8302
8302
|
"source-layer": $e,
|
|
8303
8303
|
layout: { "line-cap": "round", "line-join": "round" },
|
|
8304
8304
|
paint: {
|
|
@@ -8309,11 +8309,11 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8309
8309
|
}), I.push(bn);
|
|
8310
8310
|
return;
|
|
8311
8311
|
}
|
|
8312
|
-
const na = `vs-ov-fill-${
|
|
8312
|
+
const na = `vs-ov-fill-${s.id}`, la = `vs-ov-border-${s.id}`;
|
|
8313
8313
|
E.addLayer({
|
|
8314
8314
|
id: na,
|
|
8315
8315
|
type: "fill",
|
|
8316
|
-
source:
|
|
8316
|
+
source: s.sourceId,
|
|
8317
8317
|
"source-layer": $e,
|
|
8318
8318
|
paint: {
|
|
8319
8319
|
"fill-color": tt,
|
|
@@ -8322,7 +8322,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8322
8322
|
}), E.addLayer({
|
|
8323
8323
|
id: la,
|
|
8324
8324
|
type: "line",
|
|
8325
|
-
source:
|
|
8325
|
+
source: s.sourceId,
|
|
8326
8326
|
"source-layer": $e,
|
|
8327
8327
|
paint: {
|
|
8328
8328
|
"line-color": h.style?.stroke ?? h.style?.color ?? "#2563eb",
|
|
@@ -8331,24 +8331,24 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8331
8331
|
}
|
|
8332
8332
|
}), I.push(na, la);
|
|
8333
8333
|
};
|
|
8334
|
-
[...new Set(Fe)].forEach((jt) => gl(jt)), _t(
|
|
8334
|
+
[...new Set(Fe)].forEach((jt) => gl(jt)), _t(s, I);
|
|
8335
8335
|
return;
|
|
8336
8336
|
} else {
|
|
8337
8337
|
E.addSource(
|
|
8338
|
-
|
|
8338
|
+
s.sourceId,
|
|
8339
8339
|
bl(S, h, { safe: !1 })
|
|
8340
8340
|
);
|
|
8341
|
-
const $e = `vs-ov-raster-${
|
|
8341
|
+
const $e = `vs-ov-raster-${s.id}`;
|
|
8342
8342
|
E.addLayer({
|
|
8343
8343
|
id: $e,
|
|
8344
8344
|
type: "raster",
|
|
8345
|
-
source:
|
|
8345
|
+
source: s.sourceId,
|
|
8346
8346
|
paint: {
|
|
8347
8347
|
"raster-opacity": h.style?.opacity ?? 1
|
|
8348
8348
|
}
|
|
8349
8349
|
}), I.push($e);
|
|
8350
8350
|
}
|
|
8351
|
-
_t(
|
|
8351
|
+
_t(s, I);
|
|
8352
8352
|
}
|
|
8353
8353
|
function yt() {
|
|
8354
8354
|
if (!E) return;
|
|
@@ -8372,21 +8372,21 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8372
8372
|
}
|
|
8373
8373
|
});
|
|
8374
8374
|
}
|
|
8375
|
-
function gn(
|
|
8376
|
-
if (!E ||
|
|
8377
|
-
const f = oe[
|
|
8375
|
+
function gn(s) {
|
|
8376
|
+
if (!E || r.value) return;
|
|
8377
|
+
const f = oe[s];
|
|
8378
8378
|
if (!f) return;
|
|
8379
8379
|
f.visible = !f.visible;
|
|
8380
8380
|
const h = f.visible ? "visible" : "none";
|
|
8381
8381
|
[...f.layerIds, ...f.boundsIds].forEach((S) => {
|
|
8382
8382
|
E.getLayer(S) && E.setLayoutProperty(S, "visibility", h);
|
|
8383
|
-
}), Et(), f.visible || N(
|
|
8383
|
+
}), Et(), f.visible || N(s);
|
|
8384
8384
|
}
|
|
8385
|
-
function jl(
|
|
8385
|
+
function jl(s) {
|
|
8386
8386
|
if (!E) return;
|
|
8387
|
-
const f = k[
|
|
8387
|
+
const f = k[s];
|
|
8388
8388
|
if (!f?.url) return;
|
|
8389
|
-
const h = De(
|
|
8389
|
+
const h = De(s), S = Qe(s);
|
|
8390
8390
|
E.getLayer(S) && E.removeLayer(S), E.getSource(h) && E.removeSource(h), E.addSource(
|
|
8391
8391
|
h,
|
|
8392
8392
|
bl(f.url, f, { safe: !0 })
|
|
@@ -8401,21 +8401,21 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8401
8401
|
}
|
|
8402
8402
|
});
|
|
8403
8403
|
}
|
|
8404
|
-
function to(
|
|
8404
|
+
function to(s) {
|
|
8405
8405
|
if (!E) return;
|
|
8406
|
-
const f = De(
|
|
8406
|
+
const f = De(s), h = Qe(s);
|
|
8407
8407
|
E.getLayer(h) && E.removeLayer(h), E.getSource(f) && E.removeSource(f);
|
|
8408
8408
|
}
|
|
8409
8409
|
function zl() {
|
|
8410
|
-
E && L.value.forEach((
|
|
8410
|
+
E && L.value.forEach((s) => jl(s));
|
|
8411
8411
|
}
|
|
8412
|
-
function no(
|
|
8413
|
-
if (!E ||
|
|
8414
|
-
L.value.includes(
|
|
8412
|
+
function no(s) {
|
|
8413
|
+
if (!E || r.value || !k[s]) return;
|
|
8414
|
+
L.value.includes(s) ? (L.value = L.value.filter((h) => h !== s), to(s)) : (L.value = [...L.value, s], jl(s)), Et();
|
|
8415
8415
|
}
|
|
8416
8416
|
function Et() {
|
|
8417
8417
|
if (!E) return;
|
|
8418
|
-
const
|
|
8418
|
+
const s = L.value.map((Fe) => Qe(Fe)).filter((Fe) => E.getLayer(Fe)), f = [], h = [], S = [], I = [];
|
|
8419
8419
|
Le.value.forEach((Fe) => {
|
|
8420
8420
|
const tt = oe[Fe];
|
|
8421
8421
|
if (!tt) return;
|
|
@@ -8423,7 +8423,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8423
8423
|
gl ? S.push(...tt.layerIds) : jt ? f.push(...tt.layerIds) : h.push(...tt.layerIds), I.push(...tt.boundsIds);
|
|
8424
8424
|
});
|
|
8425
8425
|
const H = [
|
|
8426
|
-
...
|
|
8426
|
+
...s,
|
|
8427
8427
|
...f,
|
|
8428
8428
|
...h,
|
|
8429
8429
|
...S,
|
|
@@ -8440,8 +8440,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8440
8440
|
Fe && E.moveLayer(xa, Fe);
|
|
8441
8441
|
}
|
|
8442
8442
|
}
|
|
8443
|
-
function lo(
|
|
8444
|
-
if (!Ne[
|
|
8443
|
+
function lo(s) {
|
|
8444
|
+
if (!Ne[s] || (qe.value = s, !E)) return;
|
|
8445
8445
|
const f = An();
|
|
8446
8446
|
if (!f) return;
|
|
8447
8447
|
const h = E.getSource("rasterSource");
|
|
@@ -8462,33 +8462,33 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8462
8462
|
}
|
|
8463
8463
|
});
|
|
8464
8464
|
}
|
|
8465
|
-
function sl(
|
|
8465
|
+
function sl(s) {
|
|
8466
8466
|
return {
|
|
8467
8467
|
type: "Feature",
|
|
8468
8468
|
properties: {},
|
|
8469
|
-
geometry:
|
|
8469
|
+
geometry: s
|
|
8470
8470
|
};
|
|
8471
8471
|
}
|
|
8472
|
-
function Ft(
|
|
8473
|
-
if (!
|
|
8472
|
+
function Ft(s) {
|
|
8473
|
+
if (!s) return null;
|
|
8474
8474
|
try {
|
|
8475
|
-
return JSON.parse(JSON.stringify(
|
|
8475
|
+
return JSON.parse(JSON.stringify(s));
|
|
8476
8476
|
} catch {
|
|
8477
8477
|
return null;
|
|
8478
8478
|
}
|
|
8479
8479
|
}
|
|
8480
|
-
function il(
|
|
8481
|
-
if (!
|
|
8482
|
-
const f = Ft(
|
|
8480
|
+
function il(s) {
|
|
8481
|
+
if (!s) return null;
|
|
8482
|
+
const f = Ft(s.geometry);
|
|
8483
8483
|
return f ? {
|
|
8484
|
-
...
|
|
8484
|
+
...s.id !== void 0 ? { id: s.id } : {},
|
|
8485
8485
|
type: "Feature",
|
|
8486
|
-
properties: { ...
|
|
8486
|
+
properties: { ...s.properties ?? {} },
|
|
8487
8487
|
geometry: f
|
|
8488
8488
|
} : null;
|
|
8489
8489
|
}
|
|
8490
|
-
function yn(
|
|
8491
|
-
if (!
|
|
8490
|
+
function yn(s) {
|
|
8491
|
+
if (!s) return [];
|
|
8492
8492
|
const f = (I, H) => {
|
|
8493
8493
|
if (!I?.type) return [];
|
|
8494
8494
|
const ce = { ...H ?? {} };
|
|
@@ -8507,50 +8507,50 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8507
8507
|
I.properties ?? {}
|
|
8508
8508
|
) : I.type === "GeometryCollection" && Array.isArray(I.geometries) ? f(I, I.properties ?? {}) : typeof I.type == "string" && Array.isArray(I.coordinates) ? f(Ft(I), I.properties ?? {}) : null;
|
|
8509
8509
|
};
|
|
8510
|
-
if (
|
|
8511
|
-
return (
|
|
8512
|
-
if (Array.isArray(
|
|
8513
|
-
return
|
|
8510
|
+
if (s.type === "FeatureCollection")
|
|
8511
|
+
return (s.features ?? []).flatMap(h).filter(Boolean);
|
|
8512
|
+
if (Array.isArray(s))
|
|
8513
|
+
return s.flatMap(
|
|
8514
8514
|
(I) => I?.type === "FeatureCollection" ? yn(I) : [h(I)]
|
|
8515
8515
|
).flat().filter(Boolean);
|
|
8516
|
-
const S = h(
|
|
8516
|
+
const S = h(s);
|
|
8517
8517
|
return S ? Array.isArray(S) ? S : [S] : [];
|
|
8518
8518
|
}
|
|
8519
|
-
function Ul(
|
|
8520
|
-
if (!
|
|
8519
|
+
function Ul(s) {
|
|
8520
|
+
if (!s.length) return null;
|
|
8521
8521
|
if (!i.value)
|
|
8522
|
-
return Ft(
|
|
8523
|
-
const f =
|
|
8522
|
+
return Ft(s[0]?.geometry ?? null);
|
|
8523
|
+
const f = s.map((H) => Ft(H?.geometry)).filter(Boolean);
|
|
8524
8524
|
return f.every((H) => H?.type === "Point") ? { type: "MultiPoint", coordinates: f.map((H) => H.coordinates) } : f.every((H) => H?.type === "LineString") ? {
|
|
8525
8525
|
type: "MultiLineString",
|
|
8526
8526
|
coordinates: f.map((H) => H.coordinates)
|
|
8527
8527
|
} : f.every((H) => H?.type === "Polygon") ? { type: "MultiPolygon", coordinates: f.map((H) => H.coordinates) } : { type: "GeometryCollection", geometries: f };
|
|
8528
8528
|
}
|
|
8529
|
-
function Hl(
|
|
8530
|
-
if (!
|
|
8529
|
+
function Hl(s) {
|
|
8530
|
+
if (!s) return "__null__";
|
|
8531
8531
|
try {
|
|
8532
|
-
return JSON.stringify(
|
|
8532
|
+
return JSON.stringify(s);
|
|
8533
8533
|
} catch {
|
|
8534
8534
|
return "__invalid__";
|
|
8535
8535
|
}
|
|
8536
8536
|
}
|
|
8537
|
-
function ao(
|
|
8538
|
-
if (!Array.isArray(
|
|
8537
|
+
function ao(s, f) {
|
|
8538
|
+
if (!Array.isArray(s) || !Array.isArray(f) || s.length < 2 || f.length < 2) return !1;
|
|
8539
8539
|
const h = 1e-12;
|
|
8540
|
-
return Math.abs(Number(
|
|
8540
|
+
return Math.abs(Number(s[0]) - Number(f[0])) < h && Math.abs(Number(s[1]) - Number(f[1])) < h;
|
|
8541
8541
|
}
|
|
8542
|
-
function Wl(
|
|
8543
|
-
if (!Array.isArray(
|
|
8544
|
-
const S = ao(
|
|
8542
|
+
function Wl(s, f) {
|
|
8543
|
+
if (!Array.isArray(s) || s.length < 4) return null;
|
|
8544
|
+
const S = ao(s[0], s[s.length - 1]) ? s.slice(0, -1) : s.slice();
|
|
8545
8545
|
return !Number.isInteger(f) || f < 0 || f >= S.length || S.length <= 3 || (S.splice(f, 1), S.length < 3) ? null : [...S, [...S[0]]];
|
|
8546
8546
|
}
|
|
8547
|
-
function ql(
|
|
8548
|
-
if (!Array.isArray(
|
|
8549
|
-
const h =
|
|
8547
|
+
function ql(s, f) {
|
|
8548
|
+
if (!Array.isArray(s) || s.length < 2 || !Number.isInteger(f) || f < 0 || f >= s.length || s.length <= 2) return null;
|
|
8549
|
+
const h = s.slice();
|
|
8550
8550
|
return h.splice(f, 1), h.length < 2 ? null : h;
|
|
8551
8551
|
}
|
|
8552
|
-
function oo(
|
|
8553
|
-
const h = Ft(
|
|
8552
|
+
function oo(s, f) {
|
|
8553
|
+
const h = Ft(s);
|
|
8554
8554
|
if (!h || !Array.isArray(f)) return null;
|
|
8555
8555
|
if (h.type === "LineString") {
|
|
8556
8556
|
const [S] = f, I = ql(h.coordinates, S);
|
|
@@ -8570,49 +8570,49 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8570
8570
|
}
|
|
8571
8571
|
return null;
|
|
8572
8572
|
}
|
|
8573
|
-
function ro(
|
|
8574
|
-
return
|
|
8573
|
+
function ro(s) {
|
|
8574
|
+
return s ? s.split(".").map((f) => Number(f)).filter((f) => Number.isInteger(f) && f >= 0) : [];
|
|
8575
8575
|
}
|
|
8576
|
-
function Kl(
|
|
8577
|
-
return !he || !
|
|
8576
|
+
function Kl(s) {
|
|
8577
|
+
return !he || !s ? null : typeof he.get == "function" ? he.get(s) ?? null : he.getAll?.()?.features?.find((h) => String(h?.id ?? "") === s) ?? null;
|
|
8578
8578
|
}
|
|
8579
|
-
function Yl(
|
|
8580
|
-
const f =
|
|
8579
|
+
function Yl(s) {
|
|
8580
|
+
const f = s?.properties?.id ?? s?.id;
|
|
8581
8581
|
return f == null || f === "" ? null : String(f);
|
|
8582
8582
|
}
|
|
8583
|
-
function so(
|
|
8584
|
-
if (!E || !
|
|
8583
|
+
function so(s) {
|
|
8584
|
+
if (!E || !s) return null;
|
|
8585
8585
|
const f = [
|
|
8586
|
-
[
|
|
8587
|
-
[
|
|
8586
|
+
[s.x - 8, s.y - 8],
|
|
8587
|
+
[s.x + 8, s.y + 8]
|
|
8588
8588
|
], S = E.queryRenderedFeatures(f).find((I) => {
|
|
8589
8589
|
const H = String(I?.properties?.meta ?? "");
|
|
8590
8590
|
return H && H !== "feature" ? !1 : !!Yl(I);
|
|
8591
8591
|
});
|
|
8592
8592
|
return Yl(S);
|
|
8593
8593
|
}
|
|
8594
|
-
function io(
|
|
8595
|
-
if (!he || !
|
|
8596
|
-
const h = Kl(
|
|
8594
|
+
function io(s, f) {
|
|
8595
|
+
if (!he || !s || !f.length) return;
|
|
8596
|
+
const h = Kl(s);
|
|
8597
8597
|
if (!h?.geometry) return;
|
|
8598
8598
|
const S = oo(h.geometry, f);
|
|
8599
8599
|
if (!S) return;
|
|
8600
8600
|
const I = {
|
|
8601
8601
|
...h,
|
|
8602
|
-
id: h.id ??
|
|
8602
|
+
id: h.id ?? s,
|
|
8603
8603
|
geometry: S
|
|
8604
8604
|
};
|
|
8605
8605
|
ue = !0, je = !0;
|
|
8606
8606
|
try {
|
|
8607
|
-
he.delete(
|
|
8607
|
+
he.delete(s), he.add(I);
|
|
8608
8608
|
} finally {
|
|
8609
8609
|
je = !1, ue = !1;
|
|
8610
8610
|
}
|
|
8611
8611
|
Xt(), Rt();
|
|
8612
8612
|
}
|
|
8613
|
-
function uo(
|
|
8614
|
-
if (!E || !he ||
|
|
8615
|
-
const f =
|
|
8613
|
+
function uo(s) {
|
|
8614
|
+
if (!E || !he || r.value || v.isRulerActive.value || b.value !== "edit") return;
|
|
8615
|
+
const f = s?.point;
|
|
8616
8616
|
if (!f) return;
|
|
8617
8617
|
const h = [
|
|
8618
8618
|
[f.x - 8, f.y - 8],
|
|
@@ -8621,67 +8621,67 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8621
8621
|
(ce) => ce?.properties?.meta === "vertex" && ce?.properties?.parent && ce?.properties?.coord_path
|
|
8622
8622
|
);
|
|
8623
8623
|
if (!I) return;
|
|
8624
|
-
|
|
8624
|
+
s?.originalEvent?.preventDefault?.(), s?.originalEvent?.stopPropagation?.();
|
|
8625
8625
|
const H = ro(String(I.properties.coord_path));
|
|
8626
8626
|
H.length && io(String(I.properties.parent), H);
|
|
8627
8627
|
}
|
|
8628
|
-
function co(
|
|
8629
|
-
const f = Zl(
|
|
8628
|
+
function co(s) {
|
|
8629
|
+
const f = Zl(s);
|
|
8630
8630
|
if (!f) return null;
|
|
8631
8631
|
const [[h, S], [I, H]] = f;
|
|
8632
8632
|
return { lat: (S + H) / 2, lng: (h + I) / 2 };
|
|
8633
8633
|
}
|
|
8634
|
-
function Gl(
|
|
8635
|
-
if (!Array.isArray(
|
|
8634
|
+
function Gl(s) {
|
|
8635
|
+
if (!Array.isArray(s) || s.length < 3) return 0;
|
|
8636
8636
|
const f = (S, I) => {
|
|
8637
8637
|
const H = S * 2003750834e-2 / 180, ce = Math.log(Math.tan((90 + I) * Math.PI / 360)) / (Math.PI / 180);
|
|
8638
8638
|
return [H, ce * 2003750834e-2 / 180];
|
|
8639
8639
|
};
|
|
8640
8640
|
let h = 0;
|
|
8641
|
-
for (let S = 0; S <
|
|
8642
|
-
const [I, H] = f(Number(
|
|
8641
|
+
for (let S = 0; S < s.length - 1; S += 1) {
|
|
8642
|
+
const [I, H] = f(Number(s[S][0]), Number(s[S][1])), [ce, $e] = f(Number(s[S + 1][0]), Number(s[S + 1][1]));
|
|
8643
8643
|
h += I * $e - ce * H;
|
|
8644
8644
|
}
|
|
8645
8645
|
return Math.abs(h / 2) / 1e6;
|
|
8646
8646
|
}
|
|
8647
|
-
function fo(
|
|
8648
|
-
if (!
|
|
8649
|
-
if (
|
|
8650
|
-
const f =
|
|
8647
|
+
function fo(s) {
|
|
8648
|
+
if (!s?.type || !s?.coordinates) return null;
|
|
8649
|
+
if (s.type === "Polygon") {
|
|
8650
|
+
const f = s.coordinates?.[0];
|
|
8651
8651
|
return Array.isArray(f) ? Gl(f) : null;
|
|
8652
8652
|
}
|
|
8653
|
-
return
|
|
8653
|
+
return s.type === "MultiPolygon" ? s.coordinates.reduce((f, h) => {
|
|
8654
8654
|
const S = h?.[0];
|
|
8655
8655
|
return Array.isArray(S) ? f + Gl(S) : f;
|
|
8656
8656
|
}, 0) : null;
|
|
8657
8657
|
}
|
|
8658
|
-
function ul(
|
|
8659
|
-
if (!
|
|
8658
|
+
function ul(s) {
|
|
8659
|
+
if (!s) {
|
|
8660
8660
|
_.value = null;
|
|
8661
8661
|
return;
|
|
8662
8662
|
}
|
|
8663
|
-
const f = co(
|
|
8663
|
+
const f = co(s);
|
|
8664
8664
|
if (!f) {
|
|
8665
8665
|
_.value = null;
|
|
8666
8666
|
return;
|
|
8667
8667
|
}
|
|
8668
8668
|
_.value = {
|
|
8669
|
-
type: String(
|
|
8669
|
+
type: String(s.type ?? "Feature"),
|
|
8670
8670
|
center: f,
|
|
8671
|
-
areaKm2: fo(
|
|
8671
|
+
areaKm2: fo(s)
|
|
8672
8672
|
};
|
|
8673
8673
|
}
|
|
8674
|
-
function cl(
|
|
8675
|
-
if (!
|
|
8674
|
+
function cl(s) {
|
|
8675
|
+
if (!s) {
|
|
8676
8676
|
const S = mt[mt.length - 1], I = Ft(S?.geometry ?? null);
|
|
8677
8677
|
Bt = I, ul(I);
|
|
8678
8678
|
return;
|
|
8679
8679
|
}
|
|
8680
|
-
const f = mt.find((S) => String(S?.id ?? "") === String(
|
|
8680
|
+
const f = mt.find((S) => String(S?.id ?? "") === String(s)) ?? null, h = Ft(f?.geometry ?? null);
|
|
8681
8681
|
Bt = h, ul(h);
|
|
8682
8682
|
}
|
|
8683
|
-
function dl(
|
|
8684
|
-
w.value = (
|
|
8683
|
+
function dl(s) {
|
|
8684
|
+
w.value = (s ?? []).map((f, h) => {
|
|
8685
8685
|
const S = String(f?.id ?? `feature-${h + 1}`), I = fl(String(f?.geometry?.type ?? "Feature"));
|
|
8686
8686
|
return {
|
|
8687
8687
|
id: S,
|
|
@@ -8689,8 +8689,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8689
8689
|
};
|
|
8690
8690
|
});
|
|
8691
8691
|
}
|
|
8692
|
-
function fl(
|
|
8693
|
-
switch (String(
|
|
8692
|
+
function fl(s) {
|
|
8693
|
+
switch (String(s)) {
|
|
8694
8694
|
case "Point":
|
|
8695
8695
|
return "Точка";
|
|
8696
8696
|
case "MultiPoint":
|
|
@@ -8706,16 +8706,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8706
8706
|
case "GeometryCollection":
|
|
8707
8707
|
return "Колекція геометрій";
|
|
8708
8708
|
default:
|
|
8709
|
-
return String(
|
|
8709
|
+
return String(s || "Невідомо");
|
|
8710
8710
|
}
|
|
8711
8711
|
}
|
|
8712
|
-
function Xl(
|
|
8713
|
-
if (!Array.isArray(
|
|
8712
|
+
function Xl(s, f) {
|
|
8713
|
+
if (!Array.isArray(s) || !Array.isArray(f) || s.length !== 2 || f.length !== 2) return !1;
|
|
8714
8714
|
const h = 1e-9;
|
|
8715
|
-
return Math.abs(Number(
|
|
8715
|
+
return Math.abs(Number(s[0]) - Number(f[0])) < h && Math.abs(Number(s[1]) - Number(f[1])) < h;
|
|
8716
8716
|
}
|
|
8717
|
-
function Zl(
|
|
8718
|
-
if (!
|
|
8717
|
+
function Zl(s) {
|
|
8718
|
+
if (!s) return null;
|
|
8719
8719
|
let f = 1 / 0, h = 1 / 0, S = -1 / 0, I = -1 / 0;
|
|
8720
8720
|
const H = (ce) => {
|
|
8721
8721
|
if (Array.isArray(ce)) {
|
|
@@ -8727,14 +8727,14 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8727
8727
|
ce.forEach(H);
|
|
8728
8728
|
}
|
|
8729
8729
|
};
|
|
8730
|
-
return H(
|
|
8730
|
+
return H(s.coordinates), !Number.isFinite(f) || !Number.isFinite(h) ? null : [
|
|
8731
8731
|
[f, h],
|
|
8732
8732
|
[S, I]
|
|
8733
8733
|
];
|
|
8734
8734
|
}
|
|
8735
|
-
function Jl(
|
|
8736
|
-
if (!E || !
|
|
8737
|
-
const f = Zl(
|
|
8735
|
+
function Jl(s) {
|
|
8736
|
+
if (!E || !s) return;
|
|
8737
|
+
const f = Zl(s);
|
|
8738
8738
|
if (!f) return;
|
|
8739
8739
|
const [[h, S], [I, H]] = f;
|
|
8740
8740
|
if (h === I && S === H) {
|
|
@@ -8748,8 +8748,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8748
8748
|
x.value = 0;
|
|
8749
8749
|
return;
|
|
8750
8750
|
}
|
|
8751
|
-
const
|
|
8752
|
-
x.value =
|
|
8751
|
+
const s = he.getAll();
|
|
8752
|
+
x.value = s?.features?.length ?? 0;
|
|
8753
8753
|
}
|
|
8754
8754
|
function hn() {
|
|
8755
8755
|
if (!he) return null;
|
|
@@ -8765,12 +8765,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8765
8765
|
}
|
|
8766
8766
|
function Xt() {
|
|
8767
8767
|
if (!he) return;
|
|
8768
|
-
const
|
|
8769
|
-
if (x.value =
|
|
8768
|
+
const s = he.getAll();
|
|
8769
|
+
if (x.value = s?.features?.length ?? 0, !s?.features?.length) {
|
|
8770
8770
|
mt = [], w.value = [], Bt = null, st = null, _.value = null, je || (Lt = "__null__", l("update:modelValue", null));
|
|
8771
8771
|
return;
|
|
8772
8772
|
}
|
|
8773
|
-
const f = (
|
|
8773
|
+
const f = (s.features ?? []).map(il).filter(Boolean);
|
|
8774
8774
|
if (mt = f, dl(f), st = hn(), cl(st), !je) {
|
|
8775
8775
|
const h = Ul(f);
|
|
8776
8776
|
Lt = Hl(h), l("update:modelValue", h);
|
|
@@ -8780,9 +8780,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8780
8780
|
if (!he) return;
|
|
8781
8781
|
(he.getAll()?.features || []).forEach((f) => he.delete(f.id)), w.value = [], pl();
|
|
8782
8782
|
}
|
|
8783
|
-
function Dn(
|
|
8783
|
+
function Dn(s) {
|
|
8784
8784
|
if (!he) return;
|
|
8785
|
-
const f = yn(
|
|
8785
|
+
const f = yn(s), h = i.value ? f : f.slice(0, 1);
|
|
8786
8786
|
je = !0, Vn(), h.forEach((H) => {
|
|
8787
8787
|
try {
|
|
8788
8788
|
he.add(H);
|
|
@@ -8790,12 +8790,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8790
8790
|
}
|
|
8791
8791
|
}), je = !1, mt = (he.getAll?.()?.features ?? h).map(il).filter(Boolean), dl(mt), st = null;
|
|
8792
8792
|
const I = Ft(mt[mt.length - 1]?.geometry ?? null);
|
|
8793
|
-
Bt = Ft(I), pl(), ul(I), I && (Jl(I),
|
|
8793
|
+
Bt = Ft(I), pl(), ul(I), I && (Jl(I), r.value || Rt());
|
|
8794
8794
|
}
|
|
8795
8795
|
function po() {
|
|
8796
|
-
he && (je = !0, Vn(), mt.forEach((
|
|
8796
|
+
he && (je = !0, Vn(), mt.forEach((s) => {
|
|
8797
8797
|
try {
|
|
8798
|
-
he.add(
|
|
8798
|
+
he.add(s);
|
|
8799
8799
|
} catch {
|
|
8800
8800
|
}
|
|
8801
8801
|
}), je = !1, dl(mt), pl(), cl(st));
|
|
@@ -8809,10 +8809,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8809
8809
|
b.value = "";
|
|
8810
8810
|
}
|
|
8811
8811
|
}
|
|
8812
|
-
function In(
|
|
8813
|
-
if (
|
|
8814
|
-
v.isRulerActive.value && v.closeRuler(), sn = !0, un(), b.value =
|
|
8815
|
-
const f =
|
|
8812
|
+
function In(s) {
|
|
8813
|
+
if (r.value || !he) return;
|
|
8814
|
+
v.isRulerActive.value && v.closeRuler(), sn = !0, un(), b.value = s;
|
|
8815
|
+
const f = s === "marker" ? "draw_point" : s === "polyline" ? "draw_line_string" : s === "rectangle" ? "draw_rectangle" : "draw_polygon";
|
|
8816
8816
|
i.value || (je = !0, Vn(), je = !1);
|
|
8817
8817
|
try {
|
|
8818
8818
|
he.changeMode(f);
|
|
@@ -8824,9 +8824,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8824
8824
|
});
|
|
8825
8825
|
}
|
|
8826
8826
|
}
|
|
8827
|
-
function Rt(
|
|
8828
|
-
if (
|
|
8829
|
-
const h =
|
|
8827
|
+
function Rt(s) {
|
|
8828
|
+
if (r.value || !he || !he.getAll()?.features?.length) return;
|
|
8829
|
+
const h = s || hn();
|
|
8830
8830
|
if (h)
|
|
8831
8831
|
try {
|
|
8832
8832
|
he.changeMode("direct_select", { featureId: h }), st = h, cl(st), b.value = "edit";
|
|
@@ -8834,16 +8834,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8834
8834
|
b.value = "";
|
|
8835
8835
|
}
|
|
8836
8836
|
}
|
|
8837
|
-
function mo(
|
|
8838
|
-
|
|
8837
|
+
function mo(s) {
|
|
8838
|
+
r.value || !he || !s || Rt(s);
|
|
8839
8839
|
}
|
|
8840
8840
|
function vo() {
|
|
8841
|
-
if (!(
|
|
8841
|
+
if (!(r.value || !he)) {
|
|
8842
8842
|
if (i.value) {
|
|
8843
|
-
const
|
|
8844
|
-
if (
|
|
8843
|
+
const s = hn();
|
|
8844
|
+
if (s)
|
|
8845
8845
|
try {
|
|
8846
|
-
Yt = !0, he.delete(
|
|
8846
|
+
Yt = !0, he.delete(s), Yt = !1, Xt();
|
|
8847
8847
|
const f = hn();
|
|
8848
8848
|
f ? Rt(f) : un();
|
|
8849
8849
|
return;
|
|
@@ -8855,73 +8855,73 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8855
8855
|
}
|
|
8856
8856
|
}
|
|
8857
8857
|
function go() {
|
|
8858
|
-
|
|
8858
|
+
r.value || !Bt || Jl(Bt);
|
|
8859
8859
|
}
|
|
8860
|
-
function yo(
|
|
8860
|
+
function yo(s) {
|
|
8861
8861
|
if (!E || !bt) return;
|
|
8862
|
-
const f = [
|
|
8862
|
+
const f = [s[1], s[0]];
|
|
8863
8863
|
Gt || (Gt = new bt.Marker({ color: "#2563eb" })), Gt.setLngLat(f).addTo(E), E.easeTo({ center: f, zoom: 13, duration: 250 });
|
|
8864
8864
|
}
|
|
8865
8865
|
function ho() {
|
|
8866
|
-
|
|
8866
|
+
r.value || be.value?.click();
|
|
8867
8867
|
}
|
|
8868
8868
|
function bo() {
|
|
8869
|
-
|
|
8869
|
+
r.value || (Ie.value = !Ie.value);
|
|
8870
8870
|
}
|
|
8871
|
-
function Ql(
|
|
8871
|
+
function Ql(s) {
|
|
8872
8872
|
if (!Ie.value) return;
|
|
8873
8873
|
const f = se.value;
|
|
8874
|
-
f && !f.contains(
|
|
8874
|
+
f && !f.contains(s.target) && (Ie.value = !1);
|
|
8875
8875
|
}
|
|
8876
8876
|
function xo() {
|
|
8877
8877
|
Ie.value = !1, ho();
|
|
8878
8878
|
}
|
|
8879
8879
|
function wo() {
|
|
8880
|
-
|
|
8880
|
+
r.value || (He.value = [], Ie.value = !1, Ve.value = !0);
|
|
8881
8881
|
}
|
|
8882
8882
|
function ko() {
|
|
8883
8883
|
Ve.value = !1, He.value = [];
|
|
8884
8884
|
}
|
|
8885
8885
|
function $o() {
|
|
8886
|
-
if (
|
|
8887
|
-
const
|
|
8886
|
+
if (r.value || !he) return;
|
|
8887
|
+
const s = Qd(
|
|
8888
8888
|
Ze.value.coordinates ?? "",
|
|
8889
8889
|
Ze.value.format || "decimal",
|
|
8890
8890
|
Ze.value.order || "lat-lon"
|
|
8891
8891
|
);
|
|
8892
|
-
if (!
|
|
8893
|
-
He.value =
|
|
8892
|
+
if (!s.ok) {
|
|
8893
|
+
He.value = s.errors, _o(s.errors);
|
|
8894
8894
|
return;
|
|
8895
8895
|
}
|
|
8896
8896
|
He.value = [], Dn({
|
|
8897
8897
|
type: "Polygon",
|
|
8898
|
-
coordinates: [
|
|
8899
|
-
}), Xt(), Ve.value = !1,
|
|
8898
|
+
coordinates: [s.ring]
|
|
8899
|
+
}), Xt(), Ve.value = !1, s.wasClosedAutomatically && Te({
|
|
8900
8900
|
type: "info",
|
|
8901
8901
|
title: "Імпорт координат",
|
|
8902
8902
|
message: "Полігон був автоматично замкнений (перша і остання точки різнилися)."
|
|
8903
8903
|
});
|
|
8904
8904
|
}
|
|
8905
|
-
function _o(
|
|
8906
|
-
if (!
|
|
8905
|
+
function _o(s) {
|
|
8906
|
+
if (!s.length) return;
|
|
8907
8907
|
const f = 5;
|
|
8908
|
-
|
|
8908
|
+
s.slice(0, f).forEach((h) => {
|
|
8909
8909
|
const S = h.line > 0 ? `Рядок ${h.line}` : "Загальна помилка";
|
|
8910
8910
|
Te({
|
|
8911
8911
|
type: "warning",
|
|
8912
8912
|
title: "Імпорт координат",
|
|
8913
8913
|
message: `${S} — ${h.message}`
|
|
8914
8914
|
});
|
|
8915
|
-
}),
|
|
8915
|
+
}), s.length > f && Te({
|
|
8916
8916
|
type: "warning",
|
|
8917
8917
|
title: "Імпорт координат",
|
|
8918
|
-
message: `Ще помилок: ${
|
|
8918
|
+
message: `Ще помилок: ${s.length - f}`
|
|
8919
8919
|
});
|
|
8920
8920
|
}
|
|
8921
|
-
function So(
|
|
8922
|
-
if (
|
|
8921
|
+
function So(s) {
|
|
8922
|
+
if (r.value || !he) return;
|
|
8923
8923
|
Ie.value = !1;
|
|
8924
|
-
const f =
|
|
8924
|
+
const f = s.target, h = f.files?.[0];
|
|
8925
8925
|
if (!h) return;
|
|
8926
8926
|
const S = new FileReader();
|
|
8927
8927
|
S.onload = () => {
|
|
@@ -8954,14 +8954,14 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8954
8954
|
}, S.readAsText(h);
|
|
8955
8955
|
}
|
|
8956
8956
|
function Co() {
|
|
8957
|
-
if (
|
|
8958
|
-
const
|
|
8957
|
+
if (r.value || !he) return;
|
|
8958
|
+
const s = he.getAll(), f = new Blob([JSON.stringify(s, null, 2)], { type: "application/json" }), h = URL.createObjectURL(f), S = document.createElement("a");
|
|
8959
8959
|
S.href = h, S.download = "data.geojson", S.click(), URL.revokeObjectURL(h);
|
|
8960
8960
|
}
|
|
8961
8961
|
lt(async () => {
|
|
8962
8962
|
if (window.addEventListener("click", Ql, !0), !p.value) return;
|
|
8963
|
-
const
|
|
8964
|
-
bt =
|
|
8963
|
+
const s = await Ge();
|
|
8964
|
+
bt = s.maplibregl, wt = s.MapboxDraw;
|
|
8965
8965
|
const f = An();
|
|
8966
8966
|
f && (E = new bt.Map({
|
|
8967
8967
|
container: p.value,
|
|
@@ -8994,10 +8994,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
8994
8994
|
$.value?.addPoint?.({ lat: I.lat, lng: I.lng });
|
|
8995
8995
|
return;
|
|
8996
8996
|
}
|
|
8997
|
-
if (!he ||
|
|
8997
|
+
if (!he || r.value || b.value !== "edit") return;
|
|
8998
8998
|
const S = so(h?.point);
|
|
8999
8999
|
!S || S === st || requestAnimationFrame(() => {
|
|
9000
|
-
!he ||
|
|
9000
|
+
!he || r.value || Rt(S);
|
|
9001
9001
|
});
|
|
9002
9002
|
}), E.on("draw.create", () => {
|
|
9003
9003
|
if (he && !v.isRulerActive.value) {
|
|
@@ -9036,18 +9036,18 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9036
9036
|
if (!he || rn || v.isRulerActive.value || b.value === "marker" || b.value === "polyline" || b.value === "polygon" || b.value === "rectangle")
|
|
9037
9037
|
return;
|
|
9038
9038
|
const S = h?.features?.[0]?.id !== void 0 && h?.features?.[0]?.id !== null ? String(h.features[0].id) : null;
|
|
9039
|
-
if (!
|
|
9039
|
+
if (!r.value && S) {
|
|
9040
9040
|
if (b.value === "edit" && st === S) return;
|
|
9041
9041
|
requestAnimationFrame(() => {
|
|
9042
|
-
!he ||
|
|
9042
|
+
!he || r.value || Rt(S);
|
|
9043
9043
|
});
|
|
9044
9044
|
return;
|
|
9045
9045
|
}
|
|
9046
9046
|
const I = he.getSelectedIds?.(), H = Array.isArray(I) && I.length > 0 ? String(I[0]) : null;
|
|
9047
|
-
if (!
|
|
9047
|
+
if (!r.value && H) {
|
|
9048
9048
|
if (b.value === "edit" && st === H) return;
|
|
9049
9049
|
requestAnimationFrame(() => {
|
|
9050
|
-
!he ||
|
|
9050
|
+
!he || r.value || Rt(H);
|
|
9051
9051
|
});
|
|
9052
9052
|
return;
|
|
9053
9053
|
}
|
|
@@ -9070,31 +9070,31 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9070
9070
|
E && (Q.value = E.getZoom());
|
|
9071
9071
|
}));
|
|
9072
9072
|
}), fn(() => {
|
|
9073
|
-
typeof document < "u" && (document.body.style.overflow = ""), typeof window < "u" && window.removeEventListener("keydown", vl), ke && (clearTimeout(ke), ke = null), v.isRulerActive.value && v.closeRuler(), window.removeEventListener("click", Ql, !0), Object.values(oe).forEach((
|
|
9074
|
-
E && it(
|
|
9073
|
+
typeof document < "u" && (document.body.style.overflow = ""), typeof window < "u" && window.removeEventListener("keydown", vl), ke && (clearTimeout(ke), ke = null), v.isRulerActive.value && v.closeRuler(), window.removeEventListener("click", Ql, !0), Object.values(oe).forEach((s) => {
|
|
9074
|
+
E && it(s);
|
|
9075
9075
|
}), N(), Gt?.remove && Gt.remove(), Gt = null, E?.remove && E.remove(), E = null, he = null, g.value = null;
|
|
9076
9076
|
}), ge(
|
|
9077
9077
|
() => n.modelValue,
|
|
9078
|
-
(
|
|
9078
|
+
(s) => {
|
|
9079
9079
|
if (!he) {
|
|
9080
|
-
fe.value =
|
|
9080
|
+
fe.value = s;
|
|
9081
9081
|
return;
|
|
9082
9082
|
}
|
|
9083
9083
|
if (kt()) return;
|
|
9084
9084
|
const f = Ul(
|
|
9085
|
-
(i.value ? yn(
|
|
9085
|
+
(i.value ? yn(s) : yn(s).slice(0, 1)) || []
|
|
9086
9086
|
), h = Hl(f);
|
|
9087
9087
|
if (Lt && h === Lt) {
|
|
9088
9088
|
Lt = null;
|
|
9089
9089
|
return;
|
|
9090
9090
|
}
|
|
9091
|
-
Lt = null, Dn(
|
|
9091
|
+
Lt = null, Dn(s);
|
|
9092
9092
|
},
|
|
9093
9093
|
{ deep: !0 }
|
|
9094
9094
|
), ge(
|
|
9095
9095
|
() => X.value,
|
|
9096
|
-
(
|
|
9097
|
-
const f = Array.isArray(
|
|
9096
|
+
(s) => {
|
|
9097
|
+
const f = Array.isArray(s) ? s : [], h = [], S = /* @__PURE__ */ new Set();
|
|
9098
9098
|
f.forEach((I, H) => {
|
|
9099
9099
|
if (!I) return;
|
|
9100
9100
|
const ce = rl(I, H);
|
|
@@ -9123,16 +9123,16 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9123
9123
|
), ge(
|
|
9124
9124
|
() => ee.value,
|
|
9125
9125
|
() => {
|
|
9126
|
-
E && (yt(), Le.value.forEach((
|
|
9127
|
-
const f = oe[
|
|
9126
|
+
E && (yt(), Le.value.forEach((s) => {
|
|
9127
|
+
const f = oe[s];
|
|
9128
9128
|
f && xt(f);
|
|
9129
9129
|
}), Et());
|
|
9130
9130
|
},
|
|
9131
9131
|
{ deep: !0 }
|
|
9132
9132
|
), ge(
|
|
9133
9133
|
() => _e.value,
|
|
9134
|
-
async (
|
|
9135
|
-
if (Me.value = [], !
|
|
9134
|
+
async (s) => {
|
|
9135
|
+
if (Me.value = [], !s) {
|
|
9136
9136
|
E && (yt(), Le.value.forEach((f) => {
|
|
9137
9137
|
const h = oe[f];
|
|
9138
9138
|
h && xt(h);
|
|
@@ -9140,7 +9140,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9140
9140
|
return;
|
|
9141
9141
|
}
|
|
9142
9142
|
try {
|
|
9143
|
-
const f = await fetch(`https://data.gki.com.ua/api-user/atu/${
|
|
9143
|
+
const f = await fetch(`https://data.gki.com.ua/api-user/atu/${s}`);
|
|
9144
9144
|
if (!f?.ok) return;
|
|
9145
9145
|
const S = (await f.json())?.geometry?.coordinates;
|
|
9146
9146
|
Array.isArray(S) && S.length && (Me.value = S);
|
|
@@ -9157,9 +9157,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9157
9157
|
{ immediate: !0 }
|
|
9158
9158
|
), ge(
|
|
9159
9159
|
() => J.value,
|
|
9160
|
-
(
|
|
9161
|
-
if (!Array.isArray(
|
|
9162
|
-
const f = [Number(
|
|
9160
|
+
(s) => {
|
|
9161
|
+
if (!Array.isArray(s) || s.length !== 2) return;
|
|
9162
|
+
const f = [Number(s[0]), Number(s[1])];
|
|
9163
9163
|
if (Xl(Z.value, f) || (Z.value = [...f], !E)) return;
|
|
9164
9164
|
const h = E.getCenter?.();
|
|
9165
9165
|
h && Xl([h.lng, h.lat], Z.value) || E.easeTo({ center: [Z.value[0], Z.value[1]] });
|
|
@@ -9167,20 +9167,20 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9167
9167
|
{ deep: !0 }
|
|
9168
9168
|
), ge(
|
|
9169
9169
|
() => pe.value,
|
|
9170
|
-
(
|
|
9171
|
-
typeof
|
|
9170
|
+
(s) => {
|
|
9171
|
+
typeof s == "number" && (Q.value = s, E && E.setZoom(s));
|
|
9172
9172
|
}
|
|
9173
9173
|
), ge(
|
|
9174
9174
|
() => _.value?.center,
|
|
9175
|
-
(
|
|
9176
|
-
|
|
9175
|
+
(s) => {
|
|
9176
|
+
s && T(s.lng, s.lat, E?.getZoom?.());
|
|
9177
9177
|
},
|
|
9178
9178
|
{ deep: !0 }
|
|
9179
|
-
), ge(
|
|
9180
|
-
|
|
9181
|
-
}), ge(x, (
|
|
9182
|
-
if (
|
|
9183
|
-
|
|
9179
|
+
), ge(r, (s) => {
|
|
9180
|
+
s && un();
|
|
9181
|
+
}), ge(x, (s) => {
|
|
9182
|
+
if (s > 0) {
|
|
9183
|
+
r.value || Rt();
|
|
9184
9184
|
return;
|
|
9185
9185
|
}
|
|
9186
9186
|
sn || un();
|
|
@@ -9188,8 +9188,8 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9188
9188
|
const ea = y(
|
|
9189
9189
|
() => w.value.length > 0 || !!_.value
|
|
9190
9190
|
), ml = y(() => {
|
|
9191
|
-
const
|
|
9192
|
-
return
|
|
9191
|
+
const s = w.value, f = s.length > 1;
|
|
9192
|
+
return s.length ? s.map((h) => ({
|
|
9193
9193
|
id: h.id,
|
|
9194
9194
|
label: f ? h.label : _.value?.type ? fl(_.value.type) : h.label,
|
|
9195
9195
|
interactive: f
|
|
@@ -9206,12 +9206,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9206
9206
|
E?.resize && E.resize();
|
|
9207
9207
|
}, 50);
|
|
9208
9208
|
}
|
|
9209
|
-
function vl(
|
|
9210
|
-
|
|
9209
|
+
function vl(s) {
|
|
9210
|
+
s.key === "Escape" && d.value && (d.value = !1);
|
|
9211
9211
|
}
|
|
9212
|
-
return ge(d, (
|
|
9213
|
-
typeof document < "u" && (document.body.style.overflow =
|
|
9214
|
-
}), ge(ea, ta), (
|
|
9212
|
+
return ge(d, (s) => {
|
|
9213
|
+
typeof document < "u" && (document.body.style.overflow = s ? "hidden" : ""), typeof window < "u" && (s ? window.addEventListener("keydown", vl) : window.removeEventListener("keydown", vl)), ta();
|
|
9214
|
+
}), ge(ea, ta), (s, f) => (u(), we(Kt, {
|
|
9215
9215
|
to: "body",
|
|
9216
9216
|
disabled: !d.value
|
|
9217
9217
|
}, [
|
|
@@ -9241,7 +9241,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9241
9241
|
type: "button",
|
|
9242
9242
|
class: "vs-map-action-btn",
|
|
9243
9243
|
onClick: bo,
|
|
9244
|
-
disabled:
|
|
9244
|
+
disabled: r.value
|
|
9245
9245
|
}, [
|
|
9246
9246
|
f[8] || (f[8] = nt(" Імпорт ", -1)),
|
|
9247
9247
|
Y(q(pn), {
|
|
@@ -9267,7 +9267,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9267
9267
|
type: "button",
|
|
9268
9268
|
class: "vs-map-action-btn",
|
|
9269
9269
|
onClick: Co,
|
|
9270
|
-
disabled:
|
|
9270
|
+
disabled: r.value || x.value === 0
|
|
9271
9271
|
}, " Експорт ", 8, Vp)) : K("", !0)
|
|
9272
9272
|
]),
|
|
9273
9273
|
c("input", {
|
|
@@ -9277,7 +9277,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9277
9277
|
onChange: So,
|
|
9278
9278
|
accept: ".json,.geojson",
|
|
9279
9279
|
class: "hidden",
|
|
9280
|
-
disabled:
|
|
9280
|
+
disabled: r.value
|
|
9281
9281
|
}, null, 40, Dp)
|
|
9282
9282
|
])) : K("", !0)
|
|
9283
9283
|
])) : K("", !0),
|
|
@@ -9304,7 +9304,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9304
9304
|
type: "button",
|
|
9305
9305
|
class: "px-3 py-2 rounded-md bg-blue-600 text-white text-sm hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
9306
9306
|
onClick: $o,
|
|
9307
|
-
disabled:
|
|
9307
|
+
disabled: r.value
|
|
9308
9308
|
}, " Побудувати ", 8, Tp)
|
|
9309
9309
|
])
|
|
9310
9310
|
]),
|
|
@@ -9318,7 +9318,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9318
9318
|
class: ie(["vs-btn", { "vs-active": b.value === "marker" }]),
|
|
9319
9319
|
title: "Точка",
|
|
9320
9320
|
onClick: f[2] || (f[2] = (h) => In("marker")),
|
|
9321
|
-
disabled:
|
|
9321
|
+
disabled: r.value
|
|
9322
9322
|
}, [
|
|
9323
9323
|
Y(q(Va), { class: "vs-btn-icon" })
|
|
9324
9324
|
], 10, Pp)) : K("", !0),
|
|
@@ -9327,7 +9327,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9327
9327
|
class: ie(["vs-btn", { "vs-active": b.value === "polyline" }]),
|
|
9328
9328
|
title: "Лінія",
|
|
9329
9329
|
onClick: f[3] || (f[3] = (h) => In("polyline")),
|
|
9330
|
-
disabled:
|
|
9330
|
+
disabled: r.value
|
|
9331
9331
|
}, [
|
|
9332
9332
|
Y(bd, { class: "vs-btn-icon" })
|
|
9333
9333
|
], 10, Op)) : K("", !0),
|
|
@@ -9336,7 +9336,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9336
9336
|
class: ie(["vs-btn", { "vs-active": b.value === "polygon" }]),
|
|
9337
9337
|
title: "Полігон",
|
|
9338
9338
|
onClick: f[4] || (f[4] = (h) => In("polygon")),
|
|
9339
|
-
disabled:
|
|
9339
|
+
disabled: r.value
|
|
9340
9340
|
}, [
|
|
9341
9341
|
Y($d, { class: "vs-btn-icon" })
|
|
9342
9342
|
], 10, Bp)) : K("", !0),
|
|
@@ -9345,7 +9345,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9345
9345
|
class: ie(["vs-btn", { "vs-active": b.value === "rectangle" }]),
|
|
9346
9346
|
title: "Прямокутник",
|
|
9347
9347
|
onClick: f[5] || (f[5] = (h) => In("rectangle")),
|
|
9348
|
-
disabled:
|
|
9348
|
+
disabled: r.value
|
|
9349
9349
|
}, [
|
|
9350
9350
|
Y(Md, { class: "vs-btn-icon" })
|
|
9351
9351
|
], 10, Rp)) : K("", !0)
|
|
@@ -9416,7 +9416,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9416
9416
|
"active-tile-overlay-keys": L.value,
|
|
9417
9417
|
"vector-overlays": me.value,
|
|
9418
9418
|
"preview-tile": G.value,
|
|
9419
|
-
disabled:
|
|
9419
|
+
disabled: r.value,
|
|
9420
9420
|
onOnLayerChange: lo,
|
|
9421
9421
|
onOnOverlayToggle: no,
|
|
9422
9422
|
onOnVectorOverlayToggle: gn
|
|
@@ -9436,7 +9436,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9436
9436
|
type: "button",
|
|
9437
9437
|
class: ie(["vs-map-status__chip", { "vs-map-status__chip--active": h.id === q(st) }]),
|
|
9438
9438
|
onClick: (I) => mo(h.id),
|
|
9439
|
-
disabled:
|
|
9439
|
+
disabled: r.value
|
|
9440
9440
|
}, de(h.label), 11, Zp)) : (u(), m("span", Jp, de(h.label), 1)),
|
|
9441
9441
|
S < ml.value.length - 1 ? (u(), m("span", Qp, ", ")) : K("", !0)
|
|
9442
9442
|
], 64))), 128)) : (u(), m("span", em, "—"))
|
|
@@ -9457,7 +9457,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9457
9457
|
class: "vs-status-btn vs-status-btn--zoom",
|
|
9458
9458
|
title: "Масштаб до об'єкта",
|
|
9459
9459
|
onClick: go,
|
|
9460
|
-
disabled:
|
|
9460
|
+
disabled: r.value
|
|
9461
9461
|
}, [
|
|
9462
9462
|
Y(q(Wo), { class: "vs-status-btn__icon" })
|
|
9463
9463
|
], 8, im),
|
|
@@ -9466,7 +9466,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9466
9466
|
class: "vs-status-btn vs-status-btn--delete",
|
|
9467
9467
|
title: "Видалити об'єкт",
|
|
9468
9468
|
onClick: vo,
|
|
9469
|
-
disabled:
|
|
9469
|
+
disabled: r.value
|
|
9470
9470
|
}, [
|
|
9471
9471
|
Y(q(on), { class: "vs-status-btn__icon" })
|
|
9472
9472
|
], 8, um)
|
|
@@ -9501,7 +9501,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9501
9501
|
setup(e, { emit: t }) {
|
|
9502
9502
|
const n = e, l = t;
|
|
9503
9503
|
ht(n.style);
|
|
9504
|
-
const a = D(null), o = D(null), i = D(null),
|
|
9504
|
+
const a = D(null), o = D(null), i = D(null), r = D(!1), d = D(""), p = Ke(e, "modelValue"), x = y(() => n.placeholder || "Add tag…"), b = y(() => p.value?.length === 0 && d.value === ""), _ = y(() => !n.disabled && p.value?.length > 0), w = y(() => n.disabled), g = async () => {
|
|
9505
9505
|
w.value || await et(() => i.value?.focus());
|
|
9506
9506
|
}, $ = (te) => {
|
|
9507
9507
|
const F = te.trim();
|
|
@@ -9515,9 +9515,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9515
9515
|
}, C = () => {
|
|
9516
9516
|
l("update:modelValue", []);
|
|
9517
9517
|
}, V = () => {
|
|
9518
|
-
w.value || (
|
|
9518
|
+
w.value || (r.value = !0);
|
|
9519
9519
|
}, A = () => {
|
|
9520
|
-
|
|
9520
|
+
r.value = !1, !w.value && v();
|
|
9521
9521
|
}, U = (te) => {
|
|
9522
9522
|
const { key: F } = te;
|
|
9523
9523
|
F === "Enter" ? (te.preventDefault(), v()) : F === "Backspace" && d.value === "" && p.value.length > 0 && M(p.value.length - 1);
|
|
@@ -9538,10 +9538,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9538
9538
|
class: ie([
|
|
9539
9539
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
9540
9540
|
"border-gray-300 hover:border-gray-400",
|
|
9541
|
-
|
|
9541
|
+
r.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
9542
9542
|
w.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
9543
9543
|
]),
|
|
9544
|
-
"data-focus":
|
|
9544
|
+
"data-focus": r.value ? "true" : "false",
|
|
9545
9545
|
onClick: g
|
|
9546
9546
|
}, [
|
|
9547
9547
|
c("div", {
|
|
@@ -9623,7 +9623,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9623
9623
|
setup(e) {
|
|
9624
9624
|
const t = ut("values"), n = e, l = Ke(e, "modelValue");
|
|
9625
9625
|
function a(i) {
|
|
9626
|
-
const
|
|
9626
|
+
const r = {
|
|
9627
9627
|
а: "a",
|
|
9628
9628
|
б: "b",
|
|
9629
9629
|
в: "v",
|
|
@@ -9662,18 +9662,18 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9662
9662
|
ї: "yi",
|
|
9663
9663
|
ґ: "g"
|
|
9664
9664
|
};
|
|
9665
|
-
return i.toLowerCase().split("").map((d) =>
|
|
9665
|
+
return i.toLowerCase().split("").map((d) => r[d] || d).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
9666
9666
|
}
|
|
9667
9667
|
const o = () => {
|
|
9668
|
-
const i = t?.value?.[n.parent || ""]?.toString(),
|
|
9669
|
-
l.value =
|
|
9668
|
+
const i = t?.value?.[n.parent || ""]?.toString(), r = a(i);
|
|
9669
|
+
l.value = r.toString();
|
|
9670
9670
|
};
|
|
9671
|
-
return (i,
|
|
9671
|
+
return (i, r) => (u(), m("div", Lm, [
|
|
9672
9672
|
Re(c("input", {
|
|
9673
9673
|
ref: "vsText",
|
|
9674
9674
|
disabled: e.disabled,
|
|
9675
9675
|
placeholder: e.placeholder,
|
|
9676
|
-
"onUpdate:modelValue":
|
|
9676
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => l.value = d),
|
|
9677
9677
|
class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
9678
9678
|
}, null, 8, Am), [
|
|
9679
9679
|
[at, l.value]
|
|
@@ -9711,7 +9711,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9711
9711
|
if (!o.value) return "";
|
|
9712
9712
|
const p = encodeURIComponent(String(t.table)), x = encodeURIComponent(String(t.code));
|
|
9713
9713
|
return `/api/code-gen/${p}/${x}`;
|
|
9714
|
-
},
|
|
9714
|
+
}, r = async () => {
|
|
9715
9715
|
if (!o.value || l.value) return;
|
|
9716
9716
|
const p = i();
|
|
9717
9717
|
if (p) {
|
|
@@ -9724,7 +9724,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9724
9724
|
}
|
|
9725
9725
|
}
|
|
9726
9726
|
}, d = () => {
|
|
9727
|
-
a.value && (n.value ||
|
|
9727
|
+
a.value && (n.value || r());
|
|
9728
9728
|
};
|
|
9729
9729
|
return lt(() => {
|
|
9730
9730
|
d();
|
|
@@ -9745,7 +9745,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9745
9745
|
c("button", {
|
|
9746
9746
|
class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
9747
9747
|
disabled: l.value || e.disabled || !o.value,
|
|
9748
|
-
onClick:
|
|
9748
|
+
onClick: r
|
|
9749
9749
|
}, [
|
|
9750
9750
|
l.value ? (u(), m("span", Pm, "...")) : (u(), m("span", Fm, "Gen"))
|
|
9751
9751
|
], 8, Em)
|
|
@@ -9770,10 +9770,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9770
9770
|
},
|
|
9771
9771
|
emits: ["update:modelValue"],
|
|
9772
9772
|
setup(e, { emit: t }) {
|
|
9773
|
-
const n = (v) => `${v}-${Math.random().toString(36).substring(2, 15)}`, l = ut("values"), a = e, o = t, i = a.addButtonText ?? "Додати",
|
|
9773
|
+
const n = (v) => `${v}-${Math.random().toString(36).substring(2, 15)}`, l = ut("values"), a = e, o = t, i = a.addButtonText ?? "Додати", r = a.ignore ?? [], d = D([]), p = D(null);
|
|
9774
9774
|
(() => {
|
|
9775
9775
|
const v = a.parent && l?.value?.[a.parent] || a.modelValue || {};
|
|
9776
|
-
d.value = Object.entries(v).filter(([M]) => !
|
|
9776
|
+
d.value = Object.entries(v).filter(([M]) => !r.includes(M)).map(([M, C]) => ({
|
|
9777
9777
|
id: n("key-value-"),
|
|
9778
9778
|
key: M,
|
|
9779
9779
|
value: C
|
|
@@ -9800,7 +9800,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9800
9800
|
V.key && V.value !== void 0 && (M[V.key] = V.value);
|
|
9801
9801
|
});
|
|
9802
9802
|
const C = {};
|
|
9803
|
-
|
|
9803
|
+
r.length && r.forEach((V) => {
|
|
9804
9804
|
C[V] = a.parent ? l?.value?.[a.parent]?.[V] : void 0;
|
|
9805
9805
|
}), l?.value && a.parent && (l.value[a.parent] = {
|
|
9806
9806
|
...C,
|
|
@@ -9878,7 +9878,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9878
9878
|
}),
|
|
9879
9879
|
emits: ["update:modelValue"],
|
|
9880
9880
|
setup(e) {
|
|
9881
|
-
const t = e, n = Ke(e, "modelValue"), l = D([]), a = D(null), o = y(() => !!t.disabled), i = y(() => t.placeholder ?? ""),
|
|
9881
|
+
const t = e, n = Ke(e, "modelValue"), l = D([]), a = D(null), o = y(() => !!t.disabled), i = y(() => t.placeholder ?? ""), r = y(() => t.addButtonText ?? "Додати");
|
|
9882
9882
|
let d = !1;
|
|
9883
9883
|
const p = (v) => `${v}-${Math.random().toString(36).substring(2, 15)}`, x = (v) => {
|
|
9884
9884
|
const M = v ?? n.value ?? [];
|
|
@@ -9987,7 +9987,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
9987
9987
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
9988
9988
|
}, [
|
|
9989
9989
|
Y(q(Ot), { class: "h-4 w-4" }),
|
|
9990
|
-
nt(" " + de(
|
|
9990
|
+
nt(" " + de(r.value), 1)
|
|
9991
9991
|
], 8, ov)
|
|
9992
9992
|
])
|
|
9993
9993
|
]));
|
|
@@ -10009,9 +10009,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10009
10009
|
setup(e, { emit: t }) {
|
|
10010
10010
|
const n = e, { inputClass: l } = ht(n.style), a = t, o = y({
|
|
10011
10011
|
get: () => n.modelValue || "#000000",
|
|
10012
|
-
set: (
|
|
10012
|
+
set: (r) => a("update:modelValue", r)
|
|
10013
10013
|
}), i = y(() => !!n.disabled);
|
|
10014
|
-
return (
|
|
10014
|
+
return (r, d) => (u(), m("div", iv, [
|
|
10015
10015
|
Re(c("input", {
|
|
10016
10016
|
type: "color",
|
|
10017
10017
|
"onUpdate:modelValue": d[0] || (d[0] = (p) => o.value = p),
|
|
@@ -10055,7 +10055,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10055
10055
|
}, i = y({
|
|
10056
10056
|
get: () => o(n.modelValue ?? n.min),
|
|
10057
10057
|
set: (x) => a("update:modelValue", o(x))
|
|
10058
|
-
}),
|
|
10058
|
+
}), r = (x) => {
|
|
10059
10059
|
const b = x.target, _ = o(b.value);
|
|
10060
10060
|
b.value = String(_), a("update:modelValue", _);
|
|
10061
10061
|
}, d = (x) => {
|
|
@@ -10081,7 +10081,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10081
10081
|
min: e.min,
|
|
10082
10082
|
max: e.max,
|
|
10083
10083
|
step: e.step,
|
|
10084
|
-
onInput:
|
|
10084
|
+
onInput: r,
|
|
10085
10085
|
onKeydown: d,
|
|
10086
10086
|
disabled: p.value
|
|
10087
10087
|
}, null, 40, mv)
|
|
@@ -10111,7 +10111,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10111
10111
|
}),
|
|
10112
10112
|
emits: ["update:modelValue"],
|
|
10113
10113
|
setup(e) {
|
|
10114
|
-
const t = e, n = D(t.count), l = y(() => t.limit), { inputClass: a } = ht(t.style), o = Ke(e, "modelValue"), i = y(() => !!t.disabled),
|
|
10114
|
+
const t = e, n = D(t.count), l = y(() => t.limit), { inputClass: a } = ht(t.style), o = Ke(e, "modelValue"), i = y(() => !!t.disabled), r = y(() => t.placeholder ?? "");
|
|
10115
10115
|
Al(() => {
|
|
10116
10116
|
const $ = o.value?.length ?? 0;
|
|
10117
10117
|
$ < n.value && (o.value = [
|
|
@@ -10212,7 +10212,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10212
10212
|
type: e.inputType,
|
|
10213
10213
|
value: o.value?.[M - 1],
|
|
10214
10214
|
onInput: (C) => _(C, M - 1),
|
|
10215
|
-
placeholder:
|
|
10215
|
+
placeholder: r.value,
|
|
10216
10216
|
disabled: i.value,
|
|
10217
10217
|
class: ie(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(a), { "!border-red-600": e.error }]]),
|
|
10218
10218
|
style: {
|
|
@@ -10273,7 +10273,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10273
10273
|
}),
|
|
10274
10274
|
emits: /* @__PURE__ */ ze(["change", "update:modelValue", "value-selected"], ["update:modelValue"]),
|
|
10275
10275
|
setup(e, { emit: t }) {
|
|
10276
|
-
const n = e, l = t, a = Ke(e, "modelValue"), o = D([]), i = D(n.options ?? []),
|
|
10276
|
+
const n = e, l = t, a = Ke(e, "modelValue"), o = D([]), i = D(n.options ?? []), r = D({}), d = D({}), p = D({ keyword: "", parent: null }), x = D(""), b = D(!1), _ = D(null), w = D(null), g = D(null), $ = D(null), v = D(null), M = D({});
|
|
10277
10277
|
let C = !1, V = !1;
|
|
10278
10278
|
const A = ut("values"), U = y(() => !!n.disabled), te = y(() => n.placeholder ?? "Оберіть значення"), F = y(() => n.search !== !1), j = y(() => {
|
|
10279
10279
|
const k = n.parent ?? n.parentValue;
|
|
@@ -10300,11 +10300,11 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10300
10300
|
}, Z = () => {
|
|
10301
10301
|
o.value.length && (C = !0, o.value = o.value.map((k) => ({
|
|
10302
10302
|
...k,
|
|
10303
|
-
text:
|
|
10303
|
+
text: r.value[P(k.id)] ?? k.text
|
|
10304
10304
|
})));
|
|
10305
10305
|
}, Q = (k) => {
|
|
10306
10306
|
const L = P(k.id), O = J(k);
|
|
10307
|
-
O && (
|
|
10307
|
+
O && (r.value[L] = O);
|
|
10308
10308
|
}, G = (k) => {
|
|
10309
10309
|
i.value = k ? [...k] : [], k?.forEach(Q), Z();
|
|
10310
10310
|
}, ke = (k) => {
|
|
@@ -10471,12 +10471,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10471
10471
|
}, qe = async () => {
|
|
10472
10472
|
const L = (Array.isArray(a.value) ? [...a.value] : []).filter((me) => me != null);
|
|
10473
10473
|
if (n.data && L.length) {
|
|
10474
|
-
const me = L.filter((De) => !
|
|
10474
|
+
const me = L.filter((De) => !r.value[P(De)]);
|
|
10475
10475
|
me.length && await T(me);
|
|
10476
10476
|
}
|
|
10477
10477
|
const O = L.map((me) => ({
|
|
10478
10478
|
id: me,
|
|
10479
|
-
text:
|
|
10479
|
+
text: r.value[P(me)] ?? String(me),
|
|
10480
10480
|
key: pe(me)
|
|
10481
10481
|
}));
|
|
10482
10482
|
C = !0, o.value = O;
|
|
@@ -10686,7 +10686,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10686
10686
|
}),
|
|
10687
10687
|
emits: /* @__PURE__ */ ze(["update:modelValue", "update:geom"], ["update:modelValue"]),
|
|
10688
10688
|
setup(e, { emit: t }) {
|
|
10689
|
-
const n = /{{\s*([^}]+?)\s*}}/g, l = e, a = t, { inputClass: o } = ht(l.style), i = Ke(e, "modelValue"),
|
|
10689
|
+
const n = /{{\s*([^}]+?)\s*}}/g, l = e, a = t, { inputClass: o } = ht(l.style), i = Ke(e, "modelValue"), r = y({
|
|
10690
10690
|
get: () => i.value,
|
|
10691
10691
|
set: (F) => {
|
|
10692
10692
|
i.value = F;
|
|
@@ -10719,10 +10719,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10719
10719
|
y(() => v.value ? "1" : "0");
|
|
10720
10720
|
const M = ut("values");
|
|
10721
10721
|
function C() {
|
|
10722
|
-
!w.value &&
|
|
10722
|
+
!w.value && r.value.trim() && V();
|
|
10723
10723
|
}
|
|
10724
10724
|
async function V() {
|
|
10725
|
-
const F = (
|
|
10725
|
+
const F = (r.value || "").trim();
|
|
10726
10726
|
if (!F) return;
|
|
10727
10727
|
let j = F;
|
|
10728
10728
|
if (l.includes?.length && M?.value) {
|
|
@@ -10766,14 +10766,14 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10766
10766
|
c("div", Fv, [
|
|
10767
10767
|
Re(c("input", {
|
|
10768
10768
|
type: "text",
|
|
10769
|
-
"onUpdate:modelValue": j[0] || (j[0] = (B) =>
|
|
10769
|
+
"onUpdate:modelValue": j[0] || (j[0] = (B) => r.value = B),
|
|
10770
10770
|
placeholder: _.value,
|
|
10771
10771
|
disabled: w.value,
|
|
10772
10772
|
class: ie(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500", [q(o), { "!border-red-600": l.error }]]),
|
|
10773
10773
|
style: { border: "1px solid #CFD9E0" },
|
|
10774
10774
|
onKeydown: Ao(Ee(C, ["prevent"]), ["enter"])
|
|
10775
10775
|
}, null, 42, Pv), [
|
|
10776
|
-
[at,
|
|
10776
|
+
[at, r.value]
|
|
10777
10777
|
]),
|
|
10778
10778
|
p.value.length ? (u(), m("button", {
|
|
10779
10779
|
key: 0,
|
|
@@ -10789,7 +10789,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10789
10789
|
type: "button",
|
|
10790
10790
|
onClick: V,
|
|
10791
10791
|
class: "flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px]",
|
|
10792
|
-
disabled: d.value || !
|
|
10792
|
+
disabled: d.value || !r.value?.trim()
|
|
10793
10793
|
}, [
|
|
10794
10794
|
d.value ? (u(), we(q(Ia), {
|
|
10795
10795
|
key: 1,
|
|
@@ -10854,7 +10854,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10854
10854
|
const t = e, n = Ke(e, "modelValue"), l = y(() => Array.isArray(n.value) ? n.value : []), a = D([]), o = y(() => t.schema?.map((v) => ({
|
|
10855
10855
|
...v,
|
|
10856
10856
|
disabled: t.disabled || v.disabled
|
|
10857
|
-
})) ?? []), i = y(() => o.value.map((v) => $(v))),
|
|
10857
|
+
})) ?? []), i = y(() => o.value.map((v) => $(v))), r = y(() => o.value.reduce((M, C) => {
|
|
10858
10858
|
const V = Number(C?.col ?? 12);
|
|
10859
10859
|
return M + (Number.isFinite(V) && V > 0 ? V : 12);
|
|
10860
10860
|
}, 0) > 12), d = y(() => t.disabled ? !1 : t.maxItems ? l.value.length < t.maxItems : !0), p = y(() => t.disabled || l.value.length <= (t.minItems || 0));
|
|
@@ -10892,7 +10892,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10892
10892
|
(u(!0), m(Ae, null, Be(l.value, (C, V) => (u(), m("div", {
|
|
10893
10893
|
key: a.value[V],
|
|
10894
10894
|
class: ie(["flex items-center gap-3 rounded-lg transition-colors", {
|
|
10895
|
-
"border border-gray-300 p-2":
|
|
10895
|
+
"border border-gray-300 p-2": r.value
|
|
10896
10896
|
}])
|
|
10897
10897
|
}, [
|
|
10898
10898
|
Y(qt, {
|
|
@@ -10957,7 +10957,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
10957
10957
|
}),
|
|
10958
10958
|
emits: ["update:modelValue"],
|
|
10959
10959
|
setup(e) {
|
|
10960
|
-
const t = e, n = Ke(e, "modelValue"), l = D([]), a = D([]), o = D(0), i = D(null),
|
|
10960
|
+
const t = e, n = Ke(e, "modelValue"), l = D([]), a = D([]), o = D(0), i = D(null), r = D(null), d = D(null), p = y(() => t.groupLabel ?? "Group"), x = y(() => t.emptyLabel ?? "Ще немає груп"), b = y(() => t.schema?.map((R) => ({
|
|
10961
10961
|
...R,
|
|
10962
10962
|
disabled: t.disabled || R.disabled
|
|
10963
10963
|
})) ?? []), _ = y(() => b.value.map((R) => B(R))), w = y(() => t.view === "accordion"), g = y(() => !!(t.collapsible || w.value)), $ = y(() => t.draggable !== !1), v = y(() => t.disabled ? !1 : t.maxGroups ? n.value.length < t.maxGroups : !0), M = y(() => t.disabled || n.value.length <= (t.minGroups || 0));
|
|
@@ -11022,7 +11022,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11022
11022
|
fe.preventDefault();
|
|
11023
11023
|
return;
|
|
11024
11024
|
}
|
|
11025
|
-
i.value = R,
|
|
11025
|
+
i.value = R, r.value = R, d.value = {
|
|
11026
11026
|
groups: JSON.parse(JSON.stringify(n.value)),
|
|
11027
11027
|
keys: [...l.value],
|
|
11028
11028
|
states: [...a.value]
|
|
@@ -11038,7 +11038,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11038
11038
|
!$.value || t.disabled || ne();
|
|
11039
11039
|
}
|
|
11040
11040
|
function Z() {
|
|
11041
|
-
d.value && G(), i.value = null,
|
|
11041
|
+
d.value && G(), i.value = null, r.value = null, d.value = null;
|
|
11042
11042
|
}
|
|
11043
11043
|
function Q(R, fe) {
|
|
11044
11044
|
const be = [...n.value], [se] = be.splice(R, 1);
|
|
@@ -11052,12 +11052,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11052
11052
|
}
|
|
11053
11053
|
}
|
|
11054
11054
|
function G() {
|
|
11055
|
-
d.value && (n.value = d.value.groups, l.value = d.value.keys, a.value = d.value.states, d.value = null,
|
|
11055
|
+
d.value && (n.value = d.value.groups, l.value = d.value.keys, a.value = d.value.states, d.value = null, r.value = null);
|
|
11056
11056
|
}
|
|
11057
11057
|
function ke(R, fe) {
|
|
11058
11058
|
if (i.value === null) return;
|
|
11059
11059
|
const be = ye(R, fe);
|
|
11060
|
-
|
|
11060
|
+
r.value = be, T(be);
|
|
11061
11061
|
}
|
|
11062
11062
|
function ye(R, fe) {
|
|
11063
11063
|
if (!fe?.currentTarget) return R;
|
|
@@ -11070,10 +11070,10 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11070
11070
|
let be = R;
|
|
11071
11071
|
if (be > n.value.length && (be = n.value.length), be === fe || be === fe + 1) return;
|
|
11072
11072
|
const se = be > fe ? be - 1 : be;
|
|
11073
|
-
Q(fe, se), i.value = se,
|
|
11073
|
+
Q(fe, se), i.value = se, r.value = be > fe ? se + 1 : se;
|
|
11074
11074
|
}
|
|
11075
11075
|
function ne() {
|
|
11076
|
-
d.value = null, i.value = null,
|
|
11076
|
+
d.value = null, i.value = null, r.value = null;
|
|
11077
11077
|
}
|
|
11078
11078
|
return (R, fe) => (u(), m("div", Zv, [
|
|
11079
11079
|
(u(!0), m(Ae, null, Be(n.value, (be, se) => (u(), m("div", {
|
|
@@ -11187,13 +11187,13 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11187
11187
|
emits: ["update:modelValue"],
|
|
11188
11188
|
setup(e, { expose: t }) {
|
|
11189
11189
|
const n = e, l = Ke(e, "modelValue"), a = D(null), o = y(() => typeof n.height == "number" ? `${n.height}px` : n.height || "280px");
|
|
11190
|
-
let i = null,
|
|
11190
|
+
let i = null, r = null, d = !1;
|
|
11191
11191
|
const p = () => {
|
|
11192
|
-
if (
|
|
11192
|
+
if (r) return Promise.resolve(r);
|
|
11193
11193
|
if (typeof window > "u") return Promise.resolve(null);
|
|
11194
11194
|
const g = window;
|
|
11195
11195
|
if (g.monaco?.editor?.create)
|
|
11196
|
-
return
|
|
11196
|
+
return r = g.monaco, Promise.resolve(r);
|
|
11197
11197
|
if (g[Hn]) return g[Hn];
|
|
11198
11198
|
const v = (async () => {
|
|
11199
11199
|
const M = (A) => {
|
|
@@ -11226,7 +11226,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11226
11226
|
}), window.require(
|
|
11227
11227
|
["vs/editor/editor.main"],
|
|
11228
11228
|
() => {
|
|
11229
|
-
|
|
11229
|
+
r = window.monaco, g.monaco = r, A(r);
|
|
11230
11230
|
},
|
|
11231
11231
|
(te) => U(te)
|
|
11232
11232
|
);
|
|
@@ -11238,7 +11238,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11238
11238
|
});
|
|
11239
11239
|
return g[Hn] = v, v;
|
|
11240
11240
|
}, x = () => {
|
|
11241
|
-
!a.value || !
|
|
11241
|
+
!a.value || !r || (i && (i.dispose(), i = null), i = r.editor.create(a.value, {
|
|
11242
11242
|
value: l.value || "",
|
|
11243
11243
|
language: n.syntax,
|
|
11244
11244
|
theme: n.theme,
|
|
@@ -11250,7 +11250,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11250
11250
|
}));
|
|
11251
11251
|
}, b = () => {
|
|
11252
11252
|
i?.focus();
|
|
11253
|
-
}, _ = () => i, w = () =>
|
|
11253
|
+
}, _ = () => i, w = () => r;
|
|
11254
11254
|
return ge(
|
|
11255
11255
|
() => l.value,
|
|
11256
11256
|
(g) => {
|
|
@@ -11261,12 +11261,12 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11261
11261
|
), ge(
|
|
11262
11262
|
() => n.syntax,
|
|
11263
11263
|
(g) => {
|
|
11264
|
-
!i || !
|
|
11264
|
+
!i || !r || r.editor.setModelLanguage(i.getModel(), g || "xml");
|
|
11265
11265
|
}
|
|
11266
11266
|
), ge(
|
|
11267
11267
|
() => n.theme,
|
|
11268
11268
|
(g) => {
|
|
11269
|
-
|
|
11269
|
+
r && r.editor.setTheme(g || "vs-light");
|
|
11270
11270
|
}
|
|
11271
11271
|
), ge(
|
|
11272
11272
|
() => n.disabled,
|
|
@@ -11282,7 +11282,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11282
11282
|
try {
|
|
11283
11283
|
const g = await p();
|
|
11284
11284
|
if (!g || !g.editor) return;
|
|
11285
|
-
|
|
11285
|
+
r = g, x();
|
|
11286
11286
|
} catch (g) {
|
|
11287
11287
|
console.error("Failed to load Monaco editor", g);
|
|
11288
11288
|
}
|
|
@@ -11364,24 +11364,38 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11364
11364
|
},
|
|
11365
11365
|
setup(e) {
|
|
11366
11366
|
const t = e, n = ut("values");
|
|
11367
|
-
|
|
11367
|
+
function l(o, i) {
|
|
11368
|
+
const r = i?.result || i?.message || i?.error || i?.detail;
|
|
11369
|
+
return o.status === 400 && typeof r == "string" && r.trim().toLowerCase() === "not found" ? "Дані не знайдено." : o.status === 500 ? "Помилка на сервері." : typeof r == "string" && r.trim() ? r : "При спробі завантажити дані виникла помилка.";
|
|
11370
|
+
}
|
|
11371
|
+
async function a() {
|
|
11368
11372
|
try {
|
|
11369
11373
|
if (!t.api) return;
|
|
11370
|
-
const
|
|
11371
|
-
if (!
|
|
11372
|
-
|
|
11374
|
+
const o = t.api.replace("{{value}}", t.value), i = await fetch(o);
|
|
11375
|
+
if (!i.ok) {
|
|
11376
|
+
let d = null;
|
|
11377
|
+
try {
|
|
11378
|
+
d = await i.json();
|
|
11379
|
+
} catch {
|
|
11380
|
+
try {
|
|
11381
|
+
d = await i.text();
|
|
11382
|
+
} catch {
|
|
11383
|
+
d = null;
|
|
11384
|
+
}
|
|
11385
|
+
}
|
|
11386
|
+
Te({ type: "warning", title: "Validation", message: l(i, d) });
|
|
11373
11387
|
return;
|
|
11374
11388
|
}
|
|
11375
|
-
const
|
|
11389
|
+
const r = await i.json();
|
|
11376
11390
|
if (!t.set || !n) return;
|
|
11377
|
-
for (const [
|
|
11378
|
-
n.value[
|
|
11379
|
-
} catch (
|
|
11380
|
-
console.error(t.error,
|
|
11391
|
+
for (const [d, p] of Object.entries(t.set))
|
|
11392
|
+
n.value[d] = r.result[p];
|
|
11393
|
+
} catch (o) {
|
|
11394
|
+
console.error(t.error, o);
|
|
11381
11395
|
}
|
|
11382
11396
|
}
|
|
11383
|
-
return (
|
|
11384
|
-
onClick:
|
|
11397
|
+
return (o, i) => (u(), m("button", {
|
|
11398
|
+
onClick: a,
|
|
11385
11399
|
class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
|
|
11386
11400
|
}, de(e.button), 1));
|
|
11387
11401
|
}
|
|
@@ -11400,9 +11414,9 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11400
11414
|
}),
|
|
11401
11415
|
emits: /* @__PURE__ */ ze(["value-selected"], ["update:modelValue"]),
|
|
11402
11416
|
setup(e, { emit: t }) {
|
|
11403
|
-
const n = e, l = Ke(e, "modelValue"), a = t, o = y(() => br[`${n.layout}`]), i = ["label", "placeholder", "info", "description", "text", "html"],
|
|
11417
|
+
const n = e, l = Ke(e, "modelValue"), a = t, o = y(() => br[`${n.layout}`]), i = ["label", "placeholder", "info", "description", "text", "html"], r = D(pe()), d = y(() => B(n.item, r.value)), p = y(() => {
|
|
11404
11418
|
const X = { ...d.value ?? {} }, ee = n.item?.name;
|
|
11405
|
-
return ee && b?.value?.[ee] && Object.assign(X, b.value[ee]), X.__locale =
|
|
11419
|
+
return ee && b?.value?.[ee] && Object.assign(X, b.value[ee]), X.__locale = r.value, X;
|
|
11406
11420
|
}), x = y(() => cg?.[`vs-input-${n.item.type}`]), b = ut("field-props"), _ = y(() => {
|
|
11407
11421
|
const X = q(x);
|
|
11408
11422
|
if (!X) return /* @__PURE__ */ new Set();
|
|
@@ -11518,7 +11532,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11518
11532
|
}
|
|
11519
11533
|
}
|
|
11520
11534
|
lt(() => {
|
|
11521
|
-
|
|
11535
|
+
r.value = pe(), window.addEventListener("storage", _e);
|
|
11522
11536
|
}), fn(() => {
|
|
11523
11537
|
window.removeEventListener("storage", _e);
|
|
11524
11538
|
});
|
|
@@ -11554,7 +11568,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11554
11568
|
return typeof window > "u" ? "uk" : localStorage.getItem("locale") || "uk";
|
|
11555
11569
|
}
|
|
11556
11570
|
function _e() {
|
|
11557
|
-
|
|
11571
|
+
r.value = pe();
|
|
11558
11572
|
}
|
|
11559
11573
|
return (X, ee) => (u(), we($t(o.value), {
|
|
11560
11574
|
ua: p.value.ua,
|
|
@@ -11616,7 +11630,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11616
11630
|
width: { default: 400 }
|
|
11617
11631
|
},
|
|
11618
11632
|
setup(e, { expose: t }) {
|
|
11619
|
-
const n = e, l = D([]), a = D(""), o = D(""), i = y(() => !!n.enabled),
|
|
11633
|
+
const n = e, l = D([]), a = D(""), o = D(""), i = y(() => !!n.enabled), r = y(() => [
|
|
11620
11634
|
"vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
|
|
11621
11635
|
"sticky top-0 self-start shrink-0",
|
|
11622
11636
|
"max-h-full min-h-0 overflow-y-auto"
|
|
@@ -11735,7 +11749,7 @@ const _p = { class: "vs-map-body" }, Sp = {
|
|
|
11735
11749
|
}
|
|
11736
11750
|
return t({ refresh: C }), (J, pe) => i.value && l.value.length ? (u(), m("div", {
|
|
11737
11751
|
key: 0,
|
|
11738
|
-
class: ie(
|
|
11752
|
+
class: ie(r.value),
|
|
11739
11753
|
style: Oe(d.value)
|
|
11740
11754
|
}, [
|
|
11741
11755
|
c("h2", hg, de(e.title), 1),
|
|
@@ -11860,8 +11874,8 @@ function Sl(e, t = !1) {
|
|
|
11860
11874
|
return e.forEach((a) => {
|
|
11861
11875
|
const o = { ...a };
|
|
11862
11876
|
if (o.name = (a.name || a.id || a.key || "").toString(), o.type = wa(a.type), o.label = a.label || a.ua, o.rules = a.rules || a.validators, o.type === "email" && !o.rules && (o.rules = ["email"]), o.type === "tel" && !o.rules) {
|
|
11863
|
-
const i = o.mask || Wt,
|
|
11864
|
-
o.rules = [{ type: "tel", digits:
|
|
11877
|
+
const i = o.mask || Wt, r = Zt(i) || Zt(Wt);
|
|
11878
|
+
o.rules = [{ type: "tel", digits: r }];
|
|
11865
11879
|
}
|
|
11866
11880
|
a.data && (o.api = `/api/suggest/${a.data}`), o.disabled = o.disabled ?? t, Array.isArray(o.schema) && (o.schema = Sl(o.schema, o.disabled)), l.push(o);
|
|
11867
11881
|
}), l;
|
|
@@ -11907,14 +11921,14 @@ function Eg(e, t, n = !1) {
|
|
|
11907
11921
|
}), C && V ? a.value[b.name] = V : delete a.value[b.name];
|
|
11908
11922
|
}
|
|
11909
11923
|
b.schema && i(b.schema, !1);
|
|
11910
|
-
}), x && Object.values(a.value).some(Boolean) ? a.value : null),
|
|
11924
|
+
}), x && Object.values(a.value).some(Boolean) ? a.value : null), r = y(() => l.value?.filter((p) => p.hidden !== !0 && o(p)));
|
|
11911
11925
|
return {
|
|
11912
11926
|
errors: a,
|
|
11913
11927
|
validate: i,
|
|
11914
11928
|
reset: () => {
|
|
11915
11929
|
e.value = {}, a.value = {};
|
|
11916
11930
|
},
|
|
11917
|
-
visibleSchema:
|
|
11931
|
+
visibleSchema: r
|
|
11918
11932
|
};
|
|
11919
11933
|
}
|
|
11920
11934
|
const Fg = { class: "flex w-full h-full min-h-0 gap-6" }, Pg = {
|
|
@@ -11945,10 +11959,10 @@ const Fg = { class: "flex w-full h-full min-h-0 gap-6" }, Pg = {
|
|
|
11945
11959
|
}),
|
|
11946
11960
|
emits: /* @__PURE__ */ ze(["handle-submit", "update:modelValue", "value-selected"], ["update:form", "update:modelValue", "update:values"]),
|
|
11947
11961
|
setup(e, { expose: t, emit: n }) {
|
|
11948
|
-
const l = n, a = e, o = y(() => !!a.formId || a.allowIdField), i = Ke(e, "form"),
|
|
11949
|
-
get: () => d.value ??
|
|
11962
|
+
const l = n, a = e, o = y(() => !!a.formId || a.allowIdField), i = Ke(e, "form"), r = Ke(e, "modelValue"), d = Ke(e, "values"), p = y({
|
|
11963
|
+
get: () => d.value ?? r.value,
|
|
11950
11964
|
set: (Z) => {
|
|
11951
|
-
|
|
11965
|
+
r.value = Z, d.value = Z;
|
|
11952
11966
|
}
|
|
11953
11967
|
}), {
|
|
11954
11968
|
errors: x,
|
|
@@ -12063,7 +12077,7 @@ const Fg = { class: "flex w-full h-full min-h-0 gap-6" }, Pg = {
|
|
|
12063
12077
|
},
|
|
12064
12078
|
emits: ["close", "save", "edit"],
|
|
12065
12079
|
setup(e, { emit: t }) {
|
|
12066
|
-
const n = e, l = t, a = D(n.schema), o = D(n.defaultValue ? JSON.parse(JSON.stringify(n.defaultValue)) : {}), i = D({}),
|
|
12080
|
+
const n = e, l = t, a = D(n.schema), o = D(n.defaultValue ? JSON.parse(JSON.stringify(n.defaultValue)) : {}), i = D({}), r = D(n.token || ""), d = D(n.token || ""), p = D(n.mode), x = () => {
|
|
12067
12081
|
const v = n.method?.trim().toUpperCase();
|
|
12068
12082
|
return v === "GET" || v === "POST" || v === "PUT" ? v : p.value === "add" ? "POST" : "PUT";
|
|
12069
12083
|
}, b = () => {
|
|
@@ -12139,9 +12153,9 @@ const Fg = { class: "flex w-full h-full min-h-0 gap-6" }, Pg = {
|
|
|
12139
12153
|
}
|
|
12140
12154
|
return;
|
|
12141
12155
|
}
|
|
12142
|
-
if (
|
|
12156
|
+
if (r.value)
|
|
12143
12157
|
try {
|
|
12144
|
-
const C = await fetch(`/api/table/${
|
|
12158
|
+
const C = await fetch(`/api/table/${r.value}`, {
|
|
12145
12159
|
method: p.value === "add" ? "POST" : "PUT",
|
|
12146
12160
|
headers: {
|
|
12147
12161
|
"Content-Type": "application/json"
|
|
@@ -12175,10 +12189,10 @@ const Fg = { class: "flex w-full h-full min-h-0 gap-6" }, Pg = {
|
|
|
12175
12189
|
return;
|
|
12176
12190
|
}
|
|
12177
12191
|
const M = await v.json();
|
|
12178
|
-
a.value = M.schema, M.id && (d.value = M.id), M.token && (
|
|
12192
|
+
a.value = M.schema, M.id && (d.value = M.id), M.token && (r.value = M.token, d.value || (d.value = M.token));
|
|
12179
12193
|
} else if (n.token && !n.defaultValue) {
|
|
12180
|
-
|
|
12181
|
-
const v = await fetch(`/api/form/${
|
|
12194
|
+
r.value = n.token;
|
|
12195
|
+
const v = await fetch(`/api/form/${r.value}`);
|
|
12182
12196
|
if (!v.ok) {
|
|
12183
12197
|
Te({
|
|
12184
12198
|
type: v.status >= 400 && v.status < 500 ? "warning" : "error",
|