@syncfusion/ej2-gantt 21.1.41 → 21.2.4

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 (51) hide show
  1. package/CHANGELOG.md +22 -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 +40 -16
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +41 -16
  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 +19 -19
  13. package/src/gantt/actions/dialog-edit.js +1 -1
  14. package/src/gantt/actions/edit.js +5 -2
  15. package/src/gantt/actions/taskbar-edit.d.ts +1 -1
  16. package/src/gantt/actions/taskbar-edit.js +2 -2
  17. package/src/gantt/base/gantt.js +1 -1
  18. package/src/gantt/base/task-processor.js +2 -2
  19. package/src/gantt/renderer/chart-rows.js +29 -7
  20. package/src/gantt/renderer/timeline.js +1 -1
  21. package/styles/bootstrap-dark.css +3 -0
  22. package/styles/bootstrap.css +3 -0
  23. package/styles/bootstrap4.css +3 -0
  24. package/styles/bootstrap5-dark.css +3 -0
  25. package/styles/bootstrap5.css +3 -0
  26. package/styles/fabric-dark.css +3 -0
  27. package/styles/fabric.css +3 -0
  28. package/styles/fluent-dark.css +3 -0
  29. package/styles/fluent.css +3 -0
  30. package/styles/gantt/_theme.scss +4 -0
  31. package/styles/gantt/bootstrap-dark.css +3 -0
  32. package/styles/gantt/bootstrap.css +3 -0
  33. package/styles/gantt/bootstrap4.css +3 -0
  34. package/styles/gantt/bootstrap5-dark.css +3 -0
  35. package/styles/gantt/bootstrap5.css +3 -0
  36. package/styles/gantt/fabric-dark.css +3 -0
  37. package/styles/gantt/fabric.css +3 -0
  38. package/styles/gantt/fluent-dark.css +3 -0
  39. package/styles/gantt/fluent.css +3 -0
  40. package/styles/gantt/highcontrast-light.css +3 -0
  41. package/styles/gantt/highcontrast.css +3 -0
  42. package/styles/gantt/material-dark.css +3 -0
  43. package/styles/gantt/material.css +3 -0
  44. package/styles/gantt/tailwind-dark.css +3 -0
  45. package/styles/gantt/tailwind.css +3 -0
  46. package/styles/highcontrast-light.css +3 -0
  47. package/styles/highcontrast.css +3 -0
  48. package/styles/material-dark.css +3 -0
  49. package/styles/material.css +3 -0
  50. package/styles/tailwind-dark.css +3 -0
  51. package/styles/tailwind.css +3 -0
@@ -3918,13 +3918,13 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3918
3918
  minStartDate.getTime() === maxEndDate.getTime() ? true : false;
3919
3919
  if (this.compareDates(previousStartDate, minStartDate) !== 0) {
3920
3920
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
3921
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3921
+ 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")) {
3922
3922
  this.parent.setRecordValue('startDate', minStartDate, parentData.ganttProperties, true);
3923
3923
  }
3924
3924
  }
3925
3925
  if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
3926
3926
  this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
3927
- if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
3927
+ 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")) {
3928
3928
  this.parent.setRecordValue('endDate', maxEndDate, parentData.ganttProperties, true);
3929
3929
  }
3930
3930
  }
@@ -5941,7 +5941,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
5941
5941
  var secondValue;
5942
5942
  var zoomingCollections = this.parent.zoomingLevels.slice();
5943
5943
  var sortedCollectons = zoomingCollections.sort(function (a, b) {
5944
- return (a.perDayWidth < b.perDayWidth) ? 1 : -1;
5944
+ return (!a.perDayWidth && !b.perDayWidth ? 0 : (a.perDayWidth < b.perDayWidth) ? 1 : -1);
5945
5945
  });
5946
5946
  if (perDayWidth === 0) { // return when the Gantt chart is not in viewable state.
5947
5947
  return;
@@ -9182,7 +9182,12 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9182
9182
  data.ganttProperties.segments.length === 0))) {
9183
9183
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
9184
9184
  var templateElement = this.createDivElement(template)[0];
9185
- templateElement.innerText = labelString;
9185
+ if (this.parent.disableHtmlEncode) {
9186
+ templateElement.innerText = labelString;
9187
+ }
9188
+ else {
9189
+ templateElement.innerHTML = labelString;
9190
+ }
9186
9191
  var childLabel = this.parent.labelSettings.taskLabel;
9187
9192
  if (childLabel && childLabel['elementRef'])
9188
9193
  templateElement.appendChild(tempDiv);
@@ -9776,7 +9781,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9776
9781
  '<div class="' + manualParentMilestoneBottom + '" style="top:' +
9777
9782
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
9778
9783
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
9779
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
9784
+ return this.createDivElement(data.ganttProperties.duration !== 0 ? template : milestoneTemplate);
9780
9785
  };
