@arim-aisdc/public-components 2.3.53 → 2.3.54
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.
|
@@ -511,7 +511,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
511
511
|
|
|
512
512
|
/**根据缓存数据设置一些状态 */
|
|
513
513
|
var setColumnInfoFromCache = function setColumnInfoFromCache(tableColumns) {
|
|
514
|
-
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
514
|
+
var _localStorage$getItem, _tableMaxConfig$cache, _cache$columnVisibili, _cache$columnPinning$, _cache$columnPinning, _cache$columnPinning$2, _cache$columnPinning2;
|
|
515
515
|
var cache = JSON.parse((_localStorage$getItem = localStorage.getItem(tableKey)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : '{}');
|
|
516
516
|
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)) {
|
|
517
517
|
return;
|
|
@@ -529,7 +529,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
529
529
|
}));
|
|
530
530
|
};
|
|
531
531
|
var _ref5 = _objectSpread(_objectSpread({}, cache), {}, {
|
|
532
|
-
columnVisibility: cache.columnVisibility ? pickByKeys(cache.columnVisibility, columnsIdSet) : {},
|
|
532
|
+
columnVisibility: cache.columnVisibility ? pickByKeys((_cache$columnVisibili = cache.columnVisibility) !== null && _cache$columnVisibili !== void 0 ? _cache$columnVisibili : {}, columnsIdSet) : {},
|
|
533
533
|
columnPinning: cache.columnPinning ? {
|
|
534
534
|
left: (_cache$columnPinning$ = cache === null || cache === void 0 || (_cache$columnPinning = cache.columnPinning) === null || _cache$columnPinning === void 0 || (_cache$columnPinning = _cache$columnPinning.left) === null || _cache$columnPinning === void 0 ? void 0 : _cache$columnPinning.filter(function (id) {
|
|
535
535
|
return columnsIdSet.has(id);
|
|
@@ -230,6 +230,7 @@ export var useColumnWidth = function useColumnWidth(_ref) {
|
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
} else {
|
|
233
|
+
var _cache$columnSizing, _cache$columnVisibili;
|
|
233
234
|
var columnsIdSet = new Set(columns.map(function (column) {
|
|
234
235
|
return column.id;
|
|
235
236
|
}));
|
|
@@ -244,8 +245,8 @@ export var useColumnWidth = function useColumnWidth(_ref) {
|
|
|
244
245
|
};
|
|
245
246
|
|
|
246
247
|
// 主逻辑
|
|
247
|
-
Object.assign(initColumnsSizeMap, pickByKeys(cache.columnSizing, columnsIdSet));
|
|
248
|
-
Object.assign(columnVisibleConfig, pickByKeys(cache.columnVisibility, columnsIdSet));
|
|
248
|
+
Object.assign(initColumnsSizeMap, pickByKeys((_cache$columnSizing = cache.columnSizing) !== null && _cache$columnSizing !== void 0 ? _cache$columnSizing : {}, columnsIdSet));
|
|
249
|
+
Object.assign(columnVisibleConfig, pickByKeys((_cache$columnVisibili = cache.columnVisibility) !== null && _cache$columnVisibili !== void 0 ? _cache$columnVisibili : {}, columnsIdSet));
|
|
249
250
|
Object.keys(initColumnsSizeMap).forEach(function (key) {
|
|
250
251
|
if (columnVisibleConfig[key] !== false) {
|
|
251
252
|
visibleColumnsSizeMap[key] = initColumnsSizeMap[key];
|