rd-outer-component 0.1.64 → 0.1.65

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.
@@ -484,19 +484,25 @@ class CustomInputComponent {
484
484
  case 'precision':
485
485
  return (msg ||
486
486
  `${this.translate.instant('max_decimal_places')}${this.maskNumber}`);
487
+ case 'minlength':
487
488
  case 'minLength':
488
- return (msg ||
489
- `${this.translate.instant('length_cannot_be_less')}${this.minLength}`);
489
+ return msg
490
+ ? this.translate.instant(msg)
491
+ : `${this.translate.instant('length_cannot_be_less')}${this.control.errors[firstError]?.requiredLength ?? this.minLength}`;
492
+ case 'maxlength':
490
493
  case 'maxLength':
491
- return (msg ||
492
- `${this.translate.instant('length_cannot_exceed')}${this.maxLength}`);
494
+ return msg
495
+ ? this.translate.instant(msg)
496
+ : `${this.translate.instant('length_cannot_exceed')}${this.control.errors[firstError]?.requiredLength ?? this.maxLength}`;
497
+ case 'pattern':
498
+ return this.translate.instant(msg || 'invalid_format');
493
499
  case 'email':
494
500
  return msg || `${this.translate.instant('email_invalid')}`;
495
501
  case 'custom':
496
502
  return (this.control?.errors['custom'] ||
497
503
  this.translate.instant('validation_failed'));
498
504
  default:
499
- return (this.translate.instant(this.errorMessages[firstError]) ||
505
+ return (this.translate.instant(msg || 'validation_failed') ||
500
506
  this.translate.instant('validation_failed'));
501
507
  }
502
508
  }
@@ -523,8 +529,8 @@ class CustomInputComponent {
523
529
  this.required = false;
524
530
  this.size = 'default';
525
531
  this.errorMessages = {
526
- pattern: 'Invalid format',
527
- custom: 'Validation failed',
532
+ pattern: 'invalid_format',
533
+ custom: 'validation_failed',
528
534
  };
529
535
  this.valueChange = new EventEmitter();
530
536
  this.focus = new EventEmitter();