@seniorsistemas/angular-components 15.4.1 → 16.0.1
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 +21 -9
- 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 +3 -2
- package/components/file-upload/models/index.d.ts +1 -0
- package/components/file-upload/models/uploadError.d.ts +6 -0
- package/esm2015/components/file-upload/file-upload.component.js +22 -10
- package/esm2015/components/file-upload/models/index.js +1 -1
- package/esm2015/components/file-upload/models/uploadError.js +1 -0
- package/esm5/components/file-upload/file-upload.component.js +22 -10
- package/esm5/components/file-upload/models/index.js +1 -1
- package/esm5/components/file-upload/models/uploadError.js +1 -0
- package/fesm2015/seniorsistemas-angular-components.js +21 -9
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +21 -9
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -3003,7 +3003,7 @@
|
|
|
3003
3003
|
this.removeFile = new core.EventEmitter();
|
|
3004
3004
|
this.cancelUpload = new core.EventEmitter();
|
|
3005
3005
|
this.downloadFile = new core.EventEmitter();
|
|
3006
|
-
this.
|
|
3006
|
+
this.validateErrors = new core.EventEmitter();
|
|
3007
3007
|
this._files = [];
|
|
3008
3008
|
this.ngUsubscribe = new rxjs.Subject();
|
|
3009
3009
|
this.inputValue = "";
|
|
@@ -3046,18 +3046,28 @@
|
|
|
3046
3046
|
this.files = [];
|
|
3047
3047
|
}
|
|
3048
3048
|
if (this.isFileLimitExceeded(files)) {
|
|
3049
|
-
this.
|
|
3049
|
+
this.validateErrors.emit({
|
|
3050
|
+
files: files,
|
|
3051
|
+
validation: exports.ValidateErrors.MAX_FILE_LIMIT,
|
|
3052
|
+
});
|
|
3053
|
+
this.clearFileInput();
|
|
3050
3054
|
return;
|
|
3051
3055
|
}
|
|
3052
3056
|
try {
|
|
3053
3057
|
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
3054
3058
|
var file = files_1_1.value;
|
|
3055
3059
|
if (this.isUnsupportedFileExtension(file)) {
|
|
3056
|
-
this.
|
|
3060
|
+
this.validateErrors.emit({
|
|
3061
|
+
files: [file],
|
|
3062
|
+
validation: exports.ValidateErrors.UNSUPPORTED_EXTENSION,
|
|
3063
|
+
});
|
|
3057
3064
|
continue;
|
|
3058
3065
|
}
|
|
3059
3066
|
if (this.isFileSizeExceeded(file)) {
|
|
3060
|
-
this.
|
|
3067
|
+
this.validateErrors.emit({
|
|
3068
|
+
files: [file],
|
|
3069
|
+
validation: exports.ValidateErrors.MAX_FILE_SIZE,
|
|
3070
|
+
});
|
|
3061
3071
|
continue;
|
|
3062
3072
|
}
|
|
3063
3073
|
newFiles.push(file);
|
|
@@ -3075,8 +3085,8 @@
|
|
|
3075
3085
|
this.uploadHandler.emit({
|
|
3076
3086
|
files: newFiles,
|
|
3077
3087
|
});
|
|
3078
|
-
this.inputUpload.nativeElement.value = "";
|
|
3079
3088
|
}
|
|
3089
|
+
this.clearFileInput();
|
|
3080
3090
|
};
|
|
3081
3091
|
FileUploadComponent.prototype.onRemoveFile = function (file) {
|
|
3082
3092
|
var fileIndex = this.files.indexOf(file);
|
|
@@ -3090,6 +3100,7 @@
|
|
|
3090
3100
|
if (removedFiles.length) {
|
|
3091
3101
|
this.cancelUpload.emit(index);
|
|
3092
3102
|
}
|
|
3103
|
+
this.clearFileInput();
|
|
3093
3104
|
};
|
|
3094
3105
|
FileUploadComponent.prototype.onDowloadFile = function (index) {
|
|
3095
3106
|
this.downloadFile.emit({
|
|
@@ -3120,12 +3131,13 @@
|
|
|
3120
3131
|
var _a;
|
|
3121
3132
|
if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
3122
3133
|
var extension = file.name.split(".").pop().toLowerCase();
|
|
3123
|
-
|
|
3124
|
-
return true;
|
|
3125
|
-
}
|
|
3134
|
+
return !this.supportedExtensions.includes(extension);
|
|
3126
3135
|
}
|
|
3127
3136
|
return false;
|
|
3128
3137
|
};
|
|
3138
|
+
FileUploadComponent.prototype.clearFileInput = function () {
|
|
3139
|
+
this.inputUpload.nativeElement.value = null;
|
|
3140
|
+
};
|
|
3129
3141
|
var FileUploadComponent_1;
|
|
3130
3142
|
FileUploadComponent.nextId = 0;
|
|
3131
3143
|
FileUploadComponent.ctorParameters = function () { return [
|
|
@@ -3205,7 +3217,7 @@
|
|
|
3205
3217
|
], FileUploadComponent.prototype, "downloadFile", void 0);
|
|
3206
3218
|
__decorate([
|
|
3207
3219
|
core.Output()
|
|
3208
|
-
], FileUploadComponent.prototype, "
|
|
3220
|
+
], FileUploadComponent.prototype, "validateErrors", void 0);
|
|
3209
3221
|
__decorate([
|
|
3210
3222
|
core.HostListener("window:resize")
|
|
3211
3223
|
], FileUploadComponent.prototype, "onResize", null);
|