@colijnit/corecomponents_v12 256.1.25 → 256.1.26
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/colijnit-corecomponents_v12.umd.js +33 -1
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +34 -2
- package/fesm2015/colijnit-corecomponents_v12.js +33 -1
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/simple-grid/style/_layout.scss +5 -0
- package/package.json +1 -1
|
@@ -10484,7 +10484,39 @@
|
|
|
10484
10484
|
this.headerColumnsCopy = this.headerColumns;
|
|
10485
10485
|
};
|
|
10486
10486
|
SimpleGridComponent.prototype.exportToExcel = function () {
|
|
10487
|
-
this.
|
|
10487
|
+
this.isSettingsMenuOpen = false;
|
|
10488
|
+
var columns = this.headerColumnsCopy.map(function (column) {
|
|
10489
|
+
return ({
|
|
10490
|
+
key: column.field,
|
|
10491
|
+
header: column.headerText
|
|
10492
|
+
});
|
|
10493
|
+
});
|
|
10494
|
+
var headers = columns.map(function (col) { return col.header; });
|
|
10495
|
+
var rows = this.data.map(function (row) { return columns.map(function (col) {
|
|
10496
|
+
var value = row[col.key];
|
|
10497
|
+
if (value instanceof Date) {
|
|
10498
|
+
var pad = function (n) { return String(n).padStart(2, '0'); };
|
|
10499
|
+
return value.getFullYear() + "-" + pad(value.getMonth() + 1) + "-" + pad(value.getDate()) + "T" + pad(value.getHours()) + ":" + pad(value.getMinutes()) + ":" + pad(value.getSeconds());
|
|
10500
|
+
}
|
|
10501
|
+
else if (Array.isArray(value)) {
|
|
10502
|
+
return value.join(', ');
|
|
10503
|
+
}
|
|
10504
|
+
else if (typeof value === 'object' && value !== null) {
|
|
10505
|
+
return JSON.stringify(value);
|
|
10506
|
+
}
|
|
10507
|
+
else {
|
|
10508
|
+
return String(value !== null && value !== void 0 ? value : '');
|
|
10509
|
+
}
|
|
10510
|
+
}); });
|
|
10511
|
+
var csvContent = __spreadArray([headers], __read(rows)).map(function (row) { return row.map(function (cell) { return "\"" + cell.replace(/"/g, '""') + "\""; }).join(','); }).join('\r\n');
|
|
10512
|
+
var blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
|
10513
|
+
var link = document.createElement('a');
|
|
10514
|
+
var url = URL.createObjectURL(blob);
|
|
10515
|
+
link.href = url;
|
|
10516
|
+
link.setAttribute('download', 'ExcelSheet');
|
|
10517
|
+
document.body.appendChild(link);
|
|
10518
|
+
link.click();
|
|
10519
|
+
document.body.removeChild(link);
|
|
10488
10520
|
};
|
|
10489
10521
|
SimpleGridComponent.prototype.prepareDataRow = function (row, index) {
|
|
10490
10522
|
this.isRowDisabled(row, index);
|