@noxickon/onyx 0.0.3 → 0.0.4-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/Button-D-v4l8ZE.js +20 -0
- package/dist/chunks/{Button-BV4_pmoH.js → Button-bARrxYyo.js} +120 -121
- package/dist/chunks/Input-CLi1H63d.js +1 -0
- package/dist/chunks/{Input-BraK4lDE.js → Input-dfvmdIHi.js} +38 -38
- package/dist/chunks/errorHelper--G-SWQzN.js +18 -0
- package/dist/chunks/errorHelper-DaP_XxEx.js +1 -0
- package/dist/chunks/formatTimestamp-CMxOnPo1.js +12 -0
- package/dist/chunks/formatTimestamp-TTsNcy7u.js +1 -0
- package/dist/chunks/{index-DnVdNmco.js → useAuth-DDRXztKj.js} +240 -178
- package/dist/chunks/{index-DGjVEo0G.js → useAuth-DPnpY3XC.js} +18 -9
- package/dist/chunks/{useForm-BAbY8X4X.js → useForm-D4co95Vn.js} +785 -801
- package/dist/chunks/useForm-DUviJ7xS.js +18 -0
- package/dist/chunks/useQuery-BvCyJMae.js +2065 -0
- package/dist/chunks/useQuery-DTNHO7so.js +3 -0
- package/dist/context/context.cjs.js +1 -1
- package/dist/context/context.es.js +1 -1
- package/dist/context.d.ts +1 -0
- package/dist/hooks/hooks.cjs.js +6 -6
- package/dist/hooks/hooks.es.js +117 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/layout/layout.cjs.js +1 -1
- package/dist/layout/layout.es.js +1 -1
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +425 -386
- package/dist/pages/pages.cjs.js +9 -3
- package/dist/pages/pages.es.js +35 -25
- package/dist/utils/utils.cjs.js +1 -0
- package/dist/utils/utils.es.js +8 -0
- package/dist/utils.d.ts +29 -0
- package/package.json +31 -26
- package/dist/chunks/Button-CU-zvMVL.js +0 -20
- package/dist/chunks/Input-C5dK8VSu.js +0 -1
- package/dist/chunks/index-Dgwp7JKP.js +0 -601
- package/dist/chunks/index-rUH_mzKt.js +0 -2
- package/dist/chunks/useAuth-BwjRd05B.js +0 -10
- package/dist/chunks/useAuth-CR3bAGqp.js +0 -61
- package/dist/chunks/useForm-cxgyAiOs.js +0 -26
- package/dist/chunks/useQuery--6GP2-dN.js +0 -2
- package/dist/chunks/useQuery-mFRa2XuW.js +0 -1481
package/dist/hooks/hooks.es.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { a as ut, b as De, i as lt } from "../chunks/useForm-
|
|
2
|
-
import { h as
|
|
1
|
+
import { a as ut, b as De, i as lt } from "../chunks/useForm-D4co95Vn.js";
|
|
2
|
+
import { h as Or, u as Tr } from "../chunks/useForm-D4co95Vn.js";
|
|
3
3
|
import { useState as ft, useRef as dt, useCallback as Z } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-mFRa2XuW.js";
|
|
4
|
+
import { r as D, m as ge, _, a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-BvCyJMae.js";
|
|
6
5
|
var bt = [
|
|
7
6
|
"refetch",
|
|
8
7
|
"reobserve",
|
|
@@ -13,28 +12,28 @@ var bt = [
|
|
|
13
12
|
"subscribeToMore"
|
|
14
13
|
];
|
|
15
14
|
function wt(e, t) {
|
|
16
|
-
var n, r = D.useRef(void 0), s = D.useRef(void 0), o = D.useRef(void 0), i = ge(t, r.current || {}), c = (n = i
|
|
15
|
+
var n, r = D.useRef(void 0), s = D.useRef(void 0), o = D.useRef(void 0), i = ge(t, r.current || {}), c = (n = i?.query) !== null && n !== void 0 ? n : e;
|
|
17
16
|
s.current = t, o.current = c;
|
|
18
|
-
var f =
|
|
17
|
+
var f = _(_({}, i), { skip: !r.current }), u = pt(c, f), l = u.obsQueryFields, d = u.result, w = u.client, g = u.resultData, p = u.observable, m = u.onQueryExecuted, h = p.options.initialFetchPolicy || ht(f.defaultOptions, w.defaultOptions), R = D.useReducer(function(x) {
|
|
19
18
|
return x + 1;
|
|
20
19
|
}, 0)[1], E = D.useMemo(function() {
|
|
21
|
-
for (var x = {},
|
|
20
|
+
for (var x = {}, N = function(Ee) {
|
|
22
21
|
var ct = l[Ee];
|
|
23
22
|
x[Ee] = function() {
|
|
24
23
|
return r.current || (r.current = /* @__PURE__ */ Object.create(null), R()), ct.apply(this, arguments);
|
|
25
24
|
};
|
|
26
25
|
}, M = 0, K = bt; M < K.length; M++) {
|
|
27
26
|
var at = K[M];
|
|
28
|
-
|
|
27
|
+
N(at);
|
|
29
28
|
}
|
|
30
29
|
return x;
|
|
31
30
|
}, [R, l]), b = !!r.current, T = D.useMemo(function() {
|
|
32
|
-
return
|
|
31
|
+
return _(_(_({}, d), E), { called: b });
|
|
33
32
|
}, [d, E, b]), S = D.useCallback(function(x) {
|
|
34
|
-
r.current = x ?
|
|
33
|
+
r.current = x ? _(_({}, x), { fetchPolicy: x.fetchPolicy || h }) : {
|
|
35
34
|
fetchPolicy: h
|
|
36
35
|
};
|
|
37
|
-
var
|
|
36
|
+
var N = ge(s.current, _({ query: o.current }, r.current)), M = Et(g, p, w, c, _(_({}, N), { skip: !1 }), m).then(function(K) {
|
|
38
37
|
return Object.assign(K, E);
|
|
39
38
|
});
|
|
40
39
|
return M.catch(function() {
|
|
@@ -51,12 +50,12 @@ function wt(e, t) {
|
|
|
51
50
|
ut(function() {
|
|
52
51
|
A.current = S;
|
|
53
52
|
});
|
|
54
|
-
var
|
|
55
|
-
for (var x = [],
|
|
56
|
-
x[
|
|
53
|
+
var k = D.useCallback(function() {
|
|
54
|
+
for (var x = [], N = 0; N < arguments.length; N++)
|
|
55
|
+
x[N] = arguments[N];
|
|
57
56
|
return A.current.apply(A, x);
|
|
58
57
|
}, []);
|
|
59
|
-
return [
|
|
58
|
+
return [k, T];
|
|
60
59
|
}
|
|
61
60
|
function Et(e, t, n, r, s, o) {
|
|
62
61
|
var i = s.query || r, c = mt(n, i, s, !1)(t), f = t.reobserveAsConcast(yt(t, n, s, c));
|
|
@@ -75,7 +74,7 @@ function Et(e, t, n, r, s, o) {
|
|
|
75
74
|
});
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
|
-
const
|
|
77
|
+
const er = (e, t) => {
|
|
79
78
|
const n = (r) => e(r);
|
|
80
79
|
return Object.defineProperty(n, "message", { value: t }), n;
|
|
81
80
|
};
|
|
@@ -87,11 +86,11 @@ function Be(e, t) {
|
|
|
87
86
|
const { toString: gt } = Object.prototype, { getPrototypeOf: ye } = Object, { iterator: te, toStringTag: je } = Symbol, ne = /* @__PURE__ */ ((e) => (t) => {
|
|
88
87
|
const n = gt.call(t);
|
|
89
88
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
90
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
89
|
+
})(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), re = (e) => (t) => typeof t === e, { isArray: I } = Array, z = re("undefined");
|
|
91
90
|
function $(e) {
|
|
92
91
|
return e !== null && !z(e) && e.constructor !== null && !z(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
93
92
|
}
|
|
94
|
-
const qe =
|
|
93
|
+
const qe = U("ArrayBuffer");
|
|
95
94
|
function Rt(e) {
|
|
96
95
|
let t;
|
|
97
96
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qe(e.buffer), t;
|
|
@@ -109,11 +108,11 @@ const St = re("string"), P = re("function"), Me = re("number"), J = (e) => e !==
|
|
|
109
108
|
} catch {
|
|
110
109
|
return !1;
|
|
111
110
|
}
|
|
112
|
-
}, At =
|
|
111
|
+
}, At = U("Date"), xt = U("File"), Ct = U("Blob"), Pt = U("FileList"), Ft = (e) => J(e) && P(e.pipe), Nt = (e) => {
|
|
113
112
|
let t;
|
|
114
113
|
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
|
|
115
114
|
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
|
|
116
|
-
},
|
|
115
|
+
}, Ut = U("URLSearchParams"), [_t, Lt, kt, Dt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
117
116
|
function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
118
117
|
if (e === null || typeof e > "u")
|
|
119
118
|
return;
|
|
@@ -193,12 +192,12 @@ const jt = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (s, o) => {
|
|
|
193
192
|
for (; (n = e.exec(t)) !== null; )
|
|
194
193
|
r.push(n);
|
|
195
194
|
return r;
|
|
196
|
-
}, Vt =
|
|
195
|
+
}, Vt = U("HTMLFormElement"), Wt = (e) => e.toLowerCase().replace(
|
|
197
196
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
198
197
|
function(n, r, s) {
|
|
199
198
|
return r.toUpperCase() + s;
|
|
200
199
|
}
|
|
201
|
-
), Se = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Kt =
|
|
200
|
+
), Se = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Kt = U("RegExp"), He = (e, t) => {
|
|
202
201
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
203
202
|
V(n, (s, o) => {
|
|
204
203
|
let i;
|
|
@@ -250,7 +249,7 @@ const en = (e) => {
|
|
|
250
249
|
return r;
|
|
251
250
|
};
|
|
252
251
|
return n(e, 0);
|
|
253
|
-
}, tn =
|
|
252
|
+
}, tn = U("AsyncFunction"), nn = (e) => e && (J(e) || P(e)) && P(e.then) && P(e.catch), ze = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
|
|
254
253
|
s === B && o === n && r.length && r.shift()();
|
|
255
254
|
}, !1), (s) => {
|
|
256
255
|
r.push(s), B.postMessage(n, "*");
|
|
@@ -261,7 +260,7 @@ const en = (e) => {
|
|
|
261
260
|
isArray: I,
|
|
262
261
|
isArrayBuffer: qe,
|
|
263
262
|
isBuffer: $,
|
|
264
|
-
isFormData:
|
|
263
|
+
isFormData: Nt,
|
|
265
264
|
isArrayBufferView: Rt,
|
|
266
265
|
isString: St,
|
|
267
266
|
isNumber: Me,
|
|
@@ -269,9 +268,9 @@ const en = (e) => {
|
|
|
269
268
|
isObject: J,
|
|
270
269
|
isPlainObject: Q,
|
|
271
270
|
isEmptyObject: Tt,
|
|
272
|
-
isReadableStream:
|
|
273
|
-
isRequest:
|
|
274
|
-
isResponse:
|
|
271
|
+
isReadableStream: _t,
|
|
272
|
+
isRequest: Lt,
|
|
273
|
+
isResponse: kt,
|
|
275
274
|
isHeaders: Dt,
|
|
276
275
|
isUndefined: z,
|
|
277
276
|
isDate: At,
|
|
@@ -279,8 +278,8 @@ const en = (e) => {
|
|
|
279
278
|
isBlob: Ct,
|
|
280
279
|
isRegExp: Kt,
|
|
281
280
|
isFunction: P,
|
|
282
|
-
isStream:
|
|
283
|
-
isURLSearchParams:
|
|
281
|
+
isStream: Ft,
|
|
282
|
+
isURLSearchParams: Ut,
|
|
284
283
|
isTypedArray: zt,
|
|
285
284
|
isFileList: Pt,
|
|
286
285
|
forEach: V,
|
|
@@ -291,7 +290,7 @@ const en = (e) => {
|
|
|
291
290
|
inherits: Mt,
|
|
292
291
|
toFlatObject: It,
|
|
293
292
|
kindOf: ne,
|
|
294
|
-
kindOfTest:
|
|
293
|
+
kindOfTest: U,
|
|
295
294
|
endsWith: vt,
|
|
296
295
|
toArray: Ht,
|
|
297
296
|
forEachEntry: $t,
|
|
@@ -751,7 +750,7 @@ function Cn(e, t) {
|
|
|
751
750
|
});
|
|
752
751
|
});
|
|
753
752
|
}
|
|
754
|
-
let
|
|
753
|
+
let F = class {
|
|
755
754
|
constructor(t) {
|
|
756
755
|
t && this.set(t);
|
|
757
756
|
}
|
|
@@ -877,8 +876,8 @@ let N = class {
|
|
|
877
876
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
878
877
|
}
|
|
879
878
|
};
|
|
880
|
-
|
|
881
|
-
a.reduceDescriptors(
|
|
879
|
+
F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
880
|
+
a.reduceDescriptors(F.prototype, ({ value: e }, t) => {
|
|
882
881
|
let n = t[0].toUpperCase() + t.slice(1);
|
|
883
882
|
return {
|
|
884
883
|
get: () => e,
|
|
@@ -887,9 +886,9 @@ a.reduceDescriptors(N.prototype, ({ value: e }, t) => {
|
|
|
887
886
|
}
|
|
888
887
|
};
|
|
889
888
|
});
|
|
890
|
-
a.freezeMethods(
|
|
889
|
+
a.freezeMethods(F);
|
|
891
890
|
function ce(e, t) {
|
|
892
|
-
const n = this || W, r = t || n, s =
|
|
891
|
+
const n = this || W, r = t || n, s = F.from(r.headers);
|
|
893
892
|
let o = r.data;
|
|
894
893
|
return a.forEach(e, function(c) {
|
|
895
894
|
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
|
|
@@ -918,7 +917,7 @@ function Pn(e) {
|
|
|
918
917
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
919
918
|
return t && t[1] || "";
|
|
920
919
|
}
|
|
921
|
-
function
|
|
920
|
+
function Fn(e, t) {
|
|
922
921
|
e = e || 10;
|
|
923
922
|
const n = new Array(e), r = new Array(e);
|
|
924
923
|
let s = 0, o = 0, i;
|
|
@@ -934,7 +933,7 @@ function Nn(e, t) {
|
|
|
934
933
|
return g ? Math.round(w * 1e3 / g) : void 0;
|
|
935
934
|
};
|
|
936
935
|
}
|
|
937
|
-
function
|
|
936
|
+
function Nn(e, t) {
|
|
938
937
|
let n = 0, r = 1e3 / t, s, o;
|
|
939
938
|
const i = (u, l = Date.now()) => {
|
|
940
939
|
n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
|
|
@@ -948,8 +947,8 @@ function Fn(e, t) {
|
|
|
948
947
|
}
|
|
949
948
|
const Y = (e, t, n = 3) => {
|
|
950
949
|
let r = 0;
|
|
951
|
-
const s =
|
|
952
|
-
return
|
|
950
|
+
const s = Fn(50, 250);
|
|
951
|
+
return Nn((o) => {
|
|
953
952
|
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;
|
|
954
953
|
r = i;
|
|
955
954
|
const d = {
|
|
@@ -972,10 +971,10 @@ const Y = (e, t, n = 3) => {
|
|
|
972
971
|
total: e,
|
|
973
972
|
loaded: r
|
|
974
973
|
}), t[1]];
|
|
975
|
-
}, Pe = (e) => (...t) => a.asap(() => e(...t)),
|
|
974
|
+
}, Pe = (e) => (...t) => a.asap(() => e(...t)), Un = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, C.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
976
975
|
new URL(C.origin),
|
|
977
976
|
C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
|
|
978
|
-
) : () => !0,
|
|
977
|
+
) : () => !0, _n = C.hasStandardBrowserEnv ? (
|
|
979
978
|
// Standard browser envs support document.cookie
|
|
980
979
|
{
|
|
981
980
|
write(e, t, n, r, s, o) {
|
|
@@ -1002,17 +1001,17 @@ const Y = (e, t, n = 3) => {
|
|
|
1002
1001
|
}
|
|
1003
1002
|
}
|
|
1004
1003
|
);
|
|
1005
|
-
function
|
|
1004
|
+
function Ln(e) {
|
|
1006
1005
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1007
1006
|
}
|
|
1008
|
-
function
|
|
1007
|
+
function kn(e, t) {
|
|
1009
1008
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1010
1009
|
}
|
|
1011
1010
|
function Ye(e, t, n) {
|
|
1012
|
-
let r = !
|
|
1013
|
-
return e && (r || n == !1) ?
|
|
1011
|
+
let r = !Ln(t);
|
|
1012
|
+
return e && (r || n == !1) ? kn(e, t) : t;
|
|
1014
1013
|
}
|
|
1015
|
-
const
|
|
1014
|
+
const Fe = (e) => e instanceof F ? { ...e } : e;
|
|
1016
1015
|
function q(e, t) {
|
|
1017
1016
|
t = t || {};
|
|
1018
1017
|
const n = {};
|
|
@@ -1070,7 +1069,7 @@ function q(e, t) {
|
|
|
1070
1069
|
socketPath: i,
|
|
1071
1070
|
responseEncoding: i,
|
|
1072
1071
|
validateStatus: c,
|
|
1073
|
-
headers: (u, l, d) => s(
|
|
1072
|
+
headers: (u, l, d) => s(Fe(u), Fe(l), d, !0)
|
|
1074
1073
|
};
|
|
1075
1074
|
return a.forEach(Object.keys({ ...e, ...t }), function(l) {
|
|
1076
1075
|
const d = f[l] || s, w = d(e[l], t[l], l);
|
|
@@ -1080,7 +1079,7 @@ function q(e, t) {
|
|
|
1080
1079
|
const et = (e) => {
|
|
1081
1080
|
const t = q({}, e);
|
|
1082
1081
|
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
|
|
1083
|
-
t.headers = i =
|
|
1082
|
+
t.headers = i = F.from(i), t.url = Ke(Ye(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
|
|
1084
1083
|
"Authorization",
|
|
1085
1084
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1086
1085
|
);
|
|
@@ -1093,8 +1092,8 @@ const et = (e) => {
|
|
|
1093
1092
|
i.setContentType([u || "multipart/form-data", ...l].join("; "));
|
|
1094
1093
|
}
|
|
1095
1094
|
}
|
|
1096
|
-
if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 &&
|
|
1097
|
-
const u = s && o &&
|
|
1095
|
+
if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Un(t.url))) {
|
|
1096
|
+
const u = s && o && _n.read(o);
|
|
1098
1097
|
u && i.set(s, u);
|
|
1099
1098
|
}
|
|
1100
1099
|
return t;
|
|
@@ -1102,7 +1101,7 @@ const et = (e) => {
|
|
|
1102
1101
|
return new Promise(function(n, r) {
|
|
1103
1102
|
const s = et(e);
|
|
1104
1103
|
let o = s.data;
|
|
1105
|
-
const i =
|
|
1104
|
+
const i = F.from(s.headers).normalize();
|
|
1106
1105
|
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, w, g, p;
|
|
1107
1106
|
function m() {
|
|
1108
1107
|
g && g(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
@@ -1112,7 +1111,7 @@ const et = (e) => {
|
|
|
1112
1111
|
function R() {
|
|
1113
1112
|
if (!h)
|
|
1114
1113
|
return;
|
|
1115
|
-
const b =
|
|
1114
|
+
const b = F.from(
|
|
1116
1115
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1117
1116
|
), S = {
|
|
1118
1117
|
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
|
|
@@ -1122,10 +1121,10 @@ const et = (e) => {
|
|
|
1122
1121
|
config: e,
|
|
1123
1122
|
request: h
|
|
1124
1123
|
};
|
|
1125
|
-
Ze(function(
|
|
1126
|
-
n(
|
|
1127
|
-
}, function(
|
|
1128
|
-
r(
|
|
1124
|
+
Ze(function(k) {
|
|
1125
|
+
n(k), m();
|
|
1126
|
+
}, function(k) {
|
|
1127
|
+
r(k), m();
|
|
1129
1128
|
}, S), h = null;
|
|
1130
1129
|
}
|
|
1131
1130
|
"onloadend" in h ? h.onloadend = R : h.onreadystatechange = function() {
|
|
@@ -1206,7 +1205,7 @@ const et = (e) => {
|
|
|
1206
1205
|
} finally {
|
|
1207
1206
|
await t.cancel();
|
|
1208
1207
|
}
|
|
1209
|
-
},
|
|
1208
|
+
}, Ne = (e, t, n, r) => {
|
|
1210
1209
|
const s = Mn(e, t);
|
|
1211
1210
|
let o = 0, i, c = (f) => {
|
|
1212
1211
|
i || (i = !0, r && r(f));
|
|
@@ -1251,7 +1250,7 @@ const et = (e) => {
|
|
|
1251
1250
|
}
|
|
1252
1251
|
}).headers.has("Content-Type");
|
|
1253
1252
|
return e && !t;
|
|
1254
|
-
}),
|
|
1253
|
+
}), Ue = 64 * 1024, pe = tt && nt(() => a.isReadableStream(new Response("").body)), ee = {
|
|
1255
1254
|
stream: pe && ((e) => e.body)
|
|
1256
1255
|
};
|
|
1257
1256
|
oe && ((e) => {
|
|
@@ -1307,11 +1306,11 @@ const zn = async (e) => {
|
|
|
1307
1306
|
duplex: "half"
|
|
1308
1307
|
}), A;
|
|
1309
1308
|
if (a.isFormData(r) && (A = S.headers.get("content-type")) && l.setContentType(A), S.body) {
|
|
1310
|
-
const [
|
|
1309
|
+
const [k, x] = Ce(
|
|
1311
1310
|
h,
|
|
1312
1311
|
Y(Pe(f))
|
|
1313
1312
|
);
|
|
1314
|
-
r =
|
|
1313
|
+
r = Ne(S.body, Ue, k, x);
|
|
1315
1314
|
}
|
|
1316
1315
|
}
|
|
1317
1316
|
a.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1329,15 +1328,15 @@ const zn = async (e) => {
|
|
|
1329
1328
|
const b = pe && (u === "stream" || u === "response");
|
|
1330
1329
|
if (pe && (c || b && m)) {
|
|
1331
1330
|
const S = {};
|
|
1332
|
-
["status", "statusText", "headers"].forEach((
|
|
1333
|
-
S[
|
|
1331
|
+
["status", "statusText", "headers"].forEach((N) => {
|
|
1332
|
+
S[N] = E[N];
|
|
1334
1333
|
});
|
|
1335
|
-
const A = a.toFiniteNumber(E.headers.get("content-length")), [
|
|
1334
|
+
const A = a.toFiniteNumber(E.headers.get("content-length")), [k, x] = c && Ce(
|
|
1336
1335
|
A,
|
|
1337
1336
|
Y(Pe(c), !0)
|
|
1338
1337
|
) || [];
|
|
1339
1338
|
E = new Response(
|
|
1340
|
-
|
|
1339
|
+
Ne(E.body, Ue, k, () => {
|
|
1341
1340
|
x && x(), m && m();
|
|
1342
1341
|
}),
|
|
1343
1342
|
S
|
|
@@ -1348,7 +1347,7 @@ const zn = async (e) => {
|
|
|
1348
1347
|
return !b && m && m(), await new Promise((S, A) => {
|
|
1349
1348
|
Ze(S, A, {
|
|
1350
1349
|
data: T,
|
|
1351
|
-
headers:
|
|
1350
|
+
headers: F.from(E.headers),
|
|
1352
1351
|
status: E.status,
|
|
1353
1352
|
statusText: E.statusText,
|
|
1354
1353
|
config: e,
|
|
@@ -1377,7 +1376,7 @@ a.forEach(he, (e, t) => {
|
|
|
1377
1376
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1378
1377
|
}
|
|
1379
1378
|
});
|
|
1380
|
-
const
|
|
1379
|
+
const _e = (e) => `- ${e}`, Vn = (e) => a.isFunction(e) || e === null || e === !1, rt = {
|
|
1381
1380
|
getAdapter: (e) => {
|
|
1382
1381
|
e = a.isArray(e) ? e : [e];
|
|
1383
1382
|
const { length: t } = e;
|
|
@@ -1397,8 +1396,8 @@ const Ue = (e) => `- ${e}`, Vn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1397
1396
|
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1398
1397
|
);
|
|
1399
1398
|
let i = t ? o.length > 1 ? `since :
|
|
1400
|
-
` + o.map(
|
|
1401
|
-
`) : " " +
|
|
1399
|
+
` + o.map(_e).join(`
|
|
1400
|
+
`) : " " + _e(o[0]) : "as no adapter specified";
|
|
1402
1401
|
throw new y(
|
|
1403
1402
|
"There is no suitable adapter to dispatch the request " + i,
|
|
1404
1403
|
"ERR_NOT_SUPPORT"
|
|
@@ -1412,8 +1411,8 @@ function ue(e) {
|
|
|
1412
1411
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1413
1412
|
throw new v(null, e);
|
|
1414
1413
|
}
|
|
1415
|
-
function
|
|
1416
|
-
return ue(e), e.headers =
|
|
1414
|
+
function Le(e) {
|
|
1415
|
+
return ue(e), e.headers = F.from(e.headers), e.data = ce.call(
|
|
1417
1416
|
e,
|
|
1418
1417
|
e.transformRequest
|
|
1419
1418
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
|
|
@@ -1421,13 +1420,13 @@ function ke(e) {
|
|
|
1421
1420
|
e,
|
|
1422
1421
|
e.transformResponse,
|
|
1423
1422
|
r
|
|
1424
|
-
), r.headers =
|
|
1423
|
+
), r.headers = F.from(r.headers), r;
|
|
1425
1424
|
}, function(r) {
|
|
1426
1425
|
return Ge(r) || (ue(e), r && r.response && (r.response.data = ce.call(
|
|
1427
1426
|
e,
|
|
1428
1427
|
e.transformResponse,
|
|
1429
1428
|
r.response
|
|
1430
|
-
), r.response.headers =
|
|
1429
|
+
), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
|
|
1431
1430
|
});
|
|
1432
1431
|
}
|
|
1433
1432
|
const st = "1.11.0", ie = {};
|
|
@@ -1436,7 +1435,7 @@ const st = "1.11.0", ie = {};
|
|
|
1436
1435
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1437
1436
|
};
|
|
1438
1437
|
});
|
|
1439
|
-
const
|
|
1438
|
+
const ke = {};
|
|
1440
1439
|
ie.transitional = function(t, n, r) {
|
|
1441
1440
|
function s(o, i) {
|
|
1442
1441
|
return "[Axios v" + st + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
@@ -1447,7 +1446,7 @@ ie.transitional = function(t, n, r) {
|
|
|
1447
1446
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1448
1447
|
y.ERR_DEPRECATED
|
|
1449
1448
|
);
|
|
1450
|
-
return n && !
|
|
1449
|
+
return n && !ke[i] && (ke[i] = !0, console.warn(
|
|
1451
1450
|
s(
|
|
1452
1451
|
i,
|
|
1453
1452
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1478,7 +1477,7 @@ function Wn(e, t, n) {
|
|
|
1478
1477
|
const G = {
|
|
1479
1478
|
assertOptions: Wn,
|
|
1480
1479
|
validators: ie
|
|
1481
|
-
},
|
|
1480
|
+
}, L = G.validators;
|
|
1482
1481
|
let j = class {
|
|
1483
1482
|
constructor(t) {
|
|
1484
1483
|
this.defaults = t || {}, this.interceptors = {
|
|
@@ -1515,17 +1514,17 @@ let j = class {
|
|
|
1515
1514
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
|
|
1516
1515
|
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1517
1516
|
r !== void 0 && G.assertOptions(r, {
|
|
1518
|
-
silentJSONParsing:
|
|
1519
|
-
forcedJSONParsing:
|
|
1520
|
-
clarifyTimeoutError:
|
|
1517
|
+
silentJSONParsing: L.transitional(L.boolean),
|
|
1518
|
+
forcedJSONParsing: L.transitional(L.boolean),
|
|
1519
|
+
clarifyTimeoutError: L.transitional(L.boolean)
|
|
1521
1520
|
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1522
1521
|
serialize: s
|
|
1523
1522
|
} : G.assertOptions(s, {
|
|
1524
|
-
encode:
|
|
1525
|
-
serialize:
|
|
1523
|
+
encode: L.function,
|
|
1524
|
+
serialize: L.function
|
|
1526
1525
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), G.assertOptions(n, {
|
|
1527
|
-
baseUrl:
|
|
1528
|
-
withXsrfToken:
|
|
1526
|
+
baseUrl: L.spelling("baseURL"),
|
|
1527
|
+
withXsrfToken: L.spelling("withXSRFToken")
|
|
1529
1528
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1530
1529
|
let i = o && a.merge(
|
|
1531
1530
|
o.common,
|
|
@@ -1536,7 +1535,7 @@ let j = class {
|
|
|
1536
1535
|
(p) => {
|
|
1537
1536
|
delete o[p];
|
|
1538
1537
|
}
|
|
1539
|
-
), n.headers =
|
|
1538
|
+
), n.headers = F.concat(i, o);
|
|
1540
1539
|
const c = [];
|
|
1541
1540
|
let f = !0;
|
|
1542
1541
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -1548,7 +1547,7 @@ let j = class {
|
|
|
1548
1547
|
});
|
|
1549
1548
|
let l, d = 0, w;
|
|
1550
1549
|
if (!f) {
|
|
1551
|
-
const p = [
|
|
1550
|
+
const p = [Le.bind(this), void 0];
|
|
1552
1551
|
for (p.unshift(...c), p.push(...u), w = p.length, l = Promise.resolve(n); d < w; )
|
|
1553
1552
|
l = l.then(p[d++], p[d++]);
|
|
1554
1553
|
return l;
|
|
@@ -1565,7 +1564,7 @@ let j = class {
|
|
|
1565
1564
|
}
|
|
1566
1565
|
}
|
|
1567
1566
|
try {
|
|
1568
|
-
l =
|
|
1567
|
+
l = Le.call(this, g);
|
|
1569
1568
|
} catch (p) {
|
|
1570
1569
|
return Promise.reject(p);
|
|
1571
1570
|
}
|
|
@@ -1773,29 +1772,29 @@ O.all = function(t) {
|
|
|
1773
1772
|
O.spread = Qn;
|
|
1774
1773
|
O.isAxiosError = Xn;
|
|
1775
1774
|
O.mergeConfig = q;
|
|
1776
|
-
O.AxiosHeaders =
|
|
1775
|
+
O.AxiosHeaders = F;
|
|
1777
1776
|
O.formToJSON = (e) => Xe(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1778
1777
|
O.getAdapter = rt.getAdapter;
|
|
1779
1778
|
O.HttpStatusCode = me;
|
|
1780
1779
|
O.default = O;
|
|
1781
1780
|
const {
|
|
1782
|
-
Axios:
|
|
1783
|
-
AxiosError:
|
|
1784
|
-
CanceledError:
|
|
1785
|
-
isCancel:
|
|
1786
|
-
CancelToken:
|
|
1787
|
-
VERSION:
|
|
1788
|
-
all:
|
|
1789
|
-
Cancel:
|
|
1790
|
-
isAxiosError:
|
|
1791
|
-
spread:
|
|
1792
|
-
toFormData:
|
|
1793
|
-
AxiosHeaders:
|
|
1794
|
-
HttpStatusCode:
|
|
1795
|
-
formToJSON:
|
|
1796
|
-
getAdapter:
|
|
1797
|
-
mergeConfig:
|
|
1798
|
-
} = O,
|
|
1781
|
+
Axios: rr,
|
|
1782
|
+
AxiosError: sr,
|
|
1783
|
+
CanceledError: or,
|
|
1784
|
+
isCancel: ir,
|
|
1785
|
+
CancelToken: ar,
|
|
1786
|
+
VERSION: cr,
|
|
1787
|
+
all: ur,
|
|
1788
|
+
Cancel: lr,
|
|
1789
|
+
isAxiosError: fr,
|
|
1790
|
+
spread: dr,
|
|
1791
|
+
toFormData: pr,
|
|
1792
|
+
AxiosHeaders: hr,
|
|
1793
|
+
HttpStatusCode: mr,
|
|
1794
|
+
formToJSON: yr,
|
|
1795
|
+
getAdapter: br,
|
|
1796
|
+
mergeConfig: wr
|
|
1797
|
+
} = O, Er = ({
|
|
1799
1798
|
endpoint: e,
|
|
1800
1799
|
headers: t = {},
|
|
1801
1800
|
initialData: n,
|
|
@@ -1825,21 +1824,21 @@ const {
|
|
|
1825
1824
|
Array.isArray(T) ? T.forEach((S) => {
|
|
1826
1825
|
S instanceof File ? E.append(b, S) : E.append(b, String(S));
|
|
1827
1826
|
}) : T instanceof File ? E.append(b, T) : E.append(b, String(T));
|
|
1828
|
-
}), d
|
|
1827
|
+
}), d?.(), i(!0), c.current = new AbortController(), O.post(e, E, {
|
|
1829
1828
|
headers: {
|
|
1830
1829
|
"Content-Type": "multipart/form-data",
|
|
1831
1830
|
...t
|
|
1832
1831
|
},
|
|
1833
1832
|
signal: c.current.signal,
|
|
1834
1833
|
onUploadProgress: (b) => {
|
|
1835
|
-
h
|
|
1834
|
+
h?.(b);
|
|
1836
1835
|
}
|
|
1837
1836
|
}).then((b) => {
|
|
1838
|
-
m
|
|
1837
|
+
m?.(b);
|
|
1839
1838
|
}).catch((b) => {
|
|
1840
|
-
O.isCancel(b) ? w
|
|
1839
|
+
O.isCancel(b) ? w?.(b) : g?.(b);
|
|
1841
1840
|
}).finally(() => {
|
|
1842
|
-
p
|
|
1841
|
+
p?.(), i(!1), c.current = null;
|
|
1843
1842
|
});
|
|
1844
1843
|
},
|
|
1845
1844
|
[e, t, s]
|
|
@@ -1852,7 +1851,7 @@ const {
|
|
|
1852
1851
|
isUploading: o,
|
|
1853
1852
|
cancel: u
|
|
1854
1853
|
};
|
|
1855
|
-
},
|
|
1854
|
+
}, gr = ({
|
|
1856
1855
|
headers: e = {},
|
|
1857
1856
|
initialData: t,
|
|
1858
1857
|
options: n = {},
|
|
@@ -1880,15 +1879,15 @@ const {
|
|
|
1880
1879
|
},
|
|
1881
1880
|
skipValidation: S = !1
|
|
1882
1881
|
} = h;
|
|
1883
|
-
!S && !c() || (R
|
|
1882
|
+
!S && !c() || (R?.(), u({
|
|
1884
1883
|
variables: { filters: o },
|
|
1885
1884
|
...!lt(e) && { context: { headers: e } }
|
|
1886
1885
|
}).then((A) => {
|
|
1887
|
-
T
|
|
1886
|
+
T?.(A);
|
|
1888
1887
|
}).catch((A) => {
|
|
1889
|
-
E
|
|
1888
|
+
E?.(A);
|
|
1890
1889
|
}).finally(() => {
|
|
1891
|
-
b
|
|
1890
|
+
b?.();
|
|
1892
1891
|
}));
|
|
1893
1892
|
},
|
|
1894
1893
|
[o, u, e, c]
|
|
@@ -1908,10 +1907,10 @@ const {
|
|
|
1908
1907
|
};
|
|
1909
1908
|
};
|
|
1910
1909
|
export {
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1910
|
+
Or as handleRules,
|
|
1911
|
+
Er as useFileUpload,
|
|
1912
|
+
gr as useFilter,
|
|
1913
|
+
Tr as useForm,
|
|
1915
1914
|
De as useFormState,
|
|
1916
|
-
|
|
1915
|
+
er as validator
|
|
1917
1916
|
};
|