@syncfusion/ej2-gantt 22.1.36 → 22.1.38

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 22.1.36
3
+ * version : 22.1.38
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@21.1.36",
3
+ "_id": "@syncfusion/ej2-gantt@22.1.37",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-tDyjXzp2Ee+tpcZOq1yfm3Bvfzm9wNegYHa5DjMIylljMQbbDOc2vWstdSvDAkCPcnAlVlIpczkl5+q5mSglsA==",
5
+ "_integrity": "sha512-TPv0yQVVQ7urz0QkQgQRYrexjSghhirdKW9uclu5RPOsByATIf6kwgskqNxLI3rgUg9r7DuT5U73Exa/RxkwBA==",
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-21.1.36.tgz",
27
- "_shasum": "41c1dff00c5d26c0c8c9553da0e920a32aad398c",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-22.1.37.tgz",
27
+ "_shasum": "86f0da8b12060d757e0b729750fdbd8e7d1cbb08",
28
28
  "_spec": "@syncfusion/ej2-gantt@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
30
30
  "author": {
@@ -35,21 +35,21 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~22.1.34",
39
- "@syncfusion/ej2-buttons": "~21.1.36",
40
- "@syncfusion/ej2-calendars": "~22.1.36",
41
- "@syncfusion/ej2-data": "~22.1.36",
42
- "@syncfusion/ej2-dropdowns": "~22.1.36",
43
- "@syncfusion/ej2-grids": "~22.1.36",
44
- "@syncfusion/ej2-inputs": "~22.1.34",
45
- "@syncfusion/ej2-layouts": "~22.1.36",
38
+ "@syncfusion/ej2-base": "~22.1.38",
39
+ "@syncfusion/ej2-buttons": "~22.1.38",
40
+ "@syncfusion/ej2-calendars": "~22.1.38",
41
+ "@syncfusion/ej2-data": "~22.1.38",
42
+ "@syncfusion/ej2-dropdowns": "~22.1.38",
43
+ "@syncfusion/ej2-grids": "~22.1.38",
44
+ "@syncfusion/ej2-inputs": "~22.1.38",
45
+ "@syncfusion/ej2-layouts": "~22.1.37",
46
46
  "@syncfusion/ej2-lists": "~22.1.34",
47
- "@syncfusion/ej2-navigations": "~22.1.36",
47
+ "@syncfusion/ej2-navigations": "~22.1.38",
48
48
  "@syncfusion/ej2-notifications": "~22.1.34",
49
- "@syncfusion/ej2-popups": "~22.1.36",
50
- "@syncfusion/ej2-richtexteditor": "~22.1.36",
49
+ "@syncfusion/ej2-popups": "~22.1.38",
50
+ "@syncfusion/ej2-richtexteditor": "~22.1.38",
51
51
  "@syncfusion/ej2-svg-base": "~22.1.34",
52
- "@syncfusion/ej2-treegrid": "~22.1.36"
52
+ "@syncfusion/ej2-treegrid": "~22.1.38"
53
53
  },
54
54
  "deprecated": false,
55
55
  "description": "Essential JS 2 Gantt Component",
@@ -74,6 +74,6 @@
74
74
  "url": "git+https://github.com/syncfusion/ej2-gantt.git"
75
75
  },
76
76
  "typings": "index.d.ts",
77
- "version": "22.1.36",
77
+ "version": "22.1.38",
78
78
  "sideEffects": false
79
79
  }
