@opengis/form 0.0.177 → 0.0.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-LstU-_u3.js → index-CxZMljtW.js} +515 -515
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +8 -8
- package/dist/src/components/inputs/select/vs-select-control.vue.d.ts.map +1 -1
- package/dist/src/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -1
- package/dist/src/components/inputs/vs-input-select.vue.d.ts.map +1 -1
- package/dist/{vs-richtext-DP5WJJ4Y.js → vs-richtext-B0plt4Ru.js} +1 -1
- package/package.json +1 -1
|
@@ -124,8 +124,8 @@ const xa = /* @__PURE__ */ ge({
|
|
|
124
124
|
}, r = y(() => {
|
|
125
125
|
const S = t.item?.__autoMeta;
|
|
126
126
|
if (!S || S?.source !== "parent-auto" || !S?.parentField) return "";
|
|
127
|
-
const $ = String(t.item?.__locale || "uk"),
|
|
128
|
-
return `${o[$] || o.uk}: ${
|
|
127
|
+
const $ = String(t.item?.__locale || "uk"), v = String(S.parentField), h = l?.value?.[v], g = h?.[`label:${$}`] || ($ !== "uk" ? h?.[$] : void 0) || h?.label || h?.ua || h?.en || v;
|
|
128
|
+
return `${o[$] || o.uk}: ${g}`;
|
|
129
129
|
}), s = y(() => t.columns ?? { container: 12, label: 3 }), f = y(() => {
|
|
130
130
|
const { container: S, label: $ } = s.value;
|
|
131
131
|
return !S || S <= 0 ? 0 : Math.min(Math.max($ ?? 0, 0), S) / S;
|
|
@@ -138,9 +138,9 @@ const xa = /* @__PURE__ */ ge({
|
|
|
138
138
|
if (!S || S <= 0) return {};
|
|
139
139
|
if (t.item?.type === "html") return { flexBasis: "100%", maxWidth: "100%" };
|
|
140
140
|
if (!c.value) return { flexBasis: "100%", maxWidth: "100%" };
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const h = `${
|
|
141
|
+
const v = Math.max(S - Math.max($ ?? 0, 0), 0) / S;
|
|
142
|
+
if (!v) return {};
|
|
143
|
+
const h = `${v * 100}%`;
|
|
144
144
|
return { flexBasis: h, maxWidth: h };
|
|
145
145
|
});
|
|
146
146
|
return (S, $) => (u(), m("div", Eo, [
|
|
@@ -436,11 +436,11 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
436
436
|
maskPosition: "center"
|
|
437
437
|
};
|
|
438
438
|
});
|
|
439
|
-
return ($,
|
|
439
|
+
return ($, v) => (u(), m("div", nr, [
|
|
440
440
|
Pe(d("input", {
|
|
441
441
|
type: "checkbox",
|
|
442
442
|
value: $.value,
|
|
443
|
-
"onUpdate:modelValue":
|
|
443
|
+
"onUpdate:modelValue": v[0] || (v[0] = (h) => l.value = h),
|
|
444
444
|
class: re(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": o.value }]),
|
|
445
445
|
id: $.id,
|
|
446
446
|
disabled: o.value
|
|
@@ -521,7 +521,7 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
521
521
|
icon: n.option?.icon ?? n.icon,
|
|
522
522
|
imgUrl: n.option?.imgUrl ?? n.imgUrl,
|
|
523
523
|
color: n.option?.color
|
|
524
|
-
})), f = y(() => wn(s.value)), c = y(() => xn(s.value)), w = y(() => Zt(s.value)), x = y(() => !!(w.value && !f.value && !c.value)), S = y(() => !!(f.value && w.value)), $ = y(() => w.value ? { color: w.value } : void 0),
|
|
524
|
+
})), f = y(() => wn(s.value)), c = y(() => xn(s.value)), w = y(() => Zt(s.value)), x = y(() => !!(w.value && !f.value && !c.value)), S = y(() => !!(f.value && w.value)), $ = y(() => w.value ? { color: w.value } : void 0), v = y(() => {
|
|
525
525
|
if (!(!f.value || !w.value))
|
|
526
526
|
return {
|
|
527
527
|
backgroundColor: w.value,
|
|
@@ -535,7 +535,7 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
535
535
|
maskPosition: "center"
|
|
536
536
|
};
|
|
537
537
|
});
|
|
538
|
-
return (h,
|
|
538
|
+
return (h, g) => (u(), m("label", {
|
|
539
539
|
class: re(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, o.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
540
540
|
}, [
|
|
541
541
|
Pe(d("input", {
|
|
@@ -543,7 +543,7 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
543
543
|
class: "hidden",
|
|
544
544
|
name: h.id,
|
|
545
545
|
value: h.value,
|
|
546
|
-
"onUpdate:modelValue":
|
|
546
|
+
"onUpdate:modelValue": g[0] || (g[0] = (M) => l.value = M),
|
|
547
547
|
disabled: h.disabled
|
|
548
548
|
}, null, 8, ur), [
|
|
549
549
|
[pa, l.value]
|
|
@@ -561,7 +561,7 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
561
561
|
S.value ? (u(), m("span", {
|
|
562
562
|
key: 1,
|
|
563
563
|
class: "inline-block h-4 w-4",
|
|
564
|
-
style: Ee(
|
|
564
|
+
style: Ee(v.value)
|
|
565
565
|
}, null, 4)) : f.value || c.value ? (u(), m("span", pr, [
|
|
566
566
|
f.value ? (u(), m("img", {
|
|
567
567
|
key: 0,
|
|
@@ -743,8 +743,8 @@ const Zo = ["placeholder", "disabled"], Jo = /* @__PURE__ */ ge({
|
|
|
743
743
|
}, w = /* @__PURE__ */ new Set();
|
|
744
744
|
let x = !1;
|
|
745
745
|
for (let $ = 0; $ < f.length; $ += 1) {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const v = f[$];
|
|
747
|
+
v === "{" ? x = !0 : v === "}" ? x = !1 : x && w.add(v);
|
|
748
748
|
}
|
|
749
749
|
const S = {};
|
|
750
750
|
return Object.keys(c).forEach(($) => {
|
|
@@ -871,15 +871,15 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
871
871
|
}, S = /* @__PURE__ */ new Set();
|
|
872
872
|
let $ = !1;
|
|
873
873
|
for (let h = 0; h < w.length; h += 1) {
|
|
874
|
-
const
|
|
875
|
-
|
|
874
|
+
const g = w[h];
|
|
875
|
+
g === "{" ? $ = !0 : g === "}" ? $ = !1 : $ && S.add(g);
|
|
876
876
|
}
|
|
877
|
-
const
|
|
877
|
+
const v = {};
|
|
878
878
|
return Object.keys(x).forEach((h) => {
|
|
879
|
-
S.has(h) || (
|
|
879
|
+
S.has(h) || (v[h] = x[h]);
|
|
880
880
|
}), {
|
|
881
881
|
mask: w,
|
|
882
|
-
definitions:
|
|
882
|
+
definitions: v,
|
|
883
883
|
lazy: !1,
|
|
884
884
|
disabled: t.disabled
|
|
885
885
|
};
|
|
@@ -1224,7 +1224,7 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
1224
1224
|
});
|
|
1225
1225
|
return ot(async () => {
|
|
1226
1226
|
await S();
|
|
1227
|
-
}), ($,
|
|
1227
|
+
}), ($, v) => (u(), m("div", {
|
|
1228
1228
|
class: re(f.value)
|
|
1229
1229
|
}, [
|
|
1230
1230
|
(u(!0), m(De, null, Ne(R(x), (h) => (u(), m("div", {
|
|
@@ -1240,7 +1240,7 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
1240
1240
|
checked: n.value?.toString?.() === h.id?.toString?.(),
|
|
1241
1241
|
"custom-class": $.position === "horizontal" ? "" : t.customClass,
|
|
1242
1242
|
modelValue: n.value,
|
|
1243
|
-
"onUpdate:modelValue":
|
|
1243
|
+
"onUpdate:modelValue": v[0] || (v[0] = (g) => n.value = g)
|
|
1244
1244
|
}, { ref_for: !0 }, $.$attrs), null, 16, ["text", "html", "option", "value", "checked", "custom-class", "modelValue"]))
|
|
1245
1245
|
], 6))), 128))
|
|
1246
1246
|
], 2));
|
|
@@ -1286,20 +1286,20 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
1286
1286
|
options: n.options
|
|
1287
1287
|
},
|
|
1288
1288
|
formValues: o
|
|
1289
|
-
}), f = y(() => r.value), c = (b) => b?.value || b?.id || b?.text || b, w = y(() => n.slot ?? n?.optionTemplate ?? ""), x = y(() => Gn(w.value)), S = (b) => Zn(b, w.value), $ = (b) => Jn(b, w.value),
|
|
1289
|
+
}), f = y(() => r.value), c = (b) => b?.value || b?.id || b?.text || b, w = y(() => n.slot ?? n?.optionTemplate ?? ""), x = y(() => Gn(w.value)), S = (b) => Zn(b, w.value), $ = (b) => Jn(b, w.value), v = (b) => `lg:col-span-${b || 12}`, h = y(() => [
|
|
1290
1290
|
n.position === "vertical" ? "flex flex-col" : "",
|
|
1291
1291
|
n.colSpan ? "grid" : "flex justify-start"
|
|
1292
|
-
]),
|
|
1292
|
+
]), g = (b) => b == null || b === "" ? null : typeof b == "string" || typeof b == "number" ? b : String(b), M = y(() => {
|
|
1293
1293
|
if (!n.group)
|
|
1294
1294
|
return [];
|
|
1295
1295
|
const b = /* @__PURE__ */ new Map();
|
|
1296
1296
|
f.value.forEach((N) => {
|
|
1297
|
-
const W = N[n.group], j =
|
|
1297
|
+
const W = N[n.group], j = g(W);
|
|
1298
1298
|
b.has(j) || b.set(j, []), b.get(j)?.push(N);
|
|
1299
1299
|
});
|
|
1300
1300
|
const C = [];
|
|
1301
1301
|
n.values?.length && n.values.forEach((N) => {
|
|
1302
|
-
const W =
|
|
1302
|
+
const W = g(N);
|
|
1303
1303
|
C.push(W);
|
|
1304
1304
|
});
|
|
1305
1305
|
const D = /* @__PURE__ */ new Set(), U = (N) => {
|
|
@@ -1377,7 +1377,7 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
1377
1377
|
modelValue: l[c(U)],
|
|
1378
1378
|
"onUpdate:modelValue": (X) => l[c(U)] = X,
|
|
1379
1379
|
value: c(U),
|
|
1380
|
-
class: re(
|
|
1380
|
+
class: re(v(b.colSpan)),
|
|
1381
1381
|
disabled: n.disabled || U.disabled,
|
|
1382
1382
|
label: $(U),
|
|
1383
1383
|
labelHtml: x.value ? S(U) : "",
|
|
@@ -1397,7 +1397,7 @@ const Sr = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "abso
|
|
|
1397
1397
|
modelValue: l[c(D)],
|
|
1398
1398
|
"onUpdate:modelValue": (U) => l[c(D)] = U,
|
|
1399
1399
|
value: c(D),
|
|
1400
|
-
class: re(
|
|
1400
|
+
class: re(v(b.colSpan)),
|
|
1401
1401
|
disabled: n.disabled || D.disabled,
|
|
1402
1402
|
label: $(D),
|
|
1403
1403
|
labelHtml: x.value ? S(D) : "",
|
|
@@ -1871,7 +1871,7 @@ const Ms = /* @__PURE__ */ Ze(Ss, [["render", Cs]]), Ls = ge({
|
|
|
1871
1871
|
setup(e, { emit: t }) {
|
|
1872
1872
|
const n = y(() => Ca(e.pageDate)), a = y(() => Ma(e.pageDate)), l = y(
|
|
1873
1873
|
() => (S) => gn(S, e.format)
|
|
1874
|
-
), o = (S, $,
|
|
1874
|
+
), o = (S, $, v) => !$ && !v ? !0 : !($ && hn(S, Ll($)) || v && bn(S, Vl(v))), r = y(() => as({
|
|
1875
1875
|
start: n.value,
|
|
1876
1876
|
end: a.value
|
|
1877
1877
|
}).map(
|
|
@@ -1982,7 +1982,7 @@ const As = /* @__PURE__ */ Ze(Ls, [["render", Vs]]), Ds = ge({
|
|
|
1982
1982
|
},
|
|
1983
1983
|
setup(e, { emit: t }) {
|
|
1984
1984
|
const n = y(
|
|
1985
|
-
() => (
|
|
1985
|
+
() => (g) => (M) => gn(M, g)
|
|
1986
1986
|
), a = y(() => Ll(e.pageDate)), l = y(() => Vl(e.pageDate)), o = y(() => ({
|
|
1987
1987
|
start: a.value,
|
|
1988
1988
|
end: l.value
|
|
@@ -1990,19 +1990,19 @@ const As = /* @__PURE__ */ Ze(Ls, [["render", Vs]]), Ds = ge({
|
|
|
1990
1990
|
start: Dl(a.value, e.weekStartsOn),
|
|
1991
1991
|
end: rs(l.value, e.weekStartsOn)
|
|
1992
1992
|
})), s = y(() => e.customWeekdays?.length === 7 ? e.customWeekdays : null), f = y(() => {
|
|
1993
|
-
const
|
|
1993
|
+
const g = e.weekStartsOn, M = s.value;
|
|
1994
1994
|
if (M)
|
|
1995
|
-
return Array.from({ length: 7 }).map((C, D) => M[(
|
|
1995
|
+
return Array.from({ length: 7 }).map((C, D) => M[(g + D) % 7]);
|
|
1996
1996
|
const b = n.value(e.weekdayFormat);
|
|
1997
|
-
return Array.from(Array(7)).map((C, D) => (
|
|
1998
|
-
}), c = (
|
|
1999
|
-
const
|
|
1997
|
+
return Array.from(Array(7)).map((C, D) => (g + D) % 7).map((C) => ss(/* @__PURE__ */ new Date(), C, e.weekStartsOn)).map(b);
|
|
1998
|
+
}), c = (g, M, b, C) => C?.dates?.some((D) => zn(g, D)) || C?.predicate?.(g) ? !1 : !M && !b ? !0 : !(M && hn(g, an(M)) || b && bn(g, kn(b))), w = y(() => {
|
|
1999
|
+
const g = /* @__PURE__ */ new Date(), M = n.value(e.format);
|
|
2000
2000
|
return ls(r.value).map(
|
|
2001
2001
|
(b) => ({
|
|
2002
2002
|
value: b,
|
|
2003
2003
|
display: M(b),
|
|
2004
2004
|
selected: !!e.selected && zn(e.selected, b),
|
|
2005
|
-
current: zn(
|
|
2005
|
+
current: zn(g, b),
|
|
2006
2006
|
disabled: !e.allowOutsideInterval && !us(b, o.value) || !c(
|
|
2007
2007
|
b,
|
|
2008
2008
|
e.lowerLimit,
|
|
@@ -2101,19 +2101,19 @@ const Ts = /* @__PURE__ */ Ze(Ds, [["render", Is]]), Fs = ge({
|
|
|
2101
2101
|
ye(
|
|
2102
2102
|
() => e.selected,
|
|
2103
2103
|
($) => {
|
|
2104
|
-
let
|
|
2105
|
-
$ && (
|
|
2104
|
+
let v = 0, h = 0;
|
|
2105
|
+
$ && (v = $.getHours(), h = $.getMinutes()), a.value = v, l.value = h;
|
|
2106
2106
|
}
|
|
2107
2107
|
);
|
|
2108
|
-
const o = ($,
|
|
2108
|
+
const o = ($, v) => {
|
|
2109
2109
|
const h = ps(new Date(n.value.getTime()), {
|
|
2110
2110
|
hours: $,
|
|
2111
|
-
minutes:
|
|
2111
|
+
minutes: v,
|
|
2112
2112
|
seconds: 0
|
|
2113
2113
|
});
|
|
2114
|
-
x(h) && (a.value = $, l.value =
|
|
2115
|
-
}, r = ($,
|
|
2116
|
-
(
|
|
2114
|
+
x(h) && (a.value = $, l.value = v, t("select", h));
|
|
2115
|
+
}, r = ($, v) => $ < 0 ? v : $ > v ? 0 : $, s = () => o(r(a.value + 1, 23), l.value), f = () => o(r(a.value - 1, 23), l.value), c = () => o(a.value, r(l.value + 1, 59)), w = () => o(a.value, r(l.value - 1, 59)), x = ($) => !(e.disabledTime?.dates?.some(
|
|
2116
|
+
(v) => La($, v) && is($, v)
|
|
2117
2117
|
) || e.disabledTime?.predicate?.($));
|
|
2118
2118
|
return {
|
|
2119
2119
|
hours: a,
|
|
@@ -2408,9 +2408,9 @@ const Ks = /* @__PURE__ */ Ze(Fs, [["render", qs]]), In = ["time", "day", "month
|
|
|
2408
2408
|
const ue = le.replace(/[a-zA-Z]/g, "0");
|
|
2409
2409
|
return /0/.test(ue) ? ue : "";
|
|
2410
2410
|
}, $ = y(() => S(e.inputFormat));
|
|
2411
|
-
let
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2411
|
+
let v = null, h = null;
|
|
2412
|
+
const g = () => {
|
|
2413
|
+
v?.destroy(), v = null;
|
|
2414
2414
|
}, M = async () => {
|
|
2415
2415
|
if (!h) {
|
|
2416
2416
|
const { default: le } = await import("./index-W-qQIppj.js");
|
|
@@ -2418,13 +2418,13 @@ const Ks = /* @__PURE__ */ Ze(Fs, [["render", qs]]), In = ["time", "day", "month
|
|
|
2418
2418
|
}
|
|
2419
2419
|
return h;
|
|
2420
2420
|
}, b = () => {
|
|
2421
|
-
|
|
2421
|
+
v && v.value !== x.value && (v.value = x.value ?? "");
|
|
2422
2422
|
}, C = (le) => {
|
|
2423
2423
|
const ue = le && ht(le) ? gn(le, e.inputFormat) : "";
|
|
2424
2424
|
x.value !== ue && (x.value = ue), b();
|
|
2425
2425
|
}, D = async () => {
|
|
2426
|
-
if (
|
|
2427
|
-
|
|
2426
|
+
if (g(), !o.value || !$.value) return;
|
|
2427
|
+
v = (await M())(o.value, {
|
|
2428
2428
|
mask: $.value,
|
|
2429
2429
|
lazy: !0,
|
|
2430
2430
|
overwrite: !1
|
|
@@ -2446,11 +2446,11 @@ const Ks = /* @__PURE__ */ Ze(Fs, [["render", qs]]), In = ["time", "day", "month
|
|
|
2446
2446
|
D();
|
|
2447
2447
|
});
|
|
2448
2448
|
}), It(() => {
|
|
2449
|
-
|
|
2449
|
+
g();
|
|
2450
2450
|
}), ye($, (le) => {
|
|
2451
2451
|
le ? tt(() => {
|
|
2452
2452
|
D();
|
|
2453
|
-
}) :
|
|
2453
|
+
}) : g();
|
|
2454
2454
|
});
|
|
2455
2455
|
const U = y(() => n.value !== "none"), X = y(() => e.startingView === "time" && e.minimumView === "time"), N = y(() => e.startingView === "day" && e.minimumView === "time"), W = (le) => {
|
|
2456
2456
|
e.disabled || (U.value || (a.value = e.modelValue || Ys(e.lowerLimit, e.upperLimit, a.value), t("opened")), n.value = le, tt(() => Je()));
|
|
@@ -2509,7 +2509,7 @@ const Ks = /* @__PURE__ */ Ze(Fs, [["render", qs]]), In = ["time", "day", "month
|
|
|
2509
2509
|
return le < ue ? e.minimumView : e.startingView;
|
|
2510
2510
|
}), Ve = y(() => e.weekDayNames?.length === 7 ? e.weekDayNames : void 0), ae = () => e.startingView === "time" && e.minimumView === "time" ? null : W("day"), Ce = () => {
|
|
2511
2511
|
if (!o.value || !r.value) return;
|
|
2512
|
-
const le = 4, ue = 8, Me = o.value.getBoundingClientRect(), Fe = r.value.getBoundingClientRect(), ct = r.value.firstElementChild?.getBoundingClientRect(), T = window.innerWidth, Q = window.innerHeight, ce = window.scrollX || window.pageXOffset,
|
|
2512
|
+
const le = 4, ue = 8, Me = o.value.getBoundingClientRect(), Fe = r.value.getBoundingClientRect(), ct = r.value.firstElementChild?.getBoundingClientRect(), T = window.innerWidth, Q = window.innerHeight, ce = window.scrollX || window.pageXOffset, be = window.scrollY || window.pageYOffset, Se = Math.max(160, Q - ue * 2), ze = Math.min(Fe.height || 0, Se), Ye = Q - Me.bottom - le - ue, We = Me.top - le - ue, O = Ye < ze && We > Ye;
|
|
2513
2513
|
let _ = O ? Me.top - le - ze : Me.bottom + le;
|
|
2514
2514
|
_ = Math.max(ue, Math.min(_, Q - ue - ze));
|
|
2515
2515
|
const A = ct?.width || Fe.width || 268;
|
|
@@ -2518,7 +2518,7 @@ const Ks = /* @__PURE__ */ Ze(Fs, [["render", qs]]), In = ["time", "day", "month
|
|
|
2518
2518
|
const fe = O ? Math.max(120, Me.top - le - ue) : Math.max(120, Q - Me.bottom - le - ue);
|
|
2519
2519
|
s.value = {
|
|
2520
2520
|
position: "absolute",
|
|
2521
|
-
top: `${Math.round(_ +
|
|
2521
|
+
top: `${Math.round(_ + be)}px`,
|
|
2522
2522
|
left: `${Math.round(F + ce)}px`,
|
|
2523
2523
|
maxHeight: `${Math.round(Math.min(Se, fe))}px`,
|
|
2524
2524
|
overflowX: "hidden",
|
|
@@ -2778,7 +2778,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
2778
2778
|
default:
|
|
2779
2779
|
return { startingView: "day", minimumView: "day" };
|
|
2780
2780
|
}
|
|
2781
|
-
}),
|
|
2781
|
+
}), v = {
|
|
2782
2782
|
date: "dd.MM.yyyy",
|
|
2783
2783
|
datetime: "dd.MM.yyyy HH:mm",
|
|
2784
2784
|
month: "MM.yyyy",
|
|
@@ -2798,7 +2798,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
2798
2798
|
}
|
|
2799
2799
|
return "uk";
|
|
2800
2800
|
}
|
|
2801
|
-
function
|
|
2801
|
+
function g() {
|
|
2802
2802
|
const K = o?.appContext?.config?.globalProperties?.$settings?.dateFormat;
|
|
2803
2803
|
if (!K) return "";
|
|
2804
2804
|
if (typeof K == "string") return K;
|
|
@@ -2812,9 +2812,9 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
2812
2812
|
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") : "";
|
|
2813
2813
|
}
|
|
2814
2814
|
const b = y(() => {
|
|
2815
|
-
const E =
|
|
2815
|
+
const E = v[r.value] || "dd.MM.yyyy";
|
|
2816
2816
|
if (r.value === "time") return E;
|
|
2817
|
-
const K = n.dateFormat ||
|
|
2817
|
+
const K = n.dateFormat || g();
|
|
2818
2818
|
if (!K) return E;
|
|
2819
2819
|
const pe = M(K);
|
|
2820
2820
|
return pe ? r.value === "datetime" ? `${pe} HH:mm` : pe : E;
|
|
@@ -3166,7 +3166,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3166
3166
|
api: n.api,
|
|
3167
3167
|
customParams: Object.keys(b).length ? b : void 0
|
|
3168
3168
|
};
|
|
3169
|
-
},
|
|
3169
|
+
}, v = () => {
|
|
3170
3170
|
const b = S.value.missingSources;
|
|
3171
3171
|
if (!b.length) return !0;
|
|
3172
3172
|
const C = b.join(", ");
|
|
@@ -3183,12 +3183,12 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3183
3183
|
message: b || "Не вдалося завантажити файл. Спробуйте ще раз.",
|
|
3184
3184
|
position: "right-bottom"
|
|
3185
3185
|
});
|
|
3186
|
-
},
|
|
3187
|
-
n.disabled || s.value ||
|
|
3186
|
+
}, g = () => {
|
|
3187
|
+
n.disabled || s.value || v() && r.value?.click();
|
|
3188
3188
|
}, M = async (b) => {
|
|
3189
3189
|
const { files: C } = b.target;
|
|
3190
3190
|
if (!C || C.length === 0) return;
|
|
3191
|
-
if (!
|
|
3191
|
+
if (!v()) {
|
|
3192
3192
|
r.value && (r.value.value = "");
|
|
3193
3193
|
return;
|
|
3194
3194
|
}
|
|
@@ -3253,7 +3253,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3253
3253
|
item: D
|
|
3254
3254
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3255
3255
|
d("div", {
|
|
3256
|
-
onClick:
|
|
3256
|
+
onClick: g,
|
|
3257
3257
|
class: re([
|
|
3258
3258
|
"relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
|
|
3259
3259
|
b.disabled || s.value ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
@@ -3267,7 +3267,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3267
3267
|
])) : z("", !0),
|
|
3268
3268
|
b.multiple ? z("", !0) : (u(), m("div", {
|
|
3269
3269
|
key: 2,
|
|
3270
|
-
onClick:
|
|
3270
|
+
onClick: g,
|
|
3271
3271
|
class: re([b.disabled || s.value ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "relative h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
|
|
3272
3272
|
}, [
|
|
3273
3273
|
s.value ? (u(), m("div", gi)) : (u(), $e(R(Vt), {
|
|
@@ -3310,9 +3310,9 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3310
3310
|
}),
|
|
3311
3311
|
emits: ["update:modelValue"],
|
|
3312
3312
|
setup(e) {
|
|
3313
|
-
const t = e, n = Ke(e, "modelValue"), a = V(null), l = V(null), o = V(""), r = V(0), s = V(!1), f = V(""), c = V(null), w = dt("values"), x = y(() => t.format ? t.format.split(",").map((B) => B.trim().toLowerCase()).filter(Boolean) : []), S = y(() => !l.value || !l.value.size ? 0 : Math.min(100, Math.round(r.value / l.value.size * 100))), $ = y(() => l.value ? `${
|
|
3313
|
+
const t = e, n = Ke(e, "modelValue"), a = V(null), l = V(null), o = V(""), r = V(0), s = V(!1), f = V(""), c = V(null), w = dt("values"), x = y(() => t.format ? t.format.split(",").map((B) => B.trim().toLowerCase()).filter(Boolean) : []), S = y(() => !l.value || !l.value.size ? 0 : Math.min(100, Math.round(r.value / l.value.size * 100))), $ = y(() => l.value ? `${g(r.value)} / ${g(l.value.size)}` : ""), v = y(() => t.disabled ? "opacity-50 cursor-not-allowed" : s.value ? "cursor-default text-blue-500" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"), h = () => {
|
|
3314
3314
|
t.disabled || s.value || D() && a.value?.click();
|
|
3315
|
-
},
|
|
3315
|
+
}, g = (B) => {
|
|
3316
3316
|
if (!Number.isFinite(B)) return "0 B";
|
|
3317
3317
|
const q = ["B", "KB", "MB", "GB"];
|
|
3318
3318
|
let J = 0, de = B;
|
|
@@ -3462,7 +3462,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3462
3462
|
}, null, 8, ["item", "value"])) : (u(), m("div", {
|
|
3463
3463
|
key: 1,
|
|
3464
3464
|
onClick: h,
|
|
3465
|
-
class: re(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
|
|
3465
|
+
class: re(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300", v.value])
|
|
3466
3466
|
}, [
|
|
3467
3467
|
s.value ? (u(), m("div", ki, [
|
|
3468
3468
|
q[2] || (q[2] = d("div", { class: "loader" }, null, -1)),
|
|
@@ -3477,7 +3477,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3477
3477
|
d("div", $i, [
|
|
3478
3478
|
d("div", Si, [
|
|
3479
3479
|
d("div", Ci, ie(l.value.name), 1),
|
|
3480
|
-
d("div", Mi, ie(
|
|
3480
|
+
d("div", Mi, ie(g(l.value.size)), 1)
|
|
3481
3481
|
]),
|
|
3482
3482
|
d("div", Li, ie($.value), 1)
|
|
3483
3483
|
]),
|
|
@@ -3516,7 +3516,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3516
3516
|
])) : z("", !0)
|
|
3517
3517
|
]));
|
|
3518
3518
|
}
|
|
3519
|
-
}), pl = /* @__PURE__ */ Ze(Ii, [["__scopeId", "data-v-
|
|
3519
|
+
}), pl = /* @__PURE__ */ Ze(Ii, [["__scopeId", "data-v-19ea2129"]]), Ti = { class: "flex items-center justify-center h-[30px] w-[30px]" }, Fi = { class: "max-w-[55vw]" }, Ei = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Oi = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Pi = { class: "px-[5px]" }, Bi = { class: "" }, Tn = /* @__PURE__ */ ge({
|
|
3520
3520
|
__name: "vs-widget-file-info",
|
|
3521
3521
|
props: {
|
|
3522
3522
|
item: { default: null }
|
|
@@ -3690,7 +3690,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3690
3690
|
},
|
|
3691
3691
|
emits: ["update"],
|
|
3692
3692
|
setup(e, { emit: t }) {
|
|
3693
|
-
const n = e, a = dt("form"), l = y(() => a.value.formId), o = V(!1), r = V(0), s = t, f = V(!1), c = V({}), w = V([]), x = V(""), S = y(() => Array.isArray(w.value) ? w.value.filter((C) => C.ext === "jpg" || C.ext === "png").map((C) => C?.file_path) : []), $ = y(() => x.value === "" ? w.value : w.value.filter((C) => C?.uploaded_name?.includes(x.value))),
|
|
3693
|
+
const n = e, a = dt("form"), l = y(() => a.value.formId), o = V(!1), r = V(0), s = t, f = V(!1), c = V({}), w = V([]), x = V(""), S = y(() => Array.isArray(w.value) ? w.value.filter((C) => C.ext === "jpg" || C.ext === "png").map((C) => C?.file_path) : []), $ = y(() => x.value === "" ? w.value : w.value.filter((C) => C?.uploaded_name?.includes(x.value))), v = (C) => {
|
|
3694
3694
|
const D = S.value.findIndex((U) => U === C.item.file_path);
|
|
3695
3695
|
D !== -1 && (o.value = !0, r.value = D);
|
|
3696
3696
|
}, h = async () => {
|
|
@@ -3700,7 +3700,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3700
3700
|
} catch (C) {
|
|
3701
3701
|
console.error(C);
|
|
3702
3702
|
}
|
|
3703
|
-
},
|
|
3703
|
+
}, g = async (C) => {
|
|
3704
3704
|
await Promise.all(
|
|
3705
3705
|
Array.from(C.target.files).map(async (D) => {
|
|
3706
3706
|
const U = new FormData();
|
|
@@ -3745,7 +3745,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3745
3745
|
d("input", {
|
|
3746
3746
|
type: "file",
|
|
3747
3747
|
class: "hidden",
|
|
3748
|
-
onChange: D[0] || (D[0] = (N) =>
|
|
3748
|
+
onChange: D[0] || (D[0] = (N) => g(N))
|
|
3749
3749
|
}, null, 32),
|
|
3750
3750
|
d("div", tu, [
|
|
3751
3751
|
G(R(ya), { class: "h-4 w-4" })
|
|
@@ -3783,7 +3783,7 @@ const ni = /* @__PURE__ */ Ze(Gs, [["render", ti]]), li = /* @__PURE__ */ ge({
|
|
|
3783
3783
|
index: W,
|
|
3784
3784
|
onUpdate: D[2] || (D[2] = (j) => C.$emit("update", "file-list")),
|
|
3785
3785
|
onOpenModal: D[3] || (D[3] = (j) => b(j)),
|
|
3786
|
-
onOpenLightbox: D[4] || (D[4] = (j) =>
|
|
3786
|
+
onOpenLightbox: D[4] || (D[4] = (j) => v(j))
|
|
3787
3787
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
3788
3788
|
$.value.length ? z("", !0) : (u(), m("div", ru, D[8] || (D[8] = [
|
|
3789
3789
|
d("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
@@ -4045,7 +4045,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4045
4045
|
addOption: async () => {
|
|
4046
4046
|
if (!(!x.value || c?.value.validate()))
|
|
4047
4047
|
try {
|
|
4048
|
-
const
|
|
4048
|
+
const g = e.add?.api ?? `/api/table/${x.value}`, M = await fetch(g, {
|
|
4049
4049
|
method: "POST",
|
|
4050
4050
|
headers: { "Content-Type": "application/json" },
|
|
4051
4051
|
body: JSON.stringify(s.value)
|
|
@@ -4069,21 +4069,21 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4069
4069
|
}
|
|
4070
4070
|
const X = await t(U);
|
|
4071
4071
|
X && (n.value.some((W) => String(W?.id) === String(X.id)) || n.value.push(X)), o ? await o(X, U) : X && (a.value = X, l.value = U), r.value = !1, Ae({ title: "Успіх", message: "Обʼєкт успішно створено." });
|
|
4072
|
-
} catch (
|
|
4072
|
+
} catch (g) {
|
|
4073
4073
|
Ae({
|
|
4074
4074
|
title: "Помилка",
|
|
4075
4075
|
type: "error",
|
|
4076
|
-
message:
|
|
4076
|
+
message: g?.message || "Не вдалося створити обʼєкт."
|
|
4077
4077
|
});
|
|
4078
4078
|
}
|
|
4079
4079
|
},
|
|
4080
4080
|
onAddValue: async () => {
|
|
4081
4081
|
if (!e.add) return null;
|
|
4082
|
-
const h = await fetch(`/api/template/form/${e.add.form}`).then((
|
|
4082
|
+
const h = await fetch(`/api/template/form/${e.add.form}`).then((g) => g.json());
|
|
4083
4083
|
return f.value = h.schema, s.value = {}, r.value = !0, null;
|
|
4084
4084
|
}
|
|
4085
4085
|
};
|
|
4086
|
-
}, Fu = ["aria-expanded", "data-focus"], Eu = { class: "relative flex flex-1 items-center gap-1 py-0.5 pl-1 pr-0 overflow-hidden h-full min-w-0" }, Ou = {
|
|
4086
|
+
}, Fu = ["aria-expanded", "data-focus"], Eu = { class: "vs-input-select__value-area relative flex flex-1 items-center gap-1 py-0.5 pl-1 pr-0 overflow-hidden h-full min-w-0" }, Ou = {
|
|
4087
4087
|
key: 0,
|
|
4088
4088
|
class: "flex flex-nowrap items-center gap-1 overflow-x-auto overflow-y-hidden min-w-0 flex-1 py-0.5"
|
|
4089
4089
|
}, Pu = { class: "flex items-center gap-1 min-w-0" }, Bu = ["title"], Ru = ["innerHTML"], Nu = ["onClick"], ju = { class: "flex-1 min-w-[2px]" }, zu = ["placeholder"], Uu = ["title"], Hu = ["innerHTML"], Wu = {
|
|
@@ -4095,7 +4095,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4095
4095
|
}, Ku = ["placeholder"], Yu = {
|
|
4096
4096
|
key: 3,
|
|
4097
4097
|
class: "flex-1 flex items-center min-h-[30px] py-0.5 pl-2 text-sm truncate text-inherit"
|
|
4098
|
-
}, Gu = { class: "flex items-center shrink-0" }, Xu = ["disabled"], Zu = {
|
|
4098
|
+
}, Gu = { class: "vs-input-select__actions relative z-10 flex items-center shrink-0 bg-white" }, Xu = ["disabled"], Zu = {
|
|
4099
4099
|
key: 1,
|
|
4100
4100
|
class: "self-stretch w-px bg-[#ccc] my-[1px]"
|
|
4101
4101
|
}, Ju = ["disabled", "title"], Qu = /* @__PURE__ */ ge({
|
|
@@ -4226,7 +4226,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4226
4226
|
])
|
|
4227
4227
|
])) : !o.isMulti && o.selectedOptionLabel && l.value === "" ? (u(), m("div", {
|
|
4228
4228
|
key: 1,
|
|
4229
|
-
class: re(["truncate flex items-center gap-1 min-w-0 pl-2", o.disabled || !o.search ? "relative z-0 flex-1 min-h-[30px] py-0.5 text-inherit" : "absolute inset-x-0 top-0 bottom-0 z-[1] text-gray-900"]),
|
|
4229
|
+
class: re(["truncate flex items-center gap-1 min-w-0 pl-2", o.disabled || !o.search ? "relative z-0 flex-1 min-h-[30px] py-0.5 text-inherit" : "absolute inset-x-0 top-0 bottom-0 z-[1] text-gray-900 pointer-events-none"]),
|
|
4230
4230
|
title: o.selectedOptionLabel
|
|
4231
4231
|
}, [
|
|
4232
4232
|
o.shouldShowColorDot(o.selectedOption) ? (u(), m("span", {
|
|
@@ -4427,7 +4427,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4427
4427
|
set: (P) => a("update:modelValue", P)
|
|
4428
4428
|
});
|
|
4429
4429
|
!s.value && n.defaultValue && (s.value = n.defaultValue);
|
|
4430
|
-
const f = V(null), c = V(null), w = V(null), x = V(null), S = V(!1), $ = V(!1),
|
|
4430
|
+
const f = V(null), c = V(null), w = V(null), x = V(null), S = V(!1), $ = V(!1), v = V(null), h = V(-1), g = V([]), M = V(""), b = V(null), C = (P) => {
|
|
4431
4431
|
c.value = P;
|
|
4432
4432
|
}, D = (P) => {
|
|
4433
4433
|
b.value = P;
|
|
@@ -4436,12 +4436,12 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4436
4436
|
}, X = (P) => {
|
|
4437
4437
|
w.value = P;
|
|
4438
4438
|
}, N = (P, oe) => {
|
|
4439
|
-
|
|
4439
|
+
g.value[oe] = P;
|
|
4440
4440
|
}, W = V({}), j = V([]), ee = y(() => {
|
|
4441
4441
|
if (!j.value.length) return [];
|
|
4442
4442
|
const P = Le.value, oe = new Map(P.map((_e) => [_e.id?.toString(), _e]));
|
|
4443
4443
|
return j.value.map((_e) => oe.get(_e?.toString())).filter((_e) => !!_e);
|
|
4444
|
-
}), te = y(() => n.placeholder || "Select..."), B = y(() => E(
|
|
4444
|
+
}), te = y(() => n.placeholder || "Select..."), B = y(() => E(v.value)), q = y(() => o.value ? !1 : l.value ? j.value.length > 0 : !!s.value), J = (P) => l.value ? j.value.some((oe) => oe?.toString() === P?.toString()) : s.value?.toString() === P?.toString(), de = y(() => {
|
|
4445
4445
|
let P = Le.value ?? [];
|
|
4446
4446
|
if (!n.data && M.value.trim() !== "") {
|
|
4447
4447
|
const oe = M.value.toLowerCase();
|
|
@@ -4508,7 +4508,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4508
4508
|
Le.value = P;
|
|
4509
4509
|
return;
|
|
4510
4510
|
}
|
|
4511
|
-
} else if (!
|
|
4511
|
+
} else if (!v.value) {
|
|
4512
4512
|
Le.value = P;
|
|
4513
4513
|
return;
|
|
4514
4514
|
}
|
|
@@ -4521,9 +4521,9 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4521
4521
|
Le.value = [...Qe, ...P];
|
|
4522
4522
|
return;
|
|
4523
4523
|
}
|
|
4524
|
-
const _e = le(
|
|
4524
|
+
const _e = le(v.value?.id);
|
|
4525
4525
|
if (_e && !oe.has(_e)) {
|
|
4526
|
-
Le.value = [
|
|
4526
|
+
Le.value = [v.value, ...P];
|
|
4527
4527
|
return;
|
|
4528
4528
|
}
|
|
4529
4529
|
Le.value = P;
|
|
@@ -4553,12 +4553,12 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4553
4553
|
return;
|
|
4554
4554
|
}
|
|
4555
4555
|
let P = 0;
|
|
4556
|
-
if (!l.value &&
|
|
4557
|
-
const oe =
|
|
4556
|
+
if (!l.value && v.value) {
|
|
4557
|
+
const oe = v.value.id?.toString(), _e = de.value.findIndex((Ue) => Ue.id?.toString() === oe);
|
|
4558
4558
|
_e >= 0 && (P = _e);
|
|
4559
4559
|
}
|
|
4560
4560
|
h.value = P, tt(() => {
|
|
4561
|
-
F(
|
|
4561
|
+
F(g.value[P], w.value);
|
|
4562
4562
|
});
|
|
4563
4563
|
}, ce = async () => {
|
|
4564
4564
|
o.value || (S.value = !0, await tt(() => {
|
|
@@ -4566,24 +4566,24 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4566
4566
|
}), await nt(), await tt(() => {
|
|
4567
4567
|
Ie(), b.value?.focus();
|
|
4568
4568
|
}), Q());
|
|
4569
|
-
},
|
|
4569
|
+
}, be = () => {
|
|
4570
4570
|
S.value = !1, h.value = -1, tt(() => {
|
|
4571
4571
|
b.value?.blur();
|
|
4572
4572
|
});
|
|
4573
4573
|
}, Se = async (P) => {
|
|
4574
4574
|
if (o.value) return;
|
|
4575
|
-
(P !== void 0 ? P : !S.value) ? await ce() :
|
|
4575
|
+
(P !== void 0 ? P : !S.value) ? await ce() : be();
|
|
4576
4576
|
}, ze = async () => {
|
|
4577
4577
|
if (!o.value) {
|
|
4578
4578
|
if (S.value) {
|
|
4579
|
-
|
|
4579
|
+
be();
|
|
4580
4580
|
return;
|
|
4581
4581
|
}
|
|
4582
4582
|
await ce();
|
|
4583
4583
|
}
|
|
4584
4584
|
}, Ye = () => {
|
|
4585
|
-
l.value ? (j.value = [], s.value = [], a("change", []), O(null, [])) : (
|
|
4586
|
-
b.value?.focus()
|
|
4585
|
+
l.value ? (j.value = [], s.value = [], a("change", []), O(null, [])) : (v.value = null, s.value = null, a("change", null), O(null, null)), Oe(null), Ce(null), M.value = "", be(), tt(() => {
|
|
4586
|
+
b.value?.focus();
|
|
4587
4587
|
});
|
|
4588
4588
|
}, We = (P) => {
|
|
4589
4589
|
l.value && (j.value = j.value.filter((oe) => oe?.toString() !== P?.toString()), s.value = [...j.value], a("change", s.value), O(null), tt(() => b.value?.focus()));
|
|
@@ -4597,14 +4597,14 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4597
4597
|
}, _ = (P, oe = "manual") => {
|
|
4598
4598
|
l.value ? (J(P.id) || (j.value = [...j.value, P.id], s.value = [...j.value], a("change", s.value), O(P)), M.value = "", tt(() => {
|
|
4599
4599
|
b.value?.focus(), h.value = Math.min(h.value, de.value.length - 1);
|
|
4600
|
-
}), Oe(null)) : (
|
|
4600
|
+
}), Oe(null)) : (v.value = P, s.value = P.id, a("change", s.value), O(P), M.value = "", be(), Oe(P), oe === "parent-auto" && Ce({
|
|
4601
4601
|
source: oe,
|
|
4602
4602
|
parentField: n.parent ?? null,
|
|
4603
4603
|
parentValue: Ge.value ?? null
|
|
4604
4604
|
}));
|
|
4605
4605
|
}, A = (P) => {
|
|
4606
4606
|
if (J(P.id)) {
|
|
4607
|
-
l.value ||
|
|
4607
|
+
l.value || be();
|
|
4608
4608
|
return;
|
|
4609
4609
|
}
|
|
4610
4610
|
_(P);
|
|
@@ -4651,23 +4651,23 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4651
4651
|
if (!S.value) return;
|
|
4652
4652
|
const { key: oe } = P;
|
|
4653
4653
|
if (oe === "ArrowDown")
|
|
4654
|
-
P.preventDefault(), h.value + 1 < de.value.length && (h.value += 1, F(
|
|
4654
|
+
P.preventDefault(), h.value + 1 < de.value.length && (h.value += 1, F(g.value[h.value], w.value));
|
|
4655
4655
|
else if (oe === "ArrowUp")
|
|
4656
|
-
P.preventDefault(), h.value > 0 && (h.value -= 1, F(
|
|
4656
|
+
P.preventDefault(), h.value > 0 && (h.value -= 1, F(g.value[h.value], w.value));
|
|
4657
4657
|
else if (oe === "Enter") {
|
|
4658
4658
|
P.preventDefault();
|
|
4659
4659
|
const _e = de.value[h.value];
|
|
4660
4660
|
_e && _(_e), b.value?.blur();
|
|
4661
|
-
} else oe === "Escape" ? (P.preventDefault(),
|
|
4661
|
+
} else oe === "Escape" ? (P.preventDefault(), be()) : oe === "Backspace" ? l.value && M.value === "" && j.value.length && (j.value = j.value.slice(0, -1), s.value = [...j.value], a("change", s.value)) : oe === "Home" ? (h.value = 0, F(g.value[0], w.value)) : oe === "End" ? (h.value = de.value.length - 1, F(g.value[h.value], w.value)) : oe === "Tab" && be();
|
|
4662
4662
|
}, pt = () => {
|
|
4663
4663
|
o.value || ($.value = !0);
|
|
4664
4664
|
}, H = () => {
|
|
4665
4665
|
$.value = !1, M.value = "";
|
|
4666
|
-
},
|
|
4667
|
-
P.key === "Escape" && S.value &&
|
|
4666
|
+
}, we = (P) => {
|
|
4667
|
+
P.key === "Escape" && S.value && be();
|
|
4668
4668
|
}, Xe = (P) => {
|
|
4669
4669
|
const oe = P.target;
|
|
4670
|
-
f.value?.contains(oe) || x.value?.contains(oe) ||
|
|
4670
|
+
f.value?.contains(oe) || x.value?.contains(oe) || be();
|
|
4671
4671
|
}, gt = (P) => {
|
|
4672
4672
|
S.value && w.value && !w.value.contains(P.target) && Ie();
|
|
4673
4673
|
}, $t = () => {
|
|
@@ -4683,13 +4683,13 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4683
4683
|
const P = s.value[0] ?? null;
|
|
4684
4684
|
s.value = P ?? null;
|
|
4685
4685
|
}
|
|
4686
|
-
s.value != null &&
|
|
4686
|
+
s.value != null && s.value !== "" ? v.value = await ct(s.value) : v.value = null, Oe(v.value ?? null);
|
|
4687
4687
|
}
|
|
4688
4688
|
}
|
|
4689
4689
|
ye(s, () => {
|
|
4690
4690
|
Ht();
|
|
4691
4691
|
}), ot(async () => {
|
|
4692
|
-
if (addEventListener("keydown",
|
|
4692
|
+
if (addEventListener("keydown", we), addEventListener("scroll", gt, !0), addEventListener("resize", $t), document.addEventListener("click", Xe, !0), c.value && fe(c.value).addEventListener("scroll", ft, !0), n.options?.length && !n.data)
|
|
4693
4693
|
Le.value = [...n.options];
|
|
4694
4694
|
else if (n.data) {
|
|
4695
4695
|
const P = await Fe("");
|
|
@@ -4697,7 +4697,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4697
4697
|
}
|
|
4698
4698
|
await Ht(), Sn.value = !1;
|
|
4699
4699
|
}), dn(() => {
|
|
4700
|
-
removeEventListener("keydown",
|
|
4700
|
+
removeEventListener("keydown", we), removeEventListener("scroll", gt, !0), removeEventListener("resize", $t), document.removeEventListener("click", Xe, !0), c.value && fe(c.value).removeEventListener("scroll", ft, !0);
|
|
4701
4701
|
});
|
|
4702
4702
|
const {
|
|
4703
4703
|
isOpenAdd: Wt,
|
|
@@ -4711,7 +4711,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4711
4711
|
props: n,
|
|
4712
4712
|
fetchOptionByValue: Je,
|
|
4713
4713
|
optionsList: Le,
|
|
4714
|
-
selectedOption:
|
|
4714
|
+
selectedOption: v,
|
|
4715
4715
|
modelValue: s
|
|
4716
4716
|
});
|
|
4717
4717
|
function ll(P, oe = 200) {
|
|
@@ -4731,7 +4731,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4731
4731
|
}, { immediate: !0 });
|
|
4732
4732
|
const Sn = V(!0);
|
|
4733
4733
|
return ye(Ge, async () => {
|
|
4734
|
-
if (n.data && (Sn.value || (l.value ? (j.value = [], s.value = [], a("change", [])) : (
|
|
4734
|
+
if (n.data && (Sn.value || (l.value ? (j.value = [], s.value = [], a("change", [])) : (v.value = null, s.value = null, a("change", null))), await nt(), n.auto === 1 && Ge.value && Le.value.length > 0)) {
|
|
4735
4735
|
const P = Le.value[0];
|
|
4736
4736
|
P && _(P, "parent-auto");
|
|
4737
4737
|
}
|
|
@@ -4791,7 +4791,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4791
4791
|
"option-template": ne.value,
|
|
4792
4792
|
"icon-wrapper-class": ta,
|
|
4793
4793
|
"selected-option-label": B.value,
|
|
4794
|
-
"selected-option":
|
|
4794
|
+
"selected-option": v.value,
|
|
4795
4795
|
"show-clear": q.value,
|
|
4796
4796
|
"set-trigger-ref": C,
|
|
4797
4797
|
"set-input-ref": D,
|
|
@@ -4843,7 +4843,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4843
4843
|
], 512)
|
|
4844
4844
|
], 64));
|
|
4845
4845
|
}
|
|
4846
|
-
}), na = /* @__PURE__ */ Ze(sd, [["__scopeId", "data-v-
|
|
4846
|
+
}), na = /* @__PURE__ */ Ze(sd, [["__scopeId", "data-v-e32c2e90"]]), Il = (e = "") => `${e}${Math.floor(Math.random() * 1e4)}`, id = ["disabled", "aria-expanded"], ud = { class: "truncate" }, dd = { class: "py-2 px-4" }, cd = { class: "block font-medium text-[13px] text-foreground" }, pd = { class: "truncate" }, fd = { class: "p-1 border-t border-gray-200" }, md = { class: "space-y-0.5 max-h-48 overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-none [&::-webkit-scrollbar-track]:bg-scrollbar-track [&::-webkit-scrollbar-thumb]:bg-scrollbar-thumb" }, vd = ["onClick"], gd = ["checked"], yd = { class: "shrink-0 size-3.5 flex justify-center items-center" }, hd = {
|
|
4847
4847
|
key: 1,
|
|
4848
4848
|
class: "shrink-0 size-2 block mx-auto rounded-full bg-secondary/60"
|
|
4849
4849
|
}, bd = { class: "truncate" }, wd = {
|
|
@@ -4888,7 +4888,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
4888
4888
|
set: (ae) => a("update:modelValue", ae)
|
|
4889
4889
|
});
|
|
4890
4890
|
l.value == null && n.defaultValue != null && (l.value = n.defaultValue);
|
|
4891
|
-
const o = dt("values"), r = dt("field-props"), s = y(() => !!n.disabled), f = V(null), c = V(!1), w = V(null), x = V(null), S = V(null), $ = V({}),
|
|
4891
|
+
const o = dt("values"), r = dt("field-props"), s = y(() => !!n.disabled), f = V(null), c = V(!1), w = V(null), x = V(null), S = V(null), $ = V({}), v = `vs-input-inline-select-${Il()}`, h = y(() => n.placeholder || "Оберіть значення"), g = y(() => U(f.value) || n.placeholder || "Оберіть значення"), M = y(() => n.slot ?? ""), b = y(() => Gn(M.value)), C = y(() => n.teleport || "body"), D = /^#(?:[\da-fA-F]{3}|[\da-fA-F]{6}|[\da-fA-F]{8})$/, U = (ae) => Jn(ae, M.value), X = (ae) => !!(!b.value && Zt(ae)), N = y(() => {
|
|
4892
4892
|
const ae = Zt(f.value).trim();
|
|
4893
4893
|
return ae ? D.test(ae) ? `bg-[${ae}] border-[${ae}]` : `bg-${ae.toLowerCase()}-500 border-${ae.toLowerCase()}-500` : "";
|
|
4894
4894
|
}), {
|
|
@@ -5010,7 +5010,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
5010
5010
|
]),
|
|
5011
5011
|
onClick: K
|
|
5012
5012
|
}, [
|
|
5013
|
-
d("span", ud, ie(
|
|
5013
|
+
d("span", ud, ie(g.value), 1)
|
|
5014
5014
|
], 10, id),
|
|
5015
5015
|
(u(), $e(Ut, { to: C.value }, [
|
|
5016
5016
|
c.value ? (u(), m("div", {
|
|
@@ -5037,7 +5037,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
5037
5037
|
d("input", {
|
|
5038
5038
|
type: "radio",
|
|
5039
5039
|
class: "hidden",
|
|
5040
|
-
name:
|
|
5040
|
+
name: v,
|
|
5041
5041
|
checked: de(Oe.id),
|
|
5042
5042
|
tabindex: "-1"
|
|
5043
5043
|
}, null, 8, gd),
|
|
@@ -5116,7 +5116,7 @@ const Tu = /* @__PURE__ */ ge({
|
|
|
5116
5116
|
}),
|
|
5117
5117
|
emits: ["update:modelValue"],
|
|
5118
5118
|
setup(e) {
|
|
5119
|
-
const t = oo(() => import("./vs-richtext-
|
|
5119
|
+
const t = oo(() => import("./vs-richtext-B0plt4Ru.js")), n = e, { inputClass: a } = bt(n.style), l = Ke(e, "modelValue"), o = y(() => !!n.disabled), r = y(() => n.placeholder ?? ""), s = y(() => ({
|
|
5120
5120
|
height: n.richtextProps.height || "300px",
|
|
5121
5121
|
format: n.format,
|
|
5122
5122
|
...n.richtextProps
|
|
@@ -5148,7 +5148,7 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5148
5148
|
}, Ad = {
|
|
5149
5149
|
key: 0,
|
|
5150
5150
|
class: "relative flex-1 min-w-0"
|
|
5151
|
-
}, Dd = { class: "flex md:flex-nowrap flex-wrap items-center justify-end gap-2 shrink-0" }, Id = { class: "w-full overflow-x-auto" }, Td = { class: "w-full min-w-[640px] table-auto divide-y divide-gray-200" }, Fd = { class: "bg-gray-50" }, Ed = { class: "border-b border-gray-200" }, Od = { class: "px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center" }, Pd = ["onClick"], Bd = {
|
|
5151
|
+
}, Dd = { class: "flex md:flex-nowrap flex-wrap items-center md:justify-end justify-start gap-2 shrink-0" }, Id = { class: "w-full overflow-x-auto" }, Td = { class: "w-full min-w-[640px] table-auto divide-y divide-gray-200" }, Fd = { class: "bg-gray-50" }, Ed = { class: "border-b border-gray-200" }, Od = { class: "px-4 py-3 text-left text-xs font-semibold text-gray-900 w-12 text-center" }, Pd = ["onClick"], Bd = {
|
|
5152
5152
|
key: 0,
|
|
5153
5153
|
class: "text-gray-400"
|
|
5154
5154
|
}, Rd = {
|
|
@@ -5195,34 +5195,34 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5195
5195
|
return We ? Array.isArray(We) ? We.join(", ").toLowerCase().includes(f.value.toLowerCase()) : String(We).toLowerCase().includes(f.value.toLowerCase()) : !1;
|
|
5196
5196
|
})) : T;
|
|
5197
5197
|
if (!c.value) return Q;
|
|
5198
|
-
const ce = c.value,
|
|
5198
|
+
const ce = c.value, be = [...Q].sort((Se, ze) => {
|
|
5199
5199
|
const Ye = Ge(Se?.[ce]), We = Ge(ze?.[ce]);
|
|
5200
5200
|
return typeof Ye == "number" && typeof We == "number" ? Ye - We : String(Ye).localeCompare(String(We));
|
|
5201
5201
|
});
|
|
5202
|
-
return w.value === "asc" ?
|
|
5203
|
-
}), S = y(() => (t.colModel ?? []).filter((T) => !T.tableHidden)), $ = V(null),
|
|
5204
|
-
function
|
|
5202
|
+
return w.value === "asc" ? be : be.reverse();
|
|
5203
|
+
}), S = y(() => (t.colModel ?? []).filter((T) => !T.tableHidden)), $ = V(null), v = V(null), h = V(null);
|
|
5204
|
+
function g(T) {
|
|
5205
5205
|
return T.pointerType === "touch" || T.pointerType === "pen";
|
|
5206
5206
|
}
|
|
5207
5207
|
function M(T, Q) {
|
|
5208
|
-
const
|
|
5209
|
-
if (!
|
|
5210
|
-
const Se =
|
|
5208
|
+
const be = document.elementFromPoint(T, Q)?.closest?.("[data-row-index]") ?? null;
|
|
5209
|
+
if (!be) return null;
|
|
5210
|
+
const Se = be.getAttribute("data-row-index");
|
|
5211
5211
|
if (Se == null) return null;
|
|
5212
5212
|
const ze = Number.parseInt(Se, 10);
|
|
5213
5213
|
return Number.isNaN(ze) ? null : ze;
|
|
5214
5214
|
}
|
|
5215
5215
|
function b(T, Q) {
|
|
5216
|
-
|
|
5216
|
+
g(T) && (T.preventDefault(), T.currentTarget.setPointerCapture(T.pointerId), $.value = Q, v.value = Q);
|
|
5217
5217
|
}
|
|
5218
5218
|
function C(T) {
|
|
5219
|
-
if ($.value === null || !
|
|
5219
|
+
if ($.value === null || !g(T)) return;
|
|
5220
5220
|
T.preventDefault();
|
|
5221
5221
|
const Q = M(T.clientX, T.clientY);
|
|
5222
|
-
Q !== null && (
|
|
5222
|
+
Q !== null && (v.value = Q);
|
|
5223
5223
|
}
|
|
5224
5224
|
function D(T) {
|
|
5225
|
-
if ($.value === null || !
|
|
5225
|
+
if ($.value === null || !g(T)) return;
|
|
5226
5226
|
T.preventDefault();
|
|
5227
5227
|
const Q = M(T.clientX, T.clientY);
|
|
5228
5228
|
W(Q ?? $.value);
|
|
@@ -5232,8 +5232,8 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
5234
|
function U(T) {
|
|
5235
|
-
if (
|
|
5236
|
-
$.value = null,
|
|
5235
|
+
if (g(T)) {
|
|
5236
|
+
$.value = null, v.value = null;
|
|
5237
5237
|
try {
|
|
5238
5238
|
T.currentTarget.releasePointerCapture(T.pointerId);
|
|
5239
5239
|
} catch {
|
|
@@ -5243,24 +5243,24 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5243
5243
|
const X = (T) => {
|
|
5244
5244
|
$.value = T;
|
|
5245
5245
|
}, N = (T) => {
|
|
5246
|
-
|
|
5246
|
+
v.value = T;
|
|
5247
5247
|
}, W = (T) => {
|
|
5248
5248
|
if ($.value === null || $.value === T) {
|
|
5249
|
-
$.value = null,
|
|
5249
|
+
$.value = null, v.value = null;
|
|
5250
5250
|
return;
|
|
5251
5251
|
}
|
|
5252
5252
|
const Q = [...r.value], [ce] = Q.splice($.value, 1);
|
|
5253
|
-
Q.splice(T, 0, ce), r.value = Q, $.value = null,
|
|
5253
|
+
Q.splice(T, 0, ce), r.value = Q, $.value = null, v.value = null;
|
|
5254
5254
|
}, j = () => {
|
|
5255
5255
|
h.value && h.value.click();
|
|
5256
5256
|
}, ee = (T) => {
|
|
5257
5257
|
const Q = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], ce = T.toLowerCase();
|
|
5258
|
-
return Q.some((
|
|
5258
|
+
return Q.some((be) => ce.endsWith(be));
|
|
5259
5259
|
}, te = (T) => {
|
|
5260
5260
|
const ce = T.target.files?.[0];
|
|
5261
5261
|
if (!ce) return;
|
|
5262
|
-
const
|
|
5263
|
-
|
|
5262
|
+
const be = new FileReader();
|
|
5263
|
+
be.onload = (Se) => {
|
|
5264
5264
|
try {
|
|
5265
5265
|
const ze = Se.target?.result;
|
|
5266
5266
|
if (typeof ze == "string") {
|
|
@@ -5270,10 +5270,10 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5270
5270
|
} catch (ze) {
|
|
5271
5271
|
console.error("Error parsing file:", ze);
|
|
5272
5272
|
}
|
|
5273
|
-
},
|
|
5273
|
+
}, be.readAsText(ce);
|
|
5274
5274
|
}, B = () => {
|
|
5275
|
-
const T = JSON.stringify(r.value, null, 2), Q = new Blob([T], { type: "application/json" }), ce = URL.createObjectURL(Q),
|
|
5276
|
-
|
|
5275
|
+
const T = JSON.stringify(r.value, null, 2), Q = new Blob([T], { type: "application/json" }), ce = URL.createObjectURL(Q), be = document.createElement("a");
|
|
5276
|
+
be.href = ce, be.download = "data.json", be.click(), URL.revokeObjectURL(ce);
|
|
5277
5277
|
}, q = /* @__PURE__ */ new Set([
|
|
5278
5278
|
"autocomplete",
|
|
5279
5279
|
"select",
|
|
@@ -5281,21 +5281,21 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5281
5281
|
"checkbox",
|
|
5282
5282
|
"combobox"
|
|
5283
5283
|
]), J = /* @__PURE__ */ new Map(), de = (T, Q) => {
|
|
5284
|
-
const ce = `/api/suggest/${T}`,
|
|
5285
|
-
return `${ce}${
|
|
5284
|
+
const ce = `/api/suggest/${T}`, be = ce.includes("?") ? "&" : "?", Se = Q ? `&val=${Q}` : "";
|
|
5285
|
+
return `${ce}${be}json=1${Se}`;
|
|
5286
5286
|
}, se = (T) => T == null || T === "" ? null : typeof T == "object" ? T?.id !== void 0 && T.id !== null && T.id !== "" ? T.id : null : T, me = (T) => {
|
|
5287
5287
|
const Q = /* @__PURE__ */ new Set();
|
|
5288
5288
|
return Array.isArray(r.value) && r.value.forEach((ce) => {
|
|
5289
|
-
const
|
|
5290
|
-
if (
|
|
5291
|
-
if (Array.isArray(
|
|
5292
|
-
|
|
5289
|
+
const be = ce?.[T];
|
|
5290
|
+
if (be == null || be === "") return;
|
|
5291
|
+
if (Array.isArray(be)) {
|
|
5292
|
+
be.forEach((ze) => {
|
|
5293
5293
|
const Ye = se(ze);
|
|
5294
5294
|
Ye !== null && Q.add(Ye);
|
|
5295
5295
|
});
|
|
5296
5296
|
return;
|
|
5297
5297
|
}
|
|
5298
|
-
const Se = se(
|
|
5298
|
+
const Se = se(be);
|
|
5299
5299
|
Se !== null && Q.add(Se);
|
|
5300
5300
|
}), Q;
|
|
5301
5301
|
}, ne = async () => {
|
|
@@ -5304,7 +5304,7 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5304
5304
|
T.length && await Promise.all(T.map(async (Q) => {
|
|
5305
5305
|
const ce = Q.key || Q.name;
|
|
5306
5306
|
if (!ce) return;
|
|
5307
|
-
const
|
|
5307
|
+
const be = me(ce), Se = Array.from(be).map((We) => String(We)).sort(), ze = Se.join(",");
|
|
5308
5308
|
if (!Se.length || J.get(ce) === ze) return;
|
|
5309
5309
|
J.set(ce, ze);
|
|
5310
5310
|
const Ye = Se.map(encodeURIComponent).join(",");
|
|
@@ -5328,8 +5328,8 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5328
5328
|
const Z = (T) => (T?.format || T?.type || "").toString().toLowerCase(), ve = y(() => (t.colModel?.filter((Q) => Z(Q) !== "slot") ?? []).map((Q) => {
|
|
5329
5329
|
const ce = Q.key || Q.name;
|
|
5330
5330
|
return ce ? { ...Q, name: ce, key: ce } : Q;
|
|
5331
|
-
})), Ve = V({}), ae = V({}), Ce = (T) => typeof T != "string" ? !1 : !!n[T], Oe = (T, Q) => Q ? Q.split(".").reduce((ce,
|
|
5332
|
-
const Se = Oe(Q,
|
|
5331
|
+
})), Ve = V({}), ae = V({}), Ce = (T) => typeof T != "string" ? !1 : !!n[T], Oe = (T, Q) => Q ? Q.split(".").reduce((ce, be) => ce == null ? ce : ce[be.trim()], T) : T, Le = (T, Q) => typeof T != "string" ? "" : T.replace(/{{\s*([^}]+)\s*}}/g, (ce, be) => {
|
|
5332
|
+
const Se = Oe(Q, be.trim());
|
|
5333
5333
|
return Se ?? "";
|
|
5334
5334
|
}), Ge = (T) => {
|
|
5335
5335
|
if (T == null || T === "") return "";
|
|
@@ -5360,20 +5360,20 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5360
5360
|
function Re(T, Q) {
|
|
5361
5361
|
if (!T?.length) return null;
|
|
5362
5362
|
const ce = typeof Q == "object" ? Q?.id : Q;
|
|
5363
|
-
return ce == null || ce === "" ? null : T.find((
|
|
5363
|
+
return ce == null || ce === "" ? null : T.find((be) => be?.id?.toString() === ce.toString())?.text ?? null;
|
|
5364
5364
|
}
|
|
5365
5365
|
function le(T) {
|
|
5366
5366
|
return T == null || T === "" ? "-" : Array.isArray(T) ? T.map((Q) => typeof Q == "object" ? Q?.text ?? Q?.id ?? "-" : Q).join(", ") : typeof T == "object" ? T?.text ?? T?.id ?? "-" : T;
|
|
5367
5367
|
}
|
|
5368
5368
|
function ue(T, Q) {
|
|
5369
|
-
const ce = Q.key || Q.name,
|
|
5370
|
-
if (!
|
|
5371
|
-
if (Array.isArray(
|
|
5372
|
-
const Ye =
|
|
5373
|
-
return Ye.length ? Ye.join(", ") : le(
|
|
5369
|
+
const ce = Q.key || Q.name, be = T?.[ce], Se = s.value[ce];
|
|
5370
|
+
if (!be) return "-";
|
|
5371
|
+
if (Array.isArray(be)) {
|
|
5372
|
+
const Ye = be.map((We) => Re(Se, We)).filter(Boolean);
|
|
5373
|
+
return Ye.length ? Ye.join(", ") : le(be);
|
|
5374
5374
|
}
|
|
5375
|
-
const ze = Re(Se,
|
|
5376
|
-
return ze || le(
|
|
5375
|
+
const ze = Re(Se, be);
|
|
5376
|
+
return ze || le(be);
|
|
5377
5377
|
}
|
|
5378
5378
|
async function Me(T, Q) {
|
|
5379
5379
|
xe.value = "Редагувати", E.value = !0, K = "edit", pe = Q, Ve.value = { ...T };
|
|
@@ -5458,7 +5458,7 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5458
5458
|
}, [
|
|
5459
5459
|
d("button", {
|
|
5460
5460
|
type: "button",
|
|
5461
|
-
onClick: (
|
|
5461
|
+
onClick: (be) => je(ce),
|
|
5462
5462
|
class: "flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"
|
|
5463
5463
|
}, [
|
|
5464
5464
|
d("span", null, ie(ce.ua || ce.label), 1),
|
|
@@ -5469,7 +5469,7 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5469
5469
|
])
|
|
5470
5470
|
]),
|
|
5471
5471
|
d("tbody", {
|
|
5472
|
-
class: re(["divide-y divide-gray-200", { "[&_tr:last-child]:border-0": !
|
|
5472
|
+
class: re(["divide-y divide-gray-200", { "[&_tr:last-child]:border-0": !v.value }])
|
|
5473
5473
|
}, [
|
|
5474
5474
|
x.value.length === 0 ? (u(), m("td", Rd, [
|
|
5475
5475
|
d("div", Nd, [
|
|
@@ -5482,21 +5482,21 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5482
5482
|
])
|
|
5483
5483
|
])
|
|
5484
5484
|
])) : z("", !0),
|
|
5485
|
-
(u(!0), m(De, null, Ne(x.value, (ce,
|
|
5485
|
+
(u(!0), m(De, null, Ne(x.value, (ce, be) => (u(), m("tr", {
|
|
5486
5486
|
key: ce.id,
|
|
5487
|
-
"data-row-index":
|
|
5487
|
+
"data-row-index": be,
|
|
5488
5488
|
class: re(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700", {
|
|
5489
|
-
"opacity-50": $.value ===
|
|
5490
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":
|
|
5489
|
+
"opacity-50": $.value === be,
|
|
5490
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": v.value === be
|
|
5491
5491
|
}]),
|
|
5492
5492
|
draggable: "true",
|
|
5493
|
-
onDragstart: (Se) => X(
|
|
5494
|
-
onDragover: Te((Se) => N(
|
|
5495
|
-
onDrop: (Se) => W(
|
|
5493
|
+
onDragstart: (Se) => X(be),
|
|
5494
|
+
onDragover: Te((Se) => N(be), ["prevent"]),
|
|
5495
|
+
onDrop: (Se) => W(be)
|
|
5496
5496
|
}, [
|
|
5497
5497
|
d("td", {
|
|
5498
5498
|
class: "px-4 py-3 text-center align-middle touch-none select-none",
|
|
5499
|
-
onPointerdown: (Se) => b(Se,
|
|
5499
|
+
onPointerdown: (Se) => b(Se, be),
|
|
5500
5500
|
onPointermove: C,
|
|
5501
5501
|
onPointerup: D,
|
|
5502
5502
|
onPointercancel: U
|
|
@@ -5543,13 +5543,13 @@ const Md = /* @__PURE__ */ Ze($d, [["render", Cd]]), Ld = { class: "bg-white rou
|
|
|
5543
5543
|
d("td", Jd, [
|
|
5544
5544
|
d("div", Qd, [
|
|
5545
5545
|
d("button", {
|
|
5546
|
-
onClick: (Se) => Me(ce,
|
|
5546
|
+
onClick: (Se) => Me(ce, be),
|
|
5547
5547
|
class: "p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors"
|
|
5548
5548
|
}, [
|
|
5549
5549
|
G(R(wo), { class: "h-4 w-4" })
|
|
5550
5550
|
], 8, ec),
|
|
5551
5551
|
d("button", {
|
|
5552
|
-
onClick: (Se) => nt(
|
|
5552
|
+
onClick: (Se) => nt(be),
|
|
5553
5553
|
class: "p-1.5 text-gray-600 hover:text-red-600 hover:bg-red-50 rounded transition-colors"
|
|
5554
5554
|
}, [
|
|
5555
5555
|
G(R(on), { class: "h-4 w-4" })
|
|
@@ -5710,8 +5710,8 @@ const bc = ["title", "aria-expanded"], wc = ["src"], xc = { class: "map-layers__
|
|
|
5710
5710
|
},
|
|
5711
5711
|
emits: ["onLayerChange", "onOverlayToggle", "onVectorOverlayToggle"],
|
|
5712
5712
|
setup(e, { emit: t }) {
|
|
5713
|
-
const n = e, a = t, l = 10 * Fn, o = 400 * Fn, r = 400 * Fn, s = 320 * Fn, f = V(null), c = V(null), w = V(null), x = V(!1), S = V({}), $ = y(() => Object.keys(n.basemaps || {}).length > 0),
|
|
5714
|
-
() => $.value ||
|
|
5713
|
+
const n = e, a = t, l = 10 * Fn, o = 400 * Fn, r = 400 * Fn, s = 320 * Fn, f = V(null), c = V(null), w = V(null), x = V(!1), S = V({}), $ = y(() => Object.keys(n.basemaps || {}).length > 0), v = y(() => Object.keys(n.tileOverlays || {}).length > 0), h = y(() => n.vectorOverlays ?? []), g = y(() => h.value.length > 0), M = y(
|
|
5714
|
+
() => $.value || v.value || g.value
|
|
5715
5715
|
), b = y(() => n.basemaps?.[n.activeBaseKey]?.name || n.activeBaseKey || "Шари"), C = y(() => U(n.basemaps)), D = y(() => U(n.tileOverlays || {}));
|
|
5716
5716
|
function U(ne) {
|
|
5717
5717
|
const xe = n.previewTile;
|
|
@@ -5824,7 +5824,7 @@ const bc = ["title", "aria-expanded"], wc = ["src"], xc = { class: "map-layers__
|
|
|
5824
5824
|
])
|
|
5825
5825
|
]),
|
|
5826
5826
|
d("div", kc, [
|
|
5827
|
-
|
|
5827
|
+
v.value ? (u(), m("section", _c, [
|
|
5828
5828
|
xe[1] || (xe[1] = d("h4", { class: "map-layers__section-title" }, "Додаткові шари", -1)),
|
|
5829
5829
|
d("div", $c, [
|
|
5830
5830
|
(u(!0), m(De, null, Ne(ne.tileOverlays, (E, K) => (u(), m("button", {
|
|
@@ -5865,7 +5865,7 @@ const bc = ["title", "aria-expanded"], wc = ["src"], xc = { class: "map-layers__
|
|
|
5865
5865
|
], 10, Dc))), 128))
|
|
5866
5866
|
])
|
|
5867
5867
|
])) : z("", !0),
|
|
5868
|
-
|
|
5868
|
+
g.value ? (u(), m("section", Ec, [
|
|
5869
5869
|
xe[3] || (xe[3] = d("h4", { class: "map-layers__section-title" }, "Дані", -1)),
|
|
5870
5870
|
d("div", Oc, [
|
|
5871
5871
|
(u(!0), m(De, null, Ne(h.value, (E) => (u(), m("label", {
|
|
@@ -6159,16 +6159,16 @@ const Kc = ["title"], Yc = {
|
|
|
6159
6159
|
}), $ = y(() => {
|
|
6160
6160
|
const O = S.value, _ = a.config?.tools?.filter((A) => O.includes(A));
|
|
6161
6161
|
return _ && _.length ? _ : O;
|
|
6162
|
-
}),
|
|
6162
|
+
}), v = y(() => a.config?.placeholder?.trim() || "Пошук…"), h = V($.value[0]);
|
|
6163
6163
|
ye($, (O) => {
|
|
6164
6164
|
O.includes(h.value) || (h.value = O[0]);
|
|
6165
6165
|
});
|
|
6166
|
-
const
|
|
6166
|
+
const g = V(""), M = V(!1), b = V(null), C = V(null), D = V(null), U = V(null), X = V([]), N = V(null), W = V(!1), j = V([]), ee = y(
|
|
6167
6167
|
() => (h.value === "address" || h.value === "nominatim") && W.value
|
|
6168
6168
|
), te = y(() => a.config?.addressDebounceMs ?? 1e3);
|
|
6169
6169
|
let B = null;
|
|
6170
|
-
const q = V(!1), J = y(() =>
|
|
6171
|
-
() =>
|
|
6170
|
+
const q = V(!1), J = y(() => g.value.trim().length > 0 ? X.value : j.value), de = y(() => g.value.trim().length ? `Знайдено ${X.value.length}` : "Історія пошуку"), se = y(
|
|
6171
|
+
() => g.value.trim().length ? "Нічого не знайдено" : "Історія порожня"
|
|
6172
6172
|
);
|
|
6173
6173
|
function me() {
|
|
6174
6174
|
if (typeof window > "u") return [];
|
|
@@ -6207,12 +6207,12 @@ const Kc = ["title"], Yc = {
|
|
|
6207
6207
|
B && (clearTimeout(B), B = null);
|
|
6208
6208
|
}
|
|
6209
6209
|
ye(h, () => {
|
|
6210
|
-
|
|
6210
|
+
g.value = "", M.value = !1, X.value = [], W.value = !1, Z(), q.value = !1;
|
|
6211
6211
|
}), ye(ee, (O) => {
|
|
6212
6212
|
O ? tt(() => {
|
|
6213
6213
|
K();
|
|
6214
6214
|
}) : E.display = "none";
|
|
6215
|
-
}), ye(
|
|
6215
|
+
}), ye(g, (O) => {
|
|
6216
6216
|
if (h.value !== "address" && h.value !== "nominatim") {
|
|
6217
6217
|
X.value = [], Z();
|
|
6218
6218
|
return;
|
|
@@ -6243,7 +6243,7 @@ const Kc = ["title"], Yc = {
|
|
|
6243
6243
|
ve(_?.target), h.value = O;
|
|
6244
6244
|
}
|
|
6245
6245
|
function Ce() {
|
|
6246
|
-
|
|
6246
|
+
g.value = "", X.value = [], W.value = !1, q.value = !1;
|
|
6247
6247
|
}
|
|
6248
6248
|
function Oe(O) {
|
|
6249
6249
|
const _ = O.target;
|
|
@@ -6291,9 +6291,9 @@ const Kc = ["title"], Yc = {
|
|
|
6291
6291
|
const fe = F.slice(0, 2).map(Number);
|
|
6292
6292
|
if (!fe.every((Xe) => Number.isFinite(Xe))) return null;
|
|
6293
6293
|
let [Ie, et] = fe, qe = Ie, pt = et;
|
|
6294
|
-
const H = (Xe) => Math.abs(Xe) <= 90,
|
|
6295
|
-
if (!H(qe) || !
|
|
6296
|
-
if (H(pt) &&
|
|
6294
|
+
const H = (Xe) => Math.abs(Xe) <= 90, we = (Xe) => Math.abs(Xe) <= 180;
|
|
6295
|
+
if (!H(qe) || !we(pt))
|
|
6296
|
+
if (H(pt) && we(qe))
|
|
6297
6297
|
qe = et, pt = Ie;
|
|
6298
6298
|
else
|
|
6299
6299
|
return null;
|
|
@@ -6416,7 +6416,7 @@ const Kc = ["title"], Yc = {
|
|
|
6416
6416
|
}
|
|
6417
6417
|
X.value = _;
|
|
6418
6418
|
}
|
|
6419
|
-
async function
|
|
6419
|
+
async function be(O) {
|
|
6420
6420
|
if (le(O)) {
|
|
6421
6421
|
Ye(O), xe(O);
|
|
6422
6422
|
return;
|
|
@@ -6444,7 +6444,7 @@ const Kc = ["title"], Yc = {
|
|
|
6444
6444
|
l("goToCoordinates", [O.lat, O.lng]), q.value = !0;
|
|
6445
6445
|
}
|
|
6446
6446
|
async function We() {
|
|
6447
|
-
const O =
|
|
6447
|
+
const O = g.value.trim();
|
|
6448
6448
|
if (O) {
|
|
6449
6449
|
if (h.value === "xy") {
|
|
6450
6450
|
const _ = je(O);
|
|
@@ -6562,21 +6562,21 @@ const Kc = ["title"], Yc = {
|
|
|
6562
6562
|
}, [
|
|
6563
6563
|
h.value === "parcel" ? (u(), $e(Ml, {
|
|
6564
6564
|
key: 0,
|
|
6565
|
-
modelValue:
|
|
6566
|
-
"onUpdate:modelValue": _[0] || (_[0] = (A) =>
|
|
6565
|
+
modelValue: g.value,
|
|
6566
|
+
"onUpdate:modelValue": _[0] || (_[0] = (A) => g.value = A),
|
|
6567
6567
|
mask: "0000000000:00:000:0000",
|
|
6568
6568
|
class: re(["vs-input !h-[34px] transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid py-1.5 pl-3 text-sm", q.value ? "!pr-14" : "!pr-8"])
|
|
6569
6569
|
}, null, 8, ["modelValue", "class"])) : Pe((u(), m("input", {
|
|
6570
6570
|
key: 1,
|
|
6571
|
-
"onUpdate:modelValue": _[1] || (_[1] = (A) =>
|
|
6572
|
-
placeholder:
|
|
6571
|
+
"onUpdate:modelValue": _[1] || (_[1] = (A) => g.value = A),
|
|
6572
|
+
placeholder: v.value,
|
|
6573
6573
|
type: "text",
|
|
6574
6574
|
class: re(["vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid py-1.5 pl-3 text-sm", q.value ? "!pr-14" : "!pr-8"]),
|
|
6575
6575
|
onFocus: Se
|
|
6576
6576
|
}, null, 42, Xc)), [
|
|
6577
6577
|
[
|
|
6578
6578
|
rt,
|
|
6579
|
-
|
|
6579
|
+
g.value,
|
|
6580
6580
|
void 0,
|
|
6581
6581
|
{ trim: !0 }
|
|
6582
6582
|
]
|
|
@@ -6649,7 +6649,7 @@ const Kc = ["title"], Yc = {
|
|
|
6649
6649
|
(u(!0), m(De, null, Ne(J.value, (A) => (u(), m("li", {
|
|
6650
6650
|
key: A.id,
|
|
6651
6651
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-50",
|
|
6652
|
-
onClick: (F) =>
|
|
6652
|
+
onClick: (F) => be(A)
|
|
6653
6653
|
}, ie(A.title), 9, np))), 128))
|
|
6654
6654
|
])) : (u(), m("div", lp, ie(se.value), 1))
|
|
6655
6655
|
])
|
|
@@ -6797,7 +6797,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6797
6797
|
},
|
|
6798
6798
|
{ deep: !0, immediate: !0 }
|
|
6799
6799
|
);
|
|
6800
|
-
const f = (S, $,
|
|
6800
|
+
const f = (S, $, v) => Math.min(Math.max(S, $), v), c = () => {
|
|
6801
6801
|
o.value = !0;
|
|
6802
6802
|
}, w = () => {
|
|
6803
6803
|
if (!Number.isFinite(r.value) || !Number.isFinite(s.value))
|
|
@@ -6815,7 +6815,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6815
6815
|
}),
|
|
6816
6816
|
o.value ? (u(), m("div", yp, [
|
|
6817
6817
|
Pe(d("input", {
|
|
6818
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
6818
|
+
"onUpdate:modelValue": $[0] || ($[0] = (v) => r.value = v),
|
|
6819
6819
|
type: "number",
|
|
6820
6820
|
step: "0.0001",
|
|
6821
6821
|
min: "-90",
|
|
@@ -6831,7 +6831,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6831
6831
|
]
|
|
6832
6832
|
]),
|
|
6833
6833
|
Pe(d("input", {
|
|
6834
|
-
"onUpdate:modelValue": $[1] || ($[1] = (
|
|
6834
|
+
"onUpdate:modelValue": $[1] || ($[1] = (v) => s.value = v),
|
|
6835
6835
|
type: "number",
|
|
6836
6836
|
step: "0.0001",
|
|
6837
6837
|
min: "-180",
|
|
@@ -6912,8 +6912,8 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6912
6912
|
{ id: "m2", label: "м²" }
|
|
6913
6913
|
], o = () => {
|
|
6914
6914
|
n.value = !n.value;
|
|
6915
|
-
}, r = (
|
|
6916
|
-
const
|
|
6915
|
+
}, r = (v, h) => {
|
|
6916
|
+
const g = (j) => j * Math.PI / 180, M = g(h.lat - v.lat), b = g(h.lng - v.lng), C = g(v.lat), D = g(h.lat), U = Math.sin(M / 2), X = Math.sin(b / 2);
|
|
6917
6917
|
return 6371e3 * (2 * Math.asin(
|
|
6918
6918
|
Math.sqrt(
|
|
6919
6919
|
U * U + Math.cos(C) * Math.cos(D) * X * X
|
|
@@ -6921,54 +6921,54 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6921
6921
|
));
|
|
6922
6922
|
}, s = y(() => {
|
|
6923
6923
|
if (t.points.length < 2) return 0;
|
|
6924
|
-
let
|
|
6924
|
+
let v = 0;
|
|
6925
6925
|
for (let h = 1; h < t.points.length; h += 1)
|
|
6926
|
-
|
|
6927
|
-
return t.isShapeClosed && t.points.length >= 2 && (
|
|
6926
|
+
v += r(t.points[h - 1].coords, t.points[h].coords);
|
|
6927
|
+
return t.isShapeClosed && t.points.length >= 2 && (v += r(
|
|
6928
6928
|
t.points[t.points.length - 1].coords,
|
|
6929
6929
|
t.points[0].coords
|
|
6930
|
-
)),
|
|
6930
|
+
)), v;
|
|
6931
6931
|
}), f = y(() => s.value >= 1e3 ? `${tn(s.value / 1e3)} км` : `${tn(s.value)} м`);
|
|
6932
|
-
function c(
|
|
6933
|
-
if (
|
|
6934
|
-
const h =
|
|
6932
|
+
function c(v) {
|
|
6933
|
+
if (v.length < 3) return 0;
|
|
6934
|
+
const h = v[0].lat, g = v[0].lng, M = (C, D) => {
|
|
6935
6935
|
const U = (C - h) * 110574;
|
|
6936
|
-
return { x: (D -
|
|
6936
|
+
return { x: (D - g) * 111320 * Math.cos(h * Math.PI / 180), y: U };
|
|
6937
6937
|
};
|
|
6938
6938
|
let b = 0;
|
|
6939
|
-
for (let C = 0; C <
|
|
6940
|
-
const D = (C + 1) %
|
|
6939
|
+
for (let C = 0; C < v.length; C++) {
|
|
6940
|
+
const D = (C + 1) % v.length, U = M(v[C].lat, v[C].lng), X = M(v[D].lat, v[D].lng);
|
|
6941
6941
|
b += U.x * X.y - U.y * X.x;
|
|
6942
6942
|
}
|
|
6943
6943
|
return Math.abs(b) * 0.5;
|
|
6944
6944
|
}
|
|
6945
6945
|
const w = y(() => {
|
|
6946
6946
|
if (!t.isShapeClosed || t.points.length < 3) return 0;
|
|
6947
|
-
const
|
|
6948
|
-
return c(
|
|
6947
|
+
const v = t.points.map((h) => h.coords);
|
|
6948
|
+
return c(v);
|
|
6949
6949
|
}), x = y(() => w.value > 0), S = y(() => {
|
|
6950
|
-
const
|
|
6951
|
-
if (
|
|
6950
|
+
const v = w.value;
|
|
6951
|
+
if (v === 0) return "—";
|
|
6952
6952
|
if (a.value === "km2") {
|
|
6953
|
-
const
|
|
6954
|
-
return `${tn(
|
|
6953
|
+
const g = v / 1e6;
|
|
6954
|
+
return `${tn(g)} км²`;
|
|
6955
6955
|
}
|
|
6956
6956
|
if (a.value === "ha") {
|
|
6957
|
-
const
|
|
6958
|
-
return `${tn(
|
|
6957
|
+
const g = v / 1e4;
|
|
6958
|
+
return `${tn(g)} га`;
|
|
6959
6959
|
}
|
|
6960
|
-
const h =
|
|
6960
|
+
const h = v >= 1 ? Math.round(v) : v;
|
|
6961
6961
|
return `${tn(h)} м²`;
|
|
6962
6962
|
}), $ = y(() => {
|
|
6963
|
-
const
|
|
6964
|
-
return
|
|
6963
|
+
const v = t.points.length;
|
|
6964
|
+
return v === 1 ? "1 точка" : v >= 2 && v <= 4 ? `${v} точки` : `${v} точок`;
|
|
6965
6965
|
});
|
|
6966
6966
|
return ye(
|
|
6967
6967
|
() => t.points.length,
|
|
6968
6968
|
() => {
|
|
6969
6969
|
t.points.length === 0 && (n.value = !1);
|
|
6970
6970
|
}
|
|
6971
|
-
), (
|
|
6971
|
+
), (v, h) => (u(), m("div", wp, [
|
|
6972
6972
|
d("button", xp, [
|
|
6973
6973
|
d("span", kp, [
|
|
6974
6974
|
G(R(ln), {
|
|
@@ -6989,17 +6989,17 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6989
6989
|
]),
|
|
6990
6990
|
h[2] || (h[2] = d("span", { class: "text-xs font-medium text-gray-600 flex-1" }, "Площа", -1)),
|
|
6991
6991
|
d("div", Mp, [
|
|
6992
|
-
(u(), m(De, null, Ne(l, (
|
|
6993
|
-
key:
|
|
6992
|
+
(u(), m(De, null, Ne(l, (g, M) => d("button", {
|
|
6993
|
+
key: g.id,
|
|
6994
6994
|
type: "button",
|
|
6995
6995
|
class: re([
|
|
6996
6996
|
"px-2.5 py-1 text-xs font-medium transition-colors border-r border-gray-200 last:border-r-0",
|
|
6997
6997
|
M === 0 && "rounded-l-md",
|
|
6998
6998
|
M === l.length - 1 && "rounded-r-md",
|
|
6999
|
-
a.value ===
|
|
6999
|
+
a.value === g.id ? "bg-white text-green-600 font-semibold shadow-sm" : "text-gray-600 hover:bg-gray-50"
|
|
7000
7000
|
]),
|
|
7001
|
-
onClick: Te((b) => a.value =
|
|
7002
|
-
}, ie(
|
|
7001
|
+
onClick: Te((b) => a.value = g.id, ["stop"])
|
|
7002
|
+
}, ie(g.label), 11, Lp)), 64))
|
|
7003
7003
|
])
|
|
7004
7004
|
]),
|
|
7005
7005
|
d("div", Vp, [
|
|
@@ -7021,13 +7021,13 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7021
7021
|
}, " Координати ")
|
|
7022
7022
|
]),
|
|
7023
7023
|
n.value ? (u(), m("div", Ep, [
|
|
7024
|
-
(u(!0), m(De, null, Ne(
|
|
7025
|
-
key:
|
|
7026
|
-
id:
|
|
7024
|
+
(u(!0), m(De, null, Ne(v.points, (g, M) => (u(), $e(bp, {
|
|
7025
|
+
key: g.id,
|
|
7026
|
+
id: g.id,
|
|
7027
7027
|
index: M + 1,
|
|
7028
|
-
coords:
|
|
7029
|
-
onUpdate: h[0] || (h[0] = (b) =>
|
|
7030
|
-
onDelete: (b) =>
|
|
7028
|
+
coords: g.coords,
|
|
7029
|
+
onUpdate: h[0] || (h[0] = (b) => v.$emit("update-point", b)),
|
|
7030
|
+
onDelete: (b) => v.$emit("delete-point", g.id)
|
|
7031
7031
|
}, null, 8, ["id", "index", "coords", "onDelete"]))), 128))
|
|
7032
7032
|
])) : z("", !0)
|
|
7033
7033
|
]));
|
|
@@ -7127,15 +7127,15 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7127
7127
|
let x = 1;
|
|
7128
7128
|
const S = () => l.value.map((ee) => ({ id: ee.id, coords: { ...ee.coords } })), $ = () => {
|
|
7129
7129
|
l.value.length < 3 && s.value && (s.value = !1, a("shape-closed-change", !1)), a("points-change", S());
|
|
7130
|
-
},
|
|
7130
|
+
}, v = () => {
|
|
7131
7131
|
const ee = x;
|
|
7132
7132
|
return x += 1, ee;
|
|
7133
7133
|
}, h = (ee) => {
|
|
7134
7134
|
l.value = [
|
|
7135
7135
|
...l.value,
|
|
7136
|
-
{ id:
|
|
7136
|
+
{ id: v(), coords: { lat: ee.lat, lng: ee.lng } }
|
|
7137
7137
|
], $();
|
|
7138
|
-
},
|
|
7138
|
+
}, g = ({
|
|
7139
7139
|
id: ee,
|
|
7140
7140
|
coords: te
|
|
7141
7141
|
}) => {
|
|
@@ -7148,7 +7148,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7148
7148
|
}, b = () => {
|
|
7149
7149
|
l.value = [], s.value && (s.value = !1, a("shape-closed-change", !1)), $();
|
|
7150
7150
|
}, C = (ee) => {
|
|
7151
|
-
|
|
7151
|
+
g(ee);
|
|
7152
7152
|
}, D = (ee) => {
|
|
7153
7153
|
M(ee);
|
|
7154
7154
|
}, U = () => {
|
|
@@ -7256,32 +7256,32 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7256
7256
|
labelMode: {}
|
|
7257
7257
|
},
|
|
7258
7258
|
setup(e) {
|
|
7259
|
-
function t(
|
|
7260
|
-
const
|
|
7259
|
+
function t(v, h) {
|
|
7260
|
+
const g = (X) => X * Math.PI / 180, M = g(h.lat - v.lat), b = g(h.lng - v.lng), C = g(v.lat), D = g(h.lat);
|
|
7261
7261
|
return 6371e3 * (2 * Math.asin(
|
|
7262
7262
|
Math.sqrt(
|
|
7263
7263
|
Math.sin(M / 2) ** 2 + Math.cos(C) * Math.cos(D) * Math.sin(b / 2) ** 2
|
|
7264
7264
|
)
|
|
7265
7265
|
));
|
|
7266
7266
|
}
|
|
7267
|
-
function n(
|
|
7268
|
-
return Ta(
|
|
7267
|
+
function n(v) {
|
|
7268
|
+
return Ta(v);
|
|
7269
7269
|
}
|
|
7270
7270
|
const a = e;
|
|
7271
7271
|
function l() {
|
|
7272
7272
|
return { type: "FeatureCollection", features: [] };
|
|
7273
7273
|
}
|
|
7274
|
-
function o(
|
|
7275
|
-
const M =
|
|
7274
|
+
function o(v, h, g) {
|
|
7275
|
+
const M = g ?? "general", b = [];
|
|
7276
7276
|
let C = 0;
|
|
7277
7277
|
b.push(0);
|
|
7278
|
-
for (let D = 1; D <
|
|
7279
|
-
C += t(
|
|
7280
|
-
return h &&
|
|
7278
|
+
for (let D = 1; D < v.length; D++)
|
|
7279
|
+
C += t(v[D - 1].coords, v[D].coords), b.push(C);
|
|
7280
|
+
return h && v.length >= 2 && (C += t(v[v.length - 1].coords, v[0].coords)), {
|
|
7281
7281
|
type: "FeatureCollection",
|
|
7282
|
-
features:
|
|
7282
|
+
features: v.map((D, U) => {
|
|
7283
7283
|
const X = M === "general" ? U === 0 ? "0" : n(b[U]) : U === 0 ? "0" : n(
|
|
7284
|
-
t(
|
|
7284
|
+
t(v[U - 1].coords, v[U].coords)
|
|
7285
7285
|
);
|
|
7286
7286
|
return {
|
|
7287
7287
|
type: "Feature",
|
|
@@ -7294,14 +7294,14 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7294
7294
|
})
|
|
7295
7295
|
};
|
|
7296
7296
|
}
|
|
7297
|
-
function r(
|
|
7298
|
-
if (
|
|
7299
|
-
const
|
|
7300
|
-
for (let M = 0; M <
|
|
7301
|
-
const b = M ===
|
|
7302
|
-
if (b >=
|
|
7303
|
-
const C =
|
|
7304
|
-
|
|
7297
|
+
function r(v, h) {
|
|
7298
|
+
if (v.length < 2) return l();
|
|
7299
|
+
const g = [];
|
|
7300
|
+
for (let M = 0; M < v.length; M++) {
|
|
7301
|
+
const b = M === v.length - 1 && h ? 0 : M + 1;
|
|
7302
|
+
if (b >= v.length) break;
|
|
7303
|
+
const C = v[M].coords, D = v[b].coords, U = t(C, D);
|
|
7304
|
+
g.push({
|
|
7305
7305
|
type: "Feature",
|
|
7306
7306
|
geometry: {
|
|
7307
7307
|
type: "LineString",
|
|
@@ -7313,25 +7313,25 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7313
7313
|
properties: { distance: n(U) }
|
|
7314
7314
|
});
|
|
7315
7315
|
}
|
|
7316
|
-
return { type: "FeatureCollection", features:
|
|
7316
|
+
return { type: "FeatureCollection", features: g };
|
|
7317
7317
|
}
|
|
7318
|
-
function s(
|
|
7319
|
-
if (
|
|
7320
|
-
const
|
|
7321
|
-
return h &&
|
|
7318
|
+
function s(v, h) {
|
|
7319
|
+
if (v.length < 2) return l();
|
|
7320
|
+
const g = v.map((M) => [M.coords.lng, M.coords.lat]);
|
|
7321
|
+
return h && g.push(g[0]), {
|
|
7322
7322
|
type: "FeatureCollection",
|
|
7323
7323
|
features: [
|
|
7324
7324
|
{
|
|
7325
7325
|
type: "Feature",
|
|
7326
|
-
geometry: { type: "LineString", coordinates:
|
|
7326
|
+
geometry: { type: "LineString", coordinates: g },
|
|
7327
7327
|
properties: {}
|
|
7328
7328
|
}
|
|
7329
7329
|
]
|
|
7330
7330
|
};
|
|
7331
7331
|
}
|
|
7332
|
-
function f(
|
|
7333
|
-
if (
|
|
7334
|
-
const h =
|
|
7332
|
+
function f(v) {
|
|
7333
|
+
if (v.length < 3) return l();
|
|
7334
|
+
const h = v.map((g) => [g.coords.lng, g.coords.lat]);
|
|
7335
7335
|
return h.push(h[0]), {
|
|
7336
7336
|
type: "FeatureCollection",
|
|
7337
7337
|
features: [
|
|
@@ -7344,11 +7344,11 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7344
7344
|
};
|
|
7345
7345
|
}
|
|
7346
7346
|
let c = !1;
|
|
7347
|
-
function w(
|
|
7348
|
-
|
|
7347
|
+
function w(v) {
|
|
7348
|
+
v.getSource(kt) || (v.addSource(kt, {
|
|
7349
7349
|
type: "geojson",
|
|
7350
7350
|
data: l()
|
|
7351
|
-
}),
|
|
7351
|
+
}), v.addLayer({
|
|
7352
7352
|
id: `${kt}-circle`,
|
|
7353
7353
|
type: "circle",
|
|
7354
7354
|
source: kt,
|
|
@@ -7358,7 +7358,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7358
7358
|
"circle-stroke-width": 2,
|
|
7359
7359
|
"circle-stroke-color": "#ffffff"
|
|
7360
7360
|
}
|
|
7361
|
-
}),
|
|
7361
|
+
}), v.addLayer({
|
|
7362
7362
|
id: `${kt}-labels`,
|
|
7363
7363
|
type: "symbol",
|
|
7364
7364
|
source: kt,
|
|
@@ -7372,10 +7372,10 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7372
7372
|
"text-halo-color": "#ffffff",
|
|
7373
7373
|
"text-halo-width": 1
|
|
7374
7374
|
}
|
|
7375
|
-
})),
|
|
7375
|
+
})), v.getSource(Nt) || (v.addSource(Nt, {
|
|
7376
7376
|
type: "geojson",
|
|
7377
7377
|
data: l()
|
|
7378
|
-
}),
|
|
7378
|
+
}), v.addLayer({
|
|
7379
7379
|
id: `${Nt}-labels`,
|
|
7380
7380
|
type: "symbol",
|
|
7381
7381
|
source: Nt,
|
|
@@ -7391,10 +7391,10 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7391
7391
|
"text-halo-color": "#ffffff",
|
|
7392
7392
|
"text-halo-width": 1.5
|
|
7393
7393
|
}
|
|
7394
|
-
})),
|
|
7394
|
+
})), v.getSource(Bt) || (v.addSource(Bt, {
|
|
7395
7395
|
type: "geojson",
|
|
7396
7396
|
data: l()
|
|
7397
|
-
}),
|
|
7397
|
+
}), v.addLayer({
|
|
7398
7398
|
id: `${Bt}-layer`,
|
|
7399
7399
|
type: "line",
|
|
7400
7400
|
source: Bt,
|
|
@@ -7402,10 +7402,10 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7402
7402
|
"line-color": "#3b82f6",
|
|
7403
7403
|
"line-width": 2
|
|
7404
7404
|
}
|
|
7405
|
-
})),
|
|
7405
|
+
})), v.getSource(Rt) || (v.addSource(Rt, {
|
|
7406
7406
|
type: "geojson",
|
|
7407
7407
|
data: l()
|
|
7408
|
-
}),
|
|
7408
|
+
}), v.addLayer({
|
|
7409
7409
|
id: `${Rt}-layer`,
|
|
7410
7410
|
type: "fill",
|
|
7411
7411
|
source: Rt,
|
|
@@ -7415,27 +7415,27 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7415
7415
|
}
|
|
7416
7416
|
})), c = !0;
|
|
7417
7417
|
}
|
|
7418
|
-
function x(
|
|
7419
|
-
if (
|
|
7418
|
+
function x(v) {
|
|
7419
|
+
if (v) {
|
|
7420
7420
|
try {
|
|
7421
|
-
|
|
7421
|
+
v.getLayer(`${Rt}-layer`) && v.removeLayer(`${Rt}-layer`), v.getSource(Rt) && v.removeSource(Rt), v.getLayer(`${Bt}-layer`) && v.removeLayer(`${Bt}-layer`), v.getSource(Bt) && v.removeSource(Bt), v.getLayer(`${Nt}-labels`) && v.removeLayer(`${Nt}-labels`), v.getSource(Nt) && v.removeSource(Nt), v.getLayer(`${kt}-labels`) && v.removeLayer(`${kt}-labels`), v.getLayer(`${kt}-circle`) && v.removeLayer(`${kt}-circle`), v.getSource(kt) && v.removeSource(kt);
|
|
7422
7422
|
} catch {
|
|
7423
7423
|
}
|
|
7424
7424
|
c = !1;
|
|
7425
7425
|
}
|
|
7426
7426
|
}
|
|
7427
|
-
function S(
|
|
7428
|
-
if (!
|
|
7429
|
-
const h =
|
|
7427
|
+
function S(v) {
|
|
7428
|
+
if (!v) return;
|
|
7429
|
+
const h = v.getSource(kt), g = v.getSource(Bt), M = v.getSource(Rt), b = v.getSource(Nt), C = a.points, D = a.labelMode ?? "general";
|
|
7430
7430
|
h && h.setData(
|
|
7431
7431
|
o(C, a.isShapeClosed, D)
|
|
7432
|
-
),
|
|
7432
|
+
), g && g.setData(s(C, a.isShapeClosed)), M && M.setData(f(C)), b && b.setData(
|
|
7433
7433
|
D === "topoint" ? r(C, a.isShapeClosed) : l()
|
|
7434
7434
|
);
|
|
7435
7435
|
}
|
|
7436
7436
|
function $() {
|
|
7437
|
-
const
|
|
7438
|
-
|
|
7437
|
+
const v = a.map;
|
|
7438
|
+
v && (c || w(v), S(v));
|
|
7439
7439
|
}
|
|
7440
7440
|
return ye(
|
|
7441
7441
|
() => [a.points, a.isShapeClosed, a.labelMode],
|
|
@@ -7447,7 +7447,7 @@ const gp = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7447
7447
|
{ immediate: !0 }
|
|
7448
7448
|
), It(() => {
|
|
7449
7449
|
x(a.map);
|
|
7450
|
-
}), (
|
|
7450
|
+
}), (v, h) => null;
|
|
7451
7451
|
}
|
|
7452
7452
|
});
|
|
7453
7453
|
function lf(e = {}) {
|
|
@@ -7550,11 +7550,11 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
7550
7550
|
const n = e, a = t, l = ca(), o = y(() => {
|
|
7551
7551
|
const i = l?.multiple, p = l?.multi, k = (L) => L === "" || L === !0 || L === "true" || L === 1 || L === "1";
|
|
7552
7552
|
return !!n.multi || !!n.multiple || k(p) || k(i);
|
|
7553
|
-
}), r = y(() => !!n.disabled), s = V(!1), f = V(null), c = V(0), w = V(""), x = V(null), S = V([]), $ = V(null),
|
|
7553
|
+
}), r = y(() => !!n.disabled), s = V(!1), f = V(null), c = V(0), w = V(""), x = V(null), S = V([]), $ = V(null), v = V(null), h = lf({
|
|
7554
7554
|
onActivate() {
|
|
7555
|
-
if (
|
|
7555
|
+
if (we)
|
|
7556
7556
|
try {
|
|
7557
|
-
|
|
7557
|
+
we.changeMode("simple_select", { featureIds: [] });
|
|
7558
7558
|
} catch {
|
|
7559
7559
|
}
|
|
7560
7560
|
w.value = "";
|
|
@@ -7562,7 +7562,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
7562
7562
|
onDeactivate() {
|
|
7563
7563
|
}
|
|
7564
7564
|
});
|
|
7565
|
-
function
|
|
7565
|
+
function g() {
|
|
7566
7566
|
h.toggleRuler();
|
|
7567
7567
|
}
|
|
7568
7568
|
const M = Wn(), b = M?.appContext?.config?.globalProperties?.$settings ?? {}, C = b?.map ?? {}, D = M?.vnode?.props ?? {};
|
|
@@ -7754,7 +7754,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
7754
7754
|
}
|
|
7755
7755
|
};
|
|
7756
7756
|
}
|
|
7757
|
-
const
|
|
7757
|
+
const be = ce(), Se = Object.keys(be), ze = V(Se.length ? Se[0] : "");
|
|
7758
7758
|
function Ye() {
|
|
7759
7759
|
const i = Array.isArray(C.overlays) && C.overlays.length ? C.overlays : b.overlays;
|
|
7760
7760
|
return !Array.isArray(i) || !i.length ? {} : i.map((k, L) => {
|
|
@@ -7831,7 +7831,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
7831
7831
|
]
|
|
7832
7832
|
};
|
|
7833
7833
|
}
|
|
7834
|
-
let qe = null, pt = null, H = null,
|
|
7834
|
+
let qe = null, pt = null, H = null, we = null, Xe = [], gt = null, $t = null, ft = null, Ht = !1, Wt = !1, Jt = !1, qt = null;
|
|
7835
7835
|
function tl() {
|
|
7836
7836
|
return {
|
|
7837
7837
|
onSetup() {
|
|
@@ -8036,7 +8036,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8036
8036
|
];
|
|
8037
8037
|
function _n() {
|
|
8038
8038
|
const i = ze.value;
|
|
8039
|
-
return !i || !
|
|
8039
|
+
return !i || !be[i]?.url ? "" : be[i].url;
|
|
8040
8040
|
}
|
|
8041
8041
|
function $n(i, p) {
|
|
8042
8042
|
return i?.id ? String(i.id) : i?.url ? `${i.url}-${p}` : `layer-${p}`;
|
|
@@ -8321,7 +8321,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8321
8321
|
}
|
|
8322
8322
|
}
|
|
8323
8323
|
function fn(i) {
|
|
8324
|
-
if (!
|
|
8324
|
+
if (!be[i] || (ze.value = i, !H)) return;
|
|
8325
8325
|
const p = _n();
|
|
8326
8326
|
if (!p) return;
|
|
8327
8327
|
const k = H.getSource("rasterSource");
|
|
@@ -8329,14 +8329,14 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8329
8329
|
k.setTiles([p]), ut();
|
|
8330
8330
|
return;
|
|
8331
8331
|
}
|
|
8332
|
-
const L = H.getCenter?.(), I = H.getZoom?.(), Y =
|
|
8332
|
+
const L = H.getCenter?.(), I = H.getZoom?.(), Y = we?.getAll?.();
|
|
8333
8333
|
H.setStyle(et(p)), H.once("style.load", () => {
|
|
8334
8334
|
if (H && (L && Number.isFinite(I) && H.jumpTo({ center: [L.lng, L.lat], zoom: I }), st(), St(), le.value.forEach((he) => {
|
|
8335
8335
|
const ke = Re[he];
|
|
8336
8336
|
ke && Qe(ke);
|
|
8337
|
-
}), ut(), Y?.features?.length &&
|
|
8337
|
+
}), ut(), Y?.features?.length && we))
|
|
8338
8338
|
try {
|
|
8339
|
-
Y.features.forEach((he) =>
|
|
8339
|
+
Y.features.forEach((he) => we.add(he)), c.value = Y.features.length;
|
|
8340
8340
|
} catch {
|
|
8341
8341
|
c.value = 0;
|
|
8342
8342
|
}
|
|
@@ -8454,7 +8454,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8454
8454
|
return i ? i.split(".").map((p) => Number(p)).filter((p) => Number.isInteger(p) && p >= 0) : [];
|
|
8455
8455
|
}
|
|
8456
8456
|
function Pl(i) {
|
|
8457
|
-
return !
|
|
8457
|
+
return !we || !i ? null : typeof we.get == "function" ? we.get(i) ?? null : we.getAll?.()?.features?.find((k) => String(k?.id ?? "") === i) ?? null;
|
|
8458
8458
|
}
|
|
8459
8459
|
function Bl(i) {
|
|
8460
8460
|
const p = i?.properties?.id ?? i?.id;
|
|
@@ -8472,7 +8472,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8472
8472
|
return Bl(L);
|
|
8473
8473
|
}
|
|
8474
8474
|
function ja(i, p) {
|
|
8475
|
-
if (!
|
|
8475
|
+
if (!we || !i || !p.length) return;
|
|
8476
8476
|
const k = Pl(i);
|
|
8477
8477
|
if (!k?.geometry) return;
|
|
8478
8478
|
const L = Ba(k.geometry, p);
|
|
@@ -8484,14 +8484,14 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8484
8484
|
};
|
|
8485
8485
|
Je = !0, je = !0;
|
|
8486
8486
|
try {
|
|
8487
|
-
|
|
8487
|
+
we.delete(i), we.add(I);
|
|
8488
8488
|
} finally {
|
|
8489
8489
|
je = !1, Je = !1;
|
|
8490
8490
|
}
|
|
8491
8491
|
Yt(), Pt();
|
|
8492
8492
|
}
|
|
8493
8493
|
function za(i) {
|
|
8494
|
-
if (!H || !
|
|
8494
|
+
if (!H || !we || r.value || h.isRulerActive.value || w.value !== "edit") return;
|
|
8495
8495
|
const p = i?.point;
|
|
8496
8496
|
if (!p) return;
|
|
8497
8497
|
const k = [
|
|
@@ -8624,16 +8624,16 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8624
8624
|
H.fitBounds(p, { padding: 30, duration: 250, maxZoom: 18 }), K();
|
|
8625
8625
|
}
|
|
8626
8626
|
function dl() {
|
|
8627
|
-
if (!
|
|
8627
|
+
if (!we) {
|
|
8628
8628
|
c.value = 0;
|
|
8629
8629
|
return;
|
|
8630
8630
|
}
|
|
8631
|
-
const i =
|
|
8631
|
+
const i = we.getAll();
|
|
8632
8632
|
c.value = i?.features?.length ?? 0;
|
|
8633
8633
|
}
|
|
8634
8634
|
function vn() {
|
|
8635
|
-
if (!
|
|
8636
|
-
const p =
|
|
8635
|
+
if (!we) return null;
|
|
8636
|
+
const p = we.getAll?.()?.features ?? [], k = (Y) => !!Y && p.some((he) => String(he?.id ?? "") === String(Y ?? "")), L = we.getSelectedIds?.();
|
|
8637
8637
|
if (Array.isArray(L) && L.length > 0) {
|
|
8638
8638
|
const Y = L[0];
|
|
8639
8639
|
return Y != null ? String(Y) : null;
|
|
@@ -8644,8 +8644,8 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8644
8644
|
return I?.id !== void 0 && I?.id !== null ? String(I.id) : null;
|
|
8645
8645
|
}
|
|
8646
8646
|
function Yt() {
|
|
8647
|
-
if (!
|
|
8648
|
-
const i =
|
|
8647
|
+
if (!we) return;
|
|
8648
|
+
const i = we.getAll();
|
|
8649
8649
|
if (c.value = i?.features?.length ?? 0, !i?.features?.length) {
|
|
8650
8650
|
Xe = [], S.value = [], gt = null, ft = null, x.value = null, je || ($t = "__null__", a("update:modelValue", null));
|
|
8651
8651
|
return;
|
|
@@ -8657,45 +8657,45 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8657
8657
|
}
|
|
8658
8658
|
}
|
|
8659
8659
|
function Cn() {
|
|
8660
|
-
if (!
|
|
8661
|
-
(
|
|
8660
|
+
if (!we) return;
|
|
8661
|
+
(we.getAll()?.features || []).forEach((p) => we.delete(p.id)), S.value = [], dl();
|
|
8662
8662
|
}
|
|
8663
8663
|
function Mn(i) {
|
|
8664
|
-
if (!
|
|
8664
|
+
if (!we) return;
|
|
8665
8665
|
const p = mn(i), k = o.value ? p : p.slice(0, 1);
|
|
8666
8666
|
je = !0, Cn(), k.forEach((Y) => {
|
|
8667
8667
|
try {
|
|
8668
|
-
|
|
8668
|
+
we.add(Y);
|
|
8669
8669
|
} catch {
|
|
8670
8670
|
}
|
|
8671
|
-
}), je = !1, Xe = (
|
|
8671
|
+
}), je = !1, Xe = (we.getAll?.()?.features ?? k).map(ol).filter(Boolean), il(Xe), ft = null;
|
|
8672
8672
|
const I = Et(Xe[Xe.length - 1]?.geometry ?? null);
|
|
8673
8673
|
gt = Et(I), dl(), rl(I), I && (zl(I), r.value || Pt());
|
|
8674
8674
|
}
|
|
8675
8675
|
function Wa() {
|
|
8676
|
-
|
|
8676
|
+
we && (je = !0, Cn(), Xe.forEach((i) => {
|
|
8677
8677
|
try {
|
|
8678
|
-
|
|
8678
|
+
we.add(i);
|
|
8679
8679
|
} catch {
|
|
8680
8680
|
}
|
|
8681
8681
|
}), je = !1, il(Xe), dl(), sl(ft));
|
|
8682
8682
|
}
|
|
8683
8683
|
function rn() {
|
|
8684
|
-
if (
|
|
8684
|
+
if (we) {
|
|
8685
8685
|
try {
|
|
8686
|
-
|
|
8686
|
+
we.changeMode("simple_select", { featureIds: [] });
|
|
8687
8687
|
} catch {
|
|
8688
8688
|
}
|
|
8689
8689
|
w.value = "";
|
|
8690
8690
|
}
|
|
8691
8691
|
}
|
|
8692
8692
|
function Ln(i) {
|
|
8693
|
-
if (r.value || !
|
|
8693
|
+
if (r.value || !we) return;
|
|
8694
8694
|
h.isRulerActive.value && h.closeRuler(), Jt = !0, rn(), w.value = i;
|
|
8695
8695
|
const p = i === "marker" ? "draw_point" : i === "polyline" ? "draw_line_string" : i === "rectangle" ? "draw_rectangle" : "draw_polygon";
|
|
8696
8696
|
o.value || (je = !0, Cn(), je = !1);
|
|
8697
8697
|
try {
|
|
8698
|
-
|
|
8698
|
+
we.changeMode(p);
|
|
8699
8699
|
} catch {
|
|
8700
8700
|
w.value = "";
|
|
8701
8701
|
} finally {
|
|
@@ -8705,25 +8705,25 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8705
8705
|
}
|
|
8706
8706
|
}
|
|
8707
8707
|
function Pt(i) {
|
|
8708
|
-
if (r.value || !
|
|
8708
|
+
if (r.value || !we || !we.getAll()?.features?.length) return;
|
|
8709
8709
|
const k = i || vn();
|
|
8710
8710
|
if (k)
|
|
8711
8711
|
try {
|
|
8712
|
-
|
|
8712
|
+
we.changeMode("direct_select", { featureId: k }), ft = k, sl(ft), w.value = "edit";
|
|
8713
8713
|
} catch {
|
|
8714
8714
|
w.value = "";
|
|
8715
8715
|
}
|
|
8716
8716
|
}
|
|
8717
8717
|
function qa(i) {
|
|
8718
|
-
r.value || !
|
|
8718
|
+
r.value || !we || !i || Pt(i);
|
|
8719
8719
|
}
|
|
8720
8720
|
function Ka() {
|
|
8721
|
-
if (!(r.value || !
|
|
8721
|
+
if (!(r.value || !we)) {
|
|
8722
8722
|
if (o.value) {
|
|
8723
8723
|
const i = vn();
|
|
8724
8724
|
if (i)
|
|
8725
8725
|
try {
|
|
8726
|
-
Ht = !0,
|
|
8726
|
+
Ht = !0, we.delete(i), Ht = !1, Yt();
|
|
8727
8727
|
const p = vn();
|
|
8728
8728
|
p ? Pt(p) : rn();
|
|
8729
8729
|
return;
|
|
@@ -8763,7 +8763,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8763
8763
|
Ce.value = !1, Oe.value = [];
|
|
8764
8764
|
}
|
|
8765
8765
|
function to() {
|
|
8766
|
-
if (r.value || !
|
|
8766
|
+
if (r.value || !we) return;
|
|
8767
8767
|
const i = jc(
|
|
8768
8768
|
Le.value.coordinates ?? "",
|
|
8769
8769
|
Le.value.format || "decimal",
|
|
@@ -8799,7 +8799,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8799
8799
|
});
|
|
8800
8800
|
}
|
|
8801
8801
|
function lo(i) {
|
|
8802
|
-
if (r.value || !
|
|
8802
|
+
if (r.value || !we) return;
|
|
8803
8803
|
ae.value = !1;
|
|
8804
8804
|
const p = i.target, k = p.files?.[0];
|
|
8805
8805
|
if (!k) return;
|
|
@@ -8834,8 +8834,8 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8834
8834
|
}, L.readAsText(k);
|
|
8835
8835
|
}
|
|
8836
8836
|
function ao() {
|
|
8837
|
-
if (r.value || !
|
|
8838
|
-
const i =
|
|
8837
|
+
if (r.value || !we) return;
|
|
8838
|
+
const i = we.getAll(), p = new Blob([JSON.stringify(i, null, 2)], { type: "application/json" }), k = URL.createObjectURL(p), L = document.createElement("a");
|
|
8839
8839
|
L.href = k, L.download = "data.geojson", L.click(), URL.revokeObjectURL(k);
|
|
8840
8840
|
}
|
|
8841
8841
|
ot(async () => {
|
|
@@ -8851,7 +8851,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8851
8851
|
attributionControl: !1
|
|
8852
8852
|
}), $.value = H, H.addControl(new qe.NavigationControl({ showCompass: !0 }), "bottom-right"), H.on("load", () => {
|
|
8853
8853
|
if (!(!pt || !H)) {
|
|
8854
|
-
if (
|
|
8854
|
+
if (we = new pt({
|
|
8855
8855
|
displayControlsDefault: !1,
|
|
8856
8856
|
modes: {
|
|
8857
8857
|
...pt.modes,
|
|
@@ -8864,25 +8864,25 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8864
8864
|
trash: !1
|
|
8865
8865
|
},
|
|
8866
8866
|
styles: nl
|
|
8867
|
-
}), H.addControl(
|
|
8867
|
+
}), H.addControl(we), H.on("click", (k) => {
|
|
8868
8868
|
if (h.isRulerActive.value) {
|
|
8869
8869
|
const I = k?.lngLat;
|
|
8870
8870
|
if (!I) return;
|
|
8871
|
-
|
|
8871
|
+
v.value?.addPoint?.({ lat: I.lat, lng: I.lng });
|
|
8872
8872
|
return;
|
|
8873
8873
|
}
|
|
8874
|
-
if (!
|
|
8874
|
+
if (!we || r.value || w.value !== "edit") return;
|
|
8875
8875
|
const L = Na(k?.point);
|
|
8876
8876
|
!L || L === ft || requestAnimationFrame(() => {
|
|
8877
|
-
!
|
|
8877
|
+
!we || r.value || Pt(L);
|
|
8878
8878
|
});
|
|
8879
8879
|
}), H.on("draw.create", () => {
|
|
8880
|
-
if (
|
|
8880
|
+
if (we && !h.isRulerActive.value) {
|
|
8881
8881
|
if (!o.value) {
|
|
8882
|
-
const k =
|
|
8882
|
+
const k = we.getAll();
|
|
8883
8883
|
if (k.features.length > 1) {
|
|
8884
8884
|
const L = k.features[k.features.length - 1];
|
|
8885
|
-
je = !0, k.features.slice(0, -1).forEach((I) =>
|
|
8885
|
+
je = !0, k.features.slice(0, -1).forEach((I) => we.delete(I.id)), je = !1, L && (je = !0, we.add(L), je = !1);
|
|
8886
8886
|
}
|
|
8887
8887
|
}
|
|
8888
8888
|
Yt(), Pt();
|
|
@@ -8896,10 +8896,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8896
8896
|
return;
|
|
8897
8897
|
}
|
|
8898
8898
|
if (Wt = !0, Wa(), Wt = !1, w.value === "edit") {
|
|
8899
|
-
const Y = vn(), he = Y ? Pl(Y) :
|
|
8899
|
+
const Y = vn(), he = Y ? Pl(Y) : we?.getAll?.()?.features?.[0];
|
|
8900
8900
|
if (he?.id)
|
|
8901
8901
|
try {
|
|
8902
|
-
|
|
8902
|
+
we.changeMode("direct_select", { featureId: he.id }), ft = String(he.id);
|
|
8903
8903
|
} catch {
|
|
8904
8904
|
w.value = "";
|
|
8905
8905
|
}
|
|
@@ -8908,34 +8908,34 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8908
8908
|
}
|
|
8909
8909
|
Yt();
|
|
8910
8910
|
}), H.on("draw.delete", () => {
|
|
8911
|
-
Je || Ht || h.isRulerActive.value || w.value === "marker" || w.value === "polyline" || w.value === "polygon" || w.value === "rectangle" || (Yt(),
|
|
8911
|
+
Je || Ht || h.isRulerActive.value || w.value === "marker" || w.value === "polyline" || w.value === "polygon" || w.value === "rectangle" || (Yt(), we?.getAll?.()?.features?.length || (ft = null), w.value = "", rn());
|
|
8912
8912
|
}), H.on("draw.selectionchange", (k) => {
|
|
8913
|
-
if (!
|
|
8913
|
+
if (!we || Wt || h.isRulerActive.value || w.value === "marker" || w.value === "polyline" || w.value === "polygon" || w.value === "rectangle")
|
|
8914
8914
|
return;
|
|
8915
8915
|
const L = k?.features?.[0]?.id !== void 0 && k?.features?.[0]?.id !== null ? String(k.features[0].id) : null;
|
|
8916
8916
|
if (!r.value && L) {
|
|
8917
8917
|
if (w.value === "edit" && ft === L) return;
|
|
8918
8918
|
requestAnimationFrame(() => {
|
|
8919
|
-
!
|
|
8919
|
+
!we || r.value || Pt(L);
|
|
8920
8920
|
});
|
|
8921
8921
|
return;
|
|
8922
8922
|
}
|
|
8923
|
-
const I =
|
|
8923
|
+
const I = we.getSelectedIds?.(), Y = Array.isArray(I) && I.length > 0 ? String(I[0]) : null;
|
|
8924
8924
|
if (!r.value && Y) {
|
|
8925
8925
|
if (w.value === "edit" && ft === Y) return;
|
|
8926
8926
|
requestAnimationFrame(() => {
|
|
8927
|
-
!
|
|
8927
|
+
!we || r.value || Pt(Y);
|
|
8928
8928
|
});
|
|
8929
8929
|
return;
|
|
8930
8930
|
}
|
|
8931
8931
|
try {
|
|
8932
|
-
|
|
8932
|
+
we.changeMode("simple_select", { featureIds: [] });
|
|
8933
8933
|
} catch {
|
|
8934
8934
|
}
|
|
8935
8935
|
}), pe.value !== void 0) {
|
|
8936
8936
|
const k = pe.value;
|
|
8937
8937
|
pe.value = void 0, requestAnimationFrame(() => {
|
|
8938
|
-
|
|
8938
|
+
we && Mn(k);
|
|
8939
8939
|
});
|
|
8940
8940
|
}
|
|
8941
8941
|
st(), St(), le.value.forEach((k) => {
|
|
@@ -8949,11 +8949,11 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
8949
8949
|
}), dn(() => {
|
|
8950
8950
|
me && (clearTimeout(me), me = null), h.isRulerActive.value && h.closeRuler(), window.removeEventListener("click", Ul, !0), Object.values(Re).forEach((i) => {
|
|
8951
8951
|
H && _e(i);
|
|
8952
|
-
}), Kt(), qt?.remove && qt.remove(), qt = null, H?.remove && H.remove(), H = null,
|
|
8952
|
+
}), Kt(), qt?.remove && qt.remove(), qt = null, H?.remove && H.remove(), H = null, we = null, $.value = null;
|
|
8953
8953
|
}), ye(
|
|
8954
8954
|
() => n.modelValue,
|
|
8955
8955
|
(i) => {
|
|
8956
|
-
if (!
|
|
8956
|
+
if (!we) {
|
|
8957
8957
|
pe.value = i;
|
|
8958
8958
|
return;
|
|
8959
8959
|
}
|
|
@@ -9225,7 +9225,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9225
9225
|
key: 2,
|
|
9226
9226
|
class: re(["vs-btn", { "vs-active": R(h).isRulerActive.value }]),
|
|
9227
9227
|
title: "Лінійка",
|
|
9228
|
-
onClick:
|
|
9228
|
+
onClick: g
|
|
9229
9229
|
}, [
|
|
9230
9230
|
G(R(ba), { class: "vs-btn-icon" })
|
|
9231
9231
|
], 2)) : z("", !0),
|
|
@@ -9241,7 +9241,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9241
9241
|
T.value.ruler && R(h).isRulerActive.value ? (u(), $e(tf, {
|
|
9242
9242
|
key: 1,
|
|
9243
9243
|
ref_key: "rulerPanelRefEl",
|
|
9244
|
-
ref:
|
|
9244
|
+
ref: v,
|
|
9245
9245
|
onClose: p[7] || (p[7] = (k) => R(h).closeRuler()),
|
|
9246
9246
|
onTabChange: R(h).onRulerTabChange,
|
|
9247
9247
|
onPointsChange: R(h).onRulerPointsChange,
|
|
@@ -9274,7 +9274,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9274
9274
|
d("div", Cf, [
|
|
9275
9275
|
G(Rc, {
|
|
9276
9276
|
compact: "",
|
|
9277
|
-
basemaps: R(
|
|
9277
|
+
basemaps: R(be),
|
|
9278
9278
|
"active-base-key": ze.value,
|
|
9279
9279
|
"tile-overlays": R(We),
|
|
9280
9280
|
"active-tile-overlay-keys": O.value,
|
|
@@ -9365,12 +9365,12 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9365
9365
|
setup(e, { emit: t }) {
|
|
9366
9366
|
const n = e, a = t;
|
|
9367
9367
|
bt(n.style);
|
|
9368
|
-
const l = V(null), o = V(null), r = V(null), s = V(!1), f = V(""), c = Ke(e, "modelValue"), w = y(() => n.placeholder || "Add tag…"), x = y(() => c.value?.length === 0 && f.value === ""), S = y(() => !n.disabled && c.value?.length > 0), $ = y(() => n.disabled),
|
|
9368
|
+
const l = V(null), o = V(null), r = V(null), s = V(!1), f = V(""), c = Ke(e, "modelValue"), w = y(() => n.placeholder || "Add tag…"), x = y(() => c.value?.length === 0 && f.value === ""), S = y(() => !n.disabled && c.value?.length > 0), $ = y(() => n.disabled), v = async () => {
|
|
9369
9369
|
$.value || await tt(() => r.value?.focus());
|
|
9370
9370
|
}, h = (X) => {
|
|
9371
9371
|
const N = X.trim();
|
|
9372
9372
|
N !== "" && (!c.value || !Array.isArray(c.value) ? c.value = [N] : n.unique ? c.value.includes(N) || (c.value = [...c.value, N]) : c.value = [...c.value, N], f.value = "");
|
|
9373
|
-
},
|
|
9373
|
+
}, g = () => {
|
|
9374
9374
|
const X = f.value;
|
|
9375
9375
|
X.trim() !== "" && h(X), f.value = "";
|
|
9376
9376
|
}, M = (X) => {
|
|
@@ -9381,10 +9381,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9381
9381
|
}, C = () => {
|
|
9382
9382
|
$.value || (s.value = !0);
|
|
9383
9383
|
}, D = () => {
|
|
9384
|
-
s.value = !1, !$.value &&
|
|
9384
|
+
s.value = !1, !$.value && g();
|
|
9385
9385
|
}, U = (X) => {
|
|
9386
9386
|
const { key: N } = X;
|
|
9387
|
-
N === "Enter" ? (X.preventDefault(),
|
|
9387
|
+
N === "Enter" ? (X.preventDefault(), g()) : N === "Backspace" && f.value === "" && c.value.length > 0 && M(c.value.length - 1);
|
|
9388
9388
|
};
|
|
9389
9389
|
return (X, N) => (u(), m("div", {
|
|
9390
9390
|
class: "flex gap-1 w-full",
|
|
@@ -9406,7 +9406,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9406
9406
|
$.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
9407
9407
|
]),
|
|
9408
9408
|
"data-focus": s.value ? "true" : "false",
|
|
9409
|
-
onClick:
|
|
9409
|
+
onClick: v
|
|
9410
9410
|
}, [
|
|
9411
9411
|
d("div", {
|
|
9412
9412
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
@@ -9634,33 +9634,33 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9634
9634
|
},
|
|
9635
9635
|
emits: ["update:modelValue"],
|
|
9636
9636
|
setup(e, { emit: t }) {
|
|
9637
|
-
const n = (
|
|
9637
|
+
const n = (g) => `${g}-${Math.random().toString(36).substring(2, 15)}`, a = dt("values"), l = e, o = t, r = l.addButtonText ?? "Додати", s = l.ignore ?? [], f = V([]), c = V(null);
|
|
9638
9638
|
(() => {
|
|
9639
|
-
const
|
|
9640
|
-
f.value = Object.entries(
|
|
9639
|
+
const g = l.parent && a?.value?.[l.parent] || l.modelValue || {};
|
|
9640
|
+
f.value = Object.entries(g).filter(([M]) => !s.includes(M)).map(([M, b]) => ({
|
|
9641
9641
|
id: n("key-value-"),
|
|
9642
9642
|
key: M,
|
|
9643
9643
|
value: b
|
|
9644
9644
|
}));
|
|
9645
9645
|
})();
|
|
9646
|
-
function x(
|
|
9647
|
-
c.value =
|
|
9646
|
+
function x(g) {
|
|
9647
|
+
c.value = g;
|
|
9648
9648
|
}
|
|
9649
|
-
function S(
|
|
9650
|
-
if (c.value === null || c.value ===
|
|
9649
|
+
function S(g) {
|
|
9650
|
+
if (c.value === null || c.value === g) return;
|
|
9651
9651
|
const M = f.value.splice(c.value, 1)[0];
|
|
9652
|
-
f.value.splice(
|
|
9652
|
+
f.value.splice(g, 0, M), c.value = null;
|
|
9653
9653
|
}
|
|
9654
|
-
const $ = y(() => f.value.some((
|
|
9654
|
+
const $ = y(() => f.value.some((g) => g.key && !g.value || !g.key && g.value)), v = () => {
|
|
9655
9655
|
f.value.push({ id: n("key-value-"), key: "", value: "" });
|
|
9656
|
-
}, h = (
|
|
9657
|
-
f.value = f.value.filter((M) => M.id !==
|
|
9656
|
+
}, h = (g) => {
|
|
9657
|
+
f.value = f.value.filter((M) => M.id !== g);
|
|
9658
9658
|
};
|
|
9659
9659
|
return ye(
|
|
9660
9660
|
f,
|
|
9661
|
-
(
|
|
9661
|
+
(g) => {
|
|
9662
9662
|
const M = {};
|
|
9663
|
-
|
|
9663
|
+
g.forEach((C) => {
|
|
9664
9664
|
C.key && C.value !== void 0 && (M[C.key] = C.value);
|
|
9665
9665
|
});
|
|
9666
9666
|
const b = {};
|
|
@@ -9672,7 +9672,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9672
9672
|
}), o("update:modelValue", M);
|
|
9673
9673
|
},
|
|
9674
9674
|
{ deep: !0 }
|
|
9675
|
-
), (
|
|
9675
|
+
), (g, M) => (u(), m("div", hm, [
|
|
9676
9676
|
d("div", bm, [
|
|
9677
9677
|
(u(!0), m(De, null, Ne(f.value, (b, C) => (u(), m("div", {
|
|
9678
9678
|
key: b.id,
|
|
@@ -9712,7 +9712,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9712
9712
|
d("div", Cm, [
|
|
9713
9713
|
d("button", {
|
|
9714
9714
|
type: "button",
|
|
9715
|
-
onClick:
|
|
9715
|
+
onClick: v,
|
|
9716
9716
|
disabled: $.value,
|
|
9717
9717
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
9718
9718
|
}, [
|
|
@@ -9744,8 +9744,8 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9744
9744
|
setup(e) {
|
|
9745
9745
|
const t = e, n = Ke(e, "modelValue"), a = V([]), l = V(null), o = y(() => !!t.disabled), r = y(() => t.placeholder ?? ""), s = y(() => t.addButtonText ?? "Додати");
|
|
9746
9746
|
let f = !1;
|
|
9747
|
-
const c = (
|
|
9748
|
-
const M =
|
|
9747
|
+
const c = (g) => `${g}-${Math.random().toString(36).substring(2, 15)}`, w = (g) => {
|
|
9748
|
+
const M = g ?? n.value ?? [];
|
|
9749
9749
|
a.value = M.map((b, C) => ({
|
|
9750
9750
|
id: a.value[C]?.id ?? c("text-array"),
|
|
9751
9751
|
value: b ?? ""
|
|
@@ -9753,43 +9753,43 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9753
9753
|
};
|
|
9754
9754
|
w(), ye(
|
|
9755
9755
|
() => n.value,
|
|
9756
|
-
(
|
|
9756
|
+
(g) => {
|
|
9757
9757
|
if (f) {
|
|
9758
9758
|
f = !1;
|
|
9759
9759
|
return;
|
|
9760
9760
|
}
|
|
9761
|
-
w(
|
|
9761
|
+
w(g || []);
|
|
9762
9762
|
},
|
|
9763
9763
|
{ deep: !0 }
|
|
9764
9764
|
), ye(
|
|
9765
9765
|
a,
|
|
9766
|
-
(
|
|
9767
|
-
f = !0, n.value =
|
|
9766
|
+
(g) => {
|
|
9767
|
+
f = !0, n.value = g.map((M) => M.value).filter((M) => M != null && M !== "");
|
|
9768
9768
|
},
|
|
9769
9769
|
{ deep: !0 }
|
|
9770
9770
|
);
|
|
9771
|
-
const x = y(() => o.value || a.value.some((
|
|
9771
|
+
const x = y(() => o.value || a.value.some((g) => !g.value));
|
|
9772
9772
|
function S() {
|
|
9773
9773
|
x.value || (a.value = [...a.value, { id: c("text-array"), value: "" }]);
|
|
9774
9774
|
}
|
|
9775
|
-
function $(
|
|
9776
|
-
o.value || (a.value = a.value.filter((M) => M.id !==
|
|
9775
|
+
function $(g) {
|
|
9776
|
+
o.value || (a.value = a.value.filter((M) => M.id !== g));
|
|
9777
9777
|
}
|
|
9778
|
-
function g
|
|
9779
|
-
o.value || (l.value =
|
|
9778
|
+
function v(g) {
|
|
9779
|
+
o.value || (l.value = g);
|
|
9780
9780
|
}
|
|
9781
|
-
function h(
|
|
9782
|
-
if (o.value || l.value === null || l.value ===
|
|
9781
|
+
function h(g) {
|
|
9782
|
+
if (o.value || l.value === null || l.value === g) return;
|
|
9783
9783
|
const M = [...a.value], [b] = M.splice(l.value, 1);
|
|
9784
|
-
M.splice(
|
|
9784
|
+
M.splice(g, 0, b), a.value = M, l.value = null;
|
|
9785
9785
|
}
|
|
9786
|
-
return (
|
|
9786
|
+
return (g, M) => (u(), m("div", Am, [
|
|
9787
9787
|
d("div", Dm, [
|
|
9788
9788
|
(u(!0), m(De, null, Ne(a.value, (b, C) => (u(), m("div", {
|
|
9789
9789
|
key: b.id,
|
|
9790
9790
|
class: re(["flex items-center gap-2 w-full", { "opacity-50": l.value === C }]),
|
|
9791
9791
|
draggable: "true",
|
|
9792
|
-
onDragstart: (D) =>
|
|
9792
|
+
onDragstart: (D) => v(C),
|
|
9793
9793
|
onDragover: M[0] || (M[0] = Te(() => {
|
|
9794
9794
|
}, ["prevent"])),
|
|
9795
9795
|
onDrop: (D) => h(C)
|
|
@@ -9802,32 +9802,32 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9802
9802
|
G(R(un), { class: "h-4 w-4" })
|
|
9803
9803
|
], 8, Tm),
|
|
9804
9804
|
d("div", Fm, [
|
|
9805
|
-
|
|
9805
|
+
g.inputType === "text" ? (u(), $e(yn, {
|
|
9806
9806
|
key: 0,
|
|
9807
9807
|
modelValue: b.value,
|
|
9808
9808
|
"onUpdate:modelValue": (D) => b.value = D,
|
|
9809
9809
|
disabled: o.value,
|
|
9810
9810
|
placeholder: r.value
|
|
9811
9811
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : z("", !0),
|
|
9812
|
-
|
|
9812
|
+
g.inputType === "tel" ? (u(), $e($a, {
|
|
9813
9813
|
key: 1,
|
|
9814
9814
|
modelValue: b.value,
|
|
9815
9815
|
"onUpdate:modelValue": (D) => b.value = D,
|
|
9816
9816
|
disabled: o.value,
|
|
9817
9817
|
placeholder: r.value
|
|
9818
9818
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : z("", !0),
|
|
9819
|
-
|
|
9819
|
+
g.inputType === "email" ? (u(), $e(_a, {
|
|
9820
9820
|
key: 2,
|
|
9821
9821
|
modelValue: b.value,
|
|
9822
9822
|
"onUpdate:modelValue": (D) => b.value = D,
|
|
9823
9823
|
disabled: o.value,
|
|
9824
9824
|
placeholder: r.value
|
|
9825
9825
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : z("", !0),
|
|
9826
|
-
|
|
9826
|
+
g.inputType === "mask" ? (u(), $e(Ml, {
|
|
9827
9827
|
key: 3,
|
|
9828
9828
|
modelValue: b.value,
|
|
9829
9829
|
"onUpdate:modelValue": (D) => b.value = D,
|
|
9830
|
-
mask:
|
|
9830
|
+
mask: g.mask,
|
|
9831
9831
|
disabled: o.value,
|
|
9832
9832
|
placeholder: r.value
|
|
9833
9833
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "mask", "disabled", "placeholder"])) : z("", !0)
|
|
@@ -9984,13 +9984,13 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9984
9984
|
]);
|
|
9985
9985
|
});
|
|
9986
9986
|
const f = V({}), c = V({});
|
|
9987
|
-
function w(h,
|
|
9988
|
-
h && (f.value[
|
|
9987
|
+
function w(h, g) {
|
|
9988
|
+
h && (f.value[g] = h);
|
|
9989
9989
|
}
|
|
9990
|
-
async function x(h,
|
|
9990
|
+
async function x(h, g) {
|
|
9991
9991
|
if (!h || t.inputType !== "mask") return;
|
|
9992
9992
|
const { default: M } = await import("./index-W-qQIppj.js");
|
|
9993
|
-
c.value[
|
|
9993
|
+
c.value[g] && c.value[g].destroy(), c.value[g] = M(h, {
|
|
9994
9994
|
mask: t.mask || "",
|
|
9995
9995
|
definitions: {
|
|
9996
9996
|
9: /[0-9]/,
|
|
@@ -9998,35 +9998,35 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
9998
9998
|
"*": /[a-zA-Z0-9]/
|
|
9999
9999
|
},
|
|
10000
10000
|
lazy: !1
|
|
10001
|
-
}), c.value[
|
|
10001
|
+
}), c.value[g].on("accept", () => {
|
|
10002
10002
|
const b = [...o.value || []];
|
|
10003
|
-
b[
|
|
10004
|
-
}), c.value[
|
|
10003
|
+
b[g] = t.unmask ? c.value[g].unmaskedValue : c.value[g].value, o.value = b;
|
|
10004
|
+
}), c.value[g].on("complete", () => {
|
|
10005
10005
|
const b = [...o.value || []];
|
|
10006
|
-
b[
|
|
10007
|
-
}), o.value?.[
|
|
10006
|
+
b[g] = t.unmask ? c.value[g].unmaskedValue : c.value[g].value, o.value = b;
|
|
10007
|
+
}), o.value?.[g] && (c.value[g].value = o.value[g]);
|
|
10008
10008
|
}
|
|
10009
|
-
function S(h,
|
|
10009
|
+
function S(h, g) {
|
|
10010
10010
|
if (r.value) return;
|
|
10011
10011
|
const M = h.target.value ?? null, b = [...o.value];
|
|
10012
|
-
b[
|
|
10012
|
+
b[g] = t.inputType === "text" ? M : Number(M), o.value = b;
|
|
10013
10013
|
}
|
|
10014
10014
|
function $() {
|
|
10015
10015
|
n.value += 1;
|
|
10016
10016
|
const h = t.inputType === "text" || t.inputType === "mask" ? null : 0;
|
|
10017
10017
|
o.value = [...o.value, h], t.inputType === "mask" && setTimeout(() => {
|
|
10018
|
-
const
|
|
10019
|
-
f.value[
|
|
10018
|
+
const g = n.value - 1;
|
|
10019
|
+
f.value[g] && x(f.value[g], g);
|
|
10020
10020
|
}, 0);
|
|
10021
10021
|
}
|
|
10022
|
-
function
|
|
10022
|
+
function v(h) {
|
|
10023
10023
|
if (n.value > 1) {
|
|
10024
10024
|
c.value[h] && (c.value[h].destroy(), delete c.value[h]), n.value -= 1, o.value = o.value.filter((M, b) => b !== h);
|
|
10025
|
-
const
|
|
10025
|
+
const g = {};
|
|
10026
10026
|
Object.keys(c.value).forEach((M) => {
|
|
10027
10027
|
const b = parseInt(M, 10);
|
|
10028
|
-
b > h ?
|
|
10029
|
-
}), c.value =
|
|
10028
|
+
b > h ? g[b - 1] = c.value[b] : b < h && (g[b] = c.value[b]);
|
|
10029
|
+
}), c.value = g;
|
|
10030
10030
|
}
|
|
10031
10031
|
}
|
|
10032
10032
|
return ot(() => {
|
|
@@ -10038,8 +10038,8 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10038
10038
|
h && h.destroy();
|
|
10039
10039
|
});
|
|
10040
10040
|
}), ye(() => t.mask, (h) => {
|
|
10041
|
-
t.inputType === "mask" && Object.values(c.value).forEach((
|
|
10042
|
-
|
|
10041
|
+
t.inputType === "mask" && Object.values(c.value).forEach((g) => {
|
|
10042
|
+
g && g.updateOptions({
|
|
10043
10043
|
mask: h,
|
|
10044
10044
|
definitions: {
|
|
10045
10045
|
9: /[0-9]/,
|
|
@@ -10049,10 +10049,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10049
10049
|
});
|
|
10050
10050
|
});
|
|
10051
10051
|
}), ye(o, (h) => {
|
|
10052
|
-
t.inputType === "mask" && h && h.forEach((
|
|
10053
|
-
c.value[M] && c.value[M].value !==
|
|
10052
|
+
t.inputType === "mask" && h && h.forEach((g, M) => {
|
|
10053
|
+
c.value[M] && c.value[M].value !== g && (c.value[M].value = g || "");
|
|
10054
10054
|
});
|
|
10055
|
-
}, { deep: !0 }), (h,
|
|
10055
|
+
}, { deep: !0 }), (h, g) => (u(), m("div", {
|
|
10056
10056
|
class: re(["grid gap-2", `grid-cols-${a.value}`])
|
|
10057
10057
|
}, [
|
|
10058
10058
|
(u(!0), m(De, null, Ne(n.value, (M) => (u(), m("div", {
|
|
@@ -10094,7 +10094,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10094
10094
|
!h.disabled && n.value > 1 && h.isAdded ? (u(), m("button", {
|
|
10095
10095
|
key: 3,
|
|
10096
10096
|
type: "button",
|
|
10097
|
-
onClick: Te((b) =>
|
|
10097
|
+
onClick: Te((b) => v(M - 1), ["stop"]),
|
|
10098
10098
|
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"
|
|
10099
10099
|
}, [
|
|
10100
10100
|
G(R(_t), { class: "h-4 w-4" })
|
|
@@ -10137,7 +10137,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10137
10137
|
}),
|
|
10138
10138
|
emits: /* @__PURE__ */ He(["change", "update:modelValue", "value-selected"], ["update:modelValue"]),
|
|
10139
10139
|
setup(e, { emit: t }) {
|
|
10140
|
-
const n = e, a = t, l = Ke(e, "modelValue"), o = V([]), r = V(n.options ?? []), s = V({}), f = V({}), c = V({ keyword: "", parent: null }), w = V(""), x = V(!1), S = V(null), $ = V(null),
|
|
10140
|
+
const n = e, a = t, l = Ke(e, "modelValue"), o = V([]), r = V(n.options ?? []), s = V({}), f = V({}), c = V({ keyword: "", parent: null }), w = V(""), x = V(!1), S = V(null), $ = V(null), v = V(null), h = V(null), g = V(null), M = V({});
|
|
10141
10141
|
let b = !1, C = !1;
|
|
10142
10142
|
const D = dt("values"), U = y(() => !!n.disabled), X = y(() => n.placeholder ?? "Оберіть значення"), N = y(() => n.search !== !1), W = y(() => {
|
|
10143
10143
|
const _ = n.parent ?? n.parentValue;
|
|
@@ -10222,10 +10222,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10222
10222
|
})(async (_) => {
|
|
10223
10223
|
n.data && await Z(_, { force: !0 });
|
|
10224
10224
|
}, 250), ae = V(null), Ce = () => {
|
|
10225
|
-
if (!
|
|
10226
|
-
const _ =
|
|
10225
|
+
if (!v.value) return;
|
|
10226
|
+
const _ = v.value.getBoundingClientRect(), A = window.innerHeight ?? document.documentElement.clientHeight, F = window.innerWidth ?? document.documentElement.clientWidth, fe = 8, Ie = 8, et = n.maxHeight ?? 280, qe = A - _.bottom - Ie - fe, pt = _.top - Ie - fe, H = qe >= pt, we = Math.max(F - fe * 2, 0);
|
|
10227
10227
|
let { width: Xe } = _;
|
|
10228
|
-
|
|
10228
|
+
we > 0 && Xe > we && (Xe = we);
|
|
10229
10229
|
let { left: gt } = _;
|
|
10230
10230
|
gt + Xe + fe > F && (gt = F - Xe - fe), gt = Math.max(gt, fe);
|
|
10231
10231
|
const $t = Math.min(
|
|
@@ -10241,10 +10241,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10241
10241
|
top: H ? `${_.bottom + Ie}px` : `${_.top - Ie}px`
|
|
10242
10242
|
};
|
|
10243
10243
|
}, Oe = async (_ = "click") => {
|
|
10244
|
-
U.value || x.value || (ae.value = _, await Z(w.value.trim()), x.value = !0, await tt(), Ce(),
|
|
10244
|
+
U.value || x.value || (ae.value = _, await Z(w.value.trim()), x.value = !0, await tt(), Ce(), g.value?.focus());
|
|
10245
10245
|
}, Le = () => {
|
|
10246
10246
|
x.value = !1, ae.value = null, tt(() => {
|
|
10247
|
-
|
|
10247
|
+
g.value?.blur();
|
|
10248
10248
|
});
|
|
10249
10249
|
}, Ge = async (_) => {
|
|
10250
10250
|
if (_.stopPropagation(), !U.value) {
|
|
@@ -10288,7 +10288,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10288
10288
|
key: B(_.id)
|
|
10289
10289
|
};
|
|
10290
10290
|
o.value = [...o.value, F], Me(_), w.value = "", tt(() => {
|
|
10291
|
-
|
|
10291
|
+
g.value?.focus();
|
|
10292
10292
|
});
|
|
10293
10293
|
}, Me = (_) => {
|
|
10294
10294
|
const A = o.value.map((F) => F.id);
|
|
@@ -10307,7 +10307,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10307
10307
|
addSchema: T,
|
|
10308
10308
|
addForm: Q,
|
|
10309
10309
|
addTitle: ce,
|
|
10310
|
-
addOption:
|
|
10310
|
+
addOption: be,
|
|
10311
10311
|
onAddValue: Se
|
|
10312
10312
|
} = Aa({
|
|
10313
10313
|
props: n,
|
|
@@ -10387,7 +10387,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10387
10387
|
class: "z-[1000]",
|
|
10388
10388
|
title: R(ce),
|
|
10389
10389
|
buttonText: "Додати",
|
|
10390
|
-
onDone: R(
|
|
10390
|
+
onDone: R(be)
|
|
10391
10391
|
}, {
|
|
10392
10392
|
default: vt(() => [
|
|
10393
10393
|
G(zt, {
|
|
@@ -10413,7 +10413,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10413
10413
|
}, [
|
|
10414
10414
|
d("div", {
|
|
10415
10415
|
ref_key: "triggerRef",
|
|
10416
|
-
ref:
|
|
10416
|
+
ref: v,
|
|
10417
10417
|
class: re([
|
|
10418
10418
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white px-3",
|
|
10419
10419
|
"border-gray-300 hover:border-[#b3d4ff]",
|
|
@@ -10428,7 +10428,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10428
10428
|
}, [
|
|
10429
10429
|
Pe(d("input", {
|
|
10430
10430
|
ref_key: "inputRef",
|
|
10431
|
-
ref:
|
|
10431
|
+
ref: g,
|
|
10432
10432
|
"onUpdate:modelValue": A[2] || (A[2] = (F) => w.value = F),
|
|
10433
10433
|
placeholder: X.value,
|
|
10434
10434
|
disabled: U.value,
|
|
@@ -10561,7 +10561,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10561
10561
|
}), It(() => {
|
|
10562
10562
|
typeof document > "u" || (x.value != null ? document.body.style.overflow = x.value : document.body.style.removeProperty("overflow"));
|
|
10563
10563
|
});
|
|
10564
|
-
const S = y(() => a.placeholder ?? ""), $ = y(() => !!a.disabled),
|
|
10564
|
+
const S = y(() => a.placeholder ?? ""), $ = y(() => !!a.disabled), v = (N) => {
|
|
10565
10565
|
if (!N) return null;
|
|
10566
10566
|
if (Array.isArray(N)) return N;
|
|
10567
10567
|
if (typeof N == "string") {
|
|
@@ -10570,17 +10570,17 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10570
10570
|
}
|
|
10571
10571
|
return null;
|
|
10572
10572
|
}, h = y(() => {
|
|
10573
|
-
const N =
|
|
10573
|
+
const N = v(a.bbox);
|
|
10574
10574
|
if (!N || N.length !== 4) return null;
|
|
10575
10575
|
const W = N.map(Number);
|
|
10576
10576
|
return W.some((j) => Number.isNaN(j)) ? null : W;
|
|
10577
|
-
}),
|
|
10577
|
+
}), g = y(() => {
|
|
10578
10578
|
const N = h.value;
|
|
10579
10579
|
if (!N) return "";
|
|
10580
10580
|
const [W, j, ee, te] = N;
|
|
10581
10581
|
return `${W},${Math.max(j, te)},${ee},${Math.min(j, te)}`;
|
|
10582
10582
|
});
|
|
10583
|
-
y(() =>
|
|
10583
|
+
y(() => g.value ? "1" : "0");
|
|
10584
10584
|
const M = dt("values");
|
|
10585
10585
|
function b() {
|
|
10586
10586
|
!$.value && s.value.trim() && C();
|
|
@@ -10715,10 +10715,10 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10715
10715
|
}),
|
|
10716
10716
|
emits: ["update:modelValue"],
|
|
10717
10717
|
setup(e) {
|
|
10718
|
-
const t = e, n = Ke(e, "modelValue"), a = y(() => Array.isArray(n.value) ? n.value : []), l = V([]), o = y(() => t.schema?.map((
|
|
10719
|
-
...
|
|
10720
|
-
disabled: t.disabled ||
|
|
10721
|
-
})) ?? []), r = y(() => o.value.map((
|
|
10718
|
+
const t = e, n = Ke(e, "modelValue"), a = y(() => Array.isArray(n.value) ? n.value : []), l = V([]), o = y(() => t.schema?.map((g) => ({
|
|
10719
|
+
...g,
|
|
10720
|
+
disabled: t.disabled || g.disabled
|
|
10721
|
+
})) ?? []), r = y(() => o.value.map((g) => h(g))), s = y(() => o.value.reduce((M, b) => {
|
|
10722
10722
|
const C = Number(b?.col ?? 12);
|
|
10723
10723
|
return M + (Number.isFinite(C) && C > 0 ? C : 12);
|
|
10724
10724
|
}, 0) > 12), f = y(() => t.disabled ? !1 : t.maxItems ? a.value.length < t.maxItems : !0), c = y(() => t.disabled || a.value.length <= (t.minItems || 0));
|
|
@@ -10726,32 +10726,32 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10726
10726
|
w(), x();
|
|
10727
10727
|
}, { immediate: !0 }), ye(() => t.schema, x, { immediate: !0, deep: !0 });
|
|
10728
10728
|
function w() {
|
|
10729
|
-
const
|
|
10730
|
-
l.value.length <
|
|
10729
|
+
const g = a.value.length;
|
|
10730
|
+
l.value.length < g ? l.value = [...l.value, ...Array.from({ length: g - l.value.length }, () => Il())] : l.value.length > g && l.value.splice(g);
|
|
10731
10731
|
}
|
|
10732
10732
|
function x() {
|
|
10733
10733
|
if (!t.minItems || a.value.length >= t.minItems) return;
|
|
10734
|
-
const
|
|
10734
|
+
const g = t.minItems - a.value.length, M = Array.from({ length: g }, S);
|
|
10735
10735
|
n.value = [...a.value, ...M];
|
|
10736
10736
|
}
|
|
10737
10737
|
function S() {
|
|
10738
|
-
const
|
|
10738
|
+
const g = {};
|
|
10739
10739
|
return o.value.forEach((M) => {
|
|
10740
|
-
|
|
10741
|
-
}),
|
|
10740
|
+
g[M.name] = M?.default ?? null;
|
|
10741
|
+
}), g;
|
|
10742
10742
|
}
|
|
10743
10743
|
function $() {
|
|
10744
10744
|
f.value && (n.value = [...a.value, S()], w());
|
|
10745
10745
|
}
|
|
10746
|
-
function g
|
|
10747
|
-
c.value || (n.value = a.value.filter((M, b) => b !==
|
|
10746
|
+
function v(g) {
|
|
10747
|
+
c.value || (n.value = a.value.filter((M, b) => b !== g), w(), x());
|
|
10748
10748
|
}
|
|
10749
|
-
function h(
|
|
10749
|
+
function h(g) {
|
|
10750
10750
|
return {
|
|
10751
|
-
...
|
|
10751
|
+
...g
|
|
10752
10752
|
};
|
|
10753
10753
|
}
|
|
10754
|
-
return (
|
|
10754
|
+
return (g, M) => (u(), m("div", _v, [
|
|
10755
10755
|
d("div", $v, [
|
|
10756
10756
|
(u(!0), m(De, null, Ne(a.value, (b, C) => (u(), m("div", {
|
|
10757
10757
|
key: l.value[C],
|
|
@@ -10770,7 +10770,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10770
10770
|
d("button", {
|
|
10771
10771
|
type: "button",
|
|
10772
10772
|
class: "h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",
|
|
10773
|
-
onClick: (D) =>
|
|
10773
|
+
onClick: (D) => v(C),
|
|
10774
10774
|
disabled: c.value
|
|
10775
10775
|
}, [
|
|
10776
10776
|
G(R(on), { class: "h-4 w-4" })
|
|
@@ -10824,7 +10824,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10824
10824
|
const t = e, n = Ke(e, "modelValue"), a = V([]), l = V([]), o = V(0), r = V(null), s = V(null), f = V(null), c = y(() => t.groupLabel ?? "Group"), w = y(() => t.emptyLabel ?? "Ще немає груп"), x = y(() => t.schema?.map((Z) => ({
|
|
10825
10825
|
...Z,
|
|
10826
10826
|
disabled: t.disabled || Z.disabled
|
|
10827
|
-
})) ?? []), S = y(() => x.value.map((Z) => j(Z))), $ = y(() => t.view === "accordion"),
|
|
10827
|
+
})) ?? []), S = y(() => x.value.map((Z) => j(Z))), $ = y(() => t.view === "accordion"), v = y(() => !!(t.collapsible || $.value)), h = y(() => t.draggable !== !1), g = y(() => t.disabled ? !1 : t.maxGroups ? n.value.length < t.maxGroups : !0), M = y(() => t.disabled || n.value.length <= (t.minGroups || 0));
|
|
10828
10828
|
ye(() => n.value.length, () => {
|
|
10829
10829
|
b(), C(), D();
|
|
10830
10830
|
}, { immediate: !0 }), ye(() => t.schema, D, { immediate: !0, deep: !0 }), ye(() => t.view, () => {
|
|
@@ -10850,7 +10850,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10850
10850
|
}), Z;
|
|
10851
10851
|
}
|
|
10852
10852
|
function X() {
|
|
10853
|
-
|
|
10853
|
+
g.value && (n.value = [...n.value, U()], b(), C());
|
|
10854
10854
|
}
|
|
10855
10855
|
function N(Z) {
|
|
10856
10856
|
M.value || (n.value = n.value.filter((ve, Ve) => Ve !== Z), b(), $.value ? o.value >= n.value.length && (o.value = n.value.length - 1) : l.value.splice(Z, 1), D());
|
|
@@ -10873,7 +10873,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10873
10873
|
return $.value ? o.value === -1 && Z === 0 ? !1 : o.value !== Z : !!l.value[Z];
|
|
10874
10874
|
}
|
|
10875
10875
|
function te(Z) {
|
|
10876
|
-
if (
|
|
10876
|
+
if (v.value) {
|
|
10877
10877
|
if ($.value) {
|
|
10878
10878
|
o.value = Z;
|
|
10879
10879
|
return;
|
|
@@ -10964,7 +10964,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
10964
10964
|
class: "h-4 w-4 text-gray-400",
|
|
10965
10965
|
"aria-hidden": "true"
|
|
10966
10966
|
})) : z("", !0),
|
|
10967
|
-
|
|
10967
|
+
v.value ? (u(), m("button", {
|
|
10968
10968
|
key: 1,
|
|
10969
10969
|
type: "button",
|
|
10970
10970
|
class: "rounded-full p-1 text-gray-500 transition hover:bg-gray-100",
|
|
@@ -11021,7 +11021,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11021
11021
|
type: "button",
|
|
11022
11022
|
class: "flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",
|
|
11023
11023
|
onClick: X,
|
|
11024
|
-
disabled: !
|
|
11024
|
+
disabled: !g.value
|
|
11025
11025
|
}, [
|
|
11026
11026
|
G(R(Vt), { class: "h-4 w-4" }),
|
|
11027
11027
|
at(" " + ie(t.addButtonText), 1)
|
|
@@ -11055,20 +11055,20 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11055
11055
|
const c = () => {
|
|
11056
11056
|
if (s) return Promise.resolve(s);
|
|
11057
11057
|
if (typeof window > "u") return Promise.resolve(null);
|
|
11058
|
-
const
|
|
11059
|
-
if (
|
|
11060
|
-
return s =
|
|
11061
|
-
if (
|
|
11062
|
-
const
|
|
11058
|
+
const v = window;
|
|
11059
|
+
if (v.monaco?.editor?.create)
|
|
11060
|
+
return s = v.monaco, Promise.resolve(s);
|
|
11061
|
+
if (v[Nn]) return v[Nn];
|
|
11062
|
+
const g = (async () => {
|
|
11063
11063
|
const M = (D) => {
|
|
11064
11064
|
if (Array.from(document.styleSheets || []).some((N) => N?.href?.includes(D))) return;
|
|
11065
11065
|
const X = document.createElement("link");
|
|
11066
11066
|
X.rel = "stylesheet", X.href = D, document.head.appendChild(X);
|
|
11067
11067
|
}, b = (D) => {
|
|
11068
|
-
if (
|
|
11069
|
-
|
|
11068
|
+
if (v[en]?.[D]) return v[en][D];
|
|
11069
|
+
v[en] ||= {};
|
|
11070
11070
|
const U = Array.from(document.scripts).find((X) => X.src === D);
|
|
11071
|
-
return U ? (
|
|
11071
|
+
return U ? (v[en][D] = new Promise((X, N) => {
|
|
11072
11072
|
const W = U.readyState;
|
|
11073
11073
|
if (U.dataset.loaded === "true" || W === "loaded" || W === "complete") {
|
|
11074
11074
|
X();
|
|
@@ -11077,30 +11077,30 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11077
11077
|
U.addEventListener("load", () => {
|
|
11078
11078
|
U.dataset.loaded = "true", X();
|
|
11079
11079
|
}, { once: !0 }), U.addEventListener("error", (j) => N(j), { once: !0 });
|
|
11080
|
-
}),
|
|
11080
|
+
}), v[en][D]) : (v[en][D] = new Promise((X, N) => {
|
|
11081
11081
|
const W = document.createElement("script");
|
|
11082
11082
|
W.src = D, W.async = !0, W.onload = () => {
|
|
11083
11083
|
W.dataset.loaded = "true", X();
|
|
11084
11084
|
}, W.onerror = (j) => N(j), document.body.appendChild(W);
|
|
11085
|
-
}),
|
|
11085
|
+
}), v[en][D]);
|
|
11086
11086
|
}, C = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";
|
|
11087
|
-
return M(`${C}/editor/editor.main.min.css`), await b(`${C}/loader.min.js`),
|
|
11087
|
+
return M(`${C}/editor/editor.main.min.css`), await b(`${C}/loader.min.js`), v[jn] || (v[jn] = new Promise((D, U) => {
|
|
11088
11088
|
window.require.config({
|
|
11089
11089
|
paths: { vs: C }
|
|
11090
11090
|
}), window.require(
|
|
11091
11091
|
["vs/editor/editor.main"],
|
|
11092
11092
|
() => {
|
|
11093
|
-
s = window.monaco,
|
|
11093
|
+
s = window.monaco, v.monaco = s, D(s);
|
|
11094
11094
|
},
|
|
11095
11095
|
(X) => U(X)
|
|
11096
11096
|
);
|
|
11097
11097
|
}).catch((D) => {
|
|
11098
|
-
throw delete
|
|
11099
|
-
})),
|
|
11098
|
+
throw delete v[jn], D;
|
|
11099
|
+
})), v[jn];
|
|
11100
11100
|
})().catch((M) => {
|
|
11101
|
-
throw delete
|
|
11101
|
+
throw delete v[Nn], M;
|
|
11102
11102
|
});
|
|
11103
|
-
return
|
|
11103
|
+
return v[Nn] = g, g;
|
|
11104
11104
|
}, w = () => {
|
|
11105
11105
|
!l.value || !s || (r && (r.dispose(), r = null), r = s.editor.create(l.value, {
|
|
11106
11106
|
value: a.value || "",
|
|
@@ -11117,38 +11117,38 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11117
11117
|
}, S = () => r, $ = () => s;
|
|
11118
11118
|
return ye(
|
|
11119
11119
|
() => a.value,
|
|
11120
|
-
(
|
|
11120
|
+
(v) => {
|
|
11121
11121
|
if (!r) return;
|
|
11122
11122
|
const h = r.getValue();
|
|
11123
|
-
|
|
11123
|
+
v !== h && (f = !0, r.setValue(v || ""), f = !1);
|
|
11124
11124
|
}
|
|
11125
11125
|
), ye(
|
|
11126
11126
|
() => n.syntax,
|
|
11127
|
-
(
|
|
11128
|
-
!r || !s || s.editor.setModelLanguage(r.getModel(),
|
|
11127
|
+
(v) => {
|
|
11128
|
+
!r || !s || s.editor.setModelLanguage(r.getModel(), v || "xml");
|
|
11129
11129
|
}
|
|
11130
11130
|
), ye(
|
|
11131
11131
|
() => n.theme,
|
|
11132
|
-
(
|
|
11133
|
-
s && s.editor.setTheme(
|
|
11132
|
+
(v) => {
|
|
11133
|
+
s && s.editor.setTheme(v || "vs-light");
|
|
11134
11134
|
}
|
|
11135
11135
|
), ye(
|
|
11136
11136
|
() => n.disabled,
|
|
11137
|
-
(
|
|
11138
|
-
r && r.updateOptions({ readOnly: !!
|
|
11137
|
+
(v) => {
|
|
11138
|
+
r && r.updateOptions({ readOnly: !!v });
|
|
11139
11139
|
}
|
|
11140
11140
|
), ye(
|
|
11141
11141
|
() => n.minimap,
|
|
11142
|
-
(
|
|
11143
|
-
r && r.updateOptions({ minimap: { enabled: !!
|
|
11142
|
+
(v) => {
|
|
11143
|
+
r && r.updateOptions({ minimap: { enabled: !!v } });
|
|
11144
11144
|
}
|
|
11145
11145
|
), ot(async () => {
|
|
11146
11146
|
try {
|
|
11147
|
-
const
|
|
11148
|
-
if (!
|
|
11149
|
-
s =
|
|
11150
|
-
} catch (
|
|
11151
|
-
console.error("Failed to load Monaco editor",
|
|
11147
|
+
const v = await c();
|
|
11148
|
+
if (!v || !v.editor) return;
|
|
11149
|
+
s = v, w();
|
|
11150
|
+
} catch (v) {
|
|
11151
|
+
console.error("Failed to load Monaco editor", v);
|
|
11152
11152
|
}
|
|
11153
11153
|
}), It(() => {
|
|
11154
11154
|
r && (r.dispose(), r = null);
|
|
@@ -11156,7 +11156,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11156
11156
|
focus: x,
|
|
11157
11157
|
getEditor: S,
|
|
11158
11158
|
getMonaco: $
|
|
11159
|
-
}), (
|
|
11159
|
+
}), (v, h) => (u(), m("div", {
|
|
11160
11160
|
class: "w-full",
|
|
11161
11161
|
style: Ee({ height: o.value })
|
|
11162
11162
|
}, [
|
|
@@ -11274,16 +11274,16 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11274
11274
|
if (!q) return /* @__PURE__ */ new Set();
|
|
11275
11275
|
const J = Array.isArray(q) ? q : Object.keys(q);
|
|
11276
11276
|
return new Set(J);
|
|
11277
|
-
}),
|
|
11277
|
+
}), v = [...["min", "max", "step"], "api", "set", "mask"], h = y(() => {
|
|
11278
11278
|
const B = { ...f.value ?? {} }, q = n.item?.name;
|
|
11279
11279
|
q && x?.value?.[q] && Object.assign(B, x.value[q]);
|
|
11280
11280
|
const J = S.value;
|
|
11281
11281
|
let de;
|
|
11282
|
-
return J.size ? de = Object.fromEntries(Object.entries(B).filter(([se]) => J.has(se))) : de = B,
|
|
11282
|
+
return J.size ? de = Object.fromEntries(Object.entries(B).filter(([se]) => J.has(se))) : de = B, v.forEach((se) => {
|
|
11283
11283
|
const me = B[se];
|
|
11284
11284
|
me != null && (de[se] = me);
|
|
11285
11285
|
}), de;
|
|
11286
|
-
}),
|
|
11286
|
+
}), g = (B) => {
|
|
11287
11287
|
const q = typeof B == "object" && B !== null ? B : { value: B };
|
|
11288
11288
|
l("value-selected", {
|
|
11289
11289
|
...q,
|
|
@@ -11395,7 +11395,7 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11395
11395
|
(u(), $e(wt(w.value), Xt(h.value, {
|
|
11396
11396
|
modelValue: a.value,
|
|
11397
11397
|
"onUpdate:modelValue": q[0] || (q[0] = (J) => a.value = J),
|
|
11398
|
-
onValueSelected:
|
|
11398
|
+
onValueSelected: g
|
|
11399
11399
|
}), null, 16, ["modelValue"]))
|
|
11400
11400
|
]),
|
|
11401
11401
|
D.value ? (u(), m("button", {
|
|
@@ -11446,8 +11446,8 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11446
11446
|
const B = typeof te == "number" ? `${te}px` : `${te}`;
|
|
11447
11447
|
return { width: B, minWidth: B };
|
|
11448
11448
|
});
|
|
11449
|
-
let c = null, w = 0, x = 0, S = null, $ = null,
|
|
11450
|
-
const h = () => j(),
|
|
11449
|
+
let c = null, w = 0, x = 0, S = null, $ = null, v = null;
|
|
11450
|
+
const h = () => j(), g = () => b();
|
|
11451
11451
|
ye(
|
|
11452
11452
|
() => n.target,
|
|
11453
11453
|
async (te) => {
|
|
@@ -11474,14 +11474,14 @@ const af = { class: "vs-map-body" }, of = {
|
|
|
11474
11474
|
X(), M(null, !0), S = null, typeof window < "u" && (w && window.cancelAnimationFrame(w), x && window.cancelAnimationFrame(x));
|
|
11475
11475
|
});
|
|
11476
11476
|
function M(te, B = !1) {
|
|
11477
|
-
if (
|
|
11477
|
+
if (v && (v(), v = null), B) {
|
|
11478
11478
|
$ = null;
|
|
11479
11479
|
return;
|
|
11480
11480
|
}
|
|
11481
11481
|
if ($ = te ?? null, typeof window > "u") return;
|
|
11482
11482
|
const q = te ?? window, J = window;
|
|
11483
|
-
q.addEventListener("scroll", h, { passive: !0 }), J.addEventListener("resize",
|
|
11484
|
-
q.removeEventListener("scroll", h), J.removeEventListener("resize",
|
|
11483
|
+
q.addEventListener("scroll", h, { passive: !0 }), J.addEventListener("resize", g), v = () => {
|
|
11484
|
+
q.removeEventListener("scroll", h), J.removeEventListener("resize", g);
|
|
11485
11485
|
};
|
|
11486
11486
|
}
|
|
11487
11487
|
function b() {
|
|
@@ -11712,8 +11712,8 @@ function fg(e, t, n = !1) {
|
|
|
11712
11712
|
return Va(e?.value, c?.conditions);
|
|
11713
11713
|
}
|
|
11714
11714
|
const r = (c = a.value, w = !0) => (c.forEach((x) => {
|
|
11715
|
-
const S = [], $ = Number(x?.minlength),
|
|
11716
|
-
!Number.isNaN($) && Number.isFinite($) && S.push({ type: "minlength", value: $ }), !Number.isNaN(
|
|
11715
|
+
const S = [], $ = Number(x?.minlength), v = Number(x?.maxlength), h = Number(x?.min), g = Number(x?.max);
|
|
11716
|
+
!Number.isNaN($) && Number.isFinite($) && S.push({ type: "minlength", value: $ }), !Number.isNaN(v) && Number.isFinite(v) && S.push({ type: "maxlength", value: v }), !Number.isNaN(h) && Number.isFinite(h) && S.push({ type: "min", value: h }), !Number.isNaN(g) && Number.isFinite(g) && S.push({ type: "max", value: g });
|
|
11717
11717
|
const M = [...S, ...x.rules || []];
|
|
11718
11718
|
if (M.length) {
|
|
11719
11719
|
if (!o(x)) {
|
|
@@ -11775,7 +11775,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11775
11775
|
validate: x,
|
|
11776
11776
|
reset: S,
|
|
11777
11777
|
visibleSchema: $
|
|
11778
|
-
} = fg(c, l.schema, io(l, "disabled")),
|
|
11778
|
+
} = fg(c, l.schema, io(l, "disabled")), v = V(null), h = V(null), g = V({}), M = y(() => l.navigation), b = y(() => l.navWidth), C = y(() => l.style?.columns), D = Object.freeze({ container: 12, label: 3 }), U = y(() => l.columns ?? C.value ?? D), X = y(() => l.columns != null || C.value != null), N = y(() => X.value ? "horizontal" : l.layout), W = (se) => se?.columns ? "horizontal" : N.value, j = (se) => se?.columns ?? U.value, ee = y(() => {
|
|
11779
11779
|
const se = {}, me = (ne) => {
|
|
11780
11780
|
if (!ne) return;
|
|
11781
11781
|
(Array.isArray(ne) ? ne.map((E, K) => ({ key: String(K), entry: E })) : typeof ne == "object" ? Object.entries(ne).map(([E, K]) => ({ key: E, entry: K })) : []).forEach(({ key: E, entry: K }) => {
|
|
@@ -11828,7 +11828,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11828
11828
|
de(se);
|
|
11829
11829
|
},
|
|
11830
11830
|
{ immediate: !0, deep: !0 }
|
|
11831
|
-
), Vn("form", r), Vn("values", c), Vn("field-props",
|
|
11831
|
+
), Vn("form", r), Vn("values", c), Vn("field-props", g), Vn("schema-by-name", ee), (se, me) => (u(), m("div", mg, [
|
|
11832
11832
|
d("div", {
|
|
11833
11833
|
class: "flex-1 min-h-0 overflow-y-auto overflow-x-visible",
|
|
11834
11834
|
ref_key: "formScrollContainer",
|
|
@@ -11836,7 +11836,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11836
11836
|
}, [
|
|
11837
11837
|
d("form", {
|
|
11838
11838
|
ref_key: "formRef",
|
|
11839
|
-
ref:
|
|
11839
|
+
ref: v,
|
|
11840
11840
|
onSubmit: Te(te, ["prevent"]),
|
|
11841
11841
|
class: re(["grid grid-cols-12 p-1", N.value === "default" ? "gap-6" : "gap-4"])
|
|
11842
11842
|
}, [
|
|
@@ -11863,7 +11863,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11863
11863
|
], 34)
|
|
11864
11864
|
], 512),
|
|
11865
11865
|
G(tg, {
|
|
11866
|
-
target:
|
|
11866
|
+
target: v.value,
|
|
11867
11867
|
"scroll-container": h.value,
|
|
11868
11868
|
enabled: M.value,
|
|
11869
11869
|
width: b.value
|
|
@@ -11884,27 +11884,27 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11884
11884
|
emits: ["close", "save", "edit"],
|
|
11885
11885
|
setup(e, { emit: t }) {
|
|
11886
11886
|
const n = e, a = t, l = V(n.schema), o = V(n.defaultValue ? JSON.parse(JSON.stringify(n.defaultValue)) : {}), r = V({}), s = V(n.token || ""), f = V(n.token || ""), c = V(n.mode), w = () => {
|
|
11887
|
-
const
|
|
11888
|
-
return
|
|
11887
|
+
const g = n.method?.trim().toUpperCase();
|
|
11888
|
+
return g === "GET" || g === "POST" || g === "PUT" ? g : c.value === "add" ? "POST" : "PUT";
|
|
11889
11889
|
}, x = () => {
|
|
11890
11890
|
Ae({
|
|
11891
11891
|
type: "success",
|
|
11892
11892
|
title: "Успішно",
|
|
11893
11893
|
message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
|
|
11894
11894
|
});
|
|
11895
|
-
}, S = (
|
|
11895
|
+
}, S = (g) => {
|
|
11896
11896
|
const M = {};
|
|
11897
|
-
|
|
11897
|
+
g.id !== void 0 && g.id !== null && (M.id = g.id, f.value = g.id.toString()), g.obj && typeof g.obj == "object" && Object.assign(M, g.obj), Object.keys(M).length && (o.value = {
|
|
11898
11898
|
...o.value,
|
|
11899
11899
|
...M
|
|
11900
11900
|
});
|
|
11901
|
-
}, $ = async (
|
|
11902
|
-
if (console.log(
|
|
11903
|
-
await
|
|
11901
|
+
}, $ = async (g) => {
|
|
11902
|
+
if (console.log(g), g.ok) {
|
|
11903
|
+
await g.json().catch(() => ({})), x(), a("save", o.value);
|
|
11904
11904
|
return;
|
|
11905
11905
|
}
|
|
11906
|
-
const M = await
|
|
11907
|
-
if (
|
|
11906
|
+
const M = await g.json().catch(() => ({})), b = M.message || M.error;
|
|
11907
|
+
if (g.status === 400) {
|
|
11908
11908
|
Ae({
|
|
11909
11909
|
type: "warning",
|
|
11910
11910
|
title: "Помилка валідації",
|
|
@@ -11912,7 +11912,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11912
11912
|
});
|
|
11913
11913
|
return;
|
|
11914
11914
|
}
|
|
11915
|
-
if (
|
|
11915
|
+
if (g.status === 500) {
|
|
11916
11916
|
Ae({
|
|
11917
11917
|
type: "error",
|
|
11918
11918
|
title: "Серверна помилка",
|
|
@@ -11923,16 +11923,16 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11923
11923
|
Ae({
|
|
11924
11924
|
type: "error",
|
|
11925
11925
|
title: "Помилка",
|
|
11926
|
-
message: `Статус: ${
|
|
11926
|
+
message: `Статус: ${g.status}`
|
|
11927
11927
|
});
|
|
11928
11928
|
};
|
|
11929
|
-
async function
|
|
11930
|
-
const
|
|
11931
|
-
if (
|
|
11929
|
+
async function v() {
|
|
11930
|
+
const g = r.value.validate();
|
|
11931
|
+
if (g) {
|
|
11932
11932
|
Ae({
|
|
11933
11933
|
type: "warning",
|
|
11934
11934
|
title: "Помилка валідації",
|
|
11935
|
-
message: Object.entries(
|
|
11935
|
+
message: Object.entries(g).map(([b, C]) => `${b}: ${C}`).join(`
|
|
11936
11936
|
`)
|
|
11937
11937
|
});
|
|
11938
11938
|
return;
|
|
@@ -11985,42 +11985,42 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
11985
11985
|
return ot(async () => {
|
|
11986
11986
|
try {
|
|
11987
11987
|
if (n.form && !n.schema) {
|
|
11988
|
-
const
|
|
11989
|
-
if (!
|
|
11988
|
+
const g = await fetch(`/api/template/form/${n.form}`);
|
|
11989
|
+
if (!g.ok) {
|
|
11990
11990
|
Ae({
|
|
11991
|
-
type:
|
|
11991
|
+
type: g.status >= 400 && g.status < 500 ? "warning" : "error",
|
|
11992
11992
|
title: "Error",
|
|
11993
|
-
message: `Error code: ${
|
|
11993
|
+
message: `Error code: ${g.status}`
|
|
11994
11994
|
});
|
|
11995
11995
|
return;
|
|
11996
11996
|
}
|
|
11997
|
-
const M = await
|
|
11997
|
+
const M = await g.json();
|
|
11998
11998
|
l.value = M.schema, M.id && (f.value = M.id), M.token && (s.value = M.token, f.value || (f.value = M.token));
|
|
11999
11999
|
} else if (n.token && !n.defaultValue) {
|
|
12000
12000
|
s.value = n.token;
|
|
12001
|
-
const
|
|
12002
|
-
if (!
|
|
12001
|
+
const g = await fetch(`/api/form/${s.value}`);
|
|
12002
|
+
if (!g.ok) {
|
|
12003
12003
|
Ae({
|
|
12004
|
-
type:
|
|
12004
|
+
type: g.status >= 400 && g.status < 500 ? "warning" : "error",
|
|
12005
12005
|
title: "Error",
|
|
12006
|
-
message: `Error code: ${
|
|
12006
|
+
message: `Error code: ${g.status}`
|
|
12007
12007
|
});
|
|
12008
12008
|
return;
|
|
12009
12009
|
}
|
|
12010
|
-
const M = await
|
|
12010
|
+
const M = await g.json();
|
|
12011
12011
|
l.value = M.schema, M.data ? o.value = M.data : c.value = "add", S({
|
|
12012
12012
|
id: M.id,
|
|
12013
12013
|
obj: M.obj
|
|
12014
12014
|
});
|
|
12015
12015
|
}
|
|
12016
|
-
} catch (
|
|
12016
|
+
} catch (g) {
|
|
12017
12017
|
Ae({
|
|
12018
12018
|
type: "error",
|
|
12019
12019
|
title: "Error",
|
|
12020
|
-
message:
|
|
12021
|
-
}), console.error(
|
|
12020
|
+
message: g.message || "Unexpected error"
|
|
12021
|
+
}), console.error(g);
|
|
12022
12022
|
}
|
|
12023
|
-
}), (
|
|
12023
|
+
}), (g, M) => (u(), m("div", gg, [
|
|
12024
12024
|
d("div", yg, [
|
|
12025
12025
|
d("div", hg, [
|
|
12026
12026
|
d("div", bg, [
|
|
@@ -12052,7 +12052,7 @@ const mg = { class: "flex w-full h-full min-h-0 gap-6" }, vg = {
|
|
|
12052
12052
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
|
|
12053
12053
|
}, " Скасувати "),
|
|
12054
12054
|
d("button", {
|
|
12055
|
-
onClick:
|
|
12055
|
+
onClick: v,
|
|
12056
12056
|
type: "button",
|
|
12057
12057
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
12058
12058
|
}, " Зберегти ")
|