@unifylib/ui-lib 1.0.74 → 1.0.75
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.
|
@@ -2293,11 +2293,19 @@ class BaseFormCanvasComponent {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
const field = this.fields.find(f => f.property === prop);
|
|
2295
2295
|
if (!field?.validationMessages) {
|
|
2296
|
+
if (field?.type === 'phone-number' && control.touched && control.dirty && !control.value) {
|
|
2297
|
+
const prefix = this.pageInfo.labelsSection + ".";
|
|
2298
|
+
return prefix + 'INVALID_PHONE_NUMBER';
|
|
2299
|
+
}
|
|
2296
2300
|
if (control.value && control.status !== 'VALID' && this.getFirstErrorKey) {
|
|
2297
2301
|
return this.getFirstErrorKey(prop);
|
|
2298
2302
|
}
|
|
2299
2303
|
return '';
|
|
2300
2304
|
}
|
|
2305
|
+
if (field?.type === 'phone-number' && control.touched && control.dirty && !control.value) {
|
|
2306
|
+
const prefix = this.pageInfo.labelsSection + ".";
|
|
2307
|
+
return prefix + (field.validationMessages?.validatePhoneNumber || 'INVALID_PHONE_NUMBER');
|
|
2308
|
+
}
|
|
2301
2309
|
if (control.invalid) {
|
|
2302
2310
|
const errors = control.errors || {};
|
|
2303
2311
|
const prefix = this.pageInfo.labelsSection + ".";
|
|
@@ -2315,6 +2323,8 @@ class BaseFormCanvasComponent {
|
|
|
2315
2323
|
return prefix + (field.validationMessages?.decimalMax || 'DECIMAL_MAX');
|
|
2316
2324
|
if (errors['pattern'])
|
|
2317
2325
|
return prefix + (field.validationMessages?.pattern || 'INVALID_FORMAT');
|
|
2326
|
+
if (errors['validatePhoneNumber'])
|
|
2327
|
+
return prefix + (field.validationMessages?.validatePhoneNumber || 'INVALID_PHONE_NUMBER');
|
|
2318
2328
|
if (errors['invalidMathExpression'])
|
|
2319
2329
|
return prefix + 'INVALID_MATH';
|
|
2320
2330
|
if (errors['dateRangeInvalid'])
|
|
@@ -2357,6 +2367,10 @@ class BaseFormCanvasComponent {
|
|
|
2357
2367
|
}
|
|
2358
2368
|
showError(prop) {
|
|
2359
2369
|
const CONTROL = this.formParam?.get([prop]);
|
|
2370
|
+
const field = this.fields.find(f => f.property === prop);
|
|
2371
|
+
if (field?.type === 'phone-number') {
|
|
2372
|
+
return CONTROL?.touched && CONTROL?.dirty && !CONTROL?.value;
|
|
2373
|
+
}
|
|
2360
2374
|
return (CONTROL?.value || CONTROL?.value === 0) && CONTROL?.status === 'INVALID';
|
|
2361
2375
|
}
|
|
2362
2376
|
clearFieldValue(prop) {
|