@opengis/form 0.0.1 → 0.0.2
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 +296 -263
- package/index.umd.cjs +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, nextTick, ref, onMounted, onUnmounted, withModifiers, normalizeStyle, createVNode, Teleport, vShow, watch, Transition, withCtx, inject, vModelCheckbox, reactive, createStaticVNode, useAttrs, provide } from "vue";
|
|
2
|
-
const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$
|
|
2
|
+
const _hoisted_1$t = { 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 = {
|
|
@@ -27,15 +27,15 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
27
27
|
},
|
|
28
28
|
setup(e) {
|
|
29
29
|
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
30
|
-
createElementVNode("span", _hoisted_2$
|
|
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$s = { class: "w-full relative flex items-center gap-2" }, _hoisted_2$
|
|
38
|
+
}), _hoisted_1$s = { 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 = {
|
|
@@ -63,15 +63,15 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
63
63
|
},
|
|
64
64
|
setup(e) {
|
|
65
65
|
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
66
|
-
createElementVNode("span", _hoisted_2$
|
|
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$r = { class: "w-full relative" }, _hoisted_2$
|
|
74
|
+
}), _hoisted_1$r = { class: "w-full relative" }, _hoisted_2$9 = {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
77
77
|
}, _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
@@ -97,7 +97,7 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
97
97
|
setup(e) {
|
|
98
98
|
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
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 = {
|
|
@@ -108,8 +108,8 @@ const _hoisted_1$t = { class: "w-full relative" }, _hoisted_2$a = { class: "text
|
|
|
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
|
}
|
|
@@ -144,9 +144,9 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
144
144
|
"onUpdate:modelValue": s[0] || (s[0] = (i) => r.value = i),
|
|
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
151
|
}, null, 10, _hoisted_1$q)), [
|
|
152
152
|
[vModelText, r.value]
|
|
@@ -176,13 +176,13 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
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
180
|
}
|
|
181
181
|
}, null, 10, _hoisted_1$p)), [
|
|
182
182
|
[vModelText, r.value]
|
|
183
183
|
]);
|
|
184
184
|
}
|
|
185
|
-
}), _hoisted_1$o = ["value", "disabled"], _hoisted_2$
|
|
185
|
+
}), _hoisted_1$o = ["value", "disabled"], _hoisted_2$8 = { class: "text-[13px] text-gray-700" }, _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
186
186
|
__name: "vs-input-radio-default",
|
|
187
187
|
props: /* @__PURE__ */ mergeModels({
|
|
188
188
|
text: {
|
|
@@ -235,10 +235,10 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
235
235
|
class: normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${e.style?.primaryColor || "blue"}-500`]])
|
|
236
236
|
}, null, 2)) : createCommentVNode("", !0)
|
|
237
237
|
], 2),
|
|
238
|
-
createElementVNode("span", _hoisted_2$
|
|
238
|
+
createElementVNode("span", _hoisted_2$8, toDisplayString(e.text), 1)
|
|
239
239
|
], 2));
|
|
240
240
|
}
|
|
241
|
-
}), _hoisted_1$n = ["value", "disabled"], _hoisted_2$
|
|
241
|
+
}), _hoisted_1$n = ["value", "disabled"], _hoisted_2$7 = { class: "text-[13px] text-gray-700" }, _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
242
242
|
__name: "vs-input-radio-buttons",
|
|
243
243
|
props: /* @__PURE__ */ mergeModels({
|
|
244
244
|
text: {
|
|
@@ -283,7 +283,7 @@ const _hoisted_1$q = ["placeholder", "disabled"], _sfc_main$v = /* @__PURE__ */
|
|
|
283
283
|
}, null, 8, _hoisted_1$n), [
|
|
284
284
|
[vModelRadio, t.value]
|
|
285
285
|
]),
|
|
286
|
-
createElementVNode("span", _hoisted_2$
|
|
286
|
+
createElementVNode("span", _hoisted_2$7, toDisplayString(e.text), 1)
|
|
287
287
|
], 2));
|
|
288
288
|
}
|
|
289
289
|
}), layouts = {
|
|
@@ -347,6 +347,14 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
347
347
|
return !1;
|
|
348
348
|
const t = getPrototypeOf(e);
|
|
349
349
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(toStringTag in e) && !(iterator in e);
|
|
350
|
+
}, isEmptyObject = (e) => {
|
|
351
|
+
if (!isObject(e) || isBuffer(e))
|
|
352
|
+
return !1;
|
|
353
|
+
try {
|
|
354
|
+
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
355
|
+
} catch {
|
|
356
|
+
return !1;
|
|
357
|
+
}
|
|
350
358
|
}, isDate = kindOfTest("Date"), isFile = kindOfTest("File"), isBlob = kindOfTest("Blob"), isFileList = kindOfTest("FileList"), isStream = (e) => isObject(e) && isFunction(e.pipe), isFormData = (e) => {
|
|
351
359
|
let t;
|
|
352
360
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
@@ -360,6 +368,8 @@ function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
360
368
|
for (r = 0, o = e.length; r < o; r++)
|
|
361
369
|
t.call(null, e[r], r, e);
|
|
362
370
|
else {
|
|
371
|
+
if (isBuffer(e))
|
|
372
|
+
return;
|
|
363
373
|
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
|
|
364
374
|
let l;
|
|
365
375
|
for (r = 0; r < i; r++)
|
|
@@ -367,6 +377,8 @@ function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
367
377
|
}
|
|
368
378
|
}
|
|
369
379
|
function findKey(e, t) {
|
|
380
|
+
if (isBuffer(e))
|
|
381
|
+
return null;
|
|
370
382
|
t = t.toLowerCase();
|
|
371
383
|
const n = Object.keys(e);
|
|
372
384
|
let r = n.length, o;
|
|
@@ -470,12 +482,14 @@ const toJSONObject = (e) => {
|
|
|
470
482
|
if (isObject(r)) {
|
|
471
483
|
if (t.indexOf(r) >= 0)
|
|
472
484
|
return;
|
|
485
|
+
if (isBuffer(r))
|
|
486
|
+
return r;
|
|
473
487
|
if (!("toJSON" in r)) {
|
|
474
488
|
t[o] = r;
|
|
475
489
|
const s = isArray(r) ? [] : {};
|
|
476
490
|
return forEach(r, (i, l) => {
|
|
477
|
-
const
|
|
478
|
-
!isUndefined(
|
|
491
|
+
const u = n(i, o + 1);
|
|
492
|
+
!isUndefined(u) && (s[l] = u);
|
|
479
493
|
}), t[o] = void 0, s;
|
|
480
494
|
}
|
|
481
495
|
}
|
|
@@ -500,6 +514,7 @@ const toJSONObject = (e) => {
|
|
|
500
514
|
isBoolean,
|
|
501
515
|
isObject,
|
|
502
516
|
isPlainObject,
|
|
517
|
+
isEmptyObject,
|
|
503
518
|
isReadableStream,
|
|
504
519
|
isRequest,
|
|
505
520
|
isResponse,
|
|
@@ -594,8 +609,8 @@ Object.defineProperties(AxiosError$1, descriptors);
|
|
|
594
609
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
595
610
|
AxiosError$1.from = (e, t, n, r, o, s) => {
|
|
596
611
|
const i = Object.create(prototype$1);
|
|
597
|
-
return utils$1.toFlatObject(e, i, function(
|
|
598
|
-
return
|
|
612
|
+
return utils$1.toFlatObject(e, i, function(u) {
|
|
613
|
+
return u !== Error.prototype;
|
|
599
614
|
}, (l) => l !== "isAxiosError"), AxiosError$1.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
|
|
600
615
|
};
|
|
601
616
|
const httpAdapter = null;
|
|
@@ -626,52 +641,52 @@ function toFormData$1(e, t, n) {
|
|
|
626
641
|
}, !1, function(y, m) {
|
|
627
642
|
return !utils$1.isUndefined(m[y]);
|
|
628
643
|
});
|
|
629
|
-
const r = n.metaTokens, o = n.visitor || a, s = n.dots, i = n.indexes,
|
|
644
|
+
const r = n.metaTokens, o = n.visitor || a, s = n.dots, i = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
630
645
|
if (!utils$1.isFunction(o))
|
|
631
646
|
throw new TypeError("visitor must be a function");
|
|
632
|
-
function
|
|
647
|
+
function c(p) {
|
|
633
648
|
if (p === null) return "";
|
|
634
649
|
if (utils$1.isDate(p))
|
|
635
650
|
return p.toISOString();
|
|
636
651
|
if (utils$1.isBoolean(p))
|
|
637
652
|
return p.toString();
|
|
638
|
-
if (!
|
|
653
|
+
if (!u && utils$1.isBlob(p))
|
|
639
654
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
640
|
-
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ?
|
|
655
|
+
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
641
656
|
}
|
|
642
657
|
function a(p, y, m) {
|
|
643
|
-
let
|
|
658
|
+
let x = p;
|
|
644
659
|
if (p && !m && typeof p == "object") {
|
|
645
660
|
if (utils$1.endsWith(y, "{}"))
|
|
646
661
|
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(
|
|
662
|
+
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (x = utils$1.toArray(p)))
|
|
663
|
+
return y = removeBrackets(y), x.forEach(function(w, _) {
|
|
664
|
+
!(utils$1.isUndefined(w) || w === null) && t.append(
|
|
650
665
|
// eslint-disable-next-line no-nested-ternary
|
|
651
666
|
i === !0 ? renderKey([y], _, s) : i === null ? y : y + "[]",
|
|
652
|
-
|
|
667
|
+
c(w)
|
|
653
668
|
);
|
|
654
669
|
}), !1;
|
|
655
670
|
}
|
|
656
|
-
return isVisitable(p) ? !0 : (t.append(renderKey(m, y, s),
|
|
671
|
+
return isVisitable(p) ? !0 : (t.append(renderKey(m, y, s), c(p)), !1);
|
|
657
672
|
}
|
|
658
673
|
const d = [], f = Object.assign(predicates, {
|
|
659
674
|
defaultVisitor: a,
|
|
660
|
-
convertValue:
|
|
675
|
+
convertValue: c,
|
|
661
676
|
isVisitable
|
|
662
677
|
});
|
|
663
678
|
function h(p, y) {
|
|
664
679
|
if (!utils$1.isUndefined(p)) {
|
|
665
680
|
if (d.indexOf(p) !== -1)
|
|
666
681
|
throw Error("Circular reference detected in " + y.join("."));
|
|
667
|
-
d.push(p), utils$1.forEach(p, function(
|
|
668
|
-
(!(utils$1.isUndefined(
|
|
682
|
+
d.push(p), utils$1.forEach(p, function(x, $) {
|
|
683
|
+
(!(utils$1.isUndefined(x) || x === null) && o.call(
|
|
669
684
|
t,
|
|
670
|
-
|
|
671
|
-
utils$1.isString(
|
|
685
|
+
x,
|
|
686
|
+
utils$1.isString($) ? $.trim() : $,
|
|
672
687
|
y,
|
|
673
688
|
f
|
|
674
|
-
)) === !0 && h(
|
|
689
|
+
)) === !0 && h(x, y ? y.concat($) : [$]);
|
|
675
690
|
}), d.pop();
|
|
676
691
|
}
|
|
677
692
|
}
|
|
@@ -805,11 +820,12 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
805
820
|
...platform$1
|
|
806
821
|
};
|
|
807
822
|
function toURLEncodedForm(e, t) {
|
|
808
|
-
return toFormData$1(e, new platform.classes.URLSearchParams(),
|
|
823
|
+
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
809
824
|
visitor: function(n, r, o, s) {
|
|
810
825
|
return platform.isNode && utils$1.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
811
|
-
}
|
|
812
|
-
|
|
826
|
+
},
|
|
827
|
+
...t
|
|
828
|
+
});
|
|
813
829
|
}
|
|
814
830
|
function parsePropPath(e) {
|
|
815
831
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
@@ -827,8 +843,8 @@ function formDataToJSON(e) {
|
|
|
827
843
|
function t(n, r, o, s) {
|
|
828
844
|
let i = n[s++];
|
|
829
845
|
if (i === "__proto__") return !0;
|
|
830
|
-
const l = Number.isFinite(+i),
|
|
831
|
-
return i = !i && utils$1.isArray(o) ? o.length : i,
|
|
846
|
+
const l = Number.isFinite(+i), u = s >= n.length;
|
|
847
|
+
return i = !i && utils$1.isArray(o) ? o.length : i, u ? (utils$1.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !l) : ((!o[i] || !utils$1.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && utils$1.isArray(o[i]) && (o[i] = arrayToObject(o[i])), !l);
|
|
832
848
|
}
|
|
833
849
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
834
850
|
const n = {};
|
|
@@ -866,10 +882,10 @@ const defaults = {
|
|
|
866
882
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
867
883
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
868
884
|
if ((l = utils$1.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
869
|
-
const
|
|
885
|
+
const u = this.env && this.env.FormData;
|
|
870
886
|
return toFormData$1(
|
|
871
887
|
l ? { "files[]": t } : t,
|
|
872
|
-
|
|
888
|
+
u && new u(),
|
|
873
889
|
this.formSerializer
|
|
874
890
|
);
|
|
875
891
|
}
|
|
@@ -987,24 +1003,24 @@ let AxiosHeaders$1 = class {
|
|
|
987
1003
|
}
|
|
988
1004
|
set(t, n, r) {
|
|
989
1005
|
const o = this;
|
|
990
|
-
function s(l,
|
|
991
|
-
const a = normalizeHeader(
|
|
1006
|
+
function s(l, u, c) {
|
|
1007
|
+
const a = normalizeHeader(u);
|
|
992
1008
|
if (!a)
|
|
993
1009
|
throw new Error("header name must be a non-empty string");
|
|
994
1010
|
const d = utils$1.findKey(o, a);
|
|
995
|
-
(!d || o[d] === void 0 ||
|
|
1011
|
+
(!d || o[d] === void 0 || c === !0 || c === void 0 && o[d] !== !1) && (o[d || u] = normalizeValue(l));
|
|
996
1012
|
}
|
|
997
|
-
const i = (l,
|
|
1013
|
+
const i = (l, u) => utils$1.forEach(l, (c, a) => s(c, a, u));
|
|
998
1014
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
999
1015
|
i(t, n);
|
|
1000
1016
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
1001
1017
|
i(parseHeaders(t), n);
|
|
1002
1018
|
else if (utils$1.isObject(t) && utils$1.isIterable(t)) {
|
|
1003
|
-
let l = {},
|
|
1019
|
+
let l = {}, u, c;
|
|
1004
1020
|
for (const a of t) {
|
|
1005
1021
|
if (!utils$1.isArray(a))
|
|
1006
1022
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1007
|
-
l[
|
|
1023
|
+
l[c = a[0]] = (u = l[c]) ? utils$1.isArray(u) ? [...u, a[1]] : [u, a[1]] : a[1];
|
|
1008
1024
|
}
|
|
1009
1025
|
i(l, n);
|
|
1010
1026
|
} else
|
|
@@ -1152,26 +1168,26 @@ function speedometer(e, t) {
|
|
|
1152
1168
|
e = e || 10;
|
|
1153
1169
|
const n = new Array(e), r = new Array(e);
|
|
1154
1170
|
let o = 0, s = 0, i;
|
|
1155
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
1156
|
-
const
|
|
1157
|
-
i || (i =
|
|
1171
|
+
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1172
|
+
const c = Date.now(), a = r[s];
|
|
1173
|
+
i || (i = c), n[o] = u, r[o] = c;
|
|
1158
1174
|
let d = s, f = 0;
|
|
1159
1175
|
for (; d !== o; )
|
|
1160
1176
|
f += n[d++], d = d % e;
|
|
1161
|
-
if (o = (o + 1) % e, o === s && (s = (s + 1) % e),
|
|
1177
|
+
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), c - i < t)
|
|
1162
1178
|
return;
|
|
1163
|
-
const h = a &&
|
|
1179
|
+
const h = a && c - a;
|
|
1164
1180
|
return h ? Math.round(f * 1e3 / h) : void 0;
|
|
1165
1181
|
};
|
|
1166
1182
|
}
|
|
1167
1183
|
function throttle(e, t) {
|
|
1168
1184
|
let n = 0, r = 1e3 / t, o, s;
|
|
1169
|
-
const i = (
|
|
1170
|
-
n = a, o = null, s && (clearTimeout(s), s = null), e
|
|
1185
|
+
const i = (c, a = Date.now()) => {
|
|
1186
|
+
n = a, o = null, s && (clearTimeout(s), s = null), e(...c);
|
|
1171
1187
|
};
|
|
1172
|
-
return [(...
|
|
1188
|
+
return [(...c) => {
|
|
1173
1189
|
const a = Date.now(), d = a - n;
|
|
1174
|
-
d >= r ? i(
|
|
1190
|
+
d >= r ? i(c, a) : (o = c, s || (s = setTimeout(() => {
|
|
1175
1191
|
s = null, i(o);
|
|
1176
1192
|
}, r - d)));
|
|
1177
1193
|
}, () => o && i(o)];
|
|
@@ -1180,15 +1196,15 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1180
1196
|
let r = 0;
|
|
1181
1197
|
const o = speedometer(50, 250);
|
|
1182
1198
|
return throttle((s) => {
|
|
1183
|
-
const i = s.loaded, l = s.lengthComputable ? s.total : void 0,
|
|
1199
|
+
const i = s.loaded, l = s.lengthComputable ? s.total : void 0, u = i - r, c = o(u), a = i <= l;
|
|
1184
1200
|
r = i;
|
|
1185
1201
|
const d = {
|
|
1186
1202
|
loaded: i,
|
|
1187
1203
|
total: l,
|
|
1188
1204
|
progress: l ? i / l : void 0,
|
|
1189
|
-
bytes:
|
|
1190
|
-
rate:
|
|
1191
|
-
estimated:
|
|
1205
|
+
bytes: u,
|
|
1206
|
+
rate: c || void 0,
|
|
1207
|
+
estimated: c && l && a ? (l - i) / c : void 0,
|
|
1192
1208
|
event: s,
|
|
1193
1209
|
lengthComputable: l != null,
|
|
1194
1210
|
[t ? "download" : "upload"]: !0
|
|
@@ -1246,32 +1262,32 @@ const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
|
1246
1262
|
function mergeConfig$1(e, t) {
|
|
1247
1263
|
t = t || {};
|
|
1248
1264
|
const n = {};
|
|
1249
|
-
function r(
|
|
1250
|
-
return utils$1.isPlainObject(
|
|
1265
|
+
function r(c, a, d, f) {
|
|
1266
|
+
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
1267
|
}
|
|
1252
|
-
function o(
|
|
1268
|
+
function o(c, a, d, f) {
|
|
1253
1269
|
if (utils$1.isUndefined(a)) {
|
|
1254
|
-
if (!utils$1.isUndefined(
|
|
1255
|
-
return r(void 0,
|
|
1256
|
-
} else return r(
|
|
1270
|
+
if (!utils$1.isUndefined(c))
|
|
1271
|
+
return r(void 0, c, d, f);
|
|
1272
|
+
} else return r(c, a, d, f);
|
|
1257
1273
|
}
|
|
1258
|
-
function s(
|
|
1274
|
+
function s(c, a) {
|
|
1259
1275
|
if (!utils$1.isUndefined(a))
|
|
1260
1276
|
return r(void 0, a);
|
|
1261
1277
|
}
|
|
1262
|
-
function i(
|
|
1278
|
+
function i(c, a) {
|
|
1263
1279
|
if (utils$1.isUndefined(a)) {
|
|
1264
|
-
if (!utils$1.isUndefined(
|
|
1265
|
-
return r(void 0,
|
|
1280
|
+
if (!utils$1.isUndefined(c))
|
|
1281
|
+
return r(void 0, c);
|
|
1266
1282
|
} else return r(void 0, a);
|
|
1267
1283
|
}
|
|
1268
|
-
function l(
|
|
1284
|
+
function l(c, a, d) {
|
|
1269
1285
|
if (d in t)
|
|
1270
|
-
return r(
|
|
1286
|
+
return r(c, a);
|
|
1271
1287
|
if (d in e)
|
|
1272
|
-
return r(void 0,
|
|
1288
|
+
return r(void 0, c);
|
|
1273
1289
|
}
|
|
1274
|
-
const
|
|
1290
|
+
const u = {
|
|
1275
1291
|
url: s,
|
|
1276
1292
|
method: s,
|
|
1277
1293
|
data: s,
|
|
@@ -1300,10 +1316,10 @@ function mergeConfig$1(e, t) {
|
|
|
1300
1316
|
socketPath: i,
|
|
1301
1317
|
responseEncoding: i,
|
|
1302
1318
|
validateStatus: l,
|
|
1303
|
-
headers: (
|
|
1319
|
+
headers: (c, a, d) => o(headersToObject(c), headersToObject(a), d, !0)
|
|
1304
1320
|
};
|
|
1305
|
-
return utils$1.forEach(Object.keys(
|
|
1306
|
-
const d =
|
|
1321
|
+
return utils$1.forEach(Object.keys({ ...e, ...t }), function(a) {
|
|
1322
|
+
const d = u[a] || o, f = d(e[a], t[a], a);
|
|
1307
1323
|
utils$1.isUndefined(f) && d !== l || (n[a] = f);
|
|
1308
1324
|
}), n;
|
|
1309
1325
|
}
|
|
@@ -1314,18 +1330,18 @@ const resolveConfig = (e) => {
|
|
|
1314
1330
|
"Authorization",
|
|
1315
1331
|
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1316
1332
|
);
|
|
1317
|
-
let
|
|
1333
|
+
let u;
|
|
1318
1334
|
if (utils$1.isFormData(n)) {
|
|
1319
1335
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1320
1336
|
i.setContentType(void 0);
|
|
1321
|
-
else if ((
|
|
1322
|
-
const [
|
|
1323
|
-
i.setContentType([
|
|
1337
|
+
else if ((u = i.getContentType()) !== !1) {
|
|
1338
|
+
const [c, ...a] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1339
|
+
i.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1324
1340
|
}
|
|
1325
1341
|
}
|
|
1326
1342
|
if (platform.hasStandardBrowserEnv && (r && utils$1.isFunction(r) && (r = r(t)), r || r !== !1 && isURLSameOrigin(t.url))) {
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1343
|
+
const c = o && s && cookies.read(s);
|
|
1344
|
+
c && i.set(o, c);
|
|
1329
1345
|
}
|
|
1330
1346
|
return t;
|
|
1331
1347
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
@@ -1333,22 +1349,22 @@ const resolveConfig = (e) => {
|
|
|
1333
1349
|
const o = resolveConfig(e);
|
|
1334
1350
|
let s = o.data;
|
|
1335
1351
|
const i = AxiosHeaders$1.from(o.headers).normalize();
|
|
1336
|
-
let { responseType: l, onUploadProgress:
|
|
1352
|
+
let { responseType: l, onUploadProgress: u, onDownloadProgress: c } = o, a, d, f, h, p;
|
|
1337
1353
|
function y() {
|
|
1338
1354
|
h && h(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(a), o.signal && o.signal.removeEventListener("abort", a);
|
|
1339
1355
|
}
|
|
1340
1356
|
let m = new XMLHttpRequest();
|
|
1341
1357
|
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
|
|
1342
|
-
function
|
|
1358
|
+
function x() {
|
|
1343
1359
|
if (!m)
|
|
1344
1360
|
return;
|
|
1345
|
-
const
|
|
1361
|
+
const w = AxiosHeaders$1.from(
|
|
1346
1362
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1347
1363
|
), k = {
|
|
1348
1364
|
data: !l || l === "text" || l === "json" ? m.responseText : m.response,
|
|
1349
1365
|
status: m.status,
|
|
1350
1366
|
statusText: m.statusText,
|
|
1351
|
-
headers:
|
|
1367
|
+
headers: w,
|
|
1352
1368
|
config: e,
|
|
1353
1369
|
request: m
|
|
1354
1370
|
};
|
|
@@ -1358,8 +1374,8 @@ const resolveConfig = (e) => {
|
|
|
1358
1374
|
r(g), y();
|
|
1359
1375
|
}, k), m = null;
|
|
1360
1376
|
}
|
|
1361
|
-
"onloadend" in m ? m.onloadend =
|
|
1362
|
-
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1377
|
+
"onloadend" in m ? m.onloadend = x : m.onreadystatechange = function() {
|
|
1378
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1363
1379
|
}, m.onabort = function() {
|
|
1364
1380
|
m && (r(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, m)), m = null);
|
|
1365
1381
|
}, m.onerror = function() {
|
|
@@ -1375,12 +1391,12 @@ const resolveConfig = (e) => {
|
|
|
1375
1391
|
)), m = null;
|
|
1376
1392
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in m && utils$1.forEach(i.toJSON(), function(_, k) {
|
|
1377
1393
|
m.setRequestHeader(k, _);
|
|
1378
|
-
}), utils$1.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), l && l !== "json" && (m.responseType = o.responseType),
|
|
1379
|
-
m && (r(!
|
|
1394
|
+
}), utils$1.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), l && l !== "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 = (w) => {
|
|
1395
|
+
m && (r(!w || w.type ? new CanceledError$1(null, e, m) : w), m.abort(), m = null);
|
|
1380
1396
|
}, 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 " +
|
|
1397
|
+
const $ = parseProtocol(o.url);
|
|
1398
|
+
if ($ && platform.protocols.indexOf($) === -1) {
|
|
1399
|
+
r(new AxiosError$1("Unsupported protocol " + $ + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
1384
1400
|
return;
|
|
1385
1401
|
}
|
|
1386
1402
|
m.send(s || null);
|
|
@@ -1389,10 +1405,10 @@ const resolveConfig = (e) => {
|
|
|
1389
1405
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1390
1406
|
if (t || n) {
|
|
1391
1407
|
let r = new AbortController(), o;
|
|
1392
|
-
const s = function(
|
|
1408
|
+
const s = function(c) {
|
|
1393
1409
|
if (!o) {
|
|
1394
1410
|
o = !0, l();
|
|
1395
|
-
const a =
|
|
1411
|
+
const a = c instanceof Error ? c : this.reason;
|
|
1396
1412
|
r.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
1397
1413
|
}
|
|
1398
1414
|
};
|
|
@@ -1400,13 +1416,13 @@ const resolveConfig = (e) => {
|
|
|
1400
1416
|
i = null, s(new AxiosError$1(`timeout ${t} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
1401
1417
|
}, t);
|
|
1402
1418
|
const l = () => {
|
|
1403
|
-
e && (i && clearTimeout(i), i = null, e.forEach((
|
|
1404
|
-
|
|
1419
|
+
e && (i && clearTimeout(i), i = null, e.forEach((c) => {
|
|
1420
|
+
c.unsubscribe ? c.unsubscribe(s) : c.removeEventListener("abort", s);
|
|
1405
1421
|
}), e = null);
|
|
1406
1422
|
};
|
|
1407
|
-
e.forEach((
|
|
1408
|
-
const { signal:
|
|
1409
|
-
return
|
|
1423
|
+
e.forEach((c) => c.addEventListener("abort", s));
|
|
1424
|
+
const { signal: u } = r;
|
|
1425
|
+
return u.unsubscribe = () => utils$1.asap(l), u;
|
|
1410
1426
|
}
|
|
1411
1427
|
}, streamChunk = function* (e, t) {
|
|
1412
1428
|
let n = e.byteLength;
|
|
@@ -1438,15 +1454,15 @@ const resolveConfig = (e) => {
|
|
|
1438
1454
|
}
|
|
1439
1455
|
}, trackStream = (e, t, n, r) => {
|
|
1440
1456
|
const o = readBytes(e, t);
|
|
1441
|
-
let s = 0, i, l = (
|
|
1442
|
-
i || (i = !0, r && r(
|
|
1457
|
+
let s = 0, i, l = (u) => {
|
|
1458
|
+
i || (i = !0, r && r(u));
|
|
1443
1459
|
};
|
|
1444
1460
|
return new ReadableStream({
|
|
1445
|
-
async pull(
|
|
1461
|
+
async pull(u) {
|
|
1446
1462
|
try {
|
|
1447
|
-
const { done:
|
|
1448
|
-
if (
|
|
1449
|
-
l(),
|
|
1463
|
+
const { done: c, value: a } = await o.next();
|
|
1464
|
+
if (c) {
|
|
1465
|
+
l(), u.close();
|
|
1450
1466
|
return;
|
|
1451
1467
|
}
|
|
1452
1468
|
let d = a.byteLength;
|
|
@@ -1454,13 +1470,13 @@ const resolveConfig = (e) => {
|
|
|
1454
1470
|
let f = s += d;
|
|
1455
1471
|
n(f);
|
|
1456
1472
|
}
|
|
1457
|
-
|
|
1458
|
-
} catch (
|
|
1459
|
-
throw l(
|
|
1473
|
+
u.enqueue(new Uint8Array(a));
|
|
1474
|
+
} catch (c) {
|
|
1475
|
+
throw l(c), c;
|
|
1460
1476
|
}
|
|
1461
1477
|
},
|
|
1462
|
-
cancel(
|
|
1463
|
-
return l(
|
|
1478
|
+
cancel(u) {
|
|
1479
|
+
return l(u), o.return();
|
|
1464
1480
|
}
|
|
1465
1481
|
}, {
|
|
1466
1482
|
highWaterMark: 2
|
|
@@ -1517,20 +1533,20 @@ const getBodyLength = async (e) => {
|
|
|
1517
1533
|
cancelToken: s,
|
|
1518
1534
|
timeout: i,
|
|
1519
1535
|
onDownloadProgress: l,
|
|
1520
|
-
onUploadProgress:
|
|
1521
|
-
responseType:
|
|
1536
|
+
onUploadProgress: u,
|
|
1537
|
+
responseType: c,
|
|
1522
1538
|
headers: a,
|
|
1523
1539
|
withCredentials: d = "same-origin",
|
|
1524
1540
|
fetchOptions: f
|
|
1525
1541
|
} = resolveConfig(e);
|
|
1526
|
-
|
|
1542
|
+
c = c ? (c + "").toLowerCase() : "text";
|
|
1527
1543
|
let h = composeSignals([o, s && s.toAbortSignal()], i), p;
|
|
1528
1544
|
const y = h && h.unsubscribe && (() => {
|
|
1529
1545
|
h.unsubscribe();
|
|
1530
1546
|
});
|
|
1531
1547
|
let m;
|
|
1532
1548
|
try {
|
|
1533
|
-
if (
|
|
1549
|
+
if (u && supportsRequestStream && n !== "get" && n !== "head" && (m = await resolveBodyLength(a, r)) !== 0) {
|
|
1534
1550
|
let k = new Request(t, {
|
|
1535
1551
|
method: "POST",
|
|
1536
1552
|
body: r,
|
|
@@ -1539,13 +1555,13 @@ const getBodyLength = async (e) => {
|
|
|
1539
1555
|
if (utils$1.isFormData(r) && (b = k.headers.get("content-type")) && a.setContentType(b), k.body) {
|
|
1540
1556
|
const [g, v] = progressEventDecorator(
|
|
1541
1557
|
m,
|
|
1542
|
-
progressEventReducer(asyncDecorator(
|
|
1558
|
+
progressEventReducer(asyncDecorator(u))
|
|
1543
1559
|
);
|
|
1544
1560
|
r = trackStream(k.body, DEFAULT_CHUNK_SIZE, g, v);
|
|
1545
1561
|
}
|
|
1546
1562
|
}
|
|
1547
1563
|
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
1548
|
-
const
|
|
1564
|
+
const x = "credentials" in Request.prototype;
|
|
1549
1565
|
p = new Request(t, {
|
|
1550
1566
|
...f,
|
|
1551
1567
|
signal: h,
|
|
@@ -1553,45 +1569,45 @@ const getBodyLength = async (e) => {
|
|
|
1553
1569
|
headers: a.normalize().toJSON(),
|
|
1554
1570
|
body: r,
|
|
1555
1571
|
duplex: "half",
|
|
1556
|
-
credentials:
|
|
1572
|
+
credentials: x ? d : void 0
|
|
1557
1573
|
});
|
|
1558
|
-
let
|
|
1559
|
-
const
|
|
1560
|
-
if (supportsResponseStream && (l ||
|
|
1574
|
+
let $ = await fetch(p, f);
|
|
1575
|
+
const w = supportsResponseStream && (c === "stream" || c === "response");
|
|
1576
|
+
if (supportsResponseStream && (l || w && y)) {
|
|
1561
1577
|
const k = {};
|
|
1562
1578
|
["status", "statusText", "headers"].forEach((E) => {
|
|
1563
|
-
k[E] =
|
|
1579
|
+
k[E] = $[E];
|
|
1564
1580
|
});
|
|
1565
|
-
const b = utils$1.toFiniteNumber(
|
|
1581
|
+
const b = utils$1.toFiniteNumber($.headers.get("content-length")), [g, v] = l && progressEventDecorator(
|
|
1566
1582
|
b,
|
|
1567
1583
|
progressEventReducer(asyncDecorator(l), !0)
|
|
1568
1584
|
) || [];
|
|
1569
|
-
|
|
1570
|
-
trackStream(
|
|
1585
|
+
$ = new Response(
|
|
1586
|
+
trackStream($.body, DEFAULT_CHUNK_SIZE, g, () => {
|
|
1571
1587
|
v && v(), y && y();
|
|
1572
1588
|
}),
|
|
1573
1589
|
k
|
|
1574
1590
|
);
|
|
1575
1591
|
}
|
|
1576
|
-
|
|
1577
|
-
let _ = await resolvers[utils$1.findKey(resolvers,
|
|
1578
|
-
return !
|
|
1592
|
+
c = c || "text";
|
|
1593
|
+
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"]($, e);
|
|
1594
|
+
return !w && y && y(), await new Promise((k, b) => {
|
|
1579
1595
|
settle(k, b, {
|
|
1580
1596
|
data: _,
|
|
1581
|
-
headers: AxiosHeaders$1.from(
|
|
1582
|
-
status:
|
|
1583
|
-
statusText:
|
|
1597
|
+
headers: AxiosHeaders$1.from($.headers),
|
|
1598
|
+
status: $.status,
|
|
1599
|
+
statusText: $.statusText,
|
|
1584
1600
|
config: e,
|
|
1585
1601
|
request: p
|
|
1586
1602
|
});
|
|
1587
1603
|
});
|
|
1588
|
-
} catch (
|
|
1589
|
-
throw y && y(),
|
|
1604
|
+
} catch (x) {
|
|
1605
|
+
throw y && y(), x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message) ? Object.assign(
|
|
1590
1606
|
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, p),
|
|
1591
1607
|
{
|
|
1592
|
-
cause:
|
|
1608
|
+
cause: x.cause || x
|
|
1593
1609
|
}
|
|
1594
|
-
) : AxiosError$1.from(
|
|
1610
|
+
) : AxiosError$1.from(x, x && x.code, e, p);
|
|
1595
1611
|
}
|
|
1596
1612
|
}), knownAdapters = {
|
|
1597
1613
|
http: httpAdapter,
|
|
@@ -1624,7 +1640,7 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
1624
1640
|
}
|
|
1625
1641
|
if (!r) {
|
|
1626
1642
|
const s = Object.entries(o).map(
|
|
1627
|
-
([l,
|
|
1643
|
+
([l, u]) => `adapter ${l} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1628
1644
|
);
|
|
1629
1645
|
let i = t ? s.length > 1 ? `since :
|
|
1630
1646
|
` + s.map(renderReason).join(`
|
|
@@ -1660,7 +1676,7 @@ function dispatchRequest(e) {
|
|
|
1660
1676
|
), r.response.headers = AxiosHeaders$1.from(r.response.headers))), Promise.reject(r);
|
|
1661
1677
|
});
|
|
1662
1678
|
}
|
|
1663
|
-
const VERSION$1 = "1.
|
|
1679
|
+
const VERSION$1 = "1.11.0", validators$1 = {};
|
|
1664
1680
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1665
1681
|
validators$1[e] = function(r) {
|
|
1666
1682
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1696,9 +1712,9 @@ function assertOptions(e, t, n) {
|
|
|
1696
1712
|
for (; o-- > 0; ) {
|
|
1697
1713
|
const s = r[o], i = t[s];
|
|
1698
1714
|
if (i) {
|
|
1699
|
-
const l = e[s],
|
|
1700
|
-
if (
|
|
1701
|
-
throw new AxiosError$1("option " + s + " must be " +
|
|
1715
|
+
const l = e[s], u = l === void 0 || i(l, s, e);
|
|
1716
|
+
if (u !== !0)
|
|
1717
|
+
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
1702
1718
|
continue;
|
|
1703
1719
|
}
|
|
1704
1720
|
if (n !== !0)
|
|
@@ -1768,18 +1784,18 @@ let Axios$1 = class {
|
|
|
1768
1784
|
}
|
|
1769
1785
|
), n.headers = AxiosHeaders$1.concat(i, s);
|
|
1770
1786
|
const l = [];
|
|
1771
|
-
let
|
|
1787
|
+
let u = !0;
|
|
1772
1788
|
this.interceptors.request.forEach(function(y) {
|
|
1773
|
-
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (
|
|
1789
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (u = u && y.synchronous, l.unshift(y.fulfilled, y.rejected));
|
|
1774
1790
|
});
|
|
1775
|
-
const
|
|
1791
|
+
const c = [];
|
|
1776
1792
|
this.interceptors.response.forEach(function(y) {
|
|
1777
|
-
|
|
1793
|
+
c.push(y.fulfilled, y.rejected);
|
|
1778
1794
|
});
|
|
1779
1795
|
let a, d = 0, f;
|
|
1780
|
-
if (!
|
|
1796
|
+
if (!u) {
|
|
1781
1797
|
const p = [dispatchRequest.bind(this), void 0];
|
|
1782
|
-
for (p.unshift
|
|
1798
|
+
for (p.unshift(...l), p.push(...c), f = p.length, a = Promise.resolve(n); d < f; )
|
|
1783
1799
|
a = a.then(p[d++], p[d++]);
|
|
1784
1800
|
return a;
|
|
1785
1801
|
}
|
|
@@ -1799,8 +1815,8 @@ let Axios$1 = class {
|
|
|
1799
1815
|
} catch (p) {
|
|
1800
1816
|
return Promise.reject(p);
|
|
1801
1817
|
}
|
|
1802
|
-
for (d = 0, f =
|
|
1803
|
-
a = a.then(
|
|
1818
|
+
for (d = 0, f = c.length; d < f; )
|
|
1819
|
+
a = a.then(c[d++], c[d++]);
|
|
1804
1820
|
return a;
|
|
1805
1821
|
}
|
|
1806
1822
|
getUri(t) {
|
|
@@ -2111,43 +2127,43 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2111
2127
|
await nextTick();
|
|
2112
2128
|
const o = await n?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
2113
2129
|
if (!s || !o) return;
|
|
2114
|
-
const i = await parseInt(t?.getBoundingClientRect()?.height.toString()), l = await parseInt(t?.getBoundingClientRect()?.width.toString()),
|
|
2130
|
+
const i = await parseInt(t?.getBoundingClientRect()?.height.toString()), l = 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;
|
|
2115
2131
|
let f = 0, h = 0;
|
|
2116
|
-
const p = s.bottom + r +
|
|
2132
|
+
const p = s.bottom + r + u;
|
|
2117
2133
|
switch (e) {
|
|
2118
2134
|
case "top":
|
|
2119
|
-
s.top - o.height - r < 0 ? f = s.top - o.height + r +
|
|
2135
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + i : f = s.top - o.height - r, d > c + s.right + 30 ? h = s.left - o.width / 2 + s.width / 2 : h = d - 30 - c;
|
|
2120
2136
|
break;
|
|
2121
2137
|
case "bottom":
|
|
2122
|
-
a > p ? f = s.bottom + r : f = s.bottom - r -
|
|
2138
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - i, h = s.left - o.width / 2 + s.width / 2;
|
|
2123
2139
|
break;
|
|
2124
2140
|
case "left":
|
|
2125
2141
|
f = s.top - o.height / 2 + s.height / 2, s.left - o.width - r > 0 ? h = s.left - o.width - r : h = 10;
|
|
2126
2142
|
break;
|
|
2127
2143
|
case "right":
|
|
2128
|
-
f = s.top - o.height / 2 + s.height / 2, d - l >
|
|
2144
|
+
f = s.top - o.height / 2 + s.height / 2, d - l > c ? h = s.right + r : h = d - 30 - c;
|
|
2129
2145
|
break;
|
|
2130
2146
|
case "top-right":
|
|
2131
|
-
s.top - o.height - r < 0 ? f = s.top - o.height + r +
|
|
2147
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + i : f = s.top - o.height - r, d - l > c ? h = s.right + r : h = d - 30 - c;
|
|
2132
2148
|
break;
|
|
2133
2149
|
case "top-left":
|
|
2134
|
-
s.top - o.height - r < 0 ? f = s.top - o.height + r +
|
|
2150
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + i : f = s.top - o.height - r, s.left - o.width - r > 0 ? h = s.left - o.width - r : h = 10;
|
|
2135
2151
|
break;
|
|
2136
2152
|
case "top-start":
|
|
2137
|
-
s.top - o.height - r < 0 ? f = s.top - o.height + r +
|
|
2153
|
+
s.top - o.height - r < 0 ? f = s.top - o.height + r + u + i : f = s.top - o.height - r, s.left > 0 ? h = s.left : h = 10;
|
|
2138
2154
|
break;
|
|
2139
2155
|
case "bottom-right":
|
|
2140
|
-
a > p ? f = s.bottom + r : f = s.bottom - r -
|
|
2156
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - i, d - l > c ? h = s.left : h = d - 30 - c;
|
|
2141
2157
|
break;
|
|
2142
2158
|
case "bottom-left":
|
|
2143
|
-
a > p ? f = s.bottom + r : f = s.bottom - r -
|
|
2159
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - i, s.left > 0 ? h = s.right - c : h = 10;
|
|
2144
2160
|
break;
|
|
2145
2161
|
case "bottom-start":
|
|
2146
|
-
a > p ? f = s.bottom + r : f = s.bottom - r -
|
|
2162
|
+
a > p ? f = s.bottom + r : f = s.bottom - r - u - i, s.left > 0 ? h = s.left : h = 10;
|
|
2147
2163
|
break;
|
|
2148
2164
|
}
|
|
2149
|
-
f +
|
|
2150
|
-
}, _hoisted_1$i = ["disabled"], _hoisted_2$
|
|
2165
|
+
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");
|
|
2166
|
+
}, _hoisted_1$i = ["disabled"], _hoisted_2$6 = { key: 1 }, _hoisted_3$3 = {
|
|
2151
2167
|
key: 2,
|
|
2152
2168
|
class: "text-gray-400"
|
|
2153
2169
|
}, _hoisted_4$2 = { 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$m = /* @__PURE__ */ defineComponent({
|
|
@@ -2172,9 +2188,9 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2172
2188
|
}),
|
|
2173
2189
|
emits: ["update:modelValue"],
|
|
2174
2190
|
setup(e) {
|
|
2175
|
-
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue"), o = ref({}), s = ref(null), i = ref(null), l = ref(!1),
|
|
2176
|
-
|
|
2177
|
-
...
|
|
2191
|
+
const t = e, { inputClass: n } = useStyle(t.style), r = useModel(e, "modelValue"), o = ref({}), s = ref(null), i = ref(null), l = ref(!1), u = ref(null), c = ref([]), a = ref(-1), d = ref([]), f = computed(() => c.value?.length ? [
|
|
2192
|
+
u.value,
|
|
2193
|
+
...c.value?.filter((b) => b?.id !== u.value?.id)
|
|
2178
2194
|
].filter((b) => b !== null) : []), h = async () => {
|
|
2179
2195
|
try {
|
|
2180
2196
|
const { data: b } = await axios.get(
|
|
@@ -2185,27 +2201,27 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2185
2201
|
return [];
|
|
2186
2202
|
}
|
|
2187
2203
|
}, p = async (b) => {
|
|
2188
|
-
document.body.click(), l.value = b !== void 0 ? b : !l.value, l.value && !
|
|
2204
|
+
document.body.click(), l.value = b !== void 0 ? b : !l.value, l.value && !c.value?.length && (!t.options?.length && t.data ? c.value = await h() : t.options?.length && (c.value = [...t.options])), l.value && s.value ? (o.value.width = `${s.value.getBoundingClientRect()?.width}px`, i.value && dynamicPosition("bottom-start", s.value, i.value)) : a.value = -1;
|
|
2189
2205
|
}, y = () => l.value ? p(!1) : null, m = (b) => {
|
|
2190
|
-
|
|
2191
|
-
},
|
|
2206
|
+
u.value = b, r.value = b.id, p(!1);
|
|
2207
|
+
}, x = (b, g) => {
|
|
2192
2208
|
if (!b || !g) return;
|
|
2193
2209
|
const v = b.offsetTop, E = v + b.offsetHeight, S = g.scrollTop, B = S + g.clientHeight;
|
|
2194
2210
|
v < S ? g.scrollTop = v - 80 : E > B && (g.scrollTop = E - g.clientHeight + 4);
|
|
2195
|
-
},
|
|
2211
|
+
}, $ = (b) => {
|
|
2196
2212
|
if (!l.value) return;
|
|
2197
2213
|
const { keyCode: g } = b;
|
|
2198
2214
|
if ([38, 40, 13].includes(g) && b.preventDefault(), g == 38) {
|
|
2199
2215
|
if (a.value == 0) return;
|
|
2200
|
-
a.value -= 1,
|
|
2216
|
+
a.value -= 1, x(d.value[a.value], i.value);
|
|
2201
2217
|
} else if (g == 40) {
|
|
2202
2218
|
if (a.value + 1 >= f.value?.length) return;
|
|
2203
|
-
a.value += 1,
|
|
2219
|
+
a.value += 1, x(d.value[a.value], i.value);
|
|
2204
2220
|
} else if (g == 13) {
|
|
2205
2221
|
const v = f.value[a.value];
|
|
2206
2222
|
v && m(v);
|
|
2207
2223
|
}
|
|
2208
|
-
},
|
|
2224
|
+
}, w = async (b) => {
|
|
2209
2225
|
if (l.value) return;
|
|
2210
2226
|
const { keyCode: g } = b;
|
|
2211
2227
|
[38, 40].includes(g) && (await b.preventDefault(), a.value = 0, setTimeout(() => p()));
|
|
@@ -2215,9 +2231,9 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2215
2231
|
b?.key === "Escape" && l.value && p(!1);
|
|
2216
2232
|
};
|
|
2217
2233
|
return onMounted(async () => {
|
|
2218
|
-
addEventListener("click", y), addEventListener("keydown",
|
|
2234
|
+
addEventListener("click", y), addEventListener("keydown", $), addEventListener("scroll", _, !0), addEventListener("keydown", k), r.value && !t.options?.length && t.data && (c.value = await h(), u.value = c.value?.find((b) => b?.id === r.value) || null);
|
|
2219
2235
|
}), onUnmounted(() => {
|
|
2220
|
-
removeEventListener("click", y), removeEventListener("keydown",
|
|
2236
|
+
removeEventListener("click", y), removeEventListener("keydown", $), removeEventListener("scroll", _, !0), removeEventListener("keydown", k);
|
|
2221
2237
|
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
2222
2238
|
class: "relative w-full",
|
|
2223
2239
|
ref_key: "select",
|
|
@@ -2227,24 +2243,25 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2227
2243
|
}, [
|
|
2228
2244
|
createElementVNode("button", {
|
|
2229
2245
|
type: "button",
|
|
2230
|
-
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px]
|
|
2246
|
+
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
2231
2247
|
l.value ? `ring-rind ring-2 ring-${b.style?.primaryColor || "blue"}-500` : "",
|
|
2248
|
+
u.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
2232
2249
|
unref(n),
|
|
2233
2250
|
b.customClass
|
|
2234
2251
|
]]),
|
|
2235
|
-
onKeydown:
|
|
2252
|
+
onKeydown: w,
|
|
2236
2253
|
onClick: g[0] || (g[0] = (v) => p(!l.value)),
|
|
2237
2254
|
disabled: b.disabled,
|
|
2238
2255
|
style: {
|
|
2239
|
-
border: "1px solid #
|
|
2256
|
+
border: "1px solid #CFD9E0"
|
|
2240
2257
|
}
|
|
2241
2258
|
}, [
|
|
2242
|
-
|
|
2259
|
+
u.value?.color ? (openBlock(), createElementBlock("span", {
|
|
2243
2260
|
key: 0,
|
|
2244
2261
|
class: "w-[16px] h-[16px] rounded-md block",
|
|
2245
|
-
style: normalizeStyle({ backgroundColor:
|
|
2262
|
+
style: normalizeStyle({ backgroundColor: u.value?.color })
|
|
2246
2263
|
}, null, 4)) : createCommentVNode("", !0),
|
|
2247
|
-
|
|
2264
|
+
u.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2$6, toDisplayString(u.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(b.placeholder), 1))
|
|
2248
2265
|
], 42, _hoisted_1$i),
|
|
2249
2266
|
createElementVNode("span", _hoisted_4$2, [
|
|
2250
2267
|
createVNode(unref(IconChevronTopBottom), {
|
|
@@ -2252,11 +2269,11 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2252
2269
|
width: "14"
|
|
2253
2270
|
})
|
|
2254
2271
|
]),
|
|
2255
|
-
|
|
2272
|
+
u.value?.text ? (openBlock(), createElementBlock("button", {
|
|
2256
2273
|
key: 0,
|
|
2257
2274
|
type: "button",
|
|
2258
2275
|
onClick: g[1] || (g[1] = (v) => {
|
|
2259
|
-
r.value = null,
|
|
2276
|
+
r.value = null, u.value = null;
|
|
2260
2277
|
}),
|
|
2261
2278
|
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
2262
2279
|
}, [
|
|
@@ -2285,7 +2302,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2285
2302
|
key: v?.id,
|
|
2286
2303
|
ref_for: !0,
|
|
2287
2304
|
ref: (S) => d.value[E] = S,
|
|
2288
|
-
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-
|
|
2305
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [a.value == E ? "bg-gray-100" : ""]])
|
|
2289
2306
|
}, [
|
|
2290
2307
|
createElementVNode("span", _hoisted_6, [
|
|
2291
2308
|
v?.color ? (openBlock(), createElementBlock("span", {
|
|
@@ -2362,7 +2379,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2362
2379
|
innerHTML: e.html
|
|
2363
2380
|
}, null, 10, _hoisted_1$g));
|
|
2364
2381
|
}
|
|
2365
|
-
}), _hoisted_1$f = { class: "flex items-center justify-between" }, _hoisted_2$
|
|
2382
|
+
}), _hoisted_1$f = { class: "flex items-center justify-between" }, _hoisted_2$5 = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_3$2 = { class: "grid gap-3" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2366
2383
|
__name: "vs-container-switcher",
|
|
2367
2384
|
props: {
|
|
2368
2385
|
title: {
|
|
@@ -2387,7 +2404,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2387
2404
|
}
|
|
2388
2405
|
), (r, o) => (openBlock(), createElementBlock("div", null, [
|
|
2389
2406
|
createElementVNode("div", _hoisted_1$f, [
|
|
2390
|
-
createElementVNode("p",
|
|
2407
|
+
createElementVNode("p", _hoisted_2$5, toDisplayString(e.title), 1),
|
|
2391
2408
|
createVNode(_sfc_main$l, {
|
|
2392
2409
|
modelValue: n.value,
|
|
2393
2410
|
"onUpdate:modelValue": o[0] || (o[0] = (s) => n.value = s),
|
|
@@ -2396,7 +2413,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2396
2413
|
]),
|
|
2397
2414
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2398
2415
|
default: withCtx(() => [
|
|
2399
|
-
withDirectives(createElementVNode("div",
|
|
2416
|
+
withDirectives(createElementVNode("div", _hoisted_3$2, [
|
|
2400
2417
|
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2401
2418
|
], 512), [
|
|
2402
2419
|
[vShow, n.value]
|
|
@@ -2406,7 +2423,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2406
2423
|
})
|
|
2407
2424
|
]));
|
|
2408
2425
|
}
|
|
2409
|
-
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-
|
|
2426
|
+
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-d0cc3932"]]), _hoisted_1$e = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_2$4 = { class: "grid gap-3" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
2410
2427
|
__name: "vs-container-accordion",
|
|
2411
2428
|
props: {
|
|
2412
2429
|
title: {
|
|
@@ -2438,11 +2455,11 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2438
2455
|
createVNode(unref(IconChevronDown), {
|
|
2439
2456
|
class: normalizeClass(["h-4 w-4 duration-300", [n.value ? "-rotate-180" : ""]])
|
|
2440
2457
|
}, null, 8, ["class"]),
|
|
2441
|
-
createElementVNode("span",
|
|
2458
|
+
createElementVNode("span", _hoisted_1$e, toDisplayString(e.title), 1)
|
|
2442
2459
|
]),
|
|
2443
2460
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2444
2461
|
default: withCtx(() => [
|
|
2445
|
-
withDirectives(createElementVNode("div",
|
|
2462
|
+
withDirectives(createElementVNode("div", _hoisted_2$4, [
|
|
2446
2463
|
renderSlot(r.$slots, "default", {}, void 0, !0)
|
|
2447
2464
|
], 512), [
|
|
2448
2465
|
[vShow, n.value]
|
|
@@ -2452,7 +2469,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2452
2469
|
})
|
|
2453
2470
|
]));
|
|
2454
2471
|
}
|
|
2455
|
-
}), VsContainerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
2472
|
+
}), VsContainerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-a37284e6"]]), _hoisted_1$d = { class: "flex items-center justify-between" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
2456
2473
|
__name: "vs-container-default",
|
|
2457
2474
|
props: {
|
|
2458
2475
|
title: {
|
|
@@ -2543,8 +2560,8 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2543
2560
|
const t = e, n = inject("formValues", { default: {} }), r = inject("form"), o = computed(() => t.schema?.filter((i) => {
|
|
2544
2561
|
const l = i?.conditions;
|
|
2545
2562
|
if (!l) return !0;
|
|
2546
|
-
const
|
|
2547
|
-
return isVisible(
|
|
2563
|
+
const u = Array.isArray(l) ? l[0] : l, c = n?.value?.[u];
|
|
2564
|
+
return isVisible(c, l);
|
|
2548
2565
|
})), s = computed(() => views[t.view]);
|
|
2549
2566
|
return (i, l) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
2550
2567
|
key: 0,
|
|
@@ -2552,20 +2569,20 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2552
2569
|
style: normalizeStyle(e.style)
|
|
2553
2570
|
}, {
|
|
2554
2571
|
default: withCtx(() => [
|
|
2555
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (
|
|
2556
|
-
key:
|
|
2557
|
-
}, { ref_for: !0 },
|
|
2558
|
-
item:
|
|
2559
|
-
modelValue: unref(n)[
|
|
2560
|
-
"onUpdate:modelValue": (
|
|
2572
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (u) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
2573
|
+
key: u.name
|
|
2574
|
+
}, { ref_for: !0 }, u, {
|
|
2575
|
+
item: u,
|
|
2576
|
+
modelValue: unref(n)[u.name],
|
|
2577
|
+
"onUpdate:modelValue": (c) => unref(n)[u.name] = c,
|
|
2561
2578
|
style: e.style,
|
|
2562
|
-
error: unref(r)?.errors?.[
|
|
2579
|
+
error: unref(r)?.errors?.[u.name]
|
|
2563
2580
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
2564
2581
|
]),
|
|
2565
2582
|
_: 1
|
|
2566
2583
|
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
2567
2584
|
}
|
|
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-
|
|
2585
|
+
}), _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-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
2569
2586
|
__name: "vs-checkbox-default",
|
|
2570
2587
|
props: {
|
|
2571
2588
|
value: { type: [String, Number], default: "" },
|
|
@@ -2638,7 +2655,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2638
2655
|
r("update:modelValue", l);
|
|
2639
2656
|
}
|
|
2640
2657
|
}), s = computed(() => Array.isArray(o.value) ? o.value.includes(n.value) : o.value === !0 || o.value === n.value), i = computed(() => n.style?.size === "xs" ? "p-1.5 text-xs" : n.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
2641
|
-
return (l,
|
|
2658
|
+
return (l, u) => (openBlock(), createElementBlock("label", {
|
|
2642
2659
|
class: normalizeClass(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [i.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
|
|
2643
2660
|
}, [
|
|
2644
2661
|
withDirectives(createElementVNode("input", {
|
|
@@ -2646,7 +2663,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2646
2663
|
class: "hidden",
|
|
2647
2664
|
name: e.id,
|
|
2648
2665
|
value: e.value,
|
|
2649
|
-
"onUpdate:modelValue":
|
|
2666
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
2650
2667
|
disabled: e.disabled
|
|
2651
2668
|
}, null, 8, _hoisted_1$b), [
|
|
2652
2669
|
[vModelCheckbox, o.value]
|
|
@@ -2697,20 +2714,20 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2697
2714
|
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
2698
2715
|
set: (l) => {
|
|
2699
2716
|
if (Array.isArray(n.modelValue)) {
|
|
2700
|
-
let
|
|
2701
|
-
l ?
|
|
2717
|
+
let u = [...n.modelValue];
|
|
2718
|
+
l ? u.includes(n.value) || u.push(n.value) : u = u.filter((c) => c !== n.value), r("update:modelValue", u);
|
|
2702
2719
|
} else
|
|
2703
2720
|
r("update:modelValue", l);
|
|
2704
2721
|
}
|
|
2705
2722
|
}), i = ref("vs-checkbox-" + (n.view || "default"));
|
|
2706
|
-
return (l,
|
|
2723
|
+
return (l, u) => (openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2707
2724
|
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[i.value]), {
|
|
2708
2725
|
value: e.value,
|
|
2709
2726
|
label: e.label,
|
|
2710
2727
|
info: e.option?.info,
|
|
2711
2728
|
disabled: e.disabled,
|
|
2712
2729
|
modelValue: s.value,
|
|
2713
|
-
"onUpdate:modelValue":
|
|
2730
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
2714
2731
|
id: o,
|
|
2715
2732
|
icon: e.icon,
|
|
2716
2733
|
imgUrl: e.imgUrl,
|
|
@@ -2743,7 +2760,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2743
2760
|
},
|
|
2744
2761
|
emits: ["update:modelValue"],
|
|
2745
2762
|
setup(e, { emit: t }) {
|
|
2746
|
-
const n = e, r = t, o = ref([]), s = reactive({}), i = (a) => a?.value || a?.id || a?.text || a, l = (a) => a.text || String(a),
|
|
2763
|
+
const n = e, r = t, o = ref([]), s = reactive({}), i = (a) => a?.value || a?.id || a?.text || a, l = (a) => a.text || String(a), u = (a) => `lg:col-span-${a || 12}`, c = async () => {
|
|
2747
2764
|
try {
|
|
2748
2765
|
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2749
2766
|
o.value = a?.data || a;
|
|
@@ -2781,7 +2798,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2781
2798
|
{ deep: !0 }
|
|
2782
2799
|
), onMounted(() => {
|
|
2783
2800
|
if (n.data)
|
|
2784
|
-
|
|
2801
|
+
c().then(() => {
|
|
2785
2802
|
if (typeof n.modelValue == "boolean" && o.value.length === 1) {
|
|
2786
2803
|
const a = i(o.value[0]);
|
|
2787
2804
|
s[a] = n.modelValue;
|
|
@@ -2814,7 +2831,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_rend
|
|
|
2814
2831
|
modelValue: s[i(f)],
|
|
2815
2832
|
"onUpdate:modelValue": (h) => s[i(f)] = h,
|
|
2816
2833
|
value: i(f),
|
|
2817
|
-
class: normalizeClass(
|
|
2834
|
+
class: normalizeClass(u(e.colSpan)),
|
|
2818
2835
|
disabled: f.disabled,
|
|
2819
2836
|
label: l(f),
|
|
2820
2837
|
key: i(f),
|
|
@@ -3035,7 +3052,7 @@ function _sfc_render(e, t) {
|
|
|
3035
3052
|
createElementVNode("path", { d: "M12 4l0 12" }, null, -1)
|
|
3036
3053
|
]));
|
|
3037
3054
|
}
|
|
3038
|
-
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render]]), _hoisted_1$1 = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-
|
|
3055
|
+
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render]]), _hoisted_1$1 = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, _hoisted_2$1 = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3039
3056
|
__name: "vs-input-file-list-item",
|
|
3040
3057
|
props: /* @__PURE__ */ mergeModels({
|
|
3041
3058
|
multiple: { type: Boolean }
|
|
@@ -3075,7 +3092,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3075
3092
|
])
|
|
3076
3093
|
]));
|
|
3077
3094
|
}
|
|
3078
|
-
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3095
|
+
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-98838521"]]), _hoisted_1 = { class: "flex items-center gap-x-2" }, _hoisted_2 = {
|
|
3079
3096
|
key: 1,
|
|
3080
3097
|
class: "flex items-center flex-wrap gap-2"
|
|
3081
3098
|
}, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
@@ -3092,14 +3109,14 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3092
3109
|
setup(e) {
|
|
3093
3110
|
const t = e, n = useModel(e, "modelValue"), r = ref(null), o = (i) => Array.isArray(n.value) && n.value[i] || "", s = async (i) => {
|
|
3094
3111
|
if (t.format) {
|
|
3095
|
-
const
|
|
3096
|
-
if (!
|
|
3112
|
+
const c = i.target.files?.[0];
|
|
3113
|
+
if (!c || !c.name.endsWith(t.format))
|
|
3097
3114
|
return;
|
|
3098
3115
|
}
|
|
3099
3116
|
const l = i.target.files?.[0];
|
|
3100
3117
|
if (!l) return;
|
|
3101
|
-
const
|
|
3102
|
-
n.value = t.multiple ? [...n.value || [],
|
|
3118
|
+
const u = await fileUpload(l, "1", "form", "table");
|
|
3119
|
+
n.value = t.multiple ? [...n.value || [], u.result?.file_path] : u.result?.file_path;
|
|
3103
3120
|
};
|
|
3104
3121
|
return (i, l) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
3105
3122
|
createElementVNode("input", {
|
|
@@ -3112,21 +3129,21 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3112
3129
|
!i.multiple && n.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
3113
3130
|
key: 0,
|
|
3114
3131
|
item: n.value,
|
|
3115
|
-
"onUpdate:item": l[0] || (l[0] = (
|
|
3132
|
+
"onUpdate:item": l[0] || (l[0] = (u) => n.value = u),
|
|
3116
3133
|
value: n.value,
|
|
3117
|
-
"onUpdate:value": l[1] || (l[1] = (
|
|
3134
|
+
"onUpdate:value": l[1] || (l[1] = (u) => n.value = u)
|
|
3118
3135
|
}, null, 8, ["item", "value"])) : i.multiple ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
3119
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (
|
|
3136
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (u, c) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
3120
3137
|
multiple: i.multiple,
|
|
3121
|
-
key:
|
|
3138
|
+
key: c,
|
|
3122
3139
|
value: n.value,
|
|
3123
3140
|
"onUpdate:value": l[2] || (l[2] = (a) => n.value = a),
|
|
3124
|
-
item: o(
|
|
3141
|
+
item: o(c)
|
|
3125
3142
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3126
3143
|
createElementVNode("div", {
|
|
3127
|
-
onClick: l[3] || (l[3] = (
|
|
3144
|
+
onClick: l[3] || (l[3] = (u) => !i.disabled && r.value?.click()),
|
|
3128
3145
|
class: normalizeClass([
|
|
3129
|
-
"h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-
|
|
3146
|
+
"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",
|
|
3130
3147
|
i.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
3131
3148
|
])
|
|
3132
3149
|
}, [
|
|
@@ -3135,7 +3152,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3135
3152
|
])) : createCommentVNode("", !0),
|
|
3136
3153
|
i.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
3137
3154
|
key: 2,
|
|
3138
|
-
onClick: l[4] || (l[4] = (
|
|
3155
|
+
onClick: l[4] || (l[4] = (u) => r.value?.click()),
|
|
3139
3156
|
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"])
|
|
3140
3157
|
}, [
|
|
3141
3158
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
@@ -3206,74 +3223,90 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_r
|
|
|
3206
3223
|
default:
|
|
3207
3224
|
return !1;
|
|
3208
3225
|
}
|
|
3226
|
+
}, mathTable = {
|
|
3227
|
+
autocomplete: "select",
|
|
3228
|
+
combobox: "select",
|
|
3229
|
+
email: "text",
|
|
3230
|
+
textarea: "text",
|
|
3231
|
+
datepicker: "text",
|
|
3232
|
+
markedtext: "text",
|
|
3233
|
+
mask: "text"
|
|
3209
3234
|
};
|
|
3235
|
+
function convertType(e) {
|
|
3236
|
+
const t = e.toLowerCase();
|
|
3237
|
+
return mathTable[t] || t;
|
|
3238
|
+
}
|
|
3239
|
+
function convertSchema(e) {
|
|
3240
|
+
if (Array.isArray(e)) return e;
|
|
3241
|
+
const t = [];
|
|
3242
|
+
return Object.entries(e).forEach((n) => {
|
|
3243
|
+
const r = { name: n[0], ...n[1], type: convertType(n[1].type) };
|
|
3244
|
+
n[1].data && (r.api = `/api/suggest/${n[1].data}`), t.push(r);
|
|
3245
|
+
}), t;
|
|
3246
|
+
}
|
|
3210
3247
|
function useForm(e, t) {
|
|
3211
|
-
const n = ref({}),
|
|
3212
|
-
if (
|
|
3213
|
-
c.rules && c.rules.forEach((
|
|
3214
|
-
|
|
3215
|
-
}), c.schema &&
|
|
3216
|
-
}),
|
|
3248
|
+
const n = convertSchema(t), r = ref({}), o = (l = n, u = !0) => {
|
|
3249
|
+
if (l.forEach((c) => {
|
|
3250
|
+
c.rules && c.rules.forEach((a) => {
|
|
3251
|
+
r.value[c.name] = checkFormRules(e.value[c.name], a);
|
|
3252
|
+
}), c.schema && o(c.schema, !1);
|
|
3253
|
+
}), u && Object.values(r.value).some(Boolean))
|
|
3217
3254
|
throw new Error("Помилка валідації");
|
|
3218
|
-
},
|
|
3219
|
-
const
|
|
3220
|
-
if (!
|
|
3221
|
-
const c = Array.isArray(
|
|
3222
|
-
return isVisible(
|
|
3255
|
+
}, s = computed(() => n?.filter((l) => {
|
|
3256
|
+
const u = l?.conditions;
|
|
3257
|
+
if (!u) return !0;
|
|
3258
|
+
const c = Array.isArray(u) ? u[0] : u, a = e?.value?.[c];
|
|
3259
|
+
return isVisible(a, u);
|
|
3223
3260
|
}));
|
|
3224
3261
|
return {
|
|
3225
|
-
errors:
|
|
3226
|
-
validate:
|
|
3262
|
+
errors: r,
|
|
3263
|
+
validate: o,
|
|
3227
3264
|
reset: () => {
|
|
3228
|
-
e.value = {},
|
|
3265
|
+
e.value = {}, r.value = {};
|
|
3229
3266
|
},
|
|
3230
|
-
visibleSchema:
|
|
3267
|
+
visibleSchema: s
|
|
3231
3268
|
};
|
|
3232
3269
|
}
|
|
3233
3270
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3234
3271
|
__name: "vs-compact-form",
|
|
3235
3272
|
props: /* @__PURE__ */ mergeModels({
|
|
3236
|
-
schema: {
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
},
|
|
3240
|
-
style: {
|
|
3241
|
-
type: Object,
|
|
3242
|
-
default: () => ({})
|
|
3243
|
-
}
|
|
3273
|
+
schema: { default: () => [] },
|
|
3274
|
+
style: { default: () => ({}) },
|
|
3275
|
+
layout: { default: () => "default" }
|
|
3244
3276
|
}, {
|
|
3245
3277
|
form: { default: () => ({}) },
|
|
3246
3278
|
formModifiers: {},
|
|
3247
|
-
|
|
3248
|
-
|
|
3279
|
+
values: { default: () => ({}) },
|
|
3280
|
+
valuesModifiers: {}
|
|
3249
3281
|
}),
|
|
3250
|
-
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:
|
|
3282
|
+
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3251
3283
|
setup(e, { emit: t }) {
|
|
3252
|
-
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"), i = useModel(e, "
|
|
3284
|
+
const n = t, r = e, o = useAttrs(), s = useModel(e, "form"), i = useModel(e, "values"), {
|
|
3253
3285
|
errors: l,
|
|
3254
|
-
validate:
|
|
3255
|
-
reset:
|
|
3286
|
+
validate: u,
|
|
3287
|
+
reset: c,
|
|
3256
3288
|
visibleSchema: a
|
|
3257
3289
|
} = useForm(i, r.schema), d = () => {
|
|
3258
|
-
|
|
3290
|
+
u(), n("handle-submit", i.value);
|
|
3259
3291
|
};
|
|
3260
3292
|
return onMounted(() => {
|
|
3261
|
-
s.value.value = i.value, s.value.errors = l.value, s.value.reset =
|
|
3262
|
-
}), provide("form", s), provide("
|
|
3293
|
+
s.value.value = i.value, s.value.errors = l.value, s.value.reset = c, s.value.validate = u;
|
|
3294
|
+
}), provide("form", s), provide("values", i), (f, h) => (openBlock(), createElementBlock("form", {
|
|
3263
3295
|
onSubmit: withModifiers(d, ["prevent"]),
|
|
3264
|
-
class: "grid grid-cols-12 gap-
|
|
3296
|
+
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3265
3297
|
}, [
|
|
3266
3298
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3267
3299
|
key: p.name,
|
|
3268
3300
|
class: `col-span-${p.col || 12} `
|
|
3269
|
-
}, { ref_for: !0 }, { ...unref(o), ...
|
|
3301
|
+
}, { ref_for: !0 }, { ...unref(o), ...f.style, ...p }, {
|
|
3270
3302
|
item: p,
|
|
3303
|
+
layout: f.layout,
|
|
3271
3304
|
modelValue: i.value[p.name],
|
|
3272
3305
|
"onUpdate:modelValue": (y) => i.value[p.name] = y,
|
|
3273
|
-
style:
|
|
3306
|
+
style: f.style,
|
|
3274
3307
|
error: unref(l)[p.name]
|
|
3275
|
-
}), null, 16, ["class", "item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3276
|
-
],
|
|
3308
|
+
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3309
|
+
], 34));
|
|
3277
3310
|
}
|
|
3278
3311
|
});
|
|
3279
3312
|
_sfc_main.install = function e(t) {
|