@syncfusion/ej2-gantt 20.3.47 → 20.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -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 +85 -24
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +78 -17
- 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 +15 -15
- package/src/gantt/actions/context-menu.js +3 -1
- package/src/gantt/actions/dialog-edit.js +8 -5
- package/src/gantt/actions/edit.js +6 -1
- package/src/gantt/base/gantt-chart.js +3 -0
- package/src/gantt/base/gantt.js +3 -1
- package/src/gantt/base/interface.d.ts +13 -1
- package/src/gantt/base/task-processor.js +21 -7
- package/src/gantt/base/tree-grid.js +8 -1
- package/src/gantt/export/pdf-base/pdf-grid-table.js +9 -0
- package/src/gantt/export/pdf-taskbar.js +12 -0
- package/src/gantt/export/pdf-timeline.js +3 -0
- package/src/gantt/renderer/timeline.js +1 -1
- package/src/gantt/renderer/tooltip.js +1 -0
- package/styles/bootstrap4.css +1 -1
- package/styles/gantt/bootstrap4.css +1 -1
|
@@ -2918,7 +2918,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
2918
2918
|
this.parent.setRecordValue(dataMapping.id, ganttProperties.taskId, ganttData);
|
|
2919
2919
|
}
|
|
2920
2920
|
if (dataMapping.name) {
|
|
2921
|
-
this.parent.
|
|
2921
|
+
if (!this.parent.isLoad) {
|
|
2922
|
+
this.parent.setRecordValue('taskData.' + dataMapping.name, ganttProperties.taskName, ganttData);
|
|
2923
|
+
}
|
|
2922
2924
|
this.parent.setRecordValue(dataMapping.name, ganttProperties.taskName, ganttData);
|
|
2923
2925
|
}
|
|
2924
2926
|
if (dataMapping.startDate) {
|
|
@@ -2934,7 +2936,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
2934
2936
|
data[dataMapping.durationUnit] = ganttProperties.durationUnit;
|
|
2935
2937
|
}
|
|
2936
2938
|
if (dataMapping.progress) {
|
|
2937
|
-
this.parent.
|
|
2939
|
+
if (!this.parent.isLoad) {
|
|
2940
|
+
this.parent.setRecordValue('taskData.' + dataMapping.progress, ganttProperties.progress, ganttData);
|
|
2941
|
+
}
|
|
2938
2942
|
this.parent.setRecordValue(dataMapping.progress, ganttProperties.progress, ganttData);
|
|
2939
2943
|
}
|
|
2940
2944
|
if (dataMapping.baselineStartDate) {
|
|
@@ -2944,15 +2948,21 @@ class TaskProcessor extends DateProcessor {
|
|
|
2944
2948
|
this.setRecordDate(ganttData, ganttProperties.baselineEndDate, dataMapping.baselineEndDate);
|
|
2945
2949
|
}
|
|
2946
2950
|
if (dataMapping.notes) {
|
|
2947
|
-
this.parent.
|
|
2951
|
+
if (!this.parent.isLoad) {
|
|
2952
|
+
this.parent.setRecordValue('taskData.' + dataMapping.notes, ganttProperties.notes, ganttData);
|
|
2953
|
+
}
|
|
2948
2954
|
this.parent.setRecordValue(dataMapping.notes, ganttProperties.notes, ganttData);
|
|
2949
2955
|
}
|
|
2950
2956
|
if (dataMapping.cssClass) {
|
|
2951
|
-
this.parent.
|
|
2957
|
+
if (!this.parent.isLoad) {
|
|
2958
|
+
this.parent.setRecordValue('taskData.' + dataMapping.cssClass, ganttProperties.cssClass, ganttData);
|
|
2959
|
+
}
|
|
2952
2960
|
this.parent.setRecordValue(dataMapping.cssClass, ganttProperties.cssClass, ganttData);
|
|
2953
2961
|
}
|
|
2954
2962
|
if (dataMapping.indicators) {
|
|
2955
|
-
this.parent.
|
|
2963
|
+
if (!this.parent.isLoad) {
|
|
2964
|
+
this.parent.setRecordValue('taskData.' + dataMapping.indicators, ganttProperties.indicators, ganttData);
|
|
2965
|
+
}
|
|
2956
2966
|
this.parent.setRecordValue(dataMapping.indicators, ganttProperties.indicators, ganttData);
|
|
2957
2967
|
}
|
|
2958
2968
|
if (dataMapping.parentID) {
|
|
@@ -2961,11 +2971,15 @@ class TaskProcessor extends DateProcessor {
|
|
|
2961
2971
|
this.parent.setRecordValue(dataMapping.parentID, ganttProperties.parentId, ganttData);
|
|
2962
2972
|
}
|
|
2963
2973
|
if (dataMapping.work) {
|
|
2964
|
-
this.parent.
|
|
2974
|
+
if (!this.parent.isLoad) {
|
|
2975
|
+
this.parent.setRecordValue('taskData.' + dataMapping.work, this.getWorkString(ganttProperties.work, ganttProperties.workUnit), ganttData);
|
|
2976
|
+
}
|
|
2965
2977
|
this.parent.setRecordValue(dataMapping.work, ganttProperties.work, ganttData);
|
|
2966
2978
|
}
|
|
2967
2979
|
if (dataMapping.type) {
|
|
2968
|
-
this.parent.
|
|
2980
|
+
if (!this.parent.isLoad) {
|
|
2981
|
+
this.parent.setRecordValue('taskData.' + dataMapping.type, ganttProperties.taskType, ganttData);
|
|
2982
|
+
}
|
|
2969
2983
|
this.parent.setRecordValue(dataMapping.type, ganttProperties.taskType, ganttData);
|
|
2970
2984
|
}
|
|
2971
2985
|
}
|
|
@@ -4788,6 +4802,9 @@ class GanttChart {
|
|
|
4788
4802
|
* @private
|
|
4789
4803
|
*/
|
|
4790
4804
|
collapsedGanttRow(args) {
|
|
4805
|
+
if ((isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) || isNullOrUndefined(args['chartRow'])) {
|
|
4806
|
+
return;
|
|
4807
|
+
}
|
|
4791
4808
|
const record = getValue('data', args);
|
|
4792
4809
|
if (this.isExpandCollapseFromChart) {
|
|
4793
4810
|
this.expandCollapseChartRows('collapse', getValue('chartRow', args), record, null);
|
|
@@ -6290,7 +6307,7 @@ class Timeline {
|
|
|
6290
6307
|
endDate.setHours(24, 0, 0, 0);
|
|
6291
6308
|
}
|
|
6292
6309
|
}
|
|
6293
|
-
if ((this.isZooming || this.parent.isLoad) && isNullOrUndefined(this.parent.projectEndDate)) {
|
|
6310
|
+
if ((this.isZooming || this.parent.isLoad || this.parent.isFromOnPropertyChange) && isNullOrUndefined(this.parent.projectEndDate)) {
|
|
6294
6311
|
this.updateTimelineAfterZooming(endDate, false);
|
|
6295
6312
|
}
|
|
6296
6313
|
return endDate;
|
|
@@ -7546,7 +7563,14 @@ class GanttTreeGrid {
|
|
|
7546
7563
|
return data.level === 0 ? 'R-' + data.ganttProperties.taskId : 'T-' + data.ganttProperties.taskId;
|
|
7547
7564
|
}
|
|
7548
7565
|
updateScrollTop(args) {
|
|
7549
|
-
|
|
7566
|
+
let newScrollTop;
|
|
7567
|
+
if (getValue('top', args) > (this.parent.flatData.length * this.parent.rowHeight)) {
|
|
7568
|
+
newScrollTop = getValue('top', args) - document.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'];
|
|
7569
|
+
}
|
|
7570
|
+
else {
|
|
7571
|
+
newScrollTop = getValue('top', args);
|
|
7572
|
+
}
|
|
7573
|
+
this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
|
|
7550
7574
|
this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
|
|
7551
7575
|
}
|
|
7552
7576
|
treeGridClickHandler(e) {
|
|
@@ -11979,6 +12003,7 @@ class Tooltip$1 {
|
|
|
11979
12003
|
args.cancel = true;
|
|
11980
12004
|
}
|
|
11981
12005
|
});
|
|
12006
|
+
this.toolTipObj.content = argsData.content;
|
|
11982
12007
|
if (!this.parent.isAdaptive && args.event.type === 'mouseover') {
|
|
11983
12008
|
this.currentTarget = args.target;
|
|
11984
12009
|
EventHandler.add(this.currentTarget, 'mousemove', this.mouseMoveHandler.bind(this));
|
|
@@ -14926,7 +14951,9 @@ let Gantt = class Gantt extends Component {
|
|
|
14926
14951
|
if (isNullOrUndefined(index)) {
|
|
14927
14952
|
record = this.getRecordByID(id.toString());
|
|
14928
14953
|
chartRow$$1 = this.getRowByID(id);
|
|
14929
|
-
|
|
14954
|
+
if (!isNullOrUndefined(chartRow$$1)) {
|
|
14955
|
+
rowIndex = getValue('rowIndex', chartRow$$1);
|
|
14956
|
+
}
|
|
14930
14957
|
}
|
|
14931
14958
|
else if (!isNullOrUndefined(index)) {
|
|
14932
14959
|
chartRow$$1 = this.getRowByIndex(index);
|
|
@@ -20602,10 +20629,17 @@ class DialogEdit {
|
|
|
20602
20629
|
// eslint-disable-next-line
|
|
20603
20630
|
updateSegmentsData(segmentForm, data) {
|
|
20604
20631
|
const gridObj = segmentForm.ej2_instances[0];
|
|
20632
|
+
const isEdit = gridObj.isEdit;
|
|
20633
|
+
let dataSource;
|
|
20605
20634
|
if (gridObj.isEdit) {
|
|
20606
20635
|
gridObj.endEdit();
|
|
20607
20636
|
}
|
|
20608
|
-
|
|
20637
|
+
if (isEdit) {
|
|
20638
|
+
dataSource = gridObj.dataSource;
|
|
20639
|
+
}
|
|
20640
|
+
else {
|
|
20641
|
+
dataSource = gridObj.currentViewData;
|
|
20642
|
+
}
|
|
20609
20643
|
this.updateSegmentTaskData(dataSource);
|
|
20610
20644
|
}
|
|
20611
20645
|
updateGeneralTab(generalForm, isCustom) {
|
|
@@ -20699,10 +20733,6 @@ class DialogEdit {
|
|
|
20699
20733
|
const ids = [];
|
|
20700
20734
|
for (let i = 0; i < dataSource.length; i++) {
|
|
20701
20735
|
const preData = dataSource[i];
|
|
20702
|
-
const newId = preData.name.split('-')[0];
|
|
20703
|
-
if (preData.id !== newId) {
|
|
20704
|
-
preData.id = newId;
|
|
20705
|
-
}
|
|
20706
20736
|
if (ids.indexOf(preData.id) === -1) {
|
|
20707
20737
|
let name = preData.id + preData.type;
|
|
20708
20738
|
if (preData.offset && preData.offset.indexOf('-') !== -1) {
|
|
@@ -24133,6 +24163,9 @@ class Edit$2 {
|
|
|
24133
24163
|
}
|
|
24134
24164
|
/*Child collection update*/
|
|
24135
24165
|
parentItem.childRecords.splice(childIndex, 0, record);
|
|
24166
|
+
if (!this.parent.taskFields.child) {
|
|
24167
|
+
this.parent.taskFields.child = 'Children';
|
|
24168
|
+
}
|
|
24136
24169
|
if ((this.parent.dataSource instanceof DataManager &&
|
|
24137
24170
|
isNullOrUndefined(parentItem.taskData[this.parent.taskFields.parentID])) ||
|
|
24138
24171
|
!isNullOrUndefined(this.parent.dataSource)) {
|
|
@@ -24263,7 +24296,9 @@ class Edit$2 {
|
|
|
24263
24296
|
dataSource.push(addedRecord[i].taskData);
|
|
24264
24297
|
}
|
|
24265
24298
|
else {
|
|
24266
|
-
|
|
24299
|
+
if (isNullOrUndefined(addedRecord[i].parentItem)) {
|
|
24300
|
+
this.addDataInRealDataSource(dataSource, addedRecord[i].taskData, rowPosition);
|
|
24301
|
+
}
|
|
24267
24302
|
}
|
|
24268
24303
|
}
|
|
24269
24304
|
this.isBreakLoop = false;
|
|
@@ -28393,7 +28428,9 @@ class ContextMenu$2 {
|
|
|
28393
28428
|
contextMenuOpen(args) {
|
|
28394
28429
|
this.isOpen = true;
|
|
28395
28430
|
const firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
|
|
28396
|
-
|
|
28431
|
+
if (!isNullOrUndefined(firstMenuItem)) {
|
|
28432
|
+
addClass([firstMenuItem], 'e-focused');
|
|
28433
|
+
}
|
|
28397
28434
|
}
|
|
28398
28435
|
getMenuItems() {
|
|
28399
28436
|
const menuItems = !isNullOrUndefined(this.parent.contextMenuItems) ?
|
|
@@ -30893,7 +30930,10 @@ class PdfTreeGridCell {
|
|
|
30893
30930
|
const layouter = new PdfStringLayouter();
|
|
30894
30931
|
if (typeof this.value === 'string') {
|
|
30895
30932
|
/* eslint-disable-next-line */
|
|
30896
|
-
|
|
30933
|
+
let font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
|
|
30934
|
+
if (this.row.treegrid.ganttStyle.font) {
|
|
30935
|
+
font = this.row.treegrid.ganttStyle.font;
|
|
30936
|
+
}
|
|
30897
30937
|
/* eslint-disable-next-line */
|
|
30898
30938
|
const slr = layouter.layout(this.value, font, this.style.format, new SizeF(Number.MAX_VALUE, Number.MAX_VALUE), false, new SizeF(0, 0));
|
|
30899
30939
|
width += slr.actualSize.width;
|
|
@@ -30926,7 +30966,10 @@ class PdfTreeGridCell {
|
|
|
30926
30966
|
currentValue = !(isNullOrUndefined(this.remainingString) || this.remainingString === '') ? this.remainingString : this.value;
|
|
30927
30967
|
}
|
|
30928
30968
|
/* eslint-disable */
|
|
30929
|
-
|
|
30969
|
+
let font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
|
|
30970
|
+
if (this.row.treegrid.ganttStyle.font) {
|
|
30971
|
+
font = this.row.treegrid.ganttStyle.font;
|
|
30972
|
+
}
|
|
30930
30973
|
/* eslint-disable */
|
|
30931
30974
|
const slr = layouter.layout(currentValue, font, this.style.format, new SizeF(width, 0), false, new SizeF(0, 0));
|
|
30932
30975
|
height += slr.actualSize.height;
|
|
@@ -30994,6 +31037,9 @@ class PdfTreeGridCell {
|
|
|
30994
31037
|
else {
|
|
30995
31038
|
font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
|
|
30996
31039
|
}
|
|
31040
|
+
if (this.row.treegrid.ganttStyle.font) {
|
|
31041
|
+
font = this.row.treegrid.ganttStyle.font;
|
|
31042
|
+
}
|
|
30997
31043
|
let innerLayoutArea = bounds;
|
|
30998
31044
|
if (!this.isHeaderCell) {
|
|
30999
31045
|
/* eslint-disable-next-line */
|
|
@@ -32255,7 +32301,10 @@ class PdfGanttTaskbarCollection {
|
|
|
32255
32301
|
}
|
|
32256
32302
|
this.drawLeftLabel(page, startPoint, detail, cumulativeWidth);
|
|
32257
32303
|
//Draw Taskbar
|
|
32258
|
-
|
|
32304
|
+
let font = new PdfStandardFont(this.fontFamily, 9, PdfFontStyle.Regular);
|
|
32305
|
+
if (this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
|
|
32306
|
+
font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
|
|
32307
|
+
}
|
|
32259
32308
|
const fontColor = null;
|
|
32260
32309
|
const fontBrush = new PdfSolidBrush(this.progressFontColor);
|
|
32261
32310
|
const progressFormat = new PdfStringFormat();
|
|
@@ -32420,7 +32469,10 @@ class PdfGanttTaskbarCollection {
|
|
|
32420
32469
|
if (detail.startPoint <= left && left < detail.endPoint &&
|
|
32421
32470
|
!isNullOrUndefined(this.rightTaskLabel.value) && !this.rightTaskLabel.isCompleted) {
|
|
32422
32471
|
const result = this.getWidth(this.rightTaskLabel.value, detail.endPoint - left, 15);
|
|
32423
|
-
|
|
32472
|
+
let font = new PdfStandardFont(this.fontFamily, 9);
|
|
32473
|
+
if (this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
|
|
32474
|
+
font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
|
|
32475
|
+
}
|
|
32424
32476
|
const adjustHeight = (pixelToPoint(this.parent.rowHeight) - result.actualSize.height) / 2;
|
|
32425
32477
|
const point = new PointF(actualLeft, startPoint.y + adjustHeight);
|
|
32426
32478
|
const size = new SizeF(result.actualSize.width, result.actualSize.height);
|
|
@@ -32475,7 +32527,10 @@ class PdfGanttTaskbarCollection {
|
|
|
32475
32527
|
if (detail.startPoint <= left && left < detail.endPoint && !isNullOrUndefined(this.leftTaskLabel.value)
|
|
32476
32528
|
&& !this.leftTaskLabel.isCompleted) {
|
|
32477
32529
|
const result = this.getWidth(this.leftTaskLabel.value, detail.endPoint - left, 15);
|
|
32478
|
-
|
|
32530
|
+
let font = new PdfStandardFont(this.fontFamily, 9);
|
|
32531
|
+
if (this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
|
|
32532
|
+
font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
|
|
32533
|
+
}
|
|
32479
32534
|
const adjustHeight = (pixelToPoint(this.parent.rowHeight) - result.actualSize.height) / 2;
|
|
32480
32535
|
const rightLabelpoint = new PointF(actualLeft, startPoint.y + adjustHeight);
|
|
32481
32536
|
const rightLabelSize = new SizeF(result.actualSize.width, result.actualSize.height);
|
|
@@ -32503,7 +32558,10 @@ class PdfGanttTaskbarCollection {
|
|
|
32503
32558
|
}
|
|
32504
32559
|
}
|
|
32505
32560
|
getWidth(value, width, height) {
|
|
32506
|
-
|
|
32561
|
+
let font = new PdfStandardFont(this.fontFamily, 9);
|
|
32562
|
+
if (this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
|
|
32563
|
+
font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
|
|
32564
|
+
}
|
|
32507
32565
|
const layouter = new PdfStringLayouter();
|
|
32508
32566
|
const progressFormat = new PdfStringFormat();
|
|
32509
32567
|
progressFormat.alignment = PdfTextAlignment.Left;
|
|
@@ -32722,7 +32780,10 @@ class PdfTimeline {
|
|
|
32722
32780
|
const rectPen = new PdfPen(eventArgs.timelineCell.borderColor);
|
|
32723
32781
|
const rectBrush = new PdfSolidBrush(eventArgs.timelineCell.backgroundColor);
|
|
32724
32782
|
graphics.drawRectangle(rectPen, rectBrush, x, y, pixelToPoint(width), pixelToPoint(height));
|
|
32725
|
-
|
|
32783
|
+
let font = new PdfStandardFont(ganttStyle.fontFamily, e.fontSize, e.fontStyle);
|
|
32784
|
+
if (ganttStyle.font) {
|
|
32785
|
+
font = ganttStyle.font;
|
|
32786
|
+
}
|
|
32726
32787
|
const textBrush = new PdfSolidBrush(eventArgs.timelineCell.fontColor);
|
|
32727
32788
|
const pLeft = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.left : 0;
|
|
32728
32789
|
const pTop = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.top : 0;
|