@linzjs/step-ag-grid 17.0.4 → 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.
@@ -7,6 +7,7 @@ export interface AutoSizeColumnsProps {
7
7
  skipHeader?: boolean;
8
8
  colIds?: Set<string> | string[];
9
9
  userSizedColIds?: Set<string>;
10
+ includeFlex?: boolean;
10
11
  }
11
12
  export type AutoSizeColumnsResult = {
12
13
  width: number;
@@ -37,9 +37,9 @@ export declare const findActionButton: (text: string, container?: HTMLElement) =
37
37
  export declare const clickActionButton: (text: string, container?: HTMLElement) => Promise<void>;
38
38
  export declare const waitForGridReady: (props?: {
39
39
  grid?: HTMLElement;
40
- timeout: number;
40
+ timeout?: number;
41
41
  }) => Promise<void>;
42
42
  export declare const waitForGridRows: (props?: {
43
43
  grid?: HTMLElement;
44
- timeout: number;
44
+ timeout?: number;
45
45
  }) => Promise<void>;
@@ -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)) && !userSizedColIds?.has(colId) && !colState.flex;
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);