@syncfusion/ej2-gantt 20.4.54 → 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 (93) hide show
  1. package/CHANGELOG.md +14 -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 +1086 -419
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +1064 -397
  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/dependency.js +28 -12
  20. package/src/gantt/actions/dialog-edit.js +41 -21
  21. package/src/gantt/actions/edit.js +51 -30
  22. package/src/gantt/actions/filter.d.ts +2 -1
  23. package/src/gantt/actions/filter.js +88 -2
  24. package/src/gantt/actions/keyboard.js +0 -1
  25. package/src/gantt/actions/pdf-export.d.ts +3 -1
  26. package/src/gantt/actions/pdf-export.js +12 -6
  27. package/src/gantt/actions/rowdragdrop.js +2 -2
  28. package/src/gantt/actions/selection.js +5 -2
  29. package/src/gantt/actions/taskbar-edit.d.ts +5 -0
  30. package/src/gantt/actions/taskbar-edit.js +114 -10
  31. package/src/gantt/base/date-processor.js +78 -52
  32. package/src/gantt/base/gantt-chart.js +20 -4
  33. package/src/gantt/base/gantt-model.d.ts +43 -0
  34. package/src/gantt/base/gantt.d.ts +39 -1
  35. package/src/gantt/base/gantt.js +78 -33
  36. package/src/gantt/base/interface.d.ts +2 -0
  37. package/src/gantt/base/task-processor.js +135 -98
  38. package/src/gantt/base/tree-grid.js +31 -1
  39. package/src/gantt/base/utils.js +1 -1
  40. package/src/gantt/renderer/chart-rows.d.ts +2 -0
  41. package/src/gantt/renderer/chart-rows.js +156 -24
  42. package/src/gantt/renderer/connector-line.js +50 -20
  43. package/src/gantt/renderer/edit-tooltip.js +0 -3
  44. package/src/gantt/renderer/event-marker.js +4 -1
  45. package/src/gantt/renderer/nonworking-day.js +4 -1
  46. package/src/gantt/renderer/timeline.js +3 -3
  47. package/src/gantt/renderer/tooltip.js +101 -33
  48. package/styles/bootstrap-dark.css +33 -10
  49. package/styles/bootstrap.css +31 -10
  50. package/styles/bootstrap4.css +28 -7
  51. package/styles/bootstrap5-dark.css +30 -9
  52. package/styles/bootstrap5.css +30 -9
  53. package/styles/fabric-dark.css +28 -7
  54. package/styles/fabric.css +28 -7
  55. package/styles/fluent-dark.css +56 -29
  56. package/styles/fluent.css +56 -29
  57. package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
  58. package/styles/gantt/_bootstrap-definition.scss +5 -4
  59. package/styles/gantt/_bootstrap4-definition.scss +3 -2
  60. package/styles/gantt/_bootstrap5-definition.scss +15 -14
  61. package/styles/gantt/_fabric-dark-definition.scss +3 -2
  62. package/styles/gantt/_fabric-definition.scss +3 -2
  63. package/styles/gantt/_fluent-definition.scss +18 -17
  64. package/styles/gantt/_fusionnew-definition.scss +5 -4
  65. package/styles/gantt/_highcontrast-definition.scss +3 -2
  66. package/styles/gantt/_highcontrast-light-definition.scss +3 -2
  67. package/styles/gantt/_layout.scss +45 -13
  68. package/styles/gantt/_material-dark-definition.scss +3 -2
  69. package/styles/gantt/_material-definition.scss +3 -2
  70. package/styles/gantt/_tailwind-definition.scss +9 -8
  71. package/styles/gantt/_theme.scss +25 -6
  72. package/styles/gantt/bootstrap-dark.css +33 -10
  73. package/styles/gantt/bootstrap.css +31 -10
  74. package/styles/gantt/bootstrap4.css +28 -7
  75. package/styles/gantt/bootstrap5-dark.css +30 -9
  76. package/styles/gantt/bootstrap5.css +30 -9
  77. package/styles/gantt/fabric-dark.css +28 -7
  78. package/styles/gantt/fabric.css +28 -7
  79. package/styles/gantt/fluent-dark.css +56 -29
  80. package/styles/gantt/fluent.css +56 -29
  81. package/styles/gantt/highcontrast-light.css +28 -9
  82. package/styles/gantt/highcontrast.css +28 -7
  83. package/styles/gantt/material-dark.css +31 -14
  84. package/styles/gantt/material.css +28 -7
  85. package/styles/gantt/tailwind-dark.css +28 -7
  86. package/styles/gantt/tailwind.css +28 -7
  87. package/styles/highcontrast-light.css +28 -9
  88. package/styles/highcontrast.css +28 -7
  89. package/styles/material-dark.css +31 -14
  90. package/styles/material.css +28 -7
  91. package/styles/tailwind-dark.css +28 -7
  92. package/styles/tailwind.css +28 -7
  93. 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);
@@ -3733,105 +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
- totalDuration += getValue('totalDuration', progressValues);
3783
- totalDuration = Number(totalDuration.toFixed(4));
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) {
3830
+ totalDuration += getValue('totalDuration', progressValues);
3831
+ totalDuration = Number(totalDuration.toFixed(4));
3832
+ }
3833
+ else {
3834
+ totalDuration += getValue('totalDuration', progressValues);
3835
+ }
3784
3836
  }
3785
3837
  else {
3786
- totalDuration += getValue('totalDuration', progressValues);
3838
+ milestoneCount++;
3787
3839
  }
3840
+ childCompletedWorks += childData.ganttProperties.work;
3788
3841
  }
3789
- else {
3790
- milestoneCount++;
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);
3791
3890
  }
3792
- childCompletedWorks += childData.ganttProperties.work;
3793
- }
3794
- if (!deleteUpdate) {
3795
- if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3796
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3797
- }
3798
- if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3799
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3800
- }
3801
- let taskCount;
3802
- if (this.parent.isOnDelete && childData.isDelete) {
3803
- taskCount = childLength - milestoneCount - 1;
3804
- }
3805
- else {
3806
- taskCount = childLength - milestoneCount;
3807
- }
3808
- const parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
3809
- const parentProp = parentData.ganttProperties;
3810
- const milestone = (taskCount === 0) && minStartDate && maxEndDate &&
3811
- minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3812
- this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
3813
- if (parentProp.isAutoSchedule) {
3814
- this.calculateDuration(parentData);
3815
- }
3816
- this.updateWorkWithDuration(parentData);
3817
- let parentWork = parentProp.work;
3818
- parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
3819
- this.parent.setRecordValue('work', parentWork, parentProp, true);
3820
- this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
3821
- if (!isNullOrUndefined(this.parent.taskFields.type)) {
3822
- this.updateMappingData(parentData, 'type');
3823
- }
3824
- this.parent.setRecordValue('progress', Math.floor(parentProgress), parentProp, true);
3825
- this.parent.setRecordValue('totalProgress', totalProgress, parentProp, true);
3826
- this.parent.setRecordValue('totalDuration', totalDuration, parentProp, true);
3827
- if (!parentProp.isAutoSchedule) {
3828
- this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
3829
- this.updateAutoWidthLeft(parentData);
3830
- }
3831
- this.updateWidthLeft(parentData);
3832
- this.updateTaskData(parentData);
3833
3891
  }
3834
3892
  }
3893
+ else {
3894
+ parentData.ganttProperties.endDate = parentData.taskData[this.parent.taskFields.endDate];
3895
+ }
3835
3896
  if (deleteUpdate && parentData.childRecords.length === 1 && parentData.ganttProperties.duration === 0) {
3836
3897
  this.parent.setRecordValue('isMilestone', true, parentData.ganttProperties, true);
3837
3898
  this.updateWidthLeft(parentData);
@@ -3839,7 +3900,9 @@ class TaskProcessor extends DateProcessor {
3839
3900
  }
3840
3901
  const parentItem = this.parent.getParentTask(parentData.parentItem);
3841
3902
  if (parentItem) {
3842
- this.updateParentItems(parentItem);
3903
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
3904
+ this.updateParentItems(parentItem);
3905
+ }
3843
3906
  }
3844
3907
  deleteUpdate = false;
3845
3908
  }
@@ -4090,20 +4153,30 @@ class ChartScroll {
4090
4153
  }
4091
4154
  }
4092
4155
  removeShimmer() {
4093
- let parent = this.parent;
4156
+ const parent = this.parent;
4094
4157
  setTimeout(function () {
4095
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
+ }
4096
4170
  }, 0);
4097
4171
  }
4098
- ;
4099
4172
  updateShimmer() {
4100
- let parent = this.parent;
4173
+ const parent = this.parent;
4101
4174
  setTimeout(function () {
4102
4175
  parent.showMaskRow();
4103
4176
  }, 0);
4104
4177
  }
4105
4178
  updateSpinner() {
4106
- let parent = this.parent;
4179
+ const parent = this.parent;
4107
4180
  this.parent.showSpinner();
4108
4181
  window.clearTimeout(this.isScrolling);
4109
4182
  this.isScrolling = setTimeout(function () {
@@ -4135,11 +4208,11 @@ class ChartScroll {
4135
4208
  scrollArgs.scrollDirection = 'Horizontal';
4136
4209
  scrollArgs.action = 'HorizontalScroll';
4137
4210
  }
4138
- 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
4139
4212
  || isNullOrUndefined(this.parent.isToolBarClick))) {
4140
4213
  this.parent.isVirtualScroll = true;
4141
4214
  if (this.parent.showIndicator || isNullOrUndefined(this.parent.showIndicator)) {
4142
- 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') {
4143
4216
  this.updateSpinner();
4144
4217
  }
4145
4218
  }
@@ -4183,11 +4256,12 @@ class ChartScroll {
4183
4256
  * To set scroll left for chart scroll container
4184
4257
  *
4185
4258
  * @param {number} scrollLeft - To set scroll left for scroll container
4259
+ * @param {number} leftSign - specifies left sign
4186
4260
  * @returns {void} .
4187
4261
  */
4188
4262
  setScrollLeft(scrollLeft, leftSign) {
4189
4263
  if (leftSign) {
4190
- scrollLeft = leftSign == -1 && this.parent.enableRtl ? -scrollLeft : scrollLeft;
4264
+ scrollLeft = leftSign === -1 && this.parent.enableRtl ? -scrollLeft : scrollLeft;
4191
4265
  }
4192
4266
  this.element.scrollLeft = scrollLeft;
4193
4267
  this.parent.ganttChartModule.chartTimelineContainer.scrollLeft = this.element.scrollLeft;
@@ -4343,9 +4417,11 @@ class GanttChart {
4343
4417
  }
4344
4418
  else {
4345
4419
  if (this.parent.viewType === 'ProjectView') {
4346
- 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
+ }
4347
4423
  }
4348
- 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]) {
4349
4425
  this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[0].setAttribute('tabindex', '-1');
4350
4426
  }
4351
4427
  }
@@ -4398,7 +4474,14 @@ class GanttChart {
4398
4474
  Math.floor((this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight));
4399
4475
  }
4400
4476
  renderRange(rangeCollection, currentRecord) {
4401
- 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
+ }
4402
4485
  const sameIDElement = this.rangeViewContainer.querySelector('.' + 'rangeContainer' + currentRecord.ganttProperties.rowUniqueID);
