@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.esm.js
CHANGED
|
@@ -2352,7 +2352,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2352
2352
|
}
|
|
2353
2353
|
const skipHeader = sizeColumns === "auto-skip-headers" && !isEmpty(params.rowData);
|
|
2354
2354
|
if (sizeColumns === "auto" || skipHeader) {
|
|
2355
|
-
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current });
|
|
2355
|
+
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
|
|
2356
2356
|
if (isEmpty(params.rowData)) {
|
|
2357
2357
|
if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
|
|
2358
2358
|
hasSetContentSizeEmpty.current = true;
|
|
@@ -4716,13 +4716,15 @@ const GridContextProvider = (props) => {
|
|
|
4716
4716
|
/**
|
|
4717
4717
|
* Resize columns to fit container
|
|
4718
4718
|
*/
|
|
4719
|
-
const autoSizeColumns = useCallback(({ skipHeader, colIds, userSizedColIds } = {}) => {
|
|
4719
|
+
const autoSizeColumns = useCallback(({ skipHeader, colIds, userSizedColIds, includeFlex } = {}) => {
|
|
4720
4720
|
if (!columnApi)
|
|
4721
4721
|
return null;
|
|
4722
4722
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
4723
4723
|
const colsToResize = columnApi.getColumnState().filter((colState) => {
|
|
4724
4724
|
const colId = colState.colId;
|
|
4725
|
-
return (isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
4725
|
+
return ((isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
4726
|
+
!userSizedColIds?.has(colId) &&
|
|
4727
|
+
(includeFlex || !colState.flex));
|
|
4726
4728
|
});
|
|
4727
4729
|
if (!isEmpty(colsToResize)) {
|
|
4728
4730
|
columnApi.autoSizeColumns(colsToResize.map((colState) => colState.colId), skipHeader);
|