@opengis/form 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { notify as ye, VsModal as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as D, ref as x, onMounted as me, onUnmounted as Te, createElementBlock as c, openBlock as u, normalizeClass as V, createCommentVNode as z, renderSlot as _e, createElementVNode as l, toDisplayString as U, normalizeProps as Re, guardReactiveProps as Pe, createTextVNode as fe, computed as F, mergeModels as Z, useModel as W, withDirectives as K, unref as q, vModelText as se, vModelCheckbox as vt, createVNode as B, createBlock as ie, resolveDynamicComponent as Be, normalizeStyle as xe, withCtx as Le, withModifiers as ve, onBeforeUnmount as Bt, watch as le, createStaticVNode as ce, vModelRadio as mt, Fragment as Y, renderList as oe, mergeProps as Ee, reactive as jt, vModelDynamic as It, vShow as Je, inject as Me, resolveComponent as at, Transition as ht, nextTick as ze, Teleport as zt, getCurrentInstance as Et, provide as st } from "vue";
|
|
2
|
+
import { notify as ye, VsModal as gt, modal as At } from "@opengis/core";
|
|
3
|
+
const Dt = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
6
|
-
},
|
|
6
|
+
}, Ft = { class: "opacity-100" }, Ot = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-red-500 text-[14px]"
|
|
9
|
-
},
|
|
9
|
+
}, Ut = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
12
|
-
},
|
|
12
|
+
}, Tt = /* @__PURE__ */ D({
|
|
13
13
|
__name: "vs-layout-default",
|
|
14
14
|
props: {
|
|
15
15
|
ua: { default: "" },
|
|
@@ -31,26 +31,26 @@ const At = {
|
|
|
31
31
|
}), Te(() => {
|
|
32
32
|
window.removeEventListener("resize", t);
|
|
33
33
|
}), (n, s) => (u(), c("div", {
|
|
34
|
-
class:
|
|
34
|
+
class: V(["w-full relative", { "opacity-60": n.item.disabled }])
|
|
35
35
|
}, [
|
|
36
|
-
n.ua || n.label ? (u(), c("div",
|
|
37
|
-
l("span",
|
|
38
|
-
n.item?.rules?.includes("required") ? (u(), c("span",
|
|
36
|
+
n.ua || n.label ? (u(), c("div", Dt, [
|
|
37
|
+
l("span", Ft, U(n.item[e.value] || n.ua || n.label), 1),
|
|
38
|
+
n.item?.rules?.includes("required") ? (u(), c("span", Ot, "*")) : z("", !0)
|
|
39
39
|
])) : z("", !0),
|
|
40
40
|
_e(n.$slots, "default", Re(Pe(n.$attrs))),
|
|
41
|
-
n.error ? (u(), c("span",
|
|
41
|
+
n.error ? (u(), c("span", Ut, U(n.error), 1)) : z("", !0)
|
|
42
42
|
], 2));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), Rt = { class: "w-full relative flex flex-row items-center gap-2" }, Pt = {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
|
|
47
|
-
},
|
|
47
|
+
}, Ht = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "text-red-500 text-[14px]"
|
|
50
|
-
},
|
|
50
|
+
}, Nt = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
53
|
-
},
|
|
53
|
+
}, qt = /* @__PURE__ */ D({
|
|
54
54
|
__name: "vs-layout-horizontal",
|
|
55
55
|
props: {
|
|
56
56
|
ua: { default: "" },
|
|
@@ -64,19 +64,19 @@ const At = {
|
|
|
64
64
|
label: { default: "" }
|
|
65
65
|
},
|
|
66
66
|
setup(o) {
|
|
67
|
-
return (e, t) => (u(), c("div",
|
|
68
|
-
e.item?.type !== "html" ? (u(), c("span",
|
|
67
|
+
return (e, t) => (u(), c("div", Rt, [
|
|
68
|
+
e.item?.type !== "html" ? (u(), c("span", Pt, [
|
|
69
69
|
fe(U(e.ua || e.label) + " ", 1),
|
|
70
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (u(), c("span",
|
|
70
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (u(), c("span", Ht, "*")) : z("", !0)
|
|
71
71
|
])) : z("", !0),
|
|
72
72
|
_e(e.$slots, "default", Re(Pe(e.$attrs))),
|
|
73
|
-
e.error ? (u(), c("span",
|
|
73
|
+
e.error ? (u(), c("span", Nt, U(e.error), 1)) : z("", !0)
|
|
74
74
|
]));
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
76
|
+
}), Gt = { class: "w-full relative" }, Jt = {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
79
|
-
},
|
|
79
|
+
}, Kt = /* @__PURE__ */ D({
|
|
80
80
|
__name: "vs-layout-inline",
|
|
81
81
|
props: {
|
|
82
82
|
ua: { default: "" },
|
|
@@ -90,24 +90,24 @@ const At = {
|
|
|
90
90
|
label: { default: "" }
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
|
-
return (e, t) => (u(), c("div",
|
|
93
|
+
return (e, t) => (u(), c("div", Gt, [
|
|
94
94
|
_e(e.$slots, "default", Re(Pe(e.$attrs))),
|
|
95
|
-
e.error ? (u(), c("span",
|
|
95
|
+
e.error ? (u(), c("span", Jt, U(e.error), 1)) : z("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}),
|
|
98
|
+
}), Zt = { class: "flex-1 min-w-0" }, Wt = {
|
|
99
99
|
key: 0,
|
|
100
100
|
class: "text-sm font-medium text-slate-700 dark:text-slate-200 flex items-center gap-1"
|
|
101
|
-
},
|
|
101
|
+
}, Qt = { class: "truncate" }, Xt = {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "text-red-500 text-[14px]"
|
|
104
|
-
},
|
|
104
|
+
}, Yt = {
|
|
105
105
|
key: 1,
|
|
106
106
|
class: "text-xs text-slate-500 dark:text-slate-400"
|
|
107
|
-
},
|
|
107
|
+
}, el = { class: "w-full md:w-auto" }, tl = {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: "mt-1 text-xs text-red-500"
|
|
110
|
-
},
|
|
110
|
+
}, ll = /* @__PURE__ */ D({
|
|
111
111
|
__name: "vs-layout-settings",
|
|
112
112
|
props: {
|
|
113
113
|
ua: { default: "" },
|
|
@@ -135,30 +135,30 @@ const At = {
|
|
|
135
135
|
}), Te(() => {
|
|
136
136
|
window.removeEventListener("storage", a);
|
|
137
137
|
}), (i, d) => (u(), c("div", {
|
|
138
|
-
class:
|
|
138
|
+
class: V(["w-full relative", { "opacity-60": i.item?.disabled }])
|
|
139
139
|
}, [
|
|
140
140
|
l("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: V(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(i.item.type) ? "flex flex-col" : ""]])
|
|
142
142
|
}, [
|
|
143
|
-
l("div",
|
|
144
|
-
i.ua || i.label ? (u(), c("p",
|
|
145
|
-
l("span",
|
|
146
|
-
s.value ? (u(), c("span",
|
|
143
|
+
l("div", Zt, [
|
|
144
|
+
i.ua || i.label ? (u(), c("p", Wt, [
|
|
145
|
+
l("span", Qt, U(i.item[t.value] || i.ua || i.label), 1),
|
|
146
|
+
s.value ? (u(), c("span", Xt, "*")) : z("", !0)
|
|
147
147
|
])) : z("", !0),
|
|
148
|
-
n.value ? (u(), c("p",
|
|
148
|
+
n.value ? (u(), c("p", Yt, U(n.value), 1)) : z("", !0)
|
|
149
149
|
]),
|
|
150
|
-
l("div",
|
|
150
|
+
l("div", el, [
|
|
151
151
|
_e(i.$slots, "default", Re(Pe(i.$attrs)))
|
|
152
152
|
])
|
|
153
153
|
], 2),
|
|
154
|
-
r.value ? (u(), c("p",
|
|
154
|
+
r.value ? (u(), c("p", tl, U(r.value), 1)) : z("", !0)
|
|
155
155
|
], 2));
|
|
156
156
|
}
|
|
157
|
-
}),
|
|
158
|
-
default:
|
|
159
|
-
horizontal:
|
|
160
|
-
inline:
|
|
161
|
-
settings:
|
|
157
|
+
}), ol = {
|
|
158
|
+
default: Tt,
|
|
159
|
+
horizontal: qt,
|
|
160
|
+
inline: Kt,
|
|
161
|
+
settings: ll
|
|
162
162
|
};
|
|
163
163
|
function he(o) {
|
|
164
164
|
return {
|
|
@@ -168,7 +168,7 @@ function he(o) {
|
|
|
168
168
|
})
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const al = ["placeholder", "disabled"], sl = /* @__PURE__ */ D({
|
|
172
172
|
__name: "vs-input-password",
|
|
173
173
|
props: /* @__PURE__ */ Z({
|
|
174
174
|
style: { default: () => ({}) },
|
|
@@ -190,15 +190,15 @@ const ol = ["placeholder", "disabled"], al = /* @__PURE__ */ A({
|
|
|
190
190
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
|
|
191
191
|
placeholder: s.placeholder,
|
|
192
192
|
disabled: s.disabled,
|
|
193
|
-
class:
|
|
193
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
|
|
194
194
|
style: {
|
|
195
195
|
border: "1px solid #CFD9E0"
|
|
196
196
|
}
|
|
197
|
-
}, null, 10,
|
|
198
|
-
[
|
|
197
|
+
}, null, 10, al)), [
|
|
198
|
+
[se, n.value]
|
|
199
199
|
]);
|
|
200
200
|
}
|
|
201
|
-
}),
|
|
201
|
+
}), nl = ["placeholder", "disabled"], Ue = /* @__PURE__ */ D({
|
|
202
202
|
__name: "vs-input-text",
|
|
203
203
|
props: /* @__PURE__ */ Z({
|
|
204
204
|
style: { default: () => ({}) },
|
|
@@ -220,15 +220,15 @@ const ol = ["placeholder", "disabled"], al = /* @__PURE__ */ A({
|
|
|
220
220
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
|
|
221
221
|
placeholder: s.placeholder,
|
|
222
222
|
disabled: s.disabled,
|
|
223
|
-
class:
|
|
223
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
|
|
224
224
|
style: {
|
|
225
225
|
border: "1px solid #CFD9E0"
|
|
226
226
|
}
|
|
227
|
-
}, null, 10,
|
|
228
|
-
[
|
|
227
|
+
}, null, 10, nl)), [
|
|
228
|
+
[se, n.value]
|
|
229
229
|
]);
|
|
230
230
|
}
|
|
231
|
-
}),
|
|
231
|
+
}), rl = ["placeholder"], il = /* @__PURE__ */ D({
|
|
232
232
|
__name: "vs-input-number",
|
|
233
233
|
props: /* @__PURE__ */ Z({
|
|
234
234
|
style: { default: () => ({}) },
|
|
@@ -250,12 +250,12 @@ const ol = ["placeholder", "disabled"], al = /* @__PURE__ */ A({
|
|
|
250
250
|
step: "any",
|
|
251
251
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
|
|
252
252
|
placeholder: s.placeholder,
|
|
253
|
-
class:
|
|
253
|
+
class: V(["py-1.5 px-3 block w-full bg-white", [q(t)]]),
|
|
254
254
|
style: {
|
|
255
255
|
border: "1px solid #CFD9E0"
|
|
256
256
|
}
|
|
257
|
-
}, null, 10,
|
|
258
|
-
[
|
|
257
|
+
}, null, 10, rl)), [
|
|
258
|
+
[se, n.value]
|
|
259
259
|
]);
|
|
260
260
|
}
|
|
261
261
|
}), N = (o, e) => {
|
|
@@ -263,7 +263,7 @@ const ol = ["placeholder", "disabled"], al = /* @__PURE__ */ A({
|
|
|
263
263
|
for (const [n, s] of e)
|
|
264
264
|
t[n] = s;
|
|
265
265
|
return t;
|
|
266
|
-
},
|
|
266
|
+
}, ul = {}, dl = {
|
|
267
267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
268
268
|
viewBox: "0 0 24 24",
|
|
269
269
|
fill: "none",
|
|
@@ -273,8 +273,8 @@ const ol = ["placeholder", "disabled"], al = /* @__PURE__ */ A({
|
|
|
273
273
|
"stroke-linejoin": "round",
|
|
274
274
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
275
275
|
};
|
|
276
|
-
function
|
|
277
|
-
return u(), c("svg",
|
|
276
|
+
function cl(o, e) {
|
|
277
|
+
return u(), c("svg", dl, e[0] || (e[0] = [
|
|
278
278
|
l("path", {
|
|
279
279
|
stroke: "none",
|
|
280
280
|
d: "M0 0h24v24H0z",
|
|
@@ -283,7 +283,7 @@ function dl(o, e) {
|
|
|
283
283
|
l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
284
284
|
]));
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const pl = /* @__PURE__ */ N(ul, [["render", cl]]), fl = { class: "flex items-center gap-[4px]" }, vl = ["value", "id", "disabled"], ml = ["for"], hl = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, gl = /* @__PURE__ */ D({
|
|
287
287
|
__name: "vs-checkbox-default",
|
|
288
288
|
props: {
|
|
289
289
|
value: { default: "" },
|
|
@@ -300,41 +300,41 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
300
300
|
get: () => n.modelValue,
|
|
301
301
|
set: (r) => t("update:modelValue", r)
|
|
302
302
|
});
|
|
303
|
-
return (r, a) => (u(), c("div",
|
|
303
|
+
return (r, a) => (u(), c("div", fl, [
|
|
304
304
|
K(l("input", {
|
|
305
305
|
type: "checkbox",
|
|
306
306
|
value: r.value,
|
|
307
307
|
"onUpdate:modelValue": a[0] || (a[0] = (i) => s.value = i),
|
|
308
|
-
class:
|
|
308
|
+
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": r.disabled }]),
|
|
309
309
|
id: r.id,
|
|
310
310
|
disabled: r.disabled
|
|
311
|
-
}, null, 10,
|
|
312
|
-
[
|
|
311
|
+
}, null, 10, vl), [
|
|
312
|
+
[vt, s.value]
|
|
313
313
|
]),
|
|
314
314
|
l("label", {
|
|
315
315
|
for: r.id,
|
|
316
|
-
class:
|
|
316
|
+
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": r.disabled }])
|
|
317
317
|
}, [
|
|
318
318
|
l("div", {
|
|
319
|
-
class:
|
|
319
|
+
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", r.error ? "border-red-600" : ""]])
|
|
320
320
|
}, [
|
|
321
|
-
B(
|
|
321
|
+
B(pl, {
|
|
322
322
|
height: "12",
|
|
323
323
|
width: "12"
|
|
324
324
|
})
|
|
325
325
|
], 2),
|
|
326
|
-
l("span",
|
|
326
|
+
l("span", hl, [
|
|
327
327
|
_e(r.$slots, "default", {}, () => [
|
|
328
328
|
fe(U(r.label), 1)
|
|
329
329
|
])
|
|
330
330
|
])
|
|
331
|
-
], 10,
|
|
331
|
+
], 10, ml)
|
|
332
332
|
]));
|
|
333
333
|
}
|
|
334
|
-
}),
|
|
334
|
+
}), bl = ["name", "value", "disabled"], yl = { class: "flex items-center gap-[6px] text-[14px]" }, xl = {
|
|
335
335
|
key: 0,
|
|
336
336
|
class: "text-[16px]"
|
|
337
|
-
},
|
|
337
|
+
}, wl = ["src"], kl = /* @__PURE__ */ D({
|
|
338
338
|
__name: "vs-checkbox-buttons",
|
|
339
339
|
props: {
|
|
340
340
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -355,7 +355,7 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
355
355
|
}
|
|
356
356
|
}), r = F(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), a = F(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
357
357
|
return (i, d) => (u(), c("label", {
|
|
358
|
-
class:
|
|
358
|
+
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", [a.value, r.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
359
359
|
}, [
|
|
360
360
|
K(l("input", {
|
|
361
361
|
type: "checkbox",
|
|
@@ -364,14 +364,14 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
364
364
|
value: i.value,
|
|
365
365
|
"onUpdate:modelValue": d[0] || (d[0] = (v) => s.value = v),
|
|
366
366
|
disabled: i.disabled
|
|
367
|
-
}, null, 8,
|
|
368
|
-
[
|
|
367
|
+
}, null, 8, bl), [
|
|
368
|
+
[vt, s.value]
|
|
369
369
|
]),
|
|
370
|
-
l("span",
|
|
371
|
-
i.icon || i.imgUrl ? (u(), c("span",
|
|
370
|
+
l("span", yl, [
|
|
371
|
+
i.icon || i.imgUrl ? (u(), c("span", xl, [
|
|
372
372
|
i.icon ? (u(), c("i", {
|
|
373
373
|
key: 0,
|
|
374
|
-
class:
|
|
374
|
+
class: V(i.icon)
|
|
375
375
|
}, null, 2)) : z("", !0),
|
|
376
376
|
i.imgUrl ? (u(), c("img", {
|
|
377
377
|
key: 1,
|
|
@@ -379,7 +379,7 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
379
379
|
width: "16",
|
|
380
380
|
height: "16",
|
|
381
381
|
alt: "icon"
|
|
382
|
-
}, null, 8,
|
|
382
|
+
}, null, 8, wl)) : z("", !0)
|
|
383
383
|
])) : z("", !0),
|
|
384
384
|
_e(i.$slots, "default", {}, () => [
|
|
385
385
|
fe(U(i.label), 1)
|
|
@@ -387,7 +387,7 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
387
387
|
])
|
|
388
388
|
], 2));
|
|
389
389
|
}
|
|
390
|
-
}),
|
|
390
|
+
}), _l = { class: "flex items-center" }, bt = /* @__PURE__ */ D({
|
|
391
391
|
__name: "vs-input-checkbox-item",
|
|
392
392
|
props: {
|
|
393
393
|
value: { default: "" },
|
|
@@ -414,8 +414,8 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
414
414
|
n("update:modelValue", i);
|
|
415
415
|
}
|
|
416
416
|
}), a = x(`vs-checkbox-${t.view || "default"}`);
|
|
417
|
-
return (i, d) => (u(), c("div",
|
|
418
|
-
(u(),
|
|
417
|
+
return (i, d) => (u(), c("div", _l, [
|
|
418
|
+
(u(), ie(Be(a.value === "vs-checkbox-buttons" ? q(kl) : q(gl)), {
|
|
419
419
|
value: i.value,
|
|
420
420
|
label: i.label,
|
|
421
421
|
info: i.option?.info,
|
|
@@ -435,7 +435,7 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
435
435
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
436
436
|
]));
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), $l = {}, Vl = {
|
|
439
439
|
xmlns: "http://www.w3.org/2000/svg",
|
|
440
440
|
viewBox: "0 0 24 24",
|
|
441
441
|
fill: "none",
|
|
@@ -445,8 +445,8 @@ const cl = /* @__PURE__ */ N(il, [["render", dl]]), pl = { class: "flex items-ce
|
|
|
445
445
|
"stroke-linejoin": "round",
|
|
446
446
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
447
447
|
};
|
|
448
|
-
function
|
|
449
|
-
return u(), c("svg",
|
|
448
|
+
function Cl(o, e) {
|
|
449
|
+
return u(), c("svg", Vl, e[0] || (e[0] = [
|
|
450
450
|
l("path", {
|
|
451
451
|
stroke: "none",
|
|
452
452
|
d: "M0 0h24v24H0z",
|
|
@@ -455,7 +455,7 @@ function Vl(o, e) {
|
|
|
455
455
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
456
456
|
]));
|
|
457
457
|
}
|
|
458
|
-
const
|
|
458
|
+
const Ml = /* @__PURE__ */ N($l, [["render", Cl]]), Ll = {}, Sl = {
|
|
459
459
|
xmlns: "http://www.w3.org/2000/svg",
|
|
460
460
|
viewBox: "0 0 24 24",
|
|
461
461
|
fill: "none",
|
|
@@ -465,8 +465,8 @@ const Cl = /* @__PURE__ */ N(_l, [["render", Vl]]), Ml = {}, Ll = {
|
|
|
465
465
|
"stroke-linejoin": "round",
|
|
466
466
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
467
467
|
};
|
|
468
|
-
function
|
|
469
|
-
return u(), c("svg",
|
|
468
|
+
function Bl(o, e) {
|
|
469
|
+
return u(), c("svg", Sl, e[0] || (e[0] = [
|
|
470
470
|
l("path", {
|
|
471
471
|
stroke: "none",
|
|
472
472
|
d: "M0 0h24v24H0z",
|
|
@@ -476,7 +476,7 @@ function Sl(o, e) {
|
|
|
476
476
|
l("path", { d: "M6 6l12 12" }, null, -1)
|
|
477
477
|
]));
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const jl = /* @__PURE__ */ N(Ll, [["render", Bl]]), Il = {}, zl = {
|
|
480
480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
481
481
|
width: "24",
|
|
482
482
|
height: "24",
|
|
@@ -487,8 +487,8 @@ const Bl = /* @__PURE__ */ N(Ml, [["render", Sl]]), jl = {}, Il = {
|
|
|
487
487
|
"stroke-linecap": "round",
|
|
488
488
|
"stroke-linejoin": "round"
|
|
489
489
|
};
|
|
490
|
-
function
|
|
491
|
-
return u(), c("svg",
|
|
490
|
+
function El(o, e) {
|
|
491
|
+
return u(), c("svg", zl, e[0] || (e[0] = [
|
|
492
492
|
l("path", {
|
|
493
493
|
stroke: "none",
|
|
494
494
|
d: "M0 0h24v24H0z",
|
|
@@ -499,13 +499,13 @@ function zl(o, e) {
|
|
|
499
499
|
l("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
500
500
|
]));
|
|
501
501
|
}
|
|
502
|
-
const
|
|
502
|
+
const Al = /* @__PURE__ */ N(Il, [["render", El]]), Dl = {
|
|
503
503
|
key: 0,
|
|
504
504
|
class: "flex items-start gap-x-1"
|
|
505
|
-
},
|
|
505
|
+
}, Fl = {
|
|
506
506
|
key: 0,
|
|
507
507
|
class: "text-red-500 text-[14px]"
|
|
508
|
-
},
|
|
508
|
+
}, Ol = ["title"], Ul = ["disabled"], yt = /* @__PURE__ */ D({
|
|
509
509
|
__name: "vs-input-switcher",
|
|
510
510
|
props: /* @__PURE__ */ Z({
|
|
511
511
|
rules: { default: () => [] },
|
|
@@ -527,14 +527,14 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
527
527
|
emits: ["update:modelValue"],
|
|
528
528
|
setup(o) {
|
|
529
529
|
const e = o, t = W(o, "modelValue");
|
|
530
|
-
return (n, s) => e.view === "checkbox" ? (u(), c("div",
|
|
531
|
-
B(
|
|
530
|
+
return (n, s) => e.view === "checkbox" ? (u(), c("div", Dl, [
|
|
531
|
+
B(bt, {
|
|
532
532
|
modelValue: t.value,
|
|
533
533
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => t.value = r),
|
|
534
534
|
label: n.text,
|
|
535
535
|
error: n.error || ""
|
|
536
536
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
537
|
-
n.rules?.includes("required") ? (u(), c("span",
|
|
537
|
+
n.rules?.includes("required") ? (u(), c("span", Fl, "*")) : z("", !0),
|
|
538
538
|
n.i ? (u(), c("button", {
|
|
539
539
|
key: 1,
|
|
540
540
|
class: "cursor-pointer",
|
|
@@ -542,22 +542,22 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
542
542
|
onClick: s[1] || (s[1] = ve(() => {
|
|
543
543
|
}, ["prevent"]))
|
|
544
544
|
}, [
|
|
545
|
-
B(q(
|
|
546
|
-
], 8,
|
|
545
|
+
B(q(Al), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
546
|
+
], 8, Ol)) : z("", !0)
|
|
547
547
|
])) : (u(), c("button", {
|
|
548
548
|
key: 1,
|
|
549
549
|
type: "button",
|
|
550
|
-
class:
|
|
550
|
+
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]]),
|
|
551
551
|
disabled: n.disabled,
|
|
552
552
|
onClick: s[2] || (s[2] = (r) => t.value = !t.value)
|
|
553
553
|
}, [
|
|
554
554
|
l("span", {
|
|
555
555
|
"data-state": "checked",
|
|
556
|
-
class:
|
|
556
|
+
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"]])
|
|
557
557
|
}, null, 2)
|
|
558
|
-
], 10,
|
|
558
|
+
], 10, Ul));
|
|
559
559
|
}
|
|
560
|
-
}),
|
|
560
|
+
}), Tl = ["innerHTML"], nt = /* @__PURE__ */ D({
|
|
561
561
|
__name: "vs-input-static",
|
|
562
562
|
props: {
|
|
563
563
|
text: { default: "" },
|
|
@@ -572,11 +572,11 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
572
572
|
},
|
|
573
573
|
setup(o) {
|
|
574
574
|
return (e, t) => (u(), c("div", {
|
|
575
|
-
class:
|
|
575
|
+
class: V(e.customClass),
|
|
576
576
|
innerHTML: e.html ? e.html : e.text
|
|
577
|
-
}, null, 10,
|
|
577
|
+
}, null, 10, Tl));
|
|
578
578
|
}
|
|
579
|
-
}),
|
|
579
|
+
}), Rl = ["placeholder", "disabled", "name"], Pl = /* @__PURE__ */ D({
|
|
580
580
|
__name: "vs-input-mask",
|
|
581
581
|
props: /* @__PURE__ */ Z({
|
|
582
582
|
name: {},
|
|
@@ -613,7 +613,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
613
613
|
n.value = e.unmask ? r.unmaskedValue : r.value;
|
|
614
614
|
}), r.value = n.value ?? "";
|
|
615
615
|
}
|
|
616
|
-
}),
|
|
616
|
+
}), Bt(() => {
|
|
617
617
|
r?.destroy();
|
|
618
618
|
}), le(() => e.mask, (a) => {
|
|
619
619
|
r && r.updateOptions({
|
|
@@ -633,13 +633,13 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
633
633
|
placeholder: a.placeholder,
|
|
634
634
|
disabled: a.disabled,
|
|
635
635
|
name: a.name,
|
|
636
|
-
class:
|
|
636
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t)]]),
|
|
637
637
|
style: {
|
|
638
638
|
border: "1px solid #CFD9E0"
|
|
639
639
|
}
|
|
640
|
-
}, null, 10,
|
|
640
|
+
}, null, 10, Rl));
|
|
641
641
|
}
|
|
642
|
-
}),
|
|
642
|
+
}), Hl = { class: "relative w-full bg-white rounded-lg" }, Nl = ["placeholder", "disabled"], ql = /* @__PURE__ */ D({
|
|
643
643
|
__name: "vs-input-email",
|
|
644
644
|
props: /* @__PURE__ */ Z({
|
|
645
645
|
style: { default: () => ({}) },
|
|
@@ -656,23 +656,23 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
656
656
|
emits: ["update:modelValue"],
|
|
657
657
|
setup(o) {
|
|
658
658
|
const e = o, { inputClass: t } = he(e.style), n = W(o, "modelValue");
|
|
659
|
-
return (s, r) => (u(), c("div",
|
|
659
|
+
return (s, r) => (u(), c("div", Hl, [
|
|
660
660
|
r[1] || (r[1] = ce('<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)),
|
|
661
661
|
K(l("input", {
|
|
662
662
|
type: "email",
|
|
663
663
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
|
|
664
664
|
placeholder: s.placeholder,
|
|
665
665
|
disabled: s.disabled,
|
|
666
|
-
class:
|
|
666
|
+
class: V(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [q(t), { "!border-red-600": s.error }]]),
|
|
667
667
|
style: {
|
|
668
668
|
border: "1px solid #CFD9E0"
|
|
669
669
|
}
|
|
670
|
-
}, null, 10,
|
|
671
|
-
[
|
|
670
|
+
}, null, 10, Nl), [
|
|
671
|
+
[se, n.value]
|
|
672
672
|
])
|
|
673
673
|
]));
|
|
674
674
|
}
|
|
675
|
-
}),
|
|
675
|
+
}), Gl = ["value", "disabled"], Jl = { class: "text-[13px] text-gray-700" }, Kl = /* @__PURE__ */ D({
|
|
676
676
|
__name: "vs-input-radio-default",
|
|
677
677
|
props: /* @__PURE__ */ Z({
|
|
678
678
|
style: {},
|
|
@@ -692,7 +692,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
692
692
|
setup(o) {
|
|
693
693
|
const e = W(o, "modelValue");
|
|
694
694
|
return (t, n) => (u(), c("label", {
|
|
695
|
-
class:
|
|
695
|
+
class: V(["flex items-center gap-0", [t.customClass]])
|
|
696
696
|
}, [
|
|
697
697
|
K(l("input", {
|
|
698
698
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
|
|
@@ -700,24 +700,24 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
700
700
|
value: t.value,
|
|
701
701
|
disabled: t.disabled,
|
|
702
702
|
class: "hidden"
|
|
703
|
-
}, null, 8,
|
|
704
|
-
[
|
|
703
|
+
}, null, 8, Gl), [
|
|
704
|
+
[mt, e.value]
|
|
705
705
|
]),
|
|
706
706
|
l("span", {
|
|
707
|
-
class:
|
|
707
|
+
class: V(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
708
708
|
`border-${t.style?.primaryColor || "blue"}-500`,
|
|
709
709
|
t.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
710
710
|
]])
|
|
711
711
|
}, [
|
|
712
712
|
e.value == t.value ? (u(), c("span", {
|
|
713
713
|
key: 0,
|
|
714
|
-
class:
|
|
714
|
+
class: V(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
715
715
|
}, null, 2)) : z("", !0)
|
|
716
716
|
], 2),
|
|
717
|
-
l("span",
|
|
717
|
+
l("span", Jl, U(t.text), 1)
|
|
718
718
|
], 2));
|
|
719
719
|
}
|
|
720
|
-
}),
|
|
720
|
+
}), Zl = ["value", "disabled"], Wl = { class: "text-[13px] text-gray-700" }, Ql = /* @__PURE__ */ D({
|
|
721
721
|
__name: "vs-input-radio-buttons",
|
|
722
722
|
props: /* @__PURE__ */ Z({
|
|
723
723
|
style: {},
|
|
@@ -737,7 +737,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
737
737
|
setup(o) {
|
|
738
738
|
const e = W(o, "modelValue");
|
|
739
739
|
return (t, n) => (u(), c("label", {
|
|
740
|
-
class:
|
|
740
|
+
class: V(["flex items-center border rounded-lg px-2 py-1", [
|
|
741
741
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
742
742
|
t.customClass
|
|
743
743
|
]])
|
|
@@ -748,16 +748,16 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
748
748
|
value: t.value,
|
|
749
749
|
disabled: t.disabled,
|
|
750
750
|
class: "hidden"
|
|
751
|
-
}, null, 8,
|
|
752
|
-
[
|
|
751
|
+
}, null, 8, Zl), [
|
|
752
|
+
[mt, e.value]
|
|
753
753
|
]),
|
|
754
|
-
l("span",
|
|
754
|
+
l("span", Wl, U(t.text), 1)
|
|
755
755
|
], 2));
|
|
756
756
|
}
|
|
757
|
-
}),
|
|
758
|
-
"vs-input-radio-default":
|
|
759
|
-
"vs-input-radio-buttons":
|
|
760
|
-
}, rt = /* @__PURE__ */
|
|
757
|
+
}), Xl = {
|
|
758
|
+
"vs-input-radio-default": Kl,
|
|
759
|
+
"vs-input-radio-buttons": Ql
|
|
760
|
+
}, rt = /* @__PURE__ */ D({
|
|
761
761
|
__name: "vs-input-radio",
|
|
762
762
|
props: /* @__PURE__ */ Z({
|
|
763
763
|
options: {},
|
|
@@ -776,11 +776,11 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
776
776
|
}),
|
|
777
777
|
emits: ["update:modelValue"],
|
|
778
778
|
setup(o) {
|
|
779
|
-
const e = o, t = W(o, "modelValue"), n = F(() =>
|
|
779
|
+
const e = o, t = W(o, "modelValue"), n = F(() => Xl[`vs-input-radio-${e.view}`]);
|
|
780
780
|
return (s, r) => (u(), c("div", {
|
|
781
|
-
class:
|
|
781
|
+
class: V([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
782
782
|
}, [
|
|
783
|
-
(u(!0), c(Y, null, oe(s.options, (a) => (u(),
|
|
783
|
+
(u(!0), c(Y, null, oe(s.options, (a) => (u(), ie(Be(n.value), Ee({
|
|
784
784
|
key: a?.id,
|
|
785
785
|
text: a.text,
|
|
786
786
|
value: a.id.toString(),
|
|
@@ -790,7 +790,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
790
790
|
}, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
791
791
|
], 2));
|
|
792
792
|
}
|
|
793
|
-
}),
|
|
793
|
+
}), Yl = /* @__PURE__ */ D({
|
|
794
794
|
__name: "vs-input-checkbox",
|
|
795
795
|
props: {
|
|
796
796
|
options: { default: () => [] },
|
|
@@ -809,7 +809,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
809
809
|
},
|
|
810
810
|
emits: ["update:modelValue"],
|
|
811
811
|
setup(o, { emit: e }) {
|
|
812
|
-
const t = o, n = e, s = x([]), r =
|
|
812
|
+
const t = o, n = e, s = x([]), r = jt({}), a = (p) => p?.value || p?.id || p?.text || p, i = (p) => p.text || String(p), d = (p) => `lg:col-span-${p || 12}`, v = async () => {
|
|
813
813
|
try {
|
|
814
814
|
const p = await fetch(`/api/suggest/${t.data}`).then((w) => w.json());
|
|
815
815
|
s.value = p?.data || p;
|
|
@@ -874,13 +874,13 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
876
|
}), (p, w) => (u(), c("div", {
|
|
877
|
-
class:
|
|
877
|
+
class: V(["p-0 w-full gap-[6px]", [p.position === "vertical" ? "flex-col" : "", p.colSpan ? "grid" : "flex justify-start"]])
|
|
878
878
|
}, [
|
|
879
|
-
(u(!0), c(Y, null, oe(s.value, (b) => (u(),
|
|
879
|
+
(u(!0), c(Y, null, oe(s.value, (b) => (u(), ie(bt, {
|
|
880
880
|
modelValue: r[a(b)],
|
|
881
881
|
"onUpdate:modelValue": ($) => r[a(b)] = $,
|
|
882
882
|
value: a(b),
|
|
883
|
-
class:
|
|
883
|
+
class: V(d(p.colSpan)),
|
|
884
884
|
disabled: b.disabled,
|
|
885
885
|
label: i(b),
|
|
886
886
|
key: a(b),
|
|
@@ -891,7 +891,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
891
891
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
892
892
|
], 2));
|
|
893
893
|
}
|
|
894
|
-
}),
|
|
894
|
+
}), eo = /* @__PURE__ */ N(Yl, [["__scopeId", "data-v-91f3584a"]]), to = ["type", "placeholder", "disabled"], lo = /* @__PURE__ */ D({
|
|
895
895
|
__name: "vs-input-date1",
|
|
896
896
|
props: {
|
|
897
897
|
style: { default: () => ({}) },
|
|
@@ -919,15 +919,15 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
919
919
|
placeholder: d.placeholder,
|
|
920
920
|
disabled: d.disabled,
|
|
921
921
|
ref: "date",
|
|
922
|
-
class:
|
|
922
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [d.modelValue ? "" : "text-opacity-50", q(s)].join(" ")]),
|
|
923
923
|
style: {
|
|
924
924
|
border: "1px solid #CFD9E0"
|
|
925
925
|
}
|
|
926
|
-
}, null, 10,
|
|
927
|
-
[
|
|
926
|
+
}, null, 10, to)), [
|
|
927
|
+
[It, a.value]
|
|
928
928
|
]);
|
|
929
929
|
}
|
|
930
|
-
}),
|
|
930
|
+
}), oo = async (o, e, t, n) => {
|
|
931
931
|
try {
|
|
932
932
|
const s = new FormData();
|
|
933
933
|
return s.append("unique", "true"), s.append("file", o), (await fetch(
|
|
@@ -945,7 +945,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
945
945
|
position: "right-bottom"
|
|
946
946
|
}), console.error("Сталась помилка завантаження файлу", s), null;
|
|
947
947
|
}
|
|
948
|
-
},
|
|
948
|
+
}, ao = async (o) => {
|
|
949
949
|
try {
|
|
950
950
|
return await fetch(`file/delete${o}`), !0;
|
|
951
951
|
} catch (e) {
|
|
@@ -958,7 +958,7 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
958
958
|
} catch (e) {
|
|
959
959
|
console.error(e.message);
|
|
960
960
|
}
|
|
961
|
-
},
|
|
961
|
+
}, so = {}, no = {
|
|
962
962
|
xmlns: "http://www.w3.org/2000/svg",
|
|
963
963
|
width: "24",
|
|
964
964
|
height: "24",
|
|
@@ -969,13 +969,13 @@ const El = /* @__PURE__ */ N(jl, [["render", zl]]), Al = {
|
|
|
969
969
|
"stroke-linecap": "round",
|
|
970
970
|
"stroke-linejoin": "round"
|
|
971
971
|
};
|
|
972
|
-
function
|
|
973
|
-
return u(), c("svg",
|
|
972
|
+
function ro(o, e) {
|
|
973
|
+
return u(), c("svg", no, e[0] || (e[0] = [
|
|
974
974
|
l("path", { d: "M5 12h14" }, null, -1),
|
|
975
975
|
l("path", { d: "M12 5v14" }, null, -1)
|
|
976
976
|
]));
|
|
977
977
|
}
|
|
978
|
-
const Ae = /* @__PURE__ */ N(
|
|
978
|
+
const Ae = /* @__PURE__ */ N(so, [["render", ro]]), io = {}, uo = {
|
|
979
979
|
xmlns: "http://www.w3.org/2000/svg",
|
|
980
980
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
981
981
|
width: "44",
|
|
@@ -987,12 +987,12 @@ const Ae = /* @__PURE__ */ N(ao, [["render", no]]), ro = {}, io = {
|
|
|
987
987
|
"stroke-linecap": "round",
|
|
988
988
|
"stroke-linejoin": "round"
|
|
989
989
|
};
|
|
990
|
-
function
|
|
991
|
-
return u(), c("svg",
|
|
990
|
+
function co(o, e, t, n, s, r) {
|
|
991
|
+
return u(), c("svg", uo, e[0] || (e[0] = [
|
|
992
992
|
ce('<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)
|
|
993
993
|
]));
|
|
994
994
|
}
|
|
995
|
-
const
|
|
995
|
+
const po = /* @__PURE__ */ N(io, [["render", co]]), fo = {}, vo = {
|
|
996
996
|
xmlns: "http://www.w3.org/2000/svg",
|
|
997
997
|
class: "icon icon-tabler icon-tabler-table",
|
|
998
998
|
width: "44",
|
|
@@ -1004,8 +1004,8 @@ const co = /* @__PURE__ */ N(ro, [["render", uo]]), po = {}, fo = {
|
|
|
1004
1004
|
"stroke-linecap": "round",
|
|
1005
1005
|
"stroke-linejoin": "round"
|
|
1006
1006
|
};
|
|
1007
|
-
function
|
|
1008
|
-
return u(), c("svg",
|
|
1007
|
+
function mo(o, e, t, n, s, r) {
|
|
1008
|
+
return u(), c("svg", vo, e[0] || (e[0] = [
|
|
1009
1009
|
l("path", {
|
|
1010
1010
|
stroke: "none",
|
|
1011
1011
|
d: "M0 0h24v24H0z",
|
|
@@ -1032,7 +1032,7 @@ function vo(o, e, t, n, s, r) {
|
|
|
1032
1032
|
}, null, -1)
|
|
1033
1033
|
]));
|
|
1034
1034
|
}
|
|
1035
|
-
const
|
|
1035
|
+
const ho = /* @__PURE__ */ N(fo, [["render", mo]]), go = {}, bo = {
|
|
1036
1036
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1037
1037
|
width: "24",
|
|
1038
1038
|
height: "24",
|
|
@@ -1044,12 +1044,12 @@ const mo = /* @__PURE__ */ N(po, [["render", vo]]), ho = {}, go = {
|
|
|
1044
1044
|
"stroke-linejoin": "round",
|
|
1045
1045
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
1046
1046
|
};
|
|
1047
|
-
function
|
|
1048
|
-
return u(), c("svg",
|
|
1047
|
+
function yo(o, e, t, n, s, r) {
|
|
1048
|
+
return u(), c("svg", bo, e[0] || (e[0] = [
|
|
1049
1049
|
ce('<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)
|
|
1050
1050
|
]));
|
|
1051
1051
|
}
|
|
1052
|
-
const
|
|
1052
|
+
const xo = /* @__PURE__ */ N(go, [["render", yo]]), wo = {}, ko = {
|
|
1053
1053
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1054
1054
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
1055
1055
|
width: "44",
|
|
@@ -1061,12 +1061,12 @@ const yo = /* @__PURE__ */ N(ho, [["render", bo]]), xo = {}, wo = {
|
|
|
1061
1061
|
"stroke-linecap": "round",
|
|
1062
1062
|
"stroke-linejoin": "round"
|
|
1063
1063
|
};
|
|
1064
|
-
function
|
|
1065
|
-
return u(), c("svg",
|
|
1064
|
+
function _o(o, e, t, n, s, r) {
|
|
1065
|
+
return u(), c("svg", ko, e[0] || (e[0] = [
|
|
1066
1066
|
ce('<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)
|
|
1067
1067
|
]));
|
|
1068
1068
|
}
|
|
1069
|
-
const
|
|
1069
|
+
const $o = /* @__PURE__ */ N(wo, [["render", _o]]), Vo = {}, Co = {
|
|
1070
1070
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1071
1071
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
1072
1072
|
width: "44",
|
|
@@ -1078,25 +1078,25 @@ const _o = /* @__PURE__ */ N(xo, [["render", ko]]), $o = {}, Vo = {
|
|
|
1078
1078
|
"stroke-linecap": "round",
|
|
1079
1079
|
"stroke-linejoin": "round"
|
|
1080
1080
|
};
|
|
1081
|
-
function
|
|
1082
|
-
return u(), c("svg",
|
|
1081
|
+
function Mo(o, e, t, n, s, r) {
|
|
1082
|
+
return u(), c("svg", Co, e[0] || (e[0] = [
|
|
1083
1083
|
ce('<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)
|
|
1084
1084
|
]));
|
|
1085
1085
|
}
|
|
1086
|
-
const
|
|
1086
|
+
const Lo = /* @__PURE__ */ N(Vo, [["render", Mo]]), So = (o) => {
|
|
1087
1087
|
if (!o) return "";
|
|
1088
1088
|
const e = o?.split(".");
|
|
1089
1089
|
return e[e.length - 1];
|
|
1090
|
-
},
|
|
1091
|
-
const e =
|
|
1090
|
+
}, Bo = (o) => {
|
|
1091
|
+
const e = So(o), t = {
|
|
1092
1092
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
1093
1093
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
1094
1094
|
archivesFormat: ["zip", "rar"],
|
|
1095
1095
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
1096
1096
|
documentsFormat: ["pdf"]
|
|
1097
1097
|
};
|
|
1098
|
-
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ?
|
|
1099
|
-
},
|
|
1098
|
+
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? ho : t.textsFormat.includes(e) ? Lo : t.documentsFormat.includes(e) ? po : t.archivesFormat.includes(e) ? $o : xo;
|
|
1099
|
+
}, jo = {}, Io = {
|
|
1100
1100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1101
1101
|
width: "24",
|
|
1102
1102
|
height: "24",
|
|
@@ -1108,12 +1108,12 @@ const Mo = /* @__PURE__ */ N($o, [["render", Co]]), Lo = (o) => {
|
|
|
1108
1108
|
"stroke-linejoin": "round",
|
|
1109
1109
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
1110
1110
|
};
|
|
1111
|
-
function
|
|
1112
|
-
return u(), c("svg",
|
|
1111
|
+
function zo(o, e) {
|
|
1112
|
+
return u(), c("svg", Io, e[0] || (e[0] = [
|
|
1113
1113
|
ce('<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)
|
|
1114
1114
|
]));
|
|
1115
1115
|
}
|
|
1116
|
-
const He = /* @__PURE__ */ N(
|
|
1116
|
+
const He = /* @__PURE__ */ N(jo, [["render", zo]]), Eo = {}, Ao = {
|
|
1117
1117
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1118
1118
|
width: "24",
|
|
1119
1119
|
height: "24",
|
|
@@ -1125,8 +1125,8 @@ const He = /* @__PURE__ */ N(Bo, [["render", Io]]), zo = {}, Eo = {
|
|
|
1125
1125
|
"stroke-linejoin": "round",
|
|
1126
1126
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1127
1127
|
};
|
|
1128
|
-
function
|
|
1129
|
-
return u(), c("svg",
|
|
1128
|
+
function Do(o, e) {
|
|
1129
|
+
return u(), c("svg", Ao, e[0] || (e[0] = [
|
|
1130
1130
|
l("path", {
|
|
1131
1131
|
stroke: "none",
|
|
1132
1132
|
d: "M0 0h24v24H0z",
|
|
@@ -1137,7 +1137,7 @@ function Ao(o, e) {
|
|
|
1137
1137
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1138
1138
|
]));
|
|
1139
1139
|
}
|
|
1140
|
-
const
|
|
1140
|
+
const xt = /* @__PURE__ */ N(Eo, [["render", Do]]), Fo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Oo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Uo = /* @__PURE__ */ D({
|
|
1141
1141
|
__name: "vs-input-file-list-item",
|
|
1142
1142
|
props: /* @__PURE__ */ Z({
|
|
1143
1143
|
format: {},
|
|
@@ -1158,18 +1158,18 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1158
1158
|
emits: ["update:value", "update:item"],
|
|
1159
1159
|
setup(o) {
|
|
1160
1160
|
const e = W(o, "value"), t = W(o, "item"), n = o;
|
|
1161
|
-
return (s, r) => (u(), c("div",
|
|
1162
|
-
(u(),
|
|
1161
|
+
return (s, r) => (u(), c("div", Fo, [
|
|
1162
|
+
(u(), ie(Be(q(Bo)(t.value)), {
|
|
1163
1163
|
src: t.value,
|
|
1164
1164
|
alt: "file",
|
|
1165
1165
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1166
1166
|
onClick: r[0] || (r[0] = (a) => q(it)(t.value))
|
|
1167
1167
|
}, null, 8, ["src"])),
|
|
1168
|
-
l("div",
|
|
1168
|
+
l("div", Oo, [
|
|
1169
1169
|
l("button", {
|
|
1170
1170
|
type: "button",
|
|
1171
1171
|
onClick: r[1] || (r[1] = (a) => {
|
|
1172
|
-
q(
|
|
1172
|
+
q(ao)(t.value), e.value = n.multiple ? e.value?.filter((i) => i !== t.value) : "";
|
|
1173
1173
|
}),
|
|
1174
1174
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1175
1175
|
}, [
|
|
@@ -1180,15 +1180,15 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1180
1180
|
onClick: r[2] || (r[2] = (a) => q(it)(t.value)),
|
|
1181
1181
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1182
1182
|
}, [
|
|
1183
|
-
B(
|
|
1183
|
+
B(xt, { class: "w-4 h-4" })
|
|
1184
1184
|
])
|
|
1185
1185
|
])
|
|
1186
1186
|
]));
|
|
1187
1187
|
}
|
|
1188
|
-
}), ut = /* @__PURE__ */ N(
|
|
1188
|
+
}), ut = /* @__PURE__ */ N(Uo, [["__scopeId", "data-v-0ca886b3"]]), To = { class: "flex items-center gap-x-2" }, Ro = {
|
|
1189
1189
|
key: 1,
|
|
1190
1190
|
class: "flex items-center flex-wrap gap-2"
|
|
1191
|
-
},
|
|
1191
|
+
}, Po = /* @__PURE__ */ D({
|
|
1192
1192
|
__name: "vs-input-file",
|
|
1193
1193
|
props: /* @__PURE__ */ Z({
|
|
1194
1194
|
format: {},
|
|
@@ -1214,10 +1214,10 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1214
1214
|
}
|
|
1215
1215
|
const i = a.target.files?.[0];
|
|
1216
1216
|
if (!i) return;
|
|
1217
|
-
const d = await
|
|
1217
|
+
const d = await oo(i, "1", "form", "table");
|
|
1218
1218
|
t.value = e.multiple ? [...t.value || [], d?.file_path] : d?.file_path;
|
|
1219
1219
|
};
|
|
1220
|
-
return (a, i) => (u(), c("div",
|
|
1220
|
+
return (a, i) => (u(), c("div", To, [
|
|
1221
1221
|
l("input", {
|
|
1222
1222
|
class: "hidden",
|
|
1223
1223
|
ref_key: "fileInput",
|
|
@@ -1225,14 +1225,14 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1225
1225
|
type: "file",
|
|
1226
1226
|
onChange: r
|
|
1227
1227
|
}, null, 544),
|
|
1228
|
-
!a.multiple && t.value ? (u(),
|
|
1228
|
+
!a.multiple && t.value ? (u(), ie(ut, {
|
|
1229
1229
|
key: 0,
|
|
1230
1230
|
item: t.value,
|
|
1231
1231
|
"onUpdate:item": i[0] || (i[0] = (d) => t.value = d),
|
|
1232
1232
|
value: t.value,
|
|
1233
1233
|
"onUpdate:value": i[1] || (i[1] = (d) => t.value = d)
|
|
1234
|
-
}, null, 8, ["item", "value"])) : a.multiple ? (u(), c("div",
|
|
1235
|
-
(u(!0), c(Y, null, oe(t.value, (d, v) => (u(),
|
|
1234
|
+
}, null, 8, ["item", "value"])) : a.multiple ? (u(), c("div", Ro, [
|
|
1235
|
+
(u(!0), c(Y, null, oe(t.value, (d, v) => (u(), ie(ut, {
|
|
1236
1236
|
multiple: a.multiple,
|
|
1237
1237
|
key: v,
|
|
1238
1238
|
value: t.value,
|
|
@@ -1241,7 +1241,7 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1241
1241
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1242
1242
|
l("div", {
|
|
1243
1243
|
onClick: i[3] || (i[3] = (d) => !a.disabled && n.value?.click()),
|
|
1244
|
-
class:
|
|
1244
|
+
class: V([
|
|
1245
1245
|
"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",
|
|
1246
1246
|
a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1247
1247
|
])
|
|
@@ -1252,13 +1252,13 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1252
1252
|
a.multiple ? z("", !0) : (u(), c("div", {
|
|
1253
1253
|
key: 2,
|
|
1254
1254
|
onClick: i[4] || (i[4] = (d) => n.value?.click()),
|
|
1255
|
-
class:
|
|
1255
|
+
class: V([a.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"])
|
|
1256
1256
|
}, [
|
|
1257
1257
|
B(Ae, { class: "w-6 h-6" })
|
|
1258
1258
|
], 2))
|
|
1259
1259
|
]));
|
|
1260
1260
|
}
|
|
1261
|
-
}),
|
|
1261
|
+
}), Ho = { class: "max-w-[55vw]" }, No = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, qo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Go = { class: "px-[5px]" }, Jo = { class: "" }, Oe = /* @__PURE__ */ D({
|
|
1262
1262
|
__name: "vs-widget-file-info",
|
|
1263
1263
|
props: {
|
|
1264
1264
|
item: { default: null }
|
|
@@ -1283,33 +1283,33 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1283
1283
|
}
|
|
1284
1284
|
return (s, r) => (u(), c(Y, null, [
|
|
1285
1285
|
r[1] || (r[1] = ce('<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)),
|
|
1286
|
-
l("div",
|
|
1287
|
-
l("p",
|
|
1288
|
-
l("p",
|
|
1286
|
+
l("div", Ho, [
|
|
1287
|
+
l("p", No, U(s.item?.uploaded_name), 1),
|
|
1288
|
+
l("p", qo, [
|
|
1289
1289
|
l("span", null, U(s.item?.username), 1),
|
|
1290
|
-
K(l("span",
|
|
1290
|
+
K(l("span", Go, "|", 512), [
|
|
1291
1291
|
[Je, s.item?.username]
|
|
1292
1292
|
]),
|
|
1293
1293
|
l("span", null, U(t.value), 1),
|
|
1294
1294
|
r[0] || (r[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1295
|
-
l("span",
|
|
1295
|
+
l("span", Jo, U(n(s.item?.size)), 1)
|
|
1296
1296
|
])
|
|
1297
1297
|
])
|
|
1298
1298
|
], 64));
|
|
1299
1299
|
}
|
|
1300
|
-
}),
|
|
1300
|
+
}), Ko = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, Zo = {
|
|
1301
1301
|
key: 0,
|
|
1302
1302
|
class: "flex w-full gap-x-3 items-center"
|
|
1303
|
-
},
|
|
1303
|
+
}, Wo = {
|
|
1304
1304
|
key: 1,
|
|
1305
1305
|
class: "flex gap-x-3 w-full items-center"
|
|
1306
|
-
},
|
|
1306
|
+
}, Qo = {
|
|
1307
1307
|
key: 2,
|
|
1308
1308
|
class: "flex gap-x-3 w-full items-center"
|
|
1309
|
-
},
|
|
1309
|
+
}, Xo = ["href"], Yo = {
|
|
1310
1310
|
key: 3,
|
|
1311
1311
|
class: "flex gap-x-3 w-full items-center"
|
|
1312
|
-
},
|
|
1312
|
+
}, ea = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, ta = { 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" }, la = { class: "inline-block" }, oa = { class: "inline-block" }, aa = /* @__PURE__ */ D({
|
|
1313
1313
|
__name: "vs-widget-file-item",
|
|
1314
1314
|
props: {
|
|
1315
1315
|
item: { default: null },
|
|
@@ -1351,42 +1351,42 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1351
1351
|
function v(p) {
|
|
1352
1352
|
(t.item.ext === "jpg" || t.item.ext === "png") && n("openLightbox", { item: t.item, index: p });
|
|
1353
1353
|
}
|
|
1354
|
-
return (p, w) => (u(), c("div",
|
|
1355
|
-
p.item.ext === "jpg" || p.item.ext === "png" ? (u(), c("div",
|
|
1354
|
+
return (p, w) => (u(), c("div", Ko, [
|
|
1355
|
+
p.item.ext === "jpg" || p.item.ext === "png" ? (u(), c("div", Zo, [
|
|
1356
1356
|
l("div", {
|
|
1357
1357
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1358
1358
|
onClick: w[0] || (w[0] = (b) => v(p.index))
|
|
1359
1359
|
}, [
|
|
1360
1360
|
B(Oe, { item: p.item }, null, 8, ["item"])
|
|
1361
1361
|
])
|
|
1362
|
-
])) : s(p.item) ? (u(), c("div",
|
|
1362
|
+
])) : s(p.item) ? (u(), c("div", Wo, [
|
|
1363
1363
|
B(Oe, { item: p.item }, null, 8, ["item"])
|
|
1364
|
-
])) : r(p.item) ? (u(), c("div",
|
|
1364
|
+
])) : r(p.item) ? (u(), c("div", Qo, [
|
|
1365
1365
|
l("a", {
|
|
1366
1366
|
href: `/api/file-preview?id=${p.item.file_id}`,
|
|
1367
1367
|
target: "_blank",
|
|
1368
1368
|
class: "flex gap-x-3 w-full items-center"
|
|
1369
1369
|
}, [
|
|
1370
1370
|
B(Oe, { item: p.item }, null, 8, ["item"])
|
|
1371
|
-
], 8,
|
|
1372
|
-
])) : (u(), c("div",
|
|
1371
|
+
], 8, Xo)
|
|
1372
|
+
])) : (u(), c("div", Yo, [
|
|
1373
1373
|
B(Oe, { item: p.item }, null, 8, ["item"])
|
|
1374
1374
|
])),
|
|
1375
|
-
l("div",
|
|
1376
|
-
l("div",
|
|
1377
|
-
l("div",
|
|
1375
|
+
l("div", ea, [
|
|
1376
|
+
l("div", ta, [
|
|
1377
|
+
l("div", la, [
|
|
1378
1378
|
l("button", {
|
|
1379
1379
|
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",
|
|
1380
1380
|
onClick: w[1] || (w[1] = (b) => a(p.item))
|
|
1381
1381
|
}, [
|
|
1382
|
-
B(
|
|
1382
|
+
B(xt, {
|
|
1383
1383
|
height: "14",
|
|
1384
1384
|
width: "14"
|
|
1385
1385
|
})
|
|
1386
1386
|
])
|
|
1387
1387
|
]),
|
|
1388
1388
|
w[3] || (w[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
|
|
1389
|
-
l("div",
|
|
1389
|
+
l("div", oa, [
|
|
1390
1390
|
l("button", {
|
|
1391
1391
|
type: "button",
|
|
1392
1392
|
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",
|
|
@@ -1402,7 +1402,7 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1402
1402
|
])
|
|
1403
1403
|
]));
|
|
1404
1404
|
}
|
|
1405
|
-
}),
|
|
1405
|
+
}), sa = {}, na = {
|
|
1406
1406
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1407
1407
|
width: "24",
|
|
1408
1408
|
height: "24",
|
|
@@ -1414,8 +1414,8 @@ const yt = /* @__PURE__ */ N(zo, [["render", Ao]]), Do = { class: "h-[120px] w-[
|
|
|
1414
1414
|
"stroke-linejoin": "round",
|
|
1415
1415
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1416
1416
|
};
|
|
1417
|
-
function
|
|
1418
|
-
return u(), c("svg",
|
|
1417
|
+
function ra(o, e) {
|
|
1418
|
+
return u(), c("svg", na, e[0] || (e[0] = [
|
|
1419
1419
|
l("path", {
|
|
1420
1420
|
stroke: "none",
|
|
1421
1421
|
d: "M0 0h24v24H0z",
|
|
@@ -1426,13 +1426,13 @@ function na(o, e) {
|
|
|
1426
1426
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1427
1427
|
]));
|
|
1428
1428
|
}
|
|
1429
|
-
const
|
|
1429
|
+
const ia = /* @__PURE__ */ N(sa, [["render", ra]]), ua = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, da = { class: "flex w-full mb-[12px] items-center gap-x-2" }, ca = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, pa = { class1: "ml-auto" }, fa = { 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" }, va = {
|
|
1430
1430
|
key: 0,
|
|
1431
1431
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1432
|
-
},
|
|
1432
|
+
}, ma = { class: "relative" }, ha = {
|
|
1433
1433
|
key: 1,
|
|
1434
1434
|
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"
|
|
1435
|
-
},
|
|
1435
|
+
}, ga = { key: 0 }, ba = /* @__PURE__ */ D({
|
|
1436
1436
|
__name: "vs-input-file-list",
|
|
1437
1437
|
props: {
|
|
1438
1438
|
id: { default: "" },
|
|
@@ -1447,7 +1447,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1447
1447
|
},
|
|
1448
1448
|
emits: ["update"],
|
|
1449
1449
|
setup(o, { emit: e }) {
|
|
1450
|
-
const t = o, n = Me("form"), s = F(() => n.value.formId), r = x(!1), a = x(0), i = e, d = x(!1), v = x({}), p = x([]), w = x(""), b = F(() => Array.isArray(p.value) ? p.value.filter((m) => m.ext === "jpg" || m.ext === "png").map((m) => m?.file_path) : []), $ = F(() => w.value === "" ? p.value : p.value.filter((m) => m?.uploaded_name?.includes(w.value))),
|
|
1450
|
+
const t = o, n = Me("form"), s = F(() => n.value.formId), r = x(!1), a = x(0), i = e, d = x(!1), v = x({}), p = x([]), w = x(""), b = F(() => Array.isArray(p.value) ? p.value.filter((m) => m.ext === "jpg" || m.ext === "png").map((m) => m?.file_path) : []), $ = F(() => w.value === "" ? p.value : p.value.filter((m) => m?.uploaded_name?.includes(w.value))), j = (m) => {
|
|
1451
1451
|
const f = b.value.findIndex((Q) => Q === m.item.file_path);
|
|
1452
1452
|
f !== -1 && (r.value = !0, a.value = f);
|
|
1453
1453
|
}, R = async () => {
|
|
@@ -1457,7 +1457,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1457
1457
|
} catch (m) {
|
|
1458
1458
|
console.error(m);
|
|
1459
1459
|
}
|
|
1460
|
-
},
|
|
1460
|
+
}, C = async (m) => {
|
|
1461
1461
|
await Promise.all(
|
|
1462
1462
|
Array.from(m.target.files).map(async (f) => {
|
|
1463
1463
|
const Q = new FormData();
|
|
@@ -1470,15 +1470,15 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1470
1470
|
}
|
|
1471
1471
|
})
|
|
1472
1472
|
), await R();
|
|
1473
|
-
},
|
|
1473
|
+
}, E = (m) => {
|
|
1474
1474
|
const f = { ...m };
|
|
1475
1475
|
return m.cancel || (f.cancel = () => {
|
|
1476
1476
|
d.value = !1;
|
|
1477
1477
|
}), m.updateListOnConfirm && (f.confirm = async () => {
|
|
1478
1478
|
await m.confirm(), d.value = !1, R();
|
|
1479
1479
|
}), f;
|
|
1480
|
-
},
|
|
1481
|
-
v.value =
|
|
1480
|
+
}, M = (m) => {
|
|
1481
|
+
v.value = E(m), d.value = !0;
|
|
1482
1482
|
};
|
|
1483
1483
|
return le(s, (m) => {
|
|
1484
1484
|
m && R();
|
|
@@ -1486,18 +1486,18 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1486
1486
|
s.value && R();
|
|
1487
1487
|
}), (m, f) => {
|
|
1488
1488
|
const Q = at("Lightbox"), T = at("MessageBox");
|
|
1489
|
-
return u(), c("div",
|
|
1490
|
-
l("div",
|
|
1491
|
-
l("h2",
|
|
1492
|
-
l("div",
|
|
1489
|
+
return u(), c("div", ua, [
|
|
1490
|
+
l("div", da, [
|
|
1491
|
+
l("h2", ca, " Файлів: " + U(p.value?.length), 1),
|
|
1492
|
+
l("div", pa, [
|
|
1493
1493
|
l("label", null, [
|
|
1494
1494
|
l("input", {
|
|
1495
1495
|
type: "file",
|
|
1496
1496
|
class: "hidden",
|
|
1497
|
-
onChange: f[0] || (f[0] = (O) =>
|
|
1497
|
+
onChange: f[0] || (f[0] = (O) => C(O))
|
|
1498
1498
|
}, null, 32),
|
|
1499
|
-
l("div",
|
|
1500
|
-
B(
|
|
1499
|
+
l("div", fa, [
|
|
1500
|
+
B(ia, {
|
|
1501
1501
|
height: "16",
|
|
1502
1502
|
width: "16"
|
|
1503
1503
|
})
|
|
@@ -1505,9 +1505,9 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1505
1505
|
])
|
|
1506
1506
|
])
|
|
1507
1507
|
]),
|
|
1508
|
-
p.value?.length > 4 ? (u(), c("div",
|
|
1508
|
+
p.value?.length > 4 ? (u(), c("div", va, [
|
|
1509
1509
|
l("div", null, [
|
|
1510
|
-
l("div",
|
|
1510
|
+
l("div", ma, [
|
|
1511
1511
|
f[8] || (f[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
|
|
1512
1512
|
l("svg", {
|
|
1513
1513
|
class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
|
|
@@ -1536,7 +1536,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1536
1536
|
placeholder: "Введіть назву файлу"
|
|
1537
1537
|
}, null, 512), [
|
|
1538
1538
|
[
|
|
1539
|
-
|
|
1539
|
+
se,
|
|
1540
1540
|
w.value,
|
|
1541
1541
|
void 0,
|
|
1542
1542
|
{ trim: !0 }
|
|
@@ -1545,17 +1545,17 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1545
1545
|
])
|
|
1546
1546
|
])
|
|
1547
1547
|
])) : z("", !0),
|
|
1548
|
-
p.value?.length ? (u(), c("div",
|
|
1549
|
-
(u(!0), c(Y, null, oe($.value, (O, ue) => (u(),
|
|
1548
|
+
p.value?.length ? (u(), c("div", ha, [
|
|
1549
|
+
(u(!0), c(Y, null, oe($.value, (O, ue) => (u(), ie(aa, {
|
|
1550
1550
|
key: ue,
|
|
1551
1551
|
prefix: m.prefix,
|
|
1552
1552
|
item: O,
|
|
1553
1553
|
index: ue,
|
|
1554
1554
|
onUpdate: f[2] || (f[2] = (ee) => m.$emit("update", "file-list")),
|
|
1555
|
-
onOpenModal: f[3] || (f[3] = (ee) =>
|
|
1556
|
-
onOpenLightbox: f[4] || (f[4] = (ee) =>
|
|
1555
|
+
onOpenModal: f[3] || (f[3] = (ee) => M(ee)),
|
|
1556
|
+
onOpenLightbox: f[4] || (f[4] = (ee) => j(ee))
|
|
1557
1557
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1558
|
-
$.value.length ? z("", !0) : (u(), c("div",
|
|
1558
|
+
$.value.length ? z("", !0) : (u(), c("div", ga, f[9] || (f[9] = [
|
|
1559
1559
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1560
1560
|
])))
|
|
1561
1561
|
])) : z("", !0),
|
|
@@ -1574,7 +1574,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1574
1574
|
]);
|
|
1575
1575
|
};
|
|
1576
1576
|
}
|
|
1577
|
-
}),
|
|
1577
|
+
}), ya = { class: "flex items-center justify-between" }, xa = { class: "text-[16px] text-gray-900 font-medium" }, wa = { class: "grid gap-3" }, ka = /* @__PURE__ */ D({
|
|
1578
1578
|
__name: "vs-container-switcher",
|
|
1579
1579
|
props: {
|
|
1580
1580
|
title: {
|
|
@@ -1598,17 +1598,17 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1598
1598
|
t.value = n;
|
|
1599
1599
|
}
|
|
1600
1600
|
), (n, s) => (u(), c("div", null, [
|
|
1601
|
-
l("div",
|
|
1602
|
-
l("p",
|
|
1603
|
-
B(
|
|
1601
|
+
l("div", ya, [
|
|
1602
|
+
l("p", xa, U(o.title), 1),
|
|
1603
|
+
B(yt, {
|
|
1604
1604
|
modelValue: t.value,
|
|
1605
1605
|
"onUpdate:modelValue": s[0] || (s[0] = (r) => t.value = r),
|
|
1606
1606
|
style: xe(o.style)
|
|
1607
1607
|
}, null, 8, ["modelValue", "style"])
|
|
1608
1608
|
]),
|
|
1609
|
-
B(
|
|
1609
|
+
B(ht, { name: "slide-fade" }, {
|
|
1610
1610
|
default: Le(() => [
|
|
1611
|
-
K(l("div",
|
|
1611
|
+
K(l("div", wa, [
|
|
1612
1612
|
_e(n.$slots, "default", {}, void 0, !0)
|
|
1613
1613
|
], 512), [
|
|
1614
1614
|
[Je, t.value]
|
|
@@ -1618,7 +1618,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1618
1618
|
})
|
|
1619
1619
|
]));
|
|
1620
1620
|
}
|
|
1621
|
-
}),
|
|
1621
|
+
}), _a = /* @__PURE__ */ N(ka, [["__scopeId", "data-v-90320b87"]]), $a = { class: "text-[16px] text-gray-900 font-medium" }, Va = { class: "grid gap-3" }, Ca = /* @__PURE__ */ D({
|
|
1622
1622
|
__name: "vs-container-accordion",
|
|
1623
1623
|
props: {
|
|
1624
1624
|
title: {
|
|
@@ -1647,14 +1647,14 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1647
1647
|
onClick: s[0] || (s[0] = (r) => t.value = !t.value),
|
|
1648
1648
|
class: "flex items-center gap-2"
|
|
1649
1649
|
}, [
|
|
1650
|
-
B(q(
|
|
1651
|
-
class:
|
|
1650
|
+
B(q(Ml), {
|
|
1651
|
+
class: V(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1652
1652
|
}, null, 8, ["class"]),
|
|
1653
|
-
l("span",
|
|
1653
|
+
l("span", $a, U(o.title), 1)
|
|
1654
1654
|
]),
|
|
1655
|
-
B(
|
|
1655
|
+
B(ht, { name: "slide-fade" }, {
|
|
1656
1656
|
default: Le(() => [
|
|
1657
|
-
K(l("div",
|
|
1657
|
+
K(l("div", Va, [
|
|
1658
1658
|
_e(n.$slots, "default", {}, void 0, !0)
|
|
1659
1659
|
], 512), [
|
|
1660
1660
|
[Je, t.value]
|
|
@@ -1664,7 +1664,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1664
1664
|
})
|
|
1665
1665
|
]));
|
|
1666
1666
|
}
|
|
1667
|
-
}),
|
|
1667
|
+
}), Ma = /* @__PURE__ */ N(Ca, [["__scopeId", "data-v-590eff11"]]), La = { class: "flex items-center justify-between" }, Sa = /* @__PURE__ */ D({
|
|
1668
1668
|
__name: "vs-container-default",
|
|
1669
1669
|
props: {
|
|
1670
1670
|
title: {
|
|
@@ -1678,16 +1678,16 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1678
1678
|
},
|
|
1679
1679
|
setup(o) {
|
|
1680
1680
|
return (e, t) => (u(), c("div", null, [
|
|
1681
|
-
l("div",
|
|
1681
|
+
l("div", La, [
|
|
1682
1682
|
l("p", null, U(o.title), 1)
|
|
1683
1683
|
]),
|
|
1684
1684
|
_e(e.$slots, "default")
|
|
1685
1685
|
]));
|
|
1686
1686
|
}
|
|
1687
|
-
}),
|
|
1688
|
-
switcher:
|
|
1689
|
-
accordion:
|
|
1690
|
-
default:
|
|
1687
|
+
}), Ba = {
|
|
1688
|
+
switcher: _a,
|
|
1689
|
+
accordion: Ma,
|
|
1690
|
+
default: Sa
|
|
1691
1691
|
}, pe = {
|
|
1692
1692
|
Equal: "==",
|
|
1693
1693
|
Inequal: "!=",
|
|
@@ -1701,37 +1701,37 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1701
1701
|
Contain: "*",
|
|
1702
1702
|
In: "in",
|
|
1703
1703
|
NotIn: "not_in"
|
|
1704
|
-
},
|
|
1704
|
+
}, ja = (o, e) => String(o) === String(e), Ia = (o, e) => String(o) !== String(e), za = (o, e) => o > e, Ea = (o, e) => o >= e, Aa = (o, e) => o < e, Da = (o, e) => o <= e, Fa = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Oa = (o, e) => String(o).startsWith(String(e)), Ua = (o, e) => String(o).endsWith(String(e)), Ta = (o, e) => String(o).includes(String(e)), Ra = (o, e) => Array.isArray(e) ? e.includes(o) : !1, Pa = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, wt = (o, e) => {
|
|
1705
1705
|
if (!e) return !0;
|
|
1706
1706
|
switch (e?.[1]) {
|
|
1707
1707
|
case pe.Equal:
|
|
1708
|
-
return Ba(o, e?.[2]);
|
|
1709
|
-
case pe.Inequal:
|
|
1710
1708
|
return ja(o, e?.[2]);
|
|
1711
|
-
case pe.
|
|
1709
|
+
case pe.Inequal:
|
|
1712
1710
|
return Ia(o, e?.[2]);
|
|
1713
|
-
case pe.
|
|
1711
|
+
case pe.Higer:
|
|
1714
1712
|
return za(o, e?.[2]);
|
|
1715
|
-
case pe.
|
|
1713
|
+
case pe.HigerOrEqual:
|
|
1716
1714
|
return Ea(o, e?.[2]);
|
|
1717
|
-
case pe.
|
|
1715
|
+
case pe.Lower:
|
|
1718
1716
|
return Aa(o, e?.[2]);
|
|
1719
|
-
case pe.
|
|
1717
|
+
case pe.LowerOrEqual:
|
|
1720
1718
|
return Da(o, e?.[2]);
|
|
1721
|
-
case pe.
|
|
1719
|
+
case pe.Between:
|
|
1722
1720
|
return Fa(o, e?.[2]);
|
|
1723
|
-
case pe.
|
|
1721
|
+
case pe.StartWith:
|
|
1724
1722
|
return Oa(o, e?.[2]);
|
|
1725
|
-
case pe.
|
|
1723
|
+
case pe.EndWith:
|
|
1726
1724
|
return Ua(o, e?.[2]);
|
|
1727
|
-
case pe.
|
|
1725
|
+
case pe.Contain:
|
|
1728
1726
|
return Ta(o, e?.[2]);
|
|
1729
|
-
case pe.
|
|
1727
|
+
case pe.In:
|
|
1730
1728
|
return Ra(o, e?.[2]);
|
|
1729
|
+
case pe.NotIn:
|
|
1730
|
+
return Pa(o, e?.[2]);
|
|
1731
1731
|
default:
|
|
1732
1732
|
return !0;
|
|
1733
1733
|
}
|
|
1734
|
-
},
|
|
1734
|
+
}, Ha = /* @__PURE__ */ D({
|
|
1735
1735
|
__name: "vs-input-container",
|
|
1736
1736
|
props: {
|
|
1737
1737
|
style: {
|
|
@@ -1756,15 +1756,15 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1756
1756
|
const i = a?.conditions;
|
|
1757
1757
|
if (!i) return !0;
|
|
1758
1758
|
const d = Array.isArray(i) ? i[0] : i, v = t?.value?.[d];
|
|
1759
|
-
return
|
|
1760
|
-
})), r = F(() =>
|
|
1761
|
-
return (a, i) => o.schema?.length ? (u(),
|
|
1759
|
+
return wt(v, i);
|
|
1760
|
+
})), r = F(() => Ba[e.view]);
|
|
1761
|
+
return (a, i) => o.schema?.length ? (u(), ie(Be(r.value), {
|
|
1762
1762
|
key: 0,
|
|
1763
1763
|
title: o.title,
|
|
1764
1764
|
style: xe(o.style)
|
|
1765
1765
|
}, {
|
|
1766
1766
|
default: Le(() => [
|
|
1767
|
-
(u(!0), c(Y, null, oe(s.value, (d) => (u(),
|
|
1767
|
+
(u(!0), c(Y, null, oe(s.value, (d) => (u(), ie(kt, Ee({
|
|
1768
1768
|
key: d.name
|
|
1769
1769
|
}, { ref_for: !0 }, d, {
|
|
1770
1770
|
item: d,
|
|
@@ -1777,13 +1777,13 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1777
1777
|
_: 1
|
|
1778
1778
|
}, 8, ["title", "style"])) : z("", !0);
|
|
1779
1779
|
}
|
|
1780
|
-
}),
|
|
1780
|
+
}), Na = ["aria-expanded", "data-focus"], qa = { class: "flex items-center" }, Ga = ["title"], Ja = ["onClick"], Ka = ["title"], Za = {
|
|
1781
1781
|
key: 2,
|
|
1782
1782
|
class: "text-gray-500 truncate"
|
|
1783
|
-
},
|
|
1783
|
+
}, Wa = { class: "flex-1 min-w-[2px]" }, Qa = ["placeholder"], Xa = { class: "flex items-center shrink-0" }, Ya = ["disabled"], es = ["disabled", "title"], ts = ["aria-disabled", "onClick"], ls = {
|
|
1784
1784
|
key: 1,
|
|
1785
1785
|
class: "px-3 py-2 text-center text-gray-500"
|
|
1786
|
-
},
|
|
1786
|
+
}, os = ["disabled"], dt = /* @__PURE__ */ D({
|
|
1787
1787
|
__name: "vs-input-select",
|
|
1788
1788
|
props: {
|
|
1789
1789
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1815,14 +1815,14 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1815
1815
|
set: (g) => n("update:modelValue", g)
|
|
1816
1816
|
});
|
|
1817
1817
|
!a.value && t.defaultValue && (a.value = t.defaultValue);
|
|
1818
|
-
const i = x(null), d = x(null), v = x(null), p = x(!1), w = x(!1), b = x(null), $ = x([]),
|
|
1818
|
+
const i = x(null), d = x(null), v = x(null), p = x(!1), w = x(!1), b = x(null), $ = x([]), j = x(-1), R = x([]), C = x(""), E = x(null), M = x("bottom"), m = x({}), f = x([]), Q = F(() => {
|
|
1819
1819
|
if (!f.value.length) return [];
|
|
1820
1820
|
const g = new Map($.value.map((h) => [h.id?.toString(), h]));
|
|
1821
1821
|
return f.value.map((h) => g.get(h?.toString())).filter((h) => !!h);
|
|
1822
|
-
}), T = F(() => t.placeholder || "Select..."), O = F(() => s.value ? !f.value.length &&
|
|
1822
|
+
}), T = F(() => t.placeholder || "Select..."), O = F(() => s.value ? !f.value.length && C.value === "" : !b.value?.text && C.value === ""), ue = F(() => r.value ? !1 : s.value ? f.value.length > 0 : !!a.value), ee = (g) => s.value ? f.value.some((h) => h?.toString() === g?.toString()) : a.value?.toString() === g?.toString(), X = F(() => {
|
|
1823
1823
|
let g = $.value ?? [];
|
|
1824
|
-
if (!t.data &&
|
|
1825
|
-
const h =
|
|
1824
|
+
if (!t.data && C.value.trim() !== "") {
|
|
1825
|
+
const h = C.value.toLowerCase();
|
|
1826
1826
|
g = g.filter((_) => _.text?.toLowerCase?.().includes(h));
|
|
1827
1827
|
}
|
|
1828
1828
|
if (s.value && f.value.length) {
|
|
@@ -1830,7 +1830,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1830
1830
|
g = g.filter((_) => !h.has(_.id?.toString()));
|
|
1831
1831
|
}
|
|
1832
1832
|
return g;
|
|
1833
|
-
}), je = Me("values"), we = F(() => t.parent ? je?.value?.[t.parent] ?? null : null),
|
|
1833
|
+
}), je = Me("values"), we = F(() => t.parent ? je?.value?.[t.parent] ?? null : null), A = async (g) => {
|
|
1834
1834
|
if (!t.data) {
|
|
1835
1835
|
let h = t.options ?? [];
|
|
1836
1836
|
if (g?.trim()) {
|
|
@@ -1840,50 +1840,50 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1840
1840
|
return h;
|
|
1841
1841
|
}
|
|
1842
1842
|
try {
|
|
1843
|
-
const h = t.host ?? "", _ = t.prefix ?? "api", H = t.api ?? `/${_}/suggest/${t.data}`, te = `${h}${H}`,
|
|
1844
|
-
return
|
|
1843
|
+
const h = t.host ?? "", _ = t.prefix ?? "api", H = t.api ?? `/${_}/suggest/${t.data}`, te = `${h}${H}`, re = new URLSearchParams();
|
|
1844
|
+
return re.set("json", "1"), g && re.set("key", g), we.value !== void 0 && we.value !== null && we.value !== "" && re.set("parent", String(we.value)), (await fetch(`${te}?${re.toString()}`).then((Ie) => Ie.json()))?.data ?? [];
|
|
1845
1845
|
} catch {
|
|
1846
1846
|
return [];
|
|
1847
1847
|
}
|
|
1848
|
-
},
|
|
1849
|
-
t.data ? $.value = await
|
|
1848
|
+
}, S = async () => {
|
|
1849
|
+
t.data ? $.value = await A(C.value) : $.value = t.options ? [...t.options] : [];
|
|
1850
1850
|
}, I = async (g) => {
|
|
1851
1851
|
if (g == null) return null;
|
|
1852
1852
|
const h = $.value?.find((H) => H?.id?.toString() === String(g));
|
|
1853
|
-
return h || ((await
|
|
1853
|
+
return h || ((await A(String(g)))?.[0] ?? null);
|
|
1854
1854
|
}, G = async (g) => {
|
|
1855
1855
|
const h = new Set($.value.map((H) => H.id?.toString())), _ = g.filter((H) => !h.has(H?.toString()));
|
|
1856
1856
|
_.length && await _.reduce(async (H, te) => {
|
|
1857
1857
|
await H;
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1858
|
+
const re = await I(te);
|
|
1859
|
+
re && $.value.push(re);
|
|
1860
1860
|
}, Promise.resolve());
|
|
1861
1861
|
}, ae = async () => {
|
|
1862
|
-
r.value || (p.value = !0, await
|
|
1863
|
-
be(),
|
|
1862
|
+
r.value || (p.value = !0, await S(), await ze(() => {
|
|
1863
|
+
be(), E.value?.focus(), X.value.length ? j.value = 0 : j.value = -1;
|
|
1864
1864
|
}));
|
|
1865
1865
|
}, de = () => {
|
|
1866
|
-
p.value = !1,
|
|
1866
|
+
p.value = !1, j.value = -1;
|
|
1867
1867
|
}, ke = async (g) => {
|
|
1868
1868
|
if (r.value) return;
|
|
1869
1869
|
!p.value ? await ae() : de();
|
|
1870
1870
|
}, y = async () => {
|
|
1871
|
-
p.value ?
|
|
1871
|
+
p.value ? E.value?.focus() : await ae();
|
|
1872
1872
|
}, k = () => {
|
|
1873
|
-
s.value ? (f.value = [], a.value = [], n("change", [])) : (b.value = null, a.value = null, n("change", null)),
|
|
1873
|
+
s.value ? (f.value = [], a.value = [], n("change", [])) : (b.value = null, a.value = null, n("change", null)), C.value = "", ze(() => E.value?.focus());
|
|
1874
1874
|
}, P = (g) => {
|
|
1875
|
-
s.value && (f.value = f.value.filter((h) => h?.toString() !== g?.toString()), a.value = [...f.value], n("change", a.value), ze(() =>
|
|
1875
|
+
s.value && (f.value = f.value.filter((h) => h?.toString() !== g?.toString()), a.value = [...f.value], n("change", a.value), ze(() => E.value?.focus()));
|
|
1876
1876
|
}, J = (g) => {
|
|
1877
|
-
s.value ? (ee(g.id) || (f.value = [...f.value, g.id], a.value = [...f.value], n("change", a.value)),
|
|
1878
|
-
|
|
1879
|
-
})) : (b.value = g, a.value = g.id, n("change", a.value),
|
|
1880
|
-
},
|
|
1877
|
+
s.value ? (ee(g.id) || (f.value = [...f.value, g.id], a.value = [...f.value], n("change", a.value)), C.value = "", ze(() => {
|
|
1878
|
+
E.value?.focus(), j.value = Math.min(j.value, X.value.length - 1);
|
|
1879
|
+
})) : (b.value = g, a.value = g.id, n("change", a.value), C.value = "", de());
|
|
1880
|
+
}, ne = (g) => {
|
|
1881
1881
|
ee(g.id) || J(g);
|
|
1882
1882
|
}, $e = (g, h) => {
|
|
1883
1883
|
if (!g || !h) return;
|
|
1884
|
-
const _ = g.offsetTop, H = _ + g.offsetHeight, te = h.scrollTop,
|
|
1884
|
+
const _ = g.offsetTop, H = _ + g.offsetHeight, te = h.scrollTop, re = te + h.clientHeight;
|
|
1885
1885
|
let Se = h.scrollTop;
|
|
1886
|
-
_ < te ? Se = _ - 80 : H >
|
|
1886
|
+
_ < te ? Se = _ - 80 : H > re && (Se = H - h.clientHeight + 4);
|
|
1887
1887
|
const Ie = h;
|
|
1888
1888
|
Ie.scrollTop = Se;
|
|
1889
1889
|
}, ge = (g) => {
|
|
@@ -1899,26 +1899,26 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1899
1899
|
return document.body;
|
|
1900
1900
|
}, be = () => {
|
|
1901
1901
|
if (!d.value) return;
|
|
1902
|
-
const g = d.value.getBoundingClientRect(), _ = ge(d.value).getBoundingClientRect(), H = 300, te = 20,
|
|
1902
|
+
const g = d.value.getBoundingClientRect(), _ = ge(d.value).getBoundingClientRect(), H = 300, te = 20, re = 8, Se = g.top - _.top, Ie = g.bottom - _.top, lt = _.height - Ie - re - te, ot = Se - re - te;
|
|
1903
1903
|
let qe = !1;
|
|
1904
1904
|
if (lt >= ot ? qe = !0 : qe = !1, qe) {
|
|
1905
|
-
|
|
1905
|
+
M.value = "bottom";
|
|
1906
1906
|
const Ge = Math.min(H, Math.max(lt + te, 50));
|
|
1907
1907
|
m.value = {
|
|
1908
|
-
top: `${g.height +
|
|
1908
|
+
top: `${g.height + re}px`,
|
|
1909
1909
|
left: "0px",
|
|
1910
1910
|
right: "0px",
|
|
1911
1911
|
bottom: "auto",
|
|
1912
1912
|
maxHeight: `${Ge}px`
|
|
1913
1913
|
};
|
|
1914
1914
|
} else {
|
|
1915
|
-
|
|
1915
|
+
M.value = "top";
|
|
1916
1916
|
const Ge = Math.min(H, Math.max(ot + te, 50));
|
|
1917
1917
|
m.value = {
|
|
1918
1918
|
top: "auto",
|
|
1919
1919
|
left: "0px",
|
|
1920
1920
|
right: "0px",
|
|
1921
|
-
bottom: `${g.height +
|
|
1921
|
+
bottom: `${g.height + re}px`,
|
|
1922
1922
|
maxHeight: `${Ge}px`
|
|
1923
1923
|
};
|
|
1924
1924
|
}
|
|
@@ -1928,18 +1928,18 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1928
1928
|
if (!p.value) return;
|
|
1929
1929
|
const { key: h } = g;
|
|
1930
1930
|
if (h === "ArrowDown")
|
|
1931
|
-
g.preventDefault(),
|
|
1931
|
+
g.preventDefault(), j.value + 1 < X.value.length && (j.value += 1, $e(R.value[j.value], v.value));
|
|
1932
1932
|
else if (h === "ArrowUp")
|
|
1933
|
-
g.preventDefault(),
|
|
1933
|
+
g.preventDefault(), j.value > 0 && (j.value -= 1, $e(R.value[j.value], v.value));
|
|
1934
1934
|
else if (h === "Enter") {
|
|
1935
1935
|
g.preventDefault();
|
|
1936
|
-
const _ = X.value[
|
|
1937
|
-
_ && J(_),
|
|
1938
|
-
} else h === "Escape" ? (g.preventDefault(), de()) : h === "Backspace" ? s.value &&
|
|
1939
|
-
}, _t = () => {
|
|
1940
|
-
r.value || (w.value = !0);
|
|
1936
|
+
const _ = X.value[j.value];
|
|
1937
|
+
_ && J(_), E.value?.blur();
|
|
1938
|
+
} else h === "Escape" ? (g.preventDefault(), de()) : h === "Backspace" ? s.value && C.value === "" && f.value.length && (f.value = f.value.slice(0, -1), a.value = [...f.value], n("change", a.value)) : h === "Home" ? (j.value = 0, $e(R.value[0], v.value)) : h === "End" ? (j.value = X.value.length - 1, $e(R.value[j.value], v.value)) : h === "Tab" && de();
|
|
1941
1939
|
}, $t = () => {
|
|
1942
|
-
|
|
1940
|
+
r.value || (w.value = !0);
|
|
1941
|
+
}, Vt = () => {
|
|
1942
|
+
w.value = !1, C.value = "";
|
|
1943
1943
|
}, Ke = (g) => {
|
|
1944
1944
|
g.key === "Escape" && p.value && de();
|
|
1945
1945
|
}, Ze = (g) => {
|
|
@@ -1968,12 +1968,12 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1968
1968
|
le(a, () => {
|
|
1969
1969
|
Ye();
|
|
1970
1970
|
}), me(async () => {
|
|
1971
|
-
addEventListener("keydown", Ke), addEventListener("scroll", We, !0), addEventListener("resize", Qe), document.addEventListener("click", Ze, !0), d.value && ge(d.value).addEventListener("scroll", Xe, !0), t.options?.length ? $.value = [...t.options] : t.data && ($.value = await
|
|
1971
|
+
addEventListener("keydown", Ke), addEventListener("scroll", We, !0), addEventListener("resize", Qe), document.addEventListener("click", Ze, !0), d.value && ge(d.value).addEventListener("scroll", Xe, !0), t.options?.length ? $.value = [...t.options] : t.data && ($.value = await A("")), await Ye();
|
|
1972
1972
|
}), Te(() => {
|
|
1973
1973
|
removeEventListener("keydown", Ke), removeEventListener("scroll", We, !0), removeEventListener("resize", Qe), document.removeEventListener("click", Ze, !0), d.value && ge(d.value).removeEventListener("scroll", Xe, !0);
|
|
1974
1974
|
});
|
|
1975
1975
|
const Fe = x(!1), Ne = x({}), et = x([]), tt = x(null);
|
|
1976
|
-
async function
|
|
1976
|
+
async function Ct() {
|
|
1977
1977
|
if (!t.add?.token || tt?.value.validate())
|
|
1978
1978
|
return;
|
|
1979
1979
|
const h = t.add.api ?? `/api/table/${t.add.token}`, { id: _ } = await fetch(h, {
|
|
@@ -1987,35 +1987,35 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
1987
1987
|
}
|
|
1988
1988
|
Fe.value = !1, ye({ title: "Success!", message: "Object created." });
|
|
1989
1989
|
}
|
|
1990
|
-
async function
|
|
1990
|
+
async function Mt() {
|
|
1991
1991
|
if (!t.add) return null;
|
|
1992
1992
|
const g = await fetch(`/api/template/form/${t.add.form}`).then((h) => h.json());
|
|
1993
1993
|
return et.value = g.schema, Fe.value = !0, null;
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function Lt(g, h = 200) {
|
|
1996
1996
|
let _;
|
|
1997
1997
|
return (...H) => {
|
|
1998
1998
|
_ && clearTimeout(_), _ = window.setTimeout(() => g(...H), h);
|
|
1999
1999
|
};
|
|
2000
2000
|
}
|
|
2001
|
-
const
|
|
2002
|
-
$.value = await
|
|
2001
|
+
const St = Lt(async (g) => {
|
|
2002
|
+
$.value = await A(g);
|
|
2003
2003
|
}, 200);
|
|
2004
|
-
return le(
|
|
2005
|
-
t.data &&
|
|
2004
|
+
return le(C, (g) => {
|
|
2005
|
+
t.data && St(g.trim());
|
|
2006
2006
|
}), le(() => t.options, (g) => {
|
|
2007
2007
|
!t.data && g?.length && ($.value = [...g]);
|
|
2008
2008
|
}, { immediate: !0 }), le(() => t.parent ?? t.parentValue, () => {
|
|
2009
|
-
t.data &&
|
|
2009
|
+
t.data && S();
|
|
2010
2010
|
}), le(we, async () => {
|
|
2011
2011
|
t.data && (s.value ? (f.value = [], a.value = [], n("change", [])) : (b.value = null, a.value = null, n("change", null)));
|
|
2012
2012
|
}), (g, h) => (u(), c(Y, null, [
|
|
2013
|
-
B(q(
|
|
2013
|
+
B(q(gt), {
|
|
2014
2014
|
visible: Fe.value,
|
|
2015
2015
|
"onUpdate:visible": h[1] || (h[1] = (_) => Fe.value = _),
|
|
2016
2016
|
title: "Додати",
|
|
2017
2017
|
buttonText: "Додати",
|
|
2018
|
-
onDone:
|
|
2018
|
+
onDone: Ct
|
|
2019
2019
|
}, {
|
|
2020
2020
|
default: Le(() => [
|
|
2021
2021
|
B(De, {
|
|
@@ -2036,7 +2036,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2036
2036
|
}, ["stop"]))
|
|
2037
2037
|
}, [
|
|
2038
2038
|
l("div", {
|
|
2039
|
-
class:
|
|
2039
|
+
class: V(["relative w-full font-sans", t.customClass])
|
|
2040
2040
|
}, [
|
|
2041
2041
|
h[9] || (h[9] = l("span", {
|
|
2042
2042
|
id: "react-select-live-region",
|
|
@@ -2050,7 +2050,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2050
2050
|
class: "sr-only"
|
|
2051
2051
|
}, null, -1)),
|
|
2052
2052
|
l("div", {
|
|
2053
|
-
class:
|
|
2053
|
+
class: V([
|
|
2054
2054
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
2055
2055
|
"border-gray-300 hover:border-gray-400",
|
|
2056
2056
|
p.value || w.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
@@ -2072,7 +2072,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2072
2072
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2073
2073
|
key: _.id
|
|
2074
2074
|
}, [
|
|
2075
|
-
l("div",
|
|
2075
|
+
l("div", qa, [
|
|
2076
2076
|
_?.color ? (u(), c("span", {
|
|
2077
2077
|
key: 0,
|
|
2078
2078
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
@@ -2081,7 +2081,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2081
2081
|
l("div", {
|
|
2082
2082
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2083
2083
|
title: _.text
|
|
2084
|
-
}, U(_.text), 9,
|
|
2084
|
+
}, U(_.text), 9, Ga)
|
|
2085
2085
|
]),
|
|
2086
2086
|
l("div", {
|
|
2087
2087
|
role: "button",
|
|
@@ -2098,10 +2098,10 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2098
2098
|
}, [
|
|
2099
2099
|
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" })
|
|
2100
2100
|
], -1)
|
|
2101
|
-
]), 8,
|
|
2102
|
-
]))), 128)) : !s.value && !w.value && b.value?.text &&
|
|
2101
|
+
]), 8, Ja)
|
|
2102
|
+
]))), 128)) : !s.value && !w.value && b.value?.text && C.value === "" ? (u(), c("div", {
|
|
2103
2103
|
key: 1,
|
|
2104
|
-
class:
|
|
2104
|
+
class: V(["truncate text-gray-900"]),
|
|
2105
2105
|
title: b.value.text
|
|
2106
2106
|
}, [
|
|
2107
2107
|
b.value?.color ? (u(), c("span", {
|
|
@@ -2110,15 +2110,15 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2110
2110
|
style: xe({ backgroundColor: b.value?.color })
|
|
2111
2111
|
}, null, 4)) : z("", !0),
|
|
2112
2112
|
l("span", {
|
|
2113
|
-
class:
|
|
2113
|
+
class: V({ "pl-5": b.value?.color })
|
|
2114
2114
|
}, U(b.value.text), 3)
|
|
2115
|
-
], 8,
|
|
2116
|
-
O.value ? (u(), c("div",
|
|
2117
|
-
l("div",
|
|
2115
|
+
], 8, Ka)) : z("", !0),
|
|
2116
|
+
O.value ? (u(), c("div", Za, U(T.value), 1)) : z("", !0),
|
|
2117
|
+
l("div", Wa, [
|
|
2118
2118
|
!r.value && g.search ? K((u(), c("input", {
|
|
2119
2119
|
key: 0,
|
|
2120
2120
|
ref_key: "inputRef",
|
|
2121
|
-
ref:
|
|
2121
|
+
ref: E,
|
|
2122
2122
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
2123
2123
|
autocapitalize: "none",
|
|
2124
2124
|
autocomplete: "off",
|
|
@@ -2127,17 +2127,17 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2127
2127
|
type: "text",
|
|
2128
2128
|
tabindex: "0",
|
|
2129
2129
|
"aria-autocomplete": "list",
|
|
2130
|
-
placeholder: (s.value && f.value.length ? " " : null) || (w.value && !
|
|
2131
|
-
"onUpdate:modelValue": h[2] || (h[2] = (_) =>
|
|
2132
|
-
onFocus:
|
|
2133
|
-
onBlur:
|
|
2130
|
+
placeholder: (s.value && f.value.length ? " " : null) || (w.value && !C.value?.length ? b.value?.text : " "),
|
|
2131
|
+
"onUpdate:modelValue": h[2] || (h[2] = (_) => C.value = _),
|
|
2132
|
+
onFocus: $t,
|
|
2133
|
+
onBlur: Vt,
|
|
2134
2134
|
onKeydown: Ce
|
|
2135
|
-
}, null, 40,
|
|
2136
|
-
[
|
|
2135
|
+
}, null, 40, Qa)), [
|
|
2136
|
+
[se, C.value]
|
|
2137
2137
|
]) : z("", !0)
|
|
2138
2138
|
])
|
|
2139
2139
|
], 512),
|
|
2140
|
-
l("div",
|
|
2140
|
+
l("div", Xa, [
|
|
2141
2141
|
ue.value ? (u(), c("button", {
|
|
2142
2142
|
key: 0,
|
|
2143
2143
|
type: "button",
|
|
@@ -2154,7 +2154,7 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2154
2154
|
}, [
|
|
2155
2155
|
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" })
|
|
2156
2156
|
], -1)
|
|
2157
|
-
]), 8,
|
|
2157
|
+
]), 8, Ya)) : z("", !0),
|
|
2158
2158
|
h[8] || (h[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2159
2159
|
l("button", {
|
|
2160
2160
|
type: "button",
|
|
@@ -2172,14 +2172,14 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2172
2172
|
}, [
|
|
2173
2173
|
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" })
|
|
2174
2174
|
], -1)
|
|
2175
|
-
]), 8,
|
|
2175
|
+
]), 8, es)
|
|
2176
2176
|
])
|
|
2177
|
-
], 42,
|
|
2177
|
+
], 42, Na),
|
|
2178
2178
|
p.value ? (u(), c("div", {
|
|
2179
2179
|
key: 0,
|
|
2180
|
-
class:
|
|
2180
|
+
class: V([
|
|
2181
2181
|
"absolute z-10 w-full rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
|
|
2182
|
-
|
|
2182
|
+
M.value === "bottom" ? "mt-2" : "mb-2"
|
|
2183
2183
|
]),
|
|
2184
2184
|
style: xe(m.value),
|
|
2185
2185
|
role: "listbox"
|
|
@@ -2194,15 +2194,15 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2194
2194
|
key: _.id,
|
|
2195
2195
|
ref_for: !0,
|
|
2196
2196
|
ref: (te) => R.value[H] = te,
|
|
2197
|
-
class:
|
|
2197
|
+
class: V([
|
|
2198
2198
|
"flex px-3 py-2 cursor-default select-none text-gray-900 hover:bg-blue-100",
|
|
2199
|
-
|
|
2199
|
+
j.value === H ? "bg-blue-100" : "",
|
|
2200
2200
|
ee(_.id) ? "bg-blue-50" : "bg-white"
|
|
2201
2201
|
]),
|
|
2202
2202
|
"aria-disabled": ee(_.id) ? "true" : "false",
|
|
2203
2203
|
role: "option",
|
|
2204
2204
|
tabindex: "-1",
|
|
2205
|
-
onClick: (te) =>
|
|
2205
|
+
onClick: (te) => ne(_)
|
|
2206
2206
|
}, [
|
|
2207
2207
|
_?.color ? (u(), c("span", {
|
|
2208
2208
|
key: 0,
|
|
@@ -2210,20 +2210,20 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2210
2210
|
style: xe({ backgroundColor: _?.color })
|
|
2211
2211
|
}, null, 4)) : z("", !0),
|
|
2212
2212
|
l("div", {
|
|
2213
|
-
class:
|
|
2213
|
+
class: V([
|
|
2214
2214
|
"leading-[19px]",
|
|
2215
|
-
|
|
2215
|
+
j.value === _.id ? "text-white" : "",
|
|
2216
2216
|
// active style like react-select
|
|
2217
|
-
(
|
|
2217
|
+
(j.value === H, "")
|
|
2218
2218
|
])
|
|
2219
2219
|
}, U(_.text), 3)
|
|
2220
|
-
], 10,
|
|
2220
|
+
], 10, ts))), 128)) : (u(), c("div", ls, " No options "))
|
|
2221
2221
|
], 4)
|
|
2222
2222
|
], 6)) : z("", !0)
|
|
2223
2223
|
], 2),
|
|
2224
2224
|
t.add ? (u(), c("button", {
|
|
2225
2225
|
key: 0,
|
|
2226
|
-
onClick:
|
|
2226
|
+
onClick: Mt,
|
|
2227
2227
|
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",
|
|
2228
2228
|
disabled: r.value,
|
|
2229
2229
|
type: "button"
|
|
@@ -2233,11 +2233,11 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2233
2233
|
height: "16"
|
|
2234
2234
|
}),
|
|
2235
2235
|
h[11] || (h[11] = l("span", null, "Додати", -1))
|
|
2236
|
-
], 8,
|
|
2236
|
+
], 8, os)) : z("", !0)
|
|
2237
2237
|
], 512)
|
|
2238
2238
|
], 64));
|
|
2239
2239
|
}
|
|
2240
|
-
}), as = ["placeholder", "disabled"], ss = /* @__PURE__ */
|
|
2240
|
+
}), as = ["placeholder", "disabled"], ss = /* @__PURE__ */ D({
|
|
2241
2241
|
__name: "vs-input-textarea",
|
|
2242
2242
|
props: /* @__PURE__ */ Z({
|
|
2243
2243
|
style: { default: () => ({}) },
|
|
@@ -2259,12 +2259,12 @@ const ra = /* @__PURE__ */ N(aa, [["render", na]]), ia = { class: "flex flex-col
|
|
|
2259
2259
|
placeholder: s.placeholder,
|
|
2260
2260
|
disabled: s.disabled,
|
|
2261
2261
|
row: "2",
|
|
2262
|
-
class:
|
|
2262
|
+
class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [q(t)]]),
|
|
2263
2263
|
style: {
|
|
2264
2264
|
border: "1px solid #CFD9E0"
|
|
2265
2265
|
}
|
|
2266
2266
|
}, null, 10, as)), [
|
|
2267
|
-
[
|
|
2267
|
+
[se, n.value]
|
|
2268
2268
|
]);
|
|
2269
2269
|
}
|
|
2270
2270
|
}), ns = {}, rs = {
|
|
@@ -2364,7 +2364,7 @@ function $s(o, e) {
|
|
|
2364
2364
|
ce('<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)
|
|
2365
2365
|
]));
|
|
2366
2366
|
}
|
|
2367
|
-
const
|
|
2367
|
+
const ct = /* @__PURE__ */ N(ks, [["render", $s]]), Vs = {}, Cs = {
|
|
2368
2368
|
viewBox: "0 0 178 90",
|
|
2369
2369
|
fill: "none",
|
|
2370
2370
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -2392,7 +2392,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2392
2392
|
key: 0,
|
|
2393
2393
|
colspan: "100%",
|
|
2394
2394
|
class: "text-center"
|
|
2395
|
-
}, Zs = { class: "w-full" }, Ws = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Qs = ["onDragstart", "onDragover", "onDrop"], Xs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ys = { class: "flex items-center justify-center" }, en = { 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" }, tn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, ln = { class: "flex items-center justify-center gap-2" }, on = ["onClick"], an = ["onClick"], sn = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, nn = /* @__PURE__ */
|
|
2395
|
+
}, Zs = { class: "w-full" }, Ws = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Qs = ["onDragstart", "onDragover", "onDrop"], Xs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ys = { class: "flex items-center justify-center" }, en = { 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" }, tn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, ln = { class: "flex items-center justify-center gap-2" }, on = ["onClick"], an = ["onClick"], sn = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, nn = /* @__PURE__ */ D({
|
|
2396
2396
|
__name: "vs-input-datatable",
|
|
2397
2397
|
props: /* @__PURE__ */ Z({
|
|
2398
2398
|
colModel: {},
|
|
@@ -2411,29 +2411,29 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2411
2411
|
setup(o) {
|
|
2412
2412
|
const e = o, t = W(o, "modelValue"), n = x({}), s = x(""), r = F(() => {
|
|
2413
2413
|
if (!s.value) return t.value ?? [];
|
|
2414
|
-
const
|
|
2415
|
-
return t.value.filter((
|
|
2416
|
-
const G =
|
|
2417
|
-
return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(
|
|
2414
|
+
const A = s.value.toLowerCase();
|
|
2415
|
+
return t.value.filter((S) => e.colModel?.some((I) => {
|
|
2416
|
+
const G = S[I.key];
|
|
2417
|
+
return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(A) : String(G).toLowerCase().includes(A) : !1;
|
|
2418
2418
|
}));
|
|
2419
|
-
}), a = x(null), i = x(null), d = x(!1), v = x(null), p = x({ top: 0, left: 0 }), w = (
|
|
2420
|
-
a.value =
|
|
2421
|
-
}, b = (
|
|
2422
|
-
i.value =
|
|
2423
|
-
}, $ = (
|
|
2424
|
-
if (a.value === null || a.value ===
|
|
2419
|
+
}), a = x(null), i = x(null), d = x(!1), v = x(null), p = x({ top: 0, left: 0 }), w = (A) => {
|
|
2420
|
+
a.value = A;
|
|
2421
|
+
}, b = (A) => {
|
|
2422
|
+
i.value = A;
|
|
2423
|
+
}, $ = (A) => {
|
|
2424
|
+
if (a.value === null || a.value === A) {
|
|
2425
2425
|
a.value = null, i.value = null;
|
|
2426
2426
|
return;
|
|
2427
2427
|
}
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2430
|
-
},
|
|
2431
|
-
const I =
|
|
2428
|
+
const S = [...t.value], [I] = S.splice(a.value, 1);
|
|
2429
|
+
S.splice(A, 0, I), t.value = S, a.value = null, i.value = null;
|
|
2430
|
+
}, j = (A) => {
|
|
2431
|
+
const I = A.currentTarget.getBoundingClientRect();
|
|
2432
2432
|
p.value = { top: I.bottom + window.scrollY, left: I.left + window.scrollX }, d.value = !d.value;
|
|
2433
2433
|
}, R = () => {
|
|
2434
2434
|
v.value && v.value.click();
|
|
2435
|
-
},
|
|
2436
|
-
const I =
|
|
2435
|
+
}, C = (A) => {
|
|
2436
|
+
const I = A.target.files?.[0];
|
|
2437
2437
|
if (!I) return;
|
|
2438
2438
|
const G = new FileReader();
|
|
2439
2439
|
G.onload = (ae) => {
|
|
@@ -2447,43 +2447,43 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2447
2447
|
console.error("Error parsing file:", de);
|
|
2448
2448
|
}
|
|
2449
2449
|
}, G.readAsText(I);
|
|
2450
|
-
},
|
|
2451
|
-
const
|
|
2450
|
+
}, E = () => {
|
|
2451
|
+
const A = JSON.stringify(t.value, null, 2), S = new Blob([A], { type: "application/json" }), I = URL.createObjectURL(S), G = document.createElement("a");
|
|
2452
2452
|
G.href = I, G.download = "data.json", G.click(), URL.revokeObjectURL(I);
|
|
2453
2453
|
};
|
|
2454
2454
|
me(async () => {
|
|
2455
|
-
const
|
|
2456
|
-
|
|
2457
|
-
const G = await (await fetch(`/api/suggest/${
|
|
2458
|
-
n.value[
|
|
2455
|
+
const A = e.colModel?.filter((S) => S.data);
|
|
2456
|
+
A?.length && Promise.all(A.map(async (S) => {
|
|
2457
|
+
const G = await (await fetch(`/api/suggest/${S.data}`)).json();
|
|
2458
|
+
n.value[S.key] = G.data;
|
|
2459
2459
|
}));
|
|
2460
2460
|
});
|
|
2461
|
-
const
|
|
2461
|
+
const M = x(""), m = x(!1);
|
|
2462
2462
|
let f = "edit", Q = 0;
|
|
2463
2463
|
const T = x({}), O = x({});
|
|
2464
2464
|
async function ue() {
|
|
2465
|
-
|
|
2465
|
+
M.value = "Додати", m.value = !0, f = "add", T.value = {};
|
|
2466
2466
|
}
|
|
2467
|
-
function ee(
|
|
2468
|
-
const I =
|
|
2469
|
-
return n.value[I] &&
|
|
2467
|
+
function ee(A, S) {
|
|
2468
|
+
const I = S.key || S.name;
|
|
2469
|
+
return n.value[I] && A[I] ? n.value[I].find((G) => G.id.toString() === A[I].toString())?.text ?? A[I] : A[I] || "-";
|
|
2470
2470
|
}
|
|
2471
|
-
async function X(
|
|
2472
|
-
|
|
2471
|
+
async function X(A, S) {
|
|
2472
|
+
M.value = "Редагувати", m.value = !0, f = "edit", Q = S, T.value = { ...A };
|
|
2473
2473
|
}
|
|
2474
2474
|
function je() {
|
|
2475
|
-
const
|
|
2476
|
-
if (
|
|
2477
|
-
ye({ type: "warning", title: "Помилка валідації", message: Object.entries(
|
|
2475
|
+
const A = O.value.validate();
|
|
2476
|
+
if (A) {
|
|
2477
|
+
ye({ type: "warning", title: "Помилка валідації", message: Object.entries(A).map(([S, I]) => `${S}: ${I}`).join(`
|
|
2478
2478
|
`) });
|
|
2479
2479
|
return;
|
|
2480
2480
|
}
|
|
2481
|
-
f === "add" ? Array.isArray(t.value) ? t.value = [...t.value, T.value] : t.value = [T.value] : t.value = t.value.map((
|
|
2481
|
+
f === "add" ? Array.isArray(t.value) ? t.value = [...t.value, T.value] : t.value = [T.value] : t.value = t.value.map((S, I) => I === Q ? T.value : S), m.value = !1;
|
|
2482
2482
|
}
|
|
2483
|
-
function we(
|
|
2484
|
-
t.value = t.value.filter((
|
|
2483
|
+
function we(A) {
|
|
2484
|
+
t.value = t.value.filter((S, I) => I !== A);
|
|
2485
2485
|
}
|
|
2486
|
-
return (
|
|
2486
|
+
return (A, S) => (u(), c("div", zs, [
|
|
2487
2487
|
l("div", Es, [
|
|
2488
2488
|
l("div", As, [
|
|
2489
2489
|
B(us, {
|
|
@@ -2493,18 +2493,18 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2493
2493
|
}),
|
|
2494
2494
|
K(l("input", {
|
|
2495
2495
|
type: "text",
|
|
2496
|
-
"onUpdate:modelValue":
|
|
2496
|
+
"onUpdate:modelValue": S[0] || (S[0] = (I) => s.value = I),
|
|
2497
2497
|
placeholder: "Пошук",
|
|
2498
2498
|
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"
|
|
2499
2499
|
}, null, 512), [
|
|
2500
|
-
[
|
|
2500
|
+
[se, s.value]
|
|
2501
2501
|
])
|
|
2502
2502
|
]),
|
|
2503
2503
|
l("div", Ds, [
|
|
2504
2504
|
l("input", {
|
|
2505
2505
|
ref_key: "fileInput",
|
|
2506
2506
|
ref: v,
|
|
2507
|
-
onChange:
|
|
2507
|
+
onChange: C,
|
|
2508
2508
|
class: "hidden",
|
|
2509
2509
|
accept: ".json",
|
|
2510
2510
|
type: "file"
|
|
@@ -2513,7 +2513,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2513
2513
|
l("div", Os, [
|
|
2514
2514
|
l("div", Us, [
|
|
2515
2515
|
l("button", {
|
|
2516
|
-
onClick:
|
|
2516
|
+
onClick: j,
|
|
2517
2517
|
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"
|
|
2518
2518
|
}, [
|
|
2519
2519
|
B(fs, {
|
|
@@ -2525,7 +2525,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2525
2525
|
])
|
|
2526
2526
|
])
|
|
2527
2527
|
]),
|
|
2528
|
-
(u(),
|
|
2528
|
+
(u(), ie(zt, { to: "body" }, [
|
|
2529
2529
|
d.value ? (u(), c("div", {
|
|
2530
2530
|
key: 0,
|
|
2531
2531
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
@@ -2542,10 +2542,10 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2542
2542
|
width: "14",
|
|
2543
2543
|
height: "14"
|
|
2544
2544
|
}),
|
|
2545
|
-
|
|
2545
|
+
S[4] || (S[4] = fe(" Імпортувати "))
|
|
2546
2546
|
]),
|
|
2547
2547
|
l("button", {
|
|
2548
|
-
onClick:
|
|
2548
|
+
onClick: E,
|
|
2549
2549
|
class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2550
2550
|
}, [
|
|
2551
2551
|
l("span", Ps, [
|
|
@@ -2554,7 +2554,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2554
2554
|
width: "14",
|
|
2555
2555
|
height: "14"
|
|
2556
2556
|
}),
|
|
2557
|
-
|
|
2557
|
+
S[5] || (S[5] = fe(" Експортувати "))
|
|
2558
2558
|
])
|
|
2559
2559
|
])
|
|
2560
2560
|
])
|
|
@@ -2566,7 +2566,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2566
2566
|
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"
|
|
2567
2567
|
}, [
|
|
2568
2568
|
B(Ae),
|
|
2569
|
-
|
|
2569
|
+
S[6] || (S[6] = fe(" Додати "))
|
|
2570
2570
|
])
|
|
2571
2571
|
]),
|
|
2572
2572
|
l("div", Hs, [
|
|
@@ -2574,27 +2574,27 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2574
2574
|
l("thead", qs, [
|
|
2575
2575
|
l("tr", Gs, [
|
|
2576
2576
|
l("th", Js, [
|
|
2577
|
-
B(
|
|
2577
|
+
B(ct, {
|
|
2578
2578
|
width: "24",
|
|
2579
2579
|
height: "24",
|
|
2580
2580
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2581
2581
|
})
|
|
2582
2582
|
]),
|
|
2583
|
-
(u(!0), c(Y, null, oe(
|
|
2583
|
+
(u(!0), c(Y, null, oe(A.colModel, (I) => (u(), c("th", {
|
|
2584
2584
|
key: I.key,
|
|
2585
2585
|
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]"
|
|
2586
2586
|
}, U(I.ua || I.label), 1))), 128)),
|
|
2587
|
-
|
|
2587
|
+
S[7] || (S[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))
|
|
2588
2588
|
])
|
|
2589
2589
|
]),
|
|
2590
2590
|
l("tbody", {
|
|
2591
|
-
class:
|
|
2591
|
+
class: V({ "[&_tr:last-child]:border-0": !i.value })
|
|
2592
2592
|
}, [
|
|
2593
2593
|
r.value.length === 0 ? (u(), c("td", Ks, [
|
|
2594
2594
|
l("div", Zs, [
|
|
2595
2595
|
l("div", Ws, [
|
|
2596
2596
|
B(Ls, { class: "w-48 mx-auto" }),
|
|
2597
|
-
|
|
2597
|
+
S[8] || (S[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2598
2598
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2599
2599
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
2600
2600
|
], -1))
|
|
@@ -2603,7 +2603,7 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2603
2603
|
])) : z("", !0),
|
|
2604
2604
|
(u(!0), c(Y, null, oe(r.value, (I, G) => (u(), c("tr", {
|
|
2605
2605
|
key: I.id,
|
|
2606
|
-
class:
|
|
2606
|
+
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", {
|
|
2607
2607
|
"opacity-50": a.value === G,
|
|
2608
2608
|
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": i.value === G
|
|
2609
2609
|
}]),
|
|
@@ -2614,14 +2614,14 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2614
2614
|
}, [
|
|
2615
2615
|
l("td", Xs, [
|
|
2616
2616
|
l("div", Ys, [
|
|
2617
|
-
B(
|
|
2617
|
+
B(ct, {
|
|
2618
2618
|
width: "24",
|
|
2619
2619
|
height: "24",
|
|
2620
2620
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2621
2621
|
})
|
|
2622
2622
|
])
|
|
2623
2623
|
]),
|
|
2624
|
-
(u(!0), c(Y, null, oe(
|
|
2624
|
+
(u(!0), c(Y, null, oe(A.colModel, (ae) => (u(), c("td", {
|
|
2625
2625
|
key: ae.key,
|
|
2626
2626
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2627
2627
|
}, [
|
|
@@ -2655,23 +2655,23 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), zs = { class: "vs-datatable
|
|
|
2655
2655
|
], 2)
|
|
2656
2656
|
])
|
|
2657
2657
|
]),
|
|
2658
|
-
B(q(
|
|
2658
|
+
B(q(gt), {
|
|
2659
2659
|
visible: m.value,
|
|
2660
|
-
title:
|
|
2660
|
+
title: M.value,
|
|
2661
2661
|
size: "lg"
|
|
2662
2662
|
}, {
|
|
2663
2663
|
default: Le(() => [
|
|
2664
2664
|
B(De, {
|
|
2665
2665
|
schema: e.colModel,
|
|
2666
2666
|
values: T.value,
|
|
2667
|
-
"onUpdate:values":
|
|
2667
|
+
"onUpdate:values": S[1] || (S[1] = (I) => T.value = I),
|
|
2668
2668
|
form: O.value,
|
|
2669
|
-
"onUpdate:form":
|
|
2669
|
+
"onUpdate:form": S[2] || (S[2] = (I) => O.value = I)
|
|
2670
2670
|
}, null, 8, ["schema", "values", "form"]),
|
|
2671
2671
|
l("div", sn, [
|
|
2672
2672
|
l("button", {
|
|
2673
2673
|
type: "button",
|
|
2674
|
-
onClick:
|
|
2674
|
+
onClick: S[3] || (S[3] = (I) => m.value = !1),
|
|
2675
2675
|
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"
|
|
2676
2676
|
}, " Скасувати "),
|
|
2677
2677
|
l("button", {
|
|
@@ -2941,7 +2941,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
2941
2941
|
}, Zn = {
|
|
2942
2942
|
key: 2,
|
|
2943
2943
|
class: "px-3 py-2 text-xs text-gray-400"
|
|
2944
|
-
}, Wn = /* @__PURE__ */
|
|
2944
|
+
}, Wn = /* @__PURE__ */ D({
|
|
2945
2945
|
__name: "map-search",
|
|
2946
2946
|
props: {
|
|
2947
2947
|
placeholder: { default: "50, 30" }
|
|
@@ -2955,37 +2955,37 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
2955
2955
|
{ value: "atu", label: "АТУ" },
|
|
2956
2956
|
{ value: "address", label: "Адресса" },
|
|
2957
2957
|
{ value: "search_here", label: "Пошук HERE" }
|
|
2958
|
-
], w = F(() => p.find((
|
|
2959
|
-
function b(
|
|
2960
|
-
s.value =
|
|
2958
|
+
], w = F(() => p.find((M) => M.value === s.value)?.label ?? "АТУ");
|
|
2959
|
+
function b(M) {
|
|
2960
|
+
s.value = M.value, n.value = !1, r.value = "", r.value && R();
|
|
2961
2961
|
}
|
|
2962
|
-
function $(
|
|
2963
|
-
|
|
2962
|
+
function $(M) {
|
|
2963
|
+
M.target.closest(".map-search__input") || (n.value = !1);
|
|
2964
2964
|
}
|
|
2965
2965
|
me(() => document.addEventListener("click", $)), Te(() => document.removeEventListener("click", $));
|
|
2966
|
-
async function
|
|
2966
|
+
async function j(M) {
|
|
2967
2967
|
let m;
|
|
2968
2968
|
s.value === "atu" ? m = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? m = "/api/suggest/map.address_id" : s.value === "search_here" && (m = "/api/gis-url-proxy");
|
|
2969
2969
|
const f = new URL(m || "");
|
|
2970
|
-
return s.value === "search_here" ? f.searchParams.set("searchtext",
|
|
2970
|
+
return s.value === "search_here" ? f.searchParams.set("searchtext", M) : (s.value === "atu" || s.value === "address") && f.searchParams.set("key", M), f.searchParams.set("limit", "20"), f.searchParams.set("q", M), (await fetch(f.toString())).json();
|
|
2971
2971
|
}
|
|
2972
2972
|
function R() {
|
|
2973
2973
|
if (i.value = !0, d.value = !0, s.value === "coordinates") {
|
|
2974
|
-
const
|
|
2975
|
-
if (
|
|
2976
|
-
const m = parseFloat(
|
|
2974
|
+
const M = r.value.trim().split(",");
|
|
2975
|
+
if (M.length === 2) {
|
|
2976
|
+
const m = parseFloat(M[0]), f = parseFloat(M[1]);
|
|
2977
2977
|
!Number.isNaN(m) && !Number.isNaN(f) && t("goToCoordinates", [m, f]);
|
|
2978
2978
|
}
|
|
2979
2979
|
return;
|
|
2980
2980
|
}
|
|
2981
2981
|
v && window.clearTimeout(v), v = window.setTimeout(async () => {
|
|
2982
|
-
const
|
|
2983
|
-
if (!
|
|
2982
|
+
const M = r.value.trim();
|
|
2983
|
+
if (!M) {
|
|
2984
2984
|
a.value = [], d.value = !1;
|
|
2985
2985
|
return;
|
|
2986
2986
|
}
|
|
2987
2987
|
try {
|
|
2988
|
-
const m = await
|
|
2988
|
+
const m = await j(M);
|
|
2989
2989
|
a.value = Array.isArray(m.features) ? m.features : [];
|
|
2990
2990
|
} catch {
|
|
2991
2991
|
a.value = [];
|
|
@@ -2994,13 +2994,13 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
2994
2994
|
}
|
|
2995
2995
|
}, 300);
|
|
2996
2996
|
}
|
|
2997
|
-
function
|
|
2997
|
+
function C() {
|
|
2998
2998
|
r.value = "", a.value = [], i.value = !1, d.value = !1;
|
|
2999
2999
|
}
|
|
3000
|
-
function
|
|
3001
|
-
t("goToCoordinates",
|
|
3000
|
+
function E(M) {
|
|
3001
|
+
t("goToCoordinates", M), i.value = !1, d.value = !1, a.value = [];
|
|
3002
3002
|
}
|
|
3003
|
-
return (
|
|
3003
|
+
return (M, m) => (u(), c("div", Bn, [
|
|
3004
3004
|
l("div", jn, [
|
|
3005
3005
|
l("div", In, [
|
|
3006
3006
|
l("div", zn, [
|
|
@@ -3081,11 +3081,11 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3081
3081
|
placeholder: "lat, lng ex. 50, 30",
|
|
3082
3082
|
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"
|
|
3083
3083
|
}, null, 544), [
|
|
3084
|
-
[
|
|
3084
|
+
[se, r.value]
|
|
3085
3085
|
]),
|
|
3086
3086
|
r.value ? (u(), c("button", {
|
|
3087
3087
|
key: 0,
|
|
3088
|
-
onClick:
|
|
3088
|
+
onClick: C,
|
|
3089
3089
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
3090
3090
|
"aria-label": "Очистити",
|
|
3091
3091
|
type: "button"
|
|
@@ -3109,7 +3109,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3109
3109
|
a.value.length ? (u(), c("ul", Gn, [
|
|
3110
3110
|
(u(!0), c(Y, null, oe(a.value, (f) => (u(), c("li", {
|
|
3111
3111
|
key: f.properties.place_id,
|
|
3112
|
-
onClick: (Q) =>
|
|
3112
|
+
onClick: (Q) => E(f),
|
|
3113
3113
|
class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
|
|
3114
3114
|
}, U(f.properties.display_name), 9, Jn))), 128))
|
|
3115
3115
|
])) : d.value ? (u(), c("div", Kn, "Шукаю…")) : (u(), c("div", Zn, "Нічого не знайдено"))
|
|
@@ -3120,7 +3120,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3120
3120
|
])
|
|
3121
3121
|
]));
|
|
3122
3122
|
}
|
|
3123
|
-
}), Qn = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Xn = { class: "flex gap-2" }, Yn = ["onClick", "title"], er = ["src"], tr = /* @__PURE__ */
|
|
3123
|
+
}), Qn = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Xn = { class: "flex gap-2" }, Yn = ["onClick", "title"], er = ["src"], tr = /* @__PURE__ */ D({
|
|
3124
3124
|
__name: "map-layers",
|
|
3125
3125
|
props: {
|
|
3126
3126
|
basemaps: {}
|
|
@@ -3135,7 +3135,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3135
3135
|
l("div", Xn, [
|
|
3136
3136
|
(u(!0), c(Y, null, oe(a.basemaps, (d, v) => (u(), c("div", {
|
|
3137
3137
|
key: v,
|
|
3138
|
-
class:
|
|
3138
|
+
class: V(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === v }]),
|
|
3139
3139
|
onClick: (p) => r(v),
|
|
3140
3140
|
title: d.name || v,
|
|
3141
3141
|
role: "button",
|
|
@@ -3159,7 +3159,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3159
3159
|
}, yr = {
|
|
3160
3160
|
key: 1,
|
|
3161
3161
|
class: "text-xs"
|
|
3162
|
-
}, xr = /* @__PURE__ */
|
|
3162
|
+
}, xr = /* @__PURE__ */ D({
|
|
3163
3163
|
__name: "vs-input-map",
|
|
3164
3164
|
props: {
|
|
3165
3165
|
tools: {},
|
|
@@ -3173,26 +3173,26 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3173
3173
|
},
|
|
3174
3174
|
emits: ["update:modelValue"],
|
|
3175
3175
|
setup(o, { emit: e }) {
|
|
3176
|
-
const t =
|
|
3176
|
+
const t = Et(), n = o, s = e, r = x(null);
|
|
3177
3177
|
let a, i, d;
|
|
3178
|
-
const v = x(null), p = x(null), w = x(6), b = x(0), $ = x(t?.appContext.config.globalProperties.$settings?.center || [50, 30]),
|
|
3179
|
-
let
|
|
3180
|
-
const
|
|
3181
|
-
function
|
|
3178
|
+
const v = x(null), p = x(null), w = x(6), b = x(0), $ = x(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), j = x(null), R = de();
|
|
3179
|
+
let C;
|
|
3180
|
+
const E = x("topo100");
|
|
3181
|
+
function M() {
|
|
3182
3182
|
return new Promise((y, k) => {
|
|
3183
3183
|
window.L && window.L.Draw && y(0);
|
|
3184
|
-
const P = (
|
|
3185
|
-
if (Array.from(document.styleSheets).some((be) => be?.href?.includes(
|
|
3184
|
+
const P = (ne) => {
|
|
3185
|
+
if (Array.from(document.styleSheets).some((be) => be?.href?.includes(ne))) return;
|
|
3186
3186
|
const ge = document.createElement("link");
|
|
3187
|
-
ge.rel = "stylesheet", ge.href =
|
|
3188
|
-
}, J = (
|
|
3189
|
-
const be = Array.from(document.scripts).find((Ce) => Ce.src ===
|
|
3187
|
+
ge.rel = "stylesheet", ge.href = ne, document.head.appendChild(ge);
|
|
3188
|
+
}, J = (ne) => new Promise(($e, ge) => {
|
|
3189
|
+
const be = Array.from(document.scripts).find((Ce) => Ce.src === ne);
|
|
3190
3190
|
if (be) {
|
|
3191
3191
|
be.addEventListener("load", () => $e()), be.addEventListener("error", (Ce) => ge(Ce));
|
|
3192
3192
|
return;
|
|
3193
3193
|
}
|
|
3194
3194
|
const Ve = document.createElement("script");
|
|
3195
|
-
Ve.src =
|
|
3195
|
+
Ve.src = ne, Ve.async = !0, Ve.onload = () => $e(), Ve.onerror = (Ce) => ge(Ce), document.body.appendChild(Ve);
|
|
3196
3196
|
});
|
|
3197
3197
|
P("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), P("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), J("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => J("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => y(0)).catch(k);
|
|
3198
3198
|
});
|
|
@@ -3235,27 +3235,27 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3235
3235
|
function X() {
|
|
3236
3236
|
const y = i.getLayers();
|
|
3237
3237
|
if (!y.length) {
|
|
3238
|
-
|
|
3238
|
+
j.value = null, b.value = 0;
|
|
3239
3239
|
return;
|
|
3240
3240
|
}
|
|
3241
|
-
const k = y[y.length - 1], P = O(k), J = ee(k),
|
|
3242
|
-
|
|
3241
|
+
const k = y[y.length - 1], P = O(k), J = ee(k), ne = ue(k);
|
|
3242
|
+
j.value = {
|
|
3243
3243
|
type: P,
|
|
3244
3244
|
center: J,
|
|
3245
|
-
areaKm2:
|
|
3245
|
+
areaKm2: ne,
|
|
3246
3246
|
layer: k
|
|
3247
3247
|
}, b.value = y.length;
|
|
3248
3248
|
}
|
|
3249
3249
|
function je() {
|
|
3250
|
-
const y =
|
|
3250
|
+
const y = j.value?.layer;
|
|
3251
3251
|
y && (y instanceof L.Circle && y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getBounds ? a.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getLatLng && a.setView(y.getLatLng(), Math.max(w.value, 14)));
|
|
3252
3252
|
}
|
|
3253
3253
|
function we() {
|
|
3254
|
-
const y =
|
|
3254
|
+
const y = j.value?.layer;
|
|
3255
3255
|
y && (i.removeLayer(y), m(), X());
|
|
3256
3256
|
}
|
|
3257
3257
|
me(async () => {
|
|
3258
|
-
await
|
|
3258
|
+
await M(), L.drawLocal = rn, a = L.map(r.value, { zoomControl: !1 }).setView($.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), E.value = Object.keys(R)[0], C = L.tileLayer(R[E.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), i = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (P) => {
|
|
3259
3259
|
const { layer: J } = P;
|
|
3260
3260
|
i.clearLayers(), i.addLayer(J), m(), X(), f(), T.value = "";
|
|
3261
3261
|
}), a.on(L.Draw.Event.EDITED, () => {
|
|
@@ -3275,7 +3275,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3275
3275
|
L.geoJSON(k).eachLayer((J) => P.push(J)), P.length && i.addLayer(P[0]), m(), X(), f();
|
|
3276
3276
|
}
|
|
3277
3277
|
});
|
|
3278
|
-
function
|
|
3278
|
+
function A(y) {
|
|
3279
3279
|
if (a) {
|
|
3280
3280
|
switch (d && d.disable(), y) {
|
|
3281
3281
|
case "marker":
|
|
@@ -3297,7 +3297,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3297
3297
|
d && (d.enable(), T.value = y);
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
3300
|
-
function
|
|
3300
|
+
function S() {
|
|
3301
3301
|
const y = i.toGeoJSON(), k = new Blob([JSON.stringify(y, null, 2)], { type: "application/json" }), P = URL.createObjectURL(k), J = document.createElement("a");
|
|
3302
3302
|
J.href = P, J.download = "data.geojson", J.click(), URL.revokeObjectURL(P);
|
|
3303
3303
|
}
|
|
@@ -3309,8 +3309,8 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3309
3309
|
if (typeof P.result == "string")
|
|
3310
3310
|
try {
|
|
3311
3311
|
const J = JSON.parse(P.result);
|
|
3312
|
-
i.clearLayers(), J && L.geoJSON({ type: "Feature", geometry: J }).eachLayer((
|
|
3313
|
-
i.addLayer(
|
|
3312
|
+
i.clearLayers(), J && L.geoJSON({ type: "Feature", geometry: J }).eachLayer((ne) => {
|
|
3313
|
+
i.addLayer(ne);
|
|
3314
3314
|
}), m(), X(), f();
|
|
3315
3315
|
} finally {
|
|
3316
3316
|
y.target.value = "";
|
|
@@ -3318,7 +3318,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3318
3318
|
}, P.readAsText(k);
|
|
3319
3319
|
}
|
|
3320
3320
|
function G(y) {
|
|
3321
|
-
a && (
|
|
3321
|
+
a && (C && a.removeLayer(C), C = L.tileLayer(R[y].url, { maxZoom: 19, minZoom: 6 }).addTo(a), E.value = y);
|
|
3322
3322
|
}
|
|
3323
3323
|
function ae(y) {
|
|
3324
3324
|
const k = L.latLng(y[0], y[1]);
|
|
@@ -3329,8 +3329,8 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3329
3329
|
(y) => {
|
|
3330
3330
|
console.log("update map"), i.clearLayers(), y && L.geoJSON({ type: "Feature", geometry: y }).eachLayer((k) => {
|
|
3331
3331
|
i.addLayer(k), k.dragging?.enable(), k.dragging?.enabled(), k.on("dragend", (P) => {
|
|
3332
|
-
const
|
|
3333
|
-
s("update:modelValue", { type: "Point", coordinates: [
|
|
3332
|
+
const ne = P.target.getLatLng();
|
|
3333
|
+
s("update:modelValue", { type: "Point", coordinates: [ne.lng, ne.lat] });
|
|
3334
3334
|
});
|
|
3335
3335
|
}), b.value = i.getLayers().length, X(), f();
|
|
3336
3336
|
}
|
|
@@ -3357,7 +3357,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3357
3357
|
a.invalidateSize();
|
|
3358
3358
|
}, 50);
|
|
3359
3359
|
}), (y, k) => (u(), c("div", {
|
|
3360
|
-
class:
|
|
3360
|
+
class: V(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: ke.value }])
|
|
3361
3361
|
}, [
|
|
3362
3362
|
l("div", {
|
|
3363
3363
|
ref_key: "mapContainer",
|
|
@@ -3376,7 +3376,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3376
3376
|
l("button", {
|
|
3377
3377
|
type: "button",
|
|
3378
3378
|
class: "vs-btn-row",
|
|
3379
|
-
onClick:
|
|
3379
|
+
onClick: S,
|
|
3380
3380
|
disabled: b.value === 0
|
|
3381
3381
|
}, "Export ", 8, sr)
|
|
3382
3382
|
]),
|
|
@@ -3393,38 +3393,38 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3393
3393
|
l("div", nr, [
|
|
3394
3394
|
l("div", rr, [
|
|
3395
3395
|
l("button", {
|
|
3396
|
-
class:
|
|
3396
|
+
class: V(["vs-btn", { "vs-active": T.value === "marker" }]),
|
|
3397
3397
|
"aria-pressed": T.value === "marker",
|
|
3398
3398
|
title: "Point (P)",
|
|
3399
3399
|
"aria-label": "Draw point",
|
|
3400
|
-
onClick: k[0] || (k[0] = (P) =>
|
|
3400
|
+
onClick: k[0] || (k[0] = (P) => A("marker"))
|
|
3401
3401
|
}, [
|
|
3402
3402
|
B(fn)
|
|
3403
3403
|
], 10, ir),
|
|
3404
3404
|
l("button", {
|
|
3405
|
-
class:
|
|
3405
|
+
class: V(["vs-btn", { "vs-active": T.value === "polyline" }]),
|
|
3406
3406
|
"aria-pressed": T.value === "polyline",
|
|
3407
3407
|
title: "Line (L)",
|
|
3408
3408
|
"aria-label": "Draw polyline",
|
|
3409
|
-
onClick: k[1] || (k[1] = (P) =>
|
|
3409
|
+
onClick: k[1] || (k[1] = (P) => A("polyline"))
|
|
3410
3410
|
}, [
|
|
3411
3411
|
B(gn)
|
|
3412
3412
|
], 10, ur),
|
|
3413
3413
|
l("button", {
|
|
3414
|
-
class:
|
|
3414
|
+
class: V(["vs-btn", { "vs-active": T.value === "polygon" }]),
|
|
3415
3415
|
"aria-pressed": T.value === "polygon",
|
|
3416
3416
|
title: "Polygon (G)",
|
|
3417
3417
|
"aria-label": "Draw polygon",
|
|
3418
|
-
onClick: k[2] || (k[2] = (P) =>
|
|
3418
|
+
onClick: k[2] || (k[2] = (P) => A("polygon"))
|
|
3419
3419
|
}, [
|
|
3420
3420
|
B(wn)
|
|
3421
3421
|
], 10, dr),
|
|
3422
3422
|
l("button", {
|
|
3423
|
-
class:
|
|
3423
|
+
class: V(["vs-btn", { "vs-active": T.value === "rectangle" }]),
|
|
3424
3424
|
"aria-pressed": T.value === "rectangle",
|
|
3425
3425
|
title: "Rectangle (R)",
|
|
3426
3426
|
"aria-label": "Draw rectangle",
|
|
3427
|
-
onClick: k[3] || (k[3] = (P) =>
|
|
3427
|
+
onClick: k[3] || (k[3] = (P) => A("rectangle"))
|
|
3428
3428
|
}, [
|
|
3429
3429
|
B(Vn)
|
|
3430
3430
|
], 10, cr),
|
|
@@ -3441,7 +3441,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3441
3441
|
])
|
|
3442
3442
|
]),
|
|
3443
3443
|
l("div", {
|
|
3444
|
-
class:
|
|
3444
|
+
class: V(["absolute left-4 z-[1000]", j.value ? "bottom-8" : "bottom-4"])
|
|
3445
3445
|
}, [
|
|
3446
3446
|
B(tr, {
|
|
3447
3447
|
basemaps: q(R),
|
|
@@ -3449,21 +3449,21 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3449
3449
|
}, null, 8, ["basemaps"])
|
|
3450
3450
|
], 2),
|
|
3451
3451
|
l("div", pr, [
|
|
3452
|
-
|
|
3452
|
+
j.value ? (u(), c("div", fr, [
|
|
3453
3453
|
l("div", vr, [
|
|
3454
|
-
k[7] || (k[7] = fe(" Тип: "
|
|
3455
|
-
l("span", mr, U(
|
|
3454
|
+
k[7] || (k[7] = fe(" Тип: ")),
|
|
3455
|
+
l("span", mr, U(j.value.type), 1)
|
|
3456
3456
|
]),
|
|
3457
3457
|
l("div", hr, [
|
|
3458
3458
|
l("div", gr, [
|
|
3459
|
-
k[8] || (k[8] = fe(" Центр: "
|
|
3460
|
-
l("b", null, U(
|
|
3459
|
+
k[8] || (k[8] = fe(" Центр: ")),
|
|
3460
|
+
l("b", null, U(j.value.center.lat.toFixed(5)) + ", " + U(j.value.center.lng.toFixed(5)), 1)
|
|
3461
3461
|
]),
|
|
3462
|
-
|
|
3463
|
-
k[9] || (k[9] = fe(" Площа: "
|
|
3464
|
-
l("b", null, U(
|
|
3462
|
+
j.value.areaKm2 !== null ? (u(), c("div", br, [
|
|
3463
|
+
k[9] || (k[9] = fe(" Площа: ")),
|
|
3464
|
+
l("b", null, U(j.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3465
3465
|
])) : (u(), c("div", yr, k[10] || (k[10] = [
|
|
3466
|
-
fe(" Площа: "
|
|
3466
|
+
fe(" Площа: "),
|
|
3467
3467
|
l("b", null, "—", -1)
|
|
3468
3468
|
]))),
|
|
3469
3469
|
l("button", {
|
|
@@ -3488,7 +3488,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3488
3488
|
}), wr = /* @__PURE__ */ N(xr, [["__scopeId", "data-v-5a4c21a7"]]), kr = ["data-focus"], _r = { class: "flex items-center" }, $r = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Vr = ["onClick", "aria-label"], Cr = {
|
|
3489
3489
|
key: 0,
|
|
3490
3490
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3491
|
-
}, Mr = { class: "flex-1 min-w-[2px]" }, Lr = ["placeholder"], Sr = { class: "flex items-center shrink-0" }, Br = ["disabled"], jr = /* @__PURE__ */
|
|
3491
|
+
}, Mr = { class: "flex-1 min-w-[2px]" }, Lr = ["placeholder"], Sr = { class: "flex items-center shrink-0" }, Br = ["disabled"], jr = /* @__PURE__ */ D({
|
|
3492
3492
|
__name: "vs-input-tag",
|
|
3493
3493
|
props: /* @__PURE__ */ Z({
|
|
3494
3494
|
unique: { type: Boolean, default: !0 },
|
|
@@ -3507,18 +3507,18 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3507
3507
|
setup(o, { emit: e }) {
|
|
3508
3508
|
const t = o, n = e;
|
|
3509
3509
|
he(t.style);
|
|
3510
|
-
const s = x(null), r = x(null), a = x(null), i = x(!1), d = x(""), v = W(o, "modelValue"), p = F(() => t.placeholder || "Add tag…"), w = F(() => v.value?.length === 0 && d.value === ""), b = F(() => !t.disabled && v.value?.length > 0), $ = F(() => t.disabled),
|
|
3510
|
+
const s = x(null), r = x(null), a = x(null), i = x(!1), d = x(""), v = W(o, "modelValue"), p = F(() => t.placeholder || "Add tag…"), w = F(() => v.value?.length === 0 && d.value === ""), b = F(() => !t.disabled && v.value?.length > 0), $ = F(() => t.disabled), j = async () => {
|
|
3511
3511
|
$.value || await ze(() => a.value?.focus());
|
|
3512
3512
|
}, R = (T) => {
|
|
3513
3513
|
const O = T.trim();
|
|
3514
3514
|
O !== "" && (!v.value || !Array.isArray(v.value) ? v.value = [O] : t.unique ? v.value.includes(O) || (v.value = [...v.value, O]) : v.value = [...v.value, O], d.value = "");
|
|
3515
|
-
},
|
|
3515
|
+
}, C = () => {
|
|
3516
3516
|
const T = d.value;
|
|
3517
3517
|
T.trim() !== "" && R(T), d.value = "";
|
|
3518
|
-
},
|
|
3518
|
+
}, E = (T) => {
|
|
3519
3519
|
const O = v.value.slice();
|
|
3520
3520
|
O.splice(T, 1), n("update:modelValue", O);
|
|
3521
|
-
},
|
|
3521
|
+
}, M = () => {
|
|
3522
3522
|
n("update:modelValue", []);
|
|
3523
3523
|
}, m = () => {
|
|
3524
3524
|
$.value || (i.value = !0);
|
|
@@ -3526,7 +3526,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3526
3526
|
i.value = !1;
|
|
3527
3527
|
}, Q = (T) => {
|
|
3528
3528
|
const { key: O } = T;
|
|
3529
|
-
O === "Enter" ? (T.preventDefault(),
|
|
3529
|
+
O === "Enter" ? (T.preventDefault(), C()) : O === "Backspace" && d.value === "" && v.value.length > 0 && E(v.value.length - 1);
|
|
3530
3530
|
};
|
|
3531
3531
|
return (T, O) => (u(), c("div", {
|
|
3532
3532
|
class: "flex gap-1 w-full",
|
|
@@ -3536,19 +3536,19 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3536
3536
|
}, ["stop"]))
|
|
3537
3537
|
}, [
|
|
3538
3538
|
l("div", {
|
|
3539
|
-
class:
|
|
3539
|
+
class: V(["relative w-full font-sans", t.customClass]),
|
|
3540
3540
|
role: "group",
|
|
3541
3541
|
"aria-label": "Tag input"
|
|
3542
3542
|
}, [
|
|
3543
3543
|
l("div", {
|
|
3544
|
-
class:
|
|
3544
|
+
class: V([
|
|
3545
3545
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
3546
3546
|
"border-gray-300 hover:border-gray-400",
|
|
3547
3547
|
i.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
3548
3548
|
$.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3549
3549
|
]),
|
|
3550
3550
|
"data-focus": i.value ? "true" : "false",
|
|
3551
|
-
onClick:
|
|
3551
|
+
onClick: j
|
|
3552
3552
|
}, [
|
|
3553
3553
|
l("div", {
|
|
3554
3554
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
@@ -3565,7 +3565,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3565
3565
|
l("div", {
|
|
3566
3566
|
role: "button",
|
|
3567
3567
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3568
|
-
onClick: ve((X) =>
|
|
3568
|
+
onClick: ve((X) => E(ee), ["stop"]),
|
|
3569
3569
|
"aria-label": `Remove ${ue}`
|
|
3570
3570
|
}, O[2] || (O[2] = [
|
|
3571
3571
|
l("svg", {
|
|
@@ -3600,7 +3600,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3600
3600
|
onKeydown: Q,
|
|
3601
3601
|
placeholder: v.value && v.value.length ? "" : void 0
|
|
3602
3602
|
}, null, 40, Lr)), [
|
|
3603
|
-
[
|
|
3603
|
+
[se, d.value]
|
|
3604
3604
|
])
|
|
3605
3605
|
])
|
|
3606
3606
|
], 512),
|
|
@@ -3611,7 +3611,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3611
3611
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3612
3612
|
"aria-label": "Clear all tags",
|
|
3613
3613
|
disabled: $.value,
|
|
3614
|
-
onClick: ve(
|
|
3614
|
+
onClick: ve(M, ["stop"])
|
|
3615
3615
|
}, O[3] || (O[3] = [
|
|
3616
3616
|
l("svg", {
|
|
3617
3617
|
height: "20",
|
|
@@ -3627,7 +3627,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3627
3627
|
], 2)
|
|
3628
3628
|
], 512));
|
|
3629
3629
|
}
|
|
3630
|
-
}), Ir = { class: "relative flex gap-1 bg-white w-full" }, zr = ["disabled", "placeholder"], Er = /* @__PURE__ */
|
|
3630
|
+
}), Ir = { class: "relative flex gap-1 bg-white w-full" }, zr = ["disabled", "placeholder"], Er = /* @__PURE__ */ D({
|
|
3631
3631
|
__name: "vs-input-slug",
|
|
3632
3632
|
props: /* @__PURE__ */ Z({
|
|
3633
3633
|
disabled: { type: Boolean },
|
|
@@ -3694,7 +3694,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3694
3694
|
"onUpdate:modelValue": i[0] || (i[0] = (d) => n.value = d),
|
|
3695
3695
|
class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
3696
3696
|
}, null, 8, zr), [
|
|
3697
|
-
[
|
|
3697
|
+
[se, n.value]
|
|
3698
3698
|
]),
|
|
3699
3699
|
l("button", {
|
|
3700
3700
|
class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
|
|
@@ -3708,7 +3708,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3708
3708
|
}, Or = ["onDragstart", "onDrop"], Ur = { class: "w-1/3" }, Tr = { class: "w-2/3" }, Rr = ["onClick"], Pr = {
|
|
3709
3709
|
key: 0,
|
|
3710
3710
|
class: "text-[14px] text-gray-700"
|
|
3711
|
-
}, Hr = { class: "mt-2 w-full flex items-center" }, Nr = ["disabled"], qr = /* @__PURE__ */
|
|
3711
|
+
}, Hr = { class: "mt-2 w-full flex items-center" }, Nr = ["disabled"], qr = /* @__PURE__ */ D({
|
|
3712
3712
|
__name: "vs-input-key-value",
|
|
3713
3713
|
props: {
|
|
3714
3714
|
parent: {},
|
|
@@ -3718,77 +3718,77 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3718
3718
|
},
|
|
3719
3719
|
emits: ["update:modelValue"],
|
|
3720
3720
|
setup(o, { emit: e }) {
|
|
3721
|
-
const t = (
|
|
3721
|
+
const t = (C) => `${C}-${Math.random().toString(36).substring(2, 15)}`, n = Me("values"), s = o, r = e, a = s.addButtonText ?? "Додати", i = s.ignore ?? [], d = x([]), v = x(null);
|
|
3722
3722
|
(() => {
|
|
3723
|
-
const
|
|
3724
|
-
d.value = Object.entries(
|
|
3723
|
+
const C = s.parent && n?.value?.[s.parent] || s.modelValue || {};
|
|
3724
|
+
d.value = Object.entries(C).filter(([E]) => !i.includes(E)).map(([E, M]) => ({
|
|
3725
3725
|
id: t("key-value-"),
|
|
3726
|
-
key:
|
|
3727
|
-
value:
|
|
3726
|
+
key: E,
|
|
3727
|
+
value: M
|
|
3728
3728
|
}));
|
|
3729
3729
|
})();
|
|
3730
|
-
function w(
|
|
3731
|
-
v.value =
|
|
3730
|
+
function w(C) {
|
|
3731
|
+
v.value = C;
|
|
3732
3732
|
}
|
|
3733
|
-
function b(
|
|
3734
|
-
if (v.value === null || v.value ===
|
|
3735
|
-
const
|
|
3736
|
-
d.value.splice(
|
|
3733
|
+
function b(C) {
|
|
3734
|
+
if (v.value === null || v.value === C) return;
|
|
3735
|
+
const E = d.value.splice(v.value, 1)[0];
|
|
3736
|
+
d.value.splice(C, 0, E), v.value = null;
|
|
3737
3737
|
}
|
|
3738
3738
|
const $ = F(
|
|
3739
|
-
() => d.value.some((
|
|
3740
|
-
),
|
|
3739
|
+
() => d.value.some((C) => C.key && !C.value || !C.key && C.value)
|
|
3740
|
+
), j = () => {
|
|
3741
3741
|
d.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
3742
|
-
}, R = (
|
|
3743
|
-
d.value = d.value.filter((
|
|
3742
|
+
}, R = (C) => {
|
|
3743
|
+
d.value = d.value.filter((E) => E.id !== C);
|
|
3744
3744
|
};
|
|
3745
3745
|
return le(
|
|
3746
3746
|
d,
|
|
3747
|
-
(
|
|
3748
|
-
const
|
|
3749
|
-
|
|
3750
|
-
m.key && m.value !== void 0 && (
|
|
3747
|
+
(C) => {
|
|
3748
|
+
const E = {};
|
|
3749
|
+
C.forEach((m) => {
|
|
3750
|
+
m.key && m.value !== void 0 && (E[m.key] = m.value);
|
|
3751
3751
|
});
|
|
3752
|
-
const
|
|
3752
|
+
const M = {};
|
|
3753
3753
|
i.length && i.forEach((m) => {
|
|
3754
|
-
|
|
3754
|
+
M[m] = s.parent ? n?.value?.[s.parent]?.[m] : void 0;
|
|
3755
3755
|
}), n?.value && s.parent && (n.value[s.parent] = {
|
|
3756
|
-
...
|
|
3757
|
-
...
|
|
3758
|
-
}), r("update:modelValue",
|
|
3756
|
+
...M,
|
|
3757
|
+
...E
|
|
3758
|
+
}), r("update:modelValue", E);
|
|
3759
3759
|
},
|
|
3760
3760
|
{ deep: !0 }
|
|
3761
|
-
), (
|
|
3761
|
+
), (C, E) => (u(), c("div", Dr, [
|
|
3762
3762
|
l("div", Fr, [
|
|
3763
|
-
(u(!0), c(Y, null, oe(d.value, (
|
|
3764
|
-
key:
|
|
3765
|
-
class:
|
|
3763
|
+
(u(!0), c(Y, null, oe(d.value, (M, m) => (u(), c("div", {
|
|
3764
|
+
key: M.id,
|
|
3765
|
+
class: V(["flex items-center gap-2 w-full", { "opacity-50": v.value === m }]),
|
|
3766
3766
|
draggable: "true",
|
|
3767
3767
|
onDragstart: (f) => w(m),
|
|
3768
|
-
onDragover:
|
|
3768
|
+
onDragover: E[0] || (E[0] = ve(() => {
|
|
3769
3769
|
}, ["prevent"])),
|
|
3770
3770
|
onDrop: (f) => b(m)
|
|
3771
3771
|
}, [
|
|
3772
|
-
|
|
3772
|
+
E[1] || (E[1] = ce('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>', 1)),
|
|
3773
3773
|
l("div", Ur, [
|
|
3774
3774
|
B(Ue, {
|
|
3775
|
-
modelValue:
|
|
3776
|
-
"onUpdate:modelValue": (f) =>
|
|
3775
|
+
modelValue: M.key,
|
|
3776
|
+
"onUpdate:modelValue": (f) => M.key = f,
|
|
3777
3777
|
placeholder: "Ключ"
|
|
3778
3778
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3779
3779
|
]),
|
|
3780
3780
|
l("div", Tr, [
|
|
3781
3781
|
B(Ue, {
|
|
3782
|
-
modelValue:
|
|
3783
|
-
"onUpdate:modelValue": (f) =>
|
|
3782
|
+
modelValue: M.value,
|
|
3783
|
+
"onUpdate:modelValue": (f) => M.value = f,
|
|
3784
3784
|
placeholder: "Значення"
|
|
3785
3785
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3786
3786
|
]),
|
|
3787
3787
|
l("button", {
|
|
3788
|
-
onClick: (f) => R(
|
|
3788
|
+
onClick: (f) => R(M.id),
|
|
3789
3789
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
|
|
3790
3790
|
}, [
|
|
3791
|
-
B(q(
|
|
3791
|
+
B(q(jl), {
|
|
3792
3792
|
height: "16",
|
|
3793
3793
|
width: "16"
|
|
3794
3794
|
})
|
|
@@ -3799,7 +3799,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3799
3799
|
l("div", Hr, [
|
|
3800
3800
|
l("button", {
|
|
3801
3801
|
type: "button",
|
|
3802
|
-
onClick:
|
|
3802
|
+
onClick: j,
|
|
3803
3803
|
disabled: $.value,
|
|
3804
3804
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
3805
3805
|
}, [
|
|
@@ -3812,7 +3812,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3812
3812
|
])
|
|
3813
3813
|
]));
|
|
3814
3814
|
}
|
|
3815
|
-
}), Gr = /* @__PURE__ */ N(qr, [["__scopeId", "data-v-a0f7fbfc"]]), Jr = { class: "flex items-center gap-2 w-full" }, Kr = ["disabled"], Zr = /* @__PURE__ */
|
|
3815
|
+
}), Gr = /* @__PURE__ */ N(qr, [["__scopeId", "data-v-a0f7fbfc"]]), Jr = { class: "flex items-center gap-2 w-full" }, Kr = ["disabled"], Zr = /* @__PURE__ */ D({
|
|
3816
3816
|
__name: "vs-input-color",
|
|
3817
3817
|
props: {
|
|
3818
3818
|
style: { default: () => ({}) },
|
|
@@ -3835,20 +3835,20 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3835
3835
|
"onUpdate:modelValue": i[0] || (i[0] = (d) => r.value = d),
|
|
3836
3836
|
disabled: a.disabled,
|
|
3837
3837
|
ref: "color",
|
|
3838
|
-
class:
|
|
3838
|
+
class: V(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")]),
|
|
3839
3839
|
style: { border: "1px solid #CFD9E0" }
|
|
3840
3840
|
}, null, 10, Kr), [
|
|
3841
|
-
[
|
|
3841
|
+
[se, r.value]
|
|
3842
3842
|
]),
|
|
3843
3843
|
K(l("input", {
|
|
3844
3844
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
|
|
3845
3845
|
"onUpdate:modelValue": i[1] || (i[1] = (d) => r.value = d)
|
|
3846
3846
|
}, null, 512), [
|
|
3847
|
-
[
|
|
3847
|
+
[se, r.value]
|
|
3848
3848
|
])
|
|
3849
3849
|
]));
|
|
3850
3850
|
}
|
|
3851
|
-
}), Wr = { class: "flex items-center gap-2 w-full" }, Qr = ["min", "max", "step", "disabled"], Xr = /* @__PURE__ */
|
|
3851
|
+
}), Wr = { class: "flex items-center gap-2 w-full" }, Qr = ["min", "max", "step", "disabled"], Xr = /* @__PURE__ */ D({
|
|
3852
3852
|
__name: "vs-input-range",
|
|
3853
3853
|
props: {
|
|
3854
3854
|
style: { default: () => ({}) },
|
|
@@ -3877,16 +3877,16 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3877
3877
|
step: a.step,
|
|
3878
3878
|
disabled: a.disabled,
|
|
3879
3879
|
ref: "range",
|
|
3880
|
-
class:
|
|
3880
|
+
class: V(["w-full cursor-pointer accent-blue-500", [a.modelValue ? "" : "text-opacity-50", q(n)].join(" ")])
|
|
3881
3881
|
}, null, 10, Qr), [
|
|
3882
|
-
[
|
|
3882
|
+
[se, r.value]
|
|
3883
3883
|
]),
|
|
3884
3884
|
K(l("input", {
|
|
3885
3885
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
|
|
3886
3886
|
type: "number",
|
|
3887
3887
|
"onUpdate:modelValue": i[1] || (i[1] = (d) => r.value = d)
|
|
3888
3888
|
}, null, 512), [
|
|
3889
|
-
[
|
|
3889
|
+
[se, r.value]
|
|
3890
3890
|
])
|
|
3891
3891
|
]));
|
|
3892
3892
|
}
|
|
@@ -3894,29 +3894,30 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3894
3894
|
VsInputText: Ue,
|
|
3895
3895
|
VsInputRadio: rt,
|
|
3896
3896
|
"vs-input-text": Ue,
|
|
3897
|
-
"vs-input-password":
|
|
3897
|
+
"vs-input-password": sl,
|
|
3898
3898
|
"vs-input-textarea": ss,
|
|
3899
|
-
"vs-input-mask":
|
|
3900
|
-
"vs-input-number":
|
|
3899
|
+
"vs-input-mask": Pl,
|
|
3900
|
+
"vs-input-number": il,
|
|
3901
3901
|
"vs-input-radio": rt,
|
|
3902
|
-
"vs-input-select":
|
|
3903
|
-
"vs-input-switcher":
|
|
3902
|
+
"vs-input-select": dt,
|
|
3903
|
+
"vs-input-switcher": yt,
|
|
3904
3904
|
"vs-input-static": nt,
|
|
3905
|
-
"vs-input-container":
|
|
3906
|
-
"vs-input-date":
|
|
3907
|
-
"vs-input-checkbox":
|
|
3908
|
-
"vs-input-file":
|
|
3905
|
+
"vs-input-container": Ha,
|
|
3906
|
+
"vs-input-date": lo,
|
|
3907
|
+
"vs-input-checkbox": eo,
|
|
3908
|
+
"vs-input-file": Po,
|
|
3909
3909
|
"vs-input-html": nt,
|
|
3910
|
-
"vs-input-email":
|
|
3910
|
+
"vs-input-email": ql,
|
|
3911
3911
|
"vs-input-datatable": nn,
|
|
3912
3912
|
"vs-input-map": wr,
|
|
3913
|
-
"vs-input-file-list":
|
|
3913
|
+
"vs-input-file-list": ba,
|
|
3914
3914
|
"vs-input-tag": jr,
|
|
3915
3915
|
"vs-input-slug": Ar,
|
|
3916
3916
|
"vs-input-key-value": Gr,
|
|
3917
3917
|
"vs-input-range": Xr,
|
|
3918
|
-
"vs-input-color": Zr
|
|
3919
|
-
|
|
3918
|
+
"vs-input-color": Zr,
|
|
3919
|
+
"vs-input-native-select": dt
|
|
3920
|
+
}, ei = /* @__PURE__ */ D({
|
|
3920
3921
|
__name: "behavior",
|
|
3921
3922
|
props: {
|
|
3922
3923
|
api: {},
|
|
@@ -3948,7 +3949,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3948
3949
|
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"
|
|
3949
3950
|
}, U(s.button), 1));
|
|
3950
3951
|
}
|
|
3951
|
-
}),
|
|
3952
|
+
}), kt = /* @__PURE__ */ D({
|
|
3952
3953
|
__name: "vs-compact-form-layout",
|
|
3953
3954
|
props: /* @__PURE__ */ Z({
|
|
3954
3955
|
item: { default: {} },
|
|
@@ -3962,7 +3963,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3962
3963
|
}),
|
|
3963
3964
|
emits: ["update:modelValue"],
|
|
3964
3965
|
setup(o) {
|
|
3965
|
-
const e = o, t = W(o, "modelValue"), n = F(() =>
|
|
3966
|
+
const e = o, t = W(o, "modelValue"), n = F(() => ol[`${e.layout}`]), s = F(() => Yr?.[`vs-input-${e.item.type}`]), r = F(() => {
|
|
3966
3967
|
const i = q(s);
|
|
3967
3968
|
if (!i) return /* @__PURE__ */ new Set();
|
|
3968
3969
|
const d = i.props ?? i.__vccOpts?.props;
|
|
@@ -3973,7 +3974,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3973
3974
|
const i = e.item ?? {}, d = r.value;
|
|
3974
3975
|
return d.size ? Object.fromEntries(Object.entries(i).filter(([v]) => d.has(v))) : {};
|
|
3975
3976
|
});
|
|
3976
|
-
return (i, d) => (u(),
|
|
3977
|
+
return (i, d) => (u(), ie(Be(n.value), {
|
|
3977
3978
|
ua: e.item.ua,
|
|
3978
3979
|
error: e.error || "",
|
|
3979
3980
|
item: i.item,
|
|
@@ -3981,22 +3982,22 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
3981
3982
|
}, {
|
|
3982
3983
|
default: Le(() => [
|
|
3983
3984
|
l("div", {
|
|
3984
|
-
class:
|
|
3985
|
+
class: V(["flex w-full", `${e.item.type}-component`])
|
|
3985
3986
|
}, [
|
|
3986
|
-
(u(),
|
|
3987
|
+
(u(), ie(Be(s.value), Ee(a.value, {
|
|
3987
3988
|
modelValue: t.value,
|
|
3988
3989
|
"onUpdate:modelValue": d[0] || (d[0] = (v) => t.value = v)
|
|
3989
3990
|
}), null, 16, ["modelValue"])),
|
|
3990
|
-
i.item.behavior?.api && i.item.behavior?.button ? (u(),
|
|
3991
|
+
i.item.behavior?.api && i.item.behavior?.button ? (u(), ie(ei, Ee({ key: 0 }, i.item.behavior, { value: t.value }), null, 16, ["value"])) : z("", !0)
|
|
3991
3992
|
], 2)
|
|
3992
3993
|
]),
|
|
3993
3994
|
_: 1
|
|
3994
3995
|
}, 8, ["ua", "error", "item", "label"]));
|
|
3995
3996
|
}
|
|
3996
|
-
}),
|
|
3997
|
+
}), _t = {
|
|
3997
3998
|
required: "Це поле є обов’язковим",
|
|
3998
3999
|
email: "Неправильний email"
|
|
3999
|
-
}, ti = (o) => o ? !1 :
|
|
4000
|
+
}, ti = (o) => o ? !1 : _t.required, li = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? _t.email : !1, oi = (o, e) => {
|
|
4000
4001
|
const t = e.pattern ?? e.regexp;
|
|
4001
4002
|
return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
|
|
4002
4003
|
}, ai = (o, e) => !1, si = (o, e) => {
|
|
@@ -4024,7 +4025,7 @@ const Sn = /* @__PURE__ */ N(Cn, [["render", Ln]]), Bn = { class: "form-geom__se
|
|
|
4024
4025
|
file: "file"
|
|
4025
4026
|
// mask: 'text',
|
|
4026
4027
|
};
|
|
4027
|
-
function
|
|
4028
|
+
function pt(o) {
|
|
4028
4029
|
const e = o.toLowerCase();
|
|
4029
4030
|
return ni[e] || e;
|
|
4030
4031
|
}
|
|
@@ -4033,7 +4034,7 @@ function ri(o) {
|
|
|
4033
4034
|
const t = [];
|
|
4034
4035
|
return o.forEach((n) => {
|
|
4035
4036
|
const s = { ...n };
|
|
4036
|
-
s.name = (n.name || n.id || n.key || "").toString(), s.type =
|
|
4037
|
+
s.name = (n.name || n.id || n.key || "").toString(), s.type = pt(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);
|
|
4037
4038
|
}), t;
|
|
4038
4039
|
}
|
|
4039
4040
|
const e = [];
|
|
@@ -4041,7 +4042,7 @@ function ri(o) {
|
|
|
4041
4042
|
const n = {
|
|
4042
4043
|
name: t[0],
|
|
4043
4044
|
...t[1],
|
|
4044
|
-
type:
|
|
4045
|
+
type: pt(t[1].type),
|
|
4045
4046
|
label: t[1].label || t[1].ua,
|
|
4046
4047
|
rules: t[1].rules || t[1].validators
|
|
4047
4048
|
};
|
|
@@ -4054,7 +4055,7 @@ function ii(o, e) {
|
|
|
4054
4055
|
const v = d?.conditions;
|
|
4055
4056
|
if (!v) return !0;
|
|
4056
4057
|
const p = Array.isArray(v) ? v[0] : v, w = o?.value?.[p];
|
|
4057
|
-
return
|
|
4058
|
+
return wt(w, v);
|
|
4058
4059
|
}
|
|
4059
4060
|
const r = (d = t, v = !0) => (d.forEach((p) => {
|
|
4060
4061
|
if (p.rules) {
|
|
@@ -4078,7 +4079,12 @@ function ii(o, e) {
|
|
|
4078
4079
|
visibleSchema: a
|
|
4079
4080
|
};
|
|
4080
4081
|
}
|
|
4081
|
-
const
|
|
4082
|
+
const ui = {
|
|
4083
|
+
key: 0,
|
|
4084
|
+
"data-orientation": "horizontal",
|
|
4085
|
+
role: "none",
|
|
4086
|
+
class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
|
|
4087
|
+
}, De = /* @__PURE__ */ D({
|
|
4082
4088
|
__name: "vs-compact-form",
|
|
4083
4089
|
props: /* @__PURE__ */ Z({
|
|
4084
4090
|
schema: { default: () => [] },
|
|
@@ -4109,32 +4115,36 @@ const De = /* @__PURE__ */ A({
|
|
|
4109
4115
|
}), me(() => {
|
|
4110
4116
|
s.modelValue && (a.value = s.modelValue), r.value.value = a.value, r.value.errors = i.value, r.value.reset = v, r.value.validate = d, r.value.formId = s.formId;
|
|
4111
4117
|
});
|
|
4112
|
-
function b($,
|
|
4113
|
-
if ($ ===
|
|
4114
|
-
if (typeof $ != "object" || typeof
|
|
4115
|
-
const R = Object.keys($),
|
|
4116
|
-
return R.length !==
|
|
4118
|
+
function b($, j) {
|
|
4119
|
+
if ($ === j) return !0;
|
|
4120
|
+
if (typeof $ != "object" || typeof j != "object" || !$ || !j) return !1;
|
|
4121
|
+
const R = Object.keys($), C = Object.keys(j);
|
|
4122
|
+
return R.length !== C.length ? !1 : R.every((E) => $[E] === j[E]);
|
|
4117
4123
|
}
|
|
4118
|
-
return st("form", r), st("values", a), ($,
|
|
4124
|
+
return st("form", r), st("values", a), ($, j) => (u(), c("form", {
|
|
4119
4125
|
onSubmit: ve(w, ["prevent"]),
|
|
4120
|
-
class:
|
|
4126
|
+
class: V(["grid grid-cols-12", $.layout === "default" ? "gap-6" : "gap-4"])
|
|
4121
4127
|
}, [
|
|
4122
|
-
(u(!0), c(Y, null, oe(q(p), (R) => (u(),
|
|
4128
|
+
(u(!0), c(Y, null, oe(q(p), (R, C) => (u(), c("div", {
|
|
4123
4129
|
key: R.name,
|
|
4124
|
-
class:
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4130
|
+
class: V($.layout === "horizontal" ? "col-span-12" : `col-span-${R.col || 12}`)
|
|
4131
|
+
}, [
|
|
4132
|
+
B(kt, {
|
|
4133
|
+
style: xe($.style),
|
|
4134
|
+
item: R,
|
|
4135
|
+
layout: $.layout,
|
|
4136
|
+
"model-value": a.value[R.name],
|
|
4137
|
+
"onUpdate:modelValue": (E) => {
|
|
4138
|
+
const M = a.value[R.name];
|
|
4139
|
+
b(M, E) || (a.value[R.name] = E);
|
|
4140
|
+
},
|
|
4141
|
+
error: q(i)[R.name]
|
|
4142
|
+
}, null, 8, ["style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]),
|
|
4143
|
+
$.layout === "settings" && C + 1 !== q(p).length ? (u(), c("div", ui)) : z("", !0)
|
|
4144
|
+
], 2))), 128))
|
|
4135
4145
|
], 34));
|
|
4136
4146
|
}
|
|
4137
|
-
}),
|
|
4147
|
+
}), di = { class: "relative" }, ci = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, pi = { 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" }, fi = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, vi = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, mi = { class: "p-4 mim-h-0 h-full overflow-auto" }, hi = /* @__PURE__ */ D({
|
|
4138
4148
|
__name: "modal-edit",
|
|
4139
4149
|
props: {
|
|
4140
4150
|
schema: {},
|
|
@@ -4204,11 +4214,11 @@ const De = /* @__PURE__ */ A({
|
|
|
4204
4214
|
const w = await fetch(`/api/form/${i.value}`).then((b) => b.json());
|
|
4205
4215
|
s.value = w.schema, w.data ? r.value = w.data : d.value = "add";
|
|
4206
4216
|
}
|
|
4207
|
-
}), (w, b) => (u(), c("div",
|
|
4208
|
-
l("div",
|
|
4209
|
-
l("div",
|
|
4210
|
-
l("div",
|
|
4211
|
-
l("h3",
|
|
4217
|
+
}), (w, b) => (u(), c("div", di, [
|
|
4218
|
+
l("div", ci, [
|
|
4219
|
+
l("div", pi, [
|
|
4220
|
+
l("div", fi, [
|
|
4221
|
+
l("h3", vi, U(d.value === "add" ? "Додати" : "Змінити"), 1),
|
|
4212
4222
|
l("button", {
|
|
4213
4223
|
onClick: p,
|
|
4214
4224
|
type: "button",
|
|
@@ -4232,8 +4242,8 @@ const De = /* @__PURE__ */ A({
|
|
|
4232
4242
|
], -1)
|
|
4233
4243
|
]))
|
|
4234
4244
|
]),
|
|
4235
|
-
l("div",
|
|
4236
|
-
s.value ? (u(),
|
|
4245
|
+
l("div", mi, [
|
|
4246
|
+
s.value ? (u(), ie(De, {
|
|
4237
4247
|
key: 0,
|
|
4238
4248
|
schema: s.value,
|
|
4239
4249
|
values: r.value,
|
|
@@ -4258,14 +4268,14 @@ const De = /* @__PURE__ */ A({
|
|
|
4258
4268
|
])
|
|
4259
4269
|
]));
|
|
4260
4270
|
}
|
|
4261
|
-
}),
|
|
4262
|
-
const { close: t } =
|
|
4271
|
+
}), ft = (o = { mode: "edit", schema: null }) => new Promise((e) => {
|
|
4272
|
+
const { close: t } = At({
|
|
4263
4273
|
title: o.mode === "add" ? "Додати" : "Редагувати",
|
|
4264
4274
|
template: "",
|
|
4265
4275
|
visible: !0,
|
|
4266
4276
|
size: "medium",
|
|
4267
4277
|
closeClickBack: !0,
|
|
4268
|
-
content:
|
|
4278
|
+
content: hi,
|
|
4269
4279
|
contentProps: {
|
|
4270
4280
|
...o,
|
|
4271
4281
|
onClose: () => {
|
|
@@ -4279,28 +4289,28 @@ const De = /* @__PURE__ */ A({
|
|
|
4279
4289
|
});
|
|
4280
4290
|
De.install = function(e) {
|
|
4281
4291
|
e.component("VForm", De), Object.assign(e.config.globalProperties, {
|
|
4282
|
-
$form:
|
|
4283
|
-
}), e.provide("form",
|
|
4292
|
+
$form: ft
|
|
4293
|
+
}), e.provide("form", ft), window.v3plugin || (window.v3plugin = {});
|
|
4284
4294
|
};
|
|
4285
4295
|
export {
|
|
4286
|
-
|
|
4296
|
+
hi as ModalEdit,
|
|
4287
4297
|
De as VForm,
|
|
4288
|
-
|
|
4298
|
+
eo as VsInputCheckbox,
|
|
4289
4299
|
Zr as VsInputColor,
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4300
|
+
Ha as VsInputContainer,
|
|
4301
|
+
lo as VsInputDate,
|
|
4302
|
+
ql as VsInputEmail,
|
|
4303
|
+
Po as VsInputFile,
|
|
4304
|
+
ba as VsInputFileList,
|
|
4295
4305
|
Gr as VsInputKeyValue,
|
|
4296
|
-
|
|
4297
|
-
|
|
4306
|
+
Pl as VsInputMask,
|
|
4307
|
+
il as VsInputNumber,
|
|
4298
4308
|
rt as VsInputRadio,
|
|
4299
4309
|
Xr as VsInputRange,
|
|
4300
|
-
|
|
4310
|
+
dt as VsInputSelect,
|
|
4301
4311
|
Ar as VsInputSlug,
|
|
4302
4312
|
nt as VsInputStatic,
|
|
4303
|
-
|
|
4313
|
+
yt as VsInputSwitcher,
|
|
4304
4314
|
jr as VsInputTag,
|
|
4305
4315
|
Ue as VsInputText,
|
|
4306
4316
|
ss as VsInputTextarea,
|