@linzjs/step-ag-grid 21.0.3 → 21.1.0
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/README.md +1 -1
- package/dist/src/contexts/GridPopoverContext.d.ts +1 -0
- package/dist/step-ag-grid.cjs.js +17 -8
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +17 -8
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +14 -10
- package/src/contexts/GridPopoverContext.tsx +2 -0
- package/src/contexts/GridPopoverContextProvider.tsx +3 -0
package/README.md
CHANGED
package/dist/step-ag-grid.cjs.js
CHANGED
|
@@ -2369,13 +2369,13 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2369
2369
|
return;
|
|
2370
2370
|
}
|
|
2371
2371
|
if (gridRendered === "empty") {
|
|
2372
|
-
if (!hasSetContentSizeEmpty.current &&
|
|
2372
|
+
if (!hasSetContentSizeEmpty.current && !hasSetContentSize.current) {
|
|
2373
2373
|
hasSetContentSizeEmpty.current = true;
|
|
2374
2374
|
params.onContentSize?.(result);
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
else if (gridRendered === "rows-visible") {
|
|
2378
|
-
if (
|
|
2378
|
+
if (!hasSetContentSize.current) {
|
|
2379
2379
|
hasSetContentSize.current = true;
|
|
2380
2380
|
params.onContentSize?.(result);
|
|
2381
2381
|
}
|
|
@@ -2586,7 +2586,9 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2586
2586
|
if (!lodashEs.isEmpty(updatingCols()))
|
|
2587
2587
|
return;
|
|
2588
2588
|
const skipHeader = sizeColumns === "auto-skip-headers";
|
|
2589
|
-
|
|
2589
|
+
if (hasSetContentSize.current) {
|
|
2590
|
+
autoSizeColumns({ skipHeader, userSizedColIds: userSizedColIds.current, colIds: colIdsEdited.current });
|
|
2591
|
+
}
|
|
2590
2592
|
colIdsEdited.current.clear();
|
|
2591
2593
|
}, [autoSizeColumns, rowData?.length, setInitialContentSize, sizeColumns, updatedDep, updatingCols]);
|
|
2592
2594
|
/**
|
|
@@ -2699,11 +2701,15 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2699
2701
|
if (!lodashEs.isEmpty(colIdsEdited.current)) {
|
|
2700
2702
|
const skipHeader = sizeColumns === "auto-skip-headers";
|
|
2701
2703
|
if (sizeColumns === "auto" || skipHeader) {
|
|
2702
|
-
lodashEs.defer(() =>
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2704
|
+
lodashEs.defer(() => {
|
|
2705
|
+
if (hasSetContentSize.current) {
|
|
2706
|
+
autoSizeColumns({
|
|
2707
|
+
skipHeader,
|
|
2708
|
+
userSizedColIds: userSizedColIds.current,
|
|
2709
|
+
colIds: colIdsEdited.current,
|
|
2710
|
+
});
|
|
2711
|
+
}
|
|
2712
|
+
});
|
|
2707
2713
|
}
|
|
2708
2714
|
colIdsEdited.current.clear();
|
|
2709
2715
|
}
|
|
@@ -2808,6 +2814,7 @@ const GridPopoverContext = React.createContext({
|
|
|
2808
2814
|
anchorRef: { current: null },
|
|
2809
2815
|
saving: false,
|
|
2810
2816
|
setSaving: () => { },
|
|
2817
|
+
colId: "",
|
|
2811
2818
|
field: "",
|
|
2812
2819
|
value: null,
|
|
2813
2820
|
data: {},
|
|
@@ -2828,6 +2835,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
|
|
|
2828
2835
|
// Then item that is clicked on will always be first in the list
|
|
2829
2836
|
const selectedRows = React.useMemo(() => multiEdit ? lodashEs.sortBy(getFilteredSelectedRows(), (row) => row.id !== props.data.id) : [props.data], [getFilteredSelectedRows, multiEdit, props.data]);
|
|
2830
2837
|
const field = props.colDef?.field ?? "";
|
|
2838
|
+
const colId = props.colDef?.colId ?? field ?? "";
|
|
2831
2839
|
const updateValue = React.useCallback(async (saveFn, tabDirection) => {
|
|
2832
2840
|
if (hasSaved.current)
|
|
2833
2841
|
return true;
|
|
@@ -2839,6 +2847,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
|
|
|
2839
2847
|
saving,
|
|
2840
2848
|
setSaving,
|
|
2841
2849
|
selectedRows,
|
|
2850
|
+
colId,
|
|
2842
2851
|
field,
|
|
2843
2852
|
data: props.data,
|
|
2844
2853
|
value: props.value,
|