@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.
- package/bundles/esfaenza-forms-and-validations.umd.js +10 -1
- package/bundles/esfaenza-forms-and-validations.umd.js.map +1 -1
- package/esfaenza-forms-and-validations.metadata.json +1 -1
- package/esm2015/lib/forms/base-form-control.js +8 -2
- package/esm2015/lib/forms/form-adaptive/form-adaptive.component.js +4 -1
- package/fesm2015/esfaenza-forms-and-validations.js +10 -1
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/base-form-control.d.ts +5 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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) {
|