@syncfusion/ej2-gantt 20.4.40 → 20.4.43

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-gantt.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js +2 -2
  5. package/dist/ej2-gantt.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es2015.js +29 -7
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +45 -23
  9. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  10. package/dist/global/ej2-gantt.min.js +2 -2
  11. package/dist/global/ej2-gantt.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +19 -19
  14. package/src/gantt/actions/edit.js +9 -1
  15. package/src/gantt/actions/rowdragdrop.js +25 -16
  16. package/src/gantt/actions/toolbar.js +3 -0
  17. package/src/gantt/renderer/chart-rows.js +8 -6
  18. package/styles/bootstrap-dark.css +1 -1
  19. package/styles/bootstrap.css +1 -1
  20. package/styles/bootstrap4.css +2 -2
  21. package/styles/bootstrap5-dark.css +1 -1
  22. package/styles/bootstrap5.css +1 -1
  23. package/styles/fabric-dark.css +1 -1
  24. package/styles/fabric.css +1 -1
  25. package/styles/fluent-dark.css +1 -1
  26. package/styles/fluent.css +1 -1
  27. package/styles/gantt/_theme.scss +1 -1
  28. package/styles/gantt/bootstrap-dark.css +1 -1
  29. package/styles/gantt/bootstrap.css +1 -1
  30. package/styles/gantt/bootstrap4.css +2 -2
  31. package/styles/gantt/bootstrap5-dark.css +1 -1
  32. package/styles/gantt/bootstrap5.css +1 -1
  33. package/styles/gantt/fabric-dark.css +1 -1
  34. package/styles/gantt/fabric.css +1 -1
  35. package/styles/gantt/fluent-dark.css +1 -1
  36. package/styles/gantt/fluent.css +1 -1
  37. package/styles/gantt/highcontrast-light.css +1 -1
  38. package/styles/gantt/highcontrast.css +1 -1
  39. package/styles/gantt/material-dark.css +1 -1
  40. package/styles/gantt/material.css +1 -1
  41. package/styles/gantt/tailwind-dark.css +1 -1
  42. package/styles/gantt/tailwind.css +1 -1
  43. package/styles/highcontrast-light.css +1 -1
  44. package/styles/highcontrast.css +1 -1
  45. package/styles/material-dark.css +1 -1
  46. package/styles/material.css +1 -1
  47. package/styles/tailwind-dark.css +1 -1
  48. package/styles/tailwind.css +1 -1
@@ -9110,7 +9110,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9110
9110
  var splitStartDate = this.parent.dataOperation.checkStartDate(splitDate, ganttProp, false);
