@linzjs/step-ag-grid 21.0.4 → 21.1.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/README.md +1 -1
- package/dist/src/contexts/GridPopoverContext.d.ts +1 -0
- package/dist/step-ag-grid.cjs.js +12 -2
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +12 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +9 -2
- 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
|
@@ -2349,6 +2349,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2349
2349
|
const hasSetContentSize = React.useRef(false);
|
|
2350
2350
|
const hasSetContentSizeEmpty = React.useRef(false);
|
|
2351
2351
|
const needsAutoSize = React.useRef(true);
|
|
2352
|
+
const lastFullResize = React.useRef();
|
|
2352
2353
|
const setInitialContentSize = React.useCallback(() => {
|
|
2353
2354
|
if (!gridDivRef.current?.clientWidth || rowData == null) {
|
|
2354
2355
|
// Don't resize grids if they are offscreen as it doesn't work.
|
|
@@ -2376,8 +2377,14 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
|
|
|
2376
2377
|
}
|
|
2377
2378
|
else if (gridRendered === "rows-visible") {
|
|
2378
2379
|
if (!hasSetContentSize.current) {
|
|
2379
|
-
|
|
2380
|
-
|
|
2380
|
+
if (lastFullResize.current === result.width) {
|
|
2381
|
+
hasSetContentSize.current = true;
|
|
2382
|
+
params.onContentSize?.(result);
|
|
2383
|
+
}
|
|
2384
|
+
else {
|
|
2385
|
+
needsAutoSize.current = true;
|
|
2386
|
+
}
|
|
2387
|
+
lastFullResize.current = result.width;
|
|
2381
2388
|
}
|
|
2382
2389
|
}
|
|
2383
2390
|
else {
|
|
@@ -2814,6 +2821,7 @@ const GridPopoverContext = React.createContext({
|
|
|
2814
2821
|
anchorRef: { current: null },
|
|
2815
2822
|
saving: false,
|
|
2816
2823
|
setSaving: () => { },
|
|
2824
|
+
colId: "",
|
|
2817
2825
|
field: "",
|
|
2818
2826
|
value: null,
|
|
2819
2827
|
data: {},
|
|
@@ -2834,6 +2842,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
|
|
|
2834
2842
|
// Then item that is clicked on will always be first in the list
|
|
2835
2843
|
const selectedRows = React.useMemo(() => multiEdit ? lodashEs.sortBy(getFilteredSelectedRows(), (row) => row.id !== props.data.id) : [props.data], [getFilteredSelectedRows, multiEdit, props.data]);
|
|
2836
2844
|
const field = props.colDef?.field ?? "";
|
|
2845
|
+
const colId = props.colDef?.colId ?? field ?? "";
|
|
2837
2846
|
const updateValue = React.useCallback(async (saveFn, tabDirection) => {
|
|
2838
2847
|
if (hasSaved.current)
|
|
2839
2848
|
return true;
|
|
@@ -2845,6 +2854,7 @@ const GridPopoverContextProvider = ({ props, children }) => {
|
|
|
2845
2854
|
saving,
|
|
2846
2855
|
setSaving,
|
|
2847
2856
|
selectedRows,
|
|
2857
|
+
colId,
|
|
2848
2858
|
field,
|
|
2849
2859
|
data: props.data,
|
|
2850
2860
|
value: props.value,
|