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

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,49 @@ 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);
15681
+ var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
15682
15682
  onTooltipOut
15683
15683
  .pipe(filter$1(function () { return !isNil(_this.tooltip); }), untilDestroyed(this))
15684
15684
  .subscribe(function () {
15685
15685
  _this.clearTooltip();
15686
15686
  });
15687
+ agGrid.cellMouseOut
15688
+ .pipe(filter$1(function () { return !isNil(_this.tooltip); }), untilDestroyed(this))
15689
+ .subscribe(function () {
15690
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15691
+ });
15687
15692
  };
15688
15693
  /**
15689
15694
  * Dispose the tooltip
15690
15695
  */
15691
15696
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15692
- this.tooltip.dispose();
15697
+ this.tooltip && this.tooltip.dispose();
15693
15698
  this.tooltip = null;
15694
15699
  };
15695
15700
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15696
15701
  var cell = event.event.target;
15702
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15703
+ cell = cell.parentElement;
15704
+ }
15697
15705
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15698
15706
  if (textOverflow) {
15707
+ clearTimeout(this.cellMouseOutTimer);
15699
15708
  var params = { cell: cell, value: cell.innerText };
15700
15709
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15701
15710
  }