@syncfusion/ej2-gantt 20.4.51 → 20.4.52
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 +13 -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 +143 -22
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +141 -20
- 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 +12 -12
- package/src/gantt/actions/dependency.js +1 -1
- package/src/gantt/actions/edit.js +18 -5
- package/src/gantt/actions/taskbar-edit.d.ts +1 -1
- package/src/gantt/actions/taskbar-edit.js +18 -2
- package/src/gantt/base/date-processor.d.ts +1 -1
- package/src/gantt/base/date-processor.js +23 -2
- package/src/gantt/base/gantt.js +2 -0
- package/src/gantt/base/task-processor.d.ts +2 -0
- package/src/gantt/base/task-processor.js +37 -0
- package/src/gantt/renderer/timeline.js +42 -10
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.52
|
|
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@20.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-gantt@20.4.51",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-MeRVHT0+jrE16XAXCIq90XHt8jCcOhPXqJ7SiE31NEMkf2mPg8+VkaFxcgYxyZ3aUDGikV2mYk1/Vcsuu0zufg==",
|
|
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": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-20.4.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-20.4.51.tgz",
|
|
27
|
+
"_shasum": "adf3c3f231d0673d9a16819bcae9da7625a44a1d",
|
|
28
28
|
"_spec": "@syncfusion/ej2-gantt@*",
|
|
29
29
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@syncfusion/ej2-base": "~20.4.51",
|
|
39
39
|
"@syncfusion/ej2-buttons": "~20.4.50",
|
|
40
|
-
"@syncfusion/ej2-calendars": "~20.4.
|
|
40
|
+
"@syncfusion/ej2-calendars": "~20.4.52",
|
|
41
41
|
"@syncfusion/ej2-data": "~20.4.48",
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~20.4.
|
|
43
|
-
"@syncfusion/ej2-grids": "~20.4.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~20.4.
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~20.4.52",
|
|
43
|
+
"@syncfusion/ej2-grids": "~20.4.52",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~20.4.52",
|
|
45
45
|
"@syncfusion/ej2-layouts": "~20.4.48",
|
|
46
46
|
"@syncfusion/ej2-lists": "~20.4.50",
|
|
47
|
-
"@syncfusion/ej2-navigations": "~20.4.
|
|
47
|
+
"@syncfusion/ej2-navigations": "~20.4.52",
|
|
48
48
|
"@syncfusion/ej2-notifications": "~20.4.48",
|
|
49
|
-
"@syncfusion/ej2-popups": "~20.4.
|
|
50
|
-
"@syncfusion/ej2-richtexteditor": "~20.4.
|
|
49
|
+
"@syncfusion/ej2-popups": "~20.4.52",
|
|
50
|
+
"@syncfusion/ej2-richtexteditor": "~20.4.52",
|
|
51
51
|
"@syncfusion/ej2-treegrid": "~20.4.49"
|
|
52
52
|
},
|
|
53
53
|
"deprecated": false,
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"url": "git+https://github.com/syncfusion/ej2-gantt.git"
|
|
74
74
|
},
|
|
75
75
|
"typings": "index.d.ts",
|
|
76
|
-
"version": "20.4.
|
|
76
|
+
"version": "20.4.52",
|
|
77
77
|
"sideEffects": false
|
|
78
78
|
}
|
|
@@ -576,7 +576,7 @@ var Dependency = /** @class */ (function () {
|
|
|
576
576
|
var offsetValue = predecessor.offset;
|
|
577
577
|
var durationUnit = predecessor.offsetUnit;
|
|
578
578
|
if (offsetValue < 0) {
|
|
579
|
-
resultDate = this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(date, record), (offsetValue * -1), durationUnit, record);
|
|
579
|
+
resultDate = this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(date, record), (offsetValue * -1), durationUnit, record, true);
|
|
580
580
|
}
|
|
581
581
|
else {
|
|
582
582
|
resultDate = this.dateValidateModule.getEndDate(date, offsetValue, durationUnit, record, false);
|
|
@@ -1070,7 +1070,7 @@ var Edit = /** @class */ (function () {
|
|
|
1070
1070
|
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
1071
1071
|
}
|
|
1072
1072
|
for (var i = 0; i < childRecords.length; i++) {
|
|
1073
|
-
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
1073
|
+
if ((!(this.parent.isUnscheduledTask(childRecords[i].ganttProperties))) && (childRecords[i].ganttProperties.isAutoSchedule)) {
|
|
1074
1074
|
if (durationDiff > 0) {
|
|
1075
1075
|
var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
1076
1076
|
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
@@ -1098,6 +1098,7 @@ var Edit = /** @class */ (function () {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
if (childRecords.length) {
|
|
1100
1100
|
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
1101
|
+
this.parent.dataOperation.updateGanttData();
|
|
1101
1102
|
}
|
|
1102
1103
|
};
|
|
1103
1104
|
/**
|
|
@@ -1177,9 +1178,21 @@ var Edit = /** @class */ (function () {
|
|
|
1177
1178
|
});
|
|
1178
1179
|
};
|
|
1179
1180
|
Edit.prototype.dmSuccess = function (e, args) {
|
|
1180
|
-
var eLength
|
|
1181
|
+
var eLength;
|
|
1182
|
+
var rec;
|
|
1183
|
+
if (e.changedRecords) {
|
|
1184
|
+
eLength = e.changedRecords['length'];
|
|
1185
|
+
}
|
|
1186
|
+
else {
|
|
1187
|
+
eLength = e['length'];
|
|
1188
|
+
}
|
|
1181
1189
|
for (var i = 0; i < eLength; i++) {
|
|
1182
|
-
|
|
1190
|
+
if (e.changedRecords) {
|
|
1191
|
+
rec = e.changedRecords[i];
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
rec = e[i];
|
|
1195
|
+
}
|
|
1183
1196
|
var _aLength = Object.keys(rec).length;
|
|
1184
1197
|
for (var j = 0, _a = Object.keys(rec); j < _aLength; j++) {
|
|
1185
1198
|
var key = _a[j];
|
|
@@ -2844,9 +2857,9 @@ var Edit = /** @class */ (function () {
|
|
|
2844
2857
|
var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query_2);
|
|
2845
2858
|
crud.then(function (e) {
|
|
2846
2859
|
if (_this.parent.taskFields.id && !isNullOrUndefined(e.addedRecords[0][_this.parent.taskFields.id]) &&
|
|
2847
|
-
e.addedRecords[0][_this.parent.taskFields.id].toString()
|
|
2860
|
+
e.addedRecords[0][_this.parent.taskFields.id].toString() == prevID_1) {
|
|
2848
2861
|
_this.parent.setRecordValue('taskId', e.addedRecords[0][_this.parent.taskFields.id], args.data.ganttProperties, true);
|
|
2849
|
-
_this.parent.setRecordValue('taskData
|
|
2862
|
+
_this.parent.setRecordValue('taskData', e.addedRecords[0], args.data);
|
|
2850
2863
|
_this.parent.setRecordValue(_this.parent.taskFields.id, e.addedRecords[0][_this.parent.taskFields.id], args.data);
|
|
2851
2864
|
_this.parent.setRecordValue('rowUniqueID', e.addedRecords[0][_this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
|
|
2852
2865
|
var idsIndex = _this.parent.ids.indexOf(prevID_1);
|
|
@@ -223,7 +223,7 @@ export declare class TaskbarEdit extends DateProcessor {
|
|
|
223
223
|
* @returns {Date} .
|
|
224
224
|
* @private
|
|
225
225
|
*/
|
|
226
|
-
getDateByLeft(left: number): Date;
|
|
226
|
+
getDateByLeft(left: number, isMilestone?: boolean, property?: any): Date;
|
|
227
227
|
/**
|
|
228
228
|
* To set item position.
|
|
229
229
|
*
|
|
@@ -594,6 +594,16 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
594
594
|
merge(_this.taskBarEditRecord.ganttProperties, arg.previousData);
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
|
+
this.parent.flatData.map(function (data) {
|
|
598
|
+
if ((!isNullOrUndefined(_this.taskBarEditRecord.parentItem)) && data.ganttProperties.taskId === _this.taskBarEditRecord.parentItem.taskId) {
|
|
599
|
+
data.childRecords.map(function (s) {
|
|
600
|
+
if (isNullOrUndefined(s.ganttProperties.startDate) || isNullOrUndefined(s.ganttProperties.endDate) ||
|
|
601
|
+
isNullOrUndefined(s.ganttProperties.duration)) {
|
|
602
|
+
_this.parent.dataOperation.updateGanttData();
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
});
|
|
597
607
|
}
|
|
598
608
|
};
|
|
599
609
|
/**
|
|
@@ -1147,7 +1157,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1147
1157
|
};
|
|
1148
1158
|
TaskbarEdit.prototype.updateChildDrag = function (item) {
|
|
1149
1159
|
var left = this.getRoundOffStartLeft(item, this.roundOffDuration);
|
|
1150
|
-
var projectStartDate = this.getDateByLeft(left);
|
|
1160
|
+
var projectStartDate = this.getDateByLeft(left, item.isMilestone, item);
|
|
1151
1161
|
var endDate;
|
|
1152
1162
|
if (this.segmentIndex === 0) {
|
|
1153
1163
|
this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, item, null), item, true);
|
|
@@ -1370,10 +1380,16 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1370
1380
|
* @returns {Date} .
|
|
1371
1381
|
* @private
|
|
1372
1382
|
*/
|
|
1373
|
-
TaskbarEdit.prototype.getDateByLeft = function (left) {
|
|
1383
|
+
TaskbarEdit.prototype.getDateByLeft = function (left, isMilestone, property) {
|
|
1374
1384
|
var pStartDate = new Date(this.parent.timelineModule.timelineStartDate.toString());
|
|
1375
1385
|
var milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
|
|
1376
1386
|
pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
|
|
1387
|
+
/* To render the milestone in proper date while editing */
|
|
1388
|
+
if (isMilestone) {
|
|
1389
|
+
pStartDate.setDate(pStartDate.getDate() - 1);
|
|
1390
|
+
this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
|
|
1391
|
+
pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
|
|
1392
|
+
}
|
|
1377
1393
|
var tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.topTier :
|
|
1378
1394
|
this.parent.timelineModule.bottomTier;
|
|
1379
1395
|
if (tierMode !== 'Hour' && tierMode !== 'Minutes') {
|
|
@@ -121,7 +121,7 @@ export declare class DateProcessor {
|
|
|
121
121
|
* @returns {Date} .
|
|
122
122
|
* @private
|
|
123
123
|
*/
|
|
124
|
-
getStartDate(endDate: Date, duration: number, durationUnit: string, ganttProp: ITaskData): Date;
|
|
124
|
+
getStartDate(endDate: Date, duration: number, durationUnit: string, ganttProp: ITaskData, fromValidation?: boolean): Date;
|
|
125
125
|
/**
|
|
126
126
|
* @param {ITaskData} ganttProp .
|
|
127
127
|
* @param {boolean} isLoad .
|
|
@@ -429,7 +429,7 @@ var DateProcessor = /** @class */ (function () {
|
|
|
429
429
|
* @returns {Date} .
|
|
430
430
|
* @private
|
|
431
431
|
*/
|
|
432
|
-
DateProcessor.prototype.getStartDate = function (endDate, duration, durationUnit, ganttProp) {
|
|
432
|
+
DateProcessor.prototype.getStartDate = function (endDate, duration, durationUnit, ganttProp, fromValidation) {
|
|
433
433
|
var tempEnd = new Date(endDate.getTime());
|
|
434
434
|
var startDate = new Date(endDate.getTime());
|
|
435
435
|
var secondDuration = this.getDurationAsSeconds(duration, durationUnit);
|
|
@@ -445,6 +445,12 @@ var DateProcessor = /** @class */ (function () {
|
|
|
445
445
|
}
|
|
446
446
|
tempEnd = new Date(startDate.getTime());
|
|
447
447
|
}
|
|
448
|
+
/* To render the milestone in proper date while loading */
|
|
449
|
+
if (fromValidation && ganttProp.isMilestone) {
|
|
450
|
+
startDate.setDate(startDate.getDate() - 1);
|
|
451
|
+
this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, startDate);
|
|
452
|
+
startDate = this.parent.dateValidationModule.checkStartDate(startDate, ganttProp, true);
|
|
453
|
+
}
|
|
448
454
|
return startDate;
|
|
449
455
|
};
|
|
450
456
|
/**
|
|
@@ -496,6 +502,7 @@ var DateProcessor = /** @class */ (function () {
|
|
|
496
502
|
* @private
|
|
497
503
|
*/
|
|
498
504
|
DateProcessor.prototype.getValidStartDate = function (ganttProp, isAuto) {
|
|
505
|
+
var _this = this;
|
|
499
506
|
var sDate = null;
|
|
500
507
|
var startDate = isAuto ? ganttProp.autoStartDate : ganttProp.startDate;
|
|
501
508
|
var endDate = isAuto ? ganttProp.autoEndDate : ganttProp.endDate;
|
|
@@ -506,7 +513,21 @@ var DateProcessor = /** @class */ (function () {
|
|
|
506
513
|
this.setTime(this.parent.defaultStartTime, sDate);
|
|
507
514
|
}
|
|
508
515
|
else if (!isNullOrUndefined(duration)) {
|
|
509
|
-
|
|
516
|
+
this.parent.flatData.map(function (record) {
|
|
517
|
+
if (record.ganttProperties.taskId == ganttProp.taskId) {
|
|
518
|
+
if ((!isNullOrUndefined(record.parentItem)) && (record.parentItem.taskId)) {
|
|
519
|
+
_this.parent.flatData.map(function (data) {
|
|
520
|
+
if (data.ganttProperties.taskId === record.parentItem.taskId) {
|
|
521
|
+
if (!isNullOrUndefined(data.ganttProperties.startDate))
|
|
522
|
+
sDate = data.ganttProperties.startDate;
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
sDate = _this.getProjectStartDate(ganttProp);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
510
531
|
}
|
|
511
532
|
}
|
|
512
533
|
else {
|
package/src/gantt/base/gantt.js
CHANGED
|
@@ -1401,6 +1401,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
1401
1401
|
case 'dayWorkingTime':
|
|
1402
1402
|
case 'allowUnscheduledTasks':
|
|
1403
1403
|
case 'holidays':
|
|
1404
|
+
this.isLoad = true;
|
|
1404
1405
|
if (prop === 'holidays') {
|
|
1405
1406
|
this.totalHolidayDates = this.dataOperation.getHolidayDates();
|
|
1406
1407
|
this.notify('ui-update', { module: 'day-markers', properties: newProp });
|
|
@@ -1409,6 +1410,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
1409
1410
|
this.treeGrid.refreshColumns();
|
|
1410
1411
|
this.chartRowsModule.initiateTemplates();
|
|
1411
1412
|
this.chartRowsModule.refreshGanttRows();
|
|
1413
|
+
this.isLoad = false;
|
|
1412
1414
|
break;
|
|
1413
1415
|
case 'addDialogFields':
|
|
1414
1416
|
case 'editDialogFields':
|
|
@@ -1420,6 +1420,40 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1420
1420
|
task.taskData[this.parent.taskFields.durationUnit] = task.ganttProperties.durationUnit;
|
|
1421
1421
|
}
|
|
1422
1422
|
};
|
|
1423
|
+
TaskProcessor.prototype.setDataSource = function (data) {
|
|
1424
|
+
var createData = [];
|
|
1425
|
+
var length = data.length;
|
|
1426
|
+
for (var i = 0; i < length; i++) {
|
|
1427
|
+
var record = data[i];
|
|
1428
|
+
createData.push(record);
|
|
1429
|
+
if (!(isNullOrUndefined(data[i][this.parent.taskFields.child]))) {
|
|
1430
|
+
this.setDataSource(data[i][this.parent.taskFields.child]);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
return createData;
|
|
1434
|
+
};
|
|
1435
|
+
TaskProcessor.prototype.setStartDate = function (task) {
|
|
1436
|
+
var _this = this;
|
|
1437
|
+
var hierarchicalData = [];
|
|
1438
|
+
if (!isNullOrUndefined(this.parent.taskFields.parentID) && !isNullOrUndefined(this.parent.taskFields.id)) {
|
|
1439
|
+
hierarchicalData = this.setDataSource(this.parent.dataSource);
|
|
1440
|
+
}
|
|
1441
|
+
else {
|
|
1442
|
+
hierarchicalData = this.parent.dataSource;
|
|
1443
|
+
}
|
|
1444
|
+
this.parent.flatData.map(function (data) {
|
|
1445
|
+
hierarchicalData.map(function (record) {
|
|
1446
|
+
if (data.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
|
|
1447
|
+
if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
|
|
1448
|
+
task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
|
|
1449
|
+
}
|
|
1450
|
+
if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
|
|
1451
|
+
task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
});
|
|
1456
|
+
};
|
|
1423
1457
|
TaskProcessor.prototype.getWorkInHour = function (work, workUnit) {
|
|
1424
1458
|
if (workUnit === 'day') {
|
|
1425
1459
|
return work * (this.parent.secondsPerDay / 3600);
|
|
@@ -1714,6 +1748,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1714
1748
|
if (!isNullOrUndefined(this.parent.taskFields.duration)) {
|
|
1715
1749
|
this.setRecordDuration(ganttData, this.parent.taskFields.duration);
|
|
1716
1750
|
}
|
|
1751
|
+
if (this.parent.isLoad) {
|
|
1752
|
+
this.setStartDate(ganttData);
|
|
1753
|
+
}
|
|
1717
1754
|
this.calculateScheduledValues(ganttData, data, false);
|
|
1718
1755
|
}
|
|
1719
1756
|
this.updateGanttData();
|
|
@@ -156,6 +156,9 @@ var Timeline = /** @class */ (function () {
|
|
|
156
156
|
*/
|
|
157
157
|
Timeline.prototype.changeTimelineSettings = function (newTimeline) {
|
|
158
158
|
var _this = this;
|
|
159
|
+
if (!this.isZoomIn) {
|
|
160
|
+
this.isSingleTier = newTimeline.topTier.unit === 'None' || newTimeline.bottomTier.unit === 'None' ? true : false;
|
|
161
|
+
}
|
|
159
162
|
var skipProperty = this.isSingleTier ?
|
|
160
163
|
this.customTimelineSettings.topTier.unit === 'None' ?
|
|
161
164
|
'topTier' : 'bottomTier' : null;
|
|
@@ -167,7 +170,9 @@ var Timeline = /** @class */ (function () {
|
|
|
167
170
|
else {
|
|
168
171
|
var value = property === 'topTier' ? 'bottomTier' : 'topTier';
|
|
169
172
|
var assignValue = 'bottomTier';
|
|
170
|
-
|
|
173
|
+
if (newTimeline[assignValue].unit != "None") {
|
|
174
|
+
_this.customTimelineSettings[value] = __assign({}, newTimeline[assignValue]);
|
|
175
|
+
}
|
|
171
176
|
}
|
|
172
177
|
});
|
|
173
178
|
this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
|
|
@@ -403,7 +408,9 @@ var Timeline = /** @class */ (function () {
|
|
|
403
408
|
this.customTimelineSettings.bottomTier.count : this.customTimelineSettings.topTier.count;
|
|
404
409
|
var unit = this.customTimelineSettings.bottomTier.unit !== 'None' ?
|
|
405
410
|
this.customTimelineSettings.bottomTier.unit : this.customTimelineSettings.topTier.unit;
|
|
406
|
-
var
|
|
411
|
+
var tier = this.customTimelineSettings.bottomTier.unit !== 'None' ?
|
|
412
|
+
"bottomTier" : "topTier";
|
|
413
|
+
var zoomLevel = this.getCurrentZoomingLevel(unit, count, tier);
|
|
407
414
|
if (this.parent.toolbarModule) {
|
|
408
415
|
if (zoomLevel === this.parent.zoomingLevels[this.parent.zoomingLevels.length - 1].level) {
|
|
409
416
|
this.parent.toolbarModule.enableItems([this.parent.controlId + '_zoomin'], false);
|
|
@@ -421,7 +428,7 @@ var Timeline = /** @class */ (function () {
|
|
|
421
428
|
* @returns {number} .
|
|
422
429
|
* @private
|
|
423
430
|
*/
|
|
424
|
-
Timeline.prototype.getCurrentZoomingLevel = function (unit, count) {
|
|
431
|
+
Timeline.prototype.getCurrentZoomingLevel = function (unit, count, tier) {
|
|
425
432
|
var level;
|
|
426
433
|
var currentZoomCollection;
|
|
427
434
|
var checkSameCountLevels;
|
|
@@ -431,16 +438,31 @@ var Timeline = /** @class */ (function () {
|
|
|
431
438
|
this.parent.zoomingLevels = this.parent.getZoomingLevels();
|
|
432
439
|
}
|
|
433
440
|
var sameUnitLevels = this.parent.zoomingLevels.filter(function (tempLevel) {
|
|
434
|
-
|
|
441
|
+
if (tier === "bottomTier") {
|
|
442
|
+
return tempLevel.bottomTier.unit === unit;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
return tempLevel.topTier.unit === unit;
|
|
446
|
+
}
|
|
435
447
|
});
|
|
436
448
|
if (sameUnitLevels.length === 0) {
|
|
437
449
|
var closestUnit_1 = this.getClosestUnit(unit, '', false);
|
|
438
450
|
sameUnitLevels = this.parent.zoomingLevels.filter(function (tempLevel) {
|
|
439
|
-
|
|
451
|
+
if (tier === "bottomTier") {
|
|
452
|
+
return tempLevel.bottomTier.unit === closestUnit_1;
|
|
453
|
+
}
|
|
454
|
+
else {
|
|
455
|
+
return tempLevel.topTier.unit === closestUnit_1;
|
|
456
|
+
}
|
|
440
457
|
});
|
|
441
458
|
}
|
|
442
459
|
var sortedUnitLevels = sameUnitLevels.sort(function (a, b) {
|
|
443
|
-
|
|
460
|
+
if (tier === "bottomTier") {
|
|
461
|
+
return (a.bottomTier.count < b.bottomTier.count) ? 1 : -1;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
return (a.topTier.count < b.topTier.count) ? 1 : -1;
|
|
465
|
+
}
|
|
444
466
|
});
|
|
445
467
|
for (var i = 0; i < sortedUnitLevels.length; i++) {
|
|
446
468
|
firstValue = sortedUnitLevels[i];
|
|
@@ -451,10 +473,15 @@ var Timeline = /** @class */ (function () {
|
|
|
451
473
|
else {
|
|
452
474
|
secondValue = sortedUnitLevels[i + 1];
|
|
453
475
|
}
|
|
454
|
-
if (count >= firstValue.
|
|
476
|
+
if (count >= firstValue[tier].count) {
|
|
455
477
|
currentZoomCollection = sortedUnitLevels[i];
|
|
456
478
|
checkSameCountLevels = sortedUnitLevels.filter(function (tempLevel) {
|
|
457
|
-
|
|
479
|
+
if (tier === "bottomTier") {
|
|
480
|
+
return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
return tempLevel.topTier.count === currentZoomCollection.topTier.count;
|
|
484
|
+
}
|
|
458
485
|
});
|
|
459
486
|
if (checkSameCountLevels.length > 1) {
|
|
460
487
|
level = this.checkCollectionsWidth(checkSameCountLevels);
|
|
@@ -464,10 +491,15 @@ var Timeline = /** @class */ (function () {
|
|
|
464
491
|
}
|
|
465
492
|
break;
|
|
466
493
|
}
|
|
467
|
-
else if (count < firstValue.
|
|
494
|
+
else if (count < firstValue[tier].count && count > secondValue[tier].count) {
|
|
468
495
|
currentZoomCollection = sortedUnitLevels[i + 1];
|
|
469
496
|
checkSameCountLevels = sortedUnitLevels.filter(function (tempLevel) {
|
|
470
|
-
|
|
497
|
+
if (tier === "bottomTier") {
|
|
498
|
+
return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
return tempLevel.topTier.count === currentZoomCollection.topTier.count;
|
|
502
|
+
}
|
|
471
503
|
});
|
|
472
504
|
if (checkSameCountLevels.length > 1) {
|
|
473
505
|
level = this.checkCollectionsWidth(checkSameCountLevels);
|