@trudb/tru-common-lib 0.2.108 → 0.2.109

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.
@@ -5952,10 +5952,12 @@ class TruDataGridCellRenderer {
5952
5952
 
5953
5953
  class TruDataGridClipboard {
5954
5954
  util;
5955
+ uiNotification;
5955
5956
  tableName = null;
5956
5957
  rowData = [];
5957
- constructor(util) {
5958
+ constructor(util, uiNotification) {
5958
5959
  this.util = util;
5960
+ this.uiNotification = uiNotification;
5959
5961
  }
5960
5962
  copiedRows = (tableName, rowData) => {
5961
5963
  this.tableName = tableName;
@@ -5967,6 +5969,10 @@ class TruDataGridClipboard {
5967
5969
  paste = (gridApi, column, rowNode) => {
5968
5970
  };
5969
5971
  insertRowsAtTop = (dataContext, config, addEntity) => {
5972
+ if (this.tableName !== config.tableName) {
5973
+ this.uiNotification.error('Clipboard data does not match the current table name: ' + this.tableName + ' vs ' + config.tableName);
5974
+ return;
5975
+ }
5970
5976
  if (this.rowData.length) {
5971
5977
  this.rowData.forEach((row) => {
5972
5978
  let newEntity = dataContext.entityAccess().add(config.resultConfig.entityType);
@@ -5985,7 +5991,7 @@ class TruDataGridClipboard {
5985
5991
  });
5986
5992
  }
5987
5993
  };
5988
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridClipboard, deps: [{ token: TruUtil }], target: i0.ɵɵFactoryTarget.Injectable });
5994
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridClipboard, deps: [{ token: TruUtil }, { token: TruUiNotification }], target: i0.ɵɵFactoryTarget.Injectable });
5989
5995
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridClipboard, providedIn: 'root' });
5990
5996
  }
5991
5997
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridClipboard, decorators: [{
@@ -5993,7 +5999,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
5993
5999
  args: [{
5994
6000
  providedIn: 'root',
5995
6001
  }]
5996
- }], ctorParameters: () => [{ type: TruUtil }] });
6002
+ }], ctorParameters: () => [{ type: TruUtil }, { type: TruUiNotification }] });
5997
6003
 
5998
6004
  class TruDataGridPkeyCellRenderer {
5999
6005
  dataContext;
@@ -6031,7 +6037,7 @@ class TruDataGridPkeyCellRenderer {
6031
6037
  let selectedRows = this.params.api.getSelectedRows();
6032
6038
  if (selectedRows.length) {
6033
6039
  let copiedRowData = selectedRows.map((row) => row.$entity);
6034
- this.dataGridClipboard.copiedRows('', copiedRowData);
6040
+ this.dataGridClipboard.copiedRows(this.params.context.grid.config.tableName, copiedRowData);
6035
6041
  }
6036
6042
  };
6037
6043
  onPaste = (event) => {