@opengis/form 0.0.13 → 0.0.15
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/components/behavior.vue.d.ts +10 -0
- package/dist/components/behavior.vue.d.ts.map +1 -0
- package/dist/components/container-views/index.d.ts +193 -0
- package/dist/components/container-views/index.d.ts.map +1 -0
- package/dist/components/container-views/vs-container-accordion.vue.d.ts +43 -0
- package/dist/components/container-views/vs-container-accordion.vue.d.ts.map +1 -0
- package/dist/components/container-views/vs-container-default.vue.d.ts +34 -0
- package/dist/components/container-views/vs-container-default.vue.d.ts.map +1 -0
- package/dist/components/container-views/vs-container-switcher.vue.d.ts +43 -0
- package/dist/components/container-views/vs-container-switcher.vue.d.ts.map +1 -0
- package/dist/components/form/vs-compact-form.vue.d.ts +29 -0
- package/dist/components/form/vs-compact-form.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-arrow-top-bottom.vue.d.ts +3 -0
- package/dist/components/icons/icon-arrow-top-bottom.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-check.vue.d.ts +3 -0
- package/dist/components/icons/icon-check.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-chevron-down.vue.d.ts +3 -0
- package/dist/components/icons/icon-chevron-down.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-chevron-top-bottom.vue.d.ts +3 -0
- package/dist/components/icons/icon-chevron-top-bottom.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-close.vue.d.ts +3 -0
- package/dist/components/icons/icon-close.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-csv.vue.d.ts +3 -0
- package/dist/components/icons/icon-csv.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-delete.vue.d.ts +3 -0
- package/dist/components/icons/icon-delete.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-download.vue.d.ts +3 -0
- package/dist/components/icons/icon-download.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-export.vue.d.ts +3 -0
- package/dist/components/icons/icon-export.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-file.vue.d.ts +3 -0
- package/dist/components/icons/icon-file.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-geojson.vue.d.ts +3 -0
- package/dist/components/icons/icon-geojson.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-grip-vertical.vue.d.ts +3 -0
- package/dist/components/icons/icon-grip-vertical.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-import.vue.d.ts +3 -0
- package/dist/components/icons/icon-import.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-info.vue.d.ts +3 -0
- package/dist/components/icons/icon-info.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-magnifying-glass.vue.d.ts +3 -0
- package/dist/components/icons/icon-magnifying-glass.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-no-data.vue.d.ts +3 -0
- package/dist/components/icons/icon-no-data.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-pdf.vue.d.ts +3 -0
- package/dist/components/icons/icon-pdf.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-pen.vue.d.ts +3 -0
- package/dist/components/icons/icon-pen.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-plus.vue.d.ts +3 -0
- package/dist/components/icons/icon-plus.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-upload.vue.d.ts +3 -0
- package/dist/components/icons/icon-upload.vue.d.ts.map +1 -0
- package/dist/components/icons/icon-zip.vue.d.ts +3 -0
- package/dist/components/icons/icon-zip.vue.d.ts.map +1 -0
- package/dist/components/icons/index.d.ts +6 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-email.vue.d.ts +18 -0
- package/dist/components/inputs/base/vs-input-email.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-html.vue.d.ts +6 -0
- package/dist/components/inputs/base/vs-input-html.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-mask.vue.d.ts +20 -0
- package/dist/components/inputs/base/vs-input-mask.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-number.vue.d.ts +15 -0
- package/dist/components/inputs/base/vs-input-number.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-static.vue.d.ts +8 -0
- package/dist/components/inputs/base/vs-input-static.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-switcher.vue.d.ts +21 -0
- package/dist/components/inputs/base/vs-input-switcher.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-text.vue.d.ts +18 -0
- package/dist/components/inputs/base/vs-input-text.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-textarea.vue.d.ts +17 -0
- package/dist/components/inputs/base/vs-input-textarea.vue.d.ts.map +1 -0
- package/dist/components/inputs/date/vs-date-text.vue.d.ts +16 -0
- package/dist/components/inputs/date/vs-date-text.vue.d.ts.map +1 -0
- package/dist/components/inputs/date/vs-input-date.vue.d.ts +18 -0
- package/dist/components/inputs/date/vs-input-date.vue.d.ts.map +1 -0
- package/dist/components/inputs/date/vs-input-date1.vue.d.ts +17 -0
- package/dist/components/inputs/date/vs-input-date1.vue.d.ts.map +1 -0
- package/dist/components/inputs/date/vs-input-time.vue.d.ts +17 -0
- package/dist/components/inputs/date/vs-input-time.vue.d.ts.map +1 -0
- package/dist/components/inputs/file/vs-input-file-list-item.vue.d.ts +15 -0
- package/dist/components/inputs/file/vs-input-file-list-item.vue.d.ts.map +1 -0
- package/dist/components/inputs/file/vs-input-file.vue.d.ts +12 -0
- package/dist/components/inputs/file/vs-input-file.vue.d.ts.map +1 -0
- package/dist/components/inputs/file-list/vs-input-file-list.vue.d.ts +10 -0
- package/dist/components/inputs/file-list/vs-input-file-list.vue.d.ts.map +1 -0
- package/dist/components/inputs/file-list/vs-widget-file-info.vue.d.ts +8 -0
- package/dist/components/inputs/file-list/vs-widget-file-info.vue.d.ts.map +1 -0
- package/dist/components/inputs/file-list/vs-widget-file-item.vue.d.ts +40 -0
- package/dist/components/inputs/file-list/vs-widget-file-item.vue.d.ts.map +1 -0
- package/dist/components/inputs/index.d.ts +259 -0
- package/dist/components/inputs/index.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-compass.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-compass.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-full-screen.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-full-screen.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-line.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-line.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-map-pin.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-map-pin.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/icons/icon-poligon.vue.d.ts +3 -0
- package/dist/components/inputs/map/icons/icon-poligon.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/map-layers.vue.d.ts +15 -0
- package/dist/components/inputs/map/map-layers.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/map-search.vue.d.ts +12 -0
- package/dist/components/inputs/map/map-search.vue.d.ts.map +1 -0
- package/dist/components/inputs/map/map.d.ts +109 -0
- package/dist/components/inputs/map/map.d.ts.map +1 -0
- package/dist/components/inputs/map/util.d.ts +2 -0
- package/dist/components/inputs/map/util.d.ts.map +1 -0
- package/dist/components/inputs/map/vs-input-map.vue.d.ts +8 -0
- package/dist/components/inputs/map/vs-input-map.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/checkbox/index.d.ts +4 -0
- package/dist/components/inputs/options/checkbox/index.d.ts.map +1 -0
- package/dist/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts +32 -0
- package/dist/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts +31 -0
- package/dist/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts +27 -0
- package/dist/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts +15 -0
- package/dist/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/radio/index.d.ts +28 -0
- package/dist/components/inputs/options/radio/index.d.ts.map +1 -0
- package/dist/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts +15 -0
- package/dist/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/radio/vs-input-radio-default.vue.d.ts +15 -0
- package/dist/components/inputs/options/radio/vs-input-radio-default.vue.d.ts.map +1 -0
- package/dist/components/inputs/options/radio/vs-input-radio.vue.d.ts +15 -0
- package/dist/components/inputs/options/radio/vs-input-radio.vue.d.ts.map +1 -0
- package/dist/components/inputs/table/vs-input-datatable.vue.d.ts +12 -0
- package/dist/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -0
- package/dist/components/inputs/vs-input-container.vue.d.ts +44 -0
- package/dist/components/inputs/vs-input-container.vue.d.ts.map +1 -0
- package/dist/components/inputs/vs-input-select.vue.d.ts +24 -0
- package/dist/components/inputs/vs-input-select.vue.d.ts.map +1 -0
- package/dist/components/layouts/index.d.ts +100 -0
- package/dist/components/layouts/index.d.ts.map +1 -0
- package/dist/components/layouts/vs-compact-form-layout.vue.d.ts +17 -0
- package/dist/components/layouts/vs-compact-form-layout.vue.d.ts.map +1 -0
- package/dist/components/layouts/vs-layout-default.vue.d.ts +19 -0
- package/dist/components/layouts/vs-layout-default.vue.d.ts.map +1 -0
- package/dist/components/layouts/vs-layout-horizontal.vue.d.ts +19 -0
- package/dist/components/layouts/vs-layout-horizontal.vue.d.ts.map +1 -0
- package/dist/components/layouts/vs-layout-inline.vue.d.ts +19 -0
- package/dist/components/layouts/vs-layout-inline.vue.d.ts.map +1 -0
- package/dist/components/modal/modal-edit.vue.d.ts +12 -0
- package/dist/components/modal/modal-edit.vue.d.ts.map +1 -0
- package/dist/components/ui/vs-calendar.vue.d.ts +37 -0
- package/dist/components/ui/vs-calendar.vue.d.ts.map +1 -0
- package/dist/components/ui/vs-popover.vue.d.ts +89 -0
- package/dist/components/ui/vs-popover.vue.d.ts.map +1 -0
- package/dist/composables/useForm.d.ts +9 -0
- package/dist/composables/useForm.d.ts.map +1 -0
- package/dist/composables/useStyle.d.ts +9 -0
- package/dist/composables/useStyle.d.ts.map +1 -0
- package/dist/emitter/eventBus.d.ts +6 -0
- package/dist/emitter/eventBus.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1525 -1543
- package/dist/index.umd.cjs +2 -2
- package/dist/plugin/form-plugin.d.ts +10 -0
- package/dist/plugin/form-plugin.d.ts.map +1 -0
- package/dist/schema.d.ts +277 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/types/form.d.ts +93 -0
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/rules.d.ts +1 -0
- package/dist/types/rules.d.ts.map +1 -0
- package/dist/utils/convertForm.d.ts +4 -0
- package/dist/utils/convertForm.d.ts.map +1 -0
- package/dist/utils/dynamicPosition.d.ts +2 -0
- package/dist/utils/dynamicPosition.d.ts.map +1 -0
- package/dist/utils/file.api.d.ts +4 -0
- package/dist/utils/file.api.d.ts.map +1 -0
- package/dist/utils/file.preview.d.ts +2 -0
- package/dist/utils/file.preview.d.ts.map +1 -0
- package/dist/utils/formConditions.d.ts +16 -0
- package/dist/utils/formConditions.d.ts.map +1 -0
- package/dist/utils/formRules.d.ts +4 -0
- package/dist/utils/formRules.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/randomId.d.ts +2 -0
- package/dist/utils/randomId.d.ts.map +1 -0
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createCommentVNode, renderSlot, createElementVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelCheckbox, createVNode, ref, createBlock, resolveDynamicComponent, normalizeStyle, withCtx, withModifiers, onMounted, onBeforeUnmount, watch, createStaticVNode, vModelRadio, Fragment, renderList, mergeProps, reactive, vShow, inject, resolveComponent, Transition, createApp, h, onUnmounted, nextTick, Teleport, provide } from "vue";
|
|
2
|
-
import { notify } from "@opengis/core";
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as M, createElementBlock as u, openBlock as i, createCommentVNode as j, renderSlot as se, createElementVNode as t, toDisplayString as z, normalizeProps as Me, guardReactiveProps as Le, createTextVNode as le, computed as T, mergeModels as P, useModel as R, withDirectives as J, normalizeClass as C, unref as U, vModelText as ne, vModelCheckbox as Ue, createVNode as V, ref as _, createBlock as K, resolveDynamicComponent as de, normalizeStyle as ve, withCtx as ge, withModifiers as _e, onMounted as oe, onBeforeUnmount as Re, watch as ae, createStaticVNode as te, vModelRadio as He, Fragment as W, renderList as Q, mergeProps as me, reactive as Qe, vShow as Se, inject as xe, resolveComponent as je, Transition as Pe, createApp as Xe, h as Ye, onUnmounted as Ne, nextTick as et, Teleport as tt, provide as Ie } from "vue";
|
|
2
|
+
import { notify as we } from "@opengis/core";
|
|
3
|
+
const lt = { class: "w-full relative" }, ot = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
6
|
-
},
|
|
6
|
+
}, at = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-red-500 text-[14px]"
|
|
9
|
-
},
|
|
9
|
+
}, nt = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
12
|
-
},
|
|
12
|
+
}, st = /* @__PURE__ */ M({
|
|
13
13
|
__name: "vs-layout-default",
|
|
14
14
|
props: {
|
|
15
15
|
ua: { default: "" },
|
|
16
16
|
item: { default: () => ({}) },
|
|
17
|
-
error: { default: "" },
|
|
17
|
+
error: { type: [String, Boolean], default: "" },
|
|
18
18
|
label: { default: "" }
|
|
19
19
|
},
|
|
20
20
|
setup(o) {
|
|
21
|
-
return (e,
|
|
22
|
-
e.ua || e.label ? (
|
|
23
|
-
|
|
24
|
-
e.item?.rules?.includes("required") ? (
|
|
25
|
-
])) :
|
|
26
|
-
|
|
27
|
-
e.error ? (
|
|
21
|
+
return (e, l) => (i(), u("div", lt, [
|
|
22
|
+
e.ua || e.label ? (i(), u("div", ot, [
|
|
23
|
+
t("span", null, z(e.ua || e.label), 1),
|
|
24
|
+
e.item?.rules?.includes("required") ? (i(), u("span", at, "*")) : j("", !0)
|
|
25
|
+
])) : j("", !0),
|
|
26
|
+
se(e.$slots, "default", Me(Le(e.$attrs))),
|
|
27
|
+
e.error ? (i(), u("span", nt, z(e.error), 1)) : j("", !0)
|
|
28
28
|
]));
|
|
29
29
|
}
|
|
30
|
-
}),
|
|
30
|
+
}), rt = { class: "w-full relative flex flex-row items-center gap-2" }, it = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
|
|
33
|
-
},
|
|
33
|
+
}, ut = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "text-red-500 text-[14px]"
|
|
36
|
-
},
|
|
36
|
+
}, dt = {
|
|
37
37
|
key: 1,
|
|
38
38
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
39
|
-
},
|
|
39
|
+
}, ct = /* @__PURE__ */ M({
|
|
40
40
|
__name: "vs-layout-horizontal",
|
|
41
41
|
props: {
|
|
42
42
|
ua: { default: "" },
|
|
43
43
|
item: { default: () => ({}) },
|
|
44
|
-
error: { default: "" },
|
|
44
|
+
error: { type: [String, Boolean], default: "" },
|
|
45
45
|
label: { default: "" }
|
|
46
46
|
},
|
|
47
47
|
setup(o) {
|
|
48
|
-
return (e,
|
|
49
|
-
e.item?.type !== "html" ? (
|
|
50
|
-
|
|
51
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (
|
|
52
|
-
])) :
|
|
53
|
-
|
|
54
|
-
e.error ? (
|
|
48
|
+
return (e, l) => (i(), u("div", rt, [
|
|
49
|
+
e.item?.type !== "html" ? (i(), u("span", it, [
|
|
50
|
+
le(z(e.ua || e.label) + " ", 1),
|
|
51
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", ut, "*")) : j("", !0)
|
|
52
|
+
])) : j("", !0),
|
|
53
|
+
se(e.$slots, "default", Me(Le(e.$attrs))),
|
|
54
|
+
e.error ? (i(), u("span", dt, z(e.error), 1)) : j("", !0)
|
|
55
55
|
]));
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), pt = { class: "w-full relative" }, ft = {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
60
|
-
},
|
|
60
|
+
}, mt = /* @__PURE__ */ M({
|
|
61
61
|
__name: "vs-layout-inline",
|
|
62
62
|
props: {
|
|
63
63
|
ua: { default: "" },
|
|
64
64
|
item: { default: () => ({}) },
|
|
65
|
-
error: { default: "" },
|
|
65
|
+
error: { type: [String, Boolean], default: "" },
|
|
66
66
|
label: { default: "" }
|
|
67
67
|
},
|
|
68
68
|
setup(o) {
|
|
69
|
-
return (e,
|
|
70
|
-
|
|
71
|
-
e.error ? (
|
|
69
|
+
return (e, l) => (i(), u("div", pt, [
|
|
70
|
+
se(e.$slots, "default", Me(Le(e.$attrs))),
|
|
71
|
+
e.error ? (i(), u("span", ft, z(e.error), 1)) : j("", !0)
|
|
72
72
|
]));
|
|
73
73
|
}
|
|
74
|
-
}),
|
|
75
|
-
default:
|
|
76
|
-
horizontal:
|
|
77
|
-
inline:
|
|
74
|
+
}), ht = {
|
|
75
|
+
default: st,
|
|
76
|
+
horizontal: ct,
|
|
77
|
+
inline: mt
|
|
78
78
|
};
|
|
79
|
-
function
|
|
79
|
+
function ue(o) {
|
|
80
80
|
return {
|
|
81
|
-
inputClass:
|
|
82
|
-
const
|
|
83
|
-
return o?.size === "sm" ?
|
|
81
|
+
inputClass: T(() => {
|
|
82
|
+
const l = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
83
|
+
return o?.size === "sm" ? l + "h-[32px]" : l + "h-[38px]";
|
|
84
84
|
})
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const vt = ["placeholder", "disabled"], Ee = /* @__PURE__ */ M({
|
|
88
88
|
__name: "vs-input-text",
|
|
89
|
-
props: /* @__PURE__ */
|
|
89
|
+
props: /* @__PURE__ */ P({
|
|
90
90
|
style: { default: () => ({}) },
|
|
91
91
|
customClass: { default: "" },
|
|
92
92
|
placeholder: { default: "" },
|
|
@@ -130,23 +130,23 @@ const _hoisted_1$Q = ["placeholder", "disabled"], _sfc_main$V = /* @__PURE__ */
|
|
|
130
130
|
}),
|
|
131
131
|
emits: ["update:modelValue"],
|
|
132
132
|
setup(o) {
|
|
133
|
-
const e = o, { inputClass:
|
|
134
|
-
return (n,
|
|
133
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue");
|
|
134
|
+
return (n, a) => J((i(), u("input", {
|
|
135
135
|
type: "text",
|
|
136
|
-
"onUpdate:modelValue":
|
|
136
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
|
|
137
137
|
placeholder: n.placeholder,
|
|
138
138
|
disabled: n.disabled,
|
|
139
|
-
class:
|
|
139
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [U(l), { "!border-red-600": n.error }]]),
|
|
140
140
|
style: {
|
|
141
141
|
border: "1px solid #CFD9E0"
|
|
142
142
|
}
|
|
143
|
-
}, null, 10,
|
|
144
|
-
[
|
|
143
|
+
}, null, 10, vt)), [
|
|
144
|
+
[ne, s.value]
|
|
145
145
|
]);
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), gt = ["placeholder"], yt = /* @__PURE__ */ M({
|
|
148
148
|
__name: "vs-input-number",
|
|
149
|
-
props: /* @__PURE__ */
|
|
149
|
+
props: /* @__PURE__ */ P({
|
|
150
150
|
style: { default: () => ({}) },
|
|
151
151
|
customClass: {},
|
|
152
152
|
placeholder: { default: "" },
|
|
@@ -190,26 +190,26 @@ const _hoisted_1$Q = ["placeholder", "disabled"], _sfc_main$V = /* @__PURE__ */
|
|
|
190
190
|
}),
|
|
191
191
|
emits: ["update:modelValue"],
|
|
192
192
|
setup(o) {
|
|
193
|
-
const e = o, { inputClass:
|
|
194
|
-
return (n,
|
|
193
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue");
|
|
194
|
+
return (n, a) => J((i(), u("input", {
|
|
195
195
|
type: "number",
|
|
196
196
|
step: "any",
|
|
197
|
-
"onUpdate:modelValue":
|
|
197
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
|
|
198
198
|
placeholder: n.placeholder,
|
|
199
|
-
class:
|
|
199
|
+
class: C(["py-1.5 px-3 block w-full", [U(l)]]),
|
|
200
200
|
style: {
|
|
201
201
|
border: "1px solid #CFD9E0"
|
|
202
202
|
}
|
|
203
|
-
}, null, 10,
|
|
204
|
-
[
|
|
203
|
+
}, null, 10, gt)), [
|
|
204
|
+
[ne, s.value]
|
|
205
205
|
]);
|
|
206
206
|
}
|
|
207
|
-
}),
|
|
208
|
-
const
|
|
209
|
-
for (const [
|
|
210
|
-
|
|
211
|
-
return
|
|
212
|
-
},
|
|
207
|
+
}), F = (o, e) => {
|
|
208
|
+
const l = o.__vccOpts || o;
|
|
209
|
+
for (const [s, n] of e)
|
|
210
|
+
l[s] = n;
|
|
211
|
+
return l;
|
|
212
|
+
}, bt = {}, xt = {
|
|
213
213
|
xmlns: "http://www.w3.org/2000/svg",
|
|
214
214
|
viewBox: "0 0 24 24",
|
|
215
215
|
fill: "none",
|
|
@@ -219,17 +219,17 @@ const _hoisted_1$Q = ["placeholder", "disabled"], _sfc_main$V = /* @__PURE__ */
|
|
|
219
219
|
"stroke-linejoin": "round",
|
|
220
220
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
221
221
|
};
|
|
222
|
-
function
|
|
223
|
-
return
|
|
224
|
-
|
|
222
|
+
function wt(o, e) {
|
|
223
|
+
return i(), u("svg", xt, e[0] || (e[0] = [
|
|
224
|
+
t("path", {
|
|
225
225
|
stroke: "none",
|
|
226
226
|
d: "M0 0h24v24H0z",
|
|
227
227
|
fill: "none"
|
|
228
228
|
}, null, -1),
|
|
229
|
-
|
|
229
|
+
t("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
230
230
|
]));
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const kt = /* @__PURE__ */ F(bt, [["render", wt]]), _t = { class: "flex items-center gap-[4px]" }, $t = ["value", "id", "disabled"], Bt = ["for"], Ct = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Vt = /* @__PURE__ */ M({
|
|
233
233
|
__name: "vs-checkbox-default",
|
|
234
234
|
props: {
|
|
235
235
|
value: { default: "" },
|
|
@@ -238,105 +238,102 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_rend
|
|
|
238
238
|
id: {},
|
|
239
239
|
modelValue: { default: "" },
|
|
240
240
|
info: {},
|
|
241
|
-
error: {
|
|
241
|
+
error: {}
|
|
242
242
|
},
|
|
243
243
|
emits: ["update:modelValue"],
|
|
244
244
|
setup(o, { emit: e }) {
|
|
245
|
-
const
|
|
246
|
-
get: () =>
|
|
247
|
-
set: (
|
|
245
|
+
const l = e, s = o, n = T({
|
|
246
|
+
get: () => s.modelValue,
|
|
247
|
+
set: (a) => l("update:modelValue", a)
|
|
248
248
|
});
|
|
249
|
-
return (
|
|
250
|
-
|
|
249
|
+
return (a, r) => (i(), u("div", _t, [
|
|
250
|
+
J(t("input", {
|
|
251
251
|
type: "checkbox",
|
|
252
|
-
value:
|
|
253
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
254
|
-
class:
|
|
255
|
-
id:
|
|
256
|
-
disabled:
|
|
257
|
-
}, null, 10,
|
|
258
|
-
[
|
|
252
|
+
value: a.value,
|
|
253
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => n.value = d),
|
|
254
|
+
class: C(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": a.disabled }]),
|
|
255
|
+
id: a.id,
|
|
256
|
+
disabled: a.disabled
|
|
257
|
+
}, null, 10, $t), [
|
|
258
|
+
[Ue, n.value]
|
|
259
259
|
]),
|
|
260
|
-
|
|
261
|
-
for:
|
|
262
|
-
class:
|
|
260
|
+
t("label", {
|
|
261
|
+
for: a.id,
|
|
262
|
+
class: C(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": a.disabled }])
|
|
263
263
|
}, [
|
|
264
|
-
|
|
265
|
-
class:
|
|
264
|
+
t("div", {
|
|
265
|
+
class: C(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [n.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", a.error ? "border-red-600" : ""]])
|
|
266
266
|
}, [
|
|
267
|
-
|
|
267
|
+
V(kt, {
|
|
268
268
|
height: "12",
|
|
269
269
|
width: "12"
|
|
270
270
|
})
|
|
271
271
|
], 2),
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
t("span", Ct, [
|
|
273
|
+
se(a.$slots, "default", {}, () => [
|
|
274
|
+
le(z(a.label), 1)
|
|
275
275
|
])
|
|
276
276
|
])
|
|
277
|
-
], 10,
|
|
277
|
+
], 10, Bt)
|
|
278
278
|
]));
|
|
279
279
|
}
|
|
280
|
-
}),
|
|
280
|
+
}), Mt = ["name", "value", "disabled"], Lt = { class: "flex items-center gap-[6px] text-[14px]" }, St = {
|
|
281
281
|
key: 0,
|
|
282
282
|
class: "text-[16px]"
|
|
283
|
-
},
|
|
283
|
+
}, jt = ["src"], It = /* @__PURE__ */ M({
|
|
284
284
|
__name: "vs-checkbox-buttons",
|
|
285
285
|
props: {
|
|
286
286
|
value: { type: [String, Number, Boolean], default: "" },
|
|
287
287
|
label: { default: "" },
|
|
288
288
|
modelValue: { default: "" },
|
|
289
|
-
disabled: { type: Boolean
|
|
289
|
+
disabled: { type: Boolean },
|
|
290
290
|
id: {},
|
|
291
291
|
icon: {},
|
|
292
292
|
imgUrl: {},
|
|
293
|
-
style: {
|
|
293
|
+
style: {}
|
|
294
294
|
},
|
|
295
295
|
emits: ["update:modelValue"],
|
|
296
296
|
setup(o, { emit: e }) {
|
|
297
|
-
const
|
|
298
|
-
get: () =>
|
|
299
|
-
set: (
|
|
300
|
-
|
|
297
|
+
const l = o, s = e, n = T({
|
|
298
|
+
get: () => l.modelValue,
|
|
299
|
+
set: (d) => {
|
|
300
|
+
s("update:modelValue", d);
|
|
301
301
|
}
|
|
302
|
-
}),
|
|
303
|
-
return (
|
|
304
|
-
class:
|
|
302
|
+
}), a = T(() => Array.isArray(n.value) ? n.value.includes(l.value) : n.value === !0 || n.value === l.value), r = T(() => l.style?.size === "xs" ? "p-1.5 text-xs" : l.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
303
|
+
return (d, p) => (i(), u("label", {
|
|
304
|
+
class: C(["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, a.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
305
305
|
}, [
|
|
306
|
-
|
|
306
|
+
J(t("input", {
|
|
307
307
|
type: "checkbox",
|
|
308
308
|
class: "hidden",
|
|
309
|
-
name:
|
|
310
|
-
value:
|
|
311
|
-
"onUpdate:modelValue":
|
|
312
|
-
disabled:
|
|
313
|
-
}, null, 8,
|
|
314
|
-
[
|
|
309
|
+
name: d.id,
|
|
310
|
+
value: d.value,
|
|
311
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
|
|
312
|
+
disabled: d.disabled
|
|
313
|
+
}, null, 8, Mt), [
|
|
314
|
+
[Ue, n.value]
|
|
315
315
|
]),
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
t("span", Lt, [
|
|
317
|
+
d.icon || d.imgUrl ? (i(), u("span", St, [
|
|
318
|
+
d.icon ? (i(), u("i", {
|
|
319
319
|
key: 0,
|
|
320
|
-
class:
|
|
321
|
-
}, null, 2)) :
|
|
322
|
-
|
|
320
|
+
class: C(d.icon)
|
|
321
|
+
}, null, 2)) : j("", !0),
|
|
322
|
+
d.imgUrl ? (i(), u("img", {
|
|
323
323
|
key: 1,
|
|
324
|
-
src:
|
|
324
|
+
src: d.imgUrl,
|
|
325
325
|
width: "16",
|
|
326
326
|
height: "16",
|
|
327
327
|
alt: "icon"
|
|
328
|
-
}, null, 8,
|
|
329
|
-
])) :
|
|
330
|
-
|
|
331
|
-
|
|
328
|
+
}, null, 8, jt)) : j("", !0)
|
|
329
|
+
])) : j("", !0),
|
|
330
|
+
se(d.$slots, "default", {}, () => [
|
|
331
|
+
le(z(d.label), 1)
|
|
332
332
|
])
|
|
333
333
|
])
|
|
334
334
|
], 2));
|
|
335
335
|
}
|
|
336
|
-
}),
|
|
337
|
-
"vs-checkbox-default": _sfc_main$S,
|
|
338
|
-
"vs-checkbox-buttons": _sfc_main$R
|
|
339
|
-
}, _hoisted_1$L = { class: "flex items-center" }, _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
336
|
+
}), Et = { class: "flex items-center" }, qe = /* @__PURE__ */ M({
|
|
340
337
|
__name: "vs-input-checkbox-item",
|
|
341
338
|
props: {
|
|
342
339
|
value: { default: "" },
|
|
@@ -346,45 +343,45 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_rend
|
|
|
346
343
|
modelValue: { type: [Boolean, Array], default: !1 },
|
|
347
344
|
icon: {},
|
|
348
345
|
imgUrl: {},
|
|
349
|
-
slots: {
|
|
346
|
+
slots: {},
|
|
350
347
|
option: {},
|
|
351
|
-
style: {
|
|
352
|
-
error: { default:
|
|
348
|
+
style: {},
|
|
349
|
+
error: { default: "" }
|
|
353
350
|
},
|
|
354
351
|
emits: ["update:modelValue"],
|
|
355
352
|
setup(o, { emit: e }) {
|
|
356
|
-
const
|
|
357
|
-
get: () => Array.isArray(
|
|
358
|
-
set: (
|
|
359
|
-
if (Array.isArray(
|
|
360
|
-
let
|
|
361
|
-
|
|
353
|
+
const l = o, s = e, n = `radio-${Math.floor(Math.random() * 1e4)}`, a = T({
|
|
354
|
+
get: () => Array.isArray(l.modelValue) ? Array.isArray(l.modelValue) && l.modelValue.includes(l.value) : l.modelValue,
|
|
355
|
+
set: (d) => {
|
|
356
|
+
if (Array.isArray(l.modelValue)) {
|
|
357
|
+
let p = [...l.modelValue];
|
|
358
|
+
d ? p.includes(l.value) || p.push(l.value) : p = p.filter((x) => x !== l.value), s("update:modelValue", p);
|
|
362
359
|
} else
|
|
363
|
-
|
|
360
|
+
s("update:modelValue", d);
|
|
364
361
|
}
|
|
365
|
-
}), r =
|
|
366
|
-
return (
|
|
367
|
-
(
|
|
368
|
-
value:
|
|
369
|
-
label:
|
|
370
|
-
info:
|
|
371
|
-
disabled:
|
|
372
|
-
modelValue:
|
|
373
|
-
"onUpdate:modelValue":
|
|
362
|
+
}), r = _(`vs-checkbox-${l.view || "default"}`);
|
|
363
|
+
return (d, p) => (i(), u("div", Et, [
|
|
364
|
+
(i(), K(de(r.value === "vs-checkbox-buttons" ? U(It) : U(Vt)), {
|
|
365
|
+
value: d.value,
|
|
366
|
+
label: d.label,
|
|
367
|
+
info: d.option?.info,
|
|
368
|
+
disabled: d.disabled,
|
|
369
|
+
modelValue: a.value,
|
|
370
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => a.value = x),
|
|
374
371
|
id: n,
|
|
375
|
-
icon:
|
|
376
|
-
imgUrl:
|
|
377
|
-
style:
|
|
378
|
-
error:
|
|
372
|
+
icon: d.icon,
|
|
373
|
+
imgUrl: d.imgUrl,
|
|
374
|
+
style: ve(d.style),
|
|
375
|
+
error: d.error
|
|
379
376
|
}, {
|
|
380
|
-
default:
|
|
381
|
-
|
|
377
|
+
default: ge(() => [
|
|
378
|
+
le(z(d.label), 1)
|
|
382
379
|
]),
|
|
383
380
|
_: 1
|
|
384
381
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
385
382
|
]));
|
|
386
383
|
}
|
|
387
|
-
}),
|
|
384
|
+
}), Ot = {}, zt = {
|
|
388
385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
389
386
|
viewBox: "0 0 24 24",
|
|
390
387
|
fill: "none",
|
|
@@ -394,17 +391,17 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_rend
|
|
|
394
391
|
"stroke-linejoin": "round",
|
|
395
392
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
396
393
|
};
|
|
397
|
-
function
|
|
398
|
-
return
|
|
399
|
-
|
|
394
|
+
function At(o, e) {
|
|
395
|
+
return i(), u("svg", zt, e[0] || (e[0] = [
|
|
396
|
+
t("path", {
|
|
400
397
|
stroke: "none",
|
|
401
398
|
d: "M0 0h24v24H0z",
|
|
402
399
|
fill: "none"
|
|
403
400
|
}, null, -1),
|
|
404
|
-
|
|
401
|
+
t("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
405
402
|
]));
|
|
406
403
|
}
|
|
407
|
-
const
|
|
404
|
+
const Ft = /* @__PURE__ */ F(Ot, [["render", At]]), Dt = {}, Tt = {
|
|
408
405
|
xmlns: "http://www.w3.org/2000/svg",
|
|
409
406
|
width: "24",
|
|
410
407
|
height: "24",
|
|
@@ -415,27 +412,27 @@ const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sf
|
|
|
415
412
|
"stroke-linecap": "round",
|
|
416
413
|
"stroke-linejoin": "round"
|
|
417
414
|
};
|
|
418
|
-
function
|
|
419
|
-
return
|
|
420
|
-
|
|
415
|
+
function Ut(o, e) {
|
|
416
|
+
return i(), u("svg", Tt, e[0] || (e[0] = [
|
|
417
|
+
t("path", {
|
|
421
418
|
stroke: "none",
|
|
422
419
|
d: "M0 0h24v24H0z",
|
|
423
420
|
fill: "none"
|
|
424
421
|
}, null, -1),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
422
|
+
t("path", { d: "M12 9h.01" }, null, -1),
|
|
423
|
+
t("path", { d: "M11 12h1v4h1" }, null, -1),
|
|
424
|
+
t("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
428
425
|
]));
|
|
429
426
|
}
|
|
430
|
-
const
|
|
427
|
+
const Rt = /* @__PURE__ */ F(Dt, [["render", Ut]]), Ht = {
|
|
431
428
|
key: 0,
|
|
432
429
|
class: "flex items-start gap-x-1"
|
|
433
|
-
},
|
|
430
|
+
}, Pt = {
|
|
434
431
|
key: 0,
|
|
435
432
|
class: "text-red-500 text-[14px]"
|
|
436
|
-
},
|
|
433
|
+
}, Nt = ["title"], qt = ["disabled"], Ge = /* @__PURE__ */ M({
|
|
437
434
|
__name: "vs-input-switcher",
|
|
438
|
-
props: /* @__PURE__ */
|
|
435
|
+
props: /* @__PURE__ */ P({
|
|
439
436
|
style: { default: () => ({}) },
|
|
440
437
|
customClass: { default: "" },
|
|
441
438
|
placeholder: {},
|
|
@@ -479,38 +476,38 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
479
476
|
}),
|
|
480
477
|
emits: ["update:modelValue"],
|
|
481
478
|
setup(o) {
|
|
482
|
-
const e = o,
|
|
483
|
-
return (
|
|
484
|
-
|
|
485
|
-
modelValue:
|
|
486
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
487
|
-
label:
|
|
488
|
-
error:
|
|
479
|
+
const e = o, l = R(o, "modelValue");
|
|
480
|
+
return (s, n) => e.view === "checkbox" ? (i(), u("div", Ht, [
|
|
481
|
+
V(qe, {
|
|
482
|
+
modelValue: l.value,
|
|
483
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => l.value = a),
|
|
484
|
+
label: s.text,
|
|
485
|
+
error: s.error || ""
|
|
489
486
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
490
|
-
|
|
491
|
-
|
|
487
|
+
s.rules?.includes("required") ? (i(), u("span", Pt, "*")) : j("", !0),
|
|
488
|
+
s.i ? (i(), u("button", {
|
|
492
489
|
key: 1,
|
|
493
490
|
class: "cursor-pointer",
|
|
494
|
-
title:
|
|
495
|
-
onClick: n[1] || (n[1] =
|
|
491
|
+
title: s.i,
|
|
492
|
+
onClick: n[1] || (n[1] = _e(() => {
|
|
496
493
|
}, ["prevent"]))
|
|
497
494
|
}, [
|
|
498
|
-
|
|
499
|
-
], 8,
|
|
500
|
-
])) : (
|
|
495
|
+
V(U(Rt), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
496
|
+
], 8, Nt)) : j("", !0)
|
|
497
|
+
])) : (i(), u("button", {
|
|
501
498
|
key: 1,
|
|
502
499
|
type: "button",
|
|
503
|
-
class:
|
|
504
|
-
disabled:
|
|
505
|
-
onClick: n[2] || (n[2] = (
|
|
500
|
+
class: C(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [l.value ? `bg-${s.style?.primaryColor || "blue"}-500` : "bg-stone-200", s.customClass]]),
|
|
501
|
+
disabled: s.disabled,
|
|
502
|
+
onClick: n[2] || (n[2] = (a) => l.value = !l.value)
|
|
506
503
|
}, [
|
|
507
|
-
|
|
504
|
+
t("span", {
|
|
508
505
|
"data-state": "checked",
|
|
509
|
-
class:
|
|
506
|
+
class: C(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [l.value ? "translate-x-4" : "translate-x-0"]])
|
|
510
507
|
}, null, 2)
|
|
511
|
-
], 10,
|
|
508
|
+
], 10, qt));
|
|
512
509
|
}
|
|
513
|
-
}),
|
|
510
|
+
}), Gt = ["innerHTML"], Jt = /* @__PURE__ */ M({
|
|
514
511
|
__name: "vs-input-static",
|
|
515
512
|
props: {
|
|
516
513
|
style: {},
|
|
@@ -553,14 +550,14 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
553
550
|
},
|
|
554
551
|
setup(o) {
|
|
555
552
|
const e = o;
|
|
556
|
-
return (
|
|
557
|
-
class:
|
|
553
|
+
return (l, s) => (i(), u("div", {
|
|
554
|
+
class: C(l.customClass),
|
|
558
555
|
innerHTML: (e.html === "", e.text)
|
|
559
|
-
}, null, 10,
|
|
556
|
+
}, null, 10, Gt));
|
|
560
557
|
}
|
|
561
|
-
}),
|
|
558
|
+
}), Zt = ["placeholder", "disabled", "name"], Kt = /* @__PURE__ */ M({
|
|
562
559
|
__name: "vs-input-mask",
|
|
563
|
-
props: /* @__PURE__ */
|
|
560
|
+
props: /* @__PURE__ */ P({
|
|
564
561
|
style: { default: () => ({}) },
|
|
565
562
|
customClass: { default: "" },
|
|
566
563
|
placeholder: { default: "" },
|
|
@@ -604,12 +601,12 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
604
601
|
}),
|
|
605
602
|
emits: ["update:modelValue"],
|
|
606
603
|
setup(o) {
|
|
607
|
-
const e = o, { inputClass:
|
|
608
|
-
let
|
|
609
|
-
return
|
|
604
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue"), n = _(null);
|
|
605
|
+
let a = null;
|
|
606
|
+
return oe(async () => {
|
|
610
607
|
if (n.value) {
|
|
611
608
|
const { default: r } = await import("./index-W-qQIppj.js");
|
|
612
|
-
|
|
609
|
+
a = r(n.value, {
|
|
613
610
|
mask: e.mask || "",
|
|
614
611
|
definitions: {
|
|
615
612
|
9: /[0-9]/,
|
|
@@ -618,16 +615,16 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
618
615
|
},
|
|
619
616
|
lazy: !1,
|
|
620
617
|
placeholderChar: "_"
|
|
621
|
-
}),
|
|
622
|
-
|
|
623
|
-
}),
|
|
624
|
-
|
|
625
|
-
}),
|
|
618
|
+
}), a.on("accept", () => {
|
|
619
|
+
s.value = e.unmask ? a.unmaskedValue : a.value;
|
|
620
|
+
}), a.on("complete", () => {
|
|
621
|
+
s.value = e.unmask ? a.unmaskedValue : a.value;
|
|
622
|
+
}), a.value = s.value ?? "";
|
|
626
623
|
}
|
|
627
|
-
}),
|
|
628
|
-
|
|
629
|
-
}),
|
|
630
|
-
|
|
624
|
+
}), Re(() => {
|
|
625
|
+
a?.destroy();
|
|
626
|
+
}), ae(() => e.mask, (r) => {
|
|
627
|
+
a && a.updateOptions({
|
|
631
628
|
mask: r,
|
|
632
629
|
definitions: {
|
|
633
630
|
9: /[0-9]/,
|
|
@@ -635,22 +632,22 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
635
632
|
"*": /[a-zA-Z0-9]/
|
|
636
633
|
}
|
|
637
634
|
});
|
|
638
|
-
}),
|
|
639
|
-
|
|
640
|
-
}), (r,
|
|
635
|
+
}), ae(s, (r) => {
|
|
636
|
+
a && a.unmaskedValue !== r && (a.value = r || "");
|
|
637
|
+
}), (r, d) => (i(), u("input", {
|
|
641
638
|
type: "text",
|
|
642
639
|
ref_key: "inputEl",
|
|
643
640
|
ref: n,
|
|
644
641
|
placeholder: r.placeholder,
|
|
645
642
|
disabled: r.disabled,
|
|
646
643
|
name: r.name,
|
|
647
|
-
class:
|
|
644
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [U(l)]]),
|
|
648
645
|
style: {
|
|
649
646
|
border: "1px solid #CFD9E0"
|
|
650
647
|
}
|
|
651
|
-
}, null, 10,
|
|
648
|
+
}, null, 10, Zt));
|
|
652
649
|
}
|
|
653
|
-
}),
|
|
650
|
+
}), Wt = ["innerHTML"], Qt = /* @__PURE__ */ M({
|
|
654
651
|
__name: "vs-input-html",
|
|
655
652
|
props: {
|
|
656
653
|
style: {},
|
|
@@ -692,13 +689,13 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
692
689
|
colSpan: {}
|
|
693
690
|
},
|
|
694
691
|
setup(o) {
|
|
695
|
-
return (e,
|
|
696
|
-
|
|
692
|
+
return (e, l) => (i(), u("div", null, [
|
|
693
|
+
t("div", { innerHTML: e.text }, null, 8, Wt)
|
|
697
694
|
]));
|
|
698
695
|
}
|
|
699
|
-
}),
|
|
696
|
+
}), Xt = { class: "relative w-full bg-white rounded-lg" }, Yt = ["placeholder", "disabled"], el = /* @__PURE__ */ M({
|
|
700
697
|
__name: "vs-input-email",
|
|
701
|
-
props: /* @__PURE__ */
|
|
698
|
+
props: /* @__PURE__ */ P({
|
|
702
699
|
style: { default: () => ({}) },
|
|
703
700
|
customClass: { default: "" },
|
|
704
701
|
placeholder: { default: "" },
|
|
@@ -742,27 +739,27 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
742
739
|
}),
|
|
743
740
|
emits: ["update:modelValue"],
|
|
744
741
|
setup(o) {
|
|
745
|
-
const e = o, { inputClass:
|
|
746
|
-
return (n,
|
|
747
|
-
|
|
748
|
-
|
|
742
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue");
|
|
743
|
+
return (n, a) => (i(), u("div", Xt, [
|
|
744
|
+
a[1] || (a[1] = te('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
|
|
745
|
+
J(t("input", {
|
|
749
746
|
type: "email",
|
|
750
|
-
"onUpdate:modelValue":
|
|
747
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
|
|
751
748
|
placeholder: n.placeholder,
|
|
752
749
|
disabled: n.disabled,
|
|
753
|
-
class:
|
|
750
|
+
class: C(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [U(l), { "!border-red-600": n.error }]]),
|
|
754
751
|
style: {
|
|
755
752
|
border: "1px solid #CFD9E0"
|
|
756
753
|
}
|
|
757
|
-
}, null, 10,
|
|
758
|
-
[
|
|
754
|
+
}, null, 10, Yt), [
|
|
755
|
+
[ne, s.value]
|
|
759
756
|
])
|
|
760
757
|
]));
|
|
761
758
|
}
|
|
762
|
-
}),
|
|
759
|
+
}), tl = ["value", "disabled"], ll = { class: "text-[13px] text-gray-700" }, ol = /* @__PURE__ */ M({
|
|
763
760
|
__name: "vs-input-radio-default",
|
|
764
|
-
props: /* @__PURE__ */
|
|
765
|
-
style: {
|
|
761
|
+
props: /* @__PURE__ */ P({
|
|
762
|
+
style: {},
|
|
766
763
|
customClass: { default: "" },
|
|
767
764
|
placeholder: {},
|
|
768
765
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -805,37 +802,37 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
805
802
|
}),
|
|
806
803
|
emits: ["update:modelValue"],
|
|
807
804
|
setup(o) {
|
|
808
|
-
const e =
|
|
809
|
-
return (
|
|
810
|
-
class:
|
|
805
|
+
const e = R(o, "modelValue");
|
|
806
|
+
return (l, s) => (i(), u("label", {
|
|
807
|
+
class: C(["flex items-center gap-0", [l.customClass]])
|
|
811
808
|
}, [
|
|
812
|
-
|
|
813
|
-
"onUpdate:modelValue":
|
|
809
|
+
J(t("input", {
|
|
810
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => e.value = n),
|
|
814
811
|
type: "radio",
|
|
815
|
-
value:
|
|
816
|
-
disabled:
|
|
812
|
+
value: l.value,
|
|
813
|
+
disabled: l.disabled,
|
|
817
814
|
class: "hidden"
|
|
818
|
-
}, null, 8,
|
|
819
|
-
[
|
|
815
|
+
}, null, 8, tl), [
|
|
816
|
+
[He, e.value]
|
|
820
817
|
]),
|
|
821
|
-
|
|
822
|
-
class:
|
|
823
|
-
`border-${
|
|
824
|
-
|
|
818
|
+
t("span", {
|
|
819
|
+
class: C(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
820
|
+
`border-${l.style?.primaryColor || "blue"}-500`,
|
|
821
|
+
l.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
825
822
|
]])
|
|
826
823
|
}, [
|
|
827
|
-
e.value ==
|
|
824
|
+
e.value == l.value ? (i(), u("span", {
|
|
828
825
|
key: 0,
|
|
829
|
-
class:
|
|
830
|
-
}, null, 2)) :
|
|
826
|
+
class: C(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${l.style?.primaryColor || "blue"}-500`]])
|
|
827
|
+
}, null, 2)) : j("", !0)
|
|
831
828
|
], 2),
|
|
832
|
-
|
|
829
|
+
t("span", ll, z(l.text), 1)
|
|
833
830
|
], 2));
|
|
834
831
|
}
|
|
835
|
-
}),
|
|
832
|
+
}), al = ["value", "disabled"], nl = { class: "text-[13px] text-gray-700" }, sl = /* @__PURE__ */ M({
|
|
836
833
|
__name: "vs-input-radio-buttons",
|
|
837
|
-
props: /* @__PURE__ */
|
|
838
|
-
style: {
|
|
834
|
+
props: /* @__PURE__ */ P({
|
|
835
|
+
style: {},
|
|
839
836
|
customClass: { default: "" },
|
|
840
837
|
placeholder: {},
|
|
841
838
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -878,31 +875,31 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
878
875
|
}),
|
|
879
876
|
emits: ["update:modelValue"],
|
|
880
877
|
setup(o) {
|
|
881
|
-
const e =
|
|
882
|
-
return (
|
|
883
|
-
class:
|
|
884
|
-
e.value ==
|
|
885
|
-
|
|
878
|
+
const e = R(o, "modelValue");
|
|
879
|
+
return (l, s) => (i(), u("label", {
|
|
880
|
+
class: C(["flex items-center border rounded-lg px-2 py-1", [
|
|
881
|
+
e.value == l.value ? `ring-2 ring-ring ring-${l.style?.primaryColor || "blue"}-500` : "",
|
|
882
|
+
l.customClass
|
|
886
883
|
]])
|
|
887
884
|
}, [
|
|
888
|
-
|
|
889
|
-
"onUpdate:modelValue":
|
|
885
|
+
J(t("input", {
|
|
886
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => e.value = n),
|
|
890
887
|
type: "radio",
|
|
891
|
-
value:
|
|
892
|
-
disabled:
|
|
888
|
+
value: l.value,
|
|
889
|
+
disabled: l.disabled,
|
|
893
890
|
class: "hidden"
|
|
894
|
-
}, null, 8,
|
|
895
|
-
[
|
|
891
|
+
}, null, 8, al), [
|
|
892
|
+
[He, e.value]
|
|
896
893
|
]),
|
|
897
|
-
|
|
894
|
+
t("span", nl, z(l.text), 1)
|
|
898
895
|
], 2));
|
|
899
896
|
}
|
|
900
|
-
}),
|
|
901
|
-
"vs-input-radio-default":
|
|
902
|
-
"vs-input-radio-buttons":
|
|
903
|
-
},
|
|
897
|
+
}), rl = {
|
|
898
|
+
"vs-input-radio-default": ol,
|
|
899
|
+
"vs-input-radio-buttons": sl
|
|
900
|
+
}, Oe = /* @__PURE__ */ M({
|
|
904
901
|
__name: "vs-input-radio",
|
|
905
|
-
props: /* @__PURE__ */
|
|
902
|
+
props: /* @__PURE__ */ P({
|
|
906
903
|
style: {},
|
|
907
904
|
customClass: {},
|
|
908
905
|
placeholder: {},
|
|
@@ -946,21 +943,21 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
946
943
|
}),
|
|
947
944
|
emits: ["update:modelValue"],
|
|
948
945
|
setup(o) {
|
|
949
|
-
const e = o,
|
|
950
|
-
return (n,
|
|
951
|
-
class:
|
|
946
|
+
const e = o, l = R(o, "modelValue"), s = T(() => rl[`vs-input-radio-${e.view}`]);
|
|
947
|
+
return (n, a) => (i(), u("div", {
|
|
948
|
+
class: C([n.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
952
949
|
}, [
|
|
953
|
-
(
|
|
950
|
+
(i(!0), u(W, null, Q(n.options, (r) => (i(), K(de(s.value), me({
|
|
954
951
|
key: r?.id,
|
|
955
952
|
text: r.text,
|
|
956
953
|
value: r.id.toString(),
|
|
957
|
-
checked:
|
|
958
|
-
modelValue:
|
|
959
|
-
"onUpdate:modelValue":
|
|
954
|
+
checked: l.value === r.id,
|
|
955
|
+
modelValue: l.value,
|
|
956
|
+
"onUpdate:modelValue": a[0] || (a[0] = (d) => l.value = d)
|
|
960
957
|
}, { ref_for: !0 }, n.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
961
958
|
], 2));
|
|
962
959
|
}
|
|
963
|
-
}),
|
|
960
|
+
}), il = /* @__PURE__ */ M({
|
|
964
961
|
__name: "vs-input-checkbox",
|
|
965
962
|
props: {
|
|
966
963
|
style: {},
|
|
@@ -998,99 +995,98 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
998
995
|
format: {},
|
|
999
996
|
colModel: {},
|
|
1000
997
|
position: { default: "vertical" },
|
|
1001
|
-
view: {
|
|
998
|
+
view: {},
|
|
1002
999
|
colSpan: { default: 0 }
|
|
1003
1000
|
},
|
|
1004
1001
|
emits: ["update:modelValue"],
|
|
1005
1002
|
setup(o, { emit: e }) {
|
|
1006
|
-
const
|
|
1007
|
-
console.log(
|
|
1008
|
-
const
|
|
1003
|
+
const l = o;
|
|
1004
|
+
console.log(l.position);
|
|
1005
|
+
const s = e, n = _([]), a = Qe({}), r = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, x = async () => {
|
|
1009
1006
|
try {
|
|
1010
|
-
const
|
|
1011
|
-
n.value =
|
|
1012
|
-
} catch (
|
|
1013
|
-
console.error(
|
|
1007
|
+
const c = await fetch(`/api/suggest/${l.data}`).then((m) => m.json());
|
|
1008
|
+
n.value = c?.data || c;
|
|
1009
|
+
} catch (c) {
|
|
1010
|
+
console.error(c);
|
|
1014
1011
|
}
|
|
1015
1012
|
};
|
|
1016
|
-
return
|
|
1017
|
-
() =>
|
|
1018
|
-
(
|
|
1019
|
-
if (typeof
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
} else if (Array.isArray(
|
|
1023
|
-
const
|
|
1024
|
-
n.value.forEach((
|
|
1025
|
-
if (!
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1013
|
+
return ae(
|
|
1014
|
+
() => l.modelValue,
|
|
1015
|
+
(c) => {
|
|
1016
|
+
if (typeof c == "boolean" && n.value.length === 1) {
|
|
1017
|
+
const m = r(n.value[0]);
|
|
1018
|
+
a[m] = c;
|
|
1019
|
+
} else if (Array.isArray(c)) {
|
|
1020
|
+
const m = new Set(c);
|
|
1021
|
+
n.value.forEach((f) => {
|
|
1022
|
+
if (!f.disabled) {
|
|
1023
|
+
const I = r(f);
|
|
1024
|
+
a[I] = m.has(I);
|
|
1028
1025
|
}
|
|
1029
1026
|
});
|
|
1030
1027
|
}
|
|
1031
1028
|
},
|
|
1032
1029
|
{ immediate: !0 }
|
|
1033
|
-
),
|
|
1034
|
-
|
|
1030
|
+
), ae(
|
|
1031
|
+
a,
|
|
1035
1032
|
() => {
|
|
1036
1033
|
if (!n.value.length) {
|
|
1037
|
-
|
|
1034
|
+
s("update:modelValue", null);
|
|
1038
1035
|
return;
|
|
1039
1036
|
}
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1037
|
+
const c = Object.entries(a).filter(([, m]) => m).map(([m]) => m);
|
|
1038
|
+
s("update:modelValue", c.length === 0 ? null : c);
|
|
1042
1039
|
},
|
|
1043
1040
|
{ deep: !0 }
|
|
1044
|
-
),
|
|
1045
|
-
if (
|
|
1046
|
-
|
|
1047
|
-
if (typeof
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1050
|
-
} else if (Array.isArray(
|
|
1051
|
-
const
|
|
1052
|
-
n.value.forEach((
|
|
1053
|
-
if (!
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1041
|
+
), oe(() => {
|
|
1042
|
+
if (l.data)
|
|
1043
|
+
x().then(() => {
|
|
1044
|
+
if (typeof l.modelValue == "boolean" && n.value.length === 1) {
|
|
1045
|
+
const c = r(n.value[0]);
|
|
1046
|
+
a[c] = l.modelValue;
|
|
1047
|
+
} else if (Array.isArray(l.modelValue)) {
|
|
1048
|
+
const c = new Set(l.modelValue);
|
|
1049
|
+
n.value.forEach((m) => {
|
|
1050
|
+
if (!m.disabled) {
|
|
1051
|
+
const f = r(m);
|
|
1052
|
+
a[f] = c.has(f);
|
|
1056
1053
|
}
|
|
1057
1054
|
});
|
|
1058
1055
|
}
|
|
1059
1056
|
});
|
|
1060
|
-
else if (n.value =
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
} else if (Array.isArray(
|
|
1064
|
-
const
|
|
1065
|
-
n.value.forEach((
|
|
1066
|
-
if (!
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1057
|
+
else if (n.value = l.options, typeof l.modelValue == "boolean" && n.value.length === 1) {
|
|
1058
|
+
const c = r(n.value[0]);
|
|
1059
|
+
a[c] = l.modelValue;
|
|
1060
|
+
} else if (Array.isArray(l.modelValue)) {
|
|
1061
|
+
const c = new Set(l.modelValue);
|
|
1062
|
+
n.value.forEach((m) => {
|
|
1063
|
+
if (!m.disabled) {
|
|
1064
|
+
const f = r(m);
|
|
1065
|
+
a[f] = c.has(f);
|
|
1069
1066
|
}
|
|
1070
1067
|
});
|
|
1071
1068
|
}
|
|
1072
|
-
}), (
|
|
1073
|
-
class:
|
|
1069
|
+
}), (c, m) => (i(), u("div", {
|
|
1070
|
+
class: C(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
|
|
1074
1071
|
}, [
|
|
1075
|
-
(
|
|
1076
|
-
modelValue:
|
|
1077
|
-
"onUpdate:modelValue": (
|
|
1078
|
-
value: r(
|
|
1079
|
-
class:
|
|
1080
|
-
disabled:
|
|
1081
|
-
label:
|
|
1082
|
-
key: r(
|
|
1083
|
-
icon:
|
|
1084
|
-
imgUrl:
|
|
1085
|
-
option:
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
1072
|
+
(i(!0), u(W, null, Q(n.value, (f) => (i(), K(qe, {
|
|
1073
|
+
modelValue: a[r(f)],
|
|
1074
|
+
"onUpdate:modelValue": (I) => a[r(f)] = I,
|
|
1075
|
+
value: r(f),
|
|
1076
|
+
class: C(p(c.colSpan)),
|
|
1077
|
+
disabled: f.disabled,
|
|
1078
|
+
label: d(f),
|
|
1079
|
+
key: r(f),
|
|
1080
|
+
icon: f?.icon,
|
|
1081
|
+
imgUrl: f?.imgUrl,
|
|
1082
|
+
option: f,
|
|
1083
|
+
view: c.view
|
|
1084
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
1089
1085
|
], 2));
|
|
1090
1086
|
}
|
|
1091
|
-
}),
|
|
1087
|
+
}), ul = /* @__PURE__ */ F(il, [["__scopeId", "data-v-78e3db80"]]), dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ M({
|
|
1092
1088
|
__name: "vs-input-date1",
|
|
1093
|
-
props: /* @__PURE__ */
|
|
1089
|
+
props: /* @__PURE__ */ P({
|
|
1094
1090
|
style: { default: () => ({}) },
|
|
1095
1091
|
customClass: { default: "" },
|
|
1096
1092
|
placeholder: { default: "" },
|
|
@@ -1134,52 +1130,52 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
1134
1130
|
}),
|
|
1135
1131
|
emits: ["update:modelValue"],
|
|
1136
1132
|
setup(o) {
|
|
1137
|
-
const e = o, { inputClass:
|
|
1138
|
-
return (n,
|
|
1133
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue");
|
|
1134
|
+
return (n, a) => J((i(), u("input", {
|
|
1139
1135
|
type: "date",
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1136
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
|
|
1141
1137
|
placeholder: n.placeholder,
|
|
1142
1138
|
disabled: n.disabled,
|
|
1143
|
-
class:
|
|
1139
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [U(l)]]),
|
|
1144
1140
|
style: {
|
|
1145
1141
|
border: "1px solid #CFD9E0"
|
|
1146
1142
|
}
|
|
1147
|
-
}, null, 10,
|
|
1148
|
-
[
|
|
1143
|
+
}, null, 10, dl)), [
|
|
1144
|
+
[ne, s.value]
|
|
1149
1145
|
]);
|
|
1150
1146
|
}
|
|
1151
|
-
}),
|
|
1147
|
+
}), pl = async (o, e, l, s) => {
|
|
1152
1148
|
try {
|
|
1153
1149
|
const n = new FormData();
|
|
1154
1150
|
return n.append("unique", "true"), n.append("file", o), (await fetch(
|
|
1155
|
-
`/file/upload/uploads?id=${e || ""}&form=${
|
|
1151
|
+
`/file/upload/uploads?id=${e || ""}&form=${l || ""}&table=${s || ""}`,
|
|
1156
1152
|
{
|
|
1157
1153
|
method: "POST",
|
|
1158
1154
|
body: n
|
|
1159
1155
|
}
|
|
1160
1156
|
).then((r) => r.json()))?.result;
|
|
1161
1157
|
} catch (n) {
|
|
1162
|
-
return
|
|
1158
|
+
return we({
|
|
1163
1159
|
type: "error",
|
|
1164
1160
|
title: "Помилка!",
|
|
1165
1161
|
message: "Сталась помилка під час завантаження файлу",
|
|
1166
1162
|
position: "right-bottom"
|
|
1167
1163
|
}), console.error("Сталась помилка завантаження файлу", n), null;
|
|
1168
1164
|
}
|
|
1169
|
-
},
|
|
1165
|
+
}, fl = async (o) => {
|
|
1170
1166
|
try {
|
|
1171
1167
|
return await fetch(`file/delete${o}`), !0;
|
|
1172
1168
|
} catch (e) {
|
|
1173
1169
|
return console.error(e), !1;
|
|
1174
1170
|
}
|
|
1175
|
-
},
|
|
1171
|
+
}, ze = async (o) => {
|
|
1176
1172
|
try {
|
|
1177
|
-
const e = await fetch(`file/download/files/uploads${o}`),
|
|
1178
|
-
r.setAttribute("download", o), r.href = window.URL.createObjectURL(
|
|
1173
|
+
const e = await fetch(`file/download/files/uploads${o}`), l = await e.arrayBuffer(), s = e.headers["content-type"], n = new TextDecoder("utf-8").decode(l), a = new Blob([n], { type: s }), r = document.createElement("a");
|
|
1174
|
+
r.setAttribute("download", o), r.href = window.URL.createObjectURL(a), r.click();
|
|
1179
1175
|
} catch (e) {
|
|
1180
1176
|
console.error(e.message);
|
|
1181
1177
|
}
|
|
1182
|
-
},
|
|
1178
|
+
}, ml = {}, hl = {
|
|
1183
1179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1184
1180
|
width: "24",
|
|
1185
1181
|
height: "24",
|
|
@@ -1190,13 +1186,13 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_rende
|
|
|
1190
1186
|
"stroke-linecap": "round",
|
|
1191
1187
|
"stroke-linejoin": "round"
|
|
1192
1188
|
};
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1195
|
-
|
|
1196
|
-
|
|
1189
|
+
function vl(o, e) {
|
|
1190
|
+
return i(), u("svg", hl, e[0] || (e[0] = [
|
|
1191
|
+
t("path", { d: "M5 12h14" }, null, -1),
|
|
1192
|
+
t("path", { d: "M12 5v14" }, null, -1)
|
|
1197
1193
|
]));
|
|
1198
1194
|
}
|
|
1199
|
-
const
|
|
1195
|
+
const ke = /* @__PURE__ */ F(ml, [["render", vl]]), gl = {}, yl = {
|
|
1200
1196
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1201
1197
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
1202
1198
|
width: "44",
|
|
@@ -1208,12 +1204,12 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_rende
|
|
|
1208
1204
|
"stroke-linecap": "round",
|
|
1209
1205
|
"stroke-linejoin": "round"
|
|
1210
1206
|
};
|
|
1211
|
-
function
|
|
1212
|
-
return
|
|
1213
|
-
|
|
1207
|
+
function bl(o, e, l, s, n, a) {
|
|
1208
|
+
return i(), u("svg", yl, e[0] || (e[0] = [
|
|
1209
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
|
|
1214
1210
|
]));
|
|
1215
1211
|
}
|
|
1216
|
-
const
|
|
1212
|
+
const xl = /* @__PURE__ */ F(gl, [["render", bl]]), wl = {}, kl = {
|
|
1217
1213
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1218
1214
|
class: "icon icon-tabler icon-tabler-table",
|
|
1219
1215
|
width: "44",
|
|
@@ -1225,27 +1221,27 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render
|
|
|
1225
1221
|
"stroke-linecap": "round",
|
|
1226
1222
|
"stroke-linejoin": "round"
|
|
1227
1223
|
};
|
|
1228
|
-
function
|
|
1229
|
-
return
|
|
1230
|
-
|
|
1224
|
+
function _l(o, e, l, s, n, a) {
|
|
1225
|
+
return i(), u("svg", kl, e[0] || (e[0] = [
|
|
1226
|
+
t("path", {
|
|
1231
1227
|
stroke: "none",
|
|
1232
1228
|
d: "M0 0h24v24H0z",
|
|
1233
1229
|
fill: "none"
|
|
1234
1230
|
}, null, -1),
|
|
1235
|
-
|
|
1231
|
+
t("rect", {
|
|
1236
1232
|
x: "4",
|
|
1237
1233
|
y: "4",
|
|
1238
1234
|
width: "16",
|
|
1239
1235
|
height: "16",
|
|
1240
1236
|
rx: "2"
|
|
1241
1237
|
}, null, -1),
|
|
1242
|
-
|
|
1238
|
+
t("line", {
|
|
1243
1239
|
x1: "4",
|
|
1244
1240
|
y1: "10",
|
|
1245
1241
|
x2: "20",
|
|
1246
1242
|
y2: "10"
|
|
1247
1243
|
}, null, -1),
|
|
1248
|
-
|
|
1244
|
+
t("line", {
|
|
1249
1245
|
x1: "10",
|
|
1250
1246
|
y1: "4",
|
|
1251
1247
|
x2: "10",
|
|
@@ -1253,7 +1249,7 @@ function _sfc_render$i(o, e, t, a, n, l) {
|
|
|
1253
1249
|
}, null, -1)
|
|
1254
1250
|
]));
|
|
1255
1251
|
}
|
|
1256
|
-
const
|
|
1252
|
+
const $l = /* @__PURE__ */ F(wl, [["render", _l]]), Bl = {}, Cl = {
|
|
1257
1253
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1258
1254
|
width: "24",
|
|
1259
1255
|
height: "24",
|
|
@@ -1265,12 +1261,12 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render
|
|
|
1265
1261
|
"stroke-linejoin": "round",
|
|
1266
1262
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
1267
1263
|
};
|
|
1268
|
-
function
|
|
1269
|
-
return
|
|
1270
|
-
|
|
1264
|
+
function Vl(o, e, l, s, n, a) {
|
|
1265
|
+
return i(), u("svg", Cl, e[0] || (e[0] = [
|
|
1266
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
|
|
1271
1267
|
]));
|
|
1272
1268
|
}
|
|
1273
|
-
const
|
|
1269
|
+
const Ml = /* @__PURE__ */ F(Bl, [["render", Vl]]), Ll = {}, Sl = {
|
|
1274
1270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1275
1271
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
1276
1272
|
width: "44",
|
|
@@ -1282,12 +1278,12 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_rende
|
|
|
1282
1278
|
"stroke-linecap": "round",
|
|
1283
1279
|
"stroke-linejoin": "round"
|
|
1284
1280
|
};
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
1287
|
-
|
|
1281
|
+
function jl(o, e, l, s, n, a) {
|
|
1282
|
+
return i(), u("svg", Sl, e[0] || (e[0] = [
|
|
1283
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
|
|
1288
1284
|
]));
|
|
1289
1285
|
}
|
|
1290
|
-
const
|
|
1286
|
+
const Il = /* @__PURE__ */ F(Ll, [["render", jl]]), El = {}, Ol = {
|
|
1291
1287
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1292
1288
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
1293
1289
|
width: "44",
|
|
@@ -1299,25 +1295,25 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render
|
|
|
1299
1295
|
"stroke-linecap": "round",
|
|
1300
1296
|
"stroke-linejoin": "round"
|
|
1301
1297
|
};
|
|
1302
|
-
function
|
|
1303
|
-
return
|
|
1304
|
-
|
|
1298
|
+
function zl(o, e, l, s, n, a) {
|
|
1299
|
+
return i(), u("svg", Ol, e[0] || (e[0] = [
|
|
1300
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
|
|
1305
1301
|
]));
|
|
1306
1302
|
}
|
|
1307
|
-
const
|
|
1303
|
+
const Al = /* @__PURE__ */ F(El, [["render", zl]]), Fl = (o) => {
|
|
1308
1304
|
if (!o) return "";
|
|
1309
1305
|
const e = o?.split(".");
|
|
1310
1306
|
return e[e.length - 1];
|
|
1311
|
-
},
|
|
1312
|
-
const e =
|
|
1307
|
+
}, Dl = (o) => {
|
|
1308
|
+
const e = Fl(o), l = {
|
|
1313
1309
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
1314
1310
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
1315
1311
|
archivesFormat: ["zip", "rar"],
|
|
1316
1312
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
1317
1313
|
documentsFormat: ["pdf"]
|
|
1318
1314
|
};
|
|
1319
|
-
return
|
|
1320
|
-
},
|
|
1315
|
+
return l.imageFormat.includes(e) ? "img" : l.sheetsFormat.includes(e) ? $l : l.textsFormat.includes(e) ? Al : l.documentsFormat.includes(e) ? xl : l.archivesFormat.includes(e) ? Il : Ml;
|
|
1316
|
+
}, Tl = {}, Ul = {
|
|
1321
1317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1322
1318
|
width: "24",
|
|
1323
1319
|
height: "24",
|
|
@@ -1329,12 +1325,12 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_re
|
|
|
1329
1325
|
"stroke-linejoin": "round",
|
|
1330
1326
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
1331
1327
|
};
|
|
1332
|
-
function
|
|
1333
|
-
return
|
|
1334
|
-
|
|
1328
|
+
function Rl(o, e) {
|
|
1329
|
+
return i(), u("svg", Ul, e[0] || (e[0] = [
|
|
1330
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
|
|
1335
1331
|
]));
|
|
1336
1332
|
}
|
|
1337
|
-
const
|
|
1333
|
+
const $e = /* @__PURE__ */ F(Tl, [["render", Rl]]), Hl = {}, Pl = {
|
|
1338
1334
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1339
1335
|
width: "24",
|
|
1340
1336
|
height: "24",
|
|
@@ -1346,21 +1342,21 @@ const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_ren
|
|
|
1346
1342
|
"stroke-linejoin": "round",
|
|
1347
1343
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1348
1344
|
};
|
|
1349
|
-
function
|
|
1350
|
-
return
|
|
1351
|
-
|
|
1345
|
+
function Nl(o, e) {
|
|
1346
|
+
return i(), u("svg", Pl, e[0] || (e[0] = [
|
|
1347
|
+
t("path", {
|
|
1352
1348
|
stroke: "none",
|
|
1353
1349
|
d: "M0 0h24v24H0z",
|
|
1354
1350
|
fill: "none"
|
|
1355
1351
|
}, null, -1),
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1352
|
+
t("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
|
|
1353
|
+
t("path", { d: "M7 11l5 5l5 -5" }, null, -1),
|
|
1354
|
+
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
1359
1355
|
]));
|
|
1360
1356
|
}
|
|
1361
|
-
const
|
|
1357
|
+
const Je = /* @__PURE__ */ F(Hl, [["render", Nl]]), ql = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Gl = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Jl = /* @__PURE__ */ M({
|
|
1362
1358
|
__name: "vs-input-file-list-item",
|
|
1363
|
-
props: /* @__PURE__ */
|
|
1359
|
+
props: /* @__PURE__ */ P({
|
|
1364
1360
|
style: {},
|
|
1365
1361
|
customClass: {},
|
|
1366
1362
|
placeholder: {},
|
|
@@ -1406,40 +1402,40 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1406
1402
|
}),
|
|
1407
1403
|
emits: ["update:value", "update:item"],
|
|
1408
1404
|
setup(o) {
|
|
1409
|
-
const e =
|
|
1410
|
-
return (n,
|
|
1411
|
-
(
|
|
1412
|
-
src:
|
|
1405
|
+
const e = R(o, "value"), l = R(o, "item"), s = o;
|
|
1406
|
+
return (n, a) => (i(), u("div", ql, [
|
|
1407
|
+
(i(), K(de(U(Dl)(l.value)), {
|
|
1408
|
+
src: l.value,
|
|
1413
1409
|
alt: "file",
|
|
1414
1410
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1415
|
-
onClick:
|
|
1411
|
+
onClick: a[0] || (a[0] = (r) => U(ze)(l.value))
|
|
1416
1412
|
}, null, 8, ["src"])),
|
|
1417
|
-
|
|
1418
|
-
|
|
1413
|
+
t("div", Gl, [
|
|
1414
|
+
t("button", {
|
|
1419
1415
|
type: "button",
|
|
1420
|
-
onClick:
|
|
1421
|
-
|
|
1416
|
+
onClick: a[1] || (a[1] = (r) => {
|
|
1417
|
+
U(fl)(l.value), e.value = s.multiple ? e.value?.filter((d) => d !== l.value) : "";
|
|
1422
1418
|
}),
|
|
1423
1419
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1424
1420
|
}, [
|
|
1425
|
-
|
|
1421
|
+
V($e, { class: "w-4 h-4" })
|
|
1426
1422
|
]),
|
|
1427
|
-
|
|
1423
|
+
t("button", {
|
|
1428
1424
|
type: "button",
|
|
1429
|
-
onClick:
|
|
1425
|
+
onClick: a[2] || (a[2] = (r) => U(ze)(l.value)),
|
|
1430
1426
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1431
1427
|
}, [
|
|
1432
|
-
|
|
1428
|
+
V(Je, { class: "w-4 h-4" })
|
|
1433
1429
|
])
|
|
1434
1430
|
])
|
|
1435
1431
|
]));
|
|
1436
1432
|
}
|
|
1437
|
-
}),
|
|
1433
|
+
}), Ae = /* @__PURE__ */ F(Jl, [["__scopeId", "data-v-02a1389c"]]), Zl = { class: "flex items-center gap-x-2" }, Kl = {
|
|
1438
1434
|
key: 1,
|
|
1439
1435
|
class: "flex items-center flex-wrap gap-2"
|
|
1440
|
-
},
|
|
1436
|
+
}, Wl = /* @__PURE__ */ M({
|
|
1441
1437
|
__name: "vs-input-file",
|
|
1442
|
-
props: /* @__PURE__ */
|
|
1438
|
+
props: /* @__PURE__ */ P({
|
|
1443
1439
|
style: {},
|
|
1444
1440
|
customClass: {},
|
|
1445
1441
|
placeholder: {},
|
|
@@ -1483,65 +1479,65 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1483
1479
|
}),
|
|
1484
1480
|
emits: ["update:modelValue"],
|
|
1485
1481
|
setup(o) {
|
|
1486
|
-
const e = o,
|
|
1482
|
+
const e = o, l = R(o, "modelValue"), s = _(null), n = (r) => Array.isArray(l.value) && l.value[r] || "", a = async (r) => {
|
|
1487
1483
|
if (e.format) {
|
|
1488
|
-
const
|
|
1489
|
-
if (!
|
|
1484
|
+
const x = r.target.files?.[0];
|
|
1485
|
+
if (!x || !x.name.endsWith(e.format))
|
|
1490
1486
|
return;
|
|
1491
1487
|
}
|
|
1492
|
-
const
|
|
1493
|
-
if (!
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1488
|
+
const d = r.target.files?.[0];
|
|
1489
|
+
if (!d) return;
|
|
1490
|
+
const p = await pl(d, "1", "form", "table");
|
|
1491
|
+
l.value = e.multiple ? [...l.value || [], p?.file_path] : p?.file_path;
|
|
1496
1492
|
};
|
|
1497
|
-
return (r,
|
|
1498
|
-
|
|
1493
|
+
return (r, d) => (i(), u("div", Zl, [
|
|
1494
|
+
t("input", {
|
|
1499
1495
|
class: "hidden",
|
|
1500
1496
|
ref_key: "fileInput",
|
|
1501
|
-
ref:
|
|
1497
|
+
ref: s,
|
|
1502
1498
|
type: "file",
|
|
1503
|
-
onChange:
|
|
1499
|
+
onChange: a
|
|
1504
1500
|
}, null, 544),
|
|
1505
|
-
!r.multiple &&
|
|
1501
|
+
!r.multiple && l.value ? (i(), K(Ae, {
|
|
1506
1502
|
key: 0,
|
|
1507
|
-
item:
|
|
1508
|
-
"onUpdate:item":
|
|
1509
|
-
value:
|
|
1510
|
-
"onUpdate:value":
|
|
1511
|
-
}, null, 8, ["item", "value"])) : r.multiple ? (
|
|
1512
|
-
(
|
|
1503
|
+
item: l.value,
|
|
1504
|
+
"onUpdate:item": d[0] || (d[0] = (p) => l.value = p),
|
|
1505
|
+
value: l.value,
|
|
1506
|
+
"onUpdate:value": d[1] || (d[1] = (p) => l.value = p)
|
|
1507
|
+
}, null, 8, ["item", "value"])) : r.multiple ? (i(), u("div", Kl, [
|
|
1508
|
+
(i(!0), u(W, null, Q(l.value, (p, x) => (i(), K(Ae, {
|
|
1513
1509
|
multiple: r.multiple,
|
|
1514
|
-
key:
|
|
1515
|
-
value:
|
|
1516
|
-
"onUpdate:value":
|
|
1517
|
-
item: n(
|
|
1510
|
+
key: x,
|
|
1511
|
+
value: l.value,
|
|
1512
|
+
"onUpdate:value": d[2] || (d[2] = (c) => l.value = c),
|
|
1513
|
+
item: n(x)
|
|
1518
1514
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1519
|
-
|
|
1520
|
-
onClick:
|
|
1521
|
-
class:
|
|
1515
|
+
t("div", {
|
|
1516
|
+
onClick: d[3] || (d[3] = (p) => !r.disabled && s.value?.click()),
|
|
1517
|
+
class: C([
|
|
1522
1518
|
"h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
|
|
1523
1519
|
r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1524
1520
|
])
|
|
1525
1521
|
}, [
|
|
1526
|
-
|
|
1522
|
+
V(ke, { class: "w-6 h-6" })
|
|
1527
1523
|
], 2)
|
|
1528
|
-
])) :
|
|
1529
|
-
r.multiple ?
|
|
1524
|
+
])) : j("", !0),
|
|
1525
|
+
r.multiple ? j("", !0) : (i(), u("div", {
|
|
1530
1526
|
key: 2,
|
|
1531
|
-
onClick:
|
|
1532
|
-
class:
|
|
1527
|
+
onClick: d[4] || (d[4] = (p) => s.value?.click()),
|
|
1528
|
+
class: C([r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
|
|
1533
1529
|
}, [
|
|
1534
|
-
|
|
1530
|
+
V(ke, { class: "w-6 h-6" })
|
|
1535
1531
|
], 2))
|
|
1536
1532
|
]));
|
|
1537
1533
|
}
|
|
1538
|
-
}),
|
|
1534
|
+
}), Ql = { class: "max-w-[55vw]" }, Xl = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Yl = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, eo = { class: "px-[5px]" }, to = { class: "" }, be = /* @__PURE__ */ M({
|
|
1539
1535
|
__name: "vs-widget-file-info",
|
|
1540
1536
|
props: {
|
|
1541
1537
|
item: { default: null }
|
|
1542
1538
|
},
|
|
1543
1539
|
setup(o) {
|
|
1544
|
-
const e = o,
|
|
1540
|
+
const e = o, l = T(() => {
|
|
1545
1541
|
try {
|
|
1546
1542
|
return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
|
|
1547
1543
|
day: "2-digit",
|
|
@@ -1552,41 +1548,41 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1552
1548
|
return "";
|
|
1553
1549
|
}
|
|
1554
1550
|
});
|
|
1555
|
-
function
|
|
1551
|
+
function s(n) {
|
|
1556
1552
|
if (n < 1024)
|
|
1557
1553
|
return `${n} B`;
|
|
1558
|
-
const
|
|
1559
|
-
return
|
|
1554
|
+
const a = n / 1024;
|
|
1555
|
+
return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
|
|
1560
1556
|
}
|
|
1561
|
-
return (n,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
[
|
|
1557
|
+
return (n, a) => (i(), u(W, null, [
|
|
1558
|
+
a[1] || (a[1] = te('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
|
|
1559
|
+
t("div", Ql, [
|
|
1560
|
+
t("p", Xl, z(n.item?.uploaded_name), 1),
|
|
1561
|
+
t("p", Yl, [
|
|
1562
|
+
t("span", null, z(n.item?.username), 1),
|
|
1563
|
+
J(t("span", eo, "|", 512), [
|
|
1564
|
+
[Se, n.item?.username]
|
|
1569
1565
|
]),
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1566
|
+
t("span", null, z(l.value), 1),
|
|
1567
|
+
a[0] || (a[0] = t("span", { class: "px-[5px]" }, "|", -1)),
|
|
1568
|
+
t("span", to, z(s(n.item?.size)), 1)
|
|
1573
1569
|
])
|
|
1574
1570
|
])
|
|
1575
1571
|
], 64));
|
|
1576
1572
|
}
|
|
1577
|
-
}),
|
|
1573
|
+
}), lo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, oo = {
|
|
1578
1574
|
key: 0,
|
|
1579
1575
|
class: "flex w-full gap-x-3 items-center"
|
|
1580
|
-
},
|
|
1576
|
+
}, ao = {
|
|
1581
1577
|
key: 1,
|
|
1582
1578
|
class: "flex gap-x-3 w-full items-center"
|
|
1583
|
-
},
|
|
1579
|
+
}, no = {
|
|
1584
1580
|
key: 2,
|
|
1585
1581
|
class: "flex gap-x-3 w-full items-center"
|
|
1586
|
-
},
|
|
1582
|
+
}, so = ["href"], ro = {
|
|
1587
1583
|
key: 3,
|
|
1588
1584
|
class: "flex gap-x-3 w-full items-center"
|
|
1589
|
-
},
|
|
1585
|
+
}, io = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, uo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, co = { class: "inline-block" }, po = { class: "inline-block" }, fo = /* @__PURE__ */ M({
|
|
1590
1586
|
__name: "vs-widget-file-item",
|
|
1591
1587
|
props: {
|
|
1592
1588
|
item: { default: null },
|
|
@@ -1595,22 +1591,28 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1595
1591
|
},
|
|
1596
1592
|
emits: ["update", "openModal", "openLightbox"],
|
|
1597
1593
|
setup(o, { emit: e }) {
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
});
|
|
1602
|
-
function n(s) {
|
|
1603
|
-
return ["pdf", "json"].includes(s.ext);
|
|
1594
|
+
const l = o, s = e;
|
|
1595
|
+
function n(c) {
|
|
1596
|
+
return ["pdf", "json"].includes(c.ext);
|
|
1604
1597
|
}
|
|
1605
|
-
function
|
|
1606
|
-
return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(
|
|
1598
|
+
function a(c) {
|
|
1599
|
+
return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(c.ext);
|
|
1607
1600
|
}
|
|
1608
|
-
function r(
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1601
|
+
function r(c) {
|
|
1602
|
+
const m = document.createElement("a");
|
|
1603
|
+
m.setAttribute("download", c?.uploaded_name), m.href = c?.file_path, m.click();
|
|
1611
1604
|
}
|
|
1612
|
-
function
|
|
1613
|
-
|
|
1605
|
+
async function d() {
|
|
1606
|
+
try {
|
|
1607
|
+
await fetch(
|
|
1608
|
+
`${l.prefix}/widget/file/${l.item.entity_id}/${l.item.file_id}`
|
|
1609
|
+
), s("update");
|
|
1610
|
+
} catch (c) {
|
|
1611
|
+
console.error(c);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
function p() {
|
|
1615
|
+
s("openModal", {
|
|
1614
1616
|
title: "Ви впевнені?",
|
|
1615
1617
|
message: "Ви впевнені, що хочете видалити цей файл?",
|
|
1616
1618
|
confirmButtonText: "Так, я впевнена/ий",
|
|
@@ -1619,70 +1621,51 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1619
1621
|
updateListOnConfirm: !0
|
|
1620
1622
|
});
|
|
1621
1623
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
await fetch(
|
|
1625
|
-
`${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
|
|
1626
|
-
), a("update");
|
|
1627
|
-
} catch (s) {
|
|
1628
|
-
console.error(s);
|
|
1629
|
-
}
|
|
1624
|
+
function x(c) {
|
|
1625
|
+
(l.item.ext === "jpg" || l.item.ext === "png") && s("openLightbox", { item: l.item, index: c });
|
|
1630
1626
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
return computed(() => {
|
|
1635
|
-
try {
|
|
1636
|
-
return new Date(t.item.cdate).toLocaleDateString("uk-UA", {
|
|
1637
|
-
day: "2-digit",
|
|
1638
|
-
month: "long",
|
|
1639
|
-
year: "numeric"
|
|
1640
|
-
});
|
|
1641
|
-
} catch {
|
|
1642
|
-
return "";
|
|
1643
|
-
}
|
|
1644
|
-
}), (s, u) => (openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
1645
|
-
s.item.ext === "jpg" || s.item.ext === "png" ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
1646
|
-
createElementVNode("div", {
|
|
1627
|
+
return (c, m) => (i(), u("div", lo, [
|
|
1628
|
+
c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", oo, [
|
|
1629
|
+
t("div", {
|
|
1647
1630
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1648
|
-
onClick:
|
|
1631
|
+
onClick: m[0] || (m[0] = (f) => x(c.index))
|
|
1649
1632
|
}, [
|
|
1650
|
-
|
|
1633
|
+
V(be, { item: c.item }, null, 8, ["item"])
|
|
1651
1634
|
])
|
|
1652
|
-
])) : n(
|
|
1653
|
-
|
|
1654
|
-
])) :
|
|
1655
|
-
|
|
1656
|
-
href: `/api/file-preview?id=${
|
|
1635
|
+
])) : n(c.item) ? (i(), u("div", ao, [
|
|
1636
|
+
V(be, { item: c.item }, null, 8, ["item"])
|
|
1637
|
+
])) : a(c.item) ? (i(), u("div", no, [
|
|
1638
|
+
t("a", {
|
|
1639
|
+
href: `/api/file-preview?id=${c.item.file_id}`,
|
|
1657
1640
|
target: "_blank",
|
|
1658
1641
|
class: "flex gap-x-3 w-full items-center"
|
|
1659
1642
|
}, [
|
|
1660
|
-
|
|
1661
|
-
], 8,
|
|
1662
|
-
])) : (
|
|
1663
|
-
|
|
1643
|
+
V(be, { item: c.item }, null, 8, ["item"])
|
|
1644
|
+
], 8, so)
|
|
1645
|
+
])) : (i(), u("div", ro, [
|
|
1646
|
+
V(be, { item: c.item }, null, 8, ["item"])
|
|
1664
1647
|
])),
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1648
|
+
t("div", io, [
|
|
1649
|
+
t("div", uo, [
|
|
1650
|
+
t("div", co, [
|
|
1651
|
+
t("button", {
|
|
1669
1652
|
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",
|
|
1670
|
-
onClick:
|
|
1653
|
+
onClick: m[1] || (m[1] = (f) => r(c.item))
|
|
1671
1654
|
}, [
|
|
1672
|
-
|
|
1655
|
+
V(Je, {
|
|
1673
1656
|
height: "14",
|
|
1674
1657
|
width: "14"
|
|
1675
1658
|
})
|
|
1676
1659
|
])
|
|
1677
1660
|
]),
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1661
|
+
m[3] || (m[3] = t("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
|
|
1662
|
+
t("div", po, [
|
|
1663
|
+
t("button", {
|
|
1681
1664
|
type: "button",
|
|
1682
1665
|
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",
|
|
1683
|
-
onClick:
|
|
1666
|
+
onClick: m[2] || (m[2] = (f) => p())
|
|
1684
1667
|
}, [
|
|
1685
|
-
|
|
1668
|
+
V($e, {
|
|
1686
1669
|
height: "14",
|
|
1687
1670
|
width: "14"
|
|
1688
1671
|
})
|
|
@@ -1692,7 +1675,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1692
1675
|
])
|
|
1693
1676
|
]));
|
|
1694
1677
|
}
|
|
1695
|
-
}),
|
|
1678
|
+
}), mo = {}, ho = {
|
|
1696
1679
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1697
1680
|
width: "24",
|
|
1698
1681
|
height: "24",
|
|
@@ -1704,25 +1687,25 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_r
|
|
|
1704
1687
|
"stroke-linejoin": "round",
|
|
1705
1688
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1706
1689
|
};
|
|
1707
|
-
function
|
|
1708
|
-
return
|
|
1709
|
-
|
|
1690
|
+
function vo(o, e) {
|
|
1691
|
+
return i(), u("svg", ho, e[0] || (e[0] = [
|
|
1692
|
+
t("path", {
|
|
1710
1693
|
stroke: "none",
|
|
1711
1694
|
d: "M0 0h24v24H0z",
|
|
1712
1695
|
fill: "none"
|
|
1713
1696
|
}, null, -1),
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1697
|
+
t("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
|
|
1698
|
+
t("path", { d: "M7 11l5 5l5 -5" }, null, -1),
|
|
1699
|
+
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
1717
1700
|
]));
|
|
1718
1701
|
}
|
|
1719
|
-
const
|
|
1702
|
+
const go = /* @__PURE__ */ F(mo, [["render", vo]]), yo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, bo = { class: "flex w-full mb-[12px] items-center gap-x-2" }, xo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, wo = { class1: "ml-auto" }, ko = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, _o = {
|
|
1720
1703
|
key: 0,
|
|
1721
1704
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1722
|
-
},
|
|
1705
|
+
}, $o = { class: "relative" }, Bo = {
|
|
1723
1706
|
key: 1,
|
|
1724
1707
|
class: "space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"
|
|
1725
|
-
},
|
|
1708
|
+
}, Co = { key: 0 }, Vo = /* @__PURE__ */ M({
|
|
1726
1709
|
__name: "vs-input-file-list",
|
|
1727
1710
|
props: {
|
|
1728
1711
|
style: {},
|
|
@@ -1765,59 +1748,59 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1765
1748
|
},
|
|
1766
1749
|
emits: ["update"],
|
|
1767
1750
|
setup(o, { emit: e }) {
|
|
1768
|
-
const
|
|
1769
|
-
console.log("images",
|
|
1770
|
-
const
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1773
|
-
},
|
|
1751
|
+
const l = o, s = xe("form"), n = T(() => s.value.formId), a = _(!1), r = _(0), d = e, p = _(!1), x = _({}), c = _([]), m = _(""), f = T(() => Array.isArray(c.value) ? c.value.filter((b) => b.ext === "jpg" || b.ext === "png").map((b) => b?.file_path) : []);
|
|
1752
|
+
console.log("images", f.value);
|
|
1753
|
+
const I = T(() => m.value === "" ? c.value : c.value.filter((b) => b?.uploaded_name?.includes(m.value))), O = (b) => {
|
|
1754
|
+
const v = f.value.findIndex((q) => q === b.item.file_path);
|
|
1755
|
+
v !== -1 && (a.value = !0, r.value = v);
|
|
1756
|
+
}, D = async () => {
|
|
1774
1757
|
try {
|
|
1775
|
-
const
|
|
1776
|
-
|
|
1777
|
-
} catch (
|
|
1778
|
-
console.error(
|
|
1758
|
+
const b = await fetch(`${l.prefix}/widget/file/${n.value}`).then((v) => v.json());
|
|
1759
|
+
c.value = b?.rows;
|
|
1760
|
+
} catch (b) {
|
|
1761
|
+
console.error(b);
|
|
1779
1762
|
}
|
|
1780
|
-
},
|
|
1763
|
+
}, N = async (b) => {
|
|
1781
1764
|
await Promise.all(
|
|
1782
|
-
Array.from(
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1765
|
+
Array.from(b.target.files).map(async (v) => {
|
|
1766
|
+
const q = new FormData();
|
|
1767
|
+
q.append("file", v);
|
|
1785
1768
|
try {
|
|
1786
|
-
const
|
|
1787
|
-
return await fetch(
|
|
1788
|
-
} catch (
|
|
1789
|
-
return console.error(
|
|
1769
|
+
const $ = `${l.prefix}/widget/file/${n.value}`;
|
|
1770
|
+
return await fetch($, { method: "POST", body: q }), d("update", "file-list"), v;
|
|
1771
|
+
} catch ($) {
|
|
1772
|
+
return console.error($), null;
|
|
1790
1773
|
}
|
|
1791
1774
|
})
|
|
1792
|
-
), await
|
|
1793
|
-
},
|
|
1794
|
-
const
|
|
1795
|
-
return
|
|
1796
|
-
|
|
1797
|
-
}),
|
|
1798
|
-
await
|
|
1799
|
-
}),
|
|
1800
|
-
},
|
|
1801
|
-
|
|
1775
|
+
), await D();
|
|
1776
|
+
}, H = (b) => {
|
|
1777
|
+
const v = { ...b };
|
|
1778
|
+
return b.cancel || (v.cancel = () => {
|
|
1779
|
+
p.value = !1;
|
|
1780
|
+
}), b.updateListOnConfirm && (v.confirm = async () => {
|
|
1781
|
+
await b.confirm(), p.value = !1, D();
|
|
1782
|
+
}), v;
|
|
1783
|
+
}, S = (b) => {
|
|
1784
|
+
x.value = H(b), p.value = !0;
|
|
1802
1785
|
};
|
|
1803
|
-
return
|
|
1804
|
-
|
|
1805
|
-
}),
|
|
1806
|
-
n.value &&
|
|
1807
|
-
}), (
|
|
1808
|
-
const
|
|
1809
|
-
return
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1786
|
+
return ae(n, (b) => {
|
|
1787
|
+
b && D();
|
|
1788
|
+
}), oe(() => {
|
|
1789
|
+
n.value && D();
|
|
1790
|
+
}), (b, v) => {
|
|
1791
|
+
const q = je("Lightbox"), $ = je("MessageBox");
|
|
1792
|
+
return i(), u("div", yo, [
|
|
1793
|
+
t("div", bo, [
|
|
1794
|
+
t("h2", xo, " Файлів: " + z(c.value?.length), 1),
|
|
1795
|
+
t("div", wo, [
|
|
1796
|
+
t("label", null, [
|
|
1797
|
+
t("input", {
|
|
1815
1798
|
type: "file",
|
|
1816
1799
|
class: "hidden",
|
|
1817
|
-
onChange:
|
|
1800
|
+
onChange: v[0] || (v[0] = (k) => N(k))
|
|
1818
1801
|
}, null, 32),
|
|
1819
|
-
|
|
1820
|
-
|
|
1802
|
+
t("div", ko, [
|
|
1803
|
+
V(go, {
|
|
1821
1804
|
height: "16",
|
|
1822
1805
|
width: "16"
|
|
1823
1806
|
})
|
|
@@ -1825,11 +1808,11 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1825
1808
|
])
|
|
1826
1809
|
])
|
|
1827
1810
|
]),
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1811
|
+
c.value?.length > 4 ? (i(), u("div", _o, [
|
|
1812
|
+
t("div", null, [
|
|
1813
|
+
t("div", $o, [
|
|
1814
|
+
v[8] || (v[8] = t("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
|
|
1815
|
+
t("svg", {
|
|
1833
1816
|
class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
|
|
1834
1817
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1835
1818
|
width: "24",
|
|
@@ -1841,60 +1824,60 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1841
1824
|
"stroke-linecap": "round",
|
|
1842
1825
|
"stroke-linejoin": "round"
|
|
1843
1826
|
}, [
|
|
1844
|
-
|
|
1827
|
+
t("circle", {
|
|
1845
1828
|
cx: "11",
|
|
1846
1829
|
cy: "11",
|
|
1847
1830
|
r: "8"
|
|
1848
1831
|
}),
|
|
1849
|
-
|
|
1832
|
+
t("path", { d: "m21 21-4.3-4.3" })
|
|
1850
1833
|
])
|
|
1851
1834
|
], -1)),
|
|
1852
|
-
|
|
1835
|
+
J(t("input", {
|
|
1853
1836
|
type: "text",
|
|
1854
|
-
"onUpdate:modelValue":
|
|
1837
|
+
"onUpdate:modelValue": v[1] || (v[1] = (k) => m.value = k),
|
|
1855
1838
|
class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
|
|
1856
1839
|
placeholder: "Введіть назву файлу"
|
|
1857
1840
|
}, null, 512), [
|
|
1858
1841
|
[
|
|
1859
|
-
|
|
1860
|
-
|
|
1842
|
+
ne,
|
|
1843
|
+
m.value,
|
|
1861
1844
|
void 0,
|
|
1862
1845
|
{ trim: !0 }
|
|
1863
1846
|
]
|
|
1864
1847
|
])
|
|
1865
1848
|
])
|
|
1866
1849
|
])
|
|
1867
|
-
])) :
|
|
1868
|
-
|
|
1869
|
-
(
|
|
1870
|
-
key:
|
|
1871
|
-
prefix:
|
|
1850
|
+
])) : j("", !0),
|
|
1851
|
+
c.value?.length ? (i(), u("div", Bo, [
|
|
1852
|
+
(i(!0), u(W, null, Q(I.value, (k, B) => (i(), K(fo, {
|
|
1853
|
+
key: B,
|
|
1854
|
+
prefix: b.prefix,
|
|
1872
1855
|
item: k,
|
|
1873
|
-
index:
|
|
1874
|
-
onUpdate:
|
|
1875
|
-
onOpenModal:
|
|
1876
|
-
onOpenLightbox:
|
|
1856
|
+
index: B,
|
|
1857
|
+
onUpdate: v[2] || (v[2] = (A) => b.$emit("update", "file-list")),
|
|
1858
|
+
onOpenModal: v[3] || (v[3] = (A) => S(A)),
|
|
1859
|
+
onOpenLightbox: v[4] || (v[4] = (A) => O(A))
|
|
1877
1860
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1878
|
-
|
|
1879
|
-
|
|
1861
|
+
I.value.length ? j("", !0) : (i(), u("div", Co, v[9] || (v[9] = [
|
|
1862
|
+
t("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1880
1863
|
])))
|
|
1881
|
-
])) :
|
|
1882
|
-
|
|
1883
|
-
modelValue:
|
|
1884
|
-
"onUpdate:modelValue":
|
|
1864
|
+
])) : j("", !0),
|
|
1865
|
+
V(q, {
|
|
1866
|
+
modelValue: a.value,
|
|
1867
|
+
"onUpdate:modelValue": v[5] || (v[5] = (k) => a.value = k),
|
|
1885
1868
|
startIndex: r.value,
|
|
1886
|
-
"onUpdate:index":
|
|
1887
|
-
images:
|
|
1869
|
+
"onUpdate:index": v[6] || (v[6] = (k) => r.value = k),
|
|
1870
|
+
images: f.value
|
|
1888
1871
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1889
|
-
|
|
1890
|
-
modelValue:
|
|
1891
|
-
"onUpdate:modelValue":
|
|
1892
|
-
onConfirm:
|
|
1893
|
-
},
|
|
1872
|
+
V($, me({
|
|
1873
|
+
modelValue: p.value,
|
|
1874
|
+
"onUpdate:modelValue": v[7] || (v[7] = (k) => p.value = k),
|
|
1875
|
+
onConfirm: x.value.confirm
|
|
1876
|
+
}, x.value), null, 16, ["modelValue", "onConfirm"])
|
|
1894
1877
|
]);
|
|
1895
1878
|
};
|
|
1896
1879
|
}
|
|
1897
|
-
}),
|
|
1880
|
+
}), Mo = { class: "flex items-center justify-between" }, Lo = { class: "text-[16px] text-gray-900 font-medium" }, So = { class: "grid gap-3" }, jo = /* @__PURE__ */ M({
|
|
1898
1881
|
__name: "vs-container-switcher",
|
|
1899
1882
|
props: {
|
|
1900
1883
|
title: {
|
|
@@ -1911,34 +1894,34 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1911
1894
|
}
|
|
1912
1895
|
},
|
|
1913
1896
|
setup(o) {
|
|
1914
|
-
const e = o,
|
|
1915
|
-
return
|
|
1897
|
+
const e = o, l = _(e.isOpen);
|
|
1898
|
+
return ae(
|
|
1916
1899
|
() => e.isOpen,
|
|
1917
|
-
(
|
|
1918
|
-
|
|
1900
|
+
(s) => {
|
|
1901
|
+
l.value = s;
|
|
1919
1902
|
}
|
|
1920
|
-
), (
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
modelValue:
|
|
1925
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
1926
|
-
style:
|
|
1903
|
+
), (s, n) => (i(), u("div", null, [
|
|
1904
|
+
t("div", Mo, [
|
|
1905
|
+
t("p", Lo, z(o.title), 1),
|
|
1906
|
+
V(Ge, {
|
|
1907
|
+
modelValue: l.value,
|
|
1908
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => l.value = a),
|
|
1909
|
+
style: ve(o.style)
|
|
1927
1910
|
}, null, 8, ["modelValue", "style"])
|
|
1928
1911
|
]),
|
|
1929
|
-
|
|
1930
|
-
default:
|
|
1931
|
-
|
|
1932
|
-
|
|
1912
|
+
V(Pe, { name: "slide-fade" }, {
|
|
1913
|
+
default: ge(() => [
|
|
1914
|
+
J(t("div", So, [
|
|
1915
|
+
se(s.$slots, "default", {}, void 0, !0)
|
|
1933
1916
|
], 512), [
|
|
1934
|
-
[
|
|
1917
|
+
[Se, l.value]
|
|
1935
1918
|
])
|
|
1936
1919
|
]),
|
|
1937
1920
|
_: 3
|
|
1938
1921
|
})
|
|
1939
1922
|
]));
|
|
1940
1923
|
}
|
|
1941
|
-
}),
|
|
1924
|
+
}), Io = /* @__PURE__ */ F(jo, [["__scopeId", "data-v-479564a3"]]), Eo = { class: "text-[16px] text-gray-900 font-medium" }, Oo = { class: "grid gap-3" }, zo = /* @__PURE__ */ M({
|
|
1942
1925
|
__name: "vs-container-accordion",
|
|
1943
1926
|
props: {
|
|
1944
1927
|
title: {
|
|
@@ -1955,36 +1938,36 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1955
1938
|
}
|
|
1956
1939
|
},
|
|
1957
1940
|
setup(o) {
|
|
1958
|
-
const e = o,
|
|
1959
|
-
return
|
|
1941
|
+
const e = o, l = _(e.isOpen);
|
|
1942
|
+
return ae(
|
|
1960
1943
|
() => e.isOpen,
|
|
1961
|
-
(
|
|
1962
|
-
|
|
1944
|
+
(s) => {
|
|
1945
|
+
l.value = s;
|
|
1963
1946
|
}
|
|
1964
|
-
), (
|
|
1965
|
-
|
|
1947
|
+
), (s, n) => (i(), u("div", null, [
|
|
1948
|
+
t("button", {
|
|
1966
1949
|
type: "button",
|
|
1967
|
-
onClick: n[0] || (n[0] = (
|
|
1950
|
+
onClick: n[0] || (n[0] = (a) => l.value = !l.value),
|
|
1968
1951
|
class: "flex items-center gap-2"
|
|
1969
1952
|
}, [
|
|
1970
|
-
|
|
1971
|
-
class:
|
|
1953
|
+
V(U(Ft), {
|
|
1954
|
+
class: C(["h-4 w-4 duration-300", [l.value ? "-rotate-180" : ""]])
|
|
1972
1955
|
}, null, 8, ["class"]),
|
|
1973
|
-
|
|
1956
|
+
t("span", Eo, z(o.title), 1)
|
|
1974
1957
|
]),
|
|
1975
|
-
|
|
1976
|
-
default:
|
|
1977
|
-
|
|
1978
|
-
|
|
1958
|
+
V(Pe, { name: "slide-fade" }, {
|
|
1959
|
+
default: ge(() => [
|
|
1960
|
+
J(t("div", Oo, [
|
|
1961
|
+
se(s.$slots, "default", {}, void 0, !0)
|
|
1979
1962
|
], 512), [
|
|
1980
|
-
[
|
|
1963
|
+
[Se, l.value]
|
|
1981
1964
|
])
|
|
1982
1965
|
]),
|
|
1983
1966
|
_: 3
|
|
1984
1967
|
})
|
|
1985
1968
|
]));
|
|
1986
1969
|
}
|
|
1987
|
-
}),
|
|
1970
|
+
}), Ao = /* @__PURE__ */ F(zo, [["__scopeId", "data-v-a37284e6"]]), Fo = { class: "flex items-center justify-between" }, Do = /* @__PURE__ */ M({
|
|
1988
1971
|
__name: "vs-container-default",
|
|
1989
1972
|
props: {
|
|
1990
1973
|
title: {
|
|
@@ -1997,18 +1980,18 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
1997
1980
|
}
|
|
1998
1981
|
},
|
|
1999
1982
|
setup(o) {
|
|
2000
|
-
return (e,
|
|
2001
|
-
|
|
2002
|
-
|
|
1983
|
+
return (e, l) => (i(), u("div", null, [
|
|
1984
|
+
t("div", Fo, [
|
|
1985
|
+
t("p", null, z(o.title), 1)
|
|
2003
1986
|
]),
|
|
2004
|
-
|
|
1987
|
+
se(e.$slots, "default")
|
|
2005
1988
|
]));
|
|
2006
1989
|
}
|
|
2007
|
-
}),
|
|
2008
|
-
switcher:
|
|
2009
|
-
accordion:
|
|
2010
|
-
default:
|
|
2011
|
-
},
|
|
1990
|
+
}), To = {
|
|
1991
|
+
switcher: Io,
|
|
1992
|
+
accordion: Ao,
|
|
1993
|
+
default: Do
|
|
1994
|
+
}, ee = {
|
|
2012
1995
|
Equal: "==",
|
|
2013
1996
|
Inequal: "!=",
|
|
2014
1997
|
Higer: ">",
|
|
@@ -2021,37 +2004,37 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
2021
2004
|
Contain: "*",
|
|
2022
2005
|
In: "in",
|
|
2023
2006
|
NotIn: "not_in"
|
|
2024
|
-
},
|
|
2007
|
+
}, Uo = (o, e) => String(o) === String(e), Ro = (o, e) => String(o) !== String(e), Ho = (o, e) => o > e, Po = (o, e) => o >= e, No = (o, e) => o < e, qo = (o, e) => o <= e, Go = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Jo = (o, e) => String(o).startsWith(String(e)), Zo = (o, e) => String(o).endsWith(String(e)), Ko = (o, e) => String(o).includes(String(e)), Wo = (o, e) => Array.isArray(e) ? e.includes(o) : !1, Qo = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, Ze = (o, e) => {
|
|
2025
2008
|
if (!e) return !0;
|
|
2026
2009
|
switch (e?.[1]) {
|
|
2027
|
-
case
|
|
2028
|
-
return
|
|
2029
|
-
case
|
|
2030
|
-
return
|
|
2031
|
-
case
|
|
2032
|
-
return
|
|
2033
|
-
case
|
|
2034
|
-
return
|
|
2035
|
-
case
|
|
2036
|
-
return
|
|
2037
|
-
case
|
|
2038
|
-
return
|
|
2039
|
-
case
|
|
2040
|
-
return
|
|
2041
|
-
case
|
|
2042
|
-
return
|
|
2043
|
-
case
|
|
2044
|
-
return
|
|
2045
|
-
case
|
|
2046
|
-
return
|
|
2047
|
-
case
|
|
2048
|
-
return
|
|
2049
|
-
case
|
|
2050
|
-
return
|
|
2010
|
+
case ee.Equal:
|
|
2011
|
+
return Uo(o, e?.[2]);
|
|
2012
|
+
case ee.Inequal:
|
|
2013
|
+
return Ro(o, e?.[2]);
|
|
2014
|
+
case ee.Higer:
|
|
2015
|
+
return Ho(o, e?.[2]);
|
|
2016
|
+
case ee.HigerOrEqual:
|
|
2017
|
+
return Po(o, e?.[2]);
|
|
2018
|
+
case ee.Lower:
|
|
2019
|
+
return No(o, e?.[2]);
|
|
2020
|
+
case ee.LowerOrEqual:
|
|
2021
|
+
return qo(o, e?.[2]);
|
|
2022
|
+
case ee.Between:
|
|
2023
|
+
return Go(o, e?.[2]);
|
|
2024
|
+
case ee.StartWith:
|
|
2025
|
+
return Jo(o, e?.[2]);
|
|
2026
|
+
case ee.EndWith:
|
|
2027
|
+
return Zo(o, e?.[2]);
|
|
2028
|
+
case ee.Contain:
|
|
2029
|
+
return Ko(o, e?.[2]);
|
|
2030
|
+
case ee.In:
|
|
2031
|
+
return Wo(o, e?.[2]);
|
|
2032
|
+
case ee.NotIn:
|
|
2033
|
+
return Qo(o, e?.[2]);
|
|
2051
2034
|
default:
|
|
2052
2035
|
return !0;
|
|
2053
2036
|
}
|
|
2054
|
-
},
|
|
2037
|
+
}, Xo = /* @__PURE__ */ M({
|
|
2055
2038
|
__name: "vs-input-container",
|
|
2056
2039
|
props: {
|
|
2057
2040
|
style: {
|
|
@@ -2072,49 +2055,49 @@ const IconUpload = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_ren
|
|
|
2072
2055
|
}
|
|
2073
2056
|
},
|
|
2074
2057
|
setup(o) {
|
|
2075
|
-
const e = o,
|
|
2076
|
-
const
|
|
2077
|
-
if (!
|
|
2078
|
-
const
|
|
2079
|
-
return
|
|
2080
|
-
})),
|
|
2081
|
-
return (r,
|
|
2058
|
+
const e = o, l = xe("formValues", { default: {} }), s = xe("form"), n = T(() => e.schema?.filter((r) => {
|
|
2059
|
+
const d = r?.conditions;
|
|
2060
|
+
if (!d) return !0;
|
|
2061
|
+
const p = Array.isArray(d) ? d[0] : d, x = l?.value?.[p];
|
|
2062
|
+
return Ze(x, d);
|
|
2063
|
+
})), a = T(() => To[e.view]);
|
|
2064
|
+
return (r, d) => o.schema?.length ? (i(), K(de(a.value), {
|
|
2082
2065
|
key: 0,
|
|
2083
2066
|
title: o.title,
|
|
2084
|
-
style:
|
|
2067
|
+
style: ve(o.style)
|
|
2085
2068
|
}, {
|
|
2086
|
-
default:
|
|
2087
|
-
(
|
|
2088
|
-
key:
|
|
2089
|
-
}, { ref_for: !0 },
|
|
2090
|
-
item:
|
|
2091
|
-
modelValue:
|
|
2092
|
-
"onUpdate:modelValue": (
|
|
2069
|
+
default: ge(() => [
|
|
2070
|
+
(i(!0), u(W, null, Q(n.value, (p) => (i(), K(Ke, me({
|
|
2071
|
+
key: p.name
|
|
2072
|
+
}, { ref_for: !0 }, p, {
|
|
2073
|
+
item: p,
|
|
2074
|
+
modelValue: U(l)[p.name],
|
|
2075
|
+
"onUpdate:modelValue": (x) => U(l)[p.name] = x,
|
|
2093
2076
|
style: o.style,
|
|
2094
|
-
error:
|
|
2077
|
+
error: U(s)?.errors?.[p.name]
|
|
2095
2078
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
2096
2079
|
]),
|
|
2097
2080
|
_: 1
|
|
2098
|
-
}, 8, ["title", "style"])) :
|
|
2081
|
+
}, 8, ["title", "style"])) : j("", !0);
|
|
2099
2082
|
}
|
|
2100
2083
|
});
|
|
2101
|
-
function
|
|
2102
|
-
return { all: o = o || /* @__PURE__ */ new Map(), on: function(e,
|
|
2103
|
-
var
|
|
2104
|
-
|
|
2105
|
-
}, off: function(e,
|
|
2106
|
-
var
|
|
2107
|
-
|
|
2108
|
-
}, emit: function(e,
|
|
2109
|
-
var
|
|
2110
|
-
|
|
2111
|
-
n(
|
|
2112
|
-
}), (
|
|
2113
|
-
n(e,
|
|
2084
|
+
function Yo(o) {
|
|
2085
|
+
return { all: o = o || /* @__PURE__ */ new Map(), on: function(e, l) {
|
|
2086
|
+
var s = o.get(e);
|
|
2087
|
+
s ? s.push(l) : o.set(e, [l]);
|
|
2088
|
+
}, off: function(e, l) {
|
|
2089
|
+
var s = o.get(e);
|
|
2090
|
+
s && (l ? s.splice(s.indexOf(l) >>> 0, 1) : o.set(e, []));
|
|
2091
|
+
}, emit: function(e, l) {
|
|
2092
|
+
var s = o.get(e);
|
|
2093
|
+
s && s.slice().map(function(n) {
|
|
2094
|
+
n(l);
|
|
2095
|
+
}), (s = o.get("*")) && s.slice().map(function(n) {
|
|
2096
|
+
n(e, l);
|
|
2114
2097
|
});
|
|
2115
2098
|
} };
|
|
2116
2099
|
}
|
|
2117
|
-
const
|
|
2100
|
+
const ea = Yo(), ta = { class: "relative" }, la = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, oa = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, aa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, na = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, sa = { class: "p-4 mim-h-0 h-full overflow-auto" }, ra = /* @__PURE__ */ M({
|
|
2118
2101
|
__name: "modal-edit",
|
|
2119
2102
|
props: {
|
|
2120
2103
|
schema: {},
|
|
@@ -2125,46 +2108,46 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2125
2108
|
},
|
|
2126
2109
|
emits: ["close", "save", "edit"],
|
|
2127
2110
|
setup(o, { emit: e }) {
|
|
2128
|
-
const
|
|
2129
|
-
async function
|
|
2130
|
-
const
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2111
|
+
const l = o, s = e, n = _(l.schema), a = _(l.defaultValue ? JSON.parse(JSON.stringify(l.defaultValue)) : {}), r = _({}), d = _(), p = _(l.mode);
|
|
2112
|
+
async function x() {
|
|
2113
|
+
const m = r.value.validate();
|
|
2114
|
+
if (m) {
|
|
2115
|
+
we({ type: "warning", title: "Validation", message: Object.entries(m).map(([f, I]) => `${f}: ${I}`).join(`
|
|
2133
2116
|
`) });
|
|
2134
2117
|
return;
|
|
2135
2118
|
}
|
|
2136
|
-
|
|
2137
|
-
method:
|
|
2119
|
+
d.value && (await fetch("/api/table/" + d.value, {
|
|
2120
|
+
method: p.value === "add" ? "POST" : "PUT",
|
|
2138
2121
|
headers: {
|
|
2139
2122
|
"Content-Type": "application/json"
|
|
2140
2123
|
},
|
|
2141
|
-
body: JSON.stringify(
|
|
2142
|
-
}).then((
|
|
2124
|
+
body: JSON.stringify(a.value)
|
|
2125
|
+
}).then((f) => f.json()), we({ type: "success", title: "Успішно", message: `Дані успішно ${p.value === "add" ? "збережено" : "оновленно"}` }), ea.emit("saveDormData", a.value)), s("save", a.value);
|
|
2143
2126
|
}
|
|
2144
|
-
function
|
|
2145
|
-
|
|
2127
|
+
function c() {
|
|
2128
|
+
s("close");
|
|
2146
2129
|
}
|
|
2147
|
-
return
|
|
2148
|
-
if (
|
|
2149
|
-
const
|
|
2150
|
-
n.value =
|
|
2151
|
-
} else if (
|
|
2152
|
-
|
|
2153
|
-
const
|
|
2154
|
-
n.value =
|
|
2130
|
+
return oe(async () => {
|
|
2131
|
+
if (l.form) {
|
|
2132
|
+
const m = await fetch(`/api/template/form/${l.form}`).then((f) => f.json());
|
|
2133
|
+
n.value = m.schema, d.value = m.token;
|
|
2134
|
+
} else if (l.token) {
|
|
2135
|
+
d.value = l.token;
|
|
2136
|
+
const m = await fetch(`/api/form/${d.value}`).then((f) => f.json());
|
|
2137
|
+
n.value = m.schema, m.data ? a.value = m.data : p.value = "add";
|
|
2155
2138
|
}
|
|
2156
|
-
}), (
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
onClick:
|
|
2139
|
+
}), (m, f) => (i(), u("div", ta, [
|
|
2140
|
+
t("div", la, [
|
|
2141
|
+
t("div", oa, [
|
|
2142
|
+
t("div", aa, [
|
|
2143
|
+
t("h3", na, z(p.value === "add" ? "Додати" : "Змінити"), 1),
|
|
2144
|
+
t("button", {
|
|
2145
|
+
onClick: c,
|
|
2163
2146
|
type: "button",
|
|
2164
2147
|
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
|
|
2165
|
-
},
|
|
2166
|
-
|
|
2167
|
-
|
|
2148
|
+
}, f[2] || (f[2] = [
|
|
2149
|
+
t("span", { class: "sr-only" }, "Close", -1),
|
|
2150
|
+
t("svg", {
|
|
2168
2151
|
class: "flex-shrink-0 w-4 h-4",
|
|
2169
2152
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2170
2153
|
width: "24",
|
|
@@ -2176,29 +2159,29 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2176
2159
|
"stroke-linecap": "round",
|
|
2177
2160
|
"stroke-linejoin": "round"
|
|
2178
2161
|
}, [
|
|
2179
|
-
|
|
2180
|
-
|
|
2162
|
+
t("path", { d: "M18 6 6 18" }),
|
|
2163
|
+
t("path", { d: "m6 6 12 12" })
|
|
2181
2164
|
], -1)
|
|
2182
2165
|
]))
|
|
2183
2166
|
]),
|
|
2184
|
-
|
|
2185
|
-
n.value ? (
|
|
2167
|
+
t("div", sa, [
|
|
2168
|
+
n.value ? (i(), K(Ve, {
|
|
2186
2169
|
key: 0,
|
|
2187
2170
|
schema: n.value,
|
|
2188
|
-
values:
|
|
2189
|
-
"onUpdate:values":
|
|
2171
|
+
values: a.value,
|
|
2172
|
+
"onUpdate:values": f[0] || (f[0] = (I) => a.value = I),
|
|
2190
2173
|
form: r.value,
|
|
2191
|
-
"onUpdate:form":
|
|
2192
|
-
}, null, 8, ["schema", "values", "form"])) :
|
|
2174
|
+
"onUpdate:form": f[1] || (f[1] = (I) => r.value = I)
|
|
2175
|
+
}, null, 8, ["schema", "values", "form"])) : j("", !0)
|
|
2193
2176
|
]),
|
|
2194
|
-
|
|
2195
|
-
|
|
2177
|
+
t("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
|
|
2178
|
+
t("button", {
|
|
2196
2179
|
type: "button",
|
|
2197
|
-
onClick:
|
|
2180
|
+
onClick: c,
|
|
2198
2181
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
|
|
2199
2182
|
}, " Скасувати "),
|
|
2200
|
-
|
|
2201
|
-
onClick:
|
|
2183
|
+
t("button", {
|
|
2184
|
+
onClick: x,
|
|
2202
2185
|
type: "button",
|
|
2203
2186
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
2204
2187
|
}, " Зберегти ")
|
|
@@ -2207,43 +2190,43 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2207
2190
|
])
|
|
2208
2191
|
]));
|
|
2209
2192
|
}
|
|
2210
|
-
}),
|
|
2211
|
-
const
|
|
2212
|
-
if (!
|
|
2193
|
+
}), he = (o = { mode: "edit", schema: null }) => new Promise((e, l) => {
|
|
2194
|
+
const s = document.querySelector("body");
|
|
2195
|
+
if (!s) {
|
|
2213
2196
|
console.error('Modal root element with id "#modal" not found!');
|
|
2214
2197
|
return;
|
|
2215
2198
|
}
|
|
2216
2199
|
const n = document.createElement("div");
|
|
2217
|
-
|
|
2218
|
-
const
|
|
2200
|
+
s.appendChild(n);
|
|
2201
|
+
const a = Xe({
|
|
2219
2202
|
render() {
|
|
2220
|
-
return
|
|
2203
|
+
return Ye(ra, {
|
|
2221
2204
|
...o,
|
|
2222
2205
|
onClose: () => {
|
|
2223
2206
|
e(null), r();
|
|
2224
2207
|
},
|
|
2225
|
-
onSave: (
|
|
2226
|
-
e(
|
|
2208
|
+
onSave: (d) => {
|
|
2209
|
+
e(d), console.log(d), r();
|
|
2227
2210
|
}
|
|
2228
2211
|
});
|
|
2229
2212
|
}
|
|
2230
2213
|
});
|
|
2231
2214
|
function r() {
|
|
2232
|
-
|
|
2215
|
+
a.unmount(), n.remove();
|
|
2233
2216
|
}
|
|
2234
|
-
|
|
2235
|
-
}),
|
|
2217
|
+
a.mount(n);
|
|
2218
|
+
}), ia = { class: "select-container w-full" }, ua = ["aria-expanded"], da = {
|
|
2236
2219
|
key: 1,
|
|
2237
2220
|
class: "placeholder"
|
|
2238
|
-
},
|
|
2221
|
+
}, ca = ["data-value"], pa = { class: "right-side" }, fa = {
|
|
2239
2222
|
key: 0,
|
|
2240
2223
|
class: "dropdown-menu"
|
|
2241
|
-
},
|
|
2224
|
+
}, ma = ["onClick"], ha = {
|
|
2242
2225
|
key: 0,
|
|
2243
2226
|
class: "option-no-value"
|
|
2244
|
-
},
|
|
2227
|
+
}, va = /* @__PURE__ */ M({
|
|
2245
2228
|
__name: "vs-input-select",
|
|
2246
|
-
props: /* @__PURE__ */
|
|
2229
|
+
props: /* @__PURE__ */ P({
|
|
2247
2230
|
style: { default: () => ({}) },
|
|
2248
2231
|
customClass: { default: "" },
|
|
2249
2232
|
placeholder: { default: "Оберіть значення" },
|
|
@@ -2290,161 +2273,161 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2290
2273
|
}),
|
|
2291
2274
|
emits: ["update:modelValue"],
|
|
2292
2275
|
setup(o) {
|
|
2293
|
-
const e = o,
|
|
2294
|
-
|
|
2295
|
-
const
|
|
2296
|
-
let
|
|
2297
|
-
const
|
|
2298
|
-
if (
|
|
2299
|
-
const
|
|
2276
|
+
const e = o, l = T(() => e.mode || (e.api || e.search ? "search" : null));
|
|
2277
|
+
ue(e.style);
|
|
2278
|
+
const s = R(o, "modelValue"), n = _(null), a = _(!1), r = _(!1), d = _({}), p = _(null), x = _(null), c = _(null), m = _([]), f = _(-1), I = _([]), O = _(""), D = _(null);
|
|
2279
|
+
let N = null;
|
|
2280
|
+
const H = T(() => {
|
|
2281
|
+
if (m.value?.length) {
|
|
2282
|
+
const h = m.value?.filter((g) => g?.id !== c.value?.id);
|
|
2300
2283
|
return [
|
|
2301
|
-
|
|
2302
|
-
].concat(
|
|
2284
|
+
c.value
|
|
2285
|
+
].concat(h)?.filter((g) => g !== null);
|
|
2303
2286
|
}
|
|
2304
2287
|
return [];
|
|
2305
|
-
}),
|
|
2288
|
+
}), S = async () => {
|
|
2306
2289
|
try {
|
|
2307
|
-
const { data:
|
|
2308
|
-
`${e.host}/${e.prefix}/suggest/${e.data}?json=1&key=${
|
|
2309
|
-
).then((
|
|
2310
|
-
return
|
|
2290
|
+
const { data: h } = await fetch(
|
|
2291
|
+
`${e.host}/${e.prefix}/suggest/${e.data}?json=1&key=${O.value}`
|
|
2292
|
+
).then((g) => g.json());
|
|
2293
|
+
return h;
|
|
2311
2294
|
} catch {
|
|
2312
2295
|
return [];
|
|
2313
2296
|
}
|
|
2314
|
-
},
|
|
2315
|
-
document.body.click(),
|
|
2316
|
-
},
|
|
2317
|
-
|
|
2297
|
+
}, b = async (h) => {
|
|
2298
|
+
document.body.click(), a.value = h !== void 0 ? h : !a.value, a.value && !m.value?.length && (!e.options?.length && e.data ? m.value = await S() : e.options?.length && (m.value = [...e.options])), a.value && p.value ? (d.value.width = `${p.value.getBoundingClientRect()?.width}px`, l.value === "search" && D.value?.focus()) : f.value = -1;
|
|
2299
|
+
}, v = () => a.value ? b(!1) : null, q = (h) => {
|
|
2300
|
+
c.value = h, s.value = h.id, r.value = !1, b(!1);
|
|
2318
2301
|
};
|
|
2319
|
-
function
|
|
2320
|
-
|
|
2302
|
+
function $() {
|
|
2303
|
+
c.value = null, s.value = null, a.value = !0;
|
|
2321
2304
|
}
|
|
2322
|
-
const k = (
|
|
2323
|
-
if (!
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2326
|
-
},
|
|
2327
|
-
if (!
|
|
2328
|
-
const { keyCode:
|
|
2329
|
-
if ([38, 40, 13].includes(
|
|
2330
|
-
if (
|
|
2331
|
-
|
|
2332
|
-
} else if (
|
|
2333
|
-
if (
|
|
2334
|
-
|
|
2335
|
-
} else if (
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2305
|
+
const k = (h, g) => {
|
|
2306
|
+
if (!h || !g) return;
|
|
2307
|
+
const E = h.offsetTop, Z = E + h.offsetHeight, Y = g.scrollTop, ie = Y + g.clientHeight;
|
|
2308
|
+
E < Y ? Object.assign(g, { scrollTop: E - 80 }) : Z > ie && Object.assign(g, { scrollTop: Z - g.clientHeight + 4 });
|
|
2309
|
+
}, B = (h) => {
|
|
2310
|
+
if (!a.value) return;
|
|
2311
|
+
const { keyCode: g } = h;
|
|
2312
|
+
if ([38, 40, 13].includes(g) && h.preventDefault(), g === 38) {
|
|
2313
|
+
if (f.value === 0) return;
|
|
2314
|
+
f.value -= 1, k(I.value[f.value], x.value);
|
|
2315
|
+
} else if (g === 40) {
|
|
2316
|
+
if (f.value + 1 >= H.value?.length) return;
|
|
2317
|
+
f.value += 1, k(I.value[f.value], x.value);
|
|
2318
|
+
} else if (g === 13) {
|
|
2319
|
+
const E = H.value[f.value];
|
|
2320
|
+
E && q(E);
|
|
2338
2321
|
}
|
|
2339
|
-
},
|
|
2340
|
-
if (
|
|
2341
|
-
const { keyCode:
|
|
2342
|
-
[38, 40].includes(
|
|
2343
|
-
},
|
|
2344
|
-
|
|
2345
|
-
},
|
|
2346
|
-
|
|
2322
|
+
}, A = async (h) => {
|
|
2323
|
+
if (a.value) return;
|
|
2324
|
+
const { keyCode: g } = h;
|
|
2325
|
+
[38, 40].includes(g) && (await h.preventDefault(), f.value = 0, setTimeout(() => b()));
|
|
2326
|
+
}, G = (h) => {
|
|
2327
|
+
a.value && p.value && x.value && !x.value.contains(h.target) && (a.value = !1);
|
|
2328
|
+
}, X = (h) => {
|
|
2329
|
+
h?.key === "Escape" && a.value && b(!1);
|
|
2347
2330
|
};
|
|
2348
|
-
async function
|
|
2349
|
-
if (!
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2352
|
-
const { data:
|
|
2353
|
-
`${e.host}/${e.prefix}/suggest/${e.data}?json=1&val=${
|
|
2354
|
-
).then((
|
|
2355
|
-
return
|
|
2331
|
+
async function re(h) {
|
|
2332
|
+
if (!h) return null;
|
|
2333
|
+
const g = m.value?.find((Z) => Z?.id.toString() === h?.toString());
|
|
2334
|
+
if (g) return g;
|
|
2335
|
+
const { data: E } = await fetch(
|
|
2336
|
+
`${e.host}/${e.prefix}/suggest/${e.data}?json=1&val=${h}`
|
|
2337
|
+
).then((Z) => Z.json());
|
|
2338
|
+
return E[0];
|
|
2356
2339
|
}
|
|
2357
|
-
|
|
2358
|
-
addEventListener("click",
|
|
2359
|
-
}),
|
|
2360
|
-
removeEventListener("click",
|
|
2361
|
-
}),
|
|
2362
|
-
let
|
|
2363
|
-
(
|
|
2364
|
-
!e.options?.length && e.data ?
|
|
2340
|
+
oe(async () => {
|
|
2341
|
+
addEventListener("click", v), addEventListener("keydown", B), addEventListener("scroll", G, !0), addEventListener("keydown", X), e.options && (m.value = e.options), s.value && !e.options?.length && e.data && (m.value = await S()), c.value = await re(s.value?.toString());
|
|
2342
|
+
}), Ne(() => {
|
|
2343
|
+
removeEventListener("click", v), removeEventListener("keydown", B), removeEventListener("scroll", G, !0), removeEventListener("keydown", X);
|
|
2344
|
+
}), ae(O, (h) => {
|
|
2345
|
+
let g = !1;
|
|
2346
|
+
(h === "" || h.trimStart().length !== 0) && (g = !0), g && (N && clearTimeout(N), N = setTimeout(async () => {
|
|
2347
|
+
!e.options?.length && e.data ? m.value = await S() : m.value = e.options.filter((E) => E.text.toLowerCase().includes(h.toLowerCase()));
|
|
2365
2348
|
}, 200));
|
|
2366
2349
|
});
|
|
2367
|
-
async function
|
|
2350
|
+
async function Be() {
|
|
2368
2351
|
if (!e.add) return;
|
|
2369
|
-
const
|
|
2352
|
+
const h = await he({
|
|
2370
2353
|
form: e.add.form,
|
|
2371
2354
|
mode: "add"
|
|
2372
2355
|
});
|
|
2373
|
-
if (!
|
|
2374
|
-
const
|
|
2356
|
+
if (!h) return;
|
|
2357
|
+
const g = await fetch(`/api/table/${e.add.token}`, {
|
|
2375
2358
|
method: "POST",
|
|
2376
2359
|
headers: {
|
|
2377
2360
|
"Content-Type": "application/json"
|
|
2378
2361
|
},
|
|
2379
|
-
body: JSON.stringify(
|
|
2380
|
-
}).then((
|
|
2381
|
-
|
|
2362
|
+
body: JSON.stringify(h)
|
|
2363
|
+
}).then((E) => E.json());
|
|
2364
|
+
s.value = g.id, c.value = await re(g.id);
|
|
2382
2365
|
}
|
|
2383
|
-
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2366
|
+
ae(s, (h) => {
|
|
2367
|
+
const g = m.value.find((E) => E.id === h);
|
|
2368
|
+
g && (c.value = g, b(!1));
|
|
2386
2369
|
});
|
|
2387
|
-
const
|
|
2388
|
-
|
|
2389
|
-
|
|
2370
|
+
const ye = () => {
|
|
2371
|
+
a.value = !0, r.value = !r.value, D.value?.focus(), a.value && et(() => {
|
|
2372
|
+
b(!0), D.value?.focus();
|
|
2390
2373
|
});
|
|
2391
|
-
},
|
|
2392
|
-
r.value = !1,
|
|
2393
|
-
},
|
|
2394
|
-
r.value = !0,
|
|
2395
|
-
},
|
|
2396
|
-
|
|
2397
|
-
},
|
|
2398
|
-
n.value?.contains(
|
|
2374
|
+
}, Ce = () => {
|
|
2375
|
+
r.value = !1, O.value = "";
|
|
2376
|
+
}, ce = () => {
|
|
2377
|
+
r.value = !0, O.value = "";
|
|
2378
|
+
}, y = () => {
|
|
2379
|
+
a.value = !1, O.value = "";
|
|
2380
|
+
}, w = (h) => {
|
|
2381
|
+
n.value?.contains(h.target) || y();
|
|
2399
2382
|
};
|
|
2400
|
-
return
|
|
2383
|
+
return oe(() => document.addEventListener("click", w, !0)), Re(() => document.removeEventListener("click", w)), (h, g) => (i(), u("div", {
|
|
2401
2384
|
class: "flex gap-1 w-full",
|
|
2402
2385
|
ref_key: "select",
|
|
2403
|
-
ref:
|
|
2404
|
-
onClick:
|
|
2386
|
+
ref: p,
|
|
2387
|
+
onClick: g[1] || (g[1] = _e(() => {
|
|
2405
2388
|
}, ["stop"]))
|
|
2406
2389
|
}, [
|
|
2407
|
-
|
|
2408
|
-
|
|
2390
|
+
t("div", ia, [
|
|
2391
|
+
g[5] || (g[5] = t("span", {
|
|
2409
2392
|
id: "react-select-live-region",
|
|
2410
2393
|
class: "a11yText"
|
|
2411
2394
|
}, null, -1)),
|
|
2412
|
-
|
|
2395
|
+
g[6] || (g[6] = t("span", {
|
|
2413
2396
|
"aria-live": "polite",
|
|
2414
2397
|
"aria-atomic": "false",
|
|
2415
2398
|
"aria-relevant": "additions text",
|
|
2416
2399
|
role: "log",
|
|
2417
2400
|
class: "a11yText"
|
|
2418
2401
|
}, null, -1)),
|
|
2419
|
-
|
|
2420
|
-
onKeydown:
|
|
2421
|
-
class:
|
|
2402
|
+
t("div", {
|
|
2403
|
+
onKeydown: A,
|
|
2404
|
+
class: C(r.value ? "select-control-focus" : "select-control"),
|
|
2422
2405
|
role: "combobox",
|
|
2423
|
-
"aria-expanded":
|
|
2406
|
+
"aria-expanded": a.value,
|
|
2424
2407
|
"aria-haspopup": "true"
|
|
2425
2408
|
}, [
|
|
2426
|
-
|
|
2409
|
+
t("div", {
|
|
2427
2410
|
class: "input-wrapper",
|
|
2428
|
-
onClick:
|
|
2411
|
+
onClick: ye,
|
|
2429
2412
|
style: { display: "grid" },
|
|
2430
2413
|
ref_key: "triggerRef",
|
|
2431
2414
|
ref: n
|
|
2432
2415
|
}, [
|
|
2433
|
-
|
|
2416
|
+
c.value?.text && O.value === "" ? (i(), u("div", {
|
|
2434
2417
|
key: 0,
|
|
2435
|
-
class:
|
|
2436
|
-
},
|
|
2437
|
-
!
|
|
2438
|
-
|
|
2418
|
+
class: C(["singleValue", a.value ? "text-gray-500" : "text-gray-900"])
|
|
2419
|
+
}, z(c.value?.text), 3)) : j("", !0),
|
|
2420
|
+
!O.value && !c.value?.text ? (i(), u("div", da, z(h.placeholder), 1)) : j("", !0),
|
|
2421
|
+
t("div", {
|
|
2439
2422
|
class: "input-container",
|
|
2440
|
-
"data-value":
|
|
2423
|
+
"data-value": O.value
|
|
2441
2424
|
}, [
|
|
2442
|
-
r.value ?
|
|
2425
|
+
r.value ? J((i(), u("input", {
|
|
2443
2426
|
key: 0,
|
|
2444
2427
|
ref_key: "inputRef",
|
|
2445
|
-
ref:
|
|
2446
|
-
onFocus:
|
|
2447
|
-
onBlur:
|
|
2428
|
+
ref: D,
|
|
2429
|
+
onFocus: ce,
|
|
2430
|
+
onBlur: Ce,
|
|
2448
2431
|
autocapitalize: "none",
|
|
2449
2432
|
autocomplete: "off",
|
|
2450
2433
|
autocorrect: "off",
|
|
@@ -2453,20 +2436,20 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2453
2436
|
tabindex: "0",
|
|
2454
2437
|
"aria-autocomplete": "list",
|
|
2455
2438
|
role: "combobox",
|
|
2456
|
-
"onUpdate:modelValue":
|
|
2439
|
+
"onUpdate:modelValue": g[0] || (g[0] = (E) => O.value = E)
|
|
2457
2440
|
}, null, 544)), [
|
|
2458
|
-
[
|
|
2459
|
-
]) :
|
|
2460
|
-
], 8,
|
|
2441
|
+
[ne, O.value]
|
|
2442
|
+
]) : j("", !0)
|
|
2443
|
+
], 8, ca)
|
|
2461
2444
|
], 512),
|
|
2462
|
-
|
|
2463
|
-
|
|
2445
|
+
t("div", pa, [
|
|
2446
|
+
s.value ? (i(), u("div", {
|
|
2464
2447
|
key: 0,
|
|
2465
|
-
onClick:
|
|
2466
|
-
class:
|
|
2448
|
+
onClick: $,
|
|
2449
|
+
class: C(a.value ? "indicatorContainer-open" : "indicatorContainer"),
|
|
2467
2450
|
"aria-hidden": "true"
|
|
2468
|
-
},
|
|
2469
|
-
|
|
2451
|
+
}, g[2] || (g[2] = [
|
|
2452
|
+
t("svg", {
|
|
2470
2453
|
height: "20",
|
|
2471
2454
|
width: "20",
|
|
2472
2455
|
viewBox: "0 0 20 20",
|
|
@@ -2474,16 +2457,16 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2474
2457
|
focusable: "false",
|
|
2475
2458
|
class: "side-icon"
|
|
2476
2459
|
}, [
|
|
2477
|
-
|
|
2460
|
+
t("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
2478
2461
|
], -1)
|
|
2479
|
-
]), 2)) :
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
class:
|
|
2462
|
+
]), 2)) : j("", !0),
|
|
2463
|
+
g[4] || (g[4] = t("span", { class: "indicatorSeparator" }, null, -1)),
|
|
2464
|
+
t("div", {
|
|
2465
|
+
class: C(a.value ? "indicatorContainer-open" : "indicatorContainer"),
|
|
2483
2466
|
"aria-hidden": "true",
|
|
2484
|
-
onClick:
|
|
2485
|
-
},
|
|
2486
|
-
|
|
2467
|
+
onClick: ye
|
|
2468
|
+
}, g[3] || (g[3] = [
|
|
2469
|
+
t("svg", {
|
|
2487
2470
|
height: "20",
|
|
2488
2471
|
width: "20",
|
|
2489
2472
|
viewBox: "0 0 20 20",
|
|
@@ -2491,51 +2474,51 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2491
2474
|
focusable: "false",
|
|
2492
2475
|
class: "side-icon"
|
|
2493
2476
|
}, [
|
|
2494
|
-
|
|
2477
|
+
t("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })
|
|
2495
2478
|
], -1)
|
|
2496
2479
|
]), 2)
|
|
2497
2480
|
])
|
|
2498
|
-
], 42,
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
class: "menu-container",
|
|
2481
|
+
], 42, ua),
|
|
2482
|
+
a.value ? (i(), u("div", fa, [
|
|
2483
|
+
t("div", {
|
|
2484
|
+
class: "menu-container text-gray-900",
|
|
2502
2485
|
ref_key: "list",
|
|
2503
|
-
ref:
|
|
2486
|
+
ref: x
|
|
2504
2487
|
}, [
|
|
2505
|
-
(
|
|
2506
|
-
class:
|
|
2507
|
-
|
|
2508
|
-
|
|
2488
|
+
(i(!0), u(W, null, Q(H.value, (E, Z) => (i(), u("div", {
|
|
2489
|
+
class: C([
|
|
2490
|
+
s.value == E?.id ? "single-option-active" : "single-option",
|
|
2491
|
+
f.value == Z ? "!bg-blue-100" : ""
|
|
2509
2492
|
]),
|
|
2510
|
-
key:
|
|
2511
|
-
onClick: (
|
|
2493
|
+
key: E.id,
|
|
2494
|
+
onClick: (Y) => q(E),
|
|
2512
2495
|
ref_for: !0,
|
|
2513
|
-
ref: (
|
|
2496
|
+
ref: (Y) => I.value[Z] = Y,
|
|
2514
2497
|
"aria-disabled": "false",
|
|
2515
2498
|
id: "react-select-3-option-0",
|
|
2516
2499
|
tabindex: "-1",
|
|
2517
2500
|
role: "option"
|
|
2518
|
-
},
|
|
2519
|
-
|
|
2501
|
+
}, z(E?.text), 11, ma))), 128)),
|
|
2502
|
+
H.value.length === 0 ? (i(), u("div", ha, " No options ")) : j("", !0)
|
|
2520
2503
|
], 512)
|
|
2521
|
-
])) :
|
|
2504
|
+
])) : j("", !0)
|
|
2522
2505
|
]),
|
|
2523
|
-
e.add ? (
|
|
2506
|
+
e.add ? (i(), u("button", {
|
|
2524
2507
|
key: 0,
|
|
2525
|
-
onClick:
|
|
2508
|
+
onClick: Be,
|
|
2526
2509
|
class: "bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40] gap-[8px] flex items-center"
|
|
2527
2510
|
}, [
|
|
2528
|
-
|
|
2511
|
+
V(ke, {
|
|
2529
2512
|
width: "16",
|
|
2530
2513
|
height: "16"
|
|
2531
2514
|
}),
|
|
2532
|
-
|
|
2533
|
-
])) :
|
|
2515
|
+
g[7] || (g[7] = t("span", null, "Додати", -1))
|
|
2516
|
+
])) : j("", !0)
|
|
2534
2517
|
], 512));
|
|
2535
2518
|
}
|
|
2536
|
-
}),
|
|
2519
|
+
}), ga = /* @__PURE__ */ F(va, [["__scopeId", "data-v-85790176"]]), ya = ["placeholder", "disabled"], ba = /* @__PURE__ */ M({
|
|
2537
2520
|
__name: "vs-input-textarea",
|
|
2538
|
-
props: /* @__PURE__ */
|
|
2521
|
+
props: /* @__PURE__ */ P({
|
|
2539
2522
|
style: { default: () => ({}) },
|
|
2540
2523
|
customClass: { default: "" },
|
|
2541
2524
|
placeholder: { default: "" },
|
|
@@ -2579,21 +2562,21 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2579
2562
|
}),
|
|
2580
2563
|
emits: ["update:modelValue"],
|
|
2581
2564
|
setup(o) {
|
|
2582
|
-
const e = o, { inputClass:
|
|
2583
|
-
return (n,
|
|
2584
|
-
"onUpdate:modelValue":
|
|
2565
|
+
const e = o, { inputClass: l } = ue(e.style), s = R(o, "modelValue");
|
|
2566
|
+
return (n, a) => J((i(), u("textarea", {
|
|
2567
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
|
|
2585
2568
|
placeholder: n.placeholder,
|
|
2586
2569
|
disabled: n.disabled,
|
|
2587
2570
|
row: "2",
|
|
2588
|
-
class:
|
|
2571
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [U(l)]]),
|
|
2589
2572
|
style: {
|
|
2590
2573
|
border: "1px solid #CFD9E0"
|
|
2591
2574
|
}
|
|
2592
|
-
}, null, 10,
|
|
2593
|
-
[
|
|
2575
|
+
}, null, 10, ya)), [
|
|
2576
|
+
[ne, s.value]
|
|
2594
2577
|
]);
|
|
2595
2578
|
}
|
|
2596
|
-
}),
|
|
2579
|
+
}), xa = {}, wa = {
|
|
2597
2580
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2598
2581
|
viewBox: "0 0 24 24",
|
|
2599
2582
|
fill: "none",
|
|
@@ -2603,18 +2586,18 @@ const emitter = mitt(), _hoisted_1$j = { class: "relative" }, _hoisted_2$5 = { c
|
|
|
2603
2586
|
"stroke-linejoin": "round",
|
|
2604
2587
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
2605
2588
|
};
|
|
2606
|
-
function
|
|
2607
|
-
return
|
|
2608
|
-
|
|
2589
|
+
function ka(o, e) {
|
|
2590
|
+
return i(), u("svg", wa, e[0] || (e[0] = [
|
|
2591
|
+
t("path", {
|
|
2609
2592
|
stroke: "none",
|
|
2610
2593
|
d: "M0 0h24v24H0z",
|
|
2611
2594
|
fill: "none"
|
|
2612
2595
|
}, null, -1),
|
|
2613
|
-
|
|
2614
|
-
|
|
2596
|
+
t("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }, null, -1),
|
|
2597
|
+
t("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
2615
2598
|
]));
|
|
2616
2599
|
}
|
|
2617
|
-
const
|
|
2600
|
+
const _a = /* @__PURE__ */ F(xa, [["render", ka]]), $a = {}, Ba = {
|
|
2618
2601
|
class: "flex-shrink-0 mt-0.5 size-3.5",
|
|
2619
2602
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2620
2603
|
viewBox: "0 0 24 24",
|
|
@@ -2624,15 +2607,15 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render",
|
|
|
2624
2607
|
"stroke-linecap": "round",
|
|
2625
2608
|
"stroke-linejoin": "round"
|
|
2626
2609
|
};
|
|
2627
|
-
function
|
|
2628
|
-
return
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2610
|
+
function Ca(o, e) {
|
|
2611
|
+
return i(), u("svg", Ba, e[0] || (e[0] = [
|
|
2612
|
+
t("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
2613
|
+
t("path", { d: "M7 20V4" }, null, -1),
|
|
2614
|
+
t("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
|
2615
|
+
t("path", { d: "M17 4v16" }, null, -1)
|
|
2633
2616
|
]));
|
|
2634
2617
|
}
|
|
2635
|
-
const
|
|
2618
|
+
const Va = /* @__PURE__ */ F($a, [["render", Ca]]), Ma = {}, La = {
|
|
2636
2619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2637
2620
|
width: "14",
|
|
2638
2621
|
height: "14",
|
|
@@ -2643,19 +2626,19 @@ const IconArrowTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render",
|
|
|
2643
2626
|
"stroke-linecap": "round",
|
|
2644
2627
|
"stroke-linejoin": "round"
|
|
2645
2628
|
};
|
|
2646
|
-
function
|
|
2647
|
-
return
|
|
2648
|
-
|
|
2629
|
+
function Sa(o, e) {
|
|
2630
|
+
return i(), u("svg", La, e[0] || (e[0] = [
|
|
2631
|
+
t("path", {
|
|
2649
2632
|
stroke: "none",
|
|
2650
2633
|
d: "M0 0h24v24H0z",
|
|
2651
2634
|
fill: "none"
|
|
2652
2635
|
}, null, -1),
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2636
|
+
t("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
|
|
2637
|
+
t("path", { d: "M7 9l5 -5l5 5" }, null, -1),
|
|
2638
|
+
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
2656
2639
|
]));
|
|
2657
2640
|
}
|
|
2658
|
-
const
|
|
2641
|
+
const ja = /* @__PURE__ */ F(Ma, [["render", Sa]]), Ia = {}, Ea = {
|
|
2659
2642
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2660
2643
|
viewBox: "0 0 24 24",
|
|
2661
2644
|
fill: "none",
|
|
@@ -2664,19 +2647,19 @@ const IconImport = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_ren
|
|
|
2664
2647
|
"stroke-linecap": "round",
|
|
2665
2648
|
"stroke-linejoin": "round"
|
|
2666
2649
|
};
|
|
2667
|
-
function
|
|
2668
|
-
return
|
|
2669
|
-
|
|
2650
|
+
function Oa(o, e) {
|
|
2651
|
+
return i(), u("svg", Ea, e[0] || (e[0] = [
|
|
2652
|
+
t("path", {
|
|
2670
2653
|
stroke: "none",
|
|
2671
2654
|
d: "M0 0h24v24H0z",
|
|
2672
2655
|
fill: "none"
|
|
2673
2656
|
}, null, -1),
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2657
|
+
t("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
|
|
2658
|
+
t("path", { d: "M7 11l5 5l5 -5" }, null, -1),
|
|
2659
|
+
t("path", { d: "M12 4l0 12" }, null, -1)
|
|
2677
2660
|
]));
|
|
2678
2661
|
}
|
|
2679
|
-
const
|
|
2662
|
+
const za = /* @__PURE__ */ F(Ia, [["render", Oa]]), Aa = {}, Fa = {
|
|
2680
2663
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2681
2664
|
viewBox: "0 0 24 24",
|
|
2682
2665
|
fill: "none",
|
|
@@ -2685,22 +2668,22 @@ const IconExport = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_ren
|
|
|
2685
2668
|
"stroke-linecap": "round",
|
|
2686
2669
|
"stroke-linejoin": "round"
|
|
2687
2670
|
};
|
|
2688
|
-
function
|
|
2689
|
-
return
|
|
2690
|
-
|
|
2671
|
+
function Da(o, e) {
|
|
2672
|
+
return i(), u("svg", Fa, e[0] || (e[0] = [
|
|
2673
|
+
te('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
2691
2674
|
]));
|
|
2692
2675
|
}
|
|
2693
|
-
const
|
|
2676
|
+
const Fe = /* @__PURE__ */ F(Aa, [["render", Da]]), Ta = {}, Ua = {
|
|
2694
2677
|
viewBox: "0 0 178 90",
|
|
2695
2678
|
fill: "none",
|
|
2696
2679
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2697
2680
|
};
|
|
2698
|
-
function
|
|
2699
|
-
return
|
|
2700
|
-
|
|
2681
|
+
function Ra(o, e) {
|
|
2682
|
+
return i(), u("svg", Ua, e[0] || (e[0] = [
|
|
2683
|
+
te('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
|
2701
2684
|
]));
|
|
2702
2685
|
}
|
|
2703
|
-
const
|
|
2686
|
+
const Ha = /* @__PURE__ */ F(Ta, [["render", Ra]]), Pa = {}, Na = {
|
|
2704
2687
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2705
2688
|
viewBox: "0 0 24 24",
|
|
2706
2689
|
fill: "none",
|
|
@@ -2709,18 +2692,18 @@ const IconNoData = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_ren
|
|
|
2709
2692
|
"stroke-linecap": "round",
|
|
2710
2693
|
"stroke-linejoin": "round"
|
|
2711
2694
|
};
|
|
2712
|
-
function
|
|
2713
|
-
return
|
|
2714
|
-
|
|
2695
|
+
function qa(o, e) {
|
|
2696
|
+
return i(), u("svg", Na, e[0] || (e[0] = [
|
|
2697
|
+
t("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
|
|
2715
2698
|
]));
|
|
2716
2699
|
}
|
|
2717
|
-
const
|
|
2700
|
+
const Ga = /* @__PURE__ */ F(Pa, [["render", qa]]), Ja = { class: "vs-datatable border rounded-xl w-full flex-grow" }, Za = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, Ka = { class: "relative w-full" }, Wa = { class: "table-wrapper flex gap-2" }, Qa = { class: "vs-popover inline-block text-slate-700" }, Xa = { class: "text-center" }, Ya = { class: "" }, en = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, tn = { class: "flex flex-col p-[2px] gap-[2px] w-[140px]" }, ln = { class: "text-sm items-center text-gray-800 flex gap-1" }, on = { class: "w-full overflow-x-auto" }, an = { class: "w-full table-auto caption-bottom text-sm" }, nn = { class: "[&_tr]:border-b" }, sn = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, rn = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, un = {
|
|
2718
2701
|
key: 0,
|
|
2719
2702
|
colspan: "100%",
|
|
2720
2703
|
class: "text-center"
|
|
2721
|
-
},
|
|
2704
|
+
}, dn = { class: "w-full" }, cn = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, pn = ["onDragstart", "onDragover", "onDrop"], fn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, mn = { class: "flex items-center justify-center" }, hn = { class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors" }, vn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, gn = { class: "flex items-center justify-center gap-2" }, yn = ["onClick"], bn = ["onClick"], xn = /* @__PURE__ */ M({
|
|
2722
2705
|
__name: "vs-input-datatable",
|
|
2723
|
-
props: /* @__PURE__ */
|
|
2706
|
+
props: /* @__PURE__ */ P({
|
|
2724
2707
|
style: {},
|
|
2725
2708
|
customClass: {},
|
|
2726
2709
|
placeholder: {},
|
|
@@ -2764,111 +2747,111 @@ const IconPen = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render
|
|
|
2764
2747
|
}),
|
|
2765
2748
|
emits: ["update:modelValue"],
|
|
2766
2749
|
setup(o) {
|
|
2767
|
-
const e = o,
|
|
2768
|
-
if (!n.value) return
|
|
2769
|
-
const
|
|
2770
|
-
return
|
|
2771
|
-
const
|
|
2772
|
-
return
|
|
2750
|
+
const e = o, l = R(o, "modelValue"), s = _({}), n = _(""), a = T(() => {
|
|
2751
|
+
if (!n.value) return l.value ?? [];
|
|
2752
|
+
const $ = n.value.toLowerCase();
|
|
2753
|
+
return l.value.filter((k) => e.colModel?.some((B) => {
|
|
2754
|
+
const A = k[B.key];
|
|
2755
|
+
return A ? Array.isArray(A) ? A.join(", ").toLowerCase().includes($) : String(A).toLowerCase().includes($) : !1;
|
|
2773
2756
|
}));
|
|
2774
2757
|
});
|
|
2775
|
-
console.log(
|
|
2776
|
-
const r =
|
|
2777
|
-
r.value =
|
|
2778
|
-
},
|
|
2779
|
-
|
|
2780
|
-
},
|
|
2781
|
-
if (r.value === null || r.value ===
|
|
2782
|
-
r.value = null,
|
|
2758
|
+
console.log(a.value);
|
|
2759
|
+
const r = _(null), d = _(null), p = _(!1), x = _(null), c = _({ top: 0, left: 0 }), m = ($) => {
|
|
2760
|
+
r.value = $;
|
|
2761
|
+
}, f = ($) => {
|
|
2762
|
+
d.value = $;
|
|
2763
|
+
}, I = ($) => {
|
|
2764
|
+
if (r.value === null || r.value === $) {
|
|
2765
|
+
r.value = null, d.value = null;
|
|
2783
2766
|
return;
|
|
2784
2767
|
}
|
|
2785
|
-
const k = [...
|
|
2786
|
-
k.splice(
|
|
2787
|
-
},
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2790
|
-
},
|
|
2791
|
-
|
|
2792
|
-
},
|
|
2793
|
-
const
|
|
2794
|
-
if (!
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2768
|
+
const k = [...l.value], [B] = k.splice(r.value, 1);
|
|
2769
|
+
k.splice($, 0, B), l.value = k, r.value = null, d.value = null;
|
|
2770
|
+
}, O = ($) => {
|
|
2771
|
+
const B = $.currentTarget.getBoundingClientRect();
|
|
2772
|
+
c.value = { top: B.bottom + window.scrollY, left: B.left + window.scrollX }, p.value = !p.value;
|
|
2773
|
+
}, D = () => {
|
|
2774
|
+
x.value && x.value.click();
|
|
2775
|
+
}, N = ($) => {
|
|
2776
|
+
const B = $.target.files?.[0];
|
|
2777
|
+
if (!B) return;
|
|
2778
|
+
const A = new FileReader();
|
|
2779
|
+
A.onload = (G) => {
|
|
2797
2780
|
try {
|
|
2798
|
-
const
|
|
2799
|
-
if (typeof
|
|
2800
|
-
const
|
|
2801
|
-
Array.isArray(
|
|
2781
|
+
const X = G.target?.result;
|
|
2782
|
+
if (typeof X == "string") {
|
|
2783
|
+
const re = JSON.parse(X);
|
|
2784
|
+
Array.isArray(re) && l.value.push(...re);
|
|
2802
2785
|
}
|
|
2803
|
-
} catch (
|
|
2804
|
-
console.error("Error parsing file:",
|
|
2786
|
+
} catch (X) {
|
|
2787
|
+
console.error("Error parsing file:", X);
|
|
2805
2788
|
}
|
|
2806
|
-
},
|
|
2807
|
-
},
|
|
2808
|
-
const
|
|
2809
|
-
|
|
2789
|
+
}, A.readAsText(B);
|
|
2790
|
+
}, H = () => {
|
|
2791
|
+
const $ = JSON.stringify(l.value, null, 2), k = new Blob([$], { type: "application/json" }), B = URL.createObjectURL(k), A = document.createElement("a");
|
|
2792
|
+
A.href = B, A.download = "data.json", A.click(), URL.revokeObjectURL(B);
|
|
2810
2793
|
};
|
|
2811
|
-
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
|
|
2794
|
+
oe(async () => {
|
|
2795
|
+
const $ = e.colModel?.filter((k) => k.data);
|
|
2796
|
+
$?.length && Promise.all($.map(async (k) => {
|
|
2797
|
+
s.value[k.key] = await fetch(`/api/suggest/${k.data}`).then((B) => B.json());
|
|
2815
2798
|
}));
|
|
2816
2799
|
});
|
|
2817
|
-
async function
|
|
2818
|
-
const
|
|
2800
|
+
async function S() {
|
|
2801
|
+
const $ = await he({
|
|
2819
2802
|
schema: e.colModel,
|
|
2820
2803
|
mode: "add"
|
|
2821
2804
|
});
|
|
2822
|
-
|
|
2805
|
+
$ && (Array.isArray(l.value) ? l.value = [...l.value, $] : l.value = [$]);
|
|
2823
2806
|
}
|
|
2824
|
-
function
|
|
2825
|
-
return
|
|
2807
|
+
function b($, k) {
|
|
2808
|
+
return s.value[k.key] && $[k.key] ? s.value[k.key].find((B) => B.id.toString() === $[k.key].toString())?.text ?? $[k.key] : $[k.key] || "-";
|
|
2826
2809
|
}
|
|
2827
|
-
async function
|
|
2828
|
-
const
|
|
2810
|
+
async function v($, k) {
|
|
2811
|
+
const B = await he({
|
|
2829
2812
|
schema: e.colModel,
|
|
2830
2813
|
mode: "add",
|
|
2831
|
-
defaultValue:
|
|
2814
|
+
defaultValue: $
|
|
2832
2815
|
});
|
|
2833
|
-
|
|
2816
|
+
B && (l.value = l.value.map((A, G) => G === k ? B : A));
|
|
2834
2817
|
}
|
|
2835
|
-
function
|
|
2836
|
-
|
|
2818
|
+
function q($) {
|
|
2819
|
+
l.value = l.value.filter((k, B) => B !== $);
|
|
2837
2820
|
}
|
|
2838
|
-
return (
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2821
|
+
return ($, k) => (i(), u("div", Ja, [
|
|
2822
|
+
t("div", Za, [
|
|
2823
|
+
t("div", Ka, [
|
|
2824
|
+
V(_a, {
|
|
2842
2825
|
width: "14",
|
|
2843
2826
|
height: "14",
|
|
2844
2827
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2845
2828
|
}),
|
|
2846
|
-
|
|
2829
|
+
J(t("input", {
|
|
2847
2830
|
type: "text",
|
|
2848
|
-
"onUpdate:modelValue": k[0] || (k[0] = (
|
|
2831
|
+
"onUpdate:modelValue": k[0] || (k[0] = (B) => n.value = B),
|
|
2849
2832
|
placeholder: "Пошук",
|
|
2850
2833
|
class: "py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"
|
|
2851
2834
|
}, null, 512), [
|
|
2852
|
-
[
|
|
2835
|
+
[ne, n.value]
|
|
2853
2836
|
])
|
|
2854
2837
|
]),
|
|
2855
|
-
|
|
2856
|
-
|
|
2838
|
+
t("div", Wa, [
|
|
2839
|
+
t("input", {
|
|
2857
2840
|
ref_key: "fileInput",
|
|
2858
|
-
ref:
|
|
2859
|
-
onChange:
|
|
2841
|
+
ref: x,
|
|
2842
|
+
onChange: N,
|
|
2860
2843
|
class: "hidden",
|
|
2861
2844
|
accept: ".json",
|
|
2862
2845
|
type: "file"
|
|
2863
2846
|
}, null, 544),
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
onClick:
|
|
2847
|
+
t("div", Qa, [
|
|
2848
|
+
t("div", Xa, [
|
|
2849
|
+
t("div", Ya, [
|
|
2850
|
+
t("button", {
|
|
2851
|
+
onClick: O,
|
|
2869
2852
|
class: "bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
|
|
2870
2853
|
}, [
|
|
2871
|
-
|
|
2854
|
+
V(Va, {
|
|
2872
2855
|
height: "16",
|
|
2873
2856
|
width: "16"
|
|
2874
2857
|
})
|
|
@@ -2877,139 +2860,139 @@ const IconPen = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render
|
|
|
2877
2860
|
])
|
|
2878
2861
|
])
|
|
2879
2862
|
]),
|
|
2880
|
-
(
|
|
2881
|
-
|
|
2863
|
+
(i(), K(tt, { to: "body" }, [
|
|
2864
|
+
p.value ? (i(), u("div", {
|
|
2882
2865
|
key: 0,
|
|
2883
2866
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
2884
|
-
style:
|
|
2867
|
+
style: ve([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
|
|
2885
2868
|
}, [
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
onClick:
|
|
2869
|
+
t("div", en, [
|
|
2870
|
+
t("div", tn, [
|
|
2871
|
+
t("button", {
|
|
2872
|
+
onClick: D,
|
|
2890
2873
|
class: "text-slate-700 flex items-center gap-1 px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2891
2874
|
}, [
|
|
2892
|
-
|
|
2875
|
+
V(ja, {
|
|
2893
2876
|
class: "text-black",
|
|
2894
2877
|
width: "14",
|
|
2895
2878
|
height: "14"
|
|
2896
2879
|
}),
|
|
2897
|
-
k[1] || (k[1] =
|
|
2880
|
+
k[1] || (k[1] = le(" Імпортувати "))
|
|
2898
2881
|
]),
|
|
2899
|
-
|
|
2900
|
-
onClick:
|
|
2882
|
+
t("button", {
|
|
2883
|
+
onClick: H,
|
|
2901
2884
|
class: "text-slate-700 flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2902
2885
|
}, [
|
|
2903
|
-
|
|
2904
|
-
|
|
2886
|
+
t("span", ln, [
|
|
2887
|
+
V(za, {
|
|
2905
2888
|
class: "text-black",
|
|
2906
2889
|
width: "14",
|
|
2907
2890
|
height: "14"
|
|
2908
2891
|
}),
|
|
2909
|
-
k[2] || (k[2] =
|
|
2892
|
+
k[2] || (k[2] = le(" Експортувати "))
|
|
2910
2893
|
])
|
|
2911
2894
|
])
|
|
2912
2895
|
])
|
|
2913
2896
|
])
|
|
2914
|
-
], 4)) :
|
|
2897
|
+
], 4)) : j("", !0)
|
|
2915
2898
|
])),
|
|
2916
|
-
|
|
2917
|
-
onClick:
|
|
2899
|
+
t("button", {
|
|
2900
|
+
onClick: S,
|
|
2918
2901
|
class: "text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
|
|
2919
2902
|
}, [
|
|
2920
|
-
|
|
2921
|
-
k[3] || (k[3] =
|
|
2903
|
+
V(ke),
|
|
2904
|
+
k[3] || (k[3] = le(" Додати "))
|
|
2922
2905
|
])
|
|
2923
2906
|
]),
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2907
|
+
t("div", on, [
|
|
2908
|
+
t("table", an, [
|
|
2909
|
+
t("thead", nn, [
|
|
2910
|
+
t("tr", sn, [
|
|
2911
|
+
t("th", rn, [
|
|
2912
|
+
V(Fe, {
|
|
2930
2913
|
width: "24",
|
|
2931
2914
|
height: "24",
|
|
2932
2915
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2933
2916
|
})
|
|
2934
2917
|
]),
|
|
2935
|
-
(
|
|
2936
|
-
key:
|
|
2918
|
+
(i(!0), u(W, null, Q($.colModel, (B) => (i(), u("th", {
|
|
2919
|
+
key: B.key,
|
|
2937
2920
|
class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
|
|
2938
|
-
},
|
|
2939
|
-
k[4] || (k[4] =
|
|
2921
|
+
}, z(B.ua), 1))), 128)),
|
|
2922
|
+
k[4] || (k[4] = t("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
|
|
2940
2923
|
])
|
|
2941
2924
|
]),
|
|
2942
|
-
|
|
2943
|
-
class:
|
|
2925
|
+
t("tbody", {
|
|
2926
|
+
class: C({ "[&_tr:last-child]:border-0": !d.value })
|
|
2944
2927
|
}, [
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
k[5] || (k[5] =
|
|
2950
|
-
|
|
2951
|
-
|
|
2928
|
+
a.value.length === 0 ? (i(), u("td", un, [
|
|
2929
|
+
t("div", dn, [
|
|
2930
|
+
t("div", cn, [
|
|
2931
|
+
V(Ha, { class: "w-48 mx-auto" }),
|
|
2932
|
+
k[5] || (k[5] = t("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2933
|
+
t("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2934
|
+
t("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
2952
2935
|
], -1))
|
|
2953
2936
|
])
|
|
2954
2937
|
])
|
|
2955
|
-
])) :
|
|
2956
|
-
(
|
|
2957
|
-
key:
|
|
2958
|
-
class:
|
|
2959
|
-
"opacity-50": r.value ===
|
|
2960
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":
|
|
2938
|
+
])) : j("", !0),
|
|
2939
|
+
(i(!0), u(W, null, Q(a.value, (B, A) => (i(), u("tr", {
|
|
2940
|
+
key: B.id,
|
|
2941
|
+
class: C(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2942
|
+
"opacity-50": r.value === A,
|
|
2943
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === A
|
|
2961
2944
|
}]),
|
|
2962
2945
|
draggable: "true",
|
|
2963
|
-
onDragstart: (
|
|
2964
|
-
onDragover:
|
|
2965
|
-
onDrop: (
|
|
2946
|
+
onDragstart: (G) => m(A),
|
|
2947
|
+
onDragover: _e((G) => f(A), ["prevent"]),
|
|
2948
|
+
onDrop: (G) => I(A)
|
|
2966
2949
|
}, [
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2950
|
+
t("td", fn, [
|
|
2951
|
+
t("div", mn, [
|
|
2952
|
+
V(Fe, {
|
|
2970
2953
|
width: "24",
|
|
2971
2954
|
height: "24",
|
|
2972
2955
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2973
2956
|
})
|
|
2974
2957
|
])
|
|
2975
2958
|
]),
|
|
2976
|
-
(
|
|
2977
|
-
key:
|
|
2959
|
+
(i(!0), u(W, null, Q($.colModel, (G) => (i(), u("td", {
|
|
2960
|
+
key: G.key,
|
|
2978
2961
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2979
2962
|
}, [
|
|
2980
|
-
|
|
2963
|
+
t("div", hn, z(b(B, G)), 1)
|
|
2981
2964
|
]))), 128)),
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
onClick: (
|
|
2965
|
+
t("td", vn, [
|
|
2966
|
+
t("div", gn, [
|
|
2967
|
+
t("button", {
|
|
2968
|
+
onClick: (G) => v(B, A),
|
|
2986
2969
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2987
2970
|
}, [
|
|
2988
|
-
|
|
2971
|
+
V(Ga, {
|
|
2989
2972
|
width: "24",
|
|
2990
2973
|
height: "24",
|
|
2991
2974
|
class: "w-3 h-3"
|
|
2992
2975
|
})
|
|
2993
|
-
], 8,
|
|
2994
|
-
|
|
2995
|
-
onClick: (
|
|
2976
|
+
], 8, yn),
|
|
2977
|
+
t("button", {
|
|
2978
|
+
onClick: (G) => q(A),
|
|
2996
2979
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2997
2980
|
}, [
|
|
2998
|
-
|
|
2981
|
+
V($e, {
|
|
2999
2982
|
width: "24",
|
|
3000
2983
|
height: "24",
|
|
3001
2984
|
class: "w-3 h-3"
|
|
3002
2985
|
})
|
|
3003
|
-
], 8,
|
|
2986
|
+
], 8, bn)
|
|
3004
2987
|
])
|
|
3005
2988
|
])
|
|
3006
|
-
], 42,
|
|
2989
|
+
], 42, pn))), 128))
|
|
3007
2990
|
], 2)
|
|
3008
2991
|
])
|
|
3009
2992
|
])
|
|
3010
2993
|
]));
|
|
3011
2994
|
}
|
|
3012
|
-
}),
|
|
2995
|
+
}), wn = {
|
|
3013
2996
|
draw: {
|
|
3014
2997
|
toolbar: {
|
|
3015
2998
|
actions: {
|
|
@@ -3117,7 +3100,7 @@ const IconPen = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render
|
|
|
3117
3100
|
}
|
|
3118
3101
|
}
|
|
3119
3102
|
};
|
|
3120
|
-
function
|
|
3103
|
+
function De(o) {
|
|
3121
3104
|
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? o : o.geom ? {
|
|
3122
3105
|
type: "Feature",
|
|
3123
3106
|
geometry: {
|
|
@@ -3131,7 +3114,7 @@ function normalizeToGeoJSON(o) {
|
|
|
3131
3114
|
properties: {}
|
|
3132
3115
|
} : null : null;
|
|
3133
3116
|
}
|
|
3134
|
-
const
|
|
3117
|
+
const kn = {}, _n = {
|
|
3135
3118
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3136
3119
|
viewBox: "0 0 24 24",
|
|
3137
3120
|
stroke: "currentColor",
|
|
@@ -3141,18 +3124,18 @@ const _sfc_main$a = {}, _hoisted_1$8 = {
|
|
|
3141
3124
|
"stroke-linejoin": "round",
|
|
3142
3125
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
|
|
3143
3126
|
};
|
|
3144
|
-
function
|
|
3145
|
-
return
|
|
3146
|
-
|
|
3127
|
+
function $n(o, e) {
|
|
3128
|
+
return i(), u("svg", _n, e[0] || (e[0] = [
|
|
3129
|
+
t("path", {
|
|
3147
3130
|
stroke: "none",
|
|
3148
3131
|
d: "M0 0h24v24H0z",
|
|
3149
3132
|
fill: "none"
|
|
3150
3133
|
}, null, -1),
|
|
3151
|
-
|
|
3152
|
-
|
|
3134
|
+
t("path", { d: "M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" }, null, -1),
|
|
3135
|
+
t("path", { d: "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" }, null, -1)
|
|
3153
3136
|
]));
|
|
3154
3137
|
}
|
|
3155
|
-
const
|
|
3138
|
+
const Bn = /* @__PURE__ */ F(kn, [["render", $n]]), Cn = {}, Vn = {
|
|
3156
3139
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3157
3140
|
viewBox: "0 0 24 24",
|
|
3158
3141
|
fill: "none",
|
|
@@ -3162,19 +3145,19 @@ const IconMapPin = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_ren
|
|
|
3162
3145
|
"stroke-linejoin": "round",
|
|
3163
3146
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
3164
3147
|
};
|
|
3165
|
-
function
|
|
3166
|
-
return
|
|
3167
|
-
|
|
3148
|
+
function Mn(o, e) {
|
|
3149
|
+
return i(), u("svg", Vn, e[0] || (e[0] = [
|
|
3150
|
+
t("path", {
|
|
3168
3151
|
stroke: "none",
|
|
3169
3152
|
d: "M0 0h24v24H0z",
|
|
3170
3153
|
fill: "none"
|
|
3171
3154
|
}, null, -1),
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3155
|
+
t("path", { d: "M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, null, -1),
|
|
3156
|
+
t("path", { d: "M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, null, -1),
|
|
3157
|
+
t("path", { d: "M7.5 16.5l9 -9" }, null, -1)
|
|
3175
3158
|
]));
|
|
3176
3159
|
}
|
|
3177
|
-
const
|
|
3160
|
+
const Ln = /* @__PURE__ */ F(Cn, [["render", Mn]]), Sn = {}, jn = {
|
|
3178
3161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3179
3162
|
viewBox: "0 0 24 24",
|
|
3180
3163
|
fill: "none",
|
|
@@ -3184,12 +3167,12 @@ const IconLine = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_rende
|
|
|
3184
3167
|
"stroke-linejoin": "round",
|
|
3185
3168
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
3186
3169
|
};
|
|
3187
|
-
function
|
|
3188
|
-
return
|
|
3189
|
-
|
|
3170
|
+
function In(o, e) {
|
|
3171
|
+
return i(), u("svg", jn, e[0] || (e[0] = [
|
|
3172
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
|
|
3190
3173
|
]));
|
|
3191
3174
|
}
|
|
3192
|
-
const
|
|
3175
|
+
const En = /* @__PURE__ */ F(Sn, [["render", In]]), On = {}, zn = {
|
|
3193
3176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3194
3177
|
viewBox: "0 0 24 24",
|
|
3195
3178
|
fill: "none",
|
|
@@ -3199,12 +3182,12 @@ const IconPoligon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_re
|
|
|
3199
3182
|
"stroke-linejoin": "round",
|
|
3200
3183
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
3201
3184
|
};
|
|
3202
|
-
function
|
|
3203
|
-
return
|
|
3204
|
-
|
|
3185
|
+
function An(o, e) {
|
|
3186
|
+
return i(), u("svg", zn, e[0] || (e[0] = [
|
|
3187
|
+
te('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
|
|
3205
3188
|
]));
|
|
3206
3189
|
}
|
|
3207
|
-
const
|
|
3190
|
+
const Fn = /* @__PURE__ */ F(On, [["render", An]]), Dn = {}, Tn = {
|
|
3208
3191
|
version: "1.1",
|
|
3209
3192
|
viewBox: "0 0 14 14",
|
|
3210
3193
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3212,28 +3195,28 @@ const IconPoligonRectangle = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render"
|
|
|
3212
3195
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
3213
3196
|
class: "fullscreen-icon"
|
|
3214
3197
|
};
|
|
3215
|
-
function
|
|
3216
|
-
return
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3198
|
+
function Un(o, e) {
|
|
3199
|
+
return i(), u("svg", Tn, e[0] || (e[0] = [
|
|
3200
|
+
t("title", null, null, -1),
|
|
3201
|
+
t("desc", null, null, -1),
|
|
3202
|
+
t("defs", null, null, -1),
|
|
3203
|
+
t("g", {
|
|
3221
3204
|
fill: "none",
|
|
3222
3205
|
"fill-rule": "evenodd",
|
|
3223
3206
|
id: "Page-1",
|
|
3224
3207
|
stroke: "none",
|
|
3225
3208
|
"stroke-width": "1"
|
|
3226
3209
|
}, [
|
|
3227
|
-
|
|
3210
|
+
t("g", {
|
|
3228
3211
|
fill: "#000000",
|
|
3229
3212
|
id: "Core",
|
|
3230
3213
|
transform: "translate(-215.000000, -257.000000)"
|
|
3231
3214
|
}, [
|
|
3232
|
-
|
|
3215
|
+
t("g", {
|
|
3233
3216
|
id: "fullscreen",
|
|
3234
3217
|
transform: "translate(215.000000, 257.000000)"
|
|
3235
3218
|
}, [
|
|
3236
|
-
|
|
3219
|
+
t("path", {
|
|
3237
3220
|
d: "M2,9 L0,9 L0,14 L5,14 L5,12 L2,12 L2,9 L2,9 Z M0,5 L2,5 L2,2 L5,2 L5,0 L0,0 L0,5 L0,5 Z M12,12 L9,12 L9,14 L14,14 L14,9 L12,9 L12,12 L12,12 Z M9,0 L9,2 L12,2 L12,5 L14,5 L14,0 L9,0 L9,0 Z",
|
|
3238
3221
|
id: "Shape"
|
|
3239
3222
|
})
|
|
@@ -3242,10 +3225,10 @@ function _sfc_render(o, e) {
|
|
|
3242
3225
|
], -1)
|
|
3243
3226
|
]));
|
|
3244
3227
|
}
|
|
3245
|
-
const
|
|
3228
|
+
const Rn = /* @__PURE__ */ F(Dn, [["render", Un]]), Hn = { class: "form-geom__search" }, Pn = { class: "map-search__input" }, Nn = { class: "flex flex-nowrap relative" }, qn = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, Gn = { class: "flex items-center w-full" }, Jn = { class: "max-w-[90%] truncate" }, Zn = {
|
|
3246
3229
|
key: 0,
|
|
3247
3230
|
class: "absolute z-[3100] mt-0.5 left-0 right-0"
|
|
3248
|
-
},
|
|
3231
|
+
}, Kn = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, Wn = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, Qn = ["onClick"], Xn = { class: "flex justify-between items-center w-full" }, Yn = { class: "flex items-center" }, es = {
|
|
3249
3232
|
key: 0,
|
|
3250
3233
|
class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
|
|
3251
3234
|
width: "24",
|
|
@@ -3256,94 +3239,94 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3256
3239
|
"stroke-width": "2",
|
|
3257
3240
|
"stroke-linecap": "round",
|
|
3258
3241
|
"stroke-linejoin": "round"
|
|
3259
|
-
},
|
|
3242
|
+
}, ts = { class: "relative w-full" }, ls = { class: "vs-form-text relative bg-white rounded-lg" }, os = {
|
|
3260
3243
|
key: 1,
|
|
3261
3244
|
class: "absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"
|
|
3262
|
-
},
|
|
3245
|
+
}, as = { key: 0 }, ns = ["onClick"], ss = {
|
|
3263
3246
|
key: 1,
|
|
3264
3247
|
class: "px-3 py-2 text-xs text-gray-500"
|
|
3265
|
-
},
|
|
3248
|
+
}, rs = {
|
|
3266
3249
|
key: 2,
|
|
3267
3250
|
class: "px-3 py-2 text-xs text-gray-400"
|
|
3268
|
-
},
|
|
3251
|
+
}, is = /* @__PURE__ */ M({
|
|
3269
3252
|
__name: "map-search",
|
|
3270
3253
|
props: {
|
|
3271
3254
|
placeholder: { default: "50, 30" }
|
|
3272
3255
|
},
|
|
3273
3256
|
emits: ["goToCoordinates"],
|
|
3274
3257
|
setup(o, { emit: e }) {
|
|
3275
|
-
const
|
|
3276
|
-
let
|
|
3277
|
-
const
|
|
3258
|
+
const l = e, s = _(!1), n = _("coordinates"), a = _(""), r = _([]), d = _(!1), p = _(!1);
|
|
3259
|
+
let x;
|
|
3260
|
+
const c = [
|
|
3278
3261
|
{ value: "coordinates", label: "Пошук по кординатам" },
|
|
3279
3262
|
{ value: "atu", label: "АТУ" },
|
|
3280
3263
|
{ value: "address", label: "Адресса" },
|
|
3281
3264
|
{ value: "search_here", label: "Пошук HERE" }
|
|
3282
|
-
],
|
|
3283
|
-
function
|
|
3284
|
-
n.value =
|
|
3265
|
+
], m = T(() => c.find((S) => S.value === n.value)?.label ?? "АТУ");
|
|
3266
|
+
function f(S) {
|
|
3267
|
+
n.value = S.value, s.value = !1, a.value = "", a.value && D();
|
|
3285
3268
|
}
|
|
3286
|
-
function
|
|
3287
|
-
|
|
3269
|
+
function I(S) {
|
|
3270
|
+
S.target.closest(".map-search__input") || (s.value = !1);
|
|
3288
3271
|
}
|
|
3289
|
-
|
|
3290
|
-
async function
|
|
3291
|
-
let
|
|
3292
|
-
n.value === "atu" ?
|
|
3293
|
-
const
|
|
3294
|
-
return n.value === "search_here" ?
|
|
3272
|
+
oe(() => document.addEventListener("click", I)), Ne(() => document.removeEventListener("click", I));
|
|
3273
|
+
async function O(S) {
|
|
3274
|
+
let b;
|
|
3275
|
+
n.value === "atu" ? b = "/api/suggest/atu.nsdi.ato_level" : n.value === "address" ? b = "/api/suggest/map.address_id" : n.value === "search_here" && (b = "/api/gis-url-proxy");
|
|
3276
|
+
const v = new URL(b || "");
|
|
3277
|
+
return n.value === "search_here" ? v.searchParams.set("searchtext", S) : (n.value === "atu" || n.value === "address") && v.searchParams.set("key", S), v.searchParams.set("limit", "20"), v.searchParams.set("q", S), (await fetch(v.toString())).json();
|
|
3295
3278
|
}
|
|
3296
|
-
function
|
|
3297
|
-
if (
|
|
3298
|
-
const
|
|
3299
|
-
if (
|
|
3300
|
-
const
|
|
3301
|
-
!Number.isNaN(
|
|
3279
|
+
function D() {
|
|
3280
|
+
if (d.value = !0, p.value = !0, n.value === "coordinates") {
|
|
3281
|
+
const S = a.value.trim().split(",");
|
|
3282
|
+
if (S.length === 2) {
|
|
3283
|
+
const b = parseFloat(S[0]), v = parseFloat(S[1]);
|
|
3284
|
+
!Number.isNaN(b) && !Number.isNaN(v) && l("goToCoordinates", [b, v]);
|
|
3302
3285
|
}
|
|
3303
3286
|
return;
|
|
3304
3287
|
}
|
|
3305
|
-
|
|
3306
|
-
const
|
|
3307
|
-
if (!
|
|
3308
|
-
r.value = [],
|
|
3288
|
+
x && window.clearTimeout(x), x = window.setTimeout(async () => {
|
|
3289
|
+
const S = a.value.trim();
|
|
3290
|
+
if (!S) {
|
|
3291
|
+
r.value = [], p.value = !1;
|
|
3309
3292
|
return;
|
|
3310
3293
|
}
|
|
3311
3294
|
try {
|
|
3312
|
-
const
|
|
3313
|
-
r.value = Array.isArray(
|
|
3295
|
+
const b = await O(S);
|
|
3296
|
+
r.value = Array.isArray(b.features) ? b.features : [];
|
|
3314
3297
|
} catch {
|
|
3315
3298
|
r.value = [];
|
|
3316
3299
|
} finally {
|
|
3317
|
-
|
|
3300
|
+
p.value = !1;
|
|
3318
3301
|
}
|
|
3319
3302
|
}, 300);
|
|
3320
3303
|
}
|
|
3321
|
-
function
|
|
3322
|
-
|
|
3304
|
+
function N() {
|
|
3305
|
+
a.value = "", r.value = [], d.value = !1, p.value = !1;
|
|
3323
3306
|
}
|
|
3324
|
-
function
|
|
3325
|
-
|
|
3307
|
+
function H(S) {
|
|
3308
|
+
l("goToCoordinates", S), d.value = !1, p.value = !1, r.value = [];
|
|
3326
3309
|
}
|
|
3327
|
-
return (
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3310
|
+
return (S, b) => (i(), u("div", Hn, [
|
|
3311
|
+
t("div", Pn, [
|
|
3312
|
+
t("div", Nn, [
|
|
3313
|
+
t("div", qn, [
|
|
3314
|
+
t("button", {
|
|
3332
3315
|
type: "button",
|
|
3333
|
-
onClick:
|
|
3316
|
+
onClick: b[0] || (b[0] = (v) => s.value = !s.value),
|
|
3334
3317
|
class: "h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"
|
|
3335
3318
|
}, [
|
|
3336
|
-
|
|
3337
|
-
|
|
3319
|
+
t("div", Gn, [
|
|
3320
|
+
t("span", Jn, z(m.value), 1)
|
|
3338
3321
|
]),
|
|
3339
|
-
|
|
3322
|
+
b[3] || (b[3] = t("svg", {
|
|
3340
3323
|
class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
|
|
3341
3324
|
width: "15",
|
|
3342
3325
|
height: "15",
|
|
3343
3326
|
viewBox: "0 0 24 24",
|
|
3344
3327
|
fill: "none"
|
|
3345
3328
|
}, [
|
|
3346
|
-
|
|
3329
|
+
t("path", {
|
|
3347
3330
|
d: "M6 9l6 6 6-6",
|
|
3348
3331
|
"stroke-width": "2",
|
|
3349
3332
|
"stroke-linecap": "round",
|
|
@@ -3351,44 +3334,44 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3351
3334
|
})
|
|
3352
3335
|
], -1))
|
|
3353
3336
|
]),
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
(
|
|
3358
|
-
onClick: (
|
|
3359
|
-
key:
|
|
3337
|
+
s.value ? (i(), u("div", Zn, [
|
|
3338
|
+
t("div", Kn, [
|
|
3339
|
+
t("div", Wn, [
|
|
3340
|
+
(i(), u(W, null, Q(c, (v) => t("div", {
|
|
3341
|
+
onClick: (q) => f(v),
|
|
3342
|
+
key: v.value,
|
|
3360
3343
|
class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
|
|
3361
3344
|
}, [
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3345
|
+
t("div", Xn, [
|
|
3346
|
+
t("div", Yn, [
|
|
3347
|
+
t("div", null, z(v.label), 1)
|
|
3365
3348
|
]),
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
]))) :
|
|
3349
|
+
v.value === n.value ? (i(), u("svg", es, b[4] || (b[4] = [
|
|
3350
|
+
t("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
3351
|
+
]))) : j("", !0)
|
|
3369
3352
|
])
|
|
3370
|
-
], 8,
|
|
3353
|
+
], 8, Qn)), 64))
|
|
3371
3354
|
])
|
|
3372
3355
|
])
|
|
3373
|
-
])) :
|
|
3356
|
+
])) : j("", !0)
|
|
3374
3357
|
]),
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3358
|
+
t("div", ts, [
|
|
3359
|
+
t("div", ls, [
|
|
3360
|
+
b[6] || (b[6] = t("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
|
|
3361
|
+
t("svg", {
|
|
3379
3362
|
width: "16",
|
|
3380
3363
|
height: "16",
|
|
3381
3364
|
viewBox: "0 0 24 24",
|
|
3382
3365
|
fill: "none",
|
|
3383
3366
|
stroke: "currentColor"
|
|
3384
3367
|
}, [
|
|
3385
|
-
|
|
3368
|
+
t("circle", {
|
|
3386
3369
|
cx: "11",
|
|
3387
3370
|
cy: "11",
|
|
3388
3371
|
r: "8",
|
|
3389
3372
|
"stroke-width": "2"
|
|
3390
3373
|
}),
|
|
3391
|
-
|
|
3374
|
+
t("line", {
|
|
3392
3375
|
x1: "21",
|
|
3393
3376
|
y1: "21",
|
|
3394
3377
|
x2: "16.65",
|
|
@@ -3397,24 +3380,24 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3397
3380
|
})
|
|
3398
3381
|
])
|
|
3399
3382
|
], -1)),
|
|
3400
|
-
|
|
3383
|
+
J(t("input", {
|
|
3401
3384
|
type: "text",
|
|
3402
|
-
"onUpdate:modelValue":
|
|
3403
|
-
onInput:
|
|
3404
|
-
onFocus:
|
|
3385
|
+
"onUpdate:modelValue": b[1] || (b[1] = (v) => a.value = v),
|
|
3386
|
+
onInput: D,
|
|
3387
|
+
onFocus: b[2] || (b[2] = (v) => d.value = !0),
|
|
3405
3388
|
placeholder: "Пошук...",
|
|
3406
3389
|
class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
3407
3390
|
}, null, 544), [
|
|
3408
|
-
[
|
|
3391
|
+
[ne, a.value]
|
|
3409
3392
|
]),
|
|
3410
|
-
|
|
3393
|
+
a.value ? (i(), u("button", {
|
|
3411
3394
|
key: 0,
|
|
3412
|
-
onClick:
|
|
3395
|
+
onClick: N,
|
|
3413
3396
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
3414
3397
|
"aria-label": "Очистити",
|
|
3415
3398
|
type: "button"
|
|
3416
|
-
},
|
|
3417
|
-
|
|
3399
|
+
}, b[5] || (b[5] = [
|
|
3400
|
+
t("svg", {
|
|
3418
3401
|
width: "15",
|
|
3419
3402
|
height: "15",
|
|
3420
3403
|
viewBox: "0 0 24 24",
|
|
@@ -3422,29 +3405,29 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3422
3405
|
stroke: "currentColor",
|
|
3423
3406
|
"stroke-width": "2"
|
|
3424
3407
|
}, [
|
|
3425
|
-
|
|
3408
|
+
t("path", {
|
|
3426
3409
|
d: "M18 6L6 18M6 6l12 12",
|
|
3427
3410
|
"stroke-linecap": "round",
|
|
3428
3411
|
"stroke-linejoin": "round"
|
|
3429
3412
|
})
|
|
3430
3413
|
], -1)
|
|
3431
|
-
]))) :
|
|
3432
|
-
|
|
3433
|
-
r.value.length ? (
|
|
3434
|
-
(
|
|
3435
|
-
key:
|
|
3436
|
-
onClick: (
|
|
3414
|
+
]))) : j("", !0),
|
|
3415
|
+
d.value && n.value !== "coordinates" ? (i(), u("div", os, [
|
|
3416
|
+
r.value.length ? (i(), u("ul", as, [
|
|
3417
|
+
(i(!0), u(W, null, Q(r.value, (v) => (i(), u("li", {
|
|
3418
|
+
key: v.properties.place_id,
|
|
3419
|
+
onClick: (q) => H(v),
|
|
3437
3420
|
class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
|
|
3438
|
-
},
|
|
3439
|
-
])) :
|
|
3440
|
-
])) :
|
|
3421
|
+
}, z(v.properties.display_name), 9, ns))), 128))
|
|
3422
|
+
])) : p.value ? (i(), u("div", ss, "Шукаю…")) : (i(), u("div", rs, "Нічого не знайдено"))
|
|
3423
|
+
])) : j("", !0)
|
|
3441
3424
|
])
|
|
3442
3425
|
])
|
|
3443
3426
|
])
|
|
3444
3427
|
])
|
|
3445
3428
|
]));
|
|
3446
3429
|
}
|
|
3447
|
-
}),
|
|
3430
|
+
}), us = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, ds = { class: "flex gap-2" }, cs = ["onClick", "title"], ps = ["src"], fs = /* @__PURE__ */ M({
|
|
3448
3431
|
__name: "map-layers",
|
|
3449
3432
|
props: {
|
|
3450
3433
|
basemaps: {},
|
|
@@ -3452,39 +3435,39 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3452
3435
|
},
|
|
3453
3436
|
emits: ["onLayerChange"],
|
|
3454
3437
|
setup(o, { emit: e }) {
|
|
3455
|
-
const
|
|
3456
|
-
function
|
|
3457
|
-
n("onLayerChange", r),
|
|
3438
|
+
const s = _(o.defaultLayer ?? ""), n = e;
|
|
3439
|
+
function a(r) {
|
|
3440
|
+
n("onLayerChange", r), s.value = r;
|
|
3458
3441
|
}
|
|
3459
|
-
return (r,
|
|
3460
|
-
|
|
3461
|
-
(
|
|
3462
|
-
key:
|
|
3463
|
-
class:
|
|
3464
|
-
onClick: (
|
|
3465
|
-
title:
|
|
3442
|
+
return (r, d) => (i(), u("div", us, [
|
|
3443
|
+
t("div", ds, [
|
|
3444
|
+
(i(!0), u(W, null, Q(r.basemaps, (p, x) => (i(), u("div", {
|
|
3445
|
+
key: x,
|
|
3446
|
+
class: C(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": s.value === x }]),
|
|
3447
|
+
onClick: (c) => a(x),
|
|
3448
|
+
title: x,
|
|
3466
3449
|
role: "button",
|
|
3467
3450
|
tabindex: "0"
|
|
3468
3451
|
}, [
|
|
3469
|
-
|
|
3470
|
-
src:
|
|
3452
|
+
t("img", {
|
|
3453
|
+
src: p.preview,
|
|
3471
3454
|
alt: "",
|
|
3472
3455
|
class: "w-14 h-14 object-cover"
|
|
3473
|
-
}, null, 8,
|
|
3474
|
-
], 10,
|
|
3456
|
+
}, null, 8, ps)
|
|
3457
|
+
], 10, cs))), 128))
|
|
3475
3458
|
])
|
|
3476
3459
|
]));
|
|
3477
3460
|
}
|
|
3478
|
-
}),
|
|
3461
|
+
}), ms = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, hs = { class: "form-geom__panel flex gap-1 items-start mt-2" }, vs = { class: "flex items-center gap-1" }, gs = ["disabled"], ys = { class: "absolute top-4 right-4 z-[1000]" }, bs = { class: "flex flex-col gap-[2px]" }, xs = ["aria-pressed"], ws = ["aria-pressed"], ks = ["aria-pressed"], _s = ["aria-pressed"], $s = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, Bs = {
|
|
3479
3462
|
key: 0,
|
|
3480
3463
|
class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
|
|
3481
|
-
},
|
|
3464
|
+
}, Cs = { class: "mr-auto" }, Vs = { class: "font-bold" }, Ms = { class: "flex items-center" }, Ls = { class: "text-xs mr-2" }, Ss = {
|
|
3482
3465
|
key: 0,
|
|
3483
3466
|
class: "text-xs"
|
|
3484
|
-
},
|
|
3467
|
+
}, js = {
|
|
3485
3468
|
key: 1,
|
|
3486
3469
|
class: "text-xs"
|
|
3487
|
-
},
|
|
3470
|
+
}, Is = /* @__PURE__ */ M({
|
|
3488
3471
|
__name: "vs-input-map",
|
|
3489
3472
|
props: {
|
|
3490
3473
|
style: {},
|
|
@@ -3527,9 +3510,9 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3527
3510
|
},
|
|
3528
3511
|
emits: ["update:modelValue"],
|
|
3529
3512
|
setup(o, { emit: e }) {
|
|
3530
|
-
const
|
|
3531
|
-
let
|
|
3532
|
-
const
|
|
3513
|
+
const l = o, s = e, n = _(null);
|
|
3514
|
+
let a, r, d;
|
|
3515
|
+
const p = _(null), x = _(null), c = _(6), m = _(0), f = _(null), I = {
|
|
3533
3516
|
topo100: {
|
|
3534
3517
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3535
3518
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3543,310 +3526,310 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3543
3526
|
preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
|
|
3544
3527
|
}
|
|
3545
3528
|
};
|
|
3546
|
-
let
|
|
3547
|
-
const
|
|
3548
|
-
function
|
|
3549
|
-
return new Promise((
|
|
3550
|
-
window.L && window.L.Draw &&
|
|
3551
|
-
const
|
|
3552
|
-
if (Array.from(document.styleSheets).some((
|
|
3553
|
-
const
|
|
3554
|
-
|
|
3555
|
-
},
|
|
3556
|
-
const
|
|
3557
|
-
if (
|
|
3558
|
-
|
|
3529
|
+
let O;
|
|
3530
|
+
const D = _("topo100");
|
|
3531
|
+
function N() {
|
|
3532
|
+
return new Promise((y, w) => {
|
|
3533
|
+
window.L && window.L.Draw && y(0);
|
|
3534
|
+
const h = (E) => {
|
|
3535
|
+
if (Array.from(document.styleSheets).some((ie) => ie?.href?.includes(E))) return;
|
|
3536
|
+
const Y = document.createElement("link");
|
|
3537
|
+
Y.rel = "stylesheet", Y.href = E, document.head.appendChild(Y);
|
|
3538
|
+
}, g = (E) => new Promise((Z, Y) => {
|
|
3539
|
+
const ie = Array.from(document.scripts).find((fe) => fe.src === E);
|
|
3540
|
+
if (ie) {
|
|
3541
|
+
ie.addEventListener("load", () => Z()), ie.addEventListener("error", (fe) => Y(fe));
|
|
3559
3542
|
return;
|
|
3560
3543
|
}
|
|
3561
|
-
const
|
|
3562
|
-
|
|
3544
|
+
const pe = document.createElement("script");
|
|
3545
|
+
pe.src = E, pe.async = !0, pe.onload = () => Z(), pe.onerror = (fe) => Y(fe), document.body.appendChild(pe);
|
|
3563
3546
|
});
|
|
3564
|
-
|
|
3547
|
+
h("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), h("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), g("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => g("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => y(0)).catch(w);
|
|
3565
3548
|
});
|
|
3566
3549
|
}
|
|
3567
|
-
function
|
|
3568
|
-
const
|
|
3569
|
-
|
|
3550
|
+
function H() {
|
|
3551
|
+
const y = r.toGeoJSON();
|
|
3552
|
+
s("update:modelValue", y), m.value = r.getLayers().length;
|
|
3570
3553
|
}
|
|
3571
|
-
function
|
|
3572
|
-
const
|
|
3573
|
-
if (!
|
|
3574
|
-
const
|
|
3575
|
-
|
|
3554
|
+
function S(y = 30) {
|
|
3555
|
+
const w = r.getLayers();
|
|
3556
|
+
if (!w.length) return;
|
|
3557
|
+
const g = L.featureGroup(w).getBounds();
|
|
3558
|
+
g && g.isValid() && a.fitBounds(g, { padding: [y, y] });
|
|
3576
3559
|
}
|
|
3577
|
-
function
|
|
3578
|
-
|
|
3560
|
+
function b() {
|
|
3561
|
+
p.value?.click();
|
|
3579
3562
|
}
|
|
3580
|
-
const
|
|
3581
|
-
function
|
|
3582
|
-
return
|
|
3563
|
+
const v = _("");
|
|
3564
|
+
function q(y) {
|
|
3565
|
+
return y instanceof L.Circle ? "Circle" : y instanceof L.Rectangle ? "Rectangle" : y instanceof L.Polygon && !(y instanceof L.Rectangle) ? "Polygon" : y instanceof L.Polyline && !(y instanceof L.Polygon) ? "Polyline" : y instanceof L.Marker ? "Point" : "Feature";
|
|
3583
3566
|
}
|
|
3584
|
-
function
|
|
3585
|
-
if (
|
|
3586
|
-
const
|
|
3587
|
-
return Math.PI * (
|
|
3567
|
+
function $(y) {
|
|
3568
|
+
if (y instanceof L.Circle) {
|
|
3569
|
+
const w = y.getRadius();
|
|
3570
|
+
return Math.PI * (w * w) / 1e6;
|
|
3588
3571
|
}
|
|
3589
|
-
if (
|
|
3572
|
+
if (y instanceof L.Polygon || y instanceof L.Rectangle)
|
|
3590
3573
|
try {
|
|
3591
|
-
const
|
|
3592
|
-
return
|
|
3574
|
+
const w = y.getLatLngs(), h = Array.isArray(w[0]) ? w[0] : w, g = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(h) : 0;
|
|
3575
|
+
return g ? g / 1e6 : 0;
|
|
3593
3576
|
} catch {
|
|
3594
3577
|
return null;
|
|
3595
3578
|
}
|
|
3596
3579
|
return null;
|
|
3597
3580
|
}
|
|
3598
|
-
function k(
|
|
3599
|
-
return
|
|
3581
|
+
function k(y) {
|
|
3582
|
+
return y instanceof L.Circle ? y.getLatLng() : y.getBounds ? y.getBounds().getCenter() : y.getLatLng ? y.getLatLng() : a.getCenter();
|
|
3600
3583
|
}
|
|
3601
|
-
function
|
|
3602
|
-
const
|
|
3603
|
-
if (!
|
|
3604
|
-
|
|
3584
|
+
function B() {
|
|
3585
|
+
const y = r.getLayers();
|
|
3586
|
+
if (!y.length) {
|
|
3587
|
+
f.value = null, m.value = 0;
|
|
3605
3588
|
return;
|
|
3606
3589
|
}
|
|
3607
|
-
const
|
|
3608
|
-
|
|
3609
|
-
type:
|
|
3610
|
-
center:
|
|
3611
|
-
areaKm2:
|
|
3612
|
-
layer:
|
|
3613
|
-
},
|
|
3590
|
+
const w = y[y.length - 1], h = q(w), g = k(w), E = $(w);
|
|
3591
|
+
f.value = {
|
|
3592
|
+
type: h,
|
|
3593
|
+
center: g,
|
|
3594
|
+
areaKm2: E,
|
|
3595
|
+
layer: w
|
|
3596
|
+
}, m.value = y.length;
|
|
3614
3597
|
}
|
|
3615
|
-
function
|
|
3616
|
-
const
|
|
3617
|
-
|
|
3598
|
+
function A() {
|
|
3599
|
+
const y = f.value?.layer;
|
|
3600
|
+
y && (y instanceof L.Circle && y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getLatLng && a.setView(y.getLatLng(), Math.max(c.value, 14)));
|
|
3618
3601
|
}
|
|
3619
|
-
function
|
|
3620
|
-
const
|
|
3621
|
-
|
|
3602
|
+
function G() {
|
|
3603
|
+
const y = f.value?.layer;
|
|
3604
|
+
y && (r.removeLayer(y), H(), B());
|
|
3622
3605
|
}
|
|
3623
|
-
|
|
3624
|
-
await
|
|
3625
|
-
const { layer:
|
|
3626
|
-
r.clearLayers(), r.addLayer(
|
|
3627
|
-
}),
|
|
3628
|
-
|
|
3629
|
-
}),
|
|
3630
|
-
|
|
3631
|
-
}),
|
|
3632
|
-
|
|
3633
|
-
}),
|
|
3634
|
-
|
|
3606
|
+
oe(async () => {
|
|
3607
|
+
await N(), L.drawLocal = wn, a = L.map(n.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(a), O = L.tileLayer(I.topo100.url, { maxZoom: 19, minZoom: 6 }).addTo(a), D.value = "topo100", r = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (w) => {
|
|
3608
|
+
const { layer: h } = w;
|
|
3609
|
+
r.clearLayers(), r.addLayer(h), H(), B(), S(), v.value = "";
|
|
3610
|
+
}), a.on(L.Draw.Event.EDITED, () => {
|
|
3611
|
+
H(), B(), S();
|
|
3612
|
+
}), a.on(L.Draw.Event.DELETED, () => {
|
|
3613
|
+
H(), B(), S();
|
|
3614
|
+
}), a.on("mousemove", (w) => {
|
|
3615
|
+
x.value = w.latlng;
|
|
3616
|
+
}), a.on("zoomend", () => {
|
|
3617
|
+
c.value = a.getZoom();
|
|
3635
3618
|
});
|
|
3636
|
-
const
|
|
3637
|
-
if (
|
|
3638
|
-
const
|
|
3639
|
-
L.geoJSON(
|
|
3619
|
+
const y = De(l.modelValue);
|
|
3620
|
+
if (y) {
|
|
3621
|
+
const w = [];
|
|
3622
|
+
L.geoJSON(y).eachLayer((h) => w.push(h)), w.length && r.addLayer(w[0]), H(), B(), S();
|
|
3640
3623
|
}
|
|
3641
3624
|
});
|
|
3642
|
-
function
|
|
3643
|
-
if (
|
|
3644
|
-
switch (
|
|
3625
|
+
function X(y) {
|
|
3626
|
+
if (a) {
|
|
3627
|
+
switch (d && d.disable(), y) {
|
|
3645
3628
|
case "marker":
|
|
3646
|
-
|
|
3629
|
+
d = new L.Draw.Marker(a);
|
|
3647
3630
|
break;
|
|
3648
3631
|
case "polyline":
|
|
3649
|
-
|
|
3632
|
+
d = new L.Draw.Polyline(a);
|
|
3650
3633
|
break;
|
|
3651
3634
|
case "polygon":
|
|
3652
|
-
|
|
3635
|
+
d = new L.Draw.Polygon(a);
|
|
3653
3636
|
break;
|
|
3654
3637
|
case "rectangle":
|
|
3655
|
-
|
|
3638
|
+
d = new L.Draw.Rectangle(a);
|
|
3656
3639
|
break;
|
|
3657
3640
|
default:
|
|
3658
|
-
|
|
3641
|
+
d = new L.Draw.Rectangle(a);
|
|
3659
3642
|
break;
|
|
3660
3643
|
}
|
|
3661
|
-
|
|
3644
|
+
d && (d.enable(), v.value = y);
|
|
3662
3645
|
}
|
|
3663
3646
|
}
|
|
3664
|
-
function
|
|
3665
|
-
const
|
|
3666
|
-
|
|
3647
|
+
function re() {
|
|
3648
|
+
const y = r.toGeoJSON(), w = new Blob([JSON.stringify(y, null, 2)], { type: "application/json" }), h = URL.createObjectURL(w), g = document.createElement("a");
|
|
3649
|
+
g.href = h, g.download = "data.geojson", g.click(), URL.revokeObjectURL(h);
|
|
3667
3650
|
}
|
|
3668
|
-
function
|
|
3669
|
-
const
|
|
3670
|
-
if (!
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3673
|
-
if (typeof
|
|
3651
|
+
function Be(y) {
|
|
3652
|
+
const w = y.target.files?.[0];
|
|
3653
|
+
if (!w) return;
|
|
3654
|
+
const h = new FileReader();
|
|
3655
|
+
h.onload = () => {
|
|
3656
|
+
if (typeof h.result == "string")
|
|
3674
3657
|
try {
|
|
3675
|
-
const
|
|
3658
|
+
const g = JSON.parse(h.result);
|
|
3676
3659
|
r.clearLayers();
|
|
3677
|
-
const
|
|
3678
|
-
L.geoJSON(
|
|
3660
|
+
const E = [];
|
|
3661
|
+
L.geoJSON(g).eachLayer((Z) => E.push(Z)), E.length && r.addLayer(E[0]), H(), B(), S();
|
|
3679
3662
|
} finally {
|
|
3680
|
-
|
|
3663
|
+
y.target.value = "";
|
|
3681
3664
|
}
|
|
3682
|
-
},
|
|
3665
|
+
}, h.readAsText(w);
|
|
3683
3666
|
}
|
|
3684
|
-
function
|
|
3685
|
-
|
|
3667
|
+
function ye(y) {
|
|
3668
|
+
a && (O && a.removeLayer(O), O = L.tileLayer(I[y].url, { maxZoom: 19, minZoom: 6 }).addTo(a), D.value = y);
|
|
3686
3669
|
}
|
|
3687
|
-
function
|
|
3688
|
-
const
|
|
3689
|
-
|
|
3670
|
+
function Ce(y) {
|
|
3671
|
+
const w = L.latLng(y[0], y[1]);
|
|
3672
|
+
a.setView(w, 13);
|
|
3690
3673
|
}
|
|
3691
|
-
|
|
3692
|
-
() =>
|
|
3693
|
-
(
|
|
3694
|
-
const
|
|
3695
|
-
if (r.clearLayers(),
|
|
3696
|
-
const
|
|
3697
|
-
L.geoJSON(
|
|
3674
|
+
ae(
|
|
3675
|
+
() => l.modelValue,
|
|
3676
|
+
(y) => {
|
|
3677
|
+
const w = De(y);
|
|
3678
|
+
if (r.clearLayers(), w) {
|
|
3679
|
+
const h = [];
|
|
3680
|
+
L.geoJSON(w).eachLayer((g) => h.push(g)), h.length && r.addLayer(h[0]);
|
|
3698
3681
|
}
|
|
3699
|
-
|
|
3682
|
+
m.value = r.getLayers().length, B(), S();
|
|
3700
3683
|
}
|
|
3701
3684
|
);
|
|
3702
|
-
const
|
|
3703
|
-
return (
|
|
3704
|
-
class:
|
|
3685
|
+
const ce = _(!1);
|
|
3686
|
+
return (y, w) => (i(), u("div", {
|
|
3687
|
+
class: C(["leaflet-map-wrapper relative w-full h-[600px]", { fullscreen: ce.value }])
|
|
3705
3688
|
}, [
|
|
3706
|
-
|
|
3689
|
+
t("div", {
|
|
3707
3690
|
ref_key: "mapContainer",
|
|
3708
3691
|
ref: n,
|
|
3709
3692
|
class: "w-full h-full"
|
|
3710
3693
|
}, null, 512),
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3694
|
+
t("div", ms, [
|
|
3695
|
+
V(is, { onGoToCoordinates: Ce }),
|
|
3696
|
+
t("div", hs, [
|
|
3697
|
+
t("div", vs, [
|
|
3698
|
+
t("button", {
|
|
3716
3699
|
type: "button",
|
|
3717
3700
|
class: "vs-btn-row",
|
|
3718
|
-
onClick:
|
|
3701
|
+
onClick: b
|
|
3719
3702
|
}, "Імпорт"),
|
|
3720
|
-
|
|
3703
|
+
t("button", {
|
|
3721
3704
|
type: "button",
|
|
3722
3705
|
class: "vs-btn-row",
|
|
3723
|
-
onClick:
|
|
3724
|
-
disabled:
|
|
3725
|
-
}, "Експорт ", 8,
|
|
3706
|
+
onClick: re,
|
|
3707
|
+
disabled: m.value === 0
|
|
3708
|
+
}, "Експорт ", 8, gs)
|
|
3726
3709
|
]),
|
|
3727
|
-
|
|
3710
|
+
t("input", {
|
|
3728
3711
|
ref_key: "importRef",
|
|
3729
|
-
ref:
|
|
3712
|
+
ref: p,
|
|
3730
3713
|
type: "file",
|
|
3731
|
-
onChange:
|
|
3714
|
+
onChange: Be,
|
|
3732
3715
|
accept: ".json,.geojson",
|
|
3733
3716
|
class: "hidden"
|
|
3734
3717
|
}, null, 544)
|
|
3735
3718
|
])
|
|
3736
3719
|
]),
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
class:
|
|
3741
|
-
"aria-pressed":
|
|
3720
|
+
t("div", ys, [
|
|
3721
|
+
t("div", bs, [
|
|
3722
|
+
t("button", {
|
|
3723
|
+
class: C(["vs-btn", { "vs-active": v.value === "marker" }]),
|
|
3724
|
+
"aria-pressed": v.value === "marker",
|
|
3742
3725
|
title: "Point (P)",
|
|
3743
3726
|
"aria-label": "Draw point",
|
|
3744
|
-
onClick:
|
|
3727
|
+
onClick: w[0] || (w[0] = (h) => X("marker"))
|
|
3745
3728
|
}, [
|
|
3746
|
-
|
|
3747
|
-
], 10,
|
|
3748
|
-
|
|
3749
|
-
class:
|
|
3750
|
-
"aria-pressed":
|
|
3729
|
+
V(Bn)
|
|
3730
|
+
], 10, xs),
|
|
3731
|
+
t("button", {
|
|
3732
|
+
class: C(["vs-btn", { "vs-active": v.value === "polyline" }]),
|
|
3733
|
+
"aria-pressed": v.value === "polyline",
|
|
3751
3734
|
title: "Line (L)",
|
|
3752
3735
|
"aria-label": "Draw polyline",
|
|
3753
|
-
onClick:
|
|
3736
|
+
onClick: w[1] || (w[1] = (h) => X("polyline"))
|
|
3754
3737
|
}, [
|
|
3755
|
-
|
|
3756
|
-
], 10,
|
|
3757
|
-
|
|
3758
|
-
class:
|
|
3759
|
-
"aria-pressed":
|
|
3738
|
+
V(Ln)
|
|
3739
|
+
], 10, ws),
|
|
3740
|
+
t("button", {
|
|
3741
|
+
class: C(["vs-btn", { "vs-active": v.value === "polygon" }]),
|
|
3742
|
+
"aria-pressed": v.value === "polygon",
|
|
3760
3743
|
title: "Polygon (G)",
|
|
3761
3744
|
"aria-label": "Draw polygon",
|
|
3762
|
-
onClick:
|
|
3745
|
+
onClick: w[2] || (w[2] = (h) => X("polygon"))
|
|
3763
3746
|
}, [
|
|
3764
|
-
|
|
3765
|
-
], 10,
|
|
3766
|
-
|
|
3767
|
-
class:
|
|
3768
|
-
"aria-pressed":
|
|
3747
|
+
V(En)
|
|
3748
|
+
], 10, ks),
|
|
3749
|
+
t("button", {
|
|
3750
|
+
class: C(["vs-btn", { "vs-active": v.value === "rectangle" }]),
|
|
3751
|
+
"aria-pressed": v.value === "rectangle",
|
|
3769
3752
|
title: "Rectangle (R)",
|
|
3770
3753
|
"aria-label": "Draw rectangle",
|
|
3771
|
-
onClick:
|
|
3754
|
+
onClick: w[3] || (w[3] = (h) => X("rectangle"))
|
|
3772
3755
|
}, [
|
|
3773
|
-
|
|
3774
|
-
], 10,
|
|
3775
|
-
|
|
3756
|
+
V(Fn)
|
|
3757
|
+
], 10, _s),
|
|
3758
|
+
t("button", {
|
|
3776
3759
|
class: "vs-btn",
|
|
3777
|
-
onClick:
|
|
3760
|
+
onClick: w[4] || (w[4] = (h) => ce.value = !ce.value)
|
|
3778
3761
|
}, [
|
|
3779
|
-
|
|
3762
|
+
V(Rn, { style: { width: "12px", height: "12px" } })
|
|
3780
3763
|
])
|
|
3781
3764
|
])
|
|
3782
3765
|
]),
|
|
3783
|
-
|
|
3784
|
-
class:
|
|
3766
|
+
t("div", {
|
|
3767
|
+
class: C(["absolute left-4 z-[1000]", f.value ? "bottom-8" : "bottom-4"])
|
|
3785
3768
|
}, [
|
|
3786
|
-
|
|
3787
|
-
basemaps:
|
|
3769
|
+
V(fs, {
|
|
3770
|
+
basemaps: I,
|
|
3788
3771
|
"default-layer": "topo100",
|
|
3789
|
-
onOnLayerChange:
|
|
3772
|
+
onOnLayerChange: ye
|
|
3790
3773
|
})
|
|
3791
3774
|
], 2),
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3775
|
+
t("div", $s, [
|
|
3776
|
+
f.value ? (i(), u("div", Bs, [
|
|
3777
|
+
t("div", Cs, [
|
|
3778
|
+
w[7] || (w[7] = le(" Тип: ")),
|
|
3779
|
+
t("span", Vs, z(f.value.type), 1)
|
|
3797
3780
|
]),
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3781
|
+
t("div", Ms, [
|
|
3782
|
+
t("div", Ls, [
|
|
3783
|
+
w[8] || (w[8] = le(" Центр: ")),
|
|
3784
|
+
t("b", null, z(f.value.center.lat.toFixed(5)) + ", " + z(f.value.center.lng.toFixed(5)), 1)
|
|
3802
3785
|
]),
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
])) : (
|
|
3807
|
-
|
|
3808
|
-
|
|
3786
|
+
f.value.areaKm2 !== null ? (i(), u("div", Ss, [
|
|
3787
|
+
w[9] || (w[9] = le(" Площа: ")),
|
|
3788
|
+
t("b", null, z(f.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3789
|
+
])) : (i(), u("div", js, w[10] || (w[10] = [
|
|
3790
|
+
le(" Площа: "),
|
|
3791
|
+
t("b", null, "—", -1)
|
|
3809
3792
|
]))),
|
|
3810
|
-
|
|
3793
|
+
t("button", {
|
|
3811
3794
|
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",
|
|
3812
3795
|
title: "Наблизити",
|
|
3813
|
-
onClick:
|
|
3814
|
-
},
|
|
3815
|
-
|
|
3796
|
+
onClick: w[5] || (w[5] = (h) => A())
|
|
3797
|
+
}, w[11] || (w[11] = [
|
|
3798
|
+
te('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-7d193de4><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-7d193de4></path><path d="M7 10l6 0" data-v-7d193de4></path><path d="M10 7l0 6" data-v-7d193de4></path><path d="M21 21l-6 -6" data-v-7d193de4></path></svg>', 1)
|
|
3816
3799
|
])),
|
|
3817
|
-
|
|
3800
|
+
t("button", {
|
|
3818
3801
|
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",
|
|
3819
3802
|
title: "Видалити",
|
|
3820
|
-
onClick:
|
|
3803
|
+
onClick: w[6] || (w[6] = (h) => G())
|
|
3821
3804
|
}, [
|
|
3822
|
-
|
|
3805
|
+
V($e, { class: "w-3 h-3" })
|
|
3823
3806
|
])
|
|
3824
3807
|
])
|
|
3825
|
-
])) :
|
|
3808
|
+
])) : j("", !0)
|
|
3826
3809
|
])
|
|
3827
3810
|
], 2));
|
|
3828
3811
|
}
|
|
3829
|
-
}),
|
|
3830
|
-
VsInputText:
|
|
3831
|
-
VsInputRadio:
|
|
3832
|
-
"vs-input-text":
|
|
3833
|
-
"vs-input-textarea":
|
|
3834
|
-
"vs-input-mask":
|
|
3835
|
-
"vs-input-number":
|
|
3836
|
-
"vs-input-radio":
|
|
3837
|
-
"vs-input-select":
|
|
3838
|
-
"vs-input-switcher":
|
|
3839
|
-
"vs-input-static":
|
|
3840
|
-
"vs-input-container":
|
|
3841
|
-
"vs-input-date":
|
|
3842
|
-
"vs-input-checkbox":
|
|
3843
|
-
"vs-input-file":
|
|
3844
|
-
"vs-input-html":
|
|
3845
|
-
"vs-input-email":
|
|
3846
|
-
"vs-input-datatable":
|
|
3847
|
-
"vs-input-map":
|
|
3848
|
-
"vs-input-file-list":
|
|
3849
|
-
},
|
|
3812
|
+
}), Es = /* @__PURE__ */ F(Is, [["__scopeId", "data-v-7d193de4"]]), Os = {
|
|
3813
|
+
VsInputText: Ee,
|
|
3814
|
+
VsInputRadio: Oe,
|
|
3815
|
+
"vs-input-text": Ee,
|
|
3816
|
+
"vs-input-textarea": ba,
|
|
3817
|
+
"vs-input-mask": Kt,
|
|
3818
|
+
"vs-input-number": yt,
|
|
3819
|
+
"vs-input-radio": Oe,
|
|
3820
|
+
"vs-input-select": ga,
|
|
3821
|
+
"vs-input-switcher": Ge,
|
|
3822
|
+
"vs-input-static": Jt,
|
|
3823
|
+
"vs-input-container": Xo,
|
|
3824
|
+
"vs-input-date": cl,
|
|
3825
|
+
"vs-input-checkbox": ul,
|
|
3826
|
+
"vs-input-file": Wl,
|
|
3827
|
+
"vs-input-html": Qt,
|
|
3828
|
+
"vs-input-email": el,
|
|
3829
|
+
"vs-input-datatable": xn,
|
|
3830
|
+
"vs-input-map": Es,
|
|
3831
|
+
"vs-input-file-list": Vo
|
|
3832
|
+
}, zs = /* @__PURE__ */ M({
|
|
3850
3833
|
__name: "behavior",
|
|
3851
3834
|
props: {
|
|
3852
3835
|
api: {},
|
|
@@ -3856,31 +3839,31 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3856
3839
|
value: {}
|
|
3857
3840
|
},
|
|
3858
3841
|
setup(o) {
|
|
3859
|
-
const e = o,
|
|
3860
|
-
async function
|
|
3842
|
+
const e = o, l = xe("values");
|
|
3843
|
+
async function s() {
|
|
3861
3844
|
try {
|
|
3862
3845
|
if (!e.api) return;
|
|
3863
|
-
const n = e.api.replace("{{value}}", e.value),
|
|
3864
|
-
if (!
|
|
3865
|
-
|
|
3846
|
+
const n = e.api.replace("{{value}}", e.value), a = await fetch(n);
|
|
3847
|
+
if (!a.ok) {
|
|
3848
|
+
we({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
3866
3849
|
return;
|
|
3867
3850
|
}
|
|
3868
|
-
const r = await
|
|
3869
|
-
if (!e.set || !
|
|
3870
|
-
for (const [
|
|
3871
|
-
|
|
3851
|
+
const r = await a.json();
|
|
3852
|
+
if (!e.set || !l) return;
|
|
3853
|
+
for (const [d, p] of Object.entries(e.set))
|
|
3854
|
+
l.value[d] = r.result[p];
|
|
3872
3855
|
} catch (n) {
|
|
3873
3856
|
console.error(e.error, n);
|
|
3874
3857
|
}
|
|
3875
3858
|
}
|
|
3876
|
-
return (n,
|
|
3877
|
-
onClick:
|
|
3859
|
+
return (n, a) => (i(), u("button", {
|
|
3860
|
+
onClick: s,
|
|
3878
3861
|
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"
|
|
3879
|
-
},
|
|
3862
|
+
}, z(n.button), 1));
|
|
3880
3863
|
}
|
|
3881
|
-
}),
|
|
3864
|
+
}), As = { class: "flex" }, Ke = /* @__PURE__ */ M({
|
|
3882
3865
|
__name: "vs-compact-form-layout",
|
|
3883
|
-
props: /* @__PURE__ */
|
|
3866
|
+
props: /* @__PURE__ */ P({
|
|
3884
3867
|
item: { default: {} },
|
|
3885
3868
|
layout: { default: "default" },
|
|
3886
3869
|
style: { default: {} },
|
|
@@ -3892,57 +3875,55 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3892
3875
|
}),
|
|
3893
3876
|
emits: ["update:modelValue"],
|
|
3894
3877
|
setup(o) {
|
|
3895
|
-
const e = o,
|
|
3896
|
-
const
|
|
3897
|
-
if (!i) return /* @__PURE__ */ new Set();
|
|
3898
|
-
const d = i.props ?? i.__vccOpts?.props;
|
|
3878
|
+
const e = o, l = R(o, "modelValue"), s = T(() => ht[`${e.layout}`]), n = T(() => Os?.[`vs-input-${e.item.type}`]), a = T(() => {
|
|
3879
|
+
const d = U(n);
|
|
3899
3880
|
if (!d) return /* @__PURE__ */ new Set();
|
|
3900
|
-
const
|
|
3901
|
-
return new Set(
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3881
|
+
const p = d.props ?? d.__vccOpts?.props;
|
|
3882
|
+
if (!p) return /* @__PURE__ */ new Set();
|
|
3883
|
+
const x = Array.isArray(p) ? p : Object.keys(p);
|
|
3884
|
+
return new Set(x);
|
|
3885
|
+
}), r = T(() => {
|
|
3886
|
+
const d = e.item ?? {}, p = a.value;
|
|
3887
|
+
return p.size ? Object.fromEntries(Object.entries(d).filter(([x]) => p.has(x))) : {};
|
|
3905
3888
|
});
|
|
3906
|
-
return (
|
|
3889
|
+
return (d, p) => (i(), K(de(s.value), {
|
|
3907
3890
|
ua: e.item.ua,
|
|
3908
|
-
error: e.error,
|
|
3891
|
+
error: e.error || "",
|
|
3892
|
+
item: d.item,
|
|
3909
3893
|
label: e.item.label
|
|
3910
3894
|
}, {
|
|
3911
|
-
default:
|
|
3912
|
-
|
|
3913
|
-
(
|
|
3914
|
-
modelValue:
|
|
3915
|
-
"onUpdate:modelValue":
|
|
3895
|
+
default: ge(() => [
|
|
3896
|
+
t("div", As, [
|
|
3897
|
+
(i(), K(de(n.value), me(r.value, {
|
|
3898
|
+
modelValue: l.value,
|
|
3899
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => l.value = x)
|
|
3916
3900
|
}), null, 16, ["modelValue"])),
|
|
3917
|
-
|
|
3901
|
+
d.item.behavior ? (i(), K(zs, me({ key: 0 }, d.item.behavior, { value: l.value }), null, 16, ["value"])) : j("", !0)
|
|
3918
3902
|
])
|
|
3919
3903
|
]),
|
|
3920
3904
|
_: 1
|
|
3921
|
-
}, 8, ["ua", "error", "label"]));
|
|
3905
|
+
}, 8, ["ua", "error", "item", "label"]));
|
|
3922
3906
|
}
|
|
3923
|
-
}),
|
|
3907
|
+
}), We = {
|
|
3924
3908
|
required: "Це поле є обов’язковим",
|
|
3925
3909
|
email: "Неправильний email"
|
|
3926
|
-
},
|
|
3927
|
-
const
|
|
3928
|
-
return !(typeof
|
|
3929
|
-
},
|
|
3930
|
-
const func = eval(customRule.function);
|
|
3931
|
-
return func(value) ? !1 : customRule.message;
|
|
3932
|
-
}, checkFormRules = (o, e) => {
|
|
3910
|
+
}, Fs = (o) => o ? !1 : We.required, Ds = (o) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) && o ? We.email : !1, Ts = (o, e) => {
|
|
3911
|
+
const l = e.pattern ?? e.regexp;
|
|
3912
|
+
return !(typeof l == "string" ? new RegExp(l) : l).test(o) && o ? e.message : !1;
|
|
3913
|
+
}, Us = (o, e) => !1, Rs = (o, e) => {
|
|
3933
3914
|
switch (typeof e == "string" ? e : e.type) {
|
|
3934
3915
|
case "required":
|
|
3935
|
-
return
|
|
3916
|
+
return Fs(o);
|
|
3936
3917
|
case "email":
|
|
3937
|
-
return
|
|
3918
|
+
return Ds(o);
|
|
3938
3919
|
case "regexp":
|
|
3939
|
-
return
|
|
3920
|
+
return Ts(o, e);
|
|
3940
3921
|
case "custom":
|
|
3941
|
-
return
|
|
3922
|
+
return Us();
|
|
3942
3923
|
default:
|
|
3943
3924
|
return !1;
|
|
3944
3925
|
}
|
|
3945
|
-
},
|
|
3926
|
+
}, Hs = {
|
|
3946
3927
|
autocomplete: "select",
|
|
3947
3928
|
combobox: "select",
|
|
3948
3929
|
datepicker: "date",
|
|
@@ -3953,63 +3934,63 @@ const IconFullScreen = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc
|
|
|
3953
3934
|
file: "file"
|
|
3954
3935
|
// mask: 'text',
|
|
3955
3936
|
};
|
|
3956
|
-
function
|
|
3937
|
+
function Te(o) {
|
|
3957
3938
|
const e = o.toLowerCase();
|
|
3958
|
-
return
|
|
3939
|
+
return Hs[e] || e;
|
|
3959
3940
|
}
|
|
3960
|
-
function
|
|
3941
|
+
function Ps(o) {
|
|
3961
3942
|
if (Array.isArray(o)) {
|
|
3962
|
-
const
|
|
3963
|
-
return o.forEach((
|
|
3964
|
-
const n = { ...
|
|
3965
|
-
n.name = (
|
|
3966
|
-
}),
|
|
3943
|
+
const l = [];
|
|
3944
|
+
return o.forEach((s) => {
|
|
3945
|
+
const n = { ...s };
|
|
3946
|
+
n.name = (s.name || s.id || s.key).toString(), n.type = Te(s.type), n.label = s.label || s.ua, n.rules = s.rules || s.validators, s.data && (n.api = `/api/suggest/${s.data}`), l.push(n);
|
|
3947
|
+
}), l;
|
|
3967
3948
|
}
|
|
3968
3949
|
const e = [];
|
|
3969
|
-
return Object.entries(o).forEach((
|
|
3970
|
-
const
|
|
3971
|
-
name:
|
|
3972
|
-
...
|
|
3973
|
-
type:
|
|
3974
|
-
label:
|
|
3975
|
-
rules:
|
|
3950
|
+
return Object.entries(o).forEach((l) => {
|
|
3951
|
+
const s = {
|
|
3952
|
+
name: l[0],
|
|
3953
|
+
...l[1],
|
|
3954
|
+
type: Te(l[1].type),
|
|
3955
|
+
label: l[1].label || l[1].ua,
|
|
3956
|
+
rules: l[1].rules || l[1].validators
|
|
3976
3957
|
};
|
|
3977
|
-
|
|
3958
|
+
l[1].type.includes("list") && (s.multiple = !0), l[1].data && (s.api = `/api/suggest/${l[1].data}`), e.push(s);
|
|
3978
3959
|
}), e;
|
|
3979
3960
|
}
|
|
3980
|
-
function
|
|
3981
|
-
const
|
|
3982
|
-
function n(
|
|
3983
|
-
const
|
|
3984
|
-
if (!
|
|
3985
|
-
const
|
|
3986
|
-
return
|
|
3961
|
+
function Ns(o, e) {
|
|
3962
|
+
const l = Ps(e), s = _({});
|
|
3963
|
+
function n(p) {
|
|
3964
|
+
const x = p?.conditions;
|
|
3965
|
+
if (!x) return !0;
|
|
3966
|
+
const c = Array.isArray(x) ? x[0] : x, m = o?.value?.[c];
|
|
3967
|
+
return Ze(m, x);
|
|
3987
3968
|
}
|
|
3988
|
-
const
|
|
3989
|
-
if (
|
|
3990
|
-
if (!n(
|
|
3991
|
-
console.log(
|
|
3969
|
+
const a = (p = l, x = !0) => (p.forEach((c) => {
|
|
3970
|
+
if (c.rules) {
|
|
3971
|
+
if (!n(c)) {
|
|
3972
|
+
console.log(c.name, "skip hidden"), delete s.value[c.name];
|
|
3992
3973
|
return;
|
|
3993
3974
|
}
|
|
3994
|
-
|
|
3995
|
-
const
|
|
3996
|
-
|
|
3975
|
+
c.rules.forEach((m) => {
|
|
3976
|
+
const f = Rs(o.value[c.name], m);
|
|
3977
|
+
f ? s.value[c.name] = f : delete s.value[c.name];
|
|
3997
3978
|
});
|
|
3998
3979
|
}
|
|
3999
|
-
|
|
4000
|
-
}),
|
|
3980
|
+
c.schema && a(c.schema, !1);
|
|
3981
|
+
}), x && Object.values(s.value).some(Boolean) ? s.value : null), r = T(() => l?.filter((p) => n(p)));
|
|
4001
3982
|
return {
|
|
4002
|
-
errors:
|
|
4003
|
-
validate:
|
|
3983
|
+
errors: s,
|
|
3984
|
+
validate: a,
|
|
4004
3985
|
reset: () => {
|
|
4005
|
-
o.value = {},
|
|
3986
|
+
o.value = {}, s.value = {};
|
|
4006
3987
|
},
|
|
4007
3988
|
visibleSchema: r
|
|
4008
3989
|
};
|
|
4009
3990
|
}
|
|
4010
|
-
const
|
|
3991
|
+
const Ve = /* @__PURE__ */ M({
|
|
4011
3992
|
__name: "vs-compact-form",
|
|
4012
|
-
props: /* @__PURE__ */
|
|
3993
|
+
props: /* @__PURE__ */ P({
|
|
4013
3994
|
schema: { default: () => [] },
|
|
4014
3995
|
style: { default: () => ({}) },
|
|
4015
3996
|
layout: { default: () => "default" },
|
|
@@ -4020,50 +4001,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4020
4001
|
values: { default: () => ({}) },
|
|
4021
4002
|
valuesModifiers: {}
|
|
4022
4003
|
}),
|
|
4023
|
-
emits: /* @__PURE__ */
|
|
4004
|
+
emits: /* @__PURE__ */ P(["handle-submit"], ["update:form", "update:values"]),
|
|
4024
4005
|
setup(o, { emit: e }) {
|
|
4025
|
-
const
|
|
4006
|
+
const l = e, s = o, n = R(o, "form"), a = R(o, "values"), {
|
|
4026
4007
|
errors: r,
|
|
4027
|
-
validate:
|
|
4028
|
-
reset:
|
|
4029
|
-
visibleSchema:
|
|
4030
|
-
} =
|
|
4031
|
-
|
|
4008
|
+
validate: d,
|
|
4009
|
+
reset: p,
|
|
4010
|
+
visibleSchema: x
|
|
4011
|
+
} = Ns(a, s.schema), c = () => {
|
|
4012
|
+
d(), l("handle-submit", a.value);
|
|
4032
4013
|
};
|
|
4033
|
-
|
|
4034
|
-
n.value.value =
|
|
4014
|
+
oe(() => {
|
|
4015
|
+
n.value.value = a.value, n.value.errors = r.value, n.value.reset = p, n.value.validate = d, n.value.formId = s.formId;
|
|
4035
4016
|
});
|
|
4036
|
-
function
|
|
4037
|
-
if (
|
|
4038
|
-
if (typeof
|
|
4039
|
-
const
|
|
4040
|
-
return
|
|
4017
|
+
function m(f, I) {
|
|
4018
|
+
if (f === I) return !0;
|
|
4019
|
+
if (typeof f != "object" || typeof I != "object" || !f || !I) return !1;
|
|
4020
|
+
const O = Object.keys(f), D = Object.keys(I);
|
|
4021
|
+
return O.length !== D.length ? !1 : O.every((N) => f[N] === I[N]);
|
|
4041
4022
|
}
|
|
4042
|
-
return
|
|
4043
|
-
onSubmit:
|
|
4044
|
-
class:
|
|
4023
|
+
return Ie("form", n), Ie("values", a), (f, I) => (i(), u("form", {
|
|
4024
|
+
onSubmit: _e(c, ["prevent"]),
|
|
4025
|
+
class: C(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
4045
4026
|
}, [
|
|
4046
|
-
(
|
|
4047
|
-
key:
|
|
4048
|
-
class:
|
|
4049
|
-
style:
|
|
4050
|
-
item:
|
|
4051
|
-
layout:
|
|
4052
|
-
"model-value":
|
|
4053
|
-
"onUpdate:modelValue": (
|
|
4054
|
-
const
|
|
4055
|
-
|
|
4027
|
+
(i(!0), u(W, null, Q(U(x), (O) => (i(), K(Ke, {
|
|
4028
|
+
key: O.name,
|
|
4029
|
+
class: C(f.layout === "horizontal" ? "col-span-12" : `col-span-${O.col || 12} `),
|
|
4030
|
+
style: ve(f.style),
|
|
4031
|
+
item: O,
|
|
4032
|
+
layout: f.layout,
|
|
4033
|
+
"model-value": a.value[O.name],
|
|
4034
|
+
"onUpdate:modelValue": (D) => {
|
|
4035
|
+
const N = a.value[O.name];
|
|
4036
|
+
m(N, D) || (a.value[O.name] = D);
|
|
4056
4037
|
},
|
|
4057
|
-
error:
|
|
4038
|
+
error: U(r)[O.name]
|
|
4058
4039
|
}, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
|
|
4059
4040
|
], 34));
|
|
4060
4041
|
}
|
|
4061
4042
|
});
|
|
4062
|
-
|
|
4063
|
-
e.component("VForm",
|
|
4043
|
+
Ve.install = function(e) {
|
|
4044
|
+
e.component("VForm", Ve), e.config.globalProperties.$form = he, e.provide("form", he), window.v3plugin || (window.v3plugin = {}), window.v3plugin.$form = e.config.globalProperties.$form;
|
|
4064
4045
|
};
|
|
4065
4046
|
export {
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4047
|
+
ra as ModalEdit,
|
|
4048
|
+
Ve as VForm,
|
|
4049
|
+
Ee as VsInputText,
|
|
4050
|
+
Ve as default
|
|
4069
4051
|
};
|