@arim-aisdc/public-components 0.0.46 → 0.0.47

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.
@@ -30,7 +30,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
30
30
  import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
31
31
  import { getCoreRowModel, getExpandedRowModel, getFacetedUniqueValues, getFilteredRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
32
32
  import { produce } from 'immer';
33
- import { cloneDeep } from 'lodash';
33
+ import { cloneDeep, debounce } from 'lodash';
34
34
  import moment from 'moment';
35
35
  import React, { createContext, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
36
36
  import { DndProvider } from 'react-dnd';
@@ -613,12 +613,17 @@ var TableMax = function TableMax(_ref) {
613
613
  }
614
614
  }));
615
615
  }, [tableContainerWidth, hasVerticalScrollBar, table.getState().columnSizing]);
616
+ var _rowSelectionChange = useCallback(debounce(function (rowOriginal, row) {
617
+ if (rowSelectionChange) {
618
+ rowSelectionChange(rowOriginal, row);
619
+ }
620
+ }, 100), [rowSelectionChange]);
616
621
 
617
622
  // 多选数据变化回调
618
623
  useEffect(function () {
619
624
  var rowObjs = table.getSelectedRowModel().rows;
620
625
  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
621
- rowSelectionChange && rowSelectionChange(rowObjs.map(function (item) {
626
+ _rowSelectionChange(rowObjs.map(function (item) {
622
627
  return item.original;
623
628
  }), rowObjs);
624
629
  }, [rowSelection]);
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",