@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.
@@ -3026,17 +3026,15 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3026
3026
  else {
3027
3027
  hierarchicalData = this.parent.dataSource;
3028
3028
  }
3029
- this.parent.flatData.map(function (data) {
3030
- hierarchicalData.map(function (record) {
3031
- if (data.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
3032
- if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
3033
- task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
3034
- }
3035
- if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
3036
- task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
3037
- }
3029
+ hierarchicalData.map(function (record) {
3030
+ if (task.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
3031
+ if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
3032
+ task[_this.parent.taskFields.startDate] = record[_this.parent.taskFields.startDate];
3038
3033
  }
3039
- });
3034
+ if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
3035
+ task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
3036
+ }
3037
+ }
3040
3038
  });
3041
3039
  };
3042
3040
  TaskProcessor.prototype.getWorkInHour = function (work, workUnit) {
@@ -3790,12 +3788,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3790
3788
  durationInDay = (childGanttRecord.ganttProperties.duration / (this.parent.secondsPerDay / 60));
3791
3789
  break;
3792
3790
  default:
3793
- if (childGanttRecord.ganttProperties.duration < 1) {
3794
- durationInDay = (childGanttRecord.ganttProperties.duration / (this.parent.secondsPerDay / 3600));
3795
- }
3796
- else {
3797
- durationInDay = childGanttRecord.ganttProperties.duration;
3798
- }
3791
+ durationInDay = childGanttRecord.ganttProperties.duration;
3799
3792
  }
3800
3793
  if (childGanttRecord.hasChildRecords) {
3801
3794
  setValue('totalProgress', childGanttRecord.ganttProperties.totalProgress, progressValues);
@@ -3894,7 +3887,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3894
3887
  else {
3895
3888
  taskCount = childLength - milestoneCount;
3896
3889
  }
3897
- var parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
3890
+ var parentProgress = (taskCount > 0 && totalDuration > 0) ? Number((totalProgress / totalDuration).toFixed(2)) : 0;
3898
3891
  var parentProp = parentData.ganttProperties;
3899
3892
  var milestone = (taskCount === 0) && minStartDate && maxEndDate &&
3900
3893
  minStartDate.getTime() === maxEndDate.getTime() ? true : false;
@@ -5854,7 +5847,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
5854
5847
  */
5855
5848
  Timeline.prototype.changeTimelineSettings = function (newTimeline) {
5856
5849
  var _this = this;
5857
- if (!this.isZoomIn) {
5850
+ if (this.isZoomToFit) {
5851
+ this.isSingleTier = this.customTimelineSettings.topTier.unit === 'None' || this.customTimelineSettings.bottomTier.unit === 'None' ? true : false;
5852
+ }
5853
+ else if (!this.isZoomIn) {
5858
5854
  this.isSingleTier = newTimeline.topTier.unit === 'None' || newTimeline.bottomTier.unit === 'None' ? true : false;
5859
5855
  }
5860
5856
  var skipProperty = this.isSingleTier ?
@@ -10871,7 +10867,9 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10871
10867
  this.parent.ganttChartModule.tempNextElement = null;
10872
10868
  }
10873
10869
  var row = this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[index].getAttribute('data-uid'));
10874
- row.data = data;
10870
+ if (!isNullOrUndefined(row)) {
10871
+ row.data = data;
10872
+ }
10875
10873
  }
10876
10874
  };
