@magic-xpa/angular 4.1000.0-dev4100.280 → 4.1000.0-dev4100.282

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.
@@ -2481,8 +2481,18 @@ class AccessorMagicService {
2481
2481
  let c = this.task.getFormControl(rowId, id);
2482
2482
  if (c.hasError('required'))
2483
2483
  return 'Control must be updated.';
2484
- if (c.hasError('pattern'))
2485
- return 'Required pattern is : ' + c.errors.pattern.requiredPattern;
2484
+ if (c.hasError('pattern')) {
2485
+ if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
2486
+ return 'Value must be non-negative';
2487
+ if (Math.floor(Math.abs(c.errors.pattern.actualValue)).toString().length > parseInt(c.errors.pattern.requiredPattern.match(/,(\d+)/)[1])) {
2488
+ const picLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
2489
+ return 'Numeric format is limited to ' + picLimit + (picLimit == '1' ? ' digit' : ' digits');
2490
+ }
2491
+ if (c.errors.pattern.requiredPattern.split(",").length - 1 === 2) {
2492
+ const decimalPicLimit = c.errors.pattern.requiredPattern.match(/(?:[^,]+,){2}(\d+)/)[1];
2493
+ return 'Decimal format is limited to ' + decimalPicLimit + (decimalPicLimit == '1' ? ' digit' : ' digits');
2494
+ }
2495
+ }
2486
2496
  if (c.hasError('rangevalidator'))
2487
2497
  return c.errors.rangevalidator.errorMsg;
2488
2498
  if (c.hasError('maxlength'))