@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,14 +1,13 @@
1
- import "../../../styles/GridTheme.scss";
2
- import "../../../styles/index.scss";
3
- import "@linzjs/lui/dist/scss/base.scss";
1
+ import '../../../styles/GridTheme.scss';
2
+ import '../../../styles/index.scss';
3
+ import '@linzjs/lui/dist/scss/base.scss';
4
+ import '@linzjs/lui/dist/fonts';
4
5
 
5
- import { Meta, StoryFn } from "@storybook/react";
6
- import { expect } from "@storybook/test";
7
- import { fn } from "@storybook/test";
8
- import { userEvent, waitFor } from "@storybook/test";
9
- import { useMemo, useState } from "react";
10
-
11
- import "@linzjs/lui/dist/fonts";
6
+ import { Meta, StoryFn } from '@storybook/react';
7
+ import { expect } from '@storybook/test';
8
+ import { fn } from '@storybook/test';
9
+ import { userEvent, waitFor } from '@storybook/test';
10
+ import { useMemo, useState } from 'react';
12
11
 
13
12
  import {
14
13
  ColDefT,
@@ -24,24 +23,24 @@ import {
24
23
  GridUpdatingContextProvider,
25
24
  MenuOption,
26
25
  wait,
27
- } from "../../../";
28
- import { waitForGridReady } from "../../../utils/storybookTestUtil";
26
+ } from '../../../';
27
+ import { waitForGridReady } from '../../../utils/storybookTestUtil';
29
28
 
