@syncfusion/ej2-gantt 21.1.41 → 21.2.3

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 (48) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +21 -10
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +22 -10
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +20 -23
  13. package/src/gantt/actions/edit.js +1 -1
  14. package/src/gantt/actions/taskbar-edit.d.ts +1 -1
  15. package/src/gantt/actions/taskbar-edit.js +2 -2
  16. package/src/gantt/base/task-processor.js +2 -2
  17. package/src/gantt/renderer/chart-rows.js +17 -5
  18. package/styles/bootstrap-dark.css +3 -0
  19. package/styles/bootstrap.css +3 -0
  20. package/styles/bootstrap4.css +3 -0
  21. package/styles/bootstrap5-dark.css +3 -0
  22. package/styles/bootstrap5.css +3 -0
  23. package/styles/fabric-dark.css +3 -0
  24. package/styles/fabric.css +3 -0
  25. package/styles/fluent-dark.css +3 -0
  26. package/styles/fluent.css +3 -0
  27. package/styles/gantt/_theme.scss +4 -0
  28. package/styles/gantt/bootstrap-dark.css +3 -0
  29. package/styles/gantt/bootstrap.css +3 -0
  30. package/styles/gantt/bootstrap4.css +3 -0
  31. package/styles/gantt/bootstrap5-dark.css +3 -0
  32. package/styles/gantt/bootstrap5.css +3 -0
  33. package/styles/gantt/fabric-dark.css +3 -0
  34. package/styles/gantt/fabric.css +3 -0
  35. package/styles/gantt/fluent-dark.css +3 -0
  36. package/styles/gantt/fluent.css +3 -0
  37. package/styles/gantt/highcontrast-light.css +3 -0
  38. package/styles/gantt/highcontrast.css +3 -0
  39. package/styles/gantt/material-dark.css +3 -0
  40. package/styles/gantt/material.css +3 -0
  41. package/styles/gantt/tailwind-dark.css +3 -0
  42. package/styles/gantt/tailwind.css +3 -0
  43. package/styles/highcontrast-light.css +3 -0
  44. package/styles/highcontrast.css +3 -0
  45. package/styles/material-dark.css +3 -0
  46. package/styles/material.css +3 -0
  47. package/styles/tailwind-dark.css +3 -0
  48. package/styles/tailwind.css +3 -0
@@ -3871,13 +3871,13 @@ class TaskProcessor extends DateProcessor {
3871
3871
  minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3872
3872
  if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3873
3873
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3874
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3874
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone && (parentData.hasChildRecords && parentData.ganttProperties.isAutoSchedule && this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action !== "TaskbarEditing")) {
3875
3875
  this.parent.setRecordValue('startDate', minStartDate, parentData.ganttProperties, true);
3876
3876
  }
3877
3877
  }
3878
3878
  if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3879
3879
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3880
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3880
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone && (parentData.hasChildRecords && parentData.ganttProperties.isAutoSchedule && this.parent.editModule.taskbarEditModule.taskbarEditedArgs.action !== "TaskbarEditing")) {
3881
3881
  this.parent.setRecordValue('endDate', maxEndDate, parentData.ganttProperties, true);
3882
3882
  }
3883
3883
  }
@@ -9370,7 +9370,7 @@ class ChartRows extends DateProcessor {
9370
9370
  '<div class="' + manualParentMilestoneBottom + '" style="top:' +
9371
9371
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
9372
9372
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
9373
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
9373
+ return this.createDivElement(data.ganttProperties.duration !== 0 ? template : milestoneTemplate);
9374
9374
  }
