gantt-task-react-v 1.5.11 → 1.5.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.
@@ -10242,10 +10242,9 @@ const TaskListTableRowInner = forwardRef(
10242
10242
  [handleOpenContextMenu, task]
10243
10243
  );
10244
10244
  const onRootDoubleClick = useCallback(() => {
10245
- if (!onDoubleClick || task.type === "empty") {
10246
- return;
10245
+ if (task.type !== "empty" && onDoubleClick) {
10246
+ onDoubleClick(task);
10247
10247
  }
10248
- onDoubleClick(task);
10249
10248
  }, [onDoubleClick, task]);
10250
10249
  const dependencies = useMemo(() => {
10251
10250
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
@@ -20839,17 +20838,20 @@ const Gantt = (props) => {
20839
20838
  },
20840
20839
  [enableDrawer, taskBar]
20841
20840
  );
20842
- const handleTaskListDoubleClick = useCallback(
20841
+ const handleTaskListRowDoubleClick = useCallback(
20843
20842
  (task) => {
20844
- if (task.type === "empty") {
20845
- return;
20843
+ if (task.type !== "empty") {
20844
+ if (enableDrawer) {
20845
+ setActiveArrowKey(null);
20846
+ setActiveTaskId(task.id);
20847
+ setDrawerData({ type: "task", task });
20848
+ }
20846
20849
  }
20847
- handleTaskDoubleClick(task);
20848
- if (taskList.onDoubleClick) {
20849
- taskList.onDoubleClick(task);
20850
+ if (taskList.onDoubleClickRow) {
20851
+ taskList.onDoubleClickRow(task);
20850
20852
  }
20851
20853
  },
20852
- [handleTaskDoubleClick, taskList]
20854
+ [enableDrawer, taskList]
20853
20855
  );
20854
20856
  const handleDrawerClose = useCallback(() => {
20855
20857
  setDrawerData(null);
@@ -21195,7 +21197,7 @@ const Gantt = (props) => {
21195
21197
  handleMoveTasksInside,
21196
21198
  handleOpenContextMenu: handleOpenContextMenuForRow,
21197
21199
  mapTaskToNestedIndex,
21198
- onDoubleClick: handleTaskListDoubleClick,
21200
+ onDoubleClick: handleTaskListRowDoubleClick,
21199
21201
  onExpanderClick,
21200
21202
  scrollToBottomStep,
21201
21203
  scrollToTopStep,
@@ -21225,9 +21227,9 @@ const Gantt = (props) => {
21225
21227
  handleMoveTaskBefore,
21226
21228
  handleMoveTasksInside,
21227
21229
  handleOpenContextMenuForRow,
21230
+ handleTaskListRowDoubleClick,
21228
21231
  mapTaskToNestedIndex,
21229
21232
  onExpanderClick,
21230
- handleTaskListDoubleClick,
21231
21233
  scrollToBottomStep,
21232
21234
  scrollToTask,
21233
21235
  scrollToTopStep,
@@ -10259,10 +10259,9 @@
10259
10259
  [handleOpenContextMenu, task]
10260
10260
  );
10261
10261
  const onRootDoubleClick = React.useCallback(() => {
10262
- if (!onDoubleClick || task.type === "empty") {
10263
- return;
10262
+ if (task.type !== "empty" && onDoubleClick) {
10263
+ onDoubleClick(task);
10264
10264
  }
10265
- onDoubleClick(task);
10266
10265
  }, [onDoubleClick, task]);
10267
10266
  const dependencies = React.useMemo(() => {
10268
10267
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
@@ -20856,17 +20855,20 @@
20856
20855
  },
20857
20856
  [enableDrawer, taskBar]
20858
20857
  );
20859
- const handleTaskListDoubleClick = React.useCallback(
20858
+ const handleTaskListRowDoubleClick = React.useCallback(
20860
20859
  (task) => {
20861
- if (task.type === "empty") {
20862
- return;
20860
+ if (task.type !== "empty") {
20861
+ if (enableDrawer) {
20862
+ setActiveArrowKey(null);
20863
+ setActiveTaskId(task.id);
20864
+ setDrawerData({ type: "task", task });
20865
+ }
20863
20866
  }
20864
- handleTaskDoubleClick(task);
20865
- if (taskList.onDoubleClick) {
20866
- taskList.onDoubleClick(task);
20867
+ if (taskList.onDoubleClickRow) {
20868
+ taskList.onDoubleClickRow(task);
20867
20869
  }
20868
20870
  },
20869
- [handleTaskDoubleClick, taskList]
20871
+ [enableDrawer, taskList]
20870
20872
  );
20871
20873
  const handleDrawerClose = React.useCallback(() => {
20872
20874
  setDrawerData(null);
@@ -21212,7 +21214,7 @@
21212
21214
  handleMoveTasksInside,
21213
21215
  handleOpenContextMenu: handleOpenContextMenuForRow,
21214
21216
  mapTaskToNestedIndex,
21215
- onDoubleClick: handleTaskListDoubleClick,
21217
+ onDoubleClick: handleTaskListRowDoubleClick,
21216
21218
  onExpanderClick,
21217
21219
  scrollToBottomStep,
21218
21220
  scrollToTopStep,
@@ -21242,9 +21244,9 @@
21242
21244
  handleMoveTaskBefore,
21243
21245
  handleMoveTasksInside,
21244
21246
  handleOpenContextMenuForRow,
21247
+ handleTaskListRowDoubleClick,
21245
21248
  mapTaskToNestedIndex,
21246
21249
  onExpanderClick,
21247
- handleTaskListDoubleClick,
21248
21250
  scrollToBottomStep,
21249
21251
  scrollToTask,
21250
21252
  scrollToTopStep,
@@ -180,14 +180,15 @@ export interface GanttTaskListProps {
180
180
  * Callback when column visibility is toggled
181
181
  */
182
182
  onColumnVisibilityChange?: OnColumnVisibilityChange;
183
- /**
184
- * Invokes on task list row double click
185
- */
186
- onDoubleClick?: (task: RenderTask) => void;
187
183
  /**
188
184
  * Render bottom table content
189
185
  */
190
186
  tableBottom?: TableRenderBottomProps;
187
+ /**
188
+ * Invokes on double-click on a task list row.
189
+ * Receives the full task data of the double-clicked row.
190
+ */
191
+ onDoubleClickRow?: (task: RenderTask) => void;
191
192
  }
192
193
  export interface TableRenderBottomProps {
193
194
  height?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.5.11",
3
+ "version": "1.5.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",