@syncfusion/ej2-gantt 20.3.48 → 20.3.50

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.
@@ -2960,7 +2960,9 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2960
2960
  this.parent.setRecordValue(dataMapping.id, ganttProperties.taskId, ganttData);
2961
2961
  }
2962
2962
  if (dataMapping.name) {
2963
- this.parent.setRecordValue('taskData.' + dataMapping.name, ganttProperties.taskName, ganttData);
2963
+ if (!this.parent.isLoad) {
2964
+ this.parent.setRecordValue('taskData.' + dataMapping.name, ganttProperties.taskName, ganttData);
2965
+ }
2964
2966
  this.parent.setRecordValue(dataMapping.name, ganttProperties.taskName, ganttData);
2965
2967
  }
2966
2968
  if (dataMapping.startDate) {
@@ -2976,7 +2978,9 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2976
2978
  data[dataMapping.durationUnit] = ganttProperties.durationUnit;
2977
2979
  }
2978
2980
  if (dataMapping.progress) {
2979
- this.parent.setRecordValue('taskData.' + dataMapping.progress, ganttProperties.progress, ganttData);
2981
+ if (!this.parent.isLoad) {
2982
+ this.parent.setRecordValue('taskData.' + dataMapping.progress, ganttProperties.progress, ganttData);
2983
+ }
2980
2984
  this.parent.setRecordValue(dataMapping.progress, ganttProperties.progress, ganttData);
2981
2985
  }
2982
2986
  if (dataMapping.baselineStartDate) {
@@ -2986,15 +2990,21 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2986
2990
  this.setRecordDate(ganttData, ganttProperties.baselineEndDate, dataMapping.baselineEndDate);
2987
2991
  }
2988
2992
  if (dataMapping.notes) {
2989
- this.parent.setRecordValue('taskData.' + dataMapping.notes, ganttProperties.notes, ganttData);
2993
+ if (!this.parent.isLoad) {
2994
+ this.parent.setRecordValue('taskData.' + dataMapping.notes, ganttProperties.notes, ganttData);
2995
+ }
2990
2996
  this.parent.setRecordValue(dataMapping.notes, ganttProperties.notes, ganttData);
2991
2997
  }
2992
2998
  if (dataMapping.cssClass) {
2993
- this.parent.setRecordValue('taskData.' + dataMapping.cssClass, ganttProperties.cssClass, ganttData);
2999
+ if (!this.parent.isLoad) {
3000
+ this.parent.setRecordValue('taskData.' + dataMapping.cssClass, ganttProperties.cssClass, ganttData);
3001
+ }
2994
3002
  this.parent.setRecordValue(dataMapping.cssClass, ganttProperties.cssClass, ganttData);
2995
3003
  }
2996
3004
  if (dataMapping.indicators) {
2997
- this.parent.setRecordValue('taskData.' + dataMapping.indicators, ganttProperties.indicators, ganttData);
3005
+ if (!this.parent.isLoad) {
3006
+ this.parent.setRecordValue('taskData.' + dataMapping.indicators, ganttProperties.indicators, ganttData);
3007
+ }
2998
3008
  this.parent.setRecordValue(dataMapping.indicators, ganttProperties.indicators, ganttData);
2999
3009
  }
3000
3010
  if (dataMapping.parentID) {
@@ -3003,11 +3013,15 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3003
3013
  this.parent.setRecordValue(dataMapping.parentID, ganttProperties.parentId, ganttData);
3004
3014
  }
3005
3015
  if (dataMapping.work) {
3006
- this.parent.setRecordValue('taskData.' + dataMapping.work, this.getWorkString(ganttProperties.work, ganttProperties.workUnit), ganttData);
3016
+ if (!this.parent.isLoad) {
3017
+ this.parent.setRecordValue('taskData.' + dataMapping.work, this.getWorkString(ganttProperties.work, ganttProperties.workUnit), ganttData);
3018
+ }
3007
3019
  this.parent.setRecordValue(dataMapping.work, ganttProperties.work, ganttData);
3008
3020
  }
3009
3021
  if (dataMapping.type) {
3010
- this.parent.setRecordValue('taskData.' + dataMapping.type, ganttProperties.taskType, ganttData);
3022
+ if (!this.parent.isLoad) {
3023
+ this.parent.setRecordValue('taskData.' + dataMapping.type, ganttProperties.taskType, ganttData);
3024
+ }
3011
3025
  this.parent.setRecordValue(dataMapping.type, ganttProperties.taskType, ganttData);
3012
3026
  }
3013
3027
  }
