@opengis/form 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1298,16 +1298,16 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1298
1298
|
options: n.options
|
|
1299
1299
|
},
|
|
1300
1300
|
formValues: a
|
|
1301
|
-
}), c = y(() => i.value), p = (
|
|
1301
|
+
}), c = y(() => i.value), p = (C) => C?.value || C?.id || C?.text || C, _ = y(() => n.slot ?? n?.optionTemplate ?? ""), $ = y(() => ol(_.value)), b = (C) => sl(C, _.value), w = (C) => il(C, _.value), m = (C) => `lg:col-span-${C || 12}`, x = y(() => [
|
|
1302
1302
|
n.position === "vertical" ? "flex flex-col" : "",
|
|
1303
1303
|
n.colSpan ? "grid" : "flex justify-start"
|
|
1304
|
-
]), h = (
|
|
1304
|
+
]), h = (C) => C == null || C === "" ? null : typeof C == "string" || typeof C == "number" ? C : String(C), S = y(() => {
|
|
1305
1305
|
if (!n.group)
|
|
1306
1306
|
return [];
|
|
1307
|
-
const
|
|
1307
|
+
const C = /* @__PURE__ */ new Map();
|
|
1308
1308
|
c.value.forEach((R) => {
|
|
1309
1309
|
const T = R[n.group], N = h(T);
|
|
1310
|
-
|
|
1310
|
+
C.has(N) || C.set(N, []), C.get(N)?.push(R);
|
|
1311
1311
|
});
|
|
1312
1312
|
const I = [];
|
|
1313
1313
|
n.values?.length && n.values.forEach((R) => {
|
|
@@ -1315,7 +1315,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1315
1315
|
I.push(T);
|
|
1316
1316
|
});
|
|
1317
1317
|
const D = /* @__PURE__ */ new Set(), q = (R) => {
|
|
1318
|
-
const T =
|
|
1318
|
+
const T = C.get(R) || [];
|
|
1319
1319
|
if (!T.length)
|
|
1320
1320
|
return null;
|
|
1321
1321
|
const N = R === null ? "group-null" : `group-${String(R)}`, F = R === null ? Cs : String(R);
|
|
@@ -1328,7 +1328,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1328
1328
|
return I.forEach((R) => {
|
|
1329
1329
|
const T = q(R);
|
|
1330
1330
|
T && G.push(T);
|
|
1331
|
-
}),
|
|
1331
|
+
}), C.forEach((R, T) => {
|
|
1332
1332
|
if (D.has(T))
|
|
1333
1333
|
return;
|
|
1334
1334
|
const N = q(T);
|
|
@@ -1337,12 +1337,12 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1337
1337
|
});
|
|
1338
1338
|
return ge(
|
|
1339
1339
|
() => n.modelValue,
|
|
1340
|
-
(
|
|
1341
|
-
if (typeof
|
|
1340
|
+
(C) => {
|
|
1341
|
+
if (typeof C == "boolean" && c.value.length === 1) {
|
|
1342
1342
|
const I = p(c.value[0]);
|
|
1343
|
-
o[I] =
|
|
1344
|
-
} else if (Array.isArray(
|
|
1345
|
-
const I = new Set(
|
|
1343
|
+
o[I] = C;
|
|
1344
|
+
} else if (Array.isArray(C)) {
|
|
1345
|
+
const I = new Set(C);
|
|
1346
1346
|
c.value.forEach((D) => {
|
|
1347
1347
|
if (!D.disabled) {
|
|
1348
1348
|
const q = p(D);
|
|
@@ -1359,24 +1359,24 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1359
1359
|
l("update:modelValue", null);
|
|
1360
1360
|
return;
|
|
1361
1361
|
}
|
|
1362
|
-
const
|
|
1363
|
-
l("update:modelValue",
|
|
1362
|
+
const C = Object.entries(o).filter(([, I]) => I).map(([I]) => I);
|
|
1363
|
+
l("update:modelValue", C.length === 0 ? [] : C);
|
|
1364
1364
|
},
|
|
1365
1365
|
{ deep: !0 }
|
|
1366
1366
|
), rt(async () => {
|
|
1367
1367
|
if (await s(), typeof n.modelValue == "boolean" && c.value.length === 1) {
|
|
1368
|
-
const
|
|
1369
|
-
o[
|
|
1368
|
+
const C = p(c.value[0]);
|
|
1369
|
+
o[C] = n.modelValue;
|
|
1370
1370
|
} else if (Array.isArray(n.modelValue)) {
|
|
1371
|
-
const
|
|
1371
|
+
const C = new Set(n.modelValue);
|
|
1372
1372
|
c.value.forEach((I) => {
|
|
1373
1373
|
if (!I.disabled) {
|
|
1374
1374
|
const D = p(I);
|
|
1375
|
-
o[D] =
|
|
1375
|
+
o[D] = C.has(D);
|
|
1376
1376
|
}
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
|
-
}), (
|
|
1379
|
+
}), (C, I) => n.group ? (u(), v("div", $s, [
|
|
1380
1380
|
(u(!0), v(Le, null, Be(S.value, (D) => (u(), v("div", {
|
|
1381
1381
|
key: D.key,
|
|
1382
1382
|
class: "flex flex-col gap-2"
|
|
@@ -1389,7 +1389,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1389
1389
|
modelValue: o[p(q)],
|
|
1390
1390
|
"onUpdate:modelValue": (G) => o[p(q)] = G,
|
|
1391
1391
|
value: p(q),
|
|
1392
|
-
class: se(m(
|
|
1392
|
+
class: se(m(C.colSpan)),
|
|
1393
1393
|
disabled: n.disabled || q.disabled,
|
|
1394
1394
|
label: w(q),
|
|
1395
1395
|
labelHtml: $.value ? b(q) : "",
|
|
@@ -1397,7 +1397,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1397
1397
|
icon: q?.icon,
|
|
1398
1398
|
imgUrl: q?.imgUrl,
|
|
1399
1399
|
option: q,
|
|
1400
|
-
view:
|
|
1400
|
+
view: C.view
|
|
1401
1401
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "labelHtml", "icon", "imgUrl", "option", "view"]))), 128))
|
|
1402
1402
|
], 2)
|
|
1403
1403
|
]))), 128))
|
|
@@ -1409,7 +1409,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1409
1409
|
modelValue: o[p(D)],
|
|
1410
1410
|
"onUpdate:modelValue": (q) => o[p(D)] = q,
|
|
1411
1411
|
value: p(D),
|
|
1412
|
-
class: se(m(
|
|
1412
|
+
class: se(m(C.colSpan)),
|
|
1413
1413
|
disabled: n.disabled || D.disabled,
|
|
1414
1414
|
label: w(D),
|
|
1415
1415
|
labelHtml: $.value ? b(D) : "",
|
|
@@ -1417,7 +1417,7 @@ const as = { class: "relative w-full bg-white rounded-lg" }, os = { class: "abso
|
|
|
1417
1417
|
icon: D?.icon,
|
|
1418
1418
|
imgUrl: D?.imgUrl,
|
|
1419
1419
|
option: D,
|
|
1420
|
-
view:
|
|
1420
|
+
view: C.view
|
|
1421
1421
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "labelHtml", "icon", "imgUrl", "option", "view"]))), 128))
|
|
1422
1422
|
], 2));
|
|
1423
1423
|
}
|
|
@@ -2012,23 +2012,23 @@ const ui = /* @__PURE__ */ Ze(si, [["render", ii]]), di = be({
|
|
|
2012
2012
|
const h = e.weekStartsOn, S = s.value;
|
|
2013
2013
|
if (S)
|
|
2014
2014
|
return Array.from({ length: 7 }).map((I, D) => S[(h + D) % 7]);
|
|
2015
|
-
const
|
|
2016
|
-
return Array.from(Array(7)).map((I, D) => (h + D) % 7).map((I) => Ns(/* @__PURE__ */ new Date(), I, e.weekStartsOn)).map(
|
|
2017
|
-
}), p = (h, S,
|
|
2015
|
+
const C = n.value(e.weekdayFormat);
|
|
2016
|
+
return Array.from(Array(7)).map((I, D) => (h + D) % 7).map((I) => Ns(/* @__PURE__ */ new Date(), I, e.weekStartsOn)).map(C);
|
|
2017
|
+
}), p = (h, S, C, I) => I?.dates?.some((D) => Zn(h, D)) || I?.predicate?.(h) ? !1 : !S && !C ? !0 : !(S && An(h, dn(S)) || C && Vn(h, Tn(C))), _ = y(() => {
|
|
2018
2018
|
const h = /* @__PURE__ */ new Date(), S = n.value(e.format);
|
|
2019
2019
|
return Ps(i.value).map(
|
|
2020
|
-
(
|
|
2021
|
-
value:
|
|
2022
|
-
display: S(
|
|
2023
|
-
selected: !!e.selected && Zn(e.selected,
|
|
2024
|
-
current: Zn(h,
|
|
2025
|
-
disabled: !e.allowOutsideInterval && !zs(
|
|
2026
|
-
|
|
2020
|
+
(C) => ({
|
|
2021
|
+
value: C,
|
|
2022
|
+
display: S(C),
|
|
2023
|
+
selected: !!e.selected && Zn(e.selected, C),
|
|
2024
|
+
current: Zn(h, C),
|
|
2025
|
+
disabled: !e.allowOutsideInterval && !zs(C, a.value) || !p(
|
|
2026
|
+
C,
|
|
2027
2027
|
e.lowerLimit,
|
|
2028
2028
|
e.upperLimit,
|
|
2029
2029
|
e.disabledDates
|
|
2030
2030
|
),
|
|
2031
|
-
key: n.value("yyyy-MM-dd")(
|
|
2031
|
+
key: n.value("yyyy-MM-dd")(C)
|
|
2032
2032
|
})
|
|
2033
2033
|
);
|
|
2034
2034
|
}), $ = y(() => n.value(e.headingFormat)(e.pageDate)), b = y(
|
|
@@ -2436,18 +2436,18 @@ const Ci = /* @__PURE__ */ Ze(fi, [["render", Si]]), jn = ["time", "day", "month
|
|
|
2436
2436
|
x = ie;
|
|
2437
2437
|
}
|
|
2438
2438
|
return x;
|
|
2439
|
-
},
|
|
2439
|
+
}, C = () => {
|
|
2440
2440
|
m && m.value !== $.value && (m.value = $.value ?? "");
|
|
2441
2441
|
}, I = (ie) => {
|
|
2442
2442
|
const ue = ie && ht(ie) ? Sn(ie, e.inputFormat) : "";
|
|
2443
|
-
$.value !== ue && ($.value = ue),
|
|
2443
|
+
$.value !== ue && ($.value = ue), C();
|
|
2444
2444
|
}, D = async () => {
|
|
2445
2445
|
if (h(), !a.value || !w.value) return;
|
|
2446
2446
|
m = (await S())(a.value, {
|
|
2447
2447
|
mask: w.value,
|
|
2448
2448
|
lazy: !0,
|
|
2449
2449
|
overwrite: !1
|
|
2450
|
-
}),
|
|
2450
|
+
}), C();
|
|
2451
2451
|
};
|
|
2452
2452
|
ge(
|
|
2453
2453
|
() => e.modelValue,
|
|
@@ -2835,7 +2835,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
2835
2835
|
}
|
|
2836
2836
|
return "";
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function C(E) {
|
|
2839
2839
|
return E ? E.replaceAll("dd", "__DAY2__").replaceAll("d", "__DAY1__").replaceAll("mm", "__MONTH2__").replaceAll("m", "__MONTH1__").replaceAll("yy", "__YEAR2__").replaceAll("y", "__YEAR1__").replaceAll("__DAY2__", "dd").replaceAll("__DAY1__", "d").replaceAll("__MONTH2__", "MM").replaceAll("__MONTH1__", "M").replaceAll("__YEAR2__", "yy").replaceAll("__YEAR1__", "yyyy") : "";
|
|
2840
2840
|
}
|
|
2841
2841
|
const I = y(() => {
|
|
@@ -2843,7 +2843,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
2843
2843
|
if (i.value === "time") return E;
|
|
2844
2844
|
const ee = n.dateFormat || S();
|
|
2845
2845
|
if (!ee) return E;
|
|
2846
|
-
const O =
|
|
2846
|
+
const O = C(ee);
|
|
2847
2847
|
return O ? i.value === "datetime" ? `${O} HH:mm` : O : E;
|
|
2848
2848
|
});
|
|
2849
2849
|
function D(E, ee) {
|
|
@@ -3246,7 +3246,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3246
3246
|
ge(i, (G) => {
|
|
3247
3247
|
p && (p.value = G);
|
|
3248
3248
|
}, { immediate: !0 });
|
|
3249
|
-
const S = y(() => s.value.filter((G) => G.status !== "done")),
|
|
3249
|
+
const S = y(() => s.value.filter((G) => G.status !== "done")), C = y(() => S.value[0] || null), I = (G) => typeof G == "string" ? G : G?.file_path || "", D = (G, R) => ({
|
|
3250
3250
|
key: `${Date.now()}-${R}-${G.name}`,
|
|
3251
3251
|
file: G,
|
|
3252
3252
|
size: G.size,
|
|
@@ -3345,20 +3345,20 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3345
3345
|
title: "Добавить файлы",
|
|
3346
3346
|
onClick: x
|
|
3347
3347
|
}, null, 8, ["disabled"])
|
|
3348
|
-
], 64)) : !n.multiple && !
|
|
3348
|
+
], 64)) : !n.multiple && !C.value ? (u(), xe(Vt, {
|
|
3349
3349
|
key: 2,
|
|
3350
3350
|
action: "",
|
|
3351
3351
|
"is-uploading": !1,
|
|
3352
3352
|
disabled: G.disabled || i.value,
|
|
3353
3353
|
title: "Обновить файл",
|
|
3354
3354
|
onClick: x
|
|
3355
|
-
}, null, 8, ["disabled"])) :
|
|
3355
|
+
}, null, 8, ["disabled"])) : C.value ? (u(), xe(Vt, {
|
|
3356
3356
|
key: 3,
|
|
3357
3357
|
action: "",
|
|
3358
3358
|
"is-uploading": !0,
|
|
3359
3359
|
disabled: !0,
|
|
3360
|
-
"progress-percent":
|
|
3361
|
-
title:
|
|
3360
|
+
"progress-percent": C.value.progressPercent,
|
|
3361
|
+
title: C.value.file.name
|
|
3362
3362
|
}, null, 8, ["progress-percent", "title"])) : K("", !0)
|
|
3363
3363
|
]));
|
|
3364
3364
|
}
|
|
@@ -3400,7 +3400,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3400
3400
|
return Math.min(100, Math.round(F / N * 100));
|
|
3401
3401
|
}), S = () => {
|
|
3402
3402
|
t.disabled || o.value || w.value.ok && l.value?.click();
|
|
3403
|
-
},
|
|
3403
|
+
}, C = async (T, N) => {
|
|
3404
3404
|
const F = N || G(T, 0);
|
|
3405
3405
|
try {
|
|
3406
3406
|
F.status = "uploading";
|
|
@@ -3472,7 +3472,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3472
3472
|
try {
|
|
3473
3473
|
o.value = !0, a.value = "", i.value = X.map((ne, le) => G(ne, le));
|
|
3474
3474
|
const _e = (await Promise.allSettled(
|
|
3475
|
-
i.value.map((ne) =>
|
|
3475
|
+
i.value.map((ne) => C(ne.file, ne))
|
|
3476
3476
|
)).filter((ne) => ne.status === "fulfilled").map((ne) => ne.value).filter((ne) => !!ne), J = i.value.filter((ne) => ne.status === "error").map((ne) => ne.file.name);
|
|
3477
3477
|
if (_e.length === 0) {
|
|
3478
3478
|
a.value = "Не вдалося завантажити файл";
|
|
@@ -3756,7 +3756,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3756
3756
|
}), I.updateListOnConfirm && (D.confirm = async () => {
|
|
3757
3757
|
await I.confirm(), c.value = !1, x();
|
|
3758
3758
|
}), D;
|
|
3759
|
-
},
|
|
3759
|
+
}, C = (I) => {
|
|
3760
3760
|
p.value = S(I), c.value = !0;
|
|
3761
3761
|
};
|
|
3762
3762
|
return ge(o, (I) => {
|
|
@@ -3810,7 +3810,7 @@ const Ei = /* @__PURE__ */ Ze(Li, [["render", Fi]]), Pi = /* @__PURE__ */ be({
|
|
|
3810
3810
|
item: R,
|
|
3811
3811
|
index: T,
|
|
3812
3812
|
onUpdate: D[2] || (D[2] = (N) => I.$emit("update", "file-list")),
|
|
3813
|
-
onOpenModal: D[3] || (D[3] = (N) =>
|
|
3813
|
+
onOpenModal: D[3] || (D[3] = (N) => C(N)),
|
|
3814
3814
|
onOpenLightbox: D[4] || (D[4] = (N) => m(N))
|
|
3815
3815
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
3816
3816
|
w.value.length ? K("", !0) : (u(), v("div", Au, D[8] || (D[8] = [
|
|
@@ -4077,16 +4077,16 @@ const nd = /* @__PURE__ */ be({
|
|
|
4077
4077
|
method: "POST",
|
|
4078
4078
|
headers: { "Content-Type": "application/json" },
|
|
4079
4079
|
body: JSON.stringify(s.value)
|
|
4080
|
-
}),
|
|
4080
|
+
}), C = await S.json().catch(() => ({})), I = C?.error || C?.message, D = Number(C?.code) >= 400;
|
|
4081
4081
|
if (!S.ok || D) {
|
|
4082
4082
|
Ie({
|
|
4083
4083
|
title: "Помилка",
|
|
4084
4084
|
type: "error",
|
|
4085
|
-
message: I || `Код помилки: ${
|
|
4085
|
+
message: I || `Код помилки: ${C?.code || S.status}`
|
|
4086
4086
|
});
|
|
4087
4087
|
return;
|
|
4088
4088
|
}
|
|
4089
|
-
const q =
|
|
4089
|
+
const q = C?.rows?.[0], G = C?.[b.value] ?? C?.id ?? q?.[b.value] ?? q?.id;
|
|
4090
4090
|
if (!G) {
|
|
4091
4091
|
Ie({
|
|
4092
4092
|
title: "Помилка",
|
|
@@ -4455,10 +4455,10 @@ const nd = /* @__PURE__ */ be({
|
|
|
4455
4455
|
set: (j) => l("update:modelValue", j)
|
|
4456
4456
|
});
|
|
4457
4457
|
!s.value && n.defaultValue && (s.value = n.defaultValue);
|
|
4458
|
-
const c = A(null), p = A(null), _ = A(null), $ = A(null), b = A(!1), w = A(!1), m = A(null), x = A(-1), h = A([]), S = A(""),
|
|
4458
|
+
const c = A(null), p = A(null), _ = A(null), $ = A(null), b = A(!1), w = A(!1), m = A(null), x = A(-1), h = A([]), S = A(""), C = A(null), I = (j) => {
|
|
4459
4459
|
p.value = j;
|
|
4460
4460
|
}, D = (j) => {
|
|
4461
|
-
|
|
4461
|
+
C.value = j;
|
|
4462
4462
|
}, q = (j) => {
|
|
4463
4463
|
$.value = j;
|
|
4464
4464
|
}, G = (j) => {
|
|
@@ -4592,11 +4592,11 @@ const nd = /* @__PURE__ */ be({
|
|
|
4592
4592
|
a.value || (b.value = !0, await Qe(() => {
|
|
4593
4593
|
De();
|
|
4594
4594
|
}), await Ge(), await Qe(() => {
|
|
4595
|
-
De(),
|
|
4595
|
+
De(), C.value?.focus();
|
|
4596
4596
|
}), te());
|
|
4597
4597
|
}, he = () => {
|
|
4598
4598
|
b.value = !1, x.value = -1, Qe(() => {
|
|
4599
|
-
|
|
4599
|
+
C.value?.blur();
|
|
4600
4600
|
});
|
|
4601
4601
|
}, Ce = async (j) => {
|
|
4602
4602
|
if (a.value) return;
|
|
@@ -4611,10 +4611,10 @@ const nd = /* @__PURE__ */ be({
|
|
|
4611
4611
|
}
|
|
4612
4612
|
}, qe = () => {
|
|
4613
4613
|
o.value ? (N.value = [], s.value = [], l("change", []), z(null, [])) : (m.value = null, s.value = null, l("change", null), z(null, null)), Te(null), Me(null), S.value = "", he(), Qe(() => {
|
|
4614
|
-
|
|
4614
|
+
C.value?.focus();
|
|
4615
4615
|
});
|
|
4616
4616
|
}, Ye = (j) => {
|
|
4617
|
-
o.value && (N.value = N.value.filter((ae) => ae?.toString() !== j?.toString()), s.value = [...N.value], l("change", s.value), z(null), Qe(() =>
|
|
4617
|
+
o.value && (N.value = N.value.filter((ae) => ae?.toString() !== j?.toString()), s.value = [...N.value], l("change", s.value), z(null), Qe(() => C.value?.focus()));
|
|
4618
4618
|
}, z = (j, ae) => {
|
|
4619
4619
|
const $e = ae ?? (o.value ? [...N.value] : j?.id ?? null);
|
|
4620
4620
|
l("value-selected", {
|
|
@@ -4624,7 +4624,7 @@ const nd = /* @__PURE__ */ be({
|
|
|
4624
4624
|
});
|
|
4625
4625
|
}, k = (j, ae = "manual") => {
|
|
4626
4626
|
o.value ? (J(j.id) || (N.value = [...N.value, j.id], s.value = [...N.value], l("change", s.value), z(j)), S.value = "", Qe(() => {
|
|
4627
|
-
|
|
4627
|
+
C.value?.focus(), x.value = Math.min(x.value, ne.value.length - 1);
|
|
4628
4628
|
}), Te(null)) : (m.value = j, s.value = j.id, l("change", s.value), z(j), S.value = "", he(), Te(j), ae === "parent-auto" && Me({
|
|
4629
4629
|
source: ae,
|
|
4630
4630
|
parentField: n.parent ?? null,
|
|
@@ -4685,7 +4685,7 @@ const nd = /* @__PURE__ */ be({
|
|
|
4685
4685
|
else if (ae === "Enter") {
|
|
4686
4686
|
j.preventDefault();
|
|
4687
4687
|
const $e = ne.value[x.value];
|
|
4688
|
-
$e && k($e),
|
|
4688
|
+
$e && k($e), C.value?.blur();
|
|
4689
4689
|
} else ae === "Escape" ? (j.preventDefault(), he()) : ae === "Backspace" ? o.value && S.value === "" && N.value.length && (N.value = N.value.slice(0, -1), s.value = [...N.value], l("change", s.value)) : ae === "Home" ? (x.value = 0, P(h.value[0], _.value)) : ae === "End" ? (x.value = ne.value.length - 1, P(h.value[x.value], _.value)) : ae === "Tab" && he();
|
|
4690
4690
|
}, ut = () => {
|
|
4691
4691
|
a.value || (w.value = !0);
|
|
@@ -4929,7 +4929,7 @@ const nd = /* @__PURE__ */ be({
|
|
|
4929
4929
|
set: (re) => l("update:modelValue", re)
|
|
4930
4930
|
});
|
|
4931
4931
|
o.value == null && n.defaultValue != null && (o.value = n.defaultValue);
|
|
4932
|
-
const a = ot("values"), i = ot("field-props"), s = y(() => !!n.disabled), c = A(null), p = A(!1), _ = A(null), $ = A(null), b = A(null), w = A({}), m = `vs-input-inline-select-${Wl()}`, x = y(() => n.placeholder || "Оберіть значення"), h = y(() => q(c.value) || n.placeholder || "Оберіть значення"), S = y(() => n.slot ?? ""),
|
|
4932
|
+
const a = ot("values"), i = ot("field-props"), s = y(() => !!n.disabled), c = A(null), p = A(!1), _ = A(null), $ = A(null), b = A(null), w = A({}), m = `vs-input-inline-select-${Wl()}`, x = y(() => n.placeholder || "Оберіть значення"), h = y(() => q(c.value) || n.placeholder || "Оберіть значення"), S = y(() => n.slot ?? ""), C = y(() => ol(S.value)), I = y(() => n.teleport || "body"), D = /^#(?:[\da-fA-F]{3}|[\da-fA-F]{6}|[\da-fA-F]{8})$/, q = (re) => il(re, S.value), G = (re) => !!(!C.value && ln(re)), R = y(() => {
|
|
4933
4933
|
const re = ln(c.value).trim();
|
|
4934
4934
|
return re ? D.test(re) ? `bg-[${re}] border-[${re}]` : `bg-${re.toLowerCase()}-500 border-${re.toLowerCase()}-500` : "";
|
|
4935
4935
|
}), {
|
|
@@ -5157,7 +5157,7 @@ const nd = /* @__PURE__ */ be({
|
|
|
5157
5157
|
}),
|
|
5158
5158
|
emits: ["update:modelValue"],
|
|
5159
5159
|
setup(e) {
|
|
5160
|
-
const t = Oo(() => import("./vs-richtext-
|
|
5160
|
+
const t = Oo(() => import("./vs-richtext-BEkrhE3S.js")), n = e, l = Ke(e, "modelValue"), o = y(() => !!n.disabled), a = y(() => n.placeholder ?? ""), i = y(() => ({
|
|
5161
5161
|
height: n.richtextProps.height || "300px",
|
|
5162
5162
|
format: n.format,
|
|
5163
5163
|
...n.richtextProps
|
|
@@ -5253,7 +5253,7 @@ const Jd = /* @__PURE__ */ Ze(Gd, [["render", Zd]]), Qd = { class: "bg-white rou
|
|
|
5253
5253
|
const Re = Number.parseInt(Ce, 10);
|
|
5254
5254
|
return Number.isNaN(Re) ? null : Re;
|
|
5255
5255
|
}
|
|
5256
|
-
function
|
|
5256
|
+
function C(B, te) {
|
|
5257
5257
|
h(B) && (B.preventDefault(), B.currentTarget.setPointerCapture(B.pointerId), w.value = te, m.value = te);
|
|
5258
5258
|
}
|
|
5259
5259
|
function I(B) {
|
|
@@ -5537,7 +5537,7 @@ const Jd = /* @__PURE__ */ Ze(Gd, [["render", Zd]]), Qd = { class: "bg-white rou
|
|
|
5537
5537
|
}, [
|
|
5538
5538
|
d("td", {
|
|
5539
5539
|
class: "px-4 py-3 text-center align-middle touch-none select-none",
|
|
5540
|
-
onPointerdown: (Ce) =>
|
|
5540
|
+
onPointerdown: (Ce) => C(Ce, he),
|
|
5541
5541
|
onPointermove: I,
|
|
5542
5542
|
onPointerup: D,
|
|
5543
5543
|
onPointercancel: q
|
|
@@ -5753,7 +5753,7 @@ const Hc = ["title", "aria-expanded"], Wc = ["src"], qc = { class: "map-layers__
|
|
|
5753
5753
|
setup(e, { emit: t }) {
|
|
5754
5754
|
const n = e, l = t, o = 10 * Un, a = 400 * Un, i = 400 * Un, s = 320 * Un, c = A(null), p = A(null), _ = A(null), $ = A(!1), b = A({}), w = y(() => Object.keys(n.basemaps || {}).length > 0), m = y(() => Object.keys(n.tileOverlays || {}).length > 0), x = y(() => n.vectorOverlays ?? []), h = y(() => x.value.length > 0), S = y(
|
|
5755
5755
|
() => w.value || m.value || h.value
|
|
5756
|
-
),
|
|
5756
|
+
), C = y(() => n.basemaps?.[n.activeBaseKey]?.name || n.activeBaseKey || "Шари"), I = y(() => q(n.basemaps)), D = y(() => q(n.tileOverlays || {}));
|
|
5757
5757
|
function q(Y) {
|
|
5758
5758
|
const ye = n.previewTile;
|
|
5759
5759
|
return ye ? Object.fromEntries(
|
|
@@ -5829,7 +5829,7 @@ const Hc = ["title", "aria-expanded"], Wc = ["src"], qc = { class: "map-layers__
|
|
|
5829
5829
|
ref: p,
|
|
5830
5830
|
type: "button",
|
|
5831
5831
|
class: "map-layers__trigger",
|
|
5832
|
-
title:
|
|
5832
|
+
title: C.value,
|
|
5833
5833
|
"aria-haspopup": "dialog",
|
|
5834
5834
|
"aria-expanded": $.value,
|
|
5835
5835
|
onClick: Fe(X, ["stop"])
|
|
@@ -6204,7 +6204,7 @@ const hp = ["title"], bp = {
|
|
|
6204
6204
|
ge(w, (z) => {
|
|
6205
6205
|
z.includes(x.value) || (x.value = z[0]);
|
|
6206
6206
|
});
|
|
6207
|
-
const h = A(""), S = A(!1),
|
|
6207
|
+
const h = A(""), S = A(!1), C = A(null), I = A(null), D = A(null), q = A(null), G = A([]), R = A(null), T = A(!1), N = A([]), F = y(
|
|
6208
6208
|
() => (x.value === "address" || x.value === "nominatim") && T.value
|
|
6209
6209
|
), X = y(() => l.config?.addressDebounceMs ?? 1e3);
|
|
6210
6210
|
let me = null;
|
|
@@ -6271,7 +6271,7 @@ const hp = ["title"], bp = {
|
|
|
6271
6271
|
});
|
|
6272
6272
|
function ve(z) {
|
|
6273
6273
|
const k = [];
|
|
6274
|
-
I.value && k.push(I.value), z instanceof HTMLElement && k.push(z),
|
|
6274
|
+
I.value && k.push(I.value), z instanceof HTMLElement && k.push(z), C.value?.querySelectorAll("li")?.forEach((P) => {
|
|
6275
6275
|
k.push(P);
|
|
6276
6276
|
}), k.forEach((P) => {
|
|
6277
6277
|
P.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
|
|
@@ -6289,7 +6289,7 @@ const hp = ["title"], bp = {
|
|
|
6289
6289
|
function Te(z) {
|
|
6290
6290
|
const k = z.target;
|
|
6291
6291
|
if (S.value) {
|
|
6292
|
-
const V =
|
|
6292
|
+
const V = C.value;
|
|
6293
6293
|
V && !V.contains(k) && (ve(k), S.value = !1);
|
|
6294
6294
|
}
|
|
6295
6295
|
if (F.value) {
|
|
@@ -6549,7 +6549,7 @@ const hp = ["title"], bp = {
|
|
|
6549
6549
|
w.value.length > 1 ? (u(), v("div", {
|
|
6550
6550
|
key: 0,
|
|
6551
6551
|
ref_key: "dropdownRef",
|
|
6552
|
-
ref:
|
|
6552
|
+
ref: C,
|
|
6553
6553
|
class: "relative search-type w-[100px]"
|
|
6554
6554
|
}, [
|
|
6555
6555
|
d("button", {
|
|
@@ -6954,7 +6954,7 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6954
6954
|
], a = () => {
|
|
6955
6955
|
n.value = !n.value;
|
|
6956
6956
|
}, i = (m, x) => {
|
|
6957
|
-
const h = (N) => N * Math.PI / 180, S = h(x.lat - m.lat),
|
|
6957
|
+
const h = (N) => N * Math.PI / 180, S = h(x.lat - m.lat), C = h(x.lng - m.lng), I = h(m.lat), D = h(x.lat), q = Math.sin(S / 2), G = Math.sin(C / 2);
|
|
6958
6958
|
return 6371e3 * (2 * Math.asin(
|
|
6959
6959
|
Math.sqrt(
|
|
6960
6960
|
q * q + Math.cos(I) * Math.cos(D) * G * G
|
|
@@ -6976,12 +6976,12 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6976
6976
|
const q = (I - x) * 110574;
|
|
6977
6977
|
return { x: (D - h) * 111320 * Math.cos(x * Math.PI / 180), y: q };
|
|
6978
6978
|
};
|
|
6979
|
-
let
|
|
6979
|
+
let C = 0;
|
|
6980
6980
|
for (let I = 0; I < m.length; I++) {
|
|
6981
6981
|
const D = (I + 1) % m.length, q = S(m[I].lat, m[I].lng), G = S(m[D].lat, m[D].lng);
|
|
6982
|
-
|
|
6982
|
+
C += q.x * G.y - q.y * G.x;
|
|
6983
6983
|
}
|
|
6984
|
-
return Math.abs(
|
|
6984
|
+
return Math.abs(C) * 0.5;
|
|
6985
6985
|
}
|
|
6986
6986
|
const _ = y(() => {
|
|
6987
6987
|
if (!t.isShapeClosed || t.points.length < 3) return 0;
|
|
@@ -7039,7 +7039,7 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7039
7039
|
S === o.length - 1 && "rounded-r-md",
|
|
7040
7040
|
l.value === h.id ? "bg-white text-green-600 font-semibold shadow-sm" : "text-gray-600 hover:bg-gray-50"
|
|
7041
7041
|
]),
|
|
7042
|
-
onClick: Fe((
|
|
7042
|
+
onClick: Fe((C) => l.value = h.id, ["stop"])
|
|
7043
7043
|
}, de(h.label), 11, Qp)), 64))
|
|
7044
7044
|
])
|
|
7045
7045
|
]),
|
|
@@ -7067,8 +7067,8 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7067
7067
|
id: h.id,
|
|
7068
7068
|
index: S + 1,
|
|
7069
7069
|
coords: h.coords,
|
|
7070
|
-
onUpdate: x[0] || (x[0] = (
|
|
7071
|
-
onDelete: (
|
|
7070
|
+
onUpdate: x[0] || (x[0] = (C) => m.$emit("update-point", C)),
|
|
7071
|
+
onDelete: (C) => m.$emit("delete-point", h.id)
|
|
7072
7072
|
}, null, 8, ["id", "index", "coords", "onDelete"]))), 128))
|
|
7073
7073
|
])) : K("", !0)
|
|
7074
7074
|
]));
|
|
@@ -7186,7 +7186,7 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7186
7186
|
_e[me] = { id: F, coords: { ...X } }, o.value = _e, w();
|
|
7187
7187
|
}, S = (F) => {
|
|
7188
7188
|
o.value = o.value.filter((X) => X.id !== F), w();
|
|
7189
|
-
},
|
|
7189
|
+
}, C = () => {
|
|
7190
7190
|
o.value = [], s.value && (s.value = !1, l("shape-closed-change", !1)), w();
|
|
7191
7191
|
}, I = (F) => {
|
|
7192
7192
|
h(F);
|
|
@@ -7201,11 +7201,11 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7201
7201
|
}, T = () => {
|
|
7202
7202
|
_.value && (s.value = !0, l("complete"), l("shape-closed-change", !0));
|
|
7203
7203
|
}, N = () => {
|
|
7204
|
-
|
|
7204
|
+
C(), i.value = !1, l("close");
|
|
7205
7205
|
};
|
|
7206
7206
|
return t({
|
|
7207
7207
|
addPoint: x,
|
|
7208
|
-
clearPoints:
|
|
7208
|
+
clearPoints: C
|
|
7209
7209
|
}), (F, X) => (u(), v("div", yf, [
|
|
7210
7210
|
d("div", hf, [
|
|
7211
7211
|
d("div", bf, [
|
|
@@ -7282,7 +7282,7 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7282
7282
|
})) : K("", !0),
|
|
7283
7283
|
a.value ? (u(), xe(Bp, {
|
|
7284
7284
|
key: 1,
|
|
7285
|
-
onClick:
|
|
7285
|
+
onClick: C
|
|
7286
7286
|
})) : K("", !0)
|
|
7287
7287
|
])
|
|
7288
7288
|
])
|
|
@@ -7298,10 +7298,10 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7298
7298
|
},
|
|
7299
7299
|
setup(e) {
|
|
7300
7300
|
function t(m, x) {
|
|
7301
|
-
const h = (G) => G * Math.PI / 180, S = h(x.lat - m.lat),
|
|
7301
|
+
const h = (G) => G * Math.PI / 180, S = h(x.lat - m.lat), C = h(x.lng - m.lng), I = h(m.lat), D = h(x.lat);
|
|
7302
7302
|
return 6371e3 * (2 * Math.asin(
|
|
7303
7303
|
Math.sqrt(
|
|
7304
|
-
Math.sin(S / 2) ** 2 + Math.cos(I) * Math.cos(D) * Math.sin(
|
|
7304
|
+
Math.sin(S / 2) ** 2 + Math.cos(I) * Math.cos(D) * Math.sin(C / 2) ** 2
|
|
7305
7305
|
)
|
|
7306
7306
|
));
|
|
7307
7307
|
}
|
|
@@ -7313,15 +7313,15 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7313
7313
|
return { type: "FeatureCollection", features: [] };
|
|
7314
7314
|
}
|
|
7315
7315
|
function a(m, x, h) {
|
|
7316
|
-
const S = h ?? "general",
|
|
7316
|
+
const S = h ?? "general", C = [];
|
|
7317
7317
|
let I = 0;
|
|
7318
|
-
|
|
7318
|
+
C.push(0);
|
|
7319
7319
|
for (let D = 1; D < m.length; D++)
|
|
7320
|
-
I += t(m[D - 1].coords, m[D].coords),
|
|
7320
|
+
I += t(m[D - 1].coords, m[D].coords), C.push(I);
|
|
7321
7321
|
return x && m.length >= 2 && (I += t(m[m.length - 1].coords, m[0].coords)), {
|
|
7322
7322
|
type: "FeatureCollection",
|
|
7323
7323
|
features: m.map((D, q) => {
|
|
7324
|
-
const G = S === "general" ? q === 0 ? "0" : n(
|
|
7324
|
+
const G = S === "general" ? q === 0 ? "0" : n(C[q]) : q === 0 ? "0" : n(
|
|
7325
7325
|
t(m[q - 1].coords, m[q].coords)
|
|
7326
7326
|
);
|
|
7327
7327
|
return {
|
|
@@ -7339,9 +7339,9 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7339
7339
|
if (m.length < 2) return o();
|
|
7340
7340
|
const h = [];
|
|
7341
7341
|
for (let S = 0; S < m.length; S++) {
|
|
7342
|
-
const
|
|
7343
|
-
if (
|
|
7344
|
-
const I = m[S].coords, D = m[
|
|
7342
|
+
const C = S === m.length - 1 && x ? 0 : S + 1;
|
|
7343
|
+
if (C >= m.length) break;
|
|
7344
|
+
const I = m[S].coords, D = m[C].coords, q = t(I, D);
|
|
7345
7345
|
h.push({
|
|
7346
7346
|
type: "Feature",
|
|
7347
7347
|
geometry: {
|
|
@@ -7467,10 +7467,10 @@ const jp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7467
7467
|
}
|
|
7468
7468
|
function b(m) {
|
|
7469
7469
|
if (!m) return;
|
|
7470
|
-
const x = m.getSource(_t), h = m.getSource(qt), S = m.getSource(Kt),
|
|
7470
|
+
const x = m.getSource(_t), h = m.getSource(qt), S = m.getSource(Kt), C = m.getSource(Yt), I = l.points, D = l.labelMode ?? "general";
|
|
7471
7471
|
x && x.setData(
|
|
7472
7472
|
a(I, l.isShapeClosed, D)
|
|
7473
|
-
), h && h.setData(s(I, l.isShapeClosed)), S && S.setData(c(I)),
|
|
7473
|
+
), h && h.setData(s(I, l.isShapeClosed)), S && S.setData(c(I)), C && C.setData(
|
|
7474
7474
|
D === "topoint" ? i(I, l.isShapeClosed) : o()
|
|
7475
7475
|
);
|
|
7476
7476
|
}
|
|
@@ -7648,7 +7648,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7648
7648
|
emits: ["update:modelValue", "valueSelected"],
|
|
7649
7649
|
setup(e, { emit: t }) {
|
|
7650
7650
|
const n = e, l = t, o = Aa(), a = ot("values", A({})), i = typeof document < "u" && document.querySelector("#modal") ? "#modal" : "body", s = y(() => {
|
|
7651
|
-
const r = o?.multiple, f = o?.multi, g = (
|
|
7651
|
+
const r = o?.multiple, f = o?.multi, g = (M) => M === "" || M === !0 || M === "true" || M === 1 || M === "1";
|
|
7652
7652
|
return !!n.multi || !!n.multiple || g(f) || g(r);
|
|
7653
7653
|
}), c = y(() => !!n.disabled), p = A(!1), _ = A(null), $ = A(0), b = A(""), w = A(null), m = A([]), x = A(null), h = A(null), S = Af({
|
|
7654
7654
|
onActivate() {
|
|
@@ -7662,7 +7662,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7662
7662
|
onDeactivate() {
|
|
7663
7663
|
}
|
|
7664
7664
|
});
|
|
7665
|
-
function
|
|
7665
|
+
function C() {
|
|
7666
7666
|
S.toggleRuler();
|
|
7667
7667
|
}
|
|
7668
7668
|
const I = nl(), D = I?.appContext?.config?.globalProperties?.$settings ?? {}, q = D?.map ?? {}, G = y(() => {
|
|
@@ -7692,10 +7692,10 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7692
7692
|
const W = g.coordinates, ce = Number(W[0]), ke = Number(W[1]);
|
|
7693
7693
|
if (Number.isFinite(ce) && Number.isFinite(ke)) return [ce, ke];
|
|
7694
7694
|
}
|
|
7695
|
-
const
|
|
7695
|
+
const M = Number(f.lat), L = Number(
|
|
7696
7696
|
f.lng ?? f.lon
|
|
7697
7697
|
);
|
|
7698
|
-
if (Number.isFinite(
|
|
7698
|
+
if (Number.isFinite(M) && Number.isFinite(L)) return [L, M];
|
|
7699
7699
|
}
|
|
7700
7700
|
}
|
|
7701
7701
|
}
|
|
@@ -7723,8 +7723,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7723
7723
|
}
|
|
7724
7724
|
function ee(r, f, g) {
|
|
7725
7725
|
if (!Number.isFinite(r) || !Number.isFinite(f)) return;
|
|
7726
|
-
const
|
|
7727
|
-
L && L.z ===
|
|
7726
|
+
const M = jc(r, f, E(g)), L = ye.value;
|
|
7727
|
+
L && L.z === M.z && L.x === M.x && L.y === M.y || (ye.value = M);
|
|
7728
7728
|
}
|
|
7729
7729
|
function O() {
|
|
7730
7730
|
if (H) {
|
|
@@ -7749,11 +7749,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7749
7749
|
encoding: "UTF-8",
|
|
7750
7750
|
file: ""
|
|
7751
7751
|
}), Ve = y(() => {
|
|
7752
|
-
const r = a.value ?? {}, f = r.id ?? o.id ?? "1", g = o.form ?? r.form ?? "form",
|
|
7752
|
+
const r = a.value ?? {}, f = r.id ?? o.id ?? "1", g = o.form ?? r.form ?? "form", M = o.table ?? r.table ?? "table", L = n.name ?? o.field ?? "geom";
|
|
7753
7753
|
return `/file/upload/temp?${new URLSearchParams({
|
|
7754
7754
|
id: String(f),
|
|
7755
7755
|
form: String(g),
|
|
7756
|
-
table: String(
|
|
7756
|
+
table: String(M),
|
|
7757
7757
|
field: String(L)
|
|
7758
7758
|
}).toString()}`;
|
|
7759
7759
|
}), Pe = y(() => ({
|
|
@@ -7864,21 +7864,21 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7864
7864
|
const f = typeof r == "string" ? r.trim() : "";
|
|
7865
7865
|
if (!f) return "";
|
|
7866
7866
|
if (/^https?:\/\//i.test(f)) return f;
|
|
7867
|
-
const g = window?.location?.origin ?? "",
|
|
7868
|
-
return
|
|
7867
|
+
const g = window?.location?.origin ?? "", M = f.replace(/^\/+/, "");
|
|
7868
|
+
return M ? g ? `${g}/${M}` : `/${M}` : g;
|
|
7869
7869
|
}
|
|
7870
7870
|
function P() {
|
|
7871
7871
|
const r = Array.isArray(q.basemaps) && q.basemaps.length ? q.basemaps : D.basemaps;
|
|
7872
7872
|
if (Array.isArray(r) && r.length) {
|
|
7873
|
-
const g = r.map((
|
|
7874
|
-
const W = String(
|
|
7873
|
+
const g = r.map((M, L) => {
|
|
7874
|
+
const W = String(M?.key ?? M?.id ?? M?.name ?? `b${L}`), ce = V(String(M?.url ?? ""));
|
|
7875
7875
|
if (!ce) return null;
|
|
7876
|
-
const ke = typeof
|
|
7877
|
-
return [W, { ...
|
|
7876
|
+
const ke = typeof M?.preview == "string" && M.preview ? V(M.preview) : "";
|
|
7877
|
+
return [W, { ...M, url: ce, preview: ke }];
|
|
7878
7878
|
}).filter(
|
|
7879
|
-
(
|
|
7879
|
+
(M) => Array.isArray(M) && M.length === 2
|
|
7880
7880
|
).reduce(
|
|
7881
|
-
(
|
|
7881
|
+
(M, [L, W]) => (M[L] = W, M),
|
|
7882
7882
|
{}
|
|
7883
7883
|
);
|
|
7884
7884
|
if (Object.keys(g).length) return g;
|
|
@@ -7904,15 +7904,15 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
7904
7904
|
const fe = P(), De = Object.keys(fe), Je = A(De.length ? De[0] : "");
|
|
7905
7905
|
function Xe() {
|
|
7906
7906
|
const r = Array.isArray(q.overlays) && q.overlays.length ? q.overlays : D.overlays;
|
|
7907
|
-
return !Array.isArray(r) || !r.length ? {} : r.map((g,
|
|
7908
|
-
const W = (typeof g?.name == "string" ? g.name.trim() : "") || `o${
|
|
7907
|
+
return !Array.isArray(r) || !r.length ? {} : r.map((g, M) => {
|
|
7908
|
+
const W = (typeof g?.name == "string" ? g.name.trim() : "") || `o${M}`, ce = V(String(g?.url ?? ""));
|
|
7909
7909
|
if (!ce) return null;
|
|
7910
7910
|
const ke = typeof g?.preview == "string" && g.preview ? V(g.preview) : "";
|
|
7911
7911
|
return [W, { ...g, name: W, url: ce, preview: ke }];
|
|
7912
7912
|
}).filter(
|
|
7913
7913
|
(g) => Array.isArray(g) && g.length === 2
|
|
7914
7914
|
).reduce(
|
|
7915
|
-
(g, [
|
|
7915
|
+
(g, [M, L]) => (g[M] = L, g),
|
|
7916
7916
|
{}
|
|
7917
7917
|
);
|
|
7918
7918
|
}
|
|
@@ -8003,14 +8003,14 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8003
8003
|
},
|
|
8004
8004
|
onMouseMove(r, f) {
|
|
8005
8005
|
if (!r.startPoint) return;
|
|
8006
|
-
const [g,
|
|
8006
|
+
const [g, M] = r.startPoint, L = f.lngLat.lng, W = f.lngLat.lat;
|
|
8007
8007
|
r.rectangle.setCoordinates([
|
|
8008
8008
|
[
|
|
8009
|
-
[g,
|
|
8010
|
-
[L,
|
|
8009
|
+
[g, M],
|
|
8010
|
+
[L, M],
|
|
8011
8011
|
[L, W],
|
|
8012
8012
|
[g, W],
|
|
8013
|
-
[g,
|
|
8013
|
+
[g, M]
|
|
8014
8014
|
]
|
|
8015
8015
|
]);
|
|
8016
8016
|
},
|
|
@@ -8027,14 +8027,14 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8027
8027
|
]);
|
|
8028
8028
|
return;
|
|
8029
8029
|
}
|
|
8030
|
-
const [g,
|
|
8031
|
-
return Math.abs(g - L) > 0 && Math.abs(
|
|
8030
|
+
const [g, M] = r.startPoint, L = f.lngLat.lng, W = f.lngLat.lat;
|
|
8031
|
+
return Math.abs(g - L) > 0 && Math.abs(M - W) > 0 ? (r.rectangle.setCoordinates([
|
|
8032
8032
|
[
|
|
8033
|
-
[g,
|
|
8034
|
-
[L,
|
|
8033
|
+
[g, M],
|
|
8034
|
+
[L, M],
|
|
8035
8035
|
[L, W],
|
|
8036
8036
|
[g, W],
|
|
8037
|
-
[g,
|
|
8037
|
+
[g, M]
|
|
8038
8038
|
]
|
|
8039
8039
|
]), this.map.fire("draw.create", { features: [r.rectangle.toGeoJSON()] }), this.changeMode("simple_select", { featureIds: [r.rectangle.id] })) : (this.deleteFeature([r.rectangle.id], { silent: !0 }), r.hasCoordinates = !1, this.changeMode("simple_select"));
|
|
8040
8040
|
},
|
|
@@ -8044,8 +8044,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8044
8044
|
this.deleteFeature([r.rectangle.id], { silent: !0 }), this.changeMode("simple_select");
|
|
8045
8045
|
},
|
|
8046
8046
|
toDisplayFeatures(r, f, g) {
|
|
8047
|
-
const
|
|
8048
|
-
|
|
8047
|
+
const M = f.properties.id === r.rectangle.id;
|
|
8048
|
+
M && !r.hasCoordinates || (f.properties.active = M ? "true" : "false", g(f));
|
|
8049
8049
|
}
|
|
8050
8050
|
};
|
|
8051
8051
|
}
|
|
@@ -8189,8 +8189,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8189
8189
|
const f = String(r?.url ?? "").trim();
|
|
8190
8190
|
if (!f) return "";
|
|
8191
8191
|
if (/^https?:\/\//i.test(f)) return f;
|
|
8192
|
-
const g = window.location?.origin ?? "",
|
|
8193
|
-
return `${g}/${
|
|
8192
|
+
const g = window.location?.origin ?? "", M = f.replace(/^\/+/, "");
|
|
8193
|
+
return `${g}/${M}`;
|
|
8194
8194
|
}
|
|
8195
8195
|
function gt(r) {
|
|
8196
8196
|
r && Re.value?.layerId !== r || (Re.value = null);
|
|
@@ -8200,7 +8200,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8200
8200
|
const g = Number(f?.point_count);
|
|
8201
8201
|
if (Number.isFinite(g) && g > 1)
|
|
8202
8202
|
return [{ key: "Об'єктів у кластері", value: String(g) }];
|
|
8203
|
-
const
|
|
8203
|
+
const M = at(r), L = Ml(r, M, G.value);
|
|
8204
8204
|
return Array.isArray(r.popup) ? r.popup.length ? r.popup.map((W) => {
|
|
8205
8205
|
const ce = W?.field || W?.name;
|
|
8206
8206
|
if (!ce) return null;
|
|
@@ -8212,14 +8212,14 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8212
8212
|
}
|
|
8213
8213
|
function Ct(r) {
|
|
8214
8214
|
if (!Array.isArray(r)) return [];
|
|
8215
|
-
const f = (
|
|
8216
|
-
if (!
|
|
8217
|
-
const L =
|
|
8218
|
-
return !W || L[0] !== W[0] || L[1] !== W[1] ? [...
|
|
8215
|
+
const f = (M) => Array.isArray(M) && M.length >= 2 && Number.isFinite(Number(M[0])) && Number.isFinite(Number(M[1])), g = (M) => {
|
|
8216
|
+
if (!M.length) return M;
|
|
8217
|
+
const L = M[0], W = M[M.length - 1];
|
|
8218
|
+
return !W || L[0] !== W[0] || L[1] !== W[1] ? [...M, L] : M;
|
|
8219
8219
|
};
|
|
8220
8220
|
if (r.length && f(r[0])) {
|
|
8221
|
-
const
|
|
8222
|
-
return
|
|
8221
|
+
const M = r.map((L) => [Number(L[0]), Number(L[1])]).filter(f);
|
|
8222
|
+
return M.length ? [g(M)] : [];
|
|
8223
8223
|
}
|
|
8224
8224
|
return r.length && Array.isArray(r[0]) && f(r[0][0]) ? r.map(
|
|
8225
8225
|
(L) => Array.isArray(L) ? L.map((W) => [Number(W[0]), Number(W[1])]) : []
|
|
@@ -8230,10 +8230,10 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8230
8230
|
function Et(r) {
|
|
8231
8231
|
const f = r.style ?? {}, g = f.color ?? "#3b82f6";
|
|
8232
8232
|
if (!f.colorAttr || !f.colorSet) return g;
|
|
8233
|
-
const
|
|
8234
|
-
if (!
|
|
8233
|
+
const M = Object.keys(f.colorSet);
|
|
8234
|
+
if (!M.length) return g;
|
|
8235
8235
|
const L = ["match", ["to-string", ["get", f.colorAttr]]];
|
|
8236
|
-
return
|
|
8236
|
+
return M.forEach((W) => {
|
|
8237
8237
|
L.push(String(W), f.colorSet?.[W] ?? g);
|
|
8238
8238
|
}), L.push(g), L;
|
|
8239
8239
|
}
|
|
@@ -8246,20 +8246,20 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8246
8246
|
}
|
|
8247
8247
|
function Qt(r) {
|
|
8248
8248
|
if (!H) return;
|
|
8249
|
-
r.handlers.forEach((
|
|
8249
|
+
r.handlers.forEach((M) => {
|
|
8250
8250
|
try {
|
|
8251
|
-
H.off(
|
|
8251
|
+
H.off(M.type, M.layerId, M.handler);
|
|
8252
8252
|
} catch {
|
|
8253
8253
|
}
|
|
8254
|
-
}), r.handlers = [], [...r.layerIds, ...r.boundsIds].forEach((
|
|
8255
|
-
H.getLayer(
|
|
8254
|
+
}), r.handlers = [], [...r.layerIds, ...r.boundsIds].forEach((M) => {
|
|
8255
|
+
H.getLayer(M) && H.removeLayer(M);
|
|
8256
8256
|
}), Mt(r.sourceId), H.getSource(r.sourceId) && H.removeSource(r.sourceId);
|
|
8257
8257
|
const f = `vs-ov-bounds-src-${r.id}`, g = `vs-ov-bounds-line-${r.id}`;
|
|
8258
8258
|
H.getLayer(g) && H.removeLayer(g), H.getSource(f) && H.removeSource(f), gt(r.id);
|
|
8259
8259
|
}
|
|
8260
8260
|
function oo(r, f) {
|
|
8261
8261
|
if (!H) return [];
|
|
8262
|
-
const g = `vs-ov-bounds-src-${f}`,
|
|
8262
|
+
const g = `vs-ov-bounds-src-${f}`, M = `vs-ov-bounds-line-${f}`, L = r.bounds ?? le.value ?? Me.value, W = Ct(L);
|
|
8263
8263
|
if (!W.length) return [];
|
|
8264
8264
|
const ce = {
|
|
8265
8265
|
type: "FeatureCollection",
|
|
@@ -8269,8 +8269,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8269
8269
|
geometry: { type: "LineString", coordinates: ke }
|
|
8270
8270
|
}))
|
|
8271
8271
|
};
|
|
8272
|
-
return H.getLayer(
|
|
8273
|
-
id:
|
|
8272
|
+
return H.getLayer(M) && H.removeLayer(M), H.getSource(g) && H.removeSource(g), H.addSource(g, { type: "geojson", data: ce }), H.addLayer({
|
|
8273
|
+
id: M,
|
|
8274
8274
|
type: "line",
|
|
8275
8275
|
source: g,
|
|
8276
8276
|
paint: {
|
|
@@ -8279,21 +8279,21 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8279
8279
|
"line-opacity": r.style?.opacity ?? 0.8,
|
|
8280
8280
|
"line-dasharray": [2, 2]
|
|
8281
8281
|
}
|
|
8282
|
-
}), [
|
|
8282
|
+
}), [M];
|
|
8283
8283
|
}
|
|
8284
8284
|
function cl() {
|
|
8285
8285
|
return j || b.value === "marker" || b.value === "polyline" || b.value === "polygon" || b.value === "rectangle";
|
|
8286
8286
|
}
|
|
8287
8287
|
function ro(r, f) {
|
|
8288
8288
|
if (!H) return;
|
|
8289
|
-
r.handlers.forEach((
|
|
8289
|
+
r.handlers.forEach((M) => {
|
|
8290
8290
|
try {
|
|
8291
|
-
H.off(
|
|
8291
|
+
H.off(M.type, M.layerId, M.handler);
|
|
8292
8292
|
} catch {
|
|
8293
8293
|
}
|
|
8294
8294
|
});
|
|
8295
8295
|
const g = [];
|
|
8296
|
-
f.forEach((
|
|
8296
|
+
f.forEach((M) => {
|
|
8297
8297
|
const L = (ce) => {
|
|
8298
8298
|
if (cl()) return;
|
|
8299
8299
|
if (!ce?.features?.length) {
|
|
@@ -8311,9 +8311,9 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8311
8311
|
point: { x: ce.point.x, y: ce.point.y }
|
|
8312
8312
|
};
|
|
8313
8313
|
}, W = () => gt(r.id);
|
|
8314
|
-
H.on("mousemove",
|
|
8315
|
-
{ layerId:
|
|
8316
|
-
{ layerId:
|
|
8314
|
+
H.on("mousemove", M, L), H.on("mouseleave", M, W), g.push(
|
|
8315
|
+
{ layerId: M, type: "mousemove", handler: L },
|
|
8316
|
+
{ layerId: M, type: "mouseleave", handler: W }
|
|
8317
8317
|
);
|
|
8318
8318
|
}), r.handlers = g;
|
|
8319
8319
|
}
|
|
@@ -8321,21 +8321,21 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8321
8321
|
if (!H) return;
|
|
8322
8322
|
r.layerIds = f, r.boundsIds = oo(r.config, r.id), ro(r, f);
|
|
8323
8323
|
const g = r.visible ? "visible" : "none";
|
|
8324
|
-
[...r.layerIds, ...r.boundsIds].forEach((
|
|
8325
|
-
H.getLayer(
|
|
8324
|
+
[...r.layerIds, ...r.boundsIds].forEach((M) => {
|
|
8325
|
+
H.getLayer(M) && H.setLayoutProperty(M, "visibility", g);
|
|
8326
8326
|
}), Pt();
|
|
8327
8327
|
}
|
|
8328
8328
|
function mn(r) {
|
|
8329
8329
|
if (!H) return;
|
|
8330
8330
|
Qt(r), r.renderToken = (r.renderToken ?? 0) + 1;
|
|
8331
|
-
const f = r.renderToken, g = r.config,
|
|
8332
|
-
if (!
|
|
8333
|
-
const L = [], W = /\.v(?:m)?t(?:\?|$|\/)/i.test(
|
|
8331
|
+
const f = r.renderToken, g = r.config, M = at(g);
|
|
8332
|
+
if (!M) return;
|
|
8333
|
+
const L = [], W = /\.v(?:m)?t(?:\?|$|\/)/i.test(M) || /\.pbf(?:\?|$)/i.test(M) || /\/vtile(?:\/|\?|$)/i.test(M) || String(g?.service ?? "").toLowerCase() === "vector" || String(g?.format ?? "").toLowerCase() === "mvt", ce = Ml(g, M, G.value);
|
|
8334
8334
|
if (W && ce) {
|
|
8335
8335
|
const ke = g.sourceLayer || g.layer || g.service_layer || g.dataset?.layer || g.id;
|
|
8336
8336
|
H.addSource(r.sourceId, {
|
|
8337
8337
|
type: "vector",
|
|
8338
|
-
tiles: [
|
|
8338
|
+
tiles: [M],
|
|
8339
8339
|
minzoom: typeof g.minzoom == "number" ? g.minzoom : 0,
|
|
8340
8340
|
maxzoom: typeof g.maxzoom == "number" ? g.maxzoom : 22
|
|
8341
8341
|
}), (async () => {
|
|
@@ -8346,7 +8346,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8346
8346
|
overlayId: r.id,
|
|
8347
8347
|
sourceId: r.sourceId,
|
|
8348
8348
|
sourceLayer: ke,
|
|
8349
|
-
url:
|
|
8349
|
+
url: M,
|
|
8350
8350
|
config: g
|
|
8351
8351
|
});
|
|
8352
8352
|
if (!H || !H.getSource(r.sourceId) || r.renderToken !== f) {
|
|
@@ -8366,7 +8366,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8366
8366
|
const ke = g.sourceLayer || g.layer || g.service_layer || g.dataset?.layer || g.id;
|
|
8367
8367
|
H.addSource(r.sourceId, {
|
|
8368
8368
|
type: "vector",
|
|
8369
|
-
tiles: [
|
|
8369
|
+
tiles: [M],
|
|
8370
8370
|
minzoom: typeof g.minzoom == "number" ? g.minzoom : 0,
|
|
8371
8371
|
maxzoom: typeof g.maxzoom == "number" ? g.maxzoom : 22
|
|
8372
8372
|
});
|
|
@@ -8429,7 +8429,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8429
8429
|
} else {
|
|
8430
8430
|
H.addSource(
|
|
8431
8431
|
r.sourceId,
|
|
8432
|
-
Sl(
|
|
8432
|
+
Sl(M, g, { safe: !1 })
|
|
8433
8433
|
);
|
|
8434
8434
|
const ke = `vs-ov-raster-${r.id}`;
|
|
8435
8435
|
H.addLayer({
|
|
@@ -8471,22 +8471,22 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8471
8471
|
if (!f) return;
|
|
8472
8472
|
f.visible = !f.visible;
|
|
8473
8473
|
const g = f.visible ? "visible" : "none";
|
|
8474
|
-
[...f.layerIds, ...f.boundsIds].forEach((
|
|
8475
|
-
H.getLayer(
|
|
8474
|
+
[...f.layerIds, ...f.boundsIds].forEach((M) => {
|
|
8475
|
+
H.getLayer(M) && H.setLayoutProperty(M, "visibility", g);
|
|
8476
8476
|
}), Pt(), f.visible || gt(r);
|
|
8477
8477
|
}
|
|
8478
8478
|
function Kl(r) {
|
|
8479
8479
|
if (!H) return;
|
|
8480
8480
|
const f = ut[r];
|
|
8481
8481
|
if (!f?.url) return;
|
|
8482
|
-
const g = kt(r),
|
|
8483
|
-
H.getLayer(
|
|
8482
|
+
const g = kt(r), M = Zt(r);
|
|
8483
|
+
H.getLayer(M) && H.removeLayer(M), H.getSource(g) && H.removeSource(g), H.addSource(
|
|
8484
8484
|
g,
|
|
8485
8485
|
Sl(f.url, f, { safe: !0 })
|
|
8486
8486
|
);
|
|
8487
8487
|
const L = f?.opacity ?? f?.style?.opacity, W = typeof L == "number" ? L : Lm;
|
|
8488
8488
|
H.addLayer({
|
|
8489
|
-
id:
|
|
8489
|
+
id: M,
|
|
8490
8490
|
type: "raster",
|
|
8491
8491
|
source: g,
|
|
8492
8492
|
paint: {
|
|
@@ -8508,18 +8508,18 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8508
8508
|
}
|
|
8509
8509
|
function Pt() {
|
|
8510
8510
|
if (!H) return;
|
|
8511
|
-
const r = pt.value.map((Ee) => Zt(Ee)).filter((Ee) => H.getLayer(Ee)), f = [], g = [],
|
|
8511
|
+
const r = pt.value.map((Ee) => Zt(Ee)).filter((Ee) => H.getLayer(Ee)), f = [], g = [], M = [], L = [];
|
|
8512
8512
|
he.value.forEach((Ee) => {
|
|
8513
8513
|
const et = oe[Ee];
|
|
8514
8514
|
if (!et) return;
|
|
8515
8515
|
const Ht = String(et.config?.url ?? ""), kl = /\.v(?:m)?t(?:\?|$|\/)/i.test(Ht) || /\/vtile(?:\/|\?|$)/i.test(Ht) || ar(et.config, Ht, G.value), Wt = /\.png(?:\?|$)/i.test(Ht);
|
|
8516
|
-
kl ?
|
|
8516
|
+
kl ? M.push(...et.layerIds) : Wt ? f.push(...et.layerIds) : g.push(...et.layerIds), L.push(...et.boundsIds);
|
|
8517
8517
|
});
|
|
8518
8518
|
const W = [
|
|
8519
8519
|
...r,
|
|
8520
8520
|
...f,
|
|
8521
8521
|
...g,
|
|
8522
|
-
...
|
|
8522
|
+
...M,
|
|
8523
8523
|
...L
|
|
8524
8524
|
];
|
|
8525
8525
|
W.forEach((Ee) => {
|
|
@@ -8542,9 +8542,9 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8542
8542
|
g.setTiles([f]), Pt();
|
|
8543
8543
|
return;
|
|
8544
8544
|
}
|
|
8545
|
-
const
|
|
8545
|
+
const M = H.getCenter?.(), L = H.getZoom?.(), W = Se?.getAll?.();
|
|
8546
8546
|
H.setStyle(pn(f)), H.once("style.load", () => {
|
|
8547
|
-
if (H && (
|
|
8547
|
+
if (H && (M && Number.isFinite(L) && H.jumpTo({ center: [M.lng, M.lat], zoom: L }), xn(), Yl(), he.value.forEach((ce) => {
|
|
8548
8548
|
const ke = oe[ce];
|
|
8549
8549
|
ke && mn(ke);
|
|
8550
8550
|
}), Pt(), W?.features?.length && Se))
|
|
@@ -8606,8 +8606,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8606
8606
|
return r.flatMap(
|
|
8607
8607
|
(L) => L?.type === "FeatureCollection" ? En(L) : [g(L)]
|
|
8608
8608
|
).flat().filter(Boolean);
|
|
8609
|
-
const
|
|
8610
|
-
return
|
|
8609
|
+
const M = g(r);
|
|
8610
|
+
return M ? Array.isArray(M) ? M : [M] : [];
|
|
8611
8611
|
}
|
|
8612
8612
|
function Gl(r) {
|
|
8613
8613
|
if (!r.length) return null;
|
|
@@ -8634,8 +8634,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8634
8634
|
}
|
|
8635
8635
|
function Zl(r, f) {
|
|
8636
8636
|
if (!Array.isArray(r) || r.length < 4) return null;
|
|
8637
|
-
const
|
|
8638
|
-
return !Number.isInteger(f) || f < 0 || f >=
|
|
8637
|
+
const M = po(r[0], r[r.length - 1]) ? r.slice(0, -1) : r.slice();
|
|
8638
|
+
return !Number.isInteger(f) || f < 0 || f >= M.length || M.length <= 3 || (M.splice(f, 1), M.length < 3) ? null : [...M, [...M[0]]];
|
|
8639
8639
|
}
|
|
8640
8640
|
function Jl(r, f) {
|
|
8641
8641
|
if (!Array.isArray(r) || r.length < 2 || !Number.isInteger(f) || f < 0 || f >= r.length || r.length <= 2) return null;
|
|
@@ -8646,20 +8646,20 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8646
8646
|
const g = Ot(r);
|
|
8647
8647
|
if (!g || !Array.isArray(f)) return null;
|
|
8648
8648
|
if (g.type === "LineString") {
|
|
8649
|
-
const [
|
|
8649
|
+
const [M] = f, L = Jl(g.coordinates, M);
|
|
8650
8650
|
return L ? (g.coordinates = L, g) : null;
|
|
8651
8651
|
}
|
|
8652
8652
|
if (g.type === "MultiLineString") {
|
|
8653
|
-
const [
|
|
8654
|
-
return ce ? (g.coordinates[
|
|
8653
|
+
const [M, L] = f, W = g.coordinates?.[M], ce = Jl(W, L);
|
|
8654
|
+
return ce ? (g.coordinates[M] = ce, g) : null;
|
|
8655
8655
|
}
|
|
8656
8656
|
if (g.type === "Polygon") {
|
|
8657
|
-
const [
|
|
8658
|
-
return ce ? (g.coordinates[
|
|
8657
|
+
const [M, L] = f, W = g.coordinates?.[M], ce = Zl(W, L);
|
|
8658
|
+
return ce ? (g.coordinates[M] = ce, g) : null;
|
|
8659
8659
|
}
|
|
8660
8660
|
if (g.type === "MultiPolygon") {
|
|
8661
|
-
const [
|
|
8662
|
-
return ke ? (g.coordinates[
|
|
8661
|
+
const [M, L, W] = f, ce = g.coordinates?.[M]?.[L], ke = Zl(ce, W);
|
|
8662
|
+
return ke ? (g.coordinates[M][L] = ke, g) : null;
|
|
8663
8663
|
}
|
|
8664
8664
|
return null;
|
|
8665
8665
|
}
|
|
@@ -8678,22 +8678,22 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8678
8678
|
const f = [
|
|
8679
8679
|
[r.x - 8, r.y - 8],
|
|
8680
8680
|
[r.x + 8, r.y + 8]
|
|
8681
|
-
],
|
|
8681
|
+
], M = H.queryRenderedFeatures(f).find((L) => {
|
|
8682
8682
|
const W = String(L?.properties?.meta ?? "");
|
|
8683
8683
|
return W && W !== "feature" ? !1 : !!ea(L);
|
|
8684
8684
|
});
|
|
8685
|
-
return ea(
|
|
8685
|
+
return ea(M);
|
|
8686
8686
|
}
|
|
8687
8687
|
function go(r, f) {
|
|
8688
8688
|
if (!Se || !r || !f.length) return;
|
|
8689
8689
|
const g = Ql(r);
|
|
8690
8690
|
if (!g?.geometry) return;
|
|
8691
|
-
const
|
|
8692
|
-
if (!
|
|
8691
|
+
const M = fo(g.geometry, f);
|
|
8692
|
+
if (!M) return;
|
|
8693
8693
|
const L = {
|
|
8694
8694
|
...g,
|
|
8695
8695
|
id: g.id ?? r,
|
|
8696
|
-
geometry:
|
|
8696
|
+
geometry: M
|
|
8697
8697
|
};
|
|
8698
8698
|
te = !0, B = !0;
|
|
8699
8699
|
try {
|
|
@@ -8721,18 +8721,18 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8721
8721
|
function ho(r) {
|
|
8722
8722
|
const f = la(r);
|
|
8723
8723
|
if (!f) return null;
|
|
8724
|
-
const [[g,
|
|
8725
|
-
return { lat: (
|
|
8724
|
+
const [[g, M], [L, W]] = f;
|
|
8725
|
+
return { lat: (M + W) / 2, lng: (g + L) / 2 };
|
|
8726
8726
|
}
|
|
8727
8727
|
function ta(r) {
|
|
8728
8728
|
if (!Array.isArray(r) || r.length < 3) return 0;
|
|
8729
|
-
const f = (
|
|
8730
|
-
const W =
|
|
8729
|
+
const f = (M, L) => {
|
|
8730
|
+
const W = M * 2003750834e-2 / 180, ce = Math.log(Math.tan((90 + L) * Math.PI / 360)) / (Math.PI / 180);
|
|
8731
8731
|
return [W, ce * 2003750834e-2 / 180];
|
|
8732
8732
|
};
|
|
8733
8733
|
let g = 0;
|
|
8734
|
-
for (let
|
|
8735
|
-
const [L, W] = f(Number(r[
|
|
8734
|
+
for (let M = 0; M < r.length - 1; M += 1) {
|
|
8735
|
+
const [L, W] = f(Number(r[M][0]), Number(r[M][1])), [ce, ke] = f(Number(r[M + 1][0]), Number(r[M + 1][1]));
|
|
8736
8736
|
g += L * ke - ce * W;
|
|
8737
8737
|
}
|
|
8738
8738
|
return Math.abs(g / 2) / 1e6;
|
|
@@ -8744,8 +8744,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8744
8744
|
return Array.isArray(f) ? ta(f) : null;
|
|
8745
8745
|
}
|
|
8746
8746
|
return r.type === "MultiPolygon" ? r.coordinates.reduce((f, g) => {
|
|
8747
|
-
const
|
|
8748
|
-
return Array.isArray(
|
|
8747
|
+
const M = g?.[0];
|
|
8748
|
+
return Array.isArray(M) ? f + ta(M) : f;
|
|
8749
8749
|
}, 0) : null;
|
|
8750
8750
|
}
|
|
8751
8751
|
function vl(r) {
|
|
@@ -8766,18 +8766,18 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8766
8766
|
}
|
|
8767
8767
|
function gl(r) {
|
|
8768
8768
|
if (!r) {
|
|
8769
|
-
const
|
|
8769
|
+
const M = wt[wt.length - 1], L = Ot(M?.geometry ?? null);
|
|
8770
8770
|
zt = L, vl(L);
|
|
8771
8771
|
return;
|
|
8772
8772
|
}
|
|
8773
|
-
const f = wt.find((
|
|
8773
|
+
const f = wt.find((M) => String(M?.id ?? "") === String(r)) ?? null, g = Ot(f?.geometry ?? null);
|
|
8774
8774
|
zt = g, vl(g);
|
|
8775
8775
|
}
|
|
8776
8776
|
function yl(r) {
|
|
8777
8777
|
m.value = (r ?? []).map((f, g) => {
|
|
8778
|
-
const
|
|
8778
|
+
const M = String(f?.id ?? `feature-${g + 1}`), L = hl(String(f?.geometry?.type ?? "Feature"));
|
|
8779
8779
|
return {
|
|
8780
|
-
id:
|
|
8780
|
+
id: M,
|
|
8781
8781
|
label: `${L} ${g + 1}`
|
|
8782
8782
|
};
|
|
8783
8783
|
});
|
|
@@ -8809,12 +8809,12 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8809
8809
|
}
|
|
8810
8810
|
function la(r) {
|
|
8811
8811
|
if (!r) return null;
|
|
8812
|
-
let f = 1 / 0, g = 1 / 0,
|
|
8812
|
+
let f = 1 / 0, g = 1 / 0, M = -1 / 0, L = -1 / 0;
|
|
8813
8813
|
const W = (ce) => {
|
|
8814
8814
|
if (Array.isArray(ce)) {
|
|
8815
8815
|
if (ce.length >= 2 && Number.isFinite(ce[0]) && Number.isFinite(ce[1])) {
|
|
8816
8816
|
const ke = Number(ce[0]), Ee = Number(ce[1]);
|
|
8817
|
-
f = Math.min(f, ke), g = Math.min(g, Ee),
|
|
8817
|
+
f = Math.min(f, ke), g = Math.min(g, Ee), M = Math.max(M, ke), L = Math.max(L, Ee);
|
|
8818
8818
|
return;
|
|
8819
8819
|
}
|
|
8820
8820
|
ce.forEach(W);
|
|
@@ -8822,16 +8822,16 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8822
8822
|
};
|
|
8823
8823
|
return W(r.coordinates), !Number.isFinite(f) || !Number.isFinite(g) ? null : [
|
|
8824
8824
|
[f, g],
|
|
8825
|
-
[
|
|
8825
|
+
[M, L]
|
|
8826
8826
|
];
|
|
8827
8827
|
}
|
|
8828
8828
|
function aa(r) {
|
|
8829
8829
|
if (!H || !r) return;
|
|
8830
8830
|
const f = la(r);
|
|
8831
8831
|
if (!f) return;
|
|
8832
|
-
const [[g,
|
|
8833
|
-
if (g === L &&
|
|
8834
|
-
H.easeTo({ center: [g,
|
|
8832
|
+
const [[g, M], [L, W]] = f;
|
|
8833
|
+
if (g === L && M === W) {
|
|
8834
|
+
H.easeTo({ center: [g, M], zoom: Math.max(Y.value, 14) }), ve();
|
|
8835
8835
|
return;
|
|
8836
8836
|
}
|
|
8837
8837
|
H.fitBounds(f, { padding: 30, duration: 250, maxZoom: 18 }), ve();
|
|
@@ -8846,9 +8846,9 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8846
8846
|
}
|
|
8847
8847
|
function kn() {
|
|
8848
8848
|
if (!Se) return null;
|
|
8849
|
-
const f = Se.getAll?.()?.features ?? [], g = (W) => !!W && f.some((ce) => String(ce?.id ?? "") === String(W ?? "")),
|
|
8850
|
-
if (Array.isArray(
|
|
8851
|
-
const W =
|
|
8849
|
+
const f = Se.getAll?.()?.features ?? [], g = (W) => !!W && f.some((ce) => String(ce?.id ?? "") === String(W ?? "")), M = Se.getSelectedIds?.();
|
|
8850
|
+
if (Array.isArray(M) && M.length > 0) {
|
|
8851
|
+
const W = M[0];
|
|
8852
8852
|
return W != null ? String(W) : null;
|
|
8853
8853
|
}
|
|
8854
8854
|
if (g(mt)) return String(mt);
|
|
@@ -8980,8 +8980,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
8980
8980
|
return r ? typeof r == "string" ? r : typeof r == "object" && r && "file_path" in r ? String(r.file_path ?? "") : "" : "";
|
|
8981
8981
|
}
|
|
8982
8982
|
function Vo(r) {
|
|
8983
|
-
const
|
|
8984
|
-
return
|
|
8983
|
+
const M = ((Array.isArray(r) ? r[0] : r)?.features ?? []).map((L) => Array.isArray(L) ? L[0] : L).filter(Boolean).map((L) => L?.type === "Feature" ? L : { type: "Feature", properties: {}, geometry: L });
|
|
8984
|
+
return M.length ? { type: "FeatureCollection", features: M } : null;
|
|
8985
8985
|
}
|
|
8986
8986
|
async function Do() {
|
|
8987
8987
|
if (c.value || !Se || He.value) return;
|
|
@@ -9008,8 +9008,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9008
9008
|
}), g = await f.json().catch(() => null);
|
|
9009
9009
|
if (!f.ok)
|
|
9010
9010
|
throw new Error(g?.message || g?.error || `Код помилки: ${f.status}`);
|
|
9011
|
-
const
|
|
9012
|
-
if (!
|
|
9011
|
+
const M = Vo(g);
|
|
9012
|
+
if (!M) {
|
|
9013
9013
|
Ie({
|
|
9014
9014
|
type: "warning",
|
|
9015
9015
|
title: "Імпорт геометрії",
|
|
@@ -9017,7 +9017,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9017
9017
|
});
|
|
9018
9018
|
return;
|
|
9019
9019
|
}
|
|
9020
|
-
On(
|
|
9020
|
+
On(M), en(), Ue.value = !1, Ie({
|
|
9021
9021
|
type: "success",
|
|
9022
9022
|
title: "Успіх",
|
|
9023
9023
|
message: "Геометрію успішно імпортовано."
|
|
@@ -9062,11 +9062,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9062
9062
|
if (!r.length) return;
|
|
9063
9063
|
const f = 5;
|
|
9064
9064
|
r.slice(0, f).forEach((g) => {
|
|
9065
|
-
const
|
|
9065
|
+
const M = g.line > 0 ? `Рядок ${g.line}` : "Загальна помилка";
|
|
9066
9066
|
Ie({
|
|
9067
9067
|
type: "warning",
|
|
9068
9068
|
title: "Імпорт координат",
|
|
9069
|
-
message: `${
|
|
9069
|
+
message: `${M} — ${g.message}`
|
|
9070
9070
|
});
|
|
9071
9071
|
}), r.length > f && Ie({
|
|
9072
9072
|
type: "warning",
|
|
@@ -9076,8 +9076,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9076
9076
|
}
|
|
9077
9077
|
function Po() {
|
|
9078
9078
|
if (c.value || !Se) return;
|
|
9079
|
-
const r = Se.getAll(), f = new Blob([JSON.stringify(r, null, 2)], { type: "application/json" }), g = URL.createObjectURL(f),
|
|
9080
|
-
|
|
9079
|
+
const r = Se.getAll(), f = new Blob([JSON.stringify(r, null, 2)], { type: "application/json" }), g = URL.createObjectURL(f), M = document.createElement("a");
|
|
9080
|
+
M.href = g, M.download = "data.geojson", M.click(), URL.revokeObjectURL(g);
|
|
9081
9081
|
}
|
|
9082
9082
|
rt(async () => {
|
|
9083
9083
|
if (window.addEventListener("click", oa, !0), !_.value) return;
|
|
@@ -9091,8 +9091,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9091
9091
|
zoom: Y.value,
|
|
9092
9092
|
attributionControl: !1
|
|
9093
9093
|
}), x.value = H, H.addControl(new jt.NavigationControl({ showCompass: !0 }), "bottom-right"), H.on("error", (g) => {
|
|
9094
|
-
const
|
|
9095
|
-
Pf(
|
|
9094
|
+
const M = g?.error?.message ?? g?.message ?? "";
|
|
9095
|
+
Pf(M);
|
|
9096
9096
|
}), H.on("load", () => {
|
|
9097
9097
|
if (!(!Jt || !H)) {
|
|
9098
9098
|
if (Se = new Jt({
|
|
@@ -9116,24 +9116,24 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9116
9116
|
return;
|
|
9117
9117
|
}
|
|
9118
9118
|
if (!Se || c.value || b.value !== "edit") return;
|
|
9119
|
-
const
|
|
9120
|
-
!
|
|
9121
|
-
!Se || c.value || Ut(
|
|
9119
|
+
const M = vo(g?.point);
|
|
9120
|
+
!M || M === mt || requestAnimationFrame(() => {
|
|
9121
|
+
!Se || c.value || Ut(M);
|
|
9122
9122
|
});
|
|
9123
9123
|
}), H.on("draw.create", () => {
|
|
9124
9124
|
if (Se && !S.isRulerActive.value) {
|
|
9125
9125
|
if (!s.value) {
|
|
9126
9126
|
const g = Se.getAll();
|
|
9127
9127
|
if (g.features.length > 1) {
|
|
9128
|
-
const
|
|
9129
|
-
B = !0, g.features.slice(0, -1).forEach((L) => Se.delete(L.id)), B = !1,
|
|
9128
|
+
const M = g.features[g.features.length - 1];
|
|
9129
|
+
B = !0, g.features.slice(0, -1).forEach((L) => Se.delete(L.id)), B = !1, M && (B = !0, Se.add(M), B = !1);
|
|
9130
9130
|
}
|
|
9131
9131
|
}
|
|
9132
9132
|
en(), Ut();
|
|
9133
9133
|
}
|
|
9134
9134
|
}), H.on("draw.update", (g) => {
|
|
9135
9135
|
if (an || S.isRulerActive.value || cl()) return;
|
|
9136
|
-
const
|
|
9136
|
+
const M = Array.isArray(g?.features) ? g.features : [], L = g?.action === "move" && M.length > 0 && M.every((W) => W?.geometry?.type === "Point");
|
|
9137
9137
|
if (g?.action === "move") {
|
|
9138
9138
|
if (L) {
|
|
9139
9139
|
en();
|
|
@@ -9156,11 +9156,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9156
9156
|
}), H.on("draw.selectionchange", (g) => {
|
|
9157
9157
|
if (!Se || an || S.isRulerActive.value || b.value === "marker" || b.value === "polyline" || b.value === "polygon" || b.value === "rectangle")
|
|
9158
9158
|
return;
|
|
9159
|
-
const
|
|
9160
|
-
if (!c.value &&
|
|
9161
|
-
if (b.value === "edit" && mt ===
|
|
9159
|
+
const M = g?.features?.[0]?.id !== void 0 && g?.features?.[0]?.id !== null ? String(g.features[0].id) : null;
|
|
9160
|
+
if (!c.value && M) {
|
|
9161
|
+
if (b.value === "edit" && mt === M) return;
|
|
9162
9162
|
requestAnimationFrame(() => {
|
|
9163
|
-
!Se || c.value || Ut(
|
|
9163
|
+
!Se || c.value || Ut(M);
|
|
9164
9164
|
});
|
|
9165
9165
|
return;
|
|
9166
9166
|
}
|
|
@@ -9183,8 +9183,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9183
9183
|
});
|
|
9184
9184
|
}
|
|
9185
9185
|
xn(), Yl(), he.value.forEach((g) => {
|
|
9186
|
-
const
|
|
9187
|
-
|
|
9186
|
+
const M = oe[g];
|
|
9187
|
+
M && mn(M);
|
|
9188
9188
|
}), Pt(), O();
|
|
9189
9189
|
}
|
|
9190
9190
|
}), H.on("contextmenu", yo), H.on("moveend", ve), H.on("zoomend", () => {
|
|
@@ -9215,11 +9215,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9215
9215
|
), ge(
|
|
9216
9216
|
() => ne.value,
|
|
9217
9217
|
(r) => {
|
|
9218
|
-
const f = Array.isArray(r) ? r : [], g = [],
|
|
9218
|
+
const f = Array.isArray(r) ? r : [], g = [], M = /* @__PURE__ */ new Set();
|
|
9219
9219
|
f.forEach((L, W) => {
|
|
9220
9220
|
if (!L) return;
|
|
9221
9221
|
const ce = vt(L, W);
|
|
9222
|
-
g.push(ce),
|
|
9222
|
+
g.push(ce), M.add(ce);
|
|
9223
9223
|
const ke = { ...L, id: ce }, Ee = oe[ce], et = Ee?.visible ?? !!ke.visible;
|
|
9224
9224
|
Ee && H && Qt(Ee), oe[ce] = {
|
|
9225
9225
|
id: ce,
|
|
@@ -9232,7 +9232,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9232
9232
|
renderToken: Ee?.renderToken ?? 0
|
|
9233
9233
|
};
|
|
9234
9234
|
}), Object.keys(oe).forEach((L) => {
|
|
9235
|
-
if (
|
|
9235
|
+
if (M.has(L)) return;
|
|
9236
9236
|
const W = oe[L];
|
|
9237
9237
|
W && H && Qt(W), delete oe[L];
|
|
9238
9238
|
}), he.value = g, H && (he.value.forEach((L) => {
|
|
@@ -9263,8 +9263,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9263
9263
|
try {
|
|
9264
9264
|
const f = await fetch(`https://data.gki.com.ua/api-user/atu/${r}`);
|
|
9265
9265
|
if (!f?.ok) return;
|
|
9266
|
-
const
|
|
9267
|
-
Array.isArray(
|
|
9266
|
+
const M = (await f.json())?.geometry?.coordinates;
|
|
9267
|
+
Array.isArray(M) && M.length && (Me.value = M);
|
|
9268
9268
|
} catch (f) {
|
|
9269
9269
|
console.error("Failed to fetch KATOTTG bounds", f);
|
|
9270
9270
|
} finally {
|
|
@@ -9507,7 +9507,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9507
9507
|
key: 2,
|
|
9508
9508
|
class: se(["vs-btn", { "vs-active": U(S).isRulerActive.value }]),
|
|
9509
9509
|
title: "Лінійка",
|
|
9510
|
-
onClick:
|
|
9510
|
+
onClick: C
|
|
9511
9511
|
}, [
|
|
9512
9512
|
Z(U(Oa), { class: "vs-btn-icon" })
|
|
9513
9513
|
], 2)) : K("", !0),
|
|
@@ -9580,7 +9580,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9580
9580
|
d("div", cm, [
|
|
9581
9581
|
f[11] || (f[11] = d("span", { class: "vs-map-status__label" }, "Тип:", -1)),
|
|
9582
9582
|
d("div", pm, [
|
|
9583
|
-
wl.value.length ? (u(!0), v(Le, { key: 0 }, Be(wl.value, (g,
|
|
9583
|
+
wl.value.length ? (u(!0), v(Le, { key: 0 }, Be(wl.value, (g, M) => (u(), v(Le, {
|
|
9584
9584
|
key: g.id
|
|
9585
9585
|
}, [
|
|
9586
9586
|
g.interactive ? (u(), v("button", {
|
|
@@ -9590,7 +9590,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9590
9590
|
onClick: (L) => xo(g.id),
|
|
9591
9591
|
disabled: c.value
|
|
9592
9592
|
}, de(g.label), 11, fm)) : (u(), v("span", mm, de(g.label), 1)),
|
|
9593
|
-
|
|
9593
|
+
M < wl.value.length - 1 ? (u(), v("span", vm, ", ")) : K("", !0)
|
|
9594
9594
|
], 64))), 128)) : (u(), v("span", gm, "—"))
|
|
9595
9595
|
])
|
|
9596
9596
|
]),
|
|
@@ -9664,7 +9664,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9664
9664
|
}, S = (G) => {
|
|
9665
9665
|
const R = p.value.slice();
|
|
9666
9666
|
R.splice(G, 1), l("update:modelValue", R);
|
|
9667
|
-
},
|
|
9667
|
+
}, C = () => {
|
|
9668
9668
|
l("update:modelValue", []);
|
|
9669
9669
|
}, I = () => {
|
|
9670
9670
|
w.value || (s.value = !0);
|
|
@@ -9752,7 +9752,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9752
9752
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
9753
9753
|
"aria-label": "Clear all tags",
|
|
9754
9754
|
disabled: w.value,
|
|
9755
|
-
onClick: Fe(
|
|
9755
|
+
onClick: Fe(C, ["stop"])
|
|
9756
9756
|
}, [
|
|
9757
9757
|
Z(U($t), { class: "h-4 w-4" })
|
|
9758
9758
|
], 8, zm)) : K("", !0)
|
|
@@ -9925,10 +9925,10 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9925
9925
|
const n = (h) => `${h}-${Math.random().toString(36).substring(2, 15)}`, l = ot("values"), o = e, a = t, i = o.addButtonText ?? "Додати", s = o.ignore ?? [], c = A([]), p = A(null);
|
|
9926
9926
|
(() => {
|
|
9927
9927
|
const h = o.parent && l?.value?.[o.parent] || o.modelValue || {};
|
|
9928
|
-
c.value = Object.entries(h).filter(([S]) => !s.includes(S)).map(([S,
|
|
9928
|
+
c.value = Object.entries(h).filter(([S]) => !s.includes(S)).map(([S, C]) => ({
|
|
9929
9929
|
id: n("key-value-"),
|
|
9930
9930
|
key: S,
|
|
9931
|
-
value:
|
|
9931
|
+
value: C
|
|
9932
9932
|
}));
|
|
9933
9933
|
})();
|
|
9934
9934
|
function $(h) {
|
|
@@ -9951,19 +9951,19 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9951
9951
|
h.forEach((I) => {
|
|
9952
9952
|
I.key && I.value !== void 0 && (S[I.key] = I.value);
|
|
9953
9953
|
});
|
|
9954
|
-
const
|
|
9954
|
+
const C = {};
|
|
9955
9955
|
s.length && s.forEach((I) => {
|
|
9956
|
-
|
|
9956
|
+
C[I] = o.parent ? l?.value?.[o.parent]?.[I] : void 0;
|
|
9957
9957
|
}), l?.value && o.parent && (l.value[o.parent] = {
|
|
9958
|
-
...
|
|
9958
|
+
...C,
|
|
9959
9959
|
...S
|
|
9960
9960
|
}), a("update:modelValue", S);
|
|
9961
9961
|
},
|
|
9962
9962
|
{ deep: !0 }
|
|
9963
9963
|
), (h, S) => (u(), v("div", tv, [
|
|
9964
9964
|
d("div", nv, [
|
|
9965
|
-
(u(!0), v(Le, null, Be(c.value, (
|
|
9966
|
-
key:
|
|
9965
|
+
(u(!0), v(Le, null, Be(c.value, (C, I) => (u(), v("div", {
|
|
9966
|
+
key: C.id,
|
|
9967
9967
|
class: se(["flex items-center gap-2 w-full", { "opacity-50": p.value === I }]),
|
|
9968
9968
|
draggable: "true",
|
|
9969
9969
|
onDragstart: (D) => $(I),
|
|
@@ -9976,20 +9976,20 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
9976
9976
|
]),
|
|
9977
9977
|
d("div", ov, [
|
|
9978
9978
|
Z(Ln, {
|
|
9979
|
-
modelValue:
|
|
9980
|
-
"onUpdate:modelValue": (D) =>
|
|
9979
|
+
modelValue: C.key,
|
|
9980
|
+
"onUpdate:modelValue": (D) => C.key = D,
|
|
9981
9981
|
placeholder: "Ключ"
|
|
9982
9982
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
9983
9983
|
]),
|
|
9984
9984
|
d("div", rv, [
|
|
9985
9985
|
Z(Ln, {
|
|
9986
|
-
modelValue:
|
|
9987
|
-
"onUpdate:modelValue": (D) =>
|
|
9986
|
+
modelValue: C.value,
|
|
9987
|
+
"onUpdate:modelValue": (D) => C.value = D,
|
|
9988
9988
|
placeholder: "Значення"
|
|
9989
9989
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
9990
9990
|
]),
|
|
9991
9991
|
d("button", {
|
|
9992
|
-
onClick: (D) => x(
|
|
9992
|
+
onClick: (D) => x(C.id),
|
|
9993
9993
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
|
|
9994
9994
|
}, [
|
|
9995
9995
|
Z(U($t), { class: "h-4 w-4" })
|
|
@@ -10034,9 +10034,9 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10034
10034
|
let c = !1;
|
|
10035
10035
|
const p = (h) => `${h}-${Math.random().toString(36).substring(2, 15)}`, _ = (h) => {
|
|
10036
10036
|
const S = h ?? n.value ?? [];
|
|
10037
|
-
l.value = S.map((
|
|
10037
|
+
l.value = S.map((C, I) => ({
|
|
10038
10038
|
id: l.value[I]?.id ?? p("text-array"),
|
|
10039
|
-
value:
|
|
10039
|
+
value: C ?? ""
|
|
10040
10040
|
}));
|
|
10041
10041
|
};
|
|
10042
10042
|
_(), ge(
|
|
@@ -10068,13 +10068,13 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10068
10068
|
}
|
|
10069
10069
|
function x(h) {
|
|
10070
10070
|
if (a.value || o.value === null || o.value === h) return;
|
|
10071
|
-
const S = [...l.value], [
|
|
10072
|
-
S.splice(h, 0,
|
|
10071
|
+
const S = [...l.value], [C] = S.splice(o.value, 1);
|
|
10072
|
+
S.splice(h, 0, C), l.value = S, o.value = null;
|
|
10073
10073
|
}
|
|
10074
10074
|
return (h, S) => (u(), v("div", fv, [
|
|
10075
10075
|
d("div", mv, [
|
|
10076
|
-
(u(!0), v(Le, null, Be(l.value, (
|
|
10077
|
-
key:
|
|
10076
|
+
(u(!0), v(Le, null, Be(l.value, (C, I) => (u(), v("div", {
|
|
10077
|
+
key: C.id,
|
|
10078
10078
|
class: se(["flex items-center gap-2 w-full", { "opacity-50": o.value === I }]),
|
|
10079
10079
|
draggable: "true",
|
|
10080
10080
|
onDragstart: (D) => m(I),
|
|
@@ -10092,29 +10092,29 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10092
10092
|
d("div", yv, [
|
|
10093
10093
|
h.inputType === "text" ? (u(), xe(Ln, {
|
|
10094
10094
|
key: 0,
|
|
10095
|
-
modelValue:
|
|
10096
|
-
"onUpdate:modelValue": (D) =>
|
|
10095
|
+
modelValue: C.value,
|
|
10096
|
+
"onUpdate:modelValue": (D) => C.value = D,
|
|
10097
10097
|
disabled: a.value,
|
|
10098
10098
|
placeholder: i.value
|
|
10099
10099
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
10100
10100
|
h.inputType === "tel" ? (u(), xe(ja, {
|
|
10101
10101
|
key: 1,
|
|
10102
|
-
modelValue:
|
|
10103
|
-
"onUpdate:modelValue": (D) =>
|
|
10102
|
+
modelValue: C.value,
|
|
10103
|
+
"onUpdate:modelValue": (D) => C.value = D,
|
|
10104
10104
|
disabled: a.value,
|
|
10105
10105
|
placeholder: i.value
|
|
10106
10106
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
10107
10107
|
h.inputType === "email" ? (u(), xe(Na, {
|
|
10108
10108
|
key: 2,
|
|
10109
|
-
modelValue:
|
|
10110
|
-
"onUpdate:modelValue": (D) =>
|
|
10109
|
+
modelValue: C.value,
|
|
10110
|
+
"onUpdate:modelValue": (D) => C.value = D,
|
|
10111
10111
|
disabled: a.value,
|
|
10112
10112
|
placeholder: i.value
|
|
10113
10113
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
10114
10114
|
h.inputType === "mask" ? (u(), xe(Nl, {
|
|
10115
10115
|
key: 3,
|
|
10116
|
-
modelValue:
|
|
10117
|
-
"onUpdate:modelValue": (D) =>
|
|
10116
|
+
modelValue: C.value,
|
|
10117
|
+
"onUpdate:modelValue": (D) => C.value = D,
|
|
10118
10118
|
mask: h.mask,
|
|
10119
10119
|
disabled: a.value,
|
|
10120
10120
|
placeholder: i.value
|
|
@@ -10122,7 +10122,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10122
10122
|
]),
|
|
10123
10123
|
d("button", {
|
|
10124
10124
|
type: "button",
|
|
10125
|
-
onClick: (D) => w(
|
|
10125
|
+
onClick: (D) => w(C.id),
|
|
10126
10126
|
disabled: a.value,
|
|
10127
10127
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"
|
|
10128
10128
|
}, [
|
|
@@ -10287,17 +10287,17 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10287
10287
|
},
|
|
10288
10288
|
lazy: !1
|
|
10289
10289
|
}), p.value[h].on("accept", () => {
|
|
10290
|
-
const
|
|
10291
|
-
|
|
10290
|
+
const C = [...a.value || []];
|
|
10291
|
+
C[h] = t.unmask ? p.value[h].unmaskedValue : p.value[h].value, a.value = C;
|
|
10292
10292
|
}), p.value[h].on("complete", () => {
|
|
10293
|
-
const
|
|
10294
|
-
|
|
10293
|
+
const C = [...a.value || []];
|
|
10294
|
+
C[h] = t.unmask ? p.value[h].unmaskedValue : p.value[h].value, a.value = C;
|
|
10295
10295
|
}), a.value?.[h] && (p.value[h].value = a.value[h]);
|
|
10296
10296
|
}
|
|
10297
10297
|
function b(x, h) {
|
|
10298
10298
|
if (i.value) return;
|
|
10299
|
-
const S = x.target.value ?? null,
|
|
10300
|
-
|
|
10299
|
+
const S = x.target.value ?? null, C = [...a.value];
|
|
10300
|
+
C[h] = t.inputType === "text" ? S : Number(S), a.value = C;
|
|
10301
10301
|
}
|
|
10302
10302
|
function w() {
|
|
10303
10303
|
n.value += 1;
|
|
@@ -10309,11 +10309,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10309
10309
|
}
|
|
10310
10310
|
function m(x) {
|
|
10311
10311
|
if (n.value > 1) {
|
|
10312
|
-
p.value[x] && (p.value[x].destroy(), delete p.value[x]), n.value -= 1, a.value = a.value.filter((S,
|
|
10312
|
+
p.value[x] && (p.value[x].destroy(), delete p.value[x]), n.value -= 1, a.value = a.value.filter((S, C) => C !== x);
|
|
10313
10313
|
const h = {};
|
|
10314
10314
|
Object.keys(p.value).forEach((S) => {
|
|
10315
|
-
const
|
|
10316
|
-
|
|
10315
|
+
const C = parseInt(S, 10);
|
|
10316
|
+
C > x ? h[C - 1] = p.value[C] : C < x && (h[C] = p.value[C]);
|
|
10317
10317
|
}), p.value = h;
|
|
10318
10318
|
}
|
|
10319
10319
|
}
|
|
@@ -10351,7 +10351,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10351
10351
|
key: 0,
|
|
10352
10352
|
type: "text",
|
|
10353
10353
|
ref_for: !0,
|
|
10354
|
-
ref: (
|
|
10354
|
+
ref: (C) => _(C, S - 1),
|
|
10355
10355
|
placeholder: x.placeholder,
|
|
10356
10356
|
disabled: x.disabled,
|
|
10357
10357
|
name: `${x.name}[${S - 1}]`,
|
|
@@ -10363,7 +10363,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10363
10363
|
key: 1,
|
|
10364
10364
|
type: x.inputType,
|
|
10365
10365
|
value: a.value?.[S - 1],
|
|
10366
|
-
onInput: (
|
|
10366
|
+
onInput: (C) => b(C, S - 1),
|
|
10367
10367
|
placeholder: s.value,
|
|
10368
10368
|
disabled: i.value,
|
|
10369
10369
|
class: se(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [U(o), { "!border-red-600": x.error }]]),
|
|
@@ -10382,7 +10382,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10382
10382
|
!x.disabled && n.value > 1 && x.isAdded ? (u(), v("button", {
|
|
10383
10383
|
key: 3,
|
|
10384
10384
|
type: "button",
|
|
10385
|
-
onClick: Fe((
|
|
10385
|
+
onClick: Fe((C) => m(S - 1), ["stop"]),
|
|
10386
10386
|
class: "cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"
|
|
10387
10387
|
}, [
|
|
10388
10388
|
Z(U($t), { class: "h-4 w-4" })
|
|
@@ -10426,7 +10426,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10426
10426
|
emits: /* @__PURE__ */ ze(["change", "update:modelValue", "value-selected"], ["update:modelValue"]),
|
|
10427
10427
|
setup(e, { emit: t }) {
|
|
10428
10428
|
const n = e, l = t, o = Ke(e, "modelValue"), a = A([]), i = A(n.options ?? []), s = A({}), c = A({}), p = A({ keyword: "", parent: null }), _ = A(""), $ = A(!1), b = A(null), w = A(null), m = A(null), x = A(null), h = A(null), S = A({});
|
|
10429
|
-
let
|
|
10429
|
+
let C = !1, I = !1;
|
|
10430
10430
|
const D = ot("values"), q = y(() => !!n.disabled), G = y(() => n.placeholder ?? "Оберіть значення"), R = y(() => n.search !== !1), T = y(() => {
|
|
10431
10431
|
const k = n.parent ?? n.parentValue;
|
|
10432
10432
|
return k ? String(k) : "";
|
|
@@ -10450,7 +10450,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10450
10450
|
const k = n.prefix ?? "api", V = n.api ?? `/${k}/suggest/${n.data}`;
|
|
10451
10451
|
return `${n.host ?? ""}${V}`;
|
|
10452
10452
|
}, le = () => {
|
|
10453
|
-
a.value.length && (
|
|
10453
|
+
a.value.length && (C = !0, a.value = a.value.map((k) => ({
|
|
10454
10454
|
...k,
|
|
10455
10455
|
text: s.value[F(k.id)] ?? k.text
|
|
10456
10456
|
})));
|
|
@@ -10631,11 +10631,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10631
10631
|
text: s.value[F(fe)] ?? String(fe),
|
|
10632
10632
|
key: me(fe)
|
|
10633
10633
|
}));
|
|
10634
|
-
|
|
10634
|
+
C = !0, a.value = P;
|
|
10635
10635
|
};
|
|
10636
10636
|
ge(a, (k) => {
|
|
10637
|
-
if (
|
|
10638
|
-
|
|
10637
|
+
if (C) {
|
|
10638
|
+
C = !1;
|
|
10639
10639
|
return;
|
|
10640
10640
|
}
|
|
10641
10641
|
const V = k.map((P) => P.id);
|
|
@@ -10870,7 +10870,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10870
10870
|
});
|
|
10871
10871
|
y(() => h.value ? "1" : "0");
|
|
10872
10872
|
const S = ot("values");
|
|
10873
|
-
function
|
|
10873
|
+
function C() {
|
|
10874
10874
|
!w.value && s.value.trim() && I();
|
|
10875
10875
|
}
|
|
10876
10876
|
async function I() {
|
|
@@ -10923,7 +10923,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
10923
10923
|
disabled: w.value,
|
|
10924
10924
|
class: se(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500", [U(a), { "!border-red-600": l.error }]]),
|
|
10925
10925
|
style: { border: "1px solid #CFD9E0" },
|
|
10926
|
-
onKeydown: Ro(Fe(
|
|
10926
|
+
onKeydown: Ro(Fe(C, ["prevent"]), ["enter"])
|
|
10927
10927
|
}, null, 42, Jv), [
|
|
10928
10928
|
[st, s.value]
|
|
10929
10929
|
]),
|
|
@@ -11006,8 +11006,8 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11006
11006
|
const t = e, n = Ke(e, "modelValue"), l = y(() => Array.isArray(n.value) ? n.value : []), o = A([]), a = y(() => t.schema?.map((h) => ({
|
|
11007
11007
|
...h,
|
|
11008
11008
|
disabled: t.disabled || h.disabled
|
|
11009
|
-
})) ?? []), i = y(() => a.value.map((h) => x(h))), s = y(() => a.value.reduce((S,
|
|
11010
|
-
const I = Number(
|
|
11009
|
+
})) ?? []), i = y(() => a.value.map((h) => x(h))), s = y(() => a.value.reduce((S, C) => {
|
|
11010
|
+
const I = Number(C?.col ?? 12);
|
|
11011
11011
|
return S + (Number.isFinite(I) && I > 0 ? I : 12);
|
|
11012
11012
|
}, 0) > 12), c = y(() => t.disabled ? !1 : t.maxItems ? l.value.length < t.maxItems : !0), p = y(() => t.disabled || l.value.length <= (t.minItems || 0));
|
|
11013
11013
|
ge(() => l.value.length, () => {
|
|
@@ -11032,7 +11032,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11032
11032
|
c.value && (n.value = [...l.value, b()], _());
|
|
11033
11033
|
}
|
|
11034
11034
|
function m(h) {
|
|
11035
|
-
p.value || (n.value = l.value.filter((S,
|
|
11035
|
+
p.value || (n.value = l.value.filter((S, C) => C !== h), _(), $());
|
|
11036
11036
|
}
|
|
11037
11037
|
function x(h) {
|
|
11038
11038
|
return {
|
|
@@ -11041,7 +11041,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11041
11041
|
}
|
|
11042
11042
|
return (h, S) => (u(), v("div", rg, [
|
|
11043
11043
|
d("div", sg, [
|
|
11044
|
-
(u(!0), v(Le, null, Be(l.value, (
|
|
11044
|
+
(u(!0), v(Le, null, Be(l.value, (C, I) => (u(), v("div", {
|
|
11045
11045
|
key: o.value[I],
|
|
11046
11046
|
class: se(["flex items-center gap-3 rounded-lg transition-colors", {
|
|
11047
11047
|
"border border-gray-300 p-2": s.value
|
|
@@ -11114,11 +11114,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11114
11114
|
disabled: t.disabled || O.disabled
|
|
11115
11115
|
})) ?? []), b = y(() => $.value.map((O) => N(O))), w = y(() => t.view === "accordion"), m = y(() => !!(t.collapsible || w.value)), x = y(() => t.draggable !== !1), h = y(() => t.disabled ? !1 : t.maxGroups ? n.value.length < t.maxGroups : !0), S = y(() => t.disabled || n.value.length <= (t.minGroups || 0));
|
|
11116
11116
|
ge(() => n.value.length, () => {
|
|
11117
|
-
|
|
11117
|
+
C(), I(), D();
|
|
11118
11118
|
}, { immediate: !0 }), ge(() => t.schema, D, { immediate: !0, deep: !0 }), ge(() => t.view, () => {
|
|
11119
11119
|
I();
|
|
11120
11120
|
}, { immediate: !0 });
|
|
11121
|
-
function
|
|
11121
|
+
function C() {
|
|
11122
11122
|
const O = n.value.length;
|
|
11123
11123
|
l.value.length < O ? l.value = [...l.value, ...Array.from({ length: O - l.value.length }, () => Wl())] : l.value.length > O && l.value.splice(O);
|
|
11124
11124
|
}
|
|
@@ -11138,10 +11138,10 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11138
11138
|
}), O;
|
|
11139
11139
|
}
|
|
11140
11140
|
function G() {
|
|
11141
|
-
h.value && (n.value = [...n.value, q()],
|
|
11141
|
+
h.value && (n.value = [...n.value, q()], C(), I());
|
|
11142
11142
|
}
|
|
11143
11143
|
function R(O) {
|
|
11144
|
-
S.value || (n.value = n.value.filter((ve, we) => we !== O),
|
|
11144
|
+
S.value || (n.value = n.value.filter((ve, we) => we !== O), C(), w.value ? a.value >= n.value.length && (a.value = n.value.length - 1) : o.value.splice(O, 1), D());
|
|
11145
11145
|
}
|
|
11146
11146
|
function T(O) {
|
|
11147
11147
|
if (t.disabled) return;
|
|
@@ -11150,7 +11150,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11150
11150
|
...n.value.slice(0, O + 1),
|
|
11151
11151
|
ve,
|
|
11152
11152
|
...n.value.slice(O + 1)
|
|
11153
|
-
],
|
|
11153
|
+
], C(), w.value ? a.value > O && (a.value += 1) : o.value.splice(O + 1, 0, o.value[O] ?? !1);
|
|
11154
11154
|
}
|
|
11155
11155
|
function N(O) {
|
|
11156
11156
|
return {
|
|
@@ -11352,7 +11352,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11352
11352
|
if (Array.from(document.styleSheets || []).some((R) => R?.href?.includes(D))) return;
|
|
11353
11353
|
const G = document.createElement("link");
|
|
11354
11354
|
G.rel = "stylesheet", G.href = D, document.head.appendChild(G);
|
|
11355
|
-
},
|
|
11355
|
+
}, C = (D) => {
|
|
11356
11356
|
if (m[on]?.[D]) return m[on][D];
|
|
11357
11357
|
m[on] ||= {};
|
|
11358
11358
|
const q = Array.from(document.scripts).find((G) => G.src === D);
|
|
@@ -11372,7 +11372,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11372
11372
|
}, T.onerror = (N) => R(N), document.body.appendChild(T);
|
|
11373
11373
|
}), m[on][D]);
|
|
11374
11374
|
}, I = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";
|
|
11375
|
-
return S(`${I}/editor/editor.main.min.css`), await
|
|
11375
|
+
return S(`${I}/editor/editor.main.min.css`), await C(`${I}/loader.min.js`), m[Xn] || (m[Xn] = new Promise((D, q) => {
|
|
11376
11376
|
window.require.config({
|
|
11377
11377
|
paths: { vs: I }
|
|
11378
11378
|
}), window.require(
|
|
@@ -11629,7 +11629,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11629
11629
|
const ye = J[Y];
|
|
11630
11630
|
ye != null && (Q[Y] = ye);
|
|
11631
11631
|
}), Q;
|
|
11632
|
-
}),
|
|
11632
|
+
}), C = (J) => {
|
|
11633
11633
|
const ne = typeof J == "object" && J !== null ? J : { value: J };
|
|
11634
11634
|
o("value-selected", {
|
|
11635
11635
|
...ne,
|
|
@@ -11741,7 +11741,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11741
11741
|
(u(), xe(xt(_.value), nn(S.value, {
|
|
11742
11742
|
modelValue: l.value,
|
|
11743
11743
|
"onUpdate:modelValue": ne[0] || (ne[0] = (le) => l.value = le),
|
|
11744
|
-
onValueSelected:
|
|
11744
|
+
onValueSelected: C
|
|
11745
11745
|
}), null, 16, ["modelValue"]))
|
|
11746
11746
|
]),
|
|
11747
11747
|
G.value ? (u(), v("button", {
|
|
@@ -11793,7 +11793,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11793
11793
|
return { width: me, minWidth: me };
|
|
11794
11794
|
});
|
|
11795
11795
|
let p = null, _ = 0, $ = 0, b = null, w = null, m = null;
|
|
11796
|
-
const x = () => N(), h = () =>
|
|
11796
|
+
const x = () => N(), h = () => C();
|
|
11797
11797
|
ge(
|
|
11798
11798
|
() => n.target,
|
|
11799
11799
|
async (X) => {
|
|
@@ -11801,7 +11801,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11801
11801
|
b = null, l.value = [], o.value = "";
|
|
11802
11802
|
return;
|
|
11803
11803
|
}
|
|
11804
|
-
b = X, i.value && (await Qe(), q(X),
|
|
11804
|
+
b = X, i.value && (await Qe(), q(X), C());
|
|
11805
11805
|
},
|
|
11806
11806
|
{ immediate: !0 }
|
|
11807
11807
|
), ge(
|
|
@@ -11811,11 +11811,11 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11811
11811
|
w = X ?? null;
|
|
11812
11812
|
return;
|
|
11813
11813
|
}
|
|
11814
|
-
S(X ?? null), Qe(() =>
|
|
11814
|
+
S(X ?? null), Qe(() => C());
|
|
11815
11815
|
},
|
|
11816
11816
|
{ immediate: !0 }
|
|
11817
11817
|
), rt(() => {
|
|
11818
|
-
n.scrollContainer || S(null),
|
|
11818
|
+
n.scrollContainer || S(null), C();
|
|
11819
11819
|
}), It(() => {
|
|
11820
11820
|
G(), S(null, !0), b = null, typeof window < "u" && (_ && window.cancelAnimationFrame(_), $ && window.cancelAnimationFrame($));
|
|
11821
11821
|
});
|
|
@@ -11830,7 +11830,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11830
11830
|
_e.removeEventListener("scroll", x), J.removeEventListener("resize", h);
|
|
11831
11831
|
};
|
|
11832
11832
|
}
|
|
11833
|
-
function
|
|
11833
|
+
function C() {
|
|
11834
11834
|
if (!i.value || !b) return;
|
|
11835
11835
|
_ && typeof window < "u" && window.cancelAnimationFrame(_);
|
|
11836
11836
|
const X = () => {
|
|
@@ -11860,7 +11860,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11860
11860
|
return X.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
11861
11861
|
}
|
|
11862
11862
|
function q(X) {
|
|
11863
|
-
!X || !i.value || typeof MutationObserver > "u" || (G(), p = new MutationObserver(() =>
|
|
11863
|
+
!X || !i.value || typeof MutationObserver > "u" || (G(), p = new MutationObserver(() => C()), p.observe(X, { childList: !0, subtree: !0 }));
|
|
11864
11864
|
}
|
|
11865
11865
|
function G() {
|
|
11866
11866
|
p && (p.disconnect(), p = null);
|
|
@@ -11899,7 +11899,7 @@ const Of = { class: "vs-map-body" }, Bf = {
|
|
|
11899
11899
|
const _e = w, J = Math.max(0, R(me));
|
|
11900
11900
|
_e ? _e.scrollTo({ top: J, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: J, behavior: "smooth" });
|
|
11901
11901
|
}
|
|
11902
|
-
return t({ refresh:
|
|
11902
|
+
return t({ refresh: C }), (X, me) => i.value && l.value.length ? (u(), v("div", {
|
|
11903
11903
|
key: 0,
|
|
11904
11904
|
class: se(s.value),
|
|
11905
11905
|
style: Oe(c.value)
|
|
@@ -12081,14 +12081,14 @@ function Zg(e, t, n = !1) {
|
|
|
12081
12081
|
field: b.maxField,
|
|
12082
12082
|
message: b.maxFieldMessage
|
|
12083
12083
|
});
|
|
12084
|
-
const
|
|
12085
|
-
if (!
|
|
12084
|
+
const C = [...w, ...b.rules || []];
|
|
12085
|
+
if (!C.length) return;
|
|
12086
12086
|
if (!a(b)) {
|
|
12087
12087
|
delete o.value[b.name];
|
|
12088
12088
|
return;
|
|
12089
12089
|
}
|
|
12090
12090
|
let I = !1, D = null;
|
|
12091
|
-
|
|
12091
|
+
C.forEach((q) => {
|
|
12092
12092
|
const G = Gg(e.value[b.name], q, e.value);
|
|
12093
12093
|
G && (I = !0, !D && typeof G == "string" && (D = G));
|
|
12094
12094
|
}), I && D ? o.value[b.name] = D : delete o.value[b.name];
|
|
@@ -12156,7 +12156,7 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12156
12156
|
validate: $,
|
|
12157
12157
|
reset: b,
|
|
12158
12158
|
visibleSchema: w
|
|
12159
|
-
} = Zg(p, o.schema, No(o, "disabled")), m = A(null), x = A(null), h = A({}), S = y(() => o.navigation),
|
|
12159
|
+
} = Zg(p, o.schema, No(o, "disabled")), m = A(null), x = A(null), h = A({}), S = y(() => o.navigation), C = y(() => o.navWidth), I = y(() => o.style?.columns), D = Object.freeze({ container: 12, label: 3 }), q = y(() => o.columns ?? I.value ?? D), G = y(() => o.columns != null || I.value != null), R = y(() => G.value ? "horizontal" : o.layout), T = (le) => le?.columns ? "horizontal" : R.value, N = (le) => le?.columns ?? q.value, F = y(() => {
|
|
12160
12160
|
const le = {}, Q = (Y) => {
|
|
12161
12161
|
if (!Y) return;
|
|
12162
12162
|
(Array.isArray(Y) ? Y.map((pe, E) => ({ key: String(E), entry: pe })) : typeof Y == "object" ? Object.entries(Y).map(([pe, E]) => ({ key: pe, entry: E })) : []).forEach(({ key: pe, entry: E }) => {
|
|
@@ -12247,7 +12247,7 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12247
12247
|
target: m.value,
|
|
12248
12248
|
"scroll-container": x.value,
|
|
12249
12249
|
enabled: S.value,
|
|
12250
|
-
width:
|
|
12250
|
+
width: C.value
|
|
12251
12251
|
}, null, 8, ["target", "scroll-container", "enabled", "width"])
|
|
12252
12252
|
]));
|
|
12253
12253
|
}
|
|
@@ -12284,12 +12284,12 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12284
12284
|
await h.json().catch(() => ({})), $(), l("save", a.value);
|
|
12285
12285
|
return;
|
|
12286
12286
|
}
|
|
12287
|
-
const S = await h.json().catch(() => ({})),
|
|
12287
|
+
const S = await h.json().catch(() => ({})), C = S.message || S.error;
|
|
12288
12288
|
if (h.status === 400) {
|
|
12289
12289
|
Ie({
|
|
12290
12290
|
type: "warning",
|
|
12291
12291
|
title: "Помилка валідації",
|
|
12292
|
-
message:
|
|
12292
|
+
message: C || "Некоректні дані (400)"
|
|
12293
12293
|
});
|
|
12294
12294
|
return;
|
|
12295
12295
|
}
|
|
@@ -12297,7 +12297,7 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12297
12297
|
Ie({
|
|
12298
12298
|
type: "warning",
|
|
12299
12299
|
title: "Доступ заборонено",
|
|
12300
|
-
message:
|
|
12300
|
+
message: C || "Доступ заборонено (403)"
|
|
12301
12301
|
});
|
|
12302
12302
|
return;
|
|
12303
12303
|
}
|
|
@@ -12305,14 +12305,14 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12305
12305
|
Ie({
|
|
12306
12306
|
type: "error",
|
|
12307
12307
|
title: "Серверна помилка",
|
|
12308
|
-
message:
|
|
12308
|
+
message: C || "Виникла помилка на сервері (500)"
|
|
12309
12309
|
});
|
|
12310
12310
|
return;
|
|
12311
12311
|
}
|
|
12312
12312
|
Ie({
|
|
12313
12313
|
type: "error",
|
|
12314
12314
|
title: "Помилка",
|
|
12315
|
-
message: `Статус: ${h.status}`
|
|
12315
|
+
message: C || `Статус: ${h.status}`
|
|
12316
12316
|
});
|
|
12317
12317
|
};
|
|
12318
12318
|
async function m() {
|
|
@@ -12321,7 +12321,7 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12321
12321
|
Ie({
|
|
12322
12322
|
type: "warning",
|
|
12323
12323
|
title: "Помилка валідації",
|
|
12324
|
-
message: Object.entries(h).map(([
|
|
12324
|
+
message: Object.entries(h).map(([C, I]) => `${C}: ${I}`).join(`
|
|
12325
12325
|
`)
|
|
12326
12326
|
});
|
|
12327
12327
|
return;
|
|
@@ -12329,14 +12329,14 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12329
12329
|
p.value === "add" && a.value && delete a.value.id;
|
|
12330
12330
|
const S = n.api?.trim();
|
|
12331
12331
|
if (S) {
|
|
12332
|
-
const
|
|
12332
|
+
const C = _();
|
|
12333
12333
|
try {
|
|
12334
12334
|
const I = await fetch(S, {
|
|
12335
|
-
method:
|
|
12336
|
-
headers:
|
|
12335
|
+
method: C,
|
|
12336
|
+
headers: C === "GET" ? void 0 : {
|
|
12337
12337
|
"Content-Type": "application/json"
|
|
12338
12338
|
},
|
|
12339
|
-
body:
|
|
12339
|
+
body: C === "GET" ? void 0 : JSON.stringify(a.value)
|
|
12340
12340
|
});
|
|
12341
12341
|
await w(I);
|
|
12342
12342
|
} catch (I) {
|
|
@@ -12350,19 +12350,19 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12350
12350
|
}
|
|
12351
12351
|
if (s.value)
|
|
12352
12352
|
try {
|
|
12353
|
-
const
|
|
12353
|
+
const C = await fetch(`/api/table/${s.value}`, {
|
|
12354
12354
|
method: p.value === "add" ? "POST" : "PUT",
|
|
12355
12355
|
headers: {
|
|
12356
12356
|
"Content-Type": "application/json"
|
|
12357
12357
|
},
|
|
12358
12358
|
body: JSON.stringify(a.value)
|
|
12359
12359
|
});
|
|
12360
|
-
await w(
|
|
12361
|
-
} catch (
|
|
12360
|
+
await w(C);
|
|
12361
|
+
} catch (C) {
|
|
12362
12362
|
Ie({
|
|
12363
12363
|
type: "error",
|
|
12364
12364
|
title: "Помилка з’єднання",
|
|
12365
|
-
message:
|
|
12365
|
+
message: C.message || "Не вдалося виконати запит"
|
|
12366
12366
|
});
|
|
12367
12367
|
}
|
|
12368
12368
|
else
|
|
@@ -12428,9 +12428,9 @@ const Jg = { class: "flex w-full h-full min-h-0 gap-6" }, Qg = {
|
|
|
12428
12428
|
key: 0,
|
|
12429
12429
|
schema: o.value,
|
|
12430
12430
|
values: a.value,
|
|
12431
|
-
"onUpdate:values": S[0] || (S[0] = (
|
|
12431
|
+
"onUpdate:values": S[0] || (S[0] = (C) => a.value = C),
|
|
12432
12432
|
form: i.value,
|
|
12433
|
-
"onUpdate:form": S[1] || (S[1] = (
|
|
12433
|
+
"onUpdate:form": S[1] || (S[1] = (C) => i.value = C),
|
|
12434
12434
|
formId: c.value
|
|
12435
12435
|
}, null, 8, ["schema", "values", "form", "formId"])) : K("", !0)
|
|
12436
12436
|
]),
|