@linzjs/step-ag-grid 21.1.1 → 21.1.3

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": "21.1.1",
5
+ "version": "21.1.3",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -1,7 +1,12 @@
1
1
  import { LuiStatusSpinner } from "@linzjs/lui";
2
+ import { ForwardedRef, forwardRef } from "react";
2
3
 
3
- const GridLoadingOverlayComponent = (props: { headerRowHeight: number }) => (
4
+ const GridLoadingOverlayComponentFr = (
5
+ props: { headerRowHeight: number },
6
+ externalRef: ForwardedRef<HTMLDivElement>,
7
+ ) => (
4
8
  <div
9
+ ref={externalRef}
5
10
  style={{
6
11
  left: 0,
7
12
  top: 0,
@@ -19,6 +24,8 @@ const GridLoadingOverlayComponent = (props: { headerRowHeight: number }) => (
19
24
  </div>
20
25
  );
21
26
 
27
+ const GridLoadingOverlayComponent = forwardRef(GridLoadingOverlayComponentFr);
28
+
22
29
  export interface GridNoRowsOverlayProps {
23
30
  loading: boolean;
24
31
  rowCount: number | undefined | null;
@@ -28,10 +35,17 @@ export interface GridNoRowsOverlayProps {
28
35
  headerRowHeight: number;
29
36
  }
30
37
 
31
- export const GridNoRowsOverlay = (props: GridNoRowsOverlayProps) => {
32
- if (props.loading) return <GridLoadingOverlayComponent headerRowHeight={props.headerRowHeight} />;
33
- if (props.rowCount === 0) return <div>{props.noRowsOverlayText ?? "There are currently no rows"}</div>;
34
- if (props.filteredRowCount === 0)
35
- return <div>{props.noRowsMatchingOverlayText ?? "All rows have been filtered"}</div>;
36
- return <span />;
38
+ export const GridNoRowsOverlayFr = (props: GridNoRowsOverlayProps, externalRef: ForwardedRef<HTMLDivElement>) => {
39
+ if (props.loading) {
40
+ return <GridLoadingOverlayComponent ref={externalRef} headerRowHeight={props.headerRowHeight} />;
41
+ }
42
+ if (props.rowCount === 0) {
43
+ return <div ref={externalRef}>{props.noRowsOverlayText ?? "There are currently no rows"}</div>;
44
+ }
45
+ if (props.filteredRowCount === 0) {
46
+ return <div ref={externalRef}>{props.noRowsMatchingOverlayText ?? "All rows have been filtered"}</div>;
47
+ }
48
+ return <div ref={externalRef} />;
37
49
  };
50
+
51
+ export const GridNoRowsOverlay = forwardRef(GridNoRowsOverlayFr);
@@ -1,3 +1,4 @@
1
+ import clsx from "clsx";
1
2
  import { GridBaseRow } from "../Grid";
2
3
  import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
4
  import { GridFormMultiSelect, GridFormMultiSelectProps } from "../gridForm/GridFormMultiSelect";
@@ -11,7 +12,7 @@ export const GridPopoutEditMultiSelect = <TData extends GridBaseRow, TValue = an
11
12
  editor: GridFormMultiSelect,
12
13
  ...props,
13
14
  editorParams: {
14
- className: "GridMultiSelect-containerMedium",
15
15
  ...(props.editorParams as GridFormMultiSelectProps<TData>),
16
+ className: clsx("GridMultiSelect-containerMedium", props.editorParams?.className),
16
17
  },
17
18
  });
@@ -1,3 +1,4 @@
1
+ import clsx from "clsx";
1
2
  import { GridBaseRow } from "../Grid";
2
3
  import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
4
  import { GridFormMultiSelectGrid, GridFormMultiSelectGridProps } from "../gridForm/GridFormMultiSelectGrid";
@@ -11,7 +12,7 @@ export const GridPopoutEditMultiSelectGrid = <TData extends GridBaseRow, TValue
11
12
  editor: GridFormMultiSelectGrid,
12
13
  ...props,
13
14
  editorParams: {
14
- className: "GridMultiSelect-containerMedium",
15
15
  ...(props.editorParams as GridFormMultiSelectGridProps<TData>),
16
+ className: clsx("GridMultiSelect-containerMedium", props.editorParams?.className),
16
17
  },
17
18
  });
@@ -1,3 +1,4 @@
1
+ import clsx from "clsx";
1
2
  import { GridBaseRow } from "../Grid";
2
3
  import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
4
  import { GridFormDropDown, GridFormDropDownProps } from "../gridForm/GridFormDropDown";
@@ -11,8 +12,7 @@ export const GridPopoverEditDropDown = <TData extends GridBaseRow, TValue = any>
11
12
  editor: GridFormDropDown,
12
13
  ...props,
13
14
  editorParams: {
14
- // Defaults to large size container
15
- className: "GridPopoverEditDropDown-containerLarge",
16
15
  ...(props.editorParams as GridFormDropDownProps<TData>),
16
+ className: clsx("GridPopoverEditDropDown-containerLarge", props.editorParams?.className),
17
17
  },
18
18
  });