@linzjs/step-ag-grid 7.7.0 → 7.8.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/index.js +23 -16
- package/dist/index.js.map +1 -1
- package/dist/src/utils/textValidator.d.ts +1 -0
- package/dist/step-ag-grid.esm.js +23 -16
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/textValidator.test.ts +14 -2
- package/src/utils/textValidator.ts +26 -16
package/dist/index.js
CHANGED
|
@@ -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
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
if (
|
|
4231
|
-
|
|
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
|
}
|