@linzjs/step-ag-grid 7.11.6 → 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 +27 -1
- package/dist/index.js.map +1 -1
- package/dist/step-ag-grid.esm.js +28 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +12 -0
- package/src/contexts/GridContextProvider.tsx +16 -3
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +8 -3
package/dist/index.js
CHANGED
|
@@ -2166,7 +2166,20 @@ var GridContextProvider = function (props) {
|
|
|
2166
2166
|
}
|
|
2167
2167
|
var rowsThatNeedSelecting = lodashEs.sortBy(rowNodes.filter(function (node) { return !node.isSelected(); }), function (node) { return node.data.id; });
|
|
2168
2168
|
var firstNode = rowsThatNeedSelecting[0];
|
|
2169
|
-
|
|
2169
|
+
if (firstNode) {
|
|
2170
|
+
gridApi.ensureNodeVisible(firstNode);
|
|
2171
|
+
var colDefs = gridApi.getColumnDefs();
|
|
2172
|
+
if (colDefs && colDefs.length) {
|
|
2173
|
+
var col = colDefs[0]; // We don't support ColGroupDef
|
|
2174
|
+
var rowIndex_1 = firstNode.rowIndex;
|
|
2175
|
+
if (rowIndex_1 != null && col != null) {
|
|
2176
|
+
var colId_1 = col.colId;
|
|
2177
|
+
// We need to make sure we aren't currently editing a cell otherwise tests will fail
|
|
2178
|
+
// as they will start to edit the cell before this stuff has a chance to run
|
|
2179
|
+
colId_1 != null && lodashEs.defer(function () { return lodashEs.isEmpty(gridApi.getEditingCells()) && gridApi.setFocusedCell(rowIndex_1, colId_1); });
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2170
2183
|
if (select) {
|
|
2171
2184
|
// Select rows that shouldn't be selected
|
|
2172
2185
|
rowsThatNeedSelecting.forEach(function (node) { return node.setSelected(true); });
|
|
@@ -2833,6 +2846,19 @@ var Grid = function (params) {
|
|
|
2833
2846
|
suppressSizeToFit: true,
|
|
2834
2847
|
checkboxSelection: true,
|
|
2835
2848
|
headerComponent: GridHeaderSelect,
|
|
2849
|
+
suppressHeaderKeyboardEvent: function (e) {
|
|
2850
|
+
if (e.event.key === "Enter" && !e.event.repeat) {
|
|
2851
|
+
var selectedNodeCount = e.api.getSelectedRows().length;
|
|
2852
|
+
if (selectedNodeCount == 0) {
|
|
2853
|
+
e.api.selectAllFiltered();
|
|
2854
|
+
}
|
|
2855
|
+
else {
|
|
2856
|
+
e.api.deselectAll();
|
|
2857
|
+
}
|
|
2858
|
+
return true;
|
|
2859
|
+
}
|
|
2860
|
+
return false;
|
|
2861
|
+
},
|
|
2836
2862
|
onCellClicked: clickSelectorCheckboxWhenContainingCellClicked
|
|
2837
2863
|
}
|
|
2838
2864
|
], adjustColDefs, true) : adjustColDefs;
|