@arim-aisdc/public-components 2.3.78 → 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,
@@ -40,7 +40,7 @@ export var DateRange = function DateRange(_ref) {
40
40
  var _useTranslation = useTranslation(),
41
41
  _useTranslation2 = _slicedToArray(_useTranslation, 1),
42
42
  t = _useTranslation2[0];
43
- var _ref2 = columnDef.filterComProps || {},
43
+ var _ref2 = (columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterComProps) || {},
44
44
  _ref2$format = _ref2.format,
45
45
  format = _ref2$format === void 0 ? defaultDateFormat : _ref2$format,
46
46
  _ref2$rangePresets = _ref2.rangePresets,
@@ -273,12 +273,12 @@ var Filter = function Filter(_ref) {
273
273
  className: "single-com-wrapper",
274
274
  children: /*#__PURE__*/_jsx(DatePicker, {
275
275
  value: columnFilterValue ? dayjs(columnFilterValue) : undefined,
276
- showTime: (_columnDef$filterComP = columnDef.filterComProps) === null || _columnDef$filterComP === void 0 ? void 0 : _columnDef$filterComP.showTime,
277
- format: ((_columnDef$filterComP2 = columnDef.filterComProps) === null || _columnDef$filterComP2 === void 0 ? void 0 : _columnDef$filterComP2.format) || defaultDateFormat,
278
- picker: ((_columnDef$filterComP3 = columnDef.filterComProps) === null || _columnDef$filterComP3 === void 0 ? void 0 : _columnDef$filterComP3.picker) || 'date',
276
+ showTime: columnDef === null || columnDef === void 0 || (_columnDef$filterComP = columnDef.filterComProps) === null || _columnDef$filterComP === void 0 ? void 0 : _columnDef$filterComP.showTime,
277
+ format: (columnDef === null || columnDef === void 0 || (_columnDef$filterComP2 = columnDef.filterComProps) === null || _columnDef$filterComP2 === void 0 ? void 0 : _columnDef$filterComP2.format) || defaultDateFormat,
278
+ picker: (columnDef === null || columnDef === void 0 || (_columnDef$filterComP3 = columnDef.filterComProps) === null || _columnDef$filterComP3 === void 0 ? void 0 : _columnDef$filterComP3.picker) || 'date',
279
279
  onChange: function onChange(date) {
280
280
  var _columnDef$filterComP4;
281
- return handleChangeFilterValue(date ? date.format(((_columnDef$filterComP4 = columnDef.filterComProps) === null || _columnDef$filterComP4 === void 0 ? void 0 : _columnDef$filterComP4.format) || defaultDateFormat) : undefined);
281
+ return handleChangeFilterValue(date ? date.format((columnDef === null || columnDef === void 0 || (_columnDef$filterComP4 = columnDef.filterComProps) === null || _columnDef$filterComP4 === void 0 ? void 0 : _columnDef$filterComP4.format) || defaultDateFormat) : undefined);
282
282
  },
283
283
  style: {
284
284
  width: 188
@@ -111,7 +111,7 @@ export var getFormatFilters = function getFormatFilters(columns, originFilters)
111
111
  var _ref4 = curColumn || {},
112
112
  filterType = _ref4.filterType,
113
113
  filterKey = _ref4.filterKey;
114
- var _ref5 = curColumn.filterComProps || {},
114
+ var _ref5 = (curColumn === null || curColumn === void 0 ? void 0 : curColumn.filterComProps) || {},
115
115
  _ref5$format = _ref5.format,
116
116
  format = _ref5$format === void 0 ? defaultDateFormat : _ref5$format;
117
117
  // 优先取formattedFilterKey作为key
@@ -163,7 +163,7 @@ export var getFormatFiltersV2 = function getFormatFiltersV2(columns, originFilte
163
163
  var _ref6 = curColumn || {},
164
164
  filterType = _ref6.filterType,
165
165
  filterKey = _ref6.filterKey;
166
- // const { format = defaultDateFormat } = curColumn.filterComProps || {};
166
+ // const { format = defaultDateFormat } = curColumn?.filterComProps || {};
167
167
  // 优先取formattedFilterKey作为key
168
168
  var formatKey = filterKey || id;
169
169
  var res = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arim-aisdc/public-components",
3
- "version": "2.3.78",
3
+ "version": "2.3.80",
4
4
  "description": "前端组件库",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",