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