@arim-aisdc/public-components 2.3.73 → 2.3.74
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.
|
@@ -1140,7 +1140,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
1140
1140
|
totalDatas: totalDatas,
|
|
1141
1141
|
setRowSelection: setRowSelection,
|
|
1142
1142
|
openMemo: openMemo !== null && openMemo !== void 0 ? openMemo : tableMaxConfig === null || tableMaxConfig === void 0 ? void 0 : tableMaxConfig.openMemo,
|
|
1143
|
-
openVirtualRows: openVirtualRows,
|
|
1143
|
+
openVirtualRows: openVirtualRows || tableDatas.length > 100,
|
|
1144
1144
|
tableKey: tableKey
|
|
1145
1145
|
};
|
|
1146
1146
|
var changeCompactMode = function changeCompactMode() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -38,9 +38,8 @@ export var useVirtualCalculations = function useVirtualCalculations(table, table
|
|
|
38
38
|
// 行虚拟化配置 - 包含 rowHeight 依赖
|
|
39
39
|
var rows = table.getRowModel().rows;
|
|
40
40
|
var rowVirtualizerConfig = useMemo(function () {
|
|
41
|
-
if (!config.openVirtualRows) return null;
|
|
42
41
|
return {
|
|
43
|
-
count: rows.length,
|
|
42
|
+
count: config.openVirtualRows ? rows.length : 0,
|
|
44
43
|
estimateSize: function estimateSize() {
|
|
45
44
|
return config.rowHeight || 42;
|
|
46
45
|
},
|
|
@@ -54,7 +53,9 @@ export var useVirtualCalculations = function useVirtualCalculations(table, table
|
|
|
54
53
|
}, [config.openVirtualRows, rows, config.rowHeight,
|
|
55
54
|
// 关键:包含 rowHeight 依赖
|
|
56
55
|
config.rowOverscan, virtualizerRefreshKey, tableKey]);
|
|
57
|
-
|
|
56
|
+
|
|
57
|
+
// const rowVirtualizer = rowVirtualizerConfig ? useVirtualizer(rowVirtualizerConfig ) : null;
|
|
58
|
+
var rowVirtualizer = useVirtualizer(rowVirtualizerConfig);
|
|
58
59
|
|
|
59
60
|
// 响应 rowHeight 变化
|
|
60
61
|
useEffect(function () {
|