@cloudtower/eagle 0.34.13 → 0.35.1

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.
@@ -22,6 +22,23 @@ const LineChartColorBlock = ({ background, borderd = false }) => /* @__PURE__ */
22
22
  const LineChartLegend = (props) => {
23
23
  const { deselected, onClick, legends, onHover, hovering, hovereringSelf } = props;
24
24
  const [isDropdownOpen, setIsDropdownOpen] = React__default.useState(false);
25
+ const shouldSkipHover = (e) => {
26
+ const target = e.target;
27
+ const relatedTarget = e.relatedTarget;
28
+ const isFromIconSuffix = (target == null ? void 0 : target.closest(".icon-suffix-wrapper")) !== null;
29
+ const isToIconSuffix = (relatedTarget == null ? void 0 : relatedTarget.closest(".icon-suffix-wrapper")) !== null;
30
+ return isFromIconSuffix || isToIconSuffix;
31
+ };
32
+ const handleMouseEnter = (legendId) => (e) => {
33
+ if (!shouldSkipHover(e)) {
34
+ onHover("enter", legendId);
35
+ }
36
+ };
37
+ const handleMouseLeave = (legendId) => (e) => {
38
+ if (!shouldSkipHover(e)) {
39
+ onHover("leave", legendId);
40
+ }
41
+ };
25
42
  return /* @__PURE__ */ React__default.createElement(
26
43
  ExtraOverflow,
27
44
  {
@@ -39,13 +56,13 @@ const LineChartLegend = (props) => {
39
56
  className: cs(
40
57
  LegendItemsStyleDropdown,
41
58
  deselected.includes(legend.id) && "deselected",
42
- hovering.includes(legend.id) && "hovering",
59
+ (hovering == null ? void 0 : hovering.includes(legend.id)) && "hovering",
43
60
  hovereringSelf.includes(legend.id) && "hoverering-self"
44
61
  ),
45
62
  key: legend.id,
46
63
  onClick: () => onClick(legend.id),
47
- onMouseEnter: () => onHover("enter", legend.id),
48
- onMouseLeave: () => onHover("leave", legend.id)
64
+ onMouseEnter: () => handleMouseEnter(legend.id),
65
+ onMouseLeave: () => handleMouseLeave(legend.id)
49
66
  },
50
67
  /* @__PURE__ */ React__default.createElement(LineChartColorBlock, { background: legend.color }),
51
68
  /* @__PURE__ */ React__default.createElement("span", { className: "legend-name" }, /* @__PURE__ */ React__default.createElement(Truncate, { text: legend.name, len: 50, backLen: 20 })),
@@ -72,12 +89,12 @@ const LineChartLegend = (props) => {
72
89
  className: cs(
73
90
  LegendItemsStyle,
74
91
  deselected.includes(legend.id) && "deselected",
75
- hovering.includes(legend.id) && "hovering",
92
+ (hovering == null ? void 0 : hovering.includes(legend.id)) && "hovering",
76
93
  hovereringSelf.includes(legend.id) && "hoverering-self"
77
94
  ),
78
95
  key: legend.id,
79
- onMouseEnter: () => onHover("enter", legend.id),
80
- onMouseLeave: () => onHover("leave", legend.id),
96
+ onMouseEnter: handleMouseEnter(legend.id),
97
+ onMouseLeave: handleMouseLeave(legend.id),
81
98
  onClick: () => onClick(legend.id)
82
99
  },
83
100
  /* @__PURE__ */ React__default.createElement(LineChartColorBlock, { background: legend.color }),