@esfaenza/forms-and-validations 11.2.141 → 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 +15 -3
- 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/fesm2015/esfaenza-forms-and-validations.js +16 -4
- package/fesm2015/esfaenza-forms-and-validations.js.map +1 -1
- package/lib/forms/form-file/form-file.component.d.ts +5 -2
- 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
|
|