@unicom-cloud/ui 0.8.105 → 0.8.107
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/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/Modal.js +4 -2
- package/Segmented.js +4 -2
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/segmented/interface.d.ts +6 -0
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
package/table/Table.js
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import lr from "
|
|
4
|
-
import ir from "
|
|
5
|
-
import cr from "lodash/throttle";
|
|
6
|
-
import ar, { forwardRef as dr, useContext as fr, useMemo as le, useRef as w, useState as V, useImperativeHandle as ur, useCallback as pr, useEffect as Je } from "react";
|
|
1
|
+
import { jsx as c, jsxs as P, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
+
import sr from "lodash/debounce";
|
|
3
|
+
import lr from "lodash/throttle";
|
|
4
|
+
import ir, { forwardRef as ar, useContext as cr, useMemo as le, useRef as w, useState as V, useImperativeHandle as dr, useCallback as fr, useEffect as Je } from "react";
|
|
7
5
|
import "../config-provider/ConfigProvider.js";
|
|
8
|
-
import
|
|
6
|
+
import ur from "../components/common/hooks/useIsomorphicLayoutEffect.js";
|
|
9
7
|
import Qe from "../components/common/hooks/useMergeProps.js";
|
|
10
8
|
import Ze from "../components/common/hooks/useUpdateEffect.js";
|
|
11
9
|
import et from "../pagination/Pagination.js";
|
|
12
|
-
import
|
|
10
|
+
import pr from "../spin/index.js";
|
|
13
11
|
import tt from "@unicom-cloud/utils/class-name";
|
|
14
|
-
import { on as ie, off as
|
|
12
|
+
import { on as ie, off as ae } from "../components/common/utils/dom.js";
|
|
15
13
|
import "../components/common/utils/is.js";
|
|
16
|
-
import { pickDataAttributes as
|
|
17
|
-
import { resizeObserver as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { deepCloneData as
|
|
30
|
-
import
|
|
31
|
-
import { isPlainObject as
|
|
32
|
-
const
|
|
14
|
+
import { pickDataAttributes as mr } from "../components/common/utils/pick.js";
|
|
15
|
+
import { resizeObserver as gr } from "../components/common/utils/resizeObserver.js";
|
|
16
|
+
import ce from "./ColGroup.js";
|
|
17
|
+
import hr from "./hook/useColumns.js";
|
|
18
|
+
import yr from "./hook/useComponent.js";
|
|
19
|
+
import br from "./hook/useExpand.js";
|
|
20
|
+
import Cr from "./hook/useRowSelection.js";
|
|
21
|
+
import xr from "./hook/useSorter.js";
|
|
22
|
+
import Sr from "./hook/useStickyClassNames.js";
|
|
23
|
+
import wr from "./hook/useStickyOffsets.js";
|
|
24
|
+
import Fr from "./tbody/index.js";
|
|
25
|
+
import Pr from "./tfoot/index.js";
|
|
26
|
+
import $r from "./thead/index.js";
|
|
27
|
+
import { deepCloneData as Nr, getOriginData as C, getSorterPriority as rt, getSorterFn as ot, getScrollBarHeight as Tr, getScrollBarWidth as vr } from "./util.js";
|
|
28
|
+
import Dr from "../config-provider/context.js";
|
|
29
|
+
import { isPlainObject as u, isFunction as N, isNumber as nt, isArray as M } from "@unicom-cloud/utils/is";
|
|
30
|
+
const Br = [], Lr = [], zr = {
|
|
33
31
|
showHeader: !0,
|
|
34
32
|
border: !0,
|
|
35
33
|
hover: !0,
|
|
@@ -39,37 +37,37 @@ const zr = [], Rr = [], Hr = {
|
|
|
39
37
|
indentSize: 15,
|
|
40
38
|
showSorterTooltip: !0
|
|
41
39
|
};
|
|
42
|
-
function
|
|
40
|
+
function Rr(de, st) {
|
|
43
41
|
const {
|
|
44
42
|
getPrefixCls: lt,
|
|
45
43
|
loadingElement: it,
|
|
46
44
|
size: De,
|
|
47
|
-
tablePagination:
|
|
48
|
-
renderEmpty:
|
|
45
|
+
tablePagination: at,
|
|
46
|
+
renderEmpty: ct,
|
|
49
47
|
componentConfig: fe,
|
|
50
|
-
rtl:
|
|
51
|
-
} =
|
|
48
|
+
rtl: T
|
|
49
|
+
} = cr(Dr), p = Qe(
|
|
52
50
|
de,
|
|
53
|
-
|
|
51
|
+
zr,
|
|
54
52
|
fe?.Table
|
|
55
53
|
), v = Qe(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
u(de?.pagination) ? de?.pagination : {},
|
|
55
|
+
u(fe?.Table?.pagination) ? fe?.Table?.pagination : {},
|
|
56
|
+
at || {}
|
|
59
57
|
), {
|
|
60
58
|
style: dt,
|
|
61
59
|
className: ft,
|
|
62
60
|
component: ut,
|
|
63
|
-
border:
|
|
61
|
+
border: y,
|
|
64
62
|
borderCell: ue,
|
|
65
|
-
columns: Be =
|
|
66
|
-
data:
|
|
63
|
+
columns: Be = Lr,
|
|
64
|
+
data: m = Br,
|
|
67
65
|
scroll: l,
|
|
68
66
|
noDataElement: pt,
|
|
69
67
|
showHeader: mt,
|
|
70
68
|
stripe: gt,
|
|
71
69
|
hover: ht,
|
|
72
|
-
pagination:
|
|
70
|
+
pagination: F,
|
|
73
71
|
onChange: Y,
|
|
74
72
|
pagePosition: x,
|
|
75
73
|
childrenColumnName: E,
|
|
@@ -83,36 +81,36 @@ function Er(de, st) {
|
|
|
83
81
|
renderPagination: Re,
|
|
84
82
|
summary: pe,
|
|
85
83
|
rowKey: K
|
|
86
|
-
} =
|
|
87
|
-
() =>
|
|
88
|
-
[
|
|
89
|
-
), n = lt?.("table"), me =
|
|
84
|
+
} = p, He = le(
|
|
85
|
+
() => Nr(m, E),
|
|
86
|
+
[m, E]
|
|
87
|
+
), n = lt?.("table"), me = p.size || (["default", "middle", "small", "mini"].indexOf(De) > -1 ? De : "default"), B = w(null), b = w(null), ge = w(null), g = w(null), O = w(null), he = w(null), j = w(null), q = w(0), ye = w(!1), [Ee, d] = hr(p), { currentFilters: Ct, defaultSorters: xt } = zt(), [W, be] = V(1), [St, wt] = V(
|
|
90
88
|
v.pageSize || v.defaultPageSize || 10
|
|
91
|
-
), [ke, Oe] = V(Ct), [
|
|
89
|
+
), [ke, Oe] = V(Ct), [Ft, Pt] = V(0), [$t, Nt] = V([]), Ce = wr(d), [Tt, We] = Sr(
|
|
92
90
|
Ee,
|
|
93
91
|
d,
|
|
94
92
|
n
|
|
95
93
|
), {
|
|
96
|
-
currentSorter:
|
|
94
|
+
currentSorter: _,
|
|
97
95
|
activeSorters: f,
|
|
98
96
|
getNextActiveSorters: vt,
|
|
99
97
|
updateStateSorters: Dt
|
|
100
|
-
} =
|
|
98
|
+
} = xr(d, xt), { ComponentTable: U, ComponentBodyWrapper: Bt, ComponentHeaderWrapper: Lt } = yr(ut), xe = le(() => N(K) ? (e) => K(C(e)) : (e) => e[K], [K]);
|
|
101
99
|
function zt() {
|
|
102
100
|
const e = {};
|
|
103
101
|
let t = [];
|
|
104
102
|
return d.forEach((r) => {
|
|
105
103
|
const o = r.dataIndex || r.key;
|
|
106
104
|
if (r.defaultFilters && (e[o] = r.defaultFilters), r.filteredValue && (e[o] = r.filteredValue), "defaultSortOrder" in r || "sortOrder" in r) {
|
|
107
|
-
const s = rt(r.sorter),
|
|
105
|
+
const s = rt(r.sorter), a = "sortOrder" in r ? r.sortOrder : r.defaultSortOrder, i = {
|
|
108
106
|
field: o,
|
|
109
|
-
direction:
|
|
107
|
+
direction: a,
|
|
110
108
|
sorterFn: ot(r.sorter),
|
|
111
109
|
priority: s
|
|
112
110
|
};
|
|
113
|
-
|
|
114
|
-
(
|
|
115
|
-
) && t.push(i) : t.every((
|
|
111
|
+
a ? nt(s) ? t.every(
|
|
112
|
+
(h) => nt(h.priority) || !h.direction
|
|
113
|
+
) && t.push(i) : t.every((h) => !h.direction) ? t.push(i) : t = [i] : t.push(i);
|
|
116
114
|
}
|
|
117
115
|
}), { currentFilters: e, defaultSorters: t };
|
|
118
116
|
}
|
|
@@ -124,7 +122,7 @@ function Er(de, st) {
|
|
|
124
122
|
const s = r.key || r.dataIndex || o;
|
|
125
123
|
s !== void 0 && (t[s] = r.filteredValue);
|
|
126
124
|
}), t;
|
|
127
|
-
}, [d]),
|
|
125
|
+
}, [d]), $ = le(() => Object.keys(G).length ? G : ke, [ke, G]);
|
|
128
126
|
function Rt(e, t) {
|
|
129
127
|
const r = Ye(t);
|
|
130
128
|
if (!r)
|
|
@@ -136,29 +134,29 @@ function Er(de, st) {
|
|
|
136
134
|
priority: rt(r.sorter)
|
|
137
135
|
}, s = vt(o);
|
|
138
136
|
Dt(o, s);
|
|
139
|
-
const
|
|
137
|
+
const a = Z(
|
|
140
138
|
o,
|
|
141
139
|
s,
|
|
142
|
-
|
|
143
|
-
), i =
|
|
144
|
-
Y?.(z(
|
|
140
|
+
$
|
|
141
|
+
), i = A(a);
|
|
142
|
+
Y?.(z(a), o, $, {
|
|
145
143
|
currentData: C(i),
|
|
146
|
-
currentAllData: C(
|
|
144
|
+
currentAllData: C(a),
|
|
147
145
|
action: "sort"
|
|
148
146
|
});
|
|
149
147
|
}
|
|
150
148
|
function Ht(e) {
|
|
151
149
|
const t = function(o, s) {
|
|
152
|
-
return (
|
|
153
|
-
const
|
|
154
|
-
return s === "descend" ? -
|
|
150
|
+
return (a, i) => {
|
|
151
|
+
const h = o(a, i);
|
|
152
|
+
return s === "descend" ? -h : h;
|
|
155
153
|
};
|
|
156
154
|
}, r = [...e];
|
|
157
155
|
return r.sort((o, s) => s.priority - o.priority), (o, s) => {
|
|
158
|
-
for (let
|
|
159
|
-
const { sorterFn:
|
|
160
|
-
if (
|
|
161
|
-
const se = t(
|
|
156
|
+
for (let a = 0, i = r.length; a < i; a++) {
|
|
157
|
+
const { sorterFn: h, direction: Te } = r[a];
|
|
158
|
+
if (!N(h)) continue;
|
|
159
|
+
const se = t(h, Te)(o, s);
|
|
162
160
|
if (se !== 0)
|
|
163
161
|
return se;
|
|
164
162
|
}
|
|
@@ -167,7 +165,7 @@ function Er(de, st) {
|
|
|
167
165
|
}
|
|
168
166
|
function Et(e, t) {
|
|
169
167
|
const r = {
|
|
170
|
-
|
|
168
|
+
...$,
|
|
171
169
|
[e.dataIndex]: t
|
|
172
170
|
}, o = {
|
|
173
171
|
...r,
|
|
@@ -176,32 +174,32 @@ function Er(de, st) {
|
|
|
176
174
|
if (M(t) && t.length) {
|
|
177
175
|
Oe(o);
|
|
178
176
|
const s = Z(
|
|
179
|
-
|
|
177
|
+
_,
|
|
180
178
|
f,
|
|
181
179
|
r
|
|
182
|
-
),
|
|
180
|
+
), a = A(s);
|
|
183
181
|
Y?.(
|
|
184
182
|
z(s),
|
|
185
183
|
f.length === 1 ? f[0] : f,
|
|
186
184
|
r,
|
|
187
185
|
{
|
|
188
|
-
currentData: C(
|
|
186
|
+
currentData: C(a),
|
|
189
187
|
currentAllData: C(s),
|
|
190
188
|
action: "filter"
|
|
191
189
|
}
|
|
192
190
|
);
|
|
193
|
-
} else M(t) && !t.length &&
|
|
191
|
+
} else M(t) && !t.length && _e(e);
|
|
194
192
|
}
|
|
195
|
-
function
|
|
193
|
+
function _e({ dataIndex: e }) {
|
|
196
194
|
const t = {
|
|
197
|
-
|
|
195
|
+
...$
|
|
198
196
|
};
|
|
199
197
|
delete t[e], Oe(t);
|
|
200
198
|
const r = Z(
|
|
201
|
-
|
|
199
|
+
_,
|
|
202
200
|
f,
|
|
203
201
|
t
|
|
204
|
-
), o =
|
|
202
|
+
), o = A(r);
|
|
205
203
|
Y?.(
|
|
206
204
|
z(r),
|
|
207
205
|
f.length === 1 ? f[0] : f,
|
|
@@ -216,67 +214,67 @@ function Er(de, st) {
|
|
|
216
214
|
const X = !!d.find((e) => e.fixed === "left"), J = !!d.find((e) => e.fixed === "right"), Q = X || J;
|
|
217
215
|
function Z(e, t, r) {
|
|
218
216
|
let o = (He || []).slice();
|
|
219
|
-
Object.keys(r).forEach((
|
|
220
|
-
if (r[
|
|
221
|
-
const i = Ye(
|
|
222
|
-
i &&
|
|
223
|
-
(
|
|
217
|
+
Object.keys(r).forEach((a) => {
|
|
218
|
+
if (r[a] && r[a].length) {
|
|
219
|
+
const i = Ye(a);
|
|
220
|
+
i && N(i.onFilter) && (o = o.filter((h) => r[a].reduce(
|
|
221
|
+
(Te, se) => Te || i.onFilter(se, h),
|
|
224
222
|
!1
|
|
225
223
|
)));
|
|
226
224
|
}
|
|
227
225
|
});
|
|
228
|
-
const s = (
|
|
226
|
+
const s = (a) => a.slice().sort(Ht(t)).map((i) => M(i[E]) ? {
|
|
229
227
|
...i,
|
|
230
228
|
[E]: s(i[E])
|
|
231
229
|
} : i);
|
|
232
|
-
return e.direction &&
|
|
230
|
+
return e.direction && N(e.sorterFn) || t.length ? s(o) : o;
|
|
233
231
|
}
|
|
234
232
|
const L = Z(
|
|
235
|
-
|
|
233
|
+
_,
|
|
236
234
|
f,
|
|
237
|
-
|
|
235
|
+
$
|
|
238
236
|
);
|
|
239
237
|
function z(e = L) {
|
|
240
238
|
const t = v.pageSize || St || 10, r = me === "middle" ? "default" : me;
|
|
241
239
|
let o = "top";
|
|
242
240
|
x === "tl" || x === "bl" ? o = "bottom" : o = "top";
|
|
243
|
-
const s = M(e) ? e.length : 0,
|
|
244
|
-
|
|
241
|
+
const s = M(e) ? e.length : 0, a = Math.ceil(s / t) < W ? 1 : W;
|
|
242
|
+
a !== W && be(a);
|
|
245
243
|
let i = {
|
|
246
244
|
size: r,
|
|
247
245
|
total: s,
|
|
248
246
|
pageSize: t,
|
|
249
|
-
current:
|
|
247
|
+
current: a,
|
|
250
248
|
selectProps: {
|
|
251
249
|
triggerProps: {
|
|
252
250
|
position: o
|
|
253
251
|
}
|
|
254
252
|
}
|
|
255
253
|
};
|
|
256
|
-
return typeof
|
|
254
|
+
return typeof F == "object" && F.selectProps && (i.selectProps = {
|
|
257
255
|
...i.selectProps,
|
|
258
|
-
...
|
|
259
|
-
}),
|
|
256
|
+
...F.selectProps
|
|
257
|
+
}), u(F) && (i = {
|
|
260
258
|
...i,
|
|
261
|
-
...
|
|
262
|
-
}),
|
|
259
|
+
...F
|
|
260
|
+
}), u(v) && (i = {
|
|
263
261
|
...i,
|
|
264
262
|
...v
|
|
265
263
|
}), i.onChange = Kt, i;
|
|
266
264
|
}
|
|
267
|
-
const ee = z(), R =
|
|
268
|
-
function
|
|
265
|
+
const ee = z(), R = A();
|
|
266
|
+
function A(e = L, t = ee) {
|
|
269
267
|
const { current: r = 0, pageSize: o = 10 } = t;
|
|
270
|
-
return
|
|
268
|
+
return F === !1 || u(F) && m.length <= o ? e : e.slice((r - 1) * o, r * o);
|
|
271
269
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
const e = B.current, t =
|
|
270
|
+
const Ae = sr(Ie, 100), S = !!(l && l.y), I = pe?.(C(L)), Se = pe && ir.isValidElement(I) && I.props.fixed, kt = S && Se;
|
|
271
|
+
ur(() => {
|
|
272
|
+
Ie(), ie(window, "resize", Ae);
|
|
273
|
+
const e = B.current, t = b.current, r = g.current;
|
|
276
274
|
t && ie(t, "scroll", H);
|
|
277
275
|
const o = e && e.parentNode;
|
|
278
276
|
return e && o && ie(o, "scroll", H), r && ie(r, "scroll", H), () => {
|
|
279
|
-
|
|
277
|
+
ae(window, "resize", Ae), t && ae(t, "scroll", H), o && ae(o, "scroll", H), r && ae(r, "scroll", H);
|
|
280
278
|
};
|
|
281
279
|
}, [
|
|
282
280
|
X,
|
|
@@ -284,13 +282,13 @@ function Er(de, st) {
|
|
|
284
282
|
l?.x,
|
|
285
283
|
l?.y,
|
|
286
284
|
d.length,
|
|
287
|
-
|
|
285
|
+
m
|
|
288
286
|
]), Ze(() => {
|
|
289
|
-
const { total: e, pageSize: t } = z(
|
|
287
|
+
const { total: e, pageSize: t } = z(m);
|
|
290
288
|
Math.ceil(e / t) < W && be(1);
|
|
291
|
-
}, [
|
|
289
|
+
}, [m?.length]), Ze(() => {
|
|
292
290
|
te();
|
|
293
|
-
}, [
|
|
291
|
+
}, [m, X, J, T]), dr(st, () => ({
|
|
294
292
|
getRootDomElement: we,
|
|
295
293
|
scrollIntoView: (e) => {
|
|
296
294
|
he.current && he.current.scrollTo({ key: e });
|
|
@@ -300,28 +298,28 @@ function Er(de, st) {
|
|
|
300
298
|
function we() {
|
|
301
299
|
return O.current;
|
|
302
300
|
}
|
|
303
|
-
function
|
|
301
|
+
function Ie() {
|
|
304
302
|
te();
|
|
305
303
|
const e = we();
|
|
306
304
|
if (e && (Q || l && l.x)) {
|
|
307
305
|
const r = (e.querySelector(`.${n}-body`) || e.querySelector(`.${n}-content-inner`))?.getBoundingClientRect?.()?.width;
|
|
308
|
-
|
|
306
|
+
Pt(r);
|
|
309
307
|
}
|
|
310
308
|
}
|
|
311
|
-
const Ot =
|
|
312
|
-
|
|
313
|
-
const e = O.current, t = S ?
|
|
309
|
+
const Ot = fr(
|
|
310
|
+
lr(() => {
|
|
311
|
+
const e = O.current, t = S ? b.current : j.current && j.current.parentNode;
|
|
314
312
|
if (t) {
|
|
315
|
-
const r =
|
|
313
|
+
const r = T ? -t.scrollLeft : t.scrollLeft, o = r === 0, s = r + 1 >= t.children[0].getBoundingClientRect().width - t.getBoundingClientRect().width;
|
|
316
314
|
o && s ? re(
|
|
317
315
|
e.classList,
|
|
318
316
|
`${n}-scroll-position-both`
|
|
319
317
|
) : o ? re(
|
|
320
318
|
e.classList,
|
|
321
|
-
`${n}-scroll-position-${
|
|
319
|
+
`${n}-scroll-position-${T ? "right" : "left"}`
|
|
322
320
|
) : s ? re(
|
|
323
321
|
e.classList,
|
|
324
|
-
`${n}-scroll-position-${
|
|
322
|
+
`${n}-scroll-position-${T ? "left" : "right"}`
|
|
325
323
|
) : re(
|
|
326
324
|
e.classList,
|
|
327
325
|
`${n}-scroll-position-middle`
|
|
@@ -329,10 +327,10 @@ function Er(de, st) {
|
|
|
329
327
|
} else
|
|
330
328
|
e && Me(e.classList);
|
|
331
329
|
}, 100),
|
|
332
|
-
[O.current,
|
|
330
|
+
[O.current, b.current, S, T]
|
|
333
331
|
);
|
|
334
332
|
function te() {
|
|
335
|
-
if (Q || l &&
|
|
333
|
+
if (Q || l && u(l) && l.x) {
|
|
336
334
|
const e = O.current;
|
|
337
335
|
e && (X && Ve(
|
|
338
336
|
e.classList,
|
|
@@ -353,28 +351,28 @@ function Er(de, st) {
|
|
|
353
351
|
e.contains(t) || (Me(e), e.add(t));
|
|
354
352
|
}
|
|
355
353
|
const {
|
|
356
|
-
selectedRowKeys:
|
|
354
|
+
selectedRowKeys: Fe,
|
|
357
355
|
indeterminateKeys: Wt,
|
|
358
|
-
onCheckAll:
|
|
359
|
-
onCheck:
|
|
360
|
-
onCheckRadio:
|
|
356
|
+
onCheckAll: _t,
|
|
357
|
+
onCheck: At,
|
|
358
|
+
onCheckRadio: It,
|
|
361
359
|
setSelectedRowKeys: Vt,
|
|
362
360
|
allSelectedRowKeys: Mt,
|
|
363
361
|
flattenData: Yt
|
|
364
|
-
} =
|
|
362
|
+
} = Cr(p, R, He, xe);
|
|
365
363
|
function Ye(e) {
|
|
366
364
|
return d.find((t, r) => typeof t.key < "u" ? typeof t.key == "number" && typeof e == "string" ? t.key.toString() === e : t.key === e : typeof t.dataIndex < "u" ? t.dataIndex === e : typeof e == "number" ? r === e : !1);
|
|
367
365
|
}
|
|
368
366
|
function Kt(e, t) {
|
|
369
|
-
be(e), wt(t), e !== W && jt(), k && !k.checkCrossPage &&
|
|
367
|
+
be(e), wt(t), e !== W && jt(), k && !k.checkCrossPage && Fe.length && (Vt([]), k.onChange?.([], []));
|
|
370
368
|
const r = { ...z(), current: e, pageSize: t };
|
|
371
369
|
Y?.(
|
|
372
370
|
r,
|
|
373
371
|
f.length === 1 ? f[0] : f,
|
|
374
|
-
|
|
372
|
+
$,
|
|
375
373
|
{
|
|
376
374
|
currentData: C(
|
|
377
|
-
|
|
375
|
+
A(L, r)
|
|
378
376
|
),
|
|
379
377
|
currentAllData: C(L),
|
|
380
378
|
action: "paginate"
|
|
@@ -382,82 +380,72 @@ function Er(de, st) {
|
|
|
382
380
|
), v.onChange?.(e, t);
|
|
383
381
|
}
|
|
384
382
|
function jt() {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const t = u.current.scrollTop;
|
|
388
|
-
new sr({
|
|
389
|
-
from: { scrollTop: t },
|
|
390
|
-
to: { scrollTop: 0 },
|
|
391
|
-
easing: lr.quintInOut,
|
|
392
|
-
duration: 300,
|
|
393
|
-
onUpdate: (o) => {
|
|
394
|
-
u.current && (u.current.scrollTop = o.scrollTop);
|
|
395
|
-
}
|
|
396
|
-
}).start();
|
|
383
|
+
const e = b.current;
|
|
384
|
+
e && e.scrollTo({ top: 0, behavior: "smooth" });
|
|
397
385
|
}
|
|
398
386
|
function H(e) {
|
|
399
|
-
const { target: t } = e, r =
|
|
387
|
+
const { target: t } = e, r = b.current, o = B.current && B.current.parentNode, s = g.current;
|
|
400
388
|
t.scrollLeft !== q.current && (o && (o.scrollLeft = t.scrollLeft), r && (r.scrollLeft = t.scrollLeft), s && (s.scrollLeft = t.scrollLeft), te()), q.current = e.target.scrollLeft;
|
|
401
389
|
}
|
|
402
390
|
function qt(e) {
|
|
403
391
|
const { target: t } = e, r = j.current;
|
|
404
392
|
t.scrollLeft !== q.current && (r.scrollLeft = t.scrollLeft, te()), q.current = e.target.scrollLeft;
|
|
405
393
|
}
|
|
406
|
-
const [Ke, Ut] =
|
|
407
|
-
|
|
394
|
+
const [Ke, Ut] = br(
|
|
395
|
+
p,
|
|
408
396
|
Yt,
|
|
409
397
|
xe
|
|
410
398
|
);
|
|
411
|
-
let je = {},
|
|
412
|
-
l && (l.x && (typeof l.x == "number" || typeof l.x == "string") && (
|
|
399
|
+
let je = {}, Pe = {};
|
|
400
|
+
l && (l.x && (typeof l.x == "number" || typeof l.x == "string") && (Pe = {
|
|
413
401
|
width: l.x
|
|
414
402
|
}), l.y && (typeof l.y == "number" || typeof l.y == "string") && (je = {
|
|
415
403
|
maxHeight: l.y
|
|
416
404
|
}));
|
|
417
405
|
function Gt() {
|
|
418
406
|
requestAnimationFrame((e) => {
|
|
419
|
-
const t = B.current && B.current.parentNode, r =
|
|
420
|
-
r && r > 0 && (t.style.marginBottom = `-${r}px`, t.style.paddingBottom = "0px",
|
|
421
|
-
const o =
|
|
422
|
-
|
|
407
|
+
const t = B.current && B.current.parentNode, r = Tr(t);
|
|
408
|
+
r && r > 0 && (t.style.marginBottom = `-${r}px`, t.style.paddingBottom = "0px", g.current && (g.current.style.marginBottom = `-${r}px`, g.current.style.paddingBottom = "0px")), setTimeout(() => {
|
|
409
|
+
const o = b.current;
|
|
410
|
+
vr(o) ? (ye.current = !0, t && (t.style.overflowY = "scroll", t.style.scrollSnapType = "y mandatory"), g.current && (g.current.style.overflowY = "scroll", g.current.style.overflowY = "y mandatory")) : t && ye.current && (ye.current = !1, t.style.overflowY = "auto", t.style.overflowY = "y mandatory", g.current && (g.current.style.overflowY = "auto", g.current.style.overflowY = "y mandatory"));
|
|
423
411
|
}, 0);
|
|
424
412
|
});
|
|
425
413
|
}
|
|
426
|
-
const qe = /* @__PURE__ */
|
|
427
|
-
|
|
414
|
+
const qe = /* @__PURE__ */ c(
|
|
415
|
+
$r,
|
|
428
416
|
{
|
|
429
|
-
...
|
|
417
|
+
...p,
|
|
430
418
|
activeSorters: f,
|
|
431
|
-
currentSorter:
|
|
432
|
-
selectedRowKeys:
|
|
433
|
-
currentFilters:
|
|
434
|
-
onCheckAll:
|
|
419
|
+
currentSorter: _,
|
|
420
|
+
selectedRowKeys: Fe,
|
|
421
|
+
currentFilters: $,
|
|
422
|
+
onCheckAll: _t,
|
|
435
423
|
onSort: Rt,
|
|
436
424
|
data: R,
|
|
437
425
|
onHandleFilter: Et,
|
|
438
|
-
onHandleFilterReset:
|
|
426
|
+
onHandleFilterReset: _e,
|
|
439
427
|
prefixCls: n,
|
|
440
428
|
allSelectedRowKeys: Mt,
|
|
441
429
|
groupColumns: Ee,
|
|
442
430
|
stickyOffsets: Ce,
|
|
443
|
-
groupStickyClassNames:
|
|
431
|
+
groupStickyClassNames: Tt
|
|
444
432
|
}
|
|
445
433
|
);
|
|
446
434
|
function Xt() {
|
|
447
|
-
const e =
|
|
448
|
-
return S || D ? /* @__PURE__ */
|
|
435
|
+
const e = u(l) && l.x === "max-content";
|
|
436
|
+
return S || D ? /* @__PURE__ */ c(Lt, { className: `${n}-header`, children: /* @__PURE__ */ P(
|
|
449
437
|
U,
|
|
450
438
|
{
|
|
451
439
|
ref: B,
|
|
452
|
-
style: e ? {} :
|
|
440
|
+
style: e ? {} : Pe,
|
|
453
441
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
|
|
442
|
+
/* @__PURE__ */ c(
|
|
443
|
+
ce,
|
|
456
444
|
{
|
|
457
445
|
columns: d,
|
|
458
446
|
prefixCls: n,
|
|
459
447
|
producer: !1,
|
|
460
|
-
columnWidths: e && l.y ?
|
|
448
|
+
columnWidths: e && l.y ? $t : null
|
|
461
449
|
}
|
|
462
450
|
),
|
|
463
451
|
qe
|
|
@@ -465,8 +453,8 @@ function Er(de, st) {
|
|
|
465
453
|
}
|
|
466
454
|
) }) : qe;
|
|
467
455
|
}
|
|
468
|
-
const Ue =
|
|
469
|
-
|
|
456
|
+
const Ue = I && /* @__PURE__ */ c(
|
|
457
|
+
Pr,
|
|
470
458
|
{
|
|
471
459
|
prefixCls: n,
|
|
472
460
|
summary: pe,
|
|
@@ -475,63 +463,63 @@ function Er(de, st) {
|
|
|
475
463
|
stickyOffsets: Ce,
|
|
476
464
|
stickyClassNames: We
|
|
477
465
|
}
|
|
478
|
-
), Ge = /* @__PURE__ */
|
|
479
|
-
|
|
466
|
+
), Ge = /* @__PURE__ */ c(
|
|
467
|
+
Fr,
|
|
480
468
|
{
|
|
481
|
-
...
|
|
469
|
+
...p,
|
|
482
470
|
saveRef: (e) => ge.current = e,
|
|
483
|
-
selectedRowKeys:
|
|
471
|
+
selectedRowKeys: Fe,
|
|
484
472
|
indeterminateKeys: Wt,
|
|
485
473
|
expandedRowKeys: Ke,
|
|
486
|
-
onCheck:
|
|
487
|
-
onCheckRadio:
|
|
474
|
+
onCheck: At,
|
|
475
|
+
onCheckRadio: It,
|
|
488
476
|
onClickExpandBtn: Ut,
|
|
489
477
|
columns: d,
|
|
490
478
|
data: R,
|
|
491
479
|
prefixCls: n,
|
|
492
480
|
hasFixedColumn: Q,
|
|
493
|
-
tableViewWidth:
|
|
481
|
+
tableViewWidth: Ft,
|
|
494
482
|
indentSize: yt,
|
|
495
|
-
noDataElement: pt ||
|
|
483
|
+
noDataElement: pt || ct("Table"),
|
|
496
484
|
activeSorters: f,
|
|
497
|
-
currentSorter:
|
|
485
|
+
currentSorter: _,
|
|
498
486
|
stickyOffsets: Ce,
|
|
499
487
|
stickyClassNames: We,
|
|
500
488
|
getRowKey: xe,
|
|
501
489
|
saveVirtualListRef: (e) => {
|
|
502
|
-
D && (he.current = e,
|
|
490
|
+
D && (he.current = e, b.current = e?.dom);
|
|
503
491
|
},
|
|
504
|
-
___dangerouslySetInnerHTML___:
|
|
492
|
+
___dangerouslySetInnerHTML___: p.___dangerouslySetInnerHTML___
|
|
505
493
|
}
|
|
506
|
-
), Xe = !D && !kt ? /* @__PURE__ */
|
|
494
|
+
), Xe = !D && !kt ? /* @__PURE__ */ P(ve, { children: [
|
|
507
495
|
Ge,
|
|
508
496
|
Ue
|
|
509
497
|
] }) : Ge;
|
|
510
498
|
if (Je(() => {
|
|
511
|
-
const e =
|
|
499
|
+
const e = b.current || ge.current, t = gr([e], Gt);
|
|
512
500
|
return () => {
|
|
513
501
|
t();
|
|
514
502
|
};
|
|
515
|
-
}, [
|
|
516
|
-
}), [
|
|
503
|
+
}, [b.current, ge.current]), Je(() => (p.consoleTable && console.table(m), () => {
|
|
504
|
+
}), [m, p.consoleTable]), !Be.length) return null;
|
|
517
505
|
function Jt() {
|
|
518
|
-
const e =
|
|
519
|
-
return S && !D ? /* @__PURE__ */
|
|
506
|
+
const e = u(l) && l.x === "max-content" && !!l.y && M(m) && m.length > 0;
|
|
507
|
+
return S && !D ? /* @__PURE__ */ c(
|
|
520
508
|
Bt,
|
|
521
509
|
{
|
|
522
|
-
ref:
|
|
510
|
+
ref: b,
|
|
523
511
|
className: `${n}-body`,
|
|
524
512
|
style: je,
|
|
525
|
-
children: /* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
|
|
513
|
+
children: /* @__PURE__ */ P(U, { style: Pe, children: [
|
|
514
|
+
/* @__PURE__ */ c(
|
|
515
|
+
ce,
|
|
528
516
|
{
|
|
529
517
|
columns: d,
|
|
530
518
|
prefixCls: n,
|
|
531
519
|
producer: e,
|
|
532
|
-
onSetColumnWidths:
|
|
520
|
+
onSetColumnWidths: Nt,
|
|
533
521
|
expandedRowKeys: Ke,
|
|
534
|
-
data:
|
|
522
|
+
data: m
|
|
535
523
|
}
|
|
536
524
|
),
|
|
537
525
|
Xe
|
|
@@ -541,85 +529,85 @@ function Er(de, st) {
|
|
|
541
529
|
}
|
|
542
530
|
function Qt() {
|
|
543
531
|
let e = {};
|
|
544
|
-
l &&
|
|
532
|
+
l && u(l) && l.x && (e = {
|
|
545
533
|
width: l.x
|
|
546
534
|
});
|
|
547
|
-
const t = /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
535
|
+
const t = /* @__PURE__ */ c("div", { className: `${n}-tfoot`, ref: g, children: /* @__PURE__ */ P(U, { style: e, children: [
|
|
536
|
+
/* @__PURE__ */ c(ce, { columns: d, prefixCls: n }),
|
|
549
537
|
Ue
|
|
550
|
-
] }) }), r =
|
|
538
|
+
] }) }), r = I && S && Se === "top", o = I && S && Se === "bottom", s = /* @__PURE__ */ P(ve, { children: [
|
|
551
539
|
mt ? Xt() : null,
|
|
552
540
|
r && t,
|
|
553
541
|
Jt(),
|
|
554
542
|
o && t
|
|
555
|
-
] }),
|
|
556
|
-
return /* @__PURE__ */
|
|
557
|
-
!!
|
|
558
|
-
/* @__PURE__ */
|
|
543
|
+
] }), a = N(Le) && Le(R), i = N(ze) && ze(R);
|
|
544
|
+
return /* @__PURE__ */ P(ve, { children: [
|
|
545
|
+
!!a && /* @__PURE__ */ c("div", { className: `${n}-header-`, children: a }),
|
|
546
|
+
/* @__PURE__ */ c("div", { className: `${n}-container`, children: /* @__PURE__ */ c("div", { className: `${n}-content-scroll`, children: /* @__PURE__ */ c(
|
|
559
547
|
"div",
|
|
560
548
|
{
|
|
561
549
|
className: `${n}-content-inner`,
|
|
562
550
|
onScroll: S ? void 0 : qt,
|
|
563
|
-
children: S || D ? s : /* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
551
|
+
children: S || D ? s : /* @__PURE__ */ P(U, { ref: j, style: e, children: [
|
|
552
|
+
/* @__PURE__ */ c(ce, { prefixCls: n, columns: d }),
|
|
565
553
|
s
|
|
566
554
|
] })
|
|
567
555
|
}
|
|
568
556
|
) }) }),
|
|
569
|
-
!!i && /* @__PURE__ */
|
|
557
|
+
!!i && /* @__PURE__ */ c("div", { className: `${n}-footer`, children: i })
|
|
570
558
|
] });
|
|
571
559
|
}
|
|
572
|
-
const Zt =
|
|
560
|
+
const Zt = u(y) ? y.wrapper : y, $e = u(y) ? y.cell : ue, er = u(y) ? y.cell || y.headerCell : ue, tr = u(y) ? y.cell || y.bodyCell : ue, rr = tt(
|
|
573
561
|
n,
|
|
574
562
|
`${n}-size-${me}`,
|
|
575
563
|
{
|
|
576
564
|
[`${n}-border`]: Zt,
|
|
577
|
-
[`${n}-border-cell`]:
|
|
578
|
-
[`${n}-border-header-cell`]:
|
|
579
|
-
[`${n}-border-body-cell`]:
|
|
565
|
+
[`${n}-border-cell`]: $e,
|
|
566
|
+
[`${n}-border-header-cell`]: !$e && er,
|
|
567
|
+
[`${n}-border-body-cell`]: !$e && tr,
|
|
580
568
|
[`${n}-stripe`]: gt,
|
|
581
569
|
[`${n}-hover`]: ht,
|
|
582
570
|
[`${n}-type-radio`]: k && k.type === "radio",
|
|
583
571
|
[`${n}-layout-fixed`]: bt || l && (l.x || l.y) || Be.find((e) => e.ellipsis),
|
|
584
572
|
[`${n}-fixed-column`]: Q,
|
|
585
573
|
[`${n}-virtualized`]: D,
|
|
586
|
-
[`${n}-rtl`]:
|
|
574
|
+
[`${n}-rtl`]: T
|
|
587
575
|
},
|
|
588
576
|
ft
|
|
589
|
-
),
|
|
577
|
+
), Ne = x === "tl" || x === "tr" || x === "topCenter", or = tt(`${n}-pagination`, {
|
|
590
578
|
[`${n}-pagination-left`]: x === "tl" || x === "bl",
|
|
591
579
|
[`${n}-pagination-center`]: x === "topCenter" || x === "bottomCenter",
|
|
592
|
-
[`${n}-pagination-top`]:
|
|
580
|
+
[`${n}-pagination-top`]: Ne
|
|
593
581
|
});
|
|
594
|
-
let oe =
|
|
582
|
+
let oe = p.loading;
|
|
595
583
|
typeof oe == "boolean" && (oe = { loading: oe });
|
|
596
|
-
const nr =
|
|
584
|
+
const nr = F !== !1 && (L.length !== 0 || ee?.total > 0);
|
|
597
585
|
let ne;
|
|
598
|
-
return nr && (
|
|
586
|
+
return nr && (N(Re) ? ne = Re(/* @__PURE__ */ c(et, { ...ee })) : ne = /* @__PURE__ */ c("div", { className: or, children: /* @__PURE__ */ c(et, { ...ee }) })), /* @__PURE__ */ c(
|
|
599
587
|
"div",
|
|
600
588
|
{
|
|
601
589
|
ref: O,
|
|
602
590
|
style: dt,
|
|
603
591
|
className: rr,
|
|
604
|
-
...
|
|
605
|
-
children: /* @__PURE__ */
|
|
606
|
-
|
|
592
|
+
...mr(p),
|
|
593
|
+
children: /* @__PURE__ */ P(
|
|
594
|
+
pr,
|
|
607
595
|
{
|
|
608
596
|
className: `${n}-spin`,
|
|
609
597
|
element: it,
|
|
610
598
|
...oe,
|
|
611
599
|
children: [
|
|
612
|
-
|
|
600
|
+
Ne && ne,
|
|
613
601
|
Qt(),
|
|
614
|
-
|
|
602
|
+
!Ne && ne
|
|
615
603
|
]
|
|
616
604
|
}
|
|
617
605
|
)
|
|
618
606
|
}
|
|
619
607
|
);
|
|
620
608
|
}
|
|
621
|
-
const
|
|
622
|
-
|
|
609
|
+
const Hr = ar(Rr);
|
|
610
|
+
Hr.displayName = "Table";
|
|
623
611
|
export {
|
|
624
|
-
|
|
612
|
+
Hr as default
|
|
625
613
|
};
|