@opengis/form 0.0.1 → 0.0.3
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/index.css +1 -1
- package/index.js +1156 -1060
- package/index.umd.cjs +5 -5
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -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,22 +26,22 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
setup(e) {
|
|
29
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
30
|
-
createElementVNode("span", _hoisted_2$
|
|
29
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
30
|
+
createElementVNode("span", _hoisted_2$b, [
|
|
31
31
|
createElementVNode("span", null, toDisplayString(e.ua || e.label), 1),
|
|
32
|
-
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
32
|
+
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$5, "*")) : createCommentVNode("", !0)
|
|
33
33
|
]),
|
|
34
34
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
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,19 +62,19 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
setup(e) {
|
|
65
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
66
|
-
createElementVNode("span", _hoisted_2$
|
|
65
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
66
|
+
createElementVNode("span", _hoisted_2$a, [
|
|
67
67
|
createTextVNode(toDisplayString(e.ua || e.label) + " ", 1),
|
|
68
|
-
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
68
|
+
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$4, "*")) : createCommentVNode("", !0)
|
|
69
69
|
]),
|
|
70
70
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
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,25 +95,25 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { 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
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
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 {
|
|
110
110
|
inputClass: computed(() => {
|
|
111
|
-
const n = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-
|
|
112
|
-
return e?.size === "sm" ? n + "h-[32px]" : n + "h-[
|
|
111
|
+
const n = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
112
|
+
return e?.size === "sm" ? n + "h-[32px]" : n + "h-[38px]";
|
|
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
|
-
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(n)]]),
|
|
147
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
148
148
|
style: {
|
|
149
|
-
border: "1px solid #
|
|
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
|
-
border: "1px solid #
|
|
179
|
+
border: "1px solid #CFD9E0"
|
|
180
|
+
}
|
|
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"
|
|
180
271
|
}
|
|
181
|
-
}, null, 10, _hoisted_1$
|
|
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", {
|
|
@@ -235,10 +326,10 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
235
326
|
class: normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${e.style?.primaryColor || "blue"}-500`]])
|
|
236
327
|
}, null, 2)) : createCommentVNode("", !0)
|
|
237
328
|
], 2),
|
|
238
|
-
createElementVNode("span", _hoisted_2$
|
|
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
|
-
createElementVNode("span", _hoisted_2$
|
|
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
|
}
|
|
@@ -360,10 +451,10 @@ function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
360
451
|
for (r = 0, o = e.length; r < o; r++)
|
|
361
452
|
t.call(null, e[r], r, e);
|
|
362
453
|
else {
|
|
363
|
-
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e),
|
|
364
|
-
let
|
|
365
|
-
for (r = 0; r <
|
|
366
|
-
|
|
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);
|
|
367
458
|
}
|
|
368
459
|
}
|
|
369
460
|
function findKey(e, t) {
|
|
@@ -392,12 +483,12 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
392
483
|
value: t.prototype
|
|
393
484
|
}), n && Object.assign(e.prototype, n);
|
|
394
485
|
}, toFlatObject = (e, t, n, r) => {
|
|
395
|
-
let o, s,
|
|
396
|
-
const
|
|
486
|
+
let o, s, l;
|
|
487
|
+
const i = {};
|
|
397
488
|
if (t = t || {}, e == null) return t;
|
|
398
489
|
do {
|
|
399
490
|
for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
|
|
400
|
-
|
|
491
|
+
l = o[s], (!r || r(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
401
492
|
e = n !== !1 && getPrototypeOf(e);
|
|
402
493
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
403
494
|
return t;
|
|
@@ -435,8 +526,8 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
435
526
|
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
436
527
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
437
528
|
forEach(n, (o, s) => {
|
|
438
|
-
let
|
|
439
|
-
(
|
|
529
|
+
let l;
|
|
530
|
+
(l = t(o, s, e)) !== !1 && (r[s] = l || o);
|
|
440
531
|
}), Object.defineProperties(e, r);
|
|
441
532
|
}, freezeMethods = (e) => {
|
|
442
533
|
reduceDescriptors(e, (t, n) => {
|
|
@@ -473,9 +564,9 @@ const toJSONObject = (e) => {
|
|
|
473
564
|
if (!("toJSON" in r)) {
|
|
474
565
|
t[o] = r;
|
|
475
566
|
const s = isArray(r) ? [] : {};
|
|
476
|
-
return forEach(r, (
|
|
477
|
-
const
|
|
478
|
-
!isUndefined(
|
|
567
|
+
return forEach(r, (l, i) => {
|
|
568
|
+
const u = n(l, o + 1);
|
|
569
|
+
!isUndefined(u) && (s[i] = u);
|
|
479
570
|
}), t[o] = void 0, s;
|
|
480
571
|
}
|
|
481
572
|
}
|
|
@@ -593,10 +684,10 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
593
684
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
594
685
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
595
686
|
AxiosError$1.from = (e, t, n, r, o, s) => {
|
|
596
|
-
const
|
|
597
|
-
return utils$1.toFlatObject(e,
|
|
598
|
-
return
|
|
599
|
-
}, (
|
|
687
|
+
const l = Object.create(prototype$1);
|
|
688
|
+
return utils$1.toFlatObject(e, l, function(u) {
|
|
689
|
+
return u !== Error.prototype;
|
|
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;
|
|
600
691
|
};
|
|
601
692
|
const httpAdapter = null;
|
|
602
693
|
function isVisitable(e) {
|
|
@@ -626,52 +717,52 @@ function toFormData$1(e, t, n) {
|
|
|
626
717
|
}, !1, function(y, m) {
|
|
627
718
|
return !utils$1.isUndefined(m[y]);
|
|
628
719
|
});
|
|
629
|
-
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);
|
|
630
721
|
if (!utils$1.isFunction(o))
|
|
631
722
|
throw new TypeError("visitor must be a function");
|
|
632
|
-
function
|
|
723
|
+
function c(p) {
|
|
633
724
|
if (p === null) return "";
|
|
634
725
|
if (utils$1.isDate(p))
|
|
635
726
|
return p.toISOString();
|
|
636
727
|
if (utils$1.isBoolean(p))
|
|
637
728
|
return p.toString();
|
|
638
|
-
if (!
|
|
729
|
+
if (!u && utils$1.isBlob(p))
|
|
639
730
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
640
|
-
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ?
|
|
731
|
+
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
641
732
|
}
|
|
642
733
|
function a(p, y, m) {
|
|
643
|
-
let
|
|
734
|
+
let x = p;
|
|
644
735
|
if (p && !m && typeof p == "object") {
|
|
645
736
|
if (utils$1.endsWith(y, "{}"))
|
|
646
737
|
y = r ? y : y.slice(0, -2), p = JSON.stringify(p);
|
|
647
|
-
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (
|
|
648
|
-
return y = removeBrackets(y),
|
|
649
|
-
!(utils$1.isUndefined(
|
|
738
|
+
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (x = utils$1.toArray(p)))
|
|
739
|
+
return y = removeBrackets(y), x.forEach(function(v, _) {
|
|
740
|
+
!(utils$1.isUndefined(v) || v === null) && t.append(
|
|
650
741
|
// eslint-disable-next-line no-nested-ternary
|
|
651
|
-
|
|
652
|
-
|
|
742
|
+
l === !0 ? renderKey([y], _, s) : l === null ? y : y + "[]",
|
|
743
|
+
c(v)
|
|
653
744
|
);
|
|
654
745
|
}), !1;
|
|
655
746
|
}
|
|
656
|
-
return isVisitable(p) ? !0 : (t.append(renderKey(m, y, s),
|
|
747
|
+
return isVisitable(p) ? !0 : (t.append(renderKey(m, y, s), c(p)), !1);
|
|
657
748
|
}
|
|
658
749
|
const d = [], f = Object.assign(predicates, {
|
|
659
750
|
defaultVisitor: a,
|
|
660
|
-
convertValue:
|
|
751
|
+
convertValue: c,
|
|
661
752
|
isVisitable
|
|
662
753
|
});
|
|
663
754
|
function h(p, y) {
|
|
664
755
|
if (!utils$1.isUndefined(p)) {
|
|
665
756
|
if (d.indexOf(p) !== -1)
|
|
666
757
|
throw Error("Circular reference detected in " + y.join("."));
|
|
667
|
-
d.push(p), utils$1.forEach(p, function(
|
|
668
|
-
(!(utils$1.isUndefined(
|
|
758
|
+
d.push(p), utils$1.forEach(p, function(x, $) {
|
|
759
|
+
(!(utils$1.isUndefined(x) || x === null) && o.call(
|
|
669
760
|
t,
|
|
670
|
-
|
|
671
|
-
utils$1.isString(
|
|
761
|
+
x,
|
|
762
|
+
utils$1.isString($) ? $.trim() : $,
|
|
672
763
|
y,
|
|
673
764
|
f
|
|
674
|
-
)) === !0 && h(
|
|
765
|
+
)) === !0 && h(x, y ? y.concat($) : [$]);
|
|
675
766
|
}), d.pop();
|
|
676
767
|
}
|
|
677
768
|
}
|
|
@@ -721,8 +812,8 @@ function buildURL(e, t, n) {
|
|
|
721
812
|
const o = n && n.serialize;
|
|
722
813
|
let s;
|
|
723
814
|
if (o ? s = o(t, n) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, n).toString(r), s) {
|
|
724
|
-
const
|
|
725
|
-
|
|
815
|
+
const l = e.indexOf("#");
|
|
816
|
+
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
726
817
|
}
|
|
727
818
|
return e;
|
|
728
819
|
}
|
|
@@ -825,10 +916,10 @@ function arrayToObject(e) {
|
|
|
825
916
|
}
|
|
826
917
|
function formDataToJSON(e) {
|
|
827
918
|
function t(n, r, o, s) {
|
|
828
|
-
let
|
|
829
|
-
if (
|
|
830
|
-
const
|
|
831
|
-
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);
|
|
832
923
|
}
|
|
833
924
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
834
925
|
const n = {};
|
|
@@ -861,15 +952,15 @@ const defaults = {
|
|
|
861
952
|
return t.buffer;
|
|
862
953
|
if (utils$1.isURLSearchParams(t))
|
|
863
954
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
864
|
-
let
|
|
955
|
+
let i;
|
|
865
956
|
if (s) {
|
|
866
957
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
867
958
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
868
|
-
if ((
|
|
869
|
-
const
|
|
959
|
+
if ((i = utils$1.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
960
|
+
const u = this.env && this.env.FormData;
|
|
870
961
|
return toFormData$1(
|
|
871
|
-
|
|
872
|
-
|
|
962
|
+
i ? { "files[]": t } : t,
|
|
963
|
+
u && new u(),
|
|
873
964
|
this.formSerializer
|
|
874
965
|
);
|
|
875
966
|
}
|
|
@@ -881,12 +972,12 @@ const defaults = {
|
|
|
881
972
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
882
973
|
return t;
|
|
883
974
|
if (t && utils$1.isString(t) && (r && !this.responseType || o)) {
|
|
884
|
-
const
|
|
975
|
+
const l = !(n && n.silentJSONParsing) && o;
|
|
885
976
|
try {
|
|
886
977
|
return JSON.parse(t);
|
|
887
|
-
} catch (
|
|
888
|
-
if (
|
|
889
|
-
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;
|
|
890
981
|
}
|
|
891
982
|
}
|
|
892
983
|
return t;
|
|
@@ -939,8 +1030,8 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
939
1030
|
const t = {};
|
|
940
1031
|
let n, r, o;
|
|
941
1032
|
return e && e.split(`
|
|
942
|
-
`).forEach(function(
|
|
943
|
-
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);
|
|
944
1035
|
}), t;
|
|
945
1036
|
}, $internals = Symbol("internals");
|
|
946
1037
|
function normalizeHeader(e) {
|
|
@@ -974,8 +1065,8 @@ function buildAccessors(e, t) {
|
|
|
974
1065
|
const n = utils$1.toCamelCase(" " + t);
|
|
975
1066
|
["get", "set", "has"].forEach((r) => {
|
|
976
1067
|
Object.defineProperty(e, r + n, {
|
|
977
|
-
value: function(o, s,
|
|
978
|
-
return this[r].call(this, t, o, s,
|
|
1068
|
+
value: function(o, s, l) {
|
|
1069
|
+
return this[r].call(this, t, o, s, l);
|
|
979
1070
|
},
|
|
980
1071
|
configurable: !0
|
|
981
1072
|
});
|
|
@@ -987,26 +1078,26 @@ let AxiosHeaders$1 = class {
|
|
|
987
1078
|
}
|
|
988
1079
|
set(t, n, r) {
|
|
989
1080
|
const o = this;
|
|
990
|
-
function s(
|
|
991
|
-
const a = normalizeHeader(
|
|
1081
|
+
function s(i, u, c) {
|
|
1082
|
+
const a = normalizeHeader(u);
|
|
992
1083
|
if (!a)
|
|
993
1084
|
throw new Error("header name must be a non-empty string");
|
|
994
1085
|
const d = utils$1.findKey(o, a);
|
|
995
|
-
(!d || o[d] === void 0 ||
|
|
1086
|
+
(!d || o[d] === void 0 || c === !0 || c === void 0 && o[d] !== !1) && (o[d || u] = normalizeValue(i));
|
|
996
1087
|
}
|
|
997
|
-
const
|
|
1088
|
+
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
998
1089
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
999
|
-
|
|
1090
|
+
l(t, n);
|
|
1000
1091
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
1001
|
-
|
|
1092
|
+
l(parseHeaders(t), n);
|
|
1002
1093
|
else if (utils$1.isObject(t) && utils$1.isIterable(t)) {
|
|
1003
|
-
let
|
|
1094
|
+
let i = {}, u, c;
|
|
1004
1095
|
for (const a of t) {
|
|
1005
1096
|
if (!utils$1.isArray(a))
|
|
1006
1097
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1007
|
-
|
|
1098
|
+
i[c = a[0]] = (u = i[c]) ? utils$1.isArray(u) ? [...u, a[1]] : [u, a[1]] : a[1];
|
|
1008
1099
|
}
|
|
1009
|
-
i
|
|
1100
|
+
l(i, n);
|
|
1010
1101
|
} else
|
|
1011
1102
|
t != null && s(n, t, r);
|
|
1012
1103
|
return this;
|
|
@@ -1038,10 +1129,10 @@ let AxiosHeaders$1 = class {
|
|
|
1038
1129
|
delete(t, n) {
|
|
1039
1130
|
const r = this;
|
|
1040
1131
|
let o = !1;
|
|
1041
|
-
function s(
|
|
1042
|
-
if (
|
|
1043
|
-
const
|
|
1044
|
-
|
|
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);
|
|
1045
1136
|
}
|
|
1046
1137
|
}
|
|
1047
1138
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), o;
|
|
@@ -1058,13 +1149,13 @@ let AxiosHeaders$1 = class {
|
|
|
1058
1149
|
normalize(t) {
|
|
1059
1150
|
const n = this, r = {};
|
|
1060
1151
|
return utils$1.forEach(this, (o, s) => {
|
|
1061
|
-
const
|
|
1062
|
-
if (
|
|
1063
|
-
n[
|
|
1152
|
+
const l = utils$1.findKey(r, s);
|
|
1153
|
+
if (l) {
|
|
1154
|
+
n[l] = normalizeValue(o), delete n[s];
|
|
1064
1155
|
return;
|
|
1065
1156
|
}
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1157
|
+
const i = t ? formatHeader(s) : String(s).trim();
|
|
1158
|
+
i !== s && delete n[s], n[i] = normalizeValue(o), r[i] = !0;
|
|
1068
1159
|
}), this;
|
|
1069
1160
|
}
|
|
1070
1161
|
concat(...t) {
|
|
@@ -1100,9 +1191,9 @@ let AxiosHeaders$1 = class {
|
|
|
1100
1191
|
const r = (this[$internals] = this[$internals] = {
|
|
1101
1192
|
accessors: {}
|
|
1102
1193
|
}).accessors, o = this.prototype;
|
|
1103
|
-
function s(
|
|
1104
|
-
const
|
|
1105
|
-
r[
|
|
1194
|
+
function s(l) {
|
|
1195
|
+
const i = normalizeHeader(l);
|
|
1196
|
+
r[i] || (buildAccessors(o, l), r[i] = !0);
|
|
1106
1197
|
}
|
|
1107
1198
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1108
1199
|
}
|
|
@@ -1121,8 +1212,8 @@ utils$1.freezeMethods(AxiosHeaders$1);
|
|
|
1121
1212
|
function transformData(e, t) {
|
|
1122
1213
|
const n = this || defaults, r = t || n, o = AxiosHeaders$1.from(r.headers);
|
|
1123
1214
|
let s = r.data;
|
|
1124
|
-
return utils$1.forEach(e, function(
|
|
1125
|
-
s =
|
|
1215
|
+
return utils$1.forEach(e, function(i) {
|
|
1216
|
+
s = i.call(n, s, o.normalize(), t ? t.status : void 0);
|
|
1126
1217
|
}), o.normalize(), s;
|
|
1127
1218
|
}
|
|
1128
1219
|
function isCancel$1(e) {
|
|
@@ -1151,46 +1242,46 @@ function parseProtocol(e) {
|
|
|
1151
1242
|
function speedometer(e, t) {
|
|
1152
1243
|
e = e || 10;
|
|
1153
1244
|
const n = new Array(e), r = new Array(e);
|
|
1154
|
-
let o = 0, s = 0,
|
|
1155
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1245
|
+
let o = 0, s = 0, l;
|
|
1246
|
+
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1247
|
+
const c = Date.now(), a = r[s];
|
|
1248
|
+
l || (l = c), n[o] = u, r[o] = c;
|
|
1158
1249
|
let d = s, f = 0;
|
|
1159
1250
|
for (; d !== o; )
|
|
1160
1251
|
f += n[d++], d = d % e;
|
|
1161
|
-
if (o = (o + 1) % e, o === s && (s = (s + 1) % e),
|
|
1252
|
+
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c - l < t)
|
|
1162
1253
|
return;
|
|
1163
|
-
const h = a &&
|
|
1254
|
+
const h = a && c - a;
|
|
1164
1255
|
return h ? Math.round(f * 1e3 / h) : void 0;
|
|
1165
1256
|
};
|
|
1166
1257
|
}
|
|
1167
1258
|
function throttle(e, t) {
|
|
1168
1259
|
let n = 0, r = 1e3 / t, o, s;
|
|
1169
|
-
const
|
|
1170
|
-
n = a, o = null, s && (clearTimeout(s), s = null), e.apply(null,
|
|
1260
|
+
const l = (c, a = Date.now()) => {
|
|
1261
|
+
n = a, o = null, s && (clearTimeout(s), s = null), e.apply(null, c);
|
|
1171
1262
|
};
|
|
1172
|
-
return [(...
|
|
1263
|
+
return [(...c) => {
|
|
1173
1264
|
const a = Date.now(), d = a - n;
|
|
1174
|
-
d >= r ?
|
|
1175
|
-
s = null,
|
|
1265
|
+
d >= r ? l(c, a) : (o = c, s || (s = setTimeout(() => {
|
|
1266
|
+
s = null, l(o);
|
|
1176
1267
|
}, r - d)));
|
|
1177
|
-
}, () => o &&
|
|
1268
|
+
}, () => o && l(o)];
|
|
1178
1269
|
}
|
|
1179
1270
|
const progressEventReducer = (e, t, n = 3) => {
|
|
1180
1271
|
let r = 0;
|
|
1181
1272
|
const o = speedometer(50, 250);
|
|
1182
1273
|
return throttle((s) => {
|
|
1183
|
-
const
|
|
1184
|
-
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;
|
|
1185
1276
|
const d = {
|
|
1186
|
-
loaded:
|
|
1187
|
-
total:
|
|
1188
|
-
progress:
|
|
1189
|
-
bytes:
|
|
1190
|
-
rate:
|
|
1191
|
-
estimated:
|
|
1277
|
+
loaded: l,
|
|
1278
|
+
total: i,
|
|
1279
|
+
progress: i ? l / i : void 0,
|
|
1280
|
+
bytes: u,
|
|
1281
|
+
rate: c || void 0,
|
|
1282
|
+
estimated: c && i && a ? (i - l) / c : void 0,
|
|
1192
1283
|
event: s,
|
|
1193
|
-
lengthComputable:
|
|
1284
|
+
lengthComputable: i != null,
|
|
1194
1285
|
[t ? "download" : "upload"]: !0
|
|
1195
1286
|
};
|
|
1196
1287
|
e(d);
|
|
@@ -1209,8 +1300,8 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1209
1300
|
// Standard browser envs support document.cookie
|
|
1210
1301
|
{
|
|
1211
1302
|
write(e, t, n, r, o, s) {
|
|
1212
|
-
const
|
|
1213
|
-
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("; ");
|
|
1214
1305
|
},
|
|
1215
1306
|
read(e) {
|
|
1216
1307
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1246,109 +1337,109 @@ const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
|
1246
1337
|
function mergeConfig$1(e, t) {
|
|
1247
1338
|
t = t || {};
|
|
1248
1339
|
const n = {};
|
|
1249
|
-
function r(
|
|
1250
|
-
return utils$1.isPlainObject(
|
|
1340
|
+
function r(c, a, d, f) {
|
|
1341
|
+
return utils$1.isPlainObject(c) && utils$1.isPlainObject(a) ? utils$1.merge.call({ caseless: f }, c, a) : utils$1.isPlainObject(a) ? utils$1.merge({}, a) : utils$1.isArray(a) ? a.slice() : a;
|
|
1251
1342
|
}
|
|
1252
|
-
function o(
|
|
1343
|
+
function o(c, a, d, f) {
|
|
1253
1344
|
if (utils$1.isUndefined(a)) {
|
|
1254
|
-
if (!utils$1.isUndefined(
|
|
1255
|
-
return r(void 0,
|
|
1256
|
-
} else return r(
|
|
1345
|
+
if (!utils$1.isUndefined(c))
|
|
1346
|
+
return r(void 0, c, d, f);
|
|
1347
|
+
} else return r(c, a, d, f);
|
|
1257
1348
|
}
|
|
1258
|
-
function s(
|
|
1349
|
+
function s(c, a) {
|
|
1259
1350
|
if (!utils$1.isUndefined(a))
|
|
1260
1351
|
return r(void 0, a);
|
|
1261
1352
|
}
|
|
1262
|
-
function
|
|
1353
|
+
function l(c, a) {
|
|
1263
1354
|
if (utils$1.isUndefined(a)) {
|
|
1264
|
-
if (!utils$1.isUndefined(
|
|
1265
|
-
return r(void 0,
|
|
1355
|
+
if (!utils$1.isUndefined(c))
|
|
1356
|
+
return r(void 0, c);
|
|
1266
1357
|
} else return r(void 0, a);
|
|
1267
1358
|
}
|
|
1268
|
-
function
|
|
1359
|
+
function i(c, a, d) {
|
|
1269
1360
|
if (d in t)
|
|
1270
|
-
return r(
|
|
1361
|
+
return r(c, a);
|
|
1271
1362
|
if (d in e)
|
|
1272
|
-
return r(void 0,
|
|
1363
|
+
return r(void 0, c);
|
|
1273
1364
|
}
|
|
1274
|
-
const
|
|
1365
|
+
const u = {
|
|
1275
1366
|
url: s,
|
|
1276
1367
|
method: s,
|
|
1277
1368
|
data: s,
|
|
1278
|
-
baseURL:
|
|
1279
|
-
transformRequest:
|
|
1280
|
-
transformResponse:
|
|
1281
|
-
paramsSerializer:
|
|
1282
|
-
timeout:
|
|
1283
|
-
timeoutMessage:
|
|
1284
|
-
withCredentials:
|
|
1285
|
-
withXSRFToken:
|
|
1286
|
-
adapter:
|
|
1287
|
-
responseType:
|
|
1288
|
-
xsrfCookieName:
|
|
1289
|
-
xsrfHeaderName:
|
|
1290
|
-
onUploadProgress:
|
|
1291
|
-
onDownloadProgress:
|
|
1292
|
-
decompress:
|
|
1293
|
-
maxContentLength:
|
|
1294
|
-
maxBodyLength:
|
|
1295
|
-
beforeRedirect:
|
|
1296
|
-
transport:
|
|
1297
|
-
httpAgent:
|
|
1298
|
-
httpsAgent:
|
|
1299
|
-
cancelToken:
|
|
1300
|
-
socketPath:
|
|
1301
|
-
responseEncoding:
|
|
1302
|
-
validateStatus:
|
|
1303
|
-
headers: (
|
|
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,
|
|
1394
|
+
headers: (c, a, d) => o(headersToObject(c), headersToObject(a), d, !0)
|
|
1304
1395
|
};
|
|
1305
1396
|
return utils$1.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
|
|
1306
|
-
const d =
|
|
1307
|
-
utils$1.isUndefined(f) && d !==
|
|
1397
|
+
const d = u[a] || o, f = d(e[a], t[a], a);
|
|
1398
|
+
utils$1.isUndefined(f) && d !== i || (n[a] = f);
|
|
1308
1399
|
}), n;
|
|
1309
1400
|
}
|
|
1310
1401
|
const resolveConfig = (e) => {
|
|
1311
1402
|
const t = mergeConfig$1({}, e);
|
|
1312
|
-
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers:
|
|
1313
|
-
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(
|
|
1314
1405
|
"Authorization",
|
|
1315
|
-
"Basic " + btoa((
|
|
1406
|
+
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
1316
1407
|
);
|
|
1317
|
-
let
|
|
1408
|
+
let u;
|
|
1318
1409
|
if (utils$1.isFormData(n)) {
|
|
1319
1410
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1320
|
-
|
|
1321
|
-
else if ((
|
|
1322
|
-
const [
|
|
1323
|
-
|
|
1411
|
+
l.setContentType(void 0);
|
|
1412
|
+
else if ((u = l.getContentType()) !== !1) {
|
|
1413
|
+
const [c, ...a] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1414
|
+
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1324
1415
|
}
|
|
1325
1416
|
}
|
|
1326
1417
|
if (platform.hasStandardBrowserEnv && (r && utils$1.isFunction(r) && (r = r(t)), r || r !== !1 && isURLSameOrigin(t.url))) {
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1418
|
+
const c = o && s && cookies.read(s);
|
|
1419
|
+
c && l.set(o, c);
|
|
1329
1420
|
}
|
|
1330
1421
|
return t;
|
|
1331
1422
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1332
1423
|
return new Promise(function(n, r) {
|
|
1333
1424
|
const o = resolveConfig(e);
|
|
1334
1425
|
let s = o.data;
|
|
1335
|
-
const
|
|
1336
|
-
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;
|
|
1337
1428
|
function y() {
|
|
1338
1429
|
h && h(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(a), o.signal && o.signal.removeEventListener("abort", a);
|
|
1339
1430
|
}
|
|
1340
1431
|
let m = new XMLHttpRequest();
|
|
1341
1432
|
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
|
|
1342
|
-
function
|
|
1433
|
+
function x() {
|
|
1343
1434
|
if (!m)
|
|
1344
1435
|
return;
|
|
1345
|
-
const
|
|
1436
|
+
const v = AxiosHeaders$1.from(
|
|
1346
1437
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1347
1438
|
), k = {
|
|
1348
|
-
data: !
|
|
1439
|
+
data: !i || i === "text" || i === "json" ? m.responseText : m.response,
|
|
1349
1440
|
status: m.status,
|
|
1350
1441
|
statusText: m.statusText,
|
|
1351
|
-
headers:
|
|
1442
|
+
headers: v,
|
|
1352
1443
|
config: e,
|
|
1353
1444
|
request: m
|
|
1354
1445
|
};
|
|
@@ -1358,8 +1449,8 @@ const resolveConfig = (e) => {
|
|
|
1358
1449
|
r(g), y();
|
|
1359
1450
|
}, k), m = null;
|
|
1360
1451
|
}
|
|
1361
|
-
"onloadend" in m ? m.onloadend =
|
|
1362
|
-
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1452
|
+
"onloadend" in m ? m.onloadend = x : m.onreadystatechange = function() {
|
|
1453
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1363
1454
|
}, m.onabort = function() {
|
|
1364
1455
|
m && (r(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, m)), m = null);
|
|
1365
1456
|
}, m.onerror = function() {
|
|
@@ -1373,14 +1464,14 @@ const resolveConfig = (e) => {
|
|
|
1373
1464
|
e,
|
|
1374
1465
|
m
|
|
1375
1466
|
)), m = null;
|
|
1376
|
-
}, s === void 0 &&
|
|
1467
|
+
}, s === void 0 && l.setContentType(null), "setRequestHeader" in m && utils$1.forEach(l.toJSON(), function(_, k) {
|
|
1377
1468
|
m.setRequestHeader(k, _);
|
|
1378
|
-
}), utils$1.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials),
|
|
1379
|
-
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);
|
|
1380
1471
|
}, o.cancelToken && o.cancelToken.subscribe(a), o.signal && (o.signal.aborted ? a() : o.signal.addEventListener("abort", a)));
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
r(new AxiosError$1("Unsupported protocol " +
|
|
1472
|
+
const $ = parseProtocol(o.url);
|
|
1473
|
+
if ($ && platform.protocols.indexOf($) === -1) {
|
|
1474
|
+
r(new AxiosError$1("Unsupported protocol " + $ + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
1384
1475
|
return;
|
|
1385
1476
|
}
|
|
1386
1477
|
m.send(s || null);
|
|
@@ -1389,24 +1480,24 @@ const resolveConfig = (e) => {
|
|
|
1389
1480
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1390
1481
|
if (t || n) {
|
|
1391
1482
|
let r = new AbortController(), o;
|
|
1392
|
-
const s = function(
|
|
1483
|
+
const s = function(c) {
|
|
1393
1484
|
if (!o) {
|
|
1394
|
-
o = !0,
|
|
1395
|
-
const a =
|
|
1485
|
+
o = !0, i();
|
|
1486
|
+
const a = c instanceof Error ? c : this.reason;
|
|
1396
1487
|
r.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
1397
1488
|
}
|
|
1398
1489
|
};
|
|
1399
|
-
let
|
|
1400
|
-
|
|
1490
|
+
let l = t && setTimeout(() => {
|
|
1491
|
+
l = null, s(new AxiosError$1(`timeout ${t} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
1401
1492
|
}, t);
|
|
1402
|
-
const
|
|
1403
|
-
e && (
|
|
1404
|
-
|
|
1493
|
+
const i = () => {
|
|
1494
|
+
e && (l && clearTimeout(l), l = null, e.forEach((c) => {
|
|
1495
|
+
c.unsubscribe ? c.unsubscribe(s) : c.removeEventListener("abort", s);
|
|
1405
1496
|
}), e = null);
|
|
1406
1497
|
};
|
|
1407
|
-
e.forEach((
|
|
1408
|
-
const { signal:
|
|
1409
|
-
return
|
|
1498
|
+
e.forEach((c) => c.addEventListener("abort", s));
|
|
1499
|
+
const { signal: u } = r;
|
|
1500
|
+
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
1410
1501
|
}
|
|
1411
1502
|
}, streamChunk = function* (e, t) {
|
|
1412
1503
|
let n = e.byteLength;
|
|
@@ -1438,15 +1529,15 @@ const resolveConfig = (e) => {
|
|
|
1438
1529
|
}
|
|
1439
1530
|
}, trackStream = (e, t, n, r) => {
|
|
1440
1531
|
const o = readBytes(e, t);
|
|
1441
|
-
let s = 0,
|
|
1442
|
-
|
|
1532
|
+
let s = 0, l, i = (u) => {
|
|
1533
|
+
l || (l = !0, r && r(u));
|
|
1443
1534
|
};
|
|
1444
1535
|
return new ReadableStream({
|
|
1445
|
-
async pull(
|
|
1536
|
+
async pull(u) {
|
|
1446
1537
|
try {
|
|
1447
|
-
const { done:
|
|
1448
|
-
if (
|
|
1449
|
-
|
|
1538
|
+
const { done: c, value: a } = await o.next();
|
|
1539
|
+
if (c) {
|
|
1540
|
+
i(), u.close();
|
|
1450
1541
|
return;
|
|
1451
1542
|
}
|
|
1452
1543
|
let d = a.byteLength;
|
|
@@ -1454,13 +1545,13 @@ const resolveConfig = (e) => {
|
|
|
1454
1545
|
let f = s += d;
|
|
1455
1546
|
n(f);
|
|
1456
1547
|
}
|
|
1457
|
-
|
|
1458
|
-
} catch (
|
|
1459
|
-
throw
|
|
1548
|
+
u.enqueue(new Uint8Array(a));
|
|
1549
|
+
} catch (c) {
|
|
1550
|
+
throw i(c), c;
|
|
1460
1551
|
}
|
|
1461
1552
|
},
|
|
1462
|
-
cancel(
|
|
1463
|
-
return
|
|
1553
|
+
cancel(u) {
|
|
1554
|
+
return i(u), o.return();
|
|
1464
1555
|
}
|
|
1465
1556
|
}, {
|
|
1466
1557
|
highWaterMark: 2
|
|
@@ -1515,37 +1606,37 @@ const getBodyLength = async (e) => {
|
|
|
1515
1606
|
data: r,
|
|
1516
1607
|
signal: o,
|
|
1517
1608
|
cancelToken: s,
|
|
1518
|
-
timeout:
|
|
1519
|
-
onDownloadProgress:
|
|
1520
|
-
onUploadProgress:
|
|
1521
|
-
responseType:
|
|
1609
|
+
timeout: l,
|
|
1610
|
+
onDownloadProgress: i,
|
|
1611
|
+
onUploadProgress: u,
|
|
1612
|
+
responseType: c,
|
|
1522
1613
|
headers: a,
|
|
1523
1614
|
withCredentials: d = "same-origin",
|
|
1524
1615
|
fetchOptions: f
|
|
1525
1616
|
} = resolveConfig(e);
|
|
1526
|
-
|
|
1527
|
-
let h = composeSignals([o, s && s.toAbortSignal()],
|
|
1617
|
+
c = c ? (c + "").toLowerCase() : "text";
|
|
1618
|
+
let h = composeSignals([o, s && s.toAbortSignal()], l), p;
|
|
1528
1619
|
const y = h && h.unsubscribe && (() => {
|
|
1529
1620
|
h.unsubscribe();
|
|
1530
1621
|
});
|
|
1531
1622
|
let m;
|
|
1532
1623
|
try {
|
|
1533
|
-
if (
|
|
1624
|
+
if (u && supportsRequestStream && n !== "get" && n !== "head" && (m = await resolveBodyLength(a, r)) !== 0) {
|
|
1534
1625
|
let k = new Request(t, {
|
|
1535
1626
|
method: "POST",
|
|
1536
1627
|
body: r,
|
|
1537
1628
|
duplex: "half"
|
|
1538
1629
|
}), b;
|
|
1539
1630
|
if (utils$1.isFormData(r) && (b = k.headers.get("content-type")) && a.setContentType(b), k.body) {
|
|
1540
|
-
const [g,
|
|
1631
|
+
const [g, w] = progressEventDecorator(
|
|
1541
1632
|
m,
|
|
1542
|
-
progressEventReducer(asyncDecorator(
|
|
1633
|
+
progressEventReducer(asyncDecorator(u))
|
|
1543
1634
|
);
|
|
1544
|
-
r = trackStream(k.body, DEFAULT_CHUNK_SIZE, g,
|
|
1635
|
+
r = trackStream(k.body, DEFAULT_CHUNK_SIZE, g, w);
|
|
1545
1636
|
}
|
|
1546
1637
|
}
|
|
1547
1638
|
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
1548
|
-
const
|
|
1639
|
+
const x = "credentials" in Request.prototype;
|
|
1549
1640
|
p = new Request(t, {
|
|
1550
1641
|
...f,
|
|
1551
1642
|
signal: h,
|
|
@@ -1553,45 +1644,45 @@ const getBodyLength = async (e) => {
|
|
|
1553
1644
|
headers: a.normalize().toJSON(),
|
|
1554
1645
|
body: r,
|
|
1555
1646
|
duplex: "half",
|
|
1556
|
-
credentials:
|
|
1647
|
+
credentials: x ? d : void 0
|
|
1557
1648
|
});
|
|
1558
|
-
let
|
|
1559
|
-
const
|
|
1560
|
-
if (supportsResponseStream && (
|
|
1649
|
+
let $ = await fetch(p, f);
|
|
1650
|
+
const v = supportsResponseStream && (c === "stream" || c === "response");
|
|
1651
|
+
if (supportsResponseStream && (i || v && y)) {
|
|
1561
1652
|
const k = {};
|
|
1562
1653
|
["status", "statusText", "headers"].forEach((E) => {
|
|
1563
|
-
k[E] =
|
|
1654
|
+
k[E] = $[E];
|
|
1564
1655
|
});
|
|
1565
|
-
const b = utils$1.toFiniteNumber(
|
|
1656
|
+
const b = utils$1.toFiniteNumber($.headers.get("content-length")), [g, w] = i && progressEventDecorator(
|
|
1566
1657
|
b,
|
|
1567
|
-
progressEventReducer(asyncDecorator(
|
|
1658
|
+
progressEventReducer(asyncDecorator(i), !0)
|
|
1568
1659
|
) || [];
|
|
1569
|
-
|
|
1570
|
-
trackStream(
|
|
1571
|
-
|
|
1660
|
+
$ = new Response(
|
|
1661
|
+
trackStream($.body, DEFAULT_CHUNK_SIZE, g, () => {
|
|
1662
|
+
w && w(), y && y();
|
|
1572
1663
|
}),
|
|
1573
1664
|
k
|
|
1574
1665
|
);
|
|
1575
1666
|
}
|
|
1576
|
-
|
|
1577
|
-
let _ = await resolvers[utils$1.findKey(resolvers,
|
|
1578
|
-
return !
|
|
1667
|
+
c = c || "text";
|
|
1668
|
+
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"]($, e);
|
|
1669
|
+
return !v && y && y(), await new Promise((k, b) => {
|
|
1579
1670
|
settle(k, b, {
|
|
1580
1671
|
data: _,
|
|
1581
|
-
headers: AxiosHeaders$1.from(
|
|
1582
|
-
status:
|
|
1583
|
-
statusText:
|
|
1672
|
+
headers: AxiosHeaders$1.from($.headers),
|
|
1673
|
+
status: $.status,
|
|
1674
|
+
statusText: $.statusText,
|
|
1584
1675
|
config: e,
|
|
1585
1676
|
request: p
|
|
1586
1677
|
});
|
|
1587
1678
|
});
|
|
1588
|
-
} catch (
|
|
1589
|
-
throw y && y(),
|
|
1679
|
+
} catch (x) {
|
|
1680
|
+
throw y && y(), x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message) ? Object.assign(
|
|
1590
1681
|
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, p),
|
|
1591
1682
|
{
|
|
1592
|
-
cause:
|
|
1683
|
+
cause: x.cause || x
|
|
1593
1684
|
}
|
|
1594
|
-
) : AxiosError$1.from(
|
|
1685
|
+
) : AxiosError$1.from(x, x && x.code, e, p);
|
|
1595
1686
|
}
|
|
1596
1687
|
}), knownAdapters = {
|
|
1597
1688
|
http: httpAdapter,
|
|
@@ -1615,22 +1706,22 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
1615
1706
|
const o = {};
|
|
1616
1707
|
for (let s = 0; s < t; s++) {
|
|
1617
1708
|
n = e[s];
|
|
1618
|
-
let
|
|
1619
|
-
if (r = n, !isResolvedHandle(n) && (r = knownAdapters[(
|
|
1620
|
-
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}'`);
|
|
1621
1712
|
if (r)
|
|
1622
1713
|
break;
|
|
1623
|
-
o[
|
|
1714
|
+
o[l || "#" + s] = r;
|
|
1624
1715
|
}
|
|
1625
1716
|
if (!r) {
|
|
1626
1717
|
const s = Object.entries(o).map(
|
|
1627
|
-
([
|
|
1718
|
+
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1628
1719
|
);
|
|
1629
|
-
let
|
|
1720
|
+
let l = t ? s.length > 1 ? `since :
|
|
1630
1721
|
` + s.map(renderReason).join(`
|
|
1631
1722
|
`) : " " + renderReason(s[0]) : "as no adapter specified";
|
|
1632
1723
|
throw new AxiosError$1(
|
|
1633
|
-
"There is no suitable adapter to dispatch the request " +
|
|
1724
|
+
"There is no suitable adapter to dispatch the request " + l,
|
|
1634
1725
|
"ERR_NOT_SUPPORT"
|
|
1635
1726
|
);
|
|
1636
1727
|
}
|
|
@@ -1668,21 +1759,21 @@ const VERSION$1 = "1.10.0", validators$1 = {};
|
|
|
1668
1759
|
});
|
|
1669
1760
|
const deprecatedWarnings = {};
|
|
1670
1761
|
validators$1.transitional = function(t, n, r) {
|
|
1671
|
-
function o(s,
|
|
1672
|
-
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 : "");
|
|
1673
1764
|
}
|
|
1674
|
-
return (s,
|
|
1765
|
+
return (s, l, i) => {
|
|
1675
1766
|
if (t === !1)
|
|
1676
1767
|
throw new AxiosError$1(
|
|
1677
|
-
o(
|
|
1768
|
+
o(l, " has been removed" + (n ? " in " + n : "")),
|
|
1678
1769
|
AxiosError$1.ERR_DEPRECATED
|
|
1679
1770
|
);
|
|
1680
|
-
return n && !deprecatedWarnings[
|
|
1771
|
+
return n && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
1681
1772
|
o(
|
|
1682
|
-
|
|
1773
|
+
l,
|
|
1683
1774
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1684
1775
|
)
|
|
1685
|
-
)), t ? t(s,
|
|
1776
|
+
)), t ? t(s, l, i) : !0;
|
|
1686
1777
|
};
|
|
1687
1778
|
};
|
|
1688
1779
|
validators$1.spelling = function(t) {
|
|
@@ -1694,11 +1785,11 @@ function assertOptions(e, t, n) {
|
|
|
1694
1785
|
const r = Object.keys(e);
|
|
1695
1786
|
let o = r.length;
|
|
1696
1787
|
for (; o-- > 0; ) {
|
|
1697
|
-
const s = r[o],
|
|
1698
|
-
if (
|
|
1699
|
-
const
|
|
1700
|
-
if (
|
|
1701
|
-
throw new AxiosError$1("option " + s + " must be " +
|
|
1788
|
+
const s = r[o], l = t[s];
|
|
1789
|
+
if (l) {
|
|
1790
|
+
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
1791
|
+
if (u !== !0)
|
|
1792
|
+
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
1702
1793
|
continue;
|
|
1703
1794
|
}
|
|
1704
1795
|
if (n !== !0)
|
|
@@ -1757,7 +1848,7 @@ let Axios$1 = class {
|
|
|
1757
1848
|
baseUrl: validators.spelling("baseURL"),
|
|
1758
1849
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
1759
1850
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1760
|
-
let
|
|
1851
|
+
let l = s && utils$1.merge(
|
|
1761
1852
|
s.common,
|
|
1762
1853
|
s[n.method]
|
|
1763
1854
|
);
|
|
@@ -1766,27 +1857,27 @@ let Axios$1 = class {
|
|
|
1766
1857
|
(p) => {
|
|
1767
1858
|
delete s[p];
|
|
1768
1859
|
}
|
|
1769
|
-
), n.headers = AxiosHeaders$1.concat(
|
|
1770
|
-
const
|
|
1771
|
-
let
|
|
1860
|
+
), n.headers = AxiosHeaders$1.concat(l, s);
|
|
1861
|
+
const i = [];
|
|
1862
|
+
let u = !0;
|
|
1772
1863
|
this.interceptors.request.forEach(function(y) {
|
|
1773
|
-
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (
|
|
1864
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (u = u && y.synchronous, i.unshift(y.fulfilled, y.rejected));
|
|
1774
1865
|
});
|
|
1775
|
-
const
|
|
1866
|
+
const c = [];
|
|
1776
1867
|
this.interceptors.response.forEach(function(y) {
|
|
1777
|
-
|
|
1868
|
+
c.push(y.fulfilled, y.rejected);
|
|
1778
1869
|
});
|
|
1779
1870
|
let a, d = 0, f;
|
|
1780
|
-
if (!
|
|
1871
|
+
if (!u) {
|
|
1781
1872
|
const p = [dispatchRequest.bind(this), void 0];
|
|
1782
|
-
for (p.unshift.apply(p,
|
|
1873
|
+
for (p.unshift.apply(p, i), p.push.apply(p, c), f = p.length, a = Promise.resolve(n); d < f; )
|
|
1783
1874
|
a = a.then(p[d++], p[d++]);
|
|
1784
1875
|
return a;
|
|
1785
1876
|
}
|
|
1786
|
-
f =
|
|
1877
|
+
f = i.length;
|
|
1787
1878
|
let h = n;
|
|
1788
1879
|
for (d = 0; d < f; ) {
|
|
1789
|
-
const p =
|
|
1880
|
+
const p = i[d++], y = i[d++];
|
|
1790
1881
|
try {
|
|
1791
1882
|
h = p(h);
|
|
1792
1883
|
} catch (m) {
|
|
@@ -1799,8 +1890,8 @@ let Axios$1 = class {
|
|
|
1799
1890
|
} catch (p) {
|
|
1800
1891
|
return Promise.reject(p);
|
|
1801
1892
|
}
|
|
1802
|
-
for (d = 0, f =
|
|
1803
|
-
a = a.then(
|
|
1893
|
+
for (d = 0, f = c.length; d < f; )
|
|
1894
|
+
a = a.then(c[d++], c[d++]);
|
|
1804
1895
|
return a;
|
|
1805
1896
|
}
|
|
1806
1897
|
getUri(t) {
|
|
@@ -1820,14 +1911,14 @@ utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1820
1911
|
});
|
|
1821
1912
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
1822
1913
|
function n(r) {
|
|
1823
|
-
return function(s,
|
|
1824
|
-
return this.request(mergeConfig$1(
|
|
1914
|
+
return function(s, l, i) {
|
|
1915
|
+
return this.request(mergeConfig$1(i || {}, {
|
|
1825
1916
|
method: t,
|
|
1826
1917
|
headers: r ? {
|
|
1827
1918
|
"Content-Type": "multipart/form-data"
|
|
1828
1919
|
} : {},
|
|
1829
1920
|
url: s,
|
|
1830
|
-
data:
|
|
1921
|
+
data: l
|
|
1831
1922
|
}));
|
|
1832
1923
|
};
|
|
1833
1924
|
}
|
|
@@ -1850,14 +1941,14 @@ let CancelToken$1 = class C {
|
|
|
1850
1941
|
r._listeners = null;
|
|
1851
1942
|
}), this.promise.then = (o) => {
|
|
1852
1943
|
let s;
|
|
1853
|
-
const
|
|
1854
|
-
r.subscribe(
|
|
1944
|
+
const l = new Promise((i) => {
|
|
1945
|
+
r.subscribe(i), s = i;
|
|
1855
1946
|
}).then(o);
|
|
1856
|
-
return
|
|
1947
|
+
return l.cancel = function() {
|
|
1857
1948
|
r.unsubscribe(s);
|
|
1858
|
-
},
|
|
1859
|
-
}, t(function(s,
|
|
1860
|
-
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));
|
|
1861
1952
|
});
|
|
1862
1953
|
}
|
|
1863
1954
|
/**
|
|
@@ -2030,7 +2121,7 @@ const {
|
|
|
2030
2121
|
for (const [r, o] of t)
|
|
2031
2122
|
n[r] = o;
|
|
2032
2123
|
return n;
|
|
2033
|
-
}, _sfc_main$
|
|
2124
|
+
}, _sfc_main$p = {}, _hoisted_1$l = {
|
|
2034
2125
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2035
2126
|
viewBox: "0 0 24 24",
|
|
2036
2127
|
fill: "none",
|
|
@@ -2041,618 +2132,103 @@ const {
|
|
|
2041
2132
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
2042
2133
|
};
|
|
2043
2134
|
function _sfc_render$b(e, t) {
|
|
2044
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$m, t[0] || (t[0] = [
|
|
2045
|
-
createElementVNode("path", {
|
|
2046
|
-
stroke: "none",
|
|
2047
|
-
d: "M0 0h24v24H0z",
|
|
2048
|
-
fill: "none"
|
|
2049
|
-
}, null, -1),
|
|
2050
|
-
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
2051
|
-
]));
|
|
2052
|
-
}
|
|
2053
|
-
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$b]]), _sfc_main$p = {}, _hoisted_1$l = {
|
|
2054
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2055
|
-
viewBox: "0 0 24 24",
|
|
2056
|
-
fill: "none",
|
|
2057
|
-
stroke: "currentColor",
|
|
2058
|
-
"stroke-width": "2",
|
|
2059
|
-
"stroke-linecap": "round",
|
|
2060
|
-
"stroke-linejoin": "round",
|
|
2061
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
2062
|
-
};
|
|
2063
|
-
function _sfc_render$a(e, t) {
|
|
2064
2135
|
return openBlock(), createElementBlock("svg", _hoisted_1$l, t[0] || (t[0] = [
|
|
2065
2136
|
createElementVNode("path", {
|
|
2066
2137
|
stroke: "none",
|
|
2067
2138
|
d: "M0 0h24v24H0z",
|
|
2068
2139
|
fill: "none"
|
|
2069
2140
|
}, null, -1),
|
|
2070
|
-
createElementVNode("path", { d: "
|
|
2071
|
-
]));
|
|
2072
|
-
}
|
|
2073
|
-
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$a]]), _sfc_main$o = {}, _hoisted_1$k = {
|
|
2074
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2075
|
-
viewBox: "0 0 24 24",
|
|
2076
|
-
fill: "none",
|
|
2077
|
-
stroke: "currentColor",
|
|
2078
|
-
"stroke-width": "2",
|
|
2079
|
-
"stroke-linecap": "round",
|
|
2080
|
-
"stroke-linejoin": "round"
|
|
2081
|
-
};
|
|
2082
|
-
function _sfc_render$9(e, t) {
|
|
2083
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$k, t[0] || (t[0] = [
|
|
2084
|
-
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
2085
|
-
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
2086
|
-
]));
|
|
2087
|
-
}
|
|
2088
|
-
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$9]]), _sfc_main$n = {}, _hoisted_1$j = {
|
|
2089
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2090
|
-
viewBox: "0 0 24 24",
|
|
2091
|
-
fill: "none",
|
|
2092
|
-
stroke: "currentColor",
|
|
2093
|
-
"stroke-width": "2",
|
|
2094
|
-
"stroke-linecap": "round",
|
|
2095
|
-
"stroke-linejoin": "round",
|
|
2096
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
2097
|
-
};
|
|
2098
|
-
function _sfc_render$8(e, t) {
|
|
2099
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$j, t[0] || (t[0] = [
|
|
2100
|
-
createElementVNode("path", {
|
|
2101
|
-
stroke: "none",
|
|
2102
|
-
d: "M0 0h24v24H0z",
|
|
2103
|
-
fill: "none"
|
|
2104
|
-
}, null, -1),
|
|
2105
|
-
createElementVNode("path", { d: "M18 6l-12 12" }, null, -1),
|
|
2106
|
-
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
2141
|
+
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
2107
2142
|
]));
|
|
2108
2143
|
}
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
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
|
+
]));
|
|
2148
2190
|
}
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
prefix: { default: "api" },
|
|
2158
|
-
host: { default: "" },
|
|
2159
|
-
data: { default: null },
|
|
2160
|
-
options: { default: () => [] },
|
|
2161
|
-
maxHeight: { default: 400 },
|
|
2162
|
-
slots: { default: null },
|
|
2163
|
-
customClass: { default: "" },
|
|
2164
|
-
style: { default: () => ({}) },
|
|
2165
|
-
disabled: { type: Boolean }
|
|
2166
|
-
}, {
|
|
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: "" },
|
|
2167
2199
|
modelValue: {
|
|
2168
|
-
type: [
|
|
2169
|
-
default:
|
|
2200
|
+
type: [Array, String, Boolean],
|
|
2201
|
+
default: ""
|
|
2170
2202
|
},
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
...u.value?.filter((b) => b?.id !== c.value?.id)
|
|
2178
|
-
].filter((b) => b !== null) : []), h = async () => {
|
|
2179
|
-
try {
|
|
2180
|
-
const { data: b } = await axios.get(
|
|
2181
|
-
`${t.host}/${t.prefix}/suggest/${t.data}?json=1`
|
|
2182
|
-
);
|
|
2183
|
-
return b.data;
|
|
2184
|
-
} catch {
|
|
2185
|
-
return [];
|
|
2186
|
-
}
|
|
2187
|
-
}, p = async (b) => {
|
|
2188
|
-
document.body.click(), l.value = b !== void 0 ? b : !l.value, l.value && !u.value?.length && (!t.options?.length && t.data ? u.value = await h() : t.options?.length && (u.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;
|
|
2189
|
-
}, y = () => l.value ? p(!1) : null, m = (b) => {
|
|
2190
|
-
c.value = b, r.value = b.id, p(!1);
|
|
2191
|
-
}, $ = (b, g) => {
|
|
2192
|
-
if (!b || !g) return;
|
|
2193
|
-
const v = b.offsetTop, E = v + b.offsetHeight, S = g.scrollTop, B = S + g.clientHeight;
|
|
2194
|
-
v < S ? g.scrollTop = v - 80 : E > B && (g.scrollTop = E - g.clientHeight + 4);
|
|
2195
|
-
}, w = (b) => {
|
|
2196
|
-
if (!l.value) return;
|
|
2197
|
-
const { keyCode: g } = b;
|
|
2198
|
-
if ([38, 40, 13].includes(g) && b.preventDefault(), g == 38) {
|
|
2199
|
-
if (a.value == 0) return;
|
|
2200
|
-
a.value -= 1, $(d.value[a.value], i.value);
|
|
2201
|
-
} else if (g == 40) {
|
|
2202
|
-
if (a.value + 1 >= f.value?.length) return;
|
|
2203
|
-
a.value += 1, $(d.value[a.value], i.value);
|
|
2204
|
-
} else if (g == 13) {
|
|
2205
|
-
const v = f.value[a.value];
|
|
2206
|
-
v && m(v);
|
|
2207
|
-
}
|
|
2208
|
-
}, x = async (b) => {
|
|
2209
|
-
if (l.value) return;
|
|
2210
|
-
const { keyCode: g } = b;
|
|
2211
|
-
[38, 40].includes(g) && (await b.preventDefault(), a.value = 0, setTimeout(() => p()));
|
|
2212
|
-
}, _ = (b) => {
|
|
2213
|
-
l.value && s.value && i.value && !i.value.contains(b.target) && (l.value = !1);
|
|
2214
|
-
}, k = (b) => {
|
|
2215
|
-
b?.key === "Escape" && l.value && p(!1);
|
|
2216
|
-
};
|
|
2217
|
-
return onMounted(async () => {
|
|
2218
|
-
addEventListener("click", y), addEventListener("keydown", w), addEventListener("scroll", _, !0), addEventListener("keydown", k), r.value && !t.options?.length && t.data && (u.value = await h(), c.value = u.value?.find((b) => b?.id === r.value) || null);
|
|
2219
|
-
}), onUnmounted(() => {
|
|
2220
|
-
removeEventListener("click", y), removeEventListener("keydown", w), removeEventListener("scroll", _, !0), removeEventListener("keydown", k);
|
|
2221
|
-
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
2222
|
-
class: "relative w-full",
|
|
2223
|
-
ref_key: "select",
|
|
2224
|
-
ref: s,
|
|
2225
|
-
onClick: g[3] || (g[3] = withModifiers(() => {
|
|
2226
|
-
}, ["stop"]))
|
|
2227
|
-
}, [
|
|
2228
|
-
createElementVNode("button", {
|
|
2229
|
-
type: "button",
|
|
2230
|
-
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] pr-[60px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
2231
|
-
l.value ? `ring-rind ring-2 ring-${b.style?.primaryColor || "blue"}-500` : "",
|
|
2232
|
-
unref(n),
|
|
2233
|
-
b.customClass
|
|
2234
|
-
]]),
|
|
2235
|
-
onKeydown: x,
|
|
2236
|
-
onClick: g[0] || (g[0] = (v) => p(!l.value)),
|
|
2237
|
-
disabled: b.disabled,
|
|
2238
|
-
style: {
|
|
2239
|
-
border: "1px solid #e0e0e0"
|
|
2240
|
-
}
|
|
2241
|
-
}, [
|
|
2242
|
-
c.value?.color ? (openBlock(), createElementBlock("span", {
|
|
2243
|
-
key: 0,
|
|
2244
|
-
class: "w-[16px] h-[16px] rounded-md block",
|
|
2245
|
-
style: normalizeStyle({ backgroundColor: c.value?.color })
|
|
2246
|
-
}, null, 4)) : createCommentVNode("", !0),
|
|
2247
|
-
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2$5, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(b.placeholder), 1))
|
|
2248
|
-
], 42, _hoisted_1$i),
|
|
2249
|
-
createElementVNode("span", _hoisted_4$2, [
|
|
2250
|
-
createVNode(unref(IconChevronTopBottom), {
|
|
2251
|
-
height: "14",
|
|
2252
|
-
width: "14"
|
|
2253
|
-
})
|
|
2254
|
-
]),
|
|
2255
|
-
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
2256
|
-
key: 0,
|
|
2257
|
-
type: "button",
|
|
2258
|
-
onClick: g[1] || (g[1] = (v) => {
|
|
2259
|
-
r.value = null, c.value = null;
|
|
2260
|
-
}),
|
|
2261
|
-
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
2262
|
-
}, [
|
|
2263
|
-
createVNode(unref(IconClose), {
|
|
2264
|
-
height: "14",
|
|
2265
|
-
width: "14"
|
|
2266
|
-
})
|
|
2267
|
-
])) : createCommentVNode("", !0),
|
|
2268
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
2269
|
-
withDirectives(createElementVNode("ul", {
|
|
2270
|
-
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",
|
|
2271
|
-
ref_key: "list",
|
|
2272
|
-
ref: i,
|
|
2273
|
-
style: normalizeStyle({
|
|
2274
|
-
width: o.value.width,
|
|
2275
|
-
maxHeight: b.maxHeight + "px",
|
|
2276
|
-
backgroundColor: "white"
|
|
2277
|
-
}),
|
|
2278
|
-
onClick: g[2] || (g[2] = withModifiers(() => {
|
|
2279
|
-
}, ["stop"]))
|
|
2280
|
-
}, [
|
|
2281
|
-
f.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2282
|
-
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)),
|
|
2283
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (v, E) => (openBlock(), createElementBlock("li", {
|
|
2284
|
-
onClick: (S) => m(v),
|
|
2285
|
-
key: v?.id,
|
|
2286
|
-
ref_for: !0,
|
|
2287
|
-
ref: (S) => d.value[E] = S,
|
|
2288
|
-
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-800 hover:bg-gray-100 rounded-lg", [a.value == E ? "bg-gray-100" : ""]])
|
|
2289
|
-
}, [
|
|
2290
|
-
createElementVNode("span", _hoisted_6, [
|
|
2291
|
-
v?.color ? (openBlock(), createElementBlock("span", {
|
|
2292
|
-
key: 0,
|
|
2293
|
-
class: "w-[16px] h-[16px] rounded-md block",
|
|
2294
|
-
style: normalizeStyle({ backgroundColor: v?.color })
|
|
2295
|
-
}, null, 4)) : createCommentVNode("", !0),
|
|
2296
|
-
createTextVNode(" " + toDisplayString(v?.text), 1)
|
|
2297
|
-
]),
|
|
2298
|
-
r.value == v?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
2299
|
-
key: 0,
|
|
2300
|
-
height: "14",
|
|
2301
|
-
width: "14",
|
|
2302
|
-
"stroke-width": "2",
|
|
2303
|
-
class: "absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"
|
|
2304
|
-
})) : createCommentVNode("", !0)
|
|
2305
|
-
], 10, _hoisted_5))), 128))
|
|
2306
|
-
], 64)) : (openBlock(), createElementBlock("li", _hoisted_7, "Дані відсутні"))
|
|
2307
|
-
], 4), [
|
|
2308
|
-
[vShow, l.value]
|
|
2309
|
-
])
|
|
2310
|
-
]))
|
|
2311
|
-
], 512));
|
|
2312
|
-
}
|
|
2313
|
-
}), _hoisted_1$h = ["disabled"], _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2314
|
-
__name: "vs-input-switcher",
|
|
2315
|
-
props: /* @__PURE__ */ mergeModels({
|
|
2316
|
-
style: {
|
|
2317
|
-
type: Object,
|
|
2318
|
-
default: () => ({})
|
|
2319
|
-
},
|
|
2320
|
-
disabled: {
|
|
2321
|
-
type: Boolean,
|
|
2322
|
-
default: !1
|
|
2323
|
-
},
|
|
2324
|
-
customClass: {
|
|
2325
|
-
type: String,
|
|
2326
|
-
default: ""
|
|
2327
|
-
}
|
|
2328
|
-
}, {
|
|
2329
|
-
modelValue: { type: Boolean, default: !1 },
|
|
2330
|
-
modelModifiers: {}
|
|
2331
|
-
}),
|
|
2332
|
-
emits: ["update:modelValue"],
|
|
2333
|
-
setup(e) {
|
|
2334
|
-
const t = useModel(e, "modelValue");
|
|
2335
|
-
return (n, r) => (openBlock(), createElementBlock("button", {
|
|
2336
|
-
type: "button",
|
|
2337
|
-
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]]),
|
|
2338
|
-
disabled: e.disabled,
|
|
2339
|
-
onClick: r[0] || (r[0] = (o) => t.value = !t.value)
|
|
2340
|
-
}, [
|
|
2341
|
-
createElementVNode("span", {
|
|
2342
|
-
"data-state": "checked",
|
|
2343
|
-
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"]])
|
|
2344
|
-
}, null, 2)
|
|
2345
|
-
], 10, _hoisted_1$h));
|
|
2346
|
-
}
|
|
2347
|
-
}), _hoisted_1$g = ["innerHTML"], _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2348
|
-
__name: "vs-input-static",
|
|
2349
|
-
props: {
|
|
2350
|
-
html: {
|
|
2351
|
-
type: String,
|
|
2352
|
-
default: ""
|
|
2353
|
-
},
|
|
2354
|
-
customClass: {
|
|
2355
|
-
type: String,
|
|
2356
|
-
default: ""
|
|
2357
|
-
}
|
|
2358
|
-
},
|
|
2359
|
-
setup(e) {
|
|
2360
|
-
return (t, n) => (openBlock(), createElementBlock("div", {
|
|
2361
|
-
class: normalizeClass(e.customClass),
|
|
2362
|
-
innerHTML: e.html
|
|
2363
|
-
}, null, 10, _hoisted_1$g));
|
|
2364
|
-
}
|
|
2365
|
-
}), _hoisted_1$f = { class: "flex items-center justify-between" }, _hoisted_2$4 = { class: "grid gap-3" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2366
|
-
__name: "vs-container-switcher",
|
|
2367
|
-
props: {
|
|
2368
|
-
title: {
|
|
2369
|
-
type: String,
|
|
2370
|
-
default: ""
|
|
2371
|
-
},
|
|
2372
|
-
style: {
|
|
2373
|
-
type: Object,
|
|
2374
|
-
default: () => ({})
|
|
2375
|
-
},
|
|
2376
|
-
isOpen: {
|
|
2377
|
-
type: Boolean,
|
|
2378
|
-
default: !1
|
|
2379
|
-
}
|
|
2380
|
-
},
|
|
2381
|
-
setup(e) {
|
|
2382
|
-
const t = e, n = ref(t.isOpen);
|
|
2383
|
-
return watch(
|
|
2384
|
-
() => t.isOpen,
|
|
2385
|
-
(r) => {
|
|
2386
|
-
n.value = r;
|
|
2387
|
-
}
|
|
2388
|
-
), (r, o) => (openBlock(), createElementBlock("div", null, [
|
|
2389
|
-
createElementVNode("div", _hoisted_1$f, [
|
|
2390
|
-
createElementVNode("p", null, toDisplayString(e.title), 1),
|
|
2391
|
-
createVNode(_sfc_main$l, {
|
|
2392
|
-
modelValue: n.value,
|
|
2393
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) => n.value = s),
|
|
2394
|
-
style: normalizeStyle(e.style)
|
|
2395
|
-
}, null, 8, ["modelValue", "style"])
|
|
2396
|
-
]),
|
|
2397
|
-
createVNode(Transition, { name: "slide-fade" }, {
|
|
2398
|
-
default: withCtx(() => [
|
|
2399
|
-
withDirectives(createElementVNode("div", _hoisted_2$4, [
|
|
2400
|
-
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2401
|
-
], 512), [
|
|
2402
|
-
[vShow, n.value]
|
|
2403
|
-
])
|
|
2404
|
-
]),
|
|
2405
|
-
_: 3
|
|
2406
|
-
})
|
|
2407
|
-
]));
|
|
2408
|
-
}
|
|
2409
|
-
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-34f848b8"]]), _hoisted_1$e = { class: "grid gap-3" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2410
|
-
__name: "vs-container-accordion",
|
|
2411
|
-
props: {
|
|
2412
|
-
title: {
|
|
2413
|
-
type: String,
|
|
2414
|
-
default: ""
|
|
2415
|
-
},
|
|
2416
|
-
style: {
|
|
2417
|
-
type: Object,
|
|
2418
|
-
default: () => ({})
|
|
2419
|
-
},
|
|
2420
|
-
isOpen: {
|
|
2421
|
-
type: Boolean,
|
|
2422
|
-
default: !1
|
|
2423
|
-
}
|
|
2424
|
-
},
|
|
2425
|
-
setup(e) {
|
|
2426
|
-
const t = e, n = ref(t.isOpen);
|
|
2427
|
-
return watch(
|
|
2428
|
-
() => t.isOpen,
|
|
2429
|
-
(r) => {
|
|
2430
|
-
n.value = r;
|
|
2431
|
-
}
|
|
2432
|
-
), (r, o) => (openBlock(), createElementBlock("div", null, [
|
|
2433
|
-
createElementVNode("button", {
|
|
2434
|
-
type: "button",
|
|
2435
|
-
onClick: o[0] || (o[0] = (s) => n.value = !n.value),
|
|
2436
|
-
class: "flex items-center gap-2"
|
|
2437
|
-
}, [
|
|
2438
|
-
createVNode(unref(IconChevronDown), {
|
|
2439
|
-
class: normalizeClass(["h-4 w-4 duration-300", [n.value ? "-rotate-180" : ""]])
|
|
2440
|
-
}, null, 8, ["class"]),
|
|
2441
|
-
createElementVNode("span", null, toDisplayString(e.title), 1)
|
|
2442
|
-
]),
|
|
2443
|
-
createVNode(Transition, { name: "slide-fade" }, {
|
|
2444
|
-
default: withCtx(() => [
|
|
2445
|
-
withDirectives(createElementVNode("div", _hoisted_1$e, [
|
|
2446
|
-
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2447
|
-
], 512), [
|
|
2448
|
-
[vShow, n.value]
|
|
2449
|
-
])
|
|
2450
|
-
]),
|
|
2451
|
-
_: 3
|
|
2452
|
-
})
|
|
2453
|
-
]));
|
|
2454
|
-
}
|
|
2455
|
-
}), VsContainerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-896e4c89"]]), _hoisted_1$d = { class: "flex items-center justify-between" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
2456
|
-
__name: "vs-container-default",
|
|
2457
|
-
props: {
|
|
2458
|
-
title: {
|
|
2459
|
-
type: String,
|
|
2460
|
-
default: ""
|
|
2461
|
-
},
|
|
2462
|
-
style: {
|
|
2463
|
-
type: Object,
|
|
2464
|
-
default: () => ({})
|
|
2465
|
-
}
|
|
2466
|
-
},
|
|
2467
|
-
setup(e) {
|
|
2468
|
-
return (t, n) => (openBlock(), createElementBlock("div", null, [
|
|
2469
|
-
createElementVNode("div", _hoisted_1$d, [
|
|
2470
|
-
createElementVNode("p", null, toDisplayString(e.title), 1)
|
|
2471
|
-
]),
|
|
2472
|
-
renderSlot(t.$slots, "default")
|
|
2473
|
-
]));
|
|
2474
|
-
}
|
|
2475
|
-
}), views = {
|
|
2476
|
-
switcher: VsContainerSwitcher,
|
|
2477
|
-
accordion: VsContainerAccordion,
|
|
2478
|
-
default: _sfc_main$h
|
|
2479
|
-
}, FormConditionsTypes = {
|
|
2480
|
-
Equal: "==",
|
|
2481
|
-
Inequal: "!=",
|
|
2482
|
-
Higer: ">",
|
|
2483
|
-
HigerOrEqual: ">=",
|
|
2484
|
-
Lower: "<",
|
|
2485
|
-
LowerOrEqual: "<=",
|
|
2486
|
-
Between: "between",
|
|
2487
|
-
StartWith: "^",
|
|
2488
|
-
EndWith: "$",
|
|
2489
|
-
Contain: "*",
|
|
2490
|
-
In: "in",
|
|
2491
|
-
NotIn: "not_in"
|
|
2492
|
-
}, 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) => {
|
|
2493
|
-
if (!t) return !0;
|
|
2494
|
-
switch (t?.[1]) {
|
|
2495
|
-
case FormConditionsTypes.Equal:
|
|
2496
|
-
return checkEqual(e, t?.[2]);
|
|
2497
|
-
case FormConditionsTypes.Inequal:
|
|
2498
|
-
return checkInequal(e, t?.[2]);
|
|
2499
|
-
case FormConditionsTypes.Higer:
|
|
2500
|
-
return checkHigher(e, t?.[2]);
|
|
2501
|
-
case FormConditionsTypes.HigerOrEqual:
|
|
2502
|
-
return checkHigherOrEqual(e, t?.[2]);
|
|
2503
|
-
case FormConditionsTypes.Lower:
|
|
2504
|
-
return checkLower(e, t?.[2]);
|
|
2505
|
-
case FormConditionsTypes.LowerOrEqual:
|
|
2506
|
-
return checkLowerOrEqual(e, t?.[2]);
|
|
2507
|
-
case FormConditionsTypes.Between:
|
|
2508
|
-
return checkBetween(e, t?.[2]);
|
|
2509
|
-
case FormConditionsTypes.StartWith:
|
|
2510
|
-
return checkStartWith(e, t?.[2]);
|
|
2511
|
-
case FormConditionsTypes.EndWith:
|
|
2512
|
-
return checkEndWith(e, t?.[2]);
|
|
2513
|
-
case FormConditionsTypes.Contain:
|
|
2514
|
-
return checkContain(e, t?.[2]);
|
|
2515
|
-
case FormConditionsTypes.In:
|
|
2516
|
-
return checkIn(e, t?.[2]);
|
|
2517
|
-
case FormConditionsTypes.NotIn:
|
|
2518
|
-
return checkNotIn(e, t?.[2]);
|
|
2519
|
-
default:
|
|
2520
|
-
return !0;
|
|
2521
|
-
}
|
|
2522
|
-
}, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2523
|
-
__name: "vs-input-container",
|
|
2524
|
-
props: {
|
|
2525
|
-
style: {
|
|
2526
|
-
type: Object,
|
|
2527
|
-
default: () => ({})
|
|
2528
|
-
},
|
|
2529
|
-
title: {
|
|
2530
|
-
type: String,
|
|
2531
|
-
default: ""
|
|
2532
|
-
},
|
|
2533
|
-
view: {
|
|
2534
|
-
type: String,
|
|
2535
|
-
default: "default"
|
|
2536
|
-
},
|
|
2537
|
-
schema: {
|
|
2538
|
-
type: Array,
|
|
2539
|
-
default: () => []
|
|
2540
|
-
}
|
|
2541
|
-
},
|
|
2542
|
-
setup(e) {
|
|
2543
|
-
const t = e, n = inject("formValues", { default: {} }), r = inject("form"), o = computed(() => t.schema?.filter((i) => {
|
|
2544
|
-
const l = i?.conditions;
|
|
2545
|
-
if (!l) return !0;
|
|
2546
|
-
const c = Array.isArray(l) ? l[0] : l, u = n?.value?.[c];
|
|
2547
|
-
return isVisible(u, l);
|
|
2548
|
-
})), s = computed(() => views[t.view]);
|
|
2549
|
-
return (i, l) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
2550
|
-
key: 0,
|
|
2551
|
-
title: e.title,
|
|
2552
|
-
style: normalizeStyle(e.style)
|
|
2553
|
-
}, {
|
|
2554
|
-
default: withCtx(() => [
|
|
2555
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (c) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
2556
|
-
key: c.name
|
|
2557
|
-
}, { ref_for: !0 }, c, {
|
|
2558
|
-
item: c,
|
|
2559
|
-
modelValue: unref(n)[c.name],
|
|
2560
|
-
"onUpdate:modelValue": (u) => unref(n)[c.name] = u,
|
|
2561
|
-
style: e.style,
|
|
2562
|
-
error: unref(r)?.errors?.[c.name]
|
|
2563
|
-
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
2564
|
-
]),
|
|
2565
|
-
_: 1
|
|
2566
|
-
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
2567
|
-
}
|
|
2568
|
-
}), _hoisted_1$c = { class: "flex items-center gap-[4px]" }, _hoisted_2$3 = ["value", "id", "disabled"], _hoisted_3$1 = ["for"], _hoisted_4$1 = { class: "text-[13px] text-gray-500 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
2569
|
-
__name: "vs-checkbox-default",
|
|
2570
|
-
props: {
|
|
2571
|
-
value: { type: [String, Number], default: "" },
|
|
2572
|
-
label: { type: [String, Number], default: "" },
|
|
2573
|
-
disabled: { type: Boolean, default: !1 },
|
|
2574
|
-
id: { type: [String, Number] },
|
|
2575
|
-
modelValue: Boolean,
|
|
2576
|
-
info: { type: String, default: () => "" }
|
|
2577
|
-
},
|
|
2578
|
-
emits: ["update:modelValue"],
|
|
2579
|
-
setup(e, { emit: t }) {
|
|
2580
|
-
const n = t, r = e, o = computed({
|
|
2581
|
-
get: () => r.modelValue,
|
|
2582
|
-
set: (s) => n("update:modelValue", s)
|
|
2583
|
-
});
|
|
2584
|
-
return (s, i) => (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2585
|
-
withDirectives(createElementVNode("input", {
|
|
2586
|
-
type: "checkbox",
|
|
2587
|
-
value: e.value,
|
|
2588
|
-
"onUpdate:modelValue": i[0] || (i[0] = (l) => o.value = l),
|
|
2589
|
-
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 }]),
|
|
2590
|
-
id: e.id,
|
|
2591
|
-
disabled: e.disabled
|
|
2592
|
-
}, null, 10, _hoisted_2$3), [
|
|
2593
|
-
[vModelCheckbox, o.value]
|
|
2594
|
-
]),
|
|
2595
|
-
createElementVNode("label", {
|
|
2596
|
-
for: e.id,
|
|
2597
|
-
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 }])
|
|
2598
|
-
}, [
|
|
2599
|
-
createElementVNode("div", {
|
|
2600
|
-
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [o.value ? "bg-blue-600" : "bg-white"]])
|
|
2601
|
-
}, [
|
|
2602
|
-
createVNode(IconCheck, {
|
|
2603
|
-
height: "12",
|
|
2604
|
-
width: "12"
|
|
2605
|
-
})
|
|
2606
|
-
], 2),
|
|
2607
|
-
createElementVNode("span", _hoisted_4$1, [
|
|
2608
|
-
renderSlot(s.$slots, "default", {}, () => [
|
|
2609
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2610
|
-
])
|
|
2611
|
-
])
|
|
2612
|
-
], 10, _hoisted_3$1)
|
|
2613
|
-
]));
|
|
2614
|
-
}
|
|
2615
|
-
}), _hoisted_1$b = ["name", "value", "disabled"], _hoisted_2$2 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3 = {
|
|
2616
|
-
key: 0,
|
|
2617
|
-
class: "text-[16px]"
|
|
2618
|
-
}, _hoisted_4 = ["src"], _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2619
|
-
__name: "vs-checkbox-buttons",
|
|
2620
|
-
props: {
|
|
2621
|
-
value: { type: [String, Number, Boolean], default: "" },
|
|
2622
|
-
label: { type: [String, Number], default: "" },
|
|
2623
|
-
modelValue: {
|
|
2624
|
-
type: [Array, String, Boolean],
|
|
2625
|
-
default: ""
|
|
2626
|
-
},
|
|
2627
|
-
disabled: { type: Boolean, default: !1 },
|
|
2628
|
-
id: { type: [String, Number] },
|
|
2629
|
-
icon: { type: String },
|
|
2630
|
-
imgUrl: { type: String },
|
|
2631
|
-
style: { type: Object, default: () => null }
|
|
2632
|
-
},
|
|
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
|
+
},
|
|
2633
2209
|
emits: ["update:modelValue"],
|
|
2634
2210
|
setup(e, { emit: t }) {
|
|
2635
2211
|
const n = e, r = t, o = computed({
|
|
2636
2212
|
get: () => n.modelValue,
|
|
2637
|
-
set: (
|
|
2638
|
-
r("update:modelValue",
|
|
2213
|
+
set: (i) => {
|
|
2214
|
+
r("update:modelValue", i);
|
|
2639
2215
|
}
|
|
2640
|
-
}), s = computed(() => Array.isArray(o.value) ? o.value.includes(n.value) : o.value === !0 || o.value === n.value),
|
|
2641
|
-
return (
|
|
2642
|
-
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", [
|
|
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"]])
|
|
2643
2219
|
}, [
|
|
2644
2220
|
withDirectives(createElementVNode("input", {
|
|
2645
2221
|
type: "checkbox",
|
|
2646
2222
|
class: "hidden",
|
|
2647
2223
|
name: e.id,
|
|
2648
2224
|
value: e.value,
|
|
2649
|
-
"onUpdate:modelValue":
|
|
2225
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
2650
2226
|
disabled: e.disabled
|
|
2651
|
-
}, null, 8, _hoisted_1$
|
|
2227
|
+
}, null, 8, _hoisted_1$j), [
|
|
2652
2228
|
[vModelCheckbox, o.value]
|
|
2653
2229
|
]),
|
|
2654
|
-
createElementVNode("span", _hoisted_2$
|
|
2655
|
-
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3, [
|
|
2230
|
+
createElementVNode("span", _hoisted_2$5, [
|
|
2231
|
+
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
2656
2232
|
e.icon ? (openBlock(), createElementBlock("i", {
|
|
2657
2233
|
key: 0,
|
|
2658
2234
|
class: normalizeClass(e.icon)
|
|
@@ -2663,18 +2239,18 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2663
2239
|
width: "16",
|
|
2664
2240
|
height: "16",
|
|
2665
2241
|
alt: "icon"
|
|
2666
|
-
}, null, 8, _hoisted_4)) : createCommentVNode("", !0)
|
|
2242
|
+
}, null, 8, _hoisted_4$1)) : createCommentVNode("", !0)
|
|
2667
2243
|
])) : createCommentVNode("", !0),
|
|
2668
|
-
renderSlot(
|
|
2244
|
+
renderSlot(i.$slots, "default", {}, () => [
|
|
2669
2245
|
createTextVNode(toDisplayString(e.label), 1)
|
|
2670
2246
|
])
|
|
2671
2247
|
])
|
|
2672
2248
|
], 2));
|
|
2673
2249
|
}
|
|
2674
2250
|
}), VsCheckboxViews = {
|
|
2675
|
-
"vs-checkbox-default": _sfc_main$
|
|
2676
|
-
"vs-checkbox-buttons": _sfc_main$
|
|
2677
|
-
}, _hoisted_1$
|
|
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({
|
|
2678
2254
|
__name: "vs-input-checkbox-item",
|
|
2679
2255
|
props: {
|
|
2680
2256
|
value: { type: [String, Number], default: "" },
|
|
@@ -2695,22 +2271,22 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2695
2271
|
setup(e, { emit: t }) {
|
|
2696
2272
|
const n = e, r = t, o = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
2697
2273
|
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
2698
|
-
set: (
|
|
2274
|
+
set: (i) => {
|
|
2699
2275
|
if (Array.isArray(n.modelValue)) {
|
|
2700
|
-
let
|
|
2701
|
-
|
|
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);
|
|
2702
2278
|
} else
|
|
2703
|
-
r("update:modelValue",
|
|
2279
|
+
r("update:modelValue", i);
|
|
2704
2280
|
}
|
|
2705
|
-
}),
|
|
2706
|
-
return (
|
|
2707
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[
|
|
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]), {
|
|
2708
2284
|
value: e.value,
|
|
2709
2285
|
label: e.label,
|
|
2710
2286
|
info: e.option?.info,
|
|
2711
2287
|
disabled: e.disabled,
|
|
2712
2288
|
modelValue: s.value,
|
|
2713
|
-
"onUpdate:modelValue":
|
|
2289
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
2714
2290
|
id: o,
|
|
2715
2291
|
icon: e.icon,
|
|
2716
2292
|
imgUrl: e.imgUrl,
|
|
@@ -2723,7 +2299,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2723
2299
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style"]))
|
|
2724
2300
|
]));
|
|
2725
2301
|
}
|
|
2726
|
-
}), _sfc_main$
|
|
2302
|
+
}), _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
2727
2303
|
__name: "vs-input-checkbox",
|
|
2728
2304
|
props: {
|
|
2729
2305
|
options: {
|
|
@@ -2743,7 +2319,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2743
2319
|
},
|
|
2744
2320
|
emits: ["update:modelValue"],
|
|
2745
2321
|
setup(e, { emit: t }) {
|
|
2746
|
-
const n = e, r = t, o = ref([]), s = reactive({}),
|
|
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 () => {
|
|
2747
2323
|
try {
|
|
2748
2324
|
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2749
2325
|
o.value = a?.data || a;
|
|
@@ -2755,13 +2331,13 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2755
2331
|
() => n.modelValue,
|
|
2756
2332
|
(a) => {
|
|
2757
2333
|
if (typeof a == "boolean" && o.value.length === 1) {
|
|
2758
|
-
const d =
|
|
2334
|
+
const d = l(o.value[0]);
|
|
2759
2335
|
s[d] = a;
|
|
2760
2336
|
} else if (Array.isArray(a)) {
|
|
2761
2337
|
const d = new Set(a);
|
|
2762
2338
|
o.value.forEach((f) => {
|
|
2763
2339
|
if (!f.disabled) {
|
|
2764
|
-
const h =
|
|
2340
|
+
const h = l(f);
|
|
2765
2341
|
s[h] = d.has(h);
|
|
2766
2342
|
}
|
|
2767
2343
|
});
|
|
@@ -2781,28 +2357,28 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2781
2357
|
{ deep: !0 }
|
|
2782
2358
|
), onMounted(() => {
|
|
2783
2359
|
if (n.data)
|
|
2784
|
-
|
|
2360
|
+
c().then(() => {
|
|
2785
2361
|
if (typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2786
|
-
const a =
|
|
2362
|
+
const a = l(o.value[0]);
|
|
2787
2363
|
s[a] = n.modelValue;
|
|
2788
2364
|
} else if (Array.isArray(n.modelValue)) {
|
|
2789
2365
|
const a = new Set(n.modelValue);
|
|
2790
2366
|
o.value.forEach((d) => {
|
|
2791
2367
|
if (!d.disabled) {
|
|
2792
|
-
const f =
|
|
2368
|
+
const f = l(d);
|
|
2793
2369
|
s[f] = a.has(f);
|
|
2794
2370
|
}
|
|
2795
2371
|
});
|
|
2796
2372
|
}
|
|
2797
2373
|
});
|
|
2798
2374
|
else if (o.value = n.options, typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2799
|
-
const a =
|
|
2375
|
+
const a = l(o.value[0]);
|
|
2800
2376
|
s[a] = n.modelValue;
|
|
2801
2377
|
} else if (Array.isArray(n.modelValue)) {
|
|
2802
2378
|
const a = new Set(n.modelValue);
|
|
2803
2379
|
o.value.forEach((d) => {
|
|
2804
2380
|
if (!d.disabled) {
|
|
2805
|
-
const f =
|
|
2381
|
+
const f = l(d);
|
|
2806
2382
|
s[f] = a.has(f);
|
|
2807
2383
|
}
|
|
2808
2384
|
});
|
|
@@ -2810,14 +2386,14 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2810
2386
|
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2811
2387
|
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2812
2388
|
}, [
|
|
2813
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (f) => (openBlock(), createBlock(_sfc_main$
|
|
2814
|
-
modelValue: s[
|
|
2815
|
-
"onUpdate:modelValue": (h) => s[
|
|
2816
|
-
value:
|
|
2817
|
-
class: normalizeClass(
|
|
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)),
|
|
2818
2394
|
disabled: f.disabled,
|
|
2819
|
-
label:
|
|
2820
|
-
key:
|
|
2395
|
+
label: i(f),
|
|
2396
|
+
key: l(f),
|
|
2821
2397
|
icon: f?.icon,
|
|
2822
2398
|
imgUrl: f?.imgUrl,
|
|
2823
2399
|
option: f,
|
|
@@ -2826,7 +2402,46 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2826
2402
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
2827
2403
|
], 2));
|
|
2828
2404
|
}
|
|
2829
|
-
}), VsInputCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
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({
|
|
2408
|
+
style: {
|
|
2409
|
+
type: Object,
|
|
2410
|
+
default: () => ({})
|
|
2411
|
+
},
|
|
2412
|
+
customClass: {
|
|
2413
|
+
type: String,
|
|
2414
|
+
default: ""
|
|
2415
|
+
},
|
|
2416
|
+
placeholder: {
|
|
2417
|
+
type: String,
|
|
2418
|
+
default: ""
|
|
2419
|
+
},
|
|
2420
|
+
disabled: {
|
|
2421
|
+
type: Boolean,
|
|
2422
|
+
default: !1
|
|
2423
|
+
}
|
|
2424
|
+
}, {
|
|
2425
|
+
modelValue: { default: "" },
|
|
2426
|
+
modelModifiers: {}
|
|
2427
|
+
}),
|
|
2428
|
+
emits: ["update:modelValue"],
|
|
2429
|
+
setup(e) {
|
|
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
|
+
]);
|
|
2443
|
+
}
|
|
2444
|
+
}), fileUpload = async (e, t, n, r) => {
|
|
2830
2445
|
try {
|
|
2831
2446
|
const o = new FormData();
|
|
2832
2447
|
o.append("unique", "true"), o.append("file", e);
|
|
@@ -2856,7 +2471,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2856
2471
|
} catch (t) {
|
|
2857
2472
|
console.error(t.message);
|
|
2858
2473
|
}
|
|
2859
|
-
}, _sfc_main$
|
|
2474
|
+
}, _sfc_main$j = {}, _hoisted_1$g = {
|
|
2860
2475
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2861
2476
|
width: "24",
|
|
2862
2477
|
height: "24",
|
|
@@ -2867,13 +2482,13 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2867
2482
|
"stroke-linecap": "round",
|
|
2868
2483
|
"stroke-linejoin": "round"
|
|
2869
2484
|
};
|
|
2870
|
-
function _sfc_render$
|
|
2871
|
-
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] = [
|
|
2872
2487
|
createElementVNode("path", { d: "M5 12h14" }, null, -1),
|
|
2873
2488
|
createElementVNode("path", { d: "M12 5v14" }, null, -1)
|
|
2874
2489
|
]));
|
|
2875
2490
|
}
|
|
2876
|
-
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 = {
|
|
2877
2492
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2878
2493
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
2879
2494
|
width: "44",
|
|
@@ -2885,12 +2500,12 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_rende
|
|
|
2885
2500
|
"stroke-linecap": "round",
|
|
2886
2501
|
"stroke-linejoin": "round"
|
|
2887
2502
|
};
|
|
2888
|
-
function _sfc_render$
|
|
2889
|
-
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] = [
|
|
2890
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)
|
|
2891
2506
|
]));
|
|
2892
2507
|
}
|
|
2893
|
-
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 = {
|
|
2894
2509
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2895
2510
|
class: "icon icon-tabler icon-tabler-table",
|
|
2896
2511
|
width: "44",
|
|
@@ -2902,8 +2517,8 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render
|
|
|
2902
2517
|
"stroke-linecap": "round",
|
|
2903
2518
|
"stroke-linejoin": "round"
|
|
2904
2519
|
};
|
|
2905
|
-
function _sfc_render$
|
|
2906
|
-
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] = [
|
|
2907
2522
|
createElementVNode("path", {
|
|
2908
2523
|
stroke: "none",
|
|
2909
2524
|
d: "M0 0h24v24H0z",
|
|
@@ -2930,7 +2545,7 @@ function _sfc_render$5(e, t, n, r, o, s) {
|
|
|
2930
2545
|
}, null, -1)
|
|
2931
2546
|
]));
|
|
2932
2547
|
}
|
|
2933
|
-
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 = {
|
|
2934
2549
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2935
2550
|
width: "24",
|
|
2936
2551
|
height: "24",
|
|
@@ -2942,12 +2557,12 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render
|
|
|
2942
2557
|
"stroke-linejoin": "round",
|
|
2943
2558
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2944
2559
|
};
|
|
2945
|
-
function _sfc_render$
|
|
2946
|
-
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] = [
|
|
2947
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)
|
|
2948
2563
|
]));
|
|
2949
2564
|
}
|
|
2950
|
-
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 = {
|
|
2951
2566
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2952
2567
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
2953
2568
|
width: "44",
|
|
@@ -2959,12 +2574,12 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rende
|
|
|
2959
2574
|
"stroke-linecap": "round",
|
|
2960
2575
|
"stroke-linejoin": "round"
|
|
2961
2576
|
};
|
|
2962
|
-
function _sfc_render$
|
|
2963
|
-
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] = [
|
|
2964
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)
|
|
2965
2580
|
]));
|
|
2966
2581
|
}
|
|
2967
|
-
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 = {
|
|
2968
2583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2969
2584
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
2970
2585
|
width: "44",
|
|
@@ -2976,12 +2591,12 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render
|
|
|
2976
2591
|
"stroke-linecap": "round",
|
|
2977
2592
|
"stroke-linejoin": "round"
|
|
2978
2593
|
};
|
|
2979
|
-
function _sfc_render$
|
|
2980
|
-
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] = [
|
|
2981
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)
|
|
2982
2597
|
]));
|
|
2983
2598
|
}
|
|
2984
|
-
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2599
|
+
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$5]]), getFileType = (e) => {
|
|
2985
2600
|
if (!e) return "";
|
|
2986
2601
|
const t = e?.split(".");
|
|
2987
2602
|
return t[t.length - 1];
|
|
@@ -2994,7 +2609,7 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_re
|
|
|
2994
2609
|
documentsFormat: ["pdf"]
|
|
2995
2610
|
};
|
|
2996
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;
|
|
2997
|
-
}, _sfc_main$
|
|
2612
|
+
}, _sfc_main$d = {}, _hoisted_1$a = {
|
|
2998
2613
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2999
2614
|
width: "24",
|
|
3000
2615
|
height: "24",
|
|
@@ -3006,12 +2621,12 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_re
|
|
|
3006
2621
|
"stroke-linejoin": "round",
|
|
3007
2622
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
3008
2623
|
};
|
|
3009
|
-
function _sfc_render$
|
|
3010
|
-
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] = [
|
|
3011
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)
|
|
3012
2627
|
]));
|
|
3013
2628
|
}
|
|
3014
|
-
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 = {
|
|
3015
2630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3016
2631
|
width: "24",
|
|
3017
2632
|
height: "24",
|
|
@@ -3023,8 +2638,8 @@ const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_ren
|
|
|
3023
2638
|
"stroke-linejoin": "round",
|
|
3024
2639
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
3025
2640
|
};
|
|
3026
|
-
function _sfc_render(e, t) {
|
|
3027
|
-
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] = [
|
|
3028
2643
|
createElementVNode("path", {
|
|
3029
2644
|
stroke: "none",
|
|
3030
2645
|
d: "M0 0h24v24H0z",
|
|
@@ -3035,7 +2650,7 @@ function _sfc_render(e, t) {
|
|
|
3035
2650
|
createElementVNode("path", { d: "M12 4l0 12" }, null, -1)
|
|
3036
2651
|
]));
|
|
3037
2652
|
}
|
|
3038
|
-
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({
|
|
3039
2654
|
__name: "vs-input-file-list-item",
|
|
3040
2655
|
props: /* @__PURE__ */ mergeModels({
|
|
3041
2656
|
multiple: { type: Boolean }
|
|
@@ -3048,18 +2663,18 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3048
2663
|
emits: ["update:value", "update:item"],
|
|
3049
2664
|
setup(e) {
|
|
3050
2665
|
const t = useModel(e, "value"), n = useModel(e, "item"), r = e;
|
|
3051
|
-
return (o, s) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2666
|
+
return (o, s) => (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
3052
2667
|
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(n.value)), {
|
|
3053
2668
|
src: n.value,
|
|
3054
2669
|
alt: "file",
|
|
3055
2670
|
class: "w-full h-full object-cover cursor-pointer",
|
|
3056
|
-
onClick: s[0] || (s[0] = (
|
|
2671
|
+
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(n.value))
|
|
3057
2672
|
}, null, 8, ["src"])),
|
|
3058
|
-
createElementVNode("div", _hoisted_2$
|
|
2673
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
3059
2674
|
createElementVNode("button", {
|
|
3060
2675
|
type: "button",
|
|
3061
|
-
onClick: s[1] || (s[1] = (
|
|
3062
|
-
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) : "";
|
|
3063
2678
|
}),
|
|
3064
2679
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
3065
2680
|
}, [
|
|
@@ -3067,7 +2682,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3067
2682
|
]),
|
|
3068
2683
|
createElementVNode("button", {
|
|
3069
2684
|
type: "button",
|
|
3070
|
-
onClick: s[2] || (s[2] = (
|
|
2685
|
+
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(n.value)),
|
|
3071
2686
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
3072
2687
|
}, [
|
|
3073
2688
|
createVNode(IconDownload, { class: "w-4 h-4" })
|
|
@@ -3075,86 +2690,551 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3075
2690
|
])
|
|
3076
2691
|
]));
|
|
3077
2692
|
}
|
|
3078
|
-
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3079
|
-
key: 1,
|
|
3080
|
-
class: "flex items-center flex-wrap gap-2"
|
|
3081
|
-
}, _sfc_main$
|
|
3082
|
-
__name: "vs-input-file",
|
|
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 = {
|
|
2694
|
+
key: 1,
|
|
2695
|
+
class: "flex items-center flex-wrap gap-2"
|
|
2696
|
+
}, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2697
|
+
__name: "vs-input-file",
|
|
2698
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2699
|
+
multiple: { type: Boolean },
|
|
2700
|
+
format: {},
|
|
2701
|
+
disabled: { type: Boolean }
|
|
2702
|
+
}, {
|
|
2703
|
+
modelValue: {},
|
|
2704
|
+
modelModifiers: {}
|
|
2705
|
+
}),
|
|
2706
|
+
emits: ["update:modelValue"],
|
|
2707
|
+
setup(e) {
|
|
2708
|
+
const t = e, n = useModel(e, "modelValue"), r = ref(null), o = (l) => Array.isArray(n.value) && n.value[l] || "", s = async (l) => {
|
|
2709
|
+
if (t.format) {
|
|
2710
|
+
const c = l.target.files?.[0];
|
|
2711
|
+
if (!c || !c.name.endsWith(t.format))
|
|
2712
|
+
return;
|
|
2713
|
+
}
|
|
2714
|
+
const i = l.target.files?.[0];
|
|
2715
|
+
if (!i) return;
|
|
2716
|
+
const u = await fileUpload(i, "1", "form", "table");
|
|
2717
|
+
n.value = t.multiple ? [...n.value || [], u.result?.file_path] : u.result?.file_path;
|
|
2718
|
+
};
|
|
2719
|
+
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2720
|
+
createElementVNode("input", {
|
|
2721
|
+
class: "hidden",
|
|
2722
|
+
ref_key: "fileInput",
|
|
2723
|
+
ref: r,
|
|
2724
|
+
type: "file",
|
|
2725
|
+
onChange: s
|
|
2726
|
+
}, null, 544),
|
|
2727
|
+
!l.multiple && n.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
2728
|
+
key: 0,
|
|
2729
|
+
item: n.value,
|
|
2730
|
+
"onUpdate:item": i[0] || (i[0] = (u) => n.value = u),
|
|
2731
|
+
value: n.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, [
|
|
2734
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (u, c) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
2735
|
+
multiple: l.multiple,
|
|
2736
|
+
key: c,
|
|
2737
|
+
value: n.value,
|
|
2738
|
+
"onUpdate:value": i[2] || (i[2] = (a) => n.value = a),
|
|
2739
|
+
item: o(c)
|
|
2740
|
+
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
2741
|
+
createElementVNode("div", {
|
|
2742
|
+
onClick: i[3] || (i[3] = (u) => !l.disabled && r.value?.click()),
|
|
2743
|
+
class: normalizeClass([
|
|
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",
|
|
2745
|
+
l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
2746
|
+
])
|
|
2747
|
+
}, [
|
|
2748
|
+
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
2749
|
+
], 2)
|
|
2750
|
+
])) : createCommentVNode("", !0),
|
|
2751
|
+
l.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
2752
|
+
key: 2,
|
|
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"])
|
|
2755
|
+
}, [
|
|
2756
|
+
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
2757
|
+
], 2))
|
|
2758
|
+
]));
|
|
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",
|
|
3083
3065
|
props: /* @__PURE__ */ mergeModels({
|
|
3084
|
-
|
|
3085
|
-
|
|
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: () => ({}) },
|
|
3086
3075
|
disabled: { type: Boolean }
|
|
3087
3076
|
}, {
|
|
3088
|
-
modelValue: {
|
|
3077
|
+
modelValue: {
|
|
3078
|
+
type: [Number, String],
|
|
3079
|
+
default: null
|
|
3080
|
+
},
|
|
3089
3081
|
modelModifiers: {}
|
|
3090
3082
|
}),
|
|
3091
3083
|
emits: ["update:modelValue"],
|
|
3092
3084
|
setup(e) {
|
|
3093
|
-
const t = e, n = useModel(e, "modelValue"),
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
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);
|
|
3098
3117
|
}
|
|
3099
|
-
|
|
3100
|
-
if (
|
|
3101
|
-
const
|
|
3102
|
-
|
|
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);
|
|
3103
3126
|
};
|
|
3104
|
-
return (
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
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", {
|
|
3113
3167
|
key: 0,
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (c, u) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
3120
|
-
multiple: i.multiple,
|
|
3121
|
-
key: u,
|
|
3122
|
-
value: n.value,
|
|
3123
|
-
"onUpdate:value": l[2] || (l[2] = (a) => n.value = a),
|
|
3124
|
-
item: o(u)
|
|
3125
|
-
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3126
|
-
createElementVNode("div", {
|
|
3127
|
-
onClick: l[3] || (l[3] = (c) => !i.disabled && r.value?.click()),
|
|
3128
|
-
class: normalizeClass([
|
|
3129
|
-
"h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center transition-all duration-300",
|
|
3130
|
-
i.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
3131
|
-
])
|
|
3132
|
-
}, [
|
|
3133
|
-
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
3134
|
-
], 2)
|
|
3135
|
-
])) : createCommentVNode("", !0),
|
|
3136
|
-
i.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
3137
|
-
key: 2,
|
|
3138
|
-
onClick: l[4] || (l[4] = (c) => r.value?.click()),
|
|
3139
|
-
class: normalizeClass([i.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"])
|
|
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]"
|
|
3140
3173
|
}, [
|
|
3141
|
-
createVNode(
|
|
3142
|
-
|
|
3143
|
-
|
|
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));
|
|
3144
3223
|
}
|
|
3145
3224
|
}), inputs = {
|
|
3146
|
-
VsInputText: _sfc_main$
|
|
3147
|
-
VsInputRadio: _sfc_main$
|
|
3148
|
-
"vs-input-text": _sfc_main$
|
|
3149
|
-
"vs-input-
|
|
3150
|
-
"vs-input-
|
|
3151
|
-
"vs-input-
|
|
3152
|
-
"vs-input-
|
|
3153
|
-
"vs-input-
|
|
3154
|
-
"vs-input-
|
|
3155
|
-
|
|
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,
|
|
3156
3236
|
"vs-input-checkbox": VsInputCheckbox,
|
|
3157
|
-
"vs-input-file": _sfc_main$
|
|
3237
|
+
"vs-input-file": _sfc_main$a
|
|
3158
3238
|
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3159
3239
|
__name: "vs-compact-form-layout",
|
|
3160
3240
|
props: {
|
|
@@ -3206,74 +3286,90 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3206
3286
|
default:
|
|
3207
3287
|
return !1;
|
|
3208
3288
|
}
|
|
3289
|
+
}, mathTable = {
|
|
3290
|
+
autocomplete: "select",
|
|
3291
|
+
combobox: "select",
|
|
3292
|
+
email: "text",
|
|
3293
|
+
textarea: "text",
|
|
3294
|
+
datepicker: "date",
|
|
3295
|
+
markedtext: "text"
|
|
3296
|
+
// mask: 'text',
|
|
3209
3297
|
};
|
|
3298
|
+
function convertType(e) {
|
|
3299
|
+
const t = e.toLowerCase();
|
|
3300
|
+
return mathTable[t] || t;
|
|
3301
|
+
}
|
|
3302
|
+
function convertSchema(e) {
|
|
3303
|
+
if (Array.isArray(e)) return e;
|
|
3304
|
+
const t = [];
|
|
3305
|
+
return Object.entries(e).forEach((n) => {
|
|
3306
|
+
const r = { name: n[0], ...n[1], type: convertType(n[1].type), label: n[1].label || n[1].ua };
|
|
3307
|
+
n[1].data && (r.api = `/api/suggest/${n[1].data}`), t.push(r);
|
|
3308
|
+
}), t;
|
|
3309
|
+
}
|
|
3210
3310
|
function useForm(e, t) {
|
|
3211
|
-
const n = ref({}),
|
|
3311
|
+
const n = convertSchema(t), r = ref({}), o = (i = n, u = !0) => {
|
|
3212
3312
|
if (i.forEach((c) => {
|
|
3213
|
-
c.rules && c.rules.forEach((
|
|
3214
|
-
|
|
3215
|
-
}), c.schema &&
|
|
3216
|
-
}),
|
|
3313
|
+
c.rules && c.rules.forEach((a) => {
|
|
3314
|
+
r.value[c.name] = checkFormRules(e.value[c.name], a);
|
|
3315
|
+
}), c.schema && o(c.schema, !1);
|
|
3316
|
+
}), u && Object.values(r.value).some(Boolean))
|
|
3217
3317
|
throw new Error("Помилка валідації");
|
|
3218
|
-
},
|
|
3219
|
-
const
|
|
3220
|
-
if (!
|
|
3221
|
-
const c = Array.isArray(
|
|
3222
|
-
return isVisible(
|
|
3318
|
+
}, s = computed(() => n?.filter((i) => {
|
|
3319
|
+
const u = i?.conditions;
|
|
3320
|
+
if (!u) return !0;
|
|
3321
|
+
const c = Array.isArray(u) ? u[0] : u, a = e?.value?.[c];
|
|
3322
|
+
return isVisible(a, u);
|
|
3223
3323
|
}));
|
|
3224
3324
|
return {
|
|
3225
|
-
errors:
|
|
3226
|
-
validate:
|
|
3325
|
+
errors: r,
|
|
3326
|
+
validate: o,
|
|
3227
3327
|
reset: () => {
|
|
3228
|
-
e.value = {},
|
|
3328
|
+
e.value = {}, r.value = {};
|
|
3229
3329
|
},
|
|
3230
|
-
visibleSchema:
|
|
3330
|
+
visibleSchema: s
|
|
3231
3331
|
};
|
|
3232
3332
|
}
|
|
3233
3333
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3234
3334
|
__name: "vs-compact-form",
|
|
3235
3335
|
props: /* @__PURE__ */ mergeModels({
|
|
3236
|
-
schema: {
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
},
|
|
3240
|
-
style: {
|
|
3241
|
-
type: Object,
|
|
3242
|
-
default: () => ({})
|
|
3243
|
-
}
|
|
3336
|
+
schema: { default: () => [] },
|
|
3337
|
+
style: { default: () => ({}) },
|
|
3338
|
+
layout: { default: () => "default" }
|
|
3244
3339
|
}, {
|
|
3245
3340
|
form: { default: () => ({}) },
|
|
3246
3341
|
formModifiers: {},
|
|
3247
|
-
|
|
3248
|
-
|
|
3342
|
+
values: { default: () => ({}) },
|
|
3343
|
+
valuesModifiers: {}
|
|
3249
3344
|
}),
|
|
3250
|
-
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:
|
|
3345
|
+
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3251
3346
|
setup(e, { emit: t }) {
|
|
3252
|
-
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"),
|
|
3253
|
-
errors:
|
|
3254
|
-
validate:
|
|
3255
|
-
reset:
|
|
3347
|
+
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3348
|
+
errors: i,
|
|
3349
|
+
validate: u,
|
|
3350
|
+
reset: c,
|
|
3256
3351
|
visibleSchema: a
|
|
3257
|
-
} = useForm(
|
|
3258
|
-
|
|
3352
|
+
} = useForm(l, r.schema), d = () => {
|
|
3353
|
+
u(), n("handle-submit", l.value);
|
|
3259
3354
|
};
|
|
3260
3355
|
return onMounted(() => {
|
|
3261
|
-
s.value.value =
|
|
3262
|
-
}), provide("form", s), provide("
|
|
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", {
|
|
3263
3358
|
onSubmit: withModifiers(d, ["prevent"]),
|
|
3264
|
-
class: "grid grid-cols-12 gap-
|
|
3359
|
+
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3265
3360
|
}, [
|
|
3266
3361
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3267
3362
|
key: p.name,
|
|
3268
3363
|
class: `col-span-${p.col || 12} `
|
|
3269
|
-
}, { ref_for: !0 }, { ...unref(o), ...
|
|
3364
|
+
}, { ref_for: !0 }, { ...unref(o), ...f.style, ...p }, {
|
|
3270
3365
|
item: p,
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3366
|
+
layout: f.layout,
|
|
3367
|
+
modelValue: l.value[p.name],
|
|
3368
|
+
"onUpdate:modelValue": (y) => l.value[p.name] = y,
|
|
3369
|
+
style: f.style,
|
|
3370
|
+
error: unref(i)[p.name]
|
|
3371
|
+
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3372
|
+
], 34));
|
|
3277
3373
|
}
|
|
3278
3374
|
});
|
|
3279
3375
|
_sfc_main.install = function e(t) {
|
|
@@ -3281,6 +3377,6 @@ _sfc_main.install = function e(t) {
|
|
|
3281
3377
|
};
|
|
3282
3378
|
export {
|
|
3283
3379
|
_sfc_main as VForm,
|
|
3284
|
-
_sfc_main$
|
|
3380
|
+
_sfc_main$x as VsInputText,
|
|
3285
3381
|
_sfc_main as default
|
|
3286
3382
|
};
|