@opengis/form 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +972 -885
- package/dist/index.umd.cjs +4 -4
- package/package.json +60 -61
package/dist/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock,
|
|
2
|
-
const _hoisted_1$
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createCommentVNode, renderSlot, createElementVNode, toDisplayString, normalizeProps, guardReactiveProps, createTextVNode, computed, mergeModels, useModel, withDirectives, normalizeClass, unref, vModelText, vModelCheckbox, createVNode, ref, createBlock, resolveDynamicComponent, normalizeStyle, withCtx, withModifiers, vModelRadio, Fragment, renderList, mergeProps, reactive, watch, onMounted, createStaticVNode, Transition, vShow, inject, nextTick, onUnmounted, Teleport, useAttrs, provide } from "vue";
|
|
2
|
+
const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
3
3
|
key: 0,
|
|
4
|
-
class: "text-
|
|
5
|
-
},
|
|
4
|
+
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
5
|
+
}, _hoisted_3$6 = {
|
|
6
6
|
key: 0,
|
|
7
|
+
class: "text-red-500 text-[14px]"
|
|
8
|
+
}, _hoisted_4$5 = {
|
|
9
|
+
key: 1,
|
|
7
10
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
8
|
-
}, _sfc_main$
|
|
11
|
+
}, _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
9
12
|
__name: "vs-layout-default",
|
|
10
13
|
props: {
|
|
11
14
|
ua: {
|
|
@@ -26,22 +29,25 @@ const _hoisted_1$x = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
26
29
|
}
|
|
27
30
|
},
|
|
28
31
|
setup(e) {
|
|
29
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
30
|
-
|
|
32
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
33
|
+
e.ua || e.label ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
|
|
31
34
|
createElementVNode("span", null, toDisplayString(e.ua || e.label), 1),
|
|
32
|
-
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
33
|
-
]),
|
|
35
|
+
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$6, "*")) : createCommentVNode("", !0)
|
|
36
|
+
])) : createCommentVNode("", !0),
|
|
34
37
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
35
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
38
|
+
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$5, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
36
39
|
]));
|
|
37
40
|
}
|
|
38
|
-
}), _hoisted_1$
|
|
41
|
+
}), _hoisted_1$y = { class: "w-full relative flex flex-row items-center gap-2" }, _hoisted_2$b = {
|
|
39
42
|
key: 0,
|
|
40
|
-
class: "text-
|
|
41
|
-
},
|
|
43
|
+
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12"
|
|
44
|
+
}, _hoisted_3$5 = {
|
|
42
45
|
key: 0,
|
|
46
|
+
class: "text-red-500 text-[14px]"
|
|
47
|
+
}, _hoisted_4$4 = {
|
|
48
|
+
key: 1,
|
|
43
49
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
44
|
-
}, _sfc_main$
|
|
50
|
+
}, _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
45
51
|
__name: "vs-layout-horizontal",
|
|
46
52
|
props: {
|
|
47
53
|
ua: {
|
|
@@ -62,19 +68,19 @@ const _hoisted_1$x = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
62
68
|
}
|
|
63
69
|
},
|
|
64
70
|
setup(e) {
|
|
65
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
66
|
-
|
|
71
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
72
|
+
e.item?.type !== "html" ? (openBlock(), createElementBlock("span", _hoisted_2$b, [
|
|
67
73
|
createTextVNode(toDisplayString(e.ua || e.label) + " ", 1),
|
|
68
|
-
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
69
|
-
]),
|
|
74
|
+
e.item?.rules?.includes("required") && (e.ua || e.label) ? (openBlock(), createElementBlock("span", _hoisted_3$5, "*")) : createCommentVNode("", !0)
|
|
75
|
+
])) : createCommentVNode("", !0),
|
|
70
76
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
71
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
77
|
+
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
72
78
|
]));
|
|
73
79
|
}
|
|
74
|
-
}), _hoisted_1$
|
|
80
|
+
}), _hoisted_1$x = { class: "w-full relative" }, _hoisted_2$a = {
|
|
75
81
|
key: 0,
|
|
76
82
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
77
|
-
}, _sfc_main$
|
|
83
|
+
}, _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
78
84
|
__name: "vs-layout-inline",
|
|
79
85
|
props: {
|
|
80
86
|
ua: {
|
|
@@ -95,15 +101,15 @@ const _hoisted_1$x = { class: "w-full relative" }, _hoisted_2$b = { class: "text
|
|
|
95
101
|
}
|
|
96
102
|
},
|
|
97
103
|
setup(e) {
|
|
98
|
-
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
104
|
+
return (t, n) => (openBlock(), createElementBlock("div", _hoisted_1$x, [
|
|
99
105
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
100
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
106
|
+
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$a, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
101
107
|
]));
|
|
102
108
|
}
|
|
103
109
|
}), layouts$1 = {
|
|
104
|
-
default: _sfc_main$
|
|
105
|
-
horizontal: _sfc_main$
|
|
106
|
-
inline: _sfc_main$
|
|
110
|
+
default: _sfc_main$E,
|
|
111
|
+
horizontal: _sfc_main$D,
|
|
112
|
+
inline: _sfc_main$C
|
|
107
113
|
};
|
|
108
114
|
function useStyle(e) {
|
|
109
115
|
return {
|
|
@@ -113,7 +119,7 @@ function useStyle(e) {
|
|
|
113
119
|
})
|
|
114
120
|
};
|
|
115
121
|
}
|
|
116
|
-
const _hoisted_1$
|
|
122
|
+
const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
117
123
|
__name: "vs-input-text",
|
|
118
124
|
props: /* @__PURE__ */ mergeModels({
|
|
119
125
|
style: {
|
|
@@ -131,6 +137,10 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
131
137
|
disabled: {
|
|
132
138
|
type: Boolean,
|
|
133
139
|
default: !1
|
|
140
|
+
},
|
|
141
|
+
error: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: null
|
|
134
144
|
}
|
|
135
145
|
}, {
|
|
136
146
|
modelValue: { default: "" },
|
|
@@ -138,21 +148,21 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
138
148
|
}),
|
|
139
149
|
emits: ["update:modelValue"],
|
|
140
150
|
setup(e) {
|
|
141
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
142
|
-
return (
|
|
151
|
+
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
152
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
143
153
|
type: "text",
|
|
144
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
154
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
145
155
|
placeholder: e.placeholder,
|
|
146
156
|
disabled: e.disabled,
|
|
147
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
157
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n), { "!border-red-600": e.error }]]),
|
|
148
158
|
style: {
|
|
149
159
|
border: "1px solid #CFD9E0"
|
|
150
160
|
}
|
|
151
|
-
}, null, 10, _hoisted_1$
|
|
152
|
-
[vModelText,
|
|
161
|
+
}, null, 10, _hoisted_1$w)), [
|
|
162
|
+
[vModelText, o.value]
|
|
153
163
|
]);
|
|
154
164
|
}
|
|
155
|
-
}), _hoisted_1$
|
|
165
|
+
}), _hoisted_1$v = ["placeholder"], _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
156
166
|
__name: "vs-input-number",
|
|
157
167
|
props: /* @__PURE__ */ mergeModels({
|
|
158
168
|
style: {
|
|
@@ -169,22 +179,313 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
169
179
|
}),
|
|
170
180
|
emits: ["update:modelValue"],
|
|
171
181
|
setup(e) {
|
|
172
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
173
|
-
return (
|
|
182
|
+
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
183
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
174
184
|
type: "number",
|
|
175
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
185
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
176
186
|
placeholder: e.placeholder,
|
|
177
187
|
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(n)]]),
|
|
178
188
|
style: {
|
|
179
189
|
border: "1px solid #CFD9E0"
|
|
180
190
|
}
|
|
181
|
-
}, null, 10, _hoisted_1$
|
|
182
|
-
[vModelText,
|
|
191
|
+
}, null, 10, _hoisted_1$v)), [
|
|
192
|
+
[vModelText, o.value]
|
|
183
193
|
]);
|
|
184
194
|
}
|
|
185
|
-
}),
|
|
195
|
+
}), _export_sfc = (e, t) => {
|
|
196
|
+
const n = e.__vccOpts || e;
|
|
197
|
+
for (const [o, r] of t)
|
|
198
|
+
n[o] = r;
|
|
199
|
+
return n;
|
|
200
|
+
}, _sfc_main$z = {}, _hoisted_1$u = {
|
|
201
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
202
|
+
viewBox: "0 0 24 24",
|
|
203
|
+
fill: "none",
|
|
204
|
+
stroke: "currentColor",
|
|
205
|
+
"stroke-width": "4",
|
|
206
|
+
"stroke-linecap": "round",
|
|
207
|
+
"stroke-linejoin": "round",
|
|
208
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
209
|
+
};
|
|
210
|
+
function _sfc_render$d(e, t) {
|
|
211
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$u, t[0] || (t[0] = [
|
|
212
|
+
createElementVNode("path", {
|
|
213
|
+
stroke: "none",
|
|
214
|
+
d: "M0 0h24v24H0z",
|
|
215
|
+
fill: "none"
|
|
216
|
+
}, null, -1),
|
|
217
|
+
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
218
|
+
]));
|
|
219
|
+
}
|
|
220
|
+
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$d]]), _hoisted_1$t = { class: "flex items-center gap-[4px]" }, _hoisted_2$9 = ["value", "id", "disabled"], _hoisted_3$4 = ["for"], _hoisted_4$3 = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
221
|
+
__name: "vs-checkbox-default",
|
|
222
|
+
props: {
|
|
223
|
+
value: { type: [String, Number], default: "" },
|
|
224
|
+
label: { type: [String, Number], default: "" },
|
|
225
|
+
disabled: { type: Boolean, default: !1 },
|
|
226
|
+
id: { type: [String, Number] },
|
|
227
|
+
modelValue: Boolean,
|
|
228
|
+
info: { type: String, default: () => "" },
|
|
229
|
+
error: { type: String, default: () => null }
|
|
230
|
+
},
|
|
231
|
+
emits: ["update:modelValue"],
|
|
232
|
+
setup(e, { emit: t }) {
|
|
233
|
+
const n = t, o = e, r = computed({
|
|
234
|
+
get: () => o.modelValue,
|
|
235
|
+
set: (s) => n("update:modelValue", s)
|
|
236
|
+
});
|
|
237
|
+
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
238
|
+
withDirectives(createElementVNode("input", {
|
|
239
|
+
type: "checkbox",
|
|
240
|
+
value: e.value,
|
|
241
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => r.value = i),
|
|
242
|
+
class: normalizeClass(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": e.disabled }]),
|
|
243
|
+
id: e.id,
|
|
244
|
+
disabled: e.disabled
|
|
245
|
+
}, null, 10, _hoisted_2$9), [
|
|
246
|
+
[vModelCheckbox, r.value]
|
|
247
|
+
]),
|
|
248
|
+
createElementVNode("label", {
|
|
249
|
+
for: e.id,
|
|
250
|
+
class: normalizeClass(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": e.disabled }])
|
|
251
|
+
}, [
|
|
252
|
+
createElementVNode("div", {
|
|
253
|
+
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [r.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", e.error ? "border-red-600" : ""]])
|
|
254
|
+
}, [
|
|
255
|
+
createVNode(IconCheck, {
|
|
256
|
+
height: "12",
|
|
257
|
+
width: "12"
|
|
258
|
+
})
|
|
259
|
+
], 2),
|
|
260
|
+
createElementVNode("span", _hoisted_4$3, [
|
|
261
|
+
renderSlot(s.$slots, "default", {}, () => [
|
|
262
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
263
|
+
])
|
|
264
|
+
])
|
|
265
|
+
], 10, _hoisted_3$4)
|
|
266
|
+
]));
|
|
267
|
+
}
|
|
268
|
+
}), _hoisted_1$s = ["name", "value", "disabled"], _hoisted_2$8 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3$3 = {
|
|
269
|
+
key: 0,
|
|
270
|
+
class: "text-[16px]"
|
|
271
|
+
}, _hoisted_4$2 = ["src"], _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
272
|
+
__name: "vs-checkbox-buttons",
|
|
273
|
+
props: {
|
|
274
|
+
value: { type: [String, Number, Boolean], default: "" },
|
|
275
|
+
label: { type: [String, Number], default: "" },
|
|
276
|
+
modelValue: {
|
|
277
|
+
type: [Array, String, Boolean],
|
|
278
|
+
default: ""
|
|
279
|
+
},
|
|
280
|
+
disabled: { type: Boolean, default: !1 },
|
|
281
|
+
id: { type: [String, Number] },
|
|
282
|
+
icon: { type: String },
|
|
283
|
+
imgUrl: { type: String },
|
|
284
|
+
style: { type: Object, default: () => null }
|
|
285
|
+
},
|
|
286
|
+
emits: ["update:modelValue"],
|
|
287
|
+
setup(e, { emit: t }) {
|
|
288
|
+
const n = e, o = t, r = computed({
|
|
289
|
+
get: () => n.modelValue,
|
|
290
|
+
set: (i) => {
|
|
291
|
+
o("update:modelValue", i);
|
|
292
|
+
}
|
|
293
|
+
}), s = computed(() => Array.isArray(r.value) ? r.value.includes(n.value) : r.value === !0 || r.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");
|
|
294
|
+
return (i, u) => (openBlock(), createElementBlock("label", {
|
|
295
|
+
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"]])
|
|
296
|
+
}, [
|
|
297
|
+
withDirectives(createElementVNode("input", {
|
|
298
|
+
type: "checkbox",
|
|
299
|
+
class: "hidden",
|
|
300
|
+
name: e.id,
|
|
301
|
+
value: e.value,
|
|
302
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
303
|
+
disabled: e.disabled
|
|
304
|
+
}, null, 8, _hoisted_1$s), [
|
|
305
|
+
[vModelCheckbox, r.value]
|
|
306
|
+
]),
|
|
307
|
+
createElementVNode("span", _hoisted_2$8, [
|
|
308
|
+
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$3, [
|
|
309
|
+
e.icon ? (openBlock(), createElementBlock("i", {
|
|
310
|
+
key: 0,
|
|
311
|
+
class: normalizeClass(e.icon)
|
|
312
|
+
}, null, 2)) : createCommentVNode("", !0),
|
|
313
|
+
e.imgUrl ? (openBlock(), createElementBlock("img", {
|
|
314
|
+
key: 1,
|
|
315
|
+
src: e.imgUrl,
|
|
316
|
+
width: "16",
|
|
317
|
+
height: "16",
|
|
318
|
+
alt: "icon"
|
|
319
|
+
}, null, 8, _hoisted_4$2)) : createCommentVNode("", !0)
|
|
320
|
+
])) : createCommentVNode("", !0),
|
|
321
|
+
renderSlot(i.$slots, "default", {}, () => [
|
|
322
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
323
|
+
])
|
|
324
|
+
])
|
|
325
|
+
], 2));
|
|
326
|
+
}
|
|
327
|
+
}), VsCheckboxViews = {
|
|
328
|
+
"vs-checkbox-default": _sfc_main$y,
|
|
329
|
+
"vs-checkbox-buttons": _sfc_main$x
|
|
330
|
+
}, _hoisted_1$r = { class: "flex items-center" }, _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
331
|
+
__name: "vs-input-checkbox-item",
|
|
332
|
+
props: {
|
|
333
|
+
value: { type: [String, Number], default: "" },
|
|
334
|
+
label: { type: [String, Number], default: "" },
|
|
335
|
+
disabled: { type: Boolean, default: !1 },
|
|
336
|
+
view: { type: String, default: () => "default" },
|
|
337
|
+
modelValue: {
|
|
338
|
+
type: [Array, Boolean],
|
|
339
|
+
default: !1
|
|
340
|
+
},
|
|
341
|
+
icon: { type: String },
|
|
342
|
+
imgUrl: { type: String },
|
|
343
|
+
slots: { type: Object, default: () => null },
|
|
344
|
+
option: { type: [Object, String] },
|
|
345
|
+
style: { type: String, default: () => null },
|
|
346
|
+
error: { type: String, default: () => null }
|
|
347
|
+
},
|
|
348
|
+
emits: ["update:modelValue"],
|
|
349
|
+
setup(e, { emit: t }) {
|
|
350
|
+
const n = e, o = t, r = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
351
|
+
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
352
|
+
set: (i) => {
|
|
353
|
+
if (Array.isArray(n.modelValue)) {
|
|
354
|
+
let u = [...n.modelValue];
|
|
355
|
+
i ? u.includes(n.value) || u.push(n.value) : u = u.filter((c) => c !== n.value), o("update:modelValue", u);
|
|
356
|
+
} else
|
|
357
|
+
o("update:modelValue", i);
|
|
358
|
+
}
|
|
359
|
+
}), l = ref(`vs-checkbox-${n.view || "default"}`);
|
|
360
|
+
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
361
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[l.value]), {
|
|
362
|
+
value: e.value,
|
|
363
|
+
label: e.label,
|
|
364
|
+
info: e.option?.info,
|
|
365
|
+
disabled: e.disabled,
|
|
366
|
+
modelValue: s.value,
|
|
367
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
368
|
+
id: r,
|
|
369
|
+
icon: e.icon,
|
|
370
|
+
imgUrl: e.imgUrl,
|
|
371
|
+
style: normalizeStyle(e.style),
|
|
372
|
+
error: e.error
|
|
373
|
+
}, {
|
|
374
|
+
default: withCtx(() => [
|
|
375
|
+
createTextVNode(toDisplayString(e.label), 1)
|
|
376
|
+
]),
|
|
377
|
+
_: 1
|
|
378
|
+
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
379
|
+
]));
|
|
380
|
+
}
|
|
381
|
+
}), _sfc_main$v = {}, _hoisted_1$q = {
|
|
382
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
383
|
+
viewBox: "0 0 24 24",
|
|
384
|
+
fill: "none",
|
|
385
|
+
stroke: "currentColor",
|
|
386
|
+
"stroke-width": "2",
|
|
387
|
+
"stroke-linecap": "round",
|
|
388
|
+
"stroke-linejoin": "round",
|
|
389
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
390
|
+
};
|
|
391
|
+
function _sfc_render$c(e, t) {
|
|
392
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$q, t[0] || (t[0] = [
|
|
393
|
+
createElementVNode("path", {
|
|
394
|
+
stroke: "none",
|
|
395
|
+
d: "M0 0h24v24H0z",
|
|
396
|
+
fill: "none"
|
|
397
|
+
}, null, -1),
|
|
398
|
+
createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
399
|
+
]));
|
|
400
|
+
}
|
|
401
|
+
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$c]]), _sfc_main$u = {}, _hoisted_1$p = {
|
|
402
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
403
|
+
viewBox: "0 0 24 24",
|
|
404
|
+
fill: "none",
|
|
405
|
+
stroke: "currentColor",
|
|
406
|
+
"stroke-width": "2",
|
|
407
|
+
"stroke-linecap": "round",
|
|
408
|
+
"stroke-linejoin": "round"
|
|
409
|
+
};
|
|
410
|
+
function _sfc_render$b(e, t) {
|
|
411
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$p, t[0] || (t[0] = [
|
|
412
|
+
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
413
|
+
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
414
|
+
]));
|
|
415
|
+
}
|
|
416
|
+
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$b]]), _sfc_main$t = {}, _hoisted_1$o = {
|
|
417
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
418
|
+
viewBox: "0 0 24 24",
|
|
419
|
+
fill: "none",
|
|
420
|
+
stroke: "currentColor",
|
|
421
|
+
"stroke-width": "2",
|
|
422
|
+
"stroke-linecap": "round",
|
|
423
|
+
"stroke-linejoin": "round",
|
|
424
|
+
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
425
|
+
};
|
|
426
|
+
function _sfc_render$a(e, t) {
|
|
427
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$o, t[0] || (t[0] = [
|
|
428
|
+
createElementVNode("path", {
|
|
429
|
+
stroke: "none",
|
|
430
|
+
d: "M0 0h24v24H0z",
|
|
431
|
+
fill: "none"
|
|
432
|
+
}, null, -1),
|
|
433
|
+
createElementVNode("path", { d: "M18 6l-12 12" }, null, -1),
|
|
434
|
+
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
435
|
+
]));
|
|
436
|
+
}
|
|
437
|
+
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$a]]), _sfc_main$s = {}, _hoisted_1$n = {
|
|
438
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
439
|
+
width: "24",
|
|
440
|
+
height: "24",
|
|
441
|
+
viewBox: "0 0 24 24",
|
|
442
|
+
fill: "none",
|
|
443
|
+
stroke: "currentColor",
|
|
444
|
+
"stroke-width": "2",
|
|
445
|
+
"stroke-linecap": "round",
|
|
446
|
+
"stroke-linejoin": "round"
|
|
447
|
+
};
|
|
448
|
+
function _sfc_render$9(e, t) {
|
|
449
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$n, t[0] || (t[0] = [
|
|
450
|
+
createElementVNode("path", {
|
|
451
|
+
stroke: "none",
|
|
452
|
+
d: "M0 0h24v24H0z",
|
|
453
|
+
fill: "none"
|
|
454
|
+
}, null, -1),
|
|
455
|
+
createElementVNode("path", { d: "M12 9h.01" }, null, -1),
|
|
456
|
+
createElementVNode("path", { d: "M11 12h1v4h1" }, null, -1),
|
|
457
|
+
createElementVNode("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
|
|
458
|
+
]));
|
|
459
|
+
}
|
|
460
|
+
const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$9]]), _hoisted_1$m = {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: "flex items-start gap-x-1"
|
|
463
|
+
}, _hoisted_2$7 = {
|
|
464
|
+
key: 0,
|
|
465
|
+
class: "text-red-500 text-[14px]"
|
|
466
|
+
}, _hoisted_3$2 = ["title"], _hoisted_4$1 = ["disabled"], _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
186
467
|
__name: "vs-input-switcher",
|
|
187
468
|
props: /* @__PURE__ */ mergeModels({
|
|
469
|
+
view: {
|
|
470
|
+
type: String,
|
|
471
|
+
default: "switch"
|
|
472
|
+
},
|
|
473
|
+
label: {
|
|
474
|
+
type: String,
|
|
475
|
+
default: ""
|
|
476
|
+
},
|
|
477
|
+
rules: {
|
|
478
|
+
type: Array,
|
|
479
|
+
default: () => []
|
|
480
|
+
},
|
|
481
|
+
i: {
|
|
482
|
+
type: String,
|
|
483
|
+
default: ""
|
|
484
|
+
},
|
|
485
|
+
text: {
|
|
486
|
+
type: String,
|
|
487
|
+
default: ""
|
|
488
|
+
},
|
|
188
489
|
style: {
|
|
189
490
|
type: Object,
|
|
190
491
|
default: () => ({})
|
|
@@ -196,6 +497,10 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
196
497
|
customClass: {
|
|
197
498
|
type: String,
|
|
198
499
|
default: ""
|
|
500
|
+
},
|
|
501
|
+
error: {
|
|
502
|
+
type: String,
|
|
503
|
+
default: ""
|
|
199
504
|
}
|
|
200
505
|
}, {
|
|
201
506
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -204,19 +509,37 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
204
509
|
emits: ["update:modelValue"],
|
|
205
510
|
setup(e) {
|
|
206
511
|
const t = useModel(e, "modelValue");
|
|
207
|
-
return (n,
|
|
512
|
+
return (n, o) => e.view === "checkbox" ? (openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
513
|
+
createVNode(_sfc_main$w, {
|
|
514
|
+
modelValue: t.value,
|
|
515
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
516
|
+
label: e.text,
|
|
517
|
+
error: e.error
|
|
518
|
+
}, null, 8, ["modelValue", "label", "error"]),
|
|
519
|
+
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$7, "*")) : createCommentVNode("", !0),
|
|
520
|
+
e.i ? (openBlock(), createElementBlock("button", {
|
|
521
|
+
key: 1,
|
|
522
|
+
class: "cursor-pointer",
|
|
523
|
+
title: e.i,
|
|
524
|
+
onClick: o[1] || (o[1] = withModifiers(() => {
|
|
525
|
+
}, ["prevent"]))
|
|
526
|
+
}, [
|
|
527
|
+
createVNode(unref(IconInfo), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
528
|
+
], 8, _hoisted_3$2)) : createCommentVNode("", !0)
|
|
529
|
+
])) : (openBlock(), createElementBlock("button", {
|
|
530
|
+
key: 1,
|
|
208
531
|
type: "button",
|
|
209
532
|
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
533
|
disabled: e.disabled,
|
|
211
|
-
onClick:
|
|
534
|
+
onClick: o[2] || (o[2] = (r) => t.value = !t.value)
|
|
212
535
|
}, [
|
|
213
536
|
createElementVNode("span", {
|
|
214
537
|
"data-state": "checked",
|
|
215
538
|
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
539
|
}, null, 2)
|
|
217
|
-
], 10,
|
|
540
|
+
], 10, _hoisted_4$1));
|
|
218
541
|
}
|
|
219
|
-
}), _hoisted_1$
|
|
542
|
+
}), _hoisted_1$l = ["innerHTML"], _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
220
543
|
__name: "vs-input-static",
|
|
221
544
|
props: {
|
|
222
545
|
html: {
|
|
@@ -232,9 +555,9 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
232
555
|
return (t, n) => (openBlock(), createElementBlock("div", {
|
|
233
556
|
class: normalizeClass(e.customClass),
|
|
234
557
|
innerHTML: e.html
|
|
235
|
-
}, null, 10, _hoisted_1$
|
|
558
|
+
}, null, 10, _hoisted_1$l));
|
|
236
559
|
}
|
|
237
|
-
}), _hoisted_1$
|
|
560
|
+
}), _hoisted_1$k = ["placeholder", "disabled"], _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
238
561
|
__name: "vs-input-mask",
|
|
239
562
|
props: /* @__PURE__ */ mergeModels({
|
|
240
563
|
style: {
|
|
@@ -259,21 +582,37 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
259
582
|
}),
|
|
260
583
|
emits: ["update:modelValue"],
|
|
261
584
|
setup(e) {
|
|
262
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
263
|
-
return (
|
|
585
|
+
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
586
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
264
587
|
type: "text",
|
|
265
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
588
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
266
589
|
placeholder: e.placeholder,
|
|
267
590
|
disabled: e.disabled,
|
|
268
591
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
269
592
|
style: {
|
|
270
593
|
border: "1px solid #CFD9E0"
|
|
271
594
|
}
|
|
272
|
-
}, null, 10, _hoisted_1$
|
|
273
|
-
[vModelText,
|
|
595
|
+
}, null, 10, _hoisted_1$k)), [
|
|
596
|
+
[vModelText, o.value]
|
|
274
597
|
]);
|
|
275
598
|
}
|
|
276
|
-
}), _hoisted_1$
|
|
599
|
+
}), _hoisted_1$j = ["innerHTML"], _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
600
|
+
__name: "vs-input-html",
|
|
601
|
+
props: {
|
|
602
|
+
text: {
|
|
603
|
+
type: String,
|
|
604
|
+
default: ""
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
setup(e) {
|
|
608
|
+
const t = e;
|
|
609
|
+
return (n, o) => (openBlock(), createElementBlock("div", null, [
|
|
610
|
+
createElementVNode("div", {
|
|
611
|
+
innerHTML: t?.text
|
|
612
|
+
}, null, 8, _hoisted_1$j)
|
|
613
|
+
]));
|
|
614
|
+
}
|
|
615
|
+
}), _hoisted_1$i = ["value", "disabled"], _hoisted_2$6 = { class: "text-[13px] text-gray-700" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
277
616
|
__name: "vs-input-radio-default",
|
|
278
617
|
props: /* @__PURE__ */ mergeModels({
|
|
279
618
|
text: {
|
|
@@ -303,16 +642,16 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
303
642
|
emits: ["update:modelValue"],
|
|
304
643
|
setup(e) {
|
|
305
644
|
const t = useModel(e, "modelValue");
|
|
306
|
-
return (n,
|
|
645
|
+
return (n, o) => (openBlock(), createElementBlock("label", {
|
|
307
646
|
class: normalizeClass(["flex items-center gap-0", [e.customClass]])
|
|
308
647
|
}, [
|
|
309
648
|
withDirectives(createElementVNode("input", {
|
|
310
|
-
"onUpdate:modelValue":
|
|
649
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
311
650
|
type: "radio",
|
|
312
651
|
value: e.value,
|
|
313
652
|
disabled: e.disabled,
|
|
314
653
|
class: "hidden"
|
|
315
|
-
}, null, 8, _hoisted_1$
|
|
654
|
+
}, null, 8, _hoisted_1$i), [
|
|
316
655
|
[vModelRadio, t.value]
|
|
317
656
|
]),
|
|
318
657
|
createElementVNode("span", {
|
|
@@ -326,10 +665,10 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
326
665
|
class: normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${e.style?.primaryColor || "blue"}-500`]])
|
|
327
666
|
}, null, 2)) : createCommentVNode("", !0)
|
|
328
667
|
], 2),
|
|
329
|
-
createElementVNode("span", _hoisted_2$
|
|
668
|
+
createElementVNode("span", _hoisted_2$6, toDisplayString(e.text), 1)
|
|
330
669
|
], 2));
|
|
331
670
|
}
|
|
332
|
-
}), _hoisted_1$
|
|
671
|
+
}), _hoisted_1$h = ["value", "disabled"], _hoisted_2$5 = { class: "text-[13px] text-gray-700" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
333
672
|
__name: "vs-input-radio-buttons",
|
|
334
673
|
props: /* @__PURE__ */ mergeModels({
|
|
335
674
|
text: {
|
|
@@ -359,28 +698,28 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
359
698
|
emits: ["update:modelValue"],
|
|
360
699
|
setup(e) {
|
|
361
700
|
const t = useModel(e, "modelValue");
|
|
362
|
-
return (n,
|
|
701
|
+
return (n, o) => (openBlock(), createElementBlock("label", {
|
|
363
702
|
class: normalizeClass(["flex items-center border rounded-lg px-2 py-1", [
|
|
364
703
|
t.value == e.value ? `ring-2 ring-ring ring-${e.style?.primaryColor || "blue"}-500` : "",
|
|
365
704
|
e.customClass
|
|
366
705
|
]])
|
|
367
706
|
}, [
|
|
368
707
|
withDirectives(createElementVNode("input", {
|
|
369
|
-
"onUpdate:modelValue":
|
|
708
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
370
709
|
type: "radio",
|
|
371
710
|
value: e.value,
|
|
372
711
|
disabled: e.disabled,
|
|
373
712
|
class: "hidden"
|
|
374
|
-
}, null, 8, _hoisted_1$
|
|
713
|
+
}, null, 8, _hoisted_1$h), [
|
|
375
714
|
[vModelRadio, t.value]
|
|
376
715
|
]),
|
|
377
|
-
createElementVNode("span", _hoisted_2$
|
|
716
|
+
createElementVNode("span", _hoisted_2$5, toDisplayString(e.text), 1)
|
|
378
717
|
], 2));
|
|
379
718
|
}
|
|
380
719
|
}), layouts = {
|
|
381
|
-
"vs-input-radio-default": _sfc_main$
|
|
382
|
-
"vs-input-radio-buttons": _sfc_main$
|
|
383
|
-
}, _sfc_main$
|
|
720
|
+
"vs-input-radio-default": _sfc_main$n,
|
|
721
|
+
"vs-input-radio-buttons": _sfc_main$m
|
|
722
|
+
}, _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
384
723
|
__name: "vs-input-radio",
|
|
385
724
|
props: /* @__PURE__ */ mergeModels({
|
|
386
725
|
options: {
|
|
@@ -401,18 +740,18 @@ const _hoisted_1$u = ["placeholder", "disabled"], _sfc_main$z = /* @__PURE__ */
|
|
|
401
740
|
}),
|
|
402
741
|
emits: ["update:modelValue"],
|
|
403
742
|
setup(e) {
|
|
404
|
-
const t = e, n = useModel(e, "modelValue"),
|
|
405
|
-
return (
|
|
743
|
+
const t = e, n = useModel(e, "modelValue"), o = computed(() => layouts[`vs-input-radio-${t.view}`]);
|
|
744
|
+
return (r, s) => (openBlock(), createElementBlock("div", {
|
|
406
745
|
class: normalizeClass([e.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
407
746
|
}, [
|
|
408
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(
|
|
747
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps({
|
|
409
748
|
key: l?.id,
|
|
410
749
|
text: l.text,
|
|
411
750
|
value: l.id.toString(),
|
|
412
751
|
checked: n.value === l.id,
|
|
413
752
|
modelValue: n.value,
|
|
414
753
|
"onUpdate:modelValue": s[0] || (s[0] = (i) => n.value = i)
|
|
415
|
-
}, { ref_for: !0 },
|
|
754
|
+
}, { ref_for: !0 }, r.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
416
755
|
], 2));
|
|
417
756
|
}
|
|
418
757
|
});
|
|
@@ -438,14 +777,6 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
438
777
|
return !1;
|
|
439
778
|
const t = getPrototypeOf(e);
|
|
440
779
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(toStringTag in e) && !(iterator in e);
|
|
441
|
-
}, isEmptyObject = (e) => {
|
|
442
|
-
if (!isObject(e) || isBuffer(e))
|
|
443
|
-
return !1;
|
|
444
|
-
try {
|
|
445
|
-
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
446
|
-
} catch {
|
|
447
|
-
return !1;
|
|
448
|
-
}
|
|
449
780
|
}, isDate = kindOfTest("Date"), isFile = kindOfTest("File"), isBlob = kindOfTest("Blob"), isFileList = kindOfTest("FileList"), isStream = (e) => isObject(e) && isFunction(e.pipe), isFormData = (e) => {
|
|
450
781
|
let t;
|
|
451
782
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
@@ -454,60 +785,56 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
454
785
|
function forEach(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
455
786
|
if (e === null || typeof e > "u")
|
|
456
787
|
return;
|
|
457
|
-
let
|
|
788
|
+
let o, r;
|
|
458
789
|
if (typeof e != "object" && (e = [e]), isArray(e))
|
|
459
|
-
for (
|
|
460
|
-
t.call(null, e[
|
|
790
|
+
for (o = 0, r = e.length; o < r; o++)
|
|
791
|
+
t.call(null, e[o], o, e);
|
|
461
792
|
else {
|
|
462
|
-
if (isBuffer(e))
|
|
463
|
-
return;
|
|
464
793
|
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length;
|
|
465
794
|
let i;
|
|
466
|
-
for (
|
|
467
|
-
i = s[
|
|
795
|
+
for (o = 0; o < l; o++)
|
|
796
|
+
i = s[o], t.call(null, e[i], i, e);
|
|
468
797
|
}
|
|
469
798
|
}
|
|
470
799
|
function findKey(e, t) {
|
|
471
|
-
if (isBuffer(e))
|
|
472
|
-
return null;
|
|
473
800
|
t = t.toLowerCase();
|
|
474
801
|
const n = Object.keys(e);
|
|
475
|
-
let
|
|
476
|
-
for (;
|
|
477
|
-
if (
|
|
478
|
-
return
|
|
802
|
+
let o = n.length, r;
|
|
803
|
+
for (; o-- > 0; )
|
|
804
|
+
if (r = n[o], t === r.toLowerCase())
|
|
805
|
+
return r;
|
|
479
806
|
return null;
|
|
480
807
|
}
|
|
481
808
|
const _global = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, isContextDefined = (e) => !isUndefined(e) && e !== _global;
|
|
482
809
|
function merge() {
|
|
483
|
-
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, n = (
|
|
484
|
-
const s = e && findKey(t,
|
|
485
|
-
isPlainObject(t[s]) && isPlainObject(
|
|
810
|
+
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, n = (o, r) => {
|
|
811
|
+
const s = e && findKey(t, r) || r;
|
|
812
|
+
isPlainObject(t[s]) && isPlainObject(o) ? t[s] = merge(t[s], o) : isPlainObject(o) ? t[s] = merge({}, o) : isArray(o) ? t[s] = o.slice() : t[s] = o;
|
|
486
813
|
};
|
|
487
|
-
for (let
|
|
488
|
-
arguments[
|
|
814
|
+
for (let o = 0, r = arguments.length; o < r; o++)
|
|
815
|
+
arguments[o] && forEach(arguments[o], n);
|
|
489
816
|
return t;
|
|
490
817
|
}
|
|
491
|
-
const extend = (e, t, n, { allOwnKeys:
|
|
492
|
-
n && isFunction(
|
|
493
|
-
}, { allOwnKeys:
|
|
494
|
-
e.prototype = Object.create(t.prototype,
|
|
818
|
+
const extend = (e, t, n, { allOwnKeys: o } = {}) => (forEach(t, (r, s) => {
|
|
819
|
+
n && isFunction(r) ? e[s] = bind(r, n) : e[s] = r;
|
|
820
|
+
}, { allOwnKeys: o }), e), stripBOM = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), inherits = (e, t, n, o) => {
|
|
821
|
+
e.prototype = Object.create(t.prototype, o), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
495
822
|
value: t.prototype
|
|
496
823
|
}), n && Object.assign(e.prototype, n);
|
|
497
|
-
}, toFlatObject = (e, t, n,
|
|
498
|
-
let
|
|
824
|
+
}, toFlatObject = (e, t, n, o) => {
|
|
825
|
+
let r, s, l;
|
|
499
826
|
const i = {};
|
|
500
827
|
if (t = t || {}, e == null) return t;
|
|
501
828
|
do {
|
|
502
|
-
for (
|
|
503
|
-
l =
|
|
829
|
+
for (r = Object.getOwnPropertyNames(e), s = r.length; s-- > 0; )
|
|
830
|
+
l = r[s], (!o || o(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
504
831
|
e = n !== !1 && getPrototypeOf(e);
|
|
505
832
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
506
833
|
return t;
|
|
507
834
|
}, endsWith = (e, t, n) => {
|
|
508
835
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
509
|
-
const
|
|
510
|
-
return
|
|
836
|
+
const o = e.indexOf(t, n);
|
|
837
|
+
return o !== -1 && o === n;
|
|
511
838
|
}, toArray = (e) => {
|
|
512
839
|
if (!e) return null;
|
|
513
840
|
if (isArray(e)) return e;
|
|
@@ -518,35 +845,35 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
518
845
|
n[t] = e[t];
|
|
519
846
|
return n;
|
|
520
847
|
}, isTypedArray = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && getPrototypeOf(Uint8Array)), forEachEntry = (e, t) => {
|
|
521
|
-
const
|
|
522
|
-
let
|
|
523
|
-
for (; (
|
|
524
|
-
const s =
|
|
848
|
+
const o = (e && e[iterator]).call(e);
|
|
849
|
+
let r;
|
|
850
|
+
for (; (r = o.next()) && !r.done; ) {
|
|
851
|
+
const s = r.value;
|
|
525
852
|
t.call(e, s[0], s[1]);
|
|
526
853
|
}
|
|
527
854
|
}, matchAll = (e, t) => {
|
|
528
855
|
let n;
|
|
529
|
-
const
|
|
856
|
+
const o = [];
|
|
530
857
|
for (; (n = e.exec(t)) !== null; )
|
|
531
|
-
|
|
532
|
-
return
|
|
858
|
+
o.push(n);
|
|
859
|
+
return o;
|
|
533
860
|
}, isHTMLForm = kindOfTest("HTMLFormElement"), toCamelCase = (e) => e.toLowerCase().replace(
|
|
534
861
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
535
|
-
function(n,
|
|
536
|
-
return
|
|
862
|
+
function(n, o, r) {
|
|
863
|
+
return o.toUpperCase() + r;
|
|
537
864
|
}
|
|
538
865
|
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
539
|
-
const n = Object.getOwnPropertyDescriptors(e),
|
|
540
|
-
forEach(n, (
|
|
866
|
+
const n = Object.getOwnPropertyDescriptors(e), o = {};
|
|
867
|
+
forEach(n, (r, s) => {
|
|
541
868
|
let l;
|
|
542
|
-
(l = t(
|
|
543
|
-
}), Object.defineProperties(e,
|
|
869
|
+
(l = t(r, s, e)) !== !1 && (o[s] = l || r);
|
|
870
|
+
}), Object.defineProperties(e, o);
|
|
544
871
|
}, freezeMethods = (e) => {
|
|
545
872
|
reduceDescriptors(e, (t, n) => {
|
|
546
873
|
if (isFunction(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
547
874
|
return !1;
|
|
548
|
-
const
|
|
549
|
-
if (isFunction(
|
|
875
|
+
const o = e[n];
|
|
876
|
+
if (isFunction(o)) {
|
|
550
877
|
if (t.enumerable = !1, "writable" in t) {
|
|
551
878
|
t.writable = !1;
|
|
552
879
|
return;
|
|
@@ -557,40 +884,38 @@ const extend = (e, t, n, { allOwnKeys: r } = {}) => (forEach(t, (o, s) => {
|
|
|
557
884
|
}
|
|
558
885
|
});
|
|
559
886
|
}, toObjectSet = (e, t) => {
|
|
560
|
-
const n = {},
|
|
561
|
-
|
|
887
|
+
const n = {}, o = (r) => {
|
|
888
|
+
r.forEach((s) => {
|
|
562
889
|
n[s] = !0;
|
|
563
890
|
});
|
|
564
891
|
};
|
|
565
|
-
return isArray(e) ?
|
|
892
|
+
return isArray(e) ? o(e) : o(String(e).split(t)), n;
|
|
566
893
|
}, noop = () => {
|
|
567
894
|
}, toFiniteNumber = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
568
895
|
function isSpecCompliantForm(e) {
|
|
569
896
|
return !!(e && isFunction(e.append) && e[toStringTag] === "FormData" && e[iterator]);
|
|
570
897
|
}
|
|
571
898
|
const toJSONObject = (e) => {
|
|
572
|
-
const t = new Array(10), n = (
|
|
573
|
-
if (isObject(
|
|
574
|
-
if (t.indexOf(
|
|
899
|
+
const t = new Array(10), n = (o, r) => {
|
|
900
|
+
if (isObject(o)) {
|
|
901
|
+
if (t.indexOf(o) >= 0)
|
|
575
902
|
return;
|
|
576
|
-
if (
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return forEach(r, (l, i) => {
|
|
582
|
-
const u = n(l, o + 1);
|
|
903
|
+
if (!("toJSON" in o)) {
|
|
904
|
+
t[r] = o;
|
|
905
|
+
const s = isArray(o) ? [] : {};
|
|
906
|
+
return forEach(o, (l, i) => {
|
|
907
|
+
const u = n(l, r + 1);
|
|
583
908
|
!isUndefined(u) && (s[i] = u);
|
|
584
|
-
}), t[
|
|
909
|
+
}), t[r] = void 0, s;
|
|
585
910
|
}
|
|
586
911
|
}
|
|
587
|
-
return
|
|
912
|
+
return o;
|
|
588
913
|
};
|
|
589
914
|
return n(e, 0);
|
|
590
|
-
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((n,
|
|
591
|
-
|
|
592
|
-
}, !1), (
|
|
593
|
-
|
|
915
|
+
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((n, o) => (_global.addEventListener("message", ({ source: r, data: s }) => {
|
|
916
|
+
r === _global && s === n && o.length && o.shift()();
|
|
917
|
+
}, !1), (r) => {
|
|
918
|
+
o.push(r), _global.postMessage(n, "*");
|
|
594
919
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
595
920
|
typeof setImmediate == "function",
|
|
596
921
|
isFunction(_global.postMessage)
|
|
@@ -605,7 +930,6 @@ const toJSONObject = (e) => {
|
|
|
605
930
|
isBoolean,
|
|
606
931
|
isObject,
|
|
607
932
|
isPlainObject,
|
|
608
|
-
isEmptyObject,
|
|
609
933
|
isReadableStream,
|
|
610
934
|
isRequest,
|
|
611
935
|
isResponse,
|
|
@@ -654,8 +978,8 @@ const toJSONObject = (e) => {
|
|
|
654
978
|
asap,
|
|
655
979
|
isIterable
|
|
656
980
|
};
|
|
657
|
-
function AxiosError$1(e, t, n,
|
|
658
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n),
|
|
981
|
+
function AxiosError$1(e, t, n, o, r) {
|
|
982
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), o && (this.request = o), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
659
983
|
}
|
|
660
984
|
utils$1.inherits(AxiosError$1, Error, {
|
|
661
985
|
toJSON: function() {
|
|
@@ -698,11 +1022,11 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
698
1022
|
});
|
|
699
1023
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
700
1024
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
701
|
-
AxiosError$1.from = (e, t, n,
|
|
1025
|
+
AxiosError$1.from = (e, t, n, o, r, s) => {
|
|
702
1026
|
const l = Object.create(prototype$1);
|
|
703
1027
|
return utils$1.toFlatObject(e, l, function(u) {
|
|
704
1028
|
return u !== Error.prototype;
|
|
705
|
-
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, n,
|
|
1029
|
+
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, n, o, r), l.cause = e, l.name = e.name, s && Object.assign(l, s), l;
|
|
706
1030
|
};
|
|
707
1031
|
const httpAdapter = null;
|
|
708
1032
|
function isVisitable(e) {
|
|
@@ -712,8 +1036,8 @@ function removeBrackets(e) {
|
|
|
712
1036
|
return utils$1.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
713
1037
|
}
|
|
714
1038
|
function renderKey(e, t, n) {
|
|
715
|
-
return e ? e.concat(t).map(function(
|
|
716
|
-
return
|
|
1039
|
+
return e ? e.concat(t).map(function(r, s) {
|
|
1040
|
+
return r = removeBrackets(r), !n && s ? "[" + r + "]" : r;
|
|
717
1041
|
}).join(n ? "." : "") : t;
|
|
718
1042
|
}
|
|
719
1043
|
function isFlatArray(e) {
|
|
@@ -732,8 +1056,8 @@ function toFormData$1(e, t, n) {
|
|
|
732
1056
|
}, !1, function(y, m) {
|
|
733
1057
|
return !utils$1.isUndefined(m[y]);
|
|
734
1058
|
});
|
|
735
|
-
const
|
|
736
|
-
if (!utils$1.isFunction(
|
|
1059
|
+
const o = n.metaTokens, r = n.visitor || a, s = n.dots, l = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
1060
|
+
if (!utils$1.isFunction(r))
|
|
737
1061
|
throw new TypeError("visitor must be a function");
|
|
738
1062
|
function c(p) {
|
|
739
1063
|
if (p === null) return "";
|
|
@@ -749,13 +1073,13 @@ function toFormData$1(e, t, n) {
|
|
|
749
1073
|
let x = p;
|
|
750
1074
|
if (p && !m && typeof p == "object") {
|
|
751
1075
|
if (utils$1.endsWith(y, "{}"))
|
|
752
|
-
y =
|
|
1076
|
+
y = o ? y : y.slice(0, -2), p = JSON.stringify(p);
|
|
753
1077
|
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(y, "[]")) && (x = utils$1.toArray(p)))
|
|
754
|
-
return y = removeBrackets(y), x.forEach(function(
|
|
755
|
-
!(utils$1.isUndefined(
|
|
1078
|
+
return y = removeBrackets(y), x.forEach(function($, _) {
|
|
1079
|
+
!(utils$1.isUndefined($) || $ === null) && t.append(
|
|
756
1080
|
// eslint-disable-next-line no-nested-ternary
|
|
757
1081
|
l === !0 ? renderKey([y], _, s) : l === null ? y : y + "[]",
|
|
758
|
-
c(
|
|
1082
|
+
c($)
|
|
759
1083
|
);
|
|
760
1084
|
}), !1;
|
|
761
1085
|
}
|
|
@@ -770,14 +1094,14 @@ function toFormData$1(e, t, n) {
|
|
|
770
1094
|
if (!utils$1.isUndefined(p)) {
|
|
771
1095
|
if (d.indexOf(p) !== -1)
|
|
772
1096
|
throw Error("Circular reference detected in " + y.join("."));
|
|
773
|
-
d.push(p), utils$1.forEach(p, function(x,
|
|
774
|
-
(!(utils$1.isUndefined(x) || x === null) &&
|
|
1097
|
+
d.push(p), utils$1.forEach(p, function(x, v) {
|
|
1098
|
+
(!(utils$1.isUndefined(x) || x === null) && r.call(
|
|
775
1099
|
t,
|
|
776
1100
|
x,
|
|
777
|
-
utils$1.isString(
|
|
1101
|
+
utils$1.isString(v) ? v.trim() : v,
|
|
778
1102
|
y,
|
|
779
1103
|
f
|
|
780
|
-
)) === !0 && h(x, y ? y.concat(
|
|
1104
|
+
)) === !0 && h(x, y ? y.concat(v) : [v]);
|
|
781
1105
|
}), d.pop();
|
|
782
1106
|
}
|
|
783
1107
|
}
|
|
@@ -795,8 +1119,8 @@ function encode$1(e) {
|
|
|
795
1119
|
"%20": "+",
|
|
796
1120
|
"%00": "\0"
|
|
797
1121
|
};
|
|
798
|
-
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(
|
|
799
|
-
return t[
|
|
1122
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(o) {
|
|
1123
|
+
return t[o];
|
|
800
1124
|
});
|
|
801
1125
|
}
|
|
802
1126
|
function AxiosURLSearchParams(e, t) {
|
|
@@ -807,11 +1131,11 @@ prototype.append = function(t, n) {
|
|
|
807
1131
|
this._pairs.push([t, n]);
|
|
808
1132
|
};
|
|
809
1133
|
prototype.toString = function(t) {
|
|
810
|
-
const n = t ? function(
|
|
811
|
-
return t.call(this,
|
|
1134
|
+
const n = t ? function(o) {
|
|
1135
|
+
return t.call(this, o, encode$1);
|
|
812
1136
|
} : encode$1;
|
|
813
|
-
return this._pairs.map(function(
|
|
814
|
-
return n(
|
|
1137
|
+
return this._pairs.map(function(r) {
|
|
1138
|
+
return n(r[0]) + "=" + n(r[1]);
|
|
815
1139
|
}, "").join("&");
|
|
816
1140
|
};
|
|
817
1141
|
function encode(e) {
|
|
@@ -820,13 +1144,13 @@ function encode(e) {
|
|
|
820
1144
|
function buildURL(e, t, n) {
|
|
821
1145
|
if (!t)
|
|
822
1146
|
return e;
|
|
823
|
-
const
|
|
1147
|
+
const o = n && n.encode || encode;
|
|
824
1148
|
utils$1.isFunction(n) && (n = {
|
|
825
1149
|
serialize: n
|
|
826
1150
|
});
|
|
827
|
-
const
|
|
1151
|
+
const r = n && n.serialize;
|
|
828
1152
|
let s;
|
|
829
|
-
if (
|
|
1153
|
+
if (r ? s = r(t, n) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, n).toString(o), s) {
|
|
830
1154
|
const l = e.indexOf("#");
|
|
831
1155
|
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
832
1156
|
}
|
|
@@ -844,12 +1168,12 @@ class InterceptorManager {
|
|
|
844
1168
|
*
|
|
845
1169
|
* @return {Number} An ID used to remove interceptor later
|
|
846
1170
|
*/
|
|
847
|
-
use(t, n,
|
|
1171
|
+
use(t, n, o) {
|
|
848
1172
|
return this.handlers.push({
|
|
849
1173
|
fulfilled: t,
|
|
850
1174
|
rejected: n,
|
|
851
|
-
synchronous:
|
|
852
|
-
runWhen:
|
|
1175
|
+
synchronous: o ? o.synchronous : !1,
|
|
1176
|
+
runWhen: o ? o.runWhen : null
|
|
853
1177
|
}), this.handlers.length - 1;
|
|
854
1178
|
}
|
|
855
1179
|
/**
|
|
@@ -881,8 +1205,8 @@ class InterceptorManager {
|
|
|
881
1205
|
* @returns {void}
|
|
882
1206
|
*/
|
|
883
1207
|
forEach(t) {
|
|
884
|
-
utils$1.forEach(this.handlers, function(
|
|
885
|
-
|
|
1208
|
+
utils$1.forEach(this.handlers, function(o) {
|
|
1209
|
+
o !== null && t(o);
|
|
886
1210
|
});
|
|
887
1211
|
}
|
|
888
1212
|
}
|
|
@@ -911,36 +1235,35 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
911
1235
|
...platform$1
|
|
912
1236
|
};
|
|
913
1237
|
function toURLEncodedForm(e, t) {
|
|
914
|
-
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
915
|
-
visitor: function(n,
|
|
916
|
-
return platform.isNode && utils$1.isBuffer(n) ? (this.append(
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
});
|
|
1238
|
+
return toFormData$1(e, new platform.classes.URLSearchParams(), Object.assign({
|
|
1239
|
+
visitor: function(n, o, r, s) {
|
|
1240
|
+
return platform.isNode && utils$1.isBuffer(n) ? (this.append(o, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
1241
|
+
}
|
|
1242
|
+
}, t));
|
|
920
1243
|
}
|
|
921
1244
|
function parsePropPath(e) {
|
|
922
1245
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
923
1246
|
}
|
|
924
1247
|
function arrayToObject(e) {
|
|
925
1248
|
const t = {}, n = Object.keys(e);
|
|
926
|
-
let
|
|
927
|
-
const
|
|
1249
|
+
let o;
|
|
1250
|
+
const r = n.length;
|
|
928
1251
|
let s;
|
|
929
|
-
for (
|
|
930
|
-
s = n[
|
|
1252
|
+
for (o = 0; o < r; o++)
|
|
1253
|
+
s = n[o], t[s] = e[s];
|
|
931
1254
|
return t;
|
|
932
1255
|
}
|
|
933
1256
|
function formDataToJSON(e) {
|
|
934
|
-
function t(n,
|
|
1257
|
+
function t(n, o, r, s) {
|
|
935
1258
|
let l = n[s++];
|
|
936
1259
|
if (l === "__proto__") return !0;
|
|
937
1260
|
const i = Number.isFinite(+l), u = s >= n.length;
|
|
938
|
-
return l = !l && utils$1.isArray(
|
|
1261
|
+
return l = !l && utils$1.isArray(r) ? r.length : l, u ? (utils$1.hasOwnProp(r, l) ? r[l] = [r[l], o] : r[l] = o, !i) : ((!r[l] || !utils$1.isObject(r[l])) && (r[l] = []), t(n, o, r[l], s) && utils$1.isArray(r[l]) && (r[l] = arrayToObject(r[l])), !i);
|
|
939
1262
|
}
|
|
940
1263
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
941
1264
|
const n = {};
|
|
942
|
-
return utils$1.forEachEntry(e, (
|
|
943
|
-
t(parsePropPath(
|
|
1265
|
+
return utils$1.forEachEntry(e, (o, r) => {
|
|
1266
|
+
t(parsePropPath(o), r, n, 0);
|
|
944
1267
|
}), n;
|
|
945
1268
|
}
|
|
946
1269
|
return null;
|
|
@@ -949,9 +1272,9 @@ function stringifySafely(e, t, n) {
|
|
|
949
1272
|
if (utils$1.isString(e))
|
|
950
1273
|
try {
|
|
951
1274
|
return (t || JSON.parse)(e), utils$1.trim(e);
|
|
952
|
-
} catch (
|
|
953
|
-
if (
|
|
954
|
-
throw
|
|
1275
|
+
} catch (o) {
|
|
1276
|
+
if (o.name !== "SyntaxError")
|
|
1277
|
+
throw o;
|
|
955
1278
|
}
|
|
956
1279
|
return (n || JSON.stringify)(e);
|
|
957
1280
|
}
|
|
@@ -959,9 +1282,9 @@ const defaults = {
|
|
|
959
1282
|
transitional: transitionalDefaults,
|
|
960
1283
|
adapter: ["xhr", "http", "fetch"],
|
|
961
1284
|
transformRequest: [function(t, n) {
|
|
962
|
-
const
|
|
1285
|
+
const o = n.getContentType() || "", r = o.indexOf("application/json") > -1, s = utils$1.isObject(t);
|
|
963
1286
|
if (s && utils$1.isHTMLForm(t) && (t = new FormData(t)), utils$1.isFormData(t))
|
|
964
|
-
return
|
|
1287
|
+
return r ? JSON.stringify(formDataToJSON(t)) : t;
|
|
965
1288
|
if (utils$1.isArrayBuffer(t) || utils$1.isBuffer(t) || utils$1.isStream(t) || utils$1.isFile(t) || utils$1.isBlob(t) || utils$1.isReadableStream(t))
|
|
966
1289
|
return t;
|
|
967
1290
|
if (utils$1.isArrayBufferView(t))
|
|
@@ -970,9 +1293,9 @@ const defaults = {
|
|
|
970
1293
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
971
1294
|
let i;
|
|
972
1295
|
if (s) {
|
|
973
|
-
if (
|
|
1296
|
+
if (o.indexOf("application/x-www-form-urlencoded") > -1)
|
|
974
1297
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
975
|
-
if ((i = utils$1.isFileList(t)) ||
|
|
1298
|
+
if ((i = utils$1.isFileList(t)) || o.indexOf("multipart/form-data") > -1) {
|
|
976
1299
|
const u = this.env && this.env.FormData;
|
|
977
1300
|
return toFormData$1(
|
|
978
1301
|
i ? { "files[]": t } : t,
|
|
@@ -981,14 +1304,14 @@ const defaults = {
|
|
|
981
1304
|
);
|
|
982
1305
|
}
|
|
983
1306
|
}
|
|
984
|
-
return s ||
|
|
1307
|
+
return s || r ? (n.setContentType("application/json", !1), stringifySafely(t)) : t;
|
|
985
1308
|
}],
|
|
986
1309
|
transformResponse: [function(t) {
|
|
987
|
-
const n = this.transitional || defaults.transitional,
|
|
1310
|
+
const n = this.transitional || defaults.transitional, o = n && n.forcedJSONParsing, r = this.responseType === "json";
|
|
988
1311
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
989
1312
|
return t;
|
|
990
|
-
if (t && utils$1.isString(t) && (
|
|
991
|
-
const l = !(n && n.silentJSONParsing) &&
|
|
1313
|
+
if (t && utils$1.isString(t) && (o && !this.responseType || r)) {
|
|
1314
|
+
const l = !(n && n.silentJSONParsing) && r;
|
|
992
1315
|
try {
|
|
993
1316
|
return JSON.parse(t);
|
|
994
1317
|
} catch (i) {
|
|
@@ -1044,10 +1367,10 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1044
1367
|
"user-agent"
|
|
1045
1368
|
]), parseHeaders = (e) => {
|
|
1046
1369
|
const t = {};
|
|
1047
|
-
let n,
|
|
1370
|
+
let n, o, r;
|
|
1048
1371
|
return e && e.split(`
|
|
1049
1372
|
`).forEach(function(l) {
|
|
1050
|
-
|
|
1373
|
+
r = l.indexOf(":"), n = l.substring(0, r).trim().toLowerCase(), o = l.substring(r + 1).trim(), !(!n || t[n] && ignoreDuplicateOf[n]) && (n === "set-cookie" ? t[n] ? t[n].push(o) : t[n] = [o] : t[n] = t[n] ? t[n] + ", " + o : o);
|
|
1051
1374
|
}), t;
|
|
1052
1375
|
}, $internals = Symbol("internals");
|
|
1053
1376
|
function normalizeHeader(e) {
|
|
@@ -1058,31 +1381,31 @@ function normalizeValue(e) {
|
|
|
1058
1381
|
}
|
|
1059
1382
|
function parseTokens(e) {
|
|
1060
1383
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1061
|
-
let
|
|
1062
|
-
for (;
|
|
1063
|
-
t[
|
|
1384
|
+
let o;
|
|
1385
|
+
for (; o = n.exec(e); )
|
|
1386
|
+
t[o[1]] = o[2];
|
|
1064
1387
|
return t;
|
|
1065
1388
|
}
|
|
1066
1389
|
const isValidHeaderName = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1067
|
-
function matchHeaderValue(e, t, n,
|
|
1068
|
-
if (utils$1.isFunction(
|
|
1069
|
-
return
|
|
1070
|
-
if (
|
|
1071
|
-
if (utils$1.isString(
|
|
1072
|
-
return t.indexOf(
|
|
1073
|
-
if (utils$1.isRegExp(
|
|
1074
|
-
return
|
|
1390
|
+
function matchHeaderValue(e, t, n, o, r) {
|
|
1391
|
+
if (utils$1.isFunction(o))
|
|
1392
|
+
return o.call(this, t, n);
|
|
1393
|
+
if (r && (t = n), !!utils$1.isString(t)) {
|
|
1394
|
+
if (utils$1.isString(o))
|
|
1395
|
+
return t.indexOf(o) !== -1;
|
|
1396
|
+
if (utils$1.isRegExp(o))
|
|
1397
|
+
return o.test(t);
|
|
1075
1398
|
}
|
|
1076
1399
|
}
|
|
1077
1400
|
function formatHeader(e) {
|
|
1078
|
-
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n,
|
|
1401
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, o) => n.toUpperCase() + o);
|
|
1079
1402
|
}
|
|
1080
1403
|
function buildAccessors(e, t) {
|
|
1081
1404
|
const n = utils$1.toCamelCase(" " + t);
|
|
1082
|
-
["get", "set", "has"].forEach((
|
|
1083
|
-
Object.defineProperty(e,
|
|
1084
|
-
value: function(
|
|
1085
|
-
return this[
|
|
1405
|
+
["get", "set", "has"].forEach((o) => {
|
|
1406
|
+
Object.defineProperty(e, o + n, {
|
|
1407
|
+
value: function(r, s, l) {
|
|
1408
|
+
return this[o].call(this, t, r, s, l);
|
|
1086
1409
|
},
|
|
1087
1410
|
configurable: !0
|
|
1088
1411
|
});
|
|
@@ -1092,14 +1415,14 @@ let AxiosHeaders$1 = class {
|
|
|
1092
1415
|
constructor(t) {
|
|
1093
1416
|
t && this.set(t);
|
|
1094
1417
|
}
|
|
1095
|
-
set(t, n,
|
|
1096
|
-
const
|
|
1418
|
+
set(t, n, o) {
|
|
1419
|
+
const r = this;
|
|
1097
1420
|
function s(i, u, c) {
|
|
1098
1421
|
const a = normalizeHeader(u);
|
|
1099
1422
|
if (!a)
|
|
1100
1423
|
throw new Error("header name must be a non-empty string");
|
|
1101
|
-
const d = utils$1.findKey(
|
|
1102
|
-
(!d ||
|
|
1424
|
+
const d = utils$1.findKey(r, a);
|
|
1425
|
+
(!d || r[d] === void 0 || c === !0 || c === void 0 && r[d] !== !1) && (r[d || u] = normalizeValue(i));
|
|
1103
1426
|
}
|
|
1104
1427
|
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
1105
1428
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -1115,63 +1438,63 @@ let AxiosHeaders$1 = class {
|
|
|
1115
1438
|
}
|
|
1116
1439
|
l(i, n);
|
|
1117
1440
|
} else
|
|
1118
|
-
t != null && s(n, t,
|
|
1441
|
+
t != null && s(n, t, o);
|
|
1119
1442
|
return this;
|
|
1120
1443
|
}
|
|
1121
1444
|
get(t, n) {
|
|
1122
1445
|
if (t = normalizeHeader(t), t) {
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1125
|
-
const
|
|
1446
|
+
const o = utils$1.findKey(this, t);
|
|
1447
|
+
if (o) {
|
|
1448
|
+
const r = this[o];
|
|
1126
1449
|
if (!n)
|
|
1127
|
-
return
|
|
1450
|
+
return r;
|
|
1128
1451
|
if (n === !0)
|
|
1129
|
-
return parseTokens(
|
|
1452
|
+
return parseTokens(r);
|
|
1130
1453
|
if (utils$1.isFunction(n))
|
|
1131
|
-
return n.call(this,
|
|
1454
|
+
return n.call(this, r, o);
|
|
1132
1455
|
if (utils$1.isRegExp(n))
|
|
1133
|
-
return n.exec(
|
|
1456
|
+
return n.exec(r);
|
|
1134
1457
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1135
1458
|
}
|
|
1136
1459
|
}
|
|
1137
1460
|
}
|
|
1138
1461
|
has(t, n) {
|
|
1139
1462
|
if (t = normalizeHeader(t), t) {
|
|
1140
|
-
const
|
|
1141
|
-
return !!(
|
|
1463
|
+
const o = utils$1.findKey(this, t);
|
|
1464
|
+
return !!(o && this[o] !== void 0 && (!n || matchHeaderValue(this, this[o], o, n)));
|
|
1142
1465
|
}
|
|
1143
1466
|
return !1;
|
|
1144
1467
|
}
|
|
1145
1468
|
delete(t, n) {
|
|
1146
|
-
const
|
|
1147
|
-
let
|
|
1469
|
+
const o = this;
|
|
1470
|
+
let r = !1;
|
|
1148
1471
|
function s(l) {
|
|
1149
1472
|
if (l = normalizeHeader(l), l) {
|
|
1150
|
-
const i = utils$1.findKey(
|
|
1151
|
-
i && (!n || matchHeaderValue(
|
|
1473
|
+
const i = utils$1.findKey(o, l);
|
|
1474
|
+
i && (!n || matchHeaderValue(o, o[i], i, n)) && (delete o[i], r = !0);
|
|
1152
1475
|
}
|
|
1153
1476
|
}
|
|
1154
|
-
return utils$1.isArray(t) ? t.forEach(s) : s(t),
|
|
1477
|
+
return utils$1.isArray(t) ? t.forEach(s) : s(t), r;
|
|
1155
1478
|
}
|
|
1156
1479
|
clear(t) {
|
|
1157
1480
|
const n = Object.keys(this);
|
|
1158
|
-
let
|
|
1159
|
-
for (;
|
|
1160
|
-
const s = n[
|
|
1161
|
-
(!t || matchHeaderValue(this, this[s], s, t, !0)) && (delete this[s],
|
|
1481
|
+
let o = n.length, r = !1;
|
|
1482
|
+
for (; o--; ) {
|
|
1483
|
+
const s = n[o];
|
|
1484
|
+
(!t || matchHeaderValue(this, this[s], s, t, !0)) && (delete this[s], r = !0);
|
|
1162
1485
|
}
|
|
1163
|
-
return
|
|
1486
|
+
return r;
|
|
1164
1487
|
}
|
|
1165
1488
|
normalize(t) {
|
|
1166
|
-
const n = this,
|
|
1167
|
-
return utils$1.forEach(this, (
|
|
1168
|
-
const l = utils$1.findKey(
|
|
1489
|
+
const n = this, o = {};
|
|
1490
|
+
return utils$1.forEach(this, (r, s) => {
|
|
1491
|
+
const l = utils$1.findKey(o, s);
|
|
1169
1492
|
if (l) {
|
|
1170
|
-
n[l] = normalizeValue(
|
|
1493
|
+
n[l] = normalizeValue(r), delete n[s];
|
|
1171
1494
|
return;
|
|
1172
1495
|
}
|
|
1173
1496
|
const i = t ? formatHeader(s) : String(s).trim();
|
|
1174
|
-
i !== s && delete n[s], n[i] = normalizeValue(
|
|
1497
|
+
i !== s && delete n[s], n[i] = normalizeValue(r), o[i] = !0;
|
|
1175
1498
|
}), this;
|
|
1176
1499
|
}
|
|
1177
1500
|
concat(...t) {
|
|
@@ -1179,8 +1502,8 @@ let AxiosHeaders$1 = class {
|
|
|
1179
1502
|
}
|
|
1180
1503
|
toJSON(t) {
|
|
1181
1504
|
const n = /* @__PURE__ */ Object.create(null);
|
|
1182
|
-
return utils$1.forEach(this, (
|
|
1183
|
-
|
|
1505
|
+
return utils$1.forEach(this, (o, r) => {
|
|
1506
|
+
o != null && o !== !1 && (n[r] = t && utils$1.isArray(o) ? o.join(", ") : o);
|
|
1184
1507
|
}), n;
|
|
1185
1508
|
}
|
|
1186
1509
|
[Symbol.iterator]() {
|
|
@@ -1200,16 +1523,16 @@ let AxiosHeaders$1 = class {
|
|
|
1200
1523
|
return t instanceof this ? t : new this(t);
|
|
1201
1524
|
}
|
|
1202
1525
|
static concat(t, ...n) {
|
|
1203
|
-
const
|
|
1204
|
-
return n.forEach((
|
|
1526
|
+
const o = new this(t);
|
|
1527
|
+
return n.forEach((r) => o.set(r)), o;
|
|
1205
1528
|
}
|
|
1206
1529
|
static accessor(t) {
|
|
1207
|
-
const
|
|
1530
|
+
const o = (this[$internals] = this[$internals] = {
|
|
1208
1531
|
accessors: {}
|
|
1209
|
-
}).accessors,
|
|
1532
|
+
}).accessors, r = this.prototype;
|
|
1210
1533
|
function s(l) {
|
|
1211
1534
|
const i = normalizeHeader(l);
|
|
1212
|
-
|
|
1535
|
+
o[i] || (buildAccessors(r, l), o[i] = !0);
|
|
1213
1536
|
}
|
|
1214
1537
|
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1215
1538
|
}
|
|
@@ -1219,18 +1542,18 @@ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: e }, t) => {
|
|
|
1219
1542
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
1220
1543
|
return {
|
|
1221
1544
|
get: () => e,
|
|
1222
|
-
set(
|
|
1223
|
-
this[n] =
|
|
1545
|
+
set(o) {
|
|
1546
|
+
this[n] = o;
|
|
1224
1547
|
}
|
|
1225
1548
|
};
|
|
1226
1549
|
});
|
|
1227
1550
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
1228
1551
|
function transformData(e, t) {
|
|
1229
|
-
const n = this || defaults,
|
|
1230
|
-
let s =
|
|
1552
|
+
const n = this || defaults, o = t || n, r = AxiosHeaders$1.from(o.headers);
|
|
1553
|
+
let s = o.data;
|
|
1231
1554
|
return utils$1.forEach(e, function(i) {
|
|
1232
|
-
s = i.call(n, s,
|
|
1233
|
-
}),
|
|
1555
|
+
s = i.call(n, s, r.normalize(), t ? t.status : void 0);
|
|
1556
|
+
}), r.normalize(), s;
|
|
1234
1557
|
}
|
|
1235
1558
|
function isCancel$1(e) {
|
|
1236
1559
|
return !!(e && e.__CANCEL__);
|
|
@@ -1242,8 +1565,8 @@ utils$1.inherits(CanceledError$1, AxiosError$1, {
|
|
|
1242
1565
|
__CANCEL__: !0
|
|
1243
1566
|
});
|
|
1244
1567
|
function settle(e, t, n) {
|
|
1245
|
-
const
|
|
1246
|
-
!n.status || !
|
|
1568
|
+
const o = n.config.validateStatus;
|
|
1569
|
+
!n.status || !o || o(n.status) ? e(n) : t(new AxiosError$1(
|
|
1247
1570
|
"Request failed with status code " + n.status,
|
|
1248
1571
|
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
1249
1572
|
n.config,
|
|
@@ -1257,38 +1580,38 @@ function parseProtocol(e) {
|
|
|
1257
1580
|
}
|
|
1258
1581
|
function speedometer(e, t) {
|
|
1259
1582
|
e = e || 10;
|
|
1260
|
-
const n = new Array(e),
|
|
1261
|
-
let
|
|
1583
|
+
const n = new Array(e), o = new Array(e);
|
|
1584
|
+
let r = 0, s = 0, l;
|
|
1262
1585
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1263
|
-
const c = Date.now(), a =
|
|
1264
|
-
l || (l = c), n[
|
|
1586
|
+
const c = Date.now(), a = o[s];
|
|
1587
|
+
l || (l = c), n[r] = u, o[r] = c;
|
|
1265
1588
|
let d = s, f = 0;
|
|
1266
|
-
for (; d !==
|
|
1589
|
+
for (; d !== r; )
|
|
1267
1590
|
f += n[d++], d = d % e;
|
|
1268
|
-
if (
|
|
1591
|
+
if (r = (r + 1) % e, r === s && (s = (s + 1) % e), c - l < t)
|
|
1269
1592
|
return;
|
|
1270
1593
|
const h = a && c - a;
|
|
1271
1594
|
return h ? Math.round(f * 1e3 / h) : void 0;
|
|
1272
1595
|
};
|
|
1273
1596
|
}
|
|
1274
1597
|
function throttle(e, t) {
|
|
1275
|
-
let n = 0,
|
|
1598
|
+
let n = 0, o = 1e3 / t, r, s;
|
|
1276
1599
|
const l = (c, a = Date.now()) => {
|
|
1277
|
-
n = a,
|
|
1600
|
+
n = a, r = null, s && (clearTimeout(s), s = null), e.apply(null, c);
|
|
1278
1601
|
};
|
|
1279
1602
|
return [(...c) => {
|
|
1280
1603
|
const a = Date.now(), d = a - n;
|
|
1281
|
-
d >=
|
|
1282
|
-
s = null, l(
|
|
1283
|
-
},
|
|
1284
|
-
}, () =>
|
|
1604
|
+
d >= o ? l(c, a) : (r = c, s || (s = setTimeout(() => {
|
|
1605
|
+
s = null, l(r);
|
|
1606
|
+
}, o - d)));
|
|
1607
|
+
}, () => r && l(r)];
|
|
1285
1608
|
}
|
|
1286
1609
|
const progressEventReducer = (e, t, n = 3) => {
|
|
1287
|
-
let
|
|
1288
|
-
const
|
|
1610
|
+
let o = 0;
|
|
1611
|
+
const r = speedometer(50, 250);
|
|
1289
1612
|
return throttle((s) => {
|
|
1290
|
-
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l -
|
|
1291
|
-
|
|
1613
|
+
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l - o, c = r(u), a = l <= i;
|
|
1614
|
+
o = l;
|
|
1292
1615
|
const d = {
|
|
1293
1616
|
loaded: l,
|
|
1294
1617
|
total: i,
|
|
@@ -1304,10 +1627,10 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1304
1627
|
}, n);
|
|
1305
1628
|
}, progressEventDecorator = (e, t) => {
|
|
1306
1629
|
const n = e != null;
|
|
1307
|
-
return [(
|
|
1630
|
+
return [(o) => t[0]({
|
|
1308
1631
|
lengthComputable: n,
|
|
1309
1632
|
total: e,
|
|
1310
|
-
loaded:
|
|
1633
|
+
loaded: o
|
|
1311
1634
|
}), t[1]];
|
|
1312
1635
|
}, asyncDecorator = (e) => (...t) => utils$1.asap(() => e(...t)), isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, platform.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1313
1636
|
new URL(platform.origin),
|
|
@@ -1315,9 +1638,9 @@ const progressEventReducer = (e, t, n = 3) => {
|
|
|
1315
1638
|
) : () => !0, cookies = platform.hasStandardBrowserEnv ? (
|
|
1316
1639
|
// Standard browser envs support document.cookie
|
|
1317
1640
|
{
|
|
1318
|
-
write(e, t, n,
|
|
1641
|
+
write(e, t, n, o, r, s) {
|
|
1319
1642
|
const l = [e + "=" + encodeURIComponent(t)];
|
|
1320
|
-
utils$1.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), utils$1.isString(
|
|
1643
|
+
utils$1.isNumber(n) && l.push("expires=" + new Date(n).toGMTString()), utils$1.isString(o) && l.push("path=" + o), utils$1.isString(r) && l.push("domain=" + r), s === !0 && l.push("secure"), document.cookie = l.join("; ");
|
|
1321
1644
|
},
|
|
1322
1645
|
read(e) {
|
|
1323
1646
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1346,37 +1669,37 @@ function combineURLs(e, t) {
|
|
|
1346
1669
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1347
1670
|
}
|
|
1348
1671
|
function buildFullPath(e, t, n) {
|
|
1349
|
-
let
|
|
1350
|
-
return e && (
|
|
1672
|
+
let o = !isAbsoluteURL(t);
|
|
1673
|
+
return e && (o || n == !1) ? combineURLs(e, t) : t;
|
|
1351
1674
|
}
|
|
1352
1675
|
const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
1353
1676
|
function mergeConfig$1(e, t) {
|
|
1354
1677
|
t = t || {};
|
|
1355
1678
|
const n = {};
|
|
1356
|
-
function
|
|
1679
|
+
function o(c, a, d, f) {
|
|
1357
1680
|
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;
|
|
1358
1681
|
}
|
|
1359
|
-
function
|
|
1682
|
+
function r(c, a, d, f) {
|
|
1360
1683
|
if (utils$1.isUndefined(a)) {
|
|
1361
1684
|
if (!utils$1.isUndefined(c))
|
|
1362
|
-
return
|
|
1363
|
-
} else return
|
|
1685
|
+
return o(void 0, c, d, f);
|
|
1686
|
+
} else return o(c, a, d, f);
|
|
1364
1687
|
}
|
|
1365
1688
|
function s(c, a) {
|
|
1366
1689
|
if (!utils$1.isUndefined(a))
|
|
1367
|
-
return
|
|
1690
|
+
return o(void 0, a);
|
|
1368
1691
|
}
|
|
1369
1692
|
function l(c, a) {
|
|
1370
1693
|
if (utils$1.isUndefined(a)) {
|
|
1371
1694
|
if (!utils$1.isUndefined(c))
|
|
1372
|
-
return
|
|
1373
|
-
} else return
|
|
1695
|
+
return o(void 0, c);
|
|
1696
|
+
} else return o(void 0, a);
|
|
1374
1697
|
}
|
|
1375
1698
|
function i(c, a, d) {
|
|
1376
1699
|
if (d in t)
|
|
1377
|
-
return
|
|
1700
|
+
return o(c, a);
|
|
1378
1701
|
if (d in e)
|
|
1379
|
-
return
|
|
1702
|
+
return o(void 0, c);
|
|
1380
1703
|
}
|
|
1381
1704
|
const u = {
|
|
1382
1705
|
url: s,
|
|
@@ -1407,16 +1730,16 @@ function mergeConfig$1(e, t) {
|
|
|
1407
1730
|
socketPath: l,
|
|
1408
1731
|
responseEncoding: l,
|
|
1409
1732
|
validateStatus: i,
|
|
1410
|
-
headers: (c, a, d) =>
|
|
1733
|
+
headers: (c, a, d) => r(headersToObject(c), headersToObject(a), d, !0)
|
|
1411
1734
|
};
|
|
1412
|
-
return utils$1.forEach(Object.keys({
|
|
1413
|
-
const d = u[a] ||
|
|
1735
|
+
return utils$1.forEach(Object.keys(Object.assign({}, e, t)), function(a) {
|
|
1736
|
+
const d = u[a] || r, f = d(e[a], t[a], a);
|
|
1414
1737
|
utils$1.isUndefined(f) && d !== i || (n[a] = f);
|
|
1415
1738
|
}), n;
|
|
1416
1739
|
}
|
|
1417
1740
|
const resolveConfig = (e) => {
|
|
1418
1741
|
const t = mergeConfig$1({}, e);
|
|
1419
|
-
let { data: n, withXSRFToken:
|
|
1742
|
+
let { data: n, withXSRFToken: o, xsrfHeaderName: r, xsrfCookieName: s, headers: l, auth: i } = t;
|
|
1420
1743
|
t.headers = l = AxiosHeaders$1.from(l), t.url = buildURL(buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && l.set(
|
|
1421
1744
|
"Authorization",
|
|
1422
1745
|
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
@@ -1430,51 +1753,51 @@ const resolveConfig = (e) => {
|
|
|
1430
1753
|
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1431
1754
|
}
|
|
1432
1755
|
}
|
|
1433
|
-
if (platform.hasStandardBrowserEnv && (
|
|
1434
|
-
const c =
|
|
1435
|
-
c && l.set(
|
|
1756
|
+
if (platform.hasStandardBrowserEnv && (o && utils$1.isFunction(o) && (o = o(t)), o || o !== !1 && isURLSameOrigin(t.url))) {
|
|
1757
|
+
const c = r && s && cookies.read(s);
|
|
1758
|
+
c && l.set(r, c);
|
|
1436
1759
|
}
|
|
1437
1760
|
return t;
|
|
1438
1761
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1439
|
-
return new Promise(function(n,
|
|
1440
|
-
const
|
|
1441
|
-
let s =
|
|
1442
|
-
const l = AxiosHeaders$1.from(
|
|
1443
|
-
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } =
|
|
1762
|
+
return new Promise(function(n, o) {
|
|
1763
|
+
const r = resolveConfig(e);
|
|
1764
|
+
let s = r.data;
|
|
1765
|
+
const l = AxiosHeaders$1.from(r.headers).normalize();
|
|
1766
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = r, a, d, f, h, p;
|
|
1444
1767
|
function y() {
|
|
1445
|
-
h && h(), p && p(),
|
|
1768
|
+
h && h(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
1446
1769
|
}
|
|
1447
1770
|
let m = new XMLHttpRequest();
|
|
1448
|
-
m.open(
|
|
1771
|
+
m.open(r.method.toUpperCase(), r.url, !0), m.timeout = r.timeout;
|
|
1449
1772
|
function x() {
|
|
1450
1773
|
if (!m)
|
|
1451
1774
|
return;
|
|
1452
|
-
const
|
|
1775
|
+
const $ = AxiosHeaders$1.from(
|
|
1453
1776
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1454
1777
|
), k = {
|
|
1455
1778
|
data: !i || i === "text" || i === "json" ? m.responseText : m.response,
|
|
1456
1779
|
status: m.status,
|
|
1457
1780
|
statusText: m.statusText,
|
|
1458
|
-
headers:
|
|
1781
|
+
headers: $,
|
|
1459
1782
|
config: e,
|
|
1460
1783
|
request: m
|
|
1461
1784
|
};
|
|
1462
1785
|
settle(function(S) {
|
|
1463
1786
|
n(S), y();
|
|
1464
1787
|
}, function(S) {
|
|
1465
|
-
|
|
1788
|
+
o(S), y();
|
|
1466
1789
|
}, k), m = null;
|
|
1467
1790
|
}
|
|
1468
1791
|
"onloadend" in m ? m.onloadend = x : m.onreadystatechange = function() {
|
|
1469
1792
|
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1470
1793
|
}, m.onabort = function() {
|
|
1471
|
-
m && (
|
|
1794
|
+
m && (o(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, m)), m = null);
|
|
1472
1795
|
}, m.onerror = function() {
|
|
1473
|
-
|
|
1796
|
+
o(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, m)), m = null;
|
|
1474
1797
|
}, m.ontimeout = function() {
|
|
1475
|
-
let _ =
|
|
1476
|
-
const k =
|
|
1477
|
-
|
|
1798
|
+
let _ = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1799
|
+
const k = r.transitional || transitionalDefaults;
|
|
1800
|
+
r.timeoutErrorMessage && (_ = r.timeoutErrorMessage), o(new AxiosError$1(
|
|
1478
1801
|
_,
|
|
1479
1802
|
k.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
1480
1803
|
e,
|
|
@@ -1482,12 +1805,12 @@ const resolveConfig = (e) => {
|
|
|
1482
1805
|
)), m = null;
|
|
1483
1806
|
}, s === void 0 && l.setContentType(null), "setRequestHeader" in m && utils$1.forEach(l.toJSON(), function(_, k) {
|
|
1484
1807
|
m.setRequestHeader(k, _);
|
|
1485
|
-
}), utils$1.isUndefined(
|
|
1486
|
-
m && (
|
|
1487
|
-
},
|
|
1488
|
-
const
|
|
1489
|
-
if (
|
|
1490
|
-
|
|
1808
|
+
}), utils$1.isUndefined(r.withCredentials) || (m.withCredentials = !!r.withCredentials), i && i !== "json" && (m.responseType = r.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)), (r.cancelToken || r.signal) && (a = ($) => {
|
|
1809
|
+
m && (o(!$ || $.type ? new CanceledError$1(null, e, m) : $), m.abort(), m = null);
|
|
1810
|
+
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1811
|
+
const v = parseProtocol(r.url);
|
|
1812
|
+
if (v && platform.protocols.indexOf(v) === -1) {
|
|
1813
|
+
o(new AxiosError$1("Unsupported protocol " + v + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
1491
1814
|
return;
|
|
1492
1815
|
}
|
|
1493
1816
|
m.send(s || null);
|
|
@@ -1495,12 +1818,12 @@ const resolveConfig = (e) => {
|
|
|
1495
1818
|
}, composeSignals = (e, t) => {
|
|
1496
1819
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1497
1820
|
if (t || n) {
|
|
1498
|
-
let
|
|
1821
|
+
let o = new AbortController(), r;
|
|
1499
1822
|
const s = function(c) {
|
|
1500
|
-
if (!
|
|
1501
|
-
|
|
1823
|
+
if (!r) {
|
|
1824
|
+
r = !0, i();
|
|
1502
1825
|
const a = c instanceof Error ? c : this.reason;
|
|
1503
|
-
|
|
1826
|
+
o.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
1504
1827
|
}
|
|
1505
1828
|
};
|
|
1506
1829
|
let l = t && setTimeout(() => {
|
|
@@ -1512,7 +1835,7 @@ const resolveConfig = (e) => {
|
|
|
1512
1835
|
}), e = null);
|
|
1513
1836
|
};
|
|
1514
1837
|
e.forEach((c) => c.addEventListener("abort", s));
|
|
1515
|
-
const { signal: u } =
|
|
1838
|
+
const { signal: u } = o;
|
|
1516
1839
|
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
1517
1840
|
}
|
|
1518
1841
|
}, streamChunk = function* (e, t) {
|
|
@@ -1521,9 +1844,9 @@ const resolveConfig = (e) => {
|
|
|
1521
1844
|
yield e;
|
|
1522
1845
|
return;
|
|
1523
1846
|
}
|
|
1524
|
-
let
|
|
1525
|
-
for (;
|
|
1526
|
-
|
|
1847
|
+
let o = 0, r;
|
|
1848
|
+
for (; o < n; )
|
|
1849
|
+
r = o + t, yield e.slice(o, r), o = r;
|
|
1527
1850
|
}, readBytes = async function* (e, t) {
|
|
1528
1851
|
for await (const n of readStream(e))
|
|
1529
1852
|
yield* streamChunk(n, t);
|
|
@@ -1535,23 +1858,23 @@ const resolveConfig = (e) => {
|
|
|
1535
1858
|
const t = e.getReader();
|
|
1536
1859
|
try {
|
|
1537
1860
|
for (; ; ) {
|
|
1538
|
-
const { done: n, value:
|
|
1861
|
+
const { done: n, value: o } = await t.read();
|
|
1539
1862
|
if (n)
|
|
1540
1863
|
break;
|
|
1541
|
-
yield
|
|
1864
|
+
yield o;
|
|
1542
1865
|
}
|
|
1543
1866
|
} finally {
|
|
1544
1867
|
await t.cancel();
|
|
1545
1868
|
}
|
|
1546
|
-
}, trackStream = (e, t, n,
|
|
1547
|
-
const
|
|
1869
|
+
}, trackStream = (e, t, n, o) => {
|
|
1870
|
+
const r = readBytes(e, t);
|
|
1548
1871
|
let s = 0, l, i = (u) => {
|
|
1549
|
-
l || (l = !0,
|
|
1872
|
+
l || (l = !0, o && o(u));
|
|
1550
1873
|
};
|
|
1551
1874
|
return new ReadableStream({
|
|
1552
1875
|
async pull(u) {
|
|
1553
1876
|
try {
|
|
1554
|
-
const { done: c, value: a } = await
|
|
1877
|
+
const { done: c, value: a } = await r.next();
|
|
1555
1878
|
if (c) {
|
|
1556
1879
|
i(), u.close();
|
|
1557
1880
|
return;
|
|
@@ -1567,7 +1890,7 @@ const resolveConfig = (e) => {
|
|
|
1567
1890
|
}
|
|
1568
1891
|
},
|
|
1569
1892
|
cancel(u) {
|
|
1570
|
-
return i(u),
|
|
1893
|
+
return i(u), r.return();
|
|
1571
1894
|
}
|
|
1572
1895
|
}, {
|
|
1573
1896
|
highWaterMark: 2
|
|
@@ -1593,8 +1916,8 @@ const resolveConfig = (e) => {
|
|
|
1593
1916
|
};
|
|
1594
1917
|
isFetchSupported && ((e) => {
|
|
1595
1918
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1596
|
-
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (n) => n[t]() : (n,
|
|
1597
|
-
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT,
|
|
1919
|
+
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (n) => n[t]() : (n, o) => {
|
|
1920
|
+
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, o);
|
|
1598
1921
|
});
|
|
1599
1922
|
});
|
|
1600
1923
|
})(new Response());
|
|
@@ -1619,8 +1942,8 @@ const getBodyLength = async (e) => {
|
|
|
1619
1942
|
let {
|
|
1620
1943
|
url: t,
|
|
1621
1944
|
method: n,
|
|
1622
|
-
data:
|
|
1623
|
-
signal:
|
|
1945
|
+
data: o,
|
|
1946
|
+
signal: r,
|
|
1624
1947
|
cancelToken: s,
|
|
1625
1948
|
timeout: l,
|
|
1626
1949
|
onDownloadProgress: i,
|
|
@@ -1631,24 +1954,24 @@ const getBodyLength = async (e) => {
|
|
|
1631
1954
|
fetchOptions: f
|
|
1632
1955
|
} = resolveConfig(e);
|
|
1633
1956
|
c = c ? (c + "").toLowerCase() : "text";
|
|
1634
|
-
let h = composeSignals([
|
|
1957
|
+
let h = composeSignals([r, s && s.toAbortSignal()], l), p;
|
|
1635
1958
|
const y = h && h.unsubscribe && (() => {
|
|
1636
1959
|
h.unsubscribe();
|
|
1637
1960
|
});
|
|
1638
1961
|
let m;
|
|
1639
1962
|
try {
|
|
1640
|
-
if (u && supportsRequestStream && n !== "get" && n !== "head" && (m = await resolveBodyLength(a,
|
|
1963
|
+
if (u && supportsRequestStream && n !== "get" && n !== "head" && (m = await resolveBodyLength(a, o)) !== 0) {
|
|
1641
1964
|
let k = new Request(t, {
|
|
1642
1965
|
method: "POST",
|
|
1643
|
-
body:
|
|
1966
|
+
body: o,
|
|
1644
1967
|
duplex: "half"
|
|
1645
1968
|
}), E;
|
|
1646
|
-
if (utils$1.isFormData(
|
|
1969
|
+
if (utils$1.isFormData(o) && (E = k.headers.get("content-type")) && a.setContentType(E), k.body) {
|
|
1647
1970
|
const [S, C] = progressEventDecorator(
|
|
1648
1971
|
m,
|
|
1649
1972
|
progressEventReducer(asyncDecorator(u))
|
|
1650
1973
|
);
|
|
1651
|
-
|
|
1974
|
+
o = trackStream(k.body, DEFAULT_CHUNK_SIZE, S, C);
|
|
1652
1975
|
}
|
|
1653
1976
|
}
|
|
1654
1977
|
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1658,36 +1981,36 @@ const getBodyLength = async (e) => {
|
|
|
1658
1981
|
signal: h,
|
|
1659
1982
|
method: n.toUpperCase(),
|
|
1660
1983
|
headers: a.normalize().toJSON(),
|
|
1661
|
-
body:
|
|
1984
|
+
body: o,
|
|
1662
1985
|
duplex: "half",
|
|
1663
1986
|
credentials: x ? d : void 0
|
|
1664
1987
|
});
|
|
1665
|
-
let
|
|
1666
|
-
const
|
|
1667
|
-
if (supportsResponseStream && (i ||
|
|
1988
|
+
let v = await fetch(p, f);
|
|
1989
|
+
const $ = supportsResponseStream && (c === "stream" || c === "response");
|
|
1990
|
+
if (supportsResponseStream && (i || $ && y)) {
|
|
1668
1991
|
const k = {};
|
|
1669
|
-
["status", "statusText", "headers"].forEach((
|
|
1670
|
-
k[
|
|
1992
|
+
["status", "statusText", "headers"].forEach((B) => {
|
|
1993
|
+
k[B] = v[B];
|
|
1671
1994
|
});
|
|
1672
|
-
const E = utils$1.toFiniteNumber(
|
|
1995
|
+
const E = utils$1.toFiniteNumber(v.headers.get("content-length")), [S, C] = i && progressEventDecorator(
|
|
1673
1996
|
E,
|
|
1674
1997
|
progressEventReducer(asyncDecorator(i), !0)
|
|
1675
1998
|
) || [];
|
|
1676
|
-
|
|
1677
|
-
trackStream(
|
|
1999
|
+
v = new Response(
|
|
2000
|
+
trackStream(v.body, DEFAULT_CHUNK_SIZE, S, () => {
|
|
1678
2001
|
C && C(), y && y();
|
|
1679
2002
|
}),
|
|
1680
2003
|
k
|
|
1681
2004
|
);
|
|
1682
2005
|
}
|
|
1683
2006
|
c = c || "text";
|
|
1684
|
-
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"](
|
|
1685
|
-
return
|
|
2007
|
+
let _ = await resolvers[utils$1.findKey(resolvers, c) || "text"](v, e);
|
|
2008
|
+
return !$ && y && y(), await new Promise((k, E) => {
|
|
1686
2009
|
settle(k, E, {
|
|
1687
2010
|
data: _,
|
|
1688
|
-
headers: AxiosHeaders$1.from(
|
|
1689
|
-
status:
|
|
1690
|
-
statusText:
|
|
2011
|
+
headers: AxiosHeaders$1.from(v.headers),
|
|
2012
|
+
status: v.status,
|
|
2013
|
+
statusText: v.statusText,
|
|
1691
2014
|
config: e,
|
|
1692
2015
|
request: p
|
|
1693
2016
|
});
|
|
@@ -1718,19 +2041,19 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
1718
2041
|
getAdapter: (e) => {
|
|
1719
2042
|
e = utils$1.isArray(e) ? e : [e];
|
|
1720
2043
|
const { length: t } = e;
|
|
1721
|
-
let n,
|
|
1722
|
-
const
|
|
2044
|
+
let n, o;
|
|
2045
|
+
const r = {};
|
|
1723
2046
|
for (let s = 0; s < t; s++) {
|
|
1724
2047
|
n = e[s];
|
|
1725
2048
|
let l;
|
|
1726
|
-
if (
|
|
2049
|
+
if (o = n, !isResolvedHandle(n) && (o = knownAdapters[(l = String(n)).toLowerCase()], o === void 0))
|
|
1727
2050
|
throw new AxiosError$1(`Unknown adapter '${l}'`);
|
|
1728
|
-
if (
|
|
2051
|
+
if (o)
|
|
1729
2052
|
break;
|
|
1730
|
-
|
|
2053
|
+
r[l || "#" + s] = o;
|
|
1731
2054
|
}
|
|
1732
|
-
if (!
|
|
1733
|
-
const s = Object.entries(
|
|
2055
|
+
if (!o) {
|
|
2056
|
+
const s = Object.entries(r).map(
|
|
1734
2057
|
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1735
2058
|
);
|
|
1736
2059
|
let l = t ? s.length > 1 ? `since :
|
|
@@ -1741,7 +2064,7 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
1741
2064
|
"ERR_NOT_SUPPORT"
|
|
1742
2065
|
);
|
|
1743
2066
|
}
|
|
1744
|
-
return
|
|
2067
|
+
return o;
|
|
1745
2068
|
},
|
|
1746
2069
|
adapters: knownAdapters
|
|
1747
2070
|
};
|
|
@@ -1753,39 +2076,39 @@ function dispatchRequest(e) {
|
|
|
1753
2076
|
return throwIfCancellationRequested(e), e.headers = AxiosHeaders$1.from(e.headers), e.data = transformData.call(
|
|
1754
2077
|
e,
|
|
1755
2078
|
e.transformRequest
|
|
1756
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), adapters.getAdapter(e.adapter || defaults.adapter)(e).then(function(
|
|
1757
|
-
return throwIfCancellationRequested(e),
|
|
2079
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), adapters.getAdapter(e.adapter || defaults.adapter)(e).then(function(o) {
|
|
2080
|
+
return throwIfCancellationRequested(e), o.data = transformData.call(
|
|
1758
2081
|
e,
|
|
1759
2082
|
e.transformResponse,
|
|
1760
|
-
|
|
1761
|
-
),
|
|
1762
|
-
}, function(
|
|
1763
|
-
return isCancel$1(
|
|
2083
|
+
o
|
|
2084
|
+
), o.headers = AxiosHeaders$1.from(o.headers), o;
|
|
2085
|
+
}, function(o) {
|
|
2086
|
+
return isCancel$1(o) || (throwIfCancellationRequested(e), o && o.response && (o.response.data = transformData.call(
|
|
1764
2087
|
e,
|
|
1765
2088
|
e.transformResponse,
|
|
1766
|
-
|
|
1767
|
-
),
|
|
2089
|
+
o.response
|
|
2090
|
+
), o.response.headers = AxiosHeaders$1.from(o.response.headers))), Promise.reject(o);
|
|
1768
2091
|
});
|
|
1769
2092
|
}
|
|
1770
|
-
const VERSION$1 = "1.
|
|
2093
|
+
const VERSION$1 = "1.10.0", validators$1 = {};
|
|
1771
2094
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1772
|
-
validators$1[e] = function(
|
|
1773
|
-
return typeof
|
|
2095
|
+
validators$1[e] = function(o) {
|
|
2096
|
+
return typeof o === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1774
2097
|
};
|
|
1775
2098
|
});
|
|
1776
2099
|
const deprecatedWarnings = {};
|
|
1777
|
-
validators$1.transitional = function(t, n,
|
|
1778
|
-
function
|
|
1779
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (
|
|
2100
|
+
validators$1.transitional = function(t, n, o) {
|
|
2101
|
+
function r(s, l) {
|
|
2102
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (o ? ". " + o : "");
|
|
1780
2103
|
}
|
|
1781
2104
|
return (s, l, i) => {
|
|
1782
2105
|
if (t === !1)
|
|
1783
2106
|
throw new AxiosError$1(
|
|
1784
|
-
|
|
2107
|
+
r(l, " has been removed" + (n ? " in " + n : "")),
|
|
1785
2108
|
AxiosError$1.ERR_DEPRECATED
|
|
1786
2109
|
);
|
|
1787
2110
|
return n && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
1788
|
-
|
|
2111
|
+
r(
|
|
1789
2112
|
l,
|
|
1790
2113
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1791
2114
|
)
|
|
@@ -1793,15 +2116,15 @@ validators$1.transitional = function(t, n, r) {
|
|
|
1793
2116
|
};
|
|
1794
2117
|
};
|
|
1795
2118
|
validators$1.spelling = function(t) {
|
|
1796
|
-
return (n,
|
|
2119
|
+
return (n, o) => (console.warn(`${o} is likely a misspelling of ${t}`), !0);
|
|
1797
2120
|
};
|
|
1798
2121
|
function assertOptions(e, t, n) {
|
|
1799
2122
|
if (typeof e != "object")
|
|
1800
2123
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
1801
|
-
const
|
|
1802
|
-
let
|
|
1803
|
-
for (;
|
|
1804
|
-
const s = r
|
|
2124
|
+
const o = Object.keys(e);
|
|
2125
|
+
let r = o.length;
|
|
2126
|
+
for (; r-- > 0; ) {
|
|
2127
|
+
const s = o[r], l = t[s];
|
|
1805
2128
|
if (l) {
|
|
1806
2129
|
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
1807
2130
|
if (u !== !0)
|
|
@@ -1834,30 +2157,30 @@ let Axios$1 = class {
|
|
|
1834
2157
|
async request(t, n) {
|
|
1835
2158
|
try {
|
|
1836
2159
|
return await this._request(t, n);
|
|
1837
|
-
} catch (
|
|
1838
|
-
if (
|
|
1839
|
-
let
|
|
1840
|
-
Error.captureStackTrace ? Error.captureStackTrace(
|
|
1841
|
-
const s =
|
|
2160
|
+
} catch (o) {
|
|
2161
|
+
if (o instanceof Error) {
|
|
2162
|
+
let r = {};
|
|
2163
|
+
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
2164
|
+
const s = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
1842
2165
|
try {
|
|
1843
|
-
|
|
1844
|
-
` + s) :
|
|
2166
|
+
o.stack ? s && !String(o.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (o.stack += `
|
|
2167
|
+
` + s) : o.stack = s;
|
|
1845
2168
|
} catch {
|
|
1846
2169
|
}
|
|
1847
2170
|
}
|
|
1848
|
-
throw
|
|
2171
|
+
throw o;
|
|
1849
2172
|
}
|
|
1850
2173
|
}
|
|
1851
2174
|
_request(t, n) {
|
|
1852
2175
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = mergeConfig$1(this.defaults, n);
|
|
1853
|
-
const { transitional:
|
|
1854
|
-
|
|
2176
|
+
const { transitional: o, paramsSerializer: r, headers: s } = n;
|
|
2177
|
+
o !== void 0 && validator.assertOptions(o, {
|
|
1855
2178
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
1856
2179
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
1857
2180
|
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
1858
|
-
}, !1),
|
|
1859
|
-
serialize:
|
|
1860
|
-
} : validator.assertOptions(
|
|
2181
|
+
}, !1), r != null && (utils$1.isFunction(r) ? n.paramsSerializer = {
|
|
2182
|
+
serialize: r
|
|
2183
|
+
} : validator.assertOptions(r, {
|
|
1861
2184
|
encode: validators.function,
|
|
1862
2185
|
serialize: validators.function
|
|
1863
2186
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), validator.assertOptions(n, {
|
|
@@ -1886,7 +2209,7 @@ let Axios$1 = class {
|
|
|
1886
2209
|
let a, d = 0, f;
|
|
1887
2210
|
if (!u) {
|
|
1888
2211
|
const p = [dispatchRequest.bind(this), void 0];
|
|
1889
|
-
for (p.unshift(
|
|
2212
|
+
for (p.unshift.apply(p, i), p.push.apply(p, c), f = p.length, a = Promise.resolve(n); d < f; )
|
|
1890
2213
|
a = a.then(p[d++], p[d++]);
|
|
1891
2214
|
return a;
|
|
1892
2215
|
}
|
|
@@ -1917,20 +2240,20 @@ let Axios$1 = class {
|
|
|
1917
2240
|
}
|
|
1918
2241
|
};
|
|
1919
2242
|
utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1920
|
-
Axios$1.prototype[t] = function(n,
|
|
1921
|
-
return this.request(mergeConfig$1(
|
|
2243
|
+
Axios$1.prototype[t] = function(n, o) {
|
|
2244
|
+
return this.request(mergeConfig$1(o || {}, {
|
|
1922
2245
|
method: t,
|
|
1923
2246
|
url: n,
|
|
1924
|
-
data: (
|
|
2247
|
+
data: (o || {}).data
|
|
1925
2248
|
}));
|
|
1926
2249
|
};
|
|
1927
2250
|
});
|
|
1928
2251
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
1929
|
-
function n(
|
|
2252
|
+
function n(o) {
|
|
1930
2253
|
return function(s, l, i) {
|
|
1931
2254
|
return this.request(mergeConfig$1(i || {}, {
|
|
1932
2255
|
method: t,
|
|
1933
|
-
headers:
|
|
2256
|
+
headers: o ? {
|
|
1934
2257
|
"Content-Type": "multipart/form-data"
|
|
1935
2258
|
} : {},
|
|
1936
2259
|
url: s,
|
|
@@ -1940,7 +2263,7 @@ utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
|
1940
2263
|
}
|
|
1941
2264
|
Axios$1.prototype[t] = n(), Axios$1.prototype[t + "Form"] = n(!0);
|
|
1942
2265
|
});
|
|
1943
|
-
let CancelToken$1 = class
|
|
2266
|
+
let CancelToken$1 = class R {
|
|
1944
2267
|
constructor(t) {
|
|
1945
2268
|
if (typeof t != "function")
|
|
1946
2269
|
throw new TypeError("executor must be a function.");
|
|
@@ -1948,23 +2271,23 @@ let CancelToken$1 = class V {
|
|
|
1948
2271
|
this.promise = new Promise(function(s) {
|
|
1949
2272
|
n = s;
|
|
1950
2273
|
});
|
|
1951
|
-
const
|
|
1952
|
-
this.promise.then((
|
|
1953
|
-
if (!
|
|
1954
|
-
let s =
|
|
2274
|
+
const o = this;
|
|
2275
|
+
this.promise.then((r) => {
|
|
2276
|
+
if (!o._listeners) return;
|
|
2277
|
+
let s = o._listeners.length;
|
|
1955
2278
|
for (; s-- > 0; )
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
}), this.promise.then = (
|
|
2279
|
+
o._listeners[s](r);
|
|
2280
|
+
o._listeners = null;
|
|
2281
|
+
}), this.promise.then = (r) => {
|
|
1959
2282
|
let s;
|
|
1960
2283
|
const l = new Promise((i) => {
|
|
1961
|
-
|
|
1962
|
-
}).then(
|
|
2284
|
+
o.subscribe(i), s = i;
|
|
2285
|
+
}).then(r);
|
|
1963
2286
|
return l.cancel = function() {
|
|
1964
|
-
|
|
2287
|
+
o.unsubscribe(s);
|
|
1965
2288
|
}, l;
|
|
1966
2289
|
}, t(function(s, l, i) {
|
|
1967
|
-
|
|
2290
|
+
o.reason || (o.reason = new CanceledError$1(s, l, i), n(o.reason));
|
|
1968
2291
|
});
|
|
1969
2292
|
}
|
|
1970
2293
|
/**
|
|
@@ -1994,8 +2317,8 @@ let CancelToken$1 = class V {
|
|
|
1994
2317
|
n !== -1 && this._listeners.splice(n, 1);
|
|
1995
2318
|
}
|
|
1996
2319
|
toAbortSignal() {
|
|
1997
|
-
const t = new AbortController(), n = (
|
|
1998
|
-
t.abort(
|
|
2320
|
+
const t = new AbortController(), n = (o) => {
|
|
2321
|
+
t.abort(o);
|
|
1999
2322
|
};
|
|
2000
2323
|
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
|
|
2001
2324
|
}
|
|
@@ -2006,8 +2329,8 @@ let CancelToken$1 = class V {
|
|
|
2006
2329
|
static source() {
|
|
2007
2330
|
let t;
|
|
2008
2331
|
return {
|
|
2009
|
-
token: new
|
|
2010
|
-
t =
|
|
2332
|
+
token: new R(function(r) {
|
|
2333
|
+
t = r;
|
|
2011
2334
|
}),
|
|
2012
2335
|
cancel: t
|
|
2013
2336
|
};
|
|
@@ -2091,8 +2414,8 @@ Object.entries(HttpStatusCode$1).forEach(([e, t]) => {
|
|
|
2091
2414
|
});
|
|
2092
2415
|
function createInstance(e) {
|
|
2093
2416
|
const t = new Axios$1(e), n = bind(Axios$1.prototype.request, t);
|
|
2094
|
-
return utils$1.extend(n, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(
|
|
2095
|
-
return createInstance(mergeConfig$1(e,
|
|
2417
|
+
return utils$1.extend(n, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(r) {
|
|
2418
|
+
return createInstance(mergeConfig$1(e, r));
|
|
2096
2419
|
}, n;
|
|
2097
2420
|
}
|
|
2098
2421
|
const axios = createInstance(defaults);
|
|
@@ -2132,190 +2455,7 @@ const {
|
|
|
2132
2455
|
formToJSON,
|
|
2133
2456
|
getAdapter,
|
|
2134
2457
|
mergeConfig
|
|
2135
|
-
} = axios,
|
|
2136
|
-
const n = e.__vccOpts || e;
|
|
2137
|
-
for (const [r, o] of t)
|
|
2138
|
-
n[r] = o;
|
|
2139
|
-
return n;
|
|
2140
|
-
}, _sfc_main$r = {}, _hoisted_1$n = {
|
|
2141
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2142
|
-
viewBox: "0 0 24 24",
|
|
2143
|
-
fill: "none",
|
|
2144
|
-
stroke: "currentColor",
|
|
2145
|
-
"stroke-width": "4",
|
|
2146
|
-
"stroke-linecap": "round",
|
|
2147
|
-
"stroke-linejoin": "round",
|
|
2148
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
2149
|
-
};
|
|
2150
|
-
function _sfc_render$c(e, t) {
|
|
2151
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$n, t[0] || (t[0] = [
|
|
2152
|
-
createElementVNode("path", {
|
|
2153
|
-
stroke: "none",
|
|
2154
|
-
d: "M0 0h24v24H0z",
|
|
2155
|
-
fill: "none"
|
|
2156
|
-
}, null, -1),
|
|
2157
|
-
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
2158
|
-
]));
|
|
2159
|
-
}
|
|
2160
|
-
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$c]]), _hoisted_1$m = { 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$q = /* @__PURE__ */ defineComponent({
|
|
2161
|
-
__name: "vs-checkbox-default",
|
|
2162
|
-
props: {
|
|
2163
|
-
value: { type: [String, Number], default: "" },
|
|
2164
|
-
label: { type: [String, Number], default: "" },
|
|
2165
|
-
disabled: { type: Boolean, default: !1 },
|
|
2166
|
-
id: { type: [String, Number] },
|
|
2167
|
-
modelValue: Boolean,
|
|
2168
|
-
info: { type: String, default: () => "" }
|
|
2169
|
-
},
|
|
2170
|
-
emits: ["update:modelValue"],
|
|
2171
|
-
setup(e, { emit: t }) {
|
|
2172
|
-
const n = t, r = e, o = computed({
|
|
2173
|
-
get: () => r.modelValue,
|
|
2174
|
-
set: (s) => n("update:modelValue", s)
|
|
2175
|
-
});
|
|
2176
|
-
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
2177
|
-
withDirectives(createElementVNode("input", {
|
|
2178
|
-
type: "checkbox",
|
|
2179
|
-
value: e.value,
|
|
2180
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) => o.value = i),
|
|
2181
|
-
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 }]),
|
|
2182
|
-
id: e.id,
|
|
2183
|
-
disabled: e.disabled
|
|
2184
|
-
}, null, 10, _hoisted_2$6), [
|
|
2185
|
-
[vModelCheckbox, o.value]
|
|
2186
|
-
]),
|
|
2187
|
-
createElementVNode("label", {
|
|
2188
|
-
for: e.id,
|
|
2189
|
-
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 }])
|
|
2190
|
-
}, [
|
|
2191
|
-
createElementVNode("div", {
|
|
2192
|
-
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [o.value ? "bg-blue-600" : "bg-white"]])
|
|
2193
|
-
}, [
|
|
2194
|
-
createVNode(IconCheck, {
|
|
2195
|
-
height: "12",
|
|
2196
|
-
width: "12"
|
|
2197
|
-
})
|
|
2198
|
-
], 2),
|
|
2199
|
-
createElementVNode("span", _hoisted_4$2, [
|
|
2200
|
-
renderSlot(s.$slots, "default", {}, () => [
|
|
2201
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2202
|
-
])
|
|
2203
|
-
])
|
|
2204
|
-
], 10, _hoisted_3$3)
|
|
2205
|
-
]));
|
|
2206
|
-
}
|
|
2207
|
-
}), _hoisted_1$l = ["name", "value", "disabled"], _hoisted_2$5 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3$2 = {
|
|
2208
|
-
key: 0,
|
|
2209
|
-
class: "text-[16px]"
|
|
2210
|
-
}, _hoisted_4$1 = ["src"], _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
2211
|
-
__name: "vs-checkbox-buttons",
|
|
2212
|
-
props: {
|
|
2213
|
-
value: { type: [String, Number, Boolean], default: "" },
|
|
2214
|
-
label: { type: [String, Number], default: "" },
|
|
2215
|
-
modelValue: {
|
|
2216
|
-
type: [Array, String, Boolean],
|
|
2217
|
-
default: ""
|
|
2218
|
-
},
|
|
2219
|
-
disabled: { type: Boolean, default: !1 },
|
|
2220
|
-
id: { type: [String, Number] },
|
|
2221
|
-
icon: { type: String },
|
|
2222
|
-
imgUrl: { type: String },
|
|
2223
|
-
style: { type: Object, default: () => null }
|
|
2224
|
-
},
|
|
2225
|
-
emits: ["update:modelValue"],
|
|
2226
|
-
setup(e, { emit: t }) {
|
|
2227
|
-
const n = e, r = t, o = computed({
|
|
2228
|
-
get: () => n.modelValue,
|
|
2229
|
-
set: (i) => {
|
|
2230
|
-
r("update:modelValue", i);
|
|
2231
|
-
}
|
|
2232
|
-
}), 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");
|
|
2233
|
-
return (i, u) => (openBlock(), createElementBlock("label", {
|
|
2234
|
-
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"]])
|
|
2235
|
-
}, [
|
|
2236
|
-
withDirectives(createElementVNode("input", {
|
|
2237
|
-
type: "checkbox",
|
|
2238
|
-
class: "hidden",
|
|
2239
|
-
name: e.id,
|
|
2240
|
-
value: e.value,
|
|
2241
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) => o.value = c),
|
|
2242
|
-
disabled: e.disabled
|
|
2243
|
-
}, null, 8, _hoisted_1$l), [
|
|
2244
|
-
[vModelCheckbox, o.value]
|
|
2245
|
-
]),
|
|
2246
|
-
createElementVNode("span", _hoisted_2$5, [
|
|
2247
|
-
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
2248
|
-
e.icon ? (openBlock(), createElementBlock("i", {
|
|
2249
|
-
key: 0,
|
|
2250
|
-
class: normalizeClass(e.icon)
|
|
2251
|
-
}, null, 2)) : createCommentVNode("", !0),
|
|
2252
|
-
e.imgUrl ? (openBlock(), createElementBlock("img", {
|
|
2253
|
-
key: 1,
|
|
2254
|
-
src: e.imgUrl,
|
|
2255
|
-
width: "16",
|
|
2256
|
-
height: "16",
|
|
2257
|
-
alt: "icon"
|
|
2258
|
-
}, null, 8, _hoisted_4$1)) : createCommentVNode("", !0)
|
|
2259
|
-
])) : createCommentVNode("", !0),
|
|
2260
|
-
renderSlot(i.$slots, "default", {}, () => [
|
|
2261
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2262
|
-
])
|
|
2263
|
-
])
|
|
2264
|
-
], 2));
|
|
2265
|
-
}
|
|
2266
|
-
}), VsCheckboxViews = {
|
|
2267
|
-
"vs-checkbox-default": _sfc_main$q,
|
|
2268
|
-
"vs-checkbox-buttons": _sfc_main$p
|
|
2269
|
-
}, _hoisted_1$k = { class: "flex items-center" }, _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
2270
|
-
__name: "vs-input-checkbox-item",
|
|
2271
|
-
props: {
|
|
2272
|
-
value: { type: [String, Number], default: "" },
|
|
2273
|
-
label: { type: [String, Number], default: "" },
|
|
2274
|
-
disabled: { type: Boolean, default: !1 },
|
|
2275
|
-
view: { type: String, default: () => "default" },
|
|
2276
|
-
modelValue: {
|
|
2277
|
-
type: [Array, Boolean],
|
|
2278
|
-
default: !1
|
|
2279
|
-
},
|
|
2280
|
-
icon: { type: String },
|
|
2281
|
-
imgUrl: { type: String },
|
|
2282
|
-
slots: { type: Object, default: () => null },
|
|
2283
|
-
option: { type: [Object, String] },
|
|
2284
|
-
style: { type: String, default: () => null }
|
|
2285
|
-
},
|
|
2286
|
-
emits: ["update:modelValue"],
|
|
2287
|
-
setup(e, { emit: t }) {
|
|
2288
|
-
const n = e, r = t, o = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
2289
|
-
get: () => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && n.modelValue.includes(n.value) : n.modelValue,
|
|
2290
|
-
set: (i) => {
|
|
2291
|
-
if (Array.isArray(n.modelValue)) {
|
|
2292
|
-
let u = [...n.modelValue];
|
|
2293
|
-
i ? u.includes(n.value) || u.push(n.value) : u = u.filter((c) => c !== n.value), r("update:modelValue", u);
|
|
2294
|
-
} else
|
|
2295
|
-
r("update:modelValue", i);
|
|
2296
|
-
}
|
|
2297
|
-
}), l = ref(`vs-checkbox-${n.view || "default"}`);
|
|
2298
|
-
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
2299
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[l.value]), {
|
|
2300
|
-
value: e.value,
|
|
2301
|
-
label: e.label,
|
|
2302
|
-
info: e.option?.info,
|
|
2303
|
-
disabled: e.disabled,
|
|
2304
|
-
modelValue: s.value,
|
|
2305
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
2306
|
-
id: o,
|
|
2307
|
-
icon: e.icon,
|
|
2308
|
-
imgUrl: e.imgUrl,
|
|
2309
|
-
style: normalizeStyle(e.style)
|
|
2310
|
-
}, {
|
|
2311
|
-
default: withCtx(() => [
|
|
2312
|
-
createTextVNode(toDisplayString(e.label), 1)
|
|
2313
|
-
]),
|
|
2314
|
-
_: 1
|
|
2315
|
-
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style"]))
|
|
2316
|
-
]));
|
|
2317
|
-
}
|
|
2318
|
-
}), _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
2458
|
+
} = axios, _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
2319
2459
|
__name: "vs-input-checkbox",
|
|
2320
2460
|
props: {
|
|
2321
2461
|
options: {
|
|
@@ -2335,10 +2475,10 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2335
2475
|
},
|
|
2336
2476
|
emits: ["update:modelValue"],
|
|
2337
2477
|
setup(e, { emit: t }) {
|
|
2338
|
-
const n = e,
|
|
2478
|
+
const n = e, o = t, r = 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 () => {
|
|
2339
2479
|
try {
|
|
2340
2480
|
const { data: a } = await axios.get(`/api/suggest/${n.data}`);
|
|
2341
|
-
|
|
2481
|
+
r.value = a?.data || a;
|
|
2342
2482
|
} catch (a) {
|
|
2343
2483
|
console.error(a);
|
|
2344
2484
|
}
|
|
@@ -2346,12 +2486,12 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2346
2486
|
return watch(
|
|
2347
2487
|
() => n.modelValue,
|
|
2348
2488
|
(a) => {
|
|
2349
|
-
if (typeof a == "boolean" &&
|
|
2350
|
-
const d = l(
|
|
2489
|
+
if (typeof a == "boolean" && r.value.length === 1) {
|
|
2490
|
+
const d = l(r.value[0]);
|
|
2351
2491
|
s[d] = a;
|
|
2352
2492
|
} else if (Array.isArray(a)) {
|
|
2353
2493
|
const d = new Set(a);
|
|
2354
|
-
|
|
2494
|
+
r.value.forEach((f) => {
|
|
2355
2495
|
if (!f.disabled) {
|
|
2356
2496
|
const h = l(f);
|
|
2357
2497
|
s[h] = d.has(h);
|
|
@@ -2363,23 +2503,23 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2363
2503
|
), watch(
|
|
2364
2504
|
s,
|
|
2365
2505
|
() => {
|
|
2366
|
-
if (!
|
|
2367
|
-
|
|
2506
|
+
if (!r.value.length) {
|
|
2507
|
+
o("update:modelValue", null);
|
|
2368
2508
|
return;
|
|
2369
2509
|
}
|
|
2370
2510
|
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2371
|
-
|
|
2511
|
+
o("update:modelValue", a.length === 0 ? null : a);
|
|
2372
2512
|
},
|
|
2373
2513
|
{ deep: !0 }
|
|
2374
2514
|
), onMounted(() => {
|
|
2375
2515
|
if (n.data)
|
|
2376
2516
|
c().then(() => {
|
|
2377
|
-
if (typeof n.modelValue == "boolean" &&
|
|
2378
|
-
const a = l(
|
|
2517
|
+
if (typeof n.modelValue == "boolean" && r.value.length === 1) {
|
|
2518
|
+
const a = l(r.value[0]);
|
|
2379
2519
|
s[a] = n.modelValue;
|
|
2380
2520
|
} else if (Array.isArray(n.modelValue)) {
|
|
2381
2521
|
const a = new Set(n.modelValue);
|
|
2382
|
-
|
|
2522
|
+
r.value.forEach((d) => {
|
|
2383
2523
|
if (!d.disabled) {
|
|
2384
2524
|
const f = l(d);
|
|
2385
2525
|
s[f] = a.has(f);
|
|
@@ -2387,12 +2527,12 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2387
2527
|
});
|
|
2388
2528
|
}
|
|
2389
2529
|
});
|
|
2390
|
-
else if (
|
|
2391
|
-
const a = l(
|
|
2530
|
+
else if (r.value = n.options, typeof n.modelValue == "boolean" && r.value.length === 1) {
|
|
2531
|
+
const a = l(r.value[0]);
|
|
2392
2532
|
s[a] = n.modelValue;
|
|
2393
2533
|
} else if (Array.isArray(n.modelValue)) {
|
|
2394
2534
|
const a = new Set(n.modelValue);
|
|
2395
|
-
|
|
2535
|
+
r.value.forEach((d) => {
|
|
2396
2536
|
if (!d.disabled) {
|
|
2397
2537
|
const f = l(d);
|
|
2398
2538
|
s[f] = a.has(f);
|
|
@@ -2402,7 +2542,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2402
2542
|
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2403
2543
|
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2404
2544
|
}, [
|
|
2405
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2545
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (f) => (openBlock(), createBlock(_sfc_main$w, {
|
|
2406
2546
|
modelValue: s[l(f)],
|
|
2407
2547
|
"onUpdate:modelValue": (h) => s[l(f)] = h,
|
|
2408
2548
|
value: l(f),
|
|
@@ -2418,7 +2558,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2418
2558
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
2419
2559
|
], 2));
|
|
2420
2560
|
}
|
|
2421
|
-
}), VsInputCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2561
|
+
}), VsInputCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-9685f778"]]), _hoisted_1$g = ["placeholder", "disabled"], _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
2422
2562
|
__name: "vs-input-date1",
|
|
2423
2563
|
props: /* @__PURE__ */ mergeModels({
|
|
2424
2564
|
style: {
|
|
@@ -2443,31 +2583,31 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2443
2583
|
}),
|
|
2444
2584
|
emits: ["update:modelValue"],
|
|
2445
2585
|
setup(e) {
|
|
2446
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
2447
|
-
return (
|
|
2586
|
+
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
2587
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
2448
2588
|
type: "date",
|
|
2449
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
2589
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
2450
2590
|
placeholder: e.placeholder,
|
|
2451
2591
|
disabled: e.disabled,
|
|
2452
2592
|
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(n)]]),
|
|
2453
2593
|
style: {
|
|
2454
2594
|
border: "1px solid #CFD9E0"
|
|
2455
2595
|
}
|
|
2456
|
-
}, null, 10, _hoisted_1$
|
|
2457
|
-
[vModelText,
|
|
2596
|
+
}, null, 10, _hoisted_1$g)), [
|
|
2597
|
+
[vModelText, o.value]
|
|
2458
2598
|
]);
|
|
2459
2599
|
}
|
|
2460
|
-
}), fileUpload = async (e, t, n,
|
|
2600
|
+
}), fileUpload = async (e, t, n, o) => {
|
|
2461
2601
|
try {
|
|
2462
|
-
const
|
|
2463
|
-
|
|
2602
|
+
const r = new FormData();
|
|
2603
|
+
r.append("unique", "true"), r.append("file", e);
|
|
2464
2604
|
const { data: s } = await axios.post(
|
|
2465
|
-
`/file/upload/uploads?id=${t || ""}&form=${n || ""}&table=${
|
|
2466
|
-
|
|
2605
|
+
`/file/upload/uploads?id=${t || ""}&form=${n || ""}&table=${o || ""}`,
|
|
2606
|
+
r
|
|
2467
2607
|
);
|
|
2468
2608
|
return s;
|
|
2469
|
-
} catch (
|
|
2470
|
-
console.error(
|
|
2609
|
+
} catch (r) {
|
|
2610
|
+
console.error(r);
|
|
2471
2611
|
}
|
|
2472
2612
|
}, fileDelete = async (e) => {
|
|
2473
2613
|
try {
|
|
@@ -2482,12 +2622,12 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2482
2622
|
headers: {
|
|
2483
2623
|
"Content-Type": "application/json"
|
|
2484
2624
|
}
|
|
2485
|
-
}), n = t.headers["content-type"],
|
|
2486
|
-
s.setAttribute("download", e), s.href = window.URL.createObjectURL(
|
|
2625
|
+
}), n = t.headers["content-type"], o = new TextDecoder("utf-8").decode(t.data), r = new Blob([o], { type: n }), s = document.createElement("a");
|
|
2626
|
+
s.setAttribute("download", e), s.href = window.URL.createObjectURL(r), s.click();
|
|
2487
2627
|
} catch (t) {
|
|
2488
2628
|
console.error(t.message);
|
|
2489
2629
|
}
|
|
2490
|
-
}, _sfc_main$
|
|
2630
|
+
}, _sfc_main$i = {}, _hoisted_1$f = {
|
|
2491
2631
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2492
2632
|
width: "24",
|
|
2493
2633
|
height: "24",
|
|
@@ -2498,13 +2638,13 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_rend
|
|
|
2498
2638
|
"stroke-linecap": "round",
|
|
2499
2639
|
"stroke-linejoin": "round"
|
|
2500
2640
|
};
|
|
2501
|
-
function _sfc_render$
|
|
2502
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2641
|
+
function _sfc_render$8(e, t) {
|
|
2642
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$f, t[0] || (t[0] = [
|
|
2503
2643
|
createElementVNode("path", { d: "M5 12h14" }, null, -1),
|
|
2504
2644
|
createElementVNode("path", { d: "M12 5v14" }, null, -1)
|
|
2505
2645
|
]));
|
|
2506
2646
|
}
|
|
2507
|
-
const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2647
|
+
const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$8]]), _sfc_main$h = {}, _hoisted_1$e = {
|
|
2508
2648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2509
2649
|
class: "icon icon-tabler icon-tabler-file-text",
|
|
2510
2650
|
width: "44",
|
|
@@ -2516,12 +2656,12 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_rende
|
|
|
2516
2656
|
"stroke-linecap": "round",
|
|
2517
2657
|
"stroke-linejoin": "round"
|
|
2518
2658
|
};
|
|
2519
|
-
function _sfc_render$
|
|
2520
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2659
|
+
function _sfc_render$7(e, t, n, o, r, s) {
|
|
2660
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$e, t[0] || (t[0] = [
|
|
2521
2661
|
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)
|
|
2522
2662
|
]));
|
|
2523
2663
|
}
|
|
2524
|
-
const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2664
|
+
const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$7]]), _sfc_main$g = {}, _hoisted_1$d = {
|
|
2525
2665
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2526
2666
|
class: "icon icon-tabler icon-tabler-table",
|
|
2527
2667
|
width: "44",
|
|
@@ -2533,8 +2673,8 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render
|
|
|
2533
2673
|
"stroke-linecap": "round",
|
|
2534
2674
|
"stroke-linejoin": "round"
|
|
2535
2675
|
};
|
|
2536
|
-
function _sfc_render$
|
|
2537
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2676
|
+
function _sfc_render$6(e, t, n, o, r, s) {
|
|
2677
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$d, t[0] || (t[0] = [
|
|
2538
2678
|
createElementVNode("path", {
|
|
2539
2679
|
stroke: "none",
|
|
2540
2680
|
d: "M0 0h24v24H0z",
|
|
@@ -2561,7 +2701,7 @@ function _sfc_render$9(e, t, n, r, o, s) {
|
|
|
2561
2701
|
}, null, -1)
|
|
2562
2702
|
]));
|
|
2563
2703
|
}
|
|
2564
|
-
const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2704
|
+
const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$6]]), _sfc_main$f = {}, _hoisted_1$c = {
|
|
2565
2705
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2566
2706
|
width: "24",
|
|
2567
2707
|
height: "24",
|
|
@@ -2573,12 +2713,12 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render
|
|
|
2573
2713
|
"stroke-linejoin": "round",
|
|
2574
2714
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2575
2715
|
};
|
|
2576
|
-
function _sfc_render$
|
|
2577
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2716
|
+
function _sfc_render$5(e, t, n, o, r, s) {
|
|
2717
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$c, t[0] || (t[0] = [
|
|
2578
2718
|
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)
|
|
2579
2719
|
]));
|
|
2580
2720
|
}
|
|
2581
|
-
const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2721
|
+
const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$5]]), _sfc_main$e = {}, _hoisted_1$b = {
|
|
2582
2722
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2583
2723
|
class: "icon icon-tabler icon-tabler-file-zip",
|
|
2584
2724
|
width: "44",
|
|
@@ -2590,12 +2730,12 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_rende
|
|
|
2590
2730
|
"stroke-linecap": "round",
|
|
2591
2731
|
"stroke-linejoin": "round"
|
|
2592
2732
|
};
|
|
2593
|
-
function _sfc_render$
|
|
2594
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2733
|
+
function _sfc_render$4(e, t, n, o, r, s) {
|
|
2734
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$b, t[0] || (t[0] = [
|
|
2595
2735
|
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)
|
|
2596
2736
|
]));
|
|
2597
2737
|
}
|
|
2598
|
-
const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2738
|
+
const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$4]]), _sfc_main$d = {}, _hoisted_1$a = {
|
|
2599
2739
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2600
2740
|
class: "icon icon-tabler icon-tabler-file-code",
|
|
2601
2741
|
width: "44",
|
|
@@ -2607,12 +2747,12 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render
|
|
|
2607
2747
|
"stroke-linecap": "round",
|
|
2608
2748
|
"stroke-linejoin": "round"
|
|
2609
2749
|
};
|
|
2610
|
-
function _sfc_render$
|
|
2611
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2750
|
+
function _sfc_render$3(e, t, n, o, r, s) {
|
|
2751
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$a, t[0] || (t[0] = [
|
|
2612
2752
|
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)
|
|
2613
2753
|
]));
|
|
2614
2754
|
}
|
|
2615
|
-
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2755
|
+
const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$3]]), getFileType = (e) => {
|
|
2616
2756
|
if (!e) return "";
|
|
2617
2757
|
const t = e?.split(".");
|
|
2618
2758
|
return t[t.length - 1];
|
|
@@ -2625,7 +2765,7 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
|
|
|
2625
2765
|
documentsFormat: ["pdf"]
|
|
2626
2766
|
};
|
|
2627
2767
|
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;
|
|
2628
|
-
}, _sfc_main$
|
|
2768
|
+
}, _sfc_main$c = {}, _hoisted_1$9 = {
|
|
2629
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2630
2770
|
width: "24",
|
|
2631
2771
|
height: "24",
|
|
@@ -2637,12 +2777,12 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
|
|
|
2637
2777
|
"stroke-linejoin": "round",
|
|
2638
2778
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
|
|
2639
2779
|
};
|
|
2640
|
-
function _sfc_render$
|
|
2641
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2780
|
+
function _sfc_render$2(e, t) {
|
|
2781
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$9, t[0] || (t[0] = [
|
|
2642
2782
|
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)
|
|
2643
2783
|
]));
|
|
2644
2784
|
}
|
|
2645
|
-
const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2785
|
+
const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$2]]), _sfc_main$b = {}, _hoisted_1$8 = {
|
|
2646
2786
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2647
2787
|
width: "24",
|
|
2648
2788
|
height: "24",
|
|
@@ -2654,8 +2794,8 @@ const IconDelete = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_ren
|
|
|
2654
2794
|
"stroke-linejoin": "round",
|
|
2655
2795
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
|
|
2656
2796
|
};
|
|
2657
|
-
function _sfc_render$
|
|
2658
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
2797
|
+
function _sfc_render$1(e, t) {
|
|
2798
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$8, t[0] || (t[0] = [
|
|
2659
2799
|
createElementVNode("path", {
|
|
2660
2800
|
stroke: "none",
|
|
2661
2801
|
d: "M0 0h24v24H0z",
|
|
@@ -2666,7 +2806,7 @@ function _sfc_render$4(e, t) {
|
|
|
2666
2806
|
createElementVNode("path", { d: "M12 4l0 12" }, null, -1)
|
|
2667
2807
|
]));
|
|
2668
2808
|
}
|
|
2669
|
-
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2809
|
+
const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$1]]), _hoisted_1$7 = { 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$a = /* @__PURE__ */ defineComponent({
|
|
2670
2810
|
__name: "vs-input-file-list-item",
|
|
2671
2811
|
props: /* @__PURE__ */ mergeModels({
|
|
2672
2812
|
multiple: { type: Boolean }
|
|
@@ -2678,8 +2818,8 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2678
2818
|
}),
|
|
2679
2819
|
emits: ["update:value", "update:item"],
|
|
2680
2820
|
setup(e) {
|
|
2681
|
-
const t = useModel(e, "value"), n = useModel(e, "item"),
|
|
2682
|
-
return (
|
|
2821
|
+
const t = useModel(e, "value"), n = useModel(e, "item"), o = e;
|
|
2822
|
+
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
2683
2823
|
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(n.value)), {
|
|
2684
2824
|
src: n.value,
|
|
2685
2825
|
alt: "file",
|
|
@@ -2690,7 +2830,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2690
2830
|
createElementVNode("button", {
|
|
2691
2831
|
type: "button",
|
|
2692
2832
|
onClick: s[1] || (s[1] = (l) => {
|
|
2693
|
-
unref(fileDelete)(n.value), t.value =
|
|
2833
|
+
unref(fileDelete)(n.value), t.value = o.multiple ? t.value?.filter((i) => i !== n.value) : "";
|
|
2694
2834
|
}),
|
|
2695
2835
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
2696
2836
|
}, [
|
|
@@ -2706,10 +2846,10 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2706
2846
|
])
|
|
2707
2847
|
]));
|
|
2708
2848
|
}
|
|
2709
|
-
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2849
|
+
}), VsInputFileListItem = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-bc0f6d32"]]), _hoisted_1$6 = { class: "flex items-center gap-x-2" }, _hoisted_2$3 = {
|
|
2710
2850
|
key: 1,
|
|
2711
2851
|
class: "flex items-center flex-wrap gap-2"
|
|
2712
|
-
}, _sfc_main$
|
|
2852
|
+
}, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2713
2853
|
__name: "vs-input-file",
|
|
2714
2854
|
props: /* @__PURE__ */ mergeModels({
|
|
2715
2855
|
multiple: { type: Boolean },
|
|
@@ -2721,7 +2861,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2721
2861
|
}),
|
|
2722
2862
|
emits: ["update:modelValue"],
|
|
2723
2863
|
setup(e) {
|
|
2724
|
-
const t = e, n = useModel(e, "modelValue"),
|
|
2864
|
+
const t = e, n = useModel(e, "modelValue"), o = ref(null), r = (l) => Array.isArray(n.value) && n.value[l] || "", s = async (l) => {
|
|
2725
2865
|
if (t.format) {
|
|
2726
2866
|
const c = l.target.files?.[0];
|
|
2727
2867
|
if (!c || !c.name.endsWith(t.format))
|
|
@@ -2732,11 +2872,11 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2732
2872
|
const u = await fileUpload(i, "1", "form", "table");
|
|
2733
2873
|
n.value = t.multiple ? [...n.value || [], u.result?.file_path] : u.result?.file_path;
|
|
2734
2874
|
};
|
|
2735
|
-
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2875
|
+
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2736
2876
|
createElementVNode("input", {
|
|
2737
2877
|
class: "hidden",
|
|
2738
2878
|
ref_key: "fileInput",
|
|
2739
|
-
ref:
|
|
2879
|
+
ref: o,
|
|
2740
2880
|
type: "file",
|
|
2741
2881
|
onChange: s
|
|
2742
2882
|
}, null, 544),
|
|
@@ -2752,10 +2892,10 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2752
2892
|
key: c,
|
|
2753
2893
|
value: n.value,
|
|
2754
2894
|
"onUpdate:value": i[2] || (i[2] = (a) => n.value = a),
|
|
2755
|
-
item:
|
|
2895
|
+
item: r(c)
|
|
2756
2896
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
2757
2897
|
createElementVNode("div", {
|
|
2758
|
-
onClick: i[3] || (i[3] = (u) => !l.disabled &&
|
|
2898
|
+
onClick: i[3] || (i[3] = (u) => !l.disabled && o.value?.click()),
|
|
2759
2899
|
class: normalizeClass([
|
|
2760
2900
|
"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",
|
|
2761
2901
|
l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
@@ -2766,14 +2906,14 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2766
2906
|
])) : createCommentVNode("", !0),
|
|
2767
2907
|
l.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
2768
2908
|
key: 2,
|
|
2769
|
-
onClick: i[4] || (i[4] = (u) =>
|
|
2909
|
+
onClick: i[4] || (i[4] = (u) => o.value?.click()),
|
|
2770
2910
|
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"])
|
|
2771
2911
|
}, [
|
|
2772
2912
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
2773
2913
|
], 2))
|
|
2774
2914
|
]));
|
|
2775
2915
|
}
|
|
2776
|
-
}), _hoisted_1$
|
|
2916
|
+
}), _hoisted_1$5 = { 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$8 = /* @__PURE__ */ defineComponent({
|
|
2777
2917
|
__name: "vs-container-switcher",
|
|
2778
2918
|
props: {
|
|
2779
2919
|
title: {
|
|
@@ -2793,22 +2933,22 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2793
2933
|
const t = e, n = ref(t.isOpen);
|
|
2794
2934
|
return watch(
|
|
2795
2935
|
() => t.isOpen,
|
|
2796
|
-
(
|
|
2797
|
-
n.value =
|
|
2936
|
+
(o) => {
|
|
2937
|
+
n.value = o;
|
|
2798
2938
|
}
|
|
2799
|
-
), (
|
|
2800
|
-
createElementVNode("div", _hoisted_1$
|
|
2939
|
+
), (o, r) => (openBlock(), createElementBlock("div", null, [
|
|
2940
|
+
createElementVNode("div", _hoisted_1$5, [
|
|
2801
2941
|
createElementVNode("p", _hoisted_2$2, toDisplayString(e.title), 1),
|
|
2802
|
-
createVNode(_sfc_main$
|
|
2942
|
+
createVNode(_sfc_main$r, {
|
|
2803
2943
|
modelValue: n.value,
|
|
2804
|
-
"onUpdate:modelValue":
|
|
2944
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => n.value = s),
|
|
2805
2945
|
style: normalizeStyle(e.style)
|
|
2806
2946
|
}, null, 8, ["modelValue", "style"])
|
|
2807
2947
|
]),
|
|
2808
2948
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2809
2949
|
default: withCtx(() => [
|
|
2810
2950
|
withDirectives(createElementVNode("div", _hoisted_3$1, [
|
|
2811
|
-
renderSlot(
|
|
2951
|
+
renderSlot(o.$slots, "default", {}, void 0, !0)
|
|
2812
2952
|
], 512), [
|
|
2813
2953
|
[vShow, n.value]
|
|
2814
2954
|
])
|
|
@@ -2817,63 +2957,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_r
|
|
|
2817
2957
|
})
|
|
2818
2958
|
]));
|
|
2819
2959
|
}
|
|
2820
|
-
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2821
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2822
|
-
viewBox: "0 0 24 24",
|
|
2823
|
-
fill: "none",
|
|
2824
|
-
stroke: "currentColor",
|
|
2825
|
-
"stroke-width": "2",
|
|
2826
|
-
"stroke-linecap": "round",
|
|
2827
|
-
"stroke-linejoin": "round",
|
|
2828
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
2829
|
-
};
|
|
2830
|
-
function _sfc_render$3(e, t) {
|
|
2831
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$7, t[0] || (t[0] = [
|
|
2832
|
-
createElementVNode("path", {
|
|
2833
|
-
stroke: "none",
|
|
2834
|
-
d: "M0 0h24v24H0z",
|
|
2835
|
-
fill: "none"
|
|
2836
|
-
}, null, -1),
|
|
2837
|
-
createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
2838
|
-
]));
|
|
2839
|
-
}
|
|
2840
|
-
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$3]]), _sfc_main$9 = {}, _hoisted_1$6 = {
|
|
2841
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2842
|
-
viewBox: "0 0 24 24",
|
|
2843
|
-
fill: "none",
|
|
2844
|
-
stroke: "currentColor",
|
|
2845
|
-
"stroke-width": "2",
|
|
2846
|
-
"stroke-linecap": "round",
|
|
2847
|
-
"stroke-linejoin": "round"
|
|
2848
|
-
};
|
|
2849
|
-
function _sfc_render$2(e, t) {
|
|
2850
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$6, t[0] || (t[0] = [
|
|
2851
|
-
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
2852
|
-
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
2853
|
-
]));
|
|
2854
|
-
}
|
|
2855
|
-
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$2]]), _sfc_main$8 = {}, _hoisted_1$5 = {
|
|
2856
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2857
|
-
viewBox: "0 0 24 24",
|
|
2858
|
-
fill: "none",
|
|
2859
|
-
stroke: "currentColor",
|
|
2860
|
-
"stroke-width": "2",
|
|
2861
|
-
"stroke-linecap": "round",
|
|
2862
|
-
"stroke-linejoin": "round",
|
|
2863
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
2864
|
-
};
|
|
2865
|
-
function _sfc_render$1(e, t) {
|
|
2866
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$5, t[0] || (t[0] = [
|
|
2867
|
-
createElementVNode("path", {
|
|
2868
|
-
stroke: "none",
|
|
2869
|
-
d: "M0 0h24v24H0z",
|
|
2870
|
-
fill: "none"
|
|
2871
|
-
}, null, -1),
|
|
2872
|
-
createElementVNode("path", { d: "M18 6l-12 12" }, null, -1),
|
|
2873
|
-
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
2874
|
-
]));
|
|
2875
|
-
}
|
|
2876
|
-
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$1]]), _hoisted_1$4 = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_2$1 = { class: "grid gap-3" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2960
|
+
}), VsContainerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-479564a3"]]), _hoisted_1$4 = { class: "text-[16px] text-gray-900 font-medium" }, _hoisted_2$1 = { class: "grid gap-3" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2877
2961
|
__name: "vs-container-accordion",
|
|
2878
2962
|
props: {
|
|
2879
2963
|
title: {
|
|
@@ -2893,13 +2977,13 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rend
|
|
|
2893
2977
|
const t = e, n = ref(t.isOpen);
|
|
2894
2978
|
return watch(
|
|
2895
2979
|
() => t.isOpen,
|
|
2896
|
-
(
|
|
2897
|
-
n.value =
|
|
2980
|
+
(o) => {
|
|
2981
|
+
n.value = o;
|
|
2898
2982
|
}
|
|
2899
|
-
), (
|
|
2983
|
+
), (o, r) => (openBlock(), createElementBlock("div", null, [
|
|
2900
2984
|
createElementVNode("button", {
|
|
2901
2985
|
type: "button",
|
|
2902
|
-
onClick:
|
|
2986
|
+
onClick: r[0] || (r[0] = (s) => n.value = !n.value),
|
|
2903
2987
|
class: "flex items-center gap-2"
|
|
2904
2988
|
}, [
|
|
2905
2989
|
createVNode(unref(IconChevronDown), {
|
|
@@ -2910,7 +2994,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rend
|
|
|
2910
2994
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
2911
2995
|
default: withCtx(() => [
|
|
2912
2996
|
withDirectives(createElementVNode("div", _hoisted_2$1, [
|
|
2913
|
-
renderSlot(
|
|
2997
|
+
renderSlot(o.$slots, "default", {}, void 0, !0)
|
|
2914
2998
|
], 512), [
|
|
2915
2999
|
[vShow, n.value]
|
|
2916
3000
|
])
|
|
@@ -3007,7 +3091,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rend
|
|
|
3007
3091
|
}
|
|
3008
3092
|
},
|
|
3009
3093
|
setup(e) {
|
|
3010
|
-
const t = e, n = inject("formValues", { default: {} }),
|
|
3094
|
+
const t = e, n = inject("formValues", { default: {} }), o = inject("form"), r = computed(() => t.schema?.filter((l) => {
|
|
3011
3095
|
const i = l?.conditions;
|
|
3012
3096
|
if (!i) return !0;
|
|
3013
3097
|
const u = Array.isArray(i) ? i[0] : i, c = n?.value?.[u];
|
|
@@ -3019,60 +3103,60 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_rend
|
|
|
3019
3103
|
style: normalizeStyle(e.style)
|
|
3020
3104
|
}, {
|
|
3021
3105
|
default: withCtx(() => [
|
|
3022
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3106
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (u) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3023
3107
|
key: u.name
|
|
3024
3108
|
}, { ref_for: !0 }, u, {
|
|
3025
3109
|
item: u,
|
|
3026
3110
|
modelValue: unref(n)[u.name],
|
|
3027
3111
|
"onUpdate:modelValue": (c) => unref(n)[u.name] = c,
|
|
3028
3112
|
style: e.style,
|
|
3029
|
-
error: unref(
|
|
3113
|
+
error: unref(o)?.errors?.[u.name]
|
|
3030
3114
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3031
3115
|
]),
|
|
3032
3116
|
_: 1
|
|
3033
3117
|
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
3034
3118
|
}
|
|
3035
|
-
}), dynamicPosition = async (e, t, n,
|
|
3119
|
+
}), dynamicPosition = async (e, t, n, o = 10) => {
|
|
3036
3120
|
if (!t || !n) return;
|
|
3037
3121
|
await nextTick();
|
|
3038
|
-
const
|
|
3039
|
-
if (!s || !
|
|
3122
|
+
const r = await n?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
3123
|
+
if (!s || !r) return;
|
|
3040
3124
|
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;
|
|
3041
3125
|
let f = 0, h = 0;
|
|
3042
|
-
const p = s.bottom +
|
|
3126
|
+
const p = s.bottom + o + u;
|
|
3043
3127
|
switch (e) {
|
|
3044
3128
|
case "top":
|
|
3045
|
-
s.top -
|
|
3129
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, d > c + s.right + 30 ? h = s.left - r.width / 2 + s.width / 2 : h = d - 30 - c;
|
|
3046
3130
|
break;
|
|
3047
3131
|
case "bottom":
|
|
3048
|
-
a > p ? f = s.bottom +
|
|
3132
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, h = s.left - r.width / 2 + s.width / 2;
|
|
3049
3133
|
break;
|
|
3050
3134
|
case "left":
|
|
3051
|
-
f = s.top -
|
|
3135
|
+
f = s.top - r.height / 2 + s.height / 2, s.left - r.width - o > 0 ? h = s.left - r.width - o : h = 10;
|
|
3052
3136
|
break;
|
|
3053
3137
|
case "right":
|
|
3054
|
-
f = s.top -
|
|
3138
|
+
f = s.top - r.height / 2 + s.height / 2, d - i > c ? h = s.right + o : h = d - 30 - c;
|
|
3055
3139
|
break;
|
|
3056
3140
|
case "top-right":
|
|
3057
|
-
s.top -
|
|
3141
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, d - i > c ? h = s.right + o : h = d - 30 - c;
|
|
3058
3142
|
break;
|
|
3059
3143
|
case "top-left":
|
|
3060
|
-
s.top -
|
|
3144
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, s.left - r.width - o > 0 ? h = s.left - r.width - o : h = 10;
|
|
3061
3145
|
break;
|
|
3062
3146
|
case "top-start":
|
|
3063
|
-
s.top -
|
|
3147
|
+
s.top - r.height - o < 0 ? f = s.top - r.height + o + u + l : f = s.top - r.height - o, s.left > 0 ? h = s.left : h = 10;
|
|
3064
3148
|
break;
|
|
3065
3149
|
case "bottom-right":
|
|
3066
|
-
a > p ? f = s.bottom +
|
|
3150
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, d - i > c ? h = s.left : h = d - 30 - c;
|
|
3067
3151
|
break;
|
|
3068
3152
|
case "bottom-left":
|
|
3069
|
-
a > p ? f = s.bottom +
|
|
3153
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, s.left > 0 ? h = s.right - c : h = 10;
|
|
3070
3154
|
break;
|
|
3071
3155
|
case "bottom-start":
|
|
3072
|
-
a > p ? f = s.bottom +
|
|
3156
|
+
a > p ? f = s.bottom + o : f = s.bottom - o - u - l, s.left > 0 ? h = s.left : h = 10;
|
|
3073
3157
|
break;
|
|
3074
3158
|
}
|
|
3075
|
-
f + u > a ? f = a - u -
|
|
3159
|
+
f + u > a ? f = a - u - o : f < 0 && (f = o), h + c > d ? h = d - c - o : h < 0 && (h = o), n instanceof HTMLElement && (n.style.top = `${f}px`, n.style.left = `${h}px`, n.style.position = "fixed");
|
|
3076
3160
|
}, _sfc_main$4 = {}, _hoisted_1$2 = {
|
|
3077
3161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3078
3162
|
viewBox: "0 0 24 24",
|
|
@@ -3113,7 +3197,10 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3113
3197
|
customClass: { default: "" },
|
|
3114
3198
|
style: { default: () => ({}) },
|
|
3115
3199
|
disabled: { type: Boolean },
|
|
3116
|
-
mode: {}
|
|
3200
|
+
mode: {},
|
|
3201
|
+
api: {},
|
|
3202
|
+
search: { type: Boolean },
|
|
3203
|
+
error: { default: null }
|
|
3117
3204
|
}, {
|
|
3118
3205
|
modelValue: {
|
|
3119
3206
|
type: [Number, String],
|
|
@@ -3123,89 +3210,93 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3123
3210
|
}),
|
|
3124
3211
|
emits: ["update:modelValue"],
|
|
3125
3212
|
setup(e) {
|
|
3126
|
-
const t = e, { inputClass:
|
|
3127
|
-
|
|
3128
|
-
const
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3213
|
+
const t = e, n = computed(() => t.mode || (t.api || t.search ? "search" : null)), { inputClass: o } = useStyle(t.style), r = useModel(e, "modelValue"), s = ref({}), l = ref(null), i = ref(null), u = ref(!1), c = ref(null), a = ref([]), d = ref(-1), f = ref([]), h = ref(""), p = ref(null);
|
|
3214
|
+
let y = null;
|
|
3215
|
+
const m = computed(() => {
|
|
3216
|
+
if (a.value?.length) {
|
|
3217
|
+
const b = a.value?.filter((g) => g?.id !== c.value?.id);
|
|
3218
|
+
return [
|
|
3219
|
+
c.value
|
|
3220
|
+
].concat(b)?.filter((g) => g !== null);
|
|
3221
|
+
}
|
|
3222
|
+
return [];
|
|
3223
|
+
}), x = async () => {
|
|
3134
3224
|
try {
|
|
3135
3225
|
const { data: b } = await axios.get(
|
|
3136
|
-
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${
|
|
3226
|
+
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${h.value}`
|
|
3137
3227
|
);
|
|
3138
3228
|
return b.data;
|
|
3139
3229
|
} catch {
|
|
3140
3230
|
return [];
|
|
3141
3231
|
}
|
|
3142
|
-
},
|
|
3143
|
-
document.body.click(),
|
|
3144
|
-
}, $ = () =>
|
|
3145
|
-
|
|
3146
|
-
},
|
|
3232
|
+
}, v = async (b) => {
|
|
3233
|
+
document.body.click(), u.value = b !== void 0 ? b : !u.value, u.value && !a.value?.length && (!t.options?.length && t.data ? a.value = await x() : t.options?.length && (a.value = [...t.options])), u.value && l.value ? (s.value.width = `${l.value.getBoundingClientRect()?.width}px`, t.mode === "search" && p.value?.focus(), i.value && dynamicPosition("bottom-start", l.value, i.value)) : d.value = -1;
|
|
3234
|
+
}, $ = () => u.value ? v(!1) : null, _ = (b) => {
|
|
3235
|
+
c.value = b, r.value = b.id, v(!1);
|
|
3236
|
+
}, k = (b, g) => {
|
|
3147
3237
|
if (!b || !g) return;
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3150
|
-
},
|
|
3151
|
-
if (!
|
|
3238
|
+
const w = b.offsetTop, A = w + b.offsetHeight, V = g.scrollTop, O = V + g.clientHeight;
|
|
3239
|
+
w < V ? Object.assign(g, { scrollTop: w - 80 }) : A > O && Object.assign(g, { scrollTop: A - g.clientHeight + 4 });
|
|
3240
|
+
}, E = (b) => {
|
|
3241
|
+
if (!u.value) return;
|
|
3152
3242
|
const { keyCode: g } = b;
|
|
3153
|
-
if ([38, 40, 13].includes(g) && b.preventDefault(), g
|
|
3154
|
-
if (
|
|
3155
|
-
|
|
3156
|
-
} else if (g
|
|
3157
|
-
if (
|
|
3158
|
-
|
|
3159
|
-
} else if (g
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3243
|
+
if ([38, 40, 13].includes(g) && b.preventDefault(), g === 38) {
|
|
3244
|
+
if (d.value === 0) return;
|
|
3245
|
+
d.value -= 1, k(f.value[d.value], i.value);
|
|
3246
|
+
} else if (g === 40) {
|
|
3247
|
+
if (d.value + 1 >= m.value?.length) return;
|
|
3248
|
+
d.value += 1, k(f.value[d.value], i.value);
|
|
3249
|
+
} else if (g === 13) {
|
|
3250
|
+
const w = m.value[d.value];
|
|
3251
|
+
w && _(w);
|
|
3162
3252
|
}
|
|
3163
|
-
},
|
|
3164
|
-
if (
|
|
3253
|
+
}, S = async (b) => {
|
|
3254
|
+
if (u.value) return;
|
|
3165
3255
|
const { keyCode: g } = b;
|
|
3166
|
-
[38, 40].includes(g) && (await b.preventDefault(),
|
|
3167
|
-
}, S = (b) => {
|
|
3168
|
-
i.value && s.value && l.value && !l.value.contains(b.target) && (i.value = !1);
|
|
3256
|
+
[38, 40].includes(g) && (await b.preventDefault(), d.value = 0, setTimeout(() => v()));
|
|
3169
3257
|
}, C = (b) => {
|
|
3170
|
-
|
|
3258
|
+
u.value && l.value && i.value && !i.value.contains(b.target) && (u.value = !1);
|
|
3259
|
+
}, B = (b) => {
|
|
3260
|
+
b?.key === "Escape" && u.value && v(!1);
|
|
3171
3261
|
};
|
|
3172
3262
|
return onMounted(async () => {
|
|
3173
|
-
addEventListener("click", $), addEventListener("keydown",
|
|
3263
|
+
addEventListener("click", $), addEventListener("keydown", E), addEventListener("scroll", C, !0), addEventListener("keydown", B), t.options && (a.value = t.options), r.value && !t.options?.length && t.data && (a.value = await x()), c.value = a.value?.find((b) => b?.id.toString() === r.value?.toString()) || null;
|
|
3174
3264
|
}), onUnmounted(() => {
|
|
3175
|
-
removeEventListener("click", $), removeEventListener("keydown",
|
|
3176
|
-
}), watch(
|
|
3265
|
+
removeEventListener("click", $), removeEventListener("keydown", E), removeEventListener("scroll", C, !0), removeEventListener("keydown", B);
|
|
3266
|
+
}), watch(h, (b) => {
|
|
3177
3267
|
let g = !1;
|
|
3178
|
-
(b
|
|
3179
|
-
!t.options?.length && t.data ?
|
|
3268
|
+
(b === "" || b.trimStart().length !== 0) && (g = !0), g && (y && clearTimeout(y), y = setTimeout(async () => {
|
|
3269
|
+
!t.options?.length && t.data ? a.value = await x() : a.value = t.options.filter((w) => w.text.toLowerCase().includes(b.toLowerCase()));
|
|
3180
3270
|
}, 200));
|
|
3181
3271
|
}), (b, g) => (openBlock(), createElementBlock("div", {
|
|
3182
3272
|
class: "relative w-full",
|
|
3183
3273
|
ref_key: "select",
|
|
3184
|
-
ref:
|
|
3274
|
+
ref: l,
|
|
3185
3275
|
onClick: g[5] || (g[5] = withModifiers(() => {
|
|
3186
3276
|
}, ["stop"]))
|
|
3187
3277
|
}, [
|
|
3188
3278
|
createElementVNode("button", {
|
|
3189
3279
|
type: "button",
|
|
3190
3280
|
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
unref(
|
|
3194
|
-
b.customClass
|
|
3281
|
+
u.value ? `ring-rind ring-2 ring-${b.style?.primaryColor || "blue"}-500` : "",
|
|
3282
|
+
c.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
3283
|
+
unref(o),
|
|
3284
|
+
b.customClass,
|
|
3285
|
+
{ "!border-red-600": b.error }
|
|
3195
3286
|
]]),
|
|
3196
|
-
onKeydown:
|
|
3197
|
-
onClick: g[0] || (g[0] = (
|
|
3287
|
+
onKeydown: S,
|
|
3288
|
+
onClick: g[0] || (g[0] = (w) => v(!u.value)),
|
|
3198
3289
|
disabled: b.disabled,
|
|
3199
3290
|
style: {
|
|
3200
3291
|
border: "1px solid #CFD9E0"
|
|
3201
3292
|
}
|
|
3202
3293
|
}, [
|
|
3203
|
-
|
|
3294
|
+
c.value?.color ? (openBlock(), createElementBlock("span", {
|
|
3204
3295
|
key: 0,
|
|
3205
3296
|
class: "w-[16px] h-[16px] rounded-md block",
|
|
3206
|
-
style: normalizeStyle({ backgroundColor:
|
|
3297
|
+
style: normalizeStyle({ backgroundColor: c.value?.color })
|
|
3207
3298
|
}, null, 4)) : createCommentVNode("", !0),
|
|
3208
|
-
|
|
3299
|
+
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(b.placeholder), 1))
|
|
3209
3300
|
], 42, _hoisted_1$1),
|
|
3210
3301
|
createElementVNode("span", _hoisted_4, [
|
|
3211
3302
|
createVNode(unref(IconChevronTopBottom), {
|
|
@@ -3213,11 +3304,11 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3213
3304
|
width: "14"
|
|
3214
3305
|
})
|
|
3215
3306
|
]),
|
|
3216
|
-
|
|
3307
|
+
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3217
3308
|
key: 0,
|
|
3218
3309
|
type: "button",
|
|
3219
|
-
onClick: g[1] || (g[1] = (
|
|
3220
|
-
r.value = null,
|
|
3310
|
+
onClick: g[1] || (g[1] = (w) => {
|
|
3311
|
+
r.value = null, c.value = null;
|
|
3221
3312
|
}),
|
|
3222
3313
|
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3223
3314
|
}, [
|
|
@@ -3230,59 +3321,59 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3230
3321
|
withDirectives(createElementVNode("ul", {
|
|
3231
3322
|
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",
|
|
3232
3323
|
ref_key: "list",
|
|
3233
|
-
ref:
|
|
3324
|
+
ref: i,
|
|
3234
3325
|
style: normalizeStyle({
|
|
3235
|
-
width:
|
|
3326
|
+
width: s.value.width,
|
|
3236
3327
|
maxHeight: b.maxHeight + "px",
|
|
3237
3328
|
backgroundColor: "white"
|
|
3238
3329
|
}),
|
|
3239
3330
|
onClick: g[4] || (g[4] = withModifiers(() => {
|
|
3240
3331
|
}, ["stop"]))
|
|
3241
3332
|
}, [
|
|
3242
|
-
|
|
3333
|
+
n.value === "search" ? (openBlock(), createElementBlock("li", _hoisted_5, [
|
|
3243
3334
|
createElementVNode("div", _hoisted_6, [
|
|
3244
3335
|
withDirectives(createElementVNode("input", {
|
|
3245
|
-
"onUpdate:modelValue": g[2] || (g[2] = (
|
|
3336
|
+
"onUpdate:modelValue": g[2] || (g[2] = (w) => h.value = w),
|
|
3246
3337
|
class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
|
|
3247
3338
|
placeholder: "Пошук",
|
|
3248
3339
|
type: "text",
|
|
3249
3340
|
ref_key: "inputRef",
|
|
3250
|
-
ref:
|
|
3341
|
+
ref: p
|
|
3251
3342
|
}, null, 512), [
|
|
3252
|
-
[vModelText,
|
|
3343
|
+
[vModelText, h.value]
|
|
3253
3344
|
]),
|
|
3254
3345
|
createVNode(IconMagnifyingGlass, {
|
|
3255
3346
|
width: "15px",
|
|
3256
3347
|
height: "15px",
|
|
3257
3348
|
class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"
|
|
3258
3349
|
}),
|
|
3259
|
-
|
|
3350
|
+
h.value != "" ? (openBlock(), createBlock(unref(IconClose), {
|
|
3260
3351
|
key: 0,
|
|
3261
3352
|
width: "15px",
|
|
3262
3353
|
height: "15px",
|
|
3263
|
-
onClick: g[3] || (g[3] = (
|
|
3354
|
+
onClick: g[3] || (g[3] = (w) => h.value = ""),
|
|
3264
3355
|
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
3265
3356
|
})) : createCommentVNode("", !0)
|
|
3266
3357
|
])
|
|
3267
3358
|
])) : createCommentVNode("", !0),
|
|
3268
|
-
|
|
3359
|
+
m.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3269
3360
|
g[6] || (g[6] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
3270
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3271
|
-
onClick: (
|
|
3272
|
-
key:
|
|
3361
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(m.value, (w, A) => (openBlock(), createElementBlock("li", {
|
|
3362
|
+
onClick: (V) => _(w),
|
|
3363
|
+
key: w?.id,
|
|
3273
3364
|
ref_for: !0,
|
|
3274
|
-
ref: (
|
|
3275
|
-
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [
|
|
3365
|
+
ref: (V) => f.value[A] = V,
|
|
3366
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [d.value == A ? "bg-gray-100" : ""]])
|
|
3276
3367
|
}, [
|
|
3277
3368
|
createElementVNode("span", _hoisted_8, [
|
|
3278
|
-
|
|
3369
|
+
w?.color ? (openBlock(), createElementBlock("span", {
|
|
3279
3370
|
key: 0,
|
|
3280
3371
|
class: "w-[16px] h-[16px] rounded-md block",
|
|
3281
|
-
style: normalizeStyle({ backgroundColor:
|
|
3372
|
+
style: normalizeStyle({ backgroundColor: w?.color })
|
|
3282
3373
|
}, null, 4)) : createCommentVNode("", !0),
|
|
3283
|
-
createTextVNode(" " + toDisplayString(
|
|
3374
|
+
createTextVNode(" " + toDisplayString(w?.text), 1)
|
|
3284
3375
|
]),
|
|
3285
|
-
r.value ==
|
|
3376
|
+
r.value == w?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
3286
3377
|
key: 0,
|
|
3287
3378
|
height: "14",
|
|
3288
3379
|
width: "14",
|
|
@@ -3292,7 +3383,7 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3292
3383
|
], 10, _hoisted_7))), 128))
|
|
3293
3384
|
], 64)) : (openBlock(), createElementBlock("li", _hoisted_9, "Дані відсутні"))
|
|
3294
3385
|
], 4), [
|
|
3295
|
-
[vShow,
|
|
3386
|
+
[vShow, u.value]
|
|
3296
3387
|
])
|
|
3297
3388
|
]))
|
|
3298
3389
|
], 512));
|
|
@@ -3322,9 +3413,9 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3322
3413
|
}),
|
|
3323
3414
|
emits: ["update:modelValue"],
|
|
3324
3415
|
setup(e) {
|
|
3325
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
3326
|
-
return (
|
|
3327
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) =>
|
|
3416
|
+
const t = e, { inputClass: n } = useStyle(t.style), o = useModel(e, "modelValue");
|
|
3417
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("textarea", {
|
|
3418
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.value = l),
|
|
3328
3419
|
placeholder: e.placeholder,
|
|
3329
3420
|
disabled: e.disabled,
|
|
3330
3421
|
row: "2",
|
|
@@ -3333,24 +3424,25 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3333
3424
|
border: "1px solid #CFD9E0"
|
|
3334
3425
|
}
|
|
3335
3426
|
}, null, 10, _hoisted_1)), [
|
|
3336
|
-
[vModelText,
|
|
3427
|
+
[vModelText, o.value]
|
|
3337
3428
|
]);
|
|
3338
3429
|
}
|
|
3339
3430
|
}), inputs = {
|
|
3340
|
-
VsInputText: _sfc_main$
|
|
3341
|
-
VsInputRadio: _sfc_main$
|
|
3342
|
-
"vs-input-text": _sfc_main$
|
|
3431
|
+
VsInputText: _sfc_main$B,
|
|
3432
|
+
VsInputRadio: _sfc_main$l,
|
|
3433
|
+
"vs-input-text": _sfc_main$B,
|
|
3343
3434
|
"vs-input-textarea": _sfc_main$2,
|
|
3344
|
-
"vs-input-mask": _sfc_main$
|
|
3345
|
-
"vs-input-number": _sfc_main$
|
|
3346
|
-
"vs-input-radio": _sfc_main$
|
|
3435
|
+
"vs-input-mask": _sfc_main$p,
|
|
3436
|
+
"vs-input-number": _sfc_main$A,
|
|
3437
|
+
"vs-input-radio": _sfc_main$l,
|
|
3347
3438
|
"vs-input-select": _sfc_main$3,
|
|
3348
|
-
"vs-input-switcher": _sfc_main$
|
|
3349
|
-
"vs-input-static": _sfc_main$
|
|
3439
|
+
"vs-input-switcher": _sfc_main$r,
|
|
3440
|
+
"vs-input-static": _sfc_main$q,
|
|
3350
3441
|
"vs-input-container": _sfc_main$5,
|
|
3351
|
-
"vs-input-date": _sfc_main$
|
|
3442
|
+
"vs-input-date": _sfc_main$j,
|
|
3352
3443
|
"vs-input-checkbox": VsInputCheckbox,
|
|
3353
|
-
"vs-input-file": _sfc_main$
|
|
3444
|
+
"vs-input-file": _sfc_main$9,
|
|
3445
|
+
"vs-input-html": _sfc_main$o
|
|
3354
3446
|
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3355
3447
|
__name: "vs-compact-form-layout",
|
|
3356
3448
|
props: {
|
|
@@ -3372,37 +3464,25 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3372
3464
|
}
|
|
3373
3465
|
},
|
|
3374
3466
|
setup(e) {
|
|
3375
|
-
const t = e, n = computed(() => layouts$1[`${t.layout}`]),
|
|
3376
|
-
return (
|
|
3467
|
+
const t = e, n = computed(() => layouts$1[`${t.layout}`]), o = computed(() => inputs?.[`vs-input-${t.type}`]);
|
|
3468
|
+
return (r, s) => (openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps(r.$attrs, {
|
|
3377
3469
|
style: e.style,
|
|
3378
3470
|
item: e.item
|
|
3379
3471
|
}), {
|
|
3380
3472
|
default: withCtx(() => [
|
|
3381
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3473
|
+
(openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps(r.$attrs, { style: e.style }), null, 16, ["style"]))
|
|
3382
3474
|
]),
|
|
3383
3475
|
_: 1
|
|
3384
3476
|
}, 16, ["style", "item"]));
|
|
3385
3477
|
}
|
|
3386
3478
|
}), formErrorsUa = {
|
|
3387
|
-
required: "Це поле є
|
|
3479
|
+
required: "Це поле є обов’язковим",
|
|
3388
3480
|
email: "Неправильний email"
|
|
3389
|
-
}, required = (e) => e ? !1 : formErrorsUa.required, email = (e) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) && e ? formErrorsUa.email : !1, regexp = (e, t) => {
|
|
3390
|
-
try {
|
|
3391
|
-
const n = typeof t.pattern == "string" ? new RegExp(t.pattern) : t.pattern;
|
|
3392
|
-
return !n || typeof n.test != "function" ? (console.warn("Invalid regexp pattern:", t.pattern), !1) : !n.test(e) && e ? t.message : !1;
|
|
3393
|
-
} catch (n) {
|
|
3394
|
-
return console.warn("Error creating regexp pattern:", n), !1;
|
|
3395
|
-
}
|
|
3396
|
-
}, custom = (value, customRule) => {
|
|
3481
|
+
}, required = (e) => e ? !1 : formErrorsUa.required, email = (e) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) && e ? formErrorsUa.email : !1, regexp = (e, t) => !(typeof t.pattern == "string" ? new RegExp(t.pattern) : t.pattern).test(e) && e ? t.message : !1, custom = (value, customRule) => {
|
|
3397
3482
|
const func = eval(customRule.function);
|
|
3398
3483
|
return func(value) ? !1 : customRule.message;
|
|
3399
3484
|
}, checkFormRules = (e, t) => {
|
|
3400
|
-
|
|
3401
|
-
return console.warn("Rule is undefined or null"), !1;
|
|
3402
|
-
const n = typeof t == "string" ? t : t.type;
|
|
3403
|
-
if (!n)
|
|
3404
|
-
return console.warn("Rule type is undefined or null:", t), !1;
|
|
3405
|
-
switch (n) {
|
|
3485
|
+
switch (typeof t == "string" ? t : t.type) {
|
|
3406
3486
|
case "required":
|
|
3407
3487
|
return required(e);
|
|
3408
3488
|
case "email":
|
|
@@ -3430,37 +3510,44 @@ function convertSchema(e) {
|
|
|
3430
3510
|
if (Array.isArray(e)) return e;
|
|
3431
3511
|
const t = [];
|
|
3432
3512
|
return Object.entries(e).forEach((n) => {
|
|
3433
|
-
const
|
|
3513
|
+
const o = {
|
|
3434
3514
|
name: n[0],
|
|
3435
3515
|
...n[1],
|
|
3436
3516
|
type: convertType(n[1].type),
|
|
3437
3517
|
label: n[1].label || n[1].ua,
|
|
3438
3518
|
rules: n[1].rules || n[1].validators
|
|
3439
3519
|
};
|
|
3440
|
-
n[1].data && (
|
|
3520
|
+
n[1].data && (o.api = `/api/suggest/${n[1].data}`), t.push(o);
|
|
3441
3521
|
}), t;
|
|
3442
3522
|
}
|
|
3443
3523
|
function useForm(e, t) {
|
|
3444
|
-
const n = convertSchema(t),
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3524
|
+
const n = convertSchema(t), o = ref({});
|
|
3525
|
+
function r(u) {
|
|
3526
|
+
const c = u?.conditions;
|
|
3527
|
+
if (!c) return !0;
|
|
3528
|
+
const a = Array.isArray(c) ? c[0] : c, d = e?.value?.[a];
|
|
3529
|
+
return isVisible(d, c);
|
|
3530
|
+
}
|
|
3531
|
+
const s = (u = n, c = !0) => (u.forEach((a) => {
|
|
3532
|
+
if (a.rules) {
|
|
3533
|
+
if (!r(a)) {
|
|
3534
|
+
console.log(a.name, "skip hidden"), delete o.value[a.name];
|
|
3535
|
+
return;
|
|
3536
|
+
}
|
|
3537
|
+
a.rules.forEach((d) => {
|
|
3538
|
+
const f = checkFormRules(e.value[a.name], d);
|
|
3539
|
+
f ? o.value[a.name] = f : delete o.value[a.name];
|
|
3540
|
+
});
|
|
3541
|
+
}
|
|
3542
|
+
a.schema && s(a.schema, !1);
|
|
3543
|
+
}), c && Object.values(o.value).some(Boolean) ? o.value : null), l = computed(() => n?.filter((u) => r(u)));
|
|
3457
3544
|
return {
|
|
3458
|
-
errors:
|
|
3459
|
-
validate:
|
|
3545
|
+
errors: o,
|
|
3546
|
+
validate: s,
|
|
3460
3547
|
reset: () => {
|
|
3461
|
-
e.value = {},
|
|
3548
|
+
e.value = {}, o.value = {};
|
|
3462
3549
|
},
|
|
3463
|
-
visibleSchema:
|
|
3550
|
+
visibleSchema: l
|
|
3464
3551
|
};
|
|
3465
3552
|
}
|
|
3466
3553
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -3477,12 +3564,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3477
3564
|
}),
|
|
3478
3565
|
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3479
3566
|
setup(e, { emit: t }) {
|
|
3480
|
-
const n = t,
|
|
3567
|
+
const n = t, o = e, r = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3481
3568
|
errors: i,
|
|
3482
3569
|
validate: u,
|
|
3483
3570
|
reset: c,
|
|
3484
3571
|
visibleSchema: a
|
|
3485
|
-
} = useForm(l,
|
|
3572
|
+
} = useForm(l, o.schema), d = () => {
|
|
3486
3573
|
u(), n("handle-submit", l.value);
|
|
3487
3574
|
};
|
|
3488
3575
|
return onMounted(() => {
|
|
@@ -3493,8 +3580,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3493
3580
|
}, [
|
|
3494
3581
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3495
3582
|
key: p.name,
|
|
3496
|
-
class: `col-span-${p.col || 12} `
|
|
3497
|
-
}, { ref_for: !0 }, { ...unref(
|
|
3583
|
+
class: f.layout === "horizontal" ? "col-span-12" : `col-span-${p.col || 12} `
|
|
3584
|
+
}, { ref_for: !0 }, { ...unref(r), ...f.style, ...p }, {
|
|
3498
3585
|
item: p,
|
|
3499
3586
|
layout: f.layout,
|
|
3500
3587
|
modelValue: l.value[p.name],
|
|
@@ -3510,6 +3597,6 @@ _sfc_main.install = function e(t) {
|
|
|
3510
3597
|
};
|
|
3511
3598
|
export {
|
|
3512
3599
|
_sfc_main as VForm,
|
|
3513
|
-
_sfc_main$
|
|
3600
|
+
_sfc_main$B as VsInputText,
|
|
3514
3601
|
_sfc_main as default
|
|
3515
3602
|
};
|