@opengis/form 0.0.49 → 0.0.50
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/form/vs-compact-form-navigation.vue.d.ts.map +1 -1
- package/dist/components/inputs/file/vs-input-file.vue.d.ts +2 -0
- package/dist/components/inputs/file/vs-input-file.vue.d.ts.map +1 -1
- package/dist/components/inputs/index.d.ts +2 -0
- package/dist/components/inputs/index.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +950 -949
- package/dist/index.umd.cjs +3 -3
- package/package.json +67 -67
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as U, ref as w, onMounted as ke, onUnmounted as Ye, createElementBlock as d, openBlock as
|
|
1
|
+
import { defineComponent as U, ref as w, onMounted as ke, onUnmounted as Ye, createElementBlock as d, openBlock as i, createCommentVNode as D, renderSlot as Le, createElementVNode as l, toDisplayString as G, mergeProps as Te, computed as B, normalizeStyle as be, createTextVNode as ge, normalizeProps as ot, guardReactiveProps as nt, normalizeClass as E, mergeModels as re, useModel as ue, withDirectives as ne, unref as ee, vModelText as ve, vModelCheckbox as Ct, createVNode as A, createBlock as me, resolveDynamicComponent as Fe, withCtx as Be, withModifiers as we, onBeforeUnmount as at, watch as ie, createStaticVNode as ye, vModelRadio as Vt, Fragment as se, renderList as pe, reactive as Nt, vModelDynamic as qt, vShow as Xe, inject as ze, resolveComponent as mt, Transition as st, Teleport as Mt, nextTick as Ie, getCurrentInstance as Wt, watchEffect as Gt, toRef as Zt, provide as vt } from "vue";
|
|
2
2
|
import { notify as de, VsModal as Lt, modal as Kt } from "@opengis/core";
|
|
3
3
|
const Jt = { class: "w-full relative" }, Yt = {
|
|
4
4
|
key: 0,
|
|
@@ -24,22 +24,22 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
24
24
|
columns: {}
|
|
25
25
|
},
|
|
26
26
|
setup(o) {
|
|
27
|
-
const e = w("uk"), t = (
|
|
28
|
-
|
|
27
|
+
const e = w("uk"), t = (a) => {
|
|
28
|
+
a.detail.key === "locale" && (e.value = a.detail.newValue);
|
|
29
29
|
};
|
|
30
30
|
return ke(() => {
|
|
31
31
|
e.value = localStorage.locale, window.addEventListener("storage", t);
|
|
32
32
|
}), Ye(() => {
|
|
33
33
|
window.removeEventListener("resize", t);
|
|
34
|
-
}), (
|
|
35
|
-
|
|
36
|
-
l("span", Xt,
|
|
37
|
-
|
|
34
|
+
}), (a, n) => (i(), d("div", Jt, [
|
|
35
|
+
a.ua || a.label ? (i(), d("div", Yt, [
|
|
36
|
+
l("span", Xt, G(a.item[e.value] || a.ua || a.label), 1),
|
|
37
|
+
a.item?.rules?.includes("required") ? (i(), d("span", Qt, "*")) : D("", !0)
|
|
38
38
|
])) : D("", !0),
|
|
39
|
-
Le(
|
|
40
|
-
class: { "opacity-60":
|
|
39
|
+
Le(a.$slots, "default", Te(a.$attrs, {
|
|
40
|
+
class: { "opacity-60": a.item.disabled }
|
|
41
41
|
})),
|
|
42
|
-
|
|
42
|
+
a.error ? (i(), d("span", el, G(a.error), 1)) : D("", !0)
|
|
43
43
|
]));
|
|
44
44
|
}
|
|
45
45
|
}), ll = { class: "w-full relative flex flex-row items-center gap-2" }, ol = {
|
|
@@ -63,39 +63,39 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
63
63
|
columns: { default: () => ({ container: 12, label: 3 }) }
|
|
64
64
|
},
|
|
65
65
|
setup(o) {
|
|
66
|
-
const e = o, t =
|
|
67
|
-
const { container:
|
|
68
|
-
return !
|
|
69
|
-
}), n =
|
|
66
|
+
const e = o, t = B(() => e.columns ?? { container: 12, label: 3 }), a = B(() => {
|
|
67
|
+
const { container: u, label: c } = t.value;
|
|
68
|
+
return !u || u <= 0 ? 0 : Math.min(Math.max(c ?? 0, 0), u) / u;
|
|
69
|
+
}), n = B(() => e.item?.type === "html" || a.value <= 0 ? !1 : !!(e.ua || e.label)), s = B(() => {
|
|
70
70
|
if (!n.value) return {};
|
|
71
|
-
const
|
|
72
|
-
return { flexBasis:
|
|
73
|
-
}), r =
|
|
74
|
-
const { container:
|
|
75
|
-
if (!
|
|
71
|
+
const u = `${a.value * 100}%`;
|
|
72
|
+
return { flexBasis: u, maxWidth: u };
|
|
73
|
+
}), r = B(() => {
|
|
74
|
+
const { container: u, label: c } = t.value;
|
|
75
|
+
if (!u || u <= 0) return {};
|
|
76
76
|
if (e.item?.type === "html") return { flexBasis: "100%", maxWidth: "100%" };
|
|
77
77
|
if (!n.value) return { flexBasis: "100%", maxWidth: "100%" };
|
|
78
|
-
const p = Math.max(
|
|
78
|
+
const p = Math.max(u - Math.max(c ?? 0, 0), 0) / u;
|
|
79
79
|
if (!p) return {};
|
|
80
80
|
const f = `${p * 100}%`;
|
|
81
81
|
return { flexBasis: f, maxWidth: f };
|
|
82
82
|
});
|
|
83
|
-
return (
|
|
84
|
-
n.value ? (
|
|
83
|
+
return (u, c) => (i(), d("div", ll, [
|
|
84
|
+
n.value ? (i(), d("span", {
|
|
85
85
|
key: 0,
|
|
86
86
|
class: "text-sm text-gray-900 font-medium flex shrink-0",
|
|
87
|
-
style: be(
|
|
87
|
+
style: be(s.value)
|
|
88
88
|
}, [
|
|
89
|
-
ge(
|
|
90
|
-
|
|
89
|
+
ge(G(u.ua || u.label) + " ", 1),
|
|
90
|
+
u.item?.rules?.includes("required") && (u.ua || u.label) ? (i(), d("span", ol, "*")) : D("", !0)
|
|
91
91
|
], 4)) : D("", !0),
|
|
92
92
|
l("div", {
|
|
93
93
|
class: "flex-1 min-w-0",
|
|
94
94
|
style: be(r.value)
|
|
95
95
|
}, [
|
|
96
|
-
Le(
|
|
96
|
+
Le(u.$slots, "default", ot(nt(u.$attrs)))
|
|
97
97
|
], 4),
|
|
98
|
-
|
|
98
|
+
u.error ? (i(), d("span", nl, G(u.error), 1)) : D("", !0)
|
|
99
99
|
]));
|
|
100
100
|
}
|
|
101
101
|
}), sl = { class: "w-full relative" }, rl = {
|
|
@@ -116,9 +116,9 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
116
116
|
columns: {}
|
|
117
117
|
},
|
|
118
118
|
setup(o) {
|
|
119
|
-
return (e, t) => (
|
|
119
|
+
return (e, t) => (i(), d("div", sl, [
|
|
120
120
|
Le(e.$slots, "default", ot(nt(e.$attrs))),
|
|
121
|
-
e.error ? (
|
|
121
|
+
e.error ? (i(), d("span", rl, G(e.error), 1)) : D("", !0)
|
|
122
122
|
]));
|
|
123
123
|
}
|
|
124
124
|
}), ul = { class: "flex-1 min-w-0" }, dl = {
|
|
@@ -149,9 +149,9 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
149
149
|
},
|
|
150
150
|
setup(o) {
|
|
151
151
|
const e = o, t = w("uk");
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
152
|
+
B(() => (e.item ?? {})?.[t.value] ?? e.ua ?? e.label ?? "");
|
|
153
|
+
const a = B(() => e.item?.description ?? ""), n = B(() => Array.isArray(e.item?.rules) && e.item.rules.includes("required")), s = B(() => (typeof e.error == "string" ? e.error : "") ?? ""), r = (u) => {
|
|
154
|
+
u.key === "locale" && (t.value = u.newValue ?? "uk");
|
|
155
155
|
};
|
|
156
156
|
return ke(() => {
|
|
157
157
|
try {
|
|
@@ -161,24 +161,24 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
161
161
|
window.addEventListener("storage", r);
|
|
162
162
|
}), Ye(() => {
|
|
163
163
|
window.removeEventListener("storage", r);
|
|
164
|
-
}), (
|
|
165
|
-
class: E(["w-full relative", { "opacity-60":
|
|
164
|
+
}), (u, c) => (i(), d("div", {
|
|
165
|
+
class: E(["w-full relative", { "opacity-60": u.item?.disabled }])
|
|
166
166
|
}, [
|
|
167
167
|
l("div", {
|
|
168
|
-
class: E(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(
|
|
168
|
+
class: E(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(u.item.type) ? "flex flex-col" : ""]])
|
|
169
169
|
}, [
|
|
170
170
|
l("div", ul, [
|
|
171
|
-
|
|
172
|
-
l("span", cl,
|
|
173
|
-
n.value ? (
|
|
171
|
+
u.ua || u.label ? (i(), d("p", dl, [
|
|
172
|
+
l("span", cl, G(u.item[t.value] || u.ua || u.label), 1),
|
|
173
|
+
n.value ? (i(), d("span", pl, "*")) : D("", !0)
|
|
174
174
|
])) : D("", !0),
|
|
175
|
-
|
|
175
|
+
a.value ? (i(), d("p", fl, G(a.value), 1)) : D("", !0)
|
|
176
176
|
]),
|
|
177
177
|
l("div", ml, [
|
|
178
|
-
Le(
|
|
178
|
+
Le(u.$slots, "default", ot(nt(u.$attrs)))
|
|
179
179
|
])
|
|
180
180
|
], 2),
|
|
181
|
-
|
|
181
|
+
s.value ? (i(), d("p", vl, G(s.value), 1)) : D("", !0)
|
|
182
182
|
], 2));
|
|
183
183
|
}
|
|
184
184
|
}), gl = {
|
|
@@ -189,7 +189,7 @@ const Jt = { class: "w-full relative" }, Yt = {
|
|
|
189
189
|
};
|
|
190
190
|
function _e(o) {
|
|
191
191
|
return {
|
|
192
|
-
inputClass:
|
|
192
|
+
inputClass: B(() => {
|
|
193
193
|
const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
194
194
|
return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
|
|
195
195
|
})
|
|
@@ -197,7 +197,7 @@ function _e(o) {
|
|
|
197
197
|
}
|
|
198
198
|
const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
199
199
|
__name: "vs-input-password",
|
|
200
|
-
props: /* @__PURE__ */
|
|
200
|
+
props: /* @__PURE__ */ re({
|
|
201
201
|
style: { default: () => ({}) },
|
|
202
202
|
customClass: { default: "" },
|
|
203
203
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -211,10 +211,10 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
211
211
|
}),
|
|
212
212
|
emits: ["update:modelValue"],
|
|
213
213
|
setup(o) {
|
|
214
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
215
|
-
return (n,
|
|
214
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
215
|
+
return (n, s) => ne((i(), d("input", {
|
|
216
216
|
type: "password",
|
|
217
|
-
"onUpdate:modelValue":
|
|
217
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
218
218
|
placeholder: n.placeholder,
|
|
219
219
|
disabled: n.disabled,
|
|
220
220
|
class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
|
|
@@ -222,12 +222,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
222
222
|
border: "1px solid #CFD9E0"
|
|
223
223
|
}
|
|
224
224
|
}, null, 10, bl)), [
|
|
225
|
-
[ve,
|
|
225
|
+
[ve, a.value]
|
|
226
226
|
]);
|
|
227
227
|
}
|
|
228
228
|
}), xl = ["placeholder", "disabled"], Je = /* @__PURE__ */ U({
|
|
229
229
|
__name: "vs-input-text",
|
|
230
|
-
props: /* @__PURE__ */
|
|
230
|
+
props: /* @__PURE__ */ re({
|
|
231
231
|
style: { default: () => ({}) },
|
|
232
232
|
customClass: { default: "" },
|
|
233
233
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -241,10 +241,10 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
241
241
|
}),
|
|
242
242
|
emits: ["update:modelValue"],
|
|
243
243
|
setup(o) {
|
|
244
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
245
|
-
return (n,
|
|
244
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
245
|
+
return (n, s) => ne((i(), d("input", {
|
|
246
246
|
type: "text",
|
|
247
|
-
"onUpdate:modelValue":
|
|
247
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
248
248
|
placeholder: n.placeholder,
|
|
249
249
|
disabled: n.disabled,
|
|
250
250
|
class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
|
|
@@ -252,12 +252,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
252
252
|
border: "1px solid #CFD9E0"
|
|
253
253
|
}
|
|
254
254
|
}, null, 10, xl)), [
|
|
255
|
-
[ve,
|
|
255
|
+
[ve, a.value]
|
|
256
256
|
]);
|
|
257
257
|
}
|
|
258
258
|
}), wl = ["placeholder", "min", "max"], kl = /* @__PURE__ */ U({
|
|
259
259
|
__name: "vs-input-number",
|
|
260
|
-
props: /* @__PURE__ */
|
|
260
|
+
props: /* @__PURE__ */ re({
|
|
261
261
|
min: {},
|
|
262
262
|
max: {},
|
|
263
263
|
style: { default: () => ({}) },
|
|
@@ -273,11 +273,11 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
273
273
|
}),
|
|
274
274
|
emits: ["update:modelValue"],
|
|
275
275
|
setup(o) {
|
|
276
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
277
|
-
return (n,
|
|
276
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
277
|
+
return (n, s) => ne((i(), d("input", {
|
|
278
278
|
type: "number",
|
|
279
279
|
step: "any",
|
|
280
|
-
"onUpdate:modelValue":
|
|
280
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
281
281
|
placeholder: n.placeholder,
|
|
282
282
|
class: E(["py-1.5 px-3 block w-full bg-white", [ee(t)]]),
|
|
283
283
|
style: {
|
|
@@ -286,13 +286,13 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
286
286
|
min: n.min,
|
|
287
287
|
max: n.max
|
|
288
288
|
}, null, 10, wl)), [
|
|
289
|
-
[ve,
|
|
289
|
+
[ve, a.value]
|
|
290
290
|
]);
|
|
291
291
|
}
|
|
292
292
|
}), X = (o, e) => {
|
|
293
293
|
const t = o.__vccOpts || o;
|
|
294
|
-
for (const [
|
|
295
|
-
t[
|
|
294
|
+
for (const [a, n] of e)
|
|
295
|
+
t[a] = n;
|
|
296
296
|
return t;
|
|
297
297
|
}, _l = {}, $l = {
|
|
298
298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -305,7 +305,7 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
|
|
|
305
305
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
306
306
|
};
|
|
307
307
|
function Cl(o, e) {
|
|
308
|
-
return
|
|
308
|
+
return i(), d("svg", $l, e[0] || (e[0] = [
|
|
309
309
|
l("path", {
|
|
310
310
|
stroke: "none",
|
|
311
311
|
d: "M0 0h24v24H0z",
|
|
@@ -327,27 +327,27 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
327
327
|
},
|
|
328
328
|
emits: ["update:modelValue"],
|
|
329
329
|
setup(o, { emit: e }) {
|
|
330
|
-
const t = e,
|
|
331
|
-
get: () =>
|
|
332
|
-
set: (
|
|
330
|
+
const t = e, a = o, n = B({
|
|
331
|
+
get: () => a.modelValue,
|
|
332
|
+
set: (s) => t("update:modelValue", s)
|
|
333
333
|
});
|
|
334
|
-
return (
|
|
334
|
+
return (s, r) => (i(), d("div", Ml, [
|
|
335
335
|
ne(l("input", {
|
|
336
336
|
type: "checkbox",
|
|
337
|
-
value:
|
|
338
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
339
|
-
class: E(["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":
|
|
340
|
-
id:
|
|
341
|
-
disabled:
|
|
337
|
+
value: s.value,
|
|
338
|
+
"onUpdate:modelValue": r[0] || (r[0] = (u) => n.value = u),
|
|
339
|
+
class: E(["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": s.disabled }]),
|
|
340
|
+
id: s.id,
|
|
341
|
+
disabled: s.disabled
|
|
342
342
|
}, null, 10, Ll), [
|
|
343
343
|
[Ct, n.value]
|
|
344
344
|
]),
|
|
345
345
|
l("label", {
|
|
346
|
-
for:
|
|
347
|
-
class: E(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed":
|
|
346
|
+
for: s.id,
|
|
347
|
+
class: E(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": s.disabled }])
|
|
348
348
|
}, [
|
|
349
349
|
l("div", {
|
|
350
|
-
class: E(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [n.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600",
|
|
350
|
+
class: E(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [n.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", s.error ? "border-red-600" : ""]])
|
|
351
351
|
}, [
|
|
352
352
|
A(Vl, {
|
|
353
353
|
height: "12",
|
|
@@ -355,8 +355,8 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
355
355
|
})
|
|
356
356
|
], 2),
|
|
357
357
|
l("span", Bl, [
|
|
358
|
-
Le(
|
|
359
|
-
ge(
|
|
358
|
+
Le(s.$slots, "default", {}, () => [
|
|
359
|
+
ge(G(s.label), 1)
|
|
360
360
|
])
|
|
361
361
|
])
|
|
362
362
|
], 10, Sl)
|
|
@@ -379,41 +379,41 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
379
379
|
},
|
|
380
380
|
emits: ["update:modelValue"],
|
|
381
381
|
setup(o, { emit: e }) {
|
|
382
|
-
const t = o,
|
|
382
|
+
const t = o, a = e, n = B({
|
|
383
383
|
get: () => t.modelValue,
|
|
384
|
-
set: (
|
|
385
|
-
|
|
384
|
+
set: (u) => {
|
|
385
|
+
a("update:modelValue", u);
|
|
386
386
|
}
|
|
387
|
-
}),
|
|
388
|
-
return (
|
|
389
|
-
class: E(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value,
|
|
387
|
+
}), s = B(() => Array.isArray(n.value) ? n.value.includes(t.value) : n.value === !0 || n.value === t.value), r = B(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
388
|
+
return (u, c) => (i(), d("label", {
|
|
389
|
+
class: E(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
390
390
|
}, [
|
|
391
391
|
ne(l("input", {
|
|
392
392
|
type: "checkbox",
|
|
393
393
|
class: "hidden",
|
|
394
|
-
name:
|
|
395
|
-
value:
|
|
394
|
+
name: u.id,
|
|
395
|
+
value: u.value,
|
|
396
396
|
"onUpdate:modelValue": c[0] || (c[0] = (p) => n.value = p),
|
|
397
|
-
disabled:
|
|
397
|
+
disabled: u.disabled
|
|
398
398
|
}, null, 8, El), [
|
|
399
399
|
[Ct, n.value]
|
|
400
400
|
]),
|
|
401
401
|
l("span", Il, [
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
u.icon || u.imgUrl ? (i(), d("span", zl, [
|
|
403
|
+
u.icon ? (i(), d("i", {
|
|
404
404
|
key: 0,
|
|
405
|
-
class: E(
|
|
405
|
+
class: E(u.icon)
|
|
406
406
|
}, null, 2)) : D("", !0),
|
|
407
|
-
|
|
407
|
+
u.imgUrl ? (i(), d("img", {
|
|
408
408
|
key: 1,
|
|
409
|
-
src:
|
|
409
|
+
src: u.imgUrl,
|
|
410
410
|
width: "16",
|
|
411
411
|
height: "16",
|
|
412
412
|
alt: "icon"
|
|
413
413
|
}, null, 8, Al)) : D("", !0)
|
|
414
414
|
])) : D("", !0),
|
|
415
|
-
Le(
|
|
416
|
-
ge(
|
|
415
|
+
Le(u.$slots, "default", {}, () => [
|
|
416
|
+
ge(G(u.label), 1)
|
|
417
417
|
])
|
|
418
418
|
])
|
|
419
419
|
], 2));
|
|
@@ -435,32 +435,32 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
435
435
|
},
|
|
436
436
|
emits: ["update:modelValue"],
|
|
437
437
|
setup(o, { emit: e }) {
|
|
438
|
-
const t = o,
|
|
438
|
+
const t = o, a = e, n = `radio-${Math.floor(Math.random() * 1e4)}`, s = B({
|
|
439
439
|
get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
|
|
440
|
-
set: (
|
|
440
|
+
set: (u) => {
|
|
441
441
|
if (Array.isArray(t.modelValue)) {
|
|
442
442
|
let c = [...t.modelValue];
|
|
443
|
-
|
|
443
|
+
u ? c.includes(t.value) || c.push(t.value) : c = c.filter((p) => p !== t.value), a("update:modelValue", c);
|
|
444
444
|
} else
|
|
445
|
-
|
|
445
|
+
a("update:modelValue", u);
|
|
446
446
|
}
|
|
447
447
|
}), r = w(`vs-checkbox-${t.view || "default"}`);
|
|
448
|
-
return (
|
|
449
|
-
(
|
|
450
|
-
value:
|
|
451
|
-
label:
|
|
452
|
-
info:
|
|
453
|
-
disabled:
|
|
454
|
-
modelValue:
|
|
455
|
-
"onUpdate:modelValue": c[0] || (c[0] = (p) =>
|
|
448
|
+
return (u, c) => (i(), d("div", Fl, [
|
|
449
|
+
(i(), me(Fe(r.value === "vs-checkbox-buttons" ? ee(Tl) : ee(jl)), {
|
|
450
|
+
value: u.value,
|
|
451
|
+
label: u.label,
|
|
452
|
+
info: u.option?.info,
|
|
453
|
+
disabled: u.disabled,
|
|
454
|
+
modelValue: s.value,
|
|
455
|
+
"onUpdate:modelValue": c[0] || (c[0] = (p) => s.value = p),
|
|
456
456
|
id: n,
|
|
457
|
-
icon:
|
|
458
|
-
imgUrl:
|
|
459
|
-
style: be(
|
|
460
|
-
error:
|
|
457
|
+
icon: u.icon,
|
|
458
|
+
imgUrl: u.imgUrl,
|
|
459
|
+
style: be(u.style),
|
|
460
|
+
error: u.error
|
|
461
461
|
}, {
|
|
462
462
|
default: Be(() => [
|
|
463
|
-
ge(
|
|
463
|
+
ge(G(u.label), 1)
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
466
466
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
@@ -477,7 +477,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
|
|
|
477
477
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
478
478
|
};
|
|
479
479
|
function Ul(o, e) {
|
|
480
|
-
return
|
|
480
|
+
return i(), d("svg", Dl, e[0] || (e[0] = [
|
|
481
481
|
l("path", {
|
|
482
482
|
stroke: "none",
|
|
483
483
|
d: "M0 0h24v24H0z",
|
|
@@ -497,7 +497,7 @@ const Pl = /* @__PURE__ */ X(Ol, [["render", Ul]]), Rl = {}, Hl = {
|
|
|
497
497
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
498
498
|
};
|
|
499
499
|
function Nl(o, e) {
|
|
500
|
-
return
|
|
500
|
+
return i(), d("svg", Hl, e[0] || (e[0] = [
|
|
501
501
|
l("path", {
|
|
502
502
|
stroke: "none",
|
|
503
503
|
d: "M0 0h24v24H0z",
|
|
@@ -519,7 +519,7 @@ const ql = /* @__PURE__ */ X(Rl, [["render", Nl]]), Wl = {}, Gl = {
|
|
|
519
519
|
"stroke-linejoin": "round"
|
|
520
520
|
};
|
|
521
521
|
function Zl(o, e) {
|
|
522
|
-
return
|
|
522
|
+
return i(), d("svg", Gl, e[0] || (e[0] = [
|
|
523
523
|
l("path", {
|
|
524
524
|
stroke: "none",
|
|
525
525
|
d: "M0 0h24v24H0z",
|
|
@@ -538,7 +538,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
538
538
|
class: "text-red-500 text-[14px]"
|
|
539
539
|
}, Xl = ["title"], Ql = ["disabled"], Bt = /* @__PURE__ */ U({
|
|
540
540
|
__name: "vs-input-switcher",
|
|
541
|
-
props: /* @__PURE__ */
|
|
541
|
+
props: /* @__PURE__ */ re({
|
|
542
542
|
rules: { default: () => [] },
|
|
543
543
|
view: { default: "checkbox" },
|
|
544
544
|
label: { default: "" },
|
|
@@ -558,29 +558,29 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
558
558
|
emits: ["update:modelValue"],
|
|
559
559
|
setup(o) {
|
|
560
560
|
const e = o, t = ue(o, "modelValue");
|
|
561
|
-
return (
|
|
561
|
+
return (a, n) => e.view === "checkbox" ? (i(), d("div", Jl, [
|
|
562
562
|
A(St, {
|
|
563
563
|
modelValue: t.value,
|
|
564
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
565
|
-
label:
|
|
566
|
-
error:
|
|
564
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => t.value = s),
|
|
565
|
+
label: a.text,
|
|
566
|
+
error: a.error || ""
|
|
567
567
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
a.rules?.includes("required") ? (i(), d("span", Yl, "*")) : D("", !0),
|
|
569
|
+
a.i ? (i(), d("button", {
|
|
570
570
|
key: 1,
|
|
571
571
|
class: "cursor-pointer",
|
|
572
|
-
title:
|
|
572
|
+
title: a.i,
|
|
573
573
|
onClick: n[1] || (n[1] = we(() => {
|
|
574
574
|
}, ["prevent"]))
|
|
575
575
|
}, [
|
|
576
576
|
A(ee(Kl), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
577
577
|
], 8, Xl)) : D("", !0)
|
|
578
|
-
])) : (
|
|
578
|
+
])) : (i(), d("button", {
|
|
579
579
|
key: 1,
|
|
580
580
|
type: "button",
|
|
581
|
-
class: E(["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-${
|
|
582
|
-
disabled:
|
|
583
|
-
onClick: n[2] || (n[2] = (
|
|
581
|
+
class: E(["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-${a.style?.primaryColor || "blue"}-500` : "bg-stone-200", a.customClass]]),
|
|
582
|
+
disabled: a.disabled,
|
|
583
|
+
onClick: n[2] || (n[2] = (s) => t.value = !t.value)
|
|
584
584
|
}, [
|
|
585
585
|
l("span", {
|
|
586
586
|
"data-state": "checked",
|
|
@@ -602,7 +602,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
602
602
|
placeholder: {}
|
|
603
603
|
},
|
|
604
604
|
setup(o) {
|
|
605
|
-
return (e, t) => (
|
|
605
|
+
return (e, t) => (i(), d("div", {
|
|
606
606
|
id: e.name,
|
|
607
607
|
class: E(["text-gray-900", e.customClass]),
|
|
608
608
|
innerHTML: e.html ? e.html : e.text
|
|
@@ -610,7 +610,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
610
610
|
}
|
|
611
611
|
}), to = ["placeholder", "disabled", "name"], lo = /* @__PURE__ */ U({
|
|
612
612
|
__name: "vs-input-mask",
|
|
613
|
-
props: /* @__PURE__ */
|
|
613
|
+
props: /* @__PURE__ */ re({
|
|
614
614
|
name: {},
|
|
615
615
|
mask: { default: "" },
|
|
616
616
|
unmask: { type: Boolean, default: !1 },
|
|
@@ -626,12 +626,12 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
626
626
|
}),
|
|
627
627
|
emits: ["update:modelValue"],
|
|
628
628
|
setup(o) {
|
|
629
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
630
|
-
let
|
|
629
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue"), n = w(null);
|
|
630
|
+
let s = null;
|
|
631
631
|
return ke(async () => {
|
|
632
632
|
if (n.value) {
|
|
633
633
|
const { default: r } = await import("./index-W-qQIppj.js");
|
|
634
|
-
|
|
634
|
+
s = r(n.value, {
|
|
635
635
|
mask: e.mask || "",
|
|
636
636
|
definitions: {
|
|
637
637
|
9: /[0-9]/,
|
|
@@ -639,16 +639,16 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
639
639
|
"*": /[a-zA-Z0-9]/
|
|
640
640
|
},
|
|
641
641
|
lazy: !1
|
|
642
|
-
}),
|
|
643
|
-
|
|
644
|
-
}),
|
|
645
|
-
|
|
646
|
-
}),
|
|
642
|
+
}), s.on("accept", () => {
|
|
643
|
+
a.value = e.unmask ? s.unmaskedValue : s.value;
|
|
644
|
+
}), s.on("complete", () => {
|
|
645
|
+
a.value = e.unmask ? s.unmaskedValue : s.value;
|
|
646
|
+
}), s.value = a.value ?? "";
|
|
647
647
|
}
|
|
648
648
|
}), at(() => {
|
|
649
|
-
|
|
650
|
-
}),
|
|
651
|
-
|
|
649
|
+
s?.destroy();
|
|
650
|
+
}), ie(() => e.mask, (r) => {
|
|
651
|
+
s && s.updateOptions({
|
|
652
652
|
mask: r,
|
|
653
653
|
definitions: {
|
|
654
654
|
9: /[0-9]/,
|
|
@@ -656,9 +656,9 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
656
656
|
"*": /[a-zA-Z0-9]/
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
|
-
}),
|
|
660
|
-
|
|
661
|
-
}), (r,
|
|
659
|
+
}), ie(a, (r) => {
|
|
660
|
+
s && s.unmaskedValue !== r && (s.value = r || "");
|
|
661
|
+
}), (r, u) => (i(), d("input", {
|
|
662
662
|
type: "text",
|
|
663
663
|
ref_key: "inputEl",
|
|
664
664
|
ref: n,
|
|
@@ -673,7 +673,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
673
673
|
}
|
|
674
674
|
}), oo = { class: "relative w-full bg-white rounded-lg" }, no = ["placeholder", "disabled"], ao = /* @__PURE__ */ U({
|
|
675
675
|
__name: "vs-input-email",
|
|
676
|
-
props: /* @__PURE__ */
|
|
676
|
+
props: /* @__PURE__ */ re({
|
|
677
677
|
style: { default: () => ({}) },
|
|
678
678
|
customClass: { default: "" },
|
|
679
679
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -687,12 +687,12 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
687
687
|
}),
|
|
688
688
|
emits: ["update:modelValue"],
|
|
689
689
|
setup(o) {
|
|
690
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
691
|
-
return (n,
|
|
692
|
-
|
|
690
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
691
|
+
return (n, s) => (i(), d("div", oo, [
|
|
692
|
+
s[1] || (s[1] = ye('<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)),
|
|
693
693
|
ne(l("input", {
|
|
694
694
|
type: "email",
|
|
695
|
-
"onUpdate:modelValue":
|
|
695
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
696
696
|
placeholder: n.placeholder,
|
|
697
697
|
disabled: n.disabled,
|
|
698
698
|
class: E(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
|
|
@@ -700,13 +700,13 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
700
700
|
border: "1px solid #CFD9E0"
|
|
701
701
|
}
|
|
702
702
|
}, null, 10, no), [
|
|
703
|
-
[ve,
|
|
703
|
+
[ve, a.value]
|
|
704
704
|
])
|
|
705
705
|
]));
|
|
706
706
|
}
|
|
707
707
|
}), so = ["value", "disabled"], ro = { class: "text-[13px] text-gray-700" }, io = /* @__PURE__ */ U({
|
|
708
708
|
__name: "vs-input-radio-default",
|
|
709
|
-
props: /* @__PURE__ */
|
|
709
|
+
props: /* @__PURE__ */ re({
|
|
710
710
|
style: {},
|
|
711
711
|
customClass: { default: "" },
|
|
712
712
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -723,11 +723,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
723
723
|
emits: ["update:modelValue"],
|
|
724
724
|
setup(o) {
|
|
725
725
|
const e = ue(o, "modelValue");
|
|
726
|
-
return (t,
|
|
726
|
+
return (t, a) => (i(), d("label", {
|
|
727
727
|
class: E(["flex items-center gap-0", [t.customClass]])
|
|
728
728
|
}, [
|
|
729
729
|
ne(l("input", {
|
|
730
|
-
"onUpdate:modelValue":
|
|
730
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
|
|
731
731
|
type: "radio",
|
|
732
732
|
value: t.value,
|
|
733
733
|
disabled: t.disabled,
|
|
@@ -741,17 +741,17 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
741
741
|
t.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
742
742
|
]])
|
|
743
743
|
}, [
|
|
744
|
-
e.value == t.value ? (
|
|
744
|
+
e.value == t.value ? (i(), d("span", {
|
|
745
745
|
key: 0,
|
|
746
746
|
class: E(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
|
|
747
747
|
}, null, 2)) : D("", !0)
|
|
748
748
|
], 2),
|
|
749
|
-
l("span", ro,
|
|
749
|
+
l("span", ro, G(t.text), 1)
|
|
750
750
|
], 2));
|
|
751
751
|
}
|
|
752
752
|
}), uo = ["value", "disabled"], co = { class: "text-[13px] text-gray-700" }, po = /* @__PURE__ */ U({
|
|
753
753
|
__name: "vs-input-radio-buttons",
|
|
754
|
-
props: /* @__PURE__ */
|
|
754
|
+
props: /* @__PURE__ */ re({
|
|
755
755
|
style: {},
|
|
756
756
|
customClass: { default: "" },
|
|
757
757
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -768,14 +768,14 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
768
768
|
emits: ["update:modelValue"],
|
|
769
769
|
setup(o) {
|
|
770
770
|
const e = ue(o, "modelValue");
|
|
771
|
-
return (t,
|
|
771
|
+
return (t, a) => (i(), d("label", {
|
|
772
772
|
class: E(["flex items-center border rounded-lg px-2 py-1", [
|
|
773
773
|
e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
|
|
774
774
|
t.customClass
|
|
775
775
|
]])
|
|
776
776
|
}, [
|
|
777
777
|
ne(l("input", {
|
|
778
|
-
"onUpdate:modelValue":
|
|
778
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
|
|
779
779
|
type: "radio",
|
|
780
780
|
value: t.value,
|
|
781
781
|
disabled: t.disabled,
|
|
@@ -783,7 +783,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
783
783
|
}, null, 8, uo), [
|
|
784
784
|
[Vt, e.value]
|
|
785
785
|
]),
|
|
786
|
-
l("span", co,
|
|
786
|
+
l("span", co, G(t.text), 1)
|
|
787
787
|
], 2));
|
|
788
788
|
}
|
|
789
789
|
}), fo = {
|
|
@@ -791,7 +791,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
791
791
|
"vs-input-radio-buttons": po
|
|
792
792
|
}, gt = /* @__PURE__ */ U({
|
|
793
793
|
__name: "vs-input-radio",
|
|
794
|
-
props: /* @__PURE__ */
|
|
794
|
+
props: /* @__PURE__ */ re({
|
|
795
795
|
options: {},
|
|
796
796
|
position: { default: "vertical" },
|
|
797
797
|
view: { default: "default" },
|
|
@@ -808,17 +808,17 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
808
808
|
}),
|
|
809
809
|
emits: ["update:modelValue"],
|
|
810
810
|
setup(o) {
|
|
811
|
-
const e = o, t = ue(o, "modelValue"),
|
|
812
|
-
return (n,
|
|
811
|
+
const e = o, t = ue(o, "modelValue"), a = B(() => fo[`vs-input-radio-${e.view}`]);
|
|
812
|
+
return (n, s) => (i(), d("div", {
|
|
813
813
|
class: E([n.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
814
814
|
}, [
|
|
815
|
-
(
|
|
815
|
+
(i(!0), d(se, null, pe(n.options, (r) => (i(), me(Fe(a.value), Te({
|
|
816
816
|
key: r?.id,
|
|
817
817
|
text: r.text,
|
|
818
818
|
value: r.id.toString(),
|
|
819
819
|
checked: t.value === r.id,
|
|
820
820
|
modelValue: t.value,
|
|
821
|
-
"onUpdate:modelValue":
|
|
821
|
+
"onUpdate:modelValue": s[0] || (s[0] = (u) => t.value = u)
|
|
822
822
|
}, { ref_for: !0 }, n.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
823
823
|
], 2));
|
|
824
824
|
}
|
|
@@ -841,7 +841,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
841
841
|
},
|
|
842
842
|
emits: ["update:modelValue"],
|
|
843
843
|
setup(o, { emit: e }) {
|
|
844
|
-
const t = o,
|
|
844
|
+
const t = o, a = e, n = w([]), s = Nt({}), r = (f) => f?.value || f?.id || f?.text || f, u = (f) => f.text || String(f), c = (f) => `lg:col-span-${f || 12}`, p = async () => {
|
|
845
845
|
try {
|
|
846
846
|
const f = await fetch(`/api/suggest/${t.data}`).then((m) => m.json());
|
|
847
847
|
n.value = f?.data || f;
|
|
@@ -849,32 +849,32 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
849
849
|
console.error(f);
|
|
850
850
|
}
|
|
851
851
|
};
|
|
852
|
-
return
|
|
852
|
+
return ie(
|
|
853
853
|
() => t.modelValue,
|
|
854
854
|
(f) => {
|
|
855
855
|
if (typeof f == "boolean" && n.value.length === 1) {
|
|
856
856
|
const m = r(n.value[0]);
|
|
857
|
-
|
|
857
|
+
s[m] = f;
|
|
858
858
|
} else if (Array.isArray(f)) {
|
|
859
859
|
const m = new Set(f);
|
|
860
|
-
n.value.forEach((
|
|
861
|
-
if (!
|
|
862
|
-
const
|
|
863
|
-
|
|
860
|
+
n.value.forEach((y) => {
|
|
861
|
+
if (!y.disabled) {
|
|
862
|
+
const S = r(y);
|
|
863
|
+
s[S] = m.has(S);
|
|
864
864
|
}
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
},
|
|
868
868
|
{ immediate: !0 }
|
|
869
|
-
),
|
|
870
|
-
|
|
869
|
+
), ie(
|
|
870
|
+
s,
|
|
871
871
|
() => {
|
|
872
872
|
if (!n.value.length) {
|
|
873
|
-
|
|
873
|
+
a("update:modelValue", null);
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
|
-
const f = Object.entries(
|
|
877
|
-
|
|
876
|
+
const f = Object.entries(s).filter(([, m]) => m).map(([m]) => m);
|
|
877
|
+
a("update:modelValue", f.length === 0 ? [] : f);
|
|
878
878
|
},
|
|
879
879
|
{ deep: !0 }
|
|
880
880
|
), ke(() => {
|
|
@@ -882,43 +882,43 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
882
882
|
p().then(() => {
|
|
883
883
|
if (typeof t.modelValue == "boolean" && n.value.length === 1) {
|
|
884
884
|
const f = r(n.value[0]);
|
|
885
|
-
|
|
885
|
+
s[f] = t.modelValue;
|
|
886
886
|
} else if (Array.isArray(t.modelValue)) {
|
|
887
887
|
const f = new Set(t.modelValue);
|
|
888
888
|
n.value.forEach((m) => {
|
|
889
889
|
if (!m.disabled) {
|
|
890
|
-
const
|
|
891
|
-
|
|
890
|
+
const y = r(m);
|
|
891
|
+
s[y] = f.has(y);
|
|
892
892
|
}
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
895
|
});
|
|
896
896
|
else if (n.value = t.options, typeof t.modelValue == "boolean" && n.value.length === 1) {
|
|
897
897
|
const f = r(n.value[0]);
|
|
898
|
-
|
|
898
|
+
s[f] = t.modelValue;
|
|
899
899
|
} else if (Array.isArray(t.modelValue)) {
|
|
900
900
|
const f = new Set(t.modelValue);
|
|
901
901
|
n.value.forEach((m) => {
|
|
902
902
|
if (!m.disabled) {
|
|
903
|
-
const
|
|
904
|
-
|
|
903
|
+
const y = r(m);
|
|
904
|
+
s[y] = f.has(y);
|
|
905
905
|
}
|
|
906
906
|
});
|
|
907
907
|
}
|
|
908
|
-
}), (f, m) => (
|
|
908
|
+
}), (f, m) => (i(), d("div", {
|
|
909
909
|
class: E(["p-0 w-full gap-[6px]", [f.position === "vertical" ? "flex-col" : "", f.colSpan ? "grid" : "flex justify-start"]])
|
|
910
910
|
}, [
|
|
911
|
-
(
|
|
912
|
-
modelValue:
|
|
913
|
-
"onUpdate:modelValue": (
|
|
914
|
-
value: r(
|
|
911
|
+
(i(!0), d(se, null, pe(n.value, (y) => (i(), me(St, {
|
|
912
|
+
modelValue: s[r(y)],
|
|
913
|
+
"onUpdate:modelValue": (S) => s[r(y)] = S,
|
|
914
|
+
value: r(y),
|
|
915
915
|
class: E(c(f.colSpan)),
|
|
916
|
-
disabled:
|
|
917
|
-
label:
|
|
918
|
-
key: r(
|
|
919
|
-
icon:
|
|
920
|
-
imgUrl:
|
|
921
|
-
option:
|
|
916
|
+
disabled: y.disabled,
|
|
917
|
+
label: u(y),
|
|
918
|
+
key: r(y),
|
|
919
|
+
icon: y?.icon,
|
|
920
|
+
imgUrl: y?.imgUrl,
|
|
921
|
+
option: y,
|
|
922
922
|
view: f.view
|
|
923
923
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
|
|
924
924
|
], 2));
|
|
@@ -938,15 +938,15 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
938
938
|
emits: ["update:modelValue"],
|
|
939
939
|
setup(o, { emit: e }) {
|
|
940
940
|
const t = o;
|
|
941
|
-
function
|
|
941
|
+
function a(c) {
|
|
942
942
|
return c ? t.mode === "datetime" ? (c.includes("T") ? c : null) || c + (c.includes(" ") ? "" : "T00:00") : c?.split(" ")[0] : null;
|
|
943
943
|
}
|
|
944
|
-
const { inputClass: n } = _e(t.style),
|
|
945
|
-
get: () =>
|
|
946
|
-
set: (c) =>
|
|
947
|
-
}),
|
|
948
|
-
return (c, p) => ne((
|
|
949
|
-
type:
|
|
944
|
+
const { inputClass: n } = _e(t.style), s = e, r = B({
|
|
945
|
+
get: () => a(t.modelValue),
|
|
946
|
+
set: (c) => s("update:modelValue", c)
|
|
947
|
+
}), u = B(() => t.mode === "datetime" ? "datetime-local" : t.mode);
|
|
948
|
+
return (c, p) => ne((i(), d("input", {
|
|
949
|
+
type: u.value,
|
|
950
950
|
"onUpdate:modelValue": p[0] || (p[0] = (f) => r.value = f),
|
|
951
951
|
placeholder: c.placeholder,
|
|
952
952
|
disabled: c.disabled,
|
|
@@ -959,11 +959,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
959
959
|
[qt, r.value]
|
|
960
960
|
]);
|
|
961
961
|
}
|
|
962
|
-
}), bt = async (o, e, t,
|
|
962
|
+
}), bt = async (o, e, t, a) => {
|
|
963
963
|
try {
|
|
964
964
|
const n = new FormData();
|
|
965
965
|
return n.append("unique", "true"), n.append("file", o), (await fetch(
|
|
966
|
-
`/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${
|
|
966
|
+
`/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${a || ""}`,
|
|
967
967
|
{
|
|
968
968
|
method: "POST",
|
|
969
969
|
body: n
|
|
@@ -985,8 +985,8 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
985
985
|
}
|
|
986
986
|
}, yt = async (o) => {
|
|
987
987
|
try {
|
|
988
|
-
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(),
|
|
989
|
-
r.setAttribute("download", o), r.href = window.URL.createObjectURL(
|
|
988
|
+
const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), a = e.headers["content-type"], n = new TextDecoder("utf-8").decode(t), s = new Blob([n], { type: a }), r = document.createElement("a");
|
|
989
|
+
r.setAttribute("download", o), r.href = window.URL.createObjectURL(s), r.click();
|
|
990
990
|
} catch (e) {
|
|
991
991
|
console.error(e.message);
|
|
992
992
|
}
|
|
@@ -1002,7 +1002,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
|
|
|
1002
1002
|
"stroke-linejoin": "round"
|
|
1003
1003
|
};
|
|
1004
1004
|
function wo(o, e) {
|
|
1005
|
-
return
|
|
1005
|
+
return i(), d("svg", xo, e[0] || (e[0] = [
|
|
1006
1006
|
l("path", { d: "M5 12h14" }, null, -1),
|
|
1007
1007
|
l("path", { d: "M12 5v14" }, null, -1)
|
|
1008
1008
|
]));
|
|
@@ -1019,8 +1019,8 @@ const Re = /* @__PURE__ */ X(yo, [["render", wo]]), ko = {}, _o = {
|
|
|
1019
1019
|
"stroke-linecap": "round",
|
|
1020
1020
|
"stroke-linejoin": "round"
|
|
1021
1021
|
};
|
|
1022
|
-
function $o(o, e, t,
|
|
1023
|
-
return
|
|
1022
|
+
function $o(o, e, t, a, n, s) {
|
|
1023
|
+
return i(), d("svg", _o, e[0] || (e[0] = [
|
|
1024
1024
|
ye('<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)
|
|
1025
1025
|
]));
|
|
1026
1026
|
}
|
|
@@ -1036,8 +1036,8 @@ const Co = /* @__PURE__ */ X(ko, [["render", $o]]), Vo = {}, Mo = {
|
|
|
1036
1036
|
"stroke-linecap": "round",
|
|
1037
1037
|
"stroke-linejoin": "round"
|
|
1038
1038
|
};
|
|
1039
|
-
function Lo(o, e, t,
|
|
1040
|
-
return
|
|
1039
|
+
function Lo(o, e, t, a, n, s) {
|
|
1040
|
+
return i(), d("svg", Mo, e[0] || (e[0] = [
|
|
1041
1041
|
l("path", {
|
|
1042
1042
|
stroke: "none",
|
|
1043
1043
|
d: "M0 0h24v24H0z",
|
|
@@ -1076,7 +1076,7 @@ const So = /* @__PURE__ */ X(Vo, [["render", Lo]]), Bo = {}, jo = {
|
|
|
1076
1076
|
"stroke-linejoin": "round"
|
|
1077
1077
|
};
|
|
1078
1078
|
function Eo(o, e) {
|
|
1079
|
-
return
|
|
1079
|
+
return i(), d("svg", jo, e[0] || (e[0] = [
|
|
1080
1080
|
ye('<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)
|
|
1081
1081
|
]));
|
|
1082
1082
|
}
|
|
@@ -1092,8 +1092,8 @@ const jt = /* @__PURE__ */ X(Bo, [["render", Eo]]), Io = {}, zo = {
|
|
|
1092
1092
|
"stroke-linecap": "round",
|
|
1093
1093
|
"stroke-linejoin": "round"
|
|
1094
1094
|
};
|
|
1095
|
-
function Ao(o, e, t,
|
|
1096
|
-
return
|
|
1095
|
+
function Ao(o, e, t, a, n, s) {
|
|
1096
|
+
return i(), d("svg", zo, e[0] || (e[0] = [
|
|
1097
1097
|
ye('<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)
|
|
1098
1098
|
]));
|
|
1099
1099
|
}
|
|
@@ -1109,8 +1109,8 @@ const To = /* @__PURE__ */ X(Io, [["render", Ao]]), Fo = {}, Oo = {
|
|
|
1109
1109
|
"stroke-linecap": "round",
|
|
1110
1110
|
"stroke-linejoin": "round"
|
|
1111
1111
|
};
|
|
1112
|
-
function Do(o, e, t,
|
|
1113
|
-
return
|
|
1112
|
+
function Do(o, e, t, a, n, s) {
|
|
1113
|
+
return i(), d("svg", Oo, e[0] || (e[0] = [
|
|
1114
1114
|
ye('<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)
|
|
1115
1115
|
]));
|
|
1116
1116
|
}
|
|
@@ -1140,7 +1140,7 @@ const Uo = /* @__PURE__ */ X(Fo, [["render", Do]]), Po = (o) => {
|
|
|
1140
1140
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
1141
1141
|
};
|
|
1142
1142
|
function qo(o, e) {
|
|
1143
|
-
return
|
|
1143
|
+
return i(), d("svg", No, e[0] || (e[0] = [
|
|
1144
1144
|
ye('<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)
|
|
1145
1145
|
]));
|
|
1146
1146
|
}
|
|
@@ -1157,7 +1157,7 @@ const Qe = /* @__PURE__ */ X(Ho, [["render", qo]]), Wo = {}, Go = {
|
|
|
1157
1157
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1158
1158
|
};
|
|
1159
1159
|
function Zo(o, e) {
|
|
1160
|
-
return
|
|
1160
|
+
return i(), d("svg", Go, e[0] || (e[0] = [
|
|
1161
1161
|
l("path", {
|
|
1162
1162
|
stroke: "none",
|
|
1163
1163
|
d: "M0 0h24v24H0z",
|
|
@@ -1170,7 +1170,7 @@ function Zo(o, e) {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Jo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Yo = /* @__PURE__ */ U({
|
|
1172
1172
|
__name: "vs-input-file-list-item",
|
|
1173
|
-
props: /* @__PURE__ */
|
|
1173
|
+
props: /* @__PURE__ */ re({
|
|
1174
1174
|
format: {},
|
|
1175
1175
|
multiple: { type: Boolean },
|
|
1176
1176
|
style: {},
|
|
@@ -1188,19 +1188,19 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1188
1188
|
}),
|
|
1189
1189
|
emits: ["update:value", "update:item"],
|
|
1190
1190
|
setup(o) {
|
|
1191
|
-
const e = ue(o, "value"), t = ue(o, "item"),
|
|
1192
|
-
return (n,
|
|
1193
|
-
(
|
|
1191
|
+
const e = ue(o, "value"), t = ue(o, "item"), a = o;
|
|
1192
|
+
return (n, s) => (i(), d("div", Ko, [
|
|
1193
|
+
(i(), me(Fe(ee(Ro)(t.value)), {
|
|
1194
1194
|
src: t.value,
|
|
1195
1195
|
alt: "file",
|
|
1196
1196
|
class: "w-full h-full object-cover cursor-pointer",
|
|
1197
|
-
onClick:
|
|
1197
|
+
onClick: s[0] || (s[0] = (r) => ee(yt)(t.value))
|
|
1198
1198
|
}, null, 8, ["src"])),
|
|
1199
1199
|
l("div", Jo, [
|
|
1200
1200
|
l("button", {
|
|
1201
1201
|
type: "button",
|
|
1202
|
-
onClick:
|
|
1203
|
-
ee(bo)(t.value), e.value =
|
|
1202
|
+
onClick: s[1] || (s[1] = (r) => {
|
|
1203
|
+
ee(bo)(t.value), e.value = a.multiple ? e.value?.filter((u) => u !== t.value) : "";
|
|
1204
1204
|
}),
|
|
1205
1205
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
1206
1206
|
}, [
|
|
@@ -1208,7 +1208,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1208
1208
|
]),
|
|
1209
1209
|
l("button", {
|
|
1210
1210
|
type: "button",
|
|
1211
|
-
onClick:
|
|
1211
|
+
onClick: s[2] || (s[2] = (r) => ee(yt)(t.value)),
|
|
1212
1212
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
1213
1213
|
}, [
|
|
1214
1214
|
A(Et, { class: "w-4 h-4" })
|
|
@@ -1221,7 +1221,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1221
1221
|
class: "flex items-center flex-wrap gap-2"
|
|
1222
1222
|
}, tn = /* @__PURE__ */ U({
|
|
1223
1223
|
__name: "vs-input-file",
|
|
1224
|
-
props: /* @__PURE__ */
|
|
1224
|
+
props: /* @__PURE__ */ re({
|
|
1225
1225
|
format: {},
|
|
1226
1226
|
multiple: { type: Boolean },
|
|
1227
1227
|
style: {},
|
|
@@ -1235,59 +1235,59 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1235
1235
|
modelValue: {},
|
|
1236
1236
|
modelModifiers: {}
|
|
1237
1237
|
}),
|
|
1238
|
-
emits: ["update:modelValue"],
|
|
1239
|
-
setup(o) {
|
|
1240
|
-
const
|
|
1241
|
-
const { files:
|
|
1242
|
-
if (!(!
|
|
1243
|
-
if (
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1238
|
+
emits: /* @__PURE__ */ re(["change"], ["update:modelValue"]),
|
|
1239
|
+
setup(o, { emit: e }) {
|
|
1240
|
+
const t = o, a = ue(o, "modelValue"), n = e, s = w(null), r = (c) => Array.isArray(a.value) && a.value[c] || "", u = async (c) => {
|
|
1241
|
+
const { files: p } = c.target;
|
|
1242
|
+
if (!(!p || p.length === 0))
|
|
1243
|
+
if (t.multiple) {
|
|
1244
|
+
const f = Array.from(p).map(async (q) => t.format && !q.name.endsWith(t.format) ? null : await bt(q, "1", "form", "table")), S = (await Promise.all(f)).filter((q) => q !== null).map((q) => q?.file_path).filter(Boolean);
|
|
1245
|
+
a.value = [...a.value || [], ...S], n("change", a.value);
|
|
1246
1246
|
} else {
|
|
1247
|
-
const
|
|
1248
|
-
if (
|
|
1247
|
+
const f = p[0];
|
|
1248
|
+
if (t.format && !f.name.endsWith(t.format))
|
|
1249
1249
|
return;
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1250
|
+
const m = await bt(f, "1", "form", "table");
|
|
1251
|
+
a.value = m?.file_path, n("change", a.value || "");
|
|
1252
1252
|
}
|
|
1253
1253
|
};
|
|
1254
|
-
return (
|
|
1254
|
+
return (c, p) => (i(), d("div", Xo, [
|
|
1255
1255
|
l("input", {
|
|
1256
1256
|
class: "hidden",
|
|
1257
1257
|
ref_key: "fileInput",
|
|
1258
1258
|
ref: s,
|
|
1259
1259
|
type: "file",
|
|
1260
|
-
multiple:
|
|
1261
|
-
onChange:
|
|
1260
|
+
multiple: c.multiple,
|
|
1261
|
+
onChange: u
|
|
1262
1262
|
}, null, 40, Qo),
|
|
1263
|
-
!
|
|
1263
|
+
!c.multiple && a.value ? (i(), me(xt, {
|
|
1264
1264
|
key: 0,
|
|
1265
|
-
item:
|
|
1266
|
-
"onUpdate:item":
|
|
1267
|
-
value:
|
|
1268
|
-
"onUpdate:value":
|
|
1269
|
-
}, null, 8, ["item", "value"])) :
|
|
1270
|
-
(
|
|
1271
|
-
multiple:
|
|
1272
|
-
key:
|
|
1273
|
-
value:
|
|
1274
|
-
"onUpdate:value":
|
|
1275
|
-
item:
|
|
1265
|
+
item: a.value,
|
|
1266
|
+
"onUpdate:item": p[0] || (p[0] = (f) => a.value = f),
|
|
1267
|
+
value: a.value,
|
|
1268
|
+
"onUpdate:value": p[1] || (p[1] = (f) => a.value = f)
|
|
1269
|
+
}, null, 8, ["item", "value"])) : c.multiple ? (i(), d("div", en, [
|
|
1270
|
+
(i(!0), d(se, null, pe(a.value, (f, m) => (i(), me(xt, {
|
|
1271
|
+
multiple: c.multiple,
|
|
1272
|
+
key: m,
|
|
1273
|
+
value: a.value,
|
|
1274
|
+
"onUpdate:value": p[2] || (p[2] = (y) => a.value = y),
|
|
1275
|
+
item: r(m)
|
|
1276
1276
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
1277
1277
|
l("div", {
|
|
1278
|
-
onClick:
|
|
1278
|
+
onClick: p[3] || (p[3] = (f) => !c.disabled && s.value?.click()),
|
|
1279
1279
|
class: E([
|
|
1280
1280
|
"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",
|
|
1281
|
-
|
|
1281
|
+
c.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
1282
1282
|
])
|
|
1283
1283
|
}, [
|
|
1284
1284
|
A(Re, { class: "w-6 h-6" })
|
|
1285
1285
|
], 2)
|
|
1286
1286
|
])) : D("", !0),
|
|
1287
|
-
|
|
1287
|
+
c.multiple ? D("", !0) : (i(), d("div", {
|
|
1288
1288
|
key: 2,
|
|
1289
|
-
onClick:
|
|
1290
|
-
class: E([
|
|
1289
|
+
onClick: p[4] || (p[4] = (f) => s.value?.click()),
|
|
1290
|
+
class: E([c.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"])
|
|
1291
1291
|
}, [
|
|
1292
1292
|
A(Re, { class: "w-6 h-6" })
|
|
1293
1293
|
], 2))
|
|
@@ -1299,7 +1299,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1299
1299
|
item: { default: null }
|
|
1300
1300
|
},
|
|
1301
1301
|
setup(o) {
|
|
1302
|
-
const e = o, t =
|
|
1302
|
+
const e = o, t = B(() => {
|
|
1303
1303
|
try {
|
|
1304
1304
|
return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
|
|
1305
1305
|
day: "2-digit",
|
|
@@ -1310,24 +1310,24 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1310
1310
|
return "";
|
|
1311
1311
|
}
|
|
1312
1312
|
});
|
|
1313
|
-
function
|
|
1313
|
+
function a(n) {
|
|
1314
1314
|
if (n < 1024)
|
|
1315
1315
|
return `${n} B`;
|
|
1316
|
-
const
|
|
1317
|
-
return
|
|
1316
|
+
const s = n / 1024;
|
|
1317
|
+
return s < 1024 ? `${s.toFixed(2)} KB` : `${(s / 1024).toFixed(2)} MB`;
|
|
1318
1318
|
}
|
|
1319
|
-
return (n,
|
|
1320
|
-
|
|
1319
|
+
return (n, s) => (i(), d(se, null, [
|
|
1320
|
+
s[1] || (s[1] = ye('<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)),
|
|
1321
1321
|
l("div", ln, [
|
|
1322
|
-
l("p", on,
|
|
1322
|
+
l("p", on, G(n.item?.uploaded_name), 1),
|
|
1323
1323
|
l("p", nn, [
|
|
1324
|
-
l("span", null,
|
|
1324
|
+
l("span", null, G(n.item?.username), 1),
|
|
1325
1325
|
ne(l("span", an, "|", 512), [
|
|
1326
1326
|
[Xe, n.item?.username]
|
|
1327
1327
|
]),
|
|
1328
|
-
l("span", null,
|
|
1329
|
-
|
|
1330
|
-
l("span", sn,
|
|
1328
|
+
l("span", null, G(t.value), 1),
|
|
1329
|
+
s[0] || (s[0] = l("span", { class: "px-[5px]" }, "|", -1)),
|
|
1330
|
+
l("span", sn, G(a(n.item?.size)), 1)
|
|
1331
1331
|
])
|
|
1332
1332
|
])
|
|
1333
1333
|
], 64));
|
|
@@ -1353,50 +1353,50 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1353
1353
|
},
|
|
1354
1354
|
emits: ["update", "openModal", "openLightbox"],
|
|
1355
1355
|
setup(o, { emit: e }) {
|
|
1356
|
-
const t = o,
|
|
1356
|
+
const t = o, a = e;
|
|
1357
1357
|
function n(f) {
|
|
1358
1358
|
return ["pdf", "json"].includes(f.ext);
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function s(f) {
|
|
1361
1361
|
return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(f.ext);
|
|
1362
1362
|
}
|
|
1363
1363
|
function r(f) {
|
|
1364
1364
|
const m = document.createElement("a");
|
|
1365
1365
|
m.setAttribute("download", f?.uploaded_name), m.href = f?.file_path, m.click();
|
|
1366
1366
|
}
|
|
1367
|
-
async function
|
|
1367
|
+
async function u() {
|
|
1368
1368
|
try {
|
|
1369
1369
|
await fetch(
|
|
1370
1370
|
`${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
|
|
1371
|
-
),
|
|
1371
|
+
), a("update");
|
|
1372
1372
|
} catch (f) {
|
|
1373
1373
|
console.error(f);
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
function c() {
|
|
1377
|
-
|
|
1377
|
+
a("openModal", {
|
|
1378
1378
|
title: "Ви впевнені?",
|
|
1379
1379
|
message: "Ви впевнені, що хочете видалити цей файл?",
|
|
1380
1380
|
confirmButtonText: "Так, я впевнена/ий",
|
|
1381
1381
|
cancelButtonText: "Скасувати",
|
|
1382
|
-
confirm:
|
|
1382
|
+
confirm: u,
|
|
1383
1383
|
updateListOnConfirm: !0
|
|
1384
1384
|
});
|
|
1385
1385
|
}
|
|
1386
1386
|
function p(f) {
|
|
1387
|
-
(t.item.ext === "jpg" || t.item.ext === "png") &&
|
|
1387
|
+
(t.item.ext === "jpg" || t.item.ext === "png") && a("openLightbox", { item: t.item, index: f });
|
|
1388
1388
|
}
|
|
1389
|
-
return (f, m) => (
|
|
1390
|
-
f.item.ext === "jpg" || f.item.ext === "png" ? (
|
|
1389
|
+
return (f, m) => (i(), d("div", rn, [
|
|
1390
|
+
f.item.ext === "jpg" || f.item.ext === "png" ? (i(), d("div", un, [
|
|
1391
1391
|
l("div", {
|
|
1392
1392
|
class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
|
|
1393
|
-
onClick: m[0] || (m[0] = (
|
|
1393
|
+
onClick: m[0] || (m[0] = (y) => p(f.index))
|
|
1394
1394
|
}, [
|
|
1395
1395
|
A(Ke, { item: f.item }, null, 8, ["item"])
|
|
1396
1396
|
])
|
|
1397
|
-
])) : n(f.item) ? (
|
|
1397
|
+
])) : n(f.item) ? (i(), d("div", dn, [
|
|
1398
1398
|
A(Ke, { item: f.item }, null, 8, ["item"])
|
|
1399
|
-
])) :
|
|
1399
|
+
])) : s(f.item) ? (i(), d("div", cn, [
|
|
1400
1400
|
l("a", {
|
|
1401
1401
|
href: `/api/file-preview?id=${f.item.file_id}`,
|
|
1402
1402
|
target: "_blank",
|
|
@@ -1404,7 +1404,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1404
1404
|
}, [
|
|
1405
1405
|
A(Ke, { item: f.item }, null, 8, ["item"])
|
|
1406
1406
|
], 8, pn)
|
|
1407
|
-
])) : (
|
|
1407
|
+
])) : (i(), d("div", fn, [
|
|
1408
1408
|
A(Ke, { item: f.item }, null, 8, ["item"])
|
|
1409
1409
|
])),
|
|
1410
1410
|
l("div", mn, [
|
|
@@ -1412,7 +1412,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1412
1412
|
l("div", hn, [
|
|
1413
1413
|
l("button", {
|
|
1414
1414
|
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",
|
|
1415
|
-
onClick: m[1] || (m[1] = (
|
|
1415
|
+
onClick: m[1] || (m[1] = (y) => r(f.item))
|
|
1416
1416
|
}, [
|
|
1417
1417
|
A(Et, {
|
|
1418
1418
|
height: "14",
|
|
@@ -1425,7 +1425,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1425
1425
|
l("button", {
|
|
1426
1426
|
type: "button",
|
|
1427
1427
|
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",
|
|
1428
|
-
onClick: m[2] || (m[2] = (
|
|
1428
|
+
onClick: m[2] || (m[2] = (y) => c())
|
|
1429
1429
|
}, [
|
|
1430
1430
|
A(Qe, {
|
|
1431
1431
|
height: "14",
|
|
@@ -1450,7 +1450,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
|
|
|
1450
1450
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
1451
1451
|
};
|
|
1452
1452
|
function wn(o, e) {
|
|
1453
|
-
return
|
|
1453
|
+
return i(), d("svg", xn, e[0] || (e[0] = [
|
|
1454
1454
|
l("path", {
|
|
1455
1455
|
stroke: "none",
|
|
1456
1456
|
d: "M0 0h24v24H0z",
|
|
@@ -1482,9 +1482,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1482
1482
|
},
|
|
1483
1483
|
emits: ["update"],
|
|
1484
1484
|
setup(o, { emit: e }) {
|
|
1485
|
-
const t = o,
|
|
1486
|
-
const v =
|
|
1487
|
-
v !== -1 && (
|
|
1485
|
+
const t = o, a = ze("form"), n = B(() => a.value.formId), s = w(!1), r = w(0), u = e, c = w(!1), p = w({}), f = w([]), m = w(""), y = B(() => Array.isArray(f.value) ? f.value.filter((I) => I.ext === "jpg" || I.ext === "png").map((I) => I?.file_path) : []), S = B(() => m.value === "" ? f.value : f.value.filter((I) => I?.uploaded_name?.includes(m.value))), q = (I) => {
|
|
1486
|
+
const v = y.value.findIndex((x) => x === I.item.file_path);
|
|
1487
|
+
v !== -1 && (s.value = !0, r.value = v);
|
|
1488
1488
|
}, R = async () => {
|
|
1489
1489
|
try {
|
|
1490
1490
|
const I = await fetch(`${t.prefix}/widget/file/${n.value}`).then((v) => v.json());
|
|
@@ -1492,14 +1492,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1492
1492
|
} catch (I) {
|
|
1493
1493
|
console.error(I);
|
|
1494
1494
|
}
|
|
1495
|
-
},
|
|
1495
|
+
}, K = async (I) => {
|
|
1496
1496
|
await Promise.all(
|
|
1497
1497
|
Array.from(I.target.files).map(async (v) => {
|
|
1498
1498
|
const x = new FormData();
|
|
1499
1499
|
x.append("file", v);
|
|
1500
1500
|
try {
|
|
1501
1501
|
const V = `${t.prefix}/widget/file/${n.value}`, _ = await fetch(V, { method: "POST", body: x });
|
|
1502
|
-
return _.ok ? (
|
|
1502
|
+
return _.ok ? (u("update", "file-list"), v) : (de({
|
|
1503
1503
|
type: _.status >= 400 && _.status < 500 ? "warning" : "error",
|
|
1504
1504
|
title: "Error",
|
|
1505
1505
|
message: `Error code: ${_.status}`
|
|
@@ -1523,21 +1523,21 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1523
1523
|
}, H = (I) => {
|
|
1524
1524
|
p.value = T(I), c.value = !0;
|
|
1525
1525
|
};
|
|
1526
|
-
return
|
|
1526
|
+
return ie(n, (I) => {
|
|
1527
1527
|
I && R();
|
|
1528
1528
|
}), ke(() => {
|
|
1529
1529
|
n.value && R();
|
|
1530
1530
|
}), (I, v) => {
|
|
1531
1531
|
const x = mt("Lightbox"), V = mt("MessageBox");
|
|
1532
|
-
return
|
|
1532
|
+
return i(), d("div", _n, [
|
|
1533
1533
|
l("div", $n, [
|
|
1534
|
-
l("h2", Cn, " Файлів: " +
|
|
1534
|
+
l("h2", Cn, " Файлів: " + G(f.value?.length), 1),
|
|
1535
1535
|
l("div", Vn, [
|
|
1536
1536
|
l("label", null, [
|
|
1537
1537
|
l("input", {
|
|
1538
1538
|
type: "file",
|
|
1539
1539
|
class: "hidden",
|
|
1540
|
-
onChange: v[0] || (v[0] = (_) =>
|
|
1540
|
+
onChange: v[0] || (v[0] = (_) => K(_))
|
|
1541
1541
|
}, null, 32),
|
|
1542
1542
|
l("div", Mn, [
|
|
1543
1543
|
A(kn, {
|
|
@@ -1548,7 +1548,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1548
1548
|
])
|
|
1549
1549
|
])
|
|
1550
1550
|
]),
|
|
1551
|
-
f.value?.length > 4 ? (
|
|
1551
|
+
f.value?.length > 4 ? (i(), d("div", Ln, [
|
|
1552
1552
|
l("div", null, [
|
|
1553
1553
|
l("div", Sn, [
|
|
1554
1554
|
v[8] || (v[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
|
|
@@ -1588,26 +1588,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1588
1588
|
])
|
|
1589
1589
|
])
|
|
1590
1590
|
])) : D("", !0),
|
|
1591
|
-
f.value?.length ? (
|
|
1592
|
-
(
|
|
1591
|
+
f.value?.length ? (i(), d("div", Bn, [
|
|
1592
|
+
(i(!0), d(se, null, pe(S.value, (_, F) => (i(), me(bn, {
|
|
1593
1593
|
key: F,
|
|
1594
1594
|
prefix: I.prefix,
|
|
1595
1595
|
item: _,
|
|
1596
1596
|
index: F,
|
|
1597
1597
|
onUpdate: v[2] || (v[2] = (te) => I.$emit("update", "file-list")),
|
|
1598
1598
|
onOpenModal: v[3] || (v[3] = (te) => H(te)),
|
|
1599
|
-
onOpenLightbox: v[4] || (v[4] = (te) =>
|
|
1599
|
+
onOpenLightbox: v[4] || (v[4] = (te) => q(te))
|
|
1600
1600
|
}, null, 8, ["prefix", "item", "index"]))), 128)),
|
|
1601
|
-
|
|
1601
|
+
S.value.length ? D("", !0) : (i(), d("div", jn, v[9] || (v[9] = [
|
|
1602
1602
|
l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
|
|
1603
1603
|
])))
|
|
1604
1604
|
])) : D("", !0),
|
|
1605
1605
|
A(x, {
|
|
1606
|
-
modelValue:
|
|
1607
|
-
"onUpdate:modelValue": v[5] || (v[5] = (_) =>
|
|
1606
|
+
modelValue: s.value,
|
|
1607
|
+
"onUpdate:modelValue": v[5] || (v[5] = (_) => s.value = _),
|
|
1608
1608
|
startIndex: r.value,
|
|
1609
1609
|
"onUpdate:index": v[6] || (v[6] = (_) => r.value = _),
|
|
1610
|
-
images:
|
|
1610
|
+
images: y.value
|
|
1611
1611
|
}, null, 8, ["modelValue", "startIndex", "images"]),
|
|
1612
1612
|
A(V, Te({
|
|
1613
1613
|
modelValue: c.value,
|
|
@@ -1635,24 +1635,24 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1635
1635
|
},
|
|
1636
1636
|
setup(o) {
|
|
1637
1637
|
const e = o, t = w(e.isOpen);
|
|
1638
|
-
return
|
|
1638
|
+
return ie(
|
|
1639
1639
|
() => e.isOpen,
|
|
1640
|
-
(
|
|
1641
|
-
t.value =
|
|
1640
|
+
(a) => {
|
|
1641
|
+
t.value = a;
|
|
1642
1642
|
}
|
|
1643
|
-
), (
|
|
1643
|
+
), (a, n) => (i(), d("div", null, [
|
|
1644
1644
|
l("div", In, [
|
|
1645
|
-
l("p", zn,
|
|
1645
|
+
l("p", zn, G(o.title), 1),
|
|
1646
1646
|
A(Bt, {
|
|
1647
1647
|
modelValue: t.value,
|
|
1648
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
1648
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => t.value = s),
|
|
1649
1649
|
style: be(o.style)
|
|
1650
1650
|
}, null, 8, ["modelValue", "style"])
|
|
1651
1651
|
]),
|
|
1652
1652
|
A(st, { name: "slide-fade" }, {
|
|
1653
1653
|
default: Be(() => [
|
|
1654
1654
|
ne(l("div", An, [
|
|
1655
|
-
Le(
|
|
1655
|
+
Le(a.$slots, "default", {}, void 0, !0)
|
|
1656
1656
|
], 512), [
|
|
1657
1657
|
[Xe, t.value]
|
|
1658
1658
|
])
|
|
@@ -1679,26 +1679,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1679
1679
|
},
|
|
1680
1680
|
setup(o) {
|
|
1681
1681
|
const e = o, t = w(e.isOpen);
|
|
1682
|
-
return
|
|
1682
|
+
return ie(
|
|
1683
1683
|
() => e.isOpen,
|
|
1684
|
-
(
|
|
1685
|
-
t.value =
|
|
1684
|
+
(a) => {
|
|
1685
|
+
t.value = a;
|
|
1686
1686
|
}
|
|
1687
|
-
), (
|
|
1687
|
+
), (a, n) => (i(), d("div", null, [
|
|
1688
1688
|
l("button", {
|
|
1689
1689
|
type: "button",
|
|
1690
|
-
onClick: n[0] || (n[0] = (
|
|
1690
|
+
onClick: n[0] || (n[0] = (s) => t.value = !t.value),
|
|
1691
1691
|
class: "flex items-center gap-2"
|
|
1692
1692
|
}, [
|
|
1693
1693
|
A(ee(Pl), {
|
|
1694
1694
|
class: E(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
|
|
1695
1695
|
}, null, 8, ["class"]),
|
|
1696
|
-
l("span", On,
|
|
1696
|
+
l("span", On, G(o.title), 1)
|
|
1697
1697
|
]),
|
|
1698
1698
|
A(st, { name: "slide-fade" }, {
|
|
1699
1699
|
default: Be(() => [
|
|
1700
1700
|
ne(l("div", Dn, [
|
|
1701
|
-
Le(
|
|
1701
|
+
Le(a.$slots, "default", {}, void 0, !0)
|
|
1702
1702
|
], 512), [
|
|
1703
1703
|
[Xe, t.value]
|
|
1704
1704
|
])
|
|
@@ -1720,9 +1720,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1720
1720
|
}
|
|
1721
1721
|
},
|
|
1722
1722
|
setup(o) {
|
|
1723
|
-
return (e, t) => (
|
|
1723
|
+
return (e, t) => (i(), d("div", null, [
|
|
1724
1724
|
l("div", Rn, [
|
|
1725
|
-
l("p", null,
|
|
1725
|
+
l("p", null, G(o.title), 1)
|
|
1726
1726
|
]),
|
|
1727
1727
|
Le(e.$slots, "default")
|
|
1728
1728
|
]));
|
|
@@ -1795,26 +1795,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1795
1795
|
}
|
|
1796
1796
|
},
|
|
1797
1797
|
setup(o) {
|
|
1798
|
-
const e = o, t = ze("formValues", { default: {} }),
|
|
1799
|
-
const
|
|
1800
|
-
if (!
|
|
1801
|
-
const c = Array.isArray(
|
|
1802
|
-
return It(p,
|
|
1803
|
-
})),
|
|
1804
|
-
return (r,
|
|
1798
|
+
const e = o, t = ze("formValues", { default: {} }), a = ze("form"), n = B(() => e.schema?.filter((r) => {
|
|
1799
|
+
const u = r?.conditions;
|
|
1800
|
+
if (!u) return !0;
|
|
1801
|
+
const c = Array.isArray(u) ? u[0] : u, p = t?.value?.[c];
|
|
1802
|
+
return It(p, u);
|
|
1803
|
+
})), s = B(() => Nn[e.view]);
|
|
1804
|
+
return (r, u) => o.schema?.length ? (i(), me(Fe(s.value), {
|
|
1805
1805
|
key: 0,
|
|
1806
1806
|
title: o.title,
|
|
1807
1807
|
style: be(o.style)
|
|
1808
1808
|
}, {
|
|
1809
1809
|
default: Be(() => [
|
|
1810
|
-
(
|
|
1810
|
+
(i(!0), d(se, null, pe(n.value, (c) => (i(), me(zt, Te({
|
|
1811
1811
|
key: c.name
|
|
1812
1812
|
}, { ref_for: !0 }, c, {
|
|
1813
1813
|
item: c,
|
|
1814
1814
|
modelValue: ee(t)[c.name],
|
|
1815
1815
|
"onUpdate:modelValue": (p) => ee(t)[c.name] = p,
|
|
1816
1816
|
style: o.style,
|
|
1817
|
-
error: ee(
|
|
1817
|
+
error: ee(a)?.errors?.[c.name]
|
|
1818
1818
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
1819
1819
|
]),
|
|
1820
1820
|
_: 1
|
|
@@ -1854,106 +1854,106 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1854
1854
|
},
|
|
1855
1855
|
emits: ["change", "update:modelValue"],
|
|
1856
1856
|
setup(o, { emit: e }) {
|
|
1857
|
-
const t = o,
|
|
1857
|
+
const t = o, a = e, n = B(() => t.multiple), s = B(() => t.disabled);
|
|
1858
1858
|
_e(t.style);
|
|
1859
|
-
const r =
|
|
1859
|
+
const r = B({
|
|
1860
1860
|
get: () => t.modelValue,
|
|
1861
|
-
set: (h) =>
|
|
1861
|
+
set: (h) => a("update:modelValue", h)
|
|
1862
1862
|
});
|
|
1863
1863
|
!r.value && t.defaultValue && (r.value = t.defaultValue);
|
|
1864
|
-
const
|
|
1864
|
+
const u = w(null), c = w(null), p = w(null), f = w(null), m = w(!1), y = w(!1), S = w(null), q = w([]), R = w(-1), K = w([]), T = w(""), H = w(null), I = w("bottom"), v = w({}), x = w([]), V = B(() => {
|
|
1865
1865
|
if (!x.value.length) return [];
|
|
1866
|
-
const h = new Map(
|
|
1866
|
+
const h = new Map(q.value.map((g) => [g.id?.toString(), g]));
|
|
1867
1867
|
return x.value.map((g) => h.get(g?.toString())).filter((g) => !!g);
|
|
1868
|
-
}), _ =
|
|
1869
|
-
let h =
|
|
1868
|
+
}), _ = B(() => t.placeholder || "Select..."), F = B(() => W(S.value)), te = B(() => n.value ? !x.value.length && T.value === "" : !F.value && T.value === ""), J = B(() => s.value ? !1 : n.value ? x.value.length > 0 : !!r.value), M = (h) => n.value ? x.value.some((g) => g?.toString() === h?.toString()) : r.value?.toString() === h?.toString(), Z = B(() => {
|
|
1869
|
+
let h = q.value ?? [];
|
|
1870
1870
|
if (!t.data && T.value.trim() !== "") {
|
|
1871
1871
|
const g = T.value.toLowerCase();
|
|
1872
|
-
h = h.filter((
|
|
1873
|
-
const P =
|
|
1872
|
+
h = h.filter((C) => {
|
|
1873
|
+
const P = W(C).toLowerCase(), ae = C.text?.toLowerCase?.() || "";
|
|
1874
1874
|
return P.includes(g) || ae.includes(g);
|
|
1875
1875
|
});
|
|
1876
1876
|
}
|
|
1877
1877
|
if (n.value && x.value.length) {
|
|
1878
|
-
const g = new Set(x.value.map((
|
|
1879
|
-
h = h.filter((
|
|
1878
|
+
const g = new Set(x.value.map((C) => C?.toString()));
|
|
1879
|
+
h = h.filter((C) => !g.has(C.id?.toString()));
|
|
1880
1880
|
}
|
|
1881
1881
|
return h;
|
|
1882
|
-
}), N = ze("values"), le = /\{\{\s*([^}]+?)\s*\}\}/g, z = (h) => (h ? String(h) : "").replace(/<[^>]*>/g, "").trim(), j =
|
|
1882
|
+
}), N = ze("values"), le = /\{\{\s*([^}]+?)\s*\}\}/g, z = (h) => (h ? String(h) : "").replace(/<[^>]*>/g, "").trim(), j = B(() => t.slot ?? t?.optionTemplate ?? ""), $ = (h) => {
|
|
1883
1883
|
if (!h) return "";
|
|
1884
1884
|
const g = j.value;
|
|
1885
|
-
return g ? g.replace(le, (
|
|
1885
|
+
return g ? g.replace(le, (C, P) => {
|
|
1886
1886
|
const ae = P.trim(), fe = h[ae];
|
|
1887
1887
|
return fe != null ? String(fe) : "";
|
|
1888
1888
|
}) : h.text ?? "";
|
|
1889
|
-
},
|
|
1889
|
+
}, W = (h) => {
|
|
1890
1890
|
if (!h) return "";
|
|
1891
1891
|
if (!j.value) return h.text ?? "";
|
|
1892
|
-
const
|
|
1893
|
-
return z(
|
|
1892
|
+
const C = $(h);
|
|
1893
|
+
return z(C) || h.text || "";
|
|
1894
1894
|
}, oe = (h) => {
|
|
1895
|
-
t.set && N?.value && Object.entries(t.set).forEach(([g,
|
|
1895
|
+
t.set && N?.value && Object.entries(t.set).forEach(([g, C]) => {
|
|
1896
1896
|
if (!g) return;
|
|
1897
|
-
const P = h ? h[
|
|
1897
|
+
const P = h ? h[C] : null;
|
|
1898
1898
|
N.value[g] = P ?? null;
|
|
1899
1899
|
});
|
|
1900
|
-
},
|
|
1900
|
+
}, ce = B(() => t.parent ? N?.value?.[t.parent] ?? null : null), Ve = async (h) => {
|
|
1901
1901
|
if (!t.data) {
|
|
1902
1902
|
let g = t.options ?? [];
|
|
1903
1903
|
if (h?.trim()) {
|
|
1904
|
-
const
|
|
1904
|
+
const C = h.toLowerCase();
|
|
1905
1905
|
g = g.filter((P) => {
|
|
1906
|
-
const ae =
|
|
1907
|
-
return ae.includes(
|
|
1906
|
+
const ae = W(P).toLowerCase(), fe = P.text?.toLowerCase?.() || "";
|
|
1907
|
+
return ae.includes(C) || fe.includes(C);
|
|
1908
1908
|
});
|
|
1909
1909
|
}
|
|
1910
1910
|
return g;
|
|
1911
1911
|
}
|
|
1912
1912
|
try {
|
|
1913
|
-
const g = t.host ?? "",
|
|
1914
|
-
return fe.set("json", "1"), h && fe.set("key", h),
|
|
1913
|
+
const g = t.host ?? "", C = t.prefix ?? "api", P = t.api ?? `/${C}/suggest/${t.data}`, ae = `${g}${P}`, fe = new URLSearchParams();
|
|
1914
|
+
return fe.set("json", "1"), h && fe.set("key", h), ce.value !== void 0 && ce.value !== null && ce.value !== "" && fe.set("parent", String(ce.value)), (await fetch(`${ae}?${fe.toString()}`).then((Ae) => Ae.json()))?.data ?? [];
|
|
1915
1915
|
} catch {
|
|
1916
1916
|
return [];
|
|
1917
1917
|
}
|
|
1918
1918
|
}, Ne = async () => {
|
|
1919
|
-
t.data ?
|
|
1919
|
+
t.data ? q.value = await Ve(T.value) : q.value = t.options ? [...t.options] : [];
|
|
1920
1920
|
}, qe = async (h) => {
|
|
1921
1921
|
if (h == null) return null;
|
|
1922
|
-
const g =
|
|
1923
|
-
return g || ((await
|
|
1922
|
+
const g = q.value?.find((P) => P?.id?.toString() === String(h));
|
|
1923
|
+
return g || ((await Ve(String(h)))?.[0] ?? null);
|
|
1924
1924
|
}, et = async (h) => {
|
|
1925
|
-
const g = new Set(
|
|
1926
|
-
|
|
1925
|
+
const g = new Set(q.value.map((P) => P.id?.toString())), C = h.filter((P) => !g.has(P?.toString()));
|
|
1926
|
+
C.length && await C.reduce(async (P, ae) => {
|
|
1927
1927
|
await P;
|
|
1928
1928
|
const fe = await qe(ae);
|
|
1929
|
-
fe &&
|
|
1929
|
+
fe && q.value.push(fe);
|
|
1930
1930
|
}, Promise.resolve());
|
|
1931
1931
|
}, Oe = async () => {
|
|
1932
|
-
|
|
1933
|
-
|
|
1932
|
+
s.value || (m.value = !0, await Ne(), await Ie(() => {
|
|
1933
|
+
Me(), H.value?.focus(), Z.value.length ? R.value = 0 : R.value = -1;
|
|
1934
1934
|
}));
|
|
1935
1935
|
}, $e = () => {
|
|
1936
1936
|
m.value = !1, R.value = -1;
|
|
1937
|
-
},
|
|
1938
|
-
if (
|
|
1937
|
+
}, b = async (h) => {
|
|
1938
|
+
if (s.value) return;
|
|
1939
1939
|
!m.value ? await Oe() : $e();
|
|
1940
1940
|
}, k = async () => {
|
|
1941
1941
|
m.value ? H.value?.focus() : await Oe();
|
|
1942
|
-
},
|
|
1943
|
-
n.value ? (x.value = [], r.value = [],
|
|
1942
|
+
}, Y = () => {
|
|
1943
|
+
n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), oe(null), T.value = "", Ie(() => H.value?.focus());
|
|
1944
1944
|
}, O = (h) => {
|
|
1945
|
-
n.value && (x.value = x.value.filter((g) => g?.toString() !== h?.toString()), r.value = [...x.value],
|
|
1945
|
+
n.value && (x.value = x.value.filter((g) => g?.toString() !== h?.toString()), r.value = [...x.value], a("change", r.value), Ie(() => H.value?.focus()));
|
|
1946
1946
|
}, Q = (h) => {
|
|
1947
|
-
n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value],
|
|
1948
|
-
H.value?.focus(), R.value = Math.min(R.value,
|
|
1949
|
-
}), oe(null)) : (
|
|
1947
|
+
n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value], a("change", r.value)), T.value = "", Ie(() => {
|
|
1948
|
+
H.value?.focus(), R.value = Math.min(R.value, Z.value.length - 1);
|
|
1949
|
+
}), oe(null)) : (S.value = h, r.value = h.id, a("change", r.value), T.value = "", $e(), oe(h));
|
|
1950
1950
|
}, he = (h) => {
|
|
1951
1951
|
M(h.id) || Q(h);
|
|
1952
1952
|
}, Ce = (h, g) => {
|
|
1953
1953
|
if (!h || !g) return;
|
|
1954
|
-
const
|
|
1954
|
+
const C = h.offsetTop, P = C + h.offsetHeight, ae = g.scrollTop, fe = ae + g.clientHeight;
|
|
1955
1955
|
let Ee = g.scrollTop;
|
|
1956
|
-
|
|
1956
|
+
C < ae ? Ee = C - 80 : P > fe && (Ee = P - g.clientHeight + 4);
|
|
1957
1957
|
const Ae = g;
|
|
1958
1958
|
Ae.scrollTop = Ee;
|
|
1959
1959
|
}, Se = (h) => {
|
|
@@ -1961,19 +1961,19 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1961
1961
|
for (; g; ) {
|
|
1962
1962
|
if (g.classList.contains("ui-dialog__content"))
|
|
1963
1963
|
return g;
|
|
1964
|
-
const
|
|
1964
|
+
const C = window.getComputedStyle(g), P = C.overflow + C.overflowY + C.overflowX;
|
|
1965
1965
|
if (P.includes("auto") || P.includes("scroll") || g === document.body || g === document.documentElement)
|
|
1966
1966
|
return g;
|
|
1967
1967
|
g = g.parentElement;
|
|
1968
1968
|
}
|
|
1969
1969
|
return document.body;
|
|
1970
|
-
},
|
|
1970
|
+
}, Me = () => {
|
|
1971
1971
|
if (!c.value) return;
|
|
1972
|
-
const h = c.value.getBoundingClientRect(), g = window.innerHeight || document.documentElement.clientHeight,
|
|
1972
|
+
const h = c.value.getBoundingClientRect(), g = window.innerHeight || document.documentElement.clientHeight, C = window.innerWidth || document.documentElement.clientWidth, P = 8, ae = 8, fe = t.maxHeight || 300, Ee = g - h.bottom - ae - P, Ae = h.top - ae - P, Ze = Ee >= Ae, lt = Math.max(C - P * 2, 0);
|
|
1973
1973
|
let { width: De } = h;
|
|
1974
1974
|
lt > 0 && De > lt && (De = lt);
|
|
1975
1975
|
let { left: Ue } = h;
|
|
1976
|
-
Ue + De + P >
|
|
1976
|
+
Ue + De + P > C && (Ue = C - De - P), Ue = Math.max(Ue, P);
|
|
1977
1977
|
const Ht = Math.min(
|
|
1978
1978
|
fe,
|
|
1979
1979
|
Math.max(Ze ? Ee : Ae, 50)
|
|
@@ -1988,37 +1988,37 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
1988
1988
|
top: Ze ? `${h.bottom + ae}px` : `${h.top - ae}px`
|
|
1989
1989
|
};
|
|
1990
1990
|
}, je = async (h) => {
|
|
1991
|
-
|
|
1991
|
+
s.value || !m.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await Oe());
|
|
1992
1992
|
}, Tt = (h) => {
|
|
1993
1993
|
if (!m.value) return;
|
|
1994
1994
|
const { key: g } = h;
|
|
1995
1995
|
if (g === "ArrowDown")
|
|
1996
|
-
h.preventDefault(), R.value + 1 <
|
|
1996
|
+
h.preventDefault(), R.value + 1 < Z.value.length && (R.value += 1, Ce(K.value[R.value], p.value));
|
|
1997
1997
|
else if (g === "ArrowUp")
|
|
1998
|
-
h.preventDefault(), R.value > 0 && (R.value -= 1, Ce(
|
|
1998
|
+
h.preventDefault(), R.value > 0 && (R.value -= 1, Ce(K.value[R.value], p.value));
|
|
1999
1999
|
else if (g === "Enter") {
|
|
2000
2000
|
h.preventDefault();
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
} else g === "Escape" ? (h.preventDefault(), $e()) : g === "Backspace" ? n.value && T.value === "" && x.value.length && (x.value = x.value.slice(0, -1), r.value = [...x.value],
|
|
2001
|
+
const C = Z.value[R.value];
|
|
2002
|
+
C && Q(C), H.value?.blur();
|
|
2003
|
+
} else g === "Escape" ? (h.preventDefault(), $e()) : g === "Backspace" ? n.value && T.value === "" && x.value.length && (x.value = x.value.slice(0, -1), r.value = [...x.value], a("change", r.value)) : g === "Home" ? (R.value = 0, Ce(K.value[0], p.value)) : g === "End" ? (R.value = Z.value.length - 1, Ce(K.value[R.value], p.value)) : g === "Tab" && $e();
|
|
2004
2004
|
}, Ft = () => {
|
|
2005
|
-
|
|
2005
|
+
s.value || (y.value = !0);
|
|
2006
2006
|
}, Ot = () => {
|
|
2007
|
-
|
|
2007
|
+
y.value = !1, T.value = "";
|
|
2008
2008
|
}, rt = (h) => {
|
|
2009
2009
|
h.key === "Escape" && m.value && $e();
|
|
2010
2010
|
}, it = (h) => {
|
|
2011
2011
|
const g = h.target;
|
|
2012
|
-
|
|
2012
|
+
u.value?.contains(g) || f.value?.contains(g) || $e();
|
|
2013
2013
|
}, ut = (h) => {
|
|
2014
|
-
m.value && p.value && !p.value.contains(h.target) &&
|
|
2014
|
+
m.value && p.value && !p.value.contains(h.target) && Me();
|
|
2015
2015
|
}, dt = () => {
|
|
2016
|
-
m.value &&
|
|
2016
|
+
m.value && Me();
|
|
2017
2017
|
}, ct = () => {
|
|
2018
|
-
m.value &&
|
|
2018
|
+
m.value && Me();
|
|
2019
2019
|
};
|
|
2020
|
-
|
|
2021
|
-
h?.length && (
|
|
2020
|
+
ie(() => t.options, (h) => {
|
|
2021
|
+
h?.length && (q.value = [...h], We());
|
|
2022
2022
|
}, { immediate: !0 });
|
|
2023
2023
|
async function We() {
|
|
2024
2024
|
if (n.value)
|
|
@@ -2028,13 +2028,13 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2028
2028
|
const h = r.value[0] ?? null;
|
|
2029
2029
|
r.value = h ?? null;
|
|
2030
2030
|
}
|
|
2031
|
-
|
|
2031
|
+
S.value = await qe(r.value), oe(S.value ?? null);
|
|
2032
2032
|
}
|
|
2033
2033
|
}
|
|
2034
|
-
|
|
2034
|
+
ie(r, () => {
|
|
2035
2035
|
We();
|
|
2036
2036
|
}), ke(async () => {
|
|
2037
|
-
addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value && Se(c.value).addEventListener("scroll", ct, !0), t.options?.length ?
|
|
2037
|
+
addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value && Se(c.value).addEventListener("scroll", ct, !0), t.options?.length ? q.value = [...t.options] : t.data && (q.value = await Ve("")), await We();
|
|
2038
2038
|
}), Ye(() => {
|
|
2039
2039
|
removeEventListener("keydown", rt), removeEventListener("scroll", ut, !0), removeEventListener("resize", dt), document.removeEventListener("click", it, !0), c.value && Se(c.value).removeEventListener("scroll", ct, !0);
|
|
2040
2040
|
});
|
|
@@ -2042,14 +2042,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2042
2042
|
async function Dt() {
|
|
2043
2043
|
if (!t.add?.token || ft?.value.validate())
|
|
2044
2044
|
return;
|
|
2045
|
-
const g = t.add.api ?? `/api/table/${t.add.token}`, { id:
|
|
2045
|
+
const g = t.add.api ?? `/api/table/${t.add.token}`, { id: C } = await fetch(g, {
|
|
2046
2046
|
method: "POST",
|
|
2047
2047
|
headers: { "Content-Type": "application/json" },
|
|
2048
2048
|
body: JSON.stringify(tt.value)
|
|
2049
2049
|
}).then((P) => P.json());
|
|
2050
2050
|
if (!t.options?.length && t.data) {
|
|
2051
|
-
const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${
|
|
2052
|
-
|
|
2051
|
+
const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${C}`).then((ae) => ae.json());
|
|
2052
|
+
S.value = P[0], q.value.push(P[0]), r.value = C;
|
|
2053
2053
|
}
|
|
2054
2054
|
Ge.value = !1, de({ title: "Success!", message: "Object created." });
|
|
2055
2055
|
}
|
|
@@ -2059,26 +2059,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2059
2059
|
return pt.value = h.schema, Ge.value = !0, null;
|
|
2060
2060
|
}
|
|
2061
2061
|
function Pt(h, g = 200) {
|
|
2062
|
-
let
|
|
2062
|
+
let C;
|
|
2063
2063
|
return (...P) => {
|
|
2064
|
-
|
|
2064
|
+
C && clearTimeout(C), C = window.setTimeout(() => h(...P), g);
|
|
2065
2065
|
};
|
|
2066
2066
|
}
|
|
2067
2067
|
const Rt = Pt(async (h) => {
|
|
2068
|
-
|
|
2068
|
+
q.value = await Ve(h);
|
|
2069
2069
|
}, 200);
|
|
2070
|
-
return
|
|
2070
|
+
return ie(T, (h) => {
|
|
2071
2071
|
t.data && Rt(h.trim());
|
|
2072
|
-
}),
|
|
2073
|
-
!t.data && h?.length && (
|
|
2074
|
-
}, { immediate: !0 }),
|
|
2072
|
+
}), ie(() => t.options, (h) => {
|
|
2073
|
+
!t.data && h?.length && (q.value = [...h], We());
|
|
2074
|
+
}, { immediate: !0 }), ie(() => t.parent ?? t.parentValue, () => {
|
|
2075
2075
|
t.data && Ne();
|
|
2076
|
-
}),
|
|
2077
|
-
t.data && (n.value ? (x.value = [], r.value = [],
|
|
2078
|
-
}), (h, g) => (
|
|
2076
|
+
}), ie(ce, async () => {
|
|
2077
|
+
t.data && (n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)));
|
|
2078
|
+
}), (h, g) => (i(), d(se, null, [
|
|
2079
2079
|
A(ee(Lt), {
|
|
2080
2080
|
visible: Ge.value,
|
|
2081
|
-
"onUpdate:visible": g[1] || (g[1] = (
|
|
2081
|
+
"onUpdate:visible": g[1] || (g[1] = (C) => Ge.value = C),
|
|
2082
2082
|
title: "Додати",
|
|
2083
2083
|
buttonText: "Додати",
|
|
2084
2084
|
onDone: Dt,
|
|
@@ -2088,7 +2088,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2088
2088
|
A(He, {
|
|
2089
2089
|
schema: pt.value,
|
|
2090
2090
|
modelValue: tt.value,
|
|
2091
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
2091
|
+
"onUpdate:modelValue": g[0] || (g[0] = (C) => tt.value = C),
|
|
2092
2092
|
ref_key: "addForm",
|
|
2093
2093
|
ref: ft
|
|
2094
2094
|
}, null, 8, ["schema", "modelValue"])
|
|
@@ -2098,7 +2098,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2098
2098
|
l("div", {
|
|
2099
2099
|
class: "flex gap-1 w-full",
|
|
2100
2100
|
ref_key: "selectRoot",
|
|
2101
|
-
ref:
|
|
2101
|
+
ref: u,
|
|
2102
2102
|
onClick: g[4] || (g[4] = we(() => {
|
|
2103
2103
|
}, ["stop"]))
|
|
2104
2104
|
}, [
|
|
@@ -2120,47 +2120,47 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2120
2120
|
class: E([
|
|
2121
2121
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
2122
2122
|
"border-gray-300 hover:border-gray-400",
|
|
2123
|
-
m.value ||
|
|
2124
|
-
|
|
2123
|
+
m.value || y.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
2124
|
+
s.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
2125
2125
|
]),
|
|
2126
2126
|
role: "combobox",
|
|
2127
2127
|
"aria-expanded": m.value,
|
|
2128
2128
|
"aria-haspopup": "listbox",
|
|
2129
2129
|
onKeydown: je,
|
|
2130
2130
|
onClick: k,
|
|
2131
|
-
"data-focus": m.value ||
|
|
2131
|
+
"data-focus": m.value || y.value ? "true" : "false"
|
|
2132
2132
|
}, [
|
|
2133
2133
|
l("div", {
|
|
2134
2134
|
class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
2135
2135
|
ref_key: "triggerRef",
|
|
2136
2136
|
ref: c
|
|
2137
2137
|
}, [
|
|
2138
|
-
n.value && x.value.length ? (
|
|
2138
|
+
n.value && x.value.length ? (i(!0), d(se, { key: 0 }, pe(V.value, (C) => (i(), d("div", {
|
|
2139
2139
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
|
|
2140
|
-
key:
|
|
2140
|
+
key: C.id
|
|
2141
2141
|
}, [
|
|
2142
2142
|
l("div", aa, [
|
|
2143
|
-
|
|
2143
|
+
C?.color ? (i(), d("span", {
|
|
2144
2144
|
key: 0,
|
|
2145
2145
|
class: "w-[16px] h-[16px] rounded-md block ml-1.5",
|
|
2146
|
-
style: be({ backgroundColor:
|
|
2146
|
+
style: be({ backgroundColor: C?.color })
|
|
2147
2147
|
}, null, 4)) : D("", !0),
|
|
2148
2148
|
l("div", {
|
|
2149
2149
|
class: "truncate text-gray-900 overflow-hidden",
|
|
2150
|
-
title:
|
|
2150
|
+
title: W(C)
|
|
2151
2151
|
}, [
|
|
2152
|
-
j.value ? (
|
|
2152
|
+
j.value ? (i(), d("span", {
|
|
2153
2153
|
key: 0,
|
|
2154
|
-
innerHTML: C
|
|
2155
|
-
}, null, 8, ra)) : (
|
|
2156
|
-
ge(
|
|
2154
|
+
innerHTML: $(C)
|
|
2155
|
+
}, null, 8, ra)) : (i(), d(se, { key: 1 }, [
|
|
2156
|
+
ge(G(C.text), 1)
|
|
2157
2157
|
], 64))
|
|
2158
2158
|
], 8, sa)
|
|
2159
2159
|
]),
|
|
2160
2160
|
l("div", {
|
|
2161
2161
|
role: "button",
|
|
2162
2162
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
2163
|
-
onClick: we((P) => O(
|
|
2163
|
+
onClick: we((P) => O(C.id), ["stop"])
|
|
2164
2164
|
}, g[5] || (g[5] = [
|
|
2165
2165
|
l("svg", {
|
|
2166
2166
|
height: "14",
|
|
@@ -2173,28 +2173,28 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2173
2173
|
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" })
|
|
2174
2174
|
], -1)
|
|
2175
2175
|
]), 8, ia)
|
|
2176
|
-
]))), 128)) : !n.value && !
|
|
2176
|
+
]))), 128)) : !n.value && !y.value && F.value && T.value === "" ? (i(), d("div", {
|
|
2177
2177
|
key: 1,
|
|
2178
2178
|
class: E(["truncate text-gray-900"]),
|
|
2179
2179
|
title: F.value
|
|
2180
2180
|
}, [
|
|
2181
|
-
|
|
2181
|
+
S.value?.color ? (i(), d("span", {
|
|
2182
2182
|
key: 0,
|
|
2183
2183
|
class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
|
|
2184
|
-
style: be({ backgroundColor:
|
|
2184
|
+
style: be({ backgroundColor: S.value?.color })
|
|
2185
2185
|
}, null, 4)) : D("", !0),
|
|
2186
|
-
j.value ? (
|
|
2186
|
+
j.value ? (i(), d("span", {
|
|
2187
2187
|
key: 1,
|
|
2188
|
-
class: E({ "pl-5":
|
|
2189
|
-
innerHTML:
|
|
2190
|
-
}, null, 10, da)) : (
|
|
2188
|
+
class: E({ "pl-5": S.value?.color }),
|
|
2189
|
+
innerHTML: $(S.value)
|
|
2190
|
+
}, null, 10, da)) : (i(), d("span", {
|
|
2191
2191
|
key: 2,
|
|
2192
|
-
class: E({ "pl-5":
|
|
2193
|
-
},
|
|
2192
|
+
class: E({ "pl-5": S.value?.color })
|
|
2193
|
+
}, G(S.value?.text), 3))
|
|
2194
2194
|
], 8, ua)) : D("", !0),
|
|
2195
|
-
te.value ? (
|
|
2195
|
+
te.value ? (i(), d("div", ca, G(_.value), 1)) : D("", !0),
|
|
2196
2196
|
l("div", pa, [
|
|
2197
|
-
!
|
|
2197
|
+
!s.value && h.search ? ne((i(), d("input", {
|
|
2198
2198
|
key: 0,
|
|
2199
2199
|
ref_key: "inputRef",
|
|
2200
2200
|
ref: H,
|
|
@@ -2206,8 +2206,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2206
2206
|
type: "text",
|
|
2207
2207
|
tabindex: "0",
|
|
2208
2208
|
"aria-autocomplete": "list",
|
|
2209
|
-
placeholder: (n.value && x.value.length ? " " : null) ||
|
|
2210
|
-
"onUpdate:modelValue": g[2] || (g[2] = (
|
|
2209
|
+
placeholder: (n.value && x.value.length ? " " : null) || y.value && !T.value?.length && F.value || " ",
|
|
2210
|
+
"onUpdate:modelValue": g[2] || (g[2] = (C) => T.value = C),
|
|
2211
2211
|
onFocus: Ft,
|
|
2212
2212
|
onBlur: Ot,
|
|
2213
2213
|
onKeydown: Tt
|
|
@@ -2217,13 +2217,13 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2217
2217
|
])
|
|
2218
2218
|
], 512),
|
|
2219
2219
|
l("div", ma, [
|
|
2220
|
-
|
|
2220
|
+
J.value ? (i(), d("button", {
|
|
2221
2221
|
key: 0,
|
|
2222
2222
|
type: "button",
|
|
2223
2223
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2224
2224
|
"aria-hidden": "true",
|
|
2225
|
-
disabled:
|
|
2226
|
-
onClick: we(
|
|
2225
|
+
disabled: s.value,
|
|
2226
|
+
onClick: we(Y, ["stop"])
|
|
2227
2227
|
}, g[6] || (g[6] = [
|
|
2228
2228
|
l("svg", {
|
|
2229
2229
|
height: "20",
|
|
@@ -2239,8 +2239,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2239
2239
|
type: "button",
|
|
2240
2240
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
2241
2241
|
"aria-hidden": "true",
|
|
2242
|
-
disabled:
|
|
2243
|
-
onClick: g[3] || (g[3] = we((
|
|
2242
|
+
disabled: s.value,
|
|
2243
|
+
onClick: g[3] || (g[3] = we((C) => b(), ["stop"])),
|
|
2244
2244
|
title: m.value ? "Закрити список" : "Відкрити список"
|
|
2245
2245
|
}, g[7] || (g[7] = [
|
|
2246
2246
|
l("svg", {
|
|
@@ -2254,8 +2254,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2254
2254
|
]), 8, ha)
|
|
2255
2255
|
])
|
|
2256
2256
|
], 42, na),
|
|
2257
|
-
(
|
|
2258
|
-
m.value ? (
|
|
2257
|
+
(i(), me(Mt, { to: "body" }, [
|
|
2258
|
+
m.value ? (i(), d("div", {
|
|
2259
2259
|
key: 0,
|
|
2260
2260
|
ref_key: "dropdownRef",
|
|
2261
2261
|
ref: f,
|
|
@@ -2271,50 +2271,50 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2271
2271
|
ref_key: "listRef",
|
|
2272
2272
|
ref: p
|
|
2273
2273
|
}, [
|
|
2274
|
-
|
|
2275
|
-
key:
|
|
2274
|
+
Z.value.length ? (i(!0), d(se, { key: 0 }, pe(Z.value, (C, P) => (i(), d("div", {
|
|
2275
|
+
key: C.id,
|
|
2276
2276
|
ref_for: !0,
|
|
2277
|
-
ref: (ae) =>
|
|
2277
|
+
ref: (ae) => K.value[P] = ae,
|
|
2278
2278
|
class: E([
|
|
2279
2279
|
"flex px-3 py-2 cursor-default select-none text-gray-900 ",
|
|
2280
|
-
M(
|
|
2281
|
-
R.value === P && !M(
|
|
2280
|
+
M(C.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
|
|
2281
|
+
R.value === P && !M(C.id) ? "bg-blue-100" : ""
|
|
2282
2282
|
]),
|
|
2283
|
-
"aria-disabled": M(
|
|
2283
|
+
"aria-disabled": M(C.id) ? "true" : "false",
|
|
2284
2284
|
role: "option",
|
|
2285
2285
|
tabindex: "-1",
|
|
2286
|
-
onClick: (ae) => he(
|
|
2286
|
+
onClick: (ae) => he(C)
|
|
2287
2287
|
}, [
|
|
2288
|
-
|
|
2288
|
+
C?.color ? (i(), d("span", {
|
|
2289
2289
|
key: 0,
|
|
2290
2290
|
class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
|
|
2291
|
-
style: be({ backgroundColor:
|
|
2291
|
+
style: be({ backgroundColor: C?.color })
|
|
2292
2292
|
}, null, 4)) : D("", !0),
|
|
2293
2293
|
l("div", {
|
|
2294
2294
|
class: E([
|
|
2295
2295
|
"leading-[19px]",
|
|
2296
|
-
R.value ===
|
|
2296
|
+
R.value === C.id ? "text-white" : "",
|
|
2297
2297
|
// active style like react-select
|
|
2298
2298
|
(R.value === P, "")
|
|
2299
2299
|
])
|
|
2300
2300
|
}, [
|
|
2301
|
-
j.value ? (
|
|
2301
|
+
j.value ? (i(), d("span", {
|
|
2302
2302
|
key: 0,
|
|
2303
|
-
innerHTML: C
|
|
2304
|
-
}, null, 8, ba)) : (
|
|
2305
|
-
ge(
|
|
2303
|
+
innerHTML: $(C)
|
|
2304
|
+
}, null, 8, ba)) : (i(), d(se, { key: 1 }, [
|
|
2305
|
+
ge(G(C.text), 1)
|
|
2306
2306
|
], 64))
|
|
2307
2307
|
], 2)
|
|
2308
|
-
], 10, ga))), 128)) : (
|
|
2308
|
+
], 10, ga))), 128)) : (i(), d("div", ya, " No options "))
|
|
2309
2309
|
], 4)
|
|
2310
2310
|
], 4)) : D("", !0)
|
|
2311
2311
|
]))
|
|
2312
2312
|
], 2),
|
|
2313
|
-
t.add ? (
|
|
2313
|
+
t.add ? (i(), d("button", {
|
|
2314
2314
|
key: 0,
|
|
2315
2315
|
onClick: Ut,
|
|
2316
2316
|
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",
|
|
2317
|
-
disabled:
|
|
2317
|
+
disabled: s.value,
|
|
2318
2318
|
type: "button"
|
|
2319
2319
|
}, [
|
|
2320
2320
|
A(Re, {
|
|
@@ -2328,7 +2328,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2328
2328
|
}
|
|
2329
2329
|
}), wa = ["placeholder", "disabled"], ka = /* @__PURE__ */ U({
|
|
2330
2330
|
__name: "vs-input-textarea",
|
|
2331
|
-
props: /* @__PURE__ */
|
|
2331
|
+
props: /* @__PURE__ */ re({
|
|
2332
2332
|
style: { default: () => ({}) },
|
|
2333
2333
|
customClass: { default: "" },
|
|
2334
2334
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2342,9 +2342,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2342
2342
|
}),
|
|
2343
2343
|
emits: ["update:modelValue"],
|
|
2344
2344
|
setup(o) {
|
|
2345
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
2346
|
-
return (n,
|
|
2347
|
-
"onUpdate:modelValue":
|
|
2345
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
2346
|
+
return (n, s) => ne((i(), d("textarea", {
|
|
2347
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
|
|
2348
2348
|
placeholder: n.placeholder,
|
|
2349
2349
|
disabled: n.disabled,
|
|
2350
2350
|
row: "2",
|
|
@@ -2353,7 +2353,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2353
2353
|
border: "1px solid #CFD9E0"
|
|
2354
2354
|
}
|
|
2355
2355
|
}, null, 10, wa)), [
|
|
2356
|
-
[ve,
|
|
2356
|
+
[ve, a.value]
|
|
2357
2357
|
]);
|
|
2358
2358
|
}
|
|
2359
2359
|
}), _a = {}, $a = {
|
|
@@ -2367,7 +2367,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
|
|
|
2367
2367
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
|
|
2368
2368
|
};
|
|
2369
2369
|
function Ca(o, e) {
|
|
2370
|
-
return
|
|
2370
|
+
return i(), d("svg", $a, e[0] || (e[0] = [
|
|
2371
2371
|
l("path", {
|
|
2372
2372
|
stroke: "none",
|
|
2373
2373
|
d: "M0 0h24v24H0z",
|
|
@@ -2388,7 +2388,7 @@ const Va = /* @__PURE__ */ X(_a, [["render", Ca]]), Ma = {}, La = {
|
|
|
2388
2388
|
"stroke-linejoin": "round"
|
|
2389
2389
|
};
|
|
2390
2390
|
function Sa(o, e) {
|
|
2391
|
-
return
|
|
2391
|
+
return i(), d("svg", La, e[0] || (e[0] = [
|
|
2392
2392
|
l("path", { d: "m3 16 4 4 4-4" }, null, -1),
|
|
2393
2393
|
l("path", { d: "M7 20V4" }, null, -1),
|
|
2394
2394
|
l("path", { d: "m21 8-4-4-4 4" }, null, -1),
|
|
@@ -2407,7 +2407,7 @@ const Ba = /* @__PURE__ */ X(Ma, [["render", Sa]]), ja = {}, Ea = {
|
|
|
2407
2407
|
"stroke-linejoin": "round"
|
|
2408
2408
|
};
|
|
2409
2409
|
function Ia(o, e) {
|
|
2410
|
-
return
|
|
2410
|
+
return i(), d("svg", Ea, e[0] || (e[0] = [
|
|
2411
2411
|
l("path", {
|
|
2412
2412
|
stroke: "none",
|
|
2413
2413
|
d: "M0 0h24v24H0z",
|
|
@@ -2428,7 +2428,7 @@ const za = /* @__PURE__ */ X(ja, [["render", Ia]]), Aa = {}, Ta = {
|
|
|
2428
2428
|
"stroke-linejoin": "round"
|
|
2429
2429
|
};
|
|
2430
2430
|
function Fa(o, e) {
|
|
2431
|
-
return
|
|
2431
|
+
return i(), d("svg", Ta, e[0] || (e[0] = [
|
|
2432
2432
|
l("path", {
|
|
2433
2433
|
stroke: "none",
|
|
2434
2434
|
d: "M0 0h24v24H0z",
|
|
@@ -2449,7 +2449,7 @@ const Oa = /* @__PURE__ */ X(Aa, [["render", Fa]]), Da = {}, Ua = {
|
|
|
2449
2449
|
"stroke-linejoin": "round"
|
|
2450
2450
|
};
|
|
2451
2451
|
function Pa(o, e) {
|
|
2452
|
-
return
|
|
2452
|
+
return i(), d("svg", Ua, e[0] || (e[0] = [
|
|
2453
2453
|
ye('<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)
|
|
2454
2454
|
]));
|
|
2455
2455
|
}
|
|
@@ -2459,7 +2459,7 @@ const kt = /* @__PURE__ */ X(Da, [["render", Pa]]), Ra = {}, Ha = {
|
|
|
2459
2459
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2460
2460
|
};
|
|
2461
2461
|
function Na(o, e) {
|
|
2462
|
-
return
|
|
2462
|
+
return i(), d("svg", Ha, e[0] || (e[0] = [
|
|
2463
2463
|
ye('<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)
|
|
2464
2464
|
]));
|
|
2465
2465
|
}
|
|
@@ -2473,7 +2473,7 @@ const qa = /* @__PURE__ */ X(Ra, [["render", Na]]), Wa = {}, Ga = {
|
|
|
2473
2473
|
"stroke-linejoin": "round"
|
|
2474
2474
|
};
|
|
2475
2475
|
function Za(o, e) {
|
|
2476
|
-
return
|
|
2476
|
+
return i(), d("svg", Ga, e[0] || (e[0] = [
|
|
2477
2477
|
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)
|
|
2478
2478
|
]));
|
|
2479
2479
|
}
|
|
@@ -2492,7 +2492,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2492
2492
|
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"
|
|
2493
2493
|
}, _s = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, $s = { class: "flex items-center justify-center gap-2" }, Cs = ["onClick"], Vs = ["onClick"], Ms = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, Ls = /* @__PURE__ */ U({
|
|
2494
2494
|
__name: "vs-input-datatable",
|
|
2495
|
-
props: /* @__PURE__ */
|
|
2495
|
+
props: /* @__PURE__ */ re({
|
|
2496
2496
|
colModel: {},
|
|
2497
2497
|
style: {},
|
|
2498
2498
|
customClass: {},
|
|
@@ -2507,56 +2507,56 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2507
2507
|
}),
|
|
2508
2508
|
emits: ["update:modelValue"],
|
|
2509
2509
|
setup(o) {
|
|
2510
|
-
const e = o, t = ue(o, "modelValue"),
|
|
2510
|
+
const e = o, t = ue(o, "modelValue"), a = w({}), n = w(""), s = B(() => {
|
|
2511
2511
|
if (!n.value) return t.value ?? [];
|
|
2512
2512
|
const z = n.value.toLowerCase();
|
|
2513
|
-
return t.value.filter((j) => e.colModel?.some((
|
|
2514
|
-
const
|
|
2515
|
-
return
|
|
2513
|
+
return t.value.filter((j) => e.colModel?.some(($) => {
|
|
2514
|
+
const W = j[$.key];
|
|
2515
|
+
return W ? Array.isArray(W) ? W.join(", ").toLowerCase().includes(z) : String(W).toLowerCase().includes(z) : !1;
|
|
2516
2516
|
}));
|
|
2517
|
-
}), r = w(null),
|
|
2517
|
+
}), r = w(null), u = w(null), c = w(!1), p = w(null), f = w({ top: 0, left: 0 }), m = (z) => {
|
|
2518
2518
|
r.value = z;
|
|
2519
|
-
},
|
|
2520
|
-
|
|
2521
|
-
},
|
|
2519
|
+
}, y = (z) => {
|
|
2520
|
+
u.value = z;
|
|
2521
|
+
}, S = (z) => {
|
|
2522
2522
|
if (r.value === null || r.value === z) {
|
|
2523
|
-
r.value = null,
|
|
2523
|
+
r.value = null, u.value = null;
|
|
2524
2524
|
return;
|
|
2525
2525
|
}
|
|
2526
|
-
const j = [...t.value], [
|
|
2527
|
-
j.splice(z, 0,
|
|
2528
|
-
},
|
|
2529
|
-
const
|
|
2530
|
-
f.value = { top:
|
|
2526
|
+
const j = [...t.value], [$] = j.splice(r.value, 1);
|
|
2527
|
+
j.splice(z, 0, $), t.value = j, r.value = null, u.value = null;
|
|
2528
|
+
}, q = (z) => {
|
|
2529
|
+
const $ = z.currentTarget.getBoundingClientRect();
|
|
2530
|
+
f.value = { top: $.bottom + window.scrollY, left: $.left + window.scrollX }, c.value = !c.value;
|
|
2531
2531
|
}, R = () => {
|
|
2532
2532
|
p.value && p.value.click();
|
|
2533
|
-
},
|
|
2534
|
-
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"],
|
|
2535
|
-
return j.some((
|
|
2533
|
+
}, K = (z) => {
|
|
2534
|
+
const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], $ = z.toLowerCase();
|
|
2535
|
+
return j.some((W) => $.endsWith(W));
|
|
2536
2536
|
}, T = (z) => {
|
|
2537
|
-
const
|
|
2538
|
-
if (
|
|
2539
|
-
const
|
|
2540
|
-
|
|
2537
|
+
const $ = z.target.files?.[0];
|
|
2538
|
+
if (!$) return;
|
|
2539
|
+
const W = new FileReader();
|
|
2540
|
+
W.onload = (oe) => {
|
|
2541
2541
|
try {
|
|
2542
|
-
const
|
|
2543
|
-
if (typeof
|
|
2544
|
-
const
|
|
2545
|
-
Array.isArray(
|
|
2542
|
+
const ce = oe.target?.result;
|
|
2543
|
+
if (typeof ce == "string") {
|
|
2544
|
+
const Ve = JSON.parse(ce);
|
|
2545
|
+
Array.isArray(Ve) && t.value.push(...Ve);
|
|
2546
2546
|
}
|
|
2547
|
-
} catch (
|
|
2548
|
-
console.error("Error parsing file:",
|
|
2547
|
+
} catch (ce) {
|
|
2548
|
+
console.error("Error parsing file:", ce);
|
|
2549
2549
|
}
|
|
2550
|
-
},
|
|
2550
|
+
}, W.readAsText($);
|
|
2551
2551
|
}, H = () => {
|
|
2552
|
-
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }),
|
|
2553
|
-
|
|
2552
|
+
const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }), $ = URL.createObjectURL(j), W = document.createElement("a");
|
|
2553
|
+
W.href = $, W.download = "data.json", W.click(), URL.revokeObjectURL($);
|
|
2554
2554
|
};
|
|
2555
2555
|
ke(async () => {
|
|
2556
2556
|
const z = e.colModel?.filter((j) => j.data);
|
|
2557
2557
|
z?.length && Promise.all(z.map(async (j) => {
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2558
|
+
const W = await (await fetch(`/api/suggest/${j.data}`)).json();
|
|
2559
|
+
a.value[j.key] = W.data;
|
|
2560
2560
|
}));
|
|
2561
2561
|
});
|
|
2562
2562
|
const I = w(""), v = w(!1);
|
|
@@ -2565,29 +2565,29 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2565
2565
|
async function te() {
|
|
2566
2566
|
I.value = "Додати", v.value = !0, x = "add", _.value = {};
|
|
2567
2567
|
}
|
|
2568
|
-
function
|
|
2569
|
-
const
|
|
2570
|
-
return
|
|
2568
|
+
function J(z, j) {
|
|
2569
|
+
const $ = j.key || j.name;
|
|
2570
|
+
return a.value[$] && z[$] ? a.value[$].find((W) => W.id.toString() === z[$].toString())?.text ?? z[$] : z[$] || "-";
|
|
2571
2571
|
}
|
|
2572
2572
|
async function M(z, j) {
|
|
2573
2573
|
I.value = "Редагувати", v.value = !0, x = "edit", V = j, _.value = { ...z };
|
|
2574
2574
|
}
|
|
2575
|
-
function
|
|
2575
|
+
function Z() {
|
|
2576
2576
|
const z = F.value.validate();
|
|
2577
2577
|
if (z) {
|
|
2578
|
-
de({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j,
|
|
2578
|
+
de({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j, $]) => `${j}: ${$}`).join(`
|
|
2579
2579
|
`) });
|
|
2580
2580
|
return;
|
|
2581
2581
|
}
|
|
2582
|
-
x === "add" ? Array.isArray(t.value) ? t.value = [...t.value, _.value] : t.value = [_.value] : t.value = t.value.map((j,
|
|
2582
|
+
x === "add" ? Array.isArray(t.value) ? t.value = [...t.value, _.value] : t.value = [_.value] : t.value = t.value.map((j, $) => $ === V ? _.value : j), v.value = !1;
|
|
2583
2583
|
}
|
|
2584
2584
|
function N(z) {
|
|
2585
|
-
t.value = t.value.filter((j,
|
|
2585
|
+
t.value = t.value.filter((j, $) => $ !== z);
|
|
2586
2586
|
}
|
|
2587
2587
|
function le() {
|
|
2588
2588
|
v.value = !1;
|
|
2589
2589
|
}
|
|
2590
|
-
return (z, j) => (
|
|
2590
|
+
return (z, j) => (i(), d("div", Ja, [
|
|
2591
2591
|
l("div", Ya, [
|
|
2592
2592
|
l("div", Xa, [
|
|
2593
2593
|
A(Va, {
|
|
@@ -2597,7 +2597,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2597
2597
|
}),
|
|
2598
2598
|
ne(l("input", {
|
|
2599
2599
|
type: "text",
|
|
2600
|
-
"onUpdate:modelValue": j[0] || (j[0] = (
|
|
2600
|
+
"onUpdate:modelValue": j[0] || (j[0] = ($) => n.value = $),
|
|
2601
2601
|
placeholder: "Пошук",
|
|
2602
2602
|
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"
|
|
2603
2603
|
}, null, 512), [
|
|
@@ -2617,7 +2617,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2617
2617
|
l("div", ts, [
|
|
2618
2618
|
l("div", ls, [
|
|
2619
2619
|
l("button", {
|
|
2620
|
-
onClick:
|
|
2620
|
+
onClick: q,
|
|
2621
2621
|
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"
|
|
2622
2622
|
}, [
|
|
2623
2623
|
A(Ba, {
|
|
@@ -2629,8 +2629,8 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2629
2629
|
])
|
|
2630
2630
|
])
|
|
2631
2631
|
]),
|
|
2632
|
-
(
|
|
2633
|
-
c.value ? (
|
|
2632
|
+
(i(), me(Mt, { to: "body" }, [
|
|
2633
|
+
c.value ? (i(), d("div", {
|
|
2634
2634
|
key: 0,
|
|
2635
2635
|
class: "text-slate-700 vsTailwind vs-popover__content bottom",
|
|
2636
2636
|
style: be([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: f.value.top + "px", left: f.value.left + "px" }])
|
|
@@ -2646,7 +2646,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2646
2646
|
width: "14",
|
|
2647
2647
|
height: "14"
|
|
2648
2648
|
}),
|
|
2649
|
-
j[4] || (j[4] = ge(" Імпортувати "))
|
|
2649
|
+
j[4] || (j[4] = ge(" Імпортувати ", -1))
|
|
2650
2650
|
]),
|
|
2651
2651
|
l("button", {
|
|
2652
2652
|
onClick: H,
|
|
@@ -2658,7 +2658,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2658
2658
|
width: "14",
|
|
2659
2659
|
height: "14"
|
|
2660
2660
|
}),
|
|
2661
|
-
j[5] || (j[5] = ge(" Експортувати "))
|
|
2661
|
+
j[5] || (j[5] = ge(" Експортувати ", -1))
|
|
2662
2662
|
])
|
|
2663
2663
|
])
|
|
2664
2664
|
])
|
|
@@ -2670,7 +2670,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2670
2670
|
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"
|
|
2671
2671
|
}, [
|
|
2672
2672
|
A(Re),
|
|
2673
|
-
j[6] || (j[6] = ge(" Додати "))
|
|
2673
|
+
j[6] || (j[6] = ge(" Додати ", -1))
|
|
2674
2674
|
])
|
|
2675
2675
|
]),
|
|
2676
2676
|
l("div", ss, [
|
|
@@ -2684,17 +2684,17 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2684
2684
|
class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
|
|
2685
2685
|
})
|
|
2686
2686
|
]),
|
|
2687
|
-
(
|
|
2688
|
-
key:
|
|
2687
|
+
(i(!0), d(se, null, pe(z.colModel, ($) => (i(), d("th", {
|
|
2688
|
+
key: $.key,
|
|
2689
2689
|
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]"
|
|
2690
|
-
},
|
|
2690
|
+
}, G($.ua || $.label), 1))), 128)),
|
|
2691
2691
|
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))
|
|
2692
2692
|
])
|
|
2693
2693
|
]),
|
|
2694
2694
|
l("tbody", {
|
|
2695
|
-
class: E({ "[&_tr:last-child]:border-0": !
|
|
2695
|
+
class: E({ "[&_tr:last-child]:border-0": !u.value })
|
|
2696
2696
|
}, [
|
|
2697
|
-
|
|
2697
|
+
s.value.length === 0 ? (i(), d("td", cs, [
|
|
2698
2698
|
l("div", ps, [
|
|
2699
2699
|
l("div", fs, [
|
|
2700
2700
|
A(qa, { class: "w-48 mx-auto" }),
|
|
@@ -2705,16 +2705,16 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2705
2705
|
])
|
|
2706
2706
|
])
|
|
2707
2707
|
])) : D("", !0),
|
|
2708
|
-
(
|
|
2709
|
-
key:
|
|
2708
|
+
(i(!0), d(se, null, pe(s.value, ($, W) => (i(), d("tr", {
|
|
2709
|
+
key: $.id,
|
|
2710
2710
|
class: E(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
|
|
2711
|
-
"opacity-50": r.value ===
|
|
2712
|
-
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":
|
|
2711
|
+
"opacity-50": r.value === W,
|
|
2712
|
+
"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === W
|
|
2713
2713
|
}]),
|
|
2714
2714
|
draggable: "true",
|
|
2715
|
-
onDragstart: (oe) => m(
|
|
2716
|
-
onDragover: we((oe) =>
|
|
2717
|
-
onDrop: (oe) =>
|
|
2715
|
+
onDragstart: (oe) => m(W),
|
|
2716
|
+
onDragover: we((oe) => y(W), ["prevent"]),
|
|
2717
|
+
onDrop: (oe) => S(W)
|
|
2718
2718
|
}, [
|
|
2719
2719
|
l("td", vs, [
|
|
2720
2720
|
l("div", hs, [
|
|
@@ -2725,31 +2725,31 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2725
2725
|
})
|
|
2726
2726
|
])
|
|
2727
2727
|
]),
|
|
2728
|
-
(
|
|
2728
|
+
(i(!0), d(se, null, pe(z.colModel, (oe) => (i(), d("td", {
|
|
2729
2729
|
key: oe.key,
|
|
2730
2730
|
class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
|
|
2731
2731
|
}, [
|
|
2732
|
-
oe.type === "file" ? (
|
|
2733
|
-
|
|
2732
|
+
oe.type === "file" ? (i(), d("div", gs, [
|
|
2733
|
+
K(J($, oe)) ? (i(), d("div", bs, [
|
|
2734
2734
|
l("img", {
|
|
2735
|
-
src:
|
|
2735
|
+
src: J($, oe),
|
|
2736
2736
|
alt: "alt",
|
|
2737
2737
|
width: "45",
|
|
2738
2738
|
class: "rounded-md max-w-[45px] h-[45px] object-cover"
|
|
2739
2739
|
}, null, 8, ys)
|
|
2740
|
-
])) : (
|
|
2740
|
+
])) : (i(), d("div", xs, [
|
|
2741
2741
|
A(jt, { class: "w-[25px] min-w-[25px] h-[25px]" })
|
|
2742
2742
|
]))
|
|
2743
|
-
])) : oe.type === "tiptap-editor" ? (
|
|
2743
|
+
])) : oe.type === "tiptap-editor" ? (i(), d("div", {
|
|
2744
2744
|
key: 1,
|
|
2745
2745
|
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",
|
|
2746
|
-
innerHTML:
|
|
2747
|
-
}, null, 8, ws)) : (
|
|
2746
|
+
innerHTML: J($, oe)
|
|
2747
|
+
}, null, 8, ws)) : (i(), d("div", ks, G(J($, oe)), 1))
|
|
2748
2748
|
]))), 128)),
|
|
2749
2749
|
l("td", _s, [
|
|
2750
2750
|
l("div", $s, [
|
|
2751
2751
|
l("button", {
|
|
2752
|
-
onClick: (oe) => M(
|
|
2752
|
+
onClick: (oe) => M($, W),
|
|
2753
2753
|
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"
|
|
2754
2754
|
}, [
|
|
2755
2755
|
A(Ka, {
|
|
@@ -2759,7 +2759,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2759
2759
|
})
|
|
2760
2760
|
], 8, Cs),
|
|
2761
2761
|
l("button", {
|
|
2762
|
-
onClick: (oe) => N(
|
|
2762
|
+
onClick: (oe) => N(W),
|
|
2763
2763
|
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"
|
|
2764
2764
|
}, [
|
|
2765
2765
|
A(Qe, {
|
|
@@ -2784,18 +2784,18 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
|
|
|
2784
2784
|
A(He, {
|
|
2785
2785
|
schema: e.colModel,
|
|
2786
2786
|
values: _.value,
|
|
2787
|
-
"onUpdate:values": j[1] || (j[1] = (
|
|
2787
|
+
"onUpdate:values": j[1] || (j[1] = ($) => _.value = $),
|
|
2788
2788
|
form: F.value,
|
|
2789
|
-
"onUpdate:form": j[2] || (j[2] = (
|
|
2789
|
+
"onUpdate:form": j[2] || (j[2] = ($) => F.value = $)
|
|
2790
2790
|
}, null, 8, ["schema", "values", "form"]),
|
|
2791
2791
|
l("div", Ms, [
|
|
2792
2792
|
l("button", {
|
|
2793
2793
|
type: "button",
|
|
2794
|
-
onClick: j[3] || (j[3] = (
|
|
2794
|
+
onClick: j[3] || (j[3] = ($) => v.value = !1),
|
|
2795
2795
|
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"
|
|
2796
2796
|
}, " Скасувати "),
|
|
2797
2797
|
l("button", {
|
|
2798
|
-
onClick:
|
|
2798
|
+
onClick: Z,
|
|
2799
2799
|
type: "button",
|
|
2800
2800
|
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
2801
2801
|
}, " Зберегти ")
|
|
@@ -2950,7 +2950,7 @@ const js = {}, Es = {
|
|
|
2950
2950
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
|
|
2951
2951
|
};
|
|
2952
2952
|
function Is(o, e) {
|
|
2953
|
-
return
|
|
2953
|
+
return i(), d("svg", Es, e[0] || (e[0] = [
|
|
2954
2954
|
l("path", {
|
|
2955
2955
|
stroke: "none",
|
|
2956
2956
|
d: "M0 0h24v24H0z",
|
|
@@ -2971,7 +2971,7 @@ const zs = /* @__PURE__ */ X(js, [["render", Is]]), As = {}, Ts = {
|
|
|
2971
2971
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
|
|
2972
2972
|
};
|
|
2973
2973
|
function Fs(o, e) {
|
|
2974
|
-
return
|
|
2974
|
+
return i(), d("svg", Ts, e[0] || (e[0] = [
|
|
2975
2975
|
l("path", {
|
|
2976
2976
|
stroke: "none",
|
|
2977
2977
|
d: "M0 0h24v24H0z",
|
|
@@ -2993,7 +2993,7 @@ const Os = /* @__PURE__ */ X(As, [["render", Fs]]), Ds = {}, Us = {
|
|
|
2993
2993
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
|
|
2994
2994
|
};
|
|
2995
2995
|
function Ps(o, e) {
|
|
2996
|
-
return
|
|
2996
|
+
return i(), d("svg", Us, e[0] || (e[0] = [
|
|
2997
2997
|
ye('<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)
|
|
2998
2998
|
]));
|
|
2999
2999
|
}
|
|
@@ -3008,7 +3008,7 @@ const Rs = /* @__PURE__ */ X(Ds, [["render", Ps]]), Hs = {}, Ns = {
|
|
|
3008
3008
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
|
|
3009
3009
|
};
|
|
3010
3010
|
function qs(o, e) {
|
|
3011
|
-
return
|
|
3011
|
+
return i(), d("svg", Ns, e[0] || (e[0] = [
|
|
3012
3012
|
ye('<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)
|
|
3013
3013
|
]));
|
|
3014
3014
|
}
|
|
@@ -3021,7 +3021,7 @@ const Ws = /* @__PURE__ */ X(Hs, [["render", qs]]), Gs = {}, Zs = {
|
|
|
3021
3021
|
class: "fullscreen-icon"
|
|
3022
3022
|
};
|
|
3023
3023
|
function Ks(o, e) {
|
|
3024
|
-
return
|
|
3024
|
+
return i(), d("svg", Zs, e[0] || (e[0] = [
|
|
3025
3025
|
l("title", null, null, -1),
|
|
3026
3026
|
l("desc", null, null, -1),
|
|
3027
3027
|
l("defs", null, null, -1),
|
|
@@ -3060,48 +3060,48 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3060
3060
|
},
|
|
3061
3061
|
emits: ["goToCoordinates"],
|
|
3062
3062
|
setup(o, { emit: e }) {
|
|
3063
|
-
const t = o,
|
|
3063
|
+
const t = o, a = e, n = ["here", "xy", "parcel"], s = B(() => {
|
|
3064
3064
|
const v = t.config?.tools?.filter((x) => n.includes(x));
|
|
3065
3065
|
return v && v.length ? v : n;
|
|
3066
|
-
}), r =
|
|
3067
|
-
|
|
3068
|
-
v.includes(
|
|
3066
|
+
}), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u = w(s.value[0] ?? n[0]);
|
|
3067
|
+
ie(s, (v) => {
|
|
3068
|
+
v.includes(u.value) || (u.value = v[0]);
|
|
3069
3069
|
});
|
|
3070
3070
|
const c = w(""), p = w(!1), f = w(null);
|
|
3071
|
-
|
|
3071
|
+
ie(u, () => {
|
|
3072
3072
|
c.value = "", p.value = !1;
|
|
3073
3073
|
});
|
|
3074
3074
|
function m(v) {
|
|
3075
|
-
|
|
3075
|
+
u.value = v;
|
|
3076
3076
|
}
|
|
3077
|
-
function
|
|
3077
|
+
function y(v) {
|
|
3078
3078
|
if (!p.value) return;
|
|
3079
3079
|
const x = f.value;
|
|
3080
3080
|
x && !x.contains(v.target) && (p.value = !1);
|
|
3081
3081
|
}
|
|
3082
3082
|
ke(() => {
|
|
3083
|
-
window.addEventListener("click",
|
|
3083
|
+
window.addEventListener("click", y, !0);
|
|
3084
3084
|
}), at(() => {
|
|
3085
|
-
window.removeEventListener("click",
|
|
3085
|
+
window.removeEventListener("click", y, !0);
|
|
3086
3086
|
});
|
|
3087
|
-
function
|
|
3087
|
+
function S(v) {
|
|
3088
3088
|
return v === "xy" ? "Координати" : v === "parcel" ? "Кадастр" : "Адреси";
|
|
3089
3089
|
}
|
|
3090
|
-
function
|
|
3090
|
+
function q(v) {
|
|
3091
3091
|
const x = v.replace(/[,]+/g, " ").trim();
|
|
3092
3092
|
if (!x) return null;
|
|
3093
3093
|
const V = x.split(/\s+/).filter(Boolean);
|
|
3094
3094
|
if (V.length < 2) return null;
|
|
3095
3095
|
const _ = V.slice(0, 2).map(Number);
|
|
3096
3096
|
if (!_.every((le) => Number.isFinite(le))) return null;
|
|
3097
|
-
let [F, te] = _,
|
|
3098
|
-
const
|
|
3099
|
-
if (!
|
|
3100
|
-
if (
|
|
3101
|
-
|
|
3097
|
+
let [F, te] = _, J = F, M = te;
|
|
3098
|
+
const Z = (le) => Math.abs(le) <= 90, N = (le) => Math.abs(le) <= 180;
|
|
3099
|
+
if (!Z(J) || !N(M))
|
|
3100
|
+
if (Z(M) && N(J))
|
|
3101
|
+
J = te, M = F;
|
|
3102
3102
|
else
|
|
3103
3103
|
return null;
|
|
3104
|
-
return { lat:
|
|
3104
|
+
return { lat: J, lng: M };
|
|
3105
3105
|
}
|
|
3106
3106
|
function R(v) {
|
|
3107
3107
|
return (v?.items || []).map((V, _) => ({
|
|
@@ -3111,7 +3111,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3111
3111
|
lng: Number(V?.position?.lng)
|
|
3112
3112
|
})).filter((V) => Number.isFinite(V.lat) && Number.isFinite(V.lng));
|
|
3113
3113
|
}
|
|
3114
|
-
function
|
|
3114
|
+
function K(v) {
|
|
3115
3115
|
const x = v?.result || v?.data || v;
|
|
3116
3116
|
if (!x) return [];
|
|
3117
3117
|
const V = x.geom_centroid;
|
|
@@ -3133,13 +3133,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3133
3133
|
return V.every((F, te) => F.length === _[te] && /^\d+$/.test(F));
|
|
3134
3134
|
}
|
|
3135
3135
|
function H(v) {
|
|
3136
|
-
|
|
3136
|
+
a("goToCoordinates", [v.lat, v.lng]);
|
|
3137
3137
|
}
|
|
3138
3138
|
async function I() {
|
|
3139
3139
|
const v = c.value.trim();
|
|
3140
3140
|
if (v) {
|
|
3141
|
-
if (
|
|
3142
|
-
const x =
|
|
3141
|
+
if (u.value === "xy") {
|
|
3142
|
+
const x = q(v);
|
|
3143
3143
|
if (!x) {
|
|
3144
3144
|
de({ type: "warning", title: "Пошук координат", message: "Не знайдено або невірний формат координат" });
|
|
3145
3145
|
return;
|
|
@@ -3148,8 +3148,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3148
3148
|
return;
|
|
3149
3149
|
}
|
|
3150
3150
|
try {
|
|
3151
|
-
const x = new URL(
|
|
3152
|
-
if (
|
|
3151
|
+
const x = new URL(u.value === "here" ? lr : or);
|
|
3152
|
+
if (u.value === "here")
|
|
3153
3153
|
x.searchParams.set("searchtext", v);
|
|
3154
3154
|
else {
|
|
3155
3155
|
if (!T(v)) {
|
|
@@ -3160,7 +3160,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3160
3160
|
}
|
|
3161
3161
|
const V = await fetch(x.toString());
|
|
3162
3162
|
if (!V.ok) throw new Error(`HTTP ${V.status}`);
|
|
3163
|
-
const _ = await V.json(), F =
|
|
3163
|
+
const _ = await V.json(), F = u.value === "here" ? R(_) : K(_);
|
|
3164
3164
|
if (!F.length)
|
|
3165
3165
|
de({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
|
|
3166
3166
|
else {
|
|
@@ -3173,12 +3173,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3173
3173
|
}
|
|
3174
3174
|
}
|
|
3175
3175
|
}
|
|
3176
|
-
return (v, x) => (
|
|
3176
|
+
return (v, x) => (i(), d("div", Ys, [
|
|
3177
3177
|
l("form", {
|
|
3178
3178
|
class: "flex gap-2",
|
|
3179
3179
|
onSubmit: we(I, ["prevent"])
|
|
3180
3180
|
}, [
|
|
3181
|
-
|
|
3181
|
+
s.value.length > 1 ? (i(), d("div", {
|
|
3182
3182
|
key: 0,
|
|
3183
3183
|
ref_key: "dropdownRef",
|
|
3184
3184
|
ref: f,
|
|
@@ -3189,8 +3189,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3189
3189
|
class: "vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",
|
|
3190
3190
|
onClick: x[0] || (x[0] = (V) => p.value = !p.value)
|
|
3191
3191
|
}, [
|
|
3192
|
-
l("span", null,
|
|
3193
|
-
(
|
|
3192
|
+
l("span", null, G(S(u.value)), 1),
|
|
3193
|
+
(i(), d("svg", {
|
|
3194
3194
|
class: E(["w-4 h-4 text-gray-500 transition-transform", { "rotate-180": p.value }]),
|
|
3195
3195
|
viewBox: "0 0 24 24",
|
|
3196
3196
|
fill: "none",
|
|
@@ -3205,13 +3205,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3205
3205
|
}, null, -1)
|
|
3206
3206
|
]), 2))
|
|
3207
3207
|
]),
|
|
3208
|
-
p.value ? (
|
|
3208
|
+
p.value ? (i(), d("div", Xs, [
|
|
3209
3209
|
l("ul", null, [
|
|
3210
|
-
(
|
|
3210
|
+
(i(!0), d(se, null, pe(s.value, (V) => (i(), d("li", {
|
|
3211
3211
|
key: V,
|
|
3212
3212
|
class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
3213
3213
|
onClick: (_) => m(V)
|
|
3214
|
-
},
|
|
3214
|
+
}, G(S(V)), 9, Qs))), 128))
|
|
3215
3215
|
])
|
|
3216
3216
|
])) : D("", !0)
|
|
3217
3217
|
], 512)) : D("", !0),
|
|
@@ -3260,16 +3260,16 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3260
3260
|
},
|
|
3261
3261
|
emits: ["onLayerChange"],
|
|
3262
3262
|
setup(o, { emit: e }) {
|
|
3263
|
-
const
|
|
3264
|
-
function
|
|
3265
|
-
n("onLayerChange", r),
|
|
3263
|
+
const a = w(Object.keys(o.basemaps)[0]), n = e;
|
|
3264
|
+
function s(r) {
|
|
3265
|
+
n("onLayerChange", r), a.value = r;
|
|
3266
3266
|
}
|
|
3267
|
-
return (r,
|
|
3267
|
+
return (r, u) => (i(), d("div", sr, [
|
|
3268
3268
|
l("div", rr, [
|
|
3269
|
-
(
|
|
3269
|
+
(i(!0), d(se, null, pe(r.basemaps, (c, p) => (i(), d("div", {
|
|
3270
3270
|
key: p,
|
|
3271
|
-
class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300":
|
|
3272
|
-
onClick: (f) =>
|
|
3271
|
+
class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": a.value === p }]),
|
|
3272
|
+
onClick: (f) => s(p),
|
|
3273
3273
|
title: c.name || p,
|
|
3274
3274
|
role: "button",
|
|
3275
3275
|
tabindex: "0"
|
|
@@ -3310,59 +3310,59 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3310
3310
|
},
|
|
3311
3311
|
emits: ["update:modelValue"],
|
|
3312
3312
|
setup(o, { emit: e }) {
|
|
3313
|
-
const t = Wt(),
|
|
3314
|
-
function
|
|
3315
|
-
const
|
|
3313
|
+
const t = Wt(), a = o, n = e, s = w(!1), r = w("");
|
|
3314
|
+
function u() {
|
|
3315
|
+
const b = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
|
|
3316
3316
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Використовуйте два пальці для зуму карти." : "Використовуйте Ctrl + прокрутка для зуму карти.";
|
|
3317
3317
|
}
|
|
3318
3318
|
const c = w(null);
|
|
3319
|
-
let p, f, m,
|
|
3320
|
-
const
|
|
3321
|
-
|
|
3319
|
+
let p, f, m, y = null;
|
|
3320
|
+
const S = w(null), q = (b) => {
|
|
3321
|
+
b.ctrlKey && b.preventDefault();
|
|
3322
3322
|
};
|
|
3323
3323
|
function R() {
|
|
3324
|
-
if (!
|
|
3325
|
-
let
|
|
3324
|
+
if (!a.handleZoom) return null;
|
|
3325
|
+
let b;
|
|
3326
3326
|
const k = (O) => {
|
|
3327
3327
|
const Q = O.ctrlKey || O.metaKey, he = O.shiftKey;
|
|
3328
3328
|
if (!Q && !he) {
|
|
3329
|
-
|
|
3330
|
-
|
|
3329
|
+
s.value = !0, r.value = u(), clearTimeout(b), b = window.setTimeout(() => {
|
|
3330
|
+
s.value = !1;
|
|
3331
3331
|
}, 1e3);
|
|
3332
3332
|
return;
|
|
3333
3333
|
}
|
|
3334
|
-
|
|
3334
|
+
s.value = !1, p.scrollWheelZoom.enable(), setTimeout(() => {
|
|
3335
3335
|
p.scrollWheelZoom.disable();
|
|
3336
3336
|
}, 100);
|
|
3337
|
-
},
|
|
3337
|
+
}, Y = (O) => {
|
|
3338
3338
|
if (O.touches.length === 1) {
|
|
3339
|
-
|
|
3340
|
-
|
|
3339
|
+
s.value = !0, r.value = u(), clearTimeout(b), b = window.setTimeout(() => {
|
|
3340
|
+
s.value = !1;
|
|
3341
3341
|
}, 3e3);
|
|
3342
3342
|
return;
|
|
3343
3343
|
}
|
|
3344
|
-
|
|
3344
|
+
s.value = !1;
|
|
3345
3345
|
};
|
|
3346
|
-
return c.value && (c.value.addEventListener("wheel", k, { passive: !1 }), c.value.addEventListener("touchstart",
|
|
3346
|
+
return c.value && (c.value.addEventListener("wheel", k, { passive: !1 }), c.value.addEventListener("touchstart", Y, { passive: !0 })), p && p.on("wheel", (O) => {
|
|
3347
3347
|
const Q = O.originalEvent.ctrlKey || O.originalEvent.metaKey, he = O.originalEvent.shiftKey;
|
|
3348
3348
|
!Q && !he && (O.originalEvent.preventDefault(), O.originalEvent.stopPropagation());
|
|
3349
3349
|
}), () => {
|
|
3350
|
-
c.value && (c.value.removeEventListener("wheel", k), c.value.removeEventListener("touchstart",
|
|
3350
|
+
c.value && (c.value.removeEventListener("wheel", k), c.value.removeEventListener("touchstart", Y)), p && p.off("wheel"), clearTimeout(b);
|
|
3351
3351
|
};
|
|
3352
3352
|
}
|
|
3353
|
-
const
|
|
3353
|
+
const K = w(null), T = w(6), H = w(0), I = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), v = w(null), x = Oe();
|
|
3354
3354
|
let V;
|
|
3355
3355
|
const _ = w("topo100");
|
|
3356
|
-
function F(
|
|
3357
|
-
return
|
|
3356
|
+
function F(b) {
|
|
3357
|
+
return b ? b.type === "Polygon" ? {
|
|
3358
3358
|
type: "MultiPolygon",
|
|
3359
|
-
coordinates: [
|
|
3360
|
-
} : (
|
|
3359
|
+
coordinates: [b.coordinates]
|
|
3360
|
+
} : (b.type === "MultiPolygon", b) : null;
|
|
3361
3361
|
}
|
|
3362
3362
|
function te() {
|
|
3363
|
-
return new Promise((
|
|
3364
|
-
window.L && window.L.Draw &&
|
|
3365
|
-
const
|
|
3363
|
+
return new Promise((b, k) => {
|
|
3364
|
+
window.L && window.L.Draw && b(0);
|
|
3365
|
+
const Y = (Q) => {
|
|
3366
3366
|
if (Array.from(document.styleSheets).some((Se) => Se?.href?.includes(Q))) return;
|
|
3367
3367
|
const Ce = document.createElement("link");
|
|
3368
3368
|
Ce.rel = "stylesheet", Ce.href = Q, document.head.appendChild(Ce);
|
|
@@ -3372,14 +3372,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3372
3372
|
Se.addEventListener("load", () => he()), Se.addEventListener("error", (je) => Ce(je));
|
|
3373
3373
|
return;
|
|
3374
3374
|
}
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3375
|
+
const Me = document.createElement("script");
|
|
3376
|
+
Me.src = Q, Me.async = !0, Me.onload = () => he(), Me.onerror = (je) => Ce(je), document.body.appendChild(Me);
|
|
3377
3377
|
});
|
|
3378
|
-
|
|
3378
|
+
Y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), Y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => b(0)).catch(k);
|
|
3379
3379
|
});
|
|
3380
3380
|
}
|
|
3381
|
-
function
|
|
3382
|
-
const
|
|
3381
|
+
function J() {
|
|
3382
|
+
const b = f.toGeoJSON(), k = [], Y = (Q) => {
|
|
3383
3383
|
if (Q)
|
|
3384
3384
|
switch (Q.type) {
|
|
3385
3385
|
case "Polygon":
|
|
@@ -3389,99 +3389,99 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3389
3389
|
k.push(...Q.coordinates);
|
|
3390
3390
|
break;
|
|
3391
3391
|
case "GeometryCollection":
|
|
3392
|
-
(Q.geometries || []).forEach(
|
|
3392
|
+
(Q.geometries || []).forEach(Y);
|
|
3393
3393
|
break;
|
|
3394
3394
|
}
|
|
3395
3395
|
};
|
|
3396
|
-
(
|
|
3396
|
+
(b?.features || []).forEach((Q) => Y(Q.geometry));
|
|
3397
3397
|
const O = k.length ? { type: "MultiPolygon", coordinates: k } : null;
|
|
3398
3398
|
n("update:modelValue", O ? F(O) : null), H.value = f.getLayers().length;
|
|
3399
3399
|
}
|
|
3400
|
-
function M(
|
|
3400
|
+
function M(b = 30) {
|
|
3401
3401
|
const k = f.getLayers();
|
|
3402
3402
|
if (!k.length) return;
|
|
3403
3403
|
const O = L.featureGroup(k).getBounds();
|
|
3404
|
-
O && O.isValid() && p.fitBounds(O, { padding: [
|
|
3404
|
+
O && O.isValid() && p.fitBounds(O, { padding: [b, b] });
|
|
3405
3405
|
}
|
|
3406
|
-
function
|
|
3407
|
-
|
|
3406
|
+
function Z() {
|
|
3407
|
+
S.value?.click();
|
|
3408
3408
|
}
|
|
3409
3409
|
const N = w("");
|
|
3410
|
-
function le(
|
|
3411
|
-
return
|
|
3410
|
+
function le(b) {
|
|
3411
|
+
return b instanceof L.Circle ? "Circle" : b instanceof L.Rectangle ? "Rectangle" : b instanceof L.Polygon && !(b instanceof L.Rectangle) ? "Polygon" : b instanceof L.Polyline && !(b instanceof L.Polygon) ? "Polyline" : b instanceof L.Marker ? "Point" : "Feature";
|
|
3412
3412
|
}
|
|
3413
|
-
function z(
|
|
3414
|
-
if (
|
|
3415
|
-
const k =
|
|
3413
|
+
function z(b) {
|
|
3414
|
+
if (b instanceof L.Circle) {
|
|
3415
|
+
const k = b.getRadius();
|
|
3416
3416
|
return Math.PI * (k * k) / 1e6;
|
|
3417
3417
|
}
|
|
3418
|
-
if (
|
|
3418
|
+
if (b instanceof L.Polygon || b instanceof L.Rectangle)
|
|
3419
3419
|
try {
|
|
3420
|
-
const k =
|
|
3420
|
+
const k = b.getLatLngs(), Y = Array.isArray(k[0]) ? k[0] : k, O = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(Y) : 0;
|
|
3421
3421
|
return O ? O / 1e6 : 0;
|
|
3422
3422
|
} catch {
|
|
3423
3423
|
return null;
|
|
3424
3424
|
}
|
|
3425
3425
|
return null;
|
|
3426
3426
|
}
|
|
3427
|
-
function j(
|
|
3428
|
-
return
|
|
3427
|
+
function j(b) {
|
|
3428
|
+
return b instanceof L.Circle ? b.getLatLng() : b.getBounds ? b.getBounds().getCenter() : b.getLatLng ? b.getLatLng() : p.getCenter();
|
|
3429
3429
|
}
|
|
3430
|
-
function
|
|
3431
|
-
const
|
|
3432
|
-
if (!
|
|
3430
|
+
function $() {
|
|
3431
|
+
const b = f.getLayers();
|
|
3432
|
+
if (!b.length) {
|
|
3433
3433
|
v.value = null, H.value = 0;
|
|
3434
3434
|
return;
|
|
3435
3435
|
}
|
|
3436
|
-
const k =
|
|
3436
|
+
const k = b[b.length - 1], Y = le(k), O = j(k), Q = z(k);
|
|
3437
3437
|
v.value = {
|
|
3438
|
-
type:
|
|
3438
|
+
type: Y,
|
|
3439
3439
|
center: O,
|
|
3440
3440
|
areaKm2: Q,
|
|
3441
3441
|
layer: k
|
|
3442
|
-
}, H.value =
|
|
3442
|
+
}, H.value = b.length;
|
|
3443
3443
|
}
|
|
3444
|
-
function
|
|
3445
|
-
const
|
|
3446
|
-
|
|
3444
|
+
function W() {
|
|
3445
|
+
const b = v.value?.layer;
|
|
3446
|
+
b && (b instanceof L.Circle && b.getBounds ? p.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getBounds ? p.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getLatLng && p.setView(b.getLatLng(), Math.max(T.value, 14)));
|
|
3447
3447
|
}
|
|
3448
3448
|
function oe() {
|
|
3449
|
-
const
|
|
3450
|
-
|
|
3449
|
+
const b = v.value?.layer;
|
|
3450
|
+
b && (f.removeLayer(b), J(), $());
|
|
3451
3451
|
}
|
|
3452
3452
|
ke(async () => {
|
|
3453
|
-
document.addEventListener("wheel",
|
|
3454
|
-
const
|
|
3453
|
+
document.addEventListener("wheel", q, { passive: !1 }), await te(), L.drawLocal = Ss;
|
|
3454
|
+
const b = a.handleZoom;
|
|
3455
3455
|
p = L.map(c.value, {
|
|
3456
3456
|
zoomControl: !1,
|
|
3457
|
-
scrollWheelZoom: !
|
|
3457
|
+
scrollWheelZoom: !b
|
|
3458
3458
|
}).setView(I.value, 10), setTimeout(() => {
|
|
3459
|
-
|
|
3459
|
+
y = R();
|
|
3460
3460
|
}, 100), L.control.zoom({ position: "bottomright" }).addTo(p), _.value = Object.keys(x)[0], V = L.tileLayer(x[_.value].url, { maxZoom: 19, minZoom: 6 }).addTo(p), f = new L.FeatureGroup().addTo(p), p.on(L.Draw.Event.CREATED, (O) => {
|
|
3461
3461
|
const { layer: Q } = O;
|
|
3462
|
-
f.clearLayers(), f.addLayer(Q),
|
|
3462
|
+
f.clearLayers(), f.addLayer(Q), J(), $(), M(), N.value = "";
|
|
3463
3463
|
}), p.on(L.Draw.Event.EDITED, () => {
|
|
3464
|
-
|
|
3464
|
+
J(), $(), M();
|
|
3465
3465
|
}), p.on(L.Draw.Event.DELETED, () => {
|
|
3466
|
-
|
|
3466
|
+
J(), $(), M();
|
|
3467
3467
|
});
|
|
3468
3468
|
let k = !1;
|
|
3469
3469
|
p.on("mousemove", (O) => {
|
|
3470
|
-
k || (p.invalidateSize(), k = !0),
|
|
3470
|
+
k || (p.invalidateSize(), k = !0), K.value = O.latlng;
|
|
3471
3471
|
}), p.on("zoomend", () => {
|
|
3472
3472
|
T.value = p.getZoom();
|
|
3473
3473
|
});
|
|
3474
|
-
const
|
|
3475
|
-
if (
|
|
3474
|
+
const Y = Bs(a.modelValue);
|
|
3475
|
+
if (Y) {
|
|
3476
3476
|
const O = [];
|
|
3477
|
-
L.geoJSON(
|
|
3477
|
+
L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(), $(), M();
|
|
3478
3478
|
}
|
|
3479
3479
|
}), Ye(() => {
|
|
3480
|
-
document.removeEventListener("wheel",
|
|
3480
|
+
document.removeEventListener("wheel", q), y && y();
|
|
3481
3481
|
});
|
|
3482
|
-
function
|
|
3482
|
+
function ce(b) {
|
|
3483
3483
|
if (p) {
|
|
3484
|
-
switch (m && m.disable(),
|
|
3484
|
+
switch (m && m.disable(), b) {
|
|
3485
3485
|
case "marker":
|
|
3486
3486
|
m = new L.Draw.Marker(p);
|
|
3487
3487
|
break;
|
|
@@ -3498,16 +3498,16 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3498
3498
|
m = new L.Draw.Rectangle(p);
|
|
3499
3499
|
break;
|
|
3500
3500
|
}
|
|
3501
|
-
m && (m.enable(), N.value =
|
|
3501
|
+
m && (m.enable(), N.value = b);
|
|
3502
3502
|
}
|
|
3503
3503
|
}
|
|
3504
|
-
function
|
|
3505
|
-
const
|
|
3506
|
-
O.href =
|
|
3504
|
+
function Ve() {
|
|
3505
|
+
const b = f.toGeoJSON(), k = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }), Y = URL.createObjectURL(k), O = document.createElement("a");
|
|
3506
|
+
O.href = Y, O.download = "data.geojson", O.click(), URL.revokeObjectURL(Y);
|
|
3507
3507
|
}
|
|
3508
|
-
function Ne(
|
|
3509
|
-
const k =
|
|
3510
|
-
if (!
|
|
3508
|
+
function Ne(b) {
|
|
3509
|
+
const k = b.target, Y = k.files?.[0];
|
|
3510
|
+
if (!Y) return;
|
|
3511
3511
|
const O = new FileReader();
|
|
3512
3512
|
O.onload = () => {
|
|
3513
3513
|
if (typeof O.result == "string")
|
|
@@ -3515,37 +3515,37 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3515
3515
|
const Q = JSON.parse(O.result);
|
|
3516
3516
|
f.clearLayers(), Q && L.geoJSON({ type: "Feature", geometry: Q }).eachLayer((he) => {
|
|
3517
3517
|
f.addLayer(he);
|
|
3518
|
-
}),
|
|
3518
|
+
}), J(), $(), M();
|
|
3519
3519
|
} finally {
|
|
3520
3520
|
k.value = "";
|
|
3521
3521
|
}
|
|
3522
|
-
}, O.readAsText(
|
|
3522
|
+
}, O.readAsText(Y);
|
|
3523
3523
|
}
|
|
3524
|
-
function qe(
|
|
3525
|
-
p && (V && p.removeLayer(V), V = L.tileLayer(x[
|
|
3524
|
+
function qe(b) {
|
|
3525
|
+
p && (V && p.removeLayer(V), V = L.tileLayer(x[b].url, { maxZoom: 19, minZoom: 6 }).addTo(p), _.value = b);
|
|
3526
3526
|
}
|
|
3527
|
-
function et(
|
|
3528
|
-
const k = L.latLng(
|
|
3527
|
+
function et(b) {
|
|
3528
|
+
const k = L.latLng(b[0], b[1]);
|
|
3529
3529
|
p.setView(k, 13);
|
|
3530
3530
|
}
|
|
3531
|
-
|
|
3532
|
-
() =>
|
|
3533
|
-
(
|
|
3534
|
-
const k = F(
|
|
3535
|
-
if (
|
|
3531
|
+
ie(
|
|
3532
|
+
() => a.modelValue,
|
|
3533
|
+
(b) => {
|
|
3534
|
+
const k = F(b);
|
|
3535
|
+
if (b && k !== b) {
|
|
3536
3536
|
n("update:modelValue", k);
|
|
3537
3537
|
return;
|
|
3538
3538
|
}
|
|
3539
|
-
f.clearLayers(), k && L.geoJSON({ type: "Feature", geometry: k }).eachLayer((
|
|
3540
|
-
f.addLayer(
|
|
3539
|
+
f.clearLayers(), k && L.geoJSON({ type: "Feature", geometry: k }).eachLayer((Y) => {
|
|
3540
|
+
f.addLayer(Y), Y.dragging?.enable(), Y.dragging?.enabled(), Y.on("dragend", (O) => {
|
|
3541
3541
|
const he = O.target.getLatLng();
|
|
3542
3542
|
n("update:modelValue", { type: "Point", coordinates: [he.lng, he.lat] });
|
|
3543
3543
|
});
|
|
3544
|
-
}), H.value = f.getLayers().length,
|
|
3544
|
+
}), H.value = f.getLayers().length, $(), M();
|
|
3545
3545
|
}
|
|
3546
3546
|
);
|
|
3547
3547
|
function Oe() {
|
|
3548
|
-
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((
|
|
3548
|
+
return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((b, k) => Object.assign(b, { key: `b${k}`, preview: b.preview || b.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((b, k) => ({ ...b, [k.key]: k }), {}) : {
|
|
3549
3549
|
topo100: {
|
|
3550
3550
|
url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
|
|
3551
3551
|
preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
|
|
@@ -3561,11 +3561,11 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3561
3561
|
};
|
|
3562
3562
|
}
|
|
3563
3563
|
const $e = w(!1);
|
|
3564
|
-
return
|
|
3564
|
+
return ie($e, () => {
|
|
3565
3565
|
setTimeout(() => {
|
|
3566
3566
|
p.invalidateSize();
|
|
3567
3567
|
}, 50);
|
|
3568
|
-
}), (
|
|
3568
|
+
}), (b, k) => (i(), d("div", {
|
|
3569
3569
|
class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: $e.value }])
|
|
3570
3570
|
}, [
|
|
3571
3571
|
l("div", {
|
|
@@ -3583,9 +3583,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3583
3583
|
"leave-to-class": "opacity-0"
|
|
3584
3584
|
}, {
|
|
3585
3585
|
default: Be(() => [
|
|
3586
|
-
|
|
3586
|
+
s.value && a.handleZoom ? (i(), d("div", cr, [
|
|
3587
3587
|
l("div", pr, [
|
|
3588
|
-
l("p", fr,
|
|
3588
|
+
l("p", fr, G(r.value), 1)
|
|
3589
3589
|
])
|
|
3590
3590
|
])) : D("", !0)
|
|
3591
3591
|
]),
|
|
@@ -3598,18 +3598,18 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3598
3598
|
l("button", {
|
|
3599
3599
|
type: "button",
|
|
3600
3600
|
class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition",
|
|
3601
|
-
onClick:
|
|
3601
|
+
onClick: Z
|
|
3602
3602
|
}, "Import"),
|
|
3603
3603
|
l("button", {
|
|
3604
3604
|
type: "button",
|
|
3605
3605
|
class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200 disabled:hover:bg-gray-100 disabled:hover:text-gray-400",
|
|
3606
|
-
onClick:
|
|
3606
|
+
onClick: Ve,
|
|
3607
3607
|
disabled: H.value === 0
|
|
3608
3608
|
}, "Export", 8, gr)
|
|
3609
3609
|
]),
|
|
3610
3610
|
l("input", {
|
|
3611
3611
|
ref_key: "importRef",
|
|
3612
|
-
ref:
|
|
3612
|
+
ref: S,
|
|
3613
3613
|
type: "file",
|
|
3614
3614
|
onChange: Ne,
|
|
3615
3615
|
accept: ".json,.geojson",
|
|
@@ -3624,7 +3624,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3624
3624
|
"aria-pressed": N.value === "marker",
|
|
3625
3625
|
title: "Point (P)",
|
|
3626
3626
|
"aria-label": "Draw point",
|
|
3627
|
-
onClick: k[0] || (k[0] = (
|
|
3627
|
+
onClick: k[0] || (k[0] = (Y) => ce("marker"))
|
|
3628
3628
|
}, [
|
|
3629
3629
|
A(zs)
|
|
3630
3630
|
], 10, xr),
|
|
@@ -3633,7 +3633,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3633
3633
|
"aria-pressed": N.value === "polyline",
|
|
3634
3634
|
title: "Line (L)",
|
|
3635
3635
|
"aria-label": "Draw polyline",
|
|
3636
|
-
onClick: k[1] || (k[1] = (
|
|
3636
|
+
onClick: k[1] || (k[1] = (Y) => ce("polyline"))
|
|
3637
3637
|
}, [
|
|
3638
3638
|
A(Os)
|
|
3639
3639
|
], 10, wr),
|
|
@@ -3642,7 +3642,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3642
3642
|
"aria-pressed": N.value === "polygon",
|
|
3643
3643
|
title: "Polygon (G)",
|
|
3644
3644
|
"aria-label": "Draw polygon",
|
|
3645
|
-
onClick: k[2] || (k[2] = (
|
|
3645
|
+
onClick: k[2] || (k[2] = (Y) => ce("polygon"))
|
|
3646
3646
|
}, [
|
|
3647
3647
|
A(Rs)
|
|
3648
3648
|
], 10, kr),
|
|
@@ -3651,13 +3651,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3651
3651
|
"aria-pressed": N.value === "rectangle",
|
|
3652
3652
|
title: "Rectangle (R)",
|
|
3653
3653
|
"aria-label": "Draw rectangle",
|
|
3654
|
-
onClick: k[3] || (k[3] = (
|
|
3654
|
+
onClick: k[3] || (k[3] = (Y) => ce("rectangle"))
|
|
3655
3655
|
}, [
|
|
3656
3656
|
A(Ws)
|
|
3657
3657
|
], 10, _r),
|
|
3658
3658
|
l("button", {
|
|
3659
3659
|
class: "vs-btn mt-5",
|
|
3660
|
-
onClick: k[4] || (k[4] = (
|
|
3660
|
+
onClick: k[4] || (k[4] = (Y) => {
|
|
3661
3661
|
$e.value = !$e.value;
|
|
3662
3662
|
}),
|
|
3663
3663
|
title: "Full Screen",
|
|
@@ -3676,34 +3676,34 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3676
3676
|
}, null, 8, ["basemaps"])
|
|
3677
3677
|
], 2),
|
|
3678
3678
|
l("div", $r, [
|
|
3679
|
-
v.value ? (
|
|
3679
|
+
v.value ? (i(), d("div", Cr, [
|
|
3680
3680
|
l("div", Vr, [
|
|
3681
|
-
k[7] || (k[7] = ge(" Тип: ")),
|
|
3682
|
-
l("span", Mr,
|
|
3681
|
+
k[7] || (k[7] = ge(" Тип: ", -1)),
|
|
3682
|
+
l("span", Mr, G(v.value.type), 1)
|
|
3683
3683
|
]),
|
|
3684
3684
|
l("div", Lr, [
|
|
3685
3685
|
l("div", Sr, [
|
|
3686
|
-
k[8] || (k[8] = ge(" Центр: ")),
|
|
3687
|
-
l("b", null,
|
|
3686
|
+
k[8] || (k[8] = ge(" Центр: ", -1)),
|
|
3687
|
+
l("b", null, G(v.value.center.lat.toFixed(5)) + ", " + G(v.value.center.lng.toFixed(5)), 1)
|
|
3688
3688
|
]),
|
|
3689
|
-
v.value.areaKm2 !== null ? (
|
|
3690
|
-
k[9] || (k[9] = ge(" Площа: ")),
|
|
3691
|
-
l("b", null,
|
|
3692
|
-
])) : (
|
|
3693
|
-
ge(" Площа: "),
|
|
3689
|
+
v.value.areaKm2 !== null ? (i(), d("div", Br, [
|
|
3690
|
+
k[9] || (k[9] = ge(" Площа: ", -1)),
|
|
3691
|
+
l("b", null, G(v.value.areaKm2.toFixed(1)) + "км²", 1)
|
|
3692
|
+
])) : (i(), d("div", jr, k[10] || (k[10] = [
|
|
3693
|
+
ge(" Площа: ", -1),
|
|
3694
3694
|
l("b", null, "—", -1)
|
|
3695
3695
|
]))),
|
|
3696
3696
|
l("button", {
|
|
3697
3697
|
class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
|
|
3698
3698
|
title: "Наблизити",
|
|
3699
|
-
onClick: k[5] || (k[5] = (
|
|
3699
|
+
onClick: k[5] || (k[5] = (Y) => W())
|
|
3700
3700
|
}, k[11] || (k[11] = [
|
|
3701
3701
|
ye('<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-66e4a27d><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-66e4a27d></path><path d="M7 10l6 0" data-v-66e4a27d></path><path d="M10 7l0 6" data-v-66e4a27d></path><path d="M21 21l-6 -6" data-v-66e4a27d></path></svg>', 1)
|
|
3702
3702
|
])),
|
|
3703
3703
|
l("button", {
|
|
3704
3704
|
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",
|
|
3705
3705
|
title: "Видалити",
|
|
3706
|
-
onClick: k[6] || (k[6] = (
|
|
3706
|
+
onClick: k[6] || (k[6] = (Y) => oe())
|
|
3707
3707
|
}, [
|
|
3708
3708
|
A(Qe, { class: "w-3 h-3" })
|
|
3709
3709
|
])
|
|
@@ -3717,7 +3717,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3717
3717
|
class: "absolute text-gray-500 truncate pl-2"
|
|
3718
3718
|
}, Dr = { class: "flex-1 min-w-[2px]" }, Ur = ["placeholder"], Pr = { class: "flex items-center shrink-0" }, Rr = ["disabled"], Hr = /* @__PURE__ */ U({
|
|
3719
3719
|
__name: "vs-input-tag",
|
|
3720
|
-
props: /* @__PURE__ */
|
|
3720
|
+
props: /* @__PURE__ */ re({
|
|
3721
3721
|
unique: { type: Boolean, default: !0 },
|
|
3722
3722
|
style: { default: () => ({}) },
|
|
3723
3723
|
customClass: { default: "" },
|
|
@@ -3730,32 +3730,32 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3730
3730
|
modelValue: { default: [] },
|
|
3731
3731
|
modelModifiers: {}
|
|
3732
3732
|
}),
|
|
3733
|
-
emits: /* @__PURE__ */
|
|
3733
|
+
emits: /* @__PURE__ */ re(["update:modelValue"], ["update:modelValue"]),
|
|
3734
3734
|
setup(o, { emit: e }) {
|
|
3735
|
-
const t = o,
|
|
3735
|
+
const t = o, a = e;
|
|
3736
3736
|
_e(t.style);
|
|
3737
|
-
const n = w(null),
|
|
3738
|
-
|
|
3737
|
+
const n = w(null), s = w(null), r = w(null), u = w(!1), c = w(""), p = ue(o, "modelValue"), f = B(() => t.placeholder || "Add tag…"), m = B(() => p.value?.length === 0 && c.value === ""), y = B(() => !t.disabled && p.value?.length > 0), S = B(() => t.disabled), q = async () => {
|
|
3738
|
+
S.value || await Ie(() => r.value?.focus());
|
|
3739
3739
|
}, R = (V) => {
|
|
3740
3740
|
const _ = V.trim();
|
|
3741
3741
|
_ !== "" && (!p.value || !Array.isArray(p.value) ? p.value = [_] : t.unique ? p.value.includes(_) || (p.value = [...p.value, _]) : p.value = [...p.value, _], c.value = "");
|
|
3742
|
-
},
|
|
3742
|
+
}, K = () => {
|
|
3743
3743
|
const V = c.value;
|
|
3744
3744
|
V.trim() !== "" && R(V), c.value = "";
|
|
3745
3745
|
}, T = (V) => {
|
|
3746
3746
|
const _ = p.value.slice();
|
|
3747
|
-
_.splice(V, 1),
|
|
3747
|
+
_.splice(V, 1), a("update:modelValue", _);
|
|
3748
3748
|
}, H = () => {
|
|
3749
|
-
|
|
3749
|
+
a("update:modelValue", []);
|
|
3750
3750
|
}, I = () => {
|
|
3751
|
-
|
|
3751
|
+
S.value || (u.value = !0);
|
|
3752
3752
|
}, v = () => {
|
|
3753
|
-
|
|
3753
|
+
u.value = !1;
|
|
3754
3754
|
}, x = (V) => {
|
|
3755
3755
|
const { key: _ } = V;
|
|
3756
|
-
_ === "Enter" ? (V.preventDefault(),
|
|
3756
|
+
_ === "Enter" ? (V.preventDefault(), K()) : _ === "Backspace" && c.value === "" && p.value.length > 0 && T(p.value.length - 1);
|
|
3757
3757
|
};
|
|
3758
|
-
return (V, _) => (
|
|
3758
|
+
return (V, _) => (i(), d("div", {
|
|
3759
3759
|
class: "flex gap-1 w-full",
|
|
3760
3760
|
ref_key: "root",
|
|
3761
3761
|
ref: n,
|
|
@@ -3771,28 +3771,28 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3771
3771
|
class: E([
|
|
3772
3772
|
"flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
|
|
3773
3773
|
"border-gray-300 hover:border-gray-400",
|
|
3774
|
-
|
|
3775
|
-
|
|
3774
|
+
u.value ? "border-blue-500 ring-1 ring-blue-500" : "",
|
|
3775
|
+
S.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
|
|
3776
3776
|
]),
|
|
3777
|
-
"data-focus":
|
|
3778
|
-
onClick:
|
|
3777
|
+
"data-focus": u.value ? "true" : "false",
|
|
3778
|
+
onClick: q
|
|
3779
3779
|
}, [
|
|
3780
3780
|
l("div", {
|
|
3781
3781
|
class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
|
|
3782
3782
|
ref_key: "chipsRef",
|
|
3783
|
-
ref:
|
|
3783
|
+
ref: s
|
|
3784
3784
|
}, [
|
|
3785
|
-
(
|
|
3785
|
+
(i(!0), d(se, null, pe(p.value, (F, te) => (i(), d("div", {
|
|
3786
3786
|
key: te,
|
|
3787
3787
|
class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
|
|
3788
3788
|
}, [
|
|
3789
3789
|
l("div", Ar, [
|
|
3790
|
-
l("div", Tr,
|
|
3790
|
+
l("div", Tr, G(F), 1)
|
|
3791
3791
|
]),
|
|
3792
3792
|
l("div", {
|
|
3793
3793
|
role: "button",
|
|
3794
3794
|
class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
|
|
3795
|
-
onClick: we((
|
|
3795
|
+
onClick: we((J) => T(te), ["stop"]),
|
|
3796
3796
|
"aria-label": `Remove ${F}`
|
|
3797
3797
|
}, _[2] || (_[2] = [
|
|
3798
3798
|
l("svg", {
|
|
@@ -3807,9 +3807,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3807
3807
|
], -1)
|
|
3808
3808
|
]), 8, Fr)
|
|
3809
3809
|
]))), 128)),
|
|
3810
|
-
m.value ? (
|
|
3810
|
+
m.value ? (i(), d("div", Or, G(f.value), 1)) : D("", !0),
|
|
3811
3811
|
l("div", Dr, [
|
|
3812
|
-
|
|
3812
|
+
S.value ? D("", !0) : ne((i(), d("input", {
|
|
3813
3813
|
key: 0,
|
|
3814
3814
|
ref_key: "inputRef",
|
|
3815
3815
|
ref: r,
|
|
@@ -3832,12 +3832,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3832
3832
|
])
|
|
3833
3833
|
], 512),
|
|
3834
3834
|
l("div", Pr, [
|
|
3835
|
-
|
|
3835
|
+
y.value ? (i(), d("button", {
|
|
3836
3836
|
key: 0,
|
|
3837
3837
|
type: "button",
|
|
3838
3838
|
class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
|
|
3839
3839
|
"aria-label": "Clear all tags",
|
|
3840
|
-
disabled:
|
|
3840
|
+
disabled: S.value,
|
|
3841
3841
|
onClick: we(H, ["stop"])
|
|
3842
3842
|
}, _[3] || (_[3] = [
|
|
3843
3843
|
l("svg", {
|
|
@@ -3856,7 +3856,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3856
3856
|
}
|
|
3857
3857
|
}), Nr = { class: "relative flex gap-1 bg-white w-full" }, qr = ["disabled", "placeholder"], Wr = /* @__PURE__ */ U({
|
|
3858
3858
|
__name: "vs-input-slug",
|
|
3859
|
-
props: /* @__PURE__ */
|
|
3859
|
+
props: /* @__PURE__ */ re({
|
|
3860
3860
|
disabled: { type: Boolean },
|
|
3861
3861
|
placeholder: {},
|
|
3862
3862
|
parent: {}
|
|
@@ -3866,9 +3866,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3866
3866
|
}),
|
|
3867
3867
|
emits: ["update:modelValue"],
|
|
3868
3868
|
setup(o) {
|
|
3869
|
-
const e = ze("values"), t = o,
|
|
3869
|
+
const e = ze("values"), t = o, a = ue(o, "modelValue");
|
|
3870
3870
|
function n(r) {
|
|
3871
|
-
const
|
|
3871
|
+
const u = {
|
|
3872
3872
|
а: "a",
|
|
3873
3873
|
б: "b",
|
|
3874
3874
|
в: "v",
|
|
@@ -3907,25 +3907,25 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3907
3907
|
ї: "yi",
|
|
3908
3908
|
ґ: "g"
|
|
3909
3909
|
};
|
|
3910
|
-
return r.toLowerCase().split("").map((c) =>
|
|
3910
|
+
return r.toLowerCase().split("").map((c) => u[c] || c).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
3911
3911
|
}
|
|
3912
|
-
const
|
|
3913
|
-
const r = e?.value?.[t.parent || ""]?.toString(),
|
|
3914
|
-
|
|
3912
|
+
const s = () => {
|
|
3913
|
+
const r = e?.value?.[t.parent || ""]?.toString(), u = n(r);
|
|
3914
|
+
a.value = u.toString();
|
|
3915
3915
|
};
|
|
3916
|
-
return (r,
|
|
3916
|
+
return (r, u) => (i(), d("div", Nr, [
|
|
3917
3917
|
ne(l("input", {
|
|
3918
3918
|
ref: "vsText",
|
|
3919
3919
|
disabled: r.disabled,
|
|
3920
3920
|
placeholder: r.placeholder,
|
|
3921
|
-
"onUpdate:modelValue":
|
|
3921
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => a.value = c),
|
|
3922
3922
|
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"
|
|
3923
3923
|
}, null, 8, qr), [
|
|
3924
|
-
[ve,
|
|
3924
|
+
[ve, a.value]
|
|
3925
3925
|
]),
|
|
3926
3926
|
l("button", {
|
|
3927
3927
|
class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
|
|
3928
|
-
onClick:
|
|
3928
|
+
onClick: s
|
|
3929
3929
|
}, " Gen ")
|
|
3930
3930
|
]));
|
|
3931
3931
|
}
|
|
@@ -3945,56 +3945,56 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
3945
3945
|
},
|
|
3946
3946
|
emits: ["update:modelValue"],
|
|
3947
3947
|
setup(o, { emit: e }) {
|
|
3948
|
-
const t = (
|
|
3948
|
+
const t = (K) => `${K}-${Math.random().toString(36).substring(2, 15)}`, a = ze("values"), n = o, s = e, r = n.addButtonText ?? "Додати", u = n.ignore ?? [], c = w([]), p = w(null);
|
|
3949
3949
|
(() => {
|
|
3950
|
-
const
|
|
3951
|
-
c.value = Object.entries(
|
|
3950
|
+
const K = n.parent && a?.value?.[n.parent] || n.modelValue || {};
|
|
3951
|
+
c.value = Object.entries(K).filter(([T]) => !u.includes(T)).map(([T, H]) => ({
|
|
3952
3952
|
id: t("key-value-"),
|
|
3953
3953
|
key: T,
|
|
3954
3954
|
value: H
|
|
3955
3955
|
}));
|
|
3956
3956
|
})();
|
|
3957
|
-
function m(
|
|
3958
|
-
p.value =
|
|
3957
|
+
function m(K) {
|
|
3958
|
+
p.value = K;
|
|
3959
3959
|
}
|
|
3960
|
-
function
|
|
3961
|
-
if (p.value === null || p.value ===
|
|
3960
|
+
function y(K) {
|
|
3961
|
+
if (p.value === null || p.value === K) return;
|
|
3962
3962
|
const T = c.value.splice(p.value, 1)[0];
|
|
3963
|
-
c.value.splice(
|
|
3963
|
+
c.value.splice(K, 0, T), p.value = null;
|
|
3964
3964
|
}
|
|
3965
|
-
const
|
|
3966
|
-
() => c.value.some((
|
|
3967
|
-
),
|
|
3965
|
+
const S = B(
|
|
3966
|
+
() => c.value.some((K) => K.key && !K.value || !K.key && K.value)
|
|
3967
|
+
), q = () => {
|
|
3968
3968
|
c.value.push({ id: t("key-value-"), key: "", value: "" });
|
|
3969
|
-
}, R = (
|
|
3970
|
-
c.value = c.value.filter((T) => T.id !==
|
|
3969
|
+
}, R = (K) => {
|
|
3970
|
+
c.value = c.value.filter((T) => T.id !== K);
|
|
3971
3971
|
};
|
|
3972
|
-
return
|
|
3972
|
+
return ie(
|
|
3973
3973
|
c,
|
|
3974
|
-
(
|
|
3974
|
+
(K) => {
|
|
3975
3975
|
const T = {};
|
|
3976
|
-
|
|
3976
|
+
K.forEach((I) => {
|
|
3977
3977
|
I.key && I.value !== void 0 && (T[I.key] = I.value);
|
|
3978
3978
|
});
|
|
3979
3979
|
const H = {};
|
|
3980
|
-
|
|
3981
|
-
H[I] = n.parent ?
|
|
3982
|
-
}),
|
|
3980
|
+
u.length && u.forEach((I) => {
|
|
3981
|
+
H[I] = n.parent ? a?.value?.[n.parent]?.[I] : void 0;
|
|
3982
|
+
}), a?.value && n.parent && (a.value[n.parent] = {
|
|
3983
3983
|
...H,
|
|
3984
3984
|
...T
|
|
3985
|
-
}),
|
|
3985
|
+
}), s("update:modelValue", T);
|
|
3986
3986
|
},
|
|
3987
3987
|
{ deep: !0 }
|
|
3988
|
-
), (
|
|
3988
|
+
), (K, T) => (i(), d("div", Zr, [
|
|
3989
3989
|
l("div", Kr, [
|
|
3990
|
-
(
|
|
3990
|
+
(i(!0), d(se, null, pe(c.value, (H, I) => (i(), d("div", {
|
|
3991
3991
|
key: H.id,
|
|
3992
3992
|
class: E(["flex items-center gap-2 w-full", { "opacity-50": p.value === I }]),
|
|
3993
3993
|
draggable: "true",
|
|
3994
3994
|
onDragstart: (v) => m(I),
|
|
3995
3995
|
onDragover: T[0] || (T[0] = we(() => {
|
|
3996
3996
|
}, ["prevent"])),
|
|
3997
|
-
onDrop: (v) =>
|
|
3997
|
+
onDrop: (v) => y(I)
|
|
3998
3998
|
}, [
|
|
3999
3999
|
T[1] || (T[1] = ye('<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)),
|
|
4000
4000
|
l("div", Yr, [
|
|
@@ -4022,19 +4022,19 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4022
4022
|
], 8, Qr)
|
|
4023
4023
|
], 42, Jr))), 128))
|
|
4024
4024
|
], 512),
|
|
4025
|
-
c.value.length ? D("", !0) : (
|
|
4025
|
+
c.value.length ? D("", !0) : (i(), d("span", ei, " Дані для відображення відсутні ")),
|
|
4026
4026
|
l("div", ti, [
|
|
4027
4027
|
l("button", {
|
|
4028
4028
|
type: "button",
|
|
4029
|
-
onClick:
|
|
4030
|
-
disabled:
|
|
4029
|
+
onClick: q,
|
|
4030
|
+
disabled: S.value,
|
|
4031
4031
|
class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
4032
4032
|
}, [
|
|
4033
4033
|
A(Re, {
|
|
4034
4034
|
height: "14",
|
|
4035
4035
|
width: "14"
|
|
4036
4036
|
}),
|
|
4037
|
-
ge(" " +
|
|
4037
|
+
ge(" " + G(ee(r)), 1)
|
|
4038
4038
|
], 8, li)
|
|
4039
4039
|
])
|
|
4040
4040
|
]));
|
|
@@ -4052,26 +4052,26 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4052
4052
|
},
|
|
4053
4053
|
emits: ["update:modelValue"],
|
|
4054
4054
|
setup(o, { emit: e }) {
|
|
4055
|
-
const t = o, { inputClass:
|
|
4055
|
+
const t = o, { inputClass: a } = _e(t.style), n = e, s = B({
|
|
4056
4056
|
get: () => t.modelValue || "#000000",
|
|
4057
4057
|
set: (r) => n("update:modelValue", r)
|
|
4058
4058
|
});
|
|
4059
|
-
return (r,
|
|
4059
|
+
return (r, u) => (i(), d("div", ai, [
|
|
4060
4060
|
ne(l("input", {
|
|
4061
4061
|
type: "color",
|
|
4062
|
-
"onUpdate:modelValue":
|
|
4062
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4063
4063
|
disabled: r.disabled,
|
|
4064
4064
|
ref: "color",
|
|
4065
|
-
class: E(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [r.modelValue ? "" : "text-opacity-50", ee(
|
|
4065
|
+
class: E(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")]),
|
|
4066
4066
|
style: { border: "1px solid #CFD9E0" }
|
|
4067
4067
|
}, null, 10, si), [
|
|
4068
|
-
[ve,
|
|
4068
|
+
[ve, s.value]
|
|
4069
4069
|
]),
|
|
4070
4070
|
ne(l("input", {
|
|
4071
4071
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
|
|
4072
|
-
"onUpdate:modelValue":
|
|
4072
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
4073
4073
|
}, null, 512), [
|
|
4074
|
-
[ve,
|
|
4074
|
+
[ve, s.value]
|
|
4075
4075
|
])
|
|
4076
4076
|
]));
|
|
4077
4077
|
}
|
|
@@ -4091,35 +4091,35 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4091
4091
|
},
|
|
4092
4092
|
emits: ["update:modelValue"],
|
|
4093
4093
|
setup(o, { emit: e }) {
|
|
4094
|
-
const t = o, { inputClass:
|
|
4094
|
+
const t = o, { inputClass: a } = _e(t.style), n = e, s = B({
|
|
4095
4095
|
get: () => Number(t.modelValue ?? t.min),
|
|
4096
4096
|
set: (r) => n("update:modelValue", Number(r))
|
|
4097
4097
|
});
|
|
4098
|
-
return (r,
|
|
4098
|
+
return (r, u) => (i(), d("div", ii, [
|
|
4099
4099
|
ne(l("input", {
|
|
4100
4100
|
type: "range",
|
|
4101
|
-
"onUpdate:modelValue":
|
|
4101
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
4102
4102
|
min: r.min,
|
|
4103
4103
|
max: r.max,
|
|
4104
4104
|
step: r.step,
|
|
4105
4105
|
disabled: r.disabled,
|
|
4106
4106
|
ref: "range",
|
|
4107
|
-
class: E(["w-full cursor-pointer accent-blue-500", [r.modelValue ? "" : "text-opacity-50", ee(
|
|
4107
|
+
class: E(["w-full cursor-pointer accent-blue-500", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")])
|
|
4108
4108
|
}, null, 10, ui), [
|
|
4109
|
-
[ve,
|
|
4109
|
+
[ve, s.value]
|
|
4110
4110
|
]),
|
|
4111
4111
|
ne(l("input", {
|
|
4112
4112
|
class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
|
|
4113
4113
|
type: "number",
|
|
4114
|
-
"onUpdate:modelValue":
|
|
4114
|
+
"onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
|
|
4115
4115
|
}, null, 512), [
|
|
4116
|
-
[ve,
|
|
4116
|
+
[ve, s.value]
|
|
4117
4117
|
])
|
|
4118
4118
|
]));
|
|
4119
4119
|
}
|
|
4120
4120
|
}), ci = ["type", "value", "onInput", "placeholder", "disabled"], pi = /* @__PURE__ */ U({
|
|
4121
4121
|
__name: "vs-input-array",
|
|
4122
|
-
props: /* @__PURE__ */
|
|
4122
|
+
props: /* @__PURE__ */ re({
|
|
4123
4123
|
count: { default: 1 },
|
|
4124
4124
|
limit: { default: (o) => o.count ?? 1 },
|
|
4125
4125
|
inputType: { default: "text" },
|
|
@@ -4136,28 +4136,28 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4136
4136
|
}),
|
|
4137
4137
|
emits: ["update:modelValue"],
|
|
4138
4138
|
setup(o) {
|
|
4139
|
-
const e = o, { inputClass: t } = _e(e.style),
|
|
4139
|
+
const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
|
|
4140
4140
|
Gt(() => {
|
|
4141
|
-
const
|
|
4142
|
-
|
|
4143
|
-
...
|
|
4144
|
-
...Array(e.count -
|
|
4141
|
+
const s = a.value?.length ?? 0;
|
|
4142
|
+
s < e.count && (a.value = [
|
|
4143
|
+
...a.value ?? [],
|
|
4144
|
+
...Array(e.count - s)
|
|
4145
4145
|
]);
|
|
4146
4146
|
});
|
|
4147
|
-
function n(
|
|
4148
|
-
const
|
|
4149
|
-
c[r] = e.inputType === "text" ?
|
|
4147
|
+
function n(s, r) {
|
|
4148
|
+
const u = s.target.value, c = [...a.value];
|
|
4149
|
+
c[r] = e.inputType === "text" ? u : Number(u), a.value = c;
|
|
4150
4150
|
}
|
|
4151
|
-
return (
|
|
4152
|
-
class: E(["grid gap-2", `grid-cols-${
|
|
4151
|
+
return (s, r) => (i(), d("div", {
|
|
4152
|
+
class: E(["grid gap-2", `grid-cols-${s.limit}`])
|
|
4153
4153
|
}, [
|
|
4154
|
-
(
|
|
4155
|
-
type:
|
|
4156
|
-
value:
|
|
4157
|
-
onInput: (c) => n(c,
|
|
4158
|
-
placeholder:
|
|
4159
|
-
disabled:
|
|
4160
|
-
class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600":
|
|
4154
|
+
(i(!0), d(se, null, pe(s.count, (u) => (i(), d("input", {
|
|
4155
|
+
type: s.inputType,
|
|
4156
|
+
value: a.value?.[u - 1] ?? "",
|
|
4157
|
+
onInput: (c) => n(c, u - 1),
|
|
4158
|
+
placeholder: s.placeholder,
|
|
4159
|
+
disabled: s.disabled,
|
|
4160
|
+
class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": s.error }]]),
|
|
4161
4161
|
style: {
|
|
4162
4162
|
border: "1px solid #CFD9E0"
|
|
4163
4163
|
}
|
|
@@ -4203,33 +4203,33 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4203
4203
|
},
|
|
4204
4204
|
setup(o) {
|
|
4205
4205
|
const e = o, t = ze("values");
|
|
4206
|
-
async function
|
|
4206
|
+
async function a() {
|
|
4207
4207
|
try {
|
|
4208
4208
|
if (!e.api) return;
|
|
4209
|
-
const n = e.api.replace("{{value}}", e.value),
|
|
4210
|
-
if (!
|
|
4209
|
+
const n = e.api.replace("{{value}}", e.value), s = await fetch(n);
|
|
4210
|
+
if (!s.ok) {
|
|
4211
4211
|
de({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
|
|
4212
4212
|
return;
|
|
4213
4213
|
}
|
|
4214
|
-
const r = await
|
|
4214
|
+
const r = await s.json();
|
|
4215
4215
|
if (!e.set || !t) return;
|
|
4216
|
-
for (const [
|
|
4217
|
-
t.value[
|
|
4216
|
+
for (const [u, c] of Object.entries(e.set))
|
|
4217
|
+
t.value[u] = r.result[c];
|
|
4218
4218
|
} catch (n) {
|
|
4219
4219
|
console.error(e.error, n);
|
|
4220
4220
|
}
|
|
4221
4221
|
}
|
|
4222
|
-
return (n,
|
|
4223
|
-
onClick:
|
|
4222
|
+
return (n, s) => (i(), d("button", {
|
|
4223
|
+
onClick: a,
|
|
4224
4224
|
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"
|
|
4225
|
-
},
|
|
4225
|
+
}, G(n.button), 1));
|
|
4226
4226
|
}
|
|
4227
4227
|
}), vi = { class: "flex flex-col gap-1 w-full" }, hi = {
|
|
4228
4228
|
key: 0,
|
|
4229
4229
|
class: "text-sm text-gray-500"
|
|
4230
4230
|
}, zt = /* @__PURE__ */ U({
|
|
4231
4231
|
__name: "vs-compact-form-layout",
|
|
4232
|
-
props: /* @__PURE__ */
|
|
4232
|
+
props: /* @__PURE__ */ re({
|
|
4233
4233
|
item: { default: {} },
|
|
4234
4234
|
layout: { default: "default" },
|
|
4235
4235
|
style: { default: {} },
|
|
@@ -4242,21 +4242,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4242
4242
|
}),
|
|
4243
4243
|
emits: ["update:modelValue"],
|
|
4244
4244
|
setup(o) {
|
|
4245
|
-
const e = o, t = ue(o, "modelValue"),
|
|
4246
|
-
const
|
|
4247
|
-
if (!
|
|
4248
|
-
const c =
|
|
4245
|
+
const e = o, t = ue(o, "modelValue"), a = B(() => gl[`${e.layout}`]), n = B(() => fi?.[`vs-input-${e.item.type}`]), s = B(() => {
|
|
4246
|
+
const u = ee(n);
|
|
4247
|
+
if (!u) return /* @__PURE__ */ new Set();
|
|
4248
|
+
const c = u.props ?? u.__vccOpts?.props;
|
|
4249
4249
|
if (!c) return /* @__PURE__ */ new Set();
|
|
4250
4250
|
const p = Array.isArray(c) ? c : Object.keys(c);
|
|
4251
4251
|
return new Set(p);
|
|
4252
|
-
}), r =
|
|
4253
|
-
const
|
|
4254
|
-
return c.size ? Object.fromEntries(Object.entries(
|
|
4252
|
+
}), r = B(() => {
|
|
4253
|
+
const u = e.item ?? {}, c = s.value;
|
|
4254
|
+
return c.size ? Object.fromEntries(Object.entries(u).filter(([p]) => c.has(p))) : {};
|
|
4255
4255
|
});
|
|
4256
|
-
return (
|
|
4256
|
+
return (u, c) => ne((i(), me(Fe(a.value), {
|
|
4257
4257
|
ua: e.item.ua,
|
|
4258
4258
|
error: e.error || "",
|
|
4259
|
-
item:
|
|
4259
|
+
item: u.item,
|
|
4260
4260
|
columns: e.columns,
|
|
4261
4261
|
label: e.item.label
|
|
4262
4262
|
}, {
|
|
@@ -4265,18 +4265,18 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4265
4265
|
class: E(["flex w-full", `${e.item.type}-component`])
|
|
4266
4266
|
}, [
|
|
4267
4267
|
l("div", vi, [
|
|
4268
|
-
(
|
|
4268
|
+
(i(), me(Fe(n.value), Te(r.value, {
|
|
4269
4269
|
modelValue: t.value,
|
|
4270
4270
|
"onUpdate:modelValue": c[0] || (c[0] = (p) => t.value = p)
|
|
4271
4271
|
}), null, 16, ["modelValue"])),
|
|
4272
|
-
|
|
4272
|
+
u.item.description && e.layout !== "settings" ? (i(), d("p", hi, G(u.item.description), 1)) : D("", !0)
|
|
4273
4273
|
]),
|
|
4274
|
-
|
|
4274
|
+
u.item.behavior?.api && u.item.behavior?.button ? (i(), me(mi, Te({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : D("", !0)
|
|
4275
4275
|
], 2)
|
|
4276
4276
|
]),
|
|
4277
4277
|
_: 1
|
|
4278
4278
|
}, 8, ["ua", "error", "item", "columns", "label"])), [
|
|
4279
|
-
[Xe, !
|
|
4279
|
+
[Xe, !u.item.hidden]
|
|
4280
4280
|
]);
|
|
4281
4281
|
}
|
|
4282
4282
|
}), gi = { class: "text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300" }, bi = { class: "vs-compact-form-navigation__rail mt-[6px]" }, yi = ["onClick"], xi = /* @__PURE__ */ U({
|
|
@@ -4284,38 +4284,38 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4284
4284
|
props: {
|
|
4285
4285
|
target: {},
|
|
4286
4286
|
scrollContainer: {},
|
|
4287
|
-
title: { default: "Навігація
|
|
4287
|
+
title: { default: "Навігація" },
|
|
4288
4288
|
enabled: { type: Boolean, default: !0 },
|
|
4289
4289
|
width: { default: 400 }
|
|
4290
4290
|
},
|
|
4291
4291
|
setup(o, { expose: e }) {
|
|
4292
|
-
const t = o,
|
|
4292
|
+
const t = o, a = w([]), n = w(""), s = w(""), r = B(() => !!t.enabled), u = B(() => [
|
|
4293
4293
|
"vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
|
|
4294
4294
|
"sticky top-0 self-start shrink-0",
|
|
4295
4295
|
"max-h-full min-h-0 overflow-y-auto"
|
|
4296
|
-
]), c =
|
|
4296
|
+
]), c = B(() => {
|
|
4297
4297
|
const M = t.width;
|
|
4298
4298
|
if (M == null) return {};
|
|
4299
|
-
const
|
|
4300
|
-
return { width:
|
|
4299
|
+
const Z = typeof M == "number" ? `${M}px` : `${M}`;
|
|
4300
|
+
return { width: Z, minWidth: Z };
|
|
4301
4301
|
});
|
|
4302
|
-
let p = null, f = 0, m = 0,
|
|
4303
|
-
const R = () => te(),
|
|
4304
|
-
|
|
4302
|
+
let p = null, f = 0, m = 0, y = null, S = null, q = null;
|
|
4303
|
+
const R = () => te(), K = () => H();
|
|
4304
|
+
ie(
|
|
4305
4305
|
() => t.target,
|
|
4306
4306
|
async (M) => {
|
|
4307
4307
|
if (V(), !M) {
|
|
4308
|
-
|
|
4308
|
+
y = null, a.value = [], n.value = "";
|
|
4309
4309
|
return;
|
|
4310
4310
|
}
|
|
4311
|
-
|
|
4311
|
+
y = M, r.value && (await Ie(), x(M), H());
|
|
4312
4312
|
},
|
|
4313
4313
|
{ immediate: !0 }
|
|
4314
|
-
),
|
|
4314
|
+
), ie(
|
|
4315
4315
|
() => t.scrollContainer,
|
|
4316
4316
|
(M) => {
|
|
4317
4317
|
if (!r.value) {
|
|
4318
|
-
|
|
4318
|
+
S = M ?? null;
|
|
4319
4319
|
return;
|
|
4320
4320
|
}
|
|
4321
4321
|
T(M ?? null), Ie(() => H());
|
|
@@ -4324,21 +4324,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4324
4324
|
), ke(() => {
|
|
4325
4325
|
t.scrollContainer || T(null), H();
|
|
4326
4326
|
}), at(() => {
|
|
4327
|
-
V(), T(null, !0),
|
|
4327
|
+
V(), T(null, !0), y = null, typeof window < "u" && (f && window.cancelAnimationFrame(f), m && window.cancelAnimationFrame(m));
|
|
4328
4328
|
});
|
|
4329
|
-
function T(M,
|
|
4330
|
-
if (
|
|
4331
|
-
|
|
4329
|
+
function T(M, Z = !1) {
|
|
4330
|
+
if (q && (q(), q = null), Z) {
|
|
4331
|
+
S = null;
|
|
4332
4332
|
return;
|
|
4333
4333
|
}
|
|
4334
|
-
if (
|
|
4334
|
+
if (S = M ?? null, typeof window > "u") return;
|
|
4335
4335
|
const N = M ?? window, le = window;
|
|
4336
|
-
N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize",
|
|
4337
|
-
N.removeEventListener("scroll", R), le.removeEventListener("resize",
|
|
4336
|
+
N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize", K), q = () => {
|
|
4337
|
+
N.removeEventListener("scroll", R), le.removeEventListener("resize", K);
|
|
4338
4338
|
};
|
|
4339
4339
|
}
|
|
4340
4340
|
function H() {
|
|
4341
|
-
if (!r.value || !
|
|
4341
|
+
if (!r.value || !y) return;
|
|
4342
4342
|
f && typeof window < "u" && window.cancelAnimationFrame(f);
|
|
4343
4343
|
const M = () => {
|
|
4344
4344
|
I(), f = 0;
|
|
@@ -4346,22 +4346,22 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4346
4346
|
typeof window > "u" ? M() : f = window.requestAnimationFrame(M);
|
|
4347
4347
|
}
|
|
4348
4348
|
function I() {
|
|
4349
|
-
if (!r.value || !
|
|
4350
|
-
const M = Array.from(
|
|
4349
|
+
if (!r.value || !y) return;
|
|
4350
|
+
const M = Array.from(y.querySelectorAll("h1, h2")), Z = /* @__PURE__ */ new Set(), N = [];
|
|
4351
4351
|
M.forEach((le, z) => {
|
|
4352
4352
|
const j = le.textContent?.trim() ?? "";
|
|
4353
4353
|
if (!j) return;
|
|
4354
|
-
let
|
|
4355
|
-
|
|
4356
|
-
let
|
|
4357
|
-
for (;
|
|
4358
|
-
|
|
4359
|
-
le.id !==
|
|
4360
|
-
id:
|
|
4354
|
+
let $ = (le.getAttribute("id") ?? "").trim();
|
|
4355
|
+
$ || ($ = v(j) || `heading-${z + 1}`);
|
|
4356
|
+
let W = $, oe = 1;
|
|
4357
|
+
for (; Z.has(W); )
|
|
4358
|
+
W = `${$}-${oe += 1}`;
|
|
4359
|
+
le.id !== W && Object.assign(le, { id: W }), Z.add(W), N.push({
|
|
4360
|
+
id: W,
|
|
4361
4361
|
text: j,
|
|
4362
4362
|
level: le.tagName.toLowerCase() === "h1" ? 1 : 2
|
|
4363
4363
|
});
|
|
4364
|
-
}),
|
|
4364
|
+
}), a.value = N, N.length || (n.value = ""), F();
|
|
4365
4365
|
}
|
|
4366
4366
|
function v(M) {
|
|
4367
4367
|
return M.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
@@ -4373,46 +4373,47 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4373
4373
|
p && (p.disconnect(), p = null);
|
|
4374
4374
|
}
|
|
4375
4375
|
function _(M) {
|
|
4376
|
-
const
|
|
4377
|
-
if (!
|
|
4376
|
+
const Z = S;
|
|
4377
|
+
if (!Z)
|
|
4378
4378
|
return typeof window > "u" ? M.offsetTop : M.getBoundingClientRect().top + window.scrollY;
|
|
4379
|
-
const N = M.getBoundingClientRect(), le =
|
|
4380
|
-
return N.top - le.top +
|
|
4379
|
+
const N = M.getBoundingClientRect(), le = Z.getBoundingClientRect();
|
|
4380
|
+
return N.top - le.top + Z.scrollTop;
|
|
4381
4381
|
}
|
|
4382
4382
|
function F() {
|
|
4383
|
-
if (!r.value || !
|
|
4384
|
-
const M =
|
|
4383
|
+
if (!r.value || !a.value.length) return;
|
|
4384
|
+
const M = S, Z = (M ? M.scrollTop : null) || (typeof window < "u" ? window.scrollY : 0), N = (M ? M.clientHeight : null) || (typeof window < "u" ? window.innerHeight : 0), le = Z + N;
|
|
4385
4385
|
let z = null;
|
|
4386
|
-
for (
|
|
4387
|
-
const
|
|
4388
|
-
if (
|
|
4389
|
-
|
|
4390
|
-
|
|
4386
|
+
for (let $ = 0; $ < a.value.length; $ += 1) {
|
|
4387
|
+
const W = a.value[$], oe = document.getElementById(W.id);
|
|
4388
|
+
if (oe) {
|
|
4389
|
+
const ce = _(oe);
|
|
4390
|
+
ce + oe.offsetHeight > Z && ce < le && (z = W.id);
|
|
4391
|
+
}
|
|
4391
4392
|
}
|
|
4392
|
-
!z &&
|
|
4393
|
+
!z && s.value && (z = s.value), z && (s.value = z);
|
|
4393
4394
|
const j = M ? M.scrollHeight - M.clientHeight : document.documentElement.scrollHeight - window.innerHeight;
|
|
4394
|
-
|
|
4395
|
+
Z + 5 >= j && (z = a.value[a.value.length - 1].id), z && (n.value = z);
|
|
4395
4396
|
}
|
|
4396
4397
|
function te() {
|
|
4397
4398
|
r.value && (m && window.cancelAnimationFrame(m), m = window.requestAnimationFrame(() => {
|
|
4398
4399
|
F(), m = 0;
|
|
4399
4400
|
}));
|
|
4400
4401
|
}
|
|
4401
|
-
function
|
|
4402
|
+
function J(M) {
|
|
4402
4403
|
if (!r.value) return;
|
|
4403
|
-
const
|
|
4404
|
-
if (!
|
|
4405
|
-
const N =
|
|
4404
|
+
const Z = document.getElementById(M);
|
|
4405
|
+
if (!Z) return;
|
|
4406
|
+
const N = S, le = Math.max(0, _(Z));
|
|
4406
4407
|
N ? N.scrollTo({ top: le, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: le, behavior: "smooth" });
|
|
4407
4408
|
}
|
|
4408
|
-
return e({ refresh: H }), (M,
|
|
4409
|
+
return e({ refresh: H }), (M, Z) => r.value && a.value.length ? (i(), d("div", {
|
|
4409
4410
|
key: 0,
|
|
4410
|
-
class: E(
|
|
4411
|
+
class: E(u.value),
|
|
4411
4412
|
style: be(c.value)
|
|
4412
4413
|
}, [
|
|
4413
|
-
l("h2", gi,
|
|
4414
|
+
l("h2", gi, G(M.title), 1),
|
|
4414
4415
|
l("div", bi, [
|
|
4415
|
-
(
|
|
4416
|
+
(i(!0), d(se, null, pe(a.value, (N) => (i(), d("div", {
|
|
4416
4417
|
key: N.id,
|
|
4417
4418
|
class: E([
|
|
4418
4419
|
"vs-compact-form-navigation__item relative",
|
|
@@ -4422,20 +4423,20 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
|
|
|
4422
4423
|
}, [
|
|
4423
4424
|
l("button", {
|
|
4424
4425
|
type: "button",
|
|
4425
|
-
onClick: (le) =>
|
|
4426
|
+
onClick: (le) => J(N.id),
|
|
4426
4427
|
class: E([
|
|
4427
4428
|
"vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",
|
|
4428
|
-
N.level === 2 ? "pl-[
|
|
4429
|
+
N.level === 2 ? "pl-[15px]" : "pl-[18px]",
|
|
4429
4430
|
N.id === n.value ? "text-gray-800" : "text-gray-500"
|
|
4430
4431
|
])
|
|
4431
4432
|
}, [
|
|
4432
|
-
l("span", null,
|
|
4433
|
+
l("span", null, G(N.text), 1)
|
|
4433
4434
|
], 10, yi)
|
|
4434
4435
|
], 2))), 128))
|
|
4435
4436
|
])
|
|
4436
4437
|
], 6)) : D("", !0);
|
|
4437
4438
|
}
|
|
4438
|
-
}), wi = /* @__PURE__ */ X(xi, [["__scopeId", "data-v-
|
|
4439
|
+
}), wi = /* @__PURE__ */ X(xi, [["__scopeId", "data-v-1584a562"]]), At = {
|
|
4439
4440
|
required: "Це поле є обов’язковим",
|
|
4440
4441
|
email: "Неправильний email"
|
|
4441
4442
|
}, ki = (o) => o ? !1 : At.required, _i = (o) => {
|
|
@@ -4476,57 +4477,57 @@ function _t(o) {
|
|
|
4476
4477
|
}
|
|
4477
4478
|
function Li(o, e = !1) {
|
|
4478
4479
|
if (Array.isArray(o)) {
|
|
4479
|
-
const
|
|
4480
|
+
const a = [];
|
|
4480
4481
|
return o.forEach((n) => {
|
|
4481
|
-
const
|
|
4482
|
-
|
|
4483
|
-
}),
|
|
4482
|
+
const s = { ...n };
|
|
4483
|
+
s.name = (n.name || n.id || n.key || "").toString(), s.type = _t(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, s.type === "email" && !s.rules && (s.rules = ["email"]), n.data && (s.api = `/api/suggest/${n.data}`), s.disabled = e || s.disabled, a.push(s);
|
|
4484
|
+
}), a;
|
|
4484
4485
|
}
|
|
4485
4486
|
const t = [];
|
|
4486
|
-
return Object.entries(o).forEach((
|
|
4487
|
+
return Object.entries(o).forEach((a) => {
|
|
4487
4488
|
const n = {
|
|
4488
|
-
name:
|
|
4489
|
-
...
|
|
4490
|
-
type: _t(
|
|
4491
|
-
label:
|
|
4492
|
-
rules:
|
|
4489
|
+
name: a[0],
|
|
4490
|
+
...a[1],
|
|
4491
|
+
type: _t(a[1].type),
|
|
4492
|
+
label: a[1].label || a[1].ua,
|
|
4493
|
+
rules: a[1].rules || a[1].validators,
|
|
4493
4494
|
disabled: e
|
|
4494
4495
|
};
|
|
4495
|
-
n.type === "email" && !n.rules && (n.rules = ["email"]),
|
|
4496
|
+
n.type === "email" && !n.rules && (n.rules = ["email"]), a[1].type.includes("list") && (n.multiple = !0), !n.api && a[1].data && (n.api = `/api/suggest/${a[1].data}`), t.push(n);
|
|
4496
4497
|
}), t;
|
|
4497
4498
|
}
|
|
4498
4499
|
function Si(o, e, t = !1) {
|
|
4499
|
-
const
|
|
4500
|
+
const a = B(() => Li(
|
|
4500
4501
|
(Array.isArray(e), e),
|
|
4501
4502
|
typeof t == "boolean" ? t : t.value
|
|
4502
4503
|
)), n = w({});
|
|
4503
|
-
function
|
|
4504
|
+
function s(p) {
|
|
4504
4505
|
const f = p?.conditions;
|
|
4505
4506
|
if (!f) return !0;
|
|
4506
|
-
const m = Array.isArray(f) ? f[0] : f,
|
|
4507
|
-
return It(
|
|
4507
|
+
const m = Array.isArray(f) ? f[0] : f, y = o?.value?.[m];
|
|
4508
|
+
return It(y, f);
|
|
4508
4509
|
}
|
|
4509
|
-
const r = (p =
|
|
4510
|
+
const r = (p = a.value, f = !0) => (p.forEach((m) => {
|
|
4510
4511
|
if (m.rules) {
|
|
4511
|
-
if (!
|
|
4512
|
+
if (!s(m)) {
|
|
4512
4513
|
delete n.value[m.name];
|
|
4513
4514
|
return;
|
|
4514
4515
|
}
|
|
4515
|
-
let
|
|
4516
|
-
m.rules.forEach((
|
|
4517
|
-
const R = Vi(o.value[m.name],
|
|
4518
|
-
R && (
|
|
4519
|
-
}),
|
|
4516
|
+
let y = !1, S = null;
|
|
4517
|
+
m.rules.forEach((q) => {
|
|
4518
|
+
const R = Vi(o.value[m.name], q);
|
|
4519
|
+
R && (y = !0, !S && typeof R == "string" && (S = R));
|
|
4520
|
+
}), y && S ? n.value[m.name] = S : delete n.value[m.name];
|
|
4520
4521
|
}
|
|
4521
4522
|
m.schema && r(m.schema, !1);
|
|
4522
|
-
}), f && Object.values(n.value).some(Boolean) ? n.value : null),
|
|
4523
|
+
}), f && Object.values(n.value).some(Boolean) ? n.value : null), u = B(() => a.value?.filter((p) => s(p)));
|
|
4523
4524
|
return {
|
|
4524
4525
|
errors: n,
|
|
4525
4526
|
validate: r,
|
|
4526
4527
|
reset: () => {
|
|
4527
4528
|
o.value = {}, n.value = {};
|
|
4528
4529
|
},
|
|
4529
|
-
visibleSchema:
|
|
4530
|
+
visibleSchema: u
|
|
4530
4531
|
};
|
|
4531
4532
|
}
|
|
4532
4533
|
const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
@@ -4536,7 +4537,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4536
4537
|
class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
|
|
4537
4538
|
}, He = /* @__PURE__ */ U({
|
|
4538
4539
|
__name: "vs-compact-form",
|
|
4539
|
-
props: /* @__PURE__ */
|
|
4540
|
+
props: /* @__PURE__ */ re({
|
|
4540
4541
|
schema: { default: () => [] },
|
|
4541
4542
|
style: { default: () => ({}) },
|
|
4542
4543
|
modelValue: {},
|
|
@@ -4552,24 +4553,24 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4552
4553
|
values: { default: () => ({}) },
|
|
4553
4554
|
valuesModifiers: {}
|
|
4554
4555
|
}),
|
|
4555
|
-
emits: /* @__PURE__ */
|
|
4556
|
+
emits: /* @__PURE__ */ re(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
|
|
4556
4557
|
setup(o, { expose: e, emit: t }) {
|
|
4557
|
-
const
|
|
4558
|
-
errors:
|
|
4558
|
+
const a = t, n = o, s = ue(o, "form"), r = ue(o, "values"), {
|
|
4559
|
+
errors: u,
|
|
4559
4560
|
validate: c,
|
|
4560
4561
|
reset: p,
|
|
4561
4562
|
visibleSchema: f
|
|
4562
|
-
} = Si(r, n.schema, Zt(n, "disabled")), m = w(null),
|
|
4563
|
-
|
|
4563
|
+
} = Si(r, n.schema, Zt(n, "disabled")), m = w(null), y = w(null), S = B(() => n.navigation), q = B(() => n.navWidth), R = B(() => n.style?.columns), K = Object.freeze({ container: 12, label: 3 }), T = B(() => n.columns ?? R.value ?? K), H = B(() => n.columns != null || R.value != null), I = B(() => H.value ? "horizontal" : n.layout), v = (F) => F?.columns ? "horizontal" : I.value, x = (F) => F?.columns ?? T.value, V = () => {
|
|
4564
|
+
a("update:modelValue", r.value), c(), a("handle-submit", r.value);
|
|
4564
4565
|
};
|
|
4565
4566
|
e({
|
|
4566
4567
|
validate: c,
|
|
4567
4568
|
reset: p,
|
|
4568
|
-
errors:
|
|
4569
|
+
errors: u
|
|
4569
4570
|
}), ke(() => {
|
|
4570
|
-
n.modelValue && (r.value = n.modelValue),
|
|
4571
|
+
n.modelValue && (r.value = n.modelValue), s.value = {
|
|
4571
4572
|
value: r.value,
|
|
4572
|
-
errors:
|
|
4573
|
+
errors: u.value,
|
|
4573
4574
|
reset: p,
|
|
4574
4575
|
validate: c,
|
|
4575
4576
|
formId: n.formId
|
|
@@ -4578,14 +4579,14 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4578
4579
|
function _(F, te) {
|
|
4579
4580
|
if (F === te) return !0;
|
|
4580
4581
|
if (typeof F != "object" || typeof te != "object" || !F || !te) return !1;
|
|
4581
|
-
const
|
|
4582
|
-
return
|
|
4582
|
+
const J = Object.keys(F), M = Object.keys(te);
|
|
4583
|
+
return J.length !== M.length ? !1 : J.every((Z) => F[Z] === te[Z]);
|
|
4583
4584
|
}
|
|
4584
|
-
return vt("form",
|
|
4585
|
+
return vt("form", s), vt("values", r), (F, te) => (i(), d("div", Bi, [
|
|
4585
4586
|
l("div", {
|
|
4586
4587
|
class: "flex-1 min-h-0 overflow-y-auto",
|
|
4587
4588
|
ref_key: "formScrollContainer",
|
|
4588
|
-
ref:
|
|
4589
|
+
ref: y
|
|
4589
4590
|
}, [
|
|
4590
4591
|
l("form", {
|
|
4591
4592
|
ref_key: "formRef",
|
|
@@ -4593,31 +4594,31 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4593
4594
|
onSubmit: we(V, ["prevent"]),
|
|
4594
4595
|
class: E(["grid grid-cols-12 p-1", I.value === "default" ? "gap-6" : "gap-4"])
|
|
4595
4596
|
}, [
|
|
4596
|
-
(
|
|
4597
|
-
key:
|
|
4598
|
-
class: E(v(
|
|
4597
|
+
(i(!0), d(se, null, pe(ee(f), (J, M) => (i(), d("div", {
|
|
4598
|
+
key: J.name,
|
|
4599
|
+
class: E(v(J) === "horizontal" ? "col-span-12" : `col-span-${J.col || 12}`)
|
|
4599
4600
|
}, [
|
|
4600
4601
|
A(zt, {
|
|
4601
4602
|
style: be(F.style),
|
|
4602
|
-
item:
|
|
4603
|
-
layout: v(
|
|
4604
|
-
columns: x(
|
|
4605
|
-
"model-value": r.value[
|
|
4606
|
-
"onUpdate:modelValue": (
|
|
4607
|
-
const N = r.value[
|
|
4608
|
-
_(N,
|
|
4603
|
+
item: J,
|
|
4604
|
+
layout: v(J),
|
|
4605
|
+
columns: x(J),
|
|
4606
|
+
"model-value": r.value[J.name],
|
|
4607
|
+
"onUpdate:modelValue": (Z) => {
|
|
4608
|
+
const N = r.value[J.name];
|
|
4609
|
+
_(N, Z) || (r.value[J.name] = Z);
|
|
4609
4610
|
},
|
|
4610
|
-
error: ee(
|
|
4611
|
+
error: ee(u)[J.name]
|
|
4611
4612
|
}, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
|
|
4612
|
-
v(
|
|
4613
|
+
v(J) === "settings" && M + 1 !== ee(f).length ? (i(), d("div", ji)) : D("", !0)
|
|
4613
4614
|
], 2))), 128))
|
|
4614
4615
|
], 34)
|
|
4615
4616
|
], 512),
|
|
4616
4617
|
A(wi, {
|
|
4617
4618
|
target: m.value,
|
|
4618
|
-
"scroll-container":
|
|
4619
|
-
enabled:
|
|
4620
|
-
width:
|
|
4619
|
+
"scroll-container": y.value,
|
|
4620
|
+
enabled: S.value,
|
|
4621
|
+
width: q.value
|
|
4621
4622
|
}, null, 8, ["target", "scroll-container", "enabled", "width"])
|
|
4622
4623
|
]));
|
|
4623
4624
|
}
|
|
@@ -4632,55 +4633,55 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4632
4633
|
},
|
|
4633
4634
|
emits: ["close", "save", "edit"],
|
|
4634
4635
|
setup(o, { emit: e }) {
|
|
4635
|
-
const t = o,
|
|
4636
|
+
const t = o, a = e, n = w(t.schema), s = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = w({}), u = w(), c = w(t.mode);
|
|
4636
4637
|
async function p() {
|
|
4637
4638
|
const m = r.value.validate();
|
|
4638
4639
|
if (m) {
|
|
4639
|
-
de({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([
|
|
4640
|
+
de({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([y, S]) => `${y}: ${S}`).join(`
|
|
4640
4641
|
`) });
|
|
4641
4642
|
return;
|
|
4642
4643
|
}
|
|
4643
|
-
if (
|
|
4644
|
+
if (u.value)
|
|
4644
4645
|
try {
|
|
4645
|
-
const
|
|
4646
|
+
const y = await fetch(`/api/table/${u.value}`, {
|
|
4646
4647
|
method: c.value === "add" ? "POST" : "PUT",
|
|
4647
4648
|
headers: {
|
|
4648
4649
|
"Content-Type": "application/json"
|
|
4649
4650
|
},
|
|
4650
|
-
body: JSON.stringify(
|
|
4651
|
+
body: JSON.stringify(s.value)
|
|
4651
4652
|
});
|
|
4652
|
-
if (
|
|
4653
|
-
await
|
|
4653
|
+
if (y.ok)
|
|
4654
|
+
await y.json(), de({
|
|
4654
4655
|
type: "success",
|
|
4655
4656
|
title: "Успішно",
|
|
4656
4657
|
message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
|
|
4657
|
-
}),
|
|
4658
|
-
else if (
|
|
4659
|
-
const
|
|
4658
|
+
}), a("save", s.value);
|
|
4659
|
+
else if (y.status === 400) {
|
|
4660
|
+
const S = await y.json().catch(() => ({}));
|
|
4660
4661
|
de({
|
|
4661
4662
|
type: "warning",
|
|
4662
4663
|
title: "Помилка валідації",
|
|
4663
|
-
message:
|
|
4664
|
+
message: S.message || "Некоректні дані (400)"
|
|
4664
4665
|
});
|
|
4665
|
-
} else
|
|
4666
|
+
} else y.status === 500 ? de({
|
|
4666
4667
|
type: "error",
|
|
4667
4668
|
title: "Серверна помилка",
|
|
4668
4669
|
message: "Виникла помилка на сервері (500)"
|
|
4669
4670
|
}) : de({
|
|
4670
4671
|
type: "error",
|
|
4671
4672
|
title: "Помилка",
|
|
4672
|
-
message: `Статус: ${
|
|
4673
|
+
message: `Статус: ${y.status}`
|
|
4673
4674
|
});
|
|
4674
|
-
} catch (
|
|
4675
|
+
} catch (y) {
|
|
4675
4676
|
de({
|
|
4676
4677
|
type: "error",
|
|
4677
4678
|
title: "Помилка з’єднання",
|
|
4678
|
-
message:
|
|
4679
|
+
message: y.message || "Не вдалося виконати запит"
|
|
4679
4680
|
});
|
|
4680
4681
|
}
|
|
4681
4682
|
}
|
|
4682
4683
|
function f() {
|
|
4683
|
-
|
|
4684
|
+
a("close");
|
|
4684
4685
|
}
|
|
4685
4686
|
return ke(async () => {
|
|
4686
4687
|
try {
|
|
@@ -4694,11 +4695,11 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4694
4695
|
});
|
|
4695
4696
|
return;
|
|
4696
4697
|
}
|
|
4697
|
-
const
|
|
4698
|
-
n.value =
|
|
4698
|
+
const y = await m.json();
|
|
4699
|
+
n.value = y.schema, u.value = y.token;
|
|
4699
4700
|
} else if (t.token) {
|
|
4700
|
-
|
|
4701
|
-
const m = await fetch(`/api/form/${
|
|
4701
|
+
u.value = t.token;
|
|
4702
|
+
const m = await fetch(`/api/form/${u.value}`);
|
|
4702
4703
|
if (!m.ok) {
|
|
4703
4704
|
de({
|
|
4704
4705
|
type: m.status >= 400 && m.status < 500 ? "warning" : "error",
|
|
@@ -4707,8 +4708,8 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4707
4708
|
});
|
|
4708
4709
|
return;
|
|
4709
4710
|
}
|
|
4710
|
-
const
|
|
4711
|
-
n.value =
|
|
4711
|
+
const y = await m.json();
|
|
4712
|
+
n.value = y.schema, y.data ? s.value = y.data : c.value = "add";
|
|
4712
4713
|
}
|
|
4713
4714
|
} catch (m) {
|
|
4714
4715
|
de({
|
|
@@ -4717,16 +4718,16 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4717
4718
|
message: m.message || "Unexpected error"
|
|
4718
4719
|
}), console.error(m);
|
|
4719
4720
|
}
|
|
4720
|
-
}), (m,
|
|
4721
|
+
}), (m, y) => (i(), d("div", Ei, [
|
|
4721
4722
|
l("div", Ii, [
|
|
4722
4723
|
l("div", zi, [
|
|
4723
4724
|
l("div", Ai, [
|
|
4724
|
-
l("h3", Ti,
|
|
4725
|
+
l("h3", Ti, G(c.value === "add" ? "Додати" : "Змінити"), 1),
|
|
4725
4726
|
l("button", {
|
|
4726
4727
|
onClick: f,
|
|
4727
4728
|
type: "button",
|
|
4728
4729
|
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
|
|
4729
|
-
},
|
|
4730
|
+
}, y[2] || (y[2] = [
|
|
4730
4731
|
l("span", { class: "sr-only" }, "Close", -1),
|
|
4731
4732
|
l("svg", {
|
|
4732
4733
|
class: "flex-shrink-0 w-4 h-4",
|
|
@@ -4746,13 +4747,13 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4746
4747
|
]))
|
|
4747
4748
|
]),
|
|
4748
4749
|
l("div", Fi, [
|
|
4749
|
-
n.value ? (
|
|
4750
|
+
n.value ? (i(), me(He, {
|
|
4750
4751
|
key: 0,
|
|
4751
4752
|
schema: n.value,
|
|
4752
|
-
values:
|
|
4753
|
-
"onUpdate:values":
|
|
4753
|
+
values: s.value,
|
|
4754
|
+
"onUpdate:values": y[0] || (y[0] = (S) => s.value = S),
|
|
4754
4755
|
form: r.value,
|
|
4755
|
-
"onUpdate:form":
|
|
4756
|
+
"onUpdate:form": y[1] || (y[1] = (S) => r.value = S)
|
|
4756
4757
|
}, null, 8, ["schema", "values", "form"])) : D("", !0)
|
|
4757
4758
|
]),
|
|
4758
4759
|
l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
|
|
@@ -4784,8 +4785,8 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
|
|
|
4784
4785
|
onClose: () => {
|
|
4785
4786
|
e(null), t();
|
|
4786
4787
|
},
|
|
4787
|
-
onSave: (
|
|
4788
|
-
e(
|
|
4788
|
+
onSave: (a) => {
|
|
4789
|
+
e(a), t();
|
|
4789
4790
|
}
|
|
4790
4791
|
}
|
|
4791
4792
|
});
|