@gpa-gemstone/react-table 1.2.60 → 1.2.61
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.
- package/lib/Table/Table.js +5 -5
- package/package.json +1 -1
package/lib/Table/Table.js
CHANGED
|
@@ -121,7 +121,7 @@ function Table(props) {
|
|
|
121
121
|
if (React.isValidElement(element) && IsColumnProps(element.props)) {
|
|
122
122
|
if (newMap.get(element.props.Key) != null)
|
|
123
123
|
console.error("Multiple of the same key detected in table, this will cause issues.");
|
|
124
|
-
newMap.set(element.props.Key, { minWidth: 10, maxWidth:
|
|
124
|
+
newMap.set(element.props.Key, { minWidth: 10, maxWidth: undefined, width: 100 });
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
// If width is the same and keys are identical, we can skip the operation
|
|
@@ -197,9 +197,9 @@ function Table(props) {
|
|
|
197
197
|
// This follows behavior consistent with MDN documentation on how these width types should behave
|
|
198
198
|
if (widthObj.minWidth > widthObj.width)
|
|
199
199
|
widthObj.width = widthObj.minWidth;
|
|
200
|
-
if (widthObj.minWidth > widthObj.maxWidth)
|
|
200
|
+
if (widthObj.maxWidth != null && widthObj.minWidth > widthObj.maxWidth)
|
|
201
201
|
widthObj.maxWidth = widthObj.minWidth;
|
|
202
|
-
if (widthObj.width > widthObj.maxWidth)
|
|
202
|
+
if (widthObj.maxWidth != null && widthObj.width > widthObj.maxWidth)
|
|
203
203
|
widthObj.width = widthObj.maxWidth;
|
|
204
204
|
// Constrain Width to remainingSpace
|
|
205
205
|
if (widthObj.width > remainingSpace)
|
|
@@ -376,9 +376,9 @@ function Header(props) {
|
|
|
376
376
|
if (widthObjLeft == null || widthObjRight == null)
|
|
377
377
|
return ({ min: -Infinity, max: Infinity });
|
|
378
378
|
const limitByShrinkLeft = widthObjLeft.width - widthObjLeft.minWidth;
|
|
379
|
-
const limitByGrowthLeft = widthObjLeft.maxWidth - widthObjLeft.width;
|
|
379
|
+
const limitByGrowthLeft = widthObjLeft.maxWidth == null ? Number.MAX_SAFE_INTEGER : (widthObjLeft.maxWidth - widthObjLeft.width);
|
|
380
380
|
const limitByShrinkRight = widthObjRight.width - widthObjRight.minWidth;
|
|
381
|
-
const limitByGrowthRight = widthObjRight.maxWidth - widthObjRight.width;
|
|
381
|
+
const limitByGrowthRight = widthObjRight.maxWidth == null ? Number.MAX_SAFE_INTEGER : (widthObjRight.maxWidth - widthObjRight.width);
|
|
382
382
|
// Recall that a left movement is a negative deltaW
|
|
383
383
|
const minDeltaW = -(limitByShrinkLeft < limitByGrowthRight ? limitByShrinkLeft : limitByGrowthRight);
|
|
384
384
|
const maxDeltaW = limitByShrinkRight < limitByGrowthLeft ? limitByShrinkRight : limitByGrowthLeft;
|