@syncfusion/ej2-gantt 20.4.53 → 21.1.35

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-gantt.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js +2 -2
  5. package/dist/ej2-gantt.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es2015.js +1104 -450
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +1084 -430
  9. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  10. package/dist/global/ej2-gantt.min.js +2 -2
  11. package/dist/global/ej2-gantt.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +20 -20
  14. package/src/gantt/actions/cell-edit.js +8 -6
  15. package/src/gantt/actions/chart-scroll.d.ts +1 -0
  16. package/src/gantt/actions/chart-scroll.js +15 -4
  17. package/src/gantt/actions/connector-line-edit.js +39 -28
  18. package/src/gantt/actions/context-menu.js +5 -5
  19. package/src/gantt/actions/critical-path.js +10 -8
  20. package/src/gantt/actions/dependency.js +28 -12
  21. package/src/gantt/actions/dialog-edit.js +41 -21
  22. package/src/gantt/actions/edit.js +56 -55
  23. package/src/gantt/actions/filter.d.ts +2 -1
  24. package/src/gantt/actions/filter.js +88 -2
  25. package/src/gantt/actions/keyboard.js +0 -1
  26. package/src/gantt/actions/pdf-export.d.ts +3 -1
  27. package/src/gantt/actions/pdf-export.js +12 -6
  28. package/src/gantt/actions/rowdragdrop.js +2 -2
  29. package/src/gantt/actions/selection.js +5 -2
  30. package/src/gantt/actions/taskbar-edit.d.ts +5 -0
  31. package/src/gantt/actions/taskbar-edit.js +114 -10
  32. package/src/gantt/base/date-processor.js +78 -52
  33. package/src/gantt/base/gantt-chart.js +20 -4
  34. package/src/gantt/base/gantt-model.d.ts +43 -0
  35. package/src/gantt/base/gantt.d.ts +39 -1
  36. package/src/gantt/base/gantt.js +79 -33
  37. package/src/gantt/base/interface.d.ts +2 -0
  38. package/src/gantt/base/task-processor.js +133 -98
  39. package/src/gantt/base/tree-grid.js +31 -1
  40. package/src/gantt/base/utils.js +1 -1
  41. package/src/gantt/export/export-helper.js +6 -0
  42. package/src/gantt/renderer/chart-rows.d.ts +2 -0
  43. package/src/gantt/renderer/chart-rows.js +156 -24
  44. package/src/gantt/renderer/connector-line.js +50 -20
  45. package/src/gantt/renderer/edit-tooltip.js +0 -3
  46. package/src/gantt/renderer/event-marker.js +4 -1
  47. package/src/gantt/renderer/nonworking-day.js +4 -1
  48. package/src/gantt/renderer/timeline.js +3 -3
  49. package/src/gantt/renderer/tooltip.js +101 -33
  50. package/styles/bootstrap-dark.css +33 -10
  51. package/styles/bootstrap.css +31 -10
  52. package/styles/bootstrap4.css +28 -7
  53. package/styles/bootstrap5-dark.css +30 -9
  54. package/styles/bootstrap5.css +30 -9
  55. package/styles/fabric-dark.css +28 -7
  56. package/styles/fabric.css +28 -7
  57. package/styles/fluent-dark.css +56 -29
  58. package/styles/fluent.css +56 -29
  59. package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
  60. package/styles/gantt/_bootstrap-definition.scss +5 -4
  61. package/styles/gantt/_bootstrap4-definition.scss +3 -2
  62. package/styles/gantt/_bootstrap5-definition.scss +15 -14
  63. package/styles/gantt/_fabric-dark-definition.scss +3 -2
  64. package/styles/gantt/_fabric-definition.scss +3 -2
  65. package/styles/gantt/_fluent-definition.scss +18 -17
  66. package/styles/gantt/_fusionnew-definition.scss +5 -4
  67. package/styles/gantt/_highcontrast-definition.scss +3 -2
  68. package/styles/gantt/_highcontrast-light-definition.scss +3 -2
  69. package/styles/gantt/_layout.scss +45 -13
  70. package/styles/gantt/_material-dark-definition.scss +3 -2
  71. package/styles/gantt/_material-definition.scss +3 -2
  72. package/styles/gantt/_tailwind-definition.scss +9 -8
  73. package/styles/gantt/_theme.scss +25 -6
  74. package/styles/gantt/bootstrap-dark.css +33 -10
  75. package/styles/gantt/bootstrap.css +31 -10
  76. package/styles/gantt/bootstrap4.css +28 -7
  77. package/styles/gantt/bootstrap5-dark.css +30 -9
  78. package/styles/gantt/bootstrap5.css +30 -9
  79. package/styles/gantt/fabric-dark.css +28 -7
  80. package/styles/gantt/fabric.css +28 -7
  81. package/styles/gantt/fluent-dark.css +56 -29
  82. package/styles/gantt/fluent.css +56 -29
  83. package/styles/gantt/highcontrast-light.css +28 -9
  84. package/styles/gantt/highcontrast.css +28 -7
  85. package/styles/gantt/material-dark.css +31 -14
  86. package/styles/gantt/material.css +28 -7
  87. package/styles/gantt/tailwind-dark.css +28 -7
  88. package/styles/gantt/tailwind.css +28 -7
  89. package/styles/highcontrast-light.css +28 -9
  90. package/styles/highcontrast.css +28 -7
  91. package/styles/material-dark.css +31 -14
  92. package/styles/material.css +28 -7
  93. package/styles/tailwind-dark.css +28 -7
  94. package/styles/tailwind.css +28 -7
  95. package/styles/gantt/_material3-definition.scss +0 -218
