carbon-addons-iot-react 5.15.0 → 5.15.2
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.
|
@@ -1089,7 +1089,7 @@ var Table = function Table(props) {
|
|
|
1089
1089
|
preventInteraction: rowEditMode || singleRowEditMode,
|
|
1090
1090
|
testId: "".concat(id || testId, "-table-pagination"),
|
|
1091
1091
|
size: paginationProps.size,
|
|
1092
|
-
maxPagesConditionalStyle: paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
1092
|
+
maxPagesConditionalStyle: Math.ceil(maxPages * paginationProps.pageSize) < paginationProps.totalItems ? false : paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
1093
1093
|
}) : null, options.hasMultiSort && /*#__PURE__*/React__default.createElement(TableMultiSortModal, {
|
|
1094
1094
|
testId: "".concat(id, "-multi-sort-modal"),
|
|
1095
1095
|
columns: columns,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
3
|
import debounce from '../../../node_modules/lodash-es/debounce.js';
|
|
@@ -272,21 +271,27 @@ var TableHead = function TableHead(_ref) {
|
|
|
272
271
|
};
|
|
273
272
|
var onManualColumnResize = function onManualColumnResize(modifiedColumnWidths) {
|
|
274
273
|
if (percentageMode) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
delete modifiedColumns[key].width;
|
|
279
|
-
}
|
|
280
|
-
});
|
|
274
|
+
// Measure current rendered widths BEFORE switching to pixel mode
|
|
275
|
+
// This prevents unused space by preserving actual column widths
|
|
276
|
+
var measuredWidths = measureColumnWidths();
|
|
281
277
|
|
|
282
|
-
//
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
278
|
+
// Convert measured widths directly to column format with pixel values
|
|
279
|
+
// This preserves the actual rendered widths instead of using defaults
|
|
280
|
+
var columnsWithMeasuredWidths = columns.map(function (col) {
|
|
281
|
+
var measured = measuredWidths.find(function (m) {
|
|
282
|
+
return m.id === col.id;
|
|
283
|
+
});
|
|
284
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
285
|
+
width: measured ? "".concat(measured.width, "px") : col.width
|
|
286
|
+
});
|
|
287
287
|
});
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
|
|
289
|
+
// Create width map from columns with measured values, then apply user's resize
|
|
290
|
+
var newColumnWidths = createNewWidthsMap(ordering, columnsWithMeasuredWidths, modifiedColumnWidths);
|
|
291
|
+
|
|
292
|
+
// Update both state and notify parent component
|
|
293
|
+
// This ensures horizontal scrollbar appears if total width exceeds container
|
|
294
|
+
updateColumnWidths(newColumnWidths);
|
|
290
295
|
setPercentageMode(false);
|
|
291
296
|
} else {
|
|
292
297
|
var _newColumnWidths = createNewWidthsMap(ordering, currentColumnWidths, modifiedColumnWidths);
|
|
@@ -1106,7 +1106,7 @@ var Table = function Table(props) {
|
|
|
1106
1106
|
preventInteraction: rowEditMode || singleRowEditMode,
|
|
1107
1107
|
testId: "".concat(id || testId, "-table-pagination"),
|
|
1108
1108
|
size: paginationProps.size,
|
|
1109
|
-
maxPagesConditionalStyle: paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
1109
|
+
maxPagesConditionalStyle: Math.ceil(maxPages * paginationProps.pageSize) < paginationProps.totalItems ? false : paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
1110
1110
|
}) : null, options.hasMultiSort && /*#__PURE__*/React__default.default.createElement(TableMultiSortModal, {
|
|
1111
1111
|
testId: "".concat(id, "-multi-sort-modal"),
|
|
1112
1112
|
columns: columns,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
4
3
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
5
|
var debounce = require('../../../node_modules/lodash-es/debounce.js');
|
|
@@ -49,7 +48,6 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
49
48
|
|
|
50
49
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
51
50
|
|
|
52
|
-
var _toConsumableArray__default = /*#__PURE__*/_interopDefault(_toConsumableArray);
|
|
53
51
|
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
|
|
54
52
|
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
|
|
55
53
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
@@ -284,21 +282,27 @@ var TableHead = function TableHead(_ref) {
|
|
|
284
282
|
};
|
|
285
283
|
var onManualColumnResize = function onManualColumnResize(modifiedColumnWidths) {
|
|
286
284
|
if (percentageMode) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
delete modifiedColumns[key].width;
|
|
291
|
-
}
|
|
292
|
-
});
|
|
285
|
+
// Measure current rendered widths BEFORE switching to pixel mode
|
|
286
|
+
// This prevents unused space by preserving actual column widths
|
|
287
|
+
var measuredWidths = measureColumnWidths();
|
|
293
288
|
|
|
294
|
-
//
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
// Convert measured widths directly to column format with pixel values
|
|
290
|
+
// This preserves the actual rendered widths instead of using defaults
|
|
291
|
+
var columnsWithMeasuredWidths = columns.map(function (col) {
|
|
292
|
+
var measured = measuredWidths.find(function (m) {
|
|
293
|
+
return m.id === col.id;
|
|
294
|
+
});
|
|
295
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
296
|
+
width: measured ? "".concat(measured.width, "px") : col.width
|
|
297
|
+
});
|
|
299
298
|
});
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
|
|
300
|
+
// Create width map from columns with measured values, then apply user's resize
|
|
301
|
+
var newColumnWidths = columnWidthUtilityFunctions.createNewWidthsMap(ordering, columnsWithMeasuredWidths, modifiedColumnWidths);
|
|
302
|
+
|
|
303
|
+
// Update both state and notify parent component
|
|
304
|
+
// This ensures horizontal scrollbar appears if total width exceeds container
|
|
305
|
+
updateColumnWidths(newColumnWidths);
|
|
302
306
|
setPercentageMode(false);
|
|
303
307
|
} else {
|
|
304
308
|
var _newColumnWidths = columnWidthUtilityFunctions.createNewWidthsMap(ordering, currentColumnWidths, modifiedColumnWidths);
|
package/package.json
CHANGED
|
@@ -234295,21 +234295,27 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
234295
234295
|
};
|
|
234296
234296
|
var onManualColumnResize = function onManualColumnResize(modifiedColumnWidths) {
|
|
234297
234297
|
if (percentageMode) {
|
|
234298
|
-
|
|
234299
|
-
|
|
234300
|
-
|
|
234301
|
-
delete modifiedColumns[key].width;
|
|
234302
|
-
}
|
|
234303
|
-
});
|
|
234298
|
+
// Measure current rendered widths BEFORE switching to pixel mode
|
|
234299
|
+
// This prevents unused space by preserving actual column widths
|
|
234300
|
+
var measuredWidths = measureColumnWidths();
|
|
234304
234301
|
|
|
234305
|
-
//
|
|
234306
|
-
|
|
234307
|
-
|
|
234308
|
-
|
|
234309
|
-
|
|
234302
|
+
// Convert measured widths directly to column format with pixel values
|
|
234303
|
+
// This preserves the actual rendered widths instead of using defaults
|
|
234304
|
+
var columnsWithMeasuredWidths = columns.map(function (col) {
|
|
234305
|
+
var measured = measuredWidths.find(function (m) {
|
|
234306
|
+
return m.id === col.id;
|
|
234307
|
+
});
|
|
234308
|
+
return _objectSpread$1R(_objectSpread$1R({}, col), {}, {
|
|
234309
|
+
width: measured ? "".concat(measured.width, "px") : col.width
|
|
234310
|
+
});
|
|
234310
234311
|
});
|
|
234311
|
-
|
|
234312
|
-
|
|
234312
|
+
|
|
234313
|
+
// Create width map from columns with measured values, then apply user's resize
|
|
234314
|
+
var newColumnWidths = createNewWidthsMap(ordering, columnsWithMeasuredWidths, modifiedColumnWidths);
|
|
234315
|
+
|
|
234316
|
+
// Update both state and notify parent component
|
|
234317
|
+
// This ensures horizontal scrollbar appears if total width exceeds container
|
|
234318
|
+
updateColumnWidths(newColumnWidths);
|
|
234313
234319
|
setPercentageMode(false);
|
|
234314
234320
|
} else {
|
|
234315
234321
|
var _newColumnWidths = createNewWidthsMap(ordering, currentColumnWidths, modifiedColumnWidths);
|
|
@@ -247830,7 +247836,7 @@ ${formatRule(Codicon.menuSubmenu)}
|
|
|
247830
247836
|
preventInteraction: rowEditMode || singleRowEditMode,
|
|
247831
247837
|
testId: "".concat(id || testId, "-table-pagination"),
|
|
247832
247838
|
size: paginationProps.size,
|
|
247833
|
-
maxPagesConditionalStyle: paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
247839
|
+
maxPagesConditionalStyle: Math.ceil(maxPages * paginationProps.pageSize) < paginationProps.totalItems ? false : paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
|
|
247834
247840
|
}) : null, options.hasMultiSort && /*#__PURE__*/React$1.createElement(TableMultiSortModal$1, {
|
|
247835
247841
|
testId: "".concat(id, "-multi-sort-modal"),
|
|
247836
247842
|
columns: columns,
|