@linzjs/step-ag-grid 7.19.6 → 8.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.
- package/dist/src/components/Grid.d.ts +2 -1
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +5 -1
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +8 -2
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +8 -2
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +4 -1
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +4 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +10 -1
- package/dist/src/utils/bearing.d.ts +2 -3
- package/dist/step-ag-grid.esm.js +66 -46
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +3 -3
- package/src/components/gridForm/GridFormEditBearing.tsx +9 -4
- package/src/components/gridForm/GridFormMultiSelect.tsx +7 -7
- package/src/components/gridForm/GridFormPopoverMenu.tsx +9 -7
- package/src/components/gridForm/GridFormTextArea.tsx +2 -2
- package/src/components/gridForm/GridFormTextInput.tsx +2 -2
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +40 -32
- package/src/react-menu3/components/ControlledMenu.tsx +5 -1
- package/src/stories/grid/GridNonEditableRow.stories.tsx +6 -6
- package/src/stories/grid/GridPopoutBearing.stories.tsx +1 -1
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +5 -5
- package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +3 -3
- package/src/stories/grid/GridReadOnly.stories.tsx +6 -6
- package/src/stories/grid/gridForm/GridFormDropDown.stories.tsx +60 -0
- package/src/stories/grid/gridForm/GridFormEditBearing.stories.tsx +56 -0
- package/src/stories/grid/gridForm/GridFormEditBearingCorrection.stories.tsx +56 -0
- package/src/stories/grid/gridForm/reactMenuTest.scss +3 -0
- package/src/utils/bearing.ts +10 -12
package/src/utils/bearing.ts
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const value = typeof params.value == "string" ? parseFloat(params.value) : params.value;
|
|
5
|
-
if (value == null) {
|
|
1
|
+
export const bearingValueFormatter = (value: any): string => {
|
|
2
|
+
const safeValue = typeof value == "string" ? parseFloat(value) : value;
|
|
3
|
+
if (safeValue == null) {
|
|
6
4
|
return "–";
|
|
7
5
|
}
|
|
8
|
-
return convertDDToDMS(
|
|
6
|
+
return convertDDToDMS(safeValue, false, false);
|
|
9
7
|
};
|
|
10
8
|
|
|
11
|
-
export const bearingCorrectionValueFormatter = (
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
9
|
+
export const bearingCorrectionValueFormatter = (value: any): string => {
|
|
10
|
+
const safeValue = value;
|
|
11
|
+
if (safeValue == null) {
|
|
14
12
|
return "–";
|
|
15
13
|
}
|
|
16
|
-
if (typeof
|
|
17
|
-
return convertDDToDMS(bearingNumberParser(
|
|
14
|
+
if (typeof safeValue === "string") {
|
|
15
|
+
return convertDDToDMS(bearingNumberParser(safeValue), true, true);
|
|
18
16
|
}
|
|
19
|
-
return convertDDToDMS(
|
|
17
|
+
return convertDDToDMS(safeValue, true, true);
|
|
20
18
|
};
|
|
21
19
|
|
|
22
20
|
export const bearingNumberParser = (value: string): number | null => {
|