@trudb/tru-common-lib 0.2.178 → 0.2.182
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.
|
@@ -6368,7 +6368,7 @@ class TruDataGridClipboard {
|
|
|
6368
6368
|
params.api.refreshCells({ force: true });
|
|
6369
6369
|
}
|
|
6370
6370
|
};
|
|
6371
|
-
copyRow = async (tableName, copiedRows) => {
|
|
6371
|
+
copyRow = async (tableName, columnDefs, copiedRows) => {
|
|
6372
6372
|
this.tableName = tableName;
|
|
6373
6373
|
this.copiedRows = copiedRows;
|
|
6374
6374
|
if (copiedRows.length) {
|
|
@@ -6376,7 +6376,12 @@ class TruDataGridClipboard {
|
|
|
6376
6376
|
this.copiedRows.forEach((copiedRow, index) => {
|
|
6377
6377
|
let rowPropertyValues = [];
|
|
6378
6378
|
let properties = copiedRow.$entity.entityType.getPropertyNames();
|
|
6379
|
-
properties
|
|
6379
|
+
let propertiesFilteredByColDef = properties.reduce((acc, propertyName) => {
|
|
6380
|
+
if (copiedRow.hasOwnProperty(propertyName))
|
|
6381
|
+
acc.push(propertyName);
|
|
6382
|
+
return acc;
|
|
6383
|
+
}, []);
|
|
6384
|
+
propertiesFilteredByColDef
|
|
6380
6385
|
.forEach((propertyName) => {
|
|
6381
6386
|
let propertyConfig = copiedRow[propertyName]?.property;
|
|
6382
6387
|
if (propertyConfig &&
|
|
@@ -6498,7 +6503,7 @@ class TruDataGridPkeyCellRenderer {
|
|
|
6498
6503
|
let columnDefs = this.params.api.getColumnDefs();
|
|
6499
6504
|
if (selectedRows.length) {
|
|
6500
6505
|
let copiedRowData = selectedRows;
|
|
6501
|
-
this.dataGridClipboard.copyRow(this.params.context.grid.config.tableName, copiedRowData);
|
|
6506
|
+
this.dataGridClipboard.copyRow(this.params.context.grid.config.tableName, columnDefs, copiedRowData);
|
|
6502
6507
|
}
|
|
6503
6508
|
};
|
|
6504
6509
|
onPaste = (event) => {
|
|
@@ -8021,8 +8026,9 @@ class TruDataGrid {
|
|
|
8021
8026
|
}
|
|
8022
8027
|
else if (params.column.isPinned() && event.ctrlKey && event.code === 'KeyC') {
|
|
8023
8028
|
let selectedRows = this.api.getSelectedRows();
|
|
8029
|
+
let columnDefs = this.api.getColumnDefs();
|
|
8024
8030
|
if (selectedRows.length)
|
|
8025
|
-
this.dataGridClipboard.copyRow(this.config.tableName, selectedRows);
|
|
8031
|
+
this.dataGridClipboard.copyRow(this.config.tableName, columnDefs, selectedRows);
|
|
8026
8032
|
}
|
|
8027
8033
|
else if (params.column.isPinned() && event.ctrlKey && event.code === 'KeyV') {
|
|
8028
8034
|
this.dataGridClipboard.pasteRow(this.api, this.config, this.api.getSelectedRows());
|