ngx-core-components 0.1.4 → 0.1.6
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/charts/gantt-chart/gantt-chart.component.d.ts +70 -11
- package/charts/gantt-chart/models/gantt-baseline.model.d.ts +5 -0
- package/charts/gantt-chart/models/gantt-config.model.d.ts +74 -1
- package/charts/gantt-chart/models/gantt-dependency.model.d.ts +4 -1
- package/charts/gantt-chart/models/gantt-event.model.d.ts +71 -1
- package/charts/gantt-chart/models/gantt-group.model.d.ts +7 -0
- package/charts/gantt-chart/models/gantt-task.model.d.ts +28 -0
- package/charts/gantt-chart/models/index.d.ts +2 -0
- package/charts/gantt-chart/services/gantt-layout.service.d.ts +9 -2
- package/charts/gantt-chart/services/gantt-print.service.d.ts +24 -0
- package/charts/gantt-chart/utils/date-utils.d.ts +8 -0
- package/charts/gantt-chart/utils/svg-utils.d.ts +2 -2
- package/charts/public-api.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +1218 -1105
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, computed, viewChild, ChangeDetectionStrategy, Component, Injectable, output, inject, effect } from '@angular/core';
|
|
2
|
+
import { input, signal, computed, viewChild, ChangeDetectionStrategy, Component, Injectable, output, inject, ElementRef, effect } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
// Shared chart utilities and constants
|
|
5
5
|
const CHART_COLORS = [
|
|
@@ -853,6 +853,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
853
853
|
`, styles: [":host{display:inline-block}.ngx-sparkline{display:block}\n"] }]
|
|
854
854
|
}] });
|
|
855
855
|
|
|
856
|
+
var GanttItemType;
|
|
857
|
+
(function (GanttItemType) {
|
|
858
|
+
GanttItemType["Bar"] = "bar";
|
|
859
|
+
GanttItemType["Range"] = "range";
|
|
860
|
+
GanttItemType["Custom"] = "custom";
|
|
861
|
+
})(GanttItemType || (GanttItemType = {}));
|
|
862
|
+
|
|
856
863
|
var DependencyType;
|
|
857
864
|
(function (DependencyType) {
|
|
858
865
|
DependencyType["FinishToStart"] = "FS";
|
|
@@ -863,10 +870,18 @@ var DependencyType;
|
|
|
863
870
|
|
|
864
871
|
var ZoomLevel;
|
|
865
872
|
(function (ZoomLevel) {
|
|
873
|
+
ZoomLevel["Hour"] = "hour";
|
|
866
874
|
ZoomLevel["Day"] = "day";
|
|
867
875
|
ZoomLevel["Week"] = "week";
|
|
868
876
|
ZoomLevel["Month"] = "month";
|
|
877
|
+
ZoomLevel["Quarter"] = "quarter";
|
|
878
|
+
ZoomLevel["Year"] = "year";
|
|
869
879
|
})(ZoomLevel || (ZoomLevel = {}));
|
|
880
|
+
var GanttLinkLineType;
|
|
881
|
+
(function (GanttLinkLineType) {
|
|
882
|
+
GanttLinkLineType["Curve"] = "curve";
|
|
883
|
+
GanttLinkLineType["Straight"] = "straight";
|
|
884
|
+
})(GanttLinkLineType || (GanttLinkLineType = {}));
|
|
870
885
|
const DEFAULT_GANTT_CONFIG = {
|
|
871
886
|
zoomLevel: ZoomLevel.Day,
|
|
872
887
|
rowHeight: 40,
|
|
@@ -879,6 +894,43 @@ const DEFAULT_GANTT_CONFIG = {
|
|
|
879
894
|
headerHeight: 60,
|
|
880
895
|
snapTo: 'day',
|
|
881
896
|
locale: 'en-US',
|
|
897
|
+
linkable: false,
|
|
898
|
+
linkOptions: {
|
|
899
|
+
dependencyTypes: ['FS'],
|
|
900
|
+
showArrow: true,
|
|
901
|
+
lineType: GanttLinkLineType.Curve,
|
|
902
|
+
},
|
|
903
|
+
selectable: false,
|
|
904
|
+
multiple: false,
|
|
905
|
+
showToolbar: false,
|
|
906
|
+
toolbarOptions: {
|
|
907
|
+
viewTypes: [ZoomLevel.Day, ZoomLevel.Month, ZoomLevel.Year],
|
|
908
|
+
},
|
|
909
|
+
styleOptions: {
|
|
910
|
+
primaryColor: '#4a90d9',
|
|
911
|
+
headerHeight: 60,
|
|
912
|
+
rowHeight: 40,
|
|
913
|
+
barHeight: 24,
|
|
914
|
+
defaultTheme: 'default',
|
|
915
|
+
themes: {
|
|
916
|
+
default: {
|
|
917
|
+
primary: '#4a90d9',
|
|
918
|
+
danger: '#ff6358',
|
|
919
|
+
highlight: '#ff9f73',
|
|
920
|
+
background: '#ffffff',
|
|
921
|
+
text: { main: '#212529', muted: '#6c757d', light: '#adb5bd', inverse: '#ffffff' },
|
|
922
|
+
gray: { 100: '#f8f9fa', 200: '#f1f3f5', 300: '#e9ecef', 400: '#dee2e6', 500: '#adb5bd', 600: '#6c757d' },
|
|
923
|
+
},
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
virtualScrollEnabled: false,
|
|
927
|
+
loading: false,
|
|
928
|
+
loadingDelay: 0,
|
|
929
|
+
showBaseline: false,
|
|
930
|
+
tableDraggable: false,
|
|
931
|
+
loadOnScroll: false,
|
|
932
|
+
maxLevel: 10,
|
|
933
|
+
barHeight: 24,
|
|
882
934
|
};
|
|
883
935
|
|
|
884
936
|
function addDays(date, days) {
|
|
@@ -886,10 +938,23 @@ function addDays(date, days) {
|
|
|
886
938
|
result.setDate(result.getDate() + days);
|
|
887
939
|
return result;
|
|
888
940
|
}
|
|
941
|
+
function addHours(date, hours) {
|
|
942
|
+
const result = new Date(date);
|
|
943
|
+
result.setTime(result.getTime() + hours * 3600000);
|
|
944
|
+
return result;
|
|
945
|
+
}
|
|
889
946
|
function diffDays(a, b) {
|
|
890
947
|
const msPerDay = 86400000;
|
|
891
948
|
return Math.round((a.getTime() - b.getTime()) / msPerDay);
|
|
892
949
|
}
|
|
950
|
+
function diffHours(a, b) {
|
|
951
|
+
return (a.getTime() - b.getTime()) / 3600000;
|
|
952
|
+
}
|
|
953
|
+
function startOfHour(date) {
|
|
954
|
+
const result = new Date(date);
|
|
955
|
+
result.setMinutes(0, 0, 0);
|
|
956
|
+
return result;
|
|
957
|
+
}
|
|
893
958
|
function startOfDay(date) {
|
|
894
959
|
const result = new Date(date);
|
|
895
960
|
result.setHours(0, 0, 0, 0);
|
|
@@ -908,11 +973,32 @@ function startOfMonth(date) {
|
|
|
908
973
|
result.setHours(0, 0, 0, 0);
|
|
909
974
|
return result;
|
|
910
975
|
}
|
|
976
|
+
function startOfQuarter(date) {
|
|
977
|
+
const result = new Date(date);
|
|
978
|
+
const quarter = Math.floor(result.getMonth() / 3);
|
|
979
|
+
result.setMonth(quarter * 3, 1);
|
|
980
|
+
result.setHours(0, 0, 0, 0);
|
|
981
|
+
return result;
|
|
982
|
+
}
|
|
983
|
+
function startOfYear(date) {
|
|
984
|
+
const result = new Date(date);
|
|
985
|
+
result.setMonth(0, 1);
|
|
986
|
+
result.setHours(0, 0, 0, 0);
|
|
987
|
+
return result;
|
|
988
|
+
}
|
|
911
989
|
function addMonths(date, months) {
|
|
912
990
|
const result = new Date(date);
|
|
913
991
|
result.setMonth(result.getMonth() + months);
|
|
914
992
|
return result;
|
|
915
993
|
}
|
|
994
|
+
function addQuarters(date, quarters) {
|
|
995
|
+
return addMonths(date, quarters * 3);
|
|
996
|
+
}
|
|
997
|
+
function addYears(date, years) {
|
|
998
|
+
const result = new Date(date);
|
|
999
|
+
result.setFullYear(result.getFullYear() + years);
|
|
1000
|
+
return result;
|
|
1001
|
+
}
|
|
916
1002
|
function addWeeks(date, weeks) {
|
|
917
1003
|
return addDays(date, weeks * 7);
|
|
918
1004
|
}
|
|
@@ -920,6 +1006,9 @@ function isWeekend(date) {
|
|
|
920
1006
|
const day = date.getDay();
|
|
921
1007
|
return day === 0 || day === 6;
|
|
922
1008
|
}
|
|
1009
|
+
function daysInMonth(date) {
|
|
1010
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
1011
|
+
}
|
|
923
1012
|
function getDateRange(tasks) {
|
|
924
1013
|
if (tasks.length === 0) {
|
|
925
1014
|
const today = startOfDay(new Date());
|
|
@@ -939,6 +1028,13 @@ function getColumnDates(start, end, zoom) {
|
|
|
939
1028
|
const dates = [];
|
|
940
1029
|
let current;
|
|
941
1030
|
switch (zoom) {
|
|
1031
|
+
case ZoomLevel.Hour:
|
|
1032
|
+
current = startOfHour(start);
|
|
1033
|
+
while (current <= end) {
|
|
1034
|
+
dates.push(new Date(current));
|
|
1035
|
+
current = addHours(current, 1);
|
|
1036
|
+
}
|
|
1037
|
+
break;
|
|
942
1038
|
case ZoomLevel.Day:
|
|
943
1039
|
current = startOfDay(start);
|
|
944
1040
|
while (current <= end) {
|
|
@@ -960,6 +1056,20 @@ function getColumnDates(start, end, zoom) {
|
|
|
960
1056
|
current = addMonths(current, 1);
|
|
961
1057
|
}
|
|
962
1058
|
break;
|
|
1059
|
+
case ZoomLevel.Quarter:
|
|
1060
|
+
current = startOfQuarter(start);
|
|
1061
|
+
while (current <= end) {
|
|
1062
|
+
dates.push(new Date(current));
|
|
1063
|
+
current = addQuarters(current, 1);
|
|
1064
|
+
}
|
|
1065
|
+
break;
|
|
1066
|
+
case ZoomLevel.Year:
|
|
1067
|
+
current = startOfYear(start);
|
|
1068
|
+
while (current <= end) {
|
|
1069
|
+
dates.push(new Date(current));
|
|
1070
|
+
current = addYears(current, 1);
|
|
1071
|
+
}
|
|
1072
|
+
break;
|
|
963
1073
|
}
|
|
964
1074
|
return dates;
|
|
965
1075
|
}
|
|
@@ -974,6 +1084,10 @@ function snapToDay(date) {
|
|
|
974
1084
|
class GanttScaleService {
|
|
975
1085
|
dateToX(date, startDate, columnWidth, zoomLevel) {
|
|
976
1086
|
switch (zoomLevel) {
|
|
1087
|
+
case ZoomLevel.Hour: {
|
|
1088
|
+
const hours = diffHours(date, startOfHour(startDate));
|
|
1089
|
+
return hours * columnWidth;
|
|
1090
|
+
}
|
|
977
1091
|
case ZoomLevel.Day:
|
|
978
1092
|
return diffDays(startOfDay(date), startOfDay(startDate)) * columnWidth;
|
|
979
1093
|
case ZoomLevel.Week: {
|
|
@@ -985,13 +1099,38 @@ class GanttScaleService {
|
|
|
985
1099
|
const months = (date.getFullYear() - start.getFullYear()) * 12 +
|
|
986
1100
|
(date.getMonth() - start.getMonth());
|
|
987
1101
|
const dayInMonth = date.getDate() - 1;
|
|
988
|
-
const
|
|
989
|
-
return (months + dayInMonth /
|
|
1102
|
+
const dim = daysInMonth(date);
|
|
1103
|
+
return (months + dayInMonth / dim) * columnWidth;
|
|
1104
|
+
}
|
|
1105
|
+
case ZoomLevel.Quarter: {
|
|
1106
|
+
const start = startOfQuarter(startDate);
|
|
1107
|
+
const startQ = start.getFullYear() * 4 + Math.floor(start.getMonth() / 3);
|
|
1108
|
+
const dateQ = date.getFullYear() * 4 + Math.floor(date.getMonth() / 3);
|
|
1109
|
+
const qDiff = dateQ - startQ;
|
|
1110
|
+
// Fraction within the quarter
|
|
1111
|
+
const qStart = new Date(date.getFullYear(), Math.floor(date.getMonth() / 3) * 3, 1);
|
|
1112
|
+
const qEnd = new Date(date.getFullYear(), Math.floor(date.getMonth() / 3) * 3 + 3, 1);
|
|
1113
|
+
const qDays = (qEnd.getTime() - qStart.getTime()) / 86400000;
|
|
1114
|
+
const dayInQ = (date.getTime() - qStart.getTime()) / 86400000;
|
|
1115
|
+
return (qDiff + dayInQ / qDays) * columnWidth;
|
|
1116
|
+
}
|
|
1117
|
+
case ZoomLevel.Year: {
|
|
1118
|
+
const start = startOfYear(startDate);
|
|
1119
|
+
const yearDiff = date.getFullYear() - start.getFullYear();
|
|
1120
|
+
const yearStart = new Date(date.getFullYear(), 0, 1);
|
|
1121
|
+
const yearEnd = new Date(date.getFullYear() + 1, 0, 1);
|
|
1122
|
+
const yDays = (yearEnd.getTime() - yearStart.getTime()) / 86400000;
|
|
1123
|
+
const dayInY = (date.getTime() - yearStart.getTime()) / 86400000;
|
|
1124
|
+
return (yearDiff + dayInY / yDays) * columnWidth;
|
|
990
1125
|
}
|
|
991
1126
|
}
|
|
992
1127
|
}
|
|
993
1128
|
xToDate(x, startDate, columnWidth, zoomLevel) {
|
|
994
1129
|
switch (zoomLevel) {
|
|
1130
|
+
case ZoomLevel.Hour: {
|
|
1131
|
+
const hours = x / columnWidth;
|
|
1132
|
+
return addHours(startOfHour(startDate), Math.round(hours));
|
|
1133
|
+
}
|
|
995
1134
|
case ZoomLevel.Day: {
|
|
996
1135
|
const days = x / columnWidth;
|
|
997
1136
|
return addDays(startOfDay(startDate), Math.round(days));
|
|
@@ -1006,10 +1145,32 @@ class GanttScaleService {
|
|
|
1006
1145
|
const result = new Date(start);
|
|
1007
1146
|
result.setMonth(result.getMonth() + Math.floor(months));
|
|
1008
1147
|
const fraction = months - Math.floor(months);
|
|
1009
|
-
const
|
|
1010
|
-
result.setDate(1 + Math.round(fraction *
|
|
1148
|
+
const dim = daysInMonth(result);
|
|
1149
|
+
result.setDate(1 + Math.round(fraction * dim));
|
|
1011
1150
|
return result;
|
|
1012
1151
|
}
|
|
1152
|
+
case ZoomLevel.Quarter: {
|
|
1153
|
+
const quarters = x / columnWidth;
|
|
1154
|
+
const start = startOfQuarter(startDate);
|
|
1155
|
+
const result = new Date(start);
|
|
1156
|
+
result.setMonth(result.getMonth() + Math.floor(quarters) * 3);
|
|
1157
|
+
const fraction = quarters - Math.floor(quarters);
|
|
1158
|
+
const qStart = new Date(result.getFullYear(), Math.floor(result.getMonth() / 3) * 3, 1);
|
|
1159
|
+
const qEnd = new Date(result.getFullYear(), Math.floor(result.getMonth() / 3) * 3 + 3, 1);
|
|
1160
|
+
const qDays = (qEnd.getTime() - qStart.getTime()) / 86400000;
|
|
1161
|
+
return new Date(qStart.getTime() + Math.round(fraction * qDays) * 86400000);
|
|
1162
|
+
}
|
|
1163
|
+
case ZoomLevel.Year: {
|
|
1164
|
+
const years = x / columnWidth;
|
|
1165
|
+
const start = startOfYear(startDate);
|
|
1166
|
+
const result = new Date(start);
|
|
1167
|
+
result.setFullYear(result.getFullYear() + Math.floor(years));
|
|
1168
|
+
const fraction = years - Math.floor(years);
|
|
1169
|
+
const yearStart = new Date(result.getFullYear(), 0, 1);
|
|
1170
|
+
const yearEnd = new Date(result.getFullYear() + 1, 0, 1);
|
|
1171
|
+
const yDays = (yearEnd.getTime() - yearStart.getTime()) / 86400000;
|
|
1172
|
+
return new Date(yearStart.getTime() + Math.round(fraction * yDays) * 86400000);
|
|
1173
|
+
}
|
|
1013
1174
|
}
|
|
1014
1175
|
}
|
|
1015
1176
|
snapDate(date, snapTo) {
|
|
@@ -1038,7 +1199,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1038
1199
|
}] });
|
|
1039
1200
|
|
|
1040
1201
|
class GanttLayoutService {
|
|
1041
|
-
flattenTasks(tasks) {
|
|
1202
|
+
flattenTasks(tasks, groups) {
|
|
1203
|
+
if (groups && groups.length > 0) {
|
|
1204
|
+
return this.flattenWithGroups(tasks, groups);
|
|
1205
|
+
}
|
|
1206
|
+
return this.flattenTree(tasks);
|
|
1207
|
+
}
|
|
1208
|
+
flattenTree(tasks) {
|
|
1042
1209
|
const childrenMap = new Map();
|
|
1043
1210
|
for (const task of tasks) {
|
|
1044
1211
|
const parentId = task.parentId;
|
|
@@ -1073,7 +1240,7 @@ class GanttLayoutService {
|
|
|
1073
1240
|
for (const { primary: task, extra: extraTasks } of rowGroups) {
|
|
1074
1241
|
const hasChildren = childrenMap.has(task.id) && childrenMap.get(task.id).length > 0;
|
|
1075
1242
|
const isVisible = parentVisible;
|
|
1076
|
-
rows.push({ task, extraTasks, depth, rowIndex: isVisible ? rowIndex : -1, hasChildren, isVisible });
|
|
1243
|
+
rows.push({ task, extraTasks, depth, rowIndex: isVisible ? rowIndex : -1, hasChildren, isVisible, isGroupHeader: false });
|
|
1077
1244
|
if (isVisible)
|
|
1078
1245
|
rowIndex++;
|
|
1079
1246
|
const childVisible = isVisible && !task.collapsed;
|
|
@@ -1083,6 +1250,88 @@ class GanttLayoutService {
|
|
|
1083
1250
|
traverse(null, 0, true);
|
|
1084
1251
|
return rows;
|
|
1085
1252
|
}
|
|
1253
|
+
flattenWithGroups(tasks, groups) {
|
|
1254
|
+
const rows = [];
|
|
1255
|
+
let rowIndex = 0;
|
|
1256
|
+
// Build a map of tasks by group_id
|
|
1257
|
+
const tasksByGroup = new Map();
|
|
1258
|
+
const ungroupedTasks = [];
|
|
1259
|
+
for (const task of tasks) {
|
|
1260
|
+
if (task.group_id) {
|
|
1261
|
+
if (!tasksByGroup.has(task.group_id)) {
|
|
1262
|
+
tasksByGroup.set(task.group_id, []);
|
|
1263
|
+
}
|
|
1264
|
+
tasksByGroup.get(task.group_id).push(task);
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
ungroupedTasks.push(task);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
for (const group of groups) {
|
|
1271
|
+
// Create a pseudo-task for the group header
|
|
1272
|
+
const groupTask = {
|
|
1273
|
+
id: `__group__${group.id}`,
|
|
1274
|
+
name: group.title,
|
|
1275
|
+
start: new Date(),
|
|
1276
|
+
end: new Date(),
|
|
1277
|
+
progress: 0,
|
|
1278
|
+
parentId: null,
|
|
1279
|
+
collapsed: group.expanded === false,
|
|
1280
|
+
isMilestone: false,
|
|
1281
|
+
cssClass: group.class,
|
|
1282
|
+
};
|
|
1283
|
+
const groupTasks = tasksByGroup.get(group.id) || [];
|
|
1284
|
+
// Calculate group date range
|
|
1285
|
+
if (groupTasks.length > 0) {
|
|
1286
|
+
let minStart = groupTasks[0].start.getTime();
|
|
1287
|
+
let maxEnd = groupTasks[0].end.getTime();
|
|
1288
|
+
let totalProgress = 0;
|
|
1289
|
+
for (const t of groupTasks) {
|
|
1290
|
+
if (t.start.getTime() < minStart)
|
|
1291
|
+
minStart = t.start.getTime();
|
|
1292
|
+
if (t.end.getTime() > maxEnd)
|
|
1293
|
+
maxEnd = t.end.getTime();
|
|
1294
|
+
totalProgress += t.progress;
|
|
1295
|
+
}
|
|
1296
|
+
groupTask.start = new Date(minStart);
|
|
1297
|
+
groupTask.end = new Date(maxEnd);
|
|
1298
|
+
groupTask.progress = Math.round(totalProgress / groupTasks.length);
|
|
1299
|
+
}
|
|
1300
|
+
const hasChildren = groupTasks.length > 0;
|
|
1301
|
+
rows.push({
|
|
1302
|
+
task: groupTask,
|
|
1303
|
+
extraTasks: [],
|
|
1304
|
+
depth: 0,
|
|
1305
|
+
rowIndex: rowIndex++,
|
|
1306
|
+
hasChildren,
|
|
1307
|
+
isVisible: true,
|
|
1308
|
+
group,
|
|
1309
|
+
isGroupHeader: true,
|
|
1310
|
+
});
|
|
1311
|
+
if (group.expanded !== false) {
|
|
1312
|
+
// Flatten group tasks using tree logic
|
|
1313
|
+
const groupRows = this.flattenTree(groupTasks);
|
|
1314
|
+
for (const r of groupRows) {
|
|
1315
|
+
if (r.isVisible) {
|
|
1316
|
+
r.rowIndex = rowIndex++;
|
|
1317
|
+
r.depth += 1; // indent within group
|
|
1318
|
+
}
|
|
1319
|
+
rows.push(r);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
// Also flatten any ungrouped tasks
|
|
1324
|
+
if (ungroupedTasks.length > 0) {
|
|
1325
|
+
const ungroupedRows = this.flattenTree(ungroupedTasks);
|
|
1326
|
+
for (const r of ungroupedRows) {
|
|
1327
|
+
if (r.isVisible) {
|
|
1328
|
+
r.rowIndex = rowIndex++;
|
|
1329
|
+
}
|
|
1330
|
+
rows.push(r);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
return rows;
|
|
1334
|
+
}
|
|
1086
1335
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttLayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1087
1336
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttLayoutService });
|
|
1088
1337
|
}
|
|
@@ -1134,7 +1383,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1134
1383
|
type: Injectable
|
|
1135
1384
|
}] });
|
|
1136
1385
|
|
|
1137
|
-
|
|
1386
|
+
/**
|
|
1387
|
+
* Service for exporting the gantt chart as a PNG image.
|
|
1388
|
+
* Requires html2canvas as an optional peer dependency for full export.
|
|
1389
|
+
* Falls back to SVG serialization if html2canvas is not available.
|
|
1390
|
+
*/
|
|
1391
|
+
class GanttPrintService {
|
|
1392
|
+
root = null;
|
|
1393
|
+
register(rootRef) {
|
|
1394
|
+
this.root = rootRef.nativeElement;
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Export the gantt chart as a PNG data URL.
|
|
1398
|
+
* Uses the Canvas API to capture the rendered content.
|
|
1399
|
+
*/
|
|
1400
|
+
async exportAsImage(ignoreElementClass) {
|
|
1401
|
+
if (!this.root) {
|
|
1402
|
+
console.warn('[GanttPrintService] No root element registered.');
|
|
1403
|
+
return null;
|
|
1404
|
+
}
|
|
1405
|
+
try {
|
|
1406
|
+
// Try to use html2canvas if available
|
|
1407
|
+
const html2canvas = await this.loadHtml2Canvas();
|
|
1408
|
+
if (html2canvas) {
|
|
1409
|
+
const canvas = await html2canvas(this.root, {
|
|
1410
|
+
logging: false,
|
|
1411
|
+
allowTaint: true,
|
|
1412
|
+
useCORS: true,
|
|
1413
|
+
width: this.root.scrollWidth,
|
|
1414
|
+
height: this.root.scrollHeight,
|
|
1415
|
+
ignoreElements: (element) => {
|
|
1416
|
+
if (ignoreElementClass && element.classList.contains(ignoreElementClass)) {
|
|
1417
|
+
return true;
|
|
1418
|
+
}
|
|
1419
|
+
return false;
|
|
1420
|
+
},
|
|
1421
|
+
});
|
|
1422
|
+
return canvas.toDataURL('image/png');
|
|
1423
|
+
}
|
|
1424
|
+
// Fallback: capture via basic canvas rendering
|
|
1425
|
+
return this.fallbackCapture();
|
|
1426
|
+
}
|
|
1427
|
+
catch {
|
|
1428
|
+
console.warn('[GanttPrintService] Export failed.');
|
|
1429
|
+
return null;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Download the gantt chart as a PNG file.
|
|
1434
|
+
*/
|
|
1435
|
+
async print(name = 'gantt-chart', ignoreElementClass) {
|
|
1436
|
+
const dataUrl = await this.exportAsImage(ignoreElementClass);
|
|
1437
|
+
if (dataUrl) {
|
|
1438
|
+
const link = document.createElement('a');
|
|
1439
|
+
link.download = `${name}.png`;
|
|
1440
|
+
link.href = dataUrl;
|
|
1441
|
+
link.click();
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
async loadHtml2Canvas() {
|
|
1445
|
+
try {
|
|
1446
|
+
// html2canvas is an optional peer dependency – if not installed, fallback is used
|
|
1447
|
+
const module = await Function('return import("html2canvas")')();
|
|
1448
|
+
return module.default || null;
|
|
1449
|
+
}
|
|
1450
|
+
catch {
|
|
1451
|
+
return null;
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
fallbackCapture() {
|
|
1455
|
+
if (!this.root)
|
|
1456
|
+
return null;
|
|
1457
|
+
// Basic fallback: render a simple canvas with the gantt dimensions
|
|
1458
|
+
const canvas = document.createElement('canvas');
|
|
1459
|
+
const rect = this.root.getBoundingClientRect();
|
|
1460
|
+
canvas.width = rect.width;
|
|
1461
|
+
canvas.height = rect.height;
|
|
1462
|
+
const ctx = canvas.getContext('2d');
|
|
1463
|
+
if (!ctx)
|
|
1464
|
+
return null;
|
|
1465
|
+
// Fill with background
|
|
1466
|
+
ctx.fillStyle = '#ffffff';
|
|
1467
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
1468
|
+
// Draw a message indicating html2canvas is needed for full export
|
|
1469
|
+
ctx.fillStyle = '#6c757d';
|
|
1470
|
+
ctx.font = '14px sans-serif';
|
|
1471
|
+
ctx.textAlign = 'center';
|
|
1472
|
+
ctx.fillText('Install html2canvas for full chart export (npm install html2canvas)', canvas.width / 2, canvas.height / 2);
|
|
1473
|
+
return canvas.toDataURL('image/png');
|
|
1474
|
+
}
|
|
1475
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttPrintService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1476
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttPrintService });
|
|
1477
|
+
}
|
|
1478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttPrintService, decorators: [{
|
|
1479
|
+
type: Injectable
|
|
1480
|
+
}] });
|
|
1481
|
+
|
|
1482
|
+
function computeDependencyPath(from, to, type, offset = 12, lineType = GanttLinkLineType.Straight) {
|
|
1138
1483
|
let startX;
|
|
1139
1484
|
let startY;
|
|
1140
1485
|
let endX;
|
|
@@ -1165,6 +1510,12 @@ function computeDependencyPath(from, to, type, offset = 12) {
|
|
|
1165
1510
|
endY = to.y + to.height / 2;
|
|
1166
1511
|
break;
|
|
1167
1512
|
}
|
|
1513
|
+
if (lineType === GanttLinkLineType.Curve) {
|
|
1514
|
+
return computeCurvePath(startX, startY, endX, endY, type, offset);
|
|
1515
|
+
}
|
|
1516
|
+
return computeStraightPath(startX, startY, endX, endY, type, offset);
|
|
1517
|
+
}
|
|
1518
|
+
function computeStraightPath(startX, startY, endX, endY, type, offset) {
|
|
1168
1519
|
const midX = startX + offset;
|
|
1169
1520
|
if (type === DependencyType.FinishToStart && endX > startX + offset * 2) {
|
|
1170
1521
|
const mx = (startX + endX) / 2;
|
|
@@ -1172,95 +1523,150 @@ function computeDependencyPath(from, to, type, offset = 12) {
|
|
|
1172
1523
|
}
|
|
1173
1524
|
return `M ${startX} ${startY} H ${midX} V ${endY} H ${endX}`;
|
|
1174
1525
|
}
|
|
1526
|
+
function computeCurvePath(startX, startY, endX, endY, type, offset) {
|
|
1527
|
+
const dx = endX - startX;
|
|
1528
|
+
const dy = endY - startY;
|
|
1529
|
+
const r = Math.min(Math.abs(dy) / 2, offset);
|
|
1530
|
+
if (type === DependencyType.FinishToStart && dx > offset * 2) {
|
|
1531
|
+
// Smooth S-curve
|
|
1532
|
+
const midX = (startX + endX) / 2;
|
|
1533
|
+
const cp1x = midX;
|
|
1534
|
+
const cp1y = startY;
|
|
1535
|
+
const cp2x = midX;
|
|
1536
|
+
const cp2y = endY;
|
|
1537
|
+
return `M ${startX} ${startY} C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${endX} ${endY}`;
|
|
1538
|
+
}
|
|
1539
|
+
// Route around: go right, down/up, then left/right to target
|
|
1540
|
+
const midX = startX + offset;
|
|
1541
|
+
const signY = dy >= 0 ? 1 : -1;
|
|
1542
|
+
if (Math.abs(dy) < r * 2) {
|
|
1543
|
+
// Very close vertically, simple curve
|
|
1544
|
+
return `M ${startX} ${startY} C ${midX} ${startY}, ${endX - offset} ${endY}, ${endX} ${endY}`;
|
|
1545
|
+
}
|
|
1546
|
+
return `M ${startX} ${startY} ` +
|
|
1547
|
+
`H ${midX - r} ` +
|
|
1548
|
+
`Q ${midX} ${startY}, ${midX} ${startY + signY * r} ` +
|
|
1549
|
+
`V ${endY - signY * r} ` +
|
|
1550
|
+
`Q ${midX} ${endY}, ${midX + r} ${endY} ` +
|
|
1551
|
+
`H ${endX}`;
|
|
1552
|
+
}
|
|
1175
1553
|
|
|
1176
1554
|
class GanttChartComponent {
|
|
1177
|
-
// Inputs
|
|
1178
1555
|
tasks = input.required();
|
|
1179
1556
|
dependencies = input([]);
|
|
1180
1557
|
config = input({});
|
|
1181
|
-
|
|
1558
|
+
groups = input([]);
|
|
1559
|
+
baselineItems = input([]);
|
|
1182
1560
|
taskChange = output();
|
|
1183
1561
|
taskClick = output();
|
|
1184
1562
|
taskDblClick = output();
|
|
1185
1563
|
dependencyClick = output();
|
|
1186
1564
|
scroll = output();
|
|
1187
1565
|
zoomChange = output();
|
|
1188
|
-
|
|
1566
|
+
dragStarted = output();
|
|
1567
|
+
dragMoved = output();
|
|
1568
|
+
dragEnded = output();
|
|
1569
|
+
linkDragStarted = output();
|
|
1570
|
+
linkDragEnded = output();
|
|
1571
|
+
lineClick = output();
|
|
1572
|
+
barClick = output();
|
|
1573
|
+
selectedChange = output();
|
|
1574
|
+
viewChange = output();
|
|
1575
|
+
expandChange = output();
|
|
1576
|
+
loadOnScroll = output();
|
|
1577
|
+
virtualScrolledIndexChange = output();
|
|
1578
|
+
tableDragStarted = output();
|
|
1579
|
+
tableDragEnded = output();
|
|
1580
|
+
tableDragDropped = output();
|
|
1189
1581
|
scaleService = inject(GanttScaleService);
|
|
1190
1582
|
layoutService = inject(GanttLayoutService);
|
|
1191
1583
|
keyboardService = inject(GanttKeyboardService);
|
|
1192
|
-
|
|
1584
|
+
printService = inject(GanttPrintService);
|
|
1585
|
+
elementRef = inject(ElementRef);
|
|
1193
1586
|
timelineContent = viewChild('timelineContent');
|
|
1194
1587
|
treelistContent = viewChild('treelistContent');
|
|
1195
|
-
// Internal state
|
|
1196
1588
|
internalCollapsed = signal(new Map());
|
|
1589
|
+
internalGroupExpanded = signal(new Map());
|
|
1197
1590
|
hoveredTaskId = signal(null);
|
|
1198
|
-
|
|
1591
|
+
selectedTaskIds = signal(new Set());
|
|
1199
1592
|
scrollLeft = signal(0);
|
|
1200
|
-
scrollTop_ = signal(0);
|
|
1201
1593
|
sidebarWidthOverride = signal(null);
|
|
1202
1594
|
lastEmittedZoom = signal(null);
|
|
1203
|
-
|
|
1595
|
+
showLoading = signal(false);
|
|
1596
|
+
loadingTimer = null;
|
|
1204
1597
|
tooltipTask = signal(null);
|
|
1205
1598
|
tooltipSubtask = signal(null);
|
|
1206
1599
|
tooltipX = signal(0);
|
|
1207
1600
|
tooltipY = signal(0);
|
|
1208
|
-
// Row tooltip state (for sidebar multi-task rows)
|
|
1209
1601
|
rowTooltipData = signal(null);
|
|
1210
1602
|
rowTooltipX = signal(0);
|
|
1211
1603
|
rowTooltipY = signal(0);
|
|
1212
|
-
|
|
1604
|
+
linkDragLine = signal(null);
|
|
1605
|
+
linkDragSource = null;
|
|
1606
|
+
tableDragSourceRow = null;
|
|
1607
|
+
virtualRange = signal({ start: 0, end: Infinity });
|
|
1213
1608
|
mergedConfig = computed(() => {
|
|
1214
1609
|
const base = { ...DEFAULT_GANTT_CONFIG, ...this.config() };
|
|
1215
1610
|
const sbOverride = this.sidebarWidthOverride();
|
|
1216
|
-
if (sbOverride !== null)
|
|
1611
|
+
if (sbOverride !== null)
|
|
1217
1612
|
base.sidebarWidth = sbOverride;
|
|
1218
|
-
|
|
1613
|
+
if (this.config().linkOptions)
|
|
1614
|
+
base.linkOptions = { ...DEFAULT_GANTT_CONFIG.linkOptions, ...this.config().linkOptions };
|
|
1615
|
+
if (this.config().toolbarOptions)
|
|
1616
|
+
base.toolbarOptions = { ...DEFAULT_GANTT_CONFIG.toolbarOptions, ...this.config().toolbarOptions };
|
|
1617
|
+
if (this.config().styleOptions)
|
|
1618
|
+
base.styleOptions = { ...DEFAULT_GANTT_CONFIG.styleOptions, ...this.config().styleOptions };
|
|
1219
1619
|
return base;
|
|
1220
1620
|
});
|
|
1221
|
-
|
|
1621
|
+
themeVars = computed(() => {
|
|
1622
|
+
const theme = this.mergedConfig().styleOptions.themes?.[this.mergedConfig().styleOptions.defaultTheme || 'default'];
|
|
1623
|
+
if (!theme)
|
|
1624
|
+
return '';
|
|
1625
|
+
const v = [];
|
|
1626
|
+
if (theme.primary)
|
|
1627
|
+
v.push('--k-primary:' + theme.primary);
|
|
1628
|
+
if (theme.danger)
|
|
1629
|
+
v.push('--k-danger:' + theme.danger);
|
|
1630
|
+
if (theme.background)
|
|
1631
|
+
v.push('--ngx-gantt-bg:' + theme.background);
|
|
1632
|
+
return v.join(';');
|
|
1633
|
+
});
|
|
1222
1634
|
sidebarColumns = computed(() => {
|
|
1223
1635
|
const columns = this.mergedConfig().sidebarColumns ?? [];
|
|
1224
|
-
if (columns.length === 0)
|
|
1636
|
+
if (columns.length === 0)
|
|
1225
1637
|
return DEFAULT_GANTT_CONFIG.sidebarColumns;
|
|
1226
|
-
}
|
|
1227
|
-
return columns.map(column => ({ ...column, width: Math.max(60, column.width || 120) }));
|
|
1638
|
+
return columns.map(c => ({ ...c, width: Math.max(60, c.width || 120) }));
|
|
1228
1639
|
});
|
|
1229
|
-
// Tasks with collapse applied
|
|
1230
1640
|
effectiveTasks = computed(() => {
|
|
1231
1641
|
const collapsed = this.internalCollapsed();
|
|
1232
|
-
return this.tasks().map(t => ({
|
|
1233
|
-
...t,
|
|
1234
|
-
collapsed: collapsed.has(t.id) ? collapsed.get(t.id) : t.collapsed,
|
|
1235
|
-
}));
|
|
1642
|
+
return this.tasks().map(t => ({ ...t, collapsed: collapsed.has(t.id) ? collapsed.get(t.id) : t.collapsed }));
|
|
1236
1643
|
});
|
|
1237
|
-
|
|
1238
|
-
|
|
1644
|
+
effectiveGroups = computed(() => {
|
|
1645
|
+
const m = this.internalGroupExpanded();
|
|
1646
|
+
return this.groups().map(g => ({ ...g, expanded: m.has(g.id) ? m.get(g.id) : (g.expanded !== false) }));
|
|
1647
|
+
});
|
|
1648
|
+
flatRows = computed(() => this.layoutService.flattenTasks(this.effectiveTasks(), this.effectiveGroups().length > 0 ? this.effectiveGroups() : undefined));
|
|
1239
1649
|
visibleRows = computed(() => this.flatRows().filter(r => r.isVisible));
|
|
1240
|
-
|
|
1650
|
+
renderedRows = computed(() => {
|
|
1651
|
+
const rows = this.visibleRows();
|
|
1652
|
+
if (!this.mergedConfig().virtualScrollEnabled)
|
|
1653
|
+
return rows;
|
|
1654
|
+
const range = this.virtualRange();
|
|
1655
|
+
return rows.slice(range.start, Math.min(range.end, rows.length));
|
|
1656
|
+
});
|
|
1241
1657
|
dateRange = computed(() => getDateRange(this.tasks()));
|
|
1242
1658
|
columnDates = computed(() => getColumnDates(this.dateRange().start, this.dateRange().end, this.mergedConfig().zoomLevel));
|
|
1243
|
-
// Dimensions
|
|
1244
1659
|
totalWidth = computed(() => this.columnDates().length * this.mergedConfig().columnWidth);
|
|
1245
1660
|
totalHeight = computed(() => this.visibleRows().length * this.mergedConfig().rowHeight);
|
|
1246
|
-
// Header columns with labels
|
|
1247
1661
|
headerColumns = computed(() => {
|
|
1248
1662
|
const cfg = this.mergedConfig();
|
|
1249
1663
|
const today = startOfDay(new Date());
|
|
1250
|
-
return this.columnDates().map((date, i) => {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
width: cfg.columnWidth,
|
|
1256
|
-
date,
|
|
1257
|
-
label: this.getSecondaryLabel(date, cfg.zoomLevel, cfg.locale),
|
|
1258
|
-
isWeekend: isWknd,
|
|
1259
|
-
isToday,
|
|
1260
|
-
};
|
|
1261
|
-
});
|
|
1664
|
+
return this.columnDates().map((date, i) => ({
|
|
1665
|
+
x: i * cfg.columnWidth, width: cfg.columnWidth, date,
|
|
1666
|
+
label: this.getSecondaryLabel(date, cfg.zoomLevel, cfg.locale),
|
|
1667
|
+
isWeekend: isWeekend(date), isToday: date.getTime() === today.getTime(),
|
|
1668
|
+
}));
|
|
1262
1669
|
});
|
|
1263
|
-
// Primary header groups
|
|
1264
1670
|
primaryHeaderGroups = computed(() => {
|
|
1265
1671
|
const cfg = this.mergedConfig();
|
|
1266
1672
|
const dates = this.columnDates();
|
|
@@ -1272,18 +1678,13 @@ class GanttChartComponent {
|
|
|
1272
1678
|
for (let i = 1; i <= dates.length; i++) {
|
|
1273
1679
|
const label = i < dates.length ? this.getPrimaryLabel(dates[i], cfg.zoomLevel, cfg.locale) : '';
|
|
1274
1680
|
if (label !== currentLabel || i === dates.length) {
|
|
1275
|
-
groups.push({
|
|
1276
|
-
x: startIdx * cfg.columnWidth,
|
|
1277
|
-
width: (i - startIdx) * cfg.columnWidth,
|
|
1278
|
-
label: currentLabel,
|
|
1279
|
-
});
|
|
1681
|
+
groups.push({ x: startIdx * cfg.columnWidth, width: (i - startIdx) * cfg.columnWidth, label: currentLabel });
|
|
1280
1682
|
currentLabel = label;
|
|
1281
1683
|
startIdx = i;
|
|
1282
1684
|
}
|
|
1283
1685
|
}
|
|
1284
1686
|
return groups;
|
|
1285
1687
|
});
|
|
1286
|
-
// Today X
|
|
1287
1688
|
todayX = computed(() => {
|
|
1288
1689
|
const today = startOfDay(new Date());
|
|
1289
1690
|
const range = this.dateRange();
|
|
@@ -1292,54 +1693,58 @@ class GanttChartComponent {
|
|
|
1292
1693
|
const cfg = this.mergedConfig();
|
|
1293
1694
|
return this.scaleService.dateToX(today, range.start, cfg.columnWidth, cfg.zoomLevel);
|
|
1294
1695
|
});
|
|
1295
|
-
// Task bar geometries (div positioning)
|
|
1296
1696
|
taskBars = computed(() => {
|
|
1297
1697
|
const cfg = this.mergedConfig();
|
|
1298
1698
|
const range = this.dateRange();
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
task,
|
|
1302
|
-
|
|
1303
|
-
width: task.isMilestone
|
|
1304
|
-
? 0
|
|
1305
|
-
: this.scaleService.getBarWidth(task.start, task.end, range.start, cfg.columnWidth, cfg.zoomLevel),
|
|
1306
|
-
top,
|
|
1307
|
-
isSummary,
|
|
1308
|
-
barHeight,
|
|
1309
|
-
rowIndex,
|
|
1310
|
-
primaryTaskId,
|
|
1699
|
+
const makeBar = (task, top, rowIndex, isSummary, primaryTaskId, isGroupHeader) => ({
|
|
1700
|
+
task, left: isGroupHeader ? 0 : this.scaleService.dateToX(task.start, range.start, cfg.columnWidth, cfg.zoomLevel),
|
|
1701
|
+
width: isGroupHeader || task.isMilestone ? 0 : this.scaleService.getBarWidth(task.start, task.end, range.start, cfg.columnWidth, cfg.zoomLevel),
|
|
1702
|
+
top, isSummary, barHeight: cfg.barHeight, rowIndex, primaryTaskId, isGroupHeader,
|
|
1311
1703
|
});
|
|
1312
1704
|
const bars = [];
|
|
1313
|
-
this.
|
|
1705
|
+
this.renderedRows().forEach((row, idx) => {
|
|
1314
1706
|
const top = idx * cfg.rowHeight;
|
|
1315
|
-
const isSummary = row.hasChildren && !row.task.isMilestone;
|
|
1316
|
-
bars.push(makeBar(row.task, top, idx, isSummary, row.task.id));
|
|
1317
|
-
|
|
1318
|
-
|
|
1707
|
+
const isSummary = row.hasChildren && !row.task.isMilestone && !row.isGroupHeader;
|
|
1708
|
+
bars.push(makeBar(row.task, top, idx, isSummary, row.task.id, row.isGroupHeader));
|
|
1709
|
+
if (!row.isGroupHeader) {
|
|
1710
|
+
for (const extra of row.extraTasks)
|
|
1711
|
+
bars.push(makeBar(extra, top, idx, false, row.task.id, false));
|
|
1319
1712
|
}
|
|
1320
1713
|
});
|
|
1321
1714
|
return bars;
|
|
1322
1715
|
});
|
|
1323
|
-
|
|
1716
|
+
baselineBars = computed(() => {
|
|
1717
|
+
if (!this.mergedConfig().showBaseline)
|
|
1718
|
+
return [];
|
|
1719
|
+
const cfg = this.mergedConfig();
|
|
1720
|
+
const range = this.dateRange();
|
|
1721
|
+
const rows = this.renderedRows();
|
|
1722
|
+
const rowMap = new Map(rows.map((r, idx) => [r.task.id, idx]));
|
|
1723
|
+
return this.baselineItems().filter(bl => bl.start && bl.end && rowMap.has(bl.id)).map(bl => {
|
|
1724
|
+
const rowIdx = rowMap.get(bl.id);
|
|
1725
|
+
return {
|
|
1726
|
+
id: bl.id, start: bl.start, end: bl.end,
|
|
1727
|
+
left: this.scaleService.dateToX(bl.start, range.start, cfg.columnWidth, cfg.zoomLevel),
|
|
1728
|
+
width: this.scaleService.getBarWidth(bl.start, bl.end, range.start, cfg.columnWidth, cfg.zoomLevel),
|
|
1729
|
+
top: rowIdx * cfg.rowHeight + (cfg.rowHeight - cfg.barHeight) / 2 + cfg.barHeight - 4,
|
|
1730
|
+
};
|
|
1731
|
+
});
|
|
1732
|
+
});
|
|
1324
1733
|
dependencyPaths = computed(() => {
|
|
1325
1734
|
const bars = this.taskBars();
|
|
1326
1735
|
const cfg = this.mergedConfig();
|
|
1736
|
+
const lineType = cfg.linkOptions.lineType || GanttLinkLineType.Straight;
|
|
1327
1737
|
const barMap = new Map(bars.map(b => [b.task.id, b]));
|
|
1328
|
-
return this.dependencies()
|
|
1329
|
-
.filter(dep => barMap.has(dep.fromId) && barMap.has(dep.toId))
|
|
1330
|
-
.map(dep => {
|
|
1738
|
+
return this.dependencies().filter(dep => barMap.has(dep.fromId) && barMap.has(dep.toId)).map(dep => {
|
|
1331
1739
|
const from = barMap.get(dep.fromId);
|
|
1332
1740
|
const to = barMap.get(dep.toId);
|
|
1333
|
-
const barH = from.isSummary ? 10 :
|
|
1334
|
-
const
|
|
1335
|
-
const
|
|
1336
|
-
const fromRect = { x: from.left, y:
|
|
1337
|
-
const toRect = { x: to.left, y:
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
path: computeDependencyPath(fromRect, toRect, dep.type),
|
|
1341
|
-
key: dep.fromId + '-' + dep.toId,
|
|
1342
|
-
};
|
|
1741
|
+
const barH = from.isSummary ? 10 : cfg.barHeight;
|
|
1742
|
+
const fromCY = from.top + cfg.rowHeight / 2;
|
|
1743
|
+
const toCY = to.top + cfg.rowHeight / 2;
|
|
1744
|
+
const fromRect = { x: from.left, y: fromCY - barH / 2, width: from.width || 16, height: barH };
|
|
1745
|
+
const toRect = { x: to.left, y: toCY - (to.isSummary ? 5 : cfg.barHeight / 2), width: to.width || 16, height: to.isSummary ? 10 : cfg.barHeight };
|
|
1746
|
+
const depColor = typeof dep.color === 'string' ? dep.color : (typeof dep.color === 'object' ? dep.color.default : '#ff6358');
|
|
1747
|
+
return { dependency: dep, path: computeDependencyPath(fromRect, toRect, dep.type, 12, lineType), key: dep.fromId + '-' + dep.toId, color: depColor };
|
|
1343
1748
|
});
|
|
1344
1749
|
});
|
|
1345
1750
|
constructor() {
|
|
@@ -1350,47 +1755,80 @@ class GanttChartComponent {
|
|
|
1350
1755
|
this.zoomChange.emit(zoom);
|
|
1351
1756
|
}
|
|
1352
1757
|
});
|
|
1758
|
+
effect(() => {
|
|
1759
|
+
const loading = this.mergedConfig().loading;
|
|
1760
|
+
const delay = this.mergedConfig().loadingDelay;
|
|
1761
|
+
if (this.loadingTimer) {
|
|
1762
|
+
clearTimeout(this.loadingTimer);
|
|
1763
|
+
this.loadingTimer = null;
|
|
1764
|
+
}
|
|
1765
|
+
if (loading) {
|
|
1766
|
+
if (delay > 0) {
|
|
1767
|
+
this.loadingTimer = setTimeout(() => this.showLoading.set(true), delay);
|
|
1768
|
+
}
|
|
1769
|
+
else {
|
|
1770
|
+
this.showLoading.set(true);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
else {
|
|
1774
|
+
this.showLoading.set(false);
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
effect(() => { this.printService.register(this.elementRef); });
|
|
1778
|
+
}
|
|
1779
|
+
isTaskSelected(taskId) { return this.selectedTaskIds().has(taskId); }
|
|
1780
|
+
toggleSelection(task, event) {
|
|
1781
|
+
const cfg = this.mergedConfig();
|
|
1782
|
+
const current = new Set(this.selectedTaskIds());
|
|
1783
|
+
if (cfg.selectable && cfg.multiple) {
|
|
1784
|
+
if (current.has(task.id))
|
|
1785
|
+
current.delete(task.id);
|
|
1786
|
+
else
|
|
1787
|
+
current.add(task.id);
|
|
1788
|
+
}
|
|
1789
|
+
else {
|
|
1790
|
+
current.clear();
|
|
1791
|
+
current.add(task.id);
|
|
1792
|
+
}
|
|
1793
|
+
this.selectedTaskIds.set(current);
|
|
1794
|
+
if (cfg.selectable) {
|
|
1795
|
+
const selectedTasks = this.tasks().filter(t => current.has(t.id));
|
|
1796
|
+
this.selectedChange.emit({ event, current: task, selectedValue: cfg.multiple ? selectedTasks : task });
|
|
1797
|
+
}
|
|
1353
1798
|
}
|
|
1354
|
-
// Timeline scroll handler — syncs treelist scroll & header position
|
|
1355
1799
|
onTimelineScroll() {
|
|
1356
1800
|
const el = this.timelineContent()?.nativeElement;
|
|
1357
1801
|
if (!el)
|
|
1358
1802
|
return;
|
|
1359
1803
|
this.scrollLeft.set(el.scrollLeft);
|
|
1360
|
-
this.scrollTop_.set(el.scrollTop);
|
|
1361
|
-
// Sync treelist vertical scroll
|
|
1362
1804
|
const treeEl = this.treelistContent()?.nativeElement;
|
|
1363
1805
|
if (treeEl)
|
|
1364
1806
|
treeEl.scrollTop = el.scrollTop;
|
|
1807
|
+
if (this.mergedConfig().virtualScrollEnabled) {
|
|
1808
|
+
const rh = this.mergedConfig().rowHeight;
|
|
1809
|
+
const startIdx = Math.floor(el.scrollTop / rh);
|
|
1810
|
+
const count = Math.ceil(el.clientHeight / rh);
|
|
1811
|
+
this.virtualRange.set({ start: Math.max(0, startIdx - 5), end: startIdx + count + 5 });
|
|
1812
|
+
this.virtualScrolledIndexChange.emit({ index: startIdx, renderedRange: this.virtualRange(), count: this.visibleRows().length });
|
|
1813
|
+
}
|
|
1365
1814
|
const cfg = this.mergedConfig();
|
|
1366
1815
|
const range = this.dateRange();
|
|
1367
|
-
const
|
|
1368
|
-
const
|
|
1369
|
-
this.scroll.emit({
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
visibleEndDate,
|
|
1374
|
-
});
|
|
1816
|
+
const visStart = this.scaleService.xToDate(el.scrollLeft, range.start, cfg.columnWidth, cfg.zoomLevel);
|
|
1817
|
+
const visEnd = this.scaleService.xToDate(el.scrollLeft + el.clientWidth, range.start, cfg.columnWidth, cfg.zoomLevel);
|
|
1818
|
+
this.scroll.emit({ scrollLeft: el.scrollLeft, scrollTop: el.scrollTop, visibleStartDate: visStart, visibleEndDate: visEnd });
|
|
1819
|
+
if (cfg.loadOnScroll && (el.scrollLeft < 100 || el.scrollLeft + el.clientWidth > el.scrollWidth - 100)) {
|
|
1820
|
+
this.loadOnScroll.emit({ start: visStart, end: visEnd });
|
|
1821
|
+
}
|
|
1375
1822
|
}
|
|
1376
|
-
// Splitbar resize
|
|
1377
1823
|
onSplitBarDown(event) {
|
|
1378
1824
|
event.preventDefault();
|
|
1379
1825
|
const startX = event.clientX;
|
|
1380
1826
|
const startWidth = this.mergedConfig().sidebarWidth;
|
|
1381
|
-
const onMove = (e) => {
|
|
1382
|
-
|
|
1383
|
-
const newWidth = Math.max(150, Math.min(600, startWidth + delta));
|
|
1384
|
-
this.sidebarWidthOverride.set(newWidth);
|
|
1385
|
-
};
|
|
1386
|
-
const onUp = () => {
|
|
1387
|
-
document.removeEventListener('pointermove', onMove);
|
|
1388
|
-
document.removeEventListener('pointerup', onUp);
|
|
1389
|
-
};
|
|
1827
|
+
const onMove = (e) => { this.sidebarWidthOverride.set(Math.max(150, Math.min(600, startWidth + e.clientX - startX))); };
|
|
1828
|
+
const onUp = () => { document.removeEventListener('pointermove', onMove); document.removeEventListener('pointerup', onUp); };
|
|
1390
1829
|
document.addEventListener('pointermove', onMove);
|
|
1391
1830
|
document.addEventListener('pointerup', onUp);
|
|
1392
1831
|
}
|
|
1393
|
-
// Task bar drag (move/resize)
|
|
1394
1832
|
onBarPointerDown(event, task, mode) {
|
|
1395
1833
|
if (task.draggable === false)
|
|
1396
1834
|
return;
|
|
@@ -1398,7 +1836,6 @@ class GanttChartComponent {
|
|
|
1398
1836
|
event.stopPropagation();
|
|
1399
1837
|
const startX = event.clientX;
|
|
1400
1838
|
const cfg = this.mergedConfig();
|
|
1401
|
-
const range = this.dateRange();
|
|
1402
1839
|
const barEl = event.target.closest('.k-task');
|
|
1403
1840
|
if (!barEl)
|
|
1404
1841
|
return;
|
|
@@ -1408,22 +1845,21 @@ class GanttChartComponent {
|
|
|
1408
1845
|
barEl.style.zIndex = '10';
|
|
1409
1846
|
barEl.style.opacity = '0.85';
|
|
1410
1847
|
barEl.classList.add('k-dragging');
|
|
1848
|
+
this.dragStarted.emit({ task });
|
|
1411
1849
|
const onMove = (e) => {
|
|
1412
|
-
const
|
|
1413
|
-
if (mode === 'move')
|
|
1414
|
-
barEl.style.left = (origLeft +
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
barEl.style.width = Math.max(10, origWidth + deltaX) + 'px';
|
|
1418
|
-
}
|
|
1850
|
+
const dx = e.clientX - startX;
|
|
1851
|
+
if (mode === 'move')
|
|
1852
|
+
barEl.style.left = (origLeft + dx) + 'px';
|
|
1853
|
+
else if (mode === 'resize-right')
|
|
1854
|
+
barEl.style.width = Math.max(10, origWidth + dx) + 'px';
|
|
1419
1855
|
else {
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
barEl.style.
|
|
1424
|
-
barEl.style.width = newWidth + 'px';
|
|
1856
|
+
const nw = origWidth - dx;
|
|
1857
|
+
if (nw > 10) {
|
|
1858
|
+
barEl.style.left = (origLeft + dx) + 'px';
|
|
1859
|
+
barEl.style.width = nw + 'px';
|
|
1425
1860
|
}
|
|
1426
1861
|
}
|
|
1862
|
+
this.dragMoved.emit({ task });
|
|
1427
1863
|
};
|
|
1428
1864
|
const onUp = (e) => {
|
|
1429
1865
|
document.removeEventListener('pointermove', onMove);
|
|
@@ -1432,89 +1868,149 @@ class GanttChartComponent {
|
|
|
1432
1868
|
barEl.style.zIndex = '';
|
|
1433
1869
|
barEl.style.opacity = '';
|
|
1434
1870
|
barEl.classList.remove('k-dragging');
|
|
1871
|
+
this.dragEnded.emit({ task });
|
|
1435
1872
|
const deltaX = e.clientX - startX;
|
|
1436
1873
|
if (Math.abs(deltaX) < 2)
|
|
1437
|
-
return;
|
|
1874
|
+
return;
|
|
1438
1875
|
const pxPerMs = cfg.columnWidth / this.getMsPerUnit(cfg.zoomLevel);
|
|
1439
1876
|
const deltaMs = deltaX / pxPerMs;
|
|
1440
|
-
const
|
|
1441
|
-
|
|
1442
|
-
let newStart;
|
|
1443
|
-
let newEnd;
|
|
1877
|
+
const ps = task.start, pe = task.end;
|
|
1878
|
+
let ns, ne;
|
|
1444
1879
|
if (mode === 'move') {
|
|
1445
|
-
|
|
1446
|
-
|
|
1880
|
+
ns = new Date(ps.getTime() + deltaMs);
|
|
1881
|
+
ne = new Date(pe.getTime() + deltaMs);
|
|
1447
1882
|
}
|
|
1448
1883
|
else if (mode === 'resize-right') {
|
|
1449
|
-
|
|
1450
|
-
|
|
1884
|
+
ns = ps;
|
|
1885
|
+
ne = new Date(pe.getTime() + deltaMs);
|
|
1451
1886
|
}
|
|
1452
1887
|
else {
|
|
1453
|
-
|
|
1454
|
-
|
|
1888
|
+
ns = new Date(ps.getTime() + deltaMs);
|
|
1889
|
+
ne = pe;
|
|
1455
1890
|
}
|
|
1456
1891
|
if (cfg.snapTo !== 'none') {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}
|
|
1460
|
-
if (newEnd <= newStart) {
|
|
1461
|
-
newEnd = addDays(newStart, 1);
|
|
1892
|
+
ns = this.scaleService.snapDate(ns, cfg.snapTo);
|
|
1893
|
+
ne = this.scaleService.snapDate(ne, cfg.snapTo);
|
|
1462
1894
|
}
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
const
|
|
1895
|
+
if (ne <= ns)
|
|
1896
|
+
ne = addDays(ns, 1);
|
|
1897
|
+
let subs = task.subtasks;
|
|
1898
|
+
if (subs && subs.length > 0) {
|
|
1899
|
+
const od = pe.getTime() - ps.getTime(), nd = ne.getTime() - ns.getTime();
|
|
1468
1900
|
if (mode === 'move') {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
updatedSubtasks = updatedSubtasks.map(sub => ({
|
|
1472
|
-
...sub,
|
|
1473
|
-
start: new Date(sub.start.getTime() + shiftMs),
|
|
1474
|
-
end: new Date(sub.end.getTime() + shiftMs),
|
|
1475
|
-
}));
|
|
1901
|
+
const sh = ns.getTime() - ps.getTime();
|
|
1902
|
+
subs = subs.map(s => ({ ...s, start: new Date(s.start.getTime() + sh), end: new Date(s.end.getTime() + sh) }));
|
|
1476
1903
|
}
|
|
1477
|
-
else if (
|
|
1478
|
-
|
|
1479
|
-
updatedSubtasks = updatedSubtasks.map(sub => {
|
|
1480
|
-
const subStartRatio = (sub.start.getTime() - previousStart.getTime()) / origDuration;
|
|
1481
|
-
const subEndRatio = (sub.end.getTime() - previousStart.getTime()) / origDuration;
|
|
1482
|
-
return {
|
|
1483
|
-
...sub,
|
|
1484
|
-
start: new Date(newStart.getTime() + subStartRatio * newDuration),
|
|
1485
|
-
end: new Date(newStart.getTime() + subEndRatio * newDuration),
|
|
1486
|
-
};
|
|
1487
|
-
});
|
|
1904
|
+
else if (od > 0) {
|
|
1905
|
+
subs = subs.map(s => { const sr = (s.start.getTime() - ps.getTime()) / od, er = (s.end.getTime() - ps.getTime()) / od; return { ...s, start: new Date(ns.getTime() + sr * nd), end: new Date(ns.getTime() + er * nd) }; });
|
|
1488
1906
|
}
|
|
1489
1907
|
}
|
|
1490
|
-
this.taskChange.emit({
|
|
1491
|
-
task: { ...task, start: newStart, end: newEnd, subtasks: updatedSubtasks },
|
|
1492
|
-
previousStart,
|
|
1493
|
-
previousEnd,
|
|
1494
|
-
});
|
|
1908
|
+
this.taskChange.emit({ task: { ...task, start: ns, end: ne, subtasks: subs }, previousStart: ps, previousEnd: pe });
|
|
1495
1909
|
};
|
|
1496
1910
|
document.addEventListener('pointermove', onMove);
|
|
1497
1911
|
document.addEventListener('pointerup', onUp);
|
|
1498
1912
|
}
|
|
1499
|
-
|
|
1913
|
+
onLinkDragStart(event, task, side) {
|
|
1914
|
+
event.preventDefault();
|
|
1915
|
+
event.stopPropagation();
|
|
1916
|
+
this.linkDragSource = task;
|
|
1917
|
+
const timelineEl = this.timelineContent()?.nativeElement;
|
|
1918
|
+
if (!timelineEl)
|
|
1919
|
+
return;
|
|
1920
|
+
const cfg = this.mergedConfig();
|
|
1921
|
+
const taskBar = this.taskBars().find(b => b.task.id === task.id);
|
|
1922
|
+
if (!taskBar)
|
|
1923
|
+
return;
|
|
1924
|
+
const x1 = side === 'end' ? taskBar.left + taskBar.width : taskBar.left;
|
|
1925
|
+
const y1 = taskBar.top + cfg.rowHeight / 2;
|
|
1926
|
+
this.linkDragStarted.emit({ source: task });
|
|
1927
|
+
const onMove = (e) => {
|
|
1928
|
+
const rect = timelineEl.getBoundingClientRect();
|
|
1929
|
+
this.linkDragLine.set({ x1, y1, x2: e.clientX - rect.left + timelineEl.scrollLeft, y2: e.clientY - rect.top + timelineEl.scrollTop });
|
|
1930
|
+
};
|
|
1931
|
+
const onUp = (e) => {
|
|
1932
|
+
document.removeEventListener('pointermove', onMove);
|
|
1933
|
+
document.removeEventListener('pointerup', onUp);
|
|
1934
|
+
this.linkDragLine.set(null);
|
|
1935
|
+
const rect = timelineEl.getBoundingClientRect();
|
|
1936
|
+
const dropY = e.clientY - rect.top + timelineEl.scrollTop;
|
|
1937
|
+
const dropX = e.clientX - rect.left + timelineEl.scrollLeft;
|
|
1938
|
+
const targetRow = this.renderedRows().find((_row, idx) => { const rt = idx * cfg.rowHeight; return dropY >= rt && dropY < rt + cfg.rowHeight; });
|
|
1939
|
+
if (targetRow && targetRow.task.id !== task.id) {
|
|
1940
|
+
const tb = this.taskBars().find(b => b.task.id === targetRow.task.id);
|
|
1941
|
+
if (tb) {
|
|
1942
|
+
const ts = dropX < tb.left + tb.width / 2 ? 'start' : 'end';
|
|
1943
|
+
let lt;
|
|
1944
|
+
if (side === 'end' && ts === 'start')
|
|
1945
|
+
lt = DependencyType.FinishToStart;
|
|
1946
|
+
else if (side === 'start' && ts === 'start')
|
|
1947
|
+
lt = DependencyType.StartToStart;
|
|
1948
|
+
else if (side === 'end' && ts === 'end')
|
|
1949
|
+
lt = DependencyType.FinishToFinish;
|
|
1950
|
+
else
|
|
1951
|
+
lt = DependencyType.StartToFinish;
|
|
1952
|
+
this.linkDragEnded.emit({ source: task, target: targetRow.task, type: lt });
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1956
|
+
this.linkDragEnded.emit({ source: task });
|
|
1957
|
+
}
|
|
1958
|
+
this.linkDragSource = null;
|
|
1959
|
+
};
|
|
1960
|
+
document.addEventListener('pointermove', onMove);
|
|
1961
|
+
document.addEventListener('pointerup', onUp);
|
|
1962
|
+
}
|
|
1963
|
+
onTableDragStart(event, row) {
|
|
1964
|
+
this.tableDragSourceRow = row;
|
|
1965
|
+
event.dataTransfer?.setData('text/plain', row.task.id);
|
|
1966
|
+
this.tableDragStarted.emit({ source: row.task, sourceParent: this.tasks().find(t => t.id === row.task.parentId) || null });
|
|
1967
|
+
}
|
|
1968
|
+
onTableDragEnd(_event, row) {
|
|
1969
|
+
this.tableDragEnded.emit({ source: row.task, sourceParent: this.tasks().find(t => t.id === row.task.parentId) || null });
|
|
1970
|
+
this.tableDragSourceRow = null;
|
|
1971
|
+
}
|
|
1972
|
+
onTableDragOver(event, row) {
|
|
1973
|
+
if (this.tableDragSourceRow && this.tableDragSourceRow.task.id !== row.task.id) {
|
|
1974
|
+
event.preventDefault();
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
onTableDrop(event, targetRow) {
|
|
1978
|
+
event.preventDefault();
|
|
1979
|
+
if (!this.tableDragSourceRow || this.tableDragSourceRow.task.id === targetRow.task.id)
|
|
1980
|
+
return;
|
|
1981
|
+
const src = this.tableDragSourceRow.task;
|
|
1982
|
+
const rect = event.target.closest('.k-gantt-row')?.getBoundingClientRect();
|
|
1983
|
+
let pos = 'after';
|
|
1984
|
+
if (rect) {
|
|
1985
|
+
const ry = event.clientY - rect.top, th = rect.height / 3;
|
|
1986
|
+
if (ry < th)
|
|
1987
|
+
pos = 'before';
|
|
1988
|
+
else if (ry < th * 2)
|
|
1989
|
+
pos = 'inside';
|
|
1990
|
+
}
|
|
1991
|
+
this.tableDragDropped.emit({ source: src, sourceParent: this.tasks().find(t => t.id === src.parentId) || null, target: targetRow.task, targetParent: this.tasks().find(t => t.id === targetRow.task.parentId) || null, dropPosition: pos });
|
|
1992
|
+
this.tableDragSourceRow = null;
|
|
1993
|
+
}
|
|
1500
1994
|
onRowClick(task, event) {
|
|
1501
|
-
this.
|
|
1995
|
+
this.toggleSelection(task, event);
|
|
1502
1996
|
this.keyboardService.focusTask(task.id);
|
|
1503
1997
|
this.taskClick.emit({ task, originalEvent: event });
|
|
1998
|
+
this.barClick.emit({ event, task });
|
|
1504
1999
|
}
|
|
1505
|
-
// Task bar click
|
|
1506
2000
|
onTaskBarClick(task, event) {
|
|
1507
2001
|
event.stopPropagation();
|
|
1508
|
-
this.
|
|
2002
|
+
this.toggleSelection(task, event);
|
|
1509
2003
|
this.keyboardService.focusTask(task.id);
|
|
1510
2004
|
this.taskClick.emit({ task, originalEvent: event });
|
|
2005
|
+
this.barClick.emit({ event, task });
|
|
1511
2006
|
}
|
|
1512
|
-
onTaskBarDblClick(task, event) {
|
|
1513
|
-
event.stopPropagation();
|
|
1514
|
-
this.taskDblClick.emit({ task, originalEvent: event });
|
|
1515
|
-
}
|
|
2007
|
+
onTaskBarDblClick(task, event) { event.stopPropagation(); this.taskDblClick.emit({ task, originalEvent: event }); }
|
|
1516
2008
|
onDependencyClick(dep, event) {
|
|
1517
2009
|
this.dependencyClick.emit({ dependency: dep, originalEvent: event });
|
|
2010
|
+
const source = this.tasks().find(t => t.id === dep.fromId);
|
|
2011
|
+
const target = this.tasks().find(t => t.id === dep.toId);
|
|
2012
|
+
if (source && target)
|
|
2013
|
+
this.lineClick.emit({ event, source, target });
|
|
1518
2014
|
}
|
|
1519
2015
|
onToggleCollapse(taskId) {
|
|
1520
2016
|
const current = new Map(this.internalCollapsed());
|
|
@@ -1524,1095 +2020,712 @@ class GanttChartComponent {
|
|
|
1524
2020
|
const isCollapsed = current.has(taskId) ? current.get(taskId) : task.collapsed;
|
|
1525
2021
|
current.set(taskId, !isCollapsed);
|
|
1526
2022
|
this.internalCollapsed.set(current);
|
|
2023
|
+
this.expandChange.emit({ item: task, expanded: isCollapsed });
|
|
2024
|
+
}
|
|
2025
|
+
onToggleGroupCollapse(group) {
|
|
2026
|
+
const current = new Map(this.internalGroupExpanded());
|
|
2027
|
+
const isExpanded = current.has(group.id) ? current.get(group.id) : (group.expanded !== false);
|
|
2028
|
+
current.set(group.id, !isExpanded);
|
|
2029
|
+
this.internalGroupExpanded.set(current);
|
|
2030
|
+
this.expandChange.emit({ group, expanded: !isExpanded });
|
|
2031
|
+
}
|
|
2032
|
+
onToolbarViewChange(vt) { this.viewChange.emit({ viewType: vt }); this.zoomChange.emit(vt); }
|
|
2033
|
+
getViewLabel(vt) {
|
|
2034
|
+
const m = { hour: 'Hour', day: 'Day', week: 'Week', month: 'Month', quarter: 'Quarter', year: 'Year' };
|
|
2035
|
+
return m[vt] || vt;
|
|
1527
2036
|
}
|
|
1528
2037
|
onKeyDown(event) {
|
|
1529
|
-
const ids = this.
|
|
2038
|
+
const ids = this.renderedRows().map(r => r.task.id);
|
|
1530
2039
|
this.keyboardService.handleKeyDown(event, ids, {
|
|
1531
|
-
onSelect: (taskId) => {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
}
|
|
1537
|
-
},
|
|
1538
|
-
onEscape: () => {
|
|
1539
|
-
this.selectedTaskId.set(null);
|
|
1540
|
-
},
|
|
2040
|
+
onSelect: (taskId) => { const task = this.tasks().find(t => t.id === taskId); if (task) {
|
|
2041
|
+
this.toggleSelection(task, event);
|
|
2042
|
+
this.taskClick.emit({ task, originalEvent: event });
|
|
2043
|
+
} },
|
|
2044
|
+
onEscape: () => { this.selectedTaskIds.set(new Set()); },
|
|
1541
2045
|
});
|
|
1542
2046
|
}
|
|
1543
|
-
|
|
2047
|
+
scrollToToday() { this.scrollToDate(new Date()); }
|
|
1544
2048
|
scrollToDate(date) {
|
|
1545
|
-
const cfg = this.mergedConfig();
|
|
1546
|
-
const range = this.dateRange();
|
|
2049
|
+
const cfg = this.mergedConfig(), range = this.dateRange();
|
|
1547
2050
|
const x = this.scaleService.dateToX(date, range.start, cfg.columnWidth, cfg.zoomLevel);
|
|
1548
2051
|
const el = this.timelineContent()?.nativeElement;
|
|
1549
2052
|
if (el)
|
|
1550
|
-
el.scrollLeft = x;
|
|
2053
|
+
el.scrollLeft = Math.max(0, x - el.clientWidth / 2);
|
|
1551
2054
|
}
|
|
1552
2055
|
scrollToTask(taskId) {
|
|
1553
|
-
const
|
|
1554
|
-
if (
|
|
2056
|
+
const idx = this.visibleRows().findIndex(r => r.task.id === taskId);
|
|
2057
|
+
if (idx === -1)
|
|
1555
2058
|
return;
|
|
1556
|
-
const y = row.rowIndex * this.mergedConfig().rowHeight;
|
|
1557
2059
|
const el = this.timelineContent()?.nativeElement;
|
|
1558
2060
|
if (el)
|
|
1559
|
-
el.scrollTop =
|
|
2061
|
+
el.scrollTop = idx * this.mergedConfig().rowHeight;
|
|
1560
2062
|
}
|
|
1561
2063
|
expandAll() {
|
|
1562
2064
|
const map = new Map();
|
|
1563
2065
|
this.tasks().forEach(t => map.set(t.id, false));
|
|
1564
2066
|
this.internalCollapsed.set(map);
|
|
2067
|
+
const gm = new Map();
|
|
2068
|
+
this.groups().forEach(g => gm.set(g.id, true));
|
|
2069
|
+
this.internalGroupExpanded.set(gm);
|
|
1565
2070
|
}
|
|
1566
2071
|
collapseAll() {
|
|
1567
|
-
const rows = this.flatRows();
|
|
1568
2072
|
const map = new Map();
|
|
1569
|
-
|
|
2073
|
+
this.flatRows().filter(r => r.hasChildren).forEach(r => map.set(r.task.id, true));
|
|
1570
2074
|
this.internalCollapsed.set(map);
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
if (typeof column.field === 'function') {
|
|
1593
|
-
return String(column.field(row.task) ?? '');
|
|
1594
|
-
}
|
|
1595
|
-
switch (column.field) {
|
|
1596
|
-
case 'start':
|
|
1597
|
-
return this.formatDateShort(getRowStartForCell(row));
|
|
1598
|
-
case 'end':
|
|
1599
|
-
return this.formatDateShort(getRowEndForCell(row));
|
|
1600
|
-
case 'progress':
|
|
1601
|
-
return row.extraTasks.length > 0 ? `~${this.getRowAvgProgress(row)}%` : `${row.task.progress}%`;
|
|
2075
|
+
const gm = new Map();
|
|
2076
|
+
this.groups().forEach(g => gm.set(g.id, false));
|
|
2077
|
+
this.internalGroupExpanded.set(gm);
|
|
2078
|
+
}
|
|
2079
|
+
async exportAsImage(filename) { await this.printService.print(filename); }
|
|
2080
|
+
async getImageDataUrl() { return this.printService.exportAsImage(); }
|
|
2081
|
+
isSelected(taskId) { return this.selectedTaskIds().has(taskId); }
|
|
2082
|
+
getSelectedIds() { return Array.from(this.selectedTaskIds()); }
|
|
2083
|
+
rerenderView() { this.internalCollapsed.set(new Map(this.internalCollapsed())); }
|
|
2084
|
+
formatDateShort(date) { return date.toLocaleDateString(this.mergedConfig().locale, { month: 'short', day: 'numeric' }); }
|
|
2085
|
+
formatDateFull(date) { return date.toLocaleDateString(this.mergedConfig().locale, { month: 'short', day: 'numeric', year: 'numeric' }); }
|
|
2086
|
+
isNameColumn(col, index) { return typeof col.field === 'function' ? index === 0 : col.field === 'name' || index === 0; }
|
|
2087
|
+
isDateColumn(col) { return typeof col.field === 'string' && (col.field === 'start' || col.field === 'end'); }
|
|
2088
|
+
isProgressColumn(col) { return typeof col.field === 'string' && col.field === 'progress'; }
|
|
2089
|
+
getSidebarCellValue(row, col) {
|
|
2090
|
+
if (typeof col.field === 'function')
|
|
2091
|
+
return String(col.field(row.task) ?? '');
|
|
2092
|
+
switch (col.field) {
|
|
2093
|
+
case 'start': return this.formatDateShort(getRowStart(row));
|
|
2094
|
+
case 'end': return this.formatDateShort(getRowEnd(row));
|
|
2095
|
+
case 'progress': return row.extraTasks.length > 0 ? '~' + this.getRowAvgProgress(row) + '%' : row.task.progress + '%';
|
|
1602
2096
|
default: {
|
|
1603
|
-
const
|
|
1604
|
-
if (
|
|
1605
|
-
return this.formatDateShort(
|
|
1606
|
-
|
|
1607
|
-
return value == null ? '' : String(value);
|
|
2097
|
+
const v = row.task[col.field];
|
|
2098
|
+
if (v instanceof Date)
|
|
2099
|
+
return this.formatDateShort(v);
|
|
2100
|
+
return v == null ? '' : String(v);
|
|
1608
2101
|
}
|
|
1609
2102
|
}
|
|
1610
2103
|
}
|
|
1611
2104
|
showTooltip(task, event) {
|
|
1612
2105
|
this.tooltipTask.set(task);
|
|
1613
2106
|
this.tooltipSubtask.set(null);
|
|
1614
|
-
|
|
1615
|
-
const TOOLTIP_W = 220;
|
|
1616
|
-
const TOOLTIP_H = 100;
|
|
1617
|
-
const flipCoord = (cursor, size, viewport) => cursor + OFFSET + size > viewport ? cursor - size - OFFSET : cursor + OFFSET;
|
|
1618
|
-
this.tooltipX.set(flipCoord(event.clientX, TOOLTIP_W, window.innerWidth));
|
|
1619
|
-
this.tooltipY.set(flipCoord(event.clientY, TOOLTIP_H, window.innerHeight));
|
|
2107
|
+
this.updateTooltipPosition(event);
|
|
1620
2108
|
}
|
|
1621
2109
|
showSubtaskTooltip(task, subtask, event) {
|
|
1622
2110
|
this.tooltipTask.set(task);
|
|
1623
2111
|
this.tooltipSubtask.set(subtask);
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
this.
|
|
1633
|
-
this.tooltipSubtask
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
}
|
|
1642
|
-
getRowEnd(row) {
|
|
1643
|
-
if (row.extraTasks.length === 0)
|
|
1644
|
-
return row.task.end;
|
|
1645
|
-
const times = [row.task.end, ...row.extraTasks.map(t => t.end)].map(d => d.getTime());
|
|
1646
|
-
return new Date(Math.max(...times));
|
|
1647
|
-
}
|
|
1648
|
-
getRowAvgProgress(row) {
|
|
1649
|
-
const all = [row.task, ...row.extraTasks];
|
|
1650
|
-
return Math.round(all.reduce((sum, t) => sum + t.progress, 0) / all.length);
|
|
1651
|
-
}
|
|
1652
|
-
getRowProgressTitle(row) {
|
|
1653
|
-
const all = [row.task, ...row.extraTasks];
|
|
1654
|
-
return all.map(t => `${t.name}: ${t.progress}%`).join(', ');
|
|
1655
|
-
}
|
|
2112
|
+
this.updateTooltipPosition(event);
|
|
2113
|
+
}
|
|
2114
|
+
updateTooltipPosition(event) {
|
|
2115
|
+
const hostRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2116
|
+
const relX = event.clientX - hostRect.left;
|
|
2117
|
+
const relY = event.clientY - hostRect.top;
|
|
2118
|
+
const hostW = hostRect.width;
|
|
2119
|
+
const hostH = hostRect.height;
|
|
2120
|
+
const estimatedW = this.tooltipSubtask() ? 240 : 220;
|
|
2121
|
+
const estimatedH = this.tooltipSubtask() ? 140 : 120;
|
|
2122
|
+
this.tooltipX.set(flipCoord(relX, estimatedW, hostW));
|
|
2123
|
+
this.tooltipY.set(flipCoord(relY, estimatedH, hostH));
|
|
2124
|
+
}
|
|
2125
|
+
hideTooltip() { this.tooltipTask.set(null); this.tooltipSubtask.set(null); }
|
|
2126
|
+
getRowAvgProgress(row) { const all = [row.task, ...row.extraTasks]; return Math.round(all.reduce((s, t) => s + t.progress, 0) / all.length); }
|
|
2127
|
+
getRowProgressTitle(row) { return [row.task, ...row.extraTasks].map(t => t.name + ': ' + t.progress + '%').join(', '); }
|
|
2128
|
+
getUniqueExtraTasks(row) { return row.extraTasks.filter(t => t.name !== row.task.name); }
|
|
1656
2129
|
getMetaEntries(meta) {
|
|
1657
2130
|
if (!meta)
|
|
1658
2131
|
return [];
|
|
1659
|
-
return Object.entries(meta).map(([
|
|
1660
|
-
// Convert camelCase keys like "assignee" → "Assignee", "apiURL" → "Api URL"
|
|
1661
|
-
key: key
|
|
1662
|
-
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
|
|
1663
|
-
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
1664
|
-
.replace(/^./, c => c.toUpperCase()),
|
|
1665
|
-
value: String(value),
|
|
1666
|
-
}));
|
|
2132
|
+
return Object.entries(meta).map(([k, v]) => ({ key: k.replace(/([A-Z])/g, ' $1').replace(/^./, c => c.toUpperCase()), value: String(v) }));
|
|
1667
2133
|
}
|
|
1668
|
-
/** Compute pixel positions for subtask segments within a task bar. */
|
|
1669
2134
|
getSubtaskBars(bar) {
|
|
1670
|
-
const
|
|
1671
|
-
if (!
|
|
2135
|
+
const subs = bar.task.subtasks;
|
|
2136
|
+
if (!subs || subs.length === 0)
|
|
1672
2137
|
return [];
|
|
1673
|
-
const cfg = this.mergedConfig();
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
const
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
const clampedLeft = Math.max(0, Math.min(subLeft, bar.width));
|
|
1680
|
-
const clampedWidth = Math.max(4, Math.min(subWidth, bar.width - clampedLeft));
|
|
1681
|
-
return {
|
|
1682
|
-
subtask: sub,
|
|
1683
|
-
left: clampedLeft,
|
|
1684
|
-
width: clampedWidth,
|
|
1685
|
-
};
|
|
2138
|
+
const cfg = this.mergedConfig(), range = this.dateRange();
|
|
2139
|
+
return subs.map(sub => {
|
|
2140
|
+
const sl = this.scaleService.dateToX(sub.start, range.start, cfg.columnWidth, cfg.zoomLevel) - bar.left;
|
|
2141
|
+
const sw = this.scaleService.getBarWidth(sub.start, sub.end, range.start, cfg.columnWidth, cfg.zoomLevel);
|
|
2142
|
+
const cl = Math.max(0, Math.min(sl, bar.width));
|
|
2143
|
+
return { subtask: sub, left: cl, width: Math.max(4, Math.min(sw, bar.width - cl)) };
|
|
1686
2144
|
});
|
|
1687
2145
|
}
|
|
1688
|
-
showRowTooltip(row, event) {
|
|
1689
|
-
|
|
1690
|
-
this.
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1693
|
-
updateRowTooltip(event) {
|
|
1694
|
-
if (this.rowTooltipData()) {
|
|
1695
|
-
this.positionRowTooltip(event);
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1698
|
-
hideRowTooltip() {
|
|
1699
|
-
this.rowTooltipData.set(null);
|
|
1700
|
-
}
|
|
2146
|
+
showRowTooltip(row, event) { this.rowTooltipData.set({ allTasks: [row.task, ...row.extraTasks] }); this.positionRowTooltip(event); }
|
|
2147
|
+
updateRowTooltip(event) { if (this.rowTooltipData())
|
|
2148
|
+
this.positionRowTooltip(event); }
|
|
2149
|
+
hideRowTooltip() { this.rowTooltipData.set(null); }
|
|
2150
|
+
toStyleStr(style) { return Object.entries(style).filter(([, v]) => v != null).map(([k, v]) => k.replace(/([A-Z])/g, '-$1').toLowerCase() + ':' + v).join(';'); }
|
|
1701
2151
|
positionRowTooltip(event) {
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
const flipCoord = (cursor, size, viewport) => cursor + OFFSET + size > viewport ? cursor - size - OFFSET : cursor + OFFSET;
|
|
1706
|
-
this.rowTooltipX.set(flipCoord(event.clientX, TOOLTIP_W, window.innerWidth));
|
|
1707
|
-
this.rowTooltipY.set(flipCoord(event.clientY, TOOLTIP_H, window.innerHeight));
|
|
2152
|
+
const hostRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
2153
|
+
this.rowTooltipX.set(flipCoord(event.clientX - hostRect.left, 260, hostRect.width));
|
|
2154
|
+
this.rowTooltipY.set(flipCoord(event.clientY - hostRect.top, 120, hostRect.height));
|
|
1708
2155
|
}
|
|
1709
2156
|
getPrimaryLabel(date, zoom, locale) {
|
|
1710
2157
|
switch (zoom) {
|
|
2158
|
+
case ZoomLevel.Hour: return date.toLocaleDateString(locale, { month: 'short', day: 'numeric', year: 'numeric' });
|
|
1711
2159
|
case ZoomLevel.Day:
|
|
1712
|
-
case ZoomLevel.Week:
|
|
1713
|
-
return date.toLocaleDateString(locale, { month: 'long', year: 'numeric' });
|
|
2160
|
+
case ZoomLevel.Week: return date.toLocaleDateString(locale, { month: 'long', year: 'numeric' });
|
|
1714
2161
|
case ZoomLevel.Month:
|
|
1715
|
-
|
|
2162
|
+
case ZoomLevel.Quarter: return date.getFullYear().toString();
|
|
2163
|
+
case ZoomLevel.Year: return '';
|
|
1716
2164
|
}
|
|
1717
2165
|
}
|
|
1718
2166
|
getSecondaryLabel(date, zoom, locale) {
|
|
1719
2167
|
switch (zoom) {
|
|
1720
|
-
case ZoomLevel.
|
|
1721
|
-
|
|
1722
|
-
const weekday = date.toLocaleDateString(locale, { weekday: 'narrow' });
|
|
1723
|
-
return `${weekday} ${day}`;
|
|
1724
|
-
}
|
|
2168
|
+
case ZoomLevel.Hour: return date.getHours().toString().padStart(2, '0') + ':00';
|
|
2169
|
+
case ZoomLevel.Day: return date.toLocaleDateString(locale, { weekday: 'narrow' }) + ' ' + date.getDate();
|
|
1725
2170
|
case ZoomLevel.Week: {
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1728
|
-
return `W${weekNum}`;
|
|
2171
|
+
const oj = new Date(date.getFullYear(), 0, 1);
|
|
2172
|
+
return 'W' + Math.ceil(((date.getTime() - oj.getTime()) / 86400000 + oj.getDay() + 1) / 7);
|
|
1729
2173
|
}
|
|
1730
|
-
case ZoomLevel.Month:
|
|
1731
|
-
|
|
2174
|
+
case ZoomLevel.Month: return date.toLocaleDateString(locale, { month: 'short' });
|
|
2175
|
+
case ZoomLevel.Quarter: return 'Q' + (Math.floor(date.getMonth() / 3) + 1);
|
|
2176
|
+
case ZoomLevel.Year: return date.getFullYear().toString();
|
|
1732
2177
|
}
|
|
1733
2178
|
}
|
|
1734
2179
|
getMsPerUnit(zoom) {
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
case ZoomLevel.Week: return 604800000;
|
|
1738
|
-
case ZoomLevel.Month: return 2592000000;
|
|
1739
|
-
}
|
|
2180
|
+
const m = { hour: 3600000, day: 86400000, week: 604800000, month: 2592000000, quarter: 7776000000, year: 31536000000 };
|
|
2181
|
+
return m[zoom] || 86400000;
|
|
1740
2182
|
}
|
|
1741
2183
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1742
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: GanttChartComponent, isStandalone: true, selector: "ngx-gantt-chart", inputs: { tasks: { classPropertyName: "tasks", publicName: "tasks", isSignal: true, isRequired: true, transformFunction: null }, dependencies: { classPropertyName: "dependencies", publicName: "dependencies", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { taskChange: "taskChange", taskClick: "taskClick", taskDblClick: "taskDblClick", dependencyClick: "dependencyClick", scroll: "scroll", zoomChange: "zoomChange" }, providers: [
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
<thead>
|
|
1760
|
-
<tr>
|
|
1761
|
-
@for (col of sidebarColumns(); track col.header + '-' + $index) {
|
|
1762
|
-
<th class="k-header-cell">{{ col.header }}</th>
|
|
1763
|
-
}
|
|
1764
|
-
</tr>
|
|
1765
|
-
</thead>
|
|
1766
|
-
</table>
|
|
2184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: GanttChartComponent, isStandalone: true, selector: "ngx-gantt-chart", inputs: { tasks: { classPropertyName: "tasks", publicName: "tasks", isSignal: true, isRequired: true, transformFunction: null }, dependencies: { classPropertyName: "dependencies", publicName: "dependencies", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: false, transformFunction: null }, baselineItems: { classPropertyName: "baselineItems", publicName: "baselineItems", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { taskChange: "taskChange", taskClick: "taskClick", taskDblClick: "taskDblClick", dependencyClick: "dependencyClick", scroll: "scroll", zoomChange: "zoomChange", dragStarted: "dragStarted", dragMoved: "dragMoved", dragEnded: "dragEnded", linkDragStarted: "linkDragStarted", linkDragEnded: "linkDragEnded", lineClick: "lineClick", barClick: "barClick", selectedChange: "selectedChange", viewChange: "viewChange", expandChange: "expandChange", loadOnScroll: "loadOnScroll", virtualScrolledIndexChange: "virtualScrolledIndexChange", tableDragStarted: "tableDragStarted", tableDragEnded: "tableDragEnded", tableDragDropped: "tableDragDropped" }, providers: [GanttScaleService, GanttLayoutService, GanttKeyboardService, GanttPrintService], viewQueries: [{ propertyName: "timelineContent", first: true, predicate: ["timelineContent"], descendants: true, isSignal: true }, { propertyName: "treelistContent", first: true, predicate: ["treelistContent"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2185
|
+
<div class="k-gantt" [class.k-gantt-dark]="false" [class.k-no-grid]="!mergedConfig().showGrid" [style]="themeVars()" (keydown)="onKeyDown($event)">
|
|
2186
|
+
|
|
2187
|
+
@if (mergedConfig().showToolbar) {
|
|
2188
|
+
<div class="k-gantt-toolbar">
|
|
2189
|
+
<div class="k-toolbar-group k-toolbar-views">
|
|
2190
|
+
@for (vt of mergedConfig().toolbarOptions.viewTypes; track vt) {
|
|
2191
|
+
<button class="k-toolbar-btn" [class.k-active]="mergedConfig().zoomLevel === vt" (click)="onToolbarViewChange(vt)">{{ getViewLabel(vt) }}</button>
|
|
2192
|
+
}
|
|
2193
|
+
</div>
|
|
2194
|
+
<div class="k-toolbar-group">
|
|
2195
|
+
<button class="k-toolbar-btn" (click)="scrollToToday()" title="Go to Today">Today</button>
|
|
2196
|
+
@if (mergedConfig().collapsible) {
|
|
2197
|
+
<button class="k-toolbar-btn" (click)="expandAll()">Expand</button>
|
|
2198
|
+
<button class="k-toolbar-btn" (click)="collapseAll()">Collapse</button>
|
|
2199
|
+
}
|
|
2200
|
+
</div>
|
|
1767
2201
|
</div>
|
|
2202
|
+
}
|
|
1768
2203
|
|
|
1769
|
-
|
|
1770
|
-
<div class="k-treelist
|
|
1771
|
-
<
|
|
1772
|
-
<
|
|
1773
|
-
|
|
1774
|
-
<col [style.width.px]="col.width"/>
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
(mousemove)="isNameColumn(col, colIndex) && row.extraTasks.length > 0 ? updateRowTooltip($event) : null"
|
|
1797
|
-
(mouseleave)="isNameColumn(col, colIndex) && row.extraTasks.length > 0 ? hideRowTooltip() : null"
|
|
1798
|
-
>
|
|
1799
|
-
@if (isNameColumn(col, colIndex)) {
|
|
1800
|
-
<span class="k-indent" [style.width.px]="row.depth * 20"></span>
|
|
1801
|
-
@if (row.hasChildren && mergedConfig().collapsible) {
|
|
1802
|
-
<button
|
|
1803
|
-
class="k-collapse-btn"
|
|
1804
|
-
(click)="onToggleCollapse(row.task.id); $event.stopPropagation()"
|
|
1805
|
-
[attr.aria-expanded]="!row.task.collapsed"
|
|
1806
|
-
>
|
|
1807
|
-
<span class="k-icon" [class.k-collapsed]="row.task.collapsed">▼</span>
|
|
2204
|
+
<div class="k-gantt-body">
|
|
2205
|
+
<div class="k-gantt-treelist" [style.width.px]="mergedConfig().sidebarWidth">
|
|
2206
|
+
<div class="k-treelist-header" [style.height.px]="mergedConfig().headerHeight">
|
|
2207
|
+
<table class="k-treelist-header-table">
|
|
2208
|
+
<colgroup>
|
|
2209
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <col [style.width.px]="col.width"/> }
|
|
2210
|
+
</colgroup>
|
|
2211
|
+
<thead><tr>
|
|
2212
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <th class="k-header-cell">{{ col.header }}</th> }
|
|
2213
|
+
</tr></thead>
|
|
2214
|
+
</table>
|
|
2215
|
+
</div>
|
|
2216
|
+
<div class="k-treelist-content" #treelistContent>
|
|
2217
|
+
<table class="k-treelist-table">
|
|
2218
|
+
<colgroup>
|
|
2219
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <col [style.width.px]="col.width"/> }
|
|
2220
|
+
</colgroup>
|
|
2221
|
+
<tbody>
|
|
2222
|
+
@for (row of renderedRows(); track row.task.id; let i = $index) {
|
|
2223
|
+
<tr class="k-treelist-row" [class.k-group-header-row]="row.isGroupHeader" [style.height.px]="mergedConfig().rowHeight"
|
|
2224
|
+
[class.k-alt]="i % 2 === 1 && !row.isGroupHeader" [class.k-selected]="isTaskSelected(row.task.id)" [class.k-hover]="hoveredTaskId() === row.task.id"
|
|
2225
|
+
(mouseenter)="hoveredTaskId.set(row.task.id)" (mouseleave)="hoveredTaskId.set(null)" (click)="onRowClick(row.task, $event)">
|
|
2226
|
+
@if (row.isGroupHeader) {
|
|
2227
|
+
<td class="k-treelist-cell k-group-cell" [attr.colspan]="sidebarColumns().length">
|
|
2228
|
+
@if (mergedConfig().collapsible) {
|
|
2229
|
+
<button class="k-collapse-btn" (click)="onToggleGroupCollapse(row.group!); $event.stopPropagation()" [attr.aria-expanded]="row.group!.expanded !== false">
|
|
2230
|
+
<span class="k-icon" [class.k-collapsed]="row.group!.expanded === false">▼</span>
|
|
1808
2231
|
</button>
|
|
1809
|
-
} @else {
|
|
1810
|
-
<span class="k-collapse-spacer"></span>
|
|
1811
2232
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2233
|
+
<span class="k-group-title">{{ row.task.name }}</span>
|
|
2234
|
+
</td>
|
|
2235
|
+
} @else {
|
|
2236
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index; let colIndex = $index) {
|
|
2237
|
+
<td class="k-treelist-cell" [class.k-name-cell]="isNameColumn(col, colIndex)" [class.k-date-cell]="isDateColumn(col)" [class.k-pct-cell]="isProgressColumn(col)">
|
|
2238
|
+
@if (isNameColumn(col, colIndex)) {
|
|
2239
|
+
@if (mergedConfig().tableDraggable && row.task.itemDraggable !== false) {
|
|
2240
|
+
<span class="k-drag-handle" draggable="true" (dragstart)="onTableDragStart($event, row)" (dragend)="onTableDragEnd($event, row)" title="Drag to reorder">⋮⋮</span>
|
|
2241
|
+
}
|
|
2242
|
+
<span class="k-indent" [style.width.px]="row.depth * 20"></span>
|
|
2243
|
+
@if (row.hasChildren && mergedConfig().collapsible) {
|
|
2244
|
+
<button class="k-collapse-btn" (click)="onToggleCollapse(row.task.id); $event.stopPropagation()" [attr.aria-expanded]="!row.task.collapsed">
|
|
2245
|
+
<span class="k-icon" [class.k-collapsed]="row.task.collapsed">▼</span>
|
|
2246
|
+
</button>
|
|
2247
|
+
} @else { <span class="k-collapse-spacer"></span> }
|
|
2248
|
+
@if (row.task.isMilestone) { <span class="k-milestone-icon">◆</span> }
|
|
2249
|
+
<div class="k-name-wrapper">
|
|
2250
|
+
<span class="k-task-name" [class.k-summary-name]="row.hasChildren" [title]="row.task.name">{{ row.task.name }}</span>
|
|
2251
|
+
@if (getUniqueExtraTasks(row).length > 0) {
|
|
2252
|
+
<div class="k-extra-tasks-chips">
|
|
2253
|
+
@for (extra of getUniqueExtraTasks(row); track extra.id) {
|
|
2254
|
+
<span class="k-extra-task-chip" [style.background]="extra.color || '#6c757d'" [title]="extra.name">{{ extra.name.length > 14 ? extra.name.slice(0, 14) + '\u2026' : extra.name }}</span>
|
|
2255
|
+
}
|
|
2256
|
+
</div>
|
|
1827
2257
|
}
|
|
1828
2258
|
</div>
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
} @else {
|
|
1834
|
-
{{ getSidebarCellValue(row, col) }}
|
|
2259
|
+
} @else if (isProgressColumn(col) && row.extraTasks.length > 0) {
|
|
2260
|
+
<span class="k-multi-pct" [title]="getRowProgressTitle(row)">~{{ getRowAvgProgress(row) }}%</span>
|
|
2261
|
+
} @else { {{ getSidebarCellValue(row, col) }} }
|
|
2262
|
+
</td>
|
|
1835
2263
|
}
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
</
|
|
1841
|
-
</table>
|
|
1842
|
-
</div>
|
|
1843
|
-
</div>
|
|
1844
|
-
|
|
1845
|
-
<!-- ===== SPLITBAR ===== -->
|
|
1846
|
-
<div class="k-splitbar" (pointerdown)="onSplitBarDown($event)">
|
|
1847
|
-
<span class="k-splitbar-icon">⋮</span>
|
|
1848
|
-
</div>
|
|
1849
|
-
|
|
1850
|
-
<!-- ===== TIMELINE (Right Panel) ===== -->
|
|
1851
|
-
<div class="k-gantt-timeline">
|
|
1852
|
-
<!-- Timeline Header -->
|
|
1853
|
-
<div class="k-timeline-header" [style.height.px]="mergedConfig().headerHeight">
|
|
1854
|
-
<div class="k-timeline-header-wrap" [style.width.px]="totalWidth()" [style.margin-left.px]="-(scrollLeft())">
|
|
1855
|
-
<!-- Primary header row (months/years) -->
|
|
1856
|
-
<div class="k-header-row k-header-primary">
|
|
1857
|
-
@for (group of primaryHeaderGroups(); track group.label + group.x) {
|
|
1858
|
-
<div
|
|
1859
|
-
class="k-header-group-cell"
|
|
1860
|
-
[style.left.px]="group.x"
|
|
1861
|
-
[style.width.px]="group.width"
|
|
1862
|
-
>
|
|
1863
|
-
{{ group.label }}
|
|
1864
|
-
</div>
|
|
1865
|
-
}
|
|
1866
|
-
</div>
|
|
1867
|
-
<!-- Secondary header row (days/weeks/months) -->
|
|
1868
|
-
<div class="k-header-row k-header-secondary">
|
|
1869
|
-
@for (col of headerColumns(); track col.x) {
|
|
1870
|
-
<div
|
|
1871
|
-
class="k-header-tick-cell"
|
|
1872
|
-
[style.left.px]="col.x"
|
|
1873
|
-
[style.width.px]="col.width"
|
|
1874
|
-
[class.k-weekend]="col.isWeekend"
|
|
1875
|
-
[class.k-today-header]="col.isToday"
|
|
1876
|
-
>
|
|
1877
|
-
{{ col.label }}
|
|
1878
|
-
</div>
|
|
1879
|
-
}
|
|
1880
|
-
</div>
|
|
2264
|
+
}
|
|
2265
|
+
</tr>
|
|
2266
|
+
}
|
|
2267
|
+
</tbody>
|
|
2268
|
+
</table>
|
|
1881
2269
|
</div>
|
|
1882
2270
|
</div>
|
|
1883
2271
|
|
|
1884
|
-
|
|
1885
|
-
<div class="k-timeline-content" #timelineContent (scroll)="onTimelineScroll()">
|
|
1886
|
-
<div class="k-timeline-canvas" [style.width.px]="totalWidth()" [style.height.px]="totalHeight()">
|
|
1887
|
-
|
|
1888
|
-
<!-- Background rows (alternating + hover) -->
|
|
1889
|
-
<div class="k-gantt-rows">
|
|
1890
|
-
@for (row of visibleRows(); track row.task.id; let i = $index) {
|
|
1891
|
-
<div
|
|
1892
|
-
class="k-gantt-row"
|
|
1893
|
-
[style.top.px]="i * mergedConfig().rowHeight"
|
|
1894
|
-
[style.height.px]="mergedConfig().rowHeight"
|
|
1895
|
-
[class.k-alt]="i % 2 === 1"
|
|
1896
|
-
[class.k-hover]="hoveredTaskId() === row.task.id"
|
|
1897
|
-
[class.k-selected]="selectedTaskId() === row.task.id"
|
|
1898
|
-
(mouseenter)="hoveredTaskId.set(row.task.id)"
|
|
1899
|
-
(mouseleave)="hoveredTaskId.set(null)"
|
|
1900
|
-
>
|
|
1901
|
-
</div>
|
|
1902
|
-
}
|
|
1903
|
-
</div>
|
|
2272
|
+
<div class="k-splitbar" (pointerdown)="onSplitBarDown($event)"><span class="k-splitbar-icon">⋮</span></div>
|
|
1904
2273
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
2274
|
+
<div class="k-gantt-timeline">
|
|
2275
|
+
<div class="k-timeline-header" [style.height.px]="mergedConfig().headerHeight">
|
|
2276
|
+
<div class="k-timeline-header-wrap" [style.width.px]="totalWidth()" [style.margin-left.px]="-(scrollLeft())">
|
|
2277
|
+
<div class="k-header-row k-header-primary">
|
|
2278
|
+
@for (group of primaryHeaderGroups(); track group.label + group.x) {
|
|
2279
|
+
<div class="k-header-group-cell" [style.left.px]="group.x" [style.width.px]="group.width">{{ group.label }}</div>
|
|
2280
|
+
}
|
|
2281
|
+
</div>
|
|
2282
|
+
<div class="k-header-row k-header-secondary">
|
|
1908
2283
|
@for (col of headerColumns(); track col.x) {
|
|
1909
|
-
<div
|
|
1910
|
-
class="k-gantt-column"
|
|
1911
|
-
[style.left.px]="col.x"
|
|
1912
|
-
[style.width.px]="col.width"
|
|
1913
|
-
[style.height.px]="totalHeight()"
|
|
1914
|
-
[class.k-weekend-col]="col.isWeekend"
|
|
1915
|
-
>
|
|
1916
|
-
</div>
|
|
2284
|
+
<div class="k-header-tick-cell" [style.left.px]="col.x" [style.width.px]="col.width" [class.k-weekend]="col.isWeekend" [class.k-today-header]="col.isToday">{{ col.label }}</div>
|
|
1917
2285
|
}
|
|
1918
2286
|
</div>
|
|
1919
|
-
|
|
2287
|
+
</div>
|
|
2288
|
+
</div>
|
|
1920
2289
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
<div
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2290
|
+
<div class="k-timeline-content" #timelineContent (scroll)="onTimelineScroll()">
|
|
2291
|
+
<div class="k-timeline-canvas" [style.width.px]="totalWidth()" [style.height.px]="totalHeight()">
|
|
2292
|
+
<div class="k-gantt-rows">
|
|
2293
|
+
@for (row of renderedRows(); track row.task.id; let i = $index) {
|
|
2294
|
+
<div class="k-gantt-row" [class.k-group-row]="row.isGroupHeader" [style.top.px]="i * mergedConfig().rowHeight" [style.height.px]="mergedConfig().rowHeight"
|
|
2295
|
+
[class.k-alt]="i % 2 === 1 && !row.isGroupHeader" [class.k-hover]="hoveredTaskId() === row.task.id" [class.k-selected]="isTaskSelected(row.task.id)"
|
|
2296
|
+
(mouseenter)="hoveredTaskId.set(row.task.id)" (mouseleave)="hoveredTaskId.set(null)"
|
|
2297
|
+
(dragover)="mergedConfig().tableDraggable ? onTableDragOver($event, row) : null" (drop)="mergedConfig().tableDraggable ? onTableDrop($event, row) : null">
|
|
2298
|
+
</div>
|
|
2299
|
+
}
|
|
1929
2300
|
</div>
|
|
1930
|
-
}
|
|
1931
2301
|
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
class="k-task-wrap"
|
|
1937
|
-
[style.top.px]="bar.top"
|
|
1938
|
-
[style.height.px]="mergedConfig().rowHeight"
|
|
1939
|
-
>
|
|
1940
|
-
@if (bar.task.isMilestone) {
|
|
1941
|
-
<!-- Milestone diamond -->
|
|
1942
|
-
<div
|
|
1943
|
-
class="k-milestone"
|
|
1944
|
-
[style.left.px]="bar.left - 8"
|
|
1945
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
1946
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
1947
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
1948
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
1949
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
1950
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
1951
|
-
tabindex="0"
|
|
1952
|
-
[attr.aria-label]="'Milestone: ' + bar.task.name"
|
|
1953
|
-
>
|
|
1954
|
-
<div class="k-milestone-diamond" [style.background]="bar.task.color || '#e74c3c'"></div>
|
|
1955
|
-
</div>
|
|
1956
|
-
} @else if (bar.isSummary) {
|
|
1957
|
-
<!-- Summary bar (parent task) -->
|
|
1958
|
-
<div
|
|
1959
|
-
class="k-task-summary"
|
|
1960
|
-
[style.left.px]="bar.left"
|
|
1961
|
-
[style.width.px]="bar.width"
|
|
1962
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
1963
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
1964
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
1965
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
1966
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
1967
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
1968
|
-
tabindex="0"
|
|
1969
|
-
[attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'"
|
|
1970
|
-
>
|
|
1971
|
-
<div class="k-summary-bar" [style.background]="'#495057'">
|
|
1972
|
-
<div class="k-summary-progress" [style.width.%]="bar.task.progress" [style.background]="'#343a40'"></div>
|
|
1973
|
-
</div>
|
|
1974
|
-
<div class="k-summary-left-cap"></div>
|
|
1975
|
-
<div class="k-summary-right-cap"></div>
|
|
1976
|
-
</div>
|
|
1977
|
-
} @else if (bar.task.subtasks && bar.task.subtasks.length > 0) {
|
|
1978
|
-
<!-- Task bar with subtask segments -->
|
|
1979
|
-
<div
|
|
1980
|
-
class="k-task k-task-with-subtasks"
|
|
1981
|
-
[style.left.px]="bar.left"
|
|
1982
|
-
[style.width.px]="bar.width"
|
|
1983
|
-
[style.background]="bar.task.color || '#e9ecef'"
|
|
1984
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
1985
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
1986
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId)"
|
|
1987
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
1988
|
-
(pointerdown)="onBarPointerDown($event, bar.task, 'move')"
|
|
1989
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
1990
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
1991
|
-
tabindex="0"
|
|
1992
|
-
role="img"
|
|
1993
|
-
[attr.aria-label]="bar.task.name + ' with ' + bar.task.subtasks.length + ' subtasks'"
|
|
1994
|
-
>
|
|
1995
|
-
@for (sub of getSubtaskBars(bar); track sub.subtask.id) {
|
|
1996
|
-
<div
|
|
1997
|
-
class="k-subtask-segment"
|
|
1998
|
-
[style.left.px]="sub.left"
|
|
1999
|
-
[style.width.px]="sub.width"
|
|
2000
|
-
[style.background]="sub.subtask.color"
|
|
2001
|
-
[title]="sub.subtask.name + (sub.subtask.description ? ': ' + sub.subtask.description : '')"
|
|
2002
|
-
(mouseenter)="showSubtaskTooltip(bar.task, sub.subtask, $event); $event.stopPropagation()"
|
|
2003
|
-
(mouseleave)="hideTooltip()"
|
|
2004
|
-
>
|
|
2005
|
-
@if (sub.width > 40) {
|
|
2006
|
-
<span class="k-subtask-text">{{ sub.subtask.name }}</span>
|
|
2007
|
-
}
|
|
2008
|
-
@if (sub.subtask.progress != null) {
|
|
2009
|
-
<div class="k-subtask-progress" [style.width.%]="sub.subtask.progress"></div>
|
|
2010
|
-
}
|
|
2011
|
-
</div>
|
|
2012
|
-
}
|
|
2013
|
-
<!-- Resize handles -->
|
|
2014
|
-
@if (bar.task.draggable !== false) {
|
|
2015
|
-
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2016
|
-
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2017
|
-
}
|
|
2018
|
-
</div>
|
|
2019
|
-
} @else {
|
|
2020
|
-
<!-- Regular task bar -->
|
|
2021
|
-
<div
|
|
2022
|
-
class="k-task"
|
|
2023
|
-
[style.left.px]="bar.left"
|
|
2024
|
-
[style.width.px]="bar.width"
|
|
2025
|
-
[style.background]="bar.task.color || '#4a90d9'"
|
|
2026
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
2027
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
2028
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
2029
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2030
|
-
(pointerdown)="onBarPointerDown($event, bar.task, 'move')"
|
|
2031
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
2032
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2033
|
-
tabindex="0"
|
|
2034
|
-
role="img"
|
|
2035
|
-
[attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'"
|
|
2036
|
-
>
|
|
2037
|
-
<!-- Progress fill -->
|
|
2038
|
-
<div class="k-task-progress" [style.width.%]="bar.task.progress">
|
|
2039
|
-
<div class="k-task-progress-inner" [style.background]="'#2d6cb4'"></div>
|
|
2040
|
-
</div>
|
|
2041
|
-
<!-- Task text -->
|
|
2042
|
-
<span class="k-task-text" [style.color]="'#ffffff'">{{ bar.task.name }}</span>
|
|
2043
|
-
<!-- Resize handles -->
|
|
2044
|
-
@if (bar.task.draggable !== false) {
|
|
2045
|
-
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2046
|
-
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2047
|
-
}
|
|
2048
|
-
</div>
|
|
2302
|
+
@if (mergedConfig().showGrid) {
|
|
2303
|
+
<div class="k-gantt-columns">
|
|
2304
|
+
@for (col of headerColumns(); track col.x) {
|
|
2305
|
+
<div class="k-gantt-column" [style.left.px]="col.x" [style.width.px]="col.width" [style.height.px]="totalHeight()" [class.k-weekend-col]="col.isWeekend"></div>
|
|
2049
2306
|
}
|
|
2050
2307
|
</div>
|
|
2051
2308
|
}
|
|
2052
|
-
</div>
|
|
2053
2309
|
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
[attr.d]="dep.path"
|
|
2065
|
-
[attr.stroke]="dep.dependency.color || '#ff6358'"
|
|
2066
|
-
marker-end="url(#k-arrowhead)"
|
|
2067
|
-
(click)="onDependencyClick(dep.dependency, $event)"
|
|
2068
|
-
/>
|
|
2310
|
+
@if (mergedConfig().showTodayMarker && todayX() !== null) {
|
|
2311
|
+
<div class="k-today-marker" [style.left.px]="todayX()" [style.height.px]="totalHeight()"><div class="k-today-indicator"></div></div>
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
@if (mergedConfig().showBaseline && baselineItems().length > 0) {
|
|
2315
|
+
<div class="k-gantt-baselines">
|
|
2316
|
+
@for (bl of baselineBars(); track bl.id) {
|
|
2317
|
+
<div class="k-baseline-bar" [style.top.px]="bl.top" [style.left.px]="bl.left" [style.width.px]="bl.width" [style.height.px]="mergedConfig().barHeight"></div>
|
|
2318
|
+
}
|
|
2319
|
+
</div>
|
|
2069
2320
|
}
|
|
2070
|
-
</svg>
|
|
2071
2321
|
|
|
2322
|
+
<div class="k-gantt-tasks">
|
|
2323
|
+
@for (bar of taskBars(); track bar.task.id) {
|
|
2324
|
+
<div class="k-task-wrap" [style.top.px]="bar.top" [style.height.px]="mergedConfig().rowHeight" [class]="bar.task.cssClass || ''">
|
|
2325
|
+
@if (bar.isGroupHeader) {
|
|
2326
|
+
} @else if (bar.task.isMilestone) {
|
|
2327
|
+
<div class="k-milestone" [style.left.px]="bar.left - 8" [class.k-focused]="keyboardService.focusedTaskId() === bar.task.id" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2328
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2329
|
+
(click)="onTaskBarClick(bar.task, $event)" (dblclick)="onTaskBarDblClick(bar.task, $event)" tabindex="0" [attr.aria-label]="'Milestone: ' + bar.task.name">
|
|
2330
|
+
<div class="k-milestone-diamond" [style.background]="bar.task.color || '#e74c3c'"></div>
|
|
2331
|
+
</div>
|
|
2332
|
+
} @else if (bar.task.type === 'range') {
|
|
2333
|
+
<div class="k-task k-task-range" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || '#ff9f73'"
|
|
2334
|
+
[class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2335
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2336
|
+
(click)="onTaskBarClick(bar.task, $event)" tabindex="0" [attr.aria-label]="bar.task.name">
|
|
2337
|
+
<span class="k-task-text">{{ bar.task.name }}</span>
|
|
2338
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2339
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2340
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2341
|
+
}
|
|
2342
|
+
</div>
|
|
2343
|
+
} @else if (bar.isSummary) {
|
|
2344
|
+
<div class="k-task-summary" [style.left.px]="bar.left" [style.width.px]="bar.width" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2345
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2346
|
+
(click)="onTaskBarClick(bar.task, $event)" tabindex="0">
|
|
2347
|
+
<div class="k-summary-bar"><div class="k-summary-progress" [style.width.%]="bar.task.progress"></div></div>
|
|
2348
|
+
<div class="k-summary-left-cap"></div><div class="k-summary-right-cap"></div>
|
|
2349
|
+
</div>
|
|
2350
|
+
} @else if (bar.task.subtasks && bar.task.subtasks.length > 0) {
|
|
2351
|
+
<div class="k-task k-task-with-subtasks" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || '#e9ecef'"
|
|
2352
|
+
[class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2353
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2354
|
+
(pointerdown)="onBarPointerDown($event, bar.task, 'move')" (click)="onTaskBarClick(bar.task, $event)"
|
|
2355
|
+
tabindex="0" role="img" [attr.aria-label]="bar.task.name + ' with ' + bar.task.subtasks.length + ' subtasks'">
|
|
2356
|
+
@for (sub of getSubtaskBars(bar); track sub.subtask.id) {
|
|
2357
|
+
<div class="k-subtask-segment" [class]="sub.subtask.cssClass || ''" [style.left.px]="sub.left" [style.width.px]="sub.width" [style.background]="sub.subtask.color"
|
|
2358
|
+
[title]="sub.subtask.name"
|
|
2359
|
+
(mouseenter)="showSubtaskTooltip(bar.task, sub.subtask, $event); $event.stopPropagation()" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hideTooltip()">
|
|
2360
|
+
@if (sub.width > 40) { <span class="k-subtask-text">{{ sub.subtask.name }}</span> }
|
|
2361
|
+
@if (sub.subtask.progress != null) { <div class="k-subtask-progress" [style.width.%]="sub.subtask.progress"></div> }
|
|
2362
|
+
</div>
|
|
2363
|
+
}
|
|
2364
|
+
@if (bar.task.draggable !== false) {
|
|
2365
|
+
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2366
|
+
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2367
|
+
}
|
|
2368
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2369
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2370
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2371
|
+
}
|
|
2372
|
+
</div>
|
|
2373
|
+
} @else {
|
|
2374
|
+
<div class="k-task" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || 'var(--k-primary, #4a90d9)'"
|
|
2375
|
+
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2376
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2377
|
+
(pointerdown)="onBarPointerDown($event, bar.task, 'move')" (click)="onTaskBarClick(bar.task, $event)" (dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2378
|
+
tabindex="0" role="img" [attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'">
|
|
2379
|
+
<div class="k-task-progress" [style.width.%]="bar.task.progress"><div class="k-task-progress-inner"></div></div>
|
|
2380
|
+
<span class="k-task-text">{{ bar.task.name }}</span>
|
|
2381
|
+
@if (bar.task.draggable !== false) {
|
|
2382
|
+
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2383
|
+
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2384
|
+
}
|
|
2385
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2386
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2387
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2388
|
+
}
|
|
2389
|
+
</div>
|
|
2390
|
+
}
|
|
2391
|
+
</div>
|
|
2392
|
+
}
|
|
2393
|
+
</div>
|
|
2394
|
+
|
|
2395
|
+
<svg class="k-gantt-dependencies" [attr.width]="totalWidth()" [attr.height]="totalHeight()">
|
|
2396
|
+
<defs>
|
|
2397
|
+
@if (mergedConfig().linkOptions.showArrow !== false) {
|
|
2398
|
+
<marker id="k-arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
|
|
2399
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="var(--k-danger, #ff6358)"/>
|
|
2400
|
+
</marker>
|
|
2401
|
+
}
|
|
2402
|
+
</defs>
|
|
2403
|
+
@for (dep of dependencyPaths(); track dep.key) {
|
|
2404
|
+
<path class="k-dep-line" [attr.d]="dep.path" [attr.stroke]="dep.color"
|
|
2405
|
+
[attr.marker-end]="mergedConfig().linkOptions.showArrow !== false ? 'url(#k-arrowhead)' : null"
|
|
2406
|
+
[class]="dep.dependency.cssClass || ''" (click)="onDependencyClick(dep.dependency, $event)"/>
|
|
2407
|
+
}
|
|
2408
|
+
@if (linkDragLine()) {
|
|
2409
|
+
<line class="k-link-drag-line" [attr.x1]="linkDragLine()!.x1" [attr.y1]="linkDragLine()!.y1" [attr.x2]="linkDragLine()!.x2" [attr.y2]="linkDragLine()!.y2"
|
|
2410
|
+
stroke="#ff6358" stroke-width="2" stroke-dasharray="4 3"/>
|
|
2411
|
+
}
|
|
2412
|
+
</svg>
|
|
2413
|
+
</div>
|
|
2072
2414
|
</div>
|
|
2073
2415
|
</div>
|
|
2074
2416
|
</div>
|
|
2417
|
+
|
|
2418
|
+
@if (showLoading()) {
|
|
2419
|
+
<div class="k-loading-overlay"><div class="k-loading-spinner"><div class="k-spinner-circle"></div><span class="k-loading-text">Loading\u2026</span></div></div>
|
|
2420
|
+
}
|
|
2075
2421
|
</div>
|
|
2076
2422
|
|
|
2077
|
-
<!-- ===== TASK TOOLTIP ===== -->
|
|
2078
2423
|
@if (tooltipTask()) {
|
|
2079
|
-
<div
|
|
2080
|
-
class="k-bar-tooltip"
|
|
2081
|
-
[style.left.px]="tooltipX()"
|
|
2082
|
-
[style.top.px]="tooltipY()"
|
|
2083
|
-
>
|
|
2424
|
+
<div class="k-bar-tooltip" [style.left.px]="tooltipX()" [style.top.px]="tooltipY()">
|
|
2084
2425
|
<div class="k-bar-tooltip-title">{{ tooltipTask()!.name }}</div>
|
|
2085
2426
|
@if (tooltipSubtask()) {
|
|
2086
|
-
<div class="k-bar-tooltip-row">
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
</div>
|
|
2090
|
-
@if (tooltipSubtask()!.description) {
|
|
2091
|
-
<div class="k-bar-tooltip-row">
|
|
2092
|
-
<span class="k-bar-tooltip-label">Description</span>
|
|
2093
|
-
<span class="k-bar-tooltip-value">{{ tooltipSubtask()!.description }}</span>
|
|
2094
|
-
</div>
|
|
2095
|
-
}
|
|
2096
|
-
<div class="k-bar-tooltip-row">
|
|
2097
|
-
<span class="k-bar-tooltip-label">Start</span>
|
|
2098
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.start) }}</span>
|
|
2099
|
-
</div>
|
|
2100
|
-
<div class="k-bar-tooltip-row">
|
|
2101
|
-
<span class="k-bar-tooltip-label">End</span>
|
|
2102
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.end) }}</span>
|
|
2103
|
-
</div>
|
|
2104
|
-
@if (tooltipSubtask()!.progress != null) {
|
|
2105
|
-
<div class="k-bar-tooltip-row">
|
|
2106
|
-
<span class="k-bar-tooltip-label">Progress</span>
|
|
2107
|
-
<span class="k-bar-tooltip-value">{{ tooltipSubtask()!.progress }}%</span>
|
|
2108
|
-
</div>
|
|
2109
|
-
}
|
|
2110
|
-
@for (entry of getMetaEntries(tooltipSubtask()!.meta); track entry.key) {
|
|
2111
|
-
<div class="k-bar-tooltip-row">
|
|
2112
|
-
<span class="k-bar-tooltip-label">{{ entry.key }}</span>
|
|
2113
|
-
<span class="k-bar-tooltip-value">{{ entry.value }}</span>
|
|
2114
|
-
</div>
|
|
2115
|
-
}
|
|
2427
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Subtask</span><span class="k-bar-tooltip-value">{{ tooltipSubtask()!.name }}</span></div>
|
|
2428
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Start</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.start) }}</span></div>
|
|
2429
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">End</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.end) }}</span></div>
|
|
2430
|
+
@if (tooltipSubtask()!.progress != null) { <div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Progress</span><span class="k-bar-tooltip-value">{{ tooltipSubtask()!.progress }}%</span></div> }
|
|
2116
2431
|
} @else {
|
|
2117
|
-
<div class="k-bar-tooltip-row">
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
</div>
|
|
2121
|
-
<div class="k-bar-tooltip-row">
|
|
2122
|
-
<span class="k-bar-tooltip-label">End</span>
|
|
2123
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.end) }}</span>
|
|
2124
|
-
</div>
|
|
2125
|
-
<div class="k-bar-tooltip-row">
|
|
2126
|
-
<span class="k-bar-tooltip-label">Progress</span>
|
|
2127
|
-
<span class="k-bar-tooltip-value">{{ tooltipTask()!.progress }}%</span>
|
|
2128
|
-
</div>
|
|
2129
|
-
@for (entry of getMetaEntries(tooltipTask()!.meta); track entry.key) {
|
|
2130
|
-
<div class="k-bar-tooltip-row">
|
|
2131
|
-
<span class="k-bar-tooltip-label">{{ entry.key }}</span>
|
|
2132
|
-
<span class="k-bar-tooltip-value">{{ entry.value }}</span>
|
|
2133
|
-
</div>
|
|
2134
|
-
}
|
|
2135
|
-
@if (tooltipTask()!.subtasks && tooltipTask()!.subtasks!.length > 0) {
|
|
2136
|
-
<div class="k-bar-tooltip-divider"></div>
|
|
2137
|
-
<div class="k-bar-tooltip-label" style="margin-top: 6px;">Subtasks</div>
|
|
2138
|
-
@for (sub of tooltipTask()!.subtasks!; track sub.id) {
|
|
2139
|
-
<div class="k-row-tooltip-task">
|
|
2140
|
-
<span class="k-row-tooltip-dot" [style.background]="sub.color"></span>
|
|
2141
|
-
<span class="k-row-tooltip-name">{{ sub.name }}</span>
|
|
2142
|
-
@if (sub.description) {
|
|
2143
|
-
<span class="k-bar-tooltip-label">{{ sub.description }}</span>
|
|
2144
|
-
}
|
|
2145
|
-
</div>
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2432
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Start</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.start) }}</span></div>
|
|
2433
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">End</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.end) }}</span></div>
|
|
2434
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Progress</span><span class="k-bar-tooltip-value">{{ tooltipTask()!.progress }}%</span></div>
|
|
2148
2435
|
}
|
|
2149
2436
|
</div>
|
|
2150
2437
|
}
|
|
2151
2438
|
|
|
2152
|
-
<!-- ===== ROW TOOLTIP (multi-task rows) ===== -->
|
|
2153
2439
|
@if (rowTooltipData()) {
|
|
2154
|
-
<div
|
|
2155
|
-
class="k-bar-tooltip k-row-tooltip"
|
|
2156
|
-
[style.left.px]="rowTooltipX()"
|
|
2157
|
-
[style.top.px]="rowTooltipY()"
|
|
2158
|
-
>
|
|
2440
|
+
<div class="k-bar-tooltip k-row-tooltip" [style.left.px]="rowTooltipX()" [style.top.px]="rowTooltipY()">
|
|
2159
2441
|
<div class="k-bar-tooltip-title">Tasks in this row</div>
|
|
2160
2442
|
@for (t of rowTooltipData()!.allTasks; track t.id) {
|
|
2161
2443
|
<div class="k-row-tooltip-task">
|
|
2162
2444
|
<span class="k-row-tooltip-dot" [style.background]="t.color || '#4a90d9'"></span>
|
|
2163
2445
|
<span class="k-row-tooltip-name">{{ t.name }}</span>
|
|
2164
|
-
<span class="k-bar-tooltip-label">{{ formatDateShort(t.start) }}–{{ formatDateShort(t.end) }}</span>
|
|
2165
2446
|
<span class="k-bar-tooltip-value">{{ t.progress }}%</span>
|
|
2166
2447
|
</div>
|
|
2167
2448
|
}
|
|
2168
2449
|
</div>
|
|
2169
2450
|
}
|
|
2170
|
-
`, isInline: true, styles: [":host{display:block;height:100%;min-height:var(--ngx-gantt-min-height, 420px)}.k-gantt{display:flex;height:100%;min-height:inherit;width:100%;background:var(--ngx-gantt-bg, #ffffff);border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;font-family:var(--ngx-gantt-font, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);font-size:var(--ngx-gantt-font-size, 13px);color:var(--ngx-gantt-text, #212529);overflow:hidden;position:relative}.k-gantt-treelist{display:flex;flex-direction:column;flex-shrink:0;border-right:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;background:var(--ngx-gantt-bg, #ffffff)}.k-treelist-header{flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;display:flex;align-items:flex-end}.k-treelist-header-table,.k-treelist-table{width:100%;border-collapse:collapse;table-layout:fixed}.k-header-cell{padding:8px;text-align:left;font-size:var(--ngx-gantt-header-font-size, 12px);font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-header-cell:last-child{border-right:none;text-align:center}.k-treelist-content{flex:1;overflow-y:auto;overflow-x:hidden}.k-treelist-row{cursor:default;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-treelist-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-treelist-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-treelist-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-treelist-cell{padding:0 8px;height:100%;vertical-align:middle;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-treelist-cell:last-child{border-right:none}.k-name-cell{display:flex;align-items:center;gap:0}.k-indent{display:inline-block;flex-shrink:0}.k-name-wrapper{display:flex;flex-direction:column;min-width:0;justify-content:center;gap:2px;overflow:hidden}.k-extra-tasks-chips{display:flex;flex-wrap:wrap;gap:3px}.k-extra-task-chip{display:inline-flex;align-items:center;padding:0 5px;height:14px;border-radius:7px;font-size:10px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px;opacity:.9;font-weight:500;letter-spacing:.01em}.k-multi-pct{cursor:help}.k-collapse-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:var(--ngx-gantt-text-secondary, #6c757d);border-radius:3px}.k-collapse-btn:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-icon{font-size:8px;transition:transform .15s ease;display:inline-block}.k-icon.k-collapsed{transform:rotate(-90deg)}.k-collapse-spacer{display:inline-block;width:20px;flex-shrink:0}.k-milestone-icon{color:var(--ngx-gantt-milestone-color, #e74c3c);margin-right:4px;font-size:10px;flex-shrink:0}.k-task-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-summary-name{font-weight:600}.k-date-cell{font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);text-align:center}.k-pct-cell{font-size:11px;text-align:center;font-weight:500}.k-splitbar{width:7px;flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-left:1px solid var(--ngx-gantt-border, #dee2e6);border-right:1px solid var(--ngx-gantt-border, #dee2e6);cursor:col-resize;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;z-index:2}.k-splitbar:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-splitbar-icon{color:var(--ngx-gantt-text-secondary, #6c757d);font-size:14px;line-height:1}.k-gantt-timeline{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}.k-timeline-header{flex-shrink:0;overflow:hidden;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-timeline-header-wrap{position:relative;display:flex;flex-direction:column;height:100%}.k-header-row{position:relative;flex:1}.k-header-primary{border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-header-group-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:var(--ngx-gantt-header-font-size, 12px);font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;box-sizing:border-box}.k-header-tick-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;box-sizing:border-box}.k-header-tick-cell.k-weekend{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02));color:#adb5bd}.k-header-tick-cell.k-today-header{color:var(--ngx-gantt-today-color, #ff6358);font-weight:700}.k-timeline-content{flex:1;overflow:auto}.k-timeline-canvas{position:relative}.k-gantt-rows{position:absolute;top:0;left:0;right:0}.k-gantt-row{position:absolute;left:0;right:0;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-gantt-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-gantt-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-gantt-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-gantt-columns{position:absolute;top:0;left:0}.k-gantt-column{position:absolute;top:0;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);box-sizing:border-box}.k-gantt-column.k-weekend-col{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02))}.k-today-marker{position:absolute;top:0;width:2px;background:var(--ngx-gantt-today-color, #ff6358);z-index:3;pointer-events:none}.k-today-indicator{position:absolute;top:-1px;left:-5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid var(--ngx-gantt-today-color, #ff6358)}.k-gantt-tasks{position:absolute;top:0;left:0;z-index:2}.k-task-wrap{position:absolute;left:0;right:0;display:flex;align-items:center;pointer-events:none}.k-task{position:absolute;height:var(--ngx-gantt-bar-height, 24px);background:var(--ngx-gantt-bar-bg, #4a90d9);border-radius:4px;cursor:grab;pointer-events:all;display:flex;align-items:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease;-webkit-user-select:none;user-select:none}.k-task:hover{box-shadow:0 3px 8px #0000002e,0 1px 3px #0000001a}.k-task:active{cursor:grabbing}.k-task.k-focused{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:2px}.k-task.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:1px}.k-task-progress{position:absolute;top:0;left:0;height:100%;overflow:hidden;border-radius:4px 0 0 4px}.k-task-progress-inner{width:10000px;height:100%;background:var(--ngx-gantt-bar-progress-bg, #2d6cb4)}.k-task-text{position:relative;z-index:1;padding:0 8px;color:var(--ngx-gantt-bar-text, #ffffff);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.15)}.k-resize-handle{position:absolute;top:0;width:6px;height:100%;cursor:col-resize;pointer-events:all;z-index:2}.k-resize-w{left:0}.k-resize-e{right:0}.k-resize-handle:hover{background:#ffffff40}.k-task-with-subtasks{overflow:hidden;box-shadow:none}.k-task-with-subtasks:hover{box-shadow:none}.k-task-with-subtasks.k-dragging{background:#0000000f!important;border:1px dashed rgba(0,0,0,.2);border-radius:4px}.k-task-with-subtasks.k-dragging .k-subtask-segment{pointer-events:none;transition:none}.k-subtask-segment{position:absolute;top:0;height:100%;border-radius:4px;display:flex;align-items:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease,transform .1s ease;cursor:pointer;pointer-events:all;min-width:4px}.k-subtask-segment:hover{box-shadow:0 3px 8px #00000038,0 1px 3px #0000001f;transform:scaleY(1.08);z-index:1}.k-subtask-text{position:relative;z-index:1;padding:0 6px;color:#fff;font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.2)}.k-subtask-progress{position:absolute;top:0;left:0;height:100%;background:#00000026;border-radius:4px 0 0 4px;pointer-events:none}.k-bar-tooltip-divider{height:1px;background:#ffffff26;margin:6px 0}.k-task-summary{position:absolute;height:10px;pointer-events:all;cursor:pointer;display:flex;align-items:flex-end}.k-task-summary.k-focused,.k-task-summary.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:3px;border-radius:2px}.k-summary-bar{position:relative;width:100%;height:6px;background:var(--ngx-gantt-summary-color, #495057);border-radius:0}.k-summary-progress{height:100%;background:#343a40}.k-summary-left-cap,.k-summary-right-cap{position:absolute;bottom:0;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(--ngx-gantt-summary-color, #495057)}.k-summary-left-cap{left:-1px}.k-summary-right-cap{right:-1px}.k-milestone{position:absolute;pointer-events:all;cursor:pointer}.k-milestone.k-focused,.k-milestone.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:4px;border-radius:2px}.k-milestone-diamond{width:16px;height:16px;background:var(--ngx-gantt-milestone-color, #e74c3c);transform:rotate(45deg);border-radius:2px;box-shadow:0 1px 3px #00000026}.k-gantt-dependencies{position:absolute;top:0;left:0;z-index:1;pointer-events:none}.k-dep-line{fill:none;stroke:var(--ngx-gantt-arrow-color, #ff6358);stroke-width:1.5;pointer-events:stroke;cursor:pointer}.k-dep-line:hover{stroke-width:3}@keyframes k-tooltip-fadein{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.k-bar-tooltip{position:fixed;z-index:9999;background:var(--ngx-gantt-tooltip-bg, #2d3748);color:var(--ngx-gantt-tooltip-text, #ffffff);border-radius:6px;padding:10px 14px;min-width:180px;box-shadow:0 4px 16px #00000038;pointer-events:none;font-size:12px;line-height:1.5;animation:k-tooltip-fadein .15s ease}.k-bar-tooltip-title{font-weight:700;font-size:13px;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.k-bar-tooltip-row{display:flex;justify-content:space-between;gap:12px;margin-top:3px}.k-bar-tooltip-label{color:var(--ngx-gantt-tooltip-label, rgba(255,255,255,.65));white-space:nowrap}.k-bar-tooltip-value{font-weight:500;white-space:nowrap}.k-row-tooltip{min-width:240px}.k-row-tooltip-task{display:flex;align-items:center;gap:6px;margin-top:5px;padding-top:5px;border-top:1px solid rgba(255,255,255,.12)}.k-row-tooltip-task:first-of-type{border-top:none}.k-row-tooltip-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.k-row-tooltip-name{flex:1;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-gantt.k-no-grid .k-header-cell,.k-gantt.k-no-grid .k-treelist-cell,.k-gantt.k-no-grid .k-treelist-row,.k-gantt.k-no-grid .k-header-group-cell,.k-gantt.k-no-grid .k-header-tick-cell,.k-gantt.k-no-grid .k-gantt-row,.k-gantt.k-no-grid .k-gantt-column{border:none!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2451
|
+
`, isInline: true, styles: [":host{display:block;height:100%;min-height:var(--ngx-gantt-min-height, 420px);position:relative}.k-gantt{display:flex;flex-direction:column;height:100%;min-height:inherit;width:100%;background:var(--ngx-gantt-bg, #ffffff);border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;font-family:var(--ngx-gantt-font, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);font-size:var(--ngx-gantt-font-size, 13px);color:var(--ngx-gantt-text, #212529);overflow:hidden;position:relative}.k-gantt-body{display:flex;flex:1;min-height:0;overflow:hidden}.k-gantt-toolbar{display:flex;align-items:center;gap:12px;padding:8px 12px;border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);background:var(--ngx-gantt-header-bg, #f1f3f5);flex-shrink:0}.k-toolbar-group{display:flex;gap:4px}.k-toolbar-btn{padding:4px 12px;border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;background:var(--ngx-gantt-bg, #fff);color:var(--ngx-gantt-text, #212529);font-size:12px;cursor:pointer;font-family:inherit;transition:all .12s}.k-toolbar-btn:hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)}.k-toolbar-btn.k-active{background:var(--k-primary, #4a90d9);color:#fff;border-color:var(--k-primary, #4a90d9)}.k-gantt-treelist{display:flex;flex-direction:column;flex-shrink:0;border-right:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;background:var(--ngx-gantt-bg, #ffffff)}.k-treelist-header{flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;display:flex;align-items:flex-end}.k-treelist-header-table,.k-treelist-table{width:100%;border-collapse:collapse;table-layout:fixed}.k-header-cell{padding:8px;text-align:left;font-size:12px;font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-header-cell:last-child{border-right:none;text-align:center}.k-treelist-content{flex:1;overflow-y:auto;overflow-x:hidden}.k-treelist-row{cursor:default;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-treelist-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-treelist-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-treelist-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-treelist-cell{padding:0 8px;height:100%;vertical-align:middle;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-treelist-cell:last-child{border-right:none}.k-group-header-row{background:var(--ngx-gantt-header-bg, #f1f3f5)!important;font-weight:600}.k-group-cell{display:flex;align-items:center;gap:4px}.k-group-title{font-size:13px;font-weight:700}.k-group-row{background:var(--ngx-gantt-header-bg, #f1f3f5)!important}.k-name-cell{display:flex;align-items:center;gap:0}.k-indent{display:inline-block;flex-shrink:0}.k-name-wrapper{display:flex;flex-direction:column;min-width:0;justify-content:center;gap:2px;overflow:hidden}.k-extra-tasks-chips{display:flex;flex-wrap:wrap;gap:3px}.k-extra-task-chip{display:inline-flex;align-items:center;padding:0 5px;height:14px;border-radius:7px;font-size:10px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px;opacity:.9;font-weight:500}.k-multi-pct{cursor:help}.k-drag-handle{cursor:grab;color:var(--ngx-gantt-text-secondary, #6c757d);font-size:12px;padding:0 4px;flex-shrink:0;opacity:.5;-webkit-user-select:none;user-select:none}.k-drag-handle:hover{opacity:1}.k-collapse-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:var(--ngx-gantt-text-secondary, #6c757d);border-radius:3px}.k-collapse-btn:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-icon{font-size:8px;transition:transform .15s ease;display:inline-block}.k-icon.k-collapsed{transform:rotate(-90deg)}.k-collapse-spacer{display:inline-block;width:20px;flex-shrink:0}.k-milestone-icon{color:var(--ngx-gantt-milestone-color, #e74c3c);margin-right:4px;font-size:10px;flex-shrink:0}.k-task-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-summary-name{font-weight:600}.k-date-cell{font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);text-align:center}.k-pct-cell{font-size:11px;text-align:center;font-weight:500}.k-splitbar{width:7px;flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-left:1px solid var(--ngx-gantt-border, #dee2e6);border-right:1px solid var(--ngx-gantt-border, #dee2e6);cursor:col-resize;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;z-index:2}.k-splitbar:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-splitbar-icon{color:var(--ngx-gantt-text-secondary, #6c757d);font-size:14px;line-height:1}.k-gantt-timeline{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}.k-timeline-header{flex-shrink:0;overflow:hidden;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-timeline-header-wrap{position:relative;display:flex;flex-direction:column;height:100%}.k-header-row{position:relative;flex:1}.k-header-primary{border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-header-group-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;box-sizing:border-box}.k-header-tick-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;box-sizing:border-box}.k-header-tick-cell.k-weekend{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02));color:#adb5bd}.k-header-tick-cell.k-today-header{color:var(--k-danger, #ff6358);font-weight:700}.k-timeline-content{flex:1;overflow:auto}.k-timeline-canvas{position:relative}.k-gantt-rows{position:absolute;top:0;left:0;right:0}.k-gantt-row{position:absolute;left:0;right:0;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-gantt-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-gantt-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-gantt-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-gantt-columns{position:absolute;top:0;left:0}.k-gantt-column{position:absolute;top:0;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);box-sizing:border-box}.k-gantt-column.k-weekend-col{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02))}.k-today-marker{position:absolute;top:0;width:2px;background:var(--k-danger, #ff6358);z-index:3;pointer-events:none}.k-today-indicator{position:absolute;top:-1px;left:-5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid var(--k-danger, #ff6358)}.k-gantt-baselines{position:absolute;top:0;left:0;z-index:1}.k-baseline-bar{position:absolute;background:#00000014;border:1px dashed rgba(0,0,0,.15);border-radius:3px;pointer-events:none}.k-gantt-tasks{position:absolute;top:0;left:0;z-index:2}.k-task-wrap{position:absolute;left:0;right:0;display:flex;align-items:center;pointer-events:none}.k-task{position:absolute;height:var(--ngx-gantt-bar-height, 24px);border-radius:4px;cursor:grab;pointer-events:all;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease;-webkit-user-select:none;user-select:none}.k-task:hover{box-shadow:0 3px 8px #0000002e,0 1px 3px #0000001a}.k-task:active{cursor:grabbing}.k-task.k-focused{outline:2px solid var(--k-primary, #4a90d9);outline-offset:2px}.k-task.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:1px}.k-task-range{height:8px!important;border-radius:4px;cursor:pointer;opacity:.8}.k-task-range .k-task-text{font-size:10px}.k-task-progress{position:absolute;top:0;left:0;height:100%;overflow:hidden;border-radius:4px 0 0 4px}.k-task-progress-inner{width:10000px;height:100%;background:var(--ngx-gantt-bar-progress-bg, rgba(0,0,0,.15))}.k-task-text{position:relative;z-index:1;padding:0 8px;color:var(--ngx-gantt-bar-text, #ffffff);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.15)}.k-resize-handle{position:absolute;top:0;width:6px;height:100%;cursor:col-resize;pointer-events:all;z-index:2}.k-resize-w{left:0}.k-resize-e{right:0}.k-resize-handle:hover{background:#ffffff40}.k-link-connector{position:absolute;top:50%;width:10px;height:10px;border-radius:50%;background:var(--k-danger, #ff6358);transform:translateY(-50%);cursor:crosshair;pointer-events:all;opacity:0;transition:opacity .15s ease;z-index:5}.k-task:hover .k-link-connector{opacity:1}.k-link-start{left:-5px}.k-link-end{right:-5px}.k-link-drag-line{pointer-events:none}.k-task-with-subtasks{overflow:hidden;box-shadow:none}.k-task-with-subtasks:hover{box-shadow:none}.k-task-with-subtasks.k-dragging{background:#0000000f!important;border:1px dashed rgba(0,0,0,.2);border-radius:4px}.k-subtask-segment{position:absolute;top:0;height:100%;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 3px #0000001f;transition:box-shadow .15s ease,transform .1s ease;cursor:pointer;pointer-events:all;min-width:4px}.k-subtask-segment:hover{box-shadow:0 3px 8px #00000038;transform:scaleY(1.08);z-index:1}.k-subtask-segment.transit-arrow{height:40%;top:30%;border-radius:2px;box-shadow:none}.k-subtask-text{position:relative;z-index:1;padding:0 6px;color:#fff;font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.2)}.k-subtask-progress{position:absolute;top:0;left:0;height:100%;background:#00000026;border-radius:4px 0 0 4px;pointer-events:none}.k-task-summary{position:absolute;height:10px;pointer-events:all;cursor:pointer;display:flex;align-items:flex-end}.k-task-summary.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:3px;border-radius:2px}.k-summary-bar{position:relative;width:100%;height:6px;background:var(--ngx-gantt-summary-color, #495057)}.k-summary-progress{height:100%;background:#343a40}.k-summary-left-cap,.k-summary-right-cap{position:absolute;bottom:0;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(--ngx-gantt-summary-color, #495057)}.k-summary-left-cap{left:-1px}.k-summary-right-cap{right:-1px}.k-milestone{position:absolute;pointer-events:all;cursor:pointer}.k-milestone.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:4px;border-radius:2px}.k-milestone-diamond{width:16px;height:16px;background:var(--ngx-gantt-milestone-color, #e74c3c);transform:rotate(45deg);border-radius:2px;box-shadow:0 1px 3px #00000026}.k-gantt-dependencies{position:absolute;top:0;left:0;z-index:1;pointer-events:none}.k-dep-line{fill:none;stroke:var(--k-danger, #ff6358);stroke-width:1.5;pointer-events:stroke;cursor:pointer}.k-dep-line:hover{stroke-width:3}.k-loading-overlay{position:absolute;inset:0;background:#ffffffb3;z-index:100;display:flex;align-items:center;justify-content:center}.k-loading-spinner{display:flex;flex-direction:column;align-items:center;gap:12px}@keyframes k-spin{to{transform:rotate(360deg)}}.k-spinner-circle{width:32px;height:32px;border:3px solid var(--ngx-gantt-border, #dee2e6);border-top-color:var(--k-primary, #4a90d9);border-radius:50%;animation:k-spin .8s linear infinite}.k-loading-text{font-size:12px;color:var(--ngx-gantt-text-secondary, #6c757d)}@keyframes k-tooltip-fadein{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.k-bar-tooltip{position:absolute;z-index:9999;background:var(--ngx-gantt-tooltip-bg, #2d3748);color:var(--ngx-gantt-tooltip-text, #ffffff);border-radius:6px;padding:10px 14px;min-width:180px;box-shadow:0 4px 16px #00000038;pointer-events:none;font-size:12px;line-height:1.5;animation:k-tooltip-fadein .15s ease}.k-bar-tooltip-title{font-weight:700;font-size:13px;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.k-bar-tooltip-row{display:flex;gap:12px;margin-top:3px}.k-bar-tooltip-label{color:var(--ngx-gantt-tooltip-label, rgba(255,255,255,.65));white-space:nowrap;min-width:60px;flex-shrink:0}.k-bar-tooltip-value{font-weight:500;white-space:nowrap;text-align:right;margin-left:auto}.k-row-tooltip{min-width:240px}.k-row-tooltip-task{display:flex;align-items:center;gap:6px;margin-top:5px;padding-top:5px;border-top:1px solid rgba(255,255,255,.12)}.k-row-tooltip-task:first-of-type{border-top:none}.k-row-tooltip-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.k-row-tooltip-name{flex:1;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-gantt.k-no-grid .k-header-cell,.k-gantt.k-no-grid .k-treelist-cell,.k-gantt.k-no-grid .k-treelist-row,.k-gantt.k-no-grid .k-header-group-cell,.k-gantt.k-no-grid .k-header-tick-cell,.k-gantt.k-no-grid .k-gantt-row,.k-gantt.k-no-grid .k-gantt-column{border:none!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2171
2452
|
}
|
|
2172
2453
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GanttChartComponent, decorators: [{
|
|
2173
2454
|
type: Component,
|
|
2174
|
-
args: [{ selector: 'ngx-gantt-chart', standalone: true, imports: [], providers: [
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
<thead>
|
|
2192
|
-
<tr>
|
|
2193
|
-
@for (col of sidebarColumns(); track col.header + '-' + $index) {
|
|
2194
|
-
<th class="k-header-cell">{{ col.header }}</th>
|
|
2195
|
-
}
|
|
2196
|
-
</tr>
|
|
2197
|
-
</thead>
|
|
2198
|
-
</table>
|
|
2455
|
+
args: [{ selector: 'ngx-gantt-chart', standalone: true, imports: [], providers: [GanttScaleService, GanttLayoutService, GanttKeyboardService, GanttPrintService], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2456
|
+
<div class="k-gantt" [class.k-gantt-dark]="false" [class.k-no-grid]="!mergedConfig().showGrid" [style]="themeVars()" (keydown)="onKeyDown($event)">
|
|
2457
|
+
|
|
2458
|
+
@if (mergedConfig().showToolbar) {
|
|
2459
|
+
<div class="k-gantt-toolbar">
|
|
2460
|
+
<div class="k-toolbar-group k-toolbar-views">
|
|
2461
|
+
@for (vt of mergedConfig().toolbarOptions.viewTypes; track vt) {
|
|
2462
|
+
<button class="k-toolbar-btn" [class.k-active]="mergedConfig().zoomLevel === vt" (click)="onToolbarViewChange(vt)">{{ getViewLabel(vt) }}</button>
|
|
2463
|
+
}
|
|
2464
|
+
</div>
|
|
2465
|
+
<div class="k-toolbar-group">
|
|
2466
|
+
<button class="k-toolbar-btn" (click)="scrollToToday()" title="Go to Today">Today</button>
|
|
2467
|
+
@if (mergedConfig().collapsible) {
|
|
2468
|
+
<button class="k-toolbar-btn" (click)="expandAll()">Expand</button>
|
|
2469
|
+
<button class="k-toolbar-btn" (click)="collapseAll()">Collapse</button>
|
|
2470
|
+
}
|
|
2471
|
+
</div>
|
|
2199
2472
|
</div>
|
|
2473
|
+
}
|
|
2200
2474
|
|
|
2201
|
-
|
|
2202
|
-
<div class="k-treelist
|
|
2203
|
-
<
|
|
2204
|
-
<
|
|
2205
|
-
|
|
2206
|
-
<col [style.width.px]="col.width"/>
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
(mousemove)="isNameColumn(col, colIndex) && row.extraTasks.length > 0 ? updateRowTooltip($event) : null"
|
|
2229
|
-
(mouseleave)="isNameColumn(col, colIndex) && row.extraTasks.length > 0 ? hideRowTooltip() : null"
|
|
2230
|
-
>
|
|
2231
|
-
@if (isNameColumn(col, colIndex)) {
|
|
2232
|
-
<span class="k-indent" [style.width.px]="row.depth * 20"></span>
|
|
2233
|
-
@if (row.hasChildren && mergedConfig().collapsible) {
|
|
2234
|
-
<button
|
|
2235
|
-
class="k-collapse-btn"
|
|
2236
|
-
(click)="onToggleCollapse(row.task.id); $event.stopPropagation()"
|
|
2237
|
-
[attr.aria-expanded]="!row.task.collapsed"
|
|
2238
|
-
>
|
|
2239
|
-
<span class="k-icon" [class.k-collapsed]="row.task.collapsed">▼</span>
|
|
2475
|
+
<div class="k-gantt-body">
|
|
2476
|
+
<div class="k-gantt-treelist" [style.width.px]="mergedConfig().sidebarWidth">
|
|
2477
|
+
<div class="k-treelist-header" [style.height.px]="mergedConfig().headerHeight">
|
|
2478
|
+
<table class="k-treelist-header-table">
|
|
2479
|
+
<colgroup>
|
|
2480
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <col [style.width.px]="col.width"/> }
|
|
2481
|
+
</colgroup>
|
|
2482
|
+
<thead><tr>
|
|
2483
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <th class="k-header-cell">{{ col.header }}</th> }
|
|
2484
|
+
</tr></thead>
|
|
2485
|
+
</table>
|
|
2486
|
+
</div>
|
|
2487
|
+
<div class="k-treelist-content" #treelistContent>
|
|
2488
|
+
<table class="k-treelist-table">
|
|
2489
|
+
<colgroup>
|
|
2490
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index) { <col [style.width.px]="col.width"/> }
|
|
2491
|
+
</colgroup>
|
|
2492
|
+
<tbody>
|
|
2493
|
+
@for (row of renderedRows(); track row.task.id; let i = $index) {
|
|
2494
|
+
<tr class="k-treelist-row" [class.k-group-header-row]="row.isGroupHeader" [style.height.px]="mergedConfig().rowHeight"
|
|
2495
|
+
[class.k-alt]="i % 2 === 1 && !row.isGroupHeader" [class.k-selected]="isTaskSelected(row.task.id)" [class.k-hover]="hoveredTaskId() === row.task.id"
|
|
2496
|
+
(mouseenter)="hoveredTaskId.set(row.task.id)" (mouseleave)="hoveredTaskId.set(null)" (click)="onRowClick(row.task, $event)">
|
|
2497
|
+
@if (row.isGroupHeader) {
|
|
2498
|
+
<td class="k-treelist-cell k-group-cell" [attr.colspan]="sidebarColumns().length">
|
|
2499
|
+
@if (mergedConfig().collapsible) {
|
|
2500
|
+
<button class="k-collapse-btn" (click)="onToggleGroupCollapse(row.group!); $event.stopPropagation()" [attr.aria-expanded]="row.group!.expanded !== false">
|
|
2501
|
+
<span class="k-icon" [class.k-collapsed]="row.group!.expanded === false">▼</span>
|
|
2240
2502
|
</button>
|
|
2241
|
-
} @else {
|
|
2242
|
-
<span class="k-collapse-spacer"></span>
|
|
2243
|
-
}
|
|
2244
|
-
@if (row.task.isMilestone) {
|
|
2245
|
-
<span class="k-milestone-icon">◆</span>
|
|
2246
2503
|
}
|
|
2247
|
-
<
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2504
|
+
<span class="k-group-title">{{ row.task.name }}</span>
|
|
2505
|
+
</td>
|
|
2506
|
+
} @else {
|
|
2507
|
+
@for (col of sidebarColumns(); track col.header + '-' + $index; let colIndex = $index) {
|
|
2508
|
+
<td class="k-treelist-cell" [class.k-name-cell]="isNameColumn(col, colIndex)" [class.k-date-cell]="isDateColumn(col)" [class.k-pct-cell]="isProgressColumn(col)">
|
|
2509
|
+
@if (isNameColumn(col, colIndex)) {
|
|
2510
|
+
@if (mergedConfig().tableDraggable && row.task.itemDraggable !== false) {
|
|
2511
|
+
<span class="k-drag-handle" draggable="true" (dragstart)="onTableDragStart($event, row)" (dragend)="onTableDragEnd($event, row)" title="Drag to reorder">⋮⋮</span>
|
|
2512
|
+
}
|
|
2513
|
+
<span class="k-indent" [style.width.px]="row.depth * 20"></span>
|
|
2514
|
+
@if (row.hasChildren && mergedConfig().collapsible) {
|
|
2515
|
+
<button class="k-collapse-btn" (click)="onToggleCollapse(row.task.id); $event.stopPropagation()" [attr.aria-expanded]="!row.task.collapsed">
|
|
2516
|
+
<span class="k-icon" [class.k-collapsed]="row.task.collapsed">▼</span>
|
|
2517
|
+
</button>
|
|
2518
|
+
} @else { <span class="k-collapse-spacer"></span> }
|
|
2519
|
+
@if (row.task.isMilestone) { <span class="k-milestone-icon">◆</span> }
|
|
2520
|
+
<div class="k-name-wrapper">
|
|
2521
|
+
<span class="k-task-name" [class.k-summary-name]="row.hasChildren" [title]="row.task.name">{{ row.task.name }}</span>
|
|
2522
|
+
@if (getUniqueExtraTasks(row).length > 0) {
|
|
2523
|
+
<div class="k-extra-tasks-chips">
|
|
2524
|
+
@for (extra of getUniqueExtraTasks(row); track extra.id) {
|
|
2525
|
+
<span class="k-extra-task-chip" [style.background]="extra.color || '#6c757d'" [title]="extra.name">{{ extra.name.length > 14 ? extra.name.slice(0, 14) + '\u2026' : extra.name }}</span>
|
|
2526
|
+
}
|
|
2527
|
+
</div>
|
|
2259
2528
|
}
|
|
2260
2529
|
</div>
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
} @else {
|
|
2266
|
-
{{ getSidebarCellValue(row, col) }}
|
|
2530
|
+
} @else if (isProgressColumn(col) && row.extraTasks.length > 0) {
|
|
2531
|
+
<span class="k-multi-pct" [title]="getRowProgressTitle(row)">~{{ getRowAvgProgress(row) }}%</span>
|
|
2532
|
+
} @else { {{ getSidebarCellValue(row, col) }} }
|
|
2533
|
+
</td>
|
|
2267
2534
|
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
</
|
|
2273
|
-
</table>
|
|
2274
|
-
</div>
|
|
2275
|
-
</div>
|
|
2276
|
-
|
|
2277
|
-
<!-- ===== SPLITBAR ===== -->
|
|
2278
|
-
<div class="k-splitbar" (pointerdown)="onSplitBarDown($event)">
|
|
2279
|
-
<span class="k-splitbar-icon">⋮</span>
|
|
2280
|
-
</div>
|
|
2281
|
-
|
|
2282
|
-
<!-- ===== TIMELINE (Right Panel) ===== -->
|
|
2283
|
-
<div class="k-gantt-timeline">
|
|
2284
|
-
<!-- Timeline Header -->
|
|
2285
|
-
<div class="k-timeline-header" [style.height.px]="mergedConfig().headerHeight">
|
|
2286
|
-
<div class="k-timeline-header-wrap" [style.width.px]="totalWidth()" [style.margin-left.px]="-(scrollLeft())">
|
|
2287
|
-
<!-- Primary header row (months/years) -->
|
|
2288
|
-
<div class="k-header-row k-header-primary">
|
|
2289
|
-
@for (group of primaryHeaderGroups(); track group.label + group.x) {
|
|
2290
|
-
<div
|
|
2291
|
-
class="k-header-group-cell"
|
|
2292
|
-
[style.left.px]="group.x"
|
|
2293
|
-
[style.width.px]="group.width"
|
|
2294
|
-
>
|
|
2295
|
-
{{ group.label }}
|
|
2296
|
-
</div>
|
|
2297
|
-
}
|
|
2298
|
-
</div>
|
|
2299
|
-
<!-- Secondary header row (days/weeks/months) -->
|
|
2300
|
-
<div class="k-header-row k-header-secondary">
|
|
2301
|
-
@for (col of headerColumns(); track col.x) {
|
|
2302
|
-
<div
|
|
2303
|
-
class="k-header-tick-cell"
|
|
2304
|
-
[style.left.px]="col.x"
|
|
2305
|
-
[style.width.px]="col.width"
|
|
2306
|
-
[class.k-weekend]="col.isWeekend"
|
|
2307
|
-
[class.k-today-header]="col.isToday"
|
|
2308
|
-
>
|
|
2309
|
-
{{ col.label }}
|
|
2310
|
-
</div>
|
|
2311
|
-
}
|
|
2312
|
-
</div>
|
|
2535
|
+
}
|
|
2536
|
+
</tr>
|
|
2537
|
+
}
|
|
2538
|
+
</tbody>
|
|
2539
|
+
</table>
|
|
2313
2540
|
</div>
|
|
2314
2541
|
</div>
|
|
2315
2542
|
|
|
2316
|
-
|
|
2317
|
-
<div class="k-timeline-content" #timelineContent (scroll)="onTimelineScroll()">
|
|
2318
|
-
<div class="k-timeline-canvas" [style.width.px]="totalWidth()" [style.height.px]="totalHeight()">
|
|
2319
|
-
|
|
2320
|
-
<!-- Background rows (alternating + hover) -->
|
|
2321
|
-
<div class="k-gantt-rows">
|
|
2322
|
-
@for (row of visibleRows(); track row.task.id; let i = $index) {
|
|
2323
|
-
<div
|
|
2324
|
-
class="k-gantt-row"
|
|
2325
|
-
[style.top.px]="i * mergedConfig().rowHeight"
|
|
2326
|
-
[style.height.px]="mergedConfig().rowHeight"
|
|
2327
|
-
[class.k-alt]="i % 2 === 1"
|
|
2328
|
-
[class.k-hover]="hoveredTaskId() === row.task.id"
|
|
2329
|
-
[class.k-selected]="selectedTaskId() === row.task.id"
|
|
2330
|
-
(mouseenter)="hoveredTaskId.set(row.task.id)"
|
|
2331
|
-
(mouseleave)="hoveredTaskId.set(null)"
|
|
2332
|
-
>
|
|
2333
|
-
</div>
|
|
2334
|
-
}
|
|
2335
|
-
</div>
|
|
2543
|
+
<div class="k-splitbar" (pointerdown)="onSplitBarDown($event)"><span class="k-splitbar-icon">⋮</span></div>
|
|
2336
2544
|
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2545
|
+
<div class="k-gantt-timeline">
|
|
2546
|
+
<div class="k-timeline-header" [style.height.px]="mergedConfig().headerHeight">
|
|
2547
|
+
<div class="k-timeline-header-wrap" [style.width.px]="totalWidth()" [style.margin-left.px]="-(scrollLeft())">
|
|
2548
|
+
<div class="k-header-row k-header-primary">
|
|
2549
|
+
@for (group of primaryHeaderGroups(); track group.label + group.x) {
|
|
2550
|
+
<div class="k-header-group-cell" [style.left.px]="group.x" [style.width.px]="group.width">{{ group.label }}</div>
|
|
2551
|
+
}
|
|
2552
|
+
</div>
|
|
2553
|
+
<div class="k-header-row k-header-secondary">
|
|
2340
2554
|
@for (col of headerColumns(); track col.x) {
|
|
2341
|
-
<div
|
|
2342
|
-
class="k-gantt-column"
|
|
2343
|
-
[style.left.px]="col.x"
|
|
2344
|
-
[style.width.px]="col.width"
|
|
2345
|
-
[style.height.px]="totalHeight()"
|
|
2346
|
-
[class.k-weekend-col]="col.isWeekend"
|
|
2347
|
-
>
|
|
2348
|
-
</div>
|
|
2555
|
+
<div class="k-header-tick-cell" [style.left.px]="col.x" [style.width.px]="col.width" [class.k-weekend]="col.isWeekend" [class.k-today-header]="col.isToday">{{ col.label }}</div>
|
|
2349
2556
|
}
|
|
2350
2557
|
</div>
|
|
2351
|
-
|
|
2558
|
+
</div>
|
|
2559
|
+
</div>
|
|
2352
2560
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
<div
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2561
|
+
<div class="k-timeline-content" #timelineContent (scroll)="onTimelineScroll()">
|
|
2562
|
+
<div class="k-timeline-canvas" [style.width.px]="totalWidth()" [style.height.px]="totalHeight()">
|
|
2563
|
+
<div class="k-gantt-rows">
|
|
2564
|
+
@for (row of renderedRows(); track row.task.id; let i = $index) {
|
|
2565
|
+
<div class="k-gantt-row" [class.k-group-row]="row.isGroupHeader" [style.top.px]="i * mergedConfig().rowHeight" [style.height.px]="mergedConfig().rowHeight"
|
|
2566
|
+
[class.k-alt]="i % 2 === 1 && !row.isGroupHeader" [class.k-hover]="hoveredTaskId() === row.task.id" [class.k-selected]="isTaskSelected(row.task.id)"
|
|
2567
|
+
(mouseenter)="hoveredTaskId.set(row.task.id)" (mouseleave)="hoveredTaskId.set(null)"
|
|
2568
|
+
(dragover)="mergedConfig().tableDraggable ? onTableDragOver($event, row) : null" (drop)="mergedConfig().tableDraggable ? onTableDrop($event, row) : null">
|
|
2569
|
+
</div>
|
|
2570
|
+
}
|
|
2361
2571
|
</div>
|
|
2362
|
-
}
|
|
2363
2572
|
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
class="k-task-wrap"
|
|
2369
|
-
[style.top.px]="bar.top"
|
|
2370
|
-
[style.height.px]="mergedConfig().rowHeight"
|
|
2371
|
-
>
|
|
2372
|
-
@if (bar.task.isMilestone) {
|
|
2373
|
-
<!-- Milestone diamond -->
|
|
2374
|
-
<div
|
|
2375
|
-
class="k-milestone"
|
|
2376
|
-
[style.left.px]="bar.left - 8"
|
|
2377
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
2378
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
2379
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
2380
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2381
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
2382
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2383
|
-
tabindex="0"
|
|
2384
|
-
[attr.aria-label]="'Milestone: ' + bar.task.name"
|
|
2385
|
-
>
|
|
2386
|
-
<div class="k-milestone-diamond" [style.background]="bar.task.color || '#e74c3c'"></div>
|
|
2387
|
-
</div>
|
|
2388
|
-
} @else if (bar.isSummary) {
|
|
2389
|
-
<!-- Summary bar (parent task) -->
|
|
2390
|
-
<div
|
|
2391
|
-
class="k-task-summary"
|
|
2392
|
-
[style.left.px]="bar.left"
|
|
2393
|
-
[style.width.px]="bar.width"
|
|
2394
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
2395
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
2396
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
2397
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2398
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
2399
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2400
|
-
tabindex="0"
|
|
2401
|
-
[attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'"
|
|
2402
|
-
>
|
|
2403
|
-
<div class="k-summary-bar" [style.background]="'#495057'">
|
|
2404
|
-
<div class="k-summary-progress" [style.width.%]="bar.task.progress" [style.background]="'#343a40'"></div>
|
|
2405
|
-
</div>
|
|
2406
|
-
<div class="k-summary-left-cap"></div>
|
|
2407
|
-
<div class="k-summary-right-cap"></div>
|
|
2408
|
-
</div>
|
|
2409
|
-
} @else if (bar.task.subtasks && bar.task.subtasks.length > 0) {
|
|
2410
|
-
<!-- Task bar with subtask segments -->
|
|
2411
|
-
<div
|
|
2412
|
-
class="k-task k-task-with-subtasks"
|
|
2413
|
-
[style.left.px]="bar.left"
|
|
2414
|
-
[style.width.px]="bar.width"
|
|
2415
|
-
[style.background]="bar.task.color || '#e9ecef'"
|
|
2416
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
2417
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
2418
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId)"
|
|
2419
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2420
|
-
(pointerdown)="onBarPointerDown($event, bar.task, 'move')"
|
|
2421
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
2422
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2423
|
-
tabindex="0"
|
|
2424
|
-
role="img"
|
|
2425
|
-
[attr.aria-label]="bar.task.name + ' with ' + bar.task.subtasks.length + ' subtasks'"
|
|
2426
|
-
>
|
|
2427
|
-
@for (sub of getSubtaskBars(bar); track sub.subtask.id) {
|
|
2428
|
-
<div
|
|
2429
|
-
class="k-subtask-segment"
|
|
2430
|
-
[style.left.px]="sub.left"
|
|
2431
|
-
[style.width.px]="sub.width"
|
|
2432
|
-
[style.background]="sub.subtask.color"
|
|
2433
|
-
[title]="sub.subtask.name + (sub.subtask.description ? ': ' + sub.subtask.description : '')"
|
|
2434
|
-
(mouseenter)="showSubtaskTooltip(bar.task, sub.subtask, $event); $event.stopPropagation()"
|
|
2435
|
-
(mouseleave)="hideTooltip()"
|
|
2436
|
-
>
|
|
2437
|
-
@if (sub.width > 40) {
|
|
2438
|
-
<span class="k-subtask-text">{{ sub.subtask.name }}</span>
|
|
2439
|
-
}
|
|
2440
|
-
@if (sub.subtask.progress != null) {
|
|
2441
|
-
<div class="k-subtask-progress" [style.width.%]="sub.subtask.progress"></div>
|
|
2442
|
-
}
|
|
2443
|
-
</div>
|
|
2444
|
-
}
|
|
2445
|
-
<!-- Resize handles -->
|
|
2446
|
-
@if (bar.task.draggable !== false) {
|
|
2447
|
-
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2448
|
-
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2449
|
-
}
|
|
2450
|
-
</div>
|
|
2451
|
-
} @else {
|
|
2452
|
-
<!-- Regular task bar -->
|
|
2453
|
-
<div
|
|
2454
|
-
class="k-task"
|
|
2455
|
-
[style.left.px]="bar.left"
|
|
2456
|
-
[style.width.px]="bar.width"
|
|
2457
|
-
[style.background]="bar.task.color || '#4a90d9'"
|
|
2458
|
-
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id"
|
|
2459
|
-
[class.k-selected]="selectedTaskId() === bar.task.id"
|
|
2460
|
-
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)"
|
|
2461
|
-
(mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2462
|
-
(pointerdown)="onBarPointerDown($event, bar.task, 'move')"
|
|
2463
|
-
(click)="onTaskBarClick(bar.task, $event)"
|
|
2464
|
-
(dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2465
|
-
tabindex="0"
|
|
2466
|
-
role="img"
|
|
2467
|
-
[attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'"
|
|
2468
|
-
>
|
|
2469
|
-
<!-- Progress fill -->
|
|
2470
|
-
<div class="k-task-progress" [style.width.%]="bar.task.progress">
|
|
2471
|
-
<div class="k-task-progress-inner" [style.background]="'#2d6cb4'"></div>
|
|
2472
|
-
</div>
|
|
2473
|
-
<!-- Task text -->
|
|
2474
|
-
<span class="k-task-text" [style.color]="'#ffffff'">{{ bar.task.name }}</span>
|
|
2475
|
-
<!-- Resize handles -->
|
|
2476
|
-
@if (bar.task.draggable !== false) {
|
|
2477
|
-
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2478
|
-
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2479
|
-
}
|
|
2480
|
-
</div>
|
|
2573
|
+
@if (mergedConfig().showGrid) {
|
|
2574
|
+
<div class="k-gantt-columns">
|
|
2575
|
+
@for (col of headerColumns(); track col.x) {
|
|
2576
|
+
<div class="k-gantt-column" [style.left.px]="col.x" [style.width.px]="col.width" [style.height.px]="totalHeight()" [class.k-weekend-col]="col.isWeekend"></div>
|
|
2481
2577
|
}
|
|
2482
2578
|
</div>
|
|
2483
2579
|
}
|
|
2484
|
-
</div>
|
|
2485
2580
|
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
<defs>
|
|
2489
|
-
<marker id="k-arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
|
|
2490
|
-
<polygon points="0 0, 10 3.5, 0 7" fill="var(--ngx-gantt-arrow-color, #ff6358)"/>
|
|
2491
|
-
</marker>
|
|
2492
|
-
</defs>
|
|
2493
|
-
@for (dep of dependencyPaths(); track dep.key) {
|
|
2494
|
-
<path
|
|
2495
|
-
class="k-dep-line"
|
|
2496
|
-
[attr.d]="dep.path"
|
|
2497
|
-
[attr.stroke]="dep.dependency.color || '#ff6358'"
|
|
2498
|
-
marker-end="url(#k-arrowhead)"
|
|
2499
|
-
(click)="onDependencyClick(dep.dependency, $event)"
|
|
2500
|
-
/>
|
|
2581
|
+
@if (mergedConfig().showTodayMarker && todayX() !== null) {
|
|
2582
|
+
<div class="k-today-marker" [style.left.px]="todayX()" [style.height.px]="totalHeight()"><div class="k-today-indicator"></div></div>
|
|
2501
2583
|
}
|
|
2502
|
-
</svg>
|
|
2503
2584
|
|
|
2585
|
+
@if (mergedConfig().showBaseline && baselineItems().length > 0) {
|
|
2586
|
+
<div class="k-gantt-baselines">
|
|
2587
|
+
@for (bl of baselineBars(); track bl.id) {
|
|
2588
|
+
<div class="k-baseline-bar" [style.top.px]="bl.top" [style.left.px]="bl.left" [style.width.px]="bl.width" [style.height.px]="mergedConfig().barHeight"></div>
|
|
2589
|
+
}
|
|
2590
|
+
</div>
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
<div class="k-gantt-tasks">
|
|
2594
|
+
@for (bar of taskBars(); track bar.task.id) {
|
|
2595
|
+
<div class="k-task-wrap" [style.top.px]="bar.top" [style.height.px]="mergedConfig().rowHeight" [class]="bar.task.cssClass || ''">
|
|
2596
|
+
@if (bar.isGroupHeader) {
|
|
2597
|
+
} @else if (bar.task.isMilestone) {
|
|
2598
|
+
<div class="k-milestone" [style.left.px]="bar.left - 8" [class.k-focused]="keyboardService.focusedTaskId() === bar.task.id" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2599
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2600
|
+
(click)="onTaskBarClick(bar.task, $event)" (dblclick)="onTaskBarDblClick(bar.task, $event)" tabindex="0" [attr.aria-label]="'Milestone: ' + bar.task.name">
|
|
2601
|
+
<div class="k-milestone-diamond" [style.background]="bar.task.color || '#e74c3c'"></div>
|
|
2602
|
+
</div>
|
|
2603
|
+
} @else if (bar.task.type === 'range') {
|
|
2604
|
+
<div class="k-task k-task-range" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || '#ff9f73'"
|
|
2605
|
+
[class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2606
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2607
|
+
(click)="onTaskBarClick(bar.task, $event)" tabindex="0" [attr.aria-label]="bar.task.name">
|
|
2608
|
+
<span class="k-task-text">{{ bar.task.name }}</span>
|
|
2609
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2610
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2611
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2612
|
+
}
|
|
2613
|
+
</div>
|
|
2614
|
+
} @else if (bar.isSummary) {
|
|
2615
|
+
<div class="k-task-summary" [style.left.px]="bar.left" [style.width.px]="bar.width" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2616
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2617
|
+
(click)="onTaskBarClick(bar.task, $event)" tabindex="0">
|
|
2618
|
+
<div class="k-summary-bar"><div class="k-summary-progress" [style.width.%]="bar.task.progress"></div></div>
|
|
2619
|
+
<div class="k-summary-left-cap"></div><div class="k-summary-right-cap"></div>
|
|
2620
|
+
</div>
|
|
2621
|
+
} @else if (bar.task.subtasks && bar.task.subtasks.length > 0) {
|
|
2622
|
+
<div class="k-task k-task-with-subtasks" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || '#e9ecef'"
|
|
2623
|
+
[class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2624
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2625
|
+
(pointerdown)="onBarPointerDown($event, bar.task, 'move')" (click)="onTaskBarClick(bar.task, $event)"
|
|
2626
|
+
tabindex="0" role="img" [attr.aria-label]="bar.task.name + ' with ' + bar.task.subtasks.length + ' subtasks'">
|
|
2627
|
+
@for (sub of getSubtaskBars(bar); track sub.subtask.id) {
|
|
2628
|
+
<div class="k-subtask-segment" [class]="sub.subtask.cssClass || ''" [style.left.px]="sub.left" [style.width.px]="sub.width" [style.background]="sub.subtask.color"
|
|
2629
|
+
[title]="sub.subtask.name"
|
|
2630
|
+
(mouseenter)="showSubtaskTooltip(bar.task, sub.subtask, $event); $event.stopPropagation()" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hideTooltip()">
|
|
2631
|
+
@if (sub.width > 40) { <span class="k-subtask-text">{{ sub.subtask.name }}</span> }
|
|
2632
|
+
@if (sub.subtask.progress != null) { <div class="k-subtask-progress" [style.width.%]="sub.subtask.progress"></div> }
|
|
2633
|
+
</div>
|
|
2634
|
+
}
|
|
2635
|
+
@if (bar.task.draggable !== false) {
|
|
2636
|
+
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2637
|
+
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2638
|
+
}
|
|
2639
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2640
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2641
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2642
|
+
}
|
|
2643
|
+
</div>
|
|
2644
|
+
} @else {
|
|
2645
|
+
<div class="k-task" [style.left.px]="bar.left" [style.width.px]="bar.width" [style.background]="bar.task.color || 'var(--k-primary, #4a90d9)'"
|
|
2646
|
+
[class.k-focused]="keyboardService.focusedTaskId() === bar.task.id" [class.k-selected]="isTaskSelected(bar.task.id)"
|
|
2647
|
+
(mouseenter)="hoveredTaskId.set(bar.primaryTaskId); showTooltip(bar.task, $event)" (mousemove)="updateTooltipPosition($event)" (mouseleave)="hoveredTaskId.set(null); hideTooltip()"
|
|
2648
|
+
(pointerdown)="onBarPointerDown($event, bar.task, 'move')" (click)="onTaskBarClick(bar.task, $event)" (dblclick)="onTaskBarDblClick(bar.task, $event)"
|
|
2649
|
+
tabindex="0" role="img" [attr.aria-label]="bar.task.name + ' - ' + bar.task.progress + '% complete'">
|
|
2650
|
+
<div class="k-task-progress" [style.width.%]="bar.task.progress"><div class="k-task-progress-inner"></div></div>
|
|
2651
|
+
<span class="k-task-text">{{ bar.task.name }}</span>
|
|
2652
|
+
@if (bar.task.draggable !== false) {
|
|
2653
|
+
<div class="k-resize-handle k-resize-w" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-left')"></div>
|
|
2654
|
+
<div class="k-resize-handle k-resize-e" (pointerdown)="onBarPointerDown($event, bar.task, 'resize-right')"></div>
|
|
2655
|
+
}
|
|
2656
|
+
@if (mergedConfig().linkable && bar.task.linkable !== false) {
|
|
2657
|
+
<div class="k-link-connector k-link-start" (pointerdown)="onLinkDragStart($event, bar.task, 'start')"></div>
|
|
2658
|
+
<div class="k-link-connector k-link-end" (pointerdown)="onLinkDragStart($event, bar.task, 'end')"></div>
|
|
2659
|
+
}
|
|
2660
|
+
</div>
|
|
2661
|
+
}
|
|
2662
|
+
</div>
|
|
2663
|
+
}
|
|
2664
|
+
</div>
|
|
2665
|
+
|
|
2666
|
+
<svg class="k-gantt-dependencies" [attr.width]="totalWidth()" [attr.height]="totalHeight()">
|
|
2667
|
+
<defs>
|
|
2668
|
+
@if (mergedConfig().linkOptions.showArrow !== false) {
|
|
2669
|
+
<marker id="k-arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
|
|
2670
|
+
<polygon points="0 0, 10 3.5, 0 7" fill="var(--k-danger, #ff6358)"/>
|
|
2671
|
+
</marker>
|
|
2672
|
+
}
|
|
2673
|
+
</defs>
|
|
2674
|
+
@for (dep of dependencyPaths(); track dep.key) {
|
|
2675
|
+
<path class="k-dep-line" [attr.d]="dep.path" [attr.stroke]="dep.color"
|
|
2676
|
+
[attr.marker-end]="mergedConfig().linkOptions.showArrow !== false ? 'url(#k-arrowhead)' : null"
|
|
2677
|
+
[class]="dep.dependency.cssClass || ''" (click)="onDependencyClick(dep.dependency, $event)"/>
|
|
2678
|
+
}
|
|
2679
|
+
@if (linkDragLine()) {
|
|
2680
|
+
<line class="k-link-drag-line" [attr.x1]="linkDragLine()!.x1" [attr.y1]="linkDragLine()!.y1" [attr.x2]="linkDragLine()!.x2" [attr.y2]="linkDragLine()!.y2"
|
|
2681
|
+
stroke="#ff6358" stroke-width="2" stroke-dasharray="4 3"/>
|
|
2682
|
+
}
|
|
2683
|
+
</svg>
|
|
2684
|
+
</div>
|
|
2504
2685
|
</div>
|
|
2505
2686
|
</div>
|
|
2506
2687
|
</div>
|
|
2688
|
+
|
|
2689
|
+
@if (showLoading()) {
|
|
2690
|
+
<div class="k-loading-overlay"><div class="k-loading-spinner"><div class="k-spinner-circle"></div><span class="k-loading-text">Loading\u2026</span></div></div>
|
|
2691
|
+
}
|
|
2507
2692
|
</div>
|
|
2508
2693
|
|
|
2509
|
-
<!-- ===== TASK TOOLTIP ===== -->
|
|
2510
2694
|
@if (tooltipTask()) {
|
|
2511
|
-
<div
|
|
2512
|
-
class="k-bar-tooltip"
|
|
2513
|
-
[style.left.px]="tooltipX()"
|
|
2514
|
-
[style.top.px]="tooltipY()"
|
|
2515
|
-
>
|
|
2695
|
+
<div class="k-bar-tooltip" [style.left.px]="tooltipX()" [style.top.px]="tooltipY()">
|
|
2516
2696
|
<div class="k-bar-tooltip-title">{{ tooltipTask()!.name }}</div>
|
|
2517
2697
|
@if (tooltipSubtask()) {
|
|
2518
|
-
<div class="k-bar-tooltip-row">
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
</div>
|
|
2522
|
-
@if (tooltipSubtask()!.description) {
|
|
2523
|
-
<div class="k-bar-tooltip-row">
|
|
2524
|
-
<span class="k-bar-tooltip-label">Description</span>
|
|
2525
|
-
<span class="k-bar-tooltip-value">{{ tooltipSubtask()!.description }}</span>
|
|
2526
|
-
</div>
|
|
2527
|
-
}
|
|
2528
|
-
<div class="k-bar-tooltip-row">
|
|
2529
|
-
<span class="k-bar-tooltip-label">Start</span>
|
|
2530
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.start) }}</span>
|
|
2531
|
-
</div>
|
|
2532
|
-
<div class="k-bar-tooltip-row">
|
|
2533
|
-
<span class="k-bar-tooltip-label">End</span>
|
|
2534
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.end) }}</span>
|
|
2535
|
-
</div>
|
|
2536
|
-
@if (tooltipSubtask()!.progress != null) {
|
|
2537
|
-
<div class="k-bar-tooltip-row">
|
|
2538
|
-
<span class="k-bar-tooltip-label">Progress</span>
|
|
2539
|
-
<span class="k-bar-tooltip-value">{{ tooltipSubtask()!.progress }}%</span>
|
|
2540
|
-
</div>
|
|
2541
|
-
}
|
|
2542
|
-
@for (entry of getMetaEntries(tooltipSubtask()!.meta); track entry.key) {
|
|
2543
|
-
<div class="k-bar-tooltip-row">
|
|
2544
|
-
<span class="k-bar-tooltip-label">{{ entry.key }}</span>
|
|
2545
|
-
<span class="k-bar-tooltip-value">{{ entry.value }}</span>
|
|
2546
|
-
</div>
|
|
2547
|
-
}
|
|
2698
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Subtask</span><span class="k-bar-tooltip-value">{{ tooltipSubtask()!.name }}</span></div>
|
|
2699
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Start</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.start) }}</span></div>
|
|
2700
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">End</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipSubtask()!.end) }}</span></div>
|
|
2701
|
+
@if (tooltipSubtask()!.progress != null) { <div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Progress</span><span class="k-bar-tooltip-value">{{ tooltipSubtask()!.progress }}%</span></div> }
|
|
2548
2702
|
} @else {
|
|
2549
|
-
<div class="k-bar-tooltip-row">
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
</div>
|
|
2553
|
-
<div class="k-bar-tooltip-row">
|
|
2554
|
-
<span class="k-bar-tooltip-label">End</span>
|
|
2555
|
-
<span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.end) }}</span>
|
|
2556
|
-
</div>
|
|
2557
|
-
<div class="k-bar-tooltip-row">
|
|
2558
|
-
<span class="k-bar-tooltip-label">Progress</span>
|
|
2559
|
-
<span class="k-bar-tooltip-value">{{ tooltipTask()!.progress }}%</span>
|
|
2560
|
-
</div>
|
|
2561
|
-
@for (entry of getMetaEntries(tooltipTask()!.meta); track entry.key) {
|
|
2562
|
-
<div class="k-bar-tooltip-row">
|
|
2563
|
-
<span class="k-bar-tooltip-label">{{ entry.key }}</span>
|
|
2564
|
-
<span class="k-bar-tooltip-value">{{ entry.value }}</span>
|
|
2565
|
-
</div>
|
|
2566
|
-
}
|
|
2567
|
-
@if (tooltipTask()!.subtasks && tooltipTask()!.subtasks!.length > 0) {
|
|
2568
|
-
<div class="k-bar-tooltip-divider"></div>
|
|
2569
|
-
<div class="k-bar-tooltip-label" style="margin-top: 6px;">Subtasks</div>
|
|
2570
|
-
@for (sub of tooltipTask()!.subtasks!; track sub.id) {
|
|
2571
|
-
<div class="k-row-tooltip-task">
|
|
2572
|
-
<span class="k-row-tooltip-dot" [style.background]="sub.color"></span>
|
|
2573
|
-
<span class="k-row-tooltip-name">{{ sub.name }}</span>
|
|
2574
|
-
@if (sub.description) {
|
|
2575
|
-
<span class="k-bar-tooltip-label">{{ sub.description }}</span>
|
|
2576
|
-
}
|
|
2577
|
-
</div>
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2703
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Start</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.start) }}</span></div>
|
|
2704
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">End</span><span class="k-bar-tooltip-value">{{ formatDateFull(tooltipTask()!.end) }}</span></div>
|
|
2705
|
+
<div class="k-bar-tooltip-row"><span class="k-bar-tooltip-label">Progress</span><span class="k-bar-tooltip-value">{{ tooltipTask()!.progress }}%</span></div>
|
|
2580
2706
|
}
|
|
2581
2707
|
</div>
|
|
2582
2708
|
}
|
|
2583
2709
|
|
|
2584
|
-
<!-- ===== ROW TOOLTIP (multi-task rows) ===== -->
|
|
2585
2710
|
@if (rowTooltipData()) {
|
|
2586
|
-
<div
|
|
2587
|
-
class="k-bar-tooltip k-row-tooltip"
|
|
2588
|
-
[style.left.px]="rowTooltipX()"
|
|
2589
|
-
[style.top.px]="rowTooltipY()"
|
|
2590
|
-
>
|
|
2711
|
+
<div class="k-bar-tooltip k-row-tooltip" [style.left.px]="rowTooltipX()" [style.top.px]="rowTooltipY()">
|
|
2591
2712
|
<div class="k-bar-tooltip-title">Tasks in this row</div>
|
|
2592
2713
|
@for (t of rowTooltipData()!.allTasks; track t.id) {
|
|
2593
2714
|
<div class="k-row-tooltip-task">
|
|
2594
2715
|
<span class="k-row-tooltip-dot" [style.background]="t.color || '#4a90d9'"></span>
|
|
2595
2716
|
<span class="k-row-tooltip-name">{{ t.name }}</span>
|
|
2596
|
-
<span class="k-bar-tooltip-label">{{ formatDateShort(t.start) }}–{{ formatDateShort(t.end) }}</span>
|
|
2597
2717
|
<span class="k-bar-tooltip-value">{{ t.progress }}%</span>
|
|
2598
2718
|
</div>
|
|
2599
2719
|
}
|
|
2600
2720
|
</div>
|
|
2601
2721
|
}
|
|
2602
|
-
`, styles: [":host{display:block;height:100%;min-height:var(--ngx-gantt-min-height, 420px)}.k-gantt{display:flex;height:100%;min-height:inherit;width:100%;background:var(--ngx-gantt-bg, #ffffff);border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;font-family:var(--ngx-gantt-font, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);font-size:var(--ngx-gantt-font-size, 13px);color:var(--ngx-gantt-text, #212529);overflow:hidden;position:relative}.k-gantt-treelist{display:flex;flex-direction:column;flex-shrink:0;border-right:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;background:var(--ngx-gantt-bg, #ffffff)}.k-treelist-header{flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;display:flex;align-items:flex-end}.k-treelist-header-table,.k-treelist-table{width:100%;border-collapse:collapse;table-layout:fixed}.k-header-cell{padding:8px;text-align:left;font-size:var(--ngx-gantt-header-font-size, 12px);font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-header-cell:last-child{border-right:none;text-align:center}.k-treelist-content{flex:1;overflow-y:auto;overflow-x:hidden}.k-treelist-row{cursor:default;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-treelist-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-treelist-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-treelist-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-treelist-cell{padding:0 8px;height:100%;vertical-align:middle;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-treelist-cell:last-child{border-right:none}.k-name-cell{display:flex;align-items:center;gap:0}.k-indent{display:inline-block;flex-shrink:0}.k-name-wrapper{display:flex;flex-direction:column;min-width:0;justify-content:center;gap:2px;overflow:hidden}.k-extra-tasks-chips{display:flex;flex-wrap:wrap;gap:3px}.k-extra-task-chip{display:inline-flex;align-items:center;padding:0 5px;height:14px;border-radius:7px;font-size:10px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px;opacity:.9;font-weight:500;letter-spacing:.01em}.k-multi-pct{cursor:help}.k-collapse-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:var(--ngx-gantt-text-secondary, #6c757d);border-radius:3px}.k-collapse-btn:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-icon{font-size:8px;transition:transform .15s ease;display:inline-block}.k-icon.k-collapsed{transform:rotate(-90deg)}.k-collapse-spacer{display:inline-block;width:20px;flex-shrink:0}.k-milestone-icon{color:var(--ngx-gantt-milestone-color, #e74c3c);margin-right:4px;font-size:10px;flex-shrink:0}.k-task-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-summary-name{font-weight:600}.k-date-cell{font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);text-align:center}.k-pct-cell{font-size:11px;text-align:center;font-weight:500}.k-splitbar{width:7px;flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-left:1px solid var(--ngx-gantt-border, #dee2e6);border-right:1px solid var(--ngx-gantt-border, #dee2e6);cursor:col-resize;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;z-index:2}.k-splitbar:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-splitbar-icon{color:var(--ngx-gantt-text-secondary, #6c757d);font-size:14px;line-height:1}.k-gantt-timeline{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}.k-timeline-header{flex-shrink:0;overflow:hidden;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-timeline-header-wrap{position:relative;display:flex;flex-direction:column;height:100%}.k-header-row{position:relative;flex:1}.k-header-primary{border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-header-group-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:var(--ngx-gantt-header-font-size, 12px);font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;box-sizing:border-box}.k-header-tick-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;box-sizing:border-box}.k-header-tick-cell.k-weekend{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02));color:#adb5bd}.k-header-tick-cell.k-today-header{color:var(--ngx-gantt-today-color, #ff6358);font-weight:700}.k-timeline-content{flex:1;overflow:auto}.k-timeline-canvas{position:relative}.k-gantt-rows{position:absolute;top:0;left:0;right:0}.k-gantt-row{position:absolute;left:0;right:0;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-gantt-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-gantt-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-gantt-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-gantt-columns{position:absolute;top:0;left:0}.k-gantt-column{position:absolute;top:0;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);box-sizing:border-box}.k-gantt-column.k-weekend-col{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02))}.k-today-marker{position:absolute;top:0;width:2px;background:var(--ngx-gantt-today-color, #ff6358);z-index:3;pointer-events:none}.k-today-indicator{position:absolute;top:-1px;left:-5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid var(--ngx-gantt-today-color, #ff6358)}.k-gantt-tasks{position:absolute;top:0;left:0;z-index:2}.k-task-wrap{position:absolute;left:0;right:0;display:flex;align-items:center;pointer-events:none}.k-task{position:absolute;height:var(--ngx-gantt-bar-height, 24px);background:var(--ngx-gantt-bar-bg, #4a90d9);border-radius:4px;cursor:grab;pointer-events:all;display:flex;align-items:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease;-webkit-user-select:none;user-select:none}.k-task:hover{box-shadow:0 3px 8px #0000002e,0 1px 3px #0000001a}.k-task:active{cursor:grabbing}.k-task.k-focused{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:2px}.k-task.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:1px}.k-task-progress{position:absolute;top:0;left:0;height:100%;overflow:hidden;border-radius:4px 0 0 4px}.k-task-progress-inner{width:10000px;height:100%;background:var(--ngx-gantt-bar-progress-bg, #2d6cb4)}.k-task-text{position:relative;z-index:1;padding:0 8px;color:var(--ngx-gantt-bar-text, #ffffff);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.15)}.k-resize-handle{position:absolute;top:0;width:6px;height:100%;cursor:col-resize;pointer-events:all;z-index:2}.k-resize-w{left:0}.k-resize-e{right:0}.k-resize-handle:hover{background:#ffffff40}.k-task-with-subtasks{overflow:hidden;box-shadow:none}.k-task-with-subtasks:hover{box-shadow:none}.k-task-with-subtasks.k-dragging{background:#0000000f!important;border:1px dashed rgba(0,0,0,.2);border-radius:4px}.k-task-with-subtasks.k-dragging .k-subtask-segment{pointer-events:none;transition:none}.k-subtask-segment{position:absolute;top:0;height:100%;border-radius:4px;display:flex;align-items:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease,transform .1s ease;cursor:pointer;pointer-events:all;min-width:4px}.k-subtask-segment:hover{box-shadow:0 3px 8px #00000038,0 1px 3px #0000001f;transform:scaleY(1.08);z-index:1}.k-subtask-text{position:relative;z-index:1;padding:0 6px;color:#fff;font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.2)}.k-subtask-progress{position:absolute;top:0;left:0;height:100%;background:#00000026;border-radius:4px 0 0 4px;pointer-events:none}.k-bar-tooltip-divider{height:1px;background:#ffffff26;margin:6px 0}.k-task-summary{position:absolute;height:10px;pointer-events:all;cursor:pointer;display:flex;align-items:flex-end}.k-task-summary.k-focused,.k-task-summary.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:3px;border-radius:2px}.k-summary-bar{position:relative;width:100%;height:6px;background:var(--ngx-gantt-summary-color, #495057);border-radius:0}.k-summary-progress{height:100%;background:#343a40}.k-summary-left-cap,.k-summary-right-cap{position:absolute;bottom:0;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(--ngx-gantt-summary-color, #495057)}.k-summary-left-cap{left:-1px}.k-summary-right-cap{right:-1px}.k-milestone{position:absolute;pointer-events:all;cursor:pointer}.k-milestone.k-focused,.k-milestone.k-selected{outline:2px solid var(--ngx-gantt-focus-ring, #4a90d9);outline-offset:4px;border-radius:2px}.k-milestone-diamond{width:16px;height:16px;background:var(--ngx-gantt-milestone-color, #e74c3c);transform:rotate(45deg);border-radius:2px;box-shadow:0 1px 3px #00000026}.k-gantt-dependencies{position:absolute;top:0;left:0;z-index:1;pointer-events:none}.k-dep-line{fill:none;stroke:var(--ngx-gantt-arrow-color, #ff6358);stroke-width:1.5;pointer-events:stroke;cursor:pointer}.k-dep-line:hover{stroke-width:3}@keyframes k-tooltip-fadein{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.k-bar-tooltip{position:fixed;z-index:9999;background:var(--ngx-gantt-tooltip-bg, #2d3748);color:var(--ngx-gantt-tooltip-text, #ffffff);border-radius:6px;padding:10px 14px;min-width:180px;box-shadow:0 4px 16px #00000038;pointer-events:none;font-size:12px;line-height:1.5;animation:k-tooltip-fadein .15s ease}.k-bar-tooltip-title{font-weight:700;font-size:13px;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.k-bar-tooltip-row{display:flex;justify-content:space-between;gap:12px;margin-top:3px}.k-bar-tooltip-label{color:var(--ngx-gantt-tooltip-label, rgba(255,255,255,.65));white-space:nowrap}.k-bar-tooltip-value{font-weight:500;white-space:nowrap}.k-row-tooltip{min-width:240px}.k-row-tooltip-task{display:flex;align-items:center;gap:6px;margin-top:5px;padding-top:5px;border-top:1px solid rgba(255,255,255,.12)}.k-row-tooltip-task:first-of-type{border-top:none}.k-row-tooltip-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.k-row-tooltip-name{flex:1;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-gantt.k-no-grid .k-header-cell,.k-gantt.k-no-grid .k-treelist-cell,.k-gantt.k-no-grid .k-treelist-row,.k-gantt.k-no-grid .k-header-group-cell,.k-gantt.k-no-grid .k-header-tick-cell,.k-gantt.k-no-grid .k-gantt-row,.k-gantt.k-no-grid .k-gantt-column{border:none!important}\n"] }]
|
|
2722
|
+
`, styles: [":host{display:block;height:100%;min-height:var(--ngx-gantt-min-height, 420px);position:relative}.k-gantt{display:flex;flex-direction:column;height:100%;min-height:inherit;width:100%;background:var(--ngx-gantt-bg, #ffffff);border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;font-family:var(--ngx-gantt-font, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);font-size:var(--ngx-gantt-font-size, 13px);color:var(--ngx-gantt-text, #212529);overflow:hidden;position:relative}.k-gantt-body{display:flex;flex:1;min-height:0;overflow:hidden}.k-gantt-toolbar{display:flex;align-items:center;gap:12px;padding:8px 12px;border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);background:var(--ngx-gantt-header-bg, #f1f3f5);flex-shrink:0}.k-toolbar-group{display:flex;gap:4px}.k-toolbar-btn{padding:4px 12px;border:1px solid var(--ngx-gantt-border, #dee2e6);border-radius:4px;background:var(--ngx-gantt-bg, #fff);color:var(--ngx-gantt-text, #212529);font-size:12px;cursor:pointer;font-family:inherit;transition:all .12s}.k-toolbar-btn:hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)}.k-toolbar-btn.k-active{background:var(--k-primary, #4a90d9);color:#fff;border-color:var(--k-primary, #4a90d9)}.k-gantt-treelist{display:flex;flex-direction:column;flex-shrink:0;border-right:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;background:var(--ngx-gantt-bg, #ffffff)}.k-treelist-header{flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6);overflow:hidden;display:flex;align-items:flex-end}.k-treelist-header-table,.k-treelist-table{width:100%;border-collapse:collapse;table-layout:fixed}.k-header-cell{padding:8px;text-align:left;font-size:12px;font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-header-cell:last-child{border-right:none;text-align:center}.k-treelist-content{flex:1;overflow-y:auto;overflow-x:hidden}.k-treelist-row{cursor:default;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-treelist-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-treelist-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-treelist-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-treelist-cell{padding:0 8px;height:100%;vertical-align:middle;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.k-treelist-cell:last-child{border-right:none}.k-group-header-row{background:var(--ngx-gantt-header-bg, #f1f3f5)!important;font-weight:600}.k-group-cell{display:flex;align-items:center;gap:4px}.k-group-title{font-size:13px;font-weight:700}.k-group-row{background:var(--ngx-gantt-header-bg, #f1f3f5)!important}.k-name-cell{display:flex;align-items:center;gap:0}.k-indent{display:inline-block;flex-shrink:0}.k-name-wrapper{display:flex;flex-direction:column;min-width:0;justify-content:center;gap:2px;overflow:hidden}.k-extra-tasks-chips{display:flex;flex-wrap:wrap;gap:3px}.k-extra-task-chip{display:inline-flex;align-items:center;padding:0 5px;height:14px;border-radius:7px;font-size:10px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:110px;opacity:.9;font-weight:500}.k-multi-pct{cursor:help}.k-drag-handle{cursor:grab;color:var(--ngx-gantt-text-secondary, #6c757d);font-size:12px;padding:0 4px;flex-shrink:0;opacity:.5;-webkit-user-select:none;user-select:none}.k-drag-handle:hover{opacity:1}.k-collapse-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:var(--ngx-gantt-text-secondary, #6c757d);border-radius:3px}.k-collapse-btn:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-icon{font-size:8px;transition:transform .15s ease;display:inline-block}.k-icon.k-collapsed{transform:rotate(-90deg)}.k-collapse-spacer{display:inline-block;width:20px;flex-shrink:0}.k-milestone-icon{color:var(--ngx-gantt-milestone-color, #e74c3c);margin-right:4px;font-size:10px;flex-shrink:0}.k-task-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-summary-name{font-weight:600}.k-date-cell{font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);text-align:center}.k-pct-cell{font-size:11px;text-align:center;font-weight:500}.k-splitbar{width:7px;flex-shrink:0;background:var(--ngx-gantt-header-bg, #f1f3f5);border-left:1px solid var(--ngx-gantt-border, #dee2e6);border-right:1px solid var(--ngx-gantt-border, #dee2e6);cursor:col-resize;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;z-index:2}.k-splitbar:hover{background:var(--ngx-gantt-border, #dee2e6)}.k-splitbar-icon{color:var(--ngx-gantt-text-secondary, #6c757d);font-size:14px;line-height:1}.k-gantt-timeline{flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}.k-timeline-header{flex-shrink:0;overflow:hidden;background:var(--ngx-gantt-header-bg, #f1f3f5);border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-timeline-header-wrap{position:relative;display:flex;flex-direction:column;height:100%}.k-header-row{position:relative;flex:1}.k-header-primary{border-bottom:1px solid var(--ngx-gantt-border, #dee2e6)}.k-header-group-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;color:var(--ngx-gantt-header-text, #495057);border-right:1px solid var(--ngx-gantt-border, #dee2e6);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;box-sizing:border-box}.k-header-tick-cell{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ngx-gantt-text-secondary, #6c757d);border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);white-space:nowrap;box-sizing:border-box}.k-header-tick-cell.k-weekend{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02));color:#adb5bd}.k-header-tick-cell.k-today-header{color:var(--k-danger, #ff6358);font-weight:700}.k-timeline-content{flex:1;overflow:auto}.k-timeline-canvas{position:relative}.k-gantt-rows{position:absolute;top:0;left:0;right:0}.k-gantt-row{position:absolute;left:0;right:0;border-bottom:1px solid var(--ngx-gantt-grid-line, #ebedf0)}.k-gantt-row.k-alt{background:var(--ngx-gantt-alt-bg, #f8f9fa)}.k-gantt-row.k-hover{background:var(--ngx-gantt-hover-bg, #e8f0fe)!important}.k-gantt-row.k-selected{background:var(--ngx-gantt-selected-bg, #d0e1f9)!important}.k-gantt-columns{position:absolute;top:0;left:0}.k-gantt-column{position:absolute;top:0;border-right:1px solid var(--ngx-gantt-grid-line, #ebedf0);box-sizing:border-box}.k-gantt-column.k-weekend-col{background:var(--ngx-gantt-weekend-bg, rgba(0,0,0,.02))}.k-today-marker{position:absolute;top:0;width:2px;background:var(--k-danger, #ff6358);z-index:3;pointer-events:none}.k-today-indicator{position:absolute;top:-1px;left:-5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid var(--k-danger, #ff6358)}.k-gantt-baselines{position:absolute;top:0;left:0;z-index:1}.k-baseline-bar{position:absolute;background:#00000014;border:1px dashed rgba(0,0,0,.15);border-radius:3px;pointer-events:none}.k-gantt-tasks{position:absolute;top:0;left:0;z-index:2}.k-task-wrap{position:absolute;left:0;right:0;display:flex;align-items:center;pointer-events:none}.k-task{position:absolute;height:var(--ngx-gantt-bar-height, 24px);border-radius:4px;cursor:grab;pointer-events:all;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000000f;transition:box-shadow .15s ease;-webkit-user-select:none;user-select:none}.k-task:hover{box-shadow:0 3px 8px #0000002e,0 1px 3px #0000001a}.k-task:active{cursor:grabbing}.k-task.k-focused{outline:2px solid var(--k-primary, #4a90d9);outline-offset:2px}.k-task.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:1px}.k-task-range{height:8px!important;border-radius:4px;cursor:pointer;opacity:.8}.k-task-range .k-task-text{font-size:10px}.k-task-progress{position:absolute;top:0;left:0;height:100%;overflow:hidden;border-radius:4px 0 0 4px}.k-task-progress-inner{width:10000px;height:100%;background:var(--ngx-gantt-bar-progress-bg, rgba(0,0,0,.15))}.k-task-text{position:relative;z-index:1;padding:0 8px;color:var(--ngx-gantt-bar-text, #ffffff);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.15)}.k-resize-handle{position:absolute;top:0;width:6px;height:100%;cursor:col-resize;pointer-events:all;z-index:2}.k-resize-w{left:0}.k-resize-e{right:0}.k-resize-handle:hover{background:#ffffff40}.k-link-connector{position:absolute;top:50%;width:10px;height:10px;border-radius:50%;background:var(--k-danger, #ff6358);transform:translateY(-50%);cursor:crosshair;pointer-events:all;opacity:0;transition:opacity .15s ease;z-index:5}.k-task:hover .k-link-connector{opacity:1}.k-link-start{left:-5px}.k-link-end{right:-5px}.k-link-drag-line{pointer-events:none}.k-task-with-subtasks{overflow:hidden;box-shadow:none}.k-task-with-subtasks:hover{box-shadow:none}.k-task-with-subtasks.k-dragging{background:#0000000f!important;border:1px dashed rgba(0,0,0,.2);border-radius:4px}.k-subtask-segment{position:absolute;top:0;height:100%;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 3px #0000001f;transition:box-shadow .15s ease,transform .1s ease;cursor:pointer;pointer-events:all;min-width:4px}.k-subtask-segment:hover{box-shadow:0 3px 8px #00000038;transform:scaleY(1.08);z-index:1}.k-subtask-segment.transit-arrow{height:40%;top:30%;border-radius:2px;box-shadow:none}.k-subtask-text{position:relative;z-index:1;padding:0 6px;color:#fff;font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(0,0,0,.2)}.k-subtask-progress{position:absolute;top:0;left:0;height:100%;background:#00000026;border-radius:4px 0 0 4px;pointer-events:none}.k-task-summary{position:absolute;height:10px;pointer-events:all;cursor:pointer;display:flex;align-items:flex-end}.k-task-summary.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:3px;border-radius:2px}.k-summary-bar{position:relative;width:100%;height:6px;background:var(--ngx-gantt-summary-color, #495057)}.k-summary-progress{height:100%;background:#343a40}.k-summary-left-cap,.k-summary-right-cap{position:absolute;bottom:0;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(--ngx-gantt-summary-color, #495057)}.k-summary-left-cap{left:-1px}.k-summary-right-cap{right:-1px}.k-milestone{position:absolute;pointer-events:all;cursor:pointer}.k-milestone.k-selected{outline:2px solid var(--k-primary, #4a90d9);outline-offset:4px;border-radius:2px}.k-milestone-diamond{width:16px;height:16px;background:var(--ngx-gantt-milestone-color, #e74c3c);transform:rotate(45deg);border-radius:2px;box-shadow:0 1px 3px #00000026}.k-gantt-dependencies{position:absolute;top:0;left:0;z-index:1;pointer-events:none}.k-dep-line{fill:none;stroke:var(--k-danger, #ff6358);stroke-width:1.5;pointer-events:stroke;cursor:pointer}.k-dep-line:hover{stroke-width:3}.k-loading-overlay{position:absolute;inset:0;background:#ffffffb3;z-index:100;display:flex;align-items:center;justify-content:center}.k-loading-spinner{display:flex;flex-direction:column;align-items:center;gap:12px}@keyframes k-spin{to{transform:rotate(360deg)}}.k-spinner-circle{width:32px;height:32px;border:3px solid var(--ngx-gantt-border, #dee2e6);border-top-color:var(--k-primary, #4a90d9);border-radius:50%;animation:k-spin .8s linear infinite}.k-loading-text{font-size:12px;color:var(--ngx-gantt-text-secondary, #6c757d)}@keyframes k-tooltip-fadein{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.k-bar-tooltip{position:absolute;z-index:9999;background:var(--ngx-gantt-tooltip-bg, #2d3748);color:var(--ngx-gantt-tooltip-text, #ffffff);border-radius:6px;padding:10px 14px;min-width:180px;box-shadow:0 4px 16px #00000038;pointer-events:none;font-size:12px;line-height:1.5;animation:k-tooltip-fadein .15s ease}.k-bar-tooltip-title{font-weight:700;font-size:13px;margin-bottom:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.k-bar-tooltip-row{display:flex;gap:12px;margin-top:3px}.k-bar-tooltip-label{color:var(--ngx-gantt-tooltip-label, rgba(255,255,255,.65));white-space:nowrap;min-width:60px;flex-shrink:0}.k-bar-tooltip-value{font-weight:500;white-space:nowrap;text-align:right;margin-left:auto}.k-row-tooltip{min-width:240px}.k-row-tooltip-task{display:flex;align-items:center;gap:6px;margin-top:5px;padding-top:5px;border-top:1px solid rgba(255,255,255,.12)}.k-row-tooltip-task:first-of-type{border-top:none}.k-row-tooltip-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.k-row-tooltip-name{flex:1;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.k-gantt.k-no-grid .k-header-cell,.k-gantt.k-no-grid .k-treelist-cell,.k-gantt.k-no-grid .k-treelist-row,.k-gantt.k-no-grid .k-header-group-cell,.k-gantt.k-no-grid .k-header-tick-cell,.k-gantt.k-no-grid .k-gantt-row,.k-gantt.k-no-grid .k-gantt-column{border:none!important}\n"] }]
|
|
2603
2723
|
}], ctorParameters: () => [] });
|
|
2604
|
-
function
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
return new Date(Math.
|
|
2609
|
-
}
|
|
2610
|
-
function getRowEndForCell(row) {
|
|
2611
|
-
if (row.extraTasks.length === 0)
|
|
2612
|
-
return row.task.end;
|
|
2613
|
-
const times = [row.task.end, ...row.extraTasks.map(t => t.end)].map(d => d.getTime());
|
|
2614
|
-
return new Date(Math.max(...times));
|
|
2615
|
-
}
|
|
2724
|
+
function flipCoord(cursor, size, viewport) { const O = 14; return cursor + O + size > viewport ? cursor - size - O : cursor + O; }
|
|
2725
|
+
function getRowStart(row) { if (row.extraTasks.length === 0)
|
|
2726
|
+
return row.task.start; return new Date(Math.min(row.task.start.getTime(), ...row.extraTasks.map(t => t.start.getTime()))); }
|
|
2727
|
+
function getRowEnd(row) { if (row.extraTasks.length === 0)
|
|
2728
|
+
return row.task.end; return new Date(Math.max(row.task.end.getTime(), ...row.extraTasks.map(t => t.end.getTime()))); }
|
|
2616
2729
|
|
|
2617
2730
|
/*
|
|
2618
2731
|
* Public API Surface — secondary entry point: ngx-core-components/charts
|
|
@@ -2623,5 +2736,5 @@ function getRowEndForCell(row) {
|
|
|
2623
2736
|
* Generated bundle index. Do not edit.
|
|
2624
2737
|
*/
|
|
2625
2738
|
|
|
2626
|
-
export { BarChartComponent, CHART_COLORS, DEFAULT_GANTT_CONFIG, DependencyType, GanttChartComponent, GanttScaleService, LineChartComponent, PieChartComponent, SparklineComponent, ZoomLevel, addDays, addMonths, addWeeks, diffDays, getColumnDates, getDateRange, isWeekend, snapToDay, startOfDay, startOfMonth, startOfWeek };
|
|
2739
|
+
export { BarChartComponent, CHART_COLORS, DEFAULT_GANTT_CONFIG, DependencyType, GanttChartComponent, GanttItemType, GanttLinkLineType, GanttPrintService, GanttScaleService, LineChartComponent, PieChartComponent, SparklineComponent, ZoomLevel, addDays, addHours, addMonths, addQuarters, addWeeks, addYears, daysInMonth, diffDays, diffHours, getColumnDates, getDateRange, isWeekend, snapToDay, startOfDay, startOfHour, startOfMonth, startOfQuarter, startOfWeek, startOfYear };
|
|
2627
2740
|
//# sourceMappingURL=ngx-core-components-charts.mjs.map
|