@thepocman/gantt-task-react 1.0.10 → 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.
- package/dist/gantt-task-react.es.js +23 -14
- package/dist/gantt-task-react.umd.js +23 -14
- package/package.json +1 -1
|
@@ -11691,14 +11691,18 @@ const Gantt = ({
|
|
|
11691
11691
|
() => Math.round(taskHeight / 2),
|
|
11692
11692
|
[taskHeight]
|
|
11693
11693
|
);
|
|
11694
|
-
console.log("rowIndexToTasksMap ------", rowIndexToTasksMap);
|
|
11695
11694
|
const maxLevelLength = useMemo(() => {
|
|
11696
11695
|
if (enableTaskGrouping) {
|
|
11697
|
-
let
|
|
11698
|
-
for (const [, rowMap] of rowIndexToTasksMap
|
|
11699
|
-
|
|
11696
|
+
let totalHeightInRows = 0;
|
|
11697
|
+
for (const [_, rowMap] of rowIndexToTasksMap) {
|
|
11698
|
+
for (const [_2, tasksInRow] of rowMap) {
|
|
11699
|
+
const maxStack = tasksInRow.length;
|
|
11700
|
+
const stackedHeight = maxStack * (taskHeight + 2);
|
|
11701
|
+
const rowsNeeded = Math.ceil(stackedHeight / fullRowHeight);
|
|
11702
|
+
totalHeightInRows += rowsNeeded;
|
|
11703
|
+
}
|
|
11700
11704
|
}
|
|
11701
|
-
return Math.max(
|
|
11705
|
+
return Math.max(totalHeightInRows, 1);
|
|
11702
11706
|
}
|
|
11703
11707
|
let maxLength = 0;
|
|
11704
11708
|
const countByLevel = {};
|
|
@@ -11711,14 +11715,21 @@ const Gantt = ({
|
|
|
11711
11715
|
maxLength = countByLevel[comparisonLevel];
|
|
11712
11716
|
}
|
|
11713
11717
|
});
|
|
11714
|
-
console.log("📦 Tasks per level:", countByLevel);
|
|
11715
|
-
console.log("📏 maxLevelLength:", maxLength);
|
|
11716
11718
|
return maxLength;
|
|
11717
|
-
}, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap]);
|
|
11718
|
-
const ganttFullHeight = useMemo(
|
|
11719
|
-
()
|
|
11720
|
-
|
|
11721
|
-
|
|
11719
|
+
}, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap, fullRowHeight, taskHeight]);
|
|
11720
|
+
const ganttFullHeight = useMemo(() => {
|
|
11721
|
+
if (enableTaskGrouping) {
|
|
11722
|
+
let totalHeight = 0;
|
|
11723
|
+
for (const [, taskMap] of rowIndexToTasksMap) {
|
|
11724
|
+
for (const [, tasks2] of taskMap) {
|
|
11725
|
+
const stackedHeight = tasks2.length * (taskHeight + 2);
|
|
11726
|
+
totalHeight += Math.max(stackedHeight, fullRowHeight);
|
|
11727
|
+
}
|
|
11728
|
+
}
|
|
11729
|
+
return totalHeight;
|
|
11730
|
+
}
|
|
11731
|
+
return maxLevelLength * fullRowHeight;
|
|
11732
|
+
}, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight, taskHeight]);
|
|
11722
11733
|
const {
|
|
11723
11734
|
checkHasCopyTasks,
|
|
11724
11735
|
checkHasCutTasks,
|
|
@@ -11991,8 +12002,6 @@ const Gantt = ({
|
|
|
11991
12002
|
};
|
|
11992
12003
|
const handleExpanderClick = useCallback(
|
|
11993
12004
|
(clickedTask) => {
|
|
11994
|
-
console.log(`Task ${clickedTask.id} hideChildren changed from ${clickedTask.hideChildren} to ${!clickedTask.hideChildren}`);
|
|
11995
|
-
console.log("Task types:", tasks.map((task) => `${task.id}: ${task.type}`));
|
|
11996
12005
|
if (onChangeExpandState) {
|
|
11997
12006
|
onChangeExpandState({
|
|
11998
12007
|
...clickedTask,
|
|
@@ -11704,14 +11704,18 @@
|
|
|
11704
11704
|
() => Math.round(taskHeight / 2),
|
|
11705
11705
|
[taskHeight]
|
|
11706
11706
|
);
|
|
11707
|
-
console.log("rowIndexToTasksMap ------", rowIndexToTasksMap);
|
|
11708
11707
|
const maxLevelLength = React.useMemo(() => {
|
|
11709
11708
|
if (enableTaskGrouping) {
|
|
11710
|
-
let
|
|
11711
|
-
for (const [, rowMap] of rowIndexToTasksMap
|
|
11712
|
-
|
|
11709
|
+
let totalHeightInRows = 0;
|
|
11710
|
+
for (const [_, rowMap] of rowIndexToTasksMap) {
|
|
11711
|
+
for (const [_2, tasksInRow] of rowMap) {
|
|
11712
|
+
const maxStack = tasksInRow.length;
|
|
11713
|
+
const stackedHeight = maxStack * (taskHeight + 2);
|
|
11714
|
+
const rowsNeeded = Math.ceil(stackedHeight / fullRowHeight);
|
|
11715
|
+
totalHeightInRows += rowsNeeded;
|
|
11716
|
+
}
|
|
11713
11717
|
}
|
|
11714
|
-
return Math.max(
|
|
11718
|
+
return Math.max(totalHeightInRows, 1);
|
|
11715
11719
|
}
|
|
11716
11720
|
let maxLength = 0;
|
|
11717
11721
|
const countByLevel = {};
|
|
@@ -11724,14 +11728,21 @@
|
|
|
11724
11728
|
maxLength = countByLevel[comparisonLevel];
|
|
11725
11729
|
}
|
|
11726
11730
|
});
|
|
11727
|
-
console.log("📦 Tasks per level:", countByLevel);
|
|
11728
|
-
console.log("📏 maxLevelLength:", maxLength);
|
|
11729
11731
|
return maxLength;
|
|
11730
|
-
}, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap]);
|
|
11731
|
-
const ganttFullHeight = React.useMemo(
|
|
11732
|
-
()
|
|
11733
|
-
|
|
11734
|
-
|
|
11732
|
+
}, [visibleTasks, comparisonLevels, enableTaskGrouping, rowIndexToTasksMap, fullRowHeight, taskHeight]);
|
|
11733
|
+
const ganttFullHeight = React.useMemo(() => {
|
|
11734
|
+
if (enableTaskGrouping) {
|
|
11735
|
+
let totalHeight = 0;
|
|
11736
|
+
for (const [, taskMap] of rowIndexToTasksMap) {
|
|
11737
|
+
for (const [, tasks2] of taskMap) {
|
|
11738
|
+
const stackedHeight = tasks2.length * (taskHeight + 2);
|
|
11739
|
+
totalHeight += Math.max(stackedHeight, fullRowHeight);
|
|
11740
|
+
}
|
|
11741
|
+
}
|
|
11742
|
+
return totalHeight;
|
|
11743
|
+
}
|
|
11744
|
+
return maxLevelLength * fullRowHeight;
|
|
11745
|
+
}, [enableTaskGrouping, rowIndexToTasksMap, maxLevelLength, fullRowHeight, taskHeight]);
|
|
11735
11746
|
const {
|
|
11736
11747
|
checkHasCopyTasks,
|
|
11737
11748
|
checkHasCutTasks,
|
|
@@ -12004,8 +12015,6 @@
|
|
|
12004
12015
|
};
|
|
12005
12016
|
const handleExpanderClick = React.useCallback(
|
|
12006
12017
|
(clickedTask) => {
|
|
12007
|
-
console.log(`Task ${clickedTask.id} hideChildren changed from ${clickedTask.hideChildren} to ${!clickedTask.hideChildren}`);
|
|
12008
|
-
console.log("Task types:", tasks.map((task) => `${task.id}: ${task.type}`));
|
|
12009
12018
|
if (onChangeExpandState) {
|
|
12010
12019
|
onChangeExpandState({
|
|
12011
12020
|
...clickedTask,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thepocman/gantt-task-react",
|
|
3
|
-
"version": "1.0.
|
|
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",
|