@opengis/form 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/array/vs-input-array.vue.d.ts +21 -0
- package/dist/components/inputs/array/vs-input-array.vue.d.ts.map +1 -0
- package/dist/components/inputs/base/vs-input-number.vue.d.ts +2 -2
- package/dist/components/inputs/base/vs-input-number.vue.d.ts.map +1 -1
- package/dist/components/inputs/base/vs-input-range.vue.d.ts +2 -2
- package/dist/components/inputs/base/vs-input-range.vue.d.ts.map +1 -1
- package/dist/components/inputs/index.d.ts +22 -4
- package/dist/components/inputs/index.d.ts.map +1 -1
- package/dist/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1058 -1001
- package/dist/index.umd.cjs +3 -3
- package/dist/types/form.d.ts +9 -0
- package/dist/types/form.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { notify as ne, VsModal as xt, modal as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as F, ref as w, onMounted as xe, onUnmounted as qe, createElementBlock as d, openBlock as i, createCommentVNode as A, renderSlot as Ve, createElementVNode as l, toDisplayString as P, mergeProps as Ie, createTextVNode as fe, normalizeProps as Ze, guardReactiveProps as Ye, computed as D, normalizeClass as C, mergeModels as Q, useModel as X, withDirectives as K, unref as J, vModelText as ie, vModelCheckbox as ht, createVNode as I, createBlock as re, resolveDynamicComponent as Ee, normalizeStyle as ke, withCtx as Be, withModifiers as ye, onBeforeUnmount as At, watch as le, createStaticVNode as ce, vModelRadio as gt, Fragment as ee, renderList as oe, reactive as Ft, vModelDynamic as Dt, vShow as Ge, inject as Se, resolveComponent as nt, Transition as bt, Teleport as yt, nextTick as De, getCurrentInstance as Ot, watchEffect as Ut, toRef as Tt, provide as rt } from "vue";
|
|
2
|
+
import { notify as ne, VsModal as xt, modal as Rt } from "@opengis/core";
|
|
3
|
+
const Pt = { class: "w-full relative" }, Ht = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
6
|
-
},
|
|
6
|
+
}, Nt = { class: "opacity-100" }, qt = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-red-500 text-[14px]"
|
|
9
|
-
},
|
|
9
|
+
}, Gt = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
12
|
-
},
|
|
12
|
+
}, Jt = /* @__PURE__ */ F({
|
|
13
13
|
__name: "vs-layout-default",
|
|
14
14
|
props: {
|
|
15
15
|
ua: { default: "" },
|
|
@@ -26,31 +26,31 @@ const Rt = { class: "w-full relative" }, Pt = {
|
|
|
26
26
|
const e = w("uk"), t = (r) => {
|
|
27
27
|
r.detail.key === "locale" && (e.value = r.detail.newValue);
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return xe(() => {
|
|
30
30
|
e.value = localStorage.locale, window.addEventListener("storage", t);
|
|
31
31
|
}), qe(() => {
|
|
32
32
|
window.removeEventListener("resize", t);
|
|
33
|
-
}), (r, a) => (i(), d("div",
|
|
34
|
-
r.ua || r.label ? (i(), d("div",
|
|
35
|
-
l("span",
|
|
36
|
-
r.item?.rules?.includes("required") ? (i(), d("span",
|
|
37
|
-
])) :
|
|
38
|
-
|
|
33
|
+
}), (r, a) => (i(), d("div", Pt, [
|
|
34
|
+
r.ua || r.label ? (i(), d("div", Ht, [
|
|
35
|
+
l("span", Nt, P(r.item[e.value] || r.ua || r.label), 1),
|
|
36
|
+
r.item?.rules?.includes("required") ? (i(), d("span", qt, "*")) : A("", !0)
|
|
37
|
+
])) : A("", !0),
|
|
38
|
+
Ve(r.$slots, "default", Ie(r.$attrs, {
|
|
39
39
|
class: { "opacity-60": r.item.disabled }
|
|
40
40
|
})),
|
|
41
|
-
r.error ? (i(), d("span",
|
|
41
|
+
r.error ? (i(), d("span", Gt, P(r.error), 1)) : A("", !0)
|
|
42
42
|
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), Wt = { class: "w-full relative flex flex-row items-center gap-2" }, Kt = {
|
|
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
|
+
}, Zt = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "text-red-500 text-[14px]"
|
|
50
|
-
},
|
|
50
|
+
}, Yt = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
53
|
-
},
|
|
53
|
+
}, Qt = /* @__PURE__ */ F({
|
|
54
54
|
__name: "vs-layout-horizontal",
|
|
55
55
|
props: {
|
|
56
56
|
ua: { default: "" },
|
|
@@ -64,19 +64,19 @@ const Rt = { class: "w-full relative" }, Pt = {
|
|
|
64
64
|
label: { default: "" }
|
|
65
65
|
},
|
|
66
66
|
setup(o) {
|
|
67
|
-
return (e, t) => (i(), d("div",
|
|
68
|
-
e.item?.type !== "html" ? (i(), d("span",
|
|
69
|
-
|
|
70
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span",
|
|
71
|
-
])) :
|
|
72
|
-
|
|
73
|
-
e.error ? (i(), d("span",
|
|
67
|
+
return (e, t) => (i(), d("div", Wt, [
|
|
68
|
+
e.item?.type !== "html" ? (i(), d("span", Kt, [
|
|
69
|
+
fe(P(e.ua || e.label) + " ", 1),
|
|
70
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span", Zt, "*")) : A("", !0)
|
|
71
|
+
])) : A("", !0),
|
|
72
|
+
Ve(e.$slots, "default", Ze(Ye(e.$attrs))),
|
|
73
|
+
e.error ? (i(), d("span", Yt, P(e.error), 1)) : A("", !0)
|
|
74
74
|
]));
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
76
|
+
}), Xt = { class: "w-full relative" }, el = {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
79
|
-
},
|
|
79
|
+
}, tl = /* @__PURE__ */ F({
|
|
80
80
|
__name: "vs-layout-inline",
|
|
81
81
|
props: {
|
|
82
82
|
ua: { default: "" },
|
|
@@ -90,24 +90,24 @@ const Rt = { class: "w-full relative" }, Pt = {
|
|
|
90
90
|
label: { default: "" }
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
|
-
return (e, t) => (i(), d("div",
|
|
94
|
-
|
|
95
|
-
e.error ? (i(), d("span",
|
|
93
|
+
return (e, t) => (i(), d("div", Xt, [
|
|
94
|
+
Ve(e.$slots, "default", Ze(Ye(e.$attrs))),
|
|
95
|
+
e.error ? (i(), d("span", el, P(e.error), 1)) : A("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}),
|
|
98
|
+
}), ll = { class: "flex-1 min-w-0" }, ol = {
|
|
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
|
+
}, al = { class: "truncate" }, sl = {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "text-red-500 text-[14px]"
|
|
104
|
-
},
|
|
104
|
+
}, nl = {
|
|
105
105
|
key: 1,
|
|
106
106
|
class: "text-xs text-slate-500 dark:text-slate-400"
|
|
107
|
-
},
|
|
107
|
+
}, rl = { class: "w-full md:w-auto" }, il = {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: "mt-1 text-xs text-red-500"
|
|
110
|
-
},
|
|
110
|
+
}, ul = /* @__PURE__ */ F({
|
|
111
111
|
__name: "vs-layout-settings",
|
|
112
112
|
props: {
|
|
113
113
|
ua: { default: "" },
|
|
@@ -126,7 +126,7 @@ const Rt = { class: "w-full relative" }, Pt = {
|
|
|
126
126
|
const r = D(() => e.item?.description ?? ""), a = D(() => Array.isArray(e.item?.rules) && e.item.rules.includes("required")), n = D(() => (typeof e.error == "string" ? e.error : "") ?? ""), s = (u) => {
|
|
127
127
|
u.key === "locale" && (t.value = u.newValue ?? "uk");
|
|
128
128
|
};
|
|
129
|
-
return
|
|
129
|
+
return xe(() => {
|
|
130
130
|
try {
|
|
131
131
|
typeof localStorage < "u" && localStorage.locale && (t.value = localStorage.locale);
|
|
132
132
|
} catch {
|
|
@@ -135,32 +135,32 @@ const Rt = { class: "w-full relative" }, Pt = {
|
|
|
135
135
|
}), qe(() => {
|
|
136
136
|
window.removeEventListener("storage", s);
|
|
137
137
|
}), (u, c) => (i(), d("div", {
|
|
138
|
-
class:
|
|
138
|
+
class: C(["w-full relative", { "opacity-60": u.item?.disabled }])
|
|
139
139
|
}, [
|
|
140
140
|
l("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: C(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(u.item.type) ? "flex flex-col" : ""]])
|
|
142
142
|
}, [
|
|
143
|
-
l("div",
|
|
144
|
-
u.ua || u.label ? (i(), d("p",
|
|
145
|
-
l("span",
|
|
146
|
-
a.value ? (i(), d("span",
|
|
147
|
-
])) :
|
|
148
|
-
r.value ? (i(), d("p",
|
|
143
|
+
l("div", ll, [
|
|
144
|
+
u.ua || u.label ? (i(), d("p", ol, [
|
|
145
|
+
l("span", al, P(u.item[t.value] || u.ua || u.label), 1),
|
|
146
|
+
a.value ? (i(), d("span", sl, "*")) : A("", !0)
|
|
147
|
+
])) : A("", !0),
|
|
148
|
+
r.value ? (i(), d("p", nl, P(r.value), 1)) : A("", !0)
|
|
149
149
|
]),
|
|
150
|
-
l("div",
|
|
151
|
-
|
|
150
|
+
l("div", rl, [
|
|
151
|
+
Ve(u.$slots, "default", Ze(Ye(u.$attrs)))
|
|
152
152
|
])
|
|
153
153
|
], 2),
|
|
154
|
-
n.value ? (i(), d("p",
|
|
154
|
+
n.value ? (i(), d("p", il, P(n.value), 1)) : A("", !0)
|
|
155
155
|
], 2));
|
|
156
156
|
}
|
|
157
|
-
}),
|
|
158
|
-
default:
|
|
159
|
-
horizontal:
|
|
160
|
-
inline:
|
|
161
|
-
settings:
|
|
157
|
+
}), dl = {
|
|
158
|
+
default: Jt,
|
|
159
|
+
horizontal: Qt,
|
|
160
|
+
inline: tl,
|
|
161
|
+
settings: ul
|
|
162
162
|
};
|
|
163
|
-
function
|
|
163
|
+
function ve(o) {
|
|
164
164
|
return {
|
|
165
165
|
inputClass: D(() => {
|
|
166
166
|
const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
@@ -168,7 +168,7 @@ function ye(o) {
|
|
|
168
168
|
})
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const cl = ["placeholder", "disabled"], pl = /* @__PURE__ */ F({
|
|
172
172
|
__name: "vs-input-password",
|
|
173
173
|
props: /* @__PURE__ */ Q({
|
|
174
174
|
style: { default: () => ({}) },
|
|
@@ -184,21 +184,21 @@ const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
|
184
184
|
}),
|
|
185
185
|
emits: ["update:modelValue"],
|
|
186
186
|
setup(o) {
|
|
187
|
-
const e = o, { inputClass: t } =
|
|
187
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
188
188
|
return (a, n) => K((i(), d("input", {
|
|
189
189
|
type: "password",
|
|
190
190
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
191
191
|
placeholder: a.placeholder,
|
|
192
192
|
disabled: a.disabled,
|
|
193
|
-
class:
|
|
193
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t), { "!border-red-600": a.error }]]),
|
|
194
194
|
style: {
|
|
195
195
|
border: "1px solid #CFD9E0"
|
|
196
196
|
}
|
|
197
|
-
}, null, 10,
|
|
197
|
+
}, null, 10, cl)), [
|
|
198
198
|
[ie, r.value]
|
|
199
199
|
]);
|
|
200
200
|
}
|
|
201
|
-
}),
|
|
201
|
+
}), fl = ["placeholder", "disabled"], Ne = /* @__PURE__ */ F({
|
|
202
202
|
__name: "vs-input-text",
|
|
203
203
|
props: /* @__PURE__ */ Q({
|
|
204
204
|
style: { default: () => ({}) },
|
|
@@ -214,23 +214,25 @@ const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
|
214
214
|
}),
|
|
215
215
|
emits: ["update:modelValue"],
|
|
216
216
|
setup(o) {
|
|
217
|
-
const e = o, { inputClass: t } =
|
|
217
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
218
218
|
return (a, n) => K((i(), d("input", {
|
|
219
219
|
type: "text",
|
|
220
220
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
221
221
|
placeholder: a.placeholder,
|
|
222
222
|
disabled: a.disabled,
|
|
223
|
-
class:
|
|
223
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t), { "!border-red-600": a.error }]]),
|
|
224
224
|
style: {
|
|
225
225
|
border: "1px solid #CFD9E0"
|
|
226
226
|
}
|
|
227
|
-
}, null, 10,
|
|
227
|
+
}, null, 10, fl)), [
|
|
228
228
|
[ie, r.value]
|
|
229
229
|
]);
|
|
230
230
|
}
|
|
231
|
-
}),
|
|
231
|
+
}), vl = ["placeholder", "min", "max"], ml = /* @__PURE__ */ F({
|
|
232
232
|
__name: "vs-input-number",
|
|
233
233
|
props: /* @__PURE__ */ Q({
|
|
234
|
+
min: {},
|
|
235
|
+
max: {},
|
|
234
236
|
style: { default: () => ({}) },
|
|
235
237
|
customClass: {},
|
|
236
238
|
disabled: { type: Boolean },
|
|
@@ -244,17 +246,19 @@ const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
|
244
246
|
}),
|
|
245
247
|
emits: ["update:modelValue"],
|
|
246
248
|
setup(o) {
|
|
247
|
-
const e = o, { inputClass: t } =
|
|
249
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
248
250
|
return (a, n) => K((i(), d("input", {
|
|
249
251
|
type: "number",
|
|
250
252
|
step: "any",
|
|
251
253
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
252
254
|
placeholder: a.placeholder,
|
|
253
|
-
class:
|
|
255
|
+
class: C(["py-1.5 px-3 block w-full bg-white", [J(t)]]),
|
|
254
256
|
style: {
|
|
255
257
|
border: "1px solid #CFD9E0"
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
+
},
|
|
259
|
+
min: a.min,
|
|
260
|
+
max: a.max
|
|
261
|
+
}, null, 10, vl)), [
|
|
258
262
|
[ie, r.value]
|
|
259
263
|
]);
|
|
260
264
|
}
|
|
@@ -263,7 +267,7 @@ const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
|
263
267
|
for (const [r, a] of e)
|
|
264
268
|
t[r] = a;
|
|
265
269
|
return t;
|
|
266
|
-
},
|
|
270
|
+
}, hl = {}, gl = {
|
|
267
271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
268
272
|
viewBox: "0 0 24 24",
|
|
269
273
|
fill: "none",
|
|
@@ -273,8 +277,8 @@ const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
|
273
277
|
"stroke-linejoin": "round",
|
|
274
278
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
275
279
|
};
|
|
276
|
-
function
|
|
277
|
-
return i(), d("svg",
|
|
280
|
+
function bl(o, e) {
|
|
281
|
+
return i(), d("svg", gl, e[0] || (e[0] = [
|
|
278
282
|
l("path", {
|
|
279
283
|
stroke: "none",
|
|
280
284
|
d: "M0 0h24v24H0z",
|
|
@@ -283,7 +287,7 @@ function gl(o, e) {
|
|
|
283
287
|
l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
284
288
|
]));
|
|
285
289
|
}
|
|
286
|
-
const
|
|
290
|
+
const yl = /* @__PURE__ */ N(hl, [["render", bl]]), xl = { class: "flex items-center gap-[4px]" }, wl = ["value", "id", "disabled"], kl = ["for"], _l = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, $l = /* @__PURE__ */ F({
|
|
287
291
|
__name: "vs-checkbox-default",
|
|
288
292
|
props: {
|
|
289
293
|
value: { default: "" },
|
|
@@ -300,41 +304,41 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
300
304
|
get: () => r.modelValue,
|
|
301
305
|
set: (n) => t("update:modelValue", n)
|
|
302
306
|
});
|
|
303
|
-
return (n, s) => (i(), d("div",
|
|
307
|
+
return (n, s) => (i(), d("div", xl, [
|
|
304
308
|
K(l("input", {
|
|
305
309
|
type: "checkbox",
|
|
306
310
|
value: n.value,
|
|
307
311
|
"onUpdate:modelValue": s[0] || (s[0] = (u) => a.value = u),
|
|
308
|
-
class:
|
|
312
|
+
class: C(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": n.disabled }]),
|
|
309
313
|
id: n.id,
|
|
310
314
|
disabled: n.disabled
|
|
311
|
-
}, null, 10,
|
|
315
|
+
}, null, 10, wl), [
|
|
312
316
|
[ht, a.value]
|
|
313
317
|
]),
|
|
314
318
|
l("label", {
|
|
315
319
|
for: n.id,
|
|
316
|
-
class:
|
|
320
|
+
class: C(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": n.disabled }])
|
|
317
321
|
}, [
|
|
318
322
|
l("div", {
|
|
319
|
-
class:
|
|
323
|
+
class: C(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [a.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", n.error ? "border-red-600" : ""]])
|
|
320
324
|
}, [
|
|
321
|
-
I(
|
|
325
|
+
I(yl, {
|
|
322
326
|
height: "12",
|
|
323
327
|
width: "12"
|
|
324
328
|
})
|
|
325
329
|
], 2),
|
|
326
|
-
l("span",
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
l("span", _l, [
|
|
331
|
+
Ve(n.$slots, "default", {}, () => [
|
|
332
|
+
fe(P(n.label), 1)
|
|
329
333
|
])
|
|
330
334
|
])
|
|
331
|
-
], 10,
|
|
335
|
+
], 10, kl)
|
|
332
336
|
]));
|
|
333
337
|
}
|
|
334
|
-
}),
|
|
338
|
+
}), Vl = ["name", "value", "disabled"], Cl = { class: "flex items-center gap-[6px] text-[14px]" }, Ml = {
|
|
335
339
|
key: 0,
|
|
336
340
|
class: "text-[16px]"
|
|
337
|
-
},
|
|
341
|
+
}, Ll = ["src"], Sl = /* @__PURE__ */ F({
|
|
338
342
|
__name: "vs-checkbox-buttons",
|
|
339
343
|
props: {
|
|
340
344
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -355,7 +359,7 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
355
359
|
}
|
|
356
360
|
}), n = D(() => Array.isArray(a.value) ? a.value.includes(t.value) : a.value === !0 || a.value === t.value), s = D(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
357
361
|
return (u, c) => (i(), d("label", {
|
|
358
|
-
class:
|
|
362
|
+
class: C(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [s.value, n.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
359
363
|
}, [
|
|
360
364
|
K(l("input", {
|
|
361
365
|
type: "checkbox",
|
|
@@ -364,30 +368,30 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
364
368
|
value: u.value,
|
|
365
369
|
"onUpdate:modelValue": c[0] || (c[0] = (v) => a.value = v),
|
|
366
370
|
disabled: u.disabled
|
|
367
|
-
}, null, 8,
|
|
371
|
+
}, null, 8, Vl), [
|
|
368
372
|
[ht, a.value]
|
|
369
373
|
]),
|
|
370
374
|
l("span", Cl, [
|
|
371
|
-
u.icon || u.imgUrl ? (i(), d("span",
|
|
375
|
+
u.icon || u.imgUrl ? (i(), d("span", Ml, [
|
|
372
376
|
u.icon ? (i(), d("i", {
|
|
373
377
|
key: 0,
|
|
374
|
-
class:
|
|
375
|
-
}, null, 2)) :
|
|
378
|
+
class: C(u.icon)
|
|
379
|
+
}, null, 2)) : A("", !0),
|
|
376
380
|
u.imgUrl ? (i(), d("img", {
|
|
377
381
|
key: 1,
|
|
378
382
|
src: u.imgUrl,
|
|
379
383
|
width: "16",
|
|
380
384
|
height: "16",
|
|
381
385
|
alt: "icon"
|
|
382
|
-
}, null, 8,
|
|
383
|
-
])) :
|
|
384
|
-
|
|
385
|
-
|
|
386
|
+
}, null, 8, Ll)) : A("", !0)
|
|
387
|
+
])) : A("", !0),
|
|
388
|
+
Ve(u.$slots, "default", {}, () => [
|
|
389
|
+
fe(P(u.label), 1)
|
|
386
390
|
])
|
|
387
391
|
])
|
|
388
392
|
], 2));
|
|
389
393
|
}
|
|
390
|
-
}),
|
|
394
|
+
}), Bl = { class: "flex items-center" }, wt = /* @__PURE__ */ F({
|
|
391
395
|
__name: "vs-input-checkbox-item",
|
|
392
396
|
props: {
|
|
393
397
|
value: { default: "" },
|
|
@@ -414,8 +418,8 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
414
418
|
r("update:modelValue", u);
|
|
415
419
|
}
|
|
416
420
|
}), s = w(`vs-checkbox-${t.view || "default"}`);
|
|
417
|
-
return (u, c) => (i(), d("div",
|
|
418
|
-
(i(), re(Ee(s.value === "vs-checkbox-buttons" ? J(
|
|
421
|
+
return (u, c) => (i(), d("div", Bl, [
|
|
422
|
+
(i(), re(Ee(s.value === "vs-checkbox-buttons" ? J(Sl) : J($l)), {
|
|
419
423
|
value: u.value,
|
|
420
424
|
label: u.label,
|
|
421
425
|
info: u.option?.info,
|
|
@@ -425,17 +429,17 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
425
429
|
id: a,
|
|
426
430
|
icon: u.icon,
|
|
427
431
|
imgUrl: u.imgUrl,
|
|
428
|
-
style:
|
|
432
|
+
style: ke(u.style),
|
|
429
433
|
error: u.error
|
|
430
434
|
}, {
|
|
431
435
|
default: Be(() => [
|
|
432
|
-
|
|
436
|
+
fe(P(u.label), 1)
|
|
433
437
|
]),
|
|
434
438
|
_: 1
|
|
435
439
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
436
440
|
]));
|
|
437
441
|
}
|
|
438
|
-
}),
|
|
442
|
+
}), jl = {}, Il = {
|
|
439
443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
440
444
|
viewBox: "0 0 24 24",
|
|
441
445
|
fill: "none",
|
|
@@ -445,8 +449,8 @@ const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-ce
|
|
|
445
449
|
"stroke-linejoin": "round",
|
|
446
450
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
447
451
|
};
|
|
448
|
-
function
|
|
449
|
-
return i(), d("svg",
|
|
452
|
+
function El(o, e) {
|
|
453
|
+
return i(), d("svg", Il, e[0] || (e[0] = [
|
|
450
454
|
l("path", {
|
|
451
455
|
stroke: "none",
|
|
452
456
|
d: "M0 0h24v24H0z",
|
|
@@ -455,7 +459,7 @@ function Il(o, e) {
|
|
|
455
459
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
456
460
|
]));
|
|
457
461
|
}
|
|
458
|
-
const
|
|
462
|
+
const zl = /* @__PURE__ */ N(jl, [["render", El]]), Al = {}, Fl = {
|
|
459
463
|
xmlns: "http://www.w3.org/2000/svg",
|
|
460
464
|
viewBox: "0 0 24 24",
|
|
461
465
|
fill: "none",
|
|
@@ -465,7 +469,7 @@ const El = /* @__PURE__ */ N(Bl, [["render", Il]]), zl = {}, Fl = {
|
|
|
465
469
|
"stroke-linejoin": "round",
|
|
466
470
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
467
471
|
};
|
|
468
|
-
function
|
|
472
|
+
function Dl(o, e) {
|
|
469
473
|
return i(), d("svg", Fl, e[0] || (e[0] = [
|
|
470
474
|
l("path", {
|
|
471
475
|
stroke: "none",
|
|
@@ -476,7 +480,7 @@ function Al(o, e) {
|
|
|
476
480
|
l("path", { d: "M6 6l12 12" }, null, -1)
|
|
477
481
|
]));
|
|
478
482
|
}
|
|
479
|
-
const
|
|
483
|
+
const Ol = /* @__PURE__ */ N(Al, [["render", Dl]]), Ul = {}, Tl = {
|
|
480
484
|
xmlns: "http://www.w3.org/2000/svg",
|
|
481
485
|
width: "24",
|
|
482
486
|
height: "24",
|
|
@@ -487,8 +491,8 @@ const Dl = /* @__PURE__ */ N(zl, [["render", Al]]), Ol = {}, Ul = {
|
|
|
487
491
|
"stroke-linecap": "round",
|
|
488
492
|
"stroke-linejoin": "round"
|
|
489
493
|
};
|
|
490
|
-
function
|
|
491
|
-
return i(), d("svg",
|
|
494
|
+
function Rl(o, e) {
|
|
495
|
+
return i(), d("svg", Tl, e[0] || (e[0] = [
|
|
492
496
|
l("path", {
|
|
493
497
|
stroke: "none",
|
|
494
498
|
d: "M0 0h24v24H0z",
|
|
@@ -499,13 +503,13 @@ function Tl(o, e) {
|
|
|
499
503
|
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
504
|
]));
|
|
501
505
|
}
|
|
502
|
-
const
|
|
506
|
+
const Pl = /* @__PURE__ */ N(Ul, [["render", Rl]]), Hl = {
|
|
503
507
|
key: 0,
|
|
504
508
|
class: "flex items-start gap-x-1"
|
|
505
|
-
},
|
|
509
|
+
}, Nl = {
|
|
506
510
|
key: 0,
|
|
507
511
|
class: "text-red-500 text-[14px]"
|
|
508
|
-
},
|
|
512
|
+
}, ql = ["title"], Gl = ["disabled"], kt = /* @__PURE__ */ F({
|
|
509
513
|
__name: "vs-input-switcher",
|
|
510
514
|
props: /* @__PURE__ */ Q({
|
|
511
515
|
rules: { default: () => [] },
|
|
@@ -527,37 +531,37 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
527
531
|
emits: ["update:modelValue"],
|
|
528
532
|
setup(o) {
|
|
529
533
|
const e = o, t = X(o, "modelValue");
|
|
530
|
-
return (r, a) => e.view === "checkbox" ? (i(), d("div",
|
|
534
|
+
return (r, a) => e.view === "checkbox" ? (i(), d("div", Hl, [
|
|
531
535
|
I(wt, {
|
|
532
536
|
modelValue: t.value,
|
|
533
537
|
"onUpdate:modelValue": a[0] || (a[0] = (n) => t.value = n),
|
|
534
538
|
label: r.text,
|
|
535
539
|
error: r.error || ""
|
|
536
540
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
537
|
-
r.rules?.includes("required") ? (i(), d("span",
|
|
541
|
+
r.rules?.includes("required") ? (i(), d("span", Nl, "*")) : A("", !0),
|
|
538
542
|
r.i ? (i(), d("button", {
|
|
539
543
|
key: 1,
|
|
540
544
|
class: "cursor-pointer",
|
|
541
545
|
title: r.i,
|
|
542
|
-
onClick: a[1] || (a[1] =
|
|
546
|
+
onClick: a[1] || (a[1] = ye(() => {
|
|
543
547
|
}, ["prevent"]))
|
|
544
548
|
}, [
|
|
545
|
-
I(J(
|
|
546
|
-
], 8,
|
|
549
|
+
I(J(Pl), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
550
|
+
], 8, ql)) : A("", !0)
|
|
547
551
|
])) : (i(), d("button", {
|
|
548
552
|
key: 1,
|
|
549
553
|
type: "button",
|
|
550
|
-
class:
|
|
554
|
+
class: C(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${r.style?.primaryColor || "blue"}-500` : "bg-stone-200", r.customClass]]),
|
|
551
555
|
disabled: r.disabled,
|
|
552
556
|
onClick: a[2] || (a[2] = (n) => t.value = !t.value)
|
|
553
557
|
}, [
|
|
554
558
|
l("span", {
|
|
555
559
|
"data-state": "checked",
|
|
556
|
-
class:
|
|
560
|
+
class: C(["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
561
|
}, null, 2)
|
|
558
|
-
], 10,
|
|
562
|
+
], 10, Gl));
|
|
559
563
|
}
|
|
560
|
-
}),
|
|
564
|
+
}), Jl = ["innerHTML"], it = /* @__PURE__ */ F({
|
|
561
565
|
__name: "vs-input-static",
|
|
562
566
|
props: {
|
|
563
567
|
text: { default: "" },
|
|
@@ -572,11 +576,11 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
572
576
|
},
|
|
573
577
|
setup(o) {
|
|
574
578
|
return (e, t) => (i(), d("div", {
|
|
575
|
-
class:
|
|
579
|
+
class: C(e.customClass),
|
|
576
580
|
innerHTML: e.html ? e.html : e.text
|
|
577
|
-
}, null, 10,
|
|
581
|
+
}, null, 10, Jl));
|
|
578
582
|
}
|
|
579
|
-
}),
|
|
583
|
+
}), Wl = ["placeholder", "disabled", "name"], Kl = /* @__PURE__ */ F({
|
|
580
584
|
__name: "vs-input-mask",
|
|
581
585
|
props: /* @__PURE__ */ Q({
|
|
582
586
|
name: {},
|
|
@@ -594,9 +598,9 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
594
598
|
}),
|
|
595
599
|
emits: ["update:modelValue"],
|
|
596
600
|
setup(o) {
|
|
597
|
-
const e = o, { inputClass: t } =
|
|
601
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue"), a = w(null);
|
|
598
602
|
let n = null;
|
|
599
|
-
return
|
|
603
|
+
return xe(async () => {
|
|
600
604
|
if (a.value) {
|
|
601
605
|
const { default: s } = await import("./index-W-qQIppj.js");
|
|
602
606
|
n = s(a.value, {
|
|
@@ -613,7 +617,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
613
617
|
r.value = e.unmask ? n.unmaskedValue : n.value;
|
|
614
618
|
}), n.value = r.value ?? "";
|
|
615
619
|
}
|
|
616
|
-
}),
|
|
620
|
+
}), At(() => {
|
|
617
621
|
n?.destroy();
|
|
618
622
|
}), le(() => e.mask, (s) => {
|
|
619
623
|
n && n.updateOptions({
|
|
@@ -633,13 +637,13 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
633
637
|
placeholder: s.placeholder,
|
|
634
638
|
disabled: s.disabled,
|
|
635
639
|
name: s.name,
|
|
636
|
-
class:
|
|
640
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t)]]),
|
|
637
641
|
style: {
|
|
638
642
|
border: "1px solid #CFD9E0"
|
|
639
643
|
}
|
|
640
|
-
}, null, 10,
|
|
644
|
+
}, null, 10, Wl));
|
|
641
645
|
}
|
|
642
|
-
}),
|
|
646
|
+
}), Zl = { class: "relative w-full bg-white rounded-lg" }, Yl = ["placeholder", "disabled"], Ql = /* @__PURE__ */ F({
|
|
643
647
|
__name: "vs-input-email",
|
|
644
648
|
props: /* @__PURE__ */ Q({
|
|
645
649
|
style: { default: () => ({}) },
|
|
@@ -655,24 +659,24 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
655
659
|
}),
|
|
656
660
|
emits: ["update:modelValue"],
|
|
657
661
|
setup(o) {
|
|
658
|
-
const e = o, { inputClass: t } =
|
|
659
|
-
return (a, n) => (i(), d("div",
|
|
660
|
-
n[1] || (n[1] =
|
|
662
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
663
|
+
return (a, n) => (i(), d("div", Zl, [
|
|
664
|
+
n[1] || (n[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
665
|
K(l("input", {
|
|
662
666
|
type: "email",
|
|
663
667
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
664
668
|
placeholder: a.placeholder,
|
|
665
669
|
disabled: a.disabled,
|
|
666
|
-
class:
|
|
670
|
+
class: C(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t), { "!border-red-600": a.error }]]),
|
|
667
671
|
style: {
|
|
668
672
|
border: "1px solid #CFD9E0"
|
|
669
673
|
}
|
|
670
|
-
}, null, 10,
|
|
674
|
+
}, null, 10, Yl), [
|
|
671
675
|
[ie, r.value]
|
|
672
676
|
])
|
|
673
677
|
]));
|
|
674
678
|
}
|
|
675
|
-
}),
|
|
679
|
+
}), Xl = ["value", "disabled"], eo = { class: "text-[13px] text-gray-700" }, to = /* @__PURE__ */ F({
|
|
676
680
|
__name: "vs-input-radio-default",
|
|
677
681
|
props: /* @__PURE__ */ Q({
|
|
678
682
|
style: {},
|
|
@@ -692,7 +696,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
692
696
|
setup(o) {
|
|
693
697
|
const e = X(o, "modelValue");
|
|
694
698
|
return (t, r) => (i(), d("label", {
|
|
695
|
-
class:
|
|
699
|
+
class: C(["flex items-center gap-0", [t.customClass]])
|
|
696
700
|
}, [
|
|
697
701
|
K(l("input", {
|
|
698
702
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => e.value = a),
|
|
@@ -700,24 +704,24 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
700
704
|
value: t.value,
|
|
701
705
|
disabled: t.disabled,
|
|
702
706
|
class: "hidden"
|
|
703
|
-
}, null, 8,
|
|
707
|
+
}, null, 8, Xl), [
|
|
704
708
|
[gt, e.value]
|
|
705
709
|
]),
|
|
706
710
|
l("span", {
|
|
707
|
-
class:
|
|
711
|
+
class: C(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
708
712
|
`border-${t.style?.primaryColor || "blue"}-500`,
|
|
709
713
|
t.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
710
714
|
]])
|
|
711
715
|
}, [
|
|
712
716
|
e.value == t.value ? (i(), d("span", {
|
|
713
717
|
key: 0,
|
|
714
|
-
class:
|
|
715
|
-
}, null, 2)) :
|
|
718
|
+
class: C(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
719
|
+
}, null, 2)) : A("", !0)
|
|
716
720
|
], 2),
|
|
717
|
-
l("span",
|
|
721
|
+
l("span", eo, P(t.text), 1)
|
|
718
722
|
], 2));
|
|
719
723
|
}
|
|
720
|
-
}),
|
|
724
|
+
}), lo = ["value", "disabled"], oo = { class: "text-[13px] text-gray-700" }, ao = /* @__PURE__ */ F({
|
|
721
725
|
__name: "vs-input-radio-buttons",
|
|
722
726
|
props: /* @__PURE__ */ Q({
|
|
723
727
|
style: {},
|
|
@@ -737,7 +741,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
737
741
|
setup(o) {
|
|
738
742
|
const e = X(o, "modelValue");
|
|
739
743
|
return (t, r) => (i(), d("label", {
|
|
740
|
-
class:
|
|
744
|
+
class: C(["flex items-center border rounded-lg px-2 py-1", [
|
|
741
745
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
742
746
|
t.customClass
|
|
743
747
|
]])
|
|
@@ -748,16 +752,16 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
748
752
|
value: t.value,
|
|
749
753
|
disabled: t.disabled,
|
|
750
754
|
class: "hidden"
|
|
751
|
-
}, null, 8,
|
|
755
|
+
}, null, 8, lo), [
|
|
752
756
|
[gt, e.value]
|
|
753
757
|
]),
|
|
754
|
-
l("span",
|
|
758
|
+
l("span", oo, P(t.text), 1)
|
|
755
759
|
], 2));
|
|
756
760
|
}
|
|
757
|
-
}),
|
|
758
|
-
"vs-input-radio-default":
|
|
759
|
-
"vs-input-radio-buttons":
|
|
760
|
-
}, ut = /* @__PURE__ */
|
|
761
|
+
}), so = {
|
|
762
|
+
"vs-input-radio-default": to,
|
|
763
|
+
"vs-input-radio-buttons": ao
|
|
764
|
+
}, ut = /* @__PURE__ */ F({
|
|
761
765
|
__name: "vs-input-radio",
|
|
762
766
|
props: /* @__PURE__ */ Q({
|
|
763
767
|
options: {},
|
|
@@ -776,11 +780,11 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
776
780
|
}),
|
|
777
781
|
emits: ["update:modelValue"],
|
|
778
782
|
setup(o) {
|
|
779
|
-
const e = o, t = X(o, "modelValue"), r = D(() =>
|
|
783
|
+
const e = o, t = X(o, "modelValue"), r = D(() => so[`vs-input-radio-${e.view}`]);
|
|
780
784
|
return (a, n) => (i(), d("div", {
|
|
781
|
-
class:
|
|
785
|
+
class: C([a.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
782
786
|
}, [
|
|
783
|
-
(i(!0), d(ee, null,
|
|
787
|
+
(i(!0), d(ee, null, oe(a.options, (s) => (i(), re(Ee(r.value), Ie({
|
|
784
788
|
key: s?.id,
|
|
785
789
|
text: s.text,
|
|
786
790
|
value: s.id.toString(),
|
|
@@ -790,7 +794,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
790
794
|
}, { ref_for: !0 }, a.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
791
795
|
], 2));
|
|
792
796
|
}
|
|
793
|
-
}),
|
|
797
|
+
}), no = /* @__PURE__ */ F({
|
|
794
798
|
__name: "vs-input-checkbox",
|
|
795
799
|
props: {
|
|
796
800
|
options: { default: () => [] },
|
|
@@ -809,7 +813,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
809
813
|
},
|
|
810
814
|
emits: ["update:modelValue"],
|
|
811
815
|
setup(o, { emit: e }) {
|
|
812
|
-
const t = o, r = e, a = w([]), n =
|
|
816
|
+
const t = o, r = e, a = w([]), n = Ft({}), s = (p) => p?.value || p?.id || p?.text || p, u = (p) => p.text || String(p), c = (p) => `lg:col-span-${p || 12}`, v = async () => {
|
|
813
817
|
try {
|
|
814
818
|
const p = await fetch(`/api/suggest/${t.data}`).then((f) => f.json());
|
|
815
819
|
a.value = p?.data || p;
|
|
@@ -845,7 +849,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
845
849
|
r("update:modelValue", p.length === 0 ? [] : p);
|
|
846
850
|
},
|
|
847
851
|
{ deep: !0 }
|
|
848
|
-
),
|
|
852
|
+
), xe(() => {
|
|
849
853
|
if (t.data)
|
|
850
854
|
v().then(() => {
|
|
851
855
|
if (typeof t.modelValue == "boolean" && a.value.length === 1) {
|
|
@@ -874,13 +878,13 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
874
878
|
});
|
|
875
879
|
}
|
|
876
880
|
}), (p, f) => (i(), d("div", {
|
|
877
|
-
class:
|
|
881
|
+
class: C(["p-0 w-full gap-[6px]", [p.position === "vertical" ? "flex-col" : "", p.colSpan ? "grid" : "flex justify-start"]])
|
|
878
882
|
}, [
|
|
879
|
-
(i(!0), d(ee, null,
|
|
883
|
+
(i(!0), d(ee, null, oe(a.value, (y) => (i(), re(wt, {
|
|
880
884
|
modelValue: n[s(y)],
|
|
881
885
|
"onUpdate:modelValue": (_) => n[s(y)] = _,
|
|
882
886
|
value: s(y),
|
|
883
|
-
class:
|
|
887
|
+
class: C(c(p.colSpan)),
|
|
884
888
|
disabled: y.disabled,
|
|
885
889
|
label: u(y),
|
|
886
890
|
key: s(y),
|
|
@@ -891,7 +895,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
891
895
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
892
896
|
], 2));
|
|
893
897
|
}
|
|
894
|
-
}),
|
|
898
|
+
}), ro = /* @__PURE__ */ N(no, [["__scopeId", "data-v-91f3584a"]]), io = ["type", "placeholder", "disabled"], uo = /* @__PURE__ */ F({
|
|
895
899
|
__name: "vs-input-date1",
|
|
896
900
|
props: {
|
|
897
901
|
style: { default: () => ({}) },
|
|
@@ -909,7 +913,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
909
913
|
function r(c) {
|
|
910
914
|
return c ? t.mode === "datetime" ? (c.includes("T") ? c : null) || c + (c.includes(" ") ? "" : "T00:00") : c?.split(" ")[0] : null;
|
|
911
915
|
}
|
|
912
|
-
const { inputClass: a } =
|
|
916
|
+
const { inputClass: a } = ve(t.style), n = e, s = D({
|
|
913
917
|
get: () => r(t.modelValue),
|
|
914
918
|
set: (c) => n("update:modelValue", c)
|
|
915
919
|
}), u = D(() => t.mode === "datetime" ? "datetime-local" : t.mode);
|
|
@@ -919,15 +923,15 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
919
923
|
placeholder: c.placeholder,
|
|
920
924
|
disabled: c.disabled,
|
|
921
925
|
ref: "date",
|
|
922
|
-
class:
|
|
926
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [c.modelValue ? "" : "text-opacity-50", J(a)].join(" ")]),
|
|
923
927
|
style: {
|
|
924
928
|
border: "1px solid #CFD9E0"
|
|
925
929
|
}
|
|
926
|
-
}, null, 10,
|
|
930
|
+
}, null, 10, io)), [
|
|
927
931
|
[Dt, s.value]
|
|
928
932
|
]);
|
|
929
933
|
}
|
|
930
|
-
}),
|
|
934
|
+
}), co = async (o, e, t, r) => {
|
|
931
935
|
try {
|
|
932
936
|
const a = new FormData();
|
|
933
937
|
return a.append("unique", "true"), a.append("file", o), (await fetch(
|
|
@@ -945,7 +949,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
945
949
|
position: "right-bottom"
|
|
946
950
|
}), console.error("Сталась помилка завантаження файлу", a), null;
|
|
947
951
|
}
|
|
948
|
-
},
|
|
952
|
+
}, po = async (o) => {
|
|
949
953
|
try {
|
|
950
954
|
return await fetch(`file/delete${o}`), !0;
|
|
951
955
|
} catch (e) {
|
|
@@ -958,7 +962,7 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
958
962
|
} catch (e) {
|
|
959
963
|
console.error(e.message);
|
|
960
964
|
}
|
|
961
|
-
},
|
|
965
|
+
}, fo = {}, vo = {
|
|
962
966
|
xmlns: "http://www.w3.org/2000/svg",
|
|
963
967
|
width: "24",
|
|
964
968
|
height: "24",
|
|
@@ -969,13 +973,13 @@ const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
|
969
973
|
"stroke-linecap": "round",
|
|
970
974
|
"stroke-linejoin": "round"
|
|
971
975
|
};
|
|
972
|
-
function
|
|
973
|
-
return i(), d("svg",
|
|
976
|
+
function mo(o, e) {
|
|
977
|
+
return i(), d("svg", vo, e[0] || (e[0] = [
|
|
974
978
|
l("path", { d: "M5 12h14" }, null, -1),
|
|
975
979
|
l("path", { d: "M12 5v14" }, null, -1)
|
|
976
980
|
]));
|
|
977
981
|
}
|
|
978
|
-
const Ue = /* @__PURE__ */ N(
|
|
982
|
+
const Ue = /* @__PURE__ */ N(fo, [["render", mo]]), ho = {}, go = {
|
|
979
983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
980
984
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
981
985
|
width: "44",
|
|
@@ -987,12 +991,12 @@ const Ue = /* @__PURE__ */ N(po, [["render", vo]]), mo = {}, ho = {
|
|
|
987
991
|
"stroke-linecap": "round",
|
|
988
992
|
"stroke-linejoin": "round"
|
|
989
993
|
};
|
|
990
|
-
function
|
|
991
|
-
return i(), d("svg",
|
|
992
|
-
|
|
994
|
+
function bo(o, e, t, r, a, n) {
|
|
995
|
+
return i(), d("svg", go, e[0] || (e[0] = [
|
|
996
|
+
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
997
|
]));
|
|
994
998
|
}
|
|
995
|
-
const
|
|
999
|
+
const yo = /* @__PURE__ */ N(ho, [["render", bo]]), xo = {}, wo = {
|
|
996
1000
|
xmlns: "http://www.w3.org/2000/svg",
|
|
997
1001
|
class: "icon icon-tabler icon-tabler-table",
|
|
998
1002
|
width: "44",
|
|
@@ -1004,8 +1008,8 @@ const bo = /* @__PURE__ */ N(mo, [["render", go]]), yo = {}, xo = {
|
|
|
1004
1008
|
"stroke-linecap": "round",
|
|
1005
1009
|
"stroke-linejoin": "round"
|
|
1006
1010
|
};
|
|
1007
|
-
function
|
|
1008
|
-
return i(), d("svg",
|
|
1011
|
+
function ko(o, e, t, r, a, n) {
|
|
1012
|
+
return i(), d("svg", wo, e[0] || (e[0] = [
|
|
1009
1013
|
l("path", {
|
|
1010
1014
|
stroke: "none",
|
|
1011
1015
|
d: "M0 0h24v24H0z",
|
|
@@ -1032,7 +1036,7 @@ function wo(o, e, t, r, a, n) {
|
|
|
1032
1036
|
}, null, -1)
|
|
1033
1037
|
]));
|
|
1034
1038
|
}
|
|
1035
|
-
const
|
|
1039
|
+
const _o = /* @__PURE__ */ N(xo, [["render", ko]]), $o = {}, Vo = {
|
|
1036
1040
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1037
1041
|
width: "24",
|
|
1038
1042
|
height: "24",
|
|
@@ -1044,11 +1048,11 @@ const ko = /* @__PURE__ */ N(yo, [["render", wo]]), _o = {}, $o = {
|
|
|
1044
1048
|
"stroke-linejoin": "round"
|
|
1045
1049
|
};
|
|
1046
1050
|
function Co(o, e) {
|
|
1047
|
-
return i(), d("svg",
|
|
1048
|
-
|
|
1051
|
+
return i(), d("svg", Vo, e[0] || (e[0] = [
|
|
1052
|
+
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="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>', 6)
|
|
1049
1053
|
]));
|
|
1050
1054
|
}
|
|
1051
|
-
const _t = /* @__PURE__ */ N(
|
|
1055
|
+
const _t = /* @__PURE__ */ N($o, [["render", Co]]), Mo = {}, Lo = {
|
|
1052
1056
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1053
1057
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
1054
1058
|
width: "44",
|
|
@@ -1060,12 +1064,12 @@ const _t = /* @__PURE__ */ N(_o, [["render", Co]]), Vo = {}, Mo = {
|
|
|
1060
1064
|
"stroke-linecap": "round",
|
|
1061
1065
|
"stroke-linejoin": "round"
|
|
1062
1066
|
};
|
|
1063
|
-
function
|
|
1064
|
-
return i(), d("svg",
|
|
1065
|
-
|
|
1067
|
+
function So(o, e, t, r, a, n) {
|
|
1068
|
+
return i(), d("svg", Lo, e[0] || (e[0] = [
|
|
1069
|
+
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)
|
|
1066
1070
|
]));
|
|
1067
1071
|
}
|
|
1068
|
-
const
|
|
1072
|
+
const Bo = /* @__PURE__ */ N(Mo, [["render", So]]), jo = {}, Io = {
|
|
1069
1073
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1070
1074
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
1071
1075
|
width: "44",
|
|
@@ -1077,25 +1081,25 @@ const So = /* @__PURE__ */ N(Vo, [["render", Lo]]), Bo = {}, jo = {
|
|
|
1077
1081
|
"stroke-linecap": "round",
|
|
1078
1082
|
"stroke-linejoin": "round"
|
|
1079
1083
|
};
|
|
1080
|
-
function
|
|
1081
|
-
return i(), d("svg",
|
|
1082
|
-
|
|
1084
|
+
function Eo(o, e, t, r, a, n) {
|
|
1085
|
+
return i(), d("svg", Io, e[0] || (e[0] = [
|
|
1086
|
+
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)
|
|
1083
1087
|
]));
|
|
1084
1088
|
}
|
|
1085
|
-
const
|
|
1089
|
+
const zo = /* @__PURE__ */ N(jo, [["render", Eo]]), Ao = (o) => {
|
|
1086
1090
|
if (!o) return "";
|
|
1087
1091
|
const e = o?.split(".");
|
|
1088
1092
|
return e[e.length - 1];
|
|
1089
1093
|
}, Fo = (o) => {
|
|
1090
|
-
const e =
|
|
1094
|
+
const e = Ao(o), t = {
|
|
1091
1095
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
1092
1096
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
1093
1097
|
archivesFormat: ["zip", "rar"],
|
|
1094
1098
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
1095
1099
|
documentsFormat: ["pdf"]
|
|
1096
1100
|
};
|
|
1097
|
-
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ?
|
|
1098
|
-
},
|
|
1101
|
+
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? _o : t.textsFormat.includes(e) ? zo : t.documentsFormat.includes(e) ? yo : t.archivesFormat.includes(e) ? Bo : _t;
|
|
1102
|
+
}, Do = {}, Oo = {
|
|
1099
1103
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1100
1104
|
width: "24",
|
|
1101
1105
|
height: "24",
|
|
@@ -1107,12 +1111,12 @@ const Eo = /* @__PURE__ */ N(Bo, [["render", Io]]), zo = (o) => {
|
|
|
1107
1111
|
"stroke-linejoin": "round",
|
|
1108
1112
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
1109
1113
|
};
|
|
1110
|
-
function
|
|
1111
|
-
return i(), d("svg",
|
|
1112
|
-
|
|
1114
|
+
function Uo(o, e) {
|
|
1115
|
+
return i(), d("svg", Oo, e[0] || (e[0] = [
|
|
1116
|
+
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)
|
|
1113
1117
|
]));
|
|
1114
1118
|
}
|
|
1115
|
-
const Je = /* @__PURE__ */ N(
|
|
1119
|
+
const Je = /* @__PURE__ */ N(Do, [["render", Uo]]), To = {}, Ro = {
|
|
1116
1120
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1117
1121
|
width: "24",
|
|
1118
1122
|
height: "24",
|
|
@@ -1124,8 +1128,8 @@ const Je = /* @__PURE__ */ N(Ao, [["render", Oo]]), Uo = {}, To = {
|
|
|
1124
1128
|
"stroke-linejoin": "round",
|
|
1125
1129
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1126
1130
|
};
|
|
1127
|
-
function
|
|
1128
|
-
return i(), d("svg",
|
|
1131
|
+
function Po(o, e) {
|
|
1132
|
+
return i(), d("svg", Ro, e[0] || (e[0] = [
|
|
1129
1133
|
l("path", {
|
|
1130
1134
|
stroke: "none",
|
|
1131
1135
|
d: "M0 0h24v24H0z",
|
|
@@ -1136,7 +1140,7 @@ function Ro(o, e) {
|
|
|
1136
1140
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1137
1141
|
]));
|
|
1138
1142
|
}
|
|
1139
|
-
const $t = /* @__PURE__ */ N(
|
|
1143
|
+
const $t = /* @__PURE__ */ N(To, [["render", Po]]), Ho = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, No = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, qo = /* @__PURE__ */ F({
|
|
1140
1144
|
__name: "vs-input-file-list-item",
|
|
1141
1145
|
props: /* @__PURE__ */ Q({
|
|
1142
1146
|
format: {},
|
|
@@ -1157,18 +1161,18 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1157
1161
|
emits: ["update:value", "update:item"],
|
|
1158
1162
|
setup(o) {
|
|
1159
1163
|
const e = X(o, "value"), t = X(o, "item"), r = o;
|
|
1160
|
-
return (a, n) => (i(), d("div",
|
|
1164
|
+
return (a, n) => (i(), d("div", Ho, [
|
|
1161
1165
|
(i(), re(Ee(J(Fo)(t.value)), {
|
|
1162
1166
|
src: t.value,
|
|
1163
1167
|
alt: "file",
|
|
1164
1168
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1165
1169
|
onClick: n[0] || (n[0] = (s) => J(dt)(t.value))
|
|
1166
1170
|
}, null, 8, ["src"])),
|
|
1167
|
-
l("div",
|
|
1171
|
+
l("div", No, [
|
|
1168
1172
|
l("button", {
|
|
1169
1173
|
type: "button",
|
|
1170
1174
|
onClick: n[1] || (n[1] = (s) => {
|
|
1171
|
-
J(
|
|
1175
|
+
J(po)(t.value), e.value = r.multiple ? e.value?.filter((u) => u !== t.value) : "";
|
|
1172
1176
|
}),
|
|
1173
1177
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1174
1178
|
}, [
|
|
@@ -1184,10 +1188,10 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1184
1188
|
])
|
|
1185
1189
|
]));
|
|
1186
1190
|
}
|
|
1187
|
-
}), ct = /* @__PURE__ */ N(
|
|
1191
|
+
}), ct = /* @__PURE__ */ N(qo, [["__scopeId", "data-v-0ca886b3"]]), Go = { class: "flex items-center gap-x-2" }, Jo = {
|
|
1188
1192
|
key: 1,
|
|
1189
1193
|
class: "flex items-center flex-wrap gap-2"
|
|
1190
|
-
},
|
|
1194
|
+
}, Wo = /* @__PURE__ */ F({
|
|
1191
1195
|
__name: "vs-input-file",
|
|
1192
1196
|
props: /* @__PURE__ */ Q({
|
|
1193
1197
|
format: {},
|
|
@@ -1213,10 +1217,10 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1213
1217
|
}
|
|
1214
1218
|
const u = s.target.files?.[0];
|
|
1215
1219
|
if (!u) return;
|
|
1216
|
-
const c = await
|
|
1220
|
+
const c = await co(u, "1", "form", "table");
|
|
1217
1221
|
t.value = e.multiple ? [...t.value || [], c?.file_path] : c?.file_path;
|
|
1218
1222
|
};
|
|
1219
|
-
return (s, u) => (i(), d("div",
|
|
1223
|
+
return (s, u) => (i(), d("div", Go, [
|
|
1220
1224
|
l("input", {
|
|
1221
1225
|
class: "hidden",
|
|
1222
1226
|
ref_key: "fileInput",
|
|
@@ -1230,8 +1234,8 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1230
1234
|
"onUpdate:item": u[0] || (u[0] = (c) => t.value = c),
|
|
1231
1235
|
value: t.value,
|
|
1232
1236
|
"onUpdate:value": u[1] || (u[1] = (c) => t.value = c)
|
|
1233
|
-
}, null, 8, ["item", "value"])) : s.multiple ? (i(), d("div",
|
|
1234
|
-
(i(!0), d(ee, null,
|
|
1237
|
+
}, null, 8, ["item", "value"])) : s.multiple ? (i(), d("div", Jo, [
|
|
1238
|
+
(i(!0), d(ee, null, oe(t.value, (c, v) => (i(), re(ct, {
|
|
1235
1239
|
multiple: s.multiple,
|
|
1236
1240
|
key: v,
|
|
1237
1241
|
value: t.value,
|
|
@@ -1240,24 +1244,24 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1240
1244
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1241
1245
|
l("div", {
|
|
1242
1246
|
onClick: u[3] || (u[3] = (c) => !s.disabled && r.value?.click()),
|
|
1243
|
-
class:
|
|
1247
|
+
class: C([
|
|
1244
1248
|
"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",
|
|
1245
1249
|
s.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1246
1250
|
])
|
|
1247
1251
|
}, [
|
|
1248
1252
|
I(Ue, { class: "w-6 h-6" })
|
|
1249
1253
|
], 2)
|
|
1250
|
-
])) :
|
|
1251
|
-
s.multiple ?
|
|
1254
|
+
])) : A("", !0),
|
|
1255
|
+
s.multiple ? A("", !0) : (i(), d("div", {
|
|
1252
1256
|
key: 2,
|
|
1253
1257
|
onClick: u[4] || (u[4] = (c) => r.value?.click()),
|
|
1254
|
-
class:
|
|
1258
|
+
class: C([s.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
|
|
1255
1259
|
}, [
|
|
1256
1260
|
I(Ue, { class: "w-6 h-6" })
|
|
1257
1261
|
], 2))
|
|
1258
1262
|
]));
|
|
1259
1263
|
}
|
|
1260
|
-
}),
|
|
1264
|
+
}), Ko = { class: "max-w-[55vw]" }, Zo = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Yo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Qo = { class: "px-[5px]" }, Xo = { class: "" }, He = /* @__PURE__ */ F({
|
|
1261
1265
|
__name: "vs-widget-file-info",
|
|
1262
1266
|
props: {
|
|
1263
1267
|
item: { default: null }
|
|
@@ -1281,34 +1285,34 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1281
1285
|
return n < 1024 ? `${n.toFixed(2)} KB` : `${(n / 1024).toFixed(2)} MB`;
|
|
1282
1286
|
}
|
|
1283
1287
|
return (a, n) => (i(), d(ee, null, [
|
|
1284
|
-
n[1] || (n[1] =
|
|
1285
|
-
l("div",
|
|
1286
|
-
l("p",
|
|
1287
|
-
l("p",
|
|
1288
|
+
n[1] || (n[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)),
|
|
1289
|
+
l("div", Ko, [
|
|
1290
|
+
l("p", Zo, P(a.item?.uploaded_name), 1),
|
|
1291
|
+
l("p", Yo, [
|
|
1288
1292
|
l("span", null, P(a.item?.username), 1),
|
|
1289
|
-
K(l("span",
|
|
1293
|
+
K(l("span", Qo, "|", 512), [
|
|
1290
1294
|
[Ge, a.item?.username]
|
|
1291
1295
|
]),
|
|
1292
1296
|
l("span", null, P(t.value), 1),
|
|
1293
1297
|
n[0] || (n[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1294
|
-
l("span",
|
|
1298
|
+
l("span", Xo, P(r(a.item?.size)), 1)
|
|
1295
1299
|
])
|
|
1296
1300
|
])
|
|
1297
1301
|
], 64));
|
|
1298
1302
|
}
|
|
1299
|
-
}),
|
|
1303
|
+
}), ea = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, ta = {
|
|
1300
1304
|
key: 0,
|
|
1301
1305
|
class: "flex w-full gap-x-3 items-center"
|
|
1302
|
-
},
|
|
1306
|
+
}, la = {
|
|
1303
1307
|
key: 1,
|
|
1304
1308
|
class: "flex gap-x-3 w-full items-center"
|
|
1305
|
-
},
|
|
1309
|
+
}, oa = {
|
|
1306
1310
|
key: 2,
|
|
1307
1311
|
class: "flex gap-x-3 w-full items-center"
|
|
1308
|
-
},
|
|
1312
|
+
}, aa = ["href"], sa = {
|
|
1309
1313
|
key: 3,
|
|
1310
1314
|
class: "flex gap-x-3 w-full items-center"
|
|
1311
|
-
},
|
|
1315
|
+
}, na = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, ra = { 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" }, ia = { class: "inline-block" }, ua = { class: "inline-block" }, da = /* @__PURE__ */ F({
|
|
1312
1316
|
__name: "vs-widget-file-item",
|
|
1313
1317
|
props: {
|
|
1314
1318
|
item: { default: null },
|
|
@@ -1350,30 +1354,30 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1350
1354
|
function v(p) {
|
|
1351
1355
|
(t.item.ext === "jpg" || t.item.ext === "png") && r("openLightbox", { item: t.item, index: p });
|
|
1352
1356
|
}
|
|
1353
|
-
return (p, f) => (i(), d("div",
|
|
1354
|
-
p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div",
|
|
1357
|
+
return (p, f) => (i(), d("div", ea, [
|
|
1358
|
+
p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div", ta, [
|
|
1355
1359
|
l("div", {
|
|
1356
1360
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1357
1361
|
onClick: f[0] || (f[0] = (y) => v(p.index))
|
|
1358
1362
|
}, [
|
|
1359
1363
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1360
1364
|
])
|
|
1361
|
-
])) : a(p.item) ? (i(), d("div",
|
|
1365
|
+
])) : a(p.item) ? (i(), d("div", la, [
|
|
1362
1366
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1363
|
-
])) : n(p.item) ? (i(), d("div",
|
|
1367
|
+
])) : n(p.item) ? (i(), d("div", oa, [
|
|
1364
1368
|
l("a", {
|
|
1365
1369
|
href: `/api/file-preview?id=${p.item.file_id}`,
|
|
1366
1370
|
target: "_blank",
|
|
1367
1371
|
class: "flex gap-x-3 w-full items-center"
|
|
1368
1372
|
}, [
|
|
1369
1373
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1370
|
-
], 8,
|
|
1371
|
-
])) : (i(), d("div",
|
|
1374
|
+
], 8, aa)
|
|
1375
|
+
])) : (i(), d("div", sa, [
|
|
1372
1376
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1373
1377
|
])),
|
|
1374
|
-
l("div",
|
|
1375
|
-
l("div",
|
|
1376
|
-
l("div",
|
|
1378
|
+
l("div", na, [
|
|
1379
|
+
l("div", ra, [
|
|
1380
|
+
l("div", ia, [
|
|
1377
1381
|
l("button", {
|
|
1378
1382
|
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",
|
|
1379
1383
|
onClick: f[1] || (f[1] = (y) => s(p.item))
|
|
@@ -1385,7 +1389,7 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1385
1389
|
])
|
|
1386
1390
|
]),
|
|
1387
1391
|
f[3] || (f[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
|
|
1388
|
-
l("div",
|
|
1392
|
+
l("div", ua, [
|
|
1389
1393
|
l("button", {
|
|
1390
1394
|
type: "button",
|
|
1391
1395
|
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",
|
|
@@ -1401,7 +1405,7 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1401
1405
|
])
|
|
1402
1406
|
]));
|
|
1403
1407
|
}
|
|
1404
|
-
}),
|
|
1408
|
+
}), ca = {}, pa = {
|
|
1405
1409
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1406
1410
|
width: "24",
|
|
1407
1411
|
height: "24",
|
|
@@ -1413,8 +1417,8 @@ const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[
|
|
|
1413
1417
|
"stroke-linejoin": "round",
|
|
1414
1418
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1415
1419
|
};
|
|
1416
|
-
function
|
|
1417
|
-
return i(), d("svg",
|
|
1420
|
+
function fa(o, e) {
|
|
1421
|
+
return i(), d("svg", pa, e[0] || (e[0] = [
|
|
1418
1422
|
l("path", {
|
|
1419
1423
|
stroke: "none",
|
|
1420
1424
|
d: "M0 0h24v24H0z",
|
|
@@ -1425,13 +1429,13 @@ function pa(o, e) {
|
|
|
1425
1429
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1426
1430
|
]));
|
|
1427
1431
|
}
|
|
1428
|
-
const
|
|
1432
|
+
const va = /* @__PURE__ */ N(ca, [["render", fa]]), ma = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, ha = { class: "flex w-full mb-[12px] items-center gap-x-2" }, ga = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, ba = { class1: "ml-auto" }, ya = { 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" }, xa = {
|
|
1429
1433
|
key: 0,
|
|
1430
1434
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1431
|
-
},
|
|
1435
|
+
}, wa = { class: "relative" }, ka = {
|
|
1432
1436
|
key: 1,
|
|
1433
1437
|
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"
|
|
1434
|
-
},
|
|
1438
|
+
}, _a = { key: 0 }, $a = /* @__PURE__ */ F({
|
|
1435
1439
|
__name: "vs-input-file-list",
|
|
1436
1440
|
props: {
|
|
1437
1441
|
id: { default: "" },
|
|
@@ -1446,7 +1450,7 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1446
1450
|
},
|
|
1447
1451
|
emits: ["update"],
|
|
1448
1452
|
setup(o, { emit: e }) {
|
|
1449
|
-
const t = o, r = Se("form"), a = D(() => r.value.formId), n = w(!1), s = w(0), u = e, c = w(!1), v = w({}), p = w([]), f = w(""), y = D(() => Array.isArray(p.value) ? p.value.filter((x) => x.ext === "jpg" || x.ext === "png").map((x) => x?.file_path) : []), _ = D(() => f.value === "" ? p.value : p.value.filter((x) => x?.uploaded_name?.includes(f.value))),
|
|
1453
|
+
const t = o, r = Se("form"), a = D(() => r.value.formId), n = w(!1), s = w(0), u = e, c = w(!1), v = w({}), p = w([]), f = w(""), y = D(() => Array.isArray(p.value) ? p.value.filter((x) => x.ext === "jpg" || x.ext === "png").map((x) => x?.file_path) : []), _ = D(() => f.value === "" ? p.value : p.value.filter((x) => x?.uploaded_name?.includes(f.value))), O = (x) => {
|
|
1450
1454
|
const b = y.value.findIndex((z) => z === x.item.file_path);
|
|
1451
1455
|
b !== -1 && (n.value = !0, s.value = b);
|
|
1452
1456
|
}, E = async () => {
|
|
@@ -1456,17 +1460,17 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1456
1460
|
} catch (x) {
|
|
1457
1461
|
console.error(x);
|
|
1458
1462
|
}
|
|
1459
|
-
},
|
|
1463
|
+
}, U = async (x) => {
|
|
1460
1464
|
await Promise.all(
|
|
1461
1465
|
Array.from(x.target.files).map(async (b) => {
|
|
1462
1466
|
const z = new FormData();
|
|
1463
1467
|
z.append("file", b);
|
|
1464
1468
|
try {
|
|
1465
|
-
const W = `${t.prefix}/widget/file/${a.value}`,
|
|
1466
|
-
return
|
|
1467
|
-
type:
|
|
1469
|
+
const W = `${t.prefix}/widget/file/${a.value}`, V = await fetch(W, { method: "POST", body: z });
|
|
1470
|
+
return V.ok ? (u("update", "file-list"), b) : (ne({
|
|
1471
|
+
type: V.status >= 400 && V.status < 500 ? "warning" : "error",
|
|
1468
1472
|
title: "Error",
|
|
1469
|
-
message: `Error code: ${
|
|
1473
|
+
message: `Error code: ${V.status}`
|
|
1470
1474
|
}), null);
|
|
1471
1475
|
} catch (W) {
|
|
1472
1476
|
return ne({
|
|
@@ -1477,34 +1481,34 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1477
1481
|
}
|
|
1478
1482
|
})
|
|
1479
1483
|
), await E();
|
|
1480
|
-
},
|
|
1484
|
+
}, M = (x) => {
|
|
1481
1485
|
const b = { ...x };
|
|
1482
1486
|
return x.cancel || (b.cancel = () => {
|
|
1483
1487
|
c.value = !1;
|
|
1484
1488
|
}), x.updateListOnConfirm && (b.confirm = async () => {
|
|
1485
1489
|
await x.confirm(), c.value = !1, E();
|
|
1486
1490
|
}), b;
|
|
1487
|
-
},
|
|
1488
|
-
v.value =
|
|
1491
|
+
}, S = (x) => {
|
|
1492
|
+
v.value = M(x), c.value = !0;
|
|
1489
1493
|
};
|
|
1490
1494
|
return le(a, (x) => {
|
|
1491
1495
|
x && E();
|
|
1492
|
-
}),
|
|
1496
|
+
}), xe(() => {
|
|
1493
1497
|
a.value && E();
|
|
1494
1498
|
}), (x, b) => {
|
|
1495
1499
|
const z = nt("Lightbox"), W = nt("MessageBox");
|
|
1496
|
-
return i(), d("div",
|
|
1497
|
-
l("div",
|
|
1498
|
-
l("h2",
|
|
1499
|
-
l("div",
|
|
1500
|
+
return i(), d("div", ma, [
|
|
1501
|
+
l("div", ha, [
|
|
1502
|
+
l("h2", ga, " Файлів: " + P(p.value?.length), 1),
|
|
1503
|
+
l("div", ba, [
|
|
1500
1504
|
l("label", null, [
|
|
1501
1505
|
l("input", {
|
|
1502
1506
|
type: "file",
|
|
1503
1507
|
class: "hidden",
|
|
1504
|
-
onChange: b[0] || (b[0] = (
|
|
1508
|
+
onChange: b[0] || (b[0] = (V) => U(V))
|
|
1505
1509
|
}, null, 32),
|
|
1506
|
-
l("div",
|
|
1507
|
-
I(
|
|
1510
|
+
l("div", ya, [
|
|
1511
|
+
I(va, {
|
|
1508
1512
|
height: "16",
|
|
1509
1513
|
width: "16"
|
|
1510
1514
|
})
|
|
@@ -1512,9 +1516,9 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1512
1516
|
])
|
|
1513
1517
|
])
|
|
1514
1518
|
]),
|
|
1515
|
-
p.value?.length > 4 ? (i(), d("div",
|
|
1519
|
+
p.value?.length > 4 ? (i(), d("div", xa, [
|
|
1516
1520
|
l("div", null, [
|
|
1517
|
-
l("div",
|
|
1521
|
+
l("div", wa, [
|
|
1518
1522
|
b[8] || (b[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
|
|
1519
1523
|
l("svg", {
|
|
1520
1524
|
class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
|
|
@@ -1538,7 +1542,7 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1538
1542
|
], -1)),
|
|
1539
1543
|
K(l("input", {
|
|
1540
1544
|
type: "text",
|
|
1541
|
-
"onUpdate:modelValue": b[1] || (b[1] = (
|
|
1545
|
+
"onUpdate:modelValue": b[1] || (b[1] = (V) => f.value = V),
|
|
1542
1546
|
class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
|
|
1543
1547
|
placeholder: "Введіть назву файлу"
|
|
1544
1548
|
}, null, 512), [
|
|
@@ -1551,37 +1555,37 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1551
1555
|
])
|
|
1552
1556
|
])
|
|
1553
1557
|
])
|
|
1554
|
-
])) :
|
|
1555
|
-
p.value?.length ? (i(), d("div",
|
|
1556
|
-
(i(!0), d(ee, null,
|
|
1558
|
+
])) : A("", !0),
|
|
1559
|
+
p.value?.length ? (i(), d("div", ka, [
|
|
1560
|
+
(i(!0), d(ee, null, oe(_.value, (V, se) => (i(), re(da, {
|
|
1557
1561
|
key: se,
|
|
1558
1562
|
prefix: x.prefix,
|
|
1559
|
-
item:
|
|
1563
|
+
item: V,
|
|
1560
1564
|
index: se,
|
|
1561
1565
|
onUpdate: b[2] || (b[2] = (ue) => x.$emit("update", "file-list")),
|
|
1562
|
-
onOpenModal: b[3] || (b[3] = (ue) =>
|
|
1563
|
-
onOpenLightbox: b[4] || (b[4] = (ue) =>
|
|
1566
|
+
onOpenModal: b[3] || (b[3] = (ue) => S(ue)),
|
|
1567
|
+
onOpenLightbox: b[4] || (b[4] = (ue) => O(ue))
|
|
1564
1568
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1565
|
-
_.value.length ?
|
|
1569
|
+
_.value.length ? A("", !0) : (i(), d("div", _a, b[9] || (b[9] = [
|
|
1566
1570
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1567
1571
|
])))
|
|
1568
|
-
])) :
|
|
1572
|
+
])) : A("", !0),
|
|
1569
1573
|
I(z, {
|
|
1570
1574
|
modelValue: n.value,
|
|
1571
|
-
"onUpdate:modelValue": b[5] || (b[5] = (
|
|
1575
|
+
"onUpdate:modelValue": b[5] || (b[5] = (V) => n.value = V),
|
|
1572
1576
|
startIndex: s.value,
|
|
1573
|
-
"onUpdate:index": b[6] || (b[6] = (
|
|
1577
|
+
"onUpdate:index": b[6] || (b[6] = (V) => s.value = V),
|
|
1574
1578
|
images: y.value
|
|
1575
1579
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1576
1580
|
I(W, Ie({
|
|
1577
1581
|
modelValue: c.value,
|
|
1578
|
-
"onUpdate:modelValue": b[7] || (b[7] = (
|
|
1582
|
+
"onUpdate:modelValue": b[7] || (b[7] = (V) => c.value = V),
|
|
1579
1583
|
onConfirm: v.value.confirm
|
|
1580
1584
|
}, v.value), null, 16, ["modelValue", "onConfirm"])
|
|
1581
1585
|
]);
|
|
1582
1586
|
};
|
|
1583
1587
|
}
|
|
1584
|
-
}),
|
|
1588
|
+
}), Va = { class: "flex items-center justify-between" }, Ca = { class: "text-[16px] text-gray-900 font-medium" }, Ma = { class: "grid gap-3" }, La = /* @__PURE__ */ F({
|
|
1585
1589
|
__name: "vs-container-switcher",
|
|
1586
1590
|
props: {
|
|
1587
1591
|
title: {
|
|
@@ -1605,18 +1609,18 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1605
1609
|
t.value = r;
|
|
1606
1610
|
}
|
|
1607
1611
|
), (r, a) => (i(), d("div", null, [
|
|
1608
|
-
l("div",
|
|
1612
|
+
l("div", Va, [
|
|
1609
1613
|
l("p", Ca, P(o.title), 1),
|
|
1610
1614
|
I(kt, {
|
|
1611
1615
|
modelValue: t.value,
|
|
1612
1616
|
"onUpdate:modelValue": a[0] || (a[0] = (n) => t.value = n),
|
|
1613
|
-
style:
|
|
1617
|
+
style: ke(o.style)
|
|
1614
1618
|
}, null, 8, ["modelValue", "style"])
|
|
1615
1619
|
]),
|
|
1616
1620
|
I(bt, { name: "slide-fade" }, {
|
|
1617
1621
|
default: Be(() => [
|
|
1618
|
-
K(l("div",
|
|
1619
|
-
|
|
1622
|
+
K(l("div", Ma, [
|
|
1623
|
+
Ve(r.$slots, "default", {}, void 0, !0)
|
|
1620
1624
|
], 512), [
|
|
1621
1625
|
[Ge, t.value]
|
|
1622
1626
|
])
|
|
@@ -1625,7 +1629,7 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1625
1629
|
})
|
|
1626
1630
|
]));
|
|
1627
1631
|
}
|
|
1628
|
-
}),
|
|
1632
|
+
}), Sa = /* @__PURE__ */ N(La, [["__scopeId", "data-v-90320b87"]]), Ba = { class: "text-[16px] text-gray-900 font-medium" }, ja = { class: "grid gap-3" }, Ia = /* @__PURE__ */ F({
|
|
1629
1633
|
__name: "vs-container-accordion",
|
|
1630
1634
|
props: {
|
|
1631
1635
|
title: {
|
|
@@ -1654,15 +1658,15 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1654
1658
|
onClick: a[0] || (a[0] = (n) => t.value = !t.value),
|
|
1655
1659
|
class: "flex items-center gap-2"
|
|
1656
1660
|
}, [
|
|
1657
|
-
I(J(
|
|
1658
|
-
class:
|
|
1661
|
+
I(J(zl), {
|
|
1662
|
+
class: C(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1659
1663
|
}, null, 8, ["class"]),
|
|
1660
|
-
l("span",
|
|
1664
|
+
l("span", Ba, P(o.title), 1)
|
|
1661
1665
|
]),
|
|
1662
1666
|
I(bt, { name: "slide-fade" }, {
|
|
1663
1667
|
default: Be(() => [
|
|
1664
|
-
K(l("div",
|
|
1665
|
-
|
|
1668
|
+
K(l("div", ja, [
|
|
1669
|
+
Ve(r.$slots, "default", {}, void 0, !0)
|
|
1666
1670
|
], 512), [
|
|
1667
1671
|
[Ge, t.value]
|
|
1668
1672
|
])
|
|
@@ -1671,7 +1675,7 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1671
1675
|
})
|
|
1672
1676
|
]));
|
|
1673
1677
|
}
|
|
1674
|
-
}),
|
|
1678
|
+
}), Ea = /* @__PURE__ */ N(Ia, [["__scopeId", "data-v-590eff11"]]), za = { class: "flex items-center justify-between" }, Aa = /* @__PURE__ */ F({
|
|
1675
1679
|
__name: "vs-container-default",
|
|
1676
1680
|
props: {
|
|
1677
1681
|
title: {
|
|
@@ -1685,17 +1689,17 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1685
1689
|
},
|
|
1686
1690
|
setup(o) {
|
|
1687
1691
|
return (e, t) => (i(), d("div", null, [
|
|
1688
|
-
l("div",
|
|
1692
|
+
l("div", za, [
|
|
1689
1693
|
l("p", null, P(o.title), 1)
|
|
1690
1694
|
]),
|
|
1691
|
-
|
|
1695
|
+
Ve(e.$slots, "default")
|
|
1692
1696
|
]));
|
|
1693
1697
|
}
|
|
1694
1698
|
}), Fa = {
|
|
1695
|
-
switcher:
|
|
1696
|
-
accordion:
|
|
1697
|
-
default:
|
|
1698
|
-
},
|
|
1699
|
+
switcher: Sa,
|
|
1700
|
+
accordion: Ea,
|
|
1701
|
+
default: Aa
|
|
1702
|
+
}, pe = {
|
|
1699
1703
|
Equal: "==",
|
|
1700
1704
|
Inequal: "!=",
|
|
1701
1705
|
Higer: ">",
|
|
@@ -1708,37 +1712,37 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1708
1712
|
Contain: "*",
|
|
1709
1713
|
In: "in",
|
|
1710
1714
|
NotIn: "not_in"
|
|
1711
|
-
},
|
|
1715
|
+
}, Da = (o, e) => String(o) === String(e), Oa = (o, e) => String(o) !== String(e), Ua = (o, e) => o > e, Ta = (o, e) => o >= e, Ra = (o, e) => o < e, Pa = (o, e) => o <= e, Ha = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Na = (o, e) => String(o).startsWith(String(e)), qa = (o, e) => String(o).endsWith(String(e)), Ga = (o, e) => String(o).includes(String(e)), Ja = (o, e) => Array.isArray(e) ? e.includes(o) : !1, Wa = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, Vt = (o, e) => {
|
|
1712
1716
|
if (!e) return !0;
|
|
1713
1717
|
switch (e?.[1]) {
|
|
1714
|
-
case
|
|
1715
|
-
return Aa(o, e?.[2]);
|
|
1716
|
-
case fe.Inequal:
|
|
1718
|
+
case pe.Equal:
|
|
1717
1719
|
return Da(o, e?.[2]);
|
|
1718
|
-
case
|
|
1720
|
+
case pe.Inequal:
|
|
1719
1721
|
return Oa(o, e?.[2]);
|
|
1720
|
-
case
|
|
1722
|
+
case pe.Higer:
|
|
1721
1723
|
return Ua(o, e?.[2]);
|
|
1722
|
-
case
|
|
1724
|
+
case pe.HigerOrEqual:
|
|
1723
1725
|
return Ta(o, e?.[2]);
|
|
1724
|
-
case
|
|
1726
|
+
case pe.Lower:
|
|
1725
1727
|
return Ra(o, e?.[2]);
|
|
1726
|
-
case
|
|
1728
|
+
case pe.LowerOrEqual:
|
|
1727
1729
|
return Pa(o, e?.[2]);
|
|
1728
|
-
case
|
|
1730
|
+
case pe.Between:
|
|
1729
1731
|
return Ha(o, e?.[2]);
|
|
1730
|
-
case
|
|
1732
|
+
case pe.StartWith:
|
|
1731
1733
|
return Na(o, e?.[2]);
|
|
1732
|
-
case
|
|
1734
|
+
case pe.EndWith:
|
|
1733
1735
|
return qa(o, e?.[2]);
|
|
1734
|
-
case
|
|
1736
|
+
case pe.Contain:
|
|
1735
1737
|
return Ga(o, e?.[2]);
|
|
1736
|
-
case
|
|
1738
|
+
case pe.In:
|
|
1737
1739
|
return Ja(o, e?.[2]);
|
|
1740
|
+
case pe.NotIn:
|
|
1741
|
+
return Wa(o, e?.[2]);
|
|
1738
1742
|
default:
|
|
1739
1743
|
return !0;
|
|
1740
1744
|
}
|
|
1741
|
-
},
|
|
1745
|
+
}, Ka = /* @__PURE__ */ F({
|
|
1742
1746
|
__name: "vs-input-container",
|
|
1743
1747
|
props: {
|
|
1744
1748
|
style: {
|
|
@@ -1763,15 +1767,15 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1763
1767
|
const u = s?.conditions;
|
|
1764
1768
|
if (!u) return !0;
|
|
1765
1769
|
const c = Array.isArray(u) ? u[0] : u, v = t?.value?.[c];
|
|
1766
|
-
return
|
|
1770
|
+
return Vt(v, u);
|
|
1767
1771
|
})), n = D(() => Fa[e.view]);
|
|
1768
1772
|
return (s, u) => o.schema?.length ? (i(), re(Ee(n.value), {
|
|
1769
1773
|
key: 0,
|
|
1770
1774
|
title: o.title,
|
|
1771
|
-
style:
|
|
1775
|
+
style: ke(o.style)
|
|
1772
1776
|
}, {
|
|
1773
1777
|
default: Be(() => [
|
|
1774
|
-
(i(!0), d(ee, null,
|
|
1778
|
+
(i(!0), d(ee, null, oe(a.value, (c) => (i(), re(Ct, Ie({
|
|
1775
1779
|
key: c.name
|
|
1776
1780
|
}, { ref_for: !0 }, c, {
|
|
1777
1781
|
item: c,
|
|
@@ -1782,15 +1786,15 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1782
1786
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
1783
1787
|
]),
|
|
1784
1788
|
_: 1
|
|
1785
|
-
}, 8, ["title", "style"])) :
|
|
1789
|
+
}, 8, ["title", "style"])) : A("", !0);
|
|
1786
1790
|
}
|
|
1787
|
-
}),
|
|
1791
|
+
}), Za = ["aria-expanded", "data-focus"], Ya = { class: "flex items-center" }, Qa = ["title"], Xa = ["onClick"], es = ["title"], ts = {
|
|
1788
1792
|
key: 2,
|
|
1789
1793
|
class: "text-gray-500 truncate"
|
|
1790
|
-
},
|
|
1794
|
+
}, ls = { class: "flex-1 min-w-[2px]" }, os = ["placeholder"], as = { class: "flex items-center shrink-0" }, ss = ["disabled"], ns = ["disabled", "title"], rs = ["aria-disabled", "onClick"], is = {
|
|
1791
1795
|
key: 1,
|
|
1792
1796
|
class: "px-3 py-2 text-center text-gray-500"
|
|
1793
|
-
},
|
|
1797
|
+
}, us = ["disabled"], pt = /* @__PURE__ */ F({
|
|
1794
1798
|
__name: "vs-input-select",
|
|
1795
1799
|
props: {
|
|
1796
1800
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1816,85 +1820,85 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1816
1820
|
emits: ["change", "update:modelValue"],
|
|
1817
1821
|
setup(o, { emit: e }) {
|
|
1818
1822
|
const t = o, r = e, a = D(() => t.multiple), n = D(() => t.disabled);
|
|
1819
|
-
|
|
1823
|
+
ve(t.style);
|
|
1820
1824
|
const s = D({
|
|
1821
1825
|
get: () => t.modelValue,
|
|
1822
|
-
set: (
|
|
1826
|
+
set: (g) => r("update:modelValue", g)
|
|
1823
1827
|
});
|
|
1824
1828
|
!s.value && t.defaultValue && (s.value = t.defaultValue);
|
|
1825
|
-
const u = w(null), c = w(null), v = w(null), p = w(null), f = w(!1), y = w(!1), _ = w(null),
|
|
1829
|
+
const u = w(null), c = w(null), v = w(null), p = w(null), f = w(!1), y = w(!1), _ = w(null), O = w([]), E = w(-1), U = w([]), M = w(""), S = w(null), x = w("bottom"), b = w({}), z = w([]), W = D(() => {
|
|
1826
1830
|
if (!z.value.length) return [];
|
|
1827
|
-
const
|
|
1828
|
-
return z.value.map((m) =>
|
|
1829
|
-
}),
|
|
1830
|
-
let
|
|
1831
|
-
if (!t.data &&
|
|
1832
|
-
const m =
|
|
1833
|
-
|
|
1831
|
+
const g = new Map(O.value.map((m) => [m.id?.toString(), m]));
|
|
1832
|
+
return z.value.map((m) => g.get(m?.toString())).filter((m) => !!m);
|
|
1833
|
+
}), V = D(() => t.placeholder || "Select..."), se = D(() => a.value ? !z.value.length && M.value === "" : !_.value?.text && M.value === ""), ue = D(() => n.value ? !1 : a.value ? z.value.length > 0 : !!s.value), de = (g) => a.value ? z.value.some((m) => m?.toString() === g?.toString()) : s.value?.toString() === g?.toString(), te = D(() => {
|
|
1834
|
+
let g = O.value ?? [];
|
|
1835
|
+
if (!t.data && M.value.trim() !== "") {
|
|
1836
|
+
const m = M.value.toLowerCase();
|
|
1837
|
+
g = g.filter(($) => $.text?.toLowerCase?.().includes(m));
|
|
1834
1838
|
}
|
|
1835
1839
|
if (a.value && z.value.length) {
|
|
1836
1840
|
const m = new Set(z.value.map(($) => $?.toString()));
|
|
1837
|
-
|
|
1841
|
+
g = g.filter(($) => !m.has($.id?.toString()));
|
|
1838
1842
|
}
|
|
1839
|
-
return
|
|
1840
|
-
}), ze = Se("values"),
|
|
1843
|
+
return g;
|
|
1844
|
+
}), ze = Se("values"), _e = D(() => t.parent ? ze?.value?.[t.parent] ?? null : null), me = async (g) => {
|
|
1841
1845
|
if (!t.data) {
|
|
1842
1846
|
let m = t.options ?? [];
|
|
1843
|
-
if (
|
|
1844
|
-
const $ =
|
|
1847
|
+
if (g?.trim()) {
|
|
1848
|
+
const $ = g.toLowerCase();
|
|
1845
1849
|
m = m.filter((H) => H.text?.toLowerCase?.().includes($));
|
|
1846
1850
|
}
|
|
1847
1851
|
return m;
|
|
1848
1852
|
}
|
|
1849
1853
|
try {
|
|
1850
|
-
const m = t.host ?? "", $ = t.prefix ?? "api", H = t.api ?? `/${$}/suggest/${t.data}`,
|
|
1851
|
-
return
|
|
1854
|
+
const m = t.host ?? "", $ = t.prefix ?? "api", H = t.api ?? `/${$}/suggest/${t.data}`, ae = `${m}${H}`, be = new URLSearchParams();
|
|
1855
|
+
return be.set("json", "1"), g && be.set("key", g), _e.value !== void 0 && _e.value !== null && _e.value !== "" && be.set("parent", String(_e.value)), (await fetch(`${ae}?${be.toString()}`).then((je) => je.json()))?.data ?? [];
|
|
1852
1856
|
} catch {
|
|
1853
1857
|
return [];
|
|
1854
1858
|
}
|
|
1855
|
-
},
|
|
1856
|
-
t.data ?
|
|
1857
|
-
},
|
|
1858
|
-
if (
|
|
1859
|
-
const m =
|
|
1860
|
-
return m || ((await
|
|
1861
|
-
},
|
|
1862
|
-
const m = new Set(
|
|
1863
|
-
$.length && await $.reduce(async (H,
|
|
1859
|
+
}, T = async () => {
|
|
1860
|
+
t.data ? O.value = await me(M.value) : O.value = t.options ? [...t.options] : [];
|
|
1861
|
+
}, B = async (g) => {
|
|
1862
|
+
if (g == null) return null;
|
|
1863
|
+
const m = O.value?.find((H) => H?.id?.toString() === String(g));
|
|
1864
|
+
return m || ((await me(String(g)))?.[0] ?? null);
|
|
1865
|
+
}, j = async (g) => {
|
|
1866
|
+
const m = new Set(O.value.map((H) => H.id?.toString())), $ = g.filter((H) => !m.has(H?.toString()));
|
|
1867
|
+
$.length && await $.reduce(async (H, ae) => {
|
|
1864
1868
|
await H;
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1869
|
+
const be = await B(ae);
|
|
1870
|
+
be && O.value.push(be);
|
|
1867
1871
|
}, Promise.resolve());
|
|
1868
|
-
},
|
|
1869
|
-
n.value || (f.value = !0, await
|
|
1870
|
-
|
|
1872
|
+
}, q = async () => {
|
|
1873
|
+
n.value || (f.value = !0, await T(), await De(() => {
|
|
1874
|
+
we(), S.value?.focus(), te.value.length ? E.value = 0 : E.value = -1;
|
|
1871
1875
|
}));
|
|
1872
|
-
},
|
|
1876
|
+
}, Z = () => {
|
|
1873
1877
|
f.value = !1, E.value = -1;
|
|
1874
|
-
},
|
|
1878
|
+
}, he = async (g) => {
|
|
1875
1879
|
if (n.value) return;
|
|
1876
|
-
!f.value ? await
|
|
1877
|
-
},
|
|
1878
|
-
f.value ?
|
|
1880
|
+
!f.value ? await q() : Z();
|
|
1881
|
+
}, h = async () => {
|
|
1882
|
+
f.value ? S.value?.focus() : await q();
|
|
1879
1883
|
}, k = () => {
|
|
1880
|
-
a.value ? (z.value = [], s.value = [], r("change", [])) : (_.value = null, s.value = null, r("change", null)),
|
|
1881
|
-
}, R = (
|
|
1882
|
-
a.value && (z.value = z.value.filter((m) => m?.toString() !==
|
|
1883
|
-
},
|
|
1884
|
-
a.value ? (de(
|
|
1885
|
-
|
|
1886
|
-
})) : (_.value =
|
|
1887
|
-
}, Y = (
|
|
1888
|
-
de(
|
|
1889
|
-
},
|
|
1890
|
-
if (!
|
|
1891
|
-
const $ =
|
|
1884
|
+
a.value ? (z.value = [], s.value = [], r("change", [])) : (_.value = null, s.value = null, r("change", null)), M.value = "", De(() => S.value?.focus());
|
|
1885
|
+
}, R = (g) => {
|
|
1886
|
+
a.value && (z.value = z.value.filter((m) => m?.toString() !== g?.toString()), s.value = [...z.value], r("change", s.value), De(() => S.value?.focus()));
|
|
1887
|
+
}, G = (g) => {
|
|
1888
|
+
a.value ? (de(g.id) || (z.value = [...z.value, g.id], s.value = [...z.value], r("change", s.value)), M.value = "", De(() => {
|
|
1889
|
+
S.value?.focus(), E.value = Math.min(E.value, te.value.length - 1);
|
|
1890
|
+
})) : (_.value = g, s.value = g.id, r("change", s.value), M.value = "", Z());
|
|
1891
|
+
}, Y = (g) => {
|
|
1892
|
+
de(g.id) || G(g);
|
|
1893
|
+
}, ge = (g, m) => {
|
|
1894
|
+
if (!g || !m) return;
|
|
1895
|
+
const $ = g.offsetTop, H = $ + g.offsetHeight, ae = m.scrollTop, be = ae + m.clientHeight;
|
|
1892
1896
|
let Le = m.scrollTop;
|
|
1893
|
-
$ <
|
|
1897
|
+
$ < ae ? Le = $ - 80 : H > be && (Le = H - m.clientHeight + 4);
|
|
1894
1898
|
const je = m;
|
|
1895
1899
|
je.scrollTop = Le;
|
|
1896
|
-
}, $e = (
|
|
1897
|
-
let m =
|
|
1900
|
+
}, $e = (g) => {
|
|
1901
|
+
let m = g.parentElement;
|
|
1898
1902
|
for (; m; ) {
|
|
1899
1903
|
if (m.classList.contains("ui-dialog__content"))
|
|
1900
1904
|
return m;
|
|
@@ -1904,74 +1908,74 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1904
1908
|
m = m.parentElement;
|
|
1905
1909
|
}
|
|
1906
1910
|
return document.body;
|
|
1907
|
-
},
|
|
1911
|
+
}, we = () => {
|
|
1908
1912
|
if (!c.value) return;
|
|
1909
|
-
const
|
|
1910
|
-
let { width:
|
|
1911
|
-
Ke > 0 &&
|
|
1912
|
-
let { left:
|
|
1913
|
-
|
|
1913
|
+
const g = c.value.getBoundingClientRect(), m = window.innerHeight || document.documentElement.clientHeight, $ = window.innerWidth || document.documentElement.clientWidth, H = 8, ae = 8, be = t.maxHeight || 300, Le = m - g.bottom - ae - H, je = g.top - ae - H, Pe = Le >= je, Ke = Math.max($ - H * 2, 0);
|
|
1914
|
+
let { width: Ae } = g;
|
|
1915
|
+
Ke > 0 && Ae > Ke && (Ae = Ke);
|
|
1916
|
+
let { left: Fe } = g;
|
|
1917
|
+
Fe + Ae + H > $ && (Fe = $ - Ae - H), Fe = Math.max(Fe, H);
|
|
1914
1918
|
const zt = Math.min(
|
|
1915
|
-
|
|
1919
|
+
be,
|
|
1916
1920
|
Math.max(Pe ? Le : je, 50)
|
|
1917
1921
|
);
|
|
1918
1922
|
x.value = Pe ? "bottom" : "top", b.value = {
|
|
1919
1923
|
position: "fixed",
|
|
1920
|
-
left: `${
|
|
1921
|
-
width: `${
|
|
1924
|
+
left: `${Fe}px`,
|
|
1925
|
+
width: `${Ae}px`,
|
|
1922
1926
|
minWidth: "300px",
|
|
1923
1927
|
maxHeight: `${zt}px`,
|
|
1924
1928
|
transform: Pe ? "none" : "translateY(-100%)",
|
|
1925
|
-
top: Pe ? `${
|
|
1929
|
+
top: Pe ? `${g.bottom + ae}px` : `${g.top - ae}px`
|
|
1926
1930
|
};
|
|
1927
|
-
},
|
|
1928
|
-
n.value || !f.value && (
|
|
1929
|
-
}, Me = (
|
|
1931
|
+
}, Ce = async (g) => {
|
|
1932
|
+
n.value || !f.value && (g.key === "ArrowDown" || g.key === "ArrowUp") && (g.preventDefault(), await q());
|
|
1933
|
+
}, Me = (g) => {
|
|
1930
1934
|
if (!f.value) return;
|
|
1931
|
-
const { key: m } =
|
|
1935
|
+
const { key: m } = g;
|
|
1932
1936
|
if (m === "ArrowDown")
|
|
1933
|
-
|
|
1937
|
+
g.preventDefault(), E.value + 1 < te.value.length && (E.value += 1, ge(U.value[E.value], v.value));
|
|
1934
1938
|
else if (m === "ArrowUp")
|
|
1935
|
-
|
|
1939
|
+
g.preventDefault(), E.value > 0 && (E.value -= 1, ge(U.value[E.value], v.value));
|
|
1936
1940
|
else if (m === "Enter") {
|
|
1937
|
-
|
|
1941
|
+
g.preventDefault();
|
|
1938
1942
|
const $ = te.value[E.value];
|
|
1939
|
-
$ &&
|
|
1940
|
-
} else m === "Escape" ? (
|
|
1943
|
+
$ && G($), S.value?.blur();
|
|
1944
|
+
} else m === "Escape" ? (g.preventDefault(), Z()) : m === "Backspace" ? a.value && M.value === "" && z.value.length && (z.value = z.value.slice(0, -1), s.value = [...z.value], r("change", s.value)) : m === "Home" ? (E.value = 0, ge(U.value[0], v.value)) : m === "End" ? (E.value = te.value.length - 1, ge(U.value[E.value], v.value)) : m === "Tab" && Z();
|
|
1941
1945
|
}, Lt = () => {
|
|
1942
1946
|
n.value || (y.value = !0);
|
|
1943
1947
|
}, St = () => {
|
|
1944
|
-
y.value = !1,
|
|
1945
|
-
}, Qe = (
|
|
1946
|
-
|
|
1947
|
-
}, Xe = (
|
|
1948
|
-
const m =
|
|
1949
|
-
u.value?.contains(m) || p.value?.contains(m) ||
|
|
1950
|
-
}, et = (
|
|
1951
|
-
f.value && v.value && !v.value.contains(
|
|
1948
|
+
y.value = !1, M.value = "";
|
|
1949
|
+
}, Qe = (g) => {
|
|
1950
|
+
g.key === "Escape" && f.value && Z();
|
|
1951
|
+
}, Xe = (g) => {
|
|
1952
|
+
const m = g.target;
|
|
1953
|
+
u.value?.contains(m) || p.value?.contains(m) || Z();
|
|
1954
|
+
}, et = (g) => {
|
|
1955
|
+
f.value && v.value && !v.value.contains(g.target) && we();
|
|
1952
1956
|
}, tt = () => {
|
|
1953
|
-
f.value &&
|
|
1957
|
+
f.value && we();
|
|
1954
1958
|
}, lt = () => {
|
|
1955
|
-
f.value &&
|
|
1959
|
+
f.value && we();
|
|
1956
1960
|
};
|
|
1957
|
-
le(() => t.options, (
|
|
1958
|
-
|
|
1961
|
+
le(() => t.options, (g) => {
|
|
1962
|
+
g?.length && (O.value = [...g]);
|
|
1959
1963
|
}, { immediate: !0 });
|
|
1960
1964
|
const ot = async () => {
|
|
1961
1965
|
if (a.value)
|
|
1962
|
-
Array.isArray(s.value) ? z.value = [...s.value] : (z.value = s.value == null ? [] : [s.value], s.value = [...z.value]), !t.options?.length && t.data && await
|
|
1966
|
+
Array.isArray(s.value) ? z.value = [...s.value] : (z.value = s.value == null ? [] : [s.value], s.value = [...z.value]), !t.options?.length && t.data && await j(z.value);
|
|
1963
1967
|
else {
|
|
1964
1968
|
if (Array.isArray(s.value)) {
|
|
1965
|
-
const
|
|
1966
|
-
s.value =
|
|
1969
|
+
const g = s.value[0] ?? null;
|
|
1970
|
+
s.value = g ?? null;
|
|
1967
1971
|
}
|
|
1968
|
-
_.value = await
|
|
1972
|
+
_.value = await B(s.value);
|
|
1969
1973
|
}
|
|
1970
1974
|
};
|
|
1971
1975
|
le(s, () => {
|
|
1972
1976
|
ot();
|
|
1973
|
-
}),
|
|
1974
|
-
addEventListener("keydown", Qe), addEventListener("scroll", et, !0), addEventListener("resize", tt), document.addEventListener("click", Xe, !0), c.value && $e(c.value).addEventListener("scroll", lt, !0), t.options?.length ?
|
|
1977
|
+
}), xe(async () => {
|
|
1978
|
+
addEventListener("keydown", Qe), addEventListener("scroll", et, !0), addEventListener("resize", tt), document.addEventListener("click", Xe, !0), c.value && $e(c.value).addEventListener("scroll", lt, !0), t.options?.length ? O.value = [...t.options] : t.data && (O.value = await me("")), await ot();
|
|
1975
1979
|
}), qe(() => {
|
|
1976
1980
|
removeEventListener("keydown", Qe), removeEventListener("scroll", et, !0), removeEventListener("resize", tt), document.removeEventListener("click", Xe, !0), c.value && $e(c.value).removeEventListener("scroll", lt, !0);
|
|
1977
1981
|
});
|
|
@@ -1985,34 +1989,34 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
1985
1989
|
body: JSON.stringify(We.value)
|
|
1986
1990
|
}).then((H) => H.json());
|
|
1987
1991
|
if (!t.options?.length && t.data) {
|
|
1988
|
-
const { data: H } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${$}`).then((
|
|
1989
|
-
_.value = H[0],
|
|
1992
|
+
const { data: H } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${$}`).then((ae) => ae.json());
|
|
1993
|
+
_.value = H[0], O.value.push(H[0]), s.value = $;
|
|
1990
1994
|
}
|
|
1991
1995
|
Re.value = !1, ne({ title: "Success!", message: "Object created." });
|
|
1992
1996
|
}
|
|
1993
1997
|
async function jt() {
|
|
1994
1998
|
if (!t.add) return null;
|
|
1995
|
-
const
|
|
1996
|
-
return at.value =
|
|
1999
|
+
const g = await fetch(`/api/template/form/${t.add.form}`).then((m) => m.json());
|
|
2000
|
+
return at.value = g.schema, Re.value = !0, null;
|
|
1997
2001
|
}
|
|
1998
|
-
function It(
|
|
2002
|
+
function It(g, m = 200) {
|
|
1999
2003
|
let $;
|
|
2000
2004
|
return (...H) => {
|
|
2001
|
-
$ && clearTimeout($), $ = window.setTimeout(() =>
|
|
2005
|
+
$ && clearTimeout($), $ = window.setTimeout(() => g(...H), m);
|
|
2002
2006
|
};
|
|
2003
2007
|
}
|
|
2004
|
-
const Et = It(async (
|
|
2005
|
-
|
|
2008
|
+
const Et = It(async (g) => {
|
|
2009
|
+
O.value = await me(g);
|
|
2006
2010
|
}, 200);
|
|
2007
|
-
return le(
|
|
2008
|
-
t.data && Et(
|
|
2009
|
-
}), le(() => t.options, (
|
|
2010
|
-
!t.data &&
|
|
2011
|
+
return le(M, (g) => {
|
|
2012
|
+
t.data && Et(g.trim());
|
|
2013
|
+
}), le(() => t.options, (g) => {
|
|
2014
|
+
!t.data && g?.length && (O.value = [...g]);
|
|
2011
2015
|
}, { immediate: !0 }), le(() => t.parent ?? t.parentValue, () => {
|
|
2012
|
-
t.data &&
|
|
2013
|
-
}), le(
|
|
2016
|
+
t.data && T();
|
|
2017
|
+
}), le(_e, async () => {
|
|
2014
2018
|
t.data && (a.value ? (z.value = [], s.value = [], r("change", [])) : (_.value = null, s.value = null, r("change", null)));
|
|
2015
|
-
}), (
|
|
2019
|
+
}), (g, m) => (i(), d(ee, null, [
|
|
2016
2020
|
I(J(xt), {
|
|
2017
2021
|
visible: Re.value,
|
|
2018
2022
|
"onUpdate:visible": m[1] || (m[1] = ($) => Re.value = $),
|
|
@@ -2035,11 +2039,11 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2035
2039
|
class: "flex gap-1 w-full",
|
|
2036
2040
|
ref_key: "selectRoot",
|
|
2037
2041
|
ref: u,
|
|
2038
|
-
onClick: m[4] || (m[4] =
|
|
2042
|
+
onClick: m[4] || (m[4] = ye(() => {
|
|
2039
2043
|
}, ["stop"]))
|
|
2040
2044
|
}, [
|
|
2041
2045
|
l("div", {
|
|
2042
|
-
class:
|
|
2046
|
+
class: C(["relative w-full font-sans", t.customClass])
|
|
2043
2047
|
}, [
|
|
2044
2048
|
m[9] || (m[9] = l("span", {
|
|
2045
2049
|
id: "react-select-live-region",
|
|
@@ -2053,7 +2057,7 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2053
2057
|
class: "sr-only"
|
|
2054
2058
|
}, null, -1)),
|
|
2055
2059
|
l("div", {
|
|
2056
|
-
class:
|
|
2060
|
+
class: C([
|
|
2057
2061
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
2058
2062
|
"border-gray-300 hover:border-gray-400",
|
|
2059
2063
|
f.value || y.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
@@ -2062,8 +2066,8 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2062
2066
|
role: "combobox",
|
|
2063
2067
|
"aria-expanded": f.value,
|
|
2064
2068
|
"aria-haspopup": "listbox",
|
|
2065
|
-
onKeydown:
|
|
2066
|
-
onClick:
|
|
2069
|
+
onKeydown: Ce,
|
|
2070
|
+
onClick: h,
|
|
2067
2071
|
"data-focus": f.value || y.value ? "true" : "false"
|
|
2068
2072
|
}, [
|
|
2069
2073
|
l("div", {
|
|
@@ -2071,25 +2075,25 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2071
2075
|
ref_key: "triggerRef",
|
|
2072
2076
|
ref: c
|
|
2073
2077
|
}, [
|
|
2074
|
-
a.value && z.value.length ? (i(!0), d(ee, { key: 0 },
|
|
2078
|
+
a.value && z.value.length ? (i(!0), d(ee, { key: 0 }, oe(W.value, ($) => (i(), d("div", {
|
|
2075
2079
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2076
2080
|
key: $.id
|
|
2077
2081
|
}, [
|
|
2078
|
-
l("div",
|
|
2082
|
+
l("div", Ya, [
|
|
2079
2083
|
$?.color ? (i(), d("span", {
|
|
2080
2084
|
key: 0,
|
|
2081
2085
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2082
|
-
style:
|
|
2083
|
-
}, null, 4)) :
|
|
2086
|
+
style: ke({ backgroundColor: $?.color })
|
|
2087
|
+
}, null, 4)) : A("", !0),
|
|
2084
2088
|
l("div", {
|
|
2085
2089
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2086
2090
|
title: $.text
|
|
2087
|
-
}, P($.text), 9,
|
|
2091
|
+
}, P($.text), 9, Qa)
|
|
2088
2092
|
]),
|
|
2089
2093
|
l("div", {
|
|
2090
2094
|
role: "button",
|
|
2091
2095
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2092
|
-
onClick:
|
|
2096
|
+
onClick: ye((H) => R($.id), ["stop"])
|
|
2093
2097
|
}, m[5] || (m[5] = [
|
|
2094
2098
|
l("svg", {
|
|
2095
2099
|
height: "14",
|
|
@@ -2101,27 +2105,27 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2101
2105
|
}, [
|
|
2102
2106
|
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" })
|
|
2103
2107
|
], -1)
|
|
2104
|
-
]), 8,
|
|
2105
|
-
]))), 128)) : !a.value && !y.value && _.value?.text &&
|
|
2108
|
+
]), 8, Xa)
|
|
2109
|
+
]))), 128)) : !a.value && !y.value && _.value?.text && M.value === "" ? (i(), d("div", {
|
|
2106
2110
|
key: 1,
|
|
2107
|
-
class:
|
|
2111
|
+
class: C(["truncate text-gray-900"]),
|
|
2108
2112
|
title: _.value.text
|
|
2109
2113
|
}, [
|
|
2110
2114
|
_.value?.color ? (i(), d("span", {
|
|
2111
2115
|
key: 0,
|
|
2112
2116
|
class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
|
|
2113
|
-
style:
|
|
2114
|
-
}, null, 4)) :
|
|
2117
|
+
style: ke({ backgroundColor: _.value?.color })
|
|
2118
|
+
}, null, 4)) : A("", !0),
|
|
2115
2119
|
l("span", {
|
|
2116
|
-
class:
|
|
2120
|
+
class: C({ "pl-5": _.value?.color })
|
|
2117
2121
|
}, P(_.value.text), 3)
|
|
2118
|
-
], 8,
|
|
2119
|
-
se.value ? (i(), d("div",
|
|
2120
|
-
l("div",
|
|
2121
|
-
!n.value &&
|
|
2122
|
+
], 8, es)) : A("", !0),
|
|
2123
|
+
se.value ? (i(), d("div", ts, P(V.value), 1)) : A("", !0),
|
|
2124
|
+
l("div", ls, [
|
|
2125
|
+
!n.value && g.search ? K((i(), d("input", {
|
|
2122
2126
|
key: 0,
|
|
2123
2127
|
ref_key: "inputRef",
|
|
2124
|
-
ref:
|
|
2128
|
+
ref: S,
|
|
2125
2129
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
2126
2130
|
autocapitalize: "none",
|
|
2127
2131
|
autocomplete: "off",
|
|
@@ -2130,24 +2134,24 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2130
2134
|
type: "text",
|
|
2131
2135
|
tabindex: "0",
|
|
2132
2136
|
"aria-autocomplete": "list",
|
|
2133
|
-
placeholder: (a.value && z.value.length ? " " : null) || (y.value && !
|
|
2134
|
-
"onUpdate:modelValue": m[2] || (m[2] = ($) =>
|
|
2137
|
+
placeholder: (a.value && z.value.length ? " " : null) || (y.value && !M.value?.length ? _.value?.text : " "),
|
|
2138
|
+
"onUpdate:modelValue": m[2] || (m[2] = ($) => M.value = $),
|
|
2135
2139
|
onFocus: Lt,
|
|
2136
2140
|
onBlur: St,
|
|
2137
2141
|
onKeydown: Me
|
|
2138
|
-
}, null, 40,
|
|
2139
|
-
[ie,
|
|
2140
|
-
]) :
|
|
2142
|
+
}, null, 40, os)), [
|
|
2143
|
+
[ie, M.value]
|
|
2144
|
+
]) : A("", !0)
|
|
2141
2145
|
])
|
|
2142
2146
|
], 512),
|
|
2143
|
-
l("div",
|
|
2147
|
+
l("div", as, [
|
|
2144
2148
|
ue.value ? (i(), d("button", {
|
|
2145
2149
|
key: 0,
|
|
2146
2150
|
type: "button",
|
|
2147
2151
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2148
2152
|
"aria-hidden": "true",
|
|
2149
2153
|
disabled: n.value,
|
|
2150
|
-
onClick:
|
|
2154
|
+
onClick: ye(k, ["stop"])
|
|
2151
2155
|
}, m[6] || (m[6] = [
|
|
2152
2156
|
l("svg", {
|
|
2153
2157
|
height: "20",
|
|
@@ -2157,14 +2161,14 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2157
2161
|
}, [
|
|
2158
2162
|
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" })
|
|
2159
2163
|
], -1)
|
|
2160
|
-
]), 8,
|
|
2164
|
+
]), 8, ss)) : A("", !0),
|
|
2161
2165
|
m[8] || (m[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2162
2166
|
l("button", {
|
|
2163
2167
|
type: "button",
|
|
2164
2168
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2165
2169
|
"aria-hidden": "true",
|
|
2166
2170
|
disabled: n.value,
|
|
2167
|
-
onClick: m[3] || (m[3] =
|
|
2171
|
+
onClick: m[3] || (m[3] = ye(($) => he(), ["stop"])),
|
|
2168
2172
|
title: f.value ? "Закрити список" : "Відкрити список"
|
|
2169
2173
|
}, m[7] || (m[7] = [
|
|
2170
2174
|
l("svg", {
|
|
@@ -2175,31 +2179,31 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2175
2179
|
}, [
|
|
2176
2180
|
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" })
|
|
2177
2181
|
], -1)
|
|
2178
|
-
]), 8,
|
|
2182
|
+
]), 8, ns)
|
|
2179
2183
|
])
|
|
2180
|
-
], 42,
|
|
2184
|
+
], 42, Za),
|
|
2181
2185
|
(i(), re(yt, { to: "body" }, [
|
|
2182
2186
|
f.value ? (i(), d("div", {
|
|
2183
2187
|
key: 0,
|
|
2184
2188
|
ref_key: "dropdownRef",
|
|
2185
2189
|
ref: p,
|
|
2186
|
-
class:
|
|
2190
|
+
class: C([
|
|
2187
2191
|
"fixed z-[3000] rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]"
|
|
2188
2192
|
]),
|
|
2189
|
-
style:
|
|
2193
|
+
style: ke(b.value),
|
|
2190
2194
|
role: "listbox"
|
|
2191
2195
|
}, [
|
|
2192
2196
|
l("div", {
|
|
2193
2197
|
class: "overflow-y-auto py-1",
|
|
2194
|
-
style:
|
|
2198
|
+
style: ke({ maxHeight: b.value.maxHeight || "300px" }),
|
|
2195
2199
|
ref_key: "listRef",
|
|
2196
2200
|
ref: v
|
|
2197
2201
|
}, [
|
|
2198
|
-
te.value.length ? (i(!0), d(ee, { key: 0 },
|
|
2202
|
+
te.value.length ? (i(!0), d(ee, { key: 0 }, oe(te.value, ($, H) => (i(), d("div", {
|
|
2199
2203
|
key: $.id,
|
|
2200
2204
|
ref_for: !0,
|
|
2201
|
-
ref: (
|
|
2202
|
-
class:
|
|
2205
|
+
ref: (ae) => U.value[H] = ae,
|
|
2206
|
+
class: C([
|
|
2203
2207
|
"flex px-3 py-2 cursor-default select-none text-gray-900 ",
|
|
2204
2208
|
de($.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
|
|
2205
2209
|
E.value === H && !de($.id) ? "bg-blue-100" : ""
|
|
@@ -2207,24 +2211,24 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2207
2211
|
"aria-disabled": de($.id) ? "true" : "false",
|
|
2208
2212
|
role: "option",
|
|
2209
2213
|
tabindex: "-1",
|
|
2210
|
-
onClick: (
|
|
2214
|
+
onClick: (ae) => Y($)
|
|
2211
2215
|
}, [
|
|
2212
2216
|
$?.color ? (i(), d("span", {
|
|
2213
2217
|
key: 0,
|
|
2214
2218
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2215
|
-
style:
|
|
2216
|
-
}, null, 4)) :
|
|
2219
|
+
style: ke({ backgroundColor: $?.color })
|
|
2220
|
+
}, null, 4)) : A("", !0),
|
|
2217
2221
|
l("div", {
|
|
2218
|
-
class:
|
|
2222
|
+
class: C([
|
|
2219
2223
|
"leading-[19px]",
|
|
2220
2224
|
E.value === $.id ? "text-white" : "",
|
|
2221
2225
|
// active style like react-select
|
|
2222
2226
|
(E.value === H, "")
|
|
2223
2227
|
])
|
|
2224
2228
|
}, P($.text), 3)
|
|
2225
|
-
], 10,
|
|
2229
|
+
], 10, rs))), 128)) : (i(), d("div", is, " No options "))
|
|
2226
2230
|
], 4)
|
|
2227
|
-
], 4)) :
|
|
2231
|
+
], 4)) : A("", !0)
|
|
2228
2232
|
]))
|
|
2229
2233
|
], 2),
|
|
2230
2234
|
t.add ? (i(), d("button", {
|
|
@@ -2239,11 +2243,11 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2239
2243
|
height: "16"
|
|
2240
2244
|
}),
|
|
2241
2245
|
m[11] || (m[11] = l("span", null, "Додати", -1))
|
|
2242
|
-
], 8,
|
|
2246
|
+
], 8, us)) : A("", !0)
|
|
2243
2247
|
], 512)
|
|
2244
2248
|
], 64));
|
|
2245
2249
|
}
|
|
2246
|
-
}),
|
|
2250
|
+
}), ds = ["placeholder", "disabled"], cs = /* @__PURE__ */ F({
|
|
2247
2251
|
__name: "vs-input-textarea",
|
|
2248
2252
|
props: /* @__PURE__ */ Q({
|
|
2249
2253
|
style: { default: () => ({}) },
|
|
@@ -2259,21 +2263,21 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2259
2263
|
}),
|
|
2260
2264
|
emits: ["update:modelValue"],
|
|
2261
2265
|
setup(o) {
|
|
2262
|
-
const e = o, { inputClass: t } =
|
|
2266
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
2263
2267
|
return (a, n) => K((i(), d("textarea", {
|
|
2264
2268
|
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
2265
2269
|
placeholder: a.placeholder,
|
|
2266
2270
|
disabled: a.disabled,
|
|
2267
2271
|
row: "2",
|
|
2268
|
-
class:
|
|
2272
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [J(t)]]),
|
|
2269
2273
|
style: {
|
|
2270
2274
|
border: "1px solid #CFD9E0"
|
|
2271
2275
|
}
|
|
2272
|
-
}, null, 10,
|
|
2276
|
+
}, null, 10, ds)), [
|
|
2273
2277
|
[ie, r.value]
|
|
2274
2278
|
]);
|
|
2275
2279
|
}
|
|
2276
|
-
}),
|
|
2280
|
+
}), ps = {}, fs = {
|
|
2277
2281
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2278
2282
|
viewBox: "0 0 24 24",
|
|
2279
2283
|
fill: "none",
|
|
@@ -2283,8 +2287,8 @@ const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col
|
|
|
2283
2287
|
"stroke-linejoin": "round",
|
|
2284
2288
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
2285
2289
|
};
|
|
2286
|
-
function
|
|
2287
|
-
return i(), d("svg",
|
|
2290
|
+
function vs(o, e) {
|
|
2291
|
+
return i(), d("svg", fs, e[0] || (e[0] = [
|
|
2288
2292
|
l("path", {
|
|
2289
2293
|
stroke: "none",
|
|
2290
2294
|
d: "M0 0h24v24H0z",
|
|
@@ -2294,7 +2298,7 @@ function fs(o, e) {
|
|
|
2294
2298
|
l("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
2295
2299
|
]));
|
|
2296
2300
|
}
|
|
2297
|
-
const
|
|
2301
|
+
const ms = /* @__PURE__ */ N(ps, [["render", vs]]), hs = {}, gs = {
|
|
2298
2302
|
class: "flex-shrink-0 mt-0.5 size-3.5",
|
|
2299
2303
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2300
2304
|
viewBox: "0 0 24 24",
|
|
@@ -2304,15 +2308,15 @@ const vs = /* @__PURE__ */ N(cs, [["render", fs]]), ms = {}, hs = {
|
|
|
2304
2308
|
"stroke-linecap": "round",
|
|
2305
2309
|
"stroke-linejoin": "round"
|
|
2306
2310
|
};
|
|
2307
|
-
function
|
|
2308
|
-
return i(), d("svg",
|
|
2311
|
+
function bs(o, e) {
|
|
2312
|
+
return i(), d("svg", gs, e[0] || (e[0] = [
|
|
2309
2313
|
l("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
2310
2314
|
l("path", { d: "M7 20V4" }, null, -1),
|
|
2311
2315
|
l("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
|
2312
2316
|
l("path", { d: "M17 4v16" }, null, -1)
|
|
2313
2317
|
]));
|
|
2314
2318
|
}
|
|
2315
|
-
const
|
|
2319
|
+
const ys = /* @__PURE__ */ N(hs, [["render", bs]]), xs = {}, ws = {
|
|
2316
2320
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2317
2321
|
width: "14",
|
|
2318
2322
|
height: "14",
|
|
@@ -2323,8 +2327,8 @@ const bs = /* @__PURE__ */ N(ms, [["render", gs]]), ys = {}, xs = {
|
|
|
2323
2327
|
"stroke-linecap": "round",
|
|
2324
2328
|
"stroke-linejoin": "round"
|
|
2325
2329
|
};
|
|
2326
|
-
function
|
|
2327
|
-
return i(), d("svg",
|
|
2330
|
+
function ks(o, e) {
|
|
2331
|
+
return i(), d("svg", ws, e[0] || (e[0] = [
|
|
2328
2332
|
l("path", {
|
|
2329
2333
|
stroke: "none",
|
|
2330
2334
|
d: "M0 0h24v24H0z",
|
|
@@ -2335,7 +2339,7 @@ function ws(o, e) {
|
|
|
2335
2339
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
2336
2340
|
]));
|
|
2337
2341
|
}
|
|
2338
|
-
const
|
|
2342
|
+
const _s = /* @__PURE__ */ N(xs, [["render", ks]]), $s = {}, Vs = {
|
|
2339
2343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2340
2344
|
viewBox: "0 0 24 24",
|
|
2341
2345
|
fill: "none",
|
|
@@ -2345,7 +2349,7 @@ const ks = /* @__PURE__ */ N(ys, [["render", ws]]), _s = {}, $s = {
|
|
|
2345
2349
|
"stroke-linejoin": "round"
|
|
2346
2350
|
};
|
|
2347
2351
|
function Cs(o, e) {
|
|
2348
|
-
return i(), d("svg",
|
|
2352
|
+
return i(), d("svg", Vs, e[0] || (e[0] = [
|
|
2349
2353
|
l("path", {
|
|
2350
2354
|
stroke: "none",
|
|
2351
2355
|
d: "M0 0h24v24H0z",
|
|
@@ -2356,7 +2360,7 @@ function Cs(o, e) {
|
|
|
2356
2360
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
2357
2361
|
]));
|
|
2358
2362
|
}
|
|
2359
|
-
const
|
|
2363
|
+
const Ms = /* @__PURE__ */ N($s, [["render", Cs]]), Ls = {}, Ss = {
|
|
2360
2364
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2361
2365
|
viewBox: "0 0 24 24",
|
|
2362
2366
|
fill: "none",
|
|
@@ -2365,22 +2369,22 @@ const Vs = /* @__PURE__ */ N(_s, [["render", Cs]]), Ms = {}, Ls = {
|
|
|
2365
2369
|
"stroke-linecap": "round",
|
|
2366
2370
|
"stroke-linejoin": "round"
|
|
2367
2371
|
};
|
|
2368
|
-
function
|
|
2369
|
-
return i(), d("svg",
|
|
2370
|
-
|
|
2372
|
+
function Bs(o, e) {
|
|
2373
|
+
return i(), d("svg", Ss, e[0] || (e[0] = [
|
|
2374
|
+
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)
|
|
2371
2375
|
]));
|
|
2372
2376
|
}
|
|
2373
|
-
const ft = /* @__PURE__ */ N(
|
|
2377
|
+
const ft = /* @__PURE__ */ N(Ls, [["render", Bs]]), js = {}, Is = {
|
|
2374
2378
|
viewBox: "0 0 178 90",
|
|
2375
2379
|
fill: "none",
|
|
2376
2380
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2377
2381
|
};
|
|
2378
|
-
function
|
|
2379
|
-
return i(), d("svg",
|
|
2380
|
-
|
|
2382
|
+
function Es(o, e) {
|
|
2383
|
+
return i(), d("svg", Is, e[0] || (e[0] = [
|
|
2384
|
+
ce('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
|
|
2381
2385
|
]));
|
|
2382
2386
|
}
|
|
2383
|
-
const
|
|
2387
|
+
const zs = /* @__PURE__ */ N(js, [["render", Es]]), As = {}, Fs = {
|
|
2384
2388
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2385
2389
|
viewBox: "0 0 24 24",
|
|
2386
2390
|
fill: "none",
|
|
@@ -2389,25 +2393,25 @@ const Es = /* @__PURE__ */ N(Bs, [["render", Is]]), zs = {}, Fs = {
|
|
|
2389
2393
|
"stroke-linecap": "round",
|
|
2390
2394
|
"stroke-linejoin": "round"
|
|
2391
2395
|
};
|
|
2392
|
-
function
|
|
2396
|
+
function Ds(o, e) {
|
|
2393
2397
|
return i(), d("svg", Fs, e[0] || (e[0] = [
|
|
2394
2398
|
l("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
|
|
2395
2399
|
]));
|
|
2396
2400
|
}
|
|
2397
|
-
const
|
|
2401
|
+
const Os = /* @__PURE__ */ N(As, [["render", Ds]]), Us = { class: "vs-datatable border rounded-xl w-full flex-grow" }, Ts = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, Rs = { class: "relative w-full" }, Ps = { class: "table-wrapper flex gap-2" }, Hs = { class: "vs-popover inline-block text-slate-700" }, Ns = { class: "text-center" }, qs = { class: "" }, Gs = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, Js = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, Ws = { class: "text-sm items-center text-gray-800 flex gap-1" }, Ks = { class: "w-full overflow-x-auto" }, Zs = { class: "w-full table-auto caption-bottom text-sm" }, Ys = { class: "[&_tr]:border-b" }, Qs = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, Xs = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, en = {
|
|
2398
2402
|
key: 0,
|
|
2399
2403
|
colspan: "100%",
|
|
2400
2404
|
class: "text-center"
|
|
2401
|
-
},
|
|
2405
|
+
}, tn = { class: "w-full" }, ln = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, on = ["onDragstart", "onDragover", "onDrop"], an = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, sn = { class: "flex items-center justify-center" }, nn = {
|
|
2402
2406
|
key: 0,
|
|
2403
2407
|
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"
|
|
2404
|
-
},
|
|
2408
|
+
}, rn = { key: 0 }, un = ["src"], dn = {
|
|
2405
2409
|
key: 1,
|
|
2406
2410
|
class: "rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"
|
|
2407
|
-
},
|
|
2411
|
+
}, cn = ["innerHTML"], pn = {
|
|
2408
2412
|
key: 2,
|
|
2409
2413
|
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"
|
|
2410
|
-
},
|
|
2414
|
+
}, fn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, vn = { class: "flex items-center justify-center gap-2" }, mn = ["onClick"], hn = ["onClick"], gn = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, bn = /* @__PURE__ */ F({
|
|
2411
2415
|
__name: "vs-input-datatable",
|
|
2412
2416
|
props: /* @__PURE__ */ Q({
|
|
2413
2417
|
colModel: {},
|
|
@@ -2426,115 +2430,118 @@ const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable
|
|
|
2426
2430
|
setup(o) {
|
|
2427
2431
|
const e = o, t = X(o, "modelValue"), r = w({}), a = w(""), n = D(() => {
|
|
2428
2432
|
if (!a.value) return t.value ?? [];
|
|
2429
|
-
const
|
|
2430
|
-
return t.value.filter((
|
|
2431
|
-
const
|
|
2432
|
-
return
|
|
2433
|
+
const T = a.value.toLowerCase();
|
|
2434
|
+
return t.value.filter((B) => e.colModel?.some((j) => {
|
|
2435
|
+
const q = B[j.key];
|
|
2436
|
+
return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(T) : String(q).toLowerCase().includes(T) : !1;
|
|
2433
2437
|
}));
|
|
2434
|
-
}), s = w(null), u = w(null), c = w(!1), v = w(null), p = w({ top: 0, left: 0 }), f = (
|
|
2435
|
-
s.value =
|
|
2436
|
-
}, y = (
|
|
2437
|
-
u.value =
|
|
2438
|
-
}, _ = (
|
|
2439
|
-
if (s.value === null || s.value ===
|
|
2438
|
+
}), s = w(null), u = w(null), c = w(!1), v = w(null), p = w({ top: 0, left: 0 }), f = (T) => {
|
|
2439
|
+
s.value = T;
|
|
2440
|
+
}, y = (T) => {
|
|
2441
|
+
u.value = T;
|
|
2442
|
+
}, _ = (T) => {
|
|
2443
|
+
if (s.value === null || s.value === T) {
|
|
2440
2444
|
s.value = null, u.value = null;
|
|
2441
2445
|
return;
|
|
2442
2446
|
}
|
|
2443
|
-
const
|
|
2444
|
-
|
|
2445
|
-
},
|
|
2446
|
-
const
|
|
2447
|
-
p.value = { top:
|
|
2447
|
+
const B = [...t.value], [j] = B.splice(s.value, 1);
|
|
2448
|
+
B.splice(T, 0, j), t.value = B, s.value = null, u.value = null;
|
|
2449
|
+
}, O = (T) => {
|
|
2450
|
+
const j = T.currentTarget.getBoundingClientRect();
|
|
2451
|
+
p.value = { top: j.bottom + window.scrollY, left: j.left + window.scrollX }, c.value = !c.value;
|
|
2448
2452
|
}, E = () => {
|
|
2449
2453
|
v.value && v.value.click();
|
|
2450
|
-
},
|
|
2451
|
-
const
|
|
2452
|
-
return
|
|
2453
|
-
},
|
|
2454
|
-
const
|
|
2455
|
-
if (!
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2454
|
+
}, U = (T) => {
|
|
2455
|
+
const B = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], j = T.toLowerCase();
|
|
2456
|
+
return B.some((q) => j.endsWith(q));
|
|
2457
|
+
}, M = (T) => {
|
|
2458
|
+
const j = T.target.files?.[0];
|
|
2459
|
+
if (!j) return;
|
|
2460
|
+
const q = new FileReader();
|
|
2461
|
+
q.onload = (Z) => {
|
|
2458
2462
|
try {
|
|
2459
|
-
const
|
|
2460
|
-
if (typeof
|
|
2461
|
-
const
|
|
2462
|
-
Array.isArray(
|
|
2463
|
+
const he = Z.target?.result;
|
|
2464
|
+
if (typeof he == "string") {
|
|
2465
|
+
const h = JSON.parse(he);
|
|
2466
|
+
Array.isArray(h) && t.value.push(...h);
|
|
2463
2467
|
}
|
|
2464
|
-
} catch (
|
|
2465
|
-
console.error("Error parsing file:",
|
|
2468
|
+
} catch (he) {
|
|
2469
|
+
console.error("Error parsing file:", he);
|
|
2466
2470
|
}
|
|
2467
|
-
},
|
|
2468
|
-
},
|
|
2469
|
-
const
|
|
2470
|
-
|
|
2471
|
+
}, q.readAsText(j);
|
|
2472
|
+
}, S = () => {
|
|
2473
|
+
const T = JSON.stringify(t.value, null, 2), B = new Blob([T], { type: "application/json" }), j = URL.createObjectURL(B), q = document.createElement("a");
|
|
2474
|
+
q.href = j, q.download = "data.json", q.click(), URL.revokeObjectURL(j);
|
|
2471
2475
|
};
|
|
2472
|
-
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2475
|
-
const
|
|
2476
|
-
r.value[
|
|
2476
|
+
xe(async () => {
|
|
2477
|
+
const T = e.colModel?.filter((B) => B.data);
|
|
2478
|
+
T?.length && Promise.all(T.map(async (B) => {
|
|
2479
|
+
const q = await (await fetch(`/api/suggest/${B.data}`)).json();
|
|
2480
|
+
r.value[B.key] = q.data;
|
|
2477
2481
|
}));
|
|
2478
2482
|
});
|
|
2479
2483
|
const x = w(""), b = w(!1);
|
|
2480
2484
|
let z = "edit", W = 0;
|
|
2481
|
-
const
|
|
2485
|
+
const V = w({}), se = w({});
|
|
2482
2486
|
async function ue() {
|
|
2483
|
-
x.value = "Додати", b.value = !0, z = "add",
|
|
2487
|
+
x.value = "Додати", b.value = !0, z = "add", V.value = {};
|
|
2484
2488
|
}
|
|
2485
|
-
function de(
|
|
2486
|
-
const
|
|
2487
|
-
return r.value[
|
|
2489
|
+
function de(T, B) {
|
|
2490
|
+
const j = B.key || B.name;
|
|
2491
|
+
return r.value[j] && T[j] ? r.value[j].find((q) => q.id.toString() === T[j].toString())?.text ?? T[j] : T[j] || "-";
|
|
2488
2492
|
}
|
|
2489
|
-
async function te(
|
|
2490
|
-
x.value = "Редагувати", b.value = !0, z = "edit", W =
|
|
2493
|
+
async function te(T, B) {
|
|
2494
|
+
x.value = "Редагувати", b.value = !0, z = "edit", W = B, V.value = { ...T };
|
|
2491
2495
|
}
|
|
2492
2496
|
function ze() {
|
|
2493
|
-
const
|
|
2494
|
-
if (
|
|
2495
|
-
ne({ type: "warning", title: "Помилка валідації", message: Object.entries(
|
|
2497
|
+
const T = se.value.validate();
|
|
2498
|
+
if (T) {
|
|
2499
|
+
ne({ type: "warning", title: "Помилка валідації", message: Object.entries(T).map(([B, j]) => `${B}: ${j}`).join(`
|
|
2496
2500
|
`) });
|
|
2497
2501
|
return;
|
|
2498
2502
|
}
|
|
2499
|
-
z === "add" ? Array.isArray(t.value) ? t.value = [...t.value,
|
|
2503
|
+
z === "add" ? Array.isArray(t.value) ? t.value = [...t.value, V.value] : t.value = [V.value] : t.value = t.value.map((B, j) => j === W ? V.value : B), b.value = !1;
|
|
2500
2504
|
}
|
|
2501
|
-
function
|
|
2502
|
-
t.value = t.value.filter((
|
|
2505
|
+
function _e(T) {
|
|
2506
|
+
t.value = t.value.filter((B, j) => j !== T);
|
|
2503
2507
|
}
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
+
function me() {
|
|
2509
|
+
b.value = !1;
|
|
2510
|
+
}
|
|
2511
|
+
return (T, B) => (i(), d("div", Us, [
|
|
2512
|
+
l("div", Ts, [
|
|
2513
|
+
l("div", Rs, [
|
|
2514
|
+
I(ms, {
|
|
2508
2515
|
width: "14",
|
|
2509
2516
|
height: "14",
|
|
2510
2517
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2511
2518
|
}),
|
|
2512
2519
|
K(l("input", {
|
|
2513
2520
|
type: "text",
|
|
2514
|
-
"onUpdate:modelValue":
|
|
2521
|
+
"onUpdate:modelValue": B[0] || (B[0] = (j) => a.value = j),
|
|
2515
2522
|
placeholder: "Пошук",
|
|
2516
2523
|
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"
|
|
2517
2524
|
}, null, 512), [
|
|
2518
2525
|
[ie, a.value]
|
|
2519
2526
|
])
|
|
2520
2527
|
]),
|
|
2521
|
-
l("div",
|
|
2528
|
+
l("div", Ps, [
|
|
2522
2529
|
l("input", {
|
|
2523
2530
|
ref_key: "fileInput",
|
|
2524
2531
|
ref: v,
|
|
2525
|
-
onChange:
|
|
2532
|
+
onChange: M,
|
|
2526
2533
|
class: "hidden",
|
|
2527
2534
|
accept: ".json",
|
|
2528
2535
|
type: "file"
|
|
2529
2536
|
}, null, 544),
|
|
2530
|
-
l("div",
|
|
2531
|
-
l("div",
|
|
2532
|
-
l("div",
|
|
2537
|
+
l("div", Hs, [
|
|
2538
|
+
l("div", Ns, [
|
|
2539
|
+
l("div", qs, [
|
|
2533
2540
|
l("button", {
|
|
2534
|
-
onClick:
|
|
2541
|
+
onClick: O,
|
|
2535
2542
|
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"
|
|
2536
2543
|
}, [
|
|
2537
|
-
I(
|
|
2544
|
+
I(ys, {
|
|
2538
2545
|
height: "16",
|
|
2539
2546
|
width: "16"
|
|
2540
2547
|
})
|
|
@@ -2547,91 +2554,91 @@ const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable
|
|
|
2547
2554
|
c.value ? (i(), d("div", {
|
|
2548
2555
|
key: 0,
|
|
2549
2556
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
2550
|
-
style:
|
|
2557
|
+
style: ke([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: p.value.top + "px", left: p.value.left + "px" }])
|
|
2551
2558
|
}, [
|
|
2552
|
-
l("div",
|
|
2553
|
-
l("div",
|
|
2559
|
+
l("div", Gs, [
|
|
2560
|
+
l("div", Js, [
|
|
2554
2561
|
l("button", {
|
|
2555
2562
|
onClick: E,
|
|
2556
2563
|
class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2557
2564
|
}, [
|
|
2558
|
-
I(
|
|
2565
|
+
I(_s, {
|
|
2559
2566
|
class: "text-black",
|
|
2560
2567
|
width: "14",
|
|
2561
2568
|
height: "14"
|
|
2562
2569
|
}),
|
|
2563
|
-
|
|
2570
|
+
B[4] || (B[4] = fe(" Імпортувати ", -1))
|
|
2564
2571
|
]),
|
|
2565
2572
|
l("button", {
|
|
2566
|
-
onClick:
|
|
2573
|
+
onClick: S,
|
|
2567
2574
|
class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2568
2575
|
}, [
|
|
2569
|
-
l("span",
|
|
2570
|
-
I(
|
|
2576
|
+
l("span", Ws, [
|
|
2577
|
+
I(Ms, {
|
|
2571
2578
|
class: "text-black",
|
|
2572
2579
|
width: "14",
|
|
2573
2580
|
height: "14"
|
|
2574
2581
|
}),
|
|
2575
|
-
|
|
2582
|
+
B[5] || (B[5] = fe(" Експортувати ", -1))
|
|
2576
2583
|
])
|
|
2577
2584
|
])
|
|
2578
2585
|
])
|
|
2579
2586
|
])
|
|
2580
|
-
], 4)) :
|
|
2587
|
+
], 4)) : A("", !0)
|
|
2581
2588
|
])),
|
|
2582
2589
|
l("button", {
|
|
2583
2590
|
onClick: ue,
|
|
2584
2591
|
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"
|
|
2585
2592
|
}, [
|
|
2586
2593
|
I(Ue),
|
|
2587
|
-
|
|
2594
|
+
B[6] || (B[6] = fe(" Додати ", -1))
|
|
2588
2595
|
])
|
|
2589
2596
|
]),
|
|
2590
|
-
l("div",
|
|
2591
|
-
l("table",
|
|
2592
|
-
l("thead",
|
|
2593
|
-
l("tr",
|
|
2594
|
-
l("th",
|
|
2597
|
+
l("div", Ks, [
|
|
2598
|
+
l("table", Zs, [
|
|
2599
|
+
l("thead", Ys, [
|
|
2600
|
+
l("tr", Qs, [
|
|
2601
|
+
l("th", Xs, [
|
|
2595
2602
|
I(ft, {
|
|
2596
2603
|
width: "24",
|
|
2597
2604
|
height: "24",
|
|
2598
2605
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2599
2606
|
})
|
|
2600
2607
|
]),
|
|
2601
|
-
(i(!0), d(ee, null,
|
|
2602
|
-
key:
|
|
2608
|
+
(i(!0), d(ee, null, oe(T.colModel, (j) => (i(), d("th", {
|
|
2609
|
+
key: j.key,
|
|
2603
2610
|
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]"
|
|
2604
|
-
}, P(
|
|
2605
|
-
|
|
2611
|
+
}, P(j.ua || j.label), 1))), 128)),
|
|
2612
|
+
B[7] || (B[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))
|
|
2606
2613
|
])
|
|
2607
2614
|
]),
|
|
2608
2615
|
l("tbody", {
|
|
2609
|
-
class:
|
|
2616
|
+
class: C({ "[&_tr:last-child]:border-0": !u.value })
|
|
2610
2617
|
}, [
|
|
2611
|
-
n.value.length === 0 ? (i(), d("td",
|
|
2612
|
-
l("div",
|
|
2613
|
-
l("div",
|
|
2614
|
-
I(
|
|
2615
|
-
|
|
2618
|
+
n.value.length === 0 ? (i(), d("td", en, [
|
|
2619
|
+
l("div", tn, [
|
|
2620
|
+
l("div", ln, [
|
|
2621
|
+
I(zs, { class: "w-48 mx-auto" }),
|
|
2622
|
+
B[8] || (B[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2616
2623
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2617
2624
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
2618
2625
|
], -1))
|
|
2619
2626
|
])
|
|
2620
2627
|
])
|
|
2621
|
-
])) :
|
|
2622
|
-
(i(!0), d(ee, null,
|
|
2623
|
-
key:
|
|
2624
|
-
class:
|
|
2625
|
-
"opacity-50": s.value ===
|
|
2626
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value ===
|
|
2628
|
+
])) : A("", !0),
|
|
2629
|
+
(i(!0), d(ee, null, oe(n.value, (j, q) => (i(), d("tr", {
|
|
2630
|
+
key: j.id,
|
|
2631
|
+
class: C(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2632
|
+
"opacity-50": s.value === q,
|
|
2633
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === q
|
|
2627
2634
|
}]),
|
|
2628
2635
|
draggable: "true",
|
|
2629
|
-
onDragstart: (Z) => f(
|
|
2630
|
-
onDragover:
|
|
2631
|
-
onDrop: (Z) => _(
|
|
2636
|
+
onDragstart: (Z) => f(q),
|
|
2637
|
+
onDragover: ye((Z) => y(q), ["prevent"]),
|
|
2638
|
+
onDrop: (Z) => _(q)
|
|
2632
2639
|
}, [
|
|
2633
|
-
l("td",
|
|
2634
|
-
l("div",
|
|
2640
|
+
l("td", an, [
|
|
2641
|
+
l("div", sn, [
|
|
2635
2642
|
I(ft, {
|
|
2636
2643
|
width: "24",
|
|
2637
2644
|
height: "24",
|
|
@@ -2639,41 +2646,41 @@ const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable
|
|
|
2639
2646
|
})
|
|
2640
2647
|
])
|
|
2641
2648
|
]),
|
|
2642
|
-
(i(!0), d(ee, null,
|
|
2649
|
+
(i(!0), d(ee, null, oe(T.colModel, (Z) => (i(), d("td", {
|
|
2643
2650
|
key: Z.key,
|
|
2644
2651
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2645
2652
|
}, [
|
|
2646
|
-
Z.type === "file" ? (i(), d("div",
|
|
2647
|
-
|
|
2653
|
+
Z.type === "file" ? (i(), d("div", nn, [
|
|
2654
|
+
U(de(j, Z)) ? (i(), d("div", rn, [
|
|
2648
2655
|
l("img", {
|
|
2649
|
-
src: de(
|
|
2656
|
+
src: de(j, Z),
|
|
2650
2657
|
alt: "alt",
|
|
2651
2658
|
width: "45",
|
|
2652
2659
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
2653
|
-
}, null, 8,
|
|
2654
|
-
])) : (i(), d("div",
|
|
2660
|
+
}, null, 8, un)
|
|
2661
|
+
])) : (i(), d("div", dn, [
|
|
2655
2662
|
I(_t, { class: "w-[25px] min-w-[25px] h-[25px]" })
|
|
2656
2663
|
]))
|
|
2657
2664
|
])) : Z.type === "tiptap-editor" ? (i(), d("div", {
|
|
2658
2665
|
key: 1,
|
|
2659
2666
|
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",
|
|
2660
|
-
innerHTML: de(
|
|
2661
|
-
}, null, 8,
|
|
2667
|
+
innerHTML: de(j, Z)
|
|
2668
|
+
}, null, 8, cn)) : (i(), d("div", pn, P(de(j, Z)), 1))
|
|
2662
2669
|
]))), 128)),
|
|
2663
|
-
l("td",
|
|
2664
|
-
l("div",
|
|
2670
|
+
l("td", fn, [
|
|
2671
|
+
l("div", vn, [
|
|
2665
2672
|
l("button", {
|
|
2666
|
-
onClick: (Z) => te(
|
|
2673
|
+
onClick: (Z) => te(j, q),
|
|
2667
2674
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2668
2675
|
}, [
|
|
2669
|
-
I(
|
|
2676
|
+
I(Os, {
|
|
2670
2677
|
width: "24",
|
|
2671
2678
|
height: "24",
|
|
2672
2679
|
class: "w-3 h-3"
|
|
2673
2680
|
})
|
|
2674
|
-
], 8,
|
|
2681
|
+
], 8, mn),
|
|
2675
2682
|
l("button", {
|
|
2676
|
-
onClick: (Z) =>
|
|
2683
|
+
onClick: (Z) => _e(q),
|
|
2677
2684
|
class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
|
|
2678
2685
|
}, [
|
|
2679
2686
|
I(Je, {
|
|
@@ -2681,30 +2688,31 @@ const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable
|
|
|
2681
2688
|
height: "24",
|
|
2682
2689
|
class: "w-3 h-3"
|
|
2683
2690
|
})
|
|
2684
|
-
], 8,
|
|
2691
|
+
], 8, hn)
|
|
2685
2692
|
])
|
|
2686
2693
|
])
|
|
2687
|
-
], 42,
|
|
2694
|
+
], 42, on))), 128))
|
|
2688
2695
|
], 2)
|
|
2689
2696
|
])
|
|
2690
2697
|
]),
|
|
2691
2698
|
I(J(xt), {
|
|
2692
2699
|
visible: b.value,
|
|
2693
2700
|
title: x.value,
|
|
2694
|
-
size: "lg"
|
|
2701
|
+
size: "lg",
|
|
2702
|
+
onClose: me
|
|
2695
2703
|
}, {
|
|
2696
2704
|
default: Be(() => [
|
|
2697
2705
|
I(Te, {
|
|
2698
2706
|
schema: e.colModel,
|
|
2699
|
-
values:
|
|
2700
|
-
"onUpdate:values":
|
|
2707
|
+
values: V.value,
|
|
2708
|
+
"onUpdate:values": B[1] || (B[1] = (j) => V.value = j),
|
|
2701
2709
|
form: se.value,
|
|
2702
|
-
"onUpdate:form":
|
|
2710
|
+
"onUpdate:form": B[2] || (B[2] = (j) => se.value = j)
|
|
2703
2711
|
}, null, 8, ["schema", "values", "form"]),
|
|
2704
|
-
l("div",
|
|
2712
|
+
l("div", gn, [
|
|
2705
2713
|
l("button", {
|
|
2706
2714
|
type: "button",
|
|
2707
|
-
onClick:
|
|
2715
|
+
onClick: B[3] || (B[3] = (j) => b.value = !1),
|
|
2708
2716
|
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"
|
|
2709
2717
|
}, " Скасувати "),
|
|
2710
2718
|
l("button", {
|
|
@@ -2718,7 +2726,7 @@ const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable
|
|
|
2718
2726
|
}, 8, ["visible", "title"])
|
|
2719
2727
|
]));
|
|
2720
2728
|
}
|
|
2721
|
-
}),
|
|
2729
|
+
}), yn = {
|
|
2722
2730
|
draw: {
|
|
2723
2731
|
toolbar: {
|
|
2724
2732
|
actions: {
|
|
@@ -2838,7 +2846,7 @@ function Oe(o) {
|
|
|
2838
2846
|
features: (o.features || []).map((e) => Oe(e)).filter(Boolean)
|
|
2839
2847
|
} : o : null;
|
|
2840
2848
|
}
|
|
2841
|
-
function
|
|
2849
|
+
function xn(o) {
|
|
2842
2850
|
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? Oe(o) : o.geom ? {
|
|
2843
2851
|
type: "Feature",
|
|
2844
2852
|
geometry: Oe({
|
|
@@ -2852,7 +2860,7 @@ function yn(o) {
|
|
|
2852
2860
|
properties: {}
|
|
2853
2861
|
} : null : null;
|
|
2854
2862
|
}
|
|
2855
|
-
const
|
|
2863
|
+
const wn = {}, kn = {
|
|
2856
2864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2857
2865
|
viewBox: "0 0 24 24",
|
|
2858
2866
|
stroke: "currentColor",
|
|
@@ -2862,8 +2870,8 @@ const xn = {}, wn = {
|
|
|
2862
2870
|
"stroke-linejoin": "round",
|
|
2863
2871
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
|
|
2864
2872
|
};
|
|
2865
|
-
function
|
|
2866
|
-
return i(), d("svg",
|
|
2873
|
+
function _n(o, e) {
|
|
2874
|
+
return i(), d("svg", kn, e[0] || (e[0] = [
|
|
2867
2875
|
l("path", {
|
|
2868
2876
|
stroke: "none",
|
|
2869
2877
|
d: "M0 0h24v24H0z",
|
|
@@ -2873,7 +2881,7 @@ function kn(o, e) {
|
|
|
2873
2881
|
l("path", { d: "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" }, null, -1)
|
|
2874
2882
|
]));
|
|
2875
2883
|
}
|
|
2876
|
-
const
|
|
2884
|
+
const $n = /* @__PURE__ */ N(wn, [["render", _n]]), Vn = {}, Cn = {
|
|
2877
2885
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2878
2886
|
viewBox: "0 0 24 24",
|
|
2879
2887
|
fill: "none",
|
|
@@ -2883,7 +2891,7 @@ const _n = /* @__PURE__ */ N(xn, [["render", kn]]), $n = {}, Cn = {
|
|
|
2883
2891
|
"stroke-linejoin": "round",
|
|
2884
2892
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
2885
2893
|
};
|
|
2886
|
-
function
|
|
2894
|
+
function Mn(o, e) {
|
|
2887
2895
|
return i(), d("svg", Cn, e[0] || (e[0] = [
|
|
2888
2896
|
l("path", {
|
|
2889
2897
|
stroke: "none",
|
|
@@ -2895,7 +2903,7 @@ function Vn(o, e) {
|
|
|
2895
2903
|
l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
|
|
2896
2904
|
]));
|
|
2897
2905
|
}
|
|
2898
|
-
const
|
|
2906
|
+
const Ln = /* @__PURE__ */ N(Vn, [["render", Mn]]), Sn = {}, Bn = {
|
|
2899
2907
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2900
2908
|
viewBox: "0 0 24 24",
|
|
2901
2909
|
fill: "none",
|
|
@@ -2905,12 +2913,12 @@ const Mn = /* @__PURE__ */ N($n, [["render", Vn]]), Ln = {}, Sn = {
|
|
|
2905
2913
|
"stroke-linejoin": "round",
|
|
2906
2914
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
2907
2915
|
};
|
|
2908
|
-
function
|
|
2909
|
-
return i(), d("svg",
|
|
2910
|
-
|
|
2916
|
+
function jn(o, e) {
|
|
2917
|
+
return i(), d("svg", Bn, e[0] || (e[0] = [
|
|
2918
|
+
ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
|
|
2911
2919
|
]));
|
|
2912
2920
|
}
|
|
2913
|
-
const
|
|
2921
|
+
const In = /* @__PURE__ */ N(Sn, [["render", jn]]), En = {}, zn = {
|
|
2914
2922
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2915
2923
|
viewBox: "0 0 24 24",
|
|
2916
2924
|
fill: "none",
|
|
@@ -2920,12 +2928,12 @@ const jn = /* @__PURE__ */ N(Ln, [["render", Bn]]), In = {}, En = {
|
|
|
2920
2928
|
"stroke-linejoin": "round",
|
|
2921
2929
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
2922
2930
|
};
|
|
2923
|
-
function
|
|
2924
|
-
return i(), d("svg",
|
|
2925
|
-
|
|
2931
|
+
function An(o, e) {
|
|
2932
|
+
return i(), d("svg", zn, e[0] || (e[0] = [
|
|
2933
|
+
ce('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
|
|
2926
2934
|
]));
|
|
2927
2935
|
}
|
|
2928
|
-
const Fn = /* @__PURE__ */ N(
|
|
2936
|
+
const Fn = /* @__PURE__ */ N(En, [["render", An]]), Dn = {}, On = {
|
|
2929
2937
|
version: "1.1",
|
|
2930
2938
|
viewBox: "0 0 14 14",
|
|
2931
2939
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2933,8 +2941,8 @@ const Fn = /* @__PURE__ */ N(In, [["render", zn]]), An = {}, Dn = {
|
|
|
2933
2941
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
2934
2942
|
class: "fullscreen-icon"
|
|
2935
2943
|
};
|
|
2936
|
-
function
|
|
2937
|
-
return i(), d("svg",
|
|
2944
|
+
function Un(o, e) {
|
|
2945
|
+
return i(), d("svg", On, e[0] || (e[0] = [
|
|
2938
2946
|
l("title", null, null, -1),
|
|
2939
2947
|
l("desc", null, null, -1),
|
|
2940
2948
|
l("defs", null, null, -1),
|
|
@@ -2963,10 +2971,10 @@ function On(o, e) {
|
|
|
2963
2971
|
], -1)
|
|
2964
2972
|
]));
|
|
2965
2973
|
}
|
|
2966
|
-
const
|
|
2974
|
+
const Tn = /* @__PURE__ */ N(Dn, [["render", Un]]), Rn = { class: "form-geom__search" }, Pn = { class: "map-search__input" }, Hn = { class: "flex flex-nowrap relative" }, Nn = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, qn = { class: "flex items-center w-full" }, Gn = { class: "max-w-[90%] truncate" }, Jn = {
|
|
2967
2975
|
key: 0,
|
|
2968
2976
|
class: "absolute z-[3100] mt-0.5 left-0 right-0"
|
|
2969
|
-
},
|
|
2977
|
+
}, Wn = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, Kn = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, Zn = ["onClick"], Yn = { class: "flex justify-between items-center w-full" }, Qn = { class: "flex items-center" }, Xn = {
|
|
2970
2978
|
key: 0,
|
|
2971
2979
|
class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
|
|
2972
2980
|
width: "24",
|
|
@@ -2977,16 +2985,16 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
2977
2985
|
"stroke-width": "2",
|
|
2978
2986
|
"stroke-linecap": "round",
|
|
2979
2987
|
"stroke-linejoin": "round"
|
|
2980
|
-
},
|
|
2988
|
+
}, er = { class: "relative w-full" }, tr = { class: "vs-form-text relative bg-white rounded-lg" }, lr = {
|
|
2981
2989
|
key: 1,
|
|
2982
2990
|
class: "absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"
|
|
2983
|
-
},
|
|
2991
|
+
}, or = { key: 0 }, ar = ["onClick"], sr = {
|
|
2984
2992
|
key: 1,
|
|
2985
2993
|
class: "px-3 py-2 text-xs text-gray-500"
|
|
2986
|
-
},
|
|
2994
|
+
}, nr = {
|
|
2987
2995
|
key: 2,
|
|
2988
2996
|
class: "px-3 py-2 text-xs text-gray-400"
|
|
2989
|
-
},
|
|
2997
|
+
}, rr = /* @__PURE__ */ F({
|
|
2990
2998
|
__name: "map-search",
|
|
2991
2999
|
props: {
|
|
2992
3000
|
placeholder: { default: "50, 30" }
|
|
@@ -3000,37 +3008,37 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3000
3008
|
{ value: "atu", label: "АТУ" },
|
|
3001
3009
|
{ value: "address", label: "Адресса" },
|
|
3002
3010
|
{ value: "search_here", label: "Пошук HERE" }
|
|
3003
|
-
], f = D(() => p.find((
|
|
3004
|
-
function y(
|
|
3005
|
-
a.value =
|
|
3011
|
+
], f = D(() => p.find((S) => S.value === a.value)?.label ?? "АТУ");
|
|
3012
|
+
function y(S) {
|
|
3013
|
+
a.value = S.value, r.value = !1, n.value = "", n.value && E();
|
|
3006
3014
|
}
|
|
3007
|
-
function _(
|
|
3008
|
-
|
|
3015
|
+
function _(S) {
|
|
3016
|
+
S.target.closest(".map-search__input") || (r.value = !1);
|
|
3009
3017
|
}
|
|
3010
|
-
|
|
3011
|
-
async function
|
|
3018
|
+
xe(() => document.addEventListener("click", _)), qe(() => document.removeEventListener("click", _));
|
|
3019
|
+
async function O(S) {
|
|
3012
3020
|
let x;
|
|
3013
3021
|
a.value === "atu" ? x = "/api/suggest/atu.nsdi.ato_level" : a.value === "address" ? x = "/api/suggest/map.address_id" : a.value === "search_here" && (x = "/api/gis-url-proxy");
|
|
3014
3022
|
const b = new URL(x || "");
|
|
3015
|
-
return a.value === "search_here" ? b.searchParams.set("searchtext",
|
|
3023
|
+
return a.value === "search_here" ? b.searchParams.set("searchtext", S) : (a.value === "atu" || a.value === "address") && b.searchParams.set("key", S), b.searchParams.set("limit", "20"), b.searchParams.set("q", S), (await fetch(b.toString())).json();
|
|
3016
3024
|
}
|
|
3017
3025
|
function E() {
|
|
3018
3026
|
if (u.value = !0, c.value = !0, a.value === "coordinates") {
|
|
3019
|
-
const
|
|
3020
|
-
if (
|
|
3021
|
-
const x = parseFloat(
|
|
3027
|
+
const S = n.value.trim().split(",");
|
|
3028
|
+
if (S.length === 2) {
|
|
3029
|
+
const x = parseFloat(S[0]), b = parseFloat(S[1]);
|
|
3022
3030
|
!Number.isNaN(x) && !Number.isNaN(b) && t("goToCoordinates", [x, b]);
|
|
3023
3031
|
}
|
|
3024
3032
|
return;
|
|
3025
3033
|
}
|
|
3026
3034
|
v && window.clearTimeout(v), v = window.setTimeout(async () => {
|
|
3027
|
-
const
|
|
3028
|
-
if (!
|
|
3035
|
+
const S = n.value.trim();
|
|
3036
|
+
if (!S) {
|
|
3029
3037
|
s.value = [], c.value = !1;
|
|
3030
3038
|
return;
|
|
3031
3039
|
}
|
|
3032
3040
|
try {
|
|
3033
|
-
const x = await
|
|
3041
|
+
const x = await O(S);
|
|
3034
3042
|
s.value = Array.isArray(x.features) ? x.features : [];
|
|
3035
3043
|
} catch {
|
|
3036
3044
|
s.value = [];
|
|
@@ -3039,23 +3047,23 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3039
3047
|
}
|
|
3040
3048
|
}, 300);
|
|
3041
3049
|
}
|
|
3042
|
-
function
|
|
3050
|
+
function U() {
|
|
3043
3051
|
n.value = "", s.value = [], u.value = !1, c.value = !1;
|
|
3044
3052
|
}
|
|
3045
|
-
function
|
|
3046
|
-
t("goToCoordinates",
|
|
3053
|
+
function M(S) {
|
|
3054
|
+
t("goToCoordinates", S), u.value = !1, c.value = !1, s.value = [];
|
|
3047
3055
|
}
|
|
3048
|
-
return (
|
|
3049
|
-
l("div",
|
|
3050
|
-
l("div",
|
|
3051
|
-
l("div",
|
|
3056
|
+
return (S, x) => (i(), d("div", Rn, [
|
|
3057
|
+
l("div", Pn, [
|
|
3058
|
+
l("div", Hn, [
|
|
3059
|
+
l("div", Nn, [
|
|
3052
3060
|
l("button", {
|
|
3053
3061
|
type: "button",
|
|
3054
3062
|
onClick: x[0] || (x[0] = (b) => r.value = !r.value),
|
|
3055
3063
|
class: "h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"
|
|
3056
3064
|
}, [
|
|
3057
|
-
l("div",
|
|
3058
|
-
l("span",
|
|
3065
|
+
l("div", qn, [
|
|
3066
|
+
l("span", Gn, P(f.value), 1)
|
|
3059
3067
|
]),
|
|
3060
3068
|
x[3] || (x[3] = l("svg", {
|
|
3061
3069
|
class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
|
|
@@ -3072,29 +3080,29 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3072
3080
|
})
|
|
3073
3081
|
], -1))
|
|
3074
3082
|
]),
|
|
3075
|
-
r.value ? (i(), d("div",
|
|
3076
|
-
l("div",
|
|
3077
|
-
l("div",
|
|
3078
|
-
(i(), d(ee, null,
|
|
3083
|
+
r.value ? (i(), d("div", Jn, [
|
|
3084
|
+
l("div", Wn, [
|
|
3085
|
+
l("div", Kn, [
|
|
3086
|
+
(i(), d(ee, null, oe(p, (b) => l("div", {
|
|
3079
3087
|
onClick: (z) => y(b),
|
|
3080
3088
|
key: b.value,
|
|
3081
3089
|
class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
|
|
3082
3090
|
}, [
|
|
3083
|
-
l("div",
|
|
3084
|
-
l("div",
|
|
3091
|
+
l("div", Yn, [
|
|
3092
|
+
l("div", Qn, [
|
|
3085
3093
|
l("div", null, P(b.label), 1)
|
|
3086
3094
|
]),
|
|
3087
|
-
b.value === a.value ? (i(), d("svg",
|
|
3095
|
+
b.value === a.value ? (i(), d("svg", Xn, x[4] || (x[4] = [
|
|
3088
3096
|
l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
3089
|
-
]))) :
|
|
3097
|
+
]))) : A("", !0)
|
|
3090
3098
|
])
|
|
3091
|
-
], 8,
|
|
3099
|
+
], 8, Zn)), 64))
|
|
3092
3100
|
])
|
|
3093
3101
|
])
|
|
3094
|
-
])) :
|
|
3102
|
+
])) : A("", !0)
|
|
3095
3103
|
]),
|
|
3096
|
-
l("div",
|
|
3097
|
-
l("div",
|
|
3104
|
+
l("div", er, [
|
|
3105
|
+
l("div", tr, [
|
|
3098
3106
|
x[6] || (x[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
|
|
3099
3107
|
l("svg", {
|
|
3100
3108
|
width: "16",
|
|
@@ -3130,7 +3138,7 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3130
3138
|
]),
|
|
3131
3139
|
n.value ? (i(), d("button", {
|
|
3132
3140
|
key: 0,
|
|
3133
|
-
onClick:
|
|
3141
|
+
onClick: U,
|
|
3134
3142
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
3135
3143
|
"aria-label": "Очистити",
|
|
3136
3144
|
type: "button"
|
|
@@ -3149,23 +3157,23 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3149
3157
|
"stroke-linejoin": "round"
|
|
3150
3158
|
})
|
|
3151
3159
|
], -1)
|
|
3152
|
-
]))) :
|
|
3153
|
-
u.value && a.value !== "coordinates" ? (i(), d("div",
|
|
3154
|
-
s.value.length ? (i(), d("ul",
|
|
3155
|
-
(i(!0), d(ee, null,
|
|
3160
|
+
]))) : A("", !0),
|
|
3161
|
+
u.value && a.value !== "coordinates" ? (i(), d("div", lr, [
|
|
3162
|
+
s.value.length ? (i(), d("ul", or, [
|
|
3163
|
+
(i(!0), d(ee, null, oe(s.value, (b) => (i(), d("li", {
|
|
3156
3164
|
key: b.properties.place_id,
|
|
3157
|
-
onClick: (z) =>
|
|
3165
|
+
onClick: (z) => M(b),
|
|
3158
3166
|
class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
|
|
3159
|
-
}, P(b.properties.display_name), 9,
|
|
3160
|
-
])) : c.value ? (i(), d("div",
|
|
3161
|
-
])) :
|
|
3167
|
+
}, P(b.properties.display_name), 9, ar))), 128))
|
|
3168
|
+
])) : c.value ? (i(), d("div", sr, "Шукаю…")) : (i(), d("div", nr, "Нічого не знайдено"))
|
|
3169
|
+
])) : A("", !0)
|
|
3162
3170
|
])
|
|
3163
3171
|
])
|
|
3164
3172
|
])
|
|
3165
3173
|
])
|
|
3166
3174
|
]));
|
|
3167
3175
|
}
|
|
3168
|
-
}),
|
|
3176
|
+
}), ir = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, ur = { class: "flex gap-2" }, dr = ["onClick", "title"], cr = ["src"], pr = /* @__PURE__ */ F({
|
|
3169
3177
|
__name: "map-layers",
|
|
3170
3178
|
props: {
|
|
3171
3179
|
basemaps: {}
|
|
@@ -3176,11 +3184,11 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3176
3184
|
function n(s) {
|
|
3177
3185
|
a("onLayerChange", s), r.value = s;
|
|
3178
3186
|
}
|
|
3179
|
-
return (s, u) => (i(), d("div",
|
|
3180
|
-
l("div",
|
|
3181
|
-
(i(!0), d(ee, null,
|
|
3187
|
+
return (s, u) => (i(), d("div", ir, [
|
|
3188
|
+
l("div", ur, [
|
|
3189
|
+
(i(!0), d(ee, null, oe(s.basemaps, (c, v) => (i(), d("div", {
|
|
3182
3190
|
key: v,
|
|
3183
|
-
class:
|
|
3191
|
+
class: C(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": r.value === v }]),
|
|
3184
3192
|
onClick: (p) => n(v),
|
|
3185
3193
|
title: c.name || v,
|
|
3186
3194
|
role: "button",
|
|
@@ -3190,21 +3198,21 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3190
3198
|
src: c.preview,
|
|
3191
3199
|
alt: "",
|
|
3192
3200
|
class: "w-14 h-14 object-cover"
|
|
3193
|
-
}, null, 8,
|
|
3194
|
-
], 10,
|
|
3201
|
+
}, null, 8, cr)
|
|
3202
|
+
], 10, dr))), 128))
|
|
3195
3203
|
])
|
|
3196
3204
|
]));
|
|
3197
3205
|
}
|
|
3198
|
-
}),
|
|
3206
|
+
}), fr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, vr = { class: "form-geom__panel flex gap-1 items-start mt-2" }, mr = { class: "flex items-center gap-1" }, hr = ["disabled"], gr = { class: "absolute top-4 right-4 z-[1000]" }, br = { class: "flex flex-col gap-[2px]" }, yr = ["aria-pressed"], xr = ["aria-pressed"], wr = ["aria-pressed"], kr = ["aria-pressed"], _r = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, $r = {
|
|
3199
3207
|
key: 0,
|
|
3200
3208
|
class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
|
|
3201
|
-
},
|
|
3209
|
+
}, Vr = { class: "mr-auto" }, Cr = { class: "font-bold" }, Mr = { class: "flex items-center" }, Lr = { class: "text-xs mr-2" }, Sr = {
|
|
3202
3210
|
key: 0,
|
|
3203
3211
|
class: "text-xs"
|
|
3204
|
-
},
|
|
3212
|
+
}, Br = {
|
|
3205
3213
|
key: 1,
|
|
3206
3214
|
class: "text-xs"
|
|
3207
|
-
},
|
|
3215
|
+
}, jr = /* @__PURE__ */ F({
|
|
3208
3216
|
__name: "vs-input-map",
|
|
3209
3217
|
props: {
|
|
3210
3218
|
tools: {},
|
|
@@ -3220,36 +3228,36 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3220
3228
|
setup(o, { emit: e }) {
|
|
3221
3229
|
const t = Ot(), r = o, a = e, n = w(null);
|
|
3222
3230
|
let s, u, c;
|
|
3223
|
-
const v = w(null), p = w(null), f = w(6), y = w(0), _ = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]),
|
|
3224
|
-
let
|
|
3225
|
-
const
|
|
3226
|
-
function
|
|
3227
|
-
return
|
|
3231
|
+
const v = w(null), p = w(null), f = w(6), y = w(0), _ = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), O = w(null), E = Z();
|
|
3232
|
+
let U;
|
|
3233
|
+
const M = w("topo100");
|
|
3234
|
+
function S(h) {
|
|
3235
|
+
return h ? h.type === "Polygon" ? {
|
|
3228
3236
|
type: "MultiPolygon",
|
|
3229
|
-
coordinates: [
|
|
3230
|
-
} : (
|
|
3237
|
+
coordinates: [h.coordinates]
|
|
3238
|
+
} : (h.type === "MultiPolygon", h) : null;
|
|
3231
3239
|
}
|
|
3232
3240
|
function x() {
|
|
3233
|
-
return new Promise((
|
|
3234
|
-
window.L && window.L.Draw &&
|
|
3241
|
+
return new Promise((h, k) => {
|
|
3242
|
+
window.L && window.L.Draw && h(0);
|
|
3235
3243
|
const R = (Y) => {
|
|
3236
|
-
if (Array.from(document.styleSheets).some((
|
|
3244
|
+
if (Array.from(document.styleSheets).some((we) => we?.href?.includes(Y))) return;
|
|
3237
3245
|
const $e = document.createElement("link");
|
|
3238
3246
|
$e.rel = "stylesheet", $e.href = Y, document.head.appendChild($e);
|
|
3239
|
-
},
|
|
3240
|
-
const
|
|
3241
|
-
if (
|
|
3242
|
-
|
|
3247
|
+
}, G = (Y) => new Promise((ge, $e) => {
|
|
3248
|
+
const we = Array.from(document.scripts).find((Me) => Me.src === Y);
|
|
3249
|
+
if (we) {
|
|
3250
|
+
we.addEventListener("load", () => ge()), we.addEventListener("error", (Me) => $e(Me));
|
|
3243
3251
|
return;
|
|
3244
3252
|
}
|
|
3245
|
-
const
|
|
3246
|
-
|
|
3253
|
+
const Ce = document.createElement("script");
|
|
3254
|
+
Ce.src = Y, Ce.async = !0, Ce.onload = () => ge(), Ce.onerror = (Me) => $e(Me), document.body.appendChild(Ce);
|
|
3247
3255
|
});
|
|
3248
|
-
R("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), R("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),
|
|
3256
|
+
R("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), R("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), G("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => G("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => h(0)).catch(k);
|
|
3249
3257
|
});
|
|
3250
3258
|
}
|
|
3251
3259
|
function b() {
|
|
3252
|
-
const
|
|
3260
|
+
const h = u.toGeoJSON(), k = [], R = (Y) => {
|
|
3253
3261
|
if (Y)
|
|
3254
3262
|
switch (Y.type) {
|
|
3255
3263
|
case "Polygon":
|
|
@@ -3263,86 +3271,86 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3263
3271
|
break;
|
|
3264
3272
|
}
|
|
3265
3273
|
};
|
|
3266
|
-
(
|
|
3267
|
-
const
|
|
3268
|
-
a("update:modelValue",
|
|
3274
|
+
(h?.features || []).forEach((Y) => R(Y.geometry));
|
|
3275
|
+
const G = k.length ? { type: "MultiPolygon", coordinates: k } : null;
|
|
3276
|
+
a("update:modelValue", G ? S(G) : null), y.value = u.getLayers().length;
|
|
3269
3277
|
}
|
|
3270
|
-
function z(
|
|
3278
|
+
function z(h = 30) {
|
|
3271
3279
|
const k = u.getLayers();
|
|
3272
3280
|
if (!k.length) return;
|
|
3273
|
-
const
|
|
3274
|
-
|
|
3281
|
+
const G = L.featureGroup(k).getBounds();
|
|
3282
|
+
G && G.isValid() && s.fitBounds(G, { padding: [h, h] });
|
|
3275
3283
|
}
|
|
3276
3284
|
function W() {
|
|
3277
3285
|
v.value?.click();
|
|
3278
3286
|
}
|
|
3279
|
-
const
|
|
3280
|
-
function se(
|
|
3281
|
-
return
|
|
3287
|
+
const V = w("");
|
|
3288
|
+
function se(h) {
|
|
3289
|
+
return h instanceof L.Circle ? "Circle" : h instanceof L.Rectangle ? "Rectangle" : h instanceof L.Polygon && !(h instanceof L.Rectangle) ? "Polygon" : h instanceof L.Polyline && !(h instanceof L.Polygon) ? "Polyline" : h instanceof L.Marker ? "Point" : "Feature";
|
|
3282
3290
|
}
|
|
3283
|
-
function ue(
|
|
3284
|
-
if (
|
|
3285
|
-
const k =
|
|
3291
|
+
function ue(h) {
|
|
3292
|
+
if (h instanceof L.Circle) {
|
|
3293
|
+
const k = h.getRadius();
|
|
3286
3294
|
return Math.PI * (k * k) / 1e6;
|
|
3287
3295
|
}
|
|
3288
|
-
if (
|
|
3296
|
+
if (h instanceof L.Polygon || h instanceof L.Rectangle)
|
|
3289
3297
|
try {
|
|
3290
|
-
const k =
|
|
3291
|
-
return
|
|
3298
|
+
const k = h.getLatLngs(), R = Array.isArray(k[0]) ? k[0] : k, G = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(R) : 0;
|
|
3299
|
+
return G ? G / 1e6 : 0;
|
|
3292
3300
|
} catch {
|
|
3293
3301
|
return null;
|
|
3294
3302
|
}
|
|
3295
3303
|
return null;
|
|
3296
3304
|
}
|
|
3297
|
-
function de(
|
|
3298
|
-
return
|
|
3305
|
+
function de(h) {
|
|
3306
|
+
return h instanceof L.Circle ? h.getLatLng() : h.getBounds ? h.getBounds().getCenter() : h.getLatLng ? h.getLatLng() : s.getCenter();
|
|
3299
3307
|
}
|
|
3300
3308
|
function te() {
|
|
3301
|
-
const
|
|
3302
|
-
if (!
|
|
3303
|
-
|
|
3309
|
+
const h = u.getLayers();
|
|
3310
|
+
if (!h.length) {
|
|
3311
|
+
O.value = null, y.value = 0;
|
|
3304
3312
|
return;
|
|
3305
3313
|
}
|
|
3306
|
-
const k =
|
|
3307
|
-
|
|
3314
|
+
const k = h[h.length - 1], R = se(k), G = de(k), Y = ue(k);
|
|
3315
|
+
O.value = {
|
|
3308
3316
|
type: R,
|
|
3309
|
-
center:
|
|
3317
|
+
center: G,
|
|
3310
3318
|
areaKm2: Y,
|
|
3311
3319
|
layer: k
|
|
3312
|
-
}, y.value =
|
|
3320
|
+
}, y.value = h.length;
|
|
3313
3321
|
}
|
|
3314
3322
|
function ze() {
|
|
3315
|
-
const
|
|
3316
|
-
|
|
3323
|
+
const h = O.value?.layer;
|
|
3324
|
+
h && (h instanceof L.Circle && h.getBounds ? s.fitBounds(h.getBounds(), { padding: [30, 30] }) : h.getBounds ? s.fitBounds(h.getBounds(), { padding: [30, 30] }) : h.getLatLng && s.setView(h.getLatLng(), Math.max(f.value, 14)));
|
|
3317
3325
|
}
|
|
3318
|
-
function
|
|
3319
|
-
const
|
|
3320
|
-
|
|
3326
|
+
function _e() {
|
|
3327
|
+
const h = O.value?.layer;
|
|
3328
|
+
h && (u.removeLayer(h), b(), te());
|
|
3321
3329
|
}
|
|
3322
|
-
|
|
3323
|
-
await x(), L.drawLocal =
|
|
3324
|
-
const { layer:
|
|
3325
|
-
u.clearLayers(), u.addLayer(
|
|
3330
|
+
xe(async () => {
|
|
3331
|
+
await x(), L.drawLocal = yn, s = L.map(n.value, { zoomControl: !1 }).setView(_.value, 10), L.control.zoom({ position: "bottomright" }).addTo(s), M.value = Object.keys(E)[0], U = L.tileLayer(E[M.value].url, { maxZoom: 19, minZoom: 6 }).addTo(s), u = new L.FeatureGroup().addTo(s), s.on(L.Draw.Event.CREATED, (R) => {
|
|
3332
|
+
const { layer: G } = R;
|
|
3333
|
+
u.clearLayers(), u.addLayer(G), b(), te(), z(), V.value = "";
|
|
3326
3334
|
}), s.on(L.Draw.Event.EDITED, () => {
|
|
3327
3335
|
b(), te(), z();
|
|
3328
3336
|
}), s.on(L.Draw.Event.DELETED, () => {
|
|
3329
3337
|
b(), te(), z();
|
|
3330
3338
|
});
|
|
3331
|
-
let
|
|
3339
|
+
let h = !1;
|
|
3332
3340
|
s.on("mousemove", (R) => {
|
|
3333
|
-
|
|
3341
|
+
h || (s.invalidateSize(), h = !0), p.value = R.latlng;
|
|
3334
3342
|
}), s.on("zoomend", () => {
|
|
3335
3343
|
f.value = s.getZoom();
|
|
3336
3344
|
});
|
|
3337
|
-
const k =
|
|
3345
|
+
const k = xn(r.modelValue);
|
|
3338
3346
|
if (k) {
|
|
3339
3347
|
const R = [];
|
|
3340
|
-
L.geoJSON(k).eachLayer((
|
|
3348
|
+
L.geoJSON(k).eachLayer((G) => R.push(G)), R.length && u.addLayer(R[0]), b(), te(), z();
|
|
3341
3349
|
}
|
|
3342
3350
|
});
|
|
3343
|
-
function
|
|
3351
|
+
function me(h) {
|
|
3344
3352
|
if (s) {
|
|
3345
|
-
switch (c && c.disable(),
|
|
3353
|
+
switch (c && c.disable(), h) {
|
|
3346
3354
|
case "marker":
|
|
3347
3355
|
c = new L.Draw.Marker(s);
|
|
3348
3356
|
break;
|
|
@@ -3359,55 +3367,55 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3359
3367
|
c = new L.Draw.Rectangle(s);
|
|
3360
3368
|
break;
|
|
3361
3369
|
}
|
|
3362
|
-
c && (c.enable(),
|
|
3370
|
+
c && (c.enable(), V.value = h);
|
|
3363
3371
|
}
|
|
3364
3372
|
}
|
|
3365
|
-
function
|
|
3366
|
-
const
|
|
3367
|
-
|
|
3373
|
+
function T() {
|
|
3374
|
+
const h = u.toGeoJSON(), k = new Blob([JSON.stringify(h, null, 2)], { type: "application/json" }), R = URL.createObjectURL(k), G = document.createElement("a");
|
|
3375
|
+
G.href = R, G.download = "data.geojson", G.click(), URL.revokeObjectURL(R);
|
|
3368
3376
|
}
|
|
3369
|
-
function
|
|
3370
|
-
const k =
|
|
3377
|
+
function B(h) {
|
|
3378
|
+
const k = h.target.files?.[0];
|
|
3371
3379
|
if (!k) return;
|
|
3372
3380
|
const R = new FileReader();
|
|
3373
3381
|
R.onload = () => {
|
|
3374
3382
|
if (typeof R.result == "string")
|
|
3375
3383
|
try {
|
|
3376
|
-
const
|
|
3377
|
-
u.clearLayers(),
|
|
3384
|
+
const G = JSON.parse(R.result);
|
|
3385
|
+
u.clearLayers(), G && L.geoJSON({ type: "Feature", geometry: G }).eachLayer((Y) => {
|
|
3378
3386
|
u.addLayer(Y);
|
|
3379
3387
|
}), b(), te(), z();
|
|
3380
3388
|
} finally {
|
|
3381
|
-
|
|
3389
|
+
h.target.value = "";
|
|
3382
3390
|
}
|
|
3383
3391
|
}, R.readAsText(k);
|
|
3384
3392
|
}
|
|
3385
|
-
function
|
|
3386
|
-
s && (
|
|
3393
|
+
function j(h) {
|
|
3394
|
+
s && (U && s.removeLayer(U), U = L.tileLayer(E[h].url, { maxZoom: 19, minZoom: 6 }).addTo(s), M.value = h);
|
|
3387
3395
|
}
|
|
3388
|
-
function
|
|
3389
|
-
const k = L.latLng(
|
|
3396
|
+
function q(h) {
|
|
3397
|
+
const k = L.latLng(h[0], h[1]);
|
|
3390
3398
|
s.setView(k, 13);
|
|
3391
3399
|
}
|
|
3392
3400
|
le(
|
|
3393
3401
|
() => r.modelValue,
|
|
3394
|
-
(
|
|
3402
|
+
(h) => {
|
|
3395
3403
|
console.log("update map");
|
|
3396
|
-
const k =
|
|
3397
|
-
if (
|
|
3404
|
+
const k = S(h);
|
|
3405
|
+
if (h && k !== h) {
|
|
3398
3406
|
a("update:modelValue", k);
|
|
3399
3407
|
return;
|
|
3400
3408
|
}
|
|
3401
3409
|
u.clearLayers(), k && L.geoJSON({ type: "Feature", geometry: k }).eachLayer((R) => {
|
|
3402
|
-
u.addLayer(R), R.dragging?.enable(), R.dragging?.enabled(), R.on("dragend", (
|
|
3403
|
-
const
|
|
3404
|
-
a("update:modelValue", { type: "Point", coordinates: [
|
|
3410
|
+
u.addLayer(R), R.dragging?.enable(), R.dragging?.enabled(), R.on("dragend", (G) => {
|
|
3411
|
+
const ge = G.target.getLatLng();
|
|
3412
|
+
a("update:modelValue", { type: "Point", coordinates: [ge.lng, ge.lat] });
|
|
3405
3413
|
});
|
|
3406
3414
|
}), y.value = u.getLayers().length, te(), z();
|
|
3407
3415
|
}
|
|
3408
3416
|
);
|
|
3409
|
-
function
|
|
3410
|
-
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((
|
|
3417
|
+
function Z() {
|
|
3418
|
+
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((h, k) => Object.assign(h, { key: `b${k}`, preview: h.preview || h.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((h, k) => ({ ...h, [k.key]: k }), {}) : {
|
|
3411
3419
|
topo100: {
|
|
3412
3420
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3413
3421
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3422,23 +3430,23 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3422
3430
|
}
|
|
3423
3431
|
};
|
|
3424
3432
|
}
|
|
3425
|
-
const
|
|
3426
|
-
return le(
|
|
3433
|
+
const he = w(!1);
|
|
3434
|
+
return le(he, () => {
|
|
3427
3435
|
setTimeout(() => {
|
|
3428
3436
|
s.invalidateSize();
|
|
3429
3437
|
}, 50);
|
|
3430
|
-
}), (
|
|
3431
|
-
class:
|
|
3438
|
+
}), (h, k) => (i(), d("div", {
|
|
3439
|
+
class: C(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: he.value }])
|
|
3432
3440
|
}, [
|
|
3433
3441
|
l("div", {
|
|
3434
3442
|
ref_key: "mapContainer",
|
|
3435
3443
|
ref: n,
|
|
3436
3444
|
class: "w-full h-full"
|
|
3437
3445
|
}, null, 512),
|
|
3438
|
-
l("div",
|
|
3439
|
-
I(
|
|
3440
|
-
l("div",
|
|
3441
|
-
l("div",
|
|
3446
|
+
l("div", fr, [
|
|
3447
|
+
I(rr, { onGoToCoordinates: q }),
|
|
3448
|
+
l("div", vr, [
|
|
3449
|
+
l("div", mr, [
|
|
3442
3450
|
l("button", {
|
|
3443
3451
|
type: "button",
|
|
3444
3452
|
class: "vs-btn-row",
|
|
@@ -3447,94 +3455,94 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3447
3455
|
l("button", {
|
|
3448
3456
|
type: "button",
|
|
3449
3457
|
class: "vs-btn-row",
|
|
3450
|
-
onClick:
|
|
3458
|
+
onClick: T,
|
|
3451
3459
|
disabled: y.value === 0
|
|
3452
|
-
}, "Export ", 8,
|
|
3460
|
+
}, "Export ", 8, hr)
|
|
3453
3461
|
]),
|
|
3454
3462
|
l("input", {
|
|
3455
3463
|
ref_key: "importRef",
|
|
3456
3464
|
ref: v,
|
|
3457
3465
|
type: "file",
|
|
3458
|
-
onChange:
|
|
3466
|
+
onChange: B,
|
|
3459
3467
|
accept: ".json,.geojson",
|
|
3460
3468
|
class: "hidden"
|
|
3461
3469
|
}, null, 544)
|
|
3462
3470
|
])
|
|
3463
3471
|
]),
|
|
3464
|
-
l("div",
|
|
3465
|
-
l("div",
|
|
3472
|
+
l("div", gr, [
|
|
3473
|
+
l("div", br, [
|
|
3466
3474
|
l("button", {
|
|
3467
|
-
class:
|
|
3468
|
-
"aria-pressed":
|
|
3475
|
+
class: C(["vs-btn", { "vs-active": V.value === "marker" }]),
|
|
3476
|
+
"aria-pressed": V.value === "marker",
|
|
3469
3477
|
title: "Point (P)",
|
|
3470
3478
|
"aria-label": "Draw point",
|
|
3471
|
-
onClick: k[0] || (k[0] = (R) =>
|
|
3479
|
+
onClick: k[0] || (k[0] = (R) => me("marker"))
|
|
3472
3480
|
}, [
|
|
3473
|
-
I(
|
|
3474
|
-
], 10,
|
|
3481
|
+
I($n)
|
|
3482
|
+
], 10, yr),
|
|
3475
3483
|
l("button", {
|
|
3476
|
-
class:
|
|
3477
|
-
"aria-pressed":
|
|
3484
|
+
class: C(["vs-btn", { "vs-active": V.value === "polyline" }]),
|
|
3485
|
+
"aria-pressed": V.value === "polyline",
|
|
3478
3486
|
title: "Line (L)",
|
|
3479
3487
|
"aria-label": "Draw polyline",
|
|
3480
|
-
onClick: k[1] || (k[1] = (R) =>
|
|
3488
|
+
onClick: k[1] || (k[1] = (R) => me("polyline"))
|
|
3481
3489
|
}, [
|
|
3482
|
-
I(
|
|
3483
|
-
], 10,
|
|
3490
|
+
I(Ln)
|
|
3491
|
+
], 10, xr),
|
|
3484
3492
|
l("button", {
|
|
3485
|
-
class:
|
|
3486
|
-
"aria-pressed":
|
|
3493
|
+
class: C(["vs-btn", { "vs-active": V.value === "polygon" }]),
|
|
3494
|
+
"aria-pressed": V.value === "polygon",
|
|
3487
3495
|
title: "Polygon (G)",
|
|
3488
3496
|
"aria-label": "Draw polygon",
|
|
3489
|
-
onClick: k[2] || (k[2] = (R) =>
|
|
3497
|
+
onClick: k[2] || (k[2] = (R) => me("polygon"))
|
|
3490
3498
|
}, [
|
|
3491
|
-
I(
|
|
3492
|
-
], 10,
|
|
3499
|
+
I(In)
|
|
3500
|
+
], 10, wr),
|
|
3493
3501
|
l("button", {
|
|
3494
|
-
class:
|
|
3495
|
-
"aria-pressed":
|
|
3502
|
+
class: C(["vs-btn", { "vs-active": V.value === "rectangle" }]),
|
|
3503
|
+
"aria-pressed": V.value === "rectangle",
|
|
3496
3504
|
title: "Rectangle (R)",
|
|
3497
3505
|
"aria-label": "Draw rectangle",
|
|
3498
|
-
onClick: k[3] || (k[3] = (R) =>
|
|
3506
|
+
onClick: k[3] || (k[3] = (R) => me("rectangle"))
|
|
3499
3507
|
}, [
|
|
3500
3508
|
I(Fn)
|
|
3501
|
-
], 10,
|
|
3509
|
+
], 10, kr),
|
|
3502
3510
|
l("button", {
|
|
3503
3511
|
class: "vs-btn mt-5",
|
|
3504
3512
|
onClick: k[4] || (k[4] = (R) => {
|
|
3505
|
-
|
|
3513
|
+
he.value = !he.value;
|
|
3506
3514
|
}),
|
|
3507
3515
|
title: "Full Screen",
|
|
3508
3516
|
"aria-label": "Full Screen"
|
|
3509
3517
|
}, [
|
|
3510
|
-
I(
|
|
3518
|
+
I(Tn, { style: { width: "12px", height: "12px" } })
|
|
3511
3519
|
])
|
|
3512
3520
|
])
|
|
3513
3521
|
]),
|
|
3514
3522
|
l("div", {
|
|
3515
|
-
class:
|
|
3523
|
+
class: C(["absolute left-4 z-[1000]", O.value ? "bottom-8" : "bottom-4"])
|
|
3516
3524
|
}, [
|
|
3517
|
-
I(
|
|
3525
|
+
I(pr, {
|
|
3518
3526
|
basemaps: J(E),
|
|
3519
|
-
onOnLayerChange:
|
|
3527
|
+
onOnLayerChange: j
|
|
3520
3528
|
}, null, 8, ["basemaps"])
|
|
3521
3529
|
], 2),
|
|
3522
|
-
l("div",
|
|
3523
|
-
|
|
3524
|
-
l("div", $r, [
|
|
3525
|
-
k[7] || (k[7] = ve(" Тип: ", -1)),
|
|
3526
|
-
l("span", Cr, P(U.value.type), 1)
|
|
3527
|
-
]),
|
|
3530
|
+
l("div", _r, [
|
|
3531
|
+
O.value ? (i(), d("div", $r, [
|
|
3528
3532
|
l("div", Vr, [
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3533
|
+
k[7] || (k[7] = fe(" Тип: ", -1)),
|
|
3534
|
+
l("span", Cr, P(O.value.type), 1)
|
|
3535
|
+
]),
|
|
3536
|
+
l("div", Mr, [
|
|
3537
|
+
l("div", Lr, [
|
|
3538
|
+
k[8] || (k[8] = fe(" Центр: ", -1)),
|
|
3539
|
+
l("b", null, P(O.value.center.lat.toFixed(5)) + ", " + P(O.value.center.lng.toFixed(5)), 1)
|
|
3532
3540
|
]),
|
|
3533
|
-
|
|
3534
|
-
k[9] || (k[9] =
|
|
3535
|
-
l("b", null, P(
|
|
3536
|
-
])) : (i(), d("div",
|
|
3537
|
-
|
|
3541
|
+
O.value.areaKm2 !== null ? (i(), d("div", Sr, [
|
|
3542
|
+
k[9] || (k[9] = fe(" Площа: ", -1)),
|
|
3543
|
+
l("b", null, P(O.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3544
|
+
])) : (i(), d("div", Br, k[10] || (k[10] = [
|
|
3545
|
+
fe(" Площа: ", -1),
|
|
3538
3546
|
l("b", null, "—", -1)
|
|
3539
3547
|
]))),
|
|
3540
3548
|
l("button", {
|
|
@@ -3542,24 +3550,24 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3542
3550
|
title: "Наблизити",
|
|
3543
3551
|
onClick: k[5] || (k[5] = (R) => ze())
|
|
3544
3552
|
}, k[11] || (k[11] = [
|
|
3545
|
-
|
|
3553
|
+
ce('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-44f47a6f><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-44f47a6f></path><path d="M7 10l6 0" data-v-44f47a6f></path><path d="M10 7l0 6" data-v-44f47a6f></path><path d="M21 21l-6 -6" data-v-44f47a6f></path></svg>', 1)
|
|
3546
3554
|
])),
|
|
3547
3555
|
l("button", {
|
|
3548
3556
|
class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
|
|
3549
3557
|
title: "Видалити",
|
|
3550
|
-
onClick: k[6] || (k[6] = (R) =>
|
|
3558
|
+
onClick: k[6] || (k[6] = (R) => _e())
|
|
3551
3559
|
}, [
|
|
3552
3560
|
I(Je, { class: "w-3 h-3" })
|
|
3553
3561
|
])
|
|
3554
3562
|
])
|
|
3555
|
-
])) :
|
|
3563
|
+
])) : A("", !0)
|
|
3556
3564
|
])
|
|
3557
3565
|
], 2));
|
|
3558
3566
|
}
|
|
3559
|
-
}),
|
|
3567
|
+
}), Ir = /* @__PURE__ */ N(jr, [["__scopeId", "data-v-44f47a6f"]]), Er = ["data-focus"], zr = { class: "flex items-center" }, Ar = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Fr = ["onClick", "aria-label"], Dr = {
|
|
3560
3568
|
key: 0,
|
|
3561
3569
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3562
|
-
},
|
|
3570
|
+
}, Or = { class: "flex-1 min-w-[2px]" }, Ur = ["placeholder"], Tr = { class: "flex items-center shrink-0" }, Rr = ["disabled"], Pr = /* @__PURE__ */ F({
|
|
3563
3571
|
__name: "vs-input-tag",
|
|
3564
3572
|
props: /* @__PURE__ */ Q({
|
|
3565
3573
|
unique: { type: Boolean, default: !0 },
|
|
@@ -3577,68 +3585,68 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3577
3585
|
emits: /* @__PURE__ */ Q(["update:modelValue"], ["update:modelValue"]),
|
|
3578
3586
|
setup(o, { emit: e }) {
|
|
3579
3587
|
const t = o, r = e;
|
|
3580
|
-
|
|
3581
|
-
const a = w(null), n = w(null), s = w(null), u = w(!1), c = w(""), v = X(o, "modelValue"), p = D(() => t.placeholder || "Add tag…"), f = D(() => v.value?.length === 0 && c.value === ""), y = D(() => !t.disabled && v.value?.length > 0), _ = D(() => t.disabled),
|
|
3588
|
+
ve(t.style);
|
|
3589
|
+
const a = w(null), n = w(null), s = w(null), u = w(!1), c = w(""), v = X(o, "modelValue"), p = D(() => t.placeholder || "Add tag…"), f = D(() => v.value?.length === 0 && c.value === ""), y = D(() => !t.disabled && v.value?.length > 0), _ = D(() => t.disabled), O = async () => {
|
|
3582
3590
|
_.value || await De(() => s.value?.focus());
|
|
3583
3591
|
}, E = (W) => {
|
|
3584
|
-
const
|
|
3585
|
-
|
|
3586
|
-
},
|
|
3592
|
+
const V = W.trim();
|
|
3593
|
+
V !== "" && (!v.value || !Array.isArray(v.value) ? v.value = [V] : t.unique ? v.value.includes(V) || (v.value = [...v.value, V]) : v.value = [...v.value, V], c.value = "");
|
|
3594
|
+
}, U = () => {
|
|
3587
3595
|
const W = c.value;
|
|
3588
3596
|
W.trim() !== "" && E(W), c.value = "";
|
|
3589
|
-
},
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3592
|
-
},
|
|
3597
|
+
}, M = (W) => {
|
|
3598
|
+
const V = v.value.slice();
|
|
3599
|
+
V.splice(W, 1), r("update:modelValue", V);
|
|
3600
|
+
}, S = () => {
|
|
3593
3601
|
r("update:modelValue", []);
|
|
3594
3602
|
}, x = () => {
|
|
3595
3603
|
_.value || (u.value = !0);
|
|
3596
3604
|
}, b = () => {
|
|
3597
3605
|
u.value = !1;
|
|
3598
3606
|
}, z = (W) => {
|
|
3599
|
-
const { key:
|
|
3600
|
-
|
|
3607
|
+
const { key: V } = W;
|
|
3608
|
+
V === "Enter" ? (W.preventDefault(), U()) : V === "Backspace" && c.value === "" && v.value.length > 0 && M(v.value.length - 1);
|
|
3601
3609
|
};
|
|
3602
|
-
return (W,
|
|
3610
|
+
return (W, V) => (i(), d("div", {
|
|
3603
3611
|
class: "flex gap-1 w-full",
|
|
3604
3612
|
ref_key: "root",
|
|
3605
3613
|
ref: a,
|
|
3606
|
-
onClick:
|
|
3614
|
+
onClick: V[1] || (V[1] = ye(() => {
|
|
3607
3615
|
}, ["stop"]))
|
|
3608
3616
|
}, [
|
|
3609
3617
|
l("div", {
|
|
3610
|
-
class:
|
|
3618
|
+
class: C(["relative w-full font-sans", t.customClass]),
|
|
3611
3619
|
role: "group",
|
|
3612
3620
|
"aria-label": "Tag input"
|
|
3613
3621
|
}, [
|
|
3614
3622
|
l("div", {
|
|
3615
|
-
class:
|
|
3623
|
+
class: C([
|
|
3616
3624
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
3617
3625
|
"border-gray-300 hover:border-gray-400",
|
|
3618
3626
|
u.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
3619
3627
|
_.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3620
3628
|
]),
|
|
3621
3629
|
"data-focus": u.value ? "true" : "false",
|
|
3622
|
-
onClick:
|
|
3630
|
+
onClick: O
|
|
3623
3631
|
}, [
|
|
3624
3632
|
l("div", {
|
|
3625
3633
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3626
3634
|
ref_key: "chipsRef",
|
|
3627
3635
|
ref: n
|
|
3628
3636
|
}, [
|
|
3629
|
-
(i(!0), d(ee, null,
|
|
3637
|
+
(i(!0), d(ee, null, oe(v.value, (se, ue) => (i(), d("div", {
|
|
3630
3638
|
key: ue,
|
|
3631
3639
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3632
3640
|
}, [
|
|
3633
|
-
l("div",
|
|
3634
|
-
l("div",
|
|
3641
|
+
l("div", zr, [
|
|
3642
|
+
l("div", Ar, P(se), 1)
|
|
3635
3643
|
]),
|
|
3636
3644
|
l("div", {
|
|
3637
3645
|
role: "button",
|
|
3638
3646
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3639
|
-
onClick:
|
|
3647
|
+
onClick: ye((de) => M(ue), ["stop"]),
|
|
3640
3648
|
"aria-label": `Remove ${se}`
|
|
3641
|
-
},
|
|
3649
|
+
}, V[2] || (V[2] = [
|
|
3642
3650
|
l("svg", {
|
|
3643
3651
|
height: "14",
|
|
3644
3652
|
width: "14",
|
|
@@ -3651,9 +3659,9 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3651
3659
|
], -1)
|
|
3652
3660
|
]), 8, Fr)
|
|
3653
3661
|
]))), 128)),
|
|
3654
|
-
f.value ? (i(), d("div",
|
|
3655
|
-
l("div",
|
|
3656
|
-
_.value ?
|
|
3662
|
+
f.value ? (i(), d("div", Dr, P(p.value), 1)) : A("", !0),
|
|
3663
|
+
l("div", Or, [
|
|
3664
|
+
_.value ? A("", !0) : K((i(), d("input", {
|
|
3657
3665
|
key: 0,
|
|
3658
3666
|
ref_key: "inputRef",
|
|
3659
3667
|
ref: s,
|
|
@@ -3665,25 +3673,25 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3665
3673
|
type: "text",
|
|
3666
3674
|
tabindex: "0",
|
|
3667
3675
|
"aria-label": "Add tag",
|
|
3668
|
-
"onUpdate:modelValue":
|
|
3676
|
+
"onUpdate:modelValue": V[0] || (V[0] = (se) => c.value = se),
|
|
3669
3677
|
onFocus: x,
|
|
3670
3678
|
onBlur: b,
|
|
3671
3679
|
onKeydown: z,
|
|
3672
3680
|
placeholder: v.value && v.value.length ? "" : void 0
|
|
3673
|
-
}, null, 40,
|
|
3681
|
+
}, null, 40, Ur)), [
|
|
3674
3682
|
[ie, c.value]
|
|
3675
3683
|
])
|
|
3676
3684
|
])
|
|
3677
3685
|
], 512),
|
|
3678
|
-
l("div",
|
|
3686
|
+
l("div", Tr, [
|
|
3679
3687
|
y.value ? (i(), d("button", {
|
|
3680
3688
|
key: 0,
|
|
3681
3689
|
type: "button",
|
|
3682
3690
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3683
3691
|
"aria-label": "Clear all tags",
|
|
3684
3692
|
disabled: _.value,
|
|
3685
|
-
onClick:
|
|
3686
|
-
},
|
|
3693
|
+
onClick: ye(S, ["stop"])
|
|
3694
|
+
}, V[3] || (V[3] = [
|
|
3687
3695
|
l("svg", {
|
|
3688
3696
|
height: "20",
|
|
3689
3697
|
width: "20",
|
|
@@ -3692,13 +3700,13 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3692
3700
|
}, [
|
|
3693
3701
|
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" })
|
|
3694
3702
|
], -1)
|
|
3695
|
-
]), 8,
|
|
3703
|
+
]), 8, Rr)) : A("", !0)
|
|
3696
3704
|
])
|
|
3697
|
-
], 10,
|
|
3705
|
+
], 10, Er)
|
|
3698
3706
|
], 2)
|
|
3699
3707
|
], 512));
|
|
3700
3708
|
}
|
|
3701
|
-
}),
|
|
3709
|
+
}), Hr = { class: "relative flex gap-1 bg-white w-full" }, Nr = ["disabled", "placeholder"], qr = /* @__PURE__ */ F({
|
|
3702
3710
|
__name: "vs-input-slug",
|
|
3703
3711
|
props: /* @__PURE__ */ Q({
|
|
3704
3712
|
disabled: { type: Boolean },
|
|
@@ -3757,14 +3765,14 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3757
3765
|
const s = e?.value?.[t.parent || ""]?.toString(), u = a(s);
|
|
3758
3766
|
r.value = u.toString();
|
|
3759
3767
|
};
|
|
3760
|
-
return (s, u) => (i(), d("div",
|
|
3768
|
+
return (s, u) => (i(), d("div", Hr, [
|
|
3761
3769
|
K(l("input", {
|
|
3762
3770
|
ref: "vsText",
|
|
3763
3771
|
disabled: s.disabled,
|
|
3764
3772
|
placeholder: s.placeholder,
|
|
3765
3773
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
3766
3774
|
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"
|
|
3767
|
-
}, null, 8,
|
|
3775
|
+
}, null, 8, Nr), [
|
|
3768
3776
|
[ie, r.value]
|
|
3769
3777
|
]),
|
|
3770
3778
|
l("button", {
|
|
@@ -3773,13 +3781,13 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3773
3781
|
}, " Gen ")
|
|
3774
3782
|
]));
|
|
3775
3783
|
}
|
|
3776
|
-
}),
|
|
3784
|
+
}), Gr = /* @__PURE__ */ N(qr, [["__scopeId", "data-v-b0eba370"]]), Jr = { class: "w-full" }, Wr = {
|
|
3777
3785
|
ref: "sortableContainer",
|
|
3778
3786
|
class: "flex flex-col gap-1"
|
|
3779
|
-
},
|
|
3787
|
+
}, Kr = ["onDragstart", "onDrop"], Zr = { class: "w-1/3" }, Yr = { class: "w-2/3" }, Qr = ["onClick"], Xr = {
|
|
3780
3788
|
key: 0,
|
|
3781
3789
|
class: "text-[14px] text-gray-700"
|
|
3782
|
-
},
|
|
3790
|
+
}, ei = { class: "mt-2 w-full flex items-center" }, ti = ["disabled"], li = /* @__PURE__ */ F({
|
|
3783
3791
|
__name: "vs-input-key-value",
|
|
3784
3792
|
props: {
|
|
3785
3793
|
parent: {},
|
|
@@ -3789,88 +3797,88 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3789
3797
|
},
|
|
3790
3798
|
emits: ["update:modelValue"],
|
|
3791
3799
|
setup(o, { emit: e }) {
|
|
3792
|
-
const t = (
|
|
3800
|
+
const t = (U) => `${U}-${Math.random().toString(36).substring(2, 15)}`, r = Se("values"), a = o, n = e, s = a.addButtonText ?? "Додати", u = a.ignore ?? [], c = w([]), v = w(null);
|
|
3793
3801
|
(() => {
|
|
3794
|
-
const
|
|
3795
|
-
c.value = Object.entries(
|
|
3802
|
+
const U = a.parent && r?.value?.[a.parent] || a.modelValue || {};
|
|
3803
|
+
c.value = Object.entries(U).filter(([M]) => !u.includes(M)).map(([M, S]) => ({
|
|
3796
3804
|
id: t("key-value-"),
|
|
3797
|
-
key:
|
|
3798
|
-
value:
|
|
3805
|
+
key: M,
|
|
3806
|
+
value: S
|
|
3799
3807
|
}));
|
|
3800
3808
|
})();
|
|
3801
|
-
function f(
|
|
3802
|
-
v.value =
|
|
3809
|
+
function f(U) {
|
|
3810
|
+
v.value = U;
|
|
3803
3811
|
}
|
|
3804
|
-
function y(
|
|
3805
|
-
if (v.value === null || v.value ===
|
|
3806
|
-
const
|
|
3807
|
-
c.value.splice(
|
|
3812
|
+
function y(U) {
|
|
3813
|
+
if (v.value === null || v.value === U) return;
|
|
3814
|
+
const M = c.value.splice(v.value, 1)[0];
|
|
3815
|
+
c.value.splice(U, 0, M), v.value = null;
|
|
3808
3816
|
}
|
|
3809
3817
|
const _ = D(
|
|
3810
|
-
() => c.value.some((
|
|
3811
|
-
),
|
|
3818
|
+
() => c.value.some((U) => U.key && !U.value || !U.key && U.value)
|
|
3819
|
+
), O = () => {
|
|
3812
3820
|
c.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
3813
|
-
}, E = (
|
|
3814
|
-
c.value = c.value.filter((
|
|
3821
|
+
}, E = (U) => {
|
|
3822
|
+
c.value = c.value.filter((M) => M.id !== U);
|
|
3815
3823
|
};
|
|
3816
3824
|
return le(
|
|
3817
3825
|
c,
|
|
3818
|
-
(
|
|
3819
|
-
const V = {};
|
|
3820
|
-
T.forEach((x) => {
|
|
3821
|
-
x.key && x.value !== void 0 && (V[x.key] = x.value);
|
|
3822
|
-
});
|
|
3826
|
+
(U) => {
|
|
3823
3827
|
const M = {};
|
|
3828
|
+
U.forEach((x) => {
|
|
3829
|
+
x.key && x.value !== void 0 && (M[x.key] = x.value);
|
|
3830
|
+
});
|
|
3831
|
+
const S = {};
|
|
3824
3832
|
u.length && u.forEach((x) => {
|
|
3825
|
-
|
|
3833
|
+
S[x] = a.parent ? r?.value?.[a.parent]?.[x] : void 0;
|
|
3826
3834
|
}), r?.value && a.parent && (r.value[a.parent] = {
|
|
3827
|
-
...
|
|
3828
|
-
...
|
|
3829
|
-
}), n("update:modelValue",
|
|
3835
|
+
...S,
|
|
3836
|
+
...M
|
|
3837
|
+
}), n("update:modelValue", M);
|
|
3830
3838
|
},
|
|
3831
3839
|
{ deep: !0 }
|
|
3832
|
-
), (
|
|
3833
|
-
l("div",
|
|
3834
|
-
(i(!0), d(ee, null,
|
|
3835
|
-
key:
|
|
3836
|
-
class:
|
|
3840
|
+
), (U, M) => (i(), d("div", Jr, [
|
|
3841
|
+
l("div", Wr, [
|
|
3842
|
+
(i(!0), d(ee, null, oe(c.value, (S, x) => (i(), d("div", {
|
|
3843
|
+
key: S.id,
|
|
3844
|
+
class: C(["flex items-center gap-2 w-full", { "opacity-50": v.value === x }]),
|
|
3837
3845
|
draggable: "true",
|
|
3838
3846
|
onDragstart: (b) => f(x),
|
|
3839
|
-
onDragover:
|
|
3847
|
+
onDragover: M[0] || (M[0] = ye(() => {
|
|
3840
3848
|
}, ["prevent"])),
|
|
3841
3849
|
onDrop: (b) => y(x)
|
|
3842
3850
|
}, [
|
|
3843
|
-
|
|
3844
|
-
l("div",
|
|
3851
|
+
M[1] || (M[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)),
|
|
3852
|
+
l("div", Zr, [
|
|
3845
3853
|
I(Ne, {
|
|
3846
|
-
modelValue:
|
|
3847
|
-
"onUpdate:modelValue": (b) =>
|
|
3854
|
+
modelValue: S.key,
|
|
3855
|
+
"onUpdate:modelValue": (b) => S.key = b,
|
|
3848
3856
|
placeholder: "Ключ"
|
|
3849
3857
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3850
3858
|
]),
|
|
3851
|
-
l("div",
|
|
3859
|
+
l("div", Yr, [
|
|
3852
3860
|
I(Ne, {
|
|
3853
|
-
modelValue:
|
|
3854
|
-
"onUpdate:modelValue": (b) =>
|
|
3861
|
+
modelValue: S.value,
|
|
3862
|
+
"onUpdate:modelValue": (b) => S.value = b,
|
|
3855
3863
|
placeholder: "Значення"
|
|
3856
3864
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3857
3865
|
]),
|
|
3858
3866
|
l("button", {
|
|
3859
|
-
onClick: (b) => E(
|
|
3867
|
+
onClick: (b) => E(S.id),
|
|
3860
3868
|
class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
|
|
3861
3869
|
}, [
|
|
3862
|
-
I(J(
|
|
3870
|
+
I(J(Ol), {
|
|
3863
3871
|
height: "16",
|
|
3864
3872
|
width: "16"
|
|
3865
3873
|
})
|
|
3866
|
-
], 8,
|
|
3867
|
-
], 42,
|
|
3874
|
+
], 8, Qr)
|
|
3875
|
+
], 42, Kr))), 128))
|
|
3868
3876
|
], 512),
|
|
3869
|
-
c.value.length ?
|
|
3870
|
-
l("div",
|
|
3877
|
+
c.value.length ? A("", !0) : (i(), d("span", Xr, " Дані для відображення відсутні ")),
|
|
3878
|
+
l("div", ei, [
|
|
3871
3879
|
l("button", {
|
|
3872
3880
|
type: "button",
|
|
3873
|
-
onClick:
|
|
3881
|
+
onClick: O,
|
|
3874
3882
|
disabled: _.value,
|
|
3875
3883
|
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"
|
|
3876
3884
|
}, [
|
|
@@ -3878,12 +3886,12 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3878
3886
|
height: "14",
|
|
3879
3887
|
width: "14"
|
|
3880
3888
|
}),
|
|
3881
|
-
|
|
3882
|
-
], 8,
|
|
3889
|
+
fe(" " + P(J(s)), 1)
|
|
3890
|
+
], 8, ti)
|
|
3883
3891
|
])
|
|
3884
3892
|
]));
|
|
3885
3893
|
}
|
|
3886
|
-
}),
|
|
3894
|
+
}), oi = /* @__PURE__ */ N(li, [["__scopeId", "data-v-a0f7fbfc"]]), ai = { class: "flex items-center gap-2 w-full" }, si = ["disabled"], ni = /* @__PURE__ */ F({
|
|
3887
3895
|
__name: "vs-input-color",
|
|
3888
3896
|
props: {
|
|
3889
3897
|
style: { default: () => ({}) },
|
|
@@ -3896,19 +3904,19 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3896
3904
|
},
|
|
3897
3905
|
emits: ["update:modelValue"],
|
|
3898
3906
|
setup(o, { emit: e }) {
|
|
3899
|
-
const t = o, { inputClass: r } =
|
|
3907
|
+
const t = o, { inputClass: r } = ve(t.style), a = e, n = D({
|
|
3900
3908
|
get: () => t.modelValue || "#000000",
|
|
3901
3909
|
set: (s) => a("update:modelValue", s)
|
|
3902
3910
|
});
|
|
3903
|
-
return (s, u) => (i(), d("div",
|
|
3911
|
+
return (s, u) => (i(), d("div", ai, [
|
|
3904
3912
|
K(l("input", {
|
|
3905
3913
|
type: "color",
|
|
3906
3914
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => n.value = c),
|
|
3907
3915
|
disabled: s.disabled,
|
|
3908
3916
|
ref: "color",
|
|
3909
|
-
class:
|
|
3917
|
+
class: C(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [s.modelValue ? "" : "text-opacity-50", J(r)].join(" ")]),
|
|
3910
3918
|
style: { border: "1px solid #CFD9E0" }
|
|
3911
|
-
}, null, 10,
|
|
3919
|
+
}, null, 10, si), [
|
|
3912
3920
|
[ie, n.value]
|
|
3913
3921
|
]),
|
|
3914
3922
|
K(l("input", {
|
|
@@ -3919,7 +3927,7 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3919
3927
|
])
|
|
3920
3928
|
]));
|
|
3921
3929
|
}
|
|
3922
|
-
}),
|
|
3930
|
+
}), ri = { class: "flex items-center gap-2 w-full" }, ii = ["min", "max", "step", "disabled"], ui = /* @__PURE__ */ F({
|
|
3923
3931
|
__name: "vs-input-range",
|
|
3924
3932
|
props: {
|
|
3925
3933
|
style: { default: () => ({}) },
|
|
@@ -3935,11 +3943,11 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3935
3943
|
},
|
|
3936
3944
|
emits: ["update:modelValue"],
|
|
3937
3945
|
setup(o, { emit: e }) {
|
|
3938
|
-
const t = o, { inputClass: r } =
|
|
3946
|
+
const t = o, { inputClass: r } = ve(t.style), a = e, n = D({
|
|
3939
3947
|
get: () => Number(t.modelValue ?? t.min),
|
|
3940
3948
|
set: (s) => a("update:modelValue", Number(s))
|
|
3941
3949
|
});
|
|
3942
|
-
return (s, u) => (i(), d("div",
|
|
3950
|
+
return (s, u) => (i(), d("div", ri, [
|
|
3943
3951
|
K(l("input", {
|
|
3944
3952
|
type: "range",
|
|
3945
3953
|
"onUpdate:modelValue": u[0] || (u[0] = (c) => n.value = c),
|
|
@@ -3948,8 +3956,8 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3948
3956
|
step: s.step,
|
|
3949
3957
|
disabled: s.disabled,
|
|
3950
3958
|
ref: "range",
|
|
3951
|
-
class:
|
|
3952
|
-
}, null, 10,
|
|
3959
|
+
class: C(["w-full cursor-pointer accent-blue-500", [s.modelValue ? "" : "text-opacity-50", J(r)].join(" ")])
|
|
3960
|
+
}, null, 10, ii), [
|
|
3953
3961
|
[ie, n.value]
|
|
3954
3962
|
]),
|
|
3955
3963
|
K(l("input", {
|
|
@@ -3961,34 +3969,82 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
3961
3969
|
])
|
|
3962
3970
|
]));
|
|
3963
3971
|
}
|
|
3964
|
-
}),
|
|
3972
|
+
}), di = ["type", "value", "onInput", "placeholder", "disabled"], ci = /* @__PURE__ */ F({
|
|
3973
|
+
__name: "vs-input-array",
|
|
3974
|
+
props: /* @__PURE__ */ Q({
|
|
3975
|
+
count: { default: 1 },
|
|
3976
|
+
limit: { default: (o) => o.count ?? 1 },
|
|
3977
|
+
inputType: { default: "text" },
|
|
3978
|
+
style: { default: () => ({}) },
|
|
3979
|
+
customClass: { default: "" },
|
|
3980
|
+
disabled: { type: Boolean, default: !1 },
|
|
3981
|
+
modelValue: {},
|
|
3982
|
+
error: { default: "" },
|
|
3983
|
+
name: {},
|
|
3984
|
+
placeholder: { default: "" }
|
|
3985
|
+
}, {
|
|
3986
|
+
modelValue: { default: [] },
|
|
3987
|
+
modelModifiers: {}
|
|
3988
|
+
}),
|
|
3989
|
+
emits: ["update:modelValue"],
|
|
3990
|
+
setup(o) {
|
|
3991
|
+
const e = o, { inputClass: t } = ve(e.style), r = X(o, "modelValue");
|
|
3992
|
+
Ut(() => {
|
|
3993
|
+
const n = r.value?.length ?? 0;
|
|
3994
|
+
n < e.count && (r.value = [
|
|
3995
|
+
...r.value ?? [],
|
|
3996
|
+
...Array(e.count - n)
|
|
3997
|
+
]);
|
|
3998
|
+
});
|
|
3999
|
+
function a(n, s) {
|
|
4000
|
+
const u = n.target.value, c = [...r.value];
|
|
4001
|
+
c[s] = e.inputType === "text" ? u : Number(u), r.value = c;
|
|
4002
|
+
}
|
|
4003
|
+
return (n, s) => (i(), d("div", {
|
|
4004
|
+
class: C(["grid gap-2", `grid-cols-${n.limit}`])
|
|
4005
|
+
}, [
|
|
4006
|
+
(i(!0), d(ee, null, oe(n.count, (u) => (i(), d("input", {
|
|
4007
|
+
type: n.inputType,
|
|
4008
|
+
value: r.value?.[u - 1] ?? "",
|
|
4009
|
+
onInput: (c) => a(c, u - 1),
|
|
4010
|
+
placeholder: n.placeholder,
|
|
4011
|
+
disabled: n.disabled,
|
|
4012
|
+
class: C(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t), { "!border-red-600": n.error }]]),
|
|
4013
|
+
style: {
|
|
4014
|
+
border: "1px solid #CFD9E0"
|
|
4015
|
+
}
|
|
4016
|
+
}, null, 42, di))), 256))
|
|
4017
|
+
], 2));
|
|
4018
|
+
}
|
|
4019
|
+
}), pi = {
|
|
3965
4020
|
VsInputText: Ne,
|
|
3966
4021
|
VsInputRadio: ut,
|
|
3967
4022
|
"vs-input-text": Ne,
|
|
3968
|
-
"vs-input-password":
|
|
3969
|
-
"vs-input-textarea":
|
|
3970
|
-
"vs-input-mask":
|
|
3971
|
-
"vs-input-number":
|
|
4023
|
+
"vs-input-password": pl,
|
|
4024
|
+
"vs-input-textarea": cs,
|
|
4025
|
+
"vs-input-mask": Kl,
|
|
4026
|
+
"vs-input-number": ml,
|
|
3972
4027
|
"vs-input-radio": ut,
|
|
3973
4028
|
"vs-input-select": pt,
|
|
3974
4029
|
"vs-input-switcher": kt,
|
|
3975
4030
|
"vs-input-static": it,
|
|
3976
|
-
"vs-input-container":
|
|
3977
|
-
"vs-input-date":
|
|
3978
|
-
"vs-input-checkbox":
|
|
3979
|
-
"vs-input-file":
|
|
4031
|
+
"vs-input-container": Ka,
|
|
4032
|
+
"vs-input-date": uo,
|
|
4033
|
+
"vs-input-checkbox": ro,
|
|
4034
|
+
"vs-input-file": Wo,
|
|
3980
4035
|
"vs-input-html": it,
|
|
3981
|
-
"vs-input-email":
|
|
3982
|
-
"vs-input-datatable":
|
|
3983
|
-
"vs-input-map":
|
|
3984
|
-
"vs-input-file-list":
|
|
3985
|
-
"vs-input-tag":
|
|
3986
|
-
"vs-input-slug":
|
|
3987
|
-
"vs-input-key-value":
|
|
3988
|
-
"vs-input-range":
|
|
3989
|
-
"vs-input-color":
|
|
3990
|
-
"vs-input-native-select": pt
|
|
3991
|
-
|
|
4036
|
+
"vs-input-email": Ql,
|
|
4037
|
+
"vs-input-datatable": bn,
|
|
4038
|
+
"vs-input-map": Ir,
|
|
4039
|
+
"vs-input-file-list": $a,
|
|
4040
|
+
"vs-input-tag": Pr,
|
|
4041
|
+
"vs-input-slug": Gr,
|
|
4042
|
+
"vs-input-key-value": oi,
|
|
4043
|
+
"vs-input-range": ui,
|
|
4044
|
+
"vs-input-color": ni,
|
|
4045
|
+
"vs-input-native-select": pt,
|
|
4046
|
+
"vs-input-array": ci
|
|
4047
|
+
}, fi = /* @__PURE__ */ F({
|
|
3992
4048
|
__name: "behavior",
|
|
3993
4049
|
props: {
|
|
3994
4050
|
api: {},
|
|
@@ -4020,10 +4076,10 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
4020
4076
|
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"
|
|
4021
4077
|
}, P(a.button), 1));
|
|
4022
4078
|
}
|
|
4023
|
-
}),
|
|
4079
|
+
}), vi = { class: "flex flex-col gap-1 w-full" }, mi = {
|
|
4024
4080
|
key: 0,
|
|
4025
4081
|
class: "text-sm text-gray-500"
|
|
4026
|
-
},
|
|
4082
|
+
}, Ct = /* @__PURE__ */ F({
|
|
4027
4083
|
__name: "vs-compact-form-layout",
|
|
4028
4084
|
props: /* @__PURE__ */ Q({
|
|
4029
4085
|
item: { default: {} },
|
|
@@ -4037,7 +4093,7 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
4037
4093
|
}),
|
|
4038
4094
|
emits: ["update:modelValue"],
|
|
4039
4095
|
setup(o) {
|
|
4040
|
-
const e = o, t = X(o, "modelValue"), r = D(() =>
|
|
4096
|
+
const e = o, t = X(o, "modelValue"), r = D(() => dl[`${e.layout}`]), a = D(() => pi?.[`vs-input-${e.item.type}`]), n = D(() => {
|
|
4041
4097
|
const u = J(a);
|
|
4042
4098
|
if (!u) return /* @__PURE__ */ new Set();
|
|
4043
4099
|
const c = u.props ?? u.__vccOpts?.props;
|
|
@@ -4056,16 +4112,16 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
4056
4112
|
}, {
|
|
4057
4113
|
default: Be(() => [
|
|
4058
4114
|
l("div", {
|
|
4059
|
-
class:
|
|
4115
|
+
class: C(["flex w-full", `${e.item.type}-component`])
|
|
4060
4116
|
}, [
|
|
4061
|
-
l("div",
|
|
4117
|
+
l("div", vi, [
|
|
4062
4118
|
(i(), re(Ee(a.value), Ie(s.value, {
|
|
4063
4119
|
modelValue: t.value,
|
|
4064
4120
|
"onUpdate:modelValue": c[0] || (c[0] = (v) => t.value = v)
|
|
4065
4121
|
}), null, 16, ["modelValue"])),
|
|
4066
|
-
u.item.description ? (i(), d("p",
|
|
4122
|
+
u.item.description ? (i(), d("p", mi, P(u.item.description), 1)) : A("", !0)
|
|
4067
4123
|
]),
|
|
4068
|
-
u.item.behavior?.api && u.item.behavior?.button ? (i(), re(
|
|
4124
|
+
u.item.behavior?.api && u.item.behavior?.button ? (i(), re(fi, Ie({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : A("", !0)
|
|
4069
4125
|
], 2)
|
|
4070
4126
|
]),
|
|
4071
4127
|
_: 1
|
|
@@ -4076,26 +4132,26 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
4076
4132
|
}), Mt = {
|
|
4077
4133
|
required: "Це поле є обов’язковим",
|
|
4078
4134
|
email: "Неправильний email"
|
|
4079
|
-
},
|
|
4135
|
+
}, hi = (o) => o ? !1 : Mt.required, gi = (o) => {
|
|
4080
4136
|
const e = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
4081
4137
|
return o ? e.test(o) ? !1 : Mt.email : !1;
|
|
4082
|
-
},
|
|
4138
|
+
}, bi = (o, e) => {
|
|
4083
4139
|
const t = e.pattern ?? e.regexp;
|
|
4084
4140
|
return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
|
|
4085
|
-
},
|
|
4141
|
+
}, yi = (o, e) => !1, xi = (o, e) => {
|
|
4086
4142
|
switch (typeof e == "string" ? e : e.type) {
|
|
4087
4143
|
case "required":
|
|
4088
|
-
return
|
|
4144
|
+
return hi(o);
|
|
4089
4145
|
case "email":
|
|
4090
|
-
return
|
|
4146
|
+
return gi(o);
|
|
4091
4147
|
case "regexp":
|
|
4092
|
-
return
|
|
4148
|
+
return bi(o, e);
|
|
4093
4149
|
case "custom":
|
|
4094
|
-
return
|
|
4150
|
+
return yi();
|
|
4095
4151
|
default:
|
|
4096
4152
|
return !1;
|
|
4097
4153
|
}
|
|
4098
|
-
},
|
|
4154
|
+
}, wi = {
|
|
4099
4155
|
autocomplete: "select",
|
|
4100
4156
|
combobox: "select",
|
|
4101
4157
|
datepicker: "date",
|
|
@@ -4109,9 +4165,9 @@ const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__se
|
|
|
4109
4165
|
};
|
|
4110
4166
|
function vt(o) {
|
|
4111
4167
|
const e = o.toLowerCase();
|
|
4112
|
-
return
|
|
4168
|
+
return wi[e] || e;
|
|
4113
4169
|
}
|
|
4114
|
-
function
|
|
4170
|
+
function ki(o, e = !1) {
|
|
4115
4171
|
if (Array.isArray(o)) {
|
|
4116
4172
|
const r = [];
|
|
4117
4173
|
return o.forEach((a) => {
|
|
@@ -4132,9 +4188,9 @@ function yi(o, e = !1) {
|
|
|
4132
4188
|
a.type === "email" && !a.rules && (a.rules = ["email"]), r[1].type.includes("list") && (a.multiple = !0), !a.api && r[1].data && (a.api = `/api/suggest/${r[1].data}`), t.push(a);
|
|
4133
4189
|
}), t;
|
|
4134
4190
|
}
|
|
4135
|
-
function
|
|
4191
|
+
function _i(o, e, t = !1) {
|
|
4136
4192
|
const r = D(
|
|
4137
|
-
() =>
|
|
4193
|
+
() => ki(
|
|
4138
4194
|
(Array.isArray(e), e),
|
|
4139
4195
|
typeof t == "boolean" ? t : t.value
|
|
4140
4196
|
)
|
|
@@ -4143,7 +4199,7 @@ function xi(o, e, t = !1) {
|
|
|
4143
4199
|
const p = v?.conditions;
|
|
4144
4200
|
if (!p) return !0;
|
|
4145
4201
|
const f = Array.isArray(p) ? p[0] : p, y = o?.value?.[f];
|
|
4146
|
-
return
|
|
4202
|
+
return Vt(y, p);
|
|
4147
4203
|
}
|
|
4148
4204
|
const s = (v = r.value, p = !0) => (v.forEach((f) => {
|
|
4149
4205
|
if (f.rules) {
|
|
@@ -4152,7 +4208,7 @@ function xi(o, e, t = !1) {
|
|
|
4152
4208
|
return;
|
|
4153
4209
|
}
|
|
4154
4210
|
f.rules.forEach((y) => {
|
|
4155
|
-
const _ =
|
|
4211
|
+
const _ = xi(o.value[f.name], y);
|
|
4156
4212
|
_ ? a.value[f.name] = _ : delete a.value[f.name];
|
|
4157
4213
|
});
|
|
4158
4214
|
}
|
|
@@ -4167,12 +4223,12 @@ function xi(o, e, t = !1) {
|
|
|
4167
4223
|
visibleSchema: u
|
|
4168
4224
|
};
|
|
4169
4225
|
}
|
|
4170
|
-
const
|
|
4226
|
+
const $i = {
|
|
4171
4227
|
key: 0,
|
|
4172
4228
|
"data-orientation": "horizontal",
|
|
4173
4229
|
role: "none",
|
|
4174
4230
|
class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
|
|
4175
|
-
}, Te = /* @__PURE__ */
|
|
4231
|
+
}, Te = /* @__PURE__ */ F({
|
|
4176
4232
|
__name: "vs-compact-form",
|
|
4177
4233
|
props: /* @__PURE__ */ Q({
|
|
4178
4234
|
schema: { default: () => [] },
|
|
@@ -4194,48 +4250,48 @@ const wi = {
|
|
|
4194
4250
|
validate: c,
|
|
4195
4251
|
reset: v,
|
|
4196
4252
|
visibleSchema: p
|
|
4197
|
-
} =
|
|
4253
|
+
} = _i(s, a.schema, Tt(a, "disabled")), f = () => {
|
|
4198
4254
|
r("update:modelValue", s.value), c(), r("handle-submit", s.value);
|
|
4199
4255
|
};
|
|
4200
4256
|
e({
|
|
4201
4257
|
validate: c,
|
|
4202
4258
|
reset: v,
|
|
4203
4259
|
errors: u
|
|
4204
|
-
}),
|
|
4260
|
+
}), xe(() => {
|
|
4205
4261
|
a.modelValue && (s.value = a.modelValue), n.value.value = s.value, n.value.errors = u.value, n.value.reset = v, n.value.validate = c, n.value.formId = a.formId;
|
|
4206
4262
|
});
|
|
4207
|
-
function y(_,
|
|
4208
|
-
if (_ ===
|
|
4209
|
-
if (typeof _ != "object" || typeof
|
|
4210
|
-
const E = Object.keys(_),
|
|
4211
|
-
return E.length !==
|
|
4263
|
+
function y(_, O) {
|
|
4264
|
+
if (_ === O) return !0;
|
|
4265
|
+
if (typeof _ != "object" || typeof O != "object" || !_ || !O) return !1;
|
|
4266
|
+
const E = Object.keys(_), U = Object.keys(O);
|
|
4267
|
+
return E.length !== U.length ? !1 : E.every((M) => _[M] === O[M]);
|
|
4212
4268
|
}
|
|
4213
4269
|
return rt("form", n), rt("values", s), le(n.value, (_) => {
|
|
4214
4270
|
console.log("form", _);
|
|
4215
|
-
}), (_,
|
|
4216
|
-
onSubmit:
|
|
4217
|
-
class:
|
|
4271
|
+
}), (_, O) => (i(), d("form", {
|
|
4272
|
+
onSubmit: ye(f, ["prevent"]),
|
|
4273
|
+
class: C(["grid grid-cols-12", _.layout === "default" ? "gap-6" : "gap-4"])
|
|
4218
4274
|
}, [
|
|
4219
|
-
(i(!0), d(ee, null,
|
|
4275
|
+
(i(!0), d(ee, null, oe(J(p), (E, U) => (i(), d("div", {
|
|
4220
4276
|
key: E.name,
|
|
4221
|
-
class:
|
|
4277
|
+
class: C(_.layout === "horizontal" ? "col-span-12" : `col-span-${E.col || 12}`)
|
|
4222
4278
|
}, [
|
|
4223
|
-
I(
|
|
4224
|
-
style:
|
|
4279
|
+
I(Ct, {
|
|
4280
|
+
style: ke(_.style),
|
|
4225
4281
|
item: E,
|
|
4226
4282
|
layout: _.layout,
|
|
4227
4283
|
"model-value": s.value[E.name],
|
|
4228
|
-
"onUpdate:modelValue": (
|
|
4229
|
-
const
|
|
4230
|
-
y(
|
|
4284
|
+
"onUpdate:modelValue": (M) => {
|
|
4285
|
+
const S = s.value[E.name];
|
|
4286
|
+
y(S, M) || (s.value[E.name] = M);
|
|
4231
4287
|
},
|
|
4232
4288
|
error: J(u)[E.name]
|
|
4233
4289
|
}, null, 8, ["style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]),
|
|
4234
|
-
_.layout === "settings" &&
|
|
4290
|
+
_.layout === "settings" && U + 1 !== J(p).length ? (i(), d("div", $i)) : A("", !0)
|
|
4235
4291
|
], 2))), 128))
|
|
4236
4292
|
], 34));
|
|
4237
4293
|
}
|
|
4238
|
-
}),
|
|
4294
|
+
}), Vi = { class: "relative" }, Ci = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, Mi = { 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" }, Li = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Si = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Bi = { class: "p-4 mim-h-0 h-full overflow-auto" }, ji = /* @__PURE__ */ F({
|
|
4239
4295
|
__name: "modal-edit",
|
|
4240
4296
|
props: {
|
|
4241
4297
|
schema: {},
|
|
@@ -4296,7 +4352,7 @@ const wi = {
|
|
|
4296
4352
|
function p() {
|
|
4297
4353
|
r("close");
|
|
4298
4354
|
}
|
|
4299
|
-
return
|
|
4355
|
+
return xe(async () => {
|
|
4300
4356
|
try {
|
|
4301
4357
|
if (t.form) {
|
|
4302
4358
|
const f = await fetch(`/api/template/form/${t.form}`);
|
|
@@ -4331,11 +4387,11 @@ const wi = {
|
|
|
4331
4387
|
message: f.message || "Unexpected error"
|
|
4332
4388
|
}), console.error(f);
|
|
4333
4389
|
}
|
|
4334
|
-
}), (f, y) => (i(), d("div",
|
|
4335
|
-
l("div",
|
|
4336
|
-
l("div",
|
|
4337
|
-
l("div",
|
|
4338
|
-
l("h3",
|
|
4390
|
+
}), (f, y) => (i(), d("div", Vi, [
|
|
4391
|
+
l("div", Ci, [
|
|
4392
|
+
l("div", Mi, [
|
|
4393
|
+
l("div", Li, [
|
|
4394
|
+
l("h3", Si, P(c.value === "add" ? "Додати" : "Змінити"), 1),
|
|
4339
4395
|
l("button", {
|
|
4340
4396
|
onClick: p,
|
|
4341
4397
|
type: "button",
|
|
@@ -4359,7 +4415,7 @@ const wi = {
|
|
|
4359
4415
|
], -1)
|
|
4360
4416
|
]))
|
|
4361
4417
|
]),
|
|
4362
|
-
l("div",
|
|
4418
|
+
l("div", Bi, [
|
|
4363
4419
|
a.value ? (i(), re(Te, {
|
|
4364
4420
|
key: 0,
|
|
4365
4421
|
schema: a.value,
|
|
@@ -4367,7 +4423,7 @@ const wi = {
|
|
|
4367
4423
|
"onUpdate:values": y[0] || (y[0] = (_) => n.value = _),
|
|
4368
4424
|
form: s.value,
|
|
4369
4425
|
"onUpdate:form": y[1] || (y[1] = (_) => s.value = _)
|
|
4370
|
-
}, null, 8, ["schema", "values", "form"])) :
|
|
4426
|
+
}, null, 8, ["schema", "values", "form"])) : A("", !0)
|
|
4371
4427
|
]),
|
|
4372
4428
|
l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
|
|
4373
4429
|
l("button", {
|
|
@@ -4386,13 +4442,13 @@ const wi = {
|
|
|
4386
4442
|
]));
|
|
4387
4443
|
}
|
|
4388
4444
|
}), mt = (o = { mode: "edit", schema: null }) => new Promise((e) => {
|
|
4389
|
-
const { close: t } =
|
|
4445
|
+
const { close: t } = Rt({
|
|
4390
4446
|
title: o.mode === "add" ? "Додати" : "Редагувати",
|
|
4391
4447
|
template: "",
|
|
4392
4448
|
visible: !0,
|
|
4393
4449
|
size: "medium",
|
|
4394
4450
|
closeClickBack: !0,
|
|
4395
|
-
content:
|
|
4451
|
+
content: ji,
|
|
4396
4452
|
contentProps: {
|
|
4397
4453
|
...o,
|
|
4398
4454
|
onClose: () => {
|
|
@@ -4410,29 +4466,30 @@ Te.install = function(e) {
|
|
|
4410
4466
|
}), e.provide("form", mt), window.v3plugin || (window.v3plugin = {});
|
|
4411
4467
|
};
|
|
4412
4468
|
export {
|
|
4413
|
-
|
|
4469
|
+
ji as ModalEdit,
|
|
4414
4470
|
Te as VForm,
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4471
|
+
ci as VsInputArray,
|
|
4472
|
+
ro as VsInputCheckbox,
|
|
4473
|
+
ni as VsInputColor,
|
|
4474
|
+
Ka as VsInputContainer,
|
|
4475
|
+
uo as VsInputDate,
|
|
4476
|
+
Ql as VsInputEmail,
|
|
4477
|
+
Wo as VsInputFile,
|
|
4478
|
+
$a as VsInputFileList,
|
|
4479
|
+
oi as VsInputKeyValue,
|
|
4480
|
+
Kl as VsInputMask,
|
|
4481
|
+
ml as VsInputNumber,
|
|
4425
4482
|
ut as VsInputRadio,
|
|
4426
|
-
|
|
4483
|
+
ui as VsInputRange,
|
|
4427
4484
|
pt as VsInputSelect,
|
|
4428
|
-
|
|
4485
|
+
Gr as VsInputSlug,
|
|
4429
4486
|
it as VsInputStatic,
|
|
4430
4487
|
kt as VsInputSwitcher,
|
|
4431
|
-
|
|
4488
|
+
Pr as VsInputTag,
|
|
4432
4489
|
Ne as VsInputText,
|
|
4433
|
-
|
|
4490
|
+
cs as VsInputTextarea,
|
|
4434
4491
|
Te as default,
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4492
|
+
pi as inputs,
|
|
4493
|
+
bn as vsInputDatatable,
|
|
4494
|
+
Ir as vsInputMap
|
|
4438
4495
|
};
|