@linzjs/step-ag-grid 7.11.7 → 7.11.8
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/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -6
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +2 -2
- package/src/components/gridHeader/GridHeaderSelect.tsx +3 -3
- package/src/contexts/GridContextProvider.tsx +4 -2
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useMemo, useLayoutEffect, useEffect, createContext, memo, forwardRef, useRef, useContext, useState, useCallback, useReducer, cloneElement, useImperativeHandle, Fragment } from 'react';
|
|
3
3
|
import ReactDOM, { unstable_batchedUpdates, flushSync, createPortal } from 'react-dom';
|
|
4
|
-
import { findIndex, debounce, negate, isEmpty, delay, sortBy, last, difference, castArray, remove, flatten, xorBy, partition, pick, groupBy, fromPairs, toPairs, omit } from 'lodash-es';
|
|
4
|
+
import { findIndex, debounce, negate, isEmpty, delay, sortBy, defer as defer$1, last, difference, castArray, remove, flatten, xorBy, partition, pick, groupBy, fromPairs, toPairs, omit } from 'lodash-es';
|
|
5
5
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
6
6
|
import { AgGridReact } from 'ag-grid-react';
|
|
7
7
|
import { LuiMiniSpinner, LuiIcon, LuiCheckboxInput, LuiButton } from '@linzjs/lui';
|
|
@@ -2153,7 +2153,9 @@ var GridContextProvider = function (props) {
|
|
|
2153
2153
|
var rowIndex_1 = firstNode.rowIndex;
|
|
2154
2154
|
if (rowIndex_1 != null && col != null) {
|
|
2155
2155
|
var colId_1 = col.colId;
|
|
2156
|
-
|
|
2156
|
+
// We need to make sure we aren't currently editing a cell otherwise tests will fail
|
|
2157
|
+
// as they will start to edit the cell before this stuff has a chance to run
|
|
2158
|
+
colId_1 != null && defer$1(function () { return isEmpty(gridApi.getEditingCells()) && gridApi.setFocusedCell(rowIndex_1, colId_1); });
|
|
2157
2159
|
}
|
|
2158
2160
|
}
|
|
2159
2161
|
}
|
|
@@ -2679,9 +2681,9 @@ var GridHeaderSelect = function (_a) {
|
|
|
2679
2681
|
// This is used to force an update on selection change
|
|
2680
2682
|
var _b = useState(0), updateCounter = _b[0], setUpdateCounter = _b[1];
|
|
2681
2683
|
var selectedNodeCount = api.getSelectedRows().length;
|
|
2682
|
-
var clickHandler = function () {
|
|
2684
|
+
var clickHandler = useCallback(function () {
|
|
2683
2685
|
setUpdateCounter(updateCounter + 1);
|
|
2684
|
-
};
|
|
2686
|
+
}, [updateCounter]);
|
|
2685
2687
|
useEffect(function () {
|
|
2686
2688
|
api.addEventListener("selectionChanged", clickHandler);
|
|
2687
2689
|
return function () { return api.removeEventListener("selectionChanged", clickHandler); };
|
|
@@ -2832,9 +2834,9 @@ var Grid = function (params) {
|
|
|
2832
2834
|
else {
|
|
2833
2835
|
e.api.deselectAll();
|
|
2834
2836
|
}
|
|
2835
|
-
return
|
|
2837
|
+
return true;
|
|
2836
2838
|
}
|
|
2837
|
-
return
|
|
2839
|
+
return false;
|
|
2838
2840
|
},
|
|
2839
2841
|
onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
|
|
2840
2842
|
}
|