@opengis/form 0.0.139 → 0.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-kKKKCGVc.js → index-Cs54Hg4W.js} +643 -625
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/src/components/inputs/base/vs-input-number.vue.d.ts +63 -8
- package/dist/src/components/inputs/base/vs-input-number.vue.d.ts.map +1 -1
- package/dist/src/components/inputs/index.d.ts +62 -7
- package/dist/src/components/inputs/index.d.ts.map +1 -1
- package/dist/src/components/layouts/vs-compact-form-layout.vue.d.ts.map +1 -1
- package/dist/{vs-richtext-BIjdZ7EF.js → vs-richtext-IzSPyqFv.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as oe, ref as D, createElementBlock as g, openBlock as u, Fragment as be, createElementVNode as c, createBlock as ge, renderSlot as We, createVNode as H, unref as N, Teleport as el, createCommentVNode as j, normalizeStyle as Te, toDisplayString as re, computed as
|
|
2
|
-
import { Info as Nt, Check as xa, Mail as wa, Phone as ka, Table as _a, FileCode as $a, FileText as kl, FileArchive as Ca, Trash2 as Rt, Download as ql, Plus as ht, Upload as
|
|
1
|
+
import { defineComponent as oe, ref as D, createElementBlock as g, openBlock as u, Fragment as be, createElementVNode as c, createBlock as ge, renderSlot as We, createVNode as H, unref as N, Teleport as el, createCommentVNode as j, normalizeStyle as Te, toDisplayString as re, computed as k, mergeProps as At, createTextVNode as Pe, normalizeProps as jl, guardReactiveProps as Ul, onMounted as Ze, onUnmounted as tl, normalizeClass as X, mergeModels as Ve, useModel as Ae, withDirectives as ke, vModelText as Ne, useAttrs as kn, vModelCheckbox as _n, resolveDynamicComponent as _t, withCtx as et, withModifiers as De, onBeforeUnmount as It, watch as ce, vModelRadio as $n, renderList as Ce, reactive as Cn, vModelDynamic as ma, inject as it, vShow as Mt, resolveComponent as ft, Transition as zl, nextTick as Qe, defineAsyncComponent as va, createStaticVNode as Hl, useSlots as ga, getCurrentInstance as ya, watchEffect as Zt, withKeys as ha, toRef as ba, provide as Il } from "vue";
|
|
2
|
+
import { Info as Nt, Check as xa, Mail as wa, Phone as ka, Table as _a, FileCode as $a, FileText as kl, FileArchive as Ca, Trash2 as Rt, Download as ql, Plus as ht, Upload as Sn, Search as $l, ChevronDown as Ht, X as bt, GripVertical as zt, Pencil as Sa, Circle as Va, MapPin as Vn, Ruler as Mn, Maximize as Ma, ZoomIn as La, LoaderCircle as Da, Copy as Aa, ChevronRight as Fa, ChevronLeft as Ia } from "lucide-vue-next";
|
|
3
3
|
import { notify as $e, VsModal as Gl, modal as Ea } from "@opengis/core";
|
|
4
|
-
const
|
|
4
|
+
const Ln = /* @__PURE__ */ oe({
|
|
5
5
|
__name: "vs-info-tooltip",
|
|
6
6
|
props: {
|
|
7
7
|
text: {}
|
|
@@ -62,12 +62,12 @@ const Mn = /* @__PURE__ */ oe({
|
|
|
62
62
|
columns: {}
|
|
63
63
|
},
|
|
64
64
|
setup(e) {
|
|
65
|
-
const l = e, t =
|
|
65
|
+
const l = e, t = k(() => typeof l.item?.label == "string" && l.item.label ? l.item.label : l.item?.ua || l.label || l.ua), n = k(() => !!t.value), a = k(() => !!l.item?.rules?.includes("required")), o = k(() => l.item?.info || "");
|
|
66
66
|
return (r, s) => (u(), g("div", Ba, [
|
|
67
67
|
n.value ? (u(), g("div", Ta, [
|
|
68
68
|
c("span", Pa, re(t.value), 1),
|
|
69
69
|
a.value ? (u(), g("span", Na, "*")) : j("", !0),
|
|
70
|
-
o.value ? (u(), ge(
|
|
70
|
+
o.value ? (u(), ge(Ln, {
|
|
71
71
|
key: 1,
|
|
72
72
|
text: o.value
|
|
73
73
|
}, null, 8, ["text"])) : j("", !0)
|
|
@@ -99,22 +99,22 @@ const Mn = /* @__PURE__ */ oe({
|
|
|
99
99
|
columns: { default: () => ({ container: 12, label: 3 }) }
|
|
100
100
|
},
|
|
101
101
|
setup(e) {
|
|
102
|
-
const l = e, t =
|
|
102
|
+
const l = e, t = k(() => l.item?.label || l.label || l.ua), n = k(() => l.item?.info || ""), a = k(() => l.columns ?? { container: 12, label: 3 }), o = k(() => {
|
|
103
103
|
const { container: m, label: y } = a.value;
|
|
104
104
|
return !m || m <= 0 ? 0 : Math.min(Math.max(y ?? 0, 0), m) / m;
|
|
105
|
-
}), r =
|
|
105
|
+
}), r = k(() => l.item?.type === "html" || o.value <= 0 ? !1 : !!t.value), s = k(() => {
|
|
106
106
|
if (!r.value) return {};
|
|
107
107
|
const m = `${o.value * 100}%`;
|
|
108
108
|
return { flexBasis: m, maxWidth: m };
|
|
109
|
-
}), d =
|
|
109
|
+
}), d = k(() => {
|
|
110
110
|
const { container: m, label: y } = a.value;
|
|
111
111
|
if (!m || m <= 0) return {};
|
|
112
112
|
if (l.item?.type === "html") return { flexBasis: "100%", maxWidth: "100%" };
|
|
113
113
|
if (!r.value) return { flexBasis: "100%", maxWidth: "100%" };
|
|
114
114
|
const $ = Math.max(m - Math.max(y ?? 0, 0), 0) / m;
|
|
115
115
|
if (!$) return {};
|
|
116
|
-
const
|
|
117
|
-
return { flexBasis:
|
|
116
|
+
const F = `${$ * 100}%`;
|
|
117
|
+
return { flexBasis: F, maxWidth: F };
|
|
118
118
|
});
|
|
119
119
|
return (m, y) => (u(), g("div", ja, [
|
|
120
120
|
r.value ? (u(), g("span", {
|
|
@@ -124,7 +124,7 @@ const Mn = /* @__PURE__ */ oe({
|
|
|
124
124
|
}, [
|
|
125
125
|
Pe(re(t.value) + " ", 1),
|
|
126
126
|
m.item?.rules?.includes("required") && t.value ? (u(), g("span", Ua, "*")) : j("", !0),
|
|
127
|
-
n.value ? (u(), ge(
|
|
127
|
+
n.value ? (u(), ge(Ln, {
|
|
128
128
|
key: 1,
|
|
129
129
|
text: n.value
|
|
130
130
|
}, null, 8, ["text"])) : j("", !0)
|
|
@@ -186,8 +186,8 @@ const Mn = /* @__PURE__ */ oe({
|
|
|
186
186
|
},
|
|
187
187
|
setup(e) {
|
|
188
188
|
const l = e, t = D("uk");
|
|
189
|
-
|
|
190
|
-
const n =
|
|
189
|
+
k(() => (l.item ?? {})?.[t.value] ?? l.ua ?? l.label ?? "");
|
|
190
|
+
const n = k(() => l.item?.description ?? ""), a = k(() => Array.isArray(l.item?.rules) && l.item.rules.includes("required")), o = k(() => (typeof l.error == "string" ? l.error : "") ?? ""), r = () => {
|
|
191
191
|
const s = typeof localStorage < "u" ? localStorage.getItem("locale") : null;
|
|
192
192
|
t.value = s || "uk";
|
|
193
193
|
};
|
|
@@ -233,7 +233,7 @@ const Mn = /* @__PURE__ */ oe({
|
|
|
233
233
|
};
|
|
234
234
|
function tt(e) {
|
|
235
235
|
return {
|
|
236
|
-
inputClass:
|
|
236
|
+
inputClass: k(() => {
|
|
237
237
|
const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
238
238
|
return e?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
|
|
239
239
|
})
|
|
@@ -257,7 +257,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
257
257
|
}),
|
|
258
258
|
emits: ["update:modelValue"],
|
|
259
259
|
setup(e) {
|
|
260
|
-
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a =
|
|
260
|
+
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a = k(() => !!l.disabled), o = k(() => l.placeholder ?? "");
|
|
261
261
|
return (r, s) => ke((u(), g("input", {
|
|
262
262
|
type: "password",
|
|
263
263
|
"onUpdate:modelValue": s[0] || (s[0] = (d) => n.value = d),
|
|
@@ -289,7 +289,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
289
289
|
}),
|
|
290
290
|
emits: ["update:modelValue"],
|
|
291
291
|
setup(e) {
|
|
292
|
-
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a =
|
|
292
|
+
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a = k(() => !!l.disabled), o = k(() => l.placeholder ?? ""), r = k(() => l.maxlength ?? void 0), s = k(() => l.minlength ?? void 0);
|
|
293
293
|
function d() {
|
|
294
294
|
typeof n.value == "string" && (n.value = n.value.trim());
|
|
295
295
|
}
|
|
@@ -310,39 +310,59 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
310
310
|
}), rr = ["step", "placeholder", "disabled", "min", "max"], or = /* @__PURE__ */ oe({
|
|
311
311
|
__name: "vs-input-number",
|
|
312
312
|
props: /* @__PURE__ */ Ve({
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
313
|
+
style: {
|
|
314
|
+
type: Object,
|
|
315
|
+
default: () => ({})
|
|
316
|
+
},
|
|
317
|
+
placeholder: {
|
|
318
|
+
type: String,
|
|
319
|
+
default: ""
|
|
320
|
+
},
|
|
321
|
+
disabled: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: !1
|
|
324
|
+
},
|
|
325
|
+
min: {
|
|
326
|
+
type: Number,
|
|
327
|
+
default: void 0
|
|
328
|
+
},
|
|
329
|
+
max: {
|
|
330
|
+
type: Number,
|
|
331
|
+
default: void 0
|
|
332
|
+
},
|
|
333
|
+
step: {
|
|
334
|
+
type: [Number, String],
|
|
335
|
+
default: void 0
|
|
336
|
+
}
|
|
325
337
|
}, {
|
|
326
338
|
modelValue: { default: null },
|
|
327
339
|
modelModifiers: {}
|
|
328
340
|
}),
|
|
329
341
|
emits: ["update:modelValue"],
|
|
330
342
|
setup(e) {
|
|
331
|
-
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"),
|
|
332
|
-
|
|
343
|
+
const l = e, { inputClass: t } = tt(l.style), n = kn(), a = Ae(e, "modelValue"), o = k(() => !!l.disabled), r = (y) => {
|
|
344
|
+
if (y == null || y === "") return;
|
|
345
|
+
const $ = typeof y == "string" ? y.trim().replace(",", ".") : y, F = Number($);
|
|
346
|
+
return Number.isFinite(F) ? F : void 0;
|
|
347
|
+
}, s = k(() => r(l.min ?? n.min)), d = k(() => r(l.max ?? n.max)), m = k(() => {
|
|
348
|
+
if (l.step !== void 0 && l.step !== null && l.step !== "") return l.step;
|
|
349
|
+
const y = n.step;
|
|
350
|
+
return typeof y == "number" || typeof y == "string" ? y : "any";
|
|
351
|
+
});
|
|
352
|
+
return (y, $) => ke((u(), g("input", {
|
|
333
353
|
type: "number",
|
|
334
|
-
step:
|
|
335
|
-
"onUpdate:modelValue":
|
|
336
|
-
placeholder:
|
|
337
|
-
disabled:
|
|
354
|
+
step: m.value,
|
|
355
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => a.value = F),
|
|
356
|
+
placeholder: e.placeholder,
|
|
357
|
+
disabled: o.value,
|
|
338
358
|
class: X(["py-1.5 px-3 block w-full bg-white", [N(t)]]),
|
|
339
359
|
style: {
|
|
340
360
|
border: "1px solid #CFD9E0"
|
|
341
361
|
},
|
|
342
|
-
min:
|
|
343
|
-
max:
|
|
362
|
+
min: s.value,
|
|
363
|
+
max: d.value
|
|
344
364
|
}, null, 10, rr)), [
|
|
345
|
-
[Ne,
|
|
365
|
+
[Ne, a.value]
|
|
346
366
|
]);
|
|
347
367
|
}
|
|
348
368
|
}), sr = { class: "flex items-center gap-[4px]" }, ir = ["value", "id", "disabled"], ur = ["for"], dr = { class: "text-[14px] text-gray-700 flex items-center dark:text-neutral-400" }, cr = /* @__PURE__ */ oe({
|
|
@@ -358,10 +378,10 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
358
378
|
},
|
|
359
379
|
emits: ["update:modelValue"],
|
|
360
380
|
setup(e, { emit: l }) {
|
|
361
|
-
const t = l, n = e, a =
|
|
381
|
+
const t = l, n = e, a = k({
|
|
362
382
|
get: () => n.modelValue,
|
|
363
383
|
set: (r) => t("update:modelValue", r)
|
|
364
|
-
}), o =
|
|
384
|
+
}), o = k(() => !!n.disabled);
|
|
365
385
|
return (r, s) => (u(), g("div", sr, [
|
|
366
386
|
ke(c("input", {
|
|
367
387
|
type: "checkbox",
|
|
@@ -371,7 +391,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
371
391
|
id: r.id,
|
|
372
392
|
disabled: o.value
|
|
373
393
|
}, null, 10, ir), [
|
|
374
|
-
[
|
|
394
|
+
[_n, a.value]
|
|
375
395
|
]),
|
|
376
396
|
c("label", {
|
|
377
397
|
for: r.id,
|
|
@@ -407,12 +427,12 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
407
427
|
},
|
|
408
428
|
emits: ["update:modelValue"],
|
|
409
429
|
setup(e, { emit: l }) {
|
|
410
|
-
const t = e, n = l, a =
|
|
430
|
+
const t = e, n = l, a = k({
|
|
411
431
|
get: () => t.modelValue,
|
|
412
432
|
set: (s) => {
|
|
413
433
|
n("update:modelValue", s);
|
|
414
434
|
}
|
|
415
|
-
}), o =
|
|
435
|
+
}), o = k(() => Array.isArray(a.value) ? a.value.includes(t.value) : a.value === !0 || a.value === t.value), r = k(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
416
436
|
return (s, d) => (u(), g("label", {
|
|
417
437
|
class: X(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, o.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
418
438
|
}, [
|
|
@@ -424,7 +444,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
424
444
|
"onUpdate:modelValue": d[0] || (d[0] = (m) => a.value = m),
|
|
425
445
|
disabled: s.disabled
|
|
426
446
|
}, null, 8, fr), [
|
|
427
|
-
[
|
|
447
|
+
[_n, a.value]
|
|
428
448
|
]),
|
|
429
449
|
c("span", pr, [
|
|
430
450
|
s.icon || s.imgUrl ? (u(), g("span", mr, [
|
|
@@ -463,7 +483,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
463
483
|
},
|
|
464
484
|
emits: ["update:modelValue"],
|
|
465
485
|
setup(e, { emit: l }) {
|
|
466
|
-
const t = e, n = l, a = `radio-${Math.floor(Math.random() * 1e4)}`, o =
|
|
486
|
+
const t = e, n = l, a = `radio-${Math.floor(Math.random() * 1e4)}`, o = k({
|
|
467
487
|
get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
|
|
468
488
|
set: (s) => {
|
|
469
489
|
if (Array.isArray(t.modelValue)) {
|
|
@@ -500,7 +520,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
500
520
|
}, br = {
|
|
501
521
|
key: 0,
|
|
502
522
|
class: "text-red-500 text-[14px]"
|
|
503
|
-
}, xr = ["title"], wr = ["disabled"],
|
|
523
|
+
}, xr = ["title"], wr = ["disabled"], Dn = /* @__PURE__ */ oe({
|
|
504
524
|
__name: "vs-input-switcher",
|
|
505
525
|
props: /* @__PURE__ */ Ve({
|
|
506
526
|
rules: { default: () => [] },
|
|
@@ -576,7 +596,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
576
596
|
innerHTML: l.html ? l.html : l.text
|
|
577
597
|
}, null, 10, kr));
|
|
578
598
|
}
|
|
579
|
-
}), _r = ["placeholder", "disabled", "name"],
|
|
599
|
+
}), _r = ["placeholder", "disabled", "name"], An = /* @__PURE__ */ oe({
|
|
580
600
|
__name: "vs-input-mask",
|
|
581
601
|
props: /* @__PURE__ */ Ve({
|
|
582
602
|
name: {},
|
|
@@ -605,13 +625,13 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
605
625
|
"*": /[a-zA-Z0-9]/
|
|
606
626
|
}, m = /* @__PURE__ */ new Set();
|
|
607
627
|
let y = !1;
|
|
608
|
-
for (let
|
|
609
|
-
const x = s[
|
|
628
|
+
for (let F = 0; F < s.length; F += 1) {
|
|
629
|
+
const x = s[F];
|
|
610
630
|
x === "{" ? y = !0 : x === "}" ? y = !1 : y && m.add(x);
|
|
611
631
|
}
|
|
612
632
|
const $ = {};
|
|
613
|
-
return Object.keys(d).forEach((
|
|
614
|
-
m.has(
|
|
633
|
+
return Object.keys(d).forEach((F) => {
|
|
634
|
+
m.has(F) || ($[F] = d[F]);
|
|
615
635
|
}), {
|
|
616
636
|
mask: s,
|
|
617
637
|
definitions: $,
|
|
@@ -649,7 +669,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
649
669
|
}
|
|
650
670
|
}, null, 10, _r));
|
|
651
671
|
}
|
|
652
|
-
}), $r = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer" }, Sr = ["placeholder", "disabled"],
|
|
672
|
+
}), $r = { class: "relative w-full bg-white rounded-lg" }, Cr = { class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer" }, Sr = ["placeholder", "disabled"], Fn = /* @__PURE__ */ oe({
|
|
653
673
|
__name: "vs-input-email",
|
|
654
674
|
props: /* @__PURE__ */ Ve({
|
|
655
675
|
style: { default: () => ({}) },
|
|
@@ -686,7 +706,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
686
706
|
])
|
|
687
707
|
]));
|
|
688
708
|
}
|
|
689
|
-
}), Vr = { class: "relative w-full bg-white rounded-lg" }, Mr = { class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer" }, Lr = ["value", "placeholder", "disabled"],
|
|
709
|
+
}), Vr = { class: "relative w-full bg-white rounded-lg" }, Mr = { class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer" }, Lr = ["value", "placeholder", "disabled"], In = /* @__PURE__ */ oe({
|
|
690
710
|
__name: "vs-input-tel",
|
|
691
711
|
props: /* @__PURE__ */ Ve({
|
|
692
712
|
style: { default: () => ({}) },
|
|
@@ -704,7 +724,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
704
724
|
}),
|
|
705
725
|
emits: ["update:modelValue"],
|
|
706
726
|
setup(e) {
|
|
707
|
-
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a =
|
|
727
|
+
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a = k(() => n.value ? n.value.startsWith("+") ? n.value.slice(1) : n.value : ""), o = (s) => {
|
|
708
728
|
let { value: d } = s.target;
|
|
709
729
|
d = d.replace(/^\+/, ""), n.value = d ? `+${d}` : "";
|
|
710
730
|
}, r = (s) => {
|
|
@@ -754,7 +774,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
754
774
|
}),
|
|
755
775
|
emits: ["update:modelValue"],
|
|
756
776
|
setup(e) {
|
|
757
|
-
const l = e, t = Ae(e, "modelValue"), n =
|
|
777
|
+
const l = e, t = Ae(e, "modelValue"), n = k(() => !!l.disabled);
|
|
758
778
|
return (a, o) => (u(), g("label", {
|
|
759
779
|
class: X(["flex items-center gap-0", [l.customClass, n.value ? "cursor-not-allowed opacity-60" : ""]])
|
|
760
780
|
}, [
|
|
@@ -765,7 +785,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
765
785
|
disabled: n.value,
|
|
766
786
|
class: "hidden"
|
|
767
787
|
}, null, 8, Dr), [
|
|
768
|
-
[
|
|
788
|
+
[$n, t.value]
|
|
769
789
|
]),
|
|
770
790
|
c("span", {
|
|
771
791
|
class: X(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
@@ -801,7 +821,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
801
821
|
}),
|
|
802
822
|
emits: ["update:modelValue"],
|
|
803
823
|
setup(e) {
|
|
804
|
-
const l = e, t = Ae(e, "modelValue"), n =
|
|
824
|
+
const l = e, t = Ae(e, "modelValue"), n = k(() => !!l.disabled);
|
|
805
825
|
return (a, o) => (u(), g("label", {
|
|
806
826
|
class: X(["flex items-center border rounded-lg px-2 py-1", [
|
|
807
827
|
t.value == l.value ? `ring-2 ring-ring ring-${l.style?.primaryColor || "blue"}-500` : "",
|
|
@@ -816,7 +836,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
816
836
|
disabled: n.value,
|
|
817
837
|
class: "hidden"
|
|
818
838
|
}, null, 8, Ir), [
|
|
819
|
-
[
|
|
839
|
+
[$n, t.value]
|
|
820
840
|
]),
|
|
821
841
|
c("span", Er, re(l.text), 1)
|
|
822
842
|
], 2));
|
|
@@ -845,7 +865,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
845
865
|
}),
|
|
846
866
|
emits: ["update:modelValue"],
|
|
847
867
|
setup(e) {
|
|
848
|
-
const l = e, t = Ae(e, "modelValue"), n =
|
|
868
|
+
const l = e, t = Ae(e, "modelValue"), n = k(() => Tr[`vs-input-radio-${l.view}`]);
|
|
849
869
|
return (a, o) => (u(), g("div", {
|
|
850
870
|
class: X([a.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
851
871
|
}, [
|
|
@@ -888,43 +908,43 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
888
908
|
},
|
|
889
909
|
emits: ["update:modelValue"],
|
|
890
910
|
setup(e, { emit: l }) {
|
|
891
|
-
const t = e, n = l, a = D([]), o =
|
|
911
|
+
const t = e, n = l, a = D([]), o = Cn({}), r = (x) => x?.value || x?.id || x?.text || x, s = (x) => x.text || String(x), d = (x) => `lg:col-span-${x || 12}`, m = k(() => [
|
|
892
912
|
t.position === "vertical" ? "flex flex-col" : "",
|
|
893
913
|
t.colSpan ? "grid" : "flex justify-start"
|
|
894
|
-
]), y = (x) => x == null || x === "" ? null : typeof x == "string" || typeof x == "number" ? x : String(x), $ =
|
|
914
|
+
]), y = (x) => x == null || x === "" ? null : typeof x == "string" || typeof x == "number" ? x : String(x), $ = k(() => {
|
|
895
915
|
if (!t.group)
|
|
896
916
|
return [];
|
|
897
917
|
const x = /* @__PURE__ */ new Map();
|
|
898
|
-
a.value.forEach((
|
|
899
|
-
const M =
|
|
900
|
-
x.has(C) || x.set(C, []), x.get(C)?.push(
|
|
918
|
+
a.value.forEach((_) => {
|
|
919
|
+
const M = _[t.group], C = y(M);
|
|
920
|
+
x.has(C) || x.set(C, []), x.get(C)?.push(_);
|
|
901
921
|
});
|
|
902
922
|
const v = [];
|
|
903
|
-
t.values?.length && t.values.forEach((
|
|
904
|
-
const M = y(
|
|
923
|
+
t.values?.length && t.values.forEach((_) => {
|
|
924
|
+
const M = y(_);
|
|
905
925
|
v.push(M);
|
|
906
926
|
});
|
|
907
|
-
const p = /* @__PURE__ */ new Set(), h = (
|
|
908
|
-
const M = x.get(
|
|
927
|
+
const p = /* @__PURE__ */ new Set(), h = (_) => {
|
|
928
|
+
const M = x.get(_) || [];
|
|
909
929
|
if (!M.length)
|
|
910
930
|
return null;
|
|
911
|
-
const C =
|
|
912
|
-
return p.add(
|
|
931
|
+
const C = _ === null ? "group-null" : `group-${String(_)}`, S = _ === null ? Or : String(_);
|
|
932
|
+
return p.add(_), {
|
|
913
933
|
key: C,
|
|
914
934
|
label: S,
|
|
915
935
|
options: M
|
|
916
936
|
};
|
|
917
937
|
}, w = [];
|
|
918
|
-
return v.forEach((
|
|
919
|
-
const M = h(
|
|
938
|
+
return v.forEach((_) => {
|
|
939
|
+
const M = h(_);
|
|
920
940
|
M && w.push(M);
|
|
921
|
-
}), x.forEach((
|
|
941
|
+
}), x.forEach((_, M) => {
|
|
922
942
|
if (p.has(M))
|
|
923
943
|
return;
|
|
924
944
|
const C = h(M);
|
|
925
945
|
C && w.push(C);
|
|
926
946
|
}), w;
|
|
927
|
-
}),
|
|
947
|
+
}), F = async () => {
|
|
928
948
|
try {
|
|
929
949
|
const x = await fetch(`/api/suggest/${t.data}`).then((v) => v.json());
|
|
930
950
|
a.value = x?.data || x;
|
|
@@ -962,7 +982,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
962
982
|
{ deep: !0 }
|
|
963
983
|
), Ze(() => {
|
|
964
984
|
if (t.data)
|
|
965
|
-
|
|
985
|
+
F().then(() => {
|
|
966
986
|
if (typeof t.modelValue == "boolean" && a.value.length === 1) {
|
|
967
987
|
const x = r(a.value[0]);
|
|
968
988
|
o[x] = t.modelValue;
|
|
@@ -1056,13 +1076,13 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1056
1076
|
function n(y) {
|
|
1057
1077
|
return y ? t.mode === "datetime" ? (y.includes("T") ? y : null) || y + (y.includes(" ") ? "" : "T00:00") : y?.split(" ")[0] : null;
|
|
1058
1078
|
}
|
|
1059
|
-
const { inputClass: a } = tt(t.style), o = l, r =
|
|
1079
|
+
const { inputClass: a } = tt(t.style), o = l, r = k({
|
|
1060
1080
|
get: () => n(t.modelValue),
|
|
1061
1081
|
set: (y) => o("update:modelValue", y)
|
|
1062
|
-
}), s =
|
|
1082
|
+
}), s = k(() => t.mode === "datetime" ? "datetime-local" : t.mode), d = k(() => !!t.disabled), m = k(() => t.placeholder ?? "");
|
|
1063
1083
|
return (y, $) => ke((u(), g("input", {
|
|
1064
1084
|
type: s.value,
|
|
1065
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
1085
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => r.value = F),
|
|
1066
1086
|
placeholder: m.value,
|
|
1067
1087
|
disabled: d.value,
|
|
1068
1088
|
ref: "date",
|
|
@@ -1071,7 +1091,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1071
1091
|
border: "1px solid #CFD9E0"
|
|
1072
1092
|
}
|
|
1073
1093
|
}, null, 10, Ur)), [
|
|
1074
|
-
[
|
|
1094
|
+
[ma, r.value]
|
|
1075
1095
|
]);
|
|
1076
1096
|
}
|
|
1077
1097
|
}), Hr = (e, l) => {
|
|
@@ -1160,7 +1180,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1160
1180
|
}),
|
|
1161
1181
|
emits: ["update:value", "update:item"],
|
|
1162
1182
|
setup(e) {
|
|
1163
|
-
const l = Ae(e, "value"), t = Ae(e, "item"), n = e, a =
|
|
1183
|
+
const l = Ae(e, "value"), t = Ae(e, "item"), n = e, a = k(() => t.value ? typeof t.value == "string" ? t.value : t.value.file_path : ""), o = (s) => typeof s == "string" ? s : s?.file_path || "", r = () => {
|
|
1164
1184
|
const s = a.value;
|
|
1165
1185
|
qr(s), n.multiple && Array.isArray(l.value) ? l.value = l.value.filter((d) => o(d) !== s) : l.value = "";
|
|
1166
1186
|
};
|
|
@@ -1224,13 +1244,13 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1224
1244
|
}),
|
|
1225
1245
|
emits: /* @__PURE__ */ Ve(["change"], ["update:modelValue"]),
|
|
1226
1246
|
setup(e, { emit: l }) {
|
|
1227
|
-
const t = e, n = Ae(e, "modelValue"), a = l, o = D(null), r = D(!1), s = it("values"), d =
|
|
1247
|
+
const t = e, n = Ae(e, "modelValue"), a = l, o = D(null), r = D(!1), s = it("values"), d = k(() => t.format ? t.format.split(",").map((w) => w.trim().toLowerCase()).filter(Boolean) : []), m = (w) => {
|
|
1228
1248
|
if (t.max_size && w.size > t.max_size * 1024 * 1024) {
|
|
1229
|
-
const
|
|
1249
|
+
const _ = (w.size / 1048576).toFixed(2);
|
|
1230
1250
|
return $e({
|
|
1231
1251
|
type: "error",
|
|
1232
1252
|
title: "Помилка!",
|
|
1233
|
-
message: `Файл "${w.name}" занадто великий. Максимальний розмір: ${t.max_size} МБ, розмір файлу: ${
|
|
1253
|
+
message: `Файл "${w.name}" занадто великий. Максимальний розмір: ${t.max_size} МБ, розмір файлу: ${_} МБ`,
|
|
1234
1254
|
position: "right-bottom"
|
|
1235
1255
|
}), !1;
|
|
1236
1256
|
}
|
|
@@ -1238,17 +1258,17 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1238
1258
|
}, y = (w) => {
|
|
1239
1259
|
if (!d.value.length)
|
|
1240
1260
|
return !0;
|
|
1241
|
-
const
|
|
1261
|
+
const _ = `.${w.name.split(".").pop()?.toLowerCase() || ""}`, M = d.value.includes(_);
|
|
1242
1262
|
return M || $e({
|
|
1243
1263
|
type: "error",
|
|
1244
1264
|
title: "Помилка!",
|
|
1245
1265
|
message: `Неприпустимий формат файлу "${w.name}". Дозволені формати: ${d.value.join(", ")}`,
|
|
1246
1266
|
position: "right-bottom"
|
|
1247
1267
|
}), M;
|
|
1248
|
-
}, $ =
|
|
1249
|
-
const w = {},
|
|
1268
|
+
}, $ = k(() => {
|
|
1269
|
+
const w = {}, _ = [];
|
|
1250
1270
|
if (!t.customParams?.length)
|
|
1251
|
-
return { params: w, missingSources:
|
|
1271
|
+
return { params: w, missingSources: _ };
|
|
1252
1272
|
const M = s?.value ?? {};
|
|
1253
1273
|
return t.customParams.forEach((C) => {
|
|
1254
1274
|
if (!C) return;
|
|
@@ -1256,12 +1276,12 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1256
1276
|
if (!A || !z) return;
|
|
1257
1277
|
const W = M[z];
|
|
1258
1278
|
if (W == null || W === "") {
|
|
1259
|
-
|
|
1279
|
+
_.push(z);
|
|
1260
1280
|
return;
|
|
1261
1281
|
}
|
|
1262
1282
|
w[A] = W;
|
|
1263
|
-
}), { params: w, missingSources:
|
|
1264
|
-
}),
|
|
1283
|
+
}), { params: w, missingSources: _ };
|
|
1284
|
+
}), F = () => {
|
|
1265
1285
|
const { params: w } = $.value;
|
|
1266
1286
|
return {
|
|
1267
1287
|
api: t.api,
|
|
@@ -1270,11 +1290,11 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1270
1290
|
}, x = () => {
|
|
1271
1291
|
const w = $.value.missingSources;
|
|
1272
1292
|
if (!w.length) return !0;
|
|
1273
|
-
const
|
|
1293
|
+
const _ = w.join(", ");
|
|
1274
1294
|
return $e({
|
|
1275
1295
|
type: "warning",
|
|
1276
1296
|
title: "Заповніть поля",
|
|
1277
|
-
message: `Поля (${
|
|
1297
|
+
message: `Поля (${_}) необхідні для завантаження файлу`,
|
|
1278
1298
|
position: "right-bottom"
|
|
1279
1299
|
}), !1;
|
|
1280
1300
|
}, v = (w) => {
|
|
@@ -1287,13 +1307,13 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1287
1307
|
}, p = () => {
|
|
1288
1308
|
t.disabled || r.value || x() && o.value?.click();
|
|
1289
1309
|
}, h = async (w) => {
|
|
1290
|
-
const { files:
|
|
1291
|
-
if (!
|
|
1310
|
+
const { files: _ } = w.target;
|
|
1311
|
+
if (!_ || _.length === 0) return;
|
|
1292
1312
|
if (!x()) {
|
|
1293
1313
|
o.value && (o.value.value = "");
|
|
1294
1314
|
return;
|
|
1295
1315
|
}
|
|
1296
|
-
const M = Array.from(
|
|
1316
|
+
const M = Array.from(_);
|
|
1297
1317
|
if (t.max_size && M.filter((B) => !m(B)).length > 0) {
|
|
1298
1318
|
o.value && (o.value.value = "");
|
|
1299
1319
|
return;
|
|
@@ -1305,7 +1325,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1305
1325
|
r.value = !0;
|
|
1306
1326
|
try {
|
|
1307
1327
|
if (t.multiple) {
|
|
1308
|
-
const S = Array.from(
|
|
1328
|
+
const S = Array.from(_).map(async (W) => await dn(W, F())), B = await Promise.all(S), A = B.filter((W) => W?.file_path);
|
|
1309
1329
|
if (A.length === 0) {
|
|
1310
1330
|
v();
|
|
1311
1331
|
return;
|
|
@@ -1317,7 +1337,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1317
1337
|
}));
|
|
1318
1338
|
n.value = [...n.value || [], ...z], a("change", n.value);
|
|
1319
1339
|
} else {
|
|
1320
|
-
const S =
|
|
1340
|
+
const S = _[0], B = await dn(S, F());
|
|
1321
1341
|
if (!B?.file_path) {
|
|
1322
1342
|
v();
|
|
1323
1343
|
return;
|
|
@@ -1331,7 +1351,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1331
1351
|
r.value = !1, o.value && (o.value.value = "");
|
|
1332
1352
|
}
|
|
1333
1353
|
};
|
|
1334
|
-
return (w,
|
|
1354
|
+
return (w, _) => (u(), g("div", Jr, [
|
|
1335
1355
|
c("input", {
|
|
1336
1356
|
class: "hidden",
|
|
1337
1357
|
ref_key: "fileInput",
|
|
@@ -1346,13 +1366,13 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1346
1366
|
key: 0,
|
|
1347
1367
|
item: n.value,
|
|
1348
1368
|
value: n.value,
|
|
1349
|
-
"onUpdate:value":
|
|
1369
|
+
"onUpdate:value": _[0] || (_[0] = (M) => n.value = M)
|
|
1350
1370
|
}, null, 8, ["item", "value"])) : w.multiple ? (u(), g("div", Qr, [
|
|
1351
1371
|
(u(!0), g(be, null, Ce(n.value, (M, C) => (u(), ge(Nl, {
|
|
1352
1372
|
multiple: w.multiple,
|
|
1353
1373
|
key: C,
|
|
1354
1374
|
value: n.value,
|
|
1355
|
-
"onUpdate:value":
|
|
1375
|
+
"onUpdate:value": _[1] || (_[1] = (S) => n.value = S),
|
|
1356
1376
|
item: M
|
|
1357
1377
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1358
1378
|
c("div", {
|
|
@@ -1413,7 +1433,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1413
1433
|
}),
|
|
1414
1434
|
emits: ["update:modelValue"],
|
|
1415
1435
|
setup(e) {
|
|
1416
|
-
const l = e, t = Ae(e, "modelValue"), n = D(null), a = D(null), o = D(""), r = D(0), s = D(!1), d = D(""), m = D(null), y = it("values"), $ =
|
|
1436
|
+
const l = e, t = Ae(e, "modelValue"), n = D(null), a = D(null), o = D(""), r = D(0), s = D(!1), d = D(""), m = D(null), y = it("values"), $ = k(() => l.format ? l.format.split(",").map((G) => G.trim().toLowerCase()).filter(Boolean) : []), F = k(() => !a.value || !a.value.size ? 0 : Math.min(100, Math.round(r.value / a.value.size * 100))), x = k(() => a.value ? `${h(r.value)} / ${h(a.value.size)}` : ""), v = k(() => l.disabled ? "opacity-50 cursor-not-allowed" : s.value ? "cursor-default text-blue-500" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500"), p = () => {
|
|
1417
1437
|
l.disabled || s.value || C() && n.value?.click();
|
|
1418
1438
|
}, h = (G) => {
|
|
1419
1439
|
if (!Number.isFinite(G)) return "0 B";
|
|
@@ -1431,7 +1451,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1431
1451
|
message: `Максимальний розмір ${l.max_size} МБ`,
|
|
1432
1452
|
position: "right-bottom"
|
|
1433
1453
|
}), !1) : !0;
|
|
1434
|
-
},
|
|
1454
|
+
}, _ = (G) => {
|
|
1435
1455
|
if (!$.value.length) return !0;
|
|
1436
1456
|
const Z = `.${G.name.split(".").pop()?.toLowerCase() || ""}`;
|
|
1437
1457
|
return $.value.includes(Z) ? !0 : ($e({
|
|
@@ -1440,7 +1460,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1440
1460
|
message: `Дозволені формати: ${$.value.join(", ")}`,
|
|
1441
1461
|
position: "right-bottom"
|
|
1442
1462
|
}), !1);
|
|
1443
|
-
}, M =
|
|
1463
|
+
}, M = k(() => {
|
|
1444
1464
|
const G = {}, Z = [];
|
|
1445
1465
|
if (!l.customParams?.length) return { params: G, missing: Z };
|
|
1446
1466
|
const te = y?.value ?? {};
|
|
@@ -1463,7 +1483,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1463
1483
|
Z.value = "";
|
|
1464
1484
|
return;
|
|
1465
1485
|
}
|
|
1466
|
-
if (!w(te) || !
|
|
1486
|
+
if (!w(te) || !_(te)) {
|
|
1467
1487
|
Z.value = "";
|
|
1468
1488
|
return;
|
|
1469
1489
|
}
|
|
@@ -1569,7 +1589,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1569
1589
|
}, [
|
|
1570
1590
|
s.value ? (u(), g("div", so, [
|
|
1571
1591
|
Z[2] || (Z[2] = c("div", { class: "loader" }, null, -1)),
|
|
1572
|
-
c("span", null, re(
|
|
1592
|
+
c("span", null, re(F.value) + "%", 1)
|
|
1573
1593
|
])) : (u(), ge(N(ht), {
|
|
1574
1594
|
key: 1,
|
|
1575
1595
|
class: "h-4 w-4"
|
|
@@ -1587,7 +1607,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1587
1607
|
c("div", vo, [
|
|
1588
1608
|
c("div", {
|
|
1589
1609
|
class: "h-full rounded-full bg-blue-500 transition-all duration-300",
|
|
1590
|
-
style: Te({ width: `${
|
|
1610
|
+
style: Te({ width: `${F.value}%` })
|
|
1591
1611
|
}, null, 4)
|
|
1592
1612
|
]),
|
|
1593
1613
|
c("div", go, [
|
|
@@ -1625,7 +1645,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1625
1645
|
item: { default: null }
|
|
1626
1646
|
},
|
|
1627
1647
|
setup(e) {
|
|
1628
|
-
const l = e, t =
|
|
1648
|
+
const l = e, t = k(() => {
|
|
1629
1649
|
try {
|
|
1630
1650
|
return new Date(l.item.cdate).toLocaleDateString("uk-UA", {
|
|
1631
1651
|
day: "2-digit",
|
|
@@ -1718,7 +1738,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1718
1738
|
y.item.ext === "jpg" || y.item.ext === "png" ? (u(), g("div", So, [
|
|
1719
1739
|
c("div", {
|
|
1720
1740
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1721
|
-
onClick: $[0] || ($[0] = (
|
|
1741
|
+
onClick: $[0] || ($[0] = (F) => m(y.index))
|
|
1722
1742
|
}, [
|
|
1723
1743
|
H(ul, { item: y.item }, null, 8, ["item"])
|
|
1724
1744
|
])
|
|
@@ -1740,7 +1760,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1740
1760
|
c("div", Io, [
|
|
1741
1761
|
c("button", {
|
|
1742
1762
|
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",
|
|
1743
|
-
onClick: $[1] || ($[1] = (
|
|
1763
|
+
onClick: $[1] || ($[1] = (F) => r(y.item))
|
|
1744
1764
|
}, [
|
|
1745
1765
|
H(N(ql), { class: "h-4 w-4" })
|
|
1746
1766
|
])
|
|
@@ -1750,7 +1770,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1750
1770
|
c("button", {
|
|
1751
1771
|
type: "button",
|
|
1752
1772
|
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",
|
|
1753
|
-
onClick: $[2] || ($[2] = (
|
|
1773
|
+
onClick: $[2] || ($[2] = (F) => d())
|
|
1754
1774
|
}, [
|
|
1755
1775
|
H(N(Rt), { class: "h-4 w-4" })
|
|
1756
1776
|
])
|
|
@@ -1782,8 +1802,8 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1782
1802
|
},
|
|
1783
1803
|
emits: ["update"],
|
|
1784
1804
|
setup(e, { emit: l }) {
|
|
1785
|
-
const t = e, n = it("form"), a =
|
|
1786
|
-
const C =
|
|
1805
|
+
const t = e, n = it("form"), a = k(() => n.value.formId), o = D(!1), r = D(0), s = l, d = D(!1), m = D({}), y = D([]), $ = D(""), F = k(() => Array.isArray(y.value) ? y.value.filter((M) => M.ext === "jpg" || M.ext === "png").map((M) => M?.file_path) : []), x = k(() => $.value === "" ? y.value : y.value.filter((M) => M?.uploaded_name?.includes($.value))), v = (M) => {
|
|
1806
|
+
const C = F.value.findIndex((S) => S === M.item.file_path);
|
|
1787
1807
|
C !== -1 && (o.value = !0, r.value = C);
|
|
1788
1808
|
}, p = async () => {
|
|
1789
1809
|
try {
|
|
@@ -1820,7 +1840,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1820
1840
|
}), M.updateListOnConfirm && (C.confirm = async () => {
|
|
1821
1841
|
await M.confirm(), d.value = !1, p();
|
|
1822
1842
|
}), C;
|
|
1823
|
-
},
|
|
1843
|
+
}, _ = (M) => {
|
|
1824
1844
|
m.value = w(M), d.value = !0;
|
|
1825
1845
|
};
|
|
1826
1846
|
return ce(a, (M) => {
|
|
@@ -1840,7 +1860,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1840
1860
|
onChange: C[0] || (C[0] = (A) => h(A))
|
|
1841
1861
|
}, null, 32),
|
|
1842
1862
|
c("div", Ro, [
|
|
1843
|
-
H(N(
|
|
1863
|
+
H(N(Sn), { class: "h-4 w-4" })
|
|
1844
1864
|
])
|
|
1845
1865
|
])
|
|
1846
1866
|
])
|
|
@@ -1874,7 +1894,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1874
1894
|
item: A,
|
|
1875
1895
|
index: z,
|
|
1876
1896
|
onUpdate: C[2] || (C[2] = (W) => M.$emit("update", "file-list")),
|
|
1877
|
-
onOpenModal: C[3] || (C[3] = (W) =>
|
|
1897
|
+
onOpenModal: C[3] || (C[3] = (W) => _(W)),
|
|
1878
1898
|
onOpenLightbox: C[4] || (C[4] = (W) => v(W))
|
|
1879
1899
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1880
1900
|
x.value.length ? j("", !0) : (u(), g("div", qo, C[8] || (C[8] = [
|
|
@@ -1886,7 +1906,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1886
1906
|
"onUpdate:modelValue": C[5] || (C[5] = (A) => o.value = A),
|
|
1887
1907
|
startIndex: r.value,
|
|
1888
1908
|
"onUpdate:index": C[6] || (C[6] = (A) => r.value = A),
|
|
1889
|
-
images:
|
|
1909
|
+
images: F.value
|
|
1890
1910
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1891
1911
|
H(B, At({
|
|
1892
1912
|
modelValue: d.value,
|
|
@@ -1922,7 +1942,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
1922
1942
|
), (n, a) => (u(), g("div", null, [
|
|
1923
1943
|
c("div", Ko, [
|
|
1924
1944
|
c("p", Wo, re(e.title), 1),
|
|
1925
|
-
H(
|
|
1945
|
+
H(Dn, {
|
|
1926
1946
|
modelValue: t.value,
|
|
1927
1947
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => t.value = o),
|
|
1928
1948
|
style: Te(e.style)
|
|
@@ -2023,7 +2043,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2023
2043
|
Contain: "*",
|
|
2024
2044
|
In: "in",
|
|
2025
2045
|
NotIn: "not_in"
|
|
2026
|
-
}, rs = (e, l) => String(e) === String(l), os = (e, l) => String(e) !== String(l), ss = (e, l) => e > l, is = (e, l) => e >= l, us = (e, l) => e < l, ds = (e, l) => e <= l, cs = (e, l) => Array.isArray(l) && l.length === 2 ? e >= l[0] && e <= l[1] : !1, fs = (e, l) => String(e).startsWith(String(l)), ps = (e, l) => String(e).endsWith(String(l)), ms = (e, l) => String(e).includes(String(l)), vs = (e, l) => Array.isArray(l) ? l.includes(e) : !1, gs = (e, l) => Array.isArray(l) ? !l.includes(e) : !0,
|
|
2046
|
+
}, rs = (e, l) => String(e) === String(l), os = (e, l) => String(e) !== String(l), ss = (e, l) => e > l, is = (e, l) => e >= l, us = (e, l) => e < l, ds = (e, l) => e <= l, cs = (e, l) => Array.isArray(l) && l.length === 2 ? e >= l[0] && e <= l[1] : !1, fs = (e, l) => String(e).startsWith(String(l)), ps = (e, l) => String(e).endsWith(String(l)), ms = (e, l) => String(e).includes(String(l)), vs = (e, l) => Array.isArray(l) ? l.includes(e) : !1, gs = (e, l) => Array.isArray(l) ? !l.includes(e) : !0, En = (e, l) => {
|
|
2027
2047
|
if (!l) return !0;
|
|
2028
2048
|
switch (l?.[1]) {
|
|
2029
2049
|
case ct.Equal:
|
|
@@ -2078,12 +2098,12 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2078
2098
|
}
|
|
2079
2099
|
},
|
|
2080
2100
|
setup(e) {
|
|
2081
|
-
const l = e, t = it("values", D({})), n = it("form"), a =
|
|
2101
|
+
const l = e, t = it("values", D({})), n = it("form"), a = k(() => l.schema?.filter((s) => {
|
|
2082
2102
|
const d = s?.conditions;
|
|
2083
2103
|
if (!d) return !0;
|
|
2084
2104
|
const m = Array.isArray(d) ? d[0] : d, y = l.name ? t.value?.[l.name]?.[m] ?? t.value?.[m] : t.value?.[m];
|
|
2085
|
-
return
|
|
2086
|
-
})), o =
|
|
2105
|
+
return En(y, d);
|
|
2106
|
+
})), o = k(() => as[l.view]), r = k(() => {
|
|
2087
2107
|
if (t.value || (t.value = {}), !l.name) return t.value;
|
|
2088
2108
|
const s = t.value[l.name];
|
|
2089
2109
|
if (s) return s;
|
|
@@ -2099,7 +2119,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2099
2119
|
style: Te(e.style)
|
|
2100
2120
|
}, {
|
|
2101
2121
|
default: et(() => [
|
|
2102
|
-
(u(!0), g(be, null, Ce(a.value, (m) => (u(), ge(
|
|
2122
|
+
(u(!0), g(be, null, Ce(a.value, (m) => (u(), ge(On, At({
|
|
2103
2123
|
key: m.name
|
|
2104
2124
|
}, { ref_for: !0 }, m, {
|
|
2105
2125
|
item: m,
|
|
@@ -2159,20 +2179,20 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2159
2179
|
},
|
|
2160
2180
|
emits: ["change", "update:modelValue", "value-selected"],
|
|
2161
2181
|
setup(e, { emit: l }) {
|
|
2162
|
-
const t = e, n = l, a =
|
|
2182
|
+
const t = e, n = l, a = k(() => t.multiple), o = k(() => t.disabled);
|
|
2163
2183
|
tt(t.style);
|
|
2164
|
-
const r =
|
|
2184
|
+
const r = k({
|
|
2165
2185
|
get: () => t.modelValue,
|
|
2166
2186
|
set: (E) => n("update:modelValue", E)
|
|
2167
2187
|
});
|
|
2168
2188
|
!r.value && t.defaultValue && (r.value = t.defaultValue);
|
|
2169
|
-
const s = D(null), d = D(null), m = D(null), y = D(null), $ = D(!1),
|
|
2189
|
+
const s = D(null), d = D(null), m = D(null), y = D(null), $ = D(!1), F = D(!1), x = D(null), v = D([]), p = D(-1), h = D([]), w = D(""), _ = D(null), M = D("bottom"), C = D({}), S = D([]), B = k(() => {
|
|
2170
2190
|
if (!S.value.length) return [];
|
|
2171
2191
|
const E = v.value, K = new Map(E.map((U) => [U.id?.toString(), U]));
|
|
2172
2192
|
return S.value.map((U) => K.get(U?.toString())).filter((U) => !!U);
|
|
2173
|
-
}), A =
|
|
2174
|
-
|
|
2175
|
-
const W =
|
|
2193
|
+
}), A = k(() => t.placeholder || "Select..."), z = k(() => ue(x.value));
|
|
2194
|
+
k(() => a.value ? !S.value.length && w.value === "" : !z.value && w.value === "");
|
|
2195
|
+
const W = k(() => o.value ? !1 : a.value ? S.value.length > 0 : !!r.value), Q = (E) => a.value ? S.value.some((K) => K?.toString() === E?.toString()) : r.value?.toString() === E?.toString(), Y = k(() => {
|
|
2176
2196
|
let E = v.value ?? [];
|
|
2177
2197
|
if (!t.data && w.value.trim() !== "") {
|
|
2178
2198
|
const K = w.value.toLowerCase();
|
|
@@ -2186,7 +2206,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2186
2206
|
E = E.filter((U) => !K.has(U.id?.toString()));
|
|
2187
2207
|
}
|
|
2188
2208
|
return E;
|
|
2189
|
-
}), G = it("values"), Z = it("field-props"), te = /\{\{\s*([^}]+?)\s*\}\}/g, J = (E) => (E ? String(E) : "").replace(/<[^>]*>/g, "").trim(), P =
|
|
2209
|
+
}), G = it("values"), Z = it("field-props"), te = /\{\{\s*([^}]+?)\s*\}\}/g, J = (E) => (E ? String(E) : "").replace(/<[^>]*>/g, "").trim(), P = k(() => t.slot ?? t?.optionTemplate ?? ""), ae = (E) => {
|
|
2190
2210
|
if (!E) return "";
|
|
2191
2211
|
const K = P.value;
|
|
2192
2212
|
return K ? K.replace(te, (U, me) => {
|
|
@@ -2222,7 +2242,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2222
2242
|
const [Ie, ...He] = Se;
|
|
2223
2243
|
He.length && se(Ie, He, Le ?? null) || K && (K[Ie] = Le ?? null);
|
|
2224
2244
|
});
|
|
2225
|
-
}, xe =
|
|
2245
|
+
}, xe = k(() => t.parent ? G?.value?.[t.parent]?.toString() ?? null : null), he = async (E) => {
|
|
2226
2246
|
if (!t.data) {
|
|
2227
2247
|
let K = t.options ?? [];
|
|
2228
2248
|
if (E?.trim()) {
|
|
@@ -2276,11 +2296,11 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2276
2296
|
});
|
|
2277
2297
|
}, xt = async () => {
|
|
2278
2298
|
o.value || ($.value = !0, await _e(), await Qe(() => {
|
|
2279
|
-
le(),
|
|
2299
|
+
le(), _.value?.focus();
|
|
2280
2300
|
}), pt());
|
|
2281
2301
|
}, Je = () => {
|
|
2282
2302
|
$.value = !1, p.value = -1, Qe(() => {
|
|
2283
|
-
|
|
2303
|
+
_.value?.blur();
|
|
2284
2304
|
});
|
|
2285
2305
|
}, Re = async (E) => {
|
|
2286
2306
|
if (o.value) return;
|
|
@@ -2294,9 +2314,9 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2294
2314
|
await xt();
|
|
2295
2315
|
}
|
|
2296
2316
|
}, ee = () => {
|
|
2297
|
-
a.value ? (S.value = [], r.value = [], n("change", []), pe(null, [])) : (x.value = null, r.value = null, n("change", null), pe(null, null)), de(null), w.value = "", Qe(() =>
|
|
2317
|
+
a.value ? (S.value = [], r.value = [], n("change", []), pe(null, [])) : (x.value = null, r.value = null, n("change", null), pe(null, null)), de(null), w.value = "", Qe(() => _.value?.focus());
|
|
2298
2318
|
}, ne = (E) => {
|
|
2299
|
-
a.value && (S.value = S.value.filter((K) => K?.toString() !== E?.toString()), r.value = [...S.value], n("change", r.value), pe(null), Qe(() =>
|
|
2319
|
+
a.value && (S.value = S.value.filter((K) => K?.toString() !== E?.toString()), r.value = [...S.value], n("change", r.value), pe(null), Qe(() => _.value?.focus()));
|
|
2300
2320
|
}, pe = (E, K) => {
|
|
2301
2321
|
const U = K ?? (a.value ? [...S.value] : E?.id ?? null);
|
|
2302
2322
|
n("value-selected", {
|
|
@@ -2306,7 +2326,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2306
2326
|
});
|
|
2307
2327
|
}, ye = (E) => {
|
|
2308
2328
|
a.value ? (Q(E.id) || (S.value = [...S.value, E.id], r.value = [...S.value], n("change", r.value), pe(E)), w.value = "", Qe(() => {
|
|
2309
|
-
|
|
2329
|
+
_.value?.focus(), p.value = Math.min(p.value, Y.value.length - 1);
|
|
2310
2330
|
}), de(null)) : (x.value = E, r.value = E.id, n("change", r.value), pe(E), w.value = "", Je(), de(E));
|
|
2311
2331
|
}, Be = (E) => {
|
|
2312
2332
|
if (Q(E.id)) {
|
|
@@ -2351,7 +2371,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2351
2371
|
transform: Oe ? "none" : "translateY(-100%)",
|
|
2352
2372
|
top: Oe ? `${E.bottom + Le}px` : `${E.top - Le}px`
|
|
2353
2373
|
};
|
|
2354
|
-
},
|
|
2374
|
+
}, I = async (E) => {
|
|
2355
2375
|
o.value || !$.value && (E.key === "ArrowDown" || E.key === "ArrowUp") && (E.preventDefault(), await xt());
|
|
2356
2376
|
}, q = (E) => {
|
|
2357
2377
|
if (!$.value) return;
|
|
@@ -2363,12 +2383,12 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2363
2383
|
else if (K === "Enter") {
|
|
2364
2384
|
E.preventDefault();
|
|
2365
2385
|
const U = Y.value[p.value];
|
|
2366
|
-
U && ye(U),
|
|
2386
|
+
U && ye(U), _.value?.blur();
|
|
2367
2387
|
} else K === "Escape" ? (E.preventDefault(), Je()) : K === "Backspace" ? a.value && w.value === "" && S.value.length && (S.value = S.value.slice(0, -1), r.value = [...S.value], n("change", r.value)) : K === "Home" ? (p.value = 0, Fe(h.value[0], m.value)) : K === "End" ? (p.value = Y.value.length - 1, Fe(h.value[p.value], m.value)) : K === "Tab" && Je();
|
|
2368
2388
|
}, Me = () => {
|
|
2369
|
-
o.value || (
|
|
2389
|
+
o.value || (F.value = !0);
|
|
2370
2390
|
}, ut = () => {
|
|
2371
|
-
|
|
2391
|
+
F.value = !1, w.value = "";
|
|
2372
2392
|
}, Xe = (E) => {
|
|
2373
2393
|
E.key === "Escape" && $.value && Je();
|
|
2374
2394
|
}, je = (E) => {
|
|
@@ -2518,9 +2538,9 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2518
2538
|
role: "combobox",
|
|
2519
2539
|
"aria-expanded": $.value,
|
|
2520
2540
|
"aria-haspopup": "listbox",
|
|
2521
|
-
onKeydown:
|
|
2541
|
+
onKeydown: I,
|
|
2522
2542
|
onClick: O,
|
|
2523
|
-
"data-focus": $.value ||
|
|
2543
|
+
"data-focus": $.value || F.value ? "true" : "false",
|
|
2524
2544
|
ref_key: "triggerRef",
|
|
2525
2545
|
ref: d
|
|
2526
2546
|
}, [
|
|
@@ -2575,7 +2595,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2575
2595
|
!o.value && E.search ? ke((u(), g("input", {
|
|
2576
2596
|
key: 0,
|
|
2577
2597
|
ref_key: "inputRef",
|
|
2578
|
-
ref:
|
|
2598
|
+
ref: _,
|
|
2579
2599
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",
|
|
2580
2600
|
autocapitalize: "none",
|
|
2581
2601
|
autocomplete: "off",
|
|
@@ -2624,7 +2644,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2624
2644
|
!o.value && E.search ? ke((u(), g("input", {
|
|
2625
2645
|
key: 0,
|
|
2626
2646
|
ref_key: "inputRef",
|
|
2627
|
-
ref:
|
|
2647
|
+
ref: _,
|
|
2628
2648
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900 hover:cursor-pointer",
|
|
2629
2649
|
autocapitalize: "none",
|
|
2630
2650
|
autocomplete: "off",
|
|
@@ -2765,7 +2785,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2765
2785
|
}),
|
|
2766
2786
|
emits: ["update:modelValue"],
|
|
2767
2787
|
setup(e) {
|
|
2768
|
-
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a =
|
|
2788
|
+
const l = e, { inputClass: t } = tt(l.style), n = Ae(e, "modelValue"), a = k(() => !!l.disabled), o = k(() => l.placeholder ?? "");
|
|
2769
2789
|
function r() {
|
|
2770
2790
|
typeof n.value == "string" && (n.value = n.value.trim());
|
|
2771
2791
|
}
|
|
@@ -2803,7 +2823,7 @@ const lr = ["placeholder", "disabled"], nr = /* @__PURE__ */ oe({
|
|
|
2803
2823
|
}),
|
|
2804
2824
|
emits: ["update:modelValue"],
|
|
2805
2825
|
setup(e) {
|
|
2806
|
-
const l =
|
|
2826
|
+
const l = va(() => import("./vs-richtext-IzSPyqFv.js")), t = e, { inputClass: n } = tt(t.style), a = Ae(e, "modelValue"), o = k(() => !!t.disabled), r = k(() => t.placeholder ?? ""), s = k(() => ({
|
|
2807
2827
|
height: "300px",
|
|
2808
2828
|
format: t.format,
|
|
2809
2829
|
...t.richtextProps
|
|
@@ -2874,8 +2894,8 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
2874
2894
|
}),
|
|
2875
2895
|
emits: ["update:modelValue"],
|
|
2876
2896
|
setup(e) {
|
|
2877
|
-
const l = e, t =
|
|
2878
|
-
const O = r.value ?? [], ee = d.value ? O.filter((ye) =>
|
|
2897
|
+
const l = e, t = ga(), n = (O) => l.actions === void 0 ? !0 : l.actions.includes(O), a = ["search", "import", "export", "add"], o = k(() => a.some((O) => n(O))), r = Ae(e, "modelValue"), s = D({}), d = D(""), m = D(null), y = D("asc"), $ = k(() => {
|
|
2898
|
+
const O = r.value ?? [], ee = d.value ? O.filter((ye) => F.value?.some((Be) => {
|
|
2879
2899
|
const Fe = Be.key || Be.name;
|
|
2880
2900
|
if (!Fe) return !1;
|
|
2881
2901
|
const T = ye[Fe];
|
|
@@ -2887,11 +2907,11 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
2887
2907
|
return typeof Fe == "number" && typeof T == "number" ? Fe - T : String(Fe).localeCompare(String(T));
|
|
2888
2908
|
});
|
|
2889
2909
|
return y.value === "asc" ? pe : pe.reverse();
|
|
2890
|
-
}),
|
|
2910
|
+
}), F = k(() => (l.colModel ?? []).filter((O) => !O.tableHidden)), x = D(null), v = D(null), p = D(null), h = (O) => {
|
|
2891
2911
|
x.value = O;
|
|
2892
2912
|
}, w = (O) => {
|
|
2893
2913
|
v.value = O;
|
|
2894
|
-
},
|
|
2914
|
+
}, _ = (O) => {
|
|
2895
2915
|
if (x.value === null || x.value === O) {
|
|
2896
2916
|
x.value = null, v.value = null;
|
|
2897
2917
|
return;
|
|
@@ -2972,7 +2992,7 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
2972
2992
|
);
|
|
2973
2993
|
const Z = D(""), te = D(!1);
|
|
2974
2994
|
let J = "edit", P = 0;
|
|
2975
|
-
const ae = (O) => (O?.format || O?.type || "").toString().toLowerCase(), ue =
|
|
2995
|
+
const ae = (O) => (O?.format || O?.type || "").toString().toLowerCase(), ue = k(() => l.colModel?.filter((O) => ae(O) !== "slot").map((O) => {
|
|
2976
2996
|
const { slot: ee, ...ne } = O;
|
|
2977
2997
|
return ne;
|
|
2978
2998
|
}) ?? []), ve = D({}), we = D({}), lt = (O) => typeof O != "string" ? !1 : !!t[O], qe = (O, ee) => ee ? ee.split(".").reduce((ne, pe) => ne == null ? ne : ne[pe.trim()], O) : O, se = (O, ee) => typeof O != "string" ? "" : O.replace(/{{\s*([^}]+)\s*}}/g, (ne, pe) => {
|
|
@@ -3069,7 +3089,7 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
3069
3089
|
onClick: M,
|
|
3070
3090
|
class: "inline-flex items-center gap-2 rounded-md border border-gray-200 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:border-gray-300 hover:bg-gray-50 transition-colors"
|
|
3071
3091
|
}, [
|
|
3072
|
-
H(N(
|
|
3092
|
+
H(N(Sn), { class: "h-4 w-4 text-gray-700" }),
|
|
3073
3093
|
ee[4] || (ee[4] = Pe(" Імпорт ", -1))
|
|
3074
3094
|
])) : j("", !0),
|
|
3075
3095
|
n("export") ? (u(), g("button", {
|
|
@@ -3099,7 +3119,7 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
3099
3119
|
c("th", li, [
|
|
3100
3120
|
H(N(zt), { class: "mx-auto h-4 w-4 text-gray-400" })
|
|
3101
3121
|
]),
|
|
3102
|
-
(u(!0), g(be, null, Ce(
|
|
3122
|
+
(u(!0), g(be, null, Ce(F.value, (ne) => (u(), g("th", {
|
|
3103
3123
|
key: ne.key,
|
|
3104
3124
|
class: "px-4 py-3 text-left text-xs font-semibold text-gray-900"
|
|
3105
3125
|
}, [
|
|
@@ -3138,14 +3158,14 @@ const Ks = /* @__PURE__ */ Ee(Hs, [["render", Gs]]), Ws = { class: "bg-white rou
|
|
|
3138
3158
|
draggable: "true",
|
|
3139
3159
|
onDragstart: (ye) => h(pe),
|
|
3140
3160
|
onDragover: De((ye) => w(pe), ["prevent"]),
|
|
3141
|
-
onDrop: (ye) =>
|
|
3161
|
+
onDrop: (ye) => _(pe)
|
|
3142
3162
|
}, [
|
|
3143
3163
|
c("td", ui, [
|
|
3144
3164
|
c("div", di, [
|
|
3145
3165
|
H(N(zt), { class: "mx-auto h-4 w-4 text-slate-400 dark:text-slate-500" })
|
|
3146
3166
|
])
|
|
3147
3167
|
]),
|
|
3148
|
-
(u(!0), g(be, null, Ce(
|
|
3168
|
+
(u(!0), g(be, null, Ce(F.value, (ye) => (u(), g("td", {
|
|
3149
3169
|
key: ye.key,
|
|
3150
3170
|
class: "px-4 py-3 align-middle"
|
|
3151
3171
|
}, [
|
|
@@ -3305,8 +3325,8 @@ const Bi = /* @__PURE__ */ Ee(Fi, [["render", Ei]]), Ti = { class: "bg-white/30
|
|
|
3305
3325
|
"{y}": r.y
|
|
3306
3326
|
};
|
|
3307
3327
|
let y = d.url;
|
|
3308
|
-
return Object.entries(m).forEach(([$,
|
|
3309
|
-
y = y.replace(new RegExp($, "gi"), String(
|
|
3328
|
+
return Object.entries(m).forEach(([$, F]) => {
|
|
3329
|
+
y = y.replace(new RegExp($, "gi"), String(F));
|
|
3310
3330
|
}), y;
|
|
3311
3331
|
}
|
|
3312
3332
|
return (d, m) => (u(), g("div", Ti, [
|
|
@@ -3314,7 +3334,7 @@ const Bi = /* @__PURE__ */ Ee(Fi, [["render", Ei]]), Ti = { class: "bg-white/30
|
|
|
3314
3334
|
(u(!0), g(be, null, Ce(d.basemaps, (y, $) => (u(), g("div", {
|
|
3315
3335
|
key: $,
|
|
3316
3336
|
class: X(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === $ }]),
|
|
3317
|
-
onClick: (
|
|
3337
|
+
onClick: (F) => o($),
|
|
3318
3338
|
title: y.name || $,
|
|
3319
3339
|
role: "button",
|
|
3320
3340
|
tabindex: "0"
|
|
@@ -3353,17 +3373,17 @@ function Ui(e, l, t) {
|
|
|
3353
3373
|
};
|
|
3354
3374
|
const a = [], o = [];
|
|
3355
3375
|
if (n.forEach((m, y) => {
|
|
3356
|
-
const $ = y + 1,
|
|
3357
|
-
if (!
|
|
3358
|
-
a.push(...
|
|
3376
|
+
const $ = y + 1, F = l === "decimal" ? zi(m, $, t) : Tn(m, $, t);
|
|
3377
|
+
if (!F.ok) {
|
|
3378
|
+
a.push(...F.errors);
|
|
3359
3379
|
return;
|
|
3360
3380
|
}
|
|
3361
3381
|
const x = o[o.length - 1];
|
|
3362
|
-
if (x && mn(x,
|
|
3382
|
+
if (x && mn(x, F.point)) {
|
|
3363
3383
|
a.push({ line: $, message: "Послідовні точки не повинні дублюватися." });
|
|
3364
3384
|
return;
|
|
3365
3385
|
}
|
|
3366
|
-
o.push(
|
|
3386
|
+
o.push(F.point);
|
|
3367
3387
|
}), a.length)
|
|
3368
3388
|
return { ok: !1, errors: a };
|
|
3369
3389
|
if (new Set(o.map(qi)).size < 3)
|
|
@@ -3393,10 +3413,10 @@ function Ui(e, l, t) {
|
|
|
3393
3413
|
};
|
|
3394
3414
|
}
|
|
3395
3415
|
function zi(e, l, t) {
|
|
3396
|
-
return
|
|
3416
|
+
return Bn(e, "decimal", t, l);
|
|
3397
3417
|
}
|
|
3398
|
-
function
|
|
3399
|
-
return l === "decimal" ? Hi(e, n, t) :
|
|
3418
|
+
function Bn(e, l, t, n = 1) {
|
|
3419
|
+
return l === "decimal" ? Hi(e, n, t) : Tn(e, n, t);
|
|
3400
3420
|
}
|
|
3401
3421
|
function Hi(e, l, t) {
|
|
3402
3422
|
const n = [];
|
|
@@ -3430,7 +3450,7 @@ function Hi(e, l, t) {
|
|
|
3430
3450
|
const s = t === "lat-lon" ? o : r, d = t === "lat-lon" ? r : o;
|
|
3431
3451
|
return (s < -90 || s > 90) && n.push({ line: l, message: "Широта поза діапазоном (-90..90)." }), (d < -180 || d > 180) && n.push({ line: l, message: "Довгота поза діапазоном (-180..180)." }), n.length ? { ok: !1, errors: n } : { ok: !0, point: [d, s] };
|
|
3432
3452
|
}
|
|
3433
|
-
function
|
|
3453
|
+
function Tn(e, l, t) {
|
|
3434
3454
|
dl.lastIndex = 0;
|
|
3435
3455
|
const n = [...e.matchAll(dl)];
|
|
3436
3456
|
if (n.length < 2)
|
|
@@ -3532,14 +3552,14 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3532
3552
|
},
|
|
3533
3553
|
emits: ["goToCoordinates"],
|
|
3534
3554
|
setup(e, { emit: l }) {
|
|
3535
|
-
const t = e, n = l, a = ["here", "xy", "parcel"], o =
|
|
3555
|
+
const t = e, n = l, a = ["here", "xy", "parcel"], o = k(() => {
|
|
3536
3556
|
const S = t.config?.tools?.filter((B) => a.includes(B));
|
|
3537
3557
|
return S && S.length ? S : a;
|
|
3538
3558
|
}), r = {
|
|
3539
3559
|
here: "Пошук…",
|
|
3540
3560
|
xy: `50.4501 30.5234 або 50°27'00"N 30°31'24"E`,
|
|
3541
3561
|
parcel: "Пошук…"
|
|
3542
|
-
}, s =
|
|
3562
|
+
}, s = k(() => {
|
|
3543
3563
|
const S = t.config?.placeholder?.trim();
|
|
3544
3564
|
return S || r[d.value] || "Пошук…";
|
|
3545
3565
|
}), d = D(o.value[0] ?? a[0]);
|
|
@@ -3550,7 +3570,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3550
3570
|
ce(d, () => {
|
|
3551
3571
|
m.value = "", y.value = !1;
|
|
3552
3572
|
});
|
|
3553
|
-
function
|
|
3573
|
+
function F(S) {
|
|
3554
3574
|
d.value = S;
|
|
3555
3575
|
}
|
|
3556
3576
|
function x(S) {
|
|
@@ -3567,7 +3587,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3567
3587
|
return S === "xy" ? "Координати" : S === "parcel" ? "Кадастр" : "Адреси";
|
|
3568
3588
|
}
|
|
3569
3589
|
function p(S) {
|
|
3570
|
-
const B =
|
|
3590
|
+
const B = Bn(S.trim(), "dms", "lat-lon");
|
|
3571
3591
|
if (B.ok) {
|
|
3572
3592
|
const [P, ae] = B.point;
|
|
3573
3593
|
return { lat: ae, lng: P };
|
|
@@ -3611,7 +3631,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3611
3631
|
}
|
|
3612
3632
|
];
|
|
3613
3633
|
}
|
|
3614
|
-
function
|
|
3634
|
+
function _(S) {
|
|
3615
3635
|
const A = S.replace(/\s+/g, "").split(":");
|
|
3616
3636
|
if (A.length !== 4) return !1;
|
|
3617
3637
|
const z = [10, 2, 3, 4];
|
|
@@ -3641,7 +3661,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3641
3661
|
if (d.value === "here")
|
|
3642
3662
|
B.searchParams.set("searchtext", S);
|
|
3643
3663
|
else {
|
|
3644
|
-
if (!
|
|
3664
|
+
if (!_(S)) {
|
|
3645
3665
|
$e({ type: "warning", title: "Пошук кадастру", message: "Кадастровий номер має формат ХХХХХХХХХХ:ХХ:ХХХ:ХХХХ" });
|
|
3646
3666
|
return;
|
|
3647
3667
|
}
|
|
@@ -3688,7 +3708,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3688
3708
|
(u(!0), g(be, null, Ce(o.value, (A) => (u(), g("li", {
|
|
3689
3709
|
key: A,
|
|
3690
3710
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
3691
|
-
onClick: (z) =>
|
|
3711
|
+
onClick: (z) => F(A)
|
|
3692
3712
|
}, re(v(A)), 9, Zi))), 128))
|
|
3693
3713
|
])
|
|
3694
3714
|
])) : j("", !0)
|
|
@@ -3824,7 +3844,7 @@ const Wi = { class: "map-search-widget flex flex-col gap-2 rounded-xl widget min
|
|
|
3824
3844
|
function Tt(e) {
|
|
3825
3845
|
return du.format(e);
|
|
3826
3846
|
}
|
|
3827
|
-
function
|
|
3847
|
+
function Pn(e) {
|
|
3828
3848
|
return e >= 1e3 ? `${Tt(e / 1e3)} км` : `${Tt(e)} м`;
|
|
3829
3849
|
}
|
|
3830
3850
|
const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5" }, fu = {
|
|
@@ -3842,28 +3862,28 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
3842
3862
|
},
|
|
3843
3863
|
emits: ["update", "delete"],
|
|
3844
3864
|
setup(e, { emit: l }) {
|
|
3845
|
-
const t = e, n = l, a =
|
|
3865
|
+
const t = e, n = l, a = k(
|
|
3846
3866
|
() => `${t.coords.lat.toFixed(4)}°, ${t.coords.lng.toFixed(4)}°`
|
|
3847
3867
|
), o = D(!1), r = D(t.coords.lat), s = D(t.coords.lng);
|
|
3848
3868
|
ce(
|
|
3849
3869
|
() => t.coords,
|
|
3850
|
-
(
|
|
3851
|
-
r.value =
|
|
3870
|
+
(F) => {
|
|
3871
|
+
r.value = F.lat, s.value = F.lng;
|
|
3852
3872
|
},
|
|
3853
3873
|
{ deep: !0, immediate: !0 }
|
|
3854
3874
|
);
|
|
3855
|
-
const d = (
|
|
3875
|
+
const d = (F, x, v) => Math.min(Math.max(F, x), v), m = () => {
|
|
3856
3876
|
o.value = !0;
|
|
3857
3877
|
}, y = () => {
|
|
3858
3878
|
if (!Number.isFinite(r.value) || !Number.isFinite(s.value))
|
|
3859
3879
|
return;
|
|
3860
|
-
const
|
|
3861
|
-
n("update", { id: t.id, coords: { lat:
|
|
3880
|
+
const F = d(r.value, -90, 90), x = d(s.value, -180, 180);
|
|
3881
|
+
n("update", { id: t.id, coords: { lat: F, lng: x } }), o.value = !1;
|
|
3862
3882
|
}, $ = () => {
|
|
3863
3883
|
n("delete", t.id);
|
|
3864
3884
|
};
|
|
3865
|
-
return (
|
|
3866
|
-
H(N(
|
|
3885
|
+
return (F, x) => (u(), g("div", cu, [
|
|
3886
|
+
H(N(Vn), {
|
|
3867
3887
|
size: 12,
|
|
3868
3888
|
"stroke-width": 2,
|
|
3869
3889
|
class: "text-gray-400 flex-shrink-0"
|
|
@@ -3968,13 +3988,13 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
3968
3988
|
], o = () => {
|
|
3969
3989
|
t.value = !t.value;
|
|
3970
3990
|
}, r = (v, p) => {
|
|
3971
|
-
const h = (W) => W * Math.PI / 180, w = h(p.lat - v.lat),
|
|
3991
|
+
const h = (W) => W * Math.PI / 180, w = h(p.lat - v.lat), _ = h(p.lng - v.lng), M = h(v.lat), C = h(p.lat), S = Math.sin(w / 2), B = Math.sin(_ / 2);
|
|
3972
3992
|
return 6371e3 * (2 * Math.asin(
|
|
3973
3993
|
Math.sqrt(
|
|
3974
3994
|
S * S + Math.cos(M) * Math.cos(C) * B * B
|
|
3975
3995
|
)
|
|
3976
3996
|
));
|
|
3977
|
-
}, s =
|
|
3997
|
+
}, s = k(() => {
|
|
3978
3998
|
if (l.points.length < 2) return 0;
|
|
3979
3999
|
let v = 0;
|
|
3980
4000
|
for (let p = 1; p < l.points.length; p += 1)
|
|
@@ -3983,25 +4003,25 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
3983
4003
|
l.points[l.points.length - 1].coords,
|
|
3984
4004
|
l.points[0].coords
|
|
3985
4005
|
)), v;
|
|
3986
|
-
}), d =
|
|
4006
|
+
}), d = k(() => s.value >= 1e3 ? `${Tt(s.value / 1e3)} км` : `${Tt(s.value)} м`);
|
|
3987
4007
|
function m(v) {
|
|
3988
4008
|
if (v.length < 3) return 0;
|
|
3989
4009
|
const p = v[0].lat, h = v[0].lng, w = (M, C) => {
|
|
3990
4010
|
const S = (M - p) * 110574;
|
|
3991
4011
|
return { x: (C - h) * 111320 * Math.cos(p * Math.PI / 180), y: S };
|
|
3992
4012
|
};
|
|
3993
|
-
let
|
|
4013
|
+
let _ = 0;
|
|
3994
4014
|
for (let M = 0; M < v.length; M++) {
|
|
3995
4015
|
const C = (M + 1) % v.length, S = w(v[M].lat, v[M].lng), B = w(v[C].lat, v[C].lng);
|
|
3996
|
-
|
|
4016
|
+
_ += S.x * B.y - S.y * B.x;
|
|
3997
4017
|
}
|
|
3998
|
-
return Math.abs(
|
|
4018
|
+
return Math.abs(_) * 0.5;
|
|
3999
4019
|
}
|
|
4000
|
-
const y =
|
|
4020
|
+
const y = k(() => {
|
|
4001
4021
|
if (!l.isShapeClosed || l.points.length < 3) return 0;
|
|
4002
4022
|
const v = l.points.map((p) => p.coords);
|
|
4003
4023
|
return m(v);
|
|
4004
|
-
}), $ =
|
|
4024
|
+
}), $ = k(() => y.value > 0), F = k(() => {
|
|
4005
4025
|
const v = y.value;
|
|
4006
4026
|
if (v === 0) return "—";
|
|
4007
4027
|
if (n.value === "km2") {
|
|
@@ -4014,7 +4034,7 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4014
4034
|
}
|
|
4015
4035
|
const p = v >= 1 ? Math.round(v) : v;
|
|
4016
4036
|
return `${Tt(p)} м²`;
|
|
4017
|
-
}), x =
|
|
4037
|
+
}), x = k(() => {
|
|
4018
4038
|
const v = l.points.length;
|
|
4019
4039
|
return v === 1 ? "1 точка" : v >= 2 && v <= 4 ? `${v} точки` : `${v} точок`;
|
|
4020
4040
|
});
|
|
@@ -4053,12 +4073,12 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4053
4073
|
w === a.length - 1 && "rounded-r-md",
|
|
4054
4074
|
n.value === h.id ? "bg-white text-green-600 font-semibold shadow-sm" : "text-gray-600 hover:bg-gray-50"
|
|
4055
4075
|
]),
|
|
4056
|
-
onClick: De((
|
|
4076
|
+
onClick: De((_) => n.value = h.id, ["stop"])
|
|
4057
4077
|
}, re(h.label), 11, _u)), 64))
|
|
4058
4078
|
])
|
|
4059
4079
|
]),
|
|
4060
4080
|
c("div", $u, [
|
|
4061
|
-
$.value ? (u(), g("span", Cu, re(
|
|
4081
|
+
$.value ? (u(), g("span", Cu, re(F.value), 1)) : (u(), g("span", Su, "—"))
|
|
4062
4082
|
])
|
|
4063
4083
|
]),
|
|
4064
4084
|
c("div", Vu, [
|
|
@@ -4081,8 +4101,8 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4081
4101
|
id: h.id,
|
|
4082
4102
|
index: w + 1,
|
|
4083
4103
|
coords: h.coords,
|
|
4084
|
-
onUpdate: p[0] || (p[0] = (
|
|
4085
|
-
onDelete: (
|
|
4104
|
+
onUpdate: p[0] || (p[0] = (_) => v.$emit("update-point", _)),
|
|
4105
|
+
onDelete: (_) => v.$emit("delete-point", h.id)
|
|
4086
4106
|
}, null, 8, ["id", "index", "coords", "onDelete"]))), 128))
|
|
4087
4107
|
])) : j("", !0)
|
|
4088
4108
|
]));
|
|
@@ -4121,9 +4141,9 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4121
4141
|
));
|
|
4122
4142
|
}
|
|
4123
4143
|
function n(o) {
|
|
4124
|
-
return
|
|
4144
|
+
return Pn(o);
|
|
4125
4145
|
}
|
|
4126
|
-
const a =
|
|
4146
|
+
const a = k(() => {
|
|
4127
4147
|
const o = [], r = l.points;
|
|
4128
4148
|
if (r.length < 2) return o;
|
|
4129
4149
|
for (let s = 0; s < r.length; s++) {
|
|
@@ -4169,19 +4189,19 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4169
4189
|
"shape-closed-change"
|
|
4170
4190
|
],
|
|
4171
4191
|
setup(e, { expose: l, emit: t }) {
|
|
4172
|
-
const n = t, a = D([]), o =
|
|
4192
|
+
const n = t, a = D([]), o = k(() => a.value.length > 0), r = D(!1), s = D(!1), d = D("general");
|
|
4173
4193
|
function m(Q) {
|
|
4174
4194
|
d.value = Q, n("tab-change", Q);
|
|
4175
4195
|
}
|
|
4176
4196
|
Ze(() => {
|
|
4177
4197
|
n("tab-change", d.value);
|
|
4178
4198
|
});
|
|
4179
|
-
const y =
|
|
4199
|
+
const y = k(
|
|
4180
4200
|
() => a.value.length >= 3 && !s.value
|
|
4181
4201
|
);
|
|
4182
4202
|
let $ = 1;
|
|
4183
|
-
const
|
|
4184
|
-
a.value.length < 3 && s.value && (s.value = !1, n("shape-closed-change", !1)), n("points-change",
|
|
4203
|
+
const F = () => a.value.map((Q) => ({ id: Q.id, coords: { ...Q.coords } })), x = () => {
|
|
4204
|
+
a.value.length < 3 && s.value && (s.value = !1, n("shape-closed-change", !1)), n("points-change", F());
|
|
4185
4205
|
}, v = () => {
|
|
4186
4206
|
const Q = $;
|
|
4187
4207
|
return $ += 1, Q;
|
|
@@ -4200,7 +4220,7 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4200
4220
|
Z[G] = { id: Q, coords: { ...Y } }, a.value = Z, x();
|
|
4201
4221
|
}, w = (Q) => {
|
|
4202
4222
|
a.value = a.value.filter((Y) => Y.id !== Q), x();
|
|
4203
|
-
},
|
|
4223
|
+
}, _ = () => {
|
|
4204
4224
|
a.value = [], s.value && (s.value = !1, n("shape-closed-change", !1)), x();
|
|
4205
4225
|
}, M = (Q) => {
|
|
4206
4226
|
h(Q);
|
|
@@ -4215,17 +4235,17 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4215
4235
|
}, z = () => {
|
|
4216
4236
|
y.value && (s.value = !0, n("complete"), n("shape-closed-change", !0));
|
|
4217
4237
|
}, W = () => {
|
|
4218
|
-
|
|
4238
|
+
_(), r.value = !1, n("close");
|
|
4219
4239
|
};
|
|
4220
4240
|
return l({
|
|
4221
4241
|
addPoint: p,
|
|
4222
|
-
clearPoints:
|
|
4242
|
+
clearPoints: _
|
|
4223
4243
|
}), (Q, Y) => (u(), g("div", Ru, [
|
|
4224
4244
|
c("div", ju, [
|
|
4225
4245
|
c("div", Uu, [
|
|
4226
4246
|
c("div", zu, [
|
|
4227
4247
|
c("div", Hu, [
|
|
4228
|
-
H(N(
|
|
4248
|
+
H(N(Mn), {
|
|
4229
4249
|
size: 14,
|
|
4230
4250
|
"stroke-width": 2,
|
|
4231
4251
|
class: "text-white"
|
|
@@ -4296,7 +4316,7 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4296
4316
|
})) : j("", !0),
|
|
4297
4317
|
o.value ? (u(), ge(iu, {
|
|
4298
4318
|
key: 1,
|
|
4299
|
-
onClick:
|
|
4319
|
+
onClick: _
|
|
4300
4320
|
})) : j("", !0)
|
|
4301
4321
|
])
|
|
4302
4322
|
])
|
|
@@ -4312,30 +4332,30 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4312
4332
|
},
|
|
4313
4333
|
setup(e) {
|
|
4314
4334
|
function l(v, p) {
|
|
4315
|
-
const h = (B) => B * Math.PI / 180, w = h(p.lat - v.lat),
|
|
4335
|
+
const h = (B) => B * Math.PI / 180, w = h(p.lat - v.lat), _ = h(p.lng - v.lng), M = h(v.lat), C = h(p.lat);
|
|
4316
4336
|
return 6371e3 * (2 * Math.asin(
|
|
4317
4337
|
Math.sqrt(
|
|
4318
|
-
Math.sin(w / 2) ** 2 + Math.cos(M) * Math.cos(C) * Math.sin(
|
|
4338
|
+
Math.sin(w / 2) ** 2 + Math.cos(M) * Math.cos(C) * Math.sin(_ / 2) ** 2
|
|
4319
4339
|
)
|
|
4320
4340
|
));
|
|
4321
4341
|
}
|
|
4322
4342
|
function t(v) {
|
|
4323
|
-
return
|
|
4343
|
+
return Pn(v);
|
|
4324
4344
|
}
|
|
4325
4345
|
const n = e;
|
|
4326
4346
|
function a() {
|
|
4327
4347
|
return { type: "FeatureCollection", features: [] };
|
|
4328
4348
|
}
|
|
4329
4349
|
function o(v, p, h) {
|
|
4330
|
-
const w = h ?? "general",
|
|
4350
|
+
const w = h ?? "general", _ = [];
|
|
4331
4351
|
let M = 0;
|
|
4332
|
-
|
|
4352
|
+
_.push(0);
|
|
4333
4353
|
for (let C = 1; C < v.length; C++)
|
|
4334
|
-
M += l(v[C - 1].coords, v[C].coords),
|
|
4354
|
+
M += l(v[C - 1].coords, v[C].coords), _.push(M);
|
|
4335
4355
|
return p && v.length >= 2 && (M += l(v[v.length - 1].coords, v[0].coords)), {
|
|
4336
4356
|
type: "FeatureCollection",
|
|
4337
4357
|
features: v.map((C, S) => {
|
|
4338
|
-
const B = w === "general" ? S === 0 ? "0" : t(
|
|
4358
|
+
const B = w === "general" ? S === 0 ? "0" : t(_[S]) : S === 0 ? "0" : t(
|
|
4339
4359
|
l(v[S - 1].coords, v[S].coords)
|
|
4340
4360
|
);
|
|
4341
4361
|
return {
|
|
@@ -4353,9 +4373,9 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4353
4373
|
if (v.length < 2) return a();
|
|
4354
4374
|
const h = [];
|
|
4355
4375
|
for (let w = 0; w < v.length; w++) {
|
|
4356
|
-
const
|
|
4357
|
-
if (
|
|
4358
|
-
const M = v[w].coords, C = v[
|
|
4376
|
+
const _ = w === v.length - 1 && p ? 0 : w + 1;
|
|
4377
|
+
if (_ >= v.length) break;
|
|
4378
|
+
const M = v[w].coords, C = v[_].coords, S = l(M, C);
|
|
4359
4379
|
h.push({
|
|
4360
4380
|
type: "Feature",
|
|
4361
4381
|
geometry: {
|
|
@@ -4479,18 +4499,18 @@ const cu = { class: "flex items-center gap-1.5 text-xs bg-gray-50 rounded p-1.5"
|
|
|
4479
4499
|
m = !1;
|
|
4480
4500
|
}
|
|
4481
4501
|
}
|
|
4482
|
-
function
|
|
4502
|
+
function F(v) {
|
|
4483
4503
|
if (!v) return;
|
|
4484
|
-
const p = v.getSource(st), h = v.getSource(Ct), w = v.getSource(St),
|
|
4504
|
+
const p = v.getSource(st), h = v.getSource(Ct), w = v.getSource(St), _ = v.getSource(Vt), M = n.points, C = n.labelMode ?? "general";
|
|
4485
4505
|
p && p.setData(
|
|
4486
4506
|
o(M, n.isShapeClosed, C)
|
|
4487
|
-
), h && h.setData(s(M, n.isShapeClosed)), w && w.setData(d(M)),
|
|
4507
|
+
), h && h.setData(s(M, n.isShapeClosed)), w && w.setData(d(M)), _ && _.setData(
|
|
4488
4508
|
C === "topoint" ? r(M, n.isShapeClosed) : a()
|
|
4489
4509
|
);
|
|
4490
4510
|
}
|
|
4491
4511
|
function x() {
|
|
4492
4512
|
const v = n.map;
|
|
4493
|
-
v && (m || y(v),
|
|
4513
|
+
v && (m || y(v), F(v));
|
|
4494
4514
|
}
|
|
4495
4515
|
return ce(
|
|
4496
4516
|
() => [n.points, n.isShapeClosed, n.labelMode],
|
|
@@ -4525,14 +4545,14 @@ function Xu(e = {}) {
|
|
|
4525
4545
|
function $(x) {
|
|
4526
4546
|
l.value && o.value?.addPoint({ lat: x.lat, lng: x.lng });
|
|
4527
4547
|
}
|
|
4528
|
-
const
|
|
4548
|
+
const F = k(() => t.value.length > 0);
|
|
4529
4549
|
return {
|
|
4530
4550
|
isRulerActive: l,
|
|
4531
4551
|
rulerPoints: t,
|
|
4532
4552
|
rulerShapeClosed: n,
|
|
4533
4553
|
rulerActiveTab: a,
|
|
4534
4554
|
rulerPanelRef: o,
|
|
4535
|
-
hasRulerPoints:
|
|
4555
|
+
hasRulerPoints: F,
|
|
4536
4556
|
toggleRuler: r,
|
|
4537
4557
|
closeRuler: s,
|
|
4538
4558
|
onRulerPointsChange: d,
|
|
@@ -4593,10 +4613,10 @@ const Qu = {
|
|
|
4593
4613
|
},
|
|
4594
4614
|
emits: ["update:modelValue", "valueSelected"],
|
|
4595
4615
|
setup(e, { emit: l }) {
|
|
4596
|
-
const t = e, n = l, a =
|
|
4616
|
+
const t = e, n = l, a = kn(), o = k(() => {
|
|
4597
4617
|
const i = a?.multiple, f = a?.multi, b = (V) => V === "" || V === !0 || V === "true" || V === 1 || V === "1";
|
|
4598
4618
|
return !!t.multi || !!t.multiple || b(f) || b(i);
|
|
4599
|
-
}), r =
|
|
4619
|
+
}), r = k(() => !!t.disabled), s = D(!1), d = D(null), m = D(0), y = D(""), $ = D(null), F = D([]), x = D(null), v = D(null), p = Xu({
|
|
4600
4620
|
onActivate() {
|
|
4601
4621
|
if (q)
|
|
4602
4622
|
try {
|
|
@@ -4611,20 +4631,20 @@ const Qu = {
|
|
|
4611
4631
|
function h() {
|
|
4612
4632
|
p.toggleRuler();
|
|
4613
4633
|
}
|
|
4614
|
-
const w = ya(),
|
|
4634
|
+
const w = ya(), _ = w?.appContext?.config?.globalProperties?.$settings ?? {}, M = _?.map ?? {}, C = w?.vnode?.props ?? {};
|
|
4615
4635
|
function S(i) {
|
|
4616
4636
|
return Object.prototype.hasOwnProperty.call(C, i) || Object.prototype.hasOwnProperty.call(
|
|
4617
4637
|
C,
|
|
4618
4638
|
i.replace(/[A-Z]/g, (f) => `-${f.toLowerCase()}`)
|
|
4619
4639
|
);
|
|
4620
4640
|
}
|
|
4621
|
-
const B = Array.isArray(M.center) && M.center.length === 2 ? M.center : Array.isArray(
|
|
4641
|
+
const B = Array.isArray(M.center) && M.center.length === 2 ? M.center : Array.isArray(_.center) && _.center.length === 2 ? _.center : [30, 50], A = typeof M.zoom == "number" ? M.zoom : typeof _.zoom == "number" ? _.zoom : typeof _.defaultZoom == "number" ? _.defaultZoom : 10, z = k(
|
|
4622
4642
|
() => S("center") ? t.center : M.center ?? t.center
|
|
4623
|
-
), W =
|
|
4643
|
+
), W = k(
|
|
4624
4644
|
() => S("zoom") ? t.zoom : M.zoom ?? t.zoom
|
|
4625
|
-
), Q =
|
|
4645
|
+
), Q = k(
|
|
4626
4646
|
() => S("katottg") ? String(t.katottg ?? "") : String(M.katottg ?? t.katottg ?? "")
|
|
4627
|
-
), Y =
|
|
4647
|
+
), Y = k(() => S("layers") ? t.layers ?? [] : M.layers ?? t.layers ?? []), G = k(() => S("bounds") ? t.bounds : M.bounds ?? t.bounds), Z = D(
|
|
4628
4648
|
Array.isArray(z.value) && z.value.length === 2 ? [...z.value] : B
|
|
4629
4649
|
), te = D(
|
|
4630
4650
|
typeof W.value == "number" ? W.value : A
|
|
@@ -4658,19 +4678,19 @@ const Qu = {
|
|
|
4658
4678
|
}
|
|
4659
4679
|
};
|
|
4660
4680
|
let de = !1, xe = !1;
|
|
4661
|
-
const he =
|
|
4681
|
+
const he = Cn({}), _e = D([]), Ge = k(
|
|
4662
4682
|
() => _e.value.map((i) => he[i]).filter(Boolean)
|
|
4663
|
-
), ze = D(null), pt =
|
|
4683
|
+
), ze = D(null), pt = k(() => ze.value?.entries ?? []), xt = k(() => {
|
|
4664
4684
|
if (ze.value)
|
|
4665
4685
|
return {
|
|
4666
4686
|
left: `${ze.value.point.x + 12}px`,
|
|
4667
4687
|
top: `${ze.value.point.y + 12}px`
|
|
4668
4688
|
};
|
|
4669
|
-
}), Je =
|
|
4689
|
+
}), Je = k(() => {
|
|
4670
4690
|
if (Array.isArray(t.tools) && t.tools.length) return t.tools;
|
|
4671
4691
|
const i = a?.tools;
|
|
4672
4692
|
return Array.isArray(i) ? i.map((f) => String(f)) : typeof i == "string" ? i.split(",").map((f) => f.trim()).filter(Boolean) : [];
|
|
4673
|
-
}), Re =
|
|
4693
|
+
}), Re = k(() => {
|
|
4674
4694
|
const i = {
|
|
4675
4695
|
search: !1,
|
|
4676
4696
|
import: !1,
|
|
@@ -4710,7 +4730,7 @@ const Qu = {
|
|
|
4710
4730
|
return b ? f ? `${f}/${b}` : `/${b}` : f;
|
|
4711
4731
|
}
|
|
4712
4732
|
function ee() {
|
|
4713
|
-
const i = Array.isArray(M.basemaps) && M.basemaps.length ? M.basemaps :
|
|
4733
|
+
const i = Array.isArray(M.basemaps) && M.basemaps.length ? M.basemaps : _.basemaps;
|
|
4714
4734
|
if (Array.isArray(i) && i.length) {
|
|
4715
4735
|
const b = i.map((V, L) => {
|
|
4716
4736
|
const R = String(V?.key ?? V?.id ?? V?.name ?? `b${L}`), ie = O(String(V?.url ?? ""));
|
|
@@ -4789,7 +4809,7 @@ const Qu = {
|
|
|
4789
4809
|
]
|
|
4790
4810
|
};
|
|
4791
4811
|
}
|
|
4792
|
-
let T = null, le = null,
|
|
4812
|
+
let T = null, le = null, I = null, q = null, Me = [], ut = null, Xe = null, je = null, mt = !1, vt = !1, dt = !1, Ke = null;
|
|
4793
4813
|
function Lt() {
|
|
4794
4814
|
return {
|
|
4795
4815
|
onSetup() {
|
|
@@ -5045,20 +5065,20 @@ const Qu = {
|
|
|
5045
5065
|
}), L.push(b), L;
|
|
5046
5066
|
}
|
|
5047
5067
|
function E(i) {
|
|
5048
|
-
if (!
|
|
5068
|
+
if (!I) return;
|
|
5049
5069
|
i.handlers.forEach((b) => {
|
|
5050
5070
|
try {
|
|
5051
|
-
|
|
5071
|
+
I.off(b.type, b.layerId, b.handler);
|
|
5052
5072
|
} catch {
|
|
5053
5073
|
}
|
|
5054
5074
|
}), i.handlers = [], [...i.layerIds, ...i.boundsIds].forEach((b) => {
|
|
5055
|
-
|
|
5056
|
-
}),
|
|
5075
|
+
I.getLayer(b) && I.removeLayer(b);
|
|
5076
|
+
}), I.getSource(i.sourceId) && I.removeSource(i.sourceId);
|
|
5057
5077
|
const f = `vs-ov-bounds-src-${i.id}`;
|
|
5058
|
-
|
|
5078
|
+
I.getSource(f) && I.removeSource(f), Dt(i.id);
|
|
5059
5079
|
}
|
|
5060
5080
|
function K(i, f) {
|
|
5061
|
-
if (!
|
|
5081
|
+
if (!I) return [];
|
|
5062
5082
|
const b = `vs-ov-bounds-src-${f}`, V = `vs-ov-bounds-line-${f}`, L = i.bounds ?? G.value ?? ue.value, R = al(L);
|
|
5063
5083
|
if (!R.length) return [];
|
|
5064
5084
|
const ie = {
|
|
@@ -5069,7 +5089,7 @@ const Qu = {
|
|
|
5069
5089
|
geometry: { type: "LineString", coordinates: fe }
|
|
5070
5090
|
}))
|
|
5071
5091
|
};
|
|
5072
|
-
return
|
|
5092
|
+
return I.getSource(b) && I.removeSource(b), I.addSource(b, { type: "geojson", data: ie }), I.addLayer({
|
|
5073
5093
|
id: V,
|
|
5074
5094
|
type: "line",
|
|
5075
5095
|
source: b,
|
|
@@ -5082,21 +5102,21 @@ const Qu = {
|
|
|
5082
5102
|
}), [V];
|
|
5083
5103
|
}
|
|
5084
5104
|
function U(i) {
|
|
5085
|
-
if (!
|
|
5105
|
+
if (!I) return;
|
|
5086
5106
|
E(i);
|
|
5087
5107
|
const f = i.config, b = Vl(f);
|
|
5088
5108
|
if (!b) return;
|
|
5089
5109
|
const V = [], L = [];
|
|
5090
5110
|
if (/\.v(?:m)?t(?:\?|$)/i.test(b) || /\.pbf(?:\?|$)/i.test(b)) {
|
|
5091
5111
|
const fe = f.sourceLayer || f.layer || f.service_layer || f.dataset?.layer || f.id;
|
|
5092
|
-
|
|
5112
|
+
I.addSource(i.sourceId, {
|
|
5093
5113
|
type: "vector",
|
|
5094
5114
|
tiles: [b]
|
|
5095
5115
|
});
|
|
5096
5116
|
const Ue = String(f.style?.type ?? "polygon").toLowerCase(), ot = rl(f), gt = f.style?.opacity ?? 0.5;
|
|
5097
5117
|
if (Ue === "point") {
|
|
5098
5118
|
const wt = `vs-ov-point-${i.id}`;
|
|
5099
|
-
|
|
5119
|
+
I.addLayer({
|
|
5100
5120
|
id: wt,
|
|
5101
5121
|
type: "circle",
|
|
5102
5122
|
source: i.sourceId,
|
|
@@ -5109,7 +5129,7 @@ const Qu = {
|
|
|
5109
5129
|
}), V.push(wt);
|
|
5110
5130
|
} else if (Ue === "polyline" || Ue === "line") {
|
|
5111
5131
|
const wt = `vs-ov-line-${i.id}`;
|
|
5112
|
-
|
|
5132
|
+
I.addLayer({
|
|
5113
5133
|
id: wt,
|
|
5114
5134
|
type: "line",
|
|
5115
5135
|
source: i.sourceId,
|
|
@@ -5123,7 +5143,7 @@ const Qu = {
|
|
|
5123
5143
|
}), V.push(wt);
|
|
5124
5144
|
} else {
|
|
5125
5145
|
const wt = `vs-ov-fill-${i.id}`, Yt = `vs-ov-border-${i.id}`;
|
|
5126
|
-
|
|
5146
|
+
I.addLayer({
|
|
5127
5147
|
id: wt,
|
|
5128
5148
|
type: "fill",
|
|
5129
5149
|
source: i.sourceId,
|
|
@@ -5132,7 +5152,7 @@ const Qu = {
|
|
|
5132
5152
|
"fill-color": ot,
|
|
5133
5153
|
"fill-opacity": gt
|
|
5134
5154
|
}
|
|
5135
|
-
}),
|
|
5155
|
+
}), I.addLayer({
|
|
5136
5156
|
id: Yt,
|
|
5137
5157
|
type: "line",
|
|
5138
5158
|
source: i.sourceId,
|
|
@@ -5145,13 +5165,13 @@ const Qu = {
|
|
|
5145
5165
|
}), V.push(wt, Yt);
|
|
5146
5166
|
}
|
|
5147
5167
|
} else {
|
|
5148
|
-
|
|
5168
|
+
I.addSource(i.sourceId, {
|
|
5149
5169
|
type: "raster",
|
|
5150
5170
|
tiles: [b],
|
|
5151
5171
|
tileSize: 256
|
|
5152
5172
|
});
|
|
5153
5173
|
const fe = `vs-ov-raster-${i.id}`;
|
|
5154
|
-
|
|
5174
|
+
I.addLayer({
|
|
5155
5175
|
id: fe,
|
|
5156
5176
|
type: "raster",
|
|
5157
5177
|
source: i.sourceId,
|
|
@@ -5177,18 +5197,18 @@ const Qu = {
|
|
|
5177
5197
|
point: { x: gt.point.x, y: gt.point.y }
|
|
5178
5198
|
};
|
|
5179
5199
|
}, ot = () => Dt(i.id);
|
|
5180
|
-
|
|
5200
|
+
I.on("mousemove", fe, Ue), I.on("mouseleave", fe, ot), L.push(
|
|
5181
5201
|
{ layerId: fe, type: "mousemove", handler: Ue },
|
|
5182
5202
|
{ layerId: fe, type: "mouseleave", handler: ot }
|
|
5183
5203
|
);
|
|
5184
5204
|
}), i.layerIds = V, i.boundsIds = K(i.config, i.id), i.handlers = L;
|
|
5185
5205
|
const ie = i.visible ? "visible" : "none";
|
|
5186
5206
|
[...i.layerIds, ...i.boundsIds].forEach((fe) => {
|
|
5187
|
-
|
|
5207
|
+
I.getLayer(fe) && I.setLayoutProperty(fe, "visibility", ie);
|
|
5188
5208
|
});
|
|
5189
5209
|
}
|
|
5190
5210
|
function me() {
|
|
5191
|
-
if (!
|
|
5211
|
+
if (!I) return;
|
|
5192
5212
|
const f = {
|
|
5193
5213
|
type: "FeatureCollection",
|
|
5194
5214
|
features: al(G.value ?? ue.value).map((b) => ({
|
|
@@ -5197,7 +5217,7 @@ const Qu = {
|
|
|
5197
5217
|
geometry: { type: "LineString", coordinates: b }
|
|
5198
5218
|
}))
|
|
5199
5219
|
};
|
|
5200
|
-
|
|
5220
|
+
I.getSource(ml) ? I.getSource(ml).setData(f) : I.addSource(ml, { type: "geojson", data: f }), I.getLayer(vl) || I.addLayer({
|
|
5201
5221
|
id: vl,
|
|
5202
5222
|
type: "line",
|
|
5203
5223
|
source: ml,
|
|
@@ -5210,17 +5230,17 @@ const Qu = {
|
|
|
5210
5230
|
});
|
|
5211
5231
|
}
|
|
5212
5232
|
function Le(i) {
|
|
5213
|
-
if (!
|
|
5233
|
+
if (!I || r.value) return;
|
|
5214
5234
|
const f = he[i];
|
|
5215
5235
|
if (!f) return;
|
|
5216
5236
|
f.visible = !f.visible;
|
|
5217
5237
|
const b = f.visible ? "visible" : "none";
|
|
5218
5238
|
[...f.layerIds, ...f.boundsIds].forEach((V) => {
|
|
5219
|
-
|
|
5239
|
+
I.getLayer(V) && I.setLayoutProperty(V, "visibility", b);
|
|
5220
5240
|
}), Se(), f.visible || Dt(i);
|
|
5221
5241
|
}
|
|
5222
5242
|
function Se() {
|
|
5223
|
-
if (!
|
|
5243
|
+
if (!I) return;
|
|
5224
5244
|
const i = [], f = [], b = [], V = [];
|
|
5225
5245
|
_e.value.forEach((ie) => {
|
|
5226
5246
|
const fe = he[ie];
|
|
@@ -5229,19 +5249,19 @@ const Qu = {
|
|
|
5229
5249
|
ot ? b.push(...fe.layerIds) : gt ? i.push(...fe.layerIds) : f.push(...fe.layerIds), V.push(...fe.boundsIds);
|
|
5230
5250
|
}), [...i, ...f, ...b, ...V].forEach(
|
|
5231
5251
|
(ie) => {
|
|
5232
|
-
|
|
5252
|
+
I.getLayer(ie) && I.moveLayer(ie);
|
|
5233
5253
|
}
|
|
5234
|
-
),
|
|
5235
|
-
|
|
5254
|
+
), I.getLayer(vl) && I.moveLayer(vl), (I.getStyle?.()?.layers ?? []).map((ie) => String(ie?.id ?? "")).filter((ie) => ie.startsWith("gl-draw-")).forEach((ie) => {
|
|
5255
|
+
I.getLayer(ie) && I.moveLayer(ie);
|
|
5236
5256
|
});
|
|
5237
5257
|
}
|
|
5238
5258
|
function Ie(i) {
|
|
5239
|
-
if (!ne[i] || (ye.value = i, !
|
|
5259
|
+
if (!ne[i] || (ye.value = i, !I)) return;
|
|
5240
5260
|
const f = Kt();
|
|
5241
5261
|
if (!f) return;
|
|
5242
|
-
const b =
|
|
5243
|
-
|
|
5244
|
-
if (
|
|
5262
|
+
const b = I.getCenter?.(), V = I.getZoom?.(), L = q?.getAll?.();
|
|
5263
|
+
I.setStyle(Fe(f)), I.once("style.load", () => {
|
|
5264
|
+
if (I && (b && Number.isFinite(V) && I.jumpTo({ center: [b.lng, b.lat], zoom: V }), me(), _e.value.forEach((R) => {
|
|
5245
5265
|
const ie = he[R];
|
|
5246
5266
|
ie && U(ie);
|
|
5247
5267
|
}), Se(), L?.features?.length && q))
|
|
@@ -5324,14 +5344,14 @@ const Qu = {
|
|
|
5324
5344
|
return "__invalid__";
|
|
5325
5345
|
}
|
|
5326
5346
|
}
|
|
5327
|
-
function
|
|
5347
|
+
function Gn(i, f) {
|
|
5328
5348
|
if (!Array.isArray(i) || !Array.isArray(f) || i.length < 2 || f.length < 2) return !1;
|
|
5329
5349
|
const b = 1e-12;
|
|
5330
5350
|
return Math.abs(Number(i[0]) - Number(f[0])) < b && Math.abs(Number(i[1]) - Number(f[1])) < b;
|
|
5331
5351
|
}
|
|
5332
5352
|
function Jl(i, f) {
|
|
5333
5353
|
if (!Array.isArray(i) || i.length < 4) return null;
|
|
5334
|
-
const V =
|
|
5354
|
+
const V = Gn(i[0], i[i.length - 1]) ? i.slice(0, -1) : i.slice();
|
|
5335
5355
|
return !Number.isInteger(f) || f < 0 || f >= V.length || V.length <= 3 || (V.splice(f, 1), V.length < 3) ? null : [...V, [...V[0]]];
|
|
5336
5356
|
}
|
|
5337
5357
|
function Xl(i, f) {
|
|
@@ -5339,7 +5359,7 @@ const Qu = {
|
|
|
5339
5359
|
const b = i.slice();
|
|
5340
5360
|
return b.splice(f, 1), b.length < 2 ? null : b;
|
|
5341
5361
|
}
|
|
5342
|
-
function
|
|
5362
|
+
function Kn(i, f) {
|
|
5343
5363
|
const b = Oe(i);
|
|
5344
5364
|
if (!b || !Array.isArray(f)) return null;
|
|
5345
5365
|
if (b.type === "LineString") {
|
|
@@ -5360,7 +5380,7 @@ const Qu = {
|
|
|
5360
5380
|
}
|
|
5361
5381
|
return null;
|
|
5362
5382
|
}
|
|
5363
|
-
function
|
|
5383
|
+
function Wn(i) {
|
|
5364
5384
|
return i ? i.split(".").map((f) => Number(f)).filter((f) => Number.isInteger(f) && f >= 0) : [];
|
|
5365
5385
|
}
|
|
5366
5386
|
function Ql(i) {
|
|
@@ -5370,22 +5390,22 @@ const Qu = {
|
|
|
5370
5390
|
const f = i?.properties?.id ?? i?.id;
|
|
5371
5391
|
return f == null || f === "" ? null : String(f);
|
|
5372
5392
|
}
|
|
5373
|
-
function
|
|
5374
|
-
if (!
|
|
5393
|
+
function Yn(i) {
|
|
5394
|
+
if (!I || !i) return null;
|
|
5375
5395
|
const f = [
|
|
5376
5396
|
[i.x - 8, i.y - 8],
|
|
5377
5397
|
[i.x + 8, i.y + 8]
|
|
5378
|
-
], V =
|
|
5398
|
+
], V = I.queryRenderedFeatures(f).find((L) => {
|
|
5379
5399
|
const R = String(L?.properties?.meta ?? "");
|
|
5380
5400
|
return R && R !== "feature" ? !1 : !!en(L);
|
|
5381
5401
|
});
|
|
5382
5402
|
return en(V);
|
|
5383
5403
|
}
|
|
5384
|
-
function
|
|
5404
|
+
function Zn(i, f) {
|
|
5385
5405
|
if (!q || !i || !f.length) return;
|
|
5386
5406
|
const b = Ql(i);
|
|
5387
5407
|
if (!b?.geometry) return;
|
|
5388
|
-
const V =
|
|
5408
|
+
const V = Kn(b.geometry, f);
|
|
5389
5409
|
if (!V) return;
|
|
5390
5410
|
const L = {
|
|
5391
5411
|
...b,
|
|
@@ -5400,22 +5420,22 @@ const Qu = {
|
|
|
5400
5420
|
}
|
|
5401
5421
|
Et(), $t();
|
|
5402
5422
|
}
|
|
5403
|
-
function
|
|
5404
|
-
if (!
|
|
5423
|
+
function Jn(i) {
|
|
5424
|
+
if (!I || !q || r.value || p.isRulerActive.value || y.value !== "edit") return;
|
|
5405
5425
|
const f = i?.point;
|
|
5406
5426
|
if (!f) return;
|
|
5407
5427
|
const b = [
|
|
5408
5428
|
[f.x - 8, f.y - 8],
|
|
5409
5429
|
[f.x + 8, f.y + 8]
|
|
5410
|
-
], L =
|
|
5430
|
+
], L = I.queryRenderedFeatures(b).find(
|
|
5411
5431
|
(ie) => ie?.properties?.meta === "vertex" && ie?.properties?.parent && ie?.properties?.coord_path
|
|
5412
5432
|
);
|
|
5413
5433
|
if (!L) return;
|
|
5414
5434
|
i?.originalEvent?.preventDefault?.(), i?.originalEvent?.stopPropagation?.();
|
|
5415
|
-
const R =
|
|
5416
|
-
R.length &&
|
|
5435
|
+
const R = Wn(String(L.properties.coord_path));
|
|
5436
|
+
R.length && Zn(String(L.properties.parent), R);
|
|
5417
5437
|
}
|
|
5418
|
-
function
|
|
5438
|
+
function Xn(i) {
|
|
5419
5439
|
const f = an(i);
|
|
5420
5440
|
if (!f) return null;
|
|
5421
5441
|
const [[b, V], [L, R]] = f;
|
|
@@ -5434,7 +5454,7 @@ const Qu = {
|
|
|
5434
5454
|
}
|
|
5435
5455
|
return Math.abs(b / 2) / 1e6;
|
|
5436
5456
|
}
|
|
5437
|
-
function
|
|
5457
|
+
function Qn(i) {
|
|
5438
5458
|
if (!i?.type || !i?.coordinates) return null;
|
|
5439
5459
|
if (i.type === "Polygon") {
|
|
5440
5460
|
const f = i.coordinates?.[0];
|
|
@@ -5450,7 +5470,7 @@ const Qu = {
|
|
|
5450
5470
|
$.value = null;
|
|
5451
5471
|
return;
|
|
5452
5472
|
}
|
|
5453
|
-
const f =
|
|
5473
|
+
const f = Xn(i);
|
|
5454
5474
|
if (!f) {
|
|
5455
5475
|
$.value = null;
|
|
5456
5476
|
return;
|
|
@@ -5458,7 +5478,7 @@ const Qu = {
|
|
|
5458
5478
|
$.value = {
|
|
5459
5479
|
type: String(i.type ?? "Feature"),
|
|
5460
5480
|
center: f,
|
|
5461
|
-
areaKm2:
|
|
5481
|
+
areaKm2: Qn(i)
|
|
5462
5482
|
};
|
|
5463
5483
|
}
|
|
5464
5484
|
function Dl(i) {
|
|
@@ -5471,7 +5491,7 @@ const Qu = {
|
|
|
5471
5491
|
ut = b, Ll(b);
|
|
5472
5492
|
}
|
|
5473
5493
|
function Al(i) {
|
|
5474
|
-
|
|
5494
|
+
F.value = (i ?? []).map((f, b) => {
|
|
5475
5495
|
const V = String(f?.id ?? `feature-${b + 1}`), L = ln(String(f?.geometry?.type ?? "Feature"));
|
|
5476
5496
|
return {
|
|
5477
5497
|
id: V,
|
|
@@ -5523,15 +5543,15 @@ const Qu = {
|
|
|
5523
5543
|
];
|
|
5524
5544
|
}
|
|
5525
5545
|
function rn(i) {
|
|
5526
|
-
if (!
|
|
5546
|
+
if (!I || !i) return;
|
|
5527
5547
|
const f = an(i);
|
|
5528
5548
|
if (!f) return;
|
|
5529
5549
|
const [[b, V], [L, R]] = f;
|
|
5530
5550
|
if (b === L && V === R) {
|
|
5531
|
-
|
|
5551
|
+
I.easeTo({ center: [b, V], zoom: Math.max(te.value, 14) });
|
|
5532
5552
|
return;
|
|
5533
5553
|
}
|
|
5534
|
-
|
|
5554
|
+
I.fitBounds(f, { padding: 30, duration: 250, maxZoom: 18 });
|
|
5535
5555
|
}
|
|
5536
5556
|
function Fl() {
|
|
5537
5557
|
if (!q) {
|
|
@@ -5557,7 +5577,7 @@ const Qu = {
|
|
|
5557
5577
|
if (!q) return;
|
|
5558
5578
|
const i = q.getAll();
|
|
5559
5579
|
if (m.value = i?.features?.length ?? 0, !i?.features?.length) {
|
|
5560
|
-
Me = [],
|
|
5580
|
+
Me = [], F.value = [], ut = null, je = null, $.value = null, de || (Xe = "__null__", n("update:modelValue", null));
|
|
5561
5581
|
return;
|
|
5562
5582
|
}
|
|
5563
5583
|
const f = (i.features ?? []).map(nt).filter(Boolean);
|
|
@@ -5568,7 +5588,7 @@ const Qu = {
|
|
|
5568
5588
|
}
|
|
5569
5589
|
function ol() {
|
|
5570
5590
|
if (!q) return;
|
|
5571
|
-
(q.getAll()?.features || []).forEach((f) => q.delete(f.id)),
|
|
5591
|
+
(q.getAll()?.features || []).forEach((f) => q.delete(f.id)), F.value = [], Fl();
|
|
5572
5592
|
}
|
|
5573
5593
|
function sl(i) {
|
|
5574
5594
|
if (!q) return;
|
|
@@ -5582,7 +5602,7 @@ const Qu = {
|
|
|
5582
5602
|
const L = Oe(Me[Me.length - 1]?.geometry ?? null);
|
|
5583
5603
|
ut = Oe(L), Fl(), Ll(L), L && (rn(L), r.value || $t());
|
|
5584
5604
|
}
|
|
5585
|
-
function
|
|
5605
|
+
function ea() {
|
|
5586
5606
|
q && (de = !0, ol(), Me.forEach((i) => {
|
|
5587
5607
|
try {
|
|
5588
5608
|
q.add(i);
|
|
@@ -5624,10 +5644,10 @@ const Qu = {
|
|
|
5624
5644
|
y.value = "";
|
|
5625
5645
|
}
|
|
5626
5646
|
}
|
|
5627
|
-
function
|
|
5647
|
+
function ta(i) {
|
|
5628
5648
|
r.value || !q || !i || $t(i);
|
|
5629
5649
|
}
|
|
5630
|
-
function
|
|
5650
|
+
function la() {
|
|
5631
5651
|
if (!(r.value || !q)) {
|
|
5632
5652
|
if (o.value) {
|
|
5633
5653
|
const i = Wt();
|
|
@@ -5641,21 +5661,21 @@ const Qu = {
|
|
|
5641
5661
|
mt = !1;
|
|
5642
5662
|
}
|
|
5643
5663
|
}
|
|
5644
|
-
Ut(), ol(), Me = [],
|
|
5664
|
+
Ut(), ol(), Me = [], F.value = [], je = null, Xe = "__null__", $.value = null, n("update:modelValue", null);
|
|
5645
5665
|
}
|
|
5646
5666
|
}
|
|
5647
|
-
function
|
|
5667
|
+
function na() {
|
|
5648
5668
|
r.value || !ut || rn(ut);
|
|
5649
5669
|
}
|
|
5650
|
-
function
|
|
5651
|
-
if (!
|
|
5670
|
+
function aa(i) {
|
|
5671
|
+
if (!I || !T) return;
|
|
5652
5672
|
const f = [i[1], i[0]];
|
|
5653
|
-
Ke || (Ke = new T.Marker({ color: "#2563eb" })), Ke.setLngLat(f).addTo(
|
|
5673
|
+
Ke || (Ke = new T.Marker({ color: "#2563eb" })), Ke.setLngLat(f).addTo(I), I.easeTo({ center: f, zoom: 13, duration: 250 });
|
|
5654
5674
|
}
|
|
5655
|
-
function
|
|
5675
|
+
function ra() {
|
|
5656
5676
|
r.value || P.value?.click();
|
|
5657
5677
|
}
|
|
5658
|
-
function
|
|
5678
|
+
function oa() {
|
|
5659
5679
|
r.value || (ve.value = !ve.value);
|
|
5660
5680
|
}
|
|
5661
5681
|
function on(i) {
|
|
@@ -5663,16 +5683,16 @@ const Qu = {
|
|
|
5663
5683
|
const f = ae.value;
|
|
5664
5684
|
f && !f.contains(i.target) && (ve.value = !1);
|
|
5665
5685
|
}
|
|
5666
|
-
function oa() {
|
|
5667
|
-
ve.value = !1, aa();
|
|
5668
|
-
}
|
|
5669
5686
|
function sa() {
|
|
5670
|
-
|
|
5687
|
+
ve.value = !1, ra();
|
|
5671
5688
|
}
|
|
5672
5689
|
function ia() {
|
|
5673
|
-
|
|
5690
|
+
r.value || (lt.value = [], ve.value = !1, we.value = !0);
|
|
5674
5691
|
}
|
|
5675
5692
|
function ua() {
|
|
5693
|
+
we.value = !1, lt.value = [];
|
|
5694
|
+
}
|
|
5695
|
+
function da() {
|
|
5676
5696
|
if (r.value || !q) return;
|
|
5677
5697
|
const i = Ui(
|
|
5678
5698
|
qe.value.coordinates ?? "",
|
|
@@ -5680,7 +5700,7 @@ const Qu = {
|
|
|
5680
5700
|
qe.value.order || "lat-lon"
|
|
5681
5701
|
);
|
|
5682
5702
|
if (!i.ok) {
|
|
5683
|
-
lt.value = i.errors,
|
|
5703
|
+
lt.value = i.errors, ca(i.errors);
|
|
5684
5704
|
return;
|
|
5685
5705
|
}
|
|
5686
5706
|
lt.value = [], sl({
|
|
@@ -5692,7 +5712,7 @@ const Qu = {
|
|
|
5692
5712
|
message: "Полігон був автоматично замкнений (перша і остання точки різнилися)."
|
|
5693
5713
|
});
|
|
5694
5714
|
}
|
|
5695
|
-
function
|
|
5715
|
+
function ca(i) {
|
|
5696
5716
|
if (!i.length) return;
|
|
5697
5717
|
const f = 5;
|
|
5698
5718
|
i.slice(0, f).forEach((b) => {
|
|
@@ -5708,7 +5728,7 @@ const Qu = {
|
|
|
5708
5728
|
message: `Ще помилок: ${i.length - f}`
|
|
5709
5729
|
});
|
|
5710
5730
|
}
|
|
5711
|
-
function
|
|
5731
|
+
function fa(i) {
|
|
5712
5732
|
if (r.value || !q) return;
|
|
5713
5733
|
ve.value = !1;
|
|
5714
5734
|
const f = i.target, b = f.files?.[0];
|
|
@@ -5743,7 +5763,7 @@ const Qu = {
|
|
|
5743
5763
|
}), f.value = "";
|
|
5744
5764
|
}, V.readAsText(b);
|
|
5745
5765
|
}
|
|
5746
|
-
function
|
|
5766
|
+
function pa() {
|
|
5747
5767
|
if (r.value || !q) return;
|
|
5748
5768
|
const i = q.getAll(), f = new Blob([JSON.stringify(i, null, 2)], { type: "application/json" }), b = URL.createObjectURL(f), V = document.createElement("a");
|
|
5749
5769
|
V.href = b, V.download = "data.geojson", V.click(), URL.revokeObjectURL(b);
|
|
@@ -5753,14 +5773,14 @@ const Qu = {
|
|
|
5753
5773
|
const i = await Be();
|
|
5754
5774
|
T = i.maplibregl, le = i.MapboxDraw;
|
|
5755
5775
|
const f = Kt();
|
|
5756
|
-
f && (
|
|
5776
|
+
f && (I = new T.Map({
|
|
5757
5777
|
container: d.value,
|
|
5758
5778
|
style: Fe(f),
|
|
5759
5779
|
center: [Z.value[0], Z.value[1]],
|
|
5760
5780
|
zoom: te.value,
|
|
5761
5781
|
attributionControl: !1
|
|
5762
|
-
}), x.value =
|
|
5763
|
-
if (!(!le || !
|
|
5782
|
+
}), x.value = I, I.addControl(new T.NavigationControl({ showCompass: !0 }), "bottom-right"), I.on("load", () => {
|
|
5783
|
+
if (!(!le || !I)) {
|
|
5764
5784
|
if (q = new le({
|
|
5765
5785
|
displayControlsDefault: !1,
|
|
5766
5786
|
modes: {
|
|
@@ -5774,7 +5794,7 @@ const Qu = {
|
|
|
5774
5794
|
trash: !1
|
|
5775
5795
|
},
|
|
5776
5796
|
styles: Gt
|
|
5777
|
-
}),
|
|
5797
|
+
}), I.addControl(q), I.on("click", (b) => {
|
|
5778
5798
|
if (p.isRulerActive.value) {
|
|
5779
5799
|
const L = b?.lngLat;
|
|
5780
5800
|
if (!L) return;
|
|
@@ -5782,11 +5802,11 @@ const Qu = {
|
|
|
5782
5802
|
return;
|
|
5783
5803
|
}
|
|
5784
5804
|
if (!q || r.value || y.value !== "edit") return;
|
|
5785
|
-
const V =
|
|
5805
|
+
const V = Yn(b?.point);
|
|
5786
5806
|
!V || V === je || requestAnimationFrame(() => {
|
|
5787
5807
|
!q || r.value || $t(V);
|
|
5788
5808
|
});
|
|
5789
|
-
}),
|
|
5809
|
+
}), I.on("draw.create", () => {
|
|
5790
5810
|
if (q && !p.isRulerActive.value) {
|
|
5791
5811
|
if (!o.value) {
|
|
5792
5812
|
const b = q.getAll();
|
|
@@ -5797,10 +5817,10 @@ const Qu = {
|
|
|
5797
5817
|
}
|
|
5798
5818
|
Et(), $t();
|
|
5799
5819
|
}
|
|
5800
|
-
}),
|
|
5820
|
+
}), I.on("draw.update", (b) => {
|
|
5801
5821
|
if (!vt && !p.isRulerActive.value) {
|
|
5802
5822
|
if (b?.action === "move") {
|
|
5803
|
-
if (vt = !0,
|
|
5823
|
+
if (vt = !0, ea(), vt = !1, y.value === "edit") {
|
|
5804
5824
|
const V = Wt(), L = V ? Ql(V) : q?.getAll?.()?.features?.[0];
|
|
5805
5825
|
if (L?.id)
|
|
5806
5826
|
try {
|
|
@@ -5813,9 +5833,9 @@ const Qu = {
|
|
|
5813
5833
|
}
|
|
5814
5834
|
Et();
|
|
5815
5835
|
}
|
|
5816
|
-
}),
|
|
5836
|
+
}), I.on("draw.delete", () => {
|
|
5817
5837
|
xe || mt || p.isRulerActive.value || y.value === "marker" || y.value === "polyline" || y.value === "polygon" || y.value === "rectangle" || (Et(), q?.getAll?.()?.features?.length || (je = null), y.value = "", Ut());
|
|
5818
|
-
}),
|
|
5838
|
+
}), I.on("draw.selectionchange", (b) => {
|
|
5819
5839
|
if (!q || vt || p.isRulerActive.value || y.value === "marker" || y.value === "polyline" || y.value === "polygon" || y.value === "rectangle")
|
|
5820
5840
|
return;
|
|
5821
5841
|
const V = b?.features?.[0]?.id !== void 0 && b?.features?.[0]?.id !== null ? String(b.features[0].id) : null;
|
|
@@ -5849,13 +5869,13 @@ const Qu = {
|
|
|
5849
5869
|
V && U(V);
|
|
5850
5870
|
}), Se();
|
|
5851
5871
|
}
|
|
5852
|
-
}),
|
|
5853
|
-
|
|
5872
|
+
}), I.on("contextmenu", Jn), I.on("zoomend", () => {
|
|
5873
|
+
I && (te.value = I.getZoom());
|
|
5854
5874
|
}));
|
|
5855
5875
|
}), tl(() => {
|
|
5856
5876
|
p.isRulerActive.value && p.closeRuler(), window.removeEventListener("click", on, !0), Object.values(he).forEach((i) => {
|
|
5857
|
-
|
|
5858
|
-
}), Dt(), Ke?.remove && Ke.remove(), Ke = null,
|
|
5877
|
+
I && E(i);
|
|
5878
|
+
}), Dt(), Ke?.remove && Ke.remove(), Ke = null, I?.remove && I.remove(), I = null, q = null, x.value = null;
|
|
5859
5879
|
}), ce(
|
|
5860
5880
|
() => t.modelValue,
|
|
5861
5881
|
(i) => {
|
|
@@ -5882,7 +5902,7 @@ const Qu = {
|
|
|
5882
5902
|
const ie = nl(L, R);
|
|
5883
5903
|
b.push(ie), V.add(ie);
|
|
5884
5904
|
const fe = { ...L, id: ie }, Ue = he[ie], ot = Ue?.visible ?? !!fe.visible;
|
|
5885
|
-
Ue &&
|
|
5905
|
+
Ue && I && E(Ue), he[ie] = {
|
|
5886
5906
|
id: ie,
|
|
5887
5907
|
config: fe,
|
|
5888
5908
|
visible: ot,
|
|
@@ -5894,8 +5914,8 @@ const Qu = {
|
|
|
5894
5914
|
}), Object.keys(he).forEach((L) => {
|
|
5895
5915
|
if (V.has(L)) return;
|
|
5896
5916
|
const R = he[L];
|
|
5897
|
-
R &&
|
|
5898
|
-
}), _e.value = b,
|
|
5917
|
+
R && I && E(R), delete he[L];
|
|
5918
|
+
}), _e.value = b, I && (_e.value.forEach((L) => {
|
|
5899
5919
|
const R = he[L];
|
|
5900
5920
|
R && U(R);
|
|
5901
5921
|
}), Se());
|
|
@@ -5904,7 +5924,7 @@ const Qu = {
|
|
|
5904
5924
|
), ce(
|
|
5905
5925
|
() => G.value,
|
|
5906
5926
|
() => {
|
|
5907
|
-
|
|
5927
|
+
I && (me(), _e.value.forEach((i) => {
|
|
5908
5928
|
const f = he[i];
|
|
5909
5929
|
f && U(f);
|
|
5910
5930
|
}), Se());
|
|
@@ -5914,7 +5934,7 @@ const Qu = {
|
|
|
5914
5934
|
() => Q.value,
|
|
5915
5935
|
async (i) => {
|
|
5916
5936
|
if (ue.value = [], !i) {
|
|
5917
|
-
|
|
5937
|
+
I && (me(), _e.value.forEach((f) => {
|
|
5918
5938
|
const b = he[f];
|
|
5919
5939
|
b && U(b);
|
|
5920
5940
|
}), Se());
|
|
@@ -5928,7 +5948,7 @@ const Qu = {
|
|
|
5928
5948
|
} catch (f) {
|
|
5929
5949
|
console.error("Failed to fetch KATOTTG bounds", f);
|
|
5930
5950
|
} finally {
|
|
5931
|
-
if (!
|
|
5951
|
+
if (!I) return;
|
|
5932
5952
|
me(), _e.value.forEach((f) => {
|
|
5933
5953
|
const b = he[f];
|
|
5934
5954
|
b && U(b);
|
|
@@ -5941,15 +5961,15 @@ const Qu = {
|
|
|
5941
5961
|
(i) => {
|
|
5942
5962
|
if (!Array.isArray(i) || i.length !== 2) return;
|
|
5943
5963
|
const f = [Number(i[0]), Number(i[1])];
|
|
5944
|
-
if (nn(Z.value, f) || (Z.value = [...f], !
|
|
5945
|
-
const b =
|
|
5946
|
-
b && nn([b.lng, b.lat], Z.value) ||
|
|
5964
|
+
if (nn(Z.value, f) || (Z.value = [...f], !I)) return;
|
|
5965
|
+
const b = I.getCenter?.();
|
|
5966
|
+
b && nn([b.lng, b.lat], Z.value) || I.easeTo({ center: [Z.value[0], Z.value[1]] });
|
|
5947
5967
|
},
|
|
5948
5968
|
{ deep: !0 }
|
|
5949
5969
|
), ce(
|
|
5950
5970
|
() => W.value,
|
|
5951
5971
|
(i) => {
|
|
5952
|
-
typeof i == "number" && (te.value = i,
|
|
5972
|
+
typeof i == "number" && (te.value = i, I && I.setZoom(i));
|
|
5953
5973
|
}
|
|
5954
5974
|
), ce(r, (i) => {
|
|
5955
5975
|
i && Ut();
|
|
@@ -5961,7 +5981,7 @@ const Qu = {
|
|
|
5961
5981
|
dt || Ut();
|
|
5962
5982
|
}), ce(s, () => {
|
|
5963
5983
|
setTimeout(() => {
|
|
5964
|
-
|
|
5984
|
+
I?.resize && I.resize();
|
|
5965
5985
|
}, 50);
|
|
5966
5986
|
}), (i, f) => (u(), ge(el, {
|
|
5967
5987
|
to: "body",
|
|
@@ -5978,7 +5998,7 @@ const Qu = {
|
|
|
5978
5998
|
Re.value.search || Re.value.import || Re.value.export ? (u(), g("div", Qu, [
|
|
5979
5999
|
Re.value.search ? (u(), ge(nu, {
|
|
5980
6000
|
key: 0,
|
|
5981
|
-
onGoToCoordinates:
|
|
6001
|
+
onGoToCoordinates: aa
|
|
5982
6002
|
})) : j("", !0),
|
|
5983
6003
|
Re.value.import || Re.value.export ? (u(), g("div", ed, [
|
|
5984
6004
|
c("div", td, [
|
|
@@ -5991,7 +6011,7 @@ const Qu = {
|
|
|
5991
6011
|
c("button", {
|
|
5992
6012
|
type: "button",
|
|
5993
6013
|
class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",
|
|
5994
|
-
onClick:
|
|
6014
|
+
onClick: oa,
|
|
5995
6015
|
disabled: r.value
|
|
5996
6016
|
}, [
|
|
5997
6017
|
f[8] || (f[8] = Pe(" Імпорт ", -1)),
|
|
@@ -6004,12 +6024,12 @@ const Qu = {
|
|
|
6004
6024
|
key: 0,
|
|
6005
6025
|
type: "button",
|
|
6006
6026
|
class: "block w-full text-left px-3 py-2 hover:bg-gray-100 text-gray-900",
|
|
6007
|
-
onClick:
|
|
6027
|
+
onClick: sa
|
|
6008
6028
|
}, " З файлу ")) : j("", !0),
|
|
6009
6029
|
c("button", {
|
|
6010
6030
|
type: "button",
|
|
6011
6031
|
class: "block w-full text-left px-3 py-2 hover:bg-gray-100 text-gray-900",
|
|
6012
|
-
onClick:
|
|
6032
|
+
onClick: ia
|
|
6013
6033
|
}, " З координат ")
|
|
6014
6034
|
])) : j("", !0)
|
|
6015
6035
|
], 512)) : j("", !0),
|
|
@@ -6017,7 +6037,7 @@ const Qu = {
|
|
|
6017
6037
|
key: 1,
|
|
6018
6038
|
type: "button",
|
|
6019
6039
|
class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white transition",
|
|
6020
|
-
onClick:
|
|
6040
|
+
onClick: pa,
|
|
6021
6041
|
disabled: r.value || m.value === 0
|
|
6022
6042
|
}, " Експорт ", 8, ad)) : j("", !0)
|
|
6023
6043
|
]),
|
|
@@ -6025,7 +6045,7 @@ const Qu = {
|
|
|
6025
6045
|
ref_key: "importRef",
|
|
6026
6046
|
ref: P,
|
|
6027
6047
|
type: "file",
|
|
6028
|
-
onChange:
|
|
6048
|
+
onChange: fa,
|
|
6029
6049
|
accept: ".json,.geojson",
|
|
6030
6050
|
class: "hidden",
|
|
6031
6051
|
disabled: r.value
|
|
@@ -6049,12 +6069,12 @@ const Qu = {
|
|
|
6049
6069
|
c("button", {
|
|
6050
6070
|
type: "button",
|
|
6051
6071
|
class: "px-3 py-2 rounded-md border border-gray-300 text-gray-700 text-sm hover:bg-gray-100",
|
|
6052
|
-
onClick:
|
|
6072
|
+
onClick: ua
|
|
6053
6073
|
}, " Скасувати "),
|
|
6054
6074
|
c("button", {
|
|
6055
6075
|
type: "button",
|
|
6056
6076
|
class: "px-3 py-2 rounded-md bg-blue-600 text-white text-sm hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
6057
|
-
onClick:
|
|
6077
|
+
onClick: da,
|
|
6058
6078
|
disabled: r.value
|
|
6059
6079
|
}, " Побудувати ", 8, sd)
|
|
6060
6080
|
])
|
|
@@ -6070,7 +6090,7 @@ const Qu = {
|
|
|
6070
6090
|
onClick: f[2] || (f[2] = (b) => il("marker")),
|
|
6071
6091
|
disabled: r.value
|
|
6072
6092
|
}, [
|
|
6073
|
-
H(N(
|
|
6093
|
+
H(N(Vn), { class: "h-4 w-4" })
|
|
6074
6094
|
], 10, dd)) : j("", !0),
|
|
6075
6095
|
Re.value.line ? (u(), g("button", {
|
|
6076
6096
|
key: 1,
|
|
@@ -6105,7 +6125,7 @@ const Qu = {
|
|
|
6105
6125
|
title: "Ruler",
|
|
6106
6126
|
onClick: h
|
|
6107
6127
|
}, [
|
|
6108
|
-
H(N(
|
|
6128
|
+
H(N(Mn), { class: "h-4 w-4" })
|
|
6109
6129
|
], 2)) : j("", !0),
|
|
6110
6130
|
c("button", {
|
|
6111
6131
|
class: "vs-btn mt-5",
|
|
@@ -6176,11 +6196,11 @@ const Qu = {
|
|
|
6176
6196
|
])
|
|
6177
6197
|
]),
|
|
6178
6198
|
c("div", $d, [
|
|
6179
|
-
|
|
6199
|
+
F.value.length || $.value ? (u(), g("div", Cd, [
|
|
6180
6200
|
c("div", Sd, [
|
|
6181
6201
|
c("div", Vd, [
|
|
6182
6202
|
f[10] || (f[10] = Pe(" Тип: ", -1)),
|
|
6183
|
-
|
|
6203
|
+
F.value.length <= 1 ? (u(), g("span", Md, re($.value ? ln($.value.type) : F.value[0]?.label || "—"), 1)) : (u(!0), g(be, { key: 1 }, Ce(F.value, (b, V) => (u(), g(be, {
|
|
6184
6204
|
key: b.id
|
|
6185
6205
|
}, [
|
|
6186
6206
|
c("button", {
|
|
@@ -6189,10 +6209,10 @@ const Qu = {
|
|
|
6189
6209
|
"font-bold underline-offset-2",
|
|
6190
6210
|
b.id === N(je) ? "text-blue-700 underline" : "text-gray-700 hover:text-blue-700 hover:underline"
|
|
6191
6211
|
]),
|
|
6192
|
-
onClick: (L) =>
|
|
6212
|
+
onClick: (L) => ta(b.id),
|
|
6193
6213
|
disabled: r.value
|
|
6194
6214
|
}, re(b.label), 11, Ld),
|
|
6195
|
-
V <
|
|
6215
|
+
V < F.value.length - 1 ? (u(), g("span", Dd, ", ")) : j("", !0)
|
|
6196
6216
|
], 64))), 128))
|
|
6197
6217
|
])
|
|
6198
6218
|
]),
|
|
@@ -6211,7 +6231,7 @@ const Qu = {
|
|
|
6211
6231
|
c("button", {
|
|
6212
6232
|
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",
|
|
6213
6233
|
title: "Zoom to feature",
|
|
6214
|
-
onClick:
|
|
6234
|
+
onClick: na,
|
|
6215
6235
|
disabled: r.value
|
|
6216
6236
|
}, [
|
|
6217
6237
|
H(N(La), { class: "h-3 w-3" })
|
|
@@ -6219,7 +6239,7 @@ const Qu = {
|
|
|
6219
6239
|
c("button", {
|
|
6220
6240
|
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",
|
|
6221
6241
|
title: "Delete feature",
|
|
6222
|
-
onClick:
|
|
6242
|
+
onClick: la,
|
|
6223
6243
|
disabled: r.value
|
|
6224
6244
|
}, [
|
|
6225
6245
|
H(N(Rt), { class: "h-4 w-4" })
|
|
@@ -6254,7 +6274,7 @@ const Qu = {
|
|
|
6254
6274
|
setup(e, { emit: l }) {
|
|
6255
6275
|
const t = e, n = l;
|
|
6256
6276
|
tt(t.style);
|
|
6257
|
-
const a = D(null), o = D(null), r = D(null), s = D(!1), d = D(""), m = Ae(e, "modelValue"), y =
|
|
6277
|
+
const a = D(null), o = D(null), r = D(null), s = D(!1), d = D(""), m = Ae(e, "modelValue"), y = k(() => t.placeholder || "Add tag…"), $ = k(() => m.value?.length === 0 && d.value === ""), F = k(() => !t.disabled && m.value?.length > 0), x = k(() => t.disabled), v = async () => {
|
|
6258
6278
|
x.value || await Qe(() => r.value?.focus());
|
|
6259
6279
|
}, p = (B) => {
|
|
6260
6280
|
const A = B.trim();
|
|
@@ -6265,7 +6285,7 @@ const Qu = {
|
|
|
6265
6285
|
}, w = (B) => {
|
|
6266
6286
|
const A = m.value.slice();
|
|
6267
6287
|
A.splice(B, 1), n("update:modelValue", A);
|
|
6268
|
-
},
|
|
6288
|
+
}, _ = () => {
|
|
6269
6289
|
n("update:modelValue", []);
|
|
6270
6290
|
}, M = () => {
|
|
6271
6291
|
x.value || (s.value = !0);
|
|
@@ -6347,13 +6367,13 @@ const Qu = {
|
|
|
6347
6367
|
])
|
|
6348
6368
|
], 512),
|
|
6349
6369
|
c("div", Wd, [
|
|
6350
|
-
|
|
6370
|
+
F.value ? (u(), g("button", {
|
|
6351
6371
|
key: 0,
|
|
6352
6372
|
type: "button",
|
|
6353
6373
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
6354
6374
|
"aria-label": "Clear all tags",
|
|
6355
6375
|
disabled: x.value,
|
|
6356
|
-
onClick: De(
|
|
6376
|
+
onClick: De(_, ["stop"])
|
|
6357
6377
|
}, [
|
|
6358
6378
|
H(N(bt), { class: "h-4 w-4" })
|
|
6359
6379
|
], 8, Yd)) : j("", !0)
|
|
@@ -6460,7 +6480,7 @@ const Qu = {
|
|
|
6460
6480
|
}),
|
|
6461
6481
|
emits: ["update:modelValue"],
|
|
6462
6482
|
setup(e) {
|
|
6463
|
-
const l = e, t = Ae(e, "modelValue"), n = D(!1), a =
|
|
6483
|
+
const l = e, t = Ae(e, "modelValue"), n = D(!1), a = k(() => l.init !== !1), o = k(() => !!l.table && !!l.code), r = () => {
|
|
6464
6484
|
if (!o.value) return "";
|
|
6465
6485
|
const m = encodeURIComponent(String(l.table)), y = encodeURIComponent(String(l.code));
|
|
6466
6486
|
return `/api/code-gen/${m}/${y}`;
|
|
@@ -6526,21 +6546,21 @@ const Qu = {
|
|
|
6526
6546
|
const t = (h) => `${h}-${Math.random().toString(36).substring(2, 15)}`, n = it("values"), a = e, o = l, r = a.addButtonText ?? "Додати", s = a.ignore ?? [], d = D([]), m = D(null);
|
|
6527
6547
|
(() => {
|
|
6528
6548
|
const h = a.parent && n?.value?.[a.parent] || a.modelValue || {};
|
|
6529
|
-
d.value = Object.entries(h).filter(([w]) => !s.includes(w)).map(([w,
|
|
6549
|
+
d.value = Object.entries(h).filter(([w]) => !s.includes(w)).map(([w, _]) => ({
|
|
6530
6550
|
id: t("key-value-"),
|
|
6531
6551
|
key: w,
|
|
6532
|
-
value:
|
|
6552
|
+
value: _
|
|
6533
6553
|
}));
|
|
6534
6554
|
})();
|
|
6535
6555
|
function $(h) {
|
|
6536
6556
|
m.value = h;
|
|
6537
6557
|
}
|
|
6538
|
-
function
|
|
6558
|
+
function F(h) {
|
|
6539
6559
|
if (m.value === null || m.value === h) return;
|
|
6540
6560
|
const w = d.value.splice(m.value, 1)[0];
|
|
6541
6561
|
d.value.splice(h, 0, w), m.value = null;
|
|
6542
6562
|
}
|
|
6543
|
-
const x =
|
|
6563
|
+
const x = k(() => d.value.some((h) => h.key && !h.value || !h.key && h.value)), v = () => {
|
|
6544
6564
|
d.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
6545
6565
|
}, p = (h) => {
|
|
6546
6566
|
d.value = d.value.filter((w) => w.id !== h);
|
|
@@ -6552,45 +6572,45 @@ const Qu = {
|
|
|
6552
6572
|
h.forEach((M) => {
|
|
6553
6573
|
M.key && M.value !== void 0 && (w[M.key] = M.value);
|
|
6554
6574
|
});
|
|
6555
|
-
const
|
|
6575
|
+
const _ = {};
|
|
6556
6576
|
s.length && s.forEach((M) => {
|
|
6557
|
-
|
|
6577
|
+
_[M] = a.parent ? n?.value?.[a.parent]?.[M] : void 0;
|
|
6558
6578
|
}), n?.value && a.parent && (n.value[a.parent] = {
|
|
6559
|
-
...
|
|
6579
|
+
..._,
|
|
6560
6580
|
...w
|
|
6561
6581
|
}), o("update:modelValue", w);
|
|
6562
6582
|
},
|
|
6563
6583
|
{ deep: !0 }
|
|
6564
6584
|
), (h, w) => (u(), g("div", ic, [
|
|
6565
6585
|
c("div", uc, [
|
|
6566
|
-
(u(!0), g(be, null, Ce(d.value, (
|
|
6567
|
-
key:
|
|
6586
|
+
(u(!0), g(be, null, Ce(d.value, (_, M) => (u(), g("div", {
|
|
6587
|
+
key: _.id,
|
|
6568
6588
|
class: X(["flex items-center gap-2 w-full", { "opacity-50": m.value === M }]),
|
|
6569
6589
|
draggable: "true",
|
|
6570
6590
|
onDragstart: (C) => $(M),
|
|
6571
6591
|
onDragover: w[0] || (w[0] = De(() => {
|
|
6572
6592
|
}, ["prevent"])),
|
|
6573
|
-
onDrop: (C) =>
|
|
6593
|
+
onDrop: (C) => F(M)
|
|
6574
6594
|
}, [
|
|
6575
6595
|
c("button", cc, [
|
|
6576
6596
|
H(N(zt), { class: "h-4 w-4" })
|
|
6577
6597
|
]),
|
|
6578
6598
|
c("div", fc, [
|
|
6579
6599
|
H(Jt, {
|
|
6580
|
-
modelValue:
|
|
6581
|
-
"onUpdate:modelValue": (C) =>
|
|
6600
|
+
modelValue: _.key,
|
|
6601
|
+
"onUpdate:modelValue": (C) => _.key = C,
|
|
6582
6602
|
placeholder: "Ключ"
|
|
6583
6603
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
6584
6604
|
]),
|
|
6585
6605
|
c("div", pc, [
|
|
6586
6606
|
H(Jt, {
|
|
6587
|
-
modelValue:
|
|
6588
|
-
"onUpdate:modelValue": (C) =>
|
|
6607
|
+
modelValue: _.value,
|
|
6608
|
+
"onUpdate:modelValue": (C) => _.value = C,
|
|
6589
6609
|
placeholder: "Значення"
|
|
6590
6610
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
6591
6611
|
]),
|
|
6592
6612
|
c("button", {
|
|
6593
|
-
onClick: (C) => p(
|
|
6613
|
+
onClick: (C) => p(_.id),
|
|
6594
6614
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
|
|
6595
6615
|
}, [
|
|
6596
6616
|
H(N(bt), { class: "h-4 w-4" })
|
|
@@ -6631,13 +6651,13 @@ const Qu = {
|
|
|
6631
6651
|
}),
|
|
6632
6652
|
emits: ["update:modelValue"],
|
|
6633
6653
|
setup(e) {
|
|
6634
|
-
const l = e, t = Ae(e, "modelValue"), n = D([]), a = D(null), o =
|
|
6654
|
+
const l = e, t = Ae(e, "modelValue"), n = D([]), a = D(null), o = k(() => !!l.disabled), r = k(() => l.placeholder ?? ""), s = k(() => l.addButtonText ?? "Додати");
|
|
6635
6655
|
let d = !1;
|
|
6636
6656
|
const m = (h) => `${h}-${Math.random().toString(36).substring(2, 15)}`, y = (h) => {
|
|
6637
6657
|
const w = h ?? t.value ?? [];
|
|
6638
|
-
n.value = w.map((
|
|
6658
|
+
n.value = w.map((_, M) => ({
|
|
6639
6659
|
id: n.value[M]?.id ?? m("text-array"),
|
|
6640
|
-
value:
|
|
6660
|
+
value: _ ?? ""
|
|
6641
6661
|
}));
|
|
6642
6662
|
};
|
|
6643
6663
|
y(), ce(
|
|
@@ -6657,8 +6677,8 @@ const Qu = {
|
|
|
6657
6677
|
},
|
|
6658
6678
|
{ deep: !0 }
|
|
6659
6679
|
);
|
|
6660
|
-
const $ =
|
|
6661
|
-
function
|
|
6680
|
+
const $ = k(() => o.value || n.value.some((h) => !h.value));
|
|
6681
|
+
function F() {
|
|
6662
6682
|
$.value || (n.value = [...n.value, { id: m("text-array"), value: "" }]);
|
|
6663
6683
|
}
|
|
6664
6684
|
function x(h) {
|
|
@@ -6669,13 +6689,13 @@ const Qu = {
|
|
|
6669
6689
|
}
|
|
6670
6690
|
function p(h) {
|
|
6671
6691
|
if (o.value || a.value === null || a.value === h) return;
|
|
6672
|
-
const w = [...n.value], [
|
|
6673
|
-
w.splice(h, 0,
|
|
6692
|
+
const w = [...n.value], [_] = w.splice(a.value, 1);
|
|
6693
|
+
w.splice(h, 0, _), n.value = w, a.value = null;
|
|
6674
6694
|
}
|
|
6675
6695
|
return (h, w) => (u(), g("div", xc, [
|
|
6676
6696
|
c("div", wc, [
|
|
6677
|
-
(u(!0), g(be, null, Ce(n.value, (
|
|
6678
|
-
key:
|
|
6697
|
+
(u(!0), g(be, null, Ce(n.value, (_, M) => (u(), g("div", {
|
|
6698
|
+
key: _.id,
|
|
6679
6699
|
class: X(["flex items-center gap-2 w-full", { "opacity-50": a.value === M }]),
|
|
6680
6700
|
draggable: "true",
|
|
6681
6701
|
onDragstart: (C) => v(M),
|
|
@@ -6693,29 +6713,29 @@ const Qu = {
|
|
|
6693
6713
|
c("div", $c, [
|
|
6694
6714
|
h.inputType === "text" ? (u(), ge(Jt, {
|
|
6695
6715
|
key: 0,
|
|
6696
|
-
modelValue:
|
|
6697
|
-
"onUpdate:modelValue": (C) =>
|
|
6716
|
+
modelValue: _.value,
|
|
6717
|
+
"onUpdate:modelValue": (C) => _.value = C,
|
|
6698
6718
|
disabled: o.value,
|
|
6699
6719
|
placeholder: r.value
|
|
6700
6720
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : j("", !0),
|
|
6701
|
-
h.inputType === "tel" ? (u(), ge(
|
|
6721
|
+
h.inputType === "tel" ? (u(), ge(In, {
|
|
6702
6722
|
key: 1,
|
|
6703
|
-
modelValue:
|
|
6704
|
-
"onUpdate:modelValue": (C) =>
|
|
6723
|
+
modelValue: _.value,
|
|
6724
|
+
"onUpdate:modelValue": (C) => _.value = C,
|
|
6705
6725
|
disabled: o.value,
|
|
6706
6726
|
placeholder: r.value
|
|
6707
6727
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : j("", !0),
|
|
6708
|
-
h.inputType === "email" ? (u(), ge(
|
|
6728
|
+
h.inputType === "email" ? (u(), ge(Fn, {
|
|
6709
6729
|
key: 2,
|
|
6710
|
-
modelValue:
|
|
6711
|
-
"onUpdate:modelValue": (C) =>
|
|
6730
|
+
modelValue: _.value,
|
|
6731
|
+
"onUpdate:modelValue": (C) => _.value = C,
|
|
6712
6732
|
disabled: o.value,
|
|
6713
6733
|
placeholder: r.value
|
|
6714
6734
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "placeholder"])) : j("", !0),
|
|
6715
|
-
h.inputType === "mask" ? (u(), ge(
|
|
6735
|
+
h.inputType === "mask" ? (u(), ge(An, {
|
|
6716
6736
|
key: 3,
|
|
6717
|
-
modelValue:
|
|
6718
|
-
"onUpdate:modelValue": (C) =>
|
|
6737
|
+
modelValue: _.value,
|
|
6738
|
+
"onUpdate:modelValue": (C) => _.value = C,
|
|
6719
6739
|
mask: h.mask,
|
|
6720
6740
|
disabled: o.value,
|
|
6721
6741
|
placeholder: r.value
|
|
@@ -6723,7 +6743,7 @@ const Qu = {
|
|
|
6723
6743
|
]),
|
|
6724
6744
|
c("button", {
|
|
6725
6745
|
type: "button",
|
|
6726
|
-
onClick: (C) => x(
|
|
6746
|
+
onClick: (C) => x(_.id),
|
|
6727
6747
|
disabled: o.value,
|
|
6728
6748
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200 disabled:opacity-50"
|
|
6729
6749
|
}, [
|
|
@@ -6735,7 +6755,7 @@ const Qu = {
|
|
|
6735
6755
|
c("div", Vc, [
|
|
6736
6756
|
c("button", {
|
|
6737
6757
|
type: "button",
|
|
6738
|
-
onClick:
|
|
6758
|
+
onClick: F,
|
|
6739
6759
|
disabled: $.value,
|
|
6740
6760
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
6741
6761
|
}, [
|
|
@@ -6760,10 +6780,10 @@ const Qu = {
|
|
|
6760
6780
|
},
|
|
6761
6781
|
emits: ["update:modelValue"],
|
|
6762
6782
|
setup(e, { emit: l }) {
|
|
6763
|
-
const t = e, { inputClass: n } = tt(t.style), a = l, o =
|
|
6783
|
+
const t = e, { inputClass: n } = tt(t.style), a = l, o = k({
|
|
6764
6784
|
get: () => t.modelValue || "#000000",
|
|
6765
6785
|
set: (s) => a("update:modelValue", s)
|
|
6766
|
-
}), r =
|
|
6786
|
+
}), r = k(() => !!t.disabled);
|
|
6767
6787
|
return (s, d) => (u(), g("div", Ac, [
|
|
6768
6788
|
ke(c("input", {
|
|
6769
6789
|
type: "color",
|
|
@@ -6802,10 +6822,10 @@ const Qu = {
|
|
|
6802
6822
|
},
|
|
6803
6823
|
emits: ["update:modelValue"],
|
|
6804
6824
|
setup(e, { emit: l }) {
|
|
6805
|
-
const t = e, { inputClass: n } = tt(t.style), a = l, o =
|
|
6825
|
+
const t = e, { inputClass: n } = tt(t.style), a = l, o = k({
|
|
6806
6826
|
get: () => Number(t.modelValue ?? t.min),
|
|
6807
6827
|
set: (s) => a("update:modelValue", Number(s))
|
|
6808
|
-
}), r =
|
|
6828
|
+
}), r = k(() => !!t.disabled);
|
|
6809
6829
|
return (s, d) => (u(), g("div", Bc, [
|
|
6810
6830
|
ke(c("input", {
|
|
6811
6831
|
type: "range",
|
|
@@ -6853,7 +6873,7 @@ const Qu = {
|
|
|
6853
6873
|
}),
|
|
6854
6874
|
emits: ["update:modelValue"],
|
|
6855
6875
|
setup(e) {
|
|
6856
|
-
const l = e, t = D(l.count), n =
|
|
6876
|
+
const l = e, t = D(l.count), n = k(() => l.limit), { inputClass: a } = tt(l.style), o = Ae(e, "modelValue"), r = k(() => !!l.disabled), s = k(() => l.placeholder ?? "");
|
|
6857
6877
|
Zt(() => {
|
|
6858
6878
|
const p = o.value?.length ?? 0;
|
|
6859
6879
|
p < t.value && (o.value = [
|
|
@@ -6877,17 +6897,17 @@ const Qu = {
|
|
|
6877
6897
|
},
|
|
6878
6898
|
lazy: !1
|
|
6879
6899
|
}), m.value[h].on("accept", () => {
|
|
6880
|
-
const
|
|
6881
|
-
|
|
6900
|
+
const _ = [...o.value || []];
|
|
6901
|
+
_[h] = l.unmask ? m.value[h].unmaskedValue : m.value[h].value, o.value = _;
|
|
6882
6902
|
}), m.value[h].on("complete", () => {
|
|
6883
|
-
const
|
|
6884
|
-
|
|
6903
|
+
const _ = [...o.value || []];
|
|
6904
|
+
_[h] = l.unmask ? m.value[h].unmaskedValue : m.value[h].value, o.value = _;
|
|
6885
6905
|
}), o.value?.[h] && (m.value[h].value = o.value[h]);
|
|
6886
6906
|
}
|
|
6887
|
-
function
|
|
6907
|
+
function F(p, h) {
|
|
6888
6908
|
if (r.value) return;
|
|
6889
|
-
const w = p.target.value ?? null,
|
|
6890
|
-
|
|
6909
|
+
const w = p.target.value ?? null, _ = [...o.value];
|
|
6910
|
+
_[h] = l.inputType === "text" ? w : Number(w), o.value = _;
|
|
6891
6911
|
}
|
|
6892
6912
|
function x() {
|
|
6893
6913
|
t.value += 1;
|
|
@@ -6899,11 +6919,11 @@ const Qu = {
|
|
|
6899
6919
|
}
|
|
6900
6920
|
function v(p) {
|
|
6901
6921
|
if (t.value > 1) {
|
|
6902
|
-
m.value[p] && (m.value[p].destroy(), delete m.value[p]), t.value -= 1, o.value = o.value.filter((w,
|
|
6922
|
+
m.value[p] && (m.value[p].destroy(), delete m.value[p]), t.value -= 1, o.value = o.value.filter((w, _) => _ !== p);
|
|
6903
6923
|
const h = {};
|
|
6904
6924
|
Object.keys(m.value).forEach((w) => {
|
|
6905
|
-
const
|
|
6906
|
-
|
|
6925
|
+
const _ = parseInt(w, 10);
|
|
6926
|
+
_ > p ? h[_ - 1] = m.value[_] : _ < p && (h[_] = m.value[_]);
|
|
6907
6927
|
}), m.value = h;
|
|
6908
6928
|
}
|
|
6909
6929
|
}
|
|
@@ -6941,7 +6961,7 @@ const Qu = {
|
|
|
6941
6961
|
key: 0,
|
|
6942
6962
|
type: "text",
|
|
6943
6963
|
ref_for: !0,
|
|
6944
|
-
ref: (
|
|
6964
|
+
ref: (_) => y(_, w - 1),
|
|
6945
6965
|
placeholder: p.placeholder,
|
|
6946
6966
|
disabled: p.disabled,
|
|
6947
6967
|
name: `${p.name}[${w - 1}]`,
|
|
@@ -6953,7 +6973,7 @@ const Qu = {
|
|
|
6953
6973
|
key: 1,
|
|
6954
6974
|
type: p.inputType,
|
|
6955
6975
|
value: o.value?.[w - 1],
|
|
6956
|
-
onInput: (
|
|
6976
|
+
onInput: (_) => F(_, w - 1),
|
|
6957
6977
|
placeholder: s.value,
|
|
6958
6978
|
disabled: r.value,
|
|
6959
6979
|
class: X(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [N(a), { "!border-red-600": p.error }]]),
|
|
@@ -6972,7 +6992,7 @@ const Qu = {
|
|
|
6972
6992
|
!p.disabled && t.value > 1 && p.isAdded ? (u(), g("button", {
|
|
6973
6993
|
key: 3,
|
|
6974
6994
|
type: "button",
|
|
6975
|
-
onClick: De((
|
|
6995
|
+
onClick: De((_) => v(w - 1), ["stop"]),
|
|
6976
6996
|
class: "cursor-pointer shrink-0 w-[38px] text-red-600 h-[38px] rounded-md flex items-center justify-center border border-stone-200 hover:bg-stone-100"
|
|
6977
6997
|
}, [
|
|
6978
6998
|
H(N(bt), { class: "h-4 w-4" })
|
|
@@ -7014,55 +7034,55 @@ const Qu = {
|
|
|
7014
7034
|
}),
|
|
7015
7035
|
emits: /* @__PURE__ */ Ve(["change", "update:modelValue", "value-selected"], ["update:modelValue"]),
|
|
7016
7036
|
setup(e, { emit: l }) {
|
|
7017
|
-
const t = e, n = l, a = Ae(e, "modelValue"), o = D([]), r = D(t.options ?? []), s = D({}), d = D({}), m = D({ keyword: "", parent: null }), y = D(""), $ = D(!1),
|
|
7018
|
-
let
|
|
7019
|
-
const C = it("values"), S =
|
|
7037
|
+
const t = e, n = l, a = Ae(e, "modelValue"), o = D([]), r = D(t.options ?? []), s = D({}), d = D({}), m = D({ keyword: "", parent: null }), y = D(""), $ = D(!1), F = D(null), x = D(null), v = D(null), p = D(null), h = D(null), w = D({});
|
|
7038
|
+
let _ = !1, M = !1;
|
|
7039
|
+
const C = it("values"), S = k(() => !!t.disabled), B = k(() => t.placeholder ?? "Оберіть значення"), A = k(() => t.search !== !1), z = k(() => {
|
|
7020
7040
|
const T = t.parent ?? t.parentValue;
|
|
7021
7041
|
return T ? String(T) : "";
|
|
7022
|
-
}), W =
|
|
7042
|
+
}), W = k(() => z.value ? C?.value?.[z.value] ?? null : null), Q = (T) => T == null ? "__null__" : String(T), Y = (T) => {
|
|
7023
7043
|
if (!T) return "";
|
|
7024
7044
|
const le = T.label ?? T.text ?? T.name ?? T.ua ?? T.en;
|
|
7025
7045
|
return le ? String(le) : T.id !== void 0 && T.id !== null ? String(T.id) : "";
|
|
7026
7046
|
}, G = (T) => {
|
|
7027
7047
|
const le = Q(T);
|
|
7028
7048
|
return d.value[le] || (d.value[le] = `array-select-${le}-${Math.random().toString(36).slice(2, 8)}`), d.value[le];
|
|
7029
|
-
}, Z =
|
|
7049
|
+
}, Z = k(() => new Set(o.value.map((T) => Q(T.id)))), te = k(() => {
|
|
7030
7050
|
const T = Z.value;
|
|
7031
7051
|
let le = [...r.value];
|
|
7032
7052
|
if (!t.data && y.value.trim()) {
|
|
7033
|
-
const
|
|
7034
|
-
le = le.filter((q) => Y(q).toLowerCase().includes(
|
|
7053
|
+
const I = y.value.toLowerCase();
|
|
7054
|
+
le = le.filter((q) => Y(q).toLowerCase().includes(I));
|
|
7035
7055
|
}
|
|
7036
|
-
return le.filter((
|
|
7056
|
+
return le.filter((I) => !T.has(Q(I.id)));
|
|
7037
7057
|
}), J = () => {
|
|
7038
7058
|
if (!t.data) return "";
|
|
7039
7059
|
const T = t.prefix ?? "api", le = t.api ?? `/${T}/suggest/${t.data}`;
|
|
7040
7060
|
return `${t.host ?? ""}${le}`;
|
|
7041
7061
|
}, P = () => {
|
|
7042
|
-
o.value.length && (
|
|
7062
|
+
o.value.length && (_ = !0, o.value = o.value.map((T) => ({
|
|
7043
7063
|
...T,
|
|
7044
7064
|
text: s.value[Q(T.id)] ?? T.text
|
|
7045
7065
|
})));
|
|
7046
7066
|
}, ae = (T) => {
|
|
7047
|
-
const le = Q(T.id),
|
|
7048
|
-
|
|
7067
|
+
const le = Q(T.id), I = Y(T);
|
|
7068
|
+
I && (s.value[le] = I);
|
|
7049
7069
|
}, ue = (T) => {
|
|
7050
7070
|
r.value = T ? [...T] : [], T?.forEach(ae), P();
|
|
7051
7071
|
}, ve = (T) => {
|
|
7052
7072
|
if (!T.length) return;
|
|
7053
|
-
const le = new Map(r.value.map((
|
|
7054
|
-
T.forEach((
|
|
7055
|
-
const q = Q(
|
|
7056
|
-
le.set(q,
|
|
7073
|
+
const le = new Map(r.value.map((I) => [Q(I.id), I]));
|
|
7074
|
+
T.forEach((I) => {
|
|
7075
|
+
const q = Q(I.id);
|
|
7076
|
+
le.set(q, I), ae(I);
|
|
7057
7077
|
}), r.value = Array.from(le.values()), P();
|
|
7058
7078
|
}, we = async (T = "") => {
|
|
7059
7079
|
if (!t.data) return [];
|
|
7060
7080
|
const le = J();
|
|
7061
7081
|
if (!le) return [];
|
|
7062
|
-
const
|
|
7063
|
-
|
|
7082
|
+
const I = new URLSearchParams();
|
|
7083
|
+
I.set("json", "1"), T && I.set("key", T), t.start === 1 && I.set("start", "1"), W.value !== null && W.value !== void 0 && W.value !== "" && I.set("parent", String(W.value));
|
|
7064
7084
|
try {
|
|
7065
|
-
return (await (await fetch(`${le}?${
|
|
7085
|
+
return (await (await fetch(`${le}?${I.toString()}`)).json())?.data ?? [];
|
|
7066
7086
|
} catch {
|
|
7067
7087
|
return [];
|
|
7068
7088
|
}
|
|
@@ -7070,8 +7090,8 @@ const Qu = {
|
|
|
7070
7090
|
if (!t.data || !T.length) return [];
|
|
7071
7091
|
const le = J();
|
|
7072
7092
|
if (!le) return [];
|
|
7073
|
-
const
|
|
7074
|
-
q.set("json", "1"), q.set("val",
|
|
7093
|
+
const I = Array.from(new Set(T.map((Me) => Q(Me)))), q = new URLSearchParams();
|
|
7094
|
+
q.set("json", "1"), q.set("val", I.join(",")), t.start === 1 && q.set("start", "1"), W.value !== null && W.value !== void 0 && W.value !== "" && q.set("parent", String(W.value));
|
|
7075
7095
|
try {
|
|
7076
7096
|
const Xe = (await (await fetch(`${le}?${q.toString()}`)).json())?.data ?? [];
|
|
7077
7097
|
return ve(Xe), Xe;
|
|
@@ -7080,25 +7100,25 @@ const Qu = {
|
|
|
7080
7100
|
}
|
|
7081
7101
|
}, qe = async (T = "", { force: le = !1 } = {}) => {
|
|
7082
7102
|
if (!t.data) return;
|
|
7083
|
-
const
|
|
7084
|
-
if (!le && m.value.keyword === T && m.value.parent ===
|
|
7085
|
-
m.value = { keyword: T, parent:
|
|
7103
|
+
const I = W.value ?? null;
|
|
7104
|
+
if (!le && m.value.keyword === T && m.value.parent === I && r.value.length > 0) return;
|
|
7105
|
+
m.value = { keyword: T, parent: I };
|
|
7086
7106
|
const Me = await we(T);
|
|
7087
7107
|
ue(Me);
|
|
7088
7108
|
}, de = ((T, le = 200) => {
|
|
7089
|
-
let
|
|
7109
|
+
let I;
|
|
7090
7110
|
return (...q) => {
|
|
7091
|
-
|
|
7111
|
+
I && clearTimeout(I), I = setTimeout(() => T(...q), le);
|
|
7092
7112
|
};
|
|
7093
7113
|
})(async (T) => {
|
|
7094
7114
|
t.data && await qe(T, { force: !0 });
|
|
7095
7115
|
}, 250), xe = D(null), he = () => {
|
|
7096
7116
|
if (!v.value) return;
|
|
7097
|
-
const T = v.value.getBoundingClientRect(), le = window.innerHeight ?? document.documentElement.clientHeight,
|
|
7117
|
+
const T = v.value.getBoundingClientRect(), le = window.innerHeight ?? document.documentElement.clientHeight, I = window.innerWidth ?? document.documentElement.clientWidth, q = 8, Me = 8, ut = t.maxHeight ?? 280, Xe = le - T.bottom - Me - q, je = T.top - Me - q, mt = Xe >= je, vt = Math.max(I - q * 2, 0);
|
|
7098
7118
|
let { width: dt } = T;
|
|
7099
7119
|
vt > 0 && dt > vt && (dt = vt);
|
|
7100
7120
|
let { left: Ke } = T;
|
|
7101
|
-
Ke + dt + q >
|
|
7121
|
+
Ke + dt + q > I && (Ke = I - dt - q), Ke = Math.max(Ke, q);
|
|
7102
7122
|
const Lt = Math.min(
|
|
7103
7123
|
ut,
|
|
7104
7124
|
Math.max(mt ? Xe : je, 50)
|
|
@@ -7153,16 +7173,16 @@ const Qu = {
|
|
|
7153
7173
|
const le = Q(T.id);
|
|
7154
7174
|
if (Z.value.has(le)) return;
|
|
7155
7175
|
ae(T);
|
|
7156
|
-
const
|
|
7176
|
+
const I = {
|
|
7157
7177
|
id: T.id,
|
|
7158
7178
|
text: Y(T) || String(T.id ?? ""),
|
|
7159
7179
|
key: G(T.id)
|
|
7160
7180
|
};
|
|
7161
|
-
o.value = [...o.value,
|
|
7181
|
+
o.value = [...o.value, I], ee(T), y.value = "", Qe(() => {
|
|
7162
7182
|
h.value?.focus();
|
|
7163
7183
|
});
|
|
7164
7184
|
}, ee = (T) => {
|
|
7165
|
-
const le = o.value.map((
|
|
7185
|
+
const le = o.value.map((I) => I.id);
|
|
7166
7186
|
n("value-selected", {
|
|
7167
7187
|
name: t.name,
|
|
7168
7188
|
value: le,
|
|
@@ -7170,33 +7190,33 @@ const Qu = {
|
|
|
7170
7190
|
});
|
|
7171
7191
|
}, ne = (T) => {
|
|
7172
7192
|
if (S.value) return;
|
|
7173
|
-
const le = o.value.filter((
|
|
7193
|
+
const le = o.value.filter((I) => Q(I.id) !== Q(T));
|
|
7174
7194
|
o.value = le;
|
|
7175
7195
|
}, pe = (T) => {
|
|
7176
|
-
S.value || (
|
|
7196
|
+
S.value || (F.value = T);
|
|
7177
7197
|
}, ye = (T) => {
|
|
7178
|
-
if (S.value ||
|
|
7179
|
-
const le = [...o.value], [
|
|
7180
|
-
le.splice(T, 0,
|
|
7198
|
+
if (S.value || F.value === null || F.value === T) return;
|
|
7199
|
+
const le = [...o.value], [I] = le.splice(F.value, 1);
|
|
7200
|
+
le.splice(T, 0, I), F.value = null, o.value = le;
|
|
7181
7201
|
}, Be = async () => {
|
|
7182
7202
|
const le = (Array.isArray(a.value) ? [...a.value] : []).filter((q) => q != null);
|
|
7183
7203
|
if (t.data && le.length) {
|
|
7184
7204
|
const q = le.filter((Me) => !s.value[Q(Me)]);
|
|
7185
7205
|
q.length && await lt(q);
|
|
7186
7206
|
}
|
|
7187
|
-
const
|
|
7207
|
+
const I = le.map((q) => ({
|
|
7188
7208
|
id: q,
|
|
7189
7209
|
text: s.value[Q(q)] ?? String(q),
|
|
7190
7210
|
key: G(q)
|
|
7191
7211
|
}));
|
|
7192
|
-
|
|
7212
|
+
_ = !0, o.value = I;
|
|
7193
7213
|
};
|
|
7194
7214
|
ce(o, (T) => {
|
|
7195
|
-
if (
|
|
7196
|
-
|
|
7215
|
+
if (_) {
|
|
7216
|
+
_ = !1;
|
|
7197
7217
|
return;
|
|
7198
7218
|
}
|
|
7199
|
-
const le = T.map((
|
|
7219
|
+
const le = T.map((I) => I.id);
|
|
7200
7220
|
M = !0, a.value = le, n("change", le);
|
|
7201
7221
|
}, { deep: !0 }), ce(a, () => {
|
|
7202
7222
|
if (M) {
|
|
@@ -7254,7 +7274,7 @@ const Qu = {
|
|
|
7254
7274
|
ke(c("input", {
|
|
7255
7275
|
ref_key: "inputRef",
|
|
7256
7276
|
ref: h,
|
|
7257
|
-
"onUpdate:modelValue": le[0] || (le[0] = (
|
|
7277
|
+
"onUpdate:modelValue": le[0] || (le[0] = (I) => y.value = I),
|
|
7258
7278
|
placeholder: B.value,
|
|
7259
7279
|
disabled: S.value,
|
|
7260
7280
|
readonly: !A.value,
|
|
@@ -7282,13 +7302,13 @@ const Qu = {
|
|
|
7282
7302
|
style: Te(w.value)
|
|
7283
7303
|
}, [
|
|
7284
7304
|
c("div", qc, [
|
|
7285
|
-
(u(!0), g(be, null, Ce(te.value, (
|
|
7286
|
-
key: Q(
|
|
7305
|
+
(u(!0), g(be, null, Ce(te.value, (I) => (u(), g("button", {
|
|
7306
|
+
key: Q(I.id),
|
|
7287
7307
|
type: "button",
|
|
7288
7308
|
class: "w-full px-3 py-2 text-left text-sm text-stone-900 hover:bg-stone-100 disabled:opacity-50",
|
|
7289
|
-
onClick: De((q) => O(
|
|
7309
|
+
onClick: De((q) => O(I), ["stop"]),
|
|
7290
7310
|
disabled: S.value
|
|
7291
|
-
}, re(Y(
|
|
7311
|
+
}, re(Y(I)), 9, Gc))), 128)),
|
|
7292
7312
|
te.value.length === 0 ? (u(), g("p", Kc, " Немає варіантів ")) : j("", !0)
|
|
7293
7313
|
])
|
|
7294
7314
|
], 4)) : j("", !0)
|
|
@@ -7298,15 +7318,15 @@ const Qu = {
|
|
|
7298
7318
|
]))
|
|
7299
7319
|
]),
|
|
7300
7320
|
c("div", Wc, [
|
|
7301
|
-
(u(!0), g(be, null, Ce(o.value, (
|
|
7302
|
-
key:
|
|
7303
|
-
class: X(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2", { "opacity-60":
|
|
7321
|
+
(u(!0), g(be, null, Ce(o.value, (I, q) => (u(), g("div", {
|
|
7322
|
+
key: I.key,
|
|
7323
|
+
class: X(["flex items-center gap-2 rounded-md border border-stone-200 bg-white px-2 py-2", { "opacity-60": F.value === q }]),
|
|
7304
7324
|
draggable: "true",
|
|
7305
7325
|
onDragstart: (Me) => pe(q),
|
|
7306
7326
|
onDragover: le[3] || (le[3] = De(() => {
|
|
7307
7327
|
}, ["prevent"])),
|
|
7308
7328
|
onDrop: (Me) => ye(q),
|
|
7309
|
-
onDragend: le[4] || (le[4] = (Me) =>
|
|
7329
|
+
onDragend: le[4] || (le[4] = (Me) => F.value = null)
|
|
7310
7330
|
}, [
|
|
7311
7331
|
c("button", {
|
|
7312
7332
|
type: "button",
|
|
@@ -7318,14 +7338,14 @@ const Qu = {
|
|
|
7318
7338
|
], 8, Zc),
|
|
7319
7339
|
c("div", {
|
|
7320
7340
|
class: "flex-1 text-sm text-stone-900",
|
|
7321
|
-
title:
|
|
7322
|
-
}, re(
|
|
7341
|
+
title: I.text
|
|
7342
|
+
}, re(I.text), 9, Jc),
|
|
7323
7343
|
c("button", {
|
|
7324
7344
|
type: "button",
|
|
7325
7345
|
class: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-stone-400 hover:text-stone-900",
|
|
7326
7346
|
disabled: S.value,
|
|
7327
|
-
onClick: De((Me) => ne(
|
|
7328
|
-
"aria-label": `Видалити ${
|
|
7347
|
+
onClick: De((Me) => ne(I.id), ["stop"]),
|
|
7348
|
+
"aria-label": `Видалити ${I.text}`
|
|
7329
7349
|
}, [
|
|
7330
7350
|
H(N(bt), { class: "h-4 w-4" })
|
|
7331
7351
|
], 8, Xc)
|
|
@@ -7362,7 +7382,7 @@ const Qu = {
|
|
|
7362
7382
|
}),
|
|
7363
7383
|
emits: /* @__PURE__ */ Ve(["update:modelValue", "update:geom"], ["update:modelValue"]),
|
|
7364
7384
|
setup(e, { emit: l }) {
|
|
7365
|
-
const t = /{{\s*([^}]+?)\s*}}/g, n = e, a = l, { inputClass: o } = tt(n.style), r = Ae(e, "modelValue"), s =
|
|
7385
|
+
const t = /{{\s*([^}]+?)\s*}}/g, n = e, a = l, { inputClass: o } = tt(n.style), r = Ae(e, "modelValue"), s = k({
|
|
7366
7386
|
get: () => r.value,
|
|
7367
7387
|
set: (A) => {
|
|
7368
7388
|
r.value = A;
|
|
@@ -7373,7 +7393,7 @@ const Qu = {
|
|
|
7373
7393
|
}), It(() => {
|
|
7374
7394
|
typeof document > "u" || ($.value != null ? document.body.style.overflow = $.value : document.body.style.removeProperty("overflow"));
|
|
7375
7395
|
});
|
|
7376
|
-
const
|
|
7396
|
+
const F = k(() => n.placeholder ?? ""), x = k(() => !!n.disabled), v = (A) => {
|
|
7377
7397
|
if (!A) return null;
|
|
7378
7398
|
if (Array.isArray(A)) return A;
|
|
7379
7399
|
if (typeof A == "string") {
|
|
@@ -7381,20 +7401,20 @@ const Qu = {
|
|
|
7381
7401
|
return z.length !== 4 ? null : z.map(Number);
|
|
7382
7402
|
}
|
|
7383
7403
|
return null;
|
|
7384
|
-
}, p =
|
|
7404
|
+
}, p = k(() => {
|
|
7385
7405
|
const A = v(n.bbox);
|
|
7386
7406
|
if (!A || A.length !== 4) return null;
|
|
7387
7407
|
const z = A.map(Number);
|
|
7388
7408
|
return z.some((W) => Number.isNaN(W)) ? null : z;
|
|
7389
|
-
}), h =
|
|
7409
|
+
}), h = k(() => {
|
|
7390
7410
|
const A = p.value;
|
|
7391
7411
|
if (!A) return "";
|
|
7392
7412
|
const [z, W, Q, Y] = A;
|
|
7393
7413
|
return `${z},${Math.max(W, Y)},${Q},${Math.min(W, Y)}`;
|
|
7394
7414
|
});
|
|
7395
|
-
|
|
7415
|
+
k(() => h.value ? "1" : "0");
|
|
7396
7416
|
const w = it("values");
|
|
7397
|
-
function
|
|
7417
|
+
function _() {
|
|
7398
7418
|
!x.value && s.value.trim() && M();
|
|
7399
7419
|
}
|
|
7400
7420
|
async function M() {
|
|
@@ -7443,11 +7463,11 @@ const Qu = {
|
|
|
7443
7463
|
ke(c("input", {
|
|
7444
7464
|
type: "text",
|
|
7445
7465
|
"onUpdate:modelValue": z[0] || (z[0] = (W) => s.value = W),
|
|
7446
|
-
placeholder:
|
|
7466
|
+
placeholder: F.value,
|
|
7447
7467
|
disabled: x.value,
|
|
7448
7468
|
class: X(["py-1.5 px-3 block w-full bg-white border rounded-md placeholder:text-gray-400 focus:ring-2 focus:ring-blue-500", [N(o), { "!border-red-600": n.error }]]),
|
|
7449
7469
|
style: { border: "1px solid #CFD9E0" },
|
|
7450
|
-
onKeydown: ha(De(
|
|
7470
|
+
onKeydown: ha(De(_, ["prevent"]), ["enter"])
|
|
7451
7471
|
}, null, 42, nf), [
|
|
7452
7472
|
[Ne, s.value]
|
|
7453
7473
|
]),
|
|
@@ -7501,7 +7521,7 @@ const Qu = {
|
|
|
7501
7521
|
]))
|
|
7502
7522
|
]));
|
|
7503
7523
|
}
|
|
7504
|
-
}),
|
|
7524
|
+
}), Nn = (e = "") => `${e}${Math.floor(Math.random() * 1e4)}`, ff = { class: "vs-datalist space-y-3" }, pf = { class: "space-y-3" }, mf = ["onClick", "disabled"], vf = {
|
|
7505
7525
|
key: 0,
|
|
7506
7526
|
class: "rounded-lg border border-dashed border-gray-200 p-4 text-sm text-gray-500"
|
|
7507
7527
|
}, gf = ["disabled"], yf = /* @__PURE__ */ oe({
|
|
@@ -7527,16 +7547,16 @@ const Qu = {
|
|
|
7527
7547
|
}),
|
|
7528
7548
|
emits: ["update:modelValue"],
|
|
7529
7549
|
setup(e) {
|
|
7530
|
-
const l = e, t = Ae(e, "modelValue"), n =
|
|
7550
|
+
const l = e, t = Ae(e, "modelValue"), n = k(() => Array.isArray(t.value) ? t.value : []), a = D([]), o = k(() => l.schema?.map((p) => ({
|
|
7531
7551
|
...p,
|
|
7532
7552
|
disabled: l.disabled || p.disabled
|
|
7533
|
-
})) ?? []), r =
|
|
7553
|
+
})) ?? []), r = k(() => o.value.map((p) => v(p))), s = k(() => l.disabled ? !1 : l.maxItems ? n.value.length < l.maxItems : !0), d = k(() => l.disabled || n.value.length <= (l.minItems || 0));
|
|
7534
7554
|
ce(() => n.value.length, () => {
|
|
7535
7555
|
m(), y();
|
|
7536
7556
|
}, { immediate: !0 }), ce(() => l.schema, y, { immediate: !0, deep: !0 });
|
|
7537
7557
|
function m() {
|
|
7538
7558
|
const p = n.value.length;
|
|
7539
|
-
a.value.length < p ? a.value = [...a.value, ...Array.from({ length: p - a.value.length }, () =>
|
|
7559
|
+
a.value.length < p ? a.value = [...a.value, ...Array.from({ length: p - a.value.length }, () => Nn())] : a.value.length > p && a.value.splice(p);
|
|
7540
7560
|
}
|
|
7541
7561
|
function y() {
|
|
7542
7562
|
if (!l.minItems || n.value.length >= l.minItems) return;
|
|
@@ -7549,7 +7569,7 @@ const Qu = {
|
|
|
7549
7569
|
p[h.name] = h?.default ?? null;
|
|
7550
7570
|
}), p;
|
|
7551
7571
|
}
|
|
7552
|
-
function
|
|
7572
|
+
function F() {
|
|
7553
7573
|
s.value && (t.value = [...n.value, $()], m());
|
|
7554
7574
|
}
|
|
7555
7575
|
function x(p) {
|
|
@@ -7562,22 +7582,22 @@ const Qu = {
|
|
|
7562
7582
|
}
|
|
7563
7583
|
return (p, h) => (u(), g("div", ff, [
|
|
7564
7584
|
c("div", pf, [
|
|
7565
|
-
(u(!0), g(be, null, Ce(n.value, (w,
|
|
7566
|
-
key: a.value[
|
|
7585
|
+
(u(!0), g(be, null, Ce(n.value, (w, _) => (u(), g("div", {
|
|
7586
|
+
key: a.value[_],
|
|
7567
7587
|
class: "flex items-center gap-3"
|
|
7568
7588
|
}, [
|
|
7569
7589
|
H(Ft, {
|
|
7570
7590
|
schema: r.value,
|
|
7571
7591
|
layout: "inline",
|
|
7572
7592
|
navigation: !1,
|
|
7573
|
-
values: n.value[
|
|
7574
|
-
"onUpdate:values": (M) => n.value[
|
|
7575
|
-
"form-id": a.value[
|
|
7593
|
+
values: n.value[_],
|
|
7594
|
+
"onUpdate:values": (M) => n.value[_] = M,
|
|
7595
|
+
"form-id": a.value[_]
|
|
7576
7596
|
}, null, 8, ["schema", "values", "onUpdate:values", "form-id"]),
|
|
7577
7597
|
c("button", {
|
|
7578
7598
|
type: "button",
|
|
7579
7599
|
class: "h-[38px] w-[38px] flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-50 rounded-lg transition-all disabled:opacity-40",
|
|
7580
|
-
onClick: (M) => x(
|
|
7600
|
+
onClick: (M) => x(_),
|
|
7581
7601
|
disabled: d.value
|
|
7582
7602
|
}, [
|
|
7583
7603
|
H(N(Rt), { class: "h-4 w-4" })
|
|
@@ -7588,7 +7608,7 @@ const Qu = {
|
|
|
7588
7608
|
c("button", {
|
|
7589
7609
|
type: "button",
|
|
7590
7610
|
class: "flex items-center gap-2 text-gray-600 hover:text-gray-900 font-medium transition-colors text-sm",
|
|
7591
|
-
onClick:
|
|
7611
|
+
onClick: F,
|
|
7592
7612
|
disabled: !s.value
|
|
7593
7613
|
}, [
|
|
7594
7614
|
H(N(ht), { class: "h-4 w-4" }),
|
|
@@ -7628,18 +7648,18 @@ const Qu = {
|
|
|
7628
7648
|
}),
|
|
7629
7649
|
emits: ["update:modelValue"],
|
|
7630
7650
|
setup(e) {
|
|
7631
|
-
const l = e, t = Ae(e, "modelValue"), n = D([]), a = D([]), o = D(0), r = D(null), s = D(null), d = D(null), m =
|
|
7651
|
+
const l = e, t = Ae(e, "modelValue"), n = D([]), a = D([]), o = D(0), r = D(null), s = D(null), d = D(null), m = k(() => l.groupLabel ?? "Group"), y = k(() => l.emptyLabel ?? "Ще немає груп"), $ = k(() => l.schema?.map((se) => ({
|
|
7632
7652
|
...se,
|
|
7633
7653
|
disabled: l.disabled || se.disabled
|
|
7634
|
-
})) ?? []),
|
|
7654
|
+
})) ?? []), F = k(() => $.value.map((se) => W(se))), x = k(() => l.view === "accordion"), v = k(() => !!(l.collapsible || x.value)), p = k(() => l.draggable !== !1), h = k(() => l.disabled ? !1 : l.maxGroups ? t.value.length < l.maxGroups : !0), w = k(() => l.disabled || t.value.length <= (l.minGroups || 0));
|
|
7635
7655
|
ce(() => t.value.length, () => {
|
|
7636
|
-
|
|
7656
|
+
_(), M(), C();
|
|
7637
7657
|
}, { immediate: !0 }), ce(() => l.schema, C, { immediate: !0, deep: !0 }), ce(() => l.view, () => {
|
|
7638
7658
|
M();
|
|
7639
7659
|
}, { immediate: !0 });
|
|
7640
|
-
function
|
|
7660
|
+
function _() {
|
|
7641
7661
|
const se = t.value.length;
|
|
7642
|
-
n.value.length < se ? n.value = [...n.value, ...Array.from({ length: se - n.value.length }, () =>
|
|
7662
|
+
n.value.length < se ? n.value = [...n.value, ...Array.from({ length: se - n.value.length }, () => Nn())] : n.value.length > se && n.value.splice(se);
|
|
7643
7663
|
}
|
|
7644
7664
|
function M() {
|
|
7645
7665
|
const se = t.value.length;
|
|
@@ -7657,10 +7677,10 @@ const Qu = {
|
|
|
7657
7677
|
}), se;
|
|
7658
7678
|
}
|
|
7659
7679
|
function B() {
|
|
7660
|
-
h.value && (t.value = [...t.value, S()],
|
|
7680
|
+
h.value && (t.value = [...t.value, S()], _(), M());
|
|
7661
7681
|
}
|
|
7662
7682
|
function A(se) {
|
|
7663
|
-
w.value || (t.value = t.value.filter((de, xe) => xe !== se),
|
|
7683
|
+
w.value || (t.value = t.value.filter((de, xe) => xe !== se), _(), x.value ? o.value >= t.value.length && (o.value = t.value.length - 1) : a.value.splice(se, 1), C());
|
|
7664
7684
|
}
|
|
7665
7685
|
function z(se) {
|
|
7666
7686
|
if (l.disabled) return;
|
|
@@ -7669,7 +7689,7 @@ const Qu = {
|
|
|
7669
7689
|
...t.value.slice(0, se + 1),
|
|
7670
7690
|
de,
|
|
7671
7691
|
...t.value.slice(se + 1)
|
|
7672
|
-
],
|
|
7692
|
+
], _(), x.value ? o.value > se && (o.value += 1) : a.value.splice(se + 1, 0, a.value[se] ?? !1);
|
|
7673
7693
|
}
|
|
7674
7694
|
function W(se) {
|
|
7675
7695
|
return {
|
|
@@ -7811,7 +7831,7 @@ const Qu = {
|
|
|
7811
7831
|
}, [
|
|
7812
7832
|
H(Ft, {
|
|
7813
7833
|
class: "vs-dataform__form",
|
|
7814
|
-
schema:
|
|
7834
|
+
schema: F.value,
|
|
7815
7835
|
layout: "inline",
|
|
7816
7836
|
navigation: !1,
|
|
7817
7837
|
values: t.value[he],
|
|
@@ -7857,7 +7877,7 @@ const Qu = {
|
|
|
7857
7877
|
}),
|
|
7858
7878
|
emits: ["update:modelValue"],
|
|
7859
7879
|
setup(e, { expose: l }) {
|
|
7860
|
-
const t = e, n = Ae(e, "modelValue"), a = D(null), o =
|
|
7880
|
+
const t = e, n = Ae(e, "modelValue"), a = D(null), o = k(() => typeof t.height == "number" ? `${t.height}px` : t.height || "280px");
|
|
7861
7881
|
let r = null, s = null, d = !1;
|
|
7862
7882
|
const m = () => {
|
|
7863
7883
|
if (s) return Promise.resolve(s);
|
|
@@ -7871,7 +7891,7 @@ const Qu = {
|
|
|
7871
7891
|
if (Array.from(document.styleSheets || []).some((A) => A?.href?.includes(C))) return;
|
|
7872
7892
|
const B = document.createElement("link");
|
|
7873
7893
|
B.rel = "stylesheet", B.href = C, document.head.appendChild(B);
|
|
7874
|
-
},
|
|
7894
|
+
}, _ = (C) => {
|
|
7875
7895
|
if (v[Bt]?.[C]) return v[Bt][C];
|
|
7876
7896
|
v[Bt] ||= {};
|
|
7877
7897
|
const S = Array.from(document.scripts).find((B) => B.src === C);
|
|
@@ -7891,7 +7911,7 @@ const Qu = {
|
|
|
7891
7911
|
}, z.onerror = (W) => A(W), document.body.appendChild(z);
|
|
7892
7912
|
}), v[Bt][C]);
|
|
7893
7913
|
}, M = "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs";
|
|
7894
|
-
return w(`${M}/editor/editor.main.min.css`), await
|
|
7914
|
+
return w(`${M}/editor/editor.main.min.css`), await _(`${M}/loader.min.js`), v[yl] || (v[yl] = new Promise((C, S) => {
|
|
7895
7915
|
window.require.config({
|
|
7896
7916
|
paths: { vs: M }
|
|
7897
7917
|
}), window.require(
|
|
@@ -7921,7 +7941,7 @@ const Qu = {
|
|
|
7921
7941
|
}));
|
|
7922
7942
|
}, $ = () => {
|
|
7923
7943
|
r?.focus();
|
|
7924
|
-
},
|
|
7944
|
+
}, F = () => r, x = () => s;
|
|
7925
7945
|
return ce(
|
|
7926
7946
|
() => n.value,
|
|
7927
7947
|
(v) => {
|
|
@@ -7961,7 +7981,7 @@ const Qu = {
|
|
|
7961
7981
|
r && (r.dispose(), r = null);
|
|
7962
7982
|
}), l({
|
|
7963
7983
|
focus: $,
|
|
7964
|
-
getEditor:
|
|
7984
|
+
getEditor: F,
|
|
7965
7985
|
getMonaco: x
|
|
7966
7986
|
}), (v, p) => (u(), g("div", {
|
|
7967
7987
|
class: "w-full",
|
|
@@ -7981,11 +8001,11 @@ const Qu = {
|
|
|
7981
8001
|
"vs-input-password": nr,
|
|
7982
8002
|
"vs-input-textarea": Us,
|
|
7983
8003
|
"vs-input-richtext": zs,
|
|
7984
|
-
"vs-input-mask":
|
|
8004
|
+
"vs-input-mask": An,
|
|
7985
8005
|
"vs-input-number": or,
|
|
7986
8006
|
"vs-input-radio": un,
|
|
7987
8007
|
"vs-input-select": fn,
|
|
7988
|
-
"vs-input-switcher":
|
|
8008
|
+
"vs-input-switcher": Dn,
|
|
7989
8009
|
"vs-input-static": sn,
|
|
7990
8010
|
"vs-input-container": ys,
|
|
7991
8011
|
"vs-input-date": zr,
|
|
@@ -7995,8 +8015,8 @@ const Qu = {
|
|
|
7995
8015
|
file2: El,
|
|
7996
8016
|
File2: El,
|
|
7997
8017
|
"vs-input-html": sn,
|
|
7998
|
-
"vs-input-email":
|
|
7999
|
-
"vs-input-tel":
|
|
8018
|
+
"vs-input-email": Fn,
|
|
8019
|
+
"vs-input-tel": In,
|
|
8000
8020
|
"vs-input-datatable": _i,
|
|
8001
8021
|
// 20kb
|
|
8002
8022
|
"vs-input-map": Rd,
|
|
@@ -8053,7 +8073,7 @@ const Qu = {
|
|
|
8053
8073
|
class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
|
|
8054
8074
|
}, re(a.button), 1));
|
|
8055
8075
|
}
|
|
8056
|
-
}), Ef = { class: "flex flex-col gap-1 w-full" }, Bf = ["innerHTML"],
|
|
8076
|
+
}), Ef = { class: "flex flex-col gap-1 w-full" }, Bf = ["innerHTML"], On = /* @__PURE__ */ oe({
|
|
8057
8077
|
__name: "vs-compact-form-layout",
|
|
8058
8078
|
props: /* @__PURE__ */ Ve({
|
|
8059
8079
|
item: { default: {} },
|
|
@@ -8068,24 +8088,22 @@ const Qu = {
|
|
|
8068
8088
|
}),
|
|
8069
8089
|
emits: /* @__PURE__ */ Ve(["value-selected"], ["update:modelValue"]),
|
|
8070
8090
|
setup(e, { emit: l }) {
|
|
8071
|
-
const t = e, n = Ae(e, "modelValue"), a = l, o =
|
|
8091
|
+
const t = e, n = Ae(e, "modelValue"), a = l, o = k(() => tr[`${t.layout}`]), r = ["label", "placeholder", "info", "description", "text", "html"], s = D(_()), d = k(() => p(t.item, s.value)), m = k(() => Ff?.[`vs-input-${t.item.type}`]), y = it("field-props"), $ = k(() => {
|
|
8072
8092
|
const C = N(m);
|
|
8073
8093
|
if (!C) return /* @__PURE__ */ new Set();
|
|
8074
8094
|
const S = C.props ?? C.__vccOpts?.props;
|
|
8075
8095
|
if (!S) return /* @__PURE__ */ new Set();
|
|
8076
8096
|
const B = Array.isArray(S) ? S : Object.keys(S);
|
|
8077
8097
|
return new Set(B);
|
|
8078
|
-
}),
|
|
8098
|
+
}), F = ["min", "max", "step"], x = k(() => {
|
|
8079
8099
|
const C = { ...d.value ?? {} }, S = t.item?.name;
|
|
8080
8100
|
S && y?.value?.[S] && Object.assign(C, y.value[S]);
|
|
8081
8101
|
const B = $.value;
|
|
8082
8102
|
let A;
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
}
|
|
8088
|
-
return A;
|
|
8103
|
+
return B.size ? A = Object.fromEntries(Object.entries(C).filter(([z]) => B.has(z))) : A = C, F.forEach((z) => {
|
|
8104
|
+
const W = C[z];
|
|
8105
|
+
W != null && (A[z] = W);
|
|
8106
|
+
}), A;
|
|
8089
8107
|
}), v = (C) => {
|
|
8090
8108
|
const S = typeof C == "object" && C !== null ? C : { value: C };
|
|
8091
8109
|
a("value-selected", {
|
|
@@ -8094,7 +8112,7 @@ const Qu = {
|
|
|
8094
8112
|
});
|
|
8095
8113
|
};
|
|
8096
8114
|
Ze(() => {
|
|
8097
|
-
s.value =
|
|
8115
|
+
s.value = _(), window.addEventListener("storage", M);
|
|
8098
8116
|
}), tl(() => {
|
|
8099
8117
|
window.removeEventListener("storage", M);
|
|
8100
8118
|
});
|
|
@@ -8126,11 +8144,11 @@ const Qu = {
|
|
|
8126
8144
|
}
|
|
8127
8145
|
return null;
|
|
8128
8146
|
}
|
|
8129
|
-
function
|
|
8147
|
+
function _() {
|
|
8130
8148
|
return typeof window > "u" ? "uk" : localStorage.getItem("locale") || "uk";
|
|
8131
8149
|
}
|
|
8132
8150
|
function M() {
|
|
8133
|
-
s.value =
|
|
8151
|
+
s.value = _();
|
|
8134
8152
|
}
|
|
8135
8153
|
return (C, S) => (u(), ge(_t(o.value), {
|
|
8136
8154
|
ua: d.value.ua,
|
|
@@ -8171,26 +8189,26 @@ const Qu = {
|
|
|
8171
8189
|
width: { default: 400 }
|
|
8172
8190
|
},
|
|
8173
8191
|
setup(e, { expose: l }) {
|
|
8174
|
-
const t = e, n = D([]), a = D(""), o = D(""), r =
|
|
8192
|
+
const t = e, n = D([]), a = D(""), o = D(""), r = k(() => !!t.enabled), s = k(() => [
|
|
8175
8193
|
"vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
|
|
8176
8194
|
"sticky top-0 self-start shrink-0",
|
|
8177
8195
|
"max-h-full min-h-0 overflow-y-auto"
|
|
8178
|
-
]), d =
|
|
8196
|
+
]), d = k(() => {
|
|
8179
8197
|
const Y = t.width;
|
|
8180
8198
|
if (Y == null) return {};
|
|
8181
8199
|
const G = typeof Y == "number" ? `${Y}px` : `${Y}`;
|
|
8182
8200
|
return { width: G, minWidth: G };
|
|
8183
8201
|
});
|
|
8184
|
-
let m = null, y = 0, $ = 0,
|
|
8185
|
-
const p = () => W(), h = () =>
|
|
8202
|
+
let m = null, y = 0, $ = 0, F = null, x = null, v = null;
|
|
8203
|
+
const p = () => W(), h = () => _();
|
|
8186
8204
|
ce(
|
|
8187
8205
|
() => t.target,
|
|
8188
8206
|
async (Y) => {
|
|
8189
8207
|
if (B(), !Y) {
|
|
8190
|
-
|
|
8208
|
+
F = null, n.value = [], a.value = "";
|
|
8191
8209
|
return;
|
|
8192
8210
|
}
|
|
8193
|
-
|
|
8211
|
+
F = Y, r.value && (await Qe(), S(Y), _());
|
|
8194
8212
|
},
|
|
8195
8213
|
{ immediate: !0 }
|
|
8196
8214
|
), ce(
|
|
@@ -8200,13 +8218,13 @@ const Qu = {
|
|
|
8200
8218
|
x = Y ?? null;
|
|
8201
8219
|
return;
|
|
8202
8220
|
}
|
|
8203
|
-
w(Y ?? null), Qe(() =>
|
|
8221
|
+
w(Y ?? null), Qe(() => _());
|
|
8204
8222
|
},
|
|
8205
8223
|
{ immediate: !0 }
|
|
8206
8224
|
), Ze(() => {
|
|
8207
|
-
t.scrollContainer || w(null),
|
|
8225
|
+
t.scrollContainer || w(null), _();
|
|
8208
8226
|
}), It(() => {
|
|
8209
|
-
B(), w(null, !0),
|
|
8227
|
+
B(), w(null, !0), F = null, typeof window < "u" && (y && window.cancelAnimationFrame(y), $ && window.cancelAnimationFrame($));
|
|
8210
8228
|
});
|
|
8211
8229
|
function w(Y, G = !1) {
|
|
8212
8230
|
if (v && (v(), v = null), G) {
|
|
@@ -8219,8 +8237,8 @@ const Qu = {
|
|
|
8219
8237
|
Z.removeEventListener("scroll", p), te.removeEventListener("resize", h);
|
|
8220
8238
|
};
|
|
8221
8239
|
}
|
|
8222
|
-
function
|
|
8223
|
-
if (!r.value || !
|
|
8240
|
+
function _() {
|
|
8241
|
+
if (!r.value || !F) return;
|
|
8224
8242
|
y && typeof window < "u" && window.cancelAnimationFrame(y);
|
|
8225
8243
|
const Y = () => {
|
|
8226
8244
|
M(), y = 0;
|
|
@@ -8228,8 +8246,8 @@ const Qu = {
|
|
|
8228
8246
|
typeof window > "u" ? Y() : y = window.requestAnimationFrame(Y);
|
|
8229
8247
|
}
|
|
8230
8248
|
function M() {
|
|
8231
|
-
if (!r.value || !
|
|
8232
|
-
const Y = Array.from(
|
|
8249
|
+
if (!r.value || !F) return;
|
|
8250
|
+
const Y = Array.from(F.querySelectorAll("h1, h2")), G = /* @__PURE__ */ new Set(), Z = [];
|
|
8233
8251
|
Y.forEach((te, J) => {
|
|
8234
8252
|
const P = te.textContent?.trim() ?? "";
|
|
8235
8253
|
if (!P) return;
|
|
@@ -8249,7 +8267,7 @@ const Qu = {
|
|
|
8249
8267
|
return Y.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
8250
8268
|
}
|
|
8251
8269
|
function S(Y) {
|
|
8252
|
-
!Y || !r.value || typeof MutationObserver > "u" || (B(), m = new MutationObserver(() =>
|
|
8270
|
+
!Y || !r.value || typeof MutationObserver > "u" || (B(), m = new MutationObserver(() => _()), m.observe(Y, { childList: !0, subtree: !0 }));
|
|
8253
8271
|
}
|
|
8254
8272
|
function B() {
|
|
8255
8273
|
m && (m.disconnect(), m = null);
|
|
@@ -8288,7 +8306,7 @@ const Qu = {
|
|
|
8288
8306
|
const Z = x, te = Math.max(0, A(G));
|
|
8289
8307
|
Z ? Z.scrollTo({ top: te, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: te, behavior: "smooth" });
|
|
8290
8308
|
}
|
|
8291
|
-
return l({ refresh:
|
|
8309
|
+
return l({ refresh: _ }), (Y, G) => r.value && n.value.length ? (u(), g("div", {
|
|
8292
8310
|
key: 0,
|
|
8293
8311
|
class: X(s.value),
|
|
8294
8312
|
style: Te(d.value)
|
|
@@ -8332,15 +8350,15 @@ const Qu = {
|
|
|
8332
8350
|
}, zf = (e) => {
|
|
8333
8351
|
const l = /^\+[1-9]\d{1,14}$/;
|
|
8334
8352
|
return e ? l.test(e) ? !1 : kt.tel : !1;
|
|
8335
|
-
},
|
|
8353
|
+
}, Rn = (e) => e == null ? 0 : typeof e == "string" ? e.trim().length : Array.isArray(e) ? e.length : typeof e == "number" ? e.toString().length : String(e).length, Hf = (e, l) => {
|
|
8336
8354
|
if (e == null) return !1;
|
|
8337
8355
|
const t = Number(l?.value ?? l?.length);
|
|
8338
|
-
return Number.isFinite(t) &&
|
|
8356
|
+
return Number.isFinite(t) && Rn(e) < t ? l?.message || kt.minlength(t) : !1;
|
|
8339
8357
|
}, qf = (e, l) => {
|
|
8340
8358
|
if (e == null || e === "") return !1;
|
|
8341
8359
|
const t = Number(l?.value ?? l?.length);
|
|
8342
|
-
return Number.isFinite(t) &&
|
|
8343
|
-
},
|
|
8360
|
+
return Number.isFinite(t) && Rn(e) > t ? l?.message || kt.maxlength(t) : !1;
|
|
8361
|
+
}, jn = (e) => {
|
|
8344
8362
|
if (typeof e == "number") return e;
|
|
8345
8363
|
if (typeof e == "string") {
|
|
8346
8364
|
const l = e.trim().replace(",", ".");
|
|
@@ -8351,13 +8369,13 @@ const Qu = {
|
|
|
8351
8369
|
if (e == null || e === "") return !1;
|
|
8352
8370
|
const t = Number(l?.value);
|
|
8353
8371
|
if (!Number.isFinite(t)) return !1;
|
|
8354
|
-
const n =
|
|
8372
|
+
const n = jn(e);
|
|
8355
8373
|
return Number.isFinite(n) && n < t ? l?.message || kt.min(t) : !1;
|
|
8356
8374
|
}, Kf = (e, l) => {
|
|
8357
8375
|
if (e == null || e === "") return !1;
|
|
8358
8376
|
const t = Number(l?.value);
|
|
8359
8377
|
if (!Number.isFinite(t)) return !1;
|
|
8360
|
-
const n =
|
|
8378
|
+
const n = jn(e);
|
|
8361
8379
|
return Number.isFinite(n) && n > t ? l?.message || kt.max(t) : !1;
|
|
8362
8380
|
}, Wf = (e, l) => {
|
|
8363
8381
|
const t = l.pattern ?? l.regexp, n = typeof t == "string" ? new RegExp(t) : t;
|
|
@@ -8427,33 +8445,33 @@ function Ol(e, l = !1) {
|
|
|
8427
8445
|
}), t;
|
|
8428
8446
|
}
|
|
8429
8447
|
function Xf(e, l, t = !1) {
|
|
8430
|
-
const n =
|
|
8448
|
+
const n = k(() => Ol(
|
|
8431
8449
|
(Array.isArray(l), l),
|
|
8432
8450
|
typeof t == "boolean" ? t : t.value
|
|
8433
8451
|
)), a = D({});
|
|
8434
8452
|
function o(m) {
|
|
8435
8453
|
const y = m?.conditions;
|
|
8436
8454
|
if (!y) return !0;
|
|
8437
|
-
const $ = Array.isArray(y) ? y[0] : y,
|
|
8438
|
-
return
|
|
8455
|
+
const $ = Array.isArray(y) ? y[0] : y, F = e?.value?.[$];
|
|
8456
|
+
return En(F, y);
|
|
8439
8457
|
}
|
|
8440
8458
|
const r = (m = n.value, y = !0) => (m.forEach(($) => {
|
|
8441
|
-
const
|
|
8442
|
-
!Number.isNaN(x) && Number.isFinite(x) &&
|
|
8443
|
-
const w = [...
|
|
8459
|
+
const F = [], x = Number($?.minlength), v = Number($?.maxlength), p = Number($?.min), h = Number($?.max);
|
|
8460
|
+
!Number.isNaN(x) && Number.isFinite(x) && F.push({ type: "minlength", value: x }), !Number.isNaN(v) && Number.isFinite(v) && F.push({ type: "maxlength", value: v }), !Number.isNaN(p) && Number.isFinite(p) && F.push({ type: "min", value: p }), !Number.isNaN(h) && Number.isFinite(h) && F.push({ type: "max", value: h });
|
|
8461
|
+
const w = [...F, ...$.rules || []];
|
|
8444
8462
|
if (w.length) {
|
|
8445
8463
|
if (!o($)) {
|
|
8446
8464
|
delete a.value[$.name];
|
|
8447
8465
|
return;
|
|
8448
8466
|
}
|
|
8449
|
-
let
|
|
8467
|
+
let _ = !1, M = null;
|
|
8450
8468
|
w.forEach((C) => {
|
|
8451
8469
|
const S = Zf(e.value[$.name], C);
|
|
8452
|
-
S && (
|
|
8453
|
-
}),
|
|
8470
|
+
S && (_ = !0, !M && typeof S == "string" && (M = S));
|
|
8471
|
+
}), _ && M ? a.value[$.name] = M : delete a.value[$.name];
|
|
8454
8472
|
}
|
|
8455
8473
|
$.schema && r($.schema, !1);
|
|
8456
|
-
}), y && Object.values(a.value).some(Boolean) ? a.value : null), s =
|
|
8474
|
+
}), y && Object.values(a.value).some(Boolean) ? a.value : null), s = k(() => n.value?.filter((m) => m.hidden !== !0 && o(m)));
|
|
8457
8475
|
return {
|
|
8458
8476
|
errors: a,
|
|
8459
8477
|
validate: r,
|
|
@@ -8490,7 +8508,7 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8490
8508
|
}),
|
|
8491
8509
|
emits: /* @__PURE__ */ Ve(["handle-submit", "update:modelValue", "value-selected"], ["update:form", "update:modelValue", "update:values"]),
|
|
8492
8510
|
setup(e, { expose: l, emit: t }) {
|
|
8493
|
-
const n = t, a = e, o = Ae(e, "form"), r = Ae(e, "modelValue"), s = Ae(e, "values"), d =
|
|
8511
|
+
const n = t, a = e, o = Ae(e, "form"), r = Ae(e, "modelValue"), s = Ae(e, "values"), d = k({
|
|
8494
8512
|
get: () => s.value ?? r.value,
|
|
8495
8513
|
set: (G) => {
|
|
8496
8514
|
r.value = G, s.value = G;
|
|
@@ -8499,8 +8517,8 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8499
8517
|
errors: m,
|
|
8500
8518
|
validate: y,
|
|
8501
8519
|
reset: $,
|
|
8502
|
-
visibleSchema:
|
|
8503
|
-
} = Xf(d, a.schema, ba(a, "disabled")), x = D(null), v = D(null), p = D({}), h =
|
|
8520
|
+
visibleSchema: F
|
|
8521
|
+
} = Xf(d, a.schema, ba(a, "disabled")), x = D(null), v = D(null), p = D({}), h = k(() => a.navigation), w = k(() => a.navWidth), _ = k(() => a.style?.columns), M = Object.freeze({ container: 12, label: 3 }), C = k(() => a.columns ?? _.value ?? M), S = k(() => a.columns != null || _.value != null), B = k(() => S.value ? "horizontal" : a.layout), A = (G) => G?.columns ? "horizontal" : B.value, z = (G) => G?.columns ?? C.value, W = () => {
|
|
8504
8522
|
!a.formId && d.value && delete d.value.id, n("update:modelValue", d.value), y(), n("handle-submit", d.value);
|
|
8505
8523
|
}, Q = (G) => {
|
|
8506
8524
|
n("value-selected", G);
|
|
@@ -8536,11 +8554,11 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8536
8554
|
onSubmit: De(W, ["prevent"]),
|
|
8537
8555
|
class: X(["grid grid-cols-12 p-1", B.value === "default" ? "gap-6" : "gap-4"])
|
|
8538
8556
|
}, [
|
|
8539
|
-
(u(!0), g(be, null, Ce(N(
|
|
8557
|
+
(u(!0), g(be, null, Ce(N(F), (te, J) => (u(), g("div", {
|
|
8540
8558
|
key: te.name,
|
|
8541
8559
|
class: X(A(te) === "horizontal" ? "col-span-12" : `col-span-${te.col || 12}`)
|
|
8542
8560
|
}, [
|
|
8543
|
-
H(
|
|
8561
|
+
H(On, {
|
|
8544
8562
|
style: Te(G.style),
|
|
8545
8563
|
item: te,
|
|
8546
8564
|
layout: A(te),
|
|
@@ -8554,7 +8572,7 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8554
8572
|
error: N(m)[te.name],
|
|
8555
8573
|
onValueSelected: Q
|
|
8556
8574
|
}, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
|
|
8557
|
-
A(te) === "settings" && J + 1 !== N(
|
|
8575
|
+
A(te) === "settings" && J + 1 !== N(F).length ? (u(), g("div", ep)) : j("", !0)
|
|
8558
8576
|
], 2))), 128))
|
|
8559
8577
|
], 34)
|
|
8560
8578
|
], 512),
|
|
@@ -8594,7 +8612,7 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8594
8612
|
...o.value,
|
|
8595
8613
|
...h
|
|
8596
8614
|
});
|
|
8597
|
-
},
|
|
8615
|
+
}, F = async (p) => {
|
|
8598
8616
|
if (console.log(p), p.ok) {
|
|
8599
8617
|
await p.json().catch(() => ({})), y(), n("save", o.value);
|
|
8600
8618
|
return;
|
|
@@ -8625,7 +8643,7 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8625
8643
|
async function x() {
|
|
8626
8644
|
const p = r.value.validate();
|
|
8627
8645
|
if (p) {
|
|
8628
|
-
$e({ type: "warning", title: "Помилка валідації", message: Object.entries(p).map(([w,
|
|
8646
|
+
$e({ type: "warning", title: "Помилка валідації", message: Object.entries(p).map(([w, _]) => `${w}: ${_}`).join(`
|
|
8629
8647
|
`) });
|
|
8630
8648
|
return;
|
|
8631
8649
|
}
|
|
@@ -8634,19 +8652,19 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8634
8652
|
if (h) {
|
|
8635
8653
|
const w = m();
|
|
8636
8654
|
try {
|
|
8637
|
-
const
|
|
8655
|
+
const _ = await fetch(h, {
|
|
8638
8656
|
method: w,
|
|
8639
8657
|
headers: w === "GET" ? void 0 : {
|
|
8640
8658
|
"Content-Type": "application/json"
|
|
8641
8659
|
},
|
|
8642
8660
|
body: w === "GET" ? void 0 : JSON.stringify(o.value)
|
|
8643
8661
|
});
|
|
8644
|
-
await
|
|
8645
|
-
} catch (
|
|
8662
|
+
await F(_);
|
|
8663
|
+
} catch (_) {
|
|
8646
8664
|
$e({
|
|
8647
8665
|
type: "error",
|
|
8648
8666
|
title: "Помилка з’єднання",
|
|
8649
|
-
message:
|
|
8667
|
+
message: _.message || "Не вдалося виконати запит"
|
|
8650
8668
|
});
|
|
8651
8669
|
}
|
|
8652
8670
|
return;
|
|
@@ -8660,7 +8678,7 @@ const Qf = { class: "flex w-full h-full min-h-0 gap-6" }, ep = {
|
|
|
8660
8678
|
},
|
|
8661
8679
|
body: JSON.stringify(o.value)
|
|
8662
8680
|
});
|
|
8663
|
-
await
|
|
8681
|
+
await F(w);
|
|
8664
8682
|
} catch (w) {
|
|
8665
8683
|
$e({
|
|
8666
8684
|
type: "error",
|
|
@@ -8785,13 +8803,13 @@ function Cl(e, l) {
|
|
|
8785
8803
|
const t = new Date(e);
|
|
8786
8804
|
return t.setFullYear(t.getFullYear() + l), t;
|
|
8787
8805
|
}
|
|
8788
|
-
function
|
|
8806
|
+
function Un(e, l) {
|
|
8789
8807
|
return Cl(e, -l);
|
|
8790
8808
|
}
|
|
8791
|
-
function
|
|
8809
|
+
function zn(e) {
|
|
8792
8810
|
return Ot(new Date(e.getFullYear(), 0, 1));
|
|
8793
8811
|
}
|
|
8794
|
-
function
|
|
8812
|
+
function Hn(e) {
|
|
8795
8813
|
return ll(new Date(e.getFullYear(), 11, 31));
|
|
8796
8814
|
}
|
|
8797
8815
|
function pp(e) {
|
|
@@ -8821,8 +8839,8 @@ function gp(e) {
|
|
|
8821
8839
|
}
|
|
8822
8840
|
function yp(e) {
|
|
8823
8841
|
const l = [];
|
|
8824
|
-
let t =
|
|
8825
|
-
const n =
|
|
8842
|
+
let t = zn(e.start);
|
|
8843
|
+
const n = Hn(e.end);
|
|
8826
8844
|
for (; t <= n; )
|
|
8827
8845
|
l.push(qt(t)), t = Cl(t, 1);
|
|
8828
8846
|
return l;
|
|
@@ -8839,7 +8857,7 @@ function bp(e, l, t = 0) {
|
|
|
8839
8857
|
const n = Zl(e, t), a = (l - t + 7) % 7;
|
|
8840
8858
|
return n.setDate(n.getDate() + a), n;
|
|
8841
8859
|
}
|
|
8842
|
-
const wl = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear() && e.getMonth() === l.getMonth() && e.getDate() === l.getDate(), Rl = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear() && e.getMonth() === l.getMonth(), gn = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear(),
|
|
8860
|
+
const wl = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear() && e.getMonth() === l.getMonth() && e.getDate() === l.getDate(), Rl = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear() && e.getMonth() === l.getMonth(), gn = (e, l) => !!e && !!l && e.getFullYear() === l.getFullYear(), qn = (e, l) => !!e && !!l && wl(e, l) && e.getHours() === l.getHours(), xp = (e, l) => !!e && !!l && qn(e, l) && e.getMinutes() === l.getMinutes();
|
|
8843
8861
|
function wp(e, l) {
|
|
8844
8862
|
const t = e.getTime();
|
|
8845
8863
|
return t >= l.start.getTime() && t <= l.end.getTime();
|
|
@@ -9061,7 +9079,7 @@ const Sl = /* @__PURE__ */ Ee(Mp, [["render", Tp], ["__scopeId", "data-v-9e08385
|
|
|
9061
9079
|
}
|
|
9062
9080
|
},
|
|
9063
9081
|
setup(e, { emit: l }) {
|
|
9064
|
-
const t =
|
|
9082
|
+
const t = k(() => pp(e.pageDate)), n = k(() => mp(e.pageDate)), a = ($, F, x) => !F && !x ? !0 : !(F && yt($) < yt(F) || x && yt($) > yt(x)), o = k(() => yp({
|
|
9065
9083
|
start: t.value,
|
|
9066
9084
|
end: n.value
|
|
9067
9085
|
}).map(
|
|
@@ -9072,12 +9090,12 @@ const Sl = /* @__PURE__ */ Ee(Mp, [["render", Tp], ["__scopeId", "data-v-9e08385
|
|
|
9072
9090
|
selected: !!e.selected && yt($) === yt(e.selected),
|
|
9073
9091
|
disabled: !a($, e.lowerLimit, e.upperLimit)
|
|
9074
9092
|
})
|
|
9075
|
-
)), r =
|
|
9076
|
-
const $ = yt(t.value),
|
|
9077
|
-
return `${$} - ${
|
|
9078
|
-
}), s =
|
|
9093
|
+
)), r = k(() => {
|
|
9094
|
+
const $ = yt(t.value), F = yt(n.value);
|
|
9095
|
+
return `${$} - ${F}`;
|
|
9096
|
+
}), s = k(
|
|
9079
9097
|
() => e.lowerLimit && (hl(e.lowerLimit) === hl(e.pageDate) || Xt(e.pageDate, e.lowerLimit))
|
|
9080
|
-
), d =
|
|
9098
|
+
), d = k(
|
|
9081
9099
|
() => e.upperLimit && (hl(e.upperLimit) === hl(e.pageDate) || Qt(e.pageDate, e.upperLimit))
|
|
9082
9100
|
);
|
|
9083
9101
|
return {
|
|
@@ -9085,7 +9103,7 @@ const Sl = /* @__PURE__ */ Ee(Mp, [["render", Tp], ["__scopeId", "data-v-9e08385
|
|
|
9085
9103
|
heading: r,
|
|
9086
9104
|
leftDisabled: s,
|
|
9087
9105
|
rightDisabled: d,
|
|
9088
|
-
previousPage: () => l("update:pageDate",
|
|
9106
|
+
previousPage: () => l("update:pageDate", Un(e.pageDate, 10)),
|
|
9089
9107
|
nextPage: () => l("update:pageDate", Cl(e.pageDate, 10))
|
|
9090
9108
|
};
|
|
9091
9109
|
}
|
|
@@ -9144,22 +9162,22 @@ const Op = /* @__PURE__ */ Ee(Pp, [["render", Np]]), Rp = oe({
|
|
|
9144
9162
|
}
|
|
9145
9163
|
},
|
|
9146
9164
|
setup(e, { emit: l }) {
|
|
9147
|
-
const t =
|
|
9148
|
-
() => (
|
|
9149
|
-
), o = (
|
|
9165
|
+
const t = k(() => zn(e.pageDate)), n = k(() => Hn(e.pageDate)), a = k(
|
|
9166
|
+
() => (F) => _l(F, e.format)
|
|
9167
|
+
), o = (F, x, v) => !x && !v ? !0 : !(x && Xt(F, Kl(x)) || v && Qt(F, Wl(v))), r = k(() => gp({
|
|
9150
9168
|
start: t.value,
|
|
9151
9169
|
end: n.value
|
|
9152
9170
|
}).map(
|
|
9153
|
-
(
|
|
9154
|
-
value:
|
|
9155
|
-
display: a.value(
|
|
9156
|
-
key: a.value(
|
|
9157
|
-
selected: !!e.selected && Rl(e.selected,
|
|
9158
|
-
disabled: !o(
|
|
9171
|
+
(F) => ({
|
|
9172
|
+
value: F,
|
|
9173
|
+
display: a.value(F),
|
|
9174
|
+
key: a.value(F),
|
|
9175
|
+
selected: !!e.selected && Rl(e.selected, F),
|
|
9176
|
+
disabled: !o(F, e.lowerLimit, e.upperLimit)
|
|
9159
9177
|
})
|
|
9160
|
-
)), s =
|
|
9178
|
+
)), s = k(() => yt(t.value)), d = k(
|
|
9161
9179
|
() => e.lowerLimit && (gn(e.lowerLimit, e.pageDate) || Xt(e.pageDate, e.lowerLimit))
|
|
9162
|
-
), m =
|
|
9180
|
+
), m = k(
|
|
9163
9181
|
() => e.upperLimit && (gn(e.upperLimit, e.pageDate) || Qt(e.pageDate, e.upperLimit))
|
|
9164
9182
|
);
|
|
9165
9183
|
return {
|
|
@@ -9167,7 +9185,7 @@ const Op = /* @__PURE__ */ Ee(Pp, [["render", Np]]), Rp = oe({
|
|
|
9167
9185
|
heading: s,
|
|
9168
9186
|
leftDisabled: d,
|
|
9169
9187
|
rightDisabled: m,
|
|
9170
|
-
previousPage: () => l("update:pageDate",
|
|
9188
|
+
previousPage: () => l("update:pageDate", Un(e.pageDate, 1)),
|
|
9171
9189
|
nextPage: () => l("update:pageDate", Cl(e.pageDate, 1))
|
|
9172
9190
|
};
|
|
9173
9191
|
}
|
|
@@ -9254,47 +9272,47 @@ const Up = /* @__PURE__ */ Ee(Rp, [["render", jp]]), zp = oe({
|
|
|
9254
9272
|
}
|
|
9255
9273
|
},
|
|
9256
9274
|
setup(e, { emit: l }) {
|
|
9257
|
-
const t =
|
|
9275
|
+
const t = k(
|
|
9258
9276
|
() => (h) => (w) => _l(w, h)
|
|
9259
|
-
), n =
|
|
9277
|
+
), n = k(() => Kl(e.pageDate)), a = k(() => Wl(e.pageDate)), o = k(() => ({
|
|
9260
9278
|
start: n.value,
|
|
9261
9279
|
end: a.value
|
|
9262
|
-
})), r =
|
|
9280
|
+
})), r = k(() => ({
|
|
9263
9281
|
start: Zl(n.value, e.weekStartsOn),
|
|
9264
9282
|
end: hp(a.value, e.weekStartsOn)
|
|
9265
|
-
})), s =
|
|
9283
|
+
})), s = k(() => e.customWeekdays?.length === 7 ? e.customWeekdays : null), d = k(() => {
|
|
9266
9284
|
const h = e.weekStartsOn, w = s.value;
|
|
9267
9285
|
if (w)
|
|
9268
9286
|
return Array.from({ length: 7 }).map((M, C) => w[(h + C) % 7]);
|
|
9269
|
-
const
|
|
9270
|
-
return Array.from(Array(7)).map((M, C) => (h + C) % 7).map((M) => bp(/* @__PURE__ */ new Date(), M, e.weekStartsOn)).map(
|
|
9271
|
-
}), m = (h, w,
|
|
9287
|
+
const _ = t.value(e.weekdayFormat);
|
|
9288
|
+
return Array.from(Array(7)).map((M, C) => (h + C) % 7).map((M) => bp(/* @__PURE__ */ new Date(), M, e.weekStartsOn)).map(_);
|
|
9289
|
+
}), m = (h, w, _, M) => M?.dates?.some((C) => wl(h, C)) || M?.predicate?.(h) ? !1 : !w && !_ ? !0 : !(w && Xt(h, Ot(w)) || _ && Qt(h, ll(_))), y = k(() => {
|
|
9272
9290
|
const h = /* @__PURE__ */ new Date(), w = t.value(e.format);
|
|
9273
9291
|
return vp(r.value).map(
|
|
9274
|
-
(
|
|
9275
|
-
value:
|
|
9276
|
-
display: w(
|
|
9277
|
-
selected: !!e.selected && wl(e.selected,
|
|
9278
|
-
current: wl(h,
|
|
9279
|
-
disabled: !e.allowOutsideInterval && !wp(
|
|
9280
|
-
|
|
9292
|
+
(_) => ({
|
|
9293
|
+
value: _,
|
|
9294
|
+
display: w(_),
|
|
9295
|
+
selected: !!e.selected && wl(e.selected, _),
|
|
9296
|
+
current: wl(h, _),
|
|
9297
|
+
disabled: !e.allowOutsideInterval && !wp(_, o.value) || !m(
|
|
9298
|
+
_,
|
|
9281
9299
|
e.lowerLimit,
|
|
9282
9300
|
e.upperLimit,
|
|
9283
9301
|
e.disabledDates
|
|
9284
9302
|
),
|
|
9285
|
-
key: t.value("yyyy-MM-dd")(
|
|
9303
|
+
key: t.value("yyyy-MM-dd")(_)
|
|
9286
9304
|
})
|
|
9287
9305
|
);
|
|
9288
|
-
}), $ =
|
|
9306
|
+
}), $ = k(() => t.value(e.headingFormat)(e.pageDate)), F = k(
|
|
9289
9307
|
() => e.lowerLimit && (Rl(e.lowerLimit, e.pageDate) || Xt(e.pageDate, e.lowerLimit))
|
|
9290
|
-
), x =
|
|
9308
|
+
), x = k(
|
|
9291
9309
|
() => e.upperLimit && (Rl(e.upperLimit, e.pageDate) || Qt(e.pageDate, e.upperLimit))
|
|
9292
9310
|
);
|
|
9293
9311
|
return {
|
|
9294
9312
|
weekDays: d,
|
|
9295
9313
|
days: y,
|
|
9296
9314
|
heading: $,
|
|
9297
|
-
leftDisabled:
|
|
9315
|
+
leftDisabled: F,
|
|
9298
9316
|
rightDisabled: x,
|
|
9299
9317
|
previousPage: () => l("update:pageDate", fp(e.pageDate)),
|
|
9300
9318
|
nextPage: () => l("update:pageDate", Yl(e.pageDate, 1))
|
|
@@ -9364,7 +9382,7 @@ const Gp = oe({
|
|
|
9364
9382
|
}
|
|
9365
9383
|
},
|
|
9366
9384
|
setup(e, { emit: l }) {
|
|
9367
|
-
const t = D(null), n = D(null), a =
|
|
9385
|
+
const t = D(null), n = D(null), a = k(() => e.pageDate ?? e.selected), o = D(a.value.getHours()), r = D(a.value.getMinutes());
|
|
9368
9386
|
ce(
|
|
9369
9387
|
() => e.selected,
|
|
9370
9388
|
(x) => {
|
|
@@ -9372,7 +9390,7 @@ const Gp = oe({
|
|
|
9372
9390
|
x && (v = x.getHours(), p = x.getMinutes()), o.value = v, r.value = p;
|
|
9373
9391
|
}
|
|
9374
9392
|
);
|
|
9375
|
-
const s =
|
|
9393
|
+
const s = k(() => [...Array(24).keys()].map((x) => ({
|
|
9376
9394
|
value: x,
|
|
9377
9395
|
date: yn(new Date(a.value.getTime()), {
|
|
9378
9396
|
hours: x,
|
|
@@ -9381,7 +9399,7 @@ const Gp = oe({
|
|
|
9381
9399
|
}),
|
|
9382
9400
|
selected: o.value === x,
|
|
9383
9401
|
ref: D(null)
|
|
9384
|
-
}))), d =
|
|
9402
|
+
}))), d = k(() => [...Array(60).keys()].map((x) => ({
|
|
9385
9403
|
value: x,
|
|
9386
9404
|
date: yn(new Date(a.value.getTime()), {
|
|
9387
9405
|
hours: o.value,
|
|
@@ -9415,7 +9433,7 @@ const Gp = oe({
|
|
|
9415
9433
|
padStartZero: (x) => `0${x}`.substr(-2),
|
|
9416
9434
|
selectMinutes: m,
|
|
9417
9435
|
isEnabled: (x) => !(e.disabledTime?.dates?.some(
|
|
9418
|
-
(v) =>
|
|
9436
|
+
(v) => qn(x, v) && xp(x, v)
|
|
9419
9437
|
) || e.disabledTime?.predicate?.(x)),
|
|
9420
9438
|
scroll: y
|
|
9421
9439
|
};
|
|
@@ -9653,9 +9671,9 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9653
9671
|
const n = D("none"), a = D(e.startingViewDate), o = D(null), r = D(!1), s = D(""), d = (J) => {
|
|
9654
9672
|
const P = J.replace(/[a-zA-Z]/g, "0");
|
|
9655
9673
|
return /0/.test(P) ? P : "";
|
|
9656
|
-
}, m =
|
|
9674
|
+
}, m = k(() => d(e.inputFormat));
|
|
9657
9675
|
let y = null, $ = null;
|
|
9658
|
-
const
|
|
9676
|
+
const F = () => {
|
|
9659
9677
|
y?.destroy(), y = null;
|
|
9660
9678
|
}, x = async () => {
|
|
9661
9679
|
if (!$) {
|
|
@@ -9666,7 +9684,7 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9666
9684
|
}, v = () => {
|
|
9667
9685
|
y && y.value !== s.value && (y.value = s.value ?? "");
|
|
9668
9686
|
}, p = async () => {
|
|
9669
|
-
if (
|
|
9687
|
+
if (F(), !o.value || !m.value) return;
|
|
9670
9688
|
y = (await x())(o.value, {
|
|
9671
9689
|
mask: m.value,
|
|
9672
9690
|
lazy: !0,
|
|
@@ -9684,11 +9702,11 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9684
9702
|
p();
|
|
9685
9703
|
});
|
|
9686
9704
|
}), It(() => {
|
|
9687
|
-
|
|
9705
|
+
F();
|
|
9688
9706
|
}), ce(m, (J) => {
|
|
9689
9707
|
J ? Qe(() => {
|
|
9690
9708
|
p();
|
|
9691
|
-
}) :
|
|
9709
|
+
}) : F();
|
|
9692
9710
|
}), ce(s, () => {
|
|
9693
9711
|
v();
|
|
9694
9712
|
});
|
|
@@ -9700,7 +9718,7 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9700
9718
|
});
|
|
9701
9719
|
const w = (J, P) => {
|
|
9702
9720
|
a.value = P, J === "year" ? l("decadePageChanged", P) : J === "month" ? l("yearPageChanged", P) : J === "day" && l("monthPageChanged", P);
|
|
9703
|
-
},
|
|
9721
|
+
}, _ = (J) => {
|
|
9704
9722
|
a.value = J, e.minimumView === "year" ? (h("none"), l("update:modelValue", J)) : n.value = "month";
|
|
9705
9723
|
}, M = (J) => {
|
|
9706
9724
|
a.value = J, e.minimumView === "month" ? (h("none"), l("update:modelValue", J)) : n.value = "day";
|
|
@@ -9723,12 +9741,12 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9723
9741
|
const ue = bn(o.value.value, e.inputFormat);
|
|
9724
9742
|
ue && s.value === _l(ue, e.inputFormat) && (s.value = o.value.value, l("update:modelValue", ue));
|
|
9725
9743
|
}
|
|
9726
|
-
}, Y =
|
|
9744
|
+
}, Y = k(() => {
|
|
9727
9745
|
const J = xl.indexOf(e.startingView), P = xl.indexOf(e.minimumView);
|
|
9728
9746
|
return J < P ? e.minimumView : e.startingView;
|
|
9729
9747
|
}), G = (J) => Object.fromEntries(
|
|
9730
9748
|
Object.entries(J ?? {}).filter(([P, ae]) => P.startsWith("--"))
|
|
9731
|
-
), Z =
|
|
9749
|
+
), Z = k(() => e.weekDayNames?.length === 7 ? e.weekDayNames : void 0);
|
|
9732
9750
|
return {
|
|
9733
9751
|
blur: W,
|
|
9734
9752
|
focus: z,
|
|
@@ -9738,7 +9756,7 @@ const Xp = /* @__PURE__ */ Ee(Gp, [["render", Jp], ["__scopeId", "data-v-610b89e
|
|
|
9738
9756
|
pageDate: a,
|
|
9739
9757
|
renderView: h,
|
|
9740
9758
|
updatePageDate: w,
|
|
9741
|
-
selectYear:
|
|
9759
|
+
selectYear: _,
|
|
9742
9760
|
selectMonth: M,
|
|
9743
9761
|
selectDay: C,
|
|
9744
9762
|
selectTime: S,
|
|
@@ -9861,31 +9879,31 @@ const rm = /* @__PURE__ */ Ee(em, [["render", am]]), om = /* @__PURE__ */ oe({
|
|
|
9861
9879
|
},
|
|
9862
9880
|
emits: ["update:modelValue"],
|
|
9863
9881
|
setup(e, { emit: l }) {
|
|
9864
|
-
const t = e, n = l, { inputClass: a } = tt(t.style), o =
|
|
9882
|
+
const t = e, n = l, { inputClass: a } = tt(t.style), o = k(() => t.mode ? t.mode : t.time ? "datetime" : "date"), r = {
|
|
9865
9883
|
date: "дд.мм.рррр",
|
|
9866
9884
|
datetime: "дд.мм.рррр гг:хх",
|
|
9867
9885
|
month: "мм.рррр",
|
|
9868
9886
|
week: "рррр-тиждень",
|
|
9869
9887
|
time: "гг:хх",
|
|
9870
9888
|
year: "рррр"
|
|
9871
|
-
}, s =
|
|
9889
|
+
}, s = k(() => t.placeholder || r[o.value] || ""), d = k(() => [
|
|
9872
9890
|
"py-1.5 px-3 block w-full placeholder:text-[#767f8f] bg-white",
|
|
9873
9891
|
a.value,
|
|
9874
9892
|
t.customClass,
|
|
9875
9893
|
{ "!border-red-600": t.error }
|
|
9876
|
-
]), m =
|
|
9894
|
+
]), m = k(() => !t.modelValue && t.now ? /* @__PURE__ */ new Date() : null), y = k({
|
|
9877
9895
|
get: () => M(
|
|
9878
9896
|
t.modelValue ?? m.value,
|
|
9879
9897
|
o.value
|
|
9880
9898
|
) || void 0,
|
|
9881
9899
|
set: (P) => n("update:modelValue", C(P, o.value))
|
|
9882
|
-
}), $ = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],
|
|
9900
|
+
}), $ = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"], F = k(() => {
|
|
9883
9901
|
if (t.dayNames?.length)
|
|
9884
9902
|
return t.dayNames.length === 7 ? t.dayNames : $;
|
|
9885
|
-
}), x =
|
|
9903
|
+
}), x = k(() => {
|
|
9886
9904
|
const P = t.weekStart, ae = typeof P == "string" ? Number(P) : P;
|
|
9887
9905
|
return ae === void 0 || Number.isNaN(ae) ? 1 : Math.min(6, Math.max(0, ae));
|
|
9888
|
-
}), v =
|
|
9906
|
+
}), v = k(() => {
|
|
9889
9907
|
switch (o.value) {
|
|
9890
9908
|
case "time":
|
|
9891
9909
|
return { startingView: "time", minimumView: "time" };
|
|
@@ -9905,22 +9923,22 @@ const rm = /* @__PURE__ */ Ee(em, [["render", am]]), om = /* @__PURE__ */ oe({
|
|
|
9905
9923
|
time: "HH:mm",
|
|
9906
9924
|
week: "dd.MM.yyyy",
|
|
9907
9925
|
year: "yyyy"
|
|
9908
|
-
}, h =
|
|
9926
|
+
}, h = k(() => p[o.value] || "dd.MM.yyyy"), w = k(() => ({
|
|
9909
9927
|
"--vdp-selected-bg-color": t.style?.primaryColor || "#2563eb",
|
|
9910
9928
|
"--vdp-hover-bg-color": t.style?.primaryColor || "#2563eb",
|
|
9911
9929
|
"--vdp-selected-color": "#ffffff",
|
|
9912
9930
|
"--vdp-hover-color": "#ffffff",
|
|
9913
9931
|
"--vdp-border-radius": t.style?.size === "sm" ? "6px" : "8px",
|
|
9914
9932
|
"--vdp-elem-font-size": t.style?.size === "sm" ? "0.75em" : "0.85em"
|
|
9915
|
-
})),
|
|
9933
|
+
})), _ = D(!1);
|
|
9916
9934
|
ce(
|
|
9917
9935
|
() => t.modelValue,
|
|
9918
9936
|
(P) => {
|
|
9919
|
-
P ?
|
|
9937
|
+
P ? _.value = !0 : t.now || (_.value = !1);
|
|
9920
9938
|
},
|
|
9921
9939
|
{ immediate: !0 }
|
|
9922
9940
|
), Zt(() => {
|
|
9923
|
-
t.now && !t.modelValue && !
|
|
9941
|
+
t.now && !t.modelValue && !_.value && (n("update:modelValue", C(/* @__PURE__ */ new Date(), o.value)), _.value = !0);
|
|
9924
9942
|
});
|
|
9925
9943
|
function M(P, ae) {
|
|
9926
9944
|
if (!P) return null;
|
|
@@ -10026,7 +10044,7 @@ const rm = /* @__PURE__ */ Ee(em, [["render", am]]), om = /* @__PURE__ */ oe({
|
|
|
10026
10044
|
disabled: t.disabled,
|
|
10027
10045
|
clearable: t.clearable,
|
|
10028
10046
|
typeable: t.editable,
|
|
10029
|
-
"week-day-names":
|
|
10047
|
+
"week-day-names": F.value,
|
|
10030
10048
|
"week-starts-on": x.value,
|
|
10031
10049
|
"starting-view": v.value.startingView,
|
|
10032
10050
|
"minimum-view": v.value.minimumView,
|
|
@@ -10091,12 +10109,12 @@ export {
|
|
|
10091
10109
|
sp as c,
|
|
10092
10110
|
Jt as d,
|
|
10093
10111
|
or as e,
|
|
10094
|
-
|
|
10112
|
+
Dn as f,
|
|
10095
10113
|
sn as g,
|
|
10096
|
-
|
|
10114
|
+
An as h,
|
|
10097
10115
|
Ff as i,
|
|
10098
|
-
|
|
10099
|
-
|
|
10116
|
+
Fn as j,
|
|
10117
|
+
In as k,
|
|
10100
10118
|
Nc as l,
|
|
10101
10119
|
Ec as m,
|
|
10102
10120
|
un as n,
|