@sumaris-net/ngx-components 1.11.0 → 1.11.3
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/sumaris-net.ngx-components.umd.js +15 -7
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/shared/upload-file/upload-file.component.js +16 -8
- package/esm2015/src/app/shared/upload-file/upload-file.model.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +15 -7
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/upload-file/upload-file.model.d.ts +1 -1
|
@@ -18114,16 +18114,24 @@
|
|
|
18114
18114
|
return rxjs.of(file);
|
|
18115
18115
|
})
|
|
18116
18116
|
.map(function (file$) { return file$.pipe(operators.tap(function (file) { return console.debug("[upload-file] " + file.name + ": uploading..."); }), operators.switchMap(function (file) { return _this.uploadFn(file).pipe(operators.map(function (event) {
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
|
|
18117
|
+
// Progress event
|
|
18118
|
+
if ((event === null || event === void 0 ? void 0 : event.type) === i2$1.HttpEventType.UploadProgress || event.type === i2$1.HttpEventType.User) {
|
|
18119
|
+
var total = event.total || 1;
|
|
18120
|
+
var loaded = event.loaded || 0;
|
|
18121
|
+
file.progress = Math.min(1, loaded / total);
|
|
18120
18122
|
}
|
|
18123
|
+
// Response event
|
|
18121
18124
|
else if (event instanceof i2$1.HttpResponse || event instanceof FileResponse) {
|
|
18122
|
-
var
|
|
18123
|
-
file.finalName =
|
|
18125
|
+
var body = event.body;
|
|
18126
|
+
file.finalName = body === null || body === void 0 ? void 0 : body.finalName;
|
|
18124
18127
|
file.progress = 1;
|
|
18125
|
-
var message =
|
|
18126
|
-
console.
|
|
18128
|
+
var message = (body === null || body === void 0 ? void 0 : body.message) || event.statusText || 'OK';
|
|
18129
|
+
console.debug("[upload-file] " + file.name + ": " + message
|
|
18130
|
+
+ (file.finalName ? " (finalName: " + file.finalName + ")" : ''));
|
|
18131
|
+
}
|
|
18132
|
+
else {
|
|
18133
|
+
// Other events
|
|
18134
|
+
console.warn('[upload-file] Unknown event, returned by uploadFn\'s observable:', event);
|
|
18127
18135
|
}
|
|
18128
18136
|
return file;
|
|
18129
18137
|
}), operators.catchError(function (err) {
|