@seniorsistemas/angular-components 14.13.0 → 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,21 +4236,50 @@ 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;
4243
4277
  };
4244
4278
  TablePagingComponent.prototype.getExportFileName = function () {
4245
4279
  var _a;
4246
- return (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
4280
+ var fileName = (_a = this.exportFileName) !== null && _a !== void 0 ? _a : "download";
4281
+ var currentDate = moment_(new Date()).format("DD-MM-YYYY[_]HH:mm");
4282
+ return fileName + "_" + currentDate;
4247
4283
  };
4248
4284
  TablePagingComponent.prototype.exportCurrentPage = function () {
4249
4285
  this.validateComponent();
@@ -4401,7 +4437,7 @@ var ChipsFieldComponent = /** @class */ (function () {
4401
4437
  ], ChipsFieldComponent.prototype, "formControl", void 0);
4402
4438
  ChipsFieldComponent = __decorate([
4403
4439
  Component({
4404
- template: "<p-chips\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\"\n></p-chips>\n"
4440
+ template: "<p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n</p-chips>\n\n<p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n</p-chips>\n"
4405
4441
  })
4406
4442
  ], ChipsFieldComponent);
4407
4443
  return ChipsFieldComponent;