@sumaris-net/ngx-components 1.23.13 → 1.23.15

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.
@@ -20843,7 +20843,8 @@
20843
20843
  return __generator(this, function (_b) {
20844
20844
  if (this.debug)
20845
20845
  console.debug('[memory-data-service] Starting...');
20846
- return [2 /*return*/, firstNotNilPromise(this.dataSubject, { stop: this.stopSubject })];
20846
+ return [2 /*return*/, firstNotNil(this.dataSubject, { stop: this.stopSubject })
20847
+ .toPromise()];
20847
20848
  });
20848
20849
  });
20849
20850
  };
@@ -20885,25 +20886,32 @@
20885
20886
  if (isNil(originalData)) {
20886
20887
  console.warn('[memory-data-service] Cannot load all: no value set. Will return empty result');
20887
20888
  }
20888
- // Wait while idle
20889
- return [4 /*yield*/, this.waitWhileSaving()];
20889
+ if (!!this.started) return [3 /*break*/, 2];
20890
+ return [4 /*yield*/, this.ready()];
20890
20891
  case 1:
20891
- // Wait while idle
20892
20892
  _b.sent();
20893
- excludedDataByFilter = [];
20894
20893
  _b.label = 2;
20895
20894
  case 2:
20896
- _b.trys.push([2, , 5, 6]);
20895
+ if (!this.saving) return [3 /*break*/, 4];
20896
+ return [4 /*yield*/, this.waitWhileSaving()];
20897
+ case 3:
20898
+ _b.sent();
20899
+ _b.label = 4;
20900
+ case 4:
20901
+ excludedDataByFilter = [];
20902
+ _b.label = 5;
20903
+ case 5:
20904
+ _b.trys.push([5, , 8, 9]);
20897
20905
  if (isEmptyArray(originalData)) {
20898
20906
  return [2 /*return*/, { data: [], total: 0 }];
20899
20907
  }
20900
20908
  data = this._sortFn(originalData, sortBy, sortDirection);
20901
- if (!this._onLoad) return [3 /*break*/, 4];
20909
+ if (!this._onLoad) return [3 /*break*/, 7];
20902
20910
  return [4 /*yield*/, this._onLoad(data)];
20903
- case 3:
20911
+ case 6:
20904
20912
  data = _b.sent();
20905
- _b.label = 4;
20906
- case 4:
20913
+ _b.label = 7;
20914
+ case 7:
20907
20915
  // Apply filter (will update hiddenData)
20908
20916
  data = this.filter(data, filter, excludedDataByFilter);
20909
20917
  total = data.length;
@@ -20960,13 +20968,13 @@
20960
20968
  }); };
20961
20969
  }
20962
20970
  return [2 /*return*/, res];
20963
- case 5:
20971
+ case 8:
20964
20972
  // Remember hidden data
20965
20973
  if (offset === 0) {
20966
20974
  this._hiddenData = !excludedDataByPagination ? excludedDataByFilter : excludedDataByFilter.concat.apply(excludedDataByFilter, __spread(excludedDataByPagination));
20967
20975
  }
20968
20976
  return [7 /*endfinally*/];
20969
- case 6: return [2 /*return*/];
20977
+ case 9: return [2 /*return*/];
20970
20978
  }
20971
20979
  });
20972
20980
  });
@@ -20978,7 +20986,7 @@
20978
20986
  return this.dataSubject
20979
20987
  .pipe(operators.takeUntil(this.stopSubject),
20980
20988
  // Warn if waiting value to be set
20981
- operators.tap(function (data) { return !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }));
20989
+ operators.tap(function (data) { return _this.debug && !data && console.debug('[memory-data-service] Waiting value to be set...'); }), operators.filter(isNotNil), operators.mergeMap(function (_) { return _this.loadAll(offset, size, sortBy, sortDirection, filterData, options); }));
20982
20990
  };
20983
20991
  InMemoryEntitiesService.prototype.saveAll = function (data, options) {
20984
20992
  return __awaiter(this, void 0, void 0, function () {