@syncfusion/ej2-gantt 19.3.57 → 19.4.42
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 +41 -1
- package/README.md +1 -1
- 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 +149 -74
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +146 -71
- 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 +18 -18
- package/src/gantt/actions/context-menu.js +35 -14
- package/src/gantt/actions/dialog-edit.js +6 -3
- package/src/gantt/actions/edit.js +5 -1
- package/src/gantt/actions/keyboard.js +6 -2
- package/src/gantt/actions/rowdragdrop.js +2 -0
- package/src/gantt/actions/taskbar-edit.js +5 -1
- package/src/gantt/base/date-processor.js +8 -1
- package/src/gantt/base/gantt-chart.js +0 -2
- package/src/gantt/base/gantt.d.ts +15 -13
- package/src/gantt/base/gantt.js +32 -28
- package/src/gantt/base/task-processor.js +26 -4
- package/src/gantt/base/tree-grid.js +3 -0
- package/src/gantt/renderer/chart-rows.js +2 -0
- package/src/gantt/renderer/timeline.d.ts +1 -0
- package/src/gantt/renderer/timeline.js +16 -15
- package/styles/bootstrap5-dark.css +6 -5
- package/styles/bootstrap5.css +6 -5
- package/styles/fabric-dark.css +1 -1
- package/styles/gantt/_bootstrap4-definition.scss +1 -0
- package/styles/gantt/_bootstrap5-definition.scss +1 -1
- package/styles/gantt/_fabric-dark-definition.scss +2 -1
- package/styles/gantt/_fluent-definition.scss +163 -0
- package/styles/gantt/_layout.scss +7 -7
- package/styles/gantt/_material-dark-definition.scss +2 -1
- package/styles/gantt/_theme.scss +2 -1
- package/styles/gantt/bootstrap5-dark.css +6 -5
- package/styles/gantt/bootstrap5.css +6 -5
- package/styles/gantt/fabric-dark.css +1 -1
- package/styles/gantt/icons/_fluent.scss +112 -0
- package/styles/gantt/icons/_tailwind-dark.scss +112 -112
- package/styles/gantt/material-dark.css +1 -1
- package/styles/gantt/tailwind-dark.css +1 -1
- package/styles/gantt/tailwind.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.
|
|
3
|
+
* version : 19.4.42
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-gantt@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-gantt@19.
|
|
3
|
+
"_id": "@syncfusion/ej2-gantt@19.4.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-3KG1MspUbkHxeZJld50zA7/dLZW73hmvbOghZ4/Ti62Z5c5hTuK4txNgNz0968loU+UCjAU4cyMU391bjUEqpA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-gantt",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-gantt",
|
|
24
24
|
"/@syncfusion/ej2-vue-gantt"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-19.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-19.4.41.tgz",
|
|
27
|
+
"_shasum": "95e837b715bb937d5f45dbf8ab343a1172ac2f78",
|
|
28
28
|
"_spec": "@syncfusion/ej2-gantt@*",
|
|
29
29
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~19.
|
|
39
|
-
"@syncfusion/ej2-buttons": "~19.
|
|
40
|
-
"@syncfusion/ej2-calendars": "~19.
|
|
41
|
-
"@syncfusion/ej2-data": "~19.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~19.
|
|
43
|
-
"@syncfusion/ej2-grids": "~19.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~19.
|
|
45
|
-
"@syncfusion/ej2-layouts": "~19.
|
|
46
|
-
"@syncfusion/ej2-lists": "~19.
|
|
47
|
-
"@syncfusion/ej2-navigations": "~19.
|
|
48
|
-
"@syncfusion/ej2-popups": "~19.
|
|
49
|
-
"@syncfusion/ej2-richtexteditor": "~19.
|
|
50
|
-
"@syncfusion/ej2-treegrid": "~19.
|
|
38
|
+
"@syncfusion/ej2-base": "~19.4.42",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~19.4.42",
|
|
40
|
+
"@syncfusion/ej2-calendars": "~19.4.42",
|
|
41
|
+
"@syncfusion/ej2-data": "~19.4.42",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~19.4.42",
|
|
43
|
+
"@syncfusion/ej2-grids": "~19.4.42",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~19.4.42",
|
|
45
|
+
"@syncfusion/ej2-layouts": "~19.4.38",
|
|
46
|
+
"@syncfusion/ej2-lists": "~19.4.38",
|
|
47
|
+
"@syncfusion/ej2-navigations": "~19.4.41",
|
|
48
|
+
"@syncfusion/ej2-popups": "~19.4.41",
|
|
49
|
+
"@syncfusion/ej2-richtexteditor": "~19.4.40",
|
|
50
|
+
"@syncfusion/ej2-treegrid": "~19.4.42"
|
|
51
51
|
},
|
|
52
52
|
"deprecated": false,
|
|
53
53
|
"description": "Essential JS 2 Gantt Component",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
"url": "git+https://github.com/syncfusion/ej2-gantt.git"
|
|
76
76
|
},
|
|
77
77
|
"typings": "index.d.ts",
|
|
78
|
-
"version": "19.
|
|
78
|
+
"version": "19.4.42",
|
|
79
79
|
"sideEffects": false
|
|
80
80
|
}
|
|
@@ -108,6 +108,12 @@ var ContextMenu = /** @class */ (function () {
|
|
|
108
108
|
position = this.item;
|
|
109
109
|
data = extend({}, {}, this.rowData.taskData, true);
|
|
110
110
|
taskfields = this.parent.taskFields;
|
|
111
|
+
if (data[taskfields.startDate]) {
|
|
112
|
+
this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
|
|
113
|
+
}
|
|
114
|
+
if (data[taskfields.endDate]) {
|
|
115
|
+
this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
|
|
116
|
+
}
|
|
111
117
|
if (!isNullOrUndefined(taskfields.dependency)) {
|
|
112
118
|
data[taskfields.dependency] = null;
|
|
113
119
|
}
|
|
@@ -301,7 +307,12 @@ var ContextMenu = /** @class */ (function () {
|
|
|
301
307
|
var item = _a[_i];
|
|
302
308
|
// let target: EventTarget = target;
|
|
303
309
|
if (!item.separator) {
|
|
304
|
-
this.
|
|
310
|
+
if ((target.classList.contains('e-gantt-unscheduled-taskbar')) && ((item.text === this.getLocale('splitTask')) || (item.text === this.getLocale('mergeTask')))) {
|
|
311
|
+
this.hideItems.push(item.text);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
this.updateItemStatus(item, target, rowIndex);
|
|
315
|
+
}
|
|
305
316
|
}
|
|
306
317
|
}
|
|
307
318
|
args.rowData = this.rowData;
|
|
@@ -413,24 +424,34 @@ var ContextMenu = /** @class */ (function () {
|
|
|
413
424
|
break;
|
|
414
425
|
case 'Indent':
|
|
415
426
|
{
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
this.parent.
|
|
422
|
-
|
|
427
|
+
if (!this.parent.allowSelection) {
|
|
428
|
+
this.hideItems.push(item.text);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
var index = this.parent.selectedRowIndex;
|
|
432
|
+
var isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
|
|
433
|
+
this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
434
|
+
var prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
|
|
435
|
+
if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
|
|
436
|
+
this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
|
|
437
|
+
this.updateItemVisibility(item.text);
|
|
438
|
+
}
|
|
423
439
|
}
|
|
424
440
|
break;
|
|
425
441
|
}
|
|
426
442
|
case 'Outdent':
|
|
427
443
|
{
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
this.
|
|
444
|
+
if (!this.parent.allowSelection) {
|
|
445
|
+
this.hideItems.push(item.text);
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
var ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
|
|
449
|
+
var isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
|
|
450
|
+
this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
451
|
+
if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
|
|
452
|
+
this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
|
|
453
|
+
this.updateItemVisibility(item.text);
|
|
454
|
+
}
|
|
434
455
|
}
|
|
435
456
|
break;
|
|
436
457
|
}
|
|
@@ -262,7 +262,7 @@ var DialogEdit = /** @class */ (function () {
|
|
|
262
262
|
tempData.ganttProperties.durationUnit = this.parent.durationUnit.toLocaleLowerCase();
|
|
263
263
|
}
|
|
264
264
|
else if (columns[i].field === taskSettings.name) {
|
|
265
|
-
tempData[field] = '
|
|
265
|
+
tempData[field] = this.localeObj.getConstant('addDialogTitle') + ' ' + id;
|
|
266
266
|
tempData.ganttProperties.taskName = tempData[field];
|
|
267
267
|
}
|
|
268
268
|
else if (columns[i].field === taskSettings.progress) {
|
|
@@ -1106,7 +1106,7 @@ var DialogEdit = /** @class */ (function () {
|
|
|
1106
1106
|
var datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
|
|
1107
1107
|
var value = args.rowData[args.column.field];
|
|
1108
1108
|
setValue('value', value, datePickerModel);
|
|
1109
|
-
var datePicker = new
|
|
1109
|
+
var datePicker = new _this.inputs[_this.parent.columnByField[_this.parent.taskFields[fields[i]]].editType](datePickerModel);
|
|
1110
1110
|
datePicker.appendTo(args.element);
|
|
1111
1111
|
},
|
|
1112
1112
|
read: function (args) {
|
|
@@ -1181,7 +1181,7 @@ var DialogEdit = /** @class */ (function () {
|
|
|
1181
1181
|
inputValue = dialog.querySelector('#' + ganttId + 'SegmentsTabContainer' + columnName)
|
|
1182
1182
|
.ej2_instances[0];
|
|
1183
1183
|
}
|
|
1184
|
-
if (inputValue.value !== tempValue.toString()) {
|
|
1184
|
+
if (inputValue.value.toString() !== tempValue.toString()) {
|
|
1185
1185
|
inputValue.value = tempValue;
|
|
1186
1186
|
inputValue.dataBind();
|
|
1187
1187
|
}
|
|
@@ -1993,6 +1993,9 @@ var DialogEdit = /** @class */ (function () {
|
|
|
1993
1993
|
this.rowData.ganttProperties.segments = dataSource;
|
|
1994
1994
|
this.parent.setRecordValue('segments', this.parent.dataOperation.setSegmentsInfo(this.rowData, false), this.rowData.ganttProperties, true);
|
|
1995
1995
|
this.parent.setRecordValue('taskData.' + this.parent.taskFields.segments, userData, this.rowData);
|
|
1996
|
+
if (dataSource.length <= 0) {
|
|
1997
|
+
this.validateDuration(this.rowData);
|
|
1998
|
+
}
|
|
1996
1999
|
}
|
|
1997
2000
|
};
|
|
1998
2001
|
// eslint-disable-next-line
|
|
@@ -799,7 +799,7 @@ var Edit = /** @class */ (function () {
|
|
|
799
799
|
this.updateParentItemOnEditing();
|
|
800
800
|
}
|
|
801
801
|
/** Update parent up-to zeroth level */
|
|
802
|
-
if (ganttRecord.parentItem
|
|
802
|
+
if (ganttRecord.parentItem) {
|
|
803
803
|
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
804
804
|
}
|
|
805
805
|
this.initiateSaveAction(args);
|
|
@@ -2433,6 +2433,9 @@ var Edit = /** @class */ (function () {
|
|
|
2433
2433
|
var taskFields = this.parent.taskFields;
|
|
2434
2434
|
var dataSource = isCountRequired(this.parent) ? getValue('result', this.parent.dataSource) :
|
|
2435
2435
|
this.parent.dataSource;
|
|
2436
|
+
if (this.parent.dataSource instanceof DataManager) {
|
|
2437
|
+
dataSource = this.parent.dataSource.dataSource.json;
|
|
2438
|
+
}
|
|
2436
2439
|
for (var i = 0; i < addedRecord.length; i++) {
|
|
2437
2440
|
if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
|
|
2438
2441
|
rowPosition = 'Top';
|
|
@@ -2505,6 +2508,7 @@ var Edit = /** @class */ (function () {
|
|
|
2505
2508
|
Edit.prototype.addRecord = function (data, rowPosition, rowIndex) {
|
|
2506
2509
|
var _this = this;
|
|
2507
2510
|
if (this.parent.editModule && this.parent.editSettings.allowAdding) {
|
|
2511
|
+
this.parent.isDynamicData = true;
|
|
2508
2512
|
var cAddedRecord_1 = [];
|
|
2509
2513
|
if (isNullOrUndefined(data)) {
|
|
2510
2514
|
this.validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord_1);
|
|
@@ -25,6 +25,10 @@ var FocusModule = /** @class */ (function () {
|
|
|
25
25
|
FocusModule.prototype.onKeyPress = function (e) {
|
|
26
26
|
var ganttObj = this.parent;
|
|
27
27
|
var expandedRecords = ganttObj.getExpandedRecords(ganttObj.currentViewData);
|
|
28
|
+
if (isNullOrUndefined(this.parent.focusModule.getActiveElement()) && (e.action === 'expandAll' || e.action === 'collapseAll')) {
|
|
29
|
+
var focussedElement = this.parent.element.querySelector('.e-treegrid');
|
|
30
|
+
focussedElement.focus();
|
|
31
|
+
}
|
|
28
32
|
var targetElement = this.parent.focusModule.getActiveElement();
|
|
29
33
|
if (e.action === 'home' || e.action === 'end' || e.action === 'downArrow' || e.action === 'upArrow' || e.action === 'delete' ||
|
|
30
34
|
e.action === 'rightArrow' || e.action === 'leftArrow' || e.action === 'focusTask' || e.action === 'focusSearch' ||
|
|
@@ -137,9 +141,9 @@ var FocusModule = /** @class */ (function () {
|
|
|
137
141
|
{
|
|
138
142
|
if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
|
|
139
143
|
e.preventDefault();
|
|
140
|
-
var focussedElement = ganttObj.element.querySelector('.e-gantt-chart');
|
|
141
|
-
focussedElement.focus();
|
|
142
144
|
ganttObj.addRecord();
|
|
145
|
+
var focussedElement = ganttObj.element;
|
|
146
|
+
focussedElement.focus();
|
|
143
147
|
}
|
|
144
148
|
break;
|
|
145
149
|
}
|
|
@@ -541,6 +541,7 @@ var RowDD = /** @class */ (function () {
|
|
|
541
541
|
else {
|
|
542
542
|
var level = 1;
|
|
543
543
|
draggedRecord.level = droppedRecord.level + 1;
|
|
544
|
+
this.parent.setRecordValue('level', this.draggedRecord.level, this.draggedRecord);
|
|
544
545
|
this.updateChildRecordLevel(draggedRecord, level);
|
|
545
546
|
}
|
|
546
547
|
droppedRecord.expanded = true;
|
|
@@ -625,6 +626,7 @@ var RowDD = /** @class */ (function () {
|
|
|
625
626
|
parentData = this.parent.treeGrid[id][record.parentItem.uniqueID];
|
|
626
627
|
}
|
|
627
628
|
currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;
|
|
629
|
+
this.parent.setRecordValue('level', currentRecord.level, currentRecord);
|
|
628
630
|
if (currentRecord.hasChildRecords) {
|
|
629
631
|
level--;
|
|
630
632
|
level = this.updateChildRecordLevel(currentRecord, level);
|
|
@@ -493,8 +493,11 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
493
493
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
494
494
|
var args = {
|
|
495
495
|
cancel: false,
|
|
496
|
-
requestType: '
|
|
496
|
+
requestType: 'taskbarediting'
|
|
497
497
|
};
|
|
498
|
+
if (this.segmentIndex !== -1) {
|
|
499
|
+
args.requestType = 'mergeSegment';
|
|
500
|
+
}
|
|
498
501
|
this.parent.trigger('actionBegin', args, function (arg) {
|
|
499
502
|
if (arg.cancel === false) {
|
|
500
503
|
_this.taskBarEditingAction(event, false);
|
|
@@ -1479,6 +1482,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1479
1482
|
this.isMouseDragged = false;
|
|
1480
1483
|
}
|
|
1481
1484
|
else {
|
|
1485
|
+
this.parent.isOnEdit = false;
|
|
1482
1486
|
this.cancelTaskbarEditActionInMouseLeave();
|
|
1483
1487
|
}
|
|
1484
1488
|
}
|
|
@@ -281,7 +281,14 @@ var DateProcessor = /** @class */ (function () {
|
|
|
281
281
|
tDuration = this.parent.editModule.taskbarEditModule.sumOfDuration(ganttProperties.segments);
|
|
282
282
|
}
|
|
283
283
|
else {
|
|
284
|
-
|
|
284
|
+
// eslint-disable-next-line
|
|
285
|
+
if (!isNullOrUndefined(ganttProperties.startDate) && !isNullOrUndefined(ganttProperties.endDate) &&
|
|
286
|
+
(ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() && !isNullOrUndefined(ganttData.taskData[this.parent.taskFields.milestone])) {
|
|
287
|
+
tDuration = 1;
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
tDuration = this.getDuration(ganttProperties.startDate, ganttProperties.endDate, ganttProperties.durationUnit, ganttProperties.isAutoSchedule, ganttProperties.isMilestone);
|
|
291
|
+
}
|
|
285
292
|
}
|
|
286
293
|
this.parent.setRecordValue('duration', tDuration, ganttProperties, true);
|
|
287
294
|
var col = this.parent.columnByField[this.parent.columnMapping.duration];
|
|
@@ -775,8 +775,6 @@ var GanttChart = /** @class */ (function () {
|
|
|
775
775
|
this.parent.treeGrid.collapseAll();
|
|
776
776
|
}
|
|
777
777
|
this.isExpandAll = false;
|
|
778
|
-
var focussedElement = this.parent.element.querySelector('.e-treegrid');
|
|
779
|
-
focussedElement.focus();
|
|
780
778
|
};
|
|
781
779
|
/**
|
|
782
780
|
* Public method to expand particular level of rows.
|
|
@@ -199,6 +199,8 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
|
|
|
199
199
|
/** @hidden */
|
|
200
200
|
isExpandCollapseLevelMethod: boolean;
|
|
201
201
|
/** @hidden */
|
|
202
|
+
isDynamicData: boolean;
|
|
203
|
+
/** @hidden */
|
|
202
204
|
contentHeight: number;
|
|
203
205
|
/** @hidden */
|
|
204
206
|
isAdaptive: Boolean;
|
|
@@ -1207,6 +1209,19 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
|
|
|
1207
1209
|
* @private
|
|
1208
1210
|
*/
|
|
1209
1211
|
getModuleName(): string;
|
|
1212
|
+
/**
|
|
1213
|
+
* For internal use only - Initialize the event handler
|
|
1214
|
+
*
|
|
1215
|
+
* @returns {void} .
|
|
1216
|
+
* @private
|
|
1217
|
+
*/
|
|
1218
|
+
protected preRender(): void;
|
|
1219
|
+
private initProperties;
|
|
1220
|
+
/**
|
|
1221
|
+
* @returns {string} .
|
|
1222
|
+
* @private
|
|
1223
|
+
*/
|
|
1224
|
+
getDateFormat(): string;
|
|
1210
1225
|
/**
|
|
1211
1226
|
* To get timezone offset.
|
|
1212
1227
|
*
|
|
@@ -1222,19 +1237,6 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
|
|
|
1222
1237
|
* @private
|
|
1223
1238
|
*/
|
|
1224
1239
|
isInDst(date: Date): boolean;
|
|
1225
|
-
/**
|
|
1226
|
-
* For internal use only - Initialize the event handler
|
|
1227
|
-
*
|
|
1228
|
-
* @returns {void} .
|
|
1229
|
-
* @private
|
|
1230
|
-
*/
|
|
1231
|
-
protected preRender(): void;
|
|
1232
|
-
private initProperties;
|
|
1233
|
-
/**
|
|
1234
|
-
* @returns {string} .
|
|
1235
|
-
* @private
|
|
1236
|
-
*/
|
|
1237
|
-
getDateFormat(): string;
|
|
1238
1240
|
/**
|
|
1239
1241
|
* Method to map resource fields.
|
|
1240
1242
|
*
|
package/src/gantt/base/gantt.js
CHANGED
|
@@ -72,6 +72,8 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
72
72
|
/** @hidden */
|
|
73
73
|
_this.isExpandCollapseLevelMethod = false;
|
|
74
74
|
/** @hidden */
|
|
75
|
+
_this.isDynamicData = false;
|
|
76
|
+
/** @hidden */
|
|
75
77
|
_this.isConnectorLineUpdate = false;
|
|
76
78
|
/** @hidden */
|
|
77
79
|
_this.staticSelectedRowIndex = -1;
|
|
@@ -111,27 +113,6 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
111
113
|
Gantt.prototype.getModuleName = function () {
|
|
112
114
|
return 'gantt';
|
|
113
115
|
};
|
|
114
|
-
/**
|
|
115
|
-
* To get timezone offset.
|
|
116
|
-
*
|
|
117
|
-
* @returns {number} .
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
Gantt.prototype.getDefaultTZOffset = function () {
|
|
121
|
-
var janMonth = new Date(new Date().getFullYear(), 0, 1);
|
|
122
|
-
var julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
|
|
123
|
-
return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* To check whether the date is in DST.
|
|
127
|
-
*
|
|
128
|
-
* @param {Date} date .
|
|
129
|
-
* @returns {boolean} .
|
|
130
|
-
* @private
|
|
131
|
-
*/
|
|
132
|
-
Gantt.prototype.isInDst = function (date) {
|
|
133
|
-
return date.getTimezoneOffset() < this.getDefaultTZOffset();
|
|
134
|
-
};
|
|
135
116
|
/**
|
|
136
117
|
* For internal use only - Initialize the event handler
|
|
137
118
|
*
|
|
@@ -250,6 +231,27 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
250
231
|
return ganttDateFormat;
|
|
251
232
|
}
|
|
252
233
|
};
|
|
234
|
+
/**
|
|
235
|
+
* To get timezone offset.
|
|
236
|
+
*
|
|
237
|
+
* @returns {number} .
|
|
238
|
+
* @private
|
|
239
|
+
*/
|
|
240
|
+
Gantt.prototype.getDefaultTZOffset = function () {
|
|
241
|
+
var janMonth = new Date(new Date().getFullYear(), 0, 1);
|
|
242
|
+
var julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
|
|
243
|
+
return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* To check whether the date is in DST.
|
|
247
|
+
*
|
|
248
|
+
* @param {Date} date .
|
|
249
|
+
* @returns {boolean} .
|
|
250
|
+
* @private
|
|
251
|
+
*/
|
|
252
|
+
Gantt.prototype.isInDst = function (date) {
|
|
253
|
+
return date.getTimezoneOffset() < this.getDefaultTZOffset();
|
|
254
|
+
};
|
|
253
255
|
/**
|
|
254
256
|
* Method to map resource fields.
|
|
255
257
|
*
|
|
@@ -402,7 +404,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
402
404
|
this.treeGrid.dataSource = { result: this.flatData, count: count };
|
|
403
405
|
}
|
|
404
406
|
else {
|
|
405
|
-
this.treeGrid.dataSource = this.flatData
|
|
407
|
+
this.treeGrid.dataSource = this.flatData;
|
|
406
408
|
}
|
|
407
409
|
}
|
|
408
410
|
else {
|
|
@@ -964,10 +966,8 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
964
966
|
this.treeGrid.grid.searchSettings = getActualProperties(this.searchSettings);
|
|
965
967
|
this.treeGrid.grid.dataBind();
|
|
966
968
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
this.treeGrid.dataBind();
|
|
970
|
-
}
|
|
969
|
+
this.treeGrid.searchSettings = getActualProperties(this.searchSettings);
|
|
970
|
+
this.treeGrid.dataBind();
|
|
971
971
|
if (this.toolbarModule) {
|
|
972
972
|
this.toolbarModule.updateSearchTextBox();
|
|
973
973
|
}
|
|
@@ -2450,6 +2450,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2450
2450
|
* @public
|
|
2451
2451
|
*/
|
|
2452
2452
|
Gantt.prototype.updateDataSource = function (dataSource, args) {
|
|
2453
|
+
this.isDynamicData = true;
|
|
2453
2454
|
if (!isNullOrUndefined(args)) {
|
|
2454
2455
|
for (var _i = 0, _a = Object.keys(args); _i < _a.length; _i++) { // eslint-disable-line
|
|
2455
2456
|
var prop = _a[_i];
|
|
@@ -2653,12 +2654,15 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2653
2654
|
if (!isNullOrUndefined(rowData)) {
|
|
2654
2655
|
var data = extend({}, {}, rowData.taskData, true);
|
|
2655
2656
|
var taskfields = this.taskFields;
|
|
2657
|
+
if (data[taskfields.startDate]) {
|
|
2658
|
+
this.setRecordValue(taskfields.startDate, rowData.ganttProperties.startDate, data, true);
|
|
2659
|
+
}
|
|
2656
2660
|
if (!isNullOrUndefined(taskfields.duration)) {
|
|
2657
2661
|
data[taskfields.duration] = 0;
|
|
2658
2662
|
}
|
|
2659
2663
|
else {
|
|
2660
|
-
data[taskfields.startDate] = new Date(rowData.
|
|
2661
|
-
data[taskfields.endDate] = new Date(rowData.
|
|
2664
|
+
data[taskfields.startDate] = new Date(rowData.ganttProperties.startDate);
|
|
2665
|
+
data[taskfields.endDate] = new Date(rowData.ganttProperties.endDate);
|
|
2662
2666
|
}
|
|
2663
2667
|
if (!isNullOrUndefined(taskfields.milestone)) {
|
|
2664
2668
|
if (data[taskfields.milestone] === false) {
|
|
@@ -734,8 +734,16 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
734
734
|
var ganttProperties = ganttData.ganttProperties;
|
|
735
735
|
var duration = data[taskSettings.duration];
|
|
736
736
|
duration = isNullOrUndefined(duration) || duration === '' ? null : duration;
|
|
737
|
-
var startDate
|
|
738
|
-
var endDate
|
|
737
|
+
var startDate;
|
|
738
|
+
var endDate;
|
|
739
|
+
if (ganttProperties.startDate && ganttProperties.endDate) {
|
|
740
|
+
startDate = this.getDateFromFormat(ganttProperties.startDate, true);
|
|
741
|
+
endDate = this.getDateFromFormat(ganttProperties.endDate, true);
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
|
|
745
|
+
endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
|
|
746
|
+
}
|
|
739
747
|
var segments = taskSettings.segments ? (data[taskSettings.segments] ||
|
|
740
748
|
ganttData.taskData[taskSettings.segments]) : null;
|
|
741
749
|
var isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
|
|
@@ -1125,7 +1133,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1125
1133
|
eDate.setHours(0, 0, 0, 0);
|
|
1126
1134
|
}
|
|
1127
1135
|
}
|
|
1128
|
-
|
|
1136
|
+
if ((sDate).getTime() === (eDate).getTime()) {
|
|
1137
|
+
return (this.parent.perDayWidth);
|
|
1138
|
+
}
|
|
1139
|
+
else {
|
|
1140
|
+
return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
|
|
1141
|
+
}
|
|
1129
1142
|
};
|
|
1130
1143
|
/**
|
|
1131
1144
|
* Get task left value
|
|
@@ -1337,7 +1350,10 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1337
1350
|
if (!isNullOrUndefined(value)) {
|
|
1338
1351
|
value = new Date(tempDate.getTime());
|
|
1339
1352
|
}
|
|
1340
|
-
this.parent.
|
|
1353
|
+
if (!this.parent.isLoad && !this.parent.isDynamicData) {
|
|
1354
|
+
this.parent.setRecordValue('taskData.' + mapping, value, task);
|
|
1355
|
+
}
|
|
1356
|
+
this.parent.isDynamicData = false;
|
|
1341
1357
|
};
|
|
1342
1358
|
TaskProcessor.prototype.getDurationInDay = function (duration, durationUnit) {
|
|
1343
1359
|
if (durationUnit === 'day') {
|
|
@@ -2160,7 +2176,13 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2160
2176
|
continue;
|
|
2161
2177
|
}
|
|
2162
2178
|
var startDate = this.getValidStartDate(childData.ganttProperties);
|
|
2179
|
+
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
|
|
2180
|
+
startDate = childData.ganttProperties.autoStartDate;
|
|
2181
|
+
}
|
|
2163
2182
|
var endDate = this.getValidEndDate(childData.ganttProperties);
|
|
2183
|
+
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
|
|
2184
|
+
endDate = childData.ganttProperties.autoEndDate;
|
|
2185
|
+
}
|
|
2164
2186
|
if (isNullOrUndefined(minStartDate)) {
|
|
2165
2187
|
minStartDate = this.getDateFromFormat(startDate);
|
|
2166
2188
|
}
|
|
@@ -297,6 +297,9 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
297
297
|
if (getValue('requestType', args) === 'refresh' && isNullOrUndefined(getValue('type', args)) && this.parent.addDeleteRecord) {
|
|
298
298
|
if (this.parent.selectedRowIndex != -1) {
|
|
299
299
|
this.parent.selectRow(this.parent.selectedRowIndex);
|
|
300
|
+
if (this.parent.selectedRowIndex > this.parent.currentViewData.length - 1) {
|
|
301
|
+
this.parent.selectedRowIndex = -1;
|
|
302
|
+
}
|
|
300
303
|
}
|
|
301
304
|
else {
|
|
302
305
|
this.parent.selectRow(0);
|
|
@@ -1204,6 +1204,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
|
+
this.parent.renderTemplates();
|
|
1207
1208
|
this.triggerQueryTaskbarInfo();
|
|
1208
1209
|
this.parent.modifiedRecords = [];
|
|
1209
1210
|
if (collapsedResourceRecord.length) {
|
|
@@ -1568,6 +1569,7 @@ var ChartRows = /** @class */ (function (_super) {
|
|
|
1568
1569
|
else {
|
|
1569
1570
|
tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
|
|
1570
1571
|
}
|
|
1572
|
+
this.parent.renderTemplates();
|
|
1571
1573
|
if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation) {
|
|
1572
1574
|
if (isValidateRange) {
|
|
1573
1575
|
this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
|
|
@@ -817,9 +817,6 @@ var Timeline = /** @class */ (function () {
|
|
|
817
817
|
parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell);
|
|
818
818
|
scheduleDateCollection.push(new Date(startDate.toString()));
|
|
819
819
|
increment = this.getIncrement(startDate, count, mode);
|
|
820
|
-
if (this.parent.isInDst(startDate)) {
|
|
821
|
-
increment = increment + (1000 * 60 * 60);
|
|
822
|
-
}
|
|
823
820
|
newTime = startDate.getTime() + increment;
|
|
824
821
|
startDate.setTime(newTime);
|
|
825
822
|
if (startDate >= endDate) {
|
|
@@ -883,24 +880,17 @@ var Timeline = /** @class */ (function () {
|
|
|
883
880
|
dayIntervel - 1 : dayIntervel : dayIntervel;
|
|
884
881
|
lastDay.setDate(lastDay.getDate() + (dayIntervel + (7 * count)));
|
|
885
882
|
increment = lastDay.getTime() - firstDay.getTime();
|
|
886
|
-
if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
|
|
887
|
-
(!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
|
|
888
|
-
increment = increment - (1000 * 60 * 60);
|
|
889
|
-
}
|
|
890
883
|
break;
|
|
891
884
|
}
|
|
892
885
|
case 'Day':
|
|
893
886
|
lastDay.setHours(24, 0, 0, 0);
|
|
894
887
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
|
|
895
|
-
if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
|
|
896
|
-
(!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
|
|
897
|
-
increment -= (1000 * 60 * 60);
|
|
898
|
-
}
|
|
899
888
|
break;
|
|
900
889
|
case 'Hour':
|
|
901
890
|
lastDay.setMinutes(60);
|
|
902
891
|
lastDay.setSeconds(0);
|
|
903
892
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
|
|
893
|
+
increment = this.checkDate(firstDay, lastDay, increment, count);
|
|
904
894
|
break;
|
|
905
895
|
case 'Minutes':
|
|
906
896
|
lastDay.setSeconds(60);
|
|
@@ -909,6 +899,21 @@ var Timeline = /** @class */ (function () {
|
|
|
909
899
|
}
|
|
910
900
|
return increment;
|
|
911
901
|
};
|
|
902
|
+
Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count) {
|
|
903
|
+
var date = new Date(firstDay.getTime());
|
|
904
|
+
date.setTime(date.getTime() + increment);
|
|
905
|
+
if (((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
|
|
906
|
+
var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
|
|
907
|
+
if (!this.parent.isInDst(date)) {
|
|
908
|
+
increment += (1000 * 60 * 60 * diffCount);
|
|
909
|
+
}
|
|
910
|
+
else if (this.parent.isInDst(date)) {
|
|
911
|
+
increment -= (1000 * 60 * 60 * diffCount);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
return increment;
|
|
915
|
+
};
|
|
916
|
+
;
|
|
912
917
|
/**
|
|
913
918
|
* Method to find header cell was weekend or not
|
|
914
919
|
*
|
|
@@ -991,10 +996,6 @@ var Timeline = /** @class */ (function () {
|
|
|
991
996
|
*/
|
|
992
997
|
Timeline.prototype.calculateWidthBetweenTwoDate = function (mode, scheduleWeeks, endDate) {
|
|
993
998
|
var timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
|
|
994
|
-
if ((this.parent.isInDst(scheduleWeeks) && !this.parent.isInDst(endDate)) ||
|
|
995
|
-
(!this.parent.isInDst(scheduleWeeks) && this.parent.isInDst(endDate))) {
|
|
996
|
-
timeDifference = timeDifference - (1000 * 60 * 60);
|
|
997
|
-
}
|
|
998
999
|
var balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
|
|
999
1000
|
return balanceDay * this.parent.perDayWidth;
|
|
1000
1001
|
};
|