9781
9786
  /**
9782
9787
  * To get parent taskbar node.
@@ -9848,7 +9853,12 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9848
9853
  this.taskBarHeight + 'px;"></span>';
9849
9854
  }
9850
9855
  var labelElement = this.createDivElement(labelDiv)[0];
9851
- labelElement.innerText = labelString;
9856
+ if (this.parent.disableHtmlEncode) {
9857
+ labelElement.innerText = labelString;
9858
+ }
9859
+ else {
9860
+ labelElement.innerHTML = labelString;
9861
+ }
9852
9862
  var parentLabel = this.parent.labelSettings.taskLabel;
9853
9863
  if (parentLabel && parentLabel['elementRef'])
9854
9864
  labelElement.appendChild(div);
@@ -9972,7 +9982,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9972
9982
  var template = '<div class="' + taskBarMainContainer + ' ' +
9973
9983
  this.parent.getUnscheduledTaskClass(data.ganttProperties) + ' ' +
9974
9984
  ((data.ganttProperties.cssClass) ? data.ganttProperties.cssClass : '') + '" ' +
9975
- ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent) ?
9985
+ ' tabindex="-1" role="term" style="' + ((data.ganttProperties.isMilestone && !manualParent && !(data.hasChildRecords && !data.ganttProperties.isAutoSchedule)) ?
9976
9986
  ('width:' + this.milestoneHeight + 'px;height:' +
9977
9987
  this.milestoneHeight + 'px;margin-top:' + this.milestoneMarginTop + 'px;' + (this.parent.enableRtl ? 'right:' : 'left:') + (data.ganttProperties.left -
9978
9988
  (this.milestoneHeight / 2)) + 'px;') : ('width:' + data.ganttProperties.width +
@@ -10267,6 +10277,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10267
10277
  * @private
10268
10278
  */
10269
10279
  ChartRows.prototype.createTaskbarTemplate = function () {
10280
+ var _a;
10270
10281
  var trs = [].slice.call(this.ganttChartTableBody.querySelectorAll('tr'));
10271
10282
  this.ganttChartTableBody.innerHTML = '';
10272
10283
  var collapsedResourceRecord = [];
@@ -10297,6 +10308,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10297
10308
  }
10298
10309
  }
10299
10310
  else {
10311
+ var dupChartBody = void 0;
10312
+ dupChartBody = createElement('tbody', {
10313
+ id: this.parent.element.id + 'GanttTaskTableBody'
10314
+ });
10300
10315
  for (var i = 0; i < this.parent.currentViewData.length; i++) {
10301
10316
  var tempTemplateData = this.parent.currentViewData[i];
10302
10317
  if (this.parent.viewType === 'ResourceView') {
@@ -10309,9 +10324,9 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10309
10324
  }
10310
10325
  }
10311
10326
  var tRow = this.getGanttChartRow(i, tempTemplateData);
10312
- this.ganttChartTableBody.appendChild(tRow);
10327
+ dupChartBody.appendChild(tRow);
10313
10328
  if (this.parent.enableImmutableMode) {
10314
- this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[i]);
10329
+ this.refreshedTr.push(dupChartBody.querySelectorAll('tr')[i]);
10315
10330
  this.refreshedData.push(this.parent.currentViewData[i]);
10316
10331
  }
10317
10332
  // To maintain selection when virtualization is enabled
@@ -10319,6 +10334,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10319
10334
  this.parent.selectionModule.maintainSelectedRecords(parseInt(tRow.getAttribute('aria-rowindex'), 10));
10320
10335
  }
10321
10336
  }
10337
+ (_a = this.ganttChartTableBody).replaceChildren.apply(_a, dupChartBody.childNodes);
10322
10338
  }
10323
10339
  this.parent.renderTemplates();
10324
10340
  this.triggerQueryTaskbarInfo();
@@ -10376,9 +10392,15 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10376
10392
  taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
10377
10393
  }
10378
10394
  }
