@syncfusion/ej2-gantt 24.1.45 → 24.1.47

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +53 -26
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +60 -32
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +17 -17
  13. package/src/gantt/actions/edit.js +7 -1
  14. package/src/gantt/actions/pdf-export.d.ts +2 -1
  15. package/src/gantt/actions/pdf-export.js +3 -3
  16. package/src/gantt/actions/taskbar-edit.js +6 -7
  17. package/src/gantt/base/task-processor.js +19 -13
  18. package/src/gantt/base/tree-grid.d.ts +1 -0
  19. package/src/gantt/base/tree-grid.js +3 -0
  20. package/src/gantt/export/export-helper.js +3 -2
  21. package/src/gantt/export/pdf-taskbar.js +12 -2
  22. package/src/gantt/export/pdf-timeline.js +8 -5
  23. package/styles/bootstrap-dark.css +1 -1
  24. package/styles/bootstrap.css +1 -1
  25. package/styles/bootstrap4.css +1 -1
  26. package/styles/bootstrap5-dark.css +1 -1
  27. package/styles/bootstrap5.css +1 -1
  28. package/styles/fabric-dark.css +1 -1
  29. package/styles/fabric.css +1 -1
  30. package/styles/fluent-dark.css +1 -1
  31. package/styles/fluent.css +1 -1
  32. package/styles/gantt/_layout.scss +1 -1
  33. package/styles/gantt/bootstrap-dark.css +1 -1
  34. package/styles/gantt/bootstrap.css +1 -1
  35. package/styles/gantt/bootstrap4.css +1 -1
  36. package/styles/gantt/bootstrap5-dark.css +1 -1
  37. package/styles/gantt/bootstrap5.css +1 -1
  38. package/styles/gantt/fabric-dark.css +1 -1
  39. package/styles/gantt/fabric.css +1 -1
  40. package/styles/gantt/fluent-dark.css +1 -1
  41. package/styles/gantt/fluent.css +1 -1
  42. package/styles/gantt/highcontrast-light.css +1 -1
  43. package/styles/gantt/highcontrast.css +1 -1
  44. package/styles/gantt/material-dark.css +1 -1
  45. package/styles/gantt/material.css +1 -1
  46. package/styles/gantt/material3-dark.css +1 -1
  47. package/styles/gantt/material3.css +1 -1
  48. package/styles/gantt/tailwind-dark.css +1 -1
  49. package/styles/gantt/tailwind.css +1 -1
  50. package/styles/highcontrast-light.css +1 -1
  51. package/styles/highcontrast.css +1 -1
  52. package/styles/material-dark.css +1 -1
  53. package/styles/material.css +1 -1
  54. package/styles/material3-dark.css +1 -1
  55. package/styles/material3.css +1 -1
  56. package/styles/tailwind-dark.css +1 -1
  57. package/styles/tailwind.css +1 -1
@@ -1653,19 +1653,25 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1653
1653
  var queryManager = this.parent.query instanceof Query ? this.parent.query : new Query();
1654
1654
  queryManager.requiresCount();
1655
1655
  var dataManager = this.parent.dataSource;
1656
- dataManager.executeQuery(queryManager).then(function (e) {
1657
- _this.dataArray = e.result;
1658
- _this.processTimeline();
1659
- if (_this.parent.loadChildOnDemand || (!_this.parent.loadChildOnDemand && !(_this.parent.taskFields.hasChildMapping))) {
1660
- _this.cloneDataSource();
1661
- }
1662
- _this.parent.renderGantt(isChange);
1663
- }).catch(function (e) {
1664
- // Trigger action failure event
1665
- _this.parent.processTimeline();
1666
- _this.parent.renderGantt(isChange);
1667
- _this.parent.trigger('actionFailure', { error: e });
1668
- });
1656
+ if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
1657
+ this.processTimeline();
1658
+ this.parent.renderGantt(isChange);
1659
+ }
1660
+ else {
1661
+ dataManager.executeQuery(queryManager).then(function (e) {
1662
+ _this.dataArray = e.result;
1663
+ _this.processTimeline();
1664
+ if (_this.parent.loadChildOnDemand || (!_this.parent.loadChildOnDemand && !(_this.parent.taskFields.hasChildMapping))) {
1665
+ _this.cloneDataSource();
1666
+ }
1667
+ _this.parent.renderGantt(isChange);
1668
+ }).catch(function (e) {
1669
+ // Trigger action failure event
1670
+ _this.parent.processTimeline();
1671
+ _this.parent.renderGantt(isChange);
1672
+ _this.parent.trigger('actionFailure', { error: e });
1673
+ });
1674
+ }
1669
1675
  };
