@syncfusion/ej2-gantt 23.1.36 → 23.1.38

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.
@@ -4079,7 +4079,7 @@ const chartRowCell = 'e-chart-row-cell';
4079
4079
  const chartRow = 'e-chart-row';
4080
4080
  const rowExpand = 'e-row-expand';
4081
4081
  const rowCollapse = 'e-row-collapse';
4082
- const collapseParent = 'e-collapse-parent';
4082
+
4083
4083
  const taskBarLeftResizer = 'e-taskbar-left-resizer';
4084
4084
  const taskBarRightResizer = 'e-taskbar-right-resizer';
4085
4085
  const childProgressResizer = 'e-child-progress-resizer';
@@ -5403,6 +5403,12 @@ class GanttChart {
5403
5403
  else {
5404
5404
  this.isCollapseAll = true;
5405
5405
  this.parent.treeGrid.collapseAll();
5406
+ if (this.isCollapseAll && !this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView') {
5407
+ let treeGridContentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
5408
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
5409
+ this.parent.contentHeight = treeGridContentHeight;
5410
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
5411
+ }
5406
5412
  }
5407
5413
  this.isExpandAll = false;
5408
5414
  this.isCollapseAll = false;
@@ -9643,7 +9649,7 @@ class ChartRows extends DateProcessor {
9643
9649
  let baselineMilestoneHeight = this.parent.renderBaseline ? 5 : 2;
9644
9650
  const template = '<div class="' + baselineMilestoneContainer + '" style="width:' + ((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 10)) + 'px;height:' +
9645
9651
  ((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 10)) + 'px;position:absolute;transform:rotate(45deg);' + (this.parent.enableRtl ? 'right:' : 'left:') + (this.parent.enableRtl ? (data.ganttProperties.left -
9646
- (this.milestoneHeight / 2) + 3) : (data.ganttProperties.left - (this.milestoneHeight / 2) + 1)) + 'px;' + (this.baselineColor ? 'background-color: ' + this.baselineColor + ';' : '') + 'margin-top:' + ((-Math.floor(this.parent.rowHeight - this.milestoneMarginTop) + baselineMilestoneHeight) + 2) + 'px"> </div>';
9652
+ (this.milestoneHeight / 2) + 3) : (data.ganttProperties.baselineLeft - (this.milestoneHeight / 2) + 1)) + 'px;' + (this.baselineColor ? 'background-color: ' + this.baselineColor + ';' : '') + 'margin-top:' + ((-Math.floor(this.parent.rowHeight - this.milestoneMarginTop) + baselineMilestoneHeight) + 2) + 'px"> </div>';
9647
9653
  return this.createDivElement(template);
9648
9654
  }
9649
9655
  /**
@@ -10615,7 +10621,7 @@ class ChartRows extends DateProcessor {
10615
10621
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor;
10616
10622
  args.taskbarBorderColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(traceChildTaskBar) ?
10617
10623
  getComputedStyle(taskbarElement).backgroundColor :
10618
- getComputedStyle(taskbarElement.querySelector(classCollections[0])).borderColor;
10624
+ getComputedStyle(taskbarElement.querySelector(classCollections[0])).outlineColor;
10619
10625
  args.progressBarBgColor = isNullOrUndefined(progressTask) ? null :
10620
10626
  taskbarElement.classList.contains(traceChildProgressBar) ?
10621
10627
  getComputedStyle(taskbarElement).backgroundColor :
@@ -10664,7 +10670,7 @@ class ChartRows extends DateProcessor {
10664
10670
  */
