@linzjs/step-ag-grid 13.1.3 → 13.3.0

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": "13.1.3",
5
+ "version": "13.3.0",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -21,6 +21,7 @@ export interface GridBaseRow {
21
21
  export interface GridProps {
22
22
  readOnly?: boolean; // set all editables to false when read only, make all styles black, otherwise style is gray for not editable
23
23
  selectable?: boolean;
24
+ theme?: string; // should have prefix ag-theme-
24
25
  ["data-testid"]?: string;
25
26
  domLayout?: GridOptions["domLayout"];
26
27
  externalSelectedItems?: any[];
@@ -36,12 +37,21 @@ export interface GridProps {
36
37
  autoSelectFirstRow?: boolean;
37
38
  onColumnMoved?: GridOptions["onColumnMoved"];
38
39
  alwaysShowVerticalScroll?: boolean;
40
+ onGridSizeChanged: GridOptions["onGridSizeChanged"];
41
+ onFirstDataRendered: GridOptions["onFirstDataRendered"];
42
+ suppressColumnVirtualization: GridOptions["suppressColumnVirtualisation"];
39
43
  }
40
44
 
41
45
  /**
42
46
  * Wrapper for AgGrid to add commonly used functionality.
43
47
  */
44
- export const Grid = ({ rowSelection = "multiple", "data-testid": dataTestId, ...params }: GridProps): JSX.Element => {
48
+ export const Grid = ({
49
+ "data-testid": dataTestId,
50
+ rowSelection = "multiple",
51
+ suppressColumnVirtualization = true,
52
+ theme = "ag-theme-alpine",
53
+ ...params
54
+ }: GridProps): JSX.Element => {
45
55
  const {
46
56
  gridReady,
47
57
  setApis,
@@ -298,7 +308,7 @@ export const Grid = ({ rowSelection = "multiple", "data-testid": dataTestId, ...
298
308
  data-testid={dataTestId}
299
309
  className={clsx(
300
310
  "Grid-container",
301
- "ag-theme-alpine",
311
+ theme,
302
312
  staleGrid && "Grid-sortIsStale",
303
313
  gridReady && params.rowData && "Grid-ready",
304
314
  )}
@@ -312,8 +322,9 @@ export const Grid = ({ rowSelection = "multiple", "data-testid": dataTestId, ...
312
322
  rowSelection={rowSelection}
313
323
  suppressBrowserResizeObserver={true}
314
324
  colResizeDefault={"shift"}
315
- onFirstDataRendered={sizeColumnsToFit}
316
- onGridSizeChanged={sizeColumnsToFit}
325
+ onFirstDataRendered={params.onFirstDataRendered ?? sizeColumnsToFit}
326
+ onGridSizeChanged={params.onGridSizeChanged ?? sizeColumnsToFit}
327
+ suppressColumnVirtualisation={suppressColumnVirtualization}
317
328
  suppressClickEdit={true}
318
329
  onCellKeyPress={onCellKeyPress}
319
330
  onCellClicked={onCellClicked}