@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.es.js CHANGED
@@ -8479,11 +8479,23 @@ function runPresetValidation(field, validation, value) {
8479
8479
  errors.push('Field is required.');
8480
8480
  }
8481
8481
  }
8482
- if ('min' in validation && (value || value === 0) && value < validation.min) {
8483
- errors.push(`Field must have minimum value of ${validation.min}.`);
8482
+ if ('min' in validation && (value || value === 0)) {
8483
+ try {
8484
+ if (Big(value).lt(Big(validation.min))) {
8485
+ errors.push(`Field must have minimum value of ${validation.min}.`);
8486
+ }
8487
+ } catch {
8488
+ errors.push('Min validation value is not a valid number.');
8489
+ }
8484
8490
  }
8485
- if ('max' in validation && (value || value === 0) && value > validation.max) {
8486
- errors.push(`Field must have maximum value of ${validation.max}.`);
8491
+ if ('max' in validation && (value || value === 0)) {
8492
+ try {
8493
+ if (Big(value).gt(Big(validation.max))) {
8494
+ errors.push(`Field must have maximum value of ${validation.max}.`);
8495
+ }
8496
+ } catch {
8497
+ errors.push('Max validation value is not a valid number.');
8498
+ }
8487
8499
  }
8488
8500
  if ('minLength' in validation && value && value.trim().length < validation.minLength) {
8489
8501
  errors.push(`Field must have minimum length of ${validation.minLength}.`);