@opengis/form 0.0.50 → 0.0.52
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 q, mergeProps as Te, computed as B, normalizeStyle as be, createTextVNode as me, normalizeProps as ot, guardReactiveProps as nt, normalizeClass as E, mergeModels as ie, useModel as de, withDirectives as ae, unref as ee, vModelText as he, vModelCheckbox as Ct, createVNode as A, createBlock as ve, 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,22 +24,22 @@ 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
|
-
l("span", Xt,
|
|
36
|
+
l("span", Xt, q(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
|
-
a.error ? (i(), d("span", el,
|
|
42
|
+
a.error ? (i(), d("span", el, q(a.error), 1)) : D("", !0)
|
|
43
43
|
]));
|
|
44
44
|
}
|
|
45
45
|
}), ll = { class: "w-full relative flex flex-row items-center gap-2" }, ol = {
|
|
@@ -86,16 +86,16 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
86
86
|
class: "text-sm text-gray-900 font-medium flex shrink-0",
|
|
87
87
|
style: be(s.value)
|
|
88
88
|
}, [
|
|
89
|
-
|
|
89
|
+
me(q(u.ua || u.label) + " ", 1),
|
|
90
90
|
u.item?.rules?.includes("required") && (u.ua || u.label) ? (i(), d("span", ol, "*")) : D("", !0)
|
|
91
91
|
], 4)) : D("", !0),
|
|
92
92
|
l("div", {
|
|
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
|
-
u.error ? (i(), d("span", nl,
|
|
98
|
+
u.error ? (i(), d("span", nl, q(u.error), 1)) : D("", !0)
|
|
99
99
|
]));
|
|
100
100
|
}
|
|
101
101
|
}), sl = { class: "w-full relative" }, rl = {
|
|
@@ -117,8 +117,8 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
117
117
|
},
|
|
118
118
|
setup(o) {
|
|
119
119
|
return (e, t) => (i(), d("div", sl, [
|
|
120
|
-
|
|
121
|
-
e.error ? (i(), d("span", rl,
|
|
120
|
+
Se(e.$slots, "default", ot(nt(e.$attrs))),
|
|
121
|
+
e.error ? (i(), d("span", rl, q(e.error), 1)) : D("", !0)
|
|
122
122
|
]));
|
|
123
123
|
}
|
|
124
124
|
}), ul = { class: "flex-1 min-w-0" }, dl = {
|
|
@@ -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 }])
|
|
@@ -169,16 +169,16 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
169
169
|
}, [
|
|
170
170
|
l("div", ul, [
|
|
171
171
|
u.ua || u.label ? (i(), d("p", dl, [
|
|
172
|
-
l("span", cl,
|
|
172
|
+
l("span", cl, q(u.item[t.value] || u.ua || u.label), 1),
|
|
173
173
|
n.value ? (i(), d("span", pl, "*")) : D("", !0)
|
|
174
174
|
])) : D("", !0),
|
|
175
|
-
a.value ? (i(), d("p", fl,
|
|
175
|
+
a.value ? (i(), d("p", fl, q(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
|
-
s.value ? (i(), d("p", vl,
|
|
181
|
+
s.value ? (i(), d("p", vl, q(s.value), 1)) : D("", !0)
|
|
182
182
|
], 2));
|
|
183
183
|
}
|
|
184
184
|
}), gl = {
|
|
@@ -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,
|
|
@@ -222,12 +222,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
222
222
|
border: "1px solid #CFD9E0"
|
|
223
223
|
}
|
|
224
224
|
}, null, 10, bl)), [
|
|
225
|
-
[
|
|
225
|
+
[he, 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,
|
|
@@ -252,12 +252,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
252
252
|
border: "1px solid #CFD9E0"
|
|
253
253
|
}
|
|
254
254
|
}, null, 10, xl)), [
|
|
255
|
-
[
|
|
255
|
+
[he, a.value]
|
|
256
256
|
]);
|
|
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),
|
|
@@ -286,7 +286,7 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
286
286
|
min: n.min,
|
|
287
287
|
max: n.max
|
|
288
288
|
}, null, 10, wl)), [
|
|
289
|
-
[
|
|
289
|
+
[he, a.value]
|
|
290
290
|
]);
|
|
291
291
|
}
|
|
292
292
|
}), X = (o, e) => {
|
|
@@ -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,8 +355,8 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
355
355
|
})
|
|
356
356
|
], 2),
|
|
357
357
|
l("span", Bl, [
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
Se(s.$slots, "default", {}, () => [
|
|
359
|
+
me(q(s.label), 1)
|
|
360
360
|
])
|
|
361
361
|
])
|
|
362
362
|
], 10, Sl)
|
|
@@ -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,8 +412,8 @@ 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
|
-
|
|
416
|
-
|
|
415
|
+
Se(u.$slots, "default", {}, () => [
|
|
416
|
+
me(q(u.label), 1)
|
|
417
417
|
])
|
|
418
418
|
])
|
|
419
419
|
], 2));
|
|
@@ -444,9 +444,9 @@ 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
|
-
(i(),
|
|
449
|
+
(i(), ve(Fe(r.value === "vs-checkbox-buttons" ? ee(Tl) : ee(jl)), {
|
|
450
450
|
value: u.value,
|
|
451
451
|
label: u.label,
|
|
452
452
|
info: u.option?.info,
|
|
@@ -459,8 +459,8 @@ 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:
|
|
463
|
-
|
|
462
|
+
default: Ee(() => [
|
|
463
|
+
me(q(u.label), 1)
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
466
466
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
@@ -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,
|
|
@@ -700,13 +700,13 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
700
700
|
border: "1px solid #CFD9E0"
|
|
701
701
|
}
|
|
702
702
|
}, null, 10, no), [
|
|
703
|
-
[
|
|
703
|
+
[he, a.value]
|
|
704
704
|
])
|
|
705
705
|
]));
|
|
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,
|
|
@@ -746,12 +746,12 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
746
746
|
class: E(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
747
747
|
}, null, 2)) : D("", !0)
|
|
748
748
|
], 2),
|
|
749
|
-
l("span", ro,
|
|
749
|
+
l("span", ro, q(t.text), 1)
|
|
750
750
|
], 2));
|
|
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,
|
|
@@ -783,7 +783,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
783
783
|
}, null, 8, uo), [
|
|
784
784
|
[Vt, e.value]
|
|
785
785
|
]),
|
|
786
|
-
l("span", co,
|
|
786
|
+
l("span", co, q(t.text), 1)
|
|
787
787
|
], 2));
|
|
788
788
|
}
|
|
789
789
|
}), fo = {
|
|
@@ -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(), ve(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(), ve(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,9 +1188,9 @@ 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
|
-
(i(),
|
|
1193
|
+
(i(), ve(Fe(ee(Ro)(t.value)), {
|
|
1194
1194
|
src: t.value,
|
|
1195
1195
|
alt: "file",
|
|
1196
1196
|
class: "w-full h-full object-cover cursor-pointer",
|
|
@@ -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,13 +1235,13 @@ 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) {
|
|
1244
|
-
const f = Array.from(p).map(async (
|
|
1244
|
+
const f = Array.from(p).map(async (W) => t.format && !W.name.endsWith(t.format) ? null : await bt(W, "1", "form", "table")), S = (await Promise.all(f)).filter((W) => W !== null).map((W) => W?.file_path).filter(Boolean);
|
|
1245
1245
|
a.value = [...a.value || [], ...S], n("change", a.value);
|
|
1246
1246
|
} else {
|
|
1247
1247
|
const f = p[0];
|
|
@@ -1260,14 +1260,14 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1260
1260
|
multiple: c.multiple,
|
|
1261
1261
|
onChange: u
|
|
1262
1262
|
}, null, 40, Qo),
|
|
1263
|
-
!c.multiple && a.value ? (i(),
|
|
1263
|
+
!c.multiple && a.value ? (i(), ve(xt, {
|
|
1264
1264
|
key: 0,
|
|
1265
1265
|
item: a.value,
|
|
1266
1266
|
"onUpdate:item": p[0] || (p[0] = (f) => a.value = f),
|
|
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(), ve(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,18 +1316,18 @@ 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
|
-
l("p", on,
|
|
1322
|
+
l("p", on, q(n.item?.uploaded_name), 1),
|
|
1323
1323
|
l("p", nn, [
|
|
1324
|
-
l("span", null,
|
|
1325
|
-
|
|
1326
|
-
[
|
|
1324
|
+
l("span", null, q(n.item?.username), 1),
|
|
1325
|
+
ae(l("span", an, "|", 512), [
|
|
1326
|
+
[Qe, n.item?.username]
|
|
1327
1327
|
]),
|
|
1328
|
-
l("span", null,
|
|
1328
|
+
l("span", null, q(t.value), 1),
|
|
1329
1329
|
s[0] || (s[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1330
|
-
l("span", sn,
|
|
1330
|
+
l("span", sn, q(a(n.item?.size)), 1)
|
|
1331
1331
|
])
|
|
1332
1332
|
])
|
|
1333
1333
|
], 64));
|
|
@@ -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))), W = (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,21 +1523,21 @@ 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");
|
|
1532
1532
|
return i(), d("div", _n, [
|
|
1533
1533
|
l("div", $n, [
|
|
1534
|
-
l("h2", Cn, " Файлів: " +
|
|
1534
|
+
l("h2", Cn, " Файлів: " + q(f.value?.length), 1),
|
|
1535
1535
|
l("div", Vn, [
|
|
1536
1536
|
l("label", null, [
|
|
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,14 +1572,14 @@ 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), [
|
|
1581
1581
|
[
|
|
1582
|
-
|
|
1582
|
+
he,
|
|
1583
1583
|
m.value,
|
|
1584
1584
|
void 0,
|
|
1585
1585
|
{ trim: !0 }
|
|
@@ -1589,14 +1589,14 @@ 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(), ve(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)),
|
|
1599
|
-
onOpenLightbox: v[4] || (v[4] = (te) =>
|
|
1599
|
+
onOpenLightbox: v[4] || (v[4] = (te) => W(te))
|
|
1600
1600
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1601
1601
|
S.value.length ? D("", !0) : (i(), d("div", jn, v[9] || (v[9] = [
|
|
1602
1602
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
@@ -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,15 +1634,15 @@ 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;
|
|
1642
1642
|
}
|
|
1643
1643
|
), (a, n) => (i(), d("div", null, [
|
|
1644
1644
|
l("div", In, [
|
|
1645
|
-
l("p", zn,
|
|
1645
|
+
l("p", zn, q(o.title), 1),
|
|
1646
1646
|
A(Bt, {
|
|
1647
1647
|
modelValue: t.value,
|
|
1648
1648
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => t.value = s),
|
|
@@ -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;
|
|
@@ -1693,14 +1693,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1693
1693
|
A(ee(Pl), {
|
|
1694
1694
|
class: E(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1695
1695
|
}, null, 8, ["class"]),
|
|
1696
|
-
l("span", On,
|
|
1696
|
+
l("span", On, q(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
|
|
@@ -1722,16 +1722,16 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1722
1722
|
setup(o) {
|
|
1723
1723
|
return (e, t) => (i(), d("div", null, [
|
|
1724
1724
|
l("div", Rn, [
|
|
1725
|
-
l("p", null,
|
|
1725
|
+
l("p", null, q(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,19 +1795,19 @@ 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];
|
|
1802
1802
|
return It(p, u);
|
|
1803
1803
|
})), s = B(() => Nn[e.view]);
|
|
1804
|
-
return (r, u) => o.schema?.length ? (i(),
|
|
1804
|
+
return (r, u) => o.schema?.length ? (i(), ve(Fe(s.value), {
|
|
1805
1805
|
key: 0,
|
|
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(), ve(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), W = 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
|
-
}),
|
|
1869
|
-
let h =
|
|
1866
|
+
const h = W.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(() => G(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
|
+
let h = W.value ?? [];
|
|
1870
1870
|
if (!t.data && T.value.trim() !== "") {
|
|
1871
|
-
const
|
|
1872
|
-
h = h.filter((
|
|
1873
|
-
const P =
|
|
1874
|
-
return P.includes(
|
|
1871
|
+
const b = T.value.toLowerCase();
|
|
1872
|
+
h = h.filter((w) => {
|
|
1873
|
+
const P = G(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
|
+
}, G = (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 = G(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
|
-
},
|
|
1919
|
-
t.data ?
|
|
1920
|
-
},
|
|
1918
|
+
}, Oe = async () => {
|
|
1919
|
+
t.data ? W.value = await Le(T.value) : W.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 = W.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(W.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 && W.value.push(pe);
|
|
1930
1938
|
}, Promise.resolve());
|
|
1931
|
-
},
|
|
1932
|
-
s.value || (m.value = !0, await
|
|
1939
|
+
}, De = async () => {
|
|
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
|
|
1940
|
-
},
|
|
1941
|
-
m.value ? H.value?.focus() : await
|
|
1947
|
+
!m.value ? await De() : Ce();
|
|
1948
|
+
}, _ = async () => {
|
|
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 = "",
|
|
1950
|
-
},
|
|
1957
|
+
}), oe(null)) : (S.value = h, r.value = h.id, a("change", r.value), T.value = "", Ce(), oe(h));
|
|
1958
|
+
}, ge = (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
|
-
},
|
|
1991
|
-
s.value || !m.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await
|
|
1998
|
+
}, Ie = async (h) => {
|
|
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,99 +2025,100 @@ 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 && (
|
|
2028
|
+
ue(() => t.options, (h) => {
|
|
2029
|
+
h?.length && (W.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 ? W.value = [...t.options] : t.data && (W.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],
|
|
2059
|
+
const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${w}`).then((ne) => ne.json());
|
|
2060
|
+
S.value = P[0], W.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
|
-
|
|
2076
|
+
W.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 && (
|
|
2074
|
-
}, { immediate: !0 }),
|
|
2075
|
-
t.data &&
|
|
2076
|
-
}),
|
|
2077
|
-
t.data && (n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)));
|
|
2078
|
-
}), (h,
|
|
2080
|
+
}), ue(() => t.options, (h) => {
|
|
2081
|
+
!t.data && h?.length && (W.value = [...h], Ze());
|
|
2082
|
+
}, { immediate: !0 }), ue(() => t.parent ?? t.parentValue, () => {
|
|
2083
|
+
t.data && Oe();
|
|
2084
|
+
}), ue(se, async () => {
|
|
2085
|
+
t.data && (n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), await Oe());
|
|
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"])
|
|
2095
2103
|
]),
|
|
2096
2104
|
_: 1
|
|
2097
2105
|
}, 8, ["visible", "teleport"]),
|
|
2106
|
+
me(" " + q(r.value) + " ", 1),
|
|
2098
2107
|
l("div", {
|
|
2099
2108
|
class: "flex gap-1 w-full",
|
|
2100
2109
|
ref_key: "selectRoot",
|
|
2101
2110
|
ref: u,
|
|
2102
|
-
onClick:
|
|
2111
|
+
onClick: b[4] || (b[4] = ke(() => {
|
|
2103
2112
|
}, ["stop"]))
|
|
2104
2113
|
}, [
|
|
2105
2114
|
l("div", {
|
|
2106
2115
|
class: E(["relative w-full font-sans", t.customClass])
|
|
2107
2116
|
}, [
|
|
2108
|
-
|
|
2117
|
+
b[9] || (b[9] = l("span", {
|
|
2109
2118
|
id: "react-select-live-region",
|
|
2110
2119
|
class: "sr-only"
|
|
2111
2120
|
}, null, -1)),
|
|
2112
|
-
|
|
2121
|
+
b[10] || (b[10] = l("span", {
|
|
2113
2122
|
"aria-live": "polite",
|
|
2114
2123
|
"aria-atomic": "false",
|
|
2115
2124
|
"aria-relevant": "additions text",
|
|
@@ -2126,8 +2135,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2126
2135
|
role: "combobox",
|
|
2127
2136
|
"aria-expanded": m.value,
|
|
2128
2137
|
"aria-haspopup": "listbox",
|
|
2129
|
-
onKeydown:
|
|
2130
|
-
onClick:
|
|
2138
|
+
onKeydown: Ie,
|
|
2139
|
+
onClick: _,
|
|
2131
2140
|
"data-focus": m.value || y.value ? "true" : "false"
|
|
2132
2141
|
}, [
|
|
2133
2142
|
l("div", {
|
|
@@ -2135,33 +2144,33 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2135
2144
|
ref_key: "triggerRef",
|
|
2136
2145
|
ref: c
|
|
2137
2146
|
}, [
|
|
2138
|
-
n.value && x.value.length ? (i(!0), d(
|
|
2147
|
+
n.value && x.value.length ? (i(!0), d(re, { key: 0 }, fe(V.value, (w) => (i(), d("div", {
|
|
2139
2148
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2140
|
-
key:
|
|
2149
|
+
key: w.id
|
|
2141
2150
|
}, [
|
|
2142
2151
|
l("div", aa, [
|
|
2143
|
-
|
|
2152
|
+
w?.color ? (i(), d("span", {
|
|
2144
2153
|
key: 0,
|
|
2145
2154
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2146
|
-
style: be({ backgroundColor:
|
|
2155
|
+
style: be({ backgroundColor: w?.color })
|
|
2147
2156
|
}, null, 4)) : D("", !0),
|
|
2148
2157
|
l("div", {
|
|
2149
2158
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2150
|
-
title:
|
|
2159
|
+
title: G(w)
|
|
2151
2160
|
}, [
|
|
2152
2161
|
j.value ? (i(), d("span", {
|
|
2153
2162
|
key: 0,
|
|
2154
|
-
innerHTML:
|
|
2155
|
-
}, null, 8, ra)) : (i(), d(
|
|
2156
|
-
|
|
2163
|
+
innerHTML: C(w)
|
|
2164
|
+
}, null, 8, ra)) : (i(), d(re, { key: 1 }, [
|
|
2165
|
+
me(q(w.text), 1)
|
|
2157
2166
|
], 64))
|
|
2158
2167
|
], 8, sa)
|
|
2159
2168
|
]),
|
|
2160
2169
|
l("div", {
|
|
2161
2170
|
role: "button",
|
|
2162
2171
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2163
|
-
onClick:
|
|
2164
|
-
},
|
|
2172
|
+
onClick: ke((P) => O(w.id), ["stop"])
|
|
2173
|
+
}, b[5] || (b[5] = [
|
|
2165
2174
|
l("svg", {
|
|
2166
2175
|
height: "14",
|
|
2167
2176
|
width: "14",
|
|
@@ -2186,15 +2195,15 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2186
2195
|
j.value ? (i(), d("span", {
|
|
2187
2196
|
key: 1,
|
|
2188
2197
|
class: E({ "pl-5": S.value?.color }),
|
|
2189
|
-
innerHTML:
|
|
2198
|
+
innerHTML: C(S.value)
|
|
2190
2199
|
}, null, 10, da)) : (i(), d("span", {
|
|
2191
2200
|
key: 2,
|
|
2192
2201
|
class: E({ "pl-5": S.value?.color })
|
|
2193
|
-
},
|
|
2202
|
+
}, q(S.value?.text), 3))
|
|
2194
2203
|
], 8, ua)) : D("", !0),
|
|
2195
|
-
te.value ? (i(), d("div", ca,
|
|
2204
|
+
te.value ? (i(), d("div", ca, q($.value), 1)) : D("", !0),
|
|
2196
2205
|
l("div", pa, [
|
|
2197
|
-
!s.value && h.search ?
|
|
2206
|
+
!s.value && h.search ? ae((i(), d("input", {
|
|
2198
2207
|
key: 0,
|
|
2199
2208
|
ref_key: "inputRef",
|
|
2200
2209
|
ref: H,
|
|
@@ -2207,12 +2216,12 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2207
2216
|
tabindex: "0",
|
|
2208
2217
|
"aria-autocomplete": "list",
|
|
2209
2218
|
placeholder: (n.value && x.value.length ? " " : null) || y.value && !T.value?.length && F.value || " ",
|
|
2210
|
-
"onUpdate:modelValue":
|
|
2219
|
+
"onUpdate:modelValue": b[2] || (b[2] = (w) => T.value = w),
|
|
2211
2220
|
onFocus: Ft,
|
|
2212
2221
|
onBlur: Ot,
|
|
2213
2222
|
onKeydown: Tt
|
|
2214
2223
|
}, null, 40, fa)), [
|
|
2215
|
-
[
|
|
2224
|
+
[he, T.value]
|
|
2216
2225
|
]) : D("", !0)
|
|
2217
2226
|
])
|
|
2218
2227
|
], 512),
|
|
@@ -2223,8 +2232,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2223
2232
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2224
2233
|
"aria-hidden": "true",
|
|
2225
2234
|
disabled: s.value,
|
|
2226
|
-
onClick:
|
|
2227
|
-
},
|
|
2235
|
+
onClick: ke(Y, ["stop"])
|
|
2236
|
+
}, b[6] || (b[6] = [
|
|
2228
2237
|
l("svg", {
|
|
2229
2238
|
height: "20",
|
|
2230
2239
|
width: "20",
|
|
@@ -2234,15 +2243,15 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2234
2243
|
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
2244
|
], -1)
|
|
2236
2245
|
]), 8, va)) : D("", !0),
|
|
2237
|
-
|
|
2246
|
+
b[8] || (b[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2238
2247
|
l("button", {
|
|
2239
2248
|
type: "button",
|
|
2240
2249
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2241
2250
|
"aria-hidden": "true",
|
|
2242
2251
|
disabled: s.value,
|
|
2243
|
-
onClick:
|
|
2252
|
+
onClick: b[3] || (b[3] = ke((w) => g(), ["stop"])),
|
|
2244
2253
|
title: m.value ? "Закрити список" : "Відкрити список"
|
|
2245
|
-
},
|
|
2254
|
+
}, b[7] || (b[7] = [
|
|
2246
2255
|
l("svg", {
|
|
2247
2256
|
height: "20",
|
|
2248
2257
|
width: "20",
|
|
@@ -2254,7 +2263,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2254
2263
|
]), 8, ha)
|
|
2255
2264
|
])
|
|
2256
2265
|
], 42, na),
|
|
2257
|
-
(i(),
|
|
2266
|
+
(i(), ve(Mt, { to: "body" }, [
|
|
2258
2267
|
m.value ? (i(), d("div", {
|
|
2259
2268
|
key: 0,
|
|
2260
2269
|
ref_key: "dropdownRef",
|
|
@@ -2271,38 +2280,38 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2271
2280
|
ref_key: "listRef",
|
|
2272
2281
|
ref: p
|
|
2273
2282
|
}, [
|
|
2274
|
-
Z.value.length ? (i(!0), d(
|
|
2275
|
-
key:
|
|
2283
|
+
Z.value.length ? (i(!0), d(re, { key: 0 }, fe(Z.value, (w, P) => (i(), d("div", {
|
|
2284
|
+
key: w.id,
|
|
2276
2285
|
ref_for: !0,
|
|
2277
|
-
ref: (
|
|
2286
|
+
ref: (ne) => K.value[P] = ne,
|
|
2278
2287
|
class: E([
|
|
2279
2288
|
"flex px-3 py-2 cursor-default select-none text-gray-900 ",
|
|
2280
|
-
M(
|
|
2281
|
-
R.value === P && !M(
|
|
2289
|
+
M(w.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
|
|
2290
|
+
R.value === P && !M(w.id) ? "bg-blue-100" : ""
|
|
2282
2291
|
]),
|
|
2283
|
-
"aria-disabled": M(
|
|
2292
|
+
"aria-disabled": M(w.id) ? "true" : "false",
|
|
2284
2293
|
role: "option",
|
|
2285
2294
|
tabindex: "-1",
|
|
2286
|
-
onClick: (
|
|
2295
|
+
onClick: (ne) => ge(w)
|
|
2287
2296
|
}, [
|
|
2288
|
-
|
|
2297
|
+
w?.color ? (i(), d("span", {
|
|
2289
2298
|
key: 0,
|
|
2290
2299
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2291
|
-
style: be({ backgroundColor:
|
|
2300
|
+
style: be({ backgroundColor: w?.color })
|
|
2292
2301
|
}, null, 4)) : D("", !0),
|
|
2293
2302
|
l("div", {
|
|
2294
2303
|
class: E([
|
|
2295
2304
|
"leading-[19px]",
|
|
2296
|
-
R.value ===
|
|
2305
|
+
R.value === w.id ? "text-white" : "",
|
|
2297
2306
|
// active style like react-select
|
|
2298
2307
|
(R.value === P, "")
|
|
2299
2308
|
])
|
|
2300
2309
|
}, [
|
|
2301
2310
|
j.value ? (i(), d("span", {
|
|
2302
2311
|
key: 0,
|
|
2303
|
-
innerHTML:
|
|
2304
|
-
}, null, 8, ba)) : (i(), d(
|
|
2305
|
-
|
|
2312
|
+
innerHTML: C(w)
|
|
2313
|
+
}, null, 8, ba)) : (i(), d(re, { key: 1 }, [
|
|
2314
|
+
me(q(w.text), 1)
|
|
2306
2315
|
], 64))
|
|
2307
2316
|
], 2)
|
|
2308
2317
|
], 10, ga))), 128)) : (i(), d("div", ya, " No options "))
|
|
@@ -2317,18 +2326,18 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2317
2326
|
disabled: s.value,
|
|
2318
2327
|
type: "button"
|
|
2319
2328
|
}, [
|
|
2320
|
-
A(
|
|
2329
|
+
A(qe, {
|
|
2321
2330
|
width: "16",
|
|
2322
2331
|
height: "16"
|
|
2323
2332
|
}),
|
|
2324
|
-
|
|
2333
|
+
b[11] || (b[11] = l("span", null, "Додати", -1))
|
|
2325
2334
|
], 8, xa)) : D("", !0)
|
|
2326
2335
|
], 512)
|
|
2327
2336
|
], 64));
|
|
2328
2337
|
}
|
|
2329
2338
|
}), wa = ["placeholder", "disabled"], ka = /* @__PURE__ */ U({
|
|
2330
2339
|
__name: "vs-input-textarea",
|
|
2331
|
-
props: /* @__PURE__ */
|
|
2340
|
+
props: /* @__PURE__ */ ie({
|
|
2332
2341
|
style: { default: () => ({}) },
|
|
2333
2342
|
customClass: { default: "" },
|
|
2334
2343
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2342,8 +2351,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2342
2351
|
}),
|
|
2343
2352
|
emits: ["update:modelValue"],
|
|
2344
2353
|
setup(o) {
|
|
2345
|
-
const e = o, { inputClass: t } =
|
|
2346
|
-
return (n, s) =>
|
|
2354
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
2355
|
+
return (n, s) => ae((i(), d("textarea", {
|
|
2347
2356
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
2348
2357
|
placeholder: n.placeholder,
|
|
2349
2358
|
disabled: n.disabled,
|
|
@@ -2353,7 +2362,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2353
2362
|
border: "1px solid #CFD9E0"
|
|
2354
2363
|
}
|
|
2355
2364
|
}, null, 10, wa)), [
|
|
2356
|
-
[
|
|
2365
|
+
[he, a.value]
|
|
2357
2366
|
]);
|
|
2358
2367
|
}
|
|
2359
2368
|
}), _a = {}, $a = {
|
|
@@ -2492,7 +2501,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2492
2501
|
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
2502
|
}, _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
2503
|
__name: "vs-input-datatable",
|
|
2495
|
-
props: /* @__PURE__ */
|
|
2504
|
+
props: /* @__PURE__ */ ie({
|
|
2496
2505
|
colModel: {},
|
|
2497
2506
|
style: {},
|
|
2498
2507
|
customClass: {},
|
|
@@ -2507,14 +2516,14 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2507
2516
|
}),
|
|
2508
2517
|
emits: ["update:modelValue"],
|
|
2509
2518
|
setup(o) {
|
|
2510
|
-
const e = o, t =
|
|
2519
|
+
const e = o, t = de(o, "modelValue"), a = k({}), n = k(""), s = B(() => {
|
|
2511
2520
|
if (!n.value) return t.value ?? [];
|
|
2512
2521
|
const z = n.value.toLowerCase();
|
|
2513
|
-
return t.value.filter((j) => e.colModel?.some((
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2522
|
+
return t.value.filter((j) => e.colModel?.some((C) => {
|
|
2523
|
+
const G = j[C.key];
|
|
2524
|
+
return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(z) : String(G).toLowerCase().includes(z) : !1;
|
|
2516
2525
|
}));
|
|
2517
|
-
}), r =
|
|
2526
|
+
}), r = k(null), u = k(null), c = k(!1), p = k(null), f = k({ top: 0, left: 0 }), m = (z) => {
|
|
2518
2527
|
r.value = z;
|
|
2519
2528
|
}, y = (z) => {
|
|
2520
2529
|
u.value = z;
|
|
@@ -2523,66 +2532,66 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2523
2532
|
r.value = null, u.value = null;
|
|
2524
2533
|
return;
|
|
2525
2534
|
}
|
|
2526
|
-
const j = [...t.value], [
|
|
2527
|
-
j.splice(z, 0,
|
|
2528
|
-
},
|
|
2529
|
-
const
|
|
2530
|
-
f.value = { top:
|
|
2535
|
+
const j = [...t.value], [C] = j.splice(r.value, 1);
|
|
2536
|
+
j.splice(z, 0, C), t.value = j, r.value = null, u.value = null;
|
|
2537
|
+
}, W = (z) => {
|
|
2538
|
+
const C = z.currentTarget.getBoundingClientRect();
|
|
2539
|
+
f.value = { top: C.bottom + window.scrollY, left: C.left + window.scrollX }, c.value = !c.value;
|
|
2531
2540
|
}, R = () => {
|
|
2532
2541
|
p.value && p.value.click();
|
|
2533
2542
|
}, K = (z) => {
|
|
2534
|
-
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"],
|
|
2535
|
-
return j.some((
|
|
2543
|
+
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], C = z.toLowerCase();
|
|
2544
|
+
return j.some((G) => C.endsWith(G));
|
|
2536
2545
|
}, T = (z) => {
|
|
2537
|
-
const
|
|
2538
|
-
if (
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2546
|
+
const C = z.target.files?.[0];
|
|
2547
|
+
if (!C) return;
|
|
2548
|
+
const G = new FileReader();
|
|
2549
|
+
G.onload = (oe) => {
|
|
2541
2550
|
try {
|
|
2542
|
-
const
|
|
2543
|
-
if (typeof
|
|
2544
|
-
const
|
|
2545
|
-
Array.isArray(
|
|
2551
|
+
const se = oe.target?.result;
|
|
2552
|
+
if (typeof se == "string") {
|
|
2553
|
+
const Le = JSON.parse(se);
|
|
2554
|
+
Array.isArray(Le) && t.value.push(...Le);
|
|
2546
2555
|
}
|
|
2547
|
-
} catch (
|
|
2548
|
-
console.error("Error parsing file:",
|
|
2556
|
+
} catch (se) {
|
|
2557
|
+
console.error("Error parsing file:", se);
|
|
2549
2558
|
}
|
|
2550
|
-
},
|
|
2559
|
+
}, G.readAsText(C);
|
|
2551
2560
|
}, H = () => {
|
|
2552
|
-
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }),
|
|
2553
|
-
|
|
2561
|
+
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }), C = URL.createObjectURL(j), G = document.createElement("a");
|
|
2562
|
+
G.href = C, G.download = "data.json", G.click(), URL.revokeObjectURL(C);
|
|
2554
2563
|
};
|
|
2555
|
-
|
|
2564
|
+
_e(async () => {
|
|
2556
2565
|
const z = e.colModel?.filter((j) => j.data);
|
|
2557
2566
|
z?.length && Promise.all(z.map(async (j) => {
|
|
2558
|
-
const
|
|
2559
|
-
a.value[j.key] =
|
|
2567
|
+
const G = await (await fetch(`/api/suggest/${j.data}`)).json();
|
|
2568
|
+
a.value[j.key] = G.data;
|
|
2560
2569
|
}));
|
|
2561
2570
|
});
|
|
2562
|
-
const I =
|
|
2571
|
+
const I = k(""), v = k(!1);
|
|
2563
2572
|
let x = "edit", V = 0;
|
|
2564
|
-
const
|
|
2573
|
+
const $ = k({}), F = k({});
|
|
2565
2574
|
async function te() {
|
|
2566
|
-
I.value = "Додати", v.value = !0, x = "add",
|
|
2575
|
+
I.value = "Додати", v.value = !0, x = "add", $.value = {};
|
|
2567
2576
|
}
|
|
2568
2577
|
function J(z, j) {
|
|
2569
|
-
const
|
|
2570
|
-
return a.value[
|
|
2578
|
+
const C = j.key || j.name;
|
|
2579
|
+
return a.value[C] && z[C] ? a.value[C].find((G) => G.id.toString() === z[C].toString())?.text ?? z[C] : z[C] || "-";
|
|
2571
2580
|
}
|
|
2572
2581
|
async function M(z, j) {
|
|
2573
|
-
I.value = "Редагувати", v.value = !0, x = "edit", V = j,
|
|
2582
|
+
I.value = "Редагувати", v.value = !0, x = "edit", V = j, $.value = { ...z };
|
|
2574
2583
|
}
|
|
2575
2584
|
function Z() {
|
|
2576
2585
|
const z = F.value.validate();
|
|
2577
2586
|
if (z) {
|
|
2578
|
-
|
|
2587
|
+
ce({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j, C]) => `${j}: ${C}`).join(`
|
|
2579
2588
|
`) });
|
|
2580
2589
|
return;
|
|
2581
2590
|
}
|
|
2582
|
-
x === "add" ? Array.isArray(t.value) ? t.value = [...t.value,
|
|
2591
|
+
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
2592
|
}
|
|
2584
2593
|
function N(z) {
|
|
2585
|
-
t.value = t.value.filter((j,
|
|
2594
|
+
t.value = t.value.filter((j, C) => C !== z);
|
|
2586
2595
|
}
|
|
2587
2596
|
function le() {
|
|
2588
2597
|
v.value = !1;
|
|
@@ -2595,13 +2604,13 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2595
2604
|
height: "14",
|
|
2596
2605
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2597
2606
|
}),
|
|
2598
|
-
|
|
2607
|
+
ae(l("input", {
|
|
2599
2608
|
type: "text",
|
|
2600
|
-
"onUpdate:modelValue": j[0] || (j[0] = (
|
|
2609
|
+
"onUpdate:modelValue": j[0] || (j[0] = (C) => n.value = C),
|
|
2601
2610
|
placeholder: "Пошук",
|
|
2602
2611
|
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
2612
|
}, null, 512), [
|
|
2604
|
-
[
|
|
2613
|
+
[he, n.value]
|
|
2605
2614
|
])
|
|
2606
2615
|
]),
|
|
2607
2616
|
l("div", Qa, [
|
|
@@ -2617,7 +2626,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2617
2626
|
l("div", ts, [
|
|
2618
2627
|
l("div", ls, [
|
|
2619
2628
|
l("button", {
|
|
2620
|
-
onClick:
|
|
2629
|
+
onClick: W,
|
|
2621
2630
|
class: "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"
|
|
2622
2631
|
}, [
|
|
2623
2632
|
A(Ba, {
|
|
@@ -2629,7 +2638,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2629
2638
|
])
|
|
2630
2639
|
])
|
|
2631
2640
|
]),
|
|
2632
|
-
(i(),
|
|
2641
|
+
(i(), ve(Mt, { to: "body" }, [
|
|
2633
2642
|
c.value ? (i(), d("div", {
|
|
2634
2643
|
key: 0,
|
|
2635
2644
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
@@ -2646,7 +2655,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2646
2655
|
width: "14",
|
|
2647
2656
|
height: "14"
|
|
2648
2657
|
}),
|
|
2649
|
-
j[4] || (j[4] =
|
|
2658
|
+
j[4] || (j[4] = me(" Імпортувати ", -1))
|
|
2650
2659
|
]),
|
|
2651
2660
|
l("button", {
|
|
2652
2661
|
onClick: H,
|
|
@@ -2658,7 +2667,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2658
2667
|
width: "14",
|
|
2659
2668
|
height: "14"
|
|
2660
2669
|
}),
|
|
2661
|
-
j[5] || (j[5] =
|
|
2670
|
+
j[5] || (j[5] = me(" Експортувати ", -1))
|
|
2662
2671
|
])
|
|
2663
2672
|
])
|
|
2664
2673
|
])
|
|
@@ -2669,8 +2678,8 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2669
2678
|
onClick: te,
|
|
2670
2679
|
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
2680
|
}, [
|
|
2672
|
-
A(
|
|
2673
|
-
j[6] || (j[6] =
|
|
2681
|
+
A(qe),
|
|
2682
|
+
j[6] || (j[6] = me(" Додати ", -1))
|
|
2674
2683
|
])
|
|
2675
2684
|
]),
|
|
2676
2685
|
l("div", ss, [
|
|
@@ -2684,10 +2693,10 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2684
2693
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2685
2694
|
})
|
|
2686
2695
|
]),
|
|
2687
|
-
(i(!0), d(
|
|
2688
|
-
key:
|
|
2696
|
+
(i(!0), d(re, null, fe(z.colModel, (C) => (i(), d("th", {
|
|
2697
|
+
key: C.key,
|
|
2689
2698
|
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
|
-
},
|
|
2699
|
+
}, q(C.ua || C.label), 1))), 128)),
|
|
2691
2700
|
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
2701
|
])
|
|
2693
2702
|
]),
|
|
@@ -2705,16 +2714,16 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2705
2714
|
])
|
|
2706
2715
|
])
|
|
2707
2716
|
])) : D("", !0),
|
|
2708
|
-
(i(!0), d(
|
|
2709
|
-
key:
|
|
2717
|
+
(i(!0), d(re, null, fe(s.value, (C, G) => (i(), d("tr", {
|
|
2718
|
+
key: C.id,
|
|
2710
2719
|
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
|
-
"opacity-50": r.value ===
|
|
2712
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value ===
|
|
2720
|
+
"opacity-50": r.value === G,
|
|
2721
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === G
|
|
2713
2722
|
}]),
|
|
2714
2723
|
draggable: "true",
|
|
2715
|
-
onDragstart: (oe) => m(
|
|
2716
|
-
onDragover:
|
|
2717
|
-
onDrop: (oe) => S(
|
|
2724
|
+
onDragstart: (oe) => m(G),
|
|
2725
|
+
onDragover: ke((oe) => y(G), ["prevent"]),
|
|
2726
|
+
onDrop: (oe) => S(G)
|
|
2718
2727
|
}, [
|
|
2719
2728
|
l("td", vs, [
|
|
2720
2729
|
l("div", hs, [
|
|
@@ -2725,14 +2734,14 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2725
2734
|
})
|
|
2726
2735
|
])
|
|
2727
2736
|
]),
|
|
2728
|
-
(i(!0), d(
|
|
2737
|
+
(i(!0), d(re, null, fe(z.colModel, (oe) => (i(), d("td", {
|
|
2729
2738
|
key: oe.key,
|
|
2730
2739
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2731
2740
|
}, [
|
|
2732
2741
|
oe.type === "file" ? (i(), d("div", gs, [
|
|
2733
|
-
K(J(
|
|
2742
|
+
K(J(C, oe)) ? (i(), d("div", bs, [
|
|
2734
2743
|
l("img", {
|
|
2735
|
-
src: J(
|
|
2744
|
+
src: J(C, oe),
|
|
2736
2745
|
alt: "alt",
|
|
2737
2746
|
width: "45",
|
|
2738
2747
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
@@ -2743,13 +2752,13 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2743
2752
|
])) : oe.type === "tiptap-editor" ? (i(), d("div", {
|
|
2744
2753
|
key: 1,
|
|
2745
2754
|
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,
|
|
2755
|
+
innerHTML: J(C, oe)
|
|
2756
|
+
}, null, 8, ws)) : (i(), d("div", ks, q(J(C, oe)), 1))
|
|
2748
2757
|
]))), 128)),
|
|
2749
2758
|
l("td", _s, [
|
|
2750
2759
|
l("div", $s, [
|
|
2751
2760
|
l("button", {
|
|
2752
|
-
onClick: (oe) => M(
|
|
2761
|
+
onClick: (oe) => M(C, G),
|
|
2753
2762
|
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
2763
|
}, [
|
|
2755
2764
|
A(Ka, {
|
|
@@ -2759,10 +2768,10 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2759
2768
|
})
|
|
2760
2769
|
], 8, Cs),
|
|
2761
2770
|
l("button", {
|
|
2762
|
-
onClick: (oe) => N(
|
|
2771
|
+
onClick: (oe) => N(G),
|
|
2763
2772
|
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
2773
|
}, [
|
|
2765
|
-
A(
|
|
2774
|
+
A(et, {
|
|
2766
2775
|
width: "24",
|
|
2767
2776
|
height: "24",
|
|
2768
2777
|
class: "w-3 h-3"
|
|
@@ -2780,18 +2789,18 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2780
2789
|
size: "lg",
|
|
2781
2790
|
onClose: le
|
|
2782
2791
|
}, {
|
|
2783
|
-
default:
|
|
2784
|
-
A(
|
|
2792
|
+
default: Ee(() => [
|
|
2793
|
+
A(We, {
|
|
2785
2794
|
schema: e.colModel,
|
|
2786
|
-
values:
|
|
2787
|
-
"onUpdate:values": j[1] || (j[1] = (
|
|
2795
|
+
values: $.value,
|
|
2796
|
+
"onUpdate:values": j[1] || (j[1] = (C) => $.value = C),
|
|
2788
2797
|
form: F.value,
|
|
2789
|
-
"onUpdate:form": j[2] || (j[2] = (
|
|
2798
|
+
"onUpdate:form": j[2] || (j[2] = (C) => F.value = C)
|
|
2790
2799
|
}, null, 8, ["schema", "values", "form"]),
|
|
2791
2800
|
l("div", Ms, [
|
|
2792
2801
|
l("button", {
|
|
2793
2802
|
type: "button",
|
|
2794
|
-
onClick: j[3] || (j[3] = (
|
|
2803
|
+
onClick: j[3] || (j[3] = (C) => v.value = !1),
|
|
2795
2804
|
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
2805
|
}, " Скасувати "),
|
|
2797
2806
|
l("button", {
|
|
@@ -2913,29 +2922,29 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2913
2922
|
}
|
|
2914
2923
|
}
|
|
2915
2924
|
};
|
|
2916
|
-
function
|
|
2925
|
+
function Ne(o) {
|
|
2917
2926
|
return o ? o.type === "Polygon" ? {
|
|
2918
2927
|
type: "MultiPolygon",
|
|
2919
2928
|
coordinates: [o.coordinates]
|
|
2920
2929
|
} : o.type === "Feature" ? {
|
|
2921
2930
|
...o,
|
|
2922
|
-
geometry:
|
|
2931
|
+
geometry: Ne(o.geometry)
|
|
2923
2932
|
} : o.type === "FeatureCollection" ? {
|
|
2924
2933
|
...o,
|
|
2925
|
-
features: (o.features || []).map((e) =>
|
|
2934
|
+
features: (o.features || []).map((e) => Ne(e)).filter(Boolean)
|
|
2926
2935
|
} : o : null;
|
|
2927
2936
|
}
|
|
2928
2937
|
function Bs(o) {
|
|
2929
|
-
return o ? o.type === "FeatureCollection" || o.type === "Feature" ?
|
|
2938
|
+
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? Ne(o) : o.geom ? {
|
|
2930
2939
|
type: "Feature",
|
|
2931
|
-
geometry:
|
|
2940
|
+
geometry: Ne({
|
|
2932
2941
|
type: o.geom.type,
|
|
2933
2942
|
coordinates: o.geom.coordinates
|
|
2934
2943
|
}),
|
|
2935
2944
|
properties: {}
|
|
2936
2945
|
} : o.type && o.coordinates ? {
|
|
2937
2946
|
type: "Feature",
|
|
2938
|
-
geometry:
|
|
2947
|
+
geometry: Ne(o),
|
|
2939
2948
|
properties: {}
|
|
2940
2949
|
} : null : null;
|
|
2941
2950
|
}
|
|
@@ -3063,12 +3072,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3063
3072
|
const t = o, a = e, n = ["here", "xy", "parcel"], s = B(() => {
|
|
3064
3073
|
const v = t.config?.tools?.filter((x) => n.includes(x));
|
|
3065
3074
|
return v && v.length ? v : n;
|
|
3066
|
-
}), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u =
|
|
3067
|
-
|
|
3075
|
+
}), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u = k(s.value[0] ?? n[0]);
|
|
3076
|
+
ue(s, (v) => {
|
|
3068
3077
|
v.includes(u.value) || (u.value = v[0]);
|
|
3069
3078
|
});
|
|
3070
|
-
const c =
|
|
3071
|
-
|
|
3079
|
+
const c = k(""), p = k(!1), f = k(null);
|
|
3080
|
+
ue(u, () => {
|
|
3072
3081
|
c.value = "", p.value = !1;
|
|
3073
3082
|
});
|
|
3074
3083
|
function m(v) {
|
|
@@ -3079,7 +3088,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3079
3088
|
const x = f.value;
|
|
3080
3089
|
x && !x.contains(v.target) && (p.value = !1);
|
|
3081
3090
|
}
|
|
3082
|
-
|
|
3091
|
+
_e(() => {
|
|
3083
3092
|
window.addEventListener("click", y, !0);
|
|
3084
3093
|
}), at(() => {
|
|
3085
3094
|
window.removeEventListener("click", y, !0);
|
|
@@ -3087,14 +3096,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3087
3096
|
function S(v) {
|
|
3088
3097
|
return v === "xy" ? "Координати" : v === "parcel" ? "Кадастр" : "Адреси";
|
|
3089
3098
|
}
|
|
3090
|
-
function
|
|
3099
|
+
function W(v) {
|
|
3091
3100
|
const x = v.replace(/[,]+/g, " ").trim();
|
|
3092
3101
|
if (!x) return null;
|
|
3093
3102
|
const V = x.split(/\s+/).filter(Boolean);
|
|
3094
3103
|
if (V.length < 2) return null;
|
|
3095
|
-
const
|
|
3096
|
-
if (
|
|
3097
|
-
let [F, te] =
|
|
3104
|
+
const $ = V.slice(0, 2).map(Number);
|
|
3105
|
+
if (!$.every((le) => Number.isFinite(le))) return null;
|
|
3106
|
+
let [F, te] = $, J = F, M = te;
|
|
3098
3107
|
const Z = (le) => Math.abs(le) <= 90, N = (le) => Math.abs(le) <= 180;
|
|
3099
3108
|
if (!Z(J) || !N(M))
|
|
3100
3109
|
if (Z(M) && N(J))
|
|
@@ -3104,8 +3113,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3104
3113
|
return { lat: J, lng: M };
|
|
3105
3114
|
}
|
|
3106
3115
|
function R(v) {
|
|
3107
|
-
return (v?.items || []).map((V,
|
|
3108
|
-
id: String(V?.id ??
|
|
3116
|
+
return (v?.items || []).map((V, $) => ({
|
|
3117
|
+
id: String(V?.id ?? $),
|
|
3109
3118
|
title: V?.title || V?.address?.label || "Знайдений обʼєкт",
|
|
3110
3119
|
lat: Number(V?.position?.lat),
|
|
3111
3120
|
lng: Number(V?.position?.lng)
|
|
@@ -3116,21 +3125,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3116
3125
|
if (!x) return [];
|
|
3117
3126
|
const V = x.geom_centroid;
|
|
3118
3127
|
if (!V || !Array.isArray(V.coordinates)) return [];
|
|
3119
|
-
const [
|
|
3120
|
-
return !Number.isFinite(F) || !Number.isFinite(
|
|
3128
|
+
const [$, F] = V.coordinates;
|
|
3129
|
+
return !Number.isFinite(F) || !Number.isFinite($) ? [] : [
|
|
3121
3130
|
{
|
|
3122
3131
|
id: "parcel",
|
|
3123
3132
|
title: x.cadnum || x.cad_num || "Земельна ділянка",
|
|
3124
3133
|
lat: F,
|
|
3125
|
-
lng:
|
|
3134
|
+
lng: $
|
|
3126
3135
|
}
|
|
3127
3136
|
];
|
|
3128
3137
|
}
|
|
3129
3138
|
function T(v) {
|
|
3130
3139
|
const V = v.replace(/\s+/g, "").split(":");
|
|
3131
3140
|
if (V.length !== 4) return !1;
|
|
3132
|
-
const
|
|
3133
|
-
return V.every((F, te) => F.length ===
|
|
3141
|
+
const $ = [10, 2, 3, 4];
|
|
3142
|
+
return V.every((F, te) => F.length === $[te] && /^\d+$/.test(F));
|
|
3134
3143
|
}
|
|
3135
3144
|
function H(v) {
|
|
3136
3145
|
a("goToCoordinates", [v.lat, v.lng]);
|
|
@@ -3139,9 +3148,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3139
3148
|
const v = c.value.trim();
|
|
3140
3149
|
if (v) {
|
|
3141
3150
|
if (u.value === "xy") {
|
|
3142
|
-
const x =
|
|
3151
|
+
const x = W(v);
|
|
3143
3152
|
if (!x) {
|
|
3144
|
-
|
|
3153
|
+
ce({ type: "warning", title: "Пошук координат", message: "Не знайдено або невірний формат координат" });
|
|
3145
3154
|
return;
|
|
3146
3155
|
}
|
|
3147
3156
|
H(x), c.value = "";
|
|
@@ -3153,30 +3162,30 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3153
3162
|
x.searchParams.set("searchtext", v);
|
|
3154
3163
|
else {
|
|
3155
3164
|
if (!T(v)) {
|
|
3156
|
-
|
|
3165
|
+
ce({ type: "warning", title: "Пошук кадастру", message: "Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ" });
|
|
3157
3166
|
return;
|
|
3158
3167
|
}
|
|
3159
3168
|
x.searchParams.set("cad_num", v);
|
|
3160
3169
|
}
|
|
3161
3170
|
const V = await fetch(x.toString());
|
|
3162
3171
|
if (!V.ok) throw new Error(`HTTP ${V.status}`);
|
|
3163
|
-
const
|
|
3172
|
+
const $ = await V.json(), F = u.value === "here" ? R($) : K($);
|
|
3164
3173
|
if (!F.length)
|
|
3165
|
-
|
|
3174
|
+
ce({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
|
|
3166
3175
|
else {
|
|
3167
3176
|
const te = F[0];
|
|
3168
3177
|
H(te), c.value = "";
|
|
3169
3178
|
}
|
|
3170
3179
|
} catch (x) {
|
|
3171
3180
|
const V = x?.message || "Помилка пошуку";
|
|
3172
|
-
|
|
3181
|
+
ce({ type: "error", title: "Пошук", message: V });
|
|
3173
3182
|
}
|
|
3174
3183
|
}
|
|
3175
3184
|
}
|
|
3176
3185
|
return (v, x) => (i(), d("div", Ys, [
|
|
3177
3186
|
l("form", {
|
|
3178
3187
|
class: "flex gap-2",
|
|
3179
|
-
onSubmit:
|
|
3188
|
+
onSubmit: ke(I, ["prevent"])
|
|
3180
3189
|
}, [
|
|
3181
3190
|
s.value.length > 1 ? (i(), d("div", {
|
|
3182
3191
|
key: 0,
|
|
@@ -3189,7 +3198,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3189
3198
|
class: "vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",
|
|
3190
3199
|
onClick: x[0] || (x[0] = (V) => p.value = !p.value)
|
|
3191
3200
|
}, [
|
|
3192
|
-
l("span", null,
|
|
3201
|
+
l("span", null, q(S(u.value)), 1),
|
|
3193
3202
|
(i(), d("svg", {
|
|
3194
3203
|
class: E(["w-4 h-4 text-gray-500 transition-transform", { "rotate-180": p.value }]),
|
|
3195
3204
|
viewBox: "0 0 24 24",
|
|
@@ -3207,23 +3216,23 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3207
3216
|
]),
|
|
3208
3217
|
p.value ? (i(), d("div", Xs, [
|
|
3209
3218
|
l("ul", null, [
|
|
3210
|
-
(i(!0), d(
|
|
3219
|
+
(i(!0), d(re, null, fe(s.value, (V) => (i(), d("li", {
|
|
3211
3220
|
key: V,
|
|
3212
3221
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
3213
|
-
onClick: (
|
|
3214
|
-
},
|
|
3222
|
+
onClick: ($) => m(V)
|
|
3223
|
+
}, q(S(V)), 9, Qs))), 128))
|
|
3215
3224
|
])
|
|
3216
3225
|
])) : D("", !0)
|
|
3217
3226
|
], 512)) : D("", !0),
|
|
3218
3227
|
l("div", er, [
|
|
3219
|
-
|
|
3228
|
+
ae(l("input", {
|
|
3220
3229
|
"onUpdate:modelValue": x[1] || (x[1] = (V) => c.value = V),
|
|
3221
3230
|
placeholder: r.value,
|
|
3222
3231
|
type: "text",
|
|
3223
3232
|
class: "vs-input transition-all border block w-full border-gray-200 rounded-md focus:border-blue-100 border-solid !pr-8 py-1.5 pl-3 text-sm"
|
|
3224
3233
|
}, null, 8, tr), [
|
|
3225
3234
|
[
|
|
3226
|
-
|
|
3235
|
+
he,
|
|
3227
3236
|
c.value,
|
|
3228
3237
|
void 0,
|
|
3229
3238
|
{ trim: !0 }
|
|
@@ -3260,13 +3269,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3260
3269
|
},
|
|
3261
3270
|
emits: ["onLayerChange"],
|
|
3262
3271
|
setup(o, { emit: e }) {
|
|
3263
|
-
const a =
|
|
3272
|
+
const a = k(Object.keys(o.basemaps)[0]), n = e;
|
|
3264
3273
|
function s(r) {
|
|
3265
3274
|
n("onLayerChange", r), a.value = r;
|
|
3266
3275
|
}
|
|
3267
3276
|
return (r, u) => (i(), d("div", sr, [
|
|
3268
3277
|
l("div", rr, [
|
|
3269
|
-
(i(!0), d(
|
|
3278
|
+
(i(!0), d(re, null, fe(r.basemaps, (c, p) => (i(), d("div", {
|
|
3270
3279
|
key: p,
|
|
3271
3280
|
class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": a.value === p }]),
|
|
3272
3281
|
onClick: (f) => s(p),
|
|
@@ -3310,23 +3319,23 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3310
3319
|
},
|
|
3311
3320
|
emits: ["update:modelValue"],
|
|
3312
3321
|
setup(o, { emit: e }) {
|
|
3313
|
-
const t = Wt(), a = o, n = e, s =
|
|
3322
|
+
const t = Wt(), a = o, n = e, s = k(!1), r = k("");
|
|
3314
3323
|
function u() {
|
|
3315
|
-
const
|
|
3324
|
+
const g = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
|
|
3316
3325
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Використовуйте два пальці для зуму карти." : "Використовуйте Ctrl + прокрутка для зуму карти.";
|
|
3317
3326
|
}
|
|
3318
|
-
const c =
|
|
3327
|
+
const c = k(null);
|
|
3319
3328
|
let p, f, m, y = null;
|
|
3320
|
-
const S =
|
|
3321
|
-
|
|
3329
|
+
const S = k(null), W = (g) => {
|
|
3330
|
+
g.ctrlKey && g.preventDefault();
|
|
3322
3331
|
};
|
|
3323
3332
|
function R() {
|
|
3324
3333
|
if (!a.handleZoom) return null;
|
|
3325
|
-
let
|
|
3326
|
-
const
|
|
3327
|
-
const Q = O.ctrlKey || O.metaKey,
|
|
3328
|
-
if (!Q && !
|
|
3329
|
-
s.value = !0, r.value = u(), clearTimeout(
|
|
3334
|
+
let g;
|
|
3335
|
+
const _ = (O) => {
|
|
3336
|
+
const Q = O.ctrlKey || O.metaKey, ge = O.shiftKey;
|
|
3337
|
+
if (!Q && !ge) {
|
|
3338
|
+
s.value = !0, r.value = u(), clearTimeout(g), g = window.setTimeout(() => {
|
|
3330
3339
|
s.value = !1;
|
|
3331
3340
|
}, 1e3);
|
|
3332
3341
|
return;
|
|
@@ -3336,152 +3345,152 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3336
3345
|
}, 100);
|
|
3337
3346
|
}, Y = (O) => {
|
|
3338
3347
|
if (O.touches.length === 1) {
|
|
3339
|
-
s.value = !0, r.value = u(), clearTimeout(
|
|
3348
|
+
s.value = !0, r.value = u(), clearTimeout(g), g = window.setTimeout(() => {
|
|
3340
3349
|
s.value = !1;
|
|
3341
3350
|
}, 3e3);
|
|
3342
3351
|
return;
|
|
3343
3352
|
}
|
|
3344
3353
|
s.value = !1;
|
|
3345
3354
|
};
|
|
3346
|
-
return c.value && (c.value.addEventListener("wheel",
|
|
3347
|
-
const Q = O.originalEvent.ctrlKey || O.originalEvent.metaKey,
|
|
3348
|
-
!Q && !
|
|
3355
|
+
return c.value && (c.value.addEventListener("wheel", _, { passive: !1 }), c.value.addEventListener("touchstart", Y, { passive: !0 })), p && p.on("wheel", (O) => {
|
|
3356
|
+
const Q = O.originalEvent.ctrlKey || O.originalEvent.metaKey, ge = O.originalEvent.shiftKey;
|
|
3357
|
+
!Q && !ge && (O.originalEvent.preventDefault(), O.originalEvent.stopPropagation());
|
|
3349
3358
|
}), () => {
|
|
3350
|
-
c.value && (c.value.removeEventListener("wheel",
|
|
3359
|
+
c.value && (c.value.removeEventListener("wheel", _), c.value.removeEventListener("touchstart", Y)), p && p.off("wheel"), clearTimeout(g);
|
|
3351
3360
|
};
|
|
3352
3361
|
}
|
|
3353
|
-
const K =
|
|
3362
|
+
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
3363
|
let V;
|
|
3355
|
-
const
|
|
3356
|
-
function F(
|
|
3357
|
-
return
|
|
3364
|
+
const $ = k("topo100");
|
|
3365
|
+
function F(g) {
|
|
3366
|
+
return g ? g.type === "Polygon" ? {
|
|
3358
3367
|
type: "MultiPolygon",
|
|
3359
|
-
coordinates: [
|
|
3360
|
-
} : (
|
|
3368
|
+
coordinates: [g.coordinates]
|
|
3369
|
+
} : (g.type === "MultiPolygon", g) : null;
|
|
3361
3370
|
}
|
|
3362
3371
|
function te() {
|
|
3363
|
-
return new Promise((
|
|
3364
|
-
window.L && window.L.Draw &&
|
|
3372
|
+
return new Promise((g, _) => {
|
|
3373
|
+
window.L && window.L.Draw && g(0);
|
|
3365
3374
|
const Y = (Q) => {
|
|
3366
|
-
if (Array.from(document.styleSheets).some((
|
|
3367
|
-
const
|
|
3368
|
-
|
|
3369
|
-
}, O = (Q) => new Promise((
|
|
3370
|
-
const
|
|
3371
|
-
if (
|
|
3372
|
-
|
|
3375
|
+
if (Array.from(document.styleSheets).some((Be) => Be?.href?.includes(Q))) return;
|
|
3376
|
+
const Ve = document.createElement("link");
|
|
3377
|
+
Ve.rel = "stylesheet", Ve.href = Q, document.head.appendChild(Ve);
|
|
3378
|
+
}, O = (Q) => new Promise((ge, Ve) => {
|
|
3379
|
+
const Be = Array.from(document.scripts).find((Ie) => Ie.src === Q);
|
|
3380
|
+
if (Be) {
|
|
3381
|
+
Be.addEventListener("load", () => ge()), Be.addEventListener("error", (Ie) => Ve(Ie));
|
|
3373
3382
|
return;
|
|
3374
3383
|
}
|
|
3375
3384
|
const Me = document.createElement("script");
|
|
3376
|
-
Me.src = Q, Me.async = !0, Me.onload = () =>
|
|
3385
|
+
Me.src = Q, Me.async = !0, Me.onload = () => ge(), Me.onerror = (Ie) => Ve(Ie), document.body.appendChild(Me);
|
|
3377
3386
|
});
|
|
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(() =>
|
|
3387
|
+
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
3388
|
});
|
|
3380
3389
|
}
|
|
3381
3390
|
function J() {
|
|
3382
|
-
const
|
|
3391
|
+
const g = f.toGeoJSON(), _ = [], Y = (Q) => {
|
|
3383
3392
|
if (Q)
|
|
3384
3393
|
switch (Q.type) {
|
|
3385
3394
|
case "Polygon":
|
|
3386
|
-
|
|
3395
|
+
_.push(Q.coordinates);
|
|
3387
3396
|
break;
|
|
3388
3397
|
case "MultiPolygon":
|
|
3389
|
-
|
|
3398
|
+
_.push(...Q.coordinates);
|
|
3390
3399
|
break;
|
|
3391
3400
|
case "GeometryCollection":
|
|
3392
3401
|
(Q.geometries || []).forEach(Y);
|
|
3393
3402
|
break;
|
|
3394
3403
|
}
|
|
3395
3404
|
};
|
|
3396
|
-
(
|
|
3397
|
-
const O =
|
|
3405
|
+
(g?.features || []).forEach((Q) => Y(Q.geometry));
|
|
3406
|
+
const O = _.length ? { type: "MultiPolygon", coordinates: _ } : null;
|
|
3398
3407
|
n("update:modelValue", O ? F(O) : null), H.value = f.getLayers().length;
|
|
3399
3408
|
}
|
|
3400
|
-
function M(
|
|
3401
|
-
const
|
|
3402
|
-
if (!
|
|
3403
|
-
const O = L.featureGroup(
|
|
3404
|
-
O && O.isValid() && p.fitBounds(O, { padding: [
|
|
3409
|
+
function M(g = 30) {
|
|
3410
|
+
const _ = f.getLayers();
|
|
3411
|
+
if (!_.length) return;
|
|
3412
|
+
const O = L.featureGroup(_).getBounds();
|
|
3413
|
+
O && O.isValid() && p.fitBounds(O, { padding: [g, g] });
|
|
3405
3414
|
}
|
|
3406
3415
|
function Z() {
|
|
3407
3416
|
S.value?.click();
|
|
3408
3417
|
}
|
|
3409
|
-
const N =
|
|
3410
|
-
function le(
|
|
3411
|
-
return
|
|
3418
|
+
const N = k("");
|
|
3419
|
+
function le(g) {
|
|
3420
|
+
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
3421
|
}
|
|
3413
|
-
function z(
|
|
3414
|
-
if (
|
|
3415
|
-
const
|
|
3416
|
-
return Math.PI * (
|
|
3422
|
+
function z(g) {
|
|
3423
|
+
if (g instanceof L.Circle) {
|
|
3424
|
+
const _ = g.getRadius();
|
|
3425
|
+
return Math.PI * (_ * _) / 1e6;
|
|
3417
3426
|
}
|
|
3418
|
-
if (
|
|
3427
|
+
if (g instanceof L.Polygon || g instanceof L.Rectangle)
|
|
3419
3428
|
try {
|
|
3420
|
-
const
|
|
3429
|
+
const _ = g.getLatLngs(), Y = Array.isArray(_[0]) ? _[0] : _, O = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(Y) : 0;
|
|
3421
3430
|
return O ? O / 1e6 : 0;
|
|
3422
3431
|
} catch {
|
|
3423
3432
|
return null;
|
|
3424
3433
|
}
|
|
3425
3434
|
return null;
|
|
3426
3435
|
}
|
|
3427
|
-
function j(
|
|
3428
|
-
return
|
|
3436
|
+
function j(g) {
|
|
3437
|
+
return g instanceof L.Circle ? g.getLatLng() : g.getBounds ? g.getBounds().getCenter() : g.getLatLng ? g.getLatLng() : p.getCenter();
|
|
3429
3438
|
}
|
|
3430
|
-
function
|
|
3431
|
-
const
|
|
3432
|
-
if (!
|
|
3439
|
+
function C() {
|
|
3440
|
+
const g = f.getLayers();
|
|
3441
|
+
if (!g.length) {
|
|
3433
3442
|
v.value = null, H.value = 0;
|
|
3434
3443
|
return;
|
|
3435
3444
|
}
|
|
3436
|
-
const
|
|
3445
|
+
const _ = g[g.length - 1], Y = le(_), O = j(_), Q = z(_);
|
|
3437
3446
|
v.value = {
|
|
3438
3447
|
type: Y,
|
|
3439
3448
|
center: O,
|
|
3440
3449
|
areaKm2: Q,
|
|
3441
|
-
layer:
|
|
3442
|
-
}, H.value =
|
|
3450
|
+
layer: _
|
|
3451
|
+
}, H.value = g.length;
|
|
3443
3452
|
}
|
|
3444
|
-
function
|
|
3445
|
-
const
|
|
3446
|
-
|
|
3453
|
+
function G() {
|
|
3454
|
+
const g = v.value?.layer;
|
|
3455
|
+
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
3456
|
}
|
|
3448
3457
|
function oe() {
|
|
3449
|
-
const
|
|
3450
|
-
|
|
3458
|
+
const g = v.value?.layer;
|
|
3459
|
+
g && (f.removeLayer(g), J(), C());
|
|
3451
3460
|
}
|
|
3452
|
-
|
|
3453
|
-
document.addEventListener("wheel",
|
|
3454
|
-
const
|
|
3461
|
+
_e(async () => {
|
|
3462
|
+
document.addEventListener("wheel", W, { passive: !1 }), await te(), L.drawLocal = Ss;
|
|
3463
|
+
const g = a.handleZoom;
|
|
3455
3464
|
p = L.map(c.value, {
|
|
3456
3465
|
zoomControl: !1,
|
|
3457
|
-
scrollWheelZoom: !
|
|
3466
|
+
scrollWheelZoom: !g
|
|
3458
3467
|
}).setView(I.value, 10), setTimeout(() => {
|
|
3459
3468
|
y = R();
|
|
3460
|
-
}, 100), L.control.zoom({ position: "bottomright" }).addTo(p),
|
|
3469
|
+
}, 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
3470
|
const { layer: Q } = O;
|
|
3462
|
-
f.clearLayers(), f.addLayer(Q), J(),
|
|
3471
|
+
f.clearLayers(), f.addLayer(Q), J(), C(), M(), N.value = "";
|
|
3463
3472
|
}), p.on(L.Draw.Event.EDITED, () => {
|
|
3464
|
-
J(),
|
|
3473
|
+
J(), C(), M();
|
|
3465
3474
|
}), p.on(L.Draw.Event.DELETED, () => {
|
|
3466
|
-
J(),
|
|
3475
|
+
J(), C(), M();
|
|
3467
3476
|
});
|
|
3468
|
-
let
|
|
3477
|
+
let _ = !1;
|
|
3469
3478
|
p.on("mousemove", (O) => {
|
|
3470
|
-
|
|
3479
|
+
_ || (p.invalidateSize(), _ = !0), K.value = O.latlng;
|
|
3471
3480
|
}), p.on("zoomend", () => {
|
|
3472
3481
|
T.value = p.getZoom();
|
|
3473
3482
|
});
|
|
3474
3483
|
const Y = Bs(a.modelValue);
|
|
3475
3484
|
if (Y) {
|
|
3476
3485
|
const O = [];
|
|
3477
|
-
L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(),
|
|
3486
|
+
L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(), C(), M();
|
|
3478
3487
|
}
|
|
3479
|
-
}),
|
|
3480
|
-
document.removeEventListener("wheel",
|
|
3488
|
+
}), Xe(() => {
|
|
3489
|
+
document.removeEventListener("wheel", W), y && y();
|
|
3481
3490
|
});
|
|
3482
|
-
function
|
|
3491
|
+
function se(g) {
|
|
3483
3492
|
if (p) {
|
|
3484
|
-
switch (m && m.disable(),
|
|
3493
|
+
switch (m && m.disable(), g) {
|
|
3485
3494
|
case "marker":
|
|
3486
3495
|
m = new L.Draw.Marker(p);
|
|
3487
3496
|
break;
|
|
@@ -3498,54 +3507,54 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3498
3507
|
m = new L.Draw.Rectangle(p);
|
|
3499
3508
|
break;
|
|
3500
3509
|
}
|
|
3501
|
-
m && (m.enable(), N.value =
|
|
3510
|
+
m && (m.enable(), N.value = g);
|
|
3502
3511
|
}
|
|
3503
3512
|
}
|
|
3504
|
-
function
|
|
3505
|
-
const
|
|
3513
|
+
function Le() {
|
|
3514
|
+
const g = f.toGeoJSON(), _ = new Blob([JSON.stringify(g, null, 2)], { type: "application/json" }), Y = URL.createObjectURL(_), O = document.createElement("a");
|
|
3506
3515
|
O.href = Y, O.download = "data.geojson", O.click(), URL.revokeObjectURL(Y);
|
|
3507
3516
|
}
|
|
3508
|
-
function
|
|
3509
|
-
const
|
|
3517
|
+
function Oe(g) {
|
|
3518
|
+
const _ = g.target, Y = _.files?.[0];
|
|
3510
3519
|
if (!Y) return;
|
|
3511
3520
|
const O = new FileReader();
|
|
3512
3521
|
O.onload = () => {
|
|
3513
3522
|
if (typeof O.result == "string")
|
|
3514
3523
|
try {
|
|
3515
3524
|
const Q = JSON.parse(O.result);
|
|
3516
|
-
f.clearLayers(), Q && L.geoJSON({ type: "Feature", geometry: Q }).eachLayer((
|
|
3517
|
-
f.addLayer(
|
|
3518
|
-
}), J(),
|
|
3525
|
+
f.clearLayers(), Q && L.geoJSON({ type: "Feature", geometry: Q }).eachLayer((ge) => {
|
|
3526
|
+
f.addLayer(ge);
|
|
3527
|
+
}), J(), C(), M();
|
|
3519
3528
|
} finally {
|
|
3520
|
-
|
|
3529
|
+
_.value = "";
|
|
3521
3530
|
}
|
|
3522
3531
|
}, O.readAsText(Y);
|
|
3523
3532
|
}
|
|
3524
|
-
function
|
|
3525
|
-
p && (V && p.removeLayer(V), V = L.tileLayer(x[
|
|
3533
|
+
function Ge(g) {
|
|
3534
|
+
p && (V && p.removeLayer(V), V = L.tileLayer(x[g].url, { maxZoom: 19, minZoom: 6 }).addTo(p), $.value = g);
|
|
3526
3535
|
}
|
|
3527
|
-
function
|
|
3528
|
-
const
|
|
3529
|
-
p.setView(
|
|
3536
|
+
function tt(g) {
|
|
3537
|
+
const _ = L.latLng(g[0], g[1]);
|
|
3538
|
+
p.setView(_, 13);
|
|
3530
3539
|
}
|
|
3531
|
-
|
|
3540
|
+
ue(
|
|
3532
3541
|
() => a.modelValue,
|
|
3533
|
-
(
|
|
3534
|
-
const
|
|
3535
|
-
if (
|
|
3536
|
-
n("update:modelValue",
|
|
3542
|
+
(g) => {
|
|
3543
|
+
const _ = F(g);
|
|
3544
|
+
if (g && _ !== g) {
|
|
3545
|
+
n("update:modelValue", _);
|
|
3537
3546
|
return;
|
|
3538
3547
|
}
|
|
3539
|
-
f.clearLayers(),
|
|
3548
|
+
f.clearLayers(), _ && L.geoJSON({ type: "Feature", geometry: _ }).eachLayer((Y) => {
|
|
3540
3549
|
f.addLayer(Y), Y.dragging?.enable(), Y.dragging?.enabled(), Y.on("dragend", (O) => {
|
|
3541
|
-
const
|
|
3542
|
-
n("update:modelValue", { type: "Point", coordinates: [
|
|
3550
|
+
const ge = O.target.getLatLng();
|
|
3551
|
+
n("update:modelValue", { type: "Point", coordinates: [ge.lng, ge.lat] });
|
|
3543
3552
|
});
|
|
3544
|
-
}), H.value = f.getLayers().length,
|
|
3553
|
+
}), H.value = f.getLayers().length, C(), M();
|
|
3545
3554
|
}
|
|
3546
3555
|
);
|
|
3547
|
-
function
|
|
3548
|
-
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((
|
|
3556
|
+
function De() {
|
|
3557
|
+
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
3558
|
topo100: {
|
|
3550
3559
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3551
3560
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3560,13 +3569,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3560
3569
|
}
|
|
3561
3570
|
};
|
|
3562
3571
|
}
|
|
3563
|
-
const
|
|
3564
|
-
return
|
|
3572
|
+
const Ce = k(!1);
|
|
3573
|
+
return ue(Ce, () => {
|
|
3565
3574
|
setTimeout(() => {
|
|
3566
3575
|
p.invalidateSize();
|
|
3567
3576
|
}, 50);
|
|
3568
|
-
}), (
|
|
3569
|
-
class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen:
|
|
3577
|
+
}), (g, _) => (i(), d("div", {
|
|
3578
|
+
class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: Ce.value }])
|
|
3570
3579
|
}, [
|
|
3571
3580
|
l("div", {
|
|
3572
3581
|
ref_key: "mapContainer",
|
|
@@ -3582,17 +3591,17 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3582
3591
|
"leave-from-class": "opacity-100",
|
|
3583
3592
|
"leave-to-class": "opacity-0"
|
|
3584
3593
|
}, {
|
|
3585
|
-
default:
|
|
3594
|
+
default: Ee(() => [
|
|
3586
3595
|
s.value && a.handleZoom ? (i(), d("div", cr, [
|
|
3587
3596
|
l("div", pr, [
|
|
3588
|
-
l("p", fr,
|
|
3597
|
+
l("p", fr, q(r.value), 1)
|
|
3589
3598
|
])
|
|
3590
3599
|
])) : D("", !0)
|
|
3591
3600
|
]),
|
|
3592
3601
|
_: 1
|
|
3593
3602
|
}),
|
|
3594
3603
|
l("div", mr, [
|
|
3595
|
-
A(ar, { onGoToCoordinates:
|
|
3604
|
+
A(ar, { onGoToCoordinates: tt }),
|
|
3596
3605
|
l("div", vr, [
|
|
3597
3606
|
l("div", hr, [
|
|
3598
3607
|
l("button", {
|
|
@@ -3603,7 +3612,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3603
3612
|
l("button", {
|
|
3604
3613
|
type: "button",
|
|
3605
3614
|
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:
|
|
3615
|
+
onClick: Le,
|
|
3607
3616
|
disabled: H.value === 0
|
|
3608
3617
|
}, "Export", 8, gr)
|
|
3609
3618
|
]),
|
|
@@ -3611,7 +3620,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3611
3620
|
ref_key: "importRef",
|
|
3612
3621
|
ref: S,
|
|
3613
3622
|
type: "file",
|
|
3614
|
-
onChange:
|
|
3623
|
+
onChange: Oe,
|
|
3615
3624
|
accept: ".json,.geojson",
|
|
3616
3625
|
class: "hidden"
|
|
3617
3626
|
}, null, 544)
|
|
@@ -3624,7 +3633,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3624
3633
|
"aria-pressed": N.value === "marker",
|
|
3625
3634
|
title: "Point (P)",
|
|
3626
3635
|
"aria-label": "Draw point",
|
|
3627
|
-
onClick:
|
|
3636
|
+
onClick: _[0] || (_[0] = (Y) => se("marker"))
|
|
3628
3637
|
}, [
|
|
3629
3638
|
A(zs)
|
|
3630
3639
|
], 10, xr),
|
|
@@ -3633,7 +3642,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3633
3642
|
"aria-pressed": N.value === "polyline",
|
|
3634
3643
|
title: "Line (L)",
|
|
3635
3644
|
"aria-label": "Draw polyline",
|
|
3636
|
-
onClick:
|
|
3645
|
+
onClick: _[1] || (_[1] = (Y) => se("polyline"))
|
|
3637
3646
|
}, [
|
|
3638
3647
|
A(Os)
|
|
3639
3648
|
], 10, wr),
|
|
@@ -3642,7 +3651,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3642
3651
|
"aria-pressed": N.value === "polygon",
|
|
3643
3652
|
title: "Polygon (G)",
|
|
3644
3653
|
"aria-label": "Draw polygon",
|
|
3645
|
-
onClick:
|
|
3654
|
+
onClick: _[2] || (_[2] = (Y) => se("polygon"))
|
|
3646
3655
|
}, [
|
|
3647
3656
|
A(Rs)
|
|
3648
3657
|
], 10, kr),
|
|
@@ -3651,14 +3660,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3651
3660
|
"aria-pressed": N.value === "rectangle",
|
|
3652
3661
|
title: "Rectangle (R)",
|
|
3653
3662
|
"aria-label": "Draw rectangle",
|
|
3654
|
-
onClick:
|
|
3663
|
+
onClick: _[3] || (_[3] = (Y) => se("rectangle"))
|
|
3655
3664
|
}, [
|
|
3656
3665
|
A(Ws)
|
|
3657
3666
|
], 10, _r),
|
|
3658
3667
|
l("button", {
|
|
3659
3668
|
class: "vs-btn mt-5",
|
|
3660
|
-
onClick:
|
|
3661
|
-
|
|
3669
|
+
onClick: _[4] || (_[4] = (Y) => {
|
|
3670
|
+
Ce.value = !Ce.value;
|
|
3662
3671
|
}),
|
|
3663
3672
|
title: "Full Screen",
|
|
3664
3673
|
"aria-label": "Full Screen"
|
|
@@ -3672,40 +3681,40 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3672
3681
|
}, [
|
|
3673
3682
|
A(dr, {
|
|
3674
3683
|
basemaps: ee(x),
|
|
3675
|
-
onOnLayerChange:
|
|
3684
|
+
onOnLayerChange: Ge
|
|
3676
3685
|
}, null, 8, ["basemaps"])
|
|
3677
3686
|
], 2),
|
|
3678
3687
|
l("div", $r, [
|
|
3679
3688
|
v.value ? (i(), d("div", Cr, [
|
|
3680
3689
|
l("div", Vr, [
|
|
3681
|
-
|
|
3682
|
-
l("span", Mr,
|
|
3690
|
+
_[7] || (_[7] = me(" Тип: ", -1)),
|
|
3691
|
+
l("span", Mr, q(v.value.type), 1)
|
|
3683
3692
|
]),
|
|
3684
3693
|
l("div", Lr, [
|
|
3685
3694
|
l("div", Sr, [
|
|
3686
|
-
|
|
3687
|
-
l("b", null,
|
|
3695
|
+
_[8] || (_[8] = me(" Центр: ", -1)),
|
|
3696
|
+
l("b", null, q(v.value.center.lat.toFixed(5)) + ", " + q(v.value.center.lng.toFixed(5)), 1)
|
|
3688
3697
|
]),
|
|
3689
3698
|
v.value.areaKm2 !== null ? (i(), d("div", Br, [
|
|
3690
|
-
|
|
3691
|
-
l("b", null,
|
|
3692
|
-
])) : (i(), d("div", jr,
|
|
3693
|
-
|
|
3699
|
+
_[9] || (_[9] = me(" Площа: ", -1)),
|
|
3700
|
+
l("b", null, q(v.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3701
|
+
])) : (i(), d("div", jr, _[10] || (_[10] = [
|
|
3702
|
+
me(" Площа: ", -1),
|
|
3694
3703
|
l("b", null, "—", -1)
|
|
3695
3704
|
]))),
|
|
3696
3705
|
l("button", {
|
|
3697
3706
|
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
3707
|
title: "Наблизити",
|
|
3699
|
-
onClick:
|
|
3700
|
-
},
|
|
3708
|
+
onClick: _[5] || (_[5] = (Y) => G())
|
|
3709
|
+
}, _[11] || (_[11] = [
|
|
3701
3710
|
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
3711
|
])),
|
|
3703
3712
|
l("button", {
|
|
3704
3713
|
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
3714
|
title: "Видалити",
|
|
3706
|
-
onClick:
|
|
3715
|
+
onClick: _[6] || (_[6] = (Y) => oe())
|
|
3707
3716
|
}, [
|
|
3708
|
-
A(
|
|
3717
|
+
A(et, { class: "w-3 h-3" })
|
|
3709
3718
|
])
|
|
3710
3719
|
])
|
|
3711
3720
|
])) : D("", !0)
|
|
@@ -3717,7 +3726,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3717
3726
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3718
3727
|
}, Dr = { class: "flex-1 min-w-[2px]" }, Ur = ["placeholder"], Pr = { class: "flex items-center shrink-0" }, Rr = ["disabled"], Hr = /* @__PURE__ */ U({
|
|
3719
3728
|
__name: "vs-input-tag",
|
|
3720
|
-
props: /* @__PURE__ */
|
|
3729
|
+
props: /* @__PURE__ */ ie({
|
|
3721
3730
|
unique: { type: Boolean, default: !0 },
|
|
3722
3731
|
style: { default: () => ({}) },
|
|
3723
3732
|
customClass: { default: "" },
|
|
@@ -3730,21 +3739,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3730
3739
|
modelValue: { default: [] },
|
|
3731
3740
|
modelModifiers: {}
|
|
3732
3741
|
}),
|
|
3733
|
-
emits: /* @__PURE__ */
|
|
3742
|
+
emits: /* @__PURE__ */ ie(["update:modelValue"], ["update:modelValue"]),
|
|
3734
3743
|
setup(o, { emit: e }) {
|
|
3735
3744
|
const t = o, a = e;
|
|
3736
|
-
|
|
3737
|
-
const n =
|
|
3738
|
-
S.value || await
|
|
3745
|
+
$e(t.style);
|
|
3746
|
+
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), W = async () => {
|
|
3747
|
+
S.value || await je(() => r.value?.focus());
|
|
3739
3748
|
}, R = (V) => {
|
|
3740
|
-
const
|
|
3741
|
-
|
|
3749
|
+
const $ = V.trim();
|
|
3750
|
+
$ !== "" && (!p.value || !Array.isArray(p.value) ? p.value = [$] : t.unique ? p.value.includes($) || (p.value = [...p.value, $]) : p.value = [...p.value, $], c.value = "");
|
|
3742
3751
|
}, K = () => {
|
|
3743
3752
|
const V = c.value;
|
|
3744
3753
|
V.trim() !== "" && R(V), c.value = "";
|
|
3745
3754
|
}, T = (V) => {
|
|
3746
|
-
const
|
|
3747
|
-
|
|
3755
|
+
const $ = p.value.slice();
|
|
3756
|
+
$.splice(V, 1), a("update:modelValue", $);
|
|
3748
3757
|
}, H = () => {
|
|
3749
3758
|
a("update:modelValue", []);
|
|
3750
3759
|
}, I = () => {
|
|
@@ -3752,14 +3761,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3752
3761
|
}, v = () => {
|
|
3753
3762
|
u.value = !1;
|
|
3754
3763
|
}, x = (V) => {
|
|
3755
|
-
const { key:
|
|
3756
|
-
|
|
3764
|
+
const { key: $ } = V;
|
|
3765
|
+
$ === "Enter" ? (V.preventDefault(), K()) : $ === "Backspace" && c.value === "" && p.value.length > 0 && T(p.value.length - 1);
|
|
3757
3766
|
};
|
|
3758
|
-
return (V,
|
|
3767
|
+
return (V, $) => (i(), d("div", {
|
|
3759
3768
|
class: "flex gap-1 w-full",
|
|
3760
3769
|
ref_key: "root",
|
|
3761
3770
|
ref: n,
|
|
3762
|
-
onClick:
|
|
3771
|
+
onClick: $[1] || ($[1] = ke(() => {
|
|
3763
3772
|
}, ["stop"]))
|
|
3764
3773
|
}, [
|
|
3765
3774
|
l("div", {
|
|
@@ -3775,26 +3784,26 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3775
3784
|
S.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3776
3785
|
]),
|
|
3777
3786
|
"data-focus": u.value ? "true" : "false",
|
|
3778
|
-
onClick:
|
|
3787
|
+
onClick: W
|
|
3779
3788
|
}, [
|
|
3780
3789
|
l("div", {
|
|
3781
3790
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3782
3791
|
ref_key: "chipsRef",
|
|
3783
3792
|
ref: s
|
|
3784
3793
|
}, [
|
|
3785
|
-
(i(!0), d(
|
|
3794
|
+
(i(!0), d(re, null, fe(p.value, (F, te) => (i(), d("div", {
|
|
3786
3795
|
key: te,
|
|
3787
3796
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3788
3797
|
}, [
|
|
3789
3798
|
l("div", Ar, [
|
|
3790
|
-
l("div", Tr,
|
|
3799
|
+
l("div", Tr, q(F), 1)
|
|
3791
3800
|
]),
|
|
3792
3801
|
l("div", {
|
|
3793
3802
|
role: "button",
|
|
3794
3803
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3795
|
-
onClick:
|
|
3804
|
+
onClick: ke((J) => T(te), ["stop"]),
|
|
3796
3805
|
"aria-label": `Remove ${F}`
|
|
3797
|
-
},
|
|
3806
|
+
}, $[2] || ($[2] = [
|
|
3798
3807
|
l("svg", {
|
|
3799
3808
|
height: "14",
|
|
3800
3809
|
width: "14",
|
|
@@ -3807,9 +3816,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3807
3816
|
], -1)
|
|
3808
3817
|
]), 8, Fr)
|
|
3809
3818
|
]))), 128)),
|
|
3810
|
-
m.value ? (i(), d("div", Or,
|
|
3819
|
+
m.value ? (i(), d("div", Or, q(f.value), 1)) : D("", !0),
|
|
3811
3820
|
l("div", Dr, [
|
|
3812
|
-
S.value ? D("", !0) :
|
|
3821
|
+
S.value ? D("", !0) : ae((i(), d("input", {
|
|
3813
3822
|
key: 0,
|
|
3814
3823
|
ref_key: "inputRef",
|
|
3815
3824
|
ref: r,
|
|
@@ -3821,13 +3830,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3821
3830
|
type: "text",
|
|
3822
3831
|
tabindex: "0",
|
|
3823
3832
|
"aria-label": "Add tag",
|
|
3824
|
-
"onUpdate:modelValue":
|
|
3833
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => c.value = F),
|
|
3825
3834
|
onFocus: I,
|
|
3826
3835
|
onBlur: v,
|
|
3827
3836
|
onKeydown: x,
|
|
3828
3837
|
placeholder: p.value && p.value.length ? "" : void 0
|
|
3829
3838
|
}, null, 40, Ur)), [
|
|
3830
|
-
[
|
|
3839
|
+
[he, c.value]
|
|
3831
3840
|
])
|
|
3832
3841
|
])
|
|
3833
3842
|
], 512),
|
|
@@ -3838,8 +3847,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3838
3847
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3839
3848
|
"aria-label": "Clear all tags",
|
|
3840
3849
|
disabled: S.value,
|
|
3841
|
-
onClick:
|
|
3842
|
-
},
|
|
3850
|
+
onClick: ke(H, ["stop"])
|
|
3851
|
+
}, $[3] || ($[3] = [
|
|
3843
3852
|
l("svg", {
|
|
3844
3853
|
height: "20",
|
|
3845
3854
|
width: "20",
|
|
@@ -3856,7 +3865,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3856
3865
|
}
|
|
3857
3866
|
}), Nr = { class: "relative flex gap-1 bg-white w-full" }, qr = ["disabled", "placeholder"], Wr = /* @__PURE__ */ U({
|
|
3858
3867
|
__name: "vs-input-slug",
|
|
3859
|
-
props: /* @__PURE__ */
|
|
3868
|
+
props: /* @__PURE__ */ ie({
|
|
3860
3869
|
disabled: { type: Boolean },
|
|
3861
3870
|
placeholder: {},
|
|
3862
3871
|
parent: {}
|
|
@@ -3866,7 +3875,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3866
3875
|
}),
|
|
3867
3876
|
emits: ["update:modelValue"],
|
|
3868
3877
|
setup(o) {
|
|
3869
|
-
const e =
|
|
3878
|
+
const e = Ae("values"), t = o, a = de(o, "modelValue");
|
|
3870
3879
|
function n(r) {
|
|
3871
3880
|
const u = {
|
|
3872
3881
|
а: "a",
|
|
@@ -3914,14 +3923,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3914
3923
|
a.value = u.toString();
|
|
3915
3924
|
};
|
|
3916
3925
|
return (r, u) => (i(), d("div", Nr, [
|
|
3917
|
-
|
|
3926
|
+
ae(l("input", {
|
|
3918
3927
|
ref: "vsText",
|
|
3919
3928
|
disabled: r.disabled,
|
|
3920
3929
|
placeholder: r.placeholder,
|
|
3921
3930
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => a.value = c),
|
|
3922
3931
|
class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
3923
3932
|
}, null, 8, qr), [
|
|
3924
|
-
[
|
|
3933
|
+
[he, a.value]
|
|
3925
3934
|
]),
|
|
3926
3935
|
l("button", {
|
|
3927
3936
|
class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
|
|
@@ -3945,7 +3954,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3945
3954
|
},
|
|
3946
3955
|
emits: ["update:modelValue"],
|
|
3947
3956
|
setup(o, { emit: e }) {
|
|
3948
|
-
const t = (K) => `${K}-${Math.random().toString(36).substring(2, 15)}`, a =
|
|
3957
|
+
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
3958
|
(() => {
|
|
3950
3959
|
const K = n.parent && a?.value?.[n.parent] || n.modelValue || {};
|
|
3951
3960
|
c.value = Object.entries(K).filter(([T]) => !u.includes(T)).map(([T, H]) => ({
|
|
@@ -3964,12 +3973,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3964
3973
|
}
|
|
3965
3974
|
const S = B(
|
|
3966
3975
|
() => c.value.some((K) => K.key && !K.value || !K.key && K.value)
|
|
3967
|
-
),
|
|
3976
|
+
), W = () => {
|
|
3968
3977
|
c.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
3969
3978
|
}, R = (K) => {
|
|
3970
3979
|
c.value = c.value.filter((T) => T.id !== K);
|
|
3971
3980
|
};
|
|
3972
|
-
return
|
|
3981
|
+
return ue(
|
|
3973
3982
|
c,
|
|
3974
3983
|
(K) => {
|
|
3975
3984
|
const T = {};
|
|
@@ -3987,25 +3996,25 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3987
3996
|
{ deep: !0 }
|
|
3988
3997
|
), (K, T) => (i(), d("div", Zr, [
|
|
3989
3998
|
l("div", Kr, [
|
|
3990
|
-
(i(!0), d(
|
|
3999
|
+
(i(!0), d(re, null, fe(c.value, (H, I) => (i(), d("div", {
|
|
3991
4000
|
key: H.id,
|
|
3992
4001
|
class: E(["flex items-center gap-2 w-full", { "opacity-50": p.value === I }]),
|
|
3993
4002
|
draggable: "true",
|
|
3994
4003
|
onDragstart: (v) => m(I),
|
|
3995
|
-
onDragover: T[0] || (T[0] =
|
|
4004
|
+
onDragover: T[0] || (T[0] = ke(() => {
|
|
3996
4005
|
}, ["prevent"])),
|
|
3997
4006
|
onDrop: (v) => y(I)
|
|
3998
4007
|
}, [
|
|
3999
4008
|
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
4009
|
l("div", Yr, [
|
|
4001
|
-
A(
|
|
4010
|
+
A(Ye, {
|
|
4002
4011
|
modelValue: H.key,
|
|
4003
4012
|
"onUpdate:modelValue": (v) => H.key = v,
|
|
4004
4013
|
placeholder: "Ключ"
|
|
4005
4014
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
4006
4015
|
]),
|
|
4007
4016
|
l("div", Xr, [
|
|
4008
|
-
A(
|
|
4017
|
+
A(Ye, {
|
|
4009
4018
|
modelValue: H.value,
|
|
4010
4019
|
"onUpdate:modelValue": (v) => H.value = v,
|
|
4011
4020
|
placeholder: "Значення"
|
|
@@ -4026,15 +4035,15 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4026
4035
|
l("div", ti, [
|
|
4027
4036
|
l("button", {
|
|
4028
4037
|
type: "button",
|
|
4029
|
-
onClick:
|
|
4038
|
+
onClick: W,
|
|
4030
4039
|
disabled: S.value,
|
|
4031
4040
|
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
4041
|
}, [
|
|
4033
|
-
A(
|
|
4042
|
+
A(qe, {
|
|
4034
4043
|
height: "14",
|
|
4035
4044
|
width: "14"
|
|
4036
4045
|
}),
|
|
4037
|
-
|
|
4046
|
+
me(" " + q(ee(r)), 1)
|
|
4038
4047
|
], 8, li)
|
|
4039
4048
|
])
|
|
4040
4049
|
]));
|
|
@@ -4052,12 +4061,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4052
4061
|
},
|
|
4053
4062
|
emits: ["update:modelValue"],
|
|
4054
4063
|
setup(o, { emit: e }) {
|
|
4055
|
-
const t = o, { inputClass: a } =
|
|
4064
|
+
const t = o, { inputClass: a } = $e(t.style), n = e, s = B({
|
|
4056
4065
|
get: () => t.modelValue || "#000000",
|
|
4057
4066
|
set: (r) => n("update:modelValue", r)
|
|
4058
4067
|
});
|
|
4059
4068
|
return (r, u) => (i(), d("div", ai, [
|
|
4060
|
-
|
|
4069
|
+
ae(l("input", {
|
|
4061
4070
|
type: "color",
|
|
4062
4071
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4063
4072
|
disabled: r.disabled,
|
|
@@ -4065,13 +4074,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4065
4074
|
class: E(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")]),
|
|
4066
4075
|
style: { border: "1px solid #CFD9E0" }
|
|
4067
4076
|
}, null, 10, si), [
|
|
4068
|
-
[
|
|
4077
|
+
[he, s.value]
|
|
4069
4078
|
]),
|
|
4070
|
-
|
|
4079
|
+
ae(l("input", {
|
|
4071
4080
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
|
|
4072
4081
|
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
4073
4082
|
}, null, 512), [
|
|
4074
|
-
[
|
|
4083
|
+
[he, s.value]
|
|
4075
4084
|
])
|
|
4076
4085
|
]));
|
|
4077
4086
|
}
|
|
@@ -4091,12 +4100,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4091
4100
|
},
|
|
4092
4101
|
emits: ["update:modelValue"],
|
|
4093
4102
|
setup(o, { emit: e }) {
|
|
4094
|
-
const t = o, { inputClass: a } =
|
|
4103
|
+
const t = o, { inputClass: a } = $e(t.style), n = e, s = B({
|
|
4095
4104
|
get: () => Number(t.modelValue ?? t.min),
|
|
4096
4105
|
set: (r) => n("update:modelValue", Number(r))
|
|
4097
4106
|
});
|
|
4098
4107
|
return (r, u) => (i(), d("div", ii, [
|
|
4099
|
-
|
|
4108
|
+
ae(l("input", {
|
|
4100
4109
|
type: "range",
|
|
4101
4110
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4102
4111
|
min: r.min,
|
|
@@ -4106,20 +4115,20 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4106
4115
|
ref: "range",
|
|
4107
4116
|
class: E(["w-full cursor-pointer accent-blue-500", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")])
|
|
4108
4117
|
}, null, 10, ui), [
|
|
4109
|
-
[
|
|
4118
|
+
[he, s.value]
|
|
4110
4119
|
]),
|
|
4111
|
-
|
|
4120
|
+
ae(l("input", {
|
|
4112
4121
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
|
|
4113
4122
|
type: "number",
|
|
4114
4123
|
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
4115
4124
|
}, null, 512), [
|
|
4116
|
-
[
|
|
4125
|
+
[he, s.value]
|
|
4117
4126
|
])
|
|
4118
4127
|
]));
|
|
4119
4128
|
}
|
|
4120
4129
|
}), ci = ["type", "value", "onInput", "placeholder", "disabled"], pi = /* @__PURE__ */ U({
|
|
4121
4130
|
__name: "vs-input-array",
|
|
4122
|
-
props: /* @__PURE__ */
|
|
4131
|
+
props: /* @__PURE__ */ ie({
|
|
4123
4132
|
count: { default: 1 },
|
|
4124
4133
|
limit: { default: (o) => o.count ?? 1 },
|
|
4125
4134
|
inputType: { default: "text" },
|
|
@@ -4136,7 +4145,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4136
4145
|
}),
|
|
4137
4146
|
emits: ["update:modelValue"],
|
|
4138
4147
|
setup(o) {
|
|
4139
|
-
const e = o, { inputClass: t } =
|
|
4148
|
+
const e = o, { inputClass: t } = $e(e.style), a = de(o, "modelValue");
|
|
4140
4149
|
Gt(() => {
|
|
4141
4150
|
const s = a.value?.length ?? 0;
|
|
4142
4151
|
s < e.count && (a.value = [
|
|
@@ -4151,7 +4160,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4151
4160
|
return (s, r) => (i(), d("div", {
|
|
4152
4161
|
class: E(["grid gap-2", `grid-cols-${s.limit}`])
|
|
4153
4162
|
}, [
|
|
4154
|
-
(i(!0), d(
|
|
4163
|
+
(i(!0), d(re, null, fe(s.count, (u) => (i(), d("input", {
|
|
4155
4164
|
type: s.inputType,
|
|
4156
4165
|
value: a.value?.[u - 1] ?? "",
|
|
4157
4166
|
onInput: (c) => n(c, u - 1),
|
|
@@ -4165,9 +4174,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4165
4174
|
], 2));
|
|
4166
4175
|
}
|
|
4167
4176
|
}), fi = {
|
|
4168
|
-
VsInputText:
|
|
4177
|
+
VsInputText: Ye,
|
|
4169
4178
|
VsInputRadio: gt,
|
|
4170
|
-
"vs-input-text":
|
|
4179
|
+
"vs-input-text": Ye,
|
|
4171
4180
|
"vs-input-password": yl,
|
|
4172
4181
|
"vs-input-textarea": ka,
|
|
4173
4182
|
"vs-input-mask": lo,
|
|
@@ -4202,13 +4211,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4202
4211
|
value: {}
|
|
4203
4212
|
},
|
|
4204
4213
|
setup(o) {
|
|
4205
|
-
const e = o, t =
|
|
4214
|
+
const e = o, t = Ae("values");
|
|
4206
4215
|
async function a() {
|
|
4207
4216
|
try {
|
|
4208
4217
|
if (!e.api) return;
|
|
4209
4218
|
const n = e.api.replace("{{value}}", e.value), s = await fetch(n);
|
|
4210
4219
|
if (!s.ok) {
|
|
4211
|
-
|
|
4220
|
+
ce({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
4212
4221
|
return;
|
|
4213
4222
|
}
|
|
4214
4223
|
const r = await s.json();
|
|
@@ -4222,14 +4231,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4222
4231
|
return (n, s) => (i(), d("button", {
|
|
4223
4232
|
onClick: a,
|
|
4224
4233
|
class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
|
|
4225
|
-
},
|
|
4234
|
+
}, q(n.button), 1));
|
|
4226
4235
|
}
|
|
4227
4236
|
}), vi = { class: "flex flex-col gap-1 w-full" }, hi = {
|
|
4228
4237
|
key: 0,
|
|
4229
4238
|
class: "text-sm text-gray-500"
|
|
4230
4239
|
}, zt = /* @__PURE__ */ U({
|
|
4231
4240
|
__name: "vs-compact-form-layout",
|
|
4232
|
-
props: /* @__PURE__ */
|
|
4241
|
+
props: /* @__PURE__ */ ie({
|
|
4233
4242
|
item: { default: {} },
|
|
4234
4243
|
layout: { default: "default" },
|
|
4235
4244
|
style: { default: {} },
|
|
@@ -4242,7 +4251,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4242
4251
|
}),
|
|
4243
4252
|
emits: ["update:modelValue"],
|
|
4244
4253
|
setup(o) {
|
|
4245
|
-
const e = o, t =
|
|
4254
|
+
const e = o, t = de(o, "modelValue"), a = B(() => gl[`${e.layout}`]), n = B(() => fi?.[`vs-input-${e.item.type}`]), s = B(() => {
|
|
4246
4255
|
const u = ee(n);
|
|
4247
4256
|
if (!u) return /* @__PURE__ */ new Set();
|
|
4248
4257
|
const c = u.props ?? u.__vccOpts?.props;
|
|
@@ -4253,30 +4262,30 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4253
4262
|
const u = e.item ?? {}, c = s.value;
|
|
4254
4263
|
return c.size ? Object.fromEntries(Object.entries(u).filter(([p]) => c.has(p))) : {};
|
|
4255
4264
|
});
|
|
4256
|
-
return (u, c) =>
|
|
4265
|
+
return (u, c) => ae((i(), ve(Fe(a.value), {
|
|
4257
4266
|
ua: e.item.ua,
|
|
4258
4267
|
error: e.error || "",
|
|
4259
4268
|
item: u.item,
|
|
4260
4269
|
columns: e.columns,
|
|
4261
4270
|
label: e.item.label
|
|
4262
4271
|
}, {
|
|
4263
|
-
default:
|
|
4272
|
+
default: Ee(() => [
|
|
4264
4273
|
l("div", {
|
|
4265
4274
|
class: E(["flex w-full", `${e.item.type}-component`])
|
|
4266
4275
|
}, [
|
|
4267
4276
|
l("div", vi, [
|
|
4268
|
-
(i(),
|
|
4277
|
+
(i(), ve(Fe(n.value), Te(r.value, {
|
|
4269
4278
|
modelValue: t.value,
|
|
4270
4279
|
"onUpdate:modelValue": c[0] || (c[0] = (p) => t.value = p)
|
|
4271
4280
|
}), null, 16, ["modelValue"])),
|
|
4272
|
-
u.item.description && e.layout !== "settings" ? (i(), d("p", hi,
|
|
4281
|
+
u.item.description && e.layout !== "settings" ? (i(), d("p", hi, q(u.item.description), 1)) : D("", !0)
|
|
4273
4282
|
]),
|
|
4274
|
-
u.item.behavior?.api && u.item.behavior?.button ? (i(),
|
|
4283
|
+
u.item.behavior?.api && u.item.behavior?.button ? (i(), ve(mi, Te({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : D("", !0)
|
|
4275
4284
|
], 2)
|
|
4276
4285
|
]),
|
|
4277
4286
|
_: 1
|
|
4278
4287
|
}, 8, ["ua", "error", "item", "columns", "label"])), [
|
|
4279
|
-
[
|
|
4288
|
+
[Qe, !u.item.hidden]
|
|
4280
4289
|
]);
|
|
4281
4290
|
}
|
|
4282
4291
|
}), 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 +4298,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4289
4298
|
width: { default: 400 }
|
|
4290
4299
|
},
|
|
4291
4300
|
setup(o, { expose: e }) {
|
|
4292
|
-
const t = o, a =
|
|
4301
|
+
const t = o, a = k([]), n = k(""), s = k(""), r = B(() => !!t.enabled), u = B(() => [
|
|
4293
4302
|
"vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
|
|
4294
4303
|
"sticky top-0 self-start shrink-0",
|
|
4295
4304
|
"max-h-full min-h-0 overflow-y-auto"
|
|
@@ -4299,41 +4308,41 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4299
4308
|
const Z = typeof M == "number" ? `${M}px` : `${M}`;
|
|
4300
4309
|
return { width: Z, minWidth: Z };
|
|
4301
4310
|
});
|
|
4302
|
-
let p = null, f = 0, m = 0, y = null, S = null,
|
|
4311
|
+
let p = null, f = 0, m = 0, y = null, S = null, W = null;
|
|
4303
4312
|
const R = () => te(), K = () => H();
|
|
4304
|
-
|
|
4313
|
+
ue(
|
|
4305
4314
|
() => t.target,
|
|
4306
4315
|
async (M) => {
|
|
4307
4316
|
if (V(), !M) {
|
|
4308
4317
|
y = null, a.value = [], n.value = "";
|
|
4309
4318
|
return;
|
|
4310
4319
|
}
|
|
4311
|
-
y = M, r.value && (await
|
|
4320
|
+
y = M, r.value && (await je(), x(M), H());
|
|
4312
4321
|
},
|
|
4313
4322
|
{ immediate: !0 }
|
|
4314
|
-
),
|
|
4323
|
+
), ue(
|
|
4315
4324
|
() => t.scrollContainer,
|
|
4316
4325
|
(M) => {
|
|
4317
4326
|
if (!r.value) {
|
|
4318
4327
|
S = M ?? null;
|
|
4319
4328
|
return;
|
|
4320
4329
|
}
|
|
4321
|
-
T(M ?? null),
|
|
4330
|
+
T(M ?? null), je(() => H());
|
|
4322
4331
|
},
|
|
4323
4332
|
{ immediate: !0 }
|
|
4324
|
-
),
|
|
4333
|
+
), _e(() => {
|
|
4325
4334
|
t.scrollContainer || T(null), H();
|
|
4326
4335
|
}), at(() => {
|
|
4327
4336
|
V(), T(null, !0), y = null, typeof window < "u" && (f && window.cancelAnimationFrame(f), m && window.cancelAnimationFrame(m));
|
|
4328
4337
|
});
|
|
4329
4338
|
function T(M, Z = !1) {
|
|
4330
|
-
if (
|
|
4339
|
+
if (W && (W(), W = null), Z) {
|
|
4331
4340
|
S = null;
|
|
4332
4341
|
return;
|
|
4333
4342
|
}
|
|
4334
4343
|
if (S = M ?? null, typeof window > "u") return;
|
|
4335
4344
|
const N = M ?? window, le = window;
|
|
4336
|
-
N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize", K),
|
|
4345
|
+
N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize", K), W = () => {
|
|
4337
4346
|
N.removeEventListener("scroll", R), le.removeEventListener("resize", K);
|
|
4338
4347
|
};
|
|
4339
4348
|
}
|
|
@@ -4351,13 +4360,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4351
4360
|
M.forEach((le, z) => {
|
|
4352
4361
|
const j = le.textContent?.trim() ?? "";
|
|
4353
4362
|
if (!j) return;
|
|
4354
|
-
let
|
|
4355
|
-
|
|
4356
|
-
let
|
|
4357
|
-
for (; Z.has(
|
|
4358
|
-
|
|
4359
|
-
le.id !==
|
|
4360
|
-
id:
|
|
4363
|
+
let C = (le.getAttribute("id") ?? "").trim();
|
|
4364
|
+
C || (C = v(j) || `heading-${z + 1}`);
|
|
4365
|
+
let G = C, oe = 1;
|
|
4366
|
+
for (; Z.has(G); )
|
|
4367
|
+
G = `${C}-${oe += 1}`;
|
|
4368
|
+
le.id !== G && Object.assign(le, { id: G }), Z.add(G), N.push({
|
|
4369
|
+
id: G,
|
|
4361
4370
|
text: j,
|
|
4362
4371
|
level: le.tagName.toLowerCase() === "h1" ? 1 : 2
|
|
4363
4372
|
});
|
|
@@ -4372,7 +4381,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4372
4381
|
function V() {
|
|
4373
4382
|
p && (p.disconnect(), p = null);
|
|
4374
4383
|
}
|
|
4375
|
-
function
|
|
4384
|
+
function $(M) {
|
|
4376
4385
|
const Z = S;
|
|
4377
4386
|
if (!Z)
|
|
4378
4387
|
return typeof window > "u" ? M.offsetTop : M.getBoundingClientRect().top + window.scrollY;
|
|
@@ -4383,11 +4392,11 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4383
4392
|
if (!r.value || !a.value.length) return;
|
|
4384
4393
|
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
4394
|
let z = null;
|
|
4386
|
-
for (let
|
|
4387
|
-
const
|
|
4395
|
+
for (let C = 0; C < a.value.length; C += 1) {
|
|
4396
|
+
const G = a.value[C], oe = document.getElementById(G.id);
|
|
4388
4397
|
if (oe) {
|
|
4389
|
-
const
|
|
4390
|
-
|
|
4398
|
+
const se = $(oe);
|
|
4399
|
+
se + oe.offsetHeight > Z && se < le && (z = G.id);
|
|
4391
4400
|
}
|
|
4392
4401
|
}
|
|
4393
4402
|
!z && s.value && (z = s.value), z && (s.value = z);
|
|
@@ -4403,7 +4412,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4403
4412
|
if (!r.value) return;
|
|
4404
4413
|
const Z = document.getElementById(M);
|
|
4405
4414
|
if (!Z) return;
|
|
4406
|
-
const N = S, le = Math.max(0,
|
|
4415
|
+
const N = S, le = Math.max(0, $(Z));
|
|
4407
4416
|
N ? N.scrollTo({ top: le, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: le, behavior: "smooth" });
|
|
4408
4417
|
}
|
|
4409
4418
|
return e({ refresh: H }), (M, Z) => r.value && a.value.length ? (i(), d("div", {
|
|
@@ -4411,9 +4420,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4411
4420
|
class: E(u.value),
|
|
4412
4421
|
style: be(c.value)
|
|
4413
4422
|
}, [
|
|
4414
|
-
l("h2", gi,
|
|
4423
|
+
l("h2", gi, q(M.title), 1),
|
|
4415
4424
|
l("div", bi, [
|
|
4416
|
-
(i(!0), d(
|
|
4425
|
+
(i(!0), d(re, null, fe(a.value, (N) => (i(), d("div", {
|
|
4417
4426
|
key: N.id,
|
|
4418
4427
|
class: E([
|
|
4419
4428
|
"vs-compact-form-navigation__item relative",
|
|
@@ -4430,7 +4439,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4430
4439
|
N.id === n.value ? "text-gray-800" : "text-gray-500"
|
|
4431
4440
|
])
|
|
4432
4441
|
}, [
|
|
4433
|
-
l("span", null,
|
|
4442
|
+
l("span", null, q(N.text), 1)
|
|
4434
4443
|
], 10, yi)
|
|
4435
4444
|
], 2))), 128))
|
|
4436
4445
|
])
|
|
@@ -4500,7 +4509,7 @@ function Si(o, e, t = !1) {
|
|
|
4500
4509
|
const a = B(() => Li(
|
|
4501
4510
|
(Array.isArray(e), e),
|
|
4502
4511
|
typeof t == "boolean" ? t : t.value
|
|
4503
|
-
)), n =
|
|
4512
|
+
)), n = k({});
|
|
4504
4513
|
function s(p) {
|
|
4505
4514
|
const f = p?.conditions;
|
|
4506
4515
|
if (!f) return !0;
|
|
@@ -4514,8 +4523,8 @@ function Si(o, e, t = !1) {
|
|
|
4514
4523
|
return;
|
|
4515
4524
|
}
|
|
4516
4525
|
let y = !1, S = null;
|
|
4517
|
-
m.rules.forEach((
|
|
4518
|
-
const R = Vi(o.value[m.name],
|
|
4526
|
+
m.rules.forEach((W) => {
|
|
4527
|
+
const R = Vi(o.value[m.name], W);
|
|
4519
4528
|
R && (y = !0, !S && typeof R == "string" && (S = R));
|
|
4520
4529
|
}), y && S ? n.value[m.name] = S : delete n.value[m.name];
|
|
4521
4530
|
}
|
|
@@ -4535,9 +4544,9 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4535
4544
|
"data-orientation": "horizontal",
|
|
4536
4545
|
role: "none",
|
|
4537
4546
|
class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
|
|
4538
|
-
},
|
|
4547
|
+
}, We = /* @__PURE__ */ U({
|
|
4539
4548
|
__name: "vs-compact-form",
|
|
4540
|
-
props: /* @__PURE__ */
|
|
4549
|
+
props: /* @__PURE__ */ ie({
|
|
4541
4550
|
schema: { default: () => [] },
|
|
4542
4551
|
style: { default: () => ({}) },
|
|
4543
4552
|
modelValue: {},
|
|
@@ -4553,21 +4562,21 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4553
4562
|
values: { default: () => ({}) },
|
|
4554
4563
|
valuesModifiers: {}
|
|
4555
4564
|
}),
|
|
4556
|
-
emits: /* @__PURE__ */
|
|
4565
|
+
emits: /* @__PURE__ */ ie(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
4557
4566
|
setup(o, { expose: e, emit: t }) {
|
|
4558
|
-
const a = t, n = o, s =
|
|
4567
|
+
const a = t, n = o, s = de(o, "form"), r = de(o, "values"), {
|
|
4559
4568
|
errors: u,
|
|
4560
4569
|
validate: c,
|
|
4561
4570
|
reset: p,
|
|
4562
4571
|
visibleSchema: f
|
|
4563
|
-
} = Si(r, n.schema, Zt(n, "disabled")), m =
|
|
4572
|
+
} = Si(r, n.schema, Zt(n, "disabled")), m = k(null), y = k(null), S = B(() => n.navigation), W = 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
4573
|
a("update:modelValue", r.value), c(), a("handle-submit", r.value);
|
|
4565
4574
|
};
|
|
4566
4575
|
e({
|
|
4567
4576
|
validate: c,
|
|
4568
4577
|
reset: p,
|
|
4569
4578
|
errors: u
|
|
4570
|
-
}),
|
|
4579
|
+
}), _e(() => {
|
|
4571
4580
|
n.modelValue && (r.value = n.modelValue), s.value = {
|
|
4572
4581
|
value: r.value,
|
|
4573
4582
|
errors: u.value,
|
|
@@ -4576,7 +4585,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4576
4585
|
formId: n.formId
|
|
4577
4586
|
};
|
|
4578
4587
|
});
|
|
4579
|
-
function
|
|
4588
|
+
function $(F, te) {
|
|
4580
4589
|
if (F === te) return !0;
|
|
4581
4590
|
if (typeof F != "object" || typeof te != "object" || !F || !te) return !1;
|
|
4582
4591
|
const J = Object.keys(F), M = Object.keys(te);
|
|
@@ -4591,10 +4600,10 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4591
4600
|
l("form", {
|
|
4592
4601
|
ref_key: "formRef",
|
|
4593
4602
|
ref: m,
|
|
4594
|
-
onSubmit:
|
|
4603
|
+
onSubmit: ke(V, ["prevent"]),
|
|
4595
4604
|
class: E(["grid grid-cols-12 p-1", I.value === "default" ? "gap-6" : "gap-4"])
|
|
4596
4605
|
}, [
|
|
4597
|
-
(i(!0), d(
|
|
4606
|
+
(i(!0), d(re, null, fe(ee(f), (J, M) => (i(), d("div", {
|
|
4598
4607
|
key: J.name,
|
|
4599
4608
|
class: E(v(J) === "horizontal" ? "col-span-12" : `col-span-${J.col || 12}`)
|
|
4600
4609
|
}, [
|
|
@@ -4606,7 +4615,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4606
4615
|
"model-value": r.value[J.name],
|
|
4607
4616
|
"onUpdate:modelValue": (Z) => {
|
|
4608
4617
|
const N = r.value[J.name];
|
|
4609
|
-
|
|
4618
|
+
$(N, Z) || (r.value[J.name] = Z);
|
|
4610
4619
|
},
|
|
4611
4620
|
error: ee(u)[J.name]
|
|
4612
4621
|
}, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
|
|
@@ -4618,7 +4627,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4618
4627
|
target: m.value,
|
|
4619
4628
|
"scroll-container": y.value,
|
|
4620
4629
|
enabled: S.value,
|
|
4621
|
-
width:
|
|
4630
|
+
width: W.value
|
|
4622
4631
|
}, null, 8, ["target", "scroll-container", "enabled", "width"])
|
|
4623
4632
|
]));
|
|
4624
4633
|
}
|
|
@@ -4633,11 +4642,11 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4633
4642
|
},
|
|
4634
4643
|
emits: ["close", "save", "edit"],
|
|
4635
4644
|
setup(o, { emit: e }) {
|
|
4636
|
-
const t = o, a = e, n =
|
|
4645
|
+
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
4646
|
async function p() {
|
|
4638
4647
|
const m = r.value.validate();
|
|
4639
4648
|
if (m) {
|
|
4640
|
-
|
|
4649
|
+
ce({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([y, S]) => `${y}: ${S}`).join(`
|
|
4641
4650
|
`) });
|
|
4642
4651
|
return;
|
|
4643
4652
|
}
|
|
@@ -4651,29 +4660,29 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4651
4660
|
body: JSON.stringify(s.value)
|
|
4652
4661
|
});
|
|
4653
4662
|
if (y.ok)
|
|
4654
|
-
await y.json(),
|
|
4663
|
+
await y.json(), ce({
|
|
4655
4664
|
type: "success",
|
|
4656
4665
|
title: "Успішно",
|
|
4657
4666
|
message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
|
|
4658
4667
|
}), a("save", s.value);
|
|
4659
4668
|
else if (y.status === 400) {
|
|
4660
4669
|
const S = await y.json().catch(() => ({}));
|
|
4661
|
-
|
|
4670
|
+
ce({
|
|
4662
4671
|
type: "warning",
|
|
4663
4672
|
title: "Помилка валідації",
|
|
4664
4673
|
message: S.message || "Некоректні дані (400)"
|
|
4665
4674
|
});
|
|
4666
|
-
} else y.status === 500 ?
|
|
4675
|
+
} else y.status === 500 ? ce({
|
|
4667
4676
|
type: "error",
|
|
4668
4677
|
title: "Серверна помилка",
|
|
4669
4678
|
message: "Виникла помилка на сервері (500)"
|
|
4670
|
-
}) :
|
|
4679
|
+
}) : ce({
|
|
4671
4680
|
type: "error",
|
|
4672
4681
|
title: "Помилка",
|
|
4673
4682
|
message: `Статус: ${y.status}`
|
|
4674
4683
|
});
|
|
4675
4684
|
} catch (y) {
|
|
4676
|
-
|
|
4685
|
+
ce({
|
|
4677
4686
|
type: "error",
|
|
4678
4687
|
title: "Помилка з’єднання",
|
|
4679
4688
|
message: y.message || "Не вдалося виконати запит"
|
|
@@ -4683,12 +4692,12 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4683
4692
|
function f() {
|
|
4684
4693
|
a("close");
|
|
4685
4694
|
}
|
|
4686
|
-
return
|
|
4695
|
+
return _e(async () => {
|
|
4687
4696
|
try {
|
|
4688
4697
|
if (t.form) {
|
|
4689
4698
|
const m = await fetch(`/api/template/form/${t.form}`);
|
|
4690
4699
|
if (!m.ok) {
|
|
4691
|
-
|
|
4700
|
+
ce({
|
|
4692
4701
|
type: m.status >= 400 && m.status < 500 ? "warning" : "error",
|
|
4693
4702
|
title: "Error",
|
|
4694
4703
|
message: `Error code: ${m.status}`
|
|
@@ -4701,7 +4710,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4701
4710
|
u.value = t.token;
|
|
4702
4711
|
const m = await fetch(`/api/form/${u.value}`);
|
|
4703
4712
|
if (!m.ok) {
|
|
4704
|
-
|
|
4713
|
+
ce({
|
|
4705
4714
|
type: m.status >= 400 && m.status < 500 ? "warning" : "error",
|
|
4706
4715
|
title: "Error",
|
|
4707
4716
|
message: `Error code: ${m.status}`
|
|
@@ -4712,7 +4721,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4712
4721
|
n.value = y.schema, y.data ? s.value = y.data : c.value = "add";
|
|
4713
4722
|
}
|
|
4714
4723
|
} catch (m) {
|
|
4715
|
-
|
|
4724
|
+
ce({
|
|
4716
4725
|
type: "error",
|
|
4717
4726
|
title: "Error",
|
|
4718
4727
|
message: m.message || "Unexpected error"
|
|
@@ -4722,7 +4731,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4722
4731
|
l("div", Ii, [
|
|
4723
4732
|
l("div", zi, [
|
|
4724
4733
|
l("div", Ai, [
|
|
4725
|
-
l("h3", Ti,
|
|
4734
|
+
l("h3", Ti, q(c.value === "add" ? "Додати" : "Змінити"), 1),
|
|
4726
4735
|
l("button", {
|
|
4727
4736
|
onClick: f,
|
|
4728
4737
|
type: "button",
|
|
@@ -4747,7 +4756,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4747
4756
|
]))
|
|
4748
4757
|
]),
|
|
4749
4758
|
l("div", Fi, [
|
|
4750
|
-
n.value ? (i(),
|
|
4759
|
+
n.value ? (i(), ve(We, {
|
|
4751
4760
|
key: 0,
|
|
4752
4761
|
schema: n.value,
|
|
4753
4762
|
values: s.value,
|
|
@@ -4791,14 +4800,14 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4791
4800
|
}
|
|
4792
4801
|
});
|
|
4793
4802
|
});
|
|
4794
|
-
|
|
4795
|
-
e.component("VForm",
|
|
4803
|
+
We.install = function(e) {
|
|
4804
|
+
e.component("VForm", We), Object.assign(e.config.globalProperties, {
|
|
4796
4805
|
$form: $t
|
|
4797
4806
|
}), e.provide("form", $t), window.v3plugin || (window.v3plugin = {});
|
|
4798
4807
|
};
|
|
4799
4808
|
export {
|
|
4800
4809
|
Oi as ModalEdit,
|
|
4801
|
-
|
|
4810
|
+
We as VForm,
|
|
4802
4811
|
pi as VsInputArray,
|
|
4803
4812
|
vo as VsInputCheckbox,
|
|
4804
4813
|
ri as VsInputColor,
|
|
@@ -4817,9 +4826,9 @@ export {
|
|
|
4817
4826
|
ht as VsInputStatic,
|
|
4818
4827
|
Bt as VsInputSwitcher,
|
|
4819
4828
|
Hr as VsInputTag,
|
|
4820
|
-
|
|
4829
|
+
Ye as VsInputText,
|
|
4821
4830
|
ka as VsInputTextarea,
|
|
4822
|
-
|
|
4831
|
+
We as default,
|
|
4823
4832
|
fi as inputs,
|
|
4824
4833
|
Ls as vsInputDatatable,
|
|
4825
4834
|
Ir as vsInputMap
|