@linzjs/step-ag-grid 2.1.0 → 2.1.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
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Reusable [ag-grid](https://www.ag-grid.com/) component for LINZ / Toitū te whenua.
4
4
 
5
- Storybook deployed at: https://linz.github.io/step-ag-grid/ (private to LINZ)
5
+ Storybook deployed at: https://linz.github.io/step-ag-grid/
6
6
 
7
7
  ## Features
8
8
 
@@ -49,16 +49,20 @@ import "@linzjs/step-ag-grid/dist/index.css"
49
49
  import "@linzjs/step-ag-grid/dist/GridTheme.scss";
50
50
 
51
51
  import { useMemo } from "react";
52
- import { GridUpdatingContextProvider } from "@contexts/GridUpdatingContextProvider";
53
- import { GridContextProvider } from "@contexts/GridContextProvider";
54
- import { ColDefT, GridCell } from "@components/GridCell";
55
- import { GridPopoverMessage } from "@components/gridPopoverEdit/GridPopoverMessage";
52
+ import {
53
+ GridUpdatingContextProvider,
54
+ GridContextProvider,
55
+ ColDefT,
56
+ GridCell,
57
+ GridPopoverMessage,
58
+ GridPopoverEditDropDown
59
+ } from "@linzjs/step-ag-grid";
56
60
 
57
61
  const GridDemo = () => {
58
62
  interface ITestRow {
59
63
  id: number;
64
+ name: number;
60
65
  position: string;
61
- age: number;
62
66
  };
63
67
 
64
68
  const columnDefs: ColDefT<ITestRow>[] = useMemo(() => [
@@ -69,8 +73,8 @@ const GridDemo = () => {
69
73
  maxWidth: 85,
70
74
  }),
71
75
  GridCell({
72
- field: "position",
73
- headerName: "Position",
76
+ field: "name",
77
+ headerName: "Name",
74
78
  initialWidth: 65,
75
79
  maxWidth: 150,
76
80
  cellRendererParams: {
@@ -78,6 +82,20 @@ const GridDemo = () => {
78
82
  info: (props) => props.value === "Developer" && "Developers are awesome",
79
83
  },
80
84
  }),
85
+ GridPopoverEditDropDown(
86
+ {
87
+ field: "position",
88
+ initialWidth: 65,
89
+ maxWidth: 150,
90
+ headerName: "Position",
91
+ },
92
+ {
93
+ multiEdit: false,
94
+ editorParams: {
95
+ options: ["Architect", "Developer", "Product Owner", "Scrum Master", "Tester", MenuSeparator, "(other)"],
96
+ },
97
+ },
98
+ ),
81
99
  GridPopoverMessage(
82
100
  {
83
101
  headerName: "Popout message",
@@ -86,7 +104,7 @@ const GridDemo = () => {
86
104
  {
87
105
  multiEdit: true,
88
106
  editorParams: {
89
- message: async (formParams): Promise<string> => {
107
+ message: async (formParams) => {
90
108
  return `There are ${formParams.selectedRows.length} row(s) selected`;
91
109
  },
92
110
  },
@@ -98,8 +116,8 @@ const GridDemo = () => {
98
116
 
99
117
  const rowData: ITestRow[] = useMemo(
100
118
  () => [
101
- { id: 1000, position: "Tester", age: 30, desc: "Tests application", dd: "1" },
102
- { id: 1001, position: "Developer", age: 12, desc: "Develops application", dd: "2" },
119
+ { id: 1000, name: "Tom", position: "Tester" },
120
+ { id: 1001, name: "Sue", position: "Developer" },
103
121
  ],
104
122
  [],
105
123
  );
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": "2.1.0",
5
+ "version": "2.1.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -93,7 +93,6 @@ const GridEditDropDownTemplate: ComponentStory<typeof Grid> = (props: GridProps)
93
93
  {
94
94
  multiEdit: false,
95
95
  editorParams: {
96
- className: "Xxx",
97
96
  options: ["Architect", "Developer", "Product Owner", "Scrum Master", "Tester", MenuSeparator, "(other)"],
98
97
  },
99
98
  },