@ssa-ui-kit/core 2.28.0 → 2.28.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.
@@ -1,7 +1,8 @@
1
- import { LineProps } from '@nivo/line';
1
+ import { LineProps, Datum } from '@nivo/line';
2
2
  import { TrendLineTooltipProps } from './TrendLineTooltip';
3
3
  export interface TrendLineProps extends LineProps {
4
4
  color?: string;
5
5
  tooltipValueFormat?: TrendLineTooltipProps['valueFormat'];
6
+ lastActivePoint?: Datum;
6
7
  }
7
8
  export declare const TrendLine: ({ color, tooltipValueFormat, ...props }: TrendLineProps) => import("@emotion/react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -10767,19 +10767,26 @@ const TrendLineTooltip = ({
10767
10767
 
10768
10768
  const ActivePoint = ({
10769
10769
  currentPoint,
10770
+ lastActivePoint,
10771
+ points,
10770
10772
  ...props
10771
- }) => (0,jsx_runtime_namespaceObject.jsx)("g", {
10772
- children: currentPoint && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DotsItem, {
10773
- size: props.pointSize || 10,
10774
- borderWidth: props.pointBorderWidth || 10,
10775
- x: currentPoint.x,
10776
- y: currentPoint.y,
10777
- datum: currentPoint.data,
10778
- color: currentPoint.color,
10779
- borderColor: currentPoint.borderColor,
10780
- labelYOffset: props.pointLabelYOffset
10781
- }, currentPoint.id)
10782
- });
10773
+ }) => {
10774
+ const activePoint = lastActivePoint ? points.find(({
10775
+ data
10776
+ }) => data.x === lastActivePoint.x && data.y === lastActivePoint.y) : currentPoint;
10777
+ return (0,jsx_runtime_namespaceObject.jsx)("g", {
10778
+ children: activePoint && (0,jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DotsItem, {
10779
+ size: props.pointSize || 10,
10780
+ borderWidth: props.pointBorderWidth || 10,
10781
+ x: activePoint.x,
10782
+ y: activePoint.y,
10783
+ datum: activePoint.data,
10784
+ color: activePoint.color,
10785
+ borderColor: activePoint.borderColor,
10786
+ labelYOffset: props.pointLabelYOffset
10787
+ }, activePoint.id)
10788
+ });
10789
+ };
10783
10790
  const TrendLine = ({
10784
10791
  color,
10785
10792
  tooltipValueFormat,
@@ -10891,9 +10898,6 @@ const BigNumberChartComponent = ({
10891
10898
  if (!interactive) return;
10892
10899
  setHoveredValueThrottled(data.data);
10893
10900
  };
10894
- const handleMouseLeave = () => {
10895
- setHoveredValueThrottled(null);
10896
- };
10897
10901
  const value = hoveredValue ?? lastValue;
10898
10902
  return (0,jsx_runtime_namespaceObject.jsx)(WithWidgetCard, {
10899
10903
  features: features,
@@ -10924,7 +10928,7 @@ const BigNumberChartComponent = ({
10924
10928
  data
10925
10929
  }],
10926
10930
  onMouseMove: handleMouseMove,
10927
- onMouseLeave: handleMouseLeave
10931
+ lastActivePoint: value
10928
10932
  })
10929
10933
  })
10930
10934
  })]