gantt-task-react-v 1.5.13 → 1.5.15

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.
@@ -10225,9 +10225,11 @@ const TaskListTableRowInner = forwardRef(
10225
10225
  if (task.type !== "empty") {
10226
10226
  scrollToTask(task);
10227
10227
  }
10228
- selectTaskOnMouseDown(task.id, event);
10229
- if (onClick) {
10230
- onClick(task);
10228
+ if (event.detail < 2) {
10229
+ selectTaskOnMouseDown(task.id, event);
10230
+ if (onClick) {
10231
+ onClick(task);
10232
+ }
10231
10233
  }
10232
10234
  },
10233
10235
  [onClick, scrollToTask, selectTaskOnMouseDown, task]
@@ -20845,6 +20847,14 @@ const Gantt = (props) => {
20845
20847
  },
20846
20848
  [enableDrawer, taskBar]
20847
20849
  );
20850
+ const handleTaskListRowClick = useCallback(
20851
+ (task) => {
20852
+ if (taskList.onClickRow) {
20853
+ taskList.onClickRow(task);
20854
+ }
20855
+ },
20856
+ [taskList]
20857
+ );
20848
20858
  const handleTaskListRowDoubleClick = useCallback(
20849
20859
  (task) => {
20850
20860
  if (task.type !== "empty") {
@@ -21204,6 +21214,7 @@ const Gantt = (props) => {
21204
21214
  handleMoveTasksInside,
21205
21215
  handleOpenContextMenu: handleOpenContextMenuForRow,
21206
21216
  mapTaskToNestedIndex,
21217
+ onClick: handleTaskListRowClick,
21207
21218
  onDoubleClick: handleTaskListRowDoubleClick,
21208
21219
  onExpanderClick,
21209
21220
  scrollToBottomStep,
@@ -21235,6 +21246,7 @@ const Gantt = (props) => {
21235
21246
  handleMoveTaskBefore,
21236
21247
  handleMoveTasksInside,
21237
21248
  handleOpenContextMenuForRow,
21249
+ handleTaskListRowClick,
21238
21250
  handleTaskListRowDoubleClick,
21239
21251
  mapTaskToNestedIndex,
21240
21252
  onExpanderClick,
@@ -10242,9 +10242,11 @@
10242
10242
  if (task.type !== "empty") {
10243
10243
  scrollToTask(task);
10244
10244
  }
10245
- selectTaskOnMouseDown(task.id, event);
10246
- if (onClick) {
10247
- onClick(task);
10245
+ if (event.detail < 2) {
10246
+ selectTaskOnMouseDown(task.id, event);
10247
+ if (onClick) {
10248
+ onClick(task);
10249
+ }
10248
10250
  }
10249
10251
  },
10250
10252
  [onClick, scrollToTask, selectTaskOnMouseDown, task]
@@ -20862,6 +20864,14 @@
20862
20864
  },
20863
20865
  [enableDrawer, taskBar]
20864
20866
  );
20867
+ const handleTaskListRowClick = React.useCallback(
20868
+ (task) => {
20869
+ if (taskList.onClickRow) {
20870
+ taskList.onClickRow(task);
20871
+ }
20872
+ },
20873
+ [taskList]
20874
+ );
20865
20875
  const handleTaskListRowDoubleClick = React.useCallback(
20866
20876
  (task) => {
20867
20877
  if (task.type !== "empty") {
@@ -21221,6 +21231,7 @@
21221
21231
  handleMoveTasksInside,
21222
21232
  handleOpenContextMenu: handleOpenContextMenuForRow,
21223
21233
  mapTaskToNestedIndex,
21234
+ onClick: handleTaskListRowClick,
21224
21235
  onDoubleClick: handleTaskListRowDoubleClick,
21225
21236
  onExpanderClick,
21226
21237
  scrollToBottomStep,
@@ -21252,6 +21263,7 @@
21252
21263
  handleMoveTaskBefore,
21253
21264
  handleMoveTasksInside,
21254
21265
  handleOpenContextMenuForRow,
21266
+ handleTaskListRowClick,
21255
21267
  handleTaskListRowDoubleClick,
21256
21268
  mapTaskToNestedIndex,
21257
21269
  onExpanderClick,
@@ -184,6 +184,11 @@ export interface GanttTaskListProps {
184
184
  * Render bottom table content
185
185
  */
186
186
  tableBottom?: TableRenderBottomProps;
187
+ /**
188
+ * Invokes on single click on a task list row.
189
+ * Receives the full task data of the clicked row.
190
+ */
191
+ onClickRow?: (task: RenderTask) => void;
187
192
  /**
188
193
  * Invokes on double-click on a task list row.
189
194
  * Receives the full task data of the double-clicked row.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
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",