@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.
@@ -4131,7 +4131,7 @@ var chartRowCell = 'e-chart-row-cell';
4131
4131
  var chartRow = 'e-chart-row';
4132
4132
  var rowExpand = 'e-row-expand';
4133
4133
  var rowCollapse = 'e-row-collapse';
4134
- var collapseParent = 'e-collapse-parent';
4134
+
4135
4135
  var taskBarLeftResizer = 'e-taskbar-left-resizer';
4136
4136
  var taskBarRightResizer = 'e-taskbar-right-resizer';
4137
4137
  var childProgressResizer = 'e-child-progress-resizer';
@@ -5457,6 +5457,12 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5457
5457
  else {
5458
5458
  this.isCollapseAll = true;
5459
5459
  this.parent.treeGrid.collapseAll();
5460
+ if (this.isCollapseAll && !this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView') {
5461
+ var treeGridContentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
5462
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
5463
+ this.parent.contentHeight = treeGridContentHeight;
5464
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
5465
+ }
5460
5466
  }
5461
5467
  this.isExpandAll = false;
5462
5468
  this.isCollapseAll = false;
@@ -10056,7 +10062,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
10056
10062
  var baselineMilestoneHeight = this.parent.renderBaseline ? 5 : 2;
10057
10063
  var template = '<div class="' + baselineMilestoneContainer + '" style="width:' + ((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 10)) + 'px;height:' +
