@esfaenza/forms-and-validations 11.2.116 → 11.2.117
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 +13 -2
- package/bundles/esfaenza-forms-and-validations.umd.js.map +1 -1
- package/esfaenza-forms-and-validations.metadata.json +1 -1
- package/esm2015/lib/forms/form-autocomplete/form-autocomplete.component.js +2 -2
- package/esm2015/lib/forms/form-file/form-file.component.js +13 -2
- package/fesm2015/esfaenza-forms-and-validations.js +13 -2
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/form-file/form-file.component.d.ts +4 -2
- package/package.json +1 -1
|
@@ -2437,6 +2437,17 @@
|
|
|
2437
2437
|
_this.Model = new AppFile();
|
|
2438
2438
|
return _this;
|
|
2439
2439
|
}
|
|
2440
|
+
FormFileComponent.prototype.ngOnInit = function () {
|
|
2441
|
+
this._validators.push(this);
|
|
2442
|
+
this.ngControl.control.setValidators(this._validators);
|
|
2443
|
+
this.ngControl.control.updateValueAndValidity();
|
|
2444
|
+
};
|
|
2445
|
+
FormFileComponent.prototype.validate = function (control) {
|
|
2446
|
+
if (this.Required && !this.Model.filename)
|
|
2447
|
+
return { required: true };
|
|
2448
|
+
else
|
|
2449
|
+
return null;
|
|
2450
|
+
};
|
|
2440
2451
|
/** @ignore */
|
|
2441
2452
|
FormFileComponent.prototype.writeValue = function (obj) {
|
|
2442
2453
|
var model = obj == null ? new AppFile() : obj;
|
|
@@ -2487,7 +2498,7 @@
|
|
|
2487
2498
|
{ type: core.Component, args: [{
|
|
2488
2499
|
selector: "form-file",
|
|
2489
2500
|
providers: [{ provide: localizations.LocalizationService, useClass: FormFileComponentLoc }],
|
|
2490
|
-
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 <div class=\"input-group file-upload\">\r\n <input type=\"file\" (change)=\"fileChange()\" id=\"{{GeneratedName}}\" #fileInput class=\"file-upload-btn app-pointer\" [multiple]=\"Multiple ? true : null\" />\r\n <input type=\"text\" [class.frm-padding-left-22]=\"AllowDownload && Model.filename && Model.fileb64\" class=\"form-control checking-field\" placeholder=\"{{'Select a file' | localize : lc}}...\" [(ngModel)]=\"Model.filename\" name=\"dsfile\" #validationControl=\"ngModel\"
|
|
2501
|
+
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 <div class=\"input-group file-upload\">\r\n <input type=\"file\" (change)=\"fileChange()\" id=\"{{GeneratedName}}\" #fileInput class=\"file-upload-btn app-pointer\" [multiple]=\"Multiple ? true : null\" />\r\n <input type=\"text\" [class.frm-padding-left-22]=\"AllowDownload && Model.filename && Model.fileb64\" class=\"form-control checking-field\" placeholder=\"{{'Select a file' | localize : lc}}...\" [(ngModel)]=\"Model.filename\" name=\"dsfile\" #validationControl=\"ngModel\" />\r\n\r\n <a class=\"fa fa-download app-pointer app-input-icon\" *ngIf=\"AllowDownload && Model.filename && Model.fileb64\" (click)=\"downloadAttachment()\"></a>\r\n <i class=\"fa fa-times delete-file\" (click)=\"fileChange(true)\" *ngIf=\"Model.filename\"></i>\r\n <span class=\"input-group-btn\">\r\n <button class=\"btn btn-primary btn-file-upload\" type=\"button\"><i class=\"fa fa-upload\"></i></button>\r\n </span>\r\n </div>\r\n</ng-template>",
|
|
2491
2502
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
2492
2503
|
styles: [".frm-padding-left-22{padding-left:22px}"]
|
|
2493
2504
|
},] }
|
|
@@ -3758,7 +3769,7 @@
|
|
|
3758
3769
|
this.ignoreNextWriteValue = true;
|
|
3759
3770
|
if (forcedValue == "" && this.Multi)
|
|
3760
3771
|
this.Model = "";
|
|
3761
|
-
var selecteds = this.Model ? this.Model.split(',') : [];
|
|
3772
|
+
var selecteds = forcedValue ? [forcedValue] : this.Model ? (this.Model.Multi ? this.Model.split(',') : [this.Model]) : [];
|
|
3762
3773
|
this.EvaluatedModel = selecteds.map(function (t) { var _a; return _this.BoundSource && _this.BoundSource.length > 0 ? (_a = _this.BoundSource.find(function (t) { return t.id == _this.Model; })) === null || _a === void 0 ? void 0 : _a.description : ""; }).join(', ');
|
|
3763
3774
|
_super.prototype.changed.call(this, forcedValue, markForCheck);
|
|
3764
3775
|
};
|