@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.
@@ -8039,10 +8039,10 @@ class ChartRows extends DateProcessor {
8039
8039
  'border-bottom-right-radius:' + this.getBorderRadius(data.ganttProperties) + 'px;">' +
8040
8040
  '</div>');
8041
8041
  }
8042
+ let tempDiv = createElement('div');
8042
8043
  if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8043
8044
  const taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
8044
8045
  if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
8045
- const tempDiv = createElement('div');
8046
8046
  tempDiv.appendChild(taskLabelTemplateNode[0]);
8047
8047
  labelString = tempDiv.innerHTML;
8048
8048
  }
@@ -8052,6 +8052,9 @@ class ChartRows extends DateProcessor {
8052
8052
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8053
8053
  }
8054
8054
  if (labelString !== 'null') {
8055
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8056
+ labelString = '';
8057
+ }
8055
8058
  if (isNaN(parseInt(labelString))) {
8056
8059
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
8057
8060
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
@@ -8089,7 +8092,16 @@ class ChartRows extends DateProcessor {
8089
8092
  (isNullOrUndefined(data.ganttProperties.segments) || (!isNullOrUndefined(data.ganttProperties.segments) &&
8090
8093
  data.ganttProperties.segments.length === 0))) {
8091
8094
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8092
- progressDiv[0].appendChild([].slice.call(this.createDivElement(template))[0]);
8095
+ let templateElement = this.createDivElement(template)[0];
8096
+ templateElement.appendChild(tempDiv);
8097
+ progressDiv[0].appendChild(templateElement);
8098
+ let childLabel = this.parent.labelSettings.taskLabel;
8099
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8100
+ !this.isTemplate(childLabel))
8101
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8102
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8103
+ childLabel && !childLabel['elementRef'])
8104
+ progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8093
8105
  }
8094
8106
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
8095
8107
  taskbarInnerDiv[0].appendChild([].slice.call(progressDiv)[0]);
@@ -8663,10 +8675,10 @@ class ChartRows extends DateProcessor {
8663
8675
  'width:' + data.ganttProperties.progressWidth + 'px;' +
8664
8676
  'border-top-right-radius:' + this.getBorderRadius(data) + 'px;' +
8665
8677
  'border-bottom-right-radius:' + this.getBorderRadius(data) + 'px;height:100%;"></div>');
8678
+ let div = createElement('div');
8666
8679
  if (this.taskLabelTemplateFunction) {
8667
8680
  const parentTaskLabelNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressBarInnerDiv[0]);
8668
8681
  if (parentTaskLabelNode && parentTaskLabelNode.length > 0) {
8669
- const div = createElement('div');
8670
8682
  div.appendChild(parentTaskLabelNode[0]);
8671
8683
  labelString = div.innerHTML;
8672
8684
  }
@@ -8676,23 +8688,35 @@ class ChartRows extends DateProcessor {
8676
8688
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8677
8689
  }
8678
8690
  if (labelString !== 'null') {
8691
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8692
+ labelString = '';
8693
+ }
8679
8694
  if (isNaN(parseInt(labelString))) {
8680
- labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
8695
+ labelDiv = '<span class="' + taskLabel + '" style="line-height:' +
8681
8696
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
8682
8697
  'display:' + 'inline-block;' +
8683
8698
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8684
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8699
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8685
8700
  }
8686
8701
  else {
8687
- labelDiv = this.createDivElement('<span class="' +
8702
+ labelDiv = '<span class="' +
8688
8703
  taskLabel + '" style="line-height:' +
8689
8704
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8690
8705
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8691
8706
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
8692
8707
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8693
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8708
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8694
8709
  }
8695
- progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
8710
+ let labelElement = this.createDivElement(labelDiv)[0];
8711
+ labelElement.appendChild(div);
8712
+ progressBarInnerDiv[0].appendChild(labelElement);
8713
+ let parentLabel = this.parent.labelSettings.taskLabel;
8714
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8715
+ !this.isTemplate(parentLabel))
8716
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8717
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8718
+ parentLabel && !parentLabel['elementRef'])
8719
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
8696
8720
  }
8697
8721
  const milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
8698
8722
  '<div class="' + parentMilestoneTop + '" style="border-right-width:' +
@@ -9519,6 +9543,18 @@ class ChartRows extends DateProcessor {
9519
9543
  }
9520
9544
  getResourceParent(record) {
9521
9545
  const chartRows = this.parent.ganttChartModule.getChartRows();
9546
+ //Below code is for rendering taskbartemplate in resource view with multi taskbar
9547
+ if (this.parent.initialChartRowElements) {
9548
+ for (let j = 0; j <= this.parent.initialChartRowElements.length; j++) {
9549
+ if (!isNullOrUndefined(chartRows[j])) {
9550
+ if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
9551
+ !isNullOrUndefined(this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2])) {
9552
+ // eslint-disable-next-line
9553
+ chartRows[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'] = this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'];
9554
+ }
9555
+ }
9556
+ }
9557
+ }
9522
9558
  this.templateData = record;
9523
9559
  const parentTrNode = this.getTableTrNode();
9524
9560
  const leftLabelNode = this.leftLabelContainer();
@@ -12953,6 +12989,7 @@ let Gantt = class Gantt extends Component {
12953
12989
  this.getCurrentRecords(args);
12954
12990
  }
12955
12991
  this.notify('recordsUpdated', {});
12992
+ this.initialChartRowElements = this.ganttChartModule.getChartRows();
12956
12993
  this.isLoad = false;
12957
12994
  this.trigger('dataBound', args);
12958
12995
  }
@@ -18292,6 +18329,13 @@ class DialogEdit {
18292
18329
  dialogModel.target = document.body;
18293
18330
  dialogModel.close = this.dialogClose.bind(this);
18294
18331
  dialogModel.closeOnEscape = true;
18332
+ dialogModel.beforeClose = function (args) {
18333
+ if (args.closedBy == "escape") {
18334
+ if (args.event.name == "key-pressed" && args.event.target.nodeName == 'INPUT') {
18335
+ args.cancel = true;
18336
+ }
18337
+ }
18338
+ };
18295
18339
  dialogModel.open = (args) => {
18296
18340
  const dialogElement = getValue('element', args);
18297
18341
  const generalTabElement = dialogElement.querySelector('#' + this.parent.element.id + 'GeneralTabContainer');
@@ -18576,6 +18620,8 @@ class DialogEdit {
18576
18620
  }
18577
18621
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
18578
18622
  document.getElementById(id).ej2_instances[0].refresh();
18623
+ let notesTabElement = document.querySelector('#' + this.parent.element.id + 'NotesTabContainer');
18624
+ notesTabElement.style.overflow = 'scroll';
18579
18625
  }
18580
18626
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
18581
18627
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {