@esfaenza/forms-and-validations 11.2.147 → 11.2.149-beta1

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.
Files changed (27) hide show
  1. package/bundles/esfaenza-forms-and-validations.umd.js +144 -39
  2. package/bundles/esfaenza-forms-and-validations.umd.js.map +1 -1
  3. package/esfaenza-forms-and-validations.metadata.json +1 -1
  4. package/esm2015/lib/forms/base-form-control.js +94 -11
  5. package/esm2015/lib/forms/form-input/form-input.component.js +8 -2
  6. package/esm2015/lib/forms/form-select/form-select.component.js +2 -2
  7. package/esm2015/lib/validations/base-validation.js +15 -5
  8. package/esm2015/lib/validations/validation-autocomplete/validation-autocomplete.component.js +6 -5
  9. package/esm2015/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.js +6 -5
  10. package/esm2015/lib/validations/validation-currency/validation-currency.component.js +2 -2
  11. package/esm2015/lib/validations/validation-date/validation-date.component.js +3 -4
  12. package/esm2015/lib/validations/validation-datetime/validation-datetime.component.js +3 -4
  13. package/esm2015/lib/validations/validation-input/validation-input.component.js +3 -4
  14. package/esm2015/lib/validations/validation-select/validation-select.component.js +5 -6
  15. package/esm2015/lib/validations/validation-text-area/validation-text-area.component.js +2 -2
  16. package/fesm2015/esfaenza-forms-and-validations.js +133 -38
  17. package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
  18. package/lib/forms/base-form-control.d.ts +47 -8
  19. package/lib/forms/form-input/form-input.component.d.ts +2 -0
  20. package/lib/validations/base-validation.d.ts +12 -1
  21. package/lib/validations/validation-autocomplete/validation-autocomplete.component.d.ts +2 -2
  22. package/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.d.ts +2 -2
  23. package/lib/validations/validation-date/validation-date.component.d.ts +0 -1
  24. package/lib/validations/validation-datetime/validation-datetime.component.d.ts +0 -1
  25. package/lib/validations/validation-input/validation-input.component.d.ts +0 -1
  26. package/lib/validations/validation-select/validation-select.component.d.ts +0 -1
  27. package/package.json +1 -1
@@ -476,7 +476,9 @@
476
476
  * Nota bene: I tooltip rallentano tantissimo la pagina perché il tizio che ha fatto ngx bootstrap non è capace
477
477
  */
