@thepocman/gantt-task-react 1.0.11 → 1.0.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.
@@ -11719,16 +11719,17 @@ const Gantt = ({
11719
11719
  }, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap, fullRowHeight, taskHeight]);
11720
11720
  const ganttFullHeight = useMemo(() => {
11721
11721
  if (enableTaskGrouping) {
11722
- let totalRows = 0;
11722
+ let totalHeight = 0;
11723
11723
  for (const [, taskMap] of rowIndexToTasksMap) {
11724
11724
  for (const [, tasks2] of taskMap) {
11725
- totalRows += tasks2.length;
11725
+ const stackedHeight = tasks2.length * (taskHeight + 2);
11726
+ totalHeight += Math.max(stackedHeight, fullRowHeight);
11726
11727
  }
11727
11728
  }
11728
- return Math.max(totalRows, 1) * fullRowHeight;
11729
+ return totalHeight;
11729
11730
  }
11730
11731
  return maxLevelLength * fullRowHeight;
11731
- }, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight]);
11732
+ }, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight, taskHeight]);
11732
11733
  const {
11733
11734
  checkHasCopyTasks,
11734
11735
  checkHasCutTasks,
@@ -11732,16 +11732,17 @@
11732
11732
  }, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap, fullRowHeight, taskHeight]);
11733
11733
  const ganttFullHeight = React.useMemo(() => {
11734
11734
  if (enableTaskGrouping) {
11735
- let totalRows = 0;
11735
+ let totalHeight = 0;
11736
11736
  for (const [, taskMap] of rowIndexToTasksMap) {
11737
11737
  for (const [, tasks2] of taskMap) {
11738
- totalRows += tasks2.length;
11738
+ const stackedHeight = tasks2.length * (taskHeight + 2);
11739
+ totalHeight += Math.max(stackedHeight, fullRowHeight);
11739
11740
  }
11740
11741
  }
11741
- return Math.max(totalRows, 1) * fullRowHeight;
11742
+ return totalHeight;
11742
11743
  }
11743
11744
  return maxLevelLength * fullRowHeight;
11744
- }, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight]);
11745
+ }, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight, taskHeight]);
11745
11746
  const {
11746
11747
  checkHasCopyTasks,
11747
11748
  checkHasCutTasks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thepocman/gantt-task-react",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Fork of gantt-task-react with support for grouped tasks on a single row when collapsed",
5
5
  "author": "Adrian Bueno <adrianlbueno@users.noreply.github.com>",
6
6
  "homepage": "https://github.com/adrianlbueno/gantt-task-react#readme",