@sumaris-net/ngx-components 1.23.2 → 1.23.5

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.
@@ -26087,14 +26087,13 @@
26087
26087
  delete: { get: function () { return _super_1.prototype.delete; } }
26088
26088
  });
26089
26089
  return __awaiter(this, void 0, void 0, function () {
26090
- var data, rowsById, rowNotDeleted, err_1;
26090
+ var data, rowNotDeleted, err_1;
26091
26091
  var _this = this;
26092
26092
  return __generator(this, function (_b) {
26093
26093
  switch (_b.label) {
26094
26094
  case 0:
26095
26095
  this.markAsLoading();
26096
26096
  data = this.getDataFromRows(rows);
26097
- rowsById = Beans.collectById(rows);
26098
26097
  _b.label = 1;
26099
26098
  case 1:
26100
26099
  _b.trys.push([1, 3, 4, 5]);
@@ -26103,18 +26102,11 @@
26103
26102
  case 2:
26104
26103
  // Call service deletion
26105
26104
  _b.sent();
26106
- rowNotDeleted = Object.getOwnPropertyNames(rowsById)
26107
- .reduce(function (res, id) {
26108
- var row = rowsById[id];
26109
- var present = _this.getRow(+id) === row;
26110
- return present ? res.concat(row) : res;
26111
- }, []);
26112
- //this.getRows().filter(row => rows.includes(row));
26113
- // Apply missing deletion
26105
+ rowNotDeleted = this.getRows().filter(rows.includes);
26114
26106
  if (isNotEmptyArray(rowNotDeleted)) {
26115
- console.warn("[table-datasource] Force deletion of " + rowNotDeleted.length + " rows (Is service update the cache ?)");
26107
+ console.warn("[table-datasource] Force deletion of " + rowNotDeleted.length + " rows! Please check that data service update the cache, after deletion");
26116
26108
  rowNotDeleted
26117
- // Start from the end
26109
+ // Start at the end
26118
26110
  .sort(function (a, b) { return a.id > b.id ? -1 : 1; })
26119
26111
  .forEach(function (r) { return _super.delete.call(_this, r.id); });
26120
26112
  }
@@ -26688,7 +26680,7 @@
26688
26680
  return rxjs.of(undefined); // Continue
26689
26681
  }))
26690
26682
  .subscribe(function (res) { return _this.updateView(res); }));
26691
- // Listen dataSource events
26683
+ // Listen dataSource loading events
26692
26684
  if (this._dataSource)
26693
26685
  this.listenDatasourceLoading(this._dataSource);
26694
26686
  };
@@ -28042,8 +28034,9 @@
28042
28034
  if (this.debug)
28043
28035
  console.debug('[table] Many call to listenDatasource(): Cleaning previous subscriptions...');
28044
28036
  this._dataSourceLoadingSubscription.unsubscribe();
28045
- this._subscription.remove(this._dataSourceLoadingSubscription);
28037
+ this.unregisterSubscription(this._dataSourceLoadingSubscription);
28046
28038
  }
28039
+ // Propage loading to table
28047
28040
  this._dataSourceLoadingSubscription = this._dataSource.loadingSubject
28048
28041
  .pipe(operators.distinctUntilChanged(),
28049
28042
  // If changed to True: propagate as soon as possible
@@ -28051,7 +28044,7 @@
28051
28044
  // If changed to False: wait 250ms before propagate (to make sure the spinner has been displayed)
28052
28045
  operators.debounceTime(250), operators.tap(function (loading) { return !loading && _this.setLoading(false); }))
28053
28046
  .subscribe();
28054
- this._subscription.add(this._dataSourceLoadingSubscription);
28047
+ this.registerSubscription(this._dataSourceLoadingSubscription);
28055
28048
  };
28056
28049
  AppTable.prototype.startCellValueChanges = function (name, row) {
28057
28050
  var def = this._cellValueChangesDefs[name];