@linzjs/step-ag-grid 20.0.0 → 21.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 (180) hide show
  1. package/dist/src/components/ComponentLoadingWrapper.d.ts +9 -9
  2. package/dist/src/components/Grid.d.ts +80 -80
  3. package/dist/src/components/GridCell.d.ts +63 -27
  4. package/dist/src/components/GridCell.test.d.ts +1 -1
  5. package/dist/src/components/GridCellFiller.d.ts +5 -4
  6. package/dist/src/components/GridCellMultiEditor.d.ts +18 -18
  7. package/dist/src/components/GridCellMultiSelectClassRules.d.ts +2 -2
  8. package/dist/src/components/GridIcon.d.ts +9 -9
  9. package/dist/src/components/GridLoadableCell.d.ts +1 -1
  10. package/dist/src/components/GridNoRowsOverlay.d.ts +9 -9
  11. package/dist/src/components/GridPopoverHook.d.ts +12 -12
  12. package/dist/src/components/GridWrapper.d.ts +5 -5
  13. package/dist/src/components/PostSortRowsHook.d.ts +11 -11
  14. package/dist/src/components/gridFilter/GridFilterButtons.d.ts +16 -16
  15. package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +5 -5
  16. package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +2 -2
  17. package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +11 -11
  18. package/dist/src/components/gridFilter/GridFilterQuick.d.ts +5 -5
  19. package/dist/src/components/gridFilter/GridFilters.d.ts +2 -2
  20. package/dist/src/components/gridFilter/index.d.ts +7 -7
  21. package/dist/src/components/gridFilter/useGridFilter.d.ts +3 -3
  22. package/dist/src/components/gridForm/GridFormDropDown.d.ts +37 -37
  23. package/dist/src/components/gridForm/GridFormEditBearing.d.ts +12 -12
  24. package/dist/src/components/gridForm/GridFormMessage.d.ts +7 -7
  25. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +36 -36
  26. package/dist/src/components/gridForm/GridFormMultiSelectGrid.d.ts +24 -24
  27. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +36 -36
  28. package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +12 -12
  29. package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +11 -11
  30. package/dist/src/components/gridForm/GridFormTextArea.d.ts +14 -14
  31. package/dist/src/components/gridForm/GridFormTextInput.d.ts +14 -14
  32. package/dist/src/components/gridForm/index.d.ts +10 -10
  33. package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +7 -7
  34. package/dist/src/components/gridHeader/index.d.ts +1 -1
  35. package/dist/src/components/gridHook/index.d.ts +1 -1
  36. package/dist/src/components/gridHook/useGridContextMenu.d.ts +19 -19
  37. package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +5 -5
  38. package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +5 -5
  39. package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +16 -16
  40. package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +5 -5
  41. package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +8 -8
  42. package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +5 -5
  43. package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +5 -5
  44. package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +5 -5
  45. package/dist/src/components/gridPopoverEdit/index.d.ts +9 -9
  46. package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +16 -37
  47. package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +2 -2
  48. package/dist/src/components/gridRender/index.d.ts +2 -2
  49. package/dist/src/components/gridUtil.d.ts +3 -3
  50. package/dist/src/components/index.d.ts +18 -18
  51. package/dist/src/contexts/GridContext.d.ts +67 -67
  52. package/dist/src/contexts/GridContextProvider.d.ts +15 -15
  53. package/dist/src/contexts/GridContextProvider.test.d.ts +1 -1
  54. package/dist/src/contexts/GridPopoverContext.d.ts +15 -15
  55. package/dist/src/contexts/GridPopoverContextProvider.d.ts +7 -7
  56. package/dist/src/contexts/GridSubComponentContext.d.ts +10 -10
  57. package/dist/src/contexts/GridUpdatingContext.d.ts +8 -8
  58. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +3 -3
  59. package/dist/src/index.d.ts +17 -17
  60. package/dist/src/lui/ActionButton.d.ts +20 -20
  61. package/dist/src/lui/FormError.d.ts +7 -7
  62. package/dist/src/lui/TextAreaInput.d.ts +11 -11
  63. package/dist/src/lui/TextInputFormatted.d.ts +10 -10
  64. package/dist/src/lui/reactUtils.d.ts +6 -6
  65. package/dist/src/lui/reactUtils.test.d.ts +1 -1
  66. package/dist/src/lui/stateDeferredHook.d.ts +4 -4
  67. package/dist/src/lui/timeoutHook.d.ts +14 -14
  68. package/dist/src/lui/timeoutHook.test.d.ts +1 -1
  69. package/dist/src/react-menu3/components/ControlledMenu.d.ts +8 -8
  70. package/dist/src/react-menu3/components/FocusableItem.d.ts +9 -9
  71. package/dist/src/react-menu3/components/Menu.d.ts +16 -16
  72. package/dist/src/react-menu3/components/MenuButton.d.ts +8 -8
  73. package/dist/src/react-menu3/components/MenuDivider.d.ts +3 -3
  74. package/dist/src/react-menu3/components/MenuGroup.d.ts +12 -12
  75. package/dist/src/react-menu3/components/MenuHeader.d.ts +4 -4
  76. package/dist/src/react-menu3/components/MenuItem.d.ts +59 -59
  77. package/dist/src/react-menu3/components/MenuList.d.ts +2 -2
  78. package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +25 -25
  79. package/dist/src/react-menu3/components/SubMenu.d.ts +110 -110
  80. package/dist/src/react-menu3/contexts/EventHandlersContext.d.ts +7 -7
  81. package/dist/src/react-menu3/contexts/HoverItemContext.d.ts +2 -2
  82. package/dist/src/react-menu3/contexts/ItemSettingsContext.d.ts +5 -5
  83. package/dist/src/react-menu3/contexts/MenuListContext.d.ts +9 -9
  84. package/dist/src/react-menu3/contexts/MenuListItemContext.d.ts +11 -11
  85. package/dist/src/react-menu3/contexts/RadioGroupContext.d.ts +7 -7
  86. package/dist/src/react-menu3/contexts/SettingsContext.d.ts +20 -20
  87. package/dist/src/react-menu3/hooks/index.d.ts +9 -9
  88. package/dist/src/react-menu3/hooks/useBEM.d.ts +10 -10
  89. package/dist/src/react-menu3/hooks/useCombinedRef.d.ts +2 -2
  90. package/dist/src/react-menu3/hooks/useIsomorphicLayoutEffect.d.ts +3 -3
  91. package/dist/src/react-menu3/hooks/useItemEffect.d.ts +2 -2
  92. package/dist/src/react-menu3/hooks/useItemState.d.ts +7 -7
  93. package/dist/src/react-menu3/hooks/useItems.d.ts +7 -7
  94. package/dist/src/react-menu3/hooks/useMenuChange.d.ts +2 -2
  95. package/dist/src/react-menu3/hooks/useMenuState.d.ts +23 -14
  96. package/dist/src/react-menu3/hooks/useMenuStateAndFocus.d.ts +2 -2
  97. package/dist/src/react-menu3/index.d.ts +11 -11
  98. package/dist/src/react-menu3/positionUtils/getPositionHelpers.d.ts +11 -11
  99. package/dist/src/react-menu3/positionUtils/index.d.ts +3 -3
  100. package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +8 -8
  101. package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +8 -8
  102. package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +19 -19
  103. package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +19 -19
  104. package/dist/src/react-menu3/positionUtils/positionContextMenu.d.ts +13 -13
  105. package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +26 -26
  106. package/dist/src/react-menu3/style-utils/index.d.ts +11 -11
  107. package/dist/src/react-menu3/types.d.ts +401 -401
  108. package/dist/src/react-menu3/utils/constants.d.ts +54 -54
  109. package/dist/src/react-menu3/utils/index.d.ts +3 -3
  110. package/dist/src/react-menu3/utils/propTypes2.d.ts +56 -56
  111. package/dist/src/react-menu3/utils/utils.d.ts +37 -37
  112. package/dist/src/react-menu3/utils/withHovering.d.ts +7 -7
  113. package/dist/src/utils/bearing.d.ts +19 -19
  114. package/dist/src/utils/bearing.test.d.ts +1 -1
  115. package/dist/src/utils/deferredPromise.d.ts +5 -5
  116. package/dist/src/utils/storybookTestUtil.d.ts +3 -3
  117. package/dist/src/utils/testQuick.d.ts +62 -62
  118. package/dist/src/utils/testUtil.d.ts +46 -45
  119. package/dist/src/utils/textMatcher.d.ts +13 -13
  120. package/dist/src/utils/textMatcher.test.d.ts +1 -1
  121. package/dist/src/utils/textValidator.d.ts +18 -18
  122. package/dist/src/utils/textValidator.test.d.ts +1 -1
  123. package/dist/src/utils/util.d.ts +8 -8
  124. package/dist/src/utils/util.test.d.ts +1 -1
  125. package/dist/step-ag-grid.cjs.js +4652 -4651
  126. package/dist/step-ag-grid.cjs.js.map +1 -1
  127. package/dist/step-ag-grid.esm.js +4652 -4651
  128. package/dist/step-ag-grid.esm.js.map +1 -1
  129. package/dist/vite.config.d.ts +2 -0
  130. package/package.json +21 -20
  131. package/src/components/Grid.tsx +4 -4
  132. package/src/components/GridCell.test.tsx +2 -3
  133. package/src/components/GridCell.tsx +75 -23
  134. package/src/components/GridCellFiller.tsx +2 -1
  135. package/src/components/GridCellMultiEditor.tsx +9 -9
  136. package/src/components/GridCellMultiSelectClassRules.tsx +4 -4
  137. package/src/components/GridPopoverHook.tsx +4 -4
  138. package/src/components/PostSortRowsHook.ts +2 -2
  139. package/src/components/gridFilter/GridFilterButtons.tsx +6 -6
  140. package/src/components/gridFilter/GridFilterColumnsToggle.tsx +2 -5
  141. package/src/components/gridFilter/GridFilterDownloadCsvButton.tsx +1 -1
  142. package/src/components/gridFilter/useGridFilter.ts +1 -1
  143. package/src/components/gridForm/GridFormDropDown.tsx +9 -9
  144. package/src/components/gridForm/GridFormEditBearing.tsx +5 -5
  145. package/src/components/gridForm/GridFormMessage.tsx +4 -4
  146. package/src/components/gridForm/GridFormMultiSelect.tsx +9 -9
  147. package/src/components/gridForm/GridFormMultiSelectGrid.tsx +11 -11
  148. package/src/components/gridForm/GridFormPopoverMenu.tsx +13 -13
  149. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +4 -4
  150. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +4 -4
  151. package/src/components/gridForm/GridFormTextArea.tsx +6 -6
  152. package/src/components/gridForm/GridFormTextInput.tsx +7 -7
  153. package/src/components/gridHook/useGridContextMenu.tsx +8 -8
  154. package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +6 -6
  155. package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +6 -6
  156. package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +16 -16
  157. package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +6 -6
  158. package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +5 -5
  159. package/src/components/gridPopoverEdit/GridPopoverMessage.ts +5 -5
  160. package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +5 -4
  161. package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +5 -5
  162. package/src/components/gridRender/GridRenderGenericCell.tsx +6 -36
  163. package/src/contexts/GridContext.tsx +7 -7
  164. package/src/contexts/GridContextProvider.test.tsx +1 -1
  165. package/src/contexts/GridContextProvider.tsx +10 -10
  166. package/src/contexts/GridPopoverContext.tsx +6 -6
  167. package/src/stories/grid/GridDragRow.stories.tsx +4 -4
  168. package/src/stories/grid/GridNonEditableRow.stories.tsx +2 -3
  169. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +2 -2
  170. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +1 -1
  171. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +2 -2
  172. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +3 -3
  173. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +2 -2
  174. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +2 -2
  175. package/src/stories/grid/GridReadOnly.stories.tsx +6 -6
  176. package/src/stories/grid/GridViewList.stories.tsx +5 -7
  177. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +3 -3
  178. package/src/utils/testUtil.ts +49 -7
  179. package/src/utils/textValidator.ts +5 -5
  180. package/src/utils/util.ts +1 -1
