rd-outer-component 0.1.65 → 0.1.66
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/esm2020/lib/modules/custom-textarea/custom-textarea.component.mjs +14 -8
- package/fesm2015/rd-outer-component.mjs +15 -9
- package/fesm2015/rd-outer-component.mjs.map +1 -1
- package/fesm2020/rd-outer-component.mjs +13 -7
- package/fesm2020/rd-outer-component.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -761,17 +761,23 @@ class CustomTextareaComponent {
|
|
|
761
761
|
case 'required':
|
|
762
762
|
return (msg ||
|
|
763
763
|
`${this.translate.instant('please_enter')}${this.label.toLowerCase()}`);
|
|
764
|
+
case 'minlength':
|
|
764
765
|
case 'minLength':
|
|
765
|
-
return
|
|
766
|
-
|
|
766
|
+
return msg
|
|
767
|
+
? this.translate.instant(msg)
|
|
768
|
+
: `${this.translate.instant('length_cannot_be_less')}${this.control.errors[firstError]?.requiredLength ?? this.minLength}`;
|
|
769
|
+
case 'maxlength':
|
|
767
770
|
case 'maxLength':
|
|
768
|
-
return
|
|
769
|
-
|
|
771
|
+
return msg
|
|
772
|
+
? this.translate.instant(msg)
|
|
773
|
+
: `${this.translate.instant('length_cannot_exceed')}${this.control.errors[firstError]?.requiredLength ?? this.maxLength}`;
|
|
774
|
+
case 'pattern':
|
|
775
|
+
return this.translate.instant(msg || 'invalid_format');
|
|
770
776
|
case 'custom':
|
|
771
777
|
return (this.control?.errors['custom'] ||
|
|
772
778
|
this.translate.instant('validation_failed'));
|
|
773
779
|
default:
|
|
774
|
-
return (this.translate.instant(
|
|
780
|
+
return (this.translate.instant(msg || 'validation_failed') ||
|
|
775
781
|
this.translate.instant('validation_failed'));
|
|
776
782
|
}
|
|
777
783
|
}
|
|
@@ -788,8 +794,8 @@ class CustomTextareaComponent {
|
|
|
788
794
|
this.required = false;
|
|
789
795
|
this.nzAutosize = true;
|
|
790
796
|
this.errorMessages = {
|
|
791
|
-
pattern: '
|
|
792
|
-
custom: '
|
|
797
|
+
pattern: 'invalid_format',
|
|
798
|
+
custom: 'validation_failed',
|
|
793
799
|
};
|
|
794
800
|
this.valueChange = new EventEmitter();
|
|
795
801
|
this.focus = new EventEmitter();
|