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