9375
9375
  /**
9376
9376
  * To get parent taskbar node.
@@ -9566,7 +9566,7 @@ class ChartRows extends DateProcessor {
9566
9566
  const template = '<div class="' + taskBarMainContainer + ' ' +
9567
9567
  this.parent.getUnscheduledTaskClass(data.ganttProperties) + ' ' +
9568
9568
  ((data.ganttProperties.cssClass) ? data.ganttProperties.cssClass : '') + '" ' +
9569
- ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent) ?
9569
+ ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent && !(data.hasChildRecords && !data.ganttProperties.isAutoSchedule)) ?
9570
9570
  ('width:' + this.milestoneHeight + 'px;height:' +
9571
9571
  this.milestoneHeight + 'px;margin-top:' + this.milestoneMarginTop + 'px;' + (this.parent.enableRtl ? 'right:' : 'left:') + (data.ganttProperties.left -
9572
9572
  (this.milestoneHeight / 2)) + 'px;') : ('width:' + data.ganttProperties.width +
@@ -9891,6 +9891,10 @@ class ChartRows extends DateProcessor {
9891
9891
  }
9892
9892
  }
9893
9893
  else {
9894
+ let dupChartBody;
9895
+ dupChartBody = createElement('tbody', {
9896
+ id: this.parent.element.id + 'GanttTaskTableBody'
9897
+ });
9894
9898
  for (let i = 0; i < this.parent.currentViewData.length; i++) {
9895
9899
  const tempTemplateData = this.parent.currentViewData[i];
9896
9900
  if (this.parent.viewType === 'ResourceView') {
@@ -9903,9 +9907,9 @@ class ChartRows extends DateProcessor {
9903
9907
  }
9904
9908
  }
9905
9909
  const tRow = this.getGanttChartRow(i, tempTemplateData);
9906
- this.ganttChartTableBody.appendChild(tRow);
9910
+ dupChartBody.appendChild(tRow);
9907
9911
  if (this.parent.enableImmutableMode) {
9908
- this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[i]);
9912
+ this.refreshedTr.push(dupChartBody.querySelectorAll('tr')[i]);
9909
9913
  this.refreshedData.push(this.parent.currentViewData[i]);
9910
9914
  }
9911
9915
  // To maintain selection when virtualization is enabled
@@ -9913,6 +9917,7 @@ class ChartRows extends DateProcessor {
9913
9917
  this.parent.selectionModule.maintainSelectedRecords(parseInt(tRow.getAttribute('aria-rowindex'), 10));
9914
9918
  }
9915
9919
  }
9920
+ this.ganttChartTableBody.replaceChildren(...dupChartBody.childNodes);
9916
9921
  }
9917
9922
  this.parent.renderTemplates();
9918
9923
  this.triggerQueryTaskbarInfo();
@@ -9970,9 +9975,15 @@ class ChartRows extends DateProcessor {
9970
9975
  taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
9971
9976
  }
9972
9977
  }
9973
- if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
9978
+ if ((this.templateData.ganttProperties.autoDuration !== 0) && !this.templateData.ganttProperties.isMilestone && parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
9974
9979
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
9975
9980
  }
9981
+ else if ((this.templateData.ganttProperties.duration === 0 && this.templateData.ganttProperties.isMilestone && this.templateData.ganttProperties.isAutoSchedule)) {
9982
+ const milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
9983
+ if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
9984
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
9985
+ }
9986
+ }
9976
9987
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
9977
9988
  this.templateData.ganttProperties.baselineEndDate) {
9978
9989
  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()))
@@ -19352,7 +19363,7 @@ class TaskbarEdit extends DateProcessor {
19352
19363
  : ganttRecord.left;
19353
19364
  const tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.bottomTier :
19354
19365
  this.parent.timelineModule.topTier;
19355
- let remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left), 1, 'Day') / (1000 * 60 * 60 * 24)));
19366
+ let remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left, isNullOrUndefined(ganttRecord) ? ganttRecord.isMilestone : null, ganttRecord), 1, 'Day') / (1000 * 60 * 60 * 24)));
19356
19367
  let remainDays = this.parent.perDayWidth - (this.parent.perDayWidth / remainingContribution);
19357
19368
  const remainDaysInDecimal = remainDays / this.parent.perDayWidth;
19358
19369
  if (isRoundOff === undefined) {
@@ -19400,7 +19411,7 @@ class TaskbarEdit extends DateProcessor {
19400
19411
  const milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
19401
19412
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
19402
19413
  /* To render the milestone in proper date while editing */
19403
- if (isMilestone) {
19414
+ if (isMilestone && !isNullOrUndefined(property.predecessor) && property.predecessor.length > 0) {
19404
19415
  pStartDate.setDate(pStartDate.getDate() - 1);
19405
19416
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
19406
19417
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
@@ -24254,7 +24265,7 @@ class Edit$2 {
24254
24265
  this.parent.predecessorModule.isValidatedParentTaskID = '';
24255
24266
  }
24256
24267
  if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
24257
- (args.action === "DrawConnectorLine")) {
24268
+ (args.action === "DrawConnectorLine") || (args.action === "DialogEditing")) {
24258
24269
  this.updateChildItems(ganttRecord);
24259
24270
  }
24260
24271
  this.updateParentItemOnEditing();