gantt-task-react-v 1.5.10 → 1.5.11

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,12 @@ const TaskListTableRowInner = forwardRef(
10240
10241
  },
10241
10242
  [handleOpenContextMenu, task]
10242
10243
  );
10244
+ const onRootDoubleClick = useCallback(() => {
10245
+ if (!onDoubleClick || task.type === "empty") {
10246
+ return;
10247
+ }
10248
+ onDoubleClick(task);
10249
+ }, [onDoubleClick, task]);
10243
10250
  const dependencies = useMemo(() => {
10244
10251
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10245
10252
  if (!dependenciesAtLevel) {
@@ -10346,6 +10353,7 @@ const TaskListTableRowInner = forwardRef(
10346
10353
  ref,
10347
10354
  className: rowClassName,
10348
10355
  onMouseDown: onRootMouseDown,
10356
+ onDoubleClick: onRootDoubleClick,
10349
10357
  style: {
10350
10358
  height: fullRowHeight,
10351
10359
  backgroundColor,
@@ -10919,6 +10927,7 @@ const TaskListInner = ({
10919
10927
  mapTaskToNestedIndex,
10920
10928
  onExpanderClick,
10921
10929
  onClick,
10930
+ onDoubleClick,
10922
10931
  scrollToTask,
10923
10932
  selectTaskOnMouseDown,
10924
10933
  selectedIdsMirror,
@@ -10986,6 +10995,7 @@ const TaskListInner = ({
10986
10995
  isSelected: selectedIdsMirror[id],
10987
10996
  isShowTaskNumbers,
10988
10997
  onClick,
10998
+ onDoubleClick,
10989
10999
  onExpanderClick,
10990
11000
  scrollToTask,
10991
11001
  selectTaskOnMouseDown,
@@ -11010,6 +11020,7 @@ const TaskListInner = ({
11010
11020
  isShowTaskNumbers,
11011
11021
  mapTaskToNestedIndex,
11012
11022
  onClick,
11023
+ onDoubleClick,
11013
11024
  onExpanderClick,
11014
11025
  scrollToTask,
11015
11026
  selectTaskOnMouseDown,
@@ -20828,6 +20839,18 @@ const Gantt = (props) => {
20828
20839
  },
20829
20840
  [enableDrawer, taskBar]
20830
20841
  );
20842
+ const handleTaskListDoubleClick = useCallback(
20843
+ (task) => {
20844
+ if (task.type === "empty") {
20845
+ return;
20846
+ }
20847
+ handleTaskDoubleClick(task);
20848
+ if (taskList.onDoubleClick) {
20849
+ taskList.onDoubleClick(task);
20850
+ }
20851
+ },
20852
+ [handleTaskDoubleClick, taskList]
20853
+ );
20831
20854
  const handleDrawerClose = useCallback(() => {
20832
20855
  setDrawerData(null);
20833
20856
  setActiveArrowKey(null);
@@ -21172,6 +21195,7 @@ const Gantt = (props) => {
21172
21195
  handleMoveTasksInside,
21173
21196
  handleOpenContextMenu: handleOpenContextMenuForRow,
21174
21197
  mapTaskToNestedIndex,
21198
+ onDoubleClick: handleTaskListDoubleClick,
21175
21199
  onExpanderClick,
21176
21200
  scrollToBottomStep,
21177
21201
  scrollToTopStep,
@@ -21203,6 +21227,7 @@ const Gantt = (props) => {
21203
21227
  handleOpenContextMenuForRow,
21204
21228
  mapTaskToNestedIndex,
21205
21229
  onExpanderClick,
21230
+ handleTaskListDoubleClick,
21206
21231
  scrollToBottomStep,
21207
21232
  scrollToTask,
21208
21233
  scrollToTopStep,
@@ -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,12 @@
10257
10258
  },
10258
10259
  [handleOpenContextMenu, task]
10259
10260
  );
10261
+ const onRootDoubleClick = React.useCallback(() => {
10262
+ if (!onDoubleClick || task.type === "empty") {
10263
+ return;
10264
+ }
10265
+ onDoubleClick(task);
10266
+ }, [onDoubleClick, task]);
10260
10267
  const dependencies = React.useMemo(() => {
10261
10268
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10262
10269
  if (!dependenciesAtLevel) {
@@ -10363,6 +10370,7 @@
10363
10370
  ref,
10364
10371
  className: rowClassName,
10365
10372
  onMouseDown: onRootMouseDown,
10373
+ onDoubleClick: onRootDoubleClick,
10366
10374
  style: {
10367
10375
  height: fullRowHeight,
10368
10376
  backgroundColor,
@@ -10936,6 +10944,7 @@
10936
10944
  mapTaskToNestedIndex,
10937
10945
  onExpanderClick,
10938
10946
  onClick,
10947
+ onDoubleClick,
10939
10948
  scrollToTask,
10940
10949
  selectTaskOnMouseDown,
10941
10950
  selectedIdsMirror,
@@ -11003,6 +11012,7 @@
11003
11012
  isSelected: selectedIdsMirror[id],
11004
11013
  isShowTaskNumbers,
11005
11014
  onClick,
11015
+ onDoubleClick,
11006
11016
  onExpanderClick,
11007
11017
  scrollToTask,
11008
11018
  selectTaskOnMouseDown,
@@ -11027,6 +11037,7 @@
11027
11037
  isShowTaskNumbers,
11028
11038
  mapTaskToNestedIndex,
11029
11039
  onClick,
11040
+ onDoubleClick,
11030
11041
  onExpanderClick,
11031
11042
  scrollToTask,
11032
11043
  selectTaskOnMouseDown,
@@ -20845,6 +20856,18 @@
20845
20856
  },
20846
20857
  [enableDrawer, taskBar]
20847
20858
  );
20859
+ const handleTaskListDoubleClick = React.useCallback(
20860
+ (task) => {
20861
+ if (task.type === "empty") {
20862
+ return;
20863
+ }
20864
+ handleTaskDoubleClick(task);
20865
+ if (taskList.onDoubleClick) {
20866
+ taskList.onDoubleClick(task);
20867
+ }
20868
+ },
20869
+ [handleTaskDoubleClick, taskList]
20870
+ );
20848
20871
  const handleDrawerClose = React.useCallback(() => {
20849
20872
  setDrawerData(null);
20850
20873
  setActiveArrowKey(null);
@@ -21189,6 +21212,7 @@
21189
21212
  handleMoveTasksInside,
21190
21213
  handleOpenContextMenu: handleOpenContextMenuForRow,
21191
21214
  mapTaskToNestedIndex,
21215
+ onDoubleClick: handleTaskListDoubleClick,
21192
21216
  onExpanderClick,
21193
21217
  scrollToBottomStep,
21194
21218
  scrollToTopStep,
@@ -21220,6 +21244,7 @@
21220
21244
  handleOpenContextMenuForRow,
21221
21245
  mapTaskToNestedIndex,
21222
21246
  onExpanderClick,
21247
+ handleTaskListDoubleClick,
21223
21248
  scrollToBottomStep,
21224
21249
  scrollToTask,
21225
21250
  scrollToTopStep,
@@ -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;
@@ -180,6 +180,10 @@ 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;
183
187
  /**
184
188
  * Render bottom table content
185
189
  */
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.11",
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",