bitz-react-admin-ui 2.1.9 → 2.2.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.
- package/dist/components/BitzPagination/index.d.ts +4 -0
- package/dist/components/BitzPagination/index.mjs +22 -21
- package/dist/components/BitzTable/ActionBar/ActionBar.mjs +26 -22
- package/dist/components/BitzTable/ActionCol/index.d.ts +1 -1
- package/dist/components/BitzTable/ActionCol/index.mjs +61 -61
- package/dist/components/BitzTable/SelectionBar/Button.d.ts +2 -3
- package/dist/components/BitzTable/SelectionBar/Button.mjs +19 -25
- package/dist/components/BitzTable/SelectionBar/SelectionBar.mjs +19 -38
- package/dist/components/BitzTable/Store/index.d.ts +43 -22
- package/dist/components/BitzTable/Store/index.mjs +128 -125
- package/dist/components/BitzTable/Store/utils/index.d.ts +4 -5
- package/dist/components/BitzTable/Store/utils/index.mjs +31 -31
- package/dist/components/BitzTable/SubTable/index.mjs +90 -106
- package/dist/components/BitzTable/Table/SortTableContext.d.ts +12 -0
- package/dist/components/BitzTable/Table/SortTableContext.mjs +25 -0
- package/dist/components/BitzTable/Table/SortableRow.d.ts +7 -0
- package/dist/components/BitzTable/Table/SortableRow.mjs +54 -0
- package/dist/components/BitzTable/Table/index.d.ts +14 -1
- package/dist/components/BitzTable/Table/index.mjs +319 -273
- package/dist/components/BitzTable/Table/style.d.ts +2 -1
- package/dist/components/BitzTable/Table/style.mjs +17 -15
- package/dist/components/BitzTable/Table/utils.mjs +17 -16
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.d.ts +1 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnConfigModal.mjs +84 -97
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.d.ts +5 -4
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndItem.mjs +66 -60
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/DndList.mjs +78 -72
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.d.ts +1 -3
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnsSort/index.mjs +190 -189
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.d.ts +8 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndItem.mjs +94 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.d.ts +10 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/DndList.mjs +58 -0
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.d.ts +13 -7
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ExportConfig/index.mjs +119 -80
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/StylesConfig/index.d.ts +2 -2
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +26 -29
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.d.ts +3 -1
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/style.mjs +53 -77
- package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.d.ts +2 -2
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.d.ts +12 -0
- package/dist/components/BitzTable/ToolBar/ExportIcon/ExportModal.mjs +61 -0
- package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +50 -59
- package/dist/components/BitzTable/ToolBar/FullscreenIcon/index.mjs +22 -23
- package/dist/components/BitzTable/ToolBar/Modal/index.d.ts +18 -0
- package/dist/components/BitzTable/ToolBar/Modal/index.mjs +50 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.d.ts +2 -0
- package/dist/components/BitzTable/ToolBar/Modal/style.mjs +58 -0
- package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +21 -21
- package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +20 -22
- package/dist/components/BitzTable/ToolBar/index.d.ts +12 -11
- package/dist/components/BitzTable/ToolBar/style.mjs +41 -46
- package/dist/components/BitzTable/index.d.ts +4 -2
- package/dist/node_modules/.store/@ant-design_icons-svg@4.4.2/node_modules/@ant-design/icons-svg/es/asn/MenuOutlined.mjs +5 -0
- package/dist/node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs +15 -0
- package/dist/node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1098 -753
- package/dist/style.css +1 -1
- package/dist/utils/findNode.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/BitzTable/Select/index.mjs +0 -11
- package/dist/components/BitzTable/Select/style.mjs +0 -66
- package/dist/components/BitzTable/ToolBar/ExportIcon/AnyDataTotalLabel.mjs +0 -78
- package/dist/components/BitzTable/ToolBar/ExportIcon/styles.mjs +0 -47
|
@@ -1,91 +1,75 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { Table as
|
|
4
|
-
import
|
|
5
|
-
import { BitzTableContext as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { j as C } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useContext as D, useRef as et, useMemo as o, useCallback as I } from "react";
|
|
3
|
+
import { Table as g } from "antd";
|
|
4
|
+
import nt from "../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
5
|
+
import { BitzTableContext as rt } 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
|
-
const
|
|
15
|
-
function
|
|
16
|
-
dataSource:
|
|
17
|
-
columns:
|
|
18
|
-
loading:
|
|
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
|
+
const M = [g.SELECTION_COLUMN, g.EXPAND_COLUMN];
|
|
15
|
+
function Bt({
|
|
16
|
+
dataSource: u = [],
|
|
17
|
+
columns: x,
|
|
18
|
+
loading: l = !1,
|
|
19
19
|
scroll: s,
|
|
20
|
-
components:
|
|
21
|
-
expandable:
|
|
22
|
-
rowSelection:
|
|
20
|
+
components: f,
|
|
21
|
+
expandable: c,
|
|
22
|
+
rowSelection: m,
|
|
23
23
|
...a
|
|
24
24
|
}) {
|
|
25
|
-
var
|
|
26
|
-
const { token:
|
|
25
|
+
var T, N;
|
|
26
|
+
const { token: j } = at.useToken(), { gap: K } = st(), { showColumnBorder: q, rowHoverable: P } = D(rt), h = et(null), y = ot((T = h.current) == null ? void 0 : T.nativeElement), A = o(() => {
|
|
27
27
|
let t = (s == null ? void 0 : s.x) ?? 1e3;
|
|
28
28
|
return s != null && s.x ? { x: t, y: s.y || 400 } : s != null && s.y ? { x: t, y: s.y } : { x: t, y: 400 };
|
|
29
|
-
}, [s]),
|
|
30
|
-
var
|
|
31
|
-
const t = (
|
|
29
|
+
}, [s]), O = () => {
|
|
30
|
+
var r, n;
|
|
31
|
+
const t = (n = (r = h.current) == null ? void 0 : r.nativeElement) == null ? void 0 : n.querySelectorAll(
|
|
32
32
|
"& > .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)"
|
|
33
33
|
), e = [];
|
|
34
|
-
if (t == null || t.forEach((
|
|
35
|
-
var
|
|
34
|
+
if (t == null || t.forEach((i) => {
|
|
35
|
+
var b;
|
|
36
36
|
e.push(
|
|
37
|
-
((
|
|
37
|
+
((b = i.querySelector("& > .operationCol .actionGroup")) == null ? void 0 : b.clientWidth) || 0
|
|
38
38
|
);
|
|
39
39
|
}), e.length)
|
|
40
|
-
return Math.ceil(Math.max(...e)) +
|
|
41
|
-
},
|
|
42
|
-
var
|
|
43
|
-
const t = (
|
|
40
|
+
return Math.ceil(Math.max(...e)) + K * 2;
|
|
41
|
+
}, _ = () => {
|
|
42
|
+
var b, p, W, L, v;
|
|
43
|
+
const t = (p = (b = h.current) == null ? void 0 : b.nativeElement) == null ? void 0 : p.querySelector(
|
|
44
44
|
".ant-table-body"
|
|
45
|
-
), e = t == null ? void 0 : t.clientWidth,
|
|
45
|
+
), e = t == null ? void 0 : t.clientWidth, n = ((t == null ? void 0 : t.offsetWidth) || 0) - e > 0, i = (v = (L = (W = h.current) == null ? void 0 : W.nativeElement) == null ? void 0 : L.querySelector(
|
|
46
46
|
".ant-table-cell-scrollbar"
|
|
47
|
-
)) == null ? void 0 :
|
|
48
|
-
return { tbodyWidth: e, scrollbarSize:
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
const e = t.length, n = t.filter((m) => m.width), c = n.map((m) => m.width).reduce((m, k) => m + k, 0);
|
|
52
|
-
let u = 0;
|
|
53
|
-
if ((j = d.current) != null && j.nativeElement) {
|
|
54
|
-
const m = window.getComputedStyle((K = d.current) == null ? void 0 : K.nativeElement), k = parseInt(
|
|
55
|
-
m.getPropertyValue("--toolCell-paddingInline")
|
|
56
|
-
);
|
|
57
|
-
u = parseInt(m.getPropertyValue("--fontSize")) + 4 + 2 * k;
|
|
58
|
-
}
|
|
59
|
-
let b = 0;
|
|
60
|
-
h && (b += u), l && (b += u);
|
|
61
|
-
const { tbodyWidth: g } = I(), x = parseInt(`${C == null ? void 0 : C.x}`) || 0, p = Math.max(x, g), P = (parseInt(`${p}`) || 0) - c - b;
|
|
62
|
-
return P >= 0 ? P / (e - n.length) : void 0;
|
|
63
|
-
}, { hasScrollBar: B, scrollbarSize: T } = r(() => {
|
|
64
|
-
const { hasScrollBar: t, scrollbarSize: e } = I();
|
|
47
|
+
)) == null ? void 0 : v.offsetWidth;
|
|
48
|
+
return { tbodyWidth: e, scrollbarSize: i, hasScrollBar: n };
|
|
49
|
+
}, { hasScrollBar: R, scrollbarSize: S } = o(() => {
|
|
50
|
+
const { hasScrollBar: t, scrollbarSize: e } = _();
|
|
65
51
|
return {
|
|
66
52
|
hasScrollBar: t,
|
|
67
53
|
scrollbarSize: e
|
|
68
54
|
};
|
|
69
|
-
}, [
|
|
70
|
-
const t =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
...o,
|
|
74
|
-
width: o.useMaxWidth ? X() ?? o.width : o.width
|
|
55
|
+
}, [y == null ? void 0 : y.height]), d = o(() => {
|
|
56
|
+
const t = x ?? [], r = t.filter((n) => !M.includes(n)).map((n) => ({
|
|
57
|
+
...n,
|
|
58
|
+
width: n.useMaxWidth ? O() ?? n.width : n.width
|
|
75
59
|
}));
|
|
76
|
-
return
|
|
77
|
-
}, [
|
|
78
|
-
const t =
|
|
79
|
-
return Array.from({ length: e }).map((
|
|
80
|
-
key: `${Date.now()}${
|
|
60
|
+
return it(t, r, m, c);
|
|
61
|
+
}, [x]), k = o(() => ut(d, M), [d]), G = o(() => l ? k : d, [l, d, k]), z = o(() => {
|
|
62
|
+
const t = u == null ? void 0 : u.length, e = t > 4 ? t >= 8 ? 8 : t : 4;
|
|
63
|
+
return Array.from({ length: e }).map((n, i) => ({
|
|
64
|
+
key: `${Date.now()}${i}`
|
|
81
65
|
}));
|
|
82
|
-
}, [
|
|
83
|
-
if (
|
|
66
|
+
}, [u]), U = o(() => l ? z : u, [l, u, z]), { table: w, locale: $ = ct } = D(mt), F = { ...$.Table }, H = ((N = w == null ? void 0 : w.expandable) == null ? void 0 : N.expandIcon) || (c == null ? void 0 : c.expandIcon) || lt(F), B = o(() => {
|
|
67
|
+
if (c)
|
|
84
68
|
return {
|
|
85
|
-
...
|
|
86
|
-
expandedRowRender: () => /* @__PURE__ */
|
|
69
|
+
...c,
|
|
70
|
+
expandedRowRender: () => /* @__PURE__ */ C.jsx(C.Fragment, {}),
|
|
87
71
|
expandIcon: (t) => {
|
|
88
|
-
const e =
|
|
72
|
+
const e = H(t);
|
|
89
73
|
return {
|
|
90
74
|
...e,
|
|
91
75
|
props: {
|
|
@@ -93,73 +77,73 @@ function Nt({
|
|
|
93
77
|
disabled: !0,
|
|
94
78
|
style: {
|
|
95
79
|
...e.props.style,
|
|
96
|
-
backgroundColor:
|
|
80
|
+
backgroundColor: j.colorBgContainerDisabled
|
|
97
81
|
}
|
|
98
82
|
}
|
|
99
83
|
};
|
|
100
84
|
}
|
|
101
85
|
};
|
|
102
|
-
}, [
|
|
103
|
-
if (
|
|
86
|
+
}, [c]), X = o(() => l ? B : c, [l, c, B]), E = o(() => {
|
|
87
|
+
if (m)
|
|
104
88
|
return {
|
|
105
|
-
...
|
|
89
|
+
...m,
|
|
106
90
|
selectedRowKeys: [],
|
|
107
91
|
getCheckboxProps: () => ({ disabled: !0 })
|
|
108
92
|
};
|
|
109
|
-
}, [
|
|
93
|
+
}, [m]), J = o(() => l ? E : m, [l, m, E]), Q = o(() => l ? void 0 : a.rowKey, [l, a.rowKey]), V = I(
|
|
110
94
|
(t, e) => {
|
|
111
|
-
var
|
|
95
|
+
var n;
|
|
112
96
|
if (!a.onRow)
|
|
113
97
|
return {};
|
|
114
|
-
const
|
|
115
|
-
return
|
|
98
|
+
const r = (n = a.onRow) == null ? void 0 : n.call(a, t, e);
|
|
99
|
+
return r.onClick && (r.className = "rowPointerCursor"), r;
|
|
116
100
|
},
|
|
117
101
|
[a.onRow]
|
|
118
|
-
),
|
|
119
|
-
(t, e,
|
|
120
|
-
const
|
|
102
|
+
), Y = I(
|
|
103
|
+
(t, e, r) => {
|
|
104
|
+
const n = e % 2 === 0 ? "oddRow" : "evenRow";
|
|
121
105
|
if (a.rowClassName) {
|
|
122
|
-
const
|
|
123
|
-
return
|
|
106
|
+
const i = a.rowClassName(t, e, r);
|
|
107
|
+
return nt(n, i);
|
|
124
108
|
}
|
|
125
|
-
return
|
|
109
|
+
return n;
|
|
126
110
|
},
|
|
127
111
|
[a.rowClassName]
|
|
128
|
-
),
|
|
129
|
-
var
|
|
112
|
+
), Z = (t) => {
|
|
113
|
+
var r;
|
|
130
114
|
const e = { ...t };
|
|
131
|
-
return e.className.includes("ant-table-cell-fix-right") && !
|
|
115
|
+
return e.className.includes("ant-table-cell-fix-right") && !R && ((r = e.style) != null && r.right) && (e.style = {
|
|
132
116
|
...e.style,
|
|
133
|
-
right: e.style.right - (
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
-
},
|
|
136
|
-
...
|
|
117
|
+
right: e.style.right - (S || 0)
|
|
118
|
+
}), /* @__PURE__ */ C.jsx("th", { ...e });
|
|
119
|
+
}, tt = o(() => ({
|
|
120
|
+
...f,
|
|
137
121
|
header: {
|
|
138
|
-
...
|
|
139
|
-
cell:
|
|
122
|
+
...f == null ? void 0 : f.header,
|
|
123
|
+
cell: Z
|
|
140
124
|
}
|
|
141
|
-
}), [
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
|
|
125
|
+
}), [f, R, S]);
|
|
126
|
+
return /* @__PURE__ */ C.jsx(
|
|
127
|
+
g,
|
|
144
128
|
{
|
|
145
129
|
...a,
|
|
146
|
-
bordered:
|
|
147
|
-
columns:
|
|
148
|
-
dataSource:
|
|
130
|
+
bordered: q,
|
|
131
|
+
columns: G,
|
|
132
|
+
dataSource: U,
|
|
149
133
|
loading: !1,
|
|
150
134
|
pagination: !1,
|
|
151
|
-
scroll:
|
|
152
|
-
expandable:
|
|
153
|
-
rowSelection:
|
|
154
|
-
onRow:
|
|
155
|
-
rowClassName:
|
|
156
|
-
components:
|
|
157
|
-
rowKey:
|
|
158
|
-
rowHoverable:
|
|
159
|
-
ref:
|
|
135
|
+
scroll: A,
|
|
136
|
+
expandable: X,
|
|
137
|
+
rowSelection: J,
|
|
138
|
+
onRow: V,
|
|
139
|
+
rowClassName: Y,
|
|
140
|
+
components: tt,
|
|
141
|
+
rowKey: Q,
|
|
142
|
+
rowHoverable: P,
|
|
143
|
+
ref: h
|
|
160
144
|
}
|
|
161
145
|
);
|
|
162
146
|
}
|
|
163
147
|
export {
|
|
164
|
-
|
|
148
|
+
Bt as default
|
|
165
149
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DragEndEvent } from "@dnd-kit/core";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
interface SortTableContextProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
enabledRowDragSort?: boolean;
|
|
6
|
+
dataSource: any[];
|
|
7
|
+
mergeRowKey: string;
|
|
8
|
+
onDragEnd: (event: DragEndEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function SortTableContext({ children, enabledRowDragSort, dataSource, mergeRowKey, onDragEnd, }: SortTableContextProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const _default: import("react").MemoExoticComponent<typeof SortTableContext>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as t } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { DndContext as a } from "../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
|
|
3
|
+
import { restrictToVerticalAxis as n } from "../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
|
|
4
|
+
import { SortableContext as x, verticalListSortingStrategy as f } from "../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
5
|
+
import { memo as p } from "react";
|
|
6
|
+
function l({
|
|
7
|
+
children: r,
|
|
8
|
+
enabledRowDragSort: o,
|
|
9
|
+
dataSource: e,
|
|
10
|
+
mergeRowKey: m,
|
|
11
|
+
onDragEnd: i
|
|
12
|
+
}) {
|
|
13
|
+
return o ? /* @__PURE__ */ t.jsx(a, { modifiers: [n], onDragEnd: i, children: /* @__PURE__ */ t.jsx(
|
|
14
|
+
x,
|
|
15
|
+
{
|
|
16
|
+
items: e.map((s) => s[m]),
|
|
17
|
+
strategy: f,
|
|
18
|
+
children: r
|
|
19
|
+
}
|
|
20
|
+
) }) : /* @__PURE__ */ t.jsx(t.Fragment, { children: r });
|
|
21
|
+
}
|
|
22
|
+
const C = p(l);
|
|
23
|
+
export {
|
|
24
|
+
C as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
3
|
+
'data-row-key': string;
|
|
4
|
+
loading: 'true' | 'false';
|
|
5
|
+
}
|
|
6
|
+
declare const SortableRow: ({ children, loading, ...props }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default SortableRow;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { useSortable as R } from "../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
3
|
+
import { CSS as b } from "../../../node_modules/.store/@dnd-kit_utilities@3.2.2/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs";
|
|
4
|
+
import { theme as h } from "antd";
|
|
5
|
+
import a from "react";
|
|
6
|
+
import j from "../../../node_modules/.store/@ant-design_icons@5.3.6/node_modules/@ant-design/icons/es/icons/MenuOutlined.mjs";
|
|
7
|
+
const T = ({ children: m, loading: t, ...e }) => {
|
|
8
|
+
const { token: l } = h.useToken(), {
|
|
9
|
+
attributes: f,
|
|
10
|
+
listeners: u,
|
|
11
|
+
setNodeRef: c,
|
|
12
|
+
setActivatorNodeRef: d,
|
|
13
|
+
transform: o,
|
|
14
|
+
transition: p,
|
|
15
|
+
isDragging: x
|
|
16
|
+
} = R({ id: e["data-row-key"] }), S = {
|
|
17
|
+
...e.style,
|
|
18
|
+
transform: b.Transform.toString(o && { ...o, scaleY: 1 }),
|
|
19
|
+
transition: p,
|
|
20
|
+
...x ? { position: "relative", zIndex: 9999 } : {}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ i.jsx(
|
|
23
|
+
"tr",
|
|
24
|
+
{
|
|
25
|
+
...e,
|
|
26
|
+
style: S,
|
|
27
|
+
...f,
|
|
28
|
+
...t === "true" ? {} : {
|
|
29
|
+
ref: c
|
|
30
|
+
},
|
|
31
|
+
children: a.Children.map(m, (r) => {
|
|
32
|
+
var n, s;
|
|
33
|
+
return ((s = (n = r.props) == null ? void 0 : n.additionalProps) == null ? void 0 : s["data-column-name"]) === "dragSortCell" ? a.cloneElement(r, {
|
|
34
|
+
children: /* @__PURE__ */ i.jsx(
|
|
35
|
+
j,
|
|
36
|
+
{
|
|
37
|
+
ref: d,
|
|
38
|
+
style: {
|
|
39
|
+
touchAction: "none",
|
|
40
|
+
cursor: t === "true" ? "default" : "move",
|
|
41
|
+
fontSize: "calc(var(--fontSize) + 3px)",
|
|
42
|
+
color: t === "true" ? l.colorTextDisabled : "inherit"
|
|
43
|
+
},
|
|
44
|
+
...u
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}) : r;
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
T as default
|
|
54
|
+
};
|
|
@@ -6,8 +6,13 @@ import type { RowClassName } from 'rc-table/es/interface';
|
|
|
6
6
|
import { ColumnStateType, DensitySize, StylesStateType, ExportColumnStateType } from '../Store';
|
|
7
7
|
import { ActionsFunType, BitzTableColumnsType } from '..';
|
|
8
8
|
import { BitzTableBorderedType } from '@/components/BitzConfigProvider/context';
|
|
9
|
+
import { TableRowSelection } from 'antd/es/table/interface';
|
|
10
|
+
import { DragEndEvent } from '@dnd-kit/core';
|
|
9
11
|
import './index.less';
|
|
10
|
-
export interface
|
|
12
|
+
export interface BitzTableRowSelectionProps<RecordType> extends TableRowSelection<RecordType> {
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface BitzTableProps<RecordType = any> extends Omit<TableProps<RecordType>, 'size' | 'pagination' | 'bordered' | 'rowSelection'> {
|
|
11
16
|
/** 是否开启rowHover样式 */
|
|
12
17
|
rowHoverable?: boolean;
|
|
13
18
|
/** 是否开启斑马纹样式 */
|
|
@@ -16,6 +21,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
16
21
|
bordered?: BitzTableBorderedType;
|
|
17
22
|
/** PC端:是否显示分页 */
|
|
18
23
|
showPagination?: boolean;
|
|
24
|
+
/** PC端:是否显示分页选中条数据 */
|
|
25
|
+
showSelected?: boolean;
|
|
19
26
|
/** PC端:BitzTable组件的整体高度,由外部通过视口高度减去其他元素高度和间隙的结果 */
|
|
20
27
|
height?: number;
|
|
21
28
|
/** table可滚动区域的最大宽高的值 */
|
|
@@ -33,6 +40,8 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
33
40
|
operationFilter?: ActionsFunType<RecordType>;
|
|
34
41
|
/** PC&移动端:请求加载状态 */
|
|
35
42
|
loading?: boolean;
|
|
43
|
+
/** 多选/单选 */
|
|
44
|
+
rowSelection?: BitzTableRowSelectionProps<RecordType>;
|
|
36
45
|
/** 骨架屏列表个数 */
|
|
37
46
|
skeletonNum?: {
|
|
38
47
|
pc?: number;
|
|
@@ -55,6 +64,10 @@ export interface BitzTableProps<RecordType = any> extends Omit<TableProps<Record
|
|
|
55
64
|
};
|
|
56
65
|
/** PC端:给父组件传值 page当前第几页 pageSize每页有多少 */
|
|
57
66
|
paginationEmit?: (page: number, pageSize: number) => void;
|
|
67
|
+
/** 是否启用拖拽 */
|
|
68
|
+
enabledRowDragSort?: boolean;
|
|
69
|
+
/** 拖拽结束 */
|
|
70
|
+
onRowDragEnd?: (event: DragEndEvent) => void;
|
|
58
71
|
/** 移动端:加载更多返回函数 */
|
|
59
72
|
/** 移动端:下拉刷新 */
|
|
60
73
|
mobileRefreshEmit?: () => Promise<unknown> | void;
|