@bpmn-io/form-js-viewer 1.21.1 → 1.21.2
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.cjs +16 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +16 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -8499,11 +8499,23 @@ function runPresetValidation(field, validation, value) {
|
|
|
8499
8499
|
errors.push('Field is required.');
|
|
8500
8500
|
}
|
|
8501
8501
|
}
|
|
8502
|
-
if ('min' in validation && (value || value === 0)
|
|
8503
|
-
|
|
8502
|
+
if ('min' in validation && (value || value === 0)) {
|
|
8503
|
+
try {
|
|
8504
|
+
if (Big(value).lt(Big(validation.min))) {
|
|
8505
|
+
errors.push(`Field must have minimum value of ${validation.min}.`);
|
|
8506
|
+
}
|
|
8507
|
+
} catch {
|
|
8508
|
+
errors.push('Min validation value is not a valid number.');
|
|
8509
|
+
}
|
|
8504
8510
|
}
|
|
8505
|
-
if ('max' in validation && (value || value === 0)
|
|
8506
|
-
|
|
8511
|
+
if ('max' in validation && (value || value === 0)) {
|
|
8512
|
+
try {
|
|
8513
|
+
if (Big(value).gt(Big(validation.max))) {
|
|
8514
|
+
errors.push(`Field must have maximum value of ${validation.max}.`);
|
|
8515
|
+
}
|
|
8516
|
+
} catch {
|
|
8517
|
+
errors.push('Max validation value is not a valid number.');
|
|
8518
|
+
}
|
|
8507
8519
|
}
|
|
8508
8520
|
if ('minLength' in validation && value && value.trim().length < validation.minLength) {
|
|
8509
8521
|
errors.push(`Field must have minimum length of ${validation.minLength}.`);
|