@syncfusion/ej2-gantt 21.1.37 → 21.1.38

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.
@@ -2982,17 +2982,15 @@ class TaskProcessor extends DateProcessor {
2982
2982
  else {
2983
2983
  hierarchicalData = this.parent.dataSource;
2984
2984
  }
2985
- this.parent.flatData.map((data) => {
2986
- hierarchicalData.map((record) => {
2987
- if (data.ganttProperties.taskId === record[this.parent.taskFields.id]) {
2988
- if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
2989
- task[this.parent.taskFields.endDate] = record[this.parent.taskFields.endDate];
2990
- }
2991
- if (!isNullOrUndefined(this.parent.taskFields.endDate)) {
2992
- task[this.parent.taskFields.endDate] = record[this.parent.taskFields.endDate];
2993
- }
2985
+ hierarchicalData.map((record) => {
2986
+ if (task.ganttProperties.taskId === record[this.parent.taskFields.id]) {
2987
+ if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
2988
+ task[this.parent.taskFields.startDate] = record[this.parent.taskFields.startDate];
2994
2989
  }
2995
- });
2990
+ if (!isNullOrUndefined(this.parent.taskFields.endDate)) {
2991
+ task[this.parent.taskFields.endDate] = record[this.parent.taskFields.endDate];
2992
+ }
2993
+ }
2996
2994
  });
2997
2995
  }
2998
2996
  getWorkInHour(work, workUnit) {
@@ -3743,12 +3741,7 @@ class TaskProcessor extends DateProcessor {
3743
3741
  durationInDay = (childGanttRecord.ganttProperties.duration / (this.parent.secondsPerDay / 60));
3744
3742
  break;
3745
3743
  default:
3746
- if (childGanttRecord.ganttProperties.duration < 1) {
3747
- durationInDay = (childGanttRecord.ganttProperties.duration / (this.parent.secondsPerDay / 3600));
3748
- }
3749
- else {
3750
- durationInDay = childGanttRecord.ganttProperties.duration;
3751
- }
3744
+ durationInDay = childGanttRecord.ganttProperties.duration;
3752
3745
  }
3753
3746
  if (childGanttRecord.hasChildRecords) {
3754
3747
  setValue('totalProgress', childGanttRecord.ganttProperties.totalProgress, progressValues);
@@ -3847,7 +3840,7 @@ class TaskProcessor extends DateProcessor {
3847
3840
  else {
3848
3841
  taskCount = childLength - milestoneCount;
3849
3842
  }
3850
- const parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
3843
+ const parentProgress = (taskCount > 0 && totalDuration > 0) ? Number((totalProgress / totalDuration).toFixed(2)) : 0;
3851
3844
  const parentProp = parentData.ganttProperties;
3852
3845
  const milestone = (taskCount === 0) && minStartDate && maxEndDate &&
3853
3846
  minStartDate.getTime() === maxEndDate.getTime() ? true : false;
@@ -5793,7 +5786,10 @@ class Timeline {
5793
5786
  * @private
5794
5787
  */
5795
5788
  changeTimelineSettings(newTimeline) {
5796
- if (!this.isZoomIn) {
5789
+ if (this.isZoomToFit) {
5790
+ this.isSingleTier = this.customTimelineSettings.topTier.unit === 'None' || this.customTimelineSettings.bottomTier.unit === 'None' ? true : false;
5791
+ }
5792
+ else if (!this.isZoomIn) {
5797
5793
  this.isSingleTier = newTimeline.topTier.unit === 'None' || newTimeline.bottomTier.unit === 'None' ? true : false;
5798
5794
  }
5799
5795
  const skipProperty = this.isSingleTier ?
@@ -10464,7 +10460,9 @@ class ChartRows extends DateProcessor {
10464
10460
  this.parent.ganttChartModule.tempNextElement = null;
10465
10461
  }
10466
10462
  const row = this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[index].getAttribute('data-uid'));
10467
- row.data = data;
10463
+ if (!isNullOrUndefined(row)) {
10464
+ row.data = data;
10465
+ }
10468
10466
  }
10469
10467
  }
10470
10468
  getResourceParent(record) {
@@ -13216,6 +13214,7 @@ class FocusModule {
13216
13214
  if (ganttObj.selectedRowIndex === ganttObj.flatData.indexOf(currentSelectingRecord)) {
13217
13215
  return;
13218
13216
  }
13217
+ ganttObj.selectionModule.selectRow(ganttObj.flatData.indexOf(currentSelectingRecord), false, true);
13219
13218
  }
13220
13219
  break;
13221
13220
  case 'downArrow':
@@ -13633,7 +13632,9 @@ let Gantt = class Gantt extends Component {
13633
13632
  contextMenu: 'shift+F10' //F Key
13634
13633
  };
13635
13634
  this.focusModule = new FocusModule(this);
13636
- this.zoomingLevels = this.getZoomingLevels();
13635
+ if (this.zoomingLevels.length === 0) {
13636
+ this.zoomingLevels = this.getZoomingLevels();
13637
+ }
13637
13638
  this.resourceFieldsMapping();
13638
13639
  if (isNullOrUndefined(this.resourceFields.unit)) { //set resourceUnit as unit if not mapping
13639
13640
  this.resourceFields.unit = 'unit';
@@ -14837,6 +14838,14 @@ let Gantt = class Gantt extends Component {
14837
14838
  this.chartRowsModule.refreshGanttRows();
14838
14839
  this.isLoad = false;
14839
14840
  break;
14841
+ case 'dayWorkingTime':
14842
+ this.isLoad = true;
14843
+ this.dataOperation.reUpdateGanttData();
14844
+ this.treeGrid.refreshColumns();
14845
+ this.chartRowsModule.initiateTemplates();
14846
+ this.chartRowsModule.refreshGanttRows();
14847
+ this.isLoad = false;
14848
+ break;
14840
14849
  case 'addDialogFields':
14841
14850
  case 'editDialogFields':
14842
14851
  if (this.editModule && this.editModule.dialogModule) {
@@ -14916,7 +14925,6 @@ let Gantt = class Gantt extends Component {
14916
14925
  case 'readOnly':
14917
14926
  case 'viewType':
14918
14927
  case 'taskFields':
14919
- case 'dayWorkingTime':
14920
14928
  case 'allowTaskbarDragAndDrop':
14921
14929
  case 'allowTaskbarOverlap':
14922
14930
  case 'allowParentDependency':
@@ -16903,6 +16911,9 @@ __decorate([
16903
16911
  __decorate([
16904
16912
  Complex({}, TimelineSettings)
16905
16913
  ], Gantt.prototype, "timelineSettings", void 0);
16914
+ __decorate([
16915
+ Property([])
16916
+ ], Gantt.prototype, "zoomingLevels", void 0);
16906
16917
  __decorate([
16907
16918
  Complex({}, SortSettings)
16908
16919
  ], Gantt.prototype, "sortSettings", void 0);
@@ -29136,6 +29147,7 @@ class DayMarkers {
29136
29147
  }
29137
29148
  }
29138
29149
 
29150
+ /** @hidden */
29139
29151
  class CriticalPath {
29140
29152
  constructor(parent) {
29141
29153
  this.resourceCollectionIds = [];
@@ -30740,6 +30752,7 @@ class ExcelExport$1 {
30740
30752
 
30741
30753
  /**
30742
30754
  * Configures columnMenu collection in Gantt.
30755
+ * @hidden
30743
30756
  */
30744
30757
  class ColumnMenu$1 {
30745
30758
  constructor(parent) {
@@ -31985,6 +31998,7 @@ class TemporaryDictionary {
31985
31998
  */
31986
31999
  /**
31987
32000
  * `PdfBorders` class used represents the cell border of the PDF grid.
32001
+ * @hidden
31988
32002
  */
31989
32003
  class PdfBorders {
31990
32004
  // Properties
@@ -32084,6 +32098,7 @@ class PdfBorders {
32084
32098
  this.bottomPen = defaultBorderPenBottom;
32085
32099
  }
32086
32100
  }
32101
+ /** @hidden */
32087
32102
  class PdfPaddings {
32088
32103
  constructor(left, right, top, bottom) {
32089
32104
  /**
@@ -32954,9 +32969,7 @@ class PdfTreeGrid extends PdfLayoutElement {
32954
32969
  }
32955
32970
  }
32956
32971
 
32957
- /**
32958
- *
32959
- */
32972
+ /**@hidden*/
32960
32973
  class PdfTreeGridCell {
32961
32974
  constructor(row) {
32962
32975
  this.cellWidth = 0;