@linzjs/step-ag-grid 17.0.5 → 17.0.6
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/dist/src/contexts/GridContext.d.ts +1 -0
- package/dist/step-ag-grid.cjs.js +5 -3
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +5 -3
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +1 -1
- package/src/contexts/GridContext.tsx +1 -0
- package/src/contexts/GridContextProvider.tsx +6 -2
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -2373,7 +2373,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2373
2373
|
}
|
|
2374
2374
|
const skipHeader = sizeColumns === "auto-skip-headers" && !lodashEs.isEmpty(params.rowData);
|
|
2375
2375
|
if (sizeColumns === "auto" || skipHeader) {
|
|
2376
|
-
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current });
|
|
2376
|
+
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
|
|
2377
2377
|
if (lodashEs.isEmpty(params.rowData)) {
|
|
2378
2378
|
if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
|
|
2379
2379
|
hasSetContentSizeEmpty.current = true;
|
|
@@ -4737,13 +4737,15 @@ const GridContextProvider = (props) => {
|
|
|
4737
4737
|
/**
|
|
4738
4738
|
* Resize columns to fit container
|
|
4739
4739
|
*/
|
|
4740
|
-
const autoSizeColumns = React.useCallback(({ skipHeader, colIds, userSizedColIds } = {}) => {
|
|
4740
|
+
const autoSizeColumns = React.useCallback(({ skipHeader, colIds, userSizedColIds, includeFlex } = {}) => {
|
|
4741
4741
|
if (!columnApi)
|
|
4742
4742
|
return null;
|
|
4743
4743
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
4744
4744
|
const colsToResize = columnApi.getColumnState().filter((colState) => {
|
|
4745
4745
|
const colId = colState.colId;
|
|
4746
|
-
return (lodashEs.isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
4746
|
+
return ((lodashEs.isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
4747
|
+
!userSizedColIds?.has(colId) &&
|
|
4748
|
+
(includeFlex || !colState.flex));
|
|
4747
4749
|
});
|
|
4748
4750
|
if (!lodashEs.isEmpty(colsToResize)) {
|
|
4749
4751
|
columnApi.autoSizeColumns(colsToResize.map((colState) => colState.colId), skipHeader);
|