@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.
@@ -7,6 +7,7 @@ export interface TextInputValidatorProps<RowType extends GridBaseRow> {
7
7
  invalid?: (value: string, data: RowType, context: any) => JSX.Element | string | null;
8
8
  numberFormat?: {
9
9
  precision?: number;
10
+ scale?: number;
10
11
  gtMin?: number;
11
12
  geMin?: number;
12
13
  ltMax?: number;
@@ -3910,7 +3910,7 @@ var bearingCorrectionValueFormatter = function (params) {
3910
3910
  if (typeof value === "string") {
3911
3911
  return convertDDToDMS(bearingNumberParser(value), true, true);
3912
3912
  }
3913
- return convertDDToDMS(value, true, true);
3913
+ return convertDDToDMS(value, true, false);
3914
3914
  };
3915
3915
  var bearingNumberParser = function (value) {
3916
3916
  if (value === "")
@@ -4192,22 +4192,29 @@ var TextInputValidator = function (props, value, data, context) {
4192
4192
  if (value != "" && !isFloat(value)) {
4193
4193
  return "Must be a valid number";
4194
4194
  }
4195
- var number = parseFloat(value);
4196
- if (nf.gtMin != null && number <= nf.gtMin) {
4197
- return "Must be greater than ".concat(nf.gtMin);
4198
- }
4199
- if (nf.geMin != null && number < nf.geMin) {
4200
- return "Must not be less than ".concat(nf.geMin);
4201
- }
4202
- if (nf.ltMax != null && number >= nf.ltMax) {
4203
- return "Must be less than ".concat(nf.ltMax);
4204
- }
4205
- if (nf.leMax != null && number > nf.leMax) {
4206
- return "Must not be greater than ".concat(nf.leMax);
4207
- }
4208
- if (nf.precision != null && value != "") {
4209
- if (parseFloat(number.toPrecision(nf.precision + 1)) != number) {
4210
- return nf.precision == 0 ? "Must be a whole number" : "Must have no more than ".concat(nf.precision, " decimal places");
4195
+ if (value != "") {
4196
+ var number = parseFloat(value);
4197
+ if (nf.gtMin != null && number <= nf.gtMin) {
4198
+ return "Must be greater than ".concat(nf.gtMin);
4199
+ }
4200
+ if (nf.geMin != null && number < nf.geMin) {
4201
+ return "Must not be less than ".concat(nf.geMin);
4202
+ }
4203
+ if (nf.ltMax != null && number >= nf.ltMax) {
4204
+ return "Must be less than ".concat(nf.ltMax);
4205
+ }
4206
+ if (nf.leMax != null && number > nf.leMax) {
4207
+ return "Must not be greater than ".concat(nf.leMax);
4208
+ }
4209
+ if (nf.precision != null && value != "") {
4210
+ if (parseFloat(number.toPrecision(nf.precision)) != number) {
4211
+ return "Must have no more than ".concat(nf.precision, " digits precision");
4212
+ }
4213
+ }
4214
+ if (nf.scale != null && value != "") {
4215
+ if (parseFloat(number.toFixed(nf.scale)) != number) {
4216
+ return nf.scale == 0 ? "Must be a whole number" : "Must have no more than ".concat(nf.scale, " decimal places");
4217
+ }
4211
4218
  }
4212
4219
  }
4213
4220
  }