@@ -45,12 +45,12 @@ export interface GridFormMultiSelectGroup {
45
45
  filter?: string;
46
46
  }
47
47
 
48
- export interface GridFormMultiSelectSaveProps<RowType extends GridBaseRow> {
49
- selectedRows: RowType[];
48
+ export interface GridFormMultiSelectSaveProps<TData extends GridBaseRow> {
49
+ selectedRows: TData[];
50
50
  selectedOptions: MultiSelectOption[];
51
51
  }
52
52
 
53
- export interface GridFormMultiSelectProps<RowType extends GridBaseRow> extends CellEditorCommon {
53
+ export interface GridFormMultiSelectProps<TData extends GridBaseRow> extends CellEditorCommon {
54
54
  className?:
55
55
  | "GridMultiSelect-containerSmall"
56
56
  | "GridMultiSelect-containerMedium"
@@ -63,14 +63,14 @@ export interface GridFormMultiSelectProps<RowType extends GridBaseRow> extends C
63
63
  filterHelpText?: string | ((filter: string, options: MultiSelectOption[]) => string | undefined);
64
64
  noOptionsMessage?: string;
65
65
  onSelectFilter?: (props: { filter: string; options: MultiSelectOption[] }) => void;
66
- onSave?: (props: GridFormMultiSelectSaveProps<RowType>) => Promise<boolean>;
66
+ onSave?: (props: GridFormMultiSelectSaveProps<TData>) => Promise<boolean>;
67
67
  headers?: GridFormMultiSelectGroup[];
68
- options: MultiSelectOption[] | ((selectedRows: RowType[]) => Promise<MultiSelectOption[]> | MultiSelectOption[]);
69
- invalid?: (selectedRows: RowType[], selectedOptions: MultiSelectOption[]) => boolean;
68
+ options: MultiSelectOption[] | ((selectedRows: TData[]) => Promise<MultiSelectOption[]> | MultiSelectOption[]);
69
+ invalid?: (selectedRows: TData[], selectedOptions: MultiSelectOption[]) => boolean;
70
70
  }
71
71
 
72
- export const GridFormMultiSelect = <RowType extends GridBaseRow>(props: GridFormMultiSelectProps<RowType>) => {
73
- const { selectedRows, data } = useGridPopoverContext<RowType>();
72
+ export const GridFormMultiSelect = <TData extends GridBaseRow>(props: GridFormMultiSelectProps<TData>) => {
73
+ const { selectedRows, data } = useGridPopoverContext<TData>();
74
74
 
75
75
  const subComponentIsValidRef = useRef<Record<string, boolean>>({});
76
76
  const optionsInitialising = useRef(false);
@@ -95,7 +95,7 @@ export const GridFormMultiSelect = <RowType extends GridBaseRow>(props: GridForm
95
95
  }, [options, props, selectedRows]);
96
96
 
97
97
  const save = useCallback(
98
- async (selectedRows: RowType[]): Promise<boolean> => {
98
+ async (selectedRows: TData[]): Promise<boolean> => {
99
99
  if (!options || !props.onSave) return true;
100
100
 
101
101
  // Any changes to save?
@@ -19,34 +19,34 @@ export interface MultiSelectGridOption {
19
19
  warning?: string | undefined;
20
20
  }
21
21
 
22
- export interface GridFormMultiSelectGridSaveProps<RowType extends GridBaseRow> {
23
- selectedRows: RowType[];
22
+ export interface GridFormMultiSelectGridSaveProps<TData extends GridBaseRow> {
23
+ selectedRows: TData[];
24
24
  addValues: any[];
25
25
  removeValues: any[];
26
26
  }
27
27
 
28
- export interface GridFormMultiSelectGridProps<RowType extends GridBaseRow> extends CellEditorCommon {
28
+ export interface GridFormMultiSelectGridProps<TData extends GridBaseRow> extends CellEditorCommon {
29
29
  className?: string | undefined;
30
30
  noOptionsMessage?: string;
31
- onSave?: (props: GridFormMultiSelectGridSaveProps<RowType>) => Promise<boolean>;
31
+ onSave?: (props: GridFormMultiSelectGridSaveProps<TData>) => Promise<boolean>;
32
32
  options:
33
33
  | MultiSelectGridOption[]
34
- | ((selectedRows: RowType[]) => Promise<MultiSelectGridOption[]> | MultiSelectGridOption[]);
35
- invalid?: (props: GridFormMultiSelectGridSaveProps<RowType>) => boolean;
34
+ | ((selectedRows: TData[]) => Promise<MultiSelectGridOption[]> | MultiSelectGridOption[]);
35
+ invalid?: (props: GridFormMultiSelectGridSaveProps<TData>) => boolean;
36
36
  maxRowCount?: number;
37
37
  }
38
38
 
39
- export const GridFormMultiSelectGrid = <RowType extends GridBaseRow>(
40
- props: GridFormMultiSelectGridProps<RowType>,
39
+ export const GridFormMultiSelectGrid = <TData extends GridBaseRow>(
40
+ props: GridFormMultiSelectGridProps<TData>,
41
41
  ): ReactElement => {
42
- const { selectedRows } = useGridPopoverContext<RowType>();
42
+ const { selectedRows } = useGridPopoverContext<TData>();
43
43
  const optionsInitialising = useRef(false);
44
44
 
45
45
  const [initialValues, setInitialValues] = useState<MultiSelectGridOption[]>();
46
46
  const [options, setOptions] = useState<MultiSelectGridOption[]>();
47
47
 
48
48
  const genSave = useCallback(
49
- (selectedRows: RowType[]): GridFormMultiSelectGridSaveProps<RowType> => {
49
+ (selectedRows: TData[]): GridFormMultiSelectGridSaveProps<TData> => {
50
50
  if (!options) return { selectedRows, addValues: [], removeValues: [] };
51
51
 
52
52
  const preChecked = (initialValues ?? []).filter((o) => o.checked).map((o) => o.value);
@@ -63,7 +63,7 @@ export const GridFormMultiSelectGrid = <RowType extends GridBaseRow>(
63
63
  );
64
64
 
65
65
  const save = useCallback(
66
- async (selectedRows: RowType[]): Promise<boolean> => {
66
+ async (selectedRows: TData[]): Promise<boolean> => {
67
67
  if (!options || !props.onSave) return true;
68
68
  // Any changes to save?
69
69
  if (
@@ -10,9 +10,9 @@ import { GridBaseRow } from "../Grid";
10
10
  import { CellEditorCommon } from "../GridCell";
11
11
  import { useGridPopoverHook } from "../GridPopoverHook";
12
12
 
13
- export interface GridFormPopoverMenuProps<RowType extends GridBaseRow> extends CellEditorCommon {
14
- options: (selectedRows: RowType[]) => Promise<MenuOption<RowType>[]>;
15
- defaultAction?: (props: { selectedRows: RowType[]; menuOption: SelectedMenuOptionResult<RowType> }) => Promise<void>;
13
+ export interface GridFormPopoverMenuProps<TData extends GridBaseRow> extends CellEditorCommon {
14
+ options: (selectedRows: TData[]) => Promise<MenuOption<TData>[]>;
15
+ defaultAction?: (props: { selectedRows: TData[]; menuOption: SelectedMenuOptionResult<TData> }) => Promise<void>;
16
16
  }
17
17
 
18
18
  /** Menu configuration types **/
@@ -23,14 +23,14 @@ interface MenuSeparatorType {
23
23
  __isMenuSeparator__: boolean;
24
24
  }
25
25
 
26
- export interface SelectedMenuOptionResult<RowType extends GridBaseRow> extends MenuOption<RowType> {
26
+ export interface SelectedMenuOptionResult<TData extends GridBaseRow> extends MenuOption<TData> {
27
27
  subValue: any;
28
28
  }
29
29
 
30
- export interface MenuOption<RowType extends GridBaseRow> {
30
+ export interface MenuOption<TData extends GridBaseRow> {
31
31
  label: ReactElement | string | MenuSeparatorType;
32
32
  subMenu?: () => ReactElement;
33
- action?: (props: { selectedRows: RowType[]; menuOption: SelectedMenuOptionResult<RowType> }) => Promise<void>;
33
+ action?: (props: { selectedRows: TData[]; menuOption: SelectedMenuOptionResult<TData> }) => Promise<void>;
34
34
  disabled?: string | boolean;
35
35
  hidden?: boolean;
36
36
  subComponent?: (props: any) => ReactElement;
@@ -40,18 +40,18 @@ export interface MenuOption<RowType extends GridBaseRow> {
40
40
  * NOTE: If the popout menu doesn't appear on single click when also selecting row it's because
41
41
  * you need a useMemo around your columnDefs
42
42
  */
43
- export const GridFormPopoverMenu = <RowType extends GridBaseRow>(props: GridFormPopoverMenuProps<RowType>) => {
44
- const { selectedRows, updateValue, data } = useGridPopoverContext<RowType>();
43
+ export const GridFormPopoverMenu = <TData extends GridBaseRow>(props: GridFormPopoverMenuProps<TData>) => {
44
+ const { selectedRows, updateValue, data } = useGridPopoverContext<TData>();
45
45
 
46
46
  const optionsInitialising = useRef(false);
47
- const [options, setOptions] = useState<MenuOption<RowType>[]>();
47
+ const [options, setOptions] = useState<MenuOption<TData>[]>();
48
48
 
49
- const [subComponentSelected, setSubComponentSelected] = useState<MenuOption<RowType> | null>(null);
49
+ const [subComponentSelected, setSubComponentSelected] = useState<MenuOption<TData> | null>(null);
50
50
  const subComponentIsValid = useRef(false);
51
51
  const [subSelectedValue, setSubSelectedValue] = useState<any>();
52
52
 
53
53
  const defaultAction = useCallback(
54
- async (params: { selectedRows: RowType[]; menuOption: SelectedMenuOptionResult<RowType> }) => {
54
+ async (params: { selectedRows: TData[]; menuOption: SelectedMenuOptionResult<TData> }) => {
55
55
  if (props.defaultAction) await props.defaultAction(params);
56
56
  else console.error(`No action specified for ${params.menuOption.label} menu options`);
57
57
  },
@@ -80,7 +80,7 @@ export const GridFormPopoverMenu = <RowType extends GridBaseRow>(props: GridForm
80
80
  }, [options, props.defaultAction, props.options, selectedRows]);
81
81
 
82
82
  const actionClick = useCallback(
83
- async (menuOption: MenuOption<RowType>) => {
83
+ async (menuOption: MenuOption<TData>) => {
84
84
  await (menuOption.action ?? defaultAction)({
85
85
  selectedRows,
86
86
  menuOption: { ...menuOption, subValue: subSelectedValue },
@@ -91,7 +91,7 @@ export const GridFormPopoverMenu = <RowType extends GridBaseRow>(props: GridForm
91
91
  );
92
92
 
93
93
  const onMenuItemClick = useCallback(
94
- async (e: ClickEvent, item: MenuOption<RowType>) => {
94
+ async (e: ClickEvent, item: MenuOption<TData>) => {
95
95
  if (item.subComponent) {
96
96
  subComponentIsValid.current = false;
97
97
  setSubSelectedValue(null);
@@ -7,8 +7,8 @@ import { TextInputValidator, TextInputValidatorProps } from "../../utils/textVal
7
7
  import { GridBaseRow } from "../Grid";
8
8
  import { CellEditorCommon } from "../GridCell";
9
9
 
10
- export interface GridSubComponentTextAreaProps<RowType extends GridBaseRow>
11
- extends TextInputValidatorProps<RowType>,
10
+ export interface GridSubComponentTextAreaProps<TData extends GridBaseRow>
11
+ extends TextInputValidatorProps<TData>,
12
12
  CellEditorCommon {
13
13
  placeholder?: string;
14
14
  width?: string | number;
@@ -17,8 +17,8 @@ export interface GridSubComponentTextAreaProps<RowType extends GridBaseRow>
17
17
  helpText?: string;
18
18
  }
19
19
 
20
- export const GridFormSubComponentTextArea = <RowType extends GridBaseRow>(
21
- props: GridSubComponentTextAreaProps<RowType>,
20
+ export const GridFormSubComponentTextArea = <TData extends GridBaseRow>(
21
+ props: GridSubComponentTextAreaProps<TData>,
22
22
  ): ReactElement => {
23
23
  const { value, data, setValue, setValid, context } = useContext(GridSubComponentContext);
24
24
 
@@ -6,8 +6,8 @@ import { TextInputValidator, TextInputValidatorProps } from "../../utils/textVal
6
6
  import { GridBaseRow } from "../Grid";
7
7
  import { CellEditorCommon } from "../GridCell";
8
8
 
9
- export interface GridFormSubComponentTextInputProps<RowType extends GridBaseRow>
10
- extends TextInputValidatorProps<RowType>,
9
+ export interface GridFormSubComponentTextInputProps<TData extends GridBaseRow>
10
+ extends TextInputValidatorProps<TData>,
11
11
  CellEditorCommon {
12
12
  placeholder?: string;
13
13
  width?: string | number;
@@ -15,8 +15,8 @@ export interface GridFormSubComponentTextInputProps<RowType extends GridBaseRow>
15
15
  helpText?: string;
16
16
  }
17
17
 
18
- export const GridFormSubComponentTextInput = <RowType extends GridBaseRow>(
19
- props: GridFormSubComponentTextInputProps<RowType>,
18
+ export const GridFormSubComponentTextInput = <TData extends GridBaseRow>(
19
+ props: GridFormSubComponentTextInputProps<TData>,
20
20
  ): ReactElement => {
21
21
  const { value, setValue, setValid, data, context } = useContext(GridSubComponentContext);
22
22
 
@@ -7,17 +7,17 @@ import { GridBaseRow } from "../Grid";
7
7
  import { CellEditorCommon } from "../GridCell";
8
8
  import { useGridPopoverHook } from "../GridPopoverHook";
9
9
 
10
- export interface GridFormTextAreaProps<RowType extends GridBaseRow>
11
- extends TextInputValidatorProps<RowType>,
10
+ export interface GridFormTextAreaProps<TData extends GridBaseRow>
11
+ extends TextInputValidatorProps<TData>,
12
12
  CellEditorCommon {
13
13
  placeholder?: string;
14
14
  width?: string | number;
15
- onSave?: (props: { selectedRows: RowType[]; value: string }) => Promise<boolean>;
15
+ onSave?: (props: { selectedRows: TData[]; value: string }) => Promise<boolean>;
16
16
  helpText?: string;
17
17
  }
18
18
 
19
- export const GridFormTextArea = <RowType extends GridBaseRow>(props: GridFormTextAreaProps<RowType>): ReactElement => {
20
- const { field, value: initialVale, data } = useGridPopoverContext<RowType>();
19
+ export const GridFormTextArea = <TData extends GridBaseRow>(props: GridFormTextAreaProps<TData>): ReactElement => {
20
+ const { field, value: initialVale, data } = useGridPopoverContext<TData>();
21
21
 
22
22
  const initValue = useMemo(() => (initialVale == null ? "" : `${initialVale}`), [initialVale]);
23
23
  const [value, setValue] = useState(initValue);
@@ -27,7 +27,7 @@ export const GridFormTextArea = <RowType extends GridBaseRow>(props: GridFormTex
27
27
  const invalid = useCallback(() => TextInputValidator(props, value, data, {}), [props, value, data]);
28
28
 
29
29
  const save = useCallback(
30
- async (selectedRows: RowType[]): Promise<boolean> => {
30
+ async (selectedRows: TData[]): Promise<boolean> => {
31
31
  if (invalid()) return false;
32
32
 
33
33
  const trimmedValue = value.trim();
@@ -7,28 +7,28 @@ import { GridBaseRow } from "../Grid";
7
7
  import { CellEditorCommon } from "../GridCell";
8
8
  import { useGridPopoverHook } from "../GridPopoverHook";
9
9
 
10
- export interface GridFormTextInputProps<RowType extends GridBaseRow>
11
- extends TextInputValidatorProps<RowType>,
10
+ export interface GridFormTextInputProps<TData extends GridBaseRow>
11
+ extends TextInputValidatorProps<TData>,
12
12
  CellEditorCommon {
13
13
  placeholder?: string;
14
14
  units?: string;
15
15
  width?: string | number;
16
- onSave?: (props: { selectedRows: RowType[]; value: string }) => Promise<boolean>;
16
+ onSave?: (props: { selectedRows: TData[]; value: string }) => Promise<boolean>;
17
17
  helpText?: string;
18
18
  }
19
19
 
20
- export const GridFormTextInput = <RowType extends GridBaseRow>(props: GridFormTextInputProps<RowType>) => {
21
- const { field, value: initialVale, data } = useGridPopoverContext<RowType>();
20
+ export const GridFormTextInput = <TData extends GridBaseRow>(props: GridFormTextInputProps<TData>) => {
21
+ const { field, value: initialVale, data } = useGridPopoverContext<TData>();
22
22
 
23
23
  const helpText = props.helpText ?? "Press enter or tab to save";
24
24
 
25
25
  const initValue = useMemo(() => (initialVale == null ? "" : `${initialVale}`), [initialVale]);
26
26
  const [value, setValue] = useState(initValue);
27
27
 
28
- const invalid = useCallback(() => TextInputValidator<RowType>(props, value, data, {}), [data, props, value]);
28
+ const invalid = useCallback(() => TextInputValidator<TData>(props, value, data, {}), [data, props, value]);
29
29
 
30
30
  const save = useCallback(
31
- async (selectedRows: RowType[]): Promise<boolean> => {
31
+ async (selectedRows: TData[]): Promise<boolean> => {
32
32
  if (invalid()) return false;
33
33
 
34
34
  const trimmedValue = value.trim();
@@ -1,28 +1,28 @@
1
1
  import { ColDef } from "ag-grid-community";
2
- import { CellContextMenuEvent } from "ag-grid-community/dist/lib/events";
2
+ import { CellContextMenuEvent } from "ag-grid-community";
3
3
  import { ReactElement, useCallback, useContext, useRef, useState } from "react";
4
4
 
5
5
  import { GridContext } from "../../contexts/GridContext";
6
6
  import { ControlledMenu } from "../../react-menu3";
7
7
  import { GridBaseRow } from "../Grid";
8
8
 
9
- export interface GridContextMenuComponentProps<RowType extends GridBaseRow> {
10
- selectedRows: RowType[];
11
- clickedRow: RowType;
9
+ export interface GridContextMenuComponentProps<TData extends GridBaseRow> {
10
+ selectedRows: TData[];
11
+ clickedRow: TData;
12
12
  colDef: ColDef;
13
13
  close: () => void;
14
14
  }
15
15
 
16
- export type GridContextMenuComponent<RowType extends GridBaseRow> = (
17
- props: GridContextMenuComponentProps<RowType>,
16
+ export type GridContextMenuComponent<TData extends GridBaseRow> = (
17
+ props: GridContextMenuComponentProps<TData>,
18
18
  ) => ReactElement | null;
19
19
 
20
- export const useGridContextMenu = <RowType extends GridBaseRow>({
20
+ export const useGridContextMenu = <TData extends GridBaseRow>({
21
21
  contextMenuSelectRow,
22
22
  contextMenu: ContextMenu,
23
23
  }: {
24
24
  contextMenuSelectRow: boolean;
25
- contextMenu?: GridContextMenuComponent<RowType>;
25
+ contextMenu?: GridContextMenuComponent<TData>;
26
26
  }) => {
27
27
  const { redrawRows, prePopupOps, postPopupOps, getSelectedRows } = useContext(GridContext);
28
28
 
@@ -3,15 +3,15 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormMultiSelect, GridFormMultiSelectProps } from "../gridForm/GridFormMultiSelect";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoutEditMultiSelect = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- props: GenericCellEditorProps<GridFormMultiSelectProps<RowType>>,
9
- ): ColDefT<RowType> =>
10
- GridCell(colDef, {
6
+ export const GridPopoutEditMultiSelect = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ props: GenericCellEditorProps<GridFormMultiSelectProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormMultiSelectProps<TData>>(colDef, {
11
11
  editor: GridFormMultiSelect,
12
12
  ...props,
13
13
  editorParams: {
14
14
  className: "GridMultiSelect-containerMedium",
15
- ...(props.editorParams as GridFormMultiSelectProps<RowType>),
15
+ ...(props.editorParams as GridFormMultiSelectProps<TData>),
16
16
  },
17
17
  });
@@ -3,15 +3,15 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormMultiSelectGrid, GridFormMultiSelectGridProps } from "../gridForm/GridFormMultiSelectGrid";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoutEditMultiSelectGrid = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- props: GenericCellEditorProps<GridFormMultiSelectGridProps<RowType>>,
9
- ): ColDefT<RowType> =>
10
- GridCell(colDef, {
6
+ export const GridPopoutEditMultiSelectGrid = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ props: GenericCellEditorProps<GridFormMultiSelectGridProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormMultiSelectGridProps<TData>>(colDef, {
11
11
  editor: GridFormMultiSelectGrid,
12
12
  ...props,
13
13
  editorParams: {
14
14
  className: "GridMultiSelect-containerMedium",
15
- ...(props.editorParams as GridFormMultiSelectGridProps<RowType>),
15
+ ...(props.editorParams as GridFormMultiSelectGridProps<TData>),
16
16
  },
17
17
  });
@@ -1,4 +1,4 @@
1
- import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
1
+ import { ValueFormatterParams } from "ag-grid-community";
2
2
 
3
3
  import {
4
4
  bearingCorrectionRangeValidator,
@@ -11,13 +11,13 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
11
11
  import { GridFormEditBearing, GridFormEditBearingProps } from "../gridForm/GridFormEditBearing";
12
12
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
13
13
 
14
- const GridPopoverEditBearingLike = <RowType extends GridBaseRow>(
15
- colDef: GenericCellColDef<RowType>,
16
- props: GenericCellEditorProps<GridFormEditBearingProps<RowType>> & {
14
+ const GridPopoverEditBearingLike = <TData extends GridBaseRow, TValue = any>(
15
+ colDef: GenericCellColDef<TData, TValue>,
16
+ props: GenericCellEditorProps<GridFormEditBearingProps<TData>> & {
17
17
  editorParams: { formatValue: (value: any) => any };
18
18
  },
19
- ): ColDefT<RowType> =>
20
- GridCell(
19
+ ): ColDefT<TData, TValue> =>
20
+ GridCell<TData, TValue, GridFormEditBearingProps<TData>>(
21
21
  {
22
22
  valueFormatter: (params: ValueFormatterParams) => props.editorParams?.formatValue(params.value) ?? "",
23
23
  ...colDef,
@@ -34,11 +34,11 @@ export const GridPopoverEditBearingEditorParams = {
34
34
  range: bearingRangeValidator,
35
35
  };
36
36
 
37
- export const GridPopoverEditBearing = <RowType extends GridBaseRow>(
38
- colDef: GenericCellColDef<RowType>,
39
- props: GenericCellEditorProps<GridFormEditBearingProps<RowType>>,
40
- ): ColDefT<RowType> =>
41
- GridPopoverEditBearingLike(colDef, {
37
+ export const GridPopoverEditBearing = <TData extends GridBaseRow, TValue = any>(
38
+ colDef: GenericCellColDef<TData, TValue>,
39
+ props: GenericCellEditorProps<GridFormEditBearingProps<TData>>,
40
+ ): ColDefT<TData, TValue> =>
41
+ GridPopoverEditBearingLike<TData, TValue>(colDef, {
42
42
  multiEdit: !!props.multiEdit,
43
43
  editorParams: {
44
44
  ...GridPopoverEditBearingEditorParams,
@@ -52,11 +52,11 @@ export const GridPopoverEditBearingCorrectionEditorParams = {
52
52
  range: bearingCorrectionRangeValidator,
53
53
  };
54
54
 
55
- export const GridPopoverEditBearingCorrection = <RowType extends GridBaseRow>(
56
- colDef: GenericCellColDef<RowType>,
57
- props: GenericCellEditorProps<GridFormEditBearingProps<RowType>>,
58
- ): ColDefT<RowType> =>
59
- GridPopoverEditBearingLike(colDef, {
55
+ export const GridPopoverEditBearingCorrection = <TData extends GridBaseRow, TValue = any>(
56
+ colDef: GenericCellColDef<TData, TValue>,
57
+ props: GenericCellEditorProps<GridFormEditBearingProps<TData>>,
58
+ ): ColDefT<TData, TValue> =>
59
+ GridPopoverEditBearingLike<TData, TValue>(colDef, {
60
60
  multiEdit: !!props.multiEdit,
61
61
  editorParams: {
62
62
  ...GridPopoverEditBearingCorrectionEditorParams,
@@ -3,16 +3,16 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormDropDown, GridFormDropDownProps } from "../gridForm/GridFormDropDown";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoverEditDropDown = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- props: GenericCellEditorProps<GridFormDropDownProps<RowType>>,
9
- ): ColDefT<RowType> =>
10
- GridCell(colDef, {
6
+ export const GridPopoverEditDropDown = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ props: GenericCellEditorProps<GridFormDropDownProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormDropDownProps<TData>>(colDef, {
11
11
  editor: GridFormDropDown,
12
12
  ...props,
13
13
  editorParams: {
14
14
  // Defaults to large size container
15
15
  className: "GridPopoverEditDropDown-containerLarge",
16
- ...(props.editorParams as GridFormDropDownProps<RowType>),
16
+ ...(props.editorParams as GridFormDropDownProps<TData>),
17
17
  },
18
18
  });
@@ -7,11 +7,11 @@ import { GridRenderPopoutMenuCell } from "../gridRender/GridRenderPopoutMenuCell
7
7
  /**
8
8
  * Popout burger menu
9
9
  */
10
- export const GridPopoverMenu = <RowType extends GridBaseRow>(
11
- colDef: GenericCellColDef<RowType>,
12
- custom: GenericCellEditorProps<GridFormPopoverMenuProps<RowType>>,
13
- ): ColDefT<RowType> =>
14
- GridCell<RowType, GridFormPopoverMenuProps<RowType>>(
10
+ export const GridPopoverMenu = <TData extends GridBaseRow>(
11
+ colDef: GenericCellColDef<TData>,
12
+ custom: GenericCellEditorProps<GridFormPopoverMenuProps<TData>>,
13
+ ): ColDefT<TData> =>
14
+ GridCell<TData, any, GridFormPopoverMenuProps<TData>>(
15
15
  {
16
16
  minWidth: 48,
17
17
  maxWidth: 48,
@@ -3,11 +3,11 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormMessage, GridFormMessageProps } from "../gridForm/GridFormMessage";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoverMessage = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- props: GenericCellEditorProps<GridFormMessageProps<RowType>>,
9
- ): ColDefT<RowType> =>
10
- GridCell(
6
+ export const GridPopoverMessage = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ props: GenericCellEditorProps<GridFormMessageProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormMessageProps<TData>>(
11
11
  {
12
12
  resizable: true,
13
13
  ...colDef,
@@ -3,7 +3,8 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormTextArea, GridFormTextAreaProps } from "../gridForm/GridFormTextArea";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoverTextArea = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- params: GenericCellEditorProps<GridFormTextAreaProps<RowType>>,
9
- ): ColDefT<RowType> => GridCell(colDef, { editor: GridFormTextArea, ...params });
6
+ export const GridPopoverTextArea = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ params: GenericCellEditorProps<GridFormTextAreaProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormTextAreaProps<TData>>(colDef, { editor: GridFormTextArea, ...params });
@@ -3,11 +3,11 @@ import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
3
3
  import { GridFormTextInput, GridFormTextInputProps } from "../gridForm/GridFormTextInput";
4
4
  import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
5
5
 
6
- export const GridPopoverTextInput = <RowType extends GridBaseRow>(
7
- colDef: GenericCellColDef<RowType>,
8
- params: GenericCellEditorProps<GridFormTextInputProps<RowType>>,
9
- ): ColDefT<RowType> =>
10
- GridCell(colDef, {
6
+ export const GridPopoverTextInput = <TData extends GridBaseRow, TValue = any>(
7
+ colDef: GenericCellColDef<TData, TValue>,
8
+ params: GenericCellEditorProps<GridFormTextInputProps<TData>>,
9
+ ): ColDefT<TData, TValue> =>
10
+ GridCell<TData, TValue, GridFormTextInputProps<TData>>(colDef, {
11
11
  editor: GridFormTextInput,
12
12
  ...params,
13
13
  });
@@ -1,49 +1,19 @@
1
1
  import { ICellRendererParams } from "ag-grid-community";
2
- import {
3
- EditableCallbackParams,
4
- SuppressKeyboardEventParams,
5
- ValueFormatterParams,
6
- ValueGetterParams,
7
- } from "ag-grid-community/dist/lib/entities/colDef";
2
+ import { SuppressKeyboardEventParams } from "ag-grid-community";
8
3
  import { ReactElement } from "react";
9
4
 
10
5
  import { GridBaseRow } from "../Grid";
11
6
  import { ColDefT } from "../GridCell";
12
7
 
13
- export interface RowICellRendererParams<RowType extends GridBaseRow> extends ICellRendererParams {
14
- data: RowType;
15
- }
16
-
17
- export interface RowEditableCallbackParams<RowType extends GridBaseRow> extends EditableCallbackParams {
18
- data: RowType;
19
- }
20
-
21
- export interface RowValueFormatterParams<RowType extends GridBaseRow> extends ValueFormatterParams {
22
- data: RowType;
23
- }
24
- export interface RowValueGetterParams<RowType extends GridBaseRow> extends ValueGetterParams {
25
- data: RowType;
26
- }
27
-
28
- export interface RowValueGetterParams<RowType extends GridBaseRow> extends ValueGetterParams {
29
- data: RowType;
30
- }
31
-
32
- export interface GenericCellColDef<RowType extends GridBaseRow> extends ColDefT<RowType> {
33
- cellRenderer?: (params: RowICellRendererParams<RowType>) => any;
34
- cellRendererParams?: GenericCellRendererParams<RowType>;
35
- valueGetter?: string | ((params: RowValueGetterParams<RowType>) => any);
36
- valueFormatter?: string | ((params: RowValueFormatterParams<RowType>) => string);
37
- filterValueGetter?: string | ((params: RowValueGetterParams<RowType>) => string);
38
- editable?: boolean | ((params: RowEditableCallbackParams<RowType>) => boolean);
8
+ export interface GenericCellColDef<TData extends GridBaseRow, TValue = any> extends ColDefT<TData, TValue> {
39
9
  exportable?: boolean;
40
10
  }
41
11
 
42
- export interface GenericCellRendererParams<RowType extends GridBaseRow> {
12
+ export interface GenericCellRendererParams<TData extends GridBaseRow> {
43
13
  singleClickEdit?: boolean;
44
14
  rightHoverElement?: ReactElement | undefined;
45
- editAction?: (selectedRows: RowType[]) => void;
15
+ editAction?: (selectedRows: TData[]) => void;
46
16
  shortcutKeys?: Record<string, ((params: SuppressKeyboardEventParams) => boolean | void) | undefined>;
47
- warning?: (props: RowICellRendererParams<RowType>) => string | string[] | boolean | null | undefined;
48
- info?: (props: RowICellRendererParams<RowType>) => string | string[] | boolean | null | undefined;
17
+ warning?: (props: ICellRendererParams<TData>) => string | string[] | boolean | null | undefined;
18
+ info?: (props: ICellRendererParams<TData>) => string | string[] | boolean | null | undefined;
49
19
  }
@@ -1,10 +1,10 @@
1
1
  import { ColDef, ColumnApi, GridApi, IRowNode } from "ag-grid-community";
2
- import { CsvExportParams } from "ag-grid-community/dist/lib/interfaces/exportParams";
2
+ import { CsvExportParams } from "ag-grid-community";
3
3
  import { createContext, useContext } from "react";
4
4
 
5
5
  import { ColDefT, GridBaseRow } from "../components";
6
6
 
7
- export type GridFilterExternal<RowType extends GridBaseRow> = (data: RowType, rowNode: IRowNode) => boolean;
7
+ export type GridFilterExternal<TData extends GridBaseRow> = (data: TData, rowNode: IRowNode) => boolean;
8
8
 
9
9
  export interface AutoSizeColumnsProps {
10
10
  skipHeader?: boolean;
@@ -15,13 +15,13 @@ export interface AutoSizeColumnsProps {
15
15
 
16
16
  export type AutoSizeColumnsResult = { width: number } | null;
17
17
 
18
- export interface GridContextType<RowType extends GridBaseRow> {
18
+ export interface GridContextType<TData extends GridBaseRow> {
19
19
  gridReady: boolean;
20
20
  gridRenderState: () => null | "empty" | "rows-visible";
21
21
  getColDef: (colId?: string) => ColDef | undefined;
22
22
  getColumns: (
23
23
  filter?: keyof ColDef | ((r: ColDef) => boolean | undefined | null | number | string),
24
- ) => ColDefT<RowType>[];
24
+ ) => ColDefT<TData, any>[];
25
25
  getColumnIds: (filter?: keyof ColDef | ((r: ColDef) => boolean | undefined | null | number | string)) => string[];
26
26
  setApis: (gridApi: GridApi | undefined, columnApi: ColumnApi | undefined, dataTestId?: string) => void;
27
27
  prePopupOps: () => void;
@@ -57,8 +57,8 @@ export interface GridContextType<RowType extends GridBaseRow> {
57
57
  externallySelectedItemsAreInSync: boolean;
58
58
  setExternallySelectedItemsAreInSync: (inSync: boolean) => void;
59
59
  waitForExternallySelectedItemsToBeInSync: () => Promise<void>;
60
- addExternalFilter: (filter: GridFilterExternal<RowType>) => void;
61
- removeExternalFilter: (filter: GridFilterExternal<RowType>) => void;
60
+ addExternalFilter: (filter: GridFilterExternal<TData>) => void;
61
+ removeExternalFilter: (filter: GridFilterExternal<TData>) => void;
62
62
  isExternalFilterPresent: () => boolean;
63
63
  doesExternalFilterPass: (node: IRowNode) => boolean;
64
64
  invisibleColumnIds: string[] | undefined;
@@ -207,4 +207,4 @@ export const GridContext = createContext<GridContextType<any>>({
207
207
  },
208
208
  });
209
209
 
210
- export const useGridContext = <RowType extends GridBaseRow>() => useContext<GridContextType<RowType>>(GridContext);
210
+ export const useGridContext = <TData extends GridBaseRow>() => useContext<GridContextType<TData>>(GridContext);
@@ -1,4 +1,4 @@
1
- import { ValueFormatterParams } from "ag-grid-community/dist/lib/entities/colDef";
1
+ import { ValueFormatterParams } from "ag-grid-community";
2
2
 
3
3
  import { downloadCsvUseValueFormattersProcessCellCallback as Dpcc } from "./GridContextProvider";
4
4