@magic-xpa/angular 4.1000.0-dev4100.286 → 4.1000.0-dev4100.288
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.
@@ -2484,13 +2484,25 @@ class AccessorMagicService {
|
|
2484
2484
|
if (c.hasError('pattern')) {
|
2485
2485
|
if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
|
2486
2486
|
return 'Value must be non-negative';
|
2487
|
-
if (
|
2488
|
-
const
|
2489
|
-
|
2487
|
+
if (c.errors.pattern.requiredPattern.includes('.')) {
|
2488
|
+
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[0];
|
2489
|
+
const decimalFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[1];
|
2490
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2491
|
+
const actualDecimalLimit = c.errors.pattern.requiredPattern.match(/(?:[^,]+,){2}(\d+)/)[1];
|
2492
|
+
if (numericFormat.length > actualNumericLimit || decimalFormat.length > actualDecimalLimit) {
|
2493
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + actualDecimalLimit + " digits";
|
2494
|
+
}
|
2495
|
+
}
|
2496
|
+
else if (!c.errors.pattern.requiredPattern.includes('.') && !Number.isInteger(c.errors.pattern.actualValue)) {
|
2497
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2498
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
|
2490
2499
|
}
|
2491
|
-
|
2492
|
-
const
|
2493
|
-
|
2500
|
+
else {
|
2501
|
+
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString();
|
2502
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2503
|
+
if (numericFormat.length > actualNumericLimit) {
|
2504
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
|
2505
|
+
}
|
2494
2506
|
}
|
2495
2507
|
}
|
2496
2508
|
if (c.hasError('rangevalidator'))
|