1670
1676
  TaskProcessor.prototype.constructDataSource = function (dataSource) {
1671
1677
  var mappingData = new DataManager(dataSource).executeLocal(new Query()
@@ -8110,6 +8116,9 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
8110
8116
  this.bindEvents();
8111
8117
  var root = 'root';
8112
8118
  this.parent.treeGrid[root] = this.parent[root] ? this.parent[root] : this.parent;
8119
+ setValue('registeredTemplate', this.registeredTemplate, this.parent.treeGrid);
8120
+ var ref = 'viewContainerRef';
8121
+ setValue('viewContainerRef', this.parent["" + ref], this.parent.treeGrid);
8113
8122
  this.parent.treeGrid.appendTo(this.treeGridElement);
8114
8123
  if (this.parent.treeGrid.grid && this.parent.toolbarModule && this.parent.isReact) {
8115
8124
  this.parent.treeGrid.grid.portals = this.parent.portals;
@@ -20172,7 +20181,6 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20172
20181
  }
20173
20182
  else {
20174
20183
  rowElement = this.parent.getRowByIndex(parseInt(target.getAttribute('data-rowindex'))).children;
20175
-
20176
20184
  }
20177
20185
  if (rowElement) {
20178
20186
  if (this.parent.rowDragAndDropModule['dropPosition'] === 'above') {
@@ -20443,7 +20451,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20443
20451
  var rowIndex = getValue('rowIndex', rowElement);
20444
20452
  var droppedTreeGridRecord = this.parent.flatData[rowIndex];
20445
20453
  var isValid = true;
20446
- if (this.parent.viewType === 'ResourceView' && !this.taskBarEditRecord.hasChildRecords && !droppedTreeGridRecord.hasChildRecords && this.taskBarEditRecord.parentItem.taskId === droppedTreeGridRecord.parentItem.taskId) {
20454
+ if (this.parent.viewType === 'ResourceView' && !this.taskBarEditRecord.hasChildRecords && !droppedTreeGridRecord.hasChildRecords && !isNullOrUndefined(droppedTreeGridRecord.parentItem) && this.taskBarEditRecord.parentItem.taskId === droppedTreeGridRecord.parentItem.taskId) {
20447
20455
  isValid = false;
20448
20456
  }
20449
20457
  if (droppedTreeGridRecord) {
@@ -21418,7 +21426,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
21418
21426
  pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
21419
21427
  /* To render the milestone in proper date while editing */
21420
21428
  if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
21421
- pStartDate.setDate(pStartDate.getDate() - 1);
21429
+ // pStartDate.setDate(pStartDate.getDate()-1);
21422
21430
  this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
21423
21431
  pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
21424
21432
  }
@@ -21428,9 +21436,9 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
21428
21436
  if (this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && !this.parent.isInDst(pStartDate)) {
21429
21437
  pStartDate.setTime(pStartDate.getTime() + (60 * 60 * 1000));
21430
21438
  }
21431
- else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
21432
- pStartDate.setTime(pStartDate.getTime() - (60 * 60 * 1000));
21433
- }
21439
+ // else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
21440
+ // pStartDate.setTime(pStartDate.getTime() - (60 * 60 * 1000));
21441
+ // }
21434
21442
  }
21435
21443
  return pStartDate;
21436
21444
  };
@@ -21844,7 +21852,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
21844
21852
  droppedRecord.childRecords.length == 0)) ? 'child' : this.parent.rowDragAndDropModule['dropPosition'];
21845
21853
  }
