@syncfusion/ej2-gantt 19.4.52 → 19.4.55

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.
@@ -478,7 +478,8 @@ class DateProcessor {
478
478
  calculateDuration(ganttData) {
479
479
  const ganttProperties = ganttData.ganttProperties;
480
480
  let tDuration;
481
- if (!isNullOrUndefined(ganttProperties.segments) && ganttProperties.segments.length > 0) {
481
+ if (!isNullOrUndefined(ganttProperties.segments) && ganttProperties.segments.length > 0 &&
482
+ !isNullOrUndefined(this.parent.editModule.taskbarEditModule)) {
482
483
  tDuration = this.parent.editModule.taskbarEditModule.sumOfDuration(ganttProperties.segments);
483
484
  }
484
485
  else {
@@ -6519,7 +6520,7 @@ class Timeline {
6519
6520
  const validStartLeft = this.parent.dataOperation.getTaskLeft(validStartDate, false);
6520
6521
  const validEndLeft = this.parent.dataOperation.getTaskLeft(validEndDate, false);
6521
6522
  let isChanged;
6522
- if (!isNullOrUndefined(maxStartLeft) && (maxStartLeft <= this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
6523
+ if (!isNullOrUndefined(maxStartLeft) && (maxStartLeft < this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
6523
6524
  isChanged = 'prevTimeSpan';
6524
6525
  minStartDate = minStartDate > this.timelineStartDate ? this.timelineStartDate : minStartDate;
6525
6526
  }
@@ -7945,7 +7946,7 @@ class ChartRows extends DateProcessor {
7945
7946
  let childTaskbarNode = null;
7946
7947
  const data = this.templateData;
7947
7948
  if (this.childTaskbarTemplateFunction) {
7948
- childTaskbarNode = this.childTaskbarTemplateFunction(extend({ index: i }, data), this.parent, 'TaskbarTemplate', this.getTemplateID('TaskbarTemplate'), false, undefined, rootElement[0]);
7949
+ childTaskbarNode = this.childTaskbarTemplateFunction(extend({ index: i }, data), this.parent, 'TaskbarTemplate', this.getTemplateID('TaskbarTemplate'), false, undefined, rootElement[0], this.parent.treeGrid['root']);
7949
7950
  }
7950
7951
  else {
7951
7952
  let labelString = '';
@@ -7980,11 +7981,20 @@ class ChartRows extends DateProcessor {
7980
7981
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
7981
7982
  }
7982
7983
  if (labelString !== 'null') {
7983
- taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
7984
- (this.taskBarHeight - 1) + 'px; text-align: left;' +
7985
- 'display:' + 'inline-block;' +
7986
- 'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
7987
- this.taskBarHeight + 'px;">' + labelString + '</span>';
7984
+ if (isNaN(parseInt(labelString))) {
7985
+ taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
7986
+ (this.taskBarHeight - 1) + 'px; text-align: left;' +
7987
+ 'display:' + 'inline-block;' +
7988
+ 'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
7989
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
7990
+ }
7991
+ else {
7992
+ taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
7993
+ (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.viewType === 'ResourceView' ? 'left;' : ';') +
7994
+ 'display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') +
7995
+ 'width:' + (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
7996
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
7997
+ }
7988
7998
  }
7989
7999
  const template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
7990
8000
  this.splitTaskbar(data, labelString) : (data.ganttProperties.startDate && data.ganttProperties.endDate
@@ -8375,7 +8385,7 @@ class ChartRows extends DateProcessor {
8375
8385
  let milestoneNode = null;
8376
8386
  const data = this.templateData;
8377
8387
  if (this.milestoneTemplateFunction) {
8378
- milestoneNode = this.milestoneTemplateFunction(extend({ index: i }, data), this.parent, 'MilestoneTemplate', this.getTemplateID('MilestoneTemplate'), false, undefined, rootElement[0]);
8388
+ milestoneNode = this.milestoneTemplateFunction(extend({ index: i }, data), this.parent, 'MilestoneTemplate', this.getTemplateID('MilestoneTemplate'), false, undefined, rootElement[0], this.parent.treeGrid['root']);
8379
8389
  }
8380
8390
  else {
8381
8391
  const template = '<div class="' + traceMilestone + '" style="position:absolute;">' +
@@ -8446,7 +8456,7 @@ class ChartRows extends DateProcessor {
8446
8456
  leftLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('left'));
8447
8457
  let leftLabelTemplateNode = null;
8448
8458
  if (this.leftTaskLabelTemplateFunction) {
8449
- leftLabelTemplateNode = this.leftTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'LeftLabelTemplate', this.getTemplateID('LeftLabelTemplate'), false, undefined, leftLabelNode[0]);
8459
+ leftLabelTemplateNode = this.leftTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'LeftLabelTemplate', this.getTemplateID('LeftLabelTemplate'), false, undefined, leftLabelNode[0], this.parent.treeGrid['root']);
8450
8460
  }
8451
8461
  else {
8452
8462
  const field = this.parent.labelSettings.leftLabel;
@@ -8457,6 +8467,9 @@ class ChartRows extends DateProcessor {
8457
8467
  }
8458
8468
  }
8459
8469
  if (leftLabelTemplateNode && leftLabelTemplateNode.length > 0) {
8470
+ if (leftLabelTemplateNode[0]['data'] === 'null') {
8471
+ leftLabelTemplateNode[0]['data'] = '';
8472
+ }
8460
8473
  leftLabelNode[0].appendChild([].slice.call(leftLabelTemplateNode)[0]);
8461
8474
  }
8462
8475
  return leftLabelNode;
@@ -8486,7 +8499,7 @@ class ChartRows extends DateProcessor {
8486
8499
  rightLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('right'));
8487
8500
  let rightLabelTemplateNode = null;
8488
8501
  if (this.rightTaskLabelTemplateFunction) {
8489
- rightLabelTemplateNode = this.rightTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'RightLabelTemplate', this.getTemplateID('RightLabelTemplate'), false, undefined, rightLabelNode[0]);
8502
+ rightLabelTemplateNode = this.rightTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'RightLabelTemplate', this.getTemplateID('RightLabelTemplate'), false, undefined, rightLabelNode[0], this.parent.treeGrid['root']);
8490
8503
  }
8491
8504
  else {
8492
8505
  const field = this.parent.labelSettings.rightLabel;
@@ -8497,6 +8510,9 @@ class ChartRows extends DateProcessor {
8497
8510
  }
8498
8511
  }
8499
8512
  if (rightLabelTemplateNode && rightLabelTemplateNode.length > 0) {
8513
+ if (rightLabelTemplateNode[0]['data'] === 'null') {
8514
+ rightLabelTemplateNode[0]['data'] = '';
8515
+ }
8500
8516
  rightLabelNode[0].appendChild([].slice.call(rightLabelTemplateNode)[0]);
8501
8517
  }
8502
8518
  return rightLabelNode;
@@ -8551,7 +8567,7 @@ class ChartRows extends DateProcessor {
8551
8567
  let parentTaskbarNode = null;
8552
8568
  const data = this.templateData;
8553
8569
  if (this.parentTaskbarTemplateFunction) {
8554
- parentTaskbarNode = this.parentTaskbarTemplateFunction(extend({ index: i }, data), this.parent, 'ParentTaskbarTemplate', this.getTemplateID('ParentTaskbarTemplate'), false, undefined, rootElement[0]);
8570
+ parentTaskbarNode = this.parentTaskbarTemplateFunction(extend({ index: i }, data), this.parent, 'ParentTaskbarTemplate', this.getTemplateID('ParentTaskbarTemplate'), false, undefined, rootElement[0], this.parent.treeGrid['root']);
8555
8571
  }
8556
8572
  else {
8557
8573
  let labelString = '';
@@ -8583,11 +8599,20 @@ class ChartRows extends DateProcessor {
8583
8599
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8584
8600
  }
8585
8601
  if (labelString !== 'null') {
8586
- labelDiv = this.createDivElement('<span class="' +
8587
- taskLabel + '" style="line-height:' +
8588
- (this.taskBarHeight - 1) + 'px; display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : '') + 'width:' +
8589
- (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
8590
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8602
+ if (isNaN(parseInt(labelString))) {
8603
+ labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
8604
+ (this.taskBarHeight - 1) + 'px; text-align: left;' +
8605
+ 'display:' + 'inline-block;' +
8606
+ 'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8607
+ this.taskBarHeight + 'px;">' + labelString + '</span>');
8608
+ }
8609
+ else {
8610
+ labelDiv = this.createDivElement('<span class="' +
8611
+ taskLabel + '" style="line-height:' +
8612
+ (this.taskBarHeight - 1) + 'px; display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') + 'width:' +
8613
+ (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : ';') + 'px; height:' +
8614
+ this.taskBarHeight + 'px;">' + labelString + '</span>');
8615
+ }
8591
8616
  progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
8592
8617
  }
8593
8618
  const milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
@@ -8656,10 +8681,19 @@ class ChartRows extends DateProcessor {
8656
8681
  }
8657
8682
  isTemplate(template) {
8658
8683
  let result = false;
8684
+ for (let i = 0; i < this.parent.ganttColumns.length; i++) {
8685
+ if (template === this.parent.ganttColumns[i].field) {
8686
+ result = true;
8687
+ break;
8688
+ }
8689
+ }
8659
8690
  if (typeof template !== 'string' || template.indexOf('#') === 0 || template.indexOf('<') > -1
8660
- || template.indexOf('$') > -1) {
8691
+ || template.indexOf('$') > -1 || !result) {
8661
8692
  result = true;
8662
8693
  }
8694
+ else {
8695
+ result = false;
8696
+ }
8663
8697
  return result;
8664
8698
  }
8665
8699
  /**
@@ -8674,7 +8708,7 @@ class ChartRows extends DateProcessor {
8674
8708
  leftLabelContainer() {
8675
8709
  const template = '<div class="' + ((this.leftTaskLabelTemplateFunction) ? leftLabelTempContainer :
8676
8710
  leftLabelContainer) + ' ' + '" tabindex="-1" style="height:' +
8677
- (this.parent.rowHeight - 1) + 'px;width:' + this.taskNameWidth(this.templateData) + '"></div>';
8711
+ (this.parent.rowHeight - 2) + 'px;width:' + this.taskNameWidth(this.templateData) + '"></div>';
8678
8712
  return this.createDivElement(template);
8679
8713
  }
8680
8714
  taskbarContainer() {
@@ -8697,7 +8731,7 @@ class ChartRows extends DateProcessor {
8697
8731
  rightLabelContainer() {
8698
8732
  const template = '<div class="' + ((this.rightTaskLabelTemplateFunction) ? rightLabelTempContainer :
8699
8733
  rightLabelContainer) + '" ' + ' tabindex="-1" style="left:' + this.getRightLabelLeft(this.templateData) + 'px;height:'
8700
- + (this.parent.rowHeight - 1) + 'px;"></div>';
8734
+ + (this.parent.rowHeight - 2) + 'px;"></div>';
8701
8735
  return this.createDivElement(template);
8702
8736
  }
8703
8737
  childTaskbarLeftResizer() {
@@ -15620,7 +15654,8 @@ class CellEdit {
15620
15654
  if (!ganttRecord.ganttProperties.isAutoSchedule) {
15621
15655
  this.parent.setRecordValue('autoWidth', this.parent.dataOperation.calculateWidth(ganttRecord, false), ganttRecord.ganttProperties, true);
15622
15656
  }
15623
- if (!isNullOrUndefined(args.data.ganttProperties.segments) && args.data.ganttProperties.segments.length > 0) {
15657
+ if (!isNullOrUndefined(args.data.ganttProperties.segments) && args.data.ganttProperties.segments.length > 0 &&
15658
+ !isNullOrUndefined(this.parent.editModule.taskbarEditModule)) {
15624
15659
  this.parent.editModule.taskbarEditModule.updateSegmentProgress(args.data.ganttProperties);
15625
15660
  }
15626
15661
  if (!args.data.hasChildRecords) {
@@ -24854,7 +24889,9 @@ class Selection$1 {
24854
24889
  }
24855
24890
  this.addRemoveClass(index);
24856
24891
  this.selectedRowIndexes = extend([], this.getSelectedRowIndexes(), [], true);
24857
- this.parent.setProperties({ selectedRowIndex: -1 }, true);
24892
+ if (this.selectedRowIndexes.length == 0) {
24893
+ this.parent.setProperties({ selectedRowIndex: -1 }, true);
24894
+ }
24858
24895
  if (!isNullOrUndefined(this.parent.toolbarModule)) {
24859
24896
  this.parent.toolbarModule.refreshToolbarItems();
24860
24897
  }
@@ -27088,7 +27125,13 @@ class RowDD$1 {
27088
27125
  }
27089
27126
  else {
27090
27127
  startIndex = droppedRecord.index;
27091
- endIndex = draggedRecord.index;
27128
+ let rootChildRecord = draggedRecord;
27129
+ if (rootChildRecord.childRecords.length > 0) {
27130
+ do {
27131
+ rootChildRecord = rootChildRecord.childRecords[rootChildRecord.childRecords.length - 1];
27132
+ } while (rootChildRecord.childRecords.length > 0);
27133
+ }
27134
+ endIndex = rootChildRecord.index;
27092
27135
  }
27093
27136
  for (let i = startIndex; i <= endIndex; i++) {
27094
27137
  if (!isNullOrUndefined(data[i])) {