@linzjs/step-ag-grid 23.0.1 → 24.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 (274) hide show
  1. package/dist/src/components/ComponentLoadingWrapper.d.ts +1 -1
  2. package/dist/src/components/Grid.d.ts +17 -17
  3. package/dist/src/components/GridCell.d.ts +9 -9
  4. package/dist/src/components/GridCellFiller.d.ts +2 -2
  5. package/dist/src/components/GridCellMultiEditor.d.ts +6 -6
  6. package/dist/src/components/GridCellMultiSelectClassRules.d.ts +1 -1
  7. package/dist/src/components/GridIcon.d.ts +2 -2
  8. package/dist/src/components/GridNoRowsOverlay.d.ts +1 -1
  9. package/dist/src/components/GridPopoverHook.d.ts +2 -2
  10. package/dist/src/components/GridWrapper.d.ts +1 -1
  11. package/dist/src/components/PostSortRowsHook.d.ts +1 -1
  12. package/dist/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
  13. package/dist/src/components/gridFilter/GridFilterButtons.d.ts +5 -5
  14. package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +1 -1
  15. package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -1
  16. package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +2 -2
  17. package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
  18. package/dist/src/components/gridFilter/index.d.ts +7 -7
  19. package/dist/src/components/gridFilter/useGridFilter.d.ts +2 -2
  20. package/dist/src/components/gridForm/GridFormDropDown.d.ts +8 -8
  21. package/dist/src/components/gridForm/GridFormEditBearing.d.ts +2 -2
  22. package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
  23. package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +4 -4
  24. package/dist/src/components/gridForm/GridFormMultiSelectGrid.d.ts +4 -4
  25. package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +5 -5
  26. package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +4 -4
  27. package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +4 -4
  28. package/dist/src/components/gridForm/GridFormTextArea.d.ts +4 -4
  29. package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -3
  30. package/dist/src/components/gridForm/index.d.ts +10 -10
  31. package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -1
  32. package/dist/src/components/gridHeader/index.d.ts +1 -1
  33. package/dist/src/components/gridHook/index.d.ts +1 -1
  34. package/dist/src/components/gridHook/useGridContextMenu.d.ts +4 -4
  35. package/dist/src/components/gridPopoverEdit/GridButton.d.ts +5 -5
  36. package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +4 -4
  37. package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +4 -4
  38. package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +4 -4
  39. package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -4
  40. package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +4 -4
  41. package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +4 -4
  42. package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +4 -4
  43. package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +4 -4
  44. package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +4 -4
  45. package/dist/src/components/gridPopoverEdit/index.d.ts +11 -11
  46. package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +5 -5
  47. package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -1
  48. package/dist/src/components/gridRender/index.d.ts +2 -2
  49. package/dist/src/components/gridUtil.d.ts +1 -1
  50. package/dist/src/components/index.d.ts +19 -19
  51. package/dist/src/contexts/GridContext.d.ts +4 -4
  52. package/dist/src/contexts/GridContextProvider.d.ts +3 -3
  53. package/dist/src/contexts/GridPopoverContext.d.ts +3 -3
  54. package/dist/src/contexts/GridPopoverContextProvider.d.ts +4 -4
  55. package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
  56. package/dist/src/index.d.ts +17 -17
  57. package/dist/src/lui/ActionButton.d.ts +9 -9
  58. package/dist/src/lui/FormError.d.ts +2 -2
  59. package/dist/src/lui/TextAreaInput.d.ts +1 -1
  60. package/dist/src/lui/TextInputFormatted.d.ts +2 -2
  61. package/dist/src/lui/reactUtils.d.ts +1 -1
  62. package/dist/src/lui/stateDeferredHook.d.ts +1 -1
  63. package/dist/src/react-menu3/components/ControlledMenu.d.ts +2 -2
  64. package/dist/src/react-menu3/components/FocusableItem.d.ts +3 -3
  65. package/dist/src/react-menu3/components/Menu.d.ts +3 -3
  66. package/dist/src/react-menu3/components/MenuButton.d.ts +2 -2
  67. package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
  68. package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
  69. package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
  70. package/dist/src/react-menu3/components/MenuItem.d.ts +3 -3
  71. package/dist/src/react-menu3/components/MenuList.d.ts +1 -1
  72. package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
  73. package/dist/src/react-menu3/components/SubMenu.d.ts +5 -5
  74. package/dist/src/react-menu3/contexts/EventHandlersContext.d.ts +1 -1
  75. package/dist/src/react-menu3/contexts/MenuListContext.d.ts +2 -2
  76. package/dist/src/react-menu3/contexts/MenuListItemContext.d.ts +1 -1
  77. package/dist/src/react-menu3/contexts/RadioGroupContext.d.ts +1 -1
  78. package/dist/src/react-menu3/contexts/SettingsContext.d.ts +2 -2
  79. package/dist/src/react-menu3/hooks/index.d.ts +9 -9
  80. package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
  81. package/dist/src/react-menu3/hooks/useCombinedRef.d.ts +1 -1
  82. package/dist/src/react-menu3/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
  83. package/dist/src/react-menu3/hooks/useItemEffect.d.ts +1 -1
  84. package/dist/src/react-menu3/hooks/useItemState.d.ts +1 -1
  85. package/dist/src/react-menu3/hooks/useItems.d.ts +2 -2
  86. package/dist/src/react-menu3/hooks/useMenuChange.d.ts +1 -1
  87. package/dist/src/react-menu3/hooks/useMenuState.d.ts +1 -1
  88. package/dist/src/react-menu3/hooks/useMenuStateAndFocus.d.ts +1 -1
  89. package/dist/src/react-menu3/index.d.ts +11 -11
  90. package/dist/src/react-menu3/positionUtils/getPositionHelpers.d.ts +1 -1
  91. package/dist/src/react-menu3/positionUtils/index.d.ts +3 -3
  92. package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +1 -1
  93. package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +1 -1
  94. package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +4 -4
  95. package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +5 -5
  96. package/dist/src/react-menu3/positionUtils/positionContextMenu.d.ts +2 -2
  97. package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +5 -5
  98. package/dist/src/react-menu3/style-utils/index.d.ts +1 -1
  99. package/dist/src/react-menu3/types.d.ts +15 -15
  100. package/dist/src/react-menu3/utils/constants.d.ts +1 -1
  101. package/dist/src/react-menu3/utils/index.d.ts +3 -3
  102. package/dist/src/react-menu3/utils/utils.d.ts +5 -5
  103. package/dist/src/react-menu3/utils/withHovering.d.ts +1 -1
  104. package/dist/src/utils/testQuick.d.ts +2 -2
  105. package/dist/src/utils/testUtil.d.ts +2 -2
  106. package/dist/src/utils/textValidator.d.ts +2 -2
  107. package/dist/step-ag-grid.cjs.js +966 -952
  108. package/dist/step-ag-grid.cjs.js.map +1 -1
  109. package/dist/step-ag-grid.esm.js +968 -954
  110. package/dist/step-ag-grid.esm.js.map +1 -1
  111. package/package.json +26 -41
  112. package/src/components/ComponentLoadingWrapper.tsx +5 -6
  113. package/src/components/Grid.tsx +85 -83
  114. package/src/components/GridCell.test.tsx +15 -15
  115. package/src/components/GridCell.tsx +46 -44
  116. package/src/components/GridCellFiller.tsx +5 -4
  117. package/src/components/GridCellMultiEditor.tsx +7 -7
  118. package/src/components/GridCellMultiSelectClassRules.tsx +3 -3
  119. package/src/components/GridIcon.tsx +6 -7
  120. package/src/components/GridLoadableCell.tsx +2 -2
  121. package/src/components/GridNoRowsOverlay.tsx +8 -8
  122. package/src/components/GridPopoverHook.tsx +16 -16
  123. package/src/components/GridWrapper.tsx +2 -2
  124. package/src/components/PostSortRowsHook.ts +11 -11
  125. package/src/components/clickInputWhenContainingCellClicked.tsx +5 -5
  126. package/src/components/gridFilter/GridFilterButtons.tsx +8 -9
  127. package/src/components/gridFilter/GridFilterColumnsToggle.tsx +25 -26
  128. package/src/components/gridFilter/GridFilterDownloadCsvButton.tsx +12 -13
  129. package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +9 -10
  130. package/src/components/gridFilter/GridFilterQuick.tsx +6 -6
  131. package/src/components/gridFilter/GridFilters.tsx +1 -1
  132. package/src/components/gridFilter/index.ts +7 -7
  133. package/src/components/gridFilter/useGridFilter.ts +3 -3
  134. package/src/components/gridForm/GridFormDropDown.tsx +56 -52
  135. package/src/components/gridForm/GridFormEditBearing.tsx +12 -12
  136. package/src/components/gridForm/GridFormMessage.tsx +10 -10
  137. package/src/components/gridForm/GridFormMultiSelect.tsx +53 -51
  138. package/src/components/gridForm/GridFormMultiSelectGrid.tsx +25 -26
  139. package/src/components/gridForm/GridFormPopoverMenu.tsx +32 -29
  140. package/src/components/gridForm/GridFormSubComponentTextArea.tsx +10 -10
  141. package/src/components/gridForm/GridFormSubComponentTextInput.tsx +8 -8
  142. package/src/components/gridForm/GridFormTextArea.tsx +11 -11
  143. package/src/components/gridForm/GridFormTextInput.tsx +11 -11
  144. package/src/components/gridForm/index.ts +10 -10
  145. package/src/components/gridHeader/GridHeaderSelect.tsx +9 -9
  146. package/src/components/gridHeader/index.ts +1 -1
  147. package/src/components/gridHook/index.ts +1 -1
  148. package/src/components/gridHook/useGridContextMenu.tsx +7 -7
  149. package/src/components/gridPopoverEdit/GridButton.tsx +13 -12
  150. package/src/components/gridPopoverEdit/GridEditBoolean.tsx +19 -18
  151. package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +7 -6
  152. package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +7 -6
  153. package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +9 -9
  154. package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +8 -7
  155. package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +6 -6
  156. package/src/components/gridPopoverEdit/GridPopoverMessage.ts +4 -4
  157. package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +4 -4
  158. package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +4 -4
  159. package/src/components/gridPopoverEdit/index.ts +11 -11
  160. package/src/components/gridRender/GridRenderGenericCell.tsx +5 -5
  161. package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -9
  162. package/src/components/gridRender/index.ts +2 -2
  163. package/src/components/gridUtil.ts +3 -3
  164. package/src/components/index.ts +19 -19
  165. package/src/contexts/GridContext.tsx +52 -46
  166. package/src/contexts/GridContextProvider.test.tsx +14 -14
  167. package/src/contexts/GridContextProvider.tsx +42 -41
  168. package/src/contexts/GridPopoverContext.tsx +10 -7
  169. package/src/contexts/GridPopoverContextProvider.tsx +12 -10
  170. package/src/contexts/GridSubComponentContext.ts +6 -5
  171. package/src/contexts/GridUpdatingContext.tsx +5 -4
  172. package/src/contexts/GridUpdatingContextProvider.tsx +3 -3
  173. package/src/index.ts +17 -21
  174. package/src/lui/ActionButton.tsx +42 -41
  175. package/src/lui/FormError.tsx +4 -4
  176. package/src/lui/TextAreaInput.tsx +9 -9
  177. package/src/lui/TextInputFormatted.tsx +11 -11
  178. package/src/lui/reactUtils.test.tsx +8 -8
  179. package/src/lui/reactUtils.tsx +2 -2
  180. package/src/lui/stateDeferredHook.tsx +3 -5
  181. package/src/lui/timeoutHook.test.tsx +5 -5
  182. package/src/lui/timeoutHook.tsx +1 -1
  183. package/src/react-app-env.d.ts +1 -1
  184. package/src/react-menu3/components/ControlledMenu.tsx +48 -48
  185. package/src/react-menu3/components/FocusableItem.tsx +7 -7
  186. package/src/react-menu3/components/Menu.tsx +11 -11
  187. package/src/react-menu3/components/MenuButton.tsx +4 -4
  188. package/src/react-menu3/components/MenuDivider.tsx +4 -4
  189. package/src/react-menu3/components/MenuGroup.tsx +5 -5
  190. package/src/react-menu3/components/MenuHeader.tsx +4 -4
  191. package/src/react-menu3/components/MenuItem.tsx +14 -14
  192. package/src/react-menu3/components/MenuList.tsx +55 -55
  193. package/src/react-menu3/components/MenuRadioGroup.tsx +7 -7
  194. package/src/react-menu3/components/SubMenu.tsx +24 -24
  195. package/src/react-menu3/contexts/EventHandlersContext.ts +2 -2
  196. package/src/react-menu3/contexts/HoverItemContext.ts +1 -1
  197. package/src/react-menu3/contexts/ItemSettingsContext.ts +1 -1
  198. package/src/react-menu3/contexts/MenuListContext.ts +2 -2
  199. package/src/react-menu3/contexts/MenuListItemContext.ts +2 -2
  200. package/src/react-menu3/contexts/RadioGroupContext.ts +2 -2
  201. package/src/react-menu3/contexts/SettingsContext.ts +2 -2
  202. package/src/react-menu3/hooks/index.ts +9 -9
  203. package/src/react-menu3/hooks/useBEM.ts +4 -4
  204. package/src/react-menu3/hooks/useCombinedRef.ts +2 -2
  205. package/src/react-menu3/hooks/useIsomorphicLayoutEffect.ts +4 -4
  206. package/src/react-menu3/hooks/useItemEffect.ts +3 -3
  207. package/src/react-menu3/hooks/useItemState.ts +5 -5
  208. package/src/react-menu3/hooks/useItems.ts +8 -8
  209. package/src/react-menu3/hooks/useMenuChange.ts +3 -3
  210. package/src/react-menu3/hooks/useMenuState.ts +5 -5
  211. package/src/react-menu3/hooks/useMenuStateAndFocus.ts +4 -4
  212. package/src/react-menu3/index.ts +11 -11
  213. package/src/react-menu3/positionUtils/getPositionHelpers.ts +2 -2
  214. package/src/react-menu3/positionUtils/index.ts +3 -3
  215. package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +1 -1
  216. package/src/react-menu3/positionUtils/placeArrowVertical.ts +1 -1
  217. package/src/react-menu3/positionUtils/placeLeftorRight.ts +13 -13
  218. package/src/react-menu3/positionUtils/placeToporBottom.ts +15 -15
  219. package/src/react-menu3/positionUtils/positionContextMenu.ts +4 -4
  220. package/src/react-menu3/positionUtils/positionMenu.ts +14 -14
  221. package/src/react-menu3/style-utils/index.ts +24 -24
  222. package/src/react-menu3/types.ts +15 -15
  223. package/src/react-menu3/utils/constants.ts +33 -33
  224. package/src/react-menu3/utils/index.ts +3 -4
  225. package/src/react-menu3/utils/propTypes2.ts +10 -10
  226. package/src/react-menu3/utils/utils.ts +14 -14
  227. package/src/react-menu3/utils/withHovering.tsx +3 -3
  228. package/src/stories/components/ActionButton.stories.tsx +23 -24
  229. package/src/stories/grid/FormTest.tsx +15 -16
  230. package/src/stories/grid/GridDragRow.stories.tsx +33 -34
  231. package/src/stories/grid/GridFilterButtons.stories.tsx +32 -33
  232. package/src/stories/grid/GridNoRowsOverlay.stories.tsx +9 -10
  233. package/src/stories/grid/GridNonEditableRow.stories.tsx +40 -41
  234. package/src/stories/grid/GridPinnedRow.stories.tsx +25 -26
  235. package/src/stories/grid/GridPopoutContextMenu.stories.tsx +33 -32
  236. package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +21 -22
  237. package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +18 -19
  238. package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +50 -49
  239. package/src/stories/grid/GridPopoverEditBearing.stories.tsx +25 -26
  240. package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +93 -94
  241. package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +62 -63
  242. package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -28
  243. package/src/stories/grid/GridReadOnly.stories.tsx +66 -67
  244. package/src/stories/grid/GridViewList.stories.tsx +37 -38
  245. package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +37 -38
  246. package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +25 -26
  247. package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +25 -26
  248. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +31 -31
  249. package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +47 -48
  250. package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +44 -45
  251. package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +19 -20
  252. package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +21 -22
  253. package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +40 -41
  254. package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +14 -15
  255. package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +14 -15
  256. package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +10 -11
  257. package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +20 -21
  258. package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +16 -17
  259. package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +13 -14
  260. package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +13 -14
  261. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +68 -71
  262. package/src/stories/react-menu/ReactMenu.stories.tsx +26 -26
  263. package/src/utils/bearing.test.ts +44 -44
  264. package/src/utils/bearing.ts +20 -20
  265. package/src/utils/deferredPromise.ts +1 -1
  266. package/src/utils/storybookTestUtil.ts +2 -2
  267. package/src/utils/testQuick.ts +15 -14
  268. package/src/utils/testUtil.ts +31 -36
  269. package/src/utils/textMatcher.test.ts +9 -9
  270. package/src/utils/textMatcher.ts +8 -8
  271. package/src/utils/textValidator.test.ts +56 -56
  272. package/src/utils/textValidator.ts +11 -11
  273. package/src/utils/util.test.ts +20 -20
  274. package/src/utils/util.ts +7 -7