21846
21854
  if (this.parent.rowDragAndDropModule) {
21847
- if (this.parent.viewType === 'ResourceView' && (position === 'child' && !droppedRecord.hasChildRecords)) {
21855
+ if (this.parent.viewType === 'ResourceView' && (position === 'child' && !droppedRecord.hasChildRecords) && !isNullOrUndefined(droppedRecord.parentItem)) {
21848
21856
  position = 'Invalid';
21849
21857
  this.parent.rowDragAndDropModule['dropPosition'] = 'Invalid';
21850
21858
  }
@@ -29118,10 +29126,16 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
29118
29126
  }
29119
29127
  if (!isNullOrUndefined(args.data["" + tempTaskID])) {
29120
29128
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
29129
+ for (var _i = 0, _b = Object.keys(_this.parent.ids); _i < _b.length; _i++) {
29130
+ var key = _b[_i];
29131
+ if (_this.parent.ids[key] === args.data['ganttProperties']['taskId'].toString()) {
29132
+ _this.parent.ids[key] = args.data[tempTaskID].toString();
29133
+ break;
29134
+ }
29135
+ }
29121
29136
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
29122
29137
  args.newTaskData[tempTaskID] = args.data[tempTaskID];
29123
29138
  args.data['ganttProperties']['rowUniqueID'] = args.data[tempTaskID].toString();
29124
- _this.parent.ids.push(args.data[tempTaskID].toString());
29125
29139
  }
29126
29140
  }
29127
29141
  if (!args.cancel) {
@@ -37937,9 +37951,11 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
37937
37951
  compositeField.draw(footer.graphics, new PointF(0, 0));
37938
37952
  pdfDoc.template.bottom = footer;
37939
37953
  }
37954
+ var PdfPage$$1 = this.parent.pdfExportModule.pdfPage;
37955
+ var pageSize = PdfPage$$1.size;
37956
+ var clientSize = !isNullOrUndefined(pageSize) ? pageSize : this.pdfDoc.pageSettings.size;
37940
37957
  // code for draw header content
37941
37958
  if (!isNullOrUndefined(this.exportProps.header)) {
37942
- var clientSize = this.pdfDoc.pageSettings.size;
37943
37959
  var headerProp = this.exportProps.header;
37944
37960
  var position = new PointF(0, headerProp.fromTop);
37945
37961
  var size = new SizeF((clientSize.width * 1.1), ((headerProp && headerProp.height) ? headerProp.height * 0.75 : 50));
@@ -37948,7 +37964,6 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
37948
37964
  }
37949
37965
  // code for customization of footer
