@opengis/form 0.0.16 → 0.0.17
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/form/src/components/form/vs-compact-form.vue.d.ts +8 -1
- package/dist/form/src/components/form/vs-compact-form.vue.d.ts.map +1 -1
- package/dist/form/src/types/form.d.ts +2 -1
- package/dist/form/src/types/form.d.ts.map +1 -1
- package/dist/form/src/utils/convertForm.d.ts.map +1 -1
- package/dist/index.js +357 -351
- package/dist/index.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as I, createElementBlock as u, openBlock as i, createCommentVNode as
|
|
1
|
+
import { defineComponent as I, createElementBlock as u, openBlock as i, createCommentVNode as S, renderSlot as ve, createElementVNode as t, toDisplayString as E, normalizeProps as Ee, guardReactiveProps as Fe, createTextVNode as oe, computed as D, mergeModels as q, useModel as G, withDirectives as K, normalizeClass as B, unref as H, vModelText as ne, vModelCheckbox as Qe, createVNode as j, ref as $, createBlock as X, resolveDynamicComponent as xe, normalizeStyle as fe, withCtx as Me, withModifiers as ae, onMounted as ue, onBeforeUnmount as ut, watch as se, createStaticVNode as re, vModelRadio as Xe, Fragment as Q, renderList as Y, mergeProps as Ce, reactive as dt, vShow as De, inject as Se, resolveComponent as Pe, Transition as Ye, createApp as ct, h as pt, onUnmounted as et, nextTick as $e, Teleport as ft, provide as Ne } from "vue";
|
|
2
2
|
import { notify as pe } from "@opengis/core";
|
|
3
3
|
const vt = { class: "w-full relative" }, mt = {
|
|
4
4
|
key: 0,
|
|
@@ -21,10 +21,10 @@ const vt = { class: "w-full relative" }, mt = {
|
|
|
21
21
|
return (e, l) => (i(), u("div", vt, [
|
|
22
22
|
e.ua || e.label ? (i(), u("div", mt, [
|
|
23
23
|
t("span", null, E(e.ua || e.label), 1),
|
|
24
|
-
e.item?.rules?.includes("required") ? (i(), u("span", ht, "*")) :
|
|
25
|
-
])) :
|
|
24
|
+
e.item?.rules?.includes("required") ? (i(), u("span", ht, "*")) : S("", !0)
|
|
25
|
+
])) : S("", !0),
|
|
26
26
|
ve(e.$slots, "default", Ee(Fe(e.$attrs))),
|
|
27
|
-
e.error ? (i(), u("span", gt, E(e.error), 1)) :
|
|
27
|
+
e.error ? (i(), u("span", gt, E(e.error), 1)) : S("", !0)
|
|
28
28
|
]));
|
|
29
29
|
}
|
|
30
30
|
}), yt = { class: "w-full relative flex flex-row items-center gap-2" }, xt = {
|
|
@@ -48,10 +48,10 @@ const vt = { class: "w-full relative" }, mt = {
|
|
|
48
48
|
return (e, l) => (i(), u("div", yt, [
|
|
49
49
|
e.item?.type !== "html" ? (i(), u("span", xt, [
|
|
50
50
|
oe(E(e.ua || e.label) + " ", 1),
|
|
51
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", wt, "*")) :
|
|
52
|
-
])) :
|
|
51
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", wt, "*")) : S("", !0)
|
|
52
|
+
])) : S("", !0),
|
|
53
53
|
ve(e.$slots, "default", Ee(Fe(e.$attrs))),
|
|
54
|
-
e.error ? (i(), u("span", kt, E(e.error), 1)) :
|
|
54
|
+
e.error ? (i(), u("span", kt, E(e.error), 1)) : S("", !0)
|
|
55
55
|
]));
|
|
56
56
|
}
|
|
57
57
|
}), $t = { class: "w-full relative" }, Ct = {
|
|
@@ -68,7 +68,7 @@ const vt = { class: "w-full relative" }, mt = {
|
|
|
68
68
|
setup(o) {
|
|
69
69
|
return (e, l) => (i(), u("div", $t, [
|
|
70
70
|
ve(e.$slots, "default", Ee(Fe(e.$attrs))),
|
|
71
|
-
e.error ? (i(), u("span", Ct, E(e.error), 1)) :
|
|
71
|
+
e.error ? (i(), u("span", Ct, E(e.error), 1)) : S("", !0)
|
|
72
72
|
]));
|
|
73
73
|
}
|
|
74
74
|
}), Mt = {
|
|
@@ -78,7 +78,7 @@ const vt = { class: "w-full relative" }, mt = {
|
|
|
78
78
|
};
|
|
79
79
|
function me(o) {
|
|
80
80
|
return {
|
|
81
|
-
inputClass:
|
|
81
|
+
inputClass: D(() => {
|
|
82
82
|
const l = `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 `;
|
|
83
83
|
return o?.size === "sm" ? `${l}h-[32px]` : `${l}h-[38px]`;
|
|
84
84
|
})
|
|
@@ -144,7 +144,7 @@ const Lt = ["placeholder", "disabled"], He = /* @__PURE__ */ I({
|
|
|
144
144
|
[ne, n.value]
|
|
145
145
|
]);
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), T = (o, e) => {
|
|
148
148
|
const l = o.__vccOpts || o;
|
|
149
149
|
for (const [n, a] of e)
|
|
150
150
|
l[n] = a;
|
|
@@ -169,7 +169,7 @@ function It(o, e) {
|
|
|
169
169
|
t("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
170
170
|
]));
|
|
171
171
|
}
|
|
172
|
-
const zt = /* @__PURE__ */
|
|
172
|
+
const zt = /* @__PURE__ */ T(jt, [["render", It]]), Ot = { class: "flex items-center gap-[4px]" }, Et = ["value", "id", "disabled"], Ft = ["for"], Dt = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Ut = /* @__PURE__ */ I({
|
|
173
173
|
__name: "vs-checkbox-default",
|
|
174
174
|
props: {
|
|
175
175
|
value: { default: "" },
|
|
@@ -182,7 +182,7 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
182
182
|
},
|
|
183
183
|
emits: ["update:modelValue"],
|
|
184
184
|
setup(o, { emit: e }) {
|
|
185
|
-
const l = e, n = o, a =
|
|
185
|
+
const l = e, n = o, a = D({
|
|
186
186
|
get: () => n.modelValue,
|
|
187
187
|
set: (r) => l("update:modelValue", r)
|
|
188
188
|
});
|
|
@@ -204,7 +204,7 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
204
204
|
t("div", {
|
|
205
205
|
class: B(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [a.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", r.error ? "border-red-600" : ""]])
|
|
206
206
|
}, [
|
|
207
|
-
|
|
207
|
+
j(zt, {
|
|
208
208
|
height: "12",
|
|
209
209
|
width: "12"
|
|
210
210
|
})
|
|
@@ -234,12 +234,12 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
234
234
|
},
|
|
235
235
|
emits: ["update:modelValue"],
|
|
236
236
|
setup(o, { emit: e }) {
|
|
237
|
-
const l = o, n = e, a =
|
|
237
|
+
const l = o, n = e, a = D({
|
|
238
238
|
get: () => l.modelValue,
|
|
239
239
|
set: (d) => {
|
|
240
240
|
n("update:modelValue", d);
|
|
241
241
|
}
|
|
242
|
-
}), r =
|
|
242
|
+
}), r = D(() => Array.isArray(a.value) ? a.value.includes(l.value) : a.value === !0 || a.value === l.value), s = D(() => l.style?.size === "xs" ? "p-1.5 text-xs" : l.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
243
243
|
return (d, p) => (i(), u("label", {
|
|
244
244
|
class: B(["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", [s.value, r.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
245
245
|
}, [
|
|
@@ -248,7 +248,7 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
248
248
|
class: "hidden",
|
|
249
249
|
name: d.id,
|
|
250
250
|
value: d.value,
|
|
251
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
251
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => a.value = f),
|
|
252
252
|
disabled: d.disabled
|
|
253
253
|
}, null, 8, Rt), [
|
|
254
254
|
[Qe, a.value]
|
|
@@ -258,15 +258,15 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
258
258
|
d.icon ? (i(), u("i", {
|
|
259
259
|
key: 0,
|
|
260
260
|
class: B(d.icon)
|
|
261
|
-
}, null, 2)) :
|
|
261
|
+
}, null, 2)) : S("", !0),
|
|
262
262
|
d.imgUrl ? (i(), u("img", {
|
|
263
263
|
key: 1,
|
|
264
264
|
src: d.imgUrl,
|
|
265
265
|
width: "16",
|
|
266
266
|
height: "16",
|
|
267
267
|
alt: "icon"
|
|
268
|
-
}, null, 8, Nt)) :
|
|
269
|
-
])) :
|
|
268
|
+
}, null, 8, Nt)) : S("", !0)
|
|
269
|
+
])) : S("", !0),
|
|
270
270
|
ve(d.$slots, "default", {}, () => [
|
|
271
271
|
oe(E(d.label), 1)
|
|
272
272
|
])
|
|
@@ -290,12 +290,12 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
290
290
|
},
|
|
291
291
|
emits: ["update:modelValue"],
|
|
292
292
|
setup(o, { emit: e }) {
|
|
293
|
-
const l = o, n = e, a = `radio-${Math.floor(Math.random() * 1e4)}`, r =
|
|
293
|
+
const l = o, n = e, a = `radio-${Math.floor(Math.random() * 1e4)}`, r = D({
|
|
294
294
|
get: () => Array.isArray(l.modelValue) ? Array.isArray(l.modelValue) && l.modelValue.includes(l.value) : l.modelValue,
|
|
295
295
|
set: (d) => {
|
|
296
296
|
if (Array.isArray(l.modelValue)) {
|
|
297
297
|
let p = [...l.modelValue];
|
|
298
|
-
d ? p.includes(l.value) || p.push(l.value) : p = p.filter((
|
|
298
|
+
d ? p.includes(l.value) || p.push(l.value) : p = p.filter((f) => f !== l.value), n("update:modelValue", p);
|
|
299
299
|
} else
|
|
300
300
|
n("update:modelValue", d);
|
|
301
301
|
}
|
|
@@ -307,7 +307,7 @@ const zt = /* @__PURE__ */ R(jt, [["render", It]]), Ot = { class: "flex items-ce
|
|
|
307
307
|
info: d.option?.info,
|
|
308
308
|
disabled: d.disabled,
|
|
309
309
|
modelValue: r.value,
|
|
310
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
310
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => r.value = f),
|
|
311
311
|
id: a,
|
|
312
312
|
icon: d.icon,
|
|
313
313
|
imgUrl: d.imgUrl,
|
|
@@ -341,7 +341,7 @@ function Kt(o, e) {
|
|
|
341
341
|
t("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
342
342
|
]));
|
|
343
343
|
}
|
|
344
|
-
const Zt = /* @__PURE__ */
|
|
344
|
+
const Zt = /* @__PURE__ */ T(Gt, [["render", Kt]]), Wt = {}, Qt = {
|
|
345
345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
346
346
|
width: "24",
|
|
347
347
|
height: "24",
|
|
@@ -364,7 +364,7 @@ function Xt(o, e) {
|
|
|
364
364
|
t("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
365
365
|
]));
|
|
366
366
|
}
|
|
367
|
-
const Yt = /* @__PURE__ */
|
|
367
|
+
const Yt = /* @__PURE__ */ T(Wt, [["render", Xt]]), el = {
|
|
368
368
|
key: 0,
|
|
369
369
|
class: "flex items-start gap-x-1"
|
|
370
370
|
}, tl = {
|
|
@@ -393,13 +393,13 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
393
393
|
setup(o) {
|
|
394
394
|
const e = o, l = G(o, "modelValue");
|
|
395
395
|
return (n, a) => e.view === "checkbox" ? (i(), u("div", el, [
|
|
396
|
-
|
|
396
|
+
j(tt, {
|
|
397
397
|
modelValue: l.value,
|
|
398
398
|
"onUpdate:modelValue": a[0] || (a[0] = (r) => l.value = r),
|
|
399
399
|
label: n.text,
|
|
400
400
|
error: n.error || ""
|
|
401
401
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
402
|
-
n.rules?.includes("required") ? (i(), u("span", tl, "*")) :
|
|
402
|
+
n.rules?.includes("required") ? (i(), u("span", tl, "*")) : S("", !0),
|
|
403
403
|
n.i ? (i(), u("button", {
|
|
404
404
|
key: 1,
|
|
405
405
|
class: "cursor-pointer",
|
|
@@ -407,8 +407,8 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
407
407
|
onClick: a[1] || (a[1] = ae(() => {
|
|
408
408
|
}, ["prevent"]))
|
|
409
409
|
}, [
|
|
410
|
-
|
|
411
|
-
], 8, ll)) :
|
|
410
|
+
j(H(Yt), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
411
|
+
], 8, ll)) : S("", !0)
|
|
412
412
|
])) : (i(), u("button", {
|
|
413
413
|
key: 1,
|
|
414
414
|
type: "button",
|
|
@@ -578,7 +578,7 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
578
578
|
e.value == l.value ? (i(), u("span", {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: B(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${l.style?.primaryColor || "blue"}-500`]])
|
|
581
|
-
}, null, 2)) :
|
|
581
|
+
}, null, 2)) : S("", !0)
|
|
582
582
|
], 2),
|
|
583
583
|
t("span", cl, E(l.text), 1)
|
|
584
584
|
], 2));
|
|
@@ -642,7 +642,7 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
642
642
|
}),
|
|
643
643
|
emits: ["update:modelValue"],
|
|
644
644
|
setup(o) {
|
|
645
|
-
const e = o, l = G(o, "modelValue"), n =
|
|
645
|
+
const e = o, l = G(o, "modelValue"), n = D(() => hl[`vs-input-radio-${e.view}`]);
|
|
646
646
|
return (a, r) => (i(), u("div", {
|
|
647
647
|
class: B([a.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
648
648
|
}, [
|
|
@@ -675,7 +675,7 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
675
675
|
},
|
|
676
676
|
emits: ["update:modelValue"],
|
|
677
677
|
setup(o, { emit: e }) {
|
|
678
|
-
const l = o, n = e, a = $([]), r = dt({}), s = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`,
|
|
678
|
+
const l = o, n = e, a = $([]), r = dt({}), s = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
|
|
679
679
|
try {
|
|
680
680
|
const c = await fetch(`/api/suggest/${l.data}`).then((g) => g.json());
|
|
681
681
|
a.value = c?.data || c;
|
|
@@ -691,9 +691,9 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
691
691
|
r[g] = c;
|
|
692
692
|
} else if (Array.isArray(c)) {
|
|
693
693
|
const g = new Set(c);
|
|
694
|
-
a.value.forEach((
|
|
695
|
-
if (!
|
|
696
|
-
const M = s(
|
|
694
|
+
a.value.forEach((v) => {
|
|
695
|
+
if (!v.disabled) {
|
|
696
|
+
const M = s(v);
|
|
697
697
|
r[M] = g.has(M);
|
|
698
698
|
}
|
|
699
699
|
});
|
|
@@ -713,7 +713,7 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
713
713
|
{ deep: !0 }
|
|
714
714
|
), ue(() => {
|
|
715
715
|
if (l.data)
|
|
716
|
-
|
|
716
|
+
f().then(() => {
|
|
717
717
|
if (typeof l.modelValue == "boolean" && a.value.length === 1) {
|
|
718
718
|
const c = s(a.value[0]);
|
|
719
719
|
r[c] = l.modelValue;
|
|
@@ -721,8 +721,8 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
721
721
|
const c = new Set(l.modelValue);
|
|
722
722
|
a.value.forEach((g) => {
|
|
723
723
|
if (!g.disabled) {
|
|
724
|
-
const
|
|
725
|
-
r[
|
|
724
|
+
const v = s(g);
|
|
725
|
+
r[v] = c.has(v);
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
728
|
}
|
|
@@ -734,30 +734,30 @@ const Yt = /* @__PURE__ */ R(Wt, [["render", Xt]]), el = {
|
|
|
734
734
|
const c = new Set(l.modelValue);
|
|
735
735
|
a.value.forEach((g) => {
|
|
736
736
|
if (!g.disabled) {
|
|
737
|
-
const
|
|
738
|
-
r[
|
|
737
|
+
const v = s(g);
|
|
738
|
+
r[v] = c.has(v);
|
|
739
739
|
}
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
742
|
}), (c, g) => (i(), u("div", {
|
|
743
743
|
class: B(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
|
|
744
744
|
}, [
|
|
745
|
-
(i(!0), u(Q, null, Y(a.value, (
|
|
746
|
-
modelValue: r[s(
|
|
747
|
-
"onUpdate:modelValue": (M) => r[s(
|
|
748
|
-
value: s(
|
|
745
|
+
(i(!0), u(Q, null, Y(a.value, (v) => (i(), X(tt, {
|
|
746
|
+
modelValue: r[s(v)],
|
|
747
|
+
"onUpdate:modelValue": (M) => r[s(v)] = M,
|
|
748
|
+
value: s(v),
|
|
749
749
|
class: B(p(c.colSpan)),
|
|
750
|
-
disabled:
|
|
751
|
-
label: d(
|
|
752
|
-
key: s(
|
|
753
|
-
icon:
|
|
754
|
-
imgUrl:
|
|
755
|
-
option:
|
|
750
|
+
disabled: v.disabled,
|
|
751
|
+
label: d(v),
|
|
752
|
+
key: s(v),
|
|
753
|
+
icon: v?.icon,
|
|
754
|
+
imgUrl: v?.imgUrl,
|
|
755
|
+
option: v,
|
|
756
756
|
view: c.view
|
|
757
757
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
758
758
|
], 2));
|
|
759
759
|
}
|
|
760
|
-
}), bl = /* @__PURE__ */
|
|
760
|
+
}), bl = /* @__PURE__ */ T(gl, [["__scopeId", "data-v-54f9e19c"]]), yl = ["placeholder", "disabled"], xl = /* @__PURE__ */ I({
|
|
761
761
|
__name: "vs-input-date1",
|
|
762
762
|
props: /* @__PURE__ */ q({
|
|
763
763
|
style: { default: () => ({}) },
|
|
@@ -835,7 +835,7 @@ function Cl(o, e) {
|
|
|
835
835
|
t("path", { d: "M12 5v14" }, null, -1)
|
|
836
836
|
]));
|
|
837
837
|
}
|
|
838
|
-
const je = /* @__PURE__ */
|
|
838
|
+
const je = /* @__PURE__ */ T(_l, [["render", Cl]]), Vl = {}, Ml = {
|
|
839
839
|
xmlns: "http://www.w3.org/2000/svg",
|
|
840
840
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
841
841
|
width: "44",
|
|
@@ -852,7 +852,7 @@ function Ll(o, e, l, n, a, r) {
|
|
|
852
852
|
re('<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><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
|
|
853
853
|
]));
|
|
854
854
|
}
|
|
855
|
-
const Bl = /* @__PURE__ */
|
|
855
|
+
const Bl = /* @__PURE__ */ T(Vl, [["render", Ll]]), Sl = {}, jl = {
|
|
856
856
|
xmlns: "http://www.w3.org/2000/svg",
|
|
857
857
|
class: "icon icon-tabler icon-tabler-table",
|
|
858
858
|
width: "44",
|
|
@@ -892,7 +892,7 @@ function Al(o, e, l, n, a, r) {
|
|
|
892
892
|
}, null, -1)
|
|
893
893
|
]));
|
|
894
894
|
}
|
|
895
|
-
const Il = /* @__PURE__ */
|
|
895
|
+
const Il = /* @__PURE__ */ T(Sl, [["render", Al]]), zl = {}, Ol = {
|
|
896
896
|
xmlns: "http://www.w3.org/2000/svg",
|
|
897
897
|
width: "24",
|
|
898
898
|
height: "24",
|
|
@@ -909,7 +909,7 @@ function El(o, e, l, n, a, r) {
|
|
|
909
909
|
re('<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><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
|
|
910
910
|
]));
|
|
911
911
|
}
|
|
912
|
-
const Fl = /* @__PURE__ */
|
|
912
|
+
const Fl = /* @__PURE__ */ T(zl, [["render", El]]), Dl = {}, Ul = {
|
|
913
913
|
xmlns: "http://www.w3.org/2000/svg",
|
|
914
914
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
915
915
|
width: "44",
|
|
@@ -926,7 +926,7 @@ function Rl(o, e, l, n, a, r) {
|
|
|
926
926
|
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
|
|
927
927
|
]));
|
|
928
928
|
}
|
|
929
|
-
const Tl = /* @__PURE__ */
|
|
929
|
+
const Tl = /* @__PURE__ */ T(Dl, [["render", Rl]]), Pl = {}, Nl = {
|
|
930
930
|
xmlns: "http://www.w3.org/2000/svg",
|
|
931
931
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
932
932
|
width: "44",
|
|
@@ -943,7 +943,7 @@ function Hl(o, e, l, n, a, r) {
|
|
|
943
943
|
re('<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><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
|
|
944
944
|
]));
|
|
945
945
|
}
|
|
946
|
-
const ql = /* @__PURE__ */
|
|
946
|
+
const ql = /* @__PURE__ */ T(Pl, [["render", Hl]]), Gl = (o) => {
|
|
947
947
|
if (!o) return "";
|
|
948
948
|
const e = o?.split(".");
|
|
949
949
|
return e[e.length - 1];
|
|
@@ -973,7 +973,7 @@ function Wl(o, e) {
|
|
|
973
973
|
re('<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)
|
|
974
974
|
]));
|
|
975
975
|
}
|
|
976
|
-
const Ae = /* @__PURE__ */
|
|
976
|
+
const Ae = /* @__PURE__ */ T(Kl, [["render", Wl]]), Ql = {}, Xl = {
|
|
977
977
|
xmlns: "http://www.w3.org/2000/svg",
|
|
978
978
|
width: "24",
|
|
979
979
|
height: "24",
|
|
@@ -997,7 +997,7 @@ function Yl(o, e) {
|
|
|
997
997
|
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
998
998
|
]));
|
|
999
999
|
}
|
|
1000
|
-
const ot = /* @__PURE__ */
|
|
1000
|
+
const ot = /* @__PURE__ */ T(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, to = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, lo = /* @__PURE__ */ I({
|
|
1001
1001
|
__name: "vs-input-file-list-item",
|
|
1002
1002
|
props: /* @__PURE__ */ q({
|
|
1003
1003
|
format: {},
|
|
@@ -1033,19 +1033,19 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1033
1033
|
}),
|
|
1034
1034
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1035
1035
|
}, [
|
|
1036
|
-
|
|
1036
|
+
j(Ae, { class: "w-4 h-4" })
|
|
1037
1037
|
]),
|
|
1038
1038
|
t("button", {
|
|
1039
1039
|
type: "button",
|
|
1040
1040
|
onClick: r[2] || (r[2] = (s) => H(Je)(l.value)),
|
|
1041
1041
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1042
1042
|
}, [
|
|
1043
|
-
|
|
1043
|
+
j(ot, { class: "w-4 h-4" })
|
|
1044
1044
|
])
|
|
1045
1045
|
])
|
|
1046
1046
|
]));
|
|
1047
1047
|
}
|
|
1048
|
-
}), Ke = /* @__PURE__ */
|
|
1048
|
+
}), Ke = /* @__PURE__ */ T(lo, [["__scopeId", "data-v-0ca886b3"]]), oo = { class: "flex items-center gap-x-2" }, ro = {
|
|
1049
1049
|
key: 1,
|
|
1050
1050
|
class: "flex items-center flex-wrap gap-2"
|
|
1051
1051
|
}, ao = /* @__PURE__ */ I({
|
|
@@ -1068,8 +1068,8 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1068
1068
|
setup(o) {
|
|
1069
1069
|
const e = o, l = G(o, "modelValue"), n = $(null), a = (s) => Array.isArray(l.value) && l.value[s] || "", r = async (s) => {
|
|
1070
1070
|
if (e.format) {
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1071
|
+
const f = s.target.files?.[0];
|
|
1072
|
+
if (!f || !f.name.endsWith(e.format))
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
1075
1075
|
const d = s.target.files?.[0];
|
|
@@ -1092,12 +1092,12 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1092
1092
|
value: l.value,
|
|
1093
1093
|
"onUpdate:value": d[1] || (d[1] = (p) => l.value = p)
|
|
1094
1094
|
}, null, 8, ["item", "value"])) : s.multiple ? (i(), u("div", ro, [
|
|
1095
|
-
(i(!0), u(Q, null, Y(l.value, (p,
|
|
1095
|
+
(i(!0), u(Q, null, Y(l.value, (p, f) => (i(), X(Ke, {
|
|
1096
1096
|
multiple: s.multiple,
|
|
1097
|
-
key:
|
|
1097
|
+
key: f,
|
|
1098
1098
|
value: l.value,
|
|
1099
1099
|
"onUpdate:value": d[2] || (d[2] = (c) => l.value = c),
|
|
1100
|
-
item: a(
|
|
1100
|
+
item: a(f)
|
|
1101
1101
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1102
1102
|
t("div", {
|
|
1103
1103
|
onClick: d[3] || (d[3] = (p) => !s.disabled && n.value?.click()),
|
|
@@ -1106,15 +1106,15 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1106
1106
|
s.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1107
1107
|
])
|
|
1108
1108
|
}, [
|
|
1109
|
-
|
|
1109
|
+
j(je, { class: "w-6 h-6" })
|
|
1110
1110
|
], 2)
|
|
1111
|
-
])) :
|
|
1112
|
-
s.multiple ?
|
|
1111
|
+
])) : S("", !0),
|
|
1112
|
+
s.multiple ? S("", !0) : (i(), u("div", {
|
|
1113
1113
|
key: 2,
|
|
1114
1114
|
onClick: d[4] || (d[4] = (p) => n.value?.click()),
|
|
1115
1115
|
class: B([s.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"])
|
|
1116
1116
|
}, [
|
|
1117
|
-
|
|
1117
|
+
j(je, { class: "w-6 h-6" })
|
|
1118
1118
|
], 2))
|
|
1119
1119
|
]));
|
|
1120
1120
|
}
|
|
@@ -1124,7 +1124,7 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1124
1124
|
item: { default: null }
|
|
1125
1125
|
},
|
|
1126
1126
|
setup(o) {
|
|
1127
|
-
const e = o, l =
|
|
1127
|
+
const e = o, l = D(() => {
|
|
1128
1128
|
try {
|
|
1129
1129
|
return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
|
|
1130
1130
|
day: "2-digit",
|
|
@@ -1208,38 +1208,38 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1208
1208
|
updateListOnConfirm: !0
|
|
1209
1209
|
});
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function f(c) {
|
|
1212
1212
|
(l.item.ext === "jpg" || l.item.ext === "png") && n("openLightbox", { item: l.item, index: c });
|
|
1213
1213
|
}
|
|
1214
1214
|
return (c, g) => (i(), u("div", po, [
|
|
1215
1215
|
c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", fo, [
|
|
1216
1216
|
t("div", {
|
|
1217
1217
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1218
|
-
onClick: g[0] || (g[0] = (
|
|
1218
|
+
onClick: g[0] || (g[0] = (v) => f(c.index))
|
|
1219
1219
|
}, [
|
|
1220
|
-
|
|
1220
|
+
j(Be, { item: c.item }, null, 8, ["item"])
|
|
1221
1221
|
])
|
|
1222
1222
|
])) : a(c.item) ? (i(), u("div", vo, [
|
|
1223
|
-
|
|
1223
|
+
j(Be, { item: c.item }, null, 8, ["item"])
|
|
1224
1224
|
])) : r(c.item) ? (i(), u("div", mo, [
|
|
1225
1225
|
t("a", {
|
|
1226
1226
|
href: `/api/file-preview?id=${c.item.file_id}`,
|
|
1227
1227
|
target: "_blank",
|
|
1228
1228
|
class: "flex gap-x-3 w-full items-center"
|
|
1229
1229
|
}, [
|
|
1230
|
-
|
|
1230
|
+
j(Be, { item: c.item }, null, 8, ["item"])
|
|
1231
1231
|
], 8, ho)
|
|
1232
1232
|
])) : (i(), u("div", go, [
|
|
1233
|
-
|
|
1233
|
+
j(Be, { item: c.item }, null, 8, ["item"])
|
|
1234
1234
|
])),
|
|
1235
1235
|
t("div", bo, [
|
|
1236
1236
|
t("div", yo, [
|
|
1237
1237
|
t("div", xo, [
|
|
1238
1238
|
t("button", {
|
|
1239
1239
|
class: "inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
|
|
1240
|
-
onClick: g[1] || (g[1] = (
|
|
1240
|
+
onClick: g[1] || (g[1] = (v) => s(c.item))
|
|
1241
1241
|
}, [
|
|
1242
|
-
|
|
1242
|
+
j(ot, {
|
|
1243
1243
|
height: "14",
|
|
1244
1244
|
width: "14"
|
|
1245
1245
|
})
|
|
@@ -1250,9 +1250,9 @@ const ot = /* @__PURE__ */ R(Ql, [["render", Yl]]), eo = { class: "h-[120px] w-[
|
|
|
1250
1250
|
t("button", {
|
|
1251
1251
|
type: "button",
|
|
1252
1252
|
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",
|
|
1253
|
-
onClick: g[2] || (g[2] = (
|
|
1253
|
+
onClick: g[2] || (g[2] = (v) => p())
|
|
1254
1254
|
}, [
|
|
1255
|
-
|
|
1255
|
+
j(Ae, {
|
|
1256
1256
|
height: "14",
|
|
1257
1257
|
width: "14"
|
|
1258
1258
|
})
|
|
@@ -1286,7 +1286,7 @@ function Co(o, e) {
|
|
|
1286
1286
|
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
1287
1287
|
]));
|
|
1288
1288
|
}
|
|
1289
|
-
const Vo = /* @__PURE__ */
|
|
1289
|
+
const Vo = /* @__PURE__ */ T(_o, [["render", Co]]), Mo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, Lo = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, So = { class1: "ml-auto" }, jo = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, Ao = {
|
|
1290
1290
|
key: 0,
|
|
1291
1291
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1292
1292
|
}, Io = { class: "relative" }, zo = {
|
|
@@ -1307,17 +1307,17 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1307
1307
|
},
|
|
1308
1308
|
emits: ["update"],
|
|
1309
1309
|
setup(o, { emit: e }) {
|
|
1310
|
-
const l = o, n = Se("form"), a =
|
|
1311
|
-
const h =
|
|
1310
|
+
const l = o, n = Se("form"), a = D(() => n.value.formId), r = $(!1), s = $(0), d = e, p = $(!1), f = $({}), c = $([]), g = $(""), v = D(() => Array.isArray(c.value) ? c.value.filter((x) => x.ext === "jpg" || x.ext === "png").map((x) => x?.file_path) : []), M = D(() => g.value === "" ? c.value : c.value.filter((x) => x?.uploaded_name?.includes(g.value))), A = (x) => {
|
|
1311
|
+
const h = v.value.findIndex((J) => J === x.item.file_path);
|
|
1312
1312
|
h !== -1 && (r.value = !0, s.value = h);
|
|
1313
|
-
},
|
|
1313
|
+
}, F = async () => {
|
|
1314
1314
|
try {
|
|
1315
1315
|
const x = await fetch(`${l.prefix}/widget/file/${a.value}`).then((h) => h.json());
|
|
1316
1316
|
c.value = x?.rows;
|
|
1317
1317
|
} catch (x) {
|
|
1318
1318
|
console.error(x);
|
|
1319
1319
|
}
|
|
1320
|
-
},
|
|
1320
|
+
}, U = async (x) => {
|
|
1321
1321
|
await Promise.all(
|
|
1322
1322
|
Array.from(x.target.files).map(async (h) => {
|
|
1323
1323
|
const J = new FormData();
|
|
@@ -1329,21 +1329,21 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1329
1329
|
return console.error(C), null;
|
|
1330
1330
|
}
|
|
1331
1331
|
})
|
|
1332
|
-
), await
|
|
1332
|
+
), await F();
|
|
1333
1333
|
}, P = (x) => {
|
|
1334
1334
|
const h = { ...x };
|
|
1335
1335
|
return x.cancel || (h.cancel = () => {
|
|
1336
1336
|
p.value = !1;
|
|
1337
1337
|
}), x.updateListOnConfirm && (h.confirm = async () => {
|
|
1338
|
-
await x.confirm(), p.value = !1,
|
|
1338
|
+
await x.confirm(), p.value = !1, F();
|
|
1339
1339
|
}), h;
|
|
1340
1340
|
}, _ = (x) => {
|
|
1341
|
-
|
|
1341
|
+
f.value = P(x), p.value = !0;
|
|
1342
1342
|
};
|
|
1343
1343
|
return se(a, (x) => {
|
|
1344
|
-
x &&
|
|
1344
|
+
x && F();
|
|
1345
1345
|
}), ue(() => {
|
|
1346
|
-
a.value &&
|
|
1346
|
+
a.value && F();
|
|
1347
1347
|
}), (x, h) => {
|
|
1348
1348
|
const J = Pe("Lightbox"), C = Pe("MessageBox");
|
|
1349
1349
|
return i(), u("div", Mo, [
|
|
@@ -1354,10 +1354,10 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1354
1354
|
t("input", {
|
|
1355
1355
|
type: "file",
|
|
1356
1356
|
class: "hidden",
|
|
1357
|
-
onChange: h[0] || (h[0] = (m) =>
|
|
1357
|
+
onChange: h[0] || (h[0] = (m) => U(m))
|
|
1358
1358
|
}, null, 32),
|
|
1359
1359
|
t("div", jo, [
|
|
1360
|
-
|
|
1360
|
+
j(Vo, {
|
|
1361
1361
|
height: "16",
|
|
1362
1362
|
width: "16"
|
|
1363
1363
|
})
|
|
@@ -1404,7 +1404,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1404
1404
|
])
|
|
1405
1405
|
])
|
|
1406
1406
|
])
|
|
1407
|
-
])) :
|
|
1407
|
+
])) : S("", !0),
|
|
1408
1408
|
c.value?.length ? (i(), u("div", zo, [
|
|
1409
1409
|
(i(!0), u(Q, null, Y(M.value, (m, V) => (i(), X(ko, {
|
|
1410
1410
|
key: V,
|
|
@@ -1413,24 +1413,24 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1413
1413
|
index: V,
|
|
1414
1414
|
onUpdate: h[2] || (h[2] = (z) => x.$emit("update", "file-list")),
|
|
1415
1415
|
onOpenModal: h[3] || (h[3] = (z) => _(z)),
|
|
1416
|
-
onOpenLightbox: h[4] || (h[4] = (z) =>
|
|
1416
|
+
onOpenLightbox: h[4] || (h[4] = (z) => A(z))
|
|
1417
1417
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1418
|
-
M.value.length ?
|
|
1418
|
+
M.value.length ? S("", !0) : (i(), u("div", Oo, h[9] || (h[9] = [
|
|
1419
1419
|
t("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1420
1420
|
])))
|
|
1421
|
-
])) :
|
|
1422
|
-
|
|
1421
|
+
])) : S("", !0),
|
|
1422
|
+
j(J, {
|
|
1423
1423
|
modelValue: r.value,
|
|
1424
1424
|
"onUpdate:modelValue": h[5] || (h[5] = (m) => r.value = m),
|
|
1425
1425
|
startIndex: s.value,
|
|
1426
1426
|
"onUpdate:index": h[6] || (h[6] = (m) => s.value = m),
|
|
1427
|
-
images:
|
|
1427
|
+
images: v.value
|
|
1428
1428
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1429
|
-
|
|
1429
|
+
j(C, Ce({
|
|
1430
1430
|
modelValue: p.value,
|
|
1431
1431
|
"onUpdate:modelValue": h[7] || (h[7] = (m) => p.value = m),
|
|
1432
|
-
onConfirm:
|
|
1433
|
-
},
|
|
1432
|
+
onConfirm: f.value.confirm
|
|
1433
|
+
}, f.value), null, 16, ["modelValue", "onConfirm"])
|
|
1434
1434
|
]);
|
|
1435
1435
|
};
|
|
1436
1436
|
}
|
|
@@ -1460,13 +1460,13 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1460
1460
|
), (n, a) => (i(), u("div", null, [
|
|
1461
1461
|
t("div", Fo, [
|
|
1462
1462
|
t("p", Do, E(o.title), 1),
|
|
1463
|
-
|
|
1463
|
+
j(lt, {
|
|
1464
1464
|
modelValue: l.value,
|
|
1465
1465
|
"onUpdate:modelValue": a[0] || (a[0] = (r) => l.value = r),
|
|
1466
1466
|
style: fe(o.style)
|
|
1467
1467
|
}, null, 8, ["modelValue", "style"])
|
|
1468
1468
|
]),
|
|
1469
|
-
|
|
1469
|
+
j(Ye, { name: "slide-fade" }, {
|
|
1470
1470
|
default: Me(() => [
|
|
1471
1471
|
K(t("div", Uo, [
|
|
1472
1472
|
ve(n.$slots, "default", {}, void 0, !0)
|
|
@@ -1478,7 +1478,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1478
1478
|
})
|
|
1479
1479
|
]));
|
|
1480
1480
|
}
|
|
1481
|
-
}), To = /* @__PURE__ */
|
|
1481
|
+
}), To = /* @__PURE__ */ T(Ro, [["__scopeId", "data-v-90320b87"]]), Po = { class: "text-[16px] text-gray-900 font-medium" }, No = { class: "grid gap-3" }, Ho = /* @__PURE__ */ I({
|
|
1482
1482
|
__name: "vs-container-accordion",
|
|
1483
1483
|
props: {
|
|
1484
1484
|
title: {
|
|
@@ -1507,12 +1507,12 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1507
1507
|
onClick: a[0] || (a[0] = (r) => l.value = !l.value),
|
|
1508
1508
|
class: "flex items-center gap-2"
|
|
1509
1509
|
}, [
|
|
1510
|
-
|
|
1510
|
+
j(H(Zt), {
|
|
1511
1511
|
class: B(["h-4 w-4 duration-300", [l.value ? "-rotate-180" : ""]])
|
|
1512
1512
|
}, null, 8, ["class"]),
|
|
1513
1513
|
t("span", Po, E(o.title), 1)
|
|
1514
1514
|
]),
|
|
1515
|
-
|
|
1515
|
+
j(Ye, { name: "slide-fade" }, {
|
|
1516
1516
|
default: Me(() => [
|
|
1517
1517
|
K(t("div", No, [
|
|
1518
1518
|
ve(n.$slots, "default", {}, void 0, !0)
|
|
@@ -1524,7 +1524,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1524
1524
|
})
|
|
1525
1525
|
]));
|
|
1526
1526
|
}
|
|
1527
|
-
}), qo = /* @__PURE__ */
|
|
1527
|
+
}), qo = /* @__PURE__ */ T(Ho, [["__scopeId", "data-v-590eff11"]]), Go = { class: "flex items-center justify-between" }, Jo = /* @__PURE__ */ I({
|
|
1528
1528
|
__name: "vs-container-default",
|
|
1529
1529
|
props: {
|
|
1530
1530
|
title: {
|
|
@@ -1612,12 +1612,12 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1612
1612
|
}
|
|
1613
1613
|
},
|
|
1614
1614
|
setup(o) {
|
|
1615
|
-
const e = o, l = Se("formValues", { default: {} }), n = Se("form"), a =
|
|
1615
|
+
const e = o, l = Se("formValues", { default: {} }), n = Se("form"), a = D(() => e.schema?.filter((s) => {
|
|
1616
1616
|
const d = s?.conditions;
|
|
1617
1617
|
if (!d) return !0;
|
|
1618
|
-
const p = Array.isArray(d) ? d[0] : d,
|
|
1619
|
-
return rt(
|
|
1620
|
-
})), r =
|
|
1618
|
+
const p = Array.isArray(d) ? d[0] : d, f = l?.value?.[p];
|
|
1619
|
+
return rt(f, d);
|
|
1620
|
+
})), r = D(() => Ko[e.view]);
|
|
1621
1621
|
return (s, d) => o.schema?.length ? (i(), X(xe(r.value), {
|
|
1622
1622
|
key: 0,
|
|
1623
1623
|
title: o.title,
|
|
@@ -1629,13 +1629,13 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1629
1629
|
}, { ref_for: !0 }, p, {
|
|
1630
1630
|
item: p,
|
|
1631
1631
|
modelValue: H(l)[p.name],
|
|
1632
|
-
"onUpdate:modelValue": (
|
|
1632
|
+
"onUpdate:modelValue": (f) => H(l)[p.name] = f,
|
|
1633
1633
|
style: o.style,
|
|
1634
1634
|
error: H(n)?.errors?.[p.name]
|
|
1635
1635
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
1636
1636
|
]),
|
|
1637
1637
|
_: 1
|
|
1638
|
-
}, 8, ["title", "style"])) :
|
|
1638
|
+
}, 8, ["title", "style"])) : S("", !0);
|
|
1639
1639
|
}
|
|
1640
1640
|
}), ir = { class: "relative" }, ur = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, dr = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, cr = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, pr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, fr = { class: "p-4 mim-h-0 h-full overflow-auto" }, vr = /* @__PURE__ */ I({
|
|
1641
1641
|
__name: "modal-edit",
|
|
@@ -1649,49 +1649,49 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1649
1649
|
emits: ["close", "save", "edit"],
|
|
1650
1650
|
setup(o, { emit: e }) {
|
|
1651
1651
|
const l = o, n = e, a = $(l.schema), r = $(l.defaultValue ? JSON.parse(JSON.stringify(l.defaultValue)) : {}), s = $({}), d = $(), p = $(l.mode);
|
|
1652
|
-
async function
|
|
1652
|
+
async function f() {
|
|
1653
1653
|
const g = s.value.validate();
|
|
1654
1654
|
if (g) {
|
|
1655
|
-
pe({ type: "warning", title: "Помилка валідації", message: Object.entries(g).map(([
|
|
1655
|
+
pe({ type: "warning", title: "Помилка валідації", message: Object.entries(g).map(([v, M]) => `${v}: ${M}`).join(`
|
|
1656
1656
|
`) });
|
|
1657
1657
|
return;
|
|
1658
1658
|
}
|
|
1659
1659
|
if (d.value)
|
|
1660
1660
|
try {
|
|
1661
|
-
const
|
|
1661
|
+
const v = await fetch(`/api/table/${d.value}`, {
|
|
1662
1662
|
method: p.value === "add" ? "POST" : "PUT",
|
|
1663
1663
|
headers: {
|
|
1664
1664
|
"Content-Type": "application/json"
|
|
1665
1665
|
},
|
|
1666
1666
|
body: JSON.stringify(r.value)
|
|
1667
1667
|
});
|
|
1668
|
-
if (
|
|
1669
|
-
await
|
|
1668
|
+
if (v.ok)
|
|
1669
|
+
await v.json(), pe({
|
|
1670
1670
|
type: "success",
|
|
1671
1671
|
title: "Успішно",
|
|
1672
1672
|
message: `Дані успішно ${p.value === "add" ? "збережено" : "оновлено"}`
|
|
1673
1673
|
}), n("save", r.value);
|
|
1674
|
-
else if (
|
|
1675
|
-
const M = await
|
|
1674
|
+
else if (v.status === 400) {
|
|
1675
|
+
const M = await v.json().catch(() => ({}));
|
|
1676
1676
|
pe({
|
|
1677
1677
|
type: "warning",
|
|
1678
1678
|
title: "Помилка валідації",
|
|
1679
1679
|
message: M.message || "Некоректні дані (400)"
|
|
1680
1680
|
});
|
|
1681
|
-
} else
|
|
1681
|
+
} else v.status === 500 ? pe({
|
|
1682
1682
|
type: "error",
|
|
1683
1683
|
title: "Серверна помилка",
|
|
1684
1684
|
message: "Виникла помилка на сервері (500)"
|
|
1685
1685
|
}) : pe({
|
|
1686
1686
|
type: "error",
|
|
1687
1687
|
title: "Помилка",
|
|
1688
|
-
message: `Статус: ${
|
|
1688
|
+
message: `Статус: ${v.status}`
|
|
1689
1689
|
});
|
|
1690
|
-
} catch (
|
|
1690
|
+
} catch (v) {
|
|
1691
1691
|
pe({
|
|
1692
1692
|
type: "error",
|
|
1693
1693
|
title: "Помилка з’єднання",
|
|
1694
|
-
message:
|
|
1694
|
+
message: v.message || "Не вдалося виконати запит"
|
|
1695
1695
|
});
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
@@ -1700,14 +1700,14 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1700
1700
|
}
|
|
1701
1701
|
return ue(async () => {
|
|
1702
1702
|
if (l.form) {
|
|
1703
|
-
const g = await fetch(`/api/template/form/${l.form}`).then((
|
|
1703
|
+
const g = await fetch(`/api/template/form/${l.form}`).then((v) => v.json());
|
|
1704
1704
|
a.value = g.schema, d.value = g.token;
|
|
1705
1705
|
} else if (l.token) {
|
|
1706
1706
|
d.value = l.token;
|
|
1707
|
-
const g = await fetch(`/api/form/${d.value}`).then((
|
|
1707
|
+
const g = await fetch(`/api/form/${d.value}`).then((v) => v.json());
|
|
1708
1708
|
a.value = g.schema, g.data ? r.value = g.data : p.value = "add";
|
|
1709
1709
|
}
|
|
1710
|
-
}), (g,
|
|
1710
|
+
}), (g, v) => (i(), u("div", ir, [
|
|
1711
1711
|
t("div", ur, [
|
|
1712
1712
|
t("div", dr, [
|
|
1713
1713
|
t("div", cr, [
|
|
@@ -1716,7 +1716,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1716
1716
|
onClick: c,
|
|
1717
1717
|
type: "button",
|
|
1718
1718
|
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
|
|
1719
|
-
},
|
|
1719
|
+
}, v[2] || (v[2] = [
|
|
1720
1720
|
t("span", { class: "sr-only" }, "Close", -1),
|
|
1721
1721
|
t("svg", {
|
|
1722
1722
|
class: "flex-shrink-0 w-4 h-4",
|
|
@@ -1740,10 +1740,10 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1740
1740
|
key: 0,
|
|
1741
1741
|
schema: a.value,
|
|
1742
1742
|
values: r.value,
|
|
1743
|
-
"onUpdate:values":
|
|
1743
|
+
"onUpdate:values": v[0] || (v[0] = (M) => r.value = M),
|
|
1744
1744
|
form: s.value,
|
|
1745
|
-
"onUpdate:form":
|
|
1746
|
-
}, null, 8, ["schema", "values", "form"])) :
|
|
1745
|
+
"onUpdate:form": v[1] || (v[1] = (M) => s.value = M)
|
|
1746
|
+
}, null, 8, ["schema", "values", "form"])) : S("", !0)
|
|
1747
1747
|
]),
|
|
1748
1748
|
t("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
|
|
1749
1749
|
t("button", {
|
|
@@ -1752,7 +1752,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1752
1752
|
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"
|
|
1753
1753
|
}, " Скасувати "),
|
|
1754
1754
|
t("button", {
|
|
1755
|
-
onClick:
|
|
1755
|
+
onClick: f,
|
|
1756
1756
|
type: "button",
|
|
1757
1757
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
1758
1758
|
}, " Зберегти ")
|
|
@@ -1826,16 +1826,16 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1826
1826
|
}),
|
|
1827
1827
|
emits: /* @__PURE__ */ q(["change"], ["update:modelValue"]),
|
|
1828
1828
|
setup(o, { emit: e }) {
|
|
1829
|
-
const l = o, n = e, a =
|
|
1829
|
+
const l = o, n = e, a = D(() => l.multiple), r = D(() => l.disabled);
|
|
1830
1830
|
me(l.style);
|
|
1831
|
-
const s = G(o, "modelValue"), d = $(null), p = $(null),
|
|
1831
|
+
const s = G(o, "modelValue"), d = $(null), p = $(null), f = $(null), c = $(!1), g = $(!1), v = $(null), M = $([]), A = $(-1), F = $([]), U = $(""), P = $(null), _ = $([]), x = D(() => {
|
|
1832
1832
|
if (!_.value.length) return [];
|
|
1833
1833
|
const k = new Map(M.value.map((w) => [w.id?.toString(), w]));
|
|
1834
1834
|
return _.value.map((w) => k.get(w?.toString())).filter((w) => !!w);
|
|
1835
|
-
}), h =
|
|
1835
|
+
}), h = D(() => l.placeholder || "Select..."), J = D(() => a.value ? !_.value.length && U.value === "" : !v.value?.text && U.value === ""), C = D(() => r.value ? !1 : a.value ? _.value.length > 0 : !!s.value), m = (k) => a.value ? _.value.some((w) => w?.toString() === k?.toString()) : s.value?.toString?.() === k?.toString?.(), V = D(() => {
|
|
1836
1836
|
let k = M.value ?? [];
|
|
1837
|
-
if (
|
|
1838
|
-
const w =
|
|
1837
|
+
if (U.value.trim() !== "") {
|
|
1838
|
+
const w = U.value.toLowerCase();
|
|
1839
1839
|
k = k.filter((O) => O.text?.toLowerCase?.().includes(w));
|
|
1840
1840
|
}
|
|
1841
1841
|
if (a.value && _.value.length) {
|
|
@@ -1852,7 +1852,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1852
1852
|
return [];
|
|
1853
1853
|
}
|
|
1854
1854
|
}, Z = async () => {
|
|
1855
|
-
l.options?.length ? M.value = [...l.options] : l.data && (M.value = await z(
|
|
1855
|
+
l.options?.length ? M.value = [...l.options] : l.data && (M.value = await z(U.value));
|
|
1856
1856
|
}, te = async (k) => {
|
|
1857
1857
|
if (k == null) return null;
|
|
1858
1858
|
const w = M.value?.find((W) => W?.id?.toString() === String(k));
|
|
@@ -1866,25 +1866,25 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1866
1866
|
}, Promise.resolve());
|
|
1867
1867
|
}, we = async () => {
|
|
1868
1868
|
r.value || (c.value = !0, await Z(), await $e(() => {
|
|
1869
|
-
P.value?.focus(), V.value.length ?
|
|
1869
|
+
P.value?.focus(), V.value.length ? A.value = 0 : A.value = -1;
|
|
1870
1870
|
}));
|
|
1871
1871
|
}, ie = () => {
|
|
1872
|
-
c.value = !1,
|
|
1872
|
+
c.value = !1, A.value = -1;
|
|
1873
1873
|
}, Ie = async (k) => {
|
|
1874
1874
|
if (r.value) return;
|
|
1875
1875
|
!c.value ? await we() : ie();
|
|
1876
1876
|
}, ke = async () => {
|
|
1877
1877
|
c.value ? P.value?.focus() : await we();
|
|
1878
1878
|
}, b = () => {
|
|
1879
|
-
a.value ? (_.value = [], s.value = [], n("change", [])) : (
|
|
1879
|
+
a.value ? (_.value = [], s.value = [], n("change", [])) : (v.value = null, s.value = null, n("change", null)), U.value = "", $e(() => P.value?.focus());
|
|
1880
1880
|
}, y = (k) => {
|
|
1881
1881
|
a.value && (_.value = _.value.filter((w) => w?.toString() !== k?.toString()), s.value = [..._.value], n("change", s.value), $e(() => P.value?.focus()));
|
|
1882
|
-
},
|
|
1883
|
-
a.value ? (m(k.id) || (_.value = [..._.value, k.id], s.value = [..._.value], n("change", s.value)),
|
|
1884
|
-
P.value?.focus(),
|
|
1885
|
-
})) : (
|
|
1882
|
+
}, R = (k) => {
|
|
1883
|
+
a.value ? (m(k.id) || (_.value = [..._.value, k.id], s.value = [..._.value], n("change", s.value)), U.value = "", $e(() => {
|
|
1884
|
+
P.value?.focus(), A.value = Math.min(A.value, V.value.length - 1);
|
|
1885
|
+
})) : (v.value = k, s.value = k.id, n("change", s.value), U.value = "", ie());
|
|
1886
1886
|
}, N = (k) => {
|
|
1887
|
-
m(k.id) ||
|
|
1887
|
+
m(k.id) || R(k);
|
|
1888
1888
|
}, ee = (k, w) => {
|
|
1889
1889
|
if (!k || !w) return;
|
|
1890
1890
|
const O = k.offsetTop, W = O + k.offsetHeight, be = w.scrollTop, Le = be + w.clientHeight;
|
|
@@ -1898,24 +1898,24 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1898
1898
|
if (!c.value) return;
|
|
1899
1899
|
const { key: w } = k;
|
|
1900
1900
|
if (w === "ArrowDown")
|
|
1901
|
-
k.preventDefault(),
|
|
1901
|
+
k.preventDefault(), A.value + 1 < V.value.length && (A.value += 1, ee(F.value[A.value], f.value));
|
|
1902
1902
|
else if (w === "ArrowUp")
|
|
1903
|
-
k.preventDefault(),
|
|
1903
|
+
k.preventDefault(), A.value > 0 && (A.value -= 1, ee(F.value[A.value], f.value));
|
|
1904
1904
|
else if (w === "Enter") {
|
|
1905
1905
|
k.preventDefault();
|
|
1906
|
-
const O = V.value[
|
|
1907
|
-
O &&
|
|
1908
|
-
} else w === "Escape" ? (k.preventDefault(), ie()) : w === "Backspace" ? a.value &&
|
|
1906
|
+
const O = V.value[A.value];
|
|
1907
|
+
O && R(O);
|
|
1908
|
+
} else w === "Escape" ? (k.preventDefault(), ie()) : w === "Backspace" ? a.value && U.value === "" && _.value.length && (_.value = _.value.slice(0, -1), s.value = [..._.value], n("change", s.value)) : w === "Home" ? (A.value = 0, ee(F.value[0], f.value)) : w === "End" ? (A.value = V.value.length - 1, ee(F.value[A.value], f.value)) : w === "Tab" && ie();
|
|
1909
1909
|
}, he = () => {
|
|
1910
1910
|
r.value || (g.value = !0);
|
|
1911
1911
|
}, ge = () => {
|
|
1912
|
-
g.value = !1,
|
|
1912
|
+
g.value = !1, U.value = "";
|
|
1913
1913
|
}, ce = (k) => {
|
|
1914
1914
|
k.key === "Escape" && c.value && ie();
|
|
1915
1915
|
}, Ue = (k) => {
|
|
1916
1916
|
d.value && (d.value.contains(k.target) || ie());
|
|
1917
1917
|
}, Re = (k) => {
|
|
1918
|
-
c.value &&
|
|
1918
|
+
c.value && f.value && !f.value.contains(k.target) && ie();
|
|
1919
1919
|
};
|
|
1920
1920
|
se(() => l.options, (k) => {
|
|
1921
1921
|
k?.length && (M.value = [...k]);
|
|
@@ -1928,7 +1928,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1928
1928
|
const k = s.value[0] ?? null;
|
|
1929
1929
|
s.value = k ?? null;
|
|
1930
1930
|
}
|
|
1931
|
-
|
|
1931
|
+
v.value = await te(s.value);
|
|
1932
1932
|
}
|
|
1933
1933
|
};
|
|
1934
1934
|
se(s, () => {
|
|
@@ -1945,7 +1945,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1945
1945
|
method: "POST",
|
|
1946
1946
|
headers: { "Content-Type": "application/json" },
|
|
1947
1947
|
body: JSON.stringify(k)
|
|
1948
|
-
}).then((w) => w.json()), !l.options?.length && l.data && (M.value = await z(
|
|
1948
|
+
}).then((w) => w.json()), !l.options?.length && l.data && (M.value = await z(U.value)));
|
|
1949
1949
|
}
|
|
1950
1950
|
return (k, w) => (i(), u("div", {
|
|
1951
1951
|
class: "flex gap-1 w-full",
|
|
@@ -1996,7 +1996,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
1996
1996
|
key: 0,
|
|
1997
1997
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
1998
1998
|
style: fe({ backgroundColor: O?.color })
|
|
1999
|
-
}, null, 4)) :
|
|
1999
|
+
}, null, 4)) : S("", !0),
|
|
2000
2000
|
t("div", gr, E(O.text), 1)
|
|
2001
2001
|
]),
|
|
2002
2002
|
t("div", {
|
|
@@ -2015,15 +2015,15 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2015
2015
|
t("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" })
|
|
2016
2016
|
], -1)
|
|
2017
2017
|
]), 8, br)
|
|
2018
|
-
]))), 128)) : !a.value &&
|
|
2019
|
-
|
|
2018
|
+
]))), 128)) : !a.value && v.value?.text && U.value === "" ? (i(), u("div", yr, [
|
|
2019
|
+
v.value?.color ? (i(), u("span", {
|
|
2020
2020
|
key: 0,
|
|
2021
2021
|
class: "w-[14px] h-[14px] rounded-md block mr-1 mt-0.5",
|
|
2022
|
-
style: fe({ backgroundColor:
|
|
2023
|
-
}, null, 4)) :
|
|
2024
|
-
oe(" " + E(
|
|
2025
|
-
])) :
|
|
2026
|
-
J.value ? (i(), u("div", xr, E(h.value), 1)) :
|
|
2022
|
+
style: fe({ backgroundColor: v.value?.color })
|
|
2023
|
+
}, null, 4)) : S("", !0),
|
|
2024
|
+
oe(" " + E(v.value.text), 1)
|
|
2025
|
+
])) : S("", !0),
|
|
2026
|
+
J.value ? (i(), u("div", xr, E(h.value), 1)) : S("", !0),
|
|
2027
2027
|
t("div", wr, [
|
|
2028
2028
|
!r.value && k.search ? K((i(), u("input", {
|
|
2029
2029
|
key: 0,
|
|
@@ -2038,13 +2038,13 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2038
2038
|
tabindex: "0",
|
|
2039
2039
|
"aria-autocomplete": "list",
|
|
2040
2040
|
placeholder: a.value && _.value.length ? "" : void 0,
|
|
2041
|
-
"onUpdate:modelValue": w[0] || (w[0] = (O) =>
|
|
2041
|
+
"onUpdate:modelValue": w[0] || (w[0] = (O) => U.value = O),
|
|
2042
2042
|
onFocus: he,
|
|
2043
2043
|
onBlur: ge,
|
|
2044
2044
|
onKeydown: de
|
|
2045
2045
|
}, null, 40, kr)), [
|
|
2046
|
-
[ne,
|
|
2047
|
-
]) :
|
|
2046
|
+
[ne, U.value]
|
|
2047
|
+
]) : S("", !0)
|
|
2048
2048
|
])
|
|
2049
2049
|
], 512),
|
|
2050
2050
|
t("div", _r, [
|
|
@@ -2064,7 +2064,7 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2064
2064
|
}, [
|
|
2065
2065
|
t("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" })
|
|
2066
2066
|
], -1)
|
|
2067
|
-
]), 8, $r)) :
|
|
2067
|
+
]), 8, $r)) : S("", !0),
|
|
2068
2068
|
w[6] || (w[6] = t("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2069
2069
|
t("button", {
|
|
2070
2070
|
type: "button",
|
|
@@ -2088,12 +2088,12 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2088
2088
|
t("div", {
|
|
2089
2089
|
class: "max-h-[300px] overflow-y-auto py-1",
|
|
2090
2090
|
ref_key: "listRef",
|
|
2091
|
-
ref:
|
|
2091
|
+
ref: f
|
|
2092
2092
|
}, [
|
|
2093
2093
|
V.value.length ? (i(!0), u(Q, { key: 0 }, Y(V.value, (O, W) => (i(), u("div", {
|
|
2094
2094
|
key: O.id,
|
|
2095
2095
|
ref_for: !0,
|
|
2096
|
-
ref: (be) =>
|
|
2096
|
+
ref: (be) => F.value[W] = be,
|
|
2097
2097
|
class: B([
|
|
2098
2098
|
"flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
|
|
2099
2099
|
m(O.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
|
|
@@ -2107,18 +2107,18 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2107
2107
|
key: 0,
|
|
2108
2108
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2109
2109
|
style: fe({ backgroundColor: O?.color })
|
|
2110
|
-
}, null, 4)) :
|
|
2110
|
+
}, null, 4)) : S("", !0),
|
|
2111
2111
|
t("div", {
|
|
2112
2112
|
class: B([
|
|
2113
2113
|
"leading-[19px]",
|
|
2114
|
-
|
|
2114
|
+
A.value === O.id ? "text-white" : "",
|
|
2115
2115
|
// active style like react-select
|
|
2116
|
-
(
|
|
2116
|
+
(A.value === W, "")
|
|
2117
2117
|
])
|
|
2118
2118
|
}, E(O.text), 3)
|
|
2119
2119
|
], 10, Mr))), 128)) : (i(), u("div", Lr, " No options "))
|
|
2120
2120
|
], 512)
|
|
2121
|
-
])) :
|
|
2121
|
+
])) : S("", !0)
|
|
2122
2122
|
], 2),
|
|
2123
2123
|
l.add ? (i(), u("button", {
|
|
2124
2124
|
key: 0,
|
|
@@ -2127,12 +2127,12 @@ const Vo = /* @__PURE__ */ R(_o, [["render", Co]]), Mo = { class: "flex flex-col
|
|
|
2127
2127
|
disabled: r.value,
|
|
2128
2128
|
type: "button"
|
|
2129
2129
|
}, [
|
|
2130
|
-
|
|
2130
|
+
j(je, {
|
|
2131
2131
|
width: "16",
|
|
2132
2132
|
height: "16"
|
|
2133
2133
|
}),
|
|
2134
2134
|
w[9] || (w[9] = t("span", null, "Додати", -1))
|
|
2135
|
-
], 8, Br)) :
|
|
2135
|
+
], 8, Br)) : S("", !0)
|
|
2136
2136
|
], 512));
|
|
2137
2137
|
}
|
|
2138
2138
|
}), jr = ["placeholder", "disabled"], Ar = /* @__PURE__ */ I({
|
|
@@ -2186,7 +2186,7 @@ function Or(o, e) {
|
|
|
2186
2186
|
t("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
2187
2187
|
]));
|
|
2188
2188
|
}
|
|
2189
|
-
const Er = /* @__PURE__ */
|
|
2189
|
+
const Er = /* @__PURE__ */ T(Ir, [["render", Or]]), Fr = {}, Dr = {
|
|
2190
2190
|
class: "flex-shrink-0 mt-0.5 size-3.5",
|
|
2191
2191
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2192
2192
|
viewBox: "0 0 24 24",
|
|
@@ -2204,7 +2204,7 @@ function Ur(o, e) {
|
|
|
2204
2204
|
t("path", { d: "M17 4v16" }, null, -1)
|
|
2205
2205
|
]));
|
|
2206
2206
|
}
|
|
2207
|
-
const Rr = /* @__PURE__ */
|
|
2207
|
+
const Rr = /* @__PURE__ */ T(Fr, [["render", Ur]]), Tr = {}, Pr = {
|
|
2208
2208
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2209
2209
|
width: "14",
|
|
2210
2210
|
height: "14",
|
|
@@ -2227,7 +2227,7 @@ function Nr(o, e) {
|
|
|
2227
2227
|
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
2228
2228
|
]));
|
|
2229
2229
|
}
|
|
2230
|
-
const Hr = /* @__PURE__ */
|
|
2230
|
+
const Hr = /* @__PURE__ */ T(Tr, [["render", Nr]]), qr = {}, Gr = {
|
|
2231
2231
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2232
2232
|
viewBox: "0 0 24 24",
|
|
2233
2233
|
fill: "none",
|
|
@@ -2248,7 +2248,7 @@ function Jr(o, e) {
|
|
|
2248
2248
|
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
2249
2249
|
]));
|
|
2250
2250
|
}
|
|
2251
|
-
const Kr = /* @__PURE__ */
|
|
2251
|
+
const Kr = /* @__PURE__ */ T(qr, [["render", Jr]]), Zr = {}, Wr = {
|
|
2252
2252
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2253
2253
|
viewBox: "0 0 24 24",
|
|
2254
2254
|
fill: "none",
|
|
@@ -2262,7 +2262,7 @@ function Qr(o, e) {
|
|
|
2262
2262
|
re('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
2263
2263
|
]));
|
|
2264
2264
|
}
|
|
2265
|
-
const Ze = /* @__PURE__ */
|
|
2265
|
+
const Ze = /* @__PURE__ */ T(Zr, [["render", Qr]]), Xr = {}, Yr = {
|
|
2266
2266
|
viewBox: "0 0 178 90",
|
|
2267
2267
|
fill: "none",
|
|
2268
2268
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -2272,7 +2272,7 @@ function ea(o, e) {
|
|
|
2272
2272
|
re('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
|
2273
2273
|
]));
|
|
2274
2274
|
}
|
|
2275
|
-
const ta = /* @__PURE__ */
|
|
2275
|
+
const ta = /* @__PURE__ */ T(Xr, [["render", ea]]), la = {}, oa = {
|
|
2276
2276
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2277
2277
|
viewBox: "0 0 24 24",
|
|
2278
2278
|
fill: "none",
|
|
@@ -2286,7 +2286,7 @@ function ra(o, e) {
|
|
|
2286
2286
|
t("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
|
|
2287
2287
|
]));
|
|
2288
2288
|
}
|
|
2289
|
-
const aa = /* @__PURE__ */
|
|
2289
|
+
const aa = /* @__PURE__ */ T(la, [["render", ra]]), sa = { class: "vs-datatable border rounded-xl w-full flex-grow" }, na = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, ia = { class: "relative w-full" }, ua = { class: "table-wrapper flex gap-2" }, da = { class: "vs-popover inline-block text-slate-700" }, ca = { class: "text-center" }, pa = { class: "" }, fa = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, va = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, ma = { class: "text-sm items-center text-gray-800 flex gap-1" }, ha = { class: "w-full overflow-x-auto" }, ga = { class: "w-full table-auto caption-bottom text-sm" }, ba = { class: "[&_tr]:border-b" }, ya = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, xa = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, wa = {
|
|
2290
2290
|
key: 0,
|
|
2291
2291
|
colspan: "100%",
|
|
2292
2292
|
class: "text-center"
|
|
@@ -2307,16 +2307,16 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2307
2307
|
}),
|
|
2308
2308
|
emits: ["update:modelValue"],
|
|
2309
2309
|
setup(o) {
|
|
2310
|
-
const e = o, l = G(o, "modelValue"), n = $({}), a = $(""), r =
|
|
2310
|
+
const e = o, l = G(o, "modelValue"), n = $({}), a = $(""), r = D(() => {
|
|
2311
2311
|
if (!a.value) return l.value ?? [];
|
|
2312
2312
|
const C = a.value.toLowerCase();
|
|
2313
2313
|
return l.value.filter((m) => e.colModel?.some((V) => {
|
|
2314
2314
|
const z = m[V.key];
|
|
2315
2315
|
return z ? Array.isArray(z) ? z.join(", ").toLowerCase().includes(C) : String(z).toLowerCase().includes(C) : !1;
|
|
2316
2316
|
}));
|
|
2317
|
-
}), s = $(null), d = $(null), p = $(!1),
|
|
2317
|
+
}), s = $(null), d = $(null), p = $(!1), f = $(null), c = $({ top: 0, left: 0 }), g = (C) => {
|
|
2318
2318
|
s.value = C;
|
|
2319
|
-
},
|
|
2319
|
+
}, v = (C) => {
|
|
2320
2320
|
d.value = C;
|
|
2321
2321
|
}, M = (C) => {
|
|
2322
2322
|
if (s.value === null || s.value === C) {
|
|
@@ -2325,12 +2325,12 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2325
2325
|
}
|
|
2326
2326
|
const m = [...l.value], [V] = m.splice(s.value, 1);
|
|
2327
2327
|
m.splice(C, 0, V), l.value = m, s.value = null, d.value = null;
|
|
2328
|
-
},
|
|
2328
|
+
}, A = (C) => {
|
|
2329
2329
|
const V = C.currentTarget.getBoundingClientRect();
|
|
2330
2330
|
c.value = { top: V.bottom + window.scrollY, left: V.left + window.scrollX }, p.value = !p.value;
|
|
2331
|
-
},
|
|
2332
|
-
|
|
2333
|
-
},
|
|
2331
|
+
}, F = () => {
|
|
2332
|
+
f.value && f.value.click();
|
|
2333
|
+
}, U = (C) => {
|
|
2334
2334
|
const V = C.target.files?.[0];
|
|
2335
2335
|
if (!V) return;
|
|
2336
2336
|
const z = new FileReader();
|
|
@@ -2379,7 +2379,7 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2379
2379
|
return (C, m) => (i(), u("div", sa, [
|
|
2380
2380
|
t("div", na, [
|
|
2381
2381
|
t("div", ia, [
|
|
2382
|
-
|
|
2382
|
+
j(Er, {
|
|
2383
2383
|
width: "14",
|
|
2384
2384
|
height: "14",
|
|
2385
2385
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
@@ -2396,8 +2396,8 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2396
2396
|
t("div", ua, [
|
|
2397
2397
|
t("input", {
|
|
2398
2398
|
ref_key: "fileInput",
|
|
2399
|
-
ref:
|
|
2400
|
-
onChange:
|
|
2399
|
+
ref: f,
|
|
2400
|
+
onChange: U,
|
|
2401
2401
|
class: "hidden",
|
|
2402
2402
|
accept: ".json",
|
|
2403
2403
|
type: "file"
|
|
@@ -2406,10 +2406,10 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2406
2406
|
t("div", ca, [
|
|
2407
2407
|
t("div", pa, [
|
|
2408
2408
|
t("button", {
|
|
2409
|
-
onClick:
|
|
2409
|
+
onClick: A,
|
|
2410
2410
|
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"
|
|
2411
2411
|
}, [
|
|
2412
|
-
|
|
2412
|
+
j(Rr, {
|
|
2413
2413
|
height: "16",
|
|
2414
2414
|
width: "16"
|
|
2415
2415
|
})
|
|
@@ -2427,39 +2427,39 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2427
2427
|
t("div", fa, [
|
|
2428
2428
|
t("div", va, [
|
|
2429
2429
|
t("button", {
|
|
2430
|
-
onClick:
|
|
2431
|
-
class: "text-slate-700 flex items-center gap-1 px-3 py-
|
|
2430
|
+
onClick: F,
|
|
2431
|
+
class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2432
2432
|
}, [
|
|
2433
|
-
|
|
2433
|
+
j(Hr, {
|
|
2434
2434
|
class: "text-black",
|
|
2435
2435
|
width: "14",
|
|
2436
2436
|
height: "14"
|
|
2437
2437
|
}),
|
|
2438
|
-
m[1] || (m[1] = oe(" Імпортувати "
|
|
2438
|
+
m[1] || (m[1] = oe(" Імпортувати "))
|
|
2439
2439
|
]),
|
|
2440
2440
|
t("button", {
|
|
2441
2441
|
onClick: P,
|
|
2442
|
-
class: "text-slate-700 flex items-center px-3 py-
|
|
2442
|
+
class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2443
2443
|
}, [
|
|
2444
2444
|
t("span", ma, [
|
|
2445
|
-
|
|
2445
|
+
j(Kr, {
|
|
2446
2446
|
class: "text-black",
|
|
2447
2447
|
width: "14",
|
|
2448
2448
|
height: "14"
|
|
2449
2449
|
}),
|
|
2450
|
-
m[2] || (m[2] = oe(" Експортувати "
|
|
2450
|
+
m[2] || (m[2] = oe(" Експортувати "))
|
|
2451
2451
|
])
|
|
2452
2452
|
])
|
|
2453
2453
|
])
|
|
2454
2454
|
])
|
|
2455
|
-
], 4)) :
|
|
2455
|
+
], 4)) : S("", !0)
|
|
2456
2456
|
])),
|
|
2457
2457
|
t("button", {
|
|
2458
2458
|
onClick: _,
|
|
2459
2459
|
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"
|
|
2460
2460
|
}, [
|
|
2461
|
-
|
|
2462
|
-
m[3] || (m[3] = oe(" Додати "
|
|
2461
|
+
j(je),
|
|
2462
|
+
m[3] || (m[3] = oe(" Додати "))
|
|
2463
2463
|
])
|
|
2464
2464
|
]),
|
|
2465
2465
|
t("div", ha, [
|
|
@@ -2467,7 +2467,7 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2467
2467
|
t("thead", ba, [
|
|
2468
2468
|
t("tr", ya, [
|
|
2469
2469
|
t("th", xa, [
|
|
2470
|
-
|
|
2470
|
+
j(Ze, {
|
|
2471
2471
|
width: "24",
|
|
2472
2472
|
height: "24",
|
|
2473
2473
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
@@ -2476,7 +2476,7 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2476
2476
|
(i(!0), u(Q, null, Y(C.colModel, (V) => (i(), u("th", {
|
|
2477
2477
|
key: V.key,
|
|
2478
2478
|
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]"
|
|
2479
|
-
}, E(V.ua), 1))), 128)),
|
|
2479
|
+
}, E(V.ua || V.label), 1))), 128)),
|
|
2480
2480
|
m[4] || (m[4] = t("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))
|
|
2481
2481
|
])
|
|
2482
2482
|
]),
|
|
@@ -2486,14 +2486,14 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2486
2486
|
r.value.length === 0 ? (i(), u("td", wa, [
|
|
2487
2487
|
t("div", ka, [
|
|
2488
2488
|
t("div", _a, [
|
|
2489
|
-
|
|
2489
|
+
j(ta, { class: "w-48 mx-auto" }),
|
|
2490
2490
|
m[5] || (m[5] = t("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2491
2491
|
t("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2492
2492
|
t("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
2493
2493
|
], -1))
|
|
2494
2494
|
])
|
|
2495
2495
|
])
|
|
2496
|
-
])) :
|
|
2496
|
+
])) : S("", !0),
|
|
2497
2497
|
(i(!0), u(Q, null, Y(r.value, (V, z) => (i(), u("tr", {
|
|
2498
2498
|
key: V.id,
|
|
2499
2499
|
class: B(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
@@ -2502,12 +2502,12 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2502
2502
|
}]),
|
|
2503
2503
|
draggable: "true",
|
|
2504
2504
|
onDragstart: (Z) => g(z),
|
|
2505
|
-
onDragover: ae((Z) =>
|
|
2505
|
+
onDragover: ae((Z) => v(z), ["prevent"]),
|
|
2506
2506
|
onDrop: (Z) => M(z)
|
|
2507
2507
|
}, [
|
|
2508
2508
|
t("td", Ca, [
|
|
2509
2509
|
t("div", Va, [
|
|
2510
|
-
|
|
2510
|
+
j(Ze, {
|
|
2511
2511
|
width: "24",
|
|
2512
2512
|
height: "24",
|
|
2513
2513
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
@@ -2526,7 +2526,7 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2526
2526
|
onClick: (Z) => h(V, z),
|
|
2527
2527
|
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"
|
|
2528
2528
|
}, [
|
|
2529
|
-
|
|
2529
|
+
j(aa, {
|
|
2530
2530
|
width: "24",
|
|
2531
2531
|
height: "24",
|
|
2532
2532
|
class: "w-3 h-3"
|
|
@@ -2536,7 +2536,7 @@ const aa = /* @__PURE__ */ R(la, [["render", ra]]), sa = { class: "vs-datatable
|
|
|
2536
2536
|
onClick: (Z) => J(z),
|
|
2537
2537
|
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"
|
|
2538
2538
|
}, [
|
|
2539
|
-
|
|
2539
|
+
j(Ae, {
|
|
2540
2540
|
width: "24",
|
|
2541
2541
|
height: "24",
|
|
2542
2542
|
class: "w-3 h-3"
|
|
@@ -2693,7 +2693,7 @@ function Fa(o, e) {
|
|
|
2693
2693
|
t("path", { d: "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" }, null, -1)
|
|
2694
2694
|
]));
|
|
2695
2695
|
}
|
|
2696
|
-
const Da = /* @__PURE__ */
|
|
2696
|
+
const Da = /* @__PURE__ */ T(Oa, [["render", Fa]]), Ua = {}, Ra = {
|
|
2697
2697
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2698
2698
|
viewBox: "0 0 24 24",
|
|
2699
2699
|
fill: "none",
|
|
@@ -2715,7 +2715,7 @@ function Ta(o, e) {
|
|
|
2715
2715
|
t("path", { d: "M7.5 16.5l9 -9" }, null, -1)
|
|
2716
2716
|
]));
|
|
2717
2717
|
}
|
|
2718
|
-
const Pa = /* @__PURE__ */
|
|
2718
|
+
const Pa = /* @__PURE__ */ T(Ua, [["render", Ta]]), Na = {}, Ha = {
|
|
2719
2719
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2720
2720
|
viewBox: "0 0 24 24",
|
|
2721
2721
|
fill: "none",
|
|
@@ -2730,7 +2730,7 @@ function qa(o, e) {
|
|
|
2730
2730
|
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
|
|
2731
2731
|
]));
|
|
2732
2732
|
}
|
|
2733
|
-
const Ga = /* @__PURE__ */
|
|
2733
|
+
const Ga = /* @__PURE__ */ T(Na, [["render", qa]]), Ja = {}, Ka = {
|
|
2734
2734
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2735
2735
|
viewBox: "0 0 24 24",
|
|
2736
2736
|
fill: "none",
|
|
@@ -2745,7 +2745,7 @@ function Za(o, e) {
|
|
|
2745
2745
|
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
|
|
2746
2746
|
]));
|
|
2747
2747
|
}
|
|
2748
|
-
const Wa = /* @__PURE__ */
|
|
2748
|
+
const Wa = /* @__PURE__ */ T(Ja, [["render", Za]]), Qa = {}, Xa = {
|
|
2749
2749
|
version: "1.1",
|
|
2750
2750
|
viewBox: "0 0 14 14",
|
|
2751
2751
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2783,7 +2783,7 @@ function Ya(o, e) {
|
|
|
2783
2783
|
], -1)
|
|
2784
2784
|
]));
|
|
2785
2785
|
}
|
|
2786
|
-
const es = /* @__PURE__ */
|
|
2786
|
+
const es = /* @__PURE__ */ T(Qa, [["render", Ya]]), ts = { class: "form-geom__search" }, ls = { class: "map-search__input" }, os = { class: "flex flex-nowrap relative" }, rs = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, as = { class: "flex items-center w-full" }, ss = { class: "max-w-[90%] truncate" }, ns = {
|
|
2787
2787
|
key: 0,
|
|
2788
2788
|
class: "absolute z-[3100] mt-0.5 left-0 right-0"
|
|
2789
2789
|
}, is = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, us = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, ds = ["onClick"], cs = { class: "flex justify-between items-center w-full" }, ps = { class: "flex items-center" }, fs = {
|
|
@@ -2814,27 +2814,27 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2814
2814
|
emits: ["goToCoordinates"],
|
|
2815
2815
|
setup(o, { emit: e }) {
|
|
2816
2816
|
const l = e, n = $(!1), a = $("coordinates"), r = $(""), s = $([]), d = $(!1), p = $(!1);
|
|
2817
|
-
let
|
|
2817
|
+
let f;
|
|
2818
2818
|
const c = [
|
|
2819
2819
|
{ value: "coordinates", label: "Пошук по кординатам" },
|
|
2820
2820
|
{ value: "atu", label: "АТУ" },
|
|
2821
2821
|
{ value: "address", label: "Адресса" },
|
|
2822
2822
|
{ value: "search_here", label: "Пошук HERE" }
|
|
2823
|
-
], g =
|
|
2824
|
-
function
|
|
2825
|
-
a.value = _.value, n.value = !1, r.value = "", r.value &&
|
|
2823
|
+
], g = D(() => c.find((_) => _.value === a.value)?.label ?? "АТУ");
|
|
2824
|
+
function v(_) {
|
|
2825
|
+
a.value = _.value, n.value = !1, r.value = "", r.value && F();
|
|
2826
2826
|
}
|
|
2827
2827
|
function M(_) {
|
|
2828
2828
|
_.target.closest(".map-search__input") || (n.value = !1);
|
|
2829
2829
|
}
|
|
2830
2830
|
ue(() => document.addEventListener("click", M)), et(() => document.removeEventListener("click", M));
|
|
2831
|
-
async function
|
|
2831
|
+
async function A(_) {
|
|
2832
2832
|
let x;
|
|
2833
2833
|
a.value === "atu" ? x = "/api/suggest/atu.nsdi.ato_level" : a.value === "address" ? x = "/api/suggest/map.address_id" : a.value === "search_here" && (x = "/api/gis-url-proxy");
|
|
2834
2834
|
const h = new URL(x || "");
|
|
2835
2835
|
return a.value === "search_here" ? h.searchParams.set("searchtext", _) : (a.value === "atu" || a.value === "address") && h.searchParams.set("key", _), h.searchParams.set("limit", "20"), h.searchParams.set("q", _), (await fetch(h.toString())).json();
|
|
2836
2836
|
}
|
|
2837
|
-
function
|
|
2837
|
+
function F() {
|
|
2838
2838
|
if (d.value = !0, p.value = !0, a.value === "coordinates") {
|
|
2839
2839
|
const _ = r.value.trim().split(",");
|
|
2840
2840
|
if (_.length === 2) {
|
|
@@ -2843,14 +2843,14 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2843
2843
|
}
|
|
2844
2844
|
return;
|
|
2845
2845
|
}
|
|
2846
|
-
|
|
2846
|
+
f && window.clearTimeout(f), f = window.setTimeout(async () => {
|
|
2847
2847
|
const _ = r.value.trim();
|
|
2848
2848
|
if (!_) {
|
|
2849
2849
|
s.value = [], p.value = !1;
|
|
2850
2850
|
return;
|
|
2851
2851
|
}
|
|
2852
2852
|
try {
|
|
2853
|
-
const x = await
|
|
2853
|
+
const x = await A(_);
|
|
2854
2854
|
s.value = Array.isArray(x.features) ? x.features : [];
|
|
2855
2855
|
} catch {
|
|
2856
2856
|
s.value = [];
|
|
@@ -2859,7 +2859,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2859
2859
|
}
|
|
2860
2860
|
}, 300);
|
|
2861
2861
|
}
|
|
2862
|
-
function
|
|
2862
|
+
function U() {
|
|
2863
2863
|
r.value = "", s.value = [], d.value = !1, p.value = !1;
|
|
2864
2864
|
}
|
|
2865
2865
|
function P(_) {
|
|
@@ -2896,7 +2896,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2896
2896
|
t("div", is, [
|
|
2897
2897
|
t("div", us, [
|
|
2898
2898
|
(i(), u(Q, null, Y(c, (h) => t("div", {
|
|
2899
|
-
onClick: (J) =>
|
|
2899
|
+
onClick: (J) => v(h),
|
|
2900
2900
|
key: h.value,
|
|
2901
2901
|
class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
|
|
2902
2902
|
}, [
|
|
@@ -2906,12 +2906,12 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2906
2906
|
]),
|
|
2907
2907
|
h.value === a.value ? (i(), u("svg", fs, x[4] || (x[4] = [
|
|
2908
2908
|
t("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2909
|
-
]))) :
|
|
2909
|
+
]))) : S("", !0)
|
|
2910
2910
|
])
|
|
2911
2911
|
], 8, ds)), 64))
|
|
2912
2912
|
])
|
|
2913
2913
|
])
|
|
2914
|
-
])) :
|
|
2914
|
+
])) : S("", !0)
|
|
2915
2915
|
]),
|
|
2916
2916
|
t("div", vs, [
|
|
2917
2917
|
t("div", ms, [
|
|
@@ -2941,7 +2941,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2941
2941
|
K(t("input", {
|
|
2942
2942
|
type: "text",
|
|
2943
2943
|
"onUpdate:modelValue": x[1] || (x[1] = (h) => r.value = h),
|
|
2944
|
-
onInput:
|
|
2944
|
+
onInput: F,
|
|
2945
2945
|
onFocus: x[2] || (x[2] = (h) => d.value = !0),
|
|
2946
2946
|
placeholder: "Пошук...",
|
|
2947
2947
|
class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
@@ -2950,7 +2950,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2950
2950
|
]),
|
|
2951
2951
|
r.value ? (i(), u("button", {
|
|
2952
2952
|
key: 0,
|
|
2953
|
-
onClick:
|
|
2953
|
+
onClick: U,
|
|
2954
2954
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
2955
2955
|
"aria-label": "Очистити",
|
|
2956
2956
|
type: "button"
|
|
@@ -2969,7 +2969,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2969
2969
|
"stroke-linejoin": "round"
|
|
2970
2970
|
})
|
|
2971
2971
|
], -1)
|
|
2972
|
-
]))) :
|
|
2972
|
+
]))) : S("", !0),
|
|
2973
2973
|
d.value && a.value !== "coordinates" ? (i(), u("div", hs, [
|
|
2974
2974
|
s.value.length ? (i(), u("ul", gs, [
|
|
2975
2975
|
(i(!0), u(Q, null, Y(s.value, (h) => (i(), u("li", {
|
|
@@ -2978,7 +2978,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2978
2978
|
class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
|
|
2979
2979
|
}, E(h.properties.display_name), 9, bs))), 128))
|
|
2980
2980
|
])) : p.value ? (i(), u("div", ys, "Шукаю…")) : (i(), u("div", xs, "Нічого не знайдено"))
|
|
2981
|
-
])) :
|
|
2981
|
+
])) : S("", !0)
|
|
2982
2982
|
])
|
|
2983
2983
|
])
|
|
2984
2984
|
])
|
|
@@ -2999,11 +2999,11 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
2999
2999
|
}
|
|
3000
3000
|
return (s, d) => (i(), u("div", ks, [
|
|
3001
3001
|
t("div", _s, [
|
|
3002
|
-
(i(!0), u(Q, null, Y(s.basemaps, (p,
|
|
3003
|
-
key:
|
|
3004
|
-
class: B(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value ===
|
|
3005
|
-
onClick: (c) => r(
|
|
3006
|
-
title:
|
|
3002
|
+
(i(!0), u(Q, null, Y(s.basemaps, (p, f) => (i(), u("div", {
|
|
3003
|
+
key: f,
|
|
3004
|
+
class: B(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === f }]),
|
|
3005
|
+
onClick: (c) => r(f),
|
|
3006
|
+
title: f,
|
|
3007
3007
|
role: "button",
|
|
3008
3008
|
tabindex: "0"
|
|
3009
3009
|
}, [
|
|
@@ -3040,7 +3040,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3040
3040
|
setup(o, { emit: e }) {
|
|
3041
3041
|
const l = o, n = e, a = $(null);
|
|
3042
3042
|
let r, s, d;
|
|
3043
|
-
const p = $(null),
|
|
3043
|
+
const p = $(null), f = $(null), c = $(6), g = $(0), v = $(null), M = {
|
|
3044
3044
|
topo100: {
|
|
3045
3045
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3046
3046
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3054,12 +3054,12 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3054
3054
|
preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
|
|
3055
3055
|
}
|
|
3056
3056
|
};
|
|
3057
|
-
let
|
|
3058
|
-
const
|
|
3059
|
-
function
|
|
3057
|
+
let A;
|
|
3058
|
+
const F = $("topo100");
|
|
3059
|
+
function U() {
|
|
3060
3060
|
return new Promise((b, y) => {
|
|
3061
3061
|
window.L && window.L.Draw && b(0);
|
|
3062
|
-
const
|
|
3062
|
+
const R = (ee) => {
|
|
3063
3063
|
if (Array.from(document.styleSheets).some((he) => he?.href?.includes(ee))) return;
|
|
3064
3064
|
const de = document.createElement("link");
|
|
3065
3065
|
de.rel = "stylesheet", de.href = ee, document.head.appendChild(de);
|
|
@@ -3072,7 +3072,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3072
3072
|
const ge = document.createElement("script");
|
|
3073
3073
|
ge.src = ee, ge.async = !0, ge.onload = () => _e(), ge.onerror = (ce) => de(ce), document.body.appendChild(ge);
|
|
3074
3074
|
});
|
|
3075
|
-
|
|
3075
|
+
R("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), R("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), N("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => N("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => b(0)).catch(y);
|
|
3076
3076
|
});
|
|
3077
3077
|
}
|
|
3078
3078
|
function P() {
|
|
@@ -3100,7 +3100,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3100
3100
|
}
|
|
3101
3101
|
if (b instanceof L.Polygon || b instanceof L.Rectangle)
|
|
3102
3102
|
try {
|
|
3103
|
-
const y = b.getLatLngs(),
|
|
3103
|
+
const y = b.getLatLngs(), R = Array.isArray(y[0]) ? y[0] : y, N = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(R) : 0;
|
|
3104
3104
|
return N ? N / 1e6 : 0;
|
|
3105
3105
|
} catch {
|
|
3106
3106
|
return null;
|
|
@@ -3113,42 +3113,42 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3113
3113
|
function V() {
|
|
3114
3114
|
const b = s.getLayers();
|
|
3115
3115
|
if (!b.length) {
|
|
3116
|
-
|
|
3116
|
+
v.value = null, g.value = 0;
|
|
3117
3117
|
return;
|
|
3118
3118
|
}
|
|
3119
|
-
const y = b[b.length - 1],
|
|
3120
|
-
|
|
3121
|
-
type:
|
|
3119
|
+
const y = b[b.length - 1], R = J(y), N = m(y), ee = C(y);
|
|
3120
|
+
v.value = {
|
|
3121
|
+
type: R,
|
|
3122
3122
|
center: N,
|
|
3123
3123
|
areaKm2: ee,
|
|
3124
3124
|
layer: y
|
|
3125
3125
|
}, g.value = b.length;
|
|
3126
3126
|
}
|
|
3127
3127
|
function z() {
|
|
3128
|
-
const b =
|
|
3128
|
+
const b = v.value?.layer;
|
|
3129
3129
|
b && (b instanceof L.Circle && b.getBounds ? r.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getBounds ? r.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getLatLng && r.setView(b.getLatLng(), Math.max(c.value, 14)));
|
|
3130
3130
|
}
|
|
3131
3131
|
function Z() {
|
|
3132
|
-
const b =
|
|
3132
|
+
const b = v.value?.layer;
|
|
3133
3133
|
b && (s.removeLayer(b), P(), V());
|
|
3134
3134
|
}
|
|
3135
3135
|
ue(async () => {
|
|
3136
|
-
await
|
|
3137
|
-
const { layer:
|
|
3138
|
-
s.clearLayers(), s.addLayer(
|
|
3136
|
+
await U(), L.drawLocal = Ia, r = L.map(a.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(r), A = L.tileLayer(M.topo100.url, { maxZoom: 19, minZoom: 6 }).addTo(r), F.value = "topo100", s = new L.FeatureGroup().addTo(r), r.on(L.Draw.Event.CREATED, (y) => {
|
|
3137
|
+
const { layer: R } = y;
|
|
3138
|
+
s.clearLayers(), s.addLayer(R), P(), V(), _(), h.value = "";
|
|
3139
3139
|
}), r.on(L.Draw.Event.EDITED, () => {
|
|
3140
3140
|
P(), V(), _();
|
|
3141
3141
|
}), r.on(L.Draw.Event.DELETED, () => {
|
|
3142
3142
|
P(), V(), _();
|
|
3143
3143
|
}), r.on("mousemove", (y) => {
|
|
3144
|
-
|
|
3144
|
+
f.value = y.latlng;
|
|
3145
3145
|
}), r.on("zoomend", () => {
|
|
3146
3146
|
c.value = r.getZoom();
|
|
3147
3147
|
});
|
|
3148
3148
|
const b = za(l.modelValue);
|
|
3149
3149
|
if (b) {
|
|
3150
3150
|
const y = [];
|
|
3151
|
-
L.geoJSON(b).eachLayer((
|
|
3151
|
+
L.geoJSON(b).eachLayer((R) => y.push(R)), y.length && s.addLayer(y[0]), P(), V(), _();
|
|
3152
3152
|
}
|
|
3153
3153
|
});
|
|
3154
3154
|
function te(b) {
|
|
@@ -3174,27 +3174,27 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3174
3174
|
}
|
|
3175
3175
|
}
|
|
3176
3176
|
function ye() {
|
|
3177
|
-
const b = s.toGeoJSON(), y = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }),
|
|
3178
|
-
N.href =
|
|
3177
|
+
const b = s.toGeoJSON(), y = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }), R = URL.createObjectURL(y), N = document.createElement("a");
|
|
3178
|
+
N.href = R, N.download = "data.geojson", N.click(), URL.revokeObjectURL(R);
|
|
3179
3179
|
}
|
|
3180
3180
|
function we(b) {
|
|
3181
3181
|
const y = b.target.files?.[0];
|
|
3182
3182
|
if (!y) return;
|
|
3183
|
-
const
|
|
3184
|
-
|
|
3185
|
-
if (typeof
|
|
3183
|
+
const R = new FileReader();
|
|
3184
|
+
R.onload = () => {
|
|
3185
|
+
if (typeof R.result == "string")
|
|
3186
3186
|
try {
|
|
3187
|
-
const N = JSON.parse(
|
|
3187
|
+
const N = JSON.parse(R.result);
|
|
3188
3188
|
s.clearLayers(), N && L.geoJSON({ type: "Feature", geometry: N }).eachLayer((ee) => {
|
|
3189
3189
|
s.addLayer(ee);
|
|
3190
3190
|
}), P(), V(), _();
|
|
3191
3191
|
} finally {
|
|
3192
3192
|
b.target.value = "";
|
|
3193
3193
|
}
|
|
3194
|
-
},
|
|
3194
|
+
}, R.readAsText(y);
|
|
3195
3195
|
}
|
|
3196
3196
|
function ie(b) {
|
|
3197
|
-
r && (
|
|
3197
|
+
r && (A && r.removeLayer(A), A = L.tileLayer(M[b].url, { maxZoom: 19, minZoom: 6 }).addTo(r), F.value = b);
|
|
3198
3198
|
}
|
|
3199
3199
|
function Ie(b) {
|
|
3200
3200
|
const y = L.latLng(b[0], b[1]);
|
|
@@ -3218,7 +3218,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3218
3218
|
class: "w-full h-full"
|
|
3219
3219
|
}, null, 512),
|
|
3220
3220
|
t("div", Ms, [
|
|
3221
|
-
|
|
3221
|
+
j(ws, { onGoToCoordinates: Ie }),
|
|
3222
3222
|
t("div", Ls, [
|
|
3223
3223
|
t("div", Bs, [
|
|
3224
3224
|
t("button", {
|
|
@@ -3250,92 +3250,92 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3250
3250
|
"aria-pressed": h.value === "marker",
|
|
3251
3251
|
title: "Point (P)",
|
|
3252
3252
|
"aria-label": "Draw point",
|
|
3253
|
-
onClick: y[0] || (y[0] = (
|
|
3253
|
+
onClick: y[0] || (y[0] = (R) => te("marker"))
|
|
3254
3254
|
}, [
|
|
3255
|
-
|
|
3255
|
+
j(Da)
|
|
3256
3256
|
], 10, Is),
|
|
3257
3257
|
t("button", {
|
|
3258
3258
|
class: B(["vs-btn", { "vs-active": h.value === "polyline" }]),
|
|
3259
3259
|
"aria-pressed": h.value === "polyline",
|
|
3260
3260
|
title: "Line (L)",
|
|
3261
3261
|
"aria-label": "Draw polyline",
|
|
3262
|
-
onClick: y[1] || (y[1] = (
|
|
3262
|
+
onClick: y[1] || (y[1] = (R) => te("polyline"))
|
|
3263
3263
|
}, [
|
|
3264
|
-
|
|
3264
|
+
j(Pa)
|
|
3265
3265
|
], 10, zs),
|
|
3266
3266
|
t("button", {
|
|
3267
3267
|
class: B(["vs-btn", { "vs-active": h.value === "polygon" }]),
|
|
3268
3268
|
"aria-pressed": h.value === "polygon",
|
|
3269
3269
|
title: "Polygon (G)",
|
|
3270
3270
|
"aria-label": "Draw polygon",
|
|
3271
|
-
onClick: y[2] || (y[2] = (
|
|
3271
|
+
onClick: y[2] || (y[2] = (R) => te("polygon"))
|
|
3272
3272
|
}, [
|
|
3273
|
-
|
|
3273
|
+
j(Ga)
|
|
3274
3274
|
], 10, Os),
|
|
3275
3275
|
t("button", {
|
|
3276
3276
|
class: B(["vs-btn", { "vs-active": h.value === "rectangle" }]),
|
|
3277
3277
|
"aria-pressed": h.value === "rectangle",
|
|
3278
3278
|
title: "Rectangle (R)",
|
|
3279
3279
|
"aria-label": "Draw rectangle",
|
|
3280
|
-
onClick: y[3] || (y[3] = (
|
|
3280
|
+
onClick: y[3] || (y[3] = (R) => te("rectangle"))
|
|
3281
3281
|
}, [
|
|
3282
|
-
|
|
3282
|
+
j(Wa)
|
|
3283
3283
|
], 10, Es),
|
|
3284
3284
|
t("button", {
|
|
3285
3285
|
class: "vs-btn",
|
|
3286
|
-
onClick: y[4] || (y[4] = (
|
|
3286
|
+
onClick: y[4] || (y[4] = (R) => ke.value = !ke.value)
|
|
3287
3287
|
}, [
|
|
3288
|
-
|
|
3288
|
+
j(es, { style: { width: "12px", height: "12px" } })
|
|
3289
3289
|
])
|
|
3290
3290
|
])
|
|
3291
3291
|
]),
|
|
3292
3292
|
t("div", {
|
|
3293
|
-
class: B(["absolute left-4 z-[1000]",
|
|
3293
|
+
class: B(["absolute left-4 z-[1000]", v.value ? "bottom-8" : "bottom-4"])
|
|
3294
3294
|
}, [
|
|
3295
|
-
|
|
3295
|
+
j(Vs, {
|
|
3296
3296
|
basemaps: M,
|
|
3297
3297
|
"default-layer": "topo100",
|
|
3298
3298
|
onOnLayerChange: ie
|
|
3299
3299
|
})
|
|
3300
3300
|
], 2),
|
|
3301
3301
|
t("div", Fs, [
|
|
3302
|
-
|
|
3302
|
+
v.value ? (i(), u("div", Ds, [
|
|
3303
3303
|
t("div", Us, [
|
|
3304
|
-
y[7] || (y[7] = oe(" Тип: "
|
|
3305
|
-
t("span", Rs, E(
|
|
3304
|
+
y[7] || (y[7] = oe(" Тип: ")),
|
|
3305
|
+
t("span", Rs, E(v.value.type), 1)
|
|
3306
3306
|
]),
|
|
3307
3307
|
t("div", Ts, [
|
|
3308
3308
|
t("div", Ps, [
|
|
3309
|
-
y[8] || (y[8] = oe(" Центр: "
|
|
3310
|
-
t("b", null, E(
|
|
3309
|
+
y[8] || (y[8] = oe(" Центр: ")),
|
|
3310
|
+
t("b", null, E(v.value.center.lat.toFixed(5)) + ", " + E(v.value.center.lng.toFixed(5)), 1)
|
|
3311
3311
|
]),
|
|
3312
|
-
|
|
3313
|
-
y[9] || (y[9] = oe(" Площа: "
|
|
3314
|
-
t("b", null, E(
|
|
3312
|
+
v.value.areaKm2 !== null ? (i(), u("div", Ns, [
|
|
3313
|
+
y[9] || (y[9] = oe(" Площа: ")),
|
|
3314
|
+
t("b", null, E(v.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3315
3315
|
])) : (i(), u("div", Hs, y[10] || (y[10] = [
|
|
3316
|
-
oe(" Площа: "
|
|
3316
|
+
oe(" Площа: "),
|
|
3317
3317
|
t("b", null, "—", -1)
|
|
3318
3318
|
]))),
|
|
3319
3319
|
t("button", {
|
|
3320
3320
|
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",
|
|
3321
3321
|
title: "Наблизити",
|
|
3322
|
-
onClick: y[5] || (y[5] = (
|
|
3322
|
+
onClick: y[5] || (y[5] = (R) => z())
|
|
3323
3323
|
}, y[11] || (y[11] = [
|
|
3324
3324
|
re('<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-d73d6cfa><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-d73d6cfa></path><path d="M7 10l6 0" data-v-d73d6cfa></path><path d="M10 7l0 6" data-v-d73d6cfa></path><path d="M21 21l-6 -6" data-v-d73d6cfa></path></svg>', 1)
|
|
3325
3325
|
])),
|
|
3326
3326
|
t("button", {
|
|
3327
3327
|
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",
|
|
3328
3328
|
title: "Видалити",
|
|
3329
|
-
onClick: y[6] || (y[6] = (
|
|
3329
|
+
onClick: y[6] || (y[6] = (R) => Z())
|
|
3330
3330
|
}, [
|
|
3331
|
-
|
|
3331
|
+
j(Ae, { class: "w-3 h-3" })
|
|
3332
3332
|
])
|
|
3333
3333
|
])
|
|
3334
|
-
])) :
|
|
3334
|
+
])) : S("", !0)
|
|
3335
3335
|
])
|
|
3336
3336
|
], 2));
|
|
3337
3337
|
}
|
|
3338
|
-
}), Gs = /* @__PURE__ */
|
|
3338
|
+
}), Gs = /* @__PURE__ */ T(qs, [["__scopeId", "data-v-d73d6cfa"]]), Js = ["data-focus"], Ks = { class: "flex items-center" }, Zs = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Ws = ["onClick", "aria-label"], Qs = {
|
|
3339
3339
|
key: 0,
|
|
3340
3340
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3341
3341
|
}, Xs = { class: "flex-1 min-w-[2px]" }, Ys = ["placeholder"], en = { class: "flex items-center shrink-0" }, tn = ["disabled"], ln = /* @__PURE__ */ I({
|
|
@@ -3357,16 +3357,16 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3357
3357
|
setup(o, { emit: e }) {
|
|
3358
3358
|
const l = o, n = e;
|
|
3359
3359
|
me(l.style);
|
|
3360
|
-
const a = $(null), r = $(null), s = $(null), d = $(!1), p = $(""),
|
|
3360
|
+
const a = $(null), r = $(null), s = $(null), d = $(!1), p = $(""), f = G(o, "modelValue"), c = D(() => l.placeholder || "Add tag…"), g = D(() => f.value?.length === 0 && p.value === ""), v = D(() => !l.disabled && f.value?.length > 0), M = D(() => l.disabled), A = async () => {
|
|
3361
3361
|
M.value || await $e(() => s.value?.focus());
|
|
3362
|
-
},
|
|
3362
|
+
}, F = (C) => {
|
|
3363
3363
|
const m = C.trim();
|
|
3364
|
-
m !== "" && (!
|
|
3365
|
-
},
|
|
3364
|
+
m !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [m] : l.unique ? f.value.includes(m) || (f.value = [...f.value, m]) : f.value = [...f.value, m], p.value = "");
|
|
3365
|
+
}, U = () => {
|
|
3366
3366
|
const C = p.value;
|
|
3367
|
-
C.trim() !== "" &&
|
|
3367
|
+
C.trim() !== "" && F(C), p.value = "";
|
|
3368
3368
|
}, P = (C) => {
|
|
3369
|
-
const m =
|
|
3369
|
+
const m = f.value.slice();
|
|
3370
3370
|
m.splice(C, 1), n("update:modelValue", m);
|
|
3371
3371
|
}, _ = () => {
|
|
3372
3372
|
n("update:modelValue", []);
|
|
@@ -3376,7 +3376,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3376
3376
|
d.value = !1;
|
|
3377
3377
|
}, J = (C) => {
|
|
3378
3378
|
const { key: m } = C;
|
|
3379
|
-
m === "Enter" ? (C.preventDefault(),
|
|
3379
|
+
m === "Enter" ? (C.preventDefault(), U()) : m === "Backspace" && p.value === "" && f.value.length > 0 && P(f.value.length - 1);
|
|
3380
3380
|
};
|
|
3381
3381
|
return (C, m) => (i(), u("div", {
|
|
3382
3382
|
class: "flex gap-1 w-full",
|
|
@@ -3398,14 +3398,14 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3398
3398
|
M.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3399
3399
|
]),
|
|
3400
3400
|
"data-focus": d.value ? "true" : "false",
|
|
3401
|
-
onClick:
|
|
3401
|
+
onClick: A
|
|
3402
3402
|
}, [
|
|
3403
3403
|
t("div", {
|
|
3404
3404
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3405
3405
|
ref_key: "chipsRef",
|
|
3406
3406
|
ref: r
|
|
3407
3407
|
}, [
|
|
3408
|
-
(i(!0), u(Q, null, Y(
|
|
3408
|
+
(i(!0), u(Q, null, Y(f.value, (V, z) => (i(), u("div", {
|
|
3409
3409
|
key: z,
|
|
3410
3410
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3411
3411
|
}, [
|
|
@@ -3430,9 +3430,9 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3430
3430
|
], -1)
|
|
3431
3431
|
]), 8, Ws)
|
|
3432
3432
|
]))), 128)),
|
|
3433
|
-
g.value ? (i(), u("div", Qs, E(c.value), 1)) :
|
|
3433
|
+
g.value ? (i(), u("div", Qs, E(c.value), 1)) : S("", !0),
|
|
3434
3434
|
t("div", Xs, [
|
|
3435
|
-
M.value ?
|
|
3435
|
+
M.value ? S("", !0) : K((i(), u("input", {
|
|
3436
3436
|
key: 0,
|
|
3437
3437
|
ref_key: "inputRef",
|
|
3438
3438
|
ref: s,
|
|
@@ -3448,14 +3448,14 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3448
3448
|
onFocus: x,
|
|
3449
3449
|
onBlur: h,
|
|
3450
3450
|
onKeydown: J,
|
|
3451
|
-
placeholder:
|
|
3451
|
+
placeholder: f.value && f.value.length ? "" : void 0
|
|
3452
3452
|
}, null, 40, Ys)), [
|
|
3453
3453
|
[ne, p.value]
|
|
3454
3454
|
])
|
|
3455
3455
|
])
|
|
3456
3456
|
], 512),
|
|
3457
3457
|
t("div", en, [
|
|
3458
|
-
|
|
3458
|
+
v.value ? (i(), u("button", {
|
|
3459
3459
|
key: 0,
|
|
3460
3460
|
type: "button",
|
|
3461
3461
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
@@ -3471,7 +3471,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3471
3471
|
}, [
|
|
3472
3472
|
t("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" })
|
|
3473
3473
|
], -1)
|
|
3474
|
-
]), 8, tn)) :
|
|
3474
|
+
]), 8, tn)) : S("", !0)
|
|
3475
3475
|
])
|
|
3476
3476
|
], 10, Js)
|
|
3477
3477
|
], 2)
|
|
@@ -3544,16 +3544,16 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3544
3544
|
}),
|
|
3545
3545
|
emits: ["update:modelValue"],
|
|
3546
3546
|
setup(o) {
|
|
3547
|
-
const e = o, l = G(o, "modelValue"), n =
|
|
3547
|
+
const e = o, l = G(o, "modelValue"), n = D(() => Mt[`${e.layout}`]), a = D(() => on?.[`vs-input-${e.item.type}`]), r = D(() => {
|
|
3548
3548
|
const d = H(a);
|
|
3549
3549
|
if (!d) return /* @__PURE__ */ new Set();
|
|
3550
3550
|
const p = d.props ?? d.__vccOpts?.props;
|
|
3551
3551
|
if (!p) return /* @__PURE__ */ new Set();
|
|
3552
|
-
const
|
|
3553
|
-
return new Set(
|
|
3554
|
-
}), s =
|
|
3552
|
+
const f = Array.isArray(p) ? p : Object.keys(p);
|
|
3553
|
+
return new Set(f);
|
|
3554
|
+
}), s = D(() => {
|
|
3555
3555
|
const d = e.item ?? {}, p = r.value;
|
|
3556
|
-
return p.size ? Object.fromEntries(Object.entries(d).filter(([
|
|
3556
|
+
return p.size ? Object.fromEntries(Object.entries(d).filter(([f]) => p.has(f))) : {};
|
|
3557
3557
|
});
|
|
3558
3558
|
return (d, p) => (i(), X(xe(n.value), {
|
|
3559
3559
|
ua: e.item.ua,
|
|
@@ -3565,9 +3565,9 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3565
3565
|
t("div", an, [
|
|
3566
3566
|
(i(), X(xe(a.value), Ce(s.value, {
|
|
3567
3567
|
modelValue: l.value,
|
|
3568
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
3568
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => l.value = f)
|
|
3569
3569
|
}), null, 16, ["modelValue"])),
|
|
3570
|
-
d.item.behavior ? (i(), X(rn, Ce({ key: 0 }, d.item.behavior, { value: l.value }), null, 16, ["value"])) :
|
|
3570
|
+
d.item.behavior ? (i(), X(rn, Ce({ key: 0 }, d.item.behavior, { value: l.value }), null, 16, ["value"])) : S("", !0)
|
|
3571
3571
|
])
|
|
3572
3572
|
]),
|
|
3573
3573
|
_: 1
|
|
@@ -3600,6 +3600,7 @@ const es = /* @__PURE__ */ R(Qa, [["render", Ya]]), ts = { class: "form-geom__se
|
|
|
3600
3600
|
html: "static",
|
|
3601
3601
|
geom: "map",
|
|
3602
3602
|
filelist: "file-list",
|
|
3603
|
+
datalist: "datatable",
|
|
3603
3604
|
file: "file"
|
|
3604
3605
|
// mask: 'text',
|
|
3605
3606
|
};
|
|
@@ -3630,24 +3631,24 @@ function fn(o) {
|
|
|
3630
3631
|
function vn(o, e) {
|
|
3631
3632
|
const l = fn(e), n = $({});
|
|
3632
3633
|
function a(p) {
|
|
3633
|
-
const
|
|
3634
|
-
if (!
|
|
3635
|
-
const c = Array.isArray(
|
|
3636
|
-
return rt(g,
|
|
3634
|
+
const f = p?.conditions;
|
|
3635
|
+
if (!f) return !0;
|
|
3636
|
+
const c = Array.isArray(f) ? f[0] : f, g = o?.value?.[c];
|
|
3637
|
+
return rt(g, f);
|
|
3637
3638
|
}
|
|
3638
|
-
const r = (p = l,
|
|
3639
|
+
const r = (p = l, f = !0) => (p.forEach((c) => {
|
|
3639
3640
|
if (c.rules) {
|
|
3640
3641
|
if (!a(c)) {
|
|
3641
3642
|
delete n.value[c.name];
|
|
3642
3643
|
return;
|
|
3643
3644
|
}
|
|
3644
3645
|
c.rules.forEach((g) => {
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3646
|
+
const v = cn(o.value[c.name], g);
|
|
3647
|
+
v ? n.value[c.name] = v : delete n.value[c.name];
|
|
3647
3648
|
});
|
|
3648
3649
|
}
|
|
3649
3650
|
c.schema && r(c.schema, !1);
|
|
3650
|
-
}),
|
|
3651
|
+
}), f && Object.values(n.value).some(Boolean) ? n.value : null), s = D(() => l?.filter((p) => a(p)));
|
|
3651
3652
|
return {
|
|
3652
3653
|
errors: n,
|
|
3653
3654
|
validate: r,
|
|
@@ -3662,6 +3663,7 @@ const Oe = /* @__PURE__ */ I({
|
|
|
3662
3663
|
props: /* @__PURE__ */ q({
|
|
3663
3664
|
schema: { default: () => [] },
|
|
3664
3665
|
style: { default: () => ({}) },
|
|
3666
|
+
modelValue: {},
|
|
3665
3667
|
layout: { default: () => "default" },
|
|
3666
3668
|
formId: { default: () => "" }
|
|
3667
3669
|
}, {
|
|
@@ -3670,41 +3672,45 @@ const Oe = /* @__PURE__ */ I({
|
|
|
3670
3672
|
values: { default: () => ({}) },
|
|
3671
3673
|
valuesModifiers: {}
|
|
3672
3674
|
}),
|
|
3673
|
-
emits: /* @__PURE__ */ q(["handle-submit"], ["update:form", "update:values"]),
|
|
3674
|
-
setup(o, {
|
|
3675
|
-
const
|
|
3676
|
-
errors:
|
|
3677
|
-
validate:
|
|
3678
|
-
reset:
|
|
3679
|
-
visibleSchema:
|
|
3680
|
-
} = vn(
|
|
3681
|
-
|
|
3675
|
+
emits: /* @__PURE__ */ q(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
3676
|
+
setup(o, { expose: e, emit: l }) {
|
|
3677
|
+
const n = l, a = o, r = G(o, "form"), s = G(o, "values"), {
|
|
3678
|
+
errors: d,
|
|
3679
|
+
validate: p,
|
|
3680
|
+
reset: f,
|
|
3681
|
+
visibleSchema: c
|
|
3682
|
+
} = vn(s, a.schema), g = () => {
|
|
3683
|
+
n("update:modelValue", s.value), p(), n("handle-submit", s.value);
|
|
3682
3684
|
};
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
+
e({
|
|
3686
|
+
validate: p,
|
|
3687
|
+
reset: f,
|
|
3688
|
+
errors: d
|
|
3689
|
+
}), ue(() => {
|
|
3690
|
+
a.modelValue && (s.value = a.modelValue), r.value.value = s.value, r.value.errors = d.value, r.value.reset = f, r.value.validate = p, r.value.formId = a.formId;
|
|
3685
3691
|
});
|
|
3686
|
-
function
|
|
3687
|
-
if (
|
|
3688
|
-
if (typeof
|
|
3689
|
-
const
|
|
3690
|
-
return
|
|
3692
|
+
function v(M, A) {
|
|
3693
|
+
if (M === A) return !0;
|
|
3694
|
+
if (typeof M != "object" || typeof A != "object" || !M || !A) return !1;
|
|
3695
|
+
const F = Object.keys(M), U = Object.keys(A);
|
|
3696
|
+
return F.length !== U.length ? !1 : F.every((P) => M[P] === A[P]);
|
|
3691
3697
|
}
|
|
3692
|
-
return Ne("form",
|
|
3693
|
-
onSubmit: ae(
|
|
3694
|
-
class: B(["grid grid-cols-12",
|
|
3698
|
+
return Ne("form", r), Ne("values", s), (M, A) => (i(), u("form", {
|
|
3699
|
+
onSubmit: ae(g, ["prevent"]),
|
|
3700
|
+
class: B(["grid grid-cols-12", M.layout === "default" ? "gap-6" : "gap-4"])
|
|
3695
3701
|
}, [
|
|
3696
|
-
(i(!0), u(Q, null, Y(H(
|
|
3697
|
-
key:
|
|
3698
|
-
class: B(
|
|
3699
|
-
style: fe(
|
|
3700
|
-
item:
|
|
3701
|
-
layout:
|
|
3702
|
-
"model-value":
|
|
3703
|
-
"onUpdate:modelValue": (
|
|
3704
|
-
const
|
|
3705
|
-
|
|
3702
|
+
(i(!0), u(Q, null, Y(H(c), (F) => (i(), X(at, {
|
|
3703
|
+
key: F.name,
|
|
3704
|
+
class: B(M.layout === "horizontal" ? "col-span-12" : `col-span-${F.col || 12} `),
|
|
3705
|
+
style: fe(M.style),
|
|
3706
|
+
item: F,
|
|
3707
|
+
layout: M.layout,
|
|
3708
|
+
"model-value": s.value[F.name],
|
|
3709
|
+
"onUpdate:modelValue": (U) => {
|
|
3710
|
+
const P = s.value[F.name];
|
|
3711
|
+
v(P, U) || (s.value[F.name] = U);
|
|
3706
3712
|
},
|
|
3707
|
-
error: H(
|
|
3713
|
+
error: H(d)[F.name]
|
|
3708
3714
|
}, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
|
|
3709
3715
|
], 34));
|
|
3710
3716
|
}
|