@linzjs/step-ag-grid 14.9.0 → 14.9.2

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 CHANGED
@@ -1,7 +1,6 @@
1
1
  # step-ag-grid
2
2
 
3
3
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
4
-
5
4
  > Reusable [ag-grid](https://www.ag-grid.com/) component for LINZ / Toitū te whenua.
6
5
 
7
6
  ## Features
@@ -25,13 +24,13 @@ _Please note this requires React >=17, ag-grid-community >=27, and sass._
25
24
  with npm
26
25
 
27
26
  ```bash
28
- npm install @linz/step-ag-grid
27
+ npm install @linzjs/step-ag-grid
29
28
  ```
30
29
 
31
30
  or with Yarn
32
31
 
33
32
  ```bash
34
- yarn add @linz/step-ag-grid
33
+ yarn add @linzjs/step-ag-grid
35
34
  ```
36
35
 
37
36
  ## Demo
@@ -3,7 +3,7 @@ import { LuiMiniSpinner, LuiIcon, LuiButton, LuiCheckboxInput, LuiButtonGroup }
3
3
  import { AgGridReact } from 'ag-grid-react';
4
4
  import { negate, isEmpty, xorBy, last, difference, defer as defer$1, omit, sortBy, findIndex, debounce as debounce$1, delay, partition, pick, groupBy, fromPairs, toPairs, isEqual, sumBy, compact, remove, castArray, flatten } from 'lodash-es';
5
5
  import * as React from 'react';
6
- import { createContext, useContext, useEffect, useRef, useCallback, useState, useMemo, forwardRef, useLayoutEffect, memo, useReducer, cloneElement, useImperativeHandle, Fragment as Fragment$1 } from 'react';
6
+ import { createContext, useContext, useRef, useEffect, useCallback, useState, useMemo, forwardRef, useLayoutEffect, memo, useReducer, cloneElement, useImperativeHandle, Fragment as Fragment$1 } from 'react';
7
7
  import ReactDOM, { unstable_batchedUpdates, flushSync, createPortal } from 'react-dom';
8
8
  import require$$0$1 from 'util';
9
9
  import * as testUtils from 'react-dom/test-utils';
@@ -211,12 +211,16 @@ const useTimeoutHook = () => {
211
211
  return invoke;
212
212
  };
213
213
  const useIntervalHook = ({ callback, timeoutMs }) => {
214
+ const callbackRef = useRef(callback);
215
+ callbackRef.current = callback;
214
216
  useEffect(() => {
215
- const interval = setInterval(callback, timeoutMs);
217
+ const interval = setInterval(() => {
218
+ callbackRef.current && callbackRef.current();
219
+ }, timeoutMs);
216
220
  return () => {
217
221
  clearInterval(interval);
218
222
  };
219
- });
223
+ }, [timeoutMs]);
220
224
  };
221
225
 
222
226
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -621,7 +625,7 @@ const Grid = ({ "data-testid": dataTestId, rowSelection = "multiple", suppressCo
621
625
  return;
622
626
  }
623
627
  const headerCellCount = gridDivRef.current?.getElementsByClassName("ag-header-cell-label")?.length;
624
- if (headerCellCount != params.columnDefs.length) {
628
+ if (headerCellCount < 2) {
625
629
  // Don't resize grids until all the columns are visible
626
630
  // as `autoSizeColumns` will fail silently in this case
627
631
  needsAutoSize.current = true;
@@ -4794,7 +4798,7 @@ const GridContextProvider = (props) => {
4794
4798
  return;
4795
4799
  }
4796
4800
  if (!rowNode.isSelected()) {
4797
- rowNode.setSelected(true, false);
4801
+ rowNode.setSelected(true, true);
4798
4802
  }
4799
4803
  // Cell already being edited, so don't re-edit until finished
4800
4804
  if (checkUpdating([colDef.field ?? ""], rowId)) {