@arim-aisdc/public-components 2.3.63 → 2.3.65
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.
|
@@ -51,6 +51,9 @@ var SplitterPane = function SplitterPane(_ref) {
|
|
|
51
51
|
setSizes(defaultCacheSizes);
|
|
52
52
|
}, []);
|
|
53
53
|
useUpdateLayoutEffect(function () {
|
|
54
|
+
console.log(options, options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
55
|
+
return item === null || item === void 0 ? void 0 : item.size;
|
|
56
|
+
}), '3333');
|
|
54
57
|
setSizes(options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
55
58
|
return item === null || item === void 0 ? void 0 : item.size;
|
|
56
59
|
}));
|
|
@@ -58,6 +61,7 @@ var SplitterPane = function SplitterPane(_ref) {
|
|
|
58
61
|
return item === null || item === void 0 ? void 0 : item.size;
|
|
59
62
|
}))]);
|
|
60
63
|
useDeepCompareEffect(function () {
|
|
64
|
+
console.log(sizes, JSON.stringify(sizes), '33331');
|
|
61
65
|
localStorage.setItem(_cacheKeyKey, JSON.stringify(sizes));
|
|
62
66
|
}, [sizes]);
|
|
63
67
|
|
|
@@ -106,9 +110,25 @@ var SplitterPane = function SplitterPane(_ref) {
|
|
|
106
110
|
};
|
|
107
111
|
}, [sizes]);
|
|
108
112
|
var handlePaneResize = useCallback(function (newSizes) {
|
|
109
|
-
|
|
113
|
+
var _convertPixelsToPerce;
|
|
114
|
+
setSizes((_convertPixelsToPerce = convertPixelsToPercentages(newSizes)) !== null && _convertPixelsToPerce !== void 0 ? _convertPixelsToPerce : newSizes);
|
|
110
115
|
onResize === null || onResize === void 0 || onResize(newSizes);
|
|
111
116
|
}, [onResize]);
|
|
117
|
+
|
|
118
|
+
// 将像素值转换为百分比
|
|
119
|
+
var convertPixelsToPercentages = useCallback(function (pixelSizes) {
|
|
120
|
+
var isValidSizes = sizes.every(function (size) {
|
|
121
|
+
return typeof size === 'number' && size > 0;
|
|
122
|
+
});
|
|
123
|
+
if (!isValidSizes) return null;
|
|
124
|
+
var totalSize = pixelSizes.reduce(function (sum, size) {
|
|
125
|
+
return sum + size;
|
|
126
|
+
}, 0);
|
|
127
|
+
return pixelSizes.map(function (size) {
|
|
128
|
+
var percentage = size / totalSize * 100;
|
|
129
|
+
return "".concat(Math.round(percentage), "%");
|
|
130
|
+
});
|
|
131
|
+
}, []);
|
|
112
132
|
return /*#__PURE__*/_jsx(Splitter, {
|
|
113
133
|
layout: layout,
|
|
114
134
|
onResize: handlePaneResize,
|
|
@@ -536,10 +536,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
536
536
|
right: (_cache$columnPinning$2 = cache === null || cache === void 0 || (_cache$columnPinning2 = cache.columnPinning) === null || _cache$columnPinning2 === void 0 || (_cache$columnPinning2 = _cache$columnPinning2.right) === null || _cache$columnPinning2 === void 0 ? void 0 : _cache$columnPinning2.filter(function (id) {
|
|
537
537
|
return columnsIdSet.has(id);
|
|
538
538
|
})) !== null && _cache$columnPinning$2 !== void 0 ? _cache$columnPinning$2 : []
|
|
539
|
-
} :
|
|
540
|
-
left: [],
|
|
541
|
-
right: []
|
|
542
|
-
}
|
|
539
|
+
} : undefined
|
|
543
540
|
}),
|
|
544
541
|
cacheColumnVisibility = _ref5.columnVisibility,
|
|
545
542
|
cacheColumnOrder = _ref5.columnOrder,
|