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