@opengis/form 0.0.2 → 0.0.4
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/index.css +1 -0
- package/{index.js → dist/index.js} +1115 -1052
- package/dist/index.umd.cjs +6 -0
- package/package.json +40 -6
- package/index.css +0 -1
- package/index.umd.cjs +0 -6
- /package/{vite.svg → dist/vite.svg} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createElementVNode, renderSlot, createCommentVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelRadio, Fragment, renderList, createBlock, resolveDynamicComponent, mergeProps,
|
|
2
|
-
const _hoisted_1$
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createElementVNode, renderSlot, createCommentVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelRadio, Fragment, renderList, createBlock, resolveDynamicComponent, mergeProps, vModelCheckbox, createVNode, ref, normalizeStyle, withCtx, reactive, watch, onMounted, createStaticVNode, Transition, vShow, inject, nextTick, onUnmounted, withModifiers, Teleport, useAttrs, provide } from "vue";
|
|
2
|
+
const _hoisted_1$v = { class: "w-full relative" }, _hoisted_2$b = { class: "text-[14px] font-medium text-gray-900 mb-2" }, _hoisted_3$5 = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "text-red-500 text-[14px]"
|
|
5
5
|
}, _hoisted_4$4 = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
8
|
-
}, _sfc_main$
|
|
8
|
+
}, _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
9
9
|
__name: "vs-layout-default",
|
|
10
10
|
props: {
|
|
11
11
|
ua: {
|
|
@@ -26,7 +26,7 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
setup(e) {
|
|
29
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
29
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
30
30
|
createElementVNode("span", _hoisted_2$b, [
|
|
31
31
|
createElementVNode("span", null, toDisplayString(e.ua || e.label), 1),
|
|
32
32
|
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$5, "*")) : createCommentVNode("", !0)
|
|
@@ -35,13 +35,13 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
35
35
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}), _hoisted_1$
|
|
38
|
+
}), _hoisted_1$u = { class: "w-full relative flex flex-row items-center gap-2" }, _hoisted_2$a = { class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12" }, _hoisted_3$4 = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "text-red-500 text-[14px]"
|
|
41
41
|
}, _hoisted_4$3 = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
44
|
-
}, _sfc_main$
|
|
44
|
+
}, _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
45
45
|
__name: "vs-layout-horizontal",
|
|
46
46
|
props: {
|
|
47
47
|
ua: {
|
|
@@ -62,7 +62,7 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
setup(e) {
|
|
65
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
65
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
66
66
|
createElementVNode("span", _hoisted_2$a, [
|
|
67
67
|
createTextVNode(toDisplayString(e.ua || e.label) + " ", 1),
|
|
68
68
|
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$4, "*")) : createCommentVNode("", !0)
|
|
@@ -71,10 +71,10 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
71
71
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
72
72
|
]));
|
|
73
73
|
}
|
|
74
|
-
}), _hoisted_1$
|
|
74
|
+
}), _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$9 = {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
77
|
-
}, _sfc_main$
|
|
77
|
+
}, _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
78
78
|
__name: "vs-layout-inline",
|
|
79
79
|
props: {
|
|
80
80
|
ua: {
|
|
@@ -95,15 +95,15 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
setup(e) {
|
|
98
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
98
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
99
99
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
100
100
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$9, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
101
101
|
]));
|
|
102
102
|
}
|
|
103
103
|
}), layouts$1 = {
|
|
104
|
-
default: _sfc_main$
|
|
105
|
-
horizontal: _sfc_main$
|
|
106
|
-
inline: _sfc_main$
|
|
104
|
+
default: _sfc_main$A,
|
|
105
|
+
horizontal: _sfc_main$z,
|
|
106
|
+
inline: _sfc_main$y
|
|
107
107
|
};
|
|
108
108
|
function useStyle(e) {
|
|
109
109
|
return {
|
|
@@ -113,7 +113,7 @@ function useStyle(e) {
|
|
|
113
113
|
})
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
const _hoisted_1$
|
|
116
|
+
const _hoisted_1$s = ["placeholder", "disabled"], _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
117
117
|
__name: "vs-input-text",
|
|
118
118
|
props: /* @__PURE__ */ mergeModels({
|
|
119
119
|
style: {
|
|
@@ -141,18 +141,18 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
141
141
|
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue");
|
|
142
142
|
return (o, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
143
143
|
type: "text",
|
|
144
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
144
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => r.value = l),
|
|
145
145
|
placeholder: e.placeholder,
|
|
146
146
|
disabled: e.disabled,
|
|
147
147
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
148
148
|
style: {
|
|
149
149
|
border: "1px solid #CFD9E0"
|
|
150
150
|
}
|
|
151
|
-
}, null, 10, _hoisted_1$
|
|
151
|
+
}, null, 10, _hoisted_1$s)), [
|
|
152
152
|
[vModelText, r.value]
|
|
153
153
|
]);
|
|
154
154
|
}
|
|
155
|
-
}), _hoisted_1$
|
|
155
|
+
}), _hoisted_1$r = ["placeholder"], _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
156
156
|
__name: "vs-input-number",
|
|
157
157
|
props: /* @__PURE__ */ mergeModels({
|
|
158
158
|
style: {
|
|
@@ -172,17 +172,108 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
172
172
|
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue");
|
|
173
173
|
return (o, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
174
174
|
type: "number",
|
|
175
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
175
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => r.value = l),
|
|
176
176
|
placeholder: e.placeholder,
|
|
177
177
|
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(n)]]),
|
|
178
178
|
style: {
|
|
179
179
|
border: "1px solid #CFD9E0"
|
|
180
180
|
}
|
|
181
|
-
}, null, 10, _hoisted_1$
|
|
181
|
+
}, null, 10, _hoisted_1$r)), [
|
|
182
|
+
[vModelText, r.value]
|
|
183
|
+
]);
|
|
184
|
+
}
|
|
185
|
+
}), _hoisted_1$q = ["disabled"], _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
186
|
+
__name: "vs-input-switcher",
|
|
187
|
+
props: /* @__PURE__ */ mergeModels({
|
|
188
|
+
style: {
|
|
189
|
+
type: Object,
|
|
190
|
+
default: () => ({})
|
|
191
|
+
},
|
|
192
|
+
disabled: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: !1
|
|
195
|
+
},
|
|
196
|
+
customClass: {
|
|
197
|
+
type: String,
|
|
198
|
+
default: ""
|
|
199
|
+
}
|
|
200
|
+
}, {
|
|
201
|
+
modelValue: { type: Boolean, default: !1 },
|
|
202
|
+
modelModifiers: {}
|
|
203
|
+
}),
|
|
204
|
+
emits: ["update:modelValue"],
|
|
205
|
+
setup(e) {
|
|
206
|
+
const t = useModel(e, "modelValue");
|
|
207
|
+
return (n, r) => (openBlock(), createElementBlock("button", {
|
|
208
|
+
type: "button",
|
|
209
|
+
class: normalizeClass(["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", [`bg-${e.style?.primaryColor || "blue"}-500`, e.customClass]]),
|
|
210
|
+
disabled: e.disabled,
|
|
211
|
+
onClick: r[0] || (r[0] = (o) => t.value = !t.value)
|
|
212
|
+
}, [
|
|
213
|
+
createElementVNode("span", {
|
|
214
|
+
"data-state": "checked",
|
|
215
|
+
class: normalizeClass(["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"]])
|
|
216
|
+
}, null, 2)
|
|
217
|
+
], 10, _hoisted_1$q));
|
|
218
|
+
}
|
|
219
|
+
}), _hoisted_1$p = ["innerHTML"], _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
220
|
+
__name: "vs-input-static",
|
|
221
|
+
props: {
|
|
222
|
+
html: {
|
|
223
|
+
type: String,
|
|
224
|
+
default: ""
|
|
225
|
+
},
|
|
226
|
+
customClass: {
|
|
227
|
+
type: String,
|
|
228
|
+
default: ""
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
setup(e) {
|
|
232
|
+
return (t, n) => (openBlock(), createElementBlock("div", {
|
|
233
|
+
class: normalizeClass(e.customClass),
|
|
234
|
+
innerHTML: e.html
|
|
235
|
+
}, null, 10, _hoisted_1$p));
|
|
236
|
+
}
|
|
237
|
+
}), _hoisted_1$o = ["placeholder", "disabled"], _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
238
|
+
__name: "vs-input-mask",
|
|
239
|
+
props: /* @__PURE__ */ mergeModels({
|
|
240
|
+
style: {
|
|
241
|
+
type: Object,
|
|
242
|
+
default: () => ({})
|
|
243
|
+
},
|
|
244
|
+
customClass: {
|
|
245
|
+
type: String,
|
|
246
|
+
default: ""
|
|
247
|
+
},
|
|
248
|
+
placeholder: {
|
|
249
|
+
type: String,
|
|
250
|
+
default: ""
|
|
251
|
+
},
|
|
252
|
+
disabled: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
default: !1
|
|
255
|
+
}
|
|
256
|
+
}, {
|
|
257
|
+
modelValue: { default: "" },
|
|
258
|
+
modelModifiers: {}
|
|
259
|
+
}),
|
|
260
|
+
emits: ["update:modelValue"],
|
|
261
|
+
setup(e) {
|
|
262
|
+
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue");
|
|
263
|
+
return (o, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
264
|
+
type: "text",
|
|
265
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => r.value = l),
|
|
266
|
+
placeholder: e.placeholder,
|
|
267
|
+
disabled: e.disabled,
|
|
268
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
269
|
+
style: {
|
|
270
|
+
border: "1px solid #CFD9E0"
|
|
271
|
+
}
|
|
272
|
+
}, null, 10, _hoisted_1$o)), [
|
|
182
273
|
[vModelText, r.value]
|
|
183
274
|
]);
|
|
184
275
|
}
|
|
185
|
-
}), _hoisted_1$
|
|
276
|
+
}), _hoisted_1$n = ["value", "disabled"], _hoisted_2$8 = { class: "text-[13px] text-gray-700" }, _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
186
277
|
__name: "vs-input-radio-default",
|
|
187
278
|
props: /* @__PURE__ */ mergeModels({
|
|
188
279
|
text: {
|
|
@@ -221,7 +312,7 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
221
312
|
value: e.value,
|
|
222
313
|
disabled: e.disabled,
|
|
223
314
|
class: "hidden"
|
|
224
|
-
}, null, 8, _hoisted_1$
|
|
315
|
+
}, null, 8, _hoisted_1$n), [
|
|
225
316
|
[vModelRadio, t.value]
|
|
226
317
|
]),
|
|
227
318
|
createElementVNode("span", {
|
|
@@ -238,7 +329,7 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
238
329
|
createElementVNode("span", _hoisted_2$8, toDisplayString(e.text), 1)
|
|
239
330
|
], 2));
|
|
240
331
|
}
|
|
241
|
-
}), _hoisted_1$
|
|
332
|
+
}), _hoisted_1$m = ["value", "disabled"], _hoisted_2$7 = { class: "text-[13px] text-gray-700" }, _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
242
333
|
__name: "vs-input-radio-buttons",
|
|
243
334
|
props: /* @__PURE__ */ mergeModels({
|
|
244
335
|
text: {
|
|
@@ -280,16 +371,16 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
280
371
|
value: e.value,
|
|
281
372
|
disabled: e.disabled,
|
|
282
373
|
class: "hidden"
|
|
283
|
-
}, null, 8, _hoisted_1$
|
|
374
|
+
}, null, 8, _hoisted_1$m), [
|
|
284
375
|
[vModelRadio, t.value]
|
|
285
376
|
]),
|
|
286
377
|
createElementVNode("span", _hoisted_2$7, toDisplayString(e.text), 1)
|
|
287
378
|
], 2));
|
|
288
379
|
}
|
|
289
380
|
}), layouts = {
|
|
290
|
-
"vs-input-radio-default": _sfc_main$
|
|
291
|
-
"vs-input-radio-buttons": _sfc_main$
|
|
292
|
-
}, _sfc_main$
|
|
381
|
+
"vs-input-radio-default": _sfc_main$s,
|
|
382
|
+
"vs-input-radio-buttons": _sfc_main$r
|
|
383
|
+
}, _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
293
384
|
__name: "vs-input-radio",
|
|
294
385
|
props: /* @__PURE__ */ mergeModels({
|
|
295
386
|
options: {
|
|
@@ -314,13 +405,13 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
314
405
|
return (o, s) => (openBlock(), createElementBlock("div", {
|
|
315
406
|
class: normalizeClass([e.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
316
407
|
}, [
|
|
317
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (
|
|
318
|
-
key:
|
|
319
|
-
text:
|
|
320
|
-
value:
|
|
321
|
-
checked: n.value ===
|
|
408
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(r.value), mergeProps({
|
|
409
|
+
key: l?.id,
|
|
410
|
+
text: l.text,
|
|
411
|
+
value: l.id.toString(),
|
|
412
|
+
checked: n.value === l.id,
|
|
322
413
|
modelValue: n.value,
|
|
323
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
414
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => n.value = i)
|
|
324
415
|
}, { ref_for: !0 }, o.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
325
416
|
], 2));
|
|
326
417
|
}
|
|
@@ -347,14 +438,6 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
347
438
|
return !1;
|
|
348
439
|
const t = getPrototypeOf(e);
|
|
349
440
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(toStringTag in e) && !(iterator in e);
|
|
350
|
-
}, isEmptyObject = (e) => {
|
|
351
|
-
if (!isObject(e) || isBuffer(e))
|
|
352
|
-
return !1;
|
|
353
|
-
try {
|
|
354
|
-
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
355
|
-
} catch {
|
|
356
|
-
return !1;
|
|
357
|
-
}
|
|
358
441
|
}, isDate = kindOfTest("Date"), isFile = kindOfTest("File"), isBlob = kindOfTest("Blob"), isFileList = kindOfTest("FileList"), isStream = (e) => isObject(e) && isFunction(e.pipe), isFormData = (e) => {
|
|
359
442
|
let t;
|
|
360
443
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
@@ -368,17 +451,13 @@ function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
368
451
|
for (r = 0, o = e.length; r < o; r++)
|
|
369
452
|
t.call(null, e[r], r, e);
|
|
370
453
|
else {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
for (r = 0; r < i; r++)
|
|
376
|
-
l = s[r], t.call(null, e[l], l, e);
|
|
454
|
+
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length;
|
|
455
|
+
let i;
|
|
456
|
+
for (r = 0; r < l; r++)
|
|
457
|
+
i = s[r], t.call(null, e[i], i, e);
|
|
377
458
|
}
|
|
378
459
|
}
|
|
379
460
|
function findKey(e, t) {
|
|
380
|
-
if (isBuffer(e))
|
|
381
|
-
return null;
|
|
382
461
|
t = t.toLowerCase();
|
|
383
462
|
const n = Object.keys(e);
|
|
384
463
|
let r = n.length, o;
|
|
@@ -404,12 +483,12 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
404
483
|
value: t.prototype
|
|
405
484
|
}), n && Object.assign(e.prototype, n);
|
|
406
485
|
}, toFlatObject = (e, t, n, r) => {
|
|
407
|
-
let o, s,
|
|
408
|
-
const
|
|
486
|
+
let o, s, l;
|
|
487
|
+
const i = {};
|
|
409
488
|
if (t = t || {}, e == null) return t;
|
|
410
489
|
do {
|
|
411
490
|
for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
|
|
412
|
-
|
|
491
|
+
l = o[s], (!r || r(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
413
492
|
e = n !== !1 && getPrototypeOf(e);
|
|
414
493
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
415
494
|
return t;
|
|
@@ -447,8 +526,8 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
447
526
|
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
448
527
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
449
528
|
forEach(n, (o, s) => {
|
|
450
|
-
let
|
|
451
|
-
(
|
|
529
|
+
let l;
|
|
530
|
+
(l = t(o, s, e)) !== !1 && (r[s] = l || o);
|
|
452
531
|
}), Object.defineProperties(e, r);
|
|
453
532
|
}, freezeMethods = (e) => {
|
|
454
533
|
reduceDescriptors(e, (t, n) => {
|
|
@@ -482,14 +561,12 @@ const toJSONObject = (e) => {
|
|
|
482
561
|
if (isObject(r)) {
|
|
483
562
|
if (t.indexOf(r) >= 0)
|
|
484
563
|
return;
|
|
485
|
-
if (isBuffer(r))
|
|
486
|
-
return r;
|
|
487
564
|
if (!("toJSON" in r)) {
|
|
488
565
|
t[o] = r;
|
|
489
566
|
const s = isArray(r) ? [] : {};
|
|
490
|
-
return forEach(r, (
|
|
491
|
-
const u = n(
|
|
492
|
-
!isUndefined(u) && (s[
|
|
567
|
+
return forEach(r, (l, i) => {
|
|
568
|
+
const u = n(l, o + 1);
|
|
569
|
+
!isUndefined(u) && (s[i] = u);
|
|
493
570
|
}), t[o] = void 0, s;
|
|
494
571
|
}
|
|
495
572
|
}
|
|
@@ -514,7 +591,6 @@ const toJSONObject = (e) => {
|
|
|
514
591
|
isBoolean,
|
|
515
592
|
isObject,
|
|
516
593
|
isPlainObject,
|
|
517
|
-
isEmptyObject,
|
|
518
594
|
isReadableStream,
|
|
519
595
|
isRequest,
|
|
520
596
|
isResponse,
|
|
@@ -608,10 +684,10 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
608
684
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
609
685
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
610
686
|
AxiosError$1.from = (e, t, n, r, o, s) => {
|
|
611
|
-
const
|
|
612
|
-
return utils$1.toFlatObject(e,
|
|
687
|
+
const l = Object.create(prototype$1);
|
|
688
|
+
return utils$1.toFlatObject(e, l, function(u) {
|
|
613
689
|
return u !== Error.prototype;
|
|
614
|
-
}, (
|
|
690
|
+
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, n, r, o), l.cause = e, l.name = e.name, s && Object.assign(l, s), l;
|
|
615
691
|
};
|
|
616
692
|
const httpAdapter = null;
|
|
617
693
|
function isVisitable(e) {
|
|
@@ -641,7 +717,7 @@ function toFormData$1(e, t, n) {
|
|
|
641
717
|
}, !1, function(y, m) {
|
|
642
718
|
return !utils$1.isUndefined(m[y]);
|
|
643
719
|
});
|
|
644
|
-
const r = n.metaTokens, o = n.visitor || a, s = n.dots,
|
|
720
|
+
const r = n.metaTokens, o = n.visitor || a, s = n.dots, l = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
645
721
|
if (!utils$1.isFunction(o))
|
|
646
722
|
throw new TypeError("visitor must be a function");
|
|
647
723
|
function c(p) {
|
|
@@ -660,11 +736,11 @@ function toFormData$1(e, t, n) {
|
|
|
660
736
|
if (utils$1.endsWith(y, "{}"))
|
|
661
737
|
y = r ? y : y.slice(0, -2), p = JSON.stringify(p);
|
|
662
738
|
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (x = utils$1.toArray(p)))
|
|
663
|
-
return y = removeBrackets(y), x.forEach(function(
|
|
664
|
-
!(utils$1.isUndefined(
|
|
739
|
+
return y = removeBrackets(y), x.forEach(function(v, _) {
|
|
740
|
+
!(utils$1.isUndefined(v) || v === null) && t.append(
|
|
665
741
|
// eslint-disable-next-line no-nested-ternary
|
|
666
|
-
|
|
667
|
-
c(
|
|
742
|
+
l === !0 ? renderKey([y], _, s) : l === null ? y : y + "[]",
|
|
743
|
+
c(v)
|
|
668
744
|
);
|
|
669
745
|
}), !1;
|
|
670
746
|
}
|
|
@@ -736,8 +812,8 @@ function buildURL(e, t, n) {
|
|
|
736
812
|
const o = n && n.serialize;
|
|
737
813
|
let s;
|
|
738
814
|
if (o ? s = o(t, n) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, n).toString(r), s) {
|
|
739
|
-
const
|
|
740
|
-
|
|
815
|
+
const l = e.indexOf("#");
|
|
816
|
+
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
741
817
|
}
|
|
742
818
|
return e;
|
|
743
819
|
}
|
|
@@ -820,12 +896,11 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
820
896
|
...platform$1
|
|
821
897
|
};
|
|
822
898
|
function toURLEncodedForm(e, t) {
|
|
823
|
-
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
899
|
+
return toFormData$1(e, new platform.classes.URLSearchParams(), Object.assign({
|
|
824
900
|
visitor: function(n, r, o, s) {
|
|
825
901
|
return platform.isNode && utils$1.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
});
|
|
902
|
+
}
|
|
903
|
+
}, t));
|
|
829
904
|
}
|
|
830
905
|
function parsePropPath(e) {
|
|
831
906
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
@@ -841,10 +916,10 @@ function arrayToObject(e) {
|
|
|
841
916
|
}
|
|
842
917
|
function formDataToJSON(e) {
|
|
843
918
|
function t(n, r, o, s) {
|
|
844
|
-
let
|
|
845
|
-
if (
|
|
846
|
-
const
|
|
847
|
-
return
|
|
919
|
+
let l = n[s++];
|
|
920
|
+
if (l === "__proto__") return !0;
|
|
921
|
+
const i = Number.isFinite(+l), u = s >= n.length;
|
|
922
|
+
return l = !l && utils$1.isArray(o) ? o.length : l, u ? (utils$1.hasOwnProp(o, l) ? o[l] = [o[l], r] : o[l] = r, !i) : ((!o[l] || !utils$1.isObject(o[l])) && (o[l] = []), t(n, r, o[l], s) && utils$1.isArray(o[l]) && (o[l] = arrayToObject(o[l])), !i);
|
|
848
923
|
}
|
|
849
924
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
850
925
|
const n = {};
|
|
@@ -877,14 +952,14 @@ const defaults = {
|
|
|
877
952
|
return t.buffer;
|
|
878
953
|
if (utils$1.isURLSearchParams(t))
|
|
879
954
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
880
|
-
let
|
|
955
|
+
let i;
|
|
881
956
|
if (s) {
|
|
882
957
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
883
958
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
884
|
-
if ((
|
|
959
|
+
if ((i = utils$1.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
885
960
|
const u = this.env && this.env.FormData;
|
|
886
961
|
return toFormData$1(
|
|
887
|
-
|
|
962
|
+
i ? { "files[]": t } : t,
|
|
888
963
|
u && new u(),
|
|
889
964
|
this.formSerializer
|
|
890
965
|
);
|
|
@@ -897,12 +972,12 @@ const defaults = {
|
|
|
897
972
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
898
973
|
return t;
|
|
899
974
|
if (t && utils$1.isString(t) && (r && !this.responseType || o)) {
|
|
900
|
-
const
|
|
975
|
+
const l = !(n && n.silentJSONParsing) && o;
|
|
901
976
|
try {
|
|
902
977
|
return JSON.parse(t);
|
|
903
|
-
} catch (
|
|
904
|
-
if (
|
|
905
|
-
throw
|
|
978
|
+
} catch (i) {
|
|
979
|
+
if (l)
|
|
980
|
+
throw i.name === "SyntaxError" ? AxiosError$1.from(i, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response) : i;
|
|
906
981
|
}
|
|
907
982
|
}
|
|
908
983
|
return t;
|
|
@@ -955,8 +1030,8 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
955
1030
|
const t = {};
|
|
956
1031
|
let n, r, o;
|
|
957
1032
|
return e && e.split(`
|
|
958
|
-
`).forEach(function(
|
|
959
|
-
o =
|
|
1033
|
+
`).forEach(function(l) {
|
|
1034
|
+
o = l.indexOf(":"), n = l.substring(0, o).trim().toLowerCase(), r = l.substring(o + 1).trim(), !(!n || t[n] && ignoreDuplicateOf[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
960
1035
|
}), t;
|
|
961
1036
|
}, $internals = Symbol("internals");
|
|
962
1037
|
function normalizeHeader(e) {
|
|
@@ -990,8 +1065,8 @@ function buildAccessors(e, t) {
|
|
|
990
1065
|
const n = utils$1.toCamelCase(" " + t);
|
|
991
1066
|
["get", "set", "has"].forEach((r) => {
|
|
992
1067
|
Object.defineProperty(e, r + n, {
|
|
993
|
-
value: function(o, s,
|
|
994
|
-
return this[r].call(this, t, o, s,
|
|
1068
|
+
value: function(o, s, l) {
|
|
1069
|
+
return this[r].call(this, t, o, s, l);
|
|
995
1070
|
},
|
|
996
1071
|
configurable: !0
|
|
997
1072
|
});
|
|
@@ -1003,26 +1078,26 @@ let AxiosHeaders$1 = class {
|
|
|
1003
1078
|
}
|
|
1004
1079
|
set(t, n, r) {
|
|
1005
1080
|
const o = this;
|
|
1006
|
-
function s(
|
|
1081
|
+
function s(i, u, c) {
|
|
1007
1082
|
const a = normalizeHeader(u);
|
|
1008
1083
|
if (!a)
|
|
1009
1084
|
throw new Error("header name must be a non-empty string");
|
|
1010
1085
|
const d = utils$1.findKey(o, a);
|
|
1011
|
-
(!d || o[d] === void 0 || c === !0 || c === void 0 && o[d] !== !1) && (o[d || u] = normalizeValue(
|
|
1086
|
+
(!d || o[d] === void 0 || c === !0 || c === void 0 && o[d] !== !1) && (o[d || u] = normalizeValue(i));
|
|
1012
1087
|
}
|
|
1013
|
-
const
|
|
1088
|
+
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
1014
1089
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
1015
|
-
|
|
1090
|
+
l(t, n);
|
|
1016
1091
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
1017
|
-
|
|
1092
|
+
l(parseHeaders(t), n);
|
|
1018
1093
|
else if (utils$1.isObject(t) && utils$1.isIterable(t)) {
|
|
1019
|
-
let
|
|
1094
|
+
let i = {}, u, c;
|
|
1020
1095
|
for (const a of t) {
|
|
1021
1096
|
if (!utils$1.isArray(a))
|
|
1022
1097
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1023
|
-
|
|
1098
|
+
i[c = a[0]] = (u = i[c]) ? utils$1.isArray(u) ? [...u, a[1]] : [u, a[1]] : a[1];
|
|
1024
1099
|
}
|
|
1025
|
-
i
|
|
1100
|
+
l(i, n);
|
|
1026
1101
|
} else
|
|
1027
1102
|
t != null && s(n, t, r);
|
|
1028
1103
|
return this;
|
|
@@ -1054,10 +1129,10 @@ let AxiosHeaders$1 = class {
|
|
|
1054
1129
|
delete(t, n) {
|
|
1055
1130
|
const r = this;
|
|
1056
1131
|
let o = !1;
|
|
1057
|
-
function s(
|
|
1058
|
-
if (
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1132
|
+
function s(l) {
|
|
1133
|
+
if (l = normalizeHeader(l), l) {
|
|
1134
|
+
const i = utils$1.findKey(r, l);
|
|
1135
|
+
i && (!n || matchHeaderValue(r, r[i], i, n)) && (delete r[i], o = !0);
|
|
1061
1136
|
}
|
|
1062
1137
|
}
|
|
1063
1138
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), o;
|
|
@@ -1074,13 +1149,13 @@ let AxiosHeaders$1 = class {
|
|
|
1074
1149
|
normalize(t) {
|
|
1075
1150
|
const n = this, r = {};
|
|
1076
1151
|
return utils$1.forEach(this, (o, s) => {
|
|
1077
|
-
const
|
|
1078
|
-
if (
|
|
1079
|
-
n[
|
|
1152
|
+
const l = utils$1.findKey(r, s);
|
|
1153
|
+
if (l) {
|
|
1154
|
+
n[l] = normalizeValue(o), delete n[s];
|
|
1080
1155
|
return;
|
|
1081
1156
|
}
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1157
|
+
const i = t ? formatHeader(s) : String(s).trim();
|
|
1158
|
+
i !== s && delete n[s], n[i] = normalizeValue(o), r[i] = !0;
|
|
1084
1159
|
}), this;
|
|
1085
1160
|
}
|
|
1086
1161
|
concat(...t) {
|
|
@@ -1116,9 +1191,9 @@ let AxiosHeaders$1 = class {
|
|
|
1116
1191
|
const r = (this[$internals] = this[$internals] = {
|
|
1117
1192
|
accessors: {}
|
|
1118
1193
|
}).accessors, o = this.prototype;
|
|
1119
|
-
function s(
|
|
1120
|
-
const
|
|
1121
|
-
r[
|
|
1194
|
+
function s(l) {
|
|
1195
|
+
const i = normalizeHeader(l);
|
|
1196
|
+
r[i] || (buildAccessors(o, l), r[i] = !0);
|
|
1122
1197
|
}
|
|
1123
1198
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1124
1199
|
}
|
|
@@ -1137,8 +1212,8 @@ utils$1.freezeMethods(AxiosHeaders$1);
|
|
|
1137
1212
|
function transformData(e, t) {
|
|
1138
1213
|
const n = this || defaults, r = t || n, o = AxiosHeaders$1.from(r.headers);
|
|
1139
1214
|
let s = r.data;
|
|
1140
|
-
return utils$1.forEach(e, function(
|
|
1141
|
-
s =
|
|
1215
|
+
return utils$1.forEach(e, function(i) {
|
|
1216
|
+
s = i.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1142
1217
|
}), o.normalize(), s;
|
|
1143
1218
|
}
|
|
1144
1219
|
function isCancel$1(e) {
|
|
@@ -1167,14 +1242,14 @@ function parseProtocol(e) {
|
|
|
1167
1242
|
function speedometer(e, t) {
|
|
1168
1243
|
e = e || 10;
|
|
1169
1244
|
const n = new Array(e), r = new Array(e);
|
|
1170
|
-
let o = 0, s = 0,
|
|
1245
|
+
let o = 0, s = 0, l;
|
|
1171
1246
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1172
1247
|
const c = Date.now(), a = r[s];
|
|
1173
|
-
|
|
1248
|
+
l || (l = c), n[o] = u, r[o] = c;
|
|
1174
1249
|
let d = s, f = 0;
|
|
1175
1250
|
for (; d !== o; )
|
|
1176
1251
|
f += n[d++], d = d % e;
|
|
1177
|
-
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c -
|
|
1252
|
+
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c - l < t)
|
|
1178
1253
|
return;
|
|
1179
1254
|
const h = a && c - a;
|
|
1180
1255
|
return h ? Math.round(f * 1e3 / h) : void 0;
|
|
@@ -1182,31 +1257,31 @@ function speedometer(e, t) {
|
|
|
1182
1257
|
}
|
|
1183
1258
|
function throttle(e, t) {
|
|
1184
1259
|
let n = 0, r = 1e3 / t, o, s;
|
|
1185
|
-
const
|
|
1186
|
-
n = a, o = null, s && (clearTimeout(s), s = null), e(
|
|
1260
|
+
const l = (c, a = Date.now()) => {
|
|
1261
|
+
n = a, o = null, s && (clearTimeout(s), s = null), e.apply(null, c);
|
|
1187
1262
|
};
|
|
1188
1263
|
return [(...c) => {
|
|
1189
1264
|
const a = Date.now(), d = a - n;
|
|
1190
|
-
d >= r ?
|
|
1191
|
-
s = null,
|
|
1265
|
+
d >= r ? l(c, a) : (o = c, s || (s = setTimeout(() => {
|
|
1266
|
+
s = null, l(o);
|
|
1192
1267
|
}, r - d)));
|
|
1193
|
-
}, () => o &&
|
|
1268
|
+
}, () => o && l(o)];
|
|
1194
1269
|
}
|
|
1195
1270
|
const progressEventReducer = (e, t, n = 3) => {
|
|
1196
1271
|
let r = 0;
|
|
1197
1272
|
const o = speedometer(50, 250);
|
|
1198
1273
|
return throttle((s) => {
|
|
1199
|
-
const
|
|
1200
|
-
r =
|
|
1274
|
+
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l - r, c = o(u), a = l <= i;
|
|
1275
|
+
r = l;
|
|
1201
1276
|
const d = {
|
|
1202
|
-
loaded:
|
|
1203
|
-
total:
|
|
1204
|
-
progress:
|
|
1277
|
+
loaded: l,
|
|
1278
|
+
total: i,
|
|
1279
|
+
progress: i ? l / i : void 0,
|
|
1205
1280
|
bytes: u,
|
|
1206
1281
|
rate: c || void 0,
|
|
1207
|
-
estimated: c &&
|
|
1282
|
+
estimated: c && i && a ? (i - l) / c : void 0,
|
|
1208
1283
|
event: s,
|
|
1209
|
-
lengthComputable:
|
|
1284
|
+
lengthComputable: i != null,
|
|
1210
1285
|
[t ? "download" : "upload"]: !0
|
|
1211
1286
|
};
|
|
1212
1287
|
e(d);
|
|
@@ -1225,8 +1300,8 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1225
1300
|
// Standard browser envs support document.cookie
|
|
1226
1301
|
{
|
|
1227
1302
|
write(e, t, n, r, o, s) {
|
|
1228
|
-
const
|
|
1229
|
-
utils$1.isNumber(n) &&
|
|
1303
|
+
const l = [e + "=" + encodeURIComponent(t)];
|
|
1304
|
+
utils$1.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), utils$1.isString(r) && l.push("path=" + r), utils$1.isString(o) && l.push("domain=" + o), s === !0 && l.push("secure"), document.cookie = l.join("; ");
|
|
1230
1305
|
},
|
|
1231
1306
|
read(e) {
|
|
1232
1307
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1275,13 +1350,13 @@ function mergeConfig$1(e, t) {
|
|
|
1275
1350
|
if (!utils$1.isUndefined(a))
|
|
1276
1351
|
return r(void 0, a);
|
|
1277
1352
|
}
|
|
1278
|
-
function
|
|
1353
|
+
function l(c, a) {
|
|
1279
1354
|
if (utils$1.isUndefined(a)) {
|
|
1280
1355
|
if (!utils$1.isUndefined(c))
|
|
1281
1356
|
return r(void 0, c);
|
|
1282
1357
|
} else return r(void 0, a);
|
|
1283
1358
|
}
|
|
1284
|
-
function
|
|
1359
|
+
function i(c, a, d) {
|
|
1285
1360
|
if (d in t)
|
|
1286
1361
|
return r(c, a);
|
|
1287
1362
|
if (d in e)
|
|
@@ -1291,65 +1366,65 @@ function mergeConfig$1(e, t) {
|
|
|
1291
1366
|
url: s,
|
|
1292
1367
|
method: s,
|
|
1293
1368
|
data: s,
|
|
1294
|
-
baseURL:
|
|
1295
|
-
transformRequest:
|
|
1296
|
-
transformResponse:
|
|
1297
|
-
paramsSerializer:
|
|
1298
|
-
timeout:
|
|
1299
|
-
timeoutMessage:
|
|
1300
|
-
withCredentials:
|
|
1301
|
-
withXSRFToken:
|
|
1302
|
-
adapter:
|
|
1303
|
-
responseType:
|
|
1304
|
-
xsrfCookieName:
|
|
1305
|
-
xsrfHeaderName:
|
|
1306
|
-
onUploadProgress:
|
|
1307
|
-
onDownloadProgress:
|
|
1308
|
-
decompress:
|
|
1309
|
-
maxContentLength:
|
|
1310
|
-
maxBodyLength:
|
|
1311
|
-
beforeRedirect:
|
|
1312
|
-
transport:
|
|
1313
|
-
httpAgent:
|
|
1314
|
-
httpsAgent:
|
|
1315
|
-
cancelToken:
|
|
1316
|
-
socketPath:
|
|
1317
|
-
responseEncoding:
|
|
1318
|
-
validateStatus:
|
|
1369
|
+
baseURL: l,
|
|
1370
|
+
transformRequest: l,
|
|
1371
|
+
transformResponse: l,
|
|
1372
|
+
paramsSerializer: l,
|
|
1373
|
+
timeout: l,
|
|
1374
|
+
timeoutMessage: l,
|
|
1375
|
+
withCredentials: l,
|
|
1376
|
+
withXSRFToken: l,
|
|
1377
|
+
adapter: l,
|
|
1378
|
+
responseType: l,
|
|
1379
|
+
xsrfCookieName: l,
|
|
1380
|
+
xsrfHeaderName: l,
|
|
1381
|
+
onUploadProgress: l,
|
|
1382
|
+
onDownloadProgress: l,
|
|
1383
|
+
decompress: l,
|
|
1384
|
+
maxContentLength: l,
|
|
1385
|
+
maxBodyLength: l,
|
|
1386
|
+
beforeRedirect: l,
|
|
1387
|
+
transport: l,
|
|
1388
|
+
httpAgent: l,
|
|
1389
|
+
httpsAgent: l,
|
|
1390
|
+
cancelToken: l,
|
|
1391
|
+
socketPath: l,
|
|
1392
|
+
responseEncoding: l,
|
|
1393
|
+
validateStatus: i,
|
|
1319
1394
|
headers: (c, a, d) => o(headersToObject(c), headersToObject(a), d, !0)
|
|
1320
1395
|
};
|
|
1321
|
-
return utils$1.forEach(Object.keys({
|
|
1396
|
+
return utils$1.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
|
|
1322
1397
|
const d = u[a] || o, f = d(e[a], t[a], a);
|
|
1323
|
-
utils$1.isUndefined(f) && d !==
|
|
1398
|
+
utils$1.isUndefined(f) && d !== i || (n[a] = f);
|
|
1324
1399
|
}), n;
|
|
1325
1400
|
}
|
|
1326
1401
|
const resolveConfig = (e) => {
|
|
1327
1402
|
const t = mergeConfig$1({}, e);
|
|
1328
|
-
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers:
|
|
1329
|
-
t.headers =
|
|
1403
|
+
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: l, auth: i } = t;
|
|
1404
|
+
t.headers = l = AxiosHeaders$1.from(l), t.url = buildURL(buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && l.set(
|
|
1330
1405
|
"Authorization",
|
|
1331
|
-
"Basic " + btoa((
|
|
1406
|
+
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
1332
1407
|
);
|
|
1333
1408
|
let u;
|
|
1334
1409
|
if (utils$1.isFormData(n)) {
|
|
1335
1410
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1336
|
-
|
|
1337
|
-
else if ((u =
|
|
1411
|
+
l.setContentType(void 0);
|
|
1412
|
+
else if ((u = l.getContentType()) !== !1) {
|
|
1338
1413
|
const [c, ...a] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1339
|
-
|
|
1414
|
+
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1340
1415
|
}
|
|
1341
1416
|
}
|
|
1342
1417
|
if (platform.hasStandardBrowserEnv && (r && utils$1.isFunction(r) && (r = r(t)), r || r !== !1 && isURLSameOrigin(t.url))) {
|
|
1343
1418
|
const c = o && s && cookies.read(s);
|
|
1344
|
-
c &&
|
|
1419
|
+
c && l.set(o, c);
|
|
1345
1420
|
}
|
|
1346
1421
|
return t;
|
|
1347
1422
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1348
1423
|
return new Promise(function(n, r) {
|
|
1349
1424
|
const o = resolveConfig(e);
|
|
1350
1425
|
let s = o.data;
|
|
1351
|
-
const
|
|
1352
|
-
let { responseType:
|
|
1426
|
+
const l = AxiosHeaders$1.from(o.headers).normalize();
|
|
1427
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = o, a, d, f, h, p;
|
|
1353
1428
|
function y() {
|
|
1354
1429
|
h && h(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(a), o.signal && o.signal.removeEventListener("abort", a);
|
|
1355
1430
|
}
|
|
@@ -1358,13 +1433,13 @@ const resolveConfig = (e) => {
|
|
|
1358
1433
|
function x() {
|
|
1359
1434
|
if (!m)
|
|
1360
1435
|
return;
|
|
1361
|
-
const
|
|
1436
|
+
const v = AxiosHeaders$1.from(
|
|
1362
1437
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1363
1438
|
), k = {
|
|
1364
|
-
data: !
|
|
1439
|
+
data: !i || i === "text" || i === "json" ? m.responseText : m.response,
|
|
1365
1440
|
status: m.status,
|
|
1366
1441
|
statusText: m.statusText,
|
|
1367
|
-
headers:
|
|
1442
|
+
headers: v,
|
|
1368
1443
|
config: e,
|
|
1369
1444
|
request: m
|
|
1370
1445
|
};
|
|
@@ -1389,10 +1464,10 @@ const resolveConfig = (e) => {
|
|
|
1389
1464
|
e,
|
|
1390
1465
|
m
|
|
1391
1466
|
)), m = null;
|
|
1392
|
-
}, s === void 0 &&
|
|
1467
|
+
}, s === void 0 && l.setContentType(null), "setRequestHeader" in m && utils$1.forEach(l.toJSON(), function(_, k) {
|
|
1393
1468
|
m.setRequestHeader(k, _);
|
|
1394
|
-
}), utils$1.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials),
|
|
1395
|
-
m && (r(!
|
|
1469
|
+
}), utils$1.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), i && i !== "json" && (m.responseType = o.responseType), c && ([f, p] = progressEventReducer(c, !0), m.addEventListener("progress", f)), u && m.upload && ([d, h] = progressEventReducer(u), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (a = (v) => {
|
|
1470
|
+
m && (r(!v || v.type ? new CanceledError$1(null, e, m) : v), m.abort(), m = null);
|
|
1396
1471
|
}, o.cancelToken && o.cancelToken.subscribe(a), o.signal && (o.signal.aborted ? a() : o.signal.addEventListener("abort", a)));
|
|
1397
1472
|
const $ = parseProtocol(o.url);
|
|
1398
1473
|
if ($ && platform.protocols.indexOf($) === -1) {
|
|
@@ -1407,22 +1482,22 @@ const resolveConfig = (e) => {
|
|
|
1407
1482
|
let r = new AbortController(), o;
|
|
1408
1483
|
const s = function(c) {
|
|
1409
1484
|
if (!o) {
|
|
1410
|
-
o = !0,
|
|
1485
|
+
o = !0, i();
|
|
1411
1486
|
const a = c instanceof Error ? c : this.reason;
|
|
1412
1487
|
r.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
1413
1488
|
}
|
|
1414
1489
|
};
|
|
1415
|
-
let
|
|
1416
|
-
|
|
1490
|
+
let l = t && setTimeout(() => {
|
|
1491
|
+
l = null, s(new AxiosError$1(`timeout ${t} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
1417
1492
|
}, t);
|
|
1418
|
-
const
|
|
1419
|
-
e && (
|
|
1493
|
+
const i = () => {
|
|
1494
|
+
e && (l && clearTimeout(l), l = null, e.forEach((c) => {
|
|
1420
1495
|
c.unsubscribe ? c.unsubscribe(s) : c.removeEventListener("abort", s);
|
|
1421
1496
|
}), e = null);
|
|
1422
1497
|
};
|
|
1423
1498
|
e.forEach((c) => c.addEventListener("abort", s));
|
|
1424
1499
|
const { signal: u } = r;
|
|
1425
|
-
return u.unsubscribe = () => utils$1.asap(
|
|
1500
|
+
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
1426
1501
|
}
|
|
1427
1502
|
}, streamChunk = function* (e, t) {
|
|
1428
1503
|
let n = e.byteLength;
|
|
@@ -1454,15 +1529,15 @@ const resolveConfig = (e) => {
|
|
|
1454
1529
|
}
|
|
1455
1530
|
}, trackStream = (e, t, n, r) => {
|
|
1456
1531
|
const o = readBytes(e, t);
|
|
1457
|
-
let s = 0,
|
|
1458
|
-
|
|
1532
|
+
let s = 0, l, i = (u) => {
|
|
1533
|
+
l || (l = !0, r && r(u));
|
|
1459
1534
|
};
|
|
1460
1535
|
return new ReadableStream({
|
|
1461
1536
|
async pull(u) {
|
|
1462
1537
|
try {
|
|
1463
1538
|
const { done: c, value: a } = await o.next();
|
|
1464
1539
|
if (c) {
|
|
1465
|
-
|
|
1540
|
+
i(), u.close();
|
|
1466
1541
|
return;
|
|
1467
1542
|
}
|
|
1468
1543
|
let d = a.byteLength;
|
|
@@ -1472,11 +1547,11 @@ const resolveConfig = (e) => {
|
|
|
1472
1547
|
}
|
|
1473
1548
|
u.enqueue(new Uint8Array(a));
|
|
1474
1549
|
} catch (c) {
|
|
1475
|
-
throw
|
|
1550
|
+
throw i(c), c;
|
|
1476
1551
|
}
|
|
1477
1552
|
},
|
|
1478
1553
|
cancel(u) {
|
|
1479
|
-
return
|
|
1554
|
+
return i(u), o.return();
|
|
1480
1555
|
}
|
|
1481
1556
|
}, {
|
|
1482
1557
|
highWaterMark: 2
|
|
@@ -1531,8 +1606,8 @@ const getBodyLength = async (e) => {
|
|
|
1531
1606
|
data: r,
|
|
1532
1607
|
signal: o,
|
|
1533
1608
|
cancelToken: s,
|
|
1534
|
-
timeout:
|
|
1535
|
-
onDownloadProgress:
|
|
1609
|
+
timeout: l,
|
|
1610
|
+
onDownloadProgress: i,
|
|
1536
1611
|
onUploadProgress: u,
|
|
1537
1612
|
responseType: c,
|
|
1538
1613
|
headers: a,
|
|
@@ -1540,7 +1615,7 @@ const getBodyLength = async (e) => {
|
|
|
1540
1615
|
fetchOptions: f
|
|
1541
1616
|
} = resolveConfig(e);
|
|
1542
1617
|
c = c ? (c + "").toLowerCase() : "text";
|
|
1543
|
-
let h = composeSignals([o, s && s.toAbortSignal()],
|
|
1618
|
+
let h = composeSignals([o, s && s.toAbortSignal()], l), p;
|
|
1544
1619
|
const y = h && h.unsubscribe && (() => {
|
|
1545
1620
|
h.unsubscribe();
|
|
1546
1621
|
});
|
|
@@ -1553,11 +1628,11 @@ const getBodyLength = async (e) => {
|
|
|
1553
1628
|
duplex: "half"
|
|
1554
1629
|
}), b;
|
|
1555
1630
|
if (utils$1.isFormData(r) && (b = k.headers.get("content-type")) && a.setContentType(b), k.body) {
|
|
1556
|
-
const [g,
|
|
1631
|
+
const [g, w] = progressEventDecorator(
|
|
1557
1632
|
m,
|
|
1558
1633
|
progressEventReducer(asyncDecorator(u))
|
|
1559
1634
|
);
|
|
1560
|
-
r = trackStream(k.body, DEFAULT_CHUNK_SIZE, g,
|
|
1635
|
+
r = trackStream(k.body, DEFAULT_CHUNK_SIZE, g, w);
|
|
1561
1636
|
}
|
|
1562
1637
|
}
|
|
1563
1638
|
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1572,26 +1647,26 @@ const getBodyLength = async (e) => {
|
|
|
1572
1647
|
credentials: x ? d : void 0
|
|
1573
1648
|
});
|
|
1574
1649
|
let $ = await fetch(p, f);
|
|
1575
|
-
const
|
|
1576
|
-
if (supportsResponseStream && (
|
|
1650
|
+
const v = supportsResponseStream && (c === "stream" || c === "response");
|
|
1651
|
+
if (supportsResponseStream && (i || v && y)) {
|
|
1577
1652
|
const k = {};
|
|
1578
1653
|
["status", "statusText", "headers"].forEach((E) => {
|
|
1579
1654
|
k[E] = $[E];
|
|
1580
1655
|
});
|
|
1581
|
-
const b = utils$1.toFiniteNumber($.headers.get("content-length")), [g,
|
|
1656
|
+
const b = utils$1.toFiniteNumber($.headers.get("content-length")), [g, w] = i && progressEventDecorator(
|
|
1582
1657
|
b,
|
|
1583
|
-
progressEventReducer(asyncDecorator(
|
|
1658
|
+
progressEventReducer(asyncDecorator(i), !0)
|
|
1584
1659
|
) || [];
|
|
1585
1660
|
$ = new Response(
|
|
1586
1661
|
trackStream($.body, DEFAULT_CHUNK_SIZE, g, () => {
|
|
1587
|
-
|
|
1662
|
+
w && w(), y && y();
|
|
1588
1663
|
}),
|
|
1589
1664
|
k
|
|
1590
1665
|
);
|
|
1591
1666
|
}
|
|
1592
1667
|
c = c || "text";
|
|
1593
1668
|
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"]($, e);
|
|
1594
|
-
return !
|
|
1669
|
+
return !v && y && y(), await new Promise((k, b) => {
|
|
1595
1670
|
settle(k, b, {
|
|
1596
1671
|
data: _,
|
|
1597
1672
|
headers: AxiosHeaders$1.from($.headers),
|
|
@@ -1631,22 +1706,22 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
1631
1706
|
const o = {};
|
|
1632
1707
|
for (let s = 0; s < t; s++) {
|
|
1633
1708
|
n = e[s];
|
|
1634
|
-
let
|
|
1635
|
-
if (r = n, !isResolvedHandle(n) && (r = knownAdapters[(
|
|
1636
|
-
throw new AxiosError$1(`Unknown adapter '${
|
|
1709
|
+
let l;
|
|
1710
|
+
if (r = n, !isResolvedHandle(n) && (r = knownAdapters[(l = String(n)).toLowerCase()], r === void 0))
|
|
1711
|
+
throw new AxiosError$1(`Unknown adapter '${l}'`);
|
|
1637
1712
|
if (r)
|
|
1638
1713
|
break;
|
|
1639
|
-
o[
|
|
1714
|
+
o[l || "#" + s] = r;
|
|
1640
1715
|
}
|
|
1641
1716
|
if (!r) {
|
|
1642
1717
|
const s = Object.entries(o).map(
|
|
1643
|
-
([
|
|
1718
|
+
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1644
1719
|
);
|
|
1645
|
-
let
|
|
1720
|
+
let l = t ? s.length > 1 ? `since :
|
|
1646
1721
|
` + s.map(renderReason).join(`
|
|
1647
1722
|
`) : " " + renderReason(s[0]) : "as no adapter specified";
|
|
1648
1723
|
throw new AxiosError$1(
|
|
1649
|
-
"There is no suitable adapter to dispatch the request " +
|
|
1724
|
+
"There is no suitable adapter to dispatch the request " + l,
|
|
1650
1725
|
"ERR_NOT_SUPPORT"
|
|
1651
1726
|
);
|
|
1652
1727
|
}
|
|
@@ -1676,7 +1751,7 @@ function dispatchRequest(e) {
|
|
|
1676
1751
|
), r.response.headers = AxiosHeaders$1.from(r.response.headers))), Promise.reject(r);
|
|
1677
1752
|
});
|
|
1678
1753
|
}
|
|
1679
|
-
const VERSION$1 = "1.
|
|
1754
|
+
const VERSION$1 = "1.10.0", validators$1 = {};
|
|
1680
1755
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1681
1756
|
validators$1[e] = function(r) {
|
|
1682
1757
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1684,21 +1759,21 @@ const VERSION$1 = "1.11.0", validators$1 = {};
|
|
|
1684
1759
|
});
|
|
1685
1760
|
const deprecatedWarnings = {};
|
|
1686
1761
|
validators$1.transitional = function(t, n, r) {
|
|
1687
|
-
function o(s,
|
|
1688
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" +
|
|
1762
|
+
function o(s, l) {
|
|
1763
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (r ? ". " + r : "");
|
|
1689
1764
|
}
|
|
1690
|
-
return (s,
|
|
1765
|
+
return (s, l, i) => {
|
|
1691
1766
|
if (t === !1)
|
|
1692
1767
|
throw new AxiosError$1(
|
|
1693
|
-
o(
|
|
1768
|
+
o(l, " has been removed" + (n ? " in " + n : "")),
|
|
1694
1769
|
AxiosError$1.ERR_DEPRECATED
|
|
1695
1770
|
);
|
|
1696
|
-
return n && !deprecatedWarnings[
|
|
1771
|
+
return n && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
1697
1772
|
o(
|
|
1698
|
-
|
|
1773
|
+
l,
|
|
1699
1774
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1700
1775
|
)
|
|
1701
|
-
)), t ? t(s,
|
|
1776
|
+
)), t ? t(s, l, i) : !0;
|
|
1702
1777
|
};
|
|
1703
1778
|
};
|
|
1704
1779
|
validators$1.spelling = function(t) {
|
|
@@ -1710,9 +1785,9 @@ function assertOptions(e, t, n) {
|
|
|
1710
1785
|
const r = Object.keys(e);
|
|
1711
1786
|
let o = r.length;
|
|
1712
1787
|
for (; o-- > 0; ) {
|
|
1713
|
-
const s = r[o],
|
|
1714
|
-
if (
|
|
1715
|
-
const
|
|
1788
|
+
const s = r[o], l = t[s];
|
|
1789
|
+
if (l) {
|
|
1790
|
+
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
1716
1791
|
if (u !== !0)
|
|
1717
1792
|
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
1718
1793
|
continue;
|
|
@@ -1773,7 +1848,7 @@ let Axios$1 = class {
|
|
|
1773
1848
|
baseUrl: validators.spelling("baseURL"),
|
|
1774
1849
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
1775
1850
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1776
|
-
let
|
|
1851
|
+
let l = s && utils$1.merge(
|
|
1777
1852
|
s.common,
|
|
1778
1853
|
s[n.method]
|
|
1779
1854
|
);
|
|
@@ -1782,11 +1857,11 @@ let Axios$1 = class {
|
|
|
1782
1857
|
(p) => {
|
|
1783
1858
|
delete s[p];
|
|
1784
1859
|
}
|
|
1785
|
-
), n.headers = AxiosHeaders$1.concat(
|
|
1786
|
-
const
|
|
1860
|
+
), n.headers = AxiosHeaders$1.concat(l, s);
|
|
1861
|
+
const i = [];
|
|
1787
1862
|
let u = !0;
|
|
1788
1863
|
this.interceptors.request.forEach(function(y) {
|
|
1789
|
-
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (u = u && y.synchronous,
|
|
1864
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (u = u && y.synchronous, i.unshift(y.fulfilled, y.rejected));
|
|
1790
1865
|
});
|
|
1791
1866
|
const c = [];
|
|
1792
1867
|
this.interceptors.response.forEach(function(y) {
|
|
@@ -1795,14 +1870,14 @@ let Axios$1 = class {
|
|
|
1795
1870
|
let a, d = 0, f;
|
|
1796
1871
|
if (!u) {
|
|
1797
1872
|
const p = [dispatchRequest.bind(this), void 0];
|
|
1798
|
-
for (p.unshift(
|
|
1873
|
+
for (p.unshift.apply(p, i), p.push.apply(p, c), f = p.length, a = Promise.resolve(n); d < f; )
|
|
1799
1874
|
a = a.then(p[d++], p[d++]);
|
|
1800
1875
|
return a;
|
|
1801
1876
|
}
|
|
1802
|
-
f =
|
|
1877
|
+
f = i.length;
|
|
1803
1878
|
let h = n;
|
|
1804
1879
|
for (d = 0; d < f; ) {
|
|
1805
|
-
const p =
|
|
1880
|
+
const p = i[d++], y = i[d++];
|
|
1806
1881
|
try {
|
|
1807
1882
|
h = p(h);
|
|
1808
1883
|
} catch (m) {
|
|
@@ -1836,14 +1911,14 @@ utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1836
1911
|
});
|
|
1837
1912
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
1838
1913
|
function n(r) {
|
|
1839
|
-
return function(s,
|
|
1840
|
-
return this.request(mergeConfig$1(
|
|
1914
|
+
return function(s, l, i) {
|
|
1915
|
+
return this.request(mergeConfig$1(i || {}, {
|
|
1841
1916
|
method: t,
|
|
1842
1917
|
headers: r ? {
|
|
1843
1918
|
"Content-Type": "multipart/form-data"
|
|
1844
1919
|
} : {},
|
|
1845
1920
|
url: s,
|
|
1846
|
-
data:
|
|
1921
|
+
data: l
|
|
1847
1922
|
}));
|
|
1848
1923
|
};
|
|
1849
1924
|
}
|
|
@@ -1866,14 +1941,14 @@ let CancelToken$1 = class C {
|
|
|
1866
1941
|
r._listeners = null;
|
|
1867
1942
|
}), this.promise.then = (o) => {
|
|
1868
1943
|
let s;
|
|
1869
|
-
const
|
|
1870
|
-
r.subscribe(
|
|
1944
|
+
const l = new Promise((i) => {
|
|
1945
|
+
r.subscribe(i), s = i;
|
|
1871
1946
|
}).then(o);
|
|
1872
|
-
return
|
|
1947
|
+
return l.cancel = function() {
|
|
1873
1948
|
r.unsubscribe(s);
|
|
1874
|
-
},
|
|
1875
|
-
}, t(function(s,
|
|
1876
|
-
r.reason || (r.reason = new CanceledError$1(s,
|
|
1949
|
+
}, l;
|
|
1950
|
+
}, t(function(s, l, i) {
|
|
1951
|
+
r.reason || (r.reason = new CanceledError$1(s, l, i), n(r.reason));
|
|
1877
1952
|
});
|
|
1878
1953
|
}
|
|
1879
1954
|
/**
|
|
@@ -2046,7 +2121,7 @@ const {
|
|
|
2046
2121
|
for (const [r, o] of t)
|
|
2047
2122
|
n[r] = o;
|
|
2048
2123
|
return n;
|
|
2049
|
-
}, _sfc_main$
|
|
2124
|
+
}, _sfc_main$p = {}, _hoisted_1$l = {
|
|
2050
2125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2051
2126
|
viewBox: "0 0 24 24",
|
|
2052
2127
|
fill: "none",
|
|
@@ -2057,793 +2132,316 @@ const {
|
|
|
2057
2132
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
2058
2133
|
};
|
|
2059
2134
|
function _sfc_render$b(e, t) {
|
|
2060
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$m, t[0] || (t[0] = [
|
|
2061
|
-
createElementVNode("path", {
|
|
2062
|
-
stroke: "none",
|
|
2063
|
-
d: "M0 0h24v24H0z",
|
|
2064
|
-
fill: "none"
|
|
2065
|
-
}, null, -1),
|
|
2066
|
-
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
2067
|
-
]));
|
|
2068
|
-
}
|
|
2069
|
-
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$b]]), _sfc_main$p = {}, _hoisted_1$l = {
|
|
2070
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2071
|
-
viewBox: "0 0 24 24",
|
|
2072
|
-
fill: "none",
|
|
2073
|
-
stroke: "currentColor",
|
|
2074
|
-
"stroke-width": "2",
|
|
2075
|
-
"stroke-linecap": "round",
|
|
2076
|
-
"stroke-linejoin": "round",
|
|
2077
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
2078
|
-
};
|
|
2079
|
-
function _sfc_render$a(e, t) {
|
|
2080
2135
|
return openBlock(), createElementBlock("svg", _hoisted_1$l, t[0] || (t[0] = [
|
|
2081
2136
|
createElementVNode("path", {
|
|
2082
2137
|
stroke: "none",
|
|
2083
2138
|
d: "M0 0h24v24H0z",
|
|
2084
2139
|
fill: "none"
|
|
2085
2140
|
}, null, -1),
|
|
2086
|
-
createElementVNode("path", { d: "
|
|
2087
|
-
]));
|
|
2088
|
-
}
|
|
2089
|
-
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$a]]), _sfc_main$o = {}, _hoisted_1$k = {
|
|
2090
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2091
|
-
viewBox: "0 0 24 24",
|
|
2092
|
-
fill: "none",
|
|
2093
|
-
stroke: "currentColor",
|
|
2094
|
-
"stroke-width": "2",
|
|
2095
|
-
"stroke-linecap": "round",
|
|
2096
|
-
"stroke-linejoin": "round"
|
|
2097
|
-
};
|
|
2098
|
-
function _sfc_render$9(e, t) {
|
|
2099
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$k, t[0] || (t[0] = [
|
|
2100
|
-
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
2101
|
-
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
2102
|
-
]));
|
|
2103
|
-
}
|
|
2104
|
-
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$9]]), _sfc_main$n = {}, _hoisted_1$j = {
|
|
2105
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2106
|
-
viewBox: "0 0 24 24",
|
|
2107
|
-
fill: "none",
|
|
2108
|
-
stroke: "currentColor",
|
|
2109
|
-
"stroke-width": "2",
|
|
2110
|
-
"stroke-linecap": "round",
|
|
2111
|
-
"stroke-linejoin": "round",
|
|
2112
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
2113
|
-
};
|
|
2114
|
-
function _sfc_render$8(e, t) {
|
|
2115
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$j, t[0] || (t[0] = [
|
|
2116
|
-
createElementVNode("path", {
|
|
2117
|
-
stroke: "none",
|
|
2118
|
-
d: "M0 0h24v24H0z",
|
|
2119
|
-
fill: "none"
|
|
2120
|
-
}, null, -1),
|
|
2121
|
-
createElementVNode("path", { d: "M18 6l-12 12" }, null, -1),
|
|
2122
|
-
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
2141
|
+
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
2123
2142
|
]));
|
|
2124
2143
|
}
|
|
2125
|
-
const
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2144
|
+
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$b]]), _hoisted_1$k = { class: "flex items-center gap-[4px]" }, _hoisted_2$6 = ["value", "id", "disabled"], _hoisted_3$3 = ["for"], _hoisted_4$2 = { class: "text-[13px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2145
|
+
__name: "vs-checkbox-default",
|
|
2146
|
+
props: {
|
|
2147
|
+
value: { type: [String, Number], default: "" },
|
|
2148
|
+
label: { type: [String, Number], default: "" },
|
|
2149
|
+
disabled: { type: Boolean, default: !1 },
|
|
2150
|
+
id: { type: [String, Number] },
|
|
2151
|
+
modelValue: Boolean,
|
|
2152
|
+
info: { type: String, default: () => "" }
|
|
2153
|
+
},
|
|
2154
|
+
emits: ["update:modelValue"],
|
|
2155
|
+
setup(e, { emit: t }) {
|
|
2156
|
+
const n = t, r = e, o = computed({
|
|
2157
|
+
get: () => r.modelValue,
|
|
2158
|
+
set: (s) => n("update:modelValue", s)
|
|
2159
|
+
});
|
|
2160
|
+
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
2161
|
+
withDirectives(createElementVNode("input", {
|
|
2162
|
+
type: "checkbox",
|
|
2163
|
+
value: e.value,
|
|
2164
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => o.value = i),
|
|
2165
|
+
class: normalizeClass(["shrink-0 border border-solid hidden border-gray-200 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": e.disabled }]),
|
|
2166
|
+
id: e.id,
|
|
2167
|
+
disabled: e.disabled
|
|
2168
|
+
}, null, 10, _hoisted_2$6), [
|
|
2169
|
+
[vModelCheckbox, o.value]
|
|
2170
|
+
]),
|
|
2171
|
+
createElementVNode("label", {
|
|
2172
|
+
for: e.id,
|
|
2173
|
+
class: normalizeClass(["flex flex-1 checkbox-label items-center gap-x-3 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": e.disabled }])
|
|
2174
|
+
}, [
|
|
2175
|
+
createElementVNode("div", {
|
|
2176
|
+
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [o.value ? "bg-blue-600" : "bg-white"]])
|
|
2177
|
+
}, [
|
|
2178
|
+
createVNode(IconCheck, {
|
|
2179
|
+
height: "12",
|
|
2180
|
+
width: "12"
|
|
2181
|
+
})
|
|
2182
|
+
], 2),
|
|
2183
|
+
createElementVNode("span", _hoisted_4$2, [
|
|
2184
|
+
renderSlot(s.$slots, "default", {}, () => [
|
|
2185
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
2186
|
+
])
|
|
2187
|
+
])
|
|
2188
|
+
], 10, _hoisted_3$3)
|
|
2189
|
+
]));
|
|
2164
2190
|
}
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
prefix: { default: "api" },
|
|
2174
|
-
host: { default: "" },
|
|
2175
|
-
data: { default: null },
|
|
2176
|
-
options: { default: () => [] },
|
|
2177
|
-
maxHeight: { default: 400 },
|
|
2178
|
-
slots: { default: null },
|
|
2179
|
-
customClass: { default: "" },
|
|
2180
|
-
style: { default: () => ({}) },
|
|
2181
|
-
disabled: { type: Boolean }
|
|
2182
|
-
}, {
|
|
2191
|
+
}), _hoisted_1$j = ["name", "value", "disabled"], _hoisted_2$5 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3$2 = {
|
|
2192
|
+
key: 0,
|
|
2193
|
+
class: "text-[16px]"
|
|
2194
|
+
}, _hoisted_4$1 = ["src"], _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2195
|
+
__name: "vs-checkbox-buttons",
|
|
2196
|
+
props: {
|
|
2197
|
+
value: { type: [String, Number, Boolean], default: "" },
|
|
2198
|
+
label: { type: [String, Number], default: "" },
|
|
2183
2199
|
modelValue: {
|
|
2184
|
-
type: [
|
|
2185
|
-
default:
|
|
2200
|
+
type: [Array, String, Boolean],
|
|
2201
|
+
default: ""
|
|
2186
2202
|
},
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
);
|
|
2199
|
-
return b.data;
|
|
2200
|
-
} catch {
|
|
2201
|
-
return [];
|
|
2202
|
-
}
|
|
2203
|
-
}, p = async (b) => {
|
|
2204
|
-
document.body.click(), l.value = b !== void 0 ? b : !l.value, l.value && !c.value?.length && (!t.options?.length && t.data ? c.value = await h() : t.options?.length && (c.value = [...t.options])), l.value && s.value ? (o.value.width = `${s.value.getBoundingClientRect()?.width}px`, i.value && dynamicPosition("bottom-start", s.value, i.value)) : a.value = -1;
|
|
2205
|
-
}, y = () => l.value ? p(!1) : null, m = (b) => {
|
|
2206
|
-
u.value = b, r.value = b.id, p(!1);
|
|
2207
|
-
}, x = (b, g) => {
|
|
2208
|
-
if (!b || !g) return;
|
|
2209
|
-
const v = b.offsetTop, E = v + b.offsetHeight, S = g.scrollTop, B = S + g.clientHeight;
|
|
2210
|
-
v < S ? g.scrollTop = v - 80 : E > B && (g.scrollTop = E - g.clientHeight + 4);
|
|
2211
|
-
}, $ = (b) => {
|
|
2212
|
-
if (!l.value) return;
|
|
2213
|
-
const { keyCode: g } = b;
|
|
2214
|
-
if ([38, 40, 13].includes(g) && b.preventDefault(), g == 38) {
|
|
2215
|
-
if (a.value == 0) return;
|
|
2216
|
-
a.value -= 1, x(d.value[a.value], i.value);
|
|
2217
|
-
} else if (g == 40) {
|
|
2218
|
-
if (a.value + 1 >= f.value?.length) return;
|
|
2219
|
-
a.value += 1, x(d.value[a.value], i.value);
|
|
2220
|
-
} else if (g == 13) {
|
|
2221
|
-
const v = f.value[a.value];
|
|
2222
|
-
v && m(v);
|
|
2203
|
+
disabled: { type: Boolean, default: !1 },
|
|
2204
|
+
id: { type: [String, Number] },
|
|
2205
|
+
icon: { type: String },
|
|
2206
|
+
imgUrl: { type: String },
|
|
2207
|
+
style: { type: Object, default: () => null }
|
|
2208
|
+
},
|
|
2209
|
+
emits: ["update:modelValue"],
|
|
2210
|
+
setup(e, { emit: t }) {
|
|
2211
|
+
const n = e, r = t, o = computed({
|
|
2212
|
+
get: () => n.modelValue,
|
|
2213
|
+
set: (i) => {
|
|
2214
|
+
r("update:modelValue", i);
|
|
2223
2215
|
}
|
|
2224
|
-
},
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
[38, 40].includes(g) && (await b.preventDefault(), a.value = 0, setTimeout(() => p()));
|
|
2228
|
-
}, _ = (b) => {
|
|
2229
|
-
l.value && s.value && i.value && !i.value.contains(b.target) && (l.value = !1);
|
|
2230
|
-
}, k = (b) => {
|
|
2231
|
-
b?.key === "Escape" && l.value && p(!1);
|
|
2232
|
-
};
|
|
2233
|
-
return onMounted(async () => {
|
|
2234
|
-
addEventListener("click", y), addEventListener("keydown", $), addEventListener("scroll", _, !0), addEventListener("keydown", k), r.value && !t.options?.length && t.data && (c.value = await h(), u.value = c.value?.find((b) => b?.id === r.value) || null);
|
|
2235
|
-
}), onUnmounted(() => {
|
|
2236
|
-
removeEventListener("click", y), removeEventListener("keydown", $), removeEventListener("scroll", _, !0), removeEventListener("keydown", k);
|
|
2237
|
-
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
2238
|
-
class: "relative w-full",
|
|
2239
|
-
ref_key: "select",
|
|
2240
|
-
ref: s,
|
|
2241
|
-
onClick: g[3] || (g[3] = withModifiers(() => {
|
|
2242
|
-
}, ["stop"]))
|
|
2216
|
+
}), s = computed(() => Array.isArray(o.value) ? o.value.includes(n.value) : o.value === !0 || o.value === n.value), l = computed(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
2217
|
+
return (i, u) => (openBlock(), createElementBlock("label", {
|
|
2218
|
+
class: normalizeClass(["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", [l.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
2243
2219
|
}, [
|
|
2244
|
-
createElementVNode("
|
|
2245
|
-
type: "
|
|
2246
|
-
class:
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
onClick: g[0] || (g[0] = (v) => p(!l.value)),
|
|
2254
|
-
disabled: b.disabled,
|
|
2255
|
-
style: {
|
|
2256
|
-
border: "1px solid #CFD9E0"
|
|
2257
|
-
}
|
|
2258
|
-
}, [
|
|
2259
|
-
u.value?.color ? (openBlock(), createElementBlock("span", {
|
|
2260
|
-
key: 0,
|
|
2261
|
-
class: "w-[16px] h-[16px] rounded-md block",
|
|
2262
|
-
style: normalizeStyle({ backgroundColor: u.value?.color })
|
|
2263
|
-
}, null, 4)) : createCommentVNode("", !0),
|
|
2264
|
-
u.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2$6, toDisplayString(u.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(b.placeholder), 1))
|
|
2265
|
-
], 42, _hoisted_1$i),
|
|
2266
|
-
createElementVNode("span", _hoisted_4$2, [
|
|
2267
|
-
createVNode(unref(IconChevronTopBottom), {
|
|
2268
|
-
height: "14",
|
|
2269
|
-
width: "14"
|
|
2270
|
-
})
|
|
2220
|
+
withDirectives(createElementVNode("input", {
|
|
2221
|
+
type: "checkbox",
|
|
2222
|
+
class: "hidden",
|
|
2223
|
+
name: e.id,
|
|
2224
|
+
value: e.value,
|
|
2225
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
2226
|
+
disabled: e.disabled
|
|
2227
|
+
}, null, 8, _hoisted_1$j), [
|
|
2228
|
+
[vModelCheckbox, o.value]
|
|
2271
2229
|
]),
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
ref_key: "list",
|
|
2289
|
-
ref: i,
|
|
2290
|
-
style: normalizeStyle({
|
|
2291
|
-
width: o.value.width,
|
|
2292
|
-
maxHeight: b.maxHeight + "px",
|
|
2293
|
-
backgroundColor: "white"
|
|
2294
|
-
}),
|
|
2295
|
-
onClick: g[2] || (g[2] = withModifiers(() => {
|
|
2296
|
-
}, ["stop"]))
|
|
2297
|
-
}, [
|
|
2298
|
-
f.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2299
|
-
g[4] || (g[4] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
2300
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (v, E) => (openBlock(), createElementBlock("li", {
|
|
2301
|
-
onClick: (S) => m(v),
|
|
2302
|
-
key: v?.id,
|
|
2303
|
-
ref_for: !0,
|
|
2304
|
-
ref: (S) => d.value[E] = S,
|
|
2305
|
-
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [a.value == E ? "bg-gray-100" : ""]])
|
|
2306
|
-
}, [
|
|
2307
|
-
createElementVNode("span", _hoisted_6, [
|
|
2308
|
-
v?.color ? (openBlock(), createElementBlock("span", {
|
|
2309
|
-
key: 0,
|
|
2310
|
-
class: "w-[16px] h-[16px] rounded-md block",
|
|
2311
|
-
style: normalizeStyle({ backgroundColor: v?.color })
|
|
2312
|
-
}, null, 4)) : createCommentVNode("", !0),
|
|
2313
|
-
createTextVNode(" " + toDisplayString(v?.text), 1)
|
|
2314
|
-
]),
|
|
2315
|
-
r.value == v?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
2316
|
-
key: 0,
|
|
2317
|
-
height: "14",
|
|
2318
|
-
width: "14",
|
|
2319
|
-
"stroke-width": "2",
|
|
2320
|
-
class: "absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"
|
|
2321
|
-
})) : createCommentVNode("", !0)
|
|
2322
|
-
], 10, _hoisted_5))), 128))
|
|
2323
|
-
], 64)) : (openBlock(), createElementBlock("li", _hoisted_7, "Дані відсутні"))
|
|
2324
|
-
], 4), [
|
|
2325
|
-
[vShow, l.value]
|
|
2230
|
+
createElementVNode("span", _hoisted_2$5, [
|
|
2231
|
+
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
2232
|
+
e.icon ? (openBlock(), createElementBlock("i", {
|
|
2233
|
+
key: 0,
|
|
2234
|
+
class: normalizeClass(e.icon)
|
|
2235
|
+
}, null, 2)) : createCommentVNode("", !0),
|
|
2236
|
+
e.imgUrl ? (openBlock(), createElementBlock("img", {
|
|
2237
|
+
key: 1,
|
|
2238
|
+
src: e.imgUrl,
|
|
2239
|
+
width: "16",
|
|
2240
|
+
height: "16",
|
|
2241
|
+
alt: "icon"
|
|
2242
|
+
}, null, 8, _hoisted_4$1)) : createCommentVNode("", !0)
|
|
2243
|
+
])) : createCommentVNode("", !0),
|
|
2244
|
+
renderSlot(i.$slots, "default", {}, () => [
|
|
2245
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
2326
2246
|
])
|
|
2327
|
-
])
|
|
2328
|
-
],
|
|
2329
|
-
}
|
|
2330
|
-
}), _hoisted_1$h = ["disabled"], _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2331
|
-
__name: "vs-input-switcher",
|
|
2332
|
-
props: /* @__PURE__ */ mergeModels({
|
|
2333
|
-
style: {
|
|
2334
|
-
type: Object,
|
|
2335
|
-
default: () => ({})
|
|
2336
|
-
},
|
|
2337
|
-
disabled: {
|
|
2338
|
-
type: Boolean,
|
|
2339
|
-
default: !1
|
|
2340
|
-
},
|
|
2341
|
-
customClass: {
|
|
2342
|
-
type: String,
|
|
2343
|
-
default: ""
|
|
2344
|
-
}
|
|
2345
|
-
}, {
|
|
2346
|
-
modelValue: { type: Boolean, default: !1 },
|
|
2347
|
-
modelModifiers: {}
|
|
2348
|
-
}),
|
|
2349
|
-
emits: ["update:modelValue"],
|
|
2350
|
-
setup(e) {
|
|
2351
|
-
const t = useModel(e, "modelValue");
|
|
2352
|
-
return (n, r) => (openBlock(), createElementBlock("button", {
|
|
2353
|
-
type: "button",
|
|
2354
|
-
class: normalizeClass(["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", [`bg-${e.style?.primaryColor || "blue"}-500`, e.customClass]]),
|
|
2355
|
-
disabled: e.disabled,
|
|
2356
|
-
onClick: r[0] || (r[0] = (o) => t.value = !t.value)
|
|
2357
|
-
}, [
|
|
2358
|
-
createElementVNode("span", {
|
|
2359
|
-
"data-state": "checked",
|
|
2360
|
-
class: normalizeClass(["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"]])
|
|
2361
|
-
}, null, 2)
|
|
2362
|
-
], 10, _hoisted_1$h));
|
|
2363
|
-
}
|
|
2364
|
-
}), _hoisted_1$g = ["innerHTML"], _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2365
|
-
__name: "vs-input-static",
|
|
2366
|
-
props: {
|
|
2367
|
-
html: {
|
|
2368
|
-
type: String,
|
|
2369
|
-
default: ""
|
|
2370
|
-
},
|
|
2371
|
-
customClass: {
|
|
2372
|
-
type: String,
|
|
2373
|
-
default: ""
|
|
2374
|
-
}
|
|
2375
|
-
},
|
|
2376
|
-
setup(e) {
|
|
2377
|
-
return (t, n) => (openBlock(), createElementBlock("div", {
|
|
2378
|
-
class: normalizeClass(e.customClass),
|
|
2379
|
-
innerHTML: e.html
|
|
2380
|
-
}, null, 10, _hoisted_1$g));
|
|
2247
|
+
])
|
|
2248
|
+
], 2));
|
|
2381
2249
|
}
|
|
2382
|
-
}),
|
|
2383
|
-
|
|
2250
|
+
}), VsCheckboxViews = {
|
|
2251
|
+
"vs-checkbox-default": _sfc_main$o,
|
|
2252
|
+
"vs-checkbox-buttons": _sfc_main$n
|
|
2253
|
+
}, _hoisted_1$i = { class: "flex items-center" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
2254
|
+
__name: "vs-input-checkbox-item",
|
|
2384
2255
|
props: {
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
},
|
|
2389
|
-
|
|
2390
|
-
type:
|
|
2391
|
-
default: () => ({})
|
|
2392
|
-
},
|
|
2393
|
-
isOpen: {
|
|
2394
|
-
type: Boolean,
|
|
2256
|
+
value: { type: [String, Number], default: "" },
|
|
2257
|
+
label: { type: [String, Number], default: "" },
|
|
2258
|
+
disabled: { type: Boolean, default: !1 },
|
|
2259
|
+
view: { type: String, default: () => "default" },
|
|
2260
|
+
modelValue: {
|
|
2261
|
+
type: [Array, Boolean],
|
|
2395
2262
|
default: !1
|
|
2396
|
-
}
|
|
2263
|
+
},
|
|
2264
|
+
icon: { type: String },
|
|
2265
|
+
imgUrl: { type: String },
|
|
2266
|
+
slots: { type: Object, default: () => null },
|
|
2267
|
+
option: { type: [Object, String] },
|
|
2268
|
+
style: { type: String, default: () => null }
|
|
2397
2269
|
},
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
() =>
|
|
2402
|
-
(
|
|
2403
|
-
n.
|
|
2270
|
+
emits: ["update:modelValue"],
|
|
2271
|
+
setup(e, { emit: t }) {
|
|
2272
|
+
const n = e, r = t, o = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
2273
|
+
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
2274
|
+
set: (i) => {
|
|
2275
|
+
if (Array.isArray(n.modelValue)) {
|
|
2276
|
+
let u = [...n.modelValue];
|
|
2277
|
+
i ? u.includes(n.value) || u.push(n.value) : u = u.filter((c) => c !== n.value), r("update:modelValue", u);
|
|
2278
|
+
} else
|
|
2279
|
+
r("update:modelValue", i);
|
|
2404
2280
|
}
|
|
2405
|
-
),
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2281
|
+
}), l = ref(`vs-checkbox-${n.view || "default"}`);
|
|
2282
|
+
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
2283
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[l.value]), {
|
|
2284
|
+
value: e.value,
|
|
2285
|
+
label: e.label,
|
|
2286
|
+
info: e.option?.info,
|
|
2287
|
+
disabled: e.disabled,
|
|
2288
|
+
modelValue: s.value,
|
|
2289
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
2290
|
+
id: o,
|
|
2291
|
+
icon: e.icon,
|
|
2292
|
+
imgUrl: e.imgUrl,
|
|
2293
|
+
style: normalizeStyle(e.style)
|
|
2294
|
+
}, {
|
|
2415
2295
|
default: withCtx(() => [
|
|
2416
|
-
|
|
2417
|
-
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2418
|
-
], 512), [
|
|
2419
|
-
[vShow, n.value]
|
|
2420
|
-
])
|
|
2296
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
2421
2297
|
]),
|
|
2422
|
-
_:
|
|
2423
|
-
})
|
|
2298
|
+
_: 1
|
|
2299
|
+
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style"]))
|
|
2424
2300
|
]));
|
|
2425
2301
|
}
|
|
2426
|
-
}),
|
|
2427
|
-
__name: "vs-
|
|
2302
|
+
}), _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2303
|
+
__name: "vs-input-checkbox",
|
|
2428
2304
|
props: {
|
|
2429
|
-
|
|
2430
|
-
type:
|
|
2431
|
-
default:
|
|
2432
|
-
},
|
|
2433
|
-
style: {
|
|
2434
|
-
type: Object,
|
|
2435
|
-
default: () => ({})
|
|
2305
|
+
options: {
|
|
2306
|
+
type: Array,
|
|
2307
|
+
default: () => []
|
|
2436
2308
|
},
|
|
2437
|
-
|
|
2438
|
-
type: Boolean,
|
|
2309
|
+
modelValue: {
|
|
2310
|
+
type: [Boolean, Array],
|
|
2439
2311
|
default: !1
|
|
2440
|
-
}
|
|
2312
|
+
},
|
|
2313
|
+
position: { default: () => "vertical" },
|
|
2314
|
+
// vertical, horizontal
|
|
2315
|
+
slots: { type: Object, default: () => null },
|
|
2316
|
+
view: { type: String, default: () => null },
|
|
2317
|
+
colSpan: { type: Number, default: () => 0 },
|
|
2318
|
+
data: { type: String, default: () => null }
|
|
2441
2319
|
},
|
|
2442
|
-
|
|
2443
|
-
|
|
2320
|
+
emits: ["update:modelValue"],
|
|
2321
|
+
setup(e, { emit: t }) {
|
|
2322
|
+
const n = e, r = t, o = ref([]), s = reactive({}), l = (a) => a?.value || a?.id || a?.text || a, i = (a) => a.text || String(a), u = (a) => `lg:col-span-${a || 12}`, c = async () => {
|
|
2323
|
+
try {
|
|
2324
|
+
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2325
|
+
o.value = a?.data || a;
|
|
2326
|
+
} catch (a) {
|
|
2327
|
+
console.error(a);
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2444
2330
|
return watch(
|
|
2445
|
-
() =>
|
|
2446
|
-
(
|
|
2447
|
-
|
|
2331
|
+
() => n.modelValue,
|
|
2332
|
+
(a) => {
|
|
2333
|
+
if (typeof a == "boolean" && o.value.length === 1) {
|
|
2334
|
+
const d = l(o.value[0]);
|
|
2335
|
+
s[d] = a;
|
|
2336
|
+
} else if (Array.isArray(a)) {
|
|
2337
|
+
const d = new Set(a);
|
|
2338
|
+
o.value.forEach((f) => {
|
|
2339
|
+
if (!f.disabled) {
|
|
2340
|
+
const h = l(f);
|
|
2341
|
+
s[h] = d.has(h);
|
|
2342
|
+
}
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
{ immediate: !0 }
|
|
2347
|
+
), watch(
|
|
2348
|
+
s,
|
|
2349
|
+
() => {
|
|
2350
|
+
if (!o.value.length) {
|
|
2351
|
+
r("update:modelValue", null);
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2355
|
+
r("update:modelValue", a.length === 0 ? null : a);
|
|
2356
|
+
},
|
|
2357
|
+
{ deep: !0 }
|
|
2358
|
+
), onMounted(() => {
|
|
2359
|
+
if (n.data)
|
|
2360
|
+
c().then(() => {
|
|
2361
|
+
if (typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2362
|
+
const a = l(o.value[0]);
|
|
2363
|
+
s[a] = n.modelValue;
|
|
2364
|
+
} else if (Array.isArray(n.modelValue)) {
|
|
2365
|
+
const a = new Set(n.modelValue);
|
|
2366
|
+
o.value.forEach((d) => {
|
|
2367
|
+
if (!d.disabled) {
|
|
2368
|
+
const f = l(d);
|
|
2369
|
+
s[f] = a.has(f);
|
|
2370
|
+
}
|
|
2371
|
+
});
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
else if (o.value = n.options, typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2375
|
+
const a = l(o.value[0]);
|
|
2376
|
+
s[a] = n.modelValue;
|
|
2377
|
+
} else if (Array.isArray(n.modelValue)) {
|
|
2378
|
+
const a = new Set(n.modelValue);
|
|
2379
|
+
o.value.forEach((d) => {
|
|
2380
|
+
if (!d.disabled) {
|
|
2381
|
+
const f = l(d);
|
|
2382
|
+
s[f] = a.has(f);
|
|
2383
|
+
}
|
|
2384
|
+
});
|
|
2448
2385
|
}
|
|
2449
|
-
), (
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
]),
|
|
2468
|
-
_: 3
|
|
2469
|
-
})
|
|
2470
|
-
]));
|
|
2471
|
-
}
|
|
2472
|
-
}), VsContainerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-a37284e6"]]), _hoisted_1$d = { class: "flex items-center justify-between" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
2473
|
-
__name: "vs-container-default",
|
|
2474
|
-
props: {
|
|
2475
|
-
title: {
|
|
2476
|
-
type: String,
|
|
2477
|
-
default: ""
|
|
2478
|
-
},
|
|
2479
|
-
style: {
|
|
2480
|
-
type: Object,
|
|
2481
|
-
default: () => ({})
|
|
2482
|
-
}
|
|
2483
|
-
},
|
|
2484
|
-
setup(e) {
|
|
2485
|
-
return (t, n) => (openBlock(), createElementBlock("div", null, [
|
|
2486
|
-
createElementVNode("div", _hoisted_1$d, [
|
|
2487
|
-
createElementVNode("p", null, toDisplayString(e.title), 1)
|
|
2488
|
-
]),
|
|
2489
|
-
renderSlot(t.$slots, "default")
|
|
2490
|
-
]));
|
|
2491
|
-
}
|
|
2492
|
-
}), views = {
|
|
2493
|
-
switcher: VsContainerSwitcher,
|
|
2494
|
-
accordion: VsContainerAccordion,
|
|
2495
|
-
default: _sfc_main$h
|
|
2496
|
-
}, FormConditionsTypes = {
|
|
2497
|
-
Equal: "==",
|
|
2498
|
-
Inequal: "!=",
|
|
2499
|
-
Higer: ">",
|
|
2500
|
-
HigerOrEqual: ">=",
|
|
2501
|
-
Lower: "<",
|
|
2502
|
-
LowerOrEqual: "<=",
|
|
2503
|
-
Between: "between",
|
|
2504
|
-
StartWith: "^",
|
|
2505
|
-
EndWith: "$",
|
|
2506
|
-
Contain: "*",
|
|
2507
|
-
In: "in",
|
|
2508
|
-
NotIn: "not_in"
|
|
2509
|
-
}, checkEqual = (e, t) => e === t, checkInequal = (e, t) => e !== t, checkHigher = (e, t) => e > t, checkHigherOrEqual = (e, t) => e >= t, checkLower = (e, t) => e < t, checkLowerOrEqual = (e, t) => e <= t, checkBetween = (e, t) => Array.isArray(t) && t.length === 2 ? e >= t[0] && e <= t[1] : !1, checkStartWith = (e, t) => String(e).startsWith(String(t)), checkEndWith = (e, t) => String(e).endsWith(String(t)), checkContain = (e, t) => String(e).includes(String(t)), checkIn = (e, t) => Array.isArray(t) ? t.includes(e) : !1, checkNotIn = (e, t) => Array.isArray(t) ? !t.includes(e) : !0, isVisible = (e, t) => {
|
|
2510
|
-
if (!t) return !0;
|
|
2511
|
-
switch (t?.[1]) {
|
|
2512
|
-
case FormConditionsTypes.Equal:
|
|
2513
|
-
return checkEqual(e, t?.[2]);
|
|
2514
|
-
case FormConditionsTypes.Inequal:
|
|
2515
|
-
return checkInequal(e, t?.[2]);
|
|
2516
|
-
case FormConditionsTypes.Higer:
|
|
2517
|
-
return checkHigher(e, t?.[2]);
|
|
2518
|
-
case FormConditionsTypes.HigerOrEqual:
|
|
2519
|
-
return checkHigherOrEqual(e, t?.[2]);
|
|
2520
|
-
case FormConditionsTypes.Lower:
|
|
2521
|
-
return checkLower(e, t?.[2]);
|
|
2522
|
-
case FormConditionsTypes.LowerOrEqual:
|
|
2523
|
-
return checkLowerOrEqual(e, t?.[2]);
|
|
2524
|
-
case FormConditionsTypes.Between:
|
|
2525
|
-
return checkBetween(e, t?.[2]);
|
|
2526
|
-
case FormConditionsTypes.StartWith:
|
|
2527
|
-
return checkStartWith(e, t?.[2]);
|
|
2528
|
-
case FormConditionsTypes.EndWith:
|
|
2529
|
-
return checkEndWith(e, t?.[2]);
|
|
2530
|
-
case FormConditionsTypes.Contain:
|
|
2531
|
-
return checkContain(e, t?.[2]);
|
|
2532
|
-
case FormConditionsTypes.In:
|
|
2533
|
-
return checkIn(e, t?.[2]);
|
|
2534
|
-
case FormConditionsTypes.NotIn:
|
|
2535
|
-
return checkNotIn(e, t?.[2]);
|
|
2536
|
-
default:
|
|
2537
|
-
return !0;
|
|
2386
|
+
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2387
|
+
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2388
|
+
}, [
|
|
2389
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (f) => (openBlock(), createBlock(_sfc_main$m, {
|
|
2390
|
+
modelValue: s[l(f)],
|
|
2391
|
+
"onUpdate:modelValue": (h) => s[l(f)] = h,
|
|
2392
|
+
value: l(f),
|
|
2393
|
+
class: normalizeClass(u(e.colSpan)),
|
|
2394
|
+
disabled: f.disabled,
|
|
2395
|
+
label: i(f),
|
|
2396
|
+
key: l(f),
|
|
2397
|
+
icon: f?.icon,
|
|
2398
|
+
imgUrl: f?.imgUrl,
|
|
2399
|
+
option: f,
|
|
2400
|
+
slots: e.slots,
|
|
2401
|
+
view: e.view
|
|
2402
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
2403
|
+
], 2));
|
|
2538
2404
|
}
|
|
2539
|
-
}, _sfc_main$
|
|
2540
|
-
__name: "vs-input-
|
|
2541
|
-
props: {
|
|
2405
|
+
}), VsInputCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-9685f778"]]), _hoisted_1$h = ["placeholder", "disabled"], _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2406
|
+
__name: "vs-input-date1",
|
|
2407
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2542
2408
|
style: {
|
|
2543
2409
|
type: Object,
|
|
2544
2410
|
default: () => ({})
|
|
2545
2411
|
},
|
|
2546
|
-
|
|
2412
|
+
customClass: {
|
|
2547
2413
|
type: String,
|
|
2548
2414
|
default: ""
|
|
2549
2415
|
},
|
|
2550
|
-
|
|
2416
|
+
placeholder: {
|
|
2551
2417
|
type: String,
|
|
2552
|
-
default: "
|
|
2418
|
+
default: ""
|
|
2553
2419
|
},
|
|
2554
|
-
|
|
2555
|
-
type:
|
|
2556
|
-
default:
|
|
2420
|
+
disabled: {
|
|
2421
|
+
type: Boolean,
|
|
2422
|
+
default: !1
|
|
2557
2423
|
}
|
|
2558
|
-
},
|
|
2424
|
+
}, {
|
|
2425
|
+
modelValue: { default: "" },
|
|
2426
|
+
modelModifiers: {}
|
|
2427
|
+
}),
|
|
2428
|
+
emits: ["update:modelValue"],
|
|
2559
2429
|
setup(e) {
|
|
2560
|
-
const t = e,
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
},
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
key: u.name
|
|
2574
|
-
}, { ref_for: !0 }, u, {
|
|
2575
|
-
item: u,
|
|
2576
|
-
modelValue: unref(n)[u.name],
|
|
2577
|
-
"onUpdate:modelValue": (c) => unref(n)[u.name] = c,
|
|
2578
|
-
style: e.style,
|
|
2579
|
-
error: unref(r)?.errors?.[u.name]
|
|
2580
|
-
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
2581
|
-
]),
|
|
2582
|
-
_: 1
|
|
2583
|
-
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
2430
|
+
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue");
|
|
2431
|
+
return (o, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
2432
|
+
type: "date",
|
|
2433
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => r.value = l),
|
|
2434
|
+
placeholder: e.placeholder,
|
|
2435
|
+
disabled: e.disabled,
|
|
2436
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
2437
|
+
style: {
|
|
2438
|
+
border: "1px solid #CFD9E0"
|
|
2439
|
+
}
|
|
2440
|
+
}, null, 10, _hoisted_1$h)), [
|
|
2441
|
+
[vModelText, r.value]
|
|
2442
|
+
]);
|
|
2584
2443
|
}
|
|
2585
|
-
}),
|
|
2586
|
-
__name: "vs-checkbox-default",
|
|
2587
|
-
props: {
|
|
2588
|
-
value: { type: [String, Number], default: "" },
|
|
2589
|
-
label: { type: [String, Number], default: "" },
|
|
2590
|
-
disabled: { type: Boolean, default: !1 },
|
|
2591
|
-
id: { type: [String, Number] },
|
|
2592
|
-
modelValue: Boolean,
|
|
2593
|
-
info: { type: String, default: () => "" }
|
|
2594
|
-
},
|
|
2595
|
-
emits: ["update:modelValue"],
|
|
2596
|
-
setup(e, { emit: t }) {
|
|
2597
|
-
const n = t, r = e, o = computed({
|
|
2598
|
-
get: () => r.modelValue,
|
|
2599
|
-
set: (s) => n("update:modelValue", s)
|
|
2600
|
-
});
|
|
2601
|
-
return (s, i) => (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2602
|
-
withDirectives(createElementVNode("input", {
|
|
2603
|
-
type: "checkbox",
|
|
2604
|
-
value: e.value,
|
|
2605
|
-
"onUpdate:modelValue": i[0] || (i[0] = (l) => o.value = l),
|
|
2606
|
-
class: normalizeClass(["shrink-0 border border-solid hidden border-gray-200 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": e.disabled }]),
|
|
2607
|
-
id: e.id,
|
|
2608
|
-
disabled: e.disabled
|
|
2609
|
-
}, null, 10, _hoisted_2$3), [
|
|
2610
|
-
[vModelCheckbox, o.value]
|
|
2611
|
-
]),
|
|
2612
|
-
createElementVNode("label", {
|
|
2613
|
-
for: e.id,
|
|
2614
|
-
class: normalizeClass(["flex flex-1 checkbox-label items-center gap-x-3 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": e.disabled }])
|
|
2615
|
-
}, [
|
|
2616
|
-
createElementVNode("div", {
|
|
2617
|
-
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [o.value ? "bg-blue-600" : "bg-white"]])
|
|
2618
|
-
}, [
|
|
2619
|
-
createVNode(IconCheck, {
|
|
2620
|
-
height: "12",
|
|
2621
|
-
width: "12"
|
|
2622
|
-
})
|
|
2623
|
-
], 2),
|
|
2624
|
-
createElementVNode("span", _hoisted_4$1, [
|
|
2625
|
-
renderSlot(s.$slots, "default", {}, () => [
|
|
2626
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2627
|
-
])
|
|
2628
|
-
])
|
|
2629
|
-
], 10, _hoisted_3$1)
|
|
2630
|
-
]));
|
|
2631
|
-
}
|
|
2632
|
-
}), _hoisted_1$b = ["name", "value", "disabled"], _hoisted_2$2 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3 = {
|
|
2633
|
-
key: 0,
|
|
2634
|
-
class: "text-[16px]"
|
|
2635
|
-
}, _hoisted_4 = ["src"], _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2636
|
-
__name: "vs-checkbox-buttons",
|
|
2637
|
-
props: {
|
|
2638
|
-
value: { type: [String, Number, Boolean], default: "" },
|
|
2639
|
-
label: { type: [String, Number], default: "" },
|
|
2640
|
-
modelValue: {
|
|
2641
|
-
type: [Array, String, Boolean],
|
|
2642
|
-
default: ""
|
|
2643
|
-
},
|
|
2644
|
-
disabled: { type: Boolean, default: !1 },
|
|
2645
|
-
id: { type: [String, Number] },
|
|
2646
|
-
icon: { type: String },
|
|
2647
|
-
imgUrl: { type: String },
|
|
2648
|
-
style: { type: Object, default: () => null }
|
|
2649
|
-
},
|
|
2650
|
-
emits: ["update:modelValue"],
|
|
2651
|
-
setup(e, { emit: t }) {
|
|
2652
|
-
const n = e, r = t, o = computed({
|
|
2653
|
-
get: () => n.modelValue,
|
|
2654
|
-
set: (l) => {
|
|
2655
|
-
r("update:modelValue", l);
|
|
2656
|
-
}
|
|
2657
|
-
}), s = computed(() => Array.isArray(o.value) ? o.value.includes(n.value) : o.value === !0 || o.value === n.value), i = computed(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
2658
|
-
return (l, u) => (openBlock(), createElementBlock("label", {
|
|
2659
|
-
class: normalizeClass(["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", [i.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
2660
|
-
}, [
|
|
2661
|
-
withDirectives(createElementVNode("input", {
|
|
2662
|
-
type: "checkbox",
|
|
2663
|
-
class: "hidden",
|
|
2664
|
-
name: e.id,
|
|
2665
|
-
value: e.value,
|
|
2666
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
2667
|
-
disabled: e.disabled
|
|
2668
|
-
}, null, 8, _hoisted_1$b), [
|
|
2669
|
-
[vModelCheckbox, o.value]
|
|
2670
|
-
]),
|
|
2671
|
-
createElementVNode("span", _hoisted_2$2, [
|
|
2672
|
-
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
2673
|
-
e.icon ? (openBlock(), createElementBlock("i", {
|
|
2674
|
-
key: 0,
|
|
2675
|
-
class: normalizeClass(e.icon)
|
|
2676
|
-
}, null, 2)) : createCommentVNode("", !0),
|
|
2677
|
-
e.imgUrl ? (openBlock(), createElementBlock("img", {
|
|
2678
|
-
key: 1,
|
|
2679
|
-
src: e.imgUrl,
|
|
2680
|
-
width: "16",
|
|
2681
|
-
height: "16",
|
|
2682
|
-
alt: "icon"
|
|
2683
|
-
}, null, 8, _hoisted_4)) : createCommentVNode("", !0)
|
|
2684
|
-
])) : createCommentVNode("", !0),
|
|
2685
|
-
renderSlot(l.$slots, "default", {}, () => [
|
|
2686
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2687
|
-
])
|
|
2688
|
-
])
|
|
2689
|
-
], 2));
|
|
2690
|
-
}
|
|
2691
|
-
}), VsCheckboxViews = {
|
|
2692
|
-
"vs-checkbox-default": _sfc_main$f,
|
|
2693
|
-
"vs-checkbox-buttons": _sfc_main$e
|
|
2694
|
-
}, _hoisted_1$a = { class: "flex items-center" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2695
|
-
__name: "vs-input-checkbox-item",
|
|
2696
|
-
props: {
|
|
2697
|
-
value: { type: [String, Number], default: "" },
|
|
2698
|
-
label: { type: [String, Number], default: "" },
|
|
2699
|
-
disabled: { type: Boolean, default: !1 },
|
|
2700
|
-
view: { type: String, default: () => "default" },
|
|
2701
|
-
modelValue: {
|
|
2702
|
-
type: [Array, Boolean],
|
|
2703
|
-
default: !1
|
|
2704
|
-
},
|
|
2705
|
-
icon: { type: String },
|
|
2706
|
-
imgUrl: { type: String },
|
|
2707
|
-
slots: { type: Object, default: () => null },
|
|
2708
|
-
option: { type: [Object, String] },
|
|
2709
|
-
style: { type: String, default: () => null }
|
|
2710
|
-
},
|
|
2711
|
-
emits: ["update:modelValue"],
|
|
2712
|
-
setup(e, { emit: t }) {
|
|
2713
|
-
const n = e, r = t, o = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
2714
|
-
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
2715
|
-
set: (l) => {
|
|
2716
|
-
if (Array.isArray(n.modelValue)) {
|
|
2717
|
-
let u = [...n.modelValue];
|
|
2718
|
-
l ? u.includes(n.value) || u.push(n.value) : u = u.filter((c) => c !== n.value), r("update:modelValue", u);
|
|
2719
|
-
} else
|
|
2720
|
-
r("update:modelValue", l);
|
|
2721
|
-
}
|
|
2722
|
-
}), i = ref("vs-checkbox-" + (n.view || "default"));
|
|
2723
|
-
return (l, u) => (openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2724
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[i.value]), {
|
|
2725
|
-
value: e.value,
|
|
2726
|
-
label: e.label,
|
|
2727
|
-
info: e.option?.info,
|
|
2728
|
-
disabled: e.disabled,
|
|
2729
|
-
modelValue: s.value,
|
|
2730
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
2731
|
-
id: o,
|
|
2732
|
-
icon: e.icon,
|
|
2733
|
-
imgUrl: e.imgUrl,
|
|
2734
|
-
style: normalizeStyle(e.style)
|
|
2735
|
-
}, {
|
|
2736
|
-
default: withCtx(() => [
|
|
2737
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2738
|
-
]),
|
|
2739
|
-
_: 1
|
|
2740
|
-
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style"]))
|
|
2741
|
-
]));
|
|
2742
|
-
}
|
|
2743
|
-
}), _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2744
|
-
__name: "vs-input-checkbox",
|
|
2745
|
-
props: {
|
|
2746
|
-
options: {
|
|
2747
|
-
type: Array,
|
|
2748
|
-
default: () => []
|
|
2749
|
-
},
|
|
2750
|
-
modelValue: {
|
|
2751
|
-
type: [Boolean, Array],
|
|
2752
|
-
default: !1
|
|
2753
|
-
},
|
|
2754
|
-
position: { default: () => "vertical" },
|
|
2755
|
-
// vertical, horizontal
|
|
2756
|
-
slots: { type: Object, default: () => null },
|
|
2757
|
-
view: { type: String, default: () => null },
|
|
2758
|
-
colSpan: { type: Number, default: () => 0 },
|
|
2759
|
-
data: { type: String, default: () => null }
|
|
2760
|
-
},
|
|
2761
|
-
emits: ["update:modelValue"],
|
|
2762
|
-
setup(e, { emit: t }) {
|
|
2763
|
-
const n = e, r = t, o = ref([]), s = reactive({}), i = (a) => a?.value || a?.id || a?.text || a, l = (a) => a.text || String(a), u = (a) => `lg:col-span-${a || 12}`, c = async () => {
|
|
2764
|
-
try {
|
|
2765
|
-
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2766
|
-
o.value = a?.data || a;
|
|
2767
|
-
} catch (a) {
|
|
2768
|
-
console.error(a);
|
|
2769
|
-
}
|
|
2770
|
-
};
|
|
2771
|
-
return watch(
|
|
2772
|
-
() => n.modelValue,
|
|
2773
|
-
(a) => {
|
|
2774
|
-
if (typeof a == "boolean" && o.value.length === 1) {
|
|
2775
|
-
const d = i(o.value[0]);
|
|
2776
|
-
s[d] = a;
|
|
2777
|
-
} else if (Array.isArray(a)) {
|
|
2778
|
-
const d = new Set(a);
|
|
2779
|
-
o.value.forEach((f) => {
|
|
2780
|
-
if (!f.disabled) {
|
|
2781
|
-
const h = i(f);
|
|
2782
|
-
s[h] = d.has(h);
|
|
2783
|
-
}
|
|
2784
|
-
});
|
|
2785
|
-
}
|
|
2786
|
-
},
|
|
2787
|
-
{ immediate: !0 }
|
|
2788
|
-
), watch(
|
|
2789
|
-
s,
|
|
2790
|
-
() => {
|
|
2791
|
-
if (!o.value.length) {
|
|
2792
|
-
r("update:modelValue", null);
|
|
2793
|
-
return;
|
|
2794
|
-
}
|
|
2795
|
-
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2796
|
-
r("update:modelValue", a.length === 0 ? null : a);
|
|
2797
|
-
},
|
|
2798
|
-
{ deep: !0 }
|
|
2799
|
-
), onMounted(() => {
|
|
2800
|
-
if (n.data)
|
|
2801
|
-
c().then(() => {
|
|
2802
|
-
if (typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2803
|
-
const a = i(o.value[0]);
|
|
2804
|
-
s[a] = n.modelValue;
|
|
2805
|
-
} else if (Array.isArray(n.modelValue)) {
|
|
2806
|
-
const a = new Set(n.modelValue);
|
|
2807
|
-
o.value.forEach((d) => {
|
|
2808
|
-
if (!d.disabled) {
|
|
2809
|
-
const f = i(d);
|
|
2810
|
-
s[f] = a.has(f);
|
|
2811
|
-
}
|
|
2812
|
-
});
|
|
2813
|
-
}
|
|
2814
|
-
});
|
|
2815
|
-
else if (o.value = n.options, typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2816
|
-
const a = i(o.value[0]);
|
|
2817
|
-
s[a] = n.modelValue;
|
|
2818
|
-
} else if (Array.isArray(n.modelValue)) {
|
|
2819
|
-
const a = new Set(n.modelValue);
|
|
2820
|
-
o.value.forEach((d) => {
|
|
2821
|
-
if (!d.disabled) {
|
|
2822
|
-
const f = i(d);
|
|
2823
|
-
s[f] = a.has(f);
|
|
2824
|
-
}
|
|
2825
|
-
});
|
|
2826
|
-
}
|
|
2827
|
-
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2828
|
-
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2829
|
-
}, [
|
|
2830
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (f) => (openBlock(), createBlock(_sfc_main$d, {
|
|
2831
|
-
modelValue: s[i(f)],
|
|
2832
|
-
"onUpdate:modelValue": (h) => s[i(f)] = h,
|
|
2833
|
-
value: i(f),
|
|
2834
|
-
class: normalizeClass(u(e.colSpan)),
|
|
2835
|
-
disabled: f.disabled,
|
|
2836
|
-
label: l(f),
|
|
2837
|
-
key: i(f),
|
|
2838
|
-
icon: f?.icon,
|
|
2839
|
-
imgUrl: f?.imgUrl,
|
|
2840
|
-
option: f,
|
|
2841
|
-
slots: e.slots,
|
|
2842
|
-
view: e.view
|
|
2843
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
2844
|
-
], 2));
|
|
2845
|
-
}
|
|
2846
|
-
}), VsInputCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-06e7be2f"]]), fileUpload = async (e, t, n, r) => {
|
|
2444
|
+
}), fileUpload = async (e, t, n, r) => {
|
|
2847
2445
|
try {
|
|
2848
2446
|
const o = new FormData();
|
|
2849
2447
|
o.append("unique", "true"), o.append("file", e);
|
|
@@ -2873,7 +2471,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2873
2471
|
} catch (t) {
|
|
2874
2472
|
console.error(t.message);
|
|
2875
2473
|
}
|
|
2876
|
-
}, _sfc_main$
|
|
2474
|
+
}, _sfc_main$j = {}, _hoisted_1$g = {
|
|
2877
2475
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2878
2476
|
width: "24",
|
|
2879
2477
|
height: "24",
|
|
@@ -2884,13 +2482,13 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2884
2482
|
"stroke-linecap": "round",
|
|
2885
2483
|
"stroke-linejoin": "round"
|
|
2886
2484
|
};
|
|
2887
|
-
function _sfc_render$
|
|
2888
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2485
|
+
function _sfc_render$a(e, t) {
|
|
2486
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$g, t[0] || (t[0] = [
|
|
2889
2487
|
createElementVNode("path", { d: "M5 12h14" }, null, -1),
|
|
2890
2488
|
createElementVNode("path", { d: "M12 5v14" }, null, -1)
|
|
2891
2489
|
]));
|
|
2892
2490
|
}
|
|
2893
|
-
const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2491
|
+
const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$a]]), _sfc_main$i = {}, _hoisted_1$f = {
|
|
2894
2492
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2895
2493
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
2896
2494
|
width: "44",
|
|
@@ -2902,12 +2500,12 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_rende
|
|
|
2902
2500
|
"stroke-linecap": "round",
|
|
2903
2501
|
"stroke-linejoin": "round"
|
|
2904
2502
|
};
|
|
2905
|
-
function _sfc_render$
|
|
2906
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2503
|
+
function _sfc_render$9(e, t, n, r, o, s) {
|
|
2504
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$f, t[0] || (t[0] = [
|
|
2907
2505
|
createStaticVNode('<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)
|
|
2908
2506
|
]));
|
|
2909
2507
|
}
|
|
2910
|
-
const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2508
|
+
const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$9]]), _sfc_main$h = {}, _hoisted_1$e = {
|
|
2911
2509
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2912
2510
|
class: "icon icon-tabler icon-tabler-table",
|
|
2913
2511
|
width: "44",
|
|
@@ -2919,8 +2517,8 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render
|
|
|
2919
2517
|
"stroke-linecap": "round",
|
|
2920
2518
|
"stroke-linejoin": "round"
|
|
2921
2519
|
};
|
|
2922
|
-
function _sfc_render$
|
|
2923
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2520
|
+
function _sfc_render$8(e, t, n, r, o, s) {
|
|
2521
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$e, t[0] || (t[0] = [
|
|
2924
2522
|
createElementVNode("path", {
|
|
2925
2523
|
stroke: "none",
|
|
2926
2524
|
d: "M0 0h24v24H0z",
|
|
@@ -2947,7 +2545,7 @@ function _sfc_render$5(e, t, n, r, o, s) {
|
|
|
2947
2545
|
}, null, -1)
|
|
2948
2546
|
]));
|
|
2949
2547
|
}
|
|
2950
|
-
const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2548
|
+
const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$8]]), _sfc_main$g = {}, _hoisted_1$d = {
|
|
2951
2549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2952
2550
|
width: "24",
|
|
2953
2551
|
height: "24",
|
|
@@ -2959,12 +2557,12 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render
|
|
|
2959
2557
|
"stroke-linejoin": "round",
|
|
2960
2558
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2961
2559
|
};
|
|
2962
|
-
function _sfc_render$
|
|
2963
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2560
|
+
function _sfc_render$7(e, t, n, r, o, s) {
|
|
2561
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$d, t[0] || (t[0] = [
|
|
2964
2562
|
createStaticVNode('<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)
|
|
2965
2563
|
]));
|
|
2966
2564
|
}
|
|
2967
|
-
const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2565
|
+
const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$7]]), _sfc_main$f = {}, _hoisted_1$c = {
|
|
2968
2566
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2969
2567
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
2970
2568
|
width: "44",
|
|
@@ -2976,12 +2574,12 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rende
|
|
|
2976
2574
|
"stroke-linecap": "round",
|
|
2977
2575
|
"stroke-linejoin": "round"
|
|
2978
2576
|
};
|
|
2979
|
-
function _sfc_render$
|
|
2980
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2577
|
+
function _sfc_render$6(e, t, n, r, o, s) {
|
|
2578
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$c, t[0] || (t[0] = [
|
|
2981
2579
|
createStaticVNode('<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)
|
|
2982
2580
|
]));
|
|
2983
2581
|
}
|
|
2984
|
-
const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2582
|
+
const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$6]]), _sfc_main$e = {}, _hoisted_1$b = {
|
|
2985
2583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2986
2584
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
2987
2585
|
width: "44",
|
|
@@ -2993,12 +2591,12 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render
|
|
|
2993
2591
|
"stroke-linecap": "round",
|
|
2994
2592
|
"stroke-linejoin": "round"
|
|
2995
2593
|
};
|
|
2996
|
-
function _sfc_render$
|
|
2997
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2594
|
+
function _sfc_render$5(e, t, n, r, o, s) {
|
|
2595
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$b, t[0] || (t[0] = [
|
|
2998
2596
|
createStaticVNode('<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)
|
|
2999
2597
|
]));
|
|
3000
2598
|
}
|
|
3001
|
-
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2599
|
+
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$5]]), getFileType = (e) => {
|
|
3002
2600
|
if (!e) return "";
|
|
3003
2601
|
const t = e?.split(".");
|
|
3004
2602
|
return t[t.length - 1];
|
|
@@ -3011,7 +2609,7 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_re
|
|
|
3011
2609
|
documentsFormat: ["pdf"]
|
|
3012
2610
|
};
|
|
3013
2611
|
return n.imageFormat.includes(t) ? "img" : n.sheetsFormat.includes(t) ? IconCsv : n.textsFormat.includes(t) ? IconGeojson : n.documentsFormat.includes(t) ? iconPdf : n.archivesFormat.includes(t) ? IconZip : IconFile;
|
|
3014
|
-
}, _sfc_main$
|
|
2612
|
+
}, _sfc_main$d = {}, _hoisted_1$a = {
|
|
3015
2613
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3016
2614
|
width: "24",
|
|
3017
2615
|
height: "24",
|
|
@@ -3023,12 +2621,12 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_re
|
|
|
3023
2621
|
"stroke-linejoin": "round",
|
|
3024
2622
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
3025
2623
|
};
|
|
3026
|
-
function _sfc_render$
|
|
3027
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2624
|
+
function _sfc_render$4(e, t) {
|
|
2625
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$a, t[0] || (t[0] = [
|
|
3028
2626
|
createStaticVNode('<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)
|
|
3029
2627
|
]));
|
|
3030
2628
|
}
|
|
3031
|
-
const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2629
|
+
const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$4]]), _sfc_main$c = {}, _hoisted_1$9 = {
|
|
3032
2630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3033
2631
|
width: "24",
|
|
3034
2632
|
height: "24",
|
|
@@ -3040,8 +2638,8 @@ const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_ren
|
|
|
3040
2638
|
"stroke-linejoin": "round",
|
|
3041
2639
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
3042
2640
|
};
|
|
3043
|
-
function _sfc_render(e, t) {
|
|
3044
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2641
|
+
function _sfc_render$3(e, t) {
|
|
2642
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$9, t[0] || (t[0] = [
|
|
3045
2643
|
createElementVNode("path", {
|
|
3046
2644
|
stroke: "none",
|
|
3047
2645
|
d: "M0 0h24v24H0z",
|
|
@@ -3052,7 +2650,7 @@ function _sfc_render(e, t) {
|
|
|
3052
2650
|
createElementVNode("path", { d: "M12 4l0 12" }, null, -1)
|
|
3053
2651
|
]));
|
|
3054
2652
|
}
|
|
3055
|
-
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2653
|
+
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$3]]), _hoisted_1$8 = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, _hoisted_2$4 = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
3056
2654
|
__name: "vs-input-file-list-item",
|
|
3057
2655
|
props: /* @__PURE__ */ mergeModels({
|
|
3058
2656
|
multiple: { type: Boolean }
|
|
@@ -3065,18 +2663,18 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3065
2663
|
emits: ["update:value", "update:item"],
|
|
3066
2664
|
setup(e) {
|
|
3067
2665
|
const t = useModel(e, "value"), n = useModel(e, "item"), r = e;
|
|
3068
|
-
return (o, s) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2666
|
+
return (o, s) => (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
3069
2667
|
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(n.value)), {
|
|
3070
2668
|
src: n.value,
|
|
3071
2669
|
alt: "file",
|
|
3072
2670
|
class: "w-full h-full object-cover cursor-pointer",
|
|
3073
|
-
onClick: s[0] || (s[0] = (
|
|
2671
|
+
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(n.value))
|
|
3074
2672
|
}, null, 8, ["src"])),
|
|
3075
|
-
createElementVNode("div", _hoisted_2$
|
|
2673
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
3076
2674
|
createElementVNode("button", {
|
|
3077
2675
|
type: "button",
|
|
3078
|
-
onClick: s[1] || (s[1] = (
|
|
3079
|
-
unref(fileDelete)(n.value), t.value = r.multiple ? t.value?.filter((
|
|
2676
|
+
onClick: s[1] || (s[1] = (l) => {
|
|
2677
|
+
unref(fileDelete)(n.value), t.value = r.multiple ? t.value?.filter((i) => i !== n.value) : "";
|
|
3080
2678
|
}),
|
|
3081
2679
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
3082
2680
|
}, [
|
|
@@ -3084,7 +2682,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3084
2682
|
]),
|
|
3085
2683
|
createElementVNode("button", {
|
|
3086
2684
|
type: "button",
|
|
3087
|
-
onClick: s[2] || (s[2] = (
|
|
2685
|
+
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(n.value)),
|
|
3088
2686
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
3089
2687
|
}, [
|
|
3090
2688
|
createVNode(IconDownload, { class: "w-4 h-4" })
|
|
@@ -3092,10 +2690,10 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3092
2690
|
])
|
|
3093
2691
|
]));
|
|
3094
2692
|
}
|
|
3095
|
-
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2693
|
+
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-bc0f6d32"]]), _hoisted_1$7 = { class: "flex items-center gap-x-2" }, _hoisted_2$3 = {
|
|
3096
2694
|
key: 1,
|
|
3097
2695
|
class: "flex items-center flex-wrap gap-2"
|
|
3098
|
-
}, _sfc_main$
|
|
2696
|
+
}, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3099
2697
|
__name: "vs-input-file",
|
|
3100
2698
|
props: /* @__PURE__ */ mergeModels({
|
|
3101
2699
|
multiple: { type: Boolean },
|
|
@@ -3107,18 +2705,18 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3107
2705
|
}),
|
|
3108
2706
|
emits: ["update:modelValue"],
|
|
3109
2707
|
setup(e) {
|
|
3110
|
-
const t = e, n = useModel(e, "modelValue"), r = ref(null), o = (
|
|
2708
|
+
const t = e, n = useModel(e, "modelValue"), r = ref(null), o = (l) => Array.isArray(n.value) && n.value[l] || "", s = async (l) => {
|
|
3111
2709
|
if (t.format) {
|
|
3112
|
-
const c =
|
|
2710
|
+
const c = l.target.files?.[0];
|
|
3113
2711
|
if (!c || !c.name.endsWith(t.format))
|
|
3114
2712
|
return;
|
|
3115
2713
|
}
|
|
3116
|
-
const
|
|
3117
|
-
if (!
|
|
3118
|
-
const u = await fileUpload(
|
|
2714
|
+
const i = l.target.files?.[0];
|
|
2715
|
+
if (!i) return;
|
|
2716
|
+
const u = await fileUpload(i, "1", "form", "table");
|
|
3119
2717
|
n.value = t.multiple ? [...n.value || [], u.result?.file_path] : u.result?.file_path;
|
|
3120
2718
|
};
|
|
3121
|
-
return (
|
|
2719
|
+
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
3122
2720
|
createElementVNode("input", {
|
|
3123
2721
|
class: "hidden",
|
|
3124
2722
|
ref_key: "fileInput",
|
|
@@ -3126,52 +2724,517 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3126
2724
|
type: "file",
|
|
3127
2725
|
onChange: s
|
|
3128
2726
|
}, null, 544),
|
|
3129
|
-
!
|
|
2727
|
+
!l.multiple && n.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
3130
2728
|
key: 0,
|
|
3131
2729
|
item: n.value,
|
|
3132
|
-
"onUpdate:item":
|
|
2730
|
+
"onUpdate:item": i[0] || (i[0] = (u) => n.value = u),
|
|
3133
2731
|
value: n.value,
|
|
3134
|
-
"onUpdate:value":
|
|
3135
|
-
}, null, 8, ["item", "value"])) :
|
|
2732
|
+
"onUpdate:value": i[1] || (i[1] = (u) => n.value = u)
|
|
2733
|
+
}, null, 8, ["item", "value"])) : l.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
3136
2734
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (u, c) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
3137
|
-
multiple:
|
|
2735
|
+
multiple: l.multiple,
|
|
3138
2736
|
key: c,
|
|
3139
2737
|
value: n.value,
|
|
3140
|
-
"onUpdate:value":
|
|
2738
|
+
"onUpdate:value": i[2] || (i[2] = (a) => n.value = a),
|
|
3141
2739
|
item: o(c)
|
|
3142
2740
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3143
2741
|
createElementVNode("div", {
|
|
3144
|
-
onClick:
|
|
2742
|
+
onClick: i[3] || (i[3] = (u) => !l.disabled && r.value?.click()),
|
|
3145
2743
|
class: normalizeClass([
|
|
3146
2744
|
"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",
|
|
3147
|
-
|
|
2745
|
+
l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
3148
2746
|
])
|
|
3149
2747
|
}, [
|
|
3150
2748
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
3151
2749
|
], 2)
|
|
3152
2750
|
])) : createCommentVNode("", !0),
|
|
3153
|
-
|
|
2751
|
+
l.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
3154
2752
|
key: 2,
|
|
3155
|
-
onClick:
|
|
3156
|
-
class: normalizeClass([
|
|
2753
|
+
onClick: i[4] || (i[4] = (u) => r.value?.click()),
|
|
2754
|
+
class: normalizeClass([l.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"])
|
|
3157
2755
|
}, [
|
|
3158
2756
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
3159
2757
|
], 2))
|
|
3160
2758
|
]));
|
|
3161
2759
|
}
|
|
2760
|
+
}), _hoisted_1$6 = { class: "flex items-center justify-between" }, _hoisted_2$2 = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_3$1 = { class: "grid gap-3" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2761
|
+
__name: "vs-container-switcher",
|
|
2762
|
+
props: {
|
|
2763
|
+
title: {
|
|
2764
|
+
type: String,
|
|
2765
|
+
default: ""
|
|
2766
|
+
},
|
|
2767
|
+
style: {
|
|
2768
|
+
type: Object,
|
|
2769
|
+
default: () => ({})
|
|
2770
|
+
},
|
|
2771
|
+
isOpen: {
|
|
2772
|
+
type: Boolean,
|
|
2773
|
+
default: !1
|
|
2774
|
+
}
|
|
2775
|
+
},
|
|
2776
|
+
setup(e) {
|
|
2777
|
+
const t = e, n = ref(t.isOpen);
|
|
2778
|
+
return watch(
|
|
2779
|
+
() => t.isOpen,
|
|
2780
|
+
(r) => {
|
|
2781
|
+
n.value = r;
|
|
2782
|
+
}
|
|
2783
|
+
), (r, o) => (openBlock(), createElementBlock("div", null, [
|
|
2784
|
+
createElementVNode("div", _hoisted_1$6, [
|
|
2785
|
+
createElementVNode("p", _hoisted_2$2, toDisplayString(e.title), 1),
|
|
2786
|
+
createVNode(_sfc_main$v, {
|
|
2787
|
+
modelValue: n.value,
|
|
2788
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => n.value = s),
|
|
2789
|
+
style: normalizeStyle(e.style)
|
|
2790
|
+
}, null, 8, ["modelValue", "style"])
|
|
2791
|
+
]),
|
|
2792
|
+
createVNode(Transition, { name: "slide-fade" }, {
|
|
2793
|
+
default: withCtx(() => [
|
|
2794
|
+
withDirectives(createElementVNode("div", _hoisted_3$1, [
|
|
2795
|
+
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2796
|
+
], 512), [
|
|
2797
|
+
[vShow, n.value]
|
|
2798
|
+
])
|
|
2799
|
+
]),
|
|
2800
|
+
_: 3
|
|
2801
|
+
})
|
|
2802
|
+
]));
|
|
2803
|
+
}
|
|
2804
|
+
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-479564a3"]]), _sfc_main$8 = {}, _hoisted_1$5 = {
|
|
2805
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2806
|
+
viewBox: "0 0 24 24",
|
|
2807
|
+
fill: "none",
|
|
2808
|
+
stroke: "currentColor",
|
|
2809
|
+
"stroke-width": "2",
|
|
2810
|
+
"stroke-linecap": "round",
|
|
2811
|
+
"stroke-linejoin": "round",
|
|
2812
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
2813
|
+
};
|
|
2814
|
+
function _sfc_render$2(e, t) {
|
|
2815
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$5, t[0] || (t[0] = [
|
|
2816
|
+
createElementVNode("path", {
|
|
2817
|
+
stroke: "none",
|
|
2818
|
+
d: "M0 0h24v24H0z",
|
|
2819
|
+
fill: "none"
|
|
2820
|
+
}, null, -1),
|
|
2821
|
+
createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
2822
|
+
]));
|
|
2823
|
+
}
|
|
2824
|
+
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$2]]), _sfc_main$7 = {}, _hoisted_1$4 = {
|
|
2825
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2826
|
+
viewBox: "0 0 24 24",
|
|
2827
|
+
fill: "none",
|
|
2828
|
+
stroke: "currentColor",
|
|
2829
|
+
"stroke-width": "2",
|
|
2830
|
+
"stroke-linecap": "round",
|
|
2831
|
+
"stroke-linejoin": "round"
|
|
2832
|
+
};
|
|
2833
|
+
function _sfc_render$1(e, t) {
|
|
2834
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, t[0] || (t[0] = [
|
|
2835
|
+
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
2836
|
+
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
2837
|
+
]));
|
|
2838
|
+
}
|
|
2839
|
+
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$1]]), _sfc_main$6 = {}, _hoisted_1$3 = {
|
|
2840
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2841
|
+
viewBox: "0 0 24 24",
|
|
2842
|
+
fill: "none",
|
|
2843
|
+
stroke: "currentColor",
|
|
2844
|
+
"stroke-width": "2",
|
|
2845
|
+
"stroke-linecap": "round",
|
|
2846
|
+
"stroke-linejoin": "round",
|
|
2847
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
2848
|
+
};
|
|
2849
|
+
function _sfc_render(e, t) {
|
|
2850
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, t[0] || (t[0] = [
|
|
2851
|
+
createElementVNode("path", {
|
|
2852
|
+
stroke: "none",
|
|
2853
|
+
d: "M0 0h24v24H0z",
|
|
2854
|
+
fill: "none"
|
|
2855
|
+
}, null, -1),
|
|
2856
|
+
createElementVNode("path", { d: "M18 6l-12 12" }, null, -1),
|
|
2857
|
+
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
2858
|
+
]));
|
|
2859
|
+
}
|
|
2860
|
+
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render]]), _hoisted_1$2 = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_2$1 = { class: "grid gap-3" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2861
|
+
__name: "vs-container-accordion",
|
|
2862
|
+
props: {
|
|
2863
|
+
title: {
|
|
2864
|
+
type: String,
|
|
2865
|
+
default: ""
|
|
2866
|
+
},
|
|
2867
|
+
style: {
|
|
2868
|
+
type: Object,
|
|
2869
|
+
default: () => ({})
|
|
2870
|
+
},
|
|
2871
|
+
isOpen: {
|
|
2872
|
+
type: Boolean,
|
|
2873
|
+
default: !1
|
|
2874
|
+
}
|
|
2875
|
+
},
|
|
2876
|
+
setup(e) {
|
|
2877
|
+
const t = e, n = ref(t.isOpen);
|
|
2878
|
+
return watch(
|
|
2879
|
+
() => t.isOpen,
|
|
2880
|
+
(r) => {
|
|
2881
|
+
n.value = r;
|
|
2882
|
+
}
|
|
2883
|
+
), (r, o) => (openBlock(), createElementBlock("div", null, [
|
|
2884
|
+
createElementVNode("button", {
|
|
2885
|
+
type: "button",
|
|
2886
|
+
onClick: o[0] || (o[0] = (s) => n.value = !n.value),
|
|
2887
|
+
class: "flex items-center gap-2"
|
|
2888
|
+
}, [
|
|
2889
|
+
createVNode(unref(IconChevronDown), {
|
|
2890
|
+
class: normalizeClass(["h-4 w-4 duration-300", [n.value ? "-rotate-180" : ""]])
|
|
2891
|
+
}, null, 8, ["class"]),
|
|
2892
|
+
createElementVNode("span", _hoisted_1$2, toDisplayString(e.title), 1)
|
|
2893
|
+
]),
|
|
2894
|
+
createVNode(Transition, { name: "slide-fade" }, {
|
|
2895
|
+
default: withCtx(() => [
|
|
2896
|
+
withDirectives(createElementVNode("div", _hoisted_2$1, [
|
|
2897
|
+
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2898
|
+
], 512), [
|
|
2899
|
+
[vShow, n.value]
|
|
2900
|
+
])
|
|
2901
|
+
]),
|
|
2902
|
+
_: 3
|
|
2903
|
+
})
|
|
2904
|
+
]));
|
|
2905
|
+
}
|
|
2906
|
+
}), VsContainerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-a37284e6"]]), _hoisted_1$1 = { class: "flex items-center justify-between" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2907
|
+
__name: "vs-container-default",
|
|
2908
|
+
props: {
|
|
2909
|
+
title: {
|
|
2910
|
+
type: String,
|
|
2911
|
+
default: ""
|
|
2912
|
+
},
|
|
2913
|
+
style: {
|
|
2914
|
+
type: Object,
|
|
2915
|
+
default: () => ({})
|
|
2916
|
+
}
|
|
2917
|
+
},
|
|
2918
|
+
setup(e) {
|
|
2919
|
+
return (t, n) => (openBlock(), createElementBlock("div", null, [
|
|
2920
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
2921
|
+
createElementVNode("p", null, toDisplayString(e.title), 1)
|
|
2922
|
+
]),
|
|
2923
|
+
renderSlot(t.$slots, "default")
|
|
2924
|
+
]));
|
|
2925
|
+
}
|
|
2926
|
+
}), views = {
|
|
2927
|
+
switcher: VsContainerSwitcher,
|
|
2928
|
+
accordion: VsContainerAccordion,
|
|
2929
|
+
default: _sfc_main$4
|
|
2930
|
+
}, FormConditionsTypes = {
|
|
2931
|
+
Equal: "==",
|
|
2932
|
+
Inequal: "!=",
|
|
2933
|
+
Higer: ">",
|
|
2934
|
+
HigerOrEqual: ">=",
|
|
2935
|
+
Lower: "<",
|
|
2936
|
+
LowerOrEqual: "<=",
|
|
2937
|
+
Between: "between",
|
|
2938
|
+
StartWith: "^",
|
|
2939
|
+
EndWith: "$",
|
|
2940
|
+
Contain: "*",
|
|
2941
|
+
In: "in",
|
|
2942
|
+
NotIn: "not_in"
|
|
2943
|
+
}, checkEqual = (e, t) => e === t, checkInequal = (e, t) => e !== t, checkHigher = (e, t) => e > t, checkHigherOrEqual = (e, t) => e >= t, checkLower = (e, t) => e < t, checkLowerOrEqual = (e, t) => e <= t, checkBetween = (e, t) => Array.isArray(t) && t.length === 2 ? e >= t[0] && e <= t[1] : !1, checkStartWith = (e, t) => String(e).startsWith(String(t)), checkEndWith = (e, t) => String(e).endsWith(String(t)), checkContain = (e, t) => String(e).includes(String(t)), checkIn = (e, t) => Array.isArray(t) ? t.includes(e) : !1, checkNotIn = (e, t) => Array.isArray(t) ? !t.includes(e) : !0, isVisible = (e, t) => {
|
|
2944
|
+
if (!t) return !0;
|
|
2945
|
+
switch (t?.[1]) {
|
|
2946
|
+
case FormConditionsTypes.Equal:
|
|
2947
|
+
return checkEqual(e, t?.[2]);
|
|
2948
|
+
case FormConditionsTypes.Inequal:
|
|
2949
|
+
return checkInequal(e, t?.[2]);
|
|
2950
|
+
case FormConditionsTypes.Higer:
|
|
2951
|
+
return checkHigher(e, t?.[2]);
|
|
2952
|
+
case FormConditionsTypes.HigerOrEqual:
|
|
2953
|
+
return checkHigherOrEqual(e, t?.[2]);
|
|
2954
|
+
case FormConditionsTypes.Lower:
|
|
2955
|
+
return checkLower(e, t?.[2]);
|
|
2956
|
+
case FormConditionsTypes.LowerOrEqual:
|
|
2957
|
+
return checkLowerOrEqual(e, t?.[2]);
|
|
2958
|
+
case FormConditionsTypes.Between:
|
|
2959
|
+
return checkBetween(e, t?.[2]);
|
|
2960
|
+
case FormConditionsTypes.StartWith:
|
|
2961
|
+
return checkStartWith(e, t?.[2]);
|
|
2962
|
+
case FormConditionsTypes.EndWith:
|
|
2963
|
+
return checkEndWith(e, t?.[2]);
|
|
2964
|
+
case FormConditionsTypes.Contain:
|
|
2965
|
+
return checkContain(e, t?.[2]);
|
|
2966
|
+
case FormConditionsTypes.In:
|
|
2967
|
+
return checkIn(e, t?.[2]);
|
|
2968
|
+
case FormConditionsTypes.NotIn:
|
|
2969
|
+
return checkNotIn(e, t?.[2]);
|
|
2970
|
+
default:
|
|
2971
|
+
return !0;
|
|
2972
|
+
}
|
|
2973
|
+
}, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2974
|
+
__name: "vs-input-container",
|
|
2975
|
+
props: {
|
|
2976
|
+
style: {
|
|
2977
|
+
type: Object,
|
|
2978
|
+
default: () => ({})
|
|
2979
|
+
},
|
|
2980
|
+
title: {
|
|
2981
|
+
type: String,
|
|
2982
|
+
default: ""
|
|
2983
|
+
},
|
|
2984
|
+
view: {
|
|
2985
|
+
type: String,
|
|
2986
|
+
default: "default"
|
|
2987
|
+
},
|
|
2988
|
+
schema: {
|
|
2989
|
+
type: Array,
|
|
2990
|
+
default: () => []
|
|
2991
|
+
}
|
|
2992
|
+
},
|
|
2993
|
+
setup(e) {
|
|
2994
|
+
const t = e, n = inject("formValues", { default: {} }), r = inject("form"), o = computed(() => t.schema?.filter((l) => {
|
|
2995
|
+
const i = l?.conditions;
|
|
2996
|
+
if (!i) return !0;
|
|
2997
|
+
const u = Array.isArray(i) ? i[0] : i, c = n?.value?.[u];
|
|
2998
|
+
return isVisible(c, i);
|
|
2999
|
+
})), s = computed(() => views[t.view]);
|
|
3000
|
+
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
3001
|
+
key: 0,
|
|
3002
|
+
title: e.title,
|
|
3003
|
+
style: normalizeStyle(e.style)
|
|
3004
|
+
}, {
|
|
3005
|
+
default: withCtx(() => [
|
|
3006
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (u) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3007
|
+
key: u.name
|
|
3008
|
+
}, { ref_for: !0 }, u, {
|
|
3009
|
+
item: u,
|
|
3010
|
+
modelValue: unref(n)[u.name],
|
|
3011
|
+
"onUpdate:modelValue": (c) => unref(n)[u.name] = c,
|
|
3012
|
+
style: e.style,
|
|
3013
|
+
error: unref(r)?.errors?.[u.name]
|
|
3014
|
+
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3015
|
+
]),
|
|
3016
|
+
_: 1
|
|
3017
|
+
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
3018
|
+
}
|
|
3019
|
+
}), dynamicPosition = async (e, t, n, r = 10) => {
|
|
3020
|
+
if (!t || !n) return;
|
|
3021
|
+
await nextTick();
|
|
3022
|
+
const o = await n?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
3023
|
+
if (!s || !o) return;
|
|
3024
|
+
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(n?.getBoundingClientRect()?.height.toString()), c = await parseInt(n?.getBoundingClientRect()?.width.toString()), a = await window.innerHeight, d = await window.innerWidth;
|
|
3025
|
+
let f = 0, h = 0;
|
|
3026
|
+
const p = s.bottom + r + u;
|
|
3027
|
+
switch (e) {
|
|
3028
|
+
case "top":
|
|
3029
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + l : f = s.top - o.height - r, d > c + s.right + 30 ? h = s.left - o.width / 2 + s.width / 2 : h = d - 30 - c;
|
|
3030
|
+
break;
|
|
3031
|
+
case "bottom":
|
|
3032
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - l, h = s.left - o.width / 2 + s.width / 2;
|
|
3033
|
+
break;
|
|
3034
|
+
case "left":
|
|
3035
|
+
f = s.top - o.height / 2 + s.height / 2, s.left - o.width - r > 0 ? h = s.left - o.width - r : h = 10;
|
|
3036
|
+
break;
|
|
3037
|
+
case "right":
|
|
3038
|
+
f = s.top - o.height / 2 + s.height / 2, d - i > c ? h = s.right + r : h = d - 30 - c;
|
|
3039
|
+
break;
|
|
3040
|
+
case "top-right":
|
|
3041
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + l : f = s.top - o.height - r, d - i > c ? h = s.right + r : h = d - 30 - c;
|
|
3042
|
+
break;
|
|
3043
|
+
case "top-left":
|
|
3044
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + l : f = s.top - o.height - r, s.left - o.width - r > 0 ? h = s.left - o.width - r : h = 10;
|
|
3045
|
+
break;
|
|
3046
|
+
case "top-start":
|
|
3047
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + l : f = s.top - o.height - r, s.left > 0 ? h = s.left : h = 10;
|
|
3048
|
+
break;
|
|
3049
|
+
case "bottom-right":
|
|
3050
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - l, d - i > c ? h = s.left : h = d - 30 - c;
|
|
3051
|
+
break;
|
|
3052
|
+
case "bottom-left":
|
|
3053
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - l, s.left > 0 ? h = s.right - c : h = 10;
|
|
3054
|
+
break;
|
|
3055
|
+
case "bottom-start":
|
|
3056
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - l, s.left > 0 ? h = s.left : h = 10;
|
|
3057
|
+
break;
|
|
3058
|
+
}
|
|
3059
|
+
f + u > a ? f = a - u - r : f < 0 && (f = r), h + c > d ? h = d - c - r : h < 0 && (h = r), n instanceof HTMLElement && (n.style.top = `${f}px`, n.style.left = `${h}px`, n.style.position = "fixed");
|
|
3060
|
+
}, _hoisted_1 = ["disabled"], _hoisted_2 = { key: 1 }, _hoisted_3 = {
|
|
3061
|
+
key: 2,
|
|
3062
|
+
class: "text-gray-400"
|
|
3063
|
+
}, _hoisted_4 = { class: "absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none" }, _hoisted_5 = ["onClick"], _hoisted_6 = { class: "flex items-center gap-[8px] w-full" }, _hoisted_7 = { key: 1 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3064
|
+
__name: "vs-input-select",
|
|
3065
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3066
|
+
placeholder: { default: "Оберіть значення" },
|
|
3067
|
+
prefix: { default: "api" },
|
|
3068
|
+
host: { default: "" },
|
|
3069
|
+
data: { default: null },
|
|
3070
|
+
options: { default: () => [] },
|
|
3071
|
+
maxHeight: { default: 400 },
|
|
3072
|
+
slots: { default: null },
|
|
3073
|
+
customClass: { default: "" },
|
|
3074
|
+
style: { default: () => ({}) },
|
|
3075
|
+
disabled: { type: Boolean }
|
|
3076
|
+
}, {
|
|
3077
|
+
modelValue: {
|
|
3078
|
+
type: [Number, String],
|
|
3079
|
+
default: null
|
|
3080
|
+
},
|
|
3081
|
+
modelModifiers: {}
|
|
3082
|
+
}),
|
|
3083
|
+
emits: ["update:modelValue"],
|
|
3084
|
+
setup(e) {
|
|
3085
|
+
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue"), o = ref({}), s = ref(null), l = ref(null), i = ref(!1), u = ref(null), c = ref([]), a = ref(-1), d = ref([]), f = computed(() => c.value?.length ? [
|
|
3086
|
+
u.value,
|
|
3087
|
+
...c.value?.filter((b) => b?.id !== u.value?.id)
|
|
3088
|
+
].filter((b) => b !== null) : []), h = async () => {
|
|
3089
|
+
try {
|
|
3090
|
+
const { data: b } = await axios.get(
|
|
3091
|
+
`${t.host}/${t.prefix}/suggest/${t.data}?json=1`
|
|
3092
|
+
);
|
|
3093
|
+
return b.data;
|
|
3094
|
+
} catch {
|
|
3095
|
+
return [];
|
|
3096
|
+
}
|
|
3097
|
+
}, p = async (b) => {
|
|
3098
|
+
document.body.click(), i.value = b !== void 0 ? b : !i.value, i.value && !c.value?.length && (!t.options?.length && t.data ? c.value = await h() : t.options?.length && (c.value = [...t.options])), i.value && s.value ? (o.value.width = `${s.value.getBoundingClientRect()?.width}px`, l.value && dynamicPosition("bottom-start", s.value, l.value)) : a.value = -1;
|
|
3099
|
+
}, y = () => i.value ? p(!1) : null, m = (b) => {
|
|
3100
|
+
u.value = b, r.value = b.id, p(!1);
|
|
3101
|
+
}, x = (b, g) => {
|
|
3102
|
+
if (!b || !g) return;
|
|
3103
|
+
const w = b.offsetTop, E = w + b.offsetHeight, S = g.scrollTop, B = S + g.clientHeight;
|
|
3104
|
+
w < S ? g.scrollTop = w - 80 : E > B && (g.scrollTop = E - g.clientHeight + 4);
|
|
3105
|
+
}, $ = (b) => {
|
|
3106
|
+
if (!i.value) return;
|
|
3107
|
+
const { keyCode: g } = b;
|
|
3108
|
+
if ([38, 40, 13].includes(g) && b.preventDefault(), g == 38) {
|
|
3109
|
+
if (a.value == 0) return;
|
|
3110
|
+
a.value -= 1, x(d.value[a.value], l.value);
|
|
3111
|
+
} else if (g == 40) {
|
|
3112
|
+
if (a.value + 1 >= f.value?.length) return;
|
|
3113
|
+
a.value += 1, x(d.value[a.value], l.value);
|
|
3114
|
+
} else if (g == 13) {
|
|
3115
|
+
const w = f.value[a.value];
|
|
3116
|
+
w && m(w);
|
|
3117
|
+
}
|
|
3118
|
+
}, v = async (b) => {
|
|
3119
|
+
if (i.value) return;
|
|
3120
|
+
const { keyCode: g } = b;
|
|
3121
|
+
[38, 40].includes(g) && (await b.preventDefault(), a.value = 0, setTimeout(() => p()));
|
|
3122
|
+
}, _ = (b) => {
|
|
3123
|
+
i.value && s.value && l.value && !l.value.contains(b.target) && (i.value = !1);
|
|
3124
|
+
}, k = (b) => {
|
|
3125
|
+
b?.key === "Escape" && i.value && p(!1);
|
|
3126
|
+
};
|
|
3127
|
+
return onMounted(async () => {
|
|
3128
|
+
addEventListener("click", y), addEventListener("keydown", $), addEventListener("scroll", _, !0), addEventListener("keydown", k), r.value && !t.options?.length && t.data && (c.value = await h(), u.value = c.value?.find((b) => b?.id === r.value) || null);
|
|
3129
|
+
}), onUnmounted(() => {
|
|
3130
|
+
removeEventListener("click", y), removeEventListener("keydown", $), removeEventListener("scroll", _, !0), removeEventListener("keydown", k);
|
|
3131
|
+
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
3132
|
+
class: "relative w-full",
|
|
3133
|
+
ref_key: "select",
|
|
3134
|
+
ref: s,
|
|
3135
|
+
onClick: g[3] || (g[3] = withModifiers(() => {
|
|
3136
|
+
}, ["stop"]))
|
|
3137
|
+
}, [
|
|
3138
|
+
createElementVNode("button", {
|
|
3139
|
+
type: "button",
|
|
3140
|
+
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
3141
|
+
i.value ? `ring-rind ring-2 ring-${b.style?.primaryColor || "blue"}-500` : "",
|
|
3142
|
+
u.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
3143
|
+
unref(n),
|
|
3144
|
+
b.customClass
|
|
3145
|
+
]]),
|
|
3146
|
+
onKeydown: v,
|
|
3147
|
+
onClick: g[0] || (g[0] = (w) => p(!i.value)),
|
|
3148
|
+
disabled: b.disabled,
|
|
3149
|
+
style: {
|
|
3150
|
+
border: "1px solid #CFD9E0"
|
|
3151
|
+
}
|
|
3152
|
+
}, [
|
|
3153
|
+
u.value?.color ? (openBlock(), createElementBlock("span", {
|
|
3154
|
+
key: 0,
|
|
3155
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3156
|
+
style: normalizeStyle({ backgroundColor: u.value?.color })
|
|
3157
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3158
|
+
u.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(u.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(b.placeholder), 1))
|
|
3159
|
+
], 42, _hoisted_1),
|
|
3160
|
+
createElementVNode("span", _hoisted_4, [
|
|
3161
|
+
createVNode(unref(IconChevronTopBottom), {
|
|
3162
|
+
height: "14",
|
|
3163
|
+
width: "14"
|
|
3164
|
+
})
|
|
3165
|
+
]),
|
|
3166
|
+
u.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3167
|
+
key: 0,
|
|
3168
|
+
type: "button",
|
|
3169
|
+
onClick: g[1] || (g[1] = (w) => {
|
|
3170
|
+
r.value = null, u.value = null;
|
|
3171
|
+
}),
|
|
3172
|
+
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3173
|
+
}, [
|
|
3174
|
+
createVNode(unref(IconClose), {
|
|
3175
|
+
height: "14",
|
|
3176
|
+
width: "14"
|
|
3177
|
+
})
|
|
3178
|
+
])) : createCommentVNode("", !0),
|
|
3179
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3180
|
+
withDirectives(createElementVNode("ul", {
|
|
3181
|
+
class: "z-[90] border rounded-lg fixed flex flex-col gap-[2px] p-1 bg-white overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",
|
|
3182
|
+
ref_key: "list",
|
|
3183
|
+
ref: l,
|
|
3184
|
+
style: normalizeStyle({
|
|
3185
|
+
width: o.value.width,
|
|
3186
|
+
maxHeight: b.maxHeight + "px",
|
|
3187
|
+
backgroundColor: "white"
|
|
3188
|
+
}),
|
|
3189
|
+
onClick: g[2] || (g[2] = withModifiers(() => {
|
|
3190
|
+
}, ["stop"]))
|
|
3191
|
+
}, [
|
|
3192
|
+
f.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3193
|
+
g[4] || (g[4] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
3194
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (w, E) => (openBlock(), createElementBlock("li", {
|
|
3195
|
+
onClick: (S) => m(w),
|
|
3196
|
+
key: w?.id,
|
|
3197
|
+
ref_for: !0,
|
|
3198
|
+
ref: (S) => d.value[E] = S,
|
|
3199
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [a.value == E ? "bg-gray-100" : ""]])
|
|
3200
|
+
}, [
|
|
3201
|
+
createElementVNode("span", _hoisted_6, [
|
|
3202
|
+
w?.color ? (openBlock(), createElementBlock("span", {
|
|
3203
|
+
key: 0,
|
|
3204
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3205
|
+
style: normalizeStyle({ backgroundColor: w?.color })
|
|
3206
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3207
|
+
createTextVNode(" " + toDisplayString(w?.text), 1)
|
|
3208
|
+
]),
|
|
3209
|
+
r.value == w?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
3210
|
+
key: 0,
|
|
3211
|
+
height: "14",
|
|
3212
|
+
width: "14",
|
|
3213
|
+
"stroke-width": "2",
|
|
3214
|
+
class: "absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"
|
|
3215
|
+
})) : createCommentVNode("", !0)
|
|
3216
|
+
], 10, _hoisted_5))), 128))
|
|
3217
|
+
], 64)) : (openBlock(), createElementBlock("li", _hoisted_7, "Дані відсутні"))
|
|
3218
|
+
], 4), [
|
|
3219
|
+
[vShow, i.value]
|
|
3220
|
+
])
|
|
3221
|
+
]))
|
|
3222
|
+
], 512));
|
|
3223
|
+
}
|
|
3162
3224
|
}), inputs = {
|
|
3163
|
-
VsInputText: _sfc_main$
|
|
3164
|
-
VsInputRadio: _sfc_main$
|
|
3165
|
-
"vs-input-text": _sfc_main$
|
|
3166
|
-
"vs-input-
|
|
3167
|
-
"vs-input-
|
|
3168
|
-
"vs-input-
|
|
3169
|
-
"vs-input-
|
|
3170
|
-
"vs-input-
|
|
3171
|
-
"vs-input-
|
|
3172
|
-
|
|
3225
|
+
VsInputText: _sfc_main$x,
|
|
3226
|
+
VsInputRadio: _sfc_main$q,
|
|
3227
|
+
"vs-input-text": _sfc_main$x,
|
|
3228
|
+
"vs-input-mask": _sfc_main$t,
|
|
3229
|
+
"vs-input-number": _sfc_main$w,
|
|
3230
|
+
"vs-input-radio": _sfc_main$q,
|
|
3231
|
+
"vs-input-select": _sfc_main$2,
|
|
3232
|
+
"vs-input-switcher": _sfc_main$v,
|
|
3233
|
+
"vs-input-static": _sfc_main$u,
|
|
3234
|
+
"vs-input-container": _sfc_main$3,
|
|
3235
|
+
"vs-input-date": _sfc_main$k,
|
|
3173
3236
|
"vs-input-checkbox": VsInputCheckbox,
|
|
3174
|
-
"vs-input-file": _sfc_main$
|
|
3237
|
+
"vs-input-file": _sfc_main$a
|
|
3175
3238
|
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3176
3239
|
__name: "vs-compact-form-layout",
|
|
3177
3240
|
props: {
|
|
@@ -3228,9 +3291,9 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3228
3291
|
combobox: "select",
|
|
3229
3292
|
email: "text",
|
|
3230
3293
|
textarea: "text",
|
|
3231
|
-
datepicker: "
|
|
3232
|
-
markedtext: "text"
|
|
3233
|
-
mask:
|
|
3294
|
+
datepicker: "date",
|
|
3295
|
+
markedtext: "text"
|
|
3296
|
+
// mask: 'text',
|
|
3234
3297
|
};
|
|
3235
3298
|
function convertType(e) {
|
|
3236
3299
|
const t = e.toLowerCase();
|
|
@@ -3240,20 +3303,20 @@ function convertSchema(e) {
|
|
|
3240
3303
|
if (Array.isArray(e)) return e;
|
|
3241
3304
|
const t = [];
|
|
3242
3305
|
return Object.entries(e).forEach((n) => {
|
|
3243
|
-
const r = { name: n[0], ...n[1], type: convertType(n[1].type) };
|
|
3306
|
+
const r = { name: n[0], ...n[1], type: convertType(n[1].type), label: n[1].label || n[1].ua };
|
|
3244
3307
|
n[1].data && (r.api = `/api/suggest/${n[1].data}`), t.push(r);
|
|
3245
3308
|
}), t;
|
|
3246
3309
|
}
|
|
3247
3310
|
function useForm(e, t) {
|
|
3248
|
-
const n = convertSchema(t), r = ref({}), o = (
|
|
3249
|
-
if (
|
|
3311
|
+
const n = convertSchema(t), r = ref({}), o = (i = n, u = !0) => {
|
|
3312
|
+
if (i.forEach((c) => {
|
|
3250
3313
|
c.rules && c.rules.forEach((a) => {
|
|
3251
3314
|
r.value[c.name] = checkFormRules(e.value[c.name], a);
|
|
3252
3315
|
}), c.schema && o(c.schema, !1);
|
|
3253
3316
|
}), u && Object.values(r.value).some(Boolean))
|
|
3254
3317
|
throw new Error("Помилка валідації");
|
|
3255
|
-
}, s = computed(() => n?.filter((
|
|
3256
|
-
const u =
|
|
3318
|
+
}, s = computed(() => n?.filter((i) => {
|
|
3319
|
+
const u = i?.conditions;
|
|
3257
3320
|
if (!u) return !0;
|
|
3258
3321
|
const c = Array.isArray(u) ? u[0] : u, a = e?.value?.[c];
|
|
3259
3322
|
return isVisible(a, u);
|
|
@@ -3281,17 +3344,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3281
3344
|
}),
|
|
3282
3345
|
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3283
3346
|
setup(e, { emit: t }) {
|
|
3284
|
-
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"),
|
|
3285
|
-
errors:
|
|
3347
|
+
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3348
|
+
errors: i,
|
|
3286
3349
|
validate: u,
|
|
3287
3350
|
reset: c,
|
|
3288
3351
|
visibleSchema: a
|
|
3289
|
-
} = useForm(
|
|
3290
|
-
u(), n("handle-submit",
|
|
3352
|
+
} = useForm(l, r.schema), d = () => {
|
|
3353
|
+
u(), n("handle-submit", l.value);
|
|
3291
3354
|
};
|
|
3292
3355
|
return onMounted(() => {
|
|
3293
|
-
s.value.value =
|
|
3294
|
-
}), provide("form", s), provide("values",
|
|
3356
|
+
s.value.value = l.value, s.value.errors = i.value, s.value.reset = c, s.value.validate = u;
|
|
3357
|
+
}), provide("form", s), provide("values", l), (f, h) => (openBlock(), createElementBlock("form", {
|
|
3295
3358
|
onSubmit: withModifiers(d, ["prevent"]),
|
|
3296
3359
|
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3297
3360
|
}, [
|
|
@@ -3301,10 +3364,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3301
3364
|
}, { ref_for: !0 }, { ...unref(o), ...f.style, ...p }, {
|
|
3302
3365
|
item: p,
|
|
3303
3366
|
layout: f.layout,
|
|
3304
|
-
modelValue:
|
|
3305
|
-
"onUpdate:modelValue": (y) =>
|
|
3367
|
+
modelValue: l.value[p.name],
|
|
3368
|
+
"onUpdate:modelValue": (y) => l.value[p.name] = y,
|
|
3306
3369
|
style: f.style,
|
|
3307
|
-
error: unref(
|
|
3370
|
+
error: unref(i)[p.name]
|
|
3308
3371
|
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3309
3372
|
], 34));
|
|
3310
3373
|
}
|
|
@@ -3314,6 +3377,6 @@ _sfc_main.install = function e(t) {
|
|
|
3314
3377
|
};
|
|
3315
3378
|
export {
|
|
3316
3379
|
_sfc_main as VForm,
|
|
3317
|
-
_sfc_main$
|
|
3380
|
+
_sfc_main$x as VsInputText,
|
|
3318
3381
|
_sfc_main as default
|
|
3319
3382
|
};
|