gantt-task-react-v 1.5.10 → 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.
@@ -29,6 +29,7 @@ export type TaskListProps = {
29
29
  isShowTaskNumbers?: boolean;
30
30
  mapTaskToNestedIndex: MapTaskToNestedIndex;
31
31
  onClick?: (task: RenderTask) => void;
32
+ onDoubleClick?: (task: RenderTask) => void;
32
33
  onExpanderClick: (task: Task) => void;
33
34
  scrollToBottomStep: () => void;
34
35
  scrollToTask: (task: Task) => void;
@@ -10204,6 +10204,7 @@ const TaskListTableRowInner = forwardRef(
10204
10204
  isDragging,
10205
10205
  isShowTaskNumbers,
10206
10206
  onClick,
10207
+ onDoubleClick,
10207
10208
  onExpanderClick,
10208
10209
  scrollToTask,
10209
10210
  selectTaskOnMouseDown,
@@ -10240,6 +10241,11 @@ const TaskListTableRowInner = forwardRef(
10240
10241
  },
10241
10242
  [handleOpenContextMenu, task]
10242
10243
  );
10244
+ const onRootDoubleClick = useCallback(() => {
10245
+ if (task.type !== "empty" && onDoubleClick) {
10246
+ onDoubleClick(task);
10247
+ }
10248
+ }, [onDoubleClick, task]);
10243
10249
  const dependencies = useMemo(() => {
10244
10250
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10245
10251
  if (!dependenciesAtLevel) {
@@ -10346,6 +10352,7 @@ const TaskListTableRowInner = forwardRef(
10346
10352
  ref,
10347
10353
  className: rowClassName,
10348
10354
  onMouseDown: onRootMouseDown,
10355
+ onDoubleClick: onRootDoubleClick,
10349
10356
  style: {
10350
10357
  height: fullRowHeight,
10351
10358
  backgroundColor,
@@ -10919,6 +10926,7 @@ const TaskListInner = ({
10919
10926
  mapTaskToNestedIndex,
10920
10927
  onExpanderClick,
10921
10928
  onClick,
10929
+ onDoubleClick,
10922
10930
  scrollToTask,
10923
10931
  selectTaskOnMouseDown,
10924
10932
  selectedIdsMirror,
@@ -10986,6 +10994,7 @@ const TaskListInner = ({
10986
10994
  isSelected: selectedIdsMirror[id],
10987
10995
  isShowTaskNumbers,
10988
10996
  onClick,
10997
+ onDoubleClick,
10989
10998
  onExpanderClick,
10990
10999
  scrollToTask,
10991
11000
  selectTaskOnMouseDown,
@@ -11010,6 +11019,7 @@ const TaskListInner = ({
11010
11019
  isShowTaskNumbers,
11011
11020
  mapTaskToNestedIndex,
11012
11021
  onClick,
11022
+ onDoubleClick,
11013
11023
  onExpanderClick,
11014
11024
  scrollToTask,
11015
11025
  selectTaskOnMouseDown,
@@ -20828,6 +20838,21 @@ const Gantt = (props) => {
20828
20838
  },
20829
20839
  [enableDrawer, taskBar]
20830
20840
  );
20841
+ const handleTaskListRowDoubleClick = useCallback(
20842
+ (task) => {
20843
+ if (task.type !== "empty") {
20844
+ if (enableDrawer) {
20845
+ setActiveArrowKey(null);
20846
+ setActiveTaskId(task.id);
20847
+ setDrawerData({ type: "task", task });
20848
+ }
20849
+ }
20850
+ if (taskList.onDoubleClickRow) {
20851
+ taskList.onDoubleClickRow(task);
20852
+ }
20853
+ },
20854
+ [enableDrawer, taskList]
20855
+ );
20831
20856
  const handleDrawerClose = useCallback(() => {
20832
20857
  setDrawerData(null);
20833
20858
  setActiveArrowKey(null);
@@ -21172,6 +21197,7 @@ const Gantt = (props) => {
21172
21197
  handleMoveTasksInside,
21173
21198
  handleOpenContextMenu: handleOpenContextMenuForRow,
21174
21199
  mapTaskToNestedIndex,
21200
+ onDoubleClick: handleTaskListRowDoubleClick,
21175
21201
  onExpanderClick,
21176
21202
  scrollToBottomStep,
21177
21203
  scrollToTopStep,
@@ -21201,6 +21227,7 @@ const Gantt = (props) => {
21201
21227
  handleMoveTaskBefore,
21202
21228
  handleMoveTasksInside,
21203
21229
  handleOpenContextMenuForRow,
21230
+ handleTaskListRowDoubleClick,
21204
21231
  mapTaskToNestedIndex,
21205
21232
  onExpanderClick,
21206
21233
  scrollToBottomStep,
@@ -10221,6 +10221,7 @@
10221
10221
  isDragging,
10222
10222
  isShowTaskNumbers,
10223
10223
  onClick,
10224
+ onDoubleClick,
10224
10225
  onExpanderClick,
10225
10226
  scrollToTask,
10226
10227
  selectTaskOnMouseDown,
@@ -10257,6 +10258,11 @@
10257
10258
  },
10258
10259
  [handleOpenContextMenu, task]
10259
10260
  );
10261
+ const onRootDoubleClick = React.useCallback(() => {
10262
+ if (task.type !== "empty" && onDoubleClick) {
10263
+ onDoubleClick(task);
10264
+ }
10265
+ }, [onDoubleClick, task]);
10260
10266
  const dependencies = React.useMemo(() => {
10261
10267
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10262
10268
  if (!dependenciesAtLevel) {
@@ -10363,6 +10369,7 @@
10363
10369
  ref,
10364
10370
  className: rowClassName,
10365
10371
  onMouseDown: onRootMouseDown,
10372
+ onDoubleClick: onRootDoubleClick,
10366
10373
  style: {
10367
10374
  height: fullRowHeight,
10368
10375
  backgroundColor,
@@ -10936,6 +10943,7 @@
10936
10943
  mapTaskToNestedIndex,
10937
10944
  onExpanderClick,
10938
10945
  onClick,
10946
+ onDoubleClick,
10939
10947
  scrollToTask,
10940
10948
  selectTaskOnMouseDown,
10941
10949
  selectedIdsMirror,
@@ -11003,6 +11011,7 @@
11003
11011
  isSelected: selectedIdsMirror[id],
11004
11012
  isShowTaskNumbers,
11005
11013
  onClick,
11014
+ onDoubleClick,
11006
11015
  onExpanderClick,
11007
11016
  scrollToTask,
11008
11017
  selectTaskOnMouseDown,
@@ -11027,6 +11036,7 @@
11027
11036
  isShowTaskNumbers,
11028
11037
  mapTaskToNestedIndex,
11029
11038
  onClick,
11039
+ onDoubleClick,
11030
11040
  onExpanderClick,
11031
11041
  scrollToTask,
11032
11042
  selectTaskOnMouseDown,
@@ -20845,6 +20855,21 @@
20845
20855
  },
20846
20856
  [enableDrawer, taskBar]
20847
20857
  );
20858
+ const handleTaskListRowDoubleClick = React.useCallback(
20859
+ (task) => {
20860
+ if (task.type !== "empty") {
20861
+ if (enableDrawer) {
20862
+ setActiveArrowKey(null);
20863
+ setActiveTaskId(task.id);
20864
+ setDrawerData({ type: "task", task });
20865
+ }
20866
+ }
20867
+ if (taskList.onDoubleClickRow) {
20868
+ taskList.onDoubleClickRow(task);
20869
+ }
20870
+ },
20871
+ [enableDrawer, taskList]
20872
+ );
20848
20873
  const handleDrawerClose = React.useCallback(() => {
20849
20874
  setDrawerData(null);
20850
20875
  setActiveArrowKey(null);
@@ -21189,6 +21214,7 @@
21189
21214
  handleMoveTasksInside,
21190
21215
  handleOpenContextMenu: handleOpenContextMenuForRow,
21191
21216
  mapTaskToNestedIndex,
21217
+ onDoubleClick: handleTaskListRowDoubleClick,
21192
21218
  onExpanderClick,
21193
21219
  scrollToBottomStep,
21194
21220
  scrollToTopStep,
@@ -21218,6 +21244,7 @@
21218
21244
  handleMoveTaskBefore,
21219
21245
  handleMoveTasksInside,
21220
21246
  handleOpenContextMenuForRow,
21247
+ handleTaskListRowDoubleClick,
21221
21248
  mapTaskToNestedIndex,
21222
21249
  onExpanderClick,
21223
21250
  scrollToBottomStep,
@@ -184,6 +184,7 @@ export type TaskListTableRowProps = {
184
184
  isSelected: boolean;
185
185
  isShowTaskNumbers: boolean;
186
186
  onClick: (task: RenderTask) => void;
187
+ onDoubleClick?: (task: RenderTask) => void;
187
188
  onExpanderClick: (task: Task) => void;
188
189
  scrollToTask: (task: Task) => void;
189
190
  selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
@@ -184,6 +184,11 @@ export interface GanttTaskListProps {
184
184
  * Render bottom table content
185
185
  */
186
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;
187
192
  }
188
193
  export interface TableRenderBottomProps {
189
194
  height?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.5.10",
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",