rd-outer-component 0.0.41 → 0.0.42

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.
@@ -707,6 +707,8 @@ class CustomInputAmountComponent {
707
707
  return (msg || `${this.label} cannot exceed ${formatBigNumber(this.max)}`);
708
708
  case 'precision':
709
709
  return msg || `Maximum decimal places is ${this.nzPrecision}`;
710
+ case 'custom':
711
+ return this.control?.errors['custom'] || 'Validation failed';
710
712
  default:
711
713
  return msg || 'Validation failed';
712
714
  }
@@ -780,6 +782,12 @@ class CustomInputAmountComponent {
780
782
  errors['invalid'] = true;
781
783
  }
782
784
  }
785
+ if (this.customValidator) {
786
+ const customErrors = this.customValidator(control);
787
+ if (customErrors) {
788
+ Object.assign(errors, customErrors);
789
+ }
790
+ }
783
791
  return Object.keys(errors).length > 0 ? errors : null;
784
792
  }
785
793
  writeValue(value) {
@@ -790,7 +798,7 @@ class CustomInputAmountComponent {
790
798
  }
791
799
  }
792
800
  CustomInputAmountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomInputAmountComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
793
- CustomInputAmountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomInputAmountComponent, selector: "app-rd-input-amount", inputs: { label: "label", symbol: "symbol", name: "name", disabled: "disabled", min: "min", max: "max", nzPrecision: "nzPrecision", required: "required", errorMessages: "errorMessages" }, outputs: { valueChange: "valueChange" }, providers: [
801
+ CustomInputAmountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomInputAmountComponent, selector: "app-rd-input-amount", inputs: { label: "label", symbol: "symbol", name: "name", disabled: "disabled", min: "min", max: "max", nzPrecision: "nzPrecision", required: "required", customValidator: "customValidator", errorMessages: "errorMessages" }, outputs: { valueChange: "valueChange" }, providers: [
794
802
  {
795
803
  provide: NG_VALUE_ACCESSOR,
796
804
  useExisting: forwardRef(() => CustomInputAmountComponent),
@@ -832,6 +840,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
832
840
  type: Input
833
841
  }], required: [{
834
842
  type: Input
843
+ }], customValidator: [{
844
+ type: Input
835
845
  }], errorMessages: [{
836
846
  type: Input
837
847
  }], valueChange: [{