gantt-task-react-v 1.5.12 → 1.5.14

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.
@@ -34,6 +34,7 @@ export type TaskListProps = {
34
34
  scrollToBottomStep: () => void;
35
35
  scrollToTask: (task: Task) => void;
36
36
  scrollToTopStep: () => void;
37
+ selectTask: (taskId: string) => void;
37
38
  selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
38
39
  selectedIdsMirror: Readonly<Record<string, true>>;
39
40
  taskListContainerRef: RefObject<HTMLDivElement>;
@@ -10207,6 +10207,7 @@ const TaskListTableRowInner = forwardRef(
10207
10207
  onDoubleClick,
10208
10208
  onExpanderClick,
10209
10209
  scrollToTask,
10210
+ selectTask,
10210
10211
  selectTaskOnMouseDown,
10211
10212
  style: style2,
10212
10213
  task,
@@ -10224,9 +10225,11 @@ const TaskListTableRowInner = forwardRef(
10224
10225
  if (task.type !== "empty") {
10225
10226
  scrollToTask(task);
10226
10227
  }
10227
- selectTaskOnMouseDown(task.id, event);
10228
- if (onClick) {
10229
- onClick(task);
10228
+ if (event.detail < 2) {
10229
+ selectTaskOnMouseDown(task.id, event);
10230
+ if (onClick) {
10231
+ onClick(task);
10232
+ }
10230
10233
  }
10231
10234
  },
10232
10235
  [onClick, scrollToTask, selectTaskOnMouseDown, task]
@@ -10242,10 +10245,13 @@ const TaskListTableRowInner = forwardRef(
10242
10245
  [handleOpenContextMenu, task]
10243
10246
  );
10244
10247
  const onRootDoubleClick = useCallback(() => {
10245
- if (task.type !== "empty" && onDoubleClick) {
10246
- onDoubleClick(task);
10248
+ if (task.type !== "empty") {
10249
+ selectTask(task.id);
10250
+ if (onDoubleClick) {
10251
+ onDoubleClick(task);
10252
+ }
10247
10253
  }
10248
- }, [onDoubleClick, task]);
10254
+ }, [onDoubleClick, selectTask, task]);
10249
10255
  const dependencies = useMemo(() => {
10250
10256
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10251
10257
  if (!dependenciesAtLevel) {
@@ -10927,6 +10933,7 @@ const TaskListInner = ({
10927
10933
  onExpanderClick,
10928
10934
  onClick,
10929
10935
  onDoubleClick,
10936
+ selectTask,
10930
10937
  scrollToTask,
10931
10938
  selectTaskOnMouseDown,
10932
10939
  selectedIdsMirror,
@@ -10997,6 +11004,7 @@ const TaskListInner = ({
10997
11004
  onDoubleClick,
10998
11005
  onExpanderClick,
10999
11006
  scrollToTask,
11007
+ selectTask,
11000
11008
  selectTaskOnMouseDown,
11001
11009
  task,
11002
11010
  depth
@@ -11020,6 +11028,7 @@ const TaskListInner = ({
11020
11028
  mapTaskToNestedIndex,
11021
11029
  onClick,
11022
11030
  onDoubleClick,
11031
+ selectTask,
11023
11032
  onExpanderClick,
11024
11033
  scrollToTask,
11025
11034
  selectTaskOnMouseDown,
@@ -21201,6 +21210,7 @@ const Gantt = (props) => {
21201
21210
  onExpanderClick,
21202
21211
  scrollToBottomStep,
21203
21212
  scrollToTopStep,
21213
+ selectTask,
21204
21214
  selectTaskOnMouseDown,
21205
21215
  selectedIdsMirror,
21206
21216
  scrollToTask,
@@ -21233,6 +21243,7 @@ const Gantt = (props) => {
21233
21243
  scrollToBottomStep,
21234
21244
  scrollToTask,
21235
21245
  scrollToTopStep,
21246
+ selectTask,
21236
21247
  selectTaskOnMouseDown,
21237
21248
  selectedIdsMirror,
21238
21249
  taskList,
@@ -10224,6 +10224,7 @@
10224
10224
  onDoubleClick,
10225
10225
  onExpanderClick,
10226
10226
  scrollToTask,
10227
+ selectTask,
10227
10228
  selectTaskOnMouseDown,
10228
10229
  style: style2,
10229
10230
  task,
@@ -10241,9 +10242,11 @@
10241
10242
  if (task.type !== "empty") {
10242
10243
  scrollToTask(task);
10243
10244
  }
10244
- selectTaskOnMouseDown(task.id, event);
10245
- if (onClick) {
10246
- onClick(task);
10245
+ if (event.detail < 2) {
10246
+ selectTaskOnMouseDown(task.id, event);
10247
+ if (onClick) {
10248
+ onClick(task);
10249
+ }
10247
10250
  }
10248
10251
  },
10249
10252
  [onClick, scrollToTask, selectTaskOnMouseDown, task]
@@ -10259,10 +10262,13 @@
10259
10262
  [handleOpenContextMenu, task]
10260
10263
  );
10261
10264
  const onRootDoubleClick = React.useCallback(() => {
10262
- if (task.type !== "empty" && onDoubleClick) {
10263
- onDoubleClick(task);
10265
+ if (task.type !== "empty") {
10266
+ selectTask(task.id);
10267
+ if (onDoubleClick) {
10268
+ onDoubleClick(task);
10269
+ }
10264
10270
  }
10265
- }, [onDoubleClick, task]);
10271
+ }, [onDoubleClick, selectTask, task]);
10266
10272
  const dependencies = React.useMemo(() => {
10267
10273
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10268
10274
  if (!dependenciesAtLevel) {
@@ -10944,6 +10950,7 @@
10944
10950
  onExpanderClick,
10945
10951
  onClick,
10946
10952
  onDoubleClick,
10953
+ selectTask,
10947
10954
  scrollToTask,
10948
10955
  selectTaskOnMouseDown,
10949
10956
  selectedIdsMirror,
@@ -11014,6 +11021,7 @@
11014
11021
  onDoubleClick,
11015
11022
  onExpanderClick,
11016
11023
  scrollToTask,
11024
+ selectTask,
11017
11025
  selectTaskOnMouseDown,
11018
11026
  task,
11019
11027
  depth
@@ -11037,6 +11045,7 @@
11037
11045
  mapTaskToNestedIndex,
11038
11046
  onClick,
11039
11047
  onDoubleClick,
11048
+ selectTask,
11040
11049
  onExpanderClick,
11041
11050
  scrollToTask,
11042
11051
  selectTaskOnMouseDown,
@@ -21218,6 +21227,7 @@
21218
21227
  onExpanderClick,
21219
21228
  scrollToBottomStep,
21220
21229
  scrollToTopStep,
21230
+ selectTask,
21221
21231
  selectTaskOnMouseDown,
21222
21232
  selectedIdsMirror,
21223
21233
  scrollToTask,
@@ -21250,6 +21260,7 @@
21250
21260
  scrollToBottomStep,
21251
21261
  scrollToTask,
21252
21262
  scrollToTopStep,
21263
+ selectTask,
21253
21264
  selectTaskOnMouseDown,
21254
21265
  selectedIdsMirror,
21255
21266
  taskList,
@@ -187,6 +187,7 @@ export type TaskListTableRowProps = {
187
187
  onDoubleClick?: (task: RenderTask) => void;
188
188
  onExpanderClick: (task: Task) => void;
189
189
  scrollToTask: (task: Task) => void;
190
+ selectTask: (taskId: string) => void;
190
191
  selectTaskOnMouseDown: (taskId: string, event: MouseEvent) => void;
191
192
  style?: CSSProperties;
192
193
  task: RenderTask;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.5.12",
3
+ "version": "1.5.14",
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",