@@ -1,13 +1,12 @@
1
- import { isEmpty } from "lodash-es";
2
- import { ReactElement, useCallback, useContext, useEffect, useMemo, useState } from "react";
1
+ import { LuiCheckboxInput, LuiIcon } from '@linzjs/lui';
2
+ import { ColDef } from 'ag-grid-community';
3
+ import { isEmpty } from 'lodash-es';
4
+ import { ReactElement, useCallback, useContext, useEffect, useMemo, useState } from 'react';
3
5
 
4
- import { LuiCheckboxInput, LuiIcon } from "@linzjs/lui";
5
-
6
- import { GridContext } from "../../contexts/GridContext";
7
- import { Menu, MenuDivider, MenuItem } from "../../react-menu3";
8
- import { ClickEvent } from "../../react-menu3/types";
9
- import { GridFilterHeaderIconButton } from "./GridFilterHeaderIconButton";
10
- import { ColDef } from "ag-grid-community";
6
+ import { GridContext } from '../../contexts/GridContext';
7
+ import { Menu, MenuDivider, MenuItem } from '../../react-menu3';
8
+ import { ClickEvent } from '../../react-menu3/types';
9
+ import { GridFilterHeaderIconButton } from './GridFilterHeaderIconButton';
11
10
 
12
11
  export interface GridFilterColumnsToggleProps {
13
12
  saveState?: boolean;
@@ -21,13 +20,13 @@ export const GridFilterColumnsToggle = ({ saveState = true }: GridFilterColumnsT
21
20
  () =>
22
21
  isEmpty(getColumnIds())
23
22
  ? null // Grid hasn't been initialised yet
24
- : "stepAgGrid_invisibleColumnIds_" + getColumnIds().join("_"),
23
+ : 'stepAgGrid_invisibleColumnIds_' + getColumnIds().join('_'),
25
24
  [getColumnIds],
26
25
  );
27
26
 
28
27
  // infer the invisible ids from colDefs
29
28
  const resetColumns = useCallback(
30
- () => setInvisibleColumnIds(getColumnIds("initialHide")),
29
+ () => setInvisibleColumnIds(getColumnIds('initialHide')),
31
30
  [getColumnIds, setInvisibleColumnIds],
32
31
  );
33
32
 
@@ -40,10 +39,10 @@ export const GridFilterColumnsToggle = ({ saveState = true }: GridFilterColumnsT
40
39
  if (!stored) {
41
40
  resetColumns();
42
41
  } else {
43
- const invisibleIds = JSON.parse(stored ?? "[]");
42
+ const invisibleIds = JSON.parse(stored ?? '[]');
44
43
  if (!Array.isArray(invisibleIds)) {
45
44
  console.error(`stored invisible ids not an array: ${stored}`);
46
- } else if (!invisibleIds.every((id) => typeof id === "string")) {
45
+ } else if (!invisibleIds.every((id) => typeof id === 'string')) {
47
46
  console.error(`stored invisible ids not strings: ${stored}`);
48
47
  } else {
49
48
  invisibleIds && setInvisibleColumnIds(invisibleIds);
@@ -81,30 +80,30 @@ export const GridFilterColumnsToggle = ({ saveState = true }: GridFilterColumnsT
81
80
 
82
81
  return (
83
82
  <Menu
84
- menuButton={<GridFilterHeaderIconButton icon={"ic_columns"} title={"Column visibility"} />}
85
- menuClassName={"step-ag-grid-react-menu"}
83
+ menuButton={<GridFilterHeaderIconButton icon={'ic_columns'} title={'Column visibility'} />}
84
+ menuClassName={'step-ag-grid-react-menu'}
86
85
  portal={true}
87
86
  unmountOnClose={true}
88
87
  >
89
- <div className={"GridFilterColumnsToggle-container"}>
90
- {getColumns("headerName").map((col) => (
88
+ <div className={'GridFilterColumnsToggle-container'}>
89
+ {getColumns('headerName').map((col) => (
91
90
  <MenuItem
92
- key={col.colId ?? "no_col_id"}
91
+ key={col.colId ?? 'no_col_id'}
93
92
  disabled={isNonManageableColumn(col)}
94
93
  onClick={(e: ClickEvent) => {
95
94
  // Global react-menu MenuItem handler handles tabs
96
- if (e.key !== "Tab") {
95
+ if (e.key !== 'Tab') {
97
96
  e.keepOpen = true;
98
- if (e.key !== "Enter") {
97
+ if (e.key !== 'Enter') {
99
98
  toggleColumn(col.colId);
100
99
  }
101
100
  }
102
101
  }}
103
102
  >
104
103
  <LuiCheckboxInput
105
- isChecked={!!invisibleColumnIds && !invisibleColumnIds.includes(col.colId ?? "")}
104
+ isChecked={!!invisibleColumnIds && !invisibleColumnIds.includes(col.colId ?? '')}
106
105
  value={`${col.colId}`}
107
- label={col.headerName ?? ""}
106
+ label={col.headerName ?? ''}
108
107
  isDisabled={isNonManageableColumn(col)}
109
108
  inputProps={{
110
109
  onClick: (e) => {
@@ -122,16 +121,16 @@ export const GridFilterColumnsToggle = ({ saveState = true }: GridFilterColumnsT
122
121
  </div>
123
122
  <MenuDivider key={`$$divider_reset_columns`} />
124
123
  <MenuItem
125
- key={"$$reset_columns"}
124
+ key={'$$reset_columns'}
126
125
  onClick={(e: ClickEvent) => {
127
126
  // Global react-menu MenuItem handler handles tabs
128
- if (e.key !== "Tab") {
129
- e.keepOpen = e.key !== "Enter";
127
+ if (e.key !== 'Tab') {
128
+ e.keepOpen = e.key !== 'Enter';
130
129
  resetColumns();
131
130
  }
132
131
  }}
133
132
  >
134
- <LuiIcon name={"ic_regenerate"} alt={"Reset columns"} size={"md"} className={"MenuItem-icon"} />
133
+ <LuiIcon name={'ic_regenerate'} alt={'Reset columns'} size={'md'} className={'MenuItem-icon'} />
135
134
  Reset columns
136
135
  </MenuItem>
137
136
  </Menu>
@@ -1,12 +1,11 @@
1
- import { CsvExportParams } from "ag-grid-community";
2
- import { delay } from "lodash-es";
3
- import { useContext } from "react";
1
+ import { LuiMiniSpinner } from '@linzjs/lui';
2
+ import { CsvExportParams } from 'ag-grid-community';
3
+ import { delay } from 'lodash-es';
4
+ import { useContext } from 'react';
4
5
 
5
- import { LuiMiniSpinner } from "@linzjs/lui";
6
-
7
- import { GridContext } from "../../contexts/GridContext";
8
- import { useStateDeferred } from "../../lui/stateDeferredHook";
9
- import { GridFilterHeaderIconButton } from "./GridFilterHeaderIconButton";
6
+ import { GridContext } from '../../contexts/GridContext';
7
+ import { useStateDeferred } from '../../lui/stateDeferredHook';
8
+ import { GridFilterHeaderIconButton } from './GridFilterHeaderIconButton';
10
9
 
11
10
  export const GridFilterDownloadCsvButton = (csvExportParams: CsvExportParams) => {
12
11
  const { downloadCsv } = useContext(GridContext);
@@ -27,15 +26,15 @@ export const GridFilterDownloadCsvButton = (csvExportParams: CsvExportParams) =>
27
26
  <LuiMiniSpinner
28
27
  size={22}
29
28
  divProps={{
30
- role: "status",
31
- ["aria-label"]: "Downloading...",
32
- style: { width: 42, display: "flex", justifyContent: "center" },
29
+ role: 'status',
30
+ ['aria-label']: 'Downloading...',
31
+ style: { width: 42, display: 'flex', justifyContent: 'center' },
33
32
  }}
34
33
  />
35
34
  ) : (
36
35
  <GridFilterHeaderIconButton
37
- icon={"ic_csv_file"}
38
- title={"Download CSV"}
36
+ icon={'ic_csv_file'}
37
+ title={'Download CSV'}
39
38
  onClick={handleDownloadClick}
40
39
  disabled={downloading}
41
40
  />
@@ -1,7 +1,6 @@
1
- import { ButtonHTMLAttributes, MouseEvent, forwardRef } from "react";
2
-
3
- import { LuiButton, LuiIcon } from "@linzjs/lui";
4
- import { IconName, IconSize } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
1
+ import { LuiButton, LuiIcon } from '@linzjs/lui';
2
+ import { IconName, IconSize } from '@linzjs/lui/dist/components/LuiIcon/LuiIcon';
3
+ import { ButtonHTMLAttributes, forwardRef, MouseEvent } from 'react';
5
4
 
6
5
  export interface GridFilterHeaderIconButtonProps {
7
6
  icon: IconName;
@@ -13,20 +12,20 @@ export interface GridFilterHeaderIconButtonProps {
13
12
  }
14
13
 
15
14
  export const GridFilterHeaderIconButton = forwardRef<HTMLButtonElement, GridFilterHeaderIconButtonProps>(
16
- function columnsButton({ icon, title, onClick, buttonProps, disabled = false, size = "md" }, ref) {
15
+ function columnsButton({ icon, title, onClick, buttonProps, disabled = false, size = 'md' }, ref) {
17
16
  return (
18
17
  <LuiButton
19
18
  {...buttonProps}
20
- type={"button"}
21
- level={"tertiary"}
22
- className={"lui-button-icon-only"}
19
+ type={'button'}
20
+ level={'tertiary'}
21
+ className={'lui-button-icon-only'}
23
22
  ref={ref}
24
- buttonProps={{ "aria-label": title }}
23
+ buttonProps={{ 'aria-label': title }}
25
24
  title={title}
26
25
  onClick={onClick}
27
26
  disabled={disabled}
28
27
  >
29
- <LuiIcon name={icon} alt={"Menu"} size={size} />
28
+ <LuiIcon name={icon} alt={'Menu'} size={size} />
30
29
  </LuiButton>
31
30
  );
32
31
  },
@@ -1,7 +1,7 @@
1
- import { LuiIcon } from "@linzjs/lui";
2
- import { useContext, useEffect, useState } from "react";
1
+ import { LuiIcon } from '@linzjs/lui';
2
+ import { useContext, useEffect, useState } from 'react';
3
3
 
4
- import { GridContext } from "../../contexts/GridContext";
4
+ import { GridContext } from '../../contexts/GridContext';
5
5
 
6
6
  export interface GridFilterQuickProps {
7
7
  quickFilterPlaceholder?: string;
@@ -10,7 +10,7 @@ export interface GridFilterQuickProps {
10
10
 
11
11
  export const GridFilterQuick = ({ quickFilterPlaceholder, defaultValue }: GridFilterQuickProps) => {
12
12
  const { setQuickFilter } = useContext(GridContext);
13
- const [quickFilterValue, setQuickFilterValue] = useState(defaultValue ?? "");
13
+ const [quickFilterValue, setQuickFilterValue] = useState(defaultValue ?? '');
14
14
 
15
15
  useEffect(() => {
16
16
  setQuickFilter(quickFilterValue);
@@ -19,13 +19,13 @@ export const GridFilterQuick = ({ quickFilterPlaceholder, defaultValue }: GridFi
19
19
  return (
20
20
  <div className="GridFilterQuick-container">
21
21
  <div className="GridFilterQuick-icon">
22
- <LuiIcon name={"ic_search"} alt={"Search"} size={"md"} />
22
+ <LuiIcon name={'ic_search'} alt={'Search'} size={'md'} />
23
23
  </div>
24
24
  <input
25
25
  aria-label="Search"
26
26
  className="GridFilterQuick-input"
27
27
  type="text"
28
- placeholder={quickFilterPlaceholder ?? "Search"}
28
+ placeholder={quickFilterPlaceholder ?? 'Search'}
29
29
  value={quickFilterValue}
30
30
  onChange={(event) => {
31
31
  setQuickFilterValue(event.target.value);
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from "react";
1
+ import { PropsWithChildren } from 'react';
2
2
 
3
3
  export const GridFilters = ({ children }: PropsWithChildren) => (
4
4
  <div className="Grid-container-filters">{children}</div>
@@ -1,7 +1,7 @@
1
- export * from "./GridFilterHeaderIconButton";
2
- export * from "./GridFilterColumnsToggle";
3
- export * from "./GridFilterButtons";
4
- export * from "./GridFilterQuick";
5
- export * from "./GridFilters";
6
- export * from "./GridFilterDownloadCsvButton";
7
- export * from "./useGridFilter";
1
+ export * from './GridFilterButtons';
2
+ export * from './GridFilterColumnsToggle';
3
+ export * from './GridFilterDownloadCsvButton';
4
+ export * from './GridFilterHeaderIconButton';
5
+ export * from './GridFilterQuick';
6
+ export * from './GridFilters';
7
+ export * from './useGridFilter';
@@ -1,7 +1,7 @@
1
- import { useContext, useEffect } from "react";
1
+ import { useContext, useEffect } from 'react';
2
2
 
3
- import { GridContext, GridFilterExternal } from "../../contexts/GridContext";
4
- import { GridBaseRow } from "../Grid";
3
+ import { GridContext, GridFilterExternal } from '../../contexts/GridContext';
4
+ import { GridBaseRow } from '../Grid';
5
5
 
6
6
  export const useGridFilter = <TData extends GridBaseRow>(filter: GridFilterExternal<TData> | undefined) => {
7
7
  const { addExternalFilter, removeExternalFilter } = useContext(GridContext);
@@ -1,23 +1,23 @@
1
- import debounce from "debounce-promise";
2
- import { isEmpty } from "lodash-es";
3
- import { Fragment, ReactElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
1
+ import debounce from 'debounce-promise';
2
+ import { isEmpty } from 'lodash-es';
3
+ import { Fragment, ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
4
 
5
- import { useGridPopoverContext } from "../../contexts/GridPopoverContext";
6
- import { GridSubComponentContext } from "../../contexts/GridSubComponentContext";
7
- import { FormError } from "../../lui/FormError";
8
- import { FocusableItem, MenuDivider, MenuHeader, MenuItem } from "../../react-menu3";
9
- import { ClickEvent } from "../../react-menu3/types";
10
- import { textMatch } from "../../utils/textMatcher";
11
- import { isNotEmpty } from "../../utils/util";
12
- import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
13
- import { GridBaseRow } from "../Grid";
14
- import { CellEditorCommon } from "../GridCell";
15
- import { useGridPopoverHook } from "../GridPopoverHook";
5
+ import { useGridPopoverContext } from '../../contexts/GridPopoverContext';
6
+ import { GridSubComponentContext } from '../../contexts/GridSubComponentContext';
7
+ import { FormError } from '../../lui/FormError';
8
+ import { FocusableItem, MenuDivider, MenuHeader, MenuItem } from '../../react-menu3';
9
+ import { ClickEvent } from '../../react-menu3/types';
10
+ import { textMatch } from '../../utils/textMatcher';
11
+ import { isNotEmpty } from '../../utils/util';
12
+ import { ComponentLoadingWrapper } from '../ComponentLoadingWrapper';
13
+ import { GridBaseRow } from '../Grid';
14
+ import { CellEditorCommon } from '../GridCell';
15
+ import { useGridPopoverHook } from '../GridPopoverHook';
16
16
 
17
17
  export interface GridPopoutEditDropDownSelectedItem<TData extends GridBaseRow, TValue> {
18
18
  // Note the row that was clicked on will be first
19
19
  selectedRows: TData[];
20
- selectedRowIds: TData["id"][];
20
+ selectedRowIds: TData['id'][];
21
21
  value: TValue;
22
22
  subComponentValue?: any;
23
23
  }
@@ -29,10 +29,10 @@ interface FinalSelectOption {
29
29
  subComponent?: (props: any, ref: any) => any;
30
30
  }
31
31
 
32
- export const MenuSeparatorString = "_____MENU_SEPARATOR_____";
32
+ export const MenuSeparatorString = '_____MENU_SEPARATOR_____';
33
33
  export const MenuSeparator = Object.freeze({ value: MenuSeparatorString });
34
34
 
35
- export const MenuHeaderString = "_____MENU_HEADER_____";
35
+ export const MenuHeaderString = '_____MENU_HEADER_____';
36
36
  export const MenuHeaderItem = (title: string) => {
37
37
  return { label: title, value: MenuHeaderString };
38
38
  };
@@ -41,22 +41,26 @@ export type SelectOption = null | string | FinalSelectOption;
41
41
 
42
42
  export interface GridFormDropDownProps<TData extends GridBaseRow, TValue> extends CellEditorCommon {
43
43
  // This overrides CellEditorCommon to provide some common class options
44
- className?:
45
- | "GridPopoverEditDropDown-containerSmall"
46
- | "GridPopoverEditDropDown-containerMedium"
47
- | "GridPopoverEditDropDown-containerLarge"
48
- | "GridPopoverEditDropDown-containerUnlimited"
49
- | "GridPopoverEditDropDown-containerAutoWidth"
44
+ className?: // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
45
+ | 'GridPopoverEditDropDown-containerSmall'
46
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
47
+ | 'GridPopoverEditDropDown-containerMedium'
48
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
49
+ | 'GridPopoverEditDropDown-containerLarge'
50
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
51
+ | 'GridPopoverEditDropDown-containerUnlimited'
52
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
53
+ | 'GridPopoverEditDropDown-containerAutoWidth'
50
54
  | string
51
55
  | undefined;
52
56
  // local means the use the local filter, otherwise it's expected options will be passed a function that takes a filter
53
- filtered?: "local" | "reload";
57
+ filtered?: 'local' | 'reload';
54
58
  filterDefaultValue?: string;
55
59
  filterPlaceholder?: string;
56
60
  filterHelpText?: string;
57
61
  noOptionsMessage?: string;
58
- onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
59
- onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void>;
62
+ onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void> | void;
63
+ onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData, TValue>) => Promise<void> | void;
60
64
  options:
61
65
  | SelectOption[]
62
66
  | ((selectedRows: TData[], filter?: string) => Promise<SelectOption[] | undefined> | SelectOption[] | undefined)
@@ -64,14 +68,14 @@ export interface GridFormDropDownProps<TData extends GridBaseRow, TValue> extend
64
68
  }
65
69
 
66
70
  const fieldToString = (field: any) => {
67
- return typeof field == "symbol" ? field.toString() : `${field}`;
71
+ return typeof field === 'symbol' ? field.toString() : `${field}`;
68
72
  };
69
73
 
70
74
  export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridFormDropDownProps<TData, TValue>) => {
71
75
  const { selectedRows, field, data } = useGridPopoverContext<TData>();
72
76
 
73
77
  // Save triggers during async action processing which triggers another selectItem(), this ref blocks that
74
- const [filter, setFilter] = useState(props.filterDefaultValue ?? "");
78
+ const [filter, setFilter] = useState(props.filterDefaultValue ?? '');
75
79
  const [filteredValues, setFilteredValues] = useState<any[]>();
76
80
  const [options, setOptions] = useState<FinalSelectOption[] | null>(null);
77
81
  const subComponentIsValid = useRef(false);
@@ -83,7 +87,7 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
83
87
  const selectItemHandler = useCallback(
84
88
  async (value: any, subComponentValue?: any): Promise<boolean> => {
85
89
  const hasChanged =
86
- selectedRows.some((row) => row[field as keyof TData] !== value) ||
90
+ selectedRows.some((row) => row[field] !== value) ||
87
91
  (subComponentValue !== undefined && subComponentInitialValue.current !== JSON.stringify(subComponentValue));
88
92
  if (hasChanged) {
89
93
  if (props.onSelectedItem) {
@@ -94,7 +98,7 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
94
98
  subComponentValue,
95
99
  });
96
100
  } else {
97
- selectedRows.forEach((row) => (row[field] = value as any));
101
+ selectedRows.forEach((row) => (row[field] = value));
98
102
  }
99
103
  }
100
104
  return true;
@@ -107,13 +111,13 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
107
111
  if (options) return;
108
112
  let optionsConf = props.options;
109
113
 
110
- (async () => {
111
- if (typeof optionsConf == "function") {
114
+ void (async () => {
115
+ if (typeof optionsConf === 'function') {
112
116
  optionsConf = await optionsConf(selectedRows, filter);
113
117
  }
114
118
  if (optionsConf !== undefined) {
115
119
  const optionsList = optionsConf?.map((item) =>
116
- item == null || typeof item == "string"
120
+ item == null || typeof item === 'string'
117
121
  ? ({
118
122
  value: item,
119
123
  label: item,
@@ -129,16 +133,16 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
129
133
 
130
134
  // Local filtering.
131
135
  useEffect(() => {
132
- if (props.filtered == "local") {
136
+ if (props.filtered == 'local') {
133
137
  if (options == null) return;
134
138
  setFilteredValues(
135
139
  options
136
140
  .map((option) => {
137
- if (option.label != null && typeof option.label !== "string") {
138
- console.error("Cannot filter non-string labels", option);
141
+ if (option.label != null && typeof option.label !== 'string') {
142
+ console.error('Cannot filter non-string labels', option);
139
143
  return undefined;
140
144
  }
141
- return textMatch((option.label as string) || "", filter) ? option : undefined;
145
+ return textMatch((option.label as string) || '', filter) ? option : undefined;
142
146
  })
143
147
  .filter((r) => r !== undefined),
144
148
  );
@@ -157,9 +161,9 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
157
161
 
158
162
  // Reload filtering.
159
163
  useEffect(() => {
160
- if (previousFilter.current != filter && props.filtered == "reload") {
164
+ if (previousFilter.current != filter && props.filtered == 'reload') {
161
165
  previousFilter.current = filter;
162
- reSearchOnFilterChange().then();
166
+ void reSearchOnFilterChange();
163
167
  }
164
168
  }, [filter, props, reSearchOnFilterChange]);
165
169
 
@@ -202,9 +206,9 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
202
206
  return popoverWrapper(
203
207
  <>
204
208
  {props.filtered && (
205
- <div className={"GridFormDropDown-filter"}>
209
+ <div className={'GridFormDropDown-filter'}>
206
210
  <FocusableItem
207
- className={"filter-item"}
211
+ className={'filter-item'}
208
212
  onFocus={() => {
209
213
  setSelectedItem(null);
210
214
  setSubSelectedValue(null);
@@ -212,13 +216,13 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
212
216
  }}
213
217
  >
214
218
  {({ ref }: any) => (
215
- <div style={{ display: "flex", flexDirection: "column", width: "100%" }}>
219
+ <div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
216
220
  <input
217
- className={"LuiTextInput-input"}
221
+ className={'LuiTextInput-input'}
218
222
  ref={ref}
219
223
  type="text"
220
- placeholder={props.filterPlaceholder ?? "Filter..."}
221
- data-testid={"filteredMenu-free-text-input"}
224
+ placeholder={props.filterPlaceholder ?? 'Filter...'}
225
+ data-testid={'filteredMenu-free-text-input'}
222
226
  defaultValue={filter}
223
227
  data-allowtabtosave={true}
224
228
  data-disableenterautosave={
@@ -236,15 +240,15 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
236
240
  <MenuDivider key={`$$divider_filter`} />
237
241
  </div>
238
242
  )}
239
- <ComponentLoadingWrapper loading={!options} className={"GridFormDropDown-options"}>
243
+ <ComponentLoadingWrapper loading={!options} className={'GridFormDropDown-options'}>
240
244
  <>
241
245
  {options && (isEmpty(options) || (filteredValues && isEmpty(filteredValues))) && (
242
246
  <MenuItem
243
247
  key={`${fieldToString(field)}-empty`}
244
- className={"GridPopoverEditDropDown-noOptions"}
248
+ className={'GridPopoverEditDropDown-noOptions'}
245
249
  disabled={true}
246
250
  >
247
- {props.noOptionsMessage ?? "No Options"}
251
+ {props.noOptionsMessage ?? 'No Options'}
248
252
  </MenuItem>
249
253
  )}
250
254
  {options?.map((item: FinalSelectOption, index) => {
@@ -268,7 +272,7 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
268
272
  <MenuItem
269
273
  key={`${fieldToString(field)}-${index}`}
270
274
  disabled={!!item.disabled}
271
- title={item.disabled && typeof item.disabled !== "boolean" ? item.disabled : ""}
275
+ title={item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : ''}
272
276
  value={item.value}
273
277
  onFocus={() => {
274
278
  if (selectedItem !== item) {
@@ -285,11 +289,11 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
285
289
  }}
286
290
  >
287
291
  {item.label ?? (item.value == null ? `<${item.value}>` : `${item.value}`)}
288
- {item.subComponent ? "..." : ""}
292
+ {item.subComponent ? '...' : ''}
289
293
  </MenuItem>
290
294
 
291
295
  {item.subComponent && selectedItem === item && (
292
- <FocusableItem className={"LuiDeprecatedForms"} key={`${item.label}_subcomponent`}>
296
+ <FocusableItem className={'LuiDeprecatedForms'} key={`${String(item.label)}_subcomponent`}>
293
297
  {() => (
294
298
  <GridSubComponentContext.Provider
295
299
  value={{
@@ -312,7 +316,7 @@ export const GridFormDropDown = <TData extends GridBaseRow, TValue>(props: GridF
312
316
  }}
313
317
  >
314
318
  {item.subComponent && (
315
- <div className={"subComponent"}>
319
+ <div className={'subComponent'}>
316
320
  <item.subComponent />
317
321
  </div>
318
322
  )}
@@ -1,11 +1,11 @@
1
- import { useCallback, useMemo, useState } from "react";
1
+ import { useCallback, useMemo, useState } from 'react';
2
2
 
3
- import { useGridPopoverContext } from "../../contexts/GridPopoverContext";
4
- import { TextInputFormatted } from "../../lui/TextInputFormatted";
5
- import { bearingNumberParser, bearingStringValidator } from "../../utils/bearing";
6
- import { GridBaseRow } from "../Grid";
7
- import { CellEditorCommon } from "../GridCell";
8
- import { useGridPopoverHook } from "../GridPopoverHook";
3
+ import { useGridPopoverContext } from '../../contexts/GridPopoverContext';
4
+ import { TextInputFormatted } from '../../lui/TextInputFormatted';
5
+ import { bearingNumberParser, bearingStringValidator } from '../../utils/bearing';
6
+ import { GridBaseRow } from '../Grid';
7
+ import { CellEditorCommon } from '../GridCell';
8
+ import { useGridPopoverHook } from '../GridPopoverHook';
9
9
 
10
10
  export interface GridFormEditBearingProps<TData extends GridBaseRow> extends CellEditorCommon {
11
11
  formatValue?: (value: any) => string;
@@ -19,7 +19,7 @@ export const GridFormEditBearing = <TData extends GridBaseRow>(props: GridFormEd
19
19
 
20
20
  // This clears out any scientific precision
21
21
  const defaultValue = useMemo(
22
- () => (initialValue == null ? "" : parseFloat(parseFloat(initialValue).toFixed(10)).toString()),
22
+ () => (initialValue == null ? '' : parseFloat(parseFloat(initialValue).toFixed(10)).toString()),
23
23
  [initialValue],
24
24
  );
25
25
 
@@ -39,7 +39,7 @@ export const GridFormEditBearing = <TData extends GridBaseRow>(props: GridFormEd
39
39
  return await props.onSave({ selectedRows, value: parsedValue });
40
40
  } else {
41
41
  if (field == null) {
42
- console.error("field is not defined in ColDef");
42
+ console.error('field is not defined in ColDef');
43
43
  } else {
44
44
  selectedRows.forEach((row) => {
45
45
  row[field] = parsedValue as any;
@@ -57,7 +57,7 @@ export const GridFormEditBearing = <TData extends GridBaseRow>(props: GridFormEd
57
57
  });
58
58
 
59
59
  return popoverWrapper(
60
- <div className={"GridFormEditBearing-input"}>
60
+ <div className={'GridFormEditBearing-input'}>
61
61
  <TextInputFormatted
62
62
  value={defaultValue}
63
63
  onChange={(e) => {
@@ -67,11 +67,11 @@ export const GridFormEditBearing = <TData extends GridBaseRow>(props: GridFormEd
67
67
  placeholder={props.placeHolder}
68
68
  formatted={
69
69
  bearingStringValidator(value, props.range) || !props.formatValue
70
- ? "?"
70
+ ? '?'
71
71
  : props.formatValue(bearingNumberParser(value))
72
72
  }
73
73
  error={bearingStringValidator(value, props.range)}
74
- helpText={"Press enter or tab to save"}
74
+ helpText={'Press enter or tab to save'}
75
75
  />
76
76
  </div>,
77
77
  );
@@ -1,11 +1,11 @@
1
- import clsx from "clsx";
2
- import { ReactElement, useEffect, useState } from "react";
1
+ import clsx from 'clsx';
2
+ import { ReactElement, useEffect, useState } from 'react';
3
3
 
4
- import { useGridPopoverContext } from "../../contexts/GridPopoverContext";
5
- import { ComponentLoadingWrapper } from "../ComponentLoadingWrapper";
6
- import { GridBaseRow } from "../Grid";
7
- import { CellEditorCommon } from "../GridCell";
8
- import { useGridPopoverHook } from "../GridPopoverHook";
4
+ import { useGridPopoverContext } from '../../contexts/GridPopoverContext';
5
+ import { ComponentLoadingWrapper } from '../ComponentLoadingWrapper';
6
+ import { GridBaseRow } from '../Grid';
7
+ import { CellEditorCommon } from '../GridCell';
8
+ import { useGridPopoverHook } from '../GridPopoverHook';
9
9
 
10
10
  export interface GridFormMessageProps<TData extends GridBaseRow> extends CellEditorCommon {
11
11
  message: (selectedRows: TData[]) => Promise<string | ReactElement> | string | ReactElement;
@@ -18,13 +18,13 @@ export const GridFormMessage = <TData extends GridBaseRow>(props: GridFormMessag
18
18
  const { popoverWrapper } = useGridPopoverHook({ className: props.className });
19
19
 
20
20
  useEffect(() => {
21
- (async () => {
21
+ void (async () => {
22
22
  setMessage(await props.message(selectedRows));
23
- })().then();
23
+ })();
24
24
  }, [props, selectedRows]);
25
25
 
26
26
  return popoverWrapper(
27
- <ComponentLoadingWrapper loading={message === null} className={clsx("GridFormMessage-container", props.className)}>
27
+ <ComponentLoadingWrapper loading={message === null} className={clsx('GridFormMessage-container', props.className)}>
28
28
  <>{message}</>
29
29
  </ComponentLoadingWrapper>,
30
30
  );