10058
10064
  ((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 -
10059
- (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>';
10065
+ (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>';
10060
10066
  return this.createDivElement(template);
10061
10067
  };
10062
10068
  /**
@@ -11031,7 +11037,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11031
11037
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor;
11032
11038
  args.taskbarBorderColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(traceChildTaskBar) ?
11033
11039
  getComputedStyle(taskbarElement).backgroundColor :
11034
- getComputedStyle(taskbarElement.querySelector(classCollections[0])).borderColor;
11040
+ getComputedStyle(taskbarElement.querySelector(classCollections[0])).outlineColor;
11035
11041
  args.progressBarBgColor = isNullOrUndefined(progressTask) ? null :
11036
11042
  taskbarElement.classList.contains(traceChildProgressBar) ?
11037
11043
  getComputedStyle(taskbarElement).backgroundColor :
@@ -11080,7 +11086,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11080
11086
  */
11081
11087
  ChartRows.prototype.updateQueryTaskbarInfoArgs = function (args, rowElement, taskBarElement) {
11082
11088
  var trElement = args.rowElement;
11083
- var taskbarElement = args.taskbarElement;
11089
+ var taskbarElement = this.parent.enableVirtualization ? args.rowElement : args.taskbarElement;
11084
11090
  var classCollections = this.getClassName(args);
11085
11091
  var segmentRowElement;
11086
11092
  if (args.data.ganttProperties.segments && args.data.ganttProperties.segments.length > 0) {
@@ -11101,18 +11107,6 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11101
11107
  }
11102
11108
  }
11103
11109
  else if (taskbarElement) {
11104
- if (taskbarElement && this.parent.enableVirtualization && !args.data.expanded) {
11105
- var childElement = trElement.querySelector('.' + collapseParent);
11106
- if (childElement) {
11107
- for (var i = 0; i < childElement.childNodes.length; i++) {
11108
- var taskbar = childElement.childNodes[i];
11109
- var mainTaskbar = taskbar.querySelector('.' + traceChildTaskBar);
11110
- if (mainTaskbar) {
11111
- mainTaskbar.style.backgroundColor = args.taskbarBgColor;
11112
- }
11113
- }
11114
- }
11115
- }
11116
11110
  if (taskbarElement.querySelector(classCollections[0]) &&
11117
11111
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
11118
11112
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -11338,8 +11332,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11338
11332
  if (!this.parent.ganttChartModule.isExpandAll && !this.parent.ganttChartModule.isCollapseAll) {
11339
11333
  this.parent.treeGrid.grid.setRowData(dataId, data);
11340
11334
  }
11341
- if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap &&
11342
- !this.parent.ganttChartModule.isCollapseAll && !this.parent.ganttChartModule.isExpandAll) {
11335
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap) {
11343
11336
  this.updateDragDropRecords(selectedItem, tr);
11344
11337
  }
11345
11338
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
@@ -11362,6 +11355,10 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11362
11355
  addClass([cloneElement], 'collpse-parent-border');
11363
11356
  var id = tRow.querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
11364
11357
  var ganttData = this.parent.getRecordByID(id);
11358
+ var mainTaskbar = (cloneElement.querySelector('.e-gantt-child-taskbar'));
11359
+ if (this.parent.queryTaskbarInfo) {
11360
+ this.triggerQueryTaskbarInfoByIndex(mainTaskbar, ganttData);
11361
+ }
11365
11362
  var zIndex = "";
11366
11363
  if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
11367
11364
  zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
@@ -11651,15 +11648,58 @@ var Dependency = /** @__PURE__ @class */ (function () {
11651
11648
  var predecessor = predecessorValue.toString();
11652
11649
  var collection = [];
11653
11650
  var match;
11654
- var values;
11651
+ var values = [];
11655
11652
  var offsetValue;
11656
11653
  var predecessorText;
11657
11654
  predecessor.split(',').forEach(function (el) {
11658
- values = el.split('+');
11659
- offsetValue = '+';
11660
- if (el.indexOf('-') >= 0) {
11661
- values = el.split('-');
11662
- offsetValue = '-';
11655
+ var isGUId = false;
11656
+ 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}$/;
11657
+ var elSplit = el.split('-');
11658
+ var id;
11659
+ if (elSplit.length === 6) {
11660
+ elSplit[4] = elSplit[4] + '-' + elSplit[5];
11661
+ elSplit.pop();
11662
+ }
11663
+ if (elSplit.length === 5 && elSplit[4].length > 12) {
11664
+ id = el.substring(0, 36);
11665
+ if (regex.test(id)) {
11666
+ isGUId = true;
11667
+ }
11668
+ }
11669
+ if (isGUId) {
11670
+ var split = void 0;
11671
+ split = elSplit[4].split('+');
11672
+ var spliceLength = void 0;
11673
+
11674
+ if (split.length === 1) {
11675
+ values[0] = el;
11676
+ }
11677
+ else {
11678
+ spliceLength = split[1].length;
11679
+ values[0] = el.slice(0, -(spliceLength + 1));
11680
+ values[1] = split[1];
11681
+ }
11682
+ offsetValue = '+';
11683
+ if (elSplit[4].indexOf('-') >= 0) {
11684
+ split = elSplit[4].split('-');
11685
+ if (split.length === 1) {
11686
+ values[0] = el;
11687
+ }
11688
+ else {
11689
+ spliceLength = split[1].length;
11690
+ values[0] = el.slice(0, -(spliceLength + 1));
11691
+ values[1] = split[1];
11692
+ }
11693
+ offsetValue = '-';
11694
+ }
11695
+ }
11696
+ else {
11697
+ values = el.split('+');
11698
+ offsetValue = '+';
11699
+ if (el.indexOf('-') >= 0) {
11700
+ values = el.split('-');
11701
+ offsetValue = '-';
11702
+ }
11663
11703
  }
11664
11704
  match = [];
11665
11705
  var ids = _this.parent.viewType === 'ResourceView' ? _this.parent.getTaskIds() : _this.parent.ids;
@@ -12386,6 +12426,7 @@ var ConnectorLine = /** @__PURE__ @class */ (function () {
12386
12426
  this.transform = '';
12387
12427
  this.connectorLinePath = '';
12388
12428
  this.arrowPath = '';
12429
+ this.taskLineValue = 0;
12389
12430
  this.expandedRecords = [];
12390
12431
  this.parent = ganttObj;
12391
12432
  this.dependencyViewContainer =
@@ -13224,10 +13265,10 @@ var ConnectorLine = /** @__PURE__ @class */ (function () {
13224
13265
  * @private
13225
13266
  */
13226
13267
  ConnectorLine.prototype.getConnectorLineTooltipInnerTd = function (fromTaskName, fromPredecessorText, toTaskName, toPredecessorText) {
13227
- var innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
13268
+ var innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;width: 30px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
13228
13269
  innerTd = innerTd + fromTaskName + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(fromPredecessorText) + ' </td> </tr>';
13229
13270
  innerTd = innerTd + '<tr id="toPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('to') + '</td><td> ' + toTaskName;
13230
- innerTd = innerTd + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
13271
+ innerTd = innerTd + ' </td><td style="padding: 2px;width: 30px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
13231
13272
  return innerTd;
13232
13273
  };
13233
13274
  /**
@@ -13400,6 +13441,7 @@ var Splitter$1 = /** @__PURE__ @class */ (function () {
13400
13441
  var leftPane = args.pane[0];
13401
13442
  _this.splitterPreviousPositionGrid = leftPane.scrollWidth + 1 + 'px';
13402
13443
  _this.splitterObject.paneSettings[0].size = _this.getSpliterPositionInPercentage(_this.splitterPreviousPositionGrid);
13444
+ _this.splitterObject.paneSettings[1].size = (_this.parent.ganttWidth - parseInt(_this.splitterPreviousPositionGrid) - 4) + 'px';
13403
13445
  var callBackPromise = new Deferred();
13404
13446
  _this.parent.trigger('splitterResized', args, function (splitterResizedArgs) {
13405
13447
  if (splitterResizedArgs.cancel === true) {
@@ -15137,8 +15179,6 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15137
15179
  removeClass(ganttChartElement.querySelectorAll('.e-critical-milestone'), criticalMilestone);
15138
15180
  removeClass(this.element.querySelectorAll('.e-connector-line'), criticalConnectorLineSVG);
15139
15181
  removeClass(this.element.querySelectorAll('.e-connector-line-arrow'), criticalConnectorArrowSVG);
15140
- var innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
15141
- innerDivs.style.outlineColor = "";
15142
15182
  };
15143
15183
  Gantt.prototype.wireEvents = function () {
15144
15184
  if (this.allowKeyboard) {
@@ -15184,10 +15224,12 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15184
15224
  var pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
15185
15225
  this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
15186
15226
  this.splitterModule.splitterPreviousPositionChart = pane2.scrollWidth + 1 + 'px';
15187
- this.splitterModule.splitterObject.paneSettings[0].size = this.splitterModule['getSpliterPositionInPercentage'](this.splitterModule.splitterPreviousPositionGrid);
15188
- this.splitterModule.splitterObject.paneSettings[1].size = this.splitterModule.splitterPreviousPositionChart;
15227
+ this.splitterModule.splitterObject.paneSettings[1].size = (this.ganttWidth - parseInt(this.splitterModule.splitterPreviousPositionGrid) - 4) + 'px';
15228
+ var proxy_1 = this;
15189
15229
  if (this.timelineModule.isZoomToFit) {
15190
- this.timelineModule.processZoomToFit();
15230
+ setTimeout(function () {
15231
+ proxy_1.timelineModule.processZoomToFit();
15232
+ }, 0);
15191
15233
  }
15192
15234
  }
15193
15235
  };
@@ -19266,7 +19308,12 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19266
19308
  };
19267
19309
  // eslint-disable-next-line
19268
19310
  TaskbarEdit.prototype.mouseLeaveHandler = function (e) {
19269
- this.dragMouseLeave = true;
19311
+ if (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" || this.taskBarEditAction === "ProgressResizing" || this.taskBarEditAction === "LeftResizing" || this.taskBarEditAction === "RightResizing") {
19312
+ this.dragMouseLeave = false;
19313
+ }
19314
+ else {
19315
+ this.dragMouseLeave = true;
19316
+ }
19270
19317
  };
19271
19318
  /**
19272
19319
  * To update taskbar edited elements on mouse down action.
@@ -20530,7 +20577,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20530
20577
  var milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
20531
20578
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
20532
20579
  /* To render the milestone in proper date while editing */
20533
- if (isMilestone && !isNullOrUndefined(property.predecessor) && property.predecessor.length > 0) {
20580
+ if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
20534
20581
  pStartDate.setDate(pStartDate.getDate() - 1);
20535
20582
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
20536
20583
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
@@ -23506,7 +23553,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
23506
23553
  tasksData[fieldName] = column.edit.read(inputElement, controlObj.value);
23507
23554
  }
23508
23555
  }
23509
- else if (isCustom && column.editType === 'booleanedit') {
23556
+ else if (column.editType === 'booleanedit') {
23510
23557
  if (inputElement instanceof HTMLInputElement && inputElement.checked === true) {
23511
23558
  tasksData[fieldName] = true;
23512
23559
  }
@@ -23840,14 +23887,55 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
23840
23887
  ConnectorLineEdit.prototype.idFromPredecessor = function (pre) {
23841
23888
  var preArray = pre.split(',');
23842
23889
  var preIdArray = [];
23843
- var values;
23890
+ var values = [];
23844
23891
  var match = [];
23845
23892
  for (var j = 0; j < preArray.length; j++) {
23846
23893
  var strArray = [];
23847
- values = preArray[j].split('+');
23848
- if (preArray[j].indexOf('-') >= 0) {
23849
- values = preArray[j].split('-');
23850
-
23894
+ var isGUId = false;
23895
+ 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}$/;
23896
+ var elSplit = preArray[j].split('-');
23897
+ var id = void 0;
23898
+ if (elSplit.length === 6) {
23899
+ elSplit[4] = elSplit[4] + '-' + elSplit[5];
23900
+ elSplit.pop();
23901
+ }
23902
+ if (elSplit.length === 5 && elSplit[4].length > 12) {
23903
+ id = preArray[j].substring(0, 36);
23904
+ if (regex.test(id)) {
23905
+ isGUId = true;
23906
+ }
23907
+ }
23908
+ if (isGUId) {
23909
+ var split = void 0;
23910
+ split = elSplit[4].split('+');
23911
+ var spliceLength = void 0;
23912
+ if (split.length === 1) {
23913
+ values[0] = preArray[j];
23914
+ }
23915
+ else {
23916
+ spliceLength = split[1].length;
23917
+ values[0] = preArray[j].slice(0, -(spliceLength + 1));
23918
+ values[1] = split[1];
23919
+ }
23920
+ if (elSplit[4].indexOf('-') >= 0) {
23921
+ split = elSplit[4].split('-');
23922
+ if (split.length === 1) {
23923
+ values[0] = preArray[j];
23924
+ }
23925
+ else {
23926
+ spliceLength = split[1].length;
23927
+ values[0] = preArray[j].slice(0, -(spliceLength + 1));
23928
+ values[1] = split[1];
23929
+ }
23930
+
23931
+ }
23932
+ }
23933
+ else {
23934
+ values = preArray[j].split('+');
23935
+ if (preArray[j].indexOf('-') >= 0) {
23936
+ values = preArray[j].split('-');
23937
+
23938
+ }
23851
23939
  }
23852
23940
  if (!isNullOrUndefined(values[0])) {
23853
23941
  var ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
@@ -27629,6 +27717,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
27629
27717
  _this.parent.flatData[_this.parent.getTaskIds().indexOf('T' + args.data[tasks.id])] : _this.parent.getRecordByID(args.data[tasks.id]);
27630
27718
  if (!isNullOrUndefined(ganttData)) {
27631
27719
  _this.validateUpdateValues(args.newTaskData, ganttData, true);
27720
+ _this.parent.dateValidationModule.calculateEndDate(ganttData);
27721
+ _this.parent.dataOperation.updateWidthLeft(ganttData);
27722
+ _this.parent.dataOperation.updateParentItems(ganttData);
27632
27723
  }
27633
27724
  if (!isNullOrUndefined(args.data["" + tempTaskID])) {
27634
27725
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
@@ -31424,8 +31515,6 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
31424
31515
  }
31425
31516
  if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
31426
31517
  addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
31427
- var innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
31428
- innerDivs.style.outlineColor = "";
31429
31518
  }
31430
31519
  if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
31431
31520
  addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);