@sumaris-net/ngx-components 1.20.29 → 1.20.30

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.
@@ -20719,14 +20719,14 @@
20719
20719
  }
20720
20720
  return this._onChange
20721
20721
  .pipe(operators.filter(isNotNil), operators.mergeMap(function (_) { return waitFor(function () { return !_this._saving; }); }), operators.mergeMap(function (_) { return __awaiter(_this, void 0, void 0, function () {
20722
- var excludedDataByFilter, excludedDataByPagination, data, promiseOrData, _d, total;
20723
- return __generator(this, function (_e) {
20724
- switch (_e.label) {
20722
+ var excludedDataByFilter, excludedDataByPagination, data, promiseOrData, _b, total;
20723
+ return __generator(this, function (_c) {
20724
+ switch (_c.label) {
20725
20725
  case 0:
20726
20726
  excludedDataByFilter = [];
20727
- _e.label = 1;
20727
+ _c.label = 1;
20728
20728
  case 1:
20729
- _e.trys.push([1, , 6, 7]);
20729
+ _c.trys.push([1, , 6, 7]);
20730
20730
  if (isEmptyArray(this.data)) {
20731
20731
  return [2 /*return*/, { data: [], total: 0 }];
20732
20732
  }
@@ -20736,14 +20736,14 @@
20736
20736
  if (!((promiseOrData instanceof Promise))) return [3 /*break*/, 3];
20737
20737
  return [4 /*yield*/, promiseOrData];
20738
20738
  case 2:
20739
- _d = _e.sent();
20739
+ _b = _c.sent();
20740
20740
  return [3 /*break*/, 4];
20741
20741
  case 3:
20742
- _d = promiseOrData;
20743
- _e.label = 4;
20742
+ _b = promiseOrData;
20743
+ _c.label = 4;
20744
20744
  case 4:
20745
- data = _d;
20746
- _e.label = 5;
20745
+ data = _b;
20746
+ _c.label = 5;
20747
20747
  case 5:
20748
20748
  // Apply filter (will update hiddenData)
20749
20749
  data = this.filter(data, filterData, excludedDataByFilter);
@@ -20799,16 +20799,16 @@
20799
20799
  };
20800
20800
  InMemoryEntitiesService.prototype.saveAll = function (data, options) {
20801
20801
  return __awaiter(this, void 0, void 0, function () {
20802
- var res, _d;
20803
- return __generator(this, function (_e) {
20804
- switch (_e.label) {
20802
+ var res, _b;
20803
+ return __generator(this, function (_c) {
20804
+ switch (_c.label) {
20805
20805
  case 0:
20806
20806
  if (!this.data)
20807
20807
  throw new Error('[memory-service] Could not save, because value not set');
20808
20808
  this.markAsSaving();
20809
- _e.label = 1;
20809
+ _c.label = 1;
20810
20810
  case 1:
20811
- _e.trys.push([1, , 6, 7]);
20811
+ _c.trys.push([1, , 6, 7]);
20812
20812
  // Restore hidden data
20813
20813
  if (isNotEmptyArray(this._hiddenData))
20814
20814
  data = data.concat.apply(data, __spread(this._hiddenData));
@@ -20817,14 +20817,14 @@
20817
20817
  if (!((res instanceof Promise))) return [3 /*break*/, 3];
20818
20818
  return [4 /*yield*/, res];
20819
20819
  case 2:
20820
- _d = _e.sent();
20820
+ _b = _c.sent();
20821
20821
  return [3 /*break*/, 4];
20822
20822
  case 3:
20823
- _d = res;
20824
- _e.label = 4;
20823
+ _b = res;
20824
+ _c.label = 4;
20825
20825
  case 4:
20826
- data = _d;
20827
- _e.label = 5;
20826
+ data = _b;
20827
+ _c.label = 5;
20828
20828
  case 5:
20829
20829
  this.data = data;
20830
20830
  this.dirty = true;
@@ -20841,7 +20841,7 @@
20841
20841
  return __awaiter(this, void 0, void 0, function () {
20842
20842
  var updatedData, deleteCount;
20843
20843
  var _this = this;
20844
- return __generator(this, function (_d) {
20844
+ return __generator(this, function (_b) {
20845
20845
  if (!this.data)
20846
20846
  throw new Error('[memory-service] Could not delete, because value not set');
20847
20847
  updatedData = this.data.filter(function (entity) {
@@ -20875,18 +20875,26 @@
20875
20875
  return this._equalsFn(d1, d2);
20876
20876
  return d1 && d1.equals ? d1.equals(d2) : EntityUtils.equals(d1, d2, 'id');
20877
20877
  };
20878
- /**
20879
- * Count data inside the service.
20880
- * @param opts
20881
- */
20882
- InMemoryEntitiesService.prototype.count = function (opts) {
20883
- if (opts === void 0) { opts = { withHidden: false }; }
20884
- var _a, _b, _c;
20885
- if (opts.withHidden) {
20886
- return (((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = this._hiddenData) === null || _b === void 0 ? void 0 : _b.length) || 0);
20887
- }
20888
- return (((_c = this.data) === null || _c === void 0 ? void 0 : _c.length) || 0);
20889
- };
20878
+ Object.defineProperty(InMemoryEntitiesService.prototype, "count", {
20879
+ /**
20880
+ * Count data stored by the service (without hidden data).
20881
+ * @param opts
20882
+ */
20883
+ get: function () {
20884
+ var _a;
20885
+ return (((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) || 0);
20886
+ },
20887
+ enumerable: false,
20888
+ configurable: true
20889
+ });
20890
+ Object.defineProperty(InMemoryEntitiesService.prototype, "hiddenCount", {
20891
+ get: function () {
20892
+ var _a;
20893
+ return ((_a = this._hiddenData) === null || _a === void 0 ? void 0 : _a.length) || 0;
20894
+ },
20895
+ enumerable: false,
20896
+ configurable: true
20897
+ });
20890
20898
  /* -- protected methods -- */
20891
20899
  InMemoryEntitiesService.prototype.filter = function (data, _filter, hiddenData) {
20892
20900
  // if filter is DataFilter instance, use its test function