@base-stone/hooks 0.8.6 → 0.8.7
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.
|
@@ -29,18 +29,18 @@ function te() {
|
|
|
29
29
|
return q || (q = 1, P.exports = ee()), P.exports;
|
|
30
30
|
}
|
|
31
31
|
var oe = te();
|
|
32
|
-
const
|
|
32
|
+
const C = {
|
|
33
33
|
sortField: ["orderType", "orderField"],
|
|
34
34
|
sortOrder: ["ASC", "DESC"],
|
|
35
35
|
pageSize: 10
|
|
36
36
|
};
|
|
37
37
|
function ie(n) {
|
|
38
38
|
Object.keys(n).forEach((r) => {
|
|
39
|
-
|
|
39
|
+
C[r] = n[r];
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
function le(n, r = {}) {
|
|
43
|
-
const { rowSelection: a, ...t } = r, o =
|
|
43
|
+
const { rowSelection: a, ...t } = r, o = C.pageSize, [s, f] = E({
|
|
44
44
|
pagination: {
|
|
45
45
|
showSizeChanger: !0,
|
|
46
46
|
showQuickJumper: !0,
|
|
@@ -69,7 +69,7 @@ function le(n, r = {}) {
|
|
|
69
69
|
m(!0);
|
|
70
70
|
const v = { ...t, pageSize: p, ...l };
|
|
71
71
|
l.pageNo === void 0 && (v.pageNo = 1), l.pageSize === void 0 && (v.pageSize = p);
|
|
72
|
-
const { data:
|
|
72
|
+
const { data: w } = await n(v), { list: T = [], totalCount: z = 0 } = w || {};
|
|
73
73
|
a && x([]), f({
|
|
74
74
|
list: T,
|
|
75
75
|
queryParams: v,
|
|
@@ -98,10 +98,10 @@ function le(n, r = {}) {
|
|
|
98
98
|
},
|
|
99
99
|
[u, p]
|
|
100
100
|
), _ = S(
|
|
101
|
-
(l, k, v,
|
|
102
|
-
const { action: T } =
|
|
101
|
+
(l, k, v, w) => {
|
|
102
|
+
const { action: T } = w;
|
|
103
103
|
if (["paginate", "sort"].includes(T)) {
|
|
104
|
-
const { current: z, pageSize: V } = l, { field: H, order: A } = v, [Q, Y] =
|
|
104
|
+
const { current: z, pageSize: V } = l, { field: H, order: A } = v, [Q, Y] = C.sortField, [Z, B] = C.sortOrder, U = {
|
|
105
105
|
...e,
|
|
106
106
|
[Q]: A ? A === "ascend" ? Z : B : void 0,
|
|
107
107
|
[Y]: H,
|
|
@@ -186,7 +186,7 @@ function ce(n) {
|
|
|
186
186
|
maskClosable: g.maskClosable ?? !1,
|
|
187
187
|
centered: g.centered ?? !0,
|
|
188
188
|
destroyOnHidden: g.destroyOnHidden ?? !0,
|
|
189
|
-
onCancel: t(c, !1)
|
|
189
|
+
onCancel: g.onCancel ?? t(c, !1)
|
|
190
190
|
},
|
|
191
191
|
toggle: (m) => a(c, m),
|
|
192
192
|
open: (m) => t(c, !0, m),
|