@sumaris-net/ngx-components 1.11.0-rc1 → 1.11.0

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.
@@ -17936,6 +17936,23 @@
17936
17936
  { type: i1$2.TranslateService }
17937
17937
  ]; };
17938
17938
 
17939
+ var UploadFile = /** @class */ (function (_super) {
17940
+ __extends(UploadFile, _super);
17941
+ function UploadFile() {
17942
+ return _super !== null && _super.apply(this, arguments) || this;
17943
+ }
17944
+ return UploadFile;
17945
+ }(File));
17946
+ var FileResponse = /** @class */ (function () {
17947
+ function FileResponse(init) {
17948
+ this.type = i2$1.HttpEventType.Response;
17949
+ this.body = isNotNil(init === null || init === void 0 ? void 0 : init.body) ? init.body : null;
17950
+ this.status = (init === null || init === void 0 ? void 0 : init.status) || 0;
17951
+ this.statusText = (init === null || init === void 0 ? void 0 : init.statusText) || 'OK';
17952
+ }
17953
+ return FileResponse;
17954
+ }());
17955
+
17939
17956
  var UploadFileComponent = /** @class */ (function () {
17940
17957
  function UploadFileComponent(cd, translate) {
17941
17958
  this.cd = cd;
@@ -18098,13 +18115,15 @@
18098
18115
  })
18099
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) {
18100
18117
  if (event.type === i2$1.HttpEventType.UploadProgress) {
18101
- file.progress = Math.min(1, event.loaded / event.total);
18118
+ var total = event.total || file.size;
18119
+ file.progress = Math.min(1, event.loaded / total);
18102
18120
  }
18103
- else if (event instanceof i2$1.HttpResponse) {
18121
+ else if (event instanceof i2$1.HttpResponse || event instanceof FileResponse) {
18104
18122
  var content = event.body;
18105
18123
  file.finalName = content === null || content === void 0 ? void 0 : content.finalName;
18106
18124
  file.progress = 1;
18107
- console.info("[upload-file] " + file.name + ": " + (content.message || 'succeed') + " (finalName: " + file.finalName + ")");
18125
+ var message = content.message || event.statusText || 'succeed';
18126
+ console.info("[upload-file] " + file.name + ": " + message + " (finalName: " + file.finalName + ")");
18108
18127
  }
18109
18128
  return file;
18110
18129
  }), operators.catchError(function (err) {
@@ -18883,14 +18902,6 @@
18883
18902
  return FormFieldValuesHolder;
18884
18903
  }());
18885
18904
 
18886
- var UploadFile = /** @class */ (function (_super) {
18887
- __extends(UploadFile, _super);
18888
- function UploadFile() {
18889
- return _super !== null && _super.apply(this, arguments) || this;
18890
- }
18891
- return UploadFile;
18892
- }(File));
18893
-
18894
18905
  // eslint-disable-next-line @angular-eslint/directive-class-suffix
18895
18906
  var AppForm = /** @class */ (function () {
18896
18907
  function AppForm(injector, form) {
@@ -29946,7 +29957,7 @@
29946
29957
  // Stop the timer
29947
29958
  setTimeout(function () { return $stop.next(); }, 100);
29948
29959
  // Return final response
29949
- return new i2$1.HttpResponse({ body: { finalName: file.name, message: 'Upload succeed' } });
29960
+ return new i2$1.HttpResponse({ body: { finalName: file.name } });
29950
29961
  }));
29951
29962
  };
29952
29963
  UploadFileTestingPage.prototype.deleteFile = function (file) {
@@ -30603,6 +30614,7 @@
30603
30614
  exports.Environment = Environment;
30604
30615
  exports.ErrorCodes = ErrorCodes;
30605
30616
  exports.EvenPipe = EvenPipe;
30617
+ exports.FileResponse = FileResponse;
30606
30618
  exports.FileService = FileService;
30607
30619
  exports.FileSizePipe = FileSizePipe;
30608
30620
  exports.FormArrayHelper = FormArrayHelper;
@@ -30641,6 +30653,7 @@
30641
30653
  exports.MapValuesPipe = MapValuesPipe;
30642
30654
  exports.MatAutocompleteConfigHolder = MatAutocompleteConfigHolder;
30643
30655
  exports.MatAutocompleteField = MatAutocompleteField;
30656
+ exports.MatBadgeIconDirective = MatBadgeIconDirective;
30644
30657
  exports.MatBooleanField = MatBooleanField;
30645
30658
  exports.MatChipsField = MatChipsField;
30646
30659
  exports.MatDate = MatDate;
@@ -30699,6 +30712,7 @@
30699
30712
  exports.SharedFormGroupValidators = SharedFormGroupValidators;
30700
30713
  exports.SharedHotkeysModule = SharedHotkeysModule;
30701
30714
  exports.SharedMatAutocompleteModule = SharedMatAutocompleteModule;
30715
+ exports.SharedMatBadgeIconModule = SharedMatBadgeIconModule;
30702
30716
  exports.SharedMatBooleanModule = SharedMatBooleanModule;
30703
30717
  exports.SharedMatChipsModule = SharedMatChipsModule;
30704
30718
  exports.SharedMatDateTimeModule = SharedMatDateTimeModule;
@@ -30890,19 +30904,17 @@
30890
30904
  exports["ɵ0"] = ɵ0$b;
30891
30905
  exports["ɵa"] = CustomReuseStrategy;
30892
30906
  exports["ɵb"] = MatNumpadDomService;
30893
- exports["ɵc"] = SharedMatBadgeIconModule;
30894
- exports["ɵd"] = MatBadgeIconDirective;
30895
- exports["ɵe"] = isFocusableElement;
30896
- exports["ɵf"] = RegisterForm;
30897
- exports["ɵg"] = AccountValidatorService;
30898
- exports["ɵh"] = RegisterModal;
30899
- exports["ɵi"] = UserSettingsValidatorService;
30900
- exports["ɵj"] = LocalSettingsValidatorService;
30901
- exports["ɵk"] = AppIconComponent;
30902
- exports["ɵl"] = NumpadTestPage;
30903
- exports["ɵm"] = MatBadgeIconTestPage;
30904
- exports["ɵn"] = ToastTestingModule;
30905
- exports["ɵo"] = ToastTestingPage;
30907
+ exports["ɵc"] = isFocusableElement;
30908
+ exports["ɵd"] = RegisterForm;
30909
+ exports["ɵe"] = AccountValidatorService;
30910
+ exports["ɵf"] = RegisterModal;
30911
+ exports["ɵg"] = UserSettingsValidatorService;
30912
+ exports["ɵh"] = LocalSettingsValidatorService;
30913
+ exports["ɵi"] = AppIconComponent;
30914
+ exports["ɵj"] = NumpadTestPage;
30915
+ exports["ɵk"] = MatBadgeIconTestPage;
30916
+ exports["ɵl"] = ToastTestingModule;
30917
+ exports["ɵm"] = ToastTestingPage;
30906
30918
 
30907
30919
  Object.defineProperty(exports, '__esModule', { value: true });
30908
30920