@seniorsistemas/angular-components 14.16.3 → 14.16.4

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.
@@ -4556,24 +4556,28 @@
4556
4556
  return exportColumn;
4557
4557
  });
4558
4558
  };
4559
- TablePagingComponent.prototype.getRowsToExport = function () {
4559
+ TablePagingComponent.prototype.getCurrentPageRowsToExport = function () {
4560
+ return this.mapColumnsTranslations(this.table.columns, this.table.value);
4561
+ };
4562
+ TablePagingComponent.prototype.getSelectedRowsToExport = function () {
4563
+ return this.mapColumnsTranslations(this.table.columns, this.table.selection);
4564
+ };
4565
+ TablePagingComponent.prototype.mapColumnsTranslations = function (columns, rows) {
4560
4566
  var _this = this;
4561
- var enumColumns = this.table.columns.filter(function (p) { return p.enumPrefix; });
4567
+ var enumColumns = columns.filter(function (p) { return p.enumPrefix; });
4562
4568
  if (!enumColumns.length)
4563
- return this.table.value;
4564
- return __spread(this.table.value).map(function (row) {
4569
+ return rows;
4570
+ return __spread(rows).map(function (row) {
4571
+ var newRow = __assign({}, row);
4565
4572
  for (var i = 0; i <= enumColumns.length - 1; i++) {
4566
4573
  var column = enumColumns[i];
4567
4574
  var fieldName = column.field;
4568
4575
  var columnData = row[fieldName];
4569
- row[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
4576
+ newRow[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
4570
4577
  }
4571
- return row;
4578
+ return newRow;
4572
4579
  });
4573
4580
  };
4574
- TablePagingComponent.prototype.getSelectedRowsToExport = function () {
4575
- return this.table.selection;
4576
- };
4577
4581
  TablePagingComponent.prototype.getExportFileName = function () {
4578
4582
  var _a;
4579
4583
  var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
@@ -4582,7 +4586,7 @@
4582
4586
  };
4583
4587
  TablePagingComponent.prototype.exportCurrentPage = function () {
4584
4588
  this.validateComponent();
4585
- ExportUtils.exportCSV(this.getColumnsToExport(), this.getRowsToExport(), undefined, this.getExportFileName());
4589
+ ExportUtils.exportCSV(this.getColumnsToExport(), this.getCurrentPageRowsToExport(), undefined, this.getExportFileName());
4586
4590
  };
4587
4591
  TablePagingComponent.prototype.exportSelectedRecords = function () {
4588
4592
  this.validateComponent();
@@ -4590,15 +4594,16 @@
4590
4594
  };
4591
4595
  TablePagingComponent.prototype.exportAllRecords = function () {
4592
4596
  return __awaiter(this, void 0, void 0, function () {
4593
- var data;
4597
+ var serverData, dataToExport;
4594
4598
  return __generator(this, function (_a) {
4595
4599
  switch (_a.label) {
4596
4600
  case 0:
4597
4601
  this.validateComponent();
4598
4602
  return [4 /*yield*/, this.loadAllRecords()];
4599
4603
  case 1:
4600
- data = _a.sent();
4601
- ExportUtils.exportCSV(this.getColumnsToExport(), data, undefined, this.getExportFileName());
4604
+ serverData = _a.sent();
4605
+ dataToExport = this.mapColumnsTranslations(this.table.columns, serverData);
4606
+ ExportUtils.exportCSV(this.getColumnsToExport(), dataToExport, undefined, this.getExportFileName());
4602
4607
  return [2 /*return*/];
4603
4608
  }
4604
4609
  });