@esfaenza/forms-and-validations 11.2.129 → 11.2.131

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.
@@ -1947,6 +1947,11 @@
1947
1947
  * poi mettendo firstBind a false di lì in poi funziono come devo. Vista la casistica evito essenzialmente metà detectChanges
1948
1948
  */
1949
1949
  this.firstBind = true;
1950
+ /**
1951
+ * Indica di utilizzare i validatori che l'utente piazza sul componente.
1952
+ * Da non usare nel caso di form-adaptive dato che i validatori vengono valutati in base al tipo ecc
1953
+ */
1954
+ this.UseUserValidators = true;
1950
1955
  /** Indica se il campo è obbligatorio i opzionale */
1951
1956
  this.Required = false;
1952
1957
  /** Indica se il Form che contiene questo campo è già stato registrato */
@@ -2307,7 +2312,8 @@
2307
2312
  this.Form.removeControl(this.validationControl);
2308
2313
  this.validationControl = comp;
2309
2314
  //Questa serve per passare avanti i validatori
2310
- this.validationControl.control.setValidators(this._validators);
2315
+ if (this.UseUserValidators)
2316
+ this.validationControl.control.setValidators(this._validators);
2311
2317
  //Se sono staccato dal Form (vuol dire che sono ad esempio dentro un ng-template) aggiungo il controllo al Form passato come input (context del template)
2312
2318
  if (this.detatchedFromform && this.Form && !this.formHasBennBound) {
2313
2319
  this.Form.addControl(this.validationControl);
@@ -2666,6 +2672,7 @@
2666
2672
  /** @ignore */
2667
2673
  _this.executionTimers = {};
2668
2674
  _this.ModelFile = new AppFile();
2675
+ _this.UseUserValidators = false;
2669
2676
  return _this;
2670
2677
  }
2671
2678
  FormAdaptiveComponent.prototype.ngOnInit = function () {
@@ -2689,9 +2696,11 @@
2689
2696
  }
2690
2697
  break;
2691
2698
  }
2699
+ this.ngControl._setValidators(validators);
2692
2700
  this.ngControl.control.setValidators(validators);
2693
2701
  this.ngControl.control.updateValueAndValidity();
2694
2702
  }
2703
+ _super.prototype.ngOnInit.call(this);
2695
2704
  };
2696
2705
  /** @ignore */
2697
2706
  FormAdaptiveComponent.prototype.ngOnChanges = function (changes) {