@syncfusion/ej2-gantt 20.1.50 → 20.1.51

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.
@@ -6158,7 +6158,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6158
6158
  // PDf export collection
6159
6159
  var timelineCell = {};
6160
6160
  timelineCell.startDate = new Date(startDate.getTime());
6161
- if (mode === 'Month' && tier === 'bottomTier' && ((this.parent.currentZoomingLevel.level === 5) || (this.parent.currentZoomingLevel.level === 6)) && scheduleDateCollection.length === 0) {
6161
+ if (mode === 'Month' && tier === 'bottomTier' && (count != 1) && scheduleDateCollection.length === 0) {
6162
6162
  isFirstCell = true;
6163
6163
  }
6164
6164
  parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
@@ -6172,6 +6172,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
6172
6172
  }
6173
6173
  isFirstCell = false;
6174
6174
  startDate.setTime(newTime);
6175
+ if (startDate.getHours() === 5 && count === 2 && tier === 'bottomTier' &&
6176
+ this.parent.timelineSettings.bottomTier.unit === 'Hour') {
6177
+ startDate.setTime(startDate.getTime() - (1000 * 60 * 60));
6178
+ }
6175
6179
  if (startDate >= endDate) {
6176
6180
  /* eslint-disable-next-line */
6177
6181
  parentTr = this.getHeaterTemplateString(scheduleDateCollection[scheduleDateCollection.length - 1], mode, tier, true, count, timelineCell);
@@ -6292,12 +6296,12 @@ var Timeline = /** @__PURE__ @class */ (function () {
6292
6296
  Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count) {
6293
6297
  var date = new Date(firstDay.getTime());
6294
6298
  date.setTime(date.getTime() + increment);
6295
- if (((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
6299
+ if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
6296
6300
  var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
6297
6301
  if (!this.parent.isInDst(date)) {
6298
6302
  increment += (1000 * 60 * 60 * diffCount);
6299
6303
  }
6300
- else if (this.parent.isInDst(date)) {
6304
+ else if (this.parent.isInDst(date) && count !== 2) {
6301
6305
  increment -= (1000 * 60 * 60 * diffCount);
6302
6306
  }
6303
6307
  }
@@ -7053,7 +7057,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7053
7057
  return eventArgs;
7054
7058
  };
7055
7059
  GanttTreeGrid.prototype.treeActionComplete = function (args) {
7056
- var updatedArgs = extend({}, args, true);
7060
+ var updatedArgs = extend({}, args);
7057
7061
  if (getValue('requestType', args) === 'sorting') {
7058
7062
  this.parent.notify('updateModel', {});
7059
7063
  deleteObject(updatedArgs, 'isFrozen');
@@ -8439,8 +8443,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8439
8443
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
8440
8444
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8441
8445
  }
8442
- if (labelString !== 'null') {
8443
- if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8446
+ if (labelString.indexOf('null') === -1) {
8447
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
8444
8448
  labelString = '';
8445
8449
  }
8446
8450
  if (isNaN(parseInt(labelString))) {
@@ -8481,14 +8485,16 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8481
8485
  data.ganttProperties.segments.length === 0))) {
8482
8486
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8483
8487
  var templateElement = this.createDivElement(template)[0];
8484
- templateElement.appendChild(tempDiv);
8485
- progressDiv[0].appendChild(templateElement);
8486
8488
  var childLabel = this.parent.labelSettings.taskLabel;
8489
+ if (childLabel && childLabel['elementRef'])
8490
+ templateElement.appendChild(tempDiv);
8491
+ progressDiv[0].appendChild(templateElement);
8487
8492
  if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8488
- !this.isTemplate(childLabel))
8493
+ !this.isTemplate(childLabel) &&
8494
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0])
8489
8495
  progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8490
8496
  if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8491
- childLabel && !childLabel['elementRef'])
8497
+ childLabel && !childLabel['elementRef'] && tempDiv.innerHTML != '')
8492
8498
  progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8493
8499
  }
