@linzjs/step-ag-grid 34.0.0 → 34.0.1
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
package/src/components/Grid.tsx
CHANGED
|
@@ -172,7 +172,9 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
172
172
|
// ─── Spread Remaining Params ──────────────────
|
|
173
173
|
...params
|
|
174
174
|
}: GridProps<TData>): ReactElement => {
|
|
175
|
-
|
|
175
|
+
// 'fit' sizing is deterministic flex layout, not content-measured autosize - it doesn't need
|
|
176
|
+
// (and must keep working under) the Chromatic override below.
|
|
177
|
+
if (isChromatic() && sizeColumns !== 'fit') {
|
|
176
178
|
sizeColumns = 'none';
|
|
177
179
|
}
|
|
178
180
|
|
|
@@ -492,13 +494,15 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
492
494
|
'GridCell-readonly': (ccp: CellClassParams<TData>) =>
|
|
493
495
|
!suppressReadOnlyStyle && !editable(ccp as unknown as EditableCallbackParams<TData>),
|
|
494
496
|
},
|
|
495
|
-
// If chromatic we fix the size to minWidth if set otherwise 120px
|
|
496
|
-
//
|
|
497
|
-
|
|
497
|
+
// If chromatic we fix the size to minWidth if set otherwise 120px, so non-deterministic
|
|
498
|
+
// content measurement doesn't affect the snapshot - except under 'fit', which sizes via
|
|
499
|
+
// flex (proportional to the container) rather than measured content, so it's already
|
|
500
|
+
// deterministic and must keep the user's configured width.
|
|
501
|
+
width: isChromatic() && sizeColumns !== 'fit' ? colDef.minWidth || 120 : colDef.width,
|
|
498
502
|
};
|
|
499
503
|
}
|
|
500
504
|
},
|
|
501
|
-
[params.defaultColDef?.editable, params.loading, params.readOnly, suppressReadOnlyStyle],
|
|
505
|
+
[params.defaultColDef?.editable, params.loading, params.readOnly, suppressReadOnlyStyle, sizeColumns],
|
|
502
506
|
);
|
|
503
507
|
|
|
504
508
|
/**
|
|
@@ -451,7 +451,7 @@ export const GridContextProvider = <TData extends GridBaseRow>(props: PropsWithC
|
|
|
451
451
|
}, [gridApiOp]);
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
|
-
* Resize columns to fit container
|
|
454
|
+
* Resize columns to fit container.
|
|
455
455
|
*
|
|
456
456
|
* This is used to calculate the preferred size of columns.
|
|
457
457
|
* It sizes the flex columns first and then clears the calculated width.
|