@linzjs/step-ag-grid 17.7.0 → 17.9.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.
Files changed (44) hide show
  1. package/dist/src/components/Grid.d.ts +1 -0
  2. package/dist/src/components/GridNoRowsOverlay.d.ts +3 -1
  3. package/dist/src/contexts/GridContext.d.ts +1 -0
  4. package/dist/step-ag-grid.cjs.js +1115 -706
  5. package/dist/step-ag-grid.cjs.js.map +1 -1
  6. package/dist/step-ag-grid.esm.js +1117 -708
  7. package/dist/step-ag-grid.esm.js.map +1 -1
  8. package/package.json +47 -46
  9. package/src/components/Grid.tsx +42 -22
  10. package/src/components/GridNoRowsOverlay.tsx +27 -3
  11. package/src/contexts/GridContext.tsx +4 -0
  12. package/src/contexts/GridContextProvider.tsx +5 -0
  13. package/src/stories/components/ActionButton.stories.tsx +3 -3
  14. package/src/stories/grid/GridDragRow.stories.tsx +3 -3
  15. package/src/stories/grid/GridFilterButtons.stories.tsx +3 -3
  16. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +3 -3
  17. package/src/stories/grid/GridNonEditableRow.stories.tsx +3 -3
  18. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +3 -3
  19. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +3 -3
  20. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +3 -3
  21. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +3 -3
  22. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +3 -3
  23. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +3 -3
  24. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +3 -3
  25. package/src/stories/grid/GridReadOnly.stories.tsx +26 -8
  26. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +3 -3
  27. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +3 -3
  28. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +3 -3
  29. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +3 -3
  30. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +3 -3
  31. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +3 -3
  32. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +3 -3
  33. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +3 -3
  34. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +3 -3
  35. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +3 -3
  36. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +3 -3
  37. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +3 -3
  38. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +3 -3
  39. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +3 -3
  40. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +3 -3
  41. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +3 -3
  42. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +3 -3
  43. package/src/stories/react-menu/ReactMenu.stories.tsx +3 -3
  44. package/dist/node_modules/@linzjs/lui/dist/assets/svg-content.d.ts +0 -7
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": "17.7.0",
5
+ "version": "17.9.0",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -28,23 +28,24 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@linzjs/lui": ">=18",
31
- "ag-grid-community": ">=28",
32
- "ag-grid-react": ">=28",
31
+ "ag-grid-community": ">=29",
32
+ "ag-grid-react": ">=29",
33
33
  "lodash-es": ">=4",
34
- "react": ">=17",
35
- "react-dom": ">=17"
34
+ "react": ">=18",
35
+ "react-dom": ">=18"
36
36
  },
37
37
  "dependencies": {
38
38
  "@linzjs/lui": ">=18",
39
- "ag-grid-community": ">=28",
40
- "ag-grid-react": ">=28",
39
+ "ag-grid-community": ">=29",
40
+ "ag-grid-react": ">=29",
41
41
  "clsx": "^2.0.0",
42
42
  "debounce-promise": "^3.1.2",
43
43
  "lodash-es": ">=4",
44
44
  "matcher": "^5.0.0",
45
- "react": ">=17",
46
- "react-dom": ">=17",
45
+ "react": ">=18",
46
+ "react-dom": ">=18",
47
47
  "react-transition-state": "^2.1.1",
48
+ "usehooks-ts": "^2.9.1",
48
49
  "uuid": "^9.0.1"
49
50
  },
50
51
  "scripts": {
@@ -83,71 +84,71 @@
83
84
  },
