@linzjs/step-ag-grid 7.11.11 → 7.11.13

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "7.11.11",
5
+ "version": "7.11.13",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -4,7 +4,7 @@ import { AgGridReact } from "ag-grid-react";
4
4
  import { CellClickedEvent, ColDef } from "ag-grid-community";
5
5
  import { CellEvent, GridReadyEvent, SelectionChangedEvent } from "ag-grid-community/dist/lib/events";
6
6
  import { GridOptions } from "ag-grid-community/dist/lib/entities/gridOptions";
7
- import { difference, last, xorBy } from "lodash-es";
7
+ import { difference, isEmpty, last, xorBy } from "lodash-es";
8
8
  import { GridContext } from "../contexts/GridContext";
9
9
  import { usePostSortRowsHook } from "./PostSortRowsHook";
10
10
  import { fnOrVar, isNotEmpty } from "../utils/util";
@@ -65,12 +65,8 @@ export const Grid = (params: GridProps): JSX.Element => {
65
65
  useEffect(() => {
66
66
  if (!gridReady || !params.autoSelectFirstRow || hasSelectedFirstItem.current || !params.rowData) return;
67
67
  hasSelectedFirstItem.current = true;
68
- if (isNotEmpty(params.rowData)) {
69
- if (params.setExternalSelectedItems) {
70
- params.setExternalSelectedItems([params.rowData[0]]);
71
- } else {
72
- selectRowsById([params.rowData[0].id]);
73
- }
68
+ if (isNotEmpty(params.rowData) && isEmpty(params.externalSelectedItems)) {
69
+ selectRowsById([params.rowData[0].id]);
74
70
  }
75
71
  }, [gridReady, params, params.autoSelectFirstRow, params.rowData, selectRowsById]);
76
72
 
@@ -230,7 +230,7 @@ export const GridFormDropDown = <RowType extends GridBaseRow>(props: GridFormPop
230
230
  )}
231
231
  <ComponentLoadingWrapper loading={!options} className={"GridFormDropDown-options"}>
232
232
  <>
233
- {options && filteredValues && isEmpty(filteredValues) && (
233
+ {options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (
234
234
  <MenuItem key={`${fieldToString(field)}-empty`} className={"GridPopoverEditDropDown-noOptions"}>
235
235
  No Options
236
236
  </MenuItem>