@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.
@@ -15631,7 +15631,7 @@
15631
15631
  });
15632
15632
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15633
15633
  this.contentInit.complete();
15634
- this.tooltip && this.clearTooltip();
15634
+ this.clearTooltip();
15635
15635
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15636
15636
  this.rowHoverComponent = null;
15637
15637
  };
@@ -15861,40 +15861,49 @@
15861
15861
  });
15862
15862
  this.addOnHoverElement();
15863
15863
  }
15864
- agGrid.cellMouseOver
15865
- .pipe(operators.filter(function (_a) {
15866
- var node = _a.node, column = _a.column;
15867
- return lastHoveredCell !== node.id + "-" + column.getColId();
15868
- }), ngxTakeUntilDestroy.untilDestroyed(this))
15869
- .subscribe(function (event) {
15870
- lastHoveredCell = event.node.id + "-" + event.column.getColId();
15864
+ agGrid.cellMouseOver.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (event) {
15865
+ var node = event.node, column = event.column;
15866
+ if (lastHoveredCell === node.id + "-" + column.getColId()) {
15867
+ clearTimeout(_this.cellMouseOutTimer);
15868
+ return;
15869
+ }
15870
+ lastHoveredCell = node.id + "-" + column.getColId();
15871
15871
  _this.showTooltip(event);
15872
15872
  var row = event.event.target.parentElement;
15873
- if (onHoverEnabled && (event.node.group === false || isNil(event.node.group)) && _this.lastHoveredRow !== row) {
15873
+ if (onHoverEnabled && (node.group === false || isNil(node.group)) && _this.lastHoveredRow !== row) {
15874
15874
  var previousNode = _this.lastHoveredRow;
15875
15875
  _this.lastHoveredRow = row;
15876
15876
  _this.toggleRowHoverClass([previousNode, _this.lastHoveredRow]);
15877
15877
  _this.setOnHoverState(true, event);
15878
15878
  }
15879
15879
  });
15880
- var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'), agGrid.cellMouseOut);
15880
+ var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'));
15881
15881
  onTooltipOut
15882
15882
  .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
15883
15883
  .subscribe(function () {
15884
15884
  _this.clearTooltip();
15885
15885
  });
15886
+ agGrid.cellMouseOut
15887
+ .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
15888
+ .subscribe(function () {
15889
+ _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
15890
+ });
15886
15891
  };
15887
15892
  /**
15888
15893
  * Dispose the tooltip
15889
15894
  */
15890
15895
  DatoGridControllerComponent.prototype.clearTooltip = function () {
15891
- this.tooltip.dispose();
15896
+ this.tooltip && this.tooltip.dispose();
15892
15897
  this.tooltip = null;
15893
15898
  };
15894
15899
  DatoGridControllerComponent.prototype.showTooltip = function (event) {
15895
15900
  var cell = event.event.target;
15901
+ if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
15902
+ cell = cell.parentElement;
15903
+ }
15896
15904
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
15897
15905
  if (textOverflow) {
15906
+ clearTimeout(this.cellMouseOutTimer);
15898
15907
  var params = { cell: cell, value: cell.innerText };
15899
15908
  isNil(this.tooltip) ? this.createAndShowTooltip(params) : this.updateTooltip(params);
15900
15909
  }