@opengis/form 0.0.51 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as U, ref as
|
|
2
|
-
import { notify as
|
|
1
|
+
import { defineComponent as U, ref as k, onMounted as _e, onUnmounted as Xe, createElementBlock as d, openBlock as i, createCommentVNode as D, renderSlot as Se, createElementVNode as l, toDisplayString as G, mergeProps as Te, computed as B, normalizeStyle as be, createTextVNode as ge, normalizeProps as ot, guardReactiveProps as nt, normalizeClass as E, mergeModels as ie, useModel as de, withDirectives as ae, unref as ee, vModelText as ve, vModelCheckbox as Ct, createVNode as A, createBlock as me, resolveDynamicComponent as Fe, withCtx as Ee, withModifiers as ke, onBeforeUnmount as at, watch as ue, createStaticVNode as ye, vModelRadio as Vt, Fragment as re, renderList as fe, reactive as Nt, vModelDynamic as qt, vShow as Qe, inject as Ae, resolveComponent as mt, Transition as st, nextTick as je, Teleport as Mt, getCurrentInstance as Wt, watchEffect as Gt, toRef as Zt, provide as vt } from "vue";
|
|
2
|
+
import { notify as ce, VsModal as Lt, modal as Kt } from "@opengis/core";
|
|
3
3
|
const Jt = { class: "w-full relative" }, Yt = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
@@ -24,19 +24,19 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
24
24
|
columns: {}
|
|
25
25
|
},
|
|
26
26
|
setup(o) {
|
|
27
|
-
const e =
|
|
27
|
+
const e = k("uk"), t = (a) => {
|
|
28
28
|
a.detail.key === "locale" && (e.value = a.detail.newValue);
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return _e(() => {
|
|
31
31
|
e.value = localStorage.locale, window.addEventListener("storage", t);
|
|
32
|
-
}),
|
|
32
|
+
}), Xe(() => {
|
|
33
33
|
window.removeEventListener("resize", t);
|
|
34
34
|
}), (a, n) => (i(), d("div", Jt, [
|
|
35
35
|
a.ua || a.label ? (i(), d("div", Yt, [
|
|
36
36
|
l("span", Xt, G(a.item[e.value] || a.ua || a.label), 1),
|
|
37
37
|
a.item?.rules?.includes("required") ? (i(), d("span", Qt, "*")) : D("", !0)
|
|
38
38
|
])) : D("", !0),
|
|
39
|
-
|
|
39
|
+
Se(a.$slots, "default", Te(a.$attrs, {
|
|
40
40
|
class: { "opacity-60": a.item.disabled }
|
|
41
41
|
})),
|
|
42
42
|
a.error ? (i(), d("span", el, G(a.error), 1)) : D("", !0)
|
|
@@ -93,7 +93,7 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
93
93
|
class: "flex-1 min-w-0",
|
|
94
94
|
style: be(r.value)
|
|
95
95
|
}, [
|
|
96
|
-
|
|
96
|
+
Se(u.$slots, "default", ot(nt(u.$attrs)))
|
|
97
97
|
], 4),
|
|
98
98
|
u.error ? (i(), d("span", nl, G(u.error), 1)) : D("", !0)
|
|
99
99
|
]));
|
|
@@ -117,7 +117,7 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
117
117
|
},
|
|
118
118
|
setup(o) {
|
|
119
119
|
return (e, t) => (i(), d("div", sl, [
|
|
120
|
-
|
|
120
|
+
Se(e.$slots, "default", ot(nt(e.$attrs))),
|
|
121
121
|
e.error ? (i(), d("span", rl, G(e.error), 1)) : D("", !0)
|
|
122
122
|
]));
|
|
123
123
|
}
|
|
@@ -148,18 +148,18 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
148
148
|
columns: {}
|
|
149
149
|
},
|
|
150
150
|
setup(o) {
|
|
151
|
-
const e = o, t =
|
|
151
|
+
const e = o, t = k("uk");
|
|
152
152
|
B(() => (e.item ?? {})?.[t.value] ?? e.ua ?? e.label ?? "");
|
|
153
153
|
const a = B(() => e.item?.description ?? ""), n = B(() => Array.isArray(e.item?.rules) && e.item.rules.includes("required")), s = B(() => (typeof e.error == "string" ? e.error : "") ?? ""), r = (u) => {
|
|
154
154
|
u.key === "locale" && (t.value = u.newValue ?? "uk");
|
|
155
155
|
};
|
|
156
|
-
return
|
|
156
|
+
return _e(() => {
|
|
157
157
|
try {
|
|
158
158
|
typeof localStorage < "u" && localStorage.locale && (t.value = localStorage.locale);
|
|
159
159
|
} catch {
|
|
160
160
|
}
|
|
161
161
|
window.addEventListener("storage", r);
|
|
162
|
-
}),
|
|
162
|
+
}), Xe(() => {
|
|
163
163
|
window.removeEventListener("storage", r);
|
|
164
164
|
}), (u, c) => (i(), d("div", {
|
|
165
165
|
class: E(["w-full relative", { "opacity-60": u.item?.disabled }])
|
|
@@ -175,7 +175,7 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
175
175
|
a.value ? (i(), d("p", fl, G(a.value), 1)) : D("", !0)
|
|
176
176
|
]),
|
|
177
177
|
l("div", ml, [
|
|
178
|
-
|
|
178
|
+
Se(u.$slots, "default", ot(nt(u.$attrs)))
|
|
179
179
|
])
|
|
180
180
|
], 2),
|
|
181
181
|
s.value ? (i(), d("p", vl, G(s.value), 1)) : D("", !0)
|
|
@@ -187,7 +187,7 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
187
187
|
inline: il,
|
|
188
188
|
settings: hl
|
|
189
189
|
};
|
|
190
|
-
function
|
|
190
|
+
function $e(o) {
|
|
191
191
|
return {
|
|
192
192
|
inputClass: B(() => {
|
|
193
193
|
const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
@@ -197,7 +197,7 @@ function _e(o) {
|
|
|
197
197
|
}
|
|
198
198
|
const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
199
199
|
__name: "vs-input-password",
|
|
200
|
-
props: /* @__PURE__ */
|
|
200
|
+
props: /* @__PURE__ */ ie({
|
|
201
201
|
style: { default: () => ({}) },
|
|
202
202
|
customClass: { default: "" },
|
|
203
203
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -211,8 +211,8 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
211
211
|
}),
|
|
212
212
|
emits: ["update:modelValue"],
|
|
213
213
|
setup(o) {
|
|
214
|
-
const e = o, { inputClass: t } =
|
|
215
|
-
return (n, s) =>
|
|
214
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
215
|
+
return (n, s) => ae((i(), d("input", {
|
|
216
216
|
type: "password",
|
|
217
217
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
218
218
|
placeholder: n.placeholder,
|
|
@@ -225,9 +225,9 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
225
225
|
[ve, a.value]
|
|
226
226
|
]);
|
|
227
227
|
}
|
|
228
|
-
}), xl = ["placeholder", "disabled"],
|
|
228
|
+
}), xl = ["placeholder", "disabled"], Ye = /* @__PURE__ */ U({
|
|
229
229
|
__name: "vs-input-text",
|
|
230
|
-
props: /* @__PURE__ */
|
|
230
|
+
props: /* @__PURE__ */ ie({
|
|
231
231
|
style: { default: () => ({}) },
|
|
232
232
|
customClass: { default: "" },
|
|
233
233
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -241,8 +241,8 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
241
241
|
}),
|
|
242
242
|
emits: ["update:modelValue"],
|
|
243
243
|
setup(o) {
|
|
244
|
-
const e = o, { inputClass: t } =
|
|
245
|
-
return (n, s) =>
|
|
244
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
245
|
+
return (n, s) => ae((i(), d("input", {
|
|
246
246
|
type: "text",
|
|
247
247
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
248
248
|
placeholder: n.placeholder,
|
|
@@ -257,7 +257,7 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
257
257
|
}
|
|
258
258
|
}), wl = ["placeholder", "min", "max"], kl = /* @__PURE__ */ U({
|
|
259
259
|
__name: "vs-input-number",
|
|
260
|
-
props: /* @__PURE__ */
|
|
260
|
+
props: /* @__PURE__ */ ie({
|
|
261
261
|
min: {},
|
|
262
262
|
max: {},
|
|
263
263
|
style: { default: () => ({}) },
|
|
@@ -273,8 +273,8 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
273
273
|
}),
|
|
274
274
|
emits: ["update:modelValue"],
|
|
275
275
|
setup(o) {
|
|
276
|
-
const e = o, { inputClass: t } =
|
|
277
|
-
return (n, s) =>
|
|
276
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
277
|
+
return (n, s) => ae((i(), d("input", {
|
|
278
278
|
type: "number",
|
|
279
279
|
step: "any",
|
|
280
280
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
@@ -332,7 +332,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
332
332
|
set: (s) => t("update:modelValue", s)
|
|
333
333
|
});
|
|
334
334
|
return (s, r) => (i(), d("div", Ml, [
|
|
335
|
-
|
|
335
|
+
ae(l("input", {
|
|
336
336
|
type: "checkbox",
|
|
337
337
|
value: s.value,
|
|
338
338
|
"onUpdate:modelValue": r[0] || (r[0] = (u) => n.value = u),
|
|
@@ -355,7 +355,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
355
355
|
})
|
|
356
356
|
], 2),
|
|
357
357
|
l("span", Bl, [
|
|
358
|
-
|
|
358
|
+
Se(s.$slots, "default", {}, () => [
|
|
359
359
|
ge(G(s.label), 1)
|
|
360
360
|
])
|
|
361
361
|
])
|
|
@@ -388,7 +388,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
388
388
|
return (u, c) => (i(), d("label", {
|
|
389
389
|
class: E(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
390
390
|
}, [
|
|
391
|
-
|
|
391
|
+
ae(l("input", {
|
|
392
392
|
type: "checkbox",
|
|
393
393
|
class: "hidden",
|
|
394
394
|
name: u.id,
|
|
@@ -412,7 +412,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
412
412
|
alt: "icon"
|
|
413
413
|
}, null, 8, Al)) : D("", !0)
|
|
414
414
|
])) : D("", !0),
|
|
415
|
-
|
|
415
|
+
Se(u.$slots, "default", {}, () => [
|
|
416
416
|
ge(G(u.label), 1)
|
|
417
417
|
])
|
|
418
418
|
])
|
|
@@ -444,7 +444,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
444
444
|
} else
|
|
445
445
|
a("update:modelValue", u);
|
|
446
446
|
}
|
|
447
|
-
}), r =
|
|
447
|
+
}), r = k(`vs-checkbox-${t.view || "default"}`);
|
|
448
448
|
return (u, c) => (i(), d("div", Fl, [
|
|
449
449
|
(i(), me(Fe(r.value === "vs-checkbox-buttons" ? ee(Tl) : ee(jl)), {
|
|
450
450
|
value: u.value,
|
|
@@ -459,7 +459,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
459
459
|
style: be(u.style),
|
|
460
460
|
error: u.error
|
|
461
461
|
}, {
|
|
462
|
-
default:
|
|
462
|
+
default: Ee(() => [
|
|
463
463
|
ge(G(u.label), 1)
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
@@ -538,7 +538,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
538
538
|
class: "text-red-500 text-[14px]"
|
|
539
539
|
}, Xl = ["title"], Ql = ["disabled"], Bt = /* @__PURE__ */ U({
|
|
540
540
|
__name: "vs-input-switcher",
|
|
541
|
-
props: /* @__PURE__ */
|
|
541
|
+
props: /* @__PURE__ */ ie({
|
|
542
542
|
rules: { default: () => [] },
|
|
543
543
|
view: { default: "checkbox" },
|
|
544
544
|
label: { default: "" },
|
|
@@ -557,7 +557,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
557
557
|
}),
|
|
558
558
|
emits: ["update:modelValue"],
|
|
559
559
|
setup(o) {
|
|
560
|
-
const e = o, t =
|
|
560
|
+
const e = o, t = de(o, "modelValue");
|
|
561
561
|
return (a, n) => e.view === "checkbox" ? (i(), d("div", Jl, [
|
|
562
562
|
A(St, {
|
|
563
563
|
modelValue: t.value,
|
|
@@ -570,7 +570,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
570
570
|
key: 1,
|
|
571
571
|
class: "cursor-pointer",
|
|
572
572
|
title: a.i,
|
|
573
|
-
onClick: n[1] || (n[1] =
|
|
573
|
+
onClick: n[1] || (n[1] = ke(() => {
|
|
574
574
|
}, ["prevent"]))
|
|
575
575
|
}, [
|
|
576
576
|
A(ee(Kl), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
@@ -610,7 +610,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
610
610
|
}
|
|
611
611
|
}), to = ["placeholder", "disabled", "name"], lo = /* @__PURE__ */ U({
|
|
612
612
|
__name: "vs-input-mask",
|
|
613
|
-
props: /* @__PURE__ */
|
|
613
|
+
props: /* @__PURE__ */ ie({
|
|
614
614
|
name: {},
|
|
615
615
|
mask: { default: "" },
|
|
616
616
|
unmask: { type: Boolean, default: !1 },
|
|
@@ -626,9 +626,9 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
626
626
|
}),
|
|
627
627
|
emits: ["update:modelValue"],
|
|
628
628
|
setup(o) {
|
|
629
|
-
const e = o, { inputClass: t } =
|
|
629
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue"), n = k(null);
|
|
630
630
|
let s = null;
|
|
631
|
-
return
|
|
631
|
+
return _e(async () => {
|
|
632
632
|
if (n.value) {
|
|
633
633
|
const { default: r } = await import("./index-W-qQIppj.js");
|
|
634
634
|
s = r(n.value, {
|
|
@@ -647,7 +647,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
647
647
|
}
|
|
648
648
|
}), at(() => {
|
|
649
649
|
s?.destroy();
|
|
650
|
-
}),
|
|
650
|
+
}), ue(() => e.mask, (r) => {
|
|
651
651
|
s && s.updateOptions({
|
|
652
652
|
mask: r,
|
|
653
653
|
definitions: {
|
|
@@ -656,7 +656,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
656
656
|
"*": /[a-zA-Z0-9]/
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
|
-
}),
|
|
659
|
+
}), ue(a, (r) => {
|
|
660
660
|
s && s.unmaskedValue !== r && (s.value = r || "");
|
|
661
661
|
}), (r, u) => (i(), d("input", {
|
|
662
662
|
type: "text",
|
|
@@ -673,7 +673,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
673
673
|
}
|
|
674
674
|
}), oo = { class: "relative w-full bg-white rounded-lg" }, no = ["placeholder", "disabled"], ao = /* @__PURE__ */ U({
|
|
675
675
|
__name: "vs-input-email",
|
|
676
|
-
props: /* @__PURE__ */
|
|
676
|
+
props: /* @__PURE__ */ ie({
|
|
677
677
|
style: { default: () => ({}) },
|
|
678
678
|
customClass: { default: "" },
|
|
679
679
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -687,10 +687,10 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
687
687
|
}),
|
|
688
688
|
emits: ["update:modelValue"],
|
|
689
689
|
setup(o) {
|
|
690
|
-
const e = o, { inputClass: t } =
|
|
690
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
691
691
|
return (n, s) => (i(), d("div", oo, [
|
|
692
692
|
s[1] || (s[1] = ye('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
|
|
693
|
-
|
|
693
|
+
ae(l("input", {
|
|
694
694
|
type: "email",
|
|
695
695
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
696
696
|
placeholder: n.placeholder,
|
|
@@ -706,7 +706,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
706
706
|
}
|
|
707
707
|
}), so = ["value", "disabled"], ro = { class: "text-[13px] text-gray-700" }, io = /* @__PURE__ */ U({
|
|
708
708
|
__name: "vs-input-radio-default",
|
|
709
|
-
props: /* @__PURE__ */
|
|
709
|
+
props: /* @__PURE__ */ ie({
|
|
710
710
|
style: {},
|
|
711
711
|
customClass: { default: "" },
|
|
712
712
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -722,11 +722,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
722
722
|
}),
|
|
723
723
|
emits: ["update:modelValue"],
|
|
724
724
|
setup(o) {
|
|
725
|
-
const e =
|
|
725
|
+
const e = de(o, "modelValue");
|
|
726
726
|
return (t, a) => (i(), d("label", {
|
|
727
727
|
class: E(["flex items-center gap-0", [t.customClass]])
|
|
728
728
|
}, [
|
|
729
|
-
|
|
729
|
+
ae(l("input", {
|
|
730
730
|
"onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
|
|
731
731
|
type: "radio",
|
|
732
732
|
value: t.value,
|
|
@@ -751,7 +751,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
751
751
|
}
|
|
752
752
|
}), uo = ["value", "disabled"], co = { class: "text-[13px] text-gray-700" }, po = /* @__PURE__ */ U({
|
|
753
753
|
__name: "vs-input-radio-buttons",
|
|
754
|
-
props: /* @__PURE__ */
|
|
754
|
+
props: /* @__PURE__ */ ie({
|
|
755
755
|
style: {},
|
|
756
756
|
customClass: { default: "" },
|
|
757
757
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -767,14 +767,14 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
767
767
|
}),
|
|
768
768
|
emits: ["update:modelValue"],
|
|
769
769
|
setup(o) {
|
|
770
|
-
const e =
|
|
770
|
+
const e = de(o, "modelValue");
|
|
771
771
|
return (t, a) => (i(), d("label", {
|
|
772
772
|
class: E(["flex items-center border rounded-lg px-2 py-1", [
|
|
773
773
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
774
774
|
t.customClass
|
|
775
775
|
]])
|
|
776
776
|
}, [
|
|
777
|
-
|
|
777
|
+
ae(l("input", {
|
|
778
778
|
"onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
|
|
779
779
|
type: "radio",
|
|
780
780
|
value: t.value,
|
|
@@ -791,7 +791,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
791
791
|
"vs-input-radio-buttons": po
|
|
792
792
|
}, gt = /* @__PURE__ */ U({
|
|
793
793
|
__name: "vs-input-radio",
|
|
794
|
-
props: /* @__PURE__ */
|
|
794
|
+
props: /* @__PURE__ */ ie({
|
|
795
795
|
options: {},
|
|
796
796
|
position: { default: "vertical" },
|
|
797
797
|
view: { default: "default" },
|
|
@@ -808,11 +808,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
808
808
|
}),
|
|
809
809
|
emits: ["update:modelValue"],
|
|
810
810
|
setup(o) {
|
|
811
|
-
const e = o, t =
|
|
811
|
+
const e = o, t = de(o, "modelValue"), a = B(() => fo[`vs-input-radio-${e.view}`]);
|
|
812
812
|
return (n, s) => (i(), d("div", {
|
|
813
813
|
class: E([n.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
814
814
|
}, [
|
|
815
|
-
(i(!0), d(
|
|
815
|
+
(i(!0), d(re, null, fe(n.options, (r) => (i(), me(Fe(a.value), Te({
|
|
816
816
|
key: r?.id,
|
|
817
817
|
text: r.text,
|
|
818
818
|
value: r.id.toString(),
|
|
@@ -841,7 +841,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
841
841
|
},
|
|
842
842
|
emits: ["update:modelValue"],
|
|
843
843
|
setup(o, { emit: e }) {
|
|
844
|
-
const t = o, a = e, n =
|
|
844
|
+
const t = o, a = e, n = k([]), s = Nt({}), r = (f) => f?.value || f?.id || f?.text || f, u = (f) => f.text || String(f), c = (f) => `lg:col-span-${f || 12}`, p = async () => {
|
|
845
845
|
try {
|
|
846
846
|
const f = await fetch(`/api/suggest/${t.data}`).then((m) => m.json());
|
|
847
847
|
n.value = f?.data || f;
|
|
@@ -849,7 +849,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
849
849
|
console.error(f);
|
|
850
850
|
}
|
|
851
851
|
};
|
|
852
|
-
return
|
|
852
|
+
return ue(
|
|
853
853
|
() => t.modelValue,
|
|
854
854
|
(f) => {
|
|
855
855
|
if (typeof f == "boolean" && n.value.length === 1) {
|
|
@@ -866,7 +866,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
866
866
|
}
|
|
867
867
|
},
|
|
868
868
|
{ immediate: !0 }
|
|
869
|
-
),
|
|
869
|
+
), ue(
|
|
870
870
|
s,
|
|
871
871
|
() => {
|
|
872
872
|
if (!n.value.length) {
|
|
@@ -877,7 +877,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
877
877
|
a("update:modelValue", f.length === 0 ? [] : f);
|
|
878
878
|
},
|
|
879
879
|
{ deep: !0 }
|
|
880
|
-
),
|
|
880
|
+
), _e(() => {
|
|
881
881
|
if (t.data)
|
|
882
882
|
p().then(() => {
|
|
883
883
|
if (typeof t.modelValue == "boolean" && n.value.length === 1) {
|
|
@@ -908,7 +908,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
908
908
|
}), (f, m) => (i(), d("div", {
|
|
909
909
|
class: E(["p-0 w-full gap-[6px]", [f.position === "vertical" ? "flex-col" : "", f.colSpan ? "grid" : "flex justify-start"]])
|
|
910
910
|
}, [
|
|
911
|
-
(i(!0), d(
|
|
911
|
+
(i(!0), d(re, null, fe(n.value, (y) => (i(), me(St, {
|
|
912
912
|
modelValue: s[r(y)],
|
|
913
913
|
"onUpdate:modelValue": (S) => s[r(y)] = S,
|
|
914
914
|
value: r(y),
|
|
@@ -941,11 +941,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
941
941
|
function a(c) {
|
|
942
942
|
return c ? t.mode === "datetime" ? (c.includes("T") ? c : null) || c + (c.includes(" ") ? "" : "T00:00") : c?.split(" ")[0] : null;
|
|
943
943
|
}
|
|
944
|
-
const { inputClass: n } =
|
|
944
|
+
const { inputClass: n } = $e(t.style), s = e, r = B({
|
|
945
945
|
get: () => a(t.modelValue),
|
|
946
946
|
set: (c) => s("update:modelValue", c)
|
|
947
947
|
}), u = B(() => t.mode === "datetime" ? "datetime-local" : t.mode);
|
|
948
|
-
return (c, p) =>
|
|
948
|
+
return (c, p) => ae((i(), d("input", {
|
|
949
949
|
type: u.value,
|
|
950
950
|
"onUpdate:modelValue": p[0] || (p[0] = (f) => r.value = f),
|
|
951
951
|
placeholder: c.placeholder,
|
|
@@ -970,7 +970,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
970
970
|
}
|
|
971
971
|
).then((r) => r.json()))?.result;
|
|
972
972
|
} catch (n) {
|
|
973
|
-
return
|
|
973
|
+
return ce({
|
|
974
974
|
type: "error",
|
|
975
975
|
title: "Помилка!",
|
|
976
976
|
message: "Сталась помилка під час завантаження файлу",
|
|
@@ -1007,7 +1007,7 @@ function wo(o, e) {
|
|
|
1007
1007
|
l("path", { d: "M12 5v14" }, null, -1)
|
|
1008
1008
|
]));
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1010
|
+
const qe = /* @__PURE__ */ X(yo, [["render", wo]]), ko = {}, _o = {
|
|
1011
1011
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1012
1012
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
1013
1013
|
width: "44",
|
|
@@ -1144,7 +1144,7 @@ function qo(o, e) {
|
|
|
1144
1144
|
ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
|
|
1145
1145
|
]));
|
|
1146
1146
|
}
|
|
1147
|
-
const
|
|
1147
|
+
const et = /* @__PURE__ */ X(Ho, [["render", qo]]), Wo = {}, Go = {
|
|
1148
1148
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1149
1149
|
width: "24",
|
|
1150
1150
|
height: "24",
|
|
@@ -1170,7 +1170,7 @@ function Zo(o, e) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Jo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Yo = /* @__PURE__ */ U({
|
|
1172
1172
|
__name: "vs-input-file-list-item",
|
|
1173
|
-
props: /* @__PURE__ */
|
|
1173
|
+
props: /* @__PURE__ */ ie({
|
|
1174
1174
|
format: {},
|
|
1175
1175
|
multiple: { type: Boolean },
|
|
1176
1176
|
style: {},
|
|
@@ -1188,7 +1188,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1188
1188
|
}),
|
|
1189
1189
|
emits: ["update:value", "update:item"],
|
|
1190
1190
|
setup(o) {
|
|
1191
|
-
const e =
|
|
1191
|
+
const e = de(o, "value"), t = de(o, "item"), a = o;
|
|
1192
1192
|
return (n, s) => (i(), d("div", Ko, [
|
|
1193
1193
|
(i(), me(Fe(ee(Ro)(t.value)), {
|
|
1194
1194
|
src: t.value,
|
|
@@ -1204,7 +1204,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1204
1204
|
}),
|
|
1205
1205
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1206
1206
|
}, [
|
|
1207
|
-
A(
|
|
1207
|
+
A(et, { class: "w-4 h-4" })
|
|
1208
1208
|
]),
|
|
1209
1209
|
l("button", {
|
|
1210
1210
|
type: "button",
|
|
@@ -1221,7 +1221,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1221
1221
|
class: "flex items-center flex-wrap gap-2"
|
|
1222
1222
|
}, tn = /* @__PURE__ */ U({
|
|
1223
1223
|
__name: "vs-input-file",
|
|
1224
|
-
props: /* @__PURE__ */
|
|
1224
|
+
props: /* @__PURE__ */ ie({
|
|
1225
1225
|
format: {},
|
|
1226
1226
|
multiple: { type: Boolean },
|
|
1227
1227
|
style: {},
|
|
@@ -1235,9 +1235,9 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1235
1235
|
modelValue: {},
|
|
1236
1236
|
modelModifiers: {}
|
|
1237
1237
|
}),
|
|
1238
|
-
emits: /* @__PURE__ */
|
|
1238
|
+
emits: /* @__PURE__ */ ie(["change"], ["update:modelValue"]),
|
|
1239
1239
|
setup(o, { emit: e }) {
|
|
1240
|
-
const t = o, a =
|
|
1240
|
+
const t = o, a = de(o, "modelValue"), n = e, s = k(null), r = (c) => Array.isArray(a.value) && a.value[c] || "", u = async (c) => {
|
|
1241
1241
|
const { files: p } = c.target;
|
|
1242
1242
|
if (!(!p || p.length === 0))
|
|
1243
1243
|
if (t.multiple) {
|
|
@@ -1267,7 +1267,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1267
1267
|
value: a.value,
|
|
1268
1268
|
"onUpdate:value": p[1] || (p[1] = (f) => a.value = f)
|
|
1269
1269
|
}, null, 8, ["item", "value"])) : c.multiple ? (i(), d("div", en, [
|
|
1270
|
-
(i(!0), d(
|
|
1270
|
+
(i(!0), d(re, null, fe(a.value, (f, m) => (i(), me(xt, {
|
|
1271
1271
|
multiple: c.multiple,
|
|
1272
1272
|
key: m,
|
|
1273
1273
|
value: a.value,
|
|
@@ -1281,7 +1281,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1281
1281
|
c.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1282
1282
|
])
|
|
1283
1283
|
}, [
|
|
1284
|
-
A(
|
|
1284
|
+
A(qe, { class: "w-6 h-6" })
|
|
1285
1285
|
], 2)
|
|
1286
1286
|
])) : D("", !0),
|
|
1287
1287
|
c.multiple ? D("", !0) : (i(), d("div", {
|
|
@@ -1289,11 +1289,11 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1289
1289
|
onClick: p[4] || (p[4] = (f) => s.value?.click()),
|
|
1290
1290
|
class: E([c.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
|
|
1291
1291
|
}, [
|
|
1292
|
-
A(
|
|
1292
|
+
A(qe, { class: "w-6 h-6" })
|
|
1293
1293
|
], 2))
|
|
1294
1294
|
]));
|
|
1295
1295
|
}
|
|
1296
|
-
}), ln = { class: "max-w-[55vw]" }, on = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, nn = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, an = { class: "px-[5px]" }, sn = { class: "" },
|
|
1296
|
+
}), ln = { class: "max-w-[55vw]" }, on = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, nn = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, an = { class: "px-[5px]" }, sn = { class: "" }, Je = /* @__PURE__ */ U({
|
|
1297
1297
|
__name: "vs-widget-file-info",
|
|
1298
1298
|
props: {
|
|
1299
1299
|
item: { default: null }
|
|
@@ -1316,14 +1316,14 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1316
1316
|
const s = n / 1024;
|
|
1317
1317
|
return s < 1024 ? `${s.toFixed(2)} KB` : `${(s / 1024).toFixed(2)} MB`;
|
|
1318
1318
|
}
|
|
1319
|
-
return (n, s) => (i(), d(
|
|
1319
|
+
return (n, s) => (i(), d(re, null, [
|
|
1320
1320
|
s[1] || (s[1] = ye('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
|
|
1321
1321
|
l("div", ln, [
|
|
1322
1322
|
l("p", on, G(n.item?.uploaded_name), 1),
|
|
1323
1323
|
l("p", nn, [
|
|
1324
1324
|
l("span", null, G(n.item?.username), 1),
|
|
1325
|
-
|
|
1326
|
-
[
|
|
1325
|
+
ae(l("span", an, "|", 512), [
|
|
1326
|
+
[Qe, n.item?.username]
|
|
1327
1327
|
]),
|
|
1328
1328
|
l("span", null, G(t.value), 1),
|
|
1329
1329
|
s[0] || (s[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
@@ -1392,20 +1392,20 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1392
1392
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1393
1393
|
onClick: m[0] || (m[0] = (y) => p(f.index))
|
|
1394
1394
|
}, [
|
|
1395
|
-
A(
|
|
1395
|
+
A(Je, { item: f.item }, null, 8, ["item"])
|
|
1396
1396
|
])
|
|
1397
1397
|
])) : n(f.item) ? (i(), d("div", dn, [
|
|
1398
|
-
A(
|
|
1398
|
+
A(Je, { item: f.item }, null, 8, ["item"])
|
|
1399
1399
|
])) : s(f.item) ? (i(), d("div", cn, [
|
|
1400
1400
|
l("a", {
|
|
1401
1401
|
href: `/api/file-preview?id=${f.item.file_id}`,
|
|
1402
1402
|
target: "_blank",
|
|
1403
1403
|
class: "flex gap-x-3 w-full items-center"
|
|
1404
1404
|
}, [
|
|
1405
|
-
A(
|
|
1405
|
+
A(Je, { item: f.item }, null, 8, ["item"])
|
|
1406
1406
|
], 8, pn)
|
|
1407
1407
|
])) : (i(), d("div", fn, [
|
|
1408
|
-
A(
|
|
1408
|
+
A(Je, { item: f.item }, null, 8, ["item"])
|
|
1409
1409
|
])),
|
|
1410
1410
|
l("div", mn, [
|
|
1411
1411
|
l("div", vn, [
|
|
@@ -1427,7 +1427,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1427
1427
|
class: "size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",
|
|
1428
1428
|
onClick: m[2] || (m[2] = (y) => c())
|
|
1429
1429
|
}, [
|
|
1430
|
-
A(
|
|
1430
|
+
A(et, {
|
|
1431
1431
|
height: "14",
|
|
1432
1432
|
width: "14"
|
|
1433
1433
|
})
|
|
@@ -1482,7 +1482,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1482
1482
|
},
|
|
1483
1483
|
emits: ["update"],
|
|
1484
1484
|
setup(o, { emit: e }) {
|
|
1485
|
-
const t = o, a =
|
|
1485
|
+
const t = o, a = Ae("form"), n = B(() => a.value.formId), s = k(!1), r = k(0), u = e, c = k(!1), p = k({}), f = k([]), m = k(""), y = B(() => Array.isArray(f.value) ? f.value.filter((I) => I.ext === "jpg" || I.ext === "png").map((I) => I?.file_path) : []), S = B(() => m.value === "" ? f.value : f.value.filter((I) => I?.uploaded_name?.includes(m.value))), q = (I) => {
|
|
1486
1486
|
const v = y.value.findIndex((x) => x === I.item.file_path);
|
|
1487
1487
|
v !== -1 && (s.value = !0, r.value = v);
|
|
1488
1488
|
}, R = async () => {
|
|
@@ -1498,14 +1498,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1498
1498
|
const x = new FormData();
|
|
1499
1499
|
x.append("file", v);
|
|
1500
1500
|
try {
|
|
1501
|
-
const V = `${t.prefix}/widget/file/${n.value}`,
|
|
1502
|
-
return
|
|
1503
|
-
type:
|
|
1501
|
+
const V = `${t.prefix}/widget/file/${n.value}`, $ = await fetch(V, { method: "POST", body: x });
|
|
1502
|
+
return $.ok ? (u("update", "file-list"), v) : (ce({
|
|
1503
|
+
type: $.status >= 400 && $.status < 500 ? "warning" : "error",
|
|
1504
1504
|
title: "Error",
|
|
1505
|
-
message: `Error code: ${
|
|
1505
|
+
message: `Error code: ${$.status}`
|
|
1506
1506
|
}), null);
|
|
1507
1507
|
} catch (V) {
|
|
1508
|
-
return
|
|
1508
|
+
return ce({
|
|
1509
1509
|
type: "error",
|
|
1510
1510
|
title: "Error",
|
|
1511
1511
|
message: V.message || "Unknown error"
|
|
@@ -1523,9 +1523,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1523
1523
|
}, H = (I) => {
|
|
1524
1524
|
p.value = T(I), c.value = !0;
|
|
1525
1525
|
};
|
|
1526
|
-
return
|
|
1526
|
+
return ue(n, (I) => {
|
|
1527
1527
|
I && R();
|
|
1528
|
-
}),
|
|
1528
|
+
}), _e(() => {
|
|
1529
1529
|
n.value && R();
|
|
1530
1530
|
}), (I, v) => {
|
|
1531
1531
|
const x = mt("Lightbox"), V = mt("MessageBox");
|
|
@@ -1537,7 +1537,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1537
1537
|
l("input", {
|
|
1538
1538
|
type: "file",
|
|
1539
1539
|
class: "hidden",
|
|
1540
|
-
onChange: v[0] || (v[0] = (
|
|
1540
|
+
onChange: v[0] || (v[0] = ($) => K($))
|
|
1541
1541
|
}, null, 32),
|
|
1542
1542
|
l("div", Mn, [
|
|
1543
1543
|
A(kn, {
|
|
@@ -1572,9 +1572,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1572
1572
|
l("path", { d: "m21 21-4.3-4.3" })
|
|
1573
1573
|
])
|
|
1574
1574
|
], -1)),
|
|
1575
|
-
|
|
1575
|
+
ae(l("input", {
|
|
1576
1576
|
type: "text",
|
|
1577
|
-
"onUpdate:modelValue": v[1] || (v[1] = (
|
|
1577
|
+
"onUpdate:modelValue": v[1] || (v[1] = ($) => m.value = $),
|
|
1578
1578
|
class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
|
|
1579
1579
|
placeholder: "Введіть назву файлу"
|
|
1580
1580
|
}, null, 512), [
|
|
@@ -1589,10 +1589,10 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1589
1589
|
])
|
|
1590
1590
|
])) : D("", !0),
|
|
1591
1591
|
f.value?.length ? (i(), d("div", Bn, [
|
|
1592
|
-
(i(!0), d(
|
|
1592
|
+
(i(!0), d(re, null, fe(S.value, ($, F) => (i(), me(bn, {
|
|
1593
1593
|
key: F,
|
|
1594
1594
|
prefix: I.prefix,
|
|
1595
|
-
item:
|
|
1595
|
+
item: $,
|
|
1596
1596
|
index: F,
|
|
1597
1597
|
onUpdate: v[2] || (v[2] = (te) => I.$emit("update", "file-list")),
|
|
1598
1598
|
onOpenModal: v[3] || (v[3] = (te) => H(te)),
|
|
@@ -1604,14 +1604,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1604
1604
|
])) : D("", !0),
|
|
1605
1605
|
A(x, {
|
|
1606
1606
|
modelValue: s.value,
|
|
1607
|
-
"onUpdate:modelValue": v[5] || (v[5] = (
|
|
1607
|
+
"onUpdate:modelValue": v[5] || (v[5] = ($) => s.value = $),
|
|
1608
1608
|
startIndex: r.value,
|
|
1609
|
-
"onUpdate:index": v[6] || (v[6] = (
|
|
1609
|
+
"onUpdate:index": v[6] || (v[6] = ($) => r.value = $),
|
|
1610
1610
|
images: y.value
|
|
1611
1611
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1612
1612
|
A(V, Te({
|
|
1613
1613
|
modelValue: c.value,
|
|
1614
|
-
"onUpdate:modelValue": v[7] || (v[7] = (
|
|
1614
|
+
"onUpdate:modelValue": v[7] || (v[7] = ($) => c.value = $),
|
|
1615
1615
|
onConfirm: p.value.confirm
|
|
1616
1616
|
}, p.value), null, 16, ["modelValue", "onConfirm"])
|
|
1617
1617
|
]);
|
|
@@ -1634,8 +1634,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1634
1634
|
}
|
|
1635
1635
|
},
|
|
1636
1636
|
setup(o) {
|
|
1637
|
-
const e = o, t =
|
|
1638
|
-
return
|
|
1637
|
+
const e = o, t = k(e.isOpen);
|
|
1638
|
+
return ue(
|
|
1639
1639
|
() => e.isOpen,
|
|
1640
1640
|
(a) => {
|
|
1641
1641
|
t.value = a;
|
|
@@ -1650,11 +1650,11 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1650
1650
|
}, null, 8, ["modelValue", "style"])
|
|
1651
1651
|
]),
|
|
1652
1652
|
A(st, { name: "slide-fade" }, {
|
|
1653
|
-
default:
|
|
1654
|
-
|
|
1655
|
-
|
|
1653
|
+
default: Ee(() => [
|
|
1654
|
+
ae(l("div", An, [
|
|
1655
|
+
Se(a.$slots, "default", {}, void 0, !0)
|
|
1656
1656
|
], 512), [
|
|
1657
|
-
[
|
|
1657
|
+
[Qe, t.value]
|
|
1658
1658
|
])
|
|
1659
1659
|
]),
|
|
1660
1660
|
_: 3
|
|
@@ -1678,8 +1678,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1678
1678
|
}
|
|
1679
1679
|
},
|
|
1680
1680
|
setup(o) {
|
|
1681
|
-
const e = o, t =
|
|
1682
|
-
return
|
|
1681
|
+
const e = o, t = k(e.isOpen);
|
|
1682
|
+
return ue(
|
|
1683
1683
|
() => e.isOpen,
|
|
1684
1684
|
(a) => {
|
|
1685
1685
|
t.value = a;
|
|
@@ -1696,11 +1696,11 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1696
1696
|
l("span", On, G(o.title), 1)
|
|
1697
1697
|
]),
|
|
1698
1698
|
A(st, { name: "slide-fade" }, {
|
|
1699
|
-
default:
|
|
1700
|
-
|
|
1701
|
-
|
|
1699
|
+
default: Ee(() => [
|
|
1700
|
+
ae(l("div", Dn, [
|
|
1701
|
+
Se(a.$slots, "default", {}, void 0, !0)
|
|
1702
1702
|
], 512), [
|
|
1703
|
-
[
|
|
1703
|
+
[Qe, t.value]
|
|
1704
1704
|
])
|
|
1705
1705
|
]),
|
|
1706
1706
|
_: 3
|
|
@@ -1724,14 +1724,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1724
1724
|
l("div", Rn, [
|
|
1725
1725
|
l("p", null, G(o.title), 1)
|
|
1726
1726
|
]),
|
|
1727
|
-
|
|
1727
|
+
Se(e.$slots, "default")
|
|
1728
1728
|
]));
|
|
1729
1729
|
}
|
|
1730
1730
|
}), Nn = {
|
|
1731
1731
|
switcher: Fn,
|
|
1732
1732
|
accordion: Pn,
|
|
1733
1733
|
default: Hn
|
|
1734
|
-
},
|
|
1734
|
+
}, we = {
|
|
1735
1735
|
Equal: "==",
|
|
1736
1736
|
Inequal: "!=",
|
|
1737
1737
|
Higer: ">",
|
|
@@ -1747,29 +1747,29 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1747
1747
|
}, qn = (o, e) => String(o) === String(e), Wn = (o, e) => String(o) !== String(e), Gn = (o, e) => o > e, Zn = (o, e) => o >= e, Kn = (o, e) => o < e, Jn = (o, e) => o <= e, Yn = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Xn = (o, e) => String(o).startsWith(String(e)), Qn = (o, e) => String(o).endsWith(String(e)), ea = (o, e) => String(o).includes(String(e)), ta = (o, e) => Array.isArray(e) ? e.includes(o) : !1, la = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, It = (o, e) => {
|
|
1748
1748
|
if (!e) return !0;
|
|
1749
1749
|
switch (e?.[1]) {
|
|
1750
|
-
case
|
|
1750
|
+
case we.Equal:
|
|
1751
1751
|
return qn(o, e?.[2]);
|
|
1752
|
-
case
|
|
1752
|
+
case we.Inequal:
|
|
1753
1753
|
return Wn(o, e?.[2]);
|
|
1754
|
-
case
|
|
1754
|
+
case we.Higer:
|
|
1755
1755
|
return Gn(o, e?.[2]);
|
|
1756
|
-
case
|
|
1756
|
+
case we.HigerOrEqual:
|
|
1757
1757
|
return Zn(o, e?.[2]);
|
|
1758
|
-
case
|
|
1758
|
+
case we.Lower:
|
|
1759
1759
|
return Kn(o, e?.[2]);
|
|
1760
|
-
case
|
|
1760
|
+
case we.LowerOrEqual:
|
|
1761
1761
|
return Jn(o, e?.[2]);
|
|
1762
|
-
case
|
|
1762
|
+
case we.Between:
|
|
1763
1763
|
return Yn(o, e?.[2]);
|
|
1764
|
-
case
|
|
1764
|
+
case we.StartWith:
|
|
1765
1765
|
return Xn(o, e?.[2]);
|
|
1766
|
-
case
|
|
1766
|
+
case we.EndWith:
|
|
1767
1767
|
return Qn(o, e?.[2]);
|
|
1768
|
-
case
|
|
1768
|
+
case we.Contain:
|
|
1769
1769
|
return ea(o, e?.[2]);
|
|
1770
|
-
case
|
|
1770
|
+
case we.In:
|
|
1771
1771
|
return ta(o, e?.[2]);
|
|
1772
|
-
case
|
|
1772
|
+
case we.NotIn:
|
|
1773
1773
|
return la(o, e?.[2]);
|
|
1774
1774
|
default:
|
|
1775
1775
|
return !0;
|
|
@@ -1795,7 +1795,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1795
1795
|
}
|
|
1796
1796
|
},
|
|
1797
1797
|
setup(o) {
|
|
1798
|
-
const e = o, t =
|
|
1798
|
+
const e = o, t = Ae("formValues", { default: {} }), a = Ae("form"), n = B(() => e.schema?.filter((r) => {
|
|
1799
1799
|
const u = r?.conditions;
|
|
1800
1800
|
if (!u) return !0;
|
|
1801
1801
|
const c = Array.isArray(u) ? u[0] : u, p = t?.value?.[c];
|
|
@@ -1806,8 +1806,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1806
1806
|
title: o.title,
|
|
1807
1807
|
style: be(o.style)
|
|
1808
1808
|
}, {
|
|
1809
|
-
default:
|
|
1810
|
-
(i(!0), d(
|
|
1809
|
+
default: Ee(() => [
|
|
1810
|
+
(i(!0), d(re, null, fe(n.value, (c) => (i(), me(zt, Te({
|
|
1811
1811
|
key: c.name
|
|
1812
1812
|
}, { ref_for: !0 }, c, {
|
|
1813
1813
|
item: c,
|
|
@@ -1855,161 +1855,169 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1855
1855
|
emits: ["change", "update:modelValue"],
|
|
1856
1856
|
setup(o, { emit: e }) {
|
|
1857
1857
|
const t = o, a = e, n = B(() => t.multiple), s = B(() => t.disabled);
|
|
1858
|
-
|
|
1858
|
+
$e(t.style);
|
|
1859
1859
|
const r = B({
|
|
1860
1860
|
get: () => t.modelValue,
|
|
1861
1861
|
set: (h) => a("update:modelValue", h)
|
|
1862
1862
|
});
|
|
1863
1863
|
!r.value && t.defaultValue && (r.value = t.defaultValue);
|
|
1864
|
-
const u =
|
|
1864
|
+
const u = k(null), c = k(null), p = k(null), f = k(null), m = k(!1), y = k(!1), S = k(null), q = k([]), R = k(-1), K = k([]), T = k(""), H = k(null), I = k("bottom"), v = k({}), x = k([]), V = B(() => {
|
|
1865
1865
|
if (!x.value.length) return [];
|
|
1866
|
-
const h = new Map(
|
|
1867
|
-
return x.value.map((
|
|
1868
|
-
}),
|
|
1866
|
+
const h = q.value, b = new Map(h.map((w) => [w.id?.toString(), w]));
|
|
1867
|
+
return x.value.map((w) => b.get(w?.toString())).filter((w) => !!w);
|
|
1868
|
+
}), $ = B(() => t.placeholder || "Select..."), F = B(() => W(S.value)), te = B(() => n.value ? !x.value.length && T.value === "" : !F.value && T.value === ""), J = B(() => s.value ? !1 : n.value ? x.value.length > 0 : !!r.value), M = (h) => n.value ? x.value.some((b) => b?.toString() === h?.toString()) : r.value?.toString() === h?.toString(), Z = B(() => {
|
|
1869
1869
|
let h = q.value ?? [];
|
|
1870
1870
|
if (!t.data && T.value.trim() !== "") {
|
|
1871
|
-
const
|
|
1872
|
-
h = h.filter((
|
|
1873
|
-
const P = W(
|
|
1874
|
-
return P.includes(
|
|
1871
|
+
const b = T.value.toLowerCase();
|
|
1872
|
+
h = h.filter((w) => {
|
|
1873
|
+
const P = W(w).toLowerCase(), ne = w.text?.toLowerCase?.() || "";
|
|
1874
|
+
return P.includes(b) || ne.includes(b);
|
|
1875
1875
|
});
|
|
1876
1876
|
}
|
|
1877
1877
|
if (n.value && x.value.length) {
|
|
1878
|
-
const
|
|
1879
|
-
h = h.filter((
|
|
1878
|
+
const b = new Set(x.value.map((w) => w?.toString()));
|
|
1879
|
+
h = h.filter((w) => !b.has(w.id?.toString()));
|
|
1880
1880
|
}
|
|
1881
1881
|
return h;
|
|
1882
|
-
}), N =
|
|
1882
|
+
}), N = Ae("values"), le = /\{\{\s*([^}]+?)\s*\}\}/g, z = (h) => (h ? String(h) : "").replace(/<[^>]*>/g, "").trim(), j = B(() => t.slot ?? t?.optionTemplate ?? ""), C = (h) => {
|
|
1883
1883
|
if (!h) return "";
|
|
1884
|
-
const
|
|
1885
|
-
return
|
|
1886
|
-
const
|
|
1887
|
-
return
|
|
1884
|
+
const b = j.value;
|
|
1885
|
+
return b ? b.replace(le, (w, P) => {
|
|
1886
|
+
const ne = P.trim(), pe = h[ne];
|
|
1887
|
+
return pe != null ? String(pe) : "";
|
|
1888
1888
|
}) : h.text ?? "";
|
|
1889
1889
|
}, W = (h) => {
|
|
1890
1890
|
if (!h) return "";
|
|
1891
1891
|
if (!j.value) return h.text ?? "";
|
|
1892
|
-
const
|
|
1893
|
-
return z(
|
|
1892
|
+
const w = C(h);
|
|
1893
|
+
return z(w) || h.text || "";
|
|
1894
1894
|
}, oe = (h) => {
|
|
1895
|
-
t.set && N?.value && Object.entries(t.set).forEach(([
|
|
1896
|
-
if (!
|
|
1897
|
-
const P = h ? h[
|
|
1898
|
-
N.value[
|
|
1895
|
+
t.set && N?.value && Object.entries(t.set).forEach(([b, w]) => {
|
|
1896
|
+
if (!b) return;
|
|
1897
|
+
const P = h ? h[w] : null;
|
|
1898
|
+
N.value[b] = P ?? null;
|
|
1899
1899
|
});
|
|
1900
|
-
},
|
|
1900
|
+
}, se = B(() => t.parent ? N?.value?.[t.parent]?.toString() ?? null : null), Le = async (h) => {
|
|
1901
1901
|
if (!t.data) {
|
|
1902
|
-
let
|
|
1902
|
+
let b = t.options ?? [];
|
|
1903
1903
|
if (h?.trim()) {
|
|
1904
|
-
const
|
|
1905
|
-
|
|
1906
|
-
const
|
|
1907
|
-
return
|
|
1904
|
+
const w = h.toLowerCase();
|
|
1905
|
+
b = b.filter((P) => {
|
|
1906
|
+
const ne = W(P).toLowerCase(), pe = P.text?.toLowerCase?.() || "";
|
|
1907
|
+
return ne.includes(w) || pe.includes(w);
|
|
1908
1908
|
});
|
|
1909
1909
|
}
|
|
1910
|
-
return
|
|
1910
|
+
return b;
|
|
1911
1911
|
}
|
|
1912
1912
|
try {
|
|
1913
|
-
const
|
|
1914
|
-
return
|
|
1913
|
+
const b = t.host ?? "", w = t.prefix ?? "api", P = t.api ?? `/${w}/suggest/${t.data}`, ne = `${b}${P}`, pe = new URLSearchParams();
|
|
1914
|
+
return pe.set("json", "1"), h && pe.set("key", h), se.value !== void 0 && se.value !== null && se.value !== "" && pe.set("parent", se.value), (await fetch(`${ne}?${pe.toString()}`).then((ze) => ze.json()))?.data ?? [];
|
|
1915
1915
|
} catch {
|
|
1916
1916
|
return [];
|
|
1917
1917
|
}
|
|
1918
1918
|
}, Oe = async () => {
|
|
1919
|
-
t.data ? q.value = await
|
|
1920
|
-
},
|
|
1919
|
+
t.data ? q.value = await Le(T.value) : q.value = t.options ? [...t.options] : [];
|
|
1920
|
+
}, Ge = async (h) => {
|
|
1921
1921
|
if (h == null) return null;
|
|
1922
|
-
const
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1922
|
+
const b = q.value?.find((w) => w?.id?.toString() === String(h));
|
|
1923
|
+
if (b) return b;
|
|
1924
|
+
if (t.data)
|
|
1925
|
+
try {
|
|
1926
|
+
const w = t.host ?? "", P = t.prefix ?? "api", ne = t.api ?? `/${P}/suggest/${t.data}`, pe = `${w}${ne}`, xe = new URLSearchParams();
|
|
1927
|
+
return xe.set("json", "1"), xe.set("val", String(h)), se.value !== void 0 && se.value !== null && se.value !== "" && xe.set("parent", se.value), ((await fetch(`${pe}?${xe.toString()}`).then((Pe) => Pe.json()))?.data ?? [])?.[0] ?? null;
|
|
1928
|
+
} catch {
|
|
1929
|
+
return null;
|
|
1930
|
+
}
|
|
1931
|
+
return null;
|
|
1932
|
+
}, tt = async (h) => {
|
|
1933
|
+
const b = new Set(q.value.map((P) => P.id?.toString())), w = h.filter((P) => !b.has(P?.toString()));
|
|
1934
|
+
w.length && await w.reduce(async (P, ne) => {
|
|
1927
1935
|
await P;
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1936
|
+
const pe = await Ge(ne);
|
|
1937
|
+
pe && q.value.push(pe);
|
|
1930
1938
|
}, Promise.resolve());
|
|
1931
1939
|
}, De = async () => {
|
|
1932
|
-
s.value || (m.value = !0, await Oe(), await
|
|
1940
|
+
s.value || (m.value = !0, await Oe(), await je(() => {
|
|
1933
1941
|
Me(), H.value?.focus(), Z.value.length ? R.value = 0 : R.value = -1;
|
|
1934
1942
|
}));
|
|
1935
|
-
},
|
|
1943
|
+
}, Ce = () => {
|
|
1936
1944
|
m.value = !1, R.value = -1;
|
|
1937
|
-
},
|
|
1945
|
+
}, g = async (h) => {
|
|
1938
1946
|
if (s.value) return;
|
|
1939
|
-
!m.value ? await De() :
|
|
1940
|
-
},
|
|
1947
|
+
!m.value ? await De() : Ce();
|
|
1948
|
+
}, _ = async () => {
|
|
1941
1949
|
m.value ? H.value?.focus() : await De();
|
|
1942
1950
|
}, Y = () => {
|
|
1943
|
-
n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), oe(null), T.value = "",
|
|
1951
|
+
n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), oe(null), T.value = "", je(() => H.value?.focus());
|
|
1944
1952
|
}, O = (h) => {
|
|
1945
|
-
n.value && (x.value = x.value.filter((
|
|
1953
|
+
n.value && (x.value = x.value.filter((b) => b?.toString() !== h?.toString()), r.value = [...x.value], a("change", r.value), je(() => H.value?.focus()));
|
|
1946
1954
|
}, Q = (h) => {
|
|
1947
|
-
n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value], a("change", r.value)), T.value = "",
|
|
1955
|
+
n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value], a("change", r.value)), T.value = "", je(() => {
|
|
1948
1956
|
H.value?.focus(), R.value = Math.min(R.value, Z.value.length - 1);
|
|
1949
|
-
}), oe(null)) : (S.value = h, r.value = h.id, a("change", r.value), T.value = "",
|
|
1957
|
+
}), oe(null)) : (S.value = h, r.value = h.id, a("change", r.value), T.value = "", Ce(), oe(h));
|
|
1950
1958
|
}, he = (h) => {
|
|
1951
1959
|
M(h.id) || Q(h);
|
|
1952
|
-
},
|
|
1953
|
-
if (!h || !
|
|
1954
|
-
const
|
|
1955
|
-
let
|
|
1956
|
-
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1959
|
-
},
|
|
1960
|
-
let
|
|
1961
|
-
for (;
|
|
1962
|
-
if (
|
|
1963
|
-
return
|
|
1964
|
-
const
|
|
1965
|
-
if (P.includes("auto") || P.includes("scroll") ||
|
|
1966
|
-
return
|
|
1967
|
-
|
|
1960
|
+
}, Ve = (h, b) => {
|
|
1961
|
+
if (!h || !b) return;
|
|
1962
|
+
const w = h.offsetTop, P = w + h.offsetHeight, ne = b.scrollTop, pe = ne + b.clientHeight;
|
|
1963
|
+
let xe = b.scrollTop;
|
|
1964
|
+
w < ne ? xe = w - 80 : P > pe && (xe = P - b.clientHeight + 4);
|
|
1965
|
+
const ze = b;
|
|
1966
|
+
ze.scrollTop = xe;
|
|
1967
|
+
}, Be = (h) => {
|
|
1968
|
+
let b = h.parentElement;
|
|
1969
|
+
for (; b; ) {
|
|
1970
|
+
if (b.classList.contains("ui-dialog__content"))
|
|
1971
|
+
return b;
|
|
1972
|
+
const w = window.getComputedStyle(b), P = w.overflow + w.overflowY + w.overflowX;
|
|
1973
|
+
if (P.includes("auto") || P.includes("scroll") || b === document.body || b === document.documentElement)
|
|
1974
|
+
return b;
|
|
1975
|
+
b = b.parentElement;
|
|
1968
1976
|
}
|
|
1969
1977
|
return document.body;
|
|
1970
1978
|
}, Me = () => {
|
|
1971
1979
|
if (!c.value) return;
|
|
1972
|
-
const h = c.value.getBoundingClientRect(),
|
|
1973
|
-
let { width:
|
|
1974
|
-
|
|
1975
|
-
let { left:
|
|
1976
|
-
|
|
1980
|
+
const h = c.value.getBoundingClientRect(), b = window.innerHeight || document.documentElement.clientHeight, w = window.innerWidth || document.documentElement.clientWidth, P = 8, ne = 8, pe = t.maxHeight || 300, xe = b - h.bottom - ne - P, ze = h.top - ne - P, Ue = xe >= ze, Pe = Math.max(w - P * 2, 0);
|
|
1981
|
+
let { width: Re } = h;
|
|
1982
|
+
Pe > 0 && Re > Pe && (Re = Pe);
|
|
1983
|
+
let { left: He } = h;
|
|
1984
|
+
He + Re + P > w && (He = w - Re - P), He = Math.max(He, P);
|
|
1977
1985
|
const Ht = Math.min(
|
|
1978
|
-
|
|
1979
|
-
Math.max(
|
|
1986
|
+
pe,
|
|
1987
|
+
Math.max(Ue ? xe : ze, 50)
|
|
1980
1988
|
);
|
|
1981
|
-
I.value =
|
|
1989
|
+
I.value = Ue ? "bottom" : "top", v.value = {
|
|
1982
1990
|
position: "fixed",
|
|
1983
|
-
left: `${
|
|
1984
|
-
width: `${
|
|
1991
|
+
left: `${He}px`,
|
|
1992
|
+
width: `${Re}px`,
|
|
1985
1993
|
minWidth: "300px",
|
|
1986
1994
|
maxHeight: `${Ht}px`,
|
|
1987
|
-
transform:
|
|
1988
|
-
top:
|
|
1995
|
+
transform: Ue ? "none" : "translateY(-100%)",
|
|
1996
|
+
top: Ue ? `${h.bottom + ne}px` : `${h.top - ne}px`
|
|
1989
1997
|
};
|
|
1990
|
-
},
|
|
1998
|
+
}, Ie = async (h) => {
|
|
1991
1999
|
s.value || !m.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await De());
|
|
1992
2000
|
}, Tt = (h) => {
|
|
1993
2001
|
if (!m.value) return;
|
|
1994
|
-
const { key:
|
|
1995
|
-
if (
|
|
1996
|
-
h.preventDefault(), R.value + 1 < Z.value.length && (R.value += 1,
|
|
1997
|
-
else if (
|
|
1998
|
-
h.preventDefault(), R.value > 0 && (R.value -= 1,
|
|
1999
|
-
else if (
|
|
2002
|
+
const { key: b } = h;
|
|
2003
|
+
if (b === "ArrowDown")
|
|
2004
|
+
h.preventDefault(), R.value + 1 < Z.value.length && (R.value += 1, Ve(K.value[R.value], p.value));
|
|
2005
|
+
else if (b === "ArrowUp")
|
|
2006
|
+
h.preventDefault(), R.value > 0 && (R.value -= 1, Ve(K.value[R.value], p.value));
|
|
2007
|
+
else if (b === "Enter") {
|
|
2000
2008
|
h.preventDefault();
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
} else
|
|
2009
|
+
const w = Z.value[R.value];
|
|
2010
|
+
w && Q(w), H.value?.blur();
|
|
2011
|
+
} else b === "Escape" ? (h.preventDefault(), Ce()) : b === "Backspace" ? n.value && T.value === "" && x.value.length && (x.value = x.value.slice(0, -1), r.value = [...x.value], a("change", r.value)) : b === "Home" ? (R.value = 0, Ve(K.value[0], p.value)) : b === "End" ? (R.value = Z.value.length - 1, Ve(K.value[R.value], p.value)) : b === "Tab" && Ce();
|
|
2004
2012
|
}, Ft = () => {
|
|
2005
2013
|
s.value || (y.value = !0);
|
|
2006
2014
|
}, Ot = () => {
|
|
2007
2015
|
y.value = !1, T.value = "";
|
|
2008
2016
|
}, rt = (h) => {
|
|
2009
|
-
h.key === "Escape" && m.value &&
|
|
2017
|
+
h.key === "Escape" && m.value && Ce();
|
|
2010
2018
|
}, it = (h) => {
|
|
2011
|
-
const
|
|
2012
|
-
u.value?.contains(
|
|
2019
|
+
const b = h.target;
|
|
2020
|
+
u.value?.contains(b) || f.value?.contains(b) || Ce();
|
|
2013
2021
|
}, ut = (h) => {
|
|
2014
2022
|
m.value && p.value && !p.value.contains(h.target) && Me();
|
|
2015
2023
|
}, dt = () => {
|
|
@@ -2017,78 +2025,78 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2017
2025
|
}, ct = () => {
|
|
2018
2026
|
m.value && Me();
|
|
2019
2027
|
};
|
|
2020
|
-
|
|
2021
|
-
h?.length && (q.value = [...h],
|
|
2028
|
+
ue(() => t.options, (h) => {
|
|
2029
|
+
h?.length && (q.value = [...h], Ze());
|
|
2022
2030
|
}, { immediate: !0 });
|
|
2023
|
-
async function
|
|
2031
|
+
async function Ze() {
|
|
2024
2032
|
if (n.value)
|
|
2025
|
-
Array.isArray(r.value) ? x.value = [...r.value] : (x.value = r.value == null ? [] : [r.value], r.value = [...x.value]),
|
|
2033
|
+
Array.isArray(r.value) ? x.value = [...r.value] : (x.value = r.value == null ? [] : [r.value], r.value = [...x.value]), t.data && x.value.length && (await tt(x.value), await je());
|
|
2026
2034
|
else {
|
|
2027
2035
|
if (Array.isArray(r.value)) {
|
|
2028
2036
|
const h = r.value[0] ?? null;
|
|
2029
2037
|
r.value = h ?? null;
|
|
2030
2038
|
}
|
|
2031
|
-
S.value = await
|
|
2039
|
+
r.value != null && (S.value = await Ge(r.value)), oe(S.value ?? null);
|
|
2032
2040
|
}
|
|
2033
2041
|
}
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
}),
|
|
2037
|
-
addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value &&
|
|
2038
|
-
}),
|
|
2039
|
-
removeEventListener("keydown", rt), removeEventListener("scroll", ut, !0), removeEventListener("resize", dt), document.removeEventListener("click", it, !0), c.value &&
|
|
2042
|
+
ue(r, () => {
|
|
2043
|
+
Ze();
|
|
2044
|
+
}), _e(async () => {
|
|
2045
|
+
addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value && Be(c.value).addEventListener("scroll", ct, !0), t.options?.length && !t.data ? q.value = [...t.options] : t.data && (q.value = await Le("")), await Ze();
|
|
2046
|
+
}), Xe(() => {
|
|
2047
|
+
removeEventListener("keydown", rt), removeEventListener("scroll", ut, !0), removeEventListener("resize", dt), document.removeEventListener("click", it, !0), c.value && Be(c.value).removeEventListener("scroll", ct, !0);
|
|
2040
2048
|
});
|
|
2041
|
-
const
|
|
2049
|
+
const Ke = k(!1), lt = k({}), pt = k([]), ft = k(null);
|
|
2042
2050
|
async function Dt() {
|
|
2043
2051
|
if (!t.add?.token || ft?.value.validate())
|
|
2044
2052
|
return;
|
|
2045
|
-
const
|
|
2053
|
+
const b = t.add.api ?? `/api/table/${t.add.token}`, { id: w } = await fetch(b, {
|
|
2046
2054
|
method: "POST",
|
|
2047
2055
|
headers: { "Content-Type": "application/json" },
|
|
2048
|
-
body: JSON.stringify(
|
|
2056
|
+
body: JSON.stringify(lt.value)
|
|
2049
2057
|
}).then((P) => P.json());
|
|
2050
2058
|
if (!t.options?.length && t.data) {
|
|
2051
|
-
const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${
|
|
2052
|
-
S.value = P[0], q.value.push(P[0]), r.value =
|
|
2059
|
+
const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${w}`).then((ne) => ne.json());
|
|
2060
|
+
S.value = P[0], q.value.push(P[0]), r.value = w;
|
|
2053
2061
|
}
|
|
2054
|
-
|
|
2062
|
+
Ke.value = !1, ce({ title: "Success!", message: "Object created." });
|
|
2055
2063
|
}
|
|
2056
2064
|
async function Ut() {
|
|
2057
2065
|
if (!t.add) return null;
|
|
2058
|
-
const h = await fetch(`/api/template/form/${t.add.form}`).then((
|
|
2059
|
-
return pt.value = h.schema,
|
|
2066
|
+
const h = await fetch(`/api/template/form/${t.add.form}`).then((b) => b.json());
|
|
2067
|
+
return pt.value = h.schema, Ke.value = !0, null;
|
|
2060
2068
|
}
|
|
2061
|
-
function Pt(h,
|
|
2062
|
-
let
|
|
2069
|
+
function Pt(h, b = 200) {
|
|
2070
|
+
let w;
|
|
2063
2071
|
return (...P) => {
|
|
2064
|
-
|
|
2072
|
+
w && clearTimeout(w), w = window.setTimeout(() => h(...P), b);
|
|
2065
2073
|
};
|
|
2066
2074
|
}
|
|
2067
2075
|
const Rt = Pt(async (h) => {
|
|
2068
|
-
q.value = await
|
|
2076
|
+
q.value = await Le(h);
|
|
2069
2077
|
}, 200);
|
|
2070
|
-
return
|
|
2078
|
+
return ue(T, (h) => {
|
|
2071
2079
|
t.data && Rt(h.trim());
|
|
2072
|
-
}),
|
|
2073
|
-
!t.data && h?.length && (q.value = [...h],
|
|
2074
|
-
}, { immediate: !0 }),
|
|
2080
|
+
}), ue(() => t.options, (h) => {
|
|
2081
|
+
!t.data && h?.length && (q.value = [...h], Ze());
|
|
2082
|
+
}, { immediate: !0 }), ue(() => t.parent ?? t.parentValue, () => {
|
|
2075
2083
|
t.data && Oe();
|
|
2076
|
-
}),
|
|
2084
|
+
}), ue(se, async () => {
|
|
2077
2085
|
t.data && (n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), await Oe());
|
|
2078
|
-
}), (h,
|
|
2086
|
+
}), (h, b) => (i(), d(re, null, [
|
|
2079
2087
|
A(ee(Lt), {
|
|
2080
|
-
visible:
|
|
2081
|
-
"onUpdate:visible":
|
|
2088
|
+
visible: Ke.value,
|
|
2089
|
+
"onUpdate:visible": b[1] || (b[1] = (w) => Ke.value = w),
|
|
2082
2090
|
title: "Додати",
|
|
2083
2091
|
buttonText: "Додати",
|
|
2084
2092
|
onDone: Dt,
|
|
2085
2093
|
teleport: h.teleport
|
|
2086
2094
|
}, {
|
|
2087
|
-
default:
|
|
2088
|
-
A(
|
|
2095
|
+
default: Ee(() => [
|
|
2096
|
+
A(We, {
|
|
2089
2097
|
schema: pt.value,
|
|
2090
|
-
modelValue:
|
|
2091
|
-
"onUpdate:modelValue":
|
|
2098
|
+
modelValue: lt.value,
|
|
2099
|
+
"onUpdate:modelValue": b[0] || (b[0] = (w) => lt.value = w),
|
|
2092
2100
|
ref_key: "addForm",
|
|
2093
2101
|
ref: ft
|
|
2094
2102
|
}, null, 8, ["schema", "modelValue"])
|
|
@@ -2099,17 +2107,17 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2099
2107
|
class: "flex gap-1 w-full",
|
|
2100
2108
|
ref_key: "selectRoot",
|
|
2101
2109
|
ref: u,
|
|
2102
|
-
onClick:
|
|
2110
|
+
onClick: b[4] || (b[4] = ke(() => {
|
|
2103
2111
|
}, ["stop"]))
|
|
2104
2112
|
}, [
|
|
2105
2113
|
l("div", {
|
|
2106
2114
|
class: E(["relative w-full font-sans", t.customClass])
|
|
2107
2115
|
}, [
|
|
2108
|
-
|
|
2116
|
+
b[9] || (b[9] = l("span", {
|
|
2109
2117
|
id: "react-select-live-region",
|
|
2110
2118
|
class: "sr-only"
|
|
2111
2119
|
}, null, -1)),
|
|
2112
|
-
|
|
2120
|
+
b[10] || (b[10] = l("span", {
|
|
2113
2121
|
"aria-live": "polite",
|
|
2114
2122
|
"aria-atomic": "false",
|
|
2115
2123
|
"aria-relevant": "additions text",
|
|
@@ -2126,8 +2134,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2126
2134
|
role: "combobox",
|
|
2127
2135
|
"aria-expanded": m.value,
|
|
2128
2136
|
"aria-haspopup": "listbox",
|
|
2129
|
-
onKeydown:
|
|
2130
|
-
onClick:
|
|
2137
|
+
onKeydown: Ie,
|
|
2138
|
+
onClick: _,
|
|
2131
2139
|
"data-focus": m.value || y.value ? "true" : "false"
|
|
2132
2140
|
}, [
|
|
2133
2141
|
l("div", {
|
|
@@ -2135,33 +2143,33 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2135
2143
|
ref_key: "triggerRef",
|
|
2136
2144
|
ref: c
|
|
2137
2145
|
}, [
|
|
2138
|
-
n.value && x.value.length ? (i(!0), d(
|
|
2146
|
+
n.value && x.value.length ? (i(!0), d(re, { key: 0 }, fe(V.value, (w) => (i(), d("div", {
|
|
2139
2147
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2140
|
-
key:
|
|
2148
|
+
key: w.id
|
|
2141
2149
|
}, [
|
|
2142
2150
|
l("div", aa, [
|
|
2143
|
-
|
|
2151
|
+
w?.color ? (i(), d("span", {
|
|
2144
2152
|
key: 0,
|
|
2145
2153
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2146
|
-
style: be({ backgroundColor:
|
|
2154
|
+
style: be({ backgroundColor: w?.color })
|
|
2147
2155
|
}, null, 4)) : D("", !0),
|
|
2148
2156
|
l("div", {
|
|
2149
2157
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2150
|
-
title: W(
|
|
2158
|
+
title: W(w)
|
|
2151
2159
|
}, [
|
|
2152
2160
|
j.value ? (i(), d("span", {
|
|
2153
2161
|
key: 0,
|
|
2154
|
-
innerHTML:
|
|
2155
|
-
}, null, 8, ra)) : (i(), d(
|
|
2156
|
-
ge(G(
|
|
2162
|
+
innerHTML: C(w)
|
|
2163
|
+
}, null, 8, ra)) : (i(), d(re, { key: 1 }, [
|
|
2164
|
+
ge(G(w.text), 1)
|
|
2157
2165
|
], 64))
|
|
2158
2166
|
], 8, sa)
|
|
2159
2167
|
]),
|
|
2160
2168
|
l("div", {
|
|
2161
2169
|
role: "button",
|
|
2162
2170
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2163
|
-
onClick:
|
|
2164
|
-
},
|
|
2171
|
+
onClick: ke((P) => O(w.id), ["stop"])
|
|
2172
|
+
}, b[5] || (b[5] = [
|
|
2165
2173
|
l("svg", {
|
|
2166
2174
|
height: "14",
|
|
2167
2175
|
width: "14",
|
|
@@ -2186,15 +2194,15 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2186
2194
|
j.value ? (i(), d("span", {
|
|
2187
2195
|
key: 1,
|
|
2188
2196
|
class: E({ "pl-5": S.value?.color }),
|
|
2189
|
-
innerHTML:
|
|
2197
|
+
innerHTML: C(S.value)
|
|
2190
2198
|
}, null, 10, da)) : (i(), d("span", {
|
|
2191
2199
|
key: 2,
|
|
2192
2200
|
class: E({ "pl-5": S.value?.color })
|
|
2193
2201
|
}, G(S.value?.text), 3))
|
|
2194
2202
|
], 8, ua)) : D("", !0),
|
|
2195
|
-
te.value ? (i(), d("div", ca, G(
|
|
2203
|
+
te.value ? (i(), d("div", ca, G($.value), 1)) : D("", !0),
|
|
2196
2204
|
l("div", pa, [
|
|
2197
|
-
!s.value && h.search ?
|
|
2205
|
+
!s.value && h.search ? ae((i(), d("input", {
|
|
2198
2206
|
key: 0,
|
|
2199
2207
|
ref_key: "inputRef",
|
|
2200
2208
|
ref: H,
|
|
@@ -2207,7 +2215,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2207
2215
|
tabindex: "0",
|
|
2208
2216
|
"aria-autocomplete": "list",
|
|
2209
2217
|
placeholder: (n.value && x.value.length ? " " : null) || y.value && !T.value?.length && F.value || " ",
|
|
2210
|
-
"onUpdate:modelValue":
|
|
2218
|
+
"onUpdate:modelValue": b[2] || (b[2] = (w) => T.value = w),
|
|
2211
2219
|
onFocus: Ft,
|
|
2212
2220
|
onBlur: Ot,
|
|
2213
2221
|
onKeydown: Tt
|
|
@@ -2223,8 +2231,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2223
2231
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2224
2232
|
"aria-hidden": "true",
|
|
2225
2233
|
disabled: s.value,
|
|
2226
|
-
onClick:
|
|
2227
|
-
},
|
|
2234
|
+
onClick: ke(Y, ["stop"])
|
|
2235
|
+
}, b[6] || (b[6] = [
|
|
2228
2236
|
l("svg", {
|
|
2229
2237
|
height: "20",
|
|
2230
2238
|
width: "20",
|
|
@@ -2234,15 +2242,15 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2234
2242
|
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
2235
2243
|
], -1)
|
|
2236
2244
|
]), 8, va)) : D("", !0),
|
|
2237
|
-
|
|
2245
|
+
b[8] || (b[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2238
2246
|
l("button", {
|
|
2239
2247
|
type: "button",
|
|
2240
2248
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2241
2249
|
"aria-hidden": "true",
|
|
2242
2250
|
disabled: s.value,
|
|
2243
|
-
onClick:
|
|
2251
|
+
onClick: b[3] || (b[3] = ke((w) => g(), ["stop"])),
|
|
2244
2252
|
title: m.value ? "Закрити список" : "Відкрити список"
|
|
2245
|
-
},
|
|
2253
|
+
}, b[7] || (b[7] = [
|
|
2246
2254
|
l("svg", {
|
|
2247
2255
|
height: "20",
|
|
2248
2256
|
width: "20",
|
|
@@ -2271,38 +2279,38 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2271
2279
|
ref_key: "listRef",
|
|
2272
2280
|
ref: p
|
|
2273
2281
|
}, [
|
|
2274
|
-
Z.value.length ? (i(!0), d(
|
|
2275
|
-
key:
|
|
2282
|
+
Z.value.length ? (i(!0), d(re, { key: 0 }, fe(Z.value, (w, P) => (i(), d("div", {
|
|
2283
|
+
key: w.id,
|
|
2276
2284
|
ref_for: !0,
|
|
2277
|
-
ref: (
|
|
2285
|
+
ref: (ne) => K.value[P] = ne,
|
|
2278
2286
|
class: E([
|
|
2279
2287
|
"flex px-3 py-2 cursor-default select-none text-gray-900 ",
|
|
2280
|
-
M(
|
|
2281
|
-
R.value === P && !M(
|
|
2288
|
+
M(w.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
|
|
2289
|
+
R.value === P && !M(w.id) ? "bg-blue-100" : ""
|
|
2282
2290
|
]),
|
|
2283
|
-
"aria-disabled": M(
|
|
2291
|
+
"aria-disabled": M(w.id) ? "true" : "false",
|
|
2284
2292
|
role: "option",
|
|
2285
2293
|
tabindex: "-1",
|
|
2286
|
-
onClick: (
|
|
2294
|
+
onClick: (ne) => he(w)
|
|
2287
2295
|
}, [
|
|
2288
|
-
|
|
2296
|
+
w?.color ? (i(), d("span", {
|
|
2289
2297
|
key: 0,
|
|
2290
2298
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2291
|
-
style: be({ backgroundColor:
|
|
2299
|
+
style: be({ backgroundColor: w?.color })
|
|
2292
2300
|
}, null, 4)) : D("", !0),
|
|
2293
2301
|
l("div", {
|
|
2294
2302
|
class: E([
|
|
2295
2303
|
"leading-[19px]",
|
|
2296
|
-
R.value ===
|
|
2304
|
+
R.value === w.id ? "text-white" : "",
|
|
2297
2305
|
// active style like react-select
|
|
2298
2306
|
(R.value === P, "")
|
|
2299
2307
|
])
|
|
2300
2308
|
}, [
|
|
2301
2309
|
j.value ? (i(), d("span", {
|
|
2302
2310
|
key: 0,
|
|
2303
|
-
innerHTML:
|
|
2304
|
-
}, null, 8, ba)) : (i(), d(
|
|
2305
|
-
ge(G(
|
|
2311
|
+
innerHTML: C(w)
|
|
2312
|
+
}, null, 8, ba)) : (i(), d(re, { key: 1 }, [
|
|
2313
|
+
ge(G(w.text), 1)
|
|
2306
2314
|
], 64))
|
|
2307
2315
|
], 2)
|
|
2308
2316
|
], 10, ga))), 128)) : (i(), d("div", ya, " No options "))
|
|
@@ -2317,18 +2325,18 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2317
2325
|
disabled: s.value,
|
|
2318
2326
|
type: "button"
|
|
2319
2327
|
}, [
|
|
2320
|
-
A(
|
|
2328
|
+
A(qe, {
|
|
2321
2329
|
width: "16",
|
|
2322
2330
|
height: "16"
|
|
2323
2331
|
}),
|
|
2324
|
-
|
|
2332
|
+
b[11] || (b[11] = l("span", null, "Додати", -1))
|
|
2325
2333
|
], 8, xa)) : D("", !0)
|
|
2326
2334
|
], 512)
|
|
2327
2335
|
], 64));
|
|
2328
2336
|
}
|
|
2329
2337
|
}), wa = ["placeholder", "disabled"], ka = /* @__PURE__ */ U({
|
|
2330
2338
|
__name: "vs-input-textarea",
|
|
2331
|
-
props: /* @__PURE__ */
|
|
2339
|
+
props: /* @__PURE__ */ ie({
|
|
2332
2340
|
style: { default: () => ({}) },
|
|
2333
2341
|
customClass: { default: "" },
|
|
2334
2342
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2342,8 +2350,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2342
2350
|
}),
|
|
2343
2351
|
emits: ["update:modelValue"],
|
|
2344
2352
|
setup(o) {
|
|
2345
|
-
const e = o, { inputClass: t } =
|
|
2346
|
-
return (n, s) =>
|
|
2353
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
2354
|
+
return (n, s) => ae((i(), d("textarea", {
|
|
2347
2355
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
2348
2356
|
placeholder: n.placeholder,
|
|
2349
2357
|
disabled: n.disabled,
|
|
@@ -2492,7 +2500,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2492
2500
|
class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
|
|
2493
2501
|
}, _s = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, $s = { class: "flex items-center justify-center gap-2" }, Cs = ["onClick"], Vs = ["onClick"], Ms = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, Ls = /* @__PURE__ */ U({
|
|
2494
2502
|
__name: "vs-input-datatable",
|
|
2495
|
-
props: /* @__PURE__ */
|
|
2503
|
+
props: /* @__PURE__ */ ie({
|
|
2496
2504
|
colModel: {},
|
|
2497
2505
|
style: {},
|
|
2498
2506
|
customClass: {},
|
|
@@ -2507,14 +2515,14 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2507
2515
|
}),
|
|
2508
2516
|
emits: ["update:modelValue"],
|
|
2509
2517
|
setup(o) {
|
|
2510
|
-
const e = o, t =
|
|
2518
|
+
const e = o, t = de(o, "modelValue"), a = k({}), n = k(""), s = B(() => {
|
|
2511
2519
|
if (!n.value) return t.value ?? [];
|
|
2512
2520
|
const z = n.value.toLowerCase();
|
|
2513
|
-
return t.value.filter((j) => e.colModel?.some((
|
|
2514
|
-
const W = j[
|
|
2521
|
+
return t.value.filter((j) => e.colModel?.some((C) => {
|
|
2522
|
+
const W = j[C.key];
|
|
2515
2523
|
return W ? Array.isArray(W) ? W.join(", ").toLowerCase().includes(z) : String(W).toLowerCase().includes(z) : !1;
|
|
2516
2524
|
}));
|
|
2517
|
-
}), r =
|
|
2525
|
+
}), r = k(null), u = k(null), c = k(!1), p = k(null), f = k({ top: 0, left: 0 }), m = (z) => {
|
|
2518
2526
|
r.value = z;
|
|
2519
2527
|
}, y = (z) => {
|
|
2520
2528
|
u.value = z;
|
|
@@ -2523,66 +2531,66 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2523
2531
|
r.value = null, u.value = null;
|
|
2524
2532
|
return;
|
|
2525
2533
|
}
|
|
2526
|
-
const j = [...t.value], [
|
|
2527
|
-
j.splice(z, 0,
|
|
2534
|
+
const j = [...t.value], [C] = j.splice(r.value, 1);
|
|
2535
|
+
j.splice(z, 0, C), t.value = j, r.value = null, u.value = null;
|
|
2528
2536
|
}, q = (z) => {
|
|
2529
|
-
const
|
|
2530
|
-
f.value = { top:
|
|
2537
|
+
const C = z.currentTarget.getBoundingClientRect();
|
|
2538
|
+
f.value = { top: C.bottom + window.scrollY, left: C.left + window.scrollX }, c.value = !c.value;
|
|
2531
2539
|
}, R = () => {
|
|
2532
2540
|
p.value && p.value.click();
|
|
2533
2541
|
}, K = (z) => {
|
|
2534
|
-
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"],
|
|
2535
|
-
return j.some((W) =>
|
|
2542
|
+
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], C = z.toLowerCase();
|
|
2543
|
+
return j.some((W) => C.endsWith(W));
|
|
2536
2544
|
}, T = (z) => {
|
|
2537
|
-
const
|
|
2538
|
-
if (
|
|
2545
|
+
const C = z.target.files?.[0];
|
|
2546
|
+
if (!C) return;
|
|
2539
2547
|
const W = new FileReader();
|
|
2540
2548
|
W.onload = (oe) => {
|
|
2541
2549
|
try {
|
|
2542
|
-
const
|
|
2543
|
-
if (typeof
|
|
2544
|
-
const
|
|
2545
|
-
Array.isArray(
|
|
2550
|
+
const se = oe.target?.result;
|
|
2551
|
+
if (typeof se == "string") {
|
|
2552
|
+
const Le = JSON.parse(se);
|
|
2553
|
+
Array.isArray(Le) && t.value.push(...Le);
|
|
2546
2554
|
}
|
|
2547
|
-
} catch (
|
|
2548
|
-
console.error("Error parsing file:",
|
|
2555
|
+
} catch (se) {
|
|
2556
|
+
console.error("Error parsing file:", se);
|
|
2549
2557
|
}
|
|
2550
|
-
}, W.readAsText(
|
|
2558
|
+
}, W.readAsText(C);
|
|
2551
2559
|
}, H = () => {
|
|
2552
|
-
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }),
|
|
2553
|
-
W.href =
|
|
2560
|
+
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }), C = URL.createObjectURL(j), W = document.createElement("a");
|
|
2561
|
+
W.href = C, W.download = "data.json", W.click(), URL.revokeObjectURL(C);
|
|
2554
2562
|
};
|
|
2555
|
-
|
|
2563
|
+
_e(async () => {
|
|
2556
2564
|
const z = e.colModel?.filter((j) => j.data);
|
|
2557
2565
|
z?.length && Promise.all(z.map(async (j) => {
|
|
2558
2566
|
const W = await (await fetch(`/api/suggest/${j.data}`)).json();
|
|
2559
2567
|
a.value[j.key] = W.data;
|
|
2560
2568
|
}));
|
|
2561
2569
|
});
|
|
2562
|
-
const I =
|
|
2570
|
+
const I = k(""), v = k(!1);
|
|
2563
2571
|
let x = "edit", V = 0;
|
|
2564
|
-
const
|
|
2572
|
+
const $ = k({}), F = k({});
|
|
2565
2573
|
async function te() {
|
|
2566
|
-
I.value = "Додати", v.value = !0, x = "add",
|
|
2574
|
+
I.value = "Додати", v.value = !0, x = "add", $.value = {};
|
|
2567
2575
|
}
|
|
2568
2576
|
function J(z, j) {
|
|
2569
|
-
const
|
|
2570
|
-
return a.value[
|
|
2577
|
+
const C = j.key || j.name;
|
|
2578
|
+
return a.value[C] && z[C] ? a.value[C].find((W) => W.id.toString() === z[C].toString())?.text ?? z[C] : z[C] || "-";
|
|
2571
2579
|
}
|
|
2572
2580
|
async function M(z, j) {
|
|
2573
|
-
I.value = "Редагувати", v.value = !0, x = "edit", V = j,
|
|
2581
|
+
I.value = "Редагувати", v.value = !0, x = "edit", V = j, $.value = { ...z };
|
|
2574
2582
|
}
|
|
2575
2583
|
function Z() {
|
|
2576
2584
|
const z = F.value.validate();
|
|
2577
2585
|
if (z) {
|
|
2578
|
-
|
|
2586
|
+
ce({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j, C]) => `${j}: ${C}`).join(`
|
|
2579
2587
|
`) });
|
|
2580
2588
|
return;
|
|
2581
2589
|
}
|
|
2582
|
-
x === "add" ? Array.isArray(t.value) ? t.value = [...t.value,
|
|
2590
|
+
x === "add" ? Array.isArray(t.value) ? t.value = [...t.value, $.value] : t.value = [$.value] : t.value = t.value.map((j, C) => C === V ? $.value : j), v.value = !1;
|
|
2583
2591
|
}
|
|
2584
2592
|
function N(z) {
|
|
2585
|
-
t.value = t.value.filter((j,
|
|
2593
|
+
t.value = t.value.filter((j, C) => C !== z);
|
|
2586
2594
|
}
|
|
2587
2595
|
function le() {
|
|
2588
2596
|
v.value = !1;
|
|
@@ -2595,9 +2603,9 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2595
2603
|
height: "14",
|
|
2596
2604
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2597
2605
|
}),
|
|
2598
|
-
|
|
2606
|
+
ae(l("input", {
|
|
2599
2607
|
type: "text",
|
|
2600
|
-
"onUpdate:modelValue": j[0] || (j[0] = (
|
|
2608
|
+
"onUpdate:modelValue": j[0] || (j[0] = (C) => n.value = C),
|
|
2601
2609
|
placeholder: "Пошук",
|
|
2602
2610
|
class: "py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"
|
|
2603
2611
|
}, null, 512), [
|
|
@@ -2669,7 +2677,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2669
2677
|
onClick: te,
|
|
2670
2678
|
class: "text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
|
|
2671
2679
|
}, [
|
|
2672
|
-
A(
|
|
2680
|
+
A(qe),
|
|
2673
2681
|
j[6] || (j[6] = ge(" Додати ", -1))
|
|
2674
2682
|
])
|
|
2675
2683
|
]),
|
|
@@ -2684,10 +2692,10 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2684
2692
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2685
2693
|
})
|
|
2686
2694
|
]),
|
|
2687
|
-
(i(!0), d(
|
|
2688
|
-
key:
|
|
2695
|
+
(i(!0), d(re, null, fe(z.colModel, (C) => (i(), d("th", {
|
|
2696
|
+
key: C.key,
|
|
2689
2697
|
class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
|
|
2690
|
-
}, G(
|
|
2698
|
+
}, G(C.ua || C.label), 1))), 128)),
|
|
2691
2699
|
j[7] || (j[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
|
|
2692
2700
|
])
|
|
2693
2701
|
]),
|
|
@@ -2705,15 +2713,15 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2705
2713
|
])
|
|
2706
2714
|
])
|
|
2707
2715
|
])) : D("", !0),
|
|
2708
|
-
(i(!0), d(
|
|
2709
|
-
key:
|
|
2716
|
+
(i(!0), d(re, null, fe(s.value, (C, W) => (i(), d("tr", {
|
|
2717
|
+
key: C.id,
|
|
2710
2718
|
class: E(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2711
2719
|
"opacity-50": r.value === W,
|
|
2712
2720
|
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === W
|
|
2713
2721
|
}]),
|
|
2714
2722
|
draggable: "true",
|
|
2715
2723
|
onDragstart: (oe) => m(W),
|
|
2716
|
-
onDragover:
|
|
2724
|
+
onDragover: ke((oe) => y(W), ["prevent"]),
|
|
2717
2725
|
onDrop: (oe) => S(W)
|
|
2718
2726
|
}, [
|
|
2719
2727
|
l("td", vs, [
|
|
@@ -2725,14 +2733,14 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2725
2733
|
})
|
|
2726
2734
|
])
|
|
2727
2735
|
]),
|
|
2728
|
-
(i(!0), d(
|
|
2736
|
+
(i(!0), d(re, null, fe(z.colModel, (oe) => (i(), d("td", {
|
|
2729
2737
|
key: oe.key,
|
|
2730
2738
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2731
2739
|
}, [
|
|
2732
2740
|
oe.type === "file" ? (i(), d("div", gs, [
|
|
2733
|
-
K(J(
|
|
2741
|
+
K(J(C, oe)) ? (i(), d("div", bs, [
|
|
2734
2742
|
l("img", {
|
|
2735
|
-
src: J(
|
|
2743
|
+
src: J(C, oe),
|
|
2736
2744
|
alt: "alt",
|
|
2737
2745
|
width: "45",
|
|
2738
2746
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
@@ -2743,13 +2751,13 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2743
2751
|
])) : oe.type === "tiptap-editor" ? (i(), d("div", {
|
|
2744
2752
|
key: 1,
|
|
2745
2753
|
class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors",
|
|
2746
|
-
innerHTML: J(
|
|
2747
|
-
}, null, 8, ws)) : (i(), d("div", ks, G(J(
|
|
2754
|
+
innerHTML: J(C, oe)
|
|
2755
|
+
}, null, 8, ws)) : (i(), d("div", ks, G(J(C, oe)), 1))
|
|
2748
2756
|
]))), 128)),
|
|
2749
2757
|
l("td", _s, [
|
|
2750
2758
|
l("div", $s, [
|
|
2751
2759
|
l("button", {
|
|
2752
|
-
onClick: (oe) => M(
|
|
2760
|
+
onClick: (oe) => M(C, W),
|
|
2753
2761
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2754
2762
|
}, [
|
|
2755
2763
|
A(Ka, {
|
|
@@ -2762,7 +2770,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2762
2770
|
onClick: (oe) => N(W),
|
|
2763
2771
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2764
2772
|
}, [
|
|
2765
|
-
A(
|
|
2773
|
+
A(et, {
|
|
2766
2774
|
width: "24",
|
|
2767
2775
|
height: "24",
|
|
2768
2776
|
class: "w-3 h-3"
|
|
@@ -2780,18 +2788,18 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2780
2788
|
size: "lg",
|
|
2781
2789
|
onClose: le
|
|
2782
2790
|
}, {
|
|
2783
|
-
default:
|
|
2784
|
-
A(
|
|
2791
|
+
default: Ee(() => [
|
|
2792
|
+
A(We, {
|
|
2785
2793
|
schema: e.colModel,
|
|
2786
|
-
values:
|
|
2787
|
-
"onUpdate:values": j[1] || (j[1] = (
|
|
2794
|
+
values: $.value,
|
|
2795
|
+
"onUpdate:values": j[1] || (j[1] = (C) => $.value = C),
|
|
2788
2796
|
form: F.value,
|
|
2789
|
-
"onUpdate:form": j[2] || (j[2] = (
|
|
2797
|
+
"onUpdate:form": j[2] || (j[2] = (C) => F.value = C)
|
|
2790
2798
|
}, null, 8, ["schema", "values", "form"]),
|
|
2791
2799
|
l("div", Ms, [
|
|
2792
2800
|
l("button", {
|
|
2793
2801
|
type: "button",
|
|
2794
|
-
onClick: j[3] || (j[3] = (
|
|
2802
|
+
onClick: j[3] || (j[3] = (C) => v.value = !1),
|
|
2795
2803
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
|
|
2796
2804
|
}, " Скасувати "),
|
|
2797
2805
|
l("button", {
|
|
@@ -2913,29 +2921,29 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2913
2921
|
}
|
|
2914
2922
|
}
|
|
2915
2923
|
};
|
|
2916
|
-
function
|
|
2924
|
+
function Ne(o) {
|
|
2917
2925
|
return o ? o.type === "Polygon" ? {
|
|
2918
2926
|
type: "MultiPolygon",
|
|
2919
2927
|
coordinates: [o.coordinates]
|
|
2920
2928
|
} : o.type === "Feature" ? {
|
|
2921
2929
|
...o,
|
|
2922
|
-
geometry:
|
|
2930
|
+
geometry: Ne(o.geometry)
|
|
2923
2931
|
} : o.type === "FeatureCollection" ? {
|
|
2924
2932
|
...o,
|
|
2925
|
-
features: (o.features || []).map((e) =>
|
|
2933
|
+
features: (o.features || []).map((e) => Ne(e)).filter(Boolean)
|
|
2926
2934
|
} : o : null;
|
|
2927
2935
|
}
|
|
2928
2936
|
function Bs(o) {
|
|
2929
|
-
return o ? o.type === "FeatureCollection" || o.type === "Feature" ?
|
|
2937
|
+
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? Ne(o) : o.geom ? {
|
|
2930
2938
|
type: "Feature",
|
|
2931
|
-
geometry:
|
|
2939
|
+
geometry: Ne({
|
|
2932
2940
|
type: o.geom.type,
|
|
2933
2941
|
coordinates: o.geom.coordinates
|
|
2934
2942
|
}),
|
|
2935
2943
|
properties: {}
|
|
2936
2944
|
} : o.type && o.coordinates ? {
|
|
2937
2945
|
type: "Feature",
|
|
2938
|
-
geometry:
|
|
2946
|
+
geometry: Ne(o),
|
|
2939
2947
|
properties: {}
|
|
2940
2948
|
} : null : null;
|
|
2941
2949
|
}
|
|
@@ -3063,12 +3071,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3063
3071
|
const t = o, a = e, n = ["here", "xy", "parcel"], s = B(() => {
|
|
3064
3072
|
const v = t.config?.tools?.filter((x) => n.includes(x));
|
|
3065
3073
|
return v && v.length ? v : n;
|
|
3066
|
-
}), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u =
|
|
3067
|
-
|
|
3074
|
+
}), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u = k(s.value[0] ?? n[0]);
|
|
3075
|
+
ue(s, (v) => {
|
|
3068
3076
|
v.includes(u.value) || (u.value = v[0]);
|
|
3069
3077
|
});
|
|
3070
|
-
const c =
|
|
3071
|
-
|
|
3078
|
+
const c = k(""), p = k(!1), f = k(null);
|
|
3079
|
+
ue(u, () => {
|
|
3072
3080
|
c.value = "", p.value = !1;
|
|
3073
3081
|
});
|
|
3074
3082
|
function m(v) {
|
|
@@ -3079,7 +3087,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3079
3087
|
const x = f.value;
|
|
3080
3088
|
x && !x.contains(v.target) && (p.value = !1);
|
|
3081
3089
|
}
|
|
3082
|
-
|
|
3090
|
+
_e(() => {
|
|
3083
3091
|
window.addEventListener("click", y, !0);
|
|
3084
3092
|
}), at(() => {
|
|
3085
3093
|
window.removeEventListener("click", y, !0);
|
|
@@ -3092,9 +3100,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3092
3100
|
if (!x) return null;
|
|
3093
3101
|
const V = x.split(/\s+/).filter(Boolean);
|
|
3094
3102
|
if (V.length < 2) return null;
|
|
3095
|
-
const
|
|
3096
|
-
if (
|
|
3097
|
-
let [F, te] =
|
|
3103
|
+
const $ = V.slice(0, 2).map(Number);
|
|
3104
|
+
if (!$.every((le) => Number.isFinite(le))) return null;
|
|
3105
|
+
let [F, te] = $, J = F, M = te;
|
|
3098
3106
|
const Z = (le) => Math.abs(le) <= 90, N = (le) => Math.abs(le) <= 180;
|
|
3099
3107
|
if (!Z(J) || !N(M))
|
|
3100
3108
|
if (Z(M) && N(J))
|
|
@@ -3104,8 +3112,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3104
3112
|
return { lat: J, lng: M };
|
|
3105
3113
|
}
|
|
3106
3114
|
function R(v) {
|
|
3107
|
-
return (v?.items || []).map((V,
|
|
3108
|
-
id: String(V?.id ??
|
|
3115
|
+
return (v?.items || []).map((V, $) => ({
|
|
3116
|
+
id: String(V?.id ?? $),
|
|
3109
3117
|
title: V?.title || V?.address?.label || "Знайдений обʼєкт",
|
|
3110
3118
|
lat: Number(V?.position?.lat),
|
|
3111
3119
|
lng: Number(V?.position?.lng)
|
|
@@ -3116,21 +3124,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3116
3124
|
if (!x) return [];
|
|
3117
3125
|
const V = x.geom_centroid;
|
|
3118
3126
|
if (!V || !Array.isArray(V.coordinates)) return [];
|
|
3119
|
-
const [
|
|
3120
|
-
return !Number.isFinite(F) || !Number.isFinite(
|
|
3127
|
+
const [$, F] = V.coordinates;
|
|
3128
|
+
return !Number.isFinite(F) || !Number.isFinite($) ? [] : [
|
|
3121
3129
|
{
|
|
3122
3130
|
id: "parcel",
|
|
3123
3131
|
title: x.cadnum || x.cad_num || "Земельна ділянка",
|
|
3124
3132
|
lat: F,
|
|
3125
|
-
lng:
|
|
3133
|
+
lng: $
|
|
3126
3134
|
}
|
|
3127
3135
|
];
|
|
3128
3136
|
}
|
|
3129
3137
|
function T(v) {
|
|
3130
3138
|
const V = v.replace(/\s+/g, "").split(":");
|
|
3131
3139
|
if (V.length !== 4) return !1;
|
|
3132
|
-
const
|
|
3133
|
-
return V.every((F, te) => F.length ===
|
|
3140
|
+
const $ = [10, 2, 3, 4];
|
|
3141
|
+
return V.every((F, te) => F.length === $[te] && /^\d+$/.test(F));
|
|
3134
3142
|
}
|
|
3135
3143
|
function H(v) {
|
|
3136
3144
|
a("goToCoordinates", [v.lat, v.lng]);
|
|
@@ -3141,7 +3149,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3141
3149
|
if (u.value === "xy") {
|
|
3142
3150
|
const x = q(v);
|
|
3143
3151
|
if (!x) {
|
|
3144
|
-
|
|
3152
|
+
ce({ type: "warning", title: "Пошук координат", message: "Не знайдено або невірний формат координат" });
|
|
3145
3153
|
return;
|
|
3146
3154
|
}
|
|
3147
3155
|
H(x), c.value = "";
|
|
@@ -3153,30 +3161,30 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3153
3161
|
x.searchParams.set("searchtext", v);
|
|
3154
3162
|
else {
|
|
3155
3163
|
if (!T(v)) {
|
|
3156
|
-
|
|
3164
|
+
ce({ type: "warning", title: "Пошук кадастру", message: "Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ" });
|
|
3157
3165
|
return;
|
|
3158
3166
|
}
|
|
3159
3167
|
x.searchParams.set("cad_num", v);
|
|
3160
3168
|
}
|
|
3161
3169
|
const V = await fetch(x.toString());
|
|
3162
3170
|
if (!V.ok) throw new Error(`HTTP ${V.status}`);
|
|
3163
|
-
const
|
|
3171
|
+
const $ = await V.json(), F = u.value === "here" ? R($) : K($);
|
|
3164
3172
|
if (!F.length)
|
|
3165
|
-
|
|
3173
|
+
ce({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
|
|
3166
3174
|
else {
|
|
3167
3175
|
const te = F[0];
|
|
3168
3176
|
H(te), c.value = "";
|
|
3169
3177
|
}
|
|
3170
3178
|
} catch (x) {
|
|
3171
3179
|
const V = x?.message || "Помилка пошуку";
|
|
3172
|
-
|
|
3180
|
+
ce({ type: "error", title: "Пошук", message: V });
|
|
3173
3181
|
}
|
|
3174
3182
|
}
|
|
3175
3183
|
}
|
|
3176
3184
|
return (v, x) => (i(), d("div", Ys, [
|
|
3177
3185
|
l("form", {
|
|
3178
3186
|
class: "flex gap-2",
|
|
3179
|
-
onSubmit:
|
|
3187
|
+
onSubmit: ke(I, ["prevent"])
|
|
3180
3188
|
}, [
|
|
3181
3189
|
s.value.length > 1 ? (i(), d("div", {
|
|
3182
3190
|
key: 0,
|
|
@@ -3207,16 +3215,16 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3207
3215
|
]),
|
|
3208
3216
|
p.value ? (i(), d("div", Xs, [
|
|
3209
3217
|
l("ul", null, [
|
|
3210
|
-
(i(!0), d(
|
|
3218
|
+
(i(!0), d(re, null, fe(s.value, (V) => (i(), d("li", {
|
|
3211
3219
|
key: V,
|
|
3212
3220
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
3213
|
-
onClick: (
|
|
3221
|
+
onClick: ($) => m(V)
|
|
3214
3222
|
}, G(S(V)), 9, Qs))), 128))
|
|
3215
3223
|
])
|
|
3216
3224
|
])) : D("", !0)
|
|
3217
3225
|
], 512)) : D("", !0),
|
|
3218
3226
|
l("div", er, [
|
|
3219
|
-
|
|
3227
|
+
ae(l("input", {
|
|
3220
3228
|
"onUpdate:modelValue": x[1] || (x[1] = (V) => c.value = V),
|
|
3221
3229
|
placeholder: r.value,
|
|
3222
3230
|
type: "text",
|
|
@@ -3260,13 +3268,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3260
3268
|
},
|
|
3261
3269
|
emits: ["onLayerChange"],
|
|
3262
3270
|
setup(o, { emit: e }) {
|
|
3263
|
-
const a =
|
|
3271
|
+
const a = k(Object.keys(o.basemaps)[0]), n = e;
|
|
3264
3272
|
function s(r) {
|
|
3265
3273
|
n("onLayerChange", r), a.value = r;
|
|
3266
3274
|
}
|
|
3267
3275
|
return (r, u) => (i(), d("div", sr, [
|
|
3268
3276
|
l("div", rr, [
|
|
3269
|
-
(i(!0), d(
|
|
3277
|
+
(i(!0), d(re, null, fe(r.basemaps, (c, p) => (i(), d("div", {
|
|
3270
3278
|
key: p,
|
|
3271
3279
|
class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": a.value === p }]),
|
|
3272
3280
|
onClick: (f) => s(p),
|
|
@@ -3310,23 +3318,23 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3310
3318
|
},
|
|
3311
3319
|
emits: ["update:modelValue"],
|
|
3312
3320
|
setup(o, { emit: e }) {
|
|
3313
|
-
const t = Wt(), a = o, n = e, s =
|
|
3321
|
+
const t = Wt(), a = o, n = e, s = k(!1), r = k("");
|
|
3314
3322
|
function u() {
|
|
3315
|
-
const
|
|
3323
|
+
const g = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
|
|
3316
3324
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Використовуйте два пальці для зуму карти." : "Використовуйте Ctrl + прокрутка для зуму карти.";
|
|
3317
3325
|
}
|
|
3318
|
-
const c =
|
|
3326
|
+
const c = k(null);
|
|
3319
3327
|
let p, f, m, y = null;
|
|
3320
|
-
const S =
|
|
3321
|
-
|
|
3328
|
+
const S = k(null), q = (g) => {
|
|
3329
|
+
g.ctrlKey && g.preventDefault();
|
|
3322
3330
|
};
|
|
3323
3331
|
function R() {
|
|
3324
3332
|
if (!a.handleZoom) return null;
|
|
3325
|
-
let
|
|
3326
|
-
const
|
|
3333
|
+
let g;
|
|
3334
|
+
const _ = (O) => {
|
|
3327
3335
|
const Q = O.ctrlKey || O.metaKey, he = O.shiftKey;
|
|
3328
3336
|
if (!Q && !he) {
|
|
3329
|
-
s.value = !0, r.value = u(), clearTimeout(
|
|
3337
|
+
s.value = !0, r.value = u(), clearTimeout(g), g = window.setTimeout(() => {
|
|
3330
3338
|
s.value = !1;
|
|
3331
3339
|
}, 1e3);
|
|
3332
3340
|
return;
|
|
@@ -3336,152 +3344,152 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3336
3344
|
}, 100);
|
|
3337
3345
|
}, Y = (O) => {
|
|
3338
3346
|
if (O.touches.length === 1) {
|
|
3339
|
-
s.value = !0, r.value = u(), clearTimeout(
|
|
3347
|
+
s.value = !0, r.value = u(), clearTimeout(g), g = window.setTimeout(() => {
|
|
3340
3348
|
s.value = !1;
|
|
3341
3349
|
}, 3e3);
|
|
3342
3350
|
return;
|
|
3343
3351
|
}
|
|
3344
3352
|
s.value = !1;
|
|
3345
3353
|
};
|
|
3346
|
-
return c.value && (c.value.addEventListener("wheel",
|
|
3354
|
+
return c.value && (c.value.addEventListener("wheel", _, { passive: !1 }), c.value.addEventListener("touchstart", Y, { passive: !0 })), p && p.on("wheel", (O) => {
|
|
3347
3355
|
const Q = O.originalEvent.ctrlKey || O.originalEvent.metaKey, he = O.originalEvent.shiftKey;
|
|
3348
3356
|
!Q && !he && (O.originalEvent.preventDefault(), O.originalEvent.stopPropagation());
|
|
3349
3357
|
}), () => {
|
|
3350
|
-
c.value && (c.value.removeEventListener("wheel",
|
|
3358
|
+
c.value && (c.value.removeEventListener("wheel", _), c.value.removeEventListener("touchstart", Y)), p && p.off("wheel"), clearTimeout(g);
|
|
3351
3359
|
};
|
|
3352
3360
|
}
|
|
3353
|
-
const K =
|
|
3361
|
+
const K = k(null), T = k(6), H = k(0), I = k(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), v = k(null), x = De();
|
|
3354
3362
|
let V;
|
|
3355
|
-
const
|
|
3356
|
-
function F(
|
|
3357
|
-
return
|
|
3363
|
+
const $ = k("topo100");
|
|
3364
|
+
function F(g) {
|
|
3365
|
+
return g ? g.type === "Polygon" ? {
|
|
3358
3366
|
type: "MultiPolygon",
|
|
3359
|
-
coordinates: [
|
|
3360
|
-
} : (
|
|
3367
|
+
coordinates: [g.coordinates]
|
|
3368
|
+
} : (g.type === "MultiPolygon", g) : null;
|
|
3361
3369
|
}
|
|
3362
3370
|
function te() {
|
|
3363
|
-
return new Promise((
|
|
3364
|
-
window.L && window.L.Draw &&
|
|
3371
|
+
return new Promise((g, _) => {
|
|
3372
|
+
window.L && window.L.Draw && g(0);
|
|
3365
3373
|
const Y = (Q) => {
|
|
3366
|
-
if (Array.from(document.styleSheets).some((
|
|
3367
|
-
const
|
|
3368
|
-
|
|
3369
|
-
}, O = (Q) => new Promise((he,
|
|
3370
|
-
const
|
|
3371
|
-
if (
|
|
3372
|
-
|
|
3374
|
+
if (Array.from(document.styleSheets).some((Be) => Be?.href?.includes(Q))) return;
|
|
3375
|
+
const Ve = document.createElement("link");
|
|
3376
|
+
Ve.rel = "stylesheet", Ve.href = Q, document.head.appendChild(Ve);
|
|
3377
|
+
}, O = (Q) => new Promise((he, Ve) => {
|
|
3378
|
+
const Be = Array.from(document.scripts).find((Ie) => Ie.src === Q);
|
|
3379
|
+
if (Be) {
|
|
3380
|
+
Be.addEventListener("load", () => he()), Be.addEventListener("error", (Ie) => Ve(Ie));
|
|
3373
3381
|
return;
|
|
3374
3382
|
}
|
|
3375
3383
|
const Me = document.createElement("script");
|
|
3376
|
-
Me.src = Q, Me.async = !0, Me.onload = () => he(), Me.onerror = (
|
|
3384
|
+
Me.src = Q, Me.async = !0, Me.onload = () => he(), Me.onerror = (Ie) => Ve(Ie), document.body.appendChild(Me);
|
|
3377
3385
|
});
|
|
3378
|
-
Y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), Y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() =>
|
|
3386
|
+
Y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), Y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => g(0)).catch(_);
|
|
3379
3387
|
});
|
|
3380
3388
|
}
|
|
3381
3389
|
function J() {
|
|
3382
|
-
const
|
|
3390
|
+
const g = f.toGeoJSON(), _ = [], Y = (Q) => {
|
|
3383
3391
|
if (Q)
|
|
3384
3392
|
switch (Q.type) {
|
|
3385
3393
|
case "Polygon":
|
|
3386
|
-
|
|
3394
|
+
_.push(Q.coordinates);
|
|
3387
3395
|
break;
|
|
3388
3396
|
case "MultiPolygon":
|
|
3389
|
-
|
|
3397
|
+
_.push(...Q.coordinates);
|
|
3390
3398
|
break;
|
|
3391
3399
|
case "GeometryCollection":
|
|
3392
3400
|
(Q.geometries || []).forEach(Y);
|
|
3393
3401
|
break;
|
|
3394
3402
|
}
|
|
3395
3403
|
};
|
|
3396
|
-
(
|
|
3397
|
-
const O =
|
|
3404
|
+
(g?.features || []).forEach((Q) => Y(Q.geometry));
|
|
3405
|
+
const O = _.length ? { type: "MultiPolygon", coordinates: _ } : null;
|
|
3398
3406
|
n("update:modelValue", O ? F(O) : null), H.value = f.getLayers().length;
|
|
3399
3407
|
}
|
|
3400
|
-
function M(
|
|
3401
|
-
const
|
|
3402
|
-
if (!
|
|
3403
|
-
const O = L.featureGroup(
|
|
3404
|
-
O && O.isValid() && p.fitBounds(O, { padding: [
|
|
3408
|
+
function M(g = 30) {
|
|
3409
|
+
const _ = f.getLayers();
|
|
3410
|
+
if (!_.length) return;
|
|
3411
|
+
const O = L.featureGroup(_).getBounds();
|
|
3412
|
+
O && O.isValid() && p.fitBounds(O, { padding: [g, g] });
|
|
3405
3413
|
}
|
|
3406
3414
|
function Z() {
|
|
3407
3415
|
S.value?.click();
|
|
3408
3416
|
}
|
|
3409
|
-
const N =
|
|
3410
|
-
function le(
|
|
3411
|
-
return
|
|
3417
|
+
const N = k("");
|
|
3418
|
+
function le(g) {
|
|
3419
|
+
return g instanceof L.Circle ? "Circle" : g instanceof L.Rectangle ? "Rectangle" : g instanceof L.Polygon && !(g instanceof L.Rectangle) ? "Polygon" : g instanceof L.Polyline && !(g instanceof L.Polygon) ? "Polyline" : g instanceof L.Marker ? "Point" : "Feature";
|
|
3412
3420
|
}
|
|
3413
|
-
function z(
|
|
3414
|
-
if (
|
|
3415
|
-
const
|
|
3416
|
-
return Math.PI * (
|
|
3421
|
+
function z(g) {
|
|
3422
|
+
if (g instanceof L.Circle) {
|
|
3423
|
+
const _ = g.getRadius();
|
|
3424
|
+
return Math.PI * (_ * _) / 1e6;
|
|
3417
3425
|
}
|
|
3418
|
-
if (
|
|
3426
|
+
if (g instanceof L.Polygon || g instanceof L.Rectangle)
|
|
3419
3427
|
try {
|
|
3420
|
-
const
|
|
3428
|
+
const _ = g.getLatLngs(), Y = Array.isArray(_[0]) ? _[0] : _, O = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(Y) : 0;
|
|
3421
3429
|
return O ? O / 1e6 : 0;
|
|
3422
3430
|
} catch {
|
|
3423
3431
|
return null;
|
|
3424
3432
|
}
|
|
3425
3433
|
return null;
|
|
3426
3434
|
}
|
|
3427
|
-
function j(
|
|
3428
|
-
return
|
|
3435
|
+
function j(g) {
|
|
3436
|
+
return g instanceof L.Circle ? g.getLatLng() : g.getBounds ? g.getBounds().getCenter() : g.getLatLng ? g.getLatLng() : p.getCenter();
|
|
3429
3437
|
}
|
|
3430
|
-
function
|
|
3431
|
-
const
|
|
3432
|
-
if (!
|
|
3438
|
+
function C() {
|
|
3439
|
+
const g = f.getLayers();
|
|
3440
|
+
if (!g.length) {
|
|
3433
3441
|
v.value = null, H.value = 0;
|
|
3434
3442
|
return;
|
|
3435
3443
|
}
|
|
3436
|
-
const
|
|
3444
|
+
const _ = g[g.length - 1], Y = le(_), O = j(_), Q = z(_);
|
|
3437
3445
|
v.value = {
|
|
3438
3446
|
type: Y,
|
|
3439
3447
|
center: O,
|
|
3440
3448
|
areaKm2: Q,
|
|
3441
|
-
layer:
|
|
3442
|
-
}, H.value =
|
|
3449
|
+
layer: _
|
|
3450
|
+
}, H.value = g.length;
|
|
3443
3451
|
}
|
|
3444
3452
|
function W() {
|
|
3445
|
-
const
|
|
3446
|
-
|
|
3453
|
+
const g = v.value?.layer;
|
|
3454
|
+
g && (g instanceof L.Circle && g.getBounds ? p.fitBounds(g.getBounds(), { padding: [30, 30] }) : g.getBounds ? p.fitBounds(g.getBounds(), { padding: [30, 30] }) : g.getLatLng && p.setView(g.getLatLng(), Math.max(T.value, 14)));
|
|
3447
3455
|
}
|
|
3448
3456
|
function oe() {
|
|
3449
|
-
const
|
|
3450
|
-
|
|
3457
|
+
const g = v.value?.layer;
|
|
3458
|
+
g && (f.removeLayer(g), J(), C());
|
|
3451
3459
|
}
|
|
3452
|
-
|
|
3460
|
+
_e(async () => {
|
|
3453
3461
|
document.addEventListener("wheel", q, { passive: !1 }), await te(), L.drawLocal = Ss;
|
|
3454
|
-
const
|
|
3462
|
+
const g = a.handleZoom;
|
|
3455
3463
|
p = L.map(c.value, {
|
|
3456
3464
|
zoomControl: !1,
|
|
3457
|
-
scrollWheelZoom: !
|
|
3465
|
+
scrollWheelZoom: !g
|
|
3458
3466
|
}).setView(I.value, 10), setTimeout(() => {
|
|
3459
3467
|
y = R();
|
|
3460
|
-
}, 100), L.control.zoom({ position: "bottomright" }).addTo(p),
|
|
3468
|
+
}, 100), L.control.zoom({ position: "bottomright" }).addTo(p), $.value = Object.keys(x)[0], V = L.tileLayer(x[$.value].url, { maxZoom: 19, minZoom: 6 }).addTo(p), f = new L.FeatureGroup().addTo(p), p.on(L.Draw.Event.CREATED, (O) => {
|
|
3461
3469
|
const { layer: Q } = O;
|
|
3462
|
-
f.clearLayers(), f.addLayer(Q), J(),
|
|
3470
|
+
f.clearLayers(), f.addLayer(Q), J(), C(), M(), N.value = "";
|
|
3463
3471
|
}), p.on(L.Draw.Event.EDITED, () => {
|
|
3464
|
-
J(),
|
|
3472
|
+
J(), C(), M();
|
|
3465
3473
|
}), p.on(L.Draw.Event.DELETED, () => {
|
|
3466
|
-
J(),
|
|
3474
|
+
J(), C(), M();
|
|
3467
3475
|
});
|
|
3468
|
-
let
|
|
3476
|
+
let _ = !1;
|
|
3469
3477
|
p.on("mousemove", (O) => {
|
|
3470
|
-
|
|
3478
|
+
_ || (p.invalidateSize(), _ = !0), K.value = O.latlng;
|
|
3471
3479
|
}), p.on("zoomend", () => {
|
|
3472
3480
|
T.value = p.getZoom();
|
|
3473
3481
|
});
|
|
3474
3482
|
const Y = Bs(a.modelValue);
|
|
3475
3483
|
if (Y) {
|
|
3476
3484
|
const O = [];
|
|
3477
|
-
L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(),
|
|
3485
|
+
L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(), C(), M();
|
|
3478
3486
|
}
|
|
3479
|
-
}),
|
|
3487
|
+
}), Xe(() => {
|
|
3480
3488
|
document.removeEventListener("wheel", q), y && y();
|
|
3481
3489
|
});
|
|
3482
|
-
function
|
|
3490
|
+
function se(g) {
|
|
3483
3491
|
if (p) {
|
|
3484
|
-
switch (m && m.disable(),
|
|
3492
|
+
switch (m && m.disable(), g) {
|
|
3485
3493
|
case "marker":
|
|
3486
3494
|
m = new L.Draw.Marker(p);
|
|
3487
3495
|
break;
|
|
@@ -3498,15 +3506,15 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3498
3506
|
m = new L.Draw.Rectangle(p);
|
|
3499
3507
|
break;
|
|
3500
3508
|
}
|
|
3501
|
-
m && (m.enable(), N.value =
|
|
3509
|
+
m && (m.enable(), N.value = g);
|
|
3502
3510
|
}
|
|
3503
3511
|
}
|
|
3504
|
-
function
|
|
3505
|
-
const
|
|
3512
|
+
function Le() {
|
|
3513
|
+
const g = f.toGeoJSON(), _ = new Blob([JSON.stringify(g, null, 2)], { type: "application/json" }), Y = URL.createObjectURL(_), O = document.createElement("a");
|
|
3506
3514
|
O.href = Y, O.download = "data.geojson", O.click(), URL.revokeObjectURL(Y);
|
|
3507
3515
|
}
|
|
3508
|
-
function Oe(
|
|
3509
|
-
const
|
|
3516
|
+
function Oe(g) {
|
|
3517
|
+
const _ = g.target, Y = _.files?.[0];
|
|
3510
3518
|
if (!Y) return;
|
|
3511
3519
|
const O = new FileReader();
|
|
3512
3520
|
O.onload = () => {
|
|
@@ -3515,37 +3523,37 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3515
3523
|
const Q = JSON.parse(O.result);
|
|
3516
3524
|
f.clearLayers(), Q && L.geoJSON({ type: "Feature", geometry: Q }).eachLayer((he) => {
|
|
3517
3525
|
f.addLayer(he);
|
|
3518
|
-
}), J(),
|
|
3526
|
+
}), J(), C(), M();
|
|
3519
3527
|
} finally {
|
|
3520
|
-
|
|
3528
|
+
_.value = "";
|
|
3521
3529
|
}
|
|
3522
3530
|
}, O.readAsText(Y);
|
|
3523
3531
|
}
|
|
3524
|
-
function
|
|
3525
|
-
p && (V && p.removeLayer(V), V = L.tileLayer(x[
|
|
3532
|
+
function Ge(g) {
|
|
3533
|
+
p && (V && p.removeLayer(V), V = L.tileLayer(x[g].url, { maxZoom: 19, minZoom: 6 }).addTo(p), $.value = g);
|
|
3526
3534
|
}
|
|
3527
|
-
function
|
|
3528
|
-
const
|
|
3529
|
-
p.setView(
|
|
3535
|
+
function tt(g) {
|
|
3536
|
+
const _ = L.latLng(g[0], g[1]);
|
|
3537
|
+
p.setView(_, 13);
|
|
3530
3538
|
}
|
|
3531
|
-
|
|
3539
|
+
ue(
|
|
3532
3540
|
() => a.modelValue,
|
|
3533
|
-
(
|
|
3534
|
-
const
|
|
3535
|
-
if (
|
|
3536
|
-
n("update:modelValue",
|
|
3541
|
+
(g) => {
|
|
3542
|
+
const _ = F(g);
|
|
3543
|
+
if (g && _ !== g) {
|
|
3544
|
+
n("update:modelValue", _);
|
|
3537
3545
|
return;
|
|
3538
3546
|
}
|
|
3539
|
-
f.clearLayers(),
|
|
3547
|
+
f.clearLayers(), _ && L.geoJSON({ type: "Feature", geometry: _ }).eachLayer((Y) => {
|
|
3540
3548
|
f.addLayer(Y), Y.dragging?.enable(), Y.dragging?.enabled(), Y.on("dragend", (O) => {
|
|
3541
3549
|
const he = O.target.getLatLng();
|
|
3542
3550
|
n("update:modelValue", { type: "Point", coordinates: [he.lng, he.lat] });
|
|
3543
3551
|
});
|
|
3544
|
-
}), H.value = f.getLayers().length,
|
|
3552
|
+
}), H.value = f.getLayers().length, C(), M();
|
|
3545
3553
|
}
|
|
3546
3554
|
);
|
|
3547
3555
|
function De() {
|
|
3548
|
-
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((
|
|
3556
|
+
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((g, _) => Object.assign(g, { key: `b${_}`, preview: g.preview || g.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((g, _) => ({ ...g, [_.key]: _ }), {}) : {
|
|
3549
3557
|
topo100: {
|
|
3550
3558
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3551
3559
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3560,13 +3568,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3560
3568
|
}
|
|
3561
3569
|
};
|
|
3562
3570
|
}
|
|
3563
|
-
const
|
|
3564
|
-
return
|
|
3571
|
+
const Ce = k(!1);
|
|
3572
|
+
return ue(Ce, () => {
|
|
3565
3573
|
setTimeout(() => {
|
|
3566
3574
|
p.invalidateSize();
|
|
3567
3575
|
}, 50);
|
|
3568
|
-
}), (
|
|
3569
|
-
class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen:
|
|
3576
|
+
}), (g, _) => (i(), d("div", {
|
|
3577
|
+
class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: Ce.value }])
|
|
3570
3578
|
}, [
|
|
3571
3579
|
l("div", {
|
|
3572
3580
|
ref_key: "mapContainer",
|
|
@@ -3582,7 +3590,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3582
3590
|
"leave-from-class": "opacity-100",
|
|
3583
3591
|
"leave-to-class": "opacity-0"
|
|
3584
3592
|
}, {
|
|
3585
|
-
default:
|
|
3593
|
+
default: Ee(() => [
|
|
3586
3594
|
s.value && a.handleZoom ? (i(), d("div", cr, [
|
|
3587
3595
|
l("div", pr, [
|
|
3588
3596
|
l("p", fr, G(r.value), 1)
|
|
@@ -3592,7 +3600,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3592
3600
|
_: 1
|
|
3593
3601
|
}),
|
|
3594
3602
|
l("div", mr, [
|
|
3595
|
-
A(ar, { onGoToCoordinates:
|
|
3603
|
+
A(ar, { onGoToCoordinates: tt }),
|
|
3596
3604
|
l("div", vr, [
|
|
3597
3605
|
l("div", hr, [
|
|
3598
3606
|
l("button", {
|
|
@@ -3603,7 +3611,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3603
3611
|
l("button", {
|
|
3604
3612
|
type: "button",
|
|
3605
3613
|
class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200 disabled:hover:bg-gray-100 disabled:hover:text-gray-400",
|
|
3606
|
-
onClick:
|
|
3614
|
+
onClick: Le,
|
|
3607
3615
|
disabled: H.value === 0
|
|
3608
3616
|
}, "Export", 8, gr)
|
|
3609
3617
|
]),
|
|
@@ -3624,7 +3632,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3624
3632
|
"aria-pressed": N.value === "marker",
|
|
3625
3633
|
title: "Point (P)",
|
|
3626
3634
|
"aria-label": "Draw point",
|
|
3627
|
-
onClick:
|
|
3635
|
+
onClick: _[0] || (_[0] = (Y) => se("marker"))
|
|
3628
3636
|
}, [
|
|
3629
3637
|
A(zs)
|
|
3630
3638
|
], 10, xr),
|
|
@@ -3633,7 +3641,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3633
3641
|
"aria-pressed": N.value === "polyline",
|
|
3634
3642
|
title: "Line (L)",
|
|
3635
3643
|
"aria-label": "Draw polyline",
|
|
3636
|
-
onClick:
|
|
3644
|
+
onClick: _[1] || (_[1] = (Y) => se("polyline"))
|
|
3637
3645
|
}, [
|
|
3638
3646
|
A(Os)
|
|
3639
3647
|
], 10, wr),
|
|
@@ -3642,7 +3650,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3642
3650
|
"aria-pressed": N.value === "polygon",
|
|
3643
3651
|
title: "Polygon (G)",
|
|
3644
3652
|
"aria-label": "Draw polygon",
|
|
3645
|
-
onClick:
|
|
3653
|
+
onClick: _[2] || (_[2] = (Y) => se("polygon"))
|
|
3646
3654
|
}, [
|
|
3647
3655
|
A(Rs)
|
|
3648
3656
|
], 10, kr),
|
|
@@ -3651,14 +3659,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3651
3659
|
"aria-pressed": N.value === "rectangle",
|
|
3652
3660
|
title: "Rectangle (R)",
|
|
3653
3661
|
"aria-label": "Draw rectangle",
|
|
3654
|
-
onClick:
|
|
3662
|
+
onClick: _[3] || (_[3] = (Y) => se("rectangle"))
|
|
3655
3663
|
}, [
|
|
3656
3664
|
A(Ws)
|
|
3657
3665
|
], 10, _r),
|
|
3658
3666
|
l("button", {
|
|
3659
3667
|
class: "vs-btn mt-5",
|
|
3660
|
-
onClick:
|
|
3661
|
-
|
|
3668
|
+
onClick: _[4] || (_[4] = (Y) => {
|
|
3669
|
+
Ce.value = !Ce.value;
|
|
3662
3670
|
}),
|
|
3663
3671
|
title: "Full Screen",
|
|
3664
3672
|
"aria-label": "Full Screen"
|
|
@@ -3672,40 +3680,40 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3672
3680
|
}, [
|
|
3673
3681
|
A(dr, {
|
|
3674
3682
|
basemaps: ee(x),
|
|
3675
|
-
onOnLayerChange:
|
|
3683
|
+
onOnLayerChange: Ge
|
|
3676
3684
|
}, null, 8, ["basemaps"])
|
|
3677
3685
|
], 2),
|
|
3678
3686
|
l("div", $r, [
|
|
3679
3687
|
v.value ? (i(), d("div", Cr, [
|
|
3680
3688
|
l("div", Vr, [
|
|
3681
|
-
|
|
3689
|
+
_[7] || (_[7] = ge(" Тип: ", -1)),
|
|
3682
3690
|
l("span", Mr, G(v.value.type), 1)
|
|
3683
3691
|
]),
|
|
3684
3692
|
l("div", Lr, [
|
|
3685
3693
|
l("div", Sr, [
|
|
3686
|
-
|
|
3694
|
+
_[8] || (_[8] = ge(" Центр: ", -1)),
|
|
3687
3695
|
l("b", null, G(v.value.center.lat.toFixed(5)) + ", " + G(v.value.center.lng.toFixed(5)), 1)
|
|
3688
3696
|
]),
|
|
3689
3697
|
v.value.areaKm2 !== null ? (i(), d("div", Br, [
|
|
3690
|
-
|
|
3698
|
+
_[9] || (_[9] = ge(" Площа: ", -1)),
|
|
3691
3699
|
l("b", null, G(v.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3692
|
-
])) : (i(), d("div", jr,
|
|
3700
|
+
])) : (i(), d("div", jr, _[10] || (_[10] = [
|
|
3693
3701
|
ge(" Площа: ", -1),
|
|
3694
3702
|
l("b", null, "—", -1)
|
|
3695
3703
|
]))),
|
|
3696
3704
|
l("button", {
|
|
3697
3705
|
class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
|
|
3698
3706
|
title: "Наблизити",
|
|
3699
|
-
onClick:
|
|
3700
|
-
},
|
|
3707
|
+
onClick: _[5] || (_[5] = (Y) => W())
|
|
3708
|
+
}, _[11] || (_[11] = [
|
|
3701
3709
|
ye('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-66e4a27d><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-66e4a27d></path><path d="M7 10l6 0" data-v-66e4a27d></path><path d="M10 7l0 6" data-v-66e4a27d></path><path d="M21 21l-6 -6" data-v-66e4a27d></path></svg>', 1)
|
|
3702
3710
|
])),
|
|
3703
3711
|
l("button", {
|
|
3704
3712
|
class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
|
|
3705
3713
|
title: "Видалити",
|
|
3706
|
-
onClick:
|
|
3714
|
+
onClick: _[6] || (_[6] = (Y) => oe())
|
|
3707
3715
|
}, [
|
|
3708
|
-
A(
|
|
3716
|
+
A(et, { class: "w-3 h-3" })
|
|
3709
3717
|
])
|
|
3710
3718
|
])
|
|
3711
3719
|
])) : D("", !0)
|
|
@@ -3717,7 +3725,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3717
3725
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3718
3726
|
}, Dr = { class: "flex-1 min-w-[2px]" }, Ur = ["placeholder"], Pr = { class: "flex items-center shrink-0" }, Rr = ["disabled"], Hr = /* @__PURE__ */ U({
|
|
3719
3727
|
__name: "vs-input-tag",
|
|
3720
|
-
props: /* @__PURE__ */
|
|
3728
|
+
props: /* @__PURE__ */ ie({
|
|
3721
3729
|
unique: { type: Boolean, default: !0 },
|
|
3722
3730
|
style: { default: () => ({}) },
|
|
3723
3731
|
customClass: { default: "" },
|
|
@@ -3730,21 +3738,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3730
3738
|
modelValue: { default: [] },
|
|
3731
3739
|
modelModifiers: {}
|
|
3732
3740
|
}),
|
|
3733
|
-
emits: /* @__PURE__ */
|
|
3741
|
+
emits: /* @__PURE__ */ ie(["update:modelValue"], ["update:modelValue"]),
|
|
3734
3742
|
setup(o, { emit: e }) {
|
|
3735
3743
|
const t = o, a = e;
|
|
3736
|
-
|
|
3737
|
-
const n =
|
|
3738
|
-
S.value || await
|
|
3744
|
+
$e(t.style);
|
|
3745
|
+
const n = k(null), s = k(null), r = k(null), u = k(!1), c = k(""), p = de(o, "modelValue"), f = B(() => t.placeholder || "Add tag…"), m = B(() => p.value?.length === 0 && c.value === ""), y = B(() => !t.disabled && p.value?.length > 0), S = B(() => t.disabled), q = async () => {
|
|
3746
|
+
S.value || await je(() => r.value?.focus());
|
|
3739
3747
|
}, R = (V) => {
|
|
3740
|
-
const
|
|
3741
|
-
|
|
3748
|
+
const $ = V.trim();
|
|
3749
|
+
$ !== "" && (!p.value || !Array.isArray(p.value) ? p.value = [$] : t.unique ? p.value.includes($) || (p.value = [...p.value, $]) : p.value = [...p.value, $], c.value = "");
|
|
3742
3750
|
}, K = () => {
|
|
3743
3751
|
const V = c.value;
|
|
3744
3752
|
V.trim() !== "" && R(V), c.value = "";
|
|
3745
3753
|
}, T = (V) => {
|
|
3746
|
-
const
|
|
3747
|
-
|
|
3754
|
+
const $ = p.value.slice();
|
|
3755
|
+
$.splice(V, 1), a("update:modelValue", $);
|
|
3748
3756
|
}, H = () => {
|
|
3749
3757
|
a("update:modelValue", []);
|
|
3750
3758
|
}, I = () => {
|
|
@@ -3752,14 +3760,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3752
3760
|
}, v = () => {
|
|
3753
3761
|
u.value = !1;
|
|
3754
3762
|
}, x = (V) => {
|
|
3755
|
-
const { key:
|
|
3756
|
-
|
|
3763
|
+
const { key: $ } = V;
|
|
3764
|
+
$ === "Enter" ? (V.preventDefault(), K()) : $ === "Backspace" && c.value === "" && p.value.length > 0 && T(p.value.length - 1);
|
|
3757
3765
|
};
|
|
3758
|
-
return (V,
|
|
3766
|
+
return (V, $) => (i(), d("div", {
|
|
3759
3767
|
class: "flex gap-1 w-full",
|
|
3760
3768
|
ref_key: "root",
|
|
3761
3769
|
ref: n,
|
|
3762
|
-
onClick:
|
|
3770
|
+
onClick: $[1] || ($[1] = ke(() => {
|
|
3763
3771
|
}, ["stop"]))
|
|
3764
3772
|
}, [
|
|
3765
3773
|
l("div", {
|
|
@@ -3782,7 +3790,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3782
3790
|
ref_key: "chipsRef",
|
|
3783
3791
|
ref: s
|
|
3784
3792
|
}, [
|
|
3785
|
-
(i(!0), d(
|
|
3793
|
+
(i(!0), d(re, null, fe(p.value, (F, te) => (i(), d("div", {
|
|
3786
3794
|
key: te,
|
|
3787
3795
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3788
3796
|
}, [
|
|
@@ -3792,9 +3800,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3792
3800
|
l("div", {
|
|
3793
3801
|
role: "button",
|
|
3794
3802
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3795
|
-
onClick:
|
|
3803
|
+
onClick: ke((J) => T(te), ["stop"]),
|
|
3796
3804
|
"aria-label": `Remove ${F}`
|
|
3797
|
-
},
|
|
3805
|
+
}, $[2] || ($[2] = [
|
|
3798
3806
|
l("svg", {
|
|
3799
3807
|
height: "14",
|
|
3800
3808
|
width: "14",
|
|
@@ -3809,7 +3817,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3809
3817
|
]))), 128)),
|
|
3810
3818
|
m.value ? (i(), d("div", Or, G(f.value), 1)) : D("", !0),
|
|
3811
3819
|
l("div", Dr, [
|
|
3812
|
-
S.value ? D("", !0) :
|
|
3820
|
+
S.value ? D("", !0) : ae((i(), d("input", {
|
|
3813
3821
|
key: 0,
|
|
3814
3822
|
ref_key: "inputRef",
|
|
3815
3823
|
ref: r,
|
|
@@ -3821,7 +3829,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3821
3829
|
type: "text",
|
|
3822
3830
|
tabindex: "0",
|
|
3823
3831
|
"aria-label": "Add tag",
|
|
3824
|
-
"onUpdate:modelValue":
|
|
3832
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => c.value = F),
|
|
3825
3833
|
onFocus: I,
|
|
3826
3834
|
onBlur: v,
|
|
3827
3835
|
onKeydown: x,
|
|
@@ -3838,8 +3846,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3838
3846
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3839
3847
|
"aria-label": "Clear all tags",
|
|
3840
3848
|
disabled: S.value,
|
|
3841
|
-
onClick:
|
|
3842
|
-
},
|
|
3849
|
+
onClick: ke(H, ["stop"])
|
|
3850
|
+
}, $[3] || ($[3] = [
|
|
3843
3851
|
l("svg", {
|
|
3844
3852
|
height: "20",
|
|
3845
3853
|
width: "20",
|
|
@@ -3856,7 +3864,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3856
3864
|
}
|
|
3857
3865
|
}), Nr = { class: "relative flex gap-1 bg-white w-full" }, qr = ["disabled", "placeholder"], Wr = /* @__PURE__ */ U({
|
|
3858
3866
|
__name: "vs-input-slug",
|
|
3859
|
-
props: /* @__PURE__ */
|
|
3867
|
+
props: /* @__PURE__ */ ie({
|
|
3860
3868
|
disabled: { type: Boolean },
|
|
3861
3869
|
placeholder: {},
|
|
3862
3870
|
parent: {}
|
|
@@ -3866,7 +3874,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3866
3874
|
}),
|
|
3867
3875
|
emits: ["update:modelValue"],
|
|
3868
3876
|
setup(o) {
|
|
3869
|
-
const e =
|
|
3877
|
+
const e = Ae("values"), t = o, a = de(o, "modelValue");
|
|
3870
3878
|
function n(r) {
|
|
3871
3879
|
const u = {
|
|
3872
3880
|
а: "a",
|
|
@@ -3914,7 +3922,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3914
3922
|
a.value = u.toString();
|
|
3915
3923
|
};
|
|
3916
3924
|
return (r, u) => (i(), d("div", Nr, [
|
|
3917
|
-
|
|
3925
|
+
ae(l("input", {
|
|
3918
3926
|
ref: "vsText",
|
|
3919
3927
|
disabled: r.disabled,
|
|
3920
3928
|
placeholder: r.placeholder,
|
|
@@ -3945,7 +3953,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3945
3953
|
},
|
|
3946
3954
|
emits: ["update:modelValue"],
|
|
3947
3955
|
setup(o, { emit: e }) {
|
|
3948
|
-
const t = (K) => `${K}-${Math.random().toString(36).substring(2, 15)}`, a =
|
|
3956
|
+
const t = (K) => `${K}-${Math.random().toString(36).substring(2, 15)}`, a = Ae("values"), n = o, s = e, r = n.addButtonText ?? "Додати", u = n.ignore ?? [], c = k([]), p = k(null);
|
|
3949
3957
|
(() => {
|
|
3950
3958
|
const K = n.parent && a?.value?.[n.parent] || n.modelValue || {};
|
|
3951
3959
|
c.value = Object.entries(K).filter(([T]) => !u.includes(T)).map(([T, H]) => ({
|
|
@@ -3969,7 +3977,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3969
3977
|
}, R = (K) => {
|
|
3970
3978
|
c.value = c.value.filter((T) => T.id !== K);
|
|
3971
3979
|
};
|
|
3972
|
-
return
|
|
3980
|
+
return ue(
|
|
3973
3981
|
c,
|
|
3974
3982
|
(K) => {
|
|
3975
3983
|
const T = {};
|
|
@@ -3987,25 +3995,25 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3987
3995
|
{ deep: !0 }
|
|
3988
3996
|
), (K, T) => (i(), d("div", Zr, [
|
|
3989
3997
|
l("div", Kr, [
|
|
3990
|
-
(i(!0), d(
|
|
3998
|
+
(i(!0), d(re, null, fe(c.value, (H, I) => (i(), d("div", {
|
|
3991
3999
|
key: H.id,
|
|
3992
4000
|
class: E(["flex items-center gap-2 w-full", { "opacity-50": p.value === I }]),
|
|
3993
4001
|
draggable: "true",
|
|
3994
4002
|
onDragstart: (v) => m(I),
|
|
3995
|
-
onDragover: T[0] || (T[0] =
|
|
4003
|
+
onDragover: T[0] || (T[0] = ke(() => {
|
|
3996
4004
|
}, ["prevent"])),
|
|
3997
4005
|
onDrop: (v) => y(I)
|
|
3998
4006
|
}, [
|
|
3999
4007
|
T[1] || (T[1] = ye('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>', 1)),
|
|
4000
4008
|
l("div", Yr, [
|
|
4001
|
-
A(
|
|
4009
|
+
A(Ye, {
|
|
4002
4010
|
modelValue: H.key,
|
|
4003
4011
|
"onUpdate:modelValue": (v) => H.key = v,
|
|
4004
4012
|
placeholder: "Ключ"
|
|
4005
4013
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
4006
4014
|
]),
|
|
4007
4015
|
l("div", Xr, [
|
|
4008
|
-
A(
|
|
4016
|
+
A(Ye, {
|
|
4009
4017
|
modelValue: H.value,
|
|
4010
4018
|
"onUpdate:modelValue": (v) => H.value = v,
|
|
4011
4019
|
placeholder: "Значення"
|
|
@@ -4030,7 +4038,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4030
4038
|
disabled: S.value,
|
|
4031
4039
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
4032
4040
|
}, [
|
|
4033
|
-
A(
|
|
4041
|
+
A(qe, {
|
|
4034
4042
|
height: "14",
|
|
4035
4043
|
width: "14"
|
|
4036
4044
|
}),
|
|
@@ -4052,12 +4060,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4052
4060
|
},
|
|
4053
4061
|
emits: ["update:modelValue"],
|
|
4054
4062
|
setup(o, { emit: e }) {
|
|
4055
|
-
const t = o, { inputClass: a } =
|
|
4063
|
+
const t = o, { inputClass: a } = $e(t.style), n = e, s = B({
|
|
4056
4064
|
get: () => t.modelValue || "#000000",
|
|
4057
4065
|
set: (r) => n("update:modelValue", r)
|
|
4058
4066
|
});
|
|
4059
4067
|
return (r, u) => (i(), d("div", ai, [
|
|
4060
|
-
|
|
4068
|
+
ae(l("input", {
|
|
4061
4069
|
type: "color",
|
|
4062
4070
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4063
4071
|
disabled: r.disabled,
|
|
@@ -4067,7 +4075,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4067
4075
|
}, null, 10, si), [
|
|
4068
4076
|
[ve, s.value]
|
|
4069
4077
|
]),
|
|
4070
|
-
|
|
4078
|
+
ae(l("input", {
|
|
4071
4079
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
|
|
4072
4080
|
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
4073
4081
|
}, null, 512), [
|
|
@@ -4091,12 +4099,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4091
4099
|
},
|
|
4092
4100
|
emits: ["update:modelValue"],
|
|
4093
4101
|
setup(o, { emit: e }) {
|
|
4094
|
-
const t = o, { inputClass: a } =
|
|
4102
|
+
const t = o, { inputClass: a } = $e(t.style), n = e, s = B({
|
|
4095
4103
|
get: () => Number(t.modelValue ?? t.min),
|
|
4096
4104
|
set: (r) => n("update:modelValue", Number(r))
|
|
4097
4105
|
});
|
|
4098
4106
|
return (r, u) => (i(), d("div", ii, [
|
|
4099
|
-
|
|
4107
|
+
ae(l("input", {
|
|
4100
4108
|
type: "range",
|
|
4101
4109
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4102
4110
|
min: r.min,
|
|
@@ -4108,7 +4116,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4108
4116
|
}, null, 10, ui), [
|
|
4109
4117
|
[ve, s.value]
|
|
4110
4118
|
]),
|
|
4111
|
-
|
|
4119
|
+
ae(l("input", {
|
|
4112
4120
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
|
|
4113
4121
|
type: "number",
|
|
4114
4122
|
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
@@ -4119,7 +4127,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4119
4127
|
}
|
|
4120
4128
|
}), ci = ["type", "value", "onInput", "placeholder", "disabled"], pi = /* @__PURE__ */ U({
|
|
4121
4129
|
__name: "vs-input-array",
|
|
4122
|
-
props: /* @__PURE__ */
|
|
4130
|
+
props: /* @__PURE__ */ ie({
|
|
4123
4131
|
count: { default: 1 },
|
|
4124
4132
|
limit: { default: (o) => o.count ?? 1 },
|
|
4125
4133
|
inputType: { default: "text" },
|
|
@@ -4136,7 +4144,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4136
4144
|
}),
|
|
4137
4145
|
emits: ["update:modelValue"],
|
|
4138
4146
|
setup(o) {
|
|
4139
|
-
const e = o, { inputClass: t } =
|
|
4147
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
4140
4148
|
Gt(() => {
|
|
4141
4149
|
const s = a.value?.length ?? 0;
|
|
4142
4150
|
s < e.count && (a.value = [
|
|
@@ -4151,7 +4159,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4151
4159
|
return (s, r) => (i(), d("div", {
|
|
4152
4160
|
class: E(["grid gap-2", `grid-cols-${s.limit}`])
|
|
4153
4161
|
}, [
|
|
4154
|
-
(i(!0), d(
|
|
4162
|
+
(i(!0), d(re, null, fe(s.count, (u) => (i(), d("input", {
|
|
4155
4163
|
type: s.inputType,
|
|
4156
4164
|
value: a.value?.[u - 1] ?? "",
|
|
4157
4165
|
onInput: (c) => n(c, u - 1),
|
|
@@ -4165,9 +4173,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4165
4173
|
], 2));
|
|
4166
4174
|
}
|
|
4167
4175
|
}), fi = {
|
|
4168
|
-
VsInputText:
|
|
4176
|
+
VsInputText: Ye,
|
|
4169
4177
|
VsInputRadio: gt,
|
|
4170
|
-
"vs-input-text":
|
|
4178
|
+
"vs-input-text": Ye,
|
|
4171
4179
|
"vs-input-password": yl,
|
|
4172
4180
|
"vs-input-textarea": ka,
|
|
4173
4181
|
"vs-input-mask": lo,
|
|
@@ -4202,13 +4210,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4202
4210
|
value: {}
|
|
4203
4211
|
},
|
|
4204
4212
|
setup(o) {
|
|
4205
|
-
const e = o, t =
|
|
4213
|
+
const e = o, t = Ae("values");
|
|
4206
4214
|
async function a() {
|
|
4207
4215
|
try {
|
|
4208
4216
|
if (!e.api) return;
|
|
4209
4217
|
const n = e.api.replace("{{value}}", e.value), s = await fetch(n);
|
|
4210
4218
|
if (!s.ok) {
|
|
4211
|
-
|
|
4219
|
+
ce({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
4212
4220
|
return;
|
|
4213
4221
|
}
|
|
4214
4222
|
const r = await s.json();
|
|
@@ -4229,7 +4237,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4229
4237
|
class: "text-sm text-gray-500"
|
|
4230
4238
|
}, zt = /* @__PURE__ */ U({
|
|
4231
4239
|
__name: "vs-compact-form-layout",
|
|
4232
|
-
props: /* @__PURE__ */
|
|
4240
|
+
props: /* @__PURE__ */ ie({
|
|
4233
4241
|
item: { default: {} },
|
|
4234
4242
|
layout: { default: "default" },
|
|
4235
4243
|
style: { default: {} },
|
|
@@ -4242,7 +4250,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4242
4250
|
}),
|
|
4243
4251
|
emits: ["update:modelValue"],
|
|
4244
4252
|
setup(o) {
|
|
4245
|
-
const e = o, t =
|
|
4253
|
+
const e = o, t = de(o, "modelValue"), a = B(() => gl[`${e.layout}`]), n = B(() => fi?.[`vs-input-${e.item.type}`]), s = B(() => {
|
|
4246
4254
|
const u = ee(n);
|
|
4247
4255
|
if (!u) return /* @__PURE__ */ new Set();
|
|
4248
4256
|
const c = u.props ?? u.__vccOpts?.props;
|
|
@@ -4253,14 +4261,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4253
4261
|
const u = e.item ?? {}, c = s.value;
|
|
4254
4262
|
return c.size ? Object.fromEntries(Object.entries(u).filter(([p]) => c.has(p))) : {};
|
|
4255
4263
|
});
|
|
4256
|
-
return (u, c) =>
|
|
4264
|
+
return (u, c) => ae((i(), me(Fe(a.value), {
|
|
4257
4265
|
ua: e.item.ua,
|
|
4258
4266
|
error: e.error || "",
|
|
4259
4267
|
item: u.item,
|
|
4260
4268
|
columns: e.columns,
|
|
4261
4269
|
label: e.item.label
|
|
4262
4270
|
}, {
|
|
4263
|
-
default:
|
|
4271
|
+
default: Ee(() => [
|
|
4264
4272
|
l("div", {
|
|
4265
4273
|
class: E(["flex w-full", `${e.item.type}-component`])
|
|
4266
4274
|
}, [
|
|
@@ -4276,7 +4284,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4276
4284
|
]),
|
|
4277
4285
|
_: 1
|
|
4278
4286
|
}, 8, ["ua", "error", "item", "columns", "label"])), [
|
|
4279
|
-
[
|
|
4287
|
+
[Qe, !u.item.hidden]
|
|
4280
4288
|
]);
|
|
4281
4289
|
}
|
|
4282
4290
|
}), gi = { class: "text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300" }, bi = { class: "vs-compact-form-navigation__rail mt-[6px]" }, yi = ["onClick"], xi = /* @__PURE__ */ U({
|
|
@@ -4289,7 +4297,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4289
4297
|
width: { default: 400 }
|
|
4290
4298
|
},
|
|
4291
4299
|
setup(o, { expose: e }) {
|
|
4292
|
-
const t = o, a =
|
|
4300
|
+
const t = o, a = k([]), n = k(""), s = k(""), r = B(() => !!t.enabled), u = B(() => [
|
|
4293
4301
|
"vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
|
|
4294
4302
|
"sticky top-0 self-start shrink-0",
|
|
4295
4303
|
"max-h-full min-h-0 overflow-y-auto"
|
|
@@ -4301,27 +4309,27 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4301
4309
|
});
|
|
4302
4310
|
let p = null, f = 0, m = 0, y = null, S = null, q = null;
|
|
4303
4311
|
const R = () => te(), K = () => H();
|
|
4304
|
-
|
|
4312
|
+
ue(
|
|
4305
4313
|
() => t.target,
|
|
4306
4314
|
async (M) => {
|
|
4307
4315
|
if (V(), !M) {
|
|
4308
4316
|
y = null, a.value = [], n.value = "";
|
|
4309
4317
|
return;
|
|
4310
4318
|
}
|
|
4311
|
-
y = M, r.value && (await
|
|
4319
|
+
y = M, r.value && (await je(), x(M), H());
|
|
4312
4320
|
},
|
|
4313
4321
|
{ immediate: !0 }
|
|
4314
|
-
),
|
|
4322
|
+
), ue(
|
|
4315
4323
|
() => t.scrollContainer,
|
|
4316
4324
|
(M) => {
|
|
4317
4325
|
if (!r.value) {
|
|
4318
4326
|
S = M ?? null;
|
|
4319
4327
|
return;
|
|
4320
4328
|
}
|
|
4321
|
-
T(M ?? null),
|
|
4329
|
+
T(M ?? null), je(() => H());
|
|
4322
4330
|
},
|
|
4323
4331
|
{ immediate: !0 }
|
|
4324
|
-
),
|
|
4332
|
+
), _e(() => {
|
|
4325
4333
|
t.scrollContainer || T(null), H();
|
|
4326
4334
|
}), at(() => {
|
|
4327
4335
|
V(), T(null, !0), y = null, typeof window < "u" && (f && window.cancelAnimationFrame(f), m && window.cancelAnimationFrame(m));
|
|
@@ -4351,11 +4359,11 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4351
4359
|
M.forEach((le, z) => {
|
|
4352
4360
|
const j = le.textContent?.trim() ?? "";
|
|
4353
4361
|
if (!j) return;
|
|
4354
|
-
let
|
|
4355
|
-
|
|
4356
|
-
let W =
|
|
4362
|
+
let C = (le.getAttribute("id") ?? "").trim();
|
|
4363
|
+
C || (C = v(j) || `heading-${z + 1}`);
|
|
4364
|
+
let W = C, oe = 1;
|
|
4357
4365
|
for (; Z.has(W); )
|
|
4358
|
-
W = `${
|
|
4366
|
+
W = `${C}-${oe += 1}`;
|
|
4359
4367
|
le.id !== W && Object.assign(le, { id: W }), Z.add(W), N.push({
|
|
4360
4368
|
id: W,
|
|
4361
4369
|
text: j,
|
|
@@ -4372,7 +4380,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4372
4380
|
function V() {
|
|
4373
4381
|
p && (p.disconnect(), p = null);
|
|
4374
4382
|
}
|
|
4375
|
-
function
|
|
4383
|
+
function $(M) {
|
|
4376
4384
|
const Z = S;
|
|
4377
4385
|
if (!Z)
|
|
4378
4386
|
return typeof window > "u" ? M.offsetTop : M.getBoundingClientRect().top + window.scrollY;
|
|
@@ -4383,11 +4391,11 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4383
4391
|
if (!r.value || !a.value.length) return;
|
|
4384
4392
|
const M = S, Z = (M ? M.scrollTop : null) || (typeof window < "u" ? window.scrollY : 0), N = (M ? M.clientHeight : null) || (typeof window < "u" ? window.innerHeight : 0), le = Z + N;
|
|
4385
4393
|
let z = null;
|
|
4386
|
-
for (let
|
|
4387
|
-
const W = a.value[
|
|
4394
|
+
for (let C = 0; C < a.value.length; C += 1) {
|
|
4395
|
+
const W = a.value[C], oe = document.getElementById(W.id);
|
|
4388
4396
|
if (oe) {
|
|
4389
|
-
const
|
|
4390
|
-
|
|
4397
|
+
const se = $(oe);
|
|
4398
|
+
se + oe.offsetHeight > Z && se < le && (z = W.id);
|
|
4391
4399
|
}
|
|
4392
4400
|
}
|
|
4393
4401
|
!z && s.value && (z = s.value), z && (s.value = z);
|
|
@@ -4403,7 +4411,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4403
4411
|
if (!r.value) return;
|
|
4404
4412
|
const Z = document.getElementById(M);
|
|
4405
4413
|
if (!Z) return;
|
|
4406
|
-
const N = S, le = Math.max(0,
|
|
4414
|
+
const N = S, le = Math.max(0, $(Z));
|
|
4407
4415
|
N ? N.scrollTo({ top: le, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: le, behavior: "smooth" });
|
|
4408
4416
|
}
|
|
4409
4417
|
return e({ refresh: H }), (M, Z) => r.value && a.value.length ? (i(), d("div", {
|
|
@@ -4413,7 +4421,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4413
4421
|
}, [
|
|
4414
4422
|
l("h2", gi, G(M.title), 1),
|
|
4415
4423
|
l("div", bi, [
|
|
4416
|
-
(i(!0), d(
|
|
4424
|
+
(i(!0), d(re, null, fe(a.value, (N) => (i(), d("div", {
|
|
4417
4425
|
key: N.id,
|
|
4418
4426
|
class: E([
|
|
4419
4427
|
"vs-compact-form-navigation__item relative",
|
|
@@ -4500,7 +4508,7 @@ function Si(o, e, t = !1) {
|
|
|
4500
4508
|
const a = B(() => Li(
|
|
4501
4509
|
(Array.isArray(e), e),
|
|
4502
4510
|
typeof t == "boolean" ? t : t.value
|
|
4503
|
-
)), n =
|
|
4511
|
+
)), n = k({});
|
|
4504
4512
|
function s(p) {
|
|
4505
4513
|
const f = p?.conditions;
|
|
4506
4514
|
if (!f) return !0;
|
|
@@ -4535,9 +4543,9 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4535
4543
|
"data-orientation": "horizontal",
|
|
4536
4544
|
role: "none",
|
|
4537
4545
|
class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
|
|
4538
|
-
},
|
|
4546
|
+
}, We = /* @__PURE__ */ U({
|
|
4539
4547
|
__name: "vs-compact-form",
|
|
4540
|
-
props: /* @__PURE__ */
|
|
4548
|
+
props: /* @__PURE__ */ ie({
|
|
4541
4549
|
schema: { default: () => [] },
|
|
4542
4550
|
style: { default: () => ({}) },
|
|
4543
4551
|
modelValue: {},
|
|
@@ -4553,21 +4561,21 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4553
4561
|
values: { default: () => ({}) },
|
|
4554
4562
|
valuesModifiers: {}
|
|
4555
4563
|
}),
|
|
4556
|
-
emits: /* @__PURE__ */
|
|
4564
|
+
emits: /* @__PURE__ */ ie(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
4557
4565
|
setup(o, { expose: e, emit: t }) {
|
|
4558
|
-
const a = t, n = o, s =
|
|
4566
|
+
const a = t, n = o, s = de(o, "form"), r = de(o, "values"), {
|
|
4559
4567
|
errors: u,
|
|
4560
4568
|
validate: c,
|
|
4561
4569
|
reset: p,
|
|
4562
4570
|
visibleSchema: f
|
|
4563
|
-
} = Si(r, n.schema, Zt(n, "disabled")), m =
|
|
4571
|
+
} = Si(r, n.schema, Zt(n, "disabled")), m = k(null), y = k(null), S = B(() => n.navigation), q = B(() => n.navWidth), R = B(() => n.style?.columns), K = Object.freeze({ container: 12, label: 3 }), T = B(() => n.columns ?? R.value ?? K), H = B(() => n.columns != null || R.value != null), I = B(() => H.value ? "horizontal" : n.layout), v = (F) => F?.columns ? "horizontal" : I.value, x = (F) => F?.columns ?? T.value, V = () => {
|
|
4564
4572
|
a("update:modelValue", r.value), c(), a("handle-submit", r.value);
|
|
4565
4573
|
};
|
|
4566
4574
|
e({
|
|
4567
4575
|
validate: c,
|
|
4568
4576
|
reset: p,
|
|
4569
4577
|
errors: u
|
|
4570
|
-
}),
|
|
4578
|
+
}), _e(() => {
|
|
4571
4579
|
n.modelValue && (r.value = n.modelValue), s.value = {
|
|
4572
4580
|
value: r.value,
|
|
4573
4581
|
errors: u.value,
|
|
@@ -4576,7 +4584,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4576
4584
|
formId: n.formId
|
|
4577
4585
|
};
|
|
4578
4586
|
});
|
|
4579
|
-
function
|
|
4587
|
+
function $(F, te) {
|
|
4580
4588
|
if (F === te) return !0;
|
|
4581
4589
|
if (typeof F != "object" || typeof te != "object" || !F || !te) return !1;
|
|
4582
4590
|
const J = Object.keys(F), M = Object.keys(te);
|
|
@@ -4591,10 +4599,10 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4591
4599
|
l("form", {
|
|
4592
4600
|
ref_key: "formRef",
|
|
4593
4601
|
ref: m,
|
|
4594
|
-
onSubmit:
|
|
4602
|
+
onSubmit: ke(V, ["prevent"]),
|
|
4595
4603
|
class: E(["grid grid-cols-12 p-1", I.value === "default" ? "gap-6" : "gap-4"])
|
|
4596
4604
|
}, [
|
|
4597
|
-
(i(!0), d(
|
|
4605
|
+
(i(!0), d(re, null, fe(ee(f), (J, M) => (i(), d("div", {
|
|
4598
4606
|
key: J.name,
|
|
4599
4607
|
class: E(v(J) === "horizontal" ? "col-span-12" : `col-span-${J.col || 12}`)
|
|
4600
4608
|
}, [
|
|
@@ -4606,7 +4614,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4606
4614
|
"model-value": r.value[J.name],
|
|
4607
4615
|
"onUpdate:modelValue": (Z) => {
|
|
4608
4616
|
const N = r.value[J.name];
|
|
4609
|
-
|
|
4617
|
+
$(N, Z) || (r.value[J.name] = Z);
|
|
4610
4618
|
},
|
|
4611
4619
|
error: ee(u)[J.name]
|
|
4612
4620
|
}, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
|
|
@@ -4633,11 +4641,11 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4633
4641
|
},
|
|
4634
4642
|
emits: ["close", "save", "edit"],
|
|
4635
4643
|
setup(o, { emit: e }) {
|
|
4636
|
-
const t = o, a = e, n =
|
|
4644
|
+
const t = o, a = e, n = k(t.schema), s = k(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = k({}), u = k(), c = k(t.mode);
|
|
4637
4645
|
async function p() {
|
|
4638
4646
|
const m = r.value.validate();
|
|
4639
4647
|
if (m) {
|
|
4640
|
-
|
|
4648
|
+
ce({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([y, S]) => `${y}: ${S}`).join(`
|
|
4641
4649
|
`) });
|
|
4642
4650
|
return;
|
|
4643
4651
|
}
|
|
@@ -4651,29 +4659,29 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4651
4659
|
body: JSON.stringify(s.value)
|
|
4652
4660
|
});
|
|
4653
4661
|
if (y.ok)
|
|
4654
|
-
await y.json(),
|
|
4662
|
+
await y.json(), ce({
|
|
4655
4663
|
type: "success",
|
|
4656
4664
|
title: "Успішно",
|
|
4657
4665
|
message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
|
|
4658
4666
|
}), a("save", s.value);
|
|
4659
4667
|
else if (y.status === 400) {
|
|
4660
4668
|
const S = await y.json().catch(() => ({}));
|
|
4661
|
-
|
|
4669
|
+
ce({
|
|
4662
4670
|
type: "warning",
|
|
4663
4671
|
title: "Помилка валідації",
|
|
4664
4672
|
message: S.message || "Некоректні дані (400)"
|
|
4665
4673
|
});
|
|
4666
|
-
} else y.status === 500 ?
|
|
4674
|
+
} else y.status === 500 ? ce({
|
|
4667
4675
|
type: "error",
|
|
4668
4676
|
title: "Серверна помилка",
|
|
4669
4677
|
message: "Виникла помилка на сервері (500)"
|
|
4670
|
-
}) :
|
|
4678
|
+
}) : ce({
|
|
4671
4679
|
type: "error",
|
|
4672
4680
|
title: "Помилка",
|
|
4673
4681
|
message: `Статус: ${y.status}`
|
|
4674
4682
|
});
|
|
4675
4683
|
} catch (y) {
|
|
4676
|
-
|
|
4684
|
+
ce({
|
|
4677
4685
|
type: "error",
|
|
4678
4686
|
title: "Помилка з’єднання",
|
|
4679
4687
|
message: y.message || "Не вдалося виконати запит"
|
|
@@ -4683,12 +4691,12 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4683
4691
|
function f() {
|
|
4684
4692
|
a("close");
|
|
4685
4693
|
}
|
|
4686
|
-
return
|
|
4694
|
+
return _e(async () => {
|
|
4687
4695
|
try {
|
|
4688
4696
|
if (t.form) {
|
|
4689
4697
|
const m = await fetch(`/api/template/form/${t.form}`);
|
|
4690
4698
|
if (!m.ok) {
|
|
4691
|
-
|
|
4699
|
+
ce({
|
|
4692
4700
|
type: m.status >= 400 && m.status < 500 ? "warning" : "error",
|
|
4693
4701
|
title: "Error",
|
|
4694
4702
|
message: `Error code: ${m.status}`
|
|
@@ -4701,7 +4709,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4701
4709
|
u.value = t.token;
|
|
4702
4710
|
const m = await fetch(`/api/form/${u.value}`);
|
|
4703
4711
|
if (!m.ok) {
|
|
4704
|
-
|
|
4712
|
+
ce({
|
|
4705
4713
|
type: m.status >= 400 && m.status < 500 ? "warning" : "error",
|
|
4706
4714
|
title: "Error",
|
|
4707
4715
|
message: `Error code: ${m.status}`
|
|
@@ -4712,7 +4720,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4712
4720
|
n.value = y.schema, y.data ? s.value = y.data : c.value = "add";
|
|
4713
4721
|
}
|
|
4714
4722
|
} catch (m) {
|
|
4715
|
-
|
|
4723
|
+
ce({
|
|
4716
4724
|
type: "error",
|
|
4717
4725
|
title: "Error",
|
|
4718
4726
|
message: m.message || "Unexpected error"
|
|
@@ -4747,7 +4755,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4747
4755
|
]))
|
|
4748
4756
|
]),
|
|
4749
4757
|
l("div", Fi, [
|
|
4750
|
-
n.value ? (i(), me(
|
|
4758
|
+
n.value ? (i(), me(We, {
|
|
4751
4759
|
key: 0,
|
|
4752
4760
|
schema: n.value,
|
|
4753
4761
|
values: s.value,
|
|
@@ -4791,14 +4799,14 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4791
4799
|
}
|
|
4792
4800
|
});
|
|
4793
4801
|
});
|
|
4794
|
-
|
|
4795
|
-
e.component("VForm",
|
|
4802
|
+
We.install = function(e) {
|
|
4803
|
+
e.component("VForm", We), Object.assign(e.config.globalProperties, {
|
|
4796
4804
|
$form: $t
|
|
4797
4805
|
}), e.provide("form", $t), window.v3plugin || (window.v3plugin = {});
|
|
4798
4806
|
};
|
|
4799
4807
|
export {
|
|
4800
4808
|
Oi as ModalEdit,
|
|
4801
|
-
|
|
4809
|
+
We as VForm,
|
|
4802
4810
|
pi as VsInputArray,
|
|
4803
4811
|
vo as VsInputCheckbox,
|
|
4804
4812
|
ri as VsInputColor,
|
|
@@ -4817,9 +4825,9 @@ export {
|
|
|
4817
4825
|
ht as VsInputStatic,
|
|
4818
4826
|
Bt as VsInputSwitcher,
|
|
4819
4827
|
Hr as VsInputTag,
|
|
4820
|
-
|
|
4828
|
+
Ye as VsInputText,
|
|
4821
4829
|
ka as VsInputTextarea,
|
|
4822
|
-
|
|
4830
|
+
We as default,
|
|
4823
4831
|
fi as inputs,
|
|
4824
4832
|
Ls as vsInputDatatable,
|
|
4825
4833
|
Ir as vsInputMap
|