@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.
- package/dist/src/contexts/GridContext.d.ts +1 -0
- package/dist/src/utils/testUtil.d.ts +2 -2
- 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/src/utils/testUtil.ts +2 -2
package/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -153,7 +153,7 @@ export const Grid = ({
|
|
|
153
153
|
|
|
154
154
|
const skipHeader = sizeColumns === "auto-skip-headers" && !isEmpty(params.rowData);
|
|
155
155
|
if (sizeColumns === "auto" || skipHeader) {
|
|
156
|
-
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current });
|
|
156
|
+
const result = autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, includeFlex: true });
|
|
157
157
|
if (isEmpty(params.rowData)) {
|
|
158
158
|
if (!hasSetContentSizeEmpty.current && result && !hasSetContentSize.current) {
|
|
159
159
|
hasSetContentSizeEmpty.current = true;
|
|
@@ -394,12 +394,16 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
|
|
|
394
394
|
* Resize columns to fit container
|
|
395
395
|
*/
|
|
396
396
|
const autoSizeColumns = useCallback(
|
|
397
|
-
({ skipHeader, colIds, userSizedColIds }: AutoSizeColumnsProps = {}): AutoSizeColumnsResult => {
|
|
397
|
+
({ skipHeader, colIds, userSizedColIds, includeFlex }: AutoSizeColumnsProps = {}): AutoSizeColumnsResult => {
|
|
398
398
|
if (!columnApi) return null;
|
|
399
399
|
const colIdsSet = colIds instanceof Set ? colIds : new Set(colIds);
|
|
400
400
|
const colsToResize = columnApi.getColumnState().filter((colState) => {
|
|
401
401
|
const colId = colState.colId;
|
|
402
|
-
return (
|
|
402
|
+
return (
|
|
403
|
+
(isEmpty(colIdsSet) || colIdsSet.has(colId)) &&
|
|
404
|
+
!userSizedColIds?.has(colId) &&
|
|
405
|
+
(includeFlex || !colState.flex)
|
|
406
|
+
);
|
|
403
407
|
});
|
|
404
408
|
if (!isEmpty(colsToResize)) {
|
|
405
409
|
columnApi.autoSizeColumns(
|
package/src/utils/testUtil.ts
CHANGED
|
@@ -216,12 +216,12 @@ export const clickActionButton = async (text: string, container?: HTMLElement):
|
|
|
216
216
|
await user.click(button);
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
export const waitForGridReady = async (props?: { grid?: HTMLElement; timeout
|
|
219
|
+
export const waitForGridReady = async (props?: { grid?: HTMLElement; timeout?: number }) =>
|
|
220
220
|
waitFor(() => expect(getAllQuick({ classes: ".Grid-ready" }, props?.grid)).toBeInTheDocument(), {
|
|
221
221
|
timeout: props?.timeout ?? 5000,
|
|
222
222
|
});
|
|
223
223
|
|
|
224
|
-
export const waitForGridRows = async (props?: { grid?: HTMLElement; timeout
|
|
224
|
+
export const waitForGridRows = async (props?: { grid?: HTMLElement; timeout?: number }) =>
|
|
225
225
|
waitFor(async () => expect(getAllQuick({ classes: ".ag-row" }, props?.grid).length > 0).toBe(true), {
|
|
226
226
|
timeout: props?.timeout ?? 5000,
|
|
227
227
|
});
|