10379
- if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
10395
+ if ((this.templateData.ganttProperties.autoDuration !== 0) && !this.templateData.ganttProperties.isMilestone && parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
10380
10396
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
10381
10397
  }
10398
+ else if ((this.templateData.ganttProperties.duration === 0 && this.templateData.ganttProperties.isMilestone && this.templateData.ganttProperties.isAutoSchedule)) {
10399
+ var milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
10400
+ if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
10401
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
10402
+ }
10403
+ }
10382
10404
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
10383
10405
  this.templateData.ganttProperties.baselineEndDate) {
10384
10406
  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()))
@@ -15548,7 +15570,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15548
15570
  args: [this]
15549
15571
  });
15550
15572
  }
15551
- if (this.toolbar) {
15573
+ if (this.toolbar && this.toolbar.length > 0) {
15552
15574
  modules.push({
15553
15575
  member: 'toolbar',
15554
15576
  args: [this]
@@ -19825,7 +19847,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19825
19847
  : ganttRecord.left;
19826
19848
  var tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.bottomTier :
19827
19849
  this.parent.timelineModule.topTier;
19828
- var remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left), 1, 'Day') / (1000 * 60 * 60 * 24)));
19850
+ var remainingContribution = (1 / (this.parent.timelineModule.getIncrement(this.getDateByLeft(left, isNullOrUndefined(ganttRecord) ? ganttRecord.isMilestone : null, ganttRecord), 1, 'Day') / (1000 * 60 * 60 * 24)));
19829
19851
  var remainDays = this.parent.perDayWidth - (this.parent.perDayWidth / remainingContribution);
19830
19852
  var remainDaysInDecimal = remainDays / this.parent.perDayWidth;
19831
19853
  if (isRoundOff === undefined) {
@@ -19873,7 +19895,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19873
19895
  var milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
19874
19896
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
19875
19897
  /* To render the milestone in proper date while editing */
19876
- if (isMilestone) {
19898
+ if (isMilestone && !isNullOrUndefined(property.predecessor) && property.predecessor.length > 0) {
19877
19899
  pStartDate.setDate(pStartDate.getDate() - 1);
19878
19900
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
19879
19901
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
@@ -22926,7 +22948,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22926
22948
  var ganttObj = this.parent;
22927
22949
  var rte = notesElement.ej2_instances[0];
22928
22950
  if (this.isEdit) {
22929
- if (ganttObj.columnByField[ganttObj.taskFields.notes].disableHtmlEncode) {
22951
+ if (ganttObj.columnByField[ganttObj.taskFields.notes].disableHtmlEncode === false) {
22930
22952
  this.parent.setRecordValue('notes', rte.getHtml(), this.rowData.ganttProperties, true);
22931
22953
  }
22932
22954
  else {
@@ -24371,7 +24393,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24371
24393
  }
24372
24394
  else if ([tasks.progress, tasks.notes, tasks.durationUnit, tasks.expandState,
24373
24395
  tasks.milestone, tasks.name, tasks.baselineStartDate,
24374
- tasks.baselineEndDate, tasks.id, tasks.segments].indexOf(key) !== -1) {
24396
+ tasks.baselineEndDate, tasks.id, tasks.segments, tasks.cssClass].indexOf(key) !== -1) {
24375
24397
  var column = ganttObj.columnByField[key];
24376
24398
  /* eslint-disable-next-line */
24377
24399
  var value = data[key];
@@ -24385,6 +24407,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24385
24407
  else if (key === tasks.name) {
24386
24408
  ganttPropKey = 'taskName';
24387
24409
  }
24410
+ else if (key === tasks.cssClass) {
24411
+ ganttPropKey = 'cssClass';
24412
+ }
24388
24413
  else if ((key === tasks.segments) && (!isNullOrUndefined(ganttData.ganttProperties.segments))) {
24389
24414
  ganttPropKey = 'segments';
24390
24415
  /* eslint-disable-next-line */
@@ -24776,7 +24801,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24776
24801
  this.parent.predecessorModule.isValidatedParentTaskID = '';
24777
24802
  }
24778
24803
  if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
24779
- (args.action === "DrawConnectorLine")) {
24804
+ (args.action === "DrawConnectorLine") || (args.action === "DialogEditing")) {
24780
24805
  this.updateChildItems(ganttRecord);
24781
24806
  }
24782
24807
  this.updateParentItemOnEditing();