gantt-task-react-v 1.1.10 → 1.1.12

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.
@@ -8,6 +8,8 @@ type ContextMenuProps = {
8
8
  handleAction: (task: RenderTask, action: (meta: ActionMetaType) => void) => void;
9
9
  handleCloseContextMenu: () => void;
10
10
  options: ContextMenuOptionType[];
11
+ /** Optional callback invoked to select the task that opened the context menu (useful for task list) */
12
+ onSelectTask?: (taskId: string) => void;
11
13
  /** Optional boundary element to contain the context menu (like tooltips) */
12
14
  boundaryElement?: RefObject<HTMLElement>;
13
15
  };
@@ -18094,6 +18094,10 @@ function ContextMenu(props) {
18094
18094
  return;
18095
18095
  }
18096
18096
  handleAction(task, option.action);
18097
+ requestAnimationFrame(() => {
18098
+ var _a2;
18099
+ (_a2 = props.onSelectTask) == null ? void 0 : _a2.call(props, task.id);
18100
+ });
18097
18101
  },
18098
18102
  [handleAction, handleCloseContextMenu, task]
18099
18103
  );
@@ -19007,6 +19011,7 @@ const Gantt = (props) => {
19007
19011
  cutSelectedTasks,
19008
19012
  cutTask,
19009
19013
  resetSelectedTasks,
19014
+ selectTask,
19010
19015
  selectTaskOnMouseDown,
19011
19016
  selectedIdsMirror
19012
19017
  } = useSelection(
@@ -20261,6 +20266,7 @@ const Gantt = (props) => {
20261
20266
  distances,
20262
20267
  handleAction,
20263
20268
  handleCloseContextMenu,
20269
+ onSelectTask: selectTask,
20264
20270
  options: contextMenuOptions,
20265
20271
  boundaryElement: taskListHorizontalScrollRef
20266
20272
  }
@@ -18111,6 +18111,10 @@
18111
18111
  return;
18112
18112
  }
18113
18113
  handleAction(task, option.action);
18114
+ requestAnimationFrame(() => {
18115
+ var _a2;
18116
+ (_a2 = props.onSelectTask) == null ? void 0 : _a2.call(props, task.id);
18117
+ });
18114
18118
  },
18115
18119
  [handleAction, handleCloseContextMenu, task]
18116
18120
  );
@@ -19024,6 +19028,7 @@
19024
19028
  cutSelectedTasks,
19025
19029
  cutTask,
19026
19030
  resetSelectedTasks,
19031
+ selectTask,
19027
19032
  selectTaskOnMouseDown,
19028
19033
  selectedIdsMirror
19029
19034
  } = useSelection(
@@ -20278,6 +20283,7 @@
20278
20283
  distances,
20279
20284
  handleAction,
20280
20285
  handleCloseContextMenu,
20286
+ onSelectTask: selectTask,
20281
20287
  options: contextMenuOptions,
20282
20288
  boundaryElement: taskListHorizontalScrollRef
20283
20289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
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",