@esfaenza/forms-and-validations 11.2.140 → 11.2.142
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 +20 -5
- 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-file/form-file.component.js +17 -5
- package/esm2015/lib/forms/form-select/form-select.component.js +6 -3
- package/fesm2015/esfaenza-forms-and-validations.js +21 -6
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/form-file/form-file.component.d.ts +5 -2
- package/lib/forms/form-select/form-select.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -2457,14 +2457,17 @@
|
|
|
2457
2457
|
var FormFileComponent = /** @class */ (function (_super) {
|
|
2458
2458
|
__extends(FormFileComponent, _super);
|
|
2459
2459
|
/** @ignore Costruttore */
|
|
2460
|
-
function FormFileComponent(cdr, utiExts, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, lc, FAV_DEBUG_MODE) {
|
|
2460
|
+
function FormFileComponent(msgs, cdr, utiExts, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, lc, FAV_DEBUG_MODE) {
|
|
2461
2461
|
var _this = _super.call(this, cdr, ngControl, _validators, ac, AppContext, ACO_CUSTOMKEY, FAV_DEBUG_MODE) || this;
|
|
2462
|
+
_this.msgs = msgs;
|
|
2462
2463
|
_this.utiExts = utiExts;
|
|
2463
2464
|
_this.lc = lc;
|
|
2464
2465
|
/** Permette di caricare file multipli */
|
|
2465
2466
|
_this.Multiple = false;
|
|
2466
2467
|
/** Permette di scaricare l'eventuale file selezionato */
|
|
2467
2468
|
_this.AllowDownload = true;
|
|
2469
|
+
/** Controllo sulla dimensione di ogni singolo file in Byte. 0 -> nessun limite */
|
|
2470
|
+
_this.MaxSize = 0;
|
|
2468
2471
|
//Per questo componente non posso permettermi che il modello sia nullo
|
|
2469
2472
|
_this.Model = new AppFile();
|
|
2470
2473
|
return _this;
|
|
@@ -2509,8 +2512,15 @@
|
|
|
2509
2512
|
model.nativefiles = [];
|
|
2510
2513
|
}
|
|
2511
2514
|
else {
|
|
2512
|
-
for (var i = 0; i < ne.files.length; i++)
|
|
2513
|
-
|
|
2515
|
+
for (var i = 0; i < ne.files.length; i++) {
|
|
2516
|
+
var file = ne.files.item(i);
|
|
2517
|
+
if (this.MaxSize > 0 && file.size > this.MaxSize) {
|
|
2518
|
+
this.msgs.simpleError("Il file " + file.name + " eccede la dimensione massima " + this.MaxSize + " B");
|
|
2519
|
+
this.fileChange(true);
|
|
2520
|
+
return;
|
|
2521
|
+
}
|
|
2522
|
+
files.push();
|
|
2523
|
+
}
|
|
2514
2524
|
if (ne.files.length == 1)
|
|
2515
2525
|
model.filename = ne.files[0].name;
|
|
2516
2526
|
if (ne.files.length > 1)
|
|
@@ -2540,6 +2550,7 @@
|
|
|
2540
2550
|
},] }
|
|
2541
2551
|
];
|
|
2542
2552
|
FormFileComponent.ctorParameters = function () { return [
|
|
2553
|
+
{ type: extensions.MessageService },
|
|
2543
2554
|
{ type: core.ChangeDetectorRef },
|
|
2544
2555
|
{ type: extensions.UtilityService },
|
|
2545
2556
|
{ type: forms.NgControl, decorators: [{ type: core.Optional }, { type: core.Self }] },
|
|
@@ -2553,6 +2564,7 @@
|
|
|
2553
2564
|
FormFileComponent.propDecorators = {
|
|
2554
2565
|
Multiple: [{ type: core.Input }],
|
|
2555
2566
|
AllowDownload: [{ type: core.Input }],
|
|
2567
|
+
MaxSize: [{ type: core.Input }],
|
|
2556
2568
|
inputEl: [{ type: core.ViewChild, args: ["fileInput", { static: false },] }]
|
|
2557
2569
|
};
|
|
2558
2570
|
|
|
@@ -3370,6 +3382,8 @@
|
|
|
3370
3382
|
_this.EmptyFieldValue = '-2';
|
|
3371
3383
|
/** Se **true** rimuove il simbolino di validazione (croce rossa o tick verde) */
|
|
3372
3384
|
_this.ShowValidationSymbol = true;
|
|
3385
|
+
/** Template per la visualizzazione delle opzioni */
|
|
3386
|
+
_this.OptionTemplate = null;
|
|
3373
3387
|
return _this;
|
|
3374
3388
|
}
|
|
3375
3389
|
/** @ignore */
|
|
@@ -3467,7 +3481,7 @@
|
|
|
3467
3481
|
{ type: core.Component, args: [{
|
|
3468
3482
|
selector: "form-select",
|
|
3469
3483
|
providers: [{ provide: localizations.LocalizationService, useClass: FormSelectComponentLoc }],
|
|
3470
|
-
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\r\n <!-- Select vuota per quando non ho Sorgenti dati da cui selezionare. Uguale identica alla piena ma senza option\r\n Purtroppo devono essere due componenti distinti perch\u00E9 una select una volta creata non riesce pi\u00F9 ad adattarsi ai cambi di options -->\r\n <val-select *ngIf=\"!BoundSource || BoundSource.length == 0\"\r\n [FocusSubject]=\"FocusSubject\" [FieldAppearence]=\"FieldAppearence\"\r\n [required]=\"Required ? 'required' : null\"\r\n [noValidate]=\"!Validation\"\r\n [readonly]=\"Readonly\"\r\n [label]=\"SelectLabel\"\r\n [validationFailed]=\"FailedValidationMessage\"\r\n [placeholder]=\"Required ? ((RequiredPlaceholder != null ? RequiredPlaceholder : ('Select' | localize : lc) + '...')) : Placeholder\"\r\n [placeHolderValue]=\"PlaceholderValue\"\r\n [submitted]=\"Form?.submitted\"\r\n [emptyFieldValue]=\"Required || Placeholder || SelectLabel ? EmptyFieldValue : ''\"\r\n [(ngModel)]=\"Model\"\r\n [showValidationSymbol]=\"ShowValidationSymbol\"\r\n [id]=\"GeneratedName\"\r\n name=\"{{GeneratedName}}_zero\"\r\n (inputChange)=\"Model = $event.value == EmptyFieldValue ? (Required? PlaceholderValue : '') : $event.value; changed($event.internal);\"\r\n (inputFocus)=\"focused($event);\"\r\n #validationControl=\"ngModel\">\r\n </val-select>\r\n\r\n <!-- Select vera e propria per quando arrivano i dati -->\r\n <val-select *ngIf=\"BoundSource && BoundSource.length > 0\"\r\n [FocusSubject]=\"FocusSubject\" [FieldAppearence]=\"FieldAppearence\"\r\n [required]=\"Required ? 'required' : null\"\r\n [noValidate]=\"!Validation\"\r\n [readonly]=\"Readonly\"\r\n [label]=\"SelectLabel\"\r\n [validationFailed]=\"FailedValidationMessage\"\r\n [showValidationSymbol]=\"ShowValidationSymbol\"\r\n [placeholder]=\"Required ? ((RequiredPlaceholder != null ? RequiredPlaceholder : ('Select' | localize : lc) + '...')) : Placeholder\"\r\n [placeHolderValue]=\"PlaceholderValue\"\r\n [submitted]=\"Form?.submitted\"\r\n [emptyFieldValue]=\"Required || Placeholder || SelectLabel ? EmptyFieldValue : ''\"\r\n [(ngModel)]=\"Model\"\r\n [id]=\"GeneratedName\"\r\n name=\"{{GeneratedName}}_filled\"\r\n (inputChange)=\"Model = $event.value == EmptyFieldValue ? (Required? PlaceholderValue : '') : $event.value; changed($event.internal);\"\r\n (inputFocus)=\"focused($event);\"\r\n (inputFinalized)=\"finalized()\"\r\n #validationControl=\"ngModel\">\r\n <option *ngFor=\"let obj of BoundSource\" [value]=\"obj.id\">{{obj.description}}</option>\r\n </val-select>\r\n</ng-template>",
|
|
3484
|
+
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\r\n <!-- Select vuota per quando non ho Sorgenti dati da cui selezionare. Uguale identica alla piena ma senza option\r\n Purtroppo devono essere due componenti distinti perch\u00E9 una select una volta creata non riesce pi\u00F9 ad adattarsi ai cambi di options -->\r\n <val-select *ngIf=\"!BoundSource || BoundSource.length == 0\"\r\n [FocusSubject]=\"FocusSubject\" [FieldAppearence]=\"FieldAppearence\"\r\n [required]=\"Required ? 'required' : null\"\r\n [noValidate]=\"!Validation\"\r\n [readonly]=\"Readonly\"\r\n [label]=\"SelectLabel\"\r\n [validationFailed]=\"FailedValidationMessage\"\r\n [placeholder]=\"Required ? ((RequiredPlaceholder != null ? RequiredPlaceholder : ('Select' | localize : lc) + '...')) : Placeholder\"\r\n [placeHolderValue]=\"PlaceholderValue\"\r\n [submitted]=\"Form?.submitted\"\r\n [emptyFieldValue]=\"Required || Placeholder || SelectLabel ? EmptyFieldValue : ''\"\r\n [(ngModel)]=\"Model\"\r\n [showValidationSymbol]=\"ShowValidationSymbol\"\r\n [id]=\"GeneratedName\"\r\n name=\"{{GeneratedName}}_zero\"\r\n (inputChange)=\"Model = $event.value == EmptyFieldValue ? (Required? PlaceholderValue : '') : $event.value; changed($event.internal);\"\r\n (inputFocus)=\"focused($event);\"\r\n #validationControl=\"ngModel\">\r\n </val-select>\r\n\r\n <!-- Select vera e propria per quando arrivano i dati -->\r\n <val-select *ngIf=\"BoundSource && BoundSource.length > 0\"\r\n [FocusSubject]=\"FocusSubject\" [FieldAppearence]=\"FieldAppearence\"\r\n [required]=\"Required ? 'required' : null\"\r\n [noValidate]=\"!Validation\"\r\n [readonly]=\"Readonly\"\r\n [label]=\"SelectLabel\"\r\n [validationFailed]=\"FailedValidationMessage\"\r\n [showValidationSymbol]=\"ShowValidationSymbol\"\r\n [placeholder]=\"Required ? ((RequiredPlaceholder != null ? RequiredPlaceholder : ('Select' | localize : lc) + '...')) : Placeholder\"\r\n [placeHolderValue]=\"PlaceholderValue\"\r\n [submitted]=\"Form?.submitted\"\r\n [emptyFieldValue]=\"Required || Placeholder || SelectLabel ? EmptyFieldValue : ''\"\r\n [(ngModel)]=\"Model\"\r\n [id]=\"GeneratedName\"\r\n name=\"{{GeneratedName}}_filled\"\r\n (inputChange)=\"Model = $event.value == EmptyFieldValue ? (Required? PlaceholderValue : '') : $event.value; changed($event.internal);\"\r\n (inputFocus)=\"focused($event);\"\r\n (inputFinalized)=\"finalized()\"\r\n #validationControl=\"ngModel\">\r\n <option *ngFor=\"let obj of BoundSource\" [value]=\"obj.id\">\r\n <ng-container *ngIf=\"OptionTemplate\">\r\n <ng-container *ngTemplateOutlet=\"OptionTemplate; context: { $implicit : obj }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!OptionTemplate\">{{obj.description}}</ng-container>\r\n </option>\r\n </val-select>\r\n</ng-template>",
|
|
3471
3485
|
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
3472
3486
|
},] }
|
|
3473
3487
|
];
|
|
@@ -3486,7 +3500,8 @@
|
|
|
3486
3500
|
PlaceholderValue: [{ type: core.Input }],
|
|
3487
3501
|
RequiredPlaceholder: [{ type: core.Input }],
|
|
3488
3502
|
EmptyFieldValue: [{ type: core.Input }],
|
|
3489
|
-
ShowValidationSymbol: [{ type: core.Input }]
|
|
3503
|
+
ShowValidationSymbol: [{ type: core.Input }],
|
|
3504
|
+
OptionTemplate: [{ type: core.Input }]
|
|
3490
3505
|
};
|
|
3491
3506
|
|
|
3492
3507
|
/**
|