@capillarytech/blaze-ui 5.2.4 → 5.2.5

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.
package/index.js CHANGED
@@ -17029,7 +17029,8 @@ const CapLevelGraphRenderer = _ref => {
17029
17029
  const targetToolTip = (0, _get.default)(nodePostionObj, [targetId, 'toolTip']);
17030
17030
  if (sourceToolTip && targetToolTip) {
17031
17031
  // Type assertion needed because @antv/x6 Edge type may not expose addTools in TypeScript definitions
17032
- edge.addTools == null || edge.addTools([{
17032
+ const edgeWithTools = edge;
17033
+ edgeWithTools.addTools == null || edgeWithTools.addTools([{
17033
17034
  name: 'tooltip',
17034
17035
  args: {
17035
17036
  tooltip: sourceToolTip + " - " + targetToolTip
@@ -26648,16 +26649,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
26648
26649
  * definitions may not fully expose all ToolItem properties.
26649
26650
  */
26650
26651
  class TooltipTool extends _x.ToolsView.ToolItem {
26651
- /** DOM element for tooltip rendering */
26652
-
26653
- /** Delay in milliseconds before showing/hiding tooltip */
26654
-
26655
- /** Current tooltip visibility state */
26656
-
26657
- /** Timer reference for delayed tooltip operations */
26658
-
26659
- /** React root instance for rendering tooltip */
26660
-
26661
26652
  constructor(props) {
26662
26653
  super(props);
26663
26654
  this.onMouseMove = e => {
@@ -26673,7 +26664,6 @@ class TooltipTool extends _x.ToolsView.ToolItem {
26673
26664
  }, this.delay);
26674
26665
  };
26675
26666
  this.delay = 100;
26676
- this.tooltipVisible = false;
26677
26667
  }
26678
26668
  render() {
26679
26669
  super.render();
@@ -26686,18 +26676,14 @@ class TooltipTool extends _x.ToolsView.ToolItem {
26686
26676
  return this;
26687
26677
  }
26688
26678
  toggleTooltip(visible) {
26689
- if (!this.root) {
26690
- this.root = (0, _client.createRoot)(this.knob);
26691
- }
26679
+ const root = (0, _client.createRoot)(this.knob);
26692
26680
  if (visible) {
26693
26681
  const tooltipText = this.options.tooltip;
26694
- this.root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
26682
+ root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_CapTooltip.default, {
26695
26683
  title: tooltipText,
26696
- open: true,
26684
+ visible: true,
26697
26685
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {})
26698
26686
  }));
26699
- } else {
26700
- this.root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {}));
26701
26687
  }
26702
26688
  this.tooltipVisible = visible;
26703
26689
  }
@@ -26722,9 +26708,7 @@ class TooltipTool extends _x.ToolsView.ToolItem {
26722
26708
  if (this.timer) {
26723
26709
  window.clearTimeout(this.timer);
26724
26710
  }
26725
- this.timer = window.setTimeout(() => {
26726
- this.toggleTooltip(false);
26727
- }, this.delay);
26711
+ window.setTimeout(() => this.toggleTooltip(false), this.delay);
26728
26712
  document.removeEventListener('mousemove', this.onMouseMove);
26729
26713
  }
26730
26714
  delegateEvents() {
@@ -26734,21 +26718,10 @@ class TooltipTool extends _x.ToolsView.ToolItem {
26734
26718
  }
26735
26719
  onRemove() {
26736
26720
  const cellView = this.cellView;
26737
- cellView.off('cell:mouseleave', this.onMouseLeave);
26738
- if (this.timer) {
26739
- window.clearTimeout(this.timer);
26740
- }
26741
- if (this.root) {
26742
- this.root.unmount();
26743
- }
26744
- document.removeEventListener('mousemove', this.onMouseMove);
26721
+ // @ts-expect-error - x6's off method signature may vary
26722
+ cellView.off('cell:mouseleave', this.onMouseLeave, this);
26745
26723
  }
26746
26724
  }
26747
-
26748
- /**
26749
- * Type for TooltipTool config method
26750
- */
26751
-
26752
26725
  TooltipTool.config({
26753
26726
  tagName: 'div',
26754
26727
  isSVGElement: false