@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) => 1 | -1 | 0;
3
- export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
4
- export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
5
- export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
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) => 1 | -1 | 0;
8
- stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
9
- timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
10
- numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | -1 | 0;
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
- var rowVirtualizer = rowVirtualizerConfig ? useVirtualizer(rowVirtualizerConfig) : null;
56
+
57
+ // const rowVirtualizer = rowVirtualizerConfig ? useVirtualizer(rowVirtualizerConfig ) : null;
58
+ var rowVirtualizer = useVirtualizer(rowVirtualizerConfig);
58
59
 
59
60
  // 响应 rowHeight 变化
60
61
  useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.73",
3
+ "version": "2.3.74",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",