@trudb/tru-common-lib 0.2.36 → 0.2.38

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.
@@ -5932,6 +5932,7 @@ class TruDataGridPkeyCellRenderer {
5932
5932
  displayValue = '';
5933
5933
  copyIsDisabled = true;
5934
5934
  pasteIsDisabled = true;
5935
+ lockSelection = false;
5935
5936
  // private eGui: is an empty element to satisfy the getGui method.
5936
5937
  eGui;
5937
5938
  constructor(dataGridClipboard, util) {
@@ -5947,19 +5948,25 @@ class TruDataGridPkeyCellRenderer {
5947
5948
  this.contextMenu.menu?.focusFirstItem('mouse');
5948
5949
  this.contextMenu.openMenu();
5949
5950
  };
5950
- onMouseUp = (event) => {
5951
+ onMouseDown = (event) => {
5951
5952
  event.stopPropagation();
5952
5953
  event.preventDefault();
5954
+ if (this.lockSelection)
5955
+ return;
5956
+ this.lockSelection = true;
5953
5957
  if (event.ctrlKey) {
5954
5958
  if (this.params.node.isSelected())
5955
- this.params.node.setSelected(false);
5959
+ this.params.node.setSelected(false, false);
5956
5960
  else
5957
- this.params.node.setSelected(true);
5961
+ this.params.node.setSelected(true, false);
5958
5962
  }
5959
5963
  else {
5960
5964
  this.params.node.setSelected(true, true);
5961
5965
  }
5962
5966
  };
5967
+ onMouseUp = (event) => {
5968
+ this.lockSelection = false;
5969
+ };
5963
5970
  onCopy = (event) => {
5964
5971
  let selectedRows = this.params.api.getSelectedRows();
5965
5972
  if (selectedRows.length) {
@@ -5988,6 +5995,7 @@ class TruDataGridPkeyCellRenderer {
5988
5995
  else
5989
5996
  this.displayValue = params.value;
5990
5997
  params.eGridCell.addEventListener('contextmenu', this.onRightClick);
5998
+ params.eGridCell.addEventListener('mousedown', this.onMouseDown);
5991
5999
  params.eGridCell.addEventListener('mousedown', this.onMouseUp);
5992
6000
  }
5993
6001
  getGui() {
@@ -5998,6 +6006,7 @@ class TruDataGridPkeyCellRenderer {
5998
6006
  }
5999
6007
  destroy() {
6000
6008
  this.params.eGridCell.removeEventListener('contextmenu', this.onRightClick);
6009
+ this.params.eGridCell.removeEventListener('mousedown', this.onMouseDown);
6001
6010
  this.params.eGridCell.removeEventListener('mousedown', this.onMouseUp);
6002
6011
  }
6003
6012
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridPkeyCellRenderer, deps: [{ token: TruDataGridClipboard }, { token: TruUtil }], target: i0.ɵɵFactoryTarget.Component });