@seniorsistemas/angular-components 17.8.11 → 17.8.12
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/seniorsistemas-angular-components.umd.js +20 -0
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/file-upload/file-upload.component.d.ts +2 -0
- package/components/file-upload/models/validate-errors.d.ts +1 -0
- package/esm2015/components/file-upload/file-upload.component.js +20 -1
- package/esm2015/components/file-upload/models/validate-errors.js +2 -1
- package/esm5/components/file-upload/file-upload.component.js +21 -2
- package/esm5/components/file-upload/models/validate-errors.js +2 -1
- package/fesm2015/seniorsistemas-angular-components.js +20 -0
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +20 -0
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -6379,6 +6379,7 @@
|
|
|
6379
6379
|
(function (ValidateErrors) {
|
|
6380
6380
|
ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
|
|
6381
6381
|
ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
|
|
6382
|
+
ValidateErrors["MAX_COMBINED_FILE_SIZE"] = "MAX_COMBINED_FILE_SIZE";
|
|
6382
6383
|
ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
|
|
6383
6384
|
})(exports.ValidateErrors || (exports.ValidateErrors = {}));
|
|
6384
6385
|
|
|
@@ -6466,6 +6467,14 @@
|
|
|
6466
6467
|
this.clearFileInput();
|
|
6467
6468
|
return;
|
|
6468
6469
|
}
|
|
6470
|
+
if (this.isFileCombinedSizeExceeded(files)) {
|
|
6471
|
+
this.validateErrors.emit({
|
|
6472
|
+
files: files,
|
|
6473
|
+
validation: exports.ValidateErrors.MAX_COMBINED_FILE_SIZE,
|
|
6474
|
+
});
|
|
6475
|
+
this.clearFileInput();
|
|
6476
|
+
return;
|
|
6477
|
+
}
|
|
6469
6478
|
try {
|
|
6470
6479
|
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
6471
6480
|
var file = files_1_1.value;
|
|
@@ -6534,6 +6543,14 @@
|
|
|
6534
6543
|
}
|
|
6535
6544
|
return this.files.length + files.length > this.fileLimit;
|
|
6536
6545
|
};
|
|
6546
|
+
FileUploadComponent.prototype.isFileCombinedSizeExceeded = function (files) {
|
|
6547
|
+
if (!this.maxCombinedFileSize) {
|
|
6548
|
+
return false;
|
|
6549
|
+
}
|
|
6550
|
+
var filesList = __spread(files, this.files);
|
|
6551
|
+
var combinedSize = filesList.reduce(function (combinedSize, file) { return combinedSize + file.size; }, 0);
|
|
6552
|
+
return combinedSize > this.maxCombinedFileSize;
|
|
6553
|
+
};
|
|
6537
6554
|
FileUploadComponent.prototype.isFileSizeExceeded = function (file) {
|
|
6538
6555
|
if (!this.maxFileSize) {
|
|
6539
6556
|
return false;
|
|
@@ -6610,6 +6627,9 @@
|
|
|
6610
6627
|
__decorate([
|
|
6611
6628
|
core.Input()
|
|
6612
6629
|
], FileUploadComponent.prototype, "maxFileSize", void 0);
|
|
6630
|
+
__decorate([
|
|
6631
|
+
core.Input()
|
|
6632
|
+
], FileUploadComponent.prototype, "maxCombinedFileSize", void 0);
|
|
6613
6633
|
__decorate([
|
|
6614
6634
|
core.Input()
|
|
6615
6635
|
], FileUploadComponent.prototype, "fileLimit", void 0);
|