@datorama/core 23.0.4-rc.2 → 23.0.4-rc.4

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.
@@ -15432,7 +15432,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
15432
15432
  });
15433
15433
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15434
15434
  this.contentInit.complete();
15435
- this.tooltip && this.clearTooltip();
15435
+ this.clearTooltip();
15436
15436
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15437
15437
  this.rowHoverComponent = null;
15438
15438
  };
@@ -15662,40 +15662,51 @@ var DatoGridControllerComponent = /** @class */ (function () {
15662
15662
  });
15663
15663
  this.addOnHoverElement();
15664
15664
  }
15665
- agGrid.cellMouseOver
15666
- .pipe(filter$1(function (_a) {
15667
- var node = _a.node, column = _a.column;
15668
- return lastHoveredCell !== node.id + "-" + column.getColId();
15669
- }), untilDestroyed(this))
15670
- .subscribe(function (event) {
15671
- lastHoveredCell = event.node.id + "-" + event.column.getColId();
15665
+ agGrid.cellMouseOver.pipe(untilDestroyed(this)).subscribe(function (event) {
15666
+ var node = event.node, column = event.column;
15667
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15668
+ clearTimeout(_this.cellMouseOutTimer);
15669
+ return;
15670
+ }
15671
+ lastHoveredCell = node.id + "-" + column.getColId();
15672
15672
  _this.showTooltip(event);
15673
15673
  var row = event.event.target.parentElement;
15674
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15674
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15675
15675
  var previousNode = _this.lastHoveredRow;
15676
15676
  _this.lastHoveredRow = row;
15677
15677
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15678
15678
  _this.setOnHoverState(true, event);
15679
15679
  }
15680
15680
  });
15681
- var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15682
- onTooltipOut
15681
+ var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
15682
+ onTooltipOut.pipe(untilDestroyed(this)).subscribe(function () {
15683
+ lastHoveredCell = null;
15684
+ _this.clearTooltip();
15685
+ });
15686
+ agGrid.cellMouseOut
15683
15687
  .pipe(filter$1(function () { return !isNil(_this.tooltip); }), untilDestroyed(this))
15684
15688
  .subscribe(function () {
15685
- _this.clearTooltip();
15689
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15686
15690
  });
15687
15691
  };
15688
15692
  /**
15689
15693
  * Dispose the tooltip
15690
15694
  */
15691
15695
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15692
- this.tooltip.dispose();
15696
+ this.tooltip && this.tooltip.dispose();
15693
15697
  this.tooltip = null;
15694
15698
  };
15695
15699
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15696
15700
  var cell = event.event.target;
15701
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15702
+ cell = cell.parentElement;
15703
+ }
15704
+ if (event.colDef.editable) {
15705
+ cell = cell.querySelector('.value-wrapper') || cell;
15706
+ }
15697
15707
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15698
15708
  if (textOverflow) {
15709
+ clearTimeout(this.cellMouseOutTimer);
15699
15710
  var params = { cell: cell, value: cell.innerText };
15700
15711
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15701
15712
  }