@linzjs/step-ag-grid 4.0.2 → 5.0.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 (49) hide show
  1. package/dist/index.js +325 -265
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/components/GridPopoverHook.d.ts +2 -13
  4. package/dist/src/components/gridForm/GridFormDropDown.d.ts +1 -1
  5. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +1 -1
  6. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +0 -1
  7. package/dist/src/contexts/GridContext.d.ts +1 -0
  8. package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
  9. package/dist/src/contexts/GridUpdatingContext.d.ts +3 -2
  10. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
  11. package/dist/src/lui/FormError.d.ts +6 -0
  12. package/dist/src/react-menu3/components/MenuItem.d.ts +1 -1
  13. package/dist/src/react-menu3/components/SubMenu.d.ts +1 -1
  14. package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
  15. package/dist/src/react-menu3/types.d.ts +18 -17
  16. package/dist/src/react-menu3/utils/constants.d.ts +4 -0
  17. package/dist/src/react-menu3/utils/utils.d.ts +1 -1
  18. package/dist/step-ag-grid.esm.js +326 -266
  19. package/dist/step-ag-grid.esm.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/components/GridPopoverHook.tsx +30 -79
  22. package/src/components/gridForm/GridFormDropDown.tsx +62 -46
  23. package/src/components/gridForm/GridFormEditBearing.tsx +16 -8
  24. package/src/components/gridForm/GridFormMultiSelect.tsx +12 -4
  25. package/src/components/gridForm/GridFormPopoverMenu.tsx +25 -22
  26. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +1 -14
  27. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +1 -18
  28. package/src/components/gridForm/GridFormTextArea.tsx +8 -5
  29. package/src/components/gridForm/GridFormTextInput.tsx +8 -4
  30. package/src/contexts/GridContext.tsx +4 -0
  31. package/src/contexts/GridContextProvider.tsx +8 -0
  32. package/src/contexts/GridPopoverContext.tsx +1 -1
  33. package/src/contexts/GridPopoverContextProvider.tsx +7 -4
  34. package/src/contexts/GridUpdatingContext.tsx +7 -1
  35. package/src/contexts/GridUpdatingContextProvider.tsx +17 -6
  36. package/src/lui/FormError.tsx +29 -0
  37. package/src/lui/TextAreaInput.tsx +2 -18
  38. package/src/lui/TextInputFormatted.tsx +2 -17
  39. package/src/react-menu3/components/ControlledMenu.tsx +114 -12
  40. package/src/react-menu3/components/MenuItem.tsx +19 -2
  41. package/src/react-menu3/types.ts +2 -0
  42. package/src/react-menu3/utils/constants.ts +4 -0
  43. package/src/stories/grid/FormTest.tsx +24 -21
  44. package/src/stories/grid/GridPopoutBearing.stories.tsx +3 -2
  45. package/src/stories/grid/GridPopoutEditDropDown.stories.tsx +10 -0
  46. package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +1 -1
  47. package/src/stories/grid/GridReadOnly.stories.tsx +11 -11
  48. package/src/styles/GridFormDropDown.scss +1 -1
  49. package/src/utils/bearing.ts +1 -1
@@ -81,7 +81,7 @@ const GridEditMultiSelectTemplate: ComponentStory<typeof Grid> = (props: GridPro
81
81
  {
82
82
  value: "other",
83
83
  label: "Other",
84
- subComponent: () => <GridFormSubComponentTextArea maxLength={5} defaultValue={""} />,
84
+ subComponent: () => <GridFormSubComponentTextArea required={true} maxLength={5} defaultValue={""} />,
85
85
  },
86
86
  ],
87
87
  initialSelectedValues: () => ({
@@ -109,7 +109,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
109
109
  alert(`Single-edit: ${selectedRows.length} rows`);
110
110
  await wait(1500);
111
111
  },
112
- supportsMultiEdit: false,
112
+ disabled: selectedItems.length > 1,
113
113
  },
114
114
  {
115
115
  label: "Multi-edit",
@@ -117,36 +117,36 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
117
117
  alert(`Multi-edit: ${selectedRows.length} rows`);
118
118
  await wait(1500);
119
119
  },
120
- supportsMultiEdit: true,
121
120
  },
122
121
  {
123
122
  label: "Disabled item",
124
123
  disabled: "Disabled for test",
125
- supportsMultiEdit: true,
126
124
  },
127
125
  {
128
126
  label: "Developer Only",
129
127
  hidden: selectedItems.some((x) => x.position != "Developer"),
130
- supportsMultiEdit: true,
131
128
  },
132
129
  {
133
130
  label: "Other (TextInput)",
134
- supportsMultiEdit: true,
135
- action: (_, menuOptionResult) => {
136
- alert(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
131
+ action: async (_, menuOptionResult) => {
132
+ // eslint-disable-next-line no-console
133
+ console.log(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
134
+ await wait(500);
137
135
  },
138
136
  subComponent: () => (
139
- <GridFormSubComponentTextInput placeholder={"Other"} maxLength={2} required defaultValue={""} />
137
+ <GridFormSubComponentTextInput placeholder={"Other"} maxLength={5} required defaultValue={""} />
140
138
  ),
141
139
  },
142
140
  {
143
141
  label: "Other (TextArea)",
144
142
  supportsMultiEdit: true,
145
- action: (_, menuOptionResult) => {
146
- alert(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
143
+ action: async (_, menuOptionResult) => {
144
+ // eslint-disable-next-line no-console
145
+ console.log(`Sub selected value was ${JSON.stringify(menuOptionResult.subValue)}`);
146
+ await wait(500);
147
147
  },
148
148
  subComponent: () => (
149
- <GridFormSubComponentTextArea placeholder={"Other"} maxLength={2} required defaultValue={""} />
149
+ <GridFormSubComponentTextArea placeholder={"Other"} maxLength={5} required defaultValue={""} />
150
150
  ),
151
151
  },
152
152
  ] as MenuOption<ITestRow>[];
@@ -4,7 +4,7 @@
4
4
  }
5
5
 
6
6
  .GridPopoverEditDropDown-containerMedium .GridFormDropDown-options {
7
- max-height: 200px;
7
+ max-height: 220px;
8
8
  overflow-y: auto;
9
9
  }
10
10
 
@@ -1,7 +1,7 @@
1
1
  import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
2
2
 
3
3
  export const bearingValueFormatter = (params: ValueFormatterParams): string => {
4
- const value = params.value;
4
+ const value = typeof params.value == "string" ? parseFloat(params.value) : params.value;
5
5
  if (value == null) {
6
6
  return "-";
7
7
  }