@opengis/form 0.1.0 → 0.1.1
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/README.md +26 -11
- package/dist/{index-DGAgz5vJ.js → index-B1hnQExR.js} +868 -860
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +6 -6
- package/dist/src/components/modal/modal-edit.vue.d.ts.map +1 -1
- package/dist/{vs-richtext-BS4M0Znk.js → vs-richtext-DfF4oqFg.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as ge, ref as D, createElementBlock as
|
|
1
|
+
import { defineComponent as ge, ref as D, createElementBlock as g, openBlock as u, Fragment as Ae, createElementVNode as d, createBlock as xe, renderSlot as ft, createVNode as G, unref as q, Teleport as Kt, createCommentVNode as K, normalizeStyle as Oe, toDisplayString as ce, computed as y, inject as dt, mergeProps as Jt, createTextVNode as nt, normalizeProps as Ml, guardReactiveProps as Ll, onMounted as lt, onUnmounted as fn, normalizeClass as ie, mergeModels as Ue, useModel as Ke, withDirectives as Re, vModelText as at, useAttrs as $a, vModelCheckbox as Sa, resolveDynamicComponent as _t, withCtx as ut, withModifiers as Ee, onBeforeUnmount as It, watch as ve, vModelRadio as Ca, renderList as Be, reactive as Al, getCurrentInstance as Zn, resolveComponent as vt, createSlots as Ma, nextTick as et, watchEffect as Vl, vShow as Pt, Transition as Jn, isRef as Yn, defineAsyncComponent as Mo, createStaticVNode as Dl, useSlots as Lo, withKeys as Ao, toRef as Vo, provide as En } from "vue";
|
|
2
2
|
import { Info as ln, Check as La, Mail as Do, Phone as Io, ChevronRight as To, ChevronLeft as Eo, ChevronDown as pn, ChevronUp as Fo, X as Ct, Clock3 as Po, CalendarDays as Oo, Table as Bo, FileCode as Ro, FileText as Gn, FileArchive as No, Plus as Ot, Trash2 as on, Eye as Aa, Download as Il, Upload as Va, Search as Qn, GripVertical as cn, Pencil as jo, Circle as zo, MapPin as Da, Ruler as Ia, Minimize as Uo, Maximize as Ho, ZoomIn as Wo, LoaderCircle as Ta, Copy as qo } from "lucide-vue-next";
|
|
3
|
-
import { notify as
|
|
3
|
+
import { notify as Ie, VsModal as el, modal as Ko } from "@opengis/core";
|
|
4
4
|
function kl(e, t, n) {
|
|
5
5
|
if (!Array.isArray(n) || !n.length) return null;
|
|
6
6
|
const l = String(e?.preset ?? e?.renderer ?? "").trim().toLowerCase();
|
|
@@ -31,7 +31,7 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
31
31
|
function a() {
|
|
32
32
|
n.value = !1;
|
|
33
33
|
}
|
|
34
|
-
return (i, r) => (u(),
|
|
34
|
+
return (i, r) => (u(), g(Ae, null, [
|
|
35
35
|
d("span", {
|
|
36
36
|
class: "inline-flex items-center",
|
|
37
37
|
onMouseenter: o,
|
|
@@ -42,7 +42,7 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
42
42
|
])
|
|
43
43
|
], 32),
|
|
44
44
|
(u(), xe(Kt, { to: "body" }, [
|
|
45
|
-
n.value && i.text ? (u(),
|
|
45
|
+
n.value && i.text ? (u(), g("div", {
|
|
46
46
|
key: 0,
|
|
47
47
|
style: Oe(l.value),
|
|
48
48
|
class: "fixed z-[9999] max-w-xs p-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg pointer-events-none"
|
|
@@ -90,20 +90,20 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
90
90
|
const _ = String(t.item?.__locale || "uk"), x = String(f.parentField), w = i?.value?.[x], b = w?.[`label:${_}`] || (_ !== "uk" ? w?.[_] : void 0) || w?.label || w?.ua || w?.en || x;
|
|
91
91
|
return `${r[_] || r.uk}: ${b}`;
|
|
92
92
|
});
|
|
93
|
-
return (f, _) => (u(),
|
|
94
|
-
l.value ? (u(),
|
|
93
|
+
return (f, _) => (u(), g("div", Zo, [
|
|
94
|
+
l.value ? (u(), g("div", Jo, [
|
|
95
95
|
d("span", Qo, ce(n.value), 1),
|
|
96
|
-
o.value ? (u(),
|
|
96
|
+
o.value ? (u(), g("span", er, "*")) : K("", !0),
|
|
97
97
|
a.value ? (u(), xe(Ea, {
|
|
98
98
|
key: 1,
|
|
99
99
|
text: a.value
|
|
100
100
|
}, null, 8, ["text"])) : K("", !0),
|
|
101
|
-
c.value ? (u(),
|
|
101
|
+
c.value ? (u(), g("span", tr, " (" + ce(c.value) + ") ", 1)) : K("", !0)
|
|
102
102
|
])) : K("", !0),
|
|
103
103
|
ft(f.$slots, "default", Jt(f.$attrs, {
|
|
104
104
|
class: { "opacity-60": f.item.disabled }
|
|
105
105
|
})),
|
|
106
|
-
f.error ? (u(),
|
|
106
|
+
f.error ? (u(), g("span", nr, ce(f.error), 1)) : K("", !0)
|
|
107
107
|
]));
|
|
108
108
|
}
|
|
109
109
|
}), ar = { class: "w-full relative flex flex-row items-center gap-2" }, or = {
|
|
@@ -136,8 +136,8 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
136
136
|
}, i = y(() => {
|
|
137
137
|
const w = t.item?.__autoMeta;
|
|
138
138
|
if (!w || w?.source !== "parent-auto" || !w?.parentField) return "";
|
|
139
|
-
const b = String(t.item?.__locale || "uk"), m = String(w.parentField), k = o?.value?.[m],
|
|
140
|
-
return `${a[b] || a.uk}: ${
|
|
139
|
+
const b = String(t.item?.__locale || "uk"), m = String(w.parentField), k = o?.value?.[m], v = k?.[`label:${b}`] || (b !== "uk" ? k?.[b] : void 0) || k?.label || k?.ua || k?.en || m;
|
|
140
|
+
return `${a[b] || a.uk}: ${v}`;
|
|
141
141
|
}), r = y(() => t.columns ?? { container: 12, label: 3 }), c = y(() => {
|
|
142
142
|
const { container: w, label: b } = r.value;
|
|
143
143
|
return !w || w <= 0 ? 0 : Math.min(Math.max(b ?? 0, 0), w) / w;
|
|
@@ -155,19 +155,19 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
155
155
|
const k = `${m * 100}%`;
|
|
156
156
|
return { flexBasis: k, maxWidth: k };
|
|
157
157
|
});
|
|
158
|
-
return (w, b) => (u(),
|
|
159
|
-
f.value ? (u(),
|
|
158
|
+
return (w, b) => (u(), g("div", ar, [
|
|
159
|
+
f.value ? (u(), g("span", {
|
|
160
160
|
key: 0,
|
|
161
161
|
class: "text-sm text-gray-900 font-medium flex shrink-0 items-center gap-1",
|
|
162
162
|
style: Oe(_.value)
|
|
163
163
|
}, [
|
|
164
164
|
nt(ce(n.value) + " ", 1),
|
|
165
|
-
w.item?.rules?.includes("required") && n.value ? (u(),
|
|
165
|
+
w.item?.rules?.includes("required") && n.value ? (u(), g("span", or, "*")) : K("", !0),
|
|
166
166
|
l.value ? (u(), xe(Ea, {
|
|
167
167
|
key: 1,
|
|
168
168
|
text: l.value
|
|
169
169
|
}, null, 8, ["text"])) : K("", !0),
|
|
170
|
-
i.value ? (u(),
|
|
170
|
+
i.value ? (u(), g("span", rr, " (" + ce(i.value) + ") ", 1)) : K("", !0)
|
|
171
171
|
], 4)) : K("", !0),
|
|
172
172
|
d("div", {
|
|
173
173
|
class: "flex-1 min-w-0",
|
|
@@ -175,7 +175,7 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
175
175
|
}, [
|
|
176
176
|
ft(w.$slots, "default", Ml(Ll(w.$attrs)))
|
|
177
177
|
], 4),
|
|
178
|
-
w.error ? (u(),
|
|
178
|
+
w.error ? (u(), g("span", sr, ce(w.error), 1)) : K("", !0)
|
|
179
179
|
]));
|
|
180
180
|
}
|
|
181
181
|
}), ur = { class: "w-full relative" }, dr = {
|
|
@@ -196,9 +196,9 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
196
196
|
columns: {}
|
|
197
197
|
},
|
|
198
198
|
setup(e) {
|
|
199
|
-
return (t, n) => (u(),
|
|
199
|
+
return (t, n) => (u(), g("div", ur, [
|
|
200
200
|
ft(t.$slots, "default", Ml(Ll(t.$attrs))),
|
|
201
|
-
t.error ? (u(),
|
|
201
|
+
t.error ? (u(), g("span", dr, ce(t.error), 1)) : K("", !0)
|
|
202
202
|
]));
|
|
203
203
|
}
|
|
204
204
|
}), fr = { class: "flex-1 min-w-0" }, pr = {
|
|
@@ -239,18 +239,18 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
239
239
|
window.addEventListener("storage", i);
|
|
240
240
|
}), fn(() => {
|
|
241
241
|
window.removeEventListener("storage", i);
|
|
242
|
-
}), (r, c) => (u(),
|
|
242
|
+
}), (r, c) => (u(), g("div", {
|
|
243
243
|
class: ie(["w-full relative", { "opacity-60": r.item?.disabled }])
|
|
244
244
|
}, [
|
|
245
245
|
d("div", {
|
|
246
246
|
class: ie(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(r.item.type) ? "flex flex-col" : ""]])
|
|
247
247
|
}, [
|
|
248
248
|
d("div", fr, [
|
|
249
|
-
r.ua || r.label ? (u(),
|
|
249
|
+
r.ua || r.label ? (u(), g("p", pr, [
|
|
250
250
|
d("span", mr, ce(r.item[n.value] || r.ua || r.label), 1),
|
|
251
|
-
o.value ? (u(),
|
|
251
|
+
o.value ? (u(), g("span", vr, "*")) : K("", !0)
|
|
252
252
|
])) : K("", !0),
|
|
253
|
-
l.value ? (u(),
|
|
253
|
+
l.value ? (u(), g("p", {
|
|
254
254
|
key: 1,
|
|
255
255
|
class: "text-xs text-slate-500 dark:text-slate-400",
|
|
256
256
|
innerHTML: l.value
|
|
@@ -262,7 +262,7 @@ const Ea = /* @__PURE__ */ ge({
|
|
|
262
262
|
ft(r.$slots, "default", Ml(Ll(r.$attrs)))
|
|
263
263
|
], 2)
|
|
264
264
|
], 2),
|
|
265
|
-
a.value ? (u(),
|
|
265
|
+
a.value ? (u(), g("p", yr, ce(a.value), 1)) : K("", !0)
|
|
266
266
|
], 2));
|
|
267
267
|
}
|
|
268
268
|
}), br = {
|
|
@@ -298,7 +298,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
298
298
|
emits: ["update:modelValue"],
|
|
299
299
|
setup(e) {
|
|
300
300
|
const t = e, { inputClass: n } = wt(t.style), l = Ke(e, "modelValue"), o = y(() => !!t.disabled), a = y(() => t.placeholder ?? "");
|
|
301
|
-
return (i, r) => Re((u(),
|
|
301
|
+
return (i, r) => Re((u(), g("input", {
|
|
302
302
|
type: "password",
|
|
303
303
|
"onUpdate:modelValue": r[0] || (r[0] = (c) => l.value = c),
|
|
304
304
|
placeholder: a.value,
|
|
@@ -333,7 +333,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
333
333
|
function c() {
|
|
334
334
|
typeof l.value == "string" && (l.value = l.value.trim());
|
|
335
335
|
}
|
|
336
|
-
return (f, _) => Re((u(),
|
|
336
|
+
return (f, _) => Re((u(), g("input", {
|
|
337
337
|
type: "text",
|
|
338
338
|
"onUpdate:modelValue": _[0] || (_[0] = (x) => l.value = x),
|
|
339
339
|
placeholder: a.value,
|
|
@@ -389,7 +389,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
389
389
|
const _ = l.step;
|
|
390
390
|
return typeof _ == "number" || typeof _ == "string" ? _ : "any";
|
|
391
391
|
});
|
|
392
|
-
return (_, x) => Re((u(),
|
|
392
|
+
return (_, x) => Re((u(), g("input", {
|
|
393
393
|
type: "number",
|
|
394
394
|
step: f.value,
|
|
395
395
|
"onUpdate:modelValue": x[0] || (x[0] = (w) => o.value = w),
|
|
@@ -448,7 +448,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
448
448
|
maskPosition: "center"
|
|
449
449
|
};
|
|
450
450
|
});
|
|
451
|
-
return (b, m) => (u(),
|
|
451
|
+
return (b, m) => (u(), g("div", Sr, [
|
|
452
452
|
Re(d("input", {
|
|
453
453
|
type: "checkbox",
|
|
454
454
|
value: b.value,
|
|
@@ -468,21 +468,21 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
468
468
|
}, [
|
|
469
469
|
G(q(La), { class: "h-4 w-4" })
|
|
470
470
|
], 2),
|
|
471
|
-
b.html ? (u(),
|
|
471
|
+
b.html ? (u(), g("div", {
|
|
472
472
|
key: 0,
|
|
473
473
|
class: "w-full",
|
|
474
474
|
innerHTML: b.html
|
|
475
|
-
}, null, 8, Lr)) : (u(),
|
|
476
|
-
f.value ? (u(),
|
|
475
|
+
}, null, 8, Lr)) : (u(), g("span", Ar, [
|
|
476
|
+
f.value ? (u(), g("span", {
|
|
477
477
|
key: 0,
|
|
478
478
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
479
479
|
style: Oe({ background: c.value })
|
|
480
480
|
}, null, 4)) : K("", !0),
|
|
481
|
-
_.value ? (u(),
|
|
481
|
+
_.value ? (u(), g("span", {
|
|
482
482
|
key: 1,
|
|
483
483
|
class: "inline-block h-4 w-4",
|
|
484
484
|
style: Oe(w.value)
|
|
485
|
-
}, null, 4)) : i.value ? (u(),
|
|
485
|
+
}, null, 4)) : i.value ? (u(), g("img", {
|
|
486
486
|
key: 2,
|
|
487
487
|
class: "block",
|
|
488
488
|
height: "16",
|
|
@@ -547,7 +547,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
547
547
|
maskPosition: "center"
|
|
548
548
|
};
|
|
549
549
|
});
|
|
550
|
-
return (k,
|
|
550
|
+
return (k, v) => (u(), g("label", {
|
|
551
551
|
class: ie(["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", [i.value, a.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
552
552
|
}, [
|
|
553
553
|
Re(d("input", {
|
|
@@ -555,27 +555,27 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
555
555
|
class: "hidden",
|
|
556
556
|
name: k.id,
|
|
557
557
|
value: k.value,
|
|
558
|
-
"onUpdate:modelValue":
|
|
558
|
+
"onUpdate:modelValue": v[0] || (v[0] = (M) => o.value = M),
|
|
559
559
|
disabled: k.disabled
|
|
560
560
|
}, null, 8, Ir), [
|
|
561
561
|
[Sa, o.value]
|
|
562
562
|
]),
|
|
563
|
-
k.html ? (u(),
|
|
563
|
+
k.html ? (u(), g("span", {
|
|
564
564
|
key: 0,
|
|
565
565
|
class: "w-full",
|
|
566
566
|
innerHTML: k.html
|
|
567
|
-
}, null, 8, Tr)) : (u(),
|
|
568
|
-
x.value ? (u(),
|
|
567
|
+
}, null, 8, Tr)) : (u(), g("span", Er, [
|
|
568
|
+
x.value ? (u(), g("span", {
|
|
569
569
|
key: 0,
|
|
570
570
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
571
571
|
style: Oe({ background: _.value })
|
|
572
572
|
}, null, 4)) : K("", !0),
|
|
573
|
-
w.value ? (u(),
|
|
573
|
+
w.value ? (u(), g("span", {
|
|
574
574
|
key: 1,
|
|
575
575
|
class: "inline-block h-4 w-4",
|
|
576
576
|
style: Oe(m.value)
|
|
577
|
-
}, null, 4)) : c.value || f.value ? (u(),
|
|
578
|
-
c.value ? (u(),
|
|
577
|
+
}, null, 4)) : c.value || f.value ? (u(), g("span", Fr, [
|
|
578
|
+
c.value ? (u(), g("img", {
|
|
579
579
|
key: 0,
|
|
580
580
|
src: c.value,
|
|
581
581
|
width: "16",
|
|
@@ -621,7 +621,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
621
621
|
l("update:modelValue", r);
|
|
622
622
|
}
|
|
623
623
|
}), i = D(`vs-checkbox-${n.view || "default"}`);
|
|
624
|
-
return (r, c) => (u(),
|
|
624
|
+
return (r, c) => (u(), g("div", Br, [
|
|
625
625
|
(u(), xe(_t(i.value === "vs-checkbox-buttons" ? q(Or) : q(Dr)), {
|
|
626
626
|
value: r.value,
|
|
627
627
|
label: r.label,
|
|
@@ -674,14 +674,14 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
674
674
|
emits: ["update:modelValue"],
|
|
675
675
|
setup(e) {
|
|
676
676
|
const t = e, n = Ke(e, "modelValue");
|
|
677
|
-
return (l, o) => t.view === "checkbox" ? (u(),
|
|
677
|
+
return (l, o) => t.view === "checkbox" ? (u(), g("div", Rr, [
|
|
678
678
|
G(_l, {
|
|
679
679
|
modelValue: n.value,
|
|
680
680
|
"onUpdate:modelValue": o[0] || (o[0] = (a) => n.value = a),
|
|
681
681
|
error: l.error || ""
|
|
682
682
|
}, null, 8, ["modelValue", "error"]),
|
|
683
|
-
l.rules?.includes("required") ? (u(),
|
|
684
|
-
l.i ? (u(),
|
|
683
|
+
l.rules?.includes("required") ? (u(), g("span", Nr, "*")) : K("", !0),
|
|
684
|
+
l.i ? (u(), g("button", {
|
|
685
685
|
key: 1,
|
|
686
686
|
class: "cursor-pointer",
|
|
687
687
|
title: l.i,
|
|
@@ -690,7 +690,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
690
690
|
}, [
|
|
691
691
|
G(q(ln), { class: "h-4 w-4 text-gray-500" })
|
|
692
692
|
], 8, jr)) : K("", !0)
|
|
693
|
-
])) : (u(),
|
|
693
|
+
])) : (u(), g("button", {
|
|
694
694
|
key: 1,
|
|
695
695
|
type: "button",
|
|
696
696
|
class: ie(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [n.value ? `bg-${l.style?.primaryColor || "blue"}-500` : "bg-stone-200", l.customClass]]),
|
|
@@ -719,7 +719,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
719
719
|
minlength: {}
|
|
720
720
|
},
|
|
721
721
|
setup(e) {
|
|
722
|
-
return (t, n) => (u(),
|
|
722
|
+
return (t, n) => (u(), g("div", {
|
|
723
723
|
id: t.name,
|
|
724
724
|
class: ie(["text-gray-900", t.customClass]),
|
|
725
725
|
innerHTML: t.html ? t.html : t.text
|
|
@@ -785,7 +785,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
785
785
|
}
|
|
786
786
|
}), ve(l, (r) => {
|
|
787
787
|
a && a.unmaskedValue !== r && (a.value = r != null ? String(r) : "");
|
|
788
|
-
}), (r, c) => (u(),
|
|
788
|
+
}), (r, c) => (u(), g("input", {
|
|
789
789
|
type: "text",
|
|
790
790
|
ref_key: "inputEl",
|
|
791
791
|
ref: o,
|
|
@@ -817,7 +817,7 @@ const wr = ["placeholder", "disabled"], xr = /* @__PURE__ */ ge({
|
|
|
817
817
|
emits: ["update:modelValue"],
|
|
818
818
|
setup(e) {
|
|
819
819
|
const t = e, { inputClass: n } = wt(t.style), l = Ke(e, "modelValue");
|
|
820
|
-
return (o, a) => (u(),
|
|
820
|
+
return (o, a) => (u(), g("div", Wr, [
|
|
821
821
|
d("div", qr, [
|
|
822
822
|
G(q(Do), { class: "h-4 w-4 stroke-gray-500 transition-all" })
|
|
823
823
|
]),
|
|
@@ -883,8 +883,8 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
883
883
|
}, w = /* @__PURE__ */ new Set();
|
|
884
884
|
let b = !1;
|
|
885
885
|
for (let k = 0; k < _.length; k += 1) {
|
|
886
|
-
const
|
|
887
|
-
|
|
886
|
+
const v = _[k];
|
|
887
|
+
v === "{" ? b = !0 : v === "}" ? b = !1 : b && w.add(v);
|
|
888
888
|
}
|
|
889
889
|
const m = {};
|
|
890
890
|
return Object.keys(x).forEach((k) => {
|
|
@@ -922,7 +922,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
922
922
|
if (!i) return;
|
|
923
923
|
const x = c(_);
|
|
924
924
|
i.unmaskedValue !== x && (i.unmaskedValue = x);
|
|
925
|
-
}), (_, x) => (u(),
|
|
925
|
+
}), (_, x) => (u(), g("div", Yr, [
|
|
926
926
|
d("div", Gr, [
|
|
927
927
|
G(q(Io), { class: "h-4 w-4 stroke-gray-500 transition-all" })
|
|
928
928
|
]),
|
|
@@ -982,7 +982,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
982
982
|
maskPosition: "center"
|
|
983
983
|
};
|
|
984
984
|
});
|
|
985
|
-
return (x, w) => (u(),
|
|
985
|
+
return (x, w) => (u(), g("label", {
|
|
986
986
|
class: ie(["flex items-center gap-0", [t.customClass, l.value ? "cursor-not-allowed opacity-60" : ""]])
|
|
987
987
|
}, [
|
|
988
988
|
Re(d("input", {
|
|
@@ -1000,26 +1000,26 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1000
1000
|
l.value ? "opacity-50 cursor-not-allowed" : ""
|
|
1001
1001
|
]])
|
|
1002
1002
|
}, [
|
|
1003
|
-
n.value == t.value ? (u(),
|
|
1003
|
+
n.value == t.value ? (u(), g("span", {
|
|
1004
1004
|
key: 0,
|
|
1005
1005
|
class: ie(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
1006
1006
|
}, null, 2)) : K("", !0)
|
|
1007
1007
|
], 2),
|
|
1008
|
-
t.html ? (u(),
|
|
1008
|
+
t.html ? (u(), g("div", {
|
|
1009
1009
|
key: 0,
|
|
1010
1010
|
class: "w-full",
|
|
1011
1011
|
innerHTML: t.html
|
|
1012
|
-
}, null, 8, Jr)) : (u(),
|
|
1013
|
-
r.value ? (u(),
|
|
1012
|
+
}, null, 8, Jr)) : (u(), g("div", Qr, [
|
|
1013
|
+
r.value ? (u(), g("span", {
|
|
1014
1014
|
key: 0,
|
|
1015
1015
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
1016
1016
|
style: Oe({ background: i.value })
|
|
1017
1017
|
}, null, 4)) : K("", !0),
|
|
1018
|
-
c.value ? (u(),
|
|
1018
|
+
c.value ? (u(), g("span", {
|
|
1019
1019
|
key: 1,
|
|
1020
1020
|
class: "inline-block h-4 w-4",
|
|
1021
1021
|
style: Oe(_.value)
|
|
1022
|
-
}, null, 4)) : o.value ? (u(),
|
|
1022
|
+
}, null, 4)) : o.value ? (u(), g("img", {
|
|
1023
1023
|
key: 2,
|
|
1024
1024
|
class: "block",
|
|
1025
1025
|
height: "16",
|
|
@@ -1074,7 +1074,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1074
1074
|
maskPosition: "center"
|
|
1075
1075
|
};
|
|
1076
1076
|
});
|
|
1077
|
-
return (x, w) => (u(),
|
|
1077
|
+
return (x, w) => (u(), g("label", {
|
|
1078
1078
|
class: ie(["flex h-full w-full items-center border rounded-lg px-2 py-1", [
|
|
1079
1079
|
n.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
1080
1080
|
t.customClass,
|
|
@@ -1090,21 +1090,21 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1090
1090
|
}, null, 8, ls), [
|
|
1091
1091
|
[Ca, n.value]
|
|
1092
1092
|
]),
|
|
1093
|
-
t.html ? (u(),
|
|
1093
|
+
t.html ? (u(), g("div", {
|
|
1094
1094
|
key: 0,
|
|
1095
1095
|
class: "w-full",
|
|
1096
1096
|
innerHTML: t.html
|
|
1097
|
-
}, null, 8, as)) : (u(),
|
|
1098
|
-
r.value ? (u(),
|
|
1097
|
+
}, null, 8, as)) : (u(), g("div", os, [
|
|
1098
|
+
r.value ? (u(), g("span", {
|
|
1099
1099
|
key: 0,
|
|
1100
1100
|
class: "inline-flex h-3 w-3 rounded-full border border-gray-200",
|
|
1101
1101
|
style: Oe({ background: i.value })
|
|
1102
1102
|
}, null, 4)) : K("", !0),
|
|
1103
|
-
c.value ? (u(),
|
|
1103
|
+
c.value ? (u(), g("span", {
|
|
1104
1104
|
key: 1,
|
|
1105
1105
|
class: "inline-block h-4 w-4",
|
|
1106
1106
|
style: Oe(_.value)
|
|
1107
|
-
}, null, 4)) : o.value ? (u(),
|
|
1107
|
+
}, null, 4)) : o.value ? (u(), g("img", {
|
|
1108
1108
|
key: 2,
|
|
1109
1109
|
class: "block",
|
|
1110
1110
|
height: "16",
|
|
@@ -1236,10 +1236,10 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1236
1236
|
});
|
|
1237
1237
|
return lt(async () => {
|
|
1238
1238
|
await w();
|
|
1239
|
-
}), (b, m) => (u(),
|
|
1239
|
+
}), (b, m) => (u(), g("div", {
|
|
1240
1240
|
class: ie(c.value)
|
|
1241
1241
|
}, [
|
|
1242
|
-
(u(!0),
|
|
1242
|
+
(u(!0), g(Ae, null, Be(q(x), (k) => (u(), g("div", {
|
|
1243
1243
|
key: k?.id,
|
|
1244
1244
|
class: ie(["flex items-stretch", b.position === "horizontal" ? t.customClass : ""]),
|
|
1245
1245
|
style: Oe(f.value)
|
|
@@ -1252,7 +1252,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1252
1252
|
checked: n.value?.toString?.() === k.id?.toString?.(),
|
|
1253
1253
|
"custom-class": b.position === "horizontal" ? "" : t.customClass,
|
|
1254
1254
|
modelValue: n.value,
|
|
1255
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
1255
|
+
"onUpdate:modelValue": m[0] || (m[0] = (v) => n.value = v)
|
|
1256
1256
|
}, { ref_for: !0 }, b.$attrs), null, 16, ["text", "html", "option", "value", "checked", "custom-class", "modelValue"]))
|
|
1257
1257
|
], 6))), 128))
|
|
1258
1258
|
], 2));
|
|
@@ -1298,24 +1298,24 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1298
1298
|
options: n.options
|
|
1299
1299
|
},
|
|
1300
1300
|
formValues: a
|
|
1301
|
-
}), c = y(() => i.value), f = (
|
|
1301
|
+
}), c = y(() => i.value), f = (S) => S?.value || S?.id || S?.text || S, _ = y(() => n.slot ?? n?.optionTemplate ?? ""), x = y(() => tl(_.value)), w = (S) => ll(S, _.value), b = (S) => al(S, _.value), m = (S) => `lg:col-span-${S || 12}`, k = y(() => [
|
|
1302
1302
|
n.position === "vertical" ? "flex flex-col" : "",
|
|
1303
1303
|
n.colSpan ? "grid" : "flex justify-start"
|
|
1304
|
-
]),
|
|
1304
|
+
]), v = (S) => S == null || S === "" ? null : typeof S == "string" || typeof S == "number" ? S : String(S), M = y(() => {
|
|
1305
1305
|
if (!n.group)
|
|
1306
1306
|
return [];
|
|
1307
|
-
const
|
|
1307
|
+
const S = /* @__PURE__ */ new Map();
|
|
1308
1308
|
c.value.forEach((F) => {
|
|
1309
|
-
const j = F[n.group], B =
|
|
1310
|
-
|
|
1309
|
+
const j = F[n.group], B = v(j);
|
|
1310
|
+
S.has(B) || S.set(B, []), S.get(B)?.push(F);
|
|
1311
1311
|
});
|
|
1312
1312
|
const V = [];
|
|
1313
1313
|
n.values?.length && n.values.forEach((F) => {
|
|
1314
|
-
const j =
|
|
1314
|
+
const j = v(F);
|
|
1315
1315
|
V.push(j);
|
|
1316
1316
|
});
|
|
1317
1317
|
const A = /* @__PURE__ */ new Set(), U = (F) => {
|
|
1318
|
-
const j =
|
|
1318
|
+
const j = S.get(F) || [];
|
|
1319
1319
|
if (!j.length)
|
|
1320
1320
|
return null;
|
|
1321
1321
|
const B = F === null ? "group-null" : `group-${String(F)}`, P = F === null ? gs : String(F);
|
|
@@ -1328,7 +1328,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1328
1328
|
return V.forEach((F) => {
|
|
1329
1329
|
const j = U(F);
|
|
1330
1330
|
j && Z.push(j);
|
|
1331
|
-
}),
|
|
1331
|
+
}), S.forEach((F, j) => {
|
|
1332
1332
|
if (A.has(j))
|
|
1333
1333
|
return;
|
|
1334
1334
|
const B = U(j);
|
|
@@ -1337,12 +1337,12 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1337
1337
|
});
|
|
1338
1338
|
return ve(
|
|
1339
1339
|
() => n.modelValue,
|
|
1340
|
-
(
|
|
1341
|
-
if (typeof
|
|
1340
|
+
(S) => {
|
|
1341
|
+
if (typeof S == "boolean" && c.value.length === 1) {
|
|
1342
1342
|
const V = f(c.value[0]);
|
|
1343
|
-
o[V] =
|
|
1344
|
-
} else if (Array.isArray(
|
|
1345
|
-
const V = new Set(
|
|
1343
|
+
o[V] = S;
|
|
1344
|
+
} else if (Array.isArray(S)) {
|
|
1345
|
+
const V = new Set(S);
|
|
1346
1346
|
c.value.forEach((A) => {
|
|
1347
1347
|
if (!A.disabled) {
|
|
1348
1348
|
const U = f(A);
|
|
@@ -1359,37 +1359,37 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1359
1359
|
l("update:modelValue", null);
|
|
1360
1360
|
return;
|
|
1361
1361
|
}
|
|
1362
|
-
const
|
|
1363
|
-
l("update:modelValue",
|
|
1362
|
+
const S = Object.entries(o).filter(([, V]) => V).map(([V]) => V);
|
|
1363
|
+
l("update:modelValue", S.length === 0 ? [] : S);
|
|
1364
1364
|
},
|
|
1365
1365
|
{ deep: !0 }
|
|
1366
1366
|
), lt(async () => {
|
|
1367
1367
|
if (await r(), typeof n.modelValue == "boolean" && c.value.length === 1) {
|
|
1368
|
-
const
|
|
1369
|
-
o[
|
|
1368
|
+
const S = f(c.value[0]);
|
|
1369
|
+
o[S] = n.modelValue;
|
|
1370
1370
|
} else if (Array.isArray(n.modelValue)) {
|
|
1371
|
-
const
|
|
1371
|
+
const S = new Set(n.modelValue);
|
|
1372
1372
|
c.value.forEach((V) => {
|
|
1373
1373
|
if (!V.disabled) {
|
|
1374
1374
|
const A = f(V);
|
|
1375
|
-
o[A] =
|
|
1375
|
+
o[A] = S.has(A);
|
|
1376
1376
|
}
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
|
-
}), (
|
|
1380
|
-
(u(!0),
|
|
1379
|
+
}), (S, V) => n.group ? (u(), g("div", ms, [
|
|
1380
|
+
(u(!0), g(Ae, null, Be(M.value, (A) => (u(), g("div", {
|
|
1381
1381
|
key: A.key,
|
|
1382
1382
|
class: "flex flex-col gap-2"
|
|
1383
1383
|
}, [
|
|
1384
|
-
A.label ? (u(),
|
|
1384
|
+
A.label ? (u(), g("span", vs, ce(A.label), 1)) : K("", !0),
|
|
1385
1385
|
d("div", {
|
|
1386
1386
|
class: ie(["p-0 w-full gap-[12px]", k.value])
|
|
1387
1387
|
}, [
|
|
1388
|
-
(u(!0),
|
|
1388
|
+
(u(!0), g(Ae, null, Be(A.options, (U) => (u(), xe(_l, {
|
|
1389
1389
|
modelValue: o[f(U)],
|
|
1390
1390
|
"onUpdate:modelValue": (Z) => o[f(U)] = Z,
|
|
1391
1391
|
value: f(U),
|
|
1392
|
-
class: ie(m(
|
|
1392
|
+
class: ie(m(S.colSpan)),
|
|
1393
1393
|
disabled: n.disabled || U.disabled,
|
|
1394
1394
|
label: b(U),
|
|
1395
1395
|
labelHtml: x.value ? w(U) : "",
|
|
@@ -1397,19 +1397,19 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1397
1397
|
icon: U?.icon,
|
|
1398
1398
|
imgUrl: U?.imgUrl,
|
|
1399
1399
|
option: U,
|
|
1400
|
-
view:
|
|
1400
|
+
view: S.view
|
|
1401
1401
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "labelHtml", "icon", "imgUrl", "option", "view"]))), 128))
|
|
1402
1402
|
], 2)
|
|
1403
1403
|
]))), 128))
|
|
1404
|
-
])) : (u(),
|
|
1404
|
+
])) : (u(), g("div", {
|
|
1405
1405
|
key: 0,
|
|
1406
1406
|
class: ie(["p-0 w-full gap-[10px]", k.value])
|
|
1407
1407
|
}, [
|
|
1408
|
-
(u(!0),
|
|
1408
|
+
(u(!0), g(Ae, null, Be(c.value, (A) => (u(), xe(_l, {
|
|
1409
1409
|
modelValue: o[f(A)],
|
|
1410
1410
|
"onUpdate:modelValue": (U) => o[f(A)] = U,
|
|
1411
1411
|
value: f(A),
|
|
1412
|
-
class: ie(m(
|
|
1412
|
+
class: ie(m(S.colSpan)),
|
|
1413
1413
|
disabled: n.disabled || A.disabled,
|
|
1414
1414
|
label: b(A),
|
|
1415
1415
|
labelHtml: x.value ? w(A) : "",
|
|
@@ -1417,7 +1417,7 @@ const Yr = { class: "relative w-full bg-white rounded-lg" }, Gr = { class: "abso
|
|
|
1417
1417
|
icon: A?.icon,
|
|
1418
1418
|
imgUrl: A?.imgUrl,
|
|
1419
1419
|
option: A,
|
|
1420
|
-
view:
|
|
1420
|
+
view: S.view
|
|
1421
1421
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "labelHtml", "icon", "imgUrl", "option", "view"]))), 128))
|
|
1422
1422
|
], 2));
|
|
1423
1423
|
}
|
|
@@ -1683,7 +1683,7 @@ const Rs = ["year", "month", "day", "time", "custom"], Ns = ge({
|
|
|
1683
1683
|
};
|
|
1684
1684
|
function Ks(e, t, n, l, o, a) {
|
|
1685
1685
|
const i = vt("ChevronLeft"), r = vt("ChevronRight");
|
|
1686
|
-
return u(),
|
|
1686
|
+
return u(), g("div", {
|
|
1687
1687
|
class: ie([
|
|
1688
1688
|
"p-datepicker-panel p-component text-center text-slate-700 overflow-x-hidden bg-white border border-slate-200 rounded-xl shadow-[0_4px_12px_rgba(0,0,0,0.1)] p-2",
|
|
1689
1689
|
e.viewMode === "month" || e.viewMode === "year" ? "w-[182px] min-w-[182px]" : "w-[268px] min-w-[182px]"
|
|
@@ -1692,7 +1692,7 @@ function Ks(e, t, n, l, o, a) {
|
|
|
1692
1692
|
onMousedown: t[5] || (t[5] = Ee(() => {
|
|
1693
1693
|
}, ["prevent"]))
|
|
1694
1694
|
}, [
|
|
1695
|
-
e.hideHeader ? K("", !0) : (u(),
|
|
1695
|
+
e.hideHeader ? K("", !0) : (u(), g("div", js, [
|
|
1696
1696
|
d("button", {
|
|
1697
1697
|
class: "p-datepicker-prev-button inline-flex items-center justify-center size-8 rounded-full text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 disabled:text-slate-300 disabled:hover:bg-transparent",
|
|
1698
1698
|
disabled: e.leftDisabled,
|
|
@@ -1727,7 +1727,7 @@ function Ks(e, t, n, l, o, a) {
|
|
|
1727
1727
|
], 8, Us)
|
|
1728
1728
|
])),
|
|
1729
1729
|
d("div", null, [
|
|
1730
|
-
"subheading" in e.$slots ? (u(),
|
|
1730
|
+
"subheading" in e.$slots ? (u(), g("div", Hs, [
|
|
1731
1731
|
ft(e.$slots, "subheading")
|
|
1732
1732
|
])) : K("", !0),
|
|
1733
1733
|
d("div", {
|
|
@@ -1739,7 +1739,7 @@ function Ks(e, t, n, l, o, a) {
|
|
|
1739
1739
|
])
|
|
1740
1740
|
}, [
|
|
1741
1741
|
ft(e.$slots, "body", {}, () => [
|
|
1742
|
-
(u(!0),
|
|
1742
|
+
(u(!0), g(Ae, null, Be(e.items, (c) => (u(), g("button", {
|
|
1743
1743
|
key: c.key,
|
|
1744
1744
|
disabled: c.disabled,
|
|
1745
1745
|
class: ie([
|
|
@@ -1763,7 +1763,7 @@ function Ks(e, t, n, l, o, a) {
|
|
|
1763
1763
|
])
|
|
1764
1764
|
], 2),
|
|
1765
1765
|
ft(e.$slots, "after-calendar"),
|
|
1766
|
-
e.showButtonBar ? (u(),
|
|
1766
|
+
e.showButtonBar ? (u(), g("div", qs, [
|
|
1767
1767
|
d("button", {
|
|
1768
1768
|
type: "button",
|
|
1769
1769
|
class: "p-datepicker-today-button text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors px-1.5 py-1 rounded-md hover:bg-slate-100",
|
|
@@ -2001,7 +2001,7 @@ const Qs = /* @__PURE__ */ Xe(Zs, [["render", Js]]), ei = ge({
|
|
|
2001
2001
|
},
|
|
2002
2002
|
setup(e, { emit: t }) {
|
|
2003
2003
|
const n = y(
|
|
2004
|
-
() => (
|
|
2004
|
+
() => (v) => (M) => wn(M, v)
|
|
2005
2005
|
), l = y(() => Pl(e.pageDate)), o = y(() => Ol(e.pageDate)), a = y(() => ({
|
|
2006
2006
|
start: l.value,
|
|
2007
2007
|
end: o.value
|
|
@@ -2009,26 +2009,26 @@ const Qs = /* @__PURE__ */ Xe(Zs, [["render", Js]]), ei = ge({
|
|
|
2009
2009
|
start: Rl(l.value, e.weekStartsOn),
|
|
2010
2010
|
end: As(o.value, e.weekStartsOn)
|
|
2011
2011
|
})), r = y(() => e.customWeekdays?.length === 7 ? e.customWeekdays : null), c = y(() => {
|
|
2012
|
-
const
|
|
2012
|
+
const v = e.weekStartsOn, M = r.value;
|
|
2013
2013
|
if (M)
|
|
2014
|
-
return Array.from({ length: 7 }).map((V, A) => M[(
|
|
2015
|
-
const
|
|
2016
|
-
return Array.from(Array(7)).map((V, A) => (
|
|
2017
|
-
}), f = (
|
|
2018
|
-
const
|
|
2014
|
+
return Array.from({ length: 7 }).map((V, A) => M[(v + A) % 7]);
|
|
2015
|
+
const S = n.value(e.weekdayFormat);
|
|
2016
|
+
return Array.from(Array(7)).map((V, A) => (v + A) % 7).map((V) => Vs(/* @__PURE__ */ new Date(), V, e.weekStartsOn)).map(S);
|
|
2017
|
+
}), f = (v, M, S, V) => V?.dates?.some((A) => Kn(v, A)) || V?.predicate?.(v) ? !1 : !M && !S ? !0 : !(M && _n(v, an(M)) || S && $n(v, Mn(S))), _ = y(() => {
|
|
2018
|
+
const v = /* @__PURE__ */ new Date(), M = n.value(e.format);
|
|
2019
2019
|
return Cs(i.value).map(
|
|
2020
|
-
(
|
|
2021
|
-
value:
|
|
2022
|
-
display: M(
|
|
2023
|
-
selected: !!e.selected && Kn(e.selected,
|
|
2024
|
-
current: Kn(
|
|
2025
|
-
disabled: !e.allowOutsideInterval && !Is(
|
|
2026
|
-
|
|
2020
|
+
(S) => ({
|
|
2021
|
+
value: S,
|
|
2022
|
+
display: M(S),
|
|
2023
|
+
selected: !!e.selected && Kn(e.selected, S),
|
|
2024
|
+
current: Kn(v, S),
|
|
2025
|
+
disabled: !e.allowOutsideInterval && !Is(S, a.value) || !f(
|
|
2026
|
+
S,
|
|
2027
2027
|
e.lowerLimit,
|
|
2028
2028
|
e.upperLimit,
|
|
2029
2029
|
e.disabledDates
|
|
2030
2030
|
),
|
|
2031
|
-
key: n.value("yyyy-MM-dd")(
|
|
2031
|
+
key: n.value("yyyy-MM-dd")(S)
|
|
2032
2032
|
})
|
|
2033
2033
|
);
|
|
2034
2034
|
}), x = y(() => n.value(e.headingFormat)(e.pageDate)), w = y(
|
|
@@ -2067,7 +2067,7 @@ function ti(e, t, n, l, o, a) {
|
|
|
2067
2067
|
nt(ce(e.heading), 1)
|
|
2068
2068
|
]),
|
|
2069
2069
|
subheading: ut(() => [
|
|
2070
|
-
(u(!0),
|
|
2070
|
+
(u(!0), g(Ae, null, Be(e.weekDays, (r, c) => (u(), g("span", {
|
|
2071
2071
|
key: r,
|
|
2072
2072
|
class: ie(`v3dp__subheading__weekday__${c}`)
|
|
2073
2073
|
}, ce(r), 3))), 128))
|
|
@@ -2151,7 +2151,7 @@ const ni = /* @__PURE__ */ Xe(ei, [["render", ti]]), li = ge({
|
|
|
2151
2151
|
}, oi = { class: "p-datepicker-hour-picker flex flex-col items-center gap-1" }, ri = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, si = { class: "p-datepicker-minute-picker flex flex-col items-center gap-1" }, ii = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, ui = { class: "col-span-2" }, di = { class: "p-datepicker-time-picker flex items-center justify-center gap-2 py-1" }, ci = { class: "p-datepicker-hour-picker flex flex-col items-center gap-1" }, fi = { class: "min-w-8 text-center text-sm font-medium text-slate-700" }, pi = { class: "p-datepicker-minute-picker flex flex-col items-center gap-1" }, mi = { class: "min-w-8 text-center text-sm font-medium text-slate-700" };
|
|
2152
2152
|
function vi(e, t, n, l, o, a) {
|
|
2153
2153
|
const i = vt("ChevronUp"), r = vt("ChevronDown"), c = vt("picker-popup");
|
|
2154
|
-
return e.embedded ? (u(),
|
|
2154
|
+
return e.embedded ? (u(), g("div", ai, [
|
|
2155
2155
|
d("div", oi, [
|
|
2156
2156
|
d("button", {
|
|
2157
2157
|
type: "button",
|
|
@@ -2428,7 +2428,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2428
2428
|
return /0/.test(oe) ? oe : "";
|
|
2429
2429
|
}, b = y(() => w(e.inputFormat));
|
|
2430
2430
|
let m = null, k = null;
|
|
2431
|
-
const
|
|
2431
|
+
const v = () => {
|
|
2432
2432
|
m?.destroy(), m = null;
|
|
2433
2433
|
}, M = async () => {
|
|
2434
2434
|
if (!k) {
|
|
@@ -2436,18 +2436,18 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2436
2436
|
k = ue;
|
|
2437
2437
|
}
|
|
2438
2438
|
return k;
|
|
2439
|
-
},
|
|
2439
|
+
}, S = () => {
|
|
2440
2440
|
m && m.value !== x.value && (m.value = x.value ?? "");
|
|
2441
2441
|
}, V = (ue) => {
|
|
2442
2442
|
const oe = ue && gt(ue) ? wn(ue, e.inputFormat) : "";
|
|
2443
|
-
x.value !== oe && (x.value = oe),
|
|
2443
|
+
x.value !== oe && (x.value = oe), S();
|
|
2444
2444
|
}, A = async () => {
|
|
2445
|
-
if (
|
|
2445
|
+
if (v(), !a.value || !b.value) return;
|
|
2446
2446
|
m = (await M())(a.value, {
|
|
2447
2447
|
mask: b.value,
|
|
2448
2448
|
lazy: !0,
|
|
2449
2449
|
overwrite: !1
|
|
2450
|
-
}),
|
|
2450
|
+
}), S();
|
|
2451
2451
|
};
|
|
2452
2452
|
ve(
|
|
2453
2453
|
() => e.modelValue,
|
|
@@ -2465,11 +2465,11 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2465
2465
|
A();
|
|
2466
2466
|
});
|
|
2467
2467
|
}), It(() => {
|
|
2468
|
-
|
|
2468
|
+
v();
|
|
2469
2469
|
}), ve(b, (ue) => {
|
|
2470
2470
|
ue ? et(() => {
|
|
2471
2471
|
A();
|
|
2472
|
-
}) :
|
|
2472
|
+
}) : v();
|
|
2473
2473
|
});
|
|
2474
2474
|
const U = y(() => n.value !== "none"), Z = y(() => e.startingView === "time" && e.minimumView === "time"), F = y(() => e.startingView === "day" && e.minimumView === "time"), j = (ue) => {
|
|
2475
2475
|
e.disabled || (U.value || (l.value = e.modelValue || yi(e.lowerLimit, e.upperLimit, l.value), t("opened")), n.value = ue, et(() => Je()));
|
|
@@ -2544,7 +2544,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2544
2544
|
overflowY: "auto",
|
|
2545
2545
|
zIndex: "2147483000"
|
|
2546
2546
|
}, F.value && n.value === "day" && (r.value.minWidth = "345px");
|
|
2547
|
-
},
|
|
2547
|
+
}, Te = (ue, oe) => ue.bottom > oe.top && ue.top < oe.bottom && ue.right > oe.left && ue.left < oe.right, Ve = (ue) => {
|
|
2548
2548
|
const oe = [];
|
|
2549
2549
|
let Le = ue.parentElement;
|
|
2550
2550
|
for (; Le; ) {
|
|
@@ -2555,7 +2555,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2555
2555
|
}, He = () => {
|
|
2556
2556
|
if (!a.value) return !1;
|
|
2557
2557
|
const ue = a.value.getBoundingClientRect(), oe = new DOMRect(0, 0, window.innerWidth, window.innerHeight);
|
|
2558
|
-
return
|
|
2558
|
+
return Te(ue, oe) ? Ve(a.value).every((Pe) => Te(ue, Pe.getBoundingClientRect())) : !1;
|
|
2559
2559
|
}, Ze = () => {
|
|
2560
2560
|
if (U.value) {
|
|
2561
2561
|
if (!He()) {
|
|
@@ -2622,7 +2622,7 @@ const gi = /* @__PURE__ */ Xe(li, [["render", vi]]), On = ["time", "day", "month
|
|
|
2622
2622
|
}, wi = { class: "p-datepicker p-component p-inputwrapper relative" }, xi = ["readonly", "value", "placeholder", "disabled", "tabindex"], ki = { class: "p-datepicker-input-icon-container absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400" }, _i = { class: "absolute right-8 top-1/2 -translate-y-1/2" };
|
|
2623
2623
|
function $i(e, t, n, l, o, a) {
|
|
2624
2624
|
const i = vt("Clock3"), r = vt("CalendarDays"), c = vt("X"), f = vt("year-picker"), _ = vt("month-picker"), x = vt("time-picker"), w = vt("day-picker");
|
|
2625
|
-
return u(),
|
|
2625
|
+
return u(), g("div", bi, [
|
|
2626
2626
|
d("div", wi, [
|
|
2627
2627
|
d("input", Jt({
|
|
2628
2628
|
type: "text",
|
|
@@ -2813,7 +2813,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
2813
2813
|
week: "dd.MM.yyyy",
|
|
2814
2814
|
year: "yyyy"
|
|
2815
2815
|
};
|
|
2816
|
-
function
|
|
2816
|
+
function v() {
|
|
2817
2817
|
const T = a?.appContext?.config?.globalProperties?.$i18n?.locale;
|
|
2818
2818
|
if (typeof T == "string" && T)
|
|
2819
2819
|
return T;
|
|
@@ -2830,12 +2830,12 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
2830
2830
|
if (!ne) return "";
|
|
2831
2831
|
if (typeof ne == "string") return ne;
|
|
2832
2832
|
if (typeof ne == "object") {
|
|
2833
|
-
const R =
|
|
2833
|
+
const R = v();
|
|
2834
2834
|
return ne[R] || ne[R.split("-")[0]] || ne.uk || ne.en || "";
|
|
2835
2835
|
}
|
|
2836
2836
|
return "";
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function S(T) {
|
|
2839
2839
|
return T ? T.replaceAll("dd", "__DAY2__").replaceAll("d", "__DAY1__").replaceAll("mm", "__MONTH2__").replaceAll("m", "__MONTH1__").replaceAll("yy", "__YEAR2__").replaceAll("y", "__YEAR1__").replaceAll("__DAY2__", "dd").replaceAll("__DAY1__", "d").replaceAll("__MONTH2__", "MM").replaceAll("__MONTH1__", "M").replaceAll("__YEAR2__", "yy").replaceAll("__YEAR1__", "yyyy") : "";
|
|
2840
2840
|
}
|
|
2841
2841
|
const V = y(() => {
|
|
@@ -2843,7 +2843,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
2843
2843
|
if (i.value === "time") return T;
|
|
2844
2844
|
const ne = n.dateFormat || M();
|
|
2845
2845
|
if (!ne) return T;
|
|
2846
|
-
const R =
|
|
2846
|
+
const R = S(ne);
|
|
2847
2847
|
return R ? i.value === "datetime" ? `${R} HH:mm` : R : T;
|
|
2848
2848
|
});
|
|
2849
2849
|
function A(T, ne) {
|
|
@@ -2965,7 +2965,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
2965
2965
|
function ye(T) {
|
|
2966
2966
|
return String(T).padStart(2, "0");
|
|
2967
2967
|
}
|
|
2968
|
-
return (T, ne) => (u(),
|
|
2968
|
+
return (T, ne) => (u(), g("div", {
|
|
2969
2969
|
class: ie(["vs-date-picker", n.customClass])
|
|
2970
2970
|
}, [
|
|
2971
2971
|
G(Si, {
|
|
@@ -3014,7 +3014,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3014
3014
|
}
|
|
3015
3015
|
).then((x) => x.json()))?.result;
|
|
3016
3016
|
} catch (n) {
|
|
3017
|
-
return
|
|
3017
|
+
return Ie({
|
|
3018
3018
|
type: "error",
|
|
3019
3019
|
title: "Помилка!",
|
|
3020
3020
|
message: "Сталась помилка під час завантаження файлу",
|
|
@@ -3090,20 +3090,20 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3090
3090
|
}, w = () => {
|
|
3091
3091
|
a.disabled || a.isUploading || o("click");
|
|
3092
3092
|
};
|
|
3093
|
-
return (b, m) => i.value ? (u(),
|
|
3093
|
+
return (b, m) => i.value ? (u(), g("div", {
|
|
3094
3094
|
key: 0,
|
|
3095
3095
|
title: b.title,
|
|
3096
3096
|
class: ie(["relative h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300", c.value]),
|
|
3097
3097
|
onClick: w
|
|
3098
3098
|
}, [
|
|
3099
|
-
b.isUploading ? (u(),
|
|
3099
|
+
b.isUploading ? (u(), g("div", Ei, [
|
|
3100
3100
|
m[2] || (m[2] = d("div", { class: "loader" }, null, -1)),
|
|
3101
3101
|
d("span", null, ce(b.progressPercent) + "%", 1)
|
|
3102
3102
|
])) : (u(), xe(q(Ot), {
|
|
3103
3103
|
key: 1,
|
|
3104
3104
|
class: "h-4 w-4"
|
|
3105
3105
|
}))
|
|
3106
|
-
], 10, Ti)) : (u(),
|
|
3106
|
+
], 10, Ti)) : (u(), g("div", {
|
|
3107
3107
|
key: 1,
|
|
3108
3108
|
title: r.value,
|
|
3109
3109
|
class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"
|
|
@@ -3139,7 +3139,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3139
3139
|
])
|
|
3140
3140
|
], 8, Fi));
|
|
3141
3141
|
}
|
|
3142
|
-
}), Vt = /* @__PURE__ */ Xe(Oi, [["__scopeId", "data-v-dfd41538"]]), za = (e) => e ? e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean).map((t) => t.startsWith(".") ? t.slice(1) : t) : [], Ua = (e, t) => !t || e.size <= t * 1024 * 1024 ? !0 : (
|
|
3142
|
+
}), Vt = /* @__PURE__ */ Xe(Oi, [["__scopeId", "data-v-dfd41538"]]), za = (e) => e ? e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean).map((t) => t.startsWith(".") ? t.slice(1) : t) : [], Ua = (e, t) => !t || e.size <= t * 1024 * 1024 ? !0 : (Ie({
|
|
3143
3143
|
type: "error",
|
|
3144
3144
|
title: "Помилка!",
|
|
3145
3145
|
message: `Файл "${e.name}" занадто великий. Максимальний розмір: ${t} МБ`,
|
|
@@ -3147,7 +3147,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3147
3147
|
}), !1), Ha = (e, t) => {
|
|
3148
3148
|
if (!t.length) return !0;
|
|
3149
3149
|
const n = e.name.split(".").pop()?.toLowerCase() || "";
|
|
3150
|
-
return t.includes(n) ? !0 : (
|
|
3150
|
+
return t.includes(n) ? !0 : (Ie({
|
|
3151
3151
|
type: "error",
|
|
3152
3152
|
title: "Помилка!",
|
|
3153
3153
|
message: `Неприпустимий формат файлу "${e.name}". Дозволені формати: ${t.map((l) => `.${l}`).join(", ")}`,
|
|
@@ -3168,7 +3168,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3168
3168
|
return;
|
|
3169
3169
|
}
|
|
3170
3170
|
n[c] = _;
|
|
3171
|
-
}), l.length ? (
|
|
3171
|
+
}), l.length ? (Ie({
|
|
3172
3172
|
type: "warning",
|
|
3173
3173
|
title: "Заповніть поля",
|
|
3174
3174
|
message: `Поля (${l.join(", ")}) необхідні для завантаження файлу`,
|
|
@@ -3202,7 +3202,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3202
3202
|
emits: /* @__PURE__ */ Ue(["change"], ["update:modelValue"]),
|
|
3203
3203
|
setup(e, { emit: t }) {
|
|
3204
3204
|
const n = e, l = Ke(e, "modelValue"), o = t, a = D(null), i = D(!1), r = D([]), c = dt("values"), f = y(() => qa(l.value, !!n.multiple)), _ = y(() => Ka(l.value, !!n.multiple)), x = y(() => za(n.format)), w = y(() => Wa(n.customParams, c)), b = (U) => {
|
|
3205
|
-
|
|
3205
|
+
Ie({
|
|
3206
3206
|
type: "error",
|
|
3207
3207
|
title: "Помилка завантаження",
|
|
3208
3208
|
message: U || "Не вдалося завантажити файл. Спробуйте ще раз.",
|
|
@@ -3216,7 +3216,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3216
3216
|
customParams: Object.keys(w.value.params).length ? w.value.params : void 0
|
|
3217
3217
|
}, F = await Ai(U, Z);
|
|
3218
3218
|
return F?.file_path ? F.file_path : null;
|
|
3219
|
-
},
|
|
3219
|
+
}, v = y(() => r.value.filter((U) => U.status !== "done")), M = y(() => v.value[0] || null), S = (U) => typeof U == "string" ? U : U?.file_path || "", V = (U, Z) => ({
|
|
3220
3220
|
key: `${Date.now()}-${Z}-${U.name}`,
|
|
3221
3221
|
file: U,
|
|
3222
3222
|
size: U.size,
|
|
@@ -3273,7 +3273,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3273
3273
|
i.value = !1, r.value = [], a.value && (a.value.value = "");
|
|
3274
3274
|
}
|
|
3275
3275
|
};
|
|
3276
|
-
return (U, Z) => (u(),
|
|
3276
|
+
return (U, Z) => (u(), g("div", Bi, [
|
|
3277
3277
|
d("input", {
|
|
3278
3278
|
class: "hidden",
|
|
3279
3279
|
ref_key: "fileInput",
|
|
@@ -3290,15 +3290,15 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3290
3290
|
value: l.value,
|
|
3291
3291
|
"onUpdate:value": Z[0] || (Z[0] = (F) => l.value = F)
|
|
3292
3292
|
}, null, 8, ["item", "value"])) : K("", !0),
|
|
3293
|
-
n.multiple ? (u(),
|
|
3294
|
-
(u(!0),
|
|
3295
|
-
key: `${j}-${
|
|
3293
|
+
n.multiple ? (u(), g(Ae, { key: 1 }, [
|
|
3294
|
+
(u(!0), g(Ae, null, Be(f.value, (F, j) => (u(), xe(Vt, {
|
|
3295
|
+
key: `${j}-${S(F)}`,
|
|
3296
3296
|
multiple: !0,
|
|
3297
3297
|
item: F,
|
|
3298
3298
|
value: l.value,
|
|
3299
3299
|
"onUpdate:value": Z[1] || (Z[1] = (B) => l.value = B)
|
|
3300
3300
|
}, null, 8, ["item", "value"]))), 128)),
|
|
3301
|
-
(u(!0),
|
|
3301
|
+
(u(!0), g(Ae, null, Be(v.value, (F) => (u(), xe(Vt, {
|
|
3302
3302
|
key: F.key,
|
|
3303
3303
|
action: "",
|
|
3304
3304
|
"is-uploading": !0,
|
|
@@ -3361,14 +3361,14 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3361
3361
|
const t = e, n = Ke(e, "modelValue"), l = D(null), o = D(!1), a = D(""), i = D([]), r = dt("values"), c = y(() => !!t.multiple), f = y(() => za(t.format)), _ = y(() => {
|
|
3362
3362
|
if (f.value.length)
|
|
3363
3363
|
return f.value.map((j) => `.${j}`).join(",");
|
|
3364
|
-
}), x = y(() => qa(n.value, c.value)), w = y(() => Ka(n.value, c.value)), b = y(() => Wa(t.customParams, r)), m = y(() => i.value.filter((j) => j.status !== "done")), k = y(() => c.value ? null : m.value[0] || null),
|
|
3364
|
+
}), x = y(() => qa(n.value, c.value)), w = y(() => Ka(n.value, c.value)), b = y(() => Wa(t.customParams, r)), m = y(() => i.value.filter((j) => j.status !== "done")), k = y(() => c.value ? null : m.value[0] || null), v = y(() => {
|
|
3365
3365
|
const j = m.value, B = j.reduce((Q, pe) => Q + pe.size, 0);
|
|
3366
3366
|
if (!B) return 0;
|
|
3367
3367
|
const P = j.reduce((Q, pe) => Q + Math.min(pe.uploaded, pe.size), 0);
|
|
3368
3368
|
return Math.min(100, Math.round(P / B * 100));
|
|
3369
3369
|
}), M = () => {
|
|
3370
3370
|
t.disabled || o.value || b.value.ok && l.value?.click();
|
|
3371
|
-
},
|
|
3371
|
+
}, S = async (j, B) => {
|
|
3372
3372
|
const P = B || Z(j, 0);
|
|
3373
3373
|
try {
|
|
3374
3374
|
P.status = "uploading";
|
|
@@ -3440,18 +3440,18 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3440
3440
|
try {
|
|
3441
3441
|
o.value = !0, a.value = "", i.value = Q.map((te, J) => Z(te, J));
|
|
3442
3442
|
const Se = (await Promise.allSettled(
|
|
3443
|
-
i.value.map((te) =>
|
|
3443
|
+
i.value.map((te) => S(te.file, te))
|
|
3444
3444
|
)).filter((te) => te.status === "fulfilled").map((te) => te.value).filter((te) => !!te), X = i.value.filter((te) => te.status === "error").map((te) => te.file.name);
|
|
3445
3445
|
if (Se.length === 0) {
|
|
3446
3446
|
a.value = "Не вдалося завантажити файл";
|
|
3447
3447
|
return;
|
|
3448
3448
|
}
|
|
3449
|
-
X.length > 0 ?
|
|
3449
|
+
X.length > 0 ? Ie({
|
|
3450
3450
|
type: "warning",
|
|
3451
3451
|
title: "Частина файлів не завантажилась",
|
|
3452
3452
|
message: X.join(", "),
|
|
3453
3453
|
position: "right-bottom"
|
|
3454
|
-
}) :
|
|
3454
|
+
}) : Ie({
|
|
3455
3455
|
type: "success",
|
|
3456
3456
|
title: "Файл завантажено",
|
|
3457
3457
|
message: Q.length > 1 ? `Завантажено ${Se.length} файлів` : Q[0].name,
|
|
@@ -3461,7 +3461,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3461
3461
|
o.value = !1, i.value = [], B.value = "";
|
|
3462
3462
|
}
|
|
3463
3463
|
};
|
|
3464
|
-
return (j, B) => (u(),
|
|
3464
|
+
return (j, B) => (u(), g("div", ji, [
|
|
3465
3465
|
d("div", zi, [
|
|
3466
3466
|
d("input", {
|
|
3467
3467
|
ref_key: "fileInput",
|
|
@@ -3473,7 +3473,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3473
3473
|
disabled: o.value || t.disabled,
|
|
3474
3474
|
onChange: F
|
|
3475
3475
|
}, null, 40, Ui),
|
|
3476
|
-
c.value ? (u(!0),
|
|
3476
|
+
c.value ? (u(!0), g(Ae, { key: 0 }, Be(x.value, (P, Q) => (u(), xe(Vt, {
|
|
3477
3477
|
key: `${Q}-${V(P)}`,
|
|
3478
3478
|
multiple: !0,
|
|
3479
3479
|
item: P,
|
|
@@ -3485,7 +3485,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3485
3485
|
value: n.value,
|
|
3486
3486
|
"onUpdate:value": B[1] || (B[1] = (P) => n.value = P)
|
|
3487
3487
|
}, null, 8, ["item", "value"])) : K("", !0),
|
|
3488
|
-
c.value ? (u(!0),
|
|
3488
|
+
c.value ? (u(!0), g(Ae, { key: 2 }, Be(m.value, (P) => (u(), xe(Vt, {
|
|
3489
3489
|
key: P.key,
|
|
3490
3490
|
action: "",
|
|
3491
3491
|
"is-uploading": !0,
|
|
@@ -3504,12 +3504,12 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3504
3504
|
action: "",
|
|
3505
3505
|
"is-uploading": !1,
|
|
3506
3506
|
disabled: t.disabled || o.value,
|
|
3507
|
-
"progress-percent":
|
|
3507
|
+
"progress-percent": v.value,
|
|
3508
3508
|
title: c.value ? "Добавить файлы" : "Обновить файл",
|
|
3509
3509
|
onClick: M
|
|
3510
3510
|
}, null, 8, ["disabled", "progress-percent", "title"])
|
|
3511
3511
|
]),
|
|
3512
|
-
a.value ? (u(),
|
|
3512
|
+
a.value ? (u(), g("p", Hi, ce(a.value), 1)) : K("", !0)
|
|
3513
3513
|
]));
|
|
3514
3514
|
}
|
|
3515
3515
|
}), Wi = { class: "flex items-center justify-center h-[30px] w-[30px]" }, qi = { class: "max-w-[55vw]" }, Ki = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Yi = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Gi = { class: "px-[5px]" }, Xi = { class: "" }, Bn = /* @__PURE__ */ ge({
|
|
@@ -3535,7 +3535,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3535
3535
|
const a = o / 1024;
|
|
3536
3536
|
return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
|
|
3537
3537
|
}
|
|
3538
|
-
return (o, a) => (u(),
|
|
3538
|
+
return (o, a) => (u(), g(Ae, null, [
|
|
3539
3539
|
d("div", Wi, [
|
|
3540
3540
|
G(q(Gn), { class: "icon icon-tabler icons-tabler-outline icon-tabler-file h-4 w-4" })
|
|
3541
3541
|
]),
|
|
@@ -3610,17 +3610,17 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3610
3610
|
function _(x) {
|
|
3611
3611
|
(n.item.ext === "jpg" || n.item.ext === "png") && l("openLightbox", { item: n.item, index: x });
|
|
3612
3612
|
}
|
|
3613
|
-
return (x, w) => (u(),
|
|
3614
|
-
x.item.ext === "jpg" || x.item.ext === "png" ? (u(),
|
|
3613
|
+
return (x, w) => (u(), g("div", Zi, [
|
|
3614
|
+
x.item.ext === "jpg" || x.item.ext === "png" ? (u(), g("div", Ji, [
|
|
3615
3615
|
d("div", {
|
|
3616
3616
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
3617
3617
|
onClick: w[0] || (w[0] = (b) => _(x.index))
|
|
3618
3618
|
}, [
|
|
3619
3619
|
G(Bn, { item: x.item }, null, 8, ["item"])
|
|
3620
3620
|
])
|
|
3621
|
-
])) : o(x.item) ? (u(),
|
|
3621
|
+
])) : o(x.item) ? (u(), g("div", Qi, [
|
|
3622
3622
|
G(Bn, { item: x.item }, null, 8, ["item"])
|
|
3623
|
-
])) : a(x.item) ? (u(),
|
|
3623
|
+
])) : a(x.item) ? (u(), g("div", eu, [
|
|
3624
3624
|
d("a", {
|
|
3625
3625
|
href: `/api/file-preview?id=${x.item.file_id}`,
|
|
3626
3626
|
target: "_blank",
|
|
@@ -3628,7 +3628,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3628
3628
|
}, [
|
|
3629
3629
|
G(Bn, { item: x.item }, null, 8, ["item"])
|
|
3630
3630
|
], 8, tu)
|
|
3631
|
-
])) : (u(),
|
|
3631
|
+
])) : (u(), g("div", nu, [
|
|
3632
3632
|
G(Bn, { item: x.item }, null, 8, ["item"])
|
|
3633
3633
|
])),
|
|
3634
3634
|
d("div", lu, [
|
|
@@ -3696,20 +3696,20 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3696
3696
|
} catch (V) {
|
|
3697
3697
|
console.error(V);
|
|
3698
3698
|
}
|
|
3699
|
-
},
|
|
3699
|
+
}, v = async (V) => {
|
|
3700
3700
|
await Promise.all(
|
|
3701
3701
|
Array.from(V.target.files).map(async (A) => {
|
|
3702
3702
|
const U = new FormData();
|
|
3703
3703
|
U.append("file", A);
|
|
3704
3704
|
try {
|
|
3705
3705
|
const Z = `${n.prefix}/widget/file/${o.value}`, F = await fetch(Z, { method: "POST", body: U });
|
|
3706
|
-
return F.ok ? (r("update", "file-list"), A) : (
|
|
3706
|
+
return F.ok ? (r("update", "file-list"), A) : (Ie({
|
|
3707
3707
|
type: F.status >= 400 && F.status < 500 ? "warning" : "error",
|
|
3708
3708
|
title: "Error",
|
|
3709
3709
|
message: `Error code: ${F.status}`
|
|
3710
3710
|
}), null);
|
|
3711
3711
|
} catch (Z) {
|
|
3712
|
-
return
|
|
3712
|
+
return Ie({
|
|
3713
3713
|
type: "error",
|
|
3714
3714
|
title: "Error",
|
|
3715
3715
|
message: Z.message || "Unknown error"
|
|
@@ -3724,7 +3724,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3724
3724
|
}), V.updateListOnConfirm && (A.confirm = async () => {
|
|
3725
3725
|
await V.confirm(), c.value = !1, k();
|
|
3726
3726
|
}), A;
|
|
3727
|
-
},
|
|
3727
|
+
}, S = (V) => {
|
|
3728
3728
|
f.value = M(V), c.value = !0;
|
|
3729
3729
|
};
|
|
3730
3730
|
return ve(o, (V) => {
|
|
@@ -3733,7 +3733,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3733
3733
|
o.value && k();
|
|
3734
3734
|
}), (V, A) => {
|
|
3735
3735
|
const U = vt("Lightbox"), Z = vt("MessageBox");
|
|
3736
|
-
return u(),
|
|
3736
|
+
return u(), g("div", uu, [
|
|
3737
3737
|
d("div", du, [
|
|
3738
3738
|
d("h2", cu, " Файлів: " + ce(_.value?.length), 1),
|
|
3739
3739
|
d("div", fu, [
|
|
@@ -3741,7 +3741,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3741
3741
|
d("input", {
|
|
3742
3742
|
type: "file",
|
|
3743
3743
|
class: "hidden",
|
|
3744
|
-
onChange: A[0] || (A[0] = (F) =>
|
|
3744
|
+
onChange: A[0] || (A[0] = (F) => v(F))
|
|
3745
3745
|
}, null, 32),
|
|
3746
3746
|
d("div", pu, [
|
|
3747
3747
|
G(q(Va), { class: "h-4 w-4" })
|
|
@@ -3749,7 +3749,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3749
3749
|
])
|
|
3750
3750
|
])
|
|
3751
3751
|
]),
|
|
3752
|
-
_.value?.length > 4 ? (u(),
|
|
3752
|
+
_.value?.length > 4 ? (u(), g("div", mu, [
|
|
3753
3753
|
d("div", null, [
|
|
3754
3754
|
d("div", vu, [
|
|
3755
3755
|
d("div", gu, [
|
|
@@ -3771,17 +3771,17 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3771
3771
|
])
|
|
3772
3772
|
])
|
|
3773
3773
|
])) : K("", !0),
|
|
3774
|
-
_.value?.length ? (u(),
|
|
3775
|
-
(u(!0),
|
|
3774
|
+
_.value?.length ? (u(), g("div", yu, [
|
|
3775
|
+
(u(!0), g(Ae, null, Be(b.value, (F, j) => (u(), xe(iu, {
|
|
3776
3776
|
key: j,
|
|
3777
3777
|
prefix: V.prefix,
|
|
3778
3778
|
item: F,
|
|
3779
3779
|
index: j,
|
|
3780
3780
|
onUpdate: A[2] || (A[2] = (B) => V.$emit("update", "file-list")),
|
|
3781
|
-
onOpenModal: A[3] || (A[3] = (B) =>
|
|
3781
|
+
onOpenModal: A[3] || (A[3] = (B) => S(B)),
|
|
3782
3782
|
onOpenLightbox: A[4] || (A[4] = (B) => m(B))
|
|
3783
3783
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
3784
|
-
b.value.length ? K("", !0) : (u(),
|
|
3784
|
+
b.value.length ? K("", !0) : (u(), g("div", hu, A[8] || (A[8] = [
|
|
3785
3785
|
d("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
3786
3786
|
])))
|
|
3787
3787
|
])) : K("", !0),
|
|
@@ -3823,7 +3823,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3823
3823
|
(l) => {
|
|
3824
3824
|
n.value = l;
|
|
3825
3825
|
}
|
|
3826
|
-
), (l, o) => (u(),
|
|
3826
|
+
), (l, o) => (u(), g("div", null, [
|
|
3827
3827
|
d("div", wu, [
|
|
3828
3828
|
d("p", xu, ce(e.title), 1),
|
|
3829
3829
|
G(Fa, {
|
|
@@ -3867,7 +3867,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3867
3867
|
(l) => {
|
|
3868
3868
|
n.value = l;
|
|
3869
3869
|
}
|
|
3870
|
-
), (l, o) => (u(),
|
|
3870
|
+
), (l, o) => (u(), g("div", null, [
|
|
3871
3871
|
d("button", {
|
|
3872
3872
|
type: "button",
|
|
3873
3873
|
onClick: o[0] || (o[0] = (a) => n.value = !n.value),
|
|
@@ -3903,7 +3903,7 @@ const Si = /* @__PURE__ */ Xe(hi, [["render", $i]]), Ci = /* @__PURE__ */ ge({
|
|
|
3903
3903
|
}
|
|
3904
3904
|
},
|
|
3905
3905
|
setup(e) {
|
|
3906
|
-
return (t, n) => (u(),
|
|
3906
|
+
return (t, n) => (u(), g("div", null, [
|
|
3907
3907
|
d("div", Au, [
|
|
3908
3908
|
d("p", null, ce(e.title), 1)
|
|
3909
3909
|
]),
|
|
@@ -4010,7 +4010,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4010
4010
|
style: Oe(e.style)
|
|
4011
4011
|
}, {
|
|
4012
4012
|
default: ut(() => [
|
|
4013
|
-
(u(!0),
|
|
4013
|
+
(u(!0), g(Ae, null, Be(o.value, (f) => (u(), xe(Qa, Jt({
|
|
4014
4014
|
key: f.name
|
|
4015
4015
|
}, { ref_for: !0 }, f, {
|
|
4016
4016
|
item: f,
|
|
@@ -4041,22 +4041,22 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4041
4041
|
addOption: async () => {
|
|
4042
4042
|
if (!(!x.value || f?.value.validate()))
|
|
4043
4043
|
try {
|
|
4044
|
-
const
|
|
4044
|
+
const v = e.add?.api ?? `/api/table/${x.value}`, M = await fetch(v, {
|
|
4045
4045
|
method: "POST",
|
|
4046
4046
|
headers: { "Content-Type": "application/json" },
|
|
4047
4047
|
body: JSON.stringify(r.value)
|
|
4048
|
-
}),
|
|
4048
|
+
}), S = await M.json().catch(() => ({})), V = S?.error || S?.message, A = Number(S?.code) >= 400;
|
|
4049
4049
|
if (!M.ok || A) {
|
|
4050
|
-
|
|
4050
|
+
Ie({
|
|
4051
4051
|
title: "Помилка",
|
|
4052
4052
|
type: "error",
|
|
4053
|
-
message: V || `Код помилки: ${
|
|
4053
|
+
message: V || `Код помилки: ${S?.code || M.status}`
|
|
4054
4054
|
});
|
|
4055
4055
|
return;
|
|
4056
4056
|
}
|
|
4057
|
-
const U =
|
|
4057
|
+
const U = S?.rows?.[0], Z = S?.[w.value] ?? S?.id ?? U?.[w.value] ?? U?.id;
|
|
4058
4058
|
if (!Z) {
|
|
4059
|
-
|
|
4059
|
+
Ie({
|
|
4060
4060
|
title: "Помилка",
|
|
4061
4061
|
type: "error",
|
|
4062
4062
|
message: "Обʼєкт створено, але в відповіді відсутній ID."
|
|
@@ -4064,18 +4064,18 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4064
4064
|
return;
|
|
4065
4065
|
}
|
|
4066
4066
|
const F = await t(Z);
|
|
4067
|
-
F && (n.value.some((B) => String(B?.id) === String(F.id)) || n.value.push(F)), a ? await a(F, Z) : F && (l.value = F, o.value = Z), i.value = !1,
|
|
4068
|
-
} catch (
|
|
4069
|
-
|
|
4067
|
+
F && (n.value.some((B) => String(B?.id) === String(F.id)) || n.value.push(F)), a ? await a(F, Z) : F && (l.value = F, o.value = Z), i.value = !1, Ie({ title: "Успіх", message: "Обʼєкт успішно створено." });
|
|
4068
|
+
} catch (v) {
|
|
4069
|
+
Ie({
|
|
4070
4070
|
title: "Помилка",
|
|
4071
4071
|
type: "error",
|
|
4072
|
-
message:
|
|
4072
|
+
message: v?.message || "Не вдалося створити обʼєкт."
|
|
4073
4073
|
});
|
|
4074
4074
|
}
|
|
4075
4075
|
},
|
|
4076
4076
|
onAddValue: async () => {
|
|
4077
4077
|
if (!e.add) return null;
|
|
4078
|
-
const k = await fetch(`/api/template/form/${e.add.form}`).then((
|
|
4078
|
+
const k = await fetch(`/api/template/form/${e.add.form}`).then((v) => v.json());
|
|
4079
4079
|
return c.value = k.schema, r.value = {}, i.value = !0, null;
|
|
4080
4080
|
}
|
|
4081
4081
|
};
|
|
@@ -4134,7 +4134,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4134
4134
|
get: () => n.keyWord,
|
|
4135
4135
|
set: (a) => l("update:keyWord", a)
|
|
4136
4136
|
});
|
|
4137
|
-
return (a, i) => (u(),
|
|
4137
|
+
return (a, i) => (u(), g("div", {
|
|
4138
4138
|
class: ie([
|
|
4139
4139
|
"vs-input-select__control flex min-h-[38px] items-center justify-between rounded transition-colors bg-white",
|
|
4140
4140
|
a.disabled ? "bg-gray-100 text-gray-400 cursor-not-allowed" : ""
|
|
@@ -4150,18 +4150,18 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4150
4150
|
ref: a.setTriggerRef
|
|
4151
4151
|
}, [
|
|
4152
4152
|
d("div", Ku, [
|
|
4153
|
-
a.isMulti ? (u(),
|
|
4154
|
-
(u(!0),
|
|
4153
|
+
a.isMulti ? (u(), g("div", Yu, [
|
|
4154
|
+
(u(!0), g(Ae, null, Be(a.selectedOptions, (r) => (u(), g("div", {
|
|
4155
4155
|
key: r.id,
|
|
4156
4156
|
class: "flex min-w-0 bg-[rgb(230,230,230)] rounded-[2px] m-[2px] box-border max-w-full"
|
|
4157
4157
|
}, [
|
|
4158
4158
|
d("div", Gu, [
|
|
4159
|
-
a.shouldShowColorDot(r) ? (u(),
|
|
4159
|
+
a.shouldShowColorDot(r) ? (u(), g("span", {
|
|
4160
4160
|
key: 0,
|
|
4161
4161
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5 flex-shrink-0",
|
|
4162
4162
|
style: Oe({ backgroundColor: r?.color })
|
|
4163
4163
|
}, null, 4)) : K("", !0),
|
|
4164
|
-
!a.optionTemplate && a.optionHasIcon(r) ? (u(),
|
|
4164
|
+
!a.optionTemplate && a.optionHasIcon(r) ? (u(), g("span", {
|
|
4165
4165
|
key: 1,
|
|
4166
4166
|
class: ie(a.iconWrapperClass),
|
|
4167
4167
|
style: Oe(a.getIconColorStyle(r)),
|
|
@@ -4176,10 +4176,10 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4176
4176
|
class: "truncate text-[#172b4d] overflow-hidden max-w-[200px] px-0.5 pl-1.5",
|
|
4177
4177
|
title: a.getLabel(r)
|
|
4178
4178
|
}, [
|
|
4179
|
-
a.optionTemplate ? (u(),
|
|
4179
|
+
a.optionTemplate ? (u(), g("div", {
|
|
4180
4180
|
key: 0,
|
|
4181
4181
|
innerHTML: a.renderTemplate(r)
|
|
4182
|
-
}, null, 8, Zu)) : (u(),
|
|
4182
|
+
}, null, 8, Zu)) : (u(), g(Ae, { key: 1 }, [
|
|
4183
4183
|
nt(ce(r.text), 1)
|
|
4184
4184
|
], 64))
|
|
4185
4185
|
], 8, Xu)
|
|
@@ -4197,7 +4197,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4197
4197
|
], 8, Ju)
|
|
4198
4198
|
]))), 128)),
|
|
4199
4199
|
d("div", Qu, [
|
|
4200
|
-
!a.disabled && a.search ? Re((u(),
|
|
4200
|
+
!a.disabled && a.search ? Re((u(), g("input", {
|
|
4201
4201
|
key: 0,
|
|
4202
4202
|
ref: a.setInputRef,
|
|
4203
4203
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",
|
|
@@ -4220,17 +4220,17 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4220
4220
|
[at, o.value]
|
|
4221
4221
|
]) : K("", !0)
|
|
4222
4222
|
])
|
|
4223
|
-
])) : !a.isMulti && a.selectedOptionLabel && o.value === "" ? (u(),
|
|
4223
|
+
])) : !a.isMulti && a.selectedOptionLabel && o.value === "" ? (u(), g("div", {
|
|
4224
4224
|
key: 1,
|
|
4225
4225
|
class: ie(["truncate flex items-center gap-1 min-w-0 pl-2", a.disabled || !a.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"]),
|
|
4226
4226
|
title: a.selectedOptionLabel
|
|
4227
4227
|
}, [
|
|
4228
|
-
a.shouldShowColorDot(a.selectedOption) ? (u(),
|
|
4228
|
+
a.shouldShowColorDot(a.selectedOption) ? (u(), g("span", {
|
|
4229
4229
|
key: 0,
|
|
4230
4230
|
class: "w-[14px] h-[14px] rounded-md block flex-shrink-0",
|
|
4231
4231
|
style: Oe({ backgroundColor: a.selectedOption?.color })
|
|
4232
4232
|
}, null, 4)) : K("", !0),
|
|
4233
|
-
!a.optionTemplate && a.optionHasIcon(a.selectedOption) ? (u(),
|
|
4233
|
+
!a.optionTemplate && a.optionHasIcon(a.selectedOption) ? (u(), g("span", {
|
|
4234
4234
|
key: 1,
|
|
4235
4235
|
class: ie(a.iconWrapperClass),
|
|
4236
4236
|
style: Oe(a.getIconColorStyle(a.selectedOption)),
|
|
@@ -4241,13 +4241,13 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4241
4241
|
focusable: "false"
|
|
4242
4242
|
}))
|
|
4243
4243
|
], 6)) : K("", !0),
|
|
4244
|
-
a.optionTemplate ? (u(),
|
|
4244
|
+
a.optionTemplate ? (u(), g("div", {
|
|
4245
4245
|
key: 2,
|
|
4246
4246
|
class: "truncate flex-1 min-w-0",
|
|
4247
4247
|
innerHTML: a.renderTemplate(a.selectedOption)
|
|
4248
|
-
}, null, 8, nd)) : (u(),
|
|
4248
|
+
}, null, 8, nd)) : (u(), g("span", ld, ce(a.selectedOption?.text), 1))
|
|
4249
4249
|
], 10, td)) : K("", !0),
|
|
4250
|
-
!a.isMulti && !a.disabled && a.search ? (u(),
|
|
4250
|
+
!a.isMulti && !a.disabled && a.search ? (u(), g("div", ad, [
|
|
4251
4251
|
Re(d("input", {
|
|
4252
4252
|
ref: a.setInputRef,
|
|
4253
4253
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",
|
|
@@ -4269,10 +4269,10 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4269
4269
|
}, null, 40, od), [
|
|
4270
4270
|
[at, o.value]
|
|
4271
4271
|
])
|
|
4272
|
-
])) : !a.isMulti && a.disabled && (!a.selectedOptionLabel || o.value !== "") ? (u(),
|
|
4272
|
+
])) : !a.isMulti && a.disabled && (!a.selectedOptionLabel || o.value !== "") ? (u(), g("div", rd, ce(a.placeholder), 1)) : K("", !0)
|
|
4273
4273
|
]),
|
|
4274
4274
|
d("div", sd, [
|
|
4275
|
-
a.showClear ? (u(),
|
|
4275
|
+
a.showClear ? (u(), g("button", {
|
|
4276
4276
|
key: 0,
|
|
4277
4277
|
type: "button",
|
|
4278
4278
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
@@ -4286,7 +4286,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4286
4286
|
}, [
|
|
4287
4287
|
G(q(Ct), { class: "h-4 w-4" })
|
|
4288
4288
|
], 8, id)) : K("", !0),
|
|
4289
|
-
a.showClear ? (u(),
|
|
4289
|
+
a.showClear ? (u(), g("div", ud)) : K("", !0),
|
|
4290
4290
|
d("button", {
|
|
4291
4291
|
type: "button",
|
|
4292
4292
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
@@ -4329,7 +4329,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4329
4329
|
},
|
|
4330
4330
|
setup(e) {
|
|
4331
4331
|
return (t, n) => (u(), xe(Kt, { to: "body" }, [
|
|
4332
|
-
t.isOpen ? (u(),
|
|
4332
|
+
t.isOpen ? (u(), g("div", {
|
|
4333
4333
|
key: 0,
|
|
4334
4334
|
ref: t.setDropdownRef,
|
|
4335
4335
|
class: "fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
|
|
@@ -4341,7 +4341,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4341
4341
|
style: Oe({ maxHeight: t.dropdownStyle.maxHeight || "300px" }),
|
|
4342
4342
|
ref: t.setListRef
|
|
4343
4343
|
}, [
|
|
4344
|
-
t.filteredOptionsList.length ? (u(!0),
|
|
4344
|
+
t.filteredOptionsList.length ? (u(!0), g(Ae, { key: 0 }, Be(t.filteredOptionsList, (l, o) => (u(), g("div", {
|
|
4345
4345
|
key: l.id,
|
|
4346
4346
|
ref_for: !0,
|
|
4347
4347
|
ref: (a) => t.setItemRef(a, o),
|
|
@@ -4355,12 +4355,12 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4355
4355
|
tabindex: "-1",
|
|
4356
4356
|
onMousedown: Ee((a) => t.onOptionClick(l), ["prevent", "stop"])
|
|
4357
4357
|
}, [
|
|
4358
|
-
t.shouldShowColorDot(l) ? (u(),
|
|
4358
|
+
t.shouldShowColorDot(l) ? (u(), g("span", {
|
|
4359
4359
|
key: 0,
|
|
4360
4360
|
class: "w-[11px] h-[11px] rounded-full block flex-shrink-0",
|
|
4361
4361
|
style: Oe({ backgroundColor: l?.color })
|
|
4362
4362
|
}, null, 4)) : K("", !0),
|
|
4363
|
-
!t.optionTemplate && t.optionHasIcon(l) ? (u(),
|
|
4363
|
+
!t.optionTemplate && t.optionHasIcon(l) ? (u(), g("span", {
|
|
4364
4364
|
key: 1,
|
|
4365
4365
|
class: ie(t.iconWrapperClass),
|
|
4366
4366
|
style: Oe(t.getIconColorStyle(l)),
|
|
@@ -4372,14 +4372,14 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4372
4372
|
}))
|
|
4373
4373
|
], 6)) : K("", !0),
|
|
4374
4374
|
d("div", pd, [
|
|
4375
|
-
t.optionTemplate ? (u(),
|
|
4375
|
+
t.optionTemplate ? (u(), g("div", {
|
|
4376
4376
|
key: 0,
|
|
4377
4377
|
innerHTML: t.renderTemplate(l)
|
|
4378
|
-
}, null, 8, md)) : (u(),
|
|
4378
|
+
}, null, 8, md)) : (u(), g(Ae, { key: 1 }, [
|
|
4379
4379
|
nt(ce(l.text), 1)
|
|
4380
4380
|
], 64))
|
|
4381
4381
|
])
|
|
4382
|
-
], 42, fd))), 128)) : (u(),
|
|
4382
|
+
], 42, fd))), 128)) : (u(), g("div", vd, " No options "))
|
|
4383
4383
|
], 4)
|
|
4384
4384
|
], 4)) : K("", !0)
|
|
4385
4385
|
]));
|
|
@@ -4423,16 +4423,16 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4423
4423
|
set: (N) => l("update:modelValue", N)
|
|
4424
4424
|
});
|
|
4425
4425
|
!r.value && n.defaultValue && (r.value = n.defaultValue);
|
|
4426
|
-
const c = D(null), f = D(null), _ = D(null), x = D(null), w = D(!1), b = D(!1), m = D(null), k = D(-1),
|
|
4426
|
+
const c = D(null), f = D(null), _ = D(null), x = D(null), w = D(!1), b = D(!1), m = D(null), k = D(-1), v = D([]), M = D(""), S = D(null), V = (N) => {
|
|
4427
4427
|
f.value = N;
|
|
4428
4428
|
}, A = (N) => {
|
|
4429
|
-
|
|
4429
|
+
S.value = N;
|
|
4430
4430
|
}, U = (N) => {
|
|
4431
4431
|
x.value = N;
|
|
4432
4432
|
}, Z = (N) => {
|
|
4433
4433
|
_.value = N;
|
|
4434
4434
|
}, F = (N, re) => {
|
|
4435
|
-
|
|
4435
|
+
v.value[re] = N;
|
|
4436
4436
|
}, j = D({}), B = D([]), P = y(() => {
|
|
4437
4437
|
if (!B.value.length) return [];
|
|
4438
4438
|
const N = Ve.value, re = new Map(N.map(($e) => [$e.id?.toString(), $e]));
|
|
@@ -4478,7 +4478,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4478
4478
|
[wd]: N
|
|
4479
4479
|
}
|
|
4480
4480
|
};
|
|
4481
|
-
},
|
|
4481
|
+
}, Te = (N) => {
|
|
4482
4482
|
if (!n.set) return;
|
|
4483
4483
|
const re = J?.value;
|
|
4484
4484
|
!re && !ee || Object.entries(n.set).forEach(([$e, je]) => {
|
|
@@ -4554,17 +4554,17 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4554
4554
|
$e >= 0 && (N = $e);
|
|
4555
4555
|
}
|
|
4556
4556
|
k.value = N, et(() => {
|
|
4557
|
-
O(
|
|
4557
|
+
O(v.value[N], _.value);
|
|
4558
4558
|
});
|
|
4559
4559
|
}, ae = async () => {
|
|
4560
4560
|
a.value || (w.value = !0, await et(() => {
|
|
4561
4561
|
De();
|
|
4562
4562
|
}), await Ye(), await et(() => {
|
|
4563
|
-
De(),
|
|
4563
|
+
De(), S.value?.focus();
|
|
4564
4564
|
}), le());
|
|
4565
4565
|
}, we = () => {
|
|
4566
4566
|
w.value = !1, k.value = -1, et(() => {
|
|
4567
|
-
|
|
4567
|
+
S.value?.blur();
|
|
4568
4568
|
});
|
|
4569
4569
|
}, Ce = async (N) => {
|
|
4570
4570
|
if (a.value) return;
|
|
@@ -4578,11 +4578,11 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4578
4578
|
await ae();
|
|
4579
4579
|
}
|
|
4580
4580
|
}, We = () => {
|
|
4581
|
-
o.value ? (B.value = [], r.value = [], l("change", []), z(null, [])) : (m.value = null, r.value = null, l("change", null), z(null, null)),
|
|
4582
|
-
|
|
4581
|
+
o.value ? (B.value = [], r.value = [], l("change", []), z(null, [])) : (m.value = null, r.value = null, l("change", null), z(null, null)), Te(null), Me(null), M.value = "", we(), et(() => {
|
|
4582
|
+
S.value?.focus();
|
|
4583
4583
|
});
|
|
4584
4584
|
}, qe = (N) => {
|
|
4585
|
-
o.value && (B.value = B.value.filter((re) => re?.toString() !== N?.toString()), r.value = [...B.value], l("change", r.value), z(null), et(() =>
|
|
4585
|
+
o.value && (B.value = B.value.filter((re) => re?.toString() !== N?.toString()), r.value = [...B.value], l("change", r.value), z(null), et(() => S.value?.focus()));
|
|
4586
4586
|
}, z = (N, re) => {
|
|
4587
4587
|
const $e = re ?? (o.value ? [...B.value] : N?.id ?? null);
|
|
4588
4588
|
l("value-selected", {
|
|
@@ -4592,8 +4592,8 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4592
4592
|
});
|
|
4593
4593
|
}, $ = (N, re = "manual") => {
|
|
4594
4594
|
o.value ? (X(N.id) || (B.value = [...B.value, N.id], r.value = [...B.value], l("change", r.value), z(N)), M.value = "", et(() => {
|
|
4595
|
-
|
|
4596
|
-
}),
|
|
4595
|
+
S.value?.focus(), k.value = Math.min(k.value, te.value.length - 1);
|
|
4596
|
+
}), Te(null)) : (m.value = N, r.value = N.id, l("change", r.value), z(N), M.value = "", we(), Te(N), re === "parent-auto" && Me({
|
|
4597
4597
|
source: re,
|
|
4598
4598
|
parentField: n.parent ?? null,
|
|
4599
4599
|
parentValue: He.value ?? null
|
|
@@ -4647,14 +4647,14 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4647
4647
|
if (!w.value) return;
|
|
4648
4648
|
const { key: re } = N;
|
|
4649
4649
|
if (re === "ArrowDown")
|
|
4650
|
-
N.preventDefault(), k.value + 1 < te.value.length && (k.value += 1, O(
|
|
4650
|
+
N.preventDefault(), k.value + 1 < te.value.length && (k.value += 1, O(v.value[k.value], _.value));
|
|
4651
4651
|
else if (re === "ArrowUp")
|
|
4652
|
-
N.preventDefault(), k.value > 0 && (k.value -= 1, O(
|
|
4652
|
+
N.preventDefault(), k.value > 0 && (k.value -= 1, O(v.value[k.value], _.value));
|
|
4653
4653
|
else if (re === "Enter") {
|
|
4654
4654
|
N.preventDefault();
|
|
4655
4655
|
const $e = te.value[k.value];
|
|
4656
|
-
$e && $($e),
|
|
4657
|
-
} else re === "Escape" ? (N.preventDefault(), we()) : re === "Backspace" ? o.value && M.value === "" && B.value.length && (B.value = B.value.slice(0, -1), r.value = [...B.value], l("change", r.value)) : re === "Home" ? (k.value = 0, O(
|
|
4656
|
+
$e && $($e), S.value?.blur();
|
|
4657
|
+
} else re === "Escape" ? (N.preventDefault(), we()) : re === "Backspace" ? o.value && M.value === "" && B.value.length && (B.value = B.value.slice(0, -1), r.value = [...B.value], l("change", r.value)) : re === "Home" ? (k.value = 0, O(v.value[0], _.value)) : re === "End" ? (k.value = te.value.length - 1, O(v.value[k.value], _.value)) : re === "Tab" && we();
|
|
4658
4658
|
}, pt = () => {
|
|
4659
4659
|
a.value || (b.value = !0);
|
|
4660
4660
|
}, ht = () => {
|
|
@@ -4679,7 +4679,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4679
4679
|
const N = r.value[0] ?? null;
|
|
4680
4680
|
r.value = N ?? null;
|
|
4681
4681
|
}
|
|
4682
|
-
r.value != null && r.value !== "" ? m.value = await ct(r.value) : m.value = null,
|
|
4682
|
+
r.value != null && r.value !== "" ? m.value = await ct(r.value) : m.value = null, Te(m.value ?? null);
|
|
4683
4683
|
}
|
|
4684
4684
|
}
|
|
4685
4685
|
ve(r, () => {
|
|
@@ -4731,7 +4731,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4731
4731
|
const N = Ve.value[0];
|
|
4732
4732
|
N && $(N, "parent-auto");
|
|
4733
4733
|
}
|
|
4734
|
-
}), (N, re) => (u(),
|
|
4734
|
+
}), (N, re) => (u(), g(Ae, null, [
|
|
4735
4735
|
G(q(el), {
|
|
4736
4736
|
visible: q(st),
|
|
4737
4737
|
"onUpdate:visible": re[2] || (re[2] = ($e) => Yn(st) ? st.value = $e : null),
|
|
@@ -4838,7 +4838,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4838
4838
|
"render-template": ke
|
|
4839
4839
|
}, null, 8, ["is-open", "dropdown-style", "filtered-options-list", "selected-nav-index", "option-template"])
|
|
4840
4840
|
], 2),
|
|
4841
|
-
n.add ? (u(),
|
|
4841
|
+
n.add ? (u(), g("button", {
|
|
4842
4842
|
key: 0,
|
|
4843
4843
|
onClick: re[4] || (re[4] = //@ts-ignore
|
|
4844
4844
|
(...$e) => q(An) && q(An)(...$e)),
|
|
@@ -4897,7 +4897,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4897
4897
|
set: (se) => l("update:modelValue", se)
|
|
4898
4898
|
});
|
|
4899
4899
|
o.value == null && n.defaultValue != null && (o.value = n.defaultValue);
|
|
4900
|
-
const a = dt("values"), i = dt("field-props"), r = y(() => !!n.disabled), c = D(null), f = D(!1), _ = D(null), x = D(null), w = D(null), b = D({}), m = `vs-input-inline-select-${Nl()}`, k = y(() => n.placeholder || "Оберіть значення"),
|
|
4900
|
+
const a = dt("values"), i = dt("field-props"), r = y(() => !!n.disabled), c = D(null), f = D(!1), _ = D(null), x = D(null), w = D(null), b = D({}), m = `vs-input-inline-select-${Nl()}`, k = y(() => n.placeholder || "Оберіть значення"), v = y(() => U(c.value) || n.placeholder || "Оберіть значення"), M = y(() => n.slot ?? ""), S = y(() => tl(M.value)), V = y(() => n.teleport || "body"), A = /^#(?:[\da-fA-F]{3}|[\da-fA-F]{6}|[\da-fA-F]{8})$/, U = (se) => al(se, M.value), Z = (se) => !!(!S.value && Qt(se)), F = y(() => {
|
|
4901
4901
|
const se = Qt(c.value).trim();
|
|
4902
4902
|
return se ? A.test(se) ? `bg-[${se}] border-[${se}]` : `bg-${se.toLowerCase()}-500 border-${se.toLowerCase()}-500` : "";
|
|
4903
4903
|
}), {
|
|
@@ -4910,7 +4910,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4910
4910
|
props: n,
|
|
4911
4911
|
formValues: a,
|
|
4912
4912
|
watchParent: !1
|
|
4913
|
-
}), Se = (se, Me,
|
|
4913
|
+
}), Se = (se, Me, Te) => {
|
|
4914
4914
|
if (!i) return !1;
|
|
4915
4915
|
const Ve = i.value?.[se] ?? {}, He = (Je, ze, ue) => {
|
|
4916
4916
|
if (!ze.length) return Je;
|
|
@@ -4919,7 +4919,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4919
4919
|
return Pe[oe] = ue, Pe;
|
|
4920
4920
|
const Ye = typeof Je[oe] == "object" && Je[oe] !== null ? Je[oe] : {};
|
|
4921
4921
|
return Pe[oe] = He(Ye, Le, ue), Pe;
|
|
4922
|
-
}, Ze = He(Ve, Me,
|
|
4922
|
+
}, Ze = He(Ve, Me, Te);
|
|
4923
4923
|
return i.value = {
|
|
4924
4924
|
...i.value || {},
|
|
4925
4925
|
[se]: Ze
|
|
@@ -4927,23 +4927,23 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4927
4927
|
}, X = (se) => {
|
|
4928
4928
|
if (!n.set) return;
|
|
4929
4929
|
const Me = a?.value;
|
|
4930
|
-
!Me && !i || Object.entries(n.set).forEach(([
|
|
4931
|
-
if (!
|
|
4932
|
-
const He = se ? se[Ve] : null, Ze =
|
|
4930
|
+
!Me && !i || Object.entries(n.set).forEach(([Te, Ve]) => {
|
|
4931
|
+
if (!Te) return;
|
|
4932
|
+
const He = se ? se[Ve] : null, Ze = Te.split(".").map((ue) => ue.trim()).filter(Boolean);
|
|
4933
4933
|
if (!Ze.length) return;
|
|
4934
4934
|
const [Je, ...ze] = Ze;
|
|
4935
4935
|
ze.length && Se(Je, ze, He ?? null) || Me && (Me[Je] = He ?? null);
|
|
4936
4936
|
});
|
|
4937
4937
|
}, te = (se) => o.value?.toString?.() === se?.toString?.(), J = () => {
|
|
4938
4938
|
if (!x.value || typeof window > "u") return;
|
|
4939
|
-
const se = x.value.getBoundingClientRect(), Me = 8,
|
|
4939
|
+
const se = x.value.getBoundingClientRect(), Me = 8, Te = 8, Ve = window.innerHeight || document.documentElement.clientHeight, He = window.innerWidth || document.documentElement.clientWidth, Ze = w.value?.offsetHeight || 260, Je = Math.max(se.width, 176), ze = Math.max(He - Me * 2, 120), ue = Math.min(Je, ze);
|
|
4940
4940
|
let oe = se.left;
|
|
4941
4941
|
oe + ue + Me > He && (oe = He - ue - Me), oe = Math.max(oe, Me);
|
|
4942
|
-
const Le = Ve - se.bottom -
|
|
4942
|
+
const Le = Ve - se.bottom - Te - Me, Pe = se.top - Te - Me, Ye = Le < Math.min(Ze, 260) && Pe > Le, ct = Math.max(120, Math.min(320, Ye ? Pe : Le));
|
|
4943
4943
|
b.value = {
|
|
4944
4944
|
position: "fixed",
|
|
4945
4945
|
left: `${oe}px`,
|
|
4946
|
-
top: Ye ? `${se.top -
|
|
4946
|
+
top: Ye ? `${se.top - Te}px` : `${se.bottom + Te}px`,
|
|
4947
4947
|
transform: Ye ? "translateY(-100%)" : "none",
|
|
4948
4948
|
width: `${ue}px`,
|
|
4949
4949
|
maxHeight: `${ct}px`
|
|
@@ -4999,7 +4999,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
4999
4999
|
document.addEventListener("click", fe, !0), window.addEventListener("resize", be), window.addEventListener("scroll", be, !0), await ee(), await Y();
|
|
5000
5000
|
}), fn(() => {
|
|
5001
5001
|
document.removeEventListener("click", fe, !0), window.removeEventListener("resize", be), window.removeEventListener("scroll", be, !0);
|
|
5002
|
-
}), (se, Me) => (u(),
|
|
5002
|
+
}), (se, Me) => (u(), g("div", {
|
|
5003
5003
|
class: "relative inline-flex w-full max-w-full",
|
|
5004
5004
|
ref_key: "rootRef",
|
|
5005
5005
|
ref: _,
|
|
@@ -5019,10 +5019,10 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
5019
5019
|
]),
|
|
5020
5020
|
onClick: T
|
|
5021
5021
|
}, [
|
|
5022
|
-
d("span", _d, ce(
|
|
5022
|
+
d("span", _d, ce(v.value), 1)
|
|
5023
5023
|
], 10, kd),
|
|
5024
5024
|
(u(), xe(Kt, { to: V.value }, [
|
|
5025
|
-
f.value ? (u(),
|
|
5025
|
+
f.value ? (u(), g("div", {
|
|
5026
5026
|
key: 0,
|
|
5027
5027
|
ref_key: "dropdownRef",
|
|
5028
5028
|
ref: w,
|
|
@@ -5038,32 +5038,32 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
5038
5038
|
]),
|
|
5039
5039
|
d("div", Md, [
|
|
5040
5040
|
d("div", Ld, [
|
|
5041
|
-
(u(!0),
|
|
5042
|
-
key:
|
|
5041
|
+
(u(!0), g(Ae, null, Be(q(j), (Te) => (u(), g("label", {
|
|
5042
|
+
key: Te.id,
|
|
5043
5043
|
class: "py-1.5 px-3 group flex items-center gap-x-3 rounded-lg cursor-pointer text-[13px] text-gray-800 hover:bg-gray-100",
|
|
5044
|
-
onClick: Ee((Ve) => R(
|
|
5044
|
+
onClick: Ee((Ve) => R(Te), ["prevent"])
|
|
5045
5045
|
}, [
|
|
5046
5046
|
d("input", {
|
|
5047
5047
|
type: "radio",
|
|
5048
5048
|
class: "hidden",
|
|
5049
5049
|
name: m,
|
|
5050
|
-
checked: te(
|
|
5050
|
+
checked: te(Te.id),
|
|
5051
5051
|
tabindex: "-1"
|
|
5052
5052
|
}, null, 8, Vd),
|
|
5053
5053
|
d("span", Dd, [
|
|
5054
|
-
Z(
|
|
5054
|
+
Z(Te) ? (u(), g("span", {
|
|
5055
5055
|
key: 0,
|
|
5056
5056
|
class: "shrink-0 size-2 block mx-auto rounded-full",
|
|
5057
|
-
style: Oe({ backgroundColor:
|
|
5058
|
-
}, null, 4)) : (u(),
|
|
5057
|
+
style: Oe({ backgroundColor: Te.color })
|
|
5058
|
+
}, null, 4)) : (u(), g("span", Id))
|
|
5059
5059
|
]),
|
|
5060
|
-
d("span", Td, ce(U(
|
|
5060
|
+
d("span", Td, ce(U(Te)), 1),
|
|
5061
5061
|
G(q(La), {
|
|
5062
|
-
class: ie(["shrink-0 size-3.5 ms-auto transition-opacity", te(
|
|
5062
|
+
class: ie(["shrink-0 size-3.5 ms-auto transition-opacity", te(Te.id) ? "opacity-100" : "opacity-0"])
|
|
5063
5063
|
}, null, 8, ["class"])
|
|
5064
5064
|
], 8, Ad))), 128))
|
|
5065
5065
|
]),
|
|
5066
|
-
q(j).length ? K("", !0) : (u(),
|
|
5066
|
+
q(j).length ? K("", !0) : (u(), g("p", Ed, "Немає варіантів"))
|
|
5067
5067
|
])
|
|
5068
5068
|
], 4)) : K("", !0)
|
|
5069
5069
|
], 8, ["to"]))
|
|
@@ -5091,7 +5091,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
5091
5091
|
function i() {
|
|
5092
5092
|
typeof l.value == "string" && (l.value = l.value.trim());
|
|
5093
5093
|
}
|
|
5094
|
-
return (r, c) => Re((u(),
|
|
5094
|
+
return (r, c) => Re((u(), g("textarea", {
|
|
5095
5095
|
"onUpdate:modelValue": c[0] || (c[0] = (f) => l.value = f),
|
|
5096
5096
|
placeholder: a.value,
|
|
5097
5097
|
disabled: o.value,
|
|
@@ -5125,12 +5125,12 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
5125
5125
|
}),
|
|
5126
5126
|
emits: ["update:modelValue"],
|
|
5127
5127
|
setup(e) {
|
|
5128
|
-
const t = Mo(() => import("./vs-richtext-
|
|
5128
|
+
const t = Mo(() => import("./vs-richtext-DfF4oqFg.js")), n = e, l = Ke(e, "modelValue"), o = y(() => !!n.disabled), a = y(() => n.placeholder ?? ""), i = y(() => ({
|
|
5129
5129
|
height: n.richtextProps.height || "300px",
|
|
5130
5130
|
format: n.format,
|
|
5131
5131
|
...n.richtextProps
|
|
5132
5132
|
}));
|
|
5133
|
-
return (r, c) => (u(),
|
|
5133
|
+
return (r, c) => (u(), g("div", {
|
|
5134
5134
|
class: ie(["!h-full overflow-hidden rounded-md border border-solid border-stone-200 disabled:opacity-50 disabled:cursor-not-allowed", r.customClass]),
|
|
5135
5135
|
style: Oe(o.value ? { pointerEvents: "none", opacity: 0.6 } : {})
|
|
5136
5136
|
}, [
|
|
@@ -5147,7 +5147,7 @@ const Wu = /* @__PURE__ */ ge({
|
|
|
5147
5147
|
xmlns: "http://www.w3.org/2000/svg"
|
|
5148
5148
|
};
|
|
5149
5149
|
function Nd(e, t) {
|
|
5150
|
-
return u(),
|
|
5150
|
+
return u(), g("svg", Rd, t[0] || (t[0] = [
|
|
5151
5151
|
Dl('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
|
5152
5152
|
]));
|
|
5153
5153
|
}
|
|
@@ -5210,7 +5210,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5210
5210
|
});
|
|
5211
5211
|
return _.value === "asc" ? we : we.reverse();
|
|
5212
5212
|
}), w = y(() => (t.colModel ?? []).filter((W) => !W.tableHidden)), b = D(null), m = D(null), k = D(null);
|
|
5213
|
-
function
|
|
5213
|
+
function v(W) {
|
|
5214
5214
|
return W.pointerType === "touch" || W.pointerType === "pen";
|
|
5215
5215
|
}
|
|
5216
5216
|
function M(W, le) {
|
|
@@ -5221,17 +5221,17 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5221
5221
|
const Ne = Number.parseInt(Ce, 10);
|
|
5222
5222
|
return Number.isNaN(Ne) ? null : Ne;
|
|
5223
5223
|
}
|
|
5224
|
-
function
|
|
5225
|
-
|
|
5224
|
+
function S(W, le) {
|
|
5225
|
+
v(W) && (W.preventDefault(), W.currentTarget.setPointerCapture(W.pointerId), b.value = le, m.value = le);
|
|
5226
5226
|
}
|
|
5227
5227
|
function V(W) {
|
|
5228
|
-
if (b.value === null || !
|
|
5228
|
+
if (b.value === null || !v(W)) return;
|
|
5229
5229
|
W.preventDefault();
|
|
5230
5230
|
const le = M(W.clientX, W.clientY);
|
|
5231
5231
|
le !== null && (m.value = le);
|
|
5232
5232
|
}
|
|
5233
5233
|
function A(W) {
|
|
5234
|
-
if (b.value === null || !
|
|
5234
|
+
if (b.value === null || !v(W)) return;
|
|
5235
5235
|
W.preventDefault();
|
|
5236
5236
|
const le = M(W.clientX, W.clientY);
|
|
5237
5237
|
j(le ?? b.value);
|
|
@@ -5241,7 +5241,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5241
5241
|
}
|
|
5242
5242
|
}
|
|
5243
5243
|
function U(W) {
|
|
5244
|
-
if (
|
|
5244
|
+
if (v(W)) {
|
|
5245
5245
|
b.value = null, m.value = null;
|
|
5246
5246
|
try {
|
|
5247
5247
|
W.currentTarget.releasePointerCapture(W.pointerId);
|
|
@@ -5337,8 +5337,8 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5337
5337
|
const R = (W) => (W?.format || W?.type || "").toString().toLowerCase(), fe = y(() => (t.colModel?.filter((le) => R(le) !== "slot") ?? []).map((le) => {
|
|
5338
5338
|
const ae = le.key || le.name;
|
|
5339
5339
|
return ae ? { ...le, name: ae, key: ae } : le;
|
|
5340
|
-
})), be = D({}), se = D({}), Me = (W) => typeof W != "string" ? !1 : !!n[W],
|
|
5341
|
-
const Ce =
|
|
5340
|
+
})), be = D({}), se = D({}), Me = (W) => typeof W != "string" ? !1 : !!n[W], Te = (W, le) => le ? le.split(".").reduce((ae, we) => ae == null ? ae : ae[we.trim()], W) : W, Ve = (W, le) => typeof W != "string" ? "" : W.replace(/{{\s*([^}]+)\s*}}/g, (ae, we) => {
|
|
5341
|
+
const Ce = Te(le, we.trim());
|
|
5342
5342
|
return Ce ?? "";
|
|
5343
5343
|
}), He = (W) => {
|
|
5344
5344
|
if (W == null || W === "") return "";
|
|
@@ -5390,7 +5390,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5390
5390
|
function Pe() {
|
|
5391
5391
|
const W = se.value.validate();
|
|
5392
5392
|
if (W) {
|
|
5393
|
-
|
|
5393
|
+
Ie({ type: "warning", title: "Помилка валідації", message: Object.entries(W).map(([le, ae]) => `${le}: ${ae}`).join(`
|
|
5394
5394
|
`) });
|
|
5395
5395
|
return;
|
|
5396
5396
|
}
|
|
@@ -5402,9 +5402,9 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5402
5402
|
function ct() {
|
|
5403
5403
|
ye.value = !1;
|
|
5404
5404
|
}
|
|
5405
|
-
return (W, le) => (u(),
|
|
5406
|
-
a.value ? (u(),
|
|
5407
|
-
l("search") ? (u(),
|
|
5405
|
+
return (W, le) => (u(), g("div", zd, [
|
|
5406
|
+
a.value ? (u(), g("div", Ud, [
|
|
5407
|
+
l("search") ? (u(), g("div", Hd, [
|
|
5408
5408
|
G(q(Qn), { class: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400" }),
|
|
5409
5409
|
Re(d("input", {
|
|
5410
5410
|
type: "text",
|
|
@@ -5416,7 +5416,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5416
5416
|
])
|
|
5417
5417
|
])) : K("", !0),
|
|
5418
5418
|
d("div", Wd, [
|
|
5419
|
-
l("import") ? (u(),
|
|
5419
|
+
l("import") ? (u(), g("input", {
|
|
5420
5420
|
key: 0,
|
|
5421
5421
|
ref_key: "fileInput",
|
|
5422
5422
|
ref: k,
|
|
@@ -5425,7 +5425,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5425
5425
|
accept: ".json",
|
|
5426
5426
|
type: "file"
|
|
5427
5427
|
}, null, 544)) : K("", !0),
|
|
5428
|
-
l("import") ? (u(),
|
|
5428
|
+
l("import") ? (u(), g("button", {
|
|
5429
5429
|
key: 1,
|
|
5430
5430
|
type: "button",
|
|
5431
5431
|
onClick: B,
|
|
@@ -5434,7 +5434,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5434
5434
|
G(q(Va), { class: "h-4 w-4 text-gray-700" }),
|
|
5435
5435
|
le[4] || (le[4] = nt(" Імпорт ", -1))
|
|
5436
5436
|
])) : K("", !0),
|
|
5437
|
-
l("export") ? (u(),
|
|
5437
|
+
l("export") ? (u(), g("button", {
|
|
5438
5438
|
key: 2,
|
|
5439
5439
|
type: "button",
|
|
5440
5440
|
onClick: pe,
|
|
@@ -5443,7 +5443,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5443
5443
|
G(q(Il), { class: "h-4 w-4 text-gray-700" }),
|
|
5444
5444
|
le[5] || (le[5] = nt(" Експорт ", -1))
|
|
5445
5445
|
])) : K("", !0),
|
|
5446
|
-
l("add") ? (u(),
|
|
5446
|
+
l("add") ? (u(), g("button", {
|
|
5447
5447
|
key: 3,
|
|
5448
5448
|
onClick: Je,
|
|
5449
5449
|
type: "button",
|
|
@@ -5461,7 +5461,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5461
5461
|
d("th", Xd, [
|
|
5462
5462
|
G(q(cn), { class: "mx-auto h-4 w-4 text-gray-400" })
|
|
5463
5463
|
]),
|
|
5464
|
-
(u(!0),
|
|
5464
|
+
(u(!0), g(Ae, null, Be(w.value, (ae) => (u(), g("th", {
|
|
5465
5465
|
key: ae.key,
|
|
5466
5466
|
class: "px-4 py-3 text-left text-xs font-semibold text-gray-900"
|
|
5467
5467
|
}, [
|
|
@@ -5471,7 +5471,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5471
5471
|
class: "flex items-center gap-1 text-xs font-semibold text-gray-700 hover:text-gray-900 transition-colors"
|
|
5472
5472
|
}, [
|
|
5473
5473
|
d("span", null, ce(ae.ua || ae.label), 1),
|
|
5474
|
-
f.value === (ae.key || ae.name) ? (u(),
|
|
5474
|
+
f.value === (ae.key || ae.name) ? (u(), g("span", Jd, ce(_.value === "asc" ? "▲" : "▼"), 1)) : K("", !0)
|
|
5475
5475
|
], 8, Zd)
|
|
5476
5476
|
]))), 128)),
|
|
5477
5477
|
le[7] || (le[7] = d("th", { class: "px-4 py-3 text-left text-xs font-semibold text-gray-900 text-center w-[1%] whitespace-nowrap" }, " Дії ", -1))
|
|
@@ -5480,7 +5480,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5480
5480
|
d("tbody", {
|
|
5481
5481
|
class: ie(["divide-y divide-gray-200", { "[&_tr:last-child]:border-0": !m.value }])
|
|
5482
5482
|
}, [
|
|
5483
|
-
x.value.length === 0 ? (u(),
|
|
5483
|
+
x.value.length === 0 ? (u(), g("td", Qd, [
|
|
5484
5484
|
d("div", ec, [
|
|
5485
5485
|
d("div", tc, [
|
|
5486
5486
|
G(jd, { class: "w-48 mx-auto" }),
|
|
@@ -5491,7 +5491,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5491
5491
|
])
|
|
5492
5492
|
])
|
|
5493
5493
|
])) : K("", !0),
|
|
5494
|
-
(u(!0),
|
|
5494
|
+
(u(!0), g(Ae, null, Be(x.value, (ae, we) => (u(), g("tr", {
|
|
5495
5495
|
key: ae.id,
|
|
5496
5496
|
"data-row-index": we,
|
|
5497
5497
|
class: ie(["border-b transition-colors hover:bg-gray-50 cursor-move text-sm text-gray-700", {
|
|
@@ -5505,7 +5505,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5505
5505
|
}, [
|
|
5506
5506
|
d("td", {
|
|
5507
5507
|
class: "px-4 py-3 text-center align-middle touch-none select-none",
|
|
5508
|
-
onPointerdown: (Ce) =>
|
|
5508
|
+
onPointerdown: (Ce) => S(Ce, we),
|
|
5509
5509
|
onPointermove: V,
|
|
5510
5510
|
onPointerup: A,
|
|
5511
5511
|
onPointercancel: U
|
|
@@ -5514,39 +5514,39 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5514
5514
|
G(q(cn), { class: "mx-auto h-4 w-4 text-slate-400 dark:text-slate-500" })
|
|
5515
5515
|
])
|
|
5516
5516
|
], 40, lc),
|
|
5517
|
-
(u(!0),
|
|
5517
|
+
(u(!0), g(Ae, null, Be(w.value, (Ce) => (u(), g("td", {
|
|
5518
5518
|
key: Ce.key,
|
|
5519
5519
|
class: "px-4 py-3 align-middle"
|
|
5520
5520
|
}, [
|
|
5521
|
-
R(Ce) === "slot" ? (u(),
|
|
5521
|
+
R(Ce) === "slot" ? (u(), g(Ae, { key: 0 }, [
|
|
5522
5522
|
Me(Ce.slot) ? ft(W.$slots, Ce.slot, {
|
|
5523
5523
|
key: 0,
|
|
5524
5524
|
row: ae,
|
|
5525
5525
|
value: ae[Ce.key],
|
|
5526
5526
|
column: Ce
|
|
5527
|
-
}) : (u(),
|
|
5527
|
+
}) : (u(), g("div", {
|
|
5528
5528
|
key: 1,
|
|
5529
5529
|
class: "text-sm text-gray-900",
|
|
5530
5530
|
innerHTML: Ve(Ce.slot, ae)
|
|
5531
5531
|
}, null, 8, oc))
|
|
5532
|
-
], 64)) : (u(),
|
|
5533
|
-
R(Ce) === "file" ? (u(),
|
|
5534
|
-
P(oe(ae, Ce)) ? (u(),
|
|
5532
|
+
], 64)) : (u(), g(Ae, { key: 1 }, [
|
|
5533
|
+
R(Ce) === "file" ? (u(), g("div", rc, [
|
|
5534
|
+
P(oe(ae, Ce)) ? (u(), g("div", sc, [
|
|
5535
5535
|
d("img", {
|
|
5536
5536
|
src: oe(ae, Ce),
|
|
5537
5537
|
alt: "alt",
|
|
5538
5538
|
width: "45",
|
|
5539
5539
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
5540
5540
|
}, null, 8, ic)
|
|
5541
|
-
])) : (u(),
|
|
5541
|
+
])) : (u(), g("div", uc, [
|
|
5542
5542
|
G(q(Gn), { class: "h-4 w-4 min-w-4" })
|
|
5543
5543
|
]))
|
|
5544
|
-
])) : R(Ce) === "color" ? (u(),
|
|
5544
|
+
])) : R(Ce) === "color" ? (u(), g("div", dc, [
|
|
5545
5545
|
d("span", {
|
|
5546
5546
|
class: "inline-flex h-6 w-6 rounded border border-gray-200",
|
|
5547
5547
|
style: Oe({ backgroundColor: oe(ae, Ce) || "#ffffff" })
|
|
5548
5548
|
}, null, 4)
|
|
5549
|
-
])) : (u(),
|
|
5549
|
+
])) : (u(), g("div", cc, ce(oe(ae, Ce)), 1))
|
|
5550
5550
|
], 64))
|
|
5551
5551
|
]))), 128)),
|
|
5552
5552
|
d("td", fc, [
|
|
@@ -5613,7 +5613,7 @@ const jd = /* @__PURE__ */ Xe(Bd, [["render", Nd]]), zd = { class: "bg-white rou
|
|
|
5613
5613
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
5614
5614
|
};
|
|
5615
5615
|
function wc(e, t) {
|
|
5616
|
-
return u(),
|
|
5616
|
+
return u(), g("svg", bc, t[0] || (t[0] = [
|
|
5617
5617
|
d("path", {
|
|
5618
5618
|
stroke: "none",
|
|
5619
5619
|
d: "M0 0h24v24H0z",
|
|
@@ -5635,7 +5635,7 @@ const xc = /* @__PURE__ */ Xe(hc, [["render", wc]]), kc = {}, _c = {
|
|
|
5635
5635
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
5636
5636
|
};
|
|
5637
5637
|
function $c(e, t) {
|
|
5638
|
-
return u(),
|
|
5638
|
+
return u(), g("svg", _c, t[0] || (t[0] = [
|
|
5639
5639
|
Dl('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
|
|
5640
5640
|
]));
|
|
5641
5641
|
}
|
|
@@ -5650,7 +5650,7 @@ const Sc = /* @__PURE__ */ Xe(kc, [["render", $c]]), Cc = {}, Mc = {
|
|
|
5650
5650
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
5651
5651
|
};
|
|
5652
5652
|
function Lc(e, t) {
|
|
5653
|
-
return u(),
|
|
5653
|
+
return u(), g("svg", Mc, t[0] || (t[0] = [
|
|
5654
5654
|
Dl('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
|
|
5655
5655
|
]));
|
|
5656
5656
|
}
|
|
@@ -5719,9 +5719,9 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5719
5719
|
},
|
|
5720
5720
|
emits: ["onLayerChange", "onOverlayToggle", "onVectorOverlayToggle"],
|
|
5721
5721
|
setup(e, { emit: t }) {
|
|
5722
|
-
const n = e, l = t, o = 10 * Rn, a = 400 * Rn, i = 400 * Rn, r = 320 * Rn, c = D(null), f = D(null), _ = D(null), x = D(!1), w = D({}), b = y(() => Object.keys(n.basemaps || {}).length > 0), m = y(() => Object.keys(n.tileOverlays || {}).length > 0), k = y(() => n.vectorOverlays ?? []),
|
|
5723
|
-
() => b.value || m.value ||
|
|
5724
|
-
),
|
|
5722
|
+
const n = e, l = t, o = 10 * Rn, a = 400 * Rn, i = 400 * Rn, r = 320 * Rn, c = D(null), f = D(null), _ = D(null), x = D(!1), w = D({}), b = y(() => Object.keys(n.basemaps || {}).length > 0), m = y(() => Object.keys(n.tileOverlays || {}).length > 0), k = y(() => n.vectorOverlays ?? []), v = y(() => k.value.length > 0), M = y(
|
|
5723
|
+
() => b.value || m.value || v.value
|
|
5724
|
+
), S = y(() => n.basemaps?.[n.activeBaseKey]?.name || n.activeBaseKey || "Шари"), V = y(() => U(n.basemaps)), A = y(() => U(n.tileOverlays || {}));
|
|
5725
5725
|
function U(Y) {
|
|
5726
5726
|
const ke = n.previewTile;
|
|
5727
5727
|
return ke ? Object.fromEntries(
|
|
@@ -5786,7 +5786,7 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5786
5786
|
document.addEventListener("click", J), document.addEventListener("keydown", ee), window.addEventListener("resize", P), window.addEventListener("scroll", P, !0);
|
|
5787
5787
|
}), It(() => {
|
|
5788
5788
|
document.removeEventListener("click", J), document.removeEventListener("keydown", ee), window.removeEventListener("resize", P), window.removeEventListener("scroll", P, !0);
|
|
5789
|
-
}), (Y, ke) => M.value ? (u(),
|
|
5789
|
+
}), (Y, ke) => M.value ? (u(), g("div", {
|
|
5790
5790
|
key: 0,
|
|
5791
5791
|
ref_key: "rootRef",
|
|
5792
5792
|
ref: c,
|
|
@@ -5797,12 +5797,12 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5797
5797
|
ref: f,
|
|
5798
5798
|
type: "button",
|
|
5799
5799
|
class: "map-layers__trigger",
|
|
5800
|
-
title:
|
|
5800
|
+
title: S.value,
|
|
5801
5801
|
"aria-haspopup": "dialog",
|
|
5802
5802
|
"aria-expanded": x.value,
|
|
5803
5803
|
onClick: Ee(Q, ["stop"])
|
|
5804
5804
|
}, [
|
|
5805
|
-
j.value ? (u(),
|
|
5805
|
+
j.value ? (u(), g("img", {
|
|
5806
5806
|
key: 0,
|
|
5807
5807
|
src: j.value,
|
|
5808
5808
|
alt: "",
|
|
@@ -5812,7 +5812,7 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5812
5812
|
(u(), xe(Kt, { to: "body" }, [
|
|
5813
5813
|
G(Jn, { name: "map-layers-panel" }, {
|
|
5814
5814
|
default: ut(() => [
|
|
5815
|
-
x.value ? (u(),
|
|
5815
|
+
x.value ? (u(), g("div", {
|
|
5816
5816
|
key: 0,
|
|
5817
5817
|
ref_key: "panelRef",
|
|
5818
5818
|
ref: _,
|
|
@@ -5833,10 +5833,10 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5833
5833
|
])
|
|
5834
5834
|
]),
|
|
5835
5835
|
d("div", Pc, [
|
|
5836
|
-
m.value ? (u(),
|
|
5836
|
+
m.value ? (u(), g("section", Oc, [
|
|
5837
5837
|
ke[1] || (ke[1] = d("h4", { class: "map-layers__section-title" }, "Додаткові шари", -1)),
|
|
5838
5838
|
d("div", Bc, [
|
|
5839
|
-
(u(!0),
|
|
5839
|
+
(u(!0), g(Ae, null, Be(Y.tileOverlays, (ye, T) => (u(), g("button", {
|
|
5840
5840
|
key: `tile-${T}`,
|
|
5841
5841
|
type: "button",
|
|
5842
5842
|
class: ie(["map-layers__option", { "map-layers__option--active": B(String(T)) }]),
|
|
@@ -5854,10 +5854,10 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5854
5854
|
], 10, Rc))), 128))
|
|
5855
5855
|
])
|
|
5856
5856
|
])) : K("", !0),
|
|
5857
|
-
b.value ? (u(),
|
|
5857
|
+
b.value ? (u(), g("section", Uc, [
|
|
5858
5858
|
ke[2] || (ke[2] = d("h4", { class: "map-layers__section-title" }, "Базові шари", -1)),
|
|
5859
5859
|
d("div", Hc, [
|
|
5860
|
-
(u(!0),
|
|
5860
|
+
(u(!0), g(Ae, null, Be(Y.basemaps, (ye, T) => (u(), g("button", {
|
|
5861
5861
|
key: `base-${T}`,
|
|
5862
5862
|
type: "button",
|
|
5863
5863
|
class: ie(["map-layers__option", { "map-layers__option--active": Y.activeBaseKey === String(T) }]),
|
|
@@ -5874,10 +5874,10 @@ const Tc = ["title", "aria-expanded"], Ec = ["src"], Fc = { class: "map-layers__
|
|
|
5874
5874
|
], 10, Wc))), 128))
|
|
5875
5875
|
])
|
|
5876
5876
|
])) : K("", !0),
|
|
5877
|
-
|
|
5877
|
+
v.value ? (u(), g("section", Gc, [
|
|
5878
5878
|
ke[3] || (ke[3] = d("h4", { class: "map-layers__section-title" }, "Дані", -1)),
|
|
5879
5879
|
d("div", Xc, [
|
|
5880
|
-
(u(!0),
|
|
5880
|
+
(u(!0), g(Ae, null, Be(k.value, (ye) => (u(), g("label", {
|
|
5881
5881
|
key: ye.id,
|
|
5882
5882
|
class: "map-layers__vector-item"
|
|
5883
5883
|
}, [
|
|
@@ -6172,12 +6172,12 @@ const sf = ["title"], uf = {
|
|
|
6172
6172
|
ve(b, (z) => {
|
|
6173
6173
|
z.includes(k.value) || (k.value = z[0]);
|
|
6174
6174
|
});
|
|
6175
|
-
const
|
|
6175
|
+
const v = D(""), M = D(!1), S = D(null), V = D(null), A = D(null), U = D(null), Z = D([]), F = D(null), j = D(!1), B = D([]), P = y(
|
|
6176
6176
|
() => (k.value === "address" || k.value === "nominatim") && j.value
|
|
6177
6177
|
), Q = y(() => l.config?.addressDebounceMs ?? 1e3);
|
|
6178
6178
|
let pe = null;
|
|
6179
|
-
const Se = D(!1), X = y(() =>
|
|
6180
|
-
() =>
|
|
6179
|
+
const Se = D(!1), X = y(() => v.value.trim().length > 0 ? Z.value : B.value), te = y(() => v.value.trim().length ? `Знайдено ${Z.value.length}` : "Історія пошуку"), J = y(
|
|
6180
|
+
() => v.value.trim().length ? "Нічого не знайдено" : "Історія порожня"
|
|
6181
6181
|
);
|
|
6182
6182
|
function ee() {
|
|
6183
6183
|
if (typeof window > "u") return [];
|
|
@@ -6216,12 +6216,12 @@ const sf = ["title"], uf = {
|
|
|
6216
6216
|
pe && (clearTimeout(pe), pe = null);
|
|
6217
6217
|
}
|
|
6218
6218
|
ve(k, () => {
|
|
6219
|
-
|
|
6219
|
+
v.value = "", M.value = !1, Z.value = [], j.value = !1, R(), Se.value = !1;
|
|
6220
6220
|
}), ve(P, (z) => {
|
|
6221
6221
|
z ? et(() => {
|
|
6222
6222
|
T();
|
|
6223
6223
|
}) : ye.display = "none";
|
|
6224
|
-
}), ve(
|
|
6224
|
+
}), ve(v, (z) => {
|
|
6225
6225
|
if (k.value !== "address" && k.value !== "nominatim") {
|
|
6226
6226
|
Z.value = [], R();
|
|
6227
6227
|
return;
|
|
@@ -6233,13 +6233,13 @@ const sf = ["title"], uf = {
|
|
|
6233
6233
|
R(), j.value = !0, pe = window.setTimeout(() => {
|
|
6234
6234
|
ae(z).catch(($) => {
|
|
6235
6235
|
const L = $?.message || "Помилка пошуку адреси";
|
|
6236
|
-
|
|
6236
|
+
Ie({ type: "error", title: "Пошук адреси", message: L });
|
|
6237
6237
|
});
|
|
6238
6238
|
}, Q.value);
|
|
6239
6239
|
});
|
|
6240
6240
|
function fe(z) {
|
|
6241
6241
|
const $ = [];
|
|
6242
|
-
V.value && $.push(V.value), z instanceof HTMLElement && $.push(z),
|
|
6242
|
+
V.value && $.push(V.value), z instanceof HTMLElement && $.push(z), S.value?.querySelectorAll("li")?.forEach((O) => {
|
|
6243
6243
|
$.push(O);
|
|
6244
6244
|
}), $.forEach((O) => {
|
|
6245
6245
|
O.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
|
|
@@ -6252,12 +6252,12 @@ const sf = ["title"], uf = {
|
|
|
6252
6252
|
fe($?.target), k.value = z;
|
|
6253
6253
|
}
|
|
6254
6254
|
function Me() {
|
|
6255
|
-
|
|
6255
|
+
v.value = "", Z.value = [], j.value = !1, Se.value = !1;
|
|
6256
6256
|
}
|
|
6257
|
-
function
|
|
6257
|
+
function Te(z) {
|
|
6258
6258
|
const $ = z.target;
|
|
6259
6259
|
if (M.value) {
|
|
6260
|
-
const L =
|
|
6260
|
+
const L = S.value;
|
|
6261
6261
|
L && !L.contains($) && (fe($), M.value = !1);
|
|
6262
6262
|
}
|
|
6263
6263
|
if (P.value) {
|
|
@@ -6266,9 +6266,9 @@ const sf = ["title"], uf = {
|
|
|
6266
6266
|
}
|
|
6267
6267
|
}
|
|
6268
6268
|
lt(() => {
|
|
6269
|
-
B.value = ee(), window.addEventListener("click",
|
|
6269
|
+
B.value = ee(), window.addEventListener("click", Te, !0), window.addEventListener("scroll", ne, !0), window.addEventListener("resize", ne);
|
|
6270
6270
|
}), It(() => {
|
|
6271
|
-
window.removeEventListener("click",
|
|
6271
|
+
window.removeEventListener("click", Te, !0), window.removeEventListener("scroll", ne, !0), window.removeEventListener("resize", ne), R();
|
|
6272
6272
|
});
|
|
6273
6273
|
function Ve(z) {
|
|
6274
6274
|
return z === "xy" ? "Координати" : z === "parcel" ? "Кадастр" : z === "nominatim" ? "Адреса" : "Адресний";
|
|
@@ -6403,7 +6403,7 @@ const sf = ["title"], uf = {
|
|
|
6403
6403
|
async function ae(z) {
|
|
6404
6404
|
if (Z.value = [], R(), k.value === "address") {
|
|
6405
6405
|
if (!c()) {
|
|
6406
|
-
|
|
6406
|
+
Ie({
|
|
6407
6407
|
type: "warning",
|
|
6408
6408
|
title: "Пошук адреси",
|
|
6409
6409
|
message: "Не налаштовано addressSuggest"
|
|
@@ -6412,7 +6412,7 @@ const sf = ["title"], uf = {
|
|
|
6412
6412
|
}
|
|
6413
6413
|
const O = await W(z);
|
|
6414
6414
|
if (!O.length) {
|
|
6415
|
-
|
|
6415
|
+
Ie({ type: "warning", title: "Пошук адреси", message: "Не знайдено результатів" });
|
|
6416
6416
|
return;
|
|
6417
6417
|
}
|
|
6418
6418
|
Z.value = O;
|
|
@@ -6420,7 +6420,7 @@ const sf = ["title"], uf = {
|
|
|
6420
6420
|
}
|
|
6421
6421
|
const $ = await le(z);
|
|
6422
6422
|
if (!$.length) {
|
|
6423
|
-
|
|
6423
|
+
Ie({ type: "warning", title: "Пошук адреси", message: "Не знайдено результатів" });
|
|
6424
6424
|
return;
|
|
6425
6425
|
}
|
|
6426
6426
|
Z.value = $;
|
|
@@ -6430,7 +6430,7 @@ const sf = ["title"], uf = {
|
|
|
6430
6430
|
We(z), ke(z);
|
|
6431
6431
|
return;
|
|
6432
6432
|
}
|
|
6433
|
-
|
|
6433
|
+
Ie({
|
|
6434
6434
|
type: "warning",
|
|
6435
6435
|
title: "Пошук адреси",
|
|
6436
6436
|
message: "Геометрія для обраної адреси відсутня"
|
|
@@ -6453,12 +6453,12 @@ const sf = ["title"], uf = {
|
|
|
6453
6453
|
o("goToCoordinates", [z.lat, z.lng]), Se.value = !0;
|
|
6454
6454
|
}
|
|
6455
6455
|
async function qe() {
|
|
6456
|
-
const z =
|
|
6456
|
+
const z = v.value.trim();
|
|
6457
6457
|
if (z) {
|
|
6458
6458
|
if (k.value === "xy") {
|
|
6459
6459
|
const $ = Ze(z);
|
|
6460
6460
|
if (!$) {
|
|
6461
|
-
|
|
6461
|
+
Ie({
|
|
6462
6462
|
type: "warning",
|
|
6463
6463
|
title: "Пошук координат",
|
|
6464
6464
|
message: "Використайте `lat lon` або DMS у форматі `50°27'00\"N 30°31'24\"E`."
|
|
@@ -6473,13 +6473,13 @@ const sf = ["title"], uf = {
|
|
|
6473
6473
|
await ae(z);
|
|
6474
6474
|
} catch ($) {
|
|
6475
6475
|
const L = $?.message || "Помилка пошуку адреси";
|
|
6476
|
-
|
|
6476
|
+
Ie({ type: "error", title: "Пошук адреси", message: L });
|
|
6477
6477
|
}
|
|
6478
6478
|
return;
|
|
6479
6479
|
}
|
|
6480
6480
|
try {
|
|
6481
6481
|
if (!Ne(z)) {
|
|
6482
|
-
|
|
6482
|
+
Ie({
|
|
6483
6483
|
type: "warning",
|
|
6484
6484
|
title: "Пошук кадастру",
|
|
6485
6485
|
message: "Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ"
|
|
@@ -6490,22 +6490,22 @@ const sf = ["title"], uf = {
|
|
|
6490
6490
|
if (!$.ok) throw new Error(`HTTP ${$.status}`);
|
|
6491
6491
|
const L = await $.json(), O = Je(L);
|
|
6492
6492
|
if (!O.length)
|
|
6493
|
-
|
|
6493
|
+
Ie({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
|
|
6494
6494
|
else {
|
|
6495
6495
|
const me = O.find(ue);
|
|
6496
6496
|
if (!me) {
|
|
6497
|
-
|
|
6497
|
+
Ie({ type: "warning", title: "Пошук", message: "Геометрія ділянки відсутня" });
|
|
6498
6498
|
return;
|
|
6499
6499
|
}
|
|
6500
6500
|
We(me);
|
|
6501
6501
|
}
|
|
6502
6502
|
} catch ($) {
|
|
6503
6503
|
const L = $?.message || "Помилка пошуку";
|
|
6504
|
-
|
|
6504
|
+
Ie({ type: "error", title: "Пошук", message: L });
|
|
6505
6505
|
}
|
|
6506
6506
|
}
|
|
6507
6507
|
}
|
|
6508
|
-
return (z, $) => (u(),
|
|
6508
|
+
return (z, $) => (u(), g("div", {
|
|
6509
6509
|
ref_key: "widgetRef",
|
|
6510
6510
|
ref: A,
|
|
6511
6511
|
class: "map-search-widget flex flex-col gap-2 rounded-xl widget min-w-[200px]"
|
|
@@ -6514,10 +6514,10 @@ const sf = ["title"], uf = {
|
|
|
6514
6514
|
class: "flex gap-2 text-gray-900",
|
|
6515
6515
|
onSubmit: Ee(qe, ["prevent"])
|
|
6516
6516
|
}, [
|
|
6517
|
-
b.value.length > 1 ? (u(),
|
|
6517
|
+
b.value.length > 1 ? (u(), g("div", {
|
|
6518
6518
|
key: 0,
|
|
6519
6519
|
ref_key: "dropdownRef",
|
|
6520
|
-
ref:
|
|
6520
|
+
ref: S,
|
|
6521
6521
|
class: "relative search-type w-[100px]"
|
|
6522
6522
|
}, [
|
|
6523
6523
|
d("button", {
|
|
@@ -6525,7 +6525,7 @@ const sf = ["title"], uf = {
|
|
|
6525
6525
|
class: "vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",
|
|
6526
6526
|
onClick: be
|
|
6527
6527
|
}, [
|
|
6528
|
-
Re((u(),
|
|
6528
|
+
Re((u(), g("span", {
|
|
6529
6529
|
ref_key: "selectedToolLabelRef",
|
|
6530
6530
|
ref: V,
|
|
6531
6531
|
class: "block w-full truncate",
|
|
@@ -6535,7 +6535,7 @@ const sf = ["title"], uf = {
|
|
|
6535
6535
|
], 8, sf)), [
|
|
6536
6536
|
[n, He(k.value)]
|
|
6537
6537
|
]),
|
|
6538
|
-
(u(),
|
|
6538
|
+
(u(), g("svg", {
|
|
6539
6539
|
class: ie(["w-4 h-4 text-gray-500 transition-transform", { "rotate-180": M.value }]),
|
|
6540
6540
|
viewBox: "0 0 24 24",
|
|
6541
6541
|
fill: "none",
|
|
@@ -6550,9 +6550,9 @@ const sf = ["title"], uf = {
|
|
|
6550
6550
|
}, null, -1)
|
|
6551
6551
|
]), 2))
|
|
6552
6552
|
]),
|
|
6553
|
-
M.value ? (u(),
|
|
6553
|
+
M.value ? (u(), g("div", uf, [
|
|
6554
6554
|
d("ul", null, [
|
|
6555
|
-
(u(!0),
|
|
6555
|
+
(u(!0), g(Ae, null, Be(b.value, (L) => Re((u(), g("li", {
|
|
6556
6556
|
key: L,
|
|
6557
6557
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100 text-gray-900",
|
|
6558
6558
|
onClick: (O) => se(L, O)
|
|
@@ -6571,13 +6571,13 @@ const sf = ["title"], uf = {
|
|
|
6571
6571
|
}, [
|
|
6572
6572
|
k.value === "parcel" ? (u(), xe(Fl, {
|
|
6573
6573
|
key: 0,
|
|
6574
|
-
modelValue:
|
|
6575
|
-
"onUpdate:modelValue": $[0] || ($[0] = (L) =>
|
|
6574
|
+
modelValue: v.value,
|
|
6575
|
+
"onUpdate:modelValue": $[0] || ($[0] = (L) => v.value = L),
|
|
6576
6576
|
mask: "0000000000:00:000:0000",
|
|
6577
6577
|
class: ie(["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", Se.value ? "!pr-14" : "!pr-8"])
|
|
6578
|
-
}, null, 8, ["modelValue", "class"])) : Re((u(),
|
|
6578
|
+
}, null, 8, ["modelValue", "class"])) : Re((u(), g("input", {
|
|
6579
6579
|
key: 1,
|
|
6580
|
-
"onUpdate:modelValue": $[1] || ($[1] = (L) =>
|
|
6580
|
+
"onUpdate:modelValue": $[1] || ($[1] = (L) => v.value = L),
|
|
6581
6581
|
placeholder: m.value,
|
|
6582
6582
|
type: "text",
|
|
6583
6583
|
class: ie(["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", Se.value ? "!pr-14" : "!pr-8"]),
|
|
@@ -6585,13 +6585,13 @@ const sf = ["title"], uf = {
|
|
|
6585
6585
|
}, null, 42, cf)), [
|
|
6586
6586
|
[
|
|
6587
6587
|
at,
|
|
6588
|
-
|
|
6588
|
+
v.value,
|
|
6589
6589
|
void 0,
|
|
6590
6590
|
{ trim: !0 }
|
|
6591
6591
|
]
|
|
6592
6592
|
]),
|
|
6593
6593
|
d("div", ff, [
|
|
6594
|
-
Se.value ? (u(),
|
|
6594
|
+
Se.value ? (u(), g("button", {
|
|
6595
6595
|
key: 0,
|
|
6596
6596
|
type: "button",
|
|
6597
6597
|
class: "flex items-center text-gray-400 hover:text-gray-600",
|
|
@@ -6654,13 +6654,13 @@ const sf = ["title"], uf = {
|
|
|
6654
6654
|
}, " ✕ ")
|
|
6655
6655
|
]),
|
|
6656
6656
|
d("div", vf, [
|
|
6657
|
-
X.value.length ? (u(),
|
|
6658
|
-
(u(!0),
|
|
6657
|
+
X.value.length ? (u(), g("ul", gf, [
|
|
6658
|
+
(u(!0), g(Ae, null, Be(X.value, (L) => (u(), g("li", {
|
|
6659
6659
|
key: L.id,
|
|
6660
6660
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-50",
|
|
6661
6661
|
onClick: (O) => we(L)
|
|
6662
6662
|
}, ce(L.title), 9, yf))), 128))
|
|
6663
|
-
])) : (u(),
|
|
6663
|
+
])) : (u(), g("div", hf, ce(J.value), 1))
|
|
6664
6664
|
])
|
|
6665
6665
|
], 4)
|
|
6666
6666
|
])) : K("", !0)
|
|
@@ -6680,7 +6680,7 @@ const sf = ["title"], uf = {
|
|
|
6680
6680
|
}, r = () => {
|
|
6681
6681
|
l.value = null, o.value = null, n("cancel");
|
|
6682
6682
|
};
|
|
6683
|
-
return (c, f) => (u(),
|
|
6683
|
+
return (c, f) => (u(), g("div", $f, [
|
|
6684
6684
|
f[2] || (f[2] = d("p", { class: "text-xs text-gray-600 mb-1" }, "Додати точку за координатами:", -1)),
|
|
6685
6685
|
d("div", Sf, [
|
|
6686
6686
|
Re(d("input", {
|
|
@@ -6730,7 +6730,7 @@ const sf = ["title"], uf = {
|
|
|
6730
6730
|
__name: "BtnAdd",
|
|
6731
6731
|
emits: ["click"],
|
|
6732
6732
|
setup(e) {
|
|
6733
|
-
return (t, n) => (u(),
|
|
6733
|
+
return (t, n) => (u(), g("button", {
|
|
6734
6734
|
class: "flex-1 px-2 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-xs font-medium rounded transition-colors duration-150 flex items-center justify-center gap-1",
|
|
6735
6735
|
onClick: n[0] || (n[0] = (l) => t.$emit("click"))
|
|
6736
6736
|
}, [
|
|
@@ -6745,7 +6745,7 @@ const sf = ["title"], uf = {
|
|
|
6745
6745
|
__name: "BtnClear",
|
|
6746
6746
|
emits: ["click"],
|
|
6747
6747
|
setup(e) {
|
|
6748
|
-
return (t, n) => (u(),
|
|
6748
|
+
return (t, n) => (u(), g("button", {
|
|
6749
6749
|
class: "w-full px-2 py-1.5 bg-rose-500 hover:bg-rose-600 text-white text-xs font-medium rounded transition-colors duration-150 flex items-center justify-center gap-1",
|
|
6750
6750
|
onClick: n[0] || (n[0] = (l) => t.$emit("click"))
|
|
6751
6751
|
}, [
|
|
@@ -6760,7 +6760,7 @@ const sf = ["title"], uf = {
|
|
|
6760
6760
|
__name: "BtnComplete",
|
|
6761
6761
|
emits: ["click"],
|
|
6762
6762
|
setup(e) {
|
|
6763
|
-
return (t, n) => (u(),
|
|
6763
|
+
return (t, n) => (u(), g("button", {
|
|
6764
6764
|
class: "flex-1 px-2 py-1.5 bg-emerald-500 hover:bg-emerald-600 text-white text-xs font-medium rounded transition-colors duration-150 flex items-center justify-center gap-1",
|
|
6765
6765
|
onClick: n[0] || (n[0] = (l) => t.$emit("click"))
|
|
6766
6766
|
}, [
|
|
@@ -6816,13 +6816,13 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6816
6816
|
}, x = () => {
|
|
6817
6817
|
l("delete", n.id);
|
|
6818
6818
|
};
|
|
6819
|
-
return (w, b) => (u(),
|
|
6819
|
+
return (w, b) => (u(), g("div", Df, [
|
|
6820
6820
|
G(q(Da), {
|
|
6821
6821
|
size: 12,
|
|
6822
6822
|
"stroke-width": 2,
|
|
6823
6823
|
class: "text-gray-400 flex-shrink-0"
|
|
6824
6824
|
}),
|
|
6825
|
-
a.value ? (u(),
|
|
6825
|
+
a.value ? (u(), g("div", If, [
|
|
6826
6826
|
Re(d("input", {
|
|
6827
6827
|
"onUpdate:modelValue": b[0] || (b[0] = (m) => i.value = m),
|
|
6828
6828
|
type: "number",
|
|
@@ -6860,8 +6860,8 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6860
6860
|
type: "button",
|
|
6861
6861
|
onClick: _
|
|
6862
6862
|
}, " ✓ ")
|
|
6863
|
-
])) : (u(),
|
|
6864
|
-
a.value ? K("", !0) : (u(),
|
|
6863
|
+
])) : (u(), g("span", Tf, ce(o.value), 1)),
|
|
6864
|
+
a.value ? K("", !0) : (u(), g("button", {
|
|
6865
6865
|
key: 2,
|
|
6866
6866
|
class: "text-blue-500 hover:text-blue-600 px-0.5",
|
|
6867
6867
|
type: "button",
|
|
@@ -6922,7 +6922,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6922
6922
|
], a = () => {
|
|
6923
6923
|
n.value = !n.value;
|
|
6924
6924
|
}, i = (m, k) => {
|
|
6925
|
-
const
|
|
6925
|
+
const v = (B) => B * Math.PI / 180, M = v(k.lat - m.lat), S = v(k.lng - m.lng), V = v(m.lat), A = v(k.lat), U = Math.sin(M / 2), Z = Math.sin(S / 2);
|
|
6926
6926
|
return 6371e3 * (2 * Math.asin(
|
|
6927
6927
|
Math.sqrt(
|
|
6928
6928
|
U * U + Math.cos(V) * Math.cos(A) * Z * Z
|
|
@@ -6940,16 +6940,16 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6940
6940
|
}), c = y(() => r.value >= 1e3 ? `${tn(r.value / 1e3)} км` : `${tn(r.value)} м`);
|
|
6941
6941
|
function f(m) {
|
|
6942
6942
|
if (m.length < 3) return 0;
|
|
6943
|
-
const k = m[0].lat,
|
|
6943
|
+
const k = m[0].lat, v = m[0].lng, M = (V, A) => {
|
|
6944
6944
|
const U = (V - k) * 110574;
|
|
6945
|
-
return { x: (A -
|
|
6945
|
+
return { x: (A - v) * 111320 * Math.cos(k * Math.PI / 180), y: U };
|
|
6946
6946
|
};
|
|
6947
|
-
let
|
|
6947
|
+
let S = 0;
|
|
6948
6948
|
for (let V = 0; V < m.length; V++) {
|
|
6949
6949
|
const A = (V + 1) % m.length, U = M(m[V].lat, m[V].lng), Z = M(m[A].lat, m[A].lng);
|
|
6950
|
-
|
|
6950
|
+
S += U.x * Z.y - U.y * Z.x;
|
|
6951
6951
|
}
|
|
6952
|
-
return Math.abs(
|
|
6952
|
+
return Math.abs(S) * 0.5;
|
|
6953
6953
|
}
|
|
6954
6954
|
const _ = y(() => {
|
|
6955
6955
|
if (!t.isShapeClosed || t.points.length < 3) return 0;
|
|
@@ -6959,12 +6959,12 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6959
6959
|
const m = _.value;
|
|
6960
6960
|
if (m === 0) return "—";
|
|
6961
6961
|
if (l.value === "km2") {
|
|
6962
|
-
const
|
|
6963
|
-
return `${tn(
|
|
6962
|
+
const v = m / 1e6;
|
|
6963
|
+
return `${tn(v)} км²`;
|
|
6964
6964
|
}
|
|
6965
6965
|
if (l.value === "ha") {
|
|
6966
|
-
const
|
|
6967
|
-
return `${tn(
|
|
6966
|
+
const v = m / 1e4;
|
|
6967
|
+
return `${tn(v)} га`;
|
|
6968
6968
|
}
|
|
6969
6969
|
const k = m >= 1 ? Math.round(m) : m;
|
|
6970
6970
|
return `${tn(k)} м²`;
|
|
@@ -6977,7 +6977,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6977
6977
|
() => {
|
|
6978
6978
|
t.points.length === 0 && (n.value = !1);
|
|
6979
6979
|
}
|
|
6980
|
-
), (m, k) => (u(),
|
|
6980
|
+
), (m, k) => (u(), g("div", Ff, [
|
|
6981
6981
|
d("button", Pf, [
|
|
6982
6982
|
d("span", Of, [
|
|
6983
6983
|
G(q(ln), {
|
|
@@ -6998,21 +6998,21 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
6998
6998
|
]),
|
|
6999
6999
|
k[2] || (k[2] = d("span", { class: "text-xs font-medium text-gray-600 flex-1" }, "Площа", -1)),
|
|
7000
7000
|
d("div", zf, [
|
|
7001
|
-
(u(),
|
|
7002
|
-
key:
|
|
7001
|
+
(u(), g(Ae, null, Be(o, (v, M) => d("button", {
|
|
7002
|
+
key: v.id,
|
|
7003
7003
|
type: "button",
|
|
7004
7004
|
class: ie([
|
|
7005
7005
|
"px-2.5 py-1 text-xs font-medium transition-colors border-r border-gray-200 last:border-r-0",
|
|
7006
7006
|
M === 0 && "rounded-l-md",
|
|
7007
7007
|
M === o.length - 1 && "rounded-r-md",
|
|
7008
|
-
l.value ===
|
|
7008
|
+
l.value === v.id ? "bg-white text-green-600 font-semibold shadow-sm" : "text-gray-600 hover:bg-gray-50"
|
|
7009
7009
|
]),
|
|
7010
|
-
onClick: Ee((
|
|
7011
|
-
}, ce(
|
|
7010
|
+
onClick: Ee((S) => l.value = v.id, ["stop"])
|
|
7011
|
+
}, ce(v.label), 11, Uf)), 64))
|
|
7012
7012
|
])
|
|
7013
7013
|
]),
|
|
7014
7014
|
d("div", Hf, [
|
|
7015
|
-
x.value ? (u(),
|
|
7015
|
+
x.value ? (u(), g("span", Wf, ce(w.value), 1)) : (u(), g("span", qf, "—"))
|
|
7016
7016
|
])
|
|
7017
7017
|
]),
|
|
7018
7018
|
d("div", Kf, [
|
|
@@ -7029,14 +7029,14 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7029
7029
|
onClick: Ee(a, ["stop"])
|
|
7030
7030
|
}, " Координати ")
|
|
7031
7031
|
]),
|
|
7032
|
-
n.value ? (u(),
|
|
7033
|
-
(u(!0),
|
|
7034
|
-
key:
|
|
7035
|
-
id:
|
|
7032
|
+
n.value ? (u(), g("div", Xf, [
|
|
7033
|
+
(u(!0), g(Ae, null, Be(m.points, (v, M) => (u(), xe(Ef, {
|
|
7034
|
+
key: v.id,
|
|
7035
|
+
id: v.id,
|
|
7036
7036
|
index: M + 1,
|
|
7037
|
-
coords:
|
|
7038
|
-
onUpdate: k[0] || (k[0] = (
|
|
7039
|
-
onDelete: (
|
|
7037
|
+
coords: v.coords,
|
|
7038
|
+
onUpdate: k[0] || (k[0] = (S) => m.$emit("update-point", S)),
|
|
7039
|
+
onDelete: (S) => m.$emit("delete-point", v.id)
|
|
7040
7040
|
}, null, 8, ["id", "index", "coords", "onDelete"]))), 128))
|
|
7041
7041
|
])) : K("", !0)
|
|
7042
7042
|
]));
|
|
@@ -7044,7 +7044,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7044
7044
|
}), Jf = { class: "px-3 py-3 bg-blue-50/50 border-b border-blue-100" }, Qf = { class: "flex items-start gap-2" }, ep = /* @__PURE__ */ ge({
|
|
7045
7045
|
__name: "InfoHint",
|
|
7046
7046
|
setup(e) {
|
|
7047
|
-
return (t, n) => (u(),
|
|
7047
|
+
return (t, n) => (u(), g("div", Jf, [
|
|
7048
7048
|
d("div", Qf, [
|
|
7049
7049
|
G(q(ln), {
|
|
7050
7050
|
size: 16,
|
|
@@ -7092,10 +7092,10 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7092
7092
|
}
|
|
7093
7093
|
return a;
|
|
7094
7094
|
});
|
|
7095
|
-
return (a, i) => (u(),
|
|
7095
|
+
return (a, i) => (u(), g("div", tp, [
|
|
7096
7096
|
i[0] || (i[0] = d("p", { class: "text-xs font-medium text-gray-600 mb-1.5" }, "Відстань між точками:", -1)),
|
|
7097
7097
|
d("div", np, [
|
|
7098
|
-
(u(!0),
|
|
7098
|
+
(u(!0), g(Ae, null, Be(o.value, (r, c) => (u(), g("div", {
|
|
7099
7099
|
key: c,
|
|
7100
7100
|
class: "flex items-center justify-between text-xs py-1 px-2 rounded bg-gray-50"
|
|
7101
7101
|
}, [
|
|
@@ -7144,7 +7144,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7144
7144
|
...o.value,
|
|
7145
7145
|
{ id: m(), coords: { lat: P.lat, lng: P.lng } }
|
|
7146
7146
|
], b();
|
|
7147
|
-
},
|
|
7147
|
+
}, v = ({
|
|
7148
7148
|
id: P,
|
|
7149
7149
|
coords: Q
|
|
7150
7150
|
}) => {
|
|
@@ -7154,10 +7154,10 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7154
7154
|
Se[pe] = { id: P, coords: { ...Q } }, o.value = Se, b();
|
|
7155
7155
|
}, M = (P) => {
|
|
7156
7156
|
o.value = o.value.filter((Q) => Q.id !== P), b();
|
|
7157
|
-
},
|
|
7157
|
+
}, S = () => {
|
|
7158
7158
|
o.value = [], r.value && (r.value = !1, l("shape-closed-change", !1)), b();
|
|
7159
7159
|
}, V = (P) => {
|
|
7160
|
-
|
|
7160
|
+
v(P);
|
|
7161
7161
|
}, A = (P) => {
|
|
7162
7162
|
M(P);
|
|
7163
7163
|
}, U = () => {
|
|
@@ -7169,12 +7169,12 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7169
7169
|
}, j = () => {
|
|
7170
7170
|
_.value && (r.value = !0, l("complete"), l("shape-closed-change", !0));
|
|
7171
7171
|
}, B = () => {
|
|
7172
|
-
|
|
7172
|
+
S(), i.value = !1, l("close");
|
|
7173
7173
|
};
|
|
7174
7174
|
return t({
|
|
7175
7175
|
addPoint: k,
|
|
7176
|
-
clearPoints:
|
|
7177
|
-
}), (P, Q) => (u(),
|
|
7176
|
+
clearPoints: S
|
|
7177
|
+
}), (P, Q) => (u(), g("div", rp, [
|
|
7178
7178
|
d("div", sp, [
|
|
7179
7179
|
d("div", ip, [
|
|
7180
7180
|
d("div", up, [
|
|
@@ -7217,7 +7217,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7217
7217
|
onClick: Q[1] || (Q[1] = (pe) => f("topoint"))
|
|
7218
7218
|
}, " До точки ", 2)
|
|
7219
7219
|
]),
|
|
7220
|
-
c.value === "general" ? (u(),
|
|
7220
|
+
c.value === "general" ? (u(), g(Ae, { key: 0 }, [
|
|
7221
7221
|
a.value ? (u(), xe(Zf, {
|
|
7222
7222
|
key: 1,
|
|
7223
7223
|
points: o.value,
|
|
@@ -7225,12 +7225,12 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7225
7225
|
onUpdatePoint: V,
|
|
7226
7226
|
onDeletePoint: A
|
|
7227
7227
|
}, null, 8, ["points", "is-shape-closed"])) : (u(), xe(ep, { key: 0 }))
|
|
7228
|
-
], 64)) : (u(),
|
|
7228
|
+
], 64)) : (u(), g("div", fp, [
|
|
7229
7229
|
a.value ? (u(), xe(op, {
|
|
7230
7230
|
key: 0,
|
|
7231
7231
|
points: o.value,
|
|
7232
7232
|
"is-shape-closed": r.value
|
|
7233
|
-
}, null, 8, ["points", "is-shape-closed"])) : (u(),
|
|
7233
|
+
}, null, 8, ["points", "is-shape-closed"])) : (u(), g("p", pp, "Додайте точки на карті, щоб бачити відстані між ними."))
|
|
7234
7234
|
])),
|
|
7235
7235
|
d("div", mp, [
|
|
7236
7236
|
d("div", vp, [
|
|
@@ -7250,7 +7250,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7250
7250
|
})) : K("", !0),
|
|
7251
7251
|
a.value ? (u(), xe(Lf, {
|
|
7252
7252
|
key: 1,
|
|
7253
|
-
onClick:
|
|
7253
|
+
onClick: S
|
|
7254
7254
|
})) : K("", !0)
|
|
7255
7255
|
])
|
|
7256
7256
|
])
|
|
@@ -7266,10 +7266,10 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7266
7266
|
},
|
|
7267
7267
|
setup(e) {
|
|
7268
7268
|
function t(m, k) {
|
|
7269
|
-
const
|
|
7269
|
+
const v = (Z) => Z * Math.PI / 180, M = v(k.lat - m.lat), S = v(k.lng - m.lng), V = v(m.lat), A = v(k.lat);
|
|
7270
7270
|
return 6371e3 * (2 * Math.asin(
|
|
7271
7271
|
Math.sqrt(
|
|
7272
|
-
Math.sin(M / 2) ** 2 + Math.cos(V) * Math.cos(A) * Math.sin(
|
|
7272
|
+
Math.sin(M / 2) ** 2 + Math.cos(V) * Math.cos(A) * Math.sin(S / 2) ** 2
|
|
7273
7273
|
)
|
|
7274
7274
|
));
|
|
7275
7275
|
}
|
|
@@ -7280,16 +7280,16 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7280
7280
|
function o() {
|
|
7281
7281
|
return { type: "FeatureCollection", features: [] };
|
|
7282
7282
|
}
|
|
7283
|
-
function a(m, k,
|
|
7284
|
-
const M =
|
|
7283
|
+
function a(m, k, v) {
|
|
7284
|
+
const M = v ?? "general", S = [];
|
|
7285
7285
|
let V = 0;
|
|
7286
|
-
|
|
7286
|
+
S.push(0);
|
|
7287
7287
|
for (let A = 1; A < m.length; A++)
|
|
7288
|
-
V += t(m[A - 1].coords, m[A].coords),
|
|
7288
|
+
V += t(m[A - 1].coords, m[A].coords), S.push(V);
|
|
7289
7289
|
return k && m.length >= 2 && (V += t(m[m.length - 1].coords, m[0].coords)), {
|
|
7290
7290
|
type: "FeatureCollection",
|
|
7291
7291
|
features: m.map((A, U) => {
|
|
7292
|
-
const Z = M === "general" ? U === 0 ? "0" : n(
|
|
7292
|
+
const Z = M === "general" ? U === 0 ? "0" : n(S[U]) : U === 0 ? "0" : n(
|
|
7293
7293
|
t(m[U - 1].coords, m[U].coords)
|
|
7294
7294
|
);
|
|
7295
7295
|
return {
|
|
@@ -7305,12 +7305,12 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7305
7305
|
}
|
|
7306
7306
|
function i(m, k) {
|
|
7307
7307
|
if (m.length < 2) return o();
|
|
7308
|
-
const
|
|
7308
|
+
const v = [];
|
|
7309
7309
|
for (let M = 0; M < m.length; M++) {
|
|
7310
|
-
const
|
|
7311
|
-
if (
|
|
7312
|
-
const V = m[M].coords, A = m[
|
|
7313
|
-
|
|
7310
|
+
const S = M === m.length - 1 && k ? 0 : M + 1;
|
|
7311
|
+
if (S >= m.length) break;
|
|
7312
|
+
const V = m[M].coords, A = m[S].coords, U = t(V, A);
|
|
7313
|
+
v.push({
|
|
7314
7314
|
type: "Feature",
|
|
7315
7315
|
geometry: {
|
|
7316
7316
|
type: "LineString",
|
|
@@ -7322,17 +7322,17 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7322
7322
|
properties: { distance: n(U) }
|
|
7323
7323
|
});
|
|
7324
7324
|
}
|
|
7325
|
-
return { type: "FeatureCollection", features:
|
|
7325
|
+
return { type: "FeatureCollection", features: v };
|
|
7326
7326
|
}
|
|
7327
7327
|
function r(m, k) {
|
|
7328
7328
|
if (m.length < 2) return o();
|
|
7329
|
-
const
|
|
7330
|
-
return k &&
|
|
7329
|
+
const v = m.map((M) => [M.coords.lng, M.coords.lat]);
|
|
7330
|
+
return k && v.push(v[0]), {
|
|
7331
7331
|
type: "FeatureCollection",
|
|
7332
7332
|
features: [
|
|
7333
7333
|
{
|
|
7334
7334
|
type: "Feature",
|
|
7335
|
-
geometry: { type: "LineString", coordinates:
|
|
7335
|
+
geometry: { type: "LineString", coordinates: v },
|
|
7336
7336
|
properties: {}
|
|
7337
7337
|
}
|
|
7338
7338
|
]
|
|
@@ -7340,7 +7340,7 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7340
7340
|
}
|
|
7341
7341
|
function c(m) {
|
|
7342
7342
|
if (m.length < 3) return o();
|
|
7343
|
-
const k = m.map((
|
|
7343
|
+
const k = m.map((v) => [v.coords.lng, v.coords.lat]);
|
|
7344
7344
|
return k.push(k[0]), {
|
|
7345
7345
|
type: "FeatureCollection",
|
|
7346
7346
|
features: [
|
|
@@ -7435,10 +7435,10 @@ const Df = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
7435
7435
|
}
|
|
7436
7436
|
function w(m) {
|
|
7437
7437
|
if (!m) return;
|
|
7438
|
-
const k = m.getSource(St),
|
|
7438
|
+
const k = m.getSource(St), v = m.getSource(zt), M = m.getSource(Ut), S = m.getSource(Ht), V = l.points, A = l.labelMode ?? "general";
|
|
7439
7439
|
k && k.setData(
|
|
7440
7440
|
a(V, l.isShapeClosed, A)
|
|
7441
|
-
),
|
|
7441
|
+
), v && v.setData(r(V, l.isShapeClosed)), M && M.setData(c(V)), S && S.setData(
|
|
7442
7442
|
A === "topoint" ? i(V, l.isShapeClosed) : o()
|
|
7443
7443
|
);
|
|
7444
7444
|
}
|
|
@@ -7613,9 +7613,9 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7613
7613
|
emits: ["update:modelValue", "valueSelected"],
|
|
7614
7614
|
setup(e, { emit: t }) {
|
|
7615
7615
|
const n = e, l = t, o = $a(), a = typeof document < "u" && document.querySelector("#modal") ? "#modal" : "body", i = y(() => {
|
|
7616
|
-
const s = o?.multiple, p = o?.multi, h = (
|
|
7616
|
+
const s = o?.multiple, p = o?.multi, h = (C) => C === "" || C === !0 || C === "true" || C === 1 || C === "1";
|
|
7617
7617
|
return !!n.multi || !!n.multiple || h(p) || h(s);
|
|
7618
|
-
}), r = y(() => !!n.disabled), c = D(!1), f = D(null), _ = D(0), x = D(""), w = D(null), b = D([]), m = D(null), k = D(null),
|
|
7618
|
+
}), r = y(() => !!n.disabled), c = D(!1), f = D(null), _ = D(0), x = D(""), w = D(null), b = D([]), m = D(null), k = D(null), v = hp({
|
|
7619
7619
|
onActivate() {
|
|
7620
7620
|
if (he)
|
|
7621
7621
|
try {
|
|
@@ -7628,12 +7628,12 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7628
7628
|
}
|
|
7629
7629
|
});
|
|
7630
7630
|
function M() {
|
|
7631
|
-
|
|
7631
|
+
v.toggleRuler();
|
|
7632
7632
|
}
|
|
7633
|
-
const
|
|
7633
|
+
const S = Zn(), V = S?.appContext?.config?.globalProperties?.$settings ?? {}, A = V?.map ?? {}, U = y(() => {
|
|
7634
7634
|
const s = A.layerPresets;
|
|
7635
7635
|
return Array.isArray(s) ? s : [];
|
|
7636
|
-
}), Z =
|
|
7636
|
+
}), Z = S?.vnode?.props ?? {};
|
|
7637
7637
|
function F(s) {
|
|
7638
7638
|
return Object.prototype.hasOwnProperty.call(Z, s) || Object.prototype.hasOwnProperty.call(
|
|
7639
7639
|
Z,
|
|
@@ -7657,10 +7657,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7657
7657
|
const H = h.coordinates, de = Number(H[0]), _e = Number(H[1]);
|
|
7658
7658
|
if (Number.isFinite(de) && Number.isFinite(_e)) return [de, _e];
|
|
7659
7659
|
}
|
|
7660
|
-
const
|
|
7660
|
+
const C = Number(p.lat), I = Number(
|
|
7661
7661
|
p.lng ?? p.lon
|
|
7662
7662
|
);
|
|
7663
|
-
if (Number.isFinite(
|
|
7663
|
+
if (Number.isFinite(C) && Number.isFinite(I)) return [I, C];
|
|
7664
7664
|
}
|
|
7665
7665
|
}
|
|
7666
7666
|
}
|
|
@@ -7688,8 +7688,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7688
7688
|
}
|
|
7689
7689
|
function T(s, p, h) {
|
|
7690
7690
|
if (!Number.isFinite(s) || !Number.isFinite(p)) return;
|
|
7691
|
-
const
|
|
7692
|
-
I && I.z ===
|
|
7691
|
+
const C = Vc(s, p, ye(h)), I = Y.value;
|
|
7692
|
+
I && I.z === C.z && I.x === C.x && I.y === C.y || (Y.value = C);
|
|
7693
7693
|
}
|
|
7694
7694
|
function ne() {
|
|
7695
7695
|
if (E) {
|
|
@@ -7707,7 +7707,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7707
7707
|
}, 120);
|
|
7708
7708
|
}
|
|
7709
7709
|
T(J.value[0], J.value[1]);
|
|
7710
|
-
const fe = D(n.modelValue), be = D(null), se = D(null), Me = D([]),
|
|
7710
|
+
const fe = D(n.modelValue), be = D(null), se = D(null), Me = D([]), Te = D(!1), Ve = D(!1), He = D([]), Ze = D({
|
|
7711
7711
|
coordinates: "",
|
|
7712
7712
|
format: "decimal",
|
|
7713
7713
|
order: "lat-lon"
|
|
@@ -7786,21 +7786,21 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7786
7786
|
const p = typeof s == "string" ? s.trim() : "";
|
|
7787
7787
|
if (!p) return "";
|
|
7788
7788
|
if (/^https?:\/\//i.test(p)) return p;
|
|
7789
|
-
const h = window?.location?.origin ?? "",
|
|
7790
|
-
return
|
|
7789
|
+
const h = window?.location?.origin ?? "", C = p.replace(/^\/+/, "");
|
|
7790
|
+
return C ? h ? `${h}/${C}` : `/${C}` : h;
|
|
7791
7791
|
}
|
|
7792
7792
|
function Ce() {
|
|
7793
7793
|
const s = Array.isArray(A.basemaps) && A.basemaps.length ? A.basemaps : V.basemaps;
|
|
7794
7794
|
if (Array.isArray(s) && s.length) {
|
|
7795
|
-
const h = s.map((
|
|
7796
|
-
const H = String(
|
|
7795
|
+
const h = s.map((C, I) => {
|
|
7796
|
+
const H = String(C?.key ?? C?.id ?? C?.name ?? `b${I}`), de = we(String(C?.url ?? ""));
|
|
7797
7797
|
if (!de) return null;
|
|
7798
|
-
const _e = typeof
|
|
7799
|
-
return [H, { ...
|
|
7798
|
+
const _e = typeof C?.preview == "string" && C.preview ? we(C.preview) : "";
|
|
7799
|
+
return [H, { ...C, url: de, preview: _e }];
|
|
7800
7800
|
}).filter(
|
|
7801
|
-
(
|
|
7801
|
+
(C) => Array.isArray(C) && C.length === 2
|
|
7802
7802
|
).reduce(
|
|
7803
|
-
(
|
|
7803
|
+
(C, [I, H]) => (C[I] = H, C),
|
|
7804
7804
|
{}
|
|
7805
7805
|
);
|
|
7806
7806
|
if (Object.keys(h).length) return h;
|
|
@@ -7826,15 +7826,15 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7826
7826
|
const Ne = Ce(), We = Object.keys(Ne), qe = D(We.length ? We[0] : "");
|
|
7827
7827
|
function z() {
|
|
7828
7828
|
const s = Array.isArray(A.overlays) && A.overlays.length ? A.overlays : V.overlays;
|
|
7829
|
-
return !Array.isArray(s) || !s.length ? {} : s.map((h,
|
|
7830
|
-
const H = (typeof h?.name == "string" ? h.name.trim() : "") || `o${
|
|
7829
|
+
return !Array.isArray(s) || !s.length ? {} : s.map((h, C) => {
|
|
7830
|
+
const H = (typeof h?.name == "string" ? h.name.trim() : "") || `o${C}`, de = we(String(h?.url ?? ""));
|
|
7831
7831
|
if (!de) return null;
|
|
7832
7832
|
const _e = typeof h?.preview == "string" && h.preview ? we(h.preview) : "";
|
|
7833
7833
|
return [H, { ...h, name: H, url: de, preview: _e }];
|
|
7834
7834
|
}).filter(
|
|
7835
7835
|
(h) => Array.isArray(h) && h.length === 2
|
|
7836
7836
|
).reduce(
|
|
7837
|
-
(h, [
|
|
7837
|
+
(h, [C, I]) => (h[C] = I, h),
|
|
7838
7838
|
{}
|
|
7839
7839
|
);
|
|
7840
7840
|
}
|
|
@@ -7925,14 +7925,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7925
7925
|
},
|
|
7926
7926
|
onMouseMove(s, p) {
|
|
7927
7927
|
if (!s.startPoint) return;
|
|
7928
|
-
const [h,
|
|
7928
|
+
const [h, C] = s.startPoint, I = p.lngLat.lng, H = p.lngLat.lat;
|
|
7929
7929
|
s.rectangle.setCoordinates([
|
|
7930
7930
|
[
|
|
7931
|
-
[h,
|
|
7932
|
-
[I,
|
|
7931
|
+
[h, C],
|
|
7932
|
+
[I, C],
|
|
7933
7933
|
[I, H],
|
|
7934
7934
|
[h, H],
|
|
7935
|
-
[h,
|
|
7935
|
+
[h, C]
|
|
7936
7936
|
]
|
|
7937
7937
|
]);
|
|
7938
7938
|
},
|
|
@@ -7949,14 +7949,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7949
7949
|
]);
|
|
7950
7950
|
return;
|
|
7951
7951
|
}
|
|
7952
|
-
const [h,
|
|
7953
|
-
return Math.abs(h - I) > 0 && Math.abs(
|
|
7952
|
+
const [h, C] = s.startPoint, I = p.lngLat.lng, H = p.lngLat.lat;
|
|
7953
|
+
return Math.abs(h - I) > 0 && Math.abs(C - H) > 0 ? (s.rectangle.setCoordinates([
|
|
7954
7954
|
[
|
|
7955
|
-
[h,
|
|
7956
|
-
[I,
|
|
7955
|
+
[h, C],
|
|
7956
|
+
[I, C],
|
|
7957
7957
|
[I, H],
|
|
7958
7958
|
[h, H],
|
|
7959
|
-
[h,
|
|
7959
|
+
[h, C]
|
|
7960
7960
|
]
|
|
7961
7961
|
]), this.map.fire("draw.create", { features: [s.rectangle.toGeoJSON()] }), this.changeMode("simple_select", { featureIds: [s.rectangle.id] })) : (this.deleteFeature([s.rectangle.id], { silent: !0 }), s.hasCoordinates = !1, this.changeMode("simple_select"));
|
|
7962
7962
|
},
|
|
@@ -7966,8 +7966,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
7966
7966
|
this.deleteFeature([s.rectangle.id], { silent: !0 }), this.changeMode("simple_select");
|
|
7967
7967
|
},
|
|
7968
7968
|
toDisplayFeatures(s, p, h) {
|
|
7969
|
-
const
|
|
7970
|
-
|
|
7969
|
+
const C = p.properties.id === s.rectangle.id;
|
|
7970
|
+
C && !s.hasCoordinates || (p.properties.active = C ? "true" : "false", h(p));
|
|
7971
7971
|
}
|
|
7972
7972
|
};
|
|
7973
7973
|
}
|
|
@@ -8111,8 +8111,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8111
8111
|
const p = String(s?.url ?? "").trim();
|
|
8112
8112
|
if (!p) return "";
|
|
8113
8113
|
if (/^https?:\/\//i.test(p)) return p;
|
|
8114
|
-
const h = window.location?.origin ?? "",
|
|
8115
|
-
return `${h}/${
|
|
8114
|
+
const h = window.location?.origin ?? "", C = p.replace(/^\/+/, "");
|
|
8115
|
+
return `${h}/${C}`;
|
|
8116
8116
|
}
|
|
8117
8117
|
function N(s) {
|
|
8118
8118
|
s && Ye.value?.layerId !== s || (Ye.value = null);
|
|
@@ -8122,7 +8122,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8122
8122
|
const h = Number(p?.point_count);
|
|
8123
8123
|
if (Number.isFinite(h) && h > 1)
|
|
8124
8124
|
return [{ key: "Об'єктів у кластері", value: String(h) }];
|
|
8125
|
-
const
|
|
8125
|
+
const C = vn(s), I = kl(s, C, U.value);
|
|
8126
8126
|
return Array.isArray(s.popup) ? s.popup.length ? s.popup.map((H) => {
|
|
8127
8127
|
const de = H?.field || H?.name;
|
|
8128
8128
|
if (!de) return null;
|
|
@@ -8134,14 +8134,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8134
8134
|
}
|
|
8135
8135
|
function $e(s) {
|
|
8136
8136
|
if (!Array.isArray(s)) return [];
|
|
8137
|
-
const p = (
|
|
8138
|
-
if (!
|
|
8139
|
-
const I =
|
|
8140
|
-
return !H || I[0] !== H[0] || I[1] !== H[1] ? [...
|
|
8137
|
+
const p = (C) => Array.isArray(C) && C.length >= 2 && Number.isFinite(Number(C[0])) && Number.isFinite(Number(C[1])), h = (C) => {
|
|
8138
|
+
if (!C.length) return C;
|
|
8139
|
+
const I = C[0], H = C[C.length - 1];
|
|
8140
|
+
return !H || I[0] !== H[0] || I[1] !== H[1] ? [...C, I] : C;
|
|
8141
8141
|
};
|
|
8142
8142
|
if (s.length && p(s[0])) {
|
|
8143
|
-
const
|
|
8144
|
-
return
|
|
8143
|
+
const C = s.map((I) => [Number(I[0]), Number(I[1])]).filter(p);
|
|
8144
|
+
return C.length ? [h(C)] : [];
|
|
8145
8145
|
}
|
|
8146
8146
|
return s.length && Array.isArray(s[0]) && p(s[0][0]) ? s.map(
|
|
8147
8147
|
(I) => Array.isArray(I) ? I.map((H) => [Number(H[0]), Number(H[1])]) : []
|
|
@@ -8152,10 +8152,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8152
8152
|
function je(s) {
|
|
8153
8153
|
const p = s.style ?? {}, h = p.color ?? "#3b82f6";
|
|
8154
8154
|
if (!p.colorAttr || !p.colorSet) return h;
|
|
8155
|
-
const
|
|
8156
|
-
if (!
|
|
8155
|
+
const C = Object.keys(p.colorSet);
|
|
8156
|
+
if (!C.length) return h;
|
|
8157
8157
|
const I = ["match", ["to-string", ["get", p.colorAttr]]];
|
|
8158
|
-
return
|
|
8158
|
+
return C.forEach((H) => {
|
|
8159
8159
|
I.push(String(H), p.colorSet?.[H] ?? h);
|
|
8160
8160
|
}), I.push(h), I;
|
|
8161
8161
|
}
|
|
@@ -8168,20 +8168,20 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8168
8168
|
}
|
|
8169
8169
|
function it(s) {
|
|
8170
8170
|
if (!E) return;
|
|
8171
|
-
s.handlers.forEach((
|
|
8171
|
+
s.handlers.forEach((C) => {
|
|
8172
8172
|
try {
|
|
8173
|
-
E.off(
|
|
8173
|
+
E.off(C.type, C.layerId, C.handler);
|
|
8174
8174
|
} catch {
|
|
8175
8175
|
}
|
|
8176
|
-
}), s.handlers = [], [...s.layerIds, ...s.boundsIds].forEach((
|
|
8177
|
-
E.getLayer(
|
|
8176
|
+
}), s.handlers = [], [...s.layerIds, ...s.boundsIds].forEach((C) => {
|
|
8177
|
+
E.getLayer(C) && E.removeLayer(C);
|
|
8178
8178
|
}), ot(s.sourceId), E.getSource(s.sourceId) && E.removeSource(s.sourceId);
|
|
8179
8179
|
const p = `vs-ov-bounds-src-${s.id}`, h = `vs-ov-bounds-line-${s.id}`;
|
|
8180
8180
|
E.getLayer(h) && E.removeLayer(h), E.getSource(p) && E.removeSource(p), N(s.id);
|
|
8181
8181
|
}
|
|
8182
8182
|
function rt(s, p) {
|
|
8183
8183
|
if (!E) return [];
|
|
8184
|
-
const h = `vs-ov-bounds-src-${p}`,
|
|
8184
|
+
const h = `vs-ov-bounds-src-${p}`, C = `vs-ov-bounds-line-${p}`, I = s.bounds ?? te.value ?? Me.value, H = $e(I);
|
|
8185
8185
|
if (!H.length) return [];
|
|
8186
8186
|
const de = {
|
|
8187
8187
|
type: "FeatureCollection",
|
|
@@ -8191,8 +8191,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8191
8191
|
geometry: { type: "LineString", coordinates: _e }
|
|
8192
8192
|
}))
|
|
8193
8193
|
};
|
|
8194
|
-
return E.getLayer(
|
|
8195
|
-
id:
|
|
8194
|
+
return E.getLayer(C) && E.removeLayer(C), E.getSource(h) && E.removeSource(h), E.addSource(h, { type: "geojson", data: de }), E.addLayer({
|
|
8195
|
+
id: C,
|
|
8196
8196
|
type: "line",
|
|
8197
8197
|
source: h,
|
|
8198
8198
|
paint: {
|
|
@@ -8201,21 +8201,21 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8201
8201
|
"line-opacity": s.style?.opacity ?? 0.8,
|
|
8202
8202
|
"line-dasharray": [2, 2]
|
|
8203
8203
|
}
|
|
8204
|
-
}), [
|
|
8204
|
+
}), [C];
|
|
8205
8205
|
}
|
|
8206
8206
|
function kt() {
|
|
8207
8207
|
return sn || x.value === "marker" || x.value === "polyline" || x.value === "polygon" || x.value === "rectangle";
|
|
8208
8208
|
}
|
|
8209
8209
|
function Tt(s, p) {
|
|
8210
8210
|
if (!E) return;
|
|
8211
|
-
s.handlers.forEach((
|
|
8211
|
+
s.handlers.forEach((C) => {
|
|
8212
8212
|
try {
|
|
8213
|
-
E.off(
|
|
8213
|
+
E.off(C.type, C.layerId, C.handler);
|
|
8214
8214
|
} catch {
|
|
8215
8215
|
}
|
|
8216
8216
|
});
|
|
8217
8217
|
const h = [];
|
|
8218
|
-
p.forEach((
|
|
8218
|
+
p.forEach((C) => {
|
|
8219
8219
|
const I = (de) => {
|
|
8220
8220
|
if (kt()) return;
|
|
8221
8221
|
if (!de?.features?.length) {
|
|
@@ -8233,9 +8233,9 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8233
8233
|
point: { x: de.point.x, y: de.point.y }
|
|
8234
8234
|
};
|
|
8235
8235
|
}, H = () => N(s.id);
|
|
8236
|
-
E.on("mousemove",
|
|
8237
|
-
{ layerId:
|
|
8238
|
-
{ layerId:
|
|
8236
|
+
E.on("mousemove", C, I), E.on("mouseleave", C, H), h.push(
|
|
8237
|
+
{ layerId: C, type: "mousemove", handler: I },
|
|
8238
|
+
{ layerId: C, type: "mouseleave", handler: H }
|
|
8239
8239
|
);
|
|
8240
8240
|
}), s.handlers = h;
|
|
8241
8241
|
}
|
|
@@ -8243,21 +8243,21 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8243
8243
|
if (!E) return;
|
|
8244
8244
|
s.layerIds = p, s.boundsIds = rt(s.config, s.id), Tt(s, p);
|
|
8245
8245
|
const h = s.visible ? "visible" : "none";
|
|
8246
|
-
[...s.layerIds, ...s.boundsIds].forEach((
|
|
8247
|
-
E.getLayer(
|
|
8246
|
+
[...s.layerIds, ...s.boundsIds].forEach((C) => {
|
|
8247
|
+
E.getLayer(C) && E.setLayoutProperty(C, "visibility", h);
|
|
8248
8248
|
}), Et();
|
|
8249
8249
|
}
|
|
8250
8250
|
function bt(s) {
|
|
8251
8251
|
if (!E) return;
|
|
8252
8252
|
it(s), s.renderToken = (s.renderToken ?? 0) + 1;
|
|
8253
|
-
const p = s.renderToken, h = s.config,
|
|
8254
|
-
if (!
|
|
8255
|
-
const I = [], H = /\.v(?:m)?t(?:\?|$|\/)/i.test(
|
|
8253
|
+
const p = s.renderToken, h = s.config, C = vn(h);
|
|
8254
|
+
if (!C) return;
|
|
8255
|
+
const I = [], H = /\.v(?:m)?t(?:\?|$|\/)/i.test(C) || /\.pbf(?:\?|$)/i.test(C) || /\/vtile(?:\/|\?|$)/i.test(C) || String(h?.service ?? "").toLowerCase() === "vector" || String(h?.format ?? "").toLowerCase() === "mvt", de = kl(h, C, U.value);
|
|
8256
8256
|
if (H && de) {
|
|
8257
8257
|
const _e = h.sourceLayer || h.layer || h.service_layer || h.dataset?.layer || h.id;
|
|
8258
8258
|
E.addSource(s.sourceId, {
|
|
8259
8259
|
type: "vector",
|
|
8260
|
-
tiles: [
|
|
8260
|
+
tiles: [C],
|
|
8261
8261
|
minzoom: typeof h.minzoom == "number" ? h.minzoom : 0,
|
|
8262
8262
|
maxzoom: typeof h.maxzoom == "number" ? h.maxzoom : 22
|
|
8263
8263
|
}), (async () => {
|
|
@@ -8268,7 +8268,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8268
8268
|
overlayId: s.id,
|
|
8269
8269
|
sourceId: s.sourceId,
|
|
8270
8270
|
sourceLayer: _e,
|
|
8271
|
-
url:
|
|
8271
|
+
url: C,
|
|
8272
8272
|
config: h
|
|
8273
8273
|
});
|
|
8274
8274
|
if (!E || !E.getSource(s.sourceId) || s.renderToken !== p) {
|
|
@@ -8288,7 +8288,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8288
8288
|
const _e = h.sourceLayer || h.layer || h.service_layer || h.dataset?.layer || h.id;
|
|
8289
8289
|
E.addSource(s.sourceId, {
|
|
8290
8290
|
type: "vector",
|
|
8291
|
-
tiles: [
|
|
8291
|
+
tiles: [C],
|
|
8292
8292
|
minzoom: typeof h.minzoom == "number" ? h.minzoom : 0,
|
|
8293
8293
|
maxzoom: typeof h.maxzoom == "number" ? h.maxzoom : 22
|
|
8294
8294
|
});
|
|
@@ -8351,7 +8351,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8351
8351
|
} else {
|
|
8352
8352
|
E.addSource(
|
|
8353
8353
|
s.sourceId,
|
|
8354
|
-
wl(
|
|
8354
|
+
wl(C, h, { safe: !1 })
|
|
8355
8355
|
);
|
|
8356
8356
|
const _e = `vs-ov-raster-${s.id}`;
|
|
8357
8357
|
E.addLayer({
|
|
@@ -8393,22 +8393,22 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8393
8393
|
if (!p) return;
|
|
8394
8394
|
p.visible = !p.visible;
|
|
8395
8395
|
const h = p.visible ? "visible" : "none";
|
|
8396
|
-
[...p.layerIds, ...p.boundsIds].forEach((
|
|
8397
|
-
E.getLayer(
|
|
8396
|
+
[...p.layerIds, ...p.boundsIds].forEach((C) => {
|
|
8397
|
+
E.getLayer(C) && E.setLayoutProperty(C, "visibility", h);
|
|
8398
8398
|
}), Et(), p.visible || N(s);
|
|
8399
8399
|
}
|
|
8400
8400
|
function zl(s) {
|
|
8401
8401
|
if (!E) return;
|
|
8402
8402
|
const p = $[s];
|
|
8403
8403
|
if (!p?.url) return;
|
|
8404
|
-
const h = De(s),
|
|
8405
|
-
E.getLayer(
|
|
8404
|
+
const h = De(s), C = Qe(s);
|
|
8405
|
+
E.getLayer(C) && E.removeLayer(C), E.getSource(h) && E.removeSource(h), E.addSource(
|
|
8406
8406
|
h,
|
|
8407
8407
|
wl(p.url, p, { safe: !0 })
|
|
8408
8408
|
);
|
|
8409
8409
|
const I = p?.opacity ?? p?.style?.opacity, H = typeof I == "number" ? I : mm;
|
|
8410
8410
|
E.addLayer({
|
|
8411
|
-
id:
|
|
8411
|
+
id: C,
|
|
8412
8412
|
type: "raster",
|
|
8413
8413
|
source: h,
|
|
8414
8414
|
paint: {
|
|
@@ -8430,18 +8430,18 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8430
8430
|
}
|
|
8431
8431
|
function Et() {
|
|
8432
8432
|
if (!E) return;
|
|
8433
|
-
const s = L.value.map((Fe) => Qe(Fe)).filter((Fe) => E.getLayer(Fe)), p = [], h = [],
|
|
8433
|
+
const s = L.value.map((Fe) => Qe(Fe)).filter((Fe) => E.getLayer(Fe)), p = [], h = [], C = [], I = [];
|
|
8434
8434
|
Le.value.forEach((Fe) => {
|
|
8435
8435
|
const tt = oe[Fe];
|
|
8436
8436
|
if (!tt) return;
|
|
8437
8437
|
const Nt = String(tt.config?.url ?? ""), yl = /\.v(?:m)?t(?:\?|$|\/)/i.test(Nt) || /\/vtile(?:\/|\?|$)/i.test(Nt) || Yo(tt.config, Nt, U.value), jt = /\.png(?:\?|$)/i.test(Nt);
|
|
8438
|
-
yl ?
|
|
8438
|
+
yl ? C.push(...tt.layerIds) : jt ? p.push(...tt.layerIds) : h.push(...tt.layerIds), I.push(...tt.boundsIds);
|
|
8439
8439
|
});
|
|
8440
8440
|
const H = [
|
|
8441
8441
|
...s,
|
|
8442
8442
|
...p,
|
|
8443
8443
|
...h,
|
|
8444
|
-
...
|
|
8444
|
+
...C,
|
|
8445
8445
|
...I
|
|
8446
8446
|
];
|
|
8447
8447
|
H.forEach((Fe) => {
|
|
@@ -8464,9 +8464,9 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8464
8464
|
h.setTiles([p]), Et();
|
|
8465
8465
|
return;
|
|
8466
8466
|
}
|
|
8467
|
-
const
|
|
8467
|
+
const C = E.getCenter?.(), I = E.getZoom?.(), H = he?.getAll?.();
|
|
8468
8468
|
E.setStyle(pt(p)), E.once("style.load", () => {
|
|
8469
|
-
if (E && (
|
|
8469
|
+
if (E && (C && Number.isFinite(I) && E.jumpTo({ center: [C.lng, C.lat], zoom: I }), yt(), Ul(), Le.value.forEach((de) => {
|
|
8470
8470
|
const _e = oe[de];
|
|
8471
8471
|
_e && bt(_e);
|
|
8472
8472
|
}), Et(), H?.features?.length && he))
|
|
@@ -8528,8 +8528,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8528
8528
|
return s.flatMap(
|
|
8529
8529
|
(I) => I?.type === "FeatureCollection" ? yn(I) : [h(I)]
|
|
8530
8530
|
).flat().filter(Boolean);
|
|
8531
|
-
const
|
|
8532
|
-
return
|
|
8531
|
+
const C = h(s);
|
|
8532
|
+
return C ? Array.isArray(C) ? C : [C] : [];
|
|
8533
8533
|
}
|
|
8534
8534
|
function Hl(s) {
|
|
8535
8535
|
if (!s.length) return null;
|
|
@@ -8556,8 +8556,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8556
8556
|
}
|
|
8557
8557
|
function ql(s, p) {
|
|
8558
8558
|
if (!Array.isArray(s) || s.length < 4) return null;
|
|
8559
|
-
const
|
|
8560
|
-
return !Number.isInteger(p) || p < 0 || p >=
|
|
8559
|
+
const C = ao(s[0], s[s.length - 1]) ? s.slice(0, -1) : s.slice();
|
|
8560
|
+
return !Number.isInteger(p) || p < 0 || p >= C.length || C.length <= 3 || (C.splice(p, 1), C.length < 3) ? null : [...C, [...C[0]]];
|
|
8561
8561
|
}
|
|
8562
8562
|
function Kl(s, p) {
|
|
8563
8563
|
if (!Array.isArray(s) || s.length < 2 || !Number.isInteger(p) || p < 0 || p >= s.length || s.length <= 2) return null;
|
|
@@ -8568,20 +8568,20 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8568
8568
|
const h = Ft(s);
|
|
8569
8569
|
if (!h || !Array.isArray(p)) return null;
|
|
8570
8570
|
if (h.type === "LineString") {
|
|
8571
|
-
const [
|
|
8571
|
+
const [C] = p, I = Kl(h.coordinates, C);
|
|
8572
8572
|
return I ? (h.coordinates = I, h) : null;
|
|
8573
8573
|
}
|
|
8574
8574
|
if (h.type === "MultiLineString") {
|
|
8575
|
-
const [
|
|
8576
|
-
return de ? (h.coordinates[
|
|
8575
|
+
const [C, I] = p, H = h.coordinates?.[C], de = Kl(H, I);
|
|
8576
|
+
return de ? (h.coordinates[C] = de, h) : null;
|
|
8577
8577
|
}
|
|
8578
8578
|
if (h.type === "Polygon") {
|
|
8579
|
-
const [
|
|
8580
|
-
return de ? (h.coordinates[
|
|
8579
|
+
const [C, I] = p, H = h.coordinates?.[C], de = ql(H, I);
|
|
8580
|
+
return de ? (h.coordinates[C] = de, h) : null;
|
|
8581
8581
|
}
|
|
8582
8582
|
if (h.type === "MultiPolygon") {
|
|
8583
|
-
const [
|
|
8584
|
-
return _e ? (h.coordinates[
|
|
8583
|
+
const [C, I, H] = p, de = h.coordinates?.[C]?.[I], _e = ql(de, H);
|
|
8584
|
+
return _e ? (h.coordinates[C][I] = _e, h) : null;
|
|
8585
8585
|
}
|
|
8586
8586
|
return null;
|
|
8587
8587
|
}
|
|
@@ -8600,22 +8600,22 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8600
8600
|
const p = [
|
|
8601
8601
|
[s.x - 8, s.y - 8],
|
|
8602
8602
|
[s.x + 8, s.y + 8]
|
|
8603
|
-
],
|
|
8603
|
+
], C = E.queryRenderedFeatures(p).find((I) => {
|
|
8604
8604
|
const H = String(I?.properties?.meta ?? "");
|
|
8605
8605
|
return H && H !== "feature" ? !1 : !!Gl(I);
|
|
8606
8606
|
});
|
|
8607
|
-
return Gl(
|
|
8607
|
+
return Gl(C);
|
|
8608
8608
|
}
|
|
8609
8609
|
function io(s, p) {
|
|
8610
8610
|
if (!he || !s || !p.length) return;
|
|
8611
8611
|
const h = Yl(s);
|
|
8612
8612
|
if (!h?.geometry) return;
|
|
8613
|
-
const
|
|
8614
|
-
if (!
|
|
8613
|
+
const C = oo(h.geometry, p);
|
|
8614
|
+
if (!C) return;
|
|
8615
8615
|
const I = {
|
|
8616
8616
|
...h,
|
|
8617
8617
|
id: h.id ?? s,
|
|
8618
|
-
geometry:
|
|
8618
|
+
geometry: C
|
|
8619
8619
|
};
|
|
8620
8620
|
ue = !0, ze = !0;
|
|
8621
8621
|
try {
|
|
@@ -8626,7 +8626,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8626
8626
|
Xt(), Rt();
|
|
8627
8627
|
}
|
|
8628
8628
|
function uo(s) {
|
|
8629
|
-
if (!E || !he || r.value ||
|
|
8629
|
+
if (!E || !he || r.value || v.isRulerActive.value || x.value !== "edit") return;
|
|
8630
8630
|
const p = s?.point;
|
|
8631
8631
|
if (!p) return;
|
|
8632
8632
|
const h = [
|
|
@@ -8643,18 +8643,18 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8643
8643
|
function co(s) {
|
|
8644
8644
|
const p = Jl(s);
|
|
8645
8645
|
if (!p) return null;
|
|
8646
|
-
const [[h,
|
|
8647
|
-
return { lat: (
|
|
8646
|
+
const [[h, C], [I, H]] = p;
|
|
8647
|
+
return { lat: (C + H) / 2, lng: (h + I) / 2 };
|
|
8648
8648
|
}
|
|
8649
8649
|
function Xl(s) {
|
|
8650
8650
|
if (!Array.isArray(s) || s.length < 3) return 0;
|
|
8651
|
-
const p = (
|
|
8652
|
-
const H =
|
|
8651
|
+
const p = (C, I) => {
|
|
8652
|
+
const H = C * 2003750834e-2 / 180, de = Math.log(Math.tan((90 + I) * Math.PI / 360)) / (Math.PI / 180);
|
|
8653
8653
|
return [H, de * 2003750834e-2 / 180];
|
|
8654
8654
|
};
|
|
8655
8655
|
let h = 0;
|
|
8656
|
-
for (let
|
|
8657
|
-
const [I, H] = p(Number(s[
|
|
8656
|
+
for (let C = 0; C < s.length - 1; C += 1) {
|
|
8657
|
+
const [I, H] = p(Number(s[C][0]), Number(s[C][1])), [de, _e] = p(Number(s[C + 1][0]), Number(s[C + 1][1]));
|
|
8658
8658
|
h += I * _e - de * H;
|
|
8659
8659
|
}
|
|
8660
8660
|
return Math.abs(h / 2) / 1e6;
|
|
@@ -8666,8 +8666,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8666
8666
|
return Array.isArray(p) ? Xl(p) : null;
|
|
8667
8667
|
}
|
|
8668
8668
|
return s.type === "MultiPolygon" ? s.coordinates.reduce((p, h) => {
|
|
8669
|
-
const
|
|
8670
|
-
return Array.isArray(
|
|
8669
|
+
const C = h?.[0];
|
|
8670
|
+
return Array.isArray(C) ? p + Xl(C) : p;
|
|
8671
8671
|
}, 0) : null;
|
|
8672
8672
|
}
|
|
8673
8673
|
function dl(s) {
|
|
@@ -8688,18 +8688,18 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8688
8688
|
}
|
|
8689
8689
|
function cl(s) {
|
|
8690
8690
|
if (!s) {
|
|
8691
|
-
const
|
|
8691
|
+
const C = mt[mt.length - 1], I = Ft(C?.geometry ?? null);
|
|
8692
8692
|
Bt = I, dl(I);
|
|
8693
8693
|
return;
|
|
8694
8694
|
}
|
|
8695
|
-
const p = mt.find((
|
|
8695
|
+
const p = mt.find((C) => String(C?.id ?? "") === String(s)) ?? null, h = Ft(p?.geometry ?? null);
|
|
8696
8696
|
Bt = h, dl(h);
|
|
8697
8697
|
}
|
|
8698
8698
|
function fl(s) {
|
|
8699
8699
|
b.value = (s ?? []).map((p, h) => {
|
|
8700
|
-
const
|
|
8700
|
+
const C = String(p?.id ?? `feature-${h + 1}`), I = pl(String(p?.geometry?.type ?? "Feature"));
|
|
8701
8701
|
return {
|
|
8702
|
-
id:
|
|
8702
|
+
id: C,
|
|
8703
8703
|
label: `${I} ${h + 1}`
|
|
8704
8704
|
};
|
|
8705
8705
|
});
|
|
@@ -8731,12 +8731,12 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8731
8731
|
}
|
|
8732
8732
|
function Jl(s) {
|
|
8733
8733
|
if (!s) return null;
|
|
8734
|
-
let p = 1 / 0, h = 1 / 0,
|
|
8734
|
+
let p = 1 / 0, h = 1 / 0, C = -1 / 0, I = -1 / 0;
|
|
8735
8735
|
const H = (de) => {
|
|
8736
8736
|
if (Array.isArray(de)) {
|
|
8737
8737
|
if (de.length >= 2 && Number.isFinite(de[0]) && Number.isFinite(de[1])) {
|
|
8738
8738
|
const _e = Number(de[0]), Fe = Number(de[1]);
|
|
8739
|
-
p = Math.min(p, _e), h = Math.min(h, Fe),
|
|
8739
|
+
p = Math.min(p, _e), h = Math.min(h, Fe), C = Math.max(C, _e), I = Math.max(I, Fe);
|
|
8740
8740
|
return;
|
|
8741
8741
|
}
|
|
8742
8742
|
de.forEach(H);
|
|
@@ -8744,16 +8744,16 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8744
8744
|
};
|
|
8745
8745
|
return H(s.coordinates), !Number.isFinite(p) || !Number.isFinite(h) ? null : [
|
|
8746
8746
|
[p, h],
|
|
8747
|
-
[
|
|
8747
|
+
[C, I]
|
|
8748
8748
|
];
|
|
8749
8749
|
}
|
|
8750
8750
|
function Ql(s) {
|
|
8751
8751
|
if (!E || !s) return;
|
|
8752
8752
|
const p = Jl(s);
|
|
8753
8753
|
if (!p) return;
|
|
8754
|
-
const [[h,
|
|
8755
|
-
if (h === I &&
|
|
8756
|
-
E.easeTo({ center: [h,
|
|
8754
|
+
const [[h, C], [I, H]] = p;
|
|
8755
|
+
if (h === I && C === H) {
|
|
8756
|
+
E.easeTo({ center: [h, C], zoom: Math.max(ee.value, 14) }), R();
|
|
8757
8757
|
return;
|
|
8758
8758
|
}
|
|
8759
8759
|
E.fitBounds(p, { padding: 30, duration: 250, maxZoom: 18 }), R();
|
|
@@ -8768,9 +8768,9 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8768
8768
|
}
|
|
8769
8769
|
function hn() {
|
|
8770
8770
|
if (!he) return null;
|
|
8771
|
-
const p = he.getAll?.()?.features ?? [], h = (H) => !!H && p.some((de) => String(de?.id ?? "") === String(H ?? "")),
|
|
8772
|
-
if (Array.isArray(
|
|
8773
|
-
const H =
|
|
8771
|
+
const p = he.getAll?.()?.features ?? [], h = (H) => !!H && p.some((de) => String(de?.id ?? "") === String(H ?? "")), C = he.getSelectedIds?.();
|
|
8772
|
+
if (Array.isArray(C) && C.length > 0) {
|
|
8773
|
+
const H = C[0];
|
|
8774
8774
|
return H != null ? String(H) : null;
|
|
8775
8775
|
}
|
|
8776
8776
|
if (h(st)) return String(st);
|
|
@@ -8826,7 +8826,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8826
8826
|
}
|
|
8827
8827
|
function Tn(s) {
|
|
8828
8828
|
if (r.value || !he) return;
|
|
8829
|
-
|
|
8829
|
+
v.isRulerActive.value && v.closeRuler(), sn = !0, un(), x.value = s;
|
|
8830
8830
|
const p = s === "marker" ? "draw_point" : s === "polyline" ? "draw_line_string" : s === "rectangle" ? "draw_rectangle" : "draw_polygon";
|
|
8831
8831
|
i.value || (ze = !0, Dn(), ze = !1);
|
|
8832
8832
|
try {
|
|
@@ -8881,18 +8881,18 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8881
8881
|
r.value || be.value?.click();
|
|
8882
8882
|
}
|
|
8883
8883
|
function bo() {
|
|
8884
|
-
r.value || (
|
|
8884
|
+
r.value || (Te.value = !Te.value);
|
|
8885
8885
|
}
|
|
8886
8886
|
function ea(s) {
|
|
8887
|
-
if (!
|
|
8887
|
+
if (!Te.value) return;
|
|
8888
8888
|
const p = se.value;
|
|
8889
|
-
p && !p.contains(s.target) && (
|
|
8889
|
+
p && !p.contains(s.target) && (Te.value = !1);
|
|
8890
8890
|
}
|
|
8891
8891
|
function wo() {
|
|
8892
|
-
|
|
8892
|
+
Te.value = !1, ho();
|
|
8893
8893
|
}
|
|
8894
8894
|
function xo() {
|
|
8895
|
-
r.value || (He.value = [],
|
|
8895
|
+
r.value || (He.value = [], Te.value = !1, Ve.value = !0);
|
|
8896
8896
|
}
|
|
8897
8897
|
function ko() {
|
|
8898
8898
|
Ve.value = !1, He.value = [];
|
|
@@ -8911,7 +8911,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8911
8911
|
He.value = [], In({
|
|
8912
8912
|
type: "Polygon",
|
|
8913
8913
|
coordinates: [s.ring]
|
|
8914
|
-
}), Xt(), Ve.value = !1, s.wasClosedAutomatically &&
|
|
8914
|
+
}), Xt(), Ve.value = !1, s.wasClosedAutomatically && Ie({
|
|
8915
8915
|
type: "info",
|
|
8916
8916
|
title: "Імпорт координат",
|
|
8917
8917
|
message: "Полігон був автоматично замкнений (перша і остання точки різнилися)."
|
|
@@ -8921,13 +8921,13 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8921
8921
|
if (!s.length) return;
|
|
8922
8922
|
const p = 5;
|
|
8923
8923
|
s.slice(0, p).forEach((h) => {
|
|
8924
|
-
const
|
|
8925
|
-
|
|
8924
|
+
const C = h.line > 0 ? `Рядок ${h.line}` : "Загальна помилка";
|
|
8925
|
+
Ie({
|
|
8926
8926
|
type: "warning",
|
|
8927
8927
|
title: "Імпорт координат",
|
|
8928
|
-
message: `${
|
|
8928
|
+
message: `${C} — ${h.message}`
|
|
8929
8929
|
});
|
|
8930
|
-
}), s.length > p &&
|
|
8930
|
+
}), s.length > p && Ie({
|
|
8931
8931
|
type: "warning",
|
|
8932
8932
|
title: "Імпорт координат",
|
|
8933
8933
|
message: `Ще помилок: ${s.length - p}`
|
|
@@ -8935,15 +8935,15 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8935
8935
|
}
|
|
8936
8936
|
function So(s) {
|
|
8937
8937
|
if (r.value || !he) return;
|
|
8938
|
-
|
|
8938
|
+
Te.value = !1;
|
|
8939
8939
|
const p = s.target, h = p.files?.[0];
|
|
8940
8940
|
if (!h) return;
|
|
8941
|
-
const
|
|
8942
|
-
|
|
8941
|
+
const C = new FileReader();
|
|
8942
|
+
C.onload = () => {
|
|
8943
8943
|
try {
|
|
8944
|
-
const I = JSON.parse(String(
|
|
8944
|
+
const I = JSON.parse(String(C.result));
|
|
8945
8945
|
if (!yn(I).length) {
|
|
8946
|
-
|
|
8946
|
+
Ie({
|
|
8947
8947
|
type: "warning",
|
|
8948
8948
|
title: "Імпорт файлу",
|
|
8949
8949
|
message: "Файл не містить коректний GeoJSON-обʼєкт."
|
|
@@ -8952,7 +8952,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8952
8952
|
}
|
|
8953
8953
|
In(I), Xt();
|
|
8954
8954
|
} catch {
|
|
8955
|
-
|
|
8955
|
+
Ie({
|
|
8956
8956
|
type: "error",
|
|
8957
8957
|
title: "Імпорт файлу",
|
|
8958
8958
|
message: "Не вдалося прочитати файл. Перевірте формат GeoJSON/JSON."
|
|
@@ -8960,18 +8960,18 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8960
8960
|
} finally {
|
|
8961
8961
|
p.value = "";
|
|
8962
8962
|
}
|
|
8963
|
-
},
|
|
8964
|
-
|
|
8963
|
+
}, C.onerror = () => {
|
|
8964
|
+
Ie({
|
|
8965
8965
|
type: "error",
|
|
8966
8966
|
title: "Імпорт файлу",
|
|
8967
8967
|
message: "Помилка читання файлу."
|
|
8968
8968
|
}), p.value = "";
|
|
8969
|
-
},
|
|
8969
|
+
}, C.readAsText(h);
|
|
8970
8970
|
}
|
|
8971
8971
|
function Co() {
|
|
8972
8972
|
if (r.value || !he) return;
|
|
8973
|
-
const s = he.getAll(), p = new Blob([JSON.stringify(s, null, 2)], { type: "application/json" }), h = URL.createObjectURL(p),
|
|
8974
|
-
|
|
8973
|
+
const s = he.getAll(), p = new Blob([JSON.stringify(s, null, 2)], { type: "application/json" }), h = URL.createObjectURL(p), C = document.createElement("a");
|
|
8974
|
+
C.href = h, C.download = "data.geojson", C.click(), URL.revokeObjectURL(h);
|
|
8975
8975
|
}
|
|
8976
8976
|
lt(async () => {
|
|
8977
8977
|
if (window.addEventListener("click", ea, !0), !f.value) return;
|
|
@@ -8985,8 +8985,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
8985
8985
|
zoom: ee.value,
|
|
8986
8986
|
attributionControl: !1
|
|
8987
8987
|
}), m.value = E, E.addControl(new ht.NavigationControl({ showCompass: !0 }), "bottom-right"), E.on("error", (h) => {
|
|
8988
|
-
const
|
|
8989
|
-
Sp(
|
|
8988
|
+
const C = h?.error?.message ?? h?.message ?? "";
|
|
8989
|
+
Sp(C);
|
|
8990
8990
|
}), E.on("load", () => {
|
|
8991
8991
|
if (!(!xt || !E)) {
|
|
8992
8992
|
if (he = new xt({
|
|
@@ -9003,31 +9003,31 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9003
9003
|
},
|
|
9004
9004
|
styles: An
|
|
9005
9005
|
}), E.addControl(he), E.on("click", (h) => {
|
|
9006
|
-
if (
|
|
9006
|
+
if (v.isRulerActive.value) {
|
|
9007
9007
|
const I = h?.lngLat;
|
|
9008
9008
|
if (!I) return;
|
|
9009
9009
|
k.value?.addPoint?.({ lat: I.lat, lng: I.lng });
|
|
9010
9010
|
return;
|
|
9011
9011
|
}
|
|
9012
9012
|
if (!he || r.value || x.value !== "edit") return;
|
|
9013
|
-
const
|
|
9014
|
-
!
|
|
9015
|
-
!he || r.value || Rt(
|
|
9013
|
+
const C = so(h?.point);
|
|
9014
|
+
!C || C === st || requestAnimationFrame(() => {
|
|
9015
|
+
!he || r.value || Rt(C);
|
|
9016
9016
|
});
|
|
9017
9017
|
}), E.on("draw.create", () => {
|
|
9018
|
-
if (he && !
|
|
9018
|
+
if (he && !v.isRulerActive.value) {
|
|
9019
9019
|
if (!i.value) {
|
|
9020
9020
|
const h = he.getAll();
|
|
9021
9021
|
if (h.features.length > 1) {
|
|
9022
|
-
const
|
|
9023
|
-
ze = !0, h.features.slice(0, -1).forEach((I) => he.delete(I.id)), ze = !1,
|
|
9022
|
+
const C = h.features[h.features.length - 1];
|
|
9023
|
+
ze = !0, h.features.slice(0, -1).forEach((I) => he.delete(I.id)), ze = !1, C && (ze = !0, he.add(C), ze = !1);
|
|
9024
9024
|
}
|
|
9025
9025
|
}
|
|
9026
9026
|
Xt(), Rt();
|
|
9027
9027
|
}
|
|
9028
9028
|
}), E.on("draw.update", (h) => {
|
|
9029
|
-
if (rn ||
|
|
9030
|
-
const
|
|
9029
|
+
if (rn || v.isRulerActive.value || kt()) return;
|
|
9030
|
+
const C = Array.isArray(h?.features) ? h.features : [], I = h?.action === "move" && C.length > 0 && C.every((H) => H?.geometry?.type === "Point");
|
|
9031
9031
|
if (h?.action === "move") {
|
|
9032
9032
|
if (I) {
|
|
9033
9033
|
Xt();
|
|
@@ -9046,15 +9046,15 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9046
9046
|
}
|
|
9047
9047
|
Xt();
|
|
9048
9048
|
}), E.on("draw.delete", () => {
|
|
9049
|
-
ue || Yt ||
|
|
9049
|
+
ue || Yt || v.isRulerActive.value || x.value === "marker" || x.value === "polyline" || x.value === "polygon" || x.value === "rectangle" || (Xt(), he?.getAll?.()?.features?.length || (st = null), x.value = "", un());
|
|
9050
9050
|
}), E.on("draw.selectionchange", (h) => {
|
|
9051
|
-
if (!he || rn ||
|
|
9051
|
+
if (!he || rn || v.isRulerActive.value || x.value === "marker" || x.value === "polyline" || x.value === "polygon" || x.value === "rectangle")
|
|
9052
9052
|
return;
|
|
9053
|
-
const
|
|
9054
|
-
if (!r.value &&
|
|
9055
|
-
if (x.value === "edit" && st ===
|
|
9053
|
+
const C = h?.features?.[0]?.id !== void 0 && h?.features?.[0]?.id !== null ? String(h.features[0].id) : null;
|
|
9054
|
+
if (!r.value && C) {
|
|
9055
|
+
if (x.value === "edit" && st === C) return;
|
|
9056
9056
|
requestAnimationFrame(() => {
|
|
9057
|
-
!he || r.value || Rt(
|
|
9057
|
+
!he || r.value || Rt(C);
|
|
9058
9058
|
});
|
|
9059
9059
|
return;
|
|
9060
9060
|
}
|
|
@@ -9077,15 +9077,15 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9077
9077
|
});
|
|
9078
9078
|
}
|
|
9079
9079
|
yt(), Ul(), Le.value.forEach((h) => {
|
|
9080
|
-
const
|
|
9081
|
-
|
|
9080
|
+
const C = oe[h];
|
|
9081
|
+
C && bt(C);
|
|
9082
9082
|
}), Et(), ne();
|
|
9083
9083
|
}
|
|
9084
9084
|
}), E.on("contextmenu", uo), E.on("moveend", R), E.on("zoomend", () => {
|
|
9085
9085
|
E && (ee.value = E.getZoom());
|
|
9086
9086
|
}));
|
|
9087
9087
|
}), fn(() => {
|
|
9088
|
-
typeof document < "u" && (document.body.style.overflow = ""), typeof window < "u" && window.removeEventListener("keydown", gl), ke && (clearTimeout(ke), ke = null),
|
|
9088
|
+
typeof document < "u" && (document.body.style.overflow = ""), typeof window < "u" && window.removeEventListener("keydown", gl), ke && (clearTimeout(ke), ke = null), v.isRulerActive.value && v.closeRuler(), window.removeEventListener("click", ea, !0), Object.values(oe).forEach((s) => {
|
|
9089
9089
|
E && it(s);
|
|
9090
9090
|
}), N(), Gt?.remove && Gt.remove(), Gt = null, E?.remove && E.remove(), E = null, he = null, m.value = null;
|
|
9091
9091
|
}), ve(
|
|
@@ -9109,11 +9109,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9109
9109
|
), ve(
|
|
9110
9110
|
() => X.value,
|
|
9111
9111
|
(s) => {
|
|
9112
|
-
const p = Array.isArray(s) ? s : [], h = [],
|
|
9112
|
+
const p = Array.isArray(s) ? s : [], h = [], C = /* @__PURE__ */ new Set();
|
|
9113
9113
|
p.forEach((I, H) => {
|
|
9114
9114
|
if (!I) return;
|
|
9115
9115
|
const de = sl(I, H);
|
|
9116
|
-
h.push(de),
|
|
9116
|
+
h.push(de), C.add(de);
|
|
9117
9117
|
const _e = { ...I, id: de }, Fe = oe[de], tt = Fe?.visible ?? !!_e.visible;
|
|
9118
9118
|
Fe && E && it(Fe), oe[de] = {
|
|
9119
9119
|
id: de,
|
|
@@ -9126,7 +9126,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9126
9126
|
renderToken: Fe?.renderToken ?? 0
|
|
9127
9127
|
};
|
|
9128
9128
|
}), Object.keys(oe).forEach((I) => {
|
|
9129
|
-
if (
|
|
9129
|
+
if (C.has(I)) return;
|
|
9130
9130
|
const H = oe[I];
|
|
9131
9131
|
H && E && it(H), delete oe[I];
|
|
9132
9132
|
}), Le.value = h, E && (Le.value.forEach((I) => {
|
|
@@ -9157,8 +9157,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9157
9157
|
try {
|
|
9158
9158
|
const p = await fetch(`https://data.gki.com.ua/api-user/atu/${s}`);
|
|
9159
9159
|
if (!p?.ok) return;
|
|
9160
|
-
const
|
|
9161
|
-
Array.isArray(
|
|
9160
|
+
const C = (await p.json())?.geometry?.coordinates;
|
|
9161
|
+
Array.isArray(C) && C.length && (Me.value = C);
|
|
9162
9162
|
} catch (p) {
|
|
9163
9163
|
console.error("Failed to fetch KATOTTG bounds", p);
|
|
9164
9164
|
} finally {
|
|
@@ -9239,14 +9239,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9239
9239
|
ref: f,
|
|
9240
9240
|
class: "vs-map-canvas"
|
|
9241
9241
|
}, null, 512),
|
|
9242
|
-
ae.value.search || ae.value.import || ae.value.export ? (u(),
|
|
9242
|
+
ae.value.search || ae.value.import || ae.value.export ? (u(), g("div", Mp, [
|
|
9243
9243
|
ae.value.search ? (u(), xe(_f, {
|
|
9244
9244
|
key: 0,
|
|
9245
9245
|
onGoToCoordinates: yo
|
|
9246
9246
|
})) : K("", !0),
|
|
9247
|
-
ae.value.import || ae.value.export ? (u(),
|
|
9247
|
+
ae.value.import || ae.value.export ? (u(), g("div", Lp, [
|
|
9248
9248
|
d("div", Ap, [
|
|
9249
|
-
ae.value.import ? (u(),
|
|
9249
|
+
ae.value.import ? (u(), g("div", {
|
|
9250
9250
|
key: 0,
|
|
9251
9251
|
ref_key: "importMenuRef",
|
|
9252
9252
|
ref: se,
|
|
@@ -9260,11 +9260,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9260
9260
|
}, [
|
|
9261
9261
|
p[8] || (p[8] = nt(" Імпорт ", -1)),
|
|
9262
9262
|
G(q(pn), {
|
|
9263
|
-
class: ie(["h-3.5 w-3.5 shrink-0 transition-transform", { "rotate-180":
|
|
9263
|
+
class: ie(["h-3.5 w-3.5 shrink-0 transition-transform", { "rotate-180": Te.value }])
|
|
9264
9264
|
}, null, 8, ["class"])
|
|
9265
9265
|
], 8, Vp),
|
|
9266
|
-
|
|
9267
|
-
ae.value.import ? (u(),
|
|
9266
|
+
Te.value ? (u(), g("div", Dp, [
|
|
9267
|
+
ae.value.import ? (u(), g("button", {
|
|
9268
9268
|
key: 0,
|
|
9269
9269
|
type: "button",
|
|
9270
9270
|
class: "block w-full text-left px-3 py-2 hover:bg-gray-100 text-gray-900",
|
|
@@ -9277,7 +9277,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9277
9277
|
}, " З координат ")
|
|
9278
9278
|
])) : K("", !0)
|
|
9279
9279
|
], 512)) : K("", !0),
|
|
9280
|
-
ae.value.export ? (u(),
|
|
9280
|
+
ae.value.export ? (u(), g("button", {
|
|
9281
9281
|
key: 1,
|
|
9282
9282
|
type: "button",
|
|
9283
9283
|
class: "vs-map-action-btn",
|
|
@@ -9327,8 +9327,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9327
9327
|
}, 8, ["visible", "teleport"]),
|
|
9328
9328
|
d("div", Pp, [
|
|
9329
9329
|
d("div", Op, [
|
|
9330
|
-
O.value ? (u(),
|
|
9331
|
-
ae.value.point ? (u(),
|
|
9330
|
+
O.value ? (u(), g(Ae, { key: 0 }, [
|
|
9331
|
+
ae.value.point ? (u(), g("button", {
|
|
9332
9332
|
key: 0,
|
|
9333
9333
|
class: ie(["vs-btn", { "vs-active": x.value === "marker" }]),
|
|
9334
9334
|
title: "Точка",
|
|
@@ -9337,7 +9337,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9337
9337
|
}, [
|
|
9338
9338
|
G(q(Da), { class: "vs-btn-icon" })
|
|
9339
9339
|
], 10, Bp)) : K("", !0),
|
|
9340
|
-
ae.value.line ? (u(),
|
|
9340
|
+
ae.value.line ? (u(), g("button", {
|
|
9341
9341
|
key: 1,
|
|
9342
9342
|
class: ie(["vs-btn", { "vs-active": x.value === "polyline" }]),
|
|
9343
9343
|
title: "Лінія",
|
|
@@ -9346,7 +9346,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9346
9346
|
}, [
|
|
9347
9347
|
G(xc, { class: "vs-btn-icon" })
|
|
9348
9348
|
], 10, Rp)) : K("", !0),
|
|
9349
|
-
ae.value.polygon ? (u(),
|
|
9349
|
+
ae.value.polygon ? (u(), g("button", {
|
|
9350
9350
|
key: 2,
|
|
9351
9351
|
class: ie(["vs-btn", { "vs-active": x.value === "polygon" }]),
|
|
9352
9352
|
title: "Полігон",
|
|
@@ -9355,7 +9355,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9355
9355
|
}, [
|
|
9356
9356
|
G(Sc, { class: "vs-btn-icon" })
|
|
9357
9357
|
], 10, Np)) : K("", !0),
|
|
9358
|
-
ae.value.rectangle ? (u(),
|
|
9358
|
+
ae.value.rectangle ? (u(), g("button", {
|
|
9359
9359
|
key: 3,
|
|
9360
9360
|
class: ie(["vs-btn", { "vs-active": x.value === "rectangle" }]),
|
|
9361
9361
|
title: "Прямокутник",
|
|
@@ -9365,10 +9365,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9365
9365
|
G(Ac, { class: "vs-btn-icon" })
|
|
9366
9366
|
], 10, jp)) : K("", !0)
|
|
9367
9367
|
], 64)) : K("", !0),
|
|
9368
|
-
O.value ? (u(),
|
|
9369
|
-
ae.value.ruler ? (u(),
|
|
9368
|
+
O.value ? (u(), g("div", zp)) : K("", !0),
|
|
9369
|
+
ae.value.ruler ? (u(), g("button", {
|
|
9370
9370
|
key: 2,
|
|
9371
|
-
class: ie(["vs-btn", { "vs-active": q(
|
|
9371
|
+
class: ie(["vs-btn", { "vs-active": q(v).isRulerActive.value }]),
|
|
9372
9372
|
title: "Лінійка",
|
|
9373
9373
|
onClick: M
|
|
9374
9374
|
}, [
|
|
@@ -9389,30 +9389,30 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9389
9389
|
], 8, Up)
|
|
9390
9390
|
])
|
|
9391
9391
|
]),
|
|
9392
|
-
ae.value.ruler && q(
|
|
9392
|
+
ae.value.ruler && q(v).isRulerActive.value ? (u(), xe(gp, {
|
|
9393
9393
|
key: 1,
|
|
9394
9394
|
ref_key: "rulerPanelRefEl",
|
|
9395
9395
|
ref: k,
|
|
9396
|
-
onClose: p[7] || (p[7] = (h) => q(
|
|
9397
|
-
onTabChange: q(
|
|
9398
|
-
onPointsChange: q(
|
|
9399
|
-
onShapeClosedChange: q(
|
|
9396
|
+
onClose: p[7] || (p[7] = (h) => q(v).closeRuler()),
|
|
9397
|
+
onTabChange: q(v).onRulerTabChange,
|
|
9398
|
+
onPointsChange: q(v).onRulerPointsChange,
|
|
9399
|
+
onShapeClosedChange: q(v).onRulerShapeClosedChange
|
|
9400
9400
|
}, null, 8, ["onTabChange", "onPointsChange", "onShapeClosedChange"])) : K("", !0),
|
|
9401
|
-
ae.value.ruler && q(
|
|
9401
|
+
ae.value.ruler && q(v).isRulerActive.value && q(v).hasRulerPoints.value ? (u(), xe(yp, {
|
|
9402
9402
|
key: 2,
|
|
9403
9403
|
map: m.value,
|
|
9404
|
-
points: q(
|
|
9405
|
-
"is-shape-closed": q(
|
|
9406
|
-
"label-mode": q(
|
|
9404
|
+
points: q(v).rulerPoints.value,
|
|
9405
|
+
"is-shape-closed": q(v).rulerShapeClosed.value,
|
|
9406
|
+
"label-mode": q(v).rulerActiveTab.value
|
|
9407
9407
|
}, null, 8, ["map", "points", "is-shape-closed", "label-mode"])) : K("", !0),
|
|
9408
|
-
ct.value.length ? (u(),
|
|
9408
|
+
ct.value.length ? (u(), g("div", {
|
|
9409
9409
|
key: 3,
|
|
9410
9410
|
class: "absolute z-[1500] pointer-events-none",
|
|
9411
9411
|
style: Oe(W.value)
|
|
9412
9412
|
}, [
|
|
9413
9413
|
d("div", Hp, [
|
|
9414
9414
|
d("dl", Wp, [
|
|
9415
|
-
(u(!0),
|
|
9415
|
+
(u(!0), g(Ae, null, Be(ct.value, (h) => (u(), g("div", {
|
|
9416
9416
|
key: `${h.key}-${h.value}`,
|
|
9417
9417
|
class: "flex justify-between gap-2"
|
|
9418
9418
|
}, [
|
|
@@ -9438,31 +9438,31 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9438
9438
|
}, null, 8, ["basemaps", "active-base-key", "tile-overlays", "active-tile-overlay-keys", "vector-overlays", "preview-tile", "disabled"])
|
|
9439
9439
|
])
|
|
9440
9440
|
]),
|
|
9441
|
-
ta.value ? (u(),
|
|
9441
|
+
ta.value ? (u(), g("div", Gp, [
|
|
9442
9442
|
d("div", Xp, [
|
|
9443
9443
|
d("div", Zp, [
|
|
9444
9444
|
p[9] || (p[9] = d("span", { class: "vs-map-status__label" }, "Тип:", -1)),
|
|
9445
9445
|
d("div", Jp, [
|
|
9446
|
-
vl.value.length ? (u(!0),
|
|
9446
|
+
vl.value.length ? (u(!0), g(Ae, { key: 0 }, Be(vl.value, (h, C) => (u(), g(Ae, {
|
|
9447
9447
|
key: h.id
|
|
9448
9448
|
}, [
|
|
9449
|
-
h.interactive ? (u(),
|
|
9449
|
+
h.interactive ? (u(), g("button", {
|
|
9450
9450
|
key: 0,
|
|
9451
9451
|
type: "button",
|
|
9452
9452
|
class: ie(["vs-map-status__chip", { "vs-map-status__chip--active": h.id === q(st) }]),
|
|
9453
9453
|
onClick: (I) => mo(h.id),
|
|
9454
9454
|
disabled: r.value
|
|
9455
|
-
}, ce(h.label), 11, Qp)) : (u(),
|
|
9456
|
-
|
|
9457
|
-
], 64))), 128)) : (u(),
|
|
9455
|
+
}, ce(h.label), 11, Qp)) : (u(), g("span", em, ce(h.label), 1)),
|
|
9456
|
+
C < vl.value.length - 1 ? (u(), g("span", tm, ", ")) : K("", !0)
|
|
9457
|
+
], 64))), 128)) : (u(), g("span", nm, "—"))
|
|
9458
9458
|
])
|
|
9459
9459
|
]),
|
|
9460
9460
|
d("div", lm, [
|
|
9461
9461
|
d("span", am, [
|
|
9462
9462
|
p[10] || (p[10] = d("span", { class: "vs-map-status__label" }, "Центр:", -1)),
|
|
9463
|
-
w.value ? (u(),
|
|
9463
|
+
w.value ? (u(), g("span", om, ce(w.value.center.lng.toFixed(5)) + ", " + ce(w.value.center.lat.toFixed(5)), 1)) : (u(), g("span", rm, "—"))
|
|
9464
9464
|
]),
|
|
9465
|
-
w.value && w.value.areaKm2 !== null ? (u(),
|
|
9465
|
+
w.value && w.value.areaKm2 !== null ? (u(), g("span", sm, [
|
|
9466
9466
|
p[11] || (p[11] = d("span", { class: "vs-map-status__label" }, "Площа:", -1)),
|
|
9467
9467
|
d("span", im, ce(w.value.areaKm2.toFixed(1)) + " km²", 1)
|
|
9468
9468
|
])) : K("", !0),
|
|
@@ -9521,23 +9521,23 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9521
9521
|
}, k = (Z) => {
|
|
9522
9522
|
const F = Z.trim();
|
|
9523
9523
|
F !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [F] : n.unique ? f.value.includes(F) || (f.value = [...f.value, F]) : f.value = [...f.value, F], c.value = "");
|
|
9524
|
-
},
|
|
9524
|
+
}, v = () => {
|
|
9525
9525
|
const Z = c.value;
|
|
9526
9526
|
Z.trim() !== "" && k(Z), c.value = "";
|
|
9527
9527
|
}, M = (Z) => {
|
|
9528
9528
|
const F = f.value.slice();
|
|
9529
9529
|
F.splice(Z, 1), l("update:modelValue", F);
|
|
9530
|
-
},
|
|
9530
|
+
}, S = () => {
|
|
9531
9531
|
l("update:modelValue", []);
|
|
9532
9532
|
}, V = () => {
|
|
9533
9533
|
b.value || (r.value = !0);
|
|
9534
9534
|
}, A = () => {
|
|
9535
|
-
r.value = !1, !b.value &&
|
|
9535
|
+
r.value = !1, !b.value && v();
|
|
9536
9536
|
}, U = (Z) => {
|
|
9537
9537
|
const { key: F } = Z;
|
|
9538
|
-
F === "Enter" ? (Z.preventDefault(),
|
|
9538
|
+
F === "Enter" ? (Z.preventDefault(), v()) : F === "Backspace" && c.value === "" && f.value.length > 0 && M(f.value.length - 1);
|
|
9539
9539
|
};
|
|
9540
|
-
return (Z, F) => (u(),
|
|
9540
|
+
return (Z, F) => (u(), g("div", {
|
|
9541
9541
|
class: "flex gap-1 w-full",
|
|
9542
9542
|
ref_key: "root",
|
|
9543
9543
|
ref: o,
|
|
@@ -9564,7 +9564,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9564
9564
|
ref_key: "chipsRef",
|
|
9565
9565
|
ref: a
|
|
9566
9566
|
}, [
|
|
9567
|
-
(u(!0),
|
|
9567
|
+
(u(!0), g(Ae, null, Be(f.value, (j, B) => (u(), g("div", {
|
|
9568
9568
|
key: B,
|
|
9569
9569
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
9570
9570
|
}, [
|
|
@@ -9584,9 +9584,9 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9584
9584
|
})
|
|
9585
9585
|
], 8, _m)
|
|
9586
9586
|
]))), 128)),
|
|
9587
|
-
x.value ? (u(),
|
|
9587
|
+
x.value ? (u(), g("div", $m, ce(_.value), 1)) : K("", !0),
|
|
9588
9588
|
d("div", Sm, [
|
|
9589
|
-
b.value ? K("", !0) : Re((u(),
|
|
9589
|
+
b.value ? K("", !0) : Re((u(), g("input", {
|
|
9590
9590
|
key: 0,
|
|
9591
9591
|
ref_key: "inputRef",
|
|
9592
9592
|
ref: i,
|
|
@@ -9609,13 +9609,13 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9609
9609
|
])
|
|
9610
9610
|
], 512),
|
|
9611
9611
|
d("div", Mm, [
|
|
9612
|
-
w.value ? (u(),
|
|
9612
|
+
w.value ? (u(), g("button", {
|
|
9613
9613
|
key: 0,
|
|
9614
9614
|
type: "button",
|
|
9615
9615
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
9616
9616
|
"aria-label": "Clear all tags",
|
|
9617
9617
|
disabled: b.value,
|
|
9618
|
-
onClick: Ee(
|
|
9618
|
+
onClick: Ee(S, ["stop"])
|
|
9619
9619
|
}, [
|
|
9620
9620
|
G(q(Ct), { class: "h-4 w-4" })
|
|
9621
9621
|
], 8, Lm)) : K("", !0)
|
|
@@ -9683,7 +9683,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9683
9683
|
const i = t?.value?.[n.parent || ""]?.toString(), r = o(i);
|
|
9684
9684
|
l.value = r.toString();
|
|
9685
9685
|
};
|
|
9686
|
-
return (i, r) => (u(),
|
|
9686
|
+
return (i, r) => (u(), g("div", Vm, [
|
|
9687
9687
|
Re(d("input", {
|
|
9688
9688
|
ref: "vsText",
|
|
9689
9689
|
disabled: i.disabled,
|
|
@@ -9748,7 +9748,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9748
9748
|
() => {
|
|
9749
9749
|
c();
|
|
9750
9750
|
}
|
|
9751
|
-
), (f, _) => (u(),
|
|
9751
|
+
), (f, _) => (u(), g("div", Em, [
|
|
9752
9752
|
Re(d("input", {
|
|
9753
9753
|
disabled: f.disabled,
|
|
9754
9754
|
placeholder: f.placeholder,
|
|
@@ -9762,7 +9762,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9762
9762
|
disabled: l.value || f.disabled || !a.value,
|
|
9763
9763
|
onClick: r
|
|
9764
9764
|
}, [
|
|
9765
|
-
l.value ? (u(),
|
|
9765
|
+
l.value ? (u(), g("span", Bm, "...")) : (u(), g("span", Om, "Gen"))
|
|
9766
9766
|
], 8, Pm)
|
|
9767
9767
|
]));
|
|
9768
9768
|
}
|
|
@@ -9785,48 +9785,48 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9785
9785
|
},
|
|
9786
9786
|
emits: ["update:modelValue"],
|
|
9787
9787
|
setup(e, { emit: t }) {
|
|
9788
|
-
const n = (
|
|
9788
|
+
const n = (v) => `${v}-${Math.random().toString(36).substring(2, 15)}`, l = dt("values"), o = e, a = t, i = o.addButtonText ?? "Додати", r = o.ignore ?? [], c = D([]), f = D(null);
|
|
9789
9789
|
(() => {
|
|
9790
|
-
const
|
|
9791
|
-
c.value = Object.entries(
|
|
9790
|
+
const v = o.parent && l?.value?.[o.parent] || o.modelValue || {};
|
|
9791
|
+
c.value = Object.entries(v).filter(([M]) => !r.includes(M)).map(([M, S]) => ({
|
|
9792
9792
|
id: n("key-value-"),
|
|
9793
9793
|
key: M,
|
|
9794
|
-
value:
|
|
9794
|
+
value: S
|
|
9795
9795
|
}));
|
|
9796
9796
|
})();
|
|
9797
|
-
function x(
|
|
9798
|
-
f.value =
|
|
9797
|
+
function x(v) {
|
|
9798
|
+
f.value = v;
|
|
9799
9799
|
}
|
|
9800
|
-
function w(
|
|
9801
|
-
if (f.value === null || f.value ===
|
|
9800
|
+
function w(v) {
|
|
9801
|
+
if (f.value === null || f.value === v) return;
|
|
9802
9802
|
const M = c.value.splice(f.value, 1)[0];
|
|
9803
|
-
c.value.splice(
|
|
9803
|
+
c.value.splice(v, 0, M), f.value = null;
|
|
9804
9804
|
}
|
|
9805
|
-
const b = y(() => c.value.some((
|
|
9805
|
+
const b = y(() => c.value.some((v) => v.key && !v.value || !v.key && v.value)), m = () => {
|
|
9806
9806
|
c.value.push({ id: n("key-value-"), key: "", value: "" });
|
|
9807
|
-
}, k = (
|
|
9808
|
-
c.value = c.value.filter((M) => M.id !==
|
|
9807
|
+
}, k = (v) => {
|
|
9808
|
+
c.value = c.value.filter((M) => M.id !== v);
|
|
9809
9809
|
};
|
|
9810
9810
|
return ve(
|
|
9811
9811
|
c,
|
|
9812
|
-
(
|
|
9812
|
+
(v) => {
|
|
9813
9813
|
const M = {};
|
|
9814
|
-
|
|
9814
|
+
v.forEach((V) => {
|
|
9815
9815
|
V.key && V.value !== void 0 && (M[V.key] = V.value);
|
|
9816
9816
|
});
|
|
9817
|
-
const
|
|
9817
|
+
const S = {};
|
|
9818
9818
|
r.length && r.forEach((V) => {
|
|
9819
|
-
|
|
9819
|
+
S[V] = o.parent ? l?.value?.[o.parent]?.[V] : void 0;
|
|
9820
9820
|
}), l?.value && o.parent && (l.value[o.parent] = {
|
|
9821
|
-
...
|
|
9821
|
+
...S,
|
|
9822
9822
|
...M
|
|
9823
9823
|
}), a("update:modelValue", M);
|
|
9824
9824
|
},
|
|
9825
9825
|
{ deep: !0 }
|
|
9826
|
-
), (
|
|
9826
|
+
), (v, M) => (u(), g("div", jm, [
|
|
9827
9827
|
d("div", zm, [
|
|
9828
|
-
(u(!0),
|
|
9829
|
-
key:
|
|
9828
|
+
(u(!0), g(Ae, null, Be(c.value, (S, V) => (u(), g("div", {
|
|
9829
|
+
key: S.id,
|
|
9830
9830
|
class: ie(["flex items-center gap-2 w-full", { "opacity-50": f.value === V }]),
|
|
9831
9831
|
draggable: "true",
|
|
9832
9832
|
onDragstart: (A) => x(V),
|
|
@@ -9839,27 +9839,27 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9839
9839
|
]),
|
|
9840
9840
|
d("div", Wm, [
|
|
9841
9841
|
G(kn, {
|
|
9842
|
-
modelValue:
|
|
9843
|
-
"onUpdate:modelValue": (A) =>
|
|
9842
|
+
modelValue: S.key,
|
|
9843
|
+
"onUpdate:modelValue": (A) => S.key = A,
|
|
9844
9844
|
placeholder: "Ключ"
|
|
9845
9845
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
9846
9846
|
]),
|
|
9847
9847
|
d("div", qm, [
|
|
9848
9848
|
G(kn, {
|
|
9849
|
-
modelValue:
|
|
9850
|
-
"onUpdate:modelValue": (A) =>
|
|
9849
|
+
modelValue: S.value,
|
|
9850
|
+
"onUpdate:modelValue": (A) => S.value = A,
|
|
9851
9851
|
placeholder: "Значення"
|
|
9852
9852
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
9853
9853
|
]),
|
|
9854
9854
|
d("button", {
|
|
9855
|
-
onClick: (A) => k(
|
|
9855
|
+
onClick: (A) => k(S.id),
|
|
9856
9856
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
|
|
9857
9857
|
}, [
|
|
9858
9858
|
G(q(Ct), { class: "h-4 w-4" })
|
|
9859
9859
|
], 8, Km)
|
|
9860
9860
|
], 42, Um))), 128))
|
|
9861
9861
|
], 512),
|
|
9862
|
-
c.value.length ? K("", !0) : (u(),
|
|
9862
|
+
c.value.length ? K("", !0) : (u(), g("span", Ym, " Дані для відображення відсутні ")),
|
|
9863
9863
|
d("div", Gm, [
|
|
9864
9864
|
d("button", {
|
|
9865
9865
|
type: "button",
|
|
@@ -9895,49 +9895,49 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9895
9895
|
setup(e) {
|
|
9896
9896
|
const t = e, n = Ke(e, "modelValue"), l = D([]), o = D(null), a = y(() => !!t.disabled), i = y(() => t.placeholder ?? ""), r = y(() => t.addButtonText ?? "Додати");
|
|
9897
9897
|
let c = !1;
|
|
9898
|
-
const f = (
|
|
9899
|
-
const M =
|
|
9900
|
-
l.value = M.map((
|
|
9898
|
+
const f = (v) => `${v}-${Math.random().toString(36).substring(2, 15)}`, _ = (v) => {
|
|
9899
|
+
const M = v ?? n.value ?? [];
|
|
9900
|
+
l.value = M.map((S, V) => ({
|
|
9901
9901
|
id: l.value[V]?.id ?? f("text-array"),
|
|
9902
|
-
value:
|
|
9902
|
+
value: S ?? ""
|
|
9903
9903
|
}));
|
|
9904
9904
|
};
|
|
9905
9905
|
_(), ve(
|
|
9906
9906
|
() => n.value,
|
|
9907
|
-
(
|
|
9907
|
+
(v) => {
|
|
9908
9908
|
if (c) {
|
|
9909
9909
|
c = !1;
|
|
9910
9910
|
return;
|
|
9911
9911
|
}
|
|
9912
|
-
_(
|
|
9912
|
+
_(v || []);
|
|
9913
9913
|
},
|
|
9914
9914
|
{ deep: !0 }
|
|
9915
9915
|
), ve(
|
|
9916
9916
|
l,
|
|
9917
|
-
(
|
|
9918
|
-
c = !0, n.value =
|
|
9917
|
+
(v) => {
|
|
9918
|
+
c = !0, n.value = v.map((M) => M.value).filter((M) => M != null && M !== "");
|
|
9919
9919
|
},
|
|
9920
9920
|
{ deep: !0 }
|
|
9921
9921
|
);
|
|
9922
|
-
const x = y(() => a.value || l.value.some((
|
|
9922
|
+
const x = y(() => a.value || l.value.some((v) => !v.value));
|
|
9923
9923
|
function w() {
|
|
9924
9924
|
x.value || (l.value = [...l.value, { id: f("text-array"), value: "" }]);
|
|
9925
9925
|
}
|
|
9926
|
-
function b(
|
|
9927
|
-
a.value || (l.value = l.value.filter((M) => M.id !==
|
|
9926
|
+
function b(v) {
|
|
9927
|
+
a.value || (l.value = l.value.filter((M) => M.id !== v));
|
|
9928
9928
|
}
|
|
9929
|
-
function m(
|
|
9930
|
-
a.value || (o.value =
|
|
9929
|
+
function m(v) {
|
|
9930
|
+
a.value || (o.value = v);
|
|
9931
9931
|
}
|
|
9932
|
-
function k(
|
|
9933
|
-
if (a.value || o.value === null || o.value ===
|
|
9934
|
-
const M = [...l.value], [
|
|
9935
|
-
M.splice(
|
|
9932
|
+
function k(v) {
|
|
9933
|
+
if (a.value || o.value === null || o.value === v) return;
|
|
9934
|
+
const M = [...l.value], [S] = M.splice(o.value, 1);
|
|
9935
|
+
M.splice(v, 0, S), l.value = M, o.value = null;
|
|
9936
9936
|
}
|
|
9937
|
-
return (
|
|
9937
|
+
return (v, M) => (u(), g("div", Qm, [
|
|
9938
9938
|
d("div", ev, [
|
|
9939
|
-
(u(!0),
|
|
9940
|
-
key:
|
|
9939
|
+
(u(!0), g(Ae, null, Be(l.value, (S, V) => (u(), g("div", {
|
|
9940
|
+
key: S.id,
|
|
9941
9941
|
class: ie(["flex items-center gap-2 w-full", { "opacity-50": o.value === V }]),
|
|
9942
9942
|
draggable: "true",
|
|
9943
9943
|
onDragstart: (A) => m(V),
|
|
@@ -9953,39 +9953,39 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9953
9953
|
G(q(cn), { class: "h-4 w-4" })
|
|
9954
9954
|
], 8, nv),
|
|
9955
9955
|
d("div", lv, [
|
|
9956
|
-
|
|
9956
|
+
v.inputType === "text" ? (u(), xe(kn, {
|
|
9957
9957
|
key: 0,
|
|
9958
|
-
modelValue:
|
|
9959
|
-
"onUpdate:modelValue": (A) =>
|
|
9958
|
+
modelValue: S.value,
|
|
9959
|
+
"onUpdate:modelValue": (A) => S.value = A,
|
|
9960
9960
|
disabled: a.value,
|
|
9961
9961
|
placeholder: i.value
|
|
9962
9962
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
9963
|
-
|
|
9963
|
+
v.inputType === "tel" ? (u(), xe(Oa, {
|
|
9964
9964
|
key: 1,
|
|
9965
|
-
modelValue:
|
|
9966
|
-
"onUpdate:modelValue": (A) =>
|
|
9965
|
+
modelValue: S.value,
|
|
9966
|
+
"onUpdate:modelValue": (A) => S.value = A,
|
|
9967
9967
|
disabled: a.value,
|
|
9968
9968
|
placeholder: i.value
|
|
9969
9969
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
9970
|
-
|
|
9970
|
+
v.inputType === "email" ? (u(), xe(Pa, {
|
|
9971
9971
|
key: 2,
|
|
9972
|
-
modelValue:
|
|
9973
|
-
"onUpdate:modelValue": (A) =>
|
|
9972
|
+
modelValue: S.value,
|
|
9973
|
+
"onUpdate:modelValue": (A) => S.value = A,
|
|
9974
9974
|
disabled: a.value,
|
|
9975
9975
|
placeholder: i.value
|
|
9976
9976
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : K("", !0),
|
|
9977
|
-
|
|
9977
|
+
v.inputType === "mask" ? (u(), xe(Fl, {
|
|
9978
9978
|
key: 3,
|
|
9979
|
-
modelValue:
|
|
9980
|
-
"onUpdate:modelValue": (A) =>
|
|
9981
|
-
mask:
|
|
9979
|
+
modelValue: S.value,
|
|
9980
|
+
"onUpdate:modelValue": (A) => S.value = A,
|
|
9981
|
+
mask: v.mask,
|
|
9982
9982
|
disabled: a.value,
|
|
9983
9983
|
placeholder: i.value
|
|
9984
9984
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "mask", "disabled", "placeholder"])) : K("", !0)
|
|
9985
9985
|
]),
|
|
9986
9986
|
d("button", {
|
|
9987
9987
|
type: "button",
|
|
9988
|
-
onClick: (A) => b(
|
|
9988
|
+
onClick: (A) => b(S.id),
|
|
9989
9989
|
disabled: a.value,
|
|
9990
9990
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"
|
|
9991
9991
|
}, [
|
|
@@ -9993,7 +9993,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
9993
9993
|
], 8, av)
|
|
9994
9994
|
], 42, tv))), 128))
|
|
9995
9995
|
], 512),
|
|
9996
|
-
l.value.length ? K("", !0) : (u(),
|
|
9996
|
+
l.value.length ? K("", !0) : (u(), g("span", ov, " Дані для відображення відсутні ")),
|
|
9997
9997
|
d("div", rv, [
|
|
9998
9998
|
d("button", {
|
|
9999
9999
|
type: "button",
|
|
@@ -10026,7 +10026,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10026
10026
|
get: () => n.modelValue || "#000000",
|
|
10027
10027
|
set: (r) => o("update:modelValue", r)
|
|
10028
10028
|
}), i = y(() => !!n.disabled);
|
|
10029
|
-
return (r, c) => (u(),
|
|
10029
|
+
return (r, c) => (u(), g("div", dv, [
|
|
10030
10030
|
Re(d("input", {
|
|
10031
10031
|
type: "color",
|
|
10032
10032
|
"onUpdate:modelValue": c[0] || (c[0] = (f) => a.value = f),
|
|
@@ -10076,7 +10076,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10076
10076
|
}, c = (_) => {
|
|
10077
10077
|
Number(n.min) >= 0 && _.key === "-" && _.preventDefault();
|
|
10078
10078
|
}, f = y(() => !!n.disabled);
|
|
10079
|
-
return (_, x) => (u(),
|
|
10079
|
+
return (_, x) => (u(), g("div", mv, [
|
|
10080
10080
|
Re(d("input", {
|
|
10081
10081
|
type: "range",
|
|
10082
10082
|
"onUpdate:modelValue": x[0] || (x[0] = (w) => i.value = w),
|
|
@@ -10135,13 +10135,13 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10135
10135
|
]);
|
|
10136
10136
|
});
|
|
10137
10137
|
const c = D({}), f = D({});
|
|
10138
|
-
function _(k,
|
|
10139
|
-
k && (c.value[
|
|
10138
|
+
function _(k, v) {
|
|
10139
|
+
k && (c.value[v] = k);
|
|
10140
10140
|
}
|
|
10141
|
-
async function x(k,
|
|
10141
|
+
async function x(k, v) {
|
|
10142
10142
|
if (!k || t.inputType !== "mask") return;
|
|
10143
10143
|
const { default: M } = await import("./index-W-qQIppj.js");
|
|
10144
|
-
f.value[
|
|
10144
|
+
f.value[v] && f.value[v].destroy(), f.value[v] = M(k, {
|
|
10145
10145
|
mask: t.mask || "",
|
|
10146
10146
|
definitions: {
|
|
10147
10147
|
9: /[0-9]/,
|
|
@@ -10149,35 +10149,35 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10149
10149
|
"*": /[a-zA-Z0-9]/
|
|
10150
10150
|
},
|
|
10151
10151
|
lazy: !1
|
|
10152
|
-
}), f.value[
|
|
10153
|
-
const
|
|
10154
|
-
|
|
10155
|
-
}), f.value[
|
|
10156
|
-
const
|
|
10157
|
-
|
|
10158
|
-
}), a.value?.[
|
|
10159
|
-
}
|
|
10160
|
-
function w(k,
|
|
10152
|
+
}), f.value[v].on("accept", () => {
|
|
10153
|
+
const S = [...a.value || []];
|
|
10154
|
+
S[v] = t.unmask ? f.value[v].unmaskedValue : f.value[v].value, a.value = S;
|
|
10155
|
+
}), f.value[v].on("complete", () => {
|
|
10156
|
+
const S = [...a.value || []];
|
|
10157
|
+
S[v] = t.unmask ? f.value[v].unmaskedValue : f.value[v].value, a.value = S;
|
|
10158
|
+
}), a.value?.[v] && (f.value[v].value = a.value[v]);
|
|
10159
|
+
}
|
|
10160
|
+
function w(k, v) {
|
|
10161
10161
|
if (i.value) return;
|
|
10162
|
-
const M = k.target.value ?? null,
|
|
10163
|
-
|
|
10162
|
+
const M = k.target.value ?? null, S = [...a.value];
|
|
10163
|
+
S[v] = t.inputType === "text" ? M : Number(M), a.value = S;
|
|
10164
10164
|
}
|
|
10165
10165
|
function b() {
|
|
10166
10166
|
n.value += 1;
|
|
10167
10167
|
const k = t.inputType === "text" || t.inputType === "mask" ? null : 0;
|
|
10168
10168
|
a.value = [...a.value, k], t.inputType === "mask" && setTimeout(() => {
|
|
10169
|
-
const
|
|
10170
|
-
c.value[
|
|
10169
|
+
const v = n.value - 1;
|
|
10170
|
+
c.value[v] && x(c.value[v], v);
|
|
10171
10171
|
}, 0);
|
|
10172
10172
|
}
|
|
10173
10173
|
function m(k) {
|
|
10174
10174
|
if (n.value > 1) {
|
|
10175
|
-
f.value[k] && (f.value[k].destroy(), delete f.value[k]), n.value -= 1, a.value = a.value.filter((M,
|
|
10176
|
-
const
|
|
10175
|
+
f.value[k] && (f.value[k].destroy(), delete f.value[k]), n.value -= 1, a.value = a.value.filter((M, S) => S !== k);
|
|
10176
|
+
const v = {};
|
|
10177
10177
|
Object.keys(f.value).forEach((M) => {
|
|
10178
|
-
const
|
|
10179
|
-
|
|
10180
|
-
}), f.value =
|
|
10178
|
+
const S = parseInt(M, 10);
|
|
10179
|
+
S > k ? v[S - 1] = f.value[S] : S < k && (v[S] = f.value[S]);
|
|
10180
|
+
}), f.value = v;
|
|
10181
10181
|
}
|
|
10182
10182
|
}
|
|
10183
10183
|
return lt(() => {
|
|
@@ -10189,8 +10189,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10189
10189
|
k && k.destroy();
|
|
10190
10190
|
});
|
|
10191
10191
|
}), ve(() => t.mask, (k) => {
|
|
10192
|
-
t.inputType === "mask" && Object.values(f.value).forEach((
|
|
10193
|
-
|
|
10192
|
+
t.inputType === "mask" && Object.values(f.value).forEach((v) => {
|
|
10193
|
+
v && v.updateOptions({
|
|
10194
10194
|
mask: k,
|
|
10195
10195
|
definitions: {
|
|
10196
10196
|
9: /[0-9]/,
|
|
@@ -10200,21 +10200,21 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10200
10200
|
});
|
|
10201
10201
|
});
|
|
10202
10202
|
}), ve(a, (k) => {
|
|
10203
|
-
t.inputType === "mask" && k && k.forEach((
|
|
10204
|
-
f.value[M] && f.value[M].value !==
|
|
10203
|
+
t.inputType === "mask" && k && k.forEach((v, M) => {
|
|
10204
|
+
f.value[M] && f.value[M].value !== v && (f.value[M].value = v || "");
|
|
10205
10205
|
});
|
|
10206
|
-
}, { deep: !0 }), (k,
|
|
10206
|
+
}, { deep: !0 }), (k, v) => (u(), g("div", {
|
|
10207
10207
|
class: ie(["grid gap-2", `grid-cols-${l.value}`])
|
|
10208
10208
|
}, [
|
|
10209
|
-
(u(!0),
|
|
10209
|
+
(u(!0), g(Ae, null, Be(n.value, (M) => (u(), g("div", {
|
|
10210
10210
|
key: M,
|
|
10211
10211
|
class: "flex items-center gap-2 w-full"
|
|
10212
10212
|
}, [
|
|
10213
|
-
k.inputType === "mask" ? (u(),
|
|
10213
|
+
k.inputType === "mask" ? (u(), g("input", {
|
|
10214
10214
|
key: 0,
|
|
10215
10215
|
type: "text",
|
|
10216
10216
|
ref_for: !0,
|
|
10217
|
-
ref: (
|
|
10217
|
+
ref: (S) => _(S, M - 1),
|
|
10218
10218
|
placeholder: k.placeholder,
|
|
10219
10219
|
disabled: k.disabled,
|
|
10220
10220
|
name: `${k.name}[${M - 1}]`,
|
|
@@ -10222,11 +10222,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10222
10222
|
style: {
|
|
10223
10223
|
border: "1px solid #CFD9E0"
|
|
10224
10224
|
}
|
|
10225
|
-
}, null, 10, hv)) : (u(),
|
|
10225
|
+
}, null, 10, hv)) : (u(), g("input", {
|
|
10226
10226
|
key: 1,
|
|
10227
10227
|
type: k.inputType,
|
|
10228
10228
|
value: a.value?.[M - 1],
|
|
10229
|
-
onInput: (
|
|
10229
|
+
onInput: (S) => w(S, M - 1),
|
|
10230
10230
|
placeholder: r.value,
|
|
10231
10231
|
disabled: i.value,
|
|
10232
10232
|
class: ie(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(o), { "!border-red-600": k.error }]]),
|
|
@@ -10234,7 +10234,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10234
10234
|
border: "1px solid #CFD9E0"
|
|
10235
10235
|
}
|
|
10236
10236
|
}, null, 42, bv)),
|
|
10237
|
-
!k.disabled && M === n.value && k.isAdded ? (u(),
|
|
10237
|
+
!k.disabled && M === n.value && k.isAdded ? (u(), g("button", {
|
|
10238
10238
|
key: 2,
|
|
10239
10239
|
type: "button",
|
|
10240
10240
|
onClick: Ee(b, ["stop"]),
|
|
@@ -10242,10 +10242,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10242
10242
|
}, [
|
|
10243
10243
|
G(q(Ot), { class: "h-4 w-4" })
|
|
10244
10244
|
])) : K("", !0),
|
|
10245
|
-
!k.disabled && n.value > 1 && k.isAdded ? (u(),
|
|
10245
|
+
!k.disabled && n.value > 1 && k.isAdded ? (u(), g("button", {
|
|
10246
10246
|
key: 3,
|
|
10247
10247
|
type: "button",
|
|
10248
|
-
onClick: Ee((
|
|
10248
|
+
onClick: Ee((S) => m(M - 1), ["stop"]),
|
|
10249
10249
|
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"
|
|
10250
10250
|
}, [
|
|
10251
10251
|
G(q(Ct), { class: "h-4 w-4" })
|
|
@@ -10288,8 +10288,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10288
10288
|
}),
|
|
10289
10289
|
emits: /* @__PURE__ */ Ue(["change", "update:modelValue", "value-selected"], ["update:modelValue"]),
|
|
10290
10290
|
setup(e, { emit: t }) {
|
|
10291
|
-
const n = e, l = t, o = Ke(e, "modelValue"), a = D([]), i = D(n.options ?? []), r = D({}), c = D({}), f = D({ keyword: "", parent: null }), _ = D(""), x = D(!1), w = D(null), b = D(null), m = D(null), k = D(null),
|
|
10292
|
-
let
|
|
10291
|
+
const n = e, l = t, o = Ke(e, "modelValue"), a = D([]), i = D(n.options ?? []), r = D({}), c = D({}), f = D({ keyword: "", parent: null }), _ = D(""), x = D(!1), w = D(null), b = D(null), m = D(null), k = D(null), v = D(null), M = D({});
|
|
10292
|
+
let S = !1, V = !1;
|
|
10293
10293
|
const A = dt("values"), U = y(() => !!n.disabled), Z = y(() => n.placeholder ?? "Оберіть значення"), F = y(() => n.search !== !1), j = y(() => {
|
|
10294
10294
|
const $ = n.parent ?? n.parentValue;
|
|
10295
10295
|
return $ ? String($) : "";
|
|
@@ -10313,7 +10313,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10313
10313
|
const $ = n.prefix ?? "api", L = n.api ?? `/${$}/suggest/${n.data}`;
|
|
10314
10314
|
return `${n.host ?? ""}${L}`;
|
|
10315
10315
|
}, J = () => {
|
|
10316
|
-
a.value.length && (
|
|
10316
|
+
a.value.length && (S = !0, a.value = a.value.map(($) => ({
|
|
10317
10317
|
...$,
|
|
10318
10318
|
text: r.value[P($.id)] ?? $.text
|
|
10319
10319
|
})));
|
|
@@ -10391,11 +10391,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10391
10391
|
transform: ht ? "none" : "translateY(-100%)",
|
|
10392
10392
|
top: ht ? `${$.bottom + De}px` : `${$.top - De}px`
|
|
10393
10393
|
};
|
|
10394
|
-
},
|
|
10395
|
-
U.value || x.value || (se.value = $, await R(_.value.trim()), x.value = !0, await et(), Me(),
|
|
10394
|
+
}, Te = async ($ = "click") => {
|
|
10395
|
+
U.value || x.value || (se.value = $, await R(_.value.trim()), x.value = !0, await et(), Me(), v.value?.focus());
|
|
10396
10396
|
}, Ve = () => {
|
|
10397
10397
|
x.value = !1, se.value = null, et(() => {
|
|
10398
|
-
|
|
10398
|
+
v.value?.blur();
|
|
10399
10399
|
});
|
|
10400
10400
|
}, He = async ($) => {
|
|
10401
10401
|
if ($.stopPropagation(), !U.value) {
|
|
@@ -10407,7 +10407,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10407
10407
|
Ve();
|
|
10408
10408
|
return;
|
|
10409
10409
|
}
|
|
10410
|
-
await
|
|
10410
|
+
await Te("click");
|
|
10411
10411
|
}
|
|
10412
10412
|
}, Ze = ($) => {
|
|
10413
10413
|
$.key === "Escape" && Ve();
|
|
@@ -10439,7 +10439,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10439
10439
|
key: pe($.id)
|
|
10440
10440
|
};
|
|
10441
10441
|
a.value = [...a.value, O], Le($), _.value = "", et(() => {
|
|
10442
|
-
|
|
10442
|
+
v.value?.focus();
|
|
10443
10443
|
});
|
|
10444
10444
|
}, Le = ($) => {
|
|
10445
10445
|
const L = a.value.map((O) => O.id);
|
|
@@ -10494,11 +10494,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10494
10494
|
text: r.value[P(me)] ?? String(me),
|
|
10495
10495
|
key: pe(me)
|
|
10496
10496
|
}));
|
|
10497
|
-
|
|
10497
|
+
S = !0, a.value = O;
|
|
10498
10498
|
};
|
|
10499
10499
|
ve(a, ($) => {
|
|
10500
|
-
if (
|
|
10501
|
-
|
|
10500
|
+
if (S) {
|
|
10501
|
+
S = !1;
|
|
10502
10502
|
return;
|
|
10503
10503
|
}
|
|
10504
10504
|
const L = $.map((O) => O.id);
|
|
@@ -10531,7 +10531,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10531
10531
|
document.addEventListener("click", ze, !0), window.addEventListener("keydown", Ze), window.addEventListener("scroll", Je, !0), await qe();
|
|
10532
10532
|
}), fn(() => {
|
|
10533
10533
|
document.removeEventListener("click", ze, !0), window.removeEventListener("keydown", Ze), window.removeEventListener("scroll", Je, !0);
|
|
10534
|
-
}), ($, L) => (u(),
|
|
10534
|
+
}), ($, L) => (u(), g(Ae, null, [
|
|
10535
10535
|
G(q(el), {
|
|
10536
10536
|
visible: q(Ye),
|
|
10537
10537
|
"onUpdate:visible": L[1] || (L[1] = (O) => Yn(Ye) ? Ye.value = O : null),
|
|
@@ -10579,12 +10579,12 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10579
10579
|
}, [
|
|
10580
10580
|
Re(d("input", {
|
|
10581
10581
|
ref_key: "inputRef",
|
|
10582
|
-
ref:
|
|
10582
|
+
ref: v,
|
|
10583
10583
|
"onUpdate:modelValue": L[2] || (L[2] = (O) => _.value = O),
|
|
10584
10584
|
placeholder: Z.value,
|
|
10585
10585
|
disabled: U.value,
|
|
10586
10586
|
readonly: !F.value,
|
|
10587
|
-
onFocus: L[3] || (L[3] = () =>
|
|
10587
|
+
onFocus: L[3] || (L[3] = () => Te("focus")),
|
|
10588
10588
|
onKeydown: ue,
|
|
10589
10589
|
class: "flex-1 bg-transparent border-0 outline-none px-0 py-1 text-sm text-stone-900 placeholder:text-stone-400"
|
|
10590
10590
|
}, null, 40, $v), [
|
|
@@ -10600,7 +10600,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10600
10600
|
(u(), xe(Kt, { to: "body" }, [
|
|
10601
10601
|
G(Jn, { name: "fade" }, {
|
|
10602
10602
|
default: ut(() => [
|
|
10603
|
-
x.value ? (u(),
|
|
10603
|
+
x.value ? (u(), g("div", {
|
|
10604
10604
|
key: 0,
|
|
10605
10605
|
ref_key: "dropdownRef",
|
|
10606
10606
|
ref: k,
|
|
@@ -10608,14 +10608,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10608
10608
|
style: Oe(M.value)
|
|
10609
10609
|
}, [
|
|
10610
10610
|
d("div", Sv, [
|
|
10611
|
-
(u(!0),
|
|
10611
|
+
(u(!0), g(Ae, null, Be(X.value, (O) => (u(), g("button", {
|
|
10612
10612
|
key: P(O.id),
|
|
10613
10613
|
type: "button",
|
|
10614
10614
|
class: "w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",
|
|
10615
10615
|
onClick: Ee((me) => oe(O), ["stop"]),
|
|
10616
10616
|
disabled: U.value
|
|
10617
10617
|
}, ce(Q(O)), 9, Cv))), 128)),
|
|
10618
|
-
X.value.length === 0 ? (u(),
|
|
10618
|
+
X.value.length === 0 ? (u(), g("p", Mv, " Немає варіантів ")) : K("", !0)
|
|
10619
10619
|
])
|
|
10620
10620
|
], 4)) : K("", !0)
|
|
10621
10621
|
]),
|
|
@@ -10623,7 +10623,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10623
10623
|
})
|
|
10624
10624
|
]))
|
|
10625
10625
|
]),
|
|
10626
|
-
n.add ? (u(),
|
|
10626
|
+
n.add ? (u(), g("button", {
|
|
10627
10627
|
key: 0,
|
|
10628
10628
|
onClick: L[5] || (L[5] = //@ts-ignore
|
|
10629
10629
|
(...O) => q(Ce) && q(Ce)(...O)),
|
|
@@ -10636,7 +10636,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10636
10636
|
], 8, Lv)) : K("", !0)
|
|
10637
10637
|
]),
|
|
10638
10638
|
d("div", Av, [
|
|
10639
|
-
(u(!0),
|
|
10639
|
+
(u(!0), g(Ae, null, Be(a.value, (O, me) => (u(), g("div", {
|
|
10640
10640
|
key: O.key,
|
|
10641
10641
|
class: ie(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2", { "opacity-60": w.value === me }]),
|
|
10642
10642
|
draggable: "true",
|
|
@@ -10668,7 +10668,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10668
10668
|
G(q(Ct), { class: "h-4 w-4" })
|
|
10669
10669
|
], 8, Tv)
|
|
10670
10670
|
], 42, Vv))), 128)),
|
|
10671
|
-
a.value.length === 0 ? (u(),
|
|
10671
|
+
a.value.length === 0 ? (u(), g("p", Ev, "Немає вибраних значень")) : K("", !0)
|
|
10672
10672
|
])
|
|
10673
10673
|
], 512)
|
|
10674
10674
|
], 64));
|
|
@@ -10725,15 +10725,15 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10725
10725
|
if (!F || F.length !== 4) return null;
|
|
10726
10726
|
const j = F.map(Number);
|
|
10727
10727
|
return j.some((B) => Number.isNaN(B)) ? null : j;
|
|
10728
|
-
}),
|
|
10728
|
+
}), v = y(() => {
|
|
10729
10729
|
const F = k.value;
|
|
10730
10730
|
if (!F) return "";
|
|
10731
10731
|
const [j, B, P, Q] = F;
|
|
10732
10732
|
return `${j},${Math.max(B, Q)},${P},${Math.min(B, Q)}`;
|
|
10733
10733
|
});
|
|
10734
|
-
y(() =>
|
|
10734
|
+
y(() => v.value ? "1" : "0");
|
|
10735
10735
|
const M = dt("values");
|
|
10736
|
-
function
|
|
10736
|
+
function S() {
|
|
10737
10737
|
!b.value && r.value.trim() && V();
|
|
10738
10738
|
}
|
|
10739
10739
|
async function V() {
|
|
@@ -10777,7 +10777,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10777
10777
|
};
|
|
10778
10778
|
return l.api.replace(n, (B, P) => j[P.trim()] ?? "");
|
|
10779
10779
|
}
|
|
10780
|
-
return (F, j) => (u(),
|
|
10780
|
+
return (F, j) => (u(), g("div", Pv, [
|
|
10781
10781
|
d("div", Ov, [
|
|
10782
10782
|
Re(d("input", {
|
|
10783
10783
|
type: "text",
|
|
@@ -10786,11 +10786,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10786
10786
|
disabled: b.value,
|
|
10787
10787
|
class: ie(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500", [q(a), { "!border-red-600": l.error }]]),
|
|
10788
10788
|
style: { border: "1px solid #CFD9E0" },
|
|
10789
|
-
onKeydown: Ao(Ee(
|
|
10789
|
+
onKeydown: Ao(Ee(S, ["prevent"]), ["enter"])
|
|
10790
10790
|
}, null, 42, Bv), [
|
|
10791
10791
|
[at, r.value]
|
|
10792
10792
|
]),
|
|
10793
|
-
f.value.length ? (u(),
|
|
10793
|
+
f.value.length ? (u(), g("button", {
|
|
10794
10794
|
key: 0,
|
|
10795
10795
|
type: "button",
|
|
10796
10796
|
class: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-blue-600",
|
|
@@ -10815,7 +10815,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10815
10815
|
}))
|
|
10816
10816
|
], 8, Rv),
|
|
10817
10817
|
(u(), xe(Kt, { to: "body" }, [
|
|
10818
|
-
_.value ? (u(),
|
|
10818
|
+
_.value ? (u(), g("div", Nv, [
|
|
10819
10819
|
d("div", jv, [
|
|
10820
10820
|
d("div", zv, [
|
|
10821
10821
|
j[2] || (j[2] = d("span", null, "Результати пошуку", -1)),
|
|
@@ -10828,13 +10828,13 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10828
10828
|
])
|
|
10829
10829
|
]),
|
|
10830
10830
|
d("ul", null, [
|
|
10831
|
-
(u(!0),
|
|
10831
|
+
(u(!0), g(Ae, null, Be(f.value, (B, P) => (u(), g("li", {
|
|
10832
10832
|
key: P,
|
|
10833
10833
|
onClick: (Q) => U(B),
|
|
10834
10834
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100 border-b text-sm"
|
|
10835
10835
|
}, ce(B.display_name), 9, Uv))), 128))
|
|
10836
10836
|
]),
|
|
10837
|
-
f.value.length ? K("", !0) : (u(),
|
|
10837
|
+
f.value.length ? K("", !0) : (u(), g("div", Hv, " Не знайдено результатів "))
|
|
10838
10838
|
])
|
|
10839
10839
|
])) : K("", !0)
|
|
10840
10840
|
]))
|
|
@@ -10866,45 +10866,45 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10866
10866
|
}),
|
|
10867
10867
|
emits: ["update:modelValue"],
|
|
10868
10868
|
setup(e) {
|
|
10869
|
-
const t = e, n = Ke(e, "modelValue"), l = y(() => Array.isArray(n.value) ? n.value : []), o = D([]), a = y(() => t.schema?.map((
|
|
10870
|
-
...
|
|
10871
|
-
disabled: t.disabled ||
|
|
10872
|
-
})) ?? []), i = y(() => a.value.map((
|
|
10873
|
-
const V = Number(
|
|
10869
|
+
const t = e, n = Ke(e, "modelValue"), l = y(() => Array.isArray(n.value) ? n.value : []), o = D([]), a = y(() => t.schema?.map((v) => ({
|
|
10870
|
+
...v,
|
|
10871
|
+
disabled: t.disabled || v.disabled
|
|
10872
|
+
})) ?? []), i = y(() => a.value.map((v) => k(v))), r = y(() => a.value.reduce((M, S) => {
|
|
10873
|
+
const V = Number(S?.col ?? 12);
|
|
10874
10874
|
return M + (Number.isFinite(V) && V > 0 ? V : 12);
|
|
10875
10875
|
}, 0) > 12), c = y(() => t.disabled ? !1 : t.maxItems ? l.value.length < t.maxItems : !0), f = y(() => t.disabled || l.value.length <= (t.minItems || 0));
|
|
10876
10876
|
ve(() => l.value.length, () => {
|
|
10877
10877
|
_(), x();
|
|
10878
10878
|
}, { immediate: !0 }), ve(() => t.schema, x, { immediate: !0, deep: !0 });
|
|
10879
10879
|
function _() {
|
|
10880
|
-
const
|
|
10881
|
-
o.value.length <
|
|
10880
|
+
const v = l.value.length;
|
|
10881
|
+
o.value.length < v ? o.value = [...o.value, ...Array.from({ length: v - o.value.length }, () => Nl())] : o.value.length > v && o.value.splice(v);
|
|
10882
10882
|
}
|
|
10883
10883
|
function x() {
|
|
10884
10884
|
if (!t.minItems || l.value.length >= t.minItems) return;
|
|
10885
|
-
const
|
|
10885
|
+
const v = t.minItems - l.value.length, M = Array.from({ length: v }, w);
|
|
10886
10886
|
n.value = [...l.value, ...M];
|
|
10887
10887
|
}
|
|
10888
10888
|
function w() {
|
|
10889
|
-
const
|
|
10889
|
+
const v = {};
|
|
10890
10890
|
return a.value.forEach((M) => {
|
|
10891
|
-
|
|
10892
|
-
}),
|
|
10891
|
+
v[M.name] = M?.default ?? null;
|
|
10892
|
+
}), v;
|
|
10893
10893
|
}
|
|
10894
10894
|
function b() {
|
|
10895
10895
|
c.value && (n.value = [...l.value, w()], _());
|
|
10896
10896
|
}
|
|
10897
|
-
function m(
|
|
10898
|
-
f.value || (n.value = l.value.filter((M,
|
|
10897
|
+
function m(v) {
|
|
10898
|
+
f.value || (n.value = l.value.filter((M, S) => S !== v), _(), x());
|
|
10899
10899
|
}
|
|
10900
|
-
function k(
|
|
10900
|
+
function k(v) {
|
|
10901
10901
|
return {
|
|
10902
|
-
...
|
|
10902
|
+
...v
|
|
10903
10903
|
};
|
|
10904
10904
|
}
|
|
10905
|
-
return (
|
|
10905
|
+
return (v, M) => (u(), g("div", qv, [
|
|
10906
10906
|
d("div", Kv, [
|
|
10907
|
-
(u(!0),
|
|
10907
|
+
(u(!0), g(Ae, null, Be(l.value, (S, V) => (u(), g("div", {
|
|
10908
10908
|
key: o.value[V],
|
|
10909
10909
|
class: ie(["flex items-center gap-3 rounded-lg transition-colors", {
|
|
10910
10910
|
"border border-gray-300 p-2": r.value
|
|
@@ -10927,7 +10927,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10927
10927
|
G(q(on), { class: "h-4 w-4" })
|
|
10928
10928
|
], 8, Yv)
|
|
10929
10929
|
], 2))), 128)),
|
|
10930
|
-
l.value.length === 0 ? (u(),
|
|
10930
|
+
l.value.length === 0 ? (u(), g("div", Gv, ce(t.emptyLabel), 1)) : K("", !0)
|
|
10931
10931
|
]),
|
|
10932
10932
|
d("button", {
|
|
10933
10933
|
type: "button",
|
|
@@ -10975,13 +10975,13 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
10975
10975
|
const t = e, n = Ke(e, "modelValue"), l = D([]), o = D([]), a = D(0), i = D(null), r = D(null), c = D(null), f = y(() => t.groupLabel ?? "Group"), _ = y(() => t.emptyLabel ?? "Ще немає груп"), x = y(() => t.schema?.map((R) => ({
|
|
10976
10976
|
...R,
|
|
10977
10977
|
disabled: t.disabled || R.disabled
|
|
10978
|
-
})) ?? []), w = y(() => x.value.map((R) => B(R))), b = y(() => t.view === "accordion"), m = y(() => !!(t.collapsible || b.value)), k = y(() => t.draggable !== !1),
|
|
10978
|
+
})) ?? []), w = y(() => x.value.map((R) => B(R))), b = y(() => t.view === "accordion"), m = y(() => !!(t.collapsible || b.value)), k = y(() => t.draggable !== !1), v = y(() => t.disabled ? !1 : t.maxGroups ? n.value.length < t.maxGroups : !0), M = y(() => t.disabled || n.value.length <= (t.minGroups || 0));
|
|
10979
10979
|
ve(() => n.value.length, () => {
|
|
10980
|
-
|
|
10980
|
+
S(), V(), A();
|
|
10981
10981
|
}, { immediate: !0 }), ve(() => t.schema, A, { immediate: !0, deep: !0 }), ve(() => t.view, () => {
|
|
10982
10982
|
V();
|
|
10983
10983
|
}, { immediate: !0 });
|
|
10984
|
-
function
|
|
10984
|
+
function S() {
|
|
10985
10985
|
const R = n.value.length;
|
|
10986
10986
|
l.value.length < R ? l.value = [...l.value, ...Array.from({ length: R - l.value.length }, () => Nl())] : l.value.length > R && l.value.splice(R);
|
|
10987
10987
|
}
|
|
@@ -11001,10 +11001,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11001
11001
|
}), R;
|
|
11002
11002
|
}
|
|
11003
11003
|
function Z() {
|
|
11004
|
-
|
|
11004
|
+
v.value && (n.value = [...n.value, U()], S(), V());
|
|
11005
11005
|
}
|
|
11006
11006
|
function F(R) {
|
|
11007
|
-
M.value || (n.value = n.value.filter((fe, be) => be !== R),
|
|
11007
|
+
M.value || (n.value = n.value.filter((fe, be) => be !== R), S(), b.value ? a.value >= n.value.length && (a.value = n.value.length - 1) : o.value.splice(R, 1), A());
|
|
11008
11008
|
}
|
|
11009
11009
|
function j(R) {
|
|
11010
11010
|
if (t.disabled) return;
|
|
@@ -11013,7 +11013,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11013
11013
|
...n.value.slice(0, R + 1),
|
|
11014
11014
|
fe,
|
|
11015
11015
|
...n.value.slice(R + 1)
|
|
11016
|
-
],
|
|
11016
|
+
], S(), b.value ? a.value > R && (a.value += 1) : o.value.splice(R + 1, 0, o.value[R] ?? !1);
|
|
11017
11017
|
}
|
|
11018
11018
|
function B(R) {
|
|
11019
11019
|
return {
|
|
@@ -11058,8 +11058,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11058
11058
|
function ee(R, fe) {
|
|
11059
11059
|
const be = [...n.value], [se] = be.splice(R, 1);
|
|
11060
11060
|
be.splice(fe, 0, se), n.value = be;
|
|
11061
|
-
const Me = [...l.value], [
|
|
11062
|
-
if (Me.splice(fe, 0,
|
|
11061
|
+
const Me = [...l.value], [Te] = Me.splice(R, 1);
|
|
11062
|
+
if (Me.splice(fe, 0, Te), l.value = Me, b.value)
|
|
11063
11063
|
a.value === R && (a.value = fe);
|
|
11064
11064
|
else {
|
|
11065
11065
|
const Ve = [...o.value], [He] = Ve.splice(R, 1);
|
|
@@ -11090,8 +11090,8 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11090
11090
|
function ne() {
|
|
11091
11091
|
c.value = null, i.value = null, r.value = null;
|
|
11092
11092
|
}
|
|
11093
|
-
return (R, fe) => (u(),
|
|
11094
|
-
(u(!0),
|
|
11093
|
+
return (R, fe) => (u(), g("div", Qv, [
|
|
11094
|
+
(u(!0), g(Ae, null, Be(n.value, (be, se) => (u(), g("div", {
|
|
11095
11095
|
key: l.value[se],
|
|
11096
11096
|
class: ie(["relative border border-gray-200 rounded-lg bg-white transition vs-dataform__group", [
|
|
11097
11097
|
t.view === "accordion" ? "overflow-hidden" : P(se) ? "pt-6 px-6" : "p-6"
|
|
@@ -11115,7 +11115,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11115
11115
|
class: "h-4 w-4 text-gray-400",
|
|
11116
11116
|
"aria-hidden": "true"
|
|
11117
11117
|
})) : K("", !0),
|
|
11118
|
-
m.value ? (u(),
|
|
11118
|
+
m.value ? (u(), g("button", {
|
|
11119
11119
|
key: 1,
|
|
11120
11120
|
type: "button",
|
|
11121
11121
|
class: "rounded-full p-1 text-gray-500 transition hover:bg-gray-100",
|
|
@@ -11167,12 +11167,12 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11167
11167
|
[Pt, !P(se)]
|
|
11168
11168
|
])
|
|
11169
11169
|
], 42, eg))), 128)),
|
|
11170
|
-
n.value.length === 0 ? (u(),
|
|
11170
|
+
n.value.length === 0 ? (u(), g("div", sg, ce(_.value), 1)) : K("", !0),
|
|
11171
11171
|
d("button", {
|
|
11172
11172
|
type: "button",
|
|
11173
11173
|
class: "flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",
|
|
11174
11174
|
onClick: Z,
|
|
11175
|
-
disabled: !
|
|
11175
|
+
disabled: !v.value
|
|
11176
11176
|
}, [
|
|
11177
11177
|
G(q(Ot), { class: "h-4 w-4" }),
|
|
11178
11178
|
nt(" " + ce(t.addButtonText), 1)
|
|
@@ -11210,12 +11210,12 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11210
11210
|
if (m.monaco?.editor?.create)
|
|
11211
11211
|
return r = m.monaco, Promise.resolve(r);
|
|
11212
11212
|
if (m[Wn]) return m[Wn];
|
|
11213
|
-
const
|
|
11213
|
+
const v = (async () => {
|
|
11214
11214
|
const M = (A) => {
|
|
11215
11215
|
if (Array.from(document.styleSheets || []).some((F) => F?.href?.includes(A))) return;
|
|
11216
11216
|
const Z = document.createElement("link");
|
|
11217
11217
|
Z.rel = "stylesheet", Z.href = A, document.head.appendChild(Z);
|
|
11218
|
-
},
|
|
11218
|
+
}, S = (A) => {
|
|
11219
11219
|
if (m[en]?.[A]) return m[en][A];
|
|
11220
11220
|
m[en] ||= {};
|
|
11221
11221
|
const U = Array.from(document.scripts).find((Z) => Z.src === A);
|
|
@@ -11235,7 +11235,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11235
11235
|
}, j.onerror = (B) => F(B), document.body.appendChild(j);
|
|
11236
11236
|
}), m[en][A]);
|
|
11237
11237
|
}, V = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";
|
|
11238
|
-
return M(`${V}/editor/editor.main.min.css`), await
|
|
11238
|
+
return M(`${V}/editor/editor.main.min.css`), await S(`${V}/loader.min.js`), m[qn] || (m[qn] = new Promise((A, U) => {
|
|
11239
11239
|
window.require.config({
|
|
11240
11240
|
paths: { vs: V }
|
|
11241
11241
|
}), window.require(
|
|
@@ -11251,7 +11251,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11251
11251
|
})().catch((M) => {
|
|
11252
11252
|
throw delete m[Wn], M;
|
|
11253
11253
|
});
|
|
11254
|
-
return m[Wn] =
|
|
11254
|
+
return m[Wn] = v, v;
|
|
11255
11255
|
}, _ = () => {
|
|
11256
11256
|
!o.value || !r || (i && (i.dispose(), i = null), i = r.editor.create(o.value, {
|
|
11257
11257
|
value: l.value || "",
|
|
@@ -11307,7 +11307,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11307
11307
|
focus: x,
|
|
11308
11308
|
getEditor: w,
|
|
11309
11309
|
getMonaco: b
|
|
11310
|
-
}), (m, k) => (u(),
|
|
11310
|
+
}), (m, k) => (u(), g("div", {
|
|
11311
11311
|
class: "w-full",
|
|
11312
11312
|
style: Oe({ height: a.value })
|
|
11313
11313
|
}, [
|
|
@@ -11398,7 +11398,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11398
11398
|
c = null;
|
|
11399
11399
|
}
|
|
11400
11400
|
}
|
|
11401
|
-
|
|
11401
|
+
Ie({ type: "warning", title: "Validation", message: l(i, c) });
|
|
11402
11402
|
return;
|
|
11403
11403
|
}
|
|
11404
11404
|
const r = await i.json();
|
|
@@ -11409,7 +11409,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11409
11409
|
console.error(t.error, a);
|
|
11410
11410
|
}
|
|
11411
11411
|
}
|
|
11412
|
-
return (a, i) => (u(),
|
|
11412
|
+
return (a, i) => (u(), g("button", {
|
|
11413
11413
|
onClick: o,
|
|
11414
11414
|
class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
|
|
11415
11415
|
}, ce(a.button), 1));
|
|
@@ -11473,7 +11473,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11473
11473
|
"slots",
|
|
11474
11474
|
"component"
|
|
11475
11475
|
]);
|
|
11476
|
-
function
|
|
11476
|
+
function v(X) {
|
|
11477
11477
|
const te = {};
|
|
11478
11478
|
Object.entries(X).forEach(([ee, Y]) => {
|
|
11479
11479
|
k.has(ee) || ee.includes(":") || Y !== void 0 && (te[ee] = Y);
|
|
@@ -11488,11 +11488,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11488
11488
|
te && x?.value?.[te] && Object.assign(X, x.value[te]);
|
|
11489
11489
|
const J = w.value;
|
|
11490
11490
|
let ee;
|
|
11491
|
-
return J.size ? ee = Object.fromEntries(Object.entries(X).filter(([Y]) => J.has(Y))) : ee = { ...X }, Object.assign(ee,
|
|
11491
|
+
return J.size ? ee = Object.fromEntries(Object.entries(X).filter(([Y]) => J.has(Y))) : ee = { ...X }, Object.assign(ee, v(X)), m.forEach((Y) => {
|
|
11492
11492
|
const ke = X[Y];
|
|
11493
11493
|
ke != null && (ee[Y] = ke);
|
|
11494
11494
|
}), ee;
|
|
11495
|
-
}),
|
|
11495
|
+
}), S = (X) => {
|
|
11496
11496
|
const te = typeof X == "object" && X !== null ? X : { value: X };
|
|
11497
11497
|
o("value-selected", {
|
|
11498
11498
|
...te,
|
|
@@ -11523,11 +11523,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11523
11523
|
setTimeout(R, hg);
|
|
11524
11524
|
}), ee = await fetch(J);
|
|
11525
11525
|
if (ee.status === 202) {
|
|
11526
|
-
|
|
11526
|
+
Ie({ type: "warning", title: "Validation", message: "Сервер ще обробляє запит. Спробуйте пізніше." });
|
|
11527
11527
|
return;
|
|
11528
11528
|
}
|
|
11529
11529
|
if (!ee.ok) {
|
|
11530
|
-
|
|
11530
|
+
Ie({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
11531
11531
|
return;
|
|
11532
11532
|
}
|
|
11533
11533
|
const ke = await ee.json(), ye = ke?.result !== void 0 ? ke.result : ke, T = n.item?.set;
|
|
@@ -11541,7 +11541,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11541
11541
|
A.value[R] = se ?? null;
|
|
11542
11542
|
});
|
|
11543
11543
|
} catch (ee) {
|
|
11544
|
-
console.error("API lookup error:", ee),
|
|
11544
|
+
console.error("API lookup error:", ee), Ie({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
11545
11545
|
} finally {
|
|
11546
11546
|
U.value = !1;
|
|
11547
11547
|
}
|
|
@@ -11604,10 +11604,10 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11604
11604
|
(u(), xe(_t(_.value), Jt(M.value, {
|
|
11605
11605
|
modelValue: l.value,
|
|
11606
11606
|
"onUpdate:modelValue": te[0] || (te[0] = (J) => l.value = J),
|
|
11607
|
-
onValueSelected:
|
|
11607
|
+
onValueSelected: S
|
|
11608
11608
|
}), null, 16, ["modelValue"]))
|
|
11609
11609
|
]),
|
|
11610
|
-
Z.value ? (u(),
|
|
11610
|
+
Z.value ? (u(), g("button", {
|
|
11611
11611
|
key: 0,
|
|
11612
11612
|
type: "button",
|
|
11613
11613
|
class: "flex items-center justify-center px-2 py-2 border rounded-md bg-white hover:bg-gray-50 text-gray-600 hover:text-blue-600 disabled:opacity-50 h-[38px] shrink-0",
|
|
@@ -11623,7 +11623,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11623
11623
|
}))
|
|
11624
11624
|
], 8, gg)) : K("", !0)
|
|
11625
11625
|
], 2),
|
|
11626
|
-
f.value.description && n.layout !== "settings" ? (u(),
|
|
11626
|
+
f.value.description && n.layout !== "settings" ? (u(), g("p", {
|
|
11627
11627
|
key: 0,
|
|
11628
11628
|
class: "text-sm text-gray-500",
|
|
11629
11629
|
innerHTML: f.value.description
|
|
@@ -11656,7 +11656,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11656
11656
|
return { width: pe, minWidth: pe };
|
|
11657
11657
|
});
|
|
11658
11658
|
let f = null, _ = 0, x = 0, w = null, b = null, m = null;
|
|
11659
|
-
const k = () => B(),
|
|
11659
|
+
const k = () => B(), v = () => S();
|
|
11660
11660
|
ve(
|
|
11661
11661
|
() => n.target,
|
|
11662
11662
|
async (Q) => {
|
|
@@ -11664,7 +11664,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11664
11664
|
w = null, l.value = [], o.value = "";
|
|
11665
11665
|
return;
|
|
11666
11666
|
}
|
|
11667
|
-
w = Q, i.value && (await et(), U(Q),
|
|
11667
|
+
w = Q, i.value && (await et(), U(Q), S());
|
|
11668
11668
|
},
|
|
11669
11669
|
{ immediate: !0 }
|
|
11670
11670
|
), ve(
|
|
@@ -11674,11 +11674,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11674
11674
|
b = Q ?? null;
|
|
11675
11675
|
return;
|
|
11676
11676
|
}
|
|
11677
|
-
M(Q ?? null), et(() =>
|
|
11677
|
+
M(Q ?? null), et(() => S());
|
|
11678
11678
|
},
|
|
11679
11679
|
{ immediate: !0 }
|
|
11680
11680
|
), lt(() => {
|
|
11681
|
-
n.scrollContainer || M(null),
|
|
11681
|
+
n.scrollContainer || M(null), S();
|
|
11682
11682
|
}), It(() => {
|
|
11683
11683
|
Z(), M(null, !0), w = null, typeof window < "u" && (_ && window.cancelAnimationFrame(_), x && window.cancelAnimationFrame(x));
|
|
11684
11684
|
});
|
|
@@ -11689,11 +11689,11 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11689
11689
|
}
|
|
11690
11690
|
if (b = Q ?? null, typeof window > "u") return;
|
|
11691
11691
|
const Se = Q ?? window, X = window;
|
|
11692
|
-
Se.addEventListener("scroll", k, { passive: !0 }), X.addEventListener("resize",
|
|
11693
|
-
Se.removeEventListener("scroll", k), X.removeEventListener("resize",
|
|
11692
|
+
Se.addEventListener("scroll", k, { passive: !0 }), X.addEventListener("resize", v), m = () => {
|
|
11693
|
+
Se.removeEventListener("scroll", k), X.removeEventListener("resize", v);
|
|
11694
11694
|
};
|
|
11695
11695
|
}
|
|
11696
|
-
function
|
|
11696
|
+
function S() {
|
|
11697
11697
|
if (!i.value || !w) return;
|
|
11698
11698
|
_ && typeof window < "u" && window.cancelAnimationFrame(_);
|
|
11699
11699
|
const Q = () => {
|
|
@@ -11723,7 +11723,7 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11723
11723
|
return Q.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
11724
11724
|
}
|
|
11725
11725
|
function U(Q) {
|
|
11726
|
-
!Q || !i.value || typeof MutationObserver > "u" || (Z(), f = new MutationObserver(() =>
|
|
11726
|
+
!Q || !i.value || typeof MutationObserver > "u" || (Z(), f = new MutationObserver(() => S()), f.observe(Q, { childList: !0, subtree: !0 }));
|
|
11727
11727
|
}
|
|
11728
11728
|
function Z() {
|
|
11729
11729
|
f && (f.disconnect(), f = null);
|
|
@@ -11762,14 +11762,14 @@ const Cp = { class: "vs-map-body" }, Mp = {
|
|
|
11762
11762
|
const Se = b, X = Math.max(0, F(pe));
|
|
11763
11763
|
Se ? Se.scrollTo({ top: X, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: X, behavior: "smooth" });
|
|
11764
11764
|
}
|
|
11765
|
-
return t({ refresh:
|
|
11765
|
+
return t({ refresh: S }), (Q, pe) => i.value && l.value.length ? (u(), g("div", {
|
|
11766
11766
|
key: 0,
|
|
11767
11767
|
class: ie(r.value),
|
|
11768
11768
|
style: Oe(c.value)
|
|
11769
11769
|
}, [
|
|
11770
11770
|
d("h2", wg, ce(Q.title), 1),
|
|
11771
11771
|
d("div", xg, [
|
|
11772
|
-
(u(!0),
|
|
11772
|
+
(u(!0), g(Ae, null, Be(l.value, (Se) => (u(), g("div", {
|
|
11773
11773
|
key: Se.id,
|
|
11774
11774
|
class: ie([
|
|
11775
11775
|
"vs-compact-form-navigation__item relative",
|
|
@@ -11938,20 +11938,20 @@ function Og(e, t, n = !1) {
|
|
|
11938
11938
|
});
|
|
11939
11939
|
}
|
|
11940
11940
|
function c(w) {
|
|
11941
|
-
const b = [], m = Number(w?.minlength), k = Number(w?.maxlength),
|
|
11942
|
-
!Number.isNaN(m) && Number.isFinite(m) && b.push({ type: "minlength", value: m }), !Number.isNaN(k) && Number.isFinite(k) && b.push({ type: "maxlength", value: k }), !Number.isNaN(
|
|
11941
|
+
const b = [], m = Number(w?.minlength), k = Number(w?.maxlength), v = Number(w?.min), M = Number(w?.max);
|
|
11942
|
+
!Number.isNaN(m) && Number.isFinite(m) && b.push({ type: "minlength", value: m }), !Number.isNaN(k) && Number.isFinite(k) && b.push({ type: "maxlength", value: k }), !Number.isNaN(v) && Number.isFinite(v) && b.push({ type: "min", value: v }), !Number.isNaN(M) && Number.isFinite(M) && b.push({ type: "max", value: M }), typeof w?.maxField == "string" && w.maxField && b.push({
|
|
11943
11943
|
type: "maxField",
|
|
11944
11944
|
field: w.maxField,
|
|
11945
11945
|
message: w.maxFieldMessage
|
|
11946
11946
|
});
|
|
11947
|
-
const
|
|
11948
|
-
if (!
|
|
11947
|
+
const S = [...b, ...w.rules || []];
|
|
11948
|
+
if (!S.length) return;
|
|
11949
11949
|
if (!a(w)) {
|
|
11950
11950
|
delete o.value[w.name];
|
|
11951
11951
|
return;
|
|
11952
11952
|
}
|
|
11953
11953
|
let V = !1, A = null;
|
|
11954
|
-
|
|
11954
|
+
S.forEach((U) => {
|
|
11955
11955
|
const Z = Fg(e.value[w.name], U, e.value);
|
|
11956
11956
|
Z && (V = !0, !A && typeof Z == "string" && (A = Z));
|
|
11957
11957
|
}), V && A ? o.value[w.name] = A : delete o.value[w.name];
|
|
@@ -12019,7 +12019,7 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12019
12019
|
validate: x,
|
|
12020
12020
|
reset: w,
|
|
12021
12021
|
visibleSchema: b
|
|
12022
|
-
} = Og(f, o.schema, Vo(o, "disabled")), m = D(null), k = D(null),
|
|
12022
|
+
} = Og(f, o.schema, Vo(o, "disabled")), m = D(null), k = D(null), v = D({}), M = y(() => o.navigation), S = y(() => o.navWidth), V = y(() => o.style?.columns), A = Object.freeze({ container: 12, label: 3 }), U = y(() => o.columns ?? V.value ?? A), Z = y(() => o.columns != null || V.value != null), F = y(() => Z.value ? "horizontal" : o.layout), j = (J) => J?.columns ? "horizontal" : F.value, B = (J) => J?.columns ?? U.value, P = y(() => {
|
|
12023
12023
|
const J = {}, ee = (Y) => {
|
|
12024
12024
|
if (!Y) return;
|
|
12025
12025
|
(Array.isArray(Y) ? Y.map((ye, T) => ({ key: String(T), entry: ye })) : typeof Y == "object" ? Object.entries(Y).map(([ye, T]) => ({ key: ye, entry: T })) : []).forEach(({ key: ye, entry: T }) => {
|
|
@@ -12072,7 +12072,7 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12072
12072
|
te(J);
|
|
12073
12073
|
},
|
|
12074
12074
|
{ immediate: !0, deep: !0 }
|
|
12075
|
-
), En("form", i), En("values", f), En("field-props",
|
|
12075
|
+
), En("form", i), En("values", f), En("field-props", v), En("schema-by-name", P), (J, ee) => (u(), g("div", Bg, [
|
|
12076
12076
|
d("div", {
|
|
12077
12077
|
class: "flex-1 min-h-0 overflow-y-auto overflow-x-visible",
|
|
12078
12078
|
ref_key: "formScrollContainer",
|
|
@@ -12084,7 +12084,7 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12084
12084
|
onSubmit: Ee(Q, ["prevent"]),
|
|
12085
12085
|
class: ie(["grid grid-cols-12 p-1", F.value === "default" ? "gap-6" : "gap-4"])
|
|
12086
12086
|
}, [
|
|
12087
|
-
(u(!0),
|
|
12087
|
+
(u(!0), g(Ae, null, Be(q(b), (Y, ke) => (u(), g("div", {
|
|
12088
12088
|
key: Y.name,
|
|
12089
12089
|
class: ie(j(Y) === "horizontal" ? "col-span-12" : `col-span-12 md:col-span-${Y.col || 12}`)
|
|
12090
12090
|
}, [
|
|
@@ -12102,7 +12102,7 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12102
12102
|
error: q(_)[Y.name],
|
|
12103
12103
|
onValueSelected: pe
|
|
12104
12104
|
}, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
|
|
12105
|
-
j(Y) === "settings" && ke + 1 !== q(b).length ? (u(),
|
|
12105
|
+
j(Y) === "settings" && ke + 1 !== q(b).length ? (u(), g("div", Rg)) : K("", !0)
|
|
12106
12106
|
], 2))), 128))
|
|
12107
12107
|
], 34)
|
|
12108
12108
|
], 512),
|
|
@@ -12110,7 +12110,7 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12110
12110
|
target: m.value,
|
|
12111
12111
|
"scroll-container": k.value,
|
|
12112
12112
|
enabled: M.value,
|
|
12113
|
-
width:
|
|
12113
|
+
width: S.value
|
|
12114
12114
|
}, null, 8, ["target", "scroll-container", "enabled", "width"])
|
|
12115
12115
|
]));
|
|
12116
12116
|
}
|
|
@@ -12128,55 +12128,63 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12128
12128
|
emits: ["close", "save", "edit"],
|
|
12129
12129
|
setup(e, { emit: t }) {
|
|
12130
12130
|
const n = e, l = t, o = D(n.schema), a = D(n.defaultValue ? JSON.parse(JSON.stringify(n.defaultValue)) : {}), i = D({}), r = D(n.token || ""), c = D(n.token || ""), f = D(n.mode), _ = () => {
|
|
12131
|
-
const
|
|
12132
|
-
return
|
|
12131
|
+
const v = n.method?.trim().toUpperCase();
|
|
12132
|
+
return v === "GET" || v === "POST" || v === "PUT" ? v : f.value === "add" ? "POST" : "PUT";
|
|
12133
12133
|
}, x = () => {
|
|
12134
|
-
|
|
12134
|
+
Ie({
|
|
12135
12135
|
type: "success",
|
|
12136
12136
|
title: "Успішно",
|
|
12137
12137
|
message: `Дані успішно ${f.value === "add" ? "збережено" : "оновлено"}`
|
|
12138
12138
|
});
|
|
12139
|
-
}, w = (
|
|
12139
|
+
}, w = (v) => {
|
|
12140
12140
|
const M = {};
|
|
12141
|
-
|
|
12141
|
+
v.id !== void 0 && v.id !== null && (M.id = v.id, c.value = v.id.toString()), v.obj && typeof v.obj == "object" && Object.assign(M, v.obj), Object.keys(M).length && (a.value = {
|
|
12142
12142
|
...a.value,
|
|
12143
12143
|
...M
|
|
12144
12144
|
});
|
|
12145
|
-
}, b = async (
|
|
12146
|
-
if (console.log(
|
|
12147
|
-
await
|
|
12145
|
+
}, b = async (v) => {
|
|
12146
|
+
if (console.log(v), v.ok) {
|
|
12147
|
+
await v.json().catch(() => ({})), x(), l("save", a.value);
|
|
12148
12148
|
return;
|
|
12149
12149
|
}
|
|
12150
|
-
const M = await
|
|
12151
|
-
if (
|
|
12152
|
-
|
|
12150
|
+
const M = await v.json().catch(() => ({})), S = M.message || M.error;
|
|
12151
|
+
if (v.status === 400) {
|
|
12152
|
+
Ie({
|
|
12153
12153
|
type: "warning",
|
|
12154
12154
|
title: "Помилка валідації",
|
|
12155
|
-
message:
|
|
12155
|
+
message: S || "Некоректні дані (400)"
|
|
12156
12156
|
});
|
|
12157
12157
|
return;
|
|
12158
12158
|
}
|
|
12159
|
-
if (
|
|
12160
|
-
|
|
12159
|
+
if (v.status === 403) {
|
|
12160
|
+
Ie({
|
|
12161
|
+
type: "warning",
|
|
12162
|
+
title: "Доступ заборонено",
|
|
12163
|
+
message: S || "Доступ заборонено (403)"
|
|
12164
|
+
});
|
|
12165
|
+
return;
|
|
12166
|
+
}
|
|
12167
|
+
if (v.status === 500) {
|
|
12168
|
+
Ie({
|
|
12161
12169
|
type: "error",
|
|
12162
12170
|
title: "Серверна помилка",
|
|
12163
|
-
message:
|
|
12171
|
+
message: S || "Виникла помилка на сервері (500)"
|
|
12164
12172
|
});
|
|
12165
12173
|
return;
|
|
12166
12174
|
}
|
|
12167
|
-
|
|
12175
|
+
Ie({
|
|
12168
12176
|
type: "error",
|
|
12169
12177
|
title: "Помилка",
|
|
12170
|
-
message: `Статус: ${
|
|
12178
|
+
message: `Статус: ${v.status}`
|
|
12171
12179
|
});
|
|
12172
12180
|
};
|
|
12173
12181
|
async function m() {
|
|
12174
|
-
const
|
|
12175
|
-
if (
|
|
12176
|
-
|
|
12182
|
+
const v = i.value.validate();
|
|
12183
|
+
if (v) {
|
|
12184
|
+
Ie({
|
|
12177
12185
|
type: "warning",
|
|
12178
12186
|
title: "Помилка валідації",
|
|
12179
|
-
message: Object.entries(
|
|
12187
|
+
message: Object.entries(v).map(([S, V]) => `${S}: ${V}`).join(`
|
|
12180
12188
|
`)
|
|
12181
12189
|
});
|
|
12182
12190
|
return;
|
|
@@ -12184,18 +12192,18 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12184
12192
|
f.value === "add" && a.value && delete a.value.id;
|
|
12185
12193
|
const M = n.api?.trim();
|
|
12186
12194
|
if (M) {
|
|
12187
|
-
const
|
|
12195
|
+
const S = _();
|
|
12188
12196
|
try {
|
|
12189
12197
|
const V = await fetch(M, {
|
|
12190
|
-
method:
|
|
12191
|
-
headers:
|
|
12198
|
+
method: S,
|
|
12199
|
+
headers: S === "GET" ? void 0 : {
|
|
12192
12200
|
"Content-Type": "application/json"
|
|
12193
12201
|
},
|
|
12194
|
-
body:
|
|
12202
|
+
body: S === "GET" ? void 0 : JSON.stringify(a.value)
|
|
12195
12203
|
});
|
|
12196
12204
|
await b(V);
|
|
12197
12205
|
} catch (V) {
|
|
12198
|
-
|
|
12206
|
+
Ie({
|
|
12199
12207
|
type: "error",
|
|
12200
12208
|
title: "Помилка з’єднання",
|
|
12201
12209
|
message: V.message || "Не вдалося виконати запит"
|
|
@@ -12205,19 +12213,19 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12205
12213
|
}
|
|
12206
12214
|
if (r.value)
|
|
12207
12215
|
try {
|
|
12208
|
-
const
|
|
12216
|
+
const S = await fetch(`/api/table/${r.value}`, {
|
|
12209
12217
|
method: f.value === "add" ? "POST" : "PUT",
|
|
12210
12218
|
headers: {
|
|
12211
12219
|
"Content-Type": "application/json"
|
|
12212
12220
|
},
|
|
12213
12221
|
body: JSON.stringify(a.value)
|
|
12214
12222
|
});
|
|
12215
|
-
await b(
|
|
12216
|
-
} catch (
|
|
12217
|
-
|
|
12223
|
+
await b(S);
|
|
12224
|
+
} catch (S) {
|
|
12225
|
+
Ie({
|
|
12218
12226
|
type: "error",
|
|
12219
12227
|
title: "Помилка з’єднання",
|
|
12220
|
-
message:
|
|
12228
|
+
message: S.message || "Не вдалося виконати запит"
|
|
12221
12229
|
});
|
|
12222
12230
|
}
|
|
12223
12231
|
else
|
|
@@ -12229,42 +12237,42 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12229
12237
|
return lt(async () => {
|
|
12230
12238
|
try {
|
|
12231
12239
|
if (n.form && !n.schema) {
|
|
12232
|
-
const
|
|
12233
|
-
if (!
|
|
12234
|
-
|
|
12235
|
-
type:
|
|
12240
|
+
const v = await fetch(`/api/template/form/${n.form}`);
|
|
12241
|
+
if (!v.ok) {
|
|
12242
|
+
Ie({
|
|
12243
|
+
type: v.status >= 400 && v.status < 500 ? "warning" : "error",
|
|
12236
12244
|
title: "Error",
|
|
12237
|
-
message: `Error code: ${
|
|
12245
|
+
message: `Error code: ${v.status}`
|
|
12238
12246
|
});
|
|
12239
12247
|
return;
|
|
12240
12248
|
}
|
|
12241
|
-
const M = await
|
|
12249
|
+
const M = await v.json();
|
|
12242
12250
|
o.value = M.schema, M.id && (c.value = M.id), M.token && (r.value = M.token, c.value || (c.value = M.token));
|
|
12243
12251
|
} else if (n.token && !n.defaultValue) {
|
|
12244
12252
|
r.value = n.token;
|
|
12245
|
-
const
|
|
12246
|
-
if (!
|
|
12247
|
-
|
|
12248
|
-
type:
|
|
12253
|
+
const v = await fetch(`/api/form/${r.value}`);
|
|
12254
|
+
if (!v.ok) {
|
|
12255
|
+
Ie({
|
|
12256
|
+
type: v.status >= 400 && v.status < 500 ? "warning" : "error",
|
|
12249
12257
|
title: "Error",
|
|
12250
|
-
message: `Error code: ${
|
|
12258
|
+
message: `Error code: ${v.status}`
|
|
12251
12259
|
});
|
|
12252
12260
|
return;
|
|
12253
12261
|
}
|
|
12254
|
-
const M = await
|
|
12262
|
+
const M = await v.json();
|
|
12255
12263
|
o.value = M.schema, M.data ? a.value = M.data : f.value = "add", w({
|
|
12256
12264
|
id: M.id,
|
|
12257
12265
|
obj: M.obj
|
|
12258
12266
|
});
|
|
12259
12267
|
}
|
|
12260
|
-
} catch (
|
|
12261
|
-
|
|
12268
|
+
} catch (v) {
|
|
12269
|
+
Ie({
|
|
12262
12270
|
type: "error",
|
|
12263
12271
|
title: "Error",
|
|
12264
|
-
message:
|
|
12265
|
-
}), console.error(
|
|
12272
|
+
message: v.message || "Unexpected error"
|
|
12273
|
+
}), console.error(v);
|
|
12266
12274
|
}
|
|
12267
|
-
}), (
|
|
12275
|
+
}), (v, M) => (u(), g("div", Ng, [
|
|
12268
12276
|
d("div", jg, [
|
|
12269
12277
|
d("div", zg, [
|
|
12270
12278
|
d("div", Ug, [
|
|
@@ -12283,9 +12291,9 @@ const Bg = { class: "flex w-full h-full min-h-0 gap-6" }, Rg = {
|
|
|
12283
12291
|
key: 0,
|
|
12284
12292
|
schema: o.value,
|
|
12285
12293
|
values: a.value,
|
|
12286
|
-
"onUpdate:values": M[0] || (M[0] = (
|
|
12294
|
+
"onUpdate:values": M[0] || (M[0] = (S) => a.value = S),
|
|
12287
12295
|
form: i.value,
|
|
12288
|
-
"onUpdate:form": M[1] || (M[1] = (
|
|
12296
|
+
"onUpdate:form": M[1] || (M[1] = (S) => i.value = S),
|
|
12289
12297
|
formId: c.value
|
|
12290
12298
|
}, null, 8, ["schema", "values", "form", "formId"])) : K("", !0)
|
|
12291
12299
|
]),
|