bitz-react-admin-ui 2.7.1 → 2.7.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/_virtual/index.mjs +2 -2
- package/dist/_virtual/index2.mjs +2 -2
- package/dist/components/BitzTable/Store/index.mjs +168 -167
- package/dist/components/BitzTable/SubTable/index.d.ts +1 -0
- package/dist/components/BitzTable/SubTable/index.mjs +82 -76
- package/dist/components/BitzTable/Table/index.mjs +113 -109
- package/dist/components/BitzTable/Table/utils.mjs +32 -32
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/ScopeSwitch.mjs +9 -9
- package/dist/node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs +1 -1
- package/dist/node_modules/.store/prop-types@15.8.1/node_modules/prop-types/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,127 +1,133 @@
|
|
|
1
1
|
import { j as C } from "../../../node_modules/.store/react@18.3.1/node_modules/react/jsx-runtime.mjs";
|
|
2
|
-
import { useContext as L, useRef as
|
|
3
|
-
import { Table as
|
|
4
|
-
import
|
|
5
|
-
import { BitzTableContext as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
2
|
+
import { useContext as L, useRef as tt, useMemo as a, useCallback as j } from "react";
|
|
3
|
+
import { Table as et } from "antd";
|
|
4
|
+
import nt from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
|
+
import { BitzTableContext as rt, toolCols as ot } from "../Store/index.mjs";
|
|
6
|
+
import at from "../../../node_modules/.store/ahooks@3.8.0/node_modules/ahooks/es/useSize/index.mjs";
|
|
7
|
+
import st from "../../BitzTheme/index.mjs";
|
|
8
|
+
import it from "../../../node_modules/.store/antd@5.18.3/node_modules/antd/es/table/ExpandIcon.mjs";
|
|
9
9
|
import "../../../node_modules/.store/antd@5.18.3/node_modules/antd/es/config-provider/index.mjs";
|
|
10
|
-
import
|
|
11
|
-
import { getColumnsWithTool as
|
|
12
|
-
import { tablePaddingInline as
|
|
13
|
-
import
|
|
14
|
-
|
|
10
|
+
import lt from "../../../node_modules/.store/antd@5.18.3/node_modules/antd/locale/en_US.mjs";
|
|
11
|
+
import { getColumnsWithTool as ct, loopBuildSkeleton as ut } from "../Table/utils.mjs";
|
|
12
|
+
import { tablePaddingInline as mt } from "../../BitzConfigProvider/context.mjs";
|
|
13
|
+
import ft from "../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
|
|
14
|
+
import { ConfigContext as ht } from "../../../node_modules/.store/antd@5.18.3/node_modules/antd/es/config-provider/context.mjs";
|
|
15
|
+
function Wt({
|
|
15
16
|
dataSource: u,
|
|
16
17
|
columns: g,
|
|
17
|
-
loading:
|
|
18
|
-
scroll:
|
|
18
|
+
loading: i,
|
|
19
|
+
scroll: r,
|
|
19
20
|
components: f,
|
|
20
|
-
expandable:
|
|
21
|
+
expandable: l,
|
|
21
22
|
rowSelection: m,
|
|
22
|
-
...
|
|
23
|
+
...s
|
|
23
24
|
}) {
|
|
24
25
|
var p, W, E;
|
|
25
|
-
const { token: x } =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const { token: x } = st.useToken(), K = ((p = x.Table) == null ? void 0 : p.cellPaddingInline) ?? mt, { showColumnBorder: M, rowHoverable: P } = L(rt), h = tt(null), w = at((W = h.current) == null ? void 0 : W.nativeElement), q = a(() => {
|
|
27
|
+
if (r != null && r.auto)
|
|
28
|
+
return {
|
|
29
|
+
...ft(r, "auto"),
|
|
30
|
+
x: void 0
|
|
31
|
+
};
|
|
32
|
+
let t = (r == null ? void 0 : r.x) ?? 1e3;
|
|
33
|
+
return r != null && r.x ? { x: t, y: r.y || 400 } : r != null && r.y ? { x: t, y: r.y } : { x: t, y: 400 };
|
|
34
|
+
}, [r]), A = () => {
|
|
35
|
+
var o, n;
|
|
36
|
+
const t = (n = (o = h.current) == null ? void 0 : o.nativeElement) == null ? void 0 : n.querySelectorAll(
|
|
31
37
|
"& > .bitzTableContainerBody > .ant-table-wrapper.bitzTable > .ant-spin-nested-loading > .ant-spin-container > .ant-table > .ant-table-container > .ant-table-body > table > .ant-table-tbody > tr:not(.ant-table-measure-row, .ant-table-expanded-row)"
|
|
32
|
-
),
|
|
33
|
-
if (
|
|
38
|
+
), e = [];
|
|
39
|
+
if (t == null || t.forEach((c) => {
|
|
34
40
|
var b;
|
|
35
|
-
|
|
41
|
+
e.push(
|
|
36
42
|
((b = c.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
|
|
37
43
|
);
|
|
38
|
-
}),
|
|
39
|
-
return Math.ceil(Math.max(...
|
|
44
|
+
}), e.length)
|
|
45
|
+
return Math.ceil(Math.max(...e)) + K * 2;
|
|
40
46
|
}, $ = () => {
|
|
41
|
-
var b,
|
|
42
|
-
const
|
|
47
|
+
var b, v, I, N, D;
|
|
48
|
+
const t = (v = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : v.querySelector(
|
|
43
49
|
".ant-table-body"
|
|
44
|
-
),
|
|
50
|
+
), e = t == null ? void 0 : t.clientWidth, n = ((t == null ? void 0 : t.offsetWidth) || 0) - e > 0, c = (D = (N = (I = h.current) == null ? void 0 : I.nativeElement) == null ? void 0 : N.querySelector(
|
|
45
51
|
".ant-table-cell-scrollbar"
|
|
46
52
|
)) == null ? void 0 : D.offsetWidth;
|
|
47
|
-
return { tbodyWidth:
|
|
48
|
-
}, { hasScrollBar: R, scrollbarSize: k } =
|
|
49
|
-
const { hasScrollBar:
|
|
53
|
+
return { tbodyWidth: e, scrollbarSize: c, hasScrollBar: n };
|
|
54
|
+
}, { hasScrollBar: R, scrollbarSize: k } = a(() => {
|
|
55
|
+
const { hasScrollBar: t, scrollbarSize: e } = $();
|
|
50
56
|
return {
|
|
51
|
-
hasScrollBar:
|
|
52
|
-
scrollbarSize:
|
|
57
|
+
hasScrollBar: t,
|
|
58
|
+
scrollbarSize: e
|
|
53
59
|
};
|
|
54
|
-
}, [w == null ? void 0 : w.height]), d =
|
|
55
|
-
const
|
|
60
|
+
}, [w == null ? void 0 : w.height]), d = a(() => {
|
|
61
|
+
const t = g ?? [], o = t.filter((n) => !ot.includes(n)).map((n) => ({
|
|
56
62
|
...n,
|
|
57
63
|
width: n.useMaxWidth ? A() ?? n.width : n.width
|
|
58
64
|
}));
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
return ct(
|
|
66
|
+
t,
|
|
67
|
+
o,
|
|
62
68
|
!1,
|
|
63
69
|
!!m,
|
|
64
|
-
!!
|
|
70
|
+
!!l
|
|
65
71
|
);
|
|
66
|
-
}, [g]), S =
|
|
67
|
-
const
|
|
68
|
-
return Array.from({ length:
|
|
72
|
+
}, [g]), S = a(() => ut(d), [d]), F = a(() => i ? S : d, [i, d, S]), z = a(() => {
|
|
73
|
+
const t = (u == null ? void 0 : u.length) ?? 0, e = t > 4 ? t >= 8 ? 8 : t : 4;
|
|
74
|
+
return Array.from({ length: e }).map((n, c) => ({
|
|
69
75
|
key: `${Date.now()}${c}`
|
|
70
76
|
}));
|
|
71
|
-
}, [u]), G =
|
|
72
|
-
if (
|
|
77
|
+
}, [u]), G = a(() => i ? z : u, [i, u, z]), { table: y, locale: H = lt } = L(ht), _ = { ...H.Table }, J = ((E = y == null ? void 0 : y.expandable) == null ? void 0 : E.expandIcon) || (l == null ? void 0 : l.expandIcon) || it(_), B = a(() => {
|
|
78
|
+
if (l)
|
|
73
79
|
return {
|
|
74
|
-
...
|
|
80
|
+
...l,
|
|
75
81
|
expandedRowRender: () => /* @__PURE__ */ C.jsx(C.Fragment, {}),
|
|
76
|
-
expandIcon: (
|
|
77
|
-
const
|
|
82
|
+
expandIcon: (t) => {
|
|
83
|
+
const e = J(t);
|
|
78
84
|
return {
|
|
79
|
-
...
|
|
85
|
+
...e,
|
|
80
86
|
props: {
|
|
81
|
-
...
|
|
87
|
+
...e.props,
|
|
82
88
|
disabled: !0,
|
|
83
89
|
style: {
|
|
84
|
-
...
|
|
90
|
+
...e.props.style,
|
|
85
91
|
backgroundColor: x.colorBgContainerDisabled
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
};
|
|
89
95
|
}
|
|
90
96
|
};
|
|
91
|
-
}, [
|
|
97
|
+
}, [l]), O = a(() => i ? B : l, [i, l, B]), T = a(() => {
|
|
92
98
|
if (m)
|
|
93
99
|
return {
|
|
94
100
|
...m,
|
|
95
101
|
selectedRowKeys: [],
|
|
96
102
|
getCheckboxProps: () => ({ disabled: !0 })
|
|
97
103
|
};
|
|
98
|
-
}, [m]), Q =
|
|
99
|
-
(
|
|
104
|
+
}, [m]), Q = a(() => i ? T : m, [i, m, T]), U = a(() => i ? void 0 : s.rowKey, [i, s.rowKey]), V = j(
|
|
105
|
+
(t, e) => {
|
|
100
106
|
var n;
|
|
101
|
-
if (!
|
|
107
|
+
if (!s.onRow)
|
|
102
108
|
return {};
|
|
103
|
-
const
|
|
104
|
-
return
|
|
109
|
+
const o = (n = s.onRow) == null ? void 0 : n.call(s, t, e);
|
|
110
|
+
return o.onClick && (o.className = "rowPointerCursor"), o;
|
|
105
111
|
},
|
|
106
|
-
[
|
|
112
|
+
[s.onRow]
|
|
107
113
|
), X = j(
|
|
108
|
-
(
|
|
109
|
-
const n =
|
|
110
|
-
if (
|
|
111
|
-
const c =
|
|
112
|
-
return
|
|
114
|
+
(t, e, o) => {
|
|
115
|
+
const n = e % 2 === 0 ? "oddRow" : "evenRow";
|
|
116
|
+
if (s.rowClassName) {
|
|
117
|
+
const c = s.rowClassName(t, e, o);
|
|
118
|
+
return nt(n, c);
|
|
113
119
|
}
|
|
114
120
|
return n;
|
|
115
121
|
},
|
|
116
|
-
[
|
|
117
|
-
), Y = (
|
|
118
|
-
var
|
|
119
|
-
const
|
|
120
|
-
return
|
|
121
|
-
...
|
|
122
|
-
right:
|
|
123
|
-
}), /* @__PURE__ */ C.jsx("th", { ...
|
|
124
|
-
}, Z =
|
|
122
|
+
[s.rowClassName]
|
|
123
|
+
), Y = (t) => {
|
|
124
|
+
var o;
|
|
125
|
+
const e = { ...t };
|
|
126
|
+
return e.className.includes("ant-table-cell-fix-right") && !R && ((o = e.style) != null && o.right) && (e.style = {
|
|
127
|
+
...e.style,
|
|
128
|
+
right: e.style.right - (k || 0)
|
|
129
|
+
}), /* @__PURE__ */ C.jsx("th", { ...e });
|
|
130
|
+
}, Z = a(() => ({
|
|
125
131
|
...f,
|
|
126
132
|
header: {
|
|
127
133
|
...f == null ? void 0 : f.header,
|
|
@@ -129,9 +135,9 @@ function Te({
|
|
|
129
135
|
}
|
|
130
136
|
}), [f, R, k]);
|
|
131
137
|
return /* @__PURE__ */ C.jsx(
|
|
132
|
-
|
|
138
|
+
et,
|
|
133
139
|
{
|
|
134
|
-
...
|
|
140
|
+
...s,
|
|
135
141
|
bordered: M,
|
|
136
142
|
columns: F,
|
|
137
143
|
dataSource: G,
|
|
@@ -150,5 +156,5 @@ function Te({
|
|
|
150
156
|
);
|
|
151
157
|
}
|
|
152
158
|
export {
|
|
153
|
-
|
|
159
|
+
Wt as default
|
|
154
160
|
};
|