@syncfusion/ej2-gantt 20.1.48 → 20.1.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.
@@ -8427,10 +8427,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8427
8427
  'border-bottom-right-radius:' + this.getBorderRadius(data.ganttProperties) + 'px;">' +
8428
8428
  '</div>');
8429
8429
  }
8430
+ var tempDiv = createElement('div');
8430
8431
  if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8431
8432
  var taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
8432
8433
  if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
8433
- var tempDiv = createElement('div');
8434
8434
  tempDiv.appendChild(taskLabelTemplateNode[0]);
8435
8435
  labelString = tempDiv.innerHTML;
8436
8436
  }
@@ -8440,6 +8440,9 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8440
8440
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8441
8441
  }
8442
8442
  if (labelString !== 'null') {
8443
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8444
+ labelString = '';
8445
+ }
8443
8446
  if (isNaN(parseInt(labelString))) {
8444
8447
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
8445
8448
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
@@ -8477,7 +8480,16 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8477
8480
  (isNullOrUndefined(data.ganttProperties.segments) || (!isNullOrUndefined(data.ganttProperties.segments) &&
8478
8481
  data.ganttProperties.segments.length === 0))) {
8479
8482
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8480
- progressDiv[0].appendChild([].slice.call(this.createDivElement(template))[0]);
8483
+ var templateElement = this.createDivElement(template)[0];
8484
+ templateElement.appendChild(tempDiv);
8485
+ progressDiv[0].appendChild(templateElement);
8486
+ var childLabel = this.parent.labelSettings.taskLabel;
8487
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8488
+ !this.isTemplate(childLabel))
8489
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8490
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8491
+ childLabel && !childLabel['elementRef'])
8492
+ progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8481
8493
  }
8482
8494
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
8483
8495
  taskbarInnerDiv[0].appendChild([].slice.call(progressDiv)[0]);
@@ -9051,10 +9063,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9051
9063
  'width:' + data.ganttProperties.progressWidth + 'px;' +
9052
9064
  'border-top-right-radius:' + this.getBorderRadius(data) + 'px;' +
9053
9065
  'border-bottom-right-radius:' + this.getBorderRadius(data) + 'px;height:100%;"></div>');
9066
+ var div = createElement('div');
9054
9067
  if (this.taskLabelTemplateFunction) {
9055
9068
  var parentTaskLabelNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressBarInnerDiv[0]);
9056
9069
  if (parentTaskLabelNode && parentTaskLabelNode.length > 0) {
9057
- var div = createElement('div');
9058
9070
  div.appendChild(parentTaskLabelNode[0]);
9059
9071
  labelString = div.innerHTML;
9060
9072
  }
@@ -9064,23 +9076,35 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9064
9076
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
9065
9077
  }
9066
9078
  if (labelString !== 'null') {
9079
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
9080
+ labelString = '';
9081
+ }
9067
9082
  if (isNaN(parseInt(labelString))) {
9068
- labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
9083
+ labelDiv = '<span class="' + taskLabel + '" style="line-height:' +
9069
9084
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
9070
9085
  'display:' + 'inline-block;' +
9071
9086
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
9072
- this.taskBarHeight + 'px;">' + labelString + '</span>');
9087
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
9073
9088
  }
9074
9089
  else {
9075
- labelDiv = this.createDivElement('<span class="' +
9090
+ labelDiv = '<span class="' +
9076
9091
  taskLabel + '" style="line-height:' +
9077
9092
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
9078
9093
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9079
9094
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
9080
9095
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
9081
- this.taskBarHeight + 'px;">' + labelString + '</span>');
9096
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
9082
9097
  }
9083
- progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
9098
+ var labelElement = this.createDivElement(labelDiv)[0];
9099
+ labelElement.appendChild(div);
9100
+ progressBarInnerDiv[0].appendChild(labelElement);
9101
+ var parentLabel = this.parent.labelSettings.taskLabel;
9102
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
9103
+ !this.isTemplate(parentLabel))
9104
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
9105
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
9106
+ parentLabel && !parentLabel['elementRef'])
9107
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
9084
9108
  }
9085
9109
  var milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
9086
9110
  '<div class="' + parentMilestoneTop + '" style="border-right-width:' +
@@ -9908,6 +9932,18 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9908
9932
  };
9909
9933
  ChartRows.prototype.getResourceParent = function (record) {
9910
9934
  var chartRows = this.parent.ganttChartModule.getChartRows();
9935
+ //Below code is for rendering taskbartemplate in resource view with multi taskbar
9936
+ if (this.parent.initialChartRowElements) {
9937
+ for (var j = 0; j <= this.parent.initialChartRowElements.length; j++) {
9938
+ if (!isNullOrUndefined(chartRows[j])) {
9939
+ if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
9940
+ !isNullOrUndefined(this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2])) {
9941
+ // eslint-disable-next-line
9942
+ chartRows[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'] = this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'];
9943
+ }
9944
+ }
9945
+ }
9946
+ }
9911
9947
  this.templateData = record;
9912
9948
  var parentTrNode = this.getTableTrNode();
9913
9949
  var leftLabelNode = this.leftLabelContainer();
@@ -13368,6 +13404,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13368
13404
  this.getCurrentRecords(args);
13369
13405
  }
13370
13406
  this.notify('recordsUpdated', {});
13407
+ this.initialChartRowElements = this.ganttChartModule.getChartRows();
13371
13408
  this.isLoad = false;
13372
13409
  this.trigger('dataBound', args);
13373
13410
  };
@@ -18749,6 +18786,13 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
18749
18786
  dialogModel.target = document.body;
18750
18787
  dialogModel.close = this.dialogClose.bind(this);
18751
18788
  dialogModel.closeOnEscape = true;
18789
+ dialogModel.beforeClose = function (args) {
18790
+ if (args.closedBy == "escape") {
18791
+ if (args.event.name == "key-pressed" && args.event.target.nodeName == 'INPUT') {
18792
+ args.cancel = true;
18793
+ }
18794
+ }
18795
+ };
18752
18796
  dialogModel.open = function (args) {
18753
18797
  var dialogElement = getValue('element', args);
18754
18798
  var generalTabElement = dialogElement.querySelector('#' + _this.parent.element.id + 'GeneralTabContainer');
@@ -19034,6 +19078,8 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
19034
19078
  }
19035
19079
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
19036
19080
  document.getElementById(id).ej2_instances[0].refresh();
19081
+ var notesTabElement = document.querySelector('#' + this.parent.element.id + 'NotesTabContainer');
19082
+ notesTabElement.style.overflow = 'scroll';
19037
19083
  }
19038
19084
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
19039
19085
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {