@opengis/form 0.0.8 → 0.0.10
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 +1498 -1284
- package/dist/index.umd.cjs +6 -6
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
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, createStaticVNode, vModelRadio, Fragment, renderList, mergeProps, reactive, watch, onMounted, createApp, h, Transition, vShow, inject, nextTick, onUnmounted, Teleport, useAttrs, provide } from "vue";
|
|
2
|
+
const _hoisted_1$A = { class: "w-full relative" }, _hoisted_2$d = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "text-[14px] font-medium text-gray-900 mb-2"
|
|
5
5
|
}, _hoisted_3$6 = {
|
|
@@ -8,7 +8,7 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
8
8
|
}, _hoisted_4$5 = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
11
|
-
}, _sfc_main$
|
|
11
|
+
}, _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
12
12
|
__name: "vs-layout-default",
|
|
13
13
|
props: {
|
|
14
14
|
ua: {
|
|
@@ -29,8 +29,8 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
setup(e) {
|
|
32
|
-
return (t,
|
|
33
|
-
e.ua || e.label ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
32
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$A, [
|
|
33
|
+
e.ua || e.label ? (openBlock(), createElementBlock("div", _hoisted_2$d, [
|
|
34
34
|
createElementVNode("span", null, toDisplayString(e.ua || e.label), 1),
|
|
35
35
|
e.item?.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_3$6, "*")) : createCommentVNode("", !0)
|
|
36
36
|
])) : createCommentVNode("", !0),
|
|
@@ -38,16 +38,16 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
38
38
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$5, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
39
39
|
]));
|
|
40
40
|
}
|
|
41
|
-
}), _hoisted_1$
|
|
41
|
+
}), _hoisted_1$z = { class: "w-full relative flex flex-row items-center gap-2" }, _hoisted_2$c = {
|
|
42
42
|
key: 0,
|
|
43
|
-
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12"
|
|
43
|
+
class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
|
|
44
44
|
}, _hoisted_3$5 = {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "text-red-500 text-[14px]"
|
|
47
47
|
}, _hoisted_4$4 = {
|
|
48
48
|
key: 1,
|
|
49
49
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
50
|
-
}, _sfc_main$
|
|
50
|
+
}, _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
51
51
|
__name: "vs-layout-horizontal",
|
|
52
52
|
props: {
|
|
53
53
|
ua: {
|
|
@@ -68,8 +68,8 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
setup(e) {
|
|
71
|
-
return (t,
|
|
72
|
-
e.item?.type !== "html" ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
71
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$z, [
|
|
72
|
+
e.item?.type !== "html" ? (openBlock(), createElementBlock("span", _hoisted_2$c, [
|
|
73
73
|
createTextVNode(toDisplayString(e.ua || e.label) + " ", 1),
|
|
74
74
|
e.item?.rules?.includes("required") && (e.ua || e.label) ? (openBlock(), createElementBlock("span", _hoisted_3$5, "*")) : createCommentVNode("", !0)
|
|
75
75
|
])) : createCommentVNode("", !0),
|
|
@@ -77,10 +77,10 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
77
77
|
e.error ? (openBlock(), createElementBlock("span", _hoisted_4$4, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
78
78
|
]));
|
|
79
79
|
}
|
|
80
|
-
}), _hoisted_1$
|
|
80
|
+
}), _hoisted_1$y = { class: "w-full relative" }, _hoisted_2$b = {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "text-red-500 text-[10px] absolute bottom-[-14px]"
|
|
83
|
-
}, _sfc_main$
|
|
83
|
+
}, _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
84
84
|
__name: "vs-layout-inline",
|
|
85
85
|
props: {
|
|
86
86
|
ua: {
|
|
@@ -101,25 +101,25 @@ const _hoisted_1$z = { class: "w-full relative" }, _hoisted_2$c = {
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
setup(e) {
|
|
104
|
-
return (t,
|
|
104
|
+
return (t, o) => (openBlock(), createElementBlock("div", _hoisted_1$y, [
|
|
105
105
|
renderSlot(t.$slots, "default", normalizeProps(guardReactiveProps(t.$attrs))),
|
|
106
|
-
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
106
|
+
e.error ? (openBlock(), createElementBlock("span", _hoisted_2$b, toDisplayString(e.error), 1)) : createCommentVNode("", !0)
|
|
107
107
|
]));
|
|
108
108
|
}
|
|
109
109
|
}), layouts$1 = {
|
|
110
|
-
default: _sfc_main$
|
|
111
|
-
horizontal: _sfc_main$
|
|
112
|
-
inline: _sfc_main$
|
|
110
|
+
default: _sfc_main$F,
|
|
111
|
+
horizontal: _sfc_main$E,
|
|
112
|
+
inline: _sfc_main$D
|
|
113
113
|
};
|
|
114
114
|
function useStyle(e) {
|
|
115
115
|
return {
|
|
116
116
|
inputClass: computed(() => {
|
|
117
|
-
const
|
|
118
|
-
return e?.size === "sm" ?
|
|
117
|
+
const o = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${e?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
|
|
118
|
+
return e?.size === "sm" ? o + "h-[32px]" : o + "h-[38px]";
|
|
119
119
|
})
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const _hoisted_1$
|
|
122
|
+
const _hoisted_1$x = ["placeholder", "disabled"], _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
123
123
|
__name: "vs-input-text",
|
|
124
124
|
props: /* @__PURE__ */ mergeModels({
|
|
125
125
|
style: {
|
|
@@ -148,21 +148,21 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
148
148
|
}),
|
|
149
149
|
emits: ["update:modelValue"],
|
|
150
150
|
setup(e) {
|
|
151
|
-
const t = e, { inputClass:
|
|
152
|
-
return (
|
|
151
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
152
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
153
153
|
type: "text",
|
|
154
|
-
"onUpdate:modelValue":
|
|
154
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
155
155
|
placeholder: e.placeholder,
|
|
156
156
|
disabled: e.disabled,
|
|
157
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
157
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o), { "!border-red-600": e.error }]]),
|
|
158
158
|
style: {
|
|
159
159
|
border: "1px solid #CFD9E0"
|
|
160
160
|
}
|
|
161
|
-
}, null, 10, _hoisted_1$
|
|
162
|
-
[vModelText,
|
|
161
|
+
}, null, 10, _hoisted_1$x)), [
|
|
162
|
+
[vModelText, n.value]
|
|
163
163
|
]);
|
|
164
164
|
}
|
|
165
|
-
}), _hoisted_1$
|
|
165
|
+
}), _hoisted_1$w = ["placeholder"], _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
166
166
|
__name: "vs-input-number",
|
|
167
167
|
props: /* @__PURE__ */ mergeModels({
|
|
168
168
|
style: {
|
|
@@ -179,25 +179,25 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
179
179
|
}),
|
|
180
180
|
emits: ["update:modelValue"],
|
|
181
181
|
setup(e) {
|
|
182
|
-
const t = e, { inputClass:
|
|
183
|
-
return (
|
|
182
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
183
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
184
184
|
type: "number",
|
|
185
|
-
"onUpdate:modelValue":
|
|
185
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
186
186
|
placeholder: e.placeholder,
|
|
187
|
-
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(
|
|
187
|
+
class: normalizeClass(["py-1.5 px-3 block w-full", [unref(o)]]),
|
|
188
188
|
style: {
|
|
189
189
|
border: "1px solid #CFD9E0"
|
|
190
190
|
}
|
|
191
|
-
}, null, 10, _hoisted_1$
|
|
192
|
-
[vModelText,
|
|
191
|
+
}, null, 10, _hoisted_1$w)), [
|
|
192
|
+
[vModelText, n.value]
|
|
193
193
|
]);
|
|
194
194
|
}
|
|
195
195
|
}), _export_sfc = (e, t) => {
|
|
196
|
-
const
|
|
197
|
-
for (const [
|
|
198
|
-
n
|
|
199
|
-
return
|
|
200
|
-
}, _sfc_main$
|
|
196
|
+
const o = e.__vccOpts || e;
|
|
197
|
+
for (const [n, r] of t)
|
|
198
|
+
o[n] = r;
|
|
199
|
+
return o;
|
|
200
|
+
}, _sfc_main$A = {}, _hoisted_1$v = {
|
|
201
201
|
xmlns: "http://www.w3.org/2000/svg",
|
|
202
202
|
viewBox: "0 0 24 24",
|
|
203
203
|
fill: "none",
|
|
@@ -208,7 +208,7 @@ const _hoisted_1$w = ["placeholder", "disabled"], _sfc_main$B = /* @__PURE__ */
|
|
|
208
208
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
|
|
209
209
|
};
|
|
210
210
|
function _sfc_render$d(e, t) {
|
|
211
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
211
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$v, t[0] || (t[0] = [
|
|
212
212
|
createElementVNode("path", {
|
|
213
213
|
stroke: "none",
|
|
214
214
|
d: "M0 0h24v24H0z",
|
|
@@ -217,7 +217,7 @@ function _sfc_render$d(e, t) {
|
|
|
217
217
|
createElementVNode("path", { d: "M5 12l5 5l10 -10" }, null, -1)
|
|
218
218
|
]));
|
|
219
219
|
}
|
|
220
|
-
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
220
|
+
const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$d]]), _hoisted_1$u = { class: "flex items-center gap-[4px]" }, _hoisted_2$a = ["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$z = /* @__PURE__ */ defineComponent({
|
|
221
221
|
__name: "vs-checkbox-default",
|
|
222
222
|
props: {
|
|
223
223
|
value: { type: [String, Number], default: "" },
|
|
@@ -230,27 +230,27 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
230
230
|
},
|
|
231
231
|
emits: ["update:modelValue"],
|
|
232
232
|
setup(e, { emit: t }) {
|
|
233
|
-
const
|
|
234
|
-
get: () =>
|
|
235
|
-
set: (
|
|
233
|
+
const o = t, n = e, r = computed({
|
|
234
|
+
get: () => n.modelValue,
|
|
235
|
+
set: (s) => o("update:modelValue", s)
|
|
236
236
|
});
|
|
237
|
-
return (
|
|
237
|
+
return (s, l) => (openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
238
238
|
withDirectives(createElementVNode("input", {
|
|
239
239
|
type: "checkbox",
|
|
240
240
|
value: e.value,
|
|
241
|
-
"onUpdate:modelValue": l[0] || (l[0] = (i) =>
|
|
241
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => r.value = i),
|
|
242
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
243
|
id: e.id,
|
|
244
244
|
disabled: e.disabled
|
|
245
|
-
}, null, 10, _hoisted_2$
|
|
246
|
-
[vModelCheckbox,
|
|
245
|
+
}, null, 10, _hoisted_2$a), [
|
|
246
|
+
[vModelCheckbox, r.value]
|
|
247
247
|
]),
|
|
248
248
|
createElementVNode("label", {
|
|
249
249
|
for: e.id,
|
|
250
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
251
|
}, [
|
|
252
252
|
createElementVNode("div", {
|
|
253
|
-
class: normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [
|
|
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
254
|
}, [
|
|
255
255
|
createVNode(IconCheck, {
|
|
256
256
|
height: "12",
|
|
@@ -258,17 +258,17 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
258
258
|
})
|
|
259
259
|
], 2),
|
|
260
260
|
createElementVNode("span", _hoisted_4$3, [
|
|
261
|
-
renderSlot(
|
|
261
|
+
renderSlot(s.$slots, "default", {}, () => [
|
|
262
262
|
createTextVNode(toDisplayString(e.label), 1)
|
|
263
263
|
])
|
|
264
264
|
])
|
|
265
265
|
], 10, _hoisted_3$4)
|
|
266
266
|
]));
|
|
267
267
|
}
|
|
268
|
-
}), _hoisted_1$
|
|
268
|
+
}), _hoisted_1$t = ["name", "value", "disabled"], _hoisted_2$9 = { class: "flex items-center gap-[6px] text-[14px]" }, _hoisted_3$3 = {
|
|
269
269
|
key: 0,
|
|
270
270
|
class: "text-[16px]"
|
|
271
|
-
}, _hoisted_4$2 = ["src"], _sfc_main$
|
|
271
|
+
}, _hoisted_4$2 = ["src"], _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
272
272
|
__name: "vs-checkbox-buttons",
|
|
273
273
|
props: {
|
|
274
274
|
value: { type: [String, Number, Boolean], default: "" },
|
|
@@ -285,26 +285,26 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
285
285
|
},
|
|
286
286
|
emits: ["update:modelValue"],
|
|
287
287
|
setup(e, { emit: t }) {
|
|
288
|
-
const
|
|
289
|
-
get: () =>
|
|
288
|
+
const o = e, n = t, r = computed({
|
|
289
|
+
get: () => o.modelValue,
|
|
290
290
|
set: (i) => {
|
|
291
|
-
|
|
291
|
+
n("update:modelValue", i);
|
|
292
292
|
}
|
|
293
|
-
}),
|
|
293
|
+
}), s = computed(() => Array.isArray(r.value) ? r.value.includes(o.value) : r.value === !0 || r.value === o.value), l = computed(() => o.style?.size === "xs" ? "p-1.5 text-xs" : o.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
|
|
294
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,
|
|
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
296
|
}, [
|
|
297
297
|
withDirectives(createElementVNode("input", {
|
|
298
298
|
type: "checkbox",
|
|
299
299
|
class: "hidden",
|
|
300
300
|
name: e.id,
|
|
301
301
|
value: e.value,
|
|
302
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
302
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
|
|
303
303
|
disabled: e.disabled
|
|
304
|
-
}, null, 8, _hoisted_1$
|
|
305
|
-
[vModelCheckbox,
|
|
304
|
+
}, null, 8, _hoisted_1$t), [
|
|
305
|
+
[vModelCheckbox, r.value]
|
|
306
306
|
]),
|
|
307
|
-
createElementVNode("span", _hoisted_2$
|
|
307
|
+
createElementVNode("span", _hoisted_2$9, [
|
|
308
308
|
e.icon || e.imgUrl ? (openBlock(), createElementBlock("span", _hoisted_3$3, [
|
|
309
309
|
e.icon ? (openBlock(), createElementBlock("i", {
|
|
310
310
|
key: 0,
|
|
@@ -325,9 +325,9 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
325
325
|
], 2));
|
|
326
326
|
}
|
|
327
327
|
}), VsCheckboxViews = {
|
|
328
|
-
"vs-checkbox-default": _sfc_main$
|
|
329
|
-
"vs-checkbox-buttons": _sfc_main$
|
|
330
|
-
}, _hoisted_1$
|
|
328
|
+
"vs-checkbox-default": _sfc_main$z,
|
|
329
|
+
"vs-checkbox-buttons": _sfc_main$y
|
|
330
|
+
}, _hoisted_1$s = { class: "flex items-center" }, _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
331
331
|
__name: "vs-input-checkbox-item",
|
|
332
332
|
props: {
|
|
333
333
|
value: { type: [String, Number], default: "" },
|
|
@@ -347,25 +347,25 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
347
347
|
},
|
|
348
348
|
emits: ["update:modelValue"],
|
|
349
349
|
setup(e, { emit: t }) {
|
|
350
|
-
const
|
|
351
|
-
get: () => Array.isArray(
|
|
350
|
+
const o = e, n = t, r = `radio-${Math.floor(Math.random() * 1e4)}`, s = computed({
|
|
351
|
+
get: () => Array.isArray(o.modelValue) ? Array.isArray(o.modelValue) && o.modelValue.includes(o.value) : o.modelValue,
|
|
352
352
|
set: (i) => {
|
|
353
|
-
if (Array.isArray(
|
|
354
|
-
let u = [...
|
|
355
|
-
i ? u.includes(
|
|
353
|
+
if (Array.isArray(o.modelValue)) {
|
|
354
|
+
let u = [...o.modelValue];
|
|
355
|
+
i ? u.includes(o.value) || u.push(o.value) : u = u.filter((c) => c !== o.value), n("update:modelValue", u);
|
|
356
356
|
} else
|
|
357
|
-
|
|
357
|
+
n("update:modelValue", i);
|
|
358
358
|
}
|
|
359
|
-
}), l = ref(`vs-checkbox-${
|
|
360
|
-
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$
|
|
359
|
+
}), l = ref(`vs-checkbox-${o.view || "default"}`);
|
|
360
|
+
return (i, u) => (openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
361
361
|
(openBlock(), createBlock(resolveDynamicComponent(unref(VsCheckboxViews)?.[l.value]), {
|
|
362
362
|
value: e.value,
|
|
363
363
|
label: e.label,
|
|
364
364
|
info: e.option?.info,
|
|
365
365
|
disabled: e.disabled,
|
|
366
|
-
modelValue:
|
|
367
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) =>
|
|
368
|
-
id:
|
|
366
|
+
modelValue: s.value,
|
|
367
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
|
|
368
|
+
id: r,
|
|
369
369
|
icon: e.icon,
|
|
370
370
|
imgUrl: e.imgUrl,
|
|
371
371
|
style: normalizeStyle(e.style),
|
|
@@ -378,199 +378,7 @@ const IconCheck = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_rend
|
|
|
378
378
|
}, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
|
|
379
379
|
]));
|
|
380
380
|
}
|
|
381
|
-
})
|
|
382
|
-
defineComponent({
|
|
383
|
-
props: {
|
|
384
|
-
modelValue: { type: Boolean, default: () => !1 },
|
|
385
|
-
title: { type: String, default: () => "" },
|
|
386
|
-
disabled: { type: Boolean, default: () => !1 }
|
|
387
|
-
},
|
|
388
|
-
data() {
|
|
389
|
-
return {};
|
|
390
|
-
},
|
|
391
|
-
mounted() {
|
|
392
|
-
this.modelValue || this.$emit("update:modelValue", !1);
|
|
393
|
-
},
|
|
394
|
-
computed: {
|
|
395
|
-
modelState: {
|
|
396
|
-
get() {
|
|
397
|
-
return this.modelValue;
|
|
398
|
-
},
|
|
399
|
-
set(e) {
|
|
400
|
-
this.$emit("update:modelValue", e);
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
labelCursorClasses() {
|
|
404
|
-
return [
|
|
405
|
-
{ "cursor-not-allowed": this.disabled },
|
|
406
|
-
{ "cursor-pointer": !this.disabled }
|
|
407
|
-
];
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
methods: {
|
|
411
|
-
handleEnterDown(e) {
|
|
412
|
-
const { keyCode: t } = e;
|
|
413
|
-
t === 13 && (this.modelState = !this.modelState);
|
|
414
|
-
},
|
|
415
|
-
addKeyHandler() {
|
|
416
|
-
window.addEventListener("keydown", this.handleEnterDown);
|
|
417
|
-
},
|
|
418
|
-
removeKeyHandler() {
|
|
419
|
-
window.removeEventListener("keydown", this.handleEnterDown);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
const I = async (e, t, n, o = 10) => {
|
|
424
|
-
if (!t || !n) return;
|
|
425
|
-
await nextTick();
|
|
426
|
-
const s = await n?.getBoundingClientRect(), r = await t?.getBoundingClientRect();
|
|
427
|
-
if (!r || !s) return;
|
|
428
|
-
const l = await parseInt(t?.getBoundingClientRect()?.height), i = await parseInt(t?.getBoundingClientRect()?.width), u = await parseInt(n?.getBoundingClientRect()?.height), c = await parseInt(n?.getBoundingClientRect()?.width), a = await window.innerHeight, f = await window.innerWidth;
|
|
429
|
-
let d = 0, p = 0;
|
|
430
|
-
const m = r.bottom + o + u;
|
|
431
|
-
switch (e) {
|
|
432
|
-
case "top":
|
|
433
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, f > c + r.right + 30 ? p = r.left - s.width / 2 + r.width / 2 : p = f - 30 - c;
|
|
434
|
-
break;
|
|
435
|
-
case "bottom":
|
|
436
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, p = r.left - s.width / 2 + r.width / 2;
|
|
437
|
-
break;
|
|
438
|
-
case "left":
|
|
439
|
-
d = r.top - s.height / 2 + r.height / 2, r.left - s.width - o > 0 ? p = r.left - s.width - o : p = 10;
|
|
440
|
-
break;
|
|
441
|
-
case "right":
|
|
442
|
-
d = r.top - s.height / 2 + r.height / 2, f - i > c ? p = r.right + o : p = f - 30 - c;
|
|
443
|
-
break;
|
|
444
|
-
case "top-right":
|
|
445
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, f - i > c ? p = r.right + o : p = f - 30 - c;
|
|
446
|
-
break;
|
|
447
|
-
case "top-left":
|
|
448
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, r.left - s.width - o > 0 ? p = r.left - s.width - o : p = 10;
|
|
449
|
-
break;
|
|
450
|
-
case "top-start":
|
|
451
|
-
r.top - s.height - o < 0 ? d = r.top - s.height + o + u + l : d = r.top - s.height - o, r.left > 0 ? p = r.left : p = 10;
|
|
452
|
-
break;
|
|
453
|
-
case "bottom-right":
|
|
454
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, f - i > c ? p = r.left : p = f - 30 - c;
|
|
455
|
-
break;
|
|
456
|
-
case "bottom-left":
|
|
457
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, r.left > 0 ? p = r.right - c : p = 10;
|
|
458
|
-
break;
|
|
459
|
-
case "bottom-start":
|
|
460
|
-
a > m ? d = r.bottom + o : d = r.bottom - o - u - l, r.left > 0 ? p = r.left : p = 10;
|
|
461
|
-
break;
|
|
462
|
-
}
|
|
463
|
-
d + u > a ? d = a - u - o : d < 0 && (d = o), p + c > f ? p = f - c - o : p < 0 && (p = o), n instanceof HTMLElement && (n.style.top = `${d}px`, n.style.left = `${p}px`, n.style.position = "fixed");
|
|
464
|
-
}, Ae = { class: "text-center" }, Ke = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, qe = {
|
|
465
|
-
__name: "vs-popover",
|
|
466
|
-
props: {
|
|
467
|
-
isOpen: { type: Boolean, default: () => !1 },
|
|
468
|
-
placement: { type: String, default: "top" },
|
|
469
|
-
gap: { type: Number, default: 8 },
|
|
470
|
-
width: { type: [String, Number], default: "" },
|
|
471
|
-
disabled: { type: Boolean, default: !1 },
|
|
472
|
-
trigger: { type: String, default: "click" },
|
|
473
|
-
teleport: { type: String, default: "body" }
|
|
474
|
-
},
|
|
475
|
-
emits: ["isvisible"],
|
|
476
|
-
setup(e, { expose: t, emit: n }) {
|
|
477
|
-
const o = e, s = n, r = ref(!1), l = ref([]), i = ref(null), u = ref(null), c = ref(null), a = (g) => {
|
|
478
|
-
if (!g) {
|
|
479
|
-
r.value = !1;
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
u.value?.contains(g.target) || c.value?.contains(g.target) || (r.value = !1);
|
|
483
|
-
}, f = (g) => {
|
|
484
|
-
r.value && c.value && !c.value.contains(g.target) && (r.value = !1);
|
|
485
|
-
}, d = () => {
|
|
486
|
-
r.value = !1;
|
|
487
|
-
}, p = () => {
|
|
488
|
-
r.value && (r.value = !1);
|
|
489
|
-
}, m = () => {
|
|
490
|
-
let g = i.value;
|
|
491
|
-
for (; g && g !== document.body; )
|
|
492
|
-
(g.scrollHeight > g.clientHeight || g.scrollWidth > g.clientWidth) && (g.addEventListener("scroll", d), l.value.push(g)), g = g.parentElement;
|
|
493
|
-
document.body && (document.body.addEventListener("scroll", d), l.value.push(document.body));
|
|
494
|
-
}, y = () => {
|
|
495
|
-
l.value.forEach((g) => {
|
|
496
|
-
g.removeEventListener("scroll", d);
|
|
497
|
-
}), l.value = [];
|
|
498
|
-
};
|
|
499
|
-
watch(r, (g) => {
|
|
500
|
-
g ? (m(), window.addEventListener("resize", () => I(o.placement, u.value, c.value)), I(o.placement, u.value, c.value)) : window.removeEventListener("resize", () => I(o.placement, u.value, c.value)), s("isvisible", g);
|
|
501
|
-
}), onMounted(() => {
|
|
502
|
-
window.addEventListener("click", a), window.addEventListener("popstate", p), window.addEventListener("scroll", f, !0), m();
|
|
503
|
-
}), onBeforeUnmount(() => {
|
|
504
|
-
window.removeEventListener("click", a), window.removeEventListener("popstate", p), y();
|
|
505
|
-
});
|
|
506
|
-
const h = () => {
|
|
507
|
-
r.value = !0, I(o.placement, u.value, c.value);
|
|
508
|
-
}, w = () => {
|
|
509
|
-
r.value = !1;
|
|
510
|
-
}, x = async () => {
|
|
511
|
-
await I(o.placement, u.value, c.value), r.value = !r.value;
|
|
512
|
-
};
|
|
513
|
-
return t({
|
|
514
|
-
togglePopover: x
|
|
515
|
-
}), (g, k) => (openBlock(), createElementBlock("div", {
|
|
516
|
-
ref_key: "popover",
|
|
517
|
-
ref: i,
|
|
518
|
-
class: "vs-popover inline-block"
|
|
519
|
-
}, [
|
|
520
|
-
createElementVNode("div", Ae, [
|
|
521
|
-
e.trigger === "click" ? (openBlock(), createElementBlock("div", {
|
|
522
|
-
key: 0,
|
|
523
|
-
ref_key: "popoverRef",
|
|
524
|
-
ref: u,
|
|
525
|
-
onClick: x,
|
|
526
|
-
class: normalizeClass({ "pointer-events-none": e.disabled })
|
|
527
|
-
}, [
|
|
528
|
-
renderSlot(g.$slots, "reference", {}, () => [
|
|
529
|
-
k[0] || (k[0] = createElementVNode("button", null, "Click me!", -1))
|
|
530
|
-
])
|
|
531
|
-
], 2)) : createCommentVNode("", !0),
|
|
532
|
-
e.trigger === "hover" ? (openBlock(), createElementBlock("div", {
|
|
533
|
-
key: 1,
|
|
534
|
-
ref_key: "popoverRef",
|
|
535
|
-
ref: u,
|
|
536
|
-
onMouseover: h,
|
|
537
|
-
onMouseleave: w,
|
|
538
|
-
class: normalizeClass({ "pointer-events-none": e.disabled })
|
|
539
|
-
}, [
|
|
540
|
-
renderSlot(g.$slots, "reference", {}, () => [
|
|
541
|
-
k[1] || (k[1] = createElementVNode("button", null, "Click me!", -1))
|
|
542
|
-
])
|
|
543
|
-
], 34)) : createCommentVNode("", !0),
|
|
544
|
-
(openBlock(), createBlock(Teleport, { to: e.teleport }, [
|
|
545
|
-
createVNode(Transition, { name: "fade" }, {
|
|
546
|
-
default: withCtx(() => [
|
|
547
|
-
withDirectives(createElementVNode("div", {
|
|
548
|
-
class: normalizeClass(["vsTailwind vs-popover__content", e.placement]),
|
|
549
|
-
ref_key: "contentPop",
|
|
550
|
-
ref: c,
|
|
551
|
-
style: normalizeStyle({
|
|
552
|
-
width: e.width ? e.width + "px" : "fit-content",
|
|
553
|
-
zIndex: 10002
|
|
554
|
-
})
|
|
555
|
-
}, [
|
|
556
|
-
createElementVNode("div", Ke, [
|
|
557
|
-
renderSlot(g.$slots, "default", {}, () => [
|
|
558
|
-
k[2] || (k[2] = createElementVNode("span", null, "Popover content", -1))
|
|
559
|
-
])
|
|
560
|
-
])
|
|
561
|
-
], 6), [
|
|
562
|
-
[vShow, r.value]
|
|
563
|
-
])
|
|
564
|
-
]),
|
|
565
|
-
_: 3
|
|
566
|
-
})
|
|
567
|
-
], 8, ["to"]))
|
|
568
|
-
])
|
|
569
|
-
], 512));
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
reactive({ visible: !0 });
|
|
573
|
-
const _sfc_main$v = {}, _hoisted_1$q = {
|
|
381
|
+
}), _sfc_main$w = {}, _hoisted_1$r = {
|
|
574
382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
575
383
|
viewBox: "0 0 24 24",
|
|
576
384
|
fill: "none",
|
|
@@ -581,7 +389,7 @@ const _sfc_main$v = {}, _hoisted_1$q = {
|
|
|
581
389
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
|
|
582
390
|
};
|
|
583
391
|
function _sfc_render$c(e, t) {
|
|
584
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
392
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$r, t[0] || (t[0] = [
|
|
585
393
|
createElementVNode("path", {
|
|
586
394
|
stroke: "none",
|
|
587
395
|
d: "M0 0h24v24H0z",
|
|
@@ -590,7 +398,7 @@ function _sfc_render$c(e, t) {
|
|
|
590
398
|
createElementVNode("path", { d: "M6 9l6 6l6 -6" }, null, -1)
|
|
591
399
|
]));
|
|
592
400
|
}
|
|
593
|
-
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
401
|
+
const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$c]]), _sfc_main$v = {}, _hoisted_1$q = {
|
|
594
402
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
403
|
viewBox: "0 0 24 24",
|
|
596
404
|
fill: "none",
|
|
@@ -600,12 +408,12 @@ const IconChevronDown = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sf
|
|
|
600
408
|
"stroke-linejoin": "round"
|
|
601
409
|
};
|
|
602
410
|
function _sfc_render$b(e, t) {
|
|
603
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
411
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$q, t[0] || (t[0] = [
|
|
604
412
|
createElementVNode("path", { d: "m7 15 5 5 5-5" }, null, -1),
|
|
605
413
|
createElementVNode("path", { d: "m7 9 5-5 5 5" }, null, -1)
|
|
606
414
|
]));
|
|
607
415
|
}
|
|
608
|
-
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
416
|
+
const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$b]]), _sfc_main$u = {}, _hoisted_1$p = {
|
|
609
417
|
xmlns: "http://www.w3.org/2000/svg",
|
|
610
418
|
viewBox: "0 0 24 24",
|
|
611
419
|
fill: "none",
|
|
@@ -616,7 +424,7 @@ const IconChevronTopBottom = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render"
|
|
|
616
424
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
|
|
617
425
|
};
|
|
618
426
|
function _sfc_render$a(e, t) {
|
|
619
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
427
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$p, t[0] || (t[0] = [
|
|
620
428
|
createElementVNode("path", {
|
|
621
429
|
stroke: "none",
|
|
622
430
|
d: "M0 0h24v24H0z",
|
|
@@ -626,7 +434,7 @@ function _sfc_render$a(e, t) {
|
|
|
626
434
|
createElementVNode("path", { d: "M6 6l12 12" }, null, -1)
|
|
627
435
|
]));
|
|
628
436
|
}
|
|
629
|
-
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
437
|
+
const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$a]]), _sfc_main$t = {}, _hoisted_1$o = {
|
|
630
438
|
xmlns: "http://www.w3.org/2000/svg",
|
|
631
439
|
width: "24",
|
|
632
440
|
height: "24",
|
|
@@ -638,7 +446,7 @@ const IconClose = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_rend
|
|
|
638
446
|
"stroke-linejoin": "round"
|
|
639
447
|
};
|
|
640
448
|
function _sfc_render$9(e, t) {
|
|
641
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
449
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$o, t[0] || (t[0] = [
|
|
642
450
|
createElementVNode("path", {
|
|
643
451
|
stroke: "none",
|
|
644
452
|
d: "M0 0h24v24H0z",
|
|
@@ -649,13 +457,13 @@ function _sfc_render$9(e, t) {
|
|
|
649
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)
|
|
650
458
|
]));
|
|
651
459
|
}
|
|
652
|
-
const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
460
|
+
const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$9]]), _hoisted_1$n = {
|
|
653
461
|
key: 0,
|
|
654
462
|
class: "flex items-start gap-x-1"
|
|
655
|
-
}, _hoisted_2$
|
|
463
|
+
}, _hoisted_2$8 = {
|
|
656
464
|
key: 0,
|
|
657
465
|
class: "text-red-500 text-[14px]"
|
|
658
|
-
}, _hoisted_3$2 =
|
|
466
|
+
}, _hoisted_3$2 = ["title"], _hoisted_4$1 = ["disabled"], _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
659
467
|
__name: "vs-input-switcher",
|
|
660
468
|
props: /* @__PURE__ */ mergeModels({
|
|
661
469
|
view: {
|
|
@@ -701,63 +509,59 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
701
509
|
emits: ["update:modelValue"],
|
|
702
510
|
setup(e) {
|
|
703
511
|
const t = useModel(e, "modelValue");
|
|
704
|
-
return (
|
|
705
|
-
createVNode(_sfc_main$
|
|
512
|
+
return (o, n) => e.view === "checkbox" ? (openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
513
|
+
createVNode(_sfc_main$x, {
|
|
706
514
|
modelValue: t.value,
|
|
707
|
-
"onUpdate:modelValue":
|
|
515
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
708
516
|
label: e.text,
|
|
709
517
|
error: e.error
|
|
710
518
|
}, null, 8, ["modelValue", "label", "error"]),
|
|
711
|
-
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
]),
|
|
722
|
-
default: withCtx(() => [
|
|
723
|
-
createElementVNode("div", _hoisted_3$2, [
|
|
724
|
-
createElementVNode("p", _hoisted_4$1, toDisplayString(e.i), 1)
|
|
725
|
-
])
|
|
726
|
-
]),
|
|
727
|
-
_: 1
|
|
728
|
-
})
|
|
519
|
+
e.rules?.includes("required") ? (openBlock(), createElementBlock("span", _hoisted_2$8, "*")) : createCommentVNode("", !0),
|
|
520
|
+
e.i ? (openBlock(), createElementBlock("button", {
|
|
521
|
+
key: 1,
|
|
522
|
+
class: "cursor-pointer",
|
|
523
|
+
title: e.i,
|
|
524
|
+
onClick: n[1] || (n[1] = withModifiers(() => {
|
|
525
|
+
}, ["prevent"]))
|
|
526
|
+
}, [
|
|
527
|
+
createVNode(unref(IconInfo), { class: "text-gray-500 w-[14px] h-[14px]" })
|
|
528
|
+
], 8, _hoisted_3$2)) : createCommentVNode("", !0)
|
|
729
529
|
])) : (openBlock(), createElementBlock("button", {
|
|
730
530
|
key: 1,
|
|
731
531
|
type: "button",
|
|
732
|
-
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
|
|
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", [t.value ? `bg-${e.style?.primaryColor || "blue"}-500` : "bg-stone-200", e.customClass]]),
|
|
733
533
|
disabled: e.disabled,
|
|
734
|
-
onClick:
|
|
534
|
+
onClick: n[2] || (n[2] = (r) => t.value = !t.value)
|
|
735
535
|
}, [
|
|
736
536
|
createElementVNode("span", {
|
|
737
537
|
"data-state": "checked",
|
|
738
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"]])
|
|
739
539
|
}, null, 2)
|
|
740
|
-
], 10,
|
|
540
|
+
], 10, _hoisted_4$1));
|
|
741
541
|
}
|
|
742
|
-
}), _hoisted_1$
|
|
542
|
+
}), _hoisted_1$m = ["innerHTML"], _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
743
543
|
__name: "vs-input-static",
|
|
744
544
|
props: {
|
|
745
545
|
html: {
|
|
746
546
|
type: String,
|
|
747
547
|
default: ""
|
|
748
548
|
},
|
|
549
|
+
text: {
|
|
550
|
+
type: String,
|
|
551
|
+
default: ""
|
|
552
|
+
},
|
|
749
553
|
customClass: {
|
|
750
554
|
type: String,
|
|
751
555
|
default: ""
|
|
752
556
|
}
|
|
753
557
|
},
|
|
754
558
|
setup(e) {
|
|
755
|
-
return (t,
|
|
559
|
+
return (t, o) => (openBlock(), createElementBlock("div", {
|
|
756
560
|
class: normalizeClass(e.customClass),
|
|
757
|
-
innerHTML: e.html
|
|
758
|
-
}, null, 10, _hoisted_1$
|
|
561
|
+
innerHTML: (e.html === "", e.text)
|
|
562
|
+
}, null, 10, _hoisted_1$m));
|
|
759
563
|
}
|
|
760
|
-
}), _hoisted_1$
|
|
564
|
+
}), _hoisted_1$l = ["placeholder", "disabled"], _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
761
565
|
__name: "vs-input-mask",
|
|
762
566
|
props: /* @__PURE__ */ mergeModels({
|
|
763
567
|
style: {
|
|
@@ -775,28 +579,86 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
775
579
|
disabled: {
|
|
776
580
|
type: Boolean,
|
|
777
581
|
default: !1
|
|
778
|
-
}
|
|
582
|
+
},
|
|
583
|
+
mask: {
|
|
584
|
+
type: String,
|
|
585
|
+
default: ""
|
|
586
|
+
},
|
|
587
|
+
placeholderChar: { type: String, default: "_" }
|
|
779
588
|
}, {
|
|
780
589
|
modelValue: { default: "" },
|
|
781
590
|
modelModifiers: {}
|
|
782
591
|
}),
|
|
783
592
|
emits: ["update:modelValue"],
|
|
784
593
|
setup(e) {
|
|
785
|
-
const t = e, { inputClass:
|
|
786
|
-
|
|
594
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue"), r = ref(""), s = {
|
|
595
|
+
9: /\d/,
|
|
596
|
+
A: /[a-zA-Z]/,
|
|
597
|
+
"*": /[a-zA-Z0-9]/
|
|
598
|
+
}, l = computed(() => t.mask.split("")), i = computed(() => l.value.filter((d) => s[d]).length), u = computed({
|
|
599
|
+
get() {
|
|
600
|
+
let d = "", f = 0;
|
|
601
|
+
const m = i.value, p = r.value.slice(0, m);
|
|
602
|
+
for (const g of l.value)
|
|
603
|
+
s[g] ? f < p.length ? (d += p[f], f++) : d += t.placeholderChar : d += g;
|
|
604
|
+
return d;
|
|
605
|
+
},
|
|
606
|
+
set(d) {
|
|
607
|
+
const f = [], m = l.value, p = i.value;
|
|
608
|
+
let g = 0;
|
|
609
|
+
for (let y = 0; y < m.length; y++) {
|
|
610
|
+
const x = m[y];
|
|
611
|
+
if (s[x]) {
|
|
612
|
+
for (; g < d.length; ) {
|
|
613
|
+
const w = d[g];
|
|
614
|
+
if (g++, s[x].test(w)) {
|
|
615
|
+
f.push(w);
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (f.length >= p) break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
r.value = f.join(""), n.value = d;
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
function c(d) {
|
|
626
|
+
const f = d.target, m = [], p = l.value, g = i.value;
|
|
627
|
+
let y = 0;
|
|
628
|
+
for (let x = 0; x < p.length; x++) {
|
|
629
|
+
const w = p[x];
|
|
630
|
+
if (s[w]) {
|
|
631
|
+
for (; y < f.value.length; ) {
|
|
632
|
+
const E = f.value[y];
|
|
633
|
+
if (y++, s[w].test(E)) {
|
|
634
|
+
m.push(E);
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (m.length >= g) break;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
r.value = m.join(""), console.log(r.value), n.value = u.value;
|
|
642
|
+
}
|
|
643
|
+
function a(d) {
|
|
644
|
+
d.key === "Backspace" && (d.preventDefault(), r.value = r.value.slice(0, -1), n.value = u.value);
|
|
645
|
+
}
|
|
646
|
+
return (d, f) => withDirectives((openBlock(), createElementBlock("input", {
|
|
787
647
|
type: "text",
|
|
788
|
-
"onUpdate:modelValue":
|
|
648
|
+
"onUpdate:modelValue": f[0] || (f[0] = (m) => u.value = m),
|
|
789
649
|
placeholder: e.placeholder,
|
|
790
650
|
disabled: e.disabled,
|
|
791
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
651
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o)]]),
|
|
792
652
|
style: {
|
|
793
653
|
border: "1px solid #CFD9E0"
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
654
|
+
},
|
|
655
|
+
onInput: c,
|
|
656
|
+
onKeydown: a
|
|
657
|
+
}, null, 42, _hoisted_1$l)), [
|
|
658
|
+
[vModelText, u.value]
|
|
797
659
|
]);
|
|
798
660
|
}
|
|
799
|
-
}), _hoisted_1$
|
|
661
|
+
}), _hoisted_1$k = ["innerHTML"], _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
800
662
|
__name: "vs-input-html",
|
|
801
663
|
props: {
|
|
802
664
|
text: {
|
|
@@ -806,10 +668,56 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
806
668
|
},
|
|
807
669
|
setup(e) {
|
|
808
670
|
const t = e;
|
|
809
|
-
return (
|
|
671
|
+
return (o, n) => (openBlock(), createElementBlock("div", null, [
|
|
810
672
|
createElementVNode("div", {
|
|
811
673
|
innerHTML: t?.text
|
|
812
|
-
}, null, 8, _hoisted_1$
|
|
674
|
+
}, null, 8, _hoisted_1$k)
|
|
675
|
+
]));
|
|
676
|
+
}
|
|
677
|
+
}), _hoisted_1$j = { class: "relative w-full bg-white rounded-lg" }, _hoisted_2$7 = ["placeholder", "disabled"], _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
678
|
+
__name: "vs-input-email",
|
|
679
|
+
props: /* @__PURE__ */ mergeModels({
|
|
680
|
+
style: {
|
|
681
|
+
type: Object,
|
|
682
|
+
default: () => ({})
|
|
683
|
+
},
|
|
684
|
+
customClass: {
|
|
685
|
+
type: String,
|
|
686
|
+
default: ""
|
|
687
|
+
},
|
|
688
|
+
placeholder: {
|
|
689
|
+
type: String,
|
|
690
|
+
default: ""
|
|
691
|
+
},
|
|
692
|
+
disabled: {
|
|
693
|
+
type: Boolean,
|
|
694
|
+
default: !1
|
|
695
|
+
},
|
|
696
|
+
error: {
|
|
697
|
+
type: String,
|
|
698
|
+
default: null
|
|
699
|
+
}
|
|
700
|
+
}, {
|
|
701
|
+
modelValue: { default: "" },
|
|
702
|
+
modelModifiers: {}
|
|
703
|
+
}),
|
|
704
|
+
emits: ["update:modelValue"],
|
|
705
|
+
setup(e) {
|
|
706
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
707
|
+
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
708
|
+
s[1] || (s[1] = createStaticVNode('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
|
|
709
|
+
withDirectives(createElementVNode("input", {
|
|
710
|
+
type: "email",
|
|
711
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
712
|
+
placeholder: e.placeholder,
|
|
713
|
+
disabled: e.disabled,
|
|
714
|
+
class: normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o), { "!border-red-600": e.error }]]),
|
|
715
|
+
style: {
|
|
716
|
+
border: "1px solid #CFD9E0"
|
|
717
|
+
}
|
|
718
|
+
}, null, 10, _hoisted_2$7), [
|
|
719
|
+
[vModelText, n.value]
|
|
720
|
+
])
|
|
813
721
|
]));
|
|
814
722
|
}
|
|
815
723
|
}), _hoisted_1$i = ["value", "disabled"], _hoisted_2$6 = { class: "text-[13px] text-gray-700" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
@@ -842,11 +750,11 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
842
750
|
emits: ["update:modelValue"],
|
|
843
751
|
setup(e) {
|
|
844
752
|
const t = useModel(e, "modelValue");
|
|
845
|
-
return (
|
|
753
|
+
return (o, n) => (openBlock(), createElementBlock("label", {
|
|
846
754
|
class: normalizeClass(["flex items-center gap-0", [e.customClass]])
|
|
847
755
|
}, [
|
|
848
756
|
withDirectives(createElementVNode("input", {
|
|
849
|
-
"onUpdate:modelValue":
|
|
757
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
850
758
|
type: "radio",
|
|
851
759
|
value: e.value,
|
|
852
760
|
disabled: e.disabled,
|
|
@@ -898,14 +806,14 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
898
806
|
emits: ["update:modelValue"],
|
|
899
807
|
setup(e) {
|
|
900
808
|
const t = useModel(e, "modelValue");
|
|
901
|
-
return (
|
|
809
|
+
return (o, n) => (openBlock(), createElementBlock("label", {
|
|
902
810
|
class: normalizeClass(["flex items-center border rounded-lg px-2 py-1", [
|
|
903
811
|
t.value == e.value ? `ring-2 ring-ring ring-${e.style?.primaryColor || "blue"}-500` : "",
|
|
904
812
|
e.customClass
|
|
905
813
|
]])
|
|
906
814
|
}, [
|
|
907
815
|
withDirectives(createElementVNode("input", {
|
|
908
|
-
"onUpdate:modelValue":
|
|
816
|
+
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.value = r),
|
|
909
817
|
type: "radio",
|
|
910
818
|
value: e.value,
|
|
911
819
|
disabled: e.disabled,
|
|
@@ -940,18 +848,18 @@ const IconInfo = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_rende
|
|
|
940
848
|
}),
|
|
941
849
|
emits: ["update:modelValue"],
|
|
942
850
|
setup(e) {
|
|
943
|
-
const t = e,
|
|
944
|
-
return (
|
|
851
|
+
const t = e, o = useModel(e, "modelValue"), n = computed(() => layouts[`vs-input-radio-${t.view}`]);
|
|
852
|
+
return (r, s) => (openBlock(), createElementBlock("div", {
|
|
945
853
|
class: normalizeClass([e.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
|
|
946
854
|
}, [
|
|
947
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(
|
|
855
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.options, (l) => (openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps({
|
|
948
856
|
key: l?.id,
|
|
949
857
|
text: l.text,
|
|
950
858
|
value: l.id.toString(),
|
|
951
|
-
checked:
|
|
952
|
-
modelValue:
|
|
953
|
-
"onUpdate:modelValue":
|
|
954
|
-
}, { ref_for: !0 },
|
|
859
|
+
checked: o.value === l.id,
|
|
860
|
+
modelValue: o.value,
|
|
861
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i)
|
|
862
|
+
}, { ref_for: !0 }, r.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
|
|
955
863
|
], 2));
|
|
956
864
|
}
|
|
957
865
|
});
|
|
@@ -961,8 +869,8 @@ function bind(e, t) {
|
|
|
961
869
|
};
|
|
962
870
|
}
|
|
963
871
|
const { toString } = Object.prototype, { getPrototypeOf } = Object, { iterator, toStringTag } = Symbol, kindOf = /* @__PURE__ */ ((e) => (t) => {
|
|
964
|
-
const
|
|
965
|
-
return e[
|
|
872
|
+
const o = toString.call(t);
|
|
873
|
+
return e[o] || (e[o] = o.slice(8, -1).toLowerCase());
|
|
966
874
|
})(/* @__PURE__ */ Object.create(null)), kindOfTest = (e) => (e = e.toLowerCase(), (t) => kindOf(t) === e), typeOfTest = (e) => (t) => typeof t === e, { isArray } = Array, isUndefined = typeOfTest("undefined");
|
|
967
875
|
function isBuffer(e) {
|
|
968
876
|
return e !== null && !isUndefined(e) && e.constructor !== null && !isUndefined(e.constructor) && isFunction(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
@@ -990,147 +898,147 @@ const isString = typeOfTest("string"), isFunction = typeOfTest("function"), isNu
|
|
|
990
898
|
return e && (typeof FormData == "function" && e instanceof FormData || isFunction(e.append) && ((t = kindOf(e)) === "formdata" || // detect form-data instance
|
|
991
899
|
t === "object" && isFunction(e.toString) && e.toString() === "[object FormData]"));
|
|
992
900
|
}, isURLSearchParams = kindOfTest("URLSearchParams"), [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest), trim = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
993
|
-
function forEach(e, t, { allOwnKeys:
|
|
901
|
+
function forEach(e, t, { allOwnKeys: o = !1 } = {}) {
|
|
994
902
|
if (e === null || typeof e > "u")
|
|
995
903
|
return;
|
|
996
|
-
let
|
|
904
|
+
let n, r;
|
|
997
905
|
if (typeof e != "object" && (e = [e]), isArray(e))
|
|
998
|
-
for (
|
|
999
|
-
t.call(null, e[
|
|
906
|
+
for (n = 0, r = e.length; n < r; n++)
|
|
907
|
+
t.call(null, e[n], n, e);
|
|
1000
908
|
else {
|
|
1001
909
|
if (isBuffer(e))
|
|
1002
910
|
return;
|
|
1003
|
-
const
|
|
911
|
+
const s = o ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length;
|
|
1004
912
|
let i;
|
|
1005
|
-
for (
|
|
1006
|
-
i =
|
|
913
|
+
for (n = 0; n < l; n++)
|
|
914
|
+
i = s[n], t.call(null, e[i], i, e);
|
|
1007
915
|
}
|
|
1008
916
|
}
|
|
1009
917
|
function findKey(e, t) {
|
|
1010
918
|
if (isBuffer(e))
|
|
1011
919
|
return null;
|
|
1012
920
|
t = t.toLowerCase();
|
|
1013
|
-
const
|
|
1014
|
-
let
|
|
1015
|
-
for (;
|
|
1016
|
-
if (
|
|
1017
|
-
return
|
|
921
|
+
const o = Object.keys(e);
|
|
922
|
+
let n = o.length, r;
|
|
923
|
+
for (; n-- > 0; )
|
|
924
|
+
if (r = o[n], t === r.toLowerCase())
|
|
925
|
+
return r;
|
|
1018
926
|
return null;
|
|
1019
927
|
}
|
|
1020
928
|
const _global = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, isContextDefined = (e) => !isUndefined(e) && e !== _global;
|
|
1021
929
|
function merge() {
|
|
1022
|
-
const { caseless: e } = isContextDefined(this) && this || {}, t = {},
|
|
1023
|
-
const
|
|
1024
|
-
isPlainObject(t[
|
|
930
|
+
const { caseless: e } = isContextDefined(this) && this || {}, t = {}, o = (n, r) => {
|
|
931
|
+
const s = e && findKey(t, r) || r;
|
|
932
|
+
isPlainObject(t[s]) && isPlainObject(n) ? t[s] = merge(t[s], n) : isPlainObject(n) ? t[s] = merge({}, n) : isArray(n) ? t[s] = n.slice() : t[s] = n;
|
|
1025
933
|
};
|
|
1026
|
-
for (let
|
|
1027
|
-
arguments[
|
|
934
|
+
for (let n = 0, r = arguments.length; n < r; n++)
|
|
935
|
+
arguments[n] && forEach(arguments[n], o);
|
|
1028
936
|
return t;
|
|
1029
937
|
}
|
|
1030
|
-
const extend = (e, t,
|
|
1031
|
-
|
|
1032
|
-
}, { allOwnKeys:
|
|
1033
|
-
e.prototype = Object.create(t.prototype,
|
|
938
|
+
const extend = (e, t, o, { allOwnKeys: n } = {}) => (forEach(t, (r, s) => {
|
|
939
|
+
o && isFunction(r) ? e[s] = bind(r, o) : e[s] = r;
|
|
940
|
+
}, { allOwnKeys: n }), e), stripBOM = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), inherits = (e, t, o, n) => {
|
|
941
|
+
e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
1034
942
|
value: t.prototype
|
|
1035
|
-
}),
|
|
1036
|
-
}, toFlatObject = (e, t,
|
|
1037
|
-
let
|
|
943
|
+
}), o && Object.assign(e.prototype, o);
|
|
944
|
+
}, toFlatObject = (e, t, o, n) => {
|
|
945
|
+
let r, s, l;
|
|
1038
946
|
const i = {};
|
|
1039
947
|
if (t = t || {}, e == null) return t;
|
|
1040
948
|
do {
|
|
1041
|
-
for (
|
|
1042
|
-
l = s
|
|
1043
|
-
e =
|
|
1044
|
-
} while (e && (!
|
|
949
|
+
for (r = Object.getOwnPropertyNames(e), s = r.length; s-- > 0; )
|
|
950
|
+
l = r[s], (!n || n(l, e, t)) && !i[l] && (t[l] = e[l], i[l] = !0);
|
|
951
|
+
e = o !== !1 && getPrototypeOf(e);
|
|
952
|
+
} while (e && (!o || o(e, t)) && e !== Object.prototype);
|
|
1045
953
|
return t;
|
|
1046
|
-
}, endsWith = (e, t,
|
|
1047
|
-
e = String(e), (
|
|
1048
|
-
const
|
|
1049
|
-
return
|
|
954
|
+
}, endsWith = (e, t, o) => {
|
|
955
|
+
e = String(e), (o === void 0 || o > e.length) && (o = e.length), o -= t.length;
|
|
956
|
+
const n = e.indexOf(t, o);
|
|
957
|
+
return n !== -1 && n === o;
|
|
1050
958
|
}, toArray = (e) => {
|
|
1051
959
|
if (!e) return null;
|
|
1052
960
|
if (isArray(e)) return e;
|
|
1053
961
|
let t = e.length;
|
|
1054
962
|
if (!isNumber(t)) return null;
|
|
1055
|
-
const
|
|
963
|
+
const o = new Array(t);
|
|
1056
964
|
for (; t-- > 0; )
|
|
1057
|
-
|
|
1058
|
-
return
|
|
965
|
+
o[t] = e[t];
|
|
966
|
+
return o;
|
|
1059
967
|
}, isTypedArray = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && getPrototypeOf(Uint8Array)), forEachEntry = (e, t) => {
|
|
1060
|
-
const
|
|
1061
|
-
let
|
|
1062
|
-
for (; (
|
|
1063
|
-
const
|
|
1064
|
-
t.call(e,
|
|
968
|
+
const n = (e && e[iterator]).call(e);
|
|
969
|
+
let r;
|
|
970
|
+
for (; (r = n.next()) && !r.done; ) {
|
|
971
|
+
const s = r.value;
|
|
972
|
+
t.call(e, s[0], s[1]);
|
|
1065
973
|
}
|
|
1066
974
|
}, matchAll = (e, t) => {
|
|
1067
|
-
let
|
|
1068
|
-
const
|
|
1069
|
-
for (; (
|
|
1070
|
-
|
|
1071
|
-
return
|
|
975
|
+
let o;
|
|
976
|
+
const n = [];
|
|
977
|
+
for (; (o = e.exec(t)) !== null; )
|
|
978
|
+
n.push(o);
|
|
979
|
+
return n;
|
|
1072
980
|
}, isHTMLForm = kindOfTest("HTMLFormElement"), toCamelCase = (e) => e.toLowerCase().replace(
|
|
1073
981
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
1074
|
-
function(
|
|
1075
|
-
return
|
|
982
|
+
function(o, n, r) {
|
|
983
|
+
return n.toUpperCase() + r;
|
|
1076
984
|
}
|
|
1077
|
-
), hasOwnProperty = (({ hasOwnProperty: e }) => (t,
|
|
1078
|
-
const
|
|
1079
|
-
forEach(
|
|
985
|
+
), hasOwnProperty = (({ hasOwnProperty: e }) => (t, o) => e.call(t, o))(Object.prototype), isRegExp = kindOfTest("RegExp"), reduceDescriptors = (e, t) => {
|
|
986
|
+
const o = Object.getOwnPropertyDescriptors(e), n = {};
|
|
987
|
+
forEach(o, (r, s) => {
|
|
1080
988
|
let l;
|
|
1081
|
-
(l = t(
|
|
1082
|
-
}), Object.defineProperties(e,
|
|
989
|
+
(l = t(r, s, e)) !== !1 && (n[s] = l || r);
|
|
990
|
+
}), Object.defineProperties(e, n);
|
|
1083
991
|
}, freezeMethods = (e) => {
|
|
1084
|
-
reduceDescriptors(e, (t,
|
|
1085
|
-
if (isFunction(e) && ["arguments", "caller", "callee"].indexOf(
|
|
992
|
+
reduceDescriptors(e, (t, o) => {
|
|
993
|
+
if (isFunction(e) && ["arguments", "caller", "callee"].indexOf(o) !== -1)
|
|
1086
994
|
return !1;
|
|
1087
|
-
const
|
|
1088
|
-
if (isFunction(
|
|
995
|
+
const n = e[o];
|
|
996
|
+
if (isFunction(n)) {
|
|
1089
997
|
if (t.enumerable = !1, "writable" in t) {
|
|
1090
998
|
t.writable = !1;
|
|
1091
999
|
return;
|
|
1092
1000
|
}
|
|
1093
1001
|
t.set || (t.set = () => {
|
|
1094
|
-
throw Error("Can not rewrite read-only method '" +
|
|
1002
|
+
throw Error("Can not rewrite read-only method '" + o + "'");
|
|
1095
1003
|
});
|
|
1096
1004
|
}
|
|
1097
1005
|
});
|
|
1098
1006
|
}, toObjectSet = (e, t) => {
|
|
1099
|
-
const
|
|
1100
|
-
|
|
1101
|
-
|
|
1007
|
+
const o = {}, n = (r) => {
|
|
1008
|
+
r.forEach((s) => {
|
|
1009
|
+
o[s] = !0;
|
|
1102
1010
|
});
|
|
1103
1011
|
};
|
|
1104
|
-
return isArray(e) ?
|
|
1012
|
+
return isArray(e) ? n(e) : n(String(e).split(t)), o;
|
|
1105
1013
|
}, noop = () => {
|
|
1106
1014
|
}, toFiniteNumber = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
1107
1015
|
function isSpecCompliantForm(e) {
|
|
1108
1016
|
return !!(e && isFunction(e.append) && e[toStringTag] === "FormData" && e[iterator]);
|
|
1109
1017
|
}
|
|
1110
1018
|
const toJSONObject = (e) => {
|
|
1111
|
-
const t = new Array(10),
|
|
1112
|
-
if (isObject(
|
|
1113
|
-
if (t.indexOf(
|
|
1019
|
+
const t = new Array(10), o = (n, r) => {
|
|
1020
|
+
if (isObject(n)) {
|
|
1021
|
+
if (t.indexOf(n) >= 0)
|
|
1114
1022
|
return;
|
|
1115
|
-
if (isBuffer(
|
|
1116
|
-
return
|
|
1117
|
-
if (!("toJSON" in
|
|
1118
|
-
t[
|
|
1119
|
-
const
|
|
1120
|
-
return forEach(
|
|
1121
|
-
const u =
|
|
1122
|
-
!isUndefined(u) && (
|
|
1123
|
-
}), t[
|
|
1023
|
+
if (isBuffer(n))
|
|
1024
|
+
return n;
|
|
1025
|
+
if (!("toJSON" in n)) {
|
|
1026
|
+
t[r] = n;
|
|
1027
|
+
const s = isArray(n) ? [] : {};
|
|
1028
|
+
return forEach(n, (l, i) => {
|
|
1029
|
+
const u = o(l, r + 1);
|
|
1030
|
+
!isUndefined(u) && (s[i] = u);
|
|
1031
|
+
}), t[r] = void 0, s;
|
|
1124
1032
|
}
|
|
1125
1033
|
}
|
|
1126
|
-
return
|
|
1034
|
+
return n;
|
|
1127
1035
|
};
|
|
1128
|
-
return
|
|
1129
|
-
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((
|
|
1130
|
-
|
|
1131
|
-
}, !1), (
|
|
1132
|
-
|
|
1133
|
-
}))(`axios@${Math.random()}`, []) : (
|
|
1036
|
+
return o(e, 0);
|
|
1037
|
+
}, isAsyncFn = kindOfTest("AsyncFunction"), isThenable = (e) => e && (isObject(e) || isFunction(e)) && isFunction(e.then) && isFunction(e.catch), _setImmediate = ((e, t) => e ? setImmediate : t ? ((o, n) => (_global.addEventListener("message", ({ source: r, data: s }) => {
|
|
1038
|
+
r === _global && s === o && n.length && n.shift()();
|
|
1039
|
+
}, !1), (r) => {
|
|
1040
|
+
n.push(r), _global.postMessage(o, "*");
|
|
1041
|
+
}))(`axios@${Math.random()}`, []) : (o) => setTimeout(o))(
|
|
1134
1042
|
typeof setImmediate == "function",
|
|
1135
1043
|
isFunction(_global.postMessage)
|
|
1136
1044
|
), asap = typeof queueMicrotask < "u" ? queueMicrotask.bind(_global) : typeof process < "u" && process.nextTick || _setImmediate, isIterable = (e) => e != null && isFunction(e[iterator]), utils$1 = {
|
|
@@ -1193,8 +1101,8 @@ const toJSONObject = (e) => {
|
|
|
1193
1101
|
asap,
|
|
1194
1102
|
isIterable
|
|
1195
1103
|
};
|
|
1196
|
-
function AxiosError$1(e, t,
|
|
1197
|
-
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),
|
|
1104
|
+
function AxiosError$1(e, t, o, n, r) {
|
|
1105
|
+
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), o && (this.config = o), n && (this.request = n), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
1198
1106
|
}
|
|
1199
1107
|
utils$1.inherits(AxiosError$1, Error, {
|
|
1200
1108
|
toJSON: function() {
|
|
@@ -1237,11 +1145,11 @@ const prototype$1 = AxiosError$1.prototype, descriptors = {};
|
|
|
1237
1145
|
});
|
|
1238
1146
|
Object.defineProperties(AxiosError$1, descriptors);
|
|
1239
1147
|
Object.defineProperty(prototype$1, "isAxiosError", { value: !0 });
|
|
1240
|
-
AxiosError$1.from = (e, t, n,
|
|
1148
|
+
AxiosError$1.from = (e, t, o, n, r, s) => {
|
|
1241
1149
|
const l = Object.create(prototype$1);
|
|
1242
1150
|
return utils$1.toFlatObject(e, l, function(u) {
|
|
1243
1151
|
return u !== Error.prototype;
|
|
1244
|
-
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t,
|
|
1152
|
+
}, (i) => i !== "isAxiosError"), AxiosError$1.call(l, e.message, t, o, n, r), l.cause = e, l.name = e.name, s && Object.assign(l, s), l;
|
|
1245
1153
|
};
|
|
1246
1154
|
const httpAdapter = null;
|
|
1247
1155
|
function isVisitable(e) {
|
|
@@ -1250,10 +1158,10 @@ function isVisitable(e) {
|
|
|
1250
1158
|
function removeBrackets(e) {
|
|
1251
1159
|
return utils$1.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1252
1160
|
}
|
|
1253
|
-
function renderKey(e, t,
|
|
1254
|
-
return e ? e.concat(t).map(function(
|
|
1255
|
-
return
|
|
1256
|
-
}).join(
|
|
1161
|
+
function renderKey(e, t, o) {
|
|
1162
|
+
return e ? e.concat(t).map(function(r, s) {
|
|
1163
|
+
return r = removeBrackets(r), !o && s ? "[" + r + "]" : r;
|
|
1164
|
+
}).join(o ? "." : "") : t;
|
|
1257
1165
|
}
|
|
1258
1166
|
function isFlatArray(e) {
|
|
1259
1167
|
return utils$1.isArray(e) && !e.some(isVisitable);
|
|
@@ -1261,68 +1169,68 @@ function isFlatArray(e) {
|
|
|
1261
1169
|
const predicates = utils$1.toFlatObject(utils$1, {}, null, function(t) {
|
|
1262
1170
|
return /^is[A-Z]/.test(t);
|
|
1263
1171
|
});
|
|
1264
|
-
function toFormData$1(e, t,
|
|
1172
|
+
function toFormData$1(e, t, o) {
|
|
1265
1173
|
if (!utils$1.isObject(e))
|
|
1266
1174
|
throw new TypeError("target must be an object");
|
|
1267
|
-
t = t || new FormData(),
|
|
1175
|
+
t = t || new FormData(), o = utils$1.toFlatObject(o, {
|
|
1268
1176
|
metaTokens: !0,
|
|
1269
1177
|
dots: !1,
|
|
1270
1178
|
indexes: !1
|
|
1271
|
-
}, !1, function(
|
|
1272
|
-
return !utils$1.isUndefined(
|
|
1179
|
+
}, !1, function(g, y) {
|
|
1180
|
+
return !utils$1.isUndefined(y[g]);
|
|
1273
1181
|
});
|
|
1274
|
-
const
|
|
1275
|
-
if (!utils$1.isFunction(
|
|
1182
|
+
const n = o.metaTokens, r = o.visitor || a, s = o.dots, l = o.indexes, u = (o.Blob || typeof Blob < "u" && Blob) && utils$1.isSpecCompliantForm(t);
|
|
1183
|
+
if (!utils$1.isFunction(r))
|
|
1276
1184
|
throw new TypeError("visitor must be a function");
|
|
1277
|
-
function c(
|
|
1278
|
-
if (
|
|
1279
|
-
if (utils$1.isDate(
|
|
1280
|
-
return
|
|
1281
|
-
if (utils$1.isBoolean(
|
|
1282
|
-
return
|
|
1283
|
-
if (!u && utils$1.isBlob(
|
|
1185
|
+
function c(p) {
|
|
1186
|
+
if (p === null) return "";
|
|
1187
|
+
if (utils$1.isDate(p))
|
|
1188
|
+
return p.toISOString();
|
|
1189
|
+
if (utils$1.isBoolean(p))
|
|
1190
|
+
return p.toString();
|
|
1191
|
+
if (!u && utils$1.isBlob(p))
|
|
1284
1192
|
throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
|
|
1285
|
-
return utils$1.isArrayBuffer(
|
|
1286
|
-
}
|
|
1287
|
-
function a(
|
|
1288
|
-
let
|
|
1289
|
-
if (
|
|
1290
|
-
if (utils$1.endsWith(
|
|
1291
|
-
|
|
1292
|
-
else if (utils$1.isArray(
|
|
1293
|
-
return
|
|
1294
|
-
!(utils$1.isUndefined(
|
|
1193
|
+
return utils$1.isArrayBuffer(p) || utils$1.isTypedArray(p) ? u && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
|
|
1194
|
+
}
|
|
1195
|
+
function a(p, g, y) {
|
|
1196
|
+
let x = p;
|
|
1197
|
+
if (p && !y && typeof p == "object") {
|
|
1198
|
+
if (utils$1.endsWith(g, "{}"))
|
|
1199
|
+
g = n ? g : g.slice(0, -2), p = JSON.stringify(p);
|
|
1200
|
+
else if (utils$1.isArray(p) && isFlatArray(p) || (utils$1.isFileList(p) || utils$1.endsWith(g, "[]")) && (x = utils$1.toArray(p)))
|
|
1201
|
+
return g = removeBrackets(g), x.forEach(function(E, C) {
|
|
1202
|
+
!(utils$1.isUndefined(E) || E === null) && t.append(
|
|
1295
1203
|
// eslint-disable-next-line no-nested-ternary
|
|
1296
|
-
l === !0 ? renderKey([
|
|
1297
|
-
c(
|
|
1204
|
+
l === !0 ? renderKey([g], C, s) : l === null ? g : g + "[]",
|
|
1205
|
+
c(E)
|
|
1298
1206
|
);
|
|
1299
1207
|
}), !1;
|
|
1300
1208
|
}
|
|
1301
|
-
return isVisitable(
|
|
1209
|
+
return isVisitable(p) ? !0 : (t.append(renderKey(y, g, s), c(p)), !1);
|
|
1302
1210
|
}
|
|
1303
|
-
const
|
|
1211
|
+
const d = [], f = Object.assign(predicates, {
|
|
1304
1212
|
defaultVisitor: a,
|
|
1305
1213
|
convertValue: c,
|
|
1306
1214
|
isVisitable
|
|
1307
1215
|
});
|
|
1308
|
-
function p
|
|
1309
|
-
if (!utils$1.isUndefined(
|
|
1310
|
-
if (
|
|
1311
|
-
throw Error("Circular reference detected in " +
|
|
1312
|
-
|
|
1313
|
-
(!(utils$1.isUndefined(
|
|
1216
|
+
function m(p, g) {
|
|
1217
|
+
if (!utils$1.isUndefined(p)) {
|
|
1218
|
+
if (d.indexOf(p) !== -1)
|
|
1219
|
+
throw Error("Circular reference detected in " + g.join("."));
|
|
1220
|
+
d.push(p), utils$1.forEach(p, function(x, w) {
|
|
1221
|
+
(!(utils$1.isUndefined(x) || x === null) && r.call(
|
|
1314
1222
|
t,
|
|
1315
|
-
|
|
1316
|
-
utils$1.isString(
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
)) === !0 &&
|
|
1320
|
-
}),
|
|
1223
|
+
x,
|
|
1224
|
+
utils$1.isString(w) ? w.trim() : w,
|
|
1225
|
+
g,
|
|
1226
|
+
f
|
|
1227
|
+
)) === !0 && m(x, g ? g.concat(w) : [w]);
|
|
1228
|
+
}), d.pop();
|
|
1321
1229
|
}
|
|
1322
1230
|
}
|
|
1323
1231
|
if (!utils$1.isObject(e))
|
|
1324
1232
|
throw new TypeError("data must be an object");
|
|
1325
|
-
return
|
|
1233
|
+
return m(e), t;
|
|
1326
1234
|
}
|
|
1327
1235
|
function encode$1(e) {
|
|
1328
1236
|
const t = {
|
|
@@ -1334,40 +1242,40 @@ function encode$1(e) {
|
|
|
1334
1242
|
"%20": "+",
|
|
1335
1243
|
"%00": "\0"
|
|
1336
1244
|
};
|
|
1337
|
-
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(
|
|
1338
|
-
return t[
|
|
1245
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
1246
|
+
return t[n];
|
|
1339
1247
|
});
|
|
1340
1248
|
}
|
|
1341
1249
|
function AxiosURLSearchParams(e, t) {
|
|
1342
1250
|
this._pairs = [], e && toFormData$1(e, this, t);
|
|
1343
1251
|
}
|
|
1344
1252
|
const prototype = AxiosURLSearchParams.prototype;
|
|
1345
|
-
prototype.append = function(t,
|
|
1346
|
-
this._pairs.push([t,
|
|
1253
|
+
prototype.append = function(t, o) {
|
|
1254
|
+
this._pairs.push([t, o]);
|
|
1347
1255
|
};
|
|
1348
1256
|
prototype.toString = function(t) {
|
|
1349
|
-
const
|
|
1350
|
-
return t.call(this,
|
|
1257
|
+
const o = t ? function(n) {
|
|
1258
|
+
return t.call(this, n, encode$1);
|
|
1351
1259
|
} : encode$1;
|
|
1352
|
-
return this._pairs.map(function(
|
|
1353
|
-
return
|
|
1260
|
+
return this._pairs.map(function(r) {
|
|
1261
|
+
return o(r[0]) + "=" + o(r[1]);
|
|
1354
1262
|
}, "").join("&");
|
|
1355
1263
|
};
|
|
1356
1264
|
function encode(e) {
|
|
1357
1265
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1358
1266
|
}
|
|
1359
|
-
function buildURL(e, t,
|
|
1267
|
+
function buildURL(e, t, o) {
|
|
1360
1268
|
if (!t)
|
|
1361
1269
|
return e;
|
|
1362
|
-
const
|
|
1363
|
-
utils$1.isFunction(
|
|
1364
|
-
serialize:
|
|
1270
|
+
const n = o && o.encode || encode;
|
|
1271
|
+
utils$1.isFunction(o) && (o = {
|
|
1272
|
+
serialize: o
|
|
1365
1273
|
});
|
|
1366
|
-
const
|
|
1367
|
-
let
|
|
1368
|
-
if (
|
|
1274
|
+
const r = o && o.serialize;
|
|
1275
|
+
let s;
|
|
1276
|
+
if (r ? s = r(t, o) : s = utils$1.isURLSearchParams(t) ? t.toString() : new AxiosURLSearchParams(t, o).toString(n), s) {
|
|
1369
1277
|
const l = e.indexOf("#");
|
|
1370
|
-
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") +
|
|
1278
|
+
l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
|
1371
1279
|
}
|
|
1372
1280
|
return e;
|
|
1373
1281
|
}
|
|
@@ -1383,12 +1291,12 @@ class InterceptorManager {
|
|
|
1383
1291
|
*
|
|
1384
1292
|
* @return {Number} An ID used to remove interceptor later
|
|
1385
1293
|
*/
|
|
1386
|
-
use(t,
|
|
1294
|
+
use(t, o, n) {
|
|
1387
1295
|
return this.handlers.push({
|
|
1388
1296
|
fulfilled: t,
|
|
1389
|
-
rejected:
|
|
1390
|
-
synchronous:
|
|
1391
|
-
runWhen:
|
|
1297
|
+
rejected: o,
|
|
1298
|
+
synchronous: n ? n.synchronous : !1,
|
|
1299
|
+
runWhen: n ? n.runWhen : null
|
|
1392
1300
|
}), this.handlers.length - 1;
|
|
1393
1301
|
}
|
|
1394
1302
|
/**
|
|
@@ -1420,8 +1328,8 @@ class InterceptorManager {
|
|
|
1420
1328
|
* @returns {void}
|
|
1421
1329
|
*/
|
|
1422
1330
|
forEach(t) {
|
|
1423
|
-
utils$1.forEach(this.handlers, function(
|
|
1424
|
-
|
|
1331
|
+
utils$1.forEach(this.handlers, function(n) {
|
|
1332
|
+
n !== null && t(n);
|
|
1425
1333
|
});
|
|
1426
1334
|
}
|
|
1427
1335
|
}
|
|
@@ -1451,8 +1359,8 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", or
|
|
|
1451
1359
|
};
|
|
1452
1360
|
function toURLEncodedForm(e, t) {
|
|
1453
1361
|
return toFormData$1(e, new platform.classes.URLSearchParams(), {
|
|
1454
|
-
visitor: function(n,
|
|
1455
|
-
return platform.isNode && utils$1.isBuffer(
|
|
1362
|
+
visitor: function(o, n, r, s) {
|
|
1363
|
+
return platform.isNode && utils$1.isBuffer(o) ? (this.append(n, o.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
1456
1364
|
},
|
|
1457
1365
|
...t
|
|
1458
1366
|
});
|
|
@@ -1461,57 +1369,57 @@ function parsePropPath(e) {
|
|
|
1461
1369
|
return utils$1.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1462
1370
|
}
|
|
1463
1371
|
function arrayToObject(e) {
|
|
1464
|
-
const t = {},
|
|
1465
|
-
let
|
|
1466
|
-
const
|
|
1467
|
-
let
|
|
1468
|
-
for (
|
|
1469
|
-
|
|
1372
|
+
const t = {}, o = Object.keys(e);
|
|
1373
|
+
let n;
|
|
1374
|
+
const r = o.length;
|
|
1375
|
+
let s;
|
|
1376
|
+
for (n = 0; n < r; n++)
|
|
1377
|
+
s = o[n], t[s] = e[s];
|
|
1470
1378
|
return t;
|
|
1471
1379
|
}
|
|
1472
1380
|
function formDataToJSON(e) {
|
|
1473
|
-
function t(n,
|
|
1474
|
-
let l =
|
|
1381
|
+
function t(o, n, r, s) {
|
|
1382
|
+
let l = o[s++];
|
|
1475
1383
|
if (l === "__proto__") return !0;
|
|
1476
|
-
const i = Number.isFinite(+l), u =
|
|
1477
|
-
return l = !l && utils$1.isArray(
|
|
1384
|
+
const i = Number.isFinite(+l), u = s >= o.length;
|
|
1385
|
+
return l = !l && utils$1.isArray(r) ? r.length : l, u ? (utils$1.hasOwnProp(r, l) ? r[l] = [r[l], n] : r[l] = n, !i) : ((!r[l] || !utils$1.isObject(r[l])) && (r[l] = []), t(o, n, r[l], s) && utils$1.isArray(r[l]) && (r[l] = arrayToObject(r[l])), !i);
|
|
1478
1386
|
}
|
|
1479
1387
|
if (utils$1.isFormData(e) && utils$1.isFunction(e.entries)) {
|
|
1480
|
-
const
|
|
1481
|
-
return utils$1.forEachEntry(e, (
|
|
1482
|
-
t(parsePropPath(
|
|
1483
|
-
}),
|
|
1388
|
+
const o = {};
|
|
1389
|
+
return utils$1.forEachEntry(e, (n, r) => {
|
|
1390
|
+
t(parsePropPath(n), r, o, 0);
|
|
1391
|
+
}), o;
|
|
1484
1392
|
}
|
|
1485
1393
|
return null;
|
|
1486
1394
|
}
|
|
1487
|
-
function stringifySafely(e, t,
|
|
1395
|
+
function stringifySafely(e, t, o) {
|
|
1488
1396
|
if (utils$1.isString(e))
|
|
1489
1397
|
try {
|
|
1490
1398
|
return (t || JSON.parse)(e), utils$1.trim(e);
|
|
1491
|
-
} catch (
|
|
1492
|
-
if (
|
|
1493
|
-
throw
|
|
1399
|
+
} catch (n) {
|
|
1400
|
+
if (n.name !== "SyntaxError")
|
|
1401
|
+
throw n;
|
|
1494
1402
|
}
|
|
1495
|
-
return (
|
|
1403
|
+
return (o || JSON.stringify)(e);
|
|
1496
1404
|
}
|
|
1497
1405
|
const defaults = {
|
|
1498
1406
|
transitional: transitionalDefaults,
|
|
1499
1407
|
adapter: ["xhr", "http", "fetch"],
|
|
1500
|
-
transformRequest: [function(t,
|
|
1501
|
-
const
|
|
1502
|
-
if (
|
|
1503
|
-
return
|
|
1408
|
+
transformRequest: [function(t, o) {
|
|
1409
|
+
const n = o.getContentType() || "", r = n.indexOf("application/json") > -1, s = utils$1.isObject(t);
|
|
1410
|
+
if (s && utils$1.isHTMLForm(t) && (t = new FormData(t)), utils$1.isFormData(t))
|
|
1411
|
+
return r ? JSON.stringify(formDataToJSON(t)) : t;
|
|
1504
1412
|
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))
|
|
1505
1413
|
return t;
|
|
1506
1414
|
if (utils$1.isArrayBufferView(t))
|
|
1507
1415
|
return t.buffer;
|
|
1508
1416
|
if (utils$1.isURLSearchParams(t))
|
|
1509
|
-
return
|
|
1417
|
+
return o.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1510
1418
|
let i;
|
|
1511
|
-
if (
|
|
1512
|
-
if (
|
|
1419
|
+
if (s) {
|
|
1420
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1513
1421
|
return toURLEncodedForm(t, this.formSerializer).toString();
|
|
1514
|
-
if ((i = utils$1.isFileList(t)) ||
|
|
1422
|
+
if ((i = utils$1.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
|
|
1515
1423
|
const u = this.env && this.env.FormData;
|
|
1516
1424
|
return toFormData$1(
|
|
1517
1425
|
i ? { "files[]": t } : t,
|
|
@@ -1520,14 +1428,14 @@ const defaults = {
|
|
|
1520
1428
|
);
|
|
1521
1429
|
}
|
|
1522
1430
|
}
|
|
1523
|
-
return
|
|
1431
|
+
return s || r ? (o.setContentType("application/json", !1), stringifySafely(t)) : t;
|
|
1524
1432
|
}],
|
|
1525
1433
|
transformResponse: [function(t) {
|
|
1526
|
-
const
|
|
1434
|
+
const o = this.transitional || defaults.transitional, n = o && o.forcedJSONParsing, r = this.responseType === "json";
|
|
1527
1435
|
if (utils$1.isResponse(t) || utils$1.isReadableStream(t))
|
|
1528
1436
|
return t;
|
|
1529
|
-
if (t && utils$1.isString(t) && (
|
|
1530
|
-
const l = !(
|
|
1437
|
+
if (t && utils$1.isString(t) && (n && !this.responseType || r)) {
|
|
1438
|
+
const l = !(o && o.silentJSONParsing) && r;
|
|
1531
1439
|
try {
|
|
1532
1440
|
return JSON.parse(t);
|
|
1533
1441
|
} catch (i) {
|
|
@@ -1583,10 +1491,10 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1583
1491
|
"user-agent"
|
|
1584
1492
|
]), parseHeaders = (e) => {
|
|
1585
1493
|
const t = {};
|
|
1586
|
-
let
|
|
1494
|
+
let o, n, r;
|
|
1587
1495
|
return e && e.split(`
|
|
1588
1496
|
`).forEach(function(l) {
|
|
1589
|
-
|
|
1497
|
+
r = l.indexOf(":"), o = l.substring(0, r).trim().toLowerCase(), n = l.substring(r + 1).trim(), !(!o || t[o] && ignoreDuplicateOf[o]) && (o === "set-cookie" ? t[o] ? t[o].push(n) : t[o] = [n] : t[o] = t[o] ? t[o] + ", " + n : n);
|
|
1590
1498
|
}), t;
|
|
1591
1499
|
}, $internals = Symbol("internals");
|
|
1592
1500
|
function normalizeHeader(e) {
|
|
@@ -1596,32 +1504,32 @@ function normalizeValue(e) {
|
|
|
1596
1504
|
return e === !1 || e == null ? e : utils$1.isArray(e) ? e.map(normalizeValue) : String(e);
|
|
1597
1505
|
}
|
|
1598
1506
|
function parseTokens(e) {
|
|
1599
|
-
const t = /* @__PURE__ */ Object.create(null),
|
|
1600
|
-
let
|
|
1601
|
-
for (;
|
|
1602
|
-
t[
|
|
1507
|
+
const t = /* @__PURE__ */ Object.create(null), o = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1508
|
+
let n;
|
|
1509
|
+
for (; n = o.exec(e); )
|
|
1510
|
+
t[n[1]] = n[2];
|
|
1603
1511
|
return t;
|
|
1604
1512
|
}
|
|
1605
1513
|
const isValidHeaderName = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
1606
|
-
function matchHeaderValue(e, t,
|
|
1607
|
-
if (utils$1.isFunction(
|
|
1608
|
-
return
|
|
1609
|
-
if (
|
|
1610
|
-
if (utils$1.isString(
|
|
1611
|
-
return t.indexOf(
|
|
1612
|
-
if (utils$1.isRegExp(
|
|
1613
|
-
return
|
|
1514
|
+
function matchHeaderValue(e, t, o, n, r) {
|
|
1515
|
+
if (utils$1.isFunction(n))
|
|
1516
|
+
return n.call(this, t, o);
|
|
1517
|
+
if (r && (t = o), !!utils$1.isString(t)) {
|
|
1518
|
+
if (utils$1.isString(n))
|
|
1519
|
+
return t.indexOf(n) !== -1;
|
|
1520
|
+
if (utils$1.isRegExp(n))
|
|
1521
|
+
return n.test(t);
|
|
1614
1522
|
}
|
|
1615
1523
|
}
|
|
1616
1524
|
function formatHeader(e) {
|
|
1617
|
-
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t,
|
|
1525
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, o, n) => o.toUpperCase() + n);
|
|
1618
1526
|
}
|
|
1619
1527
|
function buildAccessors(e, t) {
|
|
1620
|
-
const
|
|
1621
|
-
["get", "set", "has"].forEach((
|
|
1622
|
-
Object.defineProperty(e,
|
|
1623
|
-
value: function(
|
|
1624
|
-
return this[
|
|
1528
|
+
const o = utils$1.toCamelCase(" " + t);
|
|
1529
|
+
["get", "set", "has"].forEach((n) => {
|
|
1530
|
+
Object.defineProperty(e, n + o, {
|
|
1531
|
+
value: function(r, s, l) {
|
|
1532
|
+
return this[n].call(this, t, r, s, l);
|
|
1625
1533
|
},
|
|
1626
1534
|
configurable: !0
|
|
1627
1535
|
});
|
|
@@ -1631,20 +1539,20 @@ let AxiosHeaders$1 = class {
|
|
|
1631
1539
|
constructor(t) {
|
|
1632
1540
|
t && this.set(t);
|
|
1633
1541
|
}
|
|
1634
|
-
set(t,
|
|
1635
|
-
const
|
|
1636
|
-
function
|
|
1542
|
+
set(t, o, n) {
|
|
1543
|
+
const r = this;
|
|
1544
|
+
function s(i, u, c) {
|
|
1637
1545
|
const a = normalizeHeader(u);
|
|
1638
1546
|
if (!a)
|
|
1639
1547
|
throw new Error("header name must be a non-empty string");
|
|
1640
|
-
const
|
|
1641
|
-
(!
|
|
1548
|
+
const d = utils$1.findKey(r, a);
|
|
1549
|
+
(!d || r[d] === void 0 || c === !0 || c === void 0 && r[d] !== !1) && (r[d || u] = normalizeValue(i));
|
|
1642
1550
|
}
|
|
1643
|
-
const l = (i, u) => utils$1.forEach(i, (c, a) =>
|
|
1551
|
+
const l = (i, u) => utils$1.forEach(i, (c, a) => s(c, a, u));
|
|
1644
1552
|
if (utils$1.isPlainObject(t) || t instanceof this.constructor)
|
|
1645
|
-
l(t,
|
|
1553
|
+
l(t, o);
|
|
1646
1554
|
else if (utils$1.isString(t) && (t = t.trim()) && !isValidHeaderName(t))
|
|
1647
|
-
l(parseHeaders(t),
|
|
1555
|
+
l(parseHeaders(t), o);
|
|
1648
1556
|
else if (utils$1.isObject(t) && utils$1.isIterable(t)) {
|
|
1649
1557
|
let i = {}, u, c;
|
|
1650
1558
|
for (const a of t) {
|
|
@@ -1652,81 +1560,81 @@ let AxiosHeaders$1 = class {
|
|
|
1652
1560
|
throw TypeError("Object iterator must return a key-value pair");
|
|
1653
1561
|
i[c = a[0]] = (u = i[c]) ? utils$1.isArray(u) ? [...u, a[1]] : [u, a[1]] : a[1];
|
|
1654
1562
|
}
|
|
1655
|
-
l(i,
|
|
1563
|
+
l(i, o);
|
|
1656
1564
|
} else
|
|
1657
|
-
t != null &&
|
|
1565
|
+
t != null && s(o, t, n);
|
|
1658
1566
|
return this;
|
|
1659
1567
|
}
|
|
1660
|
-
get(t,
|
|
1568
|
+
get(t, o) {
|
|
1661
1569
|
if (t = normalizeHeader(t), t) {
|
|
1662
|
-
const
|
|
1663
|
-
if (
|
|
1664
|
-
const
|
|
1665
|
-
if (!
|
|
1666
|
-
return
|
|
1667
|
-
if (
|
|
1668
|
-
return parseTokens(
|
|
1669
|
-
if (utils$1.isFunction(
|
|
1670
|
-
return
|
|
1671
|
-
if (utils$1.isRegExp(
|
|
1672
|
-
return
|
|
1570
|
+
const n = utils$1.findKey(this, t);
|
|
1571
|
+
if (n) {
|
|
1572
|
+
const r = this[n];
|
|
1573
|
+
if (!o)
|
|
1574
|
+
return r;
|
|
1575
|
+
if (o === !0)
|
|
1576
|
+
return parseTokens(r);
|
|
1577
|
+
if (utils$1.isFunction(o))
|
|
1578
|
+
return o.call(this, r, n);
|
|
1579
|
+
if (utils$1.isRegExp(o))
|
|
1580
|
+
return o.exec(r);
|
|
1673
1581
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
1674
1582
|
}
|
|
1675
1583
|
}
|
|
1676
1584
|
}
|
|
1677
|
-
has(t,
|
|
1585
|
+
has(t, o) {
|
|
1678
1586
|
if (t = normalizeHeader(t), t) {
|
|
1679
|
-
const
|
|
1680
|
-
return !!(
|
|
1587
|
+
const n = utils$1.findKey(this, t);
|
|
1588
|
+
return !!(n && this[n] !== void 0 && (!o || matchHeaderValue(this, this[n], n, o)));
|
|
1681
1589
|
}
|
|
1682
1590
|
return !1;
|
|
1683
1591
|
}
|
|
1684
|
-
delete(t,
|
|
1685
|
-
const
|
|
1686
|
-
let
|
|
1687
|
-
function
|
|
1592
|
+
delete(t, o) {
|
|
1593
|
+
const n = this;
|
|
1594
|
+
let r = !1;
|
|
1595
|
+
function s(l) {
|
|
1688
1596
|
if (l = normalizeHeader(l), l) {
|
|
1689
|
-
const i = utils$1.findKey(
|
|
1690
|
-
i && (!
|
|
1597
|
+
const i = utils$1.findKey(n, l);
|
|
1598
|
+
i && (!o || matchHeaderValue(n, n[i], i, o)) && (delete n[i], r = !0);
|
|
1691
1599
|
}
|
|
1692
1600
|
}
|
|
1693
|
-
return utils$1.isArray(t) ? t.forEach(
|
|
1601
|
+
return utils$1.isArray(t) ? t.forEach(s) : s(t), r;
|
|
1694
1602
|
}
|
|
1695
1603
|
clear(t) {
|
|
1696
|
-
const
|
|
1697
|
-
let
|
|
1698
|
-
for (;
|
|
1699
|
-
const
|
|
1700
|
-
(!t || matchHeaderValue(this, this[
|
|
1604
|
+
const o = Object.keys(this);
|
|
1605
|
+
let n = o.length, r = !1;
|
|
1606
|
+
for (; n--; ) {
|
|
1607
|
+
const s = o[n];
|
|
1608
|
+
(!t || matchHeaderValue(this, this[s], s, t, !0)) && (delete this[s], r = !0);
|
|
1701
1609
|
}
|
|
1702
|
-
return
|
|
1610
|
+
return r;
|
|
1703
1611
|
}
|
|
1704
1612
|
normalize(t) {
|
|
1705
|
-
const
|
|
1706
|
-
return utils$1.forEach(this, (
|
|
1707
|
-
const l = utils$1.findKey(
|
|
1613
|
+
const o = this, n = {};
|
|
1614
|
+
return utils$1.forEach(this, (r, s) => {
|
|
1615
|
+
const l = utils$1.findKey(n, s);
|
|
1708
1616
|
if (l) {
|
|
1709
|
-
|
|
1617
|
+
o[l] = normalizeValue(r), delete o[s];
|
|
1710
1618
|
return;
|
|
1711
1619
|
}
|
|
1712
|
-
const i = t ? formatHeader(
|
|
1713
|
-
i !==
|
|
1620
|
+
const i = t ? formatHeader(s) : String(s).trim();
|
|
1621
|
+
i !== s && delete o[s], o[i] = normalizeValue(r), n[i] = !0;
|
|
1714
1622
|
}), this;
|
|
1715
1623
|
}
|
|
1716
1624
|
concat(...t) {
|
|
1717
1625
|
return this.constructor.concat(this, ...t);
|
|
1718
1626
|
}
|
|
1719
1627
|
toJSON(t) {
|
|
1720
|
-
const
|
|
1721
|
-
return utils$1.forEach(this, (
|
|
1722
|
-
|
|
1723
|
-
}),
|
|
1628
|
+
const o = /* @__PURE__ */ Object.create(null);
|
|
1629
|
+
return utils$1.forEach(this, (n, r) => {
|
|
1630
|
+
n != null && n !== !1 && (o[r] = t && utils$1.isArray(n) ? n.join(", ") : n);
|
|
1631
|
+
}), o;
|
|
1724
1632
|
}
|
|
1725
1633
|
[Symbol.iterator]() {
|
|
1726
1634
|
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1727
1635
|
}
|
|
1728
1636
|
toString() {
|
|
1729
|
-
return Object.entries(this.toJSON()).map(([t,
|
|
1637
|
+
return Object.entries(this.toJSON()).map(([t, o]) => t + ": " + o).join(`
|
|
1730
1638
|
`);
|
|
1731
1639
|
}
|
|
1732
1640
|
getSetCookie() {
|
|
@@ -1738,56 +1646,56 @@ let AxiosHeaders$1 = class {
|
|
|
1738
1646
|
static from(t) {
|
|
1739
1647
|
return t instanceof this ? t : new this(t);
|
|
1740
1648
|
}
|
|
1741
|
-
static concat(t, ...
|
|
1742
|
-
const
|
|
1743
|
-
return
|
|
1649
|
+
static concat(t, ...o) {
|
|
1650
|
+
const n = new this(t);
|
|
1651
|
+
return o.forEach((r) => n.set(r)), n;
|
|
1744
1652
|
}
|
|
1745
1653
|
static accessor(t) {
|
|
1746
|
-
const
|
|
1654
|
+
const n = (this[$internals] = this[$internals] = {
|
|
1747
1655
|
accessors: {}
|
|
1748
|
-
}).accessors,
|
|
1749
|
-
function
|
|
1656
|
+
}).accessors, r = this.prototype;
|
|
1657
|
+
function s(l) {
|
|
1750
1658
|
const i = normalizeHeader(l);
|
|
1751
|
-
|
|
1659
|
+
n[i] || (buildAccessors(r, l), n[i] = !0);
|
|
1752
1660
|
}
|
|
1753
|
-
return utils$1.isArray(t) ? t.forEach(
|
|
1661
|
+
return utils$1.isArray(t) ? t.forEach(s) : s(t), this;
|
|
1754
1662
|
}
|
|
1755
1663
|
};
|
|
1756
1664
|
AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1757
1665
|
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: e }, t) => {
|
|
1758
|
-
let
|
|
1666
|
+
let o = t[0].toUpperCase() + t.slice(1);
|
|
1759
1667
|
return {
|
|
1760
1668
|
get: () => e,
|
|
1761
|
-
set(
|
|
1762
|
-
this[
|
|
1669
|
+
set(n) {
|
|
1670
|
+
this[o] = n;
|
|
1763
1671
|
}
|
|
1764
1672
|
};
|
|
1765
1673
|
});
|
|
1766
1674
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
1767
1675
|
function transformData(e, t) {
|
|
1768
|
-
const
|
|
1769
|
-
let
|
|
1676
|
+
const o = this || defaults, n = t || o, r = AxiosHeaders$1.from(n.headers);
|
|
1677
|
+
let s = n.data;
|
|
1770
1678
|
return utils$1.forEach(e, function(i) {
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1679
|
+
s = i.call(o, s, r.normalize(), t ? t.status : void 0);
|
|
1680
|
+
}), r.normalize(), s;
|
|
1773
1681
|
}
|
|
1774
1682
|
function isCancel$1(e) {
|
|
1775
1683
|
return !!(e && e.__CANCEL__);
|
|
1776
1684
|
}
|
|
1777
|
-
function CanceledError$1(e, t,
|
|
1778
|
-
AxiosError$1.call(this, e ?? "canceled", AxiosError$1.ERR_CANCELED, t,
|
|
1685
|
+
function CanceledError$1(e, t, o) {
|
|
1686
|
+
AxiosError$1.call(this, e ?? "canceled", AxiosError$1.ERR_CANCELED, t, o), this.name = "CanceledError";
|
|
1779
1687
|
}
|
|
1780
1688
|
utils$1.inherits(CanceledError$1, AxiosError$1, {
|
|
1781
1689
|
__CANCEL__: !0
|
|
1782
1690
|
});
|
|
1783
|
-
function settle(e, t,
|
|
1784
|
-
const
|
|
1785
|
-
!
|
|
1786
|
-
"Request failed with status code " +
|
|
1787
|
-
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1691
|
+
function settle(e, t, o) {
|
|
1692
|
+
const n = o.config.validateStatus;
|
|
1693
|
+
!o.status || !n || n(o.status) ? e(o) : t(new AxiosError$1(
|
|
1694
|
+
"Request failed with status code " + o.status,
|
|
1695
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(o.status / 100) - 4],
|
|
1696
|
+
o.config,
|
|
1697
|
+
o.request,
|
|
1698
|
+
o
|
|
1791
1699
|
));
|
|
1792
1700
|
}
|
|
1793
1701
|
function parseProtocol(e) {
|
|
@@ -1796,67 +1704,67 @@ function parseProtocol(e) {
|
|
|
1796
1704
|
}
|
|
1797
1705
|
function speedometer(e, t) {
|
|
1798
1706
|
e = e || 10;
|
|
1799
|
-
const
|
|
1800
|
-
let
|
|
1707
|
+
const o = new Array(e), n = new Array(e);
|
|
1708
|
+
let r = 0, s = 0, l;
|
|
1801
1709
|
return t = t !== void 0 ? t : 1e3, function(u) {
|
|
1802
|
-
const c = Date.now(), a =
|
|
1803
|
-
l || (l = c),
|
|
1804
|
-
let
|
|
1805
|
-
for (;
|
|
1806
|
-
|
|
1807
|
-
if (
|
|
1710
|
+
const c = Date.now(), a = n[s];
|
|
1711
|
+
l || (l = c), o[r] = u, n[r] = c;
|
|
1712
|
+
let d = s, f = 0;
|
|
1713
|
+
for (; d !== r; )
|
|
1714
|
+
f += o[d++], d = d % e;
|
|
1715
|
+
if (r = (r + 1) % e, r === s && (s = (s + 1) % e), c - l < t)
|
|
1808
1716
|
return;
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1717
|
+
const m = a && c - a;
|
|
1718
|
+
return m ? Math.round(f * 1e3 / m) : void 0;
|
|
1811
1719
|
};
|
|
1812
1720
|
}
|
|
1813
1721
|
function throttle(e, t) {
|
|
1814
|
-
let
|
|
1722
|
+
let o = 0, n = 1e3 / t, r, s;
|
|
1815
1723
|
const l = (c, a = Date.now()) => {
|
|
1816
|
-
|
|
1724
|
+
o = a, r = null, s && (clearTimeout(s), s = null), e(...c);
|
|
1817
1725
|
};
|
|
1818
1726
|
return [(...c) => {
|
|
1819
|
-
const a = Date.now(),
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
},
|
|
1823
|
-
}, () =>
|
|
1824
|
-
}
|
|
1825
|
-
const progressEventReducer = (e, t,
|
|
1826
|
-
let
|
|
1827
|
-
const
|
|
1828
|
-
return throttle((
|
|
1829
|
-
const l =
|
|
1830
|
-
|
|
1831
|
-
const
|
|
1727
|
+
const a = Date.now(), d = a - o;
|
|
1728
|
+
d >= n ? l(c, a) : (r = c, s || (s = setTimeout(() => {
|
|
1729
|
+
s = null, l(r);
|
|
1730
|
+
}, n - d)));
|
|
1731
|
+
}, () => r && l(r)];
|
|
1732
|
+
}
|
|
1733
|
+
const progressEventReducer = (e, t, o = 3) => {
|
|
1734
|
+
let n = 0;
|
|
1735
|
+
const r = speedometer(50, 250);
|
|
1736
|
+
return throttle((s) => {
|
|
1737
|
+
const l = s.loaded, i = s.lengthComputable ? s.total : void 0, u = l - n, c = r(u), a = l <= i;
|
|
1738
|
+
n = l;
|
|
1739
|
+
const d = {
|
|
1832
1740
|
loaded: l,
|
|
1833
1741
|
total: i,
|
|
1834
1742
|
progress: i ? l / i : void 0,
|
|
1835
1743
|
bytes: u,
|
|
1836
1744
|
rate: c || void 0,
|
|
1837
1745
|
estimated: c && i && a ? (i - l) / c : void 0,
|
|
1838
|
-
event:
|
|
1746
|
+
event: s,
|
|
1839
1747
|
lengthComputable: i != null,
|
|
1840
1748
|
[t ? "download" : "upload"]: !0
|
|
1841
1749
|
};
|
|
1842
|
-
e(
|
|
1843
|
-
},
|
|
1750
|
+
e(d);
|
|
1751
|
+
}, o);
|
|
1844
1752
|
}, progressEventDecorator = (e, t) => {
|
|
1845
|
-
const
|
|
1846
|
-
return [(
|
|
1847
|
-
lengthComputable:
|
|
1753
|
+
const o = e != null;
|
|
1754
|
+
return [(n) => t[0]({
|
|
1755
|
+
lengthComputable: o,
|
|
1848
1756
|
total: e,
|
|
1849
|
-
loaded:
|
|
1757
|
+
loaded: n
|
|
1850
1758
|
}), t[1]];
|
|
1851
|
-
}, asyncDecorator = (e) => (...t) => utils$1.asap(() => e(...t)), isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (
|
|
1759
|
+
}, asyncDecorator = (e) => (...t) => utils$1.asap(() => e(...t)), isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (o) => (o = new URL(o, platform.origin), e.protocol === o.protocol && e.host === o.host && (t || e.port === o.port)))(
|
|
1852
1760
|
new URL(platform.origin),
|
|
1853
1761
|
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
1854
1762
|
) : () => !0, cookies = platform.hasStandardBrowserEnv ? (
|
|
1855
1763
|
// Standard browser envs support document.cookie
|
|
1856
1764
|
{
|
|
1857
|
-
write(e, t, n,
|
|
1765
|
+
write(e, t, o, n, r, s) {
|
|
1858
1766
|
const l = [e + "=" + encodeURIComponent(t)];
|
|
1859
|
-
utils$1.isNumber(
|
|
1767
|
+
utils$1.isNumber(o) && l.push("expires=" + new Date(o).toGMTString()), utils$1.isString(n) && l.push("path=" + n), utils$1.isString(r) && l.push("domain=" + r), s === !0 && l.push("secure"), document.cookie = l.join("; ");
|
|
1860
1768
|
},
|
|
1861
1769
|
read(e) {
|
|
1862
1770
|
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -1884,43 +1792,43 @@ function isAbsoluteURL(e) {
|
|
|
1884
1792
|
function combineURLs(e, t) {
|
|
1885
1793
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1886
1794
|
}
|
|
1887
|
-
function buildFullPath(e, t,
|
|
1888
|
-
let
|
|
1889
|
-
return e && (
|
|
1795
|
+
function buildFullPath(e, t, o) {
|
|
1796
|
+
let n = !isAbsoluteURL(t);
|
|
1797
|
+
return e && (n || o == !1) ? combineURLs(e, t) : t;
|
|
1890
1798
|
}
|
|
1891
1799
|
const headersToObject = (e) => e instanceof AxiosHeaders$1 ? { ...e } : e;
|
|
1892
1800
|
function mergeConfig$1(e, t) {
|
|
1893
1801
|
t = t || {};
|
|
1894
|
-
const
|
|
1895
|
-
function
|
|
1896
|
-
return utils$1.isPlainObject(c) && utils$1.isPlainObject(a) ? utils$1.merge.call({ caseless:
|
|
1802
|
+
const o = {};
|
|
1803
|
+
function n(c, a, d, f) {
|
|
1804
|
+
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;
|
|
1897
1805
|
}
|
|
1898
|
-
function
|
|
1806
|
+
function r(c, a, d, f) {
|
|
1899
1807
|
if (utils$1.isUndefined(a)) {
|
|
1900
1808
|
if (!utils$1.isUndefined(c))
|
|
1901
|
-
return
|
|
1902
|
-
} else return
|
|
1809
|
+
return n(void 0, c, d, f);
|
|
1810
|
+
} else return n(c, a, d, f);
|
|
1903
1811
|
}
|
|
1904
|
-
function
|
|
1812
|
+
function s(c, a) {
|
|
1905
1813
|
if (!utils$1.isUndefined(a))
|
|
1906
|
-
return
|
|
1814
|
+
return n(void 0, a);
|
|
1907
1815
|
}
|
|
1908
1816
|
function l(c, a) {
|
|
1909
1817
|
if (utils$1.isUndefined(a)) {
|
|
1910
1818
|
if (!utils$1.isUndefined(c))
|
|
1911
|
-
return
|
|
1912
|
-
} else return
|
|
1819
|
+
return n(void 0, c);
|
|
1820
|
+
} else return n(void 0, a);
|
|
1913
1821
|
}
|
|
1914
|
-
function i(c, a,
|
|
1915
|
-
if (
|
|
1916
|
-
return
|
|
1917
|
-
if (
|
|
1918
|
-
return
|
|
1822
|
+
function i(c, a, d) {
|
|
1823
|
+
if (d in t)
|
|
1824
|
+
return n(c, a);
|
|
1825
|
+
if (d in e)
|
|
1826
|
+
return n(void 0, c);
|
|
1919
1827
|
}
|
|
1920
1828
|
const u = {
|
|
1921
|
-
url:
|
|
1922
|
-
method:
|
|
1923
|
-
data:
|
|
1829
|
+
url: s,
|
|
1830
|
+
method: s,
|
|
1831
|
+
data: s,
|
|
1924
1832
|
baseURL: l,
|
|
1925
1833
|
transformRequest: l,
|
|
1926
1834
|
transformResponse: l,
|
|
@@ -1946,126 +1854,126 @@ function mergeConfig$1(e, t) {
|
|
|
1946
1854
|
socketPath: l,
|
|
1947
1855
|
responseEncoding: l,
|
|
1948
1856
|
validateStatus: i,
|
|
1949
|
-
headers: (c, a,
|
|
1857
|
+
headers: (c, a, d) => r(headersToObject(c), headersToObject(a), d, !0)
|
|
1950
1858
|
};
|
|
1951
1859
|
return utils$1.forEach(Object.keys({ ...e, ...t }), function(a) {
|
|
1952
|
-
const
|
|
1953
|
-
utils$1.isUndefined(
|
|
1954
|
-
}),
|
|
1860
|
+
const d = u[a] || r, f = d(e[a], t[a], a);
|
|
1861
|
+
utils$1.isUndefined(f) && d !== i || (o[a] = f);
|
|
1862
|
+
}), o;
|
|
1955
1863
|
}
|
|
1956
1864
|
const resolveConfig = (e) => {
|
|
1957
1865
|
const t = mergeConfig$1({}, e);
|
|
1958
|
-
let { data:
|
|
1866
|
+
let { data: o, withXSRFToken: n, xsrfHeaderName: r, xsrfCookieName: s, headers: l, auth: i } = t;
|
|
1959
1867
|
t.headers = l = AxiosHeaders$1.from(l), t.url = buildURL(buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), i && l.set(
|
|
1960
1868
|
"Authorization",
|
|
1961
1869
|
"Basic " + btoa((i.username || "") + ":" + (i.password ? unescape(encodeURIComponent(i.password)) : ""))
|
|
1962
1870
|
);
|
|
1963
1871
|
let u;
|
|
1964
|
-
if (utils$1.isFormData(
|
|
1872
|
+
if (utils$1.isFormData(o)) {
|
|
1965
1873
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv)
|
|
1966
1874
|
l.setContentType(void 0);
|
|
1967
1875
|
else if ((u = l.getContentType()) !== !1) {
|
|
1968
|
-
const [c, ...a] = u ? u.split(";").map((
|
|
1876
|
+
const [c, ...a] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1969
1877
|
l.setContentType([c || "multipart/form-data", ...a].join("; "));
|
|
1970
1878
|
}
|
|
1971
1879
|
}
|
|
1972
|
-
if (platform.hasStandardBrowserEnv && (
|
|
1973
|
-
const c =
|
|
1974
|
-
c && l.set(
|
|
1880
|
+
if (platform.hasStandardBrowserEnv && (n && utils$1.isFunction(n) && (n = n(t)), n || n !== !1 && isURLSameOrigin(t.url))) {
|
|
1881
|
+
const c = r && s && cookies.read(s);
|
|
1882
|
+
c && l.set(r, c);
|
|
1975
1883
|
}
|
|
1976
1884
|
return t;
|
|
1977
1885
|
}, isXHRAdapterSupported = typeof XMLHttpRequest < "u", xhrAdapter = isXHRAdapterSupported && function(e) {
|
|
1978
|
-
return new Promise(function(
|
|
1979
|
-
const
|
|
1980
|
-
let
|
|
1981
|
-
const l = AxiosHeaders$1.from(
|
|
1982
|
-
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } =
|
|
1983
|
-
function
|
|
1984
|
-
|
|
1886
|
+
return new Promise(function(o, n) {
|
|
1887
|
+
const r = resolveConfig(e);
|
|
1888
|
+
let s = r.data;
|
|
1889
|
+
const l = AxiosHeaders$1.from(r.headers).normalize();
|
|
1890
|
+
let { responseType: i, onUploadProgress: u, onDownloadProgress: c } = r, a, d, f, m, p;
|
|
1891
|
+
function g() {
|
|
1892
|
+
m && m(), p && p(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
1985
1893
|
}
|
|
1986
|
-
let
|
|
1987
|
-
|
|
1988
|
-
function
|
|
1989
|
-
if (!
|
|
1894
|
+
let y = new XMLHttpRequest();
|
|
1895
|
+
y.open(r.method.toUpperCase(), r.url, !0), y.timeout = r.timeout;
|
|
1896
|
+
function x() {
|
|
1897
|
+
if (!y)
|
|
1990
1898
|
return;
|
|
1991
|
-
const
|
|
1992
|
-
"getAllResponseHeaders" in
|
|
1899
|
+
const E = AxiosHeaders$1.from(
|
|
1900
|
+
"getAllResponseHeaders" in y && y.getAllResponseHeaders()
|
|
1993
1901
|
), _ = {
|
|
1994
|
-
data: !i || i === "text" || i === "json" ?
|
|
1995
|
-
status:
|
|
1996
|
-
statusText:
|
|
1997
|
-
headers:
|
|
1902
|
+
data: !i || i === "text" || i === "json" ? y.responseText : y.response,
|
|
1903
|
+
status: y.status,
|
|
1904
|
+
statusText: y.statusText,
|
|
1905
|
+
headers: E,
|
|
1998
1906
|
config: e,
|
|
1999
|
-
request:
|
|
1907
|
+
request: y
|
|
2000
1908
|
};
|
|
2001
|
-
settle(function(
|
|
2002
|
-
|
|
2003
|
-
}, function(
|
|
2004
|
-
|
|
2005
|
-
}, _),
|
|
1909
|
+
settle(function(B) {
|
|
1910
|
+
o(B), g();
|
|
1911
|
+
}, function(B) {
|
|
1912
|
+
n(B), g();
|
|
1913
|
+
}, _), y = null;
|
|
2006
1914
|
}
|
|
2007
|
-
"onloadend" in
|
|
2008
|
-
!
|
|
2009
|
-
},
|
|
2010
|
-
|
|
2011
|
-
},
|
|
2012
|
-
|
|
2013
|
-
},
|
|
2014
|
-
let
|
|
2015
|
-
const _ =
|
|
2016
|
-
|
|
2017
|
-
|
|
1915
|
+
"onloadend" in y ? y.onloadend = x : y.onreadystatechange = function() {
|
|
1916
|
+
!y || y.readyState !== 4 || y.status === 0 && !(y.responseURL && y.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1917
|
+
}, y.onabort = function() {
|
|
1918
|
+
y && (n(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, e, y)), y = null);
|
|
1919
|
+
}, y.onerror = function() {
|
|
1920
|
+
n(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, y)), y = null;
|
|
1921
|
+
}, y.ontimeout = function() {
|
|
1922
|
+
let C = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1923
|
+
const _ = r.transitional || transitionalDefaults;
|
|
1924
|
+
r.timeoutErrorMessage && (C = r.timeoutErrorMessage), n(new AxiosError$1(
|
|
1925
|
+
C,
|
|
2018
1926
|
_.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2019
1927
|
e,
|
|
2020
|
-
|
|
2021
|
-
)),
|
|
2022
|
-
},
|
|
2023
|
-
|
|
2024
|
-
}), utils$1.isUndefined(
|
|
2025
|
-
|
|
2026
|
-
},
|
|
2027
|
-
const
|
|
2028
|
-
if (
|
|
2029
|
-
|
|
1928
|
+
y
|
|
1929
|
+
)), y = null;
|
|
1930
|
+
}, s === void 0 && l.setContentType(null), "setRequestHeader" in y && utils$1.forEach(l.toJSON(), function(C, _) {
|
|
1931
|
+
y.setRequestHeader(_, C);
|
|
1932
|
+
}), utils$1.isUndefined(r.withCredentials) || (y.withCredentials = !!r.withCredentials), i && i !== "json" && (y.responseType = r.responseType), c && ([f, p] = progressEventReducer(c, !0), y.addEventListener("progress", f)), u && y.upload && ([d, m] = progressEventReducer(u), y.upload.addEventListener("progress", d), y.upload.addEventListener("loadend", m)), (r.cancelToken || r.signal) && (a = (E) => {
|
|
1933
|
+
y && (n(!E || E.type ? new CanceledError$1(null, e, y) : E), y.abort(), y = null);
|
|
1934
|
+
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1935
|
+
const w = parseProtocol(r.url);
|
|
1936
|
+
if (w && platform.protocols.indexOf(w) === -1) {
|
|
1937
|
+
n(new AxiosError$1("Unsupported protocol " + w + ":", AxiosError$1.ERR_BAD_REQUEST, e));
|
|
2030
1938
|
return;
|
|
2031
1939
|
}
|
|
2032
|
-
|
|
1940
|
+
y.send(s || null);
|
|
2033
1941
|
});
|
|
2034
1942
|
}, composeSignals = (e, t) => {
|
|
2035
|
-
const { length:
|
|
2036
|
-
if (t ||
|
|
2037
|
-
let
|
|
2038
|
-
const
|
|
2039
|
-
if (!
|
|
2040
|
-
|
|
1943
|
+
const { length: o } = e = e ? e.filter(Boolean) : [];
|
|
1944
|
+
if (t || o) {
|
|
1945
|
+
let n = new AbortController(), r;
|
|
1946
|
+
const s = function(c) {
|
|
1947
|
+
if (!r) {
|
|
1948
|
+
r = !0, i();
|
|
2041
1949
|
const a = c instanceof Error ? c : this.reason;
|
|
2042
|
-
|
|
1950
|
+
n.abort(a instanceof AxiosError$1 ? a : new CanceledError$1(a instanceof Error ? a.message : a));
|
|
2043
1951
|
}
|
|
2044
1952
|
};
|
|
2045
1953
|
let l = t && setTimeout(() => {
|
|
2046
|
-
l = null,
|
|
1954
|
+
l = null, s(new AxiosError$1(`timeout ${t} of ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
2047
1955
|
}, t);
|
|
2048
1956
|
const i = () => {
|
|
2049
1957
|
e && (l && clearTimeout(l), l = null, e.forEach((c) => {
|
|
2050
|
-
c.unsubscribe ? c.unsubscribe(
|
|
1958
|
+
c.unsubscribe ? c.unsubscribe(s) : c.removeEventListener("abort", s);
|
|
2051
1959
|
}), e = null);
|
|
2052
1960
|
};
|
|
2053
|
-
e.forEach((c) => c.addEventListener("abort",
|
|
2054
|
-
const { signal: u } =
|
|
1961
|
+
e.forEach((c) => c.addEventListener("abort", s));
|
|
1962
|
+
const { signal: u } = n;
|
|
2055
1963
|
return u.unsubscribe = () => utils$1.asap(i), u;
|
|
2056
1964
|
}
|
|
2057
1965
|
}, streamChunk = function* (e, t) {
|
|
2058
|
-
let
|
|
2059
|
-
if (
|
|
1966
|
+
let o = e.byteLength;
|
|
1967
|
+
if (o < t) {
|
|
2060
1968
|
yield e;
|
|
2061
1969
|
return;
|
|
2062
1970
|
}
|
|
2063
|
-
let
|
|
2064
|
-
for (;
|
|
2065
|
-
|
|
1971
|
+
let n = 0, r;
|
|
1972
|
+
for (; n < o; )
|
|
1973
|
+
r = n + t, yield e.slice(n, r), n = r;
|
|
2066
1974
|
}, readBytes = async function* (e, t) {
|
|
2067
|
-
for await (const
|
|
2068
|
-
yield* streamChunk(
|
|
1975
|
+
for await (const o of readStream(e))
|
|
1976
|
+
yield* streamChunk(o, t);
|
|
2069
1977
|
}, readStream = async function* (e) {
|
|
2070
1978
|
if (e[Symbol.asyncIterator]) {
|
|
2071
1979
|
yield* e;
|
|
@@ -2074,31 +1982,31 @@ const resolveConfig = (e) => {
|
|
|
2074
1982
|
const t = e.getReader();
|
|
2075
1983
|
try {
|
|
2076
1984
|
for (; ; ) {
|
|
2077
|
-
const { done:
|
|
2078
|
-
if (
|
|
1985
|
+
const { done: o, value: n } = await t.read();
|
|
1986
|
+
if (o)
|
|
2079
1987
|
break;
|
|
2080
|
-
yield
|
|
1988
|
+
yield n;
|
|
2081
1989
|
}
|
|
2082
1990
|
} finally {
|
|
2083
1991
|
await t.cancel();
|
|
2084
1992
|
}
|
|
2085
|
-
}, trackStream = (e, t,
|
|
2086
|
-
const
|
|
2087
|
-
let
|
|
2088
|
-
l || (l = !0,
|
|
1993
|
+
}, trackStream = (e, t, o, n) => {
|
|
1994
|
+
const r = readBytes(e, t);
|
|
1995
|
+
let s = 0, l, i = (u) => {
|
|
1996
|
+
l || (l = !0, n && n(u));
|
|
2089
1997
|
};
|
|
2090
1998
|
return new ReadableStream({
|
|
2091
1999
|
async pull(u) {
|
|
2092
2000
|
try {
|
|
2093
|
-
const { done: c, value: a } = await
|
|
2001
|
+
const { done: c, value: a } = await r.next();
|
|
2094
2002
|
if (c) {
|
|
2095
2003
|
i(), u.close();
|
|
2096
2004
|
return;
|
|
2097
2005
|
}
|
|
2098
|
-
let
|
|
2099
|
-
if (
|
|
2100
|
-
let
|
|
2101
|
-
|
|
2006
|
+
let d = a.byteLength;
|
|
2007
|
+
if (o) {
|
|
2008
|
+
let f = s += d;
|
|
2009
|
+
o(f);
|
|
2102
2010
|
}
|
|
2103
2011
|
u.enqueue(new Uint8Array(a));
|
|
2104
2012
|
} catch (c) {
|
|
@@ -2106,7 +2014,7 @@ const resolveConfig = (e) => {
|
|
|
2106
2014
|
}
|
|
2107
2015
|
},
|
|
2108
2016
|
cancel(u) {
|
|
2109
|
-
return i(u),
|
|
2017
|
+
return i(u), r.return();
|
|
2110
2018
|
}
|
|
2111
2019
|
}, {
|
|
2112
2020
|
highWaterMark: 2
|
|
@@ -2132,8 +2040,8 @@ const resolveConfig = (e) => {
|
|
|
2132
2040
|
};
|
|
2133
2041
|
isFetchSupported && ((e) => {
|
|
2134
2042
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
2135
|
-
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (
|
|
2136
|
-
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT,
|
|
2043
|
+
!resolvers[t] && (resolvers[t] = utils$1.isFunction(e[t]) ? (o) => o[t]() : (o, n) => {
|
|
2044
|
+
throw new AxiosError$1(`Response type '${t}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, n);
|
|
2137
2045
|
});
|
|
2138
2046
|
});
|
|
2139
2047
|
})(new Response());
|
|
@@ -2152,92 +2060,92 @@ const getBodyLength = async (e) => {
|
|
|
2152
2060
|
if (utils$1.isURLSearchParams(e) && (e = e + ""), utils$1.isString(e))
|
|
2153
2061
|
return (await encodeText(e)).byteLength;
|
|
2154
2062
|
}, resolveBodyLength = async (e, t) => {
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2063
|
+
const o = utils$1.toFiniteNumber(e.getContentLength());
|
|
2064
|
+
return o ?? getBodyLength(t);
|
|
2157
2065
|
}, fetchAdapter = isFetchSupported && (async (e) => {
|
|
2158
2066
|
let {
|
|
2159
2067
|
url: t,
|
|
2160
|
-
method:
|
|
2161
|
-
data:
|
|
2162
|
-
signal:
|
|
2163
|
-
cancelToken:
|
|
2068
|
+
method: o,
|
|
2069
|
+
data: n,
|
|
2070
|
+
signal: r,
|
|
2071
|
+
cancelToken: s,
|
|
2164
2072
|
timeout: l,
|
|
2165
2073
|
onDownloadProgress: i,
|
|
2166
2074
|
onUploadProgress: u,
|
|
2167
2075
|
responseType: c,
|
|
2168
2076
|
headers: a,
|
|
2169
|
-
withCredentials:
|
|
2170
|
-
fetchOptions:
|
|
2077
|
+
withCredentials: d = "same-origin",
|
|
2078
|
+
fetchOptions: f
|
|
2171
2079
|
} = resolveConfig(e);
|
|
2172
2080
|
c = c ? (c + "").toLowerCase() : "text";
|
|
2173
|
-
let
|
|
2174
|
-
const
|
|
2175
|
-
|
|
2081
|
+
let m = composeSignals([r, s && s.toAbortSignal()], l), p;
|
|
2082
|
+
const g = m && m.unsubscribe && (() => {
|
|
2083
|
+
m.unsubscribe();
|
|
2176
2084
|
});
|
|
2177
|
-
let
|
|
2085
|
+
let y;
|
|
2178
2086
|
try {
|
|
2179
|
-
if (u && supportsRequestStream &&
|
|
2087
|
+
if (u && supportsRequestStream && o !== "get" && o !== "head" && (y = await resolveBodyLength(a, n)) !== 0) {
|
|
2180
2088
|
let _ = new Request(t, {
|
|
2181
2089
|
method: "POST",
|
|
2182
|
-
body:
|
|
2090
|
+
body: n,
|
|
2183
2091
|
duplex: "half"
|
|
2184
|
-
}),
|
|
2185
|
-
if (utils$1.isFormData(
|
|
2186
|
-
const [
|
|
2187
|
-
|
|
2092
|
+
}), S;
|
|
2093
|
+
if (utils$1.isFormData(n) && (S = _.headers.get("content-type")) && a.setContentType(S), _.body) {
|
|
2094
|
+
const [B, V] = progressEventDecorator(
|
|
2095
|
+
y,
|
|
2188
2096
|
progressEventReducer(asyncDecorator(u))
|
|
2189
2097
|
);
|
|
2190
|
-
|
|
2098
|
+
n = trackStream(_.body, DEFAULT_CHUNK_SIZE, B, V);
|
|
2191
2099
|
}
|
|
2192
2100
|
}
|
|
2193
|
-
utils$1.isString(
|
|
2194
|
-
const
|
|
2195
|
-
|
|
2196
|
-
...
|
|
2197
|
-
signal:
|
|
2198
|
-
method:
|
|
2101
|
+
utils$1.isString(d) || (d = d ? "include" : "omit");
|
|
2102
|
+
const x = "credentials" in Request.prototype;
|
|
2103
|
+
p = new Request(t, {
|
|
2104
|
+
...f,
|
|
2105
|
+
signal: m,
|
|
2106
|
+
method: o.toUpperCase(),
|
|
2199
2107
|
headers: a.normalize().toJSON(),
|
|
2200
|
-
body:
|
|
2108
|
+
body: n,
|
|
2201
2109
|
duplex: "half",
|
|
2202
|
-
credentials:
|
|
2110
|
+
credentials: x ? d : void 0
|
|
2203
2111
|
});
|
|
2204
|
-
let
|
|
2205
|
-
const
|
|
2206
|
-
if (supportsResponseStream && (i ||
|
|
2112
|
+
let w = await fetch(p, f);
|
|
2113
|
+
const E = supportsResponseStream && (c === "stream" || c === "response");
|
|
2114
|
+
if (supportsResponseStream && (i || E && g)) {
|
|
2207
2115
|
const _ = {};
|
|
2208
|
-
["status", "statusText", "headers"].forEach((
|
|
2209
|
-
_[
|
|
2116
|
+
["status", "statusText", "headers"].forEach((A) => {
|
|
2117
|
+
_[A] = w[A];
|
|
2210
2118
|
});
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2119
|
+
const S = utils$1.toFiniteNumber(w.headers.get("content-length")), [B, V] = i && progressEventDecorator(
|
|
2120
|
+
S,
|
|
2213
2121
|
progressEventReducer(asyncDecorator(i), !0)
|
|
2214
2122
|
) || [];
|
|
2215
|
-
|
|
2216
|
-
trackStream(
|
|
2217
|
-
|
|
2123
|
+
w = new Response(
|
|
2124
|
+
trackStream(w.body, DEFAULT_CHUNK_SIZE, B, () => {
|
|
2125
|
+
V && V(), g && g();
|
|
2218
2126
|
}),
|
|
2219
2127
|
_
|
|
2220
2128
|
);
|
|
2221
2129
|
}
|
|
2222
2130
|
c = c || "text";
|
|
2223
|
-
let
|
|
2224
|
-
return !
|
|
2225
|
-
settle(_,
|
|
2226
|
-
data:
|
|
2227
|
-
headers: AxiosHeaders$1.from(
|
|
2228
|
-
status:
|
|
2229
|
-
statusText:
|
|
2131
|
+
let C = await resolvers[utils$1.findKey(resolvers, c) || "text"](w, e);
|
|
2132
|
+
return !E && g && g(), await new Promise((_, S) => {
|
|
2133
|
+
settle(_, S, {
|
|
2134
|
+
data: C,
|
|
2135
|
+
headers: AxiosHeaders$1.from(w.headers),
|
|
2136
|
+
status: w.status,
|
|
2137
|
+
statusText: w.statusText,
|
|
2230
2138
|
config: e,
|
|
2231
|
-
request:
|
|
2139
|
+
request: p
|
|
2232
2140
|
});
|
|
2233
2141
|
});
|
|
2234
|
-
} catch (
|
|
2235
|
-
throw
|
|
2236
|
-
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e,
|
|
2142
|
+
} catch (x) {
|
|
2143
|
+
throw g && g(), x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message) ? Object.assign(
|
|
2144
|
+
new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, e, p),
|
|
2237
2145
|
{
|
|
2238
|
-
cause:
|
|
2146
|
+
cause: x.cause || x
|
|
2239
2147
|
}
|
|
2240
|
-
) : AxiosError$1.from(
|
|
2148
|
+
) : AxiosError$1.from(x, x && x.code, e, p);
|
|
2241
2149
|
}
|
|
2242
2150
|
}), knownAdapters = {
|
|
2243
2151
|
http: httpAdapter,
|
|
@@ -2257,30 +2165,30 @@ const renderReason = (e) => `- ${e}`, isResolvedHandle = (e) => utils$1.isFuncti
|
|
|
2257
2165
|
getAdapter: (e) => {
|
|
2258
2166
|
e = utils$1.isArray(e) ? e : [e];
|
|
2259
2167
|
const { length: t } = e;
|
|
2260
|
-
let
|
|
2261
|
-
const
|
|
2262
|
-
for (let
|
|
2263
|
-
|
|
2168
|
+
let o, n;
|
|
2169
|
+
const r = {};
|
|
2170
|
+
for (let s = 0; s < t; s++) {
|
|
2171
|
+
o = e[s];
|
|
2264
2172
|
let l;
|
|
2265
|
-
if (
|
|
2173
|
+
if (n = o, !isResolvedHandle(o) && (n = knownAdapters[(l = String(o)).toLowerCase()], n === void 0))
|
|
2266
2174
|
throw new AxiosError$1(`Unknown adapter '${l}'`);
|
|
2267
|
-
if (
|
|
2175
|
+
if (n)
|
|
2268
2176
|
break;
|
|
2269
|
-
|
|
2177
|
+
r[l || "#" + s] = n;
|
|
2270
2178
|
}
|
|
2271
|
-
if (!
|
|
2272
|
-
const
|
|
2179
|
+
if (!n) {
|
|
2180
|
+
const s = Object.entries(r).map(
|
|
2273
2181
|
([i, u]) => `adapter ${i} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2274
2182
|
);
|
|
2275
|
-
let l = t ?
|
|
2276
|
-
` +
|
|
2277
|
-
`) : " " + renderReason(
|
|
2183
|
+
let l = t ? s.length > 1 ? `since :
|
|
2184
|
+
` + s.map(renderReason).join(`
|
|
2185
|
+
`) : " " + renderReason(s[0]) : "as no adapter specified";
|
|
2278
2186
|
throw new AxiosError$1(
|
|
2279
2187
|
"There is no suitable adapter to dispatch the request " + l,
|
|
2280
2188
|
"ERR_NOT_SUPPORT"
|
|
2281
2189
|
);
|
|
2282
2190
|
}
|
|
2283
|
-
return
|
|
2191
|
+
return n;
|
|
2284
2192
|
},
|
|
2285
2193
|
adapters: knownAdapters
|
|
2286
2194
|
};
|
|
@@ -2292,63 +2200,63 @@ function dispatchRequest(e) {
|
|
|
2292
2200
|
return throwIfCancellationRequested(e), e.headers = AxiosHeaders$1.from(e.headers), e.data = transformData.call(
|
|
2293
2201
|
e,
|
|
2294
2202
|
e.transformRequest
|
|
2295
|
-
), ["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(
|
|
2296
|
-
return throwIfCancellationRequested(e),
|
|
2203
|
+
), ["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(n) {
|
|
2204
|
+
return throwIfCancellationRequested(e), n.data = transformData.call(
|
|
2297
2205
|
e,
|
|
2298
2206
|
e.transformResponse,
|
|
2299
|
-
|
|
2300
|
-
),
|
|
2301
|
-
}, function(
|
|
2302
|
-
return isCancel$1(
|
|
2207
|
+
n
|
|
2208
|
+
), n.headers = AxiosHeaders$1.from(n.headers), n;
|
|
2209
|
+
}, function(n) {
|
|
2210
|
+
return isCancel$1(n) || (throwIfCancellationRequested(e), n && n.response && (n.response.data = transformData.call(
|
|
2303
2211
|
e,
|
|
2304
2212
|
e.transformResponse,
|
|
2305
|
-
|
|
2306
|
-
),
|
|
2213
|
+
n.response
|
|
2214
|
+
), n.response.headers = AxiosHeaders$1.from(n.response.headers))), Promise.reject(n);
|
|
2307
2215
|
});
|
|
2308
2216
|
}
|
|
2309
2217
|
const VERSION$1 = "1.11.0", validators$1 = {};
|
|
2310
2218
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2311
|
-
validators$1[e] = function(
|
|
2312
|
-
return typeof
|
|
2219
|
+
validators$1[e] = function(n) {
|
|
2220
|
+
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2313
2221
|
};
|
|
2314
2222
|
});
|
|
2315
2223
|
const deprecatedWarnings = {};
|
|
2316
|
-
validators$1.transitional = function(t,
|
|
2317
|
-
function s
|
|
2318
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" +
|
|
2224
|
+
validators$1.transitional = function(t, o, n) {
|
|
2225
|
+
function r(s, l) {
|
|
2226
|
+
return "[Axios v" + VERSION$1 + "] Transitional option '" + s + "'" + l + (n ? ". " + n : "");
|
|
2319
2227
|
}
|
|
2320
|
-
return (
|
|
2228
|
+
return (s, l, i) => {
|
|
2321
2229
|
if (t === !1)
|
|
2322
2230
|
throw new AxiosError$1(
|
|
2323
|
-
|
|
2231
|
+
r(l, " has been removed" + (o ? " in " + o : "")),
|
|
2324
2232
|
AxiosError$1.ERR_DEPRECATED
|
|
2325
2233
|
);
|
|
2326
|
-
return
|
|
2327
|
-
|
|
2234
|
+
return o && !deprecatedWarnings[l] && (deprecatedWarnings[l] = !0, console.warn(
|
|
2235
|
+
r(
|
|
2328
2236
|
l,
|
|
2329
|
-
" has been deprecated since v" +
|
|
2237
|
+
" has been deprecated since v" + o + " and will be removed in the near future"
|
|
2330
2238
|
)
|
|
2331
|
-
)), t ? t(
|
|
2239
|
+
)), t ? t(s, l, i) : !0;
|
|
2332
2240
|
};
|
|
2333
2241
|
};
|
|
2334
2242
|
validators$1.spelling = function(t) {
|
|
2335
|
-
return (
|
|
2243
|
+
return (o, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
|
|
2336
2244
|
};
|
|
2337
|
-
function assertOptions(e, t,
|
|
2245
|
+
function assertOptions(e, t, o) {
|
|
2338
2246
|
if (typeof e != "object")
|
|
2339
2247
|
throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2340
|
-
const
|
|
2341
|
-
let
|
|
2342
|
-
for (;
|
|
2343
|
-
const
|
|
2248
|
+
const n = Object.keys(e);
|
|
2249
|
+
let r = n.length;
|
|
2250
|
+
for (; r-- > 0; ) {
|
|
2251
|
+
const s = n[r], l = t[s];
|
|
2344
2252
|
if (l) {
|
|
2345
|
-
const i = e[
|
|
2253
|
+
const i = e[s], u = i === void 0 || l(i, s, e);
|
|
2346
2254
|
if (u !== !0)
|
|
2347
|
-
throw new AxiosError$1("option " +
|
|
2255
|
+
throw new AxiosError$1("option " + s + " must be " + u, AxiosError$1.ERR_BAD_OPTION_VALUE);
|
|
2348
2256
|
continue;
|
|
2349
2257
|
}
|
|
2350
|
-
if (
|
|
2351
|
-
throw new AxiosError$1("Unknown option " +
|
|
2258
|
+
if (o !== !0)
|
|
2259
|
+
throw new AxiosError$1("Unknown option " + s, AxiosError$1.ERR_BAD_OPTION);
|
|
2352
2260
|
}
|
|
2353
2261
|
}
|
|
2354
2262
|
const validator = {
|
|
@@ -2370,140 +2278,140 @@ let Axios$1 = class {
|
|
|
2370
2278
|
*
|
|
2371
2279
|
* @returns {Promise} The Promise to be fulfilled
|
|
2372
2280
|
*/
|
|
2373
|
-
async request(t,
|
|
2281
|
+
async request(t, o) {
|
|
2374
2282
|
try {
|
|
2375
|
-
return await this._request(t,
|
|
2376
|
-
} catch (
|
|
2377
|
-
if (
|
|
2378
|
-
let
|
|
2379
|
-
Error.captureStackTrace ? Error.captureStackTrace(
|
|
2380
|
-
const
|
|
2283
|
+
return await this._request(t, o);
|
|
2284
|
+
} catch (n) {
|
|
2285
|
+
if (n instanceof Error) {
|
|
2286
|
+
let r = {};
|
|
2287
|
+
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
2288
|
+
const s = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
2381
2289
|
try {
|
|
2382
|
-
|
|
2383
|
-
` +
|
|
2290
|
+
n.stack ? s && !String(n.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (n.stack += `
|
|
2291
|
+
` + s) : n.stack = s;
|
|
2384
2292
|
} catch {
|
|
2385
2293
|
}
|
|
2386
2294
|
}
|
|
2387
|
-
throw
|
|
2295
|
+
throw n;
|
|
2388
2296
|
}
|
|
2389
2297
|
}
|
|
2390
|
-
_request(t,
|
|
2391
|
-
typeof t == "string" ? (
|
|
2392
|
-
const { transitional:
|
|
2393
|
-
|
|
2298
|
+
_request(t, o) {
|
|
2299
|
+
typeof t == "string" ? (o = o || {}, o.url = t) : o = t || {}, o = mergeConfig$1(this.defaults, o);
|
|
2300
|
+
const { transitional: n, paramsSerializer: r, headers: s } = o;
|
|
2301
|
+
n !== void 0 && validator.assertOptions(n, {
|
|
2394
2302
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
2395
2303
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
2396
2304
|
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
2397
|
-
}, !1),
|
|
2398
|
-
serialize:
|
|
2399
|
-
} : validator.assertOptions(
|
|
2305
|
+
}, !1), r != null && (utils$1.isFunction(r) ? o.paramsSerializer = {
|
|
2306
|
+
serialize: r
|
|
2307
|
+
} : validator.assertOptions(r, {
|
|
2400
2308
|
encode: validators.function,
|
|
2401
2309
|
serialize: validators.function
|
|
2402
|
-
}, !0)),
|
|
2310
|
+
}, !0)), o.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? o.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : o.allowAbsoluteUrls = !0), validator.assertOptions(o, {
|
|
2403
2311
|
baseUrl: validators.spelling("baseURL"),
|
|
2404
2312
|
withXsrfToken: validators.spelling("withXSRFToken")
|
|
2405
|
-
}, !0),
|
|
2406
|
-
let l =
|
|
2407
|
-
|
|
2408
|
-
|
|
2313
|
+
}, !0), o.method = (o.method || this.defaults.method || "get").toLowerCase();
|
|
2314
|
+
let l = s && utils$1.merge(
|
|
2315
|
+
s.common,
|
|
2316
|
+
s[o.method]
|
|
2409
2317
|
);
|
|
2410
|
-
|
|
2318
|
+
s && utils$1.forEach(
|
|
2411
2319
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2412
|
-
(
|
|
2413
|
-
delete
|
|
2320
|
+
(p) => {
|
|
2321
|
+
delete s[p];
|
|
2414
2322
|
}
|
|
2415
|
-
),
|
|
2323
|
+
), o.headers = AxiosHeaders$1.concat(l, s);
|
|
2416
2324
|
const i = [];
|
|
2417
2325
|
let u = !0;
|
|
2418
|
-
this.interceptors.request.forEach(function(
|
|
2419
|
-
typeof
|
|
2326
|
+
this.interceptors.request.forEach(function(g) {
|
|
2327
|
+
typeof g.runWhen == "function" && g.runWhen(o) === !1 || (u = u && g.synchronous, i.unshift(g.fulfilled, g.rejected));
|
|
2420
2328
|
});
|
|
2421
2329
|
const c = [];
|
|
2422
|
-
this.interceptors.response.forEach(function(
|
|
2423
|
-
c.push(
|
|
2330
|
+
this.interceptors.response.forEach(function(g) {
|
|
2331
|
+
c.push(g.fulfilled, g.rejected);
|
|
2424
2332
|
});
|
|
2425
|
-
let a,
|
|
2333
|
+
let a, d = 0, f;
|
|
2426
2334
|
if (!u) {
|
|
2427
|
-
const
|
|
2428
|
-
for (
|
|
2429
|
-
a = a.then(
|
|
2335
|
+
const p = [dispatchRequest.bind(this), void 0];
|
|
2336
|
+
for (p.unshift(...i), p.push(...c), f = p.length, a = Promise.resolve(o); d < f; )
|
|
2337
|
+
a = a.then(p[d++], p[d++]);
|
|
2430
2338
|
return a;
|
|
2431
2339
|
}
|
|
2432
|
-
|
|
2433
|
-
let
|
|
2434
|
-
for (
|
|
2435
|
-
const
|
|
2340
|
+
f = i.length;
|
|
2341
|
+
let m = o;
|
|
2342
|
+
for (d = 0; d < f; ) {
|
|
2343
|
+
const p = i[d++], g = i[d++];
|
|
2436
2344
|
try {
|
|
2437
|
-
|
|
2438
|
-
} catch (
|
|
2439
|
-
|
|
2345
|
+
m = p(m);
|
|
2346
|
+
} catch (y) {
|
|
2347
|
+
g.call(this, y);
|
|
2440
2348
|
break;
|
|
2441
2349
|
}
|
|
2442
2350
|
}
|
|
2443
2351
|
try {
|
|
2444
|
-
a = dispatchRequest.call(this,
|
|
2445
|
-
} catch (
|
|
2446
|
-
return Promise.reject(
|
|
2352
|
+
a = dispatchRequest.call(this, m);
|
|
2353
|
+
} catch (p) {
|
|
2354
|
+
return Promise.reject(p);
|
|
2447
2355
|
}
|
|
2448
|
-
for (
|
|
2449
|
-
a = a.then(c[
|
|
2356
|
+
for (d = 0, f = c.length; d < f; )
|
|
2357
|
+
a = a.then(c[d++], c[d++]);
|
|
2450
2358
|
return a;
|
|
2451
2359
|
}
|
|
2452
2360
|
getUri(t) {
|
|
2453
2361
|
t = mergeConfig$1(this.defaults, t);
|
|
2454
|
-
const
|
|
2455
|
-
return buildURL(
|
|
2362
|
+
const o = buildFullPath(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
2363
|
+
return buildURL(o, t.params, t.paramsSerializer);
|
|
2456
2364
|
}
|
|
2457
2365
|
};
|
|
2458
2366
|
utils$1.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2459
|
-
Axios$1.prototype[t] = function(
|
|
2460
|
-
return this.request(mergeConfig$1(
|
|
2367
|
+
Axios$1.prototype[t] = function(o, n) {
|
|
2368
|
+
return this.request(mergeConfig$1(n || {}, {
|
|
2461
2369
|
method: t,
|
|
2462
|
-
url:
|
|
2463
|
-
data: (
|
|
2370
|
+
url: o,
|
|
2371
|
+
data: (n || {}).data
|
|
2464
2372
|
}));
|
|
2465
2373
|
};
|
|
2466
2374
|
});
|
|
2467
2375
|
utils$1.forEach(["post", "put", "patch"], function(t) {
|
|
2468
|
-
function n
|
|
2469
|
-
return function(
|
|
2376
|
+
function o(n) {
|
|
2377
|
+
return function(s, l, i) {
|
|
2470
2378
|
return this.request(mergeConfig$1(i || {}, {
|
|
2471
2379
|
method: t,
|
|
2472
|
-
headers:
|
|
2380
|
+
headers: n ? {
|
|
2473
2381
|
"Content-Type": "multipart/form-data"
|
|
2474
2382
|
} : {},
|
|
2475
|
-
url:
|
|
2383
|
+
url: s,
|
|
2476
2384
|
data: l
|
|
2477
2385
|
}));
|
|
2478
2386
|
};
|
|
2479
2387
|
}
|
|
2480
|
-
Axios$1.prototype[t] =
|
|
2388
|
+
Axios$1.prototype[t] = o(), Axios$1.prototype[t + "Form"] = o(!0);
|
|
2481
2389
|
});
|
|
2482
|
-
let CancelToken$1 = class
|
|
2390
|
+
let CancelToken$1 = class M {
|
|
2483
2391
|
constructor(t) {
|
|
2484
2392
|
if (typeof t != "function")
|
|
2485
2393
|
throw new TypeError("executor must be a function.");
|
|
2486
|
-
let
|
|
2487
|
-
this.promise = new Promise(function(
|
|
2488
|
-
|
|
2394
|
+
let o;
|
|
2395
|
+
this.promise = new Promise(function(s) {
|
|
2396
|
+
o = s;
|
|
2489
2397
|
});
|
|
2490
|
-
const
|
|
2491
|
-
this.promise.then((
|
|
2492
|
-
if (!
|
|
2493
|
-
let
|
|
2494
|
-
for (;
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
}), this.promise.then = (
|
|
2498
|
-
let
|
|
2398
|
+
const n = this;
|
|
2399
|
+
this.promise.then((r) => {
|
|
2400
|
+
if (!n._listeners) return;
|
|
2401
|
+
let s = n._listeners.length;
|
|
2402
|
+
for (; s-- > 0; )
|
|
2403
|
+
n._listeners[s](r);
|
|
2404
|
+
n._listeners = null;
|
|
2405
|
+
}), this.promise.then = (r) => {
|
|
2406
|
+
let s;
|
|
2499
2407
|
const l = new Promise((i) => {
|
|
2500
|
-
|
|
2501
|
-
}).then(
|
|
2408
|
+
n.subscribe(i), s = i;
|
|
2409
|
+
}).then(r);
|
|
2502
2410
|
return l.cancel = function() {
|
|
2503
|
-
|
|
2411
|
+
n.unsubscribe(s);
|
|
2504
2412
|
}, l;
|
|
2505
|
-
}, t(function(
|
|
2506
|
-
|
|
2413
|
+
}, t(function(s, l, i) {
|
|
2414
|
+
n.reason || (n.reason = new CanceledError$1(s, l, i), o(n.reason));
|
|
2507
2415
|
});
|
|
2508
2416
|
}
|
|
2509
2417
|
/**
|
|
@@ -2529,14 +2437,14 @@ let CancelToken$1 = class A {
|
|
|
2529
2437
|
unsubscribe(t) {
|
|
2530
2438
|
if (!this._listeners)
|
|
2531
2439
|
return;
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2440
|
+
const o = this._listeners.indexOf(t);
|
|
2441
|
+
o !== -1 && this._listeners.splice(o, 1);
|
|
2534
2442
|
}
|
|
2535
2443
|
toAbortSignal() {
|
|
2536
|
-
const t = new AbortController(),
|
|
2537
|
-
t.abort(
|
|
2444
|
+
const t = new AbortController(), o = (n) => {
|
|
2445
|
+
t.abort(n);
|
|
2538
2446
|
};
|
|
2539
|
-
return this.subscribe(
|
|
2447
|
+
return this.subscribe(o), t.signal.unsubscribe = () => this.unsubscribe(o), t.signal;
|
|
2540
2448
|
}
|
|
2541
2449
|
/**
|
|
2542
2450
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
@@ -2545,16 +2453,16 @@ let CancelToken$1 = class A {
|
|
|
2545
2453
|
static source() {
|
|
2546
2454
|
let t;
|
|
2547
2455
|
return {
|
|
2548
|
-
token: new
|
|
2549
|
-
t =
|
|
2456
|
+
token: new M(function(r) {
|
|
2457
|
+
t = r;
|
|
2550
2458
|
}),
|
|
2551
2459
|
cancel: t
|
|
2552
2460
|
};
|
|
2553
2461
|
}
|
|
2554
2462
|
};
|
|
2555
2463
|
function spread$1(e) {
|
|
2556
|
-
return function(
|
|
2557
|
-
return e.apply(null,
|
|
2464
|
+
return function(o) {
|
|
2465
|
+
return e.apply(null, o);
|
|
2558
2466
|
};
|
|
2559
2467
|
}
|
|
2560
2468
|
function isAxiosError$1(e) {
|
|
@@ -2629,10 +2537,10 @@ Object.entries(HttpStatusCode$1).forEach(([e, t]) => {
|
|
|
2629
2537
|
HttpStatusCode$1[t] = e;
|
|
2630
2538
|
});
|
|
2631
2539
|
function createInstance(e) {
|
|
2632
|
-
const t = new Axios$1(e),
|
|
2633
|
-
return utils$1.extend(
|
|
2634
|
-
return createInstance(mergeConfig$1(e,
|
|
2635
|
-
},
|
|
2540
|
+
const t = new Axios$1(e), o = bind(Axios$1.prototype.request, t);
|
|
2541
|
+
return utils$1.extend(o, Axios$1.prototype, t, { allOwnKeys: !0 }), utils$1.extend(o, t, null, { allOwnKeys: !0 }), o.create = function(r) {
|
|
2542
|
+
return createInstance(mergeConfig$1(e, r));
|
|
2543
|
+
}, o;
|
|
2636
2544
|
}
|
|
2637
2545
|
const axios = createInstance(defaults);
|
|
2638
2546
|
axios.Axios = Axios$1;
|
|
@@ -2691,84 +2599,84 @@ const {
|
|
|
2691
2599
|
},
|
|
2692
2600
|
emits: ["update:modelValue"],
|
|
2693
2601
|
setup(e, { emit: t }) {
|
|
2694
|
-
const
|
|
2602
|
+
const o = e, n = 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 () => {
|
|
2695
2603
|
try {
|
|
2696
|
-
const { data: a } = await axios.get(`/api/suggest/${
|
|
2697
|
-
|
|
2604
|
+
const { data: a } = await axios.get(`/api/suggest/${o.data}`);
|
|
2605
|
+
r.value = a?.data || a;
|
|
2698
2606
|
} catch (a) {
|
|
2699
2607
|
console.error(a);
|
|
2700
2608
|
}
|
|
2701
2609
|
};
|
|
2702
2610
|
return watch(
|
|
2703
|
-
() =>
|
|
2611
|
+
() => o.modelValue,
|
|
2704
2612
|
(a) => {
|
|
2705
|
-
if (typeof a == "boolean" &&
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2613
|
+
if (typeof a == "boolean" && r.value.length === 1) {
|
|
2614
|
+
const d = l(r.value[0]);
|
|
2615
|
+
s[d] = a;
|
|
2708
2616
|
} else if (Array.isArray(a)) {
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2711
|
-
if (!
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2617
|
+
const d = new Set(a);
|
|
2618
|
+
r.value.forEach((f) => {
|
|
2619
|
+
if (!f.disabled) {
|
|
2620
|
+
const m = l(f);
|
|
2621
|
+
s[m] = d.has(m);
|
|
2714
2622
|
}
|
|
2715
2623
|
});
|
|
2716
2624
|
}
|
|
2717
2625
|
},
|
|
2718
2626
|
{ immediate: !0 }
|
|
2719
2627
|
), watch(
|
|
2720
|
-
|
|
2628
|
+
s,
|
|
2721
2629
|
() => {
|
|
2722
|
-
if (!
|
|
2723
|
-
|
|
2630
|
+
if (!r.value.length) {
|
|
2631
|
+
n("update:modelValue", null);
|
|
2724
2632
|
return;
|
|
2725
2633
|
}
|
|
2726
|
-
const a = Object.entries(
|
|
2727
|
-
|
|
2634
|
+
const a = Object.entries(s).filter(([, d]) => d).map(([d]) => d);
|
|
2635
|
+
n("update:modelValue", a.length === 0 ? null : a);
|
|
2728
2636
|
},
|
|
2729
2637
|
{ deep: !0 }
|
|
2730
2638
|
), onMounted(() => {
|
|
2731
|
-
if (
|
|
2639
|
+
if (o.data)
|
|
2732
2640
|
c().then(() => {
|
|
2733
|
-
if (typeof
|
|
2734
|
-
const a = l(
|
|
2735
|
-
|
|
2736
|
-
} else if (Array.isArray(
|
|
2737
|
-
const a = new Set(
|
|
2738
|
-
|
|
2739
|
-
if (!
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2641
|
+
if (typeof o.modelValue == "boolean" && r.value.length === 1) {
|
|
2642
|
+
const a = l(r.value[0]);
|
|
2643
|
+
s[a] = o.modelValue;
|
|
2644
|
+
} else if (Array.isArray(o.modelValue)) {
|
|
2645
|
+
const a = new Set(o.modelValue);
|
|
2646
|
+
r.value.forEach((d) => {
|
|
2647
|
+
if (!d.disabled) {
|
|
2648
|
+
const f = l(d);
|
|
2649
|
+
s[f] = a.has(f);
|
|
2742
2650
|
}
|
|
2743
2651
|
});
|
|
2744
2652
|
}
|
|
2745
2653
|
});
|
|
2746
|
-
else if (
|
|
2747
|
-
const a = l(
|
|
2748
|
-
|
|
2749
|
-
} else if (Array.isArray(
|
|
2750
|
-
const a = new Set(
|
|
2751
|
-
|
|
2752
|
-
if (!
|
|
2753
|
-
const
|
|
2754
|
-
|
|
2654
|
+
else if (r.value = o.options, typeof o.modelValue == "boolean" && r.value.length === 1) {
|
|
2655
|
+
const a = l(r.value[0]);
|
|
2656
|
+
s[a] = o.modelValue;
|
|
2657
|
+
} else if (Array.isArray(o.modelValue)) {
|
|
2658
|
+
const a = new Set(o.modelValue);
|
|
2659
|
+
r.value.forEach((d) => {
|
|
2660
|
+
if (!d.disabled) {
|
|
2661
|
+
const f = l(d);
|
|
2662
|
+
s[f] = a.has(f);
|
|
2755
2663
|
}
|
|
2756
2664
|
});
|
|
2757
2665
|
}
|
|
2758
|
-
}), (a,
|
|
2666
|
+
}), (a, d) => (openBlock(), createElementBlock("div", {
|
|
2759
2667
|
class: normalizeClass(["p-0 w-full gap-[6px]", [e.position === "vertical" ? "flex-col" : "", e.colSpan ? "grid" : "flex justify-start"]])
|
|
2760
2668
|
}, [
|
|
2761
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2762
|
-
modelValue:
|
|
2763
|
-
"onUpdate:modelValue": (
|
|
2764
|
-
value: l(
|
|
2669
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (f) => (openBlock(), createBlock(_sfc_main$x, {
|
|
2670
|
+
modelValue: s[l(f)],
|
|
2671
|
+
"onUpdate:modelValue": (m) => s[l(f)] = m,
|
|
2672
|
+
value: l(f),
|
|
2765
2673
|
class: normalizeClass(u(e.colSpan)),
|
|
2766
|
-
disabled:
|
|
2767
|
-
label: i(
|
|
2768
|
-
key: l(
|
|
2769
|
-
icon:
|
|
2770
|
-
imgUrl:
|
|
2771
|
-
option:
|
|
2674
|
+
disabled: f.disabled,
|
|
2675
|
+
label: i(f),
|
|
2676
|
+
key: l(f),
|
|
2677
|
+
icon: f?.icon,
|
|
2678
|
+
imgUrl: f?.imgUrl,
|
|
2679
|
+
option: f,
|
|
2772
2680
|
slots: e.slots,
|
|
2773
2681
|
view: e.view
|
|
2774
2682
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "slots", "view"]))), 128))
|
|
@@ -2799,31 +2707,237 @@ const {
|
|
|
2799
2707
|
}),
|
|
2800
2708
|
emits: ["update:modelValue"],
|
|
2801
2709
|
setup(e) {
|
|
2802
|
-
const t = e, { inputClass:
|
|
2803
|
-
return (
|
|
2710
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
2711
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("input", {
|
|
2804
2712
|
type: "date",
|
|
2805
|
-
"onUpdate:modelValue":
|
|
2713
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
2806
2714
|
placeholder: e.placeholder,
|
|
2807
2715
|
disabled: e.disabled,
|
|
2808
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(
|
|
2716
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [unref(o)]]),
|
|
2809
2717
|
style: {
|
|
2810
2718
|
border: "1px solid #CFD9E0"
|
|
2811
2719
|
}
|
|
2812
2720
|
}, null, 10, _hoisted_1$g)), [
|
|
2813
|
-
[vModelText,
|
|
2721
|
+
[vModelText, n.value]
|
|
2814
2722
|
]);
|
|
2815
2723
|
}
|
|
2816
|
-
}),
|
|
2724
|
+
}), $ = (e, t) => {
|
|
2725
|
+
const o = e.__vccOpts || e;
|
|
2726
|
+
for (const [n, r] of t)
|
|
2727
|
+
o[n] = r;
|
|
2728
|
+
return o;
|
|
2729
|
+
};
|
|
2730
|
+
defineComponent({
|
|
2731
|
+
props: {
|
|
2732
|
+
modelValue: { type: Boolean, default: () => !1 },
|
|
2733
|
+
title: { type: String, default: () => "" },
|
|
2734
|
+
disabled: { type: Boolean, default: () => !1 }
|
|
2735
|
+
},
|
|
2736
|
+
data() {
|
|
2737
|
+
return {};
|
|
2738
|
+
},
|
|
2739
|
+
mounted() {
|
|
2740
|
+
this.modelValue || this.$emit("update:modelValue", !1);
|
|
2741
|
+
},
|
|
2742
|
+
computed: {
|
|
2743
|
+
modelState: {
|
|
2744
|
+
get() {
|
|
2745
|
+
return this.modelValue;
|
|
2746
|
+
},
|
|
2747
|
+
set(e) {
|
|
2748
|
+
this.$emit("update:modelValue", e);
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
labelCursorClasses() {
|
|
2752
|
+
return [
|
|
2753
|
+
{ "cursor-not-allowed": this.disabled },
|
|
2754
|
+
{ "cursor-pointer": !this.disabled }
|
|
2755
|
+
];
|
|
2756
|
+
}
|
|
2757
|
+
},
|
|
2758
|
+
methods: {
|
|
2759
|
+
handleEnterDown(e) {
|
|
2760
|
+
const { keyCode: t } = e;
|
|
2761
|
+
t === 13 && (this.modelState = !this.modelState);
|
|
2762
|
+
},
|
|
2763
|
+
addKeyHandler() {
|
|
2764
|
+
window.addEventListener("keydown", this.handleEnterDown);
|
|
2765
|
+
},
|
|
2766
|
+
removeKeyHandler() {
|
|
2767
|
+
window.removeEventListener("keydown", this.handleEnterDown);
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
const Vt = {}, zt = {
|
|
2772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2773
|
+
fill: "none",
|
|
2774
|
+
viewBox: "0 0 24 24",
|
|
2775
|
+
"stroke-width": "1.5",
|
|
2776
|
+
stroke: "currentColor",
|
|
2777
|
+
class: "size-6 text-green-600"
|
|
2778
|
+
};
|
|
2779
|
+
function Et(e, t) {
|
|
2780
|
+
return openBlock(), createElementBlock("svg", zt, t[0] || (t[0] = [
|
|
2781
|
+
createElementVNode("path", {
|
|
2782
|
+
"stroke-linecap": "round",
|
|
2783
|
+
"stroke-linejoin": "round",
|
|
2784
|
+
d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
2785
|
+
}, null, -1)
|
|
2786
|
+
]));
|
|
2787
|
+
}
|
|
2788
|
+
const Lt = /* @__PURE__ */ $(Vt, [["render", Et]]), jt = {}, Mt = {
|
|
2789
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2790
|
+
fill: "none",
|
|
2791
|
+
viewBox: "0 0 24 24",
|
|
2792
|
+
"stroke-width": "1.5",
|
|
2793
|
+
stroke: "orange",
|
|
2794
|
+
class: "size-6 text-orange-600"
|
|
2795
|
+
};
|
|
2796
|
+
function Pt(e, t) {
|
|
2797
|
+
return openBlock(), createElementBlock("svg", Mt, t[0] || (t[0] = [
|
|
2798
|
+
createElementVNode("path", {
|
|
2799
|
+
"stroke-linecap": "round",
|
|
2800
|
+
"stroke-linejoin": "round",
|
|
2801
|
+
d: "M12 9v3m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
2802
|
+
}, null, -1)
|
|
2803
|
+
]));
|
|
2804
|
+
}
|
|
2805
|
+
const Tt = /* @__PURE__ */ $(jt, [["render", Pt]]), It = {}, Rt = {
|
|
2806
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2807
|
+
fill: "none",
|
|
2808
|
+
viewBox: "0 0 24 24",
|
|
2809
|
+
"stroke-width": "1.5",
|
|
2810
|
+
stroke: "currentColor",
|
|
2811
|
+
class: "size-6 text-blue-600"
|
|
2812
|
+
};
|
|
2813
|
+
function Ot(e, t) {
|
|
2814
|
+
return openBlock(), createElementBlock("svg", Rt, t[0] || (t[0] = [
|
|
2815
|
+
createElementVNode("path", {
|
|
2816
|
+
"stroke-linecap": "round",
|
|
2817
|
+
"stroke-linejoin": "round",
|
|
2818
|
+
d: "m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"
|
|
2819
|
+
}, null, -1)
|
|
2820
|
+
]));
|
|
2821
|
+
}
|
|
2822
|
+
const Dt = /* @__PURE__ */ $(It, [["render", Ot]]), Ht = {}, Nt = {
|
|
2823
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2824
|
+
fill: "none",
|
|
2825
|
+
viewBox: "0 0 24 24",
|
|
2826
|
+
"stroke-width": "1.5",
|
|
2827
|
+
stroke: "red",
|
|
2828
|
+
class: "size-6 text-red-600"
|
|
2829
|
+
};
|
|
2830
|
+
function At(e, t) {
|
|
2831
|
+
return openBlock(), createElementBlock("svg", Nt, t[0] || (t[0] = [
|
|
2832
|
+
createElementVNode("path", {
|
|
2833
|
+
"stroke-linecap": "round",
|
|
2834
|
+
"stroke-linejoin": "round",
|
|
2835
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2836
|
+
}, null, -1)
|
|
2837
|
+
]));
|
|
2838
|
+
}
|
|
2839
|
+
const Kt = /* @__PURE__ */ $(Ht, [["render", At]]), qt = { class: "rounded-md border border-gray-300 bg-white p-4 shadow-sm" }, Ut = { class: "flex items-start gap-4 opacity-100 scale-5 transition-all duration-300" }, Wt = { class: "flex-1" }, Gt = { class: "font-medium text-gray-900" }, Zt = { class: "mt-0.5 text-sm text-gray-700" }, le = /* @__PURE__ */ defineComponent({
|
|
2840
|
+
__name: "vs-notify",
|
|
2841
|
+
props: {
|
|
2842
|
+
type: {},
|
|
2843
|
+
title: {},
|
|
2844
|
+
message: {}
|
|
2845
|
+
},
|
|
2846
|
+
setup(e) {
|
|
2847
|
+
const t = {
|
|
2848
|
+
success: Lt,
|
|
2849
|
+
warning: Tt,
|
|
2850
|
+
error: Kt,
|
|
2851
|
+
info: Dt
|
|
2852
|
+
};
|
|
2853
|
+
return (o, n) => (openBlock(), createElementBlock("div", qt, [
|
|
2854
|
+
createElementVNode("div", Ut, [
|
|
2855
|
+
(openBlock(), createBlock(resolveDynamicComponent(t[o.type]))),
|
|
2856
|
+
createElementVNode("div", Wt, [
|
|
2857
|
+
createElementVNode("strong", Gt, toDisplayString(o.title), 1),
|
|
2858
|
+
createElementVNode("p", Zt, toDisplayString(o.message), 1)
|
|
2859
|
+
]),
|
|
2860
|
+
n[0] || (n[0] = createElementVNode("button", {
|
|
2861
|
+
class: "m-3 rounded-full p-1.5 text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-700",
|
|
2862
|
+
type: "button",
|
|
2863
|
+
"aria-label": "Dismiss notify"
|
|
2864
|
+
}, [
|
|
2865
|
+
createElementVNode("span", { class: "sr-only" }, "Dismiss popup"),
|
|
2866
|
+
createElementVNode("svg", {
|
|
2867
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2868
|
+
fill: "none",
|
|
2869
|
+
viewBox: "0 0 24 24",
|
|
2870
|
+
"stroke-width": "1.5",
|
|
2871
|
+
stroke: "currentColor",
|
|
2872
|
+
class: "size-5"
|
|
2873
|
+
}, [
|
|
2874
|
+
createElementVNode("path", {
|
|
2875
|
+
"stroke-linecap": "round",
|
|
2876
|
+
"stroke-linejoin": "round",
|
|
2877
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2878
|
+
})
|
|
2879
|
+
])
|
|
2880
|
+
], -1))
|
|
2881
|
+
])
|
|
2882
|
+
]));
|
|
2883
|
+
}
|
|
2884
|
+
});
|
|
2885
|
+
reactive({ visible: !0 });
|
|
2886
|
+
const H = {
|
|
2887
|
+
top: "top-4 left-1/2 transform -translate-x-1/2",
|
|
2888
|
+
"left-bottom": "bottom-4 left-4 transform",
|
|
2889
|
+
"right-bottom": "bottom-4 right-4 transform",
|
|
2890
|
+
bottom: "bottom-4 left-1/2 transform -translate-x-1/2"
|
|
2891
|
+
}, jo = (e) => {
|
|
2892
|
+
const {
|
|
2893
|
+
type: t = "info",
|
|
2894
|
+
title: o,
|
|
2895
|
+
message: n,
|
|
2896
|
+
position: r = "right-bottom"
|
|
2897
|
+
} = e || {};
|
|
2898
|
+
let s = document.querySelector("#notify-root");
|
|
2899
|
+
s || (s = document.createElement("div"), s.id = "notify-root", s.className = `fixed z-[100] flex flex-col gap-3 ${H[r]} p-6 max-w-md mx-auto font-sans antialiased`, document.body.appendChild(s)), s.className.includes(H[r]) || (Object.values(H).forEach((u) => {
|
|
2900
|
+
s.classList.remove(...u.split(" "));
|
|
2901
|
+
}), s.classList.add(...H[r].split(" ")));
|
|
2902
|
+
const l = document.createElement("div");
|
|
2903
|
+
s.appendChild(l);
|
|
2904
|
+
const i = createApp({
|
|
2905
|
+
render() {
|
|
2906
|
+
return h(le, {
|
|
2907
|
+
type: t,
|
|
2908
|
+
title: o,
|
|
2909
|
+
message: n,
|
|
2910
|
+
onClose: () => {
|
|
2911
|
+
i.unmount(), l.remove();
|
|
2912
|
+
}
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
i.mount(l), l.querySelector("button")?.addEventListener("click", () => {
|
|
2917
|
+
l.classList.add("opacity-0", "scale-95", "transition-all", "duration-300"), setTimeout(() => {
|
|
2918
|
+
i.unmount(), l.remove();
|
|
2919
|
+
}, 350);
|
|
2920
|
+
}), setTimeout(() => {
|
|
2921
|
+
l.classList.add("opacity-0", "scale-95", "transition-all", "duration-300"), setTimeout(() => {
|
|
2922
|
+
i.unmount(), l.remove();
|
|
2923
|
+
}, 350);
|
|
2924
|
+
}, 3500);
|
|
2925
|
+
}, fileUpload = async (e, t, o, n) => {
|
|
2817
2926
|
try {
|
|
2818
|
-
const
|
|
2819
|
-
|
|
2820
|
-
const { data:
|
|
2821
|
-
`/file/upload/uploads?id=${t || ""}&form=${
|
|
2822
|
-
|
|
2927
|
+
const r = new FormData();
|
|
2928
|
+
r.append("unique", "true"), r.append("file", e);
|
|
2929
|
+
const { data: s } = await axios.post(
|
|
2930
|
+
`/file/upload/uploads?id=${t || ""}&form=${o || ""}&table=${n || ""}`,
|
|
2931
|
+
r
|
|
2823
2932
|
);
|
|
2824
|
-
return
|
|
2825
|
-
} catch (
|
|
2826
|
-
|
|
2933
|
+
return s;
|
|
2934
|
+
} catch (r) {
|
|
2935
|
+
jo({
|
|
2936
|
+
type: "error",
|
|
2937
|
+
title: "Помилка!",
|
|
2938
|
+
message: "Сталась помилка під час завантаження файлу",
|
|
2939
|
+
position: "right-bottom"
|
|
2940
|
+
}), console.error("Сталась помилка завантаження файлу", r);
|
|
2827
2941
|
}
|
|
2828
2942
|
}, fileDelete = async (e) => {
|
|
2829
2943
|
try {
|
|
@@ -2838,8 +2952,8 @@ const {
|
|
|
2838
2952
|
headers: {
|
|
2839
2953
|
"Content-Type": "application/json"
|
|
2840
2954
|
}
|
|
2841
|
-
}),
|
|
2842
|
-
|
|
2955
|
+
}), o = t.headers["content-type"], n = new TextDecoder("utf-8").decode(t.data), r = new Blob([n], { type: o }), s = document.createElement("a");
|
|
2956
|
+
s.setAttribute("download", e), s.href = window.URL.createObjectURL(r), s.click();
|
|
2843
2957
|
} catch (t) {
|
|
2844
2958
|
console.error(t.message);
|
|
2845
2959
|
}
|
|
@@ -2872,7 +2986,7 @@ const IconPlus = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_rende
|
|
|
2872
2986
|
"stroke-linecap": "round",
|
|
2873
2987
|
"stroke-linejoin": "round"
|
|
2874
2988
|
};
|
|
2875
|
-
function _sfc_render$7(e, t, n,
|
|
2989
|
+
function _sfc_render$7(e, t, o, n, r, s) {
|
|
2876
2990
|
return openBlock(), createElementBlock("svg", _hoisted_1$e, t[0] || (t[0] = [
|
|
2877
2991
|
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)
|
|
2878
2992
|
]));
|
|
@@ -2889,7 +3003,7 @@ const iconPdf = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render
|
|
|
2889
3003
|
"stroke-linecap": "round",
|
|
2890
3004
|
"stroke-linejoin": "round"
|
|
2891
3005
|
};
|
|
2892
|
-
function _sfc_render$6(e, t, n,
|
|
3006
|
+
function _sfc_render$6(e, t, o, n, r, s) {
|
|
2893
3007
|
return openBlock(), createElementBlock("svg", _hoisted_1$d, t[0] || (t[0] = [
|
|
2894
3008
|
createElementVNode("path", {
|
|
2895
3009
|
stroke: "none",
|
|
@@ -2929,7 +3043,7 @@ const IconCsv = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render
|
|
|
2929
3043
|
"stroke-linejoin": "round",
|
|
2930
3044
|
class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
|
|
2931
3045
|
};
|
|
2932
|
-
function _sfc_render$5(e, t, n,
|
|
3046
|
+
function _sfc_render$5(e, t, o, n, r, s) {
|
|
2933
3047
|
return openBlock(), createElementBlock("svg", _hoisted_1$c, t[0] || (t[0] = [
|
|
2934
3048
|
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)
|
|
2935
3049
|
]));
|
|
@@ -2946,7 +3060,7 @@ const IconFile = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_rende
|
|
|
2946
3060
|
"stroke-linecap": "round",
|
|
2947
3061
|
"stroke-linejoin": "round"
|
|
2948
3062
|
};
|
|
2949
|
-
function _sfc_render$4(e, t, n,
|
|
3063
|
+
function _sfc_render$4(e, t, o, n, r, s) {
|
|
2950
3064
|
return openBlock(), createElementBlock("svg", _hoisted_1$b, t[0] || (t[0] = [
|
|
2951
3065
|
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)
|
|
2952
3066
|
]));
|
|
@@ -2963,7 +3077,7 @@ const IconZip = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render
|
|
|
2963
3077
|
"stroke-linecap": "round",
|
|
2964
3078
|
"stroke-linejoin": "round"
|
|
2965
3079
|
};
|
|
2966
|
-
function _sfc_render$3(e, t, n,
|
|
3080
|
+
function _sfc_render$3(e, t, o, n, r, s) {
|
|
2967
3081
|
return openBlock(), createElementBlock("svg", _hoisted_1$a, t[0] || (t[0] = [
|
|
2968
3082
|
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)
|
|
2969
3083
|
]));
|
|
@@ -2973,14 +3087,14 @@ const IconGeojson = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_re
|
|
|
2973
3087
|
const t = e?.split(".");
|
|
2974
3088
|
return t[t.length - 1];
|
|
2975
3089
|
}, fileFormatPreview = (e) => {
|
|
2976
|
-
const t = getFileType(e),
|
|
3090
|
+
const t = getFileType(e), o = {
|
|
2977
3091
|
imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
|
|
2978
3092
|
sheetsFormat: ["xls", "csv", "xlsx"],
|
|
2979
3093
|
archivesFormat: ["zip", "rar"],
|
|
2980
3094
|
textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
|
|
2981
3095
|
documentsFormat: ["pdf"]
|
|
2982
3096
|
};
|
|
2983
|
-
return
|
|
3097
|
+
return o.imageFormat.includes(t) ? "img" : o.sheetsFormat.includes(t) ? IconCsv : o.textsFormat.includes(t) ? IconGeojson : o.documentsFormat.includes(t) ? iconPdf : o.archivesFormat.includes(t) ? IconZip : IconFile;
|
|
2984
3098
|
}, _sfc_main$c = {}, _hoisted_1$9 = {
|
|
2985
3099
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2986
3100
|
width: "24",
|
|
@@ -3034,19 +3148,19 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3034
3148
|
}),
|
|
3035
3149
|
emits: ["update:value", "update:item"],
|
|
3036
3150
|
setup(e) {
|
|
3037
|
-
const t = useModel(e, "value"),
|
|
3038
|
-
return (
|
|
3039
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(
|
|
3040
|
-
src:
|
|
3151
|
+
const t = useModel(e, "value"), o = useModel(e, "item"), n = e;
|
|
3152
|
+
return (r, s) => (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
3153
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(fileFormatPreview)(o.value)), {
|
|
3154
|
+
src: o.value,
|
|
3041
3155
|
alt: "file",
|
|
3042
3156
|
class: "w-full h-full object-cover cursor-pointer",
|
|
3043
|
-
onClick:
|
|
3157
|
+
onClick: s[0] || (s[0] = (l) => unref(fileDownload)(o.value))
|
|
3044
3158
|
}, null, 8, ["src"])),
|
|
3045
3159
|
createElementVNode("div", _hoisted_2$4, [
|
|
3046
3160
|
createElementVNode("button", {
|
|
3047
3161
|
type: "button",
|
|
3048
|
-
onClick:
|
|
3049
|
-
unref(fileDelete)(
|
|
3162
|
+
onClick: s[1] || (s[1] = (l) => {
|
|
3163
|
+
unref(fileDelete)(o.value), t.value = n.multiple ? t.value?.filter((i) => i !== o.value) : "";
|
|
3050
3164
|
}),
|
|
3051
3165
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
|
|
3052
3166
|
}, [
|
|
@@ -3054,7 +3168,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3054
3168
|
]),
|
|
3055
3169
|
createElementVNode("button", {
|
|
3056
3170
|
type: "button",
|
|
3057
|
-
onClick:
|
|
3171
|
+
onClick: s[2] || (s[2] = (l) => unref(fileDownload)(o.value)),
|
|
3058
3172
|
class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
|
|
3059
3173
|
}, [
|
|
3060
3174
|
createVNode(IconDownload, { class: "w-4 h-4" })
|
|
@@ -3077,7 +3191,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3077
3191
|
}),
|
|
3078
3192
|
emits: ["update:modelValue"],
|
|
3079
3193
|
setup(e) {
|
|
3080
|
-
const t = e,
|
|
3194
|
+
const t = e, o = useModel(e, "modelValue"), n = ref(null), r = (l) => Array.isArray(o.value) && o.value[l] || "", s = async (l) => {
|
|
3081
3195
|
if (t.format) {
|
|
3082
3196
|
const c = l.target.files?.[0];
|
|
3083
3197
|
if (!c || !c.name.endsWith(t.format))
|
|
@@ -3086,32 +3200,32 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3086
3200
|
const i = l.target.files?.[0];
|
|
3087
3201
|
if (!i) return;
|
|
3088
3202
|
const u = await fileUpload(i, "1", "form", "table");
|
|
3089
|
-
|
|
3203
|
+
o.value = t.multiple ? [...o.value || [], u.result?.file_path] : u.result?.file_path;
|
|
3090
3204
|
};
|
|
3091
3205
|
return (l, i) => (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
3092
3206
|
createElementVNode("input", {
|
|
3093
3207
|
class: "hidden",
|
|
3094
3208
|
ref_key: "fileInput",
|
|
3095
|
-
ref:
|
|
3209
|
+
ref: n,
|
|
3096
3210
|
type: "file",
|
|
3097
|
-
onChange:
|
|
3211
|
+
onChange: s
|
|
3098
3212
|
}, null, 544),
|
|
3099
|
-
!l.multiple &&
|
|
3213
|
+
!l.multiple && o.value ? (openBlock(), createBlock(VsInputFileListItem, {
|
|
3100
3214
|
key: 0,
|
|
3101
|
-
item:
|
|
3102
|
-
"onUpdate:item": i[0] || (i[0] = (u) =>
|
|
3103
|
-
value:
|
|
3104
|
-
"onUpdate:value": i[1] || (i[1] = (u) =>
|
|
3215
|
+
item: o.value,
|
|
3216
|
+
"onUpdate:item": i[0] || (i[0] = (u) => o.value = u),
|
|
3217
|
+
value: o.value,
|
|
3218
|
+
"onUpdate:value": i[1] || (i[1] = (u) => o.value = u)
|
|
3105
3219
|
}, null, 8, ["item", "value"])) : l.multiple ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
3106
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3220
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.value, (u, c) => (openBlock(), createBlock(VsInputFileListItem, {
|
|
3107
3221
|
multiple: l.multiple,
|
|
3108
3222
|
key: c,
|
|
3109
|
-
value:
|
|
3110
|
-
"onUpdate:value": i[2] || (i[2] = (a) =>
|
|
3111
|
-
item:
|
|
3223
|
+
value: o.value,
|
|
3224
|
+
"onUpdate:value": i[2] || (i[2] = (a) => o.value = a),
|
|
3225
|
+
item: r(c)
|
|
3112
3226
|
}, null, 8, ["multiple", "value", "item"]))), 128)),
|
|
3113
3227
|
createElementVNode("div", {
|
|
3114
|
-
onClick: i[3] || (i[3] = (u) => !l.disabled &&
|
|
3228
|
+
onClick: i[3] || (i[3] = (u) => !l.disabled && n.value?.click()),
|
|
3115
3229
|
class: normalizeClass([
|
|
3116
3230
|
"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",
|
|
3117
3231
|
l.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
|
|
@@ -3122,7 +3236,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3122
3236
|
])) : createCommentVNode("", !0),
|
|
3123
3237
|
l.multiple ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
3124
3238
|
key: 2,
|
|
3125
|
-
onClick: i[4] || (i[4] = (u) =>
|
|
3239
|
+
onClick: i[4] || (i[4] = (u) => n.value?.click()),
|
|
3126
3240
|
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"])
|
|
3127
3241
|
}, [
|
|
3128
3242
|
createVNode(IconPlus, { class: "w-6 h-6" })
|
|
@@ -3146,27 +3260,27 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3146
3260
|
}
|
|
3147
3261
|
},
|
|
3148
3262
|
setup(e) {
|
|
3149
|
-
const t = e,
|
|
3263
|
+
const t = e, o = ref(t.isOpen);
|
|
3150
3264
|
return watch(
|
|
3151
3265
|
() => t.isOpen,
|
|
3152
|
-
(
|
|
3153
|
-
|
|
3266
|
+
(n) => {
|
|
3267
|
+
o.value = n;
|
|
3154
3268
|
}
|
|
3155
|
-
), (
|
|
3269
|
+
), (n, r) => (openBlock(), createElementBlock("div", null, [
|
|
3156
3270
|
createElementVNode("div", _hoisted_1$5, [
|
|
3157
3271
|
createElementVNode("p", _hoisted_2$2, toDisplayString(e.title), 1),
|
|
3158
|
-
createVNode(_sfc_main$
|
|
3159
|
-
modelValue:
|
|
3160
|
-
"onUpdate:modelValue":
|
|
3272
|
+
createVNode(_sfc_main$s, {
|
|
3273
|
+
modelValue: o.value,
|
|
3274
|
+
"onUpdate:modelValue": r[0] || (r[0] = (s) => o.value = s),
|
|
3161
3275
|
style: normalizeStyle(e.style)
|
|
3162
3276
|
}, null, 8, ["modelValue", "style"])
|
|
3163
3277
|
]),
|
|
3164
3278
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
3165
3279
|
default: withCtx(() => [
|
|
3166
3280
|
withDirectives(createElementVNode("div", _hoisted_3$1, [
|
|
3167
|
-
renderSlot(
|
|
3281
|
+
renderSlot(n.$slots, "default", {}, void 0, !0)
|
|
3168
3282
|
], 512), [
|
|
3169
|
-
[vShow,
|
|
3283
|
+
[vShow, o.value]
|
|
3170
3284
|
])
|
|
3171
3285
|
]),
|
|
3172
3286
|
_: 3
|
|
@@ -3190,29 +3304,29 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3190
3304
|
}
|
|
3191
3305
|
},
|
|
3192
3306
|
setup(e) {
|
|
3193
|
-
const t = e,
|
|
3307
|
+
const t = e, o = ref(t.isOpen);
|
|
3194
3308
|
return watch(
|
|
3195
3309
|
() => t.isOpen,
|
|
3196
|
-
(
|
|
3197
|
-
|
|
3310
|
+
(n) => {
|
|
3311
|
+
o.value = n;
|
|
3198
3312
|
}
|
|
3199
|
-
), (
|
|
3313
|
+
), (n, r) => (openBlock(), createElementBlock("div", null, [
|
|
3200
3314
|
createElementVNode("button", {
|
|
3201
3315
|
type: "button",
|
|
3202
|
-
onClick:
|
|
3316
|
+
onClick: r[0] || (r[0] = (s) => o.value = !o.value),
|
|
3203
3317
|
class: "flex items-center gap-2"
|
|
3204
3318
|
}, [
|
|
3205
3319
|
createVNode(unref(IconChevronDown), {
|
|
3206
|
-
class: normalizeClass(["h-4 w-4 duration-300", [
|
|
3320
|
+
class: normalizeClass(["h-4 w-4 duration-300", [o.value ? "-rotate-180" : ""]])
|
|
3207
3321
|
}, null, 8, ["class"]),
|
|
3208
3322
|
createElementVNode("span", _hoisted_1$4, toDisplayString(e.title), 1)
|
|
3209
3323
|
]),
|
|
3210
3324
|
createVNode(Transition, { name: "slide-fade" }, {
|
|
3211
3325
|
default: withCtx(() => [
|
|
3212
3326
|
withDirectives(createElementVNode("div", _hoisted_2$1, [
|
|
3213
|
-
renderSlot(
|
|
3327
|
+
renderSlot(n.$slots, "default", {}, void 0, !0)
|
|
3214
3328
|
], 512), [
|
|
3215
|
-
[vShow,
|
|
3329
|
+
[vShow, o.value]
|
|
3216
3330
|
])
|
|
3217
3331
|
]),
|
|
3218
3332
|
_: 3
|
|
@@ -3232,7 +3346,7 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3232
3346
|
}
|
|
3233
3347
|
},
|
|
3234
3348
|
setup(e) {
|
|
3235
|
-
return (t,
|
|
3349
|
+
return (t, o) => (openBlock(), createElementBlock("div", null, [
|
|
3236
3350
|
createElementVNode("div", _hoisted_1$3, [
|
|
3237
3351
|
createElementVNode("p", null, toDisplayString(e.title), 1)
|
|
3238
3352
|
]),
|
|
@@ -3307,72 +3421,72 @@ const IconDownload = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_r
|
|
|
3307
3421
|
}
|
|
3308
3422
|
},
|
|
3309
3423
|
setup(e) {
|
|
3310
|
-
const t = e,
|
|
3424
|
+
const t = e, o = inject("formValues", { default: {} }), n = inject("form"), r = computed(() => t.schema?.filter((l) => {
|
|
3311
3425
|
const i = l?.conditions;
|
|
3312
3426
|
if (!i) return !0;
|
|
3313
|
-
const u = Array.isArray(i) ? i[0] : i, c =
|
|
3427
|
+
const u = Array.isArray(i) ? i[0] : i, c = o?.value?.[u];
|
|
3314
3428
|
return isVisible(c, i);
|
|
3315
|
-
})),
|
|
3316
|
-
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(
|
|
3429
|
+
})), s = computed(() => views[t.view]);
|
|
3430
|
+
return (l, i) => e.schema?.length ? (openBlock(), createBlock(resolveDynamicComponent(s.value), {
|
|
3317
3431
|
key: 0,
|
|
3318
3432
|
title: e.title,
|
|
3319
3433
|
style: normalizeStyle(e.style)
|
|
3320
3434
|
}, {
|
|
3321
3435
|
default: withCtx(() => [
|
|
3322
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
3436
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(r.value, (u) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
3323
3437
|
key: u.name
|
|
3324
3438
|
}, { ref_for: !0 }, u, {
|
|
3325
3439
|
item: u,
|
|
3326
|
-
modelValue: unref(
|
|
3327
|
-
"onUpdate:modelValue": (c) => unref(
|
|
3440
|
+
modelValue: unref(o)[u.name],
|
|
3441
|
+
"onUpdate:modelValue": (c) => unref(o)[u.name] = c,
|
|
3328
3442
|
style: e.style,
|
|
3329
|
-
error: unref(
|
|
3443
|
+
error: unref(n)?.errors?.[u.name]
|
|
3330
3444
|
}), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3331
3445
|
]),
|
|
3332
3446
|
_: 1
|
|
3333
3447
|
}, 8, ["title", "style"])) : createCommentVNode("", !0);
|
|
3334
3448
|
}
|
|
3335
|
-
}), dynamicPosition = async (e, t,
|
|
3336
|
-
if (!t || !
|
|
3449
|
+
}), dynamicPosition = async (e, t, o, n = 10) => {
|
|
3450
|
+
if (!t || !o) return;
|
|
3337
3451
|
await nextTick();
|
|
3338
|
-
const
|
|
3339
|
-
if (!
|
|
3340
|
-
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(
|
|
3341
|
-
let
|
|
3342
|
-
const
|
|
3452
|
+
const r = await o?.getBoundingClientRect(), s = await t?.getBoundingClientRect();
|
|
3453
|
+
if (!s || !r) return;
|
|
3454
|
+
const l = await parseInt(t?.getBoundingClientRect()?.height.toString()), i = await parseInt(t?.getBoundingClientRect()?.width.toString()), u = await parseInt(o?.getBoundingClientRect()?.height.toString()), c = await parseInt(o?.getBoundingClientRect()?.width.toString()), a = await window.innerHeight, d = await window.innerWidth;
|
|
3455
|
+
let f = 0, m = 0;
|
|
3456
|
+
const p = s.bottom + n + u;
|
|
3343
3457
|
switch (e) {
|
|
3344
3458
|
case "top":
|
|
3345
|
-
|
|
3459
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, d > c + s.right + 30 ? m = s.left - r.width / 2 + s.width / 2 : m = d - 30 - c;
|
|
3346
3460
|
break;
|
|
3347
3461
|
case "bottom":
|
|
3348
|
-
a >
|
|
3462
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, m = s.left - r.width / 2 + s.width / 2;
|
|
3349
3463
|
break;
|
|
3350
3464
|
case "left":
|
|
3351
|
-
|
|
3465
|
+
f = s.top - r.height / 2 + s.height / 2, s.left - r.width - n > 0 ? m = s.left - r.width - n : m = 10;
|
|
3352
3466
|
break;
|
|
3353
3467
|
case "right":
|
|
3354
|
-
|
|
3468
|
+
f = s.top - r.height / 2 + s.height / 2, d - i > c ? m = s.right + n : m = d - 30 - c;
|
|
3355
3469
|
break;
|
|
3356
3470
|
case "top-right":
|
|
3357
|
-
|
|
3471
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, d - i > c ? m = s.right + n : m = d - 30 - c;
|
|
3358
3472
|
break;
|
|
3359
3473
|
case "top-left":
|
|
3360
|
-
|
|
3474
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, s.left - r.width - n > 0 ? m = s.left - r.width - n : m = 10;
|
|
3361
3475
|
break;
|
|
3362
3476
|
case "top-start":
|
|
3363
|
-
|
|
3477
|
+
s.top - r.height - n < 0 ? f = s.top - r.height + n + u + l : f = s.top - r.height - n, s.left > 0 ? m = s.left : m = 10;
|
|
3364
3478
|
break;
|
|
3365
3479
|
case "bottom-right":
|
|
3366
|
-
a >
|
|
3480
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, d - i > c ? m = s.left : m = d - 30 - c;
|
|
3367
3481
|
break;
|
|
3368
3482
|
case "bottom-left":
|
|
3369
|
-
a >
|
|
3483
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, s.left > 0 ? m = s.right - c : m = 10;
|
|
3370
3484
|
break;
|
|
3371
3485
|
case "bottom-start":
|
|
3372
|
-
a >
|
|
3486
|
+
a > p ? f = s.bottom + n : f = s.bottom - n - u - l, s.left > 0 ? m = s.left : m = 10;
|
|
3373
3487
|
break;
|
|
3374
3488
|
}
|
|
3375
|
-
|
|
3489
|
+
f + u > a ? f = a - u - n : f < 0 && (f = n), m + c > d ? m = d - c - n : m < 0 && (m = n), o instanceof HTMLElement && (o.style.top = `${f}px`, o.style.left = `${m}px`, o.style.position = "fixed");
|
|
3376
3490
|
}, _sfc_main$4 = {}, _hoisted_1$2 = {
|
|
3377
3491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3378
3492
|
viewBox: "0 0 24 24",
|
|
@@ -3400,7 +3514,7 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3400
3514
|
}, _hoisted_4 = { class: "absolute top-[50%] text-gray-500 translate-y-[-50%] right-[10px] pointer-events-none" }, _hoisted_5 = {
|
|
3401
3515
|
key: 0,
|
|
3402
3516
|
class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400"
|
|
3403
|
-
}, _hoisted_6 = { class: "h-[30px] shrink-0 flex items-center relative justify-center" }, _hoisted_7 = ["onClick"], _hoisted_8 = { class: "flex items-center gap-[8px] w-full" }, _hoisted_9 = { key: 2 }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3517
|
+
}, _hoisted_6 = { class: "h-[30px] shrink-0 flex items-center relative justify-center" }, _hoisted_7 = ["onClick"], _hoisted_8 = { class: "flex items-center gap-[8px] w-full" }, _hoisted_9 = { key: 2 }, _hoisted_10 = { class: "relative" }, _hoisted_11 = { class: "w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50" }, _hoisted_12 = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, _hoisted_13 = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, _hoisted_14 = { class: "p-4 mim-h-0 h-full overflow-auto" }, _hoisted_15 = { class: "vs-form__head mb-5 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3404
3518
|
__name: "vs-input-select",
|
|
3405
3519
|
props: /* @__PURE__ */ mergeModels({
|
|
3406
3520
|
placeholder: { default: "Оберіть значення" },
|
|
@@ -3414,6 +3528,9 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3414
3528
|
style: { default: () => ({}) },
|
|
3415
3529
|
disabled: { type: Boolean },
|
|
3416
3530
|
mode: {},
|
|
3531
|
+
add: {},
|
|
3532
|
+
api: {},
|
|
3533
|
+
search: { type: Boolean },
|
|
3417
3534
|
error: { default: null }
|
|
3418
3535
|
}, {
|
|
3419
3536
|
modelValue: {
|
|
@@ -3424,183 +3541,278 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3424
3541
|
}),
|
|
3425
3542
|
emits: ["update:modelValue"],
|
|
3426
3543
|
setup(e) {
|
|
3427
|
-
const t = e, { inputClass: n } = useStyle(t.style),
|
|
3428
|
-
let
|
|
3429
|
-
const y = computed(() => {
|
|
3430
|
-
if (
|
|
3431
|
-
const
|
|
3544
|
+
const t = e, o = computed(() => t.mode || (t.api || t.search ? "search" : null)), { inputClass: n } = 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([]), m = ref(""), p = ref(null);
|
|
3545
|
+
let g = null;
|
|
3546
|
+
const y = ref(!1), x = ref(null), w = ref({}), E = ref({}), C = computed(() => {
|
|
3547
|
+
if (a.value?.length) {
|
|
3548
|
+
const v = a.value?.filter((b) => b?.id !== c.value?.id);
|
|
3432
3549
|
return [
|
|
3433
|
-
|
|
3434
|
-
].concat(
|
|
3550
|
+
c.value
|
|
3551
|
+
].concat(v)?.filter((b) => b !== null);
|
|
3435
3552
|
}
|
|
3436
3553
|
return [];
|
|
3437
|
-
}),
|
|
3554
|
+
}), _ = async () => {
|
|
3438
3555
|
try {
|
|
3439
|
-
const { data:
|
|
3440
|
-
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${
|
|
3556
|
+
const { data: v } = await axios.get(
|
|
3557
|
+
`${t.host}/${t.prefix}/suggest/${t.data}?json=1&key=${m.value}`
|
|
3441
3558
|
);
|
|
3442
|
-
return
|
|
3559
|
+
return v.data;
|
|
3443
3560
|
} catch {
|
|
3444
3561
|
return [];
|
|
3445
3562
|
}
|
|
3446
|
-
},
|
|
3447
|
-
document.body.click(),
|
|
3448
|
-
},
|
|
3449
|
-
|
|
3450
|
-
},
|
|
3451
|
-
if (!
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3454
|
-
},
|
|
3455
|
-
if (!
|
|
3456
|
-
const { keyCode:
|
|
3457
|
-
if ([38, 40, 13].includes(
|
|
3458
|
-
if (
|
|
3459
|
-
|
|
3460
|
-
} else if (
|
|
3461
|
-
if (
|
|
3462
|
-
|
|
3463
|
-
} else if (
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3563
|
+
}, S = async (v) => {
|
|
3564
|
+
document.body.click(), u.value = v !== void 0 ? v : !u.value, u.value && !a.value?.length && (!t.options?.length && t.data ? a.value = await _() : 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;
|
|
3565
|
+
}, B = () => u.value ? S(!1) : null, V = (v) => {
|
|
3566
|
+
c.value = v, r.value = v.id, S(!1);
|
|
3567
|
+
}, A = (v, b) => {
|
|
3568
|
+
if (!v || !b) return;
|
|
3569
|
+
const k = v.offsetTop, N = k + v.offsetHeight, O = b.scrollTop, U = O + b.clientHeight;
|
|
3570
|
+
k < O ? Object.assign(b, { scrollTop: k - 80 }) : N > U && Object.assign(b, { scrollTop: N - b.clientHeight + 4 });
|
|
3571
|
+
}, R = (v) => {
|
|
3572
|
+
if (!u.value) return;
|
|
3573
|
+
const { keyCode: b } = v;
|
|
3574
|
+
if ([38, 40, 13].includes(b) && v.preventDefault(), b === 38) {
|
|
3575
|
+
if (d.value === 0) return;
|
|
3576
|
+
d.value -= 1, A(f.value[d.value], i.value);
|
|
3577
|
+
} else if (b === 40) {
|
|
3578
|
+
if (d.value + 1 >= C.value?.length) return;
|
|
3579
|
+
d.value += 1, A(f.value[d.value], i.value);
|
|
3580
|
+
} else if (b === 13) {
|
|
3581
|
+
const k = C.value[d.value];
|
|
3582
|
+
k && V(k);
|
|
3466
3583
|
}
|
|
3467
|
-
},
|
|
3468
|
-
if (
|
|
3469
|
-
const { keyCode:
|
|
3470
|
-
[38, 40].includes(
|
|
3471
|
-
},
|
|
3472
|
-
|
|
3473
|
-
},
|
|
3474
|
-
|
|
3584
|
+
}, D = async (v) => {
|
|
3585
|
+
if (u.value) return;
|
|
3586
|
+
const { keyCode: b } = v;
|
|
3587
|
+
[38, 40].includes(b) && (await v.preventDefault(), d.value = 0, setTimeout(() => S()));
|
|
3588
|
+
}, T = (v) => {
|
|
3589
|
+
u.value && l.value && i.value && !i.value.contains(v.target) && (u.value = !1);
|
|
3590
|
+
}, F = (v) => {
|
|
3591
|
+
v?.key === "Escape" && u.value && S(!1);
|
|
3475
3592
|
};
|
|
3476
|
-
|
|
3477
|
-
addEventListener("click",
|
|
3593
|
+
onMounted(async () => {
|
|
3594
|
+
addEventListener("click", B), addEventListener("keydown", R), addEventListener("scroll", T, !0), addEventListener("keydown", F), t.options && (a.value = t.options), r.value && !t.options?.length && t.data && (a.value = await _()), c.value = a.value?.find((v) => v?.id.toString() === r.value?.toString()) || null;
|
|
3478
3595
|
}), onUnmounted(() => {
|
|
3479
|
-
removeEventListener("click",
|
|
3480
|
-
}), watch(
|
|
3481
|
-
let
|
|
3482
|
-
(
|
|
3483
|
-
!t.options?.length && t.data ?
|
|
3596
|
+
removeEventListener("click", B), removeEventListener("keydown", R), removeEventListener("scroll", T, !0), removeEventListener("keydown", F);
|
|
3597
|
+
}), watch(m, (v) => {
|
|
3598
|
+
let b = !1;
|
|
3599
|
+
(v === "" || v.trimStart().length !== 0) && (b = !0), b && (g && clearTimeout(g), g = setTimeout(async () => {
|
|
3600
|
+
!t.options?.length && t.data ? a.value = await _() : a.value = t.options.filter((k) => k.text.toLowerCase().includes(v.toLowerCase()));
|
|
3484
3601
|
}, 200));
|
|
3485
|
-
})
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
}
|
|
3602
|
+
});
|
|
3603
|
+
async function j() {
|
|
3604
|
+
y.value = !0;
|
|
3605
|
+
const v = await fetch(`/api/template/form/${t.add.form}`).then((b) => b.json());
|
|
3606
|
+
x.value = v.schema;
|
|
3607
|
+
}
|
|
3608
|
+
async function L() {
|
|
3609
|
+
E.value.validate() || (await fetch("/api/table/" + t.add.token, {
|
|
3610
|
+
method: "POST",
|
|
3611
|
+
headers: {
|
|
3612
|
+
"Content-Type": "application/json"
|
|
3613
|
+
},
|
|
3614
|
+
body: JSON.stringify(w.value)
|
|
3615
|
+
}).then((b) => b.json()), y.value = !1);
|
|
3616
|
+
}
|
|
3617
|
+
return (v, b) => (openBlock(), createElementBlock(Fragment, null, [
|
|
3618
|
+
createElementVNode("div", {
|
|
3619
|
+
class: "relative w-full",
|
|
3620
|
+
ref_key: "select",
|
|
3621
|
+
ref: l,
|
|
3622
|
+
onClick: b[5] || (b[5] = withModifiers(() => {
|
|
3623
|
+
}, ["stop"]))
|
|
3507
3624
|
}, [
|
|
3508
|
-
|
|
3625
|
+
createElementVNode("button", {
|
|
3626
|
+
type: "button",
|
|
3627
|
+
class: normalizeClass(["block w-full flex items-center gap-[8px] pl-[16px] py-[5px] bg-white w-[calc(100%)] overflow-ellipsis", [
|
|
3628
|
+
u.value ? `ring-rind ring-2 ring-${v.style?.primaryColor || "blue"}-500` : "",
|
|
3629
|
+
c.value?.text ? "pr-[50px]" : "pr-[25px]",
|
|
3630
|
+
unref(n),
|
|
3631
|
+
v.customClass,
|
|
3632
|
+
{ "!border-red-600": v.error }
|
|
3633
|
+
]]),
|
|
3634
|
+
onKeydown: D,
|
|
3635
|
+
onClick: b[0] || (b[0] = (k) => S(!u.value)),
|
|
3636
|
+
disabled: v.disabled,
|
|
3637
|
+
style: {
|
|
3638
|
+
border: "1px solid #CFD9E0"
|
|
3639
|
+
}
|
|
3640
|
+
}, [
|
|
3641
|
+
c.value?.color ? (openBlock(), createElementBlock("span", {
|
|
3642
|
+
key: 0,
|
|
3643
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3644
|
+
style: normalizeStyle({ backgroundColor: c.value?.color })
|
|
3645
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3646
|
+
c.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(c.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(v.placeholder), 1))
|
|
3647
|
+
], 42, _hoisted_1$1),
|
|
3648
|
+
createElementVNode("span", _hoisted_4, [
|
|
3649
|
+
createVNode(unref(IconChevronTopBottom), {
|
|
3650
|
+
height: "14",
|
|
3651
|
+
width: "14"
|
|
3652
|
+
})
|
|
3653
|
+
]),
|
|
3654
|
+
c.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3509
3655
|
key: 0,
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
u.value?.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(u.value?.text), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(b.placeholder), 1))
|
|
3514
|
-
], 42, _hoisted_1$1),
|
|
3515
|
-
createElementVNode("span", _hoisted_4, [
|
|
3516
|
-
createVNode(unref(IconChevronTopBottom), {
|
|
3517
|
-
height: "14",
|
|
3518
|
-
width: "14"
|
|
3519
|
-
})
|
|
3520
|
-
]),
|
|
3521
|
-
u.value?.text ? (openBlock(), createElementBlock("button", {
|
|
3522
|
-
key: 0,
|
|
3523
|
-
type: "button",
|
|
3524
|
-
onClick: v[1] || (v[1] = ($) => {
|
|
3525
|
-
o.value = null, u.value = null;
|
|
3526
|
-
}),
|
|
3527
|
-
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3528
|
-
}, [
|
|
3529
|
-
createVNode(unref(IconClose), {
|
|
3530
|
-
height: "14",
|
|
3531
|
-
width: "14"
|
|
3532
|
-
})
|
|
3533
|
-
])) : createCommentVNode("", !0),
|
|
3534
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3535
|
-
withDirectives(createElementVNode("ul", {
|
|
3536
|
-
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",
|
|
3537
|
-
ref_key: "list",
|
|
3538
|
-
ref: l,
|
|
3539
|
-
style: normalizeStyle({
|
|
3540
|
-
width: s.value.width,
|
|
3541
|
-
maxHeight: b.maxHeight + "px",
|
|
3542
|
-
backgroundColor: "white"
|
|
3656
|
+
type: "button",
|
|
3657
|
+
onClick: b[1] || (b[1] = (k) => {
|
|
3658
|
+
r.value = null, c.value = null;
|
|
3543
3659
|
}),
|
|
3544
|
-
|
|
3545
|
-
}, ["stop"]))
|
|
3660
|
+
class: "absolute top-[50%] text-gray-500 translate-y-[-50%] hover:text-red-600 right-[30px]"
|
|
3546
3661
|
}, [
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3662
|
+
createVNode(unref(IconClose), {
|
|
3663
|
+
height: "14",
|
|
3664
|
+
width: "14"
|
|
3665
|
+
})
|
|
3666
|
+
])) : createCommentVNode("", !0),
|
|
3667
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3668
|
+
withDirectives(createElementVNode("ul", {
|
|
3669
|
+
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",
|
|
3670
|
+
ref_key: "list",
|
|
3671
|
+
ref: i,
|
|
3672
|
+
style: normalizeStyle({
|
|
3673
|
+
width: s.value.width,
|
|
3674
|
+
maxHeight: v.maxHeight + "px",
|
|
3675
|
+
backgroundColor: "white"
|
|
3676
|
+
}),
|
|
3677
|
+
onClick: b[4] || (b[4] = withModifiers(() => {
|
|
3678
|
+
}, ["stop"]))
|
|
3679
|
+
}, [
|
|
3680
|
+
o.value === "search" ? (openBlock(), createElementBlock("li", _hoisted_5, [
|
|
3681
|
+
createElementVNode("div", _hoisted_6, [
|
|
3682
|
+
withDirectives(createElementVNode("input", {
|
|
3683
|
+
"onUpdate:modelValue": b[2] || (b[2] = (k) => m.value = k),
|
|
3684
|
+
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",
|
|
3685
|
+
placeholder: "Пошук",
|
|
3686
|
+
type: "text",
|
|
3687
|
+
ref_key: "inputRef",
|
|
3688
|
+
ref: p
|
|
3689
|
+
}, null, 512), [
|
|
3690
|
+
[vModelText, m.value]
|
|
3691
|
+
]),
|
|
3692
|
+
createVNode(IconMagnifyingGlass, {
|
|
3693
|
+
width: "15px",
|
|
3694
|
+
height: "15px",
|
|
3695
|
+
class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"
|
|
3696
|
+
}),
|
|
3697
|
+
m.value != "" ? (openBlock(), createBlock(unref(IconClose), {
|
|
3698
|
+
key: 0,
|
|
3699
|
+
width: "15px",
|
|
3700
|
+
height: "15px",
|
|
3701
|
+
onClick: b[3] || (b[3] = (k) => m.value = ""),
|
|
3702
|
+
class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
|
|
3703
|
+
})) : createCommentVNode("", !0)
|
|
3704
|
+
])
|
|
3705
|
+
])) : createCommentVNode("", !0),
|
|
3706
|
+
C.value?.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3707
|
+
b[10] || (b[10] = createElementVNode("li", { class: "sticky top-[-4px] text-[12px] bg-white p-1 z-[2] px-4 text-gray-400" }, " Натисніть Enter для вибору, ↑↓ для навігації, Esc для закриття ", -1)),
|
|
3708
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(C.value, (k, N) => (openBlock(), createElementBlock("li", {
|
|
3709
|
+
onClick: (O) => V(k),
|
|
3710
|
+
key: k?.id,
|
|
3711
|
+
ref_for: !0,
|
|
3712
|
+
ref: (O) => f.value[N] = O,
|
|
3713
|
+
class: normalizeClass(["cursor-pointer relative py-2 px-4 w-full text-[14px] text-gray-700 hover:bg-gray-100 rounded-lg", [d.value == N ? "bg-gray-100" : ""]])
|
|
3714
|
+
}, [
|
|
3715
|
+
createElementVNode("span", _hoisted_8, [
|
|
3716
|
+
k?.color ? (openBlock(), createElementBlock("span", {
|
|
3717
|
+
key: 0,
|
|
3718
|
+
class: "w-[16px] h-[16px] rounded-md block",
|
|
3719
|
+
style: normalizeStyle({ backgroundColor: k?.color })
|
|
3720
|
+
}, null, 4)) : createCommentVNode("", !0),
|
|
3721
|
+
createTextVNode(" " + toDisplayString(k?.text), 1)
|
|
3722
|
+
]),
|
|
3723
|
+
r.value == k?.id ? (openBlock(), createBlock(unref(IconCheck), {
|
|
3584
3724
|
key: 0,
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3725
|
+
height: "14",
|
|
3726
|
+
width: "14",
|
|
3727
|
+
"stroke-width": "2",
|
|
3728
|
+
class: "absolute right-[16px] top-[50%] translate-y-[-50%] text-blue-600"
|
|
3729
|
+
})) : createCommentVNode("", !0)
|
|
3730
|
+
], 10, _hoisted_7))), 128))
|
|
3731
|
+
], 64)) : (openBlock(), createElementBlock("li", _hoisted_9, "Дані відсутні"))
|
|
3732
|
+
], 4), [
|
|
3733
|
+
[vShow, u.value]
|
|
3734
|
+
])
|
|
3735
|
+
]))
|
|
3736
|
+
], 512),
|
|
3737
|
+
t.add ? (openBlock(), createElementBlock("button", {
|
|
3738
|
+
key: 0,
|
|
3739
|
+
onClick: j,
|
|
3740
|
+
class: "ml-auto bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10px] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40px] gap-[8px] flex items-center"
|
|
3741
|
+
}, b[11] || (b[11] = [
|
|
3742
|
+
createElementVNode("svg", {
|
|
3743
|
+
class: "vpbnr cp61q",
|
|
3744
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3745
|
+
width: "16",
|
|
3746
|
+
height: "16",
|
|
3747
|
+
fill: "currentColor",
|
|
3748
|
+
viewBox: "0 0 16 16"
|
|
3749
|
+
}, [
|
|
3750
|
+
createElementVNode("path", {
|
|
3751
|
+
"fill-rule": "evenodd",
|
|
3752
|
+
"clip-rule": "evenodd",
|
|
3753
|
+
d: "M8 1C8.55228 1 9 1.44772 9 2V7L14 7C14.5523 7 15 7.44771 15 8C15 8.55228 14.5523 9 14 9L9 9V14C9 14.5523 8.55228 15 8 15C7.44772 15 7 14.5523 7 14V9.00001L2 9.00001C1.44772 9.00001 1 8.5523 1 8.00001C0.999999 7.44773 1.44771 7.00001 2 7.00001L7 7.00001V2C7 1.44772 7.44772 1 8 1Z"
|
|
3754
|
+
})
|
|
3755
|
+
], -1),
|
|
3756
|
+
createElementVNode("span", null, "Додати", -1)
|
|
3757
|
+
]))) : createCommentVNode("", !0),
|
|
3758
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
3759
|
+
withDirectives(createElementVNode("div", _hoisted_10, [
|
|
3760
|
+
createElementVNode("div", _hoisted_11, [
|
|
3761
|
+
createElementVNode("div", _hoisted_12, [
|
|
3762
|
+
createElementVNode("div", _hoisted_13, [
|
|
3763
|
+
b[13] || (b[13] = createElementVNode("h3", { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, "Додати", -1)),
|
|
3764
|
+
createElementVNode("button", {
|
|
3765
|
+
onClick: b[6] || (b[6] = (k) => y.value = !1),
|
|
3766
|
+
type: "button",
|
|
3767
|
+
class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
|
|
3768
|
+
}, b[12] || (b[12] = [
|
|
3769
|
+
createElementVNode("span", { class: "sr-only" }, "Close", -1),
|
|
3770
|
+
createElementVNode("svg", {
|
|
3771
|
+
class: "flex-shrink-0 w-4 h-4",
|
|
3772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3773
|
+
width: "24",
|
|
3774
|
+
height: "24",
|
|
3775
|
+
viewBox: "0 0 24 24",
|
|
3776
|
+
fill: "none",
|
|
3777
|
+
stroke: "currentColor",
|
|
3778
|
+
"stroke-width": "2",
|
|
3779
|
+
"stroke-linecap": "round",
|
|
3780
|
+
"stroke-linejoin": "round"
|
|
3781
|
+
}, [
|
|
3782
|
+
createElementVNode("path", { d: "M18 6 6 18" }),
|
|
3783
|
+
createElementVNode("path", { d: "m6 6 12 12" })
|
|
3784
|
+
], -1)
|
|
3785
|
+
]))
|
|
3589
3786
|
]),
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3787
|
+
createElementVNode("div", _hoisted_14, [
|
|
3788
|
+
x.value ? (openBlock(), createBlock(_sfc_main, {
|
|
3789
|
+
key: 0,
|
|
3790
|
+
schema: x.value,
|
|
3791
|
+
values: w.value,
|
|
3792
|
+
"onUpdate:values": b[7] || (b[7] = (k) => w.value = k),
|
|
3793
|
+
form: E.value,
|
|
3794
|
+
"onUpdate:form": b[8] || (b[8] = (k) => E.value = k)
|
|
3795
|
+
}, null, 8, ["schema", "values", "form"])) : createCommentVNode("", !0),
|
|
3796
|
+
createElementVNode("div", _hoisted_15, [
|
|
3797
|
+
createElementVNode("button", {
|
|
3798
|
+
type: "button",
|
|
3799
|
+
onClick: b[9] || (b[9] = (k) => y.value = !1),
|
|
3800
|
+
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
|
|
3801
|
+
}, " Скасувати "),
|
|
3802
|
+
createElementVNode("button", {
|
|
3803
|
+
onClick: L,
|
|
3804
|
+
type: "button",
|
|
3805
|
+
class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
|
|
3806
|
+
}, " Зберегти ")
|
|
3807
|
+
])
|
|
3808
|
+
])
|
|
3809
|
+
])
|
|
3810
|
+
])
|
|
3811
|
+
], 512), [
|
|
3812
|
+
[vShow, y.value]
|
|
3601
3813
|
])
|
|
3602
3814
|
]))
|
|
3603
|
-
],
|
|
3815
|
+
], 64));
|
|
3604
3816
|
}
|
|
3605
3817
|
}), _hoisted_1 = ["placeholder", "disabled"], _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3606
3818
|
__name: "vs-input-textarea",
|
|
@@ -3627,36 +3839,37 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3627
3839
|
}),
|
|
3628
3840
|
emits: ["update:modelValue"],
|
|
3629
3841
|
setup(e) {
|
|
3630
|
-
const t = e, { inputClass:
|
|
3631
|
-
return (
|
|
3632
|
-
"onUpdate:modelValue":
|
|
3842
|
+
const t = e, { inputClass: o } = useStyle(t.style), n = useModel(e, "modelValue");
|
|
3843
|
+
return (r, s) => withDirectives((openBlock(), createElementBlock("textarea", {
|
|
3844
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
|
|
3633
3845
|
placeholder: e.placeholder,
|
|
3634
3846
|
disabled: e.disabled,
|
|
3635
3847
|
row: "2",
|
|
3636
|
-
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [unref(
|
|
3848
|
+
class: normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [unref(o)]]),
|
|
3637
3849
|
style: {
|
|
3638
3850
|
border: "1px solid #CFD9E0"
|
|
3639
3851
|
}
|
|
3640
3852
|
}, null, 10, _hoisted_1)), [
|
|
3641
|
-
[vModelText,
|
|
3853
|
+
[vModelText, n.value]
|
|
3642
3854
|
]);
|
|
3643
3855
|
}
|
|
3644
3856
|
}), inputs = {
|
|
3645
|
-
VsInputText: _sfc_main$
|
|
3857
|
+
VsInputText: _sfc_main$C,
|
|
3646
3858
|
VsInputRadio: _sfc_main$l,
|
|
3647
|
-
"vs-input-text": _sfc_main$
|
|
3859
|
+
"vs-input-text": _sfc_main$C,
|
|
3648
3860
|
"vs-input-textarea": _sfc_main$2,
|
|
3649
|
-
"vs-input-mask": _sfc_main$
|
|
3650
|
-
"vs-input-number": _sfc_main$
|
|
3861
|
+
"vs-input-mask": _sfc_main$q,
|
|
3862
|
+
"vs-input-number": _sfc_main$B,
|
|
3651
3863
|
"vs-input-radio": _sfc_main$l,
|
|
3652
3864
|
"vs-input-select": _sfc_main$3,
|
|
3653
|
-
"vs-input-switcher": _sfc_main$
|
|
3654
|
-
"vs-input-static": _sfc_main$
|
|
3865
|
+
"vs-input-switcher": _sfc_main$s,
|
|
3866
|
+
"vs-input-static": _sfc_main$r,
|
|
3655
3867
|
"vs-input-container": _sfc_main$5,
|
|
3656
3868
|
"vs-input-date": _sfc_main$j,
|
|
3657
3869
|
"vs-input-checkbox": VsInputCheckbox,
|
|
3658
3870
|
"vs-input-file": _sfc_main$9,
|
|
3659
|
-
"vs-input-html": _sfc_main$
|
|
3871
|
+
"vs-input-html": _sfc_main$p,
|
|
3872
|
+
"vs-input-email": _sfc_main$o
|
|
3660
3873
|
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3661
3874
|
__name: "vs-compact-form-layout",
|
|
3662
3875
|
props: {
|
|
@@ -3678,13 +3891,13 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3678
3891
|
}
|
|
3679
3892
|
},
|
|
3680
3893
|
setup(e) {
|
|
3681
|
-
const t = e,
|
|
3682
|
-
return (
|
|
3894
|
+
const t = e, o = computed(() => layouts$1[`${t.layout}`]), n = computed(() => inputs?.[`vs-input-${t.type}`]);
|
|
3895
|
+
return (r, s) => (openBlock(), createBlock(resolveDynamicComponent(o.value), mergeProps(r.$attrs, {
|
|
3683
3896
|
style: e.style,
|
|
3684
3897
|
item: e.item
|
|
3685
3898
|
}), {
|
|
3686
3899
|
default: withCtx(() => [
|
|
3687
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
3900
|
+
(openBlock(), createBlock(resolveDynamicComponent(n.value), mergeProps(r.$attrs, { style: e.style }), null, 16, ["style"]))
|
|
3688
3901
|
]),
|
|
3689
3902
|
_: 1
|
|
3690
3903
|
}, 16, ["style", "item"]));
|
|
@@ -3711,9 +3924,10 @@ const IconMagnifyingGlass = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render",
|
|
|
3711
3924
|
}, mathTable = {
|
|
3712
3925
|
autocomplete: "select",
|
|
3713
3926
|
combobox: "select",
|
|
3714
|
-
email: "text",
|
|
3715
3927
|
datepicker: "date",
|
|
3716
|
-
markedtext: "
|
|
3928
|
+
markedtext: "mask",
|
|
3929
|
+
html: "static",
|
|
3930
|
+
filelist: "file"
|
|
3717
3931
|
// mask: 'text',
|
|
3718
3932
|
};
|
|
3719
3933
|
function convertType(e) {
|
|
@@ -3723,43 +3937,43 @@ function convertType(e) {
|
|
|
3723
3937
|
function convertSchema(e) {
|
|
3724
3938
|
if (Array.isArray(e)) return e;
|
|
3725
3939
|
const t = [];
|
|
3726
|
-
return Object.entries(e).forEach((
|
|
3727
|
-
const
|
|
3728
|
-
name:
|
|
3729
|
-
...
|
|
3730
|
-
type: convertType(
|
|
3731
|
-
label:
|
|
3732
|
-
rules:
|
|
3940
|
+
return Object.entries(e).forEach((o) => {
|
|
3941
|
+
const n = {
|
|
3942
|
+
name: o[0],
|
|
3943
|
+
...o[1],
|
|
3944
|
+
type: convertType(o[1].type),
|
|
3945
|
+
label: o[1].label || o[1].ua,
|
|
3946
|
+
rules: o[1].rules || o[1].validators
|
|
3733
3947
|
};
|
|
3734
|
-
n[1].data && (
|
|
3948
|
+
o[1].type.includes("list") && (n.multiple = !0), o[1].data && (n.api = `/api/suggest/${o[1].data}`), t.push(n);
|
|
3735
3949
|
}), t;
|
|
3736
3950
|
}
|
|
3737
3951
|
function useForm(e, t) {
|
|
3738
|
-
const
|
|
3739
|
-
function
|
|
3952
|
+
const o = convertSchema(t), n = ref({});
|
|
3953
|
+
function r(u) {
|
|
3740
3954
|
const c = u?.conditions;
|
|
3741
3955
|
if (!c) return !0;
|
|
3742
|
-
const a = Array.isArray(c) ? c[0] : c,
|
|
3743
|
-
return isVisible(
|
|
3956
|
+
const a = Array.isArray(c) ? c[0] : c, d = e?.value?.[a];
|
|
3957
|
+
return isVisible(d, c);
|
|
3744
3958
|
}
|
|
3745
|
-
const
|
|
3959
|
+
const s = (u = o, c = !0) => (u.forEach((a) => {
|
|
3746
3960
|
if (a.rules) {
|
|
3747
|
-
if (!
|
|
3748
|
-
console.log(a.name, "skip hidden"), delete
|
|
3961
|
+
if (!r(a)) {
|
|
3962
|
+
console.log(a.name, "skip hidden"), delete n.value[a.name];
|
|
3749
3963
|
return;
|
|
3750
3964
|
}
|
|
3751
|
-
a.rules.forEach((
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3965
|
+
a.rules.forEach((d) => {
|
|
3966
|
+
const f = checkFormRules(e.value[a.name], d);
|
|
3967
|
+
f ? n.value[a.name] = f : delete n.value[a.name];
|
|
3754
3968
|
});
|
|
3755
3969
|
}
|
|
3756
|
-
a.schema &&
|
|
3757
|
-
}), c && Object.values(
|
|
3970
|
+
a.schema && s(a.schema, !1);
|
|
3971
|
+
}), c && Object.values(n.value).some(Boolean) ? n.value : null), l = computed(() => o?.filter((u) => r(u)));
|
|
3758
3972
|
return {
|
|
3759
|
-
errors:
|
|
3760
|
-
validate:
|
|
3973
|
+
errors: n,
|
|
3974
|
+
validate: s,
|
|
3761
3975
|
reset: () => {
|
|
3762
|
-
e.value = {},
|
|
3976
|
+
e.value = {}, n.value = {};
|
|
3763
3977
|
},
|
|
3764
3978
|
visibleSchema: l
|
|
3765
3979
|
};
|
|
@@ -3778,30 +3992,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3778
3992
|
}),
|
|
3779
3993
|
emits: /* @__PURE__ */ mergeModels(["handle-submit"], ["update:form", "update:values"]),
|
|
3780
3994
|
setup(e, { emit: t }) {
|
|
3781
|
-
const
|
|
3995
|
+
const o = t, n = e, r = useAttrs(), s = useModel(e, "form"), l = useModel(e, "values"), {
|
|
3782
3996
|
errors: i,
|
|
3783
3997
|
validate: u,
|
|
3784
3998
|
reset: c,
|
|
3785
3999
|
visibleSchema: a
|
|
3786
|
-
} = useForm(l,
|
|
3787
|
-
u(),
|
|
4000
|
+
} = useForm(l, n.schema), d = () => {
|
|
4001
|
+
u(), o("handle-submit", l.value);
|
|
3788
4002
|
};
|
|
3789
4003
|
return onMounted(() => {
|
|
3790
|
-
|
|
3791
|
-
}), provide("form",
|
|
3792
|
-
onSubmit: withModifiers(
|
|
3793
|
-
class: normalizeClass(["grid grid-cols-12",
|
|
4004
|
+
s.value.value = l.value, s.value.errors = i.value, s.value.reset = c, s.value.validate = u;
|
|
4005
|
+
}), provide("form", s), provide("values", l), (f, m) => (openBlock(), createElementBlock("form", {
|
|
4006
|
+
onSubmit: withModifiers(d, ["prevent"]),
|
|
4007
|
+
class: normalizeClass(["grid grid-cols-12", f.layout === "default" ? "gap-6" : "gap-4"])
|
|
3794
4008
|
}, [
|
|
3795
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (
|
|
3796
|
-
key:
|
|
3797
|
-
class:
|
|
3798
|
-
}, { ref_for: !0 }, { ...unref(
|
|
3799
|
-
item:
|
|
3800
|
-
layout:
|
|
3801
|
-
modelValue: l.value[
|
|
3802
|
-
"onUpdate:modelValue": (
|
|
3803
|
-
style:
|
|
3804
|
-
error: unref(i)[
|
|
4009
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
4010
|
+
key: p.name,
|
|
4011
|
+
class: f.layout === "horizontal" ? "col-span-12" : `col-span-${p.col || 12} `
|
|
4012
|
+
}, { ref_for: !0 }, { ...unref(r), ...f.style, ...p }, {
|
|
4013
|
+
item: p,
|
|
4014
|
+
layout: f.layout,
|
|
4015
|
+
modelValue: l.value[p.name],
|
|
4016
|
+
"onUpdate:modelValue": (g) => l.value[p.name] = g,
|
|
4017
|
+
style: f.style,
|
|
4018
|
+
error: unref(i)[p.name]
|
|
3805
4019
|
}), null, 16, ["class", "item", "layout", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
|
|
3806
4020
|
], 34));
|
|
3807
4021
|
}
|
|
@@ -3811,6 +4025,6 @@ _sfc_main.install = function e(t) {
|
|
|
3811
4025
|
};
|
|
3812
4026
|
export {
|
|
3813
4027
|
_sfc_main as VForm,
|
|
3814
|
-
_sfc_main$
|
|
4028
|
+
_sfc_main$C as VsInputText,
|
|
3815
4029
|
_sfc_main as default
|
|
3816
4030
|
};
|