@@ -7623,7 +7637,14 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7623
7637
  return data.level === 0 ? 'R-' + data.ganttProperties.taskId : 'T-' + data.ganttProperties.taskId;
7624
7638
  };
7625
7639
  GanttTreeGrid.prototype.updateScrollTop = function (args) {
7626
- this.treeGridElement.querySelector('.e-content').scrollTop = getValue('top', args);
7640
+ var newScrollTop;
7641
+ if (getValue('top', args) > (this.parent.flatData.length * this.parent.rowHeight)) {
7642
+ newScrollTop = getValue('top', args) - document.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'];
7643
+ }
7644
+ else {
7645
+ newScrollTop = getValue('top', args);
7646
+ }
7647
+ this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
7627
7648
  this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
7628
7649
  };
7629
7650
  GanttTreeGrid.prototype.treeGridClickHandler = function (e) {
@@ -12844,7 +12865,14 @@ var FocusModule = /** @__PURE__ @class */ (function () {
12844
12865
  || (ganttObj.editSettings.allowTaskbarEditing && !ganttObj.editModule.taskbarEditModule.touchEdit))) {
12845
12866
  if ((ganttObj.selectionSettings.mode !== 'Cell' && ganttObj.selectionModule.selectedRowIndexes.length)
12846
12867
  || (ganttObj.selectionSettings.mode === 'Cell' && ganttObj.selectionModule.getSelectedRowCellIndexes().length)) {
12847
- ganttObj.editModule.startDeleteAction();
12868
+ if (!isNullOrUndefined(e.target)) {
12869
+ if (e.target['tagName'] !== 'INPUT') {
12870
+ ganttObj.editModule.startDeleteAction();
12871
+ }
12872
+ }
12873
+ else {
12874
+ ganttObj.editModule.startDeleteAction();
12875
+ }
12848
12876
  }
12849
12877
  }
12850
12878
  break;
@@ -21088,7 +21116,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21088
21116
  if (gridObj.isEdit) {
21089
21117
  gridObj.endEdit();
21090
21118
  }
21091
- if (isEdit) {
21119
+ if (isEdit && gridObj.currentViewData.length != gridObj.dataSource['length']) {
21092
21120
  dataSource = gridObj.dataSource;
21093
21121
  }
21094
21122
  else {
@@ -24652,6 +24680,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24652
24680
  }
24653
24681
  /*Child collection update*/
24654
24682
  parentItem.childRecords.splice(childIndex, 0, record);
24683
+ if (!this.parent.taskFields.child) {
24684
+ this.parent.taskFields.child = 'Children';
24685
+ }
24655
24686
  if ((this.parent.dataSource instanceof DataManager &&
24656
24687
  isNullOrUndefined(parentItem.taskData[this.parent.taskFields.parentID])) ||
24657
24688
  !isNullOrUndefined(this.parent.dataSource)) {
@@ -28960,7 +28991,9 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
28960
28991
  ContextMenu$$1.prototype.contextMenuOpen = function (args) {
28961
28992
  this.isOpen = true;
28962
28993
  var firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
28963
- addClass([firstMenuItem], 'e-focused');
28994
+ if (!isNullOrUndefined(firstMenuItem)) {
28995
+ addClass([firstMenuItem], 'e-focused');
28996
+ }
28964
28997
  };
28965
28998
  ContextMenu$$1.prototype.getMenuItems = function () {
28966
28999
  var menuItems = !isNullOrUndefined(this.parent.contextMenuItems) ?
@@ -31606,6 +31639,9 @@ var PdfTreeGridCell = /** @__PURE__ @class */ (function () {
31606
31639
  if (typeof this.value === 'string') {
31607
31640
  /* eslint-disable-next-line */
31608
31641
  var font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
31642
+ if (this.row.treegrid.ganttStyle.font) {
31643
+ font = this.row.treegrid.ganttStyle.font;
31644
+ }
31609
31645
  /* eslint-disable-next-line */
31610
31646
  var slr = layouter.layout(this.value, font, this.style.format, new SizeF(Number.MAX_VALUE, Number.MAX_VALUE), false, new SizeF(0, 0));
31611
31647
  width += slr.actualSize.width;
@@ -31639,6 +31675,9 @@ var PdfTreeGridCell = /** @__PURE__ @class */ (function () {
31639
31675
  }
31640
31676
  /* eslint-disable */
31641
31677
  var font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
31678
+ if (this.row.treegrid.ganttStyle.font) {
31679
+ font = this.row.treegrid.ganttStyle.font;
31680
+ }
31642
31681
  /* eslint-disable */
31643
31682
  var slr = layouter.layout(currentValue, font, this.style.format, new SizeF(width, 0), false, new SizeF(0, 0));
31644
31683
  height += slr.actualSize.height;
@@ -31706,6 +31745,9 @@ var PdfTreeGridCell = /** @__PURE__ @class */ (function () {
31706
31745
  else {
31707
31746
  font = new PdfStandardFont(this.row.treegrid.ganttStyle.fontFamily, this.style.fontSize, this.style.fontStyle);
31708
31747
  }
31748
+ if (this.row.treegrid.ganttStyle.font) {
31749
+ font = this.row.treegrid.ganttStyle.font;
31750
+ }
31709
31751
  var innerLayoutArea = bounds;
31710
31752
  if (!this.isHeaderCell) {
31711
31753
  /* eslint-disable-next-line */
@@ -33077,6 +33119,10 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
33077
33119
  this.drawLeftLabel(page, startPoint, detail, cumulativeWidth);
33078
33120
  //Draw Taskbar
33079
33121
  var font = new PdfStandardFont(this.fontFamily, 9, PdfFontStyle.Regular);
33122
+ if (!isNullOrUndefined(this.parent.pdfExportModule['helper']['exportProps'].ganttStyle) &&
33123
+ this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
33124
+ font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
33125
+ }
33080
33126
  var fontColor = null;
33081
33127
  var fontBrush = new PdfSolidBrush(this.progressFontColor);
33082
33128
  var progressFormat = new PdfStringFormat();
@@ -33242,6 +33288,10 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
33242
33288
  !isNullOrUndefined(this.rightTaskLabel.value) && !this.rightTaskLabel.isCompleted) {
33243
33289
  var result = this.getWidth(this.rightTaskLabel.value, detail.endPoint - left, 15);
33244
33290
  var font = new PdfStandardFont(this.fontFamily, 9);
33291
+ if (!isNullOrUndefined(this.parent.pdfExportModule['helper']['exportProps'].ganttStyle) &&
33292
+ this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
33293
+ font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
33294
+ }
33245
33295
  var adjustHeight = (pixelToPoint(this.parent.rowHeight) - result.actualSize.height) / 2;
33246
33296
  var point = new PointF(actualLeft, startPoint.y + adjustHeight);
33247
33297
  var size = new SizeF(result.actualSize.width, result.actualSize.height);
@@ -33297,6 +33347,10 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
33297
33347
  && !this.leftTaskLabel.isCompleted) {
33298
33348
  var result = this.getWidth(this.leftTaskLabel.value, detail.endPoint - left, 15);
33299
33349
  var font = new PdfStandardFont(this.fontFamily, 9);
33350
+ if (!isNullOrUndefined(this.parent.pdfExportModule['helper']['exportProps'].ganttStyle) &&
33351
+ this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
33352
+ font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
33353
+ }
33300
33354
  var adjustHeight = (pixelToPoint(this.parent.rowHeight) - result.actualSize.height) / 2;
33301
33355
  var rightLabelpoint = new PointF(actualLeft, startPoint.y + adjustHeight);
33302
33356
  var rightLabelSize = new SizeF(result.actualSize.width, result.actualSize.height);
@@ -33325,6 +33379,10 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
33325
33379
  };
33326
33380
  PdfGanttTaskbarCollection.prototype.getWidth = function (value, width, height) {
33327
33381
  var font = new PdfStandardFont(this.fontFamily, 9);
33382
+ if (!isNullOrUndefined(this.parent.pdfExportModule['helper']['exportProps'].ganttStyle) &&
33383
+ this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font) {
33384
+ font = this.parent.pdfExportModule['helper']['exportProps'].ganttStyle.font;
33385
+ }
33328
33386
  var layouter = new PdfStringLayouter();
33329
33387
  var progressFormat = new PdfStringFormat();
33330
33388
  progressFormat.alignment = PdfTextAlignment.Left;
@@ -33545,6 +33603,9 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
33545
33603
  var rectBrush = new PdfSolidBrush(eventArgs.timelineCell.backgroundColor);
33546
33604
  graphics.drawRectangle(rectPen, rectBrush, x, y, pixelToPoint(width), pixelToPoint(height));
33547
33605
  var font = new PdfStandardFont(ganttStyle.fontFamily, e.fontSize, e.fontStyle);
33606
+ if (ganttStyle.font) {
33607
+ font = ganttStyle.font;
33608
+ }
33548
33609
  var textBrush = new PdfSolidBrush(eventArgs.timelineCell.fontColor);
33549
33610
  var pLeft = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.left : 0;
33550
33611
  var pTop = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.top : 0;