@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.
@@ -1557,7 +1557,15 @@ class DateProcessor {
1557
1557
  const segment = segments[i];
1558
1558
  const sDate = segment.startDate;
1559
1559
  const eDate = segment.endDate;
1560
- duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24));
1560
+ if (this.parent.timelineModule.bottomTier === "Hour") {
1561
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60));
1562
+ }
1563
+ else if (this.parent.timelineModule.bottomTier === "Minutes") {
1564
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60));
1565
+ }
1566
+ else {
1567
+ duration += Math.ceil(this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24));
1568
+ }
1561
1569
  }
1562
1570
  return duration;
1563
1571
  }
@@ -2948,7 +2956,7 @@ class TaskProcessor extends DateProcessor {
2948
2956
  const data = [];
2949
2957
  for (let k = 0; k < preTaskResources.length; k++) {
2950
2958
  resourceData.filter((resourceInfo) => {
2951
- if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id]) {
2959
+ if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id] && data.indexOf(preTaskResources[k]) === -1) {
2952
2960
  data.push(preTaskResources[k]);
2953
2961
  }
2954
2962
  });
@@ -3226,7 +3234,9 @@ class TaskProcessor extends DateProcessor {
3226
3234
  if (resourceUnit !== 100) {
3227
3235
  resName += '[' + resourceUnit + '%' + ']';
3228
3236
  }
3229
- resourceName.push(resName);
3237
+ if (!isNullOrUndefined(resName)) {
3238
+ resourceName.push(resName);
3239
+ }
3230
3240
  if (data.taskData) {
3231
3241
  const mapping = taskMapping.resourceInfo;
3232
3242
  // eslint-disable-next-line
@@ -3727,7 +3737,7 @@ class TaskProcessor extends DateProcessor {
3727
3737
  if (!isNullOrUndefined(ganttRecord.segments) && ganttRecord.segments.length > 0) {
3728
3738
  const segments = ganttRecord.segments;
3729
3739
  let fixedWidth = true;
3730
- const totalTaskWidth = this.splitTasksDuration(segments) * this.parent.perDayWidth;
3740
+ const totalTaskWidth = this.splitTasksDuration(segments) * ((this.parent.timelineModule.bottomTier === "Hour" || this.parent.timelineModule.bottomTier === "Minutes") ? this.parent.timelineSettings.timelineUnitSize : this.parent.perDayWidth);
3731
3741
  let totalProgressWidth = this.parent.dataOperation.getProgressWidth(totalTaskWidth, ganttRecord.progress);
3732
3742
  for (let i = 0; i < segments.length; i++) {
3733
3743
  const segment = segments[i];
@@ -3775,6 +3785,8 @@ class TaskProcessor extends DateProcessor {
3775
3785
  const ganttRecord = data.ganttProperties;
3776
3786
  this.parent.setRecordValue('autoWidth', this.calculateWidth(data, true), ganttRecord, true);
3777
3787
  this.parent.setRecordValue('autoLeft', this.calculateLeft(ganttRecord, true), ganttRecord, true);
3788
+ this.parent.setRecordValue('progressWidth', this.parent.dataOperation.getProgressWidth((ganttRecord.isAutoSchedule ||
3789
+ !data.hasChildRecords ? ganttRecord.width : ganttRecord.autoWidth), ganttRecord.progress), ganttRecord, true);
3778
3790
  }
3779
3791
  /**
3780
3792
  * To calculate parent progress value
@@ -26254,6 +26266,7 @@ class Edit$2 {
26254
26266
  this.parent.treeGrid.parentData = [];
26255
26267
  this.parent.addDeleteRecord = true;
26256
26268
  this.parent.selectedRowIndex = 0;
26269
+ this.parent.treeGrid['isAddedFromGantt'] = true;
26257
26270
  this.parent.treeGrid.refresh();
26258
26271
  if (this.parent.enableImmutableMode) {
26259
26272
  this.parent.modifiedRecords = args.modifiedRecords;