@linzjs/step-ag-grid 21.0.1 → 21.0.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/dist/step-ag-grid.cjs.js +6 -2
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +6 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +4 -0
- package/src/contexts/GridContextProvider.tsx +2 -2
- package/src/utils/testUtil.ts +1 -1
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2362,6 +2362,10 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2362
2362
|
const skipHeader = sizeColumns === "auto-skip-headers" && gridRendered === "rows-visible";
|
|
2363
2363
|
if (sizeColumns === "auto" || skipHeader) {
|
|
2364
2364
|
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
|
|
2365
|
+
if (!result) {
|
|
2366
|
+
needsAutoSize.current = true;
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2365
2369
|
if (gridRendered === "empty") {
|
|
2366
2370
|
if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
|
|
2367
2371
|
hasSetContentSizeEmpty.current = true;
|
|
@@ -4823,10 +4827,10 @@ const GridContextProvider = (props) => {
|
|
|
4823
4827
|
* Resize columns to fit container
|
|
4824
4828
|
*/
|
|
4825
4829
|
const autoSizeColumns = useCallback(({ skipHeader, colIds, userSizedColIds, includeFlex } = {}) => {
|
|
4826
|
-
if (!gridApi)
|
|
4830
|
+
if (!gridApi || !gridApi.getColumnState())
|
|
4827
4831
|
return null;
|
|
4828
4832
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
4829
|
-
const colsToResize = gridApi.getColumnState()
|
|
4833
|
+
const colsToResize = gridApi.getColumnState()?.filter?.((colState) => {
|
|
4830
4834
|
const colId = colState.colId;
|
|
4831
4835
|
return ((isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
4832
4836
|
!userSizedColIds?.has(colId) &&
|