@linzjs/step-ag-grid 7.7.0 → 7.8.1

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## Features
6
6
 
7
7
  - [ag-grid-community](https://www.npmjs.com/package/ag-grid-community) based grid with custom popover components
8
- implemented using a modified [react-menu](https://www.npmjs.com/package/@szhsin/react-menu).
8
+ implemented using a modified [react-menu](https://www.npmjs.com/package/@szhsin/react-menu).
9
9
  - Default components
10
10
  - Text input
11
11
  - Text area
@@ -15,7 +15,7 @@ implemented using a modified [react-menu](https://www.npmjs.com/package/@szhsin/
15
15
  - Popover message
16
16
  - Custom form
17
17
 
18
- *Please note this requires React >=17, ag-grid-community >=27, and sass.*
18
+ _Please note this requires React >=17, ag-grid-community >=27, and sass._
19
19
 
20
20
  ## Install
21
21
 
@@ -44,7 +44,7 @@ Storybook demo deployed at: https://linz.github.io/step-ag-grid/
44
44
  ```tsx
45
45
  import "@linzjs/lui/dist/scss/base.scss";
46
46
  import "@linzjs/lui/dist/fonts";
47
- import "@linzjs/step-ag-grid/dist/index.css"
47
+ import "@linzjs/step-ag-grid/dist/index.css";
48
48
  // Only required for LINZ themes otherwise import the default theme from ag-grid
49
49
  import "@linzjs/step-ag-grid/dist/GridTheme.scss";
50
50
 
@@ -55,7 +55,7 @@ import {
55
55
  ColDefT,
56
56
  GridCell,
57
57
  GridPopoverMessage,
58
- GridPopoverEditDropDown
58
+ GridPopoverEditDropDown,
59
59
  } from "@linzjs/step-ag-grid";
60
60
 
61
61
  const GridDemo = () => {
@@ -63,9 +63,10 @@ const GridDemo = () => {
63
63
  id: number;
64
64
  name: number;
65
65
  position: string;
66
- };
67
-
68
- const columnDefs: ColDefT<ITestRow>[] = useMemo(() => [
66
+ }
67
+
68
+ const columnDefs: ColDefT<ITestRow>[] = useMemo(
69
+ () => [
69
70
  GridCell({
70
71
  field: "id",
71
72
  headerName: "Id",
@@ -116,8 +117,8 @@ const GridDemo = () => {
116
117
 
117
118
  const rowData: ITestRow[] = useMemo(
118
119
  () => [
119
- { id: 1000, name: "Tom", position: "Tester" },
120
- { id: 1001, name: "Sue", position: "Developer" },
120
+ { id: 1000, name: "Tom", position: "Tester" },
121
+ { id: 1001, name: "Sue", position: "Developer" },
121
122
  ],
122
123
  [],
123
124
  );
@@ -125,13 +126,11 @@ const GridDemo = () => {
125
126
  return (
126
127
  <GridUpdatingContextProvider>
127
128
  <GridContextProvider>
128
- <Grid
129
- selectable={true}
130
- columnDefs={columnDefs}
131
- rowData={rowData}
132
- />
129
+ <Grid selectable={true} columnDefs={columnDefs} rowData={rowData} />
133
130
  </GridContextProvider>
134
131
  </GridUpdatingContextProvider>
135
132
  );
136
133
  };
137
134
  ```
135
+
136
+ Check `src\stories` for more usage examples
package/dist/index.js CHANGED
@@ -3931,7 +3931,7 @@ var bearingCorrectionValueFormatter = function (params) {
3931
3931
  if (typeof value === "string") {
3932
3932
  return convertDDToDMS(bearingNumberParser(value), true, true);
3933
3933
  }
3934
- return convertDDToDMS(value, true, true);
3934
+ return convertDDToDMS(value, true, false);
3935
3935
  };
3936
3936
  var bearingNumberParser = function (value) {
3937
3937
  if (value === "")
@@ -4213,22 +4213,29 @@ var TextInputValidator = function (props, value, data, context) {
4213
4213
  if (value != "" && !isFloat(value)) {
4214
4214
  return "Must be a valid number";
4215
4215
  }
4216
- var number = parseFloat(value);
4217
- if (nf.gtMin != null && number <= nf.gtMin) {
4218
- return "Must be greater than ".concat(nf.gtMin);
4219
- }
4220
- if (nf.geMin != null && number < nf.geMin) {
4221
- return "Must not be less than ".concat(nf.geMin);
4222
- }
4223
- if (nf.ltMax != null && number >= nf.ltMax) {
4224
- return "Must be less than ".concat(nf.ltMax);
4225
- }
4226
- if (nf.leMax != null && number > nf.leMax) {
4227
- return "Must not be greater than ".concat(nf.leMax);
4228
- }
4229
- if (nf.precision != null && value != "") {
4230
- if (parseFloat(number.toPrecision(nf.precision + 1)) != number) {
4231
- return nf.precision == 0 ? "Must be a whole number" : "Must have no more than ".concat(nf.precision, " decimal places");
4216
+ if (value != "") {
4217
+ var number = parseFloat(value);
4218
+ if (nf.gtMin != null && number <= nf.gtMin) {
4219
+ return "Must be greater than ".concat(nf.gtMin);
4220
+ }
4221
+ if (nf.geMin != null && number < nf.geMin) {
4222
+ return "Must not be less than ".concat(nf.geMin);
4223
+ }
4224
+ if (nf.ltMax != null && number >= nf.ltMax) {
4225
+ return "Must be less than ".concat(nf.ltMax);
4226
+ }
4227
+ if (nf.leMax != null && number > nf.leMax) {
4228
+ return "Must not be greater than ".concat(nf.leMax);
4229
+ }
4230
+ if (nf.precision != null && value != "") {
4231
+ if (parseFloat(number.toPrecision(nf.precision)) != number) {
4232
+ return "Must have no more than ".concat(nf.precision, " digits precision");
4233
+ }
4234
+ }
4235
+ if (nf.scale != null && value != "") {
4236
+ if (parseFloat(number.toFixed(nf.scale)) != number) {
4237
+ return nf.scale == 0 ? "Must be a whole number" : "Must have no more than ".concat(nf.scale, " decimal places");
4238
+ }
4232
4239
  }
4233
4240
  }
4234
4241
  }