@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
|
@@ -2830,7 +2830,7 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
2830
2830
|
this.removeFile = new EventEmitter();
|
|
2831
2831
|
this.cancelUpload = new EventEmitter();
|
|
2832
2832
|
this.downloadFile = new EventEmitter();
|
|
2833
|
-
this.
|
|
2833
|
+
this.validateErrors = new EventEmitter();
|
|
2834
2834
|
this._files = [];
|
|
2835
2835
|
this.ngUsubscribe = new Subject();
|
|
2836
2836
|
this.inputValue = "";
|
|
@@ -2873,18 +2873,28 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
2873
2873
|
this.files = [];
|
|
2874
2874
|
}
|
|
2875
2875
|
if (this.isFileLimitExceeded(files)) {
|
|
2876
|
-
this.
|
|
2876
|
+
this.validateErrors.emit({
|
|
2877
|
+
files: files,
|
|
2878
|
+
validation: ValidateErrors.MAX_FILE_LIMIT,
|
|
2879
|
+
});
|
|
2880
|
+
this.clearFileInput();
|
|
2877
2881
|
return;
|
|
2878
2882
|
}
|
|
2879
2883
|
try {
|
|
2880
2884
|
for (var files_1 = __values(files), files_1_1 = files_1.next(); !files_1_1.done; files_1_1 = files_1.next()) {
|
|
2881
2885
|
var file = files_1_1.value;
|
|
2882
2886
|
if (this.isUnsupportedFileExtension(file)) {
|
|
2883
|
-
this.
|
|
2887
|
+
this.validateErrors.emit({
|
|
2888
|
+
files: [file],
|
|
2889
|
+
validation: ValidateErrors.UNSUPPORTED_EXTENSION,
|
|
2890
|
+
});
|
|
2884
2891
|
continue;
|
|
2885
2892
|
}
|
|
2886
2893
|
if (this.isFileSizeExceeded(file)) {
|
|
2887
|
-
this.
|
|
2894
|
+
this.validateErrors.emit({
|
|
2895
|
+
files: [file],
|
|
2896
|
+
validation: ValidateErrors.MAX_FILE_SIZE,
|
|
2897
|
+
});
|
|
2888
2898
|
continue;
|
|
2889
2899
|
}
|
|
2890
2900
|
newFiles.push(file);
|
|
@@ -2902,8 +2912,8 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
2902
2912
|
this.uploadHandler.emit({
|
|
2903
2913
|
files: newFiles,
|
|
2904
2914
|
});
|
|
2905
|
-
this.inputUpload.nativeElement.value = "";
|
|
2906
2915
|
}
|
|
2916
|
+
this.clearFileInput();
|
|
2907
2917
|
};
|
|
2908
2918
|
FileUploadComponent.prototype.onRemoveFile = function (file) {
|
|
2909
2919
|
var fileIndex = this.files.indexOf(file);
|
|
@@ -2917,6 +2927,7 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
2917
2927
|
if (removedFiles.length) {
|
|
2918
2928
|
this.cancelUpload.emit(index);
|
|
2919
2929
|
}
|
|
2930
|
+
this.clearFileInput();
|
|
2920
2931
|
};
|
|
2921
2932
|
FileUploadComponent.prototype.onDowloadFile = function (index) {
|
|
2922
2933
|
this.downloadFile.emit({
|
|
@@ -2947,12 +2958,13 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
2947
2958
|
var _a;
|
|
2948
2959
|
if ((_a = this.supportedExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
2949
2960
|
var extension = file.name.split(".").pop().toLowerCase();
|
|
2950
|
-
|
|
2951
|
-
return true;
|
|
2952
|
-
}
|
|
2961
|
+
return !this.supportedExtensions.includes(extension);
|
|
2953
2962
|
}
|
|
2954
2963
|
return false;
|
|
2955
2964
|
};
|
|
2965
|
+
FileUploadComponent.prototype.clearFileInput = function () {
|
|
2966
|
+
this.inputUpload.nativeElement.value = null;
|
|
2967
|
+
};
|
|
2956
2968
|
var FileUploadComponent_1;
|
|
2957
2969
|
FileUploadComponent.nextId = 0;
|
|
2958
2970
|
FileUploadComponent.ctorParameters = function () { return [
|
|
@@ -3032,7 +3044,7 @@ var FileUploadComponent = /** @class */ (function () {
|
|
|
3032
3044
|
], FileUploadComponent.prototype, "downloadFile", void 0);
|
|
3033
3045
|
__decorate([
|
|
3034
3046
|
Output()
|
|
3035
|
-
], FileUploadComponent.prototype, "
|
|
3047
|
+
], FileUploadComponent.prototype, "validateErrors", void 0);
|
|
3036
3048
|
__decorate([
|
|
3037
3049
|
HostListener("window:resize")
|
|
3038
3050
|
], FileUploadComponent.prototype, "onResize", null);
|