37950
37966
  if (!this.exportProps.enableFooter && !isNullOrUndefined(this.exportProps.footer)) {
37951
- var clientSize = this.pdfDoc.pageSettings.size;
37952
37967
  var footer = this.exportProps.footer;
37953
37968
  var position = new PointF(0, ((clientSize.width - 80) - ((footer && footer.fromBottom) ?
37954
37969
  footer.fromBottom * 0.75 : 0)));
@@ -38369,11 +38384,21 @@ var PdfGanttTaskbarCollection = /** @__PURE__ @class */ (function () {
38369
38384
  var pageIndex = -1;
38370
38385
  var renderBaselineWidth = 0;
38371
38386
  if (this.baselineWidth > detail.totalWidth) {
38372
- renderBaselineWidth = detail.totalWidth;
38387
+ if (this.parent.timelineModule.isZoomedToFit || this.isAutoFit()) {
38388
+ renderBaselineWidth = detail.totalWidth - this.baselineLeft;
38389
+ }
38390
+ else {
38391
+ renderBaselineWidth = detail.totalWidth;
38392
+ }
38373
38393
  this.baselineWidth = this.baselineWidth - detail.totalWidth;
38374
38394
  }
38375
38395
  else {
38376
- renderBaselineWidth = this.baselineWidth;
38396
+ if ((this.parent.timelineModule.isZoomedToFit || this.isAutoFit()) && this.baselineWidth + this.baselineLeft > detail.totalWidth) {
38397
+ renderBaselineWidth = detail.totalWidth - this.baselineLeft;
38398
+ }
38399
+ else {
38400
+ renderBaselineWidth = this.baselineWidth;
38401
+ }
38377
38402
  }
38378
38403
  var baselinePen = new PdfPen(taskbar.baselineBorderColor);
38379
38404
  var baselineBrush = new PdfSolidBrush(taskbar.baselineColor);
@@ -39666,7 +39691,7 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
39666
39691
  }
39667
39692
  graphics.drawRectangle(rectPen, rectBrush, x, y + pixelToPoint(height), width, page.getClientSize().height);
39668
39693
  if (this.holidayCompleted) {
39669
- var state = graphics.save();
39694
+ var state_1 = graphics.save();
39670
39695
  var font1 = new PdfStandardFont(PdfFontFamily.Helvetica, 10);
39671
39696
  var fontHieght = font1.height;
39672
39697
  var fontSize = font1.size;
@@ -39674,7 +39699,7 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
39674
39699
  graphics.rotateTransform(-90);
39675
39700
  graphics.translateTransform(-(page.getClientSize().height / 2), -40);
39676
39701
  graphics.drawString(this.holidayLabel, font1, null, PdfBrushes.Black, 10, 10, null);
39677
- graphics.restore(state);
39702
+ graphics.restore(state_1);
39678
39703
  this.holidayCompleted = false;
39679
39704
  }
39680
39705
  if (this.fitHolidayCompleted) {
@@ -39683,12 +39708,12 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
39683
39708
  var fontHieght = font1.height;
39684
39709
  var fontSize = font1.size;
39685
39710
  graphics.drawRectangle(null, holidayBrush, x + width / 2 - fontSize, y + pixelToPoint(height), fontSize, page.getClientSize().height);
39686
- var state = graphics.save();
39711
+ var state_2 = graphics.save();
39687
39712
  graphics.translateTransform(x + width + width / 2 - fontSize, 40);
39688
39713
  graphics.rotateTransform(-90);
39689
39714
  graphics.translateTransform(-(page.getClientSize().height / 2), -40);
39690
39715
  graphics.drawString(this.holidayLabel, font1, null, PdfBrushes.Black, 10, 10, null);
39691
- graphics.restore(state);
39716
+ graphics.restore(state_2);
39692
39717
  this.fitHolidayCompleted = false;
39693
39718
  }
39694
39719
  var font = new PdfStandardFont(ganttStyle.fontFamily, e.fontSize, e.fontStyle);
@@ -39699,6 +39724,8 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
39699
39724
  var pLeft = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.left : 0;
39700
39725
  var pTop = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.top : 0;
39701
39726
  /* eslint-disable-next-line */
39727
+ var state = graphics.save();
39728
+ graphics.setClip(new RectangleF(x, y, width, pixelToPoint(height)));
39702
39729
  if (isTopTier) {
39703
39730
  x = x + pLeft + 4;
39704
39731
  }
@@ -39706,6 +39733,7 @@ var PdfTimeline = /** @__PURE__ @class */ (function () {
39706
39733
  x = x + pLeft;
39707
39734
  }
39708
39735
  graphics.drawString(eventArgs.value, font, null, textBrush, x, y + pTop, pixelToPoint(width), pixelToPoint(height), e.format);
39736
+ graphics.restore(state);
39709
39737
  };
39710
39738
  return PdfTimeline;
39711
39739
  }());
@@ -40748,8 +40776,8 @@ var PdfExport = /** @__PURE__ @class */ (function () {
40748
40776
  var _this = this;
40749
40777
  var section = this.pdfDocument.sections.add();
40750
40778
  this.processSectionExportProperties(section, pdfExportProperties);
40751
- var pdfPage = section.pages.add();
40752
- this.pdfPageDimensions = pdfPage.getClientSize();
40779
+ this.pdfPage = section.pages.add();
40780
+ this.pdfPageDimensions = this.pdfPage.getClientSize();
40753
40781
  /* eslint-disable-next-line */
40754
40782
  return new Promise(function (resolve, reject) {
40755
40783
  _this.helper.processGridExport(data, _this.gantt, pdfExportProperties);
@@ -40758,7 +40786,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
40758
40786
  }).then(function () {
40759
40787
  var format = new PdfTreeGridLayoutFormat();
40760
40788
  format.break = PdfLayoutBreakType.FitElement;
40761
- var layouter = _this.gantt.drawGrid(pdfPage, 0, 0, format);
40789
+ var layouter = _this.gantt.drawGrid(_this.pdfPage, 0, 0, format);
40762
40790
  _this.gantt.drawChart(layouter);
40763
40791
  if (_this.helper.exportProps && _this.helper.exportProps.fitToWidthSettings && _this.helper.exportProps.fitToWidthSettings.isFitToWidth) {
40764
40792
  _this.parent.zoomingProjectStartDate = _this.helper.beforeSinglePageExport['zoomingProjectStartDate'];