4403
4486
  if (sameIDElement) {
4404
4487
  sameIDElement.remove();
@@ -4411,7 +4494,14 @@ class GanttChart {
4411
4494
  return;
4412
4495
  }
4413
4496
  for (let i = 0; i < rangeCollection.length; i++) {
4414
- 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
+ }
4415
4505
  const leftDiv = createElement('div', {
4416
4506
  className: rangeChildContainer + ' ' + 'e-leftarc', styles: (this.parent.enableRtl ? 'right:' : 'left:') +
4417
4507
  `${(this.parent.enableRtl ? rangeCollection[i].left + rangeCollection[i].width - 5 : rangeCollection[i].left)}px;
@@ -5717,7 +5807,7 @@ class Timeline {
5717
5807
  else {
5718
5808
  const value = property === 'topTier' ? 'bottomTier' : 'topTier';
5719
5809
  const assignValue = 'bottomTier';
5720
- if (newTimeline[assignValue].unit != "None") {
5810
+ if (newTimeline[`${assignValue}`].unit != "None") {
5721
5811
  this.customTimelineSettings[value] = Object.assign({}, newTimeline[assignValue]);
5722
5812
  }
5723
5813
  }
@@ -6018,7 +6108,7 @@ class Timeline {
6018
6108
  else {
6019
6109
  secondValue = sortedUnitLevels[i + 1];
6020
6110
  }
6021
- if (count >= firstValue[tier].count) {
6111
+ if (count >= firstValue[`${tier}`].count) {
6022
6112
  currentZoomCollection = sortedUnitLevels[i];
6023
6113
  checkSameCountLevels = sortedUnitLevels.filter((tempLevel) => {
6024
6114
  if (tier === "bottomTier") {
@@ -6036,7 +6126,7 @@ class Timeline {
6036
6126
  }
6037
6127
  break;
6038
6128
  }
6039
- else if (count < firstValue[tier].count && count > secondValue[tier].count) {
6129
+ else if (count < firstValue[`${tier}`].count && count > secondValue[`${tier}`].count) {
6040
6130
  currentZoomCollection = sortedUnitLevels[i + 1];
6041
6131
  checkSameCountLevels = sortedUnitLevels.filter((tempLevel) => {
6042
6132
  if (tier === "bottomTier") {
@@ -7113,6 +7203,15 @@ class GanttTreeGrid {
7113
7203
  this.columnMenuOpen = (args) => {
7114
7204
  this.parent.notify('columnMenuOpen', args);
7115
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
+ });
7116
7215
  };
7117
7216
  this.columnMenuClick = (args) => {
7118
7217
  this.parent.trigger('columnMenuClick', args);
@@ -7144,6 +7243,7 @@ class GanttTreeGrid {
7144
7243
  this.parent.treeGrid = new TreeGrid();
7145
7244
  this.parent.treeGrid.allowSelection = false;
7146
7245
  this.parent.treeGrid.allowKeyboard = this.parent.allowKeyboard;
7246
+ this.parent.treeGrid['${enableHtmlSanitizer}'] = this.parent.enableHtmlSanitizer;
7147
7247
  this.parent.treeGrid.enableImmutableMode = this.parent.enableImmutableMode;
7148
7248
  this.treeGridColumns = [];
7149
7249
  if (!this.parent.isLocaleChanged && this.parent.isLoad) {
@@ -7334,6 +7434,12 @@ class GanttTreeGrid {
7334
7434
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
7335
7435
  const collapsedArgs = this.createExpandCollapseArgs(args);
7336
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
+ }
7337
7443
  }
7338
7444
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
7339
7445
  this.parent.hideMaskRow();
@@ -7347,6 +7453,12 @@ class GanttTreeGrid {
7347
7453
  if (!args['data'].length) {
7348
7454
  const expandedArgs = this.createExpandCollapseArgs(args);
7349
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
+ }
7350
7462
  }
7351
7463
  }
7352
7464
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
@@ -7439,6 +7551,14 @@ class GanttTreeGrid {
7439
7551
  this.parent.addDeleteRecord = false;
7440
7552
  }
7441
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
+ }
7442
7562
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
7443
7563
  this.parent.hideMaskRow();
7444
7564
  }
@@ -8584,8 +8704,12 @@ class ChartRows extends DateProcessor {
8584
8704
  }
8585
8705
  }
8586
8706
  else {
8587
- labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
8707
+ const field = this.parent.labelSettings.taskLabel;
8708
+ labelString = this.getTaskLabel(field);
8588
8709
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8710
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
8711
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
8712
+ }
8589
8713
  }
8590
8714
  if (labelString.indexOf('null') === -1) {
8591
8715
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -8597,7 +8721,7 @@ class ChartRows extends DateProcessor {
8597
8721
  (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
8598
8722
  'display:' + 'inline-block;' +
8599
8723
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8600
- this.taskBarHeight + 'px;">' + labelString + '</span>';
8724
+ this.taskBarHeight + 'px;"></span>';
8601
8725
  }
8602
8726
  else {
8603
8727
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
@@ -8605,7 +8729,7 @@ class ChartRows extends DateProcessor {
8605
8729
  (this.parent.enableRtl ? 'right;' : 'left;')) : '') +
8606
8730
  +(this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8607
8731
  +(this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
8608
- this.taskBarHeight + 'px;">' + labelString + '</span>';
8732
+ this.taskBarHeight + 'px;"></span>';
8609
8733
  }
8610
8734
  }
8611
8735
  const template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
@@ -8631,6 +8755,7 @@ class ChartRows extends DateProcessor {
8631
8755
  data.ganttProperties.segments.length === 0))) {
8632
8756
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8633
8757
  let templateElement = this.createDivElement(template)[0];
8758
+ templateElement.innerText = labelString;
8634
8759
  let childLabel = this.parent.labelSettings.taskLabel;
8635
8760
  if (childLabel && childLabel['elementRef'])
8636
8761
  templateElement.appendChild(tempDiv);
@@ -9113,6 +9238,11 @@ class ChartRows extends DateProcessor {
9113
9238
  if (labelString) {
9114
9239
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
9115
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
+ }
9116
9246
  }
9117
9247
  }
9118
9248
  if (leftLabelTemplateNode && leftLabelTemplateNode.length > 0) {
@@ -9163,6 +9293,11 @@ class ChartRows extends DateProcessor {
9163
9293
  if (labelString) {
9164
9294
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
9165
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
+ }
9166
9301
  }
9167
9302
  }
9168
9303
  if (rightLabelTemplateNode && rightLabelTemplateNode.length > 0) {
@@ -9214,7 +9349,7 @@ class ChartRows extends DateProcessor {
9214
9349
  '<div class="' + manualParentMilestoneBottom + '" style="top:' +
9215
9350
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
9216
9351
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
9217
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : template);
9352
+ return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
9218
9353
  }
9219
9354
  /**
9220
9355
  * To get parent taskbar node.
@@ -9258,6 +9393,9 @@ class ChartRows extends DateProcessor {
9258
9393
  else {
9259
9394
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
9260
9395
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
9396
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
9397
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
9398
+ }
9261
9399
  }
9262
9400
  if (labelString.indexOf('null') === -1) {
9263
9401
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -9270,7 +9408,7 @@ class ChartRows extends DateProcessor {
9270
9408
  'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
9271
9409
  'display:' + 'inline-block;' +
9272
9410
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
9273
- this.taskBarHeight + 'px;">' + labelString + '</span>';
9411
+ this.taskBarHeight + 'px;"></span>';
9274
9412
  }
9275
9413
  else {
9276
9414
  labelDiv = '<span class="' +
@@ -9280,9 +9418,10 @@ class ChartRows extends DateProcessor {
9280
9418
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9281
9419
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
9282
9420
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9283
- this.taskBarHeight + 'px;">' + labelString + '</span>';
9421
+ this.taskBarHeight + 'px;"></span>';
9284
9422
  }
9285
9423
  let labelElement = this.createDivElement(labelDiv)[0];
9424
+ labelElement.innerText = labelString;
9286
9425
  let parentLabel = this.parent.labelSettings.taskLabel;
9287
9426
  if (parentLabel && parentLabel['elementRef'])
9288
9427
  labelElement.appendChild(div);
@@ -9449,7 +9588,7 @@ class ChartRows extends DateProcessor {
9449
9588
  const mileStoneLeft = -(this.connectorPointWidth + 2);
9450
9589
  const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
9451
9590
  let marginTop;
9452
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
9591
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
9453
9592
  marginTop = '';
9454
9593
  }
9455
9594
  else {
@@ -9468,7 +9607,7 @@ class ChartRows extends DateProcessor {
9468
9607
  const pointerRight = this.parent.isAdaptive ? 10 : -2;
9469
9608
  const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
9470
9609
  let marginTop;
9471
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
9610
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
9472
9611
  marginTop = '';
9473
9612
  }
9474
9613
  else {
@@ -9757,6 +9896,9 @@ class ChartRows extends DateProcessor {
9757
9896
  this.parent.renderTemplates();
9758
9897
  this.triggerQueryTaskbarInfo();
9759
9898
  this.parent.modifiedRecords = [];
9899
+ if (this.parent.viewType == 'ResourceView' && this.parent.showOverAllocation) {
9900
+ this.updateOverlapped();
9901
+ }
9760
9902
  if (collapsedResourceRecord.length) {
9761
9903
  for (let j = 0; j < collapsedResourceRecord.length; j++) {
9762
9904
  if (collapsedResourceRecord[j].hasChildRecords) {
@@ -9783,22 +9925,37 @@ class ChartRows extends DateProcessor {
9783
9925
  const taskbarContainerNode = this.taskbarContainer();
9784
9926
  taskbarContainerNode[0].setAttribute('aria-label', this.generateAriaLabel(this.templateData));
9785
9927
  taskbarContainerNode[0].setAttribute('rowUniqueId', this.templateData.ganttProperties.rowUniqueID);
9786
- const connectorLineLeftNode = this.getLeftPointNode();
9787
- 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();
9788
9931
  taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9789
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
+ }
9790
9939
  if (this.templateData.hasChildRecords) {
9791
9940
  const parentTaskbarTemplateNode = this.getParentTaskbarNode(i, taskbarContainerNode);
9941
+ const milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
9792
9942
  if (!this.templateData.ganttProperties.isAutoSchedule) {
9793
9943
  const manualTaskbar = this.getManualTaskbar();
9794
- manualTaskbar[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
9795
- const connectorLineRightNode = this.getRightPointNode();
9796
- manualTaskbar[0].appendChild([].slice.call(connectorLineRightNode)[0]);
9797
- 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
+ }
9798
9952
  }
9799
9953
  if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
9800
9954
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
9801
9955
  }
9956
+ else if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
9957
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
9958
+ }
9802
9959
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
9803
9960
  this.templateData.ganttProperties.baselineEndDate) {
9804
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()))
@@ -9868,8 +10025,13 @@ class ChartRows extends DateProcessor {
9868
10025
  ? this.getMilestoneBaselineNode() : this.getTaskBaselineNode();
9869
10026
  }
9870
10027
  }
9871
- if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
9872
- 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();
9873
10035
  taskbarContainerNode[0].appendChild([].slice.call(connectorLineRightNode)[0]);
9874
10036
  }
9875
10037
  const rightLabelNode = this.getRightLabelNode(i);
@@ -9890,6 +10052,10 @@ class ChartRows extends DateProcessor {
9890
10052
  else {
9891
10053
  const text = createElement('Text');
9892
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
+ }
9893
10059
  taskIndicatorTextNode = text.childNodes;
9894
10060
  }
9895
10061
  taskIndicatorNode[0].appendChild([].slice.call(taskIndicatorTextNode)[0]);
@@ -9982,7 +10148,7 @@ class ChartRows extends DateProcessor {
9982
10148
  getComputedStyle(trElement.querySelector(classCollections[1])).borderBottomColor :
9983
10149
  (trElement.querySelector('.' + baselineBar) ? getComputedStyle(trElement.querySelector('.' + baselineBar)).backgroundColor : null);
9984
10150
  }
9985
- else {
10151
+ else if (taskbarElement) {
9986
10152
  const childTask = taskbarElement.querySelector(classCollections[0]);
9987
10153
  const progressTask = taskbarElement.querySelector(classCollections[1]);
9988
10154
  args.taskbarBgColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(traceChildTaskBar) ?
@@ -10061,7 +10227,7 @@ class ChartRows extends DateProcessor {
10061
10227
  trElement.querySelector('.' + baselineBar).style.backgroundColor = args.baselineColor;
10062
10228
  }
10063
10229
  }
10064
- else {
10230
+ else if (taskbarElement) {
10065
10231
  if (taskbarElement.querySelector(classCollections[0]) &&
10066
10232
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
10067
10233
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -10163,6 +10329,78 @@ class ChartRows extends DateProcessor {
10163
10329
  }
10164
10330
  return null;
10165
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
+ }
10166
10404
  /**
10167
10405
  * To refresh edited TR
10168
10406
  *
@@ -10176,14 +10414,22 @@ class ChartRows extends DateProcessor {
10176
10414
  const selectedItem = this.parent.currentViewData[index];
10177
10415
  if (index !== -1 && selectedItem) {
10178
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
+ }
10179
10420
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar) {
10180
10421
  tr.replaceChild(this.getResourceParent(data).childNodes[0], tr.childNodes[0]);
10181
10422
  }
10182
10423
  else {
10183
- 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
+ }
10184
10430
  }
10185
10431
  this.parent.renderTemplates();
10186
- if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation) {
10432
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && this.parent.allowTaskbarOverlap) {
10187
10433
  if (isValidateRange) {
10188
10434
  this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
10189
10435
  }
@@ -10205,6 +10451,12 @@ class ChartRows extends DateProcessor {
10205
10451
  }
10206
10452
  const dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
10207
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
+ }
10208
10460
  let nextEditableElement = this.parent.ganttChartModule.tempNextElement;
10209
10461
  if (this.parent.ganttChartModule.isEditableElement && nextEditableElement) {
10210
10462
  this.parent.treeGrid.grid.focusModule.focus();
@@ -10218,7 +10470,7 @@ class ChartRows extends DateProcessor {
10218
10470
  getResourceParent(record) {
10219
10471
  const chartRows = this.parent.ganttChartModule.getChartRows();
10220
10472
  //Below code is for rendering taskbartemplate in resource view with multi taskbar
10221
- if (this.parent.initialChartRowElements) {
10473
+ if (this.parent.initialChartRowElements && (!this.parent.allowTaskbarDragAndDrop && this.parent.allowTaskbarOverlap)) {
10222
10474
  for (let j = 0; j < this.parent.initialChartRowElements.length; j++) {
10223
10475
  if (!isNullOrUndefined(chartRows[j])) {
10224
10476
  if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
@@ -10246,7 +10498,7 @@ class ChartRows extends DateProcessor {
10246
10498
  const id = chartRows[i].querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
10247
10499
  const ganttData = this.parent.getRecordByID(id);
10248
10500
  let zIndex = "";
10249
- if (ganttData && ganttData.ganttProperties.eOverlapIndex) {
10501
+ if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
10250
10502
  zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
10251
10503
  }
10252
10504
  const cloneChildElement = cloneElement.cloneNode(true);
@@ -10393,7 +10645,9 @@ class Dependency {
10393
10645
  for (let count = length; count >= 0; count--) {
10394
10646
  const ganttData = predecessorTasks[count];
10395
10647
  const ganttProp = ganttData.ganttProperties;
10396
- this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
10648
+ if ((!ganttData.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
10649
+ this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
10650
+ }
10397
10651
  }
10398
10652
  }
10399
10653
  /**
@@ -10555,18 +10809,26 @@ class Dependency {
10555
10809
  offsetUnit: offsetUnits.durationUnit,
10556
10810
  offset: offsetUnits.duration
10557
10811
  };
10558
- let fromData = this.parent.connectorLineModule.getRecordByID(obj.to);
10559
- let toData = this.parent.connectorLineModule.getRecordByID(obj.from);
10560
- let isValid;
10561
- if (this.parent.connectorLineEditModule && toData && fromData) {
10562
- isValid = this.parent.connectorLineEditModule.validateParentPredecessor(toData, fromData);
10563
- if (isValid)
10812
+ const isOwnParent = this.checkIsParent(match[0]);
10813
+ if (!this.parent.allowParentDependency) {
10814
+ if (!isOwnParent) {
10564
10815
  collection.push(obj);
10816
+ }
10565
10817
  }
10566
10818
  else {
10567
- 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);
10568
10831
  }
10569
- match.splice(0);
10570
10832
  });
10571
10833
  return collection;
10572
10834
  }
@@ -10689,7 +10951,9 @@ class Dependency {
10689
10951
  const length = predecessorsCollection.length;
10690
10952
  for (let count = 0; count < length; count++) {
10691
10953
  ganttRecord = predecessorsCollection[count];
10692
- this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
10954
+ if ((!ganttRecord.hasChildRecords && !this.parent.allowParentDependency) || this.parent.allowParentDependency) {
10955
+ this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
10956
+ }
10693
10957
  }
10694
10958
  }
10695
10959
  /**
@@ -10738,12 +11002,16 @@ class Dependency {
10738
11002
  * @private
10739
11003
  */
10740
11004
  updatedRecordsDateByPredecessor() {
11005
+ if (!this.parent.autoCalculateDateScheduling) {
11006
+ return;
11007
+ }
10741
11008
  const flatData = this.parent.flatData;
10742
11009
  const totLength = this.parent.flatData.length;
10743
11010
  for (let count = 0; count < totLength; count++) {
10744
11011
  if (flatData[count].ganttProperties.predecessorsName) {
10745
11012
  this.validatePredecessorDates(flatData[count]);
10746
- 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) {
10747
11015
  this.parent.editModule['updateChildItems'](flatData[count]);
10748
11016
  }
10749
11017
  }
@@ -10788,7 +11056,7 @@ class Dependency {
10788
11056
  const predecessor = predecessors[count];
10789
11057
  parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor.from);
10790
11058
  record = this.parent.connectorLineModule.getRecordByID(predecessor.to);
10791
- if (this.parent.isLoad && this.parentPredecessors.indexOf(ganttRecord) == -1
11059
+ if (this.parent.allowParentDependency && this.parent.isLoad && this.parentPredecessors.indexOf(ganttRecord) == -1
10792
11060
  && (ganttRecord.hasChildRecords || record.hasChildRecords)) {
10793
11061
  this.parentPredecessors.push(ganttRecord);
10794
11062
  }
@@ -11469,9 +11737,16 @@ class ConnectorLine {
11469
11737
  * @private
11470
11738
  */
11471
11739
  getHeightValue(data) {
11472
- return (data.parentIndex * data.rowHeight) > (data.childIndex * data.rowHeight) ?
11473
- ((data.parentIndex * data.rowHeight) - (data.childIndex * data.rowHeight)) :
11474
- ((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
+ }
11475
11750
  }
11476
11751
  /**
11477
11752
  * To get sstype2 inner element width.
@@ -11545,10 +11820,33 @@ class ConnectorLine {
11545
11820
  if (this.parent.renderBaseline) {
11546
11821
  isMilestoneValue = (data.milestoneParent && data.milestoneChild) ? 0 : data.milestoneParent ? -5 : data.milestoneChild ? 5 : 0;
11547
11822
  }
11548
- const heightValue = isVirtual ? connectorLine$$1.height : (height + isMilestoneValue);
11823
+ let heightValue = isVirtual ? connectorLine$$1.height : (height + isMilestoneValue);
11549
11824
  let borderTopWidth = 0;
11550
11825
  let addTop = 0;
11551
- 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) {
11552
11850
  let fromRecordIsParent = this.parent.currentViewData[data.parentIndex].hasChildRecords;
11553
11851
  let toRecordIsParent = this.parent.currentViewData[data.childIndex].hasChildRecords;
11554
11852
  let fromRecordIsManual = this.parent.currentViewData[data.parentIndex].ganttProperties.isAutoSchedule;
@@ -11641,7 +11939,7 @@ class ConnectorLine {
11641
11939
  this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
11642
11940
  if (this.getParentPosition(data) === 'FSType1') {
11643
11941
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11644
- ((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;' +
11645
11943
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType1">';
11646
11944
  div = div + eLine;
11647
11945
  div = div + direction + (isMilestoneParent ? -1 : 0) + 'px;width:' + (isMilestoneParent ?
@@ -11661,7 +11959,7 @@ class ConnectorLine {
11661
11959
  'px;border-top-width:' + (5 + this.lineStroke) + 'px;width:0;height:0;position:relative;"></div></div>';
11662
11960
  }
11663
11961
  if (this.getParentPosition(data) === 'FSType2') {
11664
- 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 +
11665
11963
  this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11666
11964
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType2">';
11667
11965
  div = div + eLine;
@@ -11693,7 +11991,7 @@ class ConnectorLine {
11693
11991
  }
11694
11992
  if (this.getParentPosition(data) === 'FSType3') {
11695
11993
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11696
- ((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;' +
11697
11995
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType3">';
11698
11996
  div = div + rightArrow;
11699
11997
  div = div + direction + '10px;' + this.getBorderStyles((this.parent.enableRtl ? 'right' : 'left'), 10) +
@@ -11723,7 +12021,7 @@ class ConnectorLine {
11723
12021
  }
11724
12022
  if (this.getParentPosition(data) === 'FSType4') {
11725
12023
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11726
- ((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;' +
11727
12025
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType4">';
11728
12026
  div = div + rightArrow;
11729
12027
  div = div + direction + (data.childLeft - (data.parentLeft + data.parentWidth + 10)) + 'px;' +
@@ -11749,7 +12047,7 @@ class ConnectorLine {
11749
12047
  }
11750
12048
  if (this.getParentPosition(data) === 'SSType4') {
11751
12049
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11752
- ((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;' +
11753
12051
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType4">';
11754
12052
  div = div + rightArrow;
11755
12053
  div = div + direction + (data.childLeft - data.parentLeft) + 'px;' + duplicateStingTwo;
@@ -11762,7 +12060,7 @@ class ConnectorLine {
11762
12060
  }
11763
12061
  if (this.getParentPosition(data) === 'SSType3') {
11764
12062
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11765
- ((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;' +
11766
12064
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType3">';
11767
12065
  div = div + rightArrow;
11768
12066
  div = div + direction + '10px;' + duplicateStingTwo;
@@ -11775,7 +12073,7 @@ class ConnectorLine {
11775
12073
  }
11776
12074
  if (this.getParentPosition(data) === 'SSType2') {
11777
12075
  div = div + direction + setInnerElementLeftSSType2 + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11778
- ((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;' +
11779
12077
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType2">';
11780
12078
  div = div + eLine;
11781
12079
  div = div + 'width:' + (setInnerChildWidthSSType2 + 1) + 'px;' +
@@ -11795,7 +12093,7 @@ class ConnectorLine {
11795
12093
  }
11796
12094
  if (this.getParentPosition(data) === 'SSType1') {
11797
12095
  div = div + direction + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11798
- ((data.parentIndex * data.rowHeight) + addTop +
12096
+ ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
11799
12097
  this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11800
12098
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType1">';
11801
12099
  div = div + eLine;
@@ -11813,7 +12111,7 @@ class ConnectorLine {
11813
12111
  }
11814
12112
  if (this.getParentPosition(data) === 'FFType1') {
11815
12113
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11816
- ((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;' +
11817
12115
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType1">';
11818
12116
  div = div + eLine;
11819
12117
  div = div + direction + (isMilestoneParent ? (((data.parentLeft + data.parentWidth) -
@@ -11837,7 +12135,7 @@ class ConnectorLine {
11837
12135
  }
11838
12136
  if (this.getParentPosition(data) === 'FFType2') {
11839
12137
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11840
- ((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;' +
11841
12139
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType2">';
11842
12140
  div = div + eLine;
11843
12141
  div = div + (isMilestoneParent ? direction + '-1px;' : '') + 'width:' +
@@ -11863,7 +12161,7 @@ class ConnectorLine {
11863
12161
  }
11864
12162
  if (this.getParentPosition(data) === 'FFType3') {
11865
12163
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11866
- ((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;' +
11867
12165
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType3">';
11868
12166
  div = div + duplicateStingOne;
11869
12167
  div = div + eLine;
@@ -11886,7 +12184,7 @@ class ConnectorLine {
11886
12184
  }
11887
12185
  if (this.getParentPosition(data) === 'FFType4') {
11888
12186
  div = div + direction + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11889
- ((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;' +
11890
12188
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType4">';
11891
12189
  div = div + leftArrow;
11892
12190
  div = div + (direction + ((data.childLeft + data.childWidth) -
@@ -11915,7 +12213,7 @@ class ConnectorLine {
11915
12213
  }
11916
12214
  if (this.getParentPosition(data) === 'SFType4') {
11917
12215
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11918
- ((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;' +
11919
12217
  'height:' + heightValue + 'px;position:absolute" data-connectortype="SFType4">';
11920
12218
  div = div + duplicateStingFour + 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;' +
11921
12219
  'border-bottom-width:' + (5 + this.lineStroke) +
@@ -11943,7 +12241,7 @@ class ConnectorLine {
11943
12241
  }
11944
12242
  if (this.getParentPosition(data) === 'SFType3') {
11945
12243
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11946
- ((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;' +
11947
12245
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType3">';
11948
12246
  div = div + duplicateStingOne;
11949
12247
  div = div + eLine;
@@ -11961,7 +12259,7 @@ class ConnectorLine {
11961
12259
  }
11962
12260
  if (this.getParentPosition(data) === 'SFType1') {
11963
12261
  div = div + direction + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11964
- ((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;' +
11965
12263
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType1">';
11966
12264
  div = div + eLine;
11967
12265
  div = div + 'width:11px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
@@ -11986,7 +12284,7 @@ class ConnectorLine {
11986
12284
  }
11987
12285
  if (this.getParentPosition(data) === 'SFType2') {
11988
12286
  div = div + direction + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11989
- ((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;' +
11990
12288
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType2">';
11991
12289
  div = div + eLine;
11992
12290
  div = div + direction + (((data.parentLeft) - (data.childLeft + data.childWidth)) - 10) +
@@ -12379,7 +12677,7 @@ class Tooltip$1 {
12379
12677
  this.toolTipObj.position = 'BottomCenter';
12380
12678
  this.toolTipObj.openDelay = 700;
12381
12679
  this.toolTipObj.enableRtl = this.parent.enableRtl;
12382
- this.toolTipObj.enableHtmlSanitizer = false;
12680
+ this.toolTipObj.enableHtmlSanitizer = this.parent.enableHtmlSanitizer;
12383
12681
  this.toolTipObj.cssClass = ganttTooltip;
12384
12682
  this.toolTipObj.animation = { open: { effect: 'None', delay: 0 }, close: { effect: 'None', delay: 0 } };
12385
12683
  this.toolTipObj.afterOpen = this.updateTooltipPosition.bind(this);
@@ -12592,8 +12890,12 @@ class Tooltip$1 {
12592
12890
  let taskName;
12593
12891
  if (ganttData) {
12594
12892
  data = ganttData.ganttProperties;
12595
- taskName = !isNullOrUndefined(data.taskName) ? '<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">' +
12596
- (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>' : '';
12597
12899
  }
12598
12900
  switch (elementType) {
12599
12901
  case 'milestone':
@@ -12605,9 +12907,13 @@ class Tooltip$1 {
12605
12907
  else if (!isNullOrUndefined(data.startDate)) {
12606
12908
  milestoneStartDate = data.startDate;
12607
12909
  }
12608
- 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>' +
12609
12915
  '<td class = "e-gantt-tooltip-value">' +
12610
- this.parent.getFormatedDate(milestoneStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12916
+ sDateValue + '</td></tr>' : '';
12611
12917
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12612
12918
  taskName + sDate + '</tbody></table>';
12613
12919
  break;
@@ -12615,20 +12921,28 @@ class Tooltip$1 {
12615
12921
  case 'taskbar':
12616
12922
  {
12617
12923
  const scheduledTask = !ganttData.hasChildRecords || data.isAutoSchedule ? true : false;
12618
- 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">' +
12619
12935
  this.parent.localeObj.getConstant(scheduledTask ? 'startDate' : 'subTasksStartDate') +
12620
- '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12621
- this.parent.getFormatedDate(scheduledTask ? data.startDate : data.autoStartDate, this.parent.getDateFormat()) +
12622
- '</td></tr>' : '';
12623
- 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">' +
12624
12938
  this.parent.localeObj.getConstant(scheduledTask ? 'endDate' : 'subTasksEndDate') +
12625
- '</td><td>:</td><td class = "e-gantt-tooltip-value">' + this.parent.getFormatedDate(scheduledTask ? data.endDate : data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12626
- 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">' +
12627
12941
  this.parent.localeObj.getConstant('duration') + '</td><td>:</td>' +
12628
- '<td class = "e-gantt-tooltip-value"> ' + this.parent.getDurationString((scheduledTask ? data.duration : data.autoDuration), data.durationUnit) +
12942
+ '<td class = "e-gantt-tooltip-value"> ' + durationValue +
12629
12943
  '</td></tr>' : '';
12630
- const progress = !isNullOrUndefined(data.progress) ? '<tr><td class = "e-gantt-tooltip-label">' +
12631
- 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 +
12632
12946
  '</td></tr>' : '';
12633
12947
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12634
12948
  taskName + startDate + endDate + duration + progress + '</tbody></table>';
@@ -12636,82 +12950,131 @@ class Tooltip$1 {
12636
12950
  }
12637
12951
  case 'baseline':
12638
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
+ }
12639
12959
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12640
12960
  taskName + '<tr><td class = "e-gantt-tooltip-label">' +
12641
12961
  this.parent.localeObj.getConstant('baselineStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12642
- this.parent.getFormatedDate(data.baselineStartDate, this.parent.getDateFormat()) + '</td></tr><tr>' +
12962
+ baselineStartDateValue + '</td></tr><tr>' +
12643
12963
  '<td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('baselineEndDate') +
12644
12964
  '</td><td>:</td><td class = "e-gantt-tooltip-value">' +
12645
- this.parent.getFormatedDate(data.baselineEndDate, this.parent.getDateFormat()) + '</td></tr></tbody></table>';
12965
+ baselineEndDateValue + '</td></tr></tbody></table>';
12646
12966
  break;
12647
12967
  }
12648
12968
  case 'marker':
12649
12969
  {
12650
12970
  const markerTooltipElement = parent.tooltipModule.getMarkerTooltipData(args);
12651
- 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
+ }
12652
12977
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr><td>' +
12653
- this.parent.getFormatedDate(this.parent.dateValidationModule.getDateFromFormat(markerTooltipElement.day), this.parent.getDateFormat()) +
12654
- '</td></tr><tr><td>' +
12655
- 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>';
12656
12979
  break;
12657
12980
  }
12658
12981
  case 'connectorLine':
12659
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
+ }
12660
12997
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody><tr><td class = "e-gantt-tooltip-label">' +
12661
12998
  this.parent.localeObj.getConstant('from') + '</td><td>:</td>' +
12662
- '<td class = "e-gantt-tooltip-value">' + parent.tooltipModule.predecessorTooltipData.fromName + ' (' +
12663
- 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">' +
12664
13001
  this.parent.localeObj.getConstant('to') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12665
- parent.tooltipModule.predecessorTooltipData.toName +
12666
- ' (' + parent.tooltipModule.predecessorTooltipData.toId + ')' +
12667
- '</td></tr><tr><td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('taskLink') +
12668
- '</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 +
12669
13004
  '</td></tr><tr><td class = "e-gantt-tooltip-label">' + this.parent.localeObj.getConstant('lag') +
12670
13005
  '</td><td>:</td><td class = "e-gantt-tooltip-value">' +
12671
- parent.tooltipModule.predecessorTooltipData.offsetString + '</td></tr></tbody></table>';
13006
+ offsetStringValue + '</td></tr></tbody></table>';
12672
13007
  break;
12673
13008
  }
12674
13009
  case 'indicator':
12675
13010
  if (args.target.title.length) {
12676
- 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>';
12677
13016
  }
12678
13017
  break;
12679
13018
  case 'timeline':
12680
- 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>';
12681
13024
  break;
12682
13025
  case 'manualtaskbar':
12683
13026
  {
12684
- 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">' +
12685
13040
  this.parent.localeObj.getConstant('subTasksStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12686
- this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12687
- 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">' +
12688
13043
  this.parent.localeObj.getConstant('subTasksEndDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12689
- this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12690
- 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">' +
12691
13046
  this.parent.localeObj.getConstant('duration') + '</td><td>:</td>' +
12692
- '<td class = "e-gantt-tooltip-value"> ' + this.parent.getDurationString(data.duration, data.durationUnit) +
13047
+ '<td class = "e-gantt-tooltip-value"> ' + durationUnitValue +
12693
13048
  '</td></tr>' : '';
12694
- const manualStartDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
13049
+ let manualStartDate = data.startDate ? '<tr><td class = "e-gantt-tooltip-label">' +
12695
13050
  this.parent.localeObj.getConstant('startDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12696
- this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12697
- 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">' +
12698
13053
  this.parent.localeObj.getConstant('endDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12699
- this.parent.getFormatedDate(data.endDate, this.parent.getDateFormat()) + '</td></tr>' : '';
13054
+ manualEndDateValue + '</td></tr>' : '';
12700
13055
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12701
13056
  taskName + manualStartDate + autoStartDate + manualEndDate + autoEndDate + durationValue + '</tbody></table>';
12702
13057
  break;
12703
13058
  }
12704
13059
  case 'manualmilestone':
12705
13060
  {
12706
- 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">' +
12707
13070
  this.parent.localeObj.getConstant('subTasksStartDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value"> ' +
12708
- this.parent.getFormatedDate(data.autoStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12709
- 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">' +
12710
13073
  this.parent.localeObj.getConstant('subTasksEndDate') + '</td><td>:</td>' + '<td class = "e-gantt-tooltip-value">' +
12711
- this.parent.getFormatedDate(data.autoEndDate, this.parent.getDateFormat()) + '</td></tr>' : '';
12712
- 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>' +
12713
13076
  '<td class = "e-gantt-tooltip-value">' +
12714
- this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat()) + '</tr>';
13077
+ dateValue + '</tr>';
12715
13078
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
12716
13079
  taskName + date + autoStart + autoEnd + '</tbody></table>';
12717
13080
  break;
@@ -12739,7 +13102,10 @@ class Tooltip$1 {
12739
13102
  * @private
12740
13103
  */
12741
13104
  getPredecessorTooltipData(args) {
12742
- 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
+ }
12743
13109
  const taskIds = predeceesorParent.match(/ConnectorLineparent(.*)child(.*)/);
12744
13110
  taskIds.shift();
12745
13111
  let fromTask;
@@ -12778,7 +13144,7 @@ class Tooltip$1 {
12778
13144
  */
12779
13145
  templateCompiler(template, parent, data, propName) {
12780
13146
  const tooltipFunction = parent.chartRowsModule.templateCompiler(template);
12781
- const templateID = parent.chartRowsModule.getTemplateID(propName);
13147
+ let templateID = parent.chartRowsModule.getTemplateID(propName);
12782
13148
  const templateNode = tooltipFunction(extend({ index: 0 }, data), parent, propName, templateID, true);
12783
13149
  return templateNode;
12784
13150
  }
@@ -13018,7 +13384,6 @@ class FocusModule {
13018
13384
  const top = containerPosition.top + (containerPosition.height / 2);
13019
13385
  const left = containerPosition.left + (containerPosition.width / 2);
13020
13386
  this.setActiveElement(e.target);
13021
- // eslint-disable-next-line security/detect-non-literal-fs-filename
13022
13387
  contextMenu.open(top, left);
13023
13388
  e.preventDefault();
13024
13389
  break;
@@ -13381,6 +13746,12 @@ let Gantt = class Gantt extends Component {
13381
13746
  this.treeGrid.isReact = true;
13382
13747
  this.treeGrid.grid.isReact = true;
13383
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
+ }
13384
13755
  createSpinner({ target: this.element }, this.createElement);
13385
13756
  this.trigger('load', {});
13386
13757
  this.element.classList.add(root);
@@ -13406,13 +13777,13 @@ let Gantt = class Gantt extends Component {
13406
13777
  }
13407
13778
  hideMaskRow() {
13408
13779
  let isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
13409
- if (!isNullOrUndefined(this.contentMaskTable) && isTablePresent != 0) {
13780
+ if (!isNullOrUndefined(this.contentMaskTable) && (isTablePresent != 0 || this.contentMaskTable)) {
13410
13781
  const maskTable = this.contentMaskTable;
13411
13782
  remove(maskTable);
13412
13783
  this.contentMaskTable = null;
13413
13784
  }
13414
13785
  isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
13415
- if (!isNullOrUndefined(this.headerMaskTable) && isTablePresent != 0) {
13786
+ if (!isNullOrUndefined(this.headerMaskTable) && (isTablePresent != 0 || this.headerMaskTable)) {
13416
13787
  const maskTable = this.headerMaskTable;
13417
13788
  remove(maskTable);
13418
13789
  this.headerMaskTable = null;
@@ -13425,8 +13796,8 @@ let Gantt = class Gantt extends Component {
13425
13796
  }
13426
13797
  if (this.element.querySelectorAll('.' + timelineHeaderTableContainer).length != 0) {
13427
13798
  for (var i = 0; i < this.singleTier; i++) {
13428
- if (!isNullOrUndefined(this.element.querySelectorAll('.' + timelineHeaderTableContainer)[i])) {
13429
- 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";
13430
13801
  }
13431
13802
  }
13432
13803
  }
@@ -13448,7 +13819,7 @@ let Gantt = class Gantt extends Component {
13448
13819
  if (this.element.querySelectorAll('.' + timelineHeaderTableContainer).length != 0) {
13449
13820
  this.singleTier = this.timelineModule.isSingleTier ? 1 : 2;
13450
13821
  for (var i = 0; i < this.singleTier; i++) {
13451
- this.element.querySelectorAll('.' + timelineHeaderTableContainer)[i]['style'].visibility = "hidden";
13822
+ this.element.querySelectorAll('.' + timelineHeaderTableContainer)[parseInt(i.toString(), 10)]['style'].visibility = "hidden";
13452
13823
  }
13453
13824
  }
13454
13825
  if (this.singleTier === 0) {
@@ -13567,7 +13938,7 @@ let Gantt = class Gantt extends Component {
13567
13938
  }
13568
13939
  this.topBottomHeader = 0;
13569
13940
  for (let i = 0; i < row.length; i++) {
13570
- tbody.appendChild(this.applyTimelineMaskRow(row[i]));
13941
+ tbody.appendChild(this.applyTimelineMaskRow(row[parseInt(i.toString(), 10)]));
13571
13942
  this.topBottomHeader = this.topBottomHeader + 1;
13572
13943
  }
13573
13944
  table.appendChild(tbody);
@@ -13581,11 +13952,11 @@ let Gantt = class Gantt extends Component {
13581
13952
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13582
13953
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13583
13954
  for (let i = 0; i < maskRow.childNodes.length - 1; i++) {
13584
- maskRow.childNodes[i]['style']['width'] = 166 + 'px';
13955
+ maskRow.childNodes[parseInt(i.toString(), 10)]['style']['width'] = 166 + 'px';
13585
13956
  }
13586
13957
  const maskCells = [].slice.call(maskRow.childNodes);
13587
13958
  for (let i = 0; i < maskCells.length; i++) {
13588
- const maskCell = maskCells[i];
13959
+ const maskCell = maskCells[parseInt(i.toString(), 10)];
13589
13960
  switch (this.topBottomHeader) {
13590
13961
  case 0:
13591
13962
  if (this.enableRtl) {
@@ -13602,7 +13973,7 @@ let Gantt = class Gantt extends Component {
13602
13973
  maskCell.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
13603
13974
  const innerMaskCells = [].slice.call(maskCell.childNodes);
13604
13975
  for (let i = 0; i < innerMaskCells.length; i++) {
13605
- const htmlInner = innerMaskCells[i];
13976
+ const htmlInner = innerMaskCells[parseInt(i.toString(), 10)];
13606
13977
  if (i === 0) {
13607
13978
  if (this.enableRtl) {
13608
13979
  htmlInner.innerHTML = '<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>';
@@ -13654,7 +14025,7 @@ let Gantt = class Gantt extends Component {
13654
14025
  else if (this.columnLoop === 4) {
13655
14026
  this.columnLoop = 1;
13656
14027
  }
13657
- tbody.appendChild(this.applyMaskRow(row[j]));
14028
+ tbody.appendChild(this.applyMaskRow(row[parseInt(j.toString(), 10)]));
13658
14029
  }
13659
14030
  table.appendChild(tbody);
13660
14031
  table.style.width = 100 + '%';
@@ -13675,7 +14046,7 @@ let Gantt = class Gantt extends Component {
13675
14046
  }
13676
14047
  const maskCells = [].slice.call(maskRow.childNodes);
13677
14048
  for (let i = 0; i < maskCells.length; i++) {
13678
- const maskCell = maskCells[i];
14049
+ const maskCell = maskCells[parseInt(i.toString(), 10)];
13679
14050
  switch (this.columnLoop) {
13680
14051
  case 1:
13681
14052
  if (i === 0) {
@@ -13773,7 +14144,7 @@ let Gantt = class Gantt extends Component {
13773
14144
  this.predecessorModule['parentIds'] = [];
13774
14145
  this.predecessorModule['parentRecord'] = [];
13775
14146
  this.predecessorModule.updatePredecessors();
13776
- if (this.isInPredecessorValidation && this.enableValidation) {
14147
+ if (this.isInPredecessorValidation && this.enableValidation && this.autoCalculateDateScheduling) {
13777
14148
  this.predecessorModule.updatedRecordsDateByPredecessor();
13778
14149
  }
13779
14150
  }
@@ -13786,7 +14157,9 @@ let Gantt = class Gantt extends Component {
13786
14157
  if (this.enableValidation) {
13787
14158
  this.dataOperation.updateGanttData();
13788
14159
  }
13789
- this.predecessorModule.updateParentPredecessor();
14160
+ if (this.allowParentDependency) {
14161
+ this.predecessorModule.updateParentPredecessor();
14162
+ }
13790
14163
  if (this.dataSource instanceof Object && isCountRequired(this)) {
13791
14164
  const count = getValue('count', this.dataSource);
13792
14165
  this.treeGrid.dataSource = { result: this.flatData, count: count };
@@ -13799,7 +14172,9 @@ let Gantt = class Gantt extends Component {
13799
14172
  if (this.enableValidation) {
13800
14173
  this.dataOperation.updateGanttData();
13801
14174
  }
13802
- this.predecessorModule.updateParentPredecessor();
14175
+ if (this.allowParentDependency) {
14176
+ this.predecessorModule.updateParentPredecessor();
14177
+ }
13803
14178
  this.treeGridPane.classList.remove('e-temp-content');
13804
14179
  remove(this.treeGridPane.querySelector('.e-gantt-temp-header'));
13805
14180
  this.notify('dataReady', {});
@@ -13916,22 +14291,27 @@ let Gantt = class Gantt extends Component {
13916
14291
  * @private
13917
14292
  */
13918
14293
  updateContentHeight(args) {
13919
- if (this.virtualScrollModule && this.enableVirtualization && !isNullOrUndefined(args)) {
13920
- const length = getValue('result.length', args);
13921
- this.contentHeight = length * this.rowHeight;
14294
+ if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
14295
+ return;
13922
14296
  }
13923
14297
  else {
13924
- const expandedRecords = this.virtualScrollModule && this.enableVirtualization ?
13925
- this.currentViewData : this.getExpandedRecords(this.currentViewData);
13926
- let height;
13927
- const chartRow$$1 = !isNullOrUndefined(this.ganttChartModule.getChartRows()) ? this.ganttChartModule.getChartRows()[0] : null;
13928
- if (!isNullOrUndefined(chartRow$$1) && chartRow$$1.getBoundingClientRect().height > 0) {
13929
- 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;
13930
14301
  }
13931
14302
  else {
13932
- 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;
13933
14314
  }
13934
- this.contentHeight = expandedRecords.length * height;
13935
14315
  }
13936
14316
  }
13937
14317
  /**
@@ -14444,7 +14824,6 @@ let Gantt = class Gantt extends Component {
14444
14824
  this.chartRowsModule.refreshGanttRows();
14445
14825
  break;
14446
14826
  case 'includeWeekend':
14447
- case 'dayWorkingTime':
14448
14827
  case 'allowUnscheduledTasks':
14449
14828
  case 'holidays':
14450
14829
  this.isLoad = true;
@@ -14537,6 +14916,10 @@ let Gantt = class Gantt extends Component {
14537
14916
  case 'readOnly':
14538
14917
  case 'viewType':
14539
14918
  case 'taskFields':
14919
+ case 'dayWorkingTime':
14920
+ case 'allowTaskbarDragAndDrop':
14921
+ case 'allowTaskbarOverlap':
14922
+ case 'allowParentDependency':
14540
14923
  if (prop === 'locale') {
14541
14924
  this.isLocaleChanged = true;
14542
14925
  }
@@ -14551,6 +14934,9 @@ let Gantt = class Gantt extends Component {
14551
14934
  }
14552
14935
  }
14553
14936
  if (isRefresh) {
14937
+ if (this.isLoad && this.contentMaskTable) {
14938
+ this.contentMaskTable = null;
14939
+ }
14554
14940
  this.refresh();
14555
14941
  }
14556
14942
  }
@@ -14678,7 +15064,7 @@ let Gantt = class Gantt extends Component {
14678
15064
  args: [this]
14679
15065
  });
14680
15066
  }
14681
- if (this.allowRowDragAndDrop) {
15067
+ if (this.allowRowDragAndDrop || this.allowTaskbarDragAndDrop) {
14682
15068
  modules.push({
14683
15069
  member: 'rowDragAndDrop',
14684
15070
  args: [this]
@@ -15213,10 +15599,11 @@ let Gantt = class Gantt extends Component {
15213
15599
  * @param {PdfExportProperties} pdfExportProperties - Defines the export properties of the Gantt.
15214
15600
  * @param {isMultipleExport} isMultipleExport - Define to enable multiple export.
15215
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.
15216
15603
  * @returns {Promise<any>} .
15217
15604
  */
15218
- pdfExport(pdfExportProperties, isMultipleExport, pdfDoc) {
15219
- 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)
15220
15607
  : null;
15221
15608
  }
15222
15609
  /**
@@ -15248,7 +15635,7 @@ let Gantt = class Gantt extends Component {
15248
15635
  * @private
15249
15636
  */
15250
15637
  renderWorkingDayCell(args) {
15251
- const includeWeekend = this.taskMode !== 'Auto' ? true : this.includeWeekend ? true : false;
15638
+ const includeWeekend = this.taskMode !== 'Auto' ? true : (this.includeWeekend || !this.autoCalculateDateScheduling) ? true : false;
15252
15639
  const nonWorkingDays = !includeWeekend ? this.nonWorkingDayIndex : [];
15253
15640
  const holidays = this.totalHolidayDates;
15254
15641
  if (nonWorkingDays.length > 0 && nonWorkingDays.indexOf(args.date.getDay()) !== -1) {
@@ -15258,7 +15645,12 @@ let Gantt = class Gantt extends Component {
15258
15645
  const tempDate = new Date(args.date.getTime());
15259
15646
  tempDate.setHours(0, 0, 0);
15260
15647
  if (holidays.indexOf(tempDate.getTime()) !== -1) {
15261
- args.isDisabled = true;
15648
+ if (!this.autoCalculateDateScheduling) {
15649
+ args.isDisabled = false;
15650
+ }
15651
+ else {
15652
+ args.isDisabled = true;
15653
+ }
15262
15654
  }
15263
15655
  }
15264
15656
  }
@@ -15375,8 +15767,8 @@ let Gantt = class Gantt extends Component {
15375
15767
  const id = ganttData.rowUniqueID;
15376
15768
  const task = this.getRecordByID(id);
15377
15769
  let isValid = false;
15378
- if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData[field]) && (value instanceof Date ? value.getTime() !==
15379
- 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))) {
15380
15772
  isValid = true;
15381
15773
  }
15382
15774
  if (task && ((this.editedRecords.indexOf(task) === -1 && isValid) || this.editedRecords.length === 0)) {
@@ -16323,6 +16715,12 @@ __decorate([
16323
16715
  __decorate([
16324
16716
  Property(false)
16325
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);
16326
16724
  __decorate([
16327
16725
  Property(true)
16328
16726
  ], Gantt.prototype, "disableHtmlEncode", void 0);
@@ -16332,6 +16730,12 @@ __decorate([
16332
16730
  __decorate([
16333
16731
  Property(true)
16334
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);
16335
16739
  __decorate([
16336
16740
  Property(true)
16337
16741
  ], Gantt.prototype, "autoFocusTasks", void 0);
@@ -16380,6 +16784,12 @@ __decorate([
16380
16784
  __decorate([
16381
16785
  Property(false)
16382
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);
16383
16793
  __decorate([
16384
16794
  Property('Horizontal')
16385
16795
  ], Gantt.prototype, "gridLines", void 0);
@@ -16822,8 +17232,10 @@ class CellEdit {
16822
17232
  }
16823
17233
  if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
16824
17234
  data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
16825
- || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
16826
- 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
+ }
16827
17239
  }
16828
17240
  else {
16829
17241
  const callBackPromise = new Deferred();
@@ -16873,7 +17285,7 @@ class CellEdit {
16873
17285
  }
16874
17286
  isValueChange(args, field) {
16875
17287
  const data = getValue('data', args);
16876
- const editedValue = data[field];
17288
+ const editedValue = data[`${field}`];
16877
17289
  const previousValue = getValue('previousData', args);
16878
17290
  if ((isNullOrUndefined(editedValue) && !isNullOrUndefined(previousValue)) || (!isNullOrUndefined(editedValue) && isNullOrUndefined(previousValue))) {
16879
17291
  return true;
@@ -17041,7 +17453,7 @@ class CellEdit {
17041
17453
  const ganttSegments = [];
17042
17454
  const segments = ganttProp.segments;
17043
17455
  for (let i = 0; i < segments.length; i++) {
17044
- const segment = segments[i];
17456
+ const segment = segments[parseInt(i.toString(), 10)];
17045
17457
  let endDate = segment.endDate;
17046
17458
  endDate = (!isNullOrUndefined(ganttProp.endDate)) && endDate.getTime() <
17047
17459
  ganttProp.endDate.getTime() && i !== segments.length - 1 ? endDate : ganttProp.endDate;
@@ -17240,7 +17652,7 @@ class CellEdit {
17240
17652
  }
17241
17653
  }
17242
17654
  if (!isNullOrUndefined(index) && index !== -1) {
17243
- editedResources.push(previousResource[index]);
17655
+ editedResources.push(previousResource[parseInt(index.toString(), 10)]);
17244
17656
  }
17245
17657
  else {
17246
17658
  const resource = resourceData.filter((resourceInfo) => {
@@ -17299,7 +17711,7 @@ class CellEdit {
17299
17711
  typeEdited(args, editedObj) {
17300
17712
  const key = 'taskType';
17301
17713
  const ganttProb = args.data.ganttProperties;
17302
- const taskType = editedObj[key];
17714
+ const taskType = editedObj[`${key}`];
17303
17715
  this.parent.setRecordValue('taskType', taskType, ganttProb, true);
17304
17716
  //this.parent.dataOperation.updateMappingData(args.data, 'taskType');
17305
17717
  this.updateEditedRecord(args);
@@ -17407,15 +17819,12 @@ class EditTooltip {
17407
17819
  this.parent.tooltipModule.toolTipObj.close();
17408
17820
  this.updateTooltip(segmentIndex);
17409
17821
  if (this.taskbarEdit.connectorSecondAction === 'ConnectorPointLeftDrag') {
17410
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17411
17822
  this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector('.' + connectorPointLeft));
17412
17823
  }
17413
17824
  else if (this.taskbarEdit.connectorSecondAction === 'ConnectorPointRightDrag') {
17414
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17415
17825
  this.toolTipObj.open(this.taskbarEdit.connectorSecondElement.querySelector('.' + connectorPointRight));
17416
17826
  }
17417
17827
  else {
17418
- // eslint-disable-next-line security/detect-non-literal-fs-filename
17419
17828
  this.toolTipObj.open(this.taskbarEdit.taskBarEditElement);
17420
17829
  }
17421
17830
  }
@@ -17580,6 +17989,10 @@ class TaskbarEdit extends DateProcessor {
17580
17989
  this.elementOffsetWidth = 0;
17581
17990
  this.elementOffsetHeight = 0;
17582
17991
  this.segmentIndex = -1;
17992
+ this.currentItemTop = 0;
17993
+ this.currentItemPrevTop = 0;
17994
+ this.topValue = 0;
17995
+ this.draggedRecordMarginTop = 0;
17583
17996
  this.parent = ganttObj;
17584
17997
  this.initPublicProp();
17585
17998
  this.wireEvents();
@@ -17821,7 +18234,9 @@ class TaskbarEdit extends DateProcessor {
17821
18234
  if (!isNullOrUndefined(parentRecord) && !parentRecord.expanded) {
17822
18235
  this.prevZIndex = (this.taskBarEditElement).style.zIndex;
17823
18236
  (this.taskBarEditElement).style.zIndex = '1000';
17824
- 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
+ }
17825
18240
  }
17826
18241
  }
17827
18242
  }
@@ -17985,9 +18400,20 @@ class TaskbarEdit extends DateProcessor {
17985
18400
  this.parent.ganttChartModule.scrollObject.previousScroll.left;
17986
18401
  }
17987
18402
  this.tooltipPositionX = this.mouseDownX;
17988
- this.mouseDownY = e.pageY - containerPosition.top +
18403
+ this.mouseDownY = this.dragMoveY = e.pageY - containerPosition.top +
17989
18404
  this.parent.ganttChartModule.scrollObject.previousScroll.top;
17990
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
+ }
17991
18417
  if (this.taskBarEditAction === 'ConnectorPointLeftDrag' || this.taskBarEditAction === 'ConnectorPointRightDrag') {
17992
18418
  this.fromPredecessorText = this.taskBarEditAction === 'ConnectorPointLeftDrag' ? 'start' : 'finish';
17993
18419
  this.parent.connectorLineModule.tooltipTable.innerHTML = this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName, this.fromPredecessorText, '', '');
@@ -18117,6 +18543,22 @@ class TaskbarEdit extends DateProcessor {
18117
18543
  this.drawFalseLine();
18118
18544
  }
18119
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
+ }
18120
18562
  this.setItemPosition();
18121
18563
  this.updateEditedItem();
18122
18564
  this.editTooltip.updateTooltip(this.segmentIndex);
@@ -18196,12 +18638,12 @@ class TaskbarEdit extends DateProcessor {
18196
18638
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.left;
18197
18639
  this.startScrollTimer('left');
18198
18640
  }
18199
- else if (isConnectorLineEdit && ((mouseY + 80) >
18641
+ else if (((mouseY + 80) >
18200
18642
  containerPosition.top + this.parent.ganttChartModule.chartBodyContainer.offsetHeight)) {
18201
18643
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
18202
18644
  this.startScrollTimer('bottom');
18203
18645
  }
18204
- else if (isConnectorLineEdit && ((mouseY - 20) < containerPosition.top)) {
18646
+ else if (((mouseY - 20) < containerPosition.top)) {
18205
18647
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
18206
18648
  this.startScrollTimer('top');
18207
18649
  }
@@ -18986,6 +19428,11 @@ class TaskbarEdit extends DateProcessor {
18986
19428
  taskBarMainContainer$$1.style.width = (width) + 'px';
18987
19429
  leftLabelContainer$$1.style.width = (item.left) + 'px';
18988
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
+ }
18989
19436
  if (this.taskBarEditAction === 'LeftResizing' && this.segmentIndex === 0) {
18990
19437
  const parent = this.taskBarEditElement.parentElement;
18991
19438
  const segmentedTasks = parent.getElementsByClassName('e-segmented-taskbar');
@@ -19098,7 +19545,8 @@ class TaskbarEdit extends DateProcessor {
19098
19545
  this.previousMouseMove = null;
19099
19546
  this.editTooltip.showHideTaskbarEditTooltip(false, this.segmentIndex);
19100
19547
  if (this.taskBarEditAction && this.isMouseDragged) {
19101
- if (!this.dragMouseLeave && this.taskBarEditedAction) {
19548
+ if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.viewType === 'ResourceView' &&
19549
+ this.parent.allowTaskbarDragAndDrop)) {
19102
19550
  this.taskBarEditedAction(e);
19103
19551
  this.isMouseDragged = false;
19104
19552
  }
@@ -19207,6 +19655,65 @@ class TaskbarEdit extends DateProcessor {
19207
19655
  const args = extend({}, arg);
19208
19656
  const ganttRecord = args.data;
19209
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
+ }
19210
19717
  if (args.taskBarEditAction === 'ProgressResizing') {
19211
19718
  if (args.previousData.progress !== taskData.progress) {
19212
19719
  this.parent.setRecordValue('progress', this.getProgressPercent(taskData.width, taskData.progressWidth), taskData, true);
@@ -19398,14 +19905,20 @@ class TaskbarEdit extends DateProcessor {
19398
19905
  }
19399
19906
  if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
19400
19907
  !this.elementOffsetLeft) || !this.parent.enableVirtualization) {
19401
- if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
19402
- this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
19403
- this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
19404
- }
19405
- else {
19908
+ if (!this.parent.allowParentDependency) {
19406
19909
  this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
19407
19910
  this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
19408
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
+ }
19409
19922
  this.elementOffsetWidth = this.taskBarEditElement.offsetWidth;
19410
19923
  this.elementOffsetHeight = this.taskBarEditElement.offsetHeight;
19411
19924
  }
@@ -20418,7 +20931,7 @@ class DialogEdit {
20418
20931
  targetId = inputElement.querySelector('input').getAttribute('id');
20419
20932
  inputElement = inputElement.querySelector('#' + targetId);
20420
20933
  }
20421
- 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]) {
20422
20935
  inputElement = args.event.path[1];
20423
20936
  targetId = inputElement.querySelector('input').getAttribute('id');
20424
20937
  inputElement = inputElement.querySelector('#' + targetId);
@@ -20459,6 +20972,9 @@ class DialogEdit {
20459
20972
  if (!isNullOrUndefined(tasks.startDate) && tasks.startDate !== colName) {
20460
20973
  this.updateScheduleFields(dialog, ganttProp, 'startDate');
20461
20974
  }
20975
+ if (tasks.endDate === colName && !isNullOrUndefined(ganttProp.startDate) && !isNullOrUndefined(args.value) && ganttProp.startDate.getTime() > args.value) {
20976
+ this.updateScheduleFields(dialog, ganttProp, 'endDate');
20977
+ }
20462
20978
  if (!isNullOrUndefined(tasks.endDate) && tasks.endDate !== colName) {
20463
20979
  this.updateScheduleFields(dialog, ganttProp, 'endDate');
20464
20980
  }
@@ -20649,6 +21165,9 @@ class DialogEdit {
20649
21165
  if (taskSettings.endDate === columnName) {
20650
21166
  if (value !== '') {
20651
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
+ }
20652
21171
  if (endDate.getHours() === 0 && ganttObj.defaultEndTime !== 86400) {
20653
21172
  this.parent.dateValidationModule.setTime(ganttObj.defaultEndTime, endDate);
20654
21173
  }
@@ -21026,6 +21545,9 @@ class DialogEdit {
21026
21545
  item.content = this.renderGeneralTab(item.content);
21027
21546
  }
21028
21547
  else if (item.content === 'Dependency') {
21548
+ if (this.editedRecord.hasChildRecords && !this.parent.allowParentDependency) {
21549
+ item.disabled = true;
21550
+ }
21029
21551
  item.content = this.renderPredecessorTab(item.content);
21030
21552
  }
21031
21553
  else if (item.content === 'Resources') {
@@ -21477,27 +21999,34 @@ class DialogEdit {
21477
21999
  this.preTableCollection = [];
21478
22000
  for (let i = 0; i < flatData.length; i++) {
21479
22001
  const data = flatData[i];
21480
- let currentFlatData = data;
21481
- if (data.parentUniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
21482
- this.isValidData = false;
21483
- }
21484
- else {
21485
- do {
21486
- if (currentFlatData.parentItem) {
21487
- currentFlatData = this.parent.flatData[this.parent.ids.indexOf(currentFlatData.parentItem.taskId)];
21488
- if (currentFlatData.uniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
21489
- this.isValidData = false;
21490
- 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
+ }
21491
22015
  }
21492
- }
21493
- } while (currentFlatData.parentItem);
21494
- }
21495
- if (data.hasChildRecords && this.isValidData) {
21496
- 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
+ }
21497
22025
  }
21498
- if (!this.isValidData) {
21499
- this.isValidData = true;
21500
- continue;
22026
+ else {
22027
+ if (data.hasChildRecords) {
22028
+ continue;
22029
+ }
21501
22030
  }
21502
22031
  const taskId = this.parent.viewType === 'ResourceView' ? data.ganttProperties.taskId.toString()
21503
22032
  : data.ganttProperties.rowUniqueID.toString();
@@ -21733,6 +22262,10 @@ class DialogEdit {
21733
22262
  }
21734
22263
  else {
21735
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
+ }
21736
22269
  }
21737
22270
  }
21738
22271
  }
@@ -22016,9 +22549,10 @@ class ConnectorLineEdit {
22016
22549
  const from = 'from';
22017
22550
  const to = 'to';
22018
22551
  this.parent.connectorLineModule.removeConnectorLineById('parent' + predecessor[from] + 'child' + predecessor[to]);
22019
- parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[from]);
22020
- childGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[to]);
22021
- 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))) {
22022
22556
  connectorObj =
22023
22557
  this.parent.predecessorModule.updateConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor);
22024
22558
  if (!isNullOrUndefined(connectorObj)) {
@@ -22069,8 +22603,8 @@ class ConnectorLineEdit {
22069
22603
  if (!isNullOrUndefined(values[0])) {
22070
22604
  const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
22071
22605
  if (ids.indexOf(values[0]) === -1) {
22072
- if (values[0].indexOf(" ") != -1) {
22073
- match = values[0].split(" ");
22606
+ if (values[0].indexOf(' ') !== -1) {
22607
+ match = values[0].split(' ');
22074
22608
  if (match.length === 1) {
22075
22609
  match = values[0].match(/(\d+|[A-z]+)/g);
22076
22610
  }
@@ -22141,7 +22675,7 @@ class ConnectorLineEdit {
22141
22675
  let parentRec = rec;
22142
22676
  if (rec.parentItem) {
22143
22677
  parentRec = this.parent.flatData.filter((item) => {
22144
- return item.uniqueID == rec.parentUniqueID;
22678
+ return item.uniqueID === rec.parentUniqueID;
22145
22679
  })[0];
22146
22680
  if (parentRec.parentItem) {
22147
22681
  parentRec = this.getRootParent(parentRec);
@@ -22190,13 +22724,13 @@ class ConnectorLineEdit {
22190
22724
  }
22191
22725
  else {
22192
22726
  if (!toRecord.parentItem && fromRecord.parentItem) {
22193
- let fromRootParent = this.parent.connectorLineEditModule.getRootParent(fromRecord);
22727
+ const fromRootParent = this.parent.connectorLineEditModule.getRootParent(fromRecord);
22194
22728
  if (fromRootParent.uniqueID === toRecord.uniqueID) {
22195
22729
  return false;
22196
22730
  }
22197
22731
  }
22198
22732
  else if (toRecord.parentItem && !fromRecord.parentItem) {
22199
- let toRootParent = this.parent.connectorLineEditModule.getRootParent(toRecord);
22733
+ const toRootParent = this.parent.connectorLineEditModule.getRootParent(toRecord);
22200
22734
  if (toRootParent.uniqueID === fromRecord.uniqueID) {
22201
22735
  return false;
22202
22736
  }
@@ -22222,11 +22756,20 @@ class ConnectorLineEdit {
22222
22756
  if (!isNullOrUndefined(predecessorString) && predecessorString.length > 0) {
22223
22757
  predecessorIdArray = this.idFromPredecessor(predecessorString);
22224
22758
  for (let count = 0; count < predecessorIdArray.length; count++) {
22225
- if (parseInt(predecessorIdArray[predecessorIdArray.length - 1]) !== ganttRecord[this.parent.taskFields.id]) {
22226
- let num = this.parent.ids.indexOf(predecessorIdArray[predecessorIdArray.length - 1]);
22227
- let fromRecord = this.parent.currentViewData[num];
22228
- if (fromRecord && ganttRecord) {
22229
- 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
+ }
22230
22773
  }
22231
22774
  }
22232
22775
  // Check if predecessor exist more then one
@@ -22458,7 +23001,9 @@ class ConnectorLineEdit {
22458
23001
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22459
23002
  }
22460
23003
  else if (args.validateMode.preserveLinkWithEditing) {
22461
- this.calculateOffset(ganttRecord);
23004
+ if (this.parent.UpdateOffsetOnTaskbarEdit) {
23005
+ this.calculateOffset(ganttRecord);
23006
+ }
22462
23007
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22463
23008
  }
22464
23009
  }
@@ -22489,7 +23034,7 @@ class ConnectorLineEdit {
22489
23034
  const prevPredecessor = extend([], record.ganttProperties.predecessor, [], true);
22490
23035
  const validPredecessor = this.parent.predecessorModule.getValidPredecessor(record);
22491
23036
  for (let i = 0; i < validPredecessor.length; i++) {
22492
- const predecessor = validPredecessor[i];
23037
+ const predecessor = validPredecessor[parseInt(i.toString(), 10)];
22493
23038
  const parentTask = this.parent.connectorLineModule.getRecordByID(predecessor.from);
22494
23039
  let offset;
22495
23040
  if (isScheduledTask(parentTask.ganttProperties) && isScheduledTask(record.ganttProperties)) {
@@ -22569,7 +23114,7 @@ class ConnectorLineEdit {
22569
23114
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22570
23115
  const index = getIndex(predecessor[i], 'from', prevPredecessor, 'to');
22571
23116
  prevPredecessor.splice(index, 1);
22572
- const parentIndex = getIndex(predecessor[i], 'from', parentPredecessor, 'to');
23117
+ const parentIndex = getIndex(predecessor[parseInt(i.toString(), 10)], 'from', parentPredecessor, 'to');
22573
23118
  parentPredecessor.splice(parentIndex, 1);
22574
23119
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
22575
23120
  }
@@ -22680,41 +23225,41 @@ class ConnectorLineEdit {
22680
23225
  let violationType = null;
22681
23226
  if (predecessor[i].type === 'FS') {
22682
23227
  if (ganttTaskData.startDate < startDate) {
22683
- this.validationPredecessor.push(predecessor[i]);
23228
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22684
23229
  violationType = 'taskBeforePredecessor_FS';
22685
23230
  }
22686
23231
  else if (ganttTaskData.startDate > startDate) {
22687
- this.validationPredecessor.push(predecessor[i]);
23232
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22688
23233
  violationType = 'taskAfterPredecessor_FS';
22689
23234
  }
22690
23235
  }
22691
23236
  else if (predecessor[i].type === 'SS') {
22692
23237
  if (ganttTaskData.startDate < startDate) {
22693
- this.validationPredecessor.push(predecessor[i]);
23238
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22694
23239
  violationType = 'taskBeforePredecessor_SS';
22695
23240
  }
22696
23241
  else if (ganttTaskData.startDate > startDate) {
22697
- this.validationPredecessor.push(predecessor[i]);
23242
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22698
23243
  violationType = 'taskAfterPredecessor_SS';
22699
23244
  }
22700
23245
  }
22701
23246
  else if (predecessor[i].type === 'FF') {
22702
23247
  if (endDate <= parentGanttRecord.ganttProperties.endDate) {
22703
- this.validationPredecessor.push(predecessor[i]);
23248
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22704
23249
  violationType = 'taskBeforePredecessor_FF';
22705
23250
  }
22706
23251
  else if (endDate > parentGanttRecord.ganttProperties.endDate) {
22707
- this.validationPredecessor.push(predecessor[i]);
23252
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22708
23253
  violationType = 'taskAfterPredecessor_FF';
22709
23254
  }
22710
23255
  }
22711
23256
  else if (predecessor[i].type === 'SF') {
22712
23257
  if (endDate < parentGanttRecord.ganttProperties.startDate) {
22713
- this.validationPredecessor.push(predecessor[i]);
23258
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22714
23259
  violationType = 'taskBeforePredecessor_SF';
22715
23260
  }
22716
23261
  else if (endDate >= parentGanttRecord.ganttProperties.startDate) {
22717
- this.validationPredecessor.push(predecessor[i]);
23262
+ this.validationPredecessor.push(predecessor[parseInt(i.toString(), 10)]);
22718
23263
  violationType = 'taskAfterPredecessor_SF';
22719
23264
  }
22720
23265
  }
@@ -22745,13 +23290,13 @@ class ConnectorLineEdit {
22745
23290
  const prevPredecessor = prevData.ganttProperties.predecessor;
22746
23291
  if (!isNullOrUndefined(prevPredecessor)) {
22747
23292
  for (let p = 0; p < prevPredecessor.length; p++) {
22748
- const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(prevPredecessor[p].from);
23293
+ const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(prevPredecessor[parseInt(p.toString(), 10)].from);
22749
23294
  if (parentGanttRecord === data) {
22750
- data.ganttProperties.predecessor.push(prevPredecessor[p]);
23295
+ data.ganttProperties.predecessor.push(prevPredecessor[parseInt(p.toString(), 10)]);
22751
23296
  }
22752
23297
  else {
22753
23298
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22754
- const parentIndex = getIndex(prevPredecessor[p], 'from', parentPredecessor, 'to');
23299
+ const parentIndex = getIndex(prevPredecessor[parseInt(p.toString(), 10)], 'from', parentPredecessor, 'to');
22755
23300
  if (parentIndex !== -1) {
22756
23301
  parentPredecessor.splice(parentIndex, 1);
22757
23302
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
@@ -22761,9 +23306,9 @@ class ConnectorLineEdit {
22761
23306
  }
22762
23307
  if (!isNullOrUndefined(newPredecessor)) {
22763
23308
  for (let n = 0; n < newPredecessor.length; n++) {
22764
- const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(newPredecessor[n].from);
23309
+ const parentGanttRecord = this.parent.connectorLineModule.getRecordByID(newPredecessor[parseInt(n.toString(), 10)].from);
22765
23310
  const parentPredecessor = extend([], [], parentGanttRecord.ganttProperties.predecessor, true);
22766
- parentPredecessor.push(newPredecessor[n]);
23311
+ parentPredecessor.push(newPredecessor[parseInt(n.toString(), 10)]);
22767
23312
  this.parent.setRecordValue('predecessor', parentPredecessor, parentGanttRecord.ganttProperties, true);
22768
23313
  }
22769
23314
  }
@@ -23222,7 +23767,7 @@ class Edit$2 {
23222
23767
  let isScheduleValueUpdated = false;
23223
23768
  for (const key of Object.keys(data)) {
23224
23769
  if ([tasks.startDate, tasks.endDate, tasks.duration].indexOf(key) !== -1) {
23225
- if (isNullOrUndefined(data[key]) && !ganttObj.allowUnscheduledTasks) {
23770
+ if (isNullOrUndefined(data[`${key}`]) && !ganttObj.allowUnscheduledTasks) {
23226
23771
  continue;
23227
23772
  }
23228
23773
  if (isFromDialog) {
@@ -23278,7 +23823,7 @@ class Edit$2 {
23278
23823
  else if (key === tasks.name) {
23279
23824
  ganttPropKey = 'taskName';
23280
23825
  }
23281
- else if (key === tasks.segments) {
23826
+ else if ((key === tasks.segments) && (!isNullOrUndefined(ganttData.ganttProperties.segments))) {
23282
23827
  ganttPropKey = 'segments';
23283
23828
  /* eslint-disable-next-line */
23284
23829
  if (data && !isNullOrUndefined(data[this.parent.taskFields.segments]) && data[this.parent.taskFields.segments].length > 0) {
@@ -23568,7 +24113,7 @@ class Edit$2 {
23568
24113
  else if (args.data.childRecords.length > 0 && !isValidatePredecessor) {
23569
24114
  isValidatePredecessor = this.isCheckPredecessor(args.data);
23570
24115
  if (!isValidatePredecessor && this.isTaskbarMoved(args.data)) {
23571
- for (var i = 0; i < args.data.childRecords.length; i++) {
24116
+ for (let i = 0; i < args.data.childRecords.length; i++) {
23572
24117
  if (this.parent.predecessorModule.getValidPredecessor(args.data.childRecords[i]).length > 0) {
23573
24118
  childRecordIndex = i;
23574
24119
  isValidatePredecessor = true;
@@ -23646,8 +24191,10 @@ class Edit$2 {
23646
24191
  */
23647
24192
  updateEditedTask(args) {
23648
24193
  const ganttRecord = args.data;
23649
- this.updateParentChildRecord(ganttRecord);
23650
- if (this.parent.isConnectorLineUpdate) {
24194
+ if (this.parent.autoCalculateDateScheduling) {
24195
+ this.updateParentChildRecord(ganttRecord);
24196
+ }
24197
+ if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
23651
24198
  /* validating predecessor for updated child items */
23652
24199
  for (let i = 0; i < this.validatedChildItems.length; i++) {
23653
24200
  const child = this.validatedChildItems[i];
@@ -23666,7 +24213,7 @@ class Edit$2 {
23666
24213
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
23667
24214
  this.parent.predecessorModule.isValidatedParentTaskID = '';
23668
24215
  }
23669
- if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
24216
+ if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
23670
24217
  (args.action === "DrawConnectorLine")) {
23671
24218
  this.updateChildItems(ganttRecord);
23672
24219
  }
@@ -23674,7 +24221,9 @@ class Edit$2 {
23674
24221
  }
23675
24222
  /** Update parent up-to zeroth level */
23676
24223
  if (ganttRecord.parentItem) {
23677
- this.parent.dataOperation.updateParentItems(ganttRecord, true);
24224
+ if (this.parent.autoCalculateDateScheduling) {
24225
+ this.parent.dataOperation.updateParentItems(ganttRecord, true);
24226
+ }
23678
24227
  let parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
23679
24228
  if (!parentData.ganttProperties.predecessorsName) {
23680
24229
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
@@ -23920,7 +24469,7 @@ class Edit$2 {
23920
24469
  durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
23921
24470
  }
23922
24471
  for (let i = 0; i < childRecords.length; i++) {
23923
- if ((!(this.parent.isUnscheduledTask(childRecords[i].ganttProperties))) && (childRecords[i].ganttProperties.isAutoSchedule)) {
24472
+ if (childRecords[i].ganttProperties.isAutoSchedule) {
23924
24473
  if (durationDiff > 0) {
23925
24474
  const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
23926
24475
  childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
@@ -24037,52 +24586,52 @@ class Edit$2 {
24037
24586
  }
24038
24587
  for (let i = 0; i < eLength; i++) {
24039
24588
  if (e.changedRecords) {
24040
- rec = e.changedRecords[i];
24589
+ rec = e.changedRecords[parseInt(i.toString(), 10)];
24041
24590
  }
24042
24591
  else {
24043
- rec = e[i];
24592
+ rec = e[parseInt(i.toString(), 10)];
24044
24593
  }
24045
24594
  let _aLength = Object.keys(rec).length;
24046
24595
  for (let j = 0, _a = Object.keys(rec); j < _aLength; j++) {
24047
- let key = _a[j];
24048
- this.parent.editedRecords[i][key] = rec[key];
24049
- 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}`];
24050
24599
  }
24051
24600
  if (this.parent.taskFields.id !== null) {
24052
- 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];
24053
24602
  }
