@linzjs/step-ag-grid 2.5.0 → 3.0.1

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 (39) hide show
  1. package/dist/index.js +361 -282
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/GridCell.d.ts +4 -7
  4. package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
  5. package/dist/src/components/gridForm/GridFormEditBearing.d.ts +1 -1
  6. package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
  7. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +2 -2
  8. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +8 -3
  9. package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +1 -1
  10. package/dist/src/components/gridForm/GridFormTextArea.d.ts +1 -1
  11. package/dist/src/components/gridForm/GridFormTextInput.d.ts +1 -1
  12. package/dist/src/contexts/GridPopoverContext.d.ts +10 -6
  13. package/dist/src/contexts/GridPopoverContextProvider.d.ts +3 -1
  14. package/dist/src/lui/TextInputFormatted.d.ts +0 -1
  15. package/dist/step-ag-grid.esm.js +362 -283
  16. package/dist/step-ag-grid.esm.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/components/GridCell.tsx +9 -33
  19. package/src/components/GridPopoverHook.tsx +4 -8
  20. package/src/components/GridSubComponentTextArea.tsx +0 -6
  21. package/src/components/gridForm/GridFormDropDown.tsx +35 -37
  22. package/src/components/gridForm/GridFormEditBearing.tsx +12 -8
  23. package/src/components/gridForm/GridFormMessage.tsx +8 -6
  24. package/src/components/gridForm/GridFormMultiSelect.tsx +56 -48
  25. package/src/components/gridForm/GridFormPopoverMenu.tsx +112 -29
  26. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +2 -1
  27. package/src/components/gridForm/GridFormTextArea.tsx +11 -9
  28. package/src/components/gridForm/GridFormTextInput.tsx +13 -16
  29. package/src/contexts/GridPopoverContext.tsx +18 -9
  30. package/src/contexts/GridPopoverContextProvider.tsx +24 -27
  31. package/src/lui/TextAreaInput.tsx +13 -1
  32. package/src/lui/TextInputFormatted.tsx +3 -2
  33. package/src/react-menu3/components/MenuList.tsx +42 -10
  34. package/src/react-menu3/contexts/SettingsContext.ts +1 -1
  35. package/src/stories/grid/FormTest.tsx +17 -15
  36. package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +3 -1
  37. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +0 -1
  38. package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +3 -3
  39. package/src/stories/grid/GridReadOnly.stories.tsx +15 -5
@@ -135,7 +135,9 @@ const GridEditDropDownTemplate: ComponentStory<typeof Grid> = (props: GridProps)
135
135
  options: [null, "Architect", "Developer", "Product Owner", "Scrum Master", "Tester", "(other)"],
136
136
  onSelectedItem: async (selected) => {
137
137
  await wait(2000);
138
- selected.selectedRows.forEach((row) => (row.position3 = selected.value));
138
+ selected.selectedRows.forEach((row) => {
139
+ row.position3 = selected.value;
140
+ });
139
141
  },
140
142
  },
141
143
  },
@@ -143,7 +143,6 @@ const GridPopoutEditGenericTemplate: ComponentStory<typeof Grid> = (props: GridP
143
143
  action: async (selectedRows) => {
144
144
  await wait(1500);
145
145
  setRowData(rowData.filter((data) => !selectedRows.some((row) => row.id == data.id)));
146
- return true;
147
146
  },
148
147
  supportsMultiEdit: true,
149
148
  },
@@ -62,7 +62,7 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
62
62
  {
63
63
  field: "position",
64
64
  initialWidth: 65,
65
- maxWidth: 150,
65
+ maxWidth: 300,
66
66
  headerName: "Position",
67
67
  },
68
68
  {
@@ -81,7 +81,7 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
81
81
  {
82
82
  value: "other",
83
83
  label: "Other",
84
- subComponent: () => <GridSubComponentTextArea maxLength={2} defaultValue={""} />,
84
+ subComponent: () => <GridSubComponentTextArea maxLength={5} defaultValue={""} />,
85
85
  },
86
86
  ],
87
87
  initialSelectedValues: () => ({
@@ -105,7 +105,7 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
105
105
  field: "position2",
106
106
  initialWidth: 65,
107
107
  maxWidth: 150,
108
- headerName: "Inital editor values ",
108
+ headerName: "Initial editor values ",
109
109
  valueGetter: (props) => positionTwoMap[props.data.position2],
110
110
  },
111
111
  {
@@ -12,6 +12,8 @@ import { wait } from "../../utils/util";
12
12
  import { GridPopoverMenu } from "../../components/gridPopoverEdit/GridPopoverMenu";
13
13
  import { ColDefT, GridCell } from "../../components/GridCell";
14
14
  import { GridPopoverMessage } from "../../components/gridPopoverEdit/GridPopoverMessage";
15
+ import { GridSubComponentTextArea } from "../../components/GridSubComponentTextArea";
16
+ import { MenuOption } from "../../components/gridForm/GridFormPopoverMenu";
15
17
 
16
18
  export default {
17
19
  title: "Components / Grids",
@@ -84,9 +86,9 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
84
86
  {
85
87
  multiEdit: true,
86
88
  editorParams: {
87
- message: async (formParams): Promise<string> => {
89
+ message: async (selectedRows): Promise<string> => {
88
90
  await wait(1000);
89
- return `There are ${formParams.selectedRows.length} row(s) selected`;
91
+ return `There are ${selectedRows.length} row(s) selected`;
90
92
  },
91
93
  },
92
94
  },
@@ -105,7 +107,6 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
105
107
  action: async (selectedRows) => {
106
108
  alert(`Single-edit: ${selectedRows.length} rows`);
107
109
  await wait(1500);
108
- return true;
109
110
  },
110
111
  supportsMultiEdit: false,
111
112
  },
@@ -114,7 +115,6 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
114
115
  action: async (selectedRows) => {
115
116
  alert(`Multi-edit: ${selectedRows.length} rows`);
116
117
  await wait(1500);
117
- return true;
118
118
  },
119
119
  supportsMultiEdit: true,
120
120
  },
@@ -128,7 +128,17 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
128
128
  hidden: selectedItems.some((x) => x.position != "Developer"),
129
129
  supportsMultiEdit: true,
130
130
  },
131
- ];
131
+ {
132
+ label: "Other",
133
+ supportsMultiEdit: true,
134
+ action: (_, menuOptionResult) => {
135
+ alert(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
136
+ },
137
+ subComponent: () => (
138
+ <GridSubComponentTextArea placeholder={"Other"} maxLength={2} required defaultValue={""} />
139
+ ),
140
+ },
141
+ ] as MenuOption<ITestRow>[];
132
142
  },
133
143
  },
134
144
  },