@unicom-cloud/ui 0.8.94 → 0.8.96
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/Tooltip.js +1 -1
- package/alert/index.js +50 -49
- package/badge/index.js +11 -11
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +1 -1
- package/color-picker/colors.js +1 -1
- package/color-picker/hooks/useColorPicker.js +1 -1
- package/color-picker/utils.js +1 -1
- package/components/common/empty/index.js +33 -13
- package/components/common/hooks/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +8 -8
- package/components/common/space/index.js +1 -1
- package/components/common/utils/setPrimaryColor.js +21 -21
- package/components/common/utils/setTheme.js +23 -23
- package/details/index.js +32 -31
- package/dist/tinycolor/chunk/{DGZSWe7E.js → BOzCVdr0.js} +43 -43
- package/dist/tinycolor/customize/index.js +1 -1
- package/hooks/index.js +50 -52
- package/index.js +674 -680
- package/package.json +1 -1
- package/rate/index.js +1 -1
- package/slider/index.js +1 -1
- package/slider/util.js +1 -1
- package/style.css +1 -1
- package/table/Table.js +145 -145
- package/tag/index.js +24 -24
- package/tooltip/index.js +1 -1
- package/types/common/utils/math.d.ts +1 -1
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/badge/interface.d.ts +1 -1
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/menu/context.d.ts +1 -1
- package/types/pc/utils/math.d.ts +1 -1
- package/typography/Ellipsis.js +1 -1
- package/utils/color.js +1 -1
- package/utils/index.js +174 -178
- package/utils/math.js +7 -11
- package/utils/tinycolor.js +1 -1
- package/version/index.js +1 -1
- package/components/common/hooks/useComputedState.js +0 -11
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/pc/hooks/useComputedState.d.ts +0 -1
package/table/Table.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as a, jsxs as v, Fragment as vt } from "react/jsx-runtime";
|
|
2
|
-
import { Tween as
|
|
3
|
-
import { quintInOut as
|
|
4
|
-
import
|
|
2
|
+
import { Tween as ir } from "../dist/tween/src/tween.js";
|
|
3
|
+
import { quintInOut as lr } from "../dist/tween/src/easing.js";
|
|
4
|
+
import cr from "lodash/debounce";
|
|
5
5
|
import K from "lodash/isArray";
|
|
6
6
|
import te from "lodash/isNumber";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import m from "lodash/isPlainObject";
|
|
8
|
+
import ar from "lodash/throttle";
|
|
9
|
+
import fr, { forwardRef as dr, useContext as ur, useMemo as lt, useRef as $, useState as j, useImperativeHandle as pr, useCallback as mr, useEffect as ee } from "react";
|
|
10
10
|
import "../config-provider/ConfigProvider.js";
|
|
11
11
|
import yr from "../components/common/hooks/useIsomorphicLayoutEffect.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import re from "../components/common/hooks/useMergeProps.js";
|
|
13
|
+
import oe from "../components/common/hooks/useUpdateEffect.js";
|
|
14
|
+
import ne from "../pagination/Pagination.js";
|
|
15
15
|
import gr from "../spin/index.js";
|
|
16
|
-
import
|
|
16
|
+
import se from "@unicom-cloud/utils/class-name";
|
|
17
17
|
import { on as ct, off as at } from "../components/common/utils/dom.js";
|
|
18
18
|
import { pickDataAttributes as hr } from "../components/common/utils/pick.js";
|
|
19
19
|
import { resizeObserverEffect as br } from "../components/common/utils/resizeObserverEffect.js";
|
|
@@ -28,7 +28,7 @@ import Fr from "./hook/useStickyOffsets.js";
|
|
|
28
28
|
import Nr from "./tbody/index.js";
|
|
29
29
|
import vr from "./tfoot/index.js";
|
|
30
30
|
import Pr from "./thead/index.js";
|
|
31
|
-
import { deepCloneData as Dr, getOriginData as S, getSorterPriority as
|
|
31
|
+
import { deepCloneData as Dr, getOriginData as S, getSorterPriority as ie, getSorterFn as le, getScrollBarHeight as Br, getScrollBarWidth as Lr } from "./util.js";
|
|
32
32
|
import zr from "../config-provider/context.js";
|
|
33
33
|
const Rr = [], Hr = [], Er = {
|
|
34
34
|
showHeader: !0,
|
|
@@ -40,44 +40,44 @@ const Rr = [], Hr = [], Er = {
|
|
|
40
40
|
indentSize: 15,
|
|
41
41
|
showSorterTooltip: !0
|
|
42
42
|
};
|
|
43
|
-
function kr(P,
|
|
43
|
+
function kr(P, ce) {
|
|
44
44
|
var Qt, Zt;
|
|
45
45
|
const {
|
|
46
46
|
getPrefixCls: dt,
|
|
47
|
-
loadingElement:
|
|
47
|
+
loadingElement: ae,
|
|
48
48
|
size: Pt,
|
|
49
|
-
tablePagination:
|
|
50
|
-
renderEmpty:
|
|
49
|
+
tablePagination: fe,
|
|
50
|
+
renderEmpty: de,
|
|
51
51
|
componentConfig: C,
|
|
52
52
|
rtl: L
|
|
53
|
-
} =
|
|
53
|
+
} = ur(zr), x = re(
|
|
54
54
|
P,
|
|
55
55
|
Er,
|
|
56
56
|
C == null ? void 0 : C.Table
|
|
57
|
-
), F =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
), F = re(
|
|
58
|
+
m(P == null ? void 0 : P.pagination) ? P == null ? void 0 : P.pagination : {},
|
|
59
|
+
m((Qt = C == null ? void 0 : C.Table) == null ? void 0 : Qt.pagination) ? (Zt = C == null ? void 0 : C.Table) == null ? void 0 : Zt.pagination : {},
|
|
60
|
+
fe || {}
|
|
61
61
|
), {
|
|
62
|
-
style:
|
|
63
|
-
className:
|
|
64
|
-
component:
|
|
62
|
+
style: ue,
|
|
63
|
+
className: pe,
|
|
64
|
+
component: me,
|
|
65
65
|
border: b,
|
|
66
66
|
borderCell: ut,
|
|
67
67
|
columns: Dt = Hr,
|
|
68
|
-
data:
|
|
68
|
+
data: d = Rr,
|
|
69
69
|
scroll: i,
|
|
70
|
-
noDataElement:
|
|
71
|
-
showHeader:
|
|
72
|
-
stripe:
|
|
73
|
-
hover:
|
|
70
|
+
noDataElement: ye,
|
|
71
|
+
showHeader: ge,
|
|
72
|
+
stripe: he,
|
|
73
|
+
hover: be,
|
|
74
74
|
pagination: N,
|
|
75
75
|
onChange: y,
|
|
76
76
|
pagePosition: w,
|
|
77
77
|
childrenColumnName: W,
|
|
78
|
-
indentSize:
|
|
78
|
+
indentSize: xe,
|
|
79
79
|
rowSelection: D,
|
|
80
|
-
tableLayoutFixed:
|
|
80
|
+
tableLayoutFixed: Se,
|
|
81
81
|
header: Bt,
|
|
82
82
|
// 潘启宝添加
|
|
83
83
|
footer: Lt,
|
|
@@ -86,30 +86,30 @@ function kr(P, le) {
|
|
|
86
86
|
summary: I,
|
|
87
87
|
rowKey: q
|
|
88
88
|
} = x, Rt = lt(
|
|
89
|
-
() => Dr(
|
|
90
|
-
[
|
|
91
|
-
), n = dt == null ? void 0 : dt("table"), pt = x.size || (["default", "middle", "small"].indexOf(Pt) > -1 ? Pt : "default"), R = $(null),
|
|
89
|
+
() => Dr(d, W),
|
|
90
|
+
[d, W]
|
|
91
|
+
), n = dt == null ? void 0 : dt("table"), pt = x.size || (["default", "middle", "small"].indexOf(Pt) > -1 ? Pt : "default"), R = $(null), p = $(null), mt = $(null), g = $(null), _ = $(null), yt = $(null), U = $(null), G = $(0), gt = $(!1), [Ht, f] = xr(x), { currentFilters: Ce, defaultSorters: we } = He(), [A, ht] = j(1), [Te, $e] = j(
|
|
92
92
|
F.pageSize || F.defaultPageSize || 10
|
|
93
|
-
), [Et, kt] = j(
|
|
93
|
+
), [Et, kt] = j(Ce), [Fe, Ne] = j(0), [ve, Pe] = j([]), bt = Fr(f), [De, Ot] = $r(
|
|
94
94
|
Ht,
|
|
95
95
|
f,
|
|
96
96
|
n
|
|
97
97
|
), {
|
|
98
98
|
currentSorter: V,
|
|
99
|
-
activeSorters:
|
|
100
|
-
getNextActiveSorters:
|
|
101
|
-
updateStateSorters:
|
|
102
|
-
} = Tr(f,
|
|
103
|
-
function
|
|
99
|
+
activeSorters: u,
|
|
100
|
+
getNextActiveSorters: Be,
|
|
101
|
+
updateStateSorters: Le
|
|
102
|
+
} = Tr(f, we), { ComponentTable: X, ComponentBodyWrapper: ze, ComponentHeaderWrapper: Re } = Sr(me), xt = lt(() => typeof q == "function" ? (t) => q(S(t)) : (t) => t[q], [q]);
|
|
103
|
+
function He() {
|
|
104
104
|
const t = {};
|
|
105
105
|
let e = [];
|
|
106
106
|
return f.forEach((r) => {
|
|
107
107
|
const o = r.dataIndex || r.key;
|
|
108
108
|
if (r.defaultFilters && (t[o] = r.defaultFilters), r.filteredValue && (t[o] = r.filteredValue), "defaultSortOrder" in r || "sortOrder" in r) {
|
|
109
|
-
const s =
|
|
109
|
+
const s = ie(r.sorter), c = "sortOrder" in r ? r.sortOrder : r.defaultSortOrder, l = {
|
|
110
110
|
field: o,
|
|
111
111
|
direction: c,
|
|
112
|
-
sorterFn:
|
|
112
|
+
sorterFn: le(r.sorter),
|
|
113
113
|
priority: s
|
|
114
114
|
};
|
|
115
115
|
c ? te(s) ? e.every(
|
|
@@ -127,17 +127,17 @@ function kr(P, le) {
|
|
|
127
127
|
s !== void 0 && (e[s] = r.filteredValue);
|
|
128
128
|
}), e;
|
|
129
129
|
}, [f]), B = lt(() => Object.keys(J).length ? J : Et, [Et, J]);
|
|
130
|
-
function
|
|
130
|
+
function Ee(t, e) {
|
|
131
131
|
const r = Mt(e);
|
|
132
132
|
if (!r)
|
|
133
133
|
return;
|
|
134
134
|
const o = {
|
|
135
135
|
direction: t,
|
|
136
136
|
field: e,
|
|
137
|
-
sorterFn:
|
|
138
|
-
priority:
|
|
139
|
-
}, s =
|
|
140
|
-
|
|
137
|
+
sorterFn: le(r.sorter),
|
|
138
|
+
priority: ie(r.sorter)
|
|
139
|
+
}, s = Be(o);
|
|
140
|
+
Le(o, s);
|
|
141
141
|
const c = et(
|
|
142
142
|
o,
|
|
143
143
|
s,
|
|
@@ -149,7 +149,7 @@ function kr(P, le) {
|
|
|
149
149
|
action: "sort"
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function ke(t) {
|
|
153
153
|
const e = function(o, s) {
|
|
154
154
|
return (c, l) => {
|
|
155
155
|
const h = o(c, l);
|
|
@@ -168,7 +168,7 @@ function kr(P, le) {
|
|
|
168
168
|
return 0;
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Oe(t, e) {
|
|
172
172
|
const r = {
|
|
173
173
|
...B,
|
|
174
174
|
[t.dataIndex]: e
|
|
@@ -180,12 +180,12 @@ function kr(P, le) {
|
|
|
180
180
|
kt(o);
|
|
181
181
|
const s = et(
|
|
182
182
|
V,
|
|
183
|
-
|
|
183
|
+
u,
|
|
184
184
|
r
|
|
185
185
|
), c = M(s);
|
|
186
186
|
y == null || y(
|
|
187
187
|
E(s),
|
|
188
|
-
|
|
188
|
+
u.length === 1 ? u[0] : u,
|
|
189
189
|
r,
|
|
190
190
|
{
|
|
191
191
|
currentData: S(c),
|
|
@@ -202,12 +202,12 @@ function kr(P, le) {
|
|
|
202
202
|
delete e[t], kt(e);
|
|
203
203
|
const r = et(
|
|
204
204
|
V,
|
|
205
|
-
|
|
205
|
+
u,
|
|
206
206
|
e
|
|
207
207
|
), o = M(r);
|
|
208
208
|
y == null || y(
|
|
209
209
|
E(r),
|
|
210
|
-
|
|
210
|
+
u.length === 1 ? u[0] : u,
|
|
211
211
|
e,
|
|
212
212
|
{
|
|
213
213
|
currentData: S(o),
|
|
@@ -228,7 +228,7 @@ function kr(P, le) {
|
|
|
228
228
|
)));
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
|
-
const s = (c) => c.slice().sort(
|
|
231
|
+
const s = (c) => c.slice().sort(ke(e)).map((l) => K(l[W]) ? {
|
|
232
232
|
...l,
|
|
233
233
|
[W]: s(l[W])
|
|
234
234
|
} : l);
|
|
@@ -236,11 +236,11 @@ function kr(P, le) {
|
|
|
236
236
|
}
|
|
237
237
|
const H = et(
|
|
238
238
|
V,
|
|
239
|
-
|
|
239
|
+
u,
|
|
240
240
|
B
|
|
241
241
|
);
|
|
242
242
|
function E(t = H) {
|
|
243
|
-
const e = F.pageSize ||
|
|
243
|
+
const e = F.pageSize || Te || 10, r = pt === "middle" ? "default" : pt;
|
|
244
244
|
let o = "top";
|
|
245
245
|
w === "tl" || w === "bl" ? o = "bottom" : o = "top";
|
|
246
246
|
const s = K(t) ? t.length : 0, c = Math.ceil(s / e) < A ? 1 : A;
|
|
@@ -259,23 +259,23 @@ function kr(P, le) {
|
|
|
259
259
|
return typeof N == "object" && N.selectProps && (l.selectProps = {
|
|
260
260
|
...l.selectProps,
|
|
261
261
|
...N.selectProps
|
|
262
|
-
}),
|
|
262
|
+
}), m(N) && (l = {
|
|
263
263
|
...l,
|
|
264
264
|
...N
|
|
265
|
-
}),
|
|
265
|
+
}), m(F) && (l = {
|
|
266
266
|
...l,
|
|
267
267
|
...F
|
|
268
|
-
}), l.onChange =
|
|
268
|
+
}), l.onChange = qe, l;
|
|
269
269
|
}
|
|
270
270
|
const rt = E(), k = M();
|
|
271
271
|
function M(t = H, e = rt) {
|
|
272
272
|
const { current: r = 0, pageSize: o = 10 } = e;
|
|
273
|
-
return N === !1 ||
|
|
273
|
+
return N === !1 || m(N) && d.length <= o ? t : t.slice((r - 1) * o, r * o);
|
|
274
274
|
}
|
|
275
|
-
const It =
|
|
275
|
+
const It = cr(_t, 100), T = !!(i && i.y), Y = I == null ? void 0 : I(S(H)), St = I && fr.isValidElement(Y) && Y.props.fixed, We = T && St;
|
|
276
276
|
yr(() => {
|
|
277
277
|
_t(), ct(window, "resize", It);
|
|
278
|
-
const t = R.current, e =
|
|
278
|
+
const t = R.current, e = p.current, r = g.current;
|
|
279
279
|
e && ct(e, "scroll", O);
|
|
280
280
|
const o = t && t.parentNode;
|
|
281
281
|
return t && o && ct(o, "scroll", O), r && ct(r, "scroll", O), () => {
|
|
@@ -287,13 +287,13 @@ function kr(P, le) {
|
|
|
287
287
|
i == null ? void 0 : i.x,
|
|
288
288
|
i == null ? void 0 : i.y,
|
|
289
289
|
f.length,
|
|
290
|
-
|
|
291
|
-
]),
|
|
292
|
-
const { total: t, pageSize: e } = E(
|
|
290
|
+
d
|
|
291
|
+
]), oe(() => {
|
|
292
|
+
const { total: t, pageSize: e } = E(d);
|
|
293
293
|
Math.ceil(t / e) < A && ht(1);
|
|
294
|
-
}, [
|
|
294
|
+
}, [d == null ? void 0 : d.length]), oe(() => {
|
|
295
295
|
ot();
|
|
296
|
-
}, [
|
|
296
|
+
}, [d, Q, Z, L]), pr(ce, () => ({
|
|
297
297
|
getRootDomElement: Ct,
|
|
298
298
|
scrollIntoView: (t) => {
|
|
299
299
|
yt.current && yt.current.scrollTo({ key: t });
|
|
@@ -309,12 +309,12 @@ function kr(P, le) {
|
|
|
309
309
|
const t = Ct();
|
|
310
310
|
if (t && (tt || i && i.x)) {
|
|
311
311
|
const o = t.querySelector(`.${n}-body`) || t.querySelector(`.${n}-content-inner`), s = (r = (e = o == null ? void 0 : o.getBoundingClientRect) == null ? void 0 : e.call(o)) == null ? void 0 : r.width;
|
|
312
|
-
|
|
312
|
+
Ne(s);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
const t = _.current, e = T ?
|
|
315
|
+
const Ie = mr(
|
|
316
|
+
ar(() => {
|
|
317
|
+
const t = _.current, e = T ? p.current : U.current && U.current.parentNode;
|
|
318
318
|
if (e) {
|
|
319
319
|
const r = L ? -e.scrollLeft : e.scrollLeft, o = r === 0, s = r + 1 >= e.children[0].getBoundingClientRect().width - e.getBoundingClientRect().width;
|
|
320
320
|
o && s ? nt(
|
|
@@ -333,10 +333,10 @@ function kr(P, le) {
|
|
|
333
333
|
} else
|
|
334
334
|
t && Vt(t.classList);
|
|
335
335
|
}, 100),
|
|
336
|
-
[_.current,
|
|
336
|
+
[_.current, p.current, T, L]
|
|
337
337
|
);
|
|
338
338
|
function ot() {
|
|
339
|
-
if (tt || i &&
|
|
339
|
+
if (tt || i && m(i) && i.x) {
|
|
340
340
|
const t = _.current;
|
|
341
341
|
t && (Q && At(
|
|
342
342
|
t.classList,
|
|
@@ -344,7 +344,7 @@ function kr(P, le) {
|
|
|
344
344
|
), Z && At(
|
|
345
345
|
t.classList,
|
|
346
346
|
`${n}-has-fixed-col-right`
|
|
347
|
-
)),
|
|
347
|
+
)), Ie();
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
function At(t, e) {
|
|
@@ -358,24 +358,24 @@ function kr(P, le) {
|
|
|
358
358
|
}
|
|
359
359
|
const {
|
|
360
360
|
selectedRowKeys: wt,
|
|
361
|
-
indeterminateKeys:
|
|
362
|
-
onCheckAll:
|
|
363
|
-
onCheck:
|
|
364
|
-
onCheckRadio:
|
|
365
|
-
setSelectedRowKeys:
|
|
366
|
-
allSelectedRowKeys:
|
|
367
|
-
flattenData:
|
|
361
|
+
indeterminateKeys: _e,
|
|
362
|
+
onCheckAll: Ae,
|
|
363
|
+
onCheck: Ve,
|
|
364
|
+
onCheckRadio: Me,
|
|
365
|
+
setSelectedRowKeys: Ye,
|
|
366
|
+
allSelectedRowKeys: Ke,
|
|
367
|
+
flattenData: je
|
|
368
368
|
} = wr(x, k, Rt, xt);
|
|
369
369
|
function Mt(t) {
|
|
370
370
|
return f.find((e, r) => typeof e.key < "u" ? typeof e.key == "number" && typeof t == "string" ? e.key.toString() === t : e.key === t : typeof e.dataIndex < "u" ? e.dataIndex === t : typeof t == "number" ? r === t : !1);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function qe(t, e) {
|
|
373
373
|
var o, s;
|
|
374
|
-
ht(t),
|
|
374
|
+
ht(t), $e(e), t !== A && Ue(), D && !D.checkCrossPage && wt.length && (Ye([]), (o = D.onChange) == null || o.call(D, [], []));
|
|
375
375
|
const r = { ...E(), current: t, pageSize: e };
|
|
376
376
|
y == null || y(
|
|
377
377
|
r,
|
|
378
|
-
|
|
378
|
+
u.length === 1 ? u[0] : u,
|
|
379
379
|
B,
|
|
380
380
|
{
|
|
381
381
|
currentData: S(
|
|
@@ -386,31 +386,31 @@ function kr(P, le) {
|
|
|
386
386
|
}
|
|
387
387
|
), (s = F.onChange) == null || s.call(F, t, e);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
if (!
|
|
389
|
+
function Ue() {
|
|
390
|
+
if (!p.current)
|
|
391
391
|
return;
|
|
392
|
-
const e =
|
|
393
|
-
new
|
|
392
|
+
const e = p.current.scrollTop;
|
|
393
|
+
new ir({
|
|
394
394
|
from: { scrollTop: e },
|
|
395
395
|
to: { scrollTop: 0 },
|
|
396
|
-
easing:
|
|
396
|
+
easing: lr,
|
|
397
397
|
duration: 300,
|
|
398
398
|
onUpdate: (o) => {
|
|
399
|
-
|
|
399
|
+
p.current && (p.current.scrollTop = o.scrollTop);
|
|
400
400
|
}
|
|
401
401
|
}).start();
|
|
402
402
|
}
|
|
403
403
|
function O(t) {
|
|
404
|
-
const { target: e } = t, r =
|
|
404
|
+
const { target: e } = t, r = p.current, o = R.current && R.current.parentNode, s = g.current;
|
|
405
405
|
e.scrollLeft !== G.current && (o && (o.scrollLeft = e.scrollLeft), r && (r.scrollLeft = e.scrollLeft), s && (s.scrollLeft = e.scrollLeft), ot()), G.current = t.target.scrollLeft;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Ge(t) {
|
|
408
408
|
const { target: e } = t, r = U.current;
|
|
409
409
|
e.scrollLeft !== G.current && (r.scrollLeft = e.scrollLeft, ot()), G.current = t.target.scrollLeft;
|
|
410
410
|
}
|
|
411
|
-
const [Yt,
|
|
411
|
+
const [Yt, Xe] = Cr(
|
|
412
412
|
x,
|
|
413
|
-
|
|
413
|
+
je,
|
|
414
414
|
xt
|
|
415
415
|
);
|
|
416
416
|
let Kt = {}, Tt = {};
|
|
@@ -419,11 +419,11 @@ function kr(P, le) {
|
|
|
419
419
|
}), i.y && (typeof i.y == "number" || typeof i.y == "string") && (Kt = {
|
|
420
420
|
maxHeight: i.y
|
|
421
421
|
}));
|
|
422
|
-
function
|
|
422
|
+
function Je() {
|
|
423
423
|
requestAnimationFrame((t) => {
|
|
424
424
|
const e = R.current && R.current.parentNode, r = Br(e);
|
|
425
425
|
r && r > 0 && (e.style.marginBottom = `-${r}px`, e.style.paddingBottom = "0px", g.current && (g.current.style.marginBottom = `-${r}px`, g.current.style.paddingBottom = "0px")), setTimeout(() => {
|
|
426
|
-
const o =
|
|
426
|
+
const o = p.current;
|
|
427
427
|
Lr(o) ? (gt.current = !0, e && (e.style.overflowY = "scroll", e.style.scrollSnapType = "y mandatory"), g.current && (g.current.style.overflowY = "scroll", g.current.style.overflowY = "y mandatory")) : e && gt.current && (gt.current = !1, e.style.overflowY = "auto", e.style.overflowY = "y mandatory", g.current && (g.current.style.overflowY = "auto", g.current.style.overflowY = "y mandatory"));
|
|
428
428
|
}, 0);
|
|
429
429
|
});
|
|
@@ -432,25 +432,25 @@ function kr(P, le) {
|
|
|
432
432
|
Pr,
|
|
433
433
|
{
|
|
434
434
|
...x,
|
|
435
|
-
activeSorters:
|
|
435
|
+
activeSorters: u,
|
|
436
436
|
currentSorter: V,
|
|
437
437
|
selectedRowKeys: wt,
|
|
438
438
|
currentFilters: B,
|
|
439
|
-
onCheckAll:
|
|
440
|
-
onSort:
|
|
439
|
+
onCheckAll: Ae,
|
|
440
|
+
onSort: Ee,
|
|
441
441
|
data: k,
|
|
442
|
-
onHandleFilter:
|
|
442
|
+
onHandleFilter: Oe,
|
|
443
443
|
onHandleFilterReset: Wt,
|
|
444
444
|
prefixCls: n,
|
|
445
|
-
allSelectedRowKeys:
|
|
445
|
+
allSelectedRowKeys: Ke,
|
|
446
446
|
groupColumns: Ht,
|
|
447
447
|
stickyOffsets: bt,
|
|
448
|
-
groupStickyClassNames:
|
|
448
|
+
groupStickyClassNames: De
|
|
449
449
|
}
|
|
450
450
|
);
|
|
451
|
-
function
|
|
452
|
-
const t =
|
|
453
|
-
return T || z ? /* @__PURE__ */ a(
|
|
451
|
+
function Qe() {
|
|
452
|
+
const t = m(i) && i.x === "max-content";
|
|
453
|
+
return T || z ? /* @__PURE__ */ a(Re, { className: `${n}-header`, children: /* @__PURE__ */ v(
|
|
454
454
|
X,
|
|
455
455
|
{
|
|
456
456
|
ref: R,
|
|
@@ -462,7 +462,7 @@ function kr(P, le) {
|
|
|
462
462
|
columns: f,
|
|
463
463
|
prefixCls: n,
|
|
464
464
|
producer: !1,
|
|
465
|
-
columnWidths: t && i.y ?
|
|
465
|
+
columnWidths: t && i.y ? ve : null
|
|
466
466
|
}
|
|
467
467
|
),
|
|
468
468
|
jt
|
|
@@ -486,44 +486,45 @@ function kr(P, le) {
|
|
|
486
486
|
...x,
|
|
487
487
|
saveRef: (t) => mt.current = t,
|
|
488
488
|
selectedRowKeys: wt,
|
|
489
|
-
indeterminateKeys:
|
|
489
|
+
indeterminateKeys: _e,
|
|
490
490
|
expandedRowKeys: Yt,
|
|
491
|
-
onCheck:
|
|
492
|
-
onCheckRadio:
|
|
493
|
-
onClickExpandBtn:
|
|
491
|
+
onCheck: Ve,
|
|
492
|
+
onCheckRadio: Me,
|
|
493
|
+
onClickExpandBtn: Xe,
|
|
494
494
|
columns: f,
|
|
495
495
|
data: k,
|
|
496
496
|
prefixCls: n,
|
|
497
497
|
hasFixedColumn: tt,
|
|
498
|
-
tableViewWidth:
|
|
499
|
-
indentSize:
|
|
500
|
-
noDataElement:
|
|
501
|
-
activeSorters:
|
|
498
|
+
tableViewWidth: Fe,
|
|
499
|
+
indentSize: xe,
|
|
500
|
+
noDataElement: ye || de("Table"),
|
|
501
|
+
activeSorters: u,
|
|
502
502
|
currentSorter: V,
|
|
503
503
|
stickyOffsets: bt,
|
|
504
504
|
stickyClassNames: Ot,
|
|
505
505
|
getRowKey: xt,
|
|
506
506
|
saveVirtualListRef: (t) => {
|
|
507
|
-
z && (yt.current = t,
|
|
507
|
+
z && (yt.current = t, p.current = t == null ? void 0 : t.dom);
|
|
508
508
|
},
|
|
509
509
|
___dangerouslySetInnerHTML___: x.___dangerouslySetInnerHTML___
|
|
510
510
|
}
|
|
511
|
-
), Gt = !z && !
|
|
511
|
+
), Gt = !z && !We ? /* @__PURE__ */ v(vt, { children: [
|
|
512
512
|
Ut,
|
|
513
513
|
qt
|
|
514
514
|
] }) : Ut;
|
|
515
|
-
|
|
516
|
-
const t =
|
|
515
|
+
if (ee(() => {
|
|
516
|
+
const t = p.current || mt.current, e = br([t], Je);
|
|
517
517
|
return () => {
|
|
518
518
|
e();
|
|
519
519
|
};
|
|
520
|
-
}, [
|
|
521
|
-
|
|
522
|
-
|
|
520
|
+
}, [p.current, mt.current]), ee(() => (console.table(d), () => {
|
|
521
|
+
}), [d]), !Dt.length) return null;
|
|
522
|
+
function Ze() {
|
|
523
|
+
const t = m(i) && i.x === "max-content" && !!i.y && K(d) && d.length > 0;
|
|
523
524
|
return T && !z ? /* @__PURE__ */ a(
|
|
524
|
-
|
|
525
|
+
ze,
|
|
525
526
|
{
|
|
526
|
-
ref:
|
|
527
|
+
ref: p,
|
|
527
528
|
className: `${n}-body`,
|
|
528
529
|
style: Kt,
|
|
529
530
|
children: /* @__PURE__ */ v(X, { style: Tt, children: [
|
|
@@ -533,9 +534,9 @@ function kr(P, le) {
|
|
|
533
534
|
columns: f,
|
|
534
535
|
prefixCls: n,
|
|
535
536
|
producer: t,
|
|
536
|
-
onSetColumnWidths:
|
|
537
|
+
onSetColumnWidths: Pe,
|
|
537
538
|
expandedRowKeys: Yt,
|
|
538
|
-
data:
|
|
539
|
+
data: d
|
|
539
540
|
}
|
|
540
541
|
),
|
|
541
542
|
Gt
|
|
@@ -543,18 +544,18 @@ function kr(P, le) {
|
|
|
543
544
|
}
|
|
544
545
|
) : Gt;
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
+
function tr() {
|
|
547
548
|
let t = {};
|
|
548
|
-
i &&
|
|
549
|
+
i && m(i) && i.x && (t = {
|
|
549
550
|
width: i.x
|
|
550
551
|
});
|
|
551
552
|
const e = /* @__PURE__ */ a("div", { className: `${n}-tfoot`, ref: g, children: /* @__PURE__ */ v(X, { style: t, children: [
|
|
552
553
|
/* @__PURE__ */ a(ft, { columns: f, prefixCls: n }),
|
|
553
554
|
qt
|
|
554
555
|
] }) }), r = Y && T && St === "top", o = Y && T && St === "bottom", s = /* @__PURE__ */ v(vt, { children: [
|
|
555
|
-
|
|
556
|
+
ge ? Qe() : null,
|
|
556
557
|
r && e,
|
|
557
|
-
|
|
558
|
+
Ze(),
|
|
558
559
|
o && e
|
|
559
560
|
] });
|
|
560
561
|
return /* @__PURE__ */ v(vt, { children: [
|
|
@@ -563,7 +564,7 @@ function kr(P, le) {
|
|
|
563
564
|
"div",
|
|
564
565
|
{
|
|
565
566
|
className: `${n}-content-inner`,
|
|
566
|
-
onScroll: T ? void 0 :
|
|
567
|
+
onScroll: T ? void 0 : Ge,
|
|
567
568
|
children: T || z ? s : /* @__PURE__ */ v(X, { ref: U, style: t, children: [
|
|
568
569
|
/* @__PURE__ */ a(ft, { prefixCls: n, columns: f }),
|
|
569
570
|
s
|
|
@@ -573,48 +574,47 @@ function kr(P, le) {
|
|
|
573
574
|
typeof Lt == "function" && /* @__PURE__ */ a("div", { className: `${n}-footer`, children: Lt(k) })
|
|
574
575
|
] });
|
|
575
576
|
}
|
|
576
|
-
|
|
577
|
-
const tr = p(b) ? b.wrapper : b, $t = p(b) ? b.cell : ut, er = p(b) ? b.cell || b.headerCell : ut, rr = p(b) ? b.cell || b.bodyCell : ut, or = ne(
|
|
577
|
+
const er = m(b) ? b.wrapper : b, $t = m(b) ? b.cell : ut, rr = m(b) ? b.cell || b.headerCell : ut, or = m(b) ? b.cell || b.bodyCell : ut, nr = se(
|
|
578
578
|
n,
|
|
579
579
|
`${n}-size-${pt}`,
|
|
580
580
|
{
|
|
581
|
-
[`${n}-border`]:
|
|
581
|
+
[`${n}-border`]: er,
|
|
582
582
|
[`${n}-border-cell`]: $t,
|
|
583
|
-
[`${n}-border-header-cell`]: !$t &&
|
|
584
|
-
[`${n}-border-body-cell`]: !$t &&
|
|
585
|
-
[`${n}-stripe`]:
|
|
586
|
-
[`${n}-hover`]:
|
|
583
|
+
[`${n}-border-header-cell`]: !$t && rr,
|
|
584
|
+
[`${n}-border-body-cell`]: !$t && or,
|
|
585
|
+
[`${n}-stripe`]: he,
|
|
586
|
+
[`${n}-hover`]: be,
|
|
587
587
|
[`${n}-type-radio`]: D && D.type === "radio",
|
|
588
|
-
[`${n}-layout-fixed`]:
|
|
588
|
+
[`${n}-layout-fixed`]: Se || i && (i.x || i.y) || Dt.find((t) => t.ellipsis),
|
|
589
589
|
[`${n}-fixed-column`]: tt,
|
|
590
590
|
[`${n}-virtualized`]: z,
|
|
591
591
|
[`${n}-rtl`]: L
|
|
592
592
|
},
|
|
593
|
-
|
|
594
|
-
), Ft = w === "tl" || w === "tr" || w === "topCenter",
|
|
593
|
+
pe
|
|
594
|
+
), Ft = w === "tl" || w === "tr" || w === "topCenter", sr = se(`${n}-pagination`, {
|
|
595
595
|
[`${n}-pagination-left`]: w === "tl" || w === "bl",
|
|
596
596
|
[`${n}-pagination-center`]: w === "topCenter" || w === "bottomCenter",
|
|
597
597
|
[`${n}-pagination-top`]: Ft
|
|
598
598
|
});
|
|
599
599
|
let st = x.loading;
|
|
600
600
|
typeof st == "boolean" && (st = { loading: st });
|
|
601
|
-
const Xt = typeof zt == "function" ? zt(/* @__PURE__ */ a(
|
|
601
|
+
const Xt = typeof zt == "function" ? zt(/* @__PURE__ */ a(ne, { ...rt })) : /* @__PURE__ */ a("div", { className: sr, children: /* @__PURE__ */ a(ne, { ...rt }) }), Jt = N !== !1 && (H.length !== 0 || rt.total > 0);
|
|
602
602
|
return /* @__PURE__ */ a(
|
|
603
603
|
"div",
|
|
604
604
|
{
|
|
605
605
|
ref: _,
|
|
606
|
-
style:
|
|
607
|
-
className:
|
|
606
|
+
style: ue,
|
|
607
|
+
className: nr,
|
|
608
608
|
...hr(x),
|
|
609
609
|
children: /* @__PURE__ */ v(
|
|
610
610
|
gr,
|
|
611
611
|
{
|
|
612
612
|
className: `${n}-spin`,
|
|
613
|
-
element:
|
|
613
|
+
element: ae,
|
|
614
614
|
...st,
|
|
615
615
|
children: [
|
|
616
616
|
Jt && Ft && Xt,
|
|
617
|
-
|
|
617
|
+
tr(),
|
|
618
618
|
Jt && !Ft && Xt
|
|
619
619
|
]
|
|
620
620
|
}
|
|
@@ -622,7 +622,7 @@ function kr(P, le) {
|
|
|
622
622
|
}
|
|
623
623
|
);
|
|
624
624
|
}
|
|
625
|
-
const Or =
|
|
625
|
+
const Or = dr(kr);
|
|
626
626
|
Or.displayName = "Table";
|
|
627
627
|
export {
|
|
628
628
|
Or as default
|