@seniorsistemas/angular-components 14.13.2 → 14.13.3

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.
@@ -2620,7 +2620,14 @@ var ExportUtils = /** @class */ (function () {
2620
2620
  data.forEach(function (record) {
2621
2621
  csv += "\n";
2622
2622
  columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
2623
- var cellData = _this.resolveFieldData(record, column.field);
2623
+ var cellData;
2624
+ if (Array.isArray(column.field)) {
2625
+ var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
2626
+ cellData = fieldValues.flat().join(column.separator);
2627
+ }
2628
+ else {
2629
+ cellData = _this.resolveFieldData(record, column.field);
2630
+ }
2624
2631
  if (cellData != null)
2625
2632
  cellData = String(cellData).replace(/"/g, "\"\"");
2626
2633
  else
@@ -4229,14 +4236,41 @@ var TablePagingComponent = /** @class */ (function () {
4229
4236
  };
4230
4237
  TablePagingComponent.prototype.getColumnsToExport = function () {
4231
4238
  return __spread(this.table.columns).map(function (column) {
4232
- if (column.exportable === null || column.exportable === undefined) {
4233
- column.exportable = true;
4239
+ var _a;
4240
+ var exportColumn = {
4241
+ header: column.header,
4242
+ exportable: true,
4243
+ field: column.field,
4244
+ separator: (_a = column.separator) !== null && _a !== void 0 ? _a : " - "
4245
+ };
4246
+ if (column.exportable === false) {
4247
+ exportColumn.exportable = false;
4234
4248
  }
4235
- return column;
4249
+ if (column.attributes && column.attributes.length) {
4250
+ if (column.attributes.length === 1) {
4251
+ exportColumn.field = column.attributes[0];
4252
+ }
4253
+ else {
4254
+ exportColumn.field = column.attributes;
4255
+ }
4256
+ }
4257
+ return exportColumn;
4236
4258
  });
4237
4259
  };
4238
4260
  TablePagingComponent.prototype.getRowsToExport = function () {
4239
- return this.table.value;
4261
+ var _this = this;
4262
+ var enumColumns = this.table.columns.filter(function (p) { return p.enumPrefix; });
4263
+ if (!enumColumns.length)
4264
+ return this.table.value;
4265
+ return __spread(this.table.value).map(function (row) {
4266
+ for (var i = 0; i <= enumColumns.length - 1; i++) {
4267
+ var column = enumColumns[i];
4268
+ var fieldName = column.field;
4269
+ var columnData = row[fieldName];
4270
+ row[fieldName] = _this.translate.instant(column.enumPrefix + columnData.toString().toLowerCase());
4271
+ }
4272
+ return row;
4273
+ });
4240
4274
  };
4241
4275
  TablePagingComponent.prototype.getSelectedRowsToExport = function () {
4242
4276
  return this.table.selection;