@thepocman/gantt-task-react 1.0.29 → 1.0.31
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/components/task-item/task-item.d.ts +0 -1
- package/dist/gantt-task-react.es.js +43 -31
- package/dist/gantt-task-react.umd.js +43 -31
- package/dist/style.css +5 -6
- package/package.json +1 -1
- package/dist/helpers/get-initial-closed-tasks.d.ts +0 -2
- package/dist/helpers/get-unique-tasks-from-row-index-to-tasks-map.d.ts +0 -2
- package/dist/helpers/sort-visible-tasks.d.ts +0 -2
|
@@ -38,6 +38,5 @@ export type TaskItemProps = {
|
|
|
38
38
|
handleDeleteTasks: (task: TaskOrEmpty[]) => void;
|
|
39
39
|
colorStyles: ColorStyles;
|
|
40
40
|
enableTaskGrouping?: boolean;
|
|
41
|
-
getTaskInitials?: (task: Task) => string;
|
|
42
41
|
};
|
|
43
42
|
export declare const TaskItem: React.NamedExoticComponent<TaskItemProps>;
|
|
@@ -465,14 +465,13 @@ const collectChildren = (arrayRes, mirrorRes, task, childTasksOnLevel, enableTas
|
|
|
465
465
|
if (comparisonLevel === 1) {
|
|
466
466
|
mirrorRes[task.id] = true;
|
|
467
467
|
}
|
|
468
|
-
|
|
469
|
-
if (task.type === "empty" || isTaskGroupingEnabled) {
|
|
468
|
+
if (task.type === "empty") {
|
|
470
469
|
return;
|
|
471
470
|
}
|
|
472
471
|
const childs = childTasksOnLevel.get(task.id);
|
|
473
472
|
if (childs && childs.length > 0) {
|
|
474
473
|
childs.forEach((childTask) => {
|
|
475
|
-
collectChildren(arrayRes, mirrorRes, childTask, childTasksOnLevel
|
|
474
|
+
collectChildren(arrayRes, mirrorRes, childTask, childTasksOnLevel);
|
|
476
475
|
});
|
|
477
476
|
}
|
|
478
477
|
};
|
|
@@ -482,7 +481,7 @@ const collectVisibleTasks = (childTasksMap, rootTasksMap, enableTaskGrouping) =>
|
|
|
482
481
|
for (const [comparisonLevel, rootTasks] of rootTasksMap.entries()) {
|
|
483
482
|
const childTasksOnLevel = childTasksMap.get(comparisonLevel) || /* @__PURE__ */ new Map();
|
|
484
483
|
rootTasks.forEach((task) => {
|
|
485
|
-
collectChildren(arrayRes, mirrorRes, task, childTasksOnLevel
|
|
484
|
+
collectChildren(arrayRes, mirrorRes, task, childTasksOnLevel);
|
|
486
485
|
});
|
|
487
486
|
}
|
|
488
487
|
return [arrayRes, mirrorRes];
|
|
@@ -3504,17 +3503,20 @@ const TaskListInner = ({
|
|
|
3504
3503
|
className: styles$d.taskListContent,
|
|
3505
3504
|
ref: taskListContentRef,
|
|
3506
3505
|
onScroll: onScrollTableListContentVertically,
|
|
3506
|
+
style: {
|
|
3507
|
+
height: Math.min(
|
|
3508
|
+
ganttFullHeight,
|
|
3509
|
+
distances.minimumRowDisplayed * distances.rowHeight
|
|
3510
|
+
),
|
|
3511
|
+
overflowY: "auto"
|
|
3512
|
+
},
|
|
3507
3513
|
children: /* @__PURE__ */ jsx(
|
|
3508
3514
|
"div",
|
|
3509
3515
|
{
|
|
3510
3516
|
style: {
|
|
3511
|
-
height:
|
|
3512
|
-
ganttFullHeight,
|
|
3513
|
-
distances.minimumRowDisplayed * distances.rowHeight
|
|
3514
|
-
),
|
|
3517
|
+
height: ganttFullHeight,
|
|
3515
3518
|
backgroundSize: `100% ${fullRowHeight * 2}px`,
|
|
3516
|
-
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)
|
|
3517
|
-
overflow: "hidden"
|
|
3519
|
+
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
3518
3520
|
},
|
|
3519
3521
|
children: /* @__PURE__ */ jsx(
|
|
3520
3522
|
TaskListTable,
|
|
@@ -4576,21 +4578,24 @@ const Calendar = ({
|
|
|
4576
4578
|
)
|
|
4577
4579
|
);
|
|
4578
4580
|
if (!isUnknownDates && (i2 === startColumnIndex || date.getFullYear() !== getDate(i2 - 1).getFullYear())) {
|
|
4579
|
-
const year = date.getFullYear()
|
|
4580
|
-
|
|
4581
|
+
const year = date.getFullYear();
|
|
4582
|
+
console.log("Fulll year :>> ", year);
|
|
4583
|
+
const topValue = year.toString();
|
|
4584
|
+
const startHalfYearIndex = i2 - date.getMonth();
|
|
4585
|
+
const centerX = additionalLeftSpace + columnWidth * i2 + columnWidth;
|
|
4581
4586
|
topValues2.push(
|
|
4582
4587
|
/* @__PURE__ */ jsx(
|
|
4583
4588
|
TopPartOfCalendar,
|
|
4584
4589
|
{
|
|
4585
|
-
value:
|
|
4586
|
-
x1Line: additionalLeftSpace + columnWidth *
|
|
4590
|
+
value: topValue,
|
|
4591
|
+
x1Line: additionalLeftSpace + columnWidth * startHalfYearIndex,
|
|
4587
4592
|
y1Line: 0,
|
|
4588
4593
|
y2Line: topDefaultHeight,
|
|
4589
|
-
xText:
|
|
4594
|
+
xText: centerX,
|
|
4590
4595
|
yText: topDefaultHeight * 0.9,
|
|
4591
4596
|
colors
|
|
4592
4597
|
},
|
|
4593
|
-
year
|
|
4598
|
+
`year-${year}`
|
|
4594
4599
|
)
|
|
4595
4600
|
);
|
|
4596
4601
|
}
|
|
@@ -4604,7 +4609,6 @@ const Calendar = ({
|
|
|
4604
4609
|
for (let i2 = startColumnIndex; i2 <= endColumnIndex; i2++) {
|
|
4605
4610
|
const date = getDate(i2);
|
|
4606
4611
|
const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
|
|
4607
|
-
console.log("quarter :>> ", quarter);
|
|
4608
4612
|
bottomValues2.push(
|
|
4609
4613
|
/* @__PURE__ */ jsx(
|
|
4610
4614
|
"text",
|
|
@@ -4810,6 +4814,7 @@ const Calendar = ({
|
|
|
4810
4814
|
);
|
|
4811
4815
|
const dayOfMonth = date.getDate();
|
|
4812
4816
|
const prevDate = getDate(i2 - 1);
|
|
4817
|
+
console.log("testing center :>> ", additionalLeftSpace + columnWidth * i2 + ticks * columnWidth * 0.5);
|
|
4813
4818
|
if (!isUnknownDates && dayOfMonth !== prevDate.getDate()) {
|
|
4814
4819
|
const topValue = renderTopHeaderByDate(date);
|
|
4815
4820
|
topValues2.push(
|
|
@@ -4934,7 +4939,9 @@ const shouldDrawVerticalDivider = (currentDate, previousDate, viewMode, isUnknow
|
|
|
4934
4939
|
case ViewMode.Year:
|
|
4935
4940
|
return currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4936
4941
|
case ViewMode.HalfYear:
|
|
4937
|
-
|
|
4942
|
+
const currentHalf = Math.ceil((currentDate.getMonth() + 1) / 6);
|
|
4943
|
+
const previousHalf = Math.ceil((previousDate.getMonth() + 1) / 6);
|
|
4944
|
+
return currentHalf !== previousHalf || currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4938
4945
|
case ViewMode.QuarterYear:
|
|
4939
4946
|
return Math.ceil((currentDate.getMonth() + 1) / 3) !== Math.ceil((previousDate.getMonth() + 1) / 3) || currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4940
4947
|
case ViewMode.Month:
|
|
@@ -5006,6 +5013,7 @@ const GridBodyInner = ({
|
|
|
5006
5013
|
startColumnIndex
|
|
5007
5014
|
)) {
|
|
5008
5015
|
const x3 = additionalLeftSpace + columnWidth * i2;
|
|
5016
|
+
console.log("drawing divider at x:", x3, "for index:", i2, "date:", currentDate);
|
|
5009
5017
|
dividers.push(
|
|
5010
5018
|
/* @__PURE__ */ jsx(
|
|
5011
5019
|
"line",
|
|
@@ -5239,9 +5247,9 @@ const Grid = (props) => {
|
|
|
5239
5247
|
/* @__PURE__ */ jsx(GridBody, { ...props })
|
|
5240
5248
|
] });
|
|
5241
5249
|
};
|
|
5242
|
-
const ganttTaskRoot = "
|
|
5243
|
-
const ganttTaskContent = "
|
|
5244
|
-
const wrapper$2 = "
|
|
5250
|
+
const ganttTaskRoot = "_ganttTaskRoot_1lwsd_1";
|
|
5251
|
+
const ganttTaskContent = "_ganttTaskContent_1lwsd_83";
|
|
5252
|
+
const wrapper$2 = "_wrapper_1lwsd_111";
|
|
5245
5253
|
const styles$8 = {
|
|
5246
5254
|
ganttTaskRoot,
|
|
5247
5255
|
ganttTaskContent,
|
|
@@ -6371,6 +6379,7 @@ const TaskItemInner = (props) => {
|
|
|
6371
6379
|
rtl,
|
|
6372
6380
|
selectTaskOnMouseDown,
|
|
6373
6381
|
setTooltipTask,
|
|
6382
|
+
enableTaskGrouping,
|
|
6374
6383
|
task,
|
|
6375
6384
|
task: { styles: taskStyles },
|
|
6376
6385
|
taskHalfHeight,
|
|
@@ -6598,7 +6607,7 @@ const TaskItemInner = (props) => {
|
|
|
6598
6607
|
y: taskYOffset + taskHeight * 0.5,
|
|
6599
6608
|
className: isTextInside ? style.barLabel : style.barLabel && style.barLabelOutside,
|
|
6600
6609
|
ref: textRef,
|
|
6601
|
-
children: isTextInside ? task.name : ""
|
|
6610
|
+
children: enableTaskGrouping ? isTextInside ? task.name : "" : task.name
|
|
6602
6611
|
}
|
|
6603
6612
|
),
|
|
6604
6613
|
(outOfParentWarnings || hasDependencyWarning) && /* @__PURE__ */ jsx(
|
|
@@ -6800,11 +6809,7 @@ const TaskGanttContent = ({
|
|
|
6800
6809
|
fixEndPosition,
|
|
6801
6810
|
handleDeleteTasks,
|
|
6802
6811
|
colorStyles,
|
|
6803
|
-
enableTaskGrouping
|
|
6804
|
-
getTaskInitials: (task2) => {
|
|
6805
|
-
var _a2;
|
|
6806
|
-
return ((_a2 = task2.name) == null ? void 0 : _a2.split(" ").map((word) => word[0]).join("").toUpperCase()) ?? "";
|
|
6807
|
-
}
|
|
6812
|
+
enableTaskGrouping
|
|
6808
6813
|
}
|
|
6809
6814
|
)
|
|
6810
6815
|
},
|
|
@@ -6868,7 +6873,6 @@ const TaskGanttContent = ({
|
|
|
6868
6873
|
const dependentsByTask = dependentsAtLevel == null ? void 0 : dependentsAtLevel.get(taskId);
|
|
6869
6874
|
dependentsByTask == null ? void 0 : dependentsByTask.filter(({ dependent }) => visibleTasksMirror[dependent.id]).forEach((dep) => {
|
|
6870
6875
|
var _a2, _b;
|
|
6871
|
-
console.log("dependent", dep);
|
|
6872
6876
|
const addedDepsForDep = addedDependenciesAtLevel[_a2 = dep.dependent.id] ?? (addedDependenciesAtLevel[_a2] = {});
|
|
6873
6877
|
if (addedDepsForDep[taskId])
|
|
6874
6878
|
return;
|
|
@@ -6980,12 +6984,12 @@ const TaskGanttInner = (props) => {
|
|
|
6980
6984
|
const containerStyle = {
|
|
6981
6985
|
// In order to see the vertical scrollbar of the gantt content,
|
|
6982
6986
|
// we resize dynamically the width of the gantt content
|
|
6983
|
-
height: Math.
|
|
6987
|
+
height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
|
|
6984
6988
|
width: (ganttTaskRootRef == null ? void 0 : ganttTaskRootRef.current) ? ganttTaskRootRef.current.clientWidth + ganttTaskRootRef.current.scrollLeft : fullSvgWidth
|
|
6985
6989
|
};
|
|
6986
6990
|
const gridStyle = useMemo(
|
|
6987
6991
|
() => ({
|
|
6988
|
-
height:
|
|
6992
|
+
height: ganttFullHeight,
|
|
6989
6993
|
width: fullSvgWidth,
|
|
6990
6994
|
backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
|
|
6991
6995
|
backgroundPositionX: additionalLeftSpace || void 0,
|
|
@@ -10476,6 +10480,14 @@ const defaultRoundEndDate = (date, viewMode) => {
|
|
|
10476
10480
|
}
|
|
10477
10481
|
return subQuarters(end, 1);
|
|
10478
10482
|
}
|
|
10483
|
+
case ViewMode.HalfYear: {
|
|
10484
|
+
const month = date.getMonth();
|
|
10485
|
+
if (month < 6) {
|
|
10486
|
+
return endOfHour(new Date(date.getFullYear(), 5, 1));
|
|
10487
|
+
} else {
|
|
10488
|
+
return endOfYear(date);
|
|
10489
|
+
}
|
|
10490
|
+
}
|
|
10479
10491
|
case ViewMode.Year: {
|
|
10480
10492
|
const end = endOfYear(date);
|
|
10481
10493
|
const diff = differenceInMonths(end, date);
|
|
@@ -11870,7 +11882,7 @@ const Gantt = ({
|
|
|
11870
11882
|
[sortedTasks]
|
|
11871
11883
|
);
|
|
11872
11884
|
const [visibleTasks, visibleTasksMirror] = useMemo(
|
|
11873
|
-
() => collectVisibleTasks(childTasksMap, rootTasksMap
|
|
11885
|
+
() => collectVisibleTasks(childTasksMap, rootTasksMap),
|
|
11874
11886
|
[childTasksMap, rootTasksMap]
|
|
11875
11887
|
);
|
|
11876
11888
|
const tasksMap = useMemo(() => getTasksMap(tasks), [tasks]);
|
|
@@ -478,14 +478,13 @@
|
|
|
478
478
|
if (comparisonLevel === 1) {
|
|
479
479
|
mirrorRes[task.id] = true;
|
|
480
480
|
}
|
|
481
|
-
|
|
482
|
-
if (task.type === "empty" || isTaskGroupingEnabled) {
|
|
481
|
+
if (task.type === "empty") {
|
|
483
482
|
return;
|
|
484
483
|
}
|
|
485
484
|
const childs = childTasksOnLevel.get(task.id);
|
|
486
485
|
if (childs && childs.length > 0) {
|
|
487
486
|
childs.forEach((childTask) => {
|
|
488
|
-
collectChildren(arrayRes, mirrorRes, childTask, childTasksOnLevel
|
|
487
|
+
collectChildren(arrayRes, mirrorRes, childTask, childTasksOnLevel);
|
|
489
488
|
});
|
|
490
489
|
}
|
|
491
490
|
};
|
|
@@ -495,7 +494,7 @@
|
|
|
495
494
|
for (const [comparisonLevel, rootTasks] of rootTasksMap.entries()) {
|
|
496
495
|
const childTasksOnLevel = childTasksMap.get(comparisonLevel) || /* @__PURE__ */ new Map();
|
|
497
496
|
rootTasks.forEach((task) => {
|
|
498
|
-
collectChildren(arrayRes, mirrorRes, task, childTasksOnLevel
|
|
497
|
+
collectChildren(arrayRes, mirrorRes, task, childTasksOnLevel);
|
|
499
498
|
});
|
|
500
499
|
}
|
|
501
500
|
return [arrayRes, mirrorRes];
|
|
@@ -3517,17 +3516,20 @@
|
|
|
3517
3516
|
className: styles$d.taskListContent,
|
|
3518
3517
|
ref: taskListContentRef,
|
|
3519
3518
|
onScroll: onScrollTableListContentVertically,
|
|
3519
|
+
style: {
|
|
3520
|
+
height: Math.min(
|
|
3521
|
+
ganttFullHeight,
|
|
3522
|
+
distances.minimumRowDisplayed * distances.rowHeight
|
|
3523
|
+
),
|
|
3524
|
+
overflowY: "auto"
|
|
3525
|
+
},
|
|
3520
3526
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3521
3527
|
"div",
|
|
3522
3528
|
{
|
|
3523
3529
|
style: {
|
|
3524
|
-
height:
|
|
3525
|
-
ganttFullHeight,
|
|
3526
|
-
distances.minimumRowDisplayed * distances.rowHeight
|
|
3527
|
-
),
|
|
3530
|
+
height: ganttFullHeight,
|
|
3528
3531
|
backgroundSize: `100% ${fullRowHeight * 2}px`,
|
|
3529
|
-
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)
|
|
3530
|
-
overflow: "hidden"
|
|
3532
|
+
backgroundImage: `linear-gradient(to bottom, transparent ${fullRowHeight}px, #f5f5f5 ${fullRowHeight}px)`
|
|
3531
3533
|
},
|
|
3532
3534
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3533
3535
|
TaskListTable,
|
|
@@ -4589,21 +4591,24 @@
|
|
|
4589
4591
|
)
|
|
4590
4592
|
);
|
|
4591
4593
|
if (!isUnknownDates && (i === startColumnIndex || date.getFullYear() !== getDate(i - 1).getFullYear())) {
|
|
4592
|
-
const year = date.getFullYear()
|
|
4593
|
-
|
|
4594
|
+
const year = date.getFullYear();
|
|
4595
|
+
console.log("Fulll year :>> ", year);
|
|
4596
|
+
const topValue = year.toString();
|
|
4597
|
+
const startHalfYearIndex = i - date.getMonth();
|
|
4598
|
+
const centerX = additionalLeftSpace + columnWidth * i + columnWidth;
|
|
4594
4599
|
topValues2.push(
|
|
4595
4600
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4596
4601
|
TopPartOfCalendar,
|
|
4597
4602
|
{
|
|
4598
|
-
value:
|
|
4599
|
-
x1Line: additionalLeftSpace + columnWidth *
|
|
4603
|
+
value: topValue,
|
|
4604
|
+
x1Line: additionalLeftSpace + columnWidth * startHalfYearIndex,
|
|
4600
4605
|
y1Line: 0,
|
|
4601
4606
|
y2Line: topDefaultHeight,
|
|
4602
|
-
xText:
|
|
4607
|
+
xText: centerX,
|
|
4603
4608
|
yText: topDefaultHeight * 0.9,
|
|
4604
4609
|
colors
|
|
4605
4610
|
},
|
|
4606
|
-
year
|
|
4611
|
+
`year-${year}`
|
|
4607
4612
|
)
|
|
4608
4613
|
);
|
|
4609
4614
|
}
|
|
@@ -4617,7 +4622,6 @@
|
|
|
4617
4622
|
for (let i = startColumnIndex; i <= endColumnIndex; i++) {
|
|
4618
4623
|
const date = getDate(i);
|
|
4619
4624
|
const quarter = "Q" + Math.ceil((date.getMonth() + 1) / 3);
|
|
4620
|
-
console.log("quarter :>> ", quarter);
|
|
4621
4625
|
bottomValues2.push(
|
|
4622
4626
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4623
4627
|
"text",
|
|
@@ -4823,6 +4827,7 @@
|
|
|
4823
4827
|
);
|
|
4824
4828
|
const dayOfMonth = date.getDate();
|
|
4825
4829
|
const prevDate = getDate(i - 1);
|
|
4830
|
+
console.log("testing center :>> ", additionalLeftSpace + columnWidth * i + ticks * columnWidth * 0.5);
|
|
4826
4831
|
if (!isUnknownDates && dayOfMonth !== prevDate.getDate()) {
|
|
4827
4832
|
const topValue = renderTopHeaderByDate(date);
|
|
4828
4833
|
topValues2.push(
|
|
@@ -4947,7 +4952,9 @@
|
|
|
4947
4952
|
case ViewMode.Year:
|
|
4948
4953
|
return currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4949
4954
|
case ViewMode.HalfYear:
|
|
4950
|
-
|
|
4955
|
+
const currentHalf = Math.ceil((currentDate.getMonth() + 1) / 6);
|
|
4956
|
+
const previousHalf = Math.ceil((previousDate.getMonth() + 1) / 6);
|
|
4957
|
+
return currentHalf !== previousHalf || currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4951
4958
|
case ViewMode.QuarterYear:
|
|
4952
4959
|
return Math.ceil((currentDate.getMonth() + 1) / 3) !== Math.ceil((previousDate.getMonth() + 1) / 3) || currentDate.getFullYear() !== previousDate.getFullYear();
|
|
4953
4960
|
case ViewMode.Month:
|
|
@@ -5019,6 +5026,7 @@
|
|
|
5019
5026
|
startColumnIndex
|
|
5020
5027
|
)) {
|
|
5021
5028
|
const x2 = additionalLeftSpace + columnWidth * i;
|
|
5029
|
+
console.log("drawing divider at x:", x2, "for index:", i, "date:", currentDate);
|
|
5022
5030
|
dividers.push(
|
|
5023
5031
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5024
5032
|
"line",
|
|
@@ -5252,9 +5260,9 @@
|
|
|
5252
5260
|
/* @__PURE__ */ jsxRuntime.jsx(GridBody, { ...props })
|
|
5253
5261
|
] });
|
|
5254
5262
|
};
|
|
5255
|
-
const ganttTaskRoot = "
|
|
5256
|
-
const ganttTaskContent = "
|
|
5257
|
-
const wrapper$2 = "
|
|
5263
|
+
const ganttTaskRoot = "_ganttTaskRoot_1lwsd_1";
|
|
5264
|
+
const ganttTaskContent = "_ganttTaskContent_1lwsd_83";
|
|
5265
|
+
const wrapper$2 = "_wrapper_1lwsd_111";
|
|
5258
5266
|
const styles$8 = {
|
|
5259
5267
|
ganttTaskRoot,
|
|
5260
5268
|
ganttTaskContent,
|
|
@@ -6384,6 +6392,7 @@
|
|
|
6384
6392
|
rtl,
|
|
6385
6393
|
selectTaskOnMouseDown,
|
|
6386
6394
|
setTooltipTask,
|
|
6395
|
+
enableTaskGrouping,
|
|
6387
6396
|
task,
|
|
6388
6397
|
task: { styles: taskStyles },
|
|
6389
6398
|
taskHalfHeight,
|
|
@@ -6611,7 +6620,7 @@
|
|
|
6611
6620
|
y: taskYOffset + taskHeight * 0.5,
|
|
6612
6621
|
className: isTextInside ? style.barLabel : style.barLabel && style.barLabelOutside,
|
|
6613
6622
|
ref: textRef,
|
|
6614
|
-
children: isTextInside ? task.name : ""
|
|
6623
|
+
children: enableTaskGrouping ? isTextInside ? task.name : "" : task.name
|
|
6615
6624
|
}
|
|
6616
6625
|
),
|
|
6617
6626
|
(outOfParentWarnings || hasDependencyWarning) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6813,11 +6822,7 @@
|
|
|
6813
6822
|
fixEndPosition,
|
|
6814
6823
|
handleDeleteTasks,
|
|
6815
6824
|
colorStyles,
|
|
6816
|
-
enableTaskGrouping
|
|
6817
|
-
getTaskInitials: (task2) => {
|
|
6818
|
-
var _a2;
|
|
6819
|
-
return ((_a2 = task2.name) == null ? void 0 : _a2.split(" ").map((word) => word[0]).join("").toUpperCase()) ?? "";
|
|
6820
|
-
}
|
|
6825
|
+
enableTaskGrouping
|
|
6821
6826
|
}
|
|
6822
6827
|
)
|
|
6823
6828
|
},
|
|
@@ -6881,7 +6886,6 @@
|
|
|
6881
6886
|
const dependentsByTask = dependentsAtLevel == null ? void 0 : dependentsAtLevel.get(taskId);
|
|
6882
6887
|
dependentsByTask == null ? void 0 : dependentsByTask.filter(({ dependent }) => visibleTasksMirror[dependent.id]).forEach((dep) => {
|
|
6883
6888
|
var _a2, _b;
|
|
6884
|
-
console.log("dependent", dep);
|
|
6885
6889
|
const addedDepsForDep = addedDependenciesAtLevel[_a2 = dep.dependent.id] ?? (addedDependenciesAtLevel[_a2] = {});
|
|
6886
6890
|
if (addedDepsForDep[taskId])
|
|
6887
6891
|
return;
|
|
@@ -6993,12 +6997,12 @@
|
|
|
6993
6997
|
const containerStyle = {
|
|
6994
6998
|
// In order to see the vertical scrollbar of the gantt content,
|
|
6995
6999
|
// we resize dynamically the width of the gantt content
|
|
6996
|
-
height: Math.
|
|
7000
|
+
height: Math.min(ganttFullHeight, minimumRowDisplayed * rowHeight),
|
|
6997
7001
|
width: (ganttTaskRootRef == null ? void 0 : ganttTaskRootRef.current) ? ganttTaskRootRef.current.clientWidth + ganttTaskRootRef.current.scrollLeft : fullSvgWidth
|
|
6998
7002
|
};
|
|
6999
7003
|
const gridStyle = React.useMemo(
|
|
7000
7004
|
() => ({
|
|
7001
|
-
height:
|
|
7005
|
+
height: ganttFullHeight,
|
|
7002
7006
|
width: fullSvgWidth,
|
|
7003
7007
|
backgroundSize: `${columnWidth}px ${fullRowHeight * 2}px`,
|
|
7004
7008
|
backgroundPositionX: additionalLeftSpace || void 0,
|
|
@@ -10489,6 +10493,14 @@
|
|
|
10489
10493
|
}
|
|
10490
10494
|
return subQuarters(end, 1);
|
|
10491
10495
|
}
|
|
10496
|
+
case ViewMode.HalfYear: {
|
|
10497
|
+
const month = date.getMonth();
|
|
10498
|
+
if (month < 6) {
|
|
10499
|
+
return endOfHour(new Date(date.getFullYear(), 5, 1));
|
|
10500
|
+
} else {
|
|
10501
|
+
return endOfYear(date);
|
|
10502
|
+
}
|
|
10503
|
+
}
|
|
10492
10504
|
case ViewMode.Year: {
|
|
10493
10505
|
const end = endOfYear(date);
|
|
10494
10506
|
const diff = differenceInMonths(end, date);
|
|
@@ -11883,7 +11895,7 @@
|
|
|
11883
11895
|
[sortedTasks]
|
|
11884
11896
|
);
|
|
11885
11897
|
const [visibleTasks, visibleTasksMirror] = React.useMemo(
|
|
11886
|
-
() => collectVisibleTasks(childTasksMap, rootTasksMap
|
|
11898
|
+
() => collectVisibleTasks(childTasksMap, rootTasksMap),
|
|
11887
11899
|
[childTasksMap, rootTasksMap]
|
|
11888
11900
|
);
|
|
11889
11901
|
const tasksMap = React.useMemo(() => getTasksMap(tasks), [tasks]);
|
package/dist/style.css
CHANGED
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
stroke: #e0e0e0;
|
|
333
333
|
stroke-width: 1.4;
|
|
334
334
|
}
|
|
335
|
-
.
|
|
335
|
+
._ganttTaskRoot_1lwsd_1 {
|
|
336
336
|
display: flex;
|
|
337
337
|
flex-direction: column;
|
|
338
338
|
overflow-x: scroll;
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
|
|
345
345
|
/* Only chrome otherwise the firefox scrollbar has no edge*/
|
|
346
346
|
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
|
|
347
|
-
.
|
|
347
|
+
._ganttTaskRoot_1lwsd_1 {
|
|
348
348
|
scrollbar-width: thin;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
background-clip: padding-box;
|
|
374
374
|
} */
|
|
375
375
|
|
|
376
|
-
.
|
|
376
|
+
._ganttTaskContent_1lwsd_83 {
|
|
377
377
|
margin: 0;
|
|
378
378
|
padding: 0;
|
|
379
379
|
overflow-x: hidden;
|
|
@@ -382,12 +382,12 @@
|
|
|
382
382
|
|
|
383
383
|
/* Only chrome otherwise the firefox scrollbar has no edges*/
|
|
384
384
|
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
|
|
385
|
-
.
|
|
385
|
+
._ganttTaskContent_1lwsd_83 {
|
|
386
386
|
scrollbar-width: thin;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
-
.
|
|
390
|
+
._wrapper_1lwsd_111 {
|
|
391
391
|
display: grid;
|
|
392
392
|
overflow-x: hidden;
|
|
393
393
|
overflow-y: auto;
|
|
@@ -396,7 +396,6 @@
|
|
|
396
396
|
list-style: none;
|
|
397
397
|
outline: none;
|
|
398
398
|
position: relative;
|
|
399
|
-
height: 600px;
|
|
400
399
|
}._hoverVisibleWrapper_11ld1_1:hover ._wrapper_11ld1_1 {
|
|
401
400
|
display: initial;
|
|
402
401
|
}
|
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.31",
|
|
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",
|