@arim-aisdc/public-components 2.3.53 → 2.3.55
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/TableMax/TableBody/OriginalRow.d.ts +1 -2
- package/dist/components/TableMax/TableBody/OriginalRow.js +3 -8
- package/dist/components/TableMax/TableBody/OriginalTableBody.d.ts +1 -1
- package/dist/components/TableMax/TableBody/OriginalTableBody.js +1 -8
- package/dist/components/TableMax/TableBody/TableBody.js +4 -4
- package/dist/components/TableMax/TableBody/VirtualRow.d.ts +1 -2
- package/dist/components/TableMax/TableBody/VirtualRow.js +141 -139
- package/dist/components/TableMax/TableBody/VirtualTableBody.d.ts +1 -1
- package/dist/components/TableMax/TableBody/VirtualTableBody.js +20 -26
- package/dist/components/TableMax/TableBody/components/Total.d.ts +1 -2
- package/dist/components/TableMax/TableBody/components/Total.js +6 -59
- package/dist/components/TableMax/TableBody/components/VirtualTotal.d.ts +0 -0
- package/dist/components/TableMax/TableBody/components/VirtualTotal.js +0 -0
- package/dist/components/TableMax/TableHeader/TableHeader.js +4 -4
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ColGroup.d.ts +0 -11
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/ColGroup.js +47 -32
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/index.d.ts +0 -4
- package/dist/components/TableMax/TableHeader/VirtualTableHeader/index.js +93 -79
- package/dist/components/TableMax/TableHeader/index.d.ts +0 -1
- package/dist/components/TableMax/TableHeader/index.js +1 -1
- package/dist/components/TableMax/TableMax.js +53 -59
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollProvider.d.ts +0 -3
- package/dist/components/TableMax/contexts/VirtualScroll/VirtualScrollProvider.js +26 -26
- package/dist/components/TableMax/contexts/VirtualScroll/index.d.ts +0 -1
- package/dist/components/TableMax/contexts/VirtualScroll/index.js +1 -1
- package/dist/components/TableMax/hooks/useColumnWidth.js +3 -2
- package/dist/components/TableMax/hooks/useTableComponents.d.ts +0 -6
- package/dist/components/TableMax/hooks/useTableComponents.js +25 -19
- package/dist/components/TableMax/hooks/useVirtualCalculations copy.d.ts +25 -0
- package/dist/components/TableMax/hooks/useVirtualCalculations copy.js +106 -0
- package/dist/components/TableMax/hooks/useVirtualCalculations.d.ts +1 -8
- package/dist/components/TableMax/hooks/useVirtualCalculations.js +5 -44
- package/dist/components/TableMax/hooks/useVirtualScroll.d.ts +0 -4
- package/dist/components/TableMax/hooks/useVirtualScroll.js +25 -30
- package/dist/components/TableMax/tableMax.less +20 -17
- package/dist/components/TableMax/utils.js +8 -3
- package/package.json +1 -1
|
@@ -4,41 +4,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import {
|
|
7
|
+
import { getPinningStyle } from "../../TableHeader/utils";
|
|
8
8
|
import "../../TableBody/index.less";
|
|
9
|
-
import { useVirtualConfig, useVirtualState } from "../../hooks/useVirtualScroll";
|
|
10
|
-
|
|
11
|
-
// 虚拟填充组件
|
|
12
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
10
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
type = _ref.type;
|
|
18
|
-
if (!width) return null;
|
|
19
|
-
return /*#__PURE__*/_jsx("td", {
|
|
20
|
-
style: {
|
|
21
|
-
width: "".concat(width, "px"),
|
|
22
|
-
// height: '100%',
|
|
23
|
-
padding: 0,
|
|
24
|
-
border: 'none'
|
|
25
|
-
},
|
|
26
|
-
className: "virtual-padding virtual-padding-".concat(type)
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export var Total = function Total(_ref2) {
|
|
30
|
-
var table = _ref2.table,
|
|
31
|
-
totalDatas = _ref2.totalDatas,
|
|
32
|
-
rowHeight = _ref2.rowHeight;
|
|
11
|
+
export var Total = function Total(_ref) {
|
|
12
|
+
var table = _ref.table,
|
|
13
|
+
totalDatas = _ref.totalDatas;
|
|
33
14
|
var footerGroups = table.getFooterGroups();
|
|
34
|
-
var state = useVirtualState();
|
|
35
|
-
var config = useVirtualConfig();
|
|
36
|
-
var leftPinnedColumns = state.leftPinnedColumns,
|
|
37
|
-
rightPinnedColumns = state.rightPinnedColumns,
|
|
38
|
-
scrollableColumns = state.scrollableColumns,
|
|
39
|
-
virtualColumns = state.virtualColumns,
|
|
40
|
-
virtualPaddingLeft = state.virtualPaddingLeft,
|
|
41
|
-
virtualPaddingRight = state.virtualPaddingRight;
|
|
42
15
|
|
|
43
16
|
// 公共样式对象
|
|
44
17
|
var rowStyle = {
|
|
@@ -50,7 +23,6 @@ export var Total = function Total(_ref2) {
|
|
|
50
23
|
};
|
|
51
24
|
var cellWrapperStyle = {
|
|
52
25
|
boxSizing: 'border-box',
|
|
53
|
-
height: "".concat(rowHeight, "px"),
|
|
54
26
|
borderTop: '1px solid var(--tableColor2)',
|
|
55
27
|
borderBottom: '1px solid var(--tableColor2)'
|
|
56
28
|
};
|
|
@@ -61,9 +33,7 @@ export var Total = function Total(_ref2) {
|
|
|
61
33
|
var headerId = header.id,
|
|
62
34
|
colSpan = header.colSpan;
|
|
63
35
|
var pinningStyle = getPinningStyle(header, table);
|
|
64
|
-
var cellStyle = _objectSpread(
|
|
65
|
-
height: "".concat(rowHeight - 1, "px")
|
|
66
|
-
});
|
|
36
|
+
var cellStyle = _objectSpread({}, pinningStyle);
|
|
67
37
|
return /*#__PURE__*/_jsx("td", {
|
|
68
38
|
colSpan: colSpan,
|
|
69
39
|
style: cellStyle,
|
|
@@ -82,29 +52,6 @@ export var Total = function Total(_ref2) {
|
|
|
82
52
|
return renderCell(header);
|
|
83
53
|
});
|
|
84
54
|
};
|
|
85
|
-
|
|
86
|
-
// 渲染虚拟滚动列
|
|
87
|
-
var renderVirtualColumns = function renderVirtualColumns(footerGroup) {
|
|
88
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
|
-
children: [leftPinnedColumns.map(function (column, index) {
|
|
90
|
-
var header = findHeaderByColumn(footerGroup, column);
|
|
91
|
-
return header ? renderCell(header, "-left-".concat(index)) : null;
|
|
92
|
-
}), /*#__PURE__*/_jsx(VirtualPadding, {
|
|
93
|
-
type: "left",
|
|
94
|
-
width: virtualPaddingLeft
|
|
95
|
-
}), virtualColumns.map(function (virtualColumn, index) {
|
|
96
|
-
var column = scrollableColumns[virtualColumn.index];
|
|
97
|
-
var header = findHeaderByColumn(footerGroup, column);
|
|
98
|
-
return header ? renderCell(header, "-virtual-".concat(index)) : null;
|
|
99
|
-
}), /*#__PURE__*/_jsx(VirtualPadding, {
|
|
100
|
-
type: "right",
|
|
101
|
-
width: virtualPaddingRight
|
|
102
|
-
}), rightPinnedColumns.map(function (column, index) {
|
|
103
|
-
var header = findHeaderByColumn(footerGroup, column);
|
|
104
|
-
return header ? renderCell(header, "-right-".concat(index)) : null;
|
|
105
|
-
})]
|
|
106
|
-
});
|
|
107
|
-
};
|
|
108
55
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
109
56
|
children: footerGroups.map(function (footerGroup) {
|
|
110
57
|
var id = footerGroup.id,
|
|
@@ -112,7 +59,7 @@ export var Total = function Total(_ref2) {
|
|
|
112
59
|
return /*#__PURE__*/_jsx("tr", {
|
|
113
60
|
className: "tbody-tr",
|
|
114
61
|
style: rowStyle,
|
|
115
|
-
children:
|
|
62
|
+
children: renderNormalColumns(headers)
|
|
116
63
|
}, id);
|
|
117
64
|
})
|
|
118
65
|
});
|
|
File without changes
|
|
File without changes
|
|
@@ -5,10 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { OriginalTableHeader } from "./OriginalTableHeader";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
export var TableHeader = function TableHeader(props) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return /*#__PURE__*/_jsx(
|
|
11
|
+
// const { TableHeader: HeaderComponent } = useTableComponents();
|
|
12
|
+
// return <HeaderComponent {...props} />;
|
|
13
|
+
return /*#__PURE__*/_jsx(OriginalTableHeader, _objectSpread({}, props));
|
|
14
14
|
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ColGroupProps {
|
|
3
|
-
leftPinnedColumns: any[];
|
|
4
|
-
scrollableColumns: any[];
|
|
5
|
-
rightPinnedColumns: any[];
|
|
6
|
-
virtualColumns: any[];
|
|
7
|
-
virtualPaddingLeft: number;
|
|
8
|
-
virtualPaddingRight: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const ColGroup: React.FC<ColGroupProps>;
|
|
11
|
-
export {};
|
|
@@ -1,32 +1,47 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useVirtualConfig } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { useIsVirtualEnabled, useVirtualConfig } from '../../hooks/useVirtualScroll';
|
|
3
|
+
|
|
4
|
+
// interface ColGroupProps {
|
|
5
|
+
// leftPinnedColumns: any[];
|
|
6
|
+
// scrollableColumns: any[];
|
|
7
|
+
// rightPinnedColumns: any[];
|
|
8
|
+
// virtualColumns: any[];
|
|
9
|
+
// virtualPaddingLeft: number;
|
|
10
|
+
// virtualPaddingRight: number;
|
|
11
|
+
// }
|
|
12
|
+
|
|
13
|
+
// export const ColGroup: React.FC<ColGroupProps> = ({
|
|
14
|
+
// leftPinnedColumns,
|
|
15
|
+
// scrollableColumns,
|
|
16
|
+
// rightPinnedColumns,
|
|
17
|
+
// virtualColumns,
|
|
18
|
+
// virtualPaddingLeft,
|
|
19
|
+
// virtualPaddingRight,
|
|
20
|
+
// }) => {
|
|
21
|
+
// const renderColumn = (column: any) => {
|
|
22
|
+
// const size = column.getSize() || 120;
|
|
23
|
+
// return <col key={column.id} width={size} />;
|
|
24
|
+
// };
|
|
25
|
+
// const { openVirtualColumns } = useVirtualConfig();
|
|
26
|
+
|
|
27
|
+
// return (
|
|
28
|
+
// <colgroup>
|
|
29
|
+
// {/* 左侧固定列 */}
|
|
30
|
+
// {leftPinnedColumns?.map(renderColumn)}
|
|
31
|
+
|
|
32
|
+
// {
|
|
33
|
+
// !openVirtualColumns ? scrollableColumns.map(renderColumn) :
|
|
34
|
+
// <>
|
|
35
|
+
// {/* 虚拟滚动区域 */}
|
|
36
|
+
// {Number(virtualPaddingLeft) > 0 && <col width={virtualPaddingLeft} />}
|
|
37
|
+
// {virtualColumns.map(virtualColumn =>
|
|
38
|
+
// renderColumn(scrollableColumns[virtualColumn.index])
|
|
39
|
+
// )}
|
|
40
|
+
// {Number(virtualPaddingRight) > 0 && <col width={virtualPaddingRight} />}</>
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
// {/* 右侧固定列 */}
|
|
44
|
+
// {rightPinnedColumns?.map(renderColumn)}
|
|
45
|
+
// </colgroup>
|
|
46
|
+
// );
|
|
47
|
+
// };
|
|
@@ -1,79 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { useVirtualConfig, useVirtualState } from '../../hooks/useVirtualScroll';
|
|
3
|
+
// import { ColGroup } from './ColGroup';
|
|
4
|
+
// import { PinnedColumns } from './PinnedColumns';
|
|
5
|
+
// import { VirtualPadding } from './VirtualPadding';
|
|
6
|
+
// import { VirtualColumns } from './VirtualColumns';
|
|
7
|
+
// import { TableHeaderProps } from '../OriginalTableHeader';
|
|
8
|
+
// import './index.less';
|
|
9
|
+
// import { ScrollColumns } from './ScrollColumns';
|
|
10
|
+
|
|
11
|
+
// export const VirtualTableHeader: React.FC<TableHeaderProps> = (props) => {
|
|
12
|
+
// const { table, hasGroup, rowHeight = 40 } = props;
|
|
13
|
+
// const state = useVirtualState();
|
|
14
|
+
// const config = useVirtualConfig();
|
|
15
|
+
|
|
16
|
+
// const headerGroups = table.getHeaderGroups();
|
|
17
|
+
|
|
18
|
+
// const {
|
|
19
|
+
// leftPinnedColumns,
|
|
20
|
+
// rightPinnedColumns,
|
|
21
|
+
// scrollableColumns,
|
|
22
|
+
// virtualColumns,
|
|
23
|
+
// virtualPaddingLeft,
|
|
24
|
+
// virtualPaddingRight
|
|
25
|
+
// } = state;
|
|
26
|
+
|
|
27
|
+
// return (
|
|
28
|
+
// <table>
|
|
29
|
+
// <ColGroup
|
|
30
|
+
// leftPinnedColumns={leftPinnedColumns}
|
|
31
|
+
// scrollableColumns={scrollableColumns}
|
|
32
|
+
// rightPinnedColumns={rightPinnedColumns}
|
|
33
|
+
// virtualColumns={virtualColumns}
|
|
34
|
+
// virtualPaddingLeft={virtualPaddingLeft}
|
|
35
|
+
// virtualPaddingRight={virtualPaddingRight}
|
|
36
|
+
// />
|
|
37
|
+
|
|
38
|
+
// <thead>
|
|
39
|
+
// {headerGroups.map(headerGroup => (
|
|
40
|
+
// <tr
|
|
41
|
+
// key={headerGroup.id}
|
|
42
|
+
// className="table-thead-tr cus-table-thead-tr"
|
|
43
|
+
// style={{
|
|
44
|
+
// height: hasGroup && headerGroup.depth === 0 ? `${rowHeight}px` : 'auto',
|
|
45
|
+
// width: '100%',
|
|
46
|
+
// position: 'relative'
|
|
47
|
+
// }}
|
|
48
|
+
// >
|
|
49
|
+
// {/* 左侧固定列 */}
|
|
50
|
+
// <PinnedColumns
|
|
51
|
+
// columns={leftPinnedColumns}
|
|
52
|
+
// headerGroup={headerGroup}
|
|
53
|
+
// position="left"
|
|
54
|
+
// {...props}
|
|
55
|
+
// />
|
|
56
|
+
// {
|
|
57
|
+
// !config.openVirtualColumns ? <>
|
|
58
|
+
// <ScrollColumns
|
|
59
|
+
// scrollableColumns={scrollableColumns}
|
|
60
|
+
// headerGroup={headerGroup}
|
|
61
|
+
// {...props}
|
|
62
|
+
// />
|
|
63
|
+
// </> : <>
|
|
64
|
+
// {/* 左侧虚拟填充 */}
|
|
65
|
+
// <VirtualPadding type="left" width={virtualPaddingLeft} />
|
|
66
|
+
|
|
67
|
+
// {/* 虚拟滚动列 */}
|
|
68
|
+
// <VirtualColumns
|
|
69
|
+
// virtualColumns={virtualColumns}
|
|
70
|
+
// scrollableColumns={scrollableColumns}
|
|
71
|
+
// headerGroup={headerGroup}
|
|
72
|
+
// {...props}
|
|
73
|
+
// />
|
|
74
|
+
|
|
75
|
+
// {/* 右侧虚拟填充 */}
|
|
76
|
+
// <VirtualPadding type="right" width={virtualPaddingRight} />
|
|
77
|
+
|
|
78
|
+
// </>
|
|
79
|
+
// }
|
|
80
|
+
|
|
81
|
+
// {/* 右侧固定列 */}
|
|
82
|
+
// <PinnedColumns
|
|
83
|
+
// columns={rightPinnedColumns}
|
|
84
|
+
// headerGroup={headerGroup}
|
|
85
|
+
// position="right"
|
|
86
|
+
// {...props}
|
|
87
|
+
// />
|
|
88
|
+
// </tr>
|
|
89
|
+
// ))}
|
|
90
|
+
// </thead>
|
|
91
|
+
// </table>
|
|
92
|
+
// );
|
|
93
|
+
// };
|
|
@@ -40,7 +40,6 @@ import "./tableMax.less";
|
|
|
40
40
|
import { downloadExcel, getFormatFilters, getFormatFiltersV2, getFormatSorting, operationColumnNoTooltips } from "./utils";
|
|
41
41
|
import { useTableScrollShadow } from "./hooks/useTableScrollShadow";
|
|
42
42
|
import { ExportTableData } from "./components/Export";
|
|
43
|
-
import { VirtualScrollProvider } from "./contexts";
|
|
44
43
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
45
44
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
46
45
|
export var ColumnType = /*#__PURE__*/function (ColumnType) {
|
|
@@ -55,6 +54,8 @@ var getCurrentRouterName = function getCurrentRouterName() {
|
|
|
55
54
|
return window.location.pathname.slice(1);
|
|
56
55
|
};
|
|
57
56
|
var compactModeRowHeight = 30;
|
|
57
|
+
var compactModeCellPadding = '0 2px';
|
|
58
|
+
var cellPadding = '0 8px';
|
|
58
59
|
|
|
59
60
|
/**将空默认值提升为组件外部的常量,避免引发不必要的渲染 */
|
|
60
61
|
var defaultData = [];
|
|
@@ -511,7 +512,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
511
512
|
|
|
512
513
|
/**根据缓存数据设置一些状态 */
|
|
513
514
|
var setColumnInfoFromCache = function setColumnInfoFromCache(tableColumns) {
|
|
514
|
-
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
515
|
+
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnVisibili, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
515
516
|
var cache = JSON.parse((_localStorage$getItem = localStorage.getItem(tableKey)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
|
|
516
517
|
if (cache && cache !== null && cache !== void 0 && cache.editTime && +new Date() - cache.editTime > ((_tableMaxConfig$cache = tableMaxConfig.cacheMaxAge) !== null && _tableMaxConfig$cache !== void 0 ? _tableMaxConfig$cache : CACHE_MAX_AGE)) {
|
|
517
518
|
return;
|
|
@@ -529,7 +530,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
529
530
|
}));
|
|
530
531
|
};
|
|
531
532
|
var _ref5 = _objectSpread(_objectSpread({}, cache), {}, {
|
|
532
|
-
columnVisibility: cache.columnVisibility ? pickByKeys(cache.columnVisibility, columnsIdSet) : {},
|
|
533
|
+
columnVisibility: cache.columnVisibility ? pickByKeys((_cache$columnVisibili = cache.columnVisibility) !== null && _cache$columnVisibili !== void 0 ? _cache$columnVisibili : {}, columnsIdSet) : {},
|
|
533
534
|
columnPinning: cache.columnPinning ? {
|
|
534
535
|
left: (_cache$columnPinning$ = cache === null || cache === void 0 || (_cache$columnPinning = cache.columnPinning) === null || _cache$columnPinning === void 0 || (_cache$columnPinning = _cache$columnPinning.left) === null || _cache$columnPinning === void 0 ? void 0 : _cache$columnPinning.filter(function (id) {
|
|
535
536
|
return columnsIdSet.has(id);
|
|
@@ -553,8 +554,10 @@ var TableMax = function TableMax(_ref) {
|
|
|
553
554
|
if (cacheHeaderRowNum) {
|
|
554
555
|
setheaderRowNum(cacheHeaderRowNum);
|
|
555
556
|
}
|
|
556
|
-
|
|
557
|
-
|
|
557
|
+
|
|
558
|
+
// setCompactMode(cacheCompactMode === true);
|
|
559
|
+
// setRowHeight(cacheCompactMode === true ? compactModeRowHeight : propsRowHeight);
|
|
560
|
+
changeCompactModeStyle(cacheCompactMode === true);
|
|
558
561
|
var newColumnVisibleConfig = _objectSpread(_objectSpread({}, columnVisibleConfig), cacheColumnVisibility);
|
|
559
562
|
setColumnVisibility(newColumnVisibleConfig);
|
|
560
563
|
|
|
@@ -1139,24 +1142,21 @@ var TableMax = function TableMax(_ref) {
|
|
|
1139
1142
|
hasTotalRow: hasTotalRow,
|
|
1140
1143
|
totalDatas: totalDatas,
|
|
1141
1144
|
setRowSelection: setRowSelection,
|
|
1142
|
-
openMemo: openMemo !== null && openMemo !== void 0 ? openMemo : tableMaxConfig === null || tableMaxConfig === void 0 ? void 0 : tableMaxConfig.openMemo
|
|
1145
|
+
openMemo: openMemo !== null && openMemo !== void 0 ? openMemo : tableMaxConfig === null || tableMaxConfig === void 0 ? void 0 : tableMaxConfig.openMemo,
|
|
1146
|
+
openVirtualRows: openVirtualRows
|
|
1143
1147
|
};
|
|
1144
1148
|
var changeCompactMode = function changeCompactMode() {
|
|
1145
|
-
|
|
1146
|
-
|
|
1149
|
+
changeCompactModeStyle(!compactMode);
|
|
1150
|
+
};
|
|
1151
|
+
var changeCompactModeStyle = function changeCompactModeStyle(compactMode) {
|
|
1152
|
+
var _tableContentRef$curr2, _tableContentRef$curr3;
|
|
1153
|
+
var newHeight = compactMode ? compactModeRowHeight : propsRowHeight;
|
|
1154
|
+
var newPadding = compactMode ? compactModeCellPadding : cellPadding;
|
|
1155
|
+
(_tableContentRef$curr2 = tableContentRef.current) === null || _tableContentRef$curr2 === void 0 || (_tableContentRef$curr2 = _tableContentRef$curr2.style) === null || _tableContentRef$curr2 === void 0 || _tableContentRef$curr2.setProperty('--cell-height', "".concat(newHeight, "px"));
|
|
1156
|
+
(_tableContentRef$curr3 = tableContentRef.current) === null || _tableContentRef$curr3 === void 0 || (_tableContentRef$curr3 = _tableContentRef$curr3.style) === null || _tableContentRef$curr3 === void 0 || _tableContentRef$curr3.setProperty('--cell-padding', newPadding);
|
|
1157
|
+
setCompactMode(compactMode);
|
|
1158
|
+
setRowHeight(newHeight);
|
|
1147
1159
|
};
|
|
1148
|
-
var virtualConfig = useMemo(function () {
|
|
1149
|
-
return {
|
|
1150
|
-
openVirtualColumns: openVirtualColumns,
|
|
1151
|
-
openVirtualRows: openVirtualRows,
|
|
1152
|
-
rowHeight: rowHeight,
|
|
1153
|
-
columnOverscan: 3,
|
|
1154
|
-
rowOverscan: 10
|
|
1155
|
-
};
|
|
1156
|
-
}, [openVirtualColumns, openVirtualRows, rowHeight]);
|
|
1157
|
-
|
|
1158
|
-
// const components = useTableComponents();
|
|
1159
|
-
|
|
1160
1160
|
return /*#__PURE__*/_jsx(Form, {
|
|
1161
1161
|
form: form,
|
|
1162
1162
|
component: false,
|
|
@@ -1321,46 +1321,40 @@ var TableMax = function TableMax(_ref) {
|
|
|
1321
1321
|
setColumnVisibility: setColumnVisibility
|
|
1322
1322
|
})]
|
|
1323
1323
|
})]
|
|
1324
|
-
}), /*#__PURE__*/_jsx(
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
children: /*#__PURE__*/
|
|
1332
|
-
className: "table-
|
|
1333
|
-
|
|
1334
|
-
|
|
1324
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
1325
|
+
className: "table-max-content cus-table-max-content ".concat(compactMode ? 'table-max-content-compact' : null),
|
|
1326
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
1327
|
+
className: "table-center",
|
|
1328
|
+
ref: tableContentRef
|
|
1329
|
+
// style={{ maxHeight: !autoHeight ? defaultScrollY : 'fit-content' }}
|
|
1330
|
+
,
|
|
1331
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
1332
|
+
className: "table-header-wrapper",
|
|
1333
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
1334
|
+
ref: tableHeaderRef,
|
|
1335
|
+
className: "table-header",
|
|
1336
|
+
children: /*#__PURE__*/_jsx(TableHeader, _objectSpread({}, tableHeaderProps))
|
|
1337
|
+
})
|
|
1338
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
1339
|
+
ref: tableBodyRef,
|
|
1340
|
+
className: "table-body"
|
|
1341
|
+
// onScroll={scrollHandler}
|
|
1335
1342
|
,
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
//
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
onMouseEnter: function onMouseEnter() {
|
|
1352
|
-
var _tableBodyRef$current;
|
|
1353
|
-
// 给当前元素添加hover类
|
|
1354
|
-
(_tableBodyRef$current = tableBodyRef.current) === null || _tableBodyRef$current === void 0 || _tableBodyRef$current.classList.add('hover-active');
|
|
1355
|
-
},
|
|
1356
|
-
onMouseLeave: function onMouseLeave() {
|
|
1357
|
-
var _tableBodyRef$current2;
|
|
1358
|
-
// 移除当前元素的hover类
|
|
1359
|
-
(_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 || _tableBodyRef$current2.classList.remove('hover-active');
|
|
1360
|
-
},
|
|
1361
|
-
children: /*#__PURE__*/_jsx(TableBody, _objectSpread({}, tableBodyProps))
|
|
1362
|
-
})]
|
|
1363
|
-
})
|
|
1343
|
+
style: {
|
|
1344
|
+
width: "100%"
|
|
1345
|
+
},
|
|
1346
|
+
onMouseEnter: function onMouseEnter() {
|
|
1347
|
+
var _tableBodyRef$current;
|
|
1348
|
+
// 给当前元素添加hover类
|
|
1349
|
+
(_tableBodyRef$current = tableBodyRef.current) === null || _tableBodyRef$current === void 0 || _tableBodyRef$current.classList.add('hover-active');
|
|
1350
|
+
},
|
|
1351
|
+
onMouseLeave: function onMouseLeave() {
|
|
1352
|
+
var _tableBodyRef$current2;
|
|
1353
|
+
// 移除当前元素的hover类
|
|
1354
|
+
(_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 || _tableBodyRef$current2.classList.remove('hover-active');
|
|
1355
|
+
},
|
|
1356
|
+
children: /*#__PURE__*/_jsx(TableBody, _objectSpread({}, tableBodyProps))
|
|
1357
|
+
})]
|
|
1364
1358
|
})
|
|
1365
1359
|
}), pagination && /*#__PURE__*/_jsx("div", {
|
|
1366
1360
|
className: "table-max-footer",
|