gantt-task-react-v 1.0.47 → 1.0.49
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/gantt/task-gantt-content.d.ts +20 -0
- package/dist/components/gantt-today/index.d.ts +5 -0
- package/dist/components/task-item/bar/bar-display.d.ts +17 -0
- package/dist/components/task-item/project/project-display.d.ts +17 -0
- package/dist/components/task-item/task-item.d.ts +17 -0
- package/dist/gantt-task-react.es.js +282 -100
- package/dist/gantt-task-react.umd.js +282 -100
- package/dist/types/public-types.d.ts +42 -0
- package/package.json +1 -1
|
@@ -14,6 +14,26 @@ export interface TaskGanttContentProps extends GanttTaskBarActions {
|
|
|
14
14
|
distances: Distances;
|
|
15
15
|
endColumnIndex: number;
|
|
16
16
|
fullRowHeight: number;
|
|
17
|
+
/**
|
|
18
|
+
* Absolute X coordinate of data date in the main SVG (including additionalLeftSpace), or undefined
|
|
19
|
+
*/
|
|
20
|
+
dataDateX?: number | null;
|
|
21
|
+
splitbarColors?: {
|
|
22
|
+
task?: {
|
|
23
|
+
onTime?: string;
|
|
24
|
+
delayed?: string;
|
|
25
|
+
};
|
|
26
|
+
project?: {
|
|
27
|
+
onTime?: string;
|
|
28
|
+
delayed?: string;
|
|
29
|
+
};
|
|
30
|
+
comparison?: {
|
|
31
|
+
onTime?: string;
|
|
32
|
+
delayed?: string;
|
|
33
|
+
};
|
|
34
|
+
} | null;
|
|
35
|
+
showProgressBar?: boolean;
|
|
36
|
+
progressBarColor?: string;
|
|
17
37
|
ganttRelationEvent: GanttRelationEvent | null;
|
|
18
38
|
getDate: (index: number) => Date;
|
|
19
39
|
getTaskCoordinates: (task: Task) => TaskCoordinates;
|
|
@@ -11,5 +11,10 @@ export type GanttTodayProps = {
|
|
|
11
11
|
showTodayLine?: boolean;
|
|
12
12
|
showDataDateLine?: boolean;
|
|
13
13
|
dataDate?: Date | null;
|
|
14
|
+
dataDateX?: number;
|
|
15
|
+
todayColor?: string | null;
|
|
16
|
+
dataDateColor?: string | null;
|
|
17
|
+
todayLabel?: string;
|
|
18
|
+
dataDateLabel?: string;
|
|
14
19
|
};
|
|
15
20
|
export declare const GanttToday: React.NamedExoticComponent<GanttTodayProps>;
|
|
@@ -14,6 +14,23 @@ type BarDisplayProps = {
|
|
|
14
14
|
x: number;
|
|
15
15
|
y: number;
|
|
16
16
|
customStyle?: CSSProperties;
|
|
17
|
+
dataDateX?: number | null;
|
|
18
|
+
splitbarColors?: {
|
|
19
|
+
task?: {
|
|
20
|
+
onTime?: string;
|
|
21
|
+
delayed?: string;
|
|
22
|
+
};
|
|
23
|
+
project?: {
|
|
24
|
+
onTime?: string;
|
|
25
|
+
delayed?: string;
|
|
26
|
+
};
|
|
27
|
+
comparison?: {
|
|
28
|
+
onTime?: string;
|
|
29
|
+
delayed?: string;
|
|
30
|
+
};
|
|
31
|
+
} | null;
|
|
32
|
+
showProgressBar?: boolean;
|
|
33
|
+
progressBarColor?: string;
|
|
17
34
|
};
|
|
18
35
|
export declare const BarDisplay: React.FC<BarDisplayProps>;
|
|
19
36
|
export {};
|
|
@@ -15,6 +15,23 @@ type ProjectDisplayProps = {
|
|
|
15
15
|
x1: number;
|
|
16
16
|
x2: number;
|
|
17
17
|
customStyle?: CSSProperties;
|
|
18
|
+
dataDateX?: number | null;
|
|
19
|
+
splitbarColors?: {
|
|
20
|
+
task?: {
|
|
21
|
+
onTime?: string;
|
|
22
|
+
delayed?: string;
|
|
23
|
+
};
|
|
24
|
+
project?: {
|
|
25
|
+
onTime?: string;
|
|
26
|
+
delayed?: string;
|
|
27
|
+
};
|
|
28
|
+
comparison?: {
|
|
29
|
+
onTime?: string;
|
|
30
|
+
delayed?: string;
|
|
31
|
+
};
|
|
32
|
+
} | null;
|
|
33
|
+
showProgressBar?: boolean;
|
|
34
|
+
progressBarColor?: string;
|
|
18
35
|
};
|
|
19
36
|
export declare const ProjectDisplay: React.FC<ProjectDisplayProps>;
|
|
20
37
|
export {};
|
|
@@ -13,6 +13,23 @@ export interface TaskItemProps extends Omit<GanttTaskBarActions, "taskBarMovingA
|
|
|
13
13
|
distances: Distances;
|
|
14
14
|
taskHeight: number;
|
|
15
15
|
taskHalfHeight: number;
|
|
16
|
+
dataDateX?: number | null;
|
|
17
|
+
splitbarColors?: {
|
|
18
|
+
task?: {
|
|
19
|
+
onTime?: string;
|
|
20
|
+
delayed?: string;
|
|
21
|
+
};
|
|
22
|
+
project?: {
|
|
23
|
+
onTime?: string;
|
|
24
|
+
delayed?: string;
|
|
25
|
+
};
|
|
26
|
+
comparison?: {
|
|
27
|
+
onTime?: string;
|
|
28
|
+
delayed?: string;
|
|
29
|
+
};
|
|
30
|
+
} | null;
|
|
31
|
+
showProgressBar?: boolean;
|
|
32
|
+
progressBarColor?: string;
|
|
16
33
|
authorizedRelations: RelationKind[];
|
|
17
34
|
ganttRelationEvent: GanttRelationEvent;
|
|
18
35
|
canDelete: boolean;
|
|
@@ -10912,12 +10912,16 @@ const GanttTodayInner = ({
|
|
|
10912
10912
|
distances: { columnWidth },
|
|
10913
10913
|
ganttFullHeight,
|
|
10914
10914
|
isUnknownDates,
|
|
10915
|
-
rtl,
|
|
10916
10915
|
startDate,
|
|
10917
10916
|
viewMode,
|
|
10918
10917
|
showTodayLine = true,
|
|
10919
10918
|
showDataDateLine = false,
|
|
10920
|
-
dataDate = null
|
|
10919
|
+
dataDate = null,
|
|
10920
|
+
dataDateX,
|
|
10921
|
+
todayColor = null,
|
|
10922
|
+
dataDateColor = null,
|
|
10923
|
+
todayLabel = "Today",
|
|
10924
|
+
dataDateLabel = "Data Date"
|
|
10921
10925
|
}) => {
|
|
10922
10926
|
const todayElement = useMemo(() => {
|
|
10923
10927
|
if (isUnknownDates || !showTodayLine) {
|
|
@@ -10941,125 +10945,147 @@ const GanttTodayInner = ({
|
|
|
10941
10945
|
return 1 + percent * 0.5;
|
|
10942
10946
|
}
|
|
10943
10947
|
case ViewMode.Year: {
|
|
10944
|
-
const
|
|
10948
|
+
const todayOfYear = Math.floor(
|
|
10949
|
+
(today.getTime() - new Date(today.getFullYear(), 0, 0).getTime()) / (1e3 * 60 * 60 * 24)
|
|
10950
|
+
);
|
|
10951
|
+
const totalDaysInYear = new Date(today.getFullYear(), 11, 31).getDate() === 31 ? 366 : 365;
|
|
10952
|
+
const percent = todayOfYear / totalDaysInYear;
|
|
10945
10953
|
return 1 + percent * 0.5;
|
|
10946
10954
|
}
|
|
10947
10955
|
default:
|
|
10948
10956
|
return 1;
|
|
10949
10957
|
}
|
|
10950
10958
|
};
|
|
10951
|
-
const
|
|
10952
|
-
|
|
10953
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10959
|
+
const x = additionalLeftSpace + todayIndex * columnWidth * extraMultiplier();
|
|
10960
|
+
return /* @__PURE__ */ jsxs("g", { className: "today-line", children: [
|
|
10954
10961
|
/* @__PURE__ */ jsx(
|
|
10955
|
-
"
|
|
10962
|
+
"line",
|
|
10956
10963
|
{
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10964
|
+
x1: x,
|
|
10965
|
+
y1: 0,
|
|
10966
|
+
x2: x,
|
|
10967
|
+
y2: ganttFullHeight,
|
|
10968
|
+
className: styles$c.todayLine,
|
|
10969
|
+
stroke: todayColor || void 0
|
|
10962
10970
|
}
|
|
10963
10971
|
),
|
|
10964
10972
|
/* @__PURE__ */ jsx(
|
|
10965
|
-
"
|
|
10973
|
+
"polygon",
|
|
10966
10974
|
{
|
|
10967
|
-
className: styles$c.
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
|
|
10971
|
-
|
|
10975
|
+
className: styles$c.todayTriangle,
|
|
10976
|
+
fill: todayColor || void 0,
|
|
10977
|
+
points: `${x},0 ${x - 5},8 ${x + 5},8`
|
|
10978
|
+
}
|
|
10979
|
+
),
|
|
10980
|
+
/* @__PURE__ */ jsx(
|
|
10981
|
+
"text",
|
|
10982
|
+
{
|
|
10983
|
+
x,
|
|
10984
|
+
y: 15,
|
|
10985
|
+
className: styles$c.todayLabel,
|
|
10986
|
+
fill: todayColor || void 0,
|
|
10987
|
+
textAnchor: "middle",
|
|
10988
|
+
children: todayLabel
|
|
10972
10989
|
}
|
|
10973
10990
|
)
|
|
10974
|
-
] });
|
|
10991
|
+
] }, "today-line");
|
|
10975
10992
|
}, [
|
|
10976
|
-
additionalLeftSpace,
|
|
10977
|
-
columnWidth,
|
|
10978
|
-
ganttFullHeight,
|
|
10979
10993
|
isUnknownDates,
|
|
10980
|
-
|
|
10994
|
+
showTodayLine,
|
|
10981
10995
|
startDate,
|
|
10982
10996
|
viewMode,
|
|
10983
|
-
|
|
10997
|
+
additionalLeftSpace,
|
|
10998
|
+
columnWidth,
|
|
10999
|
+
ganttFullHeight,
|
|
11000
|
+
todayColor,
|
|
11001
|
+
todayLabel
|
|
10984
11002
|
]);
|
|
10985
11003
|
const dataDateElement = useMemo(() => {
|
|
10986
|
-
if (!showDataDateLine || !dataDate) {
|
|
11004
|
+
if (isUnknownDates || !showDataDateLine || !dataDate) {
|
|
10987
11005
|
return null;
|
|
10988
11006
|
}
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11007
|
+
let x;
|
|
11008
|
+
if (dataDateX !== void 0) {
|
|
11009
|
+
x = dataDateX;
|
|
11010
|
+
} else {
|
|
11011
|
+
const dataDateIndex = getDatesDiff(dataDate, startDate, viewMode);
|
|
11012
|
+
const extraMultiplier = () => {
|
|
11013
|
+
switch (viewMode) {
|
|
11014
|
+
case ViewMode.Week: {
|
|
11015
|
+
const percent = dataDate.getDay() / 7;
|
|
11016
|
+
return 1 + percent * 0.2;
|
|
11017
|
+
}
|
|
11018
|
+
case ViewMode.Month: {
|
|
11019
|
+
const dayInMonth = dataDate.getDate();
|
|
11020
|
+
const maxDaysInMonth = getDaysInMonth(
|
|
11021
|
+
dataDate.getMonth(),
|
|
11022
|
+
dataDate.getFullYear()
|
|
11023
|
+
);
|
|
11024
|
+
const percent = dayInMonth / maxDaysInMonth;
|
|
11025
|
+
return 1 + percent * 0.5;
|
|
11026
|
+
}
|
|
11027
|
+
case ViewMode.Year: {
|
|
11028
|
+
const dataDateOfYear = Math.floor(
|
|
11029
|
+
(dataDate.getTime() - new Date(dataDate.getFullYear(), 0, 0).getTime()) / (1e3 * 60 * 60 * 24)
|
|
11030
|
+
);
|
|
11031
|
+
const totalDaysInYear = new Date(dataDate.getFullYear(), 11, 31).getDate() === 31 ? 366 : 365;
|
|
11032
|
+
const percent = dataDateOfYear / totalDaysInYear;
|
|
11033
|
+
return 1 + percent * 0.5;
|
|
11034
|
+
}
|
|
11035
|
+
default:
|
|
11036
|
+
return 1;
|
|
11008
11037
|
}
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
const tickX = dataIndex * columnWidth * extraMultiplier();
|
|
11014
|
-
const x = rtl ? tickX + columnWidth : tickX;
|
|
11015
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11038
|
+
};
|
|
11039
|
+
x = additionalLeftSpace + dataDateIndex * columnWidth * extraMultiplier();
|
|
11040
|
+
}
|
|
11041
|
+
return /* @__PURE__ */ jsxs("g", { className: "data-date-line", children: [
|
|
11016
11042
|
/* @__PURE__ */ jsx(
|
|
11017
|
-
"
|
|
11043
|
+
"line",
|
|
11018
11044
|
{
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11045
|
+
x1: x,
|
|
11046
|
+
y1: 0,
|
|
11047
|
+
x2: x,
|
|
11048
|
+
y2: ganttFullHeight,
|
|
11049
|
+
className: styles$c.dataDateLine,
|
|
11050
|
+
stroke: dataDateColor || void 0
|
|
11025
11051
|
}
|
|
11026
11052
|
),
|
|
11027
11053
|
/* @__PURE__ */ jsx(
|
|
11028
|
-
"
|
|
11054
|
+
"polygon",
|
|
11029
11055
|
{
|
|
11030
|
-
className: styles$c.
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
r: 6,
|
|
11034
|
-
fill: "var(--gantt-calendar-today-color)"
|
|
11056
|
+
className: styles$c.dataDateTriangle,
|
|
11057
|
+
fill: dataDateColor || void 0,
|
|
11058
|
+
points: `${x},0 ${x - 5},8 ${x + 5},8`
|
|
11035
11059
|
}
|
|
11036
11060
|
),
|
|
11037
11061
|
/* @__PURE__ */ jsx(
|
|
11038
11062
|
"text",
|
|
11039
11063
|
{
|
|
11040
|
-
x
|
|
11041
|
-
y:
|
|
11042
|
-
|
|
11043
|
-
fill:
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
children: "Data Date"
|
|
11064
|
+
x,
|
|
11065
|
+
y: 30,
|
|
11066
|
+
className: styles$c.dataDateLabel,
|
|
11067
|
+
fill: dataDateColor || void 0,
|
|
11068
|
+
textAnchor: "middle",
|
|
11069
|
+
children: dataDateLabel
|
|
11047
11070
|
}
|
|
11048
11071
|
)
|
|
11049
|
-
] });
|
|
11072
|
+
] }, "data-date-line");
|
|
11050
11073
|
}, [
|
|
11074
|
+
isUnknownDates,
|
|
11075
|
+
showDataDateLine,
|
|
11076
|
+
dataDate,
|
|
11077
|
+
dataDateX,
|
|
11078
|
+
startDate,
|
|
11079
|
+
viewMode,
|
|
11051
11080
|
additionalLeftSpace,
|
|
11052
11081
|
columnWidth,
|
|
11053
11082
|
ganttFullHeight,
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
viewMode,
|
|
11057
|
-
showDataDateLine,
|
|
11058
|
-
dataDate
|
|
11083
|
+
dataDateColor,
|
|
11084
|
+
dataDateLabel
|
|
11059
11085
|
]);
|
|
11060
|
-
return /* @__PURE__ */ jsxs(
|
|
11061
|
-
|
|
11062
|
-
|
|
11086
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11087
|
+
todayElement,
|
|
11088
|
+
dataDateElement
|
|
11063
11089
|
] });
|
|
11064
11090
|
};
|
|
11065
11091
|
const GanttToday = memo(GanttTodayInner);
|
|
@@ -11973,7 +11999,11 @@ const BarDisplay = ({
|
|
|
11973
11999
|
width,
|
|
11974
12000
|
x,
|
|
11975
12001
|
y,
|
|
11976
|
-
customStyle
|
|
12002
|
+
customStyle,
|
|
12003
|
+
dataDateX,
|
|
12004
|
+
splitbarColors,
|
|
12005
|
+
showProgressBar = true,
|
|
12006
|
+
progressBarColor
|
|
11977
12007
|
}) => {
|
|
11978
12008
|
return /* @__PURE__ */ jsxs(
|
|
11979
12009
|
"g",
|
|
@@ -11992,7 +12022,40 @@ const BarDisplay = ({
|
|
|
11992
12022
|
}
|
|
11993
12023
|
},
|
|
11994
12024
|
children: [
|
|
11995
|
-
|
|
12025
|
+
typeof dataDateX === "number" ? (() => {
|
|
12026
|
+
var _a, _b;
|
|
12027
|
+
const localSplit = Math.max(0, Math.min(width, dataDateX - x));
|
|
12028
|
+
const leftFill = ((_a = splitbarColors == null ? void 0 : splitbarColors.task) == null ? void 0 : _a.onTime) || "var(--gantt-bar-background-color)";
|
|
12029
|
+
const rightFill = ((_b = splitbarColors == null ? void 0 : splitbarColors.task) == null ? void 0 : _b.delayed) || "var(--gantt-bar-background-color)";
|
|
12030
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12031
|
+
/* @__PURE__ */ jsx(
|
|
12032
|
+
"rect",
|
|
12033
|
+
{
|
|
12034
|
+
x,
|
|
12035
|
+
width: localSplit,
|
|
12036
|
+
y,
|
|
12037
|
+
height,
|
|
12038
|
+
ry: barCornerRadius,
|
|
12039
|
+
rx: barCornerRadius,
|
|
12040
|
+
fill: leftFill,
|
|
12041
|
+
className: styles$8.barBackground
|
|
12042
|
+
}
|
|
12043
|
+
),
|
|
12044
|
+
/* @__PURE__ */ jsx(
|
|
12045
|
+
"rect",
|
|
12046
|
+
{
|
|
12047
|
+
x: x + localSplit,
|
|
12048
|
+
width: Math.max(0, width - localSplit),
|
|
12049
|
+
y,
|
|
12050
|
+
height,
|
|
12051
|
+
ry: barCornerRadius,
|
|
12052
|
+
rx: barCornerRadius,
|
|
12053
|
+
fill: rightFill,
|
|
12054
|
+
className: styles$8.barBackground
|
|
12055
|
+
}
|
|
12056
|
+
)
|
|
12057
|
+
] });
|
|
12058
|
+
})() : /* @__PURE__ */ jsx(
|
|
11996
12059
|
"rect",
|
|
11997
12060
|
{
|
|
11998
12061
|
x,
|
|
@@ -12005,7 +12068,7 @@ const BarDisplay = ({
|
|
|
12005
12068
|
className: styles$8.barBackground
|
|
12006
12069
|
}
|
|
12007
12070
|
),
|
|
12008
|
-
/* @__PURE__ */ jsx(
|
|
12071
|
+
showProgressBar && /* @__PURE__ */ jsx(
|
|
12009
12072
|
"rect",
|
|
12010
12073
|
{
|
|
12011
12074
|
x: progressX,
|
|
@@ -12014,7 +12077,7 @@ const BarDisplay = ({
|
|
|
12014
12077
|
height,
|
|
12015
12078
|
ry: barCornerRadius,
|
|
12016
12079
|
rx: barCornerRadius,
|
|
12017
|
-
fill: "
|
|
12080
|
+
fill: progressBarColor || "var(--gantt-bar-progress-color)"
|
|
12018
12081
|
}
|
|
12019
12082
|
)
|
|
12020
12083
|
]
|
|
@@ -12078,7 +12141,11 @@ const ProjectDisplay = ({
|
|
|
12078
12141
|
x1,
|
|
12079
12142
|
x2,
|
|
12080
12143
|
startMoveFullTask,
|
|
12081
|
-
customStyle
|
|
12144
|
+
customStyle,
|
|
12145
|
+
dataDateX,
|
|
12146
|
+
splitbarColors,
|
|
12147
|
+
showProgressBar = true,
|
|
12148
|
+
progressBarColor
|
|
12082
12149
|
}) => {
|
|
12083
12150
|
const projectLeftTriangle = [
|
|
12084
12151
|
x1,
|
|
@@ -12113,7 +12180,40 @@ const ProjectDisplay = ({
|
|
|
12113
12180
|
},
|
|
12114
12181
|
className: styles$7.projectWrapper,
|
|
12115
12182
|
children: [
|
|
12116
|
-
|
|
12183
|
+
typeof dataDateX === "number" ? (() => {
|
|
12184
|
+
var _a, _b;
|
|
12185
|
+
const localSplit = Math.max(0, Math.min(width, dataDateX - x1));
|
|
12186
|
+
const leftFill = ((_a = splitbarColors == null ? void 0 : splitbarColors.project) == null ? void 0 : _a.onTime) || "var(--gantt-project-background-color)";
|
|
12187
|
+
const rightFill = ((_b = splitbarColors == null ? void 0 : splitbarColors.project) == null ? void 0 : _b.delayed) || "var(--gantt-project-background-color)";
|
|
12188
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12189
|
+
/* @__PURE__ */ jsx(
|
|
12190
|
+
"rect",
|
|
12191
|
+
{
|
|
12192
|
+
x: x1,
|
|
12193
|
+
width: localSplit,
|
|
12194
|
+
y: taskYOffset,
|
|
12195
|
+
height: taskHeight,
|
|
12196
|
+
rx: barCornerRadius,
|
|
12197
|
+
ry: barCornerRadius,
|
|
12198
|
+
className: styles$7.projectBackground,
|
|
12199
|
+
fill: leftFill
|
|
12200
|
+
}
|
|
12201
|
+
),
|
|
12202
|
+
/* @__PURE__ */ jsx(
|
|
12203
|
+
"rect",
|
|
12204
|
+
{
|
|
12205
|
+
x: x1 + localSplit,
|
|
12206
|
+
width: Math.max(0, width - localSplit),
|
|
12207
|
+
y: taskYOffset,
|
|
12208
|
+
height: taskHeight,
|
|
12209
|
+
rx: barCornerRadius,
|
|
12210
|
+
ry: barCornerRadius,
|
|
12211
|
+
className: styles$7.projectBackground,
|
|
12212
|
+
fill: rightFill
|
|
12213
|
+
}
|
|
12214
|
+
)
|
|
12215
|
+
] });
|
|
12216
|
+
})() : /* @__PURE__ */ jsx(
|
|
12117
12217
|
"rect",
|
|
12118
12218
|
{
|
|
12119
12219
|
x: x1,
|
|
@@ -12126,7 +12226,7 @@ const ProjectDisplay = ({
|
|
|
12126
12226
|
fill: "unset"
|
|
12127
12227
|
}
|
|
12128
12228
|
),
|
|
12129
|
-
/* @__PURE__ */ jsx(
|
|
12229
|
+
showProgressBar && /* @__PURE__ */ jsx(
|
|
12130
12230
|
"rect",
|
|
12131
12231
|
{
|
|
12132
12232
|
x: progressX,
|
|
@@ -12135,7 +12235,7 @@ const ProjectDisplay = ({
|
|
|
12135
12235
|
height: taskHeight,
|
|
12136
12236
|
ry: barCornerRadius,
|
|
12137
12237
|
rx: barCornerRadius,
|
|
12138
|
-
fill: "
|
|
12238
|
+
fill: progressBarColor || "var(--gantt-bar-progress-color)"
|
|
12139
12239
|
}
|
|
12140
12240
|
),
|
|
12141
12241
|
/* @__PURE__ */ jsx(
|
|
@@ -12234,7 +12334,11 @@ const Bar = (props) => {
|
|
|
12234
12334
|
x1,
|
|
12235
12335
|
x2,
|
|
12236
12336
|
movingAction,
|
|
12237
|
-
ganttRelationEvent
|
|
12337
|
+
ganttRelationEvent,
|
|
12338
|
+
dataDateX,
|
|
12339
|
+
splitbarColors,
|
|
12340
|
+
showProgressBar,
|
|
12341
|
+
progressBarColor
|
|
12238
12342
|
} = props;
|
|
12239
12343
|
useMemo(() => width < 30, [width]);
|
|
12240
12344
|
const handleHeight = useMemo(() => taskHeight - 2, [taskHeight]);
|
|
@@ -12295,7 +12399,11 @@ const Bar = (props) => {
|
|
|
12295
12399
|
isSelected,
|
|
12296
12400
|
isCritical,
|
|
12297
12401
|
hasChildren,
|
|
12298
|
-
startMoveFullTask
|
|
12402
|
+
startMoveFullTask,
|
|
12403
|
+
dataDateX,
|
|
12404
|
+
splitbarColors,
|
|
12405
|
+
showProgressBar,
|
|
12406
|
+
progressBarColor
|
|
12299
12407
|
}
|
|
12300
12408
|
);
|
|
12301
12409
|
} else {
|
|
@@ -12314,7 +12422,11 @@ const Bar = (props) => {
|
|
|
12314
12422
|
isSelected,
|
|
12315
12423
|
isCritical,
|
|
12316
12424
|
hasChildren,
|
|
12317
|
-
startMoveFullTask
|
|
12425
|
+
startMoveFullTask,
|
|
12426
|
+
dataDateX,
|
|
12427
|
+
splitbarColors,
|
|
12428
|
+
showProgressBar,
|
|
12429
|
+
progressBarColor
|
|
12318
12430
|
}
|
|
12319
12431
|
);
|
|
12320
12432
|
}
|
|
@@ -12687,10 +12799,13 @@ const TaskItemInner = (props) => {
|
|
|
12687
12799
|
},
|
|
12688
12800
|
[onTooltipTask, task]
|
|
12689
12801
|
);
|
|
12690
|
-
const onMouseLeave = useCallback(
|
|
12691
|
-
event
|
|
12692
|
-
|
|
12693
|
-
|
|
12802
|
+
const onMouseLeave = useCallback(
|
|
12803
|
+
(event) => {
|
|
12804
|
+
event.stopPropagation();
|
|
12805
|
+
onTooltipTask(null, null);
|
|
12806
|
+
},
|
|
12807
|
+
[onTooltipTask]
|
|
12808
|
+
);
|
|
12694
12809
|
return /* @__PURE__ */ jsxs(
|
|
12695
12810
|
"g",
|
|
12696
12811
|
{
|
|
@@ -12869,7 +12984,11 @@ const TaskGanttContentInner = (props) => {
|
|
|
12869
12984
|
renderCustomLabel,
|
|
12870
12985
|
taskBarMovingAction,
|
|
12871
12986
|
waitCommitTasks,
|
|
12872
|
-
viewMode
|
|
12987
|
+
viewMode,
|
|
12988
|
+
dataDateX,
|
|
12989
|
+
splitbarColors,
|
|
12990
|
+
showProgressBar,
|
|
12991
|
+
progressBarColor
|
|
12873
12992
|
} = props;
|
|
12874
12993
|
const renderedHolidays = useMemo(() => {
|
|
12875
12994
|
const { columnWidth } = distances;
|
|
@@ -12956,6 +13075,11 @@ const TaskGanttContentInner = (props) => {
|
|
|
12956
13075
|
x2: taskX2,
|
|
12957
13076
|
comparisonDates
|
|
12958
13077
|
} = getTaskCoordinates2(task);
|
|
13078
|
+
const containerXAbs = Math.max(
|
|
13079
|
+
containerX + (additionalLeftSpace || 0),
|
|
13080
|
+
0
|
|
13081
|
+
);
|
|
13082
|
+
const dataDateXLocal = typeof dataDateX === "number" ? dataDateX - containerXAbs : void 0;
|
|
12959
13083
|
tasksRes.push(
|
|
12960
13084
|
/* @__PURE__ */ jsx(
|
|
12961
13085
|
"svg",
|
|
@@ -12999,7 +13123,11 @@ const TaskGanttContentInner = (props) => {
|
|
|
12999
13123
|
rtl,
|
|
13000
13124
|
onDeleteTask,
|
|
13001
13125
|
renderCustomLabel,
|
|
13002
|
-
viewMode
|
|
13126
|
+
viewMode,
|
|
13127
|
+
dataDateX: dataDateXLocal,
|
|
13128
|
+
splitbarColors,
|
|
13129
|
+
showProgressBar,
|
|
13130
|
+
progressBarColor
|
|
13003
13131
|
}
|
|
13004
13132
|
)
|
|
13005
13133
|
},
|
|
@@ -13209,6 +13337,10 @@ const TaskGanttContentInner = (props) => {
|
|
|
13209
13337
|
isDateChangeable,
|
|
13210
13338
|
isRelationChangeable,
|
|
13211
13339
|
visibleTasksMirror,
|
|
13340
|
+
dataDateX,
|
|
13341
|
+
splitbarColors,
|
|
13342
|
+
showProgressBar,
|
|
13343
|
+
progressBarColor,
|
|
13212
13344
|
onArrowDoubleClick
|
|
13213
13345
|
]);
|
|
13214
13346
|
return /* @__PURE__ */ jsxs("g", { className: "content", children: [
|
|
@@ -18649,7 +18781,14 @@ const Gantt = (props) => {
|
|
|
18649
18781
|
rowHeight,
|
|
18650
18782
|
showTodayLine = true,
|
|
18651
18783
|
showDataDateLine = false,
|
|
18652
|
-
dataDate = null
|
|
18784
|
+
dataDate = null,
|
|
18785
|
+
todayColor,
|
|
18786
|
+
dataDateColor,
|
|
18787
|
+
todayLabel = "Today",
|
|
18788
|
+
dataDateLabel = "Data Date",
|
|
18789
|
+
splitbarColors,
|
|
18790
|
+
showProgressBar = true,
|
|
18791
|
+
progressBarColor
|
|
18653
18792
|
} = props;
|
|
18654
18793
|
const ganttSVGRef = useRef(null);
|
|
18655
18794
|
const wrapperRef = useRef(null);
|
|
@@ -19778,6 +19917,29 @@ const Gantt = (props) => {
|
|
|
19778
19917
|
() => svgWidth + additionalLeftSpace + additionalRightSpace,
|
|
19779
19918
|
[additionalLeftSpace, additionalRightSpace, svgWidth]
|
|
19780
19919
|
);
|
|
19920
|
+
const dataDateX = useMemo(() => {
|
|
19921
|
+
if (!dataDate)
|
|
19922
|
+
return void 0;
|
|
19923
|
+
try {
|
|
19924
|
+
const roundedDataDate = roundStartDate(dataDate);
|
|
19925
|
+
const x = taskXCoordinate(
|
|
19926
|
+
roundedDataDate,
|
|
19927
|
+
startDate,
|
|
19928
|
+
viewMode,
|
|
19929
|
+
distances.columnWidth
|
|
19930
|
+
);
|
|
19931
|
+
return additionalLeftSpace + x;
|
|
19932
|
+
} catch {
|
|
19933
|
+
return void 0;
|
|
19934
|
+
}
|
|
19935
|
+
}, [
|
|
19936
|
+
dataDate,
|
|
19937
|
+
startDate,
|
|
19938
|
+
viewMode,
|
|
19939
|
+
distances,
|
|
19940
|
+
additionalLeftSpace,
|
|
19941
|
+
roundStartDate
|
|
19942
|
+
]);
|
|
19781
19943
|
const gridProps = useMemo(
|
|
19782
19944
|
() => ({
|
|
19783
19945
|
additionalLeftSpace,
|
|
@@ -19789,7 +19951,12 @@ const Gantt = (props) => {
|
|
|
19789
19951
|
viewMode,
|
|
19790
19952
|
showTodayLine,
|
|
19791
19953
|
showDataDateLine,
|
|
19792
|
-
dataDate
|
|
19954
|
+
dataDate,
|
|
19955
|
+
dataDateX,
|
|
19956
|
+
todayColor,
|
|
19957
|
+
dataDateColor,
|
|
19958
|
+
todayLabel,
|
|
19959
|
+
dataDateLabel
|
|
19793
19960
|
}),
|
|
19794
19961
|
[
|
|
19795
19962
|
additionalLeftSpace,
|
|
@@ -19801,7 +19968,12 @@ const Gantt = (props) => {
|
|
|
19801
19968
|
viewMode,
|
|
19802
19969
|
showTodayLine,
|
|
19803
19970
|
showDataDateLine,
|
|
19804
|
-
dataDate
|
|
19971
|
+
dataDate,
|
|
19972
|
+
dataDateX,
|
|
19973
|
+
todayColor,
|
|
19974
|
+
dataDateColor,
|
|
19975
|
+
todayLabel,
|
|
19976
|
+
dataDateLabel
|
|
19805
19977
|
]
|
|
19806
19978
|
);
|
|
19807
19979
|
const calendarProps = useMemo(
|
|
@@ -19837,6 +20009,11 @@ const Gantt = (props) => {
|
|
|
19837
20009
|
const renderTaskBarProps = useMemo(
|
|
19838
20010
|
() => ({
|
|
19839
20011
|
...taskBar,
|
|
20012
|
+
splitbarColors,
|
|
20013
|
+
dataDate,
|
|
20014
|
+
dataDateX,
|
|
20015
|
+
showProgressBar,
|
|
20016
|
+
progressBarColor,
|
|
19840
20017
|
taskBarMovingAction: (task) => {
|
|
19841
20018
|
var _a2;
|
|
19842
20019
|
return task.id === ((_a2 = changeInProgress == null ? void 0 : changeInProgress.changedTask) == null ? void 0 : _a2.id) ? changeInProgress.action : null;
|
|
@@ -19877,6 +20054,11 @@ const Gantt = (props) => {
|
|
|
19877
20054
|
[
|
|
19878
20055
|
viewMode,
|
|
19879
20056
|
taskBar,
|
|
20057
|
+
splitbarColors,
|
|
20058
|
+
dataDate,
|
|
20059
|
+
dataDateX,
|
|
20060
|
+
showProgressBar,
|
|
20061
|
+
progressBarColor,
|
|
19880
20062
|
authorizedRelations,
|
|
19881
20063
|
additionalLeftSpace,
|
|
19882
20064
|
additionalRightSpace,
|
|
@@ -10929,12 +10929,16 @@
|
|
|
10929
10929
|
distances: { columnWidth },
|
|
10930
10930
|
ganttFullHeight,
|
|
10931
10931
|
isUnknownDates,
|
|
10932
|
-
rtl,
|
|
10933
10932
|
startDate,
|
|
10934
10933
|
viewMode,
|
|
10935
10934
|
showTodayLine = true,
|
|
10936
10935
|
showDataDateLine = false,
|
|
10937
|
-
dataDate = null
|
|
10936
|
+
dataDate = null,
|
|
10937
|
+
dataDateX,
|
|
10938
|
+
todayColor = null,
|
|
10939
|
+
dataDateColor = null,
|
|
10940
|
+
todayLabel = "Today",
|
|
10941
|
+
dataDateLabel = "Data Date"
|
|
10938
10942
|
}) => {
|
|
10939
10943
|
const todayElement = React.useMemo(() => {
|
|
10940
10944
|
if (isUnknownDates || !showTodayLine) {
|
|
@@ -10958,125 +10962,147 @@
|
|
|
10958
10962
|
return 1 + percent * 0.5;
|
|
10959
10963
|
}
|
|
10960
10964
|
case ViewMode.Year: {
|
|
10961
|
-
const
|
|
10965
|
+
const todayOfYear = Math.floor(
|
|
10966
|
+
(today.getTime() - new Date(today.getFullYear(), 0, 0).getTime()) / (1e3 * 60 * 60 * 24)
|
|
10967
|
+
);
|
|
10968
|
+
const totalDaysInYear = new Date(today.getFullYear(), 11, 31).getDate() === 31 ? 366 : 365;
|
|
10969
|
+
const percent = todayOfYear / totalDaysInYear;
|
|
10962
10970
|
return 1 + percent * 0.5;
|
|
10963
10971
|
}
|
|
10964
10972
|
default:
|
|
10965
10973
|
return 1;
|
|
10966
10974
|
}
|
|
10967
10975
|
};
|
|
10968
|
-
const
|
|
10969
|
-
|
|
10970
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10976
|
+
const x = additionalLeftSpace + todayIndex * columnWidth * extraMultiplier();
|
|
10977
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "today-line", children: [
|
|
10971
10978
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10972
|
-
"
|
|
10979
|
+
"line",
|
|
10973
10980
|
{
|
|
10974
|
-
|
|
10975
|
-
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10981
|
+
x1: x,
|
|
10982
|
+
y1: 0,
|
|
10983
|
+
x2: x,
|
|
10984
|
+
y2: ganttFullHeight,
|
|
10985
|
+
className: styles$c.todayLine,
|
|
10986
|
+
stroke: todayColor || void 0
|
|
10979
10987
|
}
|
|
10980
10988
|
),
|
|
10981
10989
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10982
|
-
"
|
|
10990
|
+
"polygon",
|
|
10983
10991
|
{
|
|
10984
|
-
className: styles$c.
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10992
|
+
className: styles$c.todayTriangle,
|
|
10993
|
+
fill: todayColor || void 0,
|
|
10994
|
+
points: `${x},0 ${x - 5},8 ${x + 5},8`
|
|
10995
|
+
}
|
|
10996
|
+
),
|
|
10997
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10998
|
+
"text",
|
|
10999
|
+
{
|
|
11000
|
+
x,
|
|
11001
|
+
y: 15,
|
|
11002
|
+
className: styles$c.todayLabel,
|
|
11003
|
+
fill: todayColor || void 0,
|
|
11004
|
+
textAnchor: "middle",
|
|
11005
|
+
children: todayLabel
|
|
10989
11006
|
}
|
|
10990
11007
|
)
|
|
10991
|
-
] });
|
|
11008
|
+
] }, "today-line");
|
|
10992
11009
|
}, [
|
|
10993
|
-
additionalLeftSpace,
|
|
10994
|
-
columnWidth,
|
|
10995
|
-
ganttFullHeight,
|
|
10996
11010
|
isUnknownDates,
|
|
10997
|
-
|
|
11011
|
+
showTodayLine,
|
|
10998
11012
|
startDate,
|
|
10999
11013
|
viewMode,
|
|
11000
|
-
|
|
11014
|
+
additionalLeftSpace,
|
|
11015
|
+
columnWidth,
|
|
11016
|
+
ganttFullHeight,
|
|
11017
|
+
todayColor,
|
|
11018
|
+
todayLabel
|
|
11001
11019
|
]);
|
|
11002
11020
|
const dataDateElement = React.useMemo(() => {
|
|
11003
|
-
if (!showDataDateLine || !dataDate) {
|
|
11021
|
+
if (isUnknownDates || !showDataDateLine || !dataDate) {
|
|
11004
11022
|
return null;
|
|
11005
11023
|
}
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
|
|
11013
|
-
|
|
11014
|
-
|
|
11015
|
-
|
|
11016
|
-
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11024
|
+
let x;
|
|
11025
|
+
if (dataDateX !== void 0) {
|
|
11026
|
+
x = dataDateX;
|
|
11027
|
+
} else {
|
|
11028
|
+
const dataDateIndex = getDatesDiff(dataDate, startDate, viewMode);
|
|
11029
|
+
const extraMultiplier = () => {
|
|
11030
|
+
switch (viewMode) {
|
|
11031
|
+
case ViewMode.Week: {
|
|
11032
|
+
const percent = dataDate.getDay() / 7;
|
|
11033
|
+
return 1 + percent * 0.2;
|
|
11034
|
+
}
|
|
11035
|
+
case ViewMode.Month: {
|
|
11036
|
+
const dayInMonth = dataDate.getDate();
|
|
11037
|
+
const maxDaysInMonth = getDaysInMonth(
|
|
11038
|
+
dataDate.getMonth(),
|
|
11039
|
+
dataDate.getFullYear()
|
|
11040
|
+
);
|
|
11041
|
+
const percent = dayInMonth / maxDaysInMonth;
|
|
11042
|
+
return 1 + percent * 0.5;
|
|
11043
|
+
}
|
|
11044
|
+
case ViewMode.Year: {
|
|
11045
|
+
const dataDateOfYear = Math.floor(
|
|
11046
|
+
(dataDate.getTime() - new Date(dataDate.getFullYear(), 0, 0).getTime()) / (1e3 * 60 * 60 * 24)
|
|
11047
|
+
);
|
|
11048
|
+
const totalDaysInYear = new Date(dataDate.getFullYear(), 11, 31).getDate() === 31 ? 366 : 365;
|
|
11049
|
+
const percent = dataDateOfYear / totalDaysInYear;
|
|
11050
|
+
return 1 + percent * 0.5;
|
|
11051
|
+
}
|
|
11052
|
+
default:
|
|
11053
|
+
return 1;
|
|
11025
11054
|
}
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
const tickX = dataIndex * columnWidth * extraMultiplier();
|
|
11031
|
-
const x = rtl ? tickX + columnWidth : tickX;
|
|
11032
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11055
|
+
};
|
|
11056
|
+
x = additionalLeftSpace + dataDateIndex * columnWidth * extraMultiplier();
|
|
11057
|
+
}
|
|
11058
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "data-date-line", children: [
|
|
11033
11059
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11034
|
-
"
|
|
11060
|
+
"line",
|
|
11035
11061
|
{
|
|
11036
|
-
|
|
11037
|
-
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11062
|
+
x1: x,
|
|
11063
|
+
y1: 0,
|
|
11064
|
+
x2: x,
|
|
11065
|
+
y2: ganttFullHeight,
|
|
11066
|
+
className: styles$c.dataDateLine,
|
|
11067
|
+
stroke: dataDateColor || void 0
|
|
11042
11068
|
}
|
|
11043
11069
|
),
|
|
11044
11070
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11045
|
-
"
|
|
11071
|
+
"polygon",
|
|
11046
11072
|
{
|
|
11047
|
-
className: styles$c.
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
r: 6,
|
|
11051
|
-
fill: "var(--gantt-calendar-today-color)"
|
|
11073
|
+
className: styles$c.dataDateTriangle,
|
|
11074
|
+
fill: dataDateColor || void 0,
|
|
11075
|
+
points: `${x},0 ${x - 5},8 ${x + 5},8`
|
|
11052
11076
|
}
|
|
11053
11077
|
),
|
|
11054
11078
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11055
11079
|
"text",
|
|
11056
11080
|
{
|
|
11057
|
-
x
|
|
11058
|
-
y:
|
|
11059
|
-
|
|
11060
|
-
fill:
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
children: "Data Date"
|
|
11081
|
+
x,
|
|
11082
|
+
y: 30,
|
|
11083
|
+
className: styles$c.dataDateLabel,
|
|
11084
|
+
fill: dataDateColor || void 0,
|
|
11085
|
+
textAnchor: "middle",
|
|
11086
|
+
children: dataDateLabel
|
|
11064
11087
|
}
|
|
11065
11088
|
)
|
|
11066
|
-
] });
|
|
11089
|
+
] }, "data-date-line");
|
|
11067
11090
|
}, [
|
|
11091
|
+
isUnknownDates,
|
|
11092
|
+
showDataDateLine,
|
|
11093
|
+
dataDate,
|
|
11094
|
+
dataDateX,
|
|
11095
|
+
startDate,
|
|
11096
|
+
viewMode,
|
|
11068
11097
|
additionalLeftSpace,
|
|
11069
11098
|
columnWidth,
|
|
11070
11099
|
ganttFullHeight,
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
viewMode,
|
|
11074
|
-
showDataDateLine,
|
|
11075
|
-
dataDate
|
|
11100
|
+
dataDateColor,
|
|
11101
|
+
dataDateLabel
|
|
11076
11102
|
]);
|
|
11077
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11078
|
-
|
|
11079
|
-
|
|
11103
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11104
|
+
todayElement,
|
|
11105
|
+
dataDateElement
|
|
11080
11106
|
] });
|
|
11081
11107
|
};
|
|
11082
11108
|
const GanttToday = React.memo(GanttTodayInner);
|
|
@@ -11990,7 +12016,11 @@
|
|
|
11990
12016
|
width,
|
|
11991
12017
|
x,
|
|
11992
12018
|
y,
|
|
11993
|
-
customStyle
|
|
12019
|
+
customStyle,
|
|
12020
|
+
dataDateX,
|
|
12021
|
+
splitbarColors,
|
|
12022
|
+
showProgressBar = true,
|
|
12023
|
+
progressBarColor
|
|
11994
12024
|
}) => {
|
|
11995
12025
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11996
12026
|
"g",
|
|
@@ -12009,7 +12039,40 @@
|
|
|
12009
12039
|
}
|
|
12010
12040
|
},
|
|
12011
12041
|
children: [
|
|
12012
|
-
|
|
12042
|
+
typeof dataDateX === "number" ? (() => {
|
|
12043
|
+
var _a, _b;
|
|
12044
|
+
const localSplit = Math.max(0, Math.min(width, dataDateX - x));
|
|
12045
|
+
const leftFill = ((_a = splitbarColors == null ? void 0 : splitbarColors.task) == null ? void 0 : _a.onTime) || "var(--gantt-bar-background-color)";
|
|
12046
|
+
const rightFill = ((_b = splitbarColors == null ? void 0 : splitbarColors.task) == null ? void 0 : _b.delayed) || "var(--gantt-bar-background-color)";
|
|
12047
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12048
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12049
|
+
"rect",
|
|
12050
|
+
{
|
|
12051
|
+
x,
|
|
12052
|
+
width: localSplit,
|
|
12053
|
+
y,
|
|
12054
|
+
height,
|
|
12055
|
+
ry: barCornerRadius,
|
|
12056
|
+
rx: barCornerRadius,
|
|
12057
|
+
fill: leftFill,
|
|
12058
|
+
className: styles$8.barBackground
|
|
12059
|
+
}
|
|
12060
|
+
),
|
|
12061
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12062
|
+
"rect",
|
|
12063
|
+
{
|
|
12064
|
+
x: x + localSplit,
|
|
12065
|
+
width: Math.max(0, width - localSplit),
|
|
12066
|
+
y,
|
|
12067
|
+
height,
|
|
12068
|
+
ry: barCornerRadius,
|
|
12069
|
+
rx: barCornerRadius,
|
|
12070
|
+
fill: rightFill,
|
|
12071
|
+
className: styles$8.barBackground
|
|
12072
|
+
}
|
|
12073
|
+
)
|
|
12074
|
+
] });
|
|
12075
|
+
})() : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12013
12076
|
"rect",
|
|
12014
12077
|
{
|
|
12015
12078
|
x,
|
|
@@ -12022,7 +12085,7 @@
|
|
|
12022
12085
|
className: styles$8.barBackground
|
|
12023
12086
|
}
|
|
12024
12087
|
),
|
|
12025
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12088
|
+
showProgressBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12026
12089
|
"rect",
|
|
12027
12090
|
{
|
|
12028
12091
|
x: progressX,
|
|
@@ -12031,7 +12094,7 @@
|
|
|
12031
12094
|
height,
|
|
12032
12095
|
ry: barCornerRadius,
|
|
12033
12096
|
rx: barCornerRadius,
|
|
12034
|
-
fill: "
|
|
12097
|
+
fill: progressBarColor || "var(--gantt-bar-progress-color)"
|
|
12035
12098
|
}
|
|
12036
12099
|
)
|
|
12037
12100
|
]
|
|
@@ -12095,7 +12158,11 @@
|
|
|
12095
12158
|
x1,
|
|
12096
12159
|
x2,
|
|
12097
12160
|
startMoveFullTask,
|
|
12098
|
-
customStyle
|
|
12161
|
+
customStyle,
|
|
12162
|
+
dataDateX,
|
|
12163
|
+
splitbarColors,
|
|
12164
|
+
showProgressBar = true,
|
|
12165
|
+
progressBarColor
|
|
12099
12166
|
}) => {
|
|
12100
12167
|
const projectLeftTriangle = [
|
|
12101
12168
|
x1,
|
|
@@ -12130,7 +12197,40 @@
|
|
|
12130
12197
|
},
|
|
12131
12198
|
className: styles$7.projectWrapper,
|
|
12132
12199
|
children: [
|
|
12133
|
-
|
|
12200
|
+
typeof dataDateX === "number" ? (() => {
|
|
12201
|
+
var _a, _b;
|
|
12202
|
+
const localSplit = Math.max(0, Math.min(width, dataDateX - x1));
|
|
12203
|
+
const leftFill = ((_a = splitbarColors == null ? void 0 : splitbarColors.project) == null ? void 0 : _a.onTime) || "var(--gantt-project-background-color)";
|
|
12204
|
+
const rightFill = ((_b = splitbarColors == null ? void 0 : splitbarColors.project) == null ? void 0 : _b.delayed) || "var(--gantt-project-background-color)";
|
|
12205
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12206
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12207
|
+
"rect",
|
|
12208
|
+
{
|
|
12209
|
+
x: x1,
|
|
12210
|
+
width: localSplit,
|
|
12211
|
+
y: taskYOffset,
|
|
12212
|
+
height: taskHeight,
|
|
12213
|
+
rx: barCornerRadius,
|
|
12214
|
+
ry: barCornerRadius,
|
|
12215
|
+
className: styles$7.projectBackground,
|
|
12216
|
+
fill: leftFill
|
|
12217
|
+
}
|
|
12218
|
+
),
|
|
12219
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12220
|
+
"rect",
|
|
12221
|
+
{
|
|
12222
|
+
x: x1 + localSplit,
|
|
12223
|
+
width: Math.max(0, width - localSplit),
|
|
12224
|
+
y: taskYOffset,
|
|
12225
|
+
height: taskHeight,
|
|
12226
|
+
rx: barCornerRadius,
|
|
12227
|
+
ry: barCornerRadius,
|
|
12228
|
+
className: styles$7.projectBackground,
|
|
12229
|
+
fill: rightFill
|
|
12230
|
+
}
|
|
12231
|
+
)
|
|
12232
|
+
] });
|
|
12233
|
+
})() : /* @__PURE__ */ jsxRuntime.jsx(
|
|
12134
12234
|
"rect",
|
|
12135
12235
|
{
|
|
12136
12236
|
x: x1,
|
|
@@ -12143,7 +12243,7 @@
|
|
|
12143
12243
|
fill: "unset"
|
|
12144
12244
|
}
|
|
12145
12245
|
),
|
|
12146
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12246
|
+
showProgressBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12147
12247
|
"rect",
|
|
12148
12248
|
{
|
|
12149
12249
|
x: progressX,
|
|
@@ -12152,7 +12252,7 @@
|
|
|
12152
12252
|
height: taskHeight,
|
|
12153
12253
|
ry: barCornerRadius,
|
|
12154
12254
|
rx: barCornerRadius,
|
|
12155
|
-
fill: "
|
|
12255
|
+
fill: progressBarColor || "var(--gantt-bar-progress-color)"
|
|
12156
12256
|
}
|
|
12157
12257
|
),
|
|
12158
12258
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12251,7 +12351,11 @@
|
|
|
12251
12351
|
x1,
|
|
12252
12352
|
x2,
|
|
12253
12353
|
movingAction,
|
|
12254
|
-
ganttRelationEvent
|
|
12354
|
+
ganttRelationEvent,
|
|
12355
|
+
dataDateX,
|
|
12356
|
+
splitbarColors,
|
|
12357
|
+
showProgressBar,
|
|
12358
|
+
progressBarColor
|
|
12255
12359
|
} = props;
|
|
12256
12360
|
React.useMemo(() => width < 30, [width]);
|
|
12257
12361
|
const handleHeight = React.useMemo(() => taskHeight - 2, [taskHeight]);
|
|
@@ -12312,7 +12416,11 @@
|
|
|
12312
12416
|
isSelected,
|
|
12313
12417
|
isCritical,
|
|
12314
12418
|
hasChildren,
|
|
12315
|
-
startMoveFullTask
|
|
12419
|
+
startMoveFullTask,
|
|
12420
|
+
dataDateX,
|
|
12421
|
+
splitbarColors,
|
|
12422
|
+
showProgressBar,
|
|
12423
|
+
progressBarColor
|
|
12316
12424
|
}
|
|
12317
12425
|
);
|
|
12318
12426
|
} else {
|
|
@@ -12331,7 +12439,11 @@
|
|
|
12331
12439
|
isSelected,
|
|
12332
12440
|
isCritical,
|
|
12333
12441
|
hasChildren,
|
|
12334
|
-
startMoveFullTask
|
|
12442
|
+
startMoveFullTask,
|
|
12443
|
+
dataDateX,
|
|
12444
|
+
splitbarColors,
|
|
12445
|
+
showProgressBar,
|
|
12446
|
+
progressBarColor
|
|
12335
12447
|
}
|
|
12336
12448
|
);
|
|
12337
12449
|
}
|
|
@@ -12704,10 +12816,13 @@
|
|
|
12704
12816
|
},
|
|
12705
12817
|
[onTooltipTask, task]
|
|
12706
12818
|
);
|
|
12707
|
-
const onMouseLeave = React.useCallback(
|
|
12708
|
-
event
|
|
12709
|
-
|
|
12710
|
-
|
|
12819
|
+
const onMouseLeave = React.useCallback(
|
|
12820
|
+
(event) => {
|
|
12821
|
+
event.stopPropagation();
|
|
12822
|
+
onTooltipTask(null, null);
|
|
12823
|
+
},
|
|
12824
|
+
[onTooltipTask]
|
|
12825
|
+
);
|
|
12711
12826
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12712
12827
|
"g",
|
|
12713
12828
|
{
|
|
@@ -12886,7 +13001,11 @@
|
|
|
12886
13001
|
renderCustomLabel,
|
|
12887
13002
|
taskBarMovingAction,
|
|
12888
13003
|
waitCommitTasks,
|
|
12889
|
-
viewMode
|
|
13004
|
+
viewMode,
|
|
13005
|
+
dataDateX,
|
|
13006
|
+
splitbarColors,
|
|
13007
|
+
showProgressBar,
|
|
13008
|
+
progressBarColor
|
|
12890
13009
|
} = props;
|
|
12891
13010
|
const renderedHolidays = React.useMemo(() => {
|
|
12892
13011
|
const { columnWidth } = distances;
|
|
@@ -12973,6 +13092,11 @@
|
|
|
12973
13092
|
x2: taskX2,
|
|
12974
13093
|
comparisonDates
|
|
12975
13094
|
} = getTaskCoordinates2(task);
|
|
13095
|
+
const containerXAbs = Math.max(
|
|
13096
|
+
containerX + (additionalLeftSpace || 0),
|
|
13097
|
+
0
|
|
13098
|
+
);
|
|
13099
|
+
const dataDateXLocal = typeof dataDateX === "number" ? dataDateX - containerXAbs : void 0;
|
|
12976
13100
|
tasksRes.push(
|
|
12977
13101
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12978
13102
|
"svg",
|
|
@@ -13016,7 +13140,11 @@
|
|
|
13016
13140
|
rtl,
|
|
13017
13141
|
onDeleteTask,
|
|
13018
13142
|
renderCustomLabel,
|
|
13019
|
-
viewMode
|
|
13143
|
+
viewMode,
|
|
13144
|
+
dataDateX: dataDateXLocal,
|
|
13145
|
+
splitbarColors,
|
|
13146
|
+
showProgressBar,
|
|
13147
|
+
progressBarColor
|
|
13020
13148
|
}
|
|
13021
13149
|
)
|
|
13022
13150
|
},
|
|
@@ -13226,6 +13354,10 @@
|
|
|
13226
13354
|
isDateChangeable,
|
|
13227
13355
|
isRelationChangeable,
|
|
13228
13356
|
visibleTasksMirror,
|
|
13357
|
+
dataDateX,
|
|
13358
|
+
splitbarColors,
|
|
13359
|
+
showProgressBar,
|
|
13360
|
+
progressBarColor,
|
|
13229
13361
|
onArrowDoubleClick
|
|
13230
13362
|
]);
|
|
13231
13363
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { className: "content", children: [
|
|
@@ -18666,7 +18798,14 @@
|
|
|
18666
18798
|
rowHeight,
|
|
18667
18799
|
showTodayLine = true,
|
|
18668
18800
|
showDataDateLine = false,
|
|
18669
|
-
dataDate = null
|
|
18801
|
+
dataDate = null,
|
|
18802
|
+
todayColor,
|
|
18803
|
+
dataDateColor,
|
|
18804
|
+
todayLabel = "Today",
|
|
18805
|
+
dataDateLabel = "Data Date",
|
|
18806
|
+
splitbarColors,
|
|
18807
|
+
showProgressBar = true,
|
|
18808
|
+
progressBarColor
|
|
18670
18809
|
} = props;
|
|
18671
18810
|
const ganttSVGRef = React.useRef(null);
|
|
18672
18811
|
const wrapperRef = React.useRef(null);
|
|
@@ -19795,6 +19934,29 @@
|
|
|
19795
19934
|
() => svgWidth + additionalLeftSpace + additionalRightSpace,
|
|
19796
19935
|
[additionalLeftSpace, additionalRightSpace, svgWidth]
|
|
19797
19936
|
);
|
|
19937
|
+
const dataDateX = React.useMemo(() => {
|
|
19938
|
+
if (!dataDate)
|
|
19939
|
+
return void 0;
|
|
19940
|
+
try {
|
|
19941
|
+
const roundedDataDate = roundStartDate(dataDate);
|
|
19942
|
+
const x = taskXCoordinate(
|
|
19943
|
+
roundedDataDate,
|
|
19944
|
+
startDate,
|
|
19945
|
+
viewMode,
|
|
19946
|
+
distances.columnWidth
|
|
19947
|
+
);
|
|
19948
|
+
return additionalLeftSpace + x;
|
|
19949
|
+
} catch {
|
|
19950
|
+
return void 0;
|
|
19951
|
+
}
|
|
19952
|
+
}, [
|
|
19953
|
+
dataDate,
|
|
19954
|
+
startDate,
|
|
19955
|
+
viewMode,
|
|
19956
|
+
distances,
|
|
19957
|
+
additionalLeftSpace,
|
|
19958
|
+
roundStartDate
|
|
19959
|
+
]);
|
|
19798
19960
|
const gridProps = React.useMemo(
|
|
19799
19961
|
() => ({
|
|
19800
19962
|
additionalLeftSpace,
|
|
@@ -19806,7 +19968,12 @@
|
|
|
19806
19968
|
viewMode,
|
|
19807
19969
|
showTodayLine,
|
|
19808
19970
|
showDataDateLine,
|
|
19809
|
-
dataDate
|
|
19971
|
+
dataDate,
|
|
19972
|
+
dataDateX,
|
|
19973
|
+
todayColor,
|
|
19974
|
+
dataDateColor,
|
|
19975
|
+
todayLabel,
|
|
19976
|
+
dataDateLabel
|
|
19810
19977
|
}),
|
|
19811
19978
|
[
|
|
19812
19979
|
additionalLeftSpace,
|
|
@@ -19818,7 +19985,12 @@
|
|
|
19818
19985
|
viewMode,
|
|
19819
19986
|
showTodayLine,
|
|
19820
19987
|
showDataDateLine,
|
|
19821
|
-
dataDate
|
|
19988
|
+
dataDate,
|
|
19989
|
+
dataDateX,
|
|
19990
|
+
todayColor,
|
|
19991
|
+
dataDateColor,
|
|
19992
|
+
todayLabel,
|
|
19993
|
+
dataDateLabel
|
|
19822
19994
|
]
|
|
19823
19995
|
);
|
|
19824
19996
|
const calendarProps = React.useMemo(
|
|
@@ -19854,6 +20026,11 @@
|
|
|
19854
20026
|
const renderTaskBarProps = React.useMemo(
|
|
19855
20027
|
() => ({
|
|
19856
20028
|
...taskBar,
|
|
20029
|
+
splitbarColors,
|
|
20030
|
+
dataDate,
|
|
20031
|
+
dataDateX,
|
|
20032
|
+
showProgressBar,
|
|
20033
|
+
progressBarColor,
|
|
19857
20034
|
taskBarMovingAction: (task) => {
|
|
19858
20035
|
var _a2;
|
|
19859
20036
|
return task.id === ((_a2 = changeInProgress == null ? void 0 : changeInProgress.changedTask) == null ? void 0 : _a2.id) ? changeInProgress.action : null;
|
|
@@ -19894,6 +20071,11 @@
|
|
|
19894
20071
|
[
|
|
19895
20072
|
viewMode,
|
|
19896
20073
|
taskBar,
|
|
20074
|
+
splitbarColors,
|
|
20075
|
+
dataDate,
|
|
20076
|
+
dataDateX,
|
|
20077
|
+
showProgressBar,
|
|
20078
|
+
progressBarColor,
|
|
19897
20079
|
authorizedRelations,
|
|
19898
20080
|
additionalLeftSpace,
|
|
19899
20081
|
additionalRightSpace,
|
|
@@ -336,6 +336,48 @@ export interface GanttProps {
|
|
|
336
336
|
* Custom date to render as data date line when `showDataDateLine` is true
|
|
337
337
|
*/
|
|
338
338
|
dataDate?: Date | null;
|
|
339
|
+
/**
|
|
340
|
+
* Color used for the today line, pin and label. If not provided, theme calendarTodayColor is used.
|
|
341
|
+
*/
|
|
342
|
+
todayColor?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Color used for the data date line, pin and label. If not provided, theme calendarTodayColor is used.
|
|
345
|
+
*/
|
|
346
|
+
dataDateColor?: string;
|
|
347
|
+
/**
|
|
348
|
+
* Label text for the today marker. Defaults to "Today".
|
|
349
|
+
*/
|
|
350
|
+
todayLabel?: string;
|
|
351
|
+
/**
|
|
352
|
+
* Label text for the data date marker. Defaults to "Data Date".
|
|
353
|
+
*/
|
|
354
|
+
dataDateLabel?: string;
|
|
355
|
+
/**
|
|
356
|
+
* Colors to use when splitting bars at the data date line.
|
|
357
|
+
* Structure: { task?: { onTime?: string; delayed?: string }, project?: { onTime?: string; delayed?: string }, comparison?: { onTime?: string; delayed?: string } }
|
|
358
|
+
*/
|
|
359
|
+
splitbarColors?: {
|
|
360
|
+
task?: {
|
|
361
|
+
onTime?: string;
|
|
362
|
+
delayed?: string;
|
|
363
|
+
};
|
|
364
|
+
project?: {
|
|
365
|
+
onTime?: string;
|
|
366
|
+
delayed?: string;
|
|
367
|
+
};
|
|
368
|
+
comparison?: {
|
|
369
|
+
onTime?: string;
|
|
370
|
+
delayed?: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Show or hide the progress bar overlay on tasks. Defaults to true.
|
|
375
|
+
*/
|
|
376
|
+
showProgressBar?: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Color for the progress bar overlay. If not provided, theme progress color is used.
|
|
379
|
+
*/
|
|
380
|
+
progressBarColor?: string;
|
|
339
381
|
}
|
|
340
382
|
export interface GanttTaskBarActions {
|
|
341
383
|
allowMoveTaskBar?: (action: TaskBarMoveAction, task: RenderTask) => boolean;
|
package/package.json
CHANGED