@@ -101,65 +101,79 @@ var ContextMenu = /** @class */ (function () {
101
101
  }
102
102
  switch (this.item) {
103
103
  case 'TaskInformation':
104
- if (isNaN(Number(this.rowData.ganttProperties.rowUniqueID))) {
105
- this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID);
106
- }
107
- else {
108
- this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
104
+ if (!isNullOrUndefined(this.rowData)) {
105
+ if (isNaN(Number(this.rowData.ganttProperties.rowUniqueID))) {
106
+ this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID);
107
+ }
108
+ else {
109
+ this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
110
+ }
109
111
  }
110
112
  break;
111
113
  case 'Above':
112
114
  case 'Below':
113
115
  case 'Child':
114
- position = this.item;
115
- data = extend({}, {}, this.rowData.taskData, true);
116
- taskfields = this.parent.taskFields;
117
- if (data[taskfields.startDate]) {
118
- this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
119
- }
120
- if (data[taskfields.endDate]) {
121
- this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
122
- }
123
- if (!isNullOrUndefined(taskfields.dependency)) {
124
- data[taskfields.dependency] = null;
125
- }
126
- if (!isNullOrUndefined(taskfields.child) && data[taskfields.child]) {
127
- delete data[taskfields.child];
128
- }
129
- if (!isNullOrUndefined(taskfields.parentID) && data[taskfields.parentID]) {
130
- data[taskfields.parentID] = null;
116
+ if (!isNullOrUndefined(this.rowData)) {
117
+ position = this.item;
118
+ data = extend({}, {}, this.rowData.taskData, true);
119
+ taskfields = this.parent.taskFields;
120
+ if (data[taskfields.startDate]) {
121
+ this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
122
+ }
123
+ if (data[taskfields.endDate]) {
124
+ this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
125
+ }
126
+ if (!isNullOrUndefined(taskfields.dependency)) {
127
+ data[taskfields.dependency] = null;
128
+ }
129
+ if (!isNullOrUndefined(taskfields.child) && data[taskfields.child]) {
130
+ delete data[taskfields.child];
131
+ }
132
+ if (!isNullOrUndefined(taskfields.parentID) && data[taskfields.parentID]) {
133
+ data[taskfields.parentID] = null;
134
+ }
135
+ if (this.rowData) {
136
+ var rowIndex = this.parent.updatedRecords.indexOf(this.rowData);
137
+ this.parent.addRecord(data, position, rowIndex);
138
+ }
131
139
  }
132
- if (this.rowData) {
133
- var rowIndex = this.parent.updatedRecords.indexOf(this.rowData);
134
- this.parent.addRecord(data, position, rowIndex);
140
+ else if (this.parent.flatData.length === 0) {
141
+ this.parent.addRecord();
135
142
  }
136
143
  break;
137
144
  case 'Milestone':
138
145
  case 'ToMilestone':
139
- this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);
146
+ if (!isNullOrUndefined(this.rowData)) {
147
+ this.parent.convertToMilestone(this.rowData.ganttProperties.rowUniqueID);
148
+ }
149
+ else if (this.parent.flatData.length === 0) {
150
+ this.parent.addRecord();
151
+ }
140
152
  break;
141
153
  case 'DeleteTask':
142
154
  this.parent.editModule.deleteRecord(this.rowData);
143
155
  break;
144
156
  case 'ToTask':
145
- data = extend({}, {}, this.rowData.taskData, true);
146
- taskfields = this.parent.taskFields;
147
- if (!isNullOrUndefined(taskfields.duration)) {
148
- var ganttProp = this.rowData.ganttProperties;
149
- data[taskfields.duration] = '1 ' + ganttProp.durationUnit;
150
- }
151
- else {
152
- data[taskfields.startDate] = new Date(this.rowData.taskData[taskfields.startDate]);
153
- var endDate = new Date(this.rowData.taskData[taskfields.startDate]);
154
- endDate.setDate(endDate.getDate() + 1);
155
- data[taskfields.endDate] = endDate;
156
- }
157
- if (!isNullOrUndefined(data[taskfields.milestone])) {
158
- if (data[taskfields.milestone] === true) {
159
- data[taskfields.milestone] = false;
157
+ if (!isNullOrUndefined(this.rowData)) {
158
+ data = extend({}, {}, this.rowData.taskData, true);
159
+ taskfields = this.parent.taskFields;
160
+ if (!isNullOrUndefined(taskfields.duration)) {
161
+ var ganttProp = this.rowData.ganttProperties;
162
+ data[taskfields.duration] = '1 ' + ganttProp.durationUnit;
163
+ }
164
+ else {
165
+ data[taskfields.startDate] = new Date(this.rowData.taskData[taskfields.startDate]);
166
+ var endDate = new Date(this.rowData.taskData[taskfields.startDate]);
167
+ endDate.setDate(endDate.getDate() + 1);
168
+ data[taskfields.endDate] = endDate;
160
169
  }
170
+ if (!isNullOrUndefined(data[taskfields.milestone])) {
171
+ if (data[taskfields.milestone] === true) {
172
+ data[taskfields.milestone] = false;
173
+ }
174
+ }
175
+ this.parent.updateRecordByID(data);
161
176
  }
162
- this.parent.updateRecordByID(data);
163
177
  break;
164
178
  case 'Cancel':
165
179
  this.parent.cancelEdit();
@@ -315,7 +329,7 @@ var ContextMenu = /** @class */ (function () {
315
329
  this.contextMenu.enableItems(['Add', 'Save', 'Convert', 'Delete Dependency', 'Delete Task', 'TaskMode', 'Indent', 'Outdent', 'SplitTask', 'MergeTask'], false);
316
330
  }
317
331
  if ((isNullOrUndefined(args.gridRow) && isNullOrUndefined(args.chartRow)) || this.contentMenuItems.length === 0) {
318
- if (!isNullOrUndefined(args.parentItem) && !isNullOrUndefined(menuElement)) {
332
+ if (!isNullOrUndefined(args.parentItem) && !isNullOrUndefined(menuElement) || !isNullOrUndefined(closest(target, '.e-content'))) {
319
333
  args.cancel = false;
320
334
  }
321
335
  else {
@@ -355,7 +369,7 @@ var ContextMenu = /** @class */ (function () {
355
369
  args.disableItems = this.disableItems;
356
370
  args.hideItems = this.hideItems;
357
371
  args.hideChildItems = [];
358
- if (args.rowData.level === 0 && this.parent.viewType === 'ResourceView') {
372
+ if (!isNullOrUndefined(args.rowData) && args.rowData.level === 0 && this.parent.viewType === 'ResourceView') {
359
373
  args.cancel = true;
360
374
  return;
361
375
  }
@@ -397,6 +411,9 @@ var ContextMenu = /** @class */ (function () {
397
411
  if (!this.parent.editSettings.allowEditing || !this.parent.editModule) {
398
412
  this.updateItemVisibility(item.text);
399
413
  }
414
+ if (this.parent.flatData.length === 0) {
415
+ this.hideItems.push(item.text);
416
+ }
400
417
  break;
401
418
  case 'Add':
402
419
  if (!this.parent.editSettings.allowAdding || !this.parent.editModule) {
@@ -408,14 +425,14 @@ var ContextMenu = /** @class */ (function () {
408
425
  this.hideItems.push(item.text);
409
426
  break;
410
427
  case 'Convert':
411
- if (this.rowData.hasChildRecords) {
428
+ if (!isNullOrUndefined(this.rowData) && this.rowData.hasChildRecords) {
412
429
  this.hideItems.push(item.text);
413
430
  }
414
431
  else if (!this.parent.editSettings.allowEditing || !this.parent.editModule) {
415
432
  this.updateItemVisibility(item.text);
416
433
  }
417
434
  else {
418
- if (!this.rowData.ganttProperties.isMilestone) {
435
+ if (!isNullOrUndefined(this.rowData) && !this.rowData.ganttProperties.isMilestone) {
419
436
  subMenu.push(this.createItemModel(cons.content, 'ToMilestone', this.getLocale('toMilestone')));
420
437
  }
421
438
  else {
@@ -423,11 +440,14 @@ var ContextMenu = /** @class */ (function () {
423
440
  }
424
441
  item.items = subMenu;
425
442
  }
443
+ if (this.parent.flatData.length === 0) {
444
+ this.hideItems.push(item.text);
445
+ }
426
446
  break;
427
447
  case 'DeleteDependency':
428
448
  {
429
449
  var items = this.getPredecessorsItems();
430
- if (this.rowData.hasChildRecords) {
450
+ if (!isNullOrUndefined(this.rowData) && this.rowData.hasChildRecords) {
431
451
  this.hideItems.push(item.text);
432
452
  }
433
453
  else if (!this.parent.editSettings.allowDeleting || items.length === 0 || !this.parent.editModule) {
@@ -442,6 +462,9 @@ var ContextMenu = /** @class */ (function () {
442
462
  if (!this.parent.editSettings.allowDeleting || !this.parent.editModule) {
443
463
  this.updateItemVisibility(item.text);
444
464
  }
465
+ if (this.parent.flatData.length === 0) {
466
+ this.hideItems.push(item.text);
467
+ }
445
468
  break;
446
469
  case 'TaskMode':
447
470
  if (this.parent.taskMode !== 'Custom') {
@@ -330,6 +330,9 @@ var Dependency = /** @class */ (function () {
330
330
  ganttRecord = predecessorsCollection[count];
331
331
  if ((!ganttRecord.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
332
332
  this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
333
+ if (!ganttRecord.ganttProperties.isAutoSchedule) {
334
+ this.parent.connectorLineEditModule['calculateOffset'](ganttRecord);
335
+ }
333
336
  }
334
337
  }
335
338
  };
@@ -760,6 +763,9 @@ var Dependency = /** @class */ (function () {
760
763
  if (validationOn !== 'predecessor' && this.parent.isValidationEnabled) {
761
764
  this.validateChildGanttRecord(parentGanttRecord, record);
762
765
  }
766
+ else if (!record.ganttProperties.isAutoSchedule && this.parent.UpdateOffsetOnTaskbarEdit) {
767
+ this.parent.connectorLineEditModule['calculateOffset'](record);
768
+ }
763
769
  if (parentGanttRecord.expanded === false || record.expanded === false) {
764
770
  if (record) {
765
771
  this.validatePredecessor(record, undefined, 'successor');
@@ -1749,6 +1749,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
1749
1749
  }
1750
1750
  }
1751
1751
  }
1752
+ this.parent['isProjectDateUpdated'] = false;
1752
1753
  };
1753
1754
  /**
1754
1755
  * To cancel the taskbar edt action.
@@ -1270,8 +1270,16 @@ var DateProcessor = /** @class */ (function () {
1270
1270
  viewData.forEach(function (data) {
1271
1271
  taskRange = [];
1272
1272
  var task = data.ganttProperties;
1273
- var tempStartDate = _this.getValidStartDate(task);
1274
- var tempEndDate = _this.getValidEndDate(task);
1273
+ var tempStartDate;
1274
+ var tempEndDate;
1275
+ if (isNullOrUndefined(task.startDate) && isNullOrUndefined(task.endDate)) {
1276
+ tempStartDate = null;
1277
+ tempEndDate = null;
1278
+ }
1279
+ else {
1280
+ tempStartDate = _this.getValidStartDate(task);
1281
+ tempEndDate = _this.getValidEndDate(task);
1282
+ }
1275
1283
  addDateToList(minStartDate);
1276
1284
  addDateToList(maxEndDate);
1277
1285
  addDateToList(tempStartDate);
@@ -1331,6 +1339,7 @@ var DateProcessor = /** @class */ (function () {
1331
1339
  setValue('minStartDate', minStartDate, editArgs);
1332
1340
  setValue('maxEndDate', maxEndDate, editArgs);
1333
1341
  }
1342
+ this.parent['isProjectDateUpdated'] = true;
1334
1343
  };
1335
1344
  /**
1336
1345
  *
@@ -762,7 +762,6 @@ var GanttChart = /** @class */ (function () {
762
762
  this.updateWidthAndHeight();
763
763
  this.reRenderConnectorLines();
764
764
  getValue('chartRow', args).setAttribute('aria-expanded', 'false');
765
- this.parent.trigger('collapsed', args);
766
765
  };
767
766
  /**
768
767
  * To expand gantt rows
@@ -817,7 +816,6 @@ var GanttChart = /** @class */ (function () {
817
816
  this.updateWidthAndHeight();
818
817
  this.reRenderConnectorLines();
819
818
  getValue('chartRow', args).setAttribute('aria-expanded', 'true');
820
- this.parent.trigger('expanded', args);
821
819
  };
822
820
  GanttChart.prototype.renderMultiTaskbar = function (record) {
823
821
  if (this.parent.enableMultiTaskbar) {
@@ -861,20 +859,27 @@ var GanttChart = /** @class */ (function () {
861
859
  removeClass([targetElement[t]], 'e-row-expand');
862
860
  }
863
861
  }
864
- var childRecords = record.childRecords;
865
- var chartRows = this.getChartRows();
866
- var rows = [];
867
- for (var i = 0; i < chartRows.length; i++) {
868
- if (chartRows[i].classList.contains('gridrowtaskId'
869
- + record.ganttProperties.rowUniqueID + 'level' + (record.level + 1))) {
870
- rows.push(chartRows[i]);
862
+ if (!this.parent.enableVirtualization) {
863
+ var childRecords = record.childRecords;
864
+ var chartRows = this.getChartRows();
865
+ var rows = [];
866
+ for (var i = 0; i < chartRows.length; i++) {
867
+ if (chartRows[i].classList.contains("gridrowtaskId" +
868
+ record.ganttProperties.rowUniqueID +
869
+ "level" +
870
+ (record.level + 1))) {
871
+ rows.push(chartRows[i]);
872
+ }
871
873
  }
872
- }
873
- for (var i = 0; i < rows.length; i++) {
874
- rows[i].style.display = displayType;
875
- if ((childRecords[i].childRecords && childRecords[i].childRecords.length)
876
- && (action === 'collapse' || childRecords[i].expanded || this.isExpandAll)) {
877
- this.expandCollapseChartRows(action, rows[i], childRecords[i], true);
874
+ for (var i = 0; i < rows.length; i++) {
875
+ rows[i].style.display = displayType;
876
+ if (childRecords[i].childRecords &&
877
+ childRecords[i].childRecords.length &&
878
+ (action === "collapse" ||
879
+ childRecords[i].expanded ||
880
+ this.isExpandAll)) {
881
+ this.expandCollapseChartRows(action, rows[i], childRecords[i], true);
882
+ }
878
883
  }
879
884
  }
880
885
  };
@@ -86,6 +86,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
86
86
  /** @hidden */
87
87
  private headerMaskTable;
88
88
  /** @hidden */
89
+ private isProjectDateUpdated;
89
90
  columnLoop: any;
90
91
  showIndicator: boolean;
91
92
  singleTier: number;
@@ -548,7 +548,7 @@ var TaskProcessor = /** @class */ (function (_super) {
548
548
  endDate = this.getEndDate(startDate, duration, data.ganttProperties.durationUnit, data.ganttProperties, false);
549
549
  }
550
550
  else if (!taskSettings.duration && taskSettings.endDate) {
551
- endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() >
551
+ endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() <
552
552
  data.ganttProperties.endDate.getTime() && i !== segments.length - 1 ? endDate : data.ganttProperties.endDate;
553
553
  duration = this.getDuration(startDate, endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
554
554
  if (ganttSegments.length > 0 && endDate.getTime() < startDate.getTime()
@@ -1192,38 +1192,59 @@ var TaskProcessor = /** @class */ (function (_super) {
1192
1192
  modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 1000);
1193
1193
  }
1194
1194
  if (ganttData && ganttData.durationUnit == 'minute') {
1195
- modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 60 * 60 * 1000);
1195
+ modifiedsDate = new Date(modifiedsDate.getTime() + ganttData.duration * 60 * 1000);
1196
1196
  }
1197
1197
  for (var i = 0; i < this.parent.dayWorkingTime.length; i++) {
1198
1198
  hour = hour + this.parent.dayWorkingTime[i].to - this.parent.dayWorkingTime[i].from;
1199
1199
  }
1200
1200
  var dateDiff = modifiedsDate.getTime() - sDate.getTime();
1201
- if (tierMode === 'Day') {
1202
- if ((Math.floor((dateDiff / (1000 * 60 * 60)) % 24) >= hour || dateDiff === 0)) {
1203
- isValid = true;
1201
+ if (ganttData && ganttData.durationUnit == 'minute' && ganttData.duration < (hour * 60)) {
1202
+ if (tierMode === 'Day') {
1203
+ if ((Math.floor((dateDiff / (1000 * 60 * 60)) % 24) >= hour || dateDiff === 0)) {
1204
+ isValid = true;
1205
+ }
1206
+ if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime && isValid) {
1207
+ sDate.setHours(0, 0, 0, 0);
1208
+ }
1209
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
1210
+ eDate.setHours(24);
1211
+ }
1212
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
1213
+ eDate.setHours(0, 0, 0, 0);
1214
+ }
1204
1215
  }
1205
- if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime && isValid) {
1206
- sDate.setHours(0, 0, 0, 0);
1216
+ else {
1217
+ isValid = true;
1207
1218
  }
1208
- if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
1209
- eDate.setHours(24);
1219
+ if ((sDate).getTime() === (eDate).getTime()) {
1220
+ return (this.parent.perDayWidth);
1210
1221
  }
1211
- if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
1212
- eDate.setHours(0, 0, 0, 0);
1222
+ else {
1223
+ if (isValid) {
1224
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
1225
+ }
1226
+ else {
1227
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
1228
+ }
1213
1229
  }
1214
1230
  }
1215
1231
  else {
1216
- isValid = true;
1217
- }
1218
- if ((sDate).getTime() === (eDate).getTime()) {
1219
- return (this.parent.perDayWidth);
1220
- }
1221
- else {
1222
- if (isValid) {
1223
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
1232
+ if (tierMode === 'Day') {
1233
+ if (this.getSecondsInDecimal(sDate) === this.parent.defaultStartTime) {
1234
+ sDate.setHours(0, 0, 0, 0);
1235
+ }
1236
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultEndTime) {
1237
+ eDate.setHours(24);
1238
+ }
1239
+ if (this.getSecondsInDecimal(eDate) === this.parent.defaultStartTime) {
1240
+ eDate.setHours(0, 0, 0, 0);
1241
+ }
1242
+ }
1243
+ if ((sDate).getTime() === (eDate).getTime()) {
1244
+ return (this.parent.perDayWidth);
1224
1245
  }
1225
1246
  else {
1226
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
1247
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
1227
1248
  }
1228
1249
  }
1229
1250
  };
@@ -241,25 +241,60 @@ var GanttTreeGrid = /** @class */ (function () {
241
241
  GanttTreeGrid.prototype.collapsing = function (args) {
242
242
  // Collapsing event
243
243
  var callBackPromise = new Deferred();
244
+ var collapsingArgs;
245
+ var record = getValue('data', args);
246
+ var recordLength = record.length;
244
247
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart) {
245
- var collapsingArgs = this.createExpandCollapseArgs(args);
246
- this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
247
- setValue('cancel', getValue('cancel', collapsingArgs), args);
248
+ if (!isNullOrUndefined(recordLength)) {
249
+ for (var i = 0; i < recordLength; i++) {
250
+ collapsingArgs = this.createExpandCollapseArgs(args, record[i]);
251
+ this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
252
+ }
253
+ setValue('cancel', getValue('cancel', collapsingArgs), args);
254
+ }
255
+ else {
256
+ collapsingArgs = this.createExpandCollapseArgs(args, null);
257
+ this.parent.ganttChartModule.collapseGanttRow(collapsingArgs);
258
+ setValue('cancel', getValue('cancel', collapsingArgs), args);
259
+ }
248
260
  }
249
261
  };
250
262
  GanttTreeGrid.prototype.expanding = function (args) {
251
263
  // Expanding event
252
264
  var callBackPromise = new Deferred();
265
+ var expandingArgs;
266
+ var record = getValue('data', args);
267
+ var recordLength = record.length;
253
268
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart) {
254
- var expandingArgs = this.createExpandCollapseArgs(args);
255
- this.parent.ganttChartModule.expandGanttRow(expandingArgs);
256
- setValue('cancel', getValue('cancel', expandingArgs), args);
269
+ if (!isNullOrUndefined(recordLength)) {
270
+ for (var i = 0; i < recordLength; i++) {
271
+ expandingArgs = this.createExpandCollapseArgs(args, record[i]);
272
+ this.parent.ganttChartModule.expandGanttRow(expandingArgs);
273
+ }
274
+ setValue('cancel', getValue('cancel', expandingArgs), args);
275
+ }
276
+ else {
277
+ expandingArgs = this.createExpandCollapseArgs(args, null);
278
+ this.parent.ganttChartModule.expandGanttRow(expandingArgs);
279
+ setValue('cancel', getValue('cancel', expandingArgs), args);
280
+ }
257
281
  }
258
282
  };
259
283
  GanttTreeGrid.prototype.collapsed = function (args) {
260
284
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
261
- var collapsedArgs = this.createExpandCollapseArgs(args);
262
- this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
285
+ var collapsedArgs = void 0;
286
+ var record = getValue('data', args);
287
+ var recordLength = record.length;
288
+ if (!isNullOrUndefined(recordLength)) {
289
+ for (var i = 0; i < recordLength; i++) {
290
+ collapsedArgs = this.createExpandCollapseArgs(args, record[i]);
291
+ this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
292
+ }
293
+ }
294
+ else {
295
+ collapsedArgs = this.createExpandCollapseArgs(args, null);
296
+ this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
297
+ }
263
298
  if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
264
299
  collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
265
300
  this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
@@ -273,19 +308,29 @@ var GanttTreeGrid = /** @class */ (function () {
273
308
  else {
274
309
  this.parent.hideSpinner();
275
310
  }
311
+ this.parent.trigger('collapsed', args);
276
312
  };
277
313
  GanttTreeGrid.prototype.expanded = function (args) {
278
314
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
279
- if (!args['data'].length) {
280
- var expandedArgs = this.createExpandCollapseArgs(args);
281
- this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
282
- if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
283
- args['row'].style.height = this.parent.rowHeight + 'px';
284
- this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
285
- this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
286
- document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
315
+ var expandedArgs = void 0;
316
+ var record = getValue('data', args);
317
+ var recordLength = record.length;
318
+ if (!isNullOrUndefined(recordLength)) {
319
+ for (var i = 0; i < recordLength; i++) {
320
+ expandedArgs = this.createExpandCollapseArgs(args, record[i]);
321
+ this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
287
322
  }
288
323
  }
324
+ else {
325
+ expandedArgs = this.createExpandCollapseArgs(args, null);
326
+ this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
327
+ }
328
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
329
+ args['row'].style.height = this.parent.rowHeight + 'px';
330
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
331
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
332
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
333
+ }
289
334
  }
290
335
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
291
336
  this.parent.hideMaskRow();
@@ -293,6 +338,7 @@ var GanttTreeGrid = /** @class */ (function () {
293
338
  else {
294
339
  this.parent.hideSpinner();
295
340
  }
341
+ this.parent.trigger('expanded', args);
296
342
  };
297
343
  GanttTreeGrid.prototype.actionBegin = function (args) {
298
344
  this.parent.notify('actionBegin', args);
@@ -316,13 +362,23 @@ var GanttTreeGrid = /** @class */ (function () {
316
362
  GanttTreeGrid.prototype.actionFailure = function (args) {
317
363
  this.parent.trigger('actionFailure', args);
318
364
  };
319
- GanttTreeGrid.prototype.createExpandCollapseArgs = function (args) {
320
- var record = getValue('data', args);
321
- var gridRow = getValue('row', args);
365
+ GanttTreeGrid.prototype.createExpandCollapseArgs = function (args, currentRecord) {
322
366
  var chartRow;
323
- chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(record)];
324
- var eventArgs = { data: record, gridRow: gridRow, chartRow: chartRow, cancel: false };
325
- return eventArgs;
367
+ var record = getValue('data', args);
368
+ var recordLength = record.length;
369
+ if (!isNullOrUndefined(recordLength)) {
370
+ var gridRow = getValue('row', args);
371
+ chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(currentRecord)];
372
+ var eventArgs = { data: currentRecord, gridRow: gridRow, chartRow: chartRow, cancel: false };
373
+ return eventArgs;
374
+ }
375
+ else {
376
+ var record_1 = getValue('data', args);
377
+ var gridRow = getValue('row', args);
378
+ chartRow = this.parent.ganttChartModule.getChartRows()[this.parent.currentViewData.indexOf(record_1)];
379
+ var eventArgs = { data: record_1, gridRow: gridRow, chartRow: chartRow, cancel: false };
380
+ return eventArgs;
381
+ }
326
382
  };
327
383
  GanttTreeGrid.prototype.treeActionComplete = function (args) {
328
384
  var updatedArgs = extend({}, args);