@sumaris-net/ngx-components 1.23.21 → 1.23.23

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.
@@ -21236,8 +21236,9 @@
21236
21236
  });
21237
21237
  };
21238
21238
  InMemoryEntitiesService.prototype.sort = function (data, sortBy, sortDirection) {
21239
- // Replace sortBy, using the replacement map
21239
+ // Make sure to fill sortBy BEFORE checking in the replacement map
21240
21240
  sortBy = sortBy || 'id';
21241
+ // Replace sortBy, using the replacement map
21241
21242
  sortBy = this._sortByReplacement[sortBy] || sortBy;
21242
21243
  // Execute the sort
21243
21244
  return EntityUtils.sort(data, sortBy, sortDirection);
@@ -27952,10 +27953,13 @@
27952
27953
  return (this.i18nColumnPrefix || '') + changeCaseToUnderscore(columnName).toUpperCase();
27953
27954
  };
27954
27955
  AppTable.prototype.generateTableId = function () {
27956
+ var _a;
27955
27957
  var id = this.location.path(true)
27956
27958
  .replace(/[?].*$/g, '')
27957
27959
  .replace(/\/[\d]+/g, '_id')
27958
- + '_' + this.constructor.name;
27960
+ + '_'
27961
+ // Get a component unique name - See https://stackoverflow.com/questions/60114682/how-to-access-components-unique-encapsulation-id-in-angular-9
27962
+ + (((_a = this.constructor['ɵcmp']) === null || _a === void 0 ? void 0 : _a.id) || this.constructor.name);
27959
27963
  //if (this.debug) console.debug("[table] id = " + id);
27960
27964
  return id;
27961
27965
  };
@@ -29141,18 +29145,16 @@
29141
29145
  });
29142
29146
  });
29143
29147
  };
29144
- AppTabEditor.prototype.saveDirtyTables = function () {
29148
+ AppTabEditor.prototype.saveDirtyChildren = function () {
29145
29149
  return __awaiter(this, void 0, void 0, function () {
29146
- var results, saved;
29150
+ var results;
29147
29151
  return __generator(this, function (_c) {
29148
29152
  switch (_c.label) {
29149
- case 0: return [4 /*yield*/, Promise.all((this.tables || [])
29150
- .filter(function (c) { return c.dirty; })
29153
+ case 0: return [4 /*yield*/, Promise.all(__spread(this.tables, this.editors).filter(function (c) { return c.dirty; })
29151
29154
  .map(function (c) { return c.save(); }))];
29152
29155
  case 1:
29153
29156
  results = _c.sent();
29154
- saved = results.findIndex(function (result) { return result !== true; }) === -1;
29155
- return [2 /*return*/, saved];
29157
+ return [2 /*return*/, !results.some(function (saved) { return saved !== true; })];
29156
29158
  }
29157
29159
  });
29158
29160
  });
@@ -29636,7 +29638,7 @@
29636
29638
  case 2:
29637
29639
  _c.trys.push([2, 8, 9, 10]);
29638
29640
  nextTabIndex = this._autoOpenNextTab && isNil(this.previousDataId) && this.computeNextTabIndex();
29639
- return [4 /*yield*/, this.saveDirtyTables()];
29641
+ return [4 /*yield*/, this.saveDirtyChildren()];
29640
29642
  case 3:
29641
29643
  saved = _c.sent();
29642
29644
  if (!saved)
@@ -30336,7 +30338,7 @@
30336
30338
  _c.label = 2;
30337
30339
  case 2:
30338
30340
  _c.trys.push([2, 5, 6, 7]);
30339
- return [4 /*yield*/, this.saveDirtyTables()];
30341
+ return [4 /*yield*/, this.saveDirtyChildren()];
30340
30342
  case 3:
30341
30343
  saved = _c.sent();
30342
30344
  if (!saved)