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