@linzjs/step-ag-grid 29.11.2 → 29.11.3

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "29.11.2",
5
+ "version": "29.11.3",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -14,6 +14,7 @@ import {
14
14
  GetRowIdParams,
15
15
  GridOptions,
16
16
  GridReadyEvent,
17
+ GridSizeChangedEvent,
17
18
  ModelUpdatedEvent,
18
19
  ModuleRegistry,
19
20
  RowClickedEvent,
@@ -261,7 +262,6 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
261
262
  console.error('Unknown value returned from hasGridRendered');
262
263
  }
263
264
  } else {
264
- console.log('sizeColumnsToFit 3');
265
265
  sizeColumnsToFit();
266
266
  }
267
267
 
@@ -853,6 +853,15 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
853
853
  selectable,
854
854
  ]);
855
855
 
856
+ const onGridSizeChanged = useCallback(
857
+ (event: GridSizeChangedEvent<TData>) => {
858
+ if (sizeColumns === 'fit') {
859
+ event.api.sizeColumnsToFit();
860
+ }
861
+ },
862
+ [sizeColumns],
863
+ );
864
+
856
865
  return (
857
866
  <div
858
867
  data-testid={dataTestId}
@@ -883,6 +892,7 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
883
892
  getRowId={getRowId}
884
893
  suppressColumnVirtualisation={suppressColumnVirtualization}
885
894
  suppressClickEdit={true}
895
+ onGridSizeChanged={onGridSizeChanged}
886
896
  onColumnVisible={setInitialContentSize}
887
897
  onRowDataUpdated={onRowDataUpdated}
888
898
  onCellFocused={onCellFocused}