84
85
  "devDependencies": {
85
86
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
86
- "@rollup/plugin-commonjs": "^25.0.4",
87
- "@rollup/plugin-json": "^6.0.0",
88
- "@rollup/plugin-node-resolve": "^15.2.1",
87
+ "@rollup/plugin-commonjs": "^25.0.5",
88
+ "@rollup/plugin-json": "^6.0.1",
89
+ "@rollup/plugin-node-resolve": "^15.2.3",
89
90
  "@semantic-release/changelog": "^6.0.3",
90
91
  "@semantic-release/git": "^10.0.1",
91
- "@storybook/addon-essentials": "^7.2.3",
92
- "@storybook/addon-interactions": "^7.2.3",
92
+ "@storybook/addon-essentials": "^7.4.6",
93
+ "@storybook/addon-interactions": "^7.4.6",
93
94
  "@storybook/addon-postcss": "^2.0.0",
94
- "@storybook/jest": "^0.1.0",
95
- "@storybook/preset-create-react-app": "^7.2.3",
96
- "@storybook/react": "^7.2.3",
97
- "@storybook/react-webpack5": "^7.2.3",
95
+ "@storybook/jest": "^0.2.3",
96
+ "@storybook/preset-create-react-app": "^7.4.6",
97
+ "@storybook/react": "^7.4.6",
98
+ "@storybook/react-webpack5": "^7.4.6",
98
99
  "@storybook/test-runner": "^0.13.0",
99
- "@storybook/testing-library": "^0.2.0",
100
- "@testing-library/dom": "^9.3.1",
100
+ "@storybook/testing-library": "^0.2.2",
101
+ "@testing-library/dom": "^9.3.3",
101
102
  "@testing-library/jest-dom": "^5.17.0",
102
103
  "@testing-library/react": "^14.0.0",
103
- "@testing-library/user-event": "^14.4.3",
104
+ "@testing-library/user-event": "^14.5.1",
104
105
  "@trivago/prettier-plugin-sort-imports": "^4.2.0",
105
- "@types/debounce-promise": "^3.1.6",
106
- "@types/jest": "^29.5.3",
107
- "@types/lodash-es": "^4.17.8",
108
- "@types/node": "^18.17.5",
109
- "@types/react": "^18.2.20",
110
- "@types/react-dom": "^18.2.7",
111
- "@types/uuid": "^9.0.2",
106
+ "@types/debounce-promise": "^3.1.7",
107
+ "@types/jest": "^29.5.5",
108
+ "@types/lodash-es": "^4.17.9",
109
+ "@types/node": "^18.18.4",
110
+ "@types/react": "^18.2.25",
111
+ "@types/react-dom": "^18.2.11",
112
+ "@types/uuid": "^9.0.5",
112
113
  "@typescript-eslint/parser": "^5.62.0",
113
- "babel-jest": "^29.6.2",
114
+ "babel-jest": "^29.7.0",
114
115
  "babel-preset-react-app": "^10.0.1",
115
- "chromatic": "^6.24.1",
116
+ "chromatic": "^7.2.3",
116
117
  "conventional-changelog-conventionalcommits": "^6.1.0",
117
118
  "css-loader": "^6.8.1",
118
- "eslint": "^8.47.0",
119
+ "eslint": "^8.51.0",
119
120
  "eslint-config-prettier": "^9.0.0",
120
121
  "eslint-config-react-app": "^7.0.1",
121
- "eslint-plugin-deprecation": "^1.5.0",
122
- "eslint-plugin-import": "^2.28.0",
123
- "eslint-plugin-jest": "^27.2.3",
122
+ "eslint-plugin-deprecation": "^1.6.0",
123
+ "eslint-plugin-import": "^2.28.1",
124
+ "eslint-plugin-jest": "^27.4.2",
124
125
  "eslint-plugin-jsx-a11y": "^6.7.1",
125
126
  "eslint-plugin-prettier": "^4.2.1",
126
- "eslint-plugin-react": "^7.33.1",
127
+ "eslint-plugin-react": "^7.33.2",
127
128
  "eslint-plugin-react-hooks": "^4.6.0",
128
- "eslint-plugin-storybook": "^0.6.13",
129
- "eslint-plugin-testing-library": "^6.0.0",
130
- "jest": "^29.6.2",
129
+ "eslint-plugin-storybook": "^0.6.15",
130
+ "eslint-plugin-testing-library": "^6.0.2",
131
+ "jest": "^29.7.0",
131
132
  "jest-canvas-mock": "^2.5.2",
132
- "jest-environment-jsdom": "^29.6.2",
133
+ "jest-environment-jsdom": "^29.7.0",
133
134
  "jest-expect-message": "^1.1.3",
134
135
  "mkdirp": "^3.0.1",
135
136
  "npm-run-all": "^4.1.5",
136
- "postcss": "^8.4.29",
137
+ "postcss": "^8.4.31",
137
138
  "postcss-loader": "^7.3.3",
138
- "postcss-scss": "^4.0.6",
139
+ "postcss-scss": "^4.0.9",
139
140
  "prettier": "^2.8.8",
140
141
  "react-app-polyfill": "^3.0.0",
141
142
  "react-scripts": "^5.0.1",
142
- "rollup": "^3.28.0",
143
- "rollup-plugin-copy": "^3.4.0",
143
+ "rollup": "^4.0.2",
144
+ "rollup-plugin-copy": "^3.5.0",
144
145
  "rollup-plugin-peer-deps-external": "^2.2.4",
145
146
  "rollup-plugin-postcss": "^4.0.2",
146
- "rollup-plugin-typescript2": "^0.35.0",
147
+ "rollup-plugin-typescript2": "^0.36.0",
147
148
  "sass": "1.66.1",
148
149
  "sass-loader": "^13.3.2",
149
- "semantic-release": "^21.1.1",
150
- "storybook": "^7.2.3",
150
+ "semantic-release": "^22.0.5",
151
+ "storybook": "^7.4.6",
151
152
  "storybook-css-modules-preset": "^1.1.1",
152
153
  "style-loader": "^3.3.3",
153
154
  "stylelint": "^15.10.3",
@@ -23,10 +23,10 @@ import { AgGridReact } from "ag-grid-react";
23
23
  import clsx from "clsx";
24
24
  import { defer, difference, isEmpty, last, omit, xorBy } from "lodash-es";
25
25
  import { ReactElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
26
+ import { useInterval } from "usehooks-ts";
26
27
 
27
28
  import { GridContext } from "../contexts/GridContext";
28
29
  import { GridUpdatingContext } from "../contexts/GridUpdatingContext";
29
- import { useIntervalHook } from "../lui/timeoutHook";
30
30
  import { fnOrVar, isNotEmpty } from "../utils/util";
31
31
  import { GridNoRowsOverlay } from "./GridNoRowsOverlay";
32
32
  import { usePostSortRowsHook } from "./PostSortRowsHook";
@@ -101,6 +101,8 @@ export interface GridProps {
101
101
  * Defaults to false.
102
102
  */
103
103
  singleClickEdit?: boolean;
104
+
105
+ loading?: boolean;
104
106
  }
105
107
 
106
108
  /**
@@ -116,7 +118,7 @@ export const Grid = ({
116
118
  contextMenuSelectRow = false,
117
119
  singleClickEdit = false,
118
120
  rowData,
119
- rowHeight = theme === "ag-theme-step-default" ? 40 : theme === "ag-theme-step-compact" ? 36 : undefined,
121
+ rowHeight = theme === "ag-theme-step-default" ? 40 : theme === "ag-theme-step-compact" ? 36 : 40,
120
122
  ...params
121
123
  }: GridProps): ReactElement => {
122
124
  const {
@@ -136,9 +138,11 @@ export const Grid = ({
136
138
  doesExternalFilterPass,
137
139
  setOnCellEditingComplete,
138
140
  getColDef,
141
+ showNoRowsOverlay,
142
+ prePopupOps,
143
+ stopEditing,
139
144
  } = useContext(GridContext);
140
145
  const { checkUpdating, updatedDep, updatingCols } = useContext(GridUpdatingContext);
141
- const { prePopupOps } = useContext(GridContext);
142
146
 
143
147
  const gridDivRef = useRef<HTMLDivElement>(null);
144
148
  const lastSelectedIds = useRef<number[]>([]);
@@ -202,23 +206,20 @@ export const Grid = ({
202
206
  /**
203
207
  * Auto-size windows that had deferred auto-size
204
208
  */
205
- useIntervalHook({
206
- callback: () => {
207
- // Check if window has been popped out and needs resize
208
- const currentDocument = gridDivRef.current?.ownerDocument;
209
- if (currentDocument !== lastOwnerDocumentRef.current) {
210
- lastOwnerDocumentRef.current = currentDocument;
211
- if (currentDocument) {
212
- needsAutoSize.current = true;
213
- }
214
- }
215
- if (needsAutoSize.current) {
216
- needsAutoSize.current = false;
217
- setInitialContentSize();
209
+ useInterval(() => {
210
+ // Check if window has been popped out and needs resize
211
+ const currentDocument = gridDivRef.current?.ownerDocument;
212
+ if (currentDocument !== lastOwnerDocumentRef.current) {
213
+ lastOwnerDocumentRef.current = currentDocument;
214
+ if (currentDocument) {
215
+ needsAutoSize.current = true;
218
216
  }
219
- },
220
- timeoutMs: 200,
221
- });
217
+ }
218
+ if (needsAutoSize.current) {
219
+ needsAutoSize.current = false;
220
+ setInitialContentSize();
221
+ }
222
+ }, 200);
222
223
 
223
224
  /**
224
225
  * On data load select the first row of the grid if required.
@@ -326,7 +327,11 @@ export const Grid = ({
326
327
  const columnDefs = useMemo((): (ColDef | ColGroupDef)[] => {
327
328
  const adjustColDefs = params.columnDefs.map((colDef) => {
328
329
  const colDefEditable = colDef.editable;
329
- const editable = combineEditables(params.readOnly !== true, params.defaultColDef?.editable, colDefEditable);
330
+ const editable = combineEditables(
331
+ params.loading !== true && params.readOnly !== true,
332
+ params.defaultColDef?.editable,
333
+ colDefEditable,
334
+ );
330
335
  return {
331
336
  ...colDef,
332
337
  editable,
@@ -372,6 +377,7 @@ export const Grid = ({
372
377
  params.columnDefs,
373
378
  params.selectable,
374
379
  params.onRowDragEnd,
380
+ params.loading,
375
381
  params.readOnly,
376
382
  params.defaultColDef?.editable,
377
383
  selectColumnPinned,
@@ -569,6 +575,16 @@ export const Grid = ({
569
575
  }
570
576
  }, [autoSizeColumns, getColDef, sizeColumns, updatedDep, updatingCols]);
571
577
 
578
+ const prevLoading = useRef(false);
579
+ useEffect(() => {
580
+ const newLoading = !rowData || params.loading === true;
581
+ if (newLoading && !prevLoading.current) {
582
+ stopEditing();
583
+ showNoRowsOverlay();
584
+ }
585
+ prevLoading.current = newLoading;
586
+ }, [params.loading, rowData, showNoRowsOverlay, stopEditing]);
587
+
572
588
  /**
573
589
  * Resize columns to fit if required on window/container resize
574
590
  */
@@ -611,12 +627,12 @@ export const Grid = ({
611
627
  const clientSideRowModel = event.api.getModel() as IClientSideRowModel;
612
628
 
613
629
  //position 0 means highlight above, 1 means below
614
- const position = clientSideRowModel.getHighlightPosition(event.y, event.overNode as RowNode<any>);
630
+ const position = clientSideRowModel.getHighlightPosition(event.y, event.overNode as RowNode);
615
631
 
616
632
  //we don't want to show the row highlight if it wouldn't result in the row moving
617
633
  const targetIndex = event.overIndex + position - (event.node.rowIndex < event.overIndex ? 1 : 0);
618
634
  if (event.node.rowIndex != targetIndex) {
619
- clientSideRowModel.highlightRowAtPixel(event.node as RowNode<any>, event.y);
635
+ clientSideRowModel.highlightRowAtPixel(event.node as RowNode, event.y);
620
636
  }
621
637
  }
622
638
  }, []);
@@ -650,6 +666,8 @@ export const Grid = ({
650
666
  // This is setting a ref in the GridContext so won't be triggering an update loop
651
667
  setOnCellEditingComplete(params.onCellEditingComplete);
652
668
 
669
+ const headerRowCount = columnDefs.some((c) => (c as any).children) ? 2 : 1;
670
+
653
671
  return (
654
672
  <div
655
673
  data-testid={dataTestId}
@@ -692,7 +710,9 @@ export const Grid = ({
692
710
  event.api.forEachNode(() => rowCount++);
693
711
  return (
694
712
  <GridNoRowsOverlay
713
+ loading={!rowData || params.loading === true}
695
714
  rowCount={rowCount}
715
+ headerRowHeight={headerRowCount * rowHeight}
696
716
  filteredRowCount={event.api.getDisplayedRowCount()}
697
717
  noRowsOverlayText={params.noRowsOverlayText}
698
718
  />
@@ -1,11 +1,35 @@
1
+ import { LuiStatusSpinner } from "@linzjs/lui";
2
+
3
+ const GridLoadingOverlayComponent = (props: { headerRowHeight: number }) => (
4
+ <div
5
+ style={{
6
+ left: 0,
7
+ top: 0,
8
+ bottom: 0,
9
+ right: 0,
10
+ position: "absolute",
11
+ backgroundColor: "rgba(255,255,255,0.5)",
12
+ }}
13
+ >
14
+ <div style={{ height: "100%", position: "relative" }}>
15
+ <div style={{ position: "absolute", left: 0, top: props.headerRowHeight, right: 0, bottom: 0 }}>
16
+ <LuiStatusSpinner />
17
+ </div>
18
+ </div>
19
+ </div>
20
+ );
21
+
1
22
  export interface GridNoRowsOverlayProps {
23
+ loading: boolean;
2
24
  rowCount: number | undefined | null;
3
25
  filteredRowCount: number;
4
26
  noRowsOverlayText: string | undefined;
27
+ headerRowHeight: number;
5
28
  }
6
29
 
7
- export const GridNoRowsOverlay = (params: GridNoRowsOverlayProps) => {
8
- if (params.rowCount === 0) return <span>{params.noRowsOverlayText ?? "There are currently no rows"}</span>;
9
- if (params.filteredRowCount === 0) return <span>All rows have been filtered</span>;
30
+ export const GridNoRowsOverlay = (props: GridNoRowsOverlayProps) => {
31
+ if (props.loading) return <GridLoadingOverlayComponent headerRowHeight={props.headerRowHeight} />;
32
+ if (props.rowCount === 0) return <div>{props.noRowsOverlayText ?? "There are currently no rows"}</div>;
33
+ if (props.filteredRowCount === 0) return <div>All rows have been filtered</div>;
10
34
  return <span />;
11
35
  };
@@ -65,6 +65,7 @@ export interface GridContextType<RowType extends GridBaseRow> {
65
65
  setInvisibleColumnIds: (colIds: string[]) => void;
66
66
  downloadCsv: (csvExportParams?: CsvExportParams) => void;
67
67
  setOnCellEditingComplete: (callback: (() => void) | undefined) => void;
68
+ showNoRowsOverlay: () => void;
68
69
  }
69
70
 
70
71
  export const GridContext = createContext<GridContextType<any>>({
@@ -201,6 +202,9 @@ export const GridContext = createContext<GridContextType<any>>({
201
202
  setOnCellEditingComplete: () => {
202
203
  console.error("no context provider for setOnCellEditingComplete");
203
204
  },
205
+ showNoRowsOverlay: () => {
206
+ console.error("no context provider for showLoadingOverlay");
207
+ },
204
208
  });
205
209
 
206
210
  export const useGridContext = <RowType extends GridBaseRow>() => useContext<GridContextType<RowType>>(GridContext);
@@ -659,6 +659,10 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
659
659
  [gridApi],
660
660
  );
661
661
 
662
+ const showNoRowsOverlay = useCallback((): void => {
663
+ gridApi?.showNoRowsOverlay();
664
+ }, [gridApi]);
665
+
662
666
  /**
663
667
  * Apply column visibility
664
668
  */
@@ -755,6 +759,7 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: PropsWit
755
759
  doesExternalFilterPass,
756
760
  downloadCsv,
757
761
  setOnCellEditingComplete,
762
+ showNoRowsOverlay,
758
763
  }}
759
764
  >
760
765
  {props.children}
@@ -1,6 +1,6 @@
1
1
  import "@linzjs/lui/dist/scss/base.scss";
2
2
 
3
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
3
+ import { Meta, StoryFn } from "@storybook/react";
4
4
  import { useCallback } from "react";
5
5
 
6
6
  import "@linzjs/lui/dist/fonts";
@@ -12,9 +12,9 @@ export default {
12
12
  title: "Components / ActionButton",
13
13
  component: ActionButton,
14
14
  args: {},
15
- } as ComponentMeta<typeof ActionButton>;
15
+ } as Meta<typeof ActionButton>;
16
16
 
17
- const ActionButtonTemplate: ComponentStory<typeof ActionButton> = () => {
17
+ const ActionButtonTemplate: StoryFn<typeof ActionButton> = () => {
18
18
  const performAction = useCallback(async () => {
19
19
  await wait(1000);
20
20
  }, []);
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -47,7 +47,7 @@ export default {
47
47
  </div>
48
48
  ),
49
49
  ],
50
- } as ComponentMeta<typeof Grid>;
50
+ } as Meta<typeof Grid>;
51
51
 
52
52
  interface ITestRow {
53
53
  id: number;
@@ -58,7 +58,7 @@ interface ITestRow {
58
58
  dd: string;
59
59
  }
60
60
 
61
- const GridDragRowTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
61
+ const GridDragRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
62
62
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
63
63
  () => [
64
64
  GridCell({
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -35,7 +35,7 @@ export default {
35
35
  </div>
36
36
  ),
37
37
  ],
38
- } as ComponentMeta<typeof Grid>;
38
+ } as Meta<typeof Grid>;
39
39
 
40
40
  interface ITestRow {
41
41
  id: number;
@@ -43,7 +43,7 @@ interface ITestRow {
43
43
  desc: string;
44
44
  }
45
45
 
46
- const GridFilterButtonsTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
46
+ const GridFilterButtonsTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
47
47
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
48
48
  () => [
49
49
  GridCell({
@@ -1,7 +1,7 @@
1
1
  import "@linzjs/lui/dist/scss/base.scss";
2
2
 
3
3
  import { expect } from "@storybook/jest";
4
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
4
+ import { Meta, StoryFn } from "@storybook/react";
5
5
  import { within } from "@storybook/testing-library";
6
6
 
7
7
  import "@linzjs/lui/dist/fonts";
@@ -12,9 +12,9 @@ export default {
12
12
  title: "Components / Grids / GridNoRowsOverlay",
13
13
  component: GridNoRowsOverlay,
14
14
  args: {},
15
- } as ComponentMeta<typeof GridNoRowsOverlay>;
15
+ } as Meta<typeof GridNoRowsOverlay>;
16
16
 
17
- const GridNoRowsOverlayTemplate: ComponentStory<typeof GridNoRowsOverlay> = (params: GridNoRowsOverlayProps) => {
17
+ const GridNoRowsOverlayTemplate: StoryFn<typeof GridNoRowsOverlay> = (params: GridNoRowsOverlayProps) => {
18
18
  return <GridNoRowsOverlay {...params} />;
19
19
  };
20
20
 
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { ColDef } from "ag-grid-community";
7
7
  import { GridPopoverEditDropDown } from "components/gridPopoverEdit/GridPopoverEditDropDown";
8
8
  import { GridPopoverTextArea } from "components/gridPopoverEdit/GridPopoverTextArea";
@@ -44,7 +44,7 @@ export default {
44
44
  </div>
45
45
  ),
46
46
  ],
47
- } as ComponentMeta<typeof Grid>;
47
+ } as Meta<typeof Grid>;
48
48
 
49
49
  interface ITestRow {
50
50
  id: number;
@@ -53,7 +53,7 @@ interface ITestRow {
53
53
  desc: string;
54
54
  }
55
55
 
56
- const GridNonEditableRowTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
56
+ const GridNonEditableRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
57
57
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
58
58
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
59
59
  () => [
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { ReactElement, useCallback, useContext, useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -41,7 +41,7 @@ export default {
41
41
  </div>
42
42
  ),
43
43
  ],
44
- } as ComponentMeta<typeof Grid>;
44
+ } as Meta<typeof Grid>;
45
45
 
46
46
  const ContextMenu = ({ clickedRow, colDef, close }: GridContextMenuComponentProps<IFormTestRow>): ReactElement => {
47
47
  const onClick = useCallback(() => {
@@ -64,7 +64,7 @@ const ContextMenu = ({ clickedRow, colDef, close }: GridContextMenuComponentProp
64
64
  );
65
65
  };
66
66
 
67
- const GridPopoutContextMenuTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
67
+ const GridPopoutContextMenuTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
68
68
  const { selectRowsWithFlashDiff } = useContext(GridContext);
69
69
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
70
70
  const [rowData, setRowData] = useState([
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -29,9 +29,9 @@ export default {
29
29
  </div>
30
30
  ),
31
31
  ],
32
- } as ComponentMeta<typeof Grid>;
32
+ } as Meta<typeof Grid>;
33
33
 
34
- const GridPopoutEditGenericTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
34
+ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
35
35
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
36
36
  const columnDefs: ColDefT<IFormTestRow>[] = useMemo(
37
37
  () => [
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useCallback, useContext, useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -47,9 +47,9 @@ export default {
47
47
  </div>
48
48
  ),
49
49
  ],
50
- } as ComponentMeta<typeof Grid>;
50
+ } as Meta<typeof Grid>;
51
51
 
52
- const GridPopoutEditGenericTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
52
+ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
53
53
  const { selectRowsWithFlashDiff } = useContext(GridContext);
54
54
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
55
55
  const [rowData, setRowData] = useState([
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -44,7 +44,7 @@ export default {
44
44
  </div>
45
45
  ),
46
46
  ],
47
- } as ComponentMeta<typeof Grid>;
47
+ } as Meta<typeof Grid>;
48
48
 
49
49
  interface ITestRow {
50
50
  id: number;
@@ -52,7 +52,7 @@ interface ITestRow {
52
52
  bearing: string | number | null;
53
53
  }
54
54
 
55
- const GridPopoverEditBearingTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
55
+ const GridPopoverEditBearingTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
56
56
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
57
57
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
58
58
  () => [
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { useCallback, useMemo, useState } from "react";
7
7
 
8
8
  import "@linzjs/lui/dist/fonts";
@@ -48,7 +48,7 @@ export default {
48
48
  </div>
49
49
  ),
50
50
  ],
51
- } as ComponentMeta<typeof Grid>;
51
+ } as Meta<typeof Grid>;
52
52
 
53
53
  interface ITestRow {
54
54
  id: number;
@@ -65,7 +65,7 @@ interface ICode {
65
65
  desc: string;
66
66
  }
67
67
 
68
- const GridEditDropDownTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
68
+ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
69
69
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
70
70
 
71
71
  const optionsFn = useCallback(async (selectedRows: ITestRow[], filter?: string) => {
@@ -2,7 +2,7 @@ import "../../styles/GridTheme.scss";
2
2
  import "../../styles/index.scss";
3
3
  import "@linzjs/lui/dist/scss/base.scss";
4
4
 
5
- import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { Meta, StoryFn } from "@storybook/react";
6
6
  import { isEmpty, partition } from "lodash-es";
7
7
  import { useMemo, useState } from "react";
8
8
 
@@ -41,7 +41,7 @@ export default {
41
41
  </div>
42
42
  ),
43
43
  ],
44
- } as ComponentMeta<typeof Grid>;
44
+ } as Meta<typeof Grid>;
45
45
 
46
46
  interface ITestRow {
47
47
  id: number;
@@ -50,7 +50,7 @@ interface ITestRow {
50
50
  position3: string | null;
51
51
  }
52
52
 
53
- const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridProps) => {
53
+ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
54
54
  const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
55
55
 
56
56
  const columnDefs: ColDefT<ITestRow>[] = useMemo(() => {