@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
@@ -1,6 +1,6 @@
1
- import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, append, classList, closest, compile, createElement, deleteObject, extend, formatUnit, getValue, isNullOrUndefined, isObject, isObjectArray, isUndefined, merge, remove, removeClass, setValue } from '@syncfusion/ej2-base';
1
+ import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, append, classList, closest, compile, createElement, deleteObject, extend, formatUnit, getValue, isNullOrUndefined, isObject, isObjectArray, isUndefined, merge, remove, removeClass, setValue } from '@syncfusion/ej2-base';
2
2
  import { Dialog, Tooltip, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
3
- import { Edit, ForeignKey, Grid, Page, Predicate, Toolbar, ValueFormatter, click, filterAfterOpen, getActualProperties, getCustomDateFormat, getForeignData, getObject, getUid, parentsUntil, setCssInGridPopUp } from '@syncfusion/ej2-grids';
3
+ import { Edit, ForeignKey, Grid, Page, Predicate, Toolbar, ValueFormatter, click, filterAfterOpen, getActualProperties, getCustomDateFormat, getFilterMenuPostion, getForeignData, getObject, getUid, parentsUntil, setCssInGridPopUp } from '@syncfusion/ej2-grids';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, ODataAdaptor, ODataV4Adaptor, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { ColumnMenu, ContextMenu, Edit as Edit$1, ExcelExport, Filter, Reorder, Resize, RowDD, Selection, Sort, TreeGrid, VirtualScroll } from '@syncfusion/ej2-treegrid';
6
6
  import { Splitter } from '@syncfusion/ej2-layouts';
@@ -149,7 +149,7 @@ function updateDates(record, parent) {
149
149
  function formatString(str, args) {
150
150
  let regx;
151
151
  for (let i = 0; i < args.length; i++) {
152
- // eslint-disable-next-line detect-non-literal-regexp
152
+ // eslint-disable-next-line security/detect-non-literal-regexp
153
153
  regx = new RegExp('\\{' + (i) + '\\}', 'gm');
154
154
  str = str.replace(regx, args[i].toString());
155
155
  }
@@ -259,32 +259,37 @@ class DateProcessor {
259
259
  }
260
260
  }
261
261
  let tStartDate;
262
- do {
263
- tStartDate = new Date(cloneStartDate.getTime());
264
- const holidayLength = this.parent.totalHolidayDates.length;
265
- // check holidays and weekends
266
- if (this.isValidateNonWorkDays(ganttProp)) {
267
- const startTime = (!validateAsMilestone || isLoad) ? this.parent.defaultStartTime : this.parent.defaultEndTime;
268
- if (!this.parent.includeWeekend) {
269
- const tempDate = new Date(cloneStartDate.getTime());
270
- cloneStartDate = this.getNextWorkingDay(cloneStartDate);
271
- if (tempDate.getTime() !== cloneStartDate.getTime()) {
272
- this.setTime(startTime, cloneStartDate);
262
+ if (this.parent.autoCalculateDateScheduling) {
263
+ do {
264
+ tStartDate = new Date(cloneStartDate.getTime());
265
+ const holidayLength = this.parent.totalHolidayDates.length;
266
+ // check holidays and weekends
267
+ if (this.isValidateNonWorkDays(ganttProp)) {
268
+ const startTime = (!validateAsMilestone || isLoad) ? this.parent.defaultStartTime : this.parent.defaultEndTime;
269
+ if (!this.parent.includeWeekend) {
270
+ const tempDate = new Date(cloneStartDate.getTime());
271
+ cloneStartDate = this.getNextWorkingDay(cloneStartDate);
272
+ if (tempDate.getTime() !== cloneStartDate.getTime()) {
273
+ this.setTime(startTime, cloneStartDate);
274
+ }
273
275
  }
274
- }
275
- for (let count = 0; count < holidayLength; count++) {
276
- const holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
277
- const holidayTo = new Date(holidayFrom.getTime());
278
- holidayFrom.setHours(0, 0, 0, 0);
279
- holidayTo.setHours(23, 59, 59, 59);
280
- if (cloneStartDate.getTime() >= holidayFrom.getTime() && cloneStartDate.getTime() < holidayTo.getTime()) {
281
- cloneStartDate.setDate(cloneStartDate.getDate() + 1);
282
- this.setTime(startTime, cloneStartDate);
276
+ for (let count = 0; count < holidayLength; count++) {
277
+ const holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
278
+ const holidayTo = new Date(holidayFrom.getTime());
279
+ holidayFrom.setHours(0, 0, 0, 0);
280
+ holidayTo.setHours(23, 59, 59, 59);
281
+ if (cloneStartDate.getTime() >= holidayFrom.getTime() && cloneStartDate.getTime() < holidayTo.getTime()) {
282
+ cloneStartDate.setDate(cloneStartDate.getDate() + 1);
283
+ this.setTime(startTime, cloneStartDate);
284
+ }
283
285
  }
284
286
  }
285
- }
286
- } while (tStartDate.getTime() !== cloneStartDate.getTime());
287
- return new Date(cloneStartDate.getTime());
287
+ } while (tStartDate.getTime() !== cloneStartDate.getTime());
288
+ return new Date(cloneStartDate.getTime());
289
+ }
290
+ else {
291
+ return new Date(cloneStartDate.getTime());
292
+ }
288
293
  }
289
294
  /**
290
295
  * To update given date value to valid end date
@@ -319,36 +324,44 @@ class DateProcessor {
319
324
  }
320
325
  }
321
326
  let tempCheckDate;
322
- do {
323
- tempCheckDate = new Date(cloneEndDate.getTime());
324
- const holidayLength = this.parent.totalHolidayDates.length;
325
- if (this.isValidateNonWorkDays(ganttProp)) {
326
- if (!this.parent.includeWeekend) {
327
- const tempDate = new Date(cloneEndDate.getTime());
328
- cloneEndDate = this.getPreviousWorkingDay(cloneEndDate);
329
- if (tempDate.getTime() !== cloneEndDate.getTime()) {
330
- this.setTime(this.parent.defaultEndTime, cloneEndDate);
331
- }
332
- }
333
- for (let count = 0; count < holidayLength; count++) {
334
- const holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
335
- const holidayTo = new Date(holidayFrom.getTime());
336
- const tempHoliday = new Date(cloneEndDate.getTime());
337
- tempHoliday.setMinutes(cloneEndDate.getMilliseconds() - 2);
338
- holidayFrom.setHours(0, 0, 0, 0);
339
- holidayTo.setHours(23, 59, 59, 59);
340
- if (cloneEndDate.getTime() >= holidayFrom.getTime() && cloneEndDate.getTime() < holidayTo.getTime() ||
341
- tempHoliday.getTime() >= holidayFrom.getTime() && tempHoliday.getTime() < holidayTo.getTime()) {
342
- cloneEndDate.setDate(cloneEndDate.getDate() - 1);
343
- if (!(cloneEndDate.getTime() === holidayFrom.getTime() && this.parent.defaultEndTime === 86400 &&
344
- this.getSecondsInDecimal(cloneEndDate) === 0)) {
327
+ if (this.parent.autoCalculateDateScheduling) {
328
+ do {
329
+ tempCheckDate = new Date(cloneEndDate.getTime());
330
+ const holidayLength = this.parent.totalHolidayDates.length;
331
+ if (this.isValidateNonWorkDays(ganttProp)) {
332
+ if (!this.parent.includeWeekend) {
333
+ const tempDate = new Date(cloneEndDate.getTime());
334
+ cloneEndDate = this.getPreviousWorkingDay(cloneEndDate);
335
+ if (tempDate.getTime() !== cloneEndDate.getTime()) {
345
336
  this.setTime(this.parent.defaultEndTime, cloneEndDate);
346
337
  }
347
338
  }
339
+ for (let count = 0; count < holidayLength; count++) {
340
+ const holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
341
+ const holidayTo = new Date(holidayFrom.getTime());
342
+ const tempHoliday = new Date(cloneEndDate.getTime());
343
+ tempHoliday.setMinutes(cloneEndDate.getMilliseconds() - 2);
344
+ holidayFrom.setHours(0, 0, 0, 0);
345
+ holidayTo.setHours(23, 59, 59, 59);
346
+ if (cloneEndDate.getTime() >= holidayFrom.getTime() && cloneEndDate.getTime() < holidayTo.getTime() ||
347
+ tempHoliday.getTime() >= holidayFrom.getTime() && tempHoliday.getTime() < holidayTo.getTime()) {
348
+ cloneEndDate.setDate(cloneEndDate.getDate() - 1);
349
+ if (!(cloneEndDate.getTime() === holidayFrom.getTime() && this.parent.defaultEndTime === 86400 &&
350
+ this.getSecondsInDecimal(cloneEndDate) === 0)) {
351
+ this.setTime(this.parent.defaultEndTime, cloneEndDate);
352
+ }
353
+ }
354
+ }
348
355
  }
356
+ } while (tempCheckDate.getTime() !== cloneEndDate.getTime());
357
+ return new Date(cloneEndDate.getTime());
358
+ }
359
+ else {
360
+ if (!isNullOrUndefined(cloneEndDate)) {
361
+ this.setTime(this.parent.defaultEndTime, cloneEndDate);
349
362
  }
350
- } while (tempCheckDate.getTime() !== cloneEndDate.getTime());
351
- return new Date(cloneEndDate.getTime());
363
+ return new Date(cloneEndDate.getTime());
364
+ }
352
365
  }
353
366
  /**
354
367
  * To validate the baseline start date
@@ -463,6 +476,13 @@ class DateProcessor {
463
476
  }
464
477
  this.parent.setRecordValue('endDate', tempEndDate, ganttProp, true);
465
478
  }
479
+ else {
480
+ tempEndDate = ganttData[this.parent.taskFields.endDate];
481
+ if (!isNullOrUndefined(tempEndDate)) {
482
+ this.setTime(this.parent.defaultEndTime, tempEndDate);
483
+ }
484
+ this.parent.setRecordValue('endDate', tempEndDate, ganttProp, true);
485
+ }
466
486
  if (this.parent.taskFields.endDate) {
467
487
  this.parent.dataOperation.updateMappingData(ganttData, 'endDate');
468
488
  }
@@ -529,9 +549,9 @@ class DateProcessor {
529
549
  */
530
550
  getNonworkingTime(sDate, eDate, isAutoSchedule, isCheckTimeZone) {
531
551
  isCheckTimeZone = isNullOrUndefined(isCheckTimeZone) ? true : isCheckTimeZone;
532
- const weekendCount = !this.parent.includeWeekend && isAutoSchedule ? this.getWeekendCount(sDate, eDate) : 0;
552
+ const weekendCount = (!this.parent.includeWeekend && this.parent.autoCalculateDateScheduling) && isAutoSchedule ? this.getWeekendCount(sDate, eDate) : 0;
533
553
  const totalHours = this.getNumberOfSeconds(sDate, eDate, isCheckTimeZone);
534
- const holidaysCount = isAutoSchedule ? this.getHolidaysCount(sDate, eDate) : 0;
554
+ const holidaysCount = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.getHolidaysCount(sDate, eDate) : 0;
535
555
  const totWorkDays = (totalHours - (weekendCount * 86400) - (holidaysCount * 86400)) / 86400; // working days between two dates
536
556
  const nonWorkHours = this.getNonWorkingSecondsOnDate(sDate, eDate, isAutoSchedule);
537
557
  const totalNonWorkTime = (totWorkDays * (86400 - this.parent.secondsPerDay)) +
@@ -722,6 +742,9 @@ class DateProcessor {
722
742
  if (!isNullOrUndefined(data.ganttProperties.startDate))
723
743
  sDate = data.ganttProperties.startDate;
724
744
  }
745
+ else {
746
+ sDate = this.getProjectStartDate(ganttProp);
747
+ }
725
748
  });
726
749
  }
727
750
  else {
@@ -1000,6 +1023,9 @@ class DateProcessor {
1000
1023
  /*Check given date is on holidays*/
1001
1024
  isOnHolidayOrWeekEnd(date, checkWeekEnd) {
1002
1025
  checkWeekEnd = !isNullOrUndefined(checkWeekEnd) ? checkWeekEnd : this.parent.includeWeekend;
1026
+ if (!this.parent.autoCalculateDateScheduling) {
1027
+ checkWeekEnd = true;
1028
+ }
1003
1029
  if (!checkWeekEnd && this.parent.nonWorkingDayIndex.indexOf(date.getDay()) !== -1) {
1004
1030
  return true;
1005
1031
  }
@@ -1029,8 +1055,8 @@ class DateProcessor {
1029
1055
  let startRangeIndex = -1;
1030
1056
  let endRangeIndex = -1;
1031
1057
  let totNonWrkSecs = 0;
1032
- const startOnHoliday = isAutoSchedule ? this.isOnHolidayOrWeekEnd(startDate, null) : false;
1033
- const endOnHoliday = isAutoSchedule ? this.isOnHolidayOrWeekEnd(endDate, null) : false;
1058
+ const startOnHoliday = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.isOnHolidayOrWeekEnd(startDate, null) : false;
1059
+ const endOnHoliday = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.isOnHolidayOrWeekEnd(endDate, null) : false;
1034
1060
  for (let i = 0; i < this.parent.nonWorkingTimeRanges.length; i++) {
1035
1061
  const val = this.parent.nonWorkingTimeRanges[i];
1036
1062
  if (sHour >= val.from && sHour <= val.to) {
@@ -1690,7 +1716,7 @@ class TaskProcessor extends DateProcessor {
1690
1716
  constructResourceViewDataSource(resources, data, unassignedTasks) {
1691
1717
  for (let i = 0; i < data.length; i++) {
1692
1718
  const tempData = data[i];
1693
- var child = this.parent.taskFields.child != null ? this.parent.taskFields.child : 'Children';
1719
+ const child = this.parent.taskFields.child != null ? this.parent.taskFields.child : 'Children';
1694
1720
  const resourceData = tempData && tempData[this.parent.taskFields.resourceInfo];
1695
1721
  const resourceIdMapping = this.parent.resourceFields.id;
1696
1722
  if ((!tempData[child] || tempData[child].length === 0) && resourceData && resourceData.length) {
@@ -1767,7 +1793,7 @@ class TaskProcessor extends DateProcessor {
1767
1793
  }
1768
1794
  }
1769
1795
  const ganttData = this.createRecord(tempData, level, parentItem, true);
1770
- if (!this.parent.enableValidation) {
1796
+ if (!this.parent.enableValidation || !this.parent.autoCalculateDateScheduling) {
1771
1797
  this.updateTaskLeftWidth(ganttData);
1772
1798
  }
1773
1799
  ganttData.index = this.recordIndex++;
@@ -1801,6 +1827,9 @@ class TaskProcessor extends DateProcessor {
1801
1827
  this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
1802
1828
  this.updateAutoWidthLeft(parentData);
1803
1829
  }
1830
+ if (!this.parent.allowParentDependency) {
1831
+ this.resetDependency(parentData);
1832
+ }
1804
1833
  this.updateWidthLeft(parentData);
1805
1834
  this.updateTaskData(parentData);
1806
1835
  }
@@ -1913,6 +1942,9 @@ class TaskProcessor extends DateProcessor {
1913
1942
  if (!isNullOrUndefined(data[taskSettings.child]) && data[taskSettings.child].length > 0) {
1914
1943
  this.parent.setRecordValue('hasChildRecords', true, ganttData);
1915
1944
  this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
1945
+ if (!this.parent.allowParentDependency) {
1946
+ this.resetDependency(ganttData);
1947
+ }
1916
1948
  }
1917
1949
  else {
1918
1950
  this.parent.setRecordValue('hasChildRecords', false, ganttData);
@@ -2311,6 +2343,16 @@ class TaskProcessor extends DateProcessor {
2311
2343
  }
2312
2344
  }
2313
2345
  }
2346
+ if (!this.parent.autoCalculateDateScheduling) {
2347
+ if (!isNullOrUndefined(ganttData.ganttProperties.startDate)) {
2348
+ ganttData[this.parent.taskFields.startDate] = ganttData.ganttProperties.startDate;
2349
+ ganttData.taskData[this.parent.taskFields.startDate] = ganttData.ganttProperties.startDate;
2350
+ }
2351
+ if (!isNullOrUndefined(ganttData.ganttProperties.endDate)) {
2352
+ ganttData[this.parent.taskFields.endDate] = ganttData.ganttProperties.endDate;
2353
+ ganttData.taskData[this.parent.taskFields.endDate] = ganttData.ganttProperties.endDate;
2354
+ }
2355
+ }
2314
2356
  if (!isNullOrUndefined(segments)) {
2315
2357
  this.parent.setRecordValue('segments', this.setSegmentsInfo(ganttData, true), ganttProperties, true);
2316
2358
  }
@@ -3297,7 +3339,7 @@ class TaskProcessor extends DateProcessor {
3297
3339
  const rangeObj = {};
3298
3340
  if (this._isInStartDateRange(cStartDate, tStartDate, tEndDate) || this._isInEndDateRange(cEndDate, tStartDate, tEndDate)) {
3299
3341
  if ((tStartDate.getTime() > cStartDate.getTime() && tStartDate.getTime() < cEndDate.getTime()
3300
- && tEndDate.getTime() > cStartDate.getTime() && tEndDate.getTime() > cEndDate.getTime())
3342
+ && tEndDate.getTime() > cStartDate.getTime() && tEndDate.getTime() >= cEndDate.getTime())
3301
3343
  || (cStartDate.getTime() === tStartDate.getTime() && cEndDate.getTime() <= tEndDate.getTime())) {
3302
3344
  rangeObj.from = tStartDate;
3303
3345
  rangeObj.to = cEndDate;
@@ -3578,7 +3620,7 @@ class TaskProcessor extends DateProcessor {
3578
3620
  */
3579
3621
  updateTaskLeftWidth(data) {
3580
3622
  const task = data.ganttProperties;
3581
- if (!data.hasChildRecords) {
3623
+ if (!data.hasChildRecords || !this.parent.autoCalculateDateScheduling) {
3582
3624
  this.updateWidthLeft(data);
3583
3625
  }
3584
3626
  this.parent.setRecordValue('baselineLeft', this.calculateBaselineLeft(task), task, true);
@@ -3590,7 +3632,12 @@ class TaskProcessor extends DateProcessor {
3590
3632
  childData = parentItem.childRecords;
3591
3633
  }
3592
3634
  if (parentItem && childData.indexOf(data) === childData.length - 1 && !data.hasChildRecords && this.parent.enableValidation) {
3593
- this.updateParentItems(parentItem);
3635
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
3636
+ this.updateParentItems(parentItem);
3637
+ }
3638
+ if (!this.parent.autoCalculateDateScheduling) {
3639
+ this.updateWidthLeft(parentItem);
3640
+ }
3594
3641
  }
3595
3642
  else if (parentItem && !this.parent.enableValidation) {
3596
3643
  this.updateWidthLeft(parentItem);
@@ -3705,7 +3752,7 @@ class TaskProcessor extends DateProcessor {
3705
3752
  }
3706
3753
  if (childGanttRecord.hasChildRecords) {
3707
3754
  setValue('totalProgress', childGanttRecord.ganttProperties.totalProgress, progressValues);
3708
- setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration, progressValues);
3755
+ setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration ? childGanttRecord.ganttProperties.totalDuration : 0, progressValues);
3709
3756
  }
3710
3757
  else {
3711
3758
  setValue('totalProgress', childGanttRecord.ganttProperties.progress * durationInDay, progressValues);
@@ -3733,107 +3780,119 @@ class TaskProcessor extends DateProcessor {
3733
3780
  const parentData = isParent ? cloneParent : this.parent.getParentTask(cloneParent);
3734
3781
  let deleteUpdate = false;
3735
3782
  const ganttProp = parentData.ganttProperties;
3736
- if (parentData.childRecords.length > 0) {
3737
- const previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
3738
- const previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
3739
- ganttProp.autoEndDate;
3740
- const childRecords = parentData.childRecords;
3741
- const childLength = childRecords.length;
3742
- let totalDuration = 0;
3743
- let progressValues = {};
3744
- let minStartDate = null;
3745
- let maxEndDate = null;
3746
- let milestoneCount = 0;
3747
- let totalProgress = 0;
3748
- let childCompletedWorks = 0;
3749
- let childData;
3750
- for (let count = 0; count < childLength; count++) {
3751
- childData = childRecords[count];
3752
- if (this.parent.isOnDelete && childData.isDelete) {
3753
- if (childLength === 1 && this.parent.viewType === 'ProjectView') {
3754
- deleteUpdate = true;
3783
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
3784
+ if (parentData.childRecords.length > 0) {
3785
+ const previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
3786
+ const previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
3787
+ ganttProp.autoEndDate;
3788
+ const childRecords = parentData.childRecords;
3789
+ const childLength = childRecords.length;
3790
+ let totalDuration = 0;
3791
+ let progressValues = {};
3792
+ let minStartDate = null;
3793
+ let maxEndDate = null;
3794
+ let milestoneCount = 0;
3795
+ let totalProgress = 0;
3796
+ let childCompletedWorks = 0;
3797
+ let childData;
3798
+ for (let count = 0; count < childLength; count++) {
3799
+ childData = childRecords[count];
3800
+ if (this.parent.isOnDelete && childData.isDelete) {
3801
+ if (childLength === 1 && this.parent.viewType === 'ProjectView') {
3802
+ deleteUpdate = true;
3803
+ }
3804
+ continue;
3755
3805
  }
3756
- continue;
3757
- }
3758
- let startDate = this.getValidStartDate(childData.ganttProperties);
3759
- if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
3760
- startDate = childData.ganttProperties.autoStartDate;
3761
- }
3762
- let endDate = this.getValidEndDate(childData.ganttProperties);
3763
- if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
3764
- endDate = childData.ganttProperties.autoEndDate;
3765
- }
3766
- if (isNullOrUndefined(minStartDate)) {
3767
- minStartDate = this.getDateFromFormat(startDate);
3768
- }
3769
- if (isNullOrUndefined(maxEndDate)) {
3770
- maxEndDate = this.getDateFromFormat(endDate);
3771
- }
3772
- if (!isNullOrUndefined(endDate) && this.compareDates(endDate, maxEndDate) === 1) {
3773
- maxEndDate = this.getDateFromFormat(endDate);
3774
- }
3775
- if (!isNullOrUndefined(startDate) && this.compareDates(startDate, minStartDate) === -1) {
3776
- minStartDate = this.getDateFromFormat(startDate);
3777
- }
3778
- if (!childData.ganttProperties.isMilestone && isScheduledTask(childData.ganttProperties)) {
3779
- progressValues = this.getParentProgress(childData);
3780
- totalProgress += getValue('totalProgress', progressValues);
3781
- if (childData[this.parent.taskFields.duration] < 1) {
3782
- if (typeof (getValue('totalDuration', progressValues)) != 'object') {
3806
+ let startDate = this.getValidStartDate(childData.ganttProperties);
3807
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
3808
+ startDate = childData.ganttProperties.autoStartDate;
3809
+ }
3810
+ let endDate = this.getValidEndDate(childData.ganttProperties);
3811
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
3812
+ endDate = childData.ganttProperties.autoEndDate;
3813
+ }
3814
+ if (isNullOrUndefined(minStartDate)) {
3815
+ minStartDate = this.getDateFromFormat(startDate);
3816
+ }
3817
+ if (isNullOrUndefined(maxEndDate)) {
3818
+ maxEndDate = this.getDateFromFormat(endDate);
3819
+ }
3820
+ if (!isNullOrUndefined(endDate) && this.compareDates(endDate, maxEndDate) === 1) {
3821
+ maxEndDate = this.getDateFromFormat(endDate);
3822
+ }
3823
+ if (!isNullOrUndefined(startDate) && this.compareDates(startDate, minStartDate) === -1) {
3824
+ minStartDate = this.getDateFromFormat(startDate);
3825
+ }
3826
+ if (!childData.ganttProperties.isMilestone && isScheduledTask(childData.ganttProperties)) {
3827
+ progressValues = this.getParentProgress(childData);
3828
+ totalProgress += getValue('totalProgress', progressValues);
3829
+ if (childData[this.parent.taskFields.duration] < 1) {
3783
3830
  totalDuration += getValue('totalDuration', progressValues);
3784
3831
  totalDuration = Number(totalDuration.toFixed(4));
3785
3832
  }
3833
+ else {
3834
+ totalDuration += getValue('totalDuration', progressValues);
3835
+ }
3786
3836
  }
3787
3837
  else {
3788
- totalDuration += getValue('totalDuration', progressValues);
3838
+ milestoneCount++;
3789
3839
  }
3840
+ childCompletedWorks += childData.ganttProperties.work;
3790
3841
  }
3791
- else {
3792
- milestoneCount++;
3793
- }
3794
- childCompletedWorks += childData.ganttProperties.work;
3795
- }
3796
- if (!deleteUpdate) {
3797
- if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3798
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3799
- }
3800
- if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3801
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3802
- }
3803
- let taskCount;
3804
- if (this.parent.isOnDelete && childData.isDelete) {
3805
- taskCount = childLength - milestoneCount - 1;
3806
- }
3807
- else {
3808
- taskCount = childLength - milestoneCount;
3809
- }
3810
- const parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
3811
- const parentProp = parentData.ganttProperties;
3812
- const milestone = (taskCount === 0) && minStartDate && maxEndDate &&
3813
- minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3814
- this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
3815
- if (parentProp.isAutoSchedule) {
3816
- this.calculateDuration(parentData);
3817
- }
3818
- this.updateWorkWithDuration(parentData);
3819
- let parentWork = parentProp.work;
3820
- parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
3821
- this.parent.setRecordValue('work', parentWork, parentProp, true);
3822
- this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
3823
- if (!isNullOrUndefined(this.parent.taskFields.type)) {
3824
- this.updateMappingData(parentData, 'type');
3825
- }
3826
- this.parent.setRecordValue('progress', Math.floor(parentProgress), parentProp, true);
3827
- this.parent.setRecordValue('totalProgress', totalProgress, parentProp, true);
3828
- this.parent.setRecordValue('totalDuration', totalDuration, parentProp, true);
3829
- if (!parentProp.isAutoSchedule) {
3830
- this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
3831
- this.updateAutoWidthLeft(parentData);
3842
+ if (!deleteUpdate) {
3843
+ let taskCount;
3844
+ if (this.parent.isOnDelete && childData.isDelete) {
3845
+ taskCount = childLength - milestoneCount - 1;
3846
+ }
3847
+ else {
3848
+ taskCount = childLength - milestoneCount;
3849
+ }
3850
+ const parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
3851
+ const parentProp = parentData.ganttProperties;
3852
+ const milestone = (taskCount === 0) && minStartDate && maxEndDate &&
3853
+ minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3854
+ if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3855
+ this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3856
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3857
+ this.parent.setRecordValue('startDate', minStartDate, parentData.ganttProperties, true);
3858
+ }
3859
+ }
3860
+ if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3861
+ this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3862
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3863
+ this.parent.setRecordValue('endDate', maxEndDate, parentData.ganttProperties, true);
3864
+ }
3865
+ }
3866
+ this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
3867
+ if (parentProp.isAutoSchedule) {
3868
+ this.calculateDuration(parentData);
3869
+ }
3870
+ this.updateWorkWithDuration(parentData);
3871
+ let parentWork = parentProp.work;
3872
+ parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
3873
+ this.parent.setRecordValue('work', parentWork, parentProp, true);
3874
+ this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
3875
+ if (!isNullOrUndefined(this.parent.taskFields.type)) {
3876
+ this.updateMappingData(parentData, 'type');
3877
+ }
3878
+ this.parent.setRecordValue('progress', Math.floor(parentProgress), parentProp, true);
3879
+ this.parent.setRecordValue('totalProgress', totalProgress, parentProp, true);
3880
+ this.parent.setRecordValue('totalDuration', totalDuration, parentProp, true);
3881
+ if (!parentProp.isAutoSchedule) {
3882
+ this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
3883
+ this.updateAutoWidthLeft(parentData);
3884
+ }
3885
+ if (!this.parent.allowParentDependency) {
3886
+ this.resetDependency(parentData);
3887
+ }
3888
+ this.updateWidthLeft(parentData);
3889
+ this.updateTaskData(parentData);
3832
3890
  }
3833
- this.updateWidthLeft(parentData);
3834
- this.updateTaskData(parentData);
3835
3891
  }
3836
3892
  }
3893
+ else {
3894
+ parentData.ganttProperties.endDate = parentData.taskData[this.parent.taskFields.endDate];
3895
+ }
3837
3896
  if (deleteUpdate && parentData.childRecords.length === 1 && parentData.ganttProperties.duration === 0) {
3838
3897
  this.parent.setRecordValue('isMilestone', true, parentData.ganttProperties, true);
3839
3898
  this.updateWidthLeft(parentData);
@@ -3841,7 +3900,9 @@ class TaskProcessor extends DateProcessor {
3841
3900
  }
3842
3901
  const parentItem = this.parent.getParentTask(parentData.parentItem);
3843
3902
  if (parentItem) {
3844
- this.updateParentItems(parentItem);
3903
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
3904
+ this.updateParentItems(parentItem);
3905
+ }
3845
3906
  }
3846
3907
  deleteUpdate = false;
3847
3908
  }
@@ -4092,20 +4153,30 @@ class ChartScroll {
4092
4153
  }
4093
4154
  }
4094
4155
  removeShimmer() {
4095
- let parent = this.parent;
4156
+ const parent = this.parent;
4096
4157
  setTimeout(function () {
4097
4158
  parent.hideMaskRow();
4159
+ if (parent.viewType === 'ResourceView' && !parent.allowTaskbarOverlap && parent.showOverAllocation) {
4160
+ for (let i = 0; i < parent.currentViewData.length; i++) {
4161
+ const tr = parent.chartRowsModule.ganttChartTableBody.childNodes[i];
4162
+ if (tr['style'].display !== 'none' && parent.currentViewData[i].hasChildRecords && !parent.currentViewData[i].expanded) {
4163
+ parent.treeGrid.getRowByIndex(i)['style'].height = tr['style'].height;
4164
+ }
4165
+ }
4166
+ parent.contentHeight = parent.enableRtl ? parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
4167
+ parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
4168
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = parent.contentHeight + 'px';
4169
+ }
4098
4170
  }, 0);
4099
4171
  }
4100
- ;
4101
4172
  updateShimmer() {
4102
- let parent = this.parent;
4173
+ const parent = this.parent;
4103
4174
  setTimeout(function () {
4104
4175
  parent.showMaskRow();
4105
4176
  }, 0);
4106
4177
  }
4107
4178
  updateSpinner() {
4108
- let parent = this.parent;
4179
+ const parent = this.parent;
4109
4180
  this.parent.showSpinner();
4110
4181
  window.clearTimeout(this.isScrolling);
4111
4182
  this.isScrolling = setTimeout(function () {
@@ -4137,11 +4208,11 @@ class ChartScroll {
4137
4208
  scrollArgs.scrollDirection = 'Horizontal';
4138
4209
  scrollArgs.action = 'HorizontalScroll';
4139
4210
  }
4140
- if ((scrollArgs.scrollDirection != 'Horizontal' && !isNullOrUndefined(scrollArgs.scrollDirection)) && this.parent.enableVirtualization === true && (this.parent.isToolBarClick
4211
+ if ((scrollArgs.scrollDirection !== 'Horizontal' && !isNullOrUndefined(scrollArgs.scrollDirection)) && this.parent.enableVirtualization === true && (this.parent.isToolBarClick
4141
4212
  || isNullOrUndefined(this.parent.isToolBarClick))) {
4142
4213
  this.parent.isVirtualScroll = true;
4143
4214
  if (this.parent.showIndicator || isNullOrUndefined(this.parent.showIndicator)) {
4144
- if (!this.parent.enableVirtualMaskRow && this.parent.enableVirtualization && this.parent.loadingIndicator.indicatorType === "Spinner") {
4215
+ if (!this.parent.enableVirtualMaskRow && this.parent.enableVirtualization && this.parent.loadingIndicator.indicatorType === 'Spinner') {
4145
4216
  this.updateSpinner();
4146
4217
  }
4147
4218
  }
@@ -4185,11 +4256,12 @@ class ChartScroll {
4185
4256
  * To set scroll left for chart scroll container
4186
4257
  *
4187
4258
  * @param {number} scrollLeft - To set scroll left for scroll container
4259
+ * @param {number} leftSign - specifies left sign
4188
4260
  * @returns {void} .
4189
4261
  */
4190
4262
  setScrollLeft(scrollLeft, leftSign) {
4191
4263
  if (leftSign) {
4192
- scrollLeft = leftSign == -1 && this.parent.enableRtl ? -scrollLeft : scrollLeft;
4264
+ scrollLeft = leftSign === -1 && this.parent.enableRtl ? -scrollLeft : scrollLeft;
4193
4265
  }
4194
4266
  this.element.scrollLeft = scrollLeft;
4195
4267
  this.parent.ganttChartModule.chartTimelineContainer.scrollLeft = this.element.scrollLeft;
@@ -4345,9 +4417,11 @@ class GanttChart {
4345
4417
  }
4346
4418
  else {
4347
4419
  if (this.parent.viewType === 'ProjectView') {
4348
- this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[1].setAttribute('tabindex', '-1');
4420
+ if (!isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(i.toString(), 10)].children[0].children[1].children[1])) {
4421
+ this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[1].setAttribute('tabindex', '-1');
4422
+ }
4349
4423
  }
4350
- else if (this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[0]) {
4424
+ else if (this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(i.toString(), 10)].children[0].children[1].children[0]) {
4351
4425
  this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[0].setAttribute('tabindex', '-1');
4352
4426
  }
4353
4427
  }
@@ -4400,7 +4474,14 @@ class GanttChart {
4400
4474
  Math.floor((this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight));
4401
4475
  }
4402
4476
  renderRange(rangeCollection, currentRecord) {
4403
- const topValue = this.getTopValue(currentRecord);
4477
+ let topValue = 0;
4478
+ let rowIndex = this.parent.currentViewData.indexOf(currentRecord);
4479
+ if (!this.parent.allowTaskbarOverlap && this.parent.enableMultiTaskbar) {
4480
+ topValue = !currentRecord.expanded ? this.parent.getRowByIndex(rowIndex).offsetTop : this.parent.getRowByIndex(rowIndex).offsetTop + this.parent.rowHeight;
4481
+ }
4482
+ else {
4483
+ topValue = this.getTopValue(currentRecord);
4484
+ }
4404
4485
  const sameIDElement = this.rangeViewContainer.querySelector('.' + 'rangeContainer' + currentRecord.ganttProperties.rowUniqueID);
4405
4486
  if (sameIDElement) {
4406
4487
  sameIDElement.remove();
@@ -4413,7 +4494,14 @@ class GanttChart {
4413
4494
  return;
4414
4495
  }
4415
4496
  for (let i = 0; i < rangeCollection.length; i++) {
4416
- const height = this.getRangeHeight(currentRecord);
4497
+ let height;
4498
+ if (!this.parent.allowTaskbarOverlap && !currentRecord.expanded && this.parent.enableMultiTaskbar) {
4499
+ height = parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[rowIndex].style.height) -
4500
+ (this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight);
4501
+ }
4502
+ else {
4503
+ height = this.getRangeHeight(currentRecord);
4504
+ }
4417
4505
  const leftDiv = createElement('div', {
4418
4506
  className: rangeChildContainer + ' ' + 'e-leftarc', styles: (this.parent.enableRtl ? 'right:' : 'left:') +
4419
4507
  `${(this.parent.enableRtl ? rangeCollection[i].left + rangeCollection[i].width - 5 : rangeCollection[i].left)}px;
@@ -5719,7 +5807,7 @@ class Timeline {
5719
5807
  else {
5720
5808
  const value = property === 'topTier' ? 'bottomTier' : 'topTier';
5721
5809
  const assignValue = 'bottomTier';
5722
- if (newTimeline[assignValue].unit != "None") {
5810
+ if (newTimeline[`${assignValue}`].unit != "None") {
5723
5811
  this.customTimelineSettings[value] = Object.assign({}, newTimeline[assignValue]);
5724
5812
  }
5725
5813
  }
@@ -6020,7 +6108,7 @@ class Timeline {
6020
6108
  else {
6021
6109
  secondValue = sortedUnitLevels[i + 1];
6022
6110
  }
6023
- if (count >= firstValue[tier].count) {
6111
+ if (count >= firstValue[`${tier}`].count) {
6024
6112
  currentZoomCollection = sortedUnitLevels[i];
6025
6113
  checkSameCountLevels = sortedUnitLevels.filter((tempLevel) => {
6026
6114
  if (tier === "bottomTier") {
@@ -6038,7 +6126,7 @@ class Timeline {
6038
6126
  }
6039
6127
  break;
6040
6128
  }
6041
- else if (count < firstValue[tier].count && count > secondValue[tier].count) {
6129
+ else if (count < firstValue[`${tier}`].count && count > secondValue[`${tier}`].count) {
6042
6130
  currentZoomCollection = sortedUnitLevels[i + 1];
6043
6131
  checkSameCountLevels = sortedUnitLevels.filter((tempLevel) => {
6044
6132
  if (tier === "bottomTier") {
@@ -7115,6 +7203,15 @@ class GanttTreeGrid {
7115
7203
  this.columnMenuOpen = (args) => {
7116
7204
  this.parent.notify('columnMenuOpen', args);
7117
7205
  this.parent.trigger('columnMenuOpen', args);
7206
+ document.querySelector(".e-colmenu").addEventListener('mousemove', (event) => {
7207
+ const filPopOptions = document.querySelector(".e-filter-popup");
7208
+ const filOptions = document.querySelector(".e-filter-item");
7209
+ if (!isNullOrUndefined(filPopOptions)) {
7210
+ if (!filOptions.classList.contains('e-focused')) {
7211
+ remove(this.parent.filterModule.filterMenuElement);
7212
+ }
7213
+ }
7214
+ });
7118
7215
  };
7119
7216
  this.columnMenuClick = (args) => {
7120
7217
  this.parent.trigger('columnMenuClick', args);
@@ -7146,6 +7243,7 @@ class GanttTreeGrid {
7146
7243
  this.parent.treeGrid = new TreeGrid();
7147
7244
  this.parent.treeGrid.allowSelection = false;
7148
7245
  this.parent.treeGrid.allowKeyboard = this.parent.allowKeyboard;
7246
+ this.parent.treeGrid['${enableHtmlSanitizer}'] = this.parent.enableHtmlSanitizer;
7149
7247
  this.parent.treeGrid.enableImmutableMode = this.parent.enableImmutableMode;
7150
7248
  this.treeGridColumns = [];
7151
7249
  if (!this.parent.isLocaleChanged && this.parent.isLoad) {
@@ -7336,6 +7434,12 @@ class GanttTreeGrid {
7336
7434
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
7337
7435
  const collapsedArgs = this.createExpandCollapseArgs(args);
7338
7436
  this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
7437
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
7438
+ collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
7439
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
7440
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
7441
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
7442
+ }
7339
7443
  }
7340
7444
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
7341
7445
  this.parent.hideMaskRow();
@@ -7349,6 +7453,12 @@ class GanttTreeGrid {
7349
7453
  if (!args['data'].length) {
7350
7454
  const expandedArgs = this.createExpandCollapseArgs(args);
7351
7455
  this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
7456
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
7457
+ args['row'].style.height = this.parent.rowHeight + 'px';
7458
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
7459
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
7460
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
7461
+ }
7352
7462
  }
7353
7463
  }
7354
7464
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
@@ -7441,6 +7551,14 @@ class GanttTreeGrid {
7441
7551
  this.parent.addDeleteRecord = false;
7442
7552
  }
7443
7553
  this.parent.trigger('actionComplete', updatedArgs);
7554
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
7555
+ for (let i = 0; i < this.parent.currentViewData.length; i++) {
7556
+ if (this.parent.currentViewData[i].hasChildRecords && !this.parent.currentViewData[i].expanded) {
7557
+ this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[i]);
7558
+ }
7559
+ }
7560
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
7561
+ }
7444
7562
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
7445
7563
  this.parent.hideMaskRow();
7446
7564
  }
@@ -8586,8 +8704,12 @@ class ChartRows extends DateProcessor {
8586
8704
  }
8587
8705
  }
8588
8706
  else {
8589
- labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
8707
+ const field = this.parent.labelSettings.taskLabel;
8708
+ labelString = this.getTaskLabel(field);
8590
8709
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8710
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
8711
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
8712
+ }
8591
8713
  }
8592
8714
  if (labelString.indexOf('null') === -1) {
8593
8715
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -8599,7 +8721,7 @@ class ChartRows extends DateProcessor {
8599
8721
  (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
8600
8722
  'display:' + 'inline-block;' +
8601
8723
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8602
- this.taskBarHeight + 'px;">' + labelString + '</span>';
8724
+ this.taskBarHeight + 'px;"></span>';
8603
8725
  }
8604
8726
  else {
8605
8727
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
@@ -8607,7 +8729,7 @@ class ChartRows extends DateProcessor {
8607
8729
  (this.parent.enableRtl ? 'right;' : 'left;')) : '') +
8608
8730
  +(this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8609
8731
  +(this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
8610
- this.taskBarHeight + 'px;">' + labelString + '</span>';
8732
+ this.taskBarHeight + 'px;"></span>';
8611
8733
  }
8612
8734
  }
8613
8735
  const template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
@@ -8633,6 +8755,7 @@ class ChartRows extends DateProcessor {
8633
8755
  data.ganttProperties.segments.length === 0))) {
8634
8756
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8635
8757
  let templateElement = this.createDivElement(template)[0];
8758
+ templateElement.innerText = labelString;
8636
8759
  let childLabel = this.parent.labelSettings.taskLabel;
8637
8760
  if (childLabel && childLabel['elementRef'])
8638
8761
  templateElement.appendChild(tempDiv);
@@ -9115,6 +9238,11 @@ class ChartRows extends DateProcessor {
9115
9238
  if (labelString) {
9116
9239
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
9117
9240
  leftLabelTemplateNode = this.getLableText(labelString, leftLabelInnerDiv);
9241
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
9242
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
9243
+ labelString = labelString === 'isCustomTemplate' ? field : labelString;
9244
+ leftLabelTemplateNode = this.getLableText(labelString, leftLabelInnerDiv);
9245
+ }
9118
9246
  }
9119
9247
  }
9120
9248
  if (leftLabelTemplateNode && leftLabelTemplateNode.length > 0) {
@@ -9165,6 +9293,11 @@ class ChartRows extends DateProcessor {
9165
9293
  if (labelString) {
9166
9294
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
9167
9295
  rightLabelTemplateNode = this.getLableText(labelString, rightLabelInnerDiv);
9296
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
9297
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
9298
+ labelString = labelString === 'isCustomTemplate' ? field : labelString;
9299
+ rightLabelTemplateNode = this.getLableText(labelString, rightLabelInnerDiv);
9300
+ }
9168
9301
  }
9169
9302
  }
9170
9303
  if (rightLabelTemplateNode && rightLabelTemplateNode.length > 0) {
@@ -9216,7 +9349,7 @@ class ChartRows extends DateProcessor {
9216
9349
  '<div class="' + manualParentMilestoneBottom + '" style="top:' +
9217
9350
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
9218
9351
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
9219
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : template);
9352
+ return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
9220
9353
  }
9221
9354
  /**
9222
9355
  * To get parent taskbar node.
@@ -9260,6 +9393,9 @@ class ChartRows extends DateProcessor {
9260
9393
  else {
9261
9394
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
9262
9395
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
9396
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
9397
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
9398
+ }
9263
9399
  }
9264
9400
  if (labelString.indexOf('null') === -1) {
9265
9401
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -9272,7 +9408,7 @@ class ChartRows extends DateProcessor {
9272
9408
  'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
9273
9409
  'display:' + 'inline-block;' +
9274
9410
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
9275
- this.taskBarHeight + 'px;">' + labelString + '</span>';
9411
+ this.taskBarHeight + 'px;"></span>';
9276
9412
  }
9277
9413
  else {
9278
9414
  labelDiv = '<span class="' +
@@ -9282,9 +9418,10 @@ class ChartRows extends DateProcessor {
9282
9418
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9283
9419
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
9284
9420
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9285
- this.taskBarHeight + 'px;">' + labelString + '</span>';
9421
+ this.taskBarHeight + 'px;"></span>';
9286
9422
  }
9287
9423
  let labelElement = this.createDivElement(labelDiv)[0];
9424
+ labelElement.innerText = labelString;
9288
9425
  let parentLabel = this.parent.labelSettings.taskLabel;
9289
9426
  if (parentLabel && parentLabel['elementRef'])
9290
9427
  labelElement.appendChild(div);
@@ -9451,7 +9588,7 @@ class ChartRows extends DateProcessor {
9451
9588
  const mileStoneLeft = -(this.connectorPointWidth + 2);
9452
9589
  const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
9453
9590
  let marginTop;
9454
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
9591
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
9455
9592
  marginTop = '';
9456
9593
  }
9457
9594
  else {
@@ -9470,7 +9607,7 @@ class ChartRows extends DateProcessor {
9470
9607
  const pointerRight = this.parent.isAdaptive ? 10 : -2;
9471
9608
  const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
9472
9609
  let marginTop;
9473
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
9610
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
9474
9611
  marginTop = '';
9475
9612
  }
9476
9613
  else {
@@ -9759,6 +9896,9 @@ class ChartRows extends DateProcessor {
9759
9896
  this.parent.renderTemplates();
9760
9897
  this.triggerQueryTaskbarInfo();
9761
9898
  this.parent.modifiedRecords = [];
9899
+ if (this.parent.viewType == 'ResourceView' && this.parent.showOverAllocation) {
9900
+ this.updateOverlapped();
9901
+ }
9762
9902
  if (collapsedResourceRecord.length) {
9763
9903
  for (let j = 0; j < collapsedResourceRecord.length; j++) {
9764
9904
  if (collapsedResourceRecord[j].hasChildRecords) {
@@ -9785,22 +9925,37 @@ class ChartRows extends DateProcessor {
9785
9925
  const taskbarContainerNode = this.taskbarContainer();
9786
9926
  taskbarContainerNode[0].setAttribute('aria-label', this.generateAriaLabel(this.templateData));
9787
9927
  taskbarContainerNode[0].setAttribute('rowUniqueId', this.templateData.ganttProperties.rowUniqueID);
9788
- const connectorLineLeftNode = this.getLeftPointNode();
9789
- if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
9928
+ let connectorLineLeftNode;
9929
+ if (!this.templateData.hasChildRecords && !this.parent.allowParentDependency) {
9930
+ const connectorLineLeftNode = this.getLeftPointNode();
9790
9931
  taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9791
9932
  }
9933
+ else if (this.parent.allowParentDependency) {
9934
+ connectorLineLeftNode = this.getLeftPointNode();
9935
+ if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
9936
+ taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9937
+ }
9938
+ }
9792
9939
  if (this.templateData.hasChildRecords) {
9793
9940
  const parentTaskbarTemplateNode = this.getParentTaskbarNode(i, taskbarContainerNode);
9941
+ const milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
9794
9942
  if (!this.templateData.ganttProperties.isAutoSchedule) {
9795
9943
  const manualTaskbar = this.getManualTaskbar();
9796
- manualTaskbar[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9797
- const connectorLineRightNode = this.getRightPointNode();
9798
- manualTaskbar[0].appendChild([].slice.call(connectorLineRightNode)[0]);
9799
- taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
9944
+ if (!isNullOrUndefined(manualTaskbar[0])) {
9945
+ if (this.parent.allowParentDependency) {
9946
+ manualTaskbar[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9947
+ const connectorLineRightNode = this.getRightPointNode();
9948
+ manualTaskbar[0].appendChild([].slice.call(connectorLineRightNode)[0]);
9949
+ }
9950
+ taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
9951
+ }
9800
9952
  }
9801
9953
  if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
9802
9954
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
9803
9955
  }
9956
+ else if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
9957
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
9958
+ }
9804
9959
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
9805
9960
  this.templateData.ganttProperties.baselineEndDate) {
9806
9961
  taskBaselineTemplateNode = ((this.templateData.ganttProperties.baselineStartDate.getTime() === this.templateData.ganttProperties.baselineEndDate.getTime()) || ((!isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate) && !isNullOrUndefined(this.templateData.ganttProperties.startDate) && (this.templateData.ganttProperties.baselineStartDate.getTime() === this.templateData.ganttProperties.startDate.getTime()))
@@ -9870,8 +10025,13 @@ class ChartRows extends DateProcessor {
9870
10025
  ? this.getMilestoneBaselineNode() : this.getTaskBaselineNode();
9871
10026
  }
9872
10027
  }
9873
- if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
9874
- const connectorLineRightNode = this.getRightPointNode();
10028
+ let connectorLineRightNode;
10029
+ if (this.parent.allowParentDependency && ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords)) {
10030
+ connectorLineRightNode = this.getRightPointNode();
10031
+ taskbarContainerNode[0].appendChild([].slice.call(connectorLineRightNode)[0]);
10032
+ }
10033
+ else if (!this.parent.allowParentDependency) {
10034
+ connectorLineRightNode = this.getRightPointNode();
9875
10035
  taskbarContainerNode[0].appendChild([].slice.call(connectorLineRightNode)[0]);
9876
10036
  }
9877
10037
  const rightLabelNode = this.getRightLabelNode(i);
@@ -9892,6 +10052,10 @@ class ChartRows extends DateProcessor {
9892
10052
  else {
9893
10053
  const text = createElement('Text');
9894
10054
  text.innerHTML = indicators[indicatorIndex].name;
10055
+ if (this.parent.enableHtmlSanitizer && typeof (indicators[indicatorIndex].name) === 'string') {
10056
+ indicators[indicatorIndex].name = SanitizeHtmlHelper.sanitize(indicators[indicatorIndex].name);
10057
+ text.innerText = indicators[indicatorIndex].name;
10058
+ }
9895
10059
  taskIndicatorTextNode = text.childNodes;
9896
10060
  }
9897
10061
  taskIndicatorNode[0].appendChild([].slice.call(taskIndicatorTextNode)[0]);
@@ -9984,7 +10148,7 @@ class ChartRows extends DateProcessor {
9984
10148
  getComputedStyle(trElement.querySelector(classCollections[1])).borderBottomColor :
9985
10149
  (trElement.querySelector('.' + baselineBar) ? getComputedStyle(trElement.querySelector('.' + baselineBar)).backgroundColor : null);
9986
10150
  }
9987
- else {
10151
+ else if (taskbarElement) {
9988
10152
  const childTask = taskbarElement.querySelector(classCollections[0]);
9989
10153
  const progressTask = taskbarElement.querySelector(classCollections[1]);
9990
10154
  args.taskbarBgColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(traceChildTaskBar) ?
@@ -10063,7 +10227,7 @@ class ChartRows extends DateProcessor {
10063
10227
  trElement.querySelector('.' + baselineBar).style.backgroundColor = args.baselineColor;
10064
10228
  }
10065
10229
  }
10066
- else {
10230
+ else if (taskbarElement) {
10067
10231
  if (taskbarElement.querySelector(classCollections[0]) &&
10068
10232
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
10069
10233
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -10165,6 +10329,78 @@ class ChartRows extends DateProcessor {
10165
10329
  }
10166
10330
  return null;
10167
10331
  }
10332
+ // to update the eOverlapped property
10333
+ updateOverlapped() {
10334
+ for (let k = 0; k < this.parent.treeGrid.parentData.length; k++) {
10335
+ let childRecords = this.parent.treeGrid.parentData[k].childRecords;
10336
+ for (let i = 0; i < childRecords.length; i++) {
10337
+ if (childRecords[i + 1]) {
10338
+ childRecords[i].ganttProperties.eOverlapped = undefined;
10339
+ }
10340
+ for (let j = i + 1; j < childRecords.length; j++) {
10341
+ childRecords[j].ganttProperties.eOverlapped = undefined;
10342
+ if (childRecords[i].ganttProperties.startDate.getTime() < childRecords[j].ganttProperties.endDate.getTime() &&
10343
+ childRecords[i].ganttProperties.endDate.getTime() > childRecords[j].ganttProperties.startDate.getTime()) {
10344
+ childRecords[j].ganttProperties.eOverlapped = true;
10345
+ childRecords[i].ganttProperties.eOverlapped = true;
10346
+ }
10347
+ else {
10348
+ if (isNullOrUndefined(childRecords[j].ganttProperties.eOverlapped)) {
10349
+ childRecords[j].ganttProperties.eOverlapped = false;
10350
+ }
10351
+ if (isNullOrUndefined(childRecords[i].ganttProperties.eOverlapped)) {
10352
+ childRecords[i].ganttProperties.eOverlapped = false;
10353
+ }
10354
+ }
10355
+ }
10356
+ }
10357
+ }
10358
+ }
10359
+ // To update the row height when allow overallocation set to false
10360
+ updateDragDropRecords(data, tr) {
10361
+ let childRecords = data.childRecords;
10362
+ let rowIndex = this.parent.currentViewData.indexOf(data);
10363
+ let treeGridContentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
10364
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
10365
+ if (!tr) {
10366
+ tr = this.ganttChartTableBody.childNodes[rowIndex];
10367
+ }
10368
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = this.parent.rowHeight + 'px';
10369
+ this.parent.contentHeight = treeGridContentHeight;
10370
+ let rowIDs = [];
10371
+ let rowCounts = 0;
10372
+ if (data) {
10373
+ for (let i = 0; i < childRecords.length; i++) {
10374
+ for (let j = i + 1; j < childRecords.length; j++) {
10375
+ let taskbarContainer = tr.getElementsByClassName('e-taskbar-main-container');
10376
+ for (let k = 0; k < taskbarContainer.length; k++) {
10377
+ if (childRecords[i].ganttProperties.startDate.getTime() < childRecords[j].ganttProperties.endDate.getTime() &&
10378
+ childRecords[i].ganttProperties.endDate.getTime() > childRecords[j].ganttProperties.startDate.getTime()) {
10379
+ if (taskbarContainer[k].getAttribute('rowuniqueid') === childRecords[j]['rowUniqueID'] &&
10380
+ rowIDs.indexOf(childRecords[j]['rowUniqueID']) == -1) {
10381
+ rowIDs.push(childRecords[j]['rowUniqueID']);
10382
+ rowCounts++;
10383
+ tr.children[0]['style'].verticalAlign = 'baseline';
10384
+ tr.getElementsByClassName('e-taskbar-main-container')[k]['style'].marginTop = (rowCounts * this.parent.rowHeight) + this.taskBarMarginTop + 'px';
10385
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = parseInt(tr['style'].height) + this.parent.rowHeight + 'px';
10386
+ }
10387
+ }
10388
+ else {
10389
+ if (taskbarContainer[k].getAttribute('rowuniqueid') === childRecords[j]['rowUniqueID'] &&
10390
+ rowIDs.indexOf(childRecords[j]['rowUniqueID']) == -1 && this.parent.rowDragAndDropModule &&
10391
+ this.parent.rowDragAndDropModule['draggedRecord'] && taskbarContainer[k].getAttribute('rowuniqueid') ===
10392
+ this.parent.rowDragAndDropModule['draggedRecord']['rowUniqueID'] && this.parent.rowDragAndDropModule['draggedRecord']['rowUniqueID'] === childRecords[j]['rowUniqueID']) {
10393
+ tr.getElementsByClassName('e-taskbar-main-container')[k]['style'].marginTop =
10394
+ this.parent.editModule.taskbarEditModule.draggedRecordMarginTop;
10395
+ }
10396
+ }
10397
+ }
10398
+ }
10399
+ }
10400
+ this.parent.contentHeight = treeGridContentHeight;
10401
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
10402
+ }
10403
+ }
10168
10404
  /**
10169
10405
  * To refresh edited TR
10170
10406
  *
@@ -10178,14 +10414,22 @@ class ChartRows extends DateProcessor {
10178
10414
  const selectedItem = this.parent.currentViewData[index];
10179
10415
  if (index !== -1 && selectedItem) {
10180
10416
  const data = selectedItem;
10417
+ if (!this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView' && data.expanded) {
10418
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(index)['style'].height = this.parent.rowHeight + 'px';
10419
+ }
10181
10420
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar) {
10182
10421
  tr.replaceChild(this.getResourceParent(data).childNodes[0], tr.childNodes[0]);
10183
10422
  }
10184
10423
  else {
10185
- tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
10424
+ if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && !data.expanded) {
10425
+ tr.replaceWith(this.getGanttChartRow(index, data));
10426
+ }
10427
+ else {
10428
+ tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
10429
+ }
10186
10430
  }
10187
10431
  this.parent.renderTemplates();
10188
- if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation) {
10432
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && this.parent.allowTaskbarOverlap) {
10189
10433
  if (isValidateRange) {
10190
10434
  this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
10191
10435
  }
@@ -10207,6 +10451,12 @@ class ChartRows extends DateProcessor {
10207
10451
  }
10208
10452
  const dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
10209
10453
  this.parent.treeGrid.grid.setRowData(dataId, data);
10454
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap) {
10455
+ this.updateDragDropRecords(selectedItem, tr);
10456
+ }
10457
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
10458
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
10459
+ }
10210
10460
  let nextEditableElement = this.parent.ganttChartModule.tempNextElement;
10211
10461
  if (this.parent.ganttChartModule.isEditableElement && nextEditableElement) {
10212
10462
  this.parent.treeGrid.grid.focusModule.focus();
@@ -10220,7 +10470,7 @@ class ChartRows extends DateProcessor {
10220
10470
  getResourceParent(record) {
10221
10471
  const chartRows = this.parent.ganttChartModule.getChartRows();
10222
10472
  //Below code is for rendering taskbartemplate in resource view with multi taskbar
10223
- if (this.parent.initialChartRowElements) {
10473
+ if (this.parent.initialChartRowElements && (!this.parent.allowTaskbarDragAndDrop && this.parent.allowTaskbarOverlap)) {
10224
10474
  for (let j = 0; j < this.parent.initialChartRowElements.length; j++) {
10225
10475
  if (!isNullOrUndefined(chartRows[j])) {
10226
10476
  if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
@@ -10248,7 +10498,7 @@ class ChartRows extends DateProcessor {
10248
10498
  const id = chartRows[i].querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
10249
10499
  const ganttData = this.parent.getRecordByID(id);
10250
10500
  let zIndex = "";
10251
- if (ganttData && ganttData.ganttProperties.eOverlapIndex) {
10501
+ if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
10252
10502
  zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
10253
10503
  }
10254
10504
  const cloneChildElement = cloneElement.cloneNode(true);
@@ -10395,7 +10645,9 @@ class Dependency {
10395
10645
  for (let count = length; count >= 0; count--) {
10396
10646
  const ganttData = predecessorTasks[count];
10397
10647
  const ganttProp = ganttData.ganttProperties;
10398
- this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
10648
+ if ((!ganttData.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
10649
+ this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
10650
+ }
10399
10651
  }
10400
10652
  }
10401
10653
  /**
@@ -10557,18 +10809,26 @@ class Dependency {
10557
10809
  offsetUnit: offsetUnits.durationUnit,
10558
10810
  offset: offsetUnits.duration
10559
10811
  };
10560
- let fromData = this.parent.connectorLineModule.getRecordByID(obj.to);
10561
- let toData = this.parent.connectorLineModule.getRecordByID(obj.from);
10562
- let isValid;
10563
- if (this.parent.connectorLineEditModule && toData && fromData) {
10564
- isValid = this.parent.connectorLineEditModule.validateParentPredecessor(toData, fromData);
10565
- if (isValid)
10812
+ const isOwnParent = this.checkIsParent(match[0]);
10813
+ if (!this.parent.allowParentDependency) {
10814
+ if (!isOwnParent) {
10566
10815
  collection.push(obj);
10816
+ }
10567
10817
  }
10568
10818
  else {
10569
- collection.push(obj);
10819
+ let fromData = this.parent.connectorLineModule.getRecordByID(obj.to);
10820
+ let toData = this.parent.connectorLineModule.getRecordByID(obj.from);
10821
+ let isValid;
10822
+ if (this.parent.connectorLineEditModule && toData && fromData) {
10823
+ isValid = this.parent.connectorLineEditModule.validateParentPredecessor(toData, fromData);
10824
+ if (isValid)
10825
+ collection.push(obj);
10826
+ }
10827
+ else {
10828
+ collection.push(obj);
10829
+ }
10830
+ match.splice(0);
10570
10831
  }
10571
- match.splice(0);
10572
10832
  });
10573
10833
  return collection;
10574
10834
  }
@@ -10691,7 +10951,9 @@ class Dependency {
10691
10951
  const length = predecessorsCollection.length;
10692
10952
  for (let count = 0; count < length; count++) {
10693
10953
  ganttRecord = predecessorsCollection[count];
10694
- this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
10954
+ if ((!ganttRecord.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
10955
+ this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
10956
+ }
10695
10957
  }
10696
10958
  }
10697
10959
  /**
@@ -10740,12 +11002,16 @@ class Dependency {
10740
11002
  * @private
10741
11003
  */
10742
11004
  updatedRecordsDateByPredecessor() {
11005
+ if (!this.parent.autoCalculateDateScheduling) {
11006
+ return;
11007
+ }
10743
11008
  const flatData = this.parent.flatData;
10744
11009
  const totLength = this.parent.flatData.length;
10745
11010
  for (let count = 0; count < totLength; count++) {
10746
11011
  if (flatData[count].ganttProperties.predecessorsName) {
10747
11012
  this.validatePredecessorDates(flatData[count]);
10748
- if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks) {
11013
+ if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks
11014
+ && this.parent.allowParentDependency) {
10749
11015
  this.parent.editModule['updateChildItems'](flatData[count]);
10750
11016
  }
10751
11017
  }
@@ -10790,7 +11056,7 @@ class Dependency {
10790
11056
  const predecessor = predecessors[count];
10791
11057
  parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor.from);
10792
11058
  record = this.parent.connectorLineModule.getRecordByID(predecessor.to);
10793
- if (this.parent.isLoad && this.parentPredecessors.indexOf(ganttRecord) == -1
11059
+ if (this.parent.allowParentDependency && this.parent.isLoad && this.parentPredecessors.indexOf(ganttRecord) == -1
10794
11060
  && (ganttRecord.hasChildRecords || record.hasChildRecords)) {
10795
11061
  this.parentPredecessors.push(ganttRecord);
10796
11062
  }
@@ -11471,9 +11737,16 @@ class ConnectorLine {
11471
11737
  * @private
11472
11738
  */
11473
11739
  getHeightValue(data) {
11474
- return (data.parentIndex * data.rowHeight) > (data.childIndex * data.rowHeight) ?
11475
- ((data.parentIndex * data.rowHeight) - (data.childIndex * data.rowHeight)) :
11476
- ((data.childIndex * data.rowHeight) - (data.parentIndex * data.rowHeight));
11740
+ if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
11741
+ return (data.parentIndex * this.parent.rowHeight) > (data.childIndex * this.parent.rowHeight) ?
11742
+ ((data.parentIndex * this.parent.rowHeight) - (data.childIndex * this.parent.rowHeight)) :
11743
+ ((data.childIndex * this.parent.rowHeight) - (data.parentIndex * this.parent.rowHeight));
11744
+ }
11745
+ else {
11746
+ return (data.parentIndex * data.rowHeight) > (data.childIndex * data.rowHeight) ?
11747
+ ((data.parentIndex * data.rowHeight) - (data.childIndex * data.rowHeight)) :
11748
+ ((data.childIndex * data.rowHeight) - (data.parentIndex * data.rowHeight));
11749
+ }
11477
11750
  }
11478
11751
  /**
11479
11752
  * To get sstype2 inner element width.
@@ -11547,10 +11820,33 @@ class ConnectorLine {
11547
11820
  if (this.parent.renderBaseline) {
11548
11821
  isMilestoneValue = (data.milestoneParent && data.milestoneChild) ? 0 : data.milestoneParent ? -5 : data.milestoneChild ? 5 : 0;
11549
11822
  }
11550
- const heightValue = isVirtual ? connectorLine$$1.height : (height + isMilestoneValue);
11823
+ let heightValue = isVirtual ? connectorLine$$1.height : (height + isMilestoneValue);
11551
11824
  let borderTopWidth = 0;
11552
11825
  let addTop = 0;
11553
- if (this.parent.currentViewData[data.parentIndex] && this.parent.currentViewData[data.childIndex]) {
11826
+ let parentOverlapTopValue = 0;
11827
+ let childOverlapTopValue = 0;
11828
+ let count = 0;
11829
+ if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
11830
+ for (let i = 0; i < this.parent.currentViewData.length; i++) {
11831
+ if (this.parent.getRowByIndex(i).style.display != 'none') {
11832
+ if (count < data.parentIndex) {
11833
+ count++;
11834
+ parentOverlapTopValue = parentOverlapTopValue + this.parent.getRowByIndex(i).offsetHeight;
11835
+ }
11836
+ }
11837
+ }
11838
+ count = 0;
11839
+ for (let j = 0; j < this.parent.currentViewData.length; j++) {
11840
+ if (this.parent.getRowByIndex(j).style.display != 'none') {
11841
+ if (count < data.childIndex) {
11842
+ count++;
11843
+ childOverlapTopValue = childOverlapTopValue + this.parent.getRowByIndex(j).offsetHeight;
11844
+ }
11845
+ }
11846
+ }
11847
+ heightValue = Math.abs(parentOverlapTopValue - childOverlapTopValue);
11848
+ }
11849
+ if (this.parent.currentViewData[data.parentIndex] && this.parent.currentViewData[data.childIndex] && this.parent.allowParentDependency) {
11554
11850
  let fromRecordIsParent = this.parent.currentViewData[data.parentIndex].hasChildRecords;
11555
11851
  let toRecordIsParent = this.parent.currentViewData[data.childIndex].hasChildRecords;
11556
11852
  let fromRecordIsManual = this.parent.currentViewData[data.parentIndex].ganttProperties.isAutoSchedule;
@@ -11643,7 +11939,7 @@ class ConnectorLine {
11643
11939
  this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
11644
11940
  if (this.getParentPosition(data) === 'FSType1') {
11645
11941
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11646
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11942
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11647
11943
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType1">';
11648
11944
  div = div + eLine;
11649
11945
  div = div + direction + (isMilestoneParent ? -1 : 0) + 'px;width:' + (isMilestoneParent ?
@@ -11663,7 +11959,7 @@ class ConnectorLine {
11663
11959
  'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
11664
11960
  }
11665
11961
  if (this.getParentPosition(data) === 'FSType2') {
11666
- div = div + direction + data.parentLeft + 'px;top:' + (isVirtual ? connectorLine$$1.top : ((data.parentIndex * data.rowHeight) + addTop +
11962
+ div = div + direction + data.parentLeft + 'px;top:' + (isVirtual ? connectorLine$$1.top : ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
11667
11963
  this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11668
11964
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType2">';
11669
11965
  div = div + eLine;
@@ -11695,7 +11991,7 @@ class ConnectorLine {
11695
11991
  }
11696
11992
  if (this.getParentPosition(data) === 'FSType3') {
11697
11993
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11698
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11994
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11699
11995
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType3">';
11700
11996
  div = div + rightArrow;
11701
11997
  div = div + direction + '10px;' + this.getBorderStyles((this.parent.enableRtl ? 'right' : 'left'), 10) +
@@ -11725,7 +12021,7 @@ class ConnectorLine {
11725
12021
  }
11726
12022
  if (this.getParentPosition(data) === 'FSType4') {
11727
12023
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11728
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12024
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11729
12025
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType4">';
11730
12026
  div = div + rightArrow;
11731
12027
  div = div + direction + (data.childLeft - (data.parentLeft + data.parentWidth + 10)) + 'px;' +
@@ -11751,7 +12047,7 @@ class ConnectorLine {
11751
12047
  }
11752
12048
  if (this.getParentPosition(data) === 'SSType4') {
11753
12049
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11754
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12050
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11755
12051
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType4">';
11756
12052
  div = div + rightArrow;
11757
12053
  div = div + direction + (data.childLeft - data.parentLeft) + 'px;' + duplicateStingTwo;
@@ -11764,7 +12060,7 @@ class ConnectorLine {
11764
12060
  }
11765
12061
  if (this.getParentPosition(data) === 'SSType3') {
11766
12062
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11767
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12063
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11768
12064
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType3">';
11769
12065
  div = div + rightArrow;
11770
12066
  div = div + direction + '10px;' + duplicateStingTwo;
@@ -11777,7 +12073,7 @@ class ConnectorLine {
11777
12073
  }
11778
12074
  if (this.getParentPosition(data) === 'SSType2') {
11779
12075
  div = div + direction + setInnerElementLeftSSType2 + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11780
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12076
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11781
12077
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType2">';
11782
12078
  div = div + eLine;
11783
12079
  div = div + 'width:' + (setInnerChildWidthSSType2 + 1) + 'px;' +
@@ -11797,7 +12093,7 @@ class ConnectorLine {
11797
12093
  }
11798
12094
  if (this.getParentPosition(data) === 'SSType1') {
11799
12095
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11800
- ((data.parentIndex * data.rowHeight) + addTop +
12096
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
11801
12097
  this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11802
12098
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType1">';
11803
12099
  div = div + eLine;
@@ -11815,7 +12111,7 @@ class ConnectorLine {
11815
12111
  }
11816
12112
  if (this.getParentPosition(data) === 'FFType1') {
11817
12113
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11818
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12114
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11819
12115
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType1">';
11820
12116
  div = div + eLine;
11821
12117
  div = div + direction + (isMilestoneParent ? (((data.parentLeft + data.parentWidth) -
@@ -11839,7 +12135,7 @@ class ConnectorLine {
11839
12135
  }
11840
12136
  if (this.getParentPosition(data) === 'FFType2') {
11841
12137
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11842
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12138
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11843
12139
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType2">';
11844
12140
  div = div + eLine;
11845
12141
  div = div + (isMilestoneParent ? direction + '-1px;' : '') + 'width:' +
@@ -11865,7 +12161,7 @@ class ConnectorLine {
11865
12161
  }
11866
12162
  if (this.getParentPosition(data) === 'FFType3') {
11867
12163
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11868
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12164
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11869
12165
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType3">';
11870
12166
  div = div + duplicateStingOne;
11871
12167
  div = div + eLine;
@@ -11888,7 +12184,7 @@ class ConnectorLine {
11888
12184
  }
11889
12185
  if (this.getParentPosition(data) === 'FFType4') {
11890
12186
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11891
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12187
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11892
12188
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType4">';
11893
12189
  div = div + leftArrow;
11894
12190
  div = div + (direction + ((data.childLeft + data.childWidth) -
@@ -11917,7 +12213,7 @@ class ConnectorLine {
11917
12213
  }
11918
12214
  if (this.getParentPosition(data) === 'SFType4') {
11919
12215
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11920
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;width:1px;' +
12216
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;width:1px;' +
11921
12217
  'height:' + heightValue + 'px;position:absolute" data-connectortype="SFType4">';
11922
12218
  div = div + duplicateStingFour + 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;' +
11923
12219
  'border-bottom-width:' + (5 + this.lineStroke) +
@@ -11945,7 +12241,7 @@ class ConnectorLine {
11945
12241
  }
11946
12242
  if (this.getParentPosition(data) === 'SFType3') {
11947
12243
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11948
- ((data.childIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12244
+ ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11949
12245
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType3">';
11950
12246
  div = div + duplicateStingOne;
11951
12247
  div = div + eLine;
@@ -11963,7 +12259,7 @@ class ConnectorLine {
11963
12259
  }
11964
12260
  if (this.getParentPosition(data) === 'SFType1') {
11965
12261
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11966
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12262
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11967
12263
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType1">';
11968
12264
  div = div + eLine;
11969
12265
  div = div + 'width:11px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
@@ -11988,7 +12284,7 @@ class ConnectorLine {
11988
12284
  }
11989
12285
  if (this.getParentPosition(data) === 'SFType2') {
11990
12286
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11991
- ((data.parentIndex * data.rowHeight) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
12287
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11992
12288
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType2">';
11993
12289
  div = div + eLine;
11994
12290
  div = div + direction + (((data.parentLeft) - (data.childLeft + data.childWidth)) - 10) +
@@ -12381,7 +12677,7 @@ class Tooltip$1 {
12381
12677
  this.toolTipObj.position = 'BottomCenter';
12382
12678
  this.toolTipObj.openDelay = 700;
12383
12679
  this.toolTipObj.enableRtl = this.parent.enableRtl;
12384
- this.toolTipObj.enableHtmlSanitizer = false;
12680
+ this.toolTipObj.enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
12385
12681
  this.toolTipObj.cssClass = ganttTooltip;
12386
12682
  this.toolTipObj.animation = { open: { effect: 'None', delay: 0 }, close: { effect: 'None', delay: 0 } };
12387
12683
  this.toolTipObj.afterOpen = this.updateTooltipPosition.bind(this);
@@ -12594,8 +12890,12 @@ class Tooltip$1 {
12594
12890
  let taskName;
12595
12891
  if (ganttData) {
12596
12892
  data = ganttData.ganttProperties;
12597
- taskName = !isNullOrUndefined(data.taskName) ? '<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">' +
12598
- (this.parent.disableHtmlEncode ? data.taskName.replace(/</g, "&lt;").replace(/>/g, "&gt;") : data.taskName) + '</td></tr>' : '';
12893
+ let taskNameValue = data.taskName;
12894
+ if (this.parent.enableHtmlSanitizer && typeof (taskNameValue) === 'string') {
12895
+ taskNameValue = SanitizeHtmlHelper.sanitize(taskNameValue);
12896
+ }
12897
+ taskName = !isNullOrUndefined(taskNameValue) ? '<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">' +
12898
+ (this.parent.disableHtmlEncode ? taskNameValue.replace(/</g, "&lt;").replace(/>/g, "&gt;") : taskNameValue) + '</td></tr>' : '';
12599
12899
  }
12600
12900
  switch (elementType) {
12601
12901
  case 'milestone':
@@ -12607,9 +12907,13 @@ class Tooltip$1 {
12607
12907
  else if (!isNullOrUndefined(data.startDate)) {
12608
12908
  milestoneStartDate = data.startDate;
12609
12909
  }
12610
- const sDate = !isNullOrUndefined(milestoneStartDate) ? '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
12910
+ let sDateValue = this.parent.getFormatedDate(milestoneStartDate, this.parent.getDateFormat());
12911
+ if (this.parent.enableHtmlSanitizer && typeof (sDateValue) === 'string') {
12912
+ sDateValue = SanitizeHtmlHelper.sanitize(sDateValue);
12913
+ }
12914
+ let sDate = !isNullOrUndefined(milestoneStartDate) ? '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
12611
12915
  '<td class = "e-gantt-tooltip-value">' +
12612
- this.parent.getFormatedDate(milestoneStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12916
+ sDateValue + '</td></tr>' : '';
12613
12917
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12614
12918
  taskName + sDate + '</tbody></table>';
12615
12919
  break;
@@ -12617,20 +12921,28 @@ class Tooltip$1 {
12617
12921
  case 'taskbar':
12618
12922
  {
12619
12923
  const scheduledTask = !ganttData.hasChildRecords || data.isAutoSchedule ? true : false;
12620
- const startDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12924
+ let startDateValue = this.parent.getFormatedDate(scheduledTask ? data.startDate : data.autoStartDate, this.parent.getDateFormat());
12925
+ let endDateValue = this.parent.getFormatedDate(scheduledTask ? data.endDate : data.autoEndDate, this.parent.getDateFormat());
12926
+ let durationValue = this.parent.getDurationString((scheduledTask ? data.duration : data.autoDuration), data.durationUnit);
12927
+ let progressValue = data.progress;
12928
+ if (this.parent.enableHtmlSanitizer) {
12929
+ startDateValue = typeof (startDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(startDateValue) : startDateValue;
12930
+ endDateValue = typeof (endDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(endDateValue) : endDateValue;
12931
+ durationValue = typeof (durationValue) === 'string' ? SanitizeHtmlHelper.sanitize(durationValue) : durationValue;
12932
+ progressValue = typeof (progressValue) === 'string' ? SanitizeHtmlHelper.sanitize(progressValue) : progressValue;
12933
+ }
12934
+ let startDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12621
12935
  this.parent.localeObj.getConstant(scheduledTask ? 'startDate' : 'subTasksStartDate') +
12622
- '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12623
- this.parent.getFormatedDate(scheduledTask ? data.startDate : data.autoStartDate, this.parent.getDateFormat()) +
12624
- '</td></tr>' : '';
12625
- const endDate = data.endDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12936
+ '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' + startDateValue + '</td></tr>' : '';
12937
+ let endDate = data.endDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12626
12938
  this.parent.localeObj.getConstant(scheduledTask ? 'endDate' : 'subTasksEndDate') +
12627
- '</td><td>:</td><td class = "e-gantt-tooltip-value">' + this.parent.getFormatedDate(scheduledTask ? data.endDate : data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12628
- const duration = !isNullOrUndefined(data.duration) ? '<tr><td class = "e-gantt-tooltip-label">' +
12939
+ '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' + endDateValue + '</td></tr>' : '';
12940
+ let duration = !isNullOrUndefined(data.duration) ? '<tr><td class = "e-gantt-tooltip-label">' +
12629
12941
  this.parent.localeObj.getConstant('duration') + '</td><td>:</td>' +
12630
- '<td class = "e-gantt-tooltip-value"> ' + this.parent.getDurationString((scheduledTask ? data.duration : data.autoDuration), data.durationUnit) +
12942
+ '<td class = "e-gantt-tooltip-value"> ' + durationValue +
12631
12943
  '</td></tr>' : '';
12632
- const progress = !isNullOrUndefined(data.progress) ? '<tr><td class = "e-gantt-tooltip-label">' +
12633
- this.parent.localeObj.getConstant('progress') + '</td><td>:</td><td>' + data.progress +
12944
+ let progress = !isNullOrUndefined(data.progress) ? '<tr><td class = "e-gantt-tooltip-label">' +
12945
+ this.parent.localeObj.getConstant('progress') + '</td><td>:</td><td>' + progressValue +
12634
12946
  '</td></tr>' : '';
12635
12947
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12636
12948
  taskName + startDate + endDate + duration + progress + '</tbody></table>';
@@ -12638,82 +12950,131 @@ class Tooltip$1 {
12638
12950
  }
12639
12951
  case 'baseline':
12640
12952
  {
12953
+ let baselineStartDateValue = this.parent.getFormatedDate(data.baselineStartDate, this.parent.getDateFormat());
12954
+ let baselineEndDateValue = this.parent.getFormatedDate(data.baselineEndDate, this.parent.getDateFormat());
12955
+ if (this.parent.enableHtmlSanitizer) {
12956
+ baselineStartDateValue = typeof (baselineStartDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(baselineStartDateValue) : baselineStartDateValue;
12957
+ baselineEndDateValue = typeof (baselineEndDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(baselineEndDateValue) : baselineEndDateValue;
12958
+ }
12641
12959
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12642
12960
  taskName + '<tr><td class = "e-gantt-tooltip-label">' +
12643
12961
  this.parent.localeObj.getConstant('baselineStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12644
- this.parent.getFormatedDate(data.baselineStartDate, this.parent.getDateFormat()) + '</td></tr><tr>' +
12962
+ baselineStartDateValue + '</td></tr><tr>' +
12645
12963
  '<td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('baselineEndDate') +
12646
12964
  '</td><td>:</td><td class = "e-gantt-tooltip-value">' +
12647
- this.parent.getFormatedDate(data.baselineEndDate, this.parent.getDateFormat()) + '</td></tr></tbody></table>';
12965
+ baselineEndDateValue + '</td></tr></tbody></table>';
12648
12966
  break;
12649
12967
  }
12650
12968
  case 'marker':
12651
12969
  {
12652
12970
  const markerTooltipElement = parent.tooltipModule.getMarkerTooltipData(args);
12653
- const markerLabel = markerTooltipElement.label ? markerTooltipElement.label : '';
12971
+ let markerTooltipElementValue = this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(markerTooltipElement.day), this.parent.getDateFormat());
12972
+ let markerLabel = markerTooltipElement.label ? markerTooltipElement.label : '';
12973
+ if (this.parent.enableHtmlSanitizer) {
12974
+ markerLabel = typeof (markerLabel) === 'string' ? SanitizeHtmlHelper.sanitize(markerLabel) : markerLabel;
12975
+ markerTooltipElementValue = typeof (markerTooltipElementValue) === 'string' ? SanitizeHtmlHelper.sanitize(markerTooltipElementValue) : markerTooltipElementValue;
12976
+ }
12654
12977
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr><td>' +
12655
- this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(markerTooltipElement.day), this.parent.getDateFormat()) +
12656
- '</td></tr><tr><td>' +
12657
- markerLabel + '</td></tr></tbody></table>';
12978
+ markerTooltipElementValue + '</td></tr><tr><td>' + (this.parent.disableHtmlEncode ? markerLabel.replace(/</g, "&lt;").replace(/>/g, "&gt;") : markerLabel) + '</td></tr></tbody></table>';
12658
12979
  break;
12659
12980
  }
12660
12981
  case 'connectorLine':
12661
12982
  {
12983
+ let fromNameValue = parent.tooltipModule.predecessorTooltipData.fromName;
12984
+ let fromIdValue = parent.tooltipModule.predecessorTooltipData.fromId;
12985
+ let toNameValue = parent.tooltipModule.predecessorTooltipData.toName;
12986
+ let toIdValue = parent.tooltipModule.predecessorTooltipData.toId;
12987
+ let linkTextValue = parent.tooltipModule.predecessorTooltipData.linkText;
12988
+ let offsetStringValue = parent.tooltipModule.predecessorTooltipData.offsetString;
12989
+ if (this.parent.enableHtmlSanitizer) {
12990
+ fromNameValue = typeof (fromNameValue) === 'string' ? SanitizeHtmlHelper.sanitize(fromNameValue) : fromNameValue;
12991
+ fromIdValue = typeof (fromIdValue) === 'string' ? SanitizeHtmlHelper.sanitize(fromIdValue) : fromIdValue;
12992
+ toNameValue = typeof (toNameValue) === 'string' ? SanitizeHtmlHelper.sanitize(toNameValue) : toNameValue;
12993
+ toIdValue = typeof (toIdValue) === 'string' ? SanitizeHtmlHelper.sanitize(toIdValue) : toIdValue;
12994
+ linkTextValue = typeof (linkTextValue) === 'string' ? SanitizeHtmlHelper.sanitize(linkTextValue) : linkTextValue;
12995
+ offsetStringValue = typeof (offsetStringValue) === 'string' ? SanitizeHtmlHelper.sanitize(offsetStringValue) : offsetStringValue;
12996
+ }
12662
12997
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">' +
12663
12998
  this.parent.localeObj.getConstant('from') + '</td><td>:</td>' +
12664
- '<td class = "e-gantt-tooltip-value">' + parent.tooltipModule.predecessorTooltipData.fromName + ' (' +
12665
- parent.tooltipModule.predecessorTooltipData.fromId + ')' + '</td></tr><tr><td class = "e-gantt-tooltip-label">' +
12999
+ '<td class = "e-gantt-tooltip-value">' + (this.parent.disableHtmlEncode ? fromNameValue.replace(/</g, "&lt;").replace(/>/g, "&gt;") : fromNameValue) + ' (' +
13000
+ (this.parent.disableHtmlEncode ? (typeof (fromIdValue) === 'string' ? fromIdValue.replace(/</g, "&lt;").replace(/>/g, "&gt;") : fromIdValue) : fromIdValue) + ')' + '</td></tr><tr><td class = "e-gantt-tooltip-label">' +
12666
13001
  this.parent.localeObj.getConstant('to') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12667
- parent.tooltipModule.predecessorTooltipData.toName +
12668
- ' (' + parent.tooltipModule.predecessorTooltipData.toId + ')' +
12669
- '</td></tr><tr><td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('taskLink') +
12670
- '</td><td>:</td><td class = "e-gantt-tooltip-value"> ' + parent.tooltipModule.predecessorTooltipData.linkText +
13002
+ (this.parent.disableHtmlEncode ? toNameValue.replace(/</g, "&lt;").replace(/>/g, "&gt;") : toNameValue) + ' (' + toIdValue + ')' + '</td></tr><tr><td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('taskLink') +
13003
+ '</td><td>:</td><td class = "e-gantt-tooltip-value"> ' + linkTextValue +
12671
13004
  '</td></tr><tr><td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('lag') +
12672
13005
  '</td><td>:</td><td class = "e-gantt-tooltip-value">' +
12673
- parent.tooltipModule.predecessorTooltipData.offsetString + '</td></tr></tbody></table>';
13006
+ offsetStringValue + '</td></tr></tbody></table>';
12674
13007
  break;
12675
13008
  }
12676
13009
  case 'indicator':
12677
13010
  if (args.target.title.length) {
12678
- content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr>' + args.target.title + '</tr></tbody></table>';
13011
+ let titleValue = args.target.title;
13012
+ if (this.parent.enableHtmlSanitizer && typeof (titleValue) === 'string') {
13013
+ titleValue = SanitizeHtmlHelper.sanitize(titleValue);
13014
+ }
13015
+ content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr>' + titleValue + '</tr></tbody></table>';
12679
13016
  }
12680
13017
  break;
12681
13018
  case 'timeline':
12682
- content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr>' + args.target.title + '</tr></tbody></table>';
13019
+ let timlineTitleValue = args.target.title;
13020
+ if (this.parent.enableHtmlSanitizer && typeof (timlineTitleValue) === 'string') {
13021
+ timlineTitleValue = SanitizeHtmlHelper.sanitize(timlineTitleValue);
13022
+ }
13023
+ content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr>' + timlineTitleValue + '</tr></tbody></table>';
12683
13024
  break;
12684
13025
  case 'manualtaskbar':
12685
13026
  {
12686
- const autoStartDate = data.autoStartDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13027
+ let autoStartDateValue = this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat());
13028
+ let autoEndDateValue = this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat());
13029
+ let durationUnitValue = this.parent.getDurationString(data.duration, data.durationUnit);
13030
+ let manualStartDateValue = this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat());
13031
+ let manualEndDateValue = this.parent.getFormatedDate(data.endDate, this.parent.getDateFormat());
13032
+ if (this.parent.enableHtmlSanitizer) {
13033
+ autoStartDateValue = typeof (autoStartDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(autoStartDateValue) : autoStartDateValue;
13034
+ autoEndDateValue = typeof (autoEndDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(autoEndDateValue) : autoEndDateValue;
13035
+ durationUnitValue = typeof (durationUnitValue) === 'string' ? SanitizeHtmlHelper.sanitize(durationUnitValue) : durationUnitValue;
13036
+ manualStartDateValue = typeof (manualStartDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(manualStartDateValue) : manualStartDateValue;
13037
+ manualEndDateValue = typeof (manualEndDateValue) === 'string' ? SanitizeHtmlHelper.sanitize(manualEndDateValue) : manualEndDateValue;
13038
+ }
13039
+ let autoStartDate = data.autoStartDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12687
13040
  this.parent.localeObj.getConstant('subTasksStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12688
- this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12689
- const autoEndDate = data.autoEndDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13041
+ autoStartDateValue + '</td></tr>' : '';
13042
+ let autoEndDate = data.autoEndDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12690
13043
  this.parent.localeObj.getConstant('subTasksEndDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12691
- this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12692
- const durationValue = !isNullOrUndefined(data.duration) ? '<tr><td class = "e-gantt-tooltip-label">' +
13044
+ autoEndDateValue + '</td></tr>' : '';
13045
+ let durationValue = !isNullOrUndefined(data.duration) ? '<tr><td class = "e-gantt-tooltip-label">' +
12693
13046
  this.parent.localeObj.getConstant('duration') + '</td><td>:</td>' +
12694
- '<td class = "e-gantt-tooltip-value"> ' + this.parent.getDurationString(data.duration, data.durationUnit) +
13047
+ '<td class = "e-gantt-tooltip-value"> ' + durationUnitValue +
12695
13048
  '</td></tr>' : '';
12696
- const manualStartDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13049
+ let manualStartDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12697
13050
  this.parent.localeObj.getConstant('startDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12698
- this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12699
- const manualEndDate = data.endDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13051
+ manualStartDateValue + '</td></tr>' : '';
13052
+ let manualEndDate = data.endDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12700
13053
  this.parent.localeObj.getConstant('endDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12701
- this.parent.getFormatedDate(data.endDate, this.parent.getDateFormat()) + '</td></tr>' : '';
13054
+ manualEndDateValue + '</td></tr>' : '';
12702
13055
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12703
13056
  taskName + manualStartDate + autoStartDate + manualEndDate + autoEndDate + durationValue + '</tbody></table>';
12704
13057
  break;
12705
13058
  }
12706
13059
  case 'manualmilestone':
12707
13060
  {
12708
- const autoStart = data.autoStartDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13061
+ let autoStartValue = this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat());
13062
+ let autoEndValue = this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat());
13063
+ let dateValue = this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat());
13064
+ if (this.parent.enableHtmlSanitizer) {
13065
+ autoStartValue = typeof (autoStartValue) === 'string' ? SanitizeHtmlHelper.sanitize(autoStartValue) : autoStartValue;
13066
+ autoEndValue = typeof (autoEndValue) === 'string' ? SanitizeHtmlHelper.sanitize(autoEndValue) : autoEndValue;
13067
+ dateValue = typeof (dateValue) === 'string' ? SanitizeHtmlHelper.sanitize(dateValue) : dateValue;
13068
+ }
13069
+ let autoStart = data.autoStartDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12709
13070
  this.parent.localeObj.getConstant('subTasksStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12710
- this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12711
- const autoEnd = data.autoEndDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13071
+ autoStartValue + '</td></tr>' : '';
13072
+ let autoEnd = data.autoEndDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12712
13073
  this.parent.localeObj.getConstant('subTasksEndDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12713
- this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12714
- const date = '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
13074
+ autoEndValue + '</td></tr>' : '';
13075
+ let date = '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
12715
13076
  '<td class = "e-gantt-tooltip-value">' +
12716
- this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat()) + '</tr>';
13077
+ dateValue + '</tr>';
12717
13078
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12718
13079
  taskName + date + autoStart + autoEnd + '</tbody></table>';
12719
13080
  break;
@@ -12741,7 +13102,10 @@ class Tooltip$1 {
12741
13102
  * @private
12742
13103
  */
12743
13104
  getPredecessorTooltipData(args) {
12744
- const predeceesorParent = args.target.parentElement.id;
13105
+ let predeceesorParent = args.target.parentElement.id;
13106
+ if (this.parent.enableHtmlSanitizer && typeof (predeceesorParent) === 'string') {
13107
+ predeceesorParent = SanitizeHtmlHelper.sanitize(predeceesorParent);
13108
+ }
12745
13109
  const taskIds = predeceesorParent.match(/ConnectorLineparent(.*)child(.*)/);
12746
13110
  taskIds.shift();
12747
13111
  let fromTask;
@@ -12780,7 +13144,7 @@ class Tooltip$1 {
12780
13144
  */
12781
13145
  templateCompiler(template, parent, data, propName) {
12782
13146
  const tooltipFunction = parent.chartRowsModule.templateCompiler(template);
12783
- const templateID = parent.chartRowsModule.getTemplateID(propName);
13147
+ let templateID = parent.chartRowsModule.getTemplateID(propName);
12784
13148
  const templateNode = tooltipFunction(extend({ index: 0 }, data), parent, propName, templateID, true);
12785
13149
  return templateNode;
12786
13150
  }
@@ -13020,7 +13384,6 @@ class FocusModule {
13020
13384
  const top = containerPosition.top + (containerPosition.height / 2);
13021
13385
  const left = containerPosition.left + (containerPosition.width / 2);
13022
13386
  this.setActiveElement(e.target);
13023
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13024
13387
  contextMenu.open(top, left);
13025
13388
  e.preventDefault();
13026
13389
  break;
@@ -13383,6 +13746,12 @@ let Gantt = class Gantt extends Component {
13383
13746
  this.treeGrid.isReact = true;
13384
13747
  this.treeGrid.grid.isReact = true;
13385
13748
  }
13749
+ if (this.isVue) {
13750
+ this.treeGrid.isVue = true;
13751
+ this.treeGrid.grid.isVue = true;
13752
+ this.treeGrid.vueInstance = this.vueInstance;
13753
+ this.treeGrid.grid.vueInstance = this.vueInstance;
13754
+ }
13386
13755
  createSpinner({ target: this.element }, this.createElement);
13387
13756
  this.trigger('load', {});
13388
13757
  this.element.classList.add(root);
@@ -13408,13 +13777,13 @@ let Gantt = class Gantt extends Component {
13408
13777
  }
13409
13778
  hideMaskRow() {
13410
13779
  let isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
13411
- if (!isNullOrUndefined(this.contentMaskTable) && isTablePresent != 0) {
13780
+ if (!isNullOrUndefined(this.contentMaskTable) && (isTablePresent != 0 || this.contentMaskTable)) {
13412
13781
  const maskTable = this.contentMaskTable;
13413
13782
  remove(maskTable);
13414
13783
  this.contentMaskTable = null;
13415
13784
  }
13416
13785
  isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
13417
- if (!isNullOrUndefined(this.headerMaskTable) && isTablePresent != 0) {
13786
+ if (!isNullOrUndefined(this.headerMaskTable) && (isTablePresent != 0 || this.headerMaskTable)) {
13418
13787
  const maskTable = this.headerMaskTable;
13419
13788
  remove(maskTable);
13420
13789
  this.headerMaskTable = null;
@@ -13427,8 +13796,8 @@ let Gantt = class Gantt extends Component {
13427
13796
  }
13428
13797
  if (this.element.querySelectorAll('.' + timelineHeaderTableContainer).length != 0) {
13429
13798
  for (var i = 0; i < this.singleTier; i++) {
13430
- if (!isNullOrUndefined(this.element.querySelectorAll('.' + timelineHeaderTableContainer)[i])) {
13431
- this.element.querySelectorAll('.' + timelineHeaderTableContainer)[i]['style'].visibility = "visible";
13799
+ if (!isNullOrUndefined(this.element.querySelectorAll('.' + timelineHeaderTableContainer)[parseInt(i.toString(), 10)])) {
13800
+ this.element.querySelectorAll('.' + timelineHeaderTableContainer)[parseInt(i.toString(), 10)]['style'].visibility = "visible";
13432
13801
  }
13433
13802
  }
13434
13803
  }
@@ -13450,7 +13819,7 @@ let Gantt = class Gantt extends Component {
13450
13819
  if (this.element.querySelectorAll('.' + timelineHeaderTableContainer).length != 0) {
13451
13820
  this.singleTier = this.timelineModule.isSingleTier ? 1 : 2;
13452
13821
  for (var i = 0; i < this.singleTier; i++) {
13453
- this.element.querySelectorAll('.' + timelineHeaderTableContainer)[i]['style'].visibility = "hidden";
13822
+ this.element.querySelectorAll('.' + timelineHeaderTableContainer)[parseInt(i.toString(), 10)]['style'].visibility = "hidden";
13454
13823
  }
13455
13824
  }
13456
13825
  if (this.singleTier === 0) {
@@ -13569,7 +13938,7 @@ let Gantt = class Gantt extends Component {
13569
13938
  }
13570
13939
  this.topBottomHeader = 0;
13571
13940
  for (let i = 0; i < row.length; i++) {
13572
- tbody.appendChild(this.applyTimelineMaskRow(row[i]));
13941
+ tbody.appendChild(this.applyTimelineMaskRow(row[parseInt(i.toString(), 10)]));
13573
13942
  this.topBottomHeader = this.topBottomHeader + 1;
13574
13943
  }
13575
13944
  table.appendChild(tbody);
@@ -13583,11 +13952,11 @@ let Gantt = class Gantt extends Component {
13583
13952
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13584
13953
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13585
13954
  for (let i = 0; i < maskRow.childNodes.length - 1; i++) {
13586
- maskRow.childNodes[i]['style']['width'] = 166 + 'px';
13955
+ maskRow.childNodes[parseInt(i.toString(), 10)]['style']['width'] = 166 + 'px';
13587
13956
  }
13588
13957
  const maskCells = [].slice.call(maskRow.childNodes);
13589
13958
  for (let i = 0; i < maskCells.length; i++) {
13590
- const maskCell = maskCells[i];
13959
+ const maskCell = maskCells[parseInt(i.toString(), 10)];
13591
13960
  switch (this.topBottomHeader) {
13592
13961
  case 0:
13593
13962
  if (this.enableRtl) {
@@ -13604,7 +13973,7 @@ let Gantt = class Gantt extends Component {
13604
13973
  maskCell.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13605
13974
  const innerMaskCells = [].slice.call(maskCell.childNodes);
13606
13975
  for (let i = 0; i < innerMaskCells.length; i++) {
13607
- const htmlInner = innerMaskCells[i];
13976
+ const htmlInner = innerMaskCells[parseInt(i.toString(), 10)];
13608
13977
  if (i === 0) {
13609
13978
  if (this.enableRtl) {
13610
13979
  htmlInner.innerHTML = '<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>';
@@ -13656,7 +14025,7 @@ let Gantt = class Gantt extends Component {
13656
14025
  else if (this.columnLoop === 4) {
13657
14026
  this.columnLoop = 1;
13658
14027
  }
13659
- tbody.appendChild(this.applyMaskRow(row[j]));
14028
+ tbody.appendChild(this.applyMaskRow(row[parseInt(j.toString(), 10)]));
13660
14029
  }
13661
14030
  table.appendChild(tbody);
13662
14031
  table.style.width = 100 + '%';
@@ -13677,7 +14046,7 @@ let Gantt = class Gantt extends Component {
13677
14046
  }
13678
14047
  const maskCells = [].slice.call(maskRow.childNodes);
13679
14048
  for (let i = 0; i < maskCells.length; i++) {
13680
- const maskCell = maskCells[i];
14049
+ const maskCell = maskCells[parseInt(i.toString(), 10)];
13681
14050
  switch (this.columnLoop) {
13682
14051
  case 1:
13683
14052
  if (i === 0) {
@@ -13775,7 +14144,7 @@ let Gantt = class Gantt extends Component {
13775
14144
  this.predecessorModule['parentIds'] = [];
13776
14145
  this.predecessorModule['parentRecord'] = [];
13777
14146
  this.predecessorModule.updatePredecessors();
13778
- if (this.isInPredecessorValidation && this.enableValidation) {
14147
+ if (this.isInPredecessorValidation && this.enableValidation && this.autoCalculateDateScheduling) {
13779
14148
  this.predecessorModule.updatedRecordsDateByPredecessor();
13780
14149
  }
13781
14150
  }
@@ -13788,7 +14157,9 @@ let Gantt = class Gantt extends Component {
13788
14157
  if (this.enableValidation) {
13789
14158
  this.dataOperation.updateGanttData();
13790
14159
  }
13791
- this.predecessorModule.updateParentPredecessor();
14160
+ if (this.allowParentDependency) {
14161
+ this.predecessorModule.updateParentPredecessor();
14162
+ }
13792
14163
  if (this.dataSource instanceof Object && isCountRequired(this)) {
13793
14164
  const count = getValue('count', this.dataSource);
13794
14165
  this.treeGrid.dataSource = { result: this.flatData, count: count };
@@ -13801,7 +14172,9 @@ let Gantt = class Gantt extends Component {
13801
14172
  if (this.enableValidation) {
13802
14173
  this.dataOperation.updateGanttData();
13803
14174
  }
13804
- this.predecessorModule.updateParentPredecessor();
14175
+ if (this.allowParentDependency) {
14176
+ this.predecessorModule.updateParentPredecessor();
14177
+ }
13805
14178
  this.treeGridPane.classList.remove('e-temp-content');
13806
14179
  remove(this.treeGridPane.querySelector('.e-gantt-temp-header'));
13807
14180
  this.notify('dataReady', {});
@@ -13918,22 +14291,27 @@ let Gantt = class Gantt extends Component {
13918
14291
  * @private
13919
14292
  */
13920
14293
  updateContentHeight(args) {
13921
- if (this.virtualScrollModule && this.enableVirtualization && !isNullOrUndefined(args)) {
13922
- const length = getValue('result.length', args);
13923
- this.contentHeight = length * this.rowHeight;
14294
+ if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
14295
+ return;
13924
14296
  }
13925
14297
  else {
13926
- const expandedRecords = this.virtualScrollModule && this.enableVirtualization ?
13927
- this.currentViewData : this.getExpandedRecords(this.currentViewData);
13928
- let height;
13929
- const chartRow$$1 = !isNullOrUndefined(this.ganttChartModule.getChartRows()) ? this.ganttChartModule.getChartRows()[0] : null;
13930
- if (!isNullOrUndefined(chartRow$$1) && chartRow$$1.getBoundingClientRect().height > 0) {
13931
- height = chartRow$$1.getBoundingClientRect().height;
14298
+ if (this.virtualScrollModule && this.enableVirtualization && !isNullOrUndefined(args)) {
14299
+ const length = getValue('result.length', args);
14300
+ this.contentHeight = length * this.rowHeight;
13932
14301
  }
13933
14302
  else {
13934
- height = this.rowHeight;
14303
+ const expandedRecords = this.virtualScrollModule && this.enableVirtualization ?
14304
+ this.currentViewData : this.getExpandedRecords(this.currentViewData);
14305
+ let height;
14306
+ const chartRow$$1 = !isNullOrUndefined(this.ganttChartModule.getChartRows()) ? this.ganttChartModule.getChartRows()[0] : null;
14307
+ if (!isNullOrUndefined(chartRow$$1) && chartRow$$1.getBoundingClientRect().height > 0) {
14308
+ height = chartRow$$1.getBoundingClientRect().height;
14309
+ }
14310
+ else {
14311
+ height = this.rowHeight;
14312
+ }
14313
+ this.contentHeight = expandedRecords.length * height;
13935
14314
  }
13936
- this.contentHeight = expandedRecords.length * height;
13937
14315
  }
13938
14316
  }
13939
14317
  /**
@@ -14446,7 +14824,6 @@ let Gantt = class Gantt extends Component {
14446
14824
  this.chartRowsModule.refreshGanttRows();
14447
14825
  break;
14448
14826
  case 'includeWeekend':
14449
- case 'dayWorkingTime':
14450
14827
  case 'allowUnscheduledTasks':
14451
14828
  case 'holidays':
14452
14829
  this.isLoad = true;
@@ -14538,6 +14915,11 @@ let Gantt = class Gantt extends Component {
14538
14915
  case 'enableRtl':
14539
14916
  case 'readOnly':
14540
14917
  case 'viewType':
14918
+ case 'taskFields':
14919
+ case 'dayWorkingTime':
14920
+ case 'allowTaskbarDragAndDrop':
14921
+ case 'allowTaskbarOverlap':
14922
+ case 'allowParentDependency':
14541
14923
  if (prop === 'locale') {
14542
14924
  this.isLocaleChanged = true;
14543
14925
  }
@@ -14552,6 +14934,9 @@ let Gantt = class Gantt extends Component {
14552
14934
  }
14553
14935
  }
14554
14936
  if (isRefresh) {
14937
+ if (this.isLoad && this.contentMaskTable) {
14938
+ this.contentMaskTable = null;
14939
+ }
14555
14940
  this.refresh();
14556
14941
  }
14557
14942
  }
@@ -14679,7 +15064,7 @@ let Gantt = class Gantt extends Component {
14679
15064
  args: [this]
14680
15065
  });
14681
15066
  }
14682
- if (this.allowRowDragAndDrop) {
15067
+ if (this.allowRowDragAndDrop || this.allowTaskbarDragAndDrop) {
14683
15068
  modules.push({
14684
15069
  member: 'rowDragAndDrop',
14685
15070
  args: [this]
@@ -15214,10 +15599,11 @@ let Gantt = class Gantt extends Component {
15214
15599
  * @param {PdfExportProperties} pdfExportProperties - Defines the export properties of the Gantt.
15215
15600
  * @param {isMultipleExport} isMultipleExport - Define to enable multiple export.
15216
15601
  * @param {pdfDoc} pdfDoc - Defined the Pdf Document if multiple export is enabled.
15602
+ * @param {boolean} isBlob - If the 'isBlob' parameter is set to true, the method returns PDF data as a blob instead of exporting it as a down-loadable PDF file. The default value is false.
15217
15603
  * @returns {Promise<any>} .
15218
15604
  */
15219
- pdfExport(pdfExportProperties, isMultipleExport, pdfDoc) {
15220
- return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc)
15605
+ pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
15606
+ return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob)
15221
15607
  : null;
15222
15608
  }
15223
15609
  /**
@@ -15249,7 +15635,7 @@ let Gantt = class Gantt extends Component {
15249
15635
  * @private
15250
15636
  */
15251
15637
  renderWorkingDayCell(args) {
15252
- const includeWeekend = this.taskMode !== 'Auto' ? true : this.includeWeekend ? true : false;
15638
+ const includeWeekend = this.taskMode !== 'Auto' ? true : (this.includeWeekend || !this.autoCalculateDateScheduling) ? true : false;
15253
15639
  const nonWorkingDays = !includeWeekend ? this.nonWorkingDayIndex : [];
15254
15640
  const holidays = this.totalHolidayDates;
15255
15641
  if (nonWorkingDays.length > 0 && nonWorkingDays.indexOf(args.date.getDay()) !== -1) {
@@ -15259,7 +15645,12 @@ let Gantt = class Gantt extends Component {
15259
15645
  const tempDate = new Date(args.date.getTime());
15260
15646
  tempDate.setHours(0, 0, 0);
15261
15647
  if (holidays.indexOf(tempDate.getTime()) !== -1) {
15262
- args.isDisabled = true;
15648
+ if (!this.autoCalculateDateScheduling) {
15649
+ args.isDisabled = false;
15650
+ }
15651
+ else {
15652
+ args.isDisabled = true;
15653
+ }
15263
15654
  }
15264
15655
  }
15265
15656
  }
@@ -15376,8 +15767,8 @@ let Gantt = class Gantt extends Component {
15376
15767
  const id = ganttData.rowUniqueID;
15377
15768
  const task = this.getRecordByID(id);
15378
15769
  let isValid = false;
15379
- if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData[field]) && (value instanceof Date ? value.getTime() !==
15380
- ganttData[field].getTime() : ganttData[field] !== value))) {
15770
+ if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData[`${field}`]) && (value instanceof Date ? value.getTime() !==
15771
+ ganttData[`${field}`].getTime() : ganttData[`${field}`] !== value))) {
15381
15772
  isValid = true;
15382
15773
  }
15383
15774
  if (task && ((this.editedRecords.indexOf(task) === -1 && isValid) || this.editedRecords.length === 0)) {
@@ -16324,6 +16715,12 @@ __decorate([
16324
16715
  __decorate([
16325
16716
  Property(false)
16326
16717
  ], Gantt.prototype, "enableImmutableMode", void 0);
16718
+ __decorate([
16719
+ Property(true)
16720
+ ], Gantt.prototype, "allowParentDependency", void 0);
16721
+ __decorate([
16722
+ Property(false)
16723
+ ], Gantt.prototype, "enableHtmlSanitizer", void 0);
16327
16724
  __decorate([
16328
16725
  Property(true)
16329
16726
  ], Gantt.prototype, "disableHtmlEncode", void 0);
@@ -16333,6 +16730,12 @@ __decorate([
16333
16730
  __decorate([
16334
16731
  Property(true)
16335
16732
  ], Gantt.prototype, "enableVirtualMaskRow", void 0);
16733
+ __decorate([
16734
+ Property(true)
16735
+ ], Gantt.prototype, "UpdateOffsetOnTaskbarEdit", void 0);
16736
+ __decorate([
16737
+ Property(true)
16738
+ ], Gantt.prototype, "autoCalculateDateScheduling", void 0);
16336
16739
  __decorate([
16337
16740
  Property(true)
16338
16741
  ], Gantt.prototype, "autoFocusTasks", void 0);
@@ -16381,6 +16784,12 @@ __decorate([
16381
16784
  __decorate([
16382
16785
  Property(false)
16383
16786
  ], Gantt.prototype, "renderBaseline", void 0);
16787
+ __decorate([
16788
+ Property(false)
16789
+ ], Gantt.prototype, "allowTaskbarDragAndDrop", void 0);
16790
+ __decorate([
16791
+ Property(true)
16792
+ ], Gantt.prototype, "allowTaskbarOverlap", void 0);
16384
16793
  __decorate([
16385
16794
  Property('Horizontal')
16386
16795
  ], Gantt.prototype, "gridLines", void 0);
@@ -16823,8 +17232,10 @@ class CellEdit {
16823
17232
  }
16824
17233
  if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
16825
17234
  data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
16826
- || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
16827
- args.cancel = true;
17235
+ || field === taskSettings.dependency || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
17236
+ if ((field === taskSettings.dependency && !this.parent.allowParentDependency) || field !== taskSettings.dependency) {
17237
+ args.cancel = true;
17238
+ }
16828
17239
  }
16829
17240
  else {
16830
17241
  const callBackPromise = new Deferred();
@@ -16874,7 +17285,7 @@ class CellEdit {
16874
17285
  }
16875
17286
  isValueChange(args, field) {
16876
17287
  const data = getValue('data', args);
16877
- const editedValue = data[field];
17288
+ const editedValue = data[`${field}`];
16878
17289
  const previousValue = getValue('previousData', args);
16879
17290
  if ((isNullOrUndefined(editedValue) && !isNullOrUndefined(previousValue)) || (!isNullOrUndefined(editedValue) && isNullOrUndefined(previousValue))) {
16880
17291
  return true;
@@ -17042,7 +17453,7 @@ class CellEdit {
17042
17453
  const ganttSegments = [];
17043
17454
  const segments = ganttProp.segments;
17044
17455
  for (let i = 0; i < segments.length; i++) {
17045
- const segment = segments[i];
17456
+ const segment = segments[parseInt(i.toString(), 10)];
17046
17457
  let endDate = segment.endDate;
17047
17458
  endDate = (!isNullOrUndefined(ganttProp.endDate)) && endDate.getTime() <
17048
17459
  ganttProp.endDate.getTime() && i !== segments.length - 1 ? endDate : ganttProp.endDate;
@@ -17241,7 +17652,7 @@ class CellEdit {
17241
17652
  }
17242
17653
  }
17243
17654
  if (!isNullOrUndefined(index) && index !== -1) {
17244
- editedResources.push(previousResource[index]);
17655
+ editedResources.push(previousResource[parseInt(index.toString(), 10)]);
17245
17656
  }
17246
17657
  else {
17247
17658
  const resource = resourceData.filter((resourceInfo) => {
@@ -17300,7 +17711,7 @@ class CellEdit {
17300
17711
  typeEdited(args, editedObj) {
17301
17712
  const key = 'taskType';
17302
17713
  const ganttProb = args.data.ganttProperties;
17303
- const taskType = editedObj[key];
17714
+ const taskType = editedObj[`${key}`];
17304
17715
  this.parent.setRecordValue('taskType', taskType, ganttProb, true);
17305
17716
  //this.parent.dataOperation.updateMappingData(args.data, 'taskType');
17306
17717
  this.updateEditedRecord(args);
@@ -17408,15 +17819,12 @@ class EditTooltip {
17408
17819
  this.parent.tooltipModule.toolTipObj.close();
17409
17820
  this.updateTooltip(segmentIndex);
17410
17821
  if (this.taskbarEdit.connectorSecondAction === 'ConnectorPointLeftDrag') {
17411
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17412
17822
  this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector('.' + connectorPointLeft));
17413
17823
  }
17414
17824
  else if (this.taskbarEdit.connectorSecondAction === 'ConnectorPointRightDrag') {
17415
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17416
17825
  this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector('.' + connectorPointRight));
17417
17826
  }
17418
17827
  else {
17419
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17420
17828
  this.toolTipObj.open(this.taskbarEdit.taskBarEditElement);
17421
17829
  }
17422
17830
  }
@@ -17581,6 +17989,10 @@ class TaskbarEdit extends DateProcessor {
17581
17989
  this.elementOffsetWidth = 0;
17582
17990
  this.elementOffsetHeight = 0;
17583
17991
  this.segmentIndex = -1;
17992
+ this.currentItemTop = 0;
17993
+ this.currentItemPrevTop = 0;
17994
+ this.topValue = 0;
17995
+ this.draggedRecordMarginTop = 0;
17584
17996
  this.parent = ganttObj;
17585
17997
  this.initPublicProp();
17586
17998
  this.wireEvents();
@@ -17822,7 +18234,9 @@ class TaskbarEdit extends DateProcessor {
17822
18234
  if (!isNullOrUndefined(parentRecord) && !parentRecord.expanded) {
17823
18235
  this.prevZIndex = (this.taskBarEditElement).style.zIndex;
17824
18236
  (this.taskBarEditElement).style.zIndex = '1000';
17825
- addClass([this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')], 'e-collapsed-taskbar-drag');
18237
+ if (this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')) {
18238
+ addClass([this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')], 'e-collapsed-taskbar-drag');
18239
+ }
17826
18240
  }
17827
18241
  }
17828
18242
  }
@@ -17986,9 +18400,20 @@ class TaskbarEdit extends DateProcessor {
17986
18400
  this.parent.ganttChartModule.scrollObject.previousScroll.left;
17987
18401
  }
17988
18402
  this.tooltipPositionX = this.mouseDownX;
17989
- this.mouseDownY = e.pageY - containerPosition.top +
18403
+ this.mouseDownY = this.dragMoveY = e.pageY - containerPosition.top +
17990
18404
  this.parent.ganttChartModule.scrollObject.previousScroll.top;
17991
18405
  }
18406
+ if (this.parent.viewType == "ResourceView" && this.parent.allowTaskbarDragAndDrop) {
18407
+ let toolbarHeight = 0;
18408
+ if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
18409
+ toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
18410
+ }
18411
+ this.topValue = this.parent.getOffsetRect(event.target).top - this.parent.getOffsetRect(this.parent.element).top -
18412
+ parseInt((closest(event.target, '.e-taskbar-main-container'))['style'].marginTop) -
18413
+ this.parent.element.getElementsByClassName('e-timeline-header-container')[0]['offsetHeight'] -
18414
+ toolbarHeight + document.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollTop;
18415
+ this.currentItemPrevTop = this.currentItemTop = this.topValue;
18416
+ }
17992
18417
  if (this.taskBarEditAction === 'ConnectorPointLeftDrag' || this.taskBarEditAction === 'ConnectorPointRightDrag') {
17993
18418
  this.fromPredecessorText = this.taskBarEditAction === 'ConnectorPointLeftDrag' ? 'start' : 'finish';
17994
18419
  this.parent.connectorLineModule.tooltipTable.innerHTML = this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName, this.fromPredecessorText, '', '');
@@ -18118,6 +18543,22 @@ class TaskbarEdit extends DateProcessor {
18118
18543
  this.drawFalseLine();
18119
18544
  }
18120
18545
  }
18546
+ if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
18547
+ if (this.dragMoveY > this.mouseMoveY) {
18548
+ this.mouseMoveY = this.dragMoveY - this.mouseMoveY;
18549
+ this.currentItemTop = this.currentItemTop - this.mouseMoveY;
18550
+ }
18551
+ else {
18552
+ this.mouseMoveY -= this.dragMoveY;
18553
+ this.currentItemTop = this.currentItemTop + this.mouseMoveY;
18554
+ }
18555
+ const containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
18556
+ this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
18557
+ this.topValue = this.currentItemTop;
18558
+ this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
18559
+ this.topValue == this.currentItemTop) ? this.topValue :
18560
+ this.currentItemPrevTop;
18561
+ }
18121
18562
  this.setItemPosition();
18122
18563
  this.updateEditedItem();
18123
18564
  this.editTooltip.updateTooltip(this.segmentIndex);
@@ -18197,12 +18638,12 @@ class TaskbarEdit extends DateProcessor {
18197
18638
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.left;
18198
18639
  this.startScrollTimer('left');
18199
18640
  }
18200
- else if (isConnectorLineEdit && ((mouseY + 80) >
18641
+ else if (((mouseY + 80) >
18201
18642
  containerPosition.top + this.parent.ganttChartModule.chartBodyContainer.offsetHeight)) {
18202
18643
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
18203
18644
  this.startScrollTimer('bottom');
18204
18645
  }
18205
- else if (isConnectorLineEdit && ((mouseY - 20) < containerPosition.top)) {
18646
+ else if (((mouseY - 20) < containerPosition.top)) {
18206
18647
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
18207
18648
  this.startScrollTimer('top');
18208
18649
  }
@@ -18987,6 +19428,11 @@ class TaskbarEdit extends DateProcessor {
18987
19428
  taskBarMainContainer$$1.style.width = (width) + 'px';
18988
19429
  leftLabelContainer$$1.style.width = (item.left) + 'px';
18989
19430
  taskBarMainContainer$$1.style.setProperty(position, (item.left) + 'px');
19431
+ if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule &&
19432
+ (this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
19433
+ taskBarMainContainer$$1.style.setProperty('top', (this.topValue) + 'px');
19434
+ taskBarMainContainer$$1.style.zIndex = '4';
19435
+ }
18990
19436
  if (this.taskBarEditAction === 'LeftResizing' && this.segmentIndex === 0) {
18991
19437
  const parent = this.taskBarEditElement.parentElement;
18992
19438
  const segmentedTasks = parent.getElementsByClassName('e-segmented-taskbar');
@@ -19099,7 +19545,8 @@ class TaskbarEdit extends DateProcessor {
19099
19545
  this.previousMouseMove = null;
19100
19546
  this.editTooltip.showHideTaskbarEditTooltip(false, this.segmentIndex);
19101
19547
  if (this.taskBarEditAction && this.isMouseDragged) {
19102
- if (!this.dragMouseLeave && this.taskBarEditedAction) {
19548
+ if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.viewType === 'ResourceView' &&
19549
+ this.parent.allowTaskbarDragAndDrop)) {
19103
19550
  this.taskBarEditedAction(e);
19104
19551
  this.isMouseDragged = false;
19105
19552
  }
@@ -19208,6 +19655,65 @@ class TaskbarEdit extends DateProcessor {
19208
19655
  const args = extend({}, arg);
19209
19656
  const ganttRecord = args.data;
19210
19657
  const taskData = ganttRecord.ganttProperties;
19658
+ const draggedRecIndex = this.parent.currentViewData.indexOf(ganttRecord);
19659
+ if ((args.taskBarEditAction === 'MilestoneDrag' || args.taskBarEditAction === 'ChildDrag') && this.parent.viewType === "ResourceView"
19660
+ && this.parent.allowTaskbarDragAndDrop && this.dragMoveY > 0) {
19661
+ if (this.parent.rowDragAndDropModule) {
19662
+ let flatRecordCol = this.parent.currentViewData;
19663
+ if (flatRecordCol[this.taskBarEditRecord.parentItem.index] && ((this.parent.editedRecords.indexOf(flatRecordCol[this.taskBarEditRecord.parentItem.index]) === -1))) {
19664
+ this.parent.editedRecords.push(flatRecordCol[this.taskBarEditRecord.parentItem.index]);
19665
+ }
19666
+ let ganttrec;
19667
+ let resHeight = 0;
19668
+ let rowCount = 0;
19669
+ let childIndex;
19670
+ let droppedRecord;
19671
+ let treeGridrows = this.parent.treeGrid.getRows().length;
19672
+ for (let i = 0; i < treeGridrows; i++) {
19673
+ if (resHeight < this.dragMoveY && this.parent.getRowByIndex(i).style.display !== 'none') {
19674
+ rowCount = i;
19675
+ resHeight = resHeight + parseInt(this.parent.getRowByIndex(i).style.height);
19676
+ if (!flatRecordCol[i].parentItem) {
19677
+ ganttrec = flatRecordCol[i];
19678
+ }
19679
+ else {
19680
+ ganttrec = this.parent.getRecordByID(flatRecordCol[i].parentItem.taskId);
19681
+ }
19682
+ }
19683
+ }
19684
+ let draggedRecordtaskbar = this.parent.getRowByIndex(draggedRecIndex).getElementsByClassName('e-taskbar-main-container');
19685
+ let taskbarContainer = this.parent.getRowByIndex(rowCount).getElementsByClassName('e-taskbar-main-container');
19686
+ for (let j = 0; j < taskbarContainer.length; j++) {
19687
+ if (taskbarContainer[j]['offsetTop'] < this.dragMoveY && draggedRecordtaskbar[0].getAttribute('rowuniqueid') !==
19688
+ taskbarContainer[j].getAttribute('rowuniqueid')) {
19689
+ this.draggedRecordMarginTop = taskbarContainer[j]['style'].marginTop;
19690
+ childIndex = taskbarContainer[j].getAttribute('rowuniqueid');
19691
+ }
19692
+ }
19693
+ if (childIndex) {
19694
+ droppedRecord = this.parent.currentViewData.filter((data) => {
19695
+ if (data['rowUniqueID'] === childIndex) {
19696
+ return data;
19697
+ }
19698
+ else {
19699
+ return null;
19700
+ }
19701
+ });
19702
+ }
19703
+ if (droppedRecord) {
19704
+ const droppedRecordIndex = this.parent.currentViewData.indexOf(droppedRecord[0]);
19705
+ let position = (droppedRecord[0].hasChildRecords || (!droppedRecord[0].parentItem &&
19706
+ droppedRecord[0].childRecords.length == 0)) ? 'child' : 'below';
19707
+ if (this.parent.rowDragAndDropModule) {
19708
+ this.parent.rowDragAndDropModule.reorderRows([draggedRecIndex], droppedRecordIndex, position);
19709
+ }
19710
+ this.dragMoveY = 0;
19711
+ }
19712
+ }
19713
+ if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
19714
+ this.parent.ganttChartModule.renderOverAllocationContainer();
19715
+ }
19716
+ }
19211
19717
  if (args.taskBarEditAction === 'ProgressResizing') {
19212
19718
  if (args.previousData.progress !== taskData.progress) {
19213
19719
  this.parent.setRecordValue('progress', this.getProgressPercent(taskData.width, taskData.progressWidth), taskData, true);
@@ -19399,14 +19905,20 @@ class TaskbarEdit extends DateProcessor {
19399
19905
  }
19400
19906
  if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
19401
19907
  !this.elementOffsetLeft) || !this.parent.enableVirtualization) {
19402
- if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
19403
- this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
19404
- this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
19405
- }
19406
- else {
19908
+ if (!this.parent.allowParentDependency) {
19407
19909
  this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
19408
19910
  this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
19409
19911
  }
19912
+ else {
19913
+ if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
19914
+ this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
19915
+ this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
19916
+ }
19917
+ else {
19918
+ this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
19919
+ this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
19920
+ }
19921
+ }
19410
19922
  this.elementOffsetWidth = this.taskBarEditElement.offsetWidth;
19411
19923
  this.elementOffsetHeight = this.taskBarEditElement.offsetHeight;
19412
19924
  }
@@ -20419,7 +20931,7 @@ class DialogEdit {
20419
20931
  targetId = inputElement.querySelector('input').getAttribute('id');
20420
20932
  inputElement = inputElement.querySelector('#' + targetId);
20421
20933
  }
20422
- else if (!isNullOrUndefined(args.event) && !isNullOrUndefined(args.event.path[1])) {
20934
+ else if (!isNullOrUndefined(args.event) && !isNullOrUndefined(args.event.path) && !isNullOrUndefined(args.event.path)[1]) {
20423
20935
  inputElement = args.event.path[1];
20424
20936
  targetId = inputElement.querySelector('input').getAttribute('id');
20425
20937
  inputElement = inputElement.querySelector('#' + targetId);
@@ -20460,6 +20972,9 @@ class DialogEdit {
20460
20972
  if (!isNullOrUndefined(tasks.startDate) && tasks.startDate !== colName) {
20461
20973
  this.updateScheduleFields(dialog, ganttProp, 'startDate');
20462
20974
  }
20975
+ if (tasks.endDate === colName && !isNullOrUndefined(ganttProp.startDate) && !isNullOrUndefined(args.value) && ganttProp.startDate.getTime() > args.value) {
20976
+ this.updateScheduleFields(dialog, ganttProp, 'endDate');
20977
+ }
20463
20978
  if (!isNullOrUndefined(tasks.endDate) && tasks.endDate !== colName) {
20464
20979
  this.updateScheduleFields(dialog, ganttProp, 'endDate');
20465
20980
  }
@@ -20650,6 +21165,9 @@ class DialogEdit {
20650
21165
  if (taskSettings.endDate === columnName) {
20651
21166
  if (value !== '') {
20652
21167
  let endDate = this.parent.dateValidationModule.getDateFromFormat(value);
21168
+ if (isNullOrUndefined(ganttProp.startDate) && isNullOrUndefined(endDate) && ganttProp.startDate.getTime() > endDate.getTime()) {
21169
+ endDate = ganttProp.endDate;
21170
+ }
20653
21171
  if (endDate.getHours() === 0 && ganttObj.defaultEndTime !== 86400) {
20654
21172
  this.parent.dateValidationModule.setTime(ganttObj.defaultEndTime, endDate);
20655
21173
  }
@@ -21027,6 +21545,9 @@ class DialogEdit {
21027
21545
  item.content = this.renderGeneralTab(item.content);
21028
21546
  }
21029
21547
  else if (item.content === 'Dependency') {
21548
+ if (this.editedRecord.hasChildRecords && !this.parent.allowParentDependency) {
21549
+ item.disabled = true;
21550
+ }
21030
21551
  item.content = this.renderPredecessorTab(item.content);
21031
21552
  }
21032
21553
  else if (item.content === 'Resources') {
@@ -21478,27 +21999,34 @@ class DialogEdit {
21478
21999
  this.preTableCollection = [];
21479
22000
  for (let i = 0; i < flatData.length; i++) {
21480
22001
  const data = flatData[i];
21481
- let currentFlatData = data;
21482
- if (data.parentUniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
21483
- this.isValidData = false;
21484
- }
21485
- else {
21486
- do {
21487
- if (currentFlatData.parentItem) {
21488
- currentFlatData = this.parent.flatData[this.parent.ids.indexOf(currentFlatData.parentItem.taskId)];
21489
- if (currentFlatData.uniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
21490
- this.isValidData = false;
21491
- break;
22002
+ if (this.parent.allowParentDependency) {
22003
+ let currentFlatData = data;
22004
+ if (data.parentUniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
22005
+ this.isValidData = false;
22006
+ }
22007
+ else {
22008
+ do {
22009
+ if (currentFlatData.parentItem) {
22010
+ currentFlatData = this.parent.flatData[this.parent.ids.indexOf(currentFlatData.parentItem.taskId)];
22011
+ if (currentFlatData.uniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
22012
+ this.isValidData = false;
22013
+ break;
22014
+ }
21492
22015
  }
21493
- }
21494
- } while (currentFlatData.parentItem);
21495
- }
21496
- if (data.hasChildRecords && this.isValidData) {
21497
- this.isValidData = this.isParentValid(data.childRecords);
22016
+ } while (currentFlatData.parentItem);
22017
+ }
22018
+ if (data.hasChildRecords && this.isValidData) {
22019
+ this.isValidData = this.isParentValid(data.childRecords);
22020
+ }
22021
+ if (!this.isValidData) {
22022
+ this.isValidData = true;
22023
+ continue;
22024
+ }
21498
22025
  }
21499
- if (!this.isValidData) {
21500
- this.isValidData = true;
21501
- continue;
22026
+ else {
22027
+ if (data.hasChildRecords) {
22028
+ continue;
22029
+ }
21502
22030
  }
21503
22031
  const taskId = this.parent.viewType === 'ResourceView' ? data.ganttProperties.taskId.toString()
21504
22032
  : data.ganttProperties.rowUniqueID.toString();
@@ -21734,6 +22262,10 @@ class DialogEdit {
21734
22262
  }
21735
22263
  else {
21736
22264
  tasksData[fieldName] = controlObj.value;
22265
+ if (this.parent.enableHtmlSanitizer && typeof (controlObj.value) === 'string') {
22266
+ controlObj.value = SanitizeHtmlHelper.sanitize(controlObj.value);
22267
+ tasksData[fieldName] = controlObj.value;
22268
+ }
21737
22269
  }
21738
22270
  }
21739
22271
  }
@@ -22017,9 +22549,10 @@ class ConnectorLineEdit {
22017
22549
  const from = 'from';
22018
22550
  const to = 'to';
22019
22551
  this.parent.connectorLineModule.removeConnectorLineById('parent' + predecessor[from] + 'child' + predecessor[to]);
22020
- parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[from]);
22021
- childGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[to]);
22022
- if (parentGanttRecord || childGanttRecord) {
22552
+ parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[`${from}`]);
22553
+ childGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[`${to}`]);
22554
+ if ((!this.parent.allowParentDependency && (parentGanttRecord && parentGanttRecord.expanded === true) ||
22555
+ (childGanttRecord && childGanttRecord.expanded === true)) || (this.parent.allowParentDependency && (parentGanttRecord || childGanttRecord))) {
22023
22556
  connectorObj =
22024
22557
  this.parent.predecessorModule.updateConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor);
22025
22558
  if (!isNullOrUndefined(connectorObj)) {
@@ -22070,8 +22603,8 @@ class ConnectorLineEdit {
22070
22603
  if (!isNullOrUndefined(values[0])) {
22071
22604
  const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
22072
22605
  if (ids.indexOf(values[0]) === -1) {
22073
- if (values[0].indexOf(" ") != -1) {
22074
- match = values[0].split(" ");
22606
+ if (values[0].indexOf(' ') !== -1) {
22607
+ match = values[0].split(' ');
22075
22608
  if (match.length === 1) {
22076
22609
  match = values[0].match(/(\d+|[A-z]+)/g);
22077
22610
  }
@@ -22142,7 +22675,7 @@ class ConnectorLineEdit {
22142
22675
  let parentRec = rec;
22143
22676
  if (rec.parentItem) {
22144
22677
  parentRec = this.parent.flatData.filter((item) => {
22145
- return item.uniqueID == rec.parentUniqueID;
22678
+ return item.uniqueID === rec.parentUniqueID;
22146
22679
  })[0];
22147
22680
  if (parentRec.parentItem) {
22148
22681
  parentRec = this.getRootParent(parentRec);
@@ -22191,13 +22724,13 @@ class ConnectorLineEdit {
22191
22724
  }
22192
22725
  else {
22193
22726
  if (!toRecord.parentItem && fromRecord.parentItem) {
22194
- let fromRootParent = this.parent.connectorLineEditModule.getRootParent(fromRecord);
22727
+ const fromRootParent = this.parent.connectorLineEditModule.getRootParent(fromRecord);
22195
22728
  if (fromRootParent.uniqueID === toRecord.uniqueID) {
22196
22729
  return false;
22197
22730
  }
22198
22731
  }
22199
22732
  else if (toRecord.parentItem && !fromRecord.parentItem) {
22200
- let toRootParent = this.parent.connectorLineEditModule.getRootParent(toRecord);
22733
+ const toRootParent = this.parent.connectorLineEditModule.getRootParent(toRecord);
22201
22734
  if (toRootParent.uniqueID === fromRecord.uniqueID) {
22202
22735
  return false;
22203
22736
  }
@@ -22223,11 +22756,20 @@ class ConnectorLineEdit {
22223
22756
  if (!isNullOrUndefined(predecessorString) && predecessorString.length > 0) {
22224
22757
  predecessorIdArray = this.idFromPredecessor(predecessorString);
22225
22758
  for (let count = 0; count < predecessorIdArray.length; count++) {
22226
- if (parseInt(predecessorIdArray[predecessorIdArray.length - 1]) !== ganttRecord[this.parent.taskFields.id]) {
22227
- let num = this.parent.ids.indexOf(predecessorIdArray[predecessorIdArray.length - 1]);
22228
- let fromRecord = this.parent.currentViewData[num];
22229
- if (fromRecord && ganttRecord) {
22230
- flag = this.validateParentPredecessor(fromRecord, ganttRecord);
22759
+ //Check edited item has parent item in predecessor collection
22760
+ if (!this.parent.allowParentDependency) {
22761
+ const checkParent = this.checkParentRelation(ganttRecord, predecessorIdArray);
22762
+ if (!checkParent) {
22763
+ return false;
22764
+ }
22765
+ }
22766
+ else {
22767
+ if (parseInt(predecessorIdArray[predecessorIdArray.length - 1]) !== ganttRecord[this.parent.taskFields.id]) {
22768
+ let num = this.parent.ids.indexOf(predecessorIdArray[predecessorIdArray.length - 1]);
22769
+ let fromRecord = this.parent.currentViewData[num];
22770
+ if (fromRecord && ganttRecord) {
22771
+ flag = this.validateParentPredecessor(fromRecord, ganttRecord);
22772
+ }
22231
22773
  }
22232
22774
  }
22233
22775
  // Check if predecessor exist more then one
@@ -22459,7 +23001,9 @@ class ConnectorLineEdit {
22459
23001
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22460
23002
  }
22461
23003
  else if (args.validateMode.preserveLinkWithEditing) {
22462
- this.calculateOffset(ganttRecord);
23004
+ if (this.parent.UpdateOffsetOnTaskbarEdit) {
23005
+ this.calculateOffset(ganttRecord);
23006
+ }
22463
23007
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22464
23008
  }
22465
23009
  }
@@ -22490,7 +23034,7 @@ class ConnectorLineEdit {
22490
23034
  const prevPredecessor = extend([], record.ganttProperties.predecessor, [], true);
22491
23035
  const validPredecessor = this.parent.predecessorModule.getValidPredecessor(record);
22492
23036
  for (let i = 0; i < validPredecessor.length; i++) {
22493
- const predecessor = validPredecessor[i];
23037
+ const predecessor = validPredecessor[parseInt(i.toString(), 10)];
22494
23038
  const parentTask = this.parent.connectorLineModule.getRecordByID(predecessor.from);
22495
23039
  let offset;
22496
23040
  if (isScheduledTask(parentTask.ganttProperties) && isScheduledTask(record.ganttProperties)) {
@@ -22570,7 +23114,7 @@ class ConnectorLineEdit {
22570
23114
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22571
23115
  const index = getIndex(predecessor[i], 'from', prevPredecessor, 'to');
22572
23116
  prevPredecessor.splice(index, 1);
22573
- const parentIndex = getIndex(predecessor[i], 'from', parentPredecessor, 'to');
23117
+ const parentIndex = getIndex(predecessor[parseInt(i.toString(), 10)], 'from', parentPredecessor, 'to');
22574
23118
  parentPredecessor.splice(parentIndex, 1);
22575
23119
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
22576
23120
  }
@@ -22681,41 +23225,41 @@ class ConnectorLineEdit {
22681
23225
  let violationType = null;
22682
23226
  if (predecessor[i].type === 'FS') {
22683
23227
  if (ganttTaskData.startDate < startDate) {
22684
- this.validationPredecessor.push(predecessor[i]);
23228
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22685
23229
  violationType = 'taskBeforePredecessor_FS';
22686
23230
  }
22687
23231
  else if (ganttTaskData.startDate > startDate) {
22688
- this.validationPredecessor.push(predecessor[i]);
23232
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22689
23233
  violationType = 'taskAfterPredecessor_FS';
22690
23234
  }
22691
23235
  }
22692
23236
  else if (predecessor[i].type === 'SS') {
22693
23237
  if (ganttTaskData.startDate < startDate) {
22694
- this.validationPredecessor.push(predecessor[i]);
23238
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22695
23239
  violationType = 'taskBeforePredecessor_SS';
22696
23240
  }
22697
23241
  else if (ganttTaskData.startDate > startDate) {
22698
- this.validationPredecessor.push(predecessor[i]);
23242
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22699
23243
  violationType = 'taskAfterPredecessor_SS';
22700
23244
  }
22701
23245
  }
22702
23246
  else if (predecessor[i].type === 'FF') {
22703
23247
  if (endDate <= parentGanttRecord.ganttProperties.endDate) {
22704
- this.validationPredecessor.push(predecessor[i]);
23248
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22705
23249
  violationType = 'taskBeforePredecessor_FF';
22706
23250
  }
22707
23251
  else if (endDate > parentGanttRecord.ganttProperties.endDate) {
22708
- this.validationPredecessor.push(predecessor[i]);
23252
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22709
23253
  violationType = 'taskAfterPredecessor_FF';
22710
23254
  }
22711
23255
  }
22712
23256
  else if (predecessor[i].type === 'SF') {
22713
23257
  if (endDate < parentGanttRecord.ganttProperties.startDate) {
22714
- this.validationPredecessor.push(predecessor[i]);
23258
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22715
23259
  violationType = 'taskBeforePredecessor_SF';
22716
23260
  }
22717
23261
  else if (endDate >= parentGanttRecord.ganttProperties.startDate) {
22718
- this.validationPredecessor.push(predecessor[i]);
23262
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22719
23263
  violationType = 'taskAfterPredecessor_SF';
22720
23264
  }
22721
23265
  }
@@ -22746,13 +23290,13 @@ class ConnectorLineEdit {
22746
23290
  const prevPredecessor = prevData.ganttProperties.predecessor;
22747
23291
  if (!isNullOrUndefined(prevPredecessor)) {
22748
23292
  for (let p = 0; p < prevPredecessor.length; p++) {
22749
- const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(prevPredecessor[p].from);
23293
+ const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(prevPredecessor[parseInt(p.toString(), 10)].from);
22750
23294
  if (parentGanttRecord === data) {
22751
- data.ganttProperties.predecessor.push(prevPredecessor[p]);
23295
+ data.ganttProperties.predecessor.push(prevPredecessor[parseInt(p.toString(), 10)]);
22752
23296
  }
22753
23297
  else {
22754
23298
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22755
- const parentIndex = getIndex(prevPredecessor[p], 'from', parentPredecessor, 'to');
23299
+ const parentIndex = getIndex(prevPredecessor[parseInt(p.toString(), 10)], 'from', parentPredecessor, 'to');
22756
23300
  if (parentIndex !== -1) {
22757
23301
  parentPredecessor.splice(parentIndex, 1);
22758
23302
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
@@ -22762,9 +23306,9 @@ class ConnectorLineEdit {
22762
23306
  }
22763
23307
  if (!isNullOrUndefined(newPredecessor)) {
22764
23308
  for (let n = 0; n < newPredecessor.length; n++) {
22765
- const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(newPredecessor[n].from);
23309
+ const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(newPredecessor[parseInt(n.toString(), 10)].from);
22766
23310
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22767
- parentPredecessor.push(newPredecessor[n]);
23311
+ parentPredecessor.push(newPredecessor[parseInt(n.toString(), 10)]);
22768
23312
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
22769
23313
  }
22770
23314
  }
@@ -23223,7 +23767,7 @@ class Edit$2 {
23223
23767
  let isScheduleValueUpdated = false;
23224
23768
  for (const key of Object.keys(data)) {
23225
23769
  if ([tasks.startDate, tasks.endDate, tasks.duration].indexOf(key) !== -1) {
23226
- if (isNullOrUndefined(data[key]) && !ganttObj.allowUnscheduledTasks) {
23770
+ if (isNullOrUndefined(data[`${key}`]) && !ganttObj.allowUnscheduledTasks) {
23227
23771
  continue;
23228
23772
  }
23229
23773
  if (isFromDialog) {
@@ -23279,7 +23823,7 @@ class Edit$2 {
23279
23823
  else if (key === tasks.name) {
23280
23824
  ganttPropKey = 'taskName';
23281
23825
  }
23282
- else if (key === tasks.segments) {
23826
+ else if ((key === tasks.segments) && (!isNullOrUndefined(ganttData.ganttProperties.segments))) {
23283
23827
  ganttPropKey = 'segments';
23284
23828
  /* eslint-disable-next-line */
23285
23829
  if (data && !isNullOrUndefined(data[this.parent.taskFields.segments]) && data[this.parent.taskFields.segments].length > 0) {
@@ -23569,7 +24113,7 @@ class Edit$2 {
23569
24113
  else if (args.data.childRecords.length > 0 && !isValidatePredecessor) {
23570
24114
  isValidatePredecessor = this.isCheckPredecessor(args.data);
23571
24115
  if (!isValidatePredecessor && this.isTaskbarMoved(args.data)) {
23572
- for (var i = 0; i < args.data.childRecords.length; i++) {
24116
+ for (let i = 0; i < args.data.childRecords.length; i++) {
23573
24117
  if (this.parent.predecessorModule.getValidPredecessor(args.data.childRecords[i]).length > 0) {
23574
24118
  childRecordIndex = i;
23575
24119
  isValidatePredecessor = true;
@@ -23647,8 +24191,10 @@ class Edit$2 {
23647
24191
  */
23648
24192
  updateEditedTask(args) {
23649
24193
  const ganttRecord = args.data;
23650
- this.updateParentChildRecord(ganttRecord);
23651
- if (this.parent.isConnectorLineUpdate) {
24194
+ if (this.parent.autoCalculateDateScheduling) {
24195
+ this.updateParentChildRecord(ganttRecord);
24196
+ }
24197
+ if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
23652
24198
  /* validating predecessor for updated child items */
23653
24199
  for (let i = 0; i < this.validatedChildItems.length; i++) {
23654
24200
  const child = this.validatedChildItems[i];
@@ -23659,7 +24205,7 @@ class Edit$2 {
23659
24205
  }
23660
24206
  this.parent.predecessorModule.isValidatedParentTaskID = '';
23661
24207
  /** validating predecessor for current edited records */
23662
- if (ganttRecord.ganttProperties.predecessorsName) {
24208
+ if (ganttRecord.ganttProperties.predecessor) {
23663
24209
  this.parent.isMileStoneEdited = ganttRecord.ganttProperties.isMilestone;
23664
24210
  if (this.taskbarMoved) {
23665
24211
  this.parent.editedTaskBarItem = ganttRecord;
@@ -23667,7 +24213,7 @@ class Edit$2 {
23667
24213
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
23668
24214
  this.parent.predecessorModule.isValidatedParentTaskID = '';
23669
24215
  }
23670
- if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
24216
+ if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
23671
24217
  (args.action === "DrawConnectorLine")) {
23672
24218
  this.updateChildItems(ganttRecord);
23673
24219
  }
@@ -23675,7 +24221,9 @@ class Edit$2 {
23675
24221
  }
23676
24222
  /** Update parent up-to zeroth level */
23677
24223
  if (ganttRecord.parentItem) {
23678
- this.parent.dataOperation.updateParentItems(ganttRecord, true);
24224
+ if (this.parent.autoCalculateDateScheduling) {
24225
+ this.parent.dataOperation.updateParentItems(ganttRecord, true);
24226
+ }
23679
24227
  let parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
23680
24228
  if (!parentData.ganttProperties.predecessorsName) {
23681
24229
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
@@ -23921,7 +24469,7 @@ class Edit$2 {
23921
24469
  durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
23922
24470
  }
23923
24471
  for (let i = 0; i < childRecords.length; i++) {
23924
- if ((!(this.parent.isUnscheduledTask(childRecords[i].ganttProperties))) && (childRecords[i].ganttProperties.isAutoSchedule)) {
24472
+ if (childRecords[i].ganttProperties.isAutoSchedule) {
23925
24473
  if (durationDiff > 0) {
23926
24474
  const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
23927
24475
  childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
@@ -24038,52 +24586,52 @@ class Edit$2 {
24038
24586
  }
24039
24587
  for (let i = 0; i < eLength; i++) {
24040
24588
  if (e.changedRecords) {
24041
- rec = e.changedRecords[i];
24589
+ rec = e.changedRecords[parseInt(i.toString(), 10)];
24042
24590
  }
24043
24591
  else {
24044
- rec = e[i];
24592
+ rec = e[parseInt(i.toString(), 10)];
24045
24593
  }
24046
24594
  let _aLength = Object.keys(rec).length;
24047
24595
  for (let j = 0, _a = Object.keys(rec); j < _aLength; j++) {
24048
- let key = _a[j];
24049
- this.parent.editedRecords[i][key] = rec[key];
24050
- this.parent.editedRecords[i].taskData[key] = rec[key];
24596
+ let key = _a[parseInt(j.toString(), 10)];
24597
+ this.parent.editedRecords[parseInt(i.toString(), 10)][`${key}`] = rec[`${key}`];
24598
+ this.parent.editedRecords[parseInt(i.toString(), 10)].taskData[`${key}`] = rec[`${key}`];
24051
24599
  }
24052
24600
  if (this.parent.taskFields.id !== null) {
24053
- this.parent.editedRecords[i].ganttProperties["taskId"] = rec[this.parent.taskFields.id];
24601
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskId'] = rec[this.parent.taskFields.id];
24054
24602
  }
24055
24603
  if (this.parent.taskFields.name !== null) {
24056
- this.parent.editedRecords[i].ganttProperties["taskName"] = rec[this.parent.taskFields.name];
24604
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskName'] = rec[this.parent.taskFields.name];
24057
24605
  }
24058
24606
  if (this.parent.taskFields.startDate !== null) {
24059
- this.parent.editedRecords[i].ganttProperties["startDate"] = rec[this.parent.taskFields.startDate];
24607
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['startDate'] = rec[this.parent.taskFields.startDate];
24060
24608
  }
24061
24609
  if (this.parent.taskFields.endDate !== null) {
24062
- this.parent.editedRecords[i].ganttProperties["endDate"] = rec[this.parent.taskFields.endDate];
24610
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['endDate'] = rec[this.parent.taskFields.endDate];
24063
24611
  }
24064
24612
  if (this.parent.taskFields.duration !== null) {
24065
- this.parent.editedRecords[i].ganttProperties["duration"] = parseInt(rec[this.parent.taskFields.duration]);
24613
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['duration'] = parseInt(rec[this.parent.taskFields.duration]);
24066
24614
  }
24067
24615
  if (this.parent.taskFields.durationUnit !== null) {
24068
- this.parent.editedRecords[i].ganttProperties["durationUnit"] = rec[this.parent.taskFields.durationUnit];
24616
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['durationUnit'] = rec[this.parent.taskFields.durationUnit];
24069
24617
  }
24070
24618
  if (this.parent.taskFields.progress !== null) {
24071
- this.parent.editedRecords[i].ganttProperties["progress"] = rec[this.parent.taskFields.progress];
24619
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['progress'] = rec[this.parent.taskFields.progress];
24072
24620
  }
24073
24621
  if (this.parent.taskFields.dependency !== null) {
24074
- this.parent.editedRecords[i].ganttProperties["dependency"] = rec[this.parent.taskFields.dependency];
24622
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['dependency'] = rec[this.parent.taskFields.dependency];
24075
24623
  }
24076
24624
  if (this.parent.taskFields.parentID !== null) {
24077
- this.parent.editedRecords[i].ganttProperties["parentID"] = rec[this.parent.taskFields.parentID];
24625
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['parentID'] = rec[this.parent.taskFields.parentID];
24078
24626
  }
24079
24627
  if (this.parent.taskFields.baselineEndDate !== null) {
24080
- this.parent.editedRecords[i].ganttProperties["baselineEndDate"] = rec[this.parent.taskFields.baselineEndDate];
24628
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineEndDate'] = rec[this.parent.taskFields.baselineEndDate];
24081
24629
  }
24082
24630
  if (this.parent.taskFields.baselineStartDate !== null) {
24083
- this.parent.editedRecords[i].ganttProperties["baselineStartDate"] = rec[this.parent.taskFields.baselineStartDate];
24631
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineStartDate'] = rec[this.parent.taskFields.baselineStartDate];
24084
24632
  }
24085
24633
  if (this.parent.taskFields.resourceInfo !== null) {
24086
- this.parent.editedRecords[i].ganttProperties["resources"] = rec[this.parent.taskFields.resourceInfo];
24634
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['resources'] = rec[this.parent.taskFields.resourceInfo];
24087
24635
  }
24088
24636
  }
24089
24637
  this.saveSuccess(args);
@@ -24152,6 +24700,14 @@ class Edit$2 {
24152
24700
  }
24153
24701
  if (!this.isTreeGridRefresh) {
24154
24702
  this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords);
24703
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
24704
+ this.parent.contentHeight = this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
24705
+ this.parent.ganttChartModule.chartBodyContent.style.height = this.parent.contentHeight + 'px';
24706
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
24707
+ if (this.parent.taskFields.dependency) {
24708
+ this.parent.ganttChartModule.reRenderConnectorLines();
24709
+ }
24710
+ }
24155
24711
  if (this.parent.isConnectorLineUpdate && !isNullOrUndefined(this.parent.connectorLineEditModule)) {
24156
24712
  this.parent.updatedConnectorLineCollection = [];
24157
24713
  this.parent.connectorLineIds = [];
@@ -25048,7 +25604,7 @@ class Edit$2 {
25048
25604
  return !data.hasChildRecords;
25049
25605
  });
25050
25606
  for (let i = 0; i < updateUnAssignedResources.length; i++) {
25051
- const unassignedTask = this.parent.flatData.filter((data) => {
25607
+ let unassignedTask = this.parent.flatData.filter((data) => {
25052
25608
  return data.ganttProperties.taskName === this.parent.localeObj.getConstant('unassignedTask');
25053
25609
  })[0];
25054
25610
  let isDuplicate = [];
@@ -25061,15 +25617,24 @@ class Edit$2 {
25061
25617
  if (parentTask && parentTask.ganttProperties.taskName !==
25062
25618
  this.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
25063
25619
  this.checkWithUnassignedTask(updateUnAssignedResources[i]);
25064
- if (parentTask) {
25065
- this.parent.dataOperation.updateParentItems(updateUnAssignedResources[i].parentItem);
25066
- }
25067
25620
  }
25068
25621
  else if (!parentTask && (!isDuplicate || isDuplicate.length === 0)) {
25069
25622
  this.checkWithUnassignedTask(updateUnAssignedResources[i]);
25070
- if (updateUnAssignedResources[i].parentItem && unassignedTask) {
25071
- this.parent.dataOperation.updateParentItems(updateUnAssignedResources[i].parentItem);
25623
+ }
25624
+ unassignedTask = this.parent.flatData.filter((data) => {
25625
+ return data.ganttProperties.taskName === this.parent.localeObj.getConstant('unassignedTask');
25626
+ })[0];
25627
+ let parentItem = this.parent.currentViewData.filter((data) => {
25628
+ if (data.ganttProperties.taskId == updateUnAssignedResources[i].ganttProperties.taskId && (!data.hasChildRecords && data.parentItem)
25629
+ && unassignedTask.uniqueID === data.parentItem.uniqueID) {
25630
+ return data;
25631
+ }
25632
+ else {
25633
+ return null;
25072
25634
  }
25635
+ });
25636
+ if (parentItem[0]) {
25637
+ this.parent.dataOperation.updateParentItems(parentItem[0]);
25073
25638
  }
25074
25639
  }
25075
25640
  }
@@ -25640,7 +26205,7 @@ class Edit$2 {
25640
26205
  let tempTaskID = this.parent.taskFields.id;
25641
26206
  if (this.parent.editModule && this.parent.editSettings.allowAdding) {
25642
26207
  this.parent.isDynamicData = true;
25643
- const cAddedRecord = [];
26208
+ let cAddedRecord = [];
25644
26209
  if (isNullOrUndefined(data)) {
25645
26210
  this.validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord);
25646
26211
  }
@@ -25670,7 +26235,7 @@ class Edit$2 {
25670
26235
  if (!isNullOrUndefined(ganttData)) {
25671
26236
  this.validateUpdateValues(args.newTaskData, ganttData, true);
25672
26237
  }
25673
- if (!isNullOrUndefined(args.data[tempTaskID])) {
26238
+ if (!isNullOrUndefined(args.data[`${tempTaskID}`])) {
25674
26239
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
25675
26240
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
25676
26241
  args.newTaskData[tempTaskID] = args.data[tempTaskID];
@@ -25713,7 +26278,6 @@ class Edit$2 {
25713
26278
  const addedRecords = 'addedRecords';
25714
26279
  const insertCrud = data.insert(updatedData[addedRecords], null, query);
25715
26280
  insertCrud.then((e) => {
25716
- const changedRecords = 'changedRecords';
25717
26281
  let addedRecords;
25718
26282
  if (!isNullOrUndefined(e[0])) {
25719
26283
  addedRecords = e[0];
@@ -25721,26 +26285,7 @@ class Edit$2 {
25721
26285
  else {
25722
26286
  addedRecords = updatedData['addedRecords'][0];
25723
26287
  }
25724
- /* tslint:disable-next-line */
25725
- const updateCrud = data.update(this.parent.taskFields.id, updatedData[changedRecords], null, query);
25726
- updateCrud.then(() => {
25727
- if (this.parent.taskFields.id && !isNullOrUndefined(addedRecords[this.parent.taskFields.id]) &&
25728
- addedRecords[this.parent.taskFields.id].toString() !== prevID) {
25729
- this.parent.setRecordValue('taskId', addedRecords[this.parent.taskFields.id], args.data.ganttProperties, true);
25730
- this.parent.setRecordValue('taskData.' + this.parent.taskFields.id, addedRecords[this.parent.taskFields.id], args.data);
25731
- this.parent.setRecordValue(this.parent.taskFields.id, addedRecords[this.parent.taskFields.id], args.data);
25732
- this.parent.setRecordValue('rowUniqueID', addedRecords[this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
25733
- const idIndex = this.parent.ids.indexOf(prevID);
25734
- if (idIndex !== -1) {
25735
- this.parent.ids[idIndex] = addedRecords[this.parent.taskFields.id].toString();
25736
- }
25737
- }
25738
- this.updateNewRecord(cAddedRecord, args);
25739
- }).catch((e) => {
25740
- this.removeAddedRecord();
25741
- this.dmFailure(e, args);
25742
- this._resetProperties();
25743
- });
26288
+ this.updateNewRecord(cAddedRecord, args);
25744
26289
  }).catch((e) => {
25745
26290
  this.removeAddedRecord();
25746
26291
  this.dmFailure(e, args);
@@ -26966,9 +27511,95 @@ class Filter$1 {
26966
27511
  }
26967
27512
  }
26968
27513
  }
27514
+ setPosition(li, ul) {
27515
+ const gridPos = this.parent.element.getBoundingClientRect();
27516
+ let gridPosTop = gridPos.top;
27517
+ let gridPosLeft = gridPos.left;
27518
+ let parentNode;
27519
+ let parentNodeTop;
27520
+ let parentNodeLeft;
27521
+ let paddingTop;
27522
+ let paddingLeft;
27523
+ let marginTop;
27524
+ let marginLeft;
27525
+ if (!isNullOrUndefined(this.parent.element.parentNode) && this.parent.element.parentNode['tagName'] != 'BODY') {
27526
+ parentNode = this.parent.element.parentNode;
27527
+ parentNodeTop = parentNode.getBoundingClientRect().top;
27528
+ marginTop = parentNode.style.marginTop;
27529
+ while (true) {
27530
+ if (Math.abs(gridPosTop) > Math.abs(parentNodeTop)) {
27531
+ paddingTop = gridPosTop - parentNodeTop;
27532
+ break;
27533
+ }
27534
+ if (!isNullOrUndefined(this.parent.element.parentNode)) {
27535
+ parentNode = parentNode.parentNode;
27536
+ marginTop = parentNode.parentNode.style.marginTop;
27537
+ }
27538
+ parentNodeTop = parentNode.getBoundingClientRect().top;
27539
+ }
27540
+ parentNodeLeft = parentNode.getBoundingClientRect().left;
27541
+ marginLeft = parentNode.style.marginLeft;
27542
+ while (true) {
27543
+ if (Math.abs(gridPosLeft) > Math.abs(parentNodeLeft)) {
27544
+ paddingLeft = gridPosLeft - parentNodeLeft;
27545
+ break;
27546
+ }
27547
+ if (!isNullOrUndefined(this.parent.element.parentNode)) {
27548
+ parentNode = parentNode.parentNode;
27549
+ marginLeft = parentNode.style.marginLeft;
27550
+ }
27551
+ parentNodeLeft = parentNode.getBoundingClientRect().left;
27552
+ }
27553
+ }
27554
+ let liPos = li.getBoundingClientRect();
27555
+ let left = liPos.right + window.scrollX;
27556
+ let top = liPos.top + window.scrollY;
27557
+ if (gridPos.right < (left + ul.offsetWidth)) {
27558
+ if ((liPos.left - ul.offsetWidth) > gridPos.left) {
27559
+ left = (liPos.left - ul.offsetWidth);
27560
+ }
27561
+ else {
27562
+ left -= (left + ul.offsetWidth) - gridPos.right;
27563
+ }
27564
+ }
27565
+ else {
27566
+ if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
27567
+ left = Math.abs(liPos.right - gridPos.left);
27568
+ top = Math.abs(liPos.top - gridPos.top);
27569
+ }
27570
+ }
27571
+ if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
27572
+ ul.style.top = typeof (parseInt(marginTop)) === "string" ? (top + paddingTop + parseInt(marginTop)) + 'px' : (top + paddingTop) + 'px';
27573
+ ul.style.left = typeof (parseInt(marginLeft)) === "string" ? (left + paddingLeft + parseInt(marginLeft) + 8) + 'px' : (left + paddingLeft) + 'px';
27574
+ }
27575
+ else {
27576
+ ul.style.top = top + 'px';
27577
+ ul.style.left = left + 'px';
27578
+ }
27579
+ }
26969
27580
  updateFilterMenuPosition(element, args) {
26970
27581
  addClass([element], 'e-gantt');
26971
- document.querySelector('#' + this.parent.treeGrid.grid.element.id).appendChild(element);
27582
+ document.querySelector('#' + this.parent.controlId).appendChild(element);
27583
+ let targetElement;
27584
+ if (this.parent.showColumnMenu) {
27585
+ targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
27586
+ element.style.zIndex = targetElement.parentElement.style.zIndex;
27587
+ if (this.parent.treeGrid.filterSettings.type === 'Menu') {
27588
+ this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
27589
+ }
27590
+ else {
27591
+ this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
27592
+ }
27593
+ }
27594
+ else {
27595
+ targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
27596
+ if (this.parent.treeGrid.filterSettings.type === 'Menu') {
27597
+ getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
27598
+ }
27599
+ else {
27600
+ getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
27601
+ }
27602
+ }
26972
27603
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
26973
27604
  element.querySelector('.e-valid-input').focus();
26974
27605
  }
@@ -27384,7 +28015,10 @@ class Selection$1 {
27384
28015
  const rIndex = parseInt(selectedRow.getAttribute('aria-rowindex'), 10);
27385
28016
  const isToggle = this.parent.selectionSettings.enableToggle;
27386
28017
  if (this.parent.selectionSettings.type === 'Single' || (!this.isMultiCtrlRequest && !this.isMultiShiftRequest)) {
27387
- this.selectRow(rIndex, isToggle);
28018
+ if (!this.parent.allowTaskbarDragAndDrop || (this.parent.allowTaskbarDragAndDrop && (this.parent.rowDragAndDropModule &&
28019
+ !this.parent.rowDragAndDropModule['draggedRecord']))) {
28020
+ this.selectRow(rIndex, isToggle);
28021
+ }
27388
28022
  }
27389
28023
  else {
27390
28024
  if (this.isMultiShiftRequest) {
@@ -27428,7 +28062,7 @@ class Selection$1 {
27428
28062
  }
27429
28063
  addRemoveClass(records) {
27430
28064
  if (typeof (records) == "number") {
27431
- records = Array.from(String(records), (num) => Number(num));
28065
+ records = [records];
27432
28066
  }
27433
28067
  const ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
27434
28068
  for (let i = 0; i < records.length; i++) {
@@ -28202,6 +28836,9 @@ class NonWorkingDay {
28202
28836
  });
28203
28837
  const property = this.parent.disableHtmlEncode ? 'textContent' : 'innerHTML';
28204
28838
  spanElement[property] = this.parent.holidays[i].label ? this.parent.holidays[i].label : '';
28839
+ if (this.parent.enableHtmlSanitizer && typeof (spanElement[property]) === 'string') {
28840
+ spanElement[property] = SanitizeHtmlHelper.sanitize(spanElement[property]);
28841
+ }
28205
28842
  holidayDiv.appendChild(spanElement);
28206
28843
  if (this.parent.holidays[i].cssClass) {
28207
28844
  holidayDiv.classList.add(this.parent.holidays[i].cssClass);
@@ -28387,6 +29024,9 @@ class EventMarker$1 {
28387
29024
  });
28388
29025
  const property = this.parent.disableHtmlEncode ? 'textContent' : 'innerHTML';
28389
29026
  spanElement[property] = this.parent.eventMarkers[i].label;
29027
+ if (this.parent.enableHtmlSanitizer && typeof (spanElement[property]) === 'string') {
29028
+ spanElement[property] = SanitizeHtmlHelper.sanitize(spanElement[property]);
29029
+ }
28390
29030
  if (this.parent.enableRtl) {
28391
29031
  spanElement.style.right = '5px';
28392
29032
  }
@@ -29182,10 +29822,10 @@ class CriticalPath {
29182
29822
  for (let i = 0; i < criticalPathIds.length; i++) {
29183
29823
  let criticalData;
29184
29824
  if (this.parent.viewType === 'ProjectView') {
29185
- criticalData = this.parent.currentViewData[this.parent.ids.indexOf(criticalPathIds[i].toString())];
29825
+ criticalData = this.parent.flatData[this.parent.ids.indexOf(criticalPathIds[i].toString())];
29186
29826
  }
29187
29827
  else {
29188
- let currentRecords = this.parent.currentViewData.filter((data) => {
29828
+ let currentRecords = this.parent.flatData.filter((data) => {
29189
29829
  return (data.ganttProperties.taskId).toString() === criticalPathIds[i].toString();
29190
29830
  });
29191
29831
  for (let i = 0; i < currentRecords.length; i++) {
@@ -29198,16 +29838,18 @@ class CriticalPath {
29198
29838
  const element = this.parent.getRowByIndex(index);
29199
29839
  let taskClass;
29200
29840
  const columnFields = this.parent.taskFields;
29201
- if (criticalData.parentItem) {
29841
+ if (criticalData && criticalData.parentItem) {
29202
29842
  const parentRecord = this.parent.currentViewData.filter((data) => {
29203
29843
  return criticalData.parentItem.uniqueID === data.uniqueID;
29204
29844
  });
29205
- const parentIndex = this.parent.currentViewData.indexOf(parentRecord[0]);
29845
+ const parentIndex = this.parent.flatData.indexOf(parentRecord[0]);
29206
29846
  const parentElement = this.parent.getRowByIndex(parentIndex);
29207
- let parentTaskbarElement = parentElement.querySelectorAll('.e-taskbar-main-container');
29208
- for (let i = 0; i < parentTaskbarElement.length; i++) {
29209
- if (parentTaskbarElement[i].getAttribute('rowuniqueid') === criticalData['rowUniqueID']) {
29210
- addClass(parentTaskbarElement[i].querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
29847
+ if (parentElement) {
29848
+ let parentTaskbarElement = parentElement.querySelectorAll('.e-taskbar-main-container');
29849
+ for (let i = 0; i < parentTaskbarElement.length; i++) {
29850
+ if (parentTaskbarElement[i].getAttribute('rowuniqueid') === criticalData['rowUniqueID']) {
29851
+ addClass(parentTaskbarElement[i].querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
29852
+ }
29211
29853
  }
29212
29854
  }
29213
29855
  }
@@ -29617,7 +30259,7 @@ class ContextMenu$2 {
29617
30259
  this.parent.selectionModule.selectRow(rowIndex);
29618
30260
  }
29619
30261
  if (!args.parentItem) {
29620
- this.rowData = this.parent.updatedRecords[rowIndex];
30262
+ this.rowData = this.parent.updatedRecords[parseInt(rowIndex.toString(), 10)];
29621
30263
  }
29622
30264
  for (const item of args.items) {
29623
30265
  // let target: EventTarget = target;
@@ -29748,7 +30390,7 @@ class ContextMenu$2 {
29748
30390
  this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
29749
30391
  const prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
29750
30392
  if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
29751
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
30393
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[parseInt(index.toString(), 10)].level - prevRecord.level === 1) {
29752
30394
  this.updateItemVisibility(item.text);
29753
30395
  }
29754
30396
  }
@@ -29764,7 +30406,7 @@ class ContextMenu$2 {
29764
30406
  const isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
29765
30407
  this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
29766
30408
  if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
29767
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
30409
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[parseInt(ind.toString(), 10)].level === 0) {
29768
30410
  this.updateItemVisibility(item.text);
29769
30411
  }
29770
30412
  }
@@ -29774,7 +30416,7 @@ class ContextMenu$2 {
29774
30416
  {
29775
30417
  const taskSettings = this.parent.taskFields;
29776
30418
  if (this.parent.readOnly || !taskbarElement || isNullOrUndefined(taskSettings.segments) ||
29777
- this.parent.currentViewData[rowIndex].hasChildRecords) {
30419
+ this.parent.currentViewData[parseInt(rowIndex.toString(), 10)].hasChildRecords) {
29778
30420
  this.updateItemVisibility(item.text);
29779
30421
  }
29780
30422
  break;
@@ -29977,7 +30619,7 @@ class ContextMenu$2 {
29977
30619
  }
29978
30620
  contextMenuOnClose(args) {
29979
30621
  const parent = 'parentObj';
29980
- if (args.items.length > 0 && args.items[0][parent] instanceof ContextMenu$1) {
30622
+ if (args.items.length > 0 && args.items[0][`${parent}`] instanceof ContextMenu$1) {
29981
30623
  this.revertItemStatus();
29982
30624
  }
29983
30625
  }
@@ -30447,7 +31089,7 @@ class RowDD$1 {
30447
31089
  parentUniqueID = this.droppedRecord.uniqueID;
30448
31090
  }
30449
31091
  else {
30450
- parentUniqueID = this.droppedRecord.parentItem.uniqueID;
31092
+ parentUniqueID = this.droppedRecord.parentItem ? this.droppedRecord.parentItem.uniqueID : this.droppedRecord.uniqueID;
30451
31093
  }
30452
31094
  const droppedParentItem = this.parent.getTaskByUniqueID(parentUniqueID);
30453
31095
  const editedObj = {};
@@ -30474,7 +31116,7 @@ class RowDD$1 {
30474
31116
  this.updateSharedResourceTask();
30475
31117
  }
30476
31118
  }
30477
- if (this.parent.taskFields.dependency) {
31119
+ if (this.parent.taskFields.dependency && this.parent.allowParentDependency) {
30478
31120
  let isValidPredecessor = true;
30479
31121
  let draggedParent;
30480
31122
  let toParent;
@@ -33553,6 +34195,12 @@ class ExportHelper {
33553
34195
  cell.style.padding.bottom = padding - style.fontSize;
33554
34196
  cell.style.padding.left = 10;
33555
34197
  cell.style.padding.right = 10;
34198
+ if (style.padding) {
34199
+ cell.style.padding = style.padding;
34200
+ }
34201
+ if (style.borders) {
34202
+ cell.style.borders = style.borders;
34203
+ }
33556
34204
  }
33557
34205
  /**
33558
34206
  * @param {PdfDocument} pdfDoc .
@@ -34951,7 +35599,8 @@ class PdfExport {
34951
35599
  * @param {object} pdfDoc .
34952
35600
  * @returns {Promise<Object>} .
34953
35601
  */
34954
- export(pdfExportProperties, isMultipleExport, pdfDoc) {
35602
+ export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
35603
+ this.isBlob = isBlob;
34955
35604
  const args = {
34956
35605
  requestType: 'beforePdfExport',
34957
35606
  ganttObject: this.parent,
@@ -34994,7 +35643,7 @@ class PdfExport {
34994
35643
  this.pdfDocument = new PdfDocument();
34995
35644
  }
34996
35645
  this.processExport(data, pdfExportProperties, isMultipleExport).then(() => {
34997
- this.parent.trigger('pdfExportComplete', {});
35646
+ this.parent.trigger('pdfExportComplete', this.isBlob ? { promise: this.blobPromise } : {});
34998
35647
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
34999
35648
  this.parent.hideMaskRow();
35000
35649
  }
@@ -35019,12 +35668,17 @@ class PdfExport {
35019
35668
  const layouter = this.gantt.drawGrid(pdfPage, 0, 0, format);
35020
35669
  this.gantt.drawChart(layouter);
35021
35670
  if (!isMultipleExport) {
35022
- // save the PDF
35023
- if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
35024
- this.pdfDocument.save(pdfExportProperties.fileName);
35671
+ if (!this.isBlob) {
35672
+ // save the PDF
35673
+ if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
35674
+ this.pdfDocument.save(pdfExportProperties.fileName);
35675
+ }
35676
+ else {
35677
+ this.pdfDocument.save('Export.pdf');
35678
+ }
35025
35679
  }
35026
35680
  else {
35027
- this.pdfDocument.save('Export.pdf');
35681
+ this.blobPromise = this.pdfDocument.save();
35028
35682
  }
35029
35683
  this.pdfDocument.destroy();
35030
35684
  }