24054
24603
  if (this.parent.taskFields.name !== null) {
24055
- 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];
24056
24605
  }
24057
24606
  if (this.parent.taskFields.startDate !== null) {
24058
- 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];
24059
24608
  }
24060
24609
  if (this.parent.taskFields.endDate !== null) {
24061
- 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];
24062
24611
  }
24063
24612
  if (this.parent.taskFields.duration !== null) {
24064
- 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]);
24065
24614
  }
24066
24615
  if (this.parent.taskFields.durationUnit !== null) {
24067
- 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];
24068
24617
  }
24069
24618
  if (this.parent.taskFields.progress !== null) {
24070
- 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];
24071
24620
  }
24072
24621
  if (this.parent.taskFields.dependency !== null) {
24073
- 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];
24074
24623
  }
24075
24624
  if (this.parent.taskFields.parentID !== null) {
24076
- 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];
24077
24626
  }
24078
24627
  if (this.parent.taskFields.baselineEndDate !== null) {
24079
- 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];
24080
24629
  }
24081
24630
  if (this.parent.taskFields.baselineStartDate !== null) {
24082
- 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];
24083
24632
  }
24084
24633
  if (this.parent.taskFields.resourceInfo !== null) {
24085
- 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];
24086
24635
  }
24087
24636
  }
