@arim-aisdc/public-components 2.3.80 → 2.3.82

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.
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
17
17
  value: any;
18
18
  field: string;
19
19
  label?: string;
20
- text: string | Element | JSX.Element;
20
+ text: string | JSX.Element | Element;
21
21
  units?: string;
22
22
  width?: string;
23
23
  labelWidth?: string;
@@ -524,10 +524,22 @@ 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
+ var newColumnOrder = tableColumns === null || tableColumns === void 0 ? void 0 : tableColumns.map(function (column) {
528
+ return column.id;
529
+ });
530
+ var arr = newColumnOrder;
531
+ if (!tableId) {
532
+ setColumnOrder(arr);
533
+ return;
534
+ }
528
535
  var cache = JSON.parse((_localStorage$getItem = localStorage.getItem(tableKey)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
529
- if (version && version !== (cache === null || cache === void 0 ? void 0 : cache.version)) return;
536
+ if (version && version !== (cache === null || cache === void 0 ? void 0 : cache.version)) {
537
+ setColumnOrder(arr);
538
+ return;
539
+ }
540
+ ;
530
541
  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)) {
542
+ setColumnOrder(arr);
531
543
  return;
532
544
  }
533
545
  var columnsIdSet = new Set(tableColumns.map(function (column) {
@@ -593,10 +605,6 @@ var TableMax = function TableMax(_ref) {
593
605
  right: Array.from(new Set(_toConsumableArray(cacheColumnPinning.right)))
594
606
  });
595
607
  }
596
- var newColumnOrder = tableColumns === null || tableColumns === void 0 ? void 0 : tableColumns.map(function (column) {
597
- return column.id;
598
- });
599
- var arr = newColumnOrder;
600
608
  if (cacheColumnOrder && tableColumns.length === cacheColumnOrder.length && cacheColumnOrder.filter(function (columnId) {
601
609
  return !newColumnOrder.includes(columnId);
602
610
  }).length === 0) {
@@ -1,13 +1,13 @@
1
1
  import { TableMaxColumnType } from "../../type";
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;
2
+ export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
3
+ export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
4
+ export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
5
+ export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
6
6
  declare const customSortFns: {
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;
7
+ numberSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
8
+ stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
9
+ timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
10
+ numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -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": "2.3.80",
3
+ "version": "2.3.82",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",