10877
10875
  ChartRows.prototype.getResourceParent = function (record) {
@@ -13632,6 +13630,7 @@ var FocusModule = /** @__PURE__ @class */ (function () {
13632
13630
  if (ganttObj.selectedRowIndex === ganttObj.flatData.indexOf(currentSelectingRecord)) {
13633
13631
  return;
13634
13632
  }
13633
+ ganttObj.selectionModule.selectRow(ganttObj.flatData.indexOf(currentSelectingRecord), false, true);
13635
13634
  }
13636
13635
  break;
13637
13636
  case 'downArrow':
@@ -14065,7 +14064,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14065
14064
  contextMenu: 'shift+F10' //F Key
14066
14065
  };
14067
14066
  this.focusModule = new FocusModule(this);
14068
- this.zoomingLevels = this.getZoomingLevels();
14067
+ if (this.zoomingLevels.length === 0) {
14068
+ this.zoomingLevels = this.getZoomingLevels();
14069
+ }
14069
14070
  this.resourceFieldsMapping();
14070
14071
  if (isNullOrUndefined(this.resourceFields.unit)) { //set resourceUnit as unit if not mapping
14071
14072
  this.resourceFields.unit = 'unit';
@@ -15272,6 +15273,14 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15272
15273
  this.chartRowsModule.refreshGanttRows();
15273
15274
  this.isLoad = false;
15274
15275
  break;
15276
+ case 'dayWorkingTime':
15277
+ this.isLoad = true;
15278
+ this.dataOperation.reUpdateGanttData();
15279
+ this.treeGrid.refreshColumns();
15280
+ this.chartRowsModule.initiateTemplates();
15281
+ this.chartRowsModule.refreshGanttRows();
15282
+ this.isLoad = false;
15283
+ break;
15275
15284
  case 'addDialogFields':
15276
15285
  case 'editDialogFields':
15277
15286
  if (this.editModule && this.editModule.dialogModule) {
@@ -15351,7 +15360,6 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15351
15360
  case 'readOnly':
15352
15361
  case 'viewType':
15353
15362
  case 'taskFields':
15354
- case 'dayWorkingTime':
15355
15363
  case 'allowTaskbarDragAndDrop':
15356
15364
  case 'allowTaskbarOverlap':
15357
15365
  case 'allowParentDependency':
@@ -17338,6 +17346,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
17338
17346
  __decorate([
17339
17347
  Complex({}, TimelineSettings)
17340
17348
  ], Gantt.prototype, "timelineSettings", void 0);
17349
+ __decorate([
17350
+ Property([])
17351
+ ], Gantt.prototype, "zoomingLevels", void 0);
17341
17352
  __decorate([
17342
17353
  Complex({}, SortSettings)
17343
17354
  ], Gantt.prototype, "sortSettings", void 0);
@@ -29701,6 +29712,7 @@ var DayMarkers = /** @__PURE__ @class */ (function () {
29701
29712
  return DayMarkers;
29702
29713
  }());
29703
29714
 
29715
+ /** @hidden */
29704
29716
  var CriticalPath = /** @__PURE__ @class */ (function () {
29705
29717
  function CriticalPath(parent) {
29706
29718
  this.resourceCollectionIds = [];
@@ -31324,6 +31336,7 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
31324
31336
 
31325
31337
  /**
31326
31338
  * Configures columnMenu collection in Gantt.
31339
+ * @hidden
31327
31340
  */
31328
31341
  var ColumnMenu$1 = /** @__PURE__ @class */ (function () {
31329
31342
  function ColumnMenu$$1(parent) {
@@ -32600,6 +32613,7 @@ var TemporaryDictionary = /** @__PURE__ @class */ (function () {
32600
32613
  */
32601
32614
  /**
32602
32615
  * `PdfBorders` class used represents the cell border of the PDF grid.
32616
+ * @hidden
32603
32617
  */
32604
32618
  var PdfBorders = /** @__PURE__ @class */ (function () {
32605
32619
  // Constructor
@@ -32728,6 +32742,7 @@ var PdfBorders = /** @__PURE__ @class */ (function () {
32728
32742
  });
32729
32743
  return PdfBorders;
32730
32744
  }());
32745
+ /** @hidden */
32731
32746
  var PdfPaddings = /** @__PURE__ @class */ (function () {
32732
32747
  function PdfPaddings(left, right, top, bottom) {
32733
32748
  /**
@@ -33677,9 +33692,7 @@ var PdfTreeGrid = /** @__PURE__ @class */ (function (_super) {
33677
33692
  return PdfTreeGrid;
33678
33693
  }(PdfLayoutElement));
33679
33694
 
33680
- /**
33681
- *
33682
- */
33695
+ /**@hidden*/
33683
33696
  var PdfTreeGridCell = /** @__PURE__ @class */ (function () {
33684
33697
  function PdfTreeGridCell(row) {
33685
33698
  this.cellWidth = 0;