gantt-task-react-v 1.0.44 → 1.0.45

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.
@@ -17050,7 +17050,7 @@ function useRole(context, props) {
17050
17050
  };
17051
17051
  }, [enabled, role, ariaRole, open, floatingId, referenceId, isNested]);
17052
17052
  }
17053
- const useTaskTooltip = (changeInProgress) => {
17053
+ const useTaskTooltip = (changeInProgress, boundaryElement) => {
17054
17054
  const [hoverTooltipTask, setHoverTooltipTask] = useState(null);
17055
17055
  const [hoverTooltipEl, setHoverTooltipEl] = useState(null);
17056
17056
  const tooltipTask = useMemo(() => {
@@ -17073,7 +17073,14 @@ const useTaskTooltip = (changeInProgress) => {
17073
17073
  context
17074
17074
  } = useFloating({
17075
17075
  open: Boolean(tooltipTask),
17076
- middleware: [offset(10), flip(), shift()],
17076
+ middleware: [
17077
+ offset(10),
17078
+ flip(),
17079
+ shift({
17080
+ boundary: (boundaryElement == null ? void 0 : boundaryElement.current) || void 0,
17081
+ padding: 8
17082
+ })
17083
+ ],
17077
17084
  whileElementsMounted: autoUpdate,
17078
17085
  strategy: "absolute"
17079
17086
  });
@@ -19256,7 +19263,7 @@ const Gantt = (props) => {
19256
19263
  setFloatingRef,
19257
19264
  getFloatingProps,
19258
19265
  onChangeTooltipTask
19259
- } = useTaskTooltip(changeInProgress);
19266
+ } = useTaskTooltip(changeInProgress, verticalGanttContainerRef);
19260
19267
  const handleDeleteTasks = useCallback(
19261
19268
  (tasksForDelete) => {
19262
19269
  onChangeTooltipTask(null, null);
@@ -17067,7 +17067,7 @@
17067
17067
  };
17068
17068
  }, [enabled, role, ariaRole, open, floatingId, referenceId, isNested]);
17069
17069
  }
17070
- const useTaskTooltip = (changeInProgress) => {
17070
+ const useTaskTooltip = (changeInProgress, boundaryElement) => {
17071
17071
  const [hoverTooltipTask, setHoverTooltipTask] = React.useState(null);
17072
17072
  const [hoverTooltipEl, setHoverTooltipEl] = React.useState(null);
17073
17073
  const tooltipTask = React.useMemo(() => {
@@ -17090,7 +17090,14 @@
17090
17090
  context
17091
17091
  } = useFloating({
17092
17092
  open: Boolean(tooltipTask),
17093
- middleware: [offset(10), flip(), shift()],
17093
+ middleware: [
17094
+ offset(10),
17095
+ flip(),
17096
+ shift({
17097
+ boundary: (boundaryElement == null ? void 0 : boundaryElement.current) || void 0,
17098
+ padding: 8
17099
+ })
17100
+ ],
17094
17101
  whileElementsMounted: autoUpdate,
17095
17102
  strategy: "absolute"
17096
17103
  });
@@ -19273,7 +19280,7 @@
19273
19280
  setFloatingRef,
19274
19281
  getFloatingProps,
19275
19282
  onChangeTooltipTask
19276
- } = useTaskTooltip(changeInProgress);
19283
+ } = useTaskTooltip(changeInProgress, verticalGanttContainerRef);
19277
19284
  const handleDeleteTasks = React.useCallback(
19278
19285
  (tasksForDelete) => {
19279
19286
  onChangeTooltipTask(null, null);
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import { RefObject } from "react";
2
2
  import type { ChangeInProgress, Task } from "../types";
3
- export declare const useTaskTooltip: (changeInProgress: ChangeInProgress | null) => {
3
+ export declare const useTaskTooltip: (changeInProgress: ChangeInProgress | null, boundaryElement?: RefObject<HTMLElement>) => {
4
4
  tooltipTask: Task;
5
5
  tooltipX: number;
6
6
  tooltipY: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript.",
5
5
  "author": "aguilanbon",
6
6
  "homepage": "https://github.com/aguilanbon/gantt-task-react-v",