@opengis/form 0.0.40 → 0.0.41
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/vs-input-select.vue.d.ts.map +1 -1
- package/dist/components/layouts/index.d.ts +5 -1
- package/dist/components/layouts/index.d.ts.map +1 -1
- package/dist/components/layouts/vs-compact-form-layout.vue.d.ts.map +1 -1
- package/dist/components/layouts/vs-layout-default.vue.d.ts +5 -1
- package/dist/components/layouts/vs-layout-default.vue.d.ts.map +1 -1
- package/dist/index.js +1004 -998
- package/dist/index.umd.cjs +3 -3
- package/package.json +67 -67
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as O, ref as w, onMounted as be, onUnmounted as qe, createElementBlock as d, openBlock as i,
|
|
2
|
-
import { notify as
|
|
3
|
-
const Rt = {
|
|
1
|
+
import { defineComponent as O, ref as w, onMounted as be, onUnmounted as qe, createElementBlock as d, openBlock as i, createCommentVNode as F, renderSlot as Ce, createElementVNode as l, toDisplayString as P, mergeProps as Ie, createTextVNode as ve, normalizeProps as Ze, guardReactiveProps as Ye, computed as D, normalizeClass as B, 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 we, withCtx as Be, withModifiers as ge, onBeforeUnmount as Ft, watch as le, createStaticVNode as pe, vModelRadio as gt, Fragment as ee, renderList as ae, reactive as At, vModelDynamic as Dt, vShow as Ge, inject as Se, resolveComponent as nt, Transition as bt, Teleport as yt, nextTick as De, getCurrentInstance as Ot, toRef as Ut, provide as rt } from "vue";
|
|
2
|
+
import { notify as ne, VsModal as xt, modal as Tt } from "@opengis/core";
|
|
3
|
+
const Rt = { class: "w-full relative" }, Pt = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
6
|
-
},
|
|
6
|
+
}, Ht = { class: "opacity-100" }, Nt = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-red-500 text-[14px]"
|
|
9
|
-
},
|
|
9
|
+
}, qt = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
12
|
-
},
|
|
12
|
+
}, Gt = /* @__PURE__ */ O({
|
|
13
13
|
__name: "vs-layout-default",
|
|
14
14
|
props: {
|
|
15
15
|
ua: { default: "" },
|
|
@@ -23,34 +23,34 @@ const Rt = {
|
|
|
23
23
|
label: { default: "" }
|
|
24
24
|
},
|
|
25
25
|
setup(o) {
|
|
26
|
-
const e = w("uk"), t = (
|
|
27
|
-
|
|
26
|
+
const e = w("uk"), t = (r) => {
|
|
27
|
+
r.detail.key === "locale" && (e.value = r.detail.newValue);
|
|
28
28
|
};
|
|
29
29
|
return be(() => {
|
|
30
30
|
e.value = localStorage.locale, window.addEventListener("storage", t);
|
|
31
31
|
}), qe(() => {
|
|
32
32
|
window.removeEventListener("resize", t);
|
|
33
|
-
}), (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
l("span", Pt, P(n.item[e.value] || n.ua || n.label), 1),
|
|
38
|
-
n.item?.rules?.includes("required") ? (i(), d("span", Ht, "*")) : F("", !0)
|
|
33
|
+
}), (r, a) => (i(), d("div", Rt, [
|
|
34
|
+
r.ua || r.label ? (i(), d("div", Pt, [
|
|
35
|
+
l("span", Ht, P(r.item[e.value] || r.ua || r.label), 1),
|
|
36
|
+
r.item?.rules?.includes("required") ? (i(), d("span", Nt, "*")) : F("", !0)
|
|
39
37
|
])) : F("", !0),
|
|
40
|
-
Ce(
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
Ce(r.$slots, "default", Ie(r.$attrs, {
|
|
39
|
+
class: { "opacity-60": r.item.disabled }
|
|
40
|
+
})),
|
|
41
|
+
r.error ? (i(), d("span", qt, P(r.error), 1)) : F("", !0)
|
|
42
|
+
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), Jt = { class: "w-full relative flex flex-row items-center gap-2" }, Wt = {
|
|
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
|
+
}, Kt = {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: "text-red-500 text-[14px]"
|
|
50
|
-
},
|
|
50
|
+
}, Zt = {
|
|
51
51
|
key: 1,
|
|
52
52
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
53
|
-
},
|
|
53
|
+
}, Yt = /* @__PURE__ */ O({
|
|
54
54
|
__name: "vs-layout-horizontal",
|
|
55
55
|
props: {
|
|
56
56
|
ua: { default: "" },
|
|
@@ -64,19 +64,19 @@ const Rt = {
|
|
|
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",
|
|
67
|
+
return (e, t) => (i(), d("div", Jt, [
|
|
68
|
+
e.item?.type !== "html" ? (i(), d("span", Wt, [
|
|
69
69
|
ve(P(e.ua || e.label) + " ", 1),
|
|
70
|
-
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span",
|
|
70
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), d("span", Kt, "*")) : F("", !0)
|
|
71
71
|
])) : F("", !0),
|
|
72
|
-
Ce(e.$slots, "default",
|
|
73
|
-
e.error ? (i(), d("span",
|
|
72
|
+
Ce(e.$slots, "default", Ze(Ye(e.$attrs))),
|
|
73
|
+
e.error ? (i(), d("span", Zt, P(e.error), 1)) : F("", !0)
|
|
74
74
|
]));
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
76
|
+
}), Qt = { class: "w-full relative" }, Xt = {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
79
|
-
},
|
|
79
|
+
}, el = /* @__PURE__ */ O({
|
|
80
80
|
__name: "vs-layout-inline",
|
|
81
81
|
props: {
|
|
82
82
|
ua: { default: "" },
|
|
@@ -90,24 +90,24 @@ const Rt = {
|
|
|
90
90
|
label: { default: "" }
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
|
-
return (e, t) => (i(), d("div",
|
|
94
|
-
Ce(e.$slots, "default",
|
|
95
|
-
e.error ? (i(), d("span",
|
|
93
|
+
return (e, t) => (i(), d("div", Qt, [
|
|
94
|
+
Ce(e.$slots, "default", Ze(Ye(e.$attrs))),
|
|
95
|
+
e.error ? (i(), d("span", Xt, P(e.error), 1)) : F("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}),
|
|
98
|
+
}), tl = { class: "flex-1 min-w-0" }, ll = {
|
|
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
|
+
}, ol = { class: "truncate" }, al = {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "text-red-500 text-[14px]"
|
|
104
|
-
},
|
|
104
|
+
}, sl = {
|
|
105
105
|
key: 1,
|
|
106
106
|
class: "text-xs text-slate-500 dark:text-slate-400"
|
|
107
|
-
},
|
|
107
|
+
}, nl = { class: "w-full md:w-auto" }, rl = {
|
|
108
108
|
key: 0,
|
|
109
109
|
class: "mt-1 text-xs text-red-500"
|
|
110
|
-
},
|
|
110
|
+
}, il = /* @__PURE__ */ O({
|
|
111
111
|
__name: "vs-layout-settings",
|
|
112
112
|
props: {
|
|
113
113
|
ua: { default: "" },
|
|
@@ -123,7 +123,7 @@ const Rt = {
|
|
|
123
123
|
setup(o) {
|
|
124
124
|
const e = o, t = w("uk");
|
|
125
125
|
D(() => (e.item ?? {})?.[t.value] ?? e.ua ?? e.label ?? "");
|
|
126
|
-
const
|
|
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
129
|
return be(() => {
|
|
@@ -135,30 +135,30 @@ const Rt = {
|
|
|
135
135
|
}), qe(() => {
|
|
136
136
|
window.removeEventListener("storage", s);
|
|
137
137
|
}), (u, c) => (i(), d("div", {
|
|
138
|
-
class:
|
|
138
|
+
class: B(["w-full relative", { "opacity-60": u.item?.disabled }])
|
|
139
139
|
}, [
|
|
140
140
|
l("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: B(["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",
|
|
143
|
+
l("div", tl, [
|
|
144
|
+
u.ua || u.label ? (i(), d("p", ll, [
|
|
145
|
+
l("span", ol, P(u.item[t.value] || u.ua || u.label), 1),
|
|
146
|
+
a.value ? (i(), d("span", al, "*")) : F("", !0)
|
|
147
147
|
])) : F("", !0),
|
|
148
|
-
|
|
148
|
+
r.value ? (i(), d("p", sl, P(r.value), 1)) : F("", !0)
|
|
149
149
|
]),
|
|
150
|
-
l("div",
|
|
151
|
-
Ce(u.$slots, "default",
|
|
150
|
+
l("div", nl, [
|
|
151
|
+
Ce(u.$slots, "default", Ze(Ye(u.$attrs)))
|
|
152
152
|
])
|
|
153
153
|
], 2),
|
|
154
|
-
|
|
154
|
+
n.value ? (i(), d("p", rl, P(n.value), 1)) : F("", !0)
|
|
155
155
|
], 2));
|
|
156
156
|
}
|
|
157
|
-
}),
|
|
158
|
-
default:
|
|
159
|
-
horizontal:
|
|
160
|
-
inline:
|
|
161
|
-
settings:
|
|
157
|
+
}), ul = {
|
|
158
|
+
default: Gt,
|
|
159
|
+
horizontal: Yt,
|
|
160
|
+
inline: el,
|
|
161
|
+
settings: il
|
|
162
162
|
};
|
|
163
163
|
function ye(o) {
|
|
164
164
|
return {
|
|
@@ -168,7 +168,7 @@ function ye(o) {
|
|
|
168
168
|
})
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const dl = ["placeholder", "disabled"], cl = /* @__PURE__ */ O({
|
|
172
172
|
__name: "vs-input-password",
|
|
173
173
|
props: /* @__PURE__ */ Q({
|
|
174
174
|
style: { default: () => ({}) },
|
|
@@ -184,21 +184,21 @@ const ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
|
|
|
184
184
|
}),
|
|
185
185
|
emits: ["update:modelValue"],
|
|
186
186
|
setup(o) {
|
|
187
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
188
|
-
return (a,
|
|
187
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue");
|
|
188
|
+
return (a, n) => K((i(), d("input", {
|
|
189
189
|
type: "password",
|
|
190
|
-
"onUpdate:modelValue":
|
|
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: B(["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,
|
|
198
|
-
[ie,
|
|
197
|
+
}, null, 10, dl)), [
|
|
198
|
+
[ie, r.value]
|
|
199
199
|
]);
|
|
200
200
|
}
|
|
201
|
-
}),
|
|
201
|
+
}), pl = ["placeholder", "disabled"], Ne = /* @__PURE__ */ O({
|
|
202
202
|
__name: "vs-input-text",
|
|
203
203
|
props: /* @__PURE__ */ Q({
|
|
204
204
|
style: { default: () => ({}) },
|
|
@@ -214,21 +214,21 @@ const ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
|
|
|
214
214
|
}),
|
|
215
215
|
emits: ["update:modelValue"],
|
|
216
216
|
setup(o) {
|
|
217
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
218
|
-
return (a,
|
|
217
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue");
|
|
218
|
+
return (a, n) => K((i(), d("input", {
|
|
219
219
|
type: "text",
|
|
220
|
-
"onUpdate:modelValue":
|
|
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: B(["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,
|
|
228
|
-
[ie,
|
|
227
|
+
}, null, 10, pl)), [
|
|
228
|
+
[ie, r.value]
|
|
229
229
|
]);
|
|
230
230
|
}
|
|
231
|
-
}),
|
|
231
|
+
}), fl = ["placeholder"], vl = /* @__PURE__ */ O({
|
|
232
232
|
__name: "vs-input-number",
|
|
233
233
|
props: /* @__PURE__ */ Q({
|
|
234
234
|
style: { default: () => ({}) },
|
|
@@ -244,26 +244,26 @@ const ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
|
|
|
244
244
|
}),
|
|
245
245
|
emits: ["update:modelValue"],
|
|
246
246
|
setup(o) {
|
|
247
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
248
|
-
return (a,
|
|
247
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue");
|
|
248
|
+
return (a, n) => K((i(), d("input", {
|
|
249
249
|
type: "number",
|
|
250
250
|
step: "any",
|
|
251
|
-
"onUpdate:modelValue":
|
|
251
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
252
252
|
placeholder: a.placeholder,
|
|
253
|
-
class:
|
|
253
|
+
class: B(["py-1.5 px-3 block w-full bg-white", [J(t)]]),
|
|
254
254
|
style: {
|
|
255
255
|
border: "1px solid #CFD9E0"
|
|
256
256
|
}
|
|
257
|
-
}, null, 10,
|
|
258
|
-
[ie,
|
|
257
|
+
}, null, 10, fl)), [
|
|
258
|
+
[ie, r.value]
|
|
259
259
|
]);
|
|
260
260
|
}
|
|
261
261
|
}), N = (o, e) => {
|
|
262
262
|
const t = o.__vccOpts || o;
|
|
263
|
-
for (const [
|
|
264
|
-
t[
|
|
263
|
+
for (const [r, a] of e)
|
|
264
|
+
t[r] = a;
|
|
265
265
|
return t;
|
|
266
|
-
},
|
|
266
|
+
}, ml = {}, hl = {
|
|
267
267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
268
268
|
viewBox: "0 0 24 24",
|
|
269
269
|
fill: "none",
|
|
@@ -273,8 +273,8 @@ const ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
|
|
|
273
273
|
"stroke-linejoin": "round",
|
|
274
274
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
275
275
|
};
|
|
276
|
-
function
|
|
277
|
-
return i(), d("svg",
|
|
276
|
+
function gl(o, e) {
|
|
277
|
+
return i(), d("svg", hl, e[0] || (e[0] = [
|
|
278
278
|
l("path", {
|
|
279
279
|
stroke: "none",
|
|
280
280
|
d: "M0 0h24v24H0z",
|
|
@@ -283,7 +283,7 @@ function hl(o, e) {
|
|
|
283
283
|
l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
284
284
|
]));
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const bl = /* @__PURE__ */ N(ml, [["render", gl]]), yl = { class: "flex items-center gap-[4px]" }, xl = ["value", "id", "disabled"], wl = ["for"], kl = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _l = /* @__PURE__ */ O({
|
|
287
287
|
__name: "vs-checkbox-default",
|
|
288
288
|
props: {
|
|
289
289
|
value: { default: "" },
|
|
@@ -296,45 +296,45 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
296
296
|
},
|
|
297
297
|
emits: ["update:modelValue"],
|
|
298
298
|
setup(o, { emit: e }) {
|
|
299
|
-
const t = e,
|
|
300
|
-
get: () =>
|
|
301
|
-
set: (
|
|
299
|
+
const t = e, r = o, a = D({
|
|
300
|
+
get: () => r.modelValue,
|
|
301
|
+
set: (n) => t("update:modelValue", n)
|
|
302
302
|
});
|
|
303
|
-
return (
|
|
303
|
+
return (n, s) => (i(), d("div", yl, [
|
|
304
304
|
K(l("input", {
|
|
305
305
|
type: "checkbox",
|
|
306
|
-
value:
|
|
306
|
+
value: n.value,
|
|
307
307
|
"onUpdate:modelValue": s[0] || (s[0] = (u) => a.value = u),
|
|
308
|
-
class:
|
|
309
|
-
id:
|
|
310
|
-
disabled:
|
|
311
|
-
}, null, 10,
|
|
308
|
+
class: B(["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
|
+
id: n.id,
|
|
310
|
+
disabled: n.disabled
|
|
311
|
+
}, null, 10, xl), [
|
|
312
312
|
[ht, a.value]
|
|
313
313
|
]),
|
|
314
314
|
l("label", {
|
|
315
|
-
for:
|
|
316
|
-
class:
|
|
315
|
+
for: n.id,
|
|
316
|
+
class: B(["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
317
|
}, [
|
|
318
318
|
l("div", {
|
|
319
|
-
class:
|
|
319
|
+
class: B(["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
320
|
}, [
|
|
321
|
-
I(
|
|
321
|
+
I(bl, {
|
|
322
322
|
height: "12",
|
|
323
323
|
width: "12"
|
|
324
324
|
})
|
|
325
325
|
], 2),
|
|
326
|
-
l("span",
|
|
327
|
-
Ce(
|
|
328
|
-
ve(P(
|
|
326
|
+
l("span", kl, [
|
|
327
|
+
Ce(n.$slots, "default", {}, () => [
|
|
328
|
+
ve(P(n.label), 1)
|
|
329
329
|
])
|
|
330
330
|
])
|
|
331
|
-
], 10,
|
|
331
|
+
], 10, wl)
|
|
332
332
|
]));
|
|
333
333
|
}
|
|
334
|
-
}),
|
|
334
|
+
}), $l = ["name", "value", "disabled"], Cl = { class: "flex items-center gap-[6px] text-[14px]" }, Vl = {
|
|
335
335
|
key: 0,
|
|
336
336
|
class: "text-[16px]"
|
|
337
|
-
},
|
|
337
|
+
}, Ml = ["src"], Ll = /* @__PURE__ */ O({
|
|
338
338
|
__name: "vs-checkbox-buttons",
|
|
339
339
|
props: {
|
|
340
340
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -348,14 +348,14 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
348
348
|
},
|
|
349
349
|
emits: ["update:modelValue"],
|
|
350
350
|
setup(o, { emit: e }) {
|
|
351
|
-
const t = o,
|
|
351
|
+
const t = o, r = e, a = D({
|
|
352
352
|
get: () => t.modelValue,
|
|
353
353
|
set: (u) => {
|
|
354
|
-
|
|
354
|
+
r("update:modelValue", u);
|
|
355
355
|
}
|
|
356
|
-
}),
|
|
356
|
+
}), 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
357
|
return (u, c) => (i(), d("label", {
|
|
358
|
-
class:
|
|
358
|
+
class: B(["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
359
|
}, [
|
|
360
360
|
K(l("input", {
|
|
361
361
|
type: "checkbox",
|
|
@@ -364,14 +364,14 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
364
364
|
value: u.value,
|
|
365
365
|
"onUpdate:modelValue": c[0] || (c[0] = (v) => a.value = v),
|
|
366
366
|
disabled: u.disabled
|
|
367
|
-
}, null, 8,
|
|
367
|
+
}, null, 8, $l), [
|
|
368
368
|
[ht, a.value]
|
|
369
369
|
]),
|
|
370
|
-
l("span",
|
|
371
|
-
u.icon || u.imgUrl ? (i(), d("span",
|
|
370
|
+
l("span", Cl, [
|
|
371
|
+
u.icon || u.imgUrl ? (i(), d("span", Vl, [
|
|
372
372
|
u.icon ? (i(), d("i", {
|
|
373
373
|
key: 0,
|
|
374
|
-
class:
|
|
374
|
+
class: B(u.icon)
|
|
375
375
|
}, null, 2)) : F("", !0),
|
|
376
376
|
u.imgUrl ? (i(), d("img", {
|
|
377
377
|
key: 1,
|
|
@@ -379,7 +379,7 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
379
379
|
width: "16",
|
|
380
380
|
height: "16",
|
|
381
381
|
alt: "icon"
|
|
382
|
-
}, null, 8,
|
|
382
|
+
}, null, 8, Ml)) : F("", !0)
|
|
383
383
|
])) : F("", !0),
|
|
384
384
|
Ce(u.$slots, "default", {}, () => [
|
|
385
385
|
ve(P(u.label), 1)
|
|
@@ -387,7 +387,7 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
387
387
|
])
|
|
388
388
|
], 2));
|
|
389
389
|
}
|
|
390
|
-
}),
|
|
390
|
+
}), Sl = { class: "flex items-center" }, wt = /* @__PURE__ */ O({
|
|
391
391
|
__name: "vs-input-checkbox-item",
|
|
392
392
|
props: {
|
|
393
393
|
value: { default: "" },
|
|
@@ -404,24 +404,24 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
404
404
|
},
|
|
405
405
|
emits: ["update:modelValue"],
|
|
406
406
|
setup(o, { emit: e }) {
|
|
407
|
-
const t = o,
|
|
407
|
+
const t = o, r = e, a = `radio-${Math.floor(Math.random() * 1e4)}`, n = D({
|
|
408
408
|
get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
|
|
409
409
|
set: (u) => {
|
|
410
410
|
if (Array.isArray(t.modelValue)) {
|
|
411
411
|
let c = [...t.modelValue];
|
|
412
|
-
u ? c.includes(t.value) || c.push(t.value) : c = c.filter((v) => v !== t.value),
|
|
412
|
+
u ? c.includes(t.value) || c.push(t.value) : c = c.filter((v) => v !== t.value), r("update:modelValue", c);
|
|
413
413
|
} else
|
|
414
|
-
|
|
414
|
+
r("update:modelValue", u);
|
|
415
415
|
}
|
|
416
416
|
}), s = w(`vs-checkbox-${t.view || "default"}`);
|
|
417
|
-
return (u, c) => (i(), d("div",
|
|
418
|
-
(i(),
|
|
417
|
+
return (u, c) => (i(), d("div", Sl, [
|
|
418
|
+
(i(), re(Ee(s.value === "vs-checkbox-buttons" ? J(Ll) : J(_l)), {
|
|
419
419
|
value: u.value,
|
|
420
420
|
label: u.label,
|
|
421
421
|
info: u.option?.info,
|
|
422
422
|
disabled: u.disabled,
|
|
423
|
-
modelValue:
|
|
424
|
-
"onUpdate:modelValue": c[0] || (c[0] = (v) =>
|
|
423
|
+
modelValue: n.value,
|
|
424
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => n.value = v),
|
|
425
425
|
id: a,
|
|
426
426
|
icon: u.icon,
|
|
427
427
|
imgUrl: u.imgUrl,
|
|
@@ -435,7 +435,7 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
435
435
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
436
436
|
]));
|
|
437
437
|
}
|
|
438
|
-
}),
|
|
438
|
+
}), Bl = {}, jl = {
|
|
439
439
|
xmlns: "http://www.w3.org/2000/svg",
|
|
440
440
|
viewBox: "0 0 24 24",
|
|
441
441
|
fill: "none",
|
|
@@ -445,8 +445,8 @@ const gl = /* @__PURE__ */ N(vl, [["render", hl]]), bl = { class: "flex items-ce
|
|
|
445
445
|
"stroke-linejoin": "round",
|
|
446
446
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
447
447
|
};
|
|
448
|
-
function
|
|
449
|
-
return i(), d("svg",
|
|
448
|
+
function Il(o, e) {
|
|
449
|
+
return i(), d("svg", jl, e[0] || (e[0] = [
|
|
450
450
|
l("path", {
|
|
451
451
|
stroke: "none",
|
|
452
452
|
d: "M0 0h24v24H0z",
|
|
@@ -455,7 +455,7 @@ function jl(o, e) {
|
|
|
455
455
|
l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
456
456
|
]));
|
|
457
457
|
}
|
|
458
|
-
const
|
|
458
|
+
const El = /* @__PURE__ */ N(Bl, [["render", Il]]), zl = {}, Fl = {
|
|
459
459
|
xmlns: "http://www.w3.org/2000/svg",
|
|
460
460
|
viewBox: "0 0 24 24",
|
|
461
461
|
fill: "none",
|
|
@@ -465,8 +465,8 @@ const Il = /* @__PURE__ */ N(Sl, [["render", jl]]), El = {}, zl = {
|
|
|
465
465
|
"stroke-linejoin": "round",
|
|
466
466
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
467
467
|
};
|
|
468
|
-
function
|
|
469
|
-
return i(), d("svg",
|
|
468
|
+
function Al(o, e) {
|
|
469
|
+
return i(), d("svg", Fl, e[0] || (e[0] = [
|
|
470
470
|
l("path", {
|
|
471
471
|
stroke: "none",
|
|
472
472
|
d: "M0 0h24v24H0z",
|
|
@@ -476,7 +476,7 @@ function Fl(o, e) {
|
|
|
476
476
|
l("path", { d: "M6 6l12 12" }, null, -1)
|
|
477
477
|
]));
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const Dl = /* @__PURE__ */ N(zl, [["render", Al]]), Ol = {}, Ul = {
|
|
480
480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
481
481
|
width: "24",
|
|
482
482
|
height: "24",
|
|
@@ -487,8 +487,8 @@ const Al = /* @__PURE__ */ N(El, [["render", Fl]]), Dl = {}, Ol = {
|
|
|
487
487
|
"stroke-linecap": "round",
|
|
488
488
|
"stroke-linejoin": "round"
|
|
489
489
|
};
|
|
490
|
-
function
|
|
491
|
-
return i(), d("svg",
|
|
490
|
+
function Tl(o, e) {
|
|
491
|
+
return i(), d("svg", Ul, e[0] || (e[0] = [
|
|
492
492
|
l("path", {
|
|
493
493
|
stroke: "none",
|
|
494
494
|
d: "M0 0h24v24H0z",
|
|
@@ -499,13 +499,13 @@ function Ul(o, e) {
|
|
|
499
499
|
l("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
500
500
|
]));
|
|
501
501
|
}
|
|
502
|
-
const
|
|
502
|
+
const Rl = /* @__PURE__ */ N(Ol, [["render", Tl]]), Pl = {
|
|
503
503
|
key: 0,
|
|
504
504
|
class: "flex items-start gap-x-1"
|
|
505
|
-
},
|
|
505
|
+
}, Hl = {
|
|
506
506
|
key: 0,
|
|
507
507
|
class: "text-red-500 text-[14px]"
|
|
508
|
-
},
|
|
508
|
+
}, Nl = ["title"], ql = ["disabled"], kt = /* @__PURE__ */ O({
|
|
509
509
|
__name: "vs-input-switcher",
|
|
510
510
|
props: /* @__PURE__ */ Q({
|
|
511
511
|
rules: { default: () => [] },
|
|
@@ -527,37 +527,37 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
527
527
|
emits: ["update:modelValue"],
|
|
528
528
|
setup(o) {
|
|
529
529
|
const e = o, t = X(o, "modelValue");
|
|
530
|
-
return (
|
|
530
|
+
return (r, a) => e.view === "checkbox" ? (i(), d("div", Pl, [
|
|
531
531
|
I(wt, {
|
|
532
532
|
modelValue: t.value,
|
|
533
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
534
|
-
label:
|
|
535
|
-
error:
|
|
533
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => t.value = n),
|
|
534
|
+
label: r.text,
|
|
535
|
+
error: r.error || ""
|
|
536
536
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
r.rules?.includes("required") ? (i(), d("span", Hl, "*")) : F("", !0),
|
|
538
|
+
r.i ? (i(), d("button", {
|
|
539
539
|
key: 1,
|
|
540
540
|
class: "cursor-pointer",
|
|
541
|
-
title:
|
|
541
|
+
title: r.i,
|
|
542
542
|
onClick: a[1] || (a[1] = ge(() => {
|
|
543
543
|
}, ["prevent"]))
|
|
544
544
|
}, [
|
|
545
|
-
I(J(
|
|
546
|
-
], 8,
|
|
545
|
+
I(J(Rl), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
546
|
+
], 8, Nl)) : F("", !0)
|
|
547
547
|
])) : (i(), d("button", {
|
|
548
548
|
key: 1,
|
|
549
549
|
type: "button",
|
|
550
|
-
class:
|
|
551
|
-
disabled:
|
|
552
|
-
onClick: a[2] || (a[2] = (
|
|
550
|
+
class: B(["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
|
+
disabled: r.disabled,
|
|
552
|
+
onClick: a[2] || (a[2] = (n) => t.value = !t.value)
|
|
553
553
|
}, [
|
|
554
554
|
l("span", {
|
|
555
555
|
"data-state": "checked",
|
|
556
|
-
class:
|
|
556
|
+
class: B(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
|
|
557
557
|
}, null, 2)
|
|
558
|
-
], 10,
|
|
558
|
+
], 10, ql));
|
|
559
559
|
}
|
|
560
|
-
}),
|
|
560
|
+
}), Gl = ["innerHTML"], it = /* @__PURE__ */ O({
|
|
561
561
|
__name: "vs-input-static",
|
|
562
562
|
props: {
|
|
563
563
|
text: { default: "" },
|
|
@@ -572,11 +572,11 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
572
572
|
},
|
|
573
573
|
setup(o) {
|
|
574
574
|
return (e, t) => (i(), d("div", {
|
|
575
|
-
class:
|
|
575
|
+
class: B(e.customClass),
|
|
576
576
|
innerHTML: e.html ? e.html : e.text
|
|
577
|
-
}, null, 10,
|
|
577
|
+
}, null, 10, Gl));
|
|
578
578
|
}
|
|
579
|
-
}),
|
|
579
|
+
}), Jl = ["placeholder", "disabled", "name"], Wl = /* @__PURE__ */ O({
|
|
580
580
|
__name: "vs-input-mask",
|
|
581
581
|
props: /* @__PURE__ */ Q({
|
|
582
582
|
name: {},
|
|
@@ -594,12 +594,12 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
594
594
|
}),
|
|
595
595
|
emits: ["update:modelValue"],
|
|
596
596
|
setup(o) {
|
|
597
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
598
|
-
let
|
|
597
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue"), a = w(null);
|
|
598
|
+
let n = null;
|
|
599
599
|
return be(async () => {
|
|
600
600
|
if (a.value) {
|
|
601
601
|
const { default: s } = await import("./index-W-qQIppj.js");
|
|
602
|
-
|
|
602
|
+
n = s(a.value, {
|
|
603
603
|
mask: e.mask || "",
|
|
604
604
|
definitions: {
|
|
605
605
|
9: /[0-9]/,
|
|
@@ -607,16 +607,16 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
607
607
|
"*": /[a-zA-Z0-9]/
|
|
608
608
|
},
|
|
609
609
|
lazy: !1
|
|
610
|
-
}),
|
|
611
|
-
|
|
612
|
-
}),
|
|
613
|
-
|
|
614
|
-
}),
|
|
610
|
+
}), n.on("accept", () => {
|
|
611
|
+
r.value = e.unmask ? n.unmaskedValue : n.value;
|
|
612
|
+
}), n.on("complete", () => {
|
|
613
|
+
r.value = e.unmask ? n.unmaskedValue : n.value;
|
|
614
|
+
}), n.value = r.value ?? "";
|
|
615
615
|
}
|
|
616
616
|
}), Ft(() => {
|
|
617
|
-
|
|
617
|
+
n?.destroy();
|
|
618
618
|
}), le(() => e.mask, (s) => {
|
|
619
|
-
|
|
619
|
+
n && n.updateOptions({
|
|
620
620
|
mask: s,
|
|
621
621
|
definitions: {
|
|
622
622
|
9: /[0-9]/,
|
|
@@ -624,8 +624,8 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
624
624
|
"*": /[a-zA-Z0-9]/
|
|
625
625
|
}
|
|
626
626
|
});
|
|
627
|
-
}), le(
|
|
628
|
-
|
|
627
|
+
}), le(r, (s) => {
|
|
628
|
+
n && n.unmaskedValue !== s && (n.value = s || "");
|
|
629
629
|
}), (s, u) => (i(), d("input", {
|
|
630
630
|
type: "text",
|
|
631
631
|
ref_key: "inputEl",
|
|
@@ -633,13 +633,13 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
633
633
|
placeholder: s.placeholder,
|
|
634
634
|
disabled: s.disabled,
|
|
635
635
|
name: s.name,
|
|
636
|
-
class:
|
|
636
|
+
class: B(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t)]]),
|
|
637
637
|
style: {
|
|
638
638
|
border: "1px solid #CFD9E0"
|
|
639
639
|
}
|
|
640
|
-
}, null, 10,
|
|
640
|
+
}, null, 10, Jl));
|
|
641
641
|
}
|
|
642
|
-
}),
|
|
642
|
+
}), Kl = { class: "relative w-full bg-white rounded-lg" }, Zl = ["placeholder", "disabled"], Yl = /* @__PURE__ */ O({
|
|
643
643
|
__name: "vs-input-email",
|
|
644
644
|
props: /* @__PURE__ */ Q({
|
|
645
645
|
style: { default: () => ({}) },
|
|
@@ -655,24 +655,24 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
655
655
|
}),
|
|
656
656
|
emits: ["update:modelValue"],
|
|
657
657
|
setup(o) {
|
|
658
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
659
|
-
return (a,
|
|
660
|
-
|
|
658
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue");
|
|
659
|
+
return (a, n) => (i(), d("div", Kl, [
|
|
660
|
+
n[1] || (n[1] = pe('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
|
|
661
661
|
K(l("input", {
|
|
662
662
|
type: "email",
|
|
663
|
-
"onUpdate:modelValue":
|
|
663
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
664
664
|
placeholder: a.placeholder,
|
|
665
665
|
disabled: a.disabled,
|
|
666
|
-
class:
|
|
666
|
+
class: B(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [J(t), { "!border-red-600": a.error }]]),
|
|
667
667
|
style: {
|
|
668
668
|
border: "1px solid #CFD9E0"
|
|
669
669
|
}
|
|
670
|
-
}, null, 10,
|
|
671
|
-
[ie,
|
|
670
|
+
}, null, 10, Zl), [
|
|
671
|
+
[ie, r.value]
|
|
672
672
|
])
|
|
673
673
|
]));
|
|
674
674
|
}
|
|
675
|
-
}),
|
|
675
|
+
}), Ql = ["value", "disabled"], Xl = { class: "text-[13px] text-gray-700" }, eo = /* @__PURE__ */ O({
|
|
676
676
|
__name: "vs-input-radio-default",
|
|
677
677
|
props: /* @__PURE__ */ Q({
|
|
678
678
|
style: {},
|
|
@@ -691,33 +691,33 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
691
691
|
emits: ["update:modelValue"],
|
|
692
692
|
setup(o) {
|
|
693
693
|
const e = X(o, "modelValue");
|
|
694
|
-
return (t,
|
|
695
|
-
class:
|
|
694
|
+
return (t, r) => (i(), d("label", {
|
|
695
|
+
class: B(["flex items-center gap-0", [t.customClass]])
|
|
696
696
|
}, [
|
|
697
697
|
K(l("input", {
|
|
698
|
-
"onUpdate:modelValue":
|
|
698
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => e.value = a),
|
|
699
699
|
type: "radio",
|
|
700
700
|
value: t.value,
|
|
701
701
|
disabled: t.disabled,
|
|
702
702
|
class: "hidden"
|
|
703
|
-
}, null, 8,
|
|
703
|
+
}, null, 8, Ql), [
|
|
704
704
|
[gt, e.value]
|
|
705
705
|
]),
|
|
706
706
|
l("span", {
|
|
707
|
-
class:
|
|
707
|
+
class: B(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
|
|
708
708
|
`border-${t.style?.primaryColor || "blue"}-500`,
|
|
709
709
|
t.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
710
710
|
]])
|
|
711
711
|
}, [
|
|
712
712
|
e.value == t.value ? (i(), d("span", {
|
|
713
713
|
key: 0,
|
|
714
|
-
class:
|
|
714
|
+
class: B(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
715
715
|
}, null, 2)) : F("", !0)
|
|
716
716
|
], 2),
|
|
717
|
-
l("span",
|
|
717
|
+
l("span", Xl, P(t.text), 1)
|
|
718
718
|
], 2));
|
|
719
719
|
}
|
|
720
|
-
}),
|
|
720
|
+
}), to = ["value", "disabled"], lo = { class: "text-[13px] text-gray-700" }, oo = /* @__PURE__ */ O({
|
|
721
721
|
__name: "vs-input-radio-buttons",
|
|
722
722
|
props: /* @__PURE__ */ Q({
|
|
723
723
|
style: {},
|
|
@@ -736,27 +736,27 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
736
736
|
emits: ["update:modelValue"],
|
|
737
737
|
setup(o) {
|
|
738
738
|
const e = X(o, "modelValue");
|
|
739
|
-
return (t,
|
|
740
|
-
class:
|
|
739
|
+
return (t, r) => (i(), d("label", {
|
|
740
|
+
class: B(["flex items-center border rounded-lg px-2 py-1", [
|
|
741
741
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
742
742
|
t.customClass
|
|
743
743
|
]])
|
|
744
744
|
}, [
|
|
745
745
|
K(l("input", {
|
|
746
|
-
"onUpdate:modelValue":
|
|
746
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => e.value = a),
|
|
747
747
|
type: "radio",
|
|
748
748
|
value: t.value,
|
|
749
749
|
disabled: t.disabled,
|
|
750
750
|
class: "hidden"
|
|
751
|
-
}, null, 8,
|
|
751
|
+
}, null, 8, to), [
|
|
752
752
|
[gt, e.value]
|
|
753
753
|
]),
|
|
754
|
-
l("span",
|
|
754
|
+
l("span", lo, P(t.text), 1)
|
|
755
755
|
], 2));
|
|
756
756
|
}
|
|
757
|
-
}),
|
|
758
|
-
"vs-input-radio-default":
|
|
759
|
-
"vs-input-radio-buttons":
|
|
757
|
+
}), ao = {
|
|
758
|
+
"vs-input-radio-default": eo,
|
|
759
|
+
"vs-input-radio-buttons": oo
|
|
760
760
|
}, ut = /* @__PURE__ */ O({
|
|
761
761
|
__name: "vs-input-radio",
|
|
762
762
|
props: /* @__PURE__ */ Q({
|
|
@@ -776,21 +776,21 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
776
776
|
}),
|
|
777
777
|
emits: ["update:modelValue"],
|
|
778
778
|
setup(o) {
|
|
779
|
-
const e = o, t = X(o, "modelValue"),
|
|
780
|
-
return (a,
|
|
781
|
-
class:
|
|
779
|
+
const e = o, t = X(o, "modelValue"), r = D(() => ao[`vs-input-radio-${e.view}`]);
|
|
780
|
+
return (a, n) => (i(), d("div", {
|
|
781
|
+
class: B([a.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
782
782
|
}, [
|
|
783
|
-
(i(!0), d(ee, null, ae(a.options, (s) => (i(),
|
|
783
|
+
(i(!0), d(ee, null, ae(a.options, (s) => (i(), re(Ee(r.value), Ie({
|
|
784
784
|
key: s?.id,
|
|
785
785
|
text: s.text,
|
|
786
786
|
value: s.id.toString(),
|
|
787
787
|
checked: t.value === s.id,
|
|
788
788
|
modelValue: t.value,
|
|
789
|
-
"onUpdate:modelValue":
|
|
789
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => t.value = u)
|
|
790
790
|
}, { ref_for: !0 }, a.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
791
791
|
], 2));
|
|
792
792
|
}
|
|
793
|
-
}),
|
|
793
|
+
}), so = /* @__PURE__ */ O({
|
|
794
794
|
__name: "vs-input-checkbox",
|
|
795
795
|
props: {
|
|
796
796
|
options: { default: () => [] },
|
|
@@ -809,7 +809,7 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
809
809
|
},
|
|
810
810
|
emits: ["update:modelValue"],
|
|
811
811
|
setup(o, { emit: e }) {
|
|
812
|
-
const t = o,
|
|
812
|
+
const t = o, r = e, a = w([]), n = At({}), 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
813
|
try {
|
|
814
814
|
const p = await fetch(`/api/suggest/${t.data}`).then((f) => f.json());
|
|
815
815
|
a.value = p?.data || p;
|
|
@@ -822,27 +822,27 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
822
822
|
(p) => {
|
|
823
823
|
if (typeof p == "boolean" && a.value.length === 1) {
|
|
824
824
|
const f = s(a.value[0]);
|
|
825
|
-
|
|
825
|
+
n[f] = p;
|
|
826
826
|
} else if (Array.isArray(p)) {
|
|
827
827
|
const f = new Set(p);
|
|
828
828
|
a.value.forEach((y) => {
|
|
829
829
|
if (!y.disabled) {
|
|
830
830
|
const _ = s(y);
|
|
831
|
-
|
|
831
|
+
n[_] = f.has(_);
|
|
832
832
|
}
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
835
|
},
|
|
836
836
|
{ immediate: !0 }
|
|
837
837
|
), le(
|
|
838
|
-
|
|
838
|
+
n,
|
|
839
839
|
() => {
|
|
840
840
|
if (!a.value.length) {
|
|
841
|
-
|
|
841
|
+
r("update:modelValue", null);
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
|
-
const p = Object.entries(
|
|
845
|
-
|
|
844
|
+
const p = Object.entries(n).filter(([, f]) => f).map(([f]) => f);
|
|
845
|
+
r("update:modelValue", p.length === 0 ? [] : p);
|
|
846
846
|
},
|
|
847
847
|
{ deep: !0 }
|
|
848
848
|
), be(() => {
|
|
@@ -850,37 +850,37 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
850
850
|
v().then(() => {
|
|
851
851
|
if (typeof t.modelValue == "boolean" && a.value.length === 1) {
|
|
852
852
|
const p = s(a.value[0]);
|
|
853
|
-
|
|
853
|
+
n[p] = t.modelValue;
|
|
854
854
|
} else if (Array.isArray(t.modelValue)) {
|
|
855
855
|
const p = new Set(t.modelValue);
|
|
856
856
|
a.value.forEach((f) => {
|
|
857
857
|
if (!f.disabled) {
|
|
858
858
|
const y = s(f);
|
|
859
|
-
|
|
859
|
+
n[y] = p.has(y);
|
|
860
860
|
}
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
});
|
|
864
864
|
else if (a.value = t.options, typeof t.modelValue == "boolean" && a.value.length === 1) {
|
|
865
865
|
const p = s(a.value[0]);
|
|
866
|
-
|
|
866
|
+
n[p] = t.modelValue;
|
|
867
867
|
} else if (Array.isArray(t.modelValue)) {
|
|
868
868
|
const p = new Set(t.modelValue);
|
|
869
869
|
a.value.forEach((f) => {
|
|
870
870
|
if (!f.disabled) {
|
|
871
871
|
const y = s(f);
|
|
872
|
-
|
|
872
|
+
n[y] = p.has(y);
|
|
873
873
|
}
|
|
874
874
|
});
|
|
875
875
|
}
|
|
876
876
|
}), (p, f) => (i(), d("div", {
|
|
877
|
-
class:
|
|
877
|
+
class: B(["p-0 w-full gap-[6px]", [p.position === "vertical" ? "flex-col" : "", p.colSpan ? "grid" : "flex justify-start"]])
|
|
878
878
|
}, [
|
|
879
|
-
(i(!0), d(ee, null, ae(a.value, (y) => (i(),
|
|
880
|
-
modelValue:
|
|
881
|
-
"onUpdate:modelValue": (_) =>
|
|
879
|
+
(i(!0), d(ee, null, ae(a.value, (y) => (i(), re(wt, {
|
|
880
|
+
modelValue: n[s(y)],
|
|
881
|
+
"onUpdate:modelValue": (_) => n[s(y)] = _,
|
|
882
882
|
value: s(y),
|
|
883
|
-
class:
|
|
883
|
+
class: B(c(p.colSpan)),
|
|
884
884
|
disabled: y.disabled,
|
|
885
885
|
label: u(y),
|
|
886
886
|
key: s(y),
|
|
@@ -891,7 +891,7 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
891
891
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
892
892
|
], 2));
|
|
893
893
|
}
|
|
894
|
-
}),
|
|
894
|
+
}), no = /* @__PURE__ */ N(so, [["__scopeId", "data-v-91f3584a"]]), ro = ["type", "placeholder", "disabled"], io = /* @__PURE__ */ O({
|
|
895
895
|
__name: "vs-input-date1",
|
|
896
896
|
props: {
|
|
897
897
|
style: { default: () => ({}) },
|
|
@@ -906,12 +906,12 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
906
906
|
emits: ["update:modelValue"],
|
|
907
907
|
setup(o, { emit: e }) {
|
|
908
908
|
const t = o;
|
|
909
|
-
function
|
|
909
|
+
function r(c) {
|
|
910
910
|
return c ? t.mode === "datetime" ? (c.includes("T") ? c : null) || c + (c.includes(" ") ? "" : "T00:00") : c?.split(" ")[0] : null;
|
|
911
911
|
}
|
|
912
|
-
const { inputClass: a } = ye(t.style),
|
|
913
|
-
get: () =>
|
|
914
|
-
set: (c) =>
|
|
912
|
+
const { inputClass: a } = ye(t.style), n = e, s = D({
|
|
913
|
+
get: () => r(t.modelValue),
|
|
914
|
+
set: (c) => n("update:modelValue", c)
|
|
915
915
|
}), u = D(() => t.mode === "datetime" ? "datetime-local" : t.mode);
|
|
916
916
|
return (c, v) => K((i(), d("input", {
|
|
917
917
|
type: u.value,
|
|
@@ -919,7 +919,7 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
919
919
|
placeholder: c.placeholder,
|
|
920
920
|
disabled: c.disabled,
|
|
921
921
|
ref: "date",
|
|
922
|
-
class:
|
|
922
|
+
class: B(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [c.modelValue ? "" : "text-opacity-50", J(a)].join(" ")]),
|
|
923
923
|
style: {
|
|
924
924
|
border: "1px solid #CFD9E0"
|
|
925
925
|
}
|
|
@@ -927,25 +927,25 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
927
927
|
[Dt, s.value]
|
|
928
928
|
]);
|
|
929
929
|
}
|
|
930
|
-
}),
|
|
930
|
+
}), uo = async (o, e, t, r) => {
|
|
931
931
|
try {
|
|
932
932
|
const a = new FormData();
|
|
933
933
|
return a.append("unique", "true"), a.append("file", o), (await fetch(
|
|
934
|
-
`/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${
|
|
934
|
+
`/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${r || ""}`,
|
|
935
935
|
{
|
|
936
936
|
method: "POST",
|
|
937
937
|
body: a
|
|
938
938
|
}
|
|
939
939
|
).then((s) => s.json()))?.result;
|
|
940
940
|
} catch (a) {
|
|
941
|
-
return
|
|
941
|
+
return ne({
|
|
942
942
|
type: "error",
|
|
943
943
|
title: "Помилка!",
|
|
944
944
|
message: "Сталась помилка під час завантаження файлу",
|
|
945
945
|
position: "right-bottom"
|
|
946
946
|
}), console.error("Сталась помилка завантаження файлу", a), null;
|
|
947
947
|
}
|
|
948
|
-
},
|
|
948
|
+
}, co = async (o) => {
|
|
949
949
|
try {
|
|
950
950
|
return await fetch(`file/delete${o}`), !0;
|
|
951
951
|
} catch (e) {
|
|
@@ -953,12 +953,12 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
953
953
|
}
|
|
954
954
|
}, dt = async (o) => {
|
|
955
955
|
try {
|
|
956
|
-
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(),
|
|
957
|
-
s.setAttribute("download", o), s.href = window.URL.createObjectURL(
|
|
956
|
+
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), r = e.headers["content-type"], a = new TextDecoder("utf-8").decode(t), n = new Blob([a], { type: r }), s = document.createElement("a");
|
|
957
|
+
s.setAttribute("download", o), s.href = window.URL.createObjectURL(n), s.click();
|
|
958
958
|
} catch (e) {
|
|
959
959
|
console.error(e.message);
|
|
960
960
|
}
|
|
961
|
-
},
|
|
961
|
+
}, po = {}, fo = {
|
|
962
962
|
xmlns: "http://www.w3.org/2000/svg",
|
|
963
963
|
width: "24",
|
|
964
964
|
height: "24",
|
|
@@ -969,13 +969,13 @@ const Tl = /* @__PURE__ */ N(Dl, [["render", Ul]]), Rl = {
|
|
|
969
969
|
"stroke-linecap": "round",
|
|
970
970
|
"stroke-linejoin": "round"
|
|
971
971
|
};
|
|
972
|
-
function
|
|
973
|
-
return i(), d("svg",
|
|
972
|
+
function vo(o, e) {
|
|
973
|
+
return i(), d("svg", fo, e[0] || (e[0] = [
|
|
974
974
|
l("path", { d: "M5 12h14" }, null, -1),
|
|
975
975
|
l("path", { d: "M12 5v14" }, null, -1)
|
|
976
976
|
]));
|
|
977
977
|
}
|
|
978
|
-
const Ue = /* @__PURE__ */ N(
|
|
978
|
+
const Ue = /* @__PURE__ */ N(po, [["render", vo]]), mo = {}, ho = {
|
|
979
979
|
xmlns: "http://www.w3.org/2000/svg",
|
|
980
980
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
981
981
|
width: "44",
|
|
@@ -987,12 +987,12 @@ const Ue = /* @__PURE__ */ N(co, [["render", fo]]), vo = {}, mo = {
|
|
|
987
987
|
"stroke-linecap": "round",
|
|
988
988
|
"stroke-linejoin": "round"
|
|
989
989
|
};
|
|
990
|
-
function
|
|
991
|
-
return i(), d("svg",
|
|
992
|
-
|
|
990
|
+
function go(o, e, t, r, a, n) {
|
|
991
|
+
return i(), d("svg", ho, e[0] || (e[0] = [
|
|
992
|
+
pe('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
|
|
993
993
|
]));
|
|
994
994
|
}
|
|
995
|
-
const
|
|
995
|
+
const bo = /* @__PURE__ */ N(mo, [["render", go]]), yo = {}, xo = {
|
|
996
996
|
xmlns: "http://www.w3.org/2000/svg",
|
|
997
997
|
class: "icon icon-tabler icon-tabler-table",
|
|
998
998
|
width: "44",
|
|
@@ -1004,8 +1004,8 @@ const go = /* @__PURE__ */ N(vo, [["render", ho]]), bo = {}, yo = {
|
|
|
1004
1004
|
"stroke-linecap": "round",
|
|
1005
1005
|
"stroke-linejoin": "round"
|
|
1006
1006
|
};
|
|
1007
|
-
function
|
|
1008
|
-
return i(), d("svg",
|
|
1007
|
+
function wo(o, e, t, r, a, n) {
|
|
1008
|
+
return i(), d("svg", xo, e[0] || (e[0] = [
|
|
1009
1009
|
l("path", {
|
|
1010
1010
|
stroke: "none",
|
|
1011
1011
|
d: "M0 0h24v24H0z",
|
|
@@ -1032,7 +1032,7 @@ function xo(o, e, t, n, a, r) {
|
|
|
1032
1032
|
}, null, -1)
|
|
1033
1033
|
]));
|
|
1034
1034
|
}
|
|
1035
|
-
const
|
|
1035
|
+
const ko = /* @__PURE__ */ N(yo, [["render", wo]]), _o = {}, $o = {
|
|
1036
1036
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1037
1037
|
width: "24",
|
|
1038
1038
|
height: "24",
|
|
@@ -1043,12 +1043,12 @@ const wo = /* @__PURE__ */ N(bo, [["render", xo]]), ko = {}, _o = {
|
|
|
1043
1043
|
"stroke-linecap": "round",
|
|
1044
1044
|
"stroke-linejoin": "round"
|
|
1045
1045
|
};
|
|
1046
|
-
function
|
|
1047
|
-
return i(), d("svg",
|
|
1048
|
-
|
|
1046
|
+
function Co(o, e) {
|
|
1047
|
+
return i(), d("svg", $o, e[0] || (e[0] = [
|
|
1048
|
+
pe('<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
1049
|
]));
|
|
1050
1050
|
}
|
|
1051
|
-
const _t = /* @__PURE__ */ N(
|
|
1051
|
+
const _t = /* @__PURE__ */ N(_o, [["render", Co]]), Vo = {}, Mo = {
|
|
1052
1052
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1053
1053
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
1054
1054
|
width: "44",
|
|
@@ -1060,12 +1060,12 @@ const _t = /* @__PURE__ */ N(ko, [["render", $o]]), Co = {}, Vo = {
|
|
|
1060
1060
|
"stroke-linecap": "round",
|
|
1061
1061
|
"stroke-linejoin": "round"
|
|
1062
1062
|
};
|
|
1063
|
-
function
|
|
1064
|
-
return i(), d("svg",
|
|
1065
|
-
|
|
1063
|
+
function Lo(o, e, t, r, a, n) {
|
|
1064
|
+
return i(), d("svg", Mo, e[0] || (e[0] = [
|
|
1065
|
+
pe('<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
1066
|
]));
|
|
1067
1067
|
}
|
|
1068
|
-
const
|
|
1068
|
+
const So = /* @__PURE__ */ N(Vo, [["render", Lo]]), Bo = {}, jo = {
|
|
1069
1069
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1070
1070
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
1071
1071
|
width: "44",
|
|
@@ -1077,25 +1077,25 @@ const Lo = /* @__PURE__ */ N(Co, [["render", Mo]]), So = {}, Bo = {
|
|
|
1077
1077
|
"stroke-linecap": "round",
|
|
1078
1078
|
"stroke-linejoin": "round"
|
|
1079
1079
|
};
|
|
1080
|
-
function
|
|
1081
|
-
return i(), d("svg",
|
|
1082
|
-
|
|
1080
|
+
function Io(o, e, t, r, a, n) {
|
|
1081
|
+
return i(), d("svg", jo, e[0] || (e[0] = [
|
|
1082
|
+
pe('<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
1083
|
]));
|
|
1084
1084
|
}
|
|
1085
|
-
const
|
|
1085
|
+
const Eo = /* @__PURE__ */ N(Bo, [["render", Io]]), zo = (o) => {
|
|
1086
1086
|
if (!o) return "";
|
|
1087
1087
|
const e = o?.split(".");
|
|
1088
1088
|
return e[e.length - 1];
|
|
1089
|
-
},
|
|
1090
|
-
const e =
|
|
1089
|
+
}, Fo = (o) => {
|
|
1090
|
+
const e = zo(o), t = {
|
|
1091
1091
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
1092
1092
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
1093
1093
|
archivesFormat: ["zip", "rar"],
|
|
1094
1094
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
1095
1095
|
documentsFormat: ["pdf"]
|
|
1096
1096
|
};
|
|
1097
|
-
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ?
|
|
1098
|
-
},
|
|
1097
|
+
return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? ko : t.textsFormat.includes(e) ? Eo : t.documentsFormat.includes(e) ? bo : t.archivesFormat.includes(e) ? So : _t;
|
|
1098
|
+
}, Ao = {}, Do = {
|
|
1099
1099
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1100
1100
|
width: "24",
|
|
1101
1101
|
height: "24",
|
|
@@ -1107,12 +1107,12 @@ const Io = /* @__PURE__ */ N(So, [["render", jo]]), Eo = (o) => {
|
|
|
1107
1107
|
"stroke-linejoin": "round",
|
|
1108
1108
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
1109
1109
|
};
|
|
1110
|
-
function
|
|
1111
|
-
return i(), d("svg",
|
|
1112
|
-
|
|
1110
|
+
function Oo(o, e) {
|
|
1111
|
+
return i(), d("svg", Do, e[0] || (e[0] = [
|
|
1112
|
+
pe('<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
1113
|
]));
|
|
1114
1114
|
}
|
|
1115
|
-
const
|
|
1115
|
+
const Je = /* @__PURE__ */ N(Ao, [["render", Oo]]), Uo = {}, To = {
|
|
1116
1116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1117
1117
|
width: "24",
|
|
1118
1118
|
height: "24",
|
|
@@ -1124,8 +1124,8 @@ const Ke = /* @__PURE__ */ N(Fo, [["render", Do]]), Oo = {}, Uo = {
|
|
|
1124
1124
|
"stroke-linejoin": "round",
|
|
1125
1125
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1126
1126
|
};
|
|
1127
|
-
function
|
|
1128
|
-
return i(), d("svg",
|
|
1127
|
+
function Ro(o, e) {
|
|
1128
|
+
return i(), d("svg", To, e[0] || (e[0] = [
|
|
1129
1129
|
l("path", {
|
|
1130
1130
|
stroke: "none",
|
|
1131
1131
|
d: "M0 0h24v24H0z",
|
|
@@ -1136,7 +1136,7 @@ function To(o, e) {
|
|
|
1136
1136
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1137
1137
|
]));
|
|
1138
1138
|
}
|
|
1139
|
-
const $t = /* @__PURE__ */ N(
|
|
1139
|
+
const $t = /* @__PURE__ */ N(Uo, [["render", Ro]]), Po = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Ho = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, No = /* @__PURE__ */ O({
|
|
1140
1140
|
__name: "vs-input-file-list-item",
|
|
1141
1141
|
props: /* @__PURE__ */ Q({
|
|
1142
1142
|
format: {},
|
|
@@ -1156,27 +1156,27 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1156
1156
|
}),
|
|
1157
1157
|
emits: ["update:value", "update:item"],
|
|
1158
1158
|
setup(o) {
|
|
1159
|
-
const e = X(o, "value"), t = X(o, "item"),
|
|
1160
|
-
return (a,
|
|
1161
|
-
(i(),
|
|
1159
|
+
const e = X(o, "value"), t = X(o, "item"), r = o;
|
|
1160
|
+
return (a, n) => (i(), d("div", Po, [
|
|
1161
|
+
(i(), re(Ee(J(Fo)(t.value)), {
|
|
1162
1162
|
src: t.value,
|
|
1163
1163
|
alt: "file",
|
|
1164
1164
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1165
|
-
onClick:
|
|
1165
|
+
onClick: n[0] || (n[0] = (s) => J(dt)(t.value))
|
|
1166
1166
|
}, null, 8, ["src"])),
|
|
1167
|
-
l("div",
|
|
1167
|
+
l("div", Ho, [
|
|
1168
1168
|
l("button", {
|
|
1169
1169
|
type: "button",
|
|
1170
|
-
onClick:
|
|
1171
|
-
J(
|
|
1170
|
+
onClick: n[1] || (n[1] = (s) => {
|
|
1171
|
+
J(co)(t.value), e.value = r.multiple ? e.value?.filter((u) => u !== t.value) : "";
|
|
1172
1172
|
}),
|
|
1173
1173
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1174
1174
|
}, [
|
|
1175
|
-
I(
|
|
1175
|
+
I(Je, { class: "w-4 h-4" })
|
|
1176
1176
|
]),
|
|
1177
1177
|
l("button", {
|
|
1178
1178
|
type: "button",
|
|
1179
|
-
onClick:
|
|
1179
|
+
onClick: n[2] || (n[2] = (s) => J(dt)(t.value)),
|
|
1180
1180
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1181
1181
|
}, [
|
|
1182
1182
|
I($t, { class: "w-4 h-4" })
|
|
@@ -1184,10 +1184,10 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1184
1184
|
])
|
|
1185
1185
|
]));
|
|
1186
1186
|
}
|
|
1187
|
-
}), ct = /* @__PURE__ */ N(
|
|
1187
|
+
}), ct = /* @__PURE__ */ N(No, [["__scopeId", "data-v-0ca886b3"]]), qo = { class: "flex items-center gap-x-2" }, Go = {
|
|
1188
1188
|
key: 1,
|
|
1189
1189
|
class: "flex items-center flex-wrap gap-2"
|
|
1190
|
-
},
|
|
1190
|
+
}, Jo = /* @__PURE__ */ O({
|
|
1191
1191
|
__name: "vs-input-file",
|
|
1192
1192
|
props: /* @__PURE__ */ Q({
|
|
1193
1193
|
format: {},
|
|
@@ -1205,7 +1205,7 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1205
1205
|
}),
|
|
1206
1206
|
emits: ["update:modelValue"],
|
|
1207
1207
|
setup(o) {
|
|
1208
|
-
const e = o, t = X(o, "modelValue"),
|
|
1208
|
+
const e = o, t = X(o, "modelValue"), r = w(null), a = (s) => Array.isArray(t.value) && t.value[s] || "", n = async (s) => {
|
|
1209
1209
|
if (e.format) {
|
|
1210
1210
|
const v = s.target.files?.[0];
|
|
1211
1211
|
if (!v || !v.name.endsWith(e.format))
|
|
@@ -1213,25 +1213,25 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1213
1213
|
}
|
|
1214
1214
|
const u = s.target.files?.[0];
|
|
1215
1215
|
if (!u) return;
|
|
1216
|
-
const c = await
|
|
1216
|
+
const c = await uo(u, "1", "form", "table");
|
|
1217
1217
|
t.value = e.multiple ? [...t.value || [], c?.file_path] : c?.file_path;
|
|
1218
1218
|
};
|
|
1219
|
-
return (s, u) => (i(), d("div",
|
|
1219
|
+
return (s, u) => (i(), d("div", qo, [
|
|
1220
1220
|
l("input", {
|
|
1221
1221
|
class: "hidden",
|
|
1222
1222
|
ref_key: "fileInput",
|
|
1223
|
-
ref:
|
|
1223
|
+
ref: r,
|
|
1224
1224
|
type: "file",
|
|
1225
|
-
onChange:
|
|
1225
|
+
onChange: n
|
|
1226
1226
|
}, null, 544),
|
|
1227
|
-
!s.multiple && t.value ? (i(),
|
|
1227
|
+
!s.multiple && t.value ? (i(), re(ct, {
|
|
1228
1228
|
key: 0,
|
|
1229
1229
|
item: t.value,
|
|
1230
1230
|
"onUpdate:item": u[0] || (u[0] = (c) => t.value = c),
|
|
1231
1231
|
value: t.value,
|
|
1232
1232
|
"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, ae(t.value, (c, v) => (i(),
|
|
1233
|
+
}, null, 8, ["item", "value"])) : s.multiple ? (i(), d("div", Go, [
|
|
1234
|
+
(i(!0), d(ee, null, ae(t.value, (c, v) => (i(), re(ct, {
|
|
1235
1235
|
multiple: s.multiple,
|
|
1236
1236
|
key: v,
|
|
1237
1237
|
value: t.value,
|
|
@@ -1239,8 +1239,8 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1239
1239
|
item: a(v)
|
|
1240
1240
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1241
1241
|
l("div", {
|
|
1242
|
-
onClick: u[3] || (u[3] = (c) => !s.disabled &&
|
|
1243
|
-
class:
|
|
1242
|
+
onClick: u[3] || (u[3] = (c) => !s.disabled && r.value?.click()),
|
|
1243
|
+
class: B([
|
|
1244
1244
|
"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
1245
|
s.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1246
1246
|
])
|
|
@@ -1250,14 +1250,14 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1250
1250
|
])) : F("", !0),
|
|
1251
1251
|
s.multiple ? F("", !0) : (i(), d("div", {
|
|
1252
1252
|
key: 2,
|
|
1253
|
-
onClick: u[4] || (u[4] = (c) =>
|
|
1254
|
-
class:
|
|
1253
|
+
onClick: u[4] || (u[4] = (c) => r.value?.click()),
|
|
1254
|
+
class: B([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
1255
|
}, [
|
|
1256
1256
|
I(Ue, { class: "w-6 h-6" })
|
|
1257
1257
|
], 2))
|
|
1258
1258
|
]));
|
|
1259
1259
|
}
|
|
1260
|
-
}),
|
|
1260
|
+
}), Wo = { class: "max-w-[55vw]" }, Ko = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, Zo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, Yo = { class: "px-[5px]" }, Qo = { class: "" }, He = /* @__PURE__ */ O({
|
|
1261
1261
|
__name: "vs-widget-file-info",
|
|
1262
1262
|
props: {
|
|
1263
1263
|
item: { default: null }
|
|
@@ -1274,41 +1274,41 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1274
1274
|
return "";
|
|
1275
1275
|
}
|
|
1276
1276
|
});
|
|
1277
|
-
function
|
|
1277
|
+
function r(a) {
|
|
1278
1278
|
if (a < 1024)
|
|
1279
1279
|
return `${a} B`;
|
|
1280
|
-
const
|
|
1281
|
-
return
|
|
1280
|
+
const n = a / 1024;
|
|
1281
|
+
return n < 1024 ? `${n.toFixed(2)} KB` : `${(n / 1024).toFixed(2)} MB`;
|
|
1282
1282
|
}
|
|
1283
|
-
return (a,
|
|
1284
|
-
|
|
1285
|
-
l("div",
|
|
1286
|
-
l("p",
|
|
1287
|
-
l("p",
|
|
1283
|
+
return (a, n) => (i(), d(ee, null, [
|
|
1284
|
+
n[1] || (n[1] = pe('<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)),
|
|
1285
|
+
l("div", Wo, [
|
|
1286
|
+
l("p", Ko, P(a.item?.uploaded_name), 1),
|
|
1287
|
+
l("p", Zo, [
|
|
1288
1288
|
l("span", null, P(a.item?.username), 1),
|
|
1289
|
-
K(l("span",
|
|
1290
|
-
[
|
|
1289
|
+
K(l("span", Yo, "|", 512), [
|
|
1290
|
+
[Ge, a.item?.username]
|
|
1291
1291
|
]),
|
|
1292
1292
|
l("span", null, P(t.value), 1),
|
|
1293
|
-
|
|
1294
|
-
l("span",
|
|
1293
|
+
n[0] || (n[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1294
|
+
l("span", Qo, P(r(a.item?.size)), 1)
|
|
1295
1295
|
])
|
|
1296
1296
|
])
|
|
1297
1297
|
], 64));
|
|
1298
1298
|
}
|
|
1299
|
-
}),
|
|
1299
|
+
}), Xo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, ea = {
|
|
1300
1300
|
key: 0,
|
|
1301
1301
|
class: "flex w-full gap-x-3 items-center"
|
|
1302
|
-
},
|
|
1302
|
+
}, ta = {
|
|
1303
1303
|
key: 1,
|
|
1304
1304
|
class: "flex gap-x-3 w-full items-center"
|
|
1305
|
-
},
|
|
1305
|
+
}, la = {
|
|
1306
1306
|
key: 2,
|
|
1307
1307
|
class: "flex gap-x-3 w-full items-center"
|
|
1308
|
-
},
|
|
1308
|
+
}, oa = ["href"], aa = {
|
|
1309
1309
|
key: 3,
|
|
1310
1310
|
class: "flex gap-x-3 w-full items-center"
|
|
1311
|
-
},
|
|
1311
|
+
}, sa = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, na = { 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" }, ra = { class: "inline-block" }, ia = { class: "inline-block" }, ua = /* @__PURE__ */ O({
|
|
1312
1312
|
__name: "vs-widget-file-item",
|
|
1313
1313
|
props: {
|
|
1314
1314
|
item: { default: null },
|
|
@@ -1317,11 +1317,11 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1317
1317
|
},
|
|
1318
1318
|
emits: ["update", "openModal", "openLightbox"],
|
|
1319
1319
|
setup(o, { emit: e }) {
|
|
1320
|
-
const t = o,
|
|
1320
|
+
const t = o, r = e;
|
|
1321
1321
|
function a(p) {
|
|
1322
1322
|
return ["pdf", "json"].includes(p.ext);
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function n(p) {
|
|
1325
1325
|
return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(p.ext);
|
|
1326
1326
|
}
|
|
1327
1327
|
function s(p) {
|
|
@@ -1332,13 +1332,13 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1332
1332
|
try {
|
|
1333
1333
|
await fetch(
|
|
1334
1334
|
`${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
|
|
1335
|
-
),
|
|
1335
|
+
), r("update");
|
|
1336
1336
|
} catch (p) {
|
|
1337
1337
|
console.error(p);
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
1340
|
function c() {
|
|
1341
|
-
|
|
1341
|
+
r("openModal", {
|
|
1342
1342
|
title: "Ви впевнені?",
|
|
1343
1343
|
message: "Ви впевнені, що хочете видалити цей файл?",
|
|
1344
1344
|
confirmButtonText: "Так, я впевнена/ий",
|
|
@@ -1348,31 +1348,31 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
function v(p) {
|
|
1351
|
-
(t.item.ext === "jpg" || t.item.ext === "png") &&
|
|
1351
|
+
(t.item.ext === "jpg" || t.item.ext === "png") && r("openLightbox", { item: t.item, index: p });
|
|
1352
1352
|
}
|
|
1353
|
-
return (p, f) => (i(), d("div",
|
|
1354
|
-
p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div",
|
|
1353
|
+
return (p, f) => (i(), d("div", Xo, [
|
|
1354
|
+
p.item.ext === "jpg" || p.item.ext === "png" ? (i(), d("div", ea, [
|
|
1355
1355
|
l("div", {
|
|
1356
1356
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1357
1357
|
onClick: f[0] || (f[0] = (y) => v(p.index))
|
|
1358
1358
|
}, [
|
|
1359
1359
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1360
1360
|
])
|
|
1361
|
-
])) : a(p.item) ? (i(), d("div",
|
|
1361
|
+
])) : a(p.item) ? (i(), d("div", ta, [
|
|
1362
1362
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1363
|
-
])) :
|
|
1363
|
+
])) : n(p.item) ? (i(), d("div", la, [
|
|
1364
1364
|
l("a", {
|
|
1365
1365
|
href: `/api/file-preview?id=${p.item.file_id}`,
|
|
1366
1366
|
target: "_blank",
|
|
1367
1367
|
class: "flex gap-x-3 w-full items-center"
|
|
1368
1368
|
}, [
|
|
1369
1369
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1370
|
-
], 8,
|
|
1371
|
-
])) : (i(), d("div",
|
|
1370
|
+
], 8, oa)
|
|
1371
|
+
])) : (i(), d("div", aa, [
|
|
1372
1372
|
I(He, { item: p.item }, null, 8, ["item"])
|
|
1373
1373
|
])),
|
|
1374
|
-
l("div",
|
|
1375
|
-
l("div",
|
|
1374
|
+
l("div", sa, [
|
|
1375
|
+
l("div", na, [
|
|
1376
1376
|
l("div", ra, [
|
|
1377
1377
|
l("button", {
|
|
1378
1378
|
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",
|
|
@@ -1385,13 +1385,13 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1385
1385
|
])
|
|
1386
1386
|
]),
|
|
1387
1387
|
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",
|
|
1388
|
+
l("div", ia, [
|
|
1389
1389
|
l("button", {
|
|
1390
1390
|
type: "button",
|
|
1391
1391
|
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",
|
|
1392
1392
|
onClick: f[2] || (f[2] = (y) => c())
|
|
1393
1393
|
}, [
|
|
1394
|
-
I(
|
|
1394
|
+
I(Je, {
|
|
1395
1395
|
height: "14",
|
|
1396
1396
|
width: "14"
|
|
1397
1397
|
})
|
|
@@ -1401,7 +1401,7 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1401
1401
|
])
|
|
1402
1402
|
]));
|
|
1403
1403
|
}
|
|
1404
|
-
}),
|
|
1404
|
+
}), da = {}, ca = {
|
|
1405
1405
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1406
1406
|
width: "24",
|
|
1407
1407
|
height: "24",
|
|
@@ -1413,8 +1413,8 @@ const $t = /* @__PURE__ */ N(Oo, [["render", To]]), Ro = { class: "h-[120px] w-[
|
|
|
1413
1413
|
"stroke-linejoin": "round",
|
|
1414
1414
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1415
1415
|
};
|
|
1416
|
-
function
|
|
1417
|
-
return i(), d("svg",
|
|
1416
|
+
function pa(o, e) {
|
|
1417
|
+
return i(), d("svg", ca, e[0] || (e[0] = [
|
|
1418
1418
|
l("path", {
|
|
1419
1419
|
stroke: "none",
|
|
1420
1420
|
d: "M0 0h24v24H0z",
|
|
@@ -1425,13 +1425,13 @@ function ca(o, e) {
|
|
|
1425
1425
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
1426
1426
|
]));
|
|
1427
1427
|
}
|
|
1428
|
-
const
|
|
1428
|
+
const fa = /* @__PURE__ */ N(da, [["render", pa]]), va = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, ma = { class: "flex w-full mb-[12px] items-center gap-x-2" }, ha = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, ga = { class1: "ml-auto" }, ba = { 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" }, ya = {
|
|
1429
1429
|
key: 0,
|
|
1430
1430
|
class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
|
|
1431
|
-
},
|
|
1431
|
+
}, xa = { class: "relative" }, wa = {
|
|
1432
1432
|
key: 1,
|
|
1433
1433
|
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
|
-
},
|
|
1434
|
+
}, ka = { key: 0 }, _a = /* @__PURE__ */ O({
|
|
1435
1435
|
__name: "vs-input-file-list",
|
|
1436
1436
|
props: {
|
|
1437
1437
|
id: { default: "" },
|
|
@@ -1446,9 +1446,9 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1446
1446
|
},
|
|
1447
1447
|
emits: ["update"],
|
|
1448
1448
|
setup(o, { emit: e }) {
|
|
1449
|
-
const t = o,
|
|
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))), U = (x) => {
|
|
1450
1450
|
const b = y.value.findIndex((z) => z === x.item.file_path);
|
|
1451
|
-
b !== -1 && (
|
|
1451
|
+
b !== -1 && (n.value = !0, s.value = b);
|
|
1452
1452
|
}, E = async () => {
|
|
1453
1453
|
try {
|
|
1454
1454
|
const x = await fetch(`${t.prefix}/widget/file/${a.value}`).then((b) => b.json());
|
|
@@ -1462,14 +1462,14 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1462
1462
|
const z = new FormData();
|
|
1463
1463
|
z.append("file", b);
|
|
1464
1464
|
try {
|
|
1465
|
-
const W = `${t.prefix}/widget/file/${a.value}`,
|
|
1466
|
-
return
|
|
1467
|
-
type:
|
|
1465
|
+
const W = `${t.prefix}/widget/file/${a.value}`, C = await fetch(W, { method: "POST", body: z });
|
|
1466
|
+
return C.ok ? (u("update", "file-list"), b) : (ne({
|
|
1467
|
+
type: C.status >= 400 && C.status < 500 ? "warning" : "error",
|
|
1468
1468
|
title: "Error",
|
|
1469
|
-
message: `Error code: ${
|
|
1469
|
+
message: `Error code: ${C.status}`
|
|
1470
1470
|
}), null);
|
|
1471
1471
|
} catch (W) {
|
|
1472
|
-
return
|
|
1472
|
+
return ne({
|
|
1473
1473
|
type: "error",
|
|
1474
1474
|
title: "Error",
|
|
1475
1475
|
message: W.message || "Unknown error"
|
|
@@ -1477,34 +1477,34 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1477
1477
|
}
|
|
1478
1478
|
})
|
|
1479
1479
|
), await E();
|
|
1480
|
-
},
|
|
1480
|
+
}, V = (x) => {
|
|
1481
1481
|
const b = { ...x };
|
|
1482
1482
|
return x.cancel || (b.cancel = () => {
|
|
1483
1483
|
c.value = !1;
|
|
1484
1484
|
}), x.updateListOnConfirm && (b.confirm = async () => {
|
|
1485
1485
|
await x.confirm(), c.value = !1, E();
|
|
1486
1486
|
}), b;
|
|
1487
|
-
},
|
|
1488
|
-
v.value =
|
|
1487
|
+
}, M = (x) => {
|
|
1488
|
+
v.value = V(x), c.value = !0;
|
|
1489
1489
|
};
|
|
1490
1490
|
return le(a, (x) => {
|
|
1491
1491
|
x && E();
|
|
1492
1492
|
}), be(() => {
|
|
1493
1493
|
a.value && E();
|
|
1494
1494
|
}), (x, b) => {
|
|
1495
|
-
const z =
|
|
1496
|
-
return i(), d("div",
|
|
1497
|
-
l("div",
|
|
1498
|
-
l("h2",
|
|
1499
|
-
l("div",
|
|
1495
|
+
const z = nt("Lightbox"), W = nt("MessageBox");
|
|
1496
|
+
return i(), d("div", va, [
|
|
1497
|
+
l("div", ma, [
|
|
1498
|
+
l("h2", ha, " Файлів: " + P(p.value?.length), 1),
|
|
1499
|
+
l("div", ga, [
|
|
1500
1500
|
l("label", null, [
|
|
1501
1501
|
l("input", {
|
|
1502
1502
|
type: "file",
|
|
1503
1503
|
class: "hidden",
|
|
1504
|
-
onChange: b[0] || (b[0] = (
|
|
1504
|
+
onChange: b[0] || (b[0] = (C) => T(C))
|
|
1505
1505
|
}, null, 32),
|
|
1506
|
-
l("div",
|
|
1507
|
-
I(
|
|
1506
|
+
l("div", ba, [
|
|
1507
|
+
I(fa, {
|
|
1508
1508
|
height: "16",
|
|
1509
1509
|
width: "16"
|
|
1510
1510
|
})
|
|
@@ -1512,9 +1512,9 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1512
1512
|
])
|
|
1513
1513
|
])
|
|
1514
1514
|
]),
|
|
1515
|
-
p.value?.length > 4 ? (i(), d("div",
|
|
1515
|
+
p.value?.length > 4 ? (i(), d("div", ya, [
|
|
1516
1516
|
l("div", null, [
|
|
1517
|
-
l("div",
|
|
1517
|
+
l("div", xa, [
|
|
1518
1518
|
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
1519
|
l("svg", {
|
|
1520
1520
|
class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
|
|
@@ -1538,7 +1538,7 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1538
1538
|
], -1)),
|
|
1539
1539
|
K(l("input", {
|
|
1540
1540
|
type: "text",
|
|
1541
|
-
"onUpdate:modelValue": b[1] || (b[1] = (
|
|
1541
|
+
"onUpdate:modelValue": b[1] || (b[1] = (C) => f.value = C),
|
|
1542
1542
|
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
1543
|
placeholder: "Введіть назву файлу"
|
|
1544
1544
|
}, null, 512), [
|
|
@@ -1552,36 +1552,36 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1552
1552
|
])
|
|
1553
1553
|
])
|
|
1554
1554
|
])) : F("", !0),
|
|
1555
|
-
p.value?.length ? (i(), d("div",
|
|
1556
|
-
(i(!0), d(ee, null, ae(_.value, (
|
|
1555
|
+
p.value?.length ? (i(), d("div", wa, [
|
|
1556
|
+
(i(!0), d(ee, null, ae(_.value, (C, se) => (i(), re(ua, {
|
|
1557
1557
|
key: se,
|
|
1558
1558
|
prefix: x.prefix,
|
|
1559
|
-
item:
|
|
1559
|
+
item: C,
|
|
1560
1560
|
index: se,
|
|
1561
1561
|
onUpdate: b[2] || (b[2] = (ue) => x.$emit("update", "file-list")),
|
|
1562
|
-
onOpenModal: b[3] || (b[3] = (ue) =>
|
|
1562
|
+
onOpenModal: b[3] || (b[3] = (ue) => M(ue)),
|
|
1563
1563
|
onOpenLightbox: b[4] || (b[4] = (ue) => U(ue))
|
|
1564
1564
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1565
|
-
_.value.length ? F("", !0) : (i(), d("div",
|
|
1565
|
+
_.value.length ? F("", !0) : (i(), d("div", ka, b[9] || (b[9] = [
|
|
1566
1566
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1567
1567
|
])))
|
|
1568
1568
|
])) : F("", !0),
|
|
1569
1569
|
I(z, {
|
|
1570
|
-
modelValue:
|
|
1571
|
-
"onUpdate:modelValue": b[5] || (b[5] = (
|
|
1570
|
+
modelValue: n.value,
|
|
1571
|
+
"onUpdate:modelValue": b[5] || (b[5] = (C) => n.value = C),
|
|
1572
1572
|
startIndex: s.value,
|
|
1573
|
-
"onUpdate:index": b[6] || (b[6] = (
|
|
1573
|
+
"onUpdate:index": b[6] || (b[6] = (C) => s.value = C),
|
|
1574
1574
|
images: y.value
|
|
1575
1575
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1576
|
-
I(W,
|
|
1576
|
+
I(W, Ie({
|
|
1577
1577
|
modelValue: c.value,
|
|
1578
|
-
"onUpdate:modelValue": b[7] || (b[7] = (
|
|
1578
|
+
"onUpdate:modelValue": b[7] || (b[7] = (C) => c.value = C),
|
|
1579
1579
|
onConfirm: v.value.confirm
|
|
1580
1580
|
}, v.value), null, 16, ["modelValue", "onConfirm"])
|
|
1581
1581
|
]);
|
|
1582
1582
|
};
|
|
1583
1583
|
}
|
|
1584
|
-
}),
|
|
1584
|
+
}), $a = { class: "flex items-center justify-between" }, Ca = { class: "text-[16px] text-gray-900 font-medium" }, Va = { class: "grid gap-3" }, Ma = /* @__PURE__ */ O({
|
|
1585
1585
|
__name: "vs-container-switcher",
|
|
1586
1586
|
props: {
|
|
1587
1587
|
title: {
|
|
@@ -1601,31 +1601,31 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1601
1601
|
const e = o, t = w(e.isOpen);
|
|
1602
1602
|
return le(
|
|
1603
1603
|
() => e.isOpen,
|
|
1604
|
-
(
|
|
1605
|
-
t.value =
|
|
1604
|
+
(r) => {
|
|
1605
|
+
t.value = r;
|
|
1606
1606
|
}
|
|
1607
|
-
), (
|
|
1608
|
-
l("div",
|
|
1609
|
-
l("p",
|
|
1607
|
+
), (r, a) => (i(), d("div", null, [
|
|
1608
|
+
l("div", $a, [
|
|
1609
|
+
l("p", Ca, P(o.title), 1),
|
|
1610
1610
|
I(kt, {
|
|
1611
1611
|
modelValue: t.value,
|
|
1612
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
1612
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => t.value = n),
|
|
1613
1613
|
style: we(o.style)
|
|
1614
1614
|
}, null, 8, ["modelValue", "style"])
|
|
1615
1615
|
]),
|
|
1616
1616
|
I(bt, { name: "slide-fade" }, {
|
|
1617
1617
|
default: Be(() => [
|
|
1618
|
-
K(l("div",
|
|
1619
|
-
Ce(
|
|
1618
|
+
K(l("div", Va, [
|
|
1619
|
+
Ce(r.$slots, "default", {}, void 0, !0)
|
|
1620
1620
|
], 512), [
|
|
1621
|
-
[
|
|
1621
|
+
[Ge, t.value]
|
|
1622
1622
|
])
|
|
1623
1623
|
]),
|
|
1624
1624
|
_: 3
|
|
1625
1625
|
})
|
|
1626
1626
|
]));
|
|
1627
1627
|
}
|
|
1628
|
-
}),
|
|
1628
|
+
}), La = /* @__PURE__ */ N(Ma, [["__scopeId", "data-v-90320b87"]]), Sa = { class: "text-[16px] text-gray-900 font-medium" }, Ba = { class: "grid gap-3" }, ja = /* @__PURE__ */ O({
|
|
1629
1629
|
__name: "vs-container-accordion",
|
|
1630
1630
|
props: {
|
|
1631
1631
|
title: {
|
|
@@ -1645,33 +1645,33 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1645
1645
|
const e = o, t = w(e.isOpen);
|
|
1646
1646
|
return le(
|
|
1647
1647
|
() => e.isOpen,
|
|
1648
|
-
(
|
|
1649
|
-
t.value =
|
|
1648
|
+
(r) => {
|
|
1649
|
+
t.value = r;
|
|
1650
1650
|
}
|
|
1651
|
-
), (
|
|
1651
|
+
), (r, a) => (i(), d("div", null, [
|
|
1652
1652
|
l("button", {
|
|
1653
1653
|
type: "button",
|
|
1654
|
-
onClick: a[0] || (a[0] = (
|
|
1654
|
+
onClick: a[0] || (a[0] = (n) => t.value = !t.value),
|
|
1655
1655
|
class: "flex items-center gap-2"
|
|
1656
1656
|
}, [
|
|
1657
|
-
I(J(
|
|
1658
|
-
class:
|
|
1657
|
+
I(J(El), {
|
|
1658
|
+
class: B(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1659
1659
|
}, null, 8, ["class"]),
|
|
1660
|
-
l("span",
|
|
1660
|
+
l("span", Sa, P(o.title), 1)
|
|
1661
1661
|
]),
|
|
1662
1662
|
I(bt, { name: "slide-fade" }, {
|
|
1663
1663
|
default: Be(() => [
|
|
1664
|
-
K(l("div",
|
|
1665
|
-
Ce(
|
|
1664
|
+
K(l("div", Ba, [
|
|
1665
|
+
Ce(r.$slots, "default", {}, void 0, !0)
|
|
1666
1666
|
], 512), [
|
|
1667
|
-
[
|
|
1667
|
+
[Ge, t.value]
|
|
1668
1668
|
])
|
|
1669
1669
|
]),
|
|
1670
1670
|
_: 3
|
|
1671
1671
|
})
|
|
1672
1672
|
]));
|
|
1673
1673
|
}
|
|
1674
|
-
}),
|
|
1674
|
+
}), Ia = /* @__PURE__ */ N(ja, [["__scopeId", "data-v-590eff11"]]), Ea = { class: "flex items-center justify-between" }, za = /* @__PURE__ */ O({
|
|
1675
1675
|
__name: "vs-container-default",
|
|
1676
1676
|
props: {
|
|
1677
1677
|
title: {
|
|
@@ -1685,16 +1685,16 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1685
1685
|
},
|
|
1686
1686
|
setup(o) {
|
|
1687
1687
|
return (e, t) => (i(), d("div", null, [
|
|
1688
|
-
l("div",
|
|
1688
|
+
l("div", Ea, [
|
|
1689
1689
|
l("p", null, P(o.title), 1)
|
|
1690
1690
|
]),
|
|
1691
1691
|
Ce(e.$slots, "default")
|
|
1692
1692
|
]));
|
|
1693
1693
|
}
|
|
1694
|
-
}),
|
|
1695
|
-
switcher:
|
|
1696
|
-
accordion:
|
|
1697
|
-
default:
|
|
1694
|
+
}), Fa = {
|
|
1695
|
+
switcher: La,
|
|
1696
|
+
accordion: Ia,
|
|
1697
|
+
default: za
|
|
1698
1698
|
}, fe = {
|
|
1699
1699
|
Equal: "==",
|
|
1700
1700
|
Inequal: "!=",
|
|
@@ -1708,37 +1708,37 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1708
1708
|
Contain: "*",
|
|
1709
1709
|
In: "in",
|
|
1710
1710
|
NotIn: "not_in"
|
|
1711
|
-
},
|
|
1711
|
+
}, Aa = (o, e) => String(o) === String(e), Da = (o, e) => String(o) !== String(e), Oa = (o, e) => o > e, Ua = (o, e) => o >= e, Ta = (o, e) => o < e, Ra = (o, e) => o <= e, Pa = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, Ha = (o, e) => String(o).startsWith(String(e)), Na = (o, e) => String(o).endsWith(String(e)), qa = (o, e) => String(o).includes(String(e)), Ga = (o, e) => Array.isArray(e) ? e.includes(o) : !1, Ja = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, Ct = (o, e) => {
|
|
1712
1712
|
if (!e) return !0;
|
|
1713
1713
|
switch (e?.[1]) {
|
|
1714
1714
|
case fe.Equal:
|
|
1715
|
-
return Fa(o, e?.[2]);
|
|
1716
|
-
case fe.Inequal:
|
|
1717
1715
|
return Aa(o, e?.[2]);
|
|
1718
|
-
case fe.
|
|
1716
|
+
case fe.Inequal:
|
|
1719
1717
|
return Da(o, e?.[2]);
|
|
1720
|
-
case fe.
|
|
1718
|
+
case fe.Higer:
|
|
1721
1719
|
return Oa(o, e?.[2]);
|
|
1722
|
-
case fe.
|
|
1720
|
+
case fe.HigerOrEqual:
|
|
1723
1721
|
return Ua(o, e?.[2]);
|
|
1724
|
-
case fe.
|
|
1722
|
+
case fe.Lower:
|
|
1725
1723
|
return Ta(o, e?.[2]);
|
|
1726
|
-
case fe.
|
|
1724
|
+
case fe.LowerOrEqual:
|
|
1727
1725
|
return Ra(o, e?.[2]);
|
|
1728
|
-
case fe.
|
|
1726
|
+
case fe.Between:
|
|
1729
1727
|
return Pa(o, e?.[2]);
|
|
1730
|
-
case fe.
|
|
1728
|
+
case fe.StartWith:
|
|
1731
1729
|
return Ha(o, e?.[2]);
|
|
1732
|
-
case fe.
|
|
1730
|
+
case fe.EndWith:
|
|
1733
1731
|
return Na(o, e?.[2]);
|
|
1734
|
-
case fe.
|
|
1732
|
+
case fe.Contain:
|
|
1735
1733
|
return qa(o, e?.[2]);
|
|
1736
|
-
case fe.
|
|
1734
|
+
case fe.In:
|
|
1737
1735
|
return Ga(o, e?.[2]);
|
|
1736
|
+
case fe.NotIn:
|
|
1737
|
+
return Ja(o, e?.[2]);
|
|
1738
1738
|
default:
|
|
1739
1739
|
return !0;
|
|
1740
1740
|
}
|
|
1741
|
-
},
|
|
1741
|
+
}, Wa = /* @__PURE__ */ O({
|
|
1742
1742
|
__name: "vs-input-container",
|
|
1743
1743
|
props: {
|
|
1744
1744
|
style: {
|
|
@@ -1759,38 +1759,38 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1759
1759
|
}
|
|
1760
1760
|
},
|
|
1761
1761
|
setup(o) {
|
|
1762
|
-
const e = o, t = Se("formValues", { default: {} }),
|
|
1762
|
+
const e = o, t = Se("formValues", { default: {} }), r = Se("form"), a = D(() => e.schema?.filter((s) => {
|
|
1763
1763
|
const u = s?.conditions;
|
|
1764
1764
|
if (!u) return !0;
|
|
1765
1765
|
const c = Array.isArray(u) ? u[0] : u, v = t?.value?.[c];
|
|
1766
1766
|
return Ct(v, u);
|
|
1767
|
-
})),
|
|
1768
|
-
return (s, u) => o.schema?.length ? (i(),
|
|
1767
|
+
})), n = D(() => Fa[e.view]);
|
|
1768
|
+
return (s, u) => o.schema?.length ? (i(), re(Ee(n.value), {
|
|
1769
1769
|
key: 0,
|
|
1770
1770
|
title: o.title,
|
|
1771
1771
|
style: we(o.style)
|
|
1772
1772
|
}, {
|
|
1773
1773
|
default: Be(() => [
|
|
1774
|
-
(i(!0), d(ee, null, ae(a.value, (c) => (i(),
|
|
1774
|
+
(i(!0), d(ee, null, ae(a.value, (c) => (i(), re(Vt, Ie({
|
|
1775
1775
|
key: c.name
|
|
1776
1776
|
}, { ref_for: !0 }, c, {
|
|
1777
1777
|
item: c,
|
|
1778
1778
|
modelValue: J(t)[c.name],
|
|
1779
1779
|
"onUpdate:modelValue": (v) => J(t)[c.name] = v,
|
|
1780
1780
|
style: o.style,
|
|
1781
|
-
error: J(
|
|
1781
|
+
error: J(r)?.errors?.[c.name]
|
|
1782
1782
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
1783
1783
|
]),
|
|
1784
1784
|
_: 1
|
|
1785
1785
|
}, 8, ["title", "style"])) : F("", !0);
|
|
1786
1786
|
}
|
|
1787
|
-
}),
|
|
1787
|
+
}), Ka = ["aria-expanded", "data-focus"], Za = { class: "flex items-center" }, Ya = ["title"], Qa = ["onClick"], Xa = ["title"], es = {
|
|
1788
1788
|
key: 2,
|
|
1789
1789
|
class: "text-gray-500 truncate"
|
|
1790
|
-
},
|
|
1790
|
+
}, ts = { class: "flex-1 min-w-[2px]" }, ls = ["placeholder"], os = { class: "flex items-center shrink-0" }, as = ["disabled"], ss = ["disabled", "title"], ns = ["aria-disabled", "onClick"], rs = {
|
|
1791
1791
|
key: 1,
|
|
1792
1792
|
class: "px-3 py-2 text-center text-gray-500"
|
|
1793
|
-
},
|
|
1793
|
+
}, is = ["disabled"], pt = /* @__PURE__ */ O({
|
|
1794
1794
|
__name: "vs-input-select",
|
|
1795
1795
|
props: {
|
|
1796
1796
|
multiple: { type: Boolean, default: !1 },
|
|
@@ -1815,82 +1815,82 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1815
1815
|
},
|
|
1816
1816
|
emits: ["change", "update:modelValue"],
|
|
1817
1817
|
setup(o, { emit: e }) {
|
|
1818
|
-
const t = o,
|
|
1818
|
+
const t = o, r = e, a = D(() => t.multiple), n = D(() => t.disabled);
|
|
1819
1819
|
ye(t.style);
|
|
1820
1820
|
const s = D({
|
|
1821
1821
|
get: () => t.modelValue,
|
|
1822
|
-
set: (h) =>
|
|
1822
|
+
set: (h) => r("update:modelValue", h)
|
|
1823
1823
|
});
|
|
1824
1824
|
!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), U = w([]), E = w(-1), T = w([]),
|
|
1825
|
+
const u = w(null), c = w(null), v = w(null), p = w(null), f = w(!1), y = w(!1), _ = w(null), U = w([]), E = w(-1), T = w([]), V = w(""), M = w(null), x = w("bottom"), b = w({}), z = w([]), W = D(() => {
|
|
1826
1826
|
if (!z.value.length) return [];
|
|
1827
1827
|
const h = new Map(U.value.map((m) => [m.id?.toString(), m]));
|
|
1828
1828
|
return z.value.map((m) => h.get(m?.toString())).filter((m) => !!m);
|
|
1829
|
-
}),
|
|
1829
|
+
}), C = D(() => t.placeholder || "Select..."), se = D(() => a.value ? !z.value.length && V.value === "" : !_.value?.text && V.value === ""), ue = D(() => n.value ? !1 : a.value ? z.value.length > 0 : !!s.value), de = (h) => a.value ? z.value.some((m) => m?.toString() === h?.toString()) : s.value?.toString() === h?.toString(), te = D(() => {
|
|
1830
1830
|
let h = U.value ?? [];
|
|
1831
|
-
if (!t.data &&
|
|
1832
|
-
const m =
|
|
1833
|
-
h = h.filter((
|
|
1831
|
+
if (!t.data && V.value.trim() !== "") {
|
|
1832
|
+
const m = V.value.toLowerCase();
|
|
1833
|
+
h = h.filter(($) => $.text?.toLowerCase?.().includes(m));
|
|
1834
1834
|
}
|
|
1835
1835
|
if (a.value && z.value.length) {
|
|
1836
|
-
const m = new Set(z.value.map((
|
|
1837
|
-
h = h.filter((
|
|
1836
|
+
const m = new Set(z.value.map(($) => $?.toString()));
|
|
1837
|
+
h = h.filter(($) => !m.has($.id?.toString()));
|
|
1838
1838
|
}
|
|
1839
1839
|
return h;
|
|
1840
1840
|
}), ze = Se("values"), ke = D(() => t.parent ? ze?.value?.[t.parent] ?? null : null), A = async (h) => {
|
|
1841
1841
|
if (!t.data) {
|
|
1842
1842
|
let m = t.options ?? [];
|
|
1843
1843
|
if (h?.trim()) {
|
|
1844
|
-
const
|
|
1845
|
-
m = m.filter((H) => H.text?.toLowerCase?.().includes(
|
|
1844
|
+
const $ = h.toLowerCase();
|
|
1845
|
+
m = m.filter((H) => H.text?.toLowerCase?.().includes($));
|
|
1846
1846
|
}
|
|
1847
1847
|
return m;
|
|
1848
1848
|
}
|
|
1849
1849
|
try {
|
|
1850
|
-
const m = t.host ?? "",
|
|
1850
|
+
const m = t.host ?? "", $ = t.prefix ?? "api", H = t.api ?? `/${$}/suggest/${t.data}`, oe = `${m}${H}`, he = new URLSearchParams();
|
|
1851
1851
|
return he.set("json", "1"), h && he.set("key", h), ke.value !== void 0 && ke.value !== null && ke.value !== "" && he.set("parent", String(ke.value)), (await fetch(`${oe}?${he.toString()}`).then((je) => je.json()))?.data ?? [];
|
|
1852
1852
|
} catch {
|
|
1853
1853
|
return [];
|
|
1854
1854
|
}
|
|
1855
1855
|
}, j = async () => {
|
|
1856
|
-
t.data ? U.value = await A(
|
|
1857
|
-
},
|
|
1856
|
+
t.data ? U.value = await A(V.value) : U.value = t.options ? [...t.options] : [];
|
|
1857
|
+
}, S = async (h) => {
|
|
1858
1858
|
if (h == null) return null;
|
|
1859
1859
|
const m = U.value?.find((H) => H?.id?.toString() === String(h));
|
|
1860
1860
|
return m || ((await A(String(h)))?.[0] ?? null);
|
|
1861
1861
|
}, G = async (h) => {
|
|
1862
|
-
const m = new Set(U.value.map((H) => H.id?.toString())),
|
|
1863
|
-
|
|
1862
|
+
const m = new Set(U.value.map((H) => H.id?.toString())), $ = h.filter((H) => !m.has(H?.toString()));
|
|
1863
|
+
$.length && await $.reduce(async (H, oe) => {
|
|
1864
1864
|
await H;
|
|
1865
|
-
const he = await
|
|
1865
|
+
const he = await S(oe);
|
|
1866
1866
|
he && U.value.push(he);
|
|
1867
1867
|
}, Promise.resolve());
|
|
1868
1868
|
}, Z = async () => {
|
|
1869
|
-
|
|
1870
|
-
xe(),
|
|
1869
|
+
n.value || (f.value = !0, await j(), await De(() => {
|
|
1870
|
+
xe(), M.value?.focus(), te.value.length ? E.value = 0 : E.value = -1;
|
|
1871
1871
|
}));
|
|
1872
|
-
},
|
|
1872
|
+
}, ce = () => {
|
|
1873
1873
|
f.value = !1, E.value = -1;
|
|
1874
1874
|
}, _e = async (h) => {
|
|
1875
|
-
if (
|
|
1876
|
-
!f.value ? await Z() :
|
|
1875
|
+
if (n.value) return;
|
|
1876
|
+
!f.value ? await Z() : ce();
|
|
1877
1877
|
}, g = async () => {
|
|
1878
|
-
f.value ?
|
|
1878
|
+
f.value ? M.value?.focus() : await Z();
|
|
1879
1879
|
}, k = () => {
|
|
1880
|
-
a.value ? (z.value = [], s.value = [],
|
|
1880
|
+
a.value ? (z.value = [], s.value = [], r("change", [])) : (_.value = null, s.value = null, r("change", null)), V.value = "", De(() => M.value?.focus());
|
|
1881
1881
|
}, R = (h) => {
|
|
1882
|
-
a.value && (z.value = z.value.filter((m) => m?.toString() !== h?.toString()), s.value = [...z.value],
|
|
1882
|
+
a.value && (z.value = z.value.filter((m) => m?.toString() !== h?.toString()), s.value = [...z.value], r("change", s.value), De(() => M.value?.focus()));
|
|
1883
1883
|
}, q = (h) => {
|
|
1884
|
-
a.value ? (
|
|
1885
|
-
|
|
1886
|
-
})) : (_.value = h, s.value = h.id,
|
|
1884
|
+
a.value ? (de(h.id) || (z.value = [...z.value, h.id], s.value = [...z.value], r("change", s.value)), V.value = "", De(() => {
|
|
1885
|
+
M.value?.focus(), E.value = Math.min(E.value, te.value.length - 1);
|
|
1886
|
+
})) : (_.value = h, s.value = h.id, r("change", s.value), V.value = "", ce());
|
|
1887
1887
|
}, Y = (h) => {
|
|
1888
|
-
|
|
1888
|
+
de(h.id) || q(h);
|
|
1889
1889
|
}, me = (h, m) => {
|
|
1890
1890
|
if (!h || !m) return;
|
|
1891
|
-
const
|
|
1891
|
+
const $ = h.offsetTop, H = $ + h.offsetHeight, oe = m.scrollTop, he = oe + m.clientHeight;
|
|
1892
1892
|
let Le = m.scrollTop;
|
|
1893
|
-
|
|
1893
|
+
$ < oe ? Le = $ - 80 : H > he && (Le = H - m.clientHeight + 4);
|
|
1894
1894
|
const je = m;
|
|
1895
1895
|
je.scrollTop = Le;
|
|
1896
1896
|
}, $e = (h) => {
|
|
@@ -1898,7 +1898,7 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1898
1898
|
for (; m; ) {
|
|
1899
1899
|
if (m.classList.contains("ui-dialog__content"))
|
|
1900
1900
|
return m;
|
|
1901
|
-
const
|
|
1901
|
+
const $ = window.getComputedStyle(m), H = $.overflow + $.overflowY + $.overflowX;
|
|
1902
1902
|
if (H.includes("auto") || H.includes("scroll") || m === document.body || m === document.documentElement)
|
|
1903
1903
|
return m;
|
|
1904
1904
|
m = m.parentElement;
|
|
@@ -1906,26 +1906,26 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1906
1906
|
return document.body;
|
|
1907
1907
|
}, xe = () => {
|
|
1908
1908
|
if (!c.value) return;
|
|
1909
|
-
const h = c.value.getBoundingClientRect(), m = window.innerHeight || document.documentElement.clientHeight,
|
|
1910
|
-
let
|
|
1911
|
-
|
|
1912
|
-
let
|
|
1913
|
-
|
|
1909
|
+
const h = c.value.getBoundingClientRect(), m = window.innerHeight || document.documentElement.clientHeight, $ = window.innerWidth || document.documentElement.clientWidth, H = 8, oe = 8, he = t.maxHeight || 300, Le = m - h.bottom - oe - H, je = h.top - oe - H, Pe = Le >= je, Ke = Math.max($ - H * 2, 0);
|
|
1910
|
+
let { width: Fe } = h;
|
|
1911
|
+
Ke > 0 && Fe > Ke && (Fe = Ke);
|
|
1912
|
+
let { left: Ae } = h;
|
|
1913
|
+
Ae + Fe + H > $ && (Ae = $ - Fe - H), Ae = Math.max(Ae, H);
|
|
1914
1914
|
const zt = Math.min(
|
|
1915
1915
|
he,
|
|
1916
1916
|
Math.max(Pe ? Le : je, 50)
|
|
1917
1917
|
);
|
|
1918
1918
|
x.value = Pe ? "bottom" : "top", b.value = {
|
|
1919
1919
|
position: "fixed",
|
|
1920
|
-
left: `${
|
|
1921
|
-
width: `${
|
|
1922
|
-
minWidth:
|
|
1920
|
+
left: `${Ae}px`,
|
|
1921
|
+
width: `${Fe}px`,
|
|
1922
|
+
minWidth: "300px",
|
|
1923
1923
|
maxHeight: `${zt}px`,
|
|
1924
1924
|
transform: Pe ? "none" : "translateY(-100%)",
|
|
1925
1925
|
top: Pe ? `${h.bottom + oe}px` : `${h.top - oe}px`
|
|
1926
1926
|
};
|
|
1927
1927
|
}, Ve = async (h) => {
|
|
1928
|
-
|
|
1928
|
+
n.value || !f.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await Z());
|
|
1929
1929
|
}, Me = (h) => {
|
|
1930
1930
|
if (!f.value) return;
|
|
1931
1931
|
const { key: m } = h;
|
|
@@ -1935,18 +1935,18 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1935
1935
|
h.preventDefault(), E.value > 0 && (E.value -= 1, me(T.value[E.value], v.value));
|
|
1936
1936
|
else if (m === "Enter") {
|
|
1937
1937
|
h.preventDefault();
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
} else m === "Escape" ? (h.preventDefault(),
|
|
1938
|
+
const $ = te.value[E.value];
|
|
1939
|
+
$ && q($), M.value?.blur();
|
|
1940
|
+
} else m === "Escape" ? (h.preventDefault(), ce()) : m === "Backspace" ? a.value && V.value === "" && z.value.length && (z.value = z.value.slice(0, -1), s.value = [...z.value], r("change", s.value)) : m === "Home" ? (E.value = 0, me(T.value[0], v.value)) : m === "End" ? (E.value = te.value.length - 1, me(T.value[E.value], v.value)) : m === "Tab" && ce();
|
|
1941
1941
|
}, Lt = () => {
|
|
1942
|
-
|
|
1942
|
+
n.value || (y.value = !0);
|
|
1943
1943
|
}, St = () => {
|
|
1944
|
-
y.value = !1,
|
|
1944
|
+
y.value = !1, V.value = "";
|
|
1945
1945
|
}, Qe = (h) => {
|
|
1946
|
-
h.key === "Escape" && f.value &&
|
|
1946
|
+
h.key === "Escape" && f.value && ce();
|
|
1947
1947
|
}, Xe = (h) => {
|
|
1948
1948
|
const m = h.target;
|
|
1949
|
-
u.value?.contains(m) || p.value?.contains(m) ||
|
|
1949
|
+
u.value?.contains(m) || p.value?.contains(m) || ce();
|
|
1950
1950
|
}, et = (h) => {
|
|
1951
1951
|
f.value && v.value && !v.value.contains(h.target) && xe();
|
|
1952
1952
|
}, tt = () => {
|
|
@@ -1965,7 +1965,7 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1965
1965
|
const h = s.value[0] ?? null;
|
|
1966
1966
|
s.value = h ?? null;
|
|
1967
1967
|
}
|
|
1968
|
-
_.value = await
|
|
1968
|
+
_.value = await S(s.value);
|
|
1969
1969
|
}
|
|
1970
1970
|
};
|
|
1971
1971
|
le(s, () => {
|
|
@@ -1975,20 +1975,20 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1975
1975
|
}), qe(() => {
|
|
1976
1976
|
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
1977
|
});
|
|
1978
|
-
const Re = w(!1),
|
|
1978
|
+
const Re = w(!1), We = w({}), at = w([]), st = w(null);
|
|
1979
1979
|
async function Bt() {
|
|
1980
1980
|
if (!t.add?.token || st?.value.validate())
|
|
1981
1981
|
return;
|
|
1982
|
-
const m = t.add.api ?? `/api/table/${t.add.token}`, { id:
|
|
1982
|
+
const m = t.add.api ?? `/api/table/${t.add.token}`, { id: $ } = await fetch(m, {
|
|
1983
1983
|
method: "POST",
|
|
1984
1984
|
headers: { "Content-Type": "application/json" },
|
|
1985
|
-
body: JSON.stringify(
|
|
1985
|
+
body: JSON.stringify(We.value)
|
|
1986
1986
|
}).then((H) => H.json());
|
|
1987
1987
|
if (!t.options?.length && t.data) {
|
|
1988
|
-
const { data: H } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${
|
|
1989
|
-
_.value = H[0], U.value.push(H[0]), s.value =
|
|
1988
|
+
const { data: H } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${$}`).then((oe) => oe.json());
|
|
1989
|
+
_.value = H[0], U.value.push(H[0]), s.value = $;
|
|
1990
1990
|
}
|
|
1991
|
-
Re.value = !1,
|
|
1991
|
+
Re.value = !1, ne({ title: "Success!", message: "Object created." });
|
|
1992
1992
|
}
|
|
1993
1993
|
async function jt() {
|
|
1994
1994
|
if (!t.add) return null;
|
|
@@ -1996,26 +1996,26 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
1996
1996
|
return at.value = h.schema, Re.value = !0, null;
|
|
1997
1997
|
}
|
|
1998
1998
|
function It(h, m = 200) {
|
|
1999
|
-
let
|
|
1999
|
+
let $;
|
|
2000
2000
|
return (...H) => {
|
|
2001
|
-
|
|
2001
|
+
$ && clearTimeout($), $ = window.setTimeout(() => h(...H), m);
|
|
2002
2002
|
};
|
|
2003
2003
|
}
|
|
2004
2004
|
const Et = It(async (h) => {
|
|
2005
2005
|
U.value = await A(h);
|
|
2006
2006
|
}, 200);
|
|
2007
|
-
return le(
|
|
2007
|
+
return le(V, (h) => {
|
|
2008
2008
|
t.data && Et(h.trim());
|
|
2009
2009
|
}), le(() => t.options, (h) => {
|
|
2010
2010
|
!t.data && h?.length && (U.value = [...h]);
|
|
2011
2011
|
}, { immediate: !0 }), le(() => t.parent ?? t.parentValue, () => {
|
|
2012
2012
|
t.data && j();
|
|
2013
2013
|
}), le(ke, async () => {
|
|
2014
|
-
t.data && (a.value ? (z.value = [], s.value = [],
|
|
2014
|
+
t.data && (a.value ? (z.value = [], s.value = [], r("change", [])) : (_.value = null, s.value = null, r("change", null)));
|
|
2015
2015
|
}), (h, m) => (i(), d(ee, null, [
|
|
2016
2016
|
I(J(xt), {
|
|
2017
2017
|
visible: Re.value,
|
|
2018
|
-
"onUpdate:visible": m[1] || (m[1] = (
|
|
2018
|
+
"onUpdate:visible": m[1] || (m[1] = ($) => Re.value = $),
|
|
2019
2019
|
title: "Додати",
|
|
2020
2020
|
buttonText: "Додати",
|
|
2021
2021
|
onDone: Bt
|
|
@@ -2023,8 +2023,8 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2023
2023
|
default: Be(() => [
|
|
2024
2024
|
I(Te, {
|
|
2025
2025
|
schema: at.value,
|
|
2026
|
-
modelValue:
|
|
2027
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
2026
|
+
modelValue: We.value,
|
|
2027
|
+
"onUpdate:modelValue": m[0] || (m[0] = ($) => We.value = $),
|
|
2028
2028
|
ref_key: "addForm",
|
|
2029
2029
|
ref: st
|
|
2030
2030
|
}, null, 8, ["schema", "modelValue"])
|
|
@@ -2039,7 +2039,7 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2039
2039
|
}, ["stop"]))
|
|
2040
2040
|
}, [
|
|
2041
2041
|
l("div", {
|
|
2042
|
-
class:
|
|
2042
|
+
class: B(["relative w-full font-sans", t.customClass])
|
|
2043
2043
|
}, [
|
|
2044
2044
|
m[9] || (m[9] = l("span", {
|
|
2045
2045
|
id: "react-select-live-region",
|
|
@@ -2053,11 +2053,11 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2053
2053
|
class: "sr-only"
|
|
2054
2054
|
}, null, -1)),
|
|
2055
2055
|
l("div", {
|
|
2056
|
-
class:
|
|
2056
|
+
class: B([
|
|
2057
2057
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
2058
2058
|
"border-gray-300 hover:border-gray-400",
|
|
2059
2059
|
f.value || y.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
2060
|
-
|
|
2060
|
+
n.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
2061
2061
|
]),
|
|
2062
2062
|
role: "combobox",
|
|
2063
2063
|
"aria-expanded": f.value,
|
|
@@ -2071,25 +2071,25 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2071
2071
|
ref_key: "triggerRef",
|
|
2072
2072
|
ref: c
|
|
2073
2073
|
}, [
|
|
2074
|
-
a.value && z.value.length ? (i(!0), d(ee, { key: 0 }, ae(W.value, (
|
|
2074
|
+
a.value && z.value.length ? (i(!0), d(ee, { key: 0 }, ae(W.value, ($) => (i(), d("div", {
|
|
2075
2075
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2076
|
-
key:
|
|
2076
|
+
key: $.id
|
|
2077
2077
|
}, [
|
|
2078
|
-
l("div",
|
|
2079
|
-
|
|
2078
|
+
l("div", Za, [
|
|
2079
|
+
$?.color ? (i(), d("span", {
|
|
2080
2080
|
key: 0,
|
|
2081
2081
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2082
|
-
style: we({ backgroundColor:
|
|
2082
|
+
style: we({ backgroundColor: $?.color })
|
|
2083
2083
|
}, null, 4)) : F("", !0),
|
|
2084
2084
|
l("div", {
|
|
2085
2085
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2086
|
-
title:
|
|
2087
|
-
}, P(
|
|
2086
|
+
title: $.text
|
|
2087
|
+
}, P($.text), 9, Ya)
|
|
2088
2088
|
]),
|
|
2089
2089
|
l("div", {
|
|
2090
2090
|
role: "button",
|
|
2091
2091
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2092
|
-
onClick: ge((H) => R(
|
|
2092
|
+
onClick: ge((H) => R($.id), ["stop"])
|
|
2093
2093
|
}, m[5] || (m[5] = [
|
|
2094
2094
|
l("svg", {
|
|
2095
2095
|
height: "14",
|
|
@@ -2101,10 +2101,10 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2101
2101
|
}, [
|
|
2102
2102
|
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
2103
|
], -1)
|
|
2104
|
-
]), 8,
|
|
2105
|
-
]))), 128)) : !a.value && !y.value && _.value?.text &&
|
|
2104
|
+
]), 8, Qa)
|
|
2105
|
+
]))), 128)) : !a.value && !y.value && _.value?.text && V.value === "" ? (i(), d("div", {
|
|
2106
2106
|
key: 1,
|
|
2107
|
-
class:
|
|
2107
|
+
class: B(["truncate text-gray-900"]),
|
|
2108
2108
|
title: _.value.text
|
|
2109
2109
|
}, [
|
|
2110
2110
|
_.value?.color ? (i(), d("span", {
|
|
@@ -2113,15 +2113,15 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2113
2113
|
style: we({ backgroundColor: _.value?.color })
|
|
2114
2114
|
}, null, 4)) : F("", !0),
|
|
2115
2115
|
l("span", {
|
|
2116
|
-
class:
|
|
2116
|
+
class: B({ "pl-5": _.value?.color })
|
|
2117
2117
|
}, P(_.value.text), 3)
|
|
2118
|
-
], 8,
|
|
2119
|
-
se.value ? (i(), d("div",
|
|
2120
|
-
l("div",
|
|
2121
|
-
!
|
|
2118
|
+
], 8, Xa)) : F("", !0),
|
|
2119
|
+
se.value ? (i(), d("div", es, P(C.value), 1)) : F("", !0),
|
|
2120
|
+
l("div", ts, [
|
|
2121
|
+
!n.value && h.search ? K((i(), d("input", {
|
|
2122
2122
|
key: 0,
|
|
2123
2123
|
ref_key: "inputRef",
|
|
2124
|
-
ref:
|
|
2124
|
+
ref: M,
|
|
2125
2125
|
class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
|
|
2126
2126
|
autocapitalize: "none",
|
|
2127
2127
|
autocomplete: "off",
|
|
@@ -2130,23 +2130,23 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2130
2130
|
type: "text",
|
|
2131
2131
|
tabindex: "0",
|
|
2132
2132
|
"aria-autocomplete": "list",
|
|
2133
|
-
placeholder: (a.value && z.value.length ? " " : null) || (y.value && !
|
|
2134
|
-
"onUpdate:modelValue": m[2] || (m[2] = (
|
|
2133
|
+
placeholder: (a.value && z.value.length ? " " : null) || (y.value && !V.value?.length ? _.value?.text : " "),
|
|
2134
|
+
"onUpdate:modelValue": m[2] || (m[2] = ($) => V.value = $),
|
|
2135
2135
|
onFocus: Lt,
|
|
2136
2136
|
onBlur: St,
|
|
2137
2137
|
onKeydown: Me
|
|
2138
|
-
}, null, 40,
|
|
2139
|
-
[ie,
|
|
2138
|
+
}, null, 40, ls)), [
|
|
2139
|
+
[ie, V.value]
|
|
2140
2140
|
]) : F("", !0)
|
|
2141
2141
|
])
|
|
2142
2142
|
], 512),
|
|
2143
|
-
l("div",
|
|
2143
|
+
l("div", os, [
|
|
2144
2144
|
ue.value ? (i(), d("button", {
|
|
2145
2145
|
key: 0,
|
|
2146
2146
|
type: "button",
|
|
2147
2147
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2148
2148
|
"aria-hidden": "true",
|
|
2149
|
-
disabled:
|
|
2149
|
+
disabled: n.value,
|
|
2150
2150
|
onClick: ge(k, ["stop"])
|
|
2151
2151
|
}, m[6] || (m[6] = [
|
|
2152
2152
|
l("svg", {
|
|
@@ -2157,14 +2157,14 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2157
2157
|
}, [
|
|
2158
2158
|
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
2159
|
], -1)
|
|
2160
|
-
]), 8,
|
|
2160
|
+
]), 8, as)) : F("", !0),
|
|
2161
2161
|
m[8] || (m[8] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
|
|
2162
2162
|
l("button", {
|
|
2163
2163
|
type: "button",
|
|
2164
2164
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2165
2165
|
"aria-hidden": "true",
|
|
2166
|
-
disabled:
|
|
2167
|
-
onClick: m[3] || (m[3] = ge((
|
|
2166
|
+
disabled: n.value,
|
|
2167
|
+
onClick: m[3] || (m[3] = ge(($) => _e(), ["stop"])),
|
|
2168
2168
|
title: f.value ? "Закрити список" : "Відкрити список"
|
|
2169
2169
|
}, m[7] || (m[7] = [
|
|
2170
2170
|
l("svg", {
|
|
@@ -2175,15 +2175,15 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2175
2175
|
}, [
|
|
2176
2176
|
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
2177
|
], -1)
|
|
2178
|
-
]), 8,
|
|
2178
|
+
]), 8, ss)
|
|
2179
2179
|
])
|
|
2180
|
-
], 42,
|
|
2181
|
-
(i(),
|
|
2180
|
+
], 42, Ka),
|
|
2181
|
+
(i(), re(yt, { to: "body" }, [
|
|
2182
2182
|
f.value ? (i(), d("div", {
|
|
2183
2183
|
key: 0,
|
|
2184
2184
|
ref_key: "dropdownRef",
|
|
2185
2185
|
ref: p,
|
|
2186
|
-
class:
|
|
2186
|
+
class: B([
|
|
2187
2187
|
"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
2188
|
]),
|
|
2189
2189
|
style: we(b.value),
|
|
@@ -2195,34 +2195,34 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2195
2195
|
ref_key: "listRef",
|
|
2196
2196
|
ref: v
|
|
2197
2197
|
}, [
|
|
2198
|
-
te.value.length ? (i(!0), d(ee, { key: 0 }, ae(te.value, (
|
|
2199
|
-
key:
|
|
2198
|
+
te.value.length ? (i(!0), d(ee, { key: 0 }, ae(te.value, ($, H) => (i(), d("div", {
|
|
2199
|
+
key: $.id,
|
|
2200
2200
|
ref_for: !0,
|
|
2201
2201
|
ref: (oe) => T.value[H] = oe,
|
|
2202
|
-
class:
|
|
2203
|
-
"flex px-3 py-2 cursor-default select-none text-gray-900
|
|
2204
|
-
|
|
2205
|
-
|
|
2202
|
+
class: B([
|
|
2203
|
+
"flex px-3 py-2 cursor-default select-none text-gray-900 ",
|
|
2204
|
+
de($.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
|
|
2205
|
+
E.value === H && !de($.id) ? "bg-blue-100" : ""
|
|
2206
2206
|
]),
|
|
2207
|
-
"aria-disabled":
|
|
2207
|
+
"aria-disabled": de($.id) ? "true" : "false",
|
|
2208
2208
|
role: "option",
|
|
2209
2209
|
tabindex: "-1",
|
|
2210
|
-
onClick: (oe) => Y(
|
|
2210
|
+
onClick: (oe) => Y($)
|
|
2211
2211
|
}, [
|
|
2212
|
-
|
|
2212
|
+
$?.color ? (i(), d("span", {
|
|
2213
2213
|
key: 0,
|
|
2214
2214
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2215
|
-
style: we({ backgroundColor:
|
|
2215
|
+
style: we({ backgroundColor: $?.color })
|
|
2216
2216
|
}, null, 4)) : F("", !0),
|
|
2217
2217
|
l("div", {
|
|
2218
|
-
class:
|
|
2218
|
+
class: B([
|
|
2219
2219
|
"leading-[19px]",
|
|
2220
|
-
E.value ===
|
|
2220
|
+
E.value === $.id ? "text-white" : "",
|
|
2221
2221
|
// active style like react-select
|
|
2222
2222
|
(E.value === H, "")
|
|
2223
2223
|
])
|
|
2224
|
-
}, P(
|
|
2225
|
-
], 10,
|
|
2224
|
+
}, P($.text), 3)
|
|
2225
|
+
], 10, ns))), 128)) : (i(), d("div", rs, " No options "))
|
|
2226
2226
|
], 4)
|
|
2227
2227
|
], 4)) : F("", !0)
|
|
2228
2228
|
]))
|
|
@@ -2231,7 +2231,7 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2231
2231
|
key: 0,
|
|
2232
2232
|
onClick: jt,
|
|
2233
2233
|
class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
|
|
2234
|
-
disabled:
|
|
2234
|
+
disabled: n.value,
|
|
2235
2235
|
type: "button"
|
|
2236
2236
|
}, [
|
|
2237
2237
|
I(Ue, {
|
|
@@ -2239,11 +2239,11 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2239
2239
|
height: "16"
|
|
2240
2240
|
}),
|
|
2241
2241
|
m[11] || (m[11] = l("span", null, "Додати", -1))
|
|
2242
|
-
], 8,
|
|
2242
|
+
], 8, is)) : F("", !0)
|
|
2243
2243
|
], 512)
|
|
2244
2244
|
], 64));
|
|
2245
2245
|
}
|
|
2246
|
-
}),
|
|
2246
|
+
}), us = ["placeholder", "disabled"], ds = /* @__PURE__ */ O({
|
|
2247
2247
|
__name: "vs-input-textarea",
|
|
2248
2248
|
props: /* @__PURE__ */ Q({
|
|
2249
2249
|
style: { default: () => ({}) },
|
|
@@ -2259,21 +2259,21 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2259
2259
|
}),
|
|
2260
2260
|
emits: ["update:modelValue"],
|
|
2261
2261
|
setup(o) {
|
|
2262
|
-
const e = o, { inputClass: t } = ye(e.style),
|
|
2263
|
-
return (a,
|
|
2264
|
-
"onUpdate:modelValue":
|
|
2262
|
+
const e = o, { inputClass: t } = ye(e.style), r = X(o, "modelValue");
|
|
2263
|
+
return (a, n) => K((i(), d("textarea", {
|
|
2264
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => r.value = s),
|
|
2265
2265
|
placeholder: a.placeholder,
|
|
2266
2266
|
disabled: a.disabled,
|
|
2267
2267
|
row: "2",
|
|
2268
|
-
class:
|
|
2268
|
+
class: B(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [J(t)]]),
|
|
2269
2269
|
style: {
|
|
2270
2270
|
border: "1px solid #CFD9E0"
|
|
2271
2271
|
}
|
|
2272
|
-
}, null, 10,
|
|
2273
|
-
[ie,
|
|
2272
|
+
}, null, 10, us)), [
|
|
2273
|
+
[ie, r.value]
|
|
2274
2274
|
]);
|
|
2275
2275
|
}
|
|
2276
|
-
}),
|
|
2276
|
+
}), cs = {}, ps = {
|
|
2277
2277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2278
2278
|
viewBox: "0 0 24 24",
|
|
2279
2279
|
fill: "none",
|
|
@@ -2283,8 +2283,8 @@ const pa = /* @__PURE__ */ N(ua, [["render", ca]]), fa = { class: "flex flex-col
|
|
|
2283
2283
|
"stroke-linejoin": "round",
|
|
2284
2284
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
2285
2285
|
};
|
|
2286
|
-
function
|
|
2287
|
-
return i(), d("svg",
|
|
2286
|
+
function fs(o, e) {
|
|
2287
|
+
return i(), d("svg", ps, e[0] || (e[0] = [
|
|
2288
2288
|
l("path", {
|
|
2289
2289
|
stroke: "none",
|
|
2290
2290
|
d: "M0 0h24v24H0z",
|
|
@@ -2294,7 +2294,7 @@ function ps(o, e) {
|
|
|
2294
2294
|
l("path", { d: "M21 21l-6 -6" }, null, -1)
|
|
2295
2295
|
]));
|
|
2296
2296
|
}
|
|
2297
|
-
const
|
|
2297
|
+
const vs = /* @__PURE__ */ N(cs, [["render", fs]]), ms = {}, hs = {
|
|
2298
2298
|
class: "flex-shrink-0 mt-0.5 size-3.5",
|
|
2299
2299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2300
2300
|
viewBox: "0 0 24 24",
|
|
@@ -2304,15 +2304,15 @@ const fs = /* @__PURE__ */ N(ds, [["render", ps]]), vs = {}, ms = {
|
|
|
2304
2304
|
"stroke-linecap": "round",
|
|
2305
2305
|
"stroke-linejoin": "round"
|
|
2306
2306
|
};
|
|
2307
|
-
function
|
|
2308
|
-
return i(), d("svg",
|
|
2307
|
+
function gs(o, e) {
|
|
2308
|
+
return i(), d("svg", hs, e[0] || (e[0] = [
|
|
2309
2309
|
l("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
2310
2310
|
l("path", { d: "M7 20V4" }, null, -1),
|
|
2311
2311
|
l("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
|
2312
2312
|
l("path", { d: "M17 4v16" }, null, -1)
|
|
2313
2313
|
]));
|
|
2314
2314
|
}
|
|
2315
|
-
const
|
|
2315
|
+
const bs = /* @__PURE__ */ N(ms, [["render", gs]]), ys = {}, xs = {
|
|
2316
2316
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2317
2317
|
width: "14",
|
|
2318
2318
|
height: "14",
|
|
@@ -2323,8 +2323,8 @@ const gs = /* @__PURE__ */ N(vs, [["render", hs]]), bs = {}, ys = {
|
|
|
2323
2323
|
"stroke-linecap": "round",
|
|
2324
2324
|
"stroke-linejoin": "round"
|
|
2325
2325
|
};
|
|
2326
|
-
function
|
|
2327
|
-
return i(), d("svg",
|
|
2326
|
+
function ws(o, e) {
|
|
2327
|
+
return i(), d("svg", xs, e[0] || (e[0] = [
|
|
2328
2328
|
l("path", {
|
|
2329
2329
|
stroke: "none",
|
|
2330
2330
|
d: "M0 0h24v24H0z",
|
|
@@ -2335,7 +2335,7 @@ function xs(o, e) {
|
|
|
2335
2335
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
2336
2336
|
]));
|
|
2337
2337
|
}
|
|
2338
|
-
const
|
|
2338
|
+
const ks = /* @__PURE__ */ N(ys, [["render", ws]]), _s = {}, $s = {
|
|
2339
2339
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2340
2340
|
viewBox: "0 0 24 24",
|
|
2341
2341
|
fill: "none",
|
|
@@ -2344,8 +2344,8 @@ const ws = /* @__PURE__ */ N(bs, [["render", xs]]), ks = {}, _s = {
|
|
|
2344
2344
|
"stroke-linecap": "round",
|
|
2345
2345
|
"stroke-linejoin": "round"
|
|
2346
2346
|
};
|
|
2347
|
-
function
|
|
2348
|
-
return i(), d("svg",
|
|
2347
|
+
function Cs(o, e) {
|
|
2348
|
+
return i(), d("svg", $s, e[0] || (e[0] = [
|
|
2349
2349
|
l("path", {
|
|
2350
2350
|
stroke: "none",
|
|
2351
2351
|
d: "M0 0h24v24H0z",
|
|
@@ -2356,7 +2356,7 @@ function $s(o, e) {
|
|
|
2356
2356
|
l("path", { d: "M12 4l0 12" }, null, -1)
|
|
2357
2357
|
]));
|
|
2358
2358
|
}
|
|
2359
|
-
const
|
|
2359
|
+
const Vs = /* @__PURE__ */ N(_s, [["render", Cs]]), Ms = {}, Ls = {
|
|
2360
2360
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2361
2361
|
viewBox: "0 0 24 24",
|
|
2362
2362
|
fill: "none",
|
|
@@ -2365,22 +2365,22 @@ const Cs = /* @__PURE__ */ N(ks, [["render", $s]]), Vs = {}, Ms = {
|
|
|
2365
2365
|
"stroke-linecap": "round",
|
|
2366
2366
|
"stroke-linejoin": "round"
|
|
2367
2367
|
};
|
|
2368
|
-
function
|
|
2369
|
-
return i(), d("svg",
|
|
2370
|
-
|
|
2368
|
+
function Ss(o, e) {
|
|
2369
|
+
return i(), d("svg", Ls, e[0] || (e[0] = [
|
|
2370
|
+
pe('<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
2371
|
]));
|
|
2372
2372
|
}
|
|
2373
|
-
const ft = /* @__PURE__ */ N(
|
|
2373
|
+
const ft = /* @__PURE__ */ N(Ms, [["render", Ss]]), Bs = {}, js = {
|
|
2374
2374
|
viewBox: "0 0 178 90",
|
|
2375
2375
|
fill: "none",
|
|
2376
2376
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2377
2377
|
};
|
|
2378
|
-
function
|
|
2379
|
-
return i(), d("svg",
|
|
2380
|
-
|
|
2378
|
+
function Is(o, e) {
|
|
2379
|
+
return i(), d("svg", js, e[0] || (e[0] = [
|
|
2380
|
+
pe('<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
2381
|
]));
|
|
2382
2382
|
}
|
|
2383
|
-
const
|
|
2383
|
+
const Es = /* @__PURE__ */ N(Bs, [["render", Is]]), zs = {}, Fs = {
|
|
2384
2384
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2385
2385
|
viewBox: "0 0 24 24",
|
|
2386
2386
|
fill: "none",
|
|
@@ -2389,25 +2389,25 @@ const Is = /* @__PURE__ */ N(Ss, [["render", js]]), Es = {}, zs = {
|
|
|
2389
2389
|
"stroke-linecap": "round",
|
|
2390
2390
|
"stroke-linejoin": "round"
|
|
2391
2391
|
};
|
|
2392
|
-
function
|
|
2393
|
-
return i(), d("svg",
|
|
2392
|
+
function As(o, e) {
|
|
2393
|
+
return i(), d("svg", Fs, e[0] || (e[0] = [
|
|
2394
2394
|
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
2395
|
]));
|
|
2396
2396
|
}
|
|
2397
|
-
const
|
|
2397
|
+
const Ds = /* @__PURE__ */ N(zs, [["render", As]]), Os = { class: "vs-datatable border rounded-xl w-full flex-grow" }, Us = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, Ts = { class: "relative w-full" }, Rs = { class: "table-wrapper flex gap-2" }, Ps = { class: "vs-popover inline-block text-slate-700" }, Hs = { class: "text-center" }, Ns = { class: "" }, qs = { 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" }, Gs = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, Js = { class: "text-sm items-center text-gray-800 flex gap-1" }, Ws = { class: "w-full overflow-x-auto" }, Ks = { class: "w-full table-auto caption-bottom text-sm" }, Zs = { class: "[&_tr]:border-b" }, Ys = { 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" }, Qs = { 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" }, Xs = {
|
|
2398
2398
|
key: 0,
|
|
2399
2399
|
colspan: "100%",
|
|
2400
2400
|
class: "text-center"
|
|
2401
|
-
},
|
|
2401
|
+
}, en = { class: "w-full" }, tn = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, ln = ["onDragstart", "onDragover", "onDrop"], on = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, an = { class: "flex items-center justify-center" }, sn = {
|
|
2402
2402
|
key: 0,
|
|
2403
2403
|
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
|
-
},
|
|
2404
|
+
}, nn = { key: 0 }, rn = ["src"], un = {
|
|
2405
2405
|
key: 1,
|
|
2406
2406
|
class: "rounded-md max-w-[45px] w-[45px] max-h-[45px] h-[45px] bg-gray-200 flex items-center justify-center"
|
|
2407
|
-
},
|
|
2407
|
+
}, dn = ["innerHTML"], cn = {
|
|
2408
2408
|
key: 2,
|
|
2409
2409
|
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
|
-
},
|
|
2410
|
+
}, pn = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, fn = { class: "flex items-center justify-center gap-2" }, vn = ["onClick"], mn = ["onClick"], hn = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, gn = /* @__PURE__ */ O({
|
|
2411
2411
|
__name: "vs-input-datatable",
|
|
2412
2412
|
props: /* @__PURE__ */ Q({
|
|
2413
2413
|
colModel: {},
|
|
@@ -2424,11 +2424,11 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2424
2424
|
}),
|
|
2425
2425
|
emits: ["update:modelValue"],
|
|
2426
2426
|
setup(o) {
|
|
2427
|
-
const e = o, t = X(o, "modelValue"),
|
|
2427
|
+
const e = o, t = X(o, "modelValue"), r = w({}), a = w(""), n = D(() => {
|
|
2428
2428
|
if (!a.value) return t.value ?? [];
|
|
2429
2429
|
const A = a.value.toLowerCase();
|
|
2430
|
-
return t.value.filter((j) => e.colModel?.some((
|
|
2431
|
-
const G = j[
|
|
2430
|
+
return t.value.filter((j) => e.colModel?.some((S) => {
|
|
2431
|
+
const G = j[S.key];
|
|
2432
2432
|
return G ? Array.isArray(G) ? G.join(", ").toLowerCase().includes(A) : String(G).toLowerCase().includes(A) : !1;
|
|
2433
2433
|
}));
|
|
2434
2434
|
}), s = w(null), u = w(null), c = w(!1), v = w(null), p = w({ top: 0, left: 0 }), f = (A) => {
|
|
@@ -2440,101 +2440,101 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2440
2440
|
s.value = null, u.value = null;
|
|
2441
2441
|
return;
|
|
2442
2442
|
}
|
|
2443
|
-
const j = [...t.value], [
|
|
2444
|
-
j.splice(A, 0,
|
|
2443
|
+
const j = [...t.value], [S] = j.splice(s.value, 1);
|
|
2444
|
+
j.splice(A, 0, S), t.value = j, s.value = null, u.value = null;
|
|
2445
2445
|
}, U = (A) => {
|
|
2446
|
-
const
|
|
2447
|
-
p.value = { top:
|
|
2446
|
+
const S = A.currentTarget.getBoundingClientRect();
|
|
2447
|
+
p.value = { top: S.bottom + window.scrollY, left: S.left + window.scrollX }, c.value = !c.value;
|
|
2448
2448
|
}, E = () => {
|
|
2449
2449
|
v.value && v.value.click();
|
|
2450
2450
|
}, T = (A) => {
|
|
2451
|
-
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"],
|
|
2452
|
-
return j.some((G) =>
|
|
2453
|
-
},
|
|
2454
|
-
const
|
|
2455
|
-
if (!
|
|
2451
|
+
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], S = A.toLowerCase();
|
|
2452
|
+
return j.some((G) => S.endsWith(G));
|
|
2453
|
+
}, V = (A) => {
|
|
2454
|
+
const S = A.target.files?.[0];
|
|
2455
|
+
if (!S) return;
|
|
2456
2456
|
const G = new FileReader();
|
|
2457
2457
|
G.onload = (Z) => {
|
|
2458
2458
|
try {
|
|
2459
|
-
const
|
|
2460
|
-
if (typeof
|
|
2461
|
-
const _e = JSON.parse(
|
|
2459
|
+
const ce = Z.target?.result;
|
|
2460
|
+
if (typeof ce == "string") {
|
|
2461
|
+
const _e = JSON.parse(ce);
|
|
2462
2462
|
Array.isArray(_e) && t.value.push(..._e);
|
|
2463
2463
|
}
|
|
2464
|
-
} catch (
|
|
2465
|
-
console.error("Error parsing file:",
|
|
2464
|
+
} catch (ce) {
|
|
2465
|
+
console.error("Error parsing file:", ce);
|
|
2466
2466
|
}
|
|
2467
|
-
}, G.readAsText(
|
|
2468
|
-
},
|
|
2469
|
-
const A = JSON.stringify(t.value, null, 2), j = new Blob([A], { type: "application/json" }),
|
|
2470
|
-
G.href =
|
|
2467
|
+
}, G.readAsText(S);
|
|
2468
|
+
}, M = () => {
|
|
2469
|
+
const A = JSON.stringify(t.value, null, 2), j = new Blob([A], { type: "application/json" }), S = URL.createObjectURL(j), G = document.createElement("a");
|
|
2470
|
+
G.href = S, G.download = "data.json", G.click(), URL.revokeObjectURL(S);
|
|
2471
2471
|
};
|
|
2472
2472
|
be(async () => {
|
|
2473
2473
|
const A = e.colModel?.filter((j) => j.data);
|
|
2474
2474
|
A?.length && Promise.all(A.map(async (j) => {
|
|
2475
2475
|
const G = await (await fetch(`/api/suggest/${j.data}`)).json();
|
|
2476
|
-
|
|
2476
|
+
r.value[j.key] = G.data;
|
|
2477
2477
|
}));
|
|
2478
2478
|
});
|
|
2479
2479
|
const x = w(""), b = w(!1);
|
|
2480
2480
|
let z = "edit", W = 0;
|
|
2481
|
-
const
|
|
2481
|
+
const C = w({}), se = w({});
|
|
2482
2482
|
async function ue() {
|
|
2483
|
-
x.value = "Додати", b.value = !0, z = "add",
|
|
2483
|
+
x.value = "Додати", b.value = !0, z = "add", C.value = {};
|
|
2484
2484
|
}
|
|
2485
|
-
function
|
|
2486
|
-
const
|
|
2487
|
-
return
|
|
2485
|
+
function de(A, j) {
|
|
2486
|
+
const S = j.key || j.name;
|
|
2487
|
+
return r.value[S] && A[S] ? r.value[S].find((G) => G.id.toString() === A[S].toString())?.text ?? A[S] : A[S] || "-";
|
|
2488
2488
|
}
|
|
2489
2489
|
async function te(A, j) {
|
|
2490
|
-
x.value = "Редагувати", b.value = !0, z = "edit", W = j,
|
|
2490
|
+
x.value = "Редагувати", b.value = !0, z = "edit", W = j, C.value = { ...A };
|
|
2491
2491
|
}
|
|
2492
2492
|
function ze() {
|
|
2493
2493
|
const A = se.value.validate();
|
|
2494
2494
|
if (A) {
|
|
2495
|
-
|
|
2495
|
+
ne({ type: "warning", title: "Помилка валідації", message: Object.entries(A).map(([j, S]) => `${j}: ${S}`).join(`
|
|
2496
2496
|
`) });
|
|
2497
2497
|
return;
|
|
2498
2498
|
}
|
|
2499
|
-
z === "add" ? Array.isArray(t.value) ? t.value = [...t.value,
|
|
2499
|
+
z === "add" ? Array.isArray(t.value) ? t.value = [...t.value, C.value] : t.value = [C.value] : t.value = t.value.map((j, S) => S === W ? C.value : j), b.value = !1;
|
|
2500
2500
|
}
|
|
2501
2501
|
function ke(A) {
|
|
2502
|
-
t.value = t.value.filter((j,
|
|
2502
|
+
t.value = t.value.filter((j, S) => S !== A);
|
|
2503
2503
|
}
|
|
2504
|
-
return (A, j) => (i(), d("div",
|
|
2505
|
-
l("div",
|
|
2506
|
-
l("div",
|
|
2507
|
-
I(
|
|
2504
|
+
return (A, j) => (i(), d("div", Os, [
|
|
2505
|
+
l("div", Us, [
|
|
2506
|
+
l("div", Ts, [
|
|
2507
|
+
I(vs, {
|
|
2508
2508
|
width: "14",
|
|
2509
2509
|
height: "14",
|
|
2510
2510
|
class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
|
|
2511
2511
|
}),
|
|
2512
2512
|
K(l("input", {
|
|
2513
2513
|
type: "text",
|
|
2514
|
-
"onUpdate:modelValue": j[0] || (j[0] = (
|
|
2514
|
+
"onUpdate:modelValue": j[0] || (j[0] = (S) => a.value = S),
|
|
2515
2515
|
placeholder: "Пошук",
|
|
2516
2516
|
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
2517
|
}, null, 512), [
|
|
2518
2518
|
[ie, a.value]
|
|
2519
2519
|
])
|
|
2520
2520
|
]),
|
|
2521
|
-
l("div",
|
|
2521
|
+
l("div", Rs, [
|
|
2522
2522
|
l("input", {
|
|
2523
2523
|
ref_key: "fileInput",
|
|
2524
2524
|
ref: v,
|
|
2525
|
-
onChange:
|
|
2525
|
+
onChange: V,
|
|
2526
2526
|
class: "hidden",
|
|
2527
2527
|
accept: ".json",
|
|
2528
2528
|
type: "file"
|
|
2529
2529
|
}, null, 544),
|
|
2530
|
-
l("div",
|
|
2531
|
-
l("div",
|
|
2532
|
-
l("div",
|
|
2530
|
+
l("div", Ps, [
|
|
2531
|
+
l("div", Hs, [
|
|
2532
|
+
l("div", Ns, [
|
|
2533
2533
|
l("button", {
|
|
2534
2534
|
onClick: U,
|
|
2535
2535
|
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
2536
|
}, [
|
|
2537
|
-
I(
|
|
2537
|
+
I(bs, {
|
|
2538
2538
|
height: "16",
|
|
2539
2539
|
width: "16"
|
|
2540
2540
|
})
|
|
@@ -2543,36 +2543,36 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2543
2543
|
])
|
|
2544
2544
|
])
|
|
2545
2545
|
]),
|
|
2546
|
-
(i(),
|
|
2546
|
+
(i(), re(yt, { to: "body" }, [
|
|
2547
2547
|
c.value ? (i(), d("div", {
|
|
2548
2548
|
key: 0,
|
|
2549
2549
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
2550
2550
|
style: we([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: p.value.top + "px", left: p.value.left + "px" }])
|
|
2551
2551
|
}, [
|
|
2552
|
-
l("div",
|
|
2553
|
-
l("div",
|
|
2552
|
+
l("div", qs, [
|
|
2553
|
+
l("div", Gs, [
|
|
2554
2554
|
l("button", {
|
|
2555
2555
|
onClick: E,
|
|
2556
2556
|
class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2557
2557
|
}, [
|
|
2558
|
-
I(
|
|
2558
|
+
I(ks, {
|
|
2559
2559
|
class: "text-black",
|
|
2560
2560
|
width: "14",
|
|
2561
2561
|
height: "14"
|
|
2562
2562
|
}),
|
|
2563
|
-
j[4] || (j[4] = ve(" Імпортувати "))
|
|
2563
|
+
j[4] || (j[4] = ve(" Імпортувати ", -1))
|
|
2564
2564
|
]),
|
|
2565
2565
|
l("button", {
|
|
2566
|
-
onClick:
|
|
2566
|
+
onClick: M,
|
|
2567
2567
|
class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
|
|
2568
2568
|
}, [
|
|
2569
|
-
l("span",
|
|
2570
|
-
I(
|
|
2569
|
+
l("span", Js, [
|
|
2570
|
+
I(Vs, {
|
|
2571
2571
|
class: "text-black",
|
|
2572
2572
|
width: "14",
|
|
2573
2573
|
height: "14"
|
|
2574
2574
|
}),
|
|
2575
|
-
j[5] || (j[5] = ve(" Експортувати "))
|
|
2575
|
+
j[5] || (j[5] = ve(" Експортувати ", -1))
|
|
2576
2576
|
])
|
|
2577
2577
|
])
|
|
2578
2578
|
])
|
|
@@ -2584,34 +2584,34 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2584
2584
|
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
2585
|
}, [
|
|
2586
2586
|
I(Ue),
|
|
2587
|
-
j[6] || (j[6] = ve(" Додати "))
|
|
2587
|
+
j[6] || (j[6] = ve(" Додати ", -1))
|
|
2588
2588
|
])
|
|
2589
2589
|
]),
|
|
2590
|
-
l("div",
|
|
2591
|
-
l("table",
|
|
2592
|
-
l("thead",
|
|
2593
|
-
l("tr",
|
|
2594
|
-
l("th",
|
|
2590
|
+
l("div", Ws, [
|
|
2591
|
+
l("table", Ks, [
|
|
2592
|
+
l("thead", Zs, [
|
|
2593
|
+
l("tr", Ys, [
|
|
2594
|
+
l("th", Qs, [
|
|
2595
2595
|
I(ft, {
|
|
2596
2596
|
width: "24",
|
|
2597
2597
|
height: "24",
|
|
2598
2598
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2599
2599
|
})
|
|
2600
2600
|
]),
|
|
2601
|
-
(i(!0), d(ee, null, ae(A.colModel, (
|
|
2602
|
-
key:
|
|
2601
|
+
(i(!0), d(ee, null, ae(A.colModel, (S) => (i(), d("th", {
|
|
2602
|
+
key: S.key,
|
|
2603
2603
|
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(
|
|
2604
|
+
}, P(S.ua || S.label), 1))), 128)),
|
|
2605
2605
|
j[7] || (j[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
2606
|
])
|
|
2607
2607
|
]),
|
|
2608
2608
|
l("tbody", {
|
|
2609
|
-
class:
|
|
2609
|
+
class: B({ "[&_tr:last-child]:border-0": !u.value })
|
|
2610
2610
|
}, [
|
|
2611
|
-
|
|
2612
|
-
l("div",
|
|
2613
|
-
l("div",
|
|
2614
|
-
I(
|
|
2611
|
+
n.value.length === 0 ? (i(), d("td", Xs, [
|
|
2612
|
+
l("div", en, [
|
|
2613
|
+
l("div", tn, [
|
|
2614
|
+
I(Es, { class: "w-48 mx-auto" }),
|
|
2615
2615
|
j[8] || (j[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
|
|
2616
2616
|
l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
|
|
2617
2617
|
l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
|
|
@@ -2619,9 +2619,9 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2619
2619
|
])
|
|
2620
2620
|
])
|
|
2621
2621
|
])) : F("", !0),
|
|
2622
|
-
(i(!0), d(ee, null, ae(
|
|
2623
|
-
key:
|
|
2624
|
-
class:
|
|
2622
|
+
(i(!0), d(ee, null, ae(n.value, (S, G) => (i(), d("tr", {
|
|
2623
|
+
key: S.id,
|
|
2624
|
+
class: B(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2625
2625
|
"opacity-50": s.value === G,
|
|
2626
2626
|
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === G
|
|
2627
2627
|
}]),
|
|
@@ -2630,8 +2630,8 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2630
2630
|
onDragover: ge((Z) => y(G), ["prevent"]),
|
|
2631
2631
|
onDrop: (Z) => _(G)
|
|
2632
2632
|
}, [
|
|
2633
|
-
l("td",
|
|
2634
|
-
l("div",
|
|
2633
|
+
l("td", on, [
|
|
2634
|
+
l("div", an, [
|
|
2635
2635
|
I(ft, {
|
|
2636
2636
|
width: "24",
|
|
2637
2637
|
height: "24",
|
|
@@ -2643,48 +2643,48 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2643
2643
|
key: Z.key,
|
|
2644
2644
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2645
2645
|
}, [
|
|
2646
|
-
Z.type === "file" ? (i(), d("div",
|
|
2647
|
-
T(
|
|
2646
|
+
Z.type === "file" ? (i(), d("div", sn, [
|
|
2647
|
+
T(de(S, Z)) ? (i(), d("div", nn, [
|
|
2648
2648
|
l("img", {
|
|
2649
|
-
src:
|
|
2649
|
+
src: de(S, Z),
|
|
2650
2650
|
alt: "alt",
|
|
2651
2651
|
width: "45",
|
|
2652
2652
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
2653
|
-
}, null, 8,
|
|
2654
|
-
])) : (i(), d("div",
|
|
2653
|
+
}, null, 8, rn)
|
|
2654
|
+
])) : (i(), d("div", un, [
|
|
2655
2655
|
I(_t, { class: "w-[25px] min-w-[25px] h-[25px]" })
|
|
2656
2656
|
]))
|
|
2657
2657
|
])) : Z.type === "tiptap-editor" ? (i(), d("div", {
|
|
2658
2658
|
key: 1,
|
|
2659
2659
|
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:
|
|
2661
|
-
}, null, 8,
|
|
2660
|
+
innerHTML: de(S, Z)
|
|
2661
|
+
}, null, 8, dn)) : (i(), d("div", cn, P(de(S, Z)), 1))
|
|
2662
2662
|
]))), 128)),
|
|
2663
|
-
l("td",
|
|
2664
|
-
l("div",
|
|
2663
|
+
l("td", pn, [
|
|
2664
|
+
l("div", fn, [
|
|
2665
2665
|
l("button", {
|
|
2666
|
-
onClick: (Z) => te(
|
|
2666
|
+
onClick: (Z) => te(S, G),
|
|
2667
2667
|
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
2668
|
}, [
|
|
2669
|
-
I(
|
|
2669
|
+
I(Ds, {
|
|
2670
2670
|
width: "24",
|
|
2671
2671
|
height: "24",
|
|
2672
2672
|
class: "w-3 h-3"
|
|
2673
2673
|
})
|
|
2674
|
-
], 8,
|
|
2674
|
+
], 8, vn),
|
|
2675
2675
|
l("button", {
|
|
2676
2676
|
onClick: (Z) => ke(G),
|
|
2677
2677
|
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
2678
|
}, [
|
|
2679
|
-
I(
|
|
2679
|
+
I(Je, {
|
|
2680
2680
|
width: "24",
|
|
2681
2681
|
height: "24",
|
|
2682
2682
|
class: "w-3 h-3"
|
|
2683
2683
|
})
|
|
2684
|
-
], 8,
|
|
2684
|
+
], 8, mn)
|
|
2685
2685
|
])
|
|
2686
2686
|
])
|
|
2687
|
-
], 42,
|
|
2687
|
+
], 42, ln))), 128))
|
|
2688
2688
|
], 2)
|
|
2689
2689
|
])
|
|
2690
2690
|
]),
|
|
@@ -2696,15 +2696,15 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2696
2696
|
default: Be(() => [
|
|
2697
2697
|
I(Te, {
|
|
2698
2698
|
schema: e.colModel,
|
|
2699
|
-
values:
|
|
2700
|
-
"onUpdate:values": j[1] || (j[1] = (
|
|
2699
|
+
values: C.value,
|
|
2700
|
+
"onUpdate:values": j[1] || (j[1] = (S) => C.value = S),
|
|
2701
2701
|
form: se.value,
|
|
2702
|
-
"onUpdate:form": j[2] || (j[2] = (
|
|
2702
|
+
"onUpdate:form": j[2] || (j[2] = (S) => se.value = S)
|
|
2703
2703
|
}, null, 8, ["schema", "values", "form"]),
|
|
2704
|
-
l("div",
|
|
2704
|
+
l("div", hn, [
|
|
2705
2705
|
l("button", {
|
|
2706
2706
|
type: "button",
|
|
2707
|
-
onClick: j[3] || (j[3] = (
|
|
2707
|
+
onClick: j[3] || (j[3] = (S) => b.value = !1),
|
|
2708
2708
|
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
2709
|
}, " Скасувати "),
|
|
2710
2710
|
l("button", {
|
|
@@ -2718,7 +2718,7 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2718
2718
|
}, 8, ["visible", "title"])
|
|
2719
2719
|
]));
|
|
2720
2720
|
}
|
|
2721
|
-
}),
|
|
2721
|
+
}), bn = {
|
|
2722
2722
|
draw: {
|
|
2723
2723
|
toolbar: {
|
|
2724
2724
|
actions: {
|
|
@@ -2826,33 +2826,33 @@ const As = /* @__PURE__ */ N(Es, [["render", Fs]]), Ds = { class: "vs-datatable
|
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
2828
|
};
|
|
2829
|
-
function
|
|
2829
|
+
function Oe(o) {
|
|
2830
2830
|
return o ? o.type === "Polygon" ? {
|
|
2831
2831
|
type: "MultiPolygon",
|
|
2832
2832
|
coordinates: [o.coordinates]
|
|
2833
2833
|
} : o.type === "Feature" ? {
|
|
2834
2834
|
...o,
|
|
2835
|
-
geometry:
|
|
2835
|
+
geometry: Oe(o.geometry)
|
|
2836
2836
|
} : o.type === "FeatureCollection" ? {
|
|
2837
2837
|
...o,
|
|
2838
|
-
features: (o.features || []).map((e) =>
|
|
2838
|
+
features: (o.features || []).map((e) => Oe(e)).filter(Boolean)
|
|
2839
2839
|
} : o : null;
|
|
2840
2840
|
}
|
|
2841
|
-
function
|
|
2842
|
-
return o ? o.type === "FeatureCollection" || o.type === "Feature" ?
|
|
2841
|
+
function yn(o) {
|
|
2842
|
+
return o ? o.type === "FeatureCollection" || o.type === "Feature" ? Oe(o) : o.geom ? {
|
|
2843
2843
|
type: "Feature",
|
|
2844
|
-
geometry:
|
|
2844
|
+
geometry: Oe({
|
|
2845
2845
|
type: o.geom.type,
|
|
2846
2846
|
coordinates: o.geom.coordinates
|
|
2847
2847
|
}),
|
|
2848
2848
|
properties: {}
|
|
2849
2849
|
} : o.type && o.coordinates ? {
|
|
2850
2850
|
type: "Feature",
|
|
2851
|
-
geometry:
|
|
2851
|
+
geometry: Oe(o),
|
|
2852
2852
|
properties: {}
|
|
2853
2853
|
} : null : null;
|
|
2854
2854
|
}
|
|
2855
|
-
const
|
|
2855
|
+
const xn = {}, wn = {
|
|
2856
2856
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2857
2857
|
viewBox: "0 0 24 24",
|
|
2858
2858
|
stroke: "currentColor",
|
|
@@ -2862,8 +2862,8 @@ const br = {}, yr = {
|
|
|
2862
2862
|
"stroke-linejoin": "round",
|
|
2863
2863
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
|
|
2864
2864
|
};
|
|
2865
|
-
function
|
|
2866
|
-
return i(), d("svg",
|
|
2865
|
+
function kn(o, e) {
|
|
2866
|
+
return i(), d("svg", wn, e[0] || (e[0] = [
|
|
2867
2867
|
l("path", {
|
|
2868
2868
|
stroke: "none",
|
|
2869
2869
|
d: "M0 0h24v24H0z",
|
|
@@ -2873,7 +2873,7 @@ function xr(o, e) {
|
|
|
2873
2873
|
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
2874
|
]));
|
|
2875
2875
|
}
|
|
2876
|
-
const
|
|
2876
|
+
const _n = /* @__PURE__ */ N(xn, [["render", kn]]), $n = {}, Cn = {
|
|
2877
2877
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2878
2878
|
viewBox: "0 0 24 24",
|
|
2879
2879
|
fill: "none",
|
|
@@ -2883,8 +2883,8 @@ const wr = /* @__PURE__ */ N(br, [["render", xr]]), kr = {}, _r = {
|
|
|
2883
2883
|
"stroke-linejoin": "round",
|
|
2884
2884
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
2885
2885
|
};
|
|
2886
|
-
function
|
|
2887
|
-
return i(), d("svg",
|
|
2886
|
+
function Vn(o, e) {
|
|
2887
|
+
return i(), d("svg", Cn, e[0] || (e[0] = [
|
|
2888
2888
|
l("path", {
|
|
2889
2889
|
stroke: "none",
|
|
2890
2890
|
d: "M0 0h24v24H0z",
|
|
@@ -2895,7 +2895,7 @@ function $r(o, e) {
|
|
|
2895
2895
|
l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
|
|
2896
2896
|
]));
|
|
2897
2897
|
}
|
|
2898
|
-
const
|
|
2898
|
+
const Mn = /* @__PURE__ */ N($n, [["render", Vn]]), Ln = {}, Sn = {
|
|
2899
2899
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2900
2900
|
viewBox: "0 0 24 24",
|
|
2901
2901
|
fill: "none",
|
|
@@ -2905,12 +2905,12 @@ const Cr = /* @__PURE__ */ N(kr, [["render", $r]]), Vr = {}, Mr = {
|
|
|
2905
2905
|
"stroke-linejoin": "round",
|
|
2906
2906
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
2907
2907
|
};
|
|
2908
|
-
function
|
|
2909
|
-
return i(), d("svg",
|
|
2910
|
-
|
|
2908
|
+
function Bn(o, e) {
|
|
2909
|
+
return i(), d("svg", Sn, e[0] || (e[0] = [
|
|
2910
|
+
pe('<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
2911
|
]));
|
|
2912
2912
|
}
|
|
2913
|
-
const
|
|
2913
|
+
const jn = /* @__PURE__ */ N(Ln, [["render", Bn]]), In = {}, En = {
|
|
2914
2914
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2915
2915
|
viewBox: "0 0 24 24",
|
|
2916
2916
|
fill: "none",
|
|
@@ -2920,12 +2920,12 @@ const Sr = /* @__PURE__ */ N(Vr, [["render", Lr]]), Br = {}, jr = {
|
|
|
2920
2920
|
"stroke-linejoin": "round",
|
|
2921
2921
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
2922
2922
|
};
|
|
2923
|
-
function
|
|
2924
|
-
return i(), d("svg",
|
|
2925
|
-
|
|
2923
|
+
function zn(o, e) {
|
|
2924
|
+
return i(), d("svg", En, e[0] || (e[0] = [
|
|
2925
|
+
pe('<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
2926
|
]));
|
|
2927
2927
|
}
|
|
2928
|
-
const
|
|
2928
|
+
const Fn = /* @__PURE__ */ N(In, [["render", zn]]), An = {}, Dn = {
|
|
2929
2929
|
version: "1.1",
|
|
2930
2930
|
viewBox: "0 0 14 14",
|
|
2931
2931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2933,8 +2933,8 @@ const Er = /* @__PURE__ */ N(Br, [["render", Ir]]), zr = {}, Fr = {
|
|
|
2933
2933
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
2934
2934
|
class: "fullscreen-icon"
|
|
2935
2935
|
};
|
|
2936
|
-
function
|
|
2937
|
-
return i(), d("svg",
|
|
2936
|
+
function On(o, e) {
|
|
2937
|
+
return i(), d("svg", Dn, e[0] || (e[0] = [
|
|
2938
2938
|
l("title", null, null, -1),
|
|
2939
2939
|
l("desc", null, null, -1),
|
|
2940
2940
|
l("defs", null, null, -1),
|
|
@@ -2963,10 +2963,10 @@ function Ar(o, e) {
|
|
|
2963
2963
|
], -1)
|
|
2964
2964
|
]));
|
|
2965
2965
|
}
|
|
2966
|
-
const
|
|
2966
|
+
const Un = /* @__PURE__ */ N(An, [["render", On]]), Tn = { class: "form-geom__search" }, Rn = { class: "map-search__input" }, Pn = { class: "flex flex-nowrap relative" }, Hn = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, Nn = { class: "flex items-center w-full" }, qn = { class: "max-w-[90%] truncate" }, Gn = {
|
|
2967
2967
|
key: 0,
|
|
2968
2968
|
class: "absolute z-[3100] mt-0.5 left-0 right-0"
|
|
2969
|
-
},
|
|
2969
|
+
}, Jn = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, Wn = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, Kn = ["onClick"], Zn = { class: "flex justify-between items-center w-full" }, Yn = { class: "flex items-center" }, Qn = {
|
|
2970
2970
|
key: 0,
|
|
2971
2971
|
class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
|
|
2972
2972
|
width: "24",
|
|
@@ -2977,60 +2977,60 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
2977
2977
|
"stroke-width": "2",
|
|
2978
2978
|
"stroke-linecap": "round",
|
|
2979
2979
|
"stroke-linejoin": "round"
|
|
2980
|
-
},
|
|
2980
|
+
}, Xn = { class: "relative w-full" }, er = { class: "vs-form-text relative bg-white rounded-lg" }, tr = {
|
|
2981
2981
|
key: 1,
|
|
2982
2982
|
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
|
-
},
|
|
2983
|
+
}, lr = { key: 0 }, or = ["onClick"], ar = {
|
|
2984
2984
|
key: 1,
|
|
2985
2985
|
class: "px-3 py-2 text-xs text-gray-500"
|
|
2986
|
-
},
|
|
2986
|
+
}, sr = {
|
|
2987
2987
|
key: 2,
|
|
2988
2988
|
class: "px-3 py-2 text-xs text-gray-400"
|
|
2989
|
-
},
|
|
2989
|
+
}, nr = /* @__PURE__ */ O({
|
|
2990
2990
|
__name: "map-search",
|
|
2991
2991
|
props: {
|
|
2992
2992
|
placeholder: { default: "50, 30" }
|
|
2993
2993
|
},
|
|
2994
2994
|
emits: ["goToCoordinates"],
|
|
2995
2995
|
setup(o, { emit: e }) {
|
|
2996
|
-
const t = e,
|
|
2996
|
+
const t = e, r = w(!1), a = w("coordinates"), n = w(""), s = w([]), u = w(!1), c = w(!1);
|
|
2997
2997
|
let v;
|
|
2998
2998
|
const p = [
|
|
2999
2999
|
{ value: "coordinates", label: "Пошук по кординатам" },
|
|
3000
3000
|
{ value: "atu", label: "АТУ" },
|
|
3001
3001
|
{ value: "address", label: "Адресса" },
|
|
3002
3002
|
{ value: "search_here", label: "Пошук HERE" }
|
|
3003
|
-
], f = D(() => p.find((
|
|
3004
|
-
function y(
|
|
3005
|
-
a.value =
|
|
3003
|
+
], f = D(() => p.find((M) => M.value === a.value)?.label ?? "АТУ");
|
|
3004
|
+
function y(M) {
|
|
3005
|
+
a.value = M.value, r.value = !1, n.value = "", n.value && E();
|
|
3006
3006
|
}
|
|
3007
|
-
function _(
|
|
3008
|
-
|
|
3007
|
+
function _(M) {
|
|
3008
|
+
M.target.closest(".map-search__input") || (r.value = !1);
|
|
3009
3009
|
}
|
|
3010
3010
|
be(() => document.addEventListener("click", _)), qe(() => document.removeEventListener("click", _));
|
|
3011
|
-
async function U(
|
|
3011
|
+
async function U(M) {
|
|
3012
3012
|
let x;
|
|
3013
3013
|
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
3014
|
const b = new URL(x || "");
|
|
3015
|
-
return a.value === "search_here" ? b.searchParams.set("searchtext",
|
|
3015
|
+
return a.value === "search_here" ? b.searchParams.set("searchtext", M) : (a.value === "atu" || a.value === "address") && b.searchParams.set("key", M), b.searchParams.set("limit", "20"), b.searchParams.set("q", M), (await fetch(b.toString())).json();
|
|
3016
3016
|
}
|
|
3017
3017
|
function E() {
|
|
3018
3018
|
if (u.value = !0, c.value = !0, a.value === "coordinates") {
|
|
3019
|
-
const
|
|
3020
|
-
if (
|
|
3021
|
-
const x = parseFloat(
|
|
3019
|
+
const M = n.value.trim().split(",");
|
|
3020
|
+
if (M.length === 2) {
|
|
3021
|
+
const x = parseFloat(M[0]), b = parseFloat(M[1]);
|
|
3022
3022
|
!Number.isNaN(x) && !Number.isNaN(b) && t("goToCoordinates", [x, b]);
|
|
3023
3023
|
}
|
|
3024
3024
|
return;
|
|
3025
3025
|
}
|
|
3026
3026
|
v && window.clearTimeout(v), v = window.setTimeout(async () => {
|
|
3027
|
-
const
|
|
3028
|
-
if (!
|
|
3027
|
+
const M = n.value.trim();
|
|
3028
|
+
if (!M) {
|
|
3029
3029
|
s.value = [], c.value = !1;
|
|
3030
3030
|
return;
|
|
3031
3031
|
}
|
|
3032
3032
|
try {
|
|
3033
|
-
const x = await U(
|
|
3033
|
+
const x = await U(M);
|
|
3034
3034
|
s.value = Array.isArray(x.features) ? x.features : [];
|
|
3035
3035
|
} catch {
|
|
3036
3036
|
s.value = [];
|
|
@@ -3040,22 +3040,22 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3040
3040
|
}, 300);
|
|
3041
3041
|
}
|
|
3042
3042
|
function T() {
|
|
3043
|
-
|
|
3043
|
+
n.value = "", s.value = [], u.value = !1, c.value = !1;
|
|
3044
3044
|
}
|
|
3045
|
-
function M
|
|
3046
|
-
t("goToCoordinates",
|
|
3045
|
+
function V(M) {
|
|
3046
|
+
t("goToCoordinates", M), u.value = !1, c.value = !1, s.value = [];
|
|
3047
3047
|
}
|
|
3048
|
-
return (
|
|
3049
|
-
l("div",
|
|
3050
|
-
l("div",
|
|
3051
|
-
l("div",
|
|
3048
|
+
return (M, x) => (i(), d("div", Tn, [
|
|
3049
|
+
l("div", Rn, [
|
|
3050
|
+
l("div", Pn, [
|
|
3051
|
+
l("div", Hn, [
|
|
3052
3052
|
l("button", {
|
|
3053
3053
|
type: "button",
|
|
3054
|
-
onClick: x[0] || (x[0] = (b) =>
|
|
3054
|
+
onClick: x[0] || (x[0] = (b) => r.value = !r.value),
|
|
3055
3055
|
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
3056
|
}, [
|
|
3057
|
-
l("div",
|
|
3058
|
-
l("span",
|
|
3057
|
+
l("div", Nn, [
|
|
3058
|
+
l("span", qn, P(f.value), 1)
|
|
3059
3059
|
]),
|
|
3060
3060
|
x[3] || (x[3] = l("svg", {
|
|
3061
3061
|
class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
|
|
@@ -3072,29 +3072,29 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3072
3072
|
})
|
|
3073
3073
|
], -1))
|
|
3074
3074
|
]),
|
|
3075
|
-
|
|
3076
|
-
l("div",
|
|
3077
|
-
l("div",
|
|
3075
|
+
r.value ? (i(), d("div", Gn, [
|
|
3076
|
+
l("div", Jn, [
|
|
3077
|
+
l("div", Wn, [
|
|
3078
3078
|
(i(), d(ee, null, ae(p, (b) => l("div", {
|
|
3079
3079
|
onClick: (z) => y(b),
|
|
3080
3080
|
key: b.value,
|
|
3081
3081
|
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
3082
|
}, [
|
|
3083
|
-
l("div",
|
|
3084
|
-
l("div",
|
|
3083
|
+
l("div", Zn, [
|
|
3084
|
+
l("div", Yn, [
|
|
3085
3085
|
l("div", null, P(b.label), 1)
|
|
3086
3086
|
]),
|
|
3087
|
-
b.value === a.value ? (i(), d("svg",
|
|
3087
|
+
b.value === a.value ? (i(), d("svg", Qn, x[4] || (x[4] = [
|
|
3088
3088
|
l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
3089
3089
|
]))) : F("", !0)
|
|
3090
3090
|
])
|
|
3091
|
-
], 8,
|
|
3091
|
+
], 8, Kn)), 64))
|
|
3092
3092
|
])
|
|
3093
3093
|
])
|
|
3094
3094
|
])) : F("", !0)
|
|
3095
3095
|
]),
|
|
3096
|
-
l("div",
|
|
3097
|
-
l("div",
|
|
3096
|
+
l("div", Xn, [
|
|
3097
|
+
l("div", er, [
|
|
3098
3098
|
x[6] || (x[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
|
|
3099
3099
|
l("svg", {
|
|
3100
3100
|
width: "16",
|
|
@@ -3120,15 +3120,15 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3120
3120
|
], -1)),
|
|
3121
3121
|
K(l("input", {
|
|
3122
3122
|
type: "text",
|
|
3123
|
-
"onUpdate:modelValue": x[1] || (x[1] = (b) =>
|
|
3123
|
+
"onUpdate:modelValue": x[1] || (x[1] = (b) => n.value = b),
|
|
3124
3124
|
onInput: E,
|
|
3125
3125
|
onFocus: x[2] || (x[2] = (b) => u.value = !0),
|
|
3126
3126
|
placeholder: "lat, lng ex. 50, 30",
|
|
3127
3127
|
class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
|
|
3128
3128
|
}, null, 544), [
|
|
3129
|
-
[ie,
|
|
3129
|
+
[ie, n.value]
|
|
3130
3130
|
]),
|
|
3131
|
-
|
|
3131
|
+
n.value ? (i(), d("button", {
|
|
3132
3132
|
key: 0,
|
|
3133
3133
|
onClick: T,
|
|
3134
3134
|
class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
|
|
@@ -3150,14 +3150,14 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3150
3150
|
})
|
|
3151
3151
|
], -1)
|
|
3152
3152
|
]))) : F("", !0),
|
|
3153
|
-
u.value && a.value !== "coordinates" ? (i(), d("div",
|
|
3154
|
-
s.value.length ? (i(), d("ul",
|
|
3153
|
+
u.value && a.value !== "coordinates" ? (i(), d("div", tr, [
|
|
3154
|
+
s.value.length ? (i(), d("ul", lr, [
|
|
3155
3155
|
(i(!0), d(ee, null, ae(s.value, (b) => (i(), d("li", {
|
|
3156
3156
|
key: b.properties.place_id,
|
|
3157
|
-
onClick: (z) =>
|
|
3157
|
+
onClick: (z) => V(b),
|
|
3158
3158
|
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",
|
|
3159
|
+
}, P(b.properties.display_name), 9, or))), 128))
|
|
3160
|
+
])) : c.value ? (i(), d("div", ar, "Шукаю…")) : (i(), d("div", sr, "Нічого не знайдено"))
|
|
3161
3161
|
])) : F("", !0)
|
|
3162
3162
|
])
|
|
3163
3163
|
])
|
|
@@ -3165,23 +3165,23 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3165
3165
|
])
|
|
3166
3166
|
]));
|
|
3167
3167
|
}
|
|
3168
|
-
}),
|
|
3168
|
+
}), rr = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, ir = { class: "flex gap-2" }, ur = ["onClick", "title"], dr = ["src"], cr = /* @__PURE__ */ O({
|
|
3169
3169
|
__name: "map-layers",
|
|
3170
3170
|
props: {
|
|
3171
3171
|
basemaps: {}
|
|
3172
3172
|
},
|
|
3173
3173
|
emits: ["onLayerChange"],
|
|
3174
3174
|
setup(o, { emit: e }) {
|
|
3175
|
-
const
|
|
3176
|
-
function
|
|
3177
|
-
a("onLayerChange", s),
|
|
3175
|
+
const r = w(Object.keys(o.basemaps)[0]), a = e;
|
|
3176
|
+
function n(s) {
|
|
3177
|
+
a("onLayerChange", s), r.value = s;
|
|
3178
3178
|
}
|
|
3179
|
-
return (s, u) => (i(), d("div",
|
|
3180
|
-
l("div",
|
|
3179
|
+
return (s, u) => (i(), d("div", rr, [
|
|
3180
|
+
l("div", ir, [
|
|
3181
3181
|
(i(!0), d(ee, null, ae(s.basemaps, (c, v) => (i(), d("div", {
|
|
3182
3182
|
key: v,
|
|
3183
|
-
class:
|
|
3184
|
-
onClick: (p) =>
|
|
3183
|
+
class: B(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": r.value === v }]),
|
|
3184
|
+
onClick: (p) => n(v),
|
|
3185
3185
|
title: c.name || v,
|
|
3186
3186
|
role: "button",
|
|
3187
3187
|
tabindex: "0"
|
|
@@ -3190,21 +3190,21 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3190
3190
|
src: c.preview,
|
|
3191
3191
|
alt: "",
|
|
3192
3192
|
class: "w-14 h-14 object-cover"
|
|
3193
|
-
}, null, 8,
|
|
3194
|
-
], 10,
|
|
3193
|
+
}, null, 8, dr)
|
|
3194
|
+
], 10, ur))), 128))
|
|
3195
3195
|
])
|
|
3196
3196
|
]));
|
|
3197
3197
|
}
|
|
3198
|
-
}),
|
|
3198
|
+
}), pr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, fr = { class: "form-geom__panel flex gap-1 items-start mt-2" }, vr = { class: "flex items-center gap-1" }, mr = ["disabled"], hr = { class: "absolute top-4 right-4 z-[1000]" }, gr = { class: "flex flex-col gap-[2px]" }, br = ["aria-pressed"], yr = ["aria-pressed"], xr = ["aria-pressed"], wr = ["aria-pressed"], kr = { 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
3199
|
key: 0,
|
|
3200
3200
|
class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
|
|
3201
|
-
},
|
|
3201
|
+
}, $r = { class: "mr-auto" }, Cr = { class: "font-bold" }, Vr = { class: "flex items-center" }, Mr = { class: "text-xs mr-2" }, Lr = {
|
|
3202
3202
|
key: 0,
|
|
3203
3203
|
class: "text-xs"
|
|
3204
|
-
},
|
|
3204
|
+
}, Sr = {
|
|
3205
3205
|
key: 1,
|
|
3206
3206
|
class: "text-xs"
|
|
3207
|
-
},
|
|
3207
|
+
}, Br = /* @__PURE__ */ O({
|
|
3208
3208
|
__name: "vs-input-map",
|
|
3209
3209
|
props: {
|
|
3210
3210
|
tools: {},
|
|
@@ -3218,12 +3218,12 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3218
3218
|
},
|
|
3219
3219
|
emits: ["update:modelValue"],
|
|
3220
3220
|
setup(o, { emit: e }) {
|
|
3221
|
-
const t = Ot(),
|
|
3221
|
+
const t = Ot(), r = o, a = e, n = w(null);
|
|
3222
3222
|
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]), U = w(null), E =
|
|
3223
|
+
const v = w(null), p = w(null), f = w(6), y = w(0), _ = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), U = w(null), E = ce();
|
|
3224
3224
|
let T;
|
|
3225
|
-
const
|
|
3226
|
-
function
|
|
3225
|
+
const V = w("topo100");
|
|
3226
|
+
function M(g) {
|
|
3227
3227
|
return g ? g.type === "Polygon" ? {
|
|
3228
3228
|
type: "MultiPolygon",
|
|
3229
3229
|
coordinates: [g.coordinates]
|
|
@@ -3265,7 +3265,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3265
3265
|
};
|
|
3266
3266
|
(g?.features || []).forEach((Y) => R(Y.geometry));
|
|
3267
3267
|
const q = k.length ? { type: "MultiPolygon", coordinates: k } : null;
|
|
3268
|
-
a("update:modelValue", q ?
|
|
3268
|
+
a("update:modelValue", q ? M(q) : null), y.value = u.getLayers().length;
|
|
3269
3269
|
}
|
|
3270
3270
|
function z(g = 30) {
|
|
3271
3271
|
const k = u.getLayers();
|
|
@@ -3276,7 +3276,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3276
3276
|
function W() {
|
|
3277
3277
|
v.value?.click();
|
|
3278
3278
|
}
|
|
3279
|
-
const
|
|
3279
|
+
const C = w("");
|
|
3280
3280
|
function se(g) {
|
|
3281
3281
|
return g instanceof L.Circle ? "Circle" : g instanceof L.Rectangle ? "Rectangle" : g instanceof L.Polygon && !(g instanceof L.Rectangle) ? "Polygon" : g instanceof L.Polyline && !(g instanceof L.Polygon) ? "Polyline" : g instanceof L.Marker ? "Point" : "Feature";
|
|
3282
3282
|
}
|
|
@@ -3294,7 +3294,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3294
3294
|
}
|
|
3295
3295
|
return null;
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3297
|
+
function de(g) {
|
|
3298
3298
|
return g instanceof L.Circle ? g.getLatLng() : g.getBounds ? g.getBounds().getCenter() : g.getLatLng ? g.getLatLng() : s.getCenter();
|
|
3299
3299
|
}
|
|
3300
3300
|
function te() {
|
|
@@ -3303,7 +3303,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3303
3303
|
U.value = null, y.value = 0;
|
|
3304
3304
|
return;
|
|
3305
3305
|
}
|
|
3306
|
-
const k = g[g.length - 1], R = se(k), q =
|
|
3306
|
+
const k = g[g.length - 1], R = se(k), q = de(k), Y = ue(k);
|
|
3307
3307
|
U.value = {
|
|
3308
3308
|
type: R,
|
|
3309
3309
|
center: q,
|
|
@@ -3320,9 +3320,9 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3320
3320
|
g && (u.removeLayer(g), b(), te());
|
|
3321
3321
|
}
|
|
3322
3322
|
be(async () => {
|
|
3323
|
-
await x(), L.drawLocal =
|
|
3323
|
+
await x(), L.drawLocal = bn, s = L.map(n.value, { zoomControl: !1 }).setView(_.value, 10), L.control.zoom({ position: "bottomright" }).addTo(s), V.value = Object.keys(E)[0], T = L.tileLayer(E[V.value].url, { maxZoom: 19, minZoom: 6 }).addTo(s), u = new L.FeatureGroup().addTo(s), s.on(L.Draw.Event.CREATED, (R) => {
|
|
3324
3324
|
const { layer: q } = R;
|
|
3325
|
-
u.clearLayers(), u.addLayer(q), b(), te(), z(),
|
|
3325
|
+
u.clearLayers(), u.addLayer(q), b(), te(), z(), C.value = "";
|
|
3326
3326
|
}), s.on(L.Draw.Event.EDITED, () => {
|
|
3327
3327
|
b(), te(), z();
|
|
3328
3328
|
}), s.on(L.Draw.Event.DELETED, () => {
|
|
@@ -3334,7 +3334,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3334
3334
|
}), s.on("zoomend", () => {
|
|
3335
3335
|
f.value = s.getZoom();
|
|
3336
3336
|
});
|
|
3337
|
-
const k =
|
|
3337
|
+
const k = yn(r.modelValue);
|
|
3338
3338
|
if (k) {
|
|
3339
3339
|
const R = [];
|
|
3340
3340
|
L.geoJSON(k).eachLayer((q) => R.push(q)), R.length && u.addLayer(R[0]), b(), te(), z();
|
|
@@ -3359,14 +3359,14 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3359
3359
|
c = new L.Draw.Rectangle(s);
|
|
3360
3360
|
break;
|
|
3361
3361
|
}
|
|
3362
|
-
c && (c.enable(),
|
|
3362
|
+
c && (c.enable(), C.value = g);
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
3365
|
function j() {
|
|
3366
3366
|
const g = u.toGeoJSON(), k = new Blob([JSON.stringify(g, null, 2)], { type: "application/json" }), R = URL.createObjectURL(k), q = document.createElement("a");
|
|
3367
3367
|
q.href = R, q.download = "data.geojson", q.click(), URL.revokeObjectURL(R);
|
|
3368
3368
|
}
|
|
3369
|
-
function
|
|
3369
|
+
function S(g) {
|
|
3370
3370
|
const k = g.target.files?.[0];
|
|
3371
3371
|
if (!k) return;
|
|
3372
3372
|
const R = new FileReader();
|
|
@@ -3383,17 +3383,17 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3383
3383
|
}, R.readAsText(k);
|
|
3384
3384
|
}
|
|
3385
3385
|
function G(g) {
|
|
3386
|
-
s && (T && s.removeLayer(T), T = L.tileLayer(E[g].url, { maxZoom: 19, minZoom: 6 }).addTo(s),
|
|
3386
|
+
s && (T && s.removeLayer(T), T = L.tileLayer(E[g].url, { maxZoom: 19, minZoom: 6 }).addTo(s), V.value = g);
|
|
3387
3387
|
}
|
|
3388
3388
|
function Z(g) {
|
|
3389
3389
|
const k = L.latLng(g[0], g[1]);
|
|
3390
3390
|
s.setView(k, 13);
|
|
3391
3391
|
}
|
|
3392
3392
|
le(
|
|
3393
|
-
() =>
|
|
3393
|
+
() => r.modelValue,
|
|
3394
3394
|
(g) => {
|
|
3395
3395
|
console.log("update map");
|
|
3396
|
-
const k =
|
|
3396
|
+
const k = M(g);
|
|
3397
3397
|
if (g && k !== g) {
|
|
3398
3398
|
a("update:modelValue", k);
|
|
3399
3399
|
return;
|
|
@@ -3406,7 +3406,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3406
3406
|
}), y.value = u.getLayers().length, te(), z();
|
|
3407
3407
|
}
|
|
3408
3408
|
);
|
|
3409
|
-
function
|
|
3409
|
+
function ce() {
|
|
3410
3410
|
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((g, k) => Object.assign(g, { key: `b${k}`, preview: g.preview || g.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((g, k) => ({ ...g, [k.key]: k }), {}) : {
|
|
3411
3411
|
topo100: {
|
|
3412
3412
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
@@ -3428,17 +3428,17 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3428
3428
|
s.invalidateSize();
|
|
3429
3429
|
}, 50);
|
|
3430
3430
|
}), (g, k) => (i(), d("div", {
|
|
3431
|
-
class:
|
|
3431
|
+
class: B(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: _e.value }])
|
|
3432
3432
|
}, [
|
|
3433
3433
|
l("div", {
|
|
3434
3434
|
ref_key: "mapContainer",
|
|
3435
|
-
ref:
|
|
3435
|
+
ref: n,
|
|
3436
3436
|
class: "w-full h-full"
|
|
3437
3437
|
}, null, 512),
|
|
3438
|
-
l("div",
|
|
3439
|
-
I(
|
|
3440
|
-
l("div",
|
|
3441
|
-
l("div",
|
|
3438
|
+
l("div", pr, [
|
|
3439
|
+
I(nr, { onGoToCoordinates: Z }),
|
|
3440
|
+
l("div", fr, [
|
|
3441
|
+
l("div", vr, [
|
|
3442
3442
|
l("button", {
|
|
3443
3443
|
type: "button",
|
|
3444
3444
|
class: "vs-btn-row",
|
|
@@ -3449,56 +3449,56 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3449
3449
|
class: "vs-btn-row",
|
|
3450
3450
|
onClick: j,
|
|
3451
3451
|
disabled: y.value === 0
|
|
3452
|
-
}, "Export ", 8,
|
|
3452
|
+
}, "Export ", 8, mr)
|
|
3453
3453
|
]),
|
|
3454
3454
|
l("input", {
|
|
3455
3455
|
ref_key: "importRef",
|
|
3456
3456
|
ref: v,
|
|
3457
3457
|
type: "file",
|
|
3458
|
-
onChange:
|
|
3458
|
+
onChange: S,
|
|
3459
3459
|
accept: ".json,.geojson",
|
|
3460
3460
|
class: "hidden"
|
|
3461
3461
|
}, null, 544)
|
|
3462
3462
|
])
|
|
3463
3463
|
]),
|
|
3464
|
-
l("div",
|
|
3465
|
-
l("div",
|
|
3464
|
+
l("div", hr, [
|
|
3465
|
+
l("div", gr, [
|
|
3466
3466
|
l("button", {
|
|
3467
|
-
class:
|
|
3468
|
-
"aria-pressed":
|
|
3467
|
+
class: B(["vs-btn", { "vs-active": C.value === "marker" }]),
|
|
3468
|
+
"aria-pressed": C.value === "marker",
|
|
3469
3469
|
title: "Point (P)",
|
|
3470
3470
|
"aria-label": "Draw point",
|
|
3471
3471
|
onClick: k[0] || (k[0] = (R) => A("marker"))
|
|
3472
3472
|
}, [
|
|
3473
|
-
I(
|
|
3474
|
-
], 10,
|
|
3473
|
+
I(_n)
|
|
3474
|
+
], 10, br),
|
|
3475
3475
|
l("button", {
|
|
3476
|
-
class:
|
|
3477
|
-
"aria-pressed":
|
|
3476
|
+
class: B(["vs-btn", { "vs-active": C.value === "polyline" }]),
|
|
3477
|
+
"aria-pressed": C.value === "polyline",
|
|
3478
3478
|
title: "Line (L)",
|
|
3479
3479
|
"aria-label": "Draw polyline",
|
|
3480
3480
|
onClick: k[1] || (k[1] = (R) => A("polyline"))
|
|
3481
3481
|
}, [
|
|
3482
|
-
I(
|
|
3483
|
-
], 10,
|
|
3482
|
+
I(Mn)
|
|
3483
|
+
], 10, yr),
|
|
3484
3484
|
l("button", {
|
|
3485
|
-
class:
|
|
3486
|
-
"aria-pressed":
|
|
3485
|
+
class: B(["vs-btn", { "vs-active": C.value === "polygon" }]),
|
|
3486
|
+
"aria-pressed": C.value === "polygon",
|
|
3487
3487
|
title: "Polygon (G)",
|
|
3488
3488
|
"aria-label": "Draw polygon",
|
|
3489
3489
|
onClick: k[2] || (k[2] = (R) => A("polygon"))
|
|
3490
3490
|
}, [
|
|
3491
|
-
I(
|
|
3492
|
-
], 10,
|
|
3491
|
+
I(jn)
|
|
3492
|
+
], 10, xr),
|
|
3493
3493
|
l("button", {
|
|
3494
|
-
class:
|
|
3495
|
-
"aria-pressed":
|
|
3494
|
+
class: B(["vs-btn", { "vs-active": C.value === "rectangle" }]),
|
|
3495
|
+
"aria-pressed": C.value === "rectangle",
|
|
3496
3496
|
title: "Rectangle (R)",
|
|
3497
3497
|
"aria-label": "Draw rectangle",
|
|
3498
3498
|
onClick: k[3] || (k[3] = (R) => A("rectangle"))
|
|
3499
3499
|
}, [
|
|
3500
|
-
I(
|
|
3501
|
-
], 10,
|
|
3500
|
+
I(Fn)
|
|
3501
|
+
], 10, wr),
|
|
3502
3502
|
l("button", {
|
|
3503
3503
|
class: "vs-btn mt-5",
|
|
3504
3504
|
onClick: k[4] || (k[4] = (R) => {
|
|
@@ -3507,34 +3507,34 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3507
3507
|
title: "Full Screen",
|
|
3508
3508
|
"aria-label": "Full Screen"
|
|
3509
3509
|
}, [
|
|
3510
|
-
I(
|
|
3510
|
+
I(Un, { style: { width: "12px", height: "12px" } })
|
|
3511
3511
|
])
|
|
3512
3512
|
])
|
|
3513
3513
|
]),
|
|
3514
3514
|
l("div", {
|
|
3515
|
-
class:
|
|
3515
|
+
class: B(["absolute left-4 z-[1000]", U.value ? "bottom-8" : "bottom-4"])
|
|
3516
3516
|
}, [
|
|
3517
|
-
I(
|
|
3517
|
+
I(cr, {
|
|
3518
3518
|
basemaps: J(E),
|
|
3519
3519
|
onOnLayerChange: G
|
|
3520
3520
|
}, null, 8, ["basemaps"])
|
|
3521
3521
|
], 2),
|
|
3522
|
-
l("div",
|
|
3523
|
-
U.value ? (i(), d("div",
|
|
3524
|
-
l("div",
|
|
3525
|
-
k[7] || (k[7] = ve(" Тип: ")),
|
|
3526
|
-
l("span",
|
|
3522
|
+
l("div", kr, [
|
|
3523
|
+
U.value ? (i(), d("div", _r, [
|
|
3524
|
+
l("div", $r, [
|
|
3525
|
+
k[7] || (k[7] = ve(" Тип: ", -1)),
|
|
3526
|
+
l("span", Cr, P(U.value.type), 1)
|
|
3527
3527
|
]),
|
|
3528
|
-
l("div",
|
|
3529
|
-
l("div",
|
|
3530
|
-
k[8] || (k[8] = ve(" Центр: ")),
|
|
3528
|
+
l("div", Vr, [
|
|
3529
|
+
l("div", Mr, [
|
|
3530
|
+
k[8] || (k[8] = ve(" Центр: ", -1)),
|
|
3531
3531
|
l("b", null, P(U.value.center.lat.toFixed(5)) + ", " + P(U.value.center.lng.toFixed(5)), 1)
|
|
3532
3532
|
]),
|
|
3533
|
-
U.value.areaKm2 !== null ? (i(), d("div",
|
|
3534
|
-
k[9] || (k[9] = ve(" Площа: ")),
|
|
3533
|
+
U.value.areaKm2 !== null ? (i(), d("div", Lr, [
|
|
3534
|
+
k[9] || (k[9] = ve(" Площа: ", -1)),
|
|
3535
3535
|
l("b", null, P(U.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3536
|
-
])) : (i(), d("div",
|
|
3537
|
-
ve(" Площа: "),
|
|
3536
|
+
])) : (i(), d("div", Sr, k[10] || (k[10] = [
|
|
3537
|
+
ve(" Площа: ", -1),
|
|
3538
3538
|
l("b", null, "—", -1)
|
|
3539
3539
|
]))),
|
|
3540
3540
|
l("button", {
|
|
@@ -3542,24 +3542,24 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3542
3542
|
title: "Наблизити",
|
|
3543
3543
|
onClick: k[5] || (k[5] = (R) => ze())
|
|
3544
3544
|
}, k[11] || (k[11] = [
|
|
3545
|
-
|
|
3545
|
+
pe('<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
3546
|
])),
|
|
3547
3547
|
l("button", {
|
|
3548
3548
|
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
3549
|
title: "Видалити",
|
|
3550
3550
|
onClick: k[6] || (k[6] = (R) => ke())
|
|
3551
3551
|
}, [
|
|
3552
|
-
I(
|
|
3552
|
+
I(Je, { class: "w-3 h-3" })
|
|
3553
3553
|
])
|
|
3554
3554
|
])
|
|
3555
3555
|
])) : F("", !0)
|
|
3556
3556
|
])
|
|
3557
3557
|
], 2));
|
|
3558
3558
|
}
|
|
3559
|
-
}),
|
|
3559
|
+
}), jr = /* @__PURE__ */ N(Br, [["__scopeId", "data-v-44f47a6f"]]), Ir = ["data-focus"], Er = { class: "flex items-center" }, zr = { 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"], Ar = {
|
|
3560
3560
|
key: 0,
|
|
3561
3561
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3562
|
-
},
|
|
3562
|
+
}, Dr = { class: "flex-1 min-w-[2px]" }, Or = ["placeholder"], Ur = { class: "flex items-center shrink-0" }, Tr = ["disabled"], Rr = /* @__PURE__ */ O({
|
|
3563
3563
|
__name: "vs-input-tag",
|
|
3564
3564
|
props: /* @__PURE__ */ Q({
|
|
3565
3565
|
unique: { type: Boolean, default: !0 },
|
|
@@ -3576,43 +3576,43 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3576
3576
|
}),
|
|
3577
3577
|
emits: /* @__PURE__ */ Q(["update:modelValue"], ["update:modelValue"]),
|
|
3578
3578
|
setup(o, { emit: e }) {
|
|
3579
|
-
const t = o,
|
|
3579
|
+
const t = o, r = e;
|
|
3580
3580
|
ye(t.style);
|
|
3581
|
-
const a = w(null),
|
|
3582
|
-
_.value || await
|
|
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), U = async () => {
|
|
3582
|
+
_.value || await De(() => s.value?.focus());
|
|
3583
3583
|
}, E = (W) => {
|
|
3584
|
-
const
|
|
3585
|
-
|
|
3584
|
+
const C = W.trim();
|
|
3585
|
+
C !== "" && (!v.value || !Array.isArray(v.value) ? v.value = [C] : t.unique ? v.value.includes(C) || (v.value = [...v.value, C]) : v.value = [...v.value, C], c.value = "");
|
|
3586
3586
|
}, T = () => {
|
|
3587
3587
|
const W = c.value;
|
|
3588
3588
|
W.trim() !== "" && E(W), c.value = "";
|
|
3589
|
-
},
|
|
3590
|
-
const
|
|
3591
|
-
|
|
3592
|
-
},
|
|
3593
|
-
|
|
3589
|
+
}, V = (W) => {
|
|
3590
|
+
const C = v.value.slice();
|
|
3591
|
+
C.splice(W, 1), r("update:modelValue", C);
|
|
3592
|
+
}, M = () => {
|
|
3593
|
+
r("update:modelValue", []);
|
|
3594
3594
|
}, x = () => {
|
|
3595
3595
|
_.value || (u.value = !0);
|
|
3596
3596
|
}, b = () => {
|
|
3597
3597
|
u.value = !1;
|
|
3598
3598
|
}, z = (W) => {
|
|
3599
|
-
const { key:
|
|
3600
|
-
|
|
3599
|
+
const { key: C } = W;
|
|
3600
|
+
C === "Enter" ? (W.preventDefault(), T()) : C === "Backspace" && c.value === "" && v.value.length > 0 && V(v.value.length - 1);
|
|
3601
3601
|
};
|
|
3602
|
-
return (W,
|
|
3602
|
+
return (W, C) => (i(), d("div", {
|
|
3603
3603
|
class: "flex gap-1 w-full",
|
|
3604
3604
|
ref_key: "root",
|
|
3605
3605
|
ref: a,
|
|
3606
|
-
onClick:
|
|
3606
|
+
onClick: C[1] || (C[1] = ge(() => {
|
|
3607
3607
|
}, ["stop"]))
|
|
3608
3608
|
}, [
|
|
3609
3609
|
l("div", {
|
|
3610
|
-
class:
|
|
3610
|
+
class: B(["relative w-full font-sans", t.customClass]),
|
|
3611
3611
|
role: "group",
|
|
3612
3612
|
"aria-label": "Tag input"
|
|
3613
3613
|
}, [
|
|
3614
3614
|
l("div", {
|
|
3615
|
-
class:
|
|
3615
|
+
class: B([
|
|
3616
3616
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
3617
3617
|
"border-gray-300 hover:border-gray-400",
|
|
3618
3618
|
u.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
@@ -3624,21 +3624,21 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3624
3624
|
l("div", {
|
|
3625
3625
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3626
3626
|
ref_key: "chipsRef",
|
|
3627
|
-
ref:
|
|
3627
|
+
ref: n
|
|
3628
3628
|
}, [
|
|
3629
3629
|
(i(!0), d(ee, null, ae(v.value, (se, ue) => (i(), d("div", {
|
|
3630
3630
|
key: ue,
|
|
3631
3631
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3632
3632
|
}, [
|
|
3633
|
-
l("div",
|
|
3634
|
-
l("div",
|
|
3633
|
+
l("div", Er, [
|
|
3634
|
+
l("div", zr, P(se), 1)
|
|
3635
3635
|
]),
|
|
3636
3636
|
l("div", {
|
|
3637
3637
|
role: "button",
|
|
3638
3638
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3639
|
-
onClick: ge((
|
|
3639
|
+
onClick: ge((de) => V(ue), ["stop"]),
|
|
3640
3640
|
"aria-label": `Remove ${se}`
|
|
3641
|
-
},
|
|
3641
|
+
}, C[2] || (C[2] = [
|
|
3642
3642
|
l("svg", {
|
|
3643
3643
|
height: "14",
|
|
3644
3644
|
width: "14",
|
|
@@ -3649,10 +3649,10 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3649
3649
|
}, [
|
|
3650
3650
|
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" })
|
|
3651
3651
|
], -1)
|
|
3652
|
-
]), 8,
|
|
3652
|
+
]), 8, Fr)
|
|
3653
3653
|
]))), 128)),
|
|
3654
|
-
f.value ? (i(), d("div",
|
|
3655
|
-
l("div",
|
|
3654
|
+
f.value ? (i(), d("div", Ar, P(p.value), 1)) : F("", !0),
|
|
3655
|
+
l("div", Dr, [
|
|
3656
3656
|
_.value ? F("", !0) : K((i(), d("input", {
|
|
3657
3657
|
key: 0,
|
|
3658
3658
|
ref_key: "inputRef",
|
|
@@ -3665,25 +3665,25 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3665
3665
|
type: "text",
|
|
3666
3666
|
tabindex: "0",
|
|
3667
3667
|
"aria-label": "Add tag",
|
|
3668
|
-
"onUpdate:modelValue":
|
|
3668
|
+
"onUpdate:modelValue": C[0] || (C[0] = (se) => c.value = se),
|
|
3669
3669
|
onFocus: x,
|
|
3670
3670
|
onBlur: b,
|
|
3671
3671
|
onKeydown: z,
|
|
3672
3672
|
placeholder: v.value && v.value.length ? "" : void 0
|
|
3673
|
-
}, null, 40,
|
|
3673
|
+
}, null, 40, Or)), [
|
|
3674
3674
|
[ie, c.value]
|
|
3675
3675
|
])
|
|
3676
3676
|
])
|
|
3677
3677
|
], 512),
|
|
3678
|
-
l("div",
|
|
3678
|
+
l("div", Ur, [
|
|
3679
3679
|
y.value ? (i(), d("button", {
|
|
3680
3680
|
key: 0,
|
|
3681
3681
|
type: "button",
|
|
3682
3682
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3683
3683
|
"aria-label": "Clear all tags",
|
|
3684
3684
|
disabled: _.value,
|
|
3685
|
-
onClick: ge(
|
|
3686
|
-
},
|
|
3685
|
+
onClick: ge(M, ["stop"])
|
|
3686
|
+
}, C[3] || (C[3] = [
|
|
3687
3687
|
l("svg", {
|
|
3688
3688
|
height: "20",
|
|
3689
3689
|
width: "20",
|
|
@@ -3692,13 +3692,13 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3692
3692
|
}, [
|
|
3693
3693
|
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
3694
|
], -1)
|
|
3695
|
-
]), 8,
|
|
3695
|
+
]), 8, Tr)) : F("", !0)
|
|
3696
3696
|
])
|
|
3697
|
-
], 10,
|
|
3697
|
+
], 10, Ir)
|
|
3698
3698
|
], 2)
|
|
3699
3699
|
], 512));
|
|
3700
3700
|
}
|
|
3701
|
-
}),
|
|
3701
|
+
}), Pr = { class: "relative flex gap-1 bg-white w-full" }, Hr = ["disabled", "placeholder"], Nr = /* @__PURE__ */ O({
|
|
3702
3702
|
__name: "vs-input-slug",
|
|
3703
3703
|
props: /* @__PURE__ */ Q({
|
|
3704
3704
|
disabled: { type: Boolean },
|
|
@@ -3710,7 +3710,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3710
3710
|
}),
|
|
3711
3711
|
emits: ["update:modelValue"],
|
|
3712
3712
|
setup(o) {
|
|
3713
|
-
const e = Se("values"), t = o,
|
|
3713
|
+
const e = Se("values"), t = o, r = X(o, "modelValue");
|
|
3714
3714
|
function a(s) {
|
|
3715
3715
|
const u = {
|
|
3716
3716
|
а: "a",
|
|
@@ -3753,33 +3753,33 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3753
3753
|
};
|
|
3754
3754
|
return s.toLowerCase().split("").map((c) => u[c] || c).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
3755
3755
|
}
|
|
3756
|
-
const
|
|
3756
|
+
const n = () => {
|
|
3757
3757
|
const s = e?.value?.[t.parent || ""]?.toString(), u = a(s);
|
|
3758
|
-
|
|
3758
|
+
r.value = u.toString();
|
|
3759
3759
|
};
|
|
3760
|
-
return (s, u) => (i(), d("div",
|
|
3760
|
+
return (s, u) => (i(), d("div", Pr, [
|
|
3761
3761
|
K(l("input", {
|
|
3762
3762
|
ref: "vsText",
|
|
3763
3763
|
disabled: s.disabled,
|
|
3764
3764
|
placeholder: s.placeholder,
|
|
3765
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
3765
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
3766
3766
|
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,
|
|
3768
|
-
[ie,
|
|
3767
|
+
}, null, 8, Hr), [
|
|
3768
|
+
[ie, r.value]
|
|
3769
3769
|
]),
|
|
3770
3770
|
l("button", {
|
|
3771
3771
|
class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
|
|
3772
|
-
onClick:
|
|
3772
|
+
onClick: n
|
|
3773
3773
|
}, " Gen ")
|
|
3774
3774
|
]));
|
|
3775
3775
|
}
|
|
3776
|
-
}),
|
|
3776
|
+
}), qr = /* @__PURE__ */ N(Nr, [["__scopeId", "data-v-b0eba370"]]), Gr = { class: "w-full" }, Jr = {
|
|
3777
3777
|
ref: "sortableContainer",
|
|
3778
3778
|
class: "flex flex-col gap-1"
|
|
3779
|
-
},
|
|
3779
|
+
}, Wr = ["onDragstart", "onDrop"], Kr = { class: "w-1/3" }, Zr = { class: "w-2/3" }, Yr = ["onClick"], Qr = {
|
|
3780
3780
|
key: 0,
|
|
3781
3781
|
class: "text-[14px] text-gray-700"
|
|
3782
|
-
},
|
|
3782
|
+
}, Xr = { class: "mt-2 w-full flex items-center" }, ei = ["disabled"], ti = /* @__PURE__ */ O({
|
|
3783
3783
|
__name: "vs-input-key-value",
|
|
3784
3784
|
props: {
|
|
3785
3785
|
parent: {},
|
|
@@ -3789,13 +3789,13 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3789
3789
|
},
|
|
3790
3790
|
emits: ["update:modelValue"],
|
|
3791
3791
|
setup(o, { emit: e }) {
|
|
3792
|
-
const t = (T) => `${T}-${Math.random().toString(36).substring(2, 15)}`,
|
|
3792
|
+
const t = (T) => `${T}-${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
3793
|
(() => {
|
|
3794
|
-
const T = a.parent &&
|
|
3795
|
-
c.value = Object.entries(T).filter(([
|
|
3794
|
+
const T = a.parent && r?.value?.[a.parent] || a.modelValue || {};
|
|
3795
|
+
c.value = Object.entries(T).filter(([V]) => !u.includes(V)).map(([V, M]) => ({
|
|
3796
3796
|
id: t("key-value-"),
|
|
3797
|
-
key:
|
|
3798
|
-
value:
|
|
3797
|
+
key: V,
|
|
3798
|
+
value: M
|
|
3799
3799
|
}));
|
|
3800
3800
|
})();
|
|
3801
3801
|
function f(T) {
|
|
@@ -3803,71 +3803,71 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3803
3803
|
}
|
|
3804
3804
|
function y(T) {
|
|
3805
3805
|
if (v.value === null || v.value === T) return;
|
|
3806
|
-
const
|
|
3807
|
-
c.value.splice(T, 0,
|
|
3806
|
+
const V = c.value.splice(v.value, 1)[0];
|
|
3807
|
+
c.value.splice(T, 0, V), v.value = null;
|
|
3808
3808
|
}
|
|
3809
3809
|
const _ = D(
|
|
3810
3810
|
() => c.value.some((T) => T.key && !T.value || !T.key && T.value)
|
|
3811
3811
|
), U = () => {
|
|
3812
3812
|
c.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
3813
3813
|
}, E = (T) => {
|
|
3814
|
-
c.value = c.value.filter((
|
|
3814
|
+
c.value = c.value.filter((V) => V.id !== T);
|
|
3815
3815
|
};
|
|
3816
3816
|
return le(
|
|
3817
3817
|
c,
|
|
3818
3818
|
(T) => {
|
|
3819
|
-
const
|
|
3819
|
+
const V = {};
|
|
3820
3820
|
T.forEach((x) => {
|
|
3821
|
-
x.key && x.value !== void 0 && (
|
|
3821
|
+
x.key && x.value !== void 0 && (V[x.key] = x.value);
|
|
3822
3822
|
});
|
|
3823
|
-
const
|
|
3823
|
+
const M = {};
|
|
3824
3824
|
u.length && u.forEach((x) => {
|
|
3825
|
-
|
|
3826
|
-
}),
|
|
3827
|
-
...
|
|
3828
|
-
...
|
|
3829
|
-
}),
|
|
3825
|
+
M[x] = a.parent ? r?.value?.[a.parent]?.[x] : void 0;
|
|
3826
|
+
}), r?.value && a.parent && (r.value[a.parent] = {
|
|
3827
|
+
...M,
|
|
3828
|
+
...V
|
|
3829
|
+
}), n("update:modelValue", V);
|
|
3830
3830
|
},
|
|
3831
3831
|
{ deep: !0 }
|
|
3832
|
-
), (T,
|
|
3833
|
-
l("div",
|
|
3834
|
-
(i(!0), d(ee, null, ae(c.value, (
|
|
3835
|
-
key:
|
|
3836
|
-
class:
|
|
3832
|
+
), (T, V) => (i(), d("div", Gr, [
|
|
3833
|
+
l("div", Jr, [
|
|
3834
|
+
(i(!0), d(ee, null, ae(c.value, (M, x) => (i(), d("div", {
|
|
3835
|
+
key: M.id,
|
|
3836
|
+
class: B(["flex items-center gap-2 w-full", { "opacity-50": v.value === x }]),
|
|
3837
3837
|
draggable: "true",
|
|
3838
3838
|
onDragstart: (b) => f(x),
|
|
3839
|
-
onDragover:
|
|
3839
|
+
onDragover: V[0] || (V[0] = ge(() => {
|
|
3840
3840
|
}, ["prevent"])),
|
|
3841
3841
|
onDrop: (b) => y(x)
|
|
3842
3842
|
}, [
|
|
3843
|
-
|
|
3844
|
-
l("div",
|
|
3843
|
+
V[1] || (V[1] = pe('<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)),
|
|
3844
|
+
l("div", Kr, [
|
|
3845
3845
|
I(Ne, {
|
|
3846
|
-
modelValue:
|
|
3847
|
-
"onUpdate:modelValue": (b) =>
|
|
3846
|
+
modelValue: M.key,
|
|
3847
|
+
"onUpdate:modelValue": (b) => M.key = b,
|
|
3848
3848
|
placeholder: "Ключ"
|
|
3849
3849
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3850
3850
|
]),
|
|
3851
|
-
l("div",
|
|
3851
|
+
l("div", Zr, [
|
|
3852
3852
|
I(Ne, {
|
|
3853
|
-
modelValue:
|
|
3854
|
-
"onUpdate:modelValue": (b) =>
|
|
3853
|
+
modelValue: M.value,
|
|
3854
|
+
"onUpdate:modelValue": (b) => M.value = b,
|
|
3855
3855
|
placeholder: "Значення"
|
|
3856
3856
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
3857
3857
|
]),
|
|
3858
3858
|
l("button", {
|
|
3859
|
-
onClick: (b) => E(
|
|
3859
|
+
onClick: (b) => E(M.id),
|
|
3860
3860
|
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
3861
|
}, [
|
|
3862
|
-
I(J(
|
|
3862
|
+
I(J(Dl), {
|
|
3863
3863
|
height: "16",
|
|
3864
3864
|
width: "16"
|
|
3865
3865
|
})
|
|
3866
|
-
], 8,
|
|
3867
|
-
], 42,
|
|
3866
|
+
], 8, Yr)
|
|
3867
|
+
], 42, Wr))), 128))
|
|
3868
3868
|
], 512),
|
|
3869
|
-
c.value.length ? F("", !0) : (i(), d("span",
|
|
3870
|
-
l("div",
|
|
3869
|
+
c.value.length ? F("", !0) : (i(), d("span", Qr, " Дані для відображення відсутні ")),
|
|
3870
|
+
l("div", Xr, [
|
|
3871
3871
|
l("button", {
|
|
3872
3872
|
type: "button",
|
|
3873
3873
|
onClick: U,
|
|
@@ -3879,11 +3879,11 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3879
3879
|
width: "14"
|
|
3880
3880
|
}),
|
|
3881
3881
|
ve(" " + P(J(s)), 1)
|
|
3882
|
-
], 8,
|
|
3882
|
+
], 8, ei)
|
|
3883
3883
|
])
|
|
3884
3884
|
]));
|
|
3885
3885
|
}
|
|
3886
|
-
}),
|
|
3886
|
+
}), li = /* @__PURE__ */ N(ti, [["__scopeId", "data-v-a0f7fbfc"]]), oi = { class: "flex items-center gap-2 w-full" }, ai = ["disabled"], si = /* @__PURE__ */ O({
|
|
3887
3887
|
__name: "vs-input-color",
|
|
3888
3888
|
props: {
|
|
3889
3889
|
style: { default: () => ({}) },
|
|
@@ -3896,30 +3896,30 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3896
3896
|
},
|
|
3897
3897
|
emits: ["update:modelValue"],
|
|
3898
3898
|
setup(o, { emit: e }) {
|
|
3899
|
-
const t = o, { inputClass:
|
|
3899
|
+
const t = o, { inputClass: r } = ye(t.style), a = e, n = D({
|
|
3900
3900
|
get: () => t.modelValue || "#000000",
|
|
3901
3901
|
set: (s) => a("update:modelValue", s)
|
|
3902
3902
|
});
|
|
3903
|
-
return (s, u) => (i(), d("div",
|
|
3903
|
+
return (s, u) => (i(), d("div", oi, [
|
|
3904
3904
|
K(l("input", {
|
|
3905
3905
|
type: "color",
|
|
3906
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
3906
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => n.value = c),
|
|
3907
3907
|
disabled: s.disabled,
|
|
3908
3908
|
ref: "color",
|
|
3909
|
-
class:
|
|
3909
|
+
class: B(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [s.modelValue ? "" : "text-opacity-50", J(r)].join(" ")]),
|
|
3910
3910
|
style: { border: "1px solid #CFD9E0" }
|
|
3911
|
-
}, null, 10,
|
|
3912
|
-
[ie,
|
|
3911
|
+
}, null, 10, ai), [
|
|
3912
|
+
[ie, n.value]
|
|
3913
3913
|
]),
|
|
3914
3914
|
K(l("input", {
|
|
3915
3915
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
|
|
3916
|
-
"onUpdate:modelValue": u[1] || (u[1] = (c) =>
|
|
3916
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => n.value = c)
|
|
3917
3917
|
}, null, 512), [
|
|
3918
|
-
[ie,
|
|
3918
|
+
[ie, n.value]
|
|
3919
3919
|
])
|
|
3920
3920
|
]));
|
|
3921
3921
|
}
|
|
3922
|
-
}),
|
|
3922
|
+
}), ni = { class: "flex items-center gap-2 w-full" }, ri = ["min", "max", "step", "disabled"], ii = /* @__PURE__ */ O({
|
|
3923
3923
|
__name: "vs-input-range",
|
|
3924
3924
|
props: {
|
|
3925
3925
|
style: { default: () => ({}) },
|
|
@@ -3935,60 +3935,60 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3935
3935
|
},
|
|
3936
3936
|
emits: ["update:modelValue"],
|
|
3937
3937
|
setup(o, { emit: e }) {
|
|
3938
|
-
const t = o, { inputClass:
|
|
3938
|
+
const t = o, { inputClass: r } = ye(t.style), a = e, n = D({
|
|
3939
3939
|
get: () => Number(t.modelValue ?? t.min),
|
|
3940
3940
|
set: (s) => a("update:modelValue", Number(s))
|
|
3941
3941
|
});
|
|
3942
|
-
return (s, u) => (i(), d("div",
|
|
3942
|
+
return (s, u) => (i(), d("div", ni, [
|
|
3943
3943
|
K(l("input", {
|
|
3944
3944
|
type: "range",
|
|
3945
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
3945
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => n.value = c),
|
|
3946
3946
|
min: s.min,
|
|
3947
3947
|
max: s.max,
|
|
3948
3948
|
step: s.step,
|
|
3949
3949
|
disabled: s.disabled,
|
|
3950
3950
|
ref: "range",
|
|
3951
|
-
class:
|
|
3951
|
+
class: B(["w-full cursor-pointer accent-blue-500", [s.modelValue ? "" : "text-opacity-50", J(r)].join(" ")])
|
|
3952
3952
|
}, null, 10, ri), [
|
|
3953
|
-
[ie,
|
|
3953
|
+
[ie, n.value]
|
|
3954
3954
|
]),
|
|
3955
3955
|
K(l("input", {
|
|
3956
3956
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
|
|
3957
3957
|
type: "number",
|
|
3958
|
-
"onUpdate:modelValue": u[1] || (u[1] = (c) =>
|
|
3958
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => n.value = c)
|
|
3959
3959
|
}, null, 512), [
|
|
3960
|
-
[ie,
|
|
3960
|
+
[ie, n.value]
|
|
3961
3961
|
])
|
|
3962
3962
|
]));
|
|
3963
3963
|
}
|
|
3964
|
-
}),
|
|
3964
|
+
}), ui = {
|
|
3965
3965
|
VsInputText: Ne,
|
|
3966
3966
|
VsInputRadio: ut,
|
|
3967
3967
|
"vs-input-text": Ne,
|
|
3968
|
-
"vs-input-password":
|
|
3969
|
-
"vs-input-textarea":
|
|
3970
|
-
"vs-input-mask":
|
|
3971
|
-
"vs-input-number":
|
|
3968
|
+
"vs-input-password": cl,
|
|
3969
|
+
"vs-input-textarea": ds,
|
|
3970
|
+
"vs-input-mask": Wl,
|
|
3971
|
+
"vs-input-number": vl,
|
|
3972
3972
|
"vs-input-radio": ut,
|
|
3973
3973
|
"vs-input-select": pt,
|
|
3974
3974
|
"vs-input-switcher": kt,
|
|
3975
3975
|
"vs-input-static": it,
|
|
3976
|
-
"vs-input-container":
|
|
3977
|
-
"vs-input-date":
|
|
3978
|
-
"vs-input-checkbox":
|
|
3979
|
-
"vs-input-file":
|
|
3976
|
+
"vs-input-container": Wa,
|
|
3977
|
+
"vs-input-date": io,
|
|
3978
|
+
"vs-input-checkbox": no,
|
|
3979
|
+
"vs-input-file": Jo,
|
|
3980
3980
|
"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":
|
|
3981
|
+
"vs-input-email": Yl,
|
|
3982
|
+
"vs-input-datatable": gn,
|
|
3983
|
+
"vs-input-map": jr,
|
|
3984
|
+
"vs-input-file-list": _a,
|
|
3985
|
+
"vs-input-tag": Rr,
|
|
3986
|
+
"vs-input-slug": qr,
|
|
3987
|
+
"vs-input-key-value": li,
|
|
3988
|
+
"vs-input-range": ii,
|
|
3989
|
+
"vs-input-color": si,
|
|
3990
3990
|
"vs-input-native-select": pt
|
|
3991
|
-
},
|
|
3991
|
+
}, di = /* @__PURE__ */ O({
|
|
3992
3992
|
__name: "behavior",
|
|
3993
3993
|
props: {
|
|
3994
3994
|
api: {},
|
|
@@ -3999,15 +3999,15 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
3999
3999
|
},
|
|
4000
4000
|
setup(o) {
|
|
4001
4001
|
const e = o, t = Se("values");
|
|
4002
|
-
async function
|
|
4002
|
+
async function r() {
|
|
4003
4003
|
try {
|
|
4004
4004
|
if (!e.api) return;
|
|
4005
|
-
const a = e.api.replace("{{value}}", e.value),
|
|
4006
|
-
if (!
|
|
4007
|
-
|
|
4005
|
+
const a = e.api.replace("{{value}}", e.value), n = await fetch(a);
|
|
4006
|
+
if (!n.ok) {
|
|
4007
|
+
ne({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
4008
4008
|
return;
|
|
4009
4009
|
}
|
|
4010
|
-
const s = await
|
|
4010
|
+
const s = await n.json();
|
|
4011
4011
|
if (!e.set || !t) return;
|
|
4012
4012
|
for (const [u, c] of Object.entries(e.set))
|
|
4013
4013
|
t.value[u] = s.result[c];
|
|
@@ -4015,12 +4015,15 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
4015
4015
|
console.error(e.error, a);
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
|
-
return (a,
|
|
4019
|
-
onClick:
|
|
4018
|
+
return (a, n) => (i(), d("button", {
|
|
4019
|
+
onClick: r,
|
|
4020
4020
|
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
4021
|
}, P(a.button), 1));
|
|
4022
4022
|
}
|
|
4023
|
-
}),
|
|
4023
|
+
}), ci = { class: "flex flex-col gap-1 w-full" }, pi = {
|
|
4024
|
+
key: 0,
|
|
4025
|
+
class: "text-sm text-gray-500"
|
|
4026
|
+
}, Vt = /* @__PURE__ */ O({
|
|
4024
4027
|
__name: "vs-compact-form-layout",
|
|
4025
4028
|
props: /* @__PURE__ */ Q({
|
|
4026
4029
|
item: { default: {} },
|
|
@@ -4034,7 +4037,7 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
4034
4037
|
}),
|
|
4035
4038
|
emits: ["update:modelValue"],
|
|
4036
4039
|
setup(o) {
|
|
4037
|
-
const e = o, t = X(o, "modelValue"),
|
|
4040
|
+
const e = o, t = X(o, "modelValue"), r = D(() => ul[`${e.layout}`]), a = D(() => ui?.[`vs-input-${e.item.type}`]), n = D(() => {
|
|
4038
4041
|
const u = J(a);
|
|
4039
4042
|
if (!u) return /* @__PURE__ */ new Set();
|
|
4040
4043
|
const c = u.props ?? u.__vccOpts?.props;
|
|
@@ -4042,10 +4045,10 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
4042
4045
|
const v = Array.isArray(c) ? c : Object.keys(c);
|
|
4043
4046
|
return new Set(v);
|
|
4044
4047
|
}), s = D(() => {
|
|
4045
|
-
const u = e.item ?? {}, c =
|
|
4048
|
+
const u = e.item ?? {}, c = n.value;
|
|
4046
4049
|
return c.size ? Object.fromEntries(Object.entries(u).filter(([v]) => c.has(v))) : {};
|
|
4047
4050
|
});
|
|
4048
|
-
return (u, c) => K((i(),
|
|
4051
|
+
return (u, c) => K((i(), re(Ee(r.value), {
|
|
4049
4052
|
ua: e.item.ua,
|
|
4050
4053
|
error: e.error || "",
|
|
4051
4054
|
item: u.item,
|
|
@@ -4053,43 +4056,46 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
4053
4056
|
}, {
|
|
4054
4057
|
default: Be(() => [
|
|
4055
4058
|
l("div", {
|
|
4056
|
-
class:
|
|
4059
|
+
class: B(["flex w-full", `${e.item.type}-component`])
|
|
4057
4060
|
}, [
|
|
4058
|
-
(
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4061
|
+
l("div", ci, [
|
|
4062
|
+
(i(), re(Ee(a.value), Ie(s.value, {
|
|
4063
|
+
modelValue: t.value,
|
|
4064
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => t.value = v)
|
|
4065
|
+
}), null, 16, ["modelValue"])),
|
|
4066
|
+
u.item.description ? (i(), d("p", pi, P(u.item.description), 1)) : F("", !0)
|
|
4067
|
+
]),
|
|
4068
|
+
u.item.behavior?.api && u.item.behavior?.button ? (i(), re(di, Ie({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : F("", !0)
|
|
4063
4069
|
], 2)
|
|
4064
4070
|
]),
|
|
4065
4071
|
_: 1
|
|
4066
4072
|
}, 8, ["ua", "error", "item", "label"])), [
|
|
4067
|
-
[
|
|
4073
|
+
[Ge, !u.item.hidden]
|
|
4068
4074
|
]);
|
|
4069
4075
|
}
|
|
4070
4076
|
}), Mt = {
|
|
4071
4077
|
required: "Це поле є обов’язковим",
|
|
4072
4078
|
email: "Неправильний email"
|
|
4073
|
-
},
|
|
4079
|
+
}, fi = (o) => o ? !1 : Mt.required, vi = (o) => {
|
|
4074
4080
|
const e = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
4075
4081
|
return o ? e.test(o) ? !1 : Mt.email : !1;
|
|
4076
|
-
},
|
|
4082
|
+
}, mi = (o, e) => {
|
|
4077
4083
|
const t = e.pattern ?? e.regexp;
|
|
4078
4084
|
return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
|
|
4079
|
-
},
|
|
4085
|
+
}, hi = (o, e) => !1, gi = (o, e) => {
|
|
4080
4086
|
switch (typeof e == "string" ? e : e.type) {
|
|
4081
4087
|
case "required":
|
|
4082
|
-
return
|
|
4088
|
+
return fi(o);
|
|
4083
4089
|
case "email":
|
|
4084
|
-
return
|
|
4090
|
+
return vi(o);
|
|
4085
4091
|
case "regexp":
|
|
4086
|
-
return
|
|
4092
|
+
return mi(o, e);
|
|
4087
4093
|
case "custom":
|
|
4088
|
-
return
|
|
4094
|
+
return hi();
|
|
4089
4095
|
default:
|
|
4090
4096
|
return !1;
|
|
4091
4097
|
}
|
|
4092
|
-
},
|
|
4098
|
+
}, bi = {
|
|
4093
4099
|
autocomplete: "select",
|
|
4094
4100
|
combobox: "select",
|
|
4095
4101
|
datepicker: "date",
|
|
@@ -4103,55 +4109,55 @@ const Dr = /* @__PURE__ */ N(zr, [["render", Ar]]), Or = { class: "form-geom__se
|
|
|
4103
4109
|
};
|
|
4104
4110
|
function vt(o) {
|
|
4105
4111
|
const e = o.toLowerCase();
|
|
4106
|
-
return
|
|
4112
|
+
return bi[e] || e;
|
|
4107
4113
|
}
|
|
4108
|
-
function
|
|
4114
|
+
function yi(o, e = !1) {
|
|
4109
4115
|
if (Array.isArray(o)) {
|
|
4110
|
-
const
|
|
4116
|
+
const r = [];
|
|
4111
4117
|
return o.forEach((a) => {
|
|
4112
|
-
const
|
|
4113
|
-
|
|
4114
|
-
}),
|
|
4118
|
+
const n = { ...a };
|
|
4119
|
+
n.name = (a.name || a.id || a.key || "").toString(), n.type = vt(a.type), n.label = a.label || a.ua, n.rules = a.rules || a.validators, n.type === "email" && !n.rules && (n.rules = ["email"]), a.data && (n.api = `/api/suggest/${a.data}`), n.disabled = e || n.disabled, r.push(n);
|
|
4120
|
+
}), r;
|
|
4115
4121
|
}
|
|
4116
4122
|
const t = [];
|
|
4117
|
-
return Object.entries(o).forEach((
|
|
4123
|
+
return Object.entries(o).forEach((r) => {
|
|
4118
4124
|
const a = {
|
|
4119
|
-
name:
|
|
4120
|
-
...
|
|
4121
|
-
type: vt(
|
|
4122
|
-
label:
|
|
4123
|
-
rules:
|
|
4125
|
+
name: r[0],
|
|
4126
|
+
...r[1],
|
|
4127
|
+
type: vt(r[1].type),
|
|
4128
|
+
label: r[1].label || r[1].ua,
|
|
4129
|
+
rules: r[1].rules || r[1].validators,
|
|
4124
4130
|
disabled: e
|
|
4125
4131
|
};
|
|
4126
|
-
a.type === "email" && !a.rules && (a.rules = ["email"]),
|
|
4132
|
+
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);
|
|
4127
4133
|
}), t;
|
|
4128
4134
|
}
|
|
4129
|
-
function
|
|
4130
|
-
const
|
|
4131
|
-
() =>
|
|
4135
|
+
function xi(o, e, t = !1) {
|
|
4136
|
+
const r = D(
|
|
4137
|
+
() => yi(
|
|
4132
4138
|
(Array.isArray(e), e),
|
|
4133
4139
|
typeof t == "boolean" ? t : t.value
|
|
4134
4140
|
)
|
|
4135
4141
|
), a = w({});
|
|
4136
|
-
function
|
|
4142
|
+
function n(v) {
|
|
4137
4143
|
const p = v?.conditions;
|
|
4138
4144
|
if (!p) return !0;
|
|
4139
4145
|
const f = Array.isArray(p) ? p[0] : p, y = o?.value?.[f];
|
|
4140
4146
|
return Ct(y, p);
|
|
4141
4147
|
}
|
|
4142
|
-
const s = (v =
|
|
4148
|
+
const s = (v = r.value, p = !0) => (v.forEach((f) => {
|
|
4143
4149
|
if (f.rules) {
|
|
4144
|
-
if (!
|
|
4150
|
+
if (!n(f)) {
|
|
4145
4151
|
delete a.value[f.name];
|
|
4146
4152
|
return;
|
|
4147
4153
|
}
|
|
4148
4154
|
f.rules.forEach((y) => {
|
|
4149
|
-
const _ =
|
|
4155
|
+
const _ = gi(o.value[f.name], y);
|
|
4150
4156
|
_ ? a.value[f.name] = _ : delete a.value[f.name];
|
|
4151
4157
|
});
|
|
4152
4158
|
}
|
|
4153
4159
|
f.schema && s(f.schema, !1);
|
|
4154
|
-
}), p && Object.values(a.value).some(Boolean) ? a.value : null), u = D(() =>
|
|
4160
|
+
}), p && Object.values(a.value).some(Boolean) ? a.value : null), u = D(() => r.value?.filter((v) => n(v)));
|
|
4155
4161
|
return {
|
|
4156
4162
|
errors: a,
|
|
4157
4163
|
validate: s,
|
|
@@ -4161,7 +4167,7 @@ function gi(o, e, t = !1) {
|
|
|
4161
4167
|
visibleSchema: u
|
|
4162
4168
|
};
|
|
4163
4169
|
}
|
|
4164
|
-
const
|
|
4170
|
+
const wi = {
|
|
4165
4171
|
key: 0,
|
|
4166
4172
|
"data-orientation": "horizontal",
|
|
4167
4173
|
role: "none",
|
|
@@ -4183,53 +4189,53 @@ const bi = {
|
|
|
4183
4189
|
}),
|
|
4184
4190
|
emits: /* @__PURE__ */ Q(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
4185
4191
|
setup(o, { expose: e, emit: t }) {
|
|
4186
|
-
const
|
|
4192
|
+
const r = t, a = o, n = X(o, "form"), s = X(o, "values"), {
|
|
4187
4193
|
errors: u,
|
|
4188
4194
|
validate: c,
|
|
4189
4195
|
reset: v,
|
|
4190
4196
|
visibleSchema: p
|
|
4191
|
-
} =
|
|
4192
|
-
|
|
4197
|
+
} = xi(s, a.schema, Ut(a, "disabled")), f = () => {
|
|
4198
|
+
r("update:modelValue", s.value), c(), r("handle-submit", s.value);
|
|
4193
4199
|
};
|
|
4194
4200
|
e({
|
|
4195
4201
|
validate: c,
|
|
4196
4202
|
reset: v,
|
|
4197
4203
|
errors: u
|
|
4198
4204
|
}), be(() => {
|
|
4199
|
-
a.modelValue && (s.value = a.modelValue),
|
|
4205
|
+
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;
|
|
4200
4206
|
});
|
|
4201
4207
|
function y(_, U) {
|
|
4202
4208
|
if (_ === U) return !0;
|
|
4203
4209
|
if (typeof _ != "object" || typeof U != "object" || !_ || !U) return !1;
|
|
4204
4210
|
const E = Object.keys(_), T = Object.keys(U);
|
|
4205
|
-
return E.length !== T.length ? !1 : E.every((
|
|
4211
|
+
return E.length !== T.length ? !1 : E.every((V) => _[V] === U[V]);
|
|
4206
4212
|
}
|
|
4207
|
-
return
|
|
4213
|
+
return rt("form", n), rt("values", s), le(n.value, (_) => {
|
|
4208
4214
|
console.log("form", _);
|
|
4209
4215
|
}), (_, U) => (i(), d("form", {
|
|
4210
4216
|
onSubmit: ge(f, ["prevent"]),
|
|
4211
|
-
class:
|
|
4217
|
+
class: B(["grid grid-cols-12", _.layout === "default" ? "gap-6" : "gap-4"])
|
|
4212
4218
|
}, [
|
|
4213
4219
|
(i(!0), d(ee, null, ae(J(p), (E, T) => (i(), d("div", {
|
|
4214
4220
|
key: E.name,
|
|
4215
|
-
class:
|
|
4221
|
+
class: B(_.layout === "horizontal" ? "col-span-12" : `col-span-${E.col || 12}`)
|
|
4216
4222
|
}, [
|
|
4217
4223
|
I(Vt, {
|
|
4218
4224
|
style: we(_.style),
|
|
4219
4225
|
item: E,
|
|
4220
4226
|
layout: _.layout,
|
|
4221
4227
|
"model-value": s.value[E.name],
|
|
4222
|
-
"onUpdate:modelValue": (
|
|
4223
|
-
const
|
|
4224
|
-
y(
|
|
4228
|
+
"onUpdate:modelValue": (V) => {
|
|
4229
|
+
const M = s.value[E.name];
|
|
4230
|
+
y(M, V) || (s.value[E.name] = V);
|
|
4225
4231
|
},
|
|
4226
4232
|
error: J(u)[E.name]
|
|
4227
4233
|
}, null, 8, ["style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]),
|
|
4228
|
-
_.layout === "settings" && T + 1 !== J(p).length ? (i(), d("div",
|
|
4234
|
+
_.layout === "settings" && T + 1 !== J(p).length ? (i(), d("div", wi)) : F("", !0)
|
|
4229
4235
|
], 2))), 128))
|
|
4230
4236
|
], 34));
|
|
4231
4237
|
}
|
|
4232
|
-
}),
|
|
4238
|
+
}), ki = { class: "relative" }, _i = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, $i = { 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" }, Ci = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Vi = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Mi = { class: "p-4 mim-h-0 h-full overflow-auto" }, Li = /* @__PURE__ */ O({
|
|
4233
4239
|
__name: "modal-edit",
|
|
4234
4240
|
props: {
|
|
4235
4241
|
schema: {},
|
|
@@ -4240,11 +4246,11 @@ const bi = {
|
|
|
4240
4246
|
},
|
|
4241
4247
|
emits: ["close", "save", "edit"],
|
|
4242
4248
|
setup(o, { emit: e }) {
|
|
4243
|
-
const t = o,
|
|
4249
|
+
const t = o, r = e, a = w(t.schema), n = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), s = w({}), u = w(), c = w(t.mode);
|
|
4244
4250
|
async function v() {
|
|
4245
4251
|
const f = s.value.validate();
|
|
4246
4252
|
if (f) {
|
|
4247
|
-
|
|
4253
|
+
ne({ type: "warning", title: "Помилка валідації", message: Object.entries(f).map(([y, _]) => `${y}: ${_}`).join(`
|
|
4248
4254
|
`) });
|
|
4249
4255
|
return;
|
|
4250
4256
|
}
|
|
@@ -4255,32 +4261,32 @@ const bi = {
|
|
|
4255
4261
|
headers: {
|
|
4256
4262
|
"Content-Type": "application/json"
|
|
4257
4263
|
},
|
|
4258
|
-
body: JSON.stringify(
|
|
4264
|
+
body: JSON.stringify(n.value)
|
|
4259
4265
|
});
|
|
4260
4266
|
if (y.ok)
|
|
4261
|
-
await y.json(),
|
|
4267
|
+
await y.json(), ne({
|
|
4262
4268
|
type: "success",
|
|
4263
4269
|
title: "Успішно",
|
|
4264
4270
|
message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
|
|
4265
|
-
}),
|
|
4271
|
+
}), r("save", n.value);
|
|
4266
4272
|
else if (y.status === 400) {
|
|
4267
4273
|
const _ = await y.json().catch(() => ({}));
|
|
4268
|
-
|
|
4274
|
+
ne({
|
|
4269
4275
|
type: "warning",
|
|
4270
4276
|
title: "Помилка валідації",
|
|
4271
4277
|
message: _.message || "Некоректні дані (400)"
|
|
4272
4278
|
});
|
|
4273
|
-
} else y.status === 500 ?
|
|
4279
|
+
} else y.status === 500 ? ne({
|
|
4274
4280
|
type: "error",
|
|
4275
4281
|
title: "Серверна помилка",
|
|
4276
4282
|
message: "Виникла помилка на сервері (500)"
|
|
4277
|
-
}) :
|
|
4283
|
+
}) : ne({
|
|
4278
4284
|
type: "error",
|
|
4279
4285
|
title: "Помилка",
|
|
4280
4286
|
message: `Статус: ${y.status}`
|
|
4281
4287
|
});
|
|
4282
4288
|
} catch (y) {
|
|
4283
|
-
|
|
4289
|
+
ne({
|
|
4284
4290
|
type: "error",
|
|
4285
4291
|
title: "Помилка з’єднання",
|
|
4286
4292
|
message: y.message || "Не вдалося виконати запит"
|
|
@@ -4288,14 +4294,14 @@ const bi = {
|
|
|
4288
4294
|
}
|
|
4289
4295
|
}
|
|
4290
4296
|
function p() {
|
|
4291
|
-
|
|
4297
|
+
r("close");
|
|
4292
4298
|
}
|
|
4293
4299
|
return be(async () => {
|
|
4294
4300
|
try {
|
|
4295
4301
|
if (t.form) {
|
|
4296
4302
|
const f = await fetch(`/api/template/form/${t.form}`);
|
|
4297
4303
|
if (!f.ok) {
|
|
4298
|
-
|
|
4304
|
+
ne({
|
|
4299
4305
|
type: f.status >= 400 && f.status < 500 ? "warning" : "error",
|
|
4300
4306
|
title: "Error",
|
|
4301
4307
|
message: `Error code: ${f.status}`
|
|
@@ -4308,7 +4314,7 @@ const bi = {
|
|
|
4308
4314
|
u.value = t.token;
|
|
4309
4315
|
const f = await fetch(`/api/form/${u.value}`);
|
|
4310
4316
|
if (!f.ok) {
|
|
4311
|
-
|
|
4317
|
+
ne({
|
|
4312
4318
|
type: f.status >= 400 && f.status < 500 ? "warning" : "error",
|
|
4313
4319
|
title: "Error",
|
|
4314
4320
|
message: `Error code: ${f.status}`
|
|
@@ -4316,20 +4322,20 @@ const bi = {
|
|
|
4316
4322
|
return;
|
|
4317
4323
|
}
|
|
4318
4324
|
const y = await f.json();
|
|
4319
|
-
a.value = y.schema, y.data ?
|
|
4325
|
+
a.value = y.schema, y.data ? n.value = y.data : c.value = "add";
|
|
4320
4326
|
}
|
|
4321
4327
|
} catch (f) {
|
|
4322
|
-
|
|
4328
|
+
ne({
|
|
4323
4329
|
type: "error",
|
|
4324
4330
|
title: "Error",
|
|
4325
4331
|
message: f.message || "Unexpected error"
|
|
4326
4332
|
}), console.error(f);
|
|
4327
4333
|
}
|
|
4328
|
-
}), (f, y) => (i(), d("div",
|
|
4329
|
-
l("div",
|
|
4330
|
-
l("div",
|
|
4331
|
-
l("div",
|
|
4332
|
-
l("h3",
|
|
4334
|
+
}), (f, y) => (i(), d("div", ki, [
|
|
4335
|
+
l("div", _i, [
|
|
4336
|
+
l("div", $i, [
|
|
4337
|
+
l("div", Ci, [
|
|
4338
|
+
l("h3", Vi, P(c.value === "add" ? "Додати" : "Змінити"), 1),
|
|
4333
4339
|
l("button", {
|
|
4334
4340
|
onClick: p,
|
|
4335
4341
|
type: "button",
|
|
@@ -4353,12 +4359,12 @@ const bi = {
|
|
|
4353
4359
|
], -1)
|
|
4354
4360
|
]))
|
|
4355
4361
|
]),
|
|
4356
|
-
l("div",
|
|
4357
|
-
a.value ? (i(),
|
|
4362
|
+
l("div", Mi, [
|
|
4363
|
+
a.value ? (i(), re(Te, {
|
|
4358
4364
|
key: 0,
|
|
4359
4365
|
schema: a.value,
|
|
4360
|
-
values:
|
|
4361
|
-
"onUpdate:values": y[0] || (y[0] = (_) =>
|
|
4366
|
+
values: n.value,
|
|
4367
|
+
"onUpdate:values": y[0] || (y[0] = (_) => n.value = _),
|
|
4362
4368
|
form: s.value,
|
|
4363
4369
|
"onUpdate:form": y[1] || (y[1] = (_) => s.value = _)
|
|
4364
4370
|
}, null, 8, ["schema", "values", "form"])) : F("", !0)
|
|
@@ -4386,14 +4392,14 @@ const bi = {
|
|
|
4386
4392
|
visible: !0,
|
|
4387
4393
|
size: "medium",
|
|
4388
4394
|
closeClickBack: !0,
|
|
4389
|
-
content:
|
|
4395
|
+
content: Li,
|
|
4390
4396
|
contentProps: {
|
|
4391
4397
|
...o,
|
|
4392
4398
|
onClose: () => {
|
|
4393
4399
|
e(null), t();
|
|
4394
4400
|
},
|
|
4395
|
-
onSave: (
|
|
4396
|
-
e(
|
|
4401
|
+
onSave: (r) => {
|
|
4402
|
+
e(r), t();
|
|
4397
4403
|
}
|
|
4398
4404
|
}
|
|
4399
4405
|
});
|
|
@@ -4404,29 +4410,29 @@ Te.install = function(e) {
|
|
|
4404
4410
|
}), e.provide("form", mt), window.v3plugin || (window.v3plugin = {});
|
|
4405
4411
|
};
|
|
4406
4412
|
export {
|
|
4407
|
-
|
|
4413
|
+
Li as ModalEdit,
|
|
4408
4414
|
Te as VForm,
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4415
|
+
no as VsInputCheckbox,
|
|
4416
|
+
si as VsInputColor,
|
|
4417
|
+
Wa as VsInputContainer,
|
|
4418
|
+
io as VsInputDate,
|
|
4419
|
+
Yl as VsInputEmail,
|
|
4420
|
+
Jo as VsInputFile,
|
|
4421
|
+
_a as VsInputFileList,
|
|
4422
|
+
li as VsInputKeyValue,
|
|
4423
|
+
Wl as VsInputMask,
|
|
4424
|
+
vl as VsInputNumber,
|
|
4419
4425
|
ut as VsInputRadio,
|
|
4420
|
-
|
|
4426
|
+
ii as VsInputRange,
|
|
4421
4427
|
pt as VsInputSelect,
|
|
4422
|
-
|
|
4428
|
+
qr as VsInputSlug,
|
|
4423
4429
|
it as VsInputStatic,
|
|
4424
4430
|
kt as VsInputSwitcher,
|
|
4425
|
-
|
|
4431
|
+
Rr as VsInputTag,
|
|
4426
4432
|
Ne as VsInputText,
|
|
4427
|
-
|
|
4433
|
+
ds as VsInputTextarea,
|
|
4428
4434
|
Te as default,
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4435
|
+
ui as inputs,
|
|
4436
|
+
gn as vsInputDatatable,
|
|
4437
|
+
jr as vsInputMap
|
|
4432
4438
|
};
|