8494
8500
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
@@ -9075,8 +9081,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9075
9081
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
9076
9082
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
9077
9083
  }
9078
- if (labelString !== 'null') {
9079
- if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
9084
+ if (labelString.indexOf('null') === -1) {
9085
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
9080
9086
  labelString = '';
9081
9087
  }
9082
9088
  if (isNaN(parseInt(labelString))) {
@@ -9096,14 +9102,16 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9096
9102
  this.taskBarHeight + 'px;">' + labelString + '</span>';
9097
9103
  }
9098
9104
  var labelElement = this.createDivElement(labelDiv)[0];
9099
- labelElement.appendChild(div);
9100
- progressBarInnerDiv[0].appendChild(labelElement);
9101
9105
  var parentLabel = this.parent.labelSettings.taskLabel;
9106
+ if (parentLabel && parentLabel['elementRef'])
9107
+ labelElement.appendChild(div);
9108
+ progressBarInnerDiv[0].appendChild(labelElement);
9102
9109
  if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
9103
- !this.isTemplate(parentLabel))
9110
+ !this.isTemplate(parentLabel) &&
9111
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0])
9104
9112
  progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
9105
9113
  if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
9106
- parentLabel && !parentLabel['elementRef'])
9114
+ parentLabel && !parentLabel['elementRef'] && div.innerHTML != '')
9107
9115
  progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
9108
9116
  }
9109
9117
  var milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
@@ -26408,6 +26416,7 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
26408
26416
 
