@linzjs/step-ag-grid 35.2.0 → 35.2.2
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 +7 -5
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +7 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +5 -3
- package/src/contexts/GridPopoverContextProvider.tsx +7 -2
- package/src/stories/grid/GridColumnState.stories.tsx +101 -10
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -66318,15 +66318,16 @@ const Grid = ({
|
|
|
66318
66318
|
return r;
|
|
66319
66319
|
};
|
|
66320
66320
|
}
|
|
66321
|
+
const userWidth = userSizedColIds.current.get(colDef.colId ?? colDef.field ?? "");
|
|
66321
66322
|
const adjustedColDef = {
|
|
66322
66323
|
...colDef,
|
|
66323
|
-
//
|
|
66324
|
-
width: colDef.flex ? void 0 : colDef.width,
|
|
66324
|
+
// Flex columns ignore width, so only a user-sized (no longer flex) column gets one
|
|
66325
|
+
width: userWidth ?? (colDef.flex ? void 0 : colDef.width),
|
|
66325
66326
|
...!!colDef.flex && { flexAutoSizeWidth: colDef.width },
|
|
66326
66327
|
// If this is allowed flex columns don't size based on flex
|
|
66327
66328
|
suppressSizeToFit: true,
|
|
66328
66329
|
// Auto-sizing flex columns breaks everything
|
|
66329
|
-
flex,
|
|
66330
|
+
flex: userWidth != null ? void 0 : flex,
|
|
66330
66331
|
suppressAutoSize: !!flex,
|
|
66331
66332
|
sortable,
|
|
66332
66333
|
comparator
|
|
@@ -66716,15 +66717,16 @@ const GridPopoverContextProvider = (props2) => {
|
|
|
66716
66717
|
);
|
|
66717
66718
|
const field = props.colDef?.field ?? "";
|
|
66718
66719
|
const colId = props.colDef?.colId ?? field ?? "";
|
|
66720
|
+
const updatingKey = props.colDef?.field ?? props.colDef?.colId ?? "";
|
|
66719
66721
|
const updateValue = useCallback(
|
|
66720
66722
|
async (saveFn, tabDirection) => {
|
|
66721
66723
|
if (hasSaved.current) {
|
|
66722
66724
|
return true;
|
|
66723
66725
|
}
|
|
66724
66726
|
hasSaved.current = true;
|
|
66725
|
-
return saving ? false : await updatingCells({ selectedRows, field }, saveFn, setSaving, tabDirection);
|
|
66727
|
+
return saving ? false : await updatingCells({ selectedRows, field: updatingKey }, saveFn, setSaving, tabDirection);
|
|
66726
66728
|
},
|
|
66727
|
-
[
|
|
66729
|
+
[saving, selectedRows, updatingCells, updatingKey]
|
|
66728
66730
|
);
|
|
66729
66731
|
return /* @__PURE__ */ jsx(
|
|
66730
66732
|
GridPopoverContext.Provider,
|