@opengis/form 0.0.20 → 0.0.23
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/inputs/base/vs-input-mask.vue.d.ts.map +1 -1
- package/dist/components/inputs/date/vs-input-date.vue.d.ts.map +1 -1
- package/dist/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -1
- package/dist/components/inputs/vs-input-select.vue.d.ts.map +1 -1
- package/dist/components/layouts/vs-layout-default.vue.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1289 -1268
- package/dist/index.umd.cjs +3 -2
- package/dist/plugin/form-plugin.d.ts +1 -1
- package/dist/plugin/form-plugin.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/components/ui/vs-popover.vue.d.ts +0 -89
- package/dist/components/ui/vs-popover.vue.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { notify as
|
|
3
|
-
const mt = {
|
|
1
|
+
import { defineComponent as O, ref as x, onMounted as ue, onUnmounted as Ee, createElementBlock as u, openBlock as i, normalizeClass as V, createCommentVNode as j, renderSlot as ge, createElementVNode as l, toDisplayString as F, normalizeProps as Fe, guardReactiveProps as De, createTextVNode as se, computed as D, mergeModels as Q, useModel as X, withDirectives as K, unref as J, vModelText as de, vModelCheckbox as Ye, createVNode as B, createBlock as te, resolveDynamicComponent as _e, normalizeStyle as he, withCtx as $e, withModifiers as ne, onBeforeUnmount as dt, watch as ie, createStaticVNode as re, vModelRadio as et, Fragment as ee, renderList as le, mergeProps as Le, reactive as ct, vShow as Ue, inject as Be, resolveComponent as Ne, Transition as tt, nextTick as Me, Teleport as pt, provide as He } from "vue";
|
|
2
|
+
import { notify as pe, modal as ft, TooltipDirective as qe, VsModal as vt } from "@opengis/core";
|
|
3
|
+
const mt = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
6
|
-
}, gt = {
|
|
6
|
+
}, ht = { class: "opacity-100" }, gt = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-red-500 text-[14px]"
|
|
9
9
|
}, bt = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
12
|
-
}, yt = /* @__PURE__ */
|
|
12
|
+
}, yt = /* @__PURE__ */ O({
|
|
13
13
|
__name: "vs-layout-default",
|
|
14
14
|
props: {
|
|
15
15
|
ua: { default: "" },
|
|
@@ -23,21 +23,23 @@ const mt = { class: "w-full relative" }, ht = {
|
|
|
23
23
|
label: { default: "" }
|
|
24
24
|
},
|
|
25
25
|
setup(o) {
|
|
26
|
-
const e =
|
|
26
|
+
const e = x("uk"), t = (n) => {
|
|
27
27
|
n.detail.key === "locale" && (e.value = n.detail.newValue);
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return ue(() => {
|
|
30
30
|
e.value = localStorage.locale, window.addEventListener("storage", t);
|
|
31
|
-
}),
|
|
31
|
+
}), Ee(() => {
|
|
32
32
|
window.removeEventListener("resize", t);
|
|
33
|
-
}), (n,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
}), (n, s) => (i(), u("div", {
|
|
34
|
+
class: V(["w-full relative", { "opacity-60": n.item.disabled }])
|
|
35
|
+
}, [
|
|
36
|
+
n.ua || n.label ? (i(), u("div", mt, [
|
|
37
|
+
l("span", ht, F(n.item[e.value] || n.ua || n.label), 1),
|
|
38
|
+
n.item?.rules?.includes("required") ? (i(), u("span", gt, "*")) : j("", !0)
|
|
39
|
+
])) : j("", !0),
|
|
40
|
+
ge(n.$slots, "default", Fe(De(n.$attrs))),
|
|
41
|
+
n.error ? (i(), u("span", bt, F(n.error), 1)) : j("", !0)
|
|
42
|
+
], 2));
|
|
41
43
|
}
|
|
42
44
|
}), xt = { class: "w-full relative flex flex-row items-center gap-2" }, wt = {
|
|
43
45
|
key: 0,
|
|
@@ -48,7 +50,7 @@ const mt = { class: "w-full relative" }, ht = {
|
|
|
48
50
|
}, _t = {
|
|
49
51
|
key: 1,
|
|
50
52
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
51
|
-
}, $t = /* @__PURE__ */
|
|
53
|
+
}, $t = /* @__PURE__ */ O({
|
|
52
54
|
__name: "vs-layout-horizontal",
|
|
53
55
|
props: {
|
|
54
56
|
ua: { default: "" },
|
|
@@ -64,17 +66,17 @@ const mt = { class: "w-full relative" }, ht = {
|
|
|
64
66
|
setup(o) {
|
|
65
67
|
return (e, t) => (i(), u("div", xt, [
|
|
66
68
|
e.item?.type !== "html" ? (i(), u("span", wt, [
|
|
67
|
-
|
|
68
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", kt, "*")) :
|
|
69
|
-
])) :
|
|
70
|
-
|
|
71
|
-
e.error ? (i(), u("span", _t,
|
|
69
|
+
se(F(e.ua || e.label) + " ", 1),
|
|
70
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", kt, "*")) : j("", !0)
|
|
71
|
+
])) : j("", !0),
|
|
72
|
+
ge(e.$slots, "default", Fe(De(e.$attrs))),
|
|
73
|
+
e.error ? (i(), u("span", _t, F(e.error), 1)) : j("", !0)
|
|
72
74
|
]));
|
|
73
75
|
}
|
|
74
76
|
}), Ct = { class: "w-full relative" }, Vt = {
|
|
75
77
|
key: 0,
|
|
76
78
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
77
|
-
}, Mt = /* @__PURE__ */
|
|
79
|
+
}, Mt = /* @__PURE__ */ O({
|
|
78
80
|
__name: "vs-layout-inline",
|
|
79
81
|
props: {
|
|
80
82
|
ua: { default: "" },
|
|
@@ -89,8 +91,8 @@ const mt = { class: "w-full relative" }, ht = {
|
|
|
89
91
|
},
|
|
90
92
|
setup(o) {
|
|
91
93
|
return (e, t) => (i(), u("div", Ct, [
|
|
92
|
-
|
|
93
|
-
e.error ? (i(), u("span", Vt,
|
|
94
|
+
ge(e.$slots, "default", Fe(De(e.$attrs))),
|
|
95
|
+
e.error ? (i(), u("span", Vt, F(e.error), 1)) : j("", !0)
|
|
94
96
|
]));
|
|
95
97
|
}
|
|
96
98
|
}), Lt = {
|
|
@@ -98,17 +100,17 @@ const mt = { class: "w-full relative" }, ht = {
|
|
|
98
100
|
horizontal: $t,
|
|
99
101
|
inline: Mt
|
|
100
102
|
};
|
|
101
|
-
function
|
|
103
|
+
function be(o) {
|
|
102
104
|
return {
|
|
103
|
-
inputClass:
|
|
105
|
+
inputClass: D(() => {
|
|
104
106
|
const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
105
107
|
return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
|
|
106
108
|
})
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
|
-
const St = ["placeholder", "disabled"],
|
|
111
|
+
const St = ["placeholder", "disabled"], Ge = /* @__PURE__ */ O({
|
|
110
112
|
__name: "vs-input-text",
|
|
111
|
-
props: /* @__PURE__ */
|
|
113
|
+
props: /* @__PURE__ */ Q({
|
|
112
114
|
style: { default: () => ({}) },
|
|
113
115
|
customClass: { default: "" },
|
|
114
116
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -122,23 +124,23 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ A({
|
|
|
122
124
|
}),
|
|
123
125
|
emits: ["update:modelValue"],
|
|
124
126
|
setup(o) {
|
|
125
|
-
const e = o, { inputClass: t } =
|
|
126
|
-
return (
|
|
127
|
+
const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
|
|
128
|
+
return (s, a) => K((i(), u("input", {
|
|
127
129
|
type: "text",
|
|
128
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
129
|
-
placeholder:
|
|
130
|
-
disabled:
|
|
131
|
-
class:
|
|
130
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
|
|
131
|
+
placeholder: s.placeholder,
|
|
132
|
+
disabled: s.disabled,
|
|
133
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t), { "!border-red-600": s.error }]]),
|
|
132
134
|
style: {
|
|
133
135
|
border: "1px solid #CFD9E0"
|
|
134
136
|
}
|
|
135
137
|
}, null, 10, St)), [
|
|
136
|
-
[
|
|
138
|
+
[de, n.value]
|
|
137
139
|
]);
|
|
138
140
|
}
|
|
139
|
-
}), Bt = ["placeholder"], jt = /* @__PURE__ */
|
|
141
|
+
}), Bt = ["placeholder"], jt = /* @__PURE__ */ O({
|
|
140
142
|
__name: "vs-input-number",
|
|
141
|
-
props: /* @__PURE__ */
|
|
143
|
+
props: /* @__PURE__ */ Q({
|
|
142
144
|
style: { default: () => ({}) },
|
|
143
145
|
customClass: {},
|
|
144
146
|
disabled: { type: Boolean },
|
|
@@ -152,26 +154,26 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ A({
|
|
|
152
154
|
}),
|
|
153
155
|
emits: ["update:modelValue"],
|
|
154
156
|
setup(o) {
|
|
155
|
-
const e = o, { inputClass: t } =
|
|
156
|
-
return (
|
|
157
|
+
const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
|
|
158
|
+
return (s, a) => K((i(), u("input", {
|
|
157
159
|
type: "number",
|
|
158
160
|
step: "any",
|
|
159
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
160
|
-
placeholder:
|
|
161
|
-
class:
|
|
161
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
|
|
162
|
+
placeholder: s.placeholder,
|
|
163
|
+
class: V(["py-1.5 px-3 block w-full", [J(t)]]),
|
|
162
164
|
style: {
|
|
163
165
|
border: "1px solid #CFD9E0"
|
|
164
166
|
}
|
|
165
167
|
}, null, 10, Bt)), [
|
|
166
|
-
[
|
|
168
|
+
[de, n.value]
|
|
167
169
|
]);
|
|
168
170
|
}
|
|
169
171
|
}), R = (o, e) => {
|
|
170
172
|
const t = o.__vccOpts || o;
|
|
171
|
-
for (const [n,
|
|
172
|
-
t[n] =
|
|
173
|
+
for (const [n, s] of e)
|
|
174
|
+
t[n] = s;
|
|
173
175
|
return t;
|
|
174
|
-
}, It = {},
|
|
176
|
+
}, It = {}, zt = {
|
|
175
177
|
xmlns: "http://www.w3.org/2000/svg",
|
|
176
178
|
viewBox: "0 0 24 24",
|
|
177
179
|
fill: "none",
|
|
@@ -181,8 +183,8 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ A({
|
|
|
181
183
|
"stroke-linejoin": "round",
|
|
182
184
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
183
185
|
};
|
|
184
|
-
function
|
|
185
|
-
return i(), u("svg",
|
|
186
|
+
function At(o, e) {
|
|
187
|
+
return i(), u("svg", zt, e[0] || (e[0] = [
|
|
186
188
|
l("path", {
|
|
187
189
|
stroke: "none",
|
|
188
190
|
d: "M0 0h24v24H0z",
|
|
@@ -191,7 +193,7 @@ function zt(o, e) {
|
|
|
191
193
|
l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
192
194
|
]));
|
|
193
195
|
}
|
|
194
|
-
const
|
|
196
|
+
const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-center gap-[4px]" }, Ft = ["value", "id", "disabled"], Dt = ["for"], Ut = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Tt = /* @__PURE__ */ O({
|
|
195
197
|
__name: "vs-checkbox-default",
|
|
196
198
|
props: {
|
|
197
199
|
value: { default: "" },
|
|
@@ -204,36 +206,36 @@ const Et = /* @__PURE__ */ R(It, [["render", zt]]), Ft = { class: "flex items-ce
|
|
|
204
206
|
},
|
|
205
207
|
emits: ["update:modelValue"],
|
|
206
208
|
setup(o, { emit: e }) {
|
|
207
|
-
const t = e, n = o,
|
|
209
|
+
const t = e, n = o, s = D({
|
|
208
210
|
get: () => n.modelValue,
|
|
209
211
|
set: (a) => t("update:modelValue", a)
|
|
210
212
|
});
|
|
211
|
-
return (a,
|
|
212
|
-
|
|
213
|
+
return (a, r) => (i(), u("div", Et, [
|
|
214
|
+
K(l("input", {
|
|
213
215
|
type: "checkbox",
|
|
214
216
|
value: a.value,
|
|
215
|
-
"onUpdate:modelValue":
|
|
216
|
-
class:
|
|
217
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => s.value = d),
|
|
218
|
+
class: V(["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 }]),
|
|
217
219
|
id: a.id,
|
|
218
220
|
disabled: a.disabled
|
|
219
|
-
}, null, 10,
|
|
220
|
-
[
|
|
221
|
+
}, null, 10, Ft), [
|
|
222
|
+
[Ye, s.value]
|
|
221
223
|
]),
|
|
222
224
|
l("label", {
|
|
223
225
|
for: a.id,
|
|
224
|
-
class:
|
|
226
|
+
class: V(["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 }])
|
|
225
227
|
}, [
|
|
226
228
|
l("div", {
|
|
227
|
-
class:
|
|
229
|
+
class: V(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", a.error ? "border-red-600" : ""]])
|
|
228
230
|
}, [
|
|
229
|
-
|
|
231
|
+
B(Ot, {
|
|
230
232
|
height: "12",
|
|
231
233
|
width: "12"
|
|
232
234
|
})
|
|
233
235
|
], 2),
|
|
234
236
|
l("span", Ut, [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
+
ge(a.$slots, "default", {}, () => [
|
|
238
|
+
se(F(a.label), 1)
|
|
237
239
|
])
|
|
238
240
|
])
|
|
239
241
|
], 10, Dt)
|
|
@@ -242,7 +244,7 @@ const Et = /* @__PURE__ */ R(It, [["render", zt]]), Ft = { class: "flex items-ce
|
|
|
242
244
|
}), Rt = ["name", "value", "disabled"], Pt = { class: "flex items-center gap-[6px] text-[14px]" }, Nt = {
|
|
243
245
|
key: 0,
|
|
244
246
|
class: "text-[16px]"
|
|
245
|
-
}, Ht = ["src"], qt = /* @__PURE__ */
|
|
247
|
+
}, Ht = ["src"], qt = /* @__PURE__ */ O({
|
|
246
248
|
__name: "vs-checkbox-buttons",
|
|
247
249
|
props: {
|
|
248
250
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -256,46 +258,46 @@ const Et = /* @__PURE__ */ R(It, [["render", zt]]), Ft = { class: "flex items-ce
|
|
|
256
258
|
},
|
|
257
259
|
emits: ["update:modelValue"],
|
|
258
260
|
setup(o, { emit: e }) {
|
|
259
|
-
const t = o, n = e,
|
|
261
|
+
const t = o, n = e, s = D({
|
|
260
262
|
get: () => t.modelValue,
|
|
261
263
|
set: (d) => {
|
|
262
264
|
n("update:modelValue", d);
|
|
263
265
|
}
|
|
264
|
-
}), a =
|
|
266
|
+
}), a = D(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), r = D(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
265
267
|
return (d, p) => (i(), u("label", {
|
|
266
|
-
class:
|
|
268
|
+
class: V(["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"]])
|
|
267
269
|
}, [
|
|
268
|
-
|
|
270
|
+
K(l("input", {
|
|
269
271
|
type: "checkbox",
|
|
270
272
|
class: "hidden",
|
|
271
273
|
name: d.id,
|
|
272
274
|
value: d.value,
|
|
273
|
-
"onUpdate:modelValue": p[0] || (p[0] = (f) =>
|
|
275
|
+
"onUpdate:modelValue": p[0] || (p[0] = (f) => s.value = f),
|
|
274
276
|
disabled: d.disabled
|
|
275
277
|
}, null, 8, Rt), [
|
|
276
|
-
[
|
|
278
|
+
[Ye, s.value]
|
|
277
279
|
]),
|
|
278
280
|
l("span", Pt, [
|
|
279
281
|
d.icon || d.imgUrl ? (i(), u("span", Nt, [
|
|
280
282
|
d.icon ? (i(), u("i", {
|
|
281
283
|
key: 0,
|
|
282
|
-
class:
|
|
283
|
-
}, null, 2)) :
|
|
284
|
+
class: V(d.icon)
|
|
285
|
+
}, null, 2)) : j("", !0),
|
|
284
286
|
d.imgUrl ? (i(), u("img", {
|
|
285
287
|
key: 1,
|
|
286
288
|
src: d.imgUrl,
|
|
287
289
|
width: "16",
|
|
288
290
|
height: "16",
|
|
289
291
|
alt: "icon"
|
|
290
|
-
}, null, 8, Ht)) :
|
|
291
|
-
])) :
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
}, null, 8, Ht)) : j("", !0)
|
|
293
|
+
])) : j("", !0),
|
|
294
|
+
ge(d.$slots, "default", {}, () => [
|
|
295
|
+
se(F(d.label), 1)
|
|
294
296
|
])
|
|
295
297
|
])
|
|
296
298
|
], 2));
|
|
297
299
|
}
|
|
298
|
-
}), Gt = { class: "flex items-center" },
|
|
300
|
+
}), Gt = { class: "flex items-center" }, lt = /* @__PURE__ */ O({
|
|
299
301
|
__name: "vs-input-checkbox-item",
|
|
300
302
|
props: {
|
|
301
303
|
value: { default: "" },
|
|
@@ -312,7 +314,7 @@ const Et = /* @__PURE__ */ R(It, [["render", zt]]), Ft = { class: "flex items-ce
|
|
|
312
314
|
},
|
|
313
315
|
emits: ["update:modelValue"],
|
|
314
316
|
setup(o, { emit: e }) {
|
|
315
|
-
const t = o, n = e,
|
|
317
|
+
const t = o, n = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, a = D({
|
|
316
318
|
get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
|
|
317
319
|
set: (d) => {
|
|
318
320
|
if (Array.isArray(t.modelValue)) {
|
|
@@ -321,23 +323,23 @@ const Et = /* @__PURE__ */ R(It, [["render", zt]]), Ft = { class: "flex items-ce
|
|
|
321
323
|
} else
|
|
322
324
|
n("update:modelValue", d);
|
|
323
325
|
}
|
|
324
|
-
}),
|
|
326
|
+
}), r = x(`vs-checkbox-${t.view || "default"}`);
|
|
325
327
|
return (d, p) => (i(), u("div", Gt, [
|
|
326
|
-
(i(),
|
|
328
|
+
(i(), te(_e(r.value === "vs-checkbox-buttons" ? J(qt) : J(Tt)), {
|
|
327
329
|
value: d.value,
|
|
328
330
|
label: d.label,
|
|
329
331
|
info: d.option?.info,
|
|
330
332
|
disabled: d.disabled,
|
|
331
333
|
modelValue: a.value,
|
|
332
334
|
"onUpdate:modelValue": p[0] || (p[0] = (f) => a.value = f),
|
|
333
|
-
id:
|
|
335
|
+
id: s,
|
|
334
336
|
icon: d.icon,
|
|
335
337
|
imgUrl: d.imgUrl,
|
|
336
|
-
style:
|
|
338
|
+
style: he(d.style),
|
|
337
339
|
error: d.error
|
|
338
340
|
}, {
|
|
339
|
-
default:
|
|
340
|
-
|
|
341
|
+
default: $e(() => [
|
|
342
|
+
se(F(d.label), 1)
|
|
341
343
|
]),
|
|
342
344
|
_: 1
|
|
343
345
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
@@ -392,9 +394,9 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
392
394
|
}, ll = {
|
|
393
395
|
key: 0,
|
|
394
396
|
class: "text-red-500 text-[14px]"
|
|
395
|
-
}, ol = ["title"], al = ["disabled"],
|
|
397
|
+
}, ol = ["title"], al = ["disabled"], ot = /* @__PURE__ */ O({
|
|
396
398
|
__name: "vs-input-switcher",
|
|
397
|
-
props: /* @__PURE__ */
|
|
399
|
+
props: /* @__PURE__ */ Q({
|
|
398
400
|
rules: { default: () => [] },
|
|
399
401
|
view: { default: "checkbox" },
|
|
400
402
|
label: { default: "" },
|
|
@@ -413,38 +415,38 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
413
415
|
}),
|
|
414
416
|
emits: ["update:modelValue"],
|
|
415
417
|
setup(o) {
|
|
416
|
-
const e = o, t =
|
|
417
|
-
return (n,
|
|
418
|
-
|
|
418
|
+
const e = o, t = X(o, "modelValue");
|
|
419
|
+
return (n, s) => e.view === "checkbox" ? (i(), u("div", tl, [
|
|
420
|
+
B(lt, {
|
|
419
421
|
modelValue: t.value,
|
|
420
|
-
"onUpdate:modelValue":
|
|
422
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
|
|
421
423
|
label: n.text,
|
|
422
424
|
error: n.error || ""
|
|
423
425
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
424
|
-
n.rules?.includes("required") ? (i(), u("span", ll, "*")) :
|
|
426
|
+
n.rules?.includes("required") ? (i(), u("span", ll, "*")) : j("", !0),
|
|
425
427
|
n.i ? (i(), u("button", {
|
|
426
428
|
key: 1,
|
|
427
429
|
class: "cursor-pointer",
|
|
428
430
|
title: n.i,
|
|
429
|
-
onClick:
|
|
431
|
+
onClick: s[1] || (s[1] = ne(() => {
|
|
430
432
|
}, ["prevent"]))
|
|
431
433
|
}, [
|
|
432
|
-
|
|
433
|
-
], 8, ol)) :
|
|
434
|
+
B(J(el), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
435
|
+
], 8, ol)) : j("", !0)
|
|
434
436
|
])) : (i(), u("button", {
|
|
435
437
|
key: 1,
|
|
436
438
|
type: "button",
|
|
437
|
-
class:
|
|
439
|
+
class: V(["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", [t.value ? `bg-${n.style?.primaryColor || "blue"}-500` : "bg-stone-200", n.customClass]]),
|
|
438
440
|
disabled: n.disabled,
|
|
439
|
-
onClick:
|
|
441
|
+
onClick: s[2] || (s[2] = (a) => t.value = !t.value)
|
|
440
442
|
}, [
|
|
441
443
|
l("span", {
|
|
442
444
|
"data-state": "checked",
|
|
443
|
-
class:
|
|
445
|
+
class: V(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
|
|
444
446
|
}, null, 2)
|
|
445
447
|
], 10, al));
|
|
446
448
|
}
|
|
447
|
-
}),
|
|
449
|
+
}), sl = ["innerHTML"], Je = /* @__PURE__ */ O({
|
|
448
450
|
__name: "vs-input-static",
|
|
449
451
|
props: {
|
|
450
452
|
text: { default: "" },
|
|
@@ -459,13 +461,13 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
459
461
|
},
|
|
460
462
|
setup(o) {
|
|
461
463
|
return (e, t) => (i(), u("div", {
|
|
462
|
-
class:
|
|
464
|
+
class: V(e.customClass),
|
|
463
465
|
innerHTML: e.html ? e.html : e.text
|
|
464
|
-
}, null, 10,
|
|
466
|
+
}, null, 10, sl));
|
|
465
467
|
}
|
|
466
|
-
}),
|
|
468
|
+
}), rl = ["placeholder", "disabled", "name"], nl = /* @__PURE__ */ O({
|
|
467
469
|
__name: "vs-input-mask",
|
|
468
|
-
props: /* @__PURE__ */
|
|
470
|
+
props: /* @__PURE__ */ Q({
|
|
469
471
|
name: {},
|
|
470
472
|
mask: { default: "" },
|
|
471
473
|
unmask: { type: Boolean, default: !1 },
|
|
@@ -481,55 +483,54 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
481
483
|
}),
|
|
482
484
|
emits: ["update:modelValue"],
|
|
483
485
|
setup(o) {
|
|
484
|
-
const e = o, { inputClass: t } =
|
|
486
|
+
const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue"), s = x(null);
|
|
485
487
|
let a = null;
|
|
486
|
-
return
|
|
487
|
-
if (
|
|
488
|
-
const { default:
|
|
489
|
-
a = s
|
|
488
|
+
return ue(async () => {
|
|
489
|
+
if (s.value) {
|
|
490
|
+
const { default: r } = await import("./index-W-qQIppj.js");
|
|
491
|
+
a = r(s.value, {
|
|
490
492
|
mask: e.mask || "",
|
|
491
493
|
definitions: {
|
|
492
494
|
9: /[0-9]/,
|
|
493
495
|
A: /[a-zA-Z]/,
|
|
494
496
|
"*": /[a-zA-Z0-9]/
|
|
495
497
|
},
|
|
496
|
-
lazy: !1
|
|
497
|
-
placeholderChar: e.placeholder
|
|
498
|
+
lazy: !1
|
|
498
499
|
}), a.on("accept", () => {
|
|
499
500
|
n.value = e.unmask ? a.unmaskedValue : a.value;
|
|
500
501
|
}), a.on("complete", () => {
|
|
501
502
|
n.value = e.unmask ? a.unmaskedValue : a.value;
|
|
502
503
|
}), a.value = n.value ?? "";
|
|
503
504
|
}
|
|
504
|
-
}),
|
|
505
|
+
}), dt(() => {
|
|
505
506
|
a?.destroy();
|
|
506
|
-
}),
|
|
507
|
+
}), ie(() => e.mask, (r) => {
|
|
507
508
|
a && a.updateOptions({
|
|
508
|
-
mask:
|
|
509
|
+
mask: r,
|
|
509
510
|
definitions: {
|
|
510
511
|
9: /[0-9]/,
|
|
511
512
|
A: /[a-zA-Z]/,
|
|
512
513
|
"*": /[a-zA-Z0-9]/
|
|
513
514
|
}
|
|
514
515
|
});
|
|
515
|
-
}),
|
|
516
|
-
a && a.unmaskedValue !==
|
|
517
|
-
}), (
|
|
516
|
+
}), ie(n, (r) => {
|
|
517
|
+
a && a.unmaskedValue !== r && (a.value = r || "");
|
|
518
|
+
}), (r, d) => (i(), u("input", {
|
|
518
519
|
type: "text",
|
|
519
520
|
ref_key: "inputEl",
|
|
520
|
-
ref:
|
|
521
|
-
placeholder:
|
|
522
|
-
disabled:
|
|
523
|
-
name:
|
|
524
|
-
class:
|
|
521
|
+
ref: s,
|
|
522
|
+
placeholder: r.placeholder,
|
|
523
|
+
disabled: r.disabled,
|
|
524
|
+
name: r.name,
|
|
525
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t)]]),
|
|
525
526
|
style: {
|
|
526
527
|
border: "1px solid #CFD9E0"
|
|
527
528
|
}
|
|
528
|
-
}, null, 10,
|
|
529
|
+
}, null, 10, rl));
|
|
529
530
|
}
|
|
530
|
-
}), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */
|
|
531
|
+
}), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
|
|
531
532
|
__name: "vs-input-email",
|
|
532
|
-
props: /* @__PURE__ */
|
|
533
|
+
props: /* @__PURE__ */ Q({
|
|
533
534
|
style: { default: () => ({}) },
|
|
534
535
|
customClass: { default: "" },
|
|
535
536
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -543,26 +544,26 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
543
544
|
}),
|
|
544
545
|
emits: ["update:modelValue"],
|
|
545
546
|
setup(o) {
|
|
546
|
-
const e = o, { inputClass: t } =
|
|
547
|
-
return (
|
|
548
|
-
a[1] || (a[1] =
|
|
549
|
-
|
|
547
|
+
const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
|
|
548
|
+
return (s, a) => (i(), u("div", il, [
|
|
549
|
+
a[1] || (a[1] = re('<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)),
|
|
550
|
+
K(l("input", {
|
|
550
551
|
type: "email",
|
|
551
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
552
|
-
placeholder:
|
|
553
|
-
disabled:
|
|
554
|
-
class:
|
|
552
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
|
|
553
|
+
placeholder: s.placeholder,
|
|
554
|
+
disabled: s.disabled,
|
|
555
|
+
class: V(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t), { "!border-red-600": s.error }]]),
|
|
555
556
|
style: {
|
|
556
557
|
border: "1px solid #CFD9E0"
|
|
557
558
|
}
|
|
558
559
|
}, null, 10, ul), [
|
|
559
|
-
[
|
|
560
|
+
[de, n.value]
|
|
560
561
|
])
|
|
561
562
|
]));
|
|
562
563
|
}
|
|
563
|
-
}), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */
|
|
564
|
+
}), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */ O({
|
|
564
565
|
__name: "vs-input-radio-default",
|
|
565
|
-
props: /* @__PURE__ */
|
|
566
|
+
props: /* @__PURE__ */ Q({
|
|
566
567
|
style: {},
|
|
567
568
|
customClass: { default: "" },
|
|
568
569
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -578,36 +579,36 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
578
579
|
}),
|
|
579
580
|
emits: ["update:modelValue"],
|
|
580
581
|
setup(o) {
|
|
581
|
-
const e =
|
|
582
|
+
const e = X(o, "modelValue");
|
|
582
583
|
return (t, n) => (i(), u("label", {
|
|
583
|
-
class:
|
|
584
|
+
class: V(["flex items-center gap-0", [t.customClass]])
|
|
584
585
|
}, [
|
|
585
|
-
|
|
586
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
586
|
+
K(l("input", {
|
|
587
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
|
|
587
588
|
type: "radio",
|
|
588
589
|
value: t.value,
|
|
589
590
|
disabled: t.disabled,
|
|
590
591
|
class: "hidden"
|
|
591
592
|
}, null, 8, cl), [
|
|
592
|
-
[
|
|
593
|
+
[et, e.value]
|
|
593
594
|
]),
|
|
594
595
|
l("span", {
|
|
595
|
-
class:
|
|
596
|
+
class: V(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
596
597
|
`border-${t.style?.primaryColor || "blue"}-500`,
|
|
597
598
|
t.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
598
599
|
]])
|
|
599
600
|
}, [
|
|
600
601
|
e.value == t.value ? (i(), u("span", {
|
|
601
602
|
key: 0,
|
|
602
|
-
class:
|
|
603
|
-
}, null, 2)) :
|
|
603
|
+
class: V(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
604
|
+
}, null, 2)) : j("", !0)
|
|
604
605
|
], 2),
|
|
605
|
-
l("span", pl,
|
|
606
|
+
l("span", pl, F(t.text), 1)
|
|
606
607
|
], 2));
|
|
607
608
|
}
|
|
608
|
-
}), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */
|
|
609
|
+
}), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */ O({
|
|
609
610
|
__name: "vs-input-radio-buttons",
|
|
610
|
-
props: /* @__PURE__ */
|
|
611
|
+
props: /* @__PURE__ */ Q({
|
|
611
612
|
style: {},
|
|
612
613
|
customClass: { default: "" },
|
|
613
614
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -623,31 +624,31 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
623
624
|
}),
|
|
624
625
|
emits: ["update:modelValue"],
|
|
625
626
|
setup(o) {
|
|
626
|
-
const e =
|
|
627
|
+
const e = X(o, "modelValue");
|
|
627
628
|
return (t, n) => (i(), u("label", {
|
|
628
|
-
class:
|
|
629
|
+
class: V(["flex items-center border rounded-lg px-2 py-1", [
|
|
629
630
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
630
631
|
t.customClass
|
|
631
632
|
]])
|
|
632
633
|
}, [
|
|
633
|
-
|
|
634
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
634
|
+
K(l("input", {
|
|
635
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
|
|
635
636
|
type: "radio",
|
|
636
637
|
value: t.value,
|
|
637
638
|
disabled: t.disabled,
|
|
638
639
|
class: "hidden"
|
|
639
640
|
}, null, 8, vl), [
|
|
640
|
-
[
|
|
641
|
+
[et, e.value]
|
|
641
642
|
]),
|
|
642
|
-
l("span", ml,
|
|
643
|
+
l("span", ml, F(t.text), 1)
|
|
643
644
|
], 2));
|
|
644
645
|
}
|
|
645
646
|
}), gl = {
|
|
646
647
|
"vs-input-radio-default": fl,
|
|
647
648
|
"vs-input-radio-buttons": hl
|
|
648
|
-
},
|
|
649
|
+
}, Ke = /* @__PURE__ */ O({
|
|
649
650
|
__name: "vs-input-radio",
|
|
650
|
-
props: /* @__PURE__ */
|
|
651
|
+
props: /* @__PURE__ */ Q({
|
|
651
652
|
options: {},
|
|
652
653
|
position: { default: "vertical" },
|
|
653
654
|
view: { default: "default" },
|
|
@@ -664,21 +665,21 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
664
665
|
}),
|
|
665
666
|
emits: ["update:modelValue"],
|
|
666
667
|
setup(o) {
|
|
667
|
-
const e = o, t =
|
|
668
|
-
return (
|
|
669
|
-
class:
|
|
668
|
+
const e = o, t = X(o, "modelValue"), n = D(() => gl[`vs-input-radio-${e.view}`]);
|
|
669
|
+
return (s, a) => (i(), u("div", {
|
|
670
|
+
class: V([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
670
671
|
}, [
|
|
671
|
-
(i(!0), u(
|
|
672
|
-
key:
|
|
673
|
-
text:
|
|
674
|
-
value:
|
|
675
|
-
checked: t.value ===
|
|
672
|
+
(i(!0), u(ee, null, le(s.options, (r) => (i(), te(_e(n.value), Le({
|
|
673
|
+
key: r?.id,
|
|
674
|
+
text: r.text,
|
|
675
|
+
value: r.id.toString(),
|
|
676
|
+
checked: t.value === r.id,
|
|
676
677
|
modelValue: t.value,
|
|
677
678
|
"onUpdate:modelValue": a[0] || (a[0] = (d) => t.value = d)
|
|
678
|
-
}, { ref_for: !0 },
|
|
679
|
+
}, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
679
680
|
], 2));
|
|
680
681
|
}
|
|
681
|
-
}), bl = /* @__PURE__ */
|
|
682
|
+
}), bl = /* @__PURE__ */ O({
|
|
682
683
|
__name: "vs-input-checkbox",
|
|
683
684
|
props: {
|
|
684
685
|
options: { default: () => [] },
|
|
@@ -697,81 +698,81 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
697
698
|
},
|
|
698
699
|
emits: ["update:modelValue"],
|
|
699
700
|
setup(o, { emit: e }) {
|
|
700
|
-
const t = o, n = e,
|
|
701
|
+
const t = o, n = e, s = x([]), a = ct({}), r = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
|
|
701
702
|
try {
|
|
702
703
|
const c = await fetch(`/api/suggest/${t.data}`).then((g) => g.json());
|
|
703
|
-
|
|
704
|
+
s.value = c?.data || c;
|
|
704
705
|
} catch (c) {
|
|
705
706
|
console.error(c);
|
|
706
707
|
}
|
|
707
708
|
};
|
|
708
|
-
return
|
|
709
|
+
return ie(
|
|
709
710
|
() => t.modelValue,
|
|
710
711
|
(c) => {
|
|
711
|
-
if (typeof c == "boolean" &&
|
|
712
|
-
const g = s
|
|
712
|
+
if (typeof c == "boolean" && s.value.length === 1) {
|
|
713
|
+
const g = r(s.value[0]);
|
|
713
714
|
a[g] = c;
|
|
714
715
|
} else if (Array.isArray(c)) {
|
|
715
716
|
const g = new Set(c);
|
|
716
|
-
|
|
717
|
+
s.value.forEach((v) => {
|
|
717
718
|
if (!v.disabled) {
|
|
718
|
-
const
|
|
719
|
-
a[
|
|
719
|
+
const C = r(v);
|
|
720
|
+
a[C] = g.has(C);
|
|
720
721
|
}
|
|
721
722
|
});
|
|
722
723
|
}
|
|
723
724
|
},
|
|
724
725
|
{ immediate: !0 }
|
|
725
|
-
),
|
|
726
|
+
), ie(
|
|
726
727
|
a,
|
|
727
728
|
() => {
|
|
728
|
-
if (!
|
|
729
|
+
if (!s.value.length) {
|
|
729
730
|
n("update:modelValue", null);
|
|
730
731
|
return;
|
|
731
732
|
}
|
|
732
733
|
const c = Object.entries(a).filter(([, g]) => g).map(([g]) => g);
|
|
733
|
-
n("update:modelValue", c.length === 0 ?
|
|
734
|
+
n("update:modelValue", c.length === 0 ? [] : c);
|
|
734
735
|
},
|
|
735
736
|
{ deep: !0 }
|
|
736
|
-
),
|
|
737
|
+
), ue(() => {
|
|
737
738
|
if (t.data)
|
|
738
739
|
f().then(() => {
|
|
739
|
-
if (typeof t.modelValue == "boolean" &&
|
|
740
|
-
const c = s
|
|
740
|
+
if (typeof t.modelValue == "boolean" && s.value.length === 1) {
|
|
741
|
+
const c = r(s.value[0]);
|
|
741
742
|
a[c] = t.modelValue;
|
|
742
743
|
} else if (Array.isArray(t.modelValue)) {
|
|
743
744
|
const c = new Set(t.modelValue);
|
|
744
|
-
|
|
745
|
+
s.value.forEach((g) => {
|
|
745
746
|
if (!g.disabled) {
|
|
746
|
-
const v =
|
|
747
|
+
const v = r(g);
|
|
747
748
|
a[v] = c.has(v);
|
|
748
749
|
}
|
|
749
750
|
});
|
|
750
751
|
}
|
|
751
752
|
});
|
|
752
|
-
else if (
|
|
753
|
-
const c = s
|
|
753
|
+
else if (s.value = t.options, typeof t.modelValue == "boolean" && s.value.length === 1) {
|
|
754
|
+
const c = r(s.value[0]);
|
|
754
755
|
a[c] = t.modelValue;
|
|
755
756
|
} else if (Array.isArray(t.modelValue)) {
|
|
756
757
|
const c = new Set(t.modelValue);
|
|
757
|
-
|
|
758
|
+
s.value.forEach((g) => {
|
|
758
759
|
if (!g.disabled) {
|
|
759
|
-
const v =
|
|
760
|
+
const v = r(g);
|
|
760
761
|
a[v] = c.has(v);
|
|
761
762
|
}
|
|
762
763
|
});
|
|
763
764
|
}
|
|
764
765
|
}), (c, g) => (i(), u("div", {
|
|
765
|
-
class:
|
|
766
|
+
class: V(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
|
|
766
767
|
}, [
|
|
767
|
-
(i(!0), u(
|
|
768
|
-
modelValue: a[
|
|
769
|
-
"onUpdate:modelValue": (
|
|
770
|
-
value:
|
|
771
|
-
class:
|
|
768
|
+
(i(!0), u(ee, null, le(s.value, (v) => (i(), te(lt, {
|
|
769
|
+
modelValue: a[r(v)],
|
|
770
|
+
"onUpdate:modelValue": (C) => a[r(v)] = C,
|
|
771
|
+
value: r(v),
|
|
772
|
+
class: V(p(c.colSpan)),
|
|
772
773
|
disabled: v.disabled,
|
|
773
774
|
label: d(v),
|
|
774
|
-
key:
|
|
775
|
+
key: r(v),
|
|
775
776
|
icon: v?.icon,
|
|
776
777
|
imgUrl: v?.imgUrl,
|
|
777
778
|
option: v,
|
|
@@ -779,7 +780,7 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
779
780
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
780
781
|
], 2));
|
|
781
782
|
}
|
|
782
|
-
}), yl = /* @__PURE__ */ R(bl, [["__scopeId", "data-v-
|
|
783
|
+
}), yl = /* @__PURE__ */ R(bl, [["__scopeId", "data-v-91f3584a"]]), xl = ["placeholder", "disabled"], wl = /* @__PURE__ */ O({
|
|
783
784
|
__name: "vs-input-date1",
|
|
784
785
|
props: {
|
|
785
786
|
style: { default: () => ({}) },
|
|
@@ -792,41 +793,41 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
792
793
|
},
|
|
793
794
|
emits: ["update:modelValue"],
|
|
794
795
|
setup(o, { emit: e }) {
|
|
795
|
-
const t = o, { inputClass: n } =
|
|
796
|
+
const t = o, { inputClass: n } = be(t.style), s = e, a = D({
|
|
796
797
|
get: () => t.modelValue?.split(" ")[0],
|
|
797
|
-
set: (
|
|
798
|
+
set: (r) => s("update:modelValue", r)
|
|
798
799
|
});
|
|
799
|
-
return (
|
|
800
|
+
return (r, d) => K((i(), u("input", {
|
|
800
801
|
type: "date",
|
|
801
802
|
"onUpdate:modelValue": d[0] || (d[0] = (p) => a.value = p),
|
|
802
|
-
placeholder:
|
|
803
|
-
disabled:
|
|
803
|
+
placeholder: r.placeholder,
|
|
804
|
+
disabled: r.disabled,
|
|
804
805
|
ref: "date",
|
|
805
|
-
class:
|
|
806
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [r.modelValue ? "" : "text-opacity-50", J(n)].join(" ")]),
|
|
806
807
|
style: {
|
|
807
808
|
border: "1px solid #CFD9E0"
|
|
808
809
|
}
|
|
809
810
|
}, null, 10, xl)), [
|
|
810
|
-
[
|
|
811
|
+
[de, a.value]
|
|
811
812
|
]);
|
|
812
813
|
}
|
|
813
814
|
}), kl = async (o, e, t, n) => {
|
|
814
815
|
try {
|
|
815
|
-
const
|
|
816
|
-
return
|
|
816
|
+
const s = new FormData();
|
|
817
|
+
return s.append("unique", "true"), s.append("file", o), (await fetch(
|
|
817
818
|
`/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${n || ""}`,
|
|
818
819
|
{
|
|
819
820
|
method: "POST",
|
|
820
|
-
body:
|
|
821
|
+
body: s
|
|
821
822
|
}
|
|
822
|
-
).then((
|
|
823
|
-
} catch (
|
|
824
|
-
return
|
|
823
|
+
).then((r) => r.json()))?.result;
|
|
824
|
+
} catch (s) {
|
|
825
|
+
return pe({
|
|
825
826
|
type: "error",
|
|
826
827
|
title: "Помилка!",
|
|
827
828
|
message: "Сталась помилка під час завантаження файлу",
|
|
828
829
|
position: "right-bottom"
|
|
829
|
-
}), console.error("Сталась помилка завантаження файлу",
|
|
830
|
+
}), console.error("Сталась помилка завантаження файлу", s), null;
|
|
830
831
|
}
|
|
831
832
|
}, _l = async (o) => {
|
|
832
833
|
try {
|
|
@@ -834,10 +835,10 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
|
|
|
834
835
|
} catch (e) {
|
|
835
836
|
return console.error(e), !1;
|
|
836
837
|
}
|
|
837
|
-
},
|
|
838
|
+
}, Ze = async (o) => {
|
|
838
839
|
try {
|
|
839
|
-
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), n = e.headers["content-type"],
|
|
840
|
-
|
|
840
|
+
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), n = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), a = new Blob([s], { type: n }), r = document.createElement("a");
|
|
841
|
+
r.setAttribute("download", o), r.href = window.URL.createObjectURL(a), r.click();
|
|
841
842
|
} catch (e) {
|
|
842
843
|
console.error(e.message);
|
|
843
844
|
}
|
|
@@ -870,9 +871,9 @@ const je = /* @__PURE__ */ R($l, [["render", Vl]]), Ml = {}, Ll = {
|
|
|
870
871
|
"stroke-linecap": "round",
|
|
871
872
|
"stroke-linejoin": "round"
|
|
872
873
|
};
|
|
873
|
-
function Sl(o, e, t, n,
|
|
874
|
+
function Sl(o, e, t, n, s, a) {
|
|
874
875
|
return i(), u("svg", Ll, e[0] || (e[0] = [
|
|
875
|
-
|
|
876
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
|
|
876
877
|
]));
|
|
877
878
|
}
|
|
878
879
|
const Bl = /* @__PURE__ */ R(Ml, [["render", Sl]]), jl = {}, Il = {
|
|
@@ -887,7 +888,7 @@ const Bl = /* @__PURE__ */ R(Ml, [["render", Sl]]), jl = {}, Il = {
|
|
|
887
888
|
"stroke-linecap": "round",
|
|
888
889
|
"stroke-linejoin": "round"
|
|
889
890
|
};
|
|
890
|
-
function
|
|
891
|
+
function zl(o, e, t, n, s, a) {
|
|
891
892
|
return i(), u("svg", Il, e[0] || (e[0] = [
|
|
892
893
|
l("path", {
|
|
893
894
|
stroke: "none",
|
|
@@ -915,7 +916,7 @@ function Al(o, e, t, n, r, a) {
|
|
|
915
916
|
}, null, -1)
|
|
916
917
|
]));
|
|
917
918
|
}
|
|
918
|
-
const
|
|
919
|
+
const Al = /* @__PURE__ */ R(jl, [["render", zl]]), Ol = {}, El = {
|
|
919
920
|
xmlns: "http://www.w3.org/2000/svg",
|
|
920
921
|
width: "24",
|
|
921
922
|
height: "24",
|
|
@@ -927,12 +928,12 @@ const zl = /* @__PURE__ */ R(jl, [["render", Al]]), El = {}, Fl = {
|
|
|
927
928
|
"stroke-linejoin": "round",
|
|
928
929
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
929
930
|
};
|
|
930
|
-
function
|
|
931
|
-
return i(), u("svg",
|
|
932
|
-
|
|
931
|
+
function Fl(o, e, t, n, s, a) {
|
|
932
|
+
return i(), u("svg", El, e[0] || (e[0] = [
|
|
933
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
|
|
933
934
|
]));
|
|
934
935
|
}
|
|
935
|
-
const Dl = /* @__PURE__ */ R(
|
|
936
|
+
const Dl = /* @__PURE__ */ R(Ol, [["render", Fl]]), Ul = {}, Tl = {
|
|
936
937
|
xmlns: "http://www.w3.org/2000/svg",
|
|
937
938
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
938
939
|
width: "44",
|
|
@@ -944,9 +945,9 @@ const Dl = /* @__PURE__ */ R(El, [["render", Ol]]), Ul = {}, Tl = {
|
|
|
944
945
|
"stroke-linecap": "round",
|
|
945
946
|
"stroke-linejoin": "round"
|
|
946
947
|
};
|
|
947
|
-
function Rl(o, e, t, n,
|
|
948
|
+
function Rl(o, e, t, n, s, a) {
|
|
948
949
|
return i(), u("svg", Tl, e[0] || (e[0] = [
|
|
949
|
-
|
|
950
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
|
|
950
951
|
]));
|
|
951
952
|
}
|
|
952
953
|
const Pl = /* @__PURE__ */ R(Ul, [["render", Rl]]), Nl = {}, Hl = {
|
|
@@ -961,9 +962,9 @@ const Pl = /* @__PURE__ */ R(Ul, [["render", Rl]]), Nl = {}, Hl = {
|
|
|
961
962
|
"stroke-linecap": "round",
|
|
962
963
|
"stroke-linejoin": "round"
|
|
963
964
|
};
|
|
964
|
-
function ql(o, e, t, n,
|
|
965
|
+
function ql(o, e, t, n, s, a) {
|
|
965
966
|
return i(), u("svg", Hl, e[0] || (e[0] = [
|
|
966
|
-
|
|
967
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
|
|
967
968
|
]));
|
|
968
969
|
}
|
|
969
970
|
const Gl = /* @__PURE__ */ R(Nl, [["render", ql]]), Jl = (o) => {
|
|
@@ -978,7 +979,7 @@ const Gl = /* @__PURE__ */ R(Nl, [["render", ql]]), Jl = (o) => {
|
|
|
978
979
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
979
980
|
documentsFormat: ["pdf"]
|
|
980
981
|
};
|
|
981
|
-
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ?
|
|
982
|
+
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? Al : t.textsFormat.includes(e) ? Gl : t.documentsFormat.includes(e) ? Bl : t.archivesFormat.includes(e) ? Pl : Dl;
|
|
982
983
|
}, Zl = {}, Wl = {
|
|
983
984
|
xmlns: "http://www.w3.org/2000/svg",
|
|
984
985
|
width: "24",
|
|
@@ -993,10 +994,10 @@ const Gl = /* @__PURE__ */ R(Nl, [["render", ql]]), Jl = (o) => {
|
|
|
993
994
|
};
|
|
994
995
|
function Ql(o, e) {
|
|
995
996
|
return i(), u("svg", Wl, e[0] || (e[0] = [
|
|
996
|
-
|
|
997
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
|
|
997
998
|
]));
|
|
998
999
|
}
|
|
999
|
-
const
|
|
1000
|
+
const ze = /* @__PURE__ */ R(Zl, [["render", Ql]]), Xl = {}, Yl = {
|
|
1000
1001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1001
1002
|
width: "24",
|
|
1002
1003
|
height: "24",
|
|
@@ -1020,9 +1021,9 @@ function eo(o, e) {
|
|
|
1020
1021
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1021
1022
|
]));
|
|
1022
1023
|
}
|
|
1023
|
-
const
|
|
1024
|
+
const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, lo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, oo = /* @__PURE__ */ O({
|
|
1024
1025
|
__name: "vs-input-file-list-item",
|
|
1025
|
-
props: /* @__PURE__ */
|
|
1026
|
+
props: /* @__PURE__ */ Q({
|
|
1026
1027
|
format: {},
|
|
1027
1028
|
multiple: { type: Boolean },
|
|
1028
1029
|
style: {},
|
|
@@ -1040,40 +1041,40 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1040
1041
|
}),
|
|
1041
1042
|
emits: ["update:value", "update:item"],
|
|
1042
1043
|
setup(o) {
|
|
1043
|
-
const e =
|
|
1044
|
-
return (
|
|
1045
|
-
(i(),
|
|
1044
|
+
const e = X(o, "value"), t = X(o, "item"), n = o;
|
|
1045
|
+
return (s, a) => (i(), u("div", to, [
|
|
1046
|
+
(i(), te(_e(J(Kl)(t.value)), {
|
|
1046
1047
|
src: t.value,
|
|
1047
1048
|
alt: "file",
|
|
1048
1049
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1049
|
-
onClick: a[0] || (a[0] = (
|
|
1050
|
+
onClick: a[0] || (a[0] = (r) => J(Ze)(t.value))
|
|
1050
1051
|
}, null, 8, ["src"])),
|
|
1051
1052
|
l("div", lo, [
|
|
1052
1053
|
l("button", {
|
|
1053
1054
|
type: "button",
|
|
1054
|
-
onClick: a[1] || (a[1] = (
|
|
1055
|
-
|
|
1055
|
+
onClick: a[1] || (a[1] = (r) => {
|
|
1056
|
+
J(_l)(t.value), e.value = n.multiple ? e.value?.filter((d) => d !== t.value) : "";
|
|
1056
1057
|
}),
|
|
1057
1058
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1058
1059
|
}, [
|
|
1059
|
-
|
|
1060
|
+
B(ze, { class: "w-4 h-4" })
|
|
1060
1061
|
]),
|
|
1061
1062
|
l("button", {
|
|
1062
1063
|
type: "button",
|
|
1063
|
-
onClick: a[2] || (a[2] = (
|
|
1064
|
+
onClick: a[2] || (a[2] = (r) => J(Ze)(t.value)),
|
|
1064
1065
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1065
1066
|
}, [
|
|
1066
|
-
|
|
1067
|
+
B(at, { class: "w-4 h-4" })
|
|
1067
1068
|
])
|
|
1068
1069
|
])
|
|
1069
1070
|
]));
|
|
1070
1071
|
}
|
|
1071
|
-
}),
|
|
1072
|
+
}), We = /* @__PURE__ */ R(oo, [["__scopeId", "data-v-0ca886b3"]]), ao = { class: "flex items-center gap-x-2" }, so = {
|
|
1072
1073
|
key: 1,
|
|
1073
1074
|
class: "flex items-center flex-wrap gap-2"
|
|
1074
|
-
},
|
|
1075
|
+
}, ro = /* @__PURE__ */ O({
|
|
1075
1076
|
__name: "vs-input-file",
|
|
1076
|
-
props: /* @__PURE__ */
|
|
1077
|
+
props: /* @__PURE__ */ Q({
|
|
1077
1078
|
format: {},
|
|
1078
1079
|
multiple: { type: Boolean },
|
|
1079
1080
|
style: {},
|
|
@@ -1089,18 +1090,18 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1089
1090
|
}),
|
|
1090
1091
|
emits: ["update:modelValue"],
|
|
1091
1092
|
setup(o) {
|
|
1092
|
-
const e = o, t =
|
|
1093
|
+
const e = o, t = X(o, "modelValue"), n = x(null), s = (r) => Array.isArray(t.value) && t.value[r] || "", a = async (r) => {
|
|
1093
1094
|
if (e.format) {
|
|
1094
|
-
const f =
|
|
1095
|
+
const f = r.target.files?.[0];
|
|
1095
1096
|
if (!f || !f.name.endsWith(e.format))
|
|
1096
1097
|
return;
|
|
1097
1098
|
}
|
|
1098
|
-
const d =
|
|
1099
|
+
const d = r.target.files?.[0];
|
|
1099
1100
|
if (!d) return;
|
|
1100
1101
|
const p = await kl(d, "1", "form", "table");
|
|
1101
1102
|
t.value = e.multiple ? [...t.value || [], p?.file_path] : p?.file_path;
|
|
1102
1103
|
};
|
|
1103
|
-
return (
|
|
1104
|
+
return (r, d) => (i(), u("div", ao, [
|
|
1104
1105
|
l("input", {
|
|
1105
1106
|
class: "hidden",
|
|
1106
1107
|
ref_key: "fileInput",
|
|
@@ -1108,46 +1109,46 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1108
1109
|
type: "file",
|
|
1109
1110
|
onChange: a
|
|
1110
1111
|
}, null, 544),
|
|
1111
|
-
!
|
|
1112
|
+
!r.multiple && t.value ? (i(), te(We, {
|
|
1112
1113
|
key: 0,
|
|
1113
1114
|
item: t.value,
|
|
1114
1115
|
"onUpdate:item": d[0] || (d[0] = (p) => t.value = p),
|
|
1115
1116
|
value: t.value,
|
|
1116
1117
|
"onUpdate:value": d[1] || (d[1] = (p) => t.value = p)
|
|
1117
|
-
}, null, 8, ["item", "value"])) :
|
|
1118
|
-
(i(!0), u(
|
|
1119
|
-
multiple:
|
|
1118
|
+
}, null, 8, ["item", "value"])) : r.multiple ? (i(), u("div", so, [
|
|
1119
|
+
(i(!0), u(ee, null, le(t.value, (p, f) => (i(), te(We, {
|
|
1120
|
+
multiple: r.multiple,
|
|
1120
1121
|
key: f,
|
|
1121
1122
|
value: t.value,
|
|
1122
1123
|
"onUpdate:value": d[2] || (d[2] = (c) => t.value = c),
|
|
1123
|
-
item:
|
|
1124
|
+
item: s(f)
|
|
1124
1125
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1125
1126
|
l("div", {
|
|
1126
|
-
onClick: d[3] || (d[3] = (p) => !
|
|
1127
|
-
class:
|
|
1127
|
+
onClick: d[3] || (d[3] = (p) => !r.disabled && n.value?.click()),
|
|
1128
|
+
class: V([
|
|
1128
1129
|
"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",
|
|
1129
|
-
|
|
1130
|
+
r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1130
1131
|
])
|
|
1131
1132
|
}, [
|
|
1132
|
-
|
|
1133
|
+
B(je, { class: "w-6 h-6" })
|
|
1133
1134
|
], 2)
|
|
1134
|
-
])) :
|
|
1135
|
-
|
|
1135
|
+
])) : j("", !0),
|
|
1136
|
+
r.multiple ? j("", !0) : (i(), u("div", {
|
|
1136
1137
|
key: 2,
|
|
1137
1138
|
onClick: d[4] || (d[4] = (p) => n.value?.click()),
|
|
1138
|
-
class:
|
|
1139
|
+
class: V([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"])
|
|
1139
1140
|
}, [
|
|
1140
|
-
|
|
1141
|
+
B(je, { class: "w-6 h-6" })
|
|
1141
1142
|
], 2))
|
|
1142
1143
|
]));
|
|
1143
1144
|
}
|
|
1144
|
-
}), no = { class: "max-w-[55vw]" }, io = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, uo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, co = { class: "px-[5px]" }, po = { class: "" }, Se = /* @__PURE__ */
|
|
1145
|
+
}), no = { class: "max-w-[55vw]" }, io = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, uo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, co = { class: "px-[5px]" }, po = { class: "" }, Se = /* @__PURE__ */ O({
|
|
1145
1146
|
__name: "vs-widget-file-info",
|
|
1146
1147
|
props: {
|
|
1147
1148
|
item: { default: null }
|
|
1148
1149
|
},
|
|
1149
1150
|
setup(o) {
|
|
1150
|
-
const e = o, t =
|
|
1151
|
+
const e = o, t = D(() => {
|
|
1151
1152
|
try {
|
|
1152
1153
|
return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
|
|
1153
1154
|
day: "2-digit",
|
|
@@ -1158,24 +1159,24 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1158
1159
|
return "";
|
|
1159
1160
|
}
|
|
1160
1161
|
});
|
|
1161
|
-
function n(
|
|
1162
|
-
if (
|
|
1163
|
-
return `${
|
|
1164
|
-
const a =
|
|
1162
|
+
function n(s) {
|
|
1163
|
+
if (s < 1024)
|
|
1164
|
+
return `${s} B`;
|
|
1165
|
+
const a = s / 1024;
|
|
1165
1166
|
return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
|
|
1166
1167
|
}
|
|
1167
|
-
return (
|
|
1168
|
-
a[1] || (a[1] =
|
|
1168
|
+
return (s, a) => (i(), u(ee, null, [
|
|
1169
|
+
a[1] || (a[1] = re('<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)),
|
|
1169
1170
|
l("div", no, [
|
|
1170
|
-
l("p", io,
|
|
1171
|
+
l("p", io, F(s.item?.uploaded_name), 1),
|
|
1171
1172
|
l("p", uo, [
|
|
1172
|
-
l("span", null,
|
|
1173
|
-
|
|
1174
|
-
[Ue,
|
|
1173
|
+
l("span", null, F(s.item?.username), 1),
|
|
1174
|
+
K(l("span", co, "|", 512), [
|
|
1175
|
+
[Ue, s.item?.username]
|
|
1175
1176
|
]),
|
|
1176
|
-
l("span", null,
|
|
1177
|
+
l("span", null, F(t.value), 1),
|
|
1177
1178
|
a[0] || (a[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1178
|
-
l("span", po,
|
|
1179
|
+
l("span", po, F(n(s.item?.size)), 1)
|
|
1179
1180
|
])
|
|
1180
1181
|
])
|
|
1181
1182
|
], 64));
|
|
@@ -1192,7 +1193,7 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1192
1193
|
}, go = ["href"], bo = {
|
|
1193
1194
|
key: 3,
|
|
1194
1195
|
class: "flex gap-x-3 w-full items-center"
|
|
1195
|
-
}, yo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, xo = { 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" }, wo = { class: "inline-block" }, ko = { class: "inline-block" }, _o = /* @__PURE__ */
|
|
1196
|
+
}, yo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, xo = { 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" }, wo = { class: "inline-block" }, ko = { class: "inline-block" }, _o = /* @__PURE__ */ O({
|
|
1196
1197
|
__name: "vs-widget-file-item",
|
|
1197
1198
|
props: {
|
|
1198
1199
|
item: { default: null },
|
|
@@ -1202,13 +1203,13 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1202
1203
|
emits: ["update", "openModal", "openLightbox"],
|
|
1203
1204
|
setup(o, { emit: e }) {
|
|
1204
1205
|
const t = o, n = e;
|
|
1205
|
-
function
|
|
1206
|
+
function s(c) {
|
|
1206
1207
|
return ["pdf", "json"].includes(c.ext);
|
|
1207
1208
|
}
|
|
1208
1209
|
function a(c) {
|
|
1209
1210
|
return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(c.ext);
|
|
1210
1211
|
}
|
|
1211
|
-
function
|
|
1212
|
+
function r(c) {
|
|
1212
1213
|
const g = document.createElement("a");
|
|
1213
1214
|
g.setAttribute("download", c?.uploaded_name), g.href = c?.file_path, g.click();
|
|
1214
1215
|
}
|
|
@@ -1240,29 +1241,29 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1240
1241
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1241
1242
|
onClick: g[0] || (g[0] = (v) => f(c.index))
|
|
1242
1243
|
}, [
|
|
1243
|
-
|
|
1244
|
+
B(Se, { item: c.item }, null, 8, ["item"])
|
|
1244
1245
|
])
|
|
1245
|
-
])) :
|
|
1246
|
-
|
|
1246
|
+
])) : s(c.item) ? (i(), u("div", mo, [
|
|
1247
|
+
B(Se, { item: c.item }, null, 8, ["item"])
|
|
1247
1248
|
])) : a(c.item) ? (i(), u("div", ho, [
|
|
1248
1249
|
l("a", {
|
|
1249
1250
|
href: `/api/file-preview?id=${c.item.file_id}`,
|
|
1250
1251
|
target: "_blank",
|
|
1251
1252
|
class: "flex gap-x-3 w-full items-center"
|
|
1252
1253
|
}, [
|
|
1253
|
-
|
|
1254
|
+
B(Se, { item: c.item }, null, 8, ["item"])
|
|
1254
1255
|
], 8, go)
|
|
1255
1256
|
])) : (i(), u("div", bo, [
|
|
1256
|
-
|
|
1257
|
+
B(Se, { item: c.item }, null, 8, ["item"])
|
|
1257
1258
|
])),
|
|
1258
1259
|
l("div", yo, [
|
|
1259
1260
|
l("div", xo, [
|
|
1260
1261
|
l("div", wo, [
|
|
1261
1262
|
l("button", {
|
|
1262
1263
|
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",
|
|
1263
|
-
onClick: g[1] || (g[1] = (v) =>
|
|
1264
|
+
onClick: g[1] || (g[1] = (v) => r(c.item))
|
|
1264
1265
|
}, [
|
|
1265
|
-
|
|
1266
|
+
B(at, {
|
|
1266
1267
|
height: "14",
|
|
1267
1268
|
width: "14"
|
|
1268
1269
|
})
|
|
@@ -1275,7 +1276,7 @@ const ot = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
|
|
|
1275
1276
|
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",
|
|
1276
1277
|
onClick: g[2] || (g[2] = (v) => p())
|
|
1277
1278
|
}, [
|
|
1278
|
-
|
|
1279
|
+
B(ze, {
|
|
1279
1280
|
height: "14",
|
|
1280
1281
|
width: "14"
|
|
1281
1282
|
})
|
|
@@ -1309,13 +1310,13 @@ function Vo(o, e) {
|
|
|
1309
1310
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1310
1311
|
]));
|
|
1311
1312
|
}
|
|
1312
|
-
const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, So = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, jo = { class1: "ml-auto" }, Io = { 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" },
|
|
1313
|
+
const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, So = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, jo = { class1: "ml-auto" }, Io = { 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" }, zo = {
|
|
1313
1314
|
key: 0,
|
|
1314
1315
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1315
|
-
},
|
|
1316
|
+
}, Ao = { class: "relative" }, Oo = {
|
|
1316
1317
|
key: 1,
|
|
1317
1318
|
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"
|
|
1318
|
-
},
|
|
1319
|
+
}, Eo = { key: 0 }, Fo = /* @__PURE__ */ O({
|
|
1319
1320
|
__name: "vs-input-file-list",
|
|
1320
1321
|
props: {
|
|
1321
1322
|
id: { default: "" },
|
|
@@ -1330,57 +1331,57 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1330
1331
|
},
|
|
1331
1332
|
emits: ["update"],
|
|
1332
1333
|
setup(o, { emit: e }) {
|
|
1333
|
-
const t = o, n = Be("form"),
|
|
1334
|
-
const h = v.value.findIndex((
|
|
1335
|
-
h !== -1 && (a.value = !0,
|
|
1336
|
-
},
|
|
1334
|
+
const t = o, n = Be("form"), s = D(() => n.value.formId), a = x(!1), r = x(0), d = e, p = x(!1), f = x({}), c = x([]), g = x(""), v = D(() => Array.isArray(c.value) ? c.value.filter((b) => b.ext === "jpg" || b.ext === "png").map((b) => b?.file_path) : []), C = D(() => g.value === "" ? c.value : c.value.filter((b) => b?.uploaded_name?.includes(g.value))), z = (b) => {
|
|
1335
|
+
const h = v.value.findIndex((Z) => Z === b.item.file_path);
|
|
1336
|
+
h !== -1 && (a.value = !0, r.value = h);
|
|
1337
|
+
}, U = async () => {
|
|
1337
1338
|
try {
|
|
1338
|
-
const
|
|
1339
|
-
c.value =
|
|
1340
|
-
} catch (
|
|
1341
|
-
console.error(
|
|
1339
|
+
const b = await fetch(`${t.prefix}/widget/file/${s.value}`).then((h) => h.json());
|
|
1340
|
+
c.value = b?.rows;
|
|
1341
|
+
} catch (b) {
|
|
1342
|
+
console.error(b);
|
|
1342
1343
|
}
|
|
1343
|
-
}, T = async (
|
|
1344
|
+
}, T = async (b) => {
|
|
1344
1345
|
await Promise.all(
|
|
1345
|
-
Array.from(
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1346
|
+
Array.from(b.target.files).map(async (h) => {
|
|
1347
|
+
const Z = new FormData();
|
|
1348
|
+
Z.append("file", h);
|
|
1348
1349
|
try {
|
|
1349
|
-
const
|
|
1350
|
-
return await fetch(
|
|
1351
|
-
} catch (
|
|
1352
|
-
return console.error(
|
|
1350
|
+
const P = `${t.prefix}/widget/file/${s.value}`;
|
|
1351
|
+
return await fetch(P, { method: "POST", body: Z }), d("update", "file-list"), h;
|
|
1352
|
+
} catch (P) {
|
|
1353
|
+
return console.error(P), null;
|
|
1353
1354
|
}
|
|
1354
1355
|
})
|
|
1355
|
-
), await
|
|
1356
|
-
},
|
|
1357
|
-
const h = { ...
|
|
1358
|
-
return
|
|
1356
|
+
), await U();
|
|
1357
|
+
}, N = (b) => {
|
|
1358
|
+
const h = { ...b };
|
|
1359
|
+
return b.cancel || (h.cancel = () => {
|
|
1359
1360
|
p.value = !1;
|
|
1360
|
-
}),
|
|
1361
|
-
await
|
|
1361
|
+
}), b.updateListOnConfirm && (h.confirm = async () => {
|
|
1362
|
+
await b.confirm(), p.value = !1, U();
|
|
1362
1363
|
}), h;
|
|
1363
|
-
}, _ = (
|
|
1364
|
-
f.value =
|
|
1364
|
+
}, _ = (b) => {
|
|
1365
|
+
f.value = N(b), p.value = !0;
|
|
1365
1366
|
};
|
|
1366
|
-
return
|
|
1367
|
-
|
|
1368
|
-
}),
|
|
1369
|
-
|
|
1370
|
-
}), (
|
|
1371
|
-
const
|
|
1367
|
+
return ie(s, (b) => {
|
|
1368
|
+
b && U();
|
|
1369
|
+
}), ue(() => {
|
|
1370
|
+
s.value && U();
|
|
1371
|
+
}), (b, h) => {
|
|
1372
|
+
const Z = Ne("Lightbox"), P = Ne("MessageBox");
|
|
1372
1373
|
return i(), u("div", Lo, [
|
|
1373
1374
|
l("div", So, [
|
|
1374
|
-
l("h2", Bo, " Файлів: " +
|
|
1375
|
+
l("h2", Bo, " Файлів: " + F(c.value?.length), 1),
|
|
1375
1376
|
l("div", jo, [
|
|
1376
1377
|
l("label", null, [
|
|
1377
1378
|
l("input", {
|
|
1378
1379
|
type: "file",
|
|
1379
1380
|
class: "hidden",
|
|
1380
|
-
onChange: h[0] || (h[0] = (
|
|
1381
|
+
onChange: h[0] || (h[0] = (M) => T(M))
|
|
1381
1382
|
}, null, 32),
|
|
1382
1383
|
l("div", Io, [
|
|
1383
|
-
|
|
1384
|
+
B(Mo, {
|
|
1384
1385
|
height: "16",
|
|
1385
1386
|
width: "16"
|
|
1386
1387
|
})
|
|
@@ -1388,9 +1389,9 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1388
1389
|
])
|
|
1389
1390
|
])
|
|
1390
1391
|
]),
|
|
1391
|
-
c.value?.length > 4 ? (i(), u("div",
|
|
1392
|
+
c.value?.length > 4 ? (i(), u("div", zo, [
|
|
1392
1393
|
l("div", null, [
|
|
1393
|
-
l("div",
|
|
1394
|
+
l("div", Ao, [
|
|
1394
1395
|
h[8] || (h[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
|
|
1395
1396
|
l("svg", {
|
|
1396
1397
|
class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
|
|
@@ -1412,14 +1413,14 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1412
1413
|
l("path", { d: "m21 21-4.3-4.3" })
|
|
1413
1414
|
])
|
|
1414
1415
|
], -1)),
|
|
1415
|
-
|
|
1416
|
+
K(l("input", {
|
|
1416
1417
|
type: "text",
|
|
1417
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
1418
|
+
"onUpdate:modelValue": h[1] || (h[1] = (M) => g.value = M),
|
|
1418
1419
|
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",
|
|
1419
1420
|
placeholder: "Введіть назву файлу"
|
|
1420
1421
|
}, null, 512), [
|
|
1421
1422
|
[
|
|
1422
|
-
|
|
1423
|
+
de,
|
|
1423
1424
|
g.value,
|
|
1424
1425
|
void 0,
|
|
1425
1426
|
{ trim: !0 }
|
|
@@ -1427,37 +1428,37 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1427
1428
|
])
|
|
1428
1429
|
])
|
|
1429
1430
|
])
|
|
1430
|
-
])) :
|
|
1431
|
-
c.value?.length ? (i(), u("div",
|
|
1432
|
-
(i(!0), u(
|
|
1433
|
-
key:
|
|
1434
|
-
prefix:
|
|
1435
|
-
item:
|
|
1436
|
-
index:
|
|
1437
|
-
onUpdate: h[2] || (h[2] = (
|
|
1438
|
-
onOpenModal: h[3] || (h[3] = (
|
|
1439
|
-
onOpenLightbox: h[4] || (h[4] = (
|
|
1431
|
+
])) : j("", !0),
|
|
1432
|
+
c.value?.length ? (i(), u("div", Oo, [
|
|
1433
|
+
(i(!0), u(ee, null, le(C.value, (M, H) => (i(), te(_o, {
|
|
1434
|
+
key: H,
|
|
1435
|
+
prefix: b.prefix,
|
|
1436
|
+
item: M,
|
|
1437
|
+
index: H,
|
|
1438
|
+
onUpdate: h[2] || (h[2] = (Y) => b.$emit("update", "file-list")),
|
|
1439
|
+
onOpenModal: h[3] || (h[3] = (Y) => _(Y)),
|
|
1440
|
+
onOpenLightbox: h[4] || (h[4] = (Y) => z(Y))
|
|
1440
1441
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1441
|
-
|
|
1442
|
+
C.value.length ? j("", !0) : (i(), u("div", Eo, h[9] || (h[9] = [
|
|
1442
1443
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1443
1444
|
])))
|
|
1444
|
-
])) :
|
|
1445
|
-
|
|
1445
|
+
])) : j("", !0),
|
|
1446
|
+
B(Z, {
|
|
1446
1447
|
modelValue: a.value,
|
|
1447
|
-
"onUpdate:modelValue": h[5] || (h[5] = (
|
|
1448
|
-
startIndex:
|
|
1449
|
-
"onUpdate:index": h[6] || (h[6] = (
|
|
1448
|
+
"onUpdate:modelValue": h[5] || (h[5] = (M) => a.value = M),
|
|
1449
|
+
startIndex: r.value,
|
|
1450
|
+
"onUpdate:index": h[6] || (h[6] = (M) => r.value = M),
|
|
1450
1451
|
images: v.value
|
|
1451
1452
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1452
|
-
|
|
1453
|
+
B(P, Le({
|
|
1453
1454
|
modelValue: p.value,
|
|
1454
|
-
"onUpdate:modelValue": h[7] || (h[7] = (
|
|
1455
|
+
"onUpdate:modelValue": h[7] || (h[7] = (M) => p.value = M),
|
|
1455
1456
|
onConfirm: f.value.confirm
|
|
1456
1457
|
}, f.value), null, 16, ["modelValue", "onConfirm"])
|
|
1457
1458
|
]);
|
|
1458
1459
|
};
|
|
1459
1460
|
}
|
|
1460
|
-
}), Do = { class: "flex items-center justify-between" }, Uo = { class: "text-[16px] text-gray-900 font-medium" }, To = { class: "grid gap-3" }, Ro = /* @__PURE__ */
|
|
1461
|
+
}), Do = { class: "flex items-center justify-between" }, Uo = { class: "text-[16px] text-gray-900 font-medium" }, To = { class: "grid gap-3" }, Ro = /* @__PURE__ */ O({
|
|
1461
1462
|
__name: "vs-container-switcher",
|
|
1462
1463
|
props: {
|
|
1463
1464
|
title: {
|
|
@@ -1474,25 +1475,25 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1474
1475
|
}
|
|
1475
1476
|
},
|
|
1476
1477
|
setup(o) {
|
|
1477
|
-
const e = o, t =
|
|
1478
|
-
return
|
|
1478
|
+
const e = o, t = x(e.isOpen);
|
|
1479
|
+
return ie(
|
|
1479
1480
|
() => e.isOpen,
|
|
1480
1481
|
(n) => {
|
|
1481
1482
|
t.value = n;
|
|
1482
1483
|
}
|
|
1483
|
-
), (n,
|
|
1484
|
+
), (n, s) => (i(), u("div", null, [
|
|
1484
1485
|
l("div", Do, [
|
|
1485
|
-
l("p", Uo,
|
|
1486
|
-
|
|
1486
|
+
l("p", Uo, F(o.title), 1),
|
|
1487
|
+
B(ot, {
|
|
1487
1488
|
modelValue: t.value,
|
|
1488
|
-
"onUpdate:modelValue":
|
|
1489
|
-
style:
|
|
1489
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
|
|
1490
|
+
style: he(o.style)
|
|
1490
1491
|
}, null, 8, ["modelValue", "style"])
|
|
1491
1492
|
]),
|
|
1492
|
-
|
|
1493
|
-
default:
|
|
1494
|
-
|
|
1495
|
-
|
|
1493
|
+
B(tt, { name: "slide-fade" }, {
|
|
1494
|
+
default: $e(() => [
|
|
1495
|
+
K(l("div", To, [
|
|
1496
|
+
ge(n.$slots, "default", {}, void 0, !0)
|
|
1496
1497
|
], 512), [
|
|
1497
1498
|
[Ue, t.value]
|
|
1498
1499
|
])
|
|
@@ -1501,7 +1502,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1501
1502
|
})
|
|
1502
1503
|
]));
|
|
1503
1504
|
}
|
|
1504
|
-
}), Po = /* @__PURE__ */ R(Ro, [["__scopeId", "data-v-90320b87"]]), No = { class: "text-[16px] text-gray-900 font-medium" }, Ho = { class: "grid gap-3" }, qo = /* @__PURE__ */
|
|
1505
|
+
}), Po = /* @__PURE__ */ R(Ro, [["__scopeId", "data-v-90320b87"]]), No = { class: "text-[16px] text-gray-900 font-medium" }, Ho = { class: "grid gap-3" }, qo = /* @__PURE__ */ O({
|
|
1505
1506
|
__name: "vs-container-accordion",
|
|
1506
1507
|
props: {
|
|
1507
1508
|
title: {
|
|
@@ -1518,27 +1519,27 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1518
1519
|
}
|
|
1519
1520
|
},
|
|
1520
1521
|
setup(o) {
|
|
1521
|
-
const e = o, t =
|
|
1522
|
-
return
|
|
1522
|
+
const e = o, t = x(e.isOpen);
|
|
1523
|
+
return ie(
|
|
1523
1524
|
() => e.isOpen,
|
|
1524
1525
|
(n) => {
|
|
1525
1526
|
t.value = n;
|
|
1526
1527
|
}
|
|
1527
|
-
), (n,
|
|
1528
|
+
), (n, s) => (i(), u("div", null, [
|
|
1528
1529
|
l("button", {
|
|
1529
1530
|
type: "button",
|
|
1530
|
-
onClick:
|
|
1531
|
+
onClick: s[0] || (s[0] = (a) => t.value = !t.value),
|
|
1531
1532
|
class: "flex items-center gap-2"
|
|
1532
1533
|
}, [
|
|
1533
|
-
|
|
1534
|
-
class:
|
|
1534
|
+
B(J(Wt), {
|
|
1535
|
+
class: V(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1535
1536
|
}, null, 8, ["class"]),
|
|
1536
|
-
l("span", No,
|
|
1537
|
+
l("span", No, F(o.title), 1)
|
|
1537
1538
|
]),
|
|
1538
|
-
|
|
1539
|
-
default:
|
|
1540
|
-
|
|
1541
|
-
|
|
1539
|
+
B(tt, { name: "slide-fade" }, {
|
|
1540
|
+
default: $e(() => [
|
|
1541
|
+
K(l("div", Ho, [
|
|
1542
|
+
ge(n.$slots, "default", {}, void 0, !0)
|
|
1542
1543
|
], 512), [
|
|
1543
1544
|
[Ue, t.value]
|
|
1544
1545
|
])
|
|
@@ -1547,7 +1548,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1547
1548
|
})
|
|
1548
1549
|
]));
|
|
1549
1550
|
}
|
|
1550
|
-
}), Go = /* @__PURE__ */ R(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */
|
|
1551
|
+
}), Go = /* @__PURE__ */ R(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */ O({
|
|
1551
1552
|
__name: "vs-container-default",
|
|
1552
1553
|
props: {
|
|
1553
1554
|
title: {
|
|
@@ -1562,16 +1563,16 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1562
1563
|
setup(o) {
|
|
1563
1564
|
return (e, t) => (i(), u("div", null, [
|
|
1564
1565
|
l("div", Jo, [
|
|
1565
|
-
l("p", null,
|
|
1566
|
+
l("p", null, F(o.title), 1)
|
|
1566
1567
|
]),
|
|
1567
|
-
|
|
1568
|
+
ge(e.$slots, "default")
|
|
1568
1569
|
]));
|
|
1569
1570
|
}
|
|
1570
1571
|
}), Zo = {
|
|
1571
1572
|
switcher: Po,
|
|
1572
1573
|
accordion: Go,
|
|
1573
1574
|
default: Ko
|
|
1574
|
-
},
|
|
1575
|
+
}, ae = {
|
|
1575
1576
|
Equal: "==",
|
|
1576
1577
|
Inequal: "!=",
|
|
1577
1578
|
Higer: ">",
|
|
@@ -1584,37 +1585,37 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1584
1585
|
Contain: "*",
|
|
1585
1586
|
In: "in",
|
|
1586
1587
|
NotIn: "not_in"
|
|
1587
|
-
}, Wo = (o, e) => String(o) === String(e), Qo = (o, e) => String(o) !== String(e), Xo = (o, e) => o > e, Yo = (o, e) => o >= e, ea = (o, e) => o < e, ta = (o, e) => o <= e, la = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, oa = (o, e) => String(o).startsWith(String(e)), aa = (o, e) => String(o).endsWith(String(e)),
|
|
1588
|
+
}, Wo = (o, e) => String(o) === String(e), Qo = (o, e) => String(o) !== String(e), Xo = (o, e) => o > e, Yo = (o, e) => o >= e, ea = (o, e) => o < e, ta = (o, e) => o <= e, la = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, oa = (o, e) => String(o).startsWith(String(e)), aa = (o, e) => String(o).endsWith(String(e)), sa = (o, e) => String(o).includes(String(e)), ra = (o, e) => Array.isArray(e) ? e.includes(o) : !1, na = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, st = (o, e) => {
|
|
1588
1589
|
if (!e) return !0;
|
|
1589
1590
|
switch (e?.[1]) {
|
|
1590
|
-
case
|
|
1591
|
+
case ae.Equal:
|
|
1591
1592
|
return Wo(o, e?.[2]);
|
|
1592
|
-
case
|
|
1593
|
+
case ae.Inequal:
|
|
1593
1594
|
return Qo(o, e?.[2]);
|
|
1594
|
-
case
|
|
1595
|
+
case ae.Higer:
|
|
1595
1596
|
return Xo(o, e?.[2]);
|
|
1596
|
-
case
|
|
1597
|
+
case ae.HigerOrEqual:
|
|
1597
1598
|
return Yo(o, e?.[2]);
|
|
1598
|
-
case
|
|
1599
|
+
case ae.Lower:
|
|
1599
1600
|
return ea(o, e?.[2]);
|
|
1600
|
-
case
|
|
1601
|
+
case ae.LowerOrEqual:
|
|
1601
1602
|
return ta(o, e?.[2]);
|
|
1602
|
-
case
|
|
1603
|
+
case ae.Between:
|
|
1603
1604
|
return la(o, e?.[2]);
|
|
1604
|
-
case
|
|
1605
|
+
case ae.StartWith:
|
|
1605
1606
|
return oa(o, e?.[2]);
|
|
1606
|
-
case
|
|
1607
|
+
case ae.EndWith:
|
|
1607
1608
|
return aa(o, e?.[2]);
|
|
1608
|
-
case
|
|
1609
|
-
return ra(o, e?.[2]);
|
|
1610
|
-
case le.In:
|
|
1609
|
+
case ae.Contain:
|
|
1611
1610
|
return sa(o, e?.[2]);
|
|
1612
|
-
case
|
|
1611
|
+
case ae.In:
|
|
1612
|
+
return ra(o, e?.[2]);
|
|
1613
|
+
case ae.NotIn:
|
|
1613
1614
|
return na(o, e?.[2]);
|
|
1614
1615
|
default:
|
|
1615
1616
|
return !0;
|
|
1616
1617
|
}
|
|
1617
|
-
}, ia = /* @__PURE__ */
|
|
1618
|
+
}, ia = /* @__PURE__ */ O({
|
|
1618
1619
|
__name: "vs-input-container",
|
|
1619
1620
|
props: {
|
|
1620
1621
|
style: {
|
|
@@ -1635,32 +1636,32 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1635
1636
|
}
|
|
1636
1637
|
},
|
|
1637
1638
|
setup(o) {
|
|
1638
|
-
const e = o, t = Be("formValues", { default: {} }), n = Be("form"),
|
|
1639
|
-
const d =
|
|
1639
|
+
const e = o, t = Be("formValues", { default: {} }), n = Be("form"), s = D(() => e.schema?.filter((r) => {
|
|
1640
|
+
const d = r?.conditions;
|
|
1640
1641
|
if (!d) return !0;
|
|
1641
1642
|
const p = Array.isArray(d) ? d[0] : d, f = t?.value?.[p];
|
|
1642
|
-
return
|
|
1643
|
-
})), a =
|
|
1644
|
-
return (
|
|
1643
|
+
return st(f, d);
|
|
1644
|
+
})), a = D(() => Zo[e.view]);
|
|
1645
|
+
return (r, d) => o.schema?.length ? (i(), te(_e(a.value), {
|
|
1645
1646
|
key: 0,
|
|
1646
1647
|
title: o.title,
|
|
1647
|
-
style:
|
|
1648
|
+
style: he(o.style)
|
|
1648
1649
|
}, {
|
|
1649
|
-
default:
|
|
1650
|
-
(i(!0), u(
|
|
1650
|
+
default: $e(() => [
|
|
1651
|
+
(i(!0), u(ee, null, le(s.value, (p) => (i(), te(rt, Le({
|
|
1651
1652
|
key: p.name
|
|
1652
1653
|
}, { ref_for: !0 }, p, {
|
|
1653
1654
|
item: p,
|
|
1654
|
-
modelValue:
|
|
1655
|
-
"onUpdate:modelValue": (f) =>
|
|
1655
|
+
modelValue: J(t)[p.name],
|
|
1656
|
+
"onUpdate:modelValue": (f) => J(t)[p.name] = f,
|
|
1656
1657
|
style: o.style,
|
|
1657
|
-
error:
|
|
1658
|
+
error: J(n)?.errors?.[p.name]
|
|
1658
1659
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
1659
1660
|
]),
|
|
1660
1661
|
_: 1
|
|
1661
|
-
}, 8, ["title", "style"])) :
|
|
1662
|
+
}, 8, ["title", "style"])) : j("", !0);
|
|
1662
1663
|
}
|
|
1663
|
-
}), ua = { class: "relative" }, da = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ca = { 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" }, pa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, fa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, va = { class: "p-4 mim-h-0 h-full overflow-auto" }, ma = /* @__PURE__ */
|
|
1664
|
+
}), ua = { class: "relative" }, da = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ca = { 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" }, pa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, fa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, va = { class: "p-4 mim-h-0 h-full overflow-auto" }, ma = /* @__PURE__ */ O({
|
|
1664
1665
|
__name: "modal-edit",
|
|
1665
1666
|
props: {
|
|
1666
1667
|
schema: {},
|
|
@@ -1671,11 +1672,11 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1671
1672
|
},
|
|
1672
1673
|
emits: ["close", "save", "edit"],
|
|
1673
1674
|
setup(o, { emit: e }) {
|
|
1674
|
-
const t = o, n = e,
|
|
1675
|
+
const t = o, n = e, s = x(t.schema), a = x(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = x({}), d = x(), p = x(t.mode);
|
|
1675
1676
|
async function f() {
|
|
1676
|
-
const g =
|
|
1677
|
+
const g = r.value.validate();
|
|
1677
1678
|
if (g) {
|
|
1678
|
-
|
|
1679
|
+
pe({ type: "warning", title: "Помилка валідації", message: Object.entries(g).map(([v, C]) => `${v}: ${C}`).join(`
|
|
1679
1680
|
`) });
|
|
1680
1681
|
return;
|
|
1681
1682
|
}
|
|
@@ -1689,29 +1690,29 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1689
1690
|
body: JSON.stringify(a.value)
|
|
1690
1691
|
});
|
|
1691
1692
|
if (v.ok)
|
|
1692
|
-
await v.json(),
|
|
1693
|
+
await v.json(), pe({
|
|
1693
1694
|
type: "success",
|
|
1694
1695
|
title: "Успішно",
|
|
1695
1696
|
message: `Дані успішно ${p.value === "add" ? "збережено" : "оновлено"}`
|
|
1696
1697
|
}), n("save", a.value);
|
|
1697
1698
|
else if (v.status === 400) {
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1699
|
+
const C = await v.json().catch(() => ({}));
|
|
1700
|
+
pe({
|
|
1700
1701
|
type: "warning",
|
|
1701
1702
|
title: "Помилка валідації",
|
|
1702
|
-
message:
|
|
1703
|
+
message: C.message || "Некоректні дані (400)"
|
|
1703
1704
|
});
|
|
1704
|
-
} else v.status === 500 ?
|
|
1705
|
+
} else v.status === 500 ? pe({
|
|
1705
1706
|
type: "error",
|
|
1706
1707
|
title: "Серверна помилка",
|
|
1707
1708
|
message: "Виникла помилка на сервері (500)"
|
|
1708
|
-
}) :
|
|
1709
|
+
}) : pe({
|
|
1709
1710
|
type: "error",
|
|
1710
1711
|
title: "Помилка",
|
|
1711
1712
|
message: `Статус: ${v.status}`
|
|
1712
1713
|
});
|
|
1713
1714
|
} catch (v) {
|
|
1714
|
-
|
|
1715
|
+
pe({
|
|
1715
1716
|
type: "error",
|
|
1716
1717
|
title: "Помилка з’єднання",
|
|
1717
1718
|
message: v.message || "Не вдалося виконати запит"
|
|
@@ -1721,20 +1722,20 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1721
1722
|
function c() {
|
|
1722
1723
|
n("close");
|
|
1723
1724
|
}
|
|
1724
|
-
return
|
|
1725
|
+
return ue(async () => {
|
|
1725
1726
|
if (t.form) {
|
|
1726
1727
|
const g = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
|
|
1727
|
-
|
|
1728
|
+
s.value = g.schema, d.value = g.token;
|
|
1728
1729
|
} else if (t.token) {
|
|
1729
1730
|
d.value = t.token;
|
|
1730
1731
|
const g = await fetch(`/api/form/${d.value}`).then((v) => v.json());
|
|
1731
|
-
|
|
1732
|
+
s.value = g.schema, g.data ? a.value = g.data : p.value = "add";
|
|
1732
1733
|
}
|
|
1733
1734
|
}), (g, v) => (i(), u("div", ua, [
|
|
1734
1735
|
l("div", da, [
|
|
1735
1736
|
l("div", ca, [
|
|
1736
1737
|
l("div", pa, [
|
|
1737
|
-
l("h3", fa,
|
|
1738
|
+
l("h3", fa, F(p.value === "add" ? "Додати" : "Змінити"), 1),
|
|
1738
1739
|
l("button", {
|
|
1739
1740
|
onClick: c,
|
|
1740
1741
|
type: "button",
|
|
@@ -1759,14 +1760,14 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1759
1760
|
]))
|
|
1760
1761
|
]),
|
|
1761
1762
|
l("div", va, [
|
|
1762
|
-
|
|
1763
|
+
s.value ? (i(), te(Ie, {
|
|
1763
1764
|
key: 0,
|
|
1764
|
-
schema:
|
|
1765
|
+
schema: s.value,
|
|
1765
1766
|
values: a.value,
|
|
1766
|
-
"onUpdate:values": v[0] || (v[0] = (
|
|
1767
|
-
form:
|
|
1768
|
-
"onUpdate:form": v[1] || (v[1] = (
|
|
1769
|
-
}, null, 8, ["schema", "values", "form"])) :
|
|
1767
|
+
"onUpdate:values": v[0] || (v[0] = (C) => a.value = C),
|
|
1768
|
+
form: r.value,
|
|
1769
|
+
"onUpdate:form": v[1] || (v[1] = (C) => r.value = C)
|
|
1770
|
+
}, null, 8, ["schema", "values", "form"])) : j("", !0)
|
|
1770
1771
|
]),
|
|
1771
1772
|
l("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" }, [
|
|
1772
1773
|
l("button", {
|
|
@@ -1784,31 +1785,24 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1784
1785
|
])
|
|
1785
1786
|
]));
|
|
1786
1787
|
}
|
|
1787
|
-
}),
|
|
1788
|
-
const t =
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
e(null), r();
|
|
1804
|
-
},
|
|
1805
|
-
onSave: (s) => {
|
|
1806
|
-
e(s), r();
|
|
1807
|
-
}
|
|
1808
|
-
});
|
|
1788
|
+
}), Oe = (o = { mode: "edit", schema: null }) => new Promise((e) => {
|
|
1789
|
+
const { close: t } = ft({
|
|
1790
|
+
title: o.mode === "add" ? "Додати" : "Редагувати",
|
|
1791
|
+
template: "",
|
|
1792
|
+
visible: !0,
|
|
1793
|
+
size: "medium",
|
|
1794
|
+
closeClickBack: !0,
|
|
1795
|
+
content: ma,
|
|
1796
|
+
contentProps: {
|
|
1797
|
+
...o,
|
|
1798
|
+
onClose: () => {
|
|
1799
|
+
e(null), t();
|
|
1800
|
+
},
|
|
1801
|
+
onSave: (n) => {
|
|
1802
|
+
e(n), t();
|
|
1803
|
+
}
|
|
1809
1804
|
}
|
|
1810
1805
|
});
|
|
1811
|
-
a.mount(n);
|
|
1812
1806
|
}), ha = ["aria-expanded", "data-focus"], ga = { class: "flex items-center" }, ba = { class: "truncate text-gray-900 overflow-hidden" }, ya = ["onClick"], xa = ["title"], wa = {
|
|
1813
1807
|
key: 2,
|
|
1814
1808
|
class: "text-gray-500 truncate"
|
|
@@ -1819,7 +1813,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1819
1813
|
}, La = ["aria-disabled", "onClick"], Sa = {
|
|
1820
1814
|
key: 1,
|
|
1821
1815
|
class: "px-3 py-2 text-center text-gray-500"
|
|
1822
|
-
}, Ba = ["disabled"], ja = /* @__PURE__ */
|
|
1816
|
+
}, Ba = ["disabled"], ja = /* @__PURE__ */ O({
|
|
1823
1817
|
__name: "vs-input-select",
|
|
1824
1818
|
props: {
|
|
1825
1819
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1843,338 +1837,336 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
1843
1837
|
},
|
|
1844
1838
|
emits: ["change", "update:modelValue"],
|
|
1845
1839
|
setup(o, { emit: e }) {
|
|
1846
|
-
const t = o, n = e,
|
|
1847
|
-
|
|
1848
|
-
const
|
|
1840
|
+
const t = o, n = e, s = D(() => t.multiple), a = D(() => t.disabled);
|
|
1841
|
+
be(t.style);
|
|
1842
|
+
const r = D({
|
|
1849
1843
|
get: () => t.modelValue,
|
|
1850
|
-
set: (
|
|
1844
|
+
set: (w) => n("update:modelValue", w)
|
|
1851
1845
|
});
|
|
1852
|
-
!
|
|
1853
|
-
const d =
|
|
1846
|
+
!r.value && t.defaultValue && (r.value = t.defaultValue);
|
|
1847
|
+
const d = x(null), p = x(null), f = x(null), c = x(!1), g = x(!1), v = x(null), C = x([]), z = x(-1), U = x([]), T = x(""), N = x(null), _ = x([]), b = D(() => {
|
|
1854
1848
|
if (!_.value.length) return [];
|
|
1855
|
-
const
|
|
1856
|
-
return _.value.map((
|
|
1857
|
-
}), h =
|
|
1858
|
-
let
|
|
1849
|
+
const w = new Map(C.value.map((k) => [k.id?.toString(), k]));
|
|
1850
|
+
return _.value.map((k) => w.get(k?.toString())).filter((k) => !!k);
|
|
1851
|
+
}), h = D(() => t.placeholder || "Select..."), Z = D(() => s.value ? !_.value.length && T.value === "" : !v.value?.text && T.value === ""), P = D(() => a.value ? !1 : s.value ? _.value.length > 0 : !!r.value), M = (w) => s.value ? _.value.some((k) => k?.toString() === w?.toString()) : r.value?.toString() === w?.toString(), H = D(() => {
|
|
1852
|
+
let w = C.value ?? [];
|
|
1859
1853
|
if (T.value.trim() !== "") {
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1854
|
+
const k = T.value.toLowerCase();
|
|
1855
|
+
w = w.filter((A) => A.text?.toLowerCase?.().includes(k));
|
|
1862
1856
|
}
|
|
1863
|
-
if (
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1857
|
+
if (s.value && _.value.length) {
|
|
1858
|
+
const k = new Set(_.value.map((A) => A?.toString()));
|
|
1859
|
+
w = w.filter((A) => !k.has(A.id?.toString()));
|
|
1866
1860
|
}
|
|
1867
|
-
return
|
|
1868
|
-
}),
|
|
1861
|
+
return w;
|
|
1862
|
+
}), Y = async (w) => {
|
|
1869
1863
|
if (!t.data) return [];
|
|
1870
1864
|
try {
|
|
1871
|
-
const
|
|
1872
|
-
return (await fetch(
|
|
1865
|
+
const k = t.api ? t.api : `/suggest/${t.data}`, A = "?json=1", W = w ? `&val=${encodeURIComponent(w)}` : "";
|
|
1866
|
+
return (await fetch(k.concat(A, W)).then((ke) => ke.json())).data ?? [];
|
|
1873
1867
|
} catch {
|
|
1874
1868
|
return [];
|
|
1875
1869
|
}
|
|
1876
|
-
},
|
|
1877
|
-
t.options?.length ?
|
|
1878
|
-
},
|
|
1879
|
-
if (
|
|
1880
|
-
const
|
|
1881
|
-
return
|
|
1882
|
-
},
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
await
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1870
|
+
}, we = async () => {
|
|
1871
|
+
t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y(T.value));
|
|
1872
|
+
}, ce = async (w) => {
|
|
1873
|
+
if (w == null) return null;
|
|
1874
|
+
const k = C.value?.find((W) => W?.id?.toString() === String(w));
|
|
1875
|
+
return k || ((await Y(String(w)))?.[0] ?? null);
|
|
1876
|
+
}, Ce = async (w) => {
|
|
1877
|
+
const k = new Set(C.value.map((W) => W.id?.toString())), A = w.filter((W) => !k.has(W?.toString()));
|
|
1878
|
+
A.length && await A.reduce(async (W, me) => {
|
|
1879
|
+
await W;
|
|
1880
|
+
const ke = await ce(me);
|
|
1881
|
+
ke && C.value.push(ke);
|
|
1888
1882
|
}, Promise.resolve());
|
|
1889
|
-
},
|
|
1890
|
-
a.value || (c.value = !0, await
|
|
1891
|
-
|
|
1883
|
+
}, I = async () => {
|
|
1884
|
+
a.value || (c.value = !0, await we(), await Me(() => {
|
|
1885
|
+
N.value?.focus(), H.value.length ? z.value = 0 : z.value = -1;
|
|
1892
1886
|
}));
|
|
1893
|
-
},
|
|
1894
|
-
c.value = !1,
|
|
1895
|
-
},
|
|
1887
|
+
}, $ = () => {
|
|
1888
|
+
c.value = !1, z.value = -1;
|
|
1889
|
+
}, S = async (w) => {
|
|
1896
1890
|
if (a.value) return;
|
|
1897
|
-
!c.value ? await
|
|
1898
|
-
},
|
|
1899
|
-
c.value ?
|
|
1900
|
-
},
|
|
1901
|
-
|
|
1902
|
-
},
|
|
1903
|
-
|
|
1904
|
-
},
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
})) : (v.value =
|
|
1908
|
-
},
|
|
1909
|
-
|
|
1910
|
-
},
|
|
1911
|
-
if (!
|
|
1912
|
-
const
|
|
1913
|
-
let
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
},
|
|
1918
|
-
a.value || !c.value && (
|
|
1919
|
-
},
|
|
1891
|
+
!c.value ? await I() : $();
|
|
1892
|
+
}, q = async () => {
|
|
1893
|
+
c.value ? N.value?.focus() : await I();
|
|
1894
|
+
}, m = () => {
|
|
1895
|
+
s.value ? (_.value = [], r.value = [], n("change", [])) : (v.value = null, r.value = null, n("change", null)), T.value = "", Me(() => N.value?.focus());
|
|
1896
|
+
}, y = (w) => {
|
|
1897
|
+
s.value && (_.value = _.value.filter((k) => k?.toString() !== w?.toString()), r.value = [..._.value], n("change", r.value), Me(() => N.value?.focus()));
|
|
1898
|
+
}, E = (w) => {
|
|
1899
|
+
s.value ? (M(w.id) || (_.value = [..._.value, w.id], r.value = [..._.value], n("change", r.value)), T.value = "", Me(() => {
|
|
1900
|
+
N.value?.focus(), z.value = Math.min(z.value, H.value.length - 1);
|
|
1901
|
+
})) : (v.value = w, r.value = w.id, n("change", r.value), T.value = "", $());
|
|
1902
|
+
}, G = (w) => {
|
|
1903
|
+
M(w.id) || E(w);
|
|
1904
|
+
}, oe = (w, k) => {
|
|
1905
|
+
if (!w || !k) return;
|
|
1906
|
+
const A = w.offsetTop, W = A + w.offsetHeight, me = k.scrollTop, ke = me + k.clientHeight;
|
|
1907
|
+
let Ae = k.scrollTop;
|
|
1908
|
+
A < me ? Ae = A - 80 : W > ke && (Ae = W - k.clientHeight + 4);
|
|
1909
|
+
const ut = k;
|
|
1910
|
+
ut.scrollTop = Ae;
|
|
1911
|
+
}, Ve = async (w) => {
|
|
1912
|
+
a.value || !c.value && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), await I());
|
|
1913
|
+
}, fe = (w) => {
|
|
1920
1914
|
if (!c.value) return;
|
|
1921
|
-
const { key:
|
|
1922
|
-
if (
|
|
1923
|
-
|
|
1924
|
-
else if (
|
|
1925
|
-
|
|
1926
|
-
else if (
|
|
1927
|
-
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
} else
|
|
1931
|
-
}, be = () => {
|
|
1932
|
-
a.value || (g.value = !0);
|
|
1915
|
+
const { key: k } = w;
|
|
1916
|
+
if (k === "ArrowDown")
|
|
1917
|
+
w.preventDefault(), z.value + 1 < H.value.length && (z.value += 1, oe(U.value[z.value], f.value));
|
|
1918
|
+
else if (k === "ArrowUp")
|
|
1919
|
+
w.preventDefault(), z.value > 0 && (z.value -= 1, oe(U.value[z.value], f.value));
|
|
1920
|
+
else if (k === "Enter") {
|
|
1921
|
+
w.preventDefault();
|
|
1922
|
+
const A = H.value[z.value];
|
|
1923
|
+
A && E(A);
|
|
1924
|
+
} else k === "Escape" ? (w.preventDefault(), $()) : k === "Backspace" ? s.value && T.value === "" && _.value.length && (_.value = _.value.slice(0, -1), r.value = [..._.value], n("change", r.value)) : k === "Home" ? (z.value = 0, oe(U.value[0], f.value)) : k === "End" ? (z.value = H.value.length - 1, oe(U.value[z.value], f.value)) : k === "Tab" && $();
|
|
1933
1925
|
}, ye = () => {
|
|
1926
|
+
a.value || (g.value = !0);
|
|
1927
|
+
}, xe = () => {
|
|
1934
1928
|
g.value = !1, T.value = "";
|
|
1935
|
-
},
|
|
1936
|
-
|
|
1937
|
-
}, Te = (
|
|
1938
|
-
d.value && (d.value.contains(
|
|
1939
|
-
}, Re = (
|
|
1940
|
-
c.value && f.value && !f.value.contains(
|
|
1929
|
+
}, ve = (w) => {
|
|
1930
|
+
w.key === "Escape" && c.value && $();
|
|
1931
|
+
}, Te = (w) => {
|
|
1932
|
+
d.value && (d.value.contains(w.target) || $());
|
|
1933
|
+
}, Re = (w) => {
|
|
1934
|
+
c.value && f.value && !f.value.contains(w.target) && $();
|
|
1941
1935
|
};
|
|
1942
|
-
|
|
1943
|
-
|
|
1936
|
+
ie(() => t.options, (w) => {
|
|
1937
|
+
w?.length && (C.value = [...w]);
|
|
1944
1938
|
}, { immediate: !0 });
|
|
1945
1939
|
const Pe = async () => {
|
|
1946
|
-
if (
|
|
1947
|
-
Array.isArray(
|
|
1940
|
+
if (s.value)
|
|
1941
|
+
Array.isArray(r.value) ? _.value = [...r.value] : (_.value = r.value == null ? [] : [r.value], r.value = [..._.value]), !t.options?.length && t.data && await Ce(_.value);
|
|
1948
1942
|
else {
|
|
1949
|
-
if (Array.isArray(
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1943
|
+
if (Array.isArray(r.value)) {
|
|
1944
|
+
const w = r.value[0] ?? null;
|
|
1945
|
+
r.value = w ?? null;
|
|
1952
1946
|
}
|
|
1953
|
-
v.value = await
|
|
1947
|
+
v.value = await ce(r.value);
|
|
1954
1948
|
}
|
|
1955
1949
|
};
|
|
1956
|
-
|
|
1950
|
+
ie(r, () => {
|
|
1957
1951
|
Pe();
|
|
1958
|
-
}),
|
|
1959
|
-
addEventListener("keydown",
|
|
1960
|
-
}),
|
|
1961
|
-
removeEventListener("keydown",
|
|
1952
|
+
}), ue(async () => {
|
|
1953
|
+
addEventListener("keydown", ve), addEventListener("scroll", Re, !0), document.addEventListener("click", Te, !0), t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y("")), await Pe();
|
|
1954
|
+
}), Ee(() => {
|
|
1955
|
+
removeEventListener("keydown", ve), removeEventListener("scroll", Re, !0), document.removeEventListener("click", Te, !0);
|
|
1962
1956
|
});
|
|
1963
|
-
async function
|
|
1957
|
+
async function it() {
|
|
1964
1958
|
if (!t.add) return;
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1959
|
+
const w = await Oe({ form: t.add.form, mode: "add" });
|
|
1960
|
+
w && (await fetch(`/api/table/${t.add.token}`, {
|
|
1967
1961
|
method: "POST",
|
|
1968
1962
|
headers: { "Content-Type": "application/json" },
|
|
1969
|
-
body: JSON.stringify(
|
|
1970
|
-
}).then((
|
|
1963
|
+
body: JSON.stringify(w)
|
|
1964
|
+
}).then((k) => k.json()), !t.options?.length && t.data && (C.value = await Y(T.value)));
|
|
1971
1965
|
}
|
|
1972
|
-
return (
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1966
|
+
return (w, k) => (i(), u("div", {
|
|
1967
|
+
class: "flex gap-1 w-full",
|
|
1968
|
+
ref_key: "selectRoot",
|
|
1969
|
+
ref: d,
|
|
1970
|
+
onClick: k[2] || (k[2] = ne(() => {
|
|
1971
|
+
}, ["stop"]))
|
|
1972
|
+
}, [
|
|
1973
|
+
l("div", {
|
|
1974
|
+
class: V(["relative w-full font-sans", t.customClass])
|
|
1980
1975
|
}, [
|
|
1976
|
+
k[7] || (k[7] = l("span", {
|
|
1977
|
+
id: "react-select-live-region",
|
|
1978
|
+
class: "sr-only"
|
|
1979
|
+
}, null, -1)),
|
|
1980
|
+
k[8] || (k[8] = l("span", {
|
|
1981
|
+
"aria-live": "polite",
|
|
1982
|
+
"aria-atomic": "false",
|
|
1983
|
+
"aria-relevant": "additions text",
|
|
1984
|
+
role: "log",
|
|
1985
|
+
class: "sr-only"
|
|
1986
|
+
}, null, -1)),
|
|
1981
1987
|
l("div", {
|
|
1982
|
-
class:
|
|
1988
|
+
class: V([
|
|
1989
|
+
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
1990
|
+
"border-gray-300 hover:border-gray-400",
|
|
1991
|
+
c.value || g.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
1992
|
+
a.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
1993
|
+
]),
|
|
1994
|
+
role: "combobox",
|
|
1995
|
+
"aria-expanded": c.value,
|
|
1996
|
+
"aria-haspopup": "listbox",
|
|
1997
|
+
onKeydown: Ve,
|
|
1998
|
+
onClick: q,
|
|
1999
|
+
"data-focus": c.value || g.value ? "true" : "false"
|
|
1983
2000
|
}, [
|
|
1984
|
-
w[7] || (w[7] = l("span", {
|
|
1985
|
-
id: "react-select-live-region",
|
|
1986
|
-
class: "sr-only"
|
|
1987
|
-
}, null, -1)),
|
|
1988
|
-
w[8] || (w[8] = l("span", {
|
|
1989
|
-
"aria-live": "polite",
|
|
1990
|
-
"aria-atomic": "false",
|
|
1991
|
-
"aria-relevant": "additions text",
|
|
1992
|
-
role: "log",
|
|
1993
|
-
class: "sr-only"
|
|
1994
|
-
}, null, -1)),
|
|
1995
2001
|
l("div", {
|
|
1996
|
-
class:
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
c.value || g.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
2000
|
-
a.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
2001
|
-
]),
|
|
2002
|
-
role: "combobox",
|
|
2003
|
-
"aria-expanded": c.value,
|
|
2004
|
-
"aria-haspopup": "listbox",
|
|
2005
|
-
onKeydown: $e,
|
|
2006
|
-
onClick: _e,
|
|
2007
|
-
"data-focus": c.value || g.value ? "true" : "false"
|
|
2002
|
+
class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
2003
|
+
ref_key: "triggerRef",
|
|
2004
|
+
ref: p
|
|
2008
2005
|
}, [
|
|
2009
|
-
|
|
2010
|
-
class: "flex
|
|
2011
|
-
|
|
2012
|
-
ref: p
|
|
2006
|
+
s.value && _.value.length ? (i(!0), u(ee, { key: 0 }, le(b.value, (A) => (i(), u("div", {
|
|
2007
|
+
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2008
|
+
key: A.id
|
|
2013
2009
|
}, [
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
key: U.id
|
|
2017
|
-
}, [
|
|
2018
|
-
l("div", ga, [
|
|
2019
|
-
U?.color ? (i(), u("span", {
|
|
2020
|
-
key: 0,
|
|
2021
|
-
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2022
|
-
style: me({ backgroundColor: U?.color })
|
|
2023
|
-
}, null, 4)) : B("", !0),
|
|
2024
|
-
G((i(), u("div", ba, [
|
|
2025
|
-
oe(E(U.text), 1)
|
|
2026
|
-
])), [
|
|
2027
|
-
[H, U.text]
|
|
2028
|
-
])
|
|
2029
|
-
]),
|
|
2030
|
-
l("div", {
|
|
2031
|
-
role: "button",
|
|
2032
|
-
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2033
|
-
onClick: re((de) => $(U.id), ["stop"])
|
|
2034
|
-
}, w[3] || (w[3] = [
|
|
2035
|
-
l("svg", {
|
|
2036
|
-
height: "14",
|
|
2037
|
-
width: "14",
|
|
2038
|
-
viewBox: "0 0 20 20",
|
|
2039
|
-
"aria-hidden": "true",
|
|
2040
|
-
focusable: "false",
|
|
2041
|
-
class: "inline-block fill-current stroke-current leading-none stroke-0"
|
|
2042
|
-
}, [
|
|
2043
|
-
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
2044
|
-
], -1)
|
|
2045
|
-
]), 8, ya)
|
|
2046
|
-
]))), 128)) : !r.value && !g.value && v.value?.text && T.value === "" ? G((i(), u("div", {
|
|
2047
|
-
key: 1,
|
|
2048
|
-
class: S(["truncate text-gray-900"]),
|
|
2049
|
-
title: v.value.text
|
|
2050
|
-
}, [
|
|
2051
|
-
v.value?.color ? (i(), u("span", {
|
|
2010
|
+
l("div", ga, [
|
|
2011
|
+
A?.color ? (i(), u("span", {
|
|
2052
2012
|
key: 0,
|
|
2053
|
-
class: "w-[
|
|
2054
|
-
style:
|
|
2055
|
-
}, null, 4)) :
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
])
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
ref: P,
|
|
2068
|
-
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
2069
|
-
autocapitalize: "none",
|
|
2070
|
-
autocomplete: "off",
|
|
2071
|
-
autocorrect: "off",
|
|
2072
|
-
spellcheck: "false",
|
|
2073
|
-
type: "text",
|
|
2074
|
-
tabindex: "0",
|
|
2075
|
-
"aria-autocomplete": "list",
|
|
2076
|
-
placeholder: (r.value && _.value.length ? " " : null) || (g.value && !T.value?.length ? v.value?.text : " "),
|
|
2077
|
-
"onUpdate:modelValue": w[0] || (w[0] = (U) => T.value = U),
|
|
2078
|
-
onFocus: be,
|
|
2079
|
-
onBlur: ye,
|
|
2080
|
-
onKeydown: pe
|
|
2081
|
-
}, null, 40, _a)), [
|
|
2082
|
-
[ie, T.value]
|
|
2083
|
-
]) : B("", !0)
|
|
2084
|
-
])
|
|
2085
|
-
], 512),
|
|
2086
|
-
l("div", $a, [
|
|
2087
|
-
C.value ? (i(), u("button", {
|
|
2088
|
-
key: 0,
|
|
2089
|
-
type: "button",
|
|
2090
|
-
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2091
|
-
"aria-hidden": "true",
|
|
2092
|
-
disabled: a.value,
|
|
2093
|
-
onClick: re(b, ["stop"])
|
|
2094
|
-
}, w[4] || (w[4] = [
|
|
2013
|
+
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2014
|
+
style: he({ backgroundColor: A?.color })
|
|
2015
|
+
}, null, 4)) : j("", !0),
|
|
2016
|
+
K((i(), u("div", ba, [
|
|
2017
|
+
se(F(A.text), 1)
|
|
2018
|
+
])), [
|
|
2019
|
+
[J(qe), A.text]
|
|
2020
|
+
])
|
|
2021
|
+
]),
|
|
2022
|
+
l("div", {
|
|
2023
|
+
role: "button",
|
|
2024
|
+
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2025
|
+
onClick: ne((W) => y(A.id), ["stop"])
|
|
2026
|
+
}, k[3] || (k[3] = [
|
|
2095
2027
|
l("svg", {
|
|
2096
|
-
height: "
|
|
2097
|
-
width: "
|
|
2028
|
+
height: "14",
|
|
2029
|
+
width: "14",
|
|
2098
2030
|
viewBox: "0 0 20 20",
|
|
2099
|
-
|
|
2031
|
+
"aria-hidden": "true",
|
|
2032
|
+
focusable: "false",
|
|
2033
|
+
class: "inline-block fill-current stroke-current leading-none stroke-0"
|
|
2100
2034
|
}, [
|
|
2101
2035
|
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
2102
2036
|
], -1)
|
|
2103
|
-
]), 8,
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
"aria-hidden": "true",
|
|
2109
|
-
disabled: a.value,
|
|
2110
|
-
onClick: w[1] || (w[1] = re((U) => Ae(), ["stop"]))
|
|
2111
|
-
}, w[5] || (w[5] = [
|
|
2112
|
-
l("svg", {
|
|
2113
|
-
height: "20",
|
|
2114
|
-
width: "20",
|
|
2115
|
-
viewBox: "0 0 20 20",
|
|
2116
|
-
class: "fill-current"
|
|
2117
|
-
}, [
|
|
2118
|
-
l("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" })
|
|
2119
|
-
], -1)
|
|
2120
|
-
]), 8, Va)
|
|
2121
|
-
])
|
|
2122
|
-
], 42, ha),
|
|
2123
|
-
c.value ? (i(), u("div", Ma, [
|
|
2124
|
-
l("div", {
|
|
2125
|
-
class: "max-h-[300px] overflow-y-auto py-1",
|
|
2126
|
-
ref_key: "listRef",
|
|
2127
|
-
ref: f
|
|
2037
|
+
]), 8, ya)
|
|
2038
|
+
]))), 128)) : !s.value && !g.value && v.value?.text && T.value === "" ? K((i(), u("div", {
|
|
2039
|
+
key: 1,
|
|
2040
|
+
class: V(["truncate text-gray-900"]),
|
|
2041
|
+
title: v.value.text
|
|
2128
2042
|
}, [
|
|
2129
|
-
|
|
2130
|
-
key:
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2043
|
+
v.value?.color ? (i(), u("span", {
|
|
2044
|
+
key: 0,
|
|
2045
|
+
class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
|
|
2046
|
+
style: he({ backgroundColor: v.value?.color })
|
|
2047
|
+
}, null, 4)) : j("", !0),
|
|
2048
|
+
l("span", {
|
|
2049
|
+
class: V({ "pl-5": v.value?.color })
|
|
2050
|
+
}, F(v.value.text), 3)
|
|
2051
|
+
], 8, xa)), [
|
|
2052
|
+
[J(qe), v.value.text]
|
|
2053
|
+
]) : j("", !0),
|
|
2054
|
+
Z.value ? (i(), u("div", wa, F(h.value), 1)) : j("", !0),
|
|
2055
|
+
l("div", ka, [
|
|
2056
|
+
!a.value && w.search ? K((i(), u("input", {
|
|
2057
|
+
key: 0,
|
|
2058
|
+
ref_key: "inputRef",
|
|
2059
|
+
ref: N,
|
|
2060
|
+
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
2061
|
+
autocapitalize: "none",
|
|
2062
|
+
autocomplete: "off",
|
|
2063
|
+
autocorrect: "off",
|
|
2064
|
+
spellcheck: "false",
|
|
2065
|
+
type: "text",
|
|
2066
|
+
tabindex: "0",
|
|
2067
|
+
"aria-autocomplete": "list",
|
|
2068
|
+
placeholder: (s.value && _.value.length ? " " : null) || (g.value && !T.value?.length ? v.value?.text : " "),
|
|
2069
|
+
"onUpdate:modelValue": k[0] || (k[0] = (A) => T.value = A),
|
|
2070
|
+
onFocus: ye,
|
|
2071
|
+
onBlur: xe,
|
|
2072
|
+
onKeydown: fe
|
|
2073
|
+
}, null, 40, _a)), [
|
|
2074
|
+
[de, T.value]
|
|
2075
|
+
]) : j("", !0)
|
|
2076
|
+
])
|
|
2077
|
+
], 512),
|
|
2078
|
+
l("div", $a, [
|
|
2079
|
+
P.value ? (i(), u("button", {
|
|
2080
|
+
key: 0,
|
|
2081
|
+
type: "button",
|
|
2082
|
+
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2083
|
+
"aria-hidden": "true",
|
|
2084
|
+
disabled: a.value,
|
|
2085
|
+
onClick: ne(m, ["stop"])
|
|
2086
|
+
}, k[4] || (k[4] = [
|
|
2087
|
+
l("svg", {
|
|
2088
|
+
height: "20",
|
|
2089
|
+
width: "20",
|
|
2090
|
+
viewBox: "0 0 20 20",
|
|
2091
|
+
class: "fill-current"
|
|
2141
2092
|
}, [
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2093
|
+
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
2094
|
+
], -1)
|
|
2095
|
+
]), 8, Ca)) : j("", !0),
|
|
2096
|
+
k[6] || (k[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2097
|
+
l("button", {
|
|
2098
|
+
type: "button",
|
|
2099
|
+
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2100
|
+
"aria-hidden": "true",
|
|
2101
|
+
disabled: a.value,
|
|
2102
|
+
onClick: k[1] || (k[1] = ne((A) => S(), ["stop"]))
|
|
2103
|
+
}, k[5] || (k[5] = [
|
|
2104
|
+
l("svg", {
|
|
2105
|
+
height: "20",
|
|
2106
|
+
width: "20",
|
|
2107
|
+
viewBox: "0 0 20 20",
|
|
2108
|
+
class: "fill-current"
|
|
2109
|
+
}, [
|
|
2110
|
+
l("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" })
|
|
2111
|
+
], -1)
|
|
2112
|
+
]), 8, Va)
|
|
2113
|
+
])
|
|
2114
|
+
], 42, ha),
|
|
2115
|
+
c.value ? (i(), u("div", Ma, [
|
|
2116
|
+
l("div", {
|
|
2117
|
+
class: "max-h-[300px] overflow-y-auto py-1",
|
|
2118
|
+
ref_key: "listRef",
|
|
2119
|
+
ref: f
|
|
2120
|
+
}, [
|
|
2121
|
+
H.value.length ? (i(!0), u(ee, { key: 0 }, le(H.value, (A, W) => (i(), u("div", {
|
|
2122
|
+
key: A.id,
|
|
2123
|
+
ref_for: !0,
|
|
2124
|
+
ref: (me) => U.value[W] = me,
|
|
2125
|
+
class: V([
|
|
2126
|
+
"flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
|
|
2127
|
+
z.value === W ? "bg-blue-300" : "",
|
|
2128
|
+
M(A.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
|
|
2129
|
+
]),
|
|
2130
|
+
"aria-disabled": M(A.id) ? "true" : "false",
|
|
2131
|
+
role: "option",
|
|
2132
|
+
tabindex: "-1",
|
|
2133
|
+
onClick: (me) => G(A)
|
|
2134
|
+
}, [
|
|
2135
|
+
A?.color ? (i(), u("span", {
|
|
2136
|
+
key: 0,
|
|
2137
|
+
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2138
|
+
style: he({ backgroundColor: A?.color })
|
|
2139
|
+
}, null, 4)) : j("", !0),
|
|
2140
|
+
l("div", {
|
|
2141
|
+
class: V([
|
|
2142
|
+
"leading-[19px]",
|
|
2143
|
+
z.value === A.id ? "text-white" : "",
|
|
2144
|
+
// active style like react-select
|
|
2145
|
+
(z.value === W, "")
|
|
2146
|
+
])
|
|
2147
|
+
}, F(A.text), 3)
|
|
2148
|
+
], 10, La))), 128)) : (i(), u("div", Sa, " No options "))
|
|
2149
|
+
], 512)
|
|
2150
|
+
])) : j("", !0)
|
|
2151
|
+
], 2),
|
|
2152
|
+
t.add ? (i(), u("button", {
|
|
2153
|
+
key: 0,
|
|
2154
|
+
onClick: it,
|
|
2155
|
+
class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
|
|
2156
|
+
disabled: a.value,
|
|
2157
|
+
type: "button"
|
|
2158
|
+
}, [
|
|
2159
|
+
B(je, {
|
|
2160
|
+
width: "16",
|
|
2161
|
+
height: "16"
|
|
2162
|
+
}),
|
|
2163
|
+
k[9] || (k[9] = l("span", null, "Додати", -1))
|
|
2164
|
+
], 8, Ba)) : j("", !0)
|
|
2165
|
+
], 512));
|
|
2174
2166
|
}
|
|
2175
|
-
}), Ia = ["placeholder", "disabled"],
|
|
2167
|
+
}), Ia = ["placeholder", "disabled"], za = /* @__PURE__ */ O({
|
|
2176
2168
|
__name: "vs-input-textarea",
|
|
2177
|
-
props: /* @__PURE__ */
|
|
2169
|
+
props: /* @__PURE__ */ Q({
|
|
2178
2170
|
style: { default: () => ({}) },
|
|
2179
2171
|
customClass: { default: "" },
|
|
2180
2172
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2188,21 +2180,21 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
2188
2180
|
}),
|
|
2189
2181
|
emits: ["update:modelValue"],
|
|
2190
2182
|
setup(o) {
|
|
2191
|
-
const e = o, { inputClass: t } =
|
|
2192
|
-
return (
|
|
2193
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
2194
|
-
placeholder:
|
|
2195
|
-
disabled:
|
|
2183
|
+
const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
|
|
2184
|
+
return (s, a) => K((i(), u("textarea", {
|
|
2185
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
|
|
2186
|
+
placeholder: s.placeholder,
|
|
2187
|
+
disabled: s.disabled,
|
|
2196
2188
|
row: "2",
|
|
2197
|
-
class:
|
|
2189
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [J(t)]]),
|
|
2198
2190
|
style: {
|
|
2199
2191
|
border: "1px solid #CFD9E0"
|
|
2200
2192
|
}
|
|
2201
2193
|
}, null, 10, Ia)), [
|
|
2202
|
-
[
|
|
2194
|
+
[de, n.value]
|
|
2203
2195
|
]);
|
|
2204
2196
|
}
|
|
2205
|
-
}),
|
|
2197
|
+
}), Aa = {}, Oa = {
|
|
2206
2198
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2207
2199
|
viewBox: "0 0 24 24",
|
|
2208
2200
|
fill: "none",
|
|
@@ -2212,8 +2204,8 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
|
|
|
2212
2204
|
"stroke-linejoin": "round",
|
|
2213
2205
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
2214
2206
|
};
|
|
2215
|
-
function
|
|
2216
|
-
return i(), u("svg",
|
|
2207
|
+
function Ea(o, e) {
|
|
2208
|
+
return i(), u("svg", Oa, e[0] || (e[0] = [
|
|
2217
2209
|
l("path", {
|
|
2218
2210
|
stroke: "none",
|
|
2219
2211
|
d: "M0 0h24v24H0z",
|
|
@@ -2223,7 +2215,7 @@ function Fa(o, e) {
|
|
|
2223
2215
|
l("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
2224
2216
|
]));
|
|
2225
2217
|
}
|
|
2226
|
-
const
|
|
2218
|
+
const Fa = /* @__PURE__ */ R(Aa, [["render", Ea]]), Da = {}, Ua = {
|
|
2227
2219
|
class: "flex-shrink-0 mt-0.5 size-3.5",
|
|
2228
2220
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2229
2221
|
viewBox: "0 0 24 24",
|
|
@@ -2296,20 +2288,20 @@ const Za = /* @__PURE__ */ R(Ga, [["render", Ka]]), Wa = {}, Qa = {
|
|
|
2296
2288
|
};
|
|
2297
2289
|
function Xa(o, e) {
|
|
2298
2290
|
return i(), u("svg", Qa, e[0] || (e[0] = [
|
|
2299
|
-
|
|
2291
|
+
re('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
2300
2292
|
]));
|
|
2301
2293
|
}
|
|
2302
|
-
const
|
|
2294
|
+
const Qe = /* @__PURE__ */ R(Wa, [["render", Xa]]), Ya = {}, es = {
|
|
2303
2295
|
viewBox: "0 0 178 90",
|
|
2304
2296
|
fill: "none",
|
|
2305
2297
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2306
2298
|
};
|
|
2307
|
-
function
|
|
2308
|
-
return i(), u("svg",
|
|
2309
|
-
|
|
2299
|
+
function ts(o, e) {
|
|
2300
|
+
return i(), u("svg", es, e[0] || (e[0] = [
|
|
2301
|
+
re('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
|
2310
2302
|
]));
|
|
2311
2303
|
}
|
|
2312
|
-
const
|
|
2304
|
+
const ls = /* @__PURE__ */ R(Ya, [["render", ts]]), os = {}, as = {
|
|
2313
2305
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2314
2306
|
viewBox: "0 0 24 24",
|
|
2315
2307
|
fill: "none",
|
|
@@ -2318,18 +2310,18 @@ const lr = /* @__PURE__ */ R(Ya, [["render", tr]]), or = {}, ar = {
|
|
|
2318
2310
|
"stroke-linecap": "round",
|
|
2319
2311
|
"stroke-linejoin": "round"
|
|
2320
2312
|
};
|
|
2321
|
-
function
|
|
2322
|
-
return i(), u("svg",
|
|
2313
|
+
function ss(o, e) {
|
|
2314
|
+
return i(), u("svg", as, e[0] || (e[0] = [
|
|
2323
2315
|
l("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)
|
|
2324
2316
|
]));
|
|
2325
2317
|
}
|
|
2326
|
-
const
|
|
2318
|
+
const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable border rounded-xl w-full flex-grow" }, is = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, us = { class: "relative w-full" }, ds = { class: "table-wrapper flex gap-2" }, cs = { class: "vs-popover inline-block text-slate-700" }, ps = { class: "text-center" }, fs = { class: "" }, vs = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ms = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, hs = { class: "text-sm items-center text-gray-800 flex gap-1" }, gs = { class: "w-full overflow-x-auto" }, bs = { class: "w-full table-auto caption-bottom text-sm" }, ys = { class: "[&_tr]:border-b" }, xs = { 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" }, ws = { 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" }, ks = {
|
|
2327
2319
|
key: 0,
|
|
2328
2320
|
colspan: "100%",
|
|
2329
2321
|
class: "text-center"
|
|
2330
|
-
},
|
|
2322
|
+
}, _s = { class: "w-full" }, $s = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Cs = ["onDragstart", "onDragover", "onDrop"], Vs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ms = { class: "flex items-center justify-center" }, Ls = { 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" }, Ss = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Bs = { class: "flex items-center justify-center gap-2" }, js = ["onClick"], Is = ["onClick"], zs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, As = /* @__PURE__ */ O({
|
|
2331
2323
|
__name: "vs-input-datatable",
|
|
2332
|
-
props: /* @__PURE__ */
|
|
2324
|
+
props: /* @__PURE__ */ Q({
|
|
2333
2325
|
colModel: {},
|
|
2334
2326
|
style: {},
|
|
2335
2327
|
customClass: {},
|
|
@@ -2344,93 +2336,96 @@ const sr = /* @__PURE__ */ R(or, [["render", rr]]), nr = { class: "vs-datatable
|
|
|
2344
2336
|
}),
|
|
2345
2337
|
emits: ["update:modelValue"],
|
|
2346
2338
|
setup(o) {
|
|
2347
|
-
const e = o, t =
|
|
2348
|
-
if (!
|
|
2349
|
-
const
|
|
2350
|
-
return t.value.filter((
|
|
2351
|
-
const
|
|
2352
|
-
return
|
|
2339
|
+
const e = o, t = X(o, "modelValue"), n = x({}), s = x(""), a = D(() => {
|
|
2340
|
+
if (!s.value) return t.value ?? [];
|
|
2341
|
+
const I = s.value.toLowerCase();
|
|
2342
|
+
return t.value.filter(($) => e.colModel?.some((S) => {
|
|
2343
|
+
const q = $[S.key];
|
|
2344
|
+
return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(I) : String(q).toLowerCase().includes(I) : !1;
|
|
2353
2345
|
}));
|
|
2354
|
-
}),
|
|
2355
|
-
|
|
2356
|
-
}, v = (
|
|
2357
|
-
d.value =
|
|
2358
|
-
},
|
|
2359
|
-
if (
|
|
2360
|
-
|
|
2346
|
+
}), r = x(null), d = x(null), p = x(!1), f = x(null), c = x({ top: 0, left: 0 }), g = (I) => {
|
|
2347
|
+
r.value = I;
|
|
2348
|
+
}, v = (I) => {
|
|
2349
|
+
d.value = I;
|
|
2350
|
+
}, C = (I) => {
|
|
2351
|
+
if (r.value === null || r.value === I) {
|
|
2352
|
+
r.value = null, d.value = null;
|
|
2361
2353
|
return;
|
|
2362
2354
|
}
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2365
|
-
},
|
|
2366
|
-
const
|
|
2367
|
-
c.value = { top:
|
|
2368
|
-
},
|
|
2355
|
+
const $ = [...t.value], [S] = $.splice(r.value, 1);
|
|
2356
|
+
$.splice(I, 0, S), t.value = $, r.value = null, d.value = null;
|
|
2357
|
+
}, z = (I) => {
|
|
2358
|
+
const S = I.currentTarget.getBoundingClientRect();
|
|
2359
|
+
c.value = { top: S.bottom + window.scrollY, left: S.left + window.scrollX }, p.value = !p.value;
|
|
2360
|
+
}, U = () => {
|
|
2369
2361
|
f.value && f.value.click();
|
|
2370
|
-
}, T = (
|
|
2371
|
-
const
|
|
2372
|
-
if (!
|
|
2373
|
-
const
|
|
2374
|
-
|
|
2362
|
+
}, T = (I) => {
|
|
2363
|
+
const S = I.target.files?.[0];
|
|
2364
|
+
if (!S) return;
|
|
2365
|
+
const q = new FileReader();
|
|
2366
|
+
q.onload = (m) => {
|
|
2375
2367
|
try {
|
|
2376
|
-
const
|
|
2377
|
-
if (typeof
|
|
2378
|
-
const
|
|
2379
|
-
Array.isArray(
|
|
2368
|
+
const y = m.target?.result;
|
|
2369
|
+
if (typeof y == "string") {
|
|
2370
|
+
const E = JSON.parse(y);
|
|
2371
|
+
Array.isArray(E) && t.value.push(...E);
|
|
2380
2372
|
}
|
|
2381
|
-
} catch (
|
|
2382
|
-
console.error("Error parsing file:",
|
|
2373
|
+
} catch (y) {
|
|
2374
|
+
console.error("Error parsing file:", y);
|
|
2383
2375
|
}
|
|
2384
|
-
},
|
|
2385
|
-
},
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2376
|
+
}, q.readAsText(S);
|
|
2377
|
+
}, N = () => {
|
|
2378
|
+
const I = JSON.stringify(t.value, null, 2), $ = new Blob([I], { type: "application/json" }), S = URL.createObjectURL($), q = document.createElement("a");
|
|
2379
|
+
q.href = S, q.download = "data.json", q.click(), URL.revokeObjectURL(S);
|
|
2388
2380
|
};
|
|
2389
|
-
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2392
|
-
n.value[
|
|
2381
|
+
ue(async () => {
|
|
2382
|
+
const I = e.colModel?.filter(($) => $.data);
|
|
2383
|
+
I?.length && Promise.all(I.map(async ($) => {
|
|
2384
|
+
n.value[$.key] = await fetch(`/api/suggest/${$.data}`).then((S) => S.json());
|
|
2393
2385
|
}));
|
|
2394
2386
|
});
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
}
|
|
2400
|
-
C && (Array.isArray(t.value) ? t.value = [...t.value, C] : t.value = [C]);
|
|
2387
|
+
const _ = x(""), b = x(!1);
|
|
2388
|
+
let h = "edit", Z = 0;
|
|
2389
|
+
const P = x({}), M = x({});
|
|
2390
|
+
async function H() {
|
|
2391
|
+
_.value = "Додати", b.value = !0, h = "add", P.value = {};
|
|
2401
2392
|
}
|
|
2402
|
-
function
|
|
2403
|
-
return n.value[
|
|
2393
|
+
function Y(I, $) {
|
|
2394
|
+
return n.value[$.key] && I[$.key] ? n.value[$.key].find((S) => S.id.toString() === I[$.key].toString())?.text ?? I[$.key] : I[$.key] || "-";
|
|
2404
2395
|
}
|
|
2405
|
-
async function
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2396
|
+
async function we(I, $) {
|
|
2397
|
+
_.value = "Редагувати", b.value = !0, h = "edit", Z = $, P.value = { ...I };
|
|
2398
|
+
}
|
|
2399
|
+
function ce() {
|
|
2400
|
+
const I = M.value.validate();
|
|
2401
|
+
if (I) {
|
|
2402
|
+
pe({ type: "warning", title: "Помилка валідації", message: Object.entries(I).map(([$, S]) => `${$}: ${S}`).join(`
|
|
2403
|
+
`) });
|
|
2404
|
+
return;
|
|
2405
|
+
}
|
|
2406
|
+
h === "add" ? Array.isArray(t.value) ? t.value = [...t.value, P.value] : t.value = [P.value] : t.value = t.value.map(($, S) => S === Z ? P.value : $), b.value = !1;
|
|
2412
2407
|
}
|
|
2413
|
-
function
|
|
2414
|
-
t.value = t.value.filter((
|
|
2408
|
+
function Ce(I) {
|
|
2409
|
+
t.value = t.value.filter(($, S) => S !== I);
|
|
2415
2410
|
}
|
|
2416
|
-
return (
|
|
2417
|
-
l("div",
|
|
2418
|
-
l("div",
|
|
2419
|
-
|
|
2411
|
+
return (I, $) => (i(), u("div", ns, [
|
|
2412
|
+
l("div", is, [
|
|
2413
|
+
l("div", us, [
|
|
2414
|
+
B(Fa, {
|
|
2420
2415
|
width: "14",
|
|
2421
2416
|
height: "14",
|
|
2422
2417
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2423
2418
|
}),
|
|
2424
|
-
|
|
2419
|
+
K(l("input", {
|
|
2425
2420
|
type: "text",
|
|
2426
|
-
"onUpdate:modelValue":
|
|
2421
|
+
"onUpdate:modelValue": $[0] || ($[0] = (S) => s.value = S),
|
|
2427
2422
|
placeholder: "Пошук",
|
|
2428
2423
|
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"
|
|
2429
2424
|
}, null, 512), [
|
|
2430
|
-
[
|
|
2425
|
+
[de, s.value]
|
|
2431
2426
|
])
|
|
2432
2427
|
]),
|
|
2433
|
-
l("div",
|
|
2428
|
+
l("div", ds, [
|
|
2434
2429
|
l("input", {
|
|
2435
2430
|
ref_key: "fileInput",
|
|
2436
2431
|
ref: f,
|
|
@@ -2439,14 +2434,14 @@ const sr = /* @__PURE__ */ R(or, [["render", rr]]), nr = { class: "vs-datatable
|
|
|
2439
2434
|
accept: ".json",
|
|
2440
2435
|
type: "file"
|
|
2441
2436
|
}, null, 544),
|
|
2442
|
-
l("div",
|
|
2443
|
-
l("div",
|
|
2444
|
-
l("div",
|
|
2437
|
+
l("div", cs, [
|
|
2438
|
+
l("div", ps, [
|
|
2439
|
+
l("div", fs, [
|
|
2445
2440
|
l("button", {
|
|
2446
|
-
onClick:
|
|
2441
|
+
onClick: z,
|
|
2447
2442
|
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"
|
|
2448
2443
|
}, [
|
|
2449
|
-
|
|
2444
|
+
B(Ra, {
|
|
2450
2445
|
height: "16",
|
|
2451
2446
|
width: "16"
|
|
2452
2447
|
})
|
|
@@ -2455,139 +2450,167 @@ const sr = /* @__PURE__ */ R(or, [["render", rr]]), nr = { class: "vs-datatable
|
|
|
2455
2450
|
])
|
|
2456
2451
|
])
|
|
2457
2452
|
]),
|
|
2458
|
-
(i(),
|
|
2453
|
+
(i(), te(pt, { to: "body" }, [
|
|
2459
2454
|
p.value ? (i(), u("div", {
|
|
2460
2455
|
key: 0,
|
|
2461
2456
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
2462
|
-
style:
|
|
2457
|
+
style: he([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
|
|
2463
2458
|
}, [
|
|
2464
|
-
l("div",
|
|
2465
|
-
l("div",
|
|
2459
|
+
l("div", vs, [
|
|
2460
|
+
l("div", ms, [
|
|
2466
2461
|
l("button", {
|
|
2467
|
-
onClick:
|
|
2462
|
+
onClick: U,
|
|
2468
2463
|
class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2469
2464
|
}, [
|
|
2470
|
-
|
|
2465
|
+
B(qa, {
|
|
2471
2466
|
class: "text-black",
|
|
2472
2467
|
width: "14",
|
|
2473
2468
|
height: "14"
|
|
2474
2469
|
}),
|
|
2475
|
-
|
|
2470
|
+
$[4] || ($[4] = se(" Імпортувати "))
|
|
2476
2471
|
]),
|
|
2477
2472
|
l("button", {
|
|
2478
|
-
onClick:
|
|
2473
|
+
onClick: N,
|
|
2479
2474
|
class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2480
2475
|
}, [
|
|
2481
|
-
l("span",
|
|
2482
|
-
|
|
2476
|
+
l("span", hs, [
|
|
2477
|
+
B(Za, {
|
|
2483
2478
|
class: "text-black",
|
|
2484
2479
|
width: "14",
|
|
2485
2480
|
height: "14"
|
|
2486
2481
|
}),
|
|
2487
|
-
|
|
2482
|
+
$[5] || ($[5] = se(" Експортувати "))
|
|
2488
2483
|
])
|
|
2489
2484
|
])
|
|
2490
2485
|
])
|
|
2491
2486
|
])
|
|
2492
|
-
], 4)) :
|
|
2487
|
+
], 4)) : j("", !0)
|
|
2493
2488
|
])),
|
|
2494
2489
|
l("button", {
|
|
2495
|
-
onClick:
|
|
2490
|
+
onClick: H,
|
|
2496
2491
|
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"
|
|
2497
2492
|
}, [
|
|
2498
|
-
|
|
2499
|
-
|
|
2493
|
+
B(je),
|
|
2494
|
+
$[6] || ($[6] = se(" Додати "))
|
|
2500
2495
|
])
|
|
2501
2496
|
]),
|
|
2502
|
-
l("div",
|
|
2503
|
-
l("table",
|
|
2504
|
-
l("thead",
|
|
2505
|
-
l("tr",
|
|
2506
|
-
l("th",
|
|
2507
|
-
|
|
2497
|
+
l("div", gs, [
|
|
2498
|
+
l("table", bs, [
|
|
2499
|
+
l("thead", ys, [
|
|
2500
|
+
l("tr", xs, [
|
|
2501
|
+
l("th", ws, [
|
|
2502
|
+
B(Qe, {
|
|
2508
2503
|
width: "24",
|
|
2509
2504
|
height: "24",
|
|
2510
2505
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2511
2506
|
})
|
|
2512
2507
|
]),
|
|
2513
|
-
(i(!0), u(
|
|
2514
|
-
key:
|
|
2508
|
+
(i(!0), u(ee, null, le(I.colModel, (S) => (i(), u("th", {
|
|
2509
|
+
key: S.key,
|
|
2515
2510
|
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]"
|
|
2516
|
-
},
|
|
2517
|
-
|
|
2511
|
+
}, F(S.ua || S.label), 1))), 128)),
|
|
2512
|
+
$[7] || ($[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
|
|
2518
2513
|
])
|
|
2519
2514
|
]),
|
|
2520
2515
|
l("tbody", {
|
|
2521
|
-
class:
|
|
2516
|
+
class: V({ "[&_tr:last-child]:border-0": !d.value })
|
|
2522
2517
|
}, [
|
|
2523
|
-
a.value.length === 0 ? (i(), u("td",
|
|
2524
|
-
l("div",
|
|
2525
|
-
l("div", $
|
|
2526
|
-
|
|
2527
|
-
|
|
2518
|
+
a.value.length === 0 ? (i(), u("td", ks, [
|
|
2519
|
+
l("div", _s, [
|
|
2520
|
+
l("div", $s, [
|
|
2521
|
+
B(ls, { class: "w-48 mx-auto" }),
|
|
2522
|
+
$[8] || ($[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2528
2523
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2529
2524
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
2530
2525
|
], -1))
|
|
2531
2526
|
])
|
|
2532
2527
|
])
|
|
2533
|
-
])) :
|
|
2534
|
-
(i(!0), u(
|
|
2535
|
-
key:
|
|
2536
|
-
class:
|
|
2537
|
-
"opacity-50":
|
|
2538
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value ===
|
|
2528
|
+
])) : j("", !0),
|
|
2529
|
+
(i(!0), u(ee, null, le(a.value, (S, q) => (i(), u("tr", {
|
|
2530
|
+
key: S.id,
|
|
2531
|
+
class: V(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2532
|
+
"opacity-50": r.value === q,
|
|
2533
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === q
|
|
2539
2534
|
}]),
|
|
2540
2535
|
draggable: "true",
|
|
2541
|
-
onDragstart: (
|
|
2542
|
-
onDragover:
|
|
2543
|
-
onDrop: (
|
|
2536
|
+
onDragstart: (m) => g(q),
|
|
2537
|
+
onDragover: ne((m) => v(q), ["prevent"]),
|
|
2538
|
+
onDrop: (m) => C(q)
|
|
2544
2539
|
}, [
|
|
2545
|
-
l("td",
|
|
2546
|
-
l("div",
|
|
2547
|
-
|
|
2540
|
+
l("td", Vs, [
|
|
2541
|
+
l("div", Ms, [
|
|
2542
|
+
B(Qe, {
|
|
2548
2543
|
width: "24",
|
|
2549
2544
|
height: "24",
|
|
2550
2545
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2551
2546
|
})
|
|
2552
2547
|
])
|
|
2553
2548
|
]),
|
|
2554
|
-
(i(!0), u(
|
|
2555
|
-
key:
|
|
2549
|
+
(i(!0), u(ee, null, le(I.colModel, (m) => (i(), u("td", {
|
|
2550
|
+
key: m.key,
|
|
2556
2551
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2557
2552
|
}, [
|
|
2558
|
-
l("div",
|
|
2553
|
+
l("div", Ls, F(Y(S, m)), 1)
|
|
2559
2554
|
]))), 128)),
|
|
2560
|
-
l("td",
|
|
2561
|
-
l("div",
|
|
2555
|
+
l("td", Ss, [
|
|
2556
|
+
l("div", Bs, [
|
|
2562
2557
|
l("button", {
|
|
2563
|
-
onClick: (
|
|
2558
|
+
onClick: (m) => we(S, q),
|
|
2564
2559
|
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"
|
|
2565
2560
|
}, [
|
|
2566
|
-
|
|
2561
|
+
B(rs, {
|
|
2567
2562
|
width: "24",
|
|
2568
2563
|
height: "24",
|
|
2569
2564
|
class: "w-3 h-3"
|
|
2570
2565
|
})
|
|
2571
|
-
], 8,
|
|
2566
|
+
], 8, js),
|
|
2572
2567
|
l("button", {
|
|
2573
|
-
onClick: (
|
|
2568
|
+
onClick: (m) => Ce(q),
|
|
2574
2569
|
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"
|
|
2575
2570
|
}, [
|
|
2576
|
-
|
|
2571
|
+
B(ze, {
|
|
2577
2572
|
width: "24",
|
|
2578
2573
|
height: "24",
|
|
2579
2574
|
class: "w-3 h-3"
|
|
2580
2575
|
})
|
|
2581
|
-
], 8,
|
|
2576
|
+
], 8, Is)
|
|
2582
2577
|
])
|
|
2583
2578
|
])
|
|
2584
|
-
], 42,
|
|
2579
|
+
], 42, Cs))), 128))
|
|
2585
2580
|
], 2)
|
|
2586
2581
|
])
|
|
2587
|
-
])
|
|
2582
|
+
]),
|
|
2583
|
+
B(J(vt), {
|
|
2584
|
+
visible: b.value,
|
|
2585
|
+
title: _.value,
|
|
2586
|
+
size: "lg"
|
|
2587
|
+
}, {
|
|
2588
|
+
default: $e(() => [
|
|
2589
|
+
B(Ie, {
|
|
2590
|
+
schema: e.colModel,
|
|
2591
|
+
values: P.value,
|
|
2592
|
+
"onUpdate:values": $[1] || ($[1] = (S) => P.value = S),
|
|
2593
|
+
form: M.value,
|
|
2594
|
+
"onUpdate:form": $[2] || ($[2] = (S) => M.value = S)
|
|
2595
|
+
}, null, 8, ["schema", "values", "form"]),
|
|
2596
|
+
l("div", zs, [
|
|
2597
|
+
l("button", {
|
|
2598
|
+
type: "button",
|
|
2599
|
+
onClick: $[3] || ($[3] = (S) => b.value = !1),
|
|
2600
|
+
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"
|
|
2601
|
+
}, " Скасувати "),
|
|
2602
|
+
l("button", {
|
|
2603
|
+
onClick: ce,
|
|
2604
|
+
type: "button",
|
|
2605
|
+
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"
|
|
2606
|
+
}, " Зберегти ")
|
|
2607
|
+
])
|
|
2608
|
+
]),
|
|
2609
|
+
_: 1
|
|
2610
|
+
}, 8, ["visible", "title"])
|
|
2588
2611
|
]));
|
|
2589
2612
|
}
|
|
2590
|
-
}),
|
|
2613
|
+
}), Os = {
|
|
2591
2614
|
draw: {
|
|
2592
2615
|
toolbar: {
|
|
2593
2616
|
actions: {
|
|
@@ -2695,7 +2718,7 @@ const sr = /* @__PURE__ */ R(or, [["render", rr]]), nr = { class: "vs-datatable
|
|
|
2695
2718
|
}
|
|
2696
2719
|
}
|
|
2697
2720
|
};
|
|
2698
|
-
function
|
|
2721
|
+
function Es(o) {
|
|
2699
2722
|
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? o : o.geom ? {
|
|
2700
2723
|
type: "Feature",
|
|
2701
2724
|
geometry: {
|
|
@@ -2709,7 +2732,7 @@ function Er(o) {
|
|
|
2709
2732
|
properties: {}
|
|
2710
2733
|
} : null : null;
|
|
2711
2734
|
}
|
|
2712
|
-
const
|
|
2735
|
+
const Fs = {}, Ds = {
|
|
2713
2736
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2714
2737
|
viewBox: "0 0 24 24",
|
|
2715
2738
|
stroke: "currentColor",
|
|
@@ -2719,8 +2742,8 @@ const Fr = {}, Or = {
|
|
|
2719
2742
|
"stroke-linejoin": "round",
|
|
2720
2743
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
|
|
2721
2744
|
};
|
|
2722
|
-
function
|
|
2723
|
-
return i(), u("svg",
|
|
2745
|
+
function Us(o, e) {
|
|
2746
|
+
return i(), u("svg", Ds, e[0] || (e[0] = [
|
|
2724
2747
|
l("path", {
|
|
2725
2748
|
stroke: "none",
|
|
2726
2749
|
d: "M0 0h24v24H0z",
|
|
@@ -2730,7 +2753,7 @@ function Dr(o, e) {
|
|
|
2730
2753
|
l("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)
|
|
2731
2754
|
]));
|
|
2732
2755
|
}
|
|
2733
|
-
const
|
|
2756
|
+
const Ts = /* @__PURE__ */ R(Fs, [["render", Us]]), Rs = {}, Ps = {
|
|
2734
2757
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2735
2758
|
viewBox: "0 0 24 24",
|
|
2736
2759
|
fill: "none",
|
|
@@ -2740,8 +2763,8 @@ const Ur = /* @__PURE__ */ R(Fr, [["render", Dr]]), Tr = {}, Rr = {
|
|
|
2740
2763
|
"stroke-linejoin": "round",
|
|
2741
2764
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
2742
2765
|
};
|
|
2743
|
-
function
|
|
2744
|
-
return i(), u("svg",
|
|
2766
|
+
function Ns(o, e) {
|
|
2767
|
+
return i(), u("svg", Ps, e[0] || (e[0] = [
|
|
2745
2768
|
l("path", {
|
|
2746
2769
|
stroke: "none",
|
|
2747
2770
|
d: "M0 0h24v24H0z",
|
|
@@ -2752,7 +2775,7 @@ function Pr(o, e) {
|
|
|
2752
2775
|
l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
|
|
2753
2776
|
]));
|
|
2754
2777
|
}
|
|
2755
|
-
const
|
|
2778
|
+
const Hs = /* @__PURE__ */ R(Rs, [["render", Ns]]), qs = {}, Gs = {
|
|
2756
2779
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2757
2780
|
viewBox: "0 0 24 24",
|
|
2758
2781
|
fill: "none",
|
|
@@ -2762,12 +2785,12 @@ const Nr = /* @__PURE__ */ R(Tr, [["render", Pr]]), Hr = {}, qr = {
|
|
|
2762
2785
|
"stroke-linejoin": "round",
|
|
2763
2786
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
2764
2787
|
};
|
|
2765
|
-
function
|
|
2766
|
-
return i(), u("svg",
|
|
2767
|
-
|
|
2788
|
+
function Js(o, e) {
|
|
2789
|
+
return i(), u("svg", Gs, e[0] || (e[0] = [
|
|
2790
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
|
|
2768
2791
|
]));
|
|
2769
2792
|
}
|
|
2770
|
-
const
|
|
2793
|
+
const Ks = /* @__PURE__ */ R(qs, [["render", Js]]), Zs = {}, Ws = {
|
|
2771
2794
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2772
2795
|
viewBox: "0 0 24 24",
|
|
2773
2796
|
fill: "none",
|
|
@@ -2777,12 +2800,12 @@ const Jr = /* @__PURE__ */ R(Hr, [["render", Gr]]), Kr = {}, Zr = {
|
|
|
2777
2800
|
"stroke-linejoin": "round",
|
|
2778
2801
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
2779
2802
|
};
|
|
2780
|
-
function
|
|
2781
|
-
return i(), u("svg",
|
|
2782
|
-
|
|
2803
|
+
function Qs(o, e) {
|
|
2804
|
+
return i(), u("svg", Ws, e[0] || (e[0] = [
|
|
2805
|
+
re('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
|
|
2783
2806
|
]));
|
|
2784
2807
|
}
|
|
2785
|
-
const
|
|
2808
|
+
const Xs = /* @__PURE__ */ R(Zs, [["render", Qs]]), Ys = {}, er = {
|
|
2786
2809
|
version: "1.1",
|
|
2787
2810
|
viewBox: "0 0 14 14",
|
|
2788
2811
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2790,8 +2813,8 @@ const Qr = /* @__PURE__ */ R(Kr, [["render", Wr]]), Xr = {}, Yr = {
|
|
|
2790
2813
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
2791
2814
|
class: "fullscreen-icon"
|
|
2792
2815
|
};
|
|
2793
|
-
function
|
|
2794
|
-
return i(), u("svg",
|
|
2816
|
+
function tr(o, e) {
|
|
2817
|
+
return i(), u("svg", er, e[0] || (e[0] = [
|
|
2795
2818
|
l("title", null, null, -1),
|
|
2796
2819
|
l("desc", null, null, -1),
|
|
2797
2820
|
l("defs", null, null, -1),
|
|
@@ -2820,10 +2843,10 @@ function es(o, e) {
|
|
|
2820
2843
|
], -1)
|
|
2821
2844
|
]));
|
|
2822
2845
|
}
|
|
2823
|
-
const
|
|
2846
|
+
const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__search" }, ar = { class: "map-search__input" }, sr = { class: "flex flex-nowrap relative" }, rr = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, nr = { class: "flex items-center w-full" }, ir = { class: "max-w-[90%] truncate" }, ur = {
|
|
2824
2847
|
key: 0,
|
|
2825
2848
|
class: "absolute z-[3100] mt-0.5 left-0 right-0"
|
|
2826
|
-
},
|
|
2849
|
+
}, dr = { 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" }, cr = { 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" }, pr = ["onClick"], fr = { class: "flex justify-between items-center w-full" }, vr = { class: "flex items-center" }, mr = {
|
|
2827
2850
|
key: 0,
|
|
2828
2851
|
class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
|
|
2829
2852
|
width: "24",
|
|
@@ -2834,87 +2857,87 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
2834
2857
|
"stroke-width": "2",
|
|
2835
2858
|
"stroke-linecap": "round",
|
|
2836
2859
|
"stroke-linejoin": "round"
|
|
2837
|
-
},
|
|
2860
|
+
}, hr = { class: "relative w-full" }, gr = { class: "vs-form-text relative bg-white rounded-lg" }, br = {
|
|
2838
2861
|
key: 1,
|
|
2839
2862
|
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"
|
|
2840
|
-
},
|
|
2863
|
+
}, yr = { key: 0 }, xr = ["onClick"], wr = {
|
|
2841
2864
|
key: 1,
|
|
2842
2865
|
class: "px-3 py-2 text-xs text-gray-500"
|
|
2843
|
-
},
|
|
2866
|
+
}, kr = {
|
|
2844
2867
|
key: 2,
|
|
2845
2868
|
class: "px-3 py-2 text-xs text-gray-400"
|
|
2846
|
-
},
|
|
2869
|
+
}, _r = /* @__PURE__ */ O({
|
|
2847
2870
|
__name: "map-search",
|
|
2848
2871
|
props: {
|
|
2849
2872
|
placeholder: { default: "50, 30" }
|
|
2850
2873
|
},
|
|
2851
2874
|
emits: ["goToCoordinates"],
|
|
2852
2875
|
setup(o, { emit: e }) {
|
|
2853
|
-
const t = e, n =
|
|
2876
|
+
const t = e, n = x(!1), s = x("coordinates"), a = x(""), r = x([]), d = x(!1), p = x(!1);
|
|
2854
2877
|
let f;
|
|
2855
2878
|
const c = [
|
|
2856
2879
|
{ value: "coordinates", label: "Пошук по кординатам" },
|
|
2857
2880
|
{ value: "atu", label: "АТУ" },
|
|
2858
2881
|
{ value: "address", label: "Адресса" },
|
|
2859
2882
|
{ value: "search_here", label: "Пошук HERE" }
|
|
2860
|
-
], g =
|
|
2883
|
+
], g = D(() => c.find((_) => _.value === s.value)?.label ?? "АТУ");
|
|
2861
2884
|
function v(_) {
|
|
2862
|
-
|
|
2885
|
+
s.value = _.value, n.value = !1, a.value = "", a.value && U();
|
|
2863
2886
|
}
|
|
2864
|
-
function
|
|
2887
|
+
function C(_) {
|
|
2865
2888
|
_.target.closest(".map-search__input") || (n.value = !1);
|
|
2866
2889
|
}
|
|
2867
|
-
|
|
2868
|
-
async function
|
|
2869
|
-
let
|
|
2870
|
-
|
|
2871
|
-
const h = new URL(
|
|
2872
|
-
return
|
|
2890
|
+
ue(() => document.addEventListener("click", C)), Ee(() => document.removeEventListener("click", C));
|
|
2891
|
+
async function z(_) {
|
|
2892
|
+
let b;
|
|
2893
|
+
s.value === "atu" ? b = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? b = "/api/suggest/map.address_id" : s.value === "search_here" && (b = "/api/gis-url-proxy");
|
|
2894
|
+
const h = new URL(b || "");
|
|
2895
|
+
return s.value === "search_here" ? h.searchParams.set("searchtext", _) : (s.value === "atu" || s.value === "address") && h.searchParams.set("key", _), h.searchParams.set("limit", "20"), h.searchParams.set("q", _), (await fetch(h.toString())).json();
|
|
2873
2896
|
}
|
|
2874
|
-
function
|
|
2875
|
-
if (d.value = !0, p.value = !0,
|
|
2897
|
+
function U() {
|
|
2898
|
+
if (d.value = !0, p.value = !0, s.value === "coordinates") {
|
|
2876
2899
|
const _ = a.value.trim().split(",");
|
|
2877
2900
|
if (_.length === 2) {
|
|
2878
|
-
const
|
|
2879
|
-
!Number.isNaN(
|
|
2901
|
+
const b = parseFloat(_[0]), h = parseFloat(_[1]);
|
|
2902
|
+
!Number.isNaN(b) && !Number.isNaN(h) && t("goToCoordinates", [b, h]);
|
|
2880
2903
|
}
|
|
2881
2904
|
return;
|
|
2882
2905
|
}
|
|
2883
2906
|
f && window.clearTimeout(f), f = window.setTimeout(async () => {
|
|
2884
2907
|
const _ = a.value.trim();
|
|
2885
2908
|
if (!_) {
|
|
2886
|
-
|
|
2909
|
+
r.value = [], p.value = !1;
|
|
2887
2910
|
return;
|
|
2888
2911
|
}
|
|
2889
2912
|
try {
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2913
|
+
const b = await z(_);
|
|
2914
|
+
r.value = Array.isArray(b.features) ? b.features : [];
|
|
2892
2915
|
} catch {
|
|
2893
|
-
|
|
2916
|
+
r.value = [];
|
|
2894
2917
|
} finally {
|
|
2895
2918
|
p.value = !1;
|
|
2896
2919
|
}
|
|
2897
2920
|
}, 300);
|
|
2898
2921
|
}
|
|
2899
2922
|
function T() {
|
|
2900
|
-
a.value = "",
|
|
2923
|
+
a.value = "", r.value = [], d.value = !1, p.value = !1;
|
|
2901
2924
|
}
|
|
2902
|
-
function
|
|
2903
|
-
t("goToCoordinates", _), d.value = !1, p.value = !1,
|
|
2925
|
+
function N(_) {
|
|
2926
|
+
t("goToCoordinates", _), d.value = !1, p.value = !1, r.value = [];
|
|
2904
2927
|
}
|
|
2905
|
-
return (_,
|
|
2906
|
-
l("div",
|
|
2907
|
-
l("div",
|
|
2908
|
-
l("div",
|
|
2928
|
+
return (_, b) => (i(), u("div", or, [
|
|
2929
|
+
l("div", ar, [
|
|
2930
|
+
l("div", sr, [
|
|
2931
|
+
l("div", rr, [
|
|
2909
2932
|
l("button", {
|
|
2910
2933
|
type: "button",
|
|
2911
|
-
onClick:
|
|
2934
|
+
onClick: b[0] || (b[0] = (h) => n.value = !n.value),
|
|
2912
2935
|
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"
|
|
2913
2936
|
}, [
|
|
2914
|
-
l("div",
|
|
2915
|
-
l("span",
|
|
2937
|
+
l("div", nr, [
|
|
2938
|
+
l("span", ir, F(g.value), 1)
|
|
2916
2939
|
]),
|
|
2917
|
-
|
|
2940
|
+
b[3] || (b[3] = l("svg", {
|
|
2918
2941
|
class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
|
|
2919
2942
|
width: "15",
|
|
2920
2943
|
height: "15",
|
|
@@ -2929,30 +2952,30 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
2929
2952
|
})
|
|
2930
2953
|
], -1))
|
|
2931
2954
|
]),
|
|
2932
|
-
n.value ? (i(), u("div",
|
|
2933
|
-
l("div",
|
|
2934
|
-
l("div",
|
|
2935
|
-
(i(), u(
|
|
2936
|
-
onClick: (
|
|
2955
|
+
n.value ? (i(), u("div", ur, [
|
|
2956
|
+
l("div", dr, [
|
|
2957
|
+
l("div", cr, [
|
|
2958
|
+
(i(), u(ee, null, le(c, (h) => l("div", {
|
|
2959
|
+
onClick: (Z) => v(h),
|
|
2937
2960
|
key: h.value,
|
|
2938
2961
|
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"
|
|
2939
2962
|
}, [
|
|
2940
|
-
l("div",
|
|
2941
|
-
l("div",
|
|
2942
|
-
l("div", null,
|
|
2963
|
+
l("div", fr, [
|
|
2964
|
+
l("div", vr, [
|
|
2965
|
+
l("div", null, F(h.label), 1)
|
|
2943
2966
|
]),
|
|
2944
|
-
h.value ===
|
|
2967
|
+
h.value === s.value ? (i(), u("svg", mr, b[4] || (b[4] = [
|
|
2945
2968
|
l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2946
|
-
]))) :
|
|
2969
|
+
]))) : j("", !0)
|
|
2947
2970
|
])
|
|
2948
|
-
], 8,
|
|
2971
|
+
], 8, pr)), 64))
|
|
2949
2972
|
])
|
|
2950
2973
|
])
|
|
2951
|
-
])) :
|
|
2974
|
+
])) : j("", !0)
|
|
2952
2975
|
]),
|
|
2953
|
-
l("div",
|
|
2954
|
-
l("div",
|
|
2955
|
-
|
|
2976
|
+
l("div", hr, [
|
|
2977
|
+
l("div", gr, [
|
|
2978
|
+
b[6] || (b[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
|
|
2956
2979
|
l("svg", {
|
|
2957
2980
|
width: "16",
|
|
2958
2981
|
height: "16",
|
|
@@ -2975,15 +2998,15 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
2975
2998
|
})
|
|
2976
2999
|
])
|
|
2977
3000
|
], -1)),
|
|
2978
|
-
|
|
3001
|
+
K(l("input", {
|
|
2979
3002
|
type: "text",
|
|
2980
|
-
"onUpdate:modelValue":
|
|
2981
|
-
onInput:
|
|
2982
|
-
onFocus:
|
|
3003
|
+
"onUpdate:modelValue": b[1] || (b[1] = (h) => a.value = h),
|
|
3004
|
+
onInput: U,
|
|
3005
|
+
onFocus: b[2] || (b[2] = (h) => d.value = !0),
|
|
2983
3006
|
placeholder: "lat, lng ex. 50, 30",
|
|
2984
3007
|
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"
|
|
2985
3008
|
}, null, 544), [
|
|
2986
|
-
[
|
|
3009
|
+
[de, a.value]
|
|
2987
3010
|
]),
|
|
2988
3011
|
a.value ? (i(), u("button", {
|
|
2989
3012
|
key: 0,
|
|
@@ -2991,7 +3014,7 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
2991
3014
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
2992
3015
|
"aria-label": "Очистити",
|
|
2993
3016
|
type: "button"
|
|
2994
|
-
},
|
|
3017
|
+
}, b[5] || (b[5] = [
|
|
2995
3018
|
l("svg", {
|
|
2996
3019
|
width: "15",
|
|
2997
3020
|
height: "15",
|
|
@@ -3006,23 +3029,23 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3006
3029
|
"stroke-linejoin": "round"
|
|
3007
3030
|
})
|
|
3008
3031
|
], -1)
|
|
3009
|
-
]))) :
|
|
3010
|
-
d.value &&
|
|
3011
|
-
|
|
3012
|
-
(i(!0), u(
|
|
3032
|
+
]))) : j("", !0),
|
|
3033
|
+
d.value && s.value !== "coordinates" ? (i(), u("div", br, [
|
|
3034
|
+
r.value.length ? (i(), u("ul", yr, [
|
|
3035
|
+
(i(!0), u(ee, null, le(r.value, (h) => (i(), u("li", {
|
|
3013
3036
|
key: h.properties.place_id,
|
|
3014
|
-
onClick: (
|
|
3037
|
+
onClick: (Z) => N(h),
|
|
3015
3038
|
class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
|
|
3016
|
-
},
|
|
3017
|
-
])) : p.value ? (i(), u("div",
|
|
3018
|
-
])) :
|
|
3039
|
+
}, F(h.properties.display_name), 9, xr))), 128))
|
|
3040
|
+
])) : p.value ? (i(), u("div", wr, "Шукаю…")) : (i(), u("div", kr, "Нічого не знайдено"))
|
|
3041
|
+
])) : j("", !0)
|
|
3019
3042
|
])
|
|
3020
3043
|
])
|
|
3021
3044
|
])
|
|
3022
3045
|
])
|
|
3023
3046
|
]));
|
|
3024
3047
|
}
|
|
3025
|
-
}),
|
|
3048
|
+
}), $r = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Cr = { class: "flex gap-2" }, Vr = ["onClick", "title"], Mr = ["src"], Lr = /* @__PURE__ */ O({
|
|
3026
3049
|
__name: "map-layers",
|
|
3027
3050
|
props: {
|
|
3028
3051
|
basemaps: {},
|
|
@@ -3030,15 +3053,15 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3030
3053
|
},
|
|
3031
3054
|
emits: ["onLayerChange"],
|
|
3032
3055
|
setup(o, { emit: e }) {
|
|
3033
|
-
const n =
|
|
3034
|
-
function a(
|
|
3035
|
-
|
|
3056
|
+
const n = x(o.defaultLayer ?? ""), s = e;
|
|
3057
|
+
function a(r) {
|
|
3058
|
+
s("onLayerChange", r), n.value = r;
|
|
3036
3059
|
}
|
|
3037
|
-
return (
|
|
3038
|
-
l("div",
|
|
3039
|
-
(i(!0), u(
|
|
3060
|
+
return (r, d) => (i(), u("div", $r, [
|
|
3061
|
+
l("div", Cr, [
|
|
3062
|
+
(i(!0), u(ee, null, le(r.basemaps, (p, f) => (i(), u("div", {
|
|
3040
3063
|
key: f,
|
|
3041
|
-
class:
|
|
3064
|
+
class: V(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === f }]),
|
|
3042
3065
|
onClick: (c) => a(f),
|
|
3043
3066
|
title: f,
|
|
3044
3067
|
role: "button",
|
|
@@ -3048,21 +3071,21 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3048
3071
|
src: p.preview,
|
|
3049
3072
|
alt: "",
|
|
3050
3073
|
class: "w-14 h-14 object-cover"
|
|
3051
|
-
}, null, 8,
|
|
3052
|
-
], 10,
|
|
3074
|
+
}, null, 8, Mr)
|
|
3075
|
+
], 10, Vr))), 128))
|
|
3053
3076
|
])
|
|
3054
3077
|
]));
|
|
3055
3078
|
}
|
|
3056
|
-
}),
|
|
3079
|
+
}), Sr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, Br = { class: "form-geom__panel flex gap-1 items-start mt-2" }, jr = { class: "flex items-center gap-1" }, Ir = ["disabled"], zr = { class: "absolute top-4 right-4 z-[1000]" }, Ar = { class: "flex flex-col gap-[2px]" }, Or = ["aria-pressed"], Er = ["aria-pressed"], Fr = ["aria-pressed"], Dr = ["aria-pressed"], Ur = { 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" }, Tr = {
|
|
3057
3080
|
key: 0,
|
|
3058
3081
|
class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
|
|
3059
|
-
},
|
|
3082
|
+
}, Rr = { class: "mr-auto" }, Pr = { class: "font-bold" }, Nr = { class: "flex items-center" }, Hr = { class: "text-xs mr-2" }, qr = {
|
|
3060
3083
|
key: 0,
|
|
3061
3084
|
class: "text-xs"
|
|
3062
|
-
},
|
|
3085
|
+
}, Gr = {
|
|
3063
3086
|
key: 1,
|
|
3064
3087
|
class: "text-xs"
|
|
3065
|
-
},
|
|
3088
|
+
}, Jr = /* @__PURE__ */ O({
|
|
3066
3089
|
__name: "vs-input-map",
|
|
3067
3090
|
props: {
|
|
3068
3091
|
tools: {},
|
|
@@ -3076,11 +3099,9 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3076
3099
|
},
|
|
3077
3100
|
emits: ["update:modelValue"],
|
|
3078
3101
|
setup(o, { emit: e }) {
|
|
3079
|
-
const t = o;
|
|
3080
|
-
|
|
3081
|
-
const
|
|
3082
|
-
let a, s, d;
|
|
3083
|
-
const p = k(null), f = k(null), c = k(6), g = k(0), v = k(null), M = {
|
|
3102
|
+
const t = o, n = e, s = x(null);
|
|
3103
|
+
let a, r, d;
|
|
3104
|
+
const p = x(null), f = x(null), c = x(6), g = x(0), v = x(null), C = {
|
|
3084
3105
|
topo100: {
|
|
3085
3106
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3086
3107
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3094,108 +3115,108 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3094
3115
|
preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
|
|
3095
3116
|
}
|
|
3096
3117
|
};
|
|
3097
|
-
let
|
|
3098
|
-
const
|
|
3118
|
+
let z;
|
|
3119
|
+
const U = x("topo100");
|
|
3099
3120
|
function T() {
|
|
3100
|
-
return new Promise((
|
|
3101
|
-
window.L && window.L.Draw &&
|
|
3102
|
-
const
|
|
3103
|
-
if (Array.from(document.styleSheets).some((
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3106
|
-
},
|
|
3107
|
-
const
|
|
3108
|
-
if (
|
|
3109
|
-
|
|
3121
|
+
return new Promise((m, y) => {
|
|
3122
|
+
window.L && window.L.Draw && m(0);
|
|
3123
|
+
const E = (oe) => {
|
|
3124
|
+
if (Array.from(document.styleSheets).some((ye) => ye?.href?.includes(oe))) return;
|
|
3125
|
+
const fe = document.createElement("link");
|
|
3126
|
+
fe.rel = "stylesheet", fe.href = oe, document.head.appendChild(fe);
|
|
3127
|
+
}, G = (oe) => new Promise((Ve, fe) => {
|
|
3128
|
+
const ye = Array.from(document.scripts).find((ve) => ve.src === oe);
|
|
3129
|
+
if (ye) {
|
|
3130
|
+
ye.addEventListener("load", () => Ve()), ye.addEventListener("error", (ve) => fe(ve));
|
|
3110
3131
|
return;
|
|
3111
3132
|
}
|
|
3112
|
-
const
|
|
3113
|
-
|
|
3133
|
+
const xe = document.createElement("script");
|
|
3134
|
+
xe.src = oe, xe.async = !0, xe.onload = () => Ve(), xe.onerror = (ve) => fe(ve), document.body.appendChild(xe);
|
|
3114
3135
|
});
|
|
3115
|
-
|
|
3136
|
+
E("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), E("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(() => m(0)).catch(y);
|
|
3116
3137
|
});
|
|
3117
3138
|
}
|
|
3118
|
-
function
|
|
3119
|
-
const
|
|
3120
|
-
let
|
|
3121
|
-
|
|
3139
|
+
function N() {
|
|
3140
|
+
const m = r.toGeoJSON();
|
|
3141
|
+
let y = null;
|
|
3142
|
+
m?.features?.length && (y = m.features[0].geometry), n("update:modelValue", y), g.value = r.getLayers().length;
|
|
3122
3143
|
}
|
|
3123
|
-
function _(
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3126
|
-
const
|
|
3127
|
-
|
|
3144
|
+
function _(m = 30) {
|
|
3145
|
+
const y = r.getLayers();
|
|
3146
|
+
if (!y.length) return;
|
|
3147
|
+
const G = L.featureGroup(y).getBounds();
|
|
3148
|
+
G && G.isValid() && a.fitBounds(G, { padding: [m, m] });
|
|
3128
3149
|
}
|
|
3129
|
-
function
|
|
3150
|
+
function b() {
|
|
3130
3151
|
p.value?.click();
|
|
3131
3152
|
}
|
|
3132
|
-
const h =
|
|
3133
|
-
function
|
|
3134
|
-
return
|
|
3153
|
+
const h = x("");
|
|
3154
|
+
function Z(m) {
|
|
3155
|
+
return m instanceof L.Circle ? "Circle" : m instanceof L.Rectangle ? "Rectangle" : m instanceof L.Polygon && !(m instanceof L.Rectangle) ? "Polygon" : m instanceof L.Polyline && !(m instanceof L.Polygon) ? "Polyline" : m instanceof L.Marker ? "Point" : "Feature";
|
|
3135
3156
|
}
|
|
3136
|
-
function
|
|
3137
|
-
if (
|
|
3138
|
-
const
|
|
3139
|
-
return Math.PI * (
|
|
3157
|
+
function P(m) {
|
|
3158
|
+
if (m instanceof L.Circle) {
|
|
3159
|
+
const y = m.getRadius();
|
|
3160
|
+
return Math.PI * (y * y) / 1e6;
|
|
3140
3161
|
}
|
|
3141
|
-
if (
|
|
3162
|
+
if (m instanceof L.Polygon || m instanceof L.Rectangle)
|
|
3142
3163
|
try {
|
|
3143
|
-
const
|
|
3144
|
-
return
|
|
3164
|
+
const y = m.getLatLngs(), E = Array.isArray(y[0]) ? y[0] : y, G = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(E) : 0;
|
|
3165
|
+
return G ? G / 1e6 : 0;
|
|
3145
3166
|
} catch {
|
|
3146
3167
|
return null;
|
|
3147
3168
|
}
|
|
3148
3169
|
return null;
|
|
3149
3170
|
}
|
|
3150
|
-
function m
|
|
3151
|
-
return
|
|
3171
|
+
function M(m) {
|
|
3172
|
+
return m instanceof L.Circle ? m.getLatLng() : m.getBounds ? m.getBounds().getCenter() : m.getLatLng ? m.getLatLng() : a.getCenter();
|
|
3152
3173
|
}
|
|
3153
|
-
function
|
|
3154
|
-
const
|
|
3155
|
-
if (!
|
|
3174
|
+
function H() {
|
|
3175
|
+
const m = r.getLayers();
|
|
3176
|
+
if (!m.length) {
|
|
3156
3177
|
v.value = null, g.value = 0;
|
|
3157
3178
|
return;
|
|
3158
3179
|
}
|
|
3159
|
-
const
|
|
3180
|
+
const y = m[m.length - 1], E = Z(y), G = M(y), oe = P(y);
|
|
3160
3181
|
v.value = {
|
|
3161
|
-
type:
|
|
3162
|
-
center:
|
|
3163
|
-
areaKm2:
|
|
3164
|
-
layer:
|
|
3165
|
-
}, g.value =
|
|
3182
|
+
type: E,
|
|
3183
|
+
center: G,
|
|
3184
|
+
areaKm2: oe,
|
|
3185
|
+
layer: y
|
|
3186
|
+
}, g.value = m.length;
|
|
3166
3187
|
}
|
|
3167
|
-
function
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3188
|
+
function Y() {
|
|
3189
|
+
const m = v.value?.layer;
|
|
3190
|
+
m && (m instanceof L.Circle && m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getLatLng && a.setView(m.getLatLng(), Math.max(c.value, 14)));
|
|
3170
3191
|
}
|
|
3171
|
-
function
|
|
3172
|
-
const
|
|
3173
|
-
|
|
3192
|
+
function we() {
|
|
3193
|
+
const m = v.value?.layer;
|
|
3194
|
+
m && (r.removeLayer(m), N(), H());
|
|
3174
3195
|
}
|
|
3175
|
-
|
|
3176
|
-
await T(), L.drawLocal =
|
|
3177
|
-
const { layer:
|
|
3178
|
-
|
|
3196
|
+
ue(async () => {
|
|
3197
|
+
await T(), L.drawLocal = Os, a = L.map(s.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(a), z = L.tileLayer(C.topo100.url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = "topo100", r = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (E) => {
|
|
3198
|
+
const { layer: G } = E;
|
|
3199
|
+
r.clearLayers(), r.addLayer(G), N(), H(), _(), h.value = "";
|
|
3179
3200
|
}), a.on(L.Draw.Event.EDITED, () => {
|
|
3180
|
-
|
|
3201
|
+
N(), H(), _();
|
|
3181
3202
|
}), a.on(L.Draw.Event.DELETED, () => {
|
|
3182
|
-
|
|
3203
|
+
N(), H(), _();
|
|
3183
3204
|
});
|
|
3184
|
-
let
|
|
3185
|
-
a.on("mousemove", (
|
|
3186
|
-
|
|
3205
|
+
let m = !1;
|
|
3206
|
+
a.on("mousemove", (E) => {
|
|
3207
|
+
m || (a.invalidateSize(), m = !0), f.value = E.latlng;
|
|
3187
3208
|
}), a.on("zoomend", () => {
|
|
3188
3209
|
c.value = a.getZoom();
|
|
3189
3210
|
});
|
|
3190
|
-
const
|
|
3191
|
-
if (
|
|
3192
|
-
const
|
|
3193
|
-
L.geoJSON(
|
|
3211
|
+
const y = Es(t.modelValue);
|
|
3212
|
+
if (y) {
|
|
3213
|
+
const E = [];
|
|
3214
|
+
L.geoJSON(y).eachLayer((G) => E.push(G)), E.length && r.addLayer(E[0]), N(), H(), _();
|
|
3194
3215
|
}
|
|
3195
3216
|
});
|
|
3196
|
-
function
|
|
3217
|
+
function ce(m) {
|
|
3197
3218
|
if (a) {
|
|
3198
|
-
switch (d && d.disable(),
|
|
3219
|
+
switch (d && d.disable(), m) {
|
|
3199
3220
|
case "marker":
|
|
3200
3221
|
d = new L.Draw.Marker(a);
|
|
3201
3222
|
break;
|
|
@@ -3212,179 +3233,179 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3212
3233
|
d = new L.Draw.Rectangle(a);
|
|
3213
3234
|
break;
|
|
3214
3235
|
}
|
|
3215
|
-
d && (d.enable(), h.value =
|
|
3236
|
+
d && (d.enable(), h.value = m);
|
|
3216
3237
|
}
|
|
3217
3238
|
}
|
|
3218
|
-
function
|
|
3219
|
-
const
|
|
3220
|
-
|
|
3239
|
+
function Ce() {
|
|
3240
|
+
const m = r.toGeoJSON(), y = new Blob([JSON.stringify(m, null, 2)], { type: "application/json" }), E = URL.createObjectURL(y), G = document.createElement("a");
|
|
3241
|
+
G.href = E, G.download = "data.geojson", G.click(), URL.revokeObjectURL(E);
|
|
3221
3242
|
}
|
|
3222
|
-
function
|
|
3223
|
-
const
|
|
3224
|
-
if (
|
|
3225
|
-
const
|
|
3226
|
-
|
|
3227
|
-
if (typeof
|
|
3243
|
+
function I(m) {
|
|
3244
|
+
const y = m.target.files?.[0];
|
|
3245
|
+
if (!y) return;
|
|
3246
|
+
const E = new FileReader();
|
|
3247
|
+
E.onload = () => {
|
|
3248
|
+
if (typeof E.result == "string")
|
|
3228
3249
|
try {
|
|
3229
|
-
const
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
}),
|
|
3250
|
+
const G = JSON.parse(E.result);
|
|
3251
|
+
r.clearLayers(), G && L.geoJSON({ type: "Feature", geometry: G }).eachLayer((oe) => {
|
|
3252
|
+
r.addLayer(oe);
|
|
3253
|
+
}), N(), H(), _();
|
|
3233
3254
|
} finally {
|
|
3234
|
-
|
|
3255
|
+
m.target.value = "";
|
|
3235
3256
|
}
|
|
3236
|
-
},
|
|
3257
|
+
}, E.readAsText(y);
|
|
3237
3258
|
}
|
|
3238
|
-
function
|
|
3239
|
-
a && (
|
|
3259
|
+
function $(m) {
|
|
3260
|
+
a && (z && a.removeLayer(z), z = L.tileLayer(C[m].url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = m);
|
|
3240
3261
|
}
|
|
3241
|
-
function
|
|
3242
|
-
const
|
|
3243
|
-
a.setView(
|
|
3262
|
+
function S(m) {
|
|
3263
|
+
const y = L.latLng(m[0], m[1]);
|
|
3264
|
+
a.setView(y, 13);
|
|
3244
3265
|
}
|
|
3245
|
-
|
|
3266
|
+
ie(
|
|
3246
3267
|
() => t.modelValue,
|
|
3247
|
-
(
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
}), g.value =
|
|
3268
|
+
(m) => {
|
|
3269
|
+
r.clearLayers(), m && L.geoJSON({ type: "Feature", geometry: m }).eachLayer((y) => {
|
|
3270
|
+
r.addLayer(y);
|
|
3271
|
+
}), g.value = r.getLayers().length, H(), _();
|
|
3251
3272
|
}
|
|
3252
3273
|
);
|
|
3253
|
-
const
|
|
3254
|
-
return (
|
|
3255
|
-
class:
|
|
3274
|
+
const q = x(!1);
|
|
3275
|
+
return (m, y) => (i(), u("div", {
|
|
3276
|
+
class: V(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: q.value }])
|
|
3256
3277
|
}, [
|
|
3257
3278
|
l("div", {
|
|
3258
3279
|
ref_key: "mapContainer",
|
|
3259
|
-
ref:
|
|
3280
|
+
ref: s,
|
|
3260
3281
|
class: "w-full h-full"
|
|
3261
3282
|
}, null, 512),
|
|
3262
|
-
l("div",
|
|
3263
|
-
|
|
3264
|
-
l("div",
|
|
3265
|
-
l("div",
|
|
3283
|
+
l("div", Sr, [
|
|
3284
|
+
B(_r, { onGoToCoordinates: S }),
|
|
3285
|
+
l("div", Br, [
|
|
3286
|
+
l("div", jr, [
|
|
3266
3287
|
l("button", {
|
|
3267
3288
|
type: "button",
|
|
3268
3289
|
class: "vs-btn-row",
|
|
3269
|
-
onClick:
|
|
3290
|
+
onClick: b
|
|
3270
3291
|
}, "Import"),
|
|
3271
3292
|
l("button", {
|
|
3272
3293
|
type: "button",
|
|
3273
3294
|
class: "vs-btn-row",
|
|
3274
|
-
onClick:
|
|
3295
|
+
onClick: Ce,
|
|
3275
3296
|
disabled: g.value === 0
|
|
3276
|
-
}, "Export ", 8,
|
|
3297
|
+
}, "Export ", 8, Ir)
|
|
3277
3298
|
]),
|
|
3278
3299
|
l("input", {
|
|
3279
3300
|
ref_key: "importRef",
|
|
3280
3301
|
ref: p,
|
|
3281
3302
|
type: "file",
|
|
3282
|
-
onChange:
|
|
3303
|
+
onChange: I,
|
|
3283
3304
|
accept: ".json,.geojson",
|
|
3284
3305
|
class: "hidden"
|
|
3285
3306
|
}, null, 544)
|
|
3286
3307
|
])
|
|
3287
3308
|
]),
|
|
3288
|
-
l("div",
|
|
3289
|
-
l("div",
|
|
3309
|
+
l("div", zr, [
|
|
3310
|
+
l("div", Ar, [
|
|
3290
3311
|
l("button", {
|
|
3291
|
-
class:
|
|
3312
|
+
class: V(["vs-btn", { "vs-active": h.value === "marker" }]),
|
|
3292
3313
|
"aria-pressed": h.value === "marker",
|
|
3293
3314
|
title: "Point (P)",
|
|
3294
3315
|
"aria-label": "Draw point",
|
|
3295
|
-
onClick:
|
|
3316
|
+
onClick: y[0] || (y[0] = (E) => ce("marker"))
|
|
3296
3317
|
}, [
|
|
3297
|
-
|
|
3298
|
-
], 10,
|
|
3318
|
+
B(Ts)
|
|
3319
|
+
], 10, Or),
|
|
3299
3320
|
l("button", {
|
|
3300
|
-
class:
|
|
3321
|
+
class: V(["vs-btn", { "vs-active": h.value === "polyline" }]),
|
|
3301
3322
|
"aria-pressed": h.value === "polyline",
|
|
3302
3323
|
title: "Line (L)",
|
|
3303
3324
|
"aria-label": "Draw polyline",
|
|
3304
|
-
onClick:
|
|
3325
|
+
onClick: y[1] || (y[1] = (E) => ce("polyline"))
|
|
3305
3326
|
}, [
|
|
3306
|
-
|
|
3307
|
-
], 10,
|
|
3327
|
+
B(Hs)
|
|
3328
|
+
], 10, Er),
|
|
3308
3329
|
l("button", {
|
|
3309
|
-
class:
|
|
3330
|
+
class: V(["vs-btn", { "vs-active": h.value === "polygon" }]),
|
|
3310
3331
|
"aria-pressed": h.value === "polygon",
|
|
3311
3332
|
title: "Polygon (G)",
|
|
3312
3333
|
"aria-label": "Draw polygon",
|
|
3313
|
-
onClick:
|
|
3334
|
+
onClick: y[2] || (y[2] = (E) => ce("polygon"))
|
|
3314
3335
|
}, [
|
|
3315
|
-
|
|
3316
|
-
], 10,
|
|
3336
|
+
B(Ks)
|
|
3337
|
+
], 10, Fr),
|
|
3317
3338
|
l("button", {
|
|
3318
|
-
class:
|
|
3339
|
+
class: V(["vs-btn", { "vs-active": h.value === "rectangle" }]),
|
|
3319
3340
|
"aria-pressed": h.value === "rectangle",
|
|
3320
3341
|
title: "Rectangle (R)",
|
|
3321
3342
|
"aria-label": "Draw rectangle",
|
|
3322
|
-
onClick:
|
|
3343
|
+
onClick: y[3] || (y[3] = (E) => ce("rectangle"))
|
|
3323
3344
|
}, [
|
|
3324
|
-
|
|
3325
|
-
], 10,
|
|
3345
|
+
B(Xs)
|
|
3346
|
+
], 10, Dr),
|
|
3326
3347
|
l("button", {
|
|
3327
3348
|
class: "vs-btn mt-5",
|
|
3328
|
-
onClick:
|
|
3349
|
+
onClick: y[4] || (y[4] = (E) => q.value = !q.value),
|
|
3329
3350
|
title: "Full Screen",
|
|
3330
3351
|
"aria-label": "Full Screen"
|
|
3331
3352
|
}, [
|
|
3332
|
-
|
|
3353
|
+
B(lr, { style: { width: "12px", height: "12px" } })
|
|
3333
3354
|
])
|
|
3334
3355
|
])
|
|
3335
3356
|
]),
|
|
3336
3357
|
l("div", {
|
|
3337
|
-
class:
|
|
3358
|
+
class: V(["absolute left-4 z-[1000]", v.value ? "bottom-8" : "bottom-4"])
|
|
3338
3359
|
}, [
|
|
3339
|
-
|
|
3340
|
-
basemaps:
|
|
3360
|
+
B(Lr, {
|
|
3361
|
+
basemaps: C,
|
|
3341
3362
|
"default-layer": "topo100",
|
|
3342
|
-
onOnLayerChange:
|
|
3363
|
+
onOnLayerChange: $
|
|
3343
3364
|
})
|
|
3344
3365
|
], 2),
|
|
3345
|
-
l("div",
|
|
3346
|
-
v.value ? (i(), u("div",
|
|
3347
|
-
l("div",
|
|
3348
|
-
|
|
3349
|
-
l("span",
|
|
3366
|
+
l("div", Ur, [
|
|
3367
|
+
v.value ? (i(), u("div", Tr, [
|
|
3368
|
+
l("div", Rr, [
|
|
3369
|
+
y[7] || (y[7] = se(" Тип: ")),
|
|
3370
|
+
l("span", Pr, F(v.value.type), 1)
|
|
3350
3371
|
]),
|
|
3351
|
-
l("div",
|
|
3352
|
-
l("div",
|
|
3353
|
-
|
|
3354
|
-
l("b", null,
|
|
3372
|
+
l("div", Nr, [
|
|
3373
|
+
l("div", Hr, [
|
|
3374
|
+
y[8] || (y[8] = se(" Центр: ")),
|
|
3375
|
+
l("b", null, F(v.value.center.lat.toFixed(5)) + ", " + F(v.value.center.lng.toFixed(5)), 1)
|
|
3355
3376
|
]),
|
|
3356
|
-
v.value.areaKm2 !== null ? (i(), u("div",
|
|
3357
|
-
|
|
3358
|
-
l("b", null,
|
|
3359
|
-
])) : (i(), u("div",
|
|
3360
|
-
|
|
3377
|
+
v.value.areaKm2 !== null ? (i(), u("div", qr, [
|
|
3378
|
+
y[9] || (y[9] = se(" Площа: ")),
|
|
3379
|
+
l("b", null, F(v.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3380
|
+
])) : (i(), u("div", Gr, y[10] || (y[10] = [
|
|
3381
|
+
se(" Площа: "),
|
|
3361
3382
|
l("b", null, "—", -1)
|
|
3362
3383
|
]))),
|
|
3363
3384
|
l("button", {
|
|
3364
3385
|
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",
|
|
3365
3386
|
title: "Наблизити",
|
|
3366
|
-
onClick:
|
|
3367
|
-
},
|
|
3368
|
-
|
|
3387
|
+
onClick: y[5] || (y[5] = (E) => Y())
|
|
3388
|
+
}, y[11] || (y[11] = [
|
|
3389
|
+
re('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-ac23d238><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-ac23d238></path><path d="M7 10l6 0" data-v-ac23d238></path><path d="M10 7l0 6" data-v-ac23d238></path><path d="M21 21l-6 -6" data-v-ac23d238></path></svg>', 1)
|
|
3369
3390
|
])),
|
|
3370
3391
|
l("button", {
|
|
3371
3392
|
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",
|
|
3372
3393
|
title: "Видалити",
|
|
3373
|
-
onClick:
|
|
3394
|
+
onClick: y[6] || (y[6] = (E) => we())
|
|
3374
3395
|
}, [
|
|
3375
|
-
|
|
3396
|
+
B(ze, { class: "w-3 h-3" })
|
|
3376
3397
|
])
|
|
3377
3398
|
])
|
|
3378
|
-
])) :
|
|
3399
|
+
])) : j("", !0)
|
|
3379
3400
|
])
|
|
3380
3401
|
], 2));
|
|
3381
3402
|
}
|
|
3382
|
-
}),
|
|
3403
|
+
}), Kr = /* @__PURE__ */ R(Jr, [["__scopeId", "data-v-ac23d238"]]), Zr = ["data-focus"], Wr = { class: "flex items-center" }, Qr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Xr = ["onClick", "aria-label"], Yr = {
|
|
3383
3404
|
key: 0,
|
|
3384
3405
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3385
|
-
},
|
|
3406
|
+
}, en = { class: "flex-1 min-w-[2px]" }, tn = ["placeholder"], ln = { class: "flex items-center shrink-0" }, on = ["disabled"], an = /* @__PURE__ */ O({
|
|
3386
3407
|
__name: "vs-input-tag",
|
|
3387
|
-
props: /* @__PURE__ */
|
|
3408
|
+
props: /* @__PURE__ */ Q({
|
|
3388
3409
|
unique: { type: Boolean, default: !0 },
|
|
3389
3410
|
style: { default: () => ({}) },
|
|
3390
3411
|
customClass: { default: "" },
|
|
@@ -3397,71 +3418,71 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3397
3418
|
modelValue: { default: [] },
|
|
3398
3419
|
modelModifiers: {}
|
|
3399
3420
|
}),
|
|
3400
|
-
emits: /* @__PURE__ */
|
|
3421
|
+
emits: /* @__PURE__ */ Q(["update:modelValue"], ["update:modelValue"]),
|
|
3401
3422
|
setup(o, { emit: e }) {
|
|
3402
3423
|
const t = o, n = e;
|
|
3403
|
-
|
|
3404
|
-
const
|
|
3405
|
-
|
|
3406
|
-
},
|
|
3407
|
-
const
|
|
3408
|
-
|
|
3424
|
+
be(t.style);
|
|
3425
|
+
const s = x(null), a = x(null), r = x(null), d = x(!1), p = x(""), f = X(o, "modelValue"), c = D(() => t.placeholder || "Add tag…"), g = D(() => f.value?.length === 0 && p.value === ""), v = D(() => !t.disabled && f.value?.length > 0), C = D(() => t.disabled), z = async () => {
|
|
3426
|
+
C.value || await Me(() => r.value?.focus());
|
|
3427
|
+
}, U = (P) => {
|
|
3428
|
+
const M = P.trim();
|
|
3429
|
+
M !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [M] : t.unique ? f.value.includes(M) || (f.value = [...f.value, M]) : f.value = [...f.value, M], p.value = "");
|
|
3409
3430
|
}, T = () => {
|
|
3410
|
-
const
|
|
3411
|
-
|
|
3412
|
-
},
|
|
3413
|
-
const
|
|
3414
|
-
|
|
3431
|
+
const P = p.value;
|
|
3432
|
+
P.trim() !== "" && U(P), p.value = "";
|
|
3433
|
+
}, N = (P) => {
|
|
3434
|
+
const M = f.value.slice();
|
|
3435
|
+
M.splice(P, 1), n("update:modelValue", M);
|
|
3415
3436
|
}, _ = () => {
|
|
3416
3437
|
n("update:modelValue", []);
|
|
3417
|
-
},
|
|
3418
|
-
|
|
3438
|
+
}, b = () => {
|
|
3439
|
+
C.value || (d.value = !0);
|
|
3419
3440
|
}, h = () => {
|
|
3420
3441
|
d.value = !1;
|
|
3421
|
-
},
|
|
3422
|
-
const { key:
|
|
3423
|
-
|
|
3442
|
+
}, Z = (P) => {
|
|
3443
|
+
const { key: M } = P;
|
|
3444
|
+
M === "Enter" ? (P.preventDefault(), T()) : M === "Backspace" && p.value === "" && f.value.length > 0 && N(f.value.length - 1);
|
|
3424
3445
|
};
|
|
3425
|
-
return (
|
|
3446
|
+
return (P, M) => (i(), u("div", {
|
|
3426
3447
|
class: "flex gap-1 w-full",
|
|
3427
3448
|
ref_key: "root",
|
|
3428
|
-
ref:
|
|
3429
|
-
onClick:
|
|
3449
|
+
ref: s,
|
|
3450
|
+
onClick: M[1] || (M[1] = ne(() => {
|
|
3430
3451
|
}, ["stop"]))
|
|
3431
3452
|
}, [
|
|
3432
3453
|
l("div", {
|
|
3433
|
-
class:
|
|
3454
|
+
class: V(["relative w-full font-sans", t.customClass]),
|
|
3434
3455
|
role: "group",
|
|
3435
3456
|
"aria-label": "Tag input"
|
|
3436
3457
|
}, [
|
|
3437
3458
|
l("div", {
|
|
3438
|
-
class:
|
|
3459
|
+
class: V([
|
|
3439
3460
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
3440
3461
|
"border-gray-300 hover:border-gray-400",
|
|
3441
3462
|
d.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
3442
|
-
|
|
3463
|
+
C.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3443
3464
|
]),
|
|
3444
3465
|
"data-focus": d.value ? "true" : "false",
|
|
3445
|
-
onClick:
|
|
3466
|
+
onClick: z
|
|
3446
3467
|
}, [
|
|
3447
3468
|
l("div", {
|
|
3448
3469
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3449
3470
|
ref_key: "chipsRef",
|
|
3450
3471
|
ref: a
|
|
3451
3472
|
}, [
|
|
3452
|
-
(i(!0), u(
|
|
3453
|
-
key:
|
|
3473
|
+
(i(!0), u(ee, null, le(f.value, (H, Y) => (i(), u("div", {
|
|
3474
|
+
key: Y,
|
|
3454
3475
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3455
3476
|
}, [
|
|
3456
|
-
l("div",
|
|
3457
|
-
l("div",
|
|
3477
|
+
l("div", Wr, [
|
|
3478
|
+
l("div", Qr, F(H), 1)
|
|
3458
3479
|
]),
|
|
3459
3480
|
l("div", {
|
|
3460
3481
|
role: "button",
|
|
3461
3482
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3462
|
-
onClick:
|
|
3463
|
-
"aria-label": `Remove ${
|
|
3464
|
-
},
|
|
3483
|
+
onClick: ne((we) => N(Y), ["stop"]),
|
|
3484
|
+
"aria-label": `Remove ${H}`
|
|
3485
|
+
}, M[2] || (M[2] = [
|
|
3465
3486
|
l("svg", {
|
|
3466
3487
|
height: "14",
|
|
3467
3488
|
width: "14",
|
|
@@ -3472,14 +3493,14 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3472
3493
|
}, [
|
|
3473
3494
|
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
3474
3495
|
], -1)
|
|
3475
|
-
]), 8,
|
|
3496
|
+
]), 8, Xr)
|
|
3476
3497
|
]))), 128)),
|
|
3477
|
-
g.value ? (i(), u("div",
|
|
3478
|
-
l("div",
|
|
3479
|
-
|
|
3498
|
+
g.value ? (i(), u("div", Yr, F(c.value), 1)) : j("", !0),
|
|
3499
|
+
l("div", en, [
|
|
3500
|
+
C.value ? j("", !0) : K((i(), u("input", {
|
|
3480
3501
|
key: 0,
|
|
3481
3502
|
ref_key: "inputRef",
|
|
3482
|
-
ref:
|
|
3503
|
+
ref: r,
|
|
3483
3504
|
class: "pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
3484
3505
|
autocapitalize: "none",
|
|
3485
3506
|
autocomplete: "off",
|
|
@@ -3488,25 +3509,25 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3488
3509
|
type: "text",
|
|
3489
3510
|
tabindex: "0",
|
|
3490
3511
|
"aria-label": "Add tag",
|
|
3491
|
-
"onUpdate:modelValue":
|
|
3492
|
-
onFocus:
|
|
3512
|
+
"onUpdate:modelValue": M[0] || (M[0] = (H) => p.value = H),
|
|
3513
|
+
onFocus: b,
|
|
3493
3514
|
onBlur: h,
|
|
3494
|
-
onKeydown:
|
|
3515
|
+
onKeydown: Z,
|
|
3495
3516
|
placeholder: f.value && f.value.length ? "" : void 0
|
|
3496
|
-
}, null, 40,
|
|
3497
|
-
[
|
|
3517
|
+
}, null, 40, tn)), [
|
|
3518
|
+
[de, p.value]
|
|
3498
3519
|
])
|
|
3499
3520
|
])
|
|
3500
3521
|
], 512),
|
|
3501
|
-
l("div",
|
|
3522
|
+
l("div", ln, [
|
|
3502
3523
|
v.value ? (i(), u("button", {
|
|
3503
3524
|
key: 0,
|
|
3504
3525
|
type: "button",
|
|
3505
3526
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3506
3527
|
"aria-label": "Clear all tags",
|
|
3507
|
-
disabled:
|
|
3508
|
-
onClick:
|
|
3509
|
-
},
|
|
3528
|
+
disabled: C.value,
|
|
3529
|
+
onClick: ne(_, ["stop"])
|
|
3530
|
+
}, M[3] || (M[3] = [
|
|
3510
3531
|
l("svg", {
|
|
3511
3532
|
height: "20",
|
|
3512
3533
|
width: "20",
|
|
@@ -3515,34 +3536,34 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3515
3536
|
}, [
|
|
3516
3537
|
l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
|
|
3517
3538
|
], -1)
|
|
3518
|
-
]), 8,
|
|
3539
|
+
]), 8, on)) : j("", !0)
|
|
3519
3540
|
])
|
|
3520
|
-
], 10,
|
|
3541
|
+
], 10, Zr)
|
|
3521
3542
|
], 2)
|
|
3522
3543
|
], 512));
|
|
3523
3544
|
}
|
|
3524
|
-
}),
|
|
3525
|
-
VsInputText:
|
|
3526
|
-
VsInputRadio:
|
|
3527
|
-
"vs-input-text":
|
|
3528
|
-
"vs-input-textarea":
|
|
3545
|
+
}), sn = {
|
|
3546
|
+
VsInputText: Ge,
|
|
3547
|
+
VsInputRadio: Ke,
|
|
3548
|
+
"vs-input-text": Ge,
|
|
3549
|
+
"vs-input-textarea": za,
|
|
3529
3550
|
"vs-input-mask": nl,
|
|
3530
3551
|
"vs-input-number": jt,
|
|
3531
|
-
"vs-input-radio":
|
|
3552
|
+
"vs-input-radio": Ke,
|
|
3532
3553
|
"vs-input-select": ja,
|
|
3533
|
-
"vs-input-switcher":
|
|
3534
|
-
"vs-input-static":
|
|
3554
|
+
"vs-input-switcher": ot,
|
|
3555
|
+
"vs-input-static": Je,
|
|
3535
3556
|
"vs-input-container": ia,
|
|
3536
3557
|
"vs-input-date": wl,
|
|
3537
3558
|
"vs-input-checkbox": yl,
|
|
3538
|
-
"vs-input-file":
|
|
3539
|
-
"vs-input-html":
|
|
3559
|
+
"vs-input-file": ro,
|
|
3560
|
+
"vs-input-html": Je,
|
|
3540
3561
|
"vs-input-email": dl,
|
|
3541
|
-
"vs-input-datatable":
|
|
3542
|
-
"vs-input-map":
|
|
3543
|
-
"vs-input-file-list":
|
|
3544
|
-
"vs-input-tag":
|
|
3545
|
-
}, rn = /* @__PURE__ */
|
|
3562
|
+
"vs-input-datatable": As,
|
|
3563
|
+
"vs-input-map": Kr,
|
|
3564
|
+
"vs-input-file-list": Fo,
|
|
3565
|
+
"vs-input-tag": an
|
|
3566
|
+
}, rn = /* @__PURE__ */ O({
|
|
3546
3567
|
__name: "behavior",
|
|
3547
3568
|
props: {
|
|
3548
3569
|
api: {},
|
|
@@ -3556,27 +3577,27 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3556
3577
|
async function n() {
|
|
3557
3578
|
try {
|
|
3558
3579
|
if (!e.api) return;
|
|
3559
|
-
const
|
|
3580
|
+
const s = e.api.replace("{{value}}", e.value), a = await fetch(s);
|
|
3560
3581
|
if (!a.ok) {
|
|
3561
|
-
|
|
3582
|
+
pe({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
3562
3583
|
return;
|
|
3563
3584
|
}
|
|
3564
|
-
const
|
|
3585
|
+
const r = await a.json();
|
|
3565
3586
|
if (!e.set || !t) return;
|
|
3566
3587
|
for (const [d, p] of Object.entries(e.set))
|
|
3567
|
-
t.value[d] =
|
|
3568
|
-
} catch (
|
|
3569
|
-
console.error(e.error,
|
|
3588
|
+
t.value[d] = r.result[p];
|
|
3589
|
+
} catch (s) {
|
|
3590
|
+
console.error(e.error, s);
|
|
3570
3591
|
}
|
|
3571
3592
|
}
|
|
3572
|
-
return (
|
|
3593
|
+
return (s, a) => (i(), u("button", {
|
|
3573
3594
|
onClick: n,
|
|
3574
3595
|
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"
|
|
3575
|
-
},
|
|
3596
|
+
}, F(s.button), 1));
|
|
3576
3597
|
}
|
|
3577
|
-
}),
|
|
3598
|
+
}), nn = { class: "flex w-full" }, rt = /* @__PURE__ */ O({
|
|
3578
3599
|
__name: "vs-compact-form-layout",
|
|
3579
|
-
props: /* @__PURE__ */
|
|
3600
|
+
props: /* @__PURE__ */ Q({
|
|
3580
3601
|
item: { default: {} },
|
|
3581
3602
|
layout: { default: "default" },
|
|
3582
3603
|
style: { default: {} },
|
|
@@ -3588,55 +3609,55 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3588
3609
|
}),
|
|
3589
3610
|
emits: ["update:modelValue"],
|
|
3590
3611
|
setup(o) {
|
|
3591
|
-
const e = o, t =
|
|
3592
|
-
const d =
|
|
3612
|
+
const e = o, t = X(o, "modelValue"), n = D(() => Lt[`${e.layout}`]), s = D(() => sn?.[`vs-input-${e.item.type}`]), a = D(() => {
|
|
3613
|
+
const d = J(s);
|
|
3593
3614
|
if (!d) return /* @__PURE__ */ new Set();
|
|
3594
3615
|
const p = d.props ?? d.__vccOpts?.props;
|
|
3595
3616
|
if (!p) return /* @__PURE__ */ new Set();
|
|
3596
3617
|
const f = Array.isArray(p) ? p : Object.keys(p);
|
|
3597
3618
|
return new Set(f);
|
|
3598
|
-
}),
|
|
3619
|
+
}), r = D(() => {
|
|
3599
3620
|
const d = e.item ?? {}, p = a.value;
|
|
3600
3621
|
return p.size ? Object.fromEntries(Object.entries(d).filter(([f]) => p.has(f))) : {};
|
|
3601
3622
|
});
|
|
3602
|
-
return (d, p) => (i(),
|
|
3623
|
+
return (d, p) => (i(), te(_e(n.value), {
|
|
3603
3624
|
ua: e.item.ua,
|
|
3604
3625
|
error: e.error || "",
|
|
3605
3626
|
item: d.item,
|
|
3606
3627
|
label: e.item.label
|
|
3607
3628
|
}, {
|
|
3608
|
-
default:
|
|
3609
|
-
l("div",
|
|
3610
|
-
(i(),
|
|
3629
|
+
default: $e(() => [
|
|
3630
|
+
l("div", nn, [
|
|
3631
|
+
(i(), te(_e(s.value), Le(r.value, {
|
|
3611
3632
|
modelValue: t.value,
|
|
3612
3633
|
"onUpdate:modelValue": p[0] || (p[0] = (f) => t.value = f)
|
|
3613
3634
|
}), null, 16, ["modelValue"])),
|
|
3614
|
-
d.item.behavior ? (i(),
|
|
3635
|
+
d.item.behavior ? (i(), te(rn, Le({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : j("", !0)
|
|
3615
3636
|
])
|
|
3616
3637
|
]),
|
|
3617
3638
|
_: 1
|
|
3618
3639
|
}, 8, ["ua", "error", "item", "label"]));
|
|
3619
3640
|
}
|
|
3620
|
-
}),
|
|
3641
|
+
}), nt = {
|
|
3621
3642
|
required: "Це поле є обов’язковим",
|
|
3622
3643
|
email: "Неправильний email"
|
|
3623
|
-
},
|
|
3644
|
+
}, un = (o) => o ? !1 : nt.required, dn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? nt.email : !1, cn = (o, e) => {
|
|
3624
3645
|
const t = e.pattern ?? e.regexp;
|
|
3625
3646
|
return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
|
|
3626
|
-
},
|
|
3647
|
+
}, pn = (o, e) => !1, fn = (o, e) => {
|
|
3627
3648
|
switch (typeof e == "string" ? e : e.type) {
|
|
3628
3649
|
case "required":
|
|
3629
|
-
return nn(o);
|
|
3630
|
-
case "email":
|
|
3631
3650
|
return un(o);
|
|
3651
|
+
case "email":
|
|
3652
|
+
return dn(o);
|
|
3632
3653
|
case "regexp":
|
|
3633
|
-
return
|
|
3654
|
+
return cn(o, e);
|
|
3634
3655
|
case "custom":
|
|
3635
|
-
return
|
|
3656
|
+
return pn();
|
|
3636
3657
|
default:
|
|
3637
3658
|
return !1;
|
|
3638
3659
|
}
|
|
3639
|
-
},
|
|
3660
|
+
}, vn = {
|
|
3640
3661
|
autocomplete: "select",
|
|
3641
3662
|
combobox: "select",
|
|
3642
3663
|
datepicker: "date",
|
|
@@ -3648,16 +3669,16 @@ const ts = /* @__PURE__ */ R(Xr, [["render", es]]), ls = { class: "form-geom__se
|
|
|
3648
3669
|
file: "file"
|
|
3649
3670
|
// mask: 'text',
|
|
3650
3671
|
};
|
|
3651
|
-
function
|
|
3672
|
+
function Xe(o) {
|
|
3652
3673
|
const e = o.toLowerCase();
|
|
3653
|
-
return
|
|
3674
|
+
return vn[e] || e;
|
|
3654
3675
|
}
|
|
3655
|
-
function
|
|
3676
|
+
function mn(o) {
|
|
3656
3677
|
if (Array.isArray(o)) {
|
|
3657
3678
|
const t = [];
|
|
3658
3679
|
return o.forEach((n) => {
|
|
3659
|
-
const
|
|
3660
|
-
|
|
3680
|
+
const s = { ...n };
|
|
3681
|
+
s.name = (n.name || n.id || n.key || "").toString(), s.type = Xe(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, n.data && (s.api = `/api/suggest/${n.data}`), t.push(s);
|
|
3661
3682
|
}), t;
|
|
3662
3683
|
}
|
|
3663
3684
|
const e = [];
|
|
@@ -3665,46 +3686,46 @@ function vn(o) {
|
|
|
3665
3686
|
const n = {
|
|
3666
3687
|
name: t[0],
|
|
3667
3688
|
...t[1],
|
|
3668
|
-
type:
|
|
3689
|
+
type: Xe(t[1].type),
|
|
3669
3690
|
label: t[1].label || t[1].ua,
|
|
3670
3691
|
rules: t[1].rules || t[1].validators
|
|
3671
3692
|
};
|
|
3672
3693
|
t[1].type.includes("list") && (n.multiple = !0), t[1].data && (n.api = `/api/suggest/${t[1].data}`), e.push(n);
|
|
3673
3694
|
}), e;
|
|
3674
3695
|
}
|
|
3675
|
-
function
|
|
3676
|
-
const t =
|
|
3677
|
-
function
|
|
3696
|
+
function hn(o, e) {
|
|
3697
|
+
const t = mn(e), n = x({});
|
|
3698
|
+
function s(p) {
|
|
3678
3699
|
const f = p?.conditions;
|
|
3679
3700
|
if (!f) return !0;
|
|
3680
3701
|
const c = Array.isArray(f) ? f[0] : f, g = o?.value?.[c];
|
|
3681
|
-
return
|
|
3702
|
+
return st(g, f);
|
|
3682
3703
|
}
|
|
3683
3704
|
const a = (p = t, f = !0) => (p.forEach((c) => {
|
|
3684
3705
|
if (c.rules) {
|
|
3685
|
-
if (!
|
|
3706
|
+
if (!s(c)) {
|
|
3686
3707
|
delete n.value[c.name];
|
|
3687
3708
|
return;
|
|
3688
3709
|
}
|
|
3689
3710
|
c.rules.forEach((g) => {
|
|
3690
|
-
const v =
|
|
3711
|
+
const v = fn(o.value[c.name], g);
|
|
3691
3712
|
v ? n.value[c.name] = v : delete n.value[c.name];
|
|
3692
3713
|
});
|
|
3693
3714
|
}
|
|
3694
3715
|
c.schema && a(c.schema, !1);
|
|
3695
|
-
}), f && Object.values(n.value).some(Boolean) ? n.value : null),
|
|
3716
|
+
}), f && Object.values(n.value).some(Boolean) ? n.value : null), r = D(() => t?.filter((p) => s(p)));
|
|
3696
3717
|
return {
|
|
3697
3718
|
errors: n,
|
|
3698
3719
|
validate: a,
|
|
3699
3720
|
reset: () => {
|
|
3700
3721
|
o.value = {}, n.value = {};
|
|
3701
3722
|
},
|
|
3702
|
-
visibleSchema:
|
|
3723
|
+
visibleSchema: r
|
|
3703
3724
|
};
|
|
3704
3725
|
}
|
|
3705
|
-
const
|
|
3726
|
+
const Ie = /* @__PURE__ */ O({
|
|
3706
3727
|
__name: "vs-compact-form",
|
|
3707
|
-
props: /* @__PURE__ */
|
|
3728
|
+
props: /* @__PURE__ */ Q({
|
|
3708
3729
|
schema: { default: () => [] },
|
|
3709
3730
|
style: { default: () => ({}) },
|
|
3710
3731
|
modelValue: {},
|
|
@@ -3716,74 +3737,74 @@ const Ee = /* @__PURE__ */ A({
|
|
|
3716
3737
|
values: { default: () => ({}) },
|
|
3717
3738
|
valuesModifiers: {}
|
|
3718
3739
|
}),
|
|
3719
|
-
emits: /* @__PURE__ */
|
|
3740
|
+
emits: /* @__PURE__ */ Q(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
3720
3741
|
setup(o, { expose: e, emit: t }) {
|
|
3721
|
-
const n = t,
|
|
3742
|
+
const n = t, s = o, a = X(o, "form"), r = X(o, "values"), {
|
|
3722
3743
|
errors: d,
|
|
3723
3744
|
validate: p,
|
|
3724
3745
|
reset: f,
|
|
3725
3746
|
visibleSchema: c
|
|
3726
|
-
} =
|
|
3727
|
-
n("update:modelValue",
|
|
3747
|
+
} = hn(r, s.schema), g = () => {
|
|
3748
|
+
n("update:modelValue", r.value), p(), n("handle-submit", r.value);
|
|
3728
3749
|
};
|
|
3729
3750
|
e({
|
|
3730
3751
|
validate: p,
|
|
3731
3752
|
reset: f,
|
|
3732
3753
|
errors: d
|
|
3733
|
-
}),
|
|
3734
|
-
|
|
3754
|
+
}), ue(() => {
|
|
3755
|
+
s.modelValue && (r.value = s.modelValue), a.value.value = r.value, a.value.errors = d.value, a.value.reset = f, a.value.validate = p, a.value.formId = s.formId;
|
|
3735
3756
|
});
|
|
3736
|
-
function v(
|
|
3737
|
-
if (
|
|
3738
|
-
if (typeof
|
|
3739
|
-
const
|
|
3740
|
-
return
|
|
3757
|
+
function v(C, z) {
|
|
3758
|
+
if (C === z) return !0;
|
|
3759
|
+
if (typeof C != "object" || typeof z != "object" || !C || !z) return !1;
|
|
3760
|
+
const U = Object.keys(C), T = Object.keys(z);
|
|
3761
|
+
return U.length !== T.length ? !1 : U.every((N) => C[N] === z[N]);
|
|
3741
3762
|
}
|
|
3742
|
-
return He("form", a), He("values",
|
|
3743
|
-
onSubmit:
|
|
3744
|
-
class:
|
|
3763
|
+
return He("form", a), He("values", r), (C, z) => (i(), u("form", {
|
|
3764
|
+
onSubmit: ne(g, ["prevent"]),
|
|
3765
|
+
class: V(["grid grid-cols-12", C.layout === "default" ? "gap-6" : "gap-4"])
|
|
3745
3766
|
}, [
|
|
3746
|
-
(i(!0), u(
|
|
3747
|
-
key:
|
|
3748
|
-
class:
|
|
3749
|
-
style:
|
|
3750
|
-
item:
|
|
3751
|
-
layout:
|
|
3752
|
-
"model-value":
|
|
3767
|
+
(i(!0), u(ee, null, le(J(c), (U) => (i(), te(rt, {
|
|
3768
|
+
key: U.name,
|
|
3769
|
+
class: V(C.layout === "horizontal" ? "col-span-12" : `col-span-${U.col || 12} `),
|
|
3770
|
+
style: he(C.style),
|
|
3771
|
+
item: U,
|
|
3772
|
+
layout: C.layout,
|
|
3773
|
+
"model-value": r.value[U.name],
|
|
3753
3774
|
"onUpdate:modelValue": (T) => {
|
|
3754
|
-
const
|
|
3755
|
-
v(
|
|
3775
|
+
const N = r.value[U.name];
|
|
3776
|
+
v(N, T) || (r.value[U.name] = T);
|
|
3756
3777
|
},
|
|
3757
|
-
error:
|
|
3778
|
+
error: J(d)[U.name]
|
|
3758
3779
|
}, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
|
|
3759
3780
|
], 34));
|
|
3760
3781
|
}
|
|
3761
3782
|
});
|
|
3762
|
-
|
|
3763
|
-
e.component("VForm",
|
|
3764
|
-
$form:
|
|
3765
|
-
}), e.provide("form",
|
|
3783
|
+
Ie.install = function(e) {
|
|
3784
|
+
e.component("VForm", Ie), Object.assign(e.config.globalProperties, {
|
|
3785
|
+
$form: Oe
|
|
3786
|
+
}), e.provide("form", Oe), window.v3plugin || (window.v3plugin = {});
|
|
3766
3787
|
};
|
|
3767
3788
|
export {
|
|
3768
3789
|
ma as ModalEdit,
|
|
3769
|
-
|
|
3790
|
+
Ie as VForm,
|
|
3770
3791
|
yl as VsInputCheckbox,
|
|
3771
3792
|
ia as VsInputContainer,
|
|
3772
3793
|
wl as VsInputDate,
|
|
3773
3794
|
dl as VsInputEmail,
|
|
3774
|
-
|
|
3775
|
-
|
|
3795
|
+
ro as VsInputFile,
|
|
3796
|
+
Fo as VsInputFileList,
|
|
3776
3797
|
nl as VsInputMask,
|
|
3777
3798
|
jt as VsInputNumber,
|
|
3778
|
-
|
|
3799
|
+
Ke as VsInputRadio,
|
|
3779
3800
|
ja as VsInputSelect,
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3801
|
+
Je as VsInputStatic,
|
|
3802
|
+
ot as VsInputSwitcher,
|
|
3803
|
+
an as VsInputTag,
|
|
3804
|
+
Ge as VsInputText,
|
|
3805
|
+
za as VsInputTextarea,
|
|
3806
|
+
Ie as default,
|
|
3807
|
+
sn as inputs,
|
|
3808
|
+
As as vsInputDatatable,
|
|
3809
|
+
Kr as vsInputMap
|
|
3789
3810
|
};
|