@syncfusion/ej2-gantt 21.2.6 → 21.2.9
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 +35 -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 +181 -80
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +176 -75
- 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 +16 -16
- package/src/gantt/actions/context-menu.js +1 -1
- package/src/gantt/actions/dependency.js +9 -0
- package/src/gantt/actions/edit.d.ts +1 -0
- package/src/gantt/actions/edit.js +14 -3
- package/src/gantt/actions/pdf-export.js +1 -1
- package/src/gantt/actions/taskbar-edit.js +5 -2
- package/src/gantt/base/date-processor.js +1 -1
- package/src/gantt/base/gantt-chart.js +14 -3
- package/src/gantt/base/task-processor.js +51 -20
- package/src/gantt/base/tree-grid.js +2 -2
- package/src/gantt/export/export-helper.js +3 -0
- package/src/gantt/export/pdf-connector-line.d.ts +4 -3
- package/src/gantt/export/pdf-connector-line.js +22 -11
- package/src/gantt/export/pdf-gantt.d.ts +2 -1
- package/src/gantt/export/pdf-gantt.js +4 -4
- package/src/gantt/renderer/chart-rows.d.ts +1 -0
- package/src/gantt/renderer/chart-rows.js +46 -26
- package/src/gantt/renderer/timeline.js +4 -2
|
@@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11
11
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
12
|
};
|
|
13
13
|
})();
|
|
14
|
-
import { createElement, isNullOrUndefined, extend, compile, getValue, setValue, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
|
14
|
+
import { createElement, isNullOrUndefined, extend, compile, getValue, setValue, SanitizeHtmlHelper, append } from '@syncfusion/ej2-base';
|
|
15
15
|
import { formatUnit, addClass } from '@syncfusion/ej2-base';
|
|
16
16
|
import { isScheduledTask } from '../base/utils';
|
|
17
17
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
@@ -173,7 +173,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
173
173
|
if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
|
|
174
174
|
var taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
|
|
175
175
|
if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
|
|
176
|
-
|
|
176
|
+
append(taskLabelTemplateNode, tempDiv);
|
|
177
177
|
labelString = tempDiv.innerHTML;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -243,7 +243,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
243
243
|
!this.isTemplate(childLabel) &&
|
|
244
244
|
progressDiv[0].querySelectorAll('.e-task-label')[0].children[0])
|
|
245
245
|
progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
|
|
246
|
-
if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent
|
|
246
|
+
if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent === '' &&
|
|
247
247
|
childLabel && !childLabel['elementRef'] && tempDiv.innerHTML !== '')
|
|
248
248
|
progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
|
|
249
249
|
}
|
|
@@ -728,7 +728,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
728
728
|
if (leftLabelTemplateNode[0]['data'] === 'null') {
|
|
729
729
|
leftLabelTemplateNode[0]['data'] = '';
|
|
730
730
|
}
|
|
731
|
-
|
|
731
|
+
append(leftLabelTemplateNode, leftLabelNode[0]);
|
|
732
732
|
}
|
|
733
733
|
if (this.parent.enableRtl) {
|
|
734
734
|
leftLabelNode[0].style.paddingLeft = '25px';
|
|
@@ -783,7 +783,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
783
783
|
if (rightLabelTemplateNode[0]['data'] === 'null') {
|
|
784
784
|
rightLabelTemplateNode[0]['data'] = '';
|
|
785
785
|
}
|
|
786
|
-
|
|
786
|
+
append(rightLabelTemplateNode, rightLabelNode[0]);
|
|
787
787
|
}
|
|
788
788
|
if (this.parent.enableRtl) {
|
|
789
789
|
rightLabelNode[0].style.marginLeft = '0px';
|
|
@@ -914,7 +914,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
914
914
|
!this.isTemplate(parentLabel) &&
|
|
915
915
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0])
|
|
916
916
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
|
|
917
|
-
if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent
|
|
917
|
+
if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent === '' &&
|
|
918
918
|
parentLabel && !parentLabel['elementRef'] && div.innerHTML !== '')
|
|
919
919
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
|
|
920
920
|
}
|
|
@@ -944,11 +944,19 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
944
944
|
* @returns {NodeList} .
|
|
945
945
|
* @private
|
|
946
946
|
*/
|
|
947
|
-
ChartRows.prototype.getTableTrNode = function () {
|
|
947
|
+
ChartRows.prototype.getTableTrNode = function (i) {
|
|
948
948
|
var table = createElement('table');
|
|
949
949
|
var className = (this.parent.gridLines === 'Horizontal' || this.parent.gridLines === 'Both') ?
|
|
950
950
|
'e-chart-row-border' : '';
|
|
951
|
-
|
|
951
|
+
var rows = this.parent.treeGrid.grid.contentModule.getRows()[i];
|
|
952
|
+
var activecls;
|
|
953
|
+
if (rows && rows.isSelected) {
|
|
954
|
+
activecls = 'e-active';
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
activecls = '';
|
|
958
|
+
}
|
|
959
|
+
table.innerHTML = '<tr class="' + this.getRowClassName(this.templateData) + ' ' + cls.chartRow + ' ' + (activecls) + '"' +
|
|
952
960
|
'style="display:' + this.getExpandDisplayProp(this.templateData) + ';height:' +
|
|
953
961
|
this.parent.rowHeight + 'px;">' +
|
|
954
962
|
'<td class="' + cls.chartRowCell + ' ' + className
|
|
@@ -1386,7 +1394,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1386
1394
|
this.parent.renderTemplates();
|
|
1387
1395
|
this.triggerQueryTaskbarInfo();
|
|
1388
1396
|
this.parent.modifiedRecords = [];
|
|
1389
|
-
if (this.parent.viewType
|
|
1397
|
+
if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
|
|
1390
1398
|
this.updateOverlapped();
|
|
1391
1399
|
}
|
|
1392
1400
|
if (collapsedResourceRecord.length) {
|
|
@@ -1410,7 +1418,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1410
1418
|
ChartRows.prototype.getGanttChartRow = function (i, tempTemplateData) {
|
|
1411
1419
|
this.templateData = tempTemplateData;
|
|
1412
1420
|
var taskBaselineTemplateNode = null;
|
|
1413
|
-
var parentTrNode = this.getTableTrNode();
|
|
1421
|
+
var parentTrNode = this.getTableTrNode(i);
|
|
1414
1422
|
var leftLabelNode = this.getLeftLabelNode(i);
|
|
1415
1423
|
var taskbarContainerNode = this.taskbarContainer();
|
|
1416
1424
|
taskbarContainerNode[0].setAttribute('aria-label', this.generateAriaLabel(this.templateData));
|
|
@@ -1440,12 +1448,12 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1440
1448
|
}
|
|
1441
1449
|
}
|
|
1442
1450
|
if ((this.templateData.ganttProperties.autoDuration !== 0) && !this.templateData.ganttProperties.isMilestone && parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
|
|
1443
|
-
|
|
1451
|
+
append(parentTaskbarTemplateNode, taskbarContainerNode[0]);
|
|
1444
1452
|
}
|
|
1445
1453
|
else if ((this.templateData.ganttProperties.duration === 0 && this.templateData.ganttProperties.isMilestone && this.templateData.ganttProperties.isAutoSchedule)) {
|
|
1446
1454
|
var milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
|
|
1447
1455
|
if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
|
|
1448
|
-
|
|
1456
|
+
append(milestoneTemplateNode, taskbarContainerNode[0]);
|
|
1449
1457
|
}
|
|
1450
1458
|
}
|
|
1451
1459
|
if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
|
|
@@ -1499,7 +1507,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1499
1507
|
}
|
|
1500
1508
|
}
|
|
1501
1509
|
else {
|
|
1502
|
-
|
|
1510
|
+
append(childTaskbarTemplateNode, taskbarContainerNode[0]);
|
|
1503
1511
|
}
|
|
1504
1512
|
}
|
|
1505
1513
|
if (childTaskbarProgressResizeNode) {
|
|
@@ -1962,6 +1970,19 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1962
1970
|
}
|
|
1963
1971
|
}
|
|
1964
1972
|
};
|
|
1973
|
+
ChartRows.prototype.updateResourceTaskbarElement = function (tRow, parentTr) {
|
|
1974
|
+
var cloneElement = tRow.querySelector('.e-taskbar-main-container');
|
|
1975
|
+
addClass([cloneElement], 'collpse-parent-border');
|
|
1976
|
+
var id = tRow.querySelector('.' + cls.taskBarMainContainer).getAttribute('rowUniqueId');
|
|
1977
|
+
var ganttData = this.parent.getRecordByID(id);
|
|
1978
|
+
var zIndex = "";
|
|
1979
|
+
if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
|
|
1980
|
+
zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
|
|
1981
|
+
}
|
|
1982
|
+
var cloneChildElement = cloneElement.cloneNode(true);
|
|
1983
|
+
cloneChildElement.style.zIndex = zIndex;
|
|
1984
|
+
parentTr[0].childNodes[0].childNodes[0].childNodes[0].appendChild(cloneChildElement);
|
|
1985
|
+
};
|
|
1965
1986
|
ChartRows.prototype.getResourceParent = function (record) {
|
|
1966
1987
|
var chartRows = this.parent.ganttChartModule.getChartRows();
|
|
1967
1988
|
//Below code is for rendering taskbartemplate in resource view with multi taskbar
|
|
@@ -1985,20 +2006,19 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1985
2006
|
parentTrNode[0].childNodes[0].childNodes[0].appendChild(collapseParent);
|
|
1986
2007
|
var tasks = this.parent.dataOperation.setSortedChildTasks(record);
|
|
1987
2008
|
this.parent.dataOperation.updateOverlappingIndex(tasks);
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2009
|
+
var tRow;
|
|
2010
|
+
if (this.parent.enableVirtualization) {
|
|
2011
|
+
for (var i = 0; i < record.childRecords.length; i++) {
|
|
2012
|
+
tRow = this.getGanttChartRow(record.childRecords[i].index, this.parent.flatData[record.childRecords[i].index]);
|
|
2013
|
+
this.updateResourceTaskbarElement(tRow, parentTrNode);
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
else {
|
|
2017
|
+
for (var i = 0; i < chartRows.length; i++) {
|
|
2018
|
+
if (chartRows[i].classList.contains('gridrowtaskId'
|
|
2019
|
+
+ record.ganttProperties.rowUniqueID + 'level' + (record.level + 1))) {
|
|
2020
|
+
this.updateResourceTaskbarElement(chartRows[i], parentTrNode);
|
|
1998
2021
|
}
|
|
1999
|
-
var cloneChildElement = cloneElement.cloneNode(true);
|
|
2000
|
-
cloneChildElement.style.zIndex = zIndex;
|
|
2001
|
-
parentTrNode[0].childNodes[0].childNodes[0].childNodes[0].appendChild(cloneChildElement);
|
|
2002
2022
|
}
|
|
2003
2023
|
}
|
|
2004
2024
|
parentTrNode[0].childNodes[0].childNodes[0].appendChild([].slice.call(leftLabelNode)[0]);
|
|
@@ -1410,9 +1410,11 @@ var Timeline = /** @class */ (function () {
|
|
|
1410
1410
|
var validStartLeft = this.parent.dataOperation.getTaskLeft(validStartDate, false);
|
|
1411
1411
|
var validEndLeft = this.parent.dataOperation.getTaskLeft(validEndDate, false);
|
|
1412
1412
|
var isChanged = void 0;
|
|
1413
|
+
var taskbarModule = this.parent.editModule.taskbarEditModule;
|
|
1413
1414
|
if (!isNullOrUndefined(maxStartLeft) && ((minStartDate < this.timelineStartDate) ||
|
|
1414
|
-
(!isNullOrUndefined(
|
|
1415
|
-
|
|
1415
|
+
(!isNullOrUndefined(taskbarModule)) && (!isNullOrUndefined(taskbarModule.taskBarEditAction)
|
|
1416
|
+
&& taskbarModule.taskBarEditAction !== 'ProgressResizing' &&
|
|
1417
|
+
taskbarModule.taskBarEditAction !== 'RightResizing')) && (maxStartLeft < this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
|
|
1416
1418
|
isChanged = 'prevTimeSpan';
|
|
1417
1419
|
minStartDate = minStartDate > this.timelineStartDate ? this.timelineStartDate : minStartDate;
|
|
1418
1420
|
}
|