30
29
  export default {
31
- title: "Components / Grids",
30
+ title: 'Components / Grids',
32
31
  component: Grid,
33
32
  args: {
34
33
  quickFilter: true,
35
- quickFilterValue: "",
36
- quickFilterPlaceholder: "Quick filter...",
34
+ quickFilterValue: '',
35
+ quickFilterPlaceholder: 'Quick filter...',
37
36
  selectable: false,
38
- rowSelection: "single",
37
+ rowSelection: 'single',
39
38
  },
40
39
  // Storybook hangs otherwise
41
40
  parameters: {
42
41
  docs: {
43
42
  source: {
44
- type: "code",
43
+ type: 'code',
45
44
  },
46
45
  },
47
46
  },
@@ -79,28 +78,28 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
79
78
  const columnDefs: ColDefT<ITestRow>[] = useMemo(
80
79
  () => [
81
80
  GridCell({
82
- field: "id",
83
- headerName: "Id",
81
+ field: 'id',
82
+ headerName: 'Id',
84
83
  }),
85
- GridCell<ITestRow, ITestRow["position"]>({
86
- field: "position",
87
- headerName: "Position",
84
+ GridCell<ITestRow, ITestRow['position']>({
85
+ field: 'position',
86
+ headerName: 'Position',
88
87
  cellRendererParams: {
89
- warning: ({ value }) => value === "Tester" && "Testers are testing",
90
- info: ({ value }) => value === "Developer" && "Developers are awesome",
88
+ warning: ({ value }) => value === 'Tester' && 'Testers are testing',
89
+ info: ({ value }) => value === 'Developer' && 'Developers are awesome',
91
90
  },
92
91
  }),
93
92
  GridCell({
94
- field: "age",
95
- headerName: "Age",
93
+ field: 'age',
94
+ headerName: 'Age',
96
95
  }),
97
96
  GridCell({
98
- field: "desc",
99
- headerName: "Description",
97
+ field: 'desc',
98
+ headerName: 'Description',
100
99
  }),
101
100
  GridPopoverMessage(
102
101
  {
103
- headerName: "Popout message",
102
+ headerName: 'Popout message',
104
103
  maxWidth: 150,
105
104
  cellRenderer: () => <>Single Click me!</>,
106
105
  },
@@ -115,13 +114,13 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
115
114
  },
116
115
  ),
117
116
  GridCell({
118
- headerName: "Custom edit",
117
+ headerName: 'Custom edit',
119
118
  maxWidth: 100,
120
119
  editable: true,
121
- valueFormatter: () => "Press E",
120
+ valueFormatter: () => 'Press E',
122
121
  cellRendererParams: {
123
122
  rightHoverElement: (
124
- <GridIcon icon={"ic_launch_modal"} title={"Title text"} className={"GridCell-editableIcon"} />
123
+ <GridIcon icon={'ic_launch_modal'} title={'Title text'} className={'GridCell-editableIcon'} />
125
124
  ),
126
125
  editAction: () => {
127
126
  //
@@ -136,51 +135,51 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
136
135
  {
137
136
  multiEdit: true,
138
137
  editorParams: {
139
- defaultAction: async ({ menuOption }) => {
138
+ defaultAction: ({ menuOption }) => {
140
139
  // eslint-disable-next-line no-console
141
- console.log("clicked", { menuOption });
140
+ console.log('clicked', { menuOption });
142
141
  },
143
142
  options: async (selectedItems) => {
144
143
  // Just doing a timeout here to demonstrate deferred loading
145
144
  await wait(500);
146
145
  return [
147
146
  {
148
- label: "Single edit only",
147
+ label: 'Single edit only',
149
148
  action: async () => {
150
149
  //
151
150
  },
152
151
  disabled: selectedItems.length > 1,
153
152
  },
154
153
  {
155
- label: "Multi-edit",
154
+ label: 'Multi-edit',
156
155
  action: multiEditAction,
157
156
  },
158
157
  {
159
- label: "Disabled item",
160
- disabled: "Disabled for test",
158
+ label: 'Disabled item',
159
+ disabled: 'Disabled for test',
161
160
  },
162
161
  {
163
- label: "Developer Only",
164
- hidden: selectedItems.some((x) => x.position != "Developer"),
162
+ label: 'Developer Only',
163
+ hidden: selectedItems.some((x) => x.position != 'Developer'),
165
164
  },
166
165
  {
167
- label: "Other (TextInput)",
166
+ label: 'Other (TextInput)',
168
167
  action: async () => {
169
168
  //
170
169
  },
171
170
  subComponent: () => (
172
- <GridFormSubComponentTextInput placeholder={"Other"} maxLength={5} required defaultValue={""} />
171
+ <GridFormSubComponentTextInput placeholder={'Other'} maxLength={5} required defaultValue={''} />
173
172
  ),
174
173
  },
175
174
  {
176
- label: "Other (TextArea)",
175
+ label: 'Other (TextArea)',
177
176
  action: async ({ menuOption }) => {
178
177
  // eslint-disable-next-line no-console
179
178
  console.log(`Sub selected value was ${JSON.stringify(menuOption.subValue)}`);
180
179
  await wait(500);
181
180
  },
182
181
  subComponent: () => (
183
- <GridFormSubComponentTextArea placeholder={"Other"} maxLength={5} required defaultValue={""} />
182
+ <GridFormSubComponentTextArea placeholder={'Other'} maxLength={5} required defaultValue={''} />
184
183
  ),
185
184
  },
186
185
  ] as MenuOption<ITestRow>[];
@@ -194,9 +193,7 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
194
193
  },
195
194
  {
196
195
  editorParams: {
197
- options: async () => {
198
- return [];
199
- },
196
+ options: () => [],
200
197
  },
201
198
  },
202
199
  ),
@@ -205,9 +202,9 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
205
202
  );
206
203
 
207
204
  const [rowData] = useState([
208
- { id: 1000, position: "Tester", age: 30, desc: "Tests application", dd: "1" },
209
- { id: 1001, position: "Developer", age: 12, desc: "Develops application", dd: "2" },
210
- { id: 1002, position: "Manager", age: 65, desc: "Manages", dd: "3" },
205
+ { id: 1000, position: 'Tester', age: 30, desc: 'Tests application', dd: '1' },
206
+ { id: 1001, position: 'Developer', age: 12, desc: 'Develops application', dd: '2' },
207
+ { id: 1002, position: 'Manager', age: 65, desc: 'Manages', dd: '3' },
211
208
  ]);
212
209
 
213
210
  return (
@@ -218,7 +215,7 @@ const GridKeyboardInteractionsTemplate: StoryFn<typeof Grid> = (props: GridProps
218
215
  setExternalSelectedItems={setExternalSelectedItems}
219
216
  columnDefs={columnDefs}
220
217
  rowData={rowData}
221
- domLayout={"autoHeight"}
218
+ domLayout={'autoHeight'}
222
219
  autoSelectFirstRow={true}
223
220
  />
224
221
  );
@@ -232,47 +229,47 @@ GridKeyboardInteractions.play = async ({ canvasElement }) => {
232
229
  await waitForGridReady({ canvasElement });
233
230
 
234
231
  // Ensure first row/cell is selected on render
235
- await waitFor(async () => {
232
+ await waitFor(() => {
236
233
  const activeCell = canvasElement.ownerDocument.activeElement;
237
- expect(activeCell).toHaveClass("ag-cell-focus");
238
- expect(activeCell).toHaveAttribute("aria-colindex", "1");
239
- expect(activeCell?.parentElement).toHaveAttribute("row-index", "0");
234
+ expect(activeCell).toHaveClass('ag-cell-focus');
235
+ expect(activeCell).toHaveAttribute('aria-colindex', '1');
236
+ expect(activeCell?.parentElement).toHaveAttribute('row-index', '0');
240
237
  });
241
- await userEvent.keyboard("{arrowdown}{arrowdown}");
242
- await userEvent.keyboard("{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}");
238
+ await userEvent.keyboard('{arrowdown}{arrowdown}');
239
+ await userEvent.keyboard('{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}{arrowright}');
243
240
 
244
241
  // Test enter post focus
245
242
  const test = async (fn: () => any, colId: string, rowId: string) => {
246
- await userEvent.keyboard("{Enter}");
243
+ await userEvent.keyboard('{Enter}');
247
244
  await wait(1000);
248
- await userEvent.keyboard("{arrowdown}{arrowdown}");
245
+ await userEvent.keyboard('{arrowdown}{arrowdown}');
249
246
  fn();
250
- await waitFor(async () => {
247
+ await waitFor(() => {
251
248
  expect(multiEditAction).toHaveBeenCalled();
252
249
  });
253
250
 
254
- await waitFor(async () => {
251
+ await waitFor(() => {
255
252
  const activeCell = canvasElement.ownerDocument.activeElement;
256
- expect(activeCell).toHaveClass("ag-cell-focus");
257
- expect(activeCell).toHaveAttribute("aria-colindex", colId);
258
- expect(activeCell?.parentElement).toHaveAttribute("row-index", rowId);
253
+ expect(activeCell).toHaveClass('ag-cell-focus');
254
+ expect(activeCell).toHaveAttribute('aria-colindex', colId);
255
+ expect(activeCell?.parentElement).toHaveAttribute('row-index', rowId);
259
256
  });
260
257
  await wait(1000);
261
258
  };
262
259
 
263
- await test(() => userEvent.keyboard("{Enter}"), "8", "2");
264
- await test(() => userEvent.tab(), "9", "2");
260
+ await test(() => userEvent.keyboard('{Enter}'), '8', '2');
261
+ await test(() => userEvent.tab(), '9', '2');
265
262
  await userEvent.tab({ shift: true });
266
- await test(() => userEvent.tab({ shift: true }), "6", "2");
267
- await userEvent.keyboard("{Esc}");
263
+ await test(() => userEvent.tab({ shift: true }), '6', '2');
264
+ await userEvent.keyboard('{Esc}');
268
265
  await userEvent.tab();
269
266
 
270
- await userEvent.keyboard("{Enter}");
267
+ await userEvent.keyboard('{Enter}');
271
268
  await wait(250);
272
269
  expect(eAction).not.toHaveBeenCalled();
273
270
 
274
- await userEvent.keyboard("e");
275
- await waitFor(async () => {
271
+ await userEvent.keyboard('e');
272
+ await waitFor(() => {
276
273
  expect(eAction).toHaveBeenCalled();
277
274
  });
278
275
  };
@@ -1,16 +1,16 @@
1
- import "../../react-menu3/styles/index.scss";
1
+ import '../../react-menu3/styles/index.scss';
2
2
 
3
- import { Meta, StoryFn } from "@storybook/react";
4
- import { expect } from "@storybook/test";
5
- import * as test from "@storybook/test";
6
- import { userEvent, within } from "@storybook/test";
3
+ import { Meta, StoryFn } from '@storybook/react';
4
+ import { expect } from '@storybook/test';
5
+ import * as test from '@storybook/test';
6
+ import { userEvent, within } from '@storybook/test';
7
7
 
8
- import { Grid } from "../../components/Grid";
9
- import { Menu, MenuButton, MenuDivider, MenuItem, SubMenu } from "../../react-menu3";
10
- import { wait } from "../../utils/util";
8
+ import { Grid } from '../../components/Grid';
9
+ import { Menu, MenuButton, MenuDivider, MenuItem, SubMenu } from '../../react-menu3';
10
+ import { wait } from '../../utils/util';
11
11
 
12
12
  export default {
13
- title: "Components / React-menu",
13
+ title: 'Components / React-menu',
14
14
  component: Grid,
15
15
  args: {
16
16
  externalSelectedItems: [],
@@ -49,40 +49,40 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
49
49
  await wait(100); // Wait for debounce
50
50
  };
51
51
 
52
- const menuButton = await canvas.findByRole("button");
52
+ const menuButton = await canvas.findByRole('button');
53
53
  expect(menuButton).toBeInTheDocument();
54
54
 
55
55
  const openMenu = async () => {
56
56
  await wait(500); // Wait for debounce
57
57
  await userEvent.click(menuButton);
58
- expect(await canvas.findByRole("menuitem", { name: "New File" })).toBeInTheDocument();
58
+ expect(await canvas.findByRole('menuitem', { name: 'New File' })).toBeInTheDocument();
59
59
  };
60
60
 
61
61
  // Check menu closes on click outside
62
62
  await openMenu();
63
63
  await userEvent.click(menuButton.parentElement as Element);
64
- expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
64
+ expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
65
65
 
66
66
  // Test arrow down/up
67
67
  await openMenu();
68
- await keyboard("{arrowdown}");
69
- await keyboard("{arrowdown}");
70
- await keyboard("{arrowdown}");
71
- await keyboard("{arrowdown}");
72
- await keyboard("{arrowdown}");
73
- expect(document.activeElement?.innerHTML).toBe("Exit");
68
+ await keyboard('{arrowdown}');
69
+ await keyboard('{arrowdown}');
70
+ await keyboard('{arrowdown}');
71
+ await keyboard('{arrowdown}');
72
+ await keyboard('{arrowdown}');
73
+ expect(document.activeElement?.innerHTML).toBe('Exit');
74
74
 
75
- await keyboard("{arrowup}");
76
- expect(document.activeElement?.innerHTML).toBe("Print...");
75
+ await keyboard('{arrowup}');
76
+ expect(document.activeElement?.innerHTML).toBe('Print...');
77
77
 
78
78
  // Escape close
79
- await userEvent.type(menuButton.parentElement as Element, "{Escape}");
80
- expect(canvas.queryByRole("menuitem", { name: "New File" })).not.toBeInTheDocument();
79
+ await userEvent.type(menuButton.parentElement as Element, '{Escape}');
80
+ expect(canvas.queryByRole('menuitem', { name: 'New File' })).not.toBeInTheDocument();
81
81
 
82
82
  // Test enter to select
83
83
  await openMenu();
84
- await keyboard("{arrowdown}");
85
- await keyboard("{enter}");
84
+ await keyboard('{arrowdown}');
85
+ await keyboard('{enter}');
86
86
  expect(menuItemClickAction).toHaveBeenCalled();
87
87
  expect(newFileAction).toHaveBeenCalled();
88
88
 
@@ -91,10 +91,10 @@ ReactMenuControlled.play = async ({ canvasElement }) => {
91
91
 
92
92
  // Test tab to select
93
93
  await openMenu();
94
- await keyboard("{arrowdown}");
94
+ await keyboard('{arrowdown}');
95
95
  // For some reason arrow down takes a little time to activate
96
96
  await wait(10);
97
- await keyboard("{Tab}");
97
+ await keyboard('{Tab}');
98
98
  expect(menuItemClickAction).toHaveBeenCalled();
99
99
  expect(newFileAction).toHaveBeenCalled();
100
100
 
@@ -3,53 +3,53 @@ import {
3
3
  bearingRangeValidator,
4
4
  bearingStringValidator,
5
5
  convertDDToDMS,
6
- } from "./bearing";
6
+ } from './bearing';
7
7
 
8
- describe("bearing", () => {
9
- test("convertDDToDMS converts decimal-ish degrees to DMS", () => {
10
- expect(convertDDToDMS(-0.001, false)).toBe("-0° 00' 10\"");
11
- expect(convertDDToDMS(-10.001, false)).toBe("-10° 00' 10\"");
12
- expect(convertDDToDMS(-370.001, false)).toBe("-10° 00' 10\"");
8
+ describe('bearing', () => {
9
+ test('convertDDToDMS converts decimal-ish degrees to DMS', () => {
10
+ expect(convertDDToDMS(-0.001, false)).toBe('-0° 00\' 10"');
11
+ expect(convertDDToDMS(-10.001, false)).toBe('-10° 00\' 10"');
12
+ expect(convertDDToDMS(-370.001, false)).toBe('-10° 00\' 10"');
13
13
  expect(convertDDToDMS(359.595999, false, 2)).toBe("0° 00'");
14
- expect(convertDDToDMS(359.595999, false, 4)).toBe("0° 00' 00\"");
15
- expect(convertDDToDMS(359.595999, false, 5)).toBe("0° 00' 00.0\"");
16
- expect(convertDDToDMS(369.696999, false)).toBe("10° 10' 10\"");
17
- expect(convertDDToDMS(369.696999, false, 4)).toBe("10° 10' 10\"");
14
+ expect(convertDDToDMS(359.595999, false, 4)).toBe('0° 00\' 00"');
15
+ expect(convertDDToDMS(359.595999, false, 5)).toBe('0° 00\' 00.0"');
16
+ expect(convertDDToDMS(369.696999, false)).toBe('10° 10\' 10"');
17
+ expect(convertDDToDMS(369.696999, false, 4)).toBe('10° 10\' 10"');
18
18
  expect(convertDDToDMS(221.555999, false, 2)).toBe("221° 56'");
19
- expect(convertDDToDMS(221.555999, false, 5)).toBe("221° 56' 00.0\"");
20
- expect(convertDDToDMS(5, true, 5)).toBe("+5° 00' 00.0\"");
21
- expect(convertDDToDMS(5.0, true, 5)).toBe("+5° 00' 00.0\"");
22
- expect(convertDDToDMS(5.00001, true, 5)).toBe("+5° 00' 00.1\"");
23
- expect(convertDDToDMS(5.1, true, 5)).toBe("+5° 10' 00.0\"");
24
- expect(convertDDToDMS(5.12345)).toBe("+5° 12' 34.5\"");
25
- expect(convertDDToDMS(5.12345, false)).toBe("5° 12' 34.5\"");
26
- expect(convertDDToDMS(5.12345, false, 2)).toBe("5° 12' 34.5\"");
27
- expect(convertDDToDMS(300, true, 5)).toBe("+300° 00' 00.0\"");
28
- expect(convertDDToDMS(300.0, true, 5)).toBe("+300° 00' 00.0\"");
29
- expect(convertDDToDMS(300.00001)).toBe("+300° 00' 00.1\"");
30
- expect(convertDDToDMS(300.1, true, 5)).toBe("+300° 10' 00.0\"");
31
- expect(convertDDToDMS(300.12345)).toBe("+300° 12' 34.5\"");
32
- expect(convertDDToDMS(300.12345, false)).toBe("300° 12' 34.5\"");
19
+ expect(convertDDToDMS(221.555999, false, 5)).toBe('221° 56\' 00.0"');
20
+ expect(convertDDToDMS(5, true, 5)).toBe('+5° 00\' 00.0"');
21
+ expect(convertDDToDMS(5.0, true, 5)).toBe('+5° 00\' 00.0"');
22
+ expect(convertDDToDMS(5.00001, true, 5)).toBe('+5° 00\' 00.1"');
23
+ expect(convertDDToDMS(5.1, true, 5)).toBe('+5° 10\' 00.0"');
24
+ expect(convertDDToDMS(5.12345)).toBe('+5° 12\' 34.5"');
25
+ expect(convertDDToDMS(5.12345, false)).toBe('5° 12\' 34.5"');
26
+ expect(convertDDToDMS(5.12345, false, 2)).toBe('5° 12\' 34.5"');
27
+ expect(convertDDToDMS(300, true, 5)).toBe('+300° 00\' 00.0"');
28
+ expect(convertDDToDMS(300.0, true, 5)).toBe('+300° 00\' 00.0"');
29
+ expect(convertDDToDMS(300.00001)).toBe('+300° 00\' 00.1"');
30
+ expect(convertDDToDMS(300.1, true, 5)).toBe('+300° 10\' 00.0"');
31
+ expect(convertDDToDMS(300.12345)).toBe('+300° 12\' 34.5"');
32
+ expect(convertDDToDMS(300.12345, false)).toBe('300° 12\' 34.5"');
33
33
  expect(convertDDToDMS(300, false, 2)).toBe("300° 00'");
34
34
  expect(convertDDToDMS(300.1, false, 2)).toBe("300° 10'");
35
35
  expect(convertDDToDMS(0, false, 2)).toBe("0° 00'");
36
36
  expect(convertDDToDMS(0.0, false)).toBe("0° 00'");
37
- expect(convertDDToDMS(0.0, false, 4)).toBe("0° 00' 00\"");
38
- expect(convertDDToDMS(0.0, false, 5)).toBe("0° 00' 00.0\"");
37
+ expect(convertDDToDMS(0.0, false, 4)).toBe('0° 00\' 00"');
38
+ expect(convertDDToDMS(0.0, false, 5)).toBe('0° 00\' 00.0"');
39
39
  });
40
40
 
41
- test("bearingStringValidator", () => {
41
+ test('bearingStringValidator', () => {
42
42
  const tests: [string, string | null][] = [
43
- ["", null],
44
- ["1", null],
45
- ["1.2345", null],
46
- ["-1.2345", null],
47
- ["360.2345", null],
48
- ["-360.2345", null],
49
- ["1.2e6", "Bearing must be a number in D.MMSSS format"],
50
- ["0.60000", "Bearing must be a number in D.MMSSS format"],
51
- ["0.00600", "Bearing must be a number in D.MMSSS format"],
52
- ["0.123456", "Bearing has a maximum of 5 decimal places"],
43
+ ['', null],
44
+ ['1', null],
45
+ ['1.2345', null],
46
+ ['-1.2345', null],
47
+ ['360.2345', null],
48
+ ['-360.2345', null],
49
+ ['1.2e6', 'Bearing must be a number in D.MMSSS format'],
50
+ ['0.60000', 'Bearing must be a number in D.MMSSS format'],
51
+ ['0.00600', 'Bearing must be a number in D.MMSSS format'],
52
+ ['0.123456', 'Bearing has a maximum of 5 decimal places'],
53
53
  ];
54
54
 
55
55
  tests.forEach((test, i) => {
@@ -58,21 +58,21 @@ describe("bearing", () => {
58
58
 
59
59
  // calls custom invalid
60
60
  const fn = jest.fn();
61
- bearingStringValidator("1.2", fn);
61
+ bearingStringValidator('1.2', fn);
62
62
  expect(fn).toHaveBeenCalledWith(1.2);
63
63
  });
64
64
 
65
- test("bearingRangeValidator", () => {
65
+ test('bearingRangeValidator', () => {
66
66
  expect(bearingRangeValidator(0)).toBeNull();
67
67
  expect(bearingRangeValidator(359.595999)).toBeNull();
68
- expect(bearingRangeValidator(-0.00001)).toBe("Bearing must not be negative");
69
- expect(bearingRangeValidator(360)).toBe("Bearing must be less than 360 degrees");
68
+ expect(bearingRangeValidator(-0.00001)).toBe('Bearing must not be negative');
69
+ expect(bearingRangeValidator(360)).toBe('Bearing must be less than 360 degrees');
70
70
  });
71
71
 
72
- test("bearingCorrectionRangeValidator", () => {
72
+ test('bearingCorrectionRangeValidator', () => {
73
73
  expect(bearingCorrectionRangeValidator(-179.59999)).toBeNull();
74
74
  expect(bearingCorrectionRangeValidator(359.59999)).toBeNull();
75
- expect(bearingCorrectionRangeValidator(-180)).toBe("Bearing correction must be greater then -180 degrees");
76
- expect(bearingCorrectionRangeValidator(360)).toBe("Bearing correction must be less than 360 degrees");
75
+ expect(bearingCorrectionRangeValidator(-180)).toBe('Bearing correction must be greater then -180 degrees');
76
+ expect(bearingCorrectionRangeValidator(360)).toBe('Bearing correction must be less than 360 degrees');
77
77
  });
78
78
  });
@@ -1,7 +1,7 @@
1
1
  export const bearingValueFormatter = (value: any): string => {
2
- const safeValue = typeof value == "string" ? parseFloat(value) : value;
2
+ const safeValue = typeof value === 'string' ? parseFloat(value) : value;
3
3
  if (safeValue == null) {
4
- return "";
4
+ return '';
5
5
  }
6
6
  return convertDDToDMS(safeValue, false);
7
7
  };
@@ -9,16 +9,16 @@ export const bearingValueFormatter = (value: any): string => {
9
9
  export const bearingCorrectionValueFormatter = (value: any): string => {
10
10
  const safeValue = value;
11
11
  if (safeValue == null) {
12
- return "";
12
+ return '';
13
13
  }
14
- if (typeof safeValue === "string") {
14
+ if (typeof safeValue === 'string') {
15
15
  return convertDDToDMS(bearingNumberParser(safeValue), true, 4);
16
16
  }
17
17
  return convertDDToDMS(safeValue, true, 4);
18
18
  };
19
19
 
20
20
  export const bearingNumberParser = (value: string): number | null => {
21
- if (value === "") return null;
21
+ if (value === '') return null;
22
22
  return parseFloat(value);
23
23
  };
24
24
 
@@ -28,12 +28,12 @@ export const bearingStringValidator = (
28
28
  customInvalid?: (value: number | null) => string | null,
29
29
  ): string | null => {
30
30
  value = value.trim();
31
- if (value === "") return null;
31
+ if (value === '') return null;
32
32
  const match = value.match(validMaskForDmsBearing);
33
- if (!match) return "Bearing must be a number in D.MMSSS format";
33
+ if (!match) return 'Bearing must be a number in D.MMSSS format';
34
34
  const decimalPart = match[4];
35
35
  if (decimalPart != null && decimalPart.length > 5) {
36
- return "Bearing has a maximum of 5 decimal places";
36
+ return 'Bearing has a maximum of 5 decimal places';
37
37
  }
38
38
 
39
39
  const bearing = parseFloat(value);
@@ -53,10 +53,10 @@ export const bearingStringValidator = (
53
53
  * @returns Degrees Minutes Seconds
54
54
  */
55
55
  export const convertDDToDMS = (dd: number | null, showPositiveSymbol = true, trailingZeroDp: 2 | 4 | 5 = 2): string => {
56
- if (dd == null) return "";
56
+ if (dd == null) return '';
57
57
 
58
58
  // toFixed rounds parts up greater than 60, which has to be corrected below
59
- const [bearingWholeString, bearingDecimalString] = dd.toFixed(5).split(".");
59
+ const [bearingWholeString, bearingDecimalString] = dd.toFixed(5).split('.');
60
60
 
61
61
  let bearingWhole = Math.abs(parseInt(bearingWholeString));
62
62
  let minNumeric = parseInt(bearingDecimalString?.substring(0, 2));
@@ -75,12 +75,12 @@ export const convertDDToDMS = (dd: number | null, showPositiveSymbol = true, tra
75
75
  bearingWhole -= 360;
76
76
  }
77
77
 
78
- const minString = minNumeric.toString().padStart(2, "0");
79
- const secString = secNumeric.toString().padStart(2, "0");
78
+ const minString = minNumeric.toString().padStart(2, '0');
79
+ const secString = secNumeric.toString().padStart(2, '0');
80
80
  const deciSecString = bearingDecimalString?.substring(4, 5);
81
81
 
82
- let dmsString = `${showPositiveSymbol && dd > 0 ? "+" : ""}${dd < 0 ? "-" : ""}${bearingWhole}°`;
83
- if (trailingZeroDp === 5 || deciSecString != "0") {
82
+ let dmsString = `${showPositiveSymbol && dd > 0 ? '+' : ''}${dd < 0 ? '-' : ''}${bearingWhole}°`;
83
+ if (trailingZeroDp === 5 || deciSecString != '0') {
84
84
  dmsString += `\xa0${minString}'\xa0${secString}.${deciSecString}"`; // "\xa0" is here for non-breaking space
85
85
  } else if (trailingZeroDp === 4 || secNumeric != 0) {
86
86
  dmsString += `\xa0${minString}'\xa0${secString}"`;
@@ -91,15 +91,15 @@ export const convertDDToDMS = (dd: number | null, showPositiveSymbol = true, tra
91
91
  };
92
92
 
93
93
  export const bearingRangeValidator = (value: number | null) => {
94
- if (value === null) return "Bearing is required";
95
- if (value >= 360) return "Bearing must be less than 360 degrees";
96
- if (value < 0) return "Bearing must not be negative";
94
+ if (value === null) return 'Bearing is required';
95
+ if (value >= 360) return 'Bearing must be less than 360 degrees';
96
+ if (value < 0) return 'Bearing must not be negative';
97
97
  return null;
98
98
  };
99
99
 
100
100
  export const bearingCorrectionRangeValidator = (value: number | null) => {
101
- if (value === null) return "Bearing correction is required";
102
- if (value >= 360) return "Bearing correction must be less than 360 degrees";
103
- if (value <= -180) return "Bearing correction must be greater then -180 degrees";
101
+ if (value === null) return 'Bearing correction is required';
102
+ if (value >= 360) return 'Bearing correction must be less than 360 degrees';
103
+ if (value <= -180) return 'Bearing correction must be greater then -180 degrees';
104
104
  return null;
105
105
  };
@@ -1,4 +1,4 @@
1
- import { useEffect, useRef } from "react";
1
+ import { useEffect, useRef } from 'react';
2
2
 
3
3
  export const useDeferredPromise = <T>() => {
4
4
  const promiseResolve = useRef<((value: T | PromiseLike<T>) => void) | undefined>();
@@ -1,4 +1,4 @@
1
- import { expect, waitFor } from "@storybook/test";
1
+ import { expect, waitFor } from '@storybook/test';
2
2
 
3
3
  export const waitForGridReady = ({ canvasElement }: { canvasElement: HTMLElement }) =>
4
- waitFor(() => expect(canvasElement.querySelector(".Grid-ready")).toBeInTheDocument(), { timeout: 5000 });
4
+ waitFor(() => expect(canvasElement.querySelector('.Grid-ready')).toBeInTheDocument(), { timeout: 5000 });