@arim-aisdc/public-components 2.3.79 → 2.3.80
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.
|
@@ -524,6 +524,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
524
524
|
/**根据缓存数据设置一些状态 */
|
|
525
525
|
var setColumnInfoFromCache = function setColumnInfoFromCache(tableColumns) {
|
|
526
526
|
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnVisibili, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
527
|
+
if (!tableId) return;
|
|
527
528
|
var cache = JSON.parse((_localStorage$getItem = localStorage.getItem(tableKey)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
|
|
528
529
|
if (version && version !== (cache === null || cache === void 0 ? void 0 : cache.version)) return;
|
|
529
530
|
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)) {
|
|
@@ -762,7 +763,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
762
763
|
var _column$columns;
|
|
763
764
|
return (column === null || column === void 0 ? void 0 : column.columns) && ((_column$columns = column.columns) === null || _column$columns === void 0 ? void 0 : _column$columns.length) > 0;
|
|
764
765
|
}) > -1);
|
|
765
|
-
}, [columns]);
|
|
766
|
+
}, [columns, tableId]);
|
|
766
767
|
var _rowSelectionChange = useCallback(debounce(function (rowOriginal, row) {
|
|
767
768
|
if (rowSelectionChange) {
|
|
768
769
|
// console.log(rowOriginal, row, 'rowSelectionChange1')
|
|
@@ -837,6 +838,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
837
838
|
|
|
838
839
|
/**缓存table数据 */
|
|
839
840
|
useUpdateEffect(function () {
|
|
841
|
+
if (!tableId) return;
|
|
840
842
|
var tableState = table.getState();
|
|
841
843
|
localStorage.setItem(tableKey, JSON.stringify({
|
|
842
844
|
enableFilters: enableFilters,
|
|
@@ -852,7 +854,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
852
854
|
editTimeCh: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
853
855
|
version: version
|
|
854
856
|
}));
|
|
855
|
-
}, [table.getState().columnVisibility, table.getState().columnPinning, table.getState().columnOrder, table.getState().columnFilters, table.getState().sorting, enableFilters, headerRowNum, compactMode, columnSizing]);
|
|
857
|
+
}, [table.getState().columnVisibility, table.getState().columnPinning, table.getState().columnOrder, table.getState().columnFilters, table.getState().sorting, enableFilters, headerRowNum, compactMode, columnSizing, tableId]);
|
|
856
858
|
var reorderRow = useCallback(function (fromDatas, toDatas) {
|
|
857
859
|
var draggedRow = fromDatas.draggedRow,
|
|
858
860
|
isMultipleDrag = fromDatas.isMultipleDrag,
|
|
@@ -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;
|