@seniorsistemas/angular-components 14.16.18 → 14.16.19
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.
- package/bundles/seniorsistemas-angular-components.umd.js +37 -14
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/table/table-paging/table-paging.component.d.ts +7 -1
- package/esm2015/components/table/table-paging/table-paging.component.js +33 -13
- package/esm5/components/table/table-paging/table-paging.component.js +38 -15
- package/fesm2015/seniorsistemas-angular-components.js +32 -12
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +37 -14
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -4424,7 +4424,8 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
4424
4424
|
header: column.header,
|
|
4425
4425
|
exportable: true,
|
|
4426
4426
|
field: column.field,
|
|
4427
|
-
separator: (_a = column.separator) !== null && _a !== void 0 ? _a : " - "
|
|
4427
|
+
separator: (_a = column.separator) !== null && _a !== void 0 ? _a : " - ",
|
|
4428
|
+
enumPrefix: column.enumPrefix
|
|
4428
4429
|
};
|
|
4429
4430
|
if (column.exportable === false) {
|
|
4430
4431
|
exportColumn.exportable = false;
|
|
@@ -4440,11 +4441,11 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
4440
4441
|
return exportColumn;
|
|
4441
4442
|
});
|
|
4442
4443
|
};
|
|
4443
|
-
TablePagingComponent.prototype.getCurrentPageRowsToExport = function () {
|
|
4444
|
-
return this.mapColumnsTranslations(
|
|
4444
|
+
TablePagingComponent.prototype.getCurrentPageRowsToExport = function (columns) {
|
|
4445
|
+
return this.mapColumnsTranslations(columns, this.table.value);
|
|
4445
4446
|
};
|
|
4446
|
-
TablePagingComponent.prototype.getSelectedRowsToExport = function () {
|
|
4447
|
-
return this.mapColumnsTranslations(
|
|
4447
|
+
TablePagingComponent.prototype.getSelectedRowsToExport = function (columns) {
|
|
4448
|
+
return this.mapColumnsTranslations(columns, this.table.selection);
|
|
4448
4449
|
};
|
|
4449
4450
|
TablePagingComponent.prototype.mapColumnsTranslations = function (columns, rows) {
|
|
4450
4451
|
var _this = this;
|
|
@@ -4453,11 +4454,28 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
4453
4454
|
return rows;
|
|
4454
4455
|
return __spread(rows).map(function (row) {
|
|
4455
4456
|
var newRow = __assign({}, row);
|
|
4456
|
-
|
|
4457
|
+
var _loop_1 = function (i) {
|
|
4457
4458
|
var column = enumColumns[i];
|
|
4458
|
-
var
|
|
4459
|
-
|
|
4460
|
-
|
|
4459
|
+
var fields = column.field;
|
|
4460
|
+
if (!Array.isArray(fields)) {
|
|
4461
|
+
fields = [fields];
|
|
4462
|
+
}
|
|
4463
|
+
fields.forEach(function (fieldName) {
|
|
4464
|
+
var columnData = row[fieldName];
|
|
4465
|
+
if (!columnData)
|
|
4466
|
+
return;
|
|
4467
|
+
var enumValue = columnData.toString().toLowerCase();
|
|
4468
|
+
var translationKey = column.enumPrefix + enumValue;
|
|
4469
|
+
var translatedValue = _this.translate.instant(translationKey);
|
|
4470
|
+
if (translationKey === translatedValue && enumValue.length > 1) {
|
|
4471
|
+
translationKey = column.enumPrefix + enumValue.substring(0, 1) + "_" + enumValue.substr(1);
|
|
4472
|
+
translatedValue = _this.translate.instant(translationKey);
|
|
4473
|
+
}
|
|
4474
|
+
newRow[fieldName] = translatedValue;
|
|
4475
|
+
});
|
|
4476
|
+
};
|
|
4477
|
+
for (var i = 0; i <= enumColumns.length - 1; i++) {
|
|
4478
|
+
_loop_1(i);
|
|
4461
4479
|
}
|
|
4462
4480
|
return newRow;
|
|
4463
4481
|
});
|
|
@@ -4470,15 +4488,19 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
4470
4488
|
};
|
|
4471
4489
|
TablePagingComponent.prototype.exportCurrentPage = function () {
|
|
4472
4490
|
this.validateComponent();
|
|
4473
|
-
|
|
4491
|
+
var columns = this.getColumnsToExport();
|
|
4492
|
+
var dataToExport = this.getCurrentPageRowsToExport(columns);
|
|
4493
|
+
ExportUtils.exportCSV(columns, dataToExport, undefined, this.getExportFileName());
|
|
4474
4494
|
};
|
|
4475
4495
|
TablePagingComponent.prototype.exportSelectedRecords = function () {
|
|
4476
4496
|
this.validateComponent();
|
|
4477
|
-
|
|
4497
|
+
var columns = this.getColumnsToExport();
|
|
4498
|
+
var dataToExport = this.getSelectedRowsToExport(columns);
|
|
4499
|
+
ExportUtils.exportCSV(columns, dataToExport, undefined, this.getExportFileName());
|
|
4478
4500
|
};
|
|
4479
4501
|
TablePagingComponent.prototype.exportAllRecords = function () {
|
|
4480
4502
|
return __awaiter(this, void 0, void 0, function () {
|
|
4481
|
-
var serverData, dataToExport;
|
|
4503
|
+
var serverData, columns, dataToExport;
|
|
4482
4504
|
return __generator(this, function (_a) {
|
|
4483
4505
|
switch (_a.label) {
|
|
4484
4506
|
case 0:
|
|
@@ -4486,8 +4508,9 @@ var TablePagingComponent = /** @class */ (function () {
|
|
|
4486
4508
|
return [4 /*yield*/, this.loadAllRecords()];
|
|
4487
4509
|
case 1:
|
|
4488
4510
|
serverData = _a.sent();
|
|
4489
|
-
|
|
4490
|
-
|
|
4511
|
+
columns = this.getColumnsToExport();
|
|
4512
|
+
dataToExport = this.mapColumnsTranslations(columns, serverData);
|
|
4513
|
+
ExportUtils.exportCSV(columns, dataToExport, undefined, this.getExportFileName());
|
|
4491
4514
|
return [2 /*return*/];
|
|
4492
4515
|
}
|
|
4493
4516
|
});
|