gantt-task-react-v 1.5.9 → 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.
@@ -10215,27 +10215,12 @@ const TaskListTableRowInner = forwardRef(
10215
10215
  moveOverPosition
10216
10216
  } = props;
10217
10217
  const { id, comparisonLevel = 1 } = task;
10218
- const onRowDoubleClick = useCallback(
10219
- (event) => {
10220
- event.preventDefault();
10221
- if (task.type !== "empty") {
10222
- scrollToTask(task);
10223
- }
10224
- if (onDoubleClick) {
10225
- onDoubleClick(task);
10226
- }
10227
- },
10228
- [onDoubleClick, scrollToTask, task]
10229
- );
10230
10218
  const onRootMouseDown = useCallback(
10231
10219
  (event) => {
10232
10220
  event.preventDefault();
10233
10221
  if (event.button !== 0) {
10234
10222
  return;
10235
10223
  }
10236
- if (event.detail >= 2) {
10237
- return;
10238
- }
10239
10224
  if (task.type !== "empty") {
10240
10225
  scrollToTask(task);
10241
10226
  }
@@ -10256,6 +10241,12 @@ const TaskListTableRowInner = forwardRef(
10256
10241
  },
10257
10242
  [handleOpenContextMenu, task]
10258
10243
  );
10244
+ const onRootDoubleClick = useCallback(() => {
10245
+ if (!onDoubleClick || task.type === "empty") {
10246
+ return;
10247
+ }
10248
+ onDoubleClick(task);
10249
+ }, [onDoubleClick, task]);
10259
10250
  const dependencies = useMemo(() => {
10260
10251
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10261
10252
  if (!dependenciesAtLevel) {
@@ -10362,7 +10353,7 @@ const TaskListTableRowInner = forwardRef(
10362
10353
  ref,
10363
10354
  className: rowClassName,
10364
10355
  onMouseDown: onRootMouseDown,
10365
- onDoubleClick: onRowDoubleClick,
10356
+ onDoubleClick: onRootDoubleClick,
10366
10357
  style: {
10367
10358
  height: fullRowHeight,
10368
10359
  backgroundColor,
@@ -20848,25 +20839,23 @@ const Gantt = (props) => {
20848
20839
  },
20849
20840
  [enableDrawer, taskBar]
20850
20841
  );
20851
- const handleDrawerClose = useCallback(() => {
20852
- setDrawerData(null);
20853
- setActiveArrowKey(null);
20854
- setActiveTaskId(null);
20855
- }, []);
20856
- const handleTableRowDoubleClick = useCallback(
20842
+ const handleTaskListDoubleClick = useCallback(
20857
20843
  (task) => {
20858
- selectTask(task.id);
20859
- if (enableDrawer && taskList.enableTableRowDoubleClick) {
20860
- setActiveArrowKey(null);
20861
- setActiveTaskId(task.id);
20862
- setDrawerData({ type: "task", task });
20844
+ if (task.type === "empty") {
20845
+ return;
20863
20846
  }
20864
- if (taskList.onTableRowDoubleClick) {
20865
- taskList.onTableRowDoubleClick(task);
20847
+ handleTaskDoubleClick(task);
20848
+ if (taskList.onDoubleClick) {
20849
+ taskList.onDoubleClick(task);
20866
20850
  }
20867
20851
  },
20868
- [enableDrawer, selectTask, taskList]
20852
+ [handleTaskDoubleClick, taskList]
20869
20853
  );
20854
+ const handleDrawerClose = useCallback(() => {
20855
+ setDrawerData(null);
20856
+ setActiveArrowKey(null);
20857
+ setActiveTaskId(null);
20858
+ }, []);
20870
20859
  const handleGoToTask = useCallback(
20871
20860
  (taskId) => {
20872
20861
  for (const [comparisonLevel, levelMap] of tasksMap) {
@@ -21206,8 +21195,8 @@ const Gantt = (props) => {
21206
21195
  handleMoveTasksInside,
21207
21196
  handleOpenContextMenu: handleOpenContextMenuForRow,
21208
21197
  mapTaskToNestedIndex,
21198
+ onDoubleClick: handleTaskListDoubleClick,
21209
21199
  onExpanderClick,
21210
- onDoubleClick: handleTableRowDoubleClick,
21211
21200
  scrollToBottomStep,
21212
21201
  scrollToTopStep,
21213
21202
  selectTaskOnMouseDown,
@@ -21238,6 +21227,7 @@ const Gantt = (props) => {
21238
21227
  handleOpenContextMenuForRow,
21239
21228
  mapTaskToNestedIndex,
21240
21229
  onExpanderClick,
21230
+ handleTaskListDoubleClick,
21241
21231
  scrollToBottomStep,
21242
21232
  scrollToTask,
21243
21233
  scrollToTopStep,
@@ -21245,8 +21235,7 @@ const Gantt = (props) => {
21245
21235
  selectedIdsMirror,
21246
21236
  taskList,
21247
21237
  taskListContainerRef,
21248
- visibleTasks,
21249
- handleTableRowDoubleClick
21238
+ visibleTasks
21250
21239
  ]
21251
21240
  );
21252
21241
  return /* @__PURE__ */ jsx(GanttThemeProvider, { theme, children: (cssVars) => /* @__PURE__ */ jsx(GanttLocaleProvider, { locale, children: /* @__PURE__ */ jsxs(
@@ -10232,27 +10232,12 @@
10232
10232
  moveOverPosition
10233
10233
  } = props;
10234
10234
  const { id, comparisonLevel = 1 } = task;
10235
- const onRowDoubleClick = React.useCallback(
10236
- (event) => {
10237
- event.preventDefault();
10238
- if (task.type !== "empty") {
10239
- scrollToTask(task);
10240
- }
10241
- if (onDoubleClick) {
10242
- onDoubleClick(task);
10243
- }
10244
- },
10245
- [onDoubleClick, scrollToTask, task]
10246
- );
10247
10235
  const onRootMouseDown = React.useCallback(
10248
10236
  (event) => {
10249
10237
  event.preventDefault();
10250
10238
  if (event.button !== 0) {
10251
10239
  return;
10252
10240
  }
10253
- if (event.detail >= 2) {
10254
- return;
10255
- }
10256
10241
  if (task.type !== "empty") {
10257
10242
  scrollToTask(task);
10258
10243
  }
@@ -10273,6 +10258,12 @@
10273
10258
  },
10274
10259
  [handleOpenContextMenu, task]
10275
10260
  );
10261
+ const onRootDoubleClick = React.useCallback(() => {
10262
+ if (!onDoubleClick || task.type === "empty") {
10263
+ return;
10264
+ }
10265
+ onDoubleClick(task);
10266
+ }, [onDoubleClick, task]);
10276
10267
  const dependencies = React.useMemo(() => {
10277
10268
  const dependenciesAtLevel = dependencyMap.get(comparisonLevel);
10278
10269
  if (!dependenciesAtLevel) {
@@ -10379,7 +10370,7 @@
10379
10370
  ref,
10380
10371
  className: rowClassName,
10381
10372
  onMouseDown: onRootMouseDown,
10382
- onDoubleClick: onRowDoubleClick,
10373
+ onDoubleClick: onRootDoubleClick,
10383
10374
  style: {
10384
10375
  height: fullRowHeight,
10385
10376
  backgroundColor,
@@ -20865,25 +20856,23 @@
20865
20856
  },
20866
20857
  [enableDrawer, taskBar]
20867
20858
  );
20868
- const handleDrawerClose = React.useCallback(() => {
20869
- setDrawerData(null);
20870
- setActiveArrowKey(null);
20871
- setActiveTaskId(null);
20872
- }, []);
20873
- const handleTableRowDoubleClick = React.useCallback(
20859
+ const handleTaskListDoubleClick = React.useCallback(
20874
20860
  (task) => {
20875
- selectTask(task.id);
20876
- if (enableDrawer && taskList.enableTableRowDoubleClick) {
20877
- setActiveArrowKey(null);
20878
- setActiveTaskId(task.id);
20879
- setDrawerData({ type: "task", task });
20861
+ if (task.type === "empty") {
20862
+ return;
20880
20863
  }
20881
- if (taskList.onTableRowDoubleClick) {
20882
- taskList.onTableRowDoubleClick(task);
20864
+ handleTaskDoubleClick(task);
20865
+ if (taskList.onDoubleClick) {
20866
+ taskList.onDoubleClick(task);
20883
20867
  }
20884
20868
  },
20885
- [enableDrawer, selectTask, taskList]
20869
+ [handleTaskDoubleClick, taskList]
20886
20870
  );
20871
+ const handleDrawerClose = React.useCallback(() => {
20872
+ setDrawerData(null);
20873
+ setActiveArrowKey(null);
20874
+ setActiveTaskId(null);
20875
+ }, []);
20887
20876
  const handleGoToTask = React.useCallback(
20888
20877
  (taskId) => {
20889
20878
  for (const [comparisonLevel, levelMap] of tasksMap) {
@@ -21223,8 +21212,8 @@
21223
21212
  handleMoveTasksInside,
21224
21213
  handleOpenContextMenu: handleOpenContextMenuForRow,
21225
21214
  mapTaskToNestedIndex,
21215
+ onDoubleClick: handleTaskListDoubleClick,
21226
21216
  onExpanderClick,
21227
- onDoubleClick: handleTableRowDoubleClick,
21228
21217
  scrollToBottomStep,
21229
21218
  scrollToTopStep,
21230
21219
  selectTaskOnMouseDown,
@@ -21255,6 +21244,7 @@
21255
21244
  handleOpenContextMenuForRow,
21256
21245
  mapTaskToNestedIndex,
21257
21246
  onExpanderClick,
21247
+ handleTaskListDoubleClick,
21258
21248
  scrollToBottomStep,
21259
21249
  scrollToTask,
21260
21250
  scrollToTopStep,
@@ -21262,8 +21252,7 @@
21262
21252
  selectedIdsMirror,
21263
21253
  taskList,
21264
21254
  taskListContainerRef,
21265
- visibleTasks,
21266
- handleTableRowDoubleClick
21255
+ visibleTasks
21267
21256
  ]
21268
21257
  );
21269
21258
  return /* @__PURE__ */ jsxRuntime.jsx(GanttThemeProvider, { theme, children: (cssVars) => /* @__PURE__ */ jsxRuntime.jsx(GanttLocaleProvider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -181,19 +181,13 @@ export interface GanttTaskListProps {
181
181
  */
182
182
  onColumnVisibilityChange?: OnColumnVisibilityChange;
183
183
  /**
184
- * Render bottom table content
185
- */
186
- tableBottom?: TableRenderBottomProps;
187
- /**
188
- * Enable double-click on task table rows to open the drawer.
189
- * Requires `drawer.enableDrawer` to be true for the drawer to open.
184
+ * Invokes on task list row double click
190
185
  */
191
- enableTableRowDoubleClick?: boolean;
186
+ onDoubleClick?: (task: RenderTask) => void;
192
187
  /**
193
- * Callback invoked when a task table row is double-clicked.
194
- * Called regardless of `enableTableRowDoubleClick`; use it to open a custom drawer or panel.
188
+ * Render bottom table content
195
189
  */
196
- onTableRowDoubleClick?: (task: RenderTask) => void;
190
+ tableBottom?: TableRenderBottomProps;
197
191
  }
198
192
  export interface TableRenderBottomProps {
199
193
  height?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.5.9",
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",