478
478
  var BaseValidation = /** @class */ (function () {
479
- function BaseValidation() {
479
+ /** @ignore Constructor */
480
+ function BaseValidation(cdr) {
481
+ this.cdr = cdr;
480
482
  /**
481
483
  * Variabile per tenere in memoria il fatto che il componente è forzato a invalido o no
482
484
  */
@@ -628,6 +630,7 @@
628
630
  _this.baseInput.control.setErrors({ forcedtoinvalid: true });
629
631
  _this.baseInput.control.markAsTouched();
630
632
  _this.baseInput.control.markAsDirty();
633
+ _this.cdr.detectChanges();
631
634
  });
632
635
  else
633
636
  setTimeout(function () {
@@ -666,8 +669,12 @@
666
669
  */
667
670
  BaseValidation.prototype.showTooltipWithMessage = function (messageOverride) {
668
671
  if (messageOverride === void 0) { messageOverride = null; }
669
- this.validationFailed = messageOverride || this.validationFailed || (this.InferErrorMessages ? this.inferMessage() : "");
670
- if (this.validationFailed)
672
+ // Aggiorno il messaggio di validazione solo se il valore è diverso dall'ultimo valore ricevuto
673
+ if (this.valueOnLastValidation != this.baseInput.value) {
674
+ this.validationFailedBind = messageOverride || this.validationFailed || (this.InferErrorMessages ? this.inferMessage() : "");
675
+ this.valueOnLastValidation = this.baseInput.value;
676
+ }
677
+ if (this.validationFailedBind)
671
678
  this.tooltip.show();
672
679
  };
673
680
  /**
@@ -747,6 +754,9 @@
747
754
  BaseValidation.decorators = [
748
755
  { type: core.Directive }
749
756
  ];
757
+ BaseValidation.ctorParameters = function () { return [
758
+ { type: core.ChangeDetectorRef }
759
+ ]; };
750
760
  BaseValidation.propDecorators = {
751
761
  tooltip: [{ type: core.ViewChild, args: [tooltip.TooltipDirective, { static: false },] }],
752
762
  tooltip_static: [{ type: core.ViewChild, args: [tooltip.TooltipDirective, { static: true },] }],
@@ -809,20 +819,19 @@
809
819
  * @ignore
810
820
  */
811
821
  function ValidationSelectComponent(_validators, _asyncValidators, injector, cdr, lc) {
812
- var _this = _super.call(this) || this;
822
+ var _this = _super.call(this, cdr) || this;
813
823
  _this._validators = _validators;
814
824
  _this._asyncValidators = _asyncValidators;
815
825
  _this.injector = injector;
816
- _this.cdr = cdr;
817
826
  _this.lc = lc;
818
827
  /**
819
828
  * valore del campo vuoto della select
820
829
  */
821
- _this.emptyFieldValue = "-2";
830
+ _this.emptyFieldValue = "-2000";
822
831
  /**
823
832
  * Valore del placeholder
824
833
  */
825
- _this.placeHolderValue = "-1";
834
+ _this.placeHolderValue = "-1000";
826
835
  /**
827
836
  * Per i componenti non obbligatori indica se fornire un "valore vuoto"
828
837
  */
@@ -937,7 +946,7 @@
937
946
  ValidationSelectComponent.decorators = [
938
947
  { type: core.Component, args: [{
939
948
  selector: "val-select",
940
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <select matNativeControl\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n name=\"val-select\"\r\n class=\"form-control\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n id=\"{{id}}\"\r\n [customRequired]=\"required ? 'true' : 'false'\"\r\n [CustomNullValues]=\"[placeHolderValue,emptyFieldValue]\"\r\n [(ngModel)]=\"value\"\r\n [tooltip]=\"tolTemplate\"\r\n [class.checking-combo]=\"!noValidate\"\r\n [class.app-option-placeholder]=\"baseInput.value === placeHolderValue\"\r\n [class.no-bg-img]=\"!showValidationSymbol\"\r\n [disabled]=\"readonly\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (blur)=\"closeTooltip(); onBlur.emit(true);\"\r\n (ngModelChange)=\"onModelChange($event); onFinalize()\">\r\n\r\n <option *ngIf=\"placeholder\" [value]=\"placeHolderValue\" disabled selected hidden>{{placeholder}}</option>\r\n <option *ngIf=\"required == false && emptyValue\" [value]=\"emptyFieldValue\"></option>\r\n <ng-content></ng-content>\r\n </select>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
949
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <select matNativeControl\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n name=\"val-select\"\r\n class=\"form-control\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n id=\"{{id}}\"\r\n [customRequired]=\"required ? 'true' : 'false'\"\r\n [CustomNullValues]=\"[placeHolderValue,emptyFieldValue]\"\r\n [(ngModel)]=\"value\"\r\n [tooltip]=\"tolTemplate\"\r\n [class.checking-combo]=\"!noValidate\"\r\n [class.app-option-placeholder]=\"baseInput.value === placeHolderValue\"\r\n [class.no-bg-img]=\"!showValidationSymbol\"\r\n [disabled]=\"readonly\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (blur)=\"closeTooltip(); onBlur.emit(true);\"\r\n (ngModelChange)=\"onModelChange($event); onFinalize()\">\r\n\r\n <option *ngIf=\"placeholder\" [value]=\"placeHolderValue\" disabled selected hidden>{{placeholder}}</option>\r\n <option *ngIf=\"required == false && emptyValue\" [value]=\"emptyFieldValue\"></option>\r\n <ng-content></ng-content>\r\n </select>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
941
950
  encapsulation: core.ViewEncapsulation.None,
942
951
  changeDetection: core.ChangeDetectionStrategy.OnPush,
943
952
  providers: [
@@ -976,8 +985,7 @@
976
985
  * @ignore
977
986
  */
978
987
  function ValidationDateComponent(cdr, _validators, _asyncValidators, injector, lc, dateExts) {
979
- var _this = _super.call(this) || this;
980
- _this.cdr = cdr;
988
+ var _this = _super.call(this, cdr) || this;
981
989
  _this._validators = _validators;
982
990
  _this._asyncValidators = _asyncValidators;
983
991
  _this.injector = injector;
@@ -1111,7 +1119,7 @@
1111
1119
  ValidationDateComponent.decorators = [
1112
1120
  { type: core.Component, args: [{
1113
1121
  selector: "val-date",
1114
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"datepicker\"\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n name=\"val-date\"\r\n class=\"form-control {{class}}\"\r\n autocomplete=\"{{autocomplete}}\"\r\n id=\"{{id}}\"\r\n (click)=\"onFocus($event)\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"placeholder ? (FloatingLabel ? undefined : placeholder) : _format\"\r\n [disabled]=\"readonly || disabled\"\r\n [isDisabled]=\"readonly || disabled\"\r\n (dateChange)=\"outputValue($event); onFinalize();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip();\"\r\n />\r\n <mat-datepicker-toggle matSuffix [for]=\"datepicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #datepicker></mat-datepicker>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1122
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"datepicker\"\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n name=\"val-date\"\r\n class=\"form-control {{class}}\"\r\n autocomplete=\"{{autocomplete}}\"\r\n id=\"{{id}}\"\r\n (click)=\"onFocus($event)\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"placeholder ? (FloatingLabel ? undefined : placeholder) : _format\"\r\n [disabled]=\"readonly || disabled\"\r\n [isDisabled]=\"readonly || disabled\"\r\n (dateChange)=\"outputValue($event); onFinalize();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip();\"\r\n />\r\n <mat-datepicker-toggle matSuffix [for]=\"datepicker\"></mat-datepicker-toggle>\r\n <mat-datepicker #datepicker></mat-datepicker>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1115
1123
  encapsulation: core.ViewEncapsulation.None,
1116
1124
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1117
1125
  providers: [
@@ -1146,8 +1154,7 @@
1146
1154
  * @ignore
1147
1155
  */
1148
1156
  function ValidationInputComponent(cdr, _validators, _asyncValidators, injector, lc) {
1149
- var _this = _super.call(this) || this;
1150
- _this.cdr = cdr;
1157
+ var _this = _super.call(this, cdr) || this;
1151
1158
  _this._validators = _validators;
1152
1159
  _this._asyncValidators = _asyncValidators;
1153
1160
  _this.injector = injector;
@@ -1298,7 +1305,7 @@
1298
1305
  ValidationInputComponent.decorators = [
1299
1306
  { type: core.Component, args: [{
1300
1307
  selector: "val-input",
1301
- template: "<mat-form-field floatLabel=\"never\" appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label [class.app-margin-left-25]=\"HasPrefix\" *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix_internal\"></ng-container>\r\n </ng-container>\r\n\r\n <!-- Bisogna fixare un po' l'uso di readonly, disabled, frozen cazzi e mazzi -->\r\n <input matInput\r\n #baseInput='ngModel'\r\n #htmlInput\r\n type=\"{{type}}\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"{{autocomplete}}\"\r\n name=\"val-input\"\r\n class=\"form-control {{class}}\"\r\n id=\"{{id}}\"\r\n [class.app-margin-left-25]=\"HasPrefix\"\r\n [class.mat-input-with-suffix]=\"HasSuffix || Password || showWarning\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate && !showWarning\"\r\n [tooltip]=\"tolTemplate\"\r\n [readonly]=\"Frozen\"\r\n [disabled]=\"readonly || disabled\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n >\r\n <ng-container *ngIf=\"HasSuffix || Password || showWarning\">\r\n <ng-container *ngIf=\"!Password && !showWarning\">\r\n <ng-container *ngTemplateOutlet=\"suffix_internal\"></ng-container>\r\n </ng-container>\r\n\r\n <span class=\"form-input-suffix\" *ngIf=\"Password || showWarning\">\r\n <ng-container *ngIf=\"Password\" matSuffix>\r\n <a *ngIf=\"passShown\" class=\"fa fa-eye-slash app-fs-16 app-pointer\" (click)=\"type = 'password'; passShown = !passShown; $event.preventDefault()\"></a>\r\n <a *ngIf=\"!passShown\" class=\"fa fa-eye app-fs-16 app-pointer\" (click)=\"type = 'text'; passShown = !passShown; $event.preventDefault()\"></a>\r\n </ng-container>\r\n <ng-container *ngIf=\"showWarning\" matSuffix>\r\n <span title=\"{{warningTitle}}\" class=\"{{warningClass}} text-warning app-fs-16\"></span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n</mat-form-field>\r\n\r\n<!-- Questo compoennte nascosto serve solamente per assicurarsi che angular carichi gli stili dei mat-button che altrimenti non caricherebbe... dunno why -->\r\n<div hidden><mat-datepicker-toggle></mat-datepicker-toggle></div>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1308
+ template: "<mat-form-field floatLabel=\"never\" appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label [class.app-margin-left-25]=\"HasPrefix\" *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix_internal\"></ng-container>\r\n </ng-container>\r\n\r\n <!-- Bisogna fixare un po' l'uso di readonly, disabled, frozen cazzi e mazzi -->\r\n <input matInput\r\n #baseInput='ngModel'\r\n #htmlInput\r\n type=\"{{type}}\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"{{autocomplete}}\"\r\n name=\"val-input\"\r\n class=\"form-control {{class}}\"\r\n id=\"{{id}}\"\r\n [class.app-margin-left-25]=\"HasPrefix\"\r\n [class.mat-input-with-suffix]=\"HasSuffix || Password || showWarning\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate && !showWarning\"\r\n [tooltip]=\"tolTemplate\"\r\n [readonly]=\"Frozen\"\r\n [disabled]=\"readonly || disabled\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n >\r\n <ng-container *ngIf=\"HasSuffix || Password || showWarning\">\r\n <ng-container *ngIf=\"!Password && !showWarning\">\r\n <ng-container *ngTemplateOutlet=\"suffix_internal\"></ng-container>\r\n </ng-container>\r\n\r\n <span class=\"form-input-suffix\" *ngIf=\"Password || showWarning\">\r\n <ng-container *ngIf=\"Password\" matSuffix>\r\n <a *ngIf=\"passShown\" class=\"fa fa-eye-slash app-fs-16 app-pointer\" (click)=\"type = 'password'; passShown = !passShown; $event.preventDefault()\"></a>\r\n <a *ngIf=\"!passShown\" class=\"fa fa-eye app-fs-16 app-pointer\" (click)=\"type = 'text'; passShown = !passShown; $event.preventDefault()\"></a>\r\n </ng-container>\r\n <ng-container *ngIf=\"showWarning\" matSuffix>\r\n <span title=\"{{warningTitle}}\" class=\"{{warningClass}} text-warning app-fs-16\"></span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n</mat-form-field>\r\n\r\n<!-- Questo compoennte nascosto serve solamente per assicurarsi che angular carichi gli stili dei mat-button che altrimenti non caricherebbe... dunno why -->\r\n<div hidden><mat-datepicker-toggle></mat-datepicker-toggle></div>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1302
1309
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1303
1310
  providers: [
1304
1311
  { provide: localizations.LocalizationService, useClass: BaseValidationLoc },
@@ -1362,7 +1369,7 @@
1362
1369
  ValidationCurrencyComponent.decorators = [
1363
1370
  { type: core.Component, args: [{
1364
1371
  selector: "val-currency",
1365
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <input #baseInput='ngModel'\r\n #htmlInput\r\n currencyMask\r\n matInput\r\n [readonly]=\"readonly\"\r\n [options]='CurrencyOptions'\r\n [(ngModel)]=\"value\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n class=\"form-control {{class}}\"\r\n [class.checking-field]=\"!noValidate\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n type=\"{{type}}\"\r\n [tooltip]=\"tolTemplate\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"{{autocomplete}}\" />\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div>\r\n <span class=\"close-button pull-right\" (click)=\"closeTooltip()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </span>\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1372
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <input #baseInput='ngModel'\r\n #htmlInput\r\n currencyMask\r\n matInput\r\n [readonly]=\"readonly\"\r\n [options]='CurrencyOptions'\r\n [(ngModel)]=\"value\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n class=\"form-control {{class}}\"\r\n [class.checking-field]=\"!noValidate\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n type=\"{{type}}\"\r\n [tooltip]=\"tolTemplate\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"{{autocomplete}}\" />\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div>\r\n <span class=\"close-button pull-right\" (click)=\"closeTooltip()\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </span>\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1366
1373
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1367
1374
  providers: [
1368
1375
  { provide: localizations.LocalizationService, useClass: BaseValidationLoc },
@@ -1423,7 +1430,7 @@
1423
1430
  ValidationTextAreaComponent.decorators = [
1424
1431
  { type: core.Component, args: [{
1425
1432
  selector: "val-textarea",
1426
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-full-height mat-no-border-top mat-height-auto\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <textarea matInput\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n [(ngModel)]=\"value\"\r\n name=\"val-textarea\"\r\n triggers=\"\"\r\n class=\"app-no-resize form-control {{class}}\"\r\n id=\"{{id}}\"\r\n [class.checking-field]=\"!noValidate\"\r\n rows=\"{{rows}}\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n placement=\"top\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n (ngModelChange)=\"onModelChange($event)\">\r\n </textarea>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1433
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-full-height mat-no-border-top mat-height-auto\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n <textarea matInput\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n [(ngModel)]=\"value\"\r\n name=\"val-textarea\"\r\n triggers=\"\"\r\n class=\"app-no-resize form-control {{class}}\"\r\n id=\"{{id}}\"\r\n [class.checking-field]=\"!noValidate\"\r\n rows=\"{{rows}}\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n placement=\"top\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\"\r\n (ngModelChange)=\"onModelChange($event)\">\r\n </textarea>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1427
1434
  providers: [
1428
1435
  { provide: localizations.LocalizationService, useClass: BaseValidationLoc },
1429
1436
  {
@@ -1457,8 +1464,7 @@
1457
1464
  * @ignore
1458
1465
  */
1459
1466
  function ValidationDateTimeComponent(cdr, _validators, _asyncValidators, injector, lc, dateExts) {
1460
- var _this = _super.call(this) || this;
1461
- _this.cdr = cdr;
1467
+ var _this = _super.call(this, cdr) || this;
1462
1468
  _this._validators = _validators;
1463
1469
  _this._asyncValidators = _asyncValidators;
1464
1470
  _this.injector = injector;
@@ -1620,7 +1626,7 @@
1620
1626
  ValidationDateTimeComponent.decorators = [
1621
1627
  { type: core.Component, args: [{
1622
1628
  selector: "val-datetime",
1623
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n\r\n <input matInput \r\n [ngxMatDatetimePicker]=\"datepicker\" \r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n name=\"val-date\"\r\n id=\"{{id}}\"\r\n (click)=\"onFocus($event)\"\r\n class=\"form-control {{class}}\"\r\n autocomplete=\"{{autocomplete}}\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"placeholder ? '' : _format\"\r\n [disabled]=\"readonly || disabled\"\r\n [isDisabled]=\"readonly || disabled\"\r\n (dateChange)=\"outputValue($event); onFinalize();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip();\"\r\n />\r\n\r\n <mat-datepicker-toggle matSuffix [for]=\"datepicker\"></mat-datepicker-toggle>\r\n\r\n <ngx-mat-datetime-picker #datepicker \r\n [showSpinners]=\"showSpinners\" \r\n [showSeconds]=\"showSeconds\" \r\n [stepHour]=\"stepHour\" \r\n [stepMinute]=\"stepMinute\" \r\n [stepSecond]=\"stepSecond\" \r\n [touchUi]=\"false\" \r\n [color]=\"'primary'\">\r\n </ngx-mat-datetime-picker>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1629
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"placeholder && FloatingLabel\">{{placeholder}}</mat-label>\r\n\r\n <input matInput \r\n [ngxMatDatetimePicker]=\"datepicker\" \r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n name=\"val-date\"\r\n id=\"{{id}}\"\r\n (click)=\"onFocus($event)\"\r\n class=\"form-control {{class}}\"\r\n autocomplete=\"{{autocomplete}}\"\r\n [placeholder]=\"FloatingLabel ? undefined : placeholder\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [placeholder]=\"placeholder ? '' : _format\"\r\n [disabled]=\"readonly || disabled\"\r\n [isDisabled]=\"readonly || disabled\"\r\n (dateChange)=\"outputValue($event); onFinalize();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip();\"\r\n />\r\n\r\n <mat-datepicker-toggle matSuffix [for]=\"datepicker\"></mat-datepicker-toggle>\r\n\r\n <ngx-mat-datetime-picker #datepicker \r\n [showSpinners]=\"showSpinners\" \r\n [showSeconds]=\"showSeconds\" \r\n [stepHour]=\"stepHour\" \r\n [stepMinute]=\"stepMinute\" \r\n [stepSecond]=\"stepSecond\" \r\n [touchUi]=\"false\" \r\n [color]=\"'primary'\">\r\n </ngx-mat-datetime-picker>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1624
1630
  encapsulation: core.ViewEncapsulation.None,
1625
1631
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1626
1632
  providers: [
@@ -1652,8 +1658,8 @@
1652
1658
  var ValidationAutocompleteComponent = /** @class */ (function (_super) {
1653
1659
  __extends(ValidationAutocompleteComponent, _super);
1654
1660
  /** @ignore */
1655
- function ValidationAutocompleteComponent(_validators, _asyncValidators, injector, lc) {
1656
- var _this = _super.call(this) || this;
1661
+ function ValidationAutocompleteComponent(cdr, _validators, _asyncValidators, injector, lc) {
1662
+ var _this = _super.call(this, cdr) || this;
1657
1663
  _this._validators = _validators;
1658
1664
  _this._asyncValidators = _asyncValidators;
1659
1665
  _this.injector = injector;
@@ -1747,7 +1753,7 @@
1747
1753
  ValidationAutocompleteComponent.decorators = [
1748
1754
  { type: core.Component, args: [{
1749
1755
  selector: "val-autocomplete",
1750
- template: "<!-- Val-Model: {{value}} -->\r\n<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <input matInput\r\n #htmlInput\r\n #baseInput='ngModel'\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n placeholder=\"{{placeholder}}\"\r\n [matAutocomplete]=\"auto\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n class=\"form-control {{class}}\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [disabled]=\"readonly || disabled\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\">\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of FilteredSource\" [value]=\"option.id\">\r\n {{option.description}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1756
+ template: "<!-- Val-Model: {{value}} -->\r\n<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <input matInput\r\n #htmlInput\r\n #baseInput='ngModel'\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n placeholder=\"{{placeholder}}\"\r\n [matAutocomplete]=\"auto\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n class=\"form-control {{class}}\"\r\n [(ngModel)]=\"value\"\r\n [class.checking-field]=\"!noValidate\"\r\n [tooltip]=\"tolTemplate\"\r\n [disabled]=\"readonly || disabled\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && onFinalize();\"\r\n (blur)=\"closeTooltip(); onFinalize();\">\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of FilteredSource\" [value]=\"option.id\">\r\n {{option.description}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1751
1757
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1752
1758
  providers: [
1753
1759
  { provide: localizations.LocalizationService, useClass: BaseValidationLoc },
@@ -1762,6 +1768,7 @@
1762
1768
  },] }
1763
1769
  ];
1764
1770
  ValidationAutocompleteComponent.ctorParameters = function () { return [
1771
+ { type: core.ChangeDetectorRef },
1765
1772
  { type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_VALIDATORS,] }] },
1766
1773
  { type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_ASYNC_VALIDATORS,] }] },
1767
1774
  { type: core.Injector },
@@ -1780,8 +1787,8 @@
1780
1787
  var ValidationAutocompleteMultiComponent = /** @class */ (function (_super) {
1781
1788
  __extends(ValidationAutocompleteMultiComponent, _super);
1782
1789
  /** @ignore */
1783
- function ValidationAutocompleteMultiComponent(_validators, _asyncValidators, injector, lc) {
1784
- var _this = _super.call(this) || this;
1790
+ function ValidationAutocompleteMultiComponent(cdr, _validators, _asyncValidators, injector, lc) {
1791
+ var _this = _super.call(this, cdr) || this;
1785
1792
  _this._validators = _validators;
1786
1793
  _this._asyncValidators = _asyncValidators;
1787
1794
  _this.injector = injector;
@@ -1934,7 +1941,7 @@
1934
1941
  ValidationAutocompleteMultiComponent.decorators = [
1935
1942
  { type: core.Component, args: [{
1936
1943
  selector: "val-autocomplete-multi",
1937
- template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <mat-chip-list #chipList>\r\n <ng-container *ngIf=\"selectData.length < ChipThreshold\" >\r\n <mat-chip *ngFor=\"let select of selectData\" class=\"cardinal-colors\" (click)=\"!(readonly || disabled) && removeChip(select)\">\r\n {{ select.description }}\r\n <mat-icon class=\"mat-chip-remove\">cancel</mat-icon>\r\n </mat-chip>\r\n </ng-container>\r\n\r\n <mat-chip *ngIf=\"selectData.length >= ChipThreshold\" class=\"cardinal-colors\" (click)=\"!(readonly || disabled) && removeChip(null)\">\r\n {{ selectData.length }} {{ 'Elements selected' | localize: lc }}\r\n <mat-icon class=\"mat-chip-remove\">cancel</mat-icon>\r\n </mat-chip>\r\n\r\n <input matInput\r\n [matChipInputFor]=\"chipList\"\r\n #htmlInput\r\n #baseInput='ngModel'\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n [placeholder]=\"placeholder\"\r\n [matAutocomplete]=\"auto\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n [(ngModel)]=\"value\"\r\n [tooltip]=\"tolTemplate\"\r\n [disabled]=\"readonly || disabled\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (blur)=\"closeTooltip();\">\r\n </mat-chip-list>\r\n\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayFn\">\r\n <mat-option *ngFor=\"let data of FilteredSource\">\r\n <div (click)=\"toggleSelection(data); !HideChoicesOnSelection && $event.stopPropagation()\">\r\n <mat-checkbox [checked]=\"data.selected\" (change)=\"toggleSelection(data);\" (click)=\"!HideChoicesOnSelection && $event.stopPropagation()\">\r\n {{ data.description }}\r\n </mat-checkbox>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailed}}</span>\r\n </div>\r\n</ng-template>",
1944
+ template: "<mat-form-field appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top\" [style.width.px]=\"widthPx\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <mat-chip-list #chipList>\r\n <ng-container *ngIf=\"selectData.length < ChipThreshold\" >\r\n <mat-chip *ngFor=\"let select of selectData\" class=\"cardinal-colors\" (click)=\"!(readonly || disabled) && removeChip(select)\">\r\n {{ select.description }}\r\n <mat-icon class=\"mat-chip-remove\">cancel</mat-icon>\r\n </mat-chip>\r\n </ng-container>\r\n\r\n <mat-chip *ngIf=\"selectData.length >= ChipThreshold\" class=\"cardinal-colors\" (click)=\"!(readonly || disabled) && removeChip(null)\">\r\n {{ selectData.length }} {{ 'Elements selected' | localize: lc }}\r\n <mat-icon class=\"mat-chip-remove\">cancel</mat-icon>\r\n </mat-chip>\r\n\r\n <input matInput\r\n [matChipInputFor]=\"chipList\"\r\n #htmlInput\r\n #baseInput='ngModel'\r\n type=\"text\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n [placeholder]=\"placeholder\"\r\n [matAutocomplete]=\"auto\"\r\n name=\"val-input\"\r\n id=\"{{id}}\"\r\n [(ngModel)]=\"value\"\r\n [tooltip]=\"tolTemplate\"\r\n [disabled]=\"readonly || disabled\"\r\n (ngModelChange)=\"onModelChange($event)\"\r\n (click)=\"onFocus($event)\"\r\n (focus)=\"checkTooltip();\"\r\n (blur)=\"closeTooltip();\">\r\n </mat-chip-list>\r\n\r\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayFn\">\r\n <mat-option *ngFor=\"let data of FilteredSource\">\r\n <div (click)=\"toggleSelection(data); !HideChoicesOnSelection && $event.stopPropagation()\">\r\n <mat-checkbox [checked]=\"data.selected\" (change)=\"toggleSelection(data);\" (click)=\"!HideChoicesOnSelection && $event.stopPropagation()\">\r\n {{ data.description }}\r\n </mat-checkbox>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n</mat-form-field>\r\n\r\n<ng-template #tolTemplate>\r\n <div (click)=\"closeTooltip()\">\r\n <span>{{validationFailedBind}}</span>\r\n </div>\r\n</ng-template>",
1938
1945
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1939
1946
  providers: [
1940
1947
  { provide: localizations.LocalizationService, useClass: BaseValidationLoc },
@@ -1949,6 +1956,7 @@
1949
1956
  },] }
1950
1957
  ];
1951
1958
  ValidationAutocompleteMultiComponent.ctorParameters = function () { return [
1959
+ { type: core.ChangeDetectorRef },
1952
1960
  { type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_VALIDATORS,] }] },
1953
1961
  { type: Array, decorators: [{ type: core.Optional }, { type: core.Inject, args: [forms.NG_ASYNC_VALIDATORS,] }] },
1954
1962
  { type: core.Injector },
@@ -2074,6 +2082,11 @@
2074
2082
  this.BindCheckingGroups = [];
2075
2083
  /** Cache delle proprietà scritte tipo --> {prop} */
2076
2084
  this.BindProperties = [];
2085
+ this.destroyed$ = new rxjs.Subject();
2086
+ /**
2087
+ * Variabile per tenere in memoria il fatto che il componente è forzato a invalido o no
2088
+ */
2089
+ this._forceInvalid = false;
2077
2090
  if (ngControl == null) {
2078
2091
  if (!this.handleNullNgControl())
2079
2092
  console.error("ngControl nullo per qualche motivo! Il 90% delle funzionalità di questo input saranno disabilitate");
@@ -2140,23 +2153,23 @@
2140
2153
  enumerable: false,
2141
2154
  configurable: true
2142
2155
  });
2143
- Object.defineProperty(BaseFormControl.prototype, "_validationControl", {
2156
+ Object.defineProperty(BaseFormControl.prototype, "baseInput", {
2144
2157
  /**
2145
- * Query sull'elemento 'validationControl' che funziona in ambiente statico
2158
+ * Query sull'elemento 'baseInput' che funziona in ambiente statico
2146
2159
  *
2147
- * @param {NgModel} comp Elemento HTML marcato con "#validationControl"
2160
+ * @param {NgModel} comp Elemento HTML marcato con "#baseInput"
2148
2161
  */
2149
- set: function (comp) { this.registerValComp(comp); },
2162
+ set: function (comp) { this.registerBaseInput(comp); },
2150
2163
  enumerable: false,
2151
2164
  configurable: true
2152
2165
  });
2153
- Object.defineProperty(BaseFormControl.prototype, "validationControl_static", {
2166
+ Object.defineProperty(BaseFormControl.prototype, "baseInput_static", {
2154
2167
  /**
2155
- * Query sull'elemento 'validationControl' che funziona in ambiente dinamico
2168
+ * Query sull'elemento 'baseInput' che funziona in ambiente dinamico
2156
2169
  *
2157
- * @param {NgModel} comp Elemento HTML marcato con "#validationControl"
2170
+ * @param {NgModel} comp Elemento HTML marcato con "#baseInput"
2158
2171
  */
2159
- set: function (comp) { this.registerValComp(comp); },
2172
+ set: function (comp) { this.registerBaseInput(comp); },
2160
2173
  enumerable: false,
2161
2174
  configurable: true
2162
2175
  });
@@ -2271,6 +2284,20 @@
2271
2284
  return origFunc_1.apply(formOutsideRef);
2272
2285
  };
2273
2286
  }
2287
+ if (this.SetValidationSubject) {
2288
+ this.SetValidationSubject.pipe(operators.takeUntil(this.destroyed$)).subscribe(function (v) {
2289
+ if (v.fieldName + "_internal" == _this.GeneratedName) {
2290
+ // Bisogna farlo su entrambi i Control per portare il ".valid" nel punto giusto
2291
+ // e per avere gli stili sull'input
2292
+ var control = _this.Form.getControl(_this.validationControl);
2293
+ control.setErrors({ forcedtoinvalid: true });
2294
+ control.markAsTouched();
2295
+ _this.ngControl.control.setErrors({ forcedtoinvalid: true });
2296
+ _this.ngControl.control.markAsTouched();
2297
+ _this.cdr.markForCheck();
2298
+ }
2299
+ });
2300
+ }
2274
2301
  };
2275
2302
  /**
2276
2303
  * Se sono in modalità detatched devo rimuovere manualmente questo controllo quando entro nella dispose, altrimenti se poi ne andassi a riaggiungere
@@ -2279,6 +2306,8 @@
2279
2306
  BaseFormControl.prototype.ngOnDestroy = function () {
2280
2307
  if (this.Form && this.validationControl && !!this.Form.getControl(this.validationControl))
2281
2308
  this.Form.removeControl(this.validationControl);
2309
+ this.destroyed$.next();
2310
+ this.destroyed$.complete();
2282
2311
  };
2283
2312
  /** Elabora i validatori iniettati e capisce se il valore è obbligatorio o meno */
2284
2313
  BaseFormControl.prototype.checkRequiredValidator = function () {
@@ -2335,7 +2364,7 @@
2335
2364
  *
2336
2365
  * @param {NgModel} comp Elemento HTML marcato con "#validationControl"
2337
2366
  */
2338
- BaseFormControl.prototype.registerValComp = function (comp) {
2367
+ BaseFormControl.prototype.registerBaseInput = function (comp) {
2339
2368
  if (comp) {
2340
2369
  // È arrivato un nuovo validationContorl (succede solo nel form-select quando cambia la source da 0 elementi / null ad N elementi, quindi al massimo una volta)
2341
2370
  if (this.validationControl && this.Form)
@@ -2420,6 +2449,73 @@
2420
2449
  if (this.FAV_DEBUG_MODE)
2421
2450
  console.log("@forms-and-validations: " + message);
2422
2451
  };
2452
+ Object.defineProperty(BaseFormControl.prototype, "submitted", {
2453
+ /**
2454
+ * Imposta il componente come "submitted" scatenandone le validazioni ed eventualmente la visualizzazione del tooltip di errore
2455
+ *
2456
+ * @param {boolean} val **true** se si vuole impostare questo controllo come submitted, **false** altrimenti
2457
+ */
2458
+ set: function (val) {
2459
+ this._submitted = val;
2460
+ if (!this.baseInput)
2461
+ return;
2462
+ if (val) {
2463
+ this.baseInput.control.markAsTouched();
2464
+ }
2465
+ if (this.baseInput.control.status === "INVALID" && val) { /*this.showTooltipWithMessage();*/ }
2466
+ else { /*this.tooltip.hide();*/ }
2467
+ },
2468
+ enumerable: false,
2469
+ configurable: true
2470
+ });
2471
+ Object.defineProperty(BaseFormControl.prototype, "forceInvalid", {
2472
+ /**
2473
+ * Imposta il componente come "invalid" a prescindere dai validatori
2474
+ */
2475
+ set: function (val) {
2476
+ var _this = this;
2477
+ this._forceInvalid = val;
2478
+ if (val)
2479
+ setTimeout(function () {
2480
+ _this.baseInput.control.setErrors({ forcedtoinvalid: true });
2481
+ _this.baseInput.control.markAsTouched();
2482
+ _this.baseInput.control.markAsDirty();
2483
+ _this.cdr.detectChanges();
2484
+ });
2485
+ else
2486
+ setTimeout(function () {
2487
+ _this.baseInput.control.setErrors({ forcedtoinvalid: null });
2488
+ _this.baseInput.control.updateValueAndValidity();
2489
+ });
2490
+ },
2491
+ enumerable: false,
2492
+ configurable: true
2493
+ });
2494
+ /**
2495
+ * @ignore
2496
+ */
2497
+ BaseFormControl.prototype.setDisabledState = function (isDisabled) {
2498
+ isDisabled ? this.baseInput.control.disable() : this.baseInput.control.enable();
2499
+ this.Readonly = isDisabled;
2500
+ };
2501
+ /**
2502
+ * Registra il Subject per ricevere le richieste di Focus dall'esterno
2503
+ */
2504
+ BaseFormControl.prototype.registerFocusRequest = function () {
2505
+ var _this = this;
2506
+ if (!this.FocusSubject)
2507
+ return;
2508
+ this.observable = this.FocusSubject.subscribe(function (t) {
2509
+ _this.htmlInput.nativeElement.focus();
2510
+ });
2511
+ };
2512
+ /**
2513
+ * Deregistra il Subject delle richieste di focus
2514
+ */
2515
+ BaseFormControl.prototype.deregisterFocusRequest = function () {
2516
+ if (this.observable)
2517
+ this.observable.unsubscribe();
2518
+ };
2423
2519
  return BaseFormControl;
2424
2520
  }());
2425
2521
  BaseFormControl.decorators = [
@@ -2463,11 +2559,14 @@
2463
2559
  Display: [{ type: core.Input }],
2464
2560
  Readonly: [{ type: core.Input }],
2465
2561
  LabelInputRatio: [{ type: core.Input }],
2466
- _validationControl: [{ type: core.ViewChild, args: ["validationControl", { static: false },] }],
2467
- validationControl_static: [{ type: core.ViewChild, args: ["validationControl", { static: true },] }],
2562
+ htmlInput: [{ type: core.ViewChild, args: ['htmlInput', { static: false },] }],
2563
+ baseInput: [{ type: core.ViewChild, args: ["baseInput", { static: false },] }],
2564
+ baseInput_static: [{ type: core.ViewChild, args: ["baseInput", { static: true },] }],
2468
2565
  inputChange: [{ type: core.Output }],
2469
2566
  inputFocus: [{ type: core.Output }],
2470
- inputFinalized: [{ type: core.Output }]
2567
+ inputFinalized: [{ type: core.Output }],
2568
+ submitted: [{ type: core.Input, args: ["submitted",] }],
2569
+ forceInvalid: [{ type: core.Input }]
2471
2570
  };
2472
2571
 
2473
2572
  /**
@@ -3337,6 +3436,7 @@
3337
3436
  _this.HasSuffix = false;
3338
3437
  /** Indica la presenza o meno di un prefisso, si basa sulla "truthiness" della proiezione **prefix** */
3339
3438
  _this.HasPrefix = false;
3439
+ _this.ShowPassword = false;
3340
3440
  return _this;
3341
3441
  }
3342
3442
  /** @ignore */
@@ -3351,12 +3451,17 @@
3351
3451
  };
3352
3452
  /** @ignore */
3353
3453
  FormInputComponent.prototype.onNotNullValueSet = function () { };
3454
+ FormInputComponent.prototype.onShowHidePassword = function (event) {
3455
+ this.Password = !this.Password;
3456
+ this.ShowPassword = !this.ShowPassword;
3457
+ event.preventDefault();
3458
+ };
3354
3459
  return FormInputComponent;
3355
3460
  }(BaseFormControl));
3356
3461
  FormInputComponent.decorators = [
3357
3462
  { type: core.Component, args: [{
3358
3463
  selector: "form-input",
3359
- template: "<!-- Uguale in tutti i componenti --------------------------------------------------------------------------->\r\n<ng-container *ngIf=\"!FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">\r\n <ng-container *ngIf=\"DisplayLayout == 'form'\">{{ EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"DisplayLayout == 'inline'\" class=\"app-inline\">{{ EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\" class=\"{{FormGroupClass + (Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (DisplayLayout == 'inline' && DisplayMode ? (' app-inline-block ' + (!Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n\r\n <label class=\"col-md-{{(DisplayMode && DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : LabelColWidth) + (DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{Label}}{{Required && !DisplayMode ? '*' : ''}}{{Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline' && InlineSeparator != ''\">{{InlineSeparator}}</span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">{{ EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>\r\n<!----------------------------------------------------------------------------------------------------------->\r\n\r\n<ng-template #controlTemplate>\r\n <val-input [FocusSubject]=\"FocusSubject\" [SetValidationSubject]=\"SetValidationSubject\" [FieldAppearence]=\"FieldAppearence\"\r\n [noValidate]=\"!Validation\"\r\n [Frozen]=\"Frozen\"\r\n [submitted]=\"Form?.submitted\"\r\n [readonly]=\"Readonly\"\r\n [forceInvalid]=\"ForcedError\" \r\n [FloatingLabel]=\"FloatingLabel\"\r\n type=\"text\"\r\n [(ngModel)]=\"Model\"\r\n [id]=\"GeneratedName\"\r\n name=\"{{GeneratedName}}\"\r\n autocomplete=\"off\"\r\n #validationControl=\"ngModel\"\r\n (inputChange)=\"changed();\"\r\n (inputFocus)=\"focused($event);\"\r\n (inputFinalized)=\"finalized()\"\r\n [placeholder]=\"Placeholder\"\r\n [validationFailed]=\"FailedValidationMessage\"\r\n [Password]=\"Password\">\r\n <ng-container *ngIf=\"HasSuffix\">\r\n <ng-template #suffix_internal>\r\n <button type=\"button\" class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-suffix\"\r\n matSuffix (click)=\"onSuffixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"suffix\"></ng-container>\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <ng-template #prefix_internal>\r\n <button type=\"button\" class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-prefix\"\r\n matPrefix (click)=\"onPrefixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"prefix\"></ng-container>\r\n </button>\r\n </ng-template>\r\n </ng-container>\r\n </val-input>\r\n</ng-template>",
3464
+ template: "<!-- Uguale in tutti i componenti --------------------------------------------------------------------------->\r\n<ng-container *ngIf=\"!FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">\r\n <ng-container *ngIf=\"DisplayLayout == 'form'\">{{ EvaluatedModel }}</ng-container>\r\n <div *ngIf=\"DisplayLayout == 'inline'\" class=\"app-inline\">{{ EvaluatedModel }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n</ng-container>\r\n\r\n<div *ngIf=\"FormLayout && (!DisplayMode || (DisplayLayout != 'hidden' && DisplayCondition))\" class=\"{{FormGroupClass + (Last ? ' app-margin-bottom-0 app-margin-right-0 ' : '') + (DisplayLayout == 'inline' && DisplayMode ? (' app-inline-block ' + (!Last ? 'app-margin-right-10' : '')) : ' form-group row')}}\">\r\n <label class=\"col-md-{{(DisplayMode && DisplayLayout == 'inline' ? 'none app-bold app-margin-bottom-0' : LabelColWidth) + (DisplayMode ? ' app-bold' : ' m-t-5') }}\">{{Label}}{{Required && !DisplayMode ? '*' : ''}}{{Label ? \":\" : \"\"}}</label>\r\n <span *ngIf=\"DisplayMode && DisplayLayout == 'inline' && InlineSeparator != ''\">{{InlineSeparator}}</span>\r\n <div class=\"col-md-{{DisplayMode && DisplayLayout == 'inline' ? 'none app-inline-block' : InputColWidth}}\">\r\n <ng-container *ngIf=\"DisplayMode && !DisplayModeTemplate\">{{ EvaluatedModel }}</ng-container>\r\n <ng-container *ngIf=\"DisplayMode && DisplayModeTemplate\"><ng-container *ngTemplateOutlet=\"DisplayModeTemplate, context: { $implicit: EvaluatedModel }\"></ng-container></ng-container>\r\n <div [hidden]=\"DisplayMode\"><ng-container *ngTemplateOutlet=\"controlTemplate\"></ng-container></div>\r\n </div>\r\n <div class=\"clearfix\"></div>\r\n</div>\r\n<!----------------------------------------------------------------------------------------------------------->\r\n\r\n<ng-template #controlTemplate>\r\n <mat-form-field floatLabel=\"never\" appearance=\"{{FieldAppearence}}\" class=\"mat-full-width mat-no-border-top mat-height-fixed\">\r\n <mat-label [class.app-margin-left-25]=\"HasPrefix\" *ngIf=\"Placeholder && FloatingLabel\">{{Placeholder}}</mat-label>\r\n <!--Prefisso-->\r\n <ng-container *ngIf=\"HasPrefix\">\r\n <button type=\"button\"\r\n class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-prefix\"\r\n matPrefix (click)=\"onPrefixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"prefix\"></ng-container>\r\n </button>\r\n </ng-container>\r\n <!--Input-->\r\n <input matInput\r\n #baseInput=\"ngModel\"\r\n #htmlInput\r\n [type]=\"Password ? 'password' : 'text'\"\r\n triggers=\"\"\r\n placement=\"top\"\r\n autocomplete=\"off\"\r\n name=\"base-input\"\r\n class=\"form-control\"\r\n id=\"{{GeneratedName}}\"\r\n [class.app-margin-left-25]=\"HasPrefix\"\r\n [class.mat-input-with-suffix]=\"HasSuffix || Password\"\r\n [(ngModel)]=\"Model\"\r\n [class.checking-field]=\"!Validation\"\r\n [readonly]=\"Frozen\"\r\n [disabled]=\"Readonly\"\r\n [placeholder]=\"FloatingLabel ? undefined : Placeholder\"\r\n (focus)=\"focused($event);\"\r\n (ngModelChange)=\"changed()\"\r\n (keyup)=\"($event.keyCode == 13 || $event.keyCode == 27) && finalized();\"\r\n (blur)=\"finalized();\"\r\n >\r\n <ng-container *ngIf=\"HasSuffix || Password\">\r\n <ng-container *ngIf=\"!Password\">\r\n <button type=\"button\"\r\n class=\"mat-button mat-icon-button mat-button-base mat-icon-button-override mat-icon-button-override-suffix\"\r\n matSuffix (click)=\"onSuffixAction.emit(); $event.stopPropagation(); $event.preventDefault();\">\r\n <ng-container *ngTemplateOutlet=\"suffix\"></ng-container>\r\n </button>\r\n </ng-container>\r\n <!--Password-->\r\n <span class=\"form-input-suffix\" *ngIf=\"Password\">\r\n <ng-container *ngIf=\"Password\" matSuffix>\r\n <a *ngIf=\"ShowPassword\" class=\"fa fa-eye-slash app-fs-16 app-pointer\" (click)=\"onShowHidePassword($event)\"></a>\r\n <a *ngIf=\"!ShowPassword\" class=\"fa fa-eye app-fs-16 app-pointer\" (click)=\"onShowHidePassword($event)\"></a>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n </mat-form-field>\r\n</ng-template>",
3360
3465
  changeDetection: core.ChangeDetectionStrategy.OnPush
3361
3466
  },] }
3362
3467
  ];
@@ -3419,7 +3524,7 @@
3419
3524
  *
3420
3525
  * Si consiglia di mantenere il default
3421
3526
  */
3422
- _this.EmptyFieldValue = '-2';
3527
+ _this.EmptyFieldValue = '-2000';
3423
3528
  /** Se **true** rimuove il simbolino di validazione (croce rossa o tick verde) */
3424
3529
  _this.ShowValidationSymbol = true;
3425
3530
  /** Template per la visualizzazione delle opzioni */