@syncfusion/ej2-gantt 23.2.5 → 24.1.41
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/CHANGELOG.md +3 -0
- package/dist/ej2-gantt.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +2980 -336
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +3034 -370
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +21 -21
- package/src/gantt/actions/cell-edit.js +7 -3
- package/src/gantt/actions/chart-scroll.d.ts +9 -1
- package/src/gantt/actions/chart-scroll.js +111 -3
- package/src/gantt/actions/connector-line-edit.js +8 -1
- package/src/gantt/actions/context-menu.js +2 -2
- package/src/gantt/actions/day-markers.d.ts +2 -1
- package/src/gantt/actions/dependency.js +2 -2
- package/src/gantt/actions/dialog-edit.d.ts +24 -0
- package/src/gantt/actions/dialog-edit.js +383 -1
- package/src/gantt/actions/edit.js +104 -41
- package/src/gantt/actions/keyboard.js +5 -1
- package/src/gantt/actions/pdf-export.js +12 -4
- package/src/gantt/actions/rowdragdrop.js +24 -5
- package/src/gantt/actions/selection.js +6 -3
- package/src/gantt/actions/taskbar-edit.d.ts +14 -0
- package/src/gantt/actions/taskbar-edit.js +513 -78
- package/src/gantt/actions/toolbar.js +4 -1
- package/src/gantt/base/css-constants.d.ts +2 -0
- package/src/gantt/base/css-constants.js +2 -0
- package/src/gantt/base/enum.d.ts +22 -0
- package/src/gantt/base/gantt-chart.js +63 -21
- package/src/gantt/base/gantt-model.d.ts +9 -1
- package/src/gantt/base/gantt.d.ts +11 -1
- package/src/gantt/base/gantt.js +46 -18
- package/src/gantt/base/interface.d.ts +135 -3
- package/src/gantt/base/splitter.js +6 -0
- package/src/gantt/base/task-processor.d.ts +1 -1
- package/src/gantt/base/task-processor.js +37 -9
- package/src/gantt/base/tree-grid.js +1 -1
- package/src/gantt/export/export-helper.d.ts +12 -0
- package/src/gantt/export/export-helper.js +316 -9
- package/src/gantt/export/pdf-base/pdf-grid-table.js +14 -1
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +36 -0
- package/src/gantt/export/pdf-connector-line.js +137 -32
- package/src/gantt/export/pdf-event-marker.d.ts +10 -0
- package/src/gantt/export/pdf-event-marker.js +57 -0
- package/src/gantt/export/pdf-gantt.d.ts +2 -0
- package/src/gantt/export/pdf-gantt.js +30 -10
- package/src/gantt/export/pdf-taskbar.d.ts +23 -2
- package/src/gantt/export/pdf-taskbar.js +771 -43
- package/src/gantt/export/pdf-timeline.d.ts +9 -0
- package/src/gantt/export/pdf-timeline.js +98 -20
- package/src/gantt/models/column.d.ts +12 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +29 -16
- package/src/gantt/renderer/connector-line.js +8 -5
- package/src/gantt/renderer/edit-tooltip.js +3 -0
- package/src/gantt/renderer/event-marker.js +4 -1
- package/src/gantt/renderer/nonworking-day.js +18 -5
- package/src/gantt/renderer/timeline.d.ts +9 -0
- package/src/gantt/renderer/timeline.js +169 -21
- package/styles/bootstrap-dark.css +77 -16
- package/styles/bootstrap.css +78 -17
- package/styles/bootstrap4.css +78 -17
- package/styles/bootstrap5-dark.css +78 -17
- package/styles/bootstrap5.css +78 -17
- package/styles/fabric-dark.css +78 -17
- package/styles/fabric.css +78 -17
- package/styles/fluent-dark.css +78 -17
- package/styles/fluent.css +78 -17
- package/styles/gantt/_bootstrap-dark-definition.scss +7 -2
- package/styles/gantt/_bootstrap-definition.scss +7 -2
- package/styles/gantt/_bootstrap4-definition.scss +7 -2
- package/styles/gantt/_bootstrap5-definition.scss +7 -2
- package/styles/gantt/_fabric-dark-definition.scss +7 -2
- package/styles/gantt/_fabric-definition.scss +7 -2
- package/styles/gantt/_fluent-definition.scss +7 -2
- package/styles/gantt/_fusionnew-definition.scss +6 -2
- package/styles/gantt/_highcontrast-definition.scss +7 -2
- package/styles/gantt/_highcontrast-light-definition.scss +7 -2
- package/styles/gantt/_layout.scss +92 -20
- package/styles/gantt/_material-dark-definition.scss +7 -2
- package/styles/gantt/_material-definition.scss +7 -2
- package/styles/gantt/_material3-definition.scss +7 -2
- package/styles/gantt/_tailwind-definition.scss +6 -1
- package/styles/gantt/_theme.scss +11 -0
- package/styles/gantt/bootstrap-dark.css +77 -16
- package/styles/gantt/bootstrap.css +78 -17
- package/styles/gantt/bootstrap4.css +78 -17
- package/styles/gantt/bootstrap5-dark.css +78 -17
- package/styles/gantt/bootstrap5.css +78 -17
- package/styles/gantt/fabric-dark.css +78 -17
- package/styles/gantt/fabric.css +78 -17
- package/styles/gantt/fluent-dark.css +78 -17
- package/styles/gantt/fluent.css +78 -17
- package/styles/gantt/highcontrast-light.css +78 -17
- package/styles/gantt/highcontrast.css +78 -17
- package/styles/gantt/material-dark.css +78 -17
- package/styles/gantt/material.css +78 -17
- package/styles/gantt/material3-dark.css +77 -16
- package/styles/gantt/material3.css +77 -16
- package/styles/gantt/tailwind-dark.css +78 -17
- package/styles/gantt/tailwind.css +78 -17
- package/styles/highcontrast-light.css +78 -17
- package/styles/highcontrast.css +78 -17
- package/styles/material-dark.css +78 -17
- package/styles/material.css +78 -17
- package/styles/material3-dark.css +77 -16
- package/styles/material3.css +77 -16
- package/styles/tailwind-dark.css +78 -17
- package/styles/tailwind.css +78 -17
|
@@ -29,10 +29,18 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
29
29
|
};
|
|
30
30
|
PdfGanttPredecessor.prototype.findindex = function (num) {
|
|
31
31
|
var dataindex;
|
|
32
|
-
this.parent.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if (!this.parent.enableVirtualization) {
|
|
33
|
+
this.parent.currentViewData.map(function (data, index) { if (data.index == num) {
|
|
34
|
+
dataindex = index;
|
|
35
|
+
} });
|
|
36
|
+
return dataindex;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.parent.flatData.map(function (data, index) { if (data.index == num) {
|
|
40
|
+
dataindex = index;
|
|
41
|
+
} });
|
|
42
|
+
return dataindex;
|
|
43
|
+
}
|
|
36
44
|
};
|
|
37
45
|
/**
|
|
38
46
|
* Calculate the predecesor line point and draw the predecessor
|
|
@@ -163,9 +171,10 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
163
171
|
}
|
|
164
172
|
break;
|
|
165
173
|
}
|
|
174
|
+
var midPointManualparent = Math.round((this.parent.rowHeight - 15) / 2.0);
|
|
166
175
|
var midPointforTaskbar = Math.round((this.parent.rowHeight - 1) / 2.0);
|
|
167
176
|
var midPointforBaseline = Math.round((this.parent.rowHeight - 10) / 2.0);
|
|
168
|
-
var midPoint = this.parent.renderBaseline ? midPointforBaseline : midPointforTaskbar;
|
|
177
|
+
var midPoint = this.parent.renderBaseline ? midPointforBaseline : ((!parentTask.isAutoSchedule && parentTask.isParentTask) || (!childTask.isAutoSchedule && childTask.isParentTask)) ? midPointManualparent : midPointforTaskbar;
|
|
169
178
|
midPoint = pixelToPoint(midPoint);
|
|
170
179
|
/* eslint-disable-next-line */
|
|
171
180
|
var point1, point2, point3, point4, point5, point6;
|
|
@@ -174,16 +183,35 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
174
183
|
var childTaskpoint = __assign({}, childTask.taskStartPoint);
|
|
175
184
|
parentY = parentTaskpoint.y + parentPageData.startPoint.y;
|
|
176
185
|
childY = childTaskpoint.y + childPageData.startPoint.y;
|
|
177
|
-
var ffpoint1
|
|
178
|
-
var sspoint1
|
|
179
|
-
var ffpoint3
|
|
180
|
-
var ffpoint4
|
|
181
|
-
var sspoint4
|
|
186
|
+
var ffpoint1;
|
|
187
|
+
var sspoint1;
|
|
188
|
+
var ffpoint3;
|
|
189
|
+
var ffpoint4;
|
|
190
|
+
var sspoint4;
|
|
191
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
192
|
+
ffpoint1 = new PointF((this.parentLeft + this.parentWidth), parentY + midPoint);
|
|
193
|
+
sspoint1 = new PointF((this.parentLeft) - 1, parentY + midPoint);
|
|
194
|
+
ffpoint3 = new PointF((this.childLeft - 20), childY + midPoint);
|
|
195
|
+
ffpoint4 = new PointF((this.childLeft - 6 - this.lineWidth) - 1, childY + midPoint);
|
|
196
|
+
sspoint4 = new PointF((this.childLeft + this.childWidth + 6 + this.lineWidth) + 1, childY + midPoint);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
ffpoint1 = new PointF(pixelToPoint(this.parentLeft + this.parentWidth), parentY + midPoint);
|
|
200
|
+
sspoint1 = new PointF(pixelToPoint(this.parentLeft) - 1, parentY + midPoint);
|
|
201
|
+
ffpoint3 = new PointF(pixelToPoint(this.childLeft - 20), childY + midPoint);
|
|
202
|
+
ffpoint4 = new PointF(pixelToPoint(this.childLeft - 6 - this.lineWidth) - 1, childY + midPoint);
|
|
203
|
+
sspoint4 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 6 + this.lineWidth) + 1, childY + midPoint);
|
|
204
|
+
}
|
|
182
205
|
switch (predecessorType) {
|
|
183
206
|
case 'FSType1':
|
|
184
207
|
case 'FSType3':
|
|
185
208
|
point1 = ffpoint1;
|
|
186
|
-
|
|
209
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
210
|
+
point2 = new PointF((this.childLeft - 20), parentY + midPoint);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
point2 = new PointF(pixelToPoint(this.childLeft - 20), parentY + midPoint);
|
|
214
|
+
}
|
|
187
215
|
point3 = ffpoint3;
|
|
188
216
|
point4 = ffpoint4;
|
|
189
217
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
@@ -192,7 +220,12 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
192
220
|
point1 = ffpoint1;
|
|
193
221
|
point2 = new PointF(point1.x + 10, parentY + midPoint);
|
|
194
222
|
point3 = new PointF(point1.x + 10, childY + 2);
|
|
195
|
-
|
|
223
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
224
|
+
point4 = new PointF((this.childLeft - 20), childY + 2);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
point4 = new PointF(pixelToPoint(this.childLeft - 20), childY + 2);
|
|
228
|
+
}
|
|
196
229
|
point5 = ffpoint3;
|
|
197
230
|
point6 = ffpoint4;
|
|
198
231
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint, point5, point6);
|
|
@@ -201,23 +234,40 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
201
234
|
point1 = ffpoint1;
|
|
202
235
|
point2 = new PointF(point1.x + 10, parentY + midPoint);
|
|
203
236
|
point3 = new PointF(point1.x + 10, parentY + 2);
|
|
204
|
-
|
|
237
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
238
|
+
point4 = new PointF((this.childLeft - 20), parentY + 2);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
point4 = new PointF(pixelToPoint(this.childLeft - 20), parentY + 2);
|
|
242
|
+
}
|
|
205
243
|
point5 = ffpoint3;
|
|
206
244
|
point6 = ffpoint4;
|
|
207
245
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint, point5, point6);
|
|
208
246
|
break;
|
|
209
247
|
case 'FFType1':
|
|
210
248
|
case 'FFType3':
|
|
211
|
-
|
|
212
|
-
|
|
249
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
250
|
+
point1 = new PointF((this.parentLeft + this.parentWidth) + 1, parentY + midPoint);
|
|
251
|
+
point2 = new PointF((this.childLeft + this.childWidth + 20), parentY + midPoint);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
point1 = new PointF(pixelToPoint(this.parentLeft + this.parentWidth) + 1, parentY + midPoint);
|
|
255
|
+
point2 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), parentY + midPoint);
|
|
256
|
+
}
|
|
213
257
|
point3 = new PointF(point2.x, childY + midPoint);
|
|
214
258
|
point4 = sspoint4;
|
|
215
259
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
216
260
|
break;
|
|
217
261
|
case 'FFType2':
|
|
218
262
|
case 'FFType4':
|
|
219
|
-
|
|
220
|
-
|
|
263
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
264
|
+
point1 = new PointF((this.parentLeft + this.parentWidth) + 1, parentY + midPoint);
|
|
265
|
+
point2 = new PointF((this.parentLeft + this.parentWidth + 20), parentY + midPoint);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
point1 = new PointF(pixelToPoint(this.parentLeft + this.parentWidth) + 1, parentY + midPoint);
|
|
269
|
+
point2 = new PointF(pixelToPoint(this.parentLeft + this.parentWidth + 20), parentY + midPoint);
|
|
270
|
+
}
|
|
221
271
|
point3 = new PointF(point2.x, childY + midPoint);
|
|
222
272
|
point4 = sspoint4;
|
|
223
273
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
@@ -225,7 +275,12 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
225
275
|
case 'SSType1':
|
|
226
276
|
case 'SSType3':
|
|
227
277
|
point1 = sspoint1;
|
|
228
|
-
|
|
278
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
279
|
+
point2 = new PointF((this.childLeft - 20), parentY + midPoint);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
point2 = new PointF(pixelToPoint(this.childLeft - 20), parentY + midPoint);
|
|
283
|
+
}
|
|
229
284
|
point3 = new PointF(point2.x, childY + midPoint);
|
|
230
285
|
point4 = ffpoint4;
|
|
231
286
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
@@ -233,7 +288,12 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
233
288
|
case 'SSType2':
|
|
234
289
|
case 'SSType4':
|
|
235
290
|
point1 = sspoint1;
|
|
236
|
-
|
|
291
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
292
|
+
point2 = new PointF((this.parentLeft - 20), parentY + midPoint);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
point2 = new PointF(pixelToPoint(this.parentLeft - 20), parentY + midPoint);
|
|
296
|
+
}
|
|
237
297
|
point3 = new PointF(point2.x, childY + midPoint);
|
|
238
298
|
point4 = ffpoint4;
|
|
239
299
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
@@ -241,25 +301,42 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
241
301
|
case 'SFType1':
|
|
242
302
|
case 'SFType3':
|
|
243
303
|
point1 = sspoint1;
|
|
244
|
-
|
|
304
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
305
|
+
point2 = new PointF((this.childLeft + this.childWidth + 20), parentY + midPoint);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
point2 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), parentY + midPoint);
|
|
309
|
+
}
|
|
245
310
|
point3 = new PointF(point2.x, childY + midPoint);
|
|
246
311
|
point4 = sspoint4;
|
|
247
312
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint);
|
|
248
313
|
break;
|
|
249
314
|
case 'SFType2':
|
|
250
315
|
point1 = sspoint1;
|
|
251
|
-
|
|
316
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
317
|
+
point2 = new PointF((this.parentLeft - 20), parentY + midPoint);
|
|
318
|
+
point4 = new PointF((this.childLeft + this.childWidth + 20), childY + 2);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
point2 = new PointF(pixelToPoint(this.parentLeft - 20), parentY + midPoint);
|
|
322
|
+
point4 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), childY + 2);
|
|
323
|
+
}
|
|
252
324
|
point3 = new PointF(point2.x, childY + 2);
|
|
253
|
-
point4 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), childY + 2);
|
|
254
325
|
point5 = new PointF(point4.x, childY + midPoint);
|
|
255
326
|
point6 = sspoint4;
|
|
256
327
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint, point5, point6);
|
|
257
328
|
break;
|
|
258
329
|
case 'SFType4':
|
|
259
330
|
point1 = sspoint1;
|
|
260
|
-
|
|
331
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
332
|
+
point2 = new PointF((this.parentLeft - 20), parentY + midPoint);
|
|
333
|
+
point4 = new PointF((this.childLeft + this.childWidth + 20), parentY + 2);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
point2 = new PointF(pixelToPoint(this.parentLeft - 20), parentY + midPoint);
|
|
337
|
+
point4 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), parentY + 2);
|
|
338
|
+
}
|
|
261
339
|
point3 = new PointF(point2.x, parentY + 2);
|
|
262
|
-
point4 = new PointF(pixelToPoint(this.childLeft + this.childWidth + 20), parentY + 2);
|
|
263
340
|
point5 = new PointF(point4.x, childY + midPoint);
|
|
264
341
|
point6 = sspoint4;
|
|
265
342
|
this.connectLines(startPage, endPage, point1, point2, point3, point4, childTask, midPoint, point5, point6);
|
|
@@ -411,11 +488,21 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
411
488
|
var pdfPages = page.section.getPages();
|
|
412
489
|
var width = 6 + this.lineWidth;
|
|
413
490
|
var point2;
|
|
414
|
-
if (this.
|
|
415
|
-
|
|
491
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
492
|
+
if (this.type === 'FS' || this.type === 'SS') {
|
|
493
|
+
startPoint = new PointF((this.childLeft) - 1, childTask.taskStartPoint.y + pageData.startPoint.y);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
startPoint = new PointF((this.childLeft + this.childWidth) + 1, childTask.taskStartPoint.y + pageData.startPoint.y);
|
|
497
|
+
}
|
|
416
498
|
}
|
|
417
499
|
else {
|
|
418
|
-
|
|
500
|
+
if (this.type === 'FS' || this.type === 'SS') {
|
|
501
|
+
startPoint = new PointF(pixelToPoint(this.childLeft) - 1, childTask.taskStartPoint.y + pageData.startPoint.y);
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
startPoint = new PointF(pixelToPoint(this.childLeft + this.childWidth) + 1, childTask.taskStartPoint.y + pageData.startPoint.y);
|
|
505
|
+
}
|
|
419
506
|
}
|
|
420
507
|
var startPointCheck = this.contains(pageRect, startPoint.x, startPoint.y);
|
|
421
508
|
if (!startPointCheck) {
|
|
@@ -429,15 +516,33 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
429
516
|
startPoint.x = startPoint.x - pageData.startPoint.x + pageData.pageStartX;
|
|
430
517
|
startPoint.y = startPoint.y - pageData.startPoint.y;
|
|
431
518
|
var point1 = new PointF(startPoint.x, startPoint.y + midPoint);
|
|
432
|
-
if (this.
|
|
433
|
-
|
|
519
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
520
|
+
if (this.type === 'FS' || this.type === 'SS') {
|
|
521
|
+
point2 = new PointF(point1.x - (width), point1.y - (width));
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
point2 = new PointF(point1.x + (width), point1.y - (width));
|
|
525
|
+
}
|
|
434
526
|
}
|
|
435
527
|
else {
|
|
436
|
-
|
|
528
|
+
if (this.type === 'FS' || this.type === 'SS') {
|
|
529
|
+
point2 = new PointF(point1.x - pixelToPoint(width), point1.y - pixelToPoint(width));
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
point2 = new PointF(point1.x + pixelToPoint(width), point1.y - pixelToPoint(width));
|
|
533
|
+
}
|
|
437
534
|
}
|
|
438
|
-
var point3 = new PointF(point2.x, point2.y + pixelToPoint(2 * width));
|
|
439
535
|
var brush = new PdfSolidBrush(this.connectorLineColor);
|
|
440
|
-
var
|
|
536
|
+
var point3;
|
|
537
|
+
var predecessorPen;
|
|
538
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
539
|
+
point3 = new PointF(point2.x, point2.y + (2 * width));
|
|
540
|
+
predecessorPen = new PdfPen(brush, (this.lineWidth));
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
point3 = new PointF(point2.x, point2.y + pixelToPoint(2 * width));
|
|
544
|
+
predecessorPen = new PdfPen(brush, pixelToPoint(this.lineWidth));
|
|
545
|
+
}
|
|
441
546
|
graphics.drawLine(predecessorPen, point1, point2);
|
|
442
547
|
graphics.drawLine(predecessorPen, point2, point3);
|
|
443
548
|
graphics.drawLine(predecessorPen, point3, point1);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PointF, PdfColor, PdfPage, PdfFontFamily } from '@syncfusion/ej2-pdf-export';
|
|
2
|
+
import { TimelineDetails, IEventMarkerInfo } from './../base/interface';
|
|
3
|
+
import { Gantt } from '../base/gantt';
|
|
4
|
+
export declare class EventMarker {
|
|
5
|
+
parent: Gantt;
|
|
6
|
+
constructor(parent?: Gantt);
|
|
7
|
+
fontFamily: PdfFontFamily;
|
|
8
|
+
progressFontColor: PdfColor;
|
|
9
|
+
drawEventMarker(page: PdfPage, startPoint: PointF, cumulativeWidth: number, detail: TimelineDetails, eventMarker: IEventMarkerInfo, cumulativeHeight: number): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PointF, PdfColor, PdfPen, PdfSolidBrush, PdfStandardFont, PdfFontFamily, PdfStringFormat, PdfTextAlignment, PdfDashStyle, PdfBrushes } from '@syncfusion/ej2-pdf-export';
|
|
2
|
+
import { pixelToPoint } from '../base/utils';
|
|
3
|
+
import { isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
4
|
+
var EventMarker = /** @class */ (function () {
|
|
5
|
+
function EventMarker(parent) {
|
|
6
|
+
this.parent = parent;
|
|
7
|
+
}
|
|
8
|
+
EventMarker.prototype.drawEventMarker = function (page, startPoint, cumulativeWidth, detail, eventMarker, cumulativeHeight) {
|
|
9
|
+
var taskGraphics = page.graphics;
|
|
10
|
+
var pageSize = page.getClientSize();
|
|
11
|
+
var font = new PdfStandardFont(PdfFontFamily.Helvetica, 10);
|
|
12
|
+
if (!isNullOrUndefined(this.parent.pdfExportModule['helper']['exportProps'].ganttStyle) &&
|
|
13
|
+
this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
|
|
14
|
+
font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
|
|
15
|
+
}
|
|
16
|
+
var strSize;
|
|
17
|
+
if (!isNullOrUndefined(eventMarker.label)) {
|
|
18
|
+
strSize = font.measureString(eventMarker.label);
|
|
19
|
+
}
|
|
20
|
+
var triangle = 8;
|
|
21
|
+
var eventLine = new PdfPen(new PdfColor(0, 0, 0));
|
|
22
|
+
eventLine.dashStyle = PdfDashStyle.Dash;
|
|
23
|
+
if (detail.startDate <= eventMarker.date && eventMarker.date <= detail.endDate) {
|
|
24
|
+
var enventFormat = new PdfStringFormat();
|
|
25
|
+
enventFormat.alignment = PdfTextAlignment.Center;
|
|
26
|
+
var eventBrush = new PdfSolidBrush(new PdfColor(253, 191, 100));
|
|
27
|
+
var left = this.parent.dataOperation.getTaskLeft(this.parent.dateValidationModule.getDateFromFormat(eventMarker.date, true), false, true);
|
|
28
|
+
var diff = 10;
|
|
29
|
+
if (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
30
|
+
taskGraphics.drawLine(eventLine, new PointF(startPoint.x + (left - cumulativeWidth) + diff, cumulativeHeight), new PointF(startPoint.x + (left - cumulativeWidth) + diff, pageSize.height));
|
|
31
|
+
if (!isNullOrUndefined(eventMarker.label)) {
|
|
32
|
+
taskGraphics.save();
|
|
33
|
+
taskGraphics.translateTransform(startPoint.x + (left - cumulativeWidth) + 7 + diff, cumulativeHeight + pixelToPoint(50) + strSize.height / 2);
|
|
34
|
+
taskGraphics.rotateTransform(45);
|
|
35
|
+
taskGraphics.drawRectangle(null, eventBrush, 0, 0, triangle, triangle);
|
|
36
|
+
taskGraphics.restore();
|
|
37
|
+
taskGraphics.drawRectangle(null, eventBrush, startPoint.x + (left - cumulativeWidth) + 7 + diff, cumulativeHeight + pixelToPoint(50), strSize.width + 10, strSize.height * 2);
|
|
38
|
+
taskGraphics.drawString(eventMarker.label, font, null, PdfBrushes.Black, startPoint.x + (left - cumulativeWidth) + 12 + diff, cumulativeHeight + pixelToPoint(50) + pixelToPoint(strSize.height / 2), strSize.width, strSize.height, enventFormat);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
taskGraphics.drawLine(eventLine, new PointF(startPoint.x + pixelToPoint(left - cumulativeWidth) + diff, cumulativeHeight), new PointF(startPoint.x + pixelToPoint(left - cumulativeWidth) + diff, pageSize.height));
|
|
43
|
+
if (!isNullOrUndefined(eventMarker.label)) {
|
|
44
|
+
taskGraphics.save();
|
|
45
|
+
taskGraphics.translateTransform(startPoint.x + pixelToPoint(left - cumulativeWidth) + 7 + diff, cumulativeHeight + pixelToPoint(50) + strSize.height / 2);
|
|
46
|
+
taskGraphics.rotateTransform(45);
|
|
47
|
+
taskGraphics.drawRectangle(null, eventBrush, 0, 0, triangle, triangle);
|
|
48
|
+
taskGraphics.restore();
|
|
49
|
+
taskGraphics.drawRectangle(null, eventBrush, startPoint.x + pixelToPoint(left - cumulativeWidth) + 7 + diff, cumulativeHeight + pixelToPoint(50), strSize.width + 10, strSize.height * 2);
|
|
50
|
+
taskGraphics.drawString(eventMarker.label, font, null, PdfBrushes.Black, startPoint.x + pixelToPoint(left - cumulativeWidth) + 12 + diff, cumulativeHeight + pixelToPoint(50) + pixelToPoint(strSize.height / 2), strSize.width, strSize.height, enventFormat);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return EventMarker;
|
|
56
|
+
}());
|
|
57
|
+
export { EventMarker };
|
|
@@ -5,6 +5,7 @@ import { Gantt } from '../base/gantt';
|
|
|
5
5
|
import { PdfTreeGrid } from './pdf-treegrid';
|
|
6
6
|
import { PdfTimeline } from './pdf-timeline';
|
|
7
7
|
import { PdfGanttPredecessor } from './pdf-connector-line';
|
|
8
|
+
import { EventMarker } from "./pdf-event-marker";
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
10
11
|
*/
|
|
@@ -25,6 +26,7 @@ export declare class PdfGantt extends PdfTreeGrid {
|
|
|
25
26
|
predecessor: PdfGanttPredecessor;
|
|
26
27
|
chartHeader: PdfTimeline;
|
|
27
28
|
chartPageIndex: number;
|
|
29
|
+
eventMarker: EventMarker;
|
|
28
30
|
parent: Gantt;
|
|
29
31
|
constructor(parent: Gantt);
|
|
30
32
|
readonly taskbar: PdfGanttTaskbarCollection;
|
|
@@ -29,6 +29,7 @@ import { PdfTreeGrid } from './pdf-treegrid';
|
|
|
29
29
|
import { PdfTimeline } from './pdf-timeline';
|
|
30
30
|
import { pixelToPoint, pointToPixel } from '../base/utils';
|
|
31
31
|
import { PdfGanttPredecessor } from './pdf-connector-line';
|
|
32
|
+
import { EventMarker } from "./pdf-event-marker";
|
|
32
33
|
/**
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
@@ -39,6 +40,7 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
39
40
|
_this.exportProps = {};
|
|
40
41
|
_this.parent = parent;
|
|
41
42
|
_this.chartHeader = new PdfTimeline(_this);
|
|
43
|
+
_this.eventMarker = new EventMarker(parent);
|
|
42
44
|
_this.predecessor = new PdfGanttPredecessor(parent, _this);
|
|
43
45
|
_this.headerDetails = [];
|
|
44
46
|
_this.pdfPageDetail = [];
|
|
@@ -100,12 +102,10 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
100
102
|
}
|
|
101
103
|
var detail = {};
|
|
102
104
|
var range = [];
|
|
103
|
-
var convertedWidth = (this.parent.pdfExportModule
|
|
104
|
-
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) ? pixelToPoint(this.chartHeader.bottomTierCellWidth) : this.chartHeader.bottomTierCellWidth;
|
|
105
|
+
var convertedWidth = (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) ? pixelToPoint(this.chartHeader.bottomTierCellWidth) : this.chartHeader.bottomTierCellWidth;
|
|
105
106
|
var width = 0;
|
|
106
107
|
if (this.chartHeader.bottomTierCellWidth !== 0) {
|
|
107
|
-
width = (this.parent.pdfExportModule
|
|
108
|
-
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) ? (Math.floor(pageWidth / convertedWidth) * convertedWidth) : (Math.floor(pageWidth / convertedWidth) * convertedWidth) + 5;
|
|
108
|
+
width = (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) ? (Math.floor(pageWidth / convertedWidth) * convertedWidth) : (Math.floor(pageWidth / convertedWidth) * convertedWidth) + 5;
|
|
109
109
|
}
|
|
110
110
|
range[0] = point;
|
|
111
111
|
if (headerWidth - point <= width) {
|
|
@@ -223,14 +223,18 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
223
223
|
var pageData;
|
|
224
224
|
this.headerDetails.forEach(function (detail, index) {
|
|
225
225
|
var page = _this.result.page.section.getPages()[_this.startPageIndex];
|
|
226
|
-
page['contentWidth'] = (_this.parent.pdfExportModule
|
|
227
|
-
_this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) ? pointToPixel(_this.headerDetails[index].endPoint - _this.headerDetails[index].startPoint) : _this.headerDetails[index].endPoint - _this.headerDetails[index].startPoint;
|
|
226
|
+
page['contentWidth'] = (_this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) ? pointToPixel(_this.headerDetails[index].endPoint - _this.headerDetails[index].startPoint) : _this.headerDetails[index].endPoint - _this.headerDetails[index].startPoint;
|
|
228
227
|
_this.chartHeader.drawTimeline(page, _this.startPoint, detail);
|
|
229
228
|
taskbarPoint.y = taskbarPoint.y + pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60); // headerHeight
|
|
230
229
|
pageStartX = taskbarPoint.x;
|
|
231
230
|
cumulativeHeight = pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60); // headerHeight
|
|
232
231
|
_this.headerDetails[_this.headerDetails.indexOf(detail)].startIndex = _this.startPageIndex;
|
|
233
232
|
_this.headerDetails[_this.headerDetails.indexOf(detail)].pageStartPoint = taskbarPoint;
|
|
233
|
+
_this.parent.eventMarkerColloction.map(function (eventMarker) {
|
|
234
|
+
var timelimeHeight = pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
235
|
+
var pdfPage = _this.result.page.section.getPages()[_this.startPageIndex];
|
|
236
|
+
_this.eventMarker.drawEventMarker(pdfPage, taskbarPoint, cumulativeWidth, detail, eventMarker, timelimeHeight);
|
|
237
|
+
});
|
|
234
238
|
for (var i = 0; i < _this.taskbarCollection.length; i++) {
|
|
235
239
|
var task = _this.taskbarCollection[i];
|
|
236
240
|
var rowHeight = _this.rows.getRow(i + 1).height;
|
|
@@ -238,10 +242,11 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
238
242
|
var graphics = pdfPage.graphics;
|
|
239
243
|
var pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
240
244
|
if (page['contentWidth'] && (_this.parent.gridLines == "Both" || _this.parent.gridLines == "Horizontal")) {
|
|
241
|
-
|
|
245
|
+
var lineWidth = _this.chartHeader.timelineWidth;
|
|
246
|
+
graphics.drawRectangle(pen, pageStartX, taskbarPoint.y, (_this.parent.pdfExportModule.gantt.taskbar.isAutoFit() && _this.parent.timelineModule.bottomTier !== "Day") ? page['contentWidth'] + 0.5 : lineWidth, rowHeight);
|
|
242
247
|
}
|
|
243
248
|
/* eslint-disable-next-line */
|
|
244
|
-
var isNextPage = task.drawTaskbar(pdfPage, taskbarPoint, detail, cumulativeWidth, rowHeight, _this.taskbarCollection[i]);
|
|
249
|
+
var isNextPage = task.drawTaskbar(pdfPage, taskbarPoint, detail, cumulativeWidth, rowHeight, _this.taskbarCollection[i], lineWidth);
|
|
245
250
|
if (isNextPage) {
|
|
246
251
|
if (_this.enableHeader) {
|
|
247
252
|
taskbarPoint.y = pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
@@ -254,7 +259,12 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
254
259
|
pageData.height = cumulativeHeight;
|
|
255
260
|
pageData.pageStartX = pageStartX;
|
|
256
261
|
pageData.startPoint = __assign({}, pagePoint);
|
|
257
|
-
|
|
262
|
+
if (_this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
263
|
+
pageData.width = (detail.totalWidth);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
pageData.width = pixelToPoint(detail.totalWidth);
|
|
267
|
+
}
|
|
258
268
|
_this.pdfPageDetail.push(pageData);
|
|
259
269
|
pagePoint.y += pageData.height;
|
|
260
270
|
if (_this.enableHeader) {
|
|
@@ -264,6 +274,11 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
264
274
|
taskbarPoint.y = 0;
|
|
265
275
|
cumulativeHeight = 0;
|
|
266
276
|
}
|
|
277
|
+
_this.parent.eventMarkerColloction.map(function (eventMarker) {
|
|
278
|
+
var timelimeHeight = pixelToPoint(_this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
279
|
+
var pdfPage = _this.result.page.section.getPages()[_this.startPageIndex];
|
|
280
|
+
_this.eventMarker.drawEventMarker(pdfPage, taskbarPoint, cumulativeWidth, detail, eventMarker, timelimeHeight);
|
|
281
|
+
});
|
|
267
282
|
}
|
|
268
283
|
taskbarPoint.y += rowHeight;
|
|
269
284
|
cumulativeHeight += rowHeight;
|
|
@@ -276,7 +291,12 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
276
291
|
pageData.height = cumulativeHeight;
|
|
277
292
|
pageData.pageStartX = pageStartX;
|
|
278
293
|
pageData.startPoint = __assign({}, pagePoint);
|
|
279
|
-
|
|
294
|
+
if (_this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) {
|
|
295
|
+
pageData.width = (detail.totalWidth);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
pageData.width = pixelToPoint(detail.totalWidth);
|
|
299
|
+
}
|
|
280
300
|
_this.pdfPageDetail.push(pageData);
|
|
281
301
|
pagePoint.x += pageData.width;
|
|
282
302
|
pagePoint.y = 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PointF, PdfColor, PdfPage, PdfFontFamily } from '@syncfusion/ej2-pdf-export';
|
|
2
|
-
import { TimelineDetails, TaskLabel } from './../base/interface';
|
|
2
|
+
import { TimelineDetails, TaskLabel, IIndicator } from './../base/interface';
|
|
3
3
|
import { Gantt } from '../base/gantt';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
@@ -33,6 +33,10 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
33
33
|
progress?: number;
|
|
34
34
|
/** Defines the progress width of task. */
|
|
35
35
|
progressWidth?: number;
|
|
36
|
+
/** Defines the autostart date of task. */
|
|
37
|
+
autoStartDate?: Date;
|
|
38
|
+
/** Defines the autoent date of task. */
|
|
39
|
+
autoEndDate?: Date;
|
|
36
40
|
/** Defines the start date of task. */
|
|
37
41
|
startDate?: Date;
|
|
38
42
|
/** Defines the id of task. */
|
|
@@ -69,6 +73,15 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
69
73
|
progressFontColor: PdfColor;
|
|
70
74
|
taskColor: PdfColor;
|
|
71
75
|
baselineColor: PdfColor;
|
|
76
|
+
splitLineBackground: PdfColor;
|
|
77
|
+
unscheduledTaskBarColor: PdfColor;
|
|
78
|
+
manualParentBackground: PdfColor;
|
|
79
|
+
manualParentProgress: PdfColor;
|
|
80
|
+
manualChildBackground: PdfColor;
|
|
81
|
+
manualChildProgress: PdfColor;
|
|
82
|
+
manuallineColor: PdfColor;
|
|
83
|
+
manualParentBorder: PdfColor;
|
|
84
|
+
manualChildBorder: PdfColor;
|
|
72
85
|
baselineBorderColor: PdfColor;
|
|
73
86
|
baselineTop: number;
|
|
74
87
|
labelColor: PdfColor;
|
|
@@ -77,7 +90,14 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
77
90
|
milestoneColor: PdfColor;
|
|
78
91
|
taskbar: PdfGanttTaskbarCollection[];
|
|
79
92
|
parent: Gantt;
|
|
93
|
+
segment: any;
|
|
94
|
+
isSpliterTask: boolean;
|
|
95
|
+
segmentCollection: any;
|
|
80
96
|
isCompleted: boolean;
|
|
97
|
+
isCompletedAutotask: boolean;
|
|
98
|
+
autoWidth?: number;
|
|
99
|
+
autoLeft?: number;
|
|
100
|
+
indicators: IIndicator[];
|
|
81
101
|
/**
|
|
82
102
|
* @private
|
|
83
103
|
*/
|
|
@@ -99,12 +119,13 @@ export declare class PdfGanttTaskbarCollection {
|
|
|
99
119
|
* Get the next PDF page
|
|
100
120
|
*/
|
|
101
121
|
private GetNextPage;
|
|
122
|
+
isAutoFit(): boolean;
|
|
102
123
|
/**
|
|
103
124
|
* Draw the taskbar, chart back ground
|
|
104
125
|
*
|
|
105
126
|
* @private
|
|
106
127
|
*/
|
|
107
|
-
drawTaskbar(page: PdfPage, startPoint: PointF, detail: TimelineDetails, cumulativeWidth: number, rowHeight: number, taskbar: PdfGanttTaskbarCollection): boolean;
|
|
128
|
+
drawTaskbar(page: PdfPage, startPoint: PointF, detail: TimelineDetails, cumulativeWidth: number, rowHeight: number, taskbar: PdfGanttTaskbarCollection, lineWidth: number): boolean;
|
|
108
129
|
/**
|
|
109
130
|
* @param {PdfPage} page .
|
|
110
131
|
* @param {PointF} startPoint .
|