@@ -404,7 +404,7 @@ var Edit = /** @class */ (function () {
404
404
  for (var _i = 0, _b = Object.keys(data); _i < _b.length; _i++) {
405
405
  var key = _b[_i];
406
406
  if ([tasks.startDate, tasks.endDate, tasks.duration].indexOf(key) !== -1) {
407
- if (isNullOrUndefined(data[key]) && !ganttObj.allowUnscheduledTasks) {
407
+ if (isNullOrUndefined(data["" + key]) && !ganttObj.allowUnscheduledTasks) {
408
408
  continue;
409
409
  }
410
410
  if (isFromDialog) {
@@ -459,7 +459,7 @@ var Edit = /** @class */ (function () {
459
459
  else if (key === tasks.name) {
460
460
  ganttPropKey = 'taskName';
461
461
  }
462
- else if (key === tasks.segments) {
462
+ else if ((key === tasks.segments) && (!isNullOrUndefined(ganttData.ganttProperties.segments))) {
463
463
  ganttPropKey = 'segments';
464
464
  /* eslint-disable-next-line */
465
465
  if (data && !isNullOrUndefined(data[this.parent.taskFields.segments]) && data[this.parent.taskFields.segments].length > 0) {
@@ -827,8 +827,10 @@ var Edit = /** @class */ (function () {
827
827
  */
828
828
  Edit.prototype.updateEditedTask = function (args) {
829
829
  var ganttRecord = args.data;
830
- this.updateParentChildRecord(ganttRecord);
831
- if (this.parent.isConnectorLineUpdate) {
830
+ if (this.parent.autoCalculateDateScheduling) {
831
+ this.updateParentChildRecord(ganttRecord);
832
+ }
833
+ if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
832
834
  /* validating predecessor for updated child items */
833
835
  for (var i = 0; i < this.validatedChildItems.length; i++) {
834
836
  var child = this.validatedChildItems[i];
@@ -839,7 +841,7 @@ var Edit = /** @class */ (function () {
839
841
  }
840
842
  this.parent.predecessorModule.isValidatedParentTaskID = '';
841
843
  /** validating predecessor for current edited records */
842
- if (ganttRecord.ganttProperties.predecessorsName) {
844
+ if (ganttRecord.ganttProperties.predecessor) {
843
845
  this.parent.isMileStoneEdited = ganttRecord.ganttProperties.isMilestone;
844
846
  if (this.taskbarMoved) {
845
847
  this.parent.editedTaskBarItem = ganttRecord;
@@ -847,7 +849,7 @@ var Edit = /** @class */ (function () {
847
849
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
848
850
  this.parent.predecessorModule.isValidatedParentTaskID = '';
849
851
  }
850
- if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
852
+ if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
851
853
  (args.action === "DrawConnectorLine")) {
852
854
  this.updateChildItems(ganttRecord);
853
855
  }
@@ -855,7 +857,9 @@ var Edit = /** @class */ (function () {
855
857
  }
856
858
  /** Update parent up-to zeroth level */
857
859
  if (ganttRecord.parentItem) {
858
- this.parent.dataOperation.updateParentItems(ganttRecord, true);
860
+ if (this.parent.autoCalculateDateScheduling) {
861
+ this.parent.dataOperation.updateParentItems(ganttRecord, true);
862
+ }
859
863
  var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
860
864
  if (!parentData.ganttProperties.predecessorsName) {
861
865
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
@@ -1101,7 +1105,7 @@ var Edit = /** @class */ (function () {
1101
1105
  durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
1102
1106
  }
1103
1107
  for (var i = 0; i < childRecords.length; i++) {
1104
- if ((!(this.parent.isUnscheduledTask(childRecords[i].ganttProperties))) && (childRecords[i].ganttProperties.isAutoSchedule)) {
1108
+ if (childRecords[i].ganttProperties.isAutoSchedule) {
1105
1109
  if (durationDiff > 0) {
1106
1110
  var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
1107
1111
  childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
@@ -1219,52 +1223,52 @@ var Edit = /** @class */ (function () {
1219
1223
  }
1220
1224
  for (var i = 0; i < eLength; i++) {
1221
1225
  if (e.changedRecords) {
1222
- rec = e.changedRecords[i];
1226
+ rec = e.changedRecords[parseInt(i.toString(), 10)];
1223
1227
  }
1224
1228
  else {
1225
- rec = e[i];
1229
+ rec = e[parseInt(i.toString(), 10)];
1226
1230
  }
1227
1231
  var _aLength = Object.keys(rec).length;
1228
1232
  for (var j = 0, _a = Object.keys(rec); j < _aLength; j++) {
1229
- var key = _a[j];
1230
- this.parent.editedRecords[i][key] = rec[key];
1231
- this.parent.editedRecords[i].taskData[key] = rec[key];
1233
+ var key = _a[parseInt(j.toString(), 10)];
1234
+ this.parent.editedRecords[parseInt(i.toString(), 10)]["" + key] = rec["" + key];
1235
+ this.parent.editedRecords[parseInt(i.toString(), 10)].taskData["" + key] = rec["" + key];
1232
1236
  }
1233
1237
  if (this.parent.taskFields.id !== null) {
1234
- this.parent.editedRecords[i].ganttProperties["taskId"] = rec[this.parent.taskFields.id];
1238
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskId'] = rec[this.parent.taskFields.id];
1235
1239
  }
1236
1240
  if (this.parent.taskFields.name !== null) {
1237
- this.parent.editedRecords[i].ganttProperties["taskName"] = rec[this.parent.taskFields.name];
1241
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskName'] = rec[this.parent.taskFields.name];
1238
1242
  }
1239
1243
  if (this.parent.taskFields.startDate !== null) {
1240
- this.parent.editedRecords[i].ganttProperties["startDate"] = rec[this.parent.taskFields.startDate];
1244
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['startDate'] = rec[this.parent.taskFields.startDate];
1241
1245
  }
1242
1246
  if (this.parent.taskFields.endDate !== null) {
1243
- this.parent.editedRecords[i].ganttProperties["endDate"] = rec[this.parent.taskFields.endDate];
1247
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['endDate'] = rec[this.parent.taskFields.endDate];
1244
1248
  }
1245
1249
  if (this.parent.taskFields.duration !== null) {
1246
- this.parent.editedRecords[i].ganttProperties["duration"] = parseInt(rec[this.parent.taskFields.duration]);
1250
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['duration'] = parseInt(rec[this.parent.taskFields.duration]);
1247
1251
  }
1248
1252
  if (this.parent.taskFields.durationUnit !== null) {
1249
- this.parent.editedRecords[i].ganttProperties["durationUnit"] = rec[this.parent.taskFields.durationUnit];
1253
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['durationUnit'] = rec[this.parent.taskFields.durationUnit];
1250
1254
  }
1251
1255
  if (this.parent.taskFields.progress !== null) {
1252
- this.parent.editedRecords[i].ganttProperties["progress"] = rec[this.parent.taskFields.progress];
1256
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['progress'] = rec[this.parent.taskFields.progress];
1253
1257
  }
1254
1258
  if (this.parent.taskFields.dependency !== null) {
1255
- this.parent.editedRecords[i].ganttProperties["dependency"] = rec[this.parent.taskFields.dependency];
1259
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['dependency'] = rec[this.parent.taskFields.dependency];
1256
1260
  }
1257
1261
  if (this.parent.taskFields.parentID !== null) {
1258
- this.parent.editedRecords[i].ganttProperties["parentID"] = rec[this.parent.taskFields.parentID];
1262
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['parentID'] = rec[this.parent.taskFields.parentID];
1259
1263
  }
1260
1264
  if (this.parent.taskFields.baselineEndDate !== null) {
1261
- this.parent.editedRecords[i].ganttProperties["baselineEndDate"] = rec[this.parent.taskFields.baselineEndDate];
1265
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineEndDate'] = rec[this.parent.taskFields.baselineEndDate];
1262
1266
  }
1263
1267
  if (this.parent.taskFields.baselineStartDate !== null) {
1264
- this.parent.editedRecords[i].ganttProperties["baselineStartDate"] = rec[this.parent.taskFields.baselineStartDate];
1268
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineStartDate'] = rec[this.parent.taskFields.baselineStartDate];
1265
1269
  }
1266
1270
  if (this.parent.taskFields.resourceInfo !== null) {
1267
- this.parent.editedRecords[i].ganttProperties["resources"] = rec[this.parent.taskFields.resourceInfo];
1271
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['resources'] = rec[this.parent.taskFields.resourceInfo];
1268
1272
  }
1269
1273
  }
1270
1274
  this.saveSuccess(args);
@@ -1333,6 +1337,14 @@ var Edit = /** @class */ (function () {
1333
1337
  }
1334
1338
  if (!this.isTreeGridRefresh) {
1335
1339
  this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords);
1340
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
1341
+ this.parent.contentHeight = this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
1342
+ this.parent.ganttChartModule.chartBodyContent.style.height = this.parent.contentHeight + 'px';
1343
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
1344
+ if (this.parent.taskFields.dependency) {
1345
+ this.parent.ganttChartModule.reRenderConnectorLines();
1346
+ }
1347
+ }
1336
1348
  if (this.parent.isConnectorLineUpdate && !isNullOrUndefined(this.parent.connectorLineEditModule)) {
1337
1349
  this.parent.updatedConnectorLineCollection = [];
1338
1350
  this.parent.connectorLineIds = [];
@@ -2248,15 +2260,24 @@ var Edit = /** @class */ (function () {
2248
2260
  if (parentTask && parentTask.ganttProperties.taskName !==
2249
2261
  this_2.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
2250
2262
  this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
2251
- if (parentTask) {
2252
- this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
2253
- }
2254
2263
  }
2255
2264
  else if (!parentTask && (!isDuplicate || isDuplicate.length === 0)) {
2256
2265
  this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
2257
- if (updateUnAssignedResources_1[i].parentItem && unassignedTask) {
2258
- this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
2266
+ }
2267
+ unassignedTask = this_2.parent.flatData.filter(function (data) {
2268
+ return data.ganttProperties.taskName === _this.parent.localeObj.getConstant('unassignedTask');
2269
+ })[0];
2270
+ var parentItem = this_2.parent.currentViewData.filter(function (data) {
2271
+ if (data.ganttProperties.taskId == updateUnAssignedResources_1[i].ganttProperties.taskId && (!data.hasChildRecords && data.parentItem)
2272
+ && unassignedTask.uniqueID === data.parentItem.uniqueID) {
2273
+ return data;
2274
+ }
2275
+ else {
2276
+ return null;
2259
2277
  }
2278
+ });
2279
+ if (parentItem[0]) {
2280
+ this_2.parent.dataOperation.updateParentItems(parentItem[0]);
2260
2281
  }
2261
2282
  };
2262
2283
  var this_2 = this;
@@ -2866,7 +2887,7 @@ var Edit = /** @class */ (function () {
2866
2887
  if (!isNullOrUndefined(ganttData)) {
2867
2888
  _this.validateUpdateValues(args.newTaskData, ganttData, true);
2868
2889
  }
2869
- if (!isNullOrUndefined(args.data[tempTaskID])) {
2890
+ if (!isNullOrUndefined(args.data["" + tempTaskID])) {
2870
2891
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
2871
2892
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
2872
2893
  args.newTaskData[tempTaskID] = args.data[tempTaskID];
@@ -2881,11 +2902,11 @@ var Edit = /** @class */ (function () {
2881
2902
  };
2882
2903
  var prevID_1 = args.data.ganttProperties.taskId.toString();
2883
2904
  /* tslint:disable-next-line */
2884
- var query_2 = _this.parent.query instanceof Query ? _this.parent.query : new Query();
2905
+ var query = _this.parent.query instanceof Query ? _this.parent.query : new Query();
2885
2906
  var adaptor = data_2.adaptor;
2886
2907
  if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data_2.dataSource.batchUrl) {
2887
2908
  /* tslint:disable-next-line */
2888
- var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query_2);
2909
+ var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query);
2889
2910
  crud.then(function (e) {
2890
2911
  if (_this.parent.taskFields.id && !isNullOrUndefined(e.addedRecords[0][_this.parent.taskFields.id]) &&
2891
2912
  e.addedRecords[0][_this.parent.taskFields.id].toString() == prevID_1) {
@@ -2907,9 +2928,8 @@ var Edit = /** @class */ (function () {
2907
2928
  }
2908
2929
  else {
2909
2930
  var addedRecords = 'addedRecords';
2910
- var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query_2);
2931
+ var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query);
2911
2932
  insertCrud.then(function (e) {
2912
- var changedRecords = 'changedRecords';
2913
2933
  var addedRecords;
2914
2934
  if (!isNullOrUndefined(e[0])) {
2915
2935
  addedRecords = e[0];
@@ -2917,26 +2937,7 @@ var Edit = /** @class */ (function () {
2917
2937
  else {
2918
2938
  addedRecords = updatedData_2['addedRecords'][0];
2919
2939
  }
2920
- /* tslint:disable-next-line */
2921
- var updateCrud = data_2.update(_this.parent.taskFields.id, updatedData_2[changedRecords], null, query_2);
2922
- updateCrud.then(function () {
2923
- if (_this.parent.taskFields.id && !isNullOrUndefined(addedRecords[_this.parent.taskFields.id]) &&
2924
- addedRecords[_this.parent.taskFields.id].toString() !== prevID_1) {
2925
- _this.parent.setRecordValue('taskId', addedRecords[_this.parent.taskFields.id], args.data.ganttProperties, true);
2926
- _this.parent.setRecordValue('taskData.' + _this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
2927
- _this.parent.setRecordValue(_this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
2928
- _this.parent.setRecordValue('rowUniqueID', addedRecords[_this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
2929
- var idIndex = _this.parent.ids.indexOf(prevID_1);
2930
- if (idIndex !== -1) {
2931
- _this.parent.ids[idIndex] = addedRecords[_this.parent.taskFields.id].toString();
2932
- }
2933
- }
2934
- _this.updateNewRecord(cAddedRecord_1, args);
2935
- }).catch(function (e) {
2936
- _this.removeAddedRecord();
2937
- _this.dmFailure(e, args);
2938
- _this._resetProperties();
2939
- });
2940
+ _this.updateNewRecord(cAddedRecord_1, args);
2940
2941
  }).catch(function (e) {
2941
2942
  _this.removeAddedRecord();
2942
2943
  _this.dmFailure(e, args);
@@ -4,7 +4,7 @@ import { Gantt } from '../base/gantt';
4
4
  */
5
5
  export declare class Filter {
6
6
  parent: Gantt;
7
- private filterMenuElement;
7
+ filterMenuElement: HTMLElement;
8
8
  constructor(gantt: Gantt);
9
9
  private getModuleName;
10
10
  /**
@@ -39,6 +39,7 @@ export declare class Filter {
39
39
  private actionBegin;
40
40
  closeFilterOnContextClick(element: Element): void;
41
41
  private actionComplete;
42
+ private setPosition;
42
43
  private updateFilterMenuPosition;
43
44
  private removeEventListener;
44
45
  /**
@@ -1,5 +1,5 @@
1
1
  import { TreeGrid, Filter as TreeGridFilter } from '@syncfusion/ej2-treegrid';
2
- import { filterAfterOpen } from '@syncfusion/ej2-grids';
2
+ import { filterAfterOpen, getFilterMenuPostion } from '@syncfusion/ej2-grids';
3
3
  import { getActualProperties, getCustomDateFormat } from '@syncfusion/ej2-grids';
4
4
  import { getValue, isNullOrUndefined, remove, createElement, addClass, closest, EventHandler } from '@syncfusion/ej2-base';
5
5
  import { TextBox } from '@syncfusion/ej2-inputs';
@@ -255,9 +255,95 @@ var Filter = /** @class */ (function () {
255
255
  }
256
256
  }
257
257
  };
258
+ Filter.prototype.setPosition = function (li, ul) {
259
+ var gridPos = this.parent.element.getBoundingClientRect();
260
+ var gridPosTop = gridPos.top;
261
+ var gridPosLeft = gridPos.left;
262
+ var parentNode;
263
+ var parentNodeTop;
264
+ var parentNodeLeft;
265
+ var paddingTop;
266
+ var paddingLeft;
267
+ var marginTop;
268
+ var marginLeft;
269
+ if (!isNullOrUndefined(this.parent.element.parentNode) && this.parent.element.parentNode['tagName'] != 'BODY') {
270
+ parentNode = this.parent.element.parentNode;
271
+ parentNodeTop = parentNode.getBoundingClientRect().top;
272
+ marginTop = parentNode.style.marginTop;
273
+ while (true) {
274
+ if (Math.abs(gridPosTop) > Math.abs(parentNodeTop)) {
275
+ paddingTop = gridPosTop - parentNodeTop;
276
+ break;
277
+ }
278
+ if (!isNullOrUndefined(this.parent.element.parentNode)) {
279
+ parentNode = parentNode.parentNode;
280
+ marginTop = parentNode.parentNode.style.marginTop;
281
+ }
282
+ parentNodeTop = parentNode.getBoundingClientRect().top;
283
+ }
284
+ parentNodeLeft = parentNode.getBoundingClientRect().left;
285
+ marginLeft = parentNode.style.marginLeft;
286
+ while (true) {
287
+ if (Math.abs(gridPosLeft) > Math.abs(parentNodeLeft)) {
288
+ paddingLeft = gridPosLeft - parentNodeLeft;
289
+ break;
290
+ }
291
+ if (!isNullOrUndefined(this.parent.element.parentNode)) {
292
+ parentNode = parentNode.parentNode;
293
+ marginLeft = parentNode.style.marginLeft;
294
+ }
295
+ parentNodeLeft = parentNode.getBoundingClientRect().left;
296
+ }
297
+ }
298
+ var liPos = li.getBoundingClientRect();
299
+ var left = liPos.right + window.scrollX;
300
+ var top = liPos.top + window.scrollY;
301
+ if (gridPos.right < (left + ul.offsetWidth)) {
302
+ if ((liPos.left - ul.offsetWidth) > gridPos.left) {
303
+ left = (liPos.left - ul.offsetWidth);
304
+ }
305
+ else {
306
+ left -= (left + ul.offsetWidth) - gridPos.right;
307
+ }
308
+ }
309
+ else {
310
+ if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
311
+ left = Math.abs(liPos.right - gridPos.left);
312
+ top = Math.abs(liPos.top - gridPos.top);
313
+ }
314
+ }
315
+ if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
316
+ ul.style.top = typeof (parseInt(marginTop)) === "string" ? (top + paddingTop + parseInt(marginTop)) + 'px' : (top + paddingTop) + 'px';
317
+ ul.style.left = typeof (parseInt(marginLeft)) === "string" ? (left + paddingLeft + parseInt(marginLeft) + 8) + 'px' : (left + paddingLeft) + 'px';
318
+ }
319
+ else {
320
+ ul.style.top = top + 'px';
321
+ ul.style.left = left + 'px';
322
+ }
323
+ };
258
324
  Filter.prototype.updateFilterMenuPosition = function (element, args) {
259
325
  addClass([element], 'e-gantt');
260
- document.querySelector('#' + this.parent.treeGrid.grid.element.id).appendChild(element);
326
+ document.querySelector('#' + this.parent.controlId).appendChild(element);
327
+ var targetElement;
328
+ if (this.parent.showColumnMenu) {
329
+ targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
330
+ element.style.zIndex = targetElement.parentElement.style.zIndex;
331
+ if (this.parent.treeGrid.filterSettings.type === 'Menu') {
332
+ this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
333
+ }
334
+ else {
335
+ this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
336
+ }
337
+ }
338
+ else {
339
+ targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
340
+ if (this.parent.treeGrid.filterSettings.type === 'Menu') {
341
+ getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
342
+ }
343
+ else {
344
+ getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
345
+ }
346
+ }
261
347
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
262
348
  element.querySelector('.e-valid-input').focus();
263
349
  }
@@ -230,7 +230,6 @@ var FocusModule = /** @class */ (function () {
230
230
  var top_1 = containerPosition.top + (containerPosition.height / 2);
231
231
  var left = containerPosition.left + (containerPosition.width / 2);
232
232
  this.setActiveElement(e.target);
233
- // eslint-disable-next-line security/detect-non-literal-fs-filename
234
233
  contextMenu.open(top_1, left);
235
234
  e.preventDefault();
236
235
  break;
@@ -11,6 +11,8 @@ export declare class PdfExport {
11
11
  private pdfDocument;
12
12
  gantt: PdfGantt;
13
13
  isPdfExport: boolean;
14
+ private isBlob;
15
+ private blobPromise;
14
16
  /**
15
17
  * @param {Gantt} parent .
16
18
  * @hidden
@@ -34,7 +36,7 @@ export declare class PdfExport {
34
36
  * @param {object} pdfDoc .
35
37
  * @returns {Promise<Object>} .
36
38
  */
37
- export(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object): Promise<Object>;
39
+ export(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object, isBlob?: boolean): Promise<Object>;
38
40
  private exportWithData;
39
41
  private processExport;
40
42
  private processSectionExportProperties;
@@ -45,8 +45,9 @@ var PdfExport = /** @class */ (function () {
45
45
  * @param {object} pdfDoc .
46
46
  * @returns {Promise<Object>} .
47
47
  */
48
- PdfExport.prototype.export = function (pdfExportProperties, isMultipleExport, pdfDoc) {
48
+ PdfExport.prototype.export = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
49
49
  var _this = this;
50
+ this.isBlob = isBlob;
50
51
  var args = {
51
52
  requestType: 'beforePdfExport',
52
53
  ganttObject: this.parent,
@@ -90,7 +91,7 @@ var PdfExport = /** @class */ (function () {
90
91
  this.pdfDocument = new PdfDocument();
91
92
  }
92
93
  this.processExport(data, pdfExportProperties, isMultipleExport).then(function () {
93
- _this.parent.trigger('pdfExportComplete', {});
94
+ _this.parent.trigger('pdfExportComplete', _this.isBlob ? { promise: _this.blobPromise } : {});
94
95
  if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
95
96
  _this.parent.hideMaskRow();
96
97
  }
@@ -116,12 +117,17 @@ var PdfExport = /** @class */ (function () {
116
117
  var layouter = _this.gantt.drawGrid(pdfPage, 0, 0, format);
117
118
  _this.gantt.drawChart(layouter);
118
119
  if (!isMultipleExport) {
119
- // save the PDF
120
- if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
121
- _this.pdfDocument.save(pdfExportProperties.fileName);
120
+ if (!_this.isBlob) {
121
+ // save the PDF
122
+ if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
123
+ _this.pdfDocument.save(pdfExportProperties.fileName);
124
+ }
125
+ else {
126
+ _this.pdfDocument.save('Export.pdf');
127
+ }
122
128
  }
123
129
  else {
124
- _this.pdfDocument.save('Export.pdf');
130
+ _this.blobPromise = _this.pdfDocument.save();
125
131
  }
126
132
  _this.pdfDocument.destroy();
127
133
  }
@@ -348,7 +348,7 @@ var RowDD = /** @class */ (function () {
348
348
  parentUniqueID = this.droppedRecord.uniqueID;
349
349
  }
350
350
  else {
351
- parentUniqueID = this.droppedRecord.parentItem.uniqueID;
351
+ parentUniqueID = this.droppedRecord.parentItem ? this.droppedRecord.parentItem.uniqueID : this.droppedRecord.uniqueID;
352
352
  }
353
353
  var droppedParentItem = this.parent.getTaskByUniqueID(parentUniqueID);
354
354
  var editedObj = {};
@@ -375,7 +375,7 @@ var RowDD = /** @class */ (function () {
375
375
  this.updateSharedResourceTask();
376
376
  }
377
377
  }
378
- if (this.parent.taskFields.dependency) {
378
+ if (this.parent.taskFields.dependency && this.parent.allowParentDependency) {
379
379
  var isValidPredecessor = true;
380
380
  var draggedParent = void 0;
381
381
  var toParent_1;
@@ -307,7 +307,10 @@ var Selection = /** @class */ (function () {
307
307
  var rIndex = parseInt(selectedRow.getAttribute('aria-rowindex'), 10);
308
308
  var isToggle = this.parent.selectionSettings.enableToggle;
309
309
  if (this.parent.selectionSettings.type === 'Single' || (!this.isMultiCtrlRequest && !this.isMultiShiftRequest)) {
310
- this.selectRow(rIndex, isToggle);
310
+ if (!this.parent.allowTaskbarDragAndDrop || (this.parent.allowTaskbarDragAndDrop && (this.parent.rowDragAndDropModule &&
311
+ !this.parent.rowDragAndDropModule['draggedRecord']))) {
312
+ this.selectRow(rIndex, isToggle);
313
+ }
311
314
  }
312
315
  else {
313
316
  if (this.isMultiShiftRequest) {
@@ -351,7 +354,7 @@ var Selection = /** @class */ (function () {
351
354
  };
352
355
  Selection.prototype.addRemoveClass = function (records) {
353
356
  if (typeof (records) == "number") {
354
- records = Array.from(String(records), function (num) { return Number(num); });
357
+ records = [records];
355
358
  }
356
359
  var ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
357
360
  var _loop_1 = function (i) {
@@ -47,6 +47,11 @@ export declare class TaskbarEdit extends DateProcessor {
47
47
  private elementOffsetHeight;
48
48
  segmentIndex: number;
49
49
  private targetElement;
50
+ currentItemTop: number;
51
+ currentItemPrevTop: number;
52
+ topValue: number;
53
+ draggedRecordMarginTop: number;
54
+ dragMoveY: number;
50
55
  constructor(ganttObj?: Gantt);
51
56
  private wireEvents;
52
57
  /**