@syncfusion/ej2-gantt 21.2.9 → 21.2.10

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.
@@ -1565,7 +1565,15 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
1565
1565
  var segment = segments[i];
1566
1566
  var sDate = segment.startDate;
1567
1567
  var eDate = segment.endDate;
1568
- duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24));
1568
+ if (this.parent.timelineModule.bottomTier === "Hour") {
1569
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60));
1570
+ }
1571
+ else if (this.parent.timelineModule.bottomTier === "Minutes") {
1572
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60));
1573
+ }
1574
+ else {
1575
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24));
1576
+ }
1569
1577
  }
1570
1578
  return duration;
1571
1579
  };
@@ -2988,7 +2996,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2988
2996
  var data_1 = [];
2989
2997
  var _loop_4 = function (k) {
2990
2998
  resourceData.filter(function (resourceInfo) {
2991
- if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id]) {
2999
+ if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id] && data_1.indexOf(preTaskResources[k]) === -1) {
2992
3000
  data_1.push(preTaskResources[k]);
2993
3001
  }
2994
3002
  });
@@ -3273,7 +3281,9 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3273
3281
  if (resourceUnit !== 100) {
3274
3282
  resName += '[' + resourceUnit + '%' + ']';
3275
3283
  }
3276
- resourceName.push(resName);
3284
+ if (!isNullOrUndefined(resName)) {
3285
+ resourceName.push(resName);
3286
+ }
3277
3287
  if (data.taskData) {
3278
3288
  var mapping = taskMapping.resourceInfo;
3279
3289
  // eslint-disable-next-line
@@ -3774,7 +3784,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3774
3784
  if (!isNullOrUndefined(ganttRecord.segments) && ganttRecord.segments.length > 0) {
3775
3785
  var segments = ganttRecord.segments;
3776
3786
  var fixedWidth = true;
3777
- var totalTaskWidth = this.splitTasksDuration(segments) * this.parent.perDayWidth;
3787
+ var totalTaskWidth = this.splitTasksDuration(segments) * ((this.parent.timelineModule.bottomTier === "Hour" || this.parent.timelineModule.bottomTier === "Minutes") ? this.parent.timelineSettings.timelineUnitSize : this.parent.perDayWidth);
3778
3788
  var totalProgressWidth = this.parent.dataOperation.getProgressWidth(totalTaskWidth, ganttRecord.progress);
3779
3789
  for (var i = 0; i < segments.length; i++) {
3780
3790
  var segment = segments[i];
@@ -3822,6 +3832,8 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3822
3832
  var ganttRecord = data.ganttProperties;
3823
3833
  this.parent.setRecordValue('autoWidth', this.calculateWidth(data, true), ganttRecord, true);
3824
3834
  this.parent.setRecordValue('autoLeft', this.calculateLeft(ganttRecord, true), ganttRecord, true);
3835
+ this.parent.setRecordValue('progressWidth', this.parent.dataOperation.getProgressWidth((ganttRecord.isAutoSchedule ||
3836
+ !data.hasChildRecords ? ganttRecord.width : ganttRecord.autoWidth), ganttRecord.progress), ganttRecord, true);
3825
3837
  };
3826
3838
  /**
3827
3839
  * To calculate parent progress value
@@ -26788,6 +26800,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26788
26800
  this.parent.treeGrid.parentData = [];
26789
26801
  this.parent.addDeleteRecord = true;
26790
26802
  this.parent.selectedRowIndex = 0;
26803
+ this.parent.treeGrid['isAddedFromGantt'] = true;
26791
26804
  this.parent.treeGrid.refresh();
26792
26805
  if (this.parent.enableImmutableMode) {
26793
26806
  this.parent.modifiedRecords = args.modifiedRecords;