9111
9111
  if (splitStartDate.getTime() !== ganttProp.startDate.getTime()) {
9112
9112
  if (ganttProp.isAutoSchedule) {
9113
- if (!isNullOrUndefined(segments)) {
9113
+ if (!isNullOrUndefined(segments) && segments.length > 0) {
9114
9114
  segmentIndex = this.getSegmentIndex(splitStartDate, splitRecord);
9115
9115
  }
9116
9116
  //check atleast one day difference is there to split
@@ -9429,11 +9429,11 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9429
9429
  'width:' + data.ganttProperties.width + 'px;' +
9430
9430
  'height:' + taskbarHeight + 'px;>' + innerDiv + ((data.ganttProperties.startDate && data.ganttProperties.endDate &&
9431
9431
  data.ganttProperties.duration) || data.ganttProperties.duration ? '<div class="e-gantt-manualparenttaskbar-left" style=' +
9432
- (this.parent.enableRtl ? 'margin-right:0px;' : '') + '"height:' + taskbarHeight + 'px;border-left-width:' + taskbarHeight / 5 +
9432
+ (this.parent.enableRtl ? 'margin-right:0px;' : '') + '"height:' + ((taskbarHeight / 5) + 8) + 'px;border-left-width:' + taskbarHeight / 5 +
9433
9433
  'px; border-bottom:' + taskbarHeight / 5 + 'px solid transparent;"></div>' +
9434
9434
  '<div class="e-gantt-manualparenttaskbar-right" style=' + (this.parent.enableRtl ? 'margin-right:-8px;' : '') +
9435
- (this.parent.enableRtl ? 'right:' : 'left:') + (data.ganttProperties.width - taskbarHeight / 5) + 'px;height:' +
9436
- (taskbarHeight) + 'px;border-right-width:' + taskbarHeight / 5 + 'px;border-bottom:' +
9435
+ (this.parent.enableRtl ? 'right:' : 'left:') + (data.ganttProperties.width - Math.floor(((taskbarHeight / 5) + 8) / 5)) + 'px;height:' +
9436
+ ((taskbarHeight / 5) + 8) + 'px;border-right-width:' + taskbarHeight / 5 + 'px;border-bottom:' +
9437
9437
  taskbarHeight / 5 + 'px solid transparent;>' + '</div></div>' : '');
9438
9438
  var milestoneTemplate = '<div class="' + manualParentMilestone + '" style="position:absolute;' +
9439
9439
  (this.parent.enableRtl ? 'right:' : 'left:') +
@@ -9497,7 +9497,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9497
9497
  }
9498
9498
  if (isNaN(parseInt(labelString))) {
9499
9499
  labelDiv = '<span class="' + taskLabel + '" style="line-height:' +
9500
- (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
9500
+ (data['isManual'] && data.hasChildRecords ? (Math.floor((60 / 100) * this.taskBarHeight)) : (this.taskBarHeight - 1)) +
9501
+ 'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
9501
9502
  'display:' + 'inline-block;' +
9502
9503
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
9503
9504
  this.taskBarHeight + 'px;">' + labelString + '</span>';
@@ -9505,7 +9506,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9505
9506
  else {
9506
9507
  labelDiv = '<span class="' +
9507
9508
  taskLabel + '" style="line-height:' +
9508
- (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
9509
+ (data['isManual'] && data.hasChildRecords ? (Math.floor((60 / 100) * this.taskBarHeight)) : (this.taskBarHeight - 1)) + 'px;' +
9510
+ (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
9509
9511
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9510
9512
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
9511
9513
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
@@ -23575,7 +23577,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23575
23577
  if ((key === tasks.baselineStartDate || key === tasks.baselineEndDate) &&
23576
23578
  (ganttData.ganttProperties.baselineStartDate && ganttData.ganttProperties.baselineEndDate)) {
23577
23579
  ganttObj.setRecordValue('baselineStartDate', ganttObj.dataOperation.checkBaselineStartDate(ganttData.ganttProperties.baselineStartDate), ganttData.ganttProperties, true);
23578
- ganttObj.dataOperation.setTime(this.parent.defaultEndTime, ganttData.ganttProperties.baselineEndDate);
23580
+ if (ganttData.ganttProperties.baselineEndDate && ganttData.ganttProperties.baselineEndDate.getHours() === 0 && this.parent.defaultEndTime !== 86400) {
23581
+ ganttObj.dataOperation.setTime(this.parent.defaultEndTime, ganttData.ganttProperties.baselineEndDate);
23582
+ }
23579
23583
  ganttObj.setRecordValue('baselineEndDate', ganttObj.dataOperation.checkBaselineEndDate(ganttData.ganttProperties.baselineEndDate), ganttData.ganttProperties, true);
23580
23584
  ganttObj.setRecordValue('baselineLeft', ganttObj.dataOperation.calculateBaselineLeft(ganttData.ganttProperties), ganttData.ganttProperties, true);
23581
23585
  ganttObj.setRecordValue('baselineWidth', ganttObj.dataOperation.calculateBaselineWidth(ganttData.ganttProperties), ganttData.ganttProperties, true);
@@ -25908,6 +25912,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25908
25912
  else {
25909
25913
  _this.parent.showSpinner();
25910
25914
  }
25915
+ var tasks = _this.parent.taskFields;
25916
+ var ganttData = _this.parent.viewType === 'ResourceView' ?
25917
+ _this.parent.flatData[_this.parent.getTaskIds().indexOf('T' + args.data[tasks.id])] : _this.parent.getRecordByID(args.data[tasks.id]);
25918
+ if (!isNullOrUndefined(ganttData)) {
25919
+ _this.validateUpdateValues(args.newTaskData, ganttData, true);
25920
+ }
25911
25921
  if (!isNullOrUndefined(args.data[tempTaskID])) {
25912
25922
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
25913
25923
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
@@ -28210,6 +28220,9 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
28210
28220
  * @private
28211
28221
  */
28212
28222
  Toolbar$$1.prototype.zoomToFit = function () {
28223
+ if (this.parent.timelineModule.isZoomIn) {
28224
+ this.parent.timelineModule.isZoomIn = false;
28225
+ }
28213
28226
  this.parent.timelineModule.processZoomToFit();
28214
28227
  this.parent.ganttChartModule.updateScrollLeft(0);
28215
28228
  };
@@ -30648,6 +30661,15 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
30648
30661
  delete droppedRecord.taskData[this_1.parent.taskFields.segments];
30649
30662
  }
30650
30663
  }
30664
+ if (this_1.treeGridData.length != 0) {
30665
+ for (var i_1 = 0; i_1 < this_1.treeGridData.length; i_1++) {
30666
+ this_1.treeGridData[parseInt(i_1.toString(), 10)].index = i_1;
30667
+ if (!isNullOrUndefined(this_1.treeGridData[parseInt(i_1.toString(), 10)].parentItem)) {
30668
+ var updatedParent = getValue('uniqueIDCollection.' + this_1.treeGridData[parseInt(i_1.toString(), 10)].parentUniqueID, this_1.parent.treeGrid);
30669
+ this_1.treeGridData[parseInt(i_1.toString(), 10)].parentItem.index = updatedParent.index;
30670
+ }
30671
+ }
30672
+ }
30651
30673
  // eslint-disable-next-line
30652
30674
  if (!isNullOrUndefined(draggedRecord.parentItem && this_1.updateParentRecords.indexOf(draggedRecord.parentItem) !== -1)) {
30653
30675
  this_1.updateParentRecords.push(draggedRecord.parentItem);
@@ -30661,51 +30683,51 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
30661
30683
  var uniqueTaskID_1 = this_1.parent.taskFields.id;
30662
30684
  if (draggedRecord.index < droppedRecord.index) {
30663
30685
  startIndex = draggedRecord.index;
30664
- var _loop_3 = function (i_1) {
30686
+ var _loop_3 = function (i_2) {
30665
30687
  var currentData = this_1.parent.currentViewData.filter(function (e) {
30666
- return e[uniqueTaskID_1] === ganttData_1[i_1][uniqueTaskID_1];
30688
+ return e[uniqueTaskID_1] === ganttData_1[i_2][uniqueTaskID_1];
30667
30689
  })[0];
30668
30690
  if (currentData && currentData.index > droppedRecord.index) {
30669
30691
  endIndex = currentData.index;
30670
30692
  return "break";
30671
30693
  }
30672
30694
  };
30673
- for (var i_1 = 0; i_1 < ganttData_1.length; i_1++) {
30674
- var state_2 = _loop_3(i_1);
30695
+ for (var i_2 = 0; i_2 < ganttData_1.length; i_2++) {
30696
+ var state_2 = _loop_3(i_2);
30675
30697
  if (state_2 === "break")
30676
30698
  break;
30677
30699
  }
30678
30700
  }
30679
30701
  else {
30680
30702
  startIndex = droppedRecord.index;
30681
- var _loop_4 = function (i_2) {
30703
+ var _loop_4 = function (i_3) {
30682
30704
  var currentData = this_1.parent.currentViewData.filter(function (e) {
30683
- return e[uniqueTaskID_1] === ganttData_1[i_2][uniqueTaskID_1];
30705
+ return e[uniqueTaskID_1] === ganttData_1[i_3][uniqueTaskID_1];
30684
30706
  })[0];
30685
30707
  if (currentData && currentData.index > draggedRecord.index) {
30686
30708
  endIndex = currentData.index;
30687
30709
  return "break";
30688
30710
  }
30689
30711
  };
30690
- for (var i_2 = 0; i_2 < ganttData_1.length; i_2++) {
30691
- var state_3 = _loop_4(i_2);
30712
+ for (var i_3 = 0; i_3 < ganttData_1.length; i_3++) {
30713
+ var state_3 = _loop_4(i_3);
30692
30714
  if (state_3 === "break")
30693
30715
  break;
30694
30716
  }
30695
30717
  }
30696
- var _loop_5 = function (i_3) {
30697
- if (!isNullOrUndefined(data_1[i_3])) {
30698
- data_1[i_3].index = i_3;
30699
- if (!isNullOrUndefined(data_1[i_3].parentItem)) {
30718
+ var _loop_5 = function (i_4) {
30719
+ if (!isNullOrUndefined(data_1[i_4])) {
30720
+ data_1[i_4].index = i_4;
30721
+ if (!isNullOrUndefined(data_1[i_4].parentItem)) {
30700
30722
  var updatedParent = data_1.filter(function (e) {
30701
- return e.uniqueID === data_1[i_3].parentUniqueID;
30723
+ return e.uniqueID === data_1[i_4].parentUniqueID;
30702
30724
  })[0];
30703
- data_1[i_3].parentItem.index = updatedParent.index;
30725
+ data_1[i_4].parentItem.index = updatedParent.index;
30704
30726
  }
30705
30727
  }
30706
30728
  };
30707
- for (var i_3 = startIndex; i_3 <= endIndex; i_3++) {
30708
- _loop_5(i_3);
30729
+ for (var i_4 = startIndex; i_4 <= endIndex; i_4++) {
30730
+ _loop_5(i_4);
30709
30731
  }
30710
30732
  }
30711
30733
  gObj.rowDragAndDropModule.refreshDataSource();