24088
24637
  this.saveSuccess(args);
@@ -24151,6 +24700,14 @@ class Edit$2 {
24151
24700
  }
24152
24701
  if (!this.isTreeGridRefresh) {
24153
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
+ }
24154
24711
  if (this.parent.isConnectorLineUpdate && !isNullOrUndefined(this.parent.connectorLineEditModule)) {
24155
24712
  this.parent.updatedConnectorLineCollection = [];
24156
24713
  this.parent.connectorLineIds = [];
@@ -25047,7 +25604,7 @@ class Edit$2 {
25047
25604
  return !data.hasChildRecords;
25048
25605
  });
25049
25606
  for (let i = 0; i < updateUnAssignedResources.length; i++) {
25050
- const unassignedTask = this.parent.flatData.filter((data) => {
25607
+ let unassignedTask = this.parent.flatData.filter((data) => {
25051
25608
  return data.ganttProperties.taskName === this.parent.localeObj.getConstant('unassignedTask');
25052
25609
  })[0];
25053
25610
  let isDuplicate = [];
@@ -25060,15 +25617,24 @@ class Edit$2 {
25060
25617
  if (parentTask && parentTask.ganttProperties.taskName !==
25061
25618
  this.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
25062
25619
  this.checkWithUnassignedTask(updateUnAssignedResources[i]);
25063
- if (parentTask) {
25064
- this.parent.dataOperation.updateParentItems(updateUnAssignedResources[i].parentItem);
25065
- }
25066
25620
  }
25067
25621
  else if (!parentTask && (!isDuplicate || isDuplicate.length === 0)) {
25068
25622
  this.checkWithUnassignedTask(updateUnAssignedResources[i]);
25069
- if (updateUnAssignedResources[i].parentItem && unassignedTask) {
25070
- 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;
25071
25634
  }
25635
+ });
25636
+ if (parentItem[0]) {
25637
+ this.parent.dataOperation.updateParentItems(parentItem[0]);
25072
25638
  }
25073
25639
  }
25074
25640
  }
@@ -25669,7 +26235,7 @@ class Edit$2 {
25669
26235
  if (!isNullOrUndefined(ganttData)) {
25670
26236
  this.validateUpdateValues(args.newTaskData, ganttData, true);
25671
26237
  }
25672
- if (!isNullOrUndefined(args.data[tempTaskID])) {
26238
+ if (!isNullOrUndefined(args.data[`${tempTaskID}`])) {
25673
26239
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
25674
26240
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
25675
26241
  args.newTaskData[tempTaskID] = args.data[tempTaskID];
@@ -26945,9 +27511,95 @@ class Filter$1 {
26945
27511
  }
26946
27512
  }
26947
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
+ }
26948
27580
  updateFilterMenuPosition(element, args) {
26949
27581
  addClass([element], 'e-gantt');
26950
- 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
+ }
26951
27603
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
26952
27604
  element.querySelector('.e-valid-input').focus();
26953
27605
  }
@@ -27363,7 +28015,10 @@ class Selection$1 {
27363
28015
  const rIndex = parseInt(selectedRow.getAttribute('aria-rowindex'), 10);
27364
28016
  const isToggle = this.parent.selectionSettings.enableToggle;
27365
28017
  if (this.parent.selectionSettings.type === 'Single' || (!this.isMultiCtrlRequest && !this.isMultiShiftRequest)) {
27366
- 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
+ }
27367
28022
  }
27368
28023
  else {
27369
28024
  if (this.isMultiShiftRequest) {
@@ -27407,7 +28062,7 @@ class Selection$1 {
27407
28062
  }
27408
28063
  addRemoveClass(records) {
27409
28064
  if (typeof (records) == "number") {
27410
- records = Array.from(String(records), (num) => Number(num));
28065
+ records = [records];
27411
28066
  }
27412
28067
  const ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
27413
28068
  for (let i = 0; i < records.length; i++) {
@@ -28181,6 +28836,9 @@ class NonWorkingDay {
28181
28836
  });
28182
28837
  const property = this.parent.disableHtmlEncode ? 'textContent' : 'innerHTML';
28183
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
+ }
28184
28842
  holidayDiv.appendChild(spanElement);
28185
28843
  if (this.parent.holidays[i].cssClass) {
28186
28844
  holidayDiv.classList.add(this.parent.holidays[i].cssClass);
@@ -28366,6 +29024,9 @@ class EventMarker$1 {
28366
29024
  });
28367
29025
  const property = this.parent.disableHtmlEncode ? 'textContent' : 'innerHTML';
28368
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
+ }
28369
29030
  if (this.parent.enableRtl) {
28370
29031
  spanElement.style.right = '5px';
28371
29032
  }
@@ -29598,7 +30259,7 @@ class ContextMenu$2 {
29598
30259
  this.parent.selectionModule.selectRow(rowIndex);
29599
30260
  }
29600
30261
  if (!args.parentItem) {
29601
- this.rowData = this.parent.updatedRecords[rowIndex];
30262
+ this.rowData = this.parent.updatedRecords[parseInt(rowIndex.toString(), 10)];
29602
30263
  }
29603
30264
  for (const item of args.items) {
29604
30265
  // let target: EventTarget = target;
@@ -29729,7 +30390,7 @@ class ContextMenu$2 {
29729
30390
  this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
29730
30391
  const prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
29731
30392
  if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
29732
- 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) {
29733
30394
  this.updateItemVisibility(item.text);
29734
30395
  }
29735
30396
  }
@@ -29745,7 +30406,7 @@ class ContextMenu$2 {
29745
30406
  const isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
29746
30407
  this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
29747
30408
  if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
29748
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
30409
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[parseInt(ind.toString(), 10)].level === 0) {
29749
30410
  this.updateItemVisibility(item.text);
29750
30411
  }
29751
30412
  }
@@ -29755,7 +30416,7 @@ class ContextMenu$2 {
29755
30416
  {
29756
30417
  const taskSettings = this.parent.taskFields;
29757
30418
  if (this.parent.readOnly || !taskbarElement || isNullOrUndefined(taskSettings.segments) ||
29758
- this.parent.currentViewData[rowIndex].hasChildRecords) {
30419
+ this.parent.currentViewData[parseInt(rowIndex.toString(), 10)].hasChildRecords) {
29759
30420
  this.updateItemVisibility(item.text);
29760
30421
  }
29761
30422
  break;
@@ -29958,7 +30619,7 @@ class ContextMenu$2 {
29958
30619
  }
29959
30620
  contextMenuOnClose(args) {
29960
30621
  const parent = 'parentObj';
29961
- 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) {
29962
30623
  this.revertItemStatus();
29963
30624
  }
29964
30625
  }
@@ -30428,7 +31089,7 @@ class RowDD$1 {
30428
31089
  parentUniqueID = this.droppedRecord.uniqueID;
30429
31090
  }
30430
31091
  else {
30431
- parentUniqueID = this.droppedRecord.parentItem.uniqueID;
31092
+ parentUniqueID = this.droppedRecord.parentItem ? this.droppedRecord.parentItem.uniqueID : this.droppedRecord.uniqueID;
30432
31093
  }
30433
31094
  const droppedParentItem = this.parent.getTaskByUniqueID(parentUniqueID);
30434
31095
  const editedObj = {};
@@ -30455,7 +31116,7 @@ class RowDD$1 {
30455
31116
  this.updateSharedResourceTask();
30456
31117
  }
30457
31118
  }
30458
- if (this.parent.taskFields.dependency) {
31119
+ if (this.parent.taskFields.dependency && this.parent.allowParentDependency) {
30459
31120
  let isValidPredecessor = true;
30460
31121
  let draggedParent;
30461
31122
  let toParent;
@@ -34938,7 +35599,8 @@ class PdfExport {
34938
35599
  * @param {object} pdfDoc .
34939
35600
  * @returns {Promise<Object>} .
34940
35601
  */
34941
- export(pdfExportProperties, isMultipleExport, pdfDoc) {
35602
+ export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
35603
+ this.isBlob = isBlob;
34942
35604
  const args = {
34943
35605
  requestType: 'beforePdfExport',
34944
35606
  ganttObject: this.parent,
@@ -34981,7 +35643,7 @@ class PdfExport {
34981
35643
  this.pdfDocument = new PdfDocument();
34982
35644
  }
34983
35645
  this.processExport(data, pdfExportProperties, isMultipleExport).then(() => {
34984
- this.parent.trigger('pdfExportComplete', {});
35646
+ this.parent.trigger('pdfExportComplete', this.isBlob ? { promise: this.blobPromise } : {});
34985
35647
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
34986
35648
  this.parent.hideMaskRow();
34987
35649
  }
@@ -35006,12 +35668,17 @@ class PdfExport {
35006
35668
  const layouter = this.gantt.drawGrid(pdfPage, 0, 0, format);
35007
35669
  this.gantt.drawChart(layouter);
35008
35670
  if (!isMultipleExport) {
35009
- // save the PDF
35010
- if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
35011
- 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
+ }
35012
35679
  }
35013
35680
  else {
35014
- this.pdfDocument.save('Export.pdf');
35681
+ this.blobPromise = this.pdfDocument.save();
35015
35682
  }
35016
35683
  this.pdfDocument.destroy();
35017
35684
  }