10665
10671
  updateQueryTaskbarInfoArgs(args, rowElement, taskBarElement) {
10666
10672
  const trElement = args.rowElement;
10667
- const taskbarElement = args.taskbarElement;
10673
+ const taskbarElement = this.parent.enableVirtualization ? args.rowElement : args.taskbarElement;
10668
10674
  const classCollections = this.getClassName(args);
10669
10675
  let segmentRowElement;
10670
10676
  if (args.data.ganttProperties.segments && args.data.ganttProperties.segments.length > 0) {
@@ -10685,18 +10691,6 @@ class ChartRows extends DateProcessor {
10685
10691
  }
10686
10692
  }
10687
10693
  else if (taskbarElement) {
10688
- if (taskbarElement && this.parent.enableVirtualization && !args.data.expanded) {
10689
- const childElement = trElement.querySelector('.' + collapseParent);
10690
- if (childElement) {
10691
- for (let i = 0; i < childElement.childNodes.length; i++) {
10692
- const taskbar = childElement.childNodes[i];
10693
- const mainTaskbar = taskbar.querySelector('.' + traceChildTaskBar);
10694
- if (mainTaskbar) {
10695
- mainTaskbar.style.backgroundColor = args.taskbarBgColor;
10696
- }
10697
- }
10698
- }
10699
- }
10700
10694
  if (taskbarElement.querySelector(classCollections[0]) &&
10701
10695
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
10702
10696
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -10922,8 +10916,7 @@ class ChartRows extends DateProcessor {
10922
10916
  if (!this.parent.ganttChartModule.isExpandAll && !this.parent.ganttChartModule.isCollapseAll) {
10923
10917
  this.parent.treeGrid.grid.setRowData(dataId, data);
10924
10918
  }
10925
- if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap &&
10926
- !this.parent.ganttChartModule.isCollapseAll && !this.parent.ganttChartModule.isExpandAll) {
10919
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap) {
10927
10920
  this.updateDragDropRecords(selectedItem, tr);
10928
10921
  }
10929
10922
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
@@ -10946,6 +10939,10 @@ class ChartRows extends DateProcessor {
10946
10939
  addClass([cloneElement], 'collpse-parent-border');
10947
10940
  const id = tRow.querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
10948
10941
  const ganttData = this.parent.getRecordByID(id);
10942
+ const mainTaskbar = (cloneElement.querySelector('.e-gantt-child-taskbar'));
10943
+ if (this.parent.queryTaskbarInfo) {
10944
+ this.triggerQueryTaskbarInfoByIndex(mainTaskbar, ganttData);
10945
+ }
10949
10946
  let zIndex = "";
10950
10947
  if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
10951
10948
  zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
@@ -11233,15 +11230,58 @@ class Dependency {
11233
11230
  const predecessor = predecessorValue.toString();
11234
11231
  const collection = [];
11235
11232
  let match;
11236
- let values;
11233
+ let values = [];
11237
11234
  let offsetValue;
11238
11235
  let predecessorText;
11239
11236
  predecessor.split(',').forEach((el) => {
11240
- values = el.split('+');
11241
- offsetValue = '+';
11242
- if (el.indexOf('-') >= 0) {
11243
- values = el.split('-');
11244
- offsetValue = '-';
11237
+ let isGUId = false;
11238
+ var regex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
11239
+ let elSplit = el.split('-');
11240
+ let id;
11241
+ if (elSplit.length === 6) {
11242
+ elSplit[4] = elSplit[4] + '-' + elSplit[5];
11243
+ elSplit.pop();
11244
+ }
11245
+ if (elSplit.length === 5 && elSplit[4].length > 12) {
11246
+ id = el.substring(0, 36);
11247
+ if (regex.test(id)) {
11248
+ isGUId = true;
11249
+ }
11250
+ }
11251
+ if (isGUId) {
11252
+ let split;
11253
+ split = elSplit[4].split('+');
11254
+ let spliceLength;
11255
+
11256
+ if (split.length === 1) {
11257
+ values[0] = el;
11258
+ }
11259
+ else {
11260
+ spliceLength = split[1].length;
11261
+ values[0] = el.slice(0, -(spliceLength + 1));
11262
+ values[1] = split[1];
11263
+ }
11264
+ offsetValue = '+';
11265
+ if (elSplit[4].indexOf('-') >= 0) {
11266
+ split = elSplit[4].split('-');
11267
+ if (split.length === 1) {
11268
+ values[0] = el;
11269
+ }
11270
+ else {
11271
+ spliceLength = split[1].length;
11272
+ values[0] = el.slice(0, -(spliceLength + 1));
11273
+ values[1] = split[1];
11274
+ }
11275
+ offsetValue = '-';
11276
+ }
11277
+ }
11278
+ else {
11279
+ values = el.split('+');
11280
+ offsetValue = '+';
11281
+ if (el.indexOf('-') >= 0) {
11282
+ values = el.split('-');
11283
+ offsetValue = '-';
11284
+ }
11245
11285
  }
11246
11286
  match = [];
11247
11287
  const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
@@ -11965,6 +12005,7 @@ class ConnectorLine {
11965
12005
  this.transform = '';
11966
12006
  this.connectorLinePath = '';
11967
12007
  this.arrowPath = '';
12008
+ this.taskLineValue = 0;
11968
12009
  this.expandedRecords = [];
11969
12010
  this.parent = ganttObj;
11970
12011
  this.dependencyViewContainer =
@@ -12803,10 +12844,10 @@ class ConnectorLine {
12803
12844
  * @private
12804
12845
  */
12805
12846
  getConnectorLineTooltipInnerTd(fromTaskName, fromPredecessorText, toTaskName, toPredecessorText) {
12806
- let innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
12847
+ let innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;width: 30px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
12807
12848
  innerTd = innerTd + fromTaskName + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(fromPredecessorText) + ' </td> </tr>';
12808
12849
  innerTd = innerTd + '<tr id="toPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('to') + '</td><td> ' + toTaskName;
12809
- innerTd = innerTd + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
12850
+ innerTd = innerTd + ' </td><td style="padding: 2px;width: 30px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
12810
12851
  return innerTd;
12811
12852
  }
12812
12853
  /**
@@ -12977,6 +13018,7 @@ class Splitter$1 {
12977
13018
  const leftPane = args.pane[0];
12978
13019
  this.splitterPreviousPositionGrid = leftPane.scrollWidth + 1 + 'px';
12979
13020
  this.splitterObject.paneSettings[0].size = this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid);
13021
+ this.splitterObject.paneSettings[1].size = (this.parent.ganttWidth - parseInt(this.splitterPreviousPositionGrid) - 4) + 'px';
12980
13022
  const callBackPromise = new Deferred();
12981
13023
  this.parent.trigger('splitterResized', args, (splitterResizedArgs) => {
12982
13024
  if (splitterResizedArgs.cancel === true) {
@@ -14696,8 +14738,6 @@ let Gantt = class Gantt extends Component {
14696
14738
  removeClass(ganttChartElement.querySelectorAll('.e-critical-milestone'), criticalMilestone);
14697
14739
  removeClass(this.element.querySelectorAll('.e-connector-line'), criticalConnectorLineSVG);
14698
14740
  removeClass(this.element.querySelectorAll('.e-connector-line-arrow'), criticalConnectorArrowSVG);
14699
- const innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
14700
- innerDivs.style.outlineColor = "";
14701
14741
  }
14702
14742
  wireEvents() {
14703
14743
  if (this.allowKeyboard) {
@@ -14743,10 +14783,12 @@ let Gantt = class Gantt extends Component {
14743
14783
  const pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
14744
14784
  this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
14745
14785
  this.splitterModule.splitterPreviousPositionChart = pane2.scrollWidth + 1 + 'px';
14746
- this.splitterModule.splitterObject.paneSettings[0].size = this.splitterModule['getSpliterPositionInPercentage'](this.splitterModule.splitterPreviousPositionGrid);
14747
- this.splitterModule.splitterObject.paneSettings[1].size = this.splitterModule.splitterPreviousPositionChart;
14786
+ this.splitterModule.splitterObject.paneSettings[1].size = (this.ganttWidth - parseInt(this.splitterModule.splitterPreviousPositionGrid) - 4) + 'px';
14787
+ let proxy = this;
14748
14788
  if (this.timelineModule.isZoomToFit) {
14749
- this.timelineModule.processZoomToFit();
14789
+ setTimeout(() => {
14790
+ proxy.timelineModule.processZoomToFit();
14791
+ }, 0);
14750
14792
  }
14751
14793
  }
14752
14794
  }
@@ -18785,7 +18827,12 @@ class TaskbarEdit extends DateProcessor {
18785
18827
  }
18786
18828
  // eslint-disable-next-line
18787
18829
  mouseLeaveHandler(e) {
18788
- this.dragMouseLeave = true;
18830
+ if (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" || this.taskBarEditAction === "ProgressResizing" || this.taskBarEditAction === "LeftResizing" || this.taskBarEditAction === "RightResizing") {
18831
+ this.dragMouseLeave = false;
18832
+ }
18833
+ else {
18834
+ this.dragMouseLeave = true;
18835
+ }
18789
18836
  }
18790
18837
  /**
18791
18838
  * To update taskbar edited elements on mouse down action.
@@ -20046,7 +20093,7 @@ class TaskbarEdit extends DateProcessor {
20046
20093
  const milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
20047
20094
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
20048
20095
  /* To render the milestone in proper date while editing */
20049
- if (isMilestone && !isNullOrUndefined(property.predecessor) && property.predecessor.length > 0) {
20096
+ if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
20050
20097
  pStartDate.setDate(pStartDate.getDate() - 1);
20051
20098
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
20052
20099
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
@@ -23002,7 +23049,7 @@ class DialogEdit {
23002
23049
  tasksData[fieldName] = column.edit.read(inputElement, controlObj.value);
23003
23050
  }
23004
23051
  }
23005
- else if (isCustom && column.editType === 'booleanedit') {
23052
+ else if (column.editType === 'booleanedit') {
23006
23053
  if (inputElement instanceof HTMLInputElement && inputElement.checked === true) {
23007
23054
  tasksData[fieldName] = true;
23008
23055
  }
@@ -23336,14 +23383,55 @@ class ConnectorLineEdit {
23336
23383
  idFromPredecessor(pre) {
23337
23384
  const preArray = pre.split(',');
23338
23385
  const preIdArray = [];
23339
- let values;
23386
+ let values = [];
23340
23387
  let match = [];
23341
23388
  for (let j = 0; j < preArray.length; j++) {
23342
23389
  const strArray = [];
23343
- values = preArray[j].split('+');
23344
- if (preArray[j].indexOf('-') >= 0) {
23345
- values = preArray[j].split('-');
23346
-
23390
+ let isGUId = false;
23391
+ var regex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
23392
+ let elSplit = preArray[j].split('-');
23393
+ let id;
23394
+ if (elSplit.length === 6) {
23395
+ elSplit[4] = elSplit[4] + '-' + elSplit[5];
23396
+ elSplit.pop();
23397
+ }
23398
+ if (elSplit.length === 5 && elSplit[4].length > 12) {
23399
+ id = preArray[j].substring(0, 36);
23400
+ if (regex.test(id)) {
23401
+ isGUId = true;
23402
+ }
23403
+ }
23404
+ if (isGUId) {
23405
+ let split;
23406
+ split = elSplit[4].split('+');
23407
+ let spliceLength;
23408
+ if (split.length === 1) {
23409
+ values[0] = preArray[j];
23410
+ }
23411
+ else {
23412
+ spliceLength = split[1].length;
23413
+ values[0] = preArray[j].slice(0, -(spliceLength + 1));
23414
+ values[1] = split[1];
23415
+ }
23416
+ if (elSplit[4].indexOf('-') >= 0) {
23417
+ split = elSplit[4].split('-');
23418
+ if (split.length === 1) {
23419
+ values[0] = preArray[j];
23420
+ }
23421
+ else {
23422
+ spliceLength = split[1].length;
23423
+ values[0] = preArray[j].slice(0, -(spliceLength + 1));
23424
+ values[1] = split[1];
23425
+ }
23426
+
23427
+ }
23428
+ }
23429
+ else {
23430
+ values = preArray[j].split('+');
23431
+ if (preArray[j].indexOf('-') >= 0) {
23432
+ values = preArray[j].split('-');
23433
+
23434
+ }
23347
23435
  }
23348
23436
  if (!isNullOrUndefined(values[0])) {
23349
23437
  const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
@@ -27080,6 +27168,9 @@ class Edit$2 {
27080
27168
  this.parent.flatData[this.parent.getTaskIds().indexOf('T' + args.data[tasks.id])] : this.parent.getRecordByID(args.data[tasks.id]);
27081
27169
  if (!isNullOrUndefined(ganttData)) {
27082
27170
  this.validateUpdateValues(args.newTaskData, ganttData, true);
27171
+ this.parent.dateValidationModule.calculateEndDate(ganttData);
27172
+ this.parent.dataOperation.updateWidthLeft(ganttData);
27173
+ this.parent.dataOperation.updateParentItems(ganttData);
27083
27174
  }
27084
27175
  if (!isNullOrUndefined(args.data[`${tempTaskID}`])) {
27085
27176
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
@@ -30840,8 +30931,6 @@ class CriticalPath {
30840
30931
  }
30841
30932
  if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
30842
30933
  addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
30843
- const innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
30844
- innerDivs.style.outlineColor = "";
30845
30934
  }
30846
30935
  if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
30847
30936
  addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);