rd-outer-component 0.1.9 → 0.1.10

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.
@@ -1021,30 +1021,34 @@ class CustomInputAmountComponent {
1021
1021
  this.onValidatorChange = () => { };
1022
1022
  }
1023
1023
  get currentErrorMessage() {
1024
- if (!this.errors)
1024
+ if (!this.control?.errors)
1025
1025
  return '';
1026
1026
  const firstError = Object.keys(this.control?.errors || {})[0];
1027
1027
  const msg = this.errorMessages[firstError];
1028
1028
  switch (firstError) {
1029
1029
  case 'required':
1030
1030
  return (this.errorMessages?.required ||
1031
+ msg ||
1031
1032
  `${this.translate.instant('please_enter')}${this.label.toLowerCase()}`);
1032
1033
  case 'min':
1033
1034
  return (this.errorMessages?.min ||
1035
+ msg ||
1034
1036
  `${this.label}${this.translate.instant('min_value_error')}${formatBigNumber(this.min)}`);
1035
1037
  case 'max':
1036
1038
  return (this.errorMessages?.max ||
1039
+ msg ||
1037
1040
  `${this.label}${this.translate.instant('max_value_error')}${formatBigNumber(this.max)}`);
1038
1041
  case 'precision':
1039
- return (this.errorMessages?.precision ||
1042
+ return (msg ||
1040
1043
  `${this.translate.instant('max_decimal_places')}${this.nzPrecision}`);
1041
1044
  default:
1042
- return (this.errorMessages[firstError] ||
1045
+ return (msg ||
1046
+ this.errorMessages[firstError] ||
1043
1047
  this.translate.instant('validation_failed'));
1044
1048
  }
1045
1049
  }
1046
1050
  get showError() {
1047
- return this.touched && !!this.errors;
1051
+ return (!!this.control?.invalid && (this.control?.touched || this.control?.dirty));
1048
1052
  }
1049
1053
  handleValueChange(value) {
1050
1054
  const rawValue = value.replace(/,/g, '');