@syncfusion/ej2-gantt 22.2.12 → 23.1.36
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 +180 -164
- 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 +846 -242
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +884 -264
- 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 +4 -1
- package/src/gantt/actions/critical-path.d.ts +2 -0
- package/src/gantt/actions/critical-path.js +79 -59
- package/src/gantt/actions/dependency.d.ts +1 -0
- package/src/gantt/actions/dependency.js +43 -25
- package/src/gantt/actions/dialog-edit.js +27 -7
- package/src/gantt/actions/edit.js +15 -8
- package/src/gantt/actions/pdf-export.d.ts +4 -1
- package/src/gantt/actions/pdf-export.js +36 -3
- package/src/gantt/actions/rowdragdrop.js +10 -2
- package/src/gantt/actions/selection.js +22 -5
- package/src/gantt/actions/taskbar-edit.js +51 -36
- package/src/gantt/actions/toolbar.js +8 -0
- package/src/gantt/base/date-processor.js +1 -1
- package/src/gantt/base/gantt-chart.d.ts +1 -0
- package/src/gantt/base/gantt-chart.js +79 -6
- package/src/gantt/base/gantt-model.d.ts +7 -0
- package/src/gantt/base/gantt.d.ts +6 -0
- package/src/gantt/base/gantt.js +73 -11
- package/src/gantt/base/interface.d.ts +14 -0
- package/src/gantt/base/task-processor.d.ts +4 -4
- package/src/gantt/base/task-processor.js +75 -25
- package/src/gantt/base/tree-grid.js +19 -10
- package/src/gantt/export/export-helper.d.ts +5 -1
- package/src/gantt/export/export-helper.js +150 -3
- package/src/gantt/export/pdf-base/pdf-grid-table.js +2 -2
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +8 -0
- package/src/gantt/export/pdf-base/treegrid-layouter.js +3 -1
- package/src/gantt/export/pdf-connector-line.js +3 -1
- package/src/gantt/export/pdf-gantt.js +6 -0
- package/src/gantt/export/pdf-taskbar.d.ts +13 -0
- package/src/gantt/export/pdf-taskbar.js +39 -5
- package/src/gantt/export/pdf-timeline.js +17 -8
- package/src/gantt/export/pdf-treegrid.js +3 -3
- package/src/gantt/models/task-fields-model.d.ts +7 -0
- package/src/gantt/models/task-fields.d.ts +6 -0
- package/src/gantt/models/task-fields.js +3 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +39 -20
- package/src/gantt/renderer/connector-line.js +49 -9
- package/src/gantt/renderer/edit-tooltip.js +2 -1
- package/src/gantt/renderer/timeline.js +16 -9
- package/src/gantt/renderer/tooltip.js +5 -5
- package/styles/bootstrap-dark.css +44 -100
- package/styles/bootstrap.css +44 -100
- package/styles/bootstrap4.css +44 -100
- package/styles/bootstrap5-dark.css +44 -100
- package/styles/bootstrap5.css +44 -100
- package/styles/fabric-dark.css +44 -100
- package/styles/fabric.css +44 -100
- package/styles/fluent-dark.css +44 -100
- package/styles/fluent.css +44 -100
- package/styles/gantt/_layout.scss +44 -31
- package/styles/gantt/_theme.scss +104 -98
- package/styles/gantt/bootstrap-dark.css +44 -100
- package/styles/gantt/bootstrap-dark.scss +1 -1
- package/styles/gantt/bootstrap.css +44 -100
- package/styles/gantt/bootstrap.scss +1 -1
- package/styles/gantt/bootstrap4.css +44 -100
- package/styles/gantt/bootstrap4.scss +1 -1
- package/styles/gantt/bootstrap5-dark.css +44 -100
- package/styles/gantt/bootstrap5-dark.scss +1 -1
- package/styles/gantt/bootstrap5.css +44 -100
- package/styles/gantt/bootstrap5.scss +1 -1
- package/styles/gantt/fabric-dark.css +44 -100
- package/styles/gantt/fabric-dark.scss +1 -1
- package/styles/gantt/fabric.css +44 -100
- package/styles/gantt/fabric.scss +1 -1
- package/styles/gantt/fluent-dark.css +44 -100
- package/styles/gantt/fluent-dark.scss +1 -1
- package/styles/gantt/fluent.css +44 -100
- package/styles/gantt/fluent.scss +1 -1
- package/styles/gantt/highcontrast-light.css +40 -100
- package/styles/gantt/highcontrast-light.scss +1 -1
- package/styles/gantt/highcontrast.css +44 -100
- package/styles/gantt/highcontrast.scss +1 -1
- package/styles/gantt/icons/_bootstrap-dark.scss +4 -0
- package/styles/gantt/icons/_bootstrap.scss +4 -0
- package/styles/gantt/icons/_bootstrap4.scss +4 -0
- package/styles/gantt/icons/_bootstrap5.scss +4 -0
- package/styles/gantt/icons/_fabric-dark.scss +4 -0
- package/styles/gantt/icons/_fabric.scss +4 -0
- package/styles/gantt/icons/_fluent.scss +4 -0
- package/styles/gantt/icons/_fusionnew.scss +4 -0
- package/styles/gantt/icons/_highcontrast.scss +4 -0
- package/styles/gantt/icons/_material-dark.scss +4 -0
- package/styles/gantt/icons/_material.scss +4 -0
- package/styles/gantt/icons/_material3.scss +4 -0
- package/styles/gantt/icons/_tailwind-dark.scss +4 -0
- package/styles/gantt/icons/_tailwind.scss +4 -0
- package/styles/gantt/material-dark.css +44 -101
- package/styles/gantt/material-dark.scss +1 -1
- package/styles/gantt/material.css +44 -101
- package/styles/gantt/material.scss +1 -1
- package/styles/gantt/material3-dark.css +45 -102
- package/styles/gantt/material3-dark.scss +1 -1
- package/styles/gantt/material3.css +45 -102
- package/styles/gantt/material3.scss +1 -1
- package/styles/gantt/tailwind-dark.css +44 -101
- package/styles/gantt/tailwind-dark.scss +1 -1
- package/styles/gantt/tailwind.css +44 -101
- package/styles/gantt/tailwind.scss +1 -1
- package/styles/highcontrast-light.css +40 -100
- package/styles/highcontrast.css +44 -100
- package/styles/material-dark.css +44 -101
- package/styles/material.css +44 -101
- package/styles/material3-dark.css +45 -102
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +45 -102
- package/styles/material3.scss +1 -1
- package/styles/tailwind-dark.css +44 -101
- package/styles/tailwind.css +44 -101
|
@@ -77,11 +77,23 @@ var PdfExport = /** @class */ (function () {
|
|
|
77
77
|
if (isNullOrUndefined(pdfExportProperties)) {
|
|
78
78
|
pdfExportProperties = {};
|
|
79
79
|
}
|
|
80
|
-
if (pdfExportProperties.
|
|
81
|
-
|
|
80
|
+
if (pdfExportProperties.fitToWidthSettings && pdfExportProperties.fitToWidthSettings.isFitToWidth) {
|
|
81
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
82
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.currentViewData, null, true);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.flatData, null, true);
|
|
86
|
+
}
|
|
87
|
+
this.helper.beforeSinglePageExport['cloneCurrentViewData'] = extend([], this.parent.currentViewData, null, true);
|
|
88
|
+
data = this.helper.beforeSinglePageExport['cloneFlatData'];
|
|
82
89
|
}
|
|
83
90
|
else {
|
|
84
|
-
|
|
91
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
92
|
+
data = this.parent.currentViewData;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
data = this.parent.flatData;
|
|
96
|
+
}
|
|
85
97
|
}
|
|
86
98
|
this.initGantt();
|
|
87
99
|
if (!isNullOrUndefined(pdfDoc)) {
|
|
@@ -106,6 +118,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
106
118
|
var section = this.pdfDocument.sections.add();
|
|
107
119
|
this.processSectionExportProperties(section, pdfExportProperties);
|
|
108
120
|
var pdfPage = section.pages.add();
|
|
121
|
+
this.pdfPageDimensions = pdfPage.getClientSize();
|
|
109
122
|
/* eslint-disable-next-line */
|
|
110
123
|
return new Promise(function (resolve, reject) {
|
|
111
124
|
_this.helper.processGridExport(data, _this.gantt, pdfExportProperties);
|
|
@@ -116,6 +129,26 @@ var PdfExport = /** @class */ (function () {
|
|
|
116
129
|
format.break = PdfLayoutBreakType.FitElement;
|
|
117
130
|
var layouter = _this.gantt.drawGrid(pdfPage, 0, 0, format);
|
|
118
131
|
_this.gantt.drawChart(layouter);
|
|
132
|
+
if (_this.helper.exportProps && _this.helper.exportProps.fitToWidthSettings && _this.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
133
|
+
_this.parent.zoomingProjectStartDate = _this.helper.beforeSinglePageExport['zoomingProjectStartDate'];
|
|
134
|
+
_this.parent.zoomingProjectEndDate = _this.helper.beforeSinglePageExport['zoomingProjectEndDate'];
|
|
135
|
+
_this.parent.cloneProjectStartDate = _this.helper.beforeSinglePageExport['cloneProjectStartDate'];
|
|
136
|
+
_this.parent.cloneProjectEndDate = _this.helper.beforeSinglePageExport['cloneProjectEndDate'];
|
|
137
|
+
_this.parent.timelineModule.customTimelineSettings = _this.helper.beforeSinglePageExport['customTimelineSettings'];
|
|
138
|
+
_this.parent.isTimelineRoundOff = _this.helper.beforeSinglePageExport['isTimelineRoundOff'];
|
|
139
|
+
_this.parent.timelineModule.topTier = _this.helper.beforeSinglePageExport['topTier'];
|
|
140
|
+
_this.parent.timelineModule.topTierCellWidth = _this.helper.beforeSinglePageExport['topTierCellWidth'];
|
|
141
|
+
_this.parent.timelineModule.topTierCollection = _this.helper.beforeSinglePageExport['topTierCollection'];
|
|
142
|
+
_this.parent.timelineModule.bottomTier = _this.helper.beforeSinglePageExport['bottomTier'];
|
|
143
|
+
_this.parent.timelineModule.bottomTierCellWidth = _this.helper.beforeSinglePageExport['bottomTierCellWidth'];
|
|
144
|
+
_this.parent.timelineModule.bottomTierCollection = _this.helper.beforeSinglePageExport['bottomTierCollection'];
|
|
145
|
+
_this.parent.timelineModule.totalTimelineWidth = _this.helper.beforeSinglePageExport['totalTimelineWidth'];
|
|
146
|
+
_this.parent.timelineModule.timelineStartDate = _this.helper.beforeSinglePageExport['timelineStartDate'];
|
|
147
|
+
_this.parent.timelineModule.timelineEndDate = _this.helper.beforeSinglePageExport['timelineEndDate'];
|
|
148
|
+
_this.parent.timelineModule.timelineRoundOffEndDate = _this.helper.beforeSinglePageExport['timelineRoundOffEndDate'];
|
|
149
|
+
_this.parent.perDayWidth = _this.helper.beforeSinglePageExport['perDayWidth'];
|
|
150
|
+
_this.parent.updatedConnectorLineCollection = _this.helper.beforeSinglePageExport['updatedConnectorLineCollection'];
|
|
151
|
+
}
|
|
119
152
|
if (!isMultipleExport) {
|
|
120
153
|
if (!_this.isBlob) {
|
|
121
154
|
// save the PDF
|
|
@@ -111,8 +111,16 @@ var RowDD = /** @class */ (function () {
|
|
|
111
111
|
var dragElement = this.parent.element.querySelector('.e-ganttdrag');
|
|
112
112
|
var ganttTop = this.parent.element.getClientRects()[0].top;
|
|
113
113
|
var ganttLeft = this.parent.element.getClientRects()[0].left;
|
|
114
|
-
var left
|
|
115
|
-
var top
|
|
114
|
+
var left;
|
|
115
|
+
var top;
|
|
116
|
+
if (this.parent.isAdaptive) {
|
|
117
|
+
left = args.originalEvent.event.touches[0].clientX - ganttLeft;
|
|
118
|
+
top = args.originalEvent.event.touches[0].clientY - ganttTop;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
left = getValue('event', args.originalEvent).clientX - ganttLeft;
|
|
122
|
+
top = getValue('event', args.originalEvent).clientY - ganttTop;
|
|
123
|
+
}
|
|
116
124
|
dragElement.style.left = left + 20 + 'px';
|
|
117
125
|
dragElement.style.top = top + 20 + 'px';
|
|
118
126
|
this.parent.trigger('rowDrag', args);
|
|
@@ -261,7 +261,24 @@ var Selection = /** @class */ (function () {
|
|
|
261
261
|
* @returns {Object[]} .
|
|
262
262
|
*/
|
|
263
263
|
Selection.prototype.getSelectedRecords = function () {
|
|
264
|
-
|
|
264
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
265
|
+
var selectedRows = [];
|
|
266
|
+
var selectedIndexes_1 = this.parent.selectionModule.getSelectedRowIndexes();
|
|
267
|
+
var _loop_1 = function (i) {
|
|
268
|
+
var rec = this_1.parent.currentViewData.filter(function (data) {
|
|
269
|
+
return data.index == selectedIndexes_1[i];
|
|
270
|
+
})[0];
|
|
271
|
+
selectedRows.push(rec);
|
|
272
|
+
};
|
|
273
|
+
var this_1 = this;
|
|
274
|
+
for (var i = 0; i < selectedIndexes_1.length; i++) {
|
|
275
|
+
_loop_1(i);
|
|
276
|
+
}
|
|
277
|
+
return selectedRows;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
return this.parent.treeGrid.getSelectedRecords();
|
|
281
|
+
}
|
|
265
282
|
};
|
|
266
283
|
/**
|
|
267
284
|
* Get the selected records for cell selection.
|
|
@@ -361,19 +378,19 @@ var Selection = /** @class */ (function () {
|
|
|
361
378
|
records = [records];
|
|
362
379
|
}
|
|
363
380
|
var ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
|
|
364
|
-
var
|
|
381
|
+
var _loop_2 = function (i) {
|
|
365
382
|
var selectedRow = ganttRow.filter(function (e) {
|
|
366
383
|
// eslint-disable-next-line
|
|
367
384
|
return parseInt(e.getAttribute('aria-rowindex'), 0) === records[i];
|
|
368
385
|
})[0];
|
|
369
386
|
if (!isNullOrUndefined(selectedRow)) {
|
|
370
387
|
// eslint-disable-next-line
|
|
371
|
-
|
|
388
|
+
this_2.getSelectedRowIndexes().indexOf(records[i]) > -1 ? this_2.addClass(selectedRow) : this_2.removeClass(selectedRow);
|
|
372
389
|
}
|
|
373
390
|
};
|
|
374
|
-
var
|
|
391
|
+
var this_2 = this;
|
|
375
392
|
for (var i = 0; i < records.length; i++) {
|
|
376
|
-
|
|
393
|
+
_loop_2(i);
|
|
377
394
|
}
|
|
378
395
|
};
|
|
379
396
|
Selection.prototype.addClass = function (selectedRow) {
|
|
@@ -88,13 +88,10 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
88
88
|
TaskbarEdit.prototype.mouseDownHandler = function (e) {
|
|
89
89
|
if (this.parent.editSettings.allowTaskbarEditing && !this.parent.readOnly) {
|
|
90
90
|
this.canDrag = false;
|
|
91
|
-
if (this.
|
|
91
|
+
if (this.taskBarEditElement) {
|
|
92
92
|
var targetElement = this.getElementByPosition(e);
|
|
93
93
|
var element = parentsUntil(targetElement, cls.taskBarMainContainer);
|
|
94
|
-
if (element && element.innerHTML === this.taskBarEditElement.innerHTML
|
|
95
|
-
!(targetElement.classList.contains(cls.connectorPointLeft) ||
|
|
96
|
-
targetElement.classList.contains(cls.connectorPointRight)) &&
|
|
97
|
-
!this.tapPointOnFocus) {
|
|
94
|
+
if ((element && element.innerHTML === this.taskBarEditElement.innerHTML || this.taskBarEditElement.classList.contains("e-segmented-taskbar") || this.taskBarEditElement.classList.contains("collpse-parent-border"))) {
|
|
98
95
|
this.updateTaskBarEditElement(e);
|
|
99
96
|
this.canDrag = true;
|
|
100
97
|
e.preventDefault();
|
|
@@ -117,7 +114,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
117
114
|
}
|
|
118
115
|
return;
|
|
119
116
|
}
|
|
120
|
-
if (this.tapPointOnFocus && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
117
|
+
if (this.tapPointOnFocus && !isNullOrUndefined(this.taskBarEditElement) && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
121
118
|
this.connectorSecondRecord = this.parent.ganttChartModule.getRecordByTaskBar(element);
|
|
122
119
|
this.connectorSecondAction = 'ConnectorPointLeftDrag';
|
|
123
120
|
this.connectorSecondElement = element;
|
|
@@ -128,8 +125,16 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
128
125
|
this.showHideActivePredecessors(false);
|
|
129
126
|
this.initPublicProp();
|
|
130
127
|
}
|
|
131
|
-
else if (targetElement.classList.contains(cls.connectorPointLeftHover)
|
|
132
|
-
|
|
128
|
+
else if (targetElement.classList.contains(cls.connectorPointLeftHover)) {
|
|
129
|
+
this.canDrag = false;
|
|
130
|
+
this.multipleSelectionEnabled();
|
|
131
|
+
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
132
|
+
this.tapPointOnFocus = true;
|
|
133
|
+
this.taskBarEditAction = 'ConnectorPointLeftDrag';
|
|
134
|
+
this.connectorSecondRecord = this.taskBarEditRecord;
|
|
135
|
+
this.taskBarEditingAction(e, false);
|
|
136
|
+
}
|
|
137
|
+
else if (targetElement.classList.contains(cls.connectorPointRightHover)) {
|
|
133
138
|
this.canDrag = false;
|
|
134
139
|
this.multipleSelectionEnabled();
|
|
135
140
|
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
@@ -259,7 +264,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
259
264
|
}
|
|
260
265
|
}
|
|
261
266
|
if (this.parent.editSettings.allowTaskbarEditing && element) {
|
|
262
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
267
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
263
268
|
this.editElement = element;
|
|
264
269
|
this.realTaskbarElement = this.editElement;
|
|
265
270
|
var index = this.editElement.getAttribute('data-segment-index');
|
|
@@ -340,7 +345,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
340
345
|
else {
|
|
341
346
|
if (this.parent.isAdaptive) {
|
|
342
347
|
if (this.taskBarEditElement) {
|
|
343
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
348
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
344
349
|
}
|
|
345
350
|
this.initPublicProp();
|
|
346
351
|
}
|
|
@@ -400,8 +405,12 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
400
405
|
&& isShowConnectorPoints) {
|
|
401
406
|
var connectorElement = !isNullOrUndefined(element.querySelector('.' + cls.connectorPointLeft)) ?
|
|
402
407
|
element : element.parentElement;
|
|
403
|
-
|
|
404
|
-
|
|
408
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + cls.connectorPointLeft))) {
|
|
409
|
+
addClass([connectorElement.querySelector('.' + cls.connectorPointLeft)], [cls.connectorPointLeftHover]);
|
|
410
|
+
}
|
|
411
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + cls.connectorPointRight))) {
|
|
412
|
+
addClass([connectorElement.querySelector('.' + cls.connectorPointRight)], [cls.connectorPointRightHover]);
|
|
413
|
+
}
|
|
405
414
|
}
|
|
406
415
|
}
|
|
407
416
|
else if (!fadeConnectorLine) {
|
|
@@ -528,7 +537,8 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
528
537
|
var item = this.taskBarEditRecord.ganttProperties;
|
|
529
538
|
this.previousItem = this.parent.timelineModule.extendFunction(item, this.previousItemProperty);
|
|
530
539
|
if (this.taskBarEditAction !== 'ConnectorPointLeftDrag' &&
|
|
531
|
-
this.taskBarEditAction !== 'ConnectorPointRightDrag'
|
|
540
|
+
this.taskBarEditAction !== 'ConnectorPointRightDrag' &&
|
|
541
|
+
!(this.parent.viewType == 'ResourceView' && this.taskBarEditAction == 'ParentDrag')) {
|
|
532
542
|
this.editTooltip.showHideTaskbarEditTooltip(true, this.segmentIndex);
|
|
533
543
|
}
|
|
534
544
|
this.taskBarEditElement.setAttribute('aria-grabbed', 'true');
|
|
@@ -566,6 +576,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
566
576
|
this.dragMouseLeave = false;
|
|
567
577
|
this.isMouseDragCheck();
|
|
568
578
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
579
|
+
event.preventDefault();
|
|
569
580
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
570
581
|
var currentElement = this.editElement.parentElement;
|
|
571
582
|
currentElement.style.setProperty("position", "absolute");
|
|
@@ -655,9 +666,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
655
666
|
this.taskBarEditAction === 'ConnectorPointRightDrag') {
|
|
656
667
|
this.updateConnectorLineSecondProperties(e);
|
|
657
668
|
this.triggerDependencyEvent(e);
|
|
658
|
-
|
|
659
|
-
this.drawFalseLine();
|
|
660
|
-
}
|
|
669
|
+
this.drawFalseLine();
|
|
661
670
|
}
|
|
662
671
|
if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
|
|
663
672
|
if (this.dragMoveY > this.mouseMoveY) {
|
|
@@ -669,7 +678,12 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
669
678
|
this.currentItemTop = this.currentItemTop + this.mouseMoveY;
|
|
670
679
|
}
|
|
671
680
|
var containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
|
|
672
|
-
this.
|
|
681
|
+
if (this.parent.isAdaptive || e.touches) {
|
|
682
|
+
this.dragMoveY = e.touches[0].pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
683
|
+
}
|
|
684
|
+
else {
|
|
685
|
+
this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
686
|
+
}
|
|
673
687
|
this.topValue = this.currentItemTop;
|
|
674
688
|
this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
|
|
675
689
|
this.topValue == this.currentItemTop) ? this.topValue :
|
|
@@ -1056,6 +1070,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1056
1070
|
if (this.segmentIndex === 0) {
|
|
1057
1071
|
this.parent.setRecordValue('width', item.width - differenceWidth, item, true);
|
|
1058
1072
|
this.parent.setRecordValue('left', item.left + differenceWidth, item, true);
|
|
1073
|
+
segment.width = segment.width - differenceWidth;
|
|
1059
1074
|
for (var i = 1; i < item.segments.length; i++) {
|
|
1060
1075
|
var segment_3 = segments[i];
|
|
1061
1076
|
segment_3.left = segment_3.left - differenceWidth;
|
|
@@ -1536,6 +1551,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1536
1551
|
var traceParentTaskBar = this.taskBarEditElement.querySelector('.' + cls.traceParentTaskBar);
|
|
1537
1552
|
var traceParentProgressBar = this.taskBarEditElement.querySelector('.' + cls.traceParentProgressBar);
|
|
1538
1553
|
var traceConnectorPointRight = this.taskBarEditElement.querySelector('.' + cls.rightConnectorPointOuterDiv);
|
|
1554
|
+
var segmentConnectorPointRight = taskBarMainContainer.querySelector('.' + cls.rightConnectorPointOuterDiv);
|
|
1539
1555
|
var manualParentTaskbar = this.taskBarEditElement;
|
|
1540
1556
|
var manualTaskbar = this.taskBarEditElement.querySelector('.' + cls.manualParentTaskBar);
|
|
1541
1557
|
var manualParentRight = this.taskBarEditElement.querySelector('.' + cls.manualParentRightResizer);
|
|
@@ -1562,6 +1578,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1562
1578
|
}
|
|
1563
1579
|
taskBarMainContainer.style.setProperty(position, (item.left) + 'px');
|
|
1564
1580
|
taskBarMainContainer.style.width = (width) + 'px';
|
|
1581
|
+
if (segmentedTaskBarContainer && segmentConnectorPointRight) {
|
|
1582
|
+
segmentConnectorPointRight.style.left = (this.parent.isAdaptive ? (width + 10) : (width + 2)) + 'px';
|
|
1583
|
+
}
|
|
1565
1584
|
if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule &&
|
|
1566
1585
|
(this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
|
|
1567
1586
|
taskBarMainContainer.style.setProperty('top', (this.topValue) + 'px');
|
|
@@ -1678,9 +1697,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1678
1697
|
}
|
|
1679
1698
|
if (segmentedTaskBarContainer) {
|
|
1680
1699
|
taskBarRightResizer.style.setProperty(position, rightResizer + 'px');
|
|
1681
|
-
traceChildProgressBar.style.width = (segment.
|
|
1700
|
+
traceChildProgressBar.style.width = (segment.width) + 'px';
|
|
1682
1701
|
if (!isNullOrUndefined(childProgressResizer)) {
|
|
1683
|
-
childProgressResizer.style.setProperty(position, segment.
|
|
1702
|
+
childProgressResizer.style.setProperty(position, segment.width - 10 + 'px');
|
|
1684
1703
|
}
|
|
1685
1704
|
}
|
|
1686
1705
|
}
|
|
@@ -1750,9 +1769,6 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1750
1769
|
this.taskBarEditAction === 'ConnectorPointRightDrag') && this.drawPredecessor && (!this.connectorSecondRecord.hasChildRecords ||
|
|
1751
1770
|
this.connectorSecondRecord.hasChildRecords && this.parent.allowParentDependency)) {
|
|
1752
1771
|
this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord, this.finalPredecessor);
|
|
1753
|
-
if (this.parent.UpdateOffsetOnTaskbarEdit) {
|
|
1754
|
-
this.parent.connectorLineEditModule['calculateOffset'](this.connectorSecondRecord);
|
|
1755
|
-
}
|
|
1756
1772
|
}
|
|
1757
1773
|
else {
|
|
1758
1774
|
if (x1 !== x2 || (Math.abs(y1 - resMouseY) >= (this.parent.rowHeight - this.parent.taskbarHeight) / 2)) {
|
|
@@ -2042,6 +2058,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
2042
2058
|
TaskbarEdit.prototype.updateConnectorLineSecondProperties = function (e) {
|
|
2043
2059
|
var target = this.getElementByPosition(e);
|
|
2044
2060
|
var element = parentsUntil(target, cls.taskBarMainContainer);
|
|
2061
|
+
var isBigger = document.body.className.includes("e-bigger");
|
|
2045
2062
|
this.connectorSecondAction = null;
|
|
2046
2063
|
var scrollTop = 0;
|
|
2047
2064
|
if (parentsUntil(target, cls.connectorPointLeft)) {
|
|
@@ -2064,20 +2081,20 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
2064
2081
|
if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
|
|
2065
2082
|
!this.elementOffsetLeft) || !this.parent.enableVirtualization) {
|
|
2066
2083
|
if (!this.parent.allowParentDependency) {
|
|
2067
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
2084
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
2068
2085
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
2069
2086
|
}
|
|
2070
2087
|
else {
|
|
2071
2088
|
if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
|
|
2072
|
-
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft;
|
|
2089
|
+
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
2073
2090
|
this.elementOffsetTop = ((this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
|
|
2074
2091
|
}
|
|
2075
2092
|
else {
|
|
2076
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
2093
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
2077
2094
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
2078
2095
|
}
|
|
2079
2096
|
}
|
|
2080
|
-
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth;
|
|
2097
|
+
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth + ((isBigger) ? 20 : 0);
|
|
2081
2098
|
this.elementOffsetHeight = this.realTaskbarElement.offsetHeight;
|
|
2082
2099
|
}
|
|
2083
2100
|
this.showHideTaskBarEditingElements(element, this.highlightedSecondElement, true);
|
|
@@ -2185,18 +2202,16 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
2185
2202
|
// Get XY coordinates for touch and non-touch device
|
|
2186
2203
|
TaskbarEdit.prototype.getCoordinate = function (event) {
|
|
2187
2204
|
var coordinates = {};
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2205
|
+
var e = event;
|
|
2206
|
+
coordinates.pageX = e.pageX;
|
|
2207
|
+
coordinates.pageY = e.pageY;
|
|
2208
|
+
if (event && event.type !== 'click') {
|
|
2209
|
+
var e_1 = event;
|
|
2210
|
+
if (e_1.type === 'touchmove' || e_1.type === 'touchstart' || e_1.type === 'touchend') {
|
|
2211
|
+
coordinates.pageX = e_1.changedTouches[0].pageX;
|
|
2212
|
+
coordinates.pageY = e_1.changedTouches[0].pageY;
|
|
2193
2213
|
}
|
|
2194
2214
|
}
|
|
2195
|
-
else if (event) {
|
|
2196
|
-
var e = event;
|
|
2197
|
-
coordinates.pageX = e.pageX;
|
|
2198
|
-
coordinates.pageY = e.pageY;
|
|
2199
|
-
}
|
|
2200
2215
|
return coordinates;
|
|
2201
2216
|
};
|
|
2202
2217
|
// Get current target element by mouse position
|
|
@@ -394,6 +394,14 @@ var Toolbar = /** @class */ (function () {
|
|
|
394
394
|
var edit = gObj.editSettings;
|
|
395
395
|
var gID = this.id;
|
|
396
396
|
var ind = gObj.selectedRowIndex;
|
|
397
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
398
|
+
for (var i = 0; i < gObj.updatedRecords.length; i++) {
|
|
399
|
+
if (gObj.updatedRecords[i].index === ind) {
|
|
400
|
+
ind = i;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
397
405
|
var previousGanttRecord;
|
|
398
406
|
var isSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length === 1 ||
|
|
399
407
|
gObj.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
@@ -307,7 +307,7 @@ var DateProcessor = /** @class */ (function () {
|
|
|
307
307
|
}
|
|
308
308
|
else {
|
|
309
309
|
if ((!isNullOrUndefined(this.parent.taskFields.milestone)) && (!isNullOrUndefined(ganttProperties.startDate)) && !isNullOrUndefined(ganttProperties.endDate) &&
|
|
310
|
-
(ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() &&
|
|
310
|
+
(ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() && (ganttData.taskData[this.parent.taskFields.milestone] === false)) {
|
|
311
311
|
tDuration = 1;
|
|
312
312
|
}
|
|
313
313
|
else {
|
|
@@ -11,6 +11,7 @@ var GanttChart = /** @class */ (function () {
|
|
|
11
11
|
function GanttChart(parent) {
|
|
12
12
|
this.isExpandCollapseFromChart = false;
|
|
13
13
|
this.isExpandAll = false;
|
|
14
|
+
this.isCollapseAll = false;
|
|
14
15
|
this.isGanttElement = false;
|
|
15
16
|
this.parent = parent;
|
|
16
17
|
this.chartTimelineContainer = null;
|
|
@@ -356,6 +357,42 @@ var GanttChart = /** @class */ (function () {
|
|
|
356
357
|
if (this.parent.editSettings.allowTaskbarEditing) {
|
|
357
358
|
this.parent.notify('chartMouseUp', e);
|
|
358
359
|
}
|
|
360
|
+
if (!this.parent.editSettings.allowEditing) {
|
|
361
|
+
var isTaskbarEdited = false;
|
|
362
|
+
if (this.parent.editSettings.allowTaskbarEditing &&
|
|
363
|
+
getValue('editModule.taskbarEditModule.isMouseDragged', this.parent) &&
|
|
364
|
+
getValue('editModule.taskbarEditModule.taskBarEditAction', this.parent)) {
|
|
365
|
+
isTaskbarEdited = true;
|
|
366
|
+
}
|
|
367
|
+
if (!isTaskbarEdited) {
|
|
368
|
+
/** Expand/collapse action */
|
|
369
|
+
var target = e.target;
|
|
370
|
+
var isOnTaskbarElement = e.target.classList.contains(cls.taskBarMainContainer)
|
|
371
|
+
|| closest(e.target, '.' + cls.taskBarMainContainer);
|
|
372
|
+
if (closest(target, '.e-gantt-parent-taskbar') && !this.parent.editSettings.allowEditing) {
|
|
373
|
+
this.chartExpandCollapseRequest(e);
|
|
374
|
+
}
|
|
375
|
+
else if (!isOnTaskbarElement && this.parent.autoFocusTasks) {
|
|
376
|
+
this.scrollToTarget(e); /** Scroll to task */
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (e.type === "touchend") {
|
|
381
|
+
var resizeCheck = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
|
|
382
|
+
if (!isNullOrUndefined(resizeCheck)) {
|
|
383
|
+
resizeCheck.remove();
|
|
384
|
+
}
|
|
385
|
+
var Check = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-clone-taskbar');
|
|
386
|
+
if (!isNullOrUndefined(Check)) {
|
|
387
|
+
var clonetbody = Check.parentElement;
|
|
388
|
+
var cloneTable = clonetbody.parentElement;
|
|
389
|
+
cloneTable.remove();
|
|
390
|
+
}
|
|
391
|
+
var falseline = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-gantt-false-line');
|
|
392
|
+
if (!isNullOrUndefined(falseline)) {
|
|
393
|
+
this.parent.editModule.taskbarEditModule.removeFalseLine(true);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
359
396
|
};
|
|
360
397
|
/**
|
|
361
398
|
*
|
|
@@ -747,13 +784,27 @@ var GanttChart = /** @class */ (function () {
|
|
|
747
784
|
* @private
|
|
748
785
|
*/
|
|
749
786
|
GanttChart.prototype.collapsedGanttRow = function (args) {
|
|
787
|
+
var _this = this;
|
|
750
788
|
if ((isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) || isNullOrUndefined(args['chartRow'])) {
|
|
751
789
|
return;
|
|
752
790
|
}
|
|
753
|
-
var record
|
|
791
|
+
var record;
|
|
792
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
793
|
+
record = this.parent.currentViewData.filter(function (item) { return item.ganttProperties[_this.parent.taskFields.id] === args['data'][_this.parent.taskFields.id]; })[0];
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
record = getValue('data', args);
|
|
797
|
+
}
|
|
754
798
|
if (this.isExpandCollapseFromChart) {
|
|
755
799
|
this.expandCollapseChartRows('collapse', getValue('chartRow', args), record, null);
|
|
756
|
-
this.parent.
|
|
800
|
+
var idField_1 = this.parent.taskFields.id;
|
|
801
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
802
|
+
var gridRec = this.parent.treeGrid.getCurrentViewRecords().filter(function (item) { return item[idField_1] == args['data'][idField_1]; })[0];
|
|
803
|
+
this.parent.treeGrid.collapseRow(getValue('gridRow', args), gridRec);
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
this.parent.treeGrid.collapseRow(getValue('gridRow', args), record);
|
|
807
|
+
}
|
|
757
808
|
this.isExpandCollapseFromChart = false;
|
|
758
809
|
}
|
|
759
810
|
else {
|
|
@@ -798,13 +849,27 @@ var GanttChart = /** @class */ (function () {
|
|
|
798
849
|
* @private
|
|
799
850
|
*/
|
|
800
851
|
GanttChart.prototype.expandedGanttRow = function (args) {
|
|
852
|
+
var _this = this;
|
|
801
853
|
if ((isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) || isNullOrUndefined(args['chartRow'])) {
|
|
802
854
|
return;
|
|
803
855
|
}
|
|
804
|
-
var record
|
|
856
|
+
var record;
|
|
857
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
858
|
+
record = this.parent.currentViewData.filter(function (item) { return item.ganttProperties.taskId == args['data'][_this.parent.taskFields.id]; })[0];
|
|
859
|
+
}
|
|
860
|
+
else {
|
|
861
|
+
record = getValue('data', args);
|
|
862
|
+
}
|
|
805
863
|
if (this.isExpandCollapseFromChart) {
|
|
806
864
|
this.expandCollapseChartRows('expand', getValue('chartRow', args), record, null);
|
|
807
|
-
this.parent.
|
|
865
|
+
var idField_2 = this.parent.taskFields.id;
|
|
866
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
867
|
+
var gridRec = this.parent.treeGrid.getCurrentViewRecords().filter(function (item) { return item[idField_2] == args['data'][idField_2]; })[0];
|
|
868
|
+
this.parent.treeGrid.expandRow(getValue('gridRow', args), gridRec);
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
this.parent.treeGrid.expandRow(getValue('gridRow', args), record);
|
|
872
|
+
}
|
|
808
873
|
this.isExpandCollapseFromChart = false;
|
|
809
874
|
}
|
|
810
875
|
else {
|
|
@@ -903,9 +968,11 @@ var GanttChart = /** @class */ (function () {
|
|
|
903
968
|
this.parent.treeGrid.expandAll();
|
|
904
969
|
}
|
|
905
970
|
else {
|
|
971
|
+
this.isCollapseAll = true;
|
|
906
972
|
this.parent.treeGrid.collapseAll();
|
|
907
973
|
}
|
|
908
974
|
this.isExpandAll = false;
|
|
975
|
+
this.isCollapseAll = false;
|
|
909
976
|
};
|
|
910
977
|
/**
|
|
911
978
|
* Public method to expand particular level of rows.
|
|
@@ -1388,7 +1455,7 @@ var GanttChart = /** @class */ (function () {
|
|
|
1388
1455
|
childElement = element;
|
|
1389
1456
|
}
|
|
1390
1457
|
}
|
|
1391
|
-
if (element.classList.contains('e-right-label-temp-container') || element.classList.contains('e-left-label-temp-container') || element.classList.contains('e-indicator-span')) {
|
|
1458
|
+
if (element.classList.contains('e-right-label-temp-container') || element.classList.contains('e-left-label-temp-container') || element.classList.contains('e-indicator-span') || element.classList.contains("e-timeline-header-container")) {
|
|
1392
1459
|
if (focus === 'add') {
|
|
1393
1460
|
element.setAttribute('tabIndex', '0');
|
|
1394
1461
|
addClass([element], 'e-active-container');
|
|
@@ -1452,7 +1519,13 @@ var GanttChart = /** @class */ (function () {
|
|
|
1452
1519
|
recordIndex = this.parent.flatData.indexOf(record);
|
|
1453
1520
|
}
|
|
1454
1521
|
else {
|
|
1455
|
-
|
|
1522
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
1523
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
1524
|
+
recordIndex = this.parent.ids.indexOf(record.ganttProperties.taskId.toString());
|
|
1525
|
+
}
|
|
1526
|
+
else {
|
|
1527
|
+
recordIndex = this.parent.currentViewData.indexOf(record);
|
|
1528
|
+
}
|
|
1456
1529
|
}
|
|
1457
1530
|
}
|
|
1458
1531
|
return recordIndex;
|
|
@@ -57,6 +57,13 @@ export interface GanttModel extends ComponentModel{
|
|
|
57
57
|
*/
|
|
58
58
|
enableVirtualMaskRow?: boolean;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Gets or sets whether to load child record on demand in remote data binding. Initially parent records are rendered in collapsed state.
|
|
62
|
+
*
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
loadChildOnDemand?: boolean;
|
|
66
|
+
|
|
60
67
|
/**
|
|
61
68
|
* Specifies whether to update offset value on a task for all the predecessor edit actions.
|
|
62
69
|
*
|
|
@@ -350,6 +350,12 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
|
|
|
350
350
|
* @default true
|
|
351
351
|
*/
|
|
352
352
|
enableVirtualMaskRow: boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Gets or sets whether to load child record on demand in remote data binding. Initially parent records are rendered in collapsed state.
|
|
355
|
+
*
|
|
356
|
+
* @default false
|
|
357
|
+
*/
|
|
358
|
+
loadChildOnDemand: boolean;
|
|
353
359
|
/**
|
|
354
360
|
* Specifies whether to update offset value on a task for all the predecessor edit actions.
|
|
355
361
|
*
|