26409
26417
  var NonWorkingDay = /** @__PURE__ @class */ (function () {
26410
26418
  function NonWorkingDay(gantt) {
26419
+ this.weekendWidthUpdated = false;
26411
26420
  this.parent = gantt;
26412
26421
  this.nonworkingContainer = null;
26413
26422
  this.holidayContainer = null;
@@ -26547,6 +26556,14 @@ var NonWorkingDay = /** @__PURE__ @class */ (function () {
26547
26556
  width = this.parent.dataOperation.getTaskWidth(start, tempEnd);
26548
26557
  isFirstCell = false;
26549
26558
  }
26559
+ var sDate = new Date(startDate);
26560
+ sDate.setDate(sDate.getDate() + 1);
26561
+ if (sDate.getTimezoneOffset() != this.parent.timelineModule.timelineStartDate.getTimezoneOffset() && !this.weekendWidthUpdated) {
26562
+ if (this.parent.timelineModule.bottomTier == 'Hour' && this.parent.timelineSettings.bottomTier.count === 1) {
26563
+ width = width - this.parent.timelineSettings.timelineUnitSize;
26564
+ this.weekendWidthUpdated = true;
26565
+ }
26566
+ }
26550
26567
  var weekendDiv = createElement('div', {
26551
26568
  className: weekend, styles: "left:" + left + "px;width:" + width + "px;height:100%;"
26552
26569
  });
@@ -30938,6 +30955,9 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
30938
30955
  if (data[_this.parent.labelSettings.rightLabel]) {
30939
30956
  taskbar.rightTaskLabel.value = data[_this.parent.labelSettings.rightLabel].toString();
30940
30957
  }
30958
+ if (data[_this.parent.labelSettings.taskLabel]) {
30959
+ taskbar.taskLabel = data[_this.parent.labelSettings.taskLabel].toString();
30960
+ }
30941
30961
  var reduceLeft = ganttProp.isMilestone ? Math.floor(_this.parent.chartRowsModule.taskBarHeight / 2) + 33 : 33; // 33 indicates default timeline cell width
30942
30962
  taskbar.rightTaskLabel.left = ganttProp.left + ganttProp.width + reduceLeft; // right label left value
30943
30963
  taskbar.fontFamily = _this.ganttStyle.fontFamily;
@@ -31299,6 +31319,9 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31299
31319
  var progressFormat = new PdfStringFormat();
31300
31320
  progressFormat.lineAlignment = PdfVerticalAlignment.Middle;
31301
31321
  progressFormat.alignment = PdfTextAlignment.Right;
31322
+ if (/^[a-zA-Z]/.test(this.taskLabel)) {
31323
+ progressFormat.alignment = PdfTextAlignment.Left;
31324
+ }
31302
31325
  var pageIndex = -1;
31303
31326
  if (!taskbar.isMilestone) {
31304
31327
  var taskbarPen = new PdfPen(taskbar.taskBorderColor);
@@ -31320,10 +31343,10 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31320
31343
  }
31321
31344
  else {
31322
31345
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
31323
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
31346
+ if (this.isScheduledTask) {
31324
31347
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
31325
- if (!isNullOrUndefined(this.parent.taskFields.progress) && !isNullOrUndefined(this.parent.labelSettings.taskLabel)) {
31326
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight, pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
31348
+ if (!isNullOrUndefined(this.parent.labelSettings.taskLabel) && !isNullOrUndefined(this.taskLabel)) {
31349
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight, pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
31327
31350
  }
31328
31351
  }
31329
31352
  }
@@ -31345,7 +31368,7 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31345
31368
  }
31346
31369
  else {
31347
31370
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(renderWidth), pixelToPoint(taskbar.height));
31348
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
31371
+ if (this.isScheduledTask) {
31349
31372
  var progressBoundsWidth = 0;
31350
31373
  if (this.progressWidth <= renderWidth) {
31351
31374
  progressBoundsWidth = this.progressWidth;
@@ -31355,8 +31378,8 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31355
31378
  }
31356
31379
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(progressBoundsWidth), pixelToPoint(taskbar.height));
31357
31380
  this.progressWidth -= progressBoundsWidth;
31358
- if (this.progressWidth === 0 && this.progress !== 0 && this.parent.labelSettings.taskLabel) {
31359
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
31381
+ if (this.parent.labelSettings.taskLabel && !isNullOrUndefined(this.taskLabel)) {
31382
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
31360
31383
  }
31361
31384
  }
31362
31385
  }
@@ -31373,8 +31396,8 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31373
31396
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
31374
31397
  if (this.isScheduledTask) {
31375
31398
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
31376
- if (this.progressWidth === 0 && this.progress !== 0) {
31377
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
31399
+ if (!isNullOrUndefined(this.taskLabel)) {
31400
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(this.progressWidth), pixelToPoint(this.height), progressFormat);
31378
31401
  }
31379
31402
  }
31380
31403
  this.isCompleted = true;
@@ -31388,7 +31411,7 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31388
31411
  this.isStartPoint = true;
31389
31412
  }
31390
31413
  taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(detail.totalWidth), pixelToPoint(taskbar.height));
31391
- if (this.progress > 0 && this.progressWidth > 0 && this.isScheduledTask) {
31414
+ if (this.isScheduledTask) {
31392
31415
  var progressBoundsWidth = 0;
31393
31416
  if (this.progressWidth <= detail.totalWidth) {
31394
31417
  progressBoundsWidth = this.progressWidth;
@@ -31398,8 +31421,8 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
31398
31421
  }
31399
31422
  taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(progressBoundsWidth), pixelToPoint(taskbar.height));
31400
31423
  this.progressWidth -= progressBoundsWidth;
31401
- if (this.progressWidth === 0 && this.progress !== 0) {
31402
- taskGraphics.drawString(this.progress.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
31424
+ if (!isNullOrUndefined(this.taskLabel)) {
31425
+ taskGraphics.drawString(this.taskLabel.toString(), font, fontColor, fontBrush, startPoint.x + pixelToPoint(this.left), (startPoint.y + adjustHeight), pixelToPoint(progressBoundsWidth), pixelToPoint(this.height), progressFormat);
31403
31426
  }
31404
31427
  }
31405
31428
  this.isCompleted = false;