@syncfusion/ej2-gantt 20.4.51 → 20.4.53

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.
@@ -632,7 +632,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
632
632
  * @returns {Date} .
633
633
  * @private
634
634
  */
635
- DateProcessor.prototype.getStartDate = function (endDate, duration, durationUnit, ganttProp) {
635
+ DateProcessor.prototype.getStartDate = function (endDate, duration, durationUnit, ganttProp, fromValidation) {
636
636
  var tempEnd = new Date(endDate.getTime());
637
637
  var startDate = new Date(endDate.getTime());
638
638
  var secondDuration = this.getDurationAsSeconds(duration, durationUnit);
@@ -648,6 +648,12 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
648
648
  }
649
649
  tempEnd = new Date(startDate.getTime());
650
650
  }
651
+ /* To render the milestone in proper date while loading */
652
+ if (fromValidation && ganttProp.isMilestone) {
653
+ startDate.setDate(startDate.getDate() - 1);
654
+ this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, startDate);
655
+ startDate = this.parent.dateValidationModule.checkStartDate(startDate, ganttProp, true);
656
+ }
651
657
  return startDate;
652
658
  };
653
659
  /**
@@ -699,6 +705,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
699
705
  * @private
700
706
  */
701
707
  DateProcessor.prototype.getValidStartDate = function (ganttProp, isAuto) {
708
+ var _this = this;
702
709
  var sDate = null;
703
710
  var startDate = isAuto ? ganttProp.autoStartDate : ganttProp.startDate;
704
711
  var endDate = isAuto ? ganttProp.autoEndDate : ganttProp.endDate;
@@ -709,7 +716,21 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
709
716
  this.setTime(this.parent.defaultStartTime, sDate);
710
717
  }
711
718
  else if (!isNullOrUndefined(duration)) {
712
- sDate = this.getProjectStartDate(ganttProp);
719
+ this.parent.flatData.map(function (record) {
720
+ if (record.ganttProperties.taskId == ganttProp.taskId) {
721
+ if ((!isNullOrUndefined(record.parentItem)) && (record.parentItem.taskId)) {
722
+ _this.parent.flatData.map(function (data) {
723
+ if (data.ganttProperties.taskId === record.parentItem.taskId) {
724
+ if (!isNullOrUndefined(data.ganttProperties.startDate))
725
+ sDate = data.ganttProperties.startDate;
726
+ }
727
+ });
728
+ }
729
+ else {
730
+ sDate = _this.getProjectStartDate(ganttProp);
731
+ }
732
+ }
733
+ });
713
734
  }
714
735
  }
715
736
  else {
@@ -2942,6 +2963,40 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2942
2963
  task.taskData[this.parent.taskFields.durationUnit] = task.ganttProperties.durationUnit;
2943
2964
  }
2944
2965
  };
2966
+ TaskProcessor.prototype.setDataSource = function (data) {
2967
+ var createData = [];
2968
+ var length = data.length;
2969
+ for (var i = 0; i < length; i++) {
2970
+ var record = data[i];
2971
+ createData.push(record);
2972
+ if (!(isNullOrUndefined(data[i][this.parent.taskFields.child]))) {
2973
+ this.setDataSource(data[i][this.parent.taskFields.child]);
2974
+ }
2975
+ }
2976
+ return createData;
2977
+ };
2978
+ TaskProcessor.prototype.setStartDate = function (task) {
2979
+ var _this = this;
2980
+ var hierarchicalData = [];
2981
+ if (!isNullOrUndefined(this.parent.taskFields.parentID) && !isNullOrUndefined(this.parent.taskFields.id)) {
2982
+ hierarchicalData = this.setDataSource(this.parent.dataSource);
2983
+ }
2984
+ else {
2985
+ hierarchicalData = this.parent.dataSource;
2986
+ }
2987
+ this.parent.flatData.map(function (data) {
2988
+ hierarchicalData.map(function (record) {
2989
+ if (data.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
2990
+ if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
2991
+ task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
2992
+ }
2993
+ if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
2994
+ task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
2995
+ }
2996
+ }
2997
+ });
2998
+ });
2999
+ };
2945
3000
  TaskProcessor.prototype.getWorkInHour = function (work, workUnit) {
2946
3001
  if (workUnit === 'day') {
2947
3002
  return work * (this.parent.secondsPerDay / 3600);
@@ -3236,6 +3291,9 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3236
3291
  if (!isNullOrUndefined(this.parent.taskFields.duration)) {
3237
3292
  this.setRecordDuration(ganttData, this.parent.taskFields.duration);
3238
3293
  }
3294
+ if (this.parent.isLoad) {
3295
+ this.setStartDate(ganttData);
3296
+ }
3239
3297
  this.calculateScheduledValues(ganttData, data, false);
3240
3298
  }
3241
3299
  this.updateGanttData();
@@ -5708,6 +5766,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5708
5766
  */
5709
5767
  Timeline.prototype.changeTimelineSettings = function (newTimeline) {
5710
5768
  var _this = this;
5769
+ if (!this.isZoomIn) {
5770
+ this.isSingleTier = newTimeline.topTier.unit === 'None' || newTimeline.bottomTier.unit === 'None' ? true : false;
5771
+ }
5711
5772
  var skipProperty = this.isSingleTier ?
5712
5773
  this.customTimelineSettings.topTier.unit === 'None' ?
5713
5774
  'topTier' : 'bottomTier' : null;
@@ -5719,7 +5780,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5719
5780
  else {
5720
5781
  var value = property === 'topTier' ? 'bottomTier' : 'topTier';
5721
5782
  var assignValue = 'bottomTier';
5722
- _this.customTimelineSettings[value] = __assign({}, newTimeline[assignValue]);
5783
+ if (newTimeline[assignValue].unit != "None") {
5784
+ _this.customTimelineSettings[value] = __assign({}, newTimeline[assignValue]);
5785
+ }
5723
5786
  }
5724
5787
  });
5725
5788
  this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
@@ -5955,7 +6018,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5955
6018
  this.customTimelineSettings.bottomTier.count : this.customTimelineSettings.topTier.count;
5956
6019
  var unit = this.customTimelineSettings.bottomTier.unit !== 'None' ?
5957
6020
  this.customTimelineSettings.bottomTier.unit : this.customTimelineSettings.topTier.unit;
5958
- var zoomLevel = this.getCurrentZoomingLevel(unit, count);
6021
+ var tier = this.customTimelineSettings.bottomTier.unit !== 'None' ?
6022
+ "bottomTier" : "topTier";
6023
+ var zoomLevel = this.getCurrentZoomingLevel(unit, count, tier);
5959
6024
  if (this.parent.toolbarModule) {
5960
6025
  if (zoomLevel === this.parent.zoomingLevels[this.parent.zoomingLevels.length - 1].level) {
5961
6026
  this.parent.toolbarModule.enableItems([this.parent.controlId + '_zoomin'], false);
@@ -5973,7 +6038,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
5973
6038
  * @returns {number} .
5974
6039
  * @private
5975
6040
  */
5976
- Timeline.prototype.getCurrentZoomingLevel = function (unit, count) {
6041
+ Timeline.prototype.getCurrentZoomingLevel = function (unit, count, tier) {
5977
6042
  var level;
5978
6043
  var currentZoomCollection;
5979
6044
  var checkSameCountLevels;
@@ -5983,16 +6048,31 @@ var Timeline = /** @__PURE__ @class */ (function () {
5983
6048
  this.parent.zoomingLevels = this.parent.getZoomingLevels();
5984
6049
  }
5985
6050
  var sameUnitLevels = this.parent.zoomingLevels.filter(function (tempLevel) {
5986
- return tempLevel.bottomTier.unit === unit;
6051
+ if (tier === "bottomTier") {
6052
+ return tempLevel.bottomTier.unit === unit;
6053
+ }
6054
+ else {
6055
+ return tempLevel.topTier.unit === unit;
6056
+ }
5987
6057
  });
5988
6058
  if (sameUnitLevels.length === 0) {
5989
6059
  var closestUnit_1 = this.getClosestUnit(unit, '', false);
5990
6060
  sameUnitLevels = this.parent.zoomingLevels.filter(function (tempLevel) {
5991
- return tempLevel.bottomTier.unit === closestUnit_1;
6061
+ if (tier === "bottomTier") {
6062
+ return tempLevel.bottomTier.unit === closestUnit_1;
6063
+ }
6064
+ else {
6065
+ return tempLevel.topTier.unit === closestUnit_1;
6066
+ }
5992
6067
  });
5993
6068
  }
5994
6069
  var sortedUnitLevels = sameUnitLevels.sort(function (a, b) {
5995
- return (a.bottomTier.count < b.bottomTier.count) ? 1 : -1;
6070
+ if (tier === "bottomTier") {
6071
+ return (a.bottomTier.count < b.bottomTier.count) ? 1 : -1;
6072
+ }
6073
+ else {
6074
+ return (a.topTier.count < b.topTier.count) ? 1 : -1;
6075
+ }
5996
6076
  });
5997
6077
  for (var i = 0; i < sortedUnitLevels.length; i++) {
5998
6078
  firstValue = sortedUnitLevels[i];
@@ -6003,10 +6083,15 @@ var Timeline = /** @__PURE__ @class */ (function () {
6003
6083
  else {
6004
6084
  secondValue = sortedUnitLevels[i + 1];
6005
6085
  }
6006
- if (count >= firstValue.bottomTier.count) {
6086
+ if (count >= firstValue[tier].count) {
6007
6087
  currentZoomCollection = sortedUnitLevels[i];
6008
6088
  checkSameCountLevels = sortedUnitLevels.filter(function (tempLevel) {
6009
- return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
6089
+ if (tier === "bottomTier") {
6090
+ return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
6091
+ }
6092
+ else {
6093
+ return tempLevel.topTier.count === currentZoomCollection.topTier.count;
6094
+ }
6010
6095
  });
6011
6096
  if (checkSameCountLevels.length > 1) {
6012
6097
  level = this.checkCollectionsWidth(checkSameCountLevels);
@@ -6016,10 +6101,15 @@ var Timeline = /** @__PURE__ @class */ (function () {
6016
6101
  }
6017
6102
  break;
6018
6103
  }
6019
- else if (count < firstValue.bottomTier.count && count > secondValue.bottomTier.count) {
6104
+ else if (count < firstValue[tier].count && count > secondValue[tier].count) {
6020
6105
  currentZoomCollection = sortedUnitLevels[i + 1];
6021
6106
  checkSameCountLevels = sortedUnitLevels.filter(function (tempLevel) {
6022
- return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
6107
+ if (tier === "bottomTier") {
6108
+ return tempLevel.bottomTier.count === currentZoomCollection.bottomTier.count;
6109
+ }
6110
+ else {
6111
+ return tempLevel.topTier.count === currentZoomCollection.topTier.count;
6112
+ }
6023
6113
  });
6024
6114
  if (checkSameCountLevels.length > 1) {
6025
6115
  level = this.checkCollectionsWidth(checkSameCountLevels);
@@ -7127,7 +7217,13 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7127
7217
  this.parent.treeGrid.allowKeyboard = this.parent.allowKeyboard;
7128
7218
  this.parent.treeGrid.enableImmutableMode = this.parent.enableImmutableMode;
7129
7219
  this.treeGridColumns = [];
7220
+ if (!this.parent.isLocaleChanged && this.parent.isLoad) {
7221
+ this.parent.previousGanttColumns = extend([], [], this.parent.columns, true);
7222
+ }
7130
7223
  this.validateGanttColumns();
7224
+ if (this.parent.isLocaleChanged) {
7225
+ this.parent.isLocaleChanged = false;
7226
+ }
7131
7227
  this.addEventListener();
7132
7228
  }
7133
7229
  GanttTreeGrid.prototype.addEventListener = function () {
@@ -7549,6 +7645,9 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7549
7645
  */
7550
7646
  GanttTreeGrid.prototype.createTreeGridColumn = function (column, isDefined) {
7551
7647
  var taskSettings = this.parent.taskFields;
7648
+ var previousColumn = this.parent.previousGanttColumns.filter(function (prevcolumn) {
7649
+ return column.field == prevcolumn.field;
7650
+ })[0];
7552
7651
  column.disableHtmlEncode = !isNullOrUndefined(column.disableHtmlEncode) ? column.disableHtmlEncode : this.parent.disableHtmlEncode;
7553
7652
  if (taskSettings.id !== column.field) {
7554
7653
  column.clipMode = column.clipMode ? column.clipMode : 'EllipsisWithTooltip';
@@ -7559,14 +7658,24 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7559
7658
  }
7560
7659
  else if (taskSettings.name === column.field) {
7561
7660
  /** Name column */
7562
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('name');
7661
+ if (this.parent.isLocaleChanged && previousColumn) {
7662
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('name');
7663
+ }
7664
+ else {
7665
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('name');
7666
+ }
7563
7667
  column.width = column.width ? column.width : 150;
7564
7668
  column.editType = column.editType ? column.editType : 'stringedit';
7565
7669
  column.type = column.type ? column.type : 'string';
7566
7670
  }
7567
7671
  else if (taskSettings.startDate === column.field) {
7568
7672
  /** Name column */
7569
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('startDate');
7673
+ if (this.parent.isLocaleChanged && previousColumn) {
7674
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('startDate');
7675
+ }
7676
+ else {
7677
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('startDate');
7678
+ }
7570
7679
  column.editType = column.editType ? column.editType :
7571
7680
  this.parent.getDateFormat().toLowerCase().indexOf('hh') !== -1 ? 'datetimepickeredit' : 'datepickeredit';
7572
7681
  column.format = column.format ? column.format : { type: 'date', format: this.parent.getDateFormat() };
@@ -7574,7 +7683,12 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7574
7683
  column.edit = { params: { renderDayCell: this.parent.renderWorkingDayCell.bind(this.parent) } };
7575
7684
  }
7576
7685
  else if (taskSettings.endDate === column.field) {
7577
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('endDate');
7686
+ if (this.parent.isLocaleChanged && previousColumn) {
7687
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('endDate');
7688
+ }
7689
+ else {
7690
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('endDate');
7691
+ }
7578
7692
  column.format = column.format ? column.format : { type: 'date', format: this.parent.getDateFormat() };
7579
7693
  column.editType = column.editType ? column.editType :
7580
7694
  this.parent.getDateFormat().toLowerCase().indexOf('hh') !== -1 ? 'datetimepickeredit' : 'datepickeredit';
@@ -7583,7 +7697,12 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7583
7697
  }
7584
7698
  else if (taskSettings.duration === column.field) {
7585
7699
  column.width = column.width ? column.width : 150;
7586
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('duration');
7700
+ if (this.parent.isLocaleChanged && previousColumn) {
7701
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('duration');
7702
+ }
7703
+ else {
7704
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('duration');
7705
+ }
7587
7706
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) ? null :
7588
7707
  this.durationValueAccessor.bind(this);
7589
7708
  column.editType = column.editType ? column.editType : 'stringedit';
@@ -7593,7 +7712,12 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7593
7712
  this.composeProgressColumn(column);
7594
7713
  }
7595
7714
  else if (taskSettings.dependency === column.field) {
7596
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('dependency');
7715
+ if (this.parent.isLocaleChanged && previousColumn) {
7716
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('dependency');
7717
+ }
7718
+ else {
7719
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('dependency');
7720
+ }
7597
7721
  column.width = column.width ? column.width : 150;
7598
7722
  column.editType = column.editType ? column.editType : 'stringedit';
7599
7723
  column.type = 'string';
@@ -7603,7 +7727,12 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7603
7727
  this.composeResourceColumn(column);
7604
7728
  }
7605
7729
  else if (taskSettings.notes === column.field) {
7606
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('notes');
7730
+ if (this.parent.isLocaleChanged && previousColumn) {
7731
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('notes');
7732
+ }
7733
+ else {
7734
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('notes');
7735
+ }
7607
7736
  column.width = column.width ? column.width : 150;
7608
7737
  column.editType = column.editType ? column.editType : 'stringedit';
7609
7738
  if (!this.parent.showInlineNotes) {
@@ -7618,26 +7747,46 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7618
7747
  var colName = (taskSettings.baselineEndDate === column.field) ? 'baselineEndDate' :
7619
7748
  'baselineStartDate';
7620
7749
  column.width = column.width ? column.width : 150;
7621
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant(colName);
7750
+ if (this.parent.isLocaleChanged && previousColumn) {
7751
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant(colName);
7752
+ }
7753
+ else {
7754
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant(colName);
7755
+ }
7622
7756
  column.format = column.format ? column.format : { type: 'date', format: this.parent.getDateFormat() };
7623
7757
  column.editType = column.editType ? column.editType :
7624
7758
  this.parent.getDateFormat().toLowerCase().indexOf('hh') !== -1 ? 'datetimepickeredit' : 'datepickeredit';
7625
7759
  }
7626
7760
  else if (taskSettings.work === column.field) {
7627
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('work');
7761
+ if (this.parent.isLocaleChanged && previousColumn) {
7762
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('work');
7763
+ }
7764
+ else {
7765
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('work');
7766
+ }
7628
7767
  column.width = column.width ? column.width : 150;
7629
7768
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : this.workValueAccessor.bind(this);
7630
7769
  column.editType = column.editType ? column.editType : 'numericedit';
7631
7770
  }
7632
7771
  else if (taskSettings.type === column.field) {
7633
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('taskType');
7772
+ if (this.parent.isLocaleChanged && previousColumn) {
7773
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('taskType');
7774
+ }
7775
+ else {
7776
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('taskType');
7777
+ }
7634
7778
  column.width = column.width ? column.width : 150;
7635
7779
  //column.type = 'string';
7636
7780
  column.editType = 'dropdownedit';
7637
7781
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : this.taskTypeValueAccessor.bind(this);
7638
7782
  }
7639
7783
  else if (taskSettings.manual === column.field && this.parent.taskMode === 'Custom') {
7640
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('taskMode');
7784
+ if (this.parent.isLocaleChanged && previousColumn) {
7785
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('taskMode');
7786
+ }
7787
+ else {
7788
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('taskMode');
7789
+ }
7641
7790
  column.width = column.width ? column.width : 120;
7642
7791
  column.editType = column.editType ? column.editType : 'dropdownedit';
7643
7792
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : this.modeValueAccessor.bind(this);
@@ -7661,7 +7810,15 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7661
7810
  * @returns {void} .
7662
7811
  */
7663
7812
  GanttTreeGrid.prototype.composeResourceColumn = function (column) {
7664
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('resourceName');
7813
+ var previousColumn = this.parent.previousGanttColumns.filter(function (prevcolumn) {
7814
+ return column.field == prevcolumn.field;
7815
+ })[0];
7816
+ if (this.parent.isLocaleChanged && previousColumn) {
7817
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('resourceName');
7818
+ }
7819
+ else {
7820
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('resourceName');
7821
+ }
7665
7822
  column.width = column.width ? column.width : 150;
7666
7823
  column.type = 'string';
7667
7824
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : this.resourceValueAccessor.bind(this);
@@ -7696,7 +7853,17 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7696
7853
  var lengthDataSource = this.parent.dataSource['length'];
7697
7854
  var taskIDName;
7698
7855
  column.isPrimaryKey = isProjectView ? true : false;
7699
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('id');
7856
+ if (this.parent.isLocaleChanged) {
7857
+ var previousColumn = this.parent.previousGanttColumns.filter(function (prevcolumn) {
7858
+ return column.field == prevcolumn.field;
7859
+ })[0];
7860
+ if (previousColumn) {
7861
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('id');
7862
+ }
7863
+ }
7864
+ else {
7865
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('id');
7866
+ }
7700
7867
  column.width = column.width ? column.width : 100;
7701
7868
  for (var i = 0; i < lengthDataSource; i++) {
7702
7869
  if (!isNullOrUndefined(this.parent.dataSource[i][this.parent.taskFields.id])) {
@@ -7733,7 +7900,15 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7733
7900
  * @returns {void} .
7734
7901
  */
7735
7902
  GanttTreeGrid.prototype.composeProgressColumn = function (column) {
7736
- column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('progress');
7903
+ var previousColumn = this.parent.previousGanttColumns.filter(function (prevcolumn) {
7904
+ return column.field == prevcolumn.field;
7905
+ })[0];
7906
+ if (this.parent.isLocaleChanged && previousColumn) {
7907
+ column.headerText = previousColumn.headerText ? previousColumn.headerText : this.parent.localeObj.getConstant('progress');
7908
+ }
7909
+ else {
7910
+ column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('progress');
7911
+ }
7737
7912
  column.width = column.width ? column.width : 150;
7738
7913
  column.editType = column.editType ? column.editType : 'numericedit';
7739
7914
  };
@@ -9967,7 +10142,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9967
10142
  for (var i = 0; i < this.parent.currentViewData.length; i++) {
9968
10143
  var tempTemplateData = this.parent.currentViewData[i];
9969
10144
  if (this.parent.viewType === 'ResourceView') {
9970
- if (this.parent.editModule && this.parent.editModule.isResourceTaskDeleted) {
10145
+ if (this.parent.editModule && this.parent.editModule.isResourceTaskDeleted || this.parent.isFromOnPropertyChange) {
9971
10146
  this.parent.initialChartRowElements = this.parent.ganttChartModule.getChartRows();
9972
10147
  this.parent.editModule.isResourceTaskDeleted = false;
9973
10148
  }
@@ -10479,7 +10654,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10479
10654
  addClass([cloneElement], 'collpse-parent-border');
10480
10655
  var id = chartRows[i].querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
10481
10656
  var ganttData = this.parent.getRecordByID(id);
10482
- var zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
10657
+ var zIndex = "";
10658
+ if (ganttData && ganttData.ganttProperties.eOverlapIndex) {
10659
+ zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
10660
+ }
10483
10661
  var cloneChildElement = cloneElement.cloneNode(true);
10484
10662
  cloneChildElement.style.zIndex = zIndex;
10485
10663
  parentTrNode[0].childNodes[0].childNodes[0].childNodes[0].appendChild(cloneChildElement);
@@ -11180,7 +11358,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
11180
11358
  var offsetValue = predecessor.offset;
11181
11359
  var durationUnit = predecessor.offsetUnit;
11182
11360
  if (offsetValue < 0) {
11183
- resultDate = this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(date, record), (offsetValue * -1), durationUnit, record);
11361
+ resultDate = this.dateValidateModule.getStartDate(this.dateValidateModule.checkEndDate(date, record), (offsetValue * -1), durationUnit, record, true);
11184
11362
  }
11185
11363
  else {
11186
11364
  resultDate = this.dateValidateModule.getEndDate(date, offsetValue, durationUnit, record, false);
@@ -13365,6 +13543,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13365
13543
  var _this = _super.call(this, options, element) || this;
13366
13544
  _this.showIndicator = true;
13367
13545
  _this.singleTier = 0;
13546
+ _this.isLocaleChanged = false;
13368
13547
  /** @hidden */
13369
13548
  _this.isCancelled = false;
13370
13549
  /** @hidden */
@@ -14705,6 +14884,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14705
14884
  case 'dayWorkingTime':
14706
14885
  case 'allowUnscheduledTasks':
14707
14886
  case 'holidays':
14887
+ this.isLoad = true;
14708
14888
  if (prop === 'holidays') {
14709
14889
  this.totalHolidayDates = this.dataOperation.getHolidayDates();
14710
14890
  this.notify('ui-update', { module: 'day-markers', properties: newProp });
@@ -14713,6 +14893,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14713
14893
  this.treeGrid.refreshColumns();
14714
14894
  this.chartRowsModule.initiateTemplates();
14715
14895
  this.chartRowsModule.refreshGanttRows();
14896
+ this.isLoad = false;
14716
14897
  break;
14717
14898
  case 'addDialogFields':
14718
14899
  case 'editDialogFields':
@@ -14792,6 +14973,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14792
14973
  case 'enableRtl':
14793
14974
  case 'readOnly':
14794
14975
  case 'viewType':
14976
+ if (prop === 'locale') {
14977
+ this.isLocaleChanged = true;
14978
+ }
14795
14979
  isRefresh = true;
14796
14980
  break;
14797
14981
  case 'validateManualTasksOnLinking':
@@ -18418,6 +18602,16 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
18418
18602
  merge(_this.taskBarEditRecord.ganttProperties, arg.previousData);
18419
18603
  }
18420
18604
  });
18605
+ this.parent.flatData.map(function (data) {
18606
+ if ((!isNullOrUndefined(_this.taskBarEditRecord.parentItem)) && data.ganttProperties.taskId === _this.taskBarEditRecord.parentItem.taskId) {
18607
+ data.childRecords.map(function (s) {
18608
+ if (isNullOrUndefined(s.ganttProperties.startDate) || isNullOrUndefined(s.ganttProperties.endDate) ||
18609
+ isNullOrUndefined(s.ganttProperties.duration)) {
18610
+ _this.parent.dataOperation.updateGanttData();
18611
+ }
18612
+ });
18613
+ }
18614
+ });
18421
18615
  }
18422
18616
  };
18423
18617
  /**
@@ -18971,7 +19165,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
18971
19165
  };
18972
19166
  TaskbarEdit.prototype.updateChildDrag = function (item) {
18973
19167
  var left = this.getRoundOffStartLeft(item, this.roundOffDuration);
18974
- var projectStartDate = this.getDateByLeft(left);
19168
+ var projectStartDate = this.getDateByLeft(left, item.isMilestone, item);
18975
19169
  var endDate;
18976
19170
  if (this.segmentIndex === 0) {
18977
19171
  this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, item, null), item, true);
@@ -19194,10 +19388,16 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19194
19388
  * @returns {Date} .
19195
19389
  * @private
19196
19390
  */
19197
- TaskbarEdit.prototype.getDateByLeft = function (left) {
19391
+ TaskbarEdit.prototype.getDateByLeft = function (left, isMilestone, property) {
19198
19392
  var pStartDate = new Date(this.parent.timelineModule.timelineStartDate.toString());
19199
19393
  var milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
19200
19394
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
19395
+ /* To render the milestone in proper date while editing */
19396
+ if (isMilestone) {
19397
+ pStartDate.setDate(pStartDate.getDate() - 1);
19398
+ this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
19399
+ pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
19400
+ }
19201
19401
  var tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.topTier :
19202
19402
  this.parent.timelineModule.bottomTier;
19203
19403
  if (tierMode !== 'Hour' && tierMode !== 'Minutes') {
@@ -22774,7 +22974,7 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
22774
22974
  this.parent.chartRowsModule.refreshRecords([args.data]);
22775
22975
  }
22776
22976
  else if (args.validateMode.removeLink) {
22777
- this.removePredecessors(ganttRecord, this.validationPredecessor);
22977
+ this.checkChildRecords(ganttRecord);
22778
22978
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22779
22979
  }
22780
22980
  else if (args.validateMode.preserveLinkWithEditing) {
@@ -22782,6 +22982,29 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
22782
22982
  this.parent.editModule.updateEditedTask(args.editEventArgs);
22783
22983
  }
22784
22984
  };
22985
+ ConnectorLineEdit.prototype.checkChildRecords = function (ganttRecord) {
22986
+ this.validationPredecessor = ganttRecord.ganttProperties.predecessor;
22987
+ if (!isNullOrUndefined(this.validationPredecessor)) {
22988
+ this.removePredecessors(ganttRecord, this.validationPredecessor);
22989
+ }
22990
+ if (ganttRecord.childRecords.length > 0) {
22991
+ for (var i = 0; i < ganttRecord.childRecords.length; i++) {
22992
+ var childRecord = ganttRecord.childRecords[i];
22993
+ this.validationPredecessor = childRecord.ganttProperties.predecessor;
22994
+ if (!isNullOrUndefined(this.validationPredecessor)) {
22995
+ this.removePredecessors(childRecord, this.validationPredecessor);
22996
+ }
22997
+ if (childRecord.childRecords.length > 0) {
22998
+ this.checkChildRecords(childRecord);
22999
+ }
23000
+ }
23001
+ }
23002
+ else if (!isNullOrUndefined(ganttRecord.parentItem)) {
23003
+ var parentRecord = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
23004
+ this.validationPredecessor = parentRecord.ganttProperties.predecessor;
23005
+ this.removePredecessors(parentRecord, this.validationPredecessor);
23006
+ }
23007
+ };
22785
23008
  ConnectorLineEdit.prototype.calculateOffset = function (record) {
22786
23009
  var prevPredecessor = extend([], record.ganttProperties.predecessor, [], true);
22787
23010
  var validPredecessor = this.parent.predecessorModule.getValidPredecessor(record);
@@ -22857,6 +23080,9 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
22857
23080
  */
22858
23081
  ConnectorLineEdit.prototype.removePredecessors = function (ganttRecord, predecessor) {
22859
23082
  var prevPredecessor = extend([], [], ganttRecord.ganttProperties.predecessor, true);
23083
+ if (isNullOrUndefined(predecessor)) {
23084
+ return;
23085
+ }
22860
23086
  var preLength = predecessor.length;
22861
23087
  for (var i = 0; i < preLength; i++) {
22862
23088
  var parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[i].from);
@@ -22952,14 +23178,20 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
22952
23178
  * @returns {boolean} .
22953
23179
  * @private
22954
23180
  */
22955
- ConnectorLineEdit.prototype.validateTypes = function (ganttRecord) {
23181
+ ConnectorLineEdit.prototype.validateTypes = function (ganttRecord, data) {
22956
23182
  var predecessor = this.parent.predecessorModule.getValidPredecessor(ganttRecord);
22957
23183
  var parentGanttRecord;
23184
+ var ganttTaskData;
22958
23185
  this.validationPredecessor = [];
22959
23186
  var violatedParent;
22960
23187
  var violateType;
22961
23188
  var startDate = this.parent.predecessorModule.getPredecessorDate(ganttRecord, predecessor);
22962
- var ganttTaskData = ganttRecord.ganttProperties;
23189
+ if (data) {
23190
+ ganttTaskData = data.ganttProperties;
23191
+ }
23192
+ else {
23193
+ ganttTaskData = ganttRecord.ganttProperties;
23194
+ }
22963
23195
  var endDate = this.parent.allowUnscheduledTasks && isNullOrUndefined(startDate) ?
22964
23196
  ganttTaskData.endDate :
22965
23197
  this.dateValidateModule.getEndDate(startDate, ganttTaskData.duration, ganttTaskData.durationUnit, ganttTaskData, false);
@@ -23844,6 +24076,29 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23844
24076
  */
23845
24077
  Edit$$1.prototype.initiateUpdateAction = function (args) {
23846
24078
  var isValidatePredecessor = this.isCheckPredecessor(args.data);
24079
+ var parentData;
24080
+ var childRecordIndex;
24081
+ if (!isNullOrUndefined(args.data.parentItem) && !isValidatePredecessor) {
24082
+ parentData = this.parent.getRecordByID(args.data.parentItem.taskId);
24083
+ if (this.isTaskbarMoved(args.data) && this.parent.predecessorModule.getValidPredecessor(parentData).length > 0
24084
+ && this.parent.isInPredecessorValidation) {
24085
+ isValidatePredecessor = true;
24086
+ }
24087
+ else {
24088
+ isValidatePredecessor = false;
24089
+ }
24090
+ }
24091
+ else if (args.data.childRecords.length > 0 && !isValidatePredecessor) {
24092
+ isValidatePredecessor = this.isCheckPredecessor(args.data);
24093
+ if (!isValidatePredecessor && this.isTaskbarMoved(args.data)) {
24094
+ for (var i = 0; i < args.data.childRecords.length; i++) {
24095
+ if (this.parent.predecessorModule.getValidPredecessor(args.data.childRecords[i]).length > 0) {
24096
+ childRecordIndex = i;
24097
+ isValidatePredecessor = true;
24098
+ }
24099
+ }
24100
+ }
24101
+ }
23847
24102
  this.taskbarMoved = this.isTaskbarMoved(args.data);
23848
24103
  this.predecessorUpdated = this.isPredecessorUpdated(args.data);
23849
24104
  if (this.predecessorUpdated) {
@@ -23852,7 +24107,15 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23852
24107
  }
23853
24108
  var validateObject = {};
23854
24109
  if (isValidatePredecessor) {
23855
- validateObject = this.parent.connectorLineEditModule.validateTypes(args.data);
24110
+ if (!isNullOrUndefined(parentData)) {
24111
+ validateObject = this.parent.connectorLineEditModule.validateTypes(parentData, args.data);
24112
+ }
24113
+ else if (!isNullOrUndefined(childRecordIndex)) {
24114
+ validateObject = this.parent.connectorLineEditModule.validateTypes(args.data.childRecords[childRecordIndex], args.data);
24115
+ }
24116
+ else {
24117
+ validateObject = this.parent.connectorLineEditModule.validateTypes(args.data);
24118
+ }
23856
24119
  this.parent.isConnectorLineUpdate = true;
23857
24120
  if (!isNullOrUndefined(getValue('violationType', validateObject))) {
23858
24121
  var newArgs = this.validateTaskEvent(args);
@@ -24180,7 +24443,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24180
24443
  durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
24181
24444
  }
24182
24445
  for (var i = 0; i < childRecords.length; i++) {
24183
- if (childRecords[i].ganttProperties.isAutoSchedule) {
24446
+ if ((!(this.parent.isUnscheduledTask(childRecords[i].ganttProperties))) && (childRecords[i].ganttProperties.isAutoSchedule)) {
24184
24447
  if (durationDiff > 0) {
24185
24448
  var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
24186
24449
  childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
@@ -24208,6 +24471,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24208
24471
  }
24209
24472
  if (childRecords.length) {
24210
24473
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
24474
+ this.parent.dataOperation.updateGanttData();
24211
24475
  }
24212
24476
  };
24213
24477
  /**
@@ -24287,9 +24551,21 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24287
24551
  });
24288
24552
  };
24289
24553
  Edit$$1.prototype.dmSuccess = function (e, args) {
24290
- var eLength = e['length'];
24554
+ var eLength;
24555
+ var rec;
24556
+ if (e.changedRecords) {
24557
+ eLength = e.changedRecords['length'];
24558
+ }
24559
+ else {
24560
+ eLength = e['length'];
24561
+ }
24291
24562
  for (var i = 0; i < eLength; i++) {
24292
- var rec = e[i];
24563
+ if (e.changedRecords) {
24564
+ rec = e.changedRecords[i];
24565
+ }
24566
+ else {
24567
+ rec = e[i];
24568
+ }
24293
24569
  var _aLength = Object.keys(rec).length;
24294
24570
  for (var j = 0, _a = Object.keys(rec); j < _aLength; j++) {
24295
24571
  var key = _a[j];
@@ -25954,9 +26230,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25954
26230
  var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query_2);
25955
26231
  crud.then(function (e) {
25956
26232
  if (_this.parent.taskFields.id && !isNullOrUndefined(e.addedRecords[0][_this.parent.taskFields.id]) &&
25957
- e.addedRecords[0][_this.parent.taskFields.id].toString() !== prevID_1) {
26233
+ e.addedRecords[0][_this.parent.taskFields.id].toString() == prevID_1) {
25958
26234
  _this.parent.setRecordValue('taskId', e.addedRecords[0][_this.parent.taskFields.id], args.data.ganttProperties, true);
25959
- _this.parent.setRecordValue('taskData.' + _this.parent.taskFields.id, e.addedRecords[0][_this.parent.taskFields.id], args.data);
26235
+ _this.parent.setRecordValue('taskData', e.addedRecords[0], args.data);
25960
26236
  _this.parent.setRecordValue(_this.parent.taskFields.id, e.addedRecords[0][_this.parent.taskFields.id], args.data);
25961
26237
  _this.parent.setRecordValue('rowUniqueID', e.addedRecords[0][_this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
25962
26238
  var idsIndex = _this.parent.ids.indexOf(prevID_1);