@syncfusion/ej2-gantt 23.2.7 → 24.1.41

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 (112) hide show
  1. package/CHANGELOG.md +0 -10
  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 +2939 -324
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +2993 -358
  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 +21 -21
  13. package/src/gantt/actions/cell-edit.js +7 -3
  14. package/src/gantt/actions/chart-scroll.d.ts +9 -1
  15. package/src/gantt/actions/chart-scroll.js +111 -3
  16. package/src/gantt/actions/connector-line-edit.js +8 -1
  17. package/src/gantt/actions/context-menu.js +2 -2
  18. package/src/gantt/actions/day-markers.d.ts +2 -1
  19. package/src/gantt/actions/dependency.js +2 -2
  20. package/src/gantt/actions/dialog-edit.d.ts +24 -0
  21. package/src/gantt/actions/dialog-edit.js +383 -1
  22. package/src/gantt/actions/edit.js +68 -21
  23. package/src/gantt/actions/keyboard.js +5 -1
  24. package/src/gantt/actions/pdf-export.js +12 -4
  25. package/src/gantt/actions/rowdragdrop.js +20 -9
  26. package/src/gantt/actions/selection.js +6 -3
  27. package/src/gantt/actions/taskbar-edit.d.ts +14 -0
  28. package/src/gantt/actions/taskbar-edit.js +517 -82
  29. package/src/gantt/actions/toolbar.js +4 -1
  30. package/src/gantt/base/css-constants.d.ts +2 -0
  31. package/src/gantt/base/css-constants.js +2 -0
  32. package/src/gantt/base/enum.d.ts +22 -0
  33. package/src/gantt/base/gantt-chart.js +63 -21
  34. package/src/gantt/base/gantt-model.d.ts +9 -1
  35. package/src/gantt/base/gantt.d.ts +11 -1
  36. package/src/gantt/base/gantt.js +46 -18
  37. package/src/gantt/base/interface.d.ts +135 -3
  38. package/src/gantt/base/splitter.js +6 -0
  39. package/src/gantt/base/task-processor.d.ts +1 -1
  40. package/src/gantt/base/task-processor.js +37 -9
  41. package/src/gantt/export/export-helper.d.ts +12 -0
  42. package/src/gantt/export/export-helper.js +316 -9
  43. package/src/gantt/export/pdf-base/pdf-grid-table.js +14 -1
  44. package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +36 -0
  45. package/src/gantt/export/pdf-connector-line.js +137 -32
  46. package/src/gantt/export/pdf-event-marker.d.ts +10 -0
  47. package/src/gantt/export/pdf-event-marker.js +57 -0
  48. package/src/gantt/export/pdf-gantt.d.ts +2 -0
  49. package/src/gantt/export/pdf-gantt.js +30 -10
  50. package/src/gantt/export/pdf-taskbar.d.ts +23 -2
  51. package/src/gantt/export/pdf-taskbar.js +771 -43
  52. package/src/gantt/export/pdf-timeline.d.ts +9 -0
  53. package/src/gantt/export/pdf-timeline.js +98 -20
  54. package/src/gantt/models/column.d.ts +12 -0
  55. package/src/gantt/renderer/chart-rows.d.ts +1 -1
  56. package/src/gantt/renderer/chart-rows.js +29 -16
  57. package/src/gantt/renderer/connector-line.js +8 -5
  58. package/src/gantt/renderer/edit-tooltip.js +3 -0
  59. package/src/gantt/renderer/event-marker.js +4 -1
  60. package/src/gantt/renderer/nonworking-day.js +18 -5
  61. package/src/gantt/renderer/timeline.d.ts +9 -0
  62. package/src/gantt/renderer/timeline.js +164 -21
  63. package/styles/bootstrap-dark.css +77 -16
  64. package/styles/bootstrap.css +78 -17
  65. package/styles/bootstrap4.css +78 -17
  66. package/styles/bootstrap5-dark.css +78 -17
  67. package/styles/bootstrap5.css +78 -17
  68. package/styles/fabric-dark.css +78 -17
  69. package/styles/fabric.css +78 -17
  70. package/styles/fluent-dark.css +78 -17
  71. package/styles/fluent.css +78 -17
  72. package/styles/gantt/_bootstrap-dark-definition.scss +7 -2
  73. package/styles/gantt/_bootstrap-definition.scss +7 -2
  74. package/styles/gantt/_bootstrap4-definition.scss +7 -2
  75. package/styles/gantt/_bootstrap5-definition.scss +7 -2
  76. package/styles/gantt/_fabric-dark-definition.scss +7 -2
  77. package/styles/gantt/_fabric-definition.scss +7 -2
  78. package/styles/gantt/_fluent-definition.scss +7 -2
  79. package/styles/gantt/_fusionnew-definition.scss +6 -2
  80. package/styles/gantt/_highcontrast-definition.scss +7 -2
  81. package/styles/gantt/_highcontrast-light-definition.scss +7 -2
  82. package/styles/gantt/_layout.scss +92 -20
  83. package/styles/gantt/_material-dark-definition.scss +7 -2
  84. package/styles/gantt/_material-definition.scss +7 -2
  85. package/styles/gantt/_material3-definition.scss +7 -2
  86. package/styles/gantt/_tailwind-definition.scss +6 -1
  87. package/styles/gantt/_theme.scss +11 -0
  88. package/styles/gantt/bootstrap-dark.css +77 -16
  89. package/styles/gantt/bootstrap.css +78 -17
  90. package/styles/gantt/bootstrap4.css +78 -17
  91. package/styles/gantt/bootstrap5-dark.css +78 -17
  92. package/styles/gantt/bootstrap5.css +78 -17
  93. package/styles/gantt/fabric-dark.css +78 -17
  94. package/styles/gantt/fabric.css +78 -17
  95. package/styles/gantt/fluent-dark.css +78 -17
  96. package/styles/gantt/fluent.css +78 -17
  97. package/styles/gantt/highcontrast-light.css +78 -17
  98. package/styles/gantt/highcontrast.css +78 -17
  99. package/styles/gantt/material-dark.css +78 -17
  100. package/styles/gantt/material.css +78 -17
  101. package/styles/gantt/material3-dark.css +77 -16
  102. package/styles/gantt/material3.css +77 -16
  103. package/styles/gantt/tailwind-dark.css +78 -17
  104. package/styles/gantt/tailwind.css +78 -17
  105. package/styles/highcontrast-light.css +78 -17
  106. package/styles/highcontrast.css +78 -17
  107. package/styles/material-dark.css +78 -17
  108. package/styles/material.css +78 -17
  109. package/styles/material3-dark.css +77 -16
  110. package/styles/material3.css +77 -16
  111. package/styles/tailwind-dark.css +78 -17
  112. package/styles/tailwind.css +78 -17
@@ -24,6 +24,8 @@ var DialogEdit = /** @class */ (function () {
24
24
  * @returns {void} .
25
25
  */
26
26
  function DialogEdit(parent) {
27
+ this.taskFieldColumn = [];
28
+ this.customFieldColumn = [];
27
29
  /**
28
30
  * @private
29
31
  */
@@ -199,6 +201,7 @@ var DialogEdit = /** @class */ (function () {
199
201
  DialogEdit.prototype.openAddDialog = function () {
200
202
  this.isEdit = false;
201
203
  this.editedRecord = this.composeAddRecord();
204
+ this.isFromAddDialog = true;
202
205
  this.createDialog();
203
206
  };
204
207
  /**
@@ -357,6 +360,7 @@ var DialogEdit = /** @class */ (function () {
357
360
  }
358
361
  if (Object.keys(this.rowData).length !== 0) {
359
362
  this.editedRecord = extend({}, {}, this.rowData, true);
363
+ this.isFromEditDialog = true;
360
364
  this.createDialog();
361
365
  }
362
366
  };
@@ -429,8 +433,114 @@ var DialogEdit = /** @class */ (function () {
429
433
  }
430
434
  }
431
435
  else {
436
+ if (this.singleTab && this.CustomformObj) {
437
+ if (!this.CustomformObj.validate()) {
438
+ target.style.pointerEvents = '';
439
+ return;
440
+ }
441
+ }
442
+ else {
443
+ if (this.CustomformObj) {
444
+ if (this.isAddingDialog) {
445
+ if (this.parent.addDialogFields.length > 1 && this.parent.addDialogFields[0].type == "Custom" && !this.formObj) {
446
+ if (!this.CustomformObj.validate()) {
447
+ target.style.pointerEvents = '';
448
+ return;
449
+ }
450
+ }
451
+ }
452
+ else if (this.isEditingDialog) {
453
+ if (this.parent.editDialogFields.length > 1 && this.parent.editDialogFields[0].type == "Custom" && !this.formObj) {
454
+ if (!this.CustomformObj.validate()) {
455
+ target.style.pointerEvents = '';
456
+ return;
457
+ }
458
+ }
459
+ }
460
+ if (!this.formObj.validate() && !this.CustomformObj.validate()) {
461
+ target.style.pointerEvents = '';
462
+ return;
463
+ }
464
+ }
465
+ if (this.formObj) {
466
+ var formValid = this.formObj.validate();
467
+ if (this.storeDependencyTab) {
468
+ var dependencyTab = this.storeDependencyTab.querySelector('.e-gridform');
469
+ if (dependencyTab) {
470
+ var dependencyTabValid = dependencyTab['ej2_instances'][0].validate();
471
+ if (!formValid || !dependencyTabValid) {
472
+ target.style.pointerEvents = '';
473
+ return;
474
+ }
475
+ }
476
+ }
477
+ if (this.storeResourceTab) {
478
+ var resourceTab = this.storeResourceTab.querySelector('.e-gridform');
479
+ if (resourceTab) {
480
+ var resourceTabValid = resourceTab['ej2_instances'][0].validate();
481
+ if (!formValid || !resourceTabValid) {
482
+ target.style.pointerEvents = '';
483
+ return;
484
+ }
485
+ }
486
+ }
487
+ if (!formValid) {
488
+ target.style.pointerEvents = '';
489
+ return;
490
+ }
491
+ }
492
+ else if (this.storeDependencyTab || this.firstOccuringTab == "Dependency") {
493
+ if (this.firstOccuringTab == "Dependency") {
494
+ var element = e.target.closest('#' + this.parent.element.id + '_dialog');
495
+ var dependencyTab = element.querySelector('.e-gridform');
496
+ if (dependencyTab) {
497
+ var dependencyTabValid = dependencyTab['ej2_instances'][0].validate();
498
+ if (!dependencyTabValid) {
499
+ target.style.pointerEvents = '';
500
+ return;
501
+ }
502
+ }
503
+ }
504
+ else {
505
+ var dependencyTab = this.storeDependencyTab.querySelector('.e-gridform');
506
+ if (dependencyTab) {
507
+ var dependencyTabValid = dependencyTab['ej2_instances'][0].validate();
508
+ if (!dependencyTabValid) {
509
+ target.style.pointerEvents = '';
510
+ return;
511
+ }
512
+ }
513
+ }
514
+ }
515
+ else if (this.storeResourceTab || this.firstOccuringTab == "Resources") {
516
+ if (this.firstOccuringTab == "Resources") {
517
+ var element = e.target.closest('#' + this.parent.element.id + '_dialog');
518
+ var resourceTab = element.querySelector('.e-gridform');
519
+ if (resourceTab) {
520
+ var resourceTabValid = resourceTab['ej2_instances'][0].validate();
521
+ if (!resourceTabValid) {
522
+ target.style.pointerEvents = '';
523
+ return;
524
+ }
525
+ }
526
+ }
527
+ else {
528
+ var resourceTab = this.storeResourceTab.querySelector('.e-gridform');
529
+ if (resourceTab) {
530
+ var resourceTabValid = resourceTab['ej2_instances'][0].validate();
531
+ if (!resourceTabValid) {
532
+ target.style.pointerEvents = '';
533
+ return;
534
+ }
535
+ }
536
+ }
537
+ }
538
+ }
432
539
  this.initiateDialogSave();
433
540
  target.style.pointerEvents = 'auto';
541
+ this.singleTab = false;
542
+ this.isAddingDialog = false;
543
+ this.isEditingDialog = false;
434
544
  }
435
545
  };
436
546
  /**
@@ -665,6 +775,11 @@ var DialogEdit = /** @class */ (function () {
665
775
  element: _this.dialog,
666
776
  cancel: false
667
777
  };
778
+ var columns = _this.parent.treeGrid.grid.getColumns();
779
+ var isValidateColumn = columns.some(function (obj) { return obj.validationRules; });
780
+ if (isValidateColumn) {
781
+ _this.changeFormObj(actionCompleteArgs.element, false);
782
+ }
668
783
  _this.parent.trigger('actionComplete', actionCompleteArgs, function (actionCompleteArg) {
669
784
  if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
670
785
  _this.parent.hideMaskRow();
@@ -679,9 +794,276 @@ var DialogEdit = /** @class */ (function () {
679
794
  }
680
795
  });
681
796
  };
797
+ DialogEdit.prototype.changeFormObj = function (actionCompleteArgs, isCustomTab) {
798
+ if (!this.storeColumn) {
799
+ this.storeColumn = this.parent.treeGrid.grid.getColumns();
800
+ }
801
+ if (!this.taskfields) {
802
+ this.taskfields = this.parent.taskFields['properties'];
803
+ }
804
+ if (!this.storeValidTab) {
805
+ this.storeValidTab = this.getFilteredDialogFields();
806
+ }
807
+ var typeOrder = ['General', 'Resources', 'Dependency', 'Custom'];
808
+ // Custom comparator function to sort by type order
809
+ function customComparator(a, b) {
810
+ var typeA = a.type || ''; // Default to empty string if type is missing
811
+ var typeB = b.type || '';
812
+ var indexA = typeOrder.indexOf(typeA);
813
+ var indexB = typeOrder.indexOf(typeB);
814
+ return indexA - indexB;
815
+ }
816
+ // Sort the array based on the custom comparator
817
+ if (this.storeValidTab) {
818
+ this.storeValidTab.sort(customComparator);
819
+ }
820
+ if (this.customFieldColumn.length === 0 || this.taskFieldColumn.length === 0) {
821
+ this.validateColumn(this.storeColumn, this.taskfields, this.storeValidTab);
822
+ }
823
+ if ((this.isFromAddDialog || this.isFromEditDialog) && this.isSingleCustomTab()) {
824
+ isCustomTab = true;
825
+ this.singleTab = true;
826
+ }
827
+ if (this.isFromAddDialog) {
828
+ if (this.parent.addDialogFields.length > 1) {
829
+ if (this.parent.addDialogFields[0].type === 'Resources'
830
+ || this.parent.addDialogFields[0].type === 'Dependency') {
831
+ this.firstOccuringTab = this.parent.addDialogFields[0].type;
832
+ }
833
+ }
834
+ if (this.parent.addDialogFields.length == 1) {
835
+ this.firstOccuringTab = this.parent.addDialogFields[0].type;
836
+ }
837
+ }
838
+ else if (this.isFromEditDialog) {
839
+ if (this.parent.editDialogFields.length > 1) {
840
+ if (this.parent.editDialogFields[0].type === 'Resources'
841
+ || this.parent.editDialogFields[0].type === 'Dependency') {
842
+ this.firstOccuringTab = this.parent.editDialogFields[0].type;
843
+ }
844
+ }
845
+ if (this.parent.editDialogFields.length == 1) {
846
+ this.firstOccuringTab = this.parent.editDialogFields[0].type;
847
+ }
848
+ }
849
+ if (this.isFromEditDialog) {
850
+ if (this.parent.editDialogFields.length > 1) {
851
+ if (this.parent.editDialogFields[0].type == 'Custom') {
852
+ isCustomTab = true;
853
+ }
854
+ }
855
+ }
856
+ if (this.isFromAddDialog) {
857
+ if (this.parent.addDialogFields.length > 1) {
858
+ if (this.parent.addDialogFields[0].type == 'Custom') {
859
+ isCustomTab = true;
860
+ }
861
+ }
862
+ }
863
+ if (isCustomTab) {
864
+ this.CustomformObj = actionCompleteArgs.querySelector('.e-edit-form-row');
865
+ if (this.CustomformObj === null) {
866
+ return;
867
+ }
868
+ var validationRulesArray = {};
869
+ for (var i = 0; i < this.customFieldColumn.length; i++) {
870
+ var column = this.customFieldColumn[parseInt(i.toString(), 10)];
871
+ if (!column.visible) {
872
+ continue;
873
+ }
874
+ if (column.validationRules) {
875
+ validationRulesArray[column.field] = column.validationRules;
876
+ }
877
+ }
878
+ if (Object.keys(validationRulesArray).length > 0) {
879
+ this.CustomformObj = this.createFormObj(this.CustomformObj, validationRulesArray);
880
+ }
881
+ }
882
+ else {
883
+ this.formObj = actionCompleteArgs.querySelector('.e-edit-form-row');
884
+ if (this.formObj === null) {
885
+ return;
886
+ }
887
+ var validationRulesArray = {};
888
+ for (var i = 0; i < this.taskFieldColumn.length; i++) {
889
+ var column = this.taskFieldColumn[parseInt(i.toString(), 10)];
890
+ if (!column.visible) {
891
+ continue;
892
+ }
893
+ if (column.validationRules) {
894
+ validationRulesArray[column.field] = column.validationRules;
895
+ }
896
+ }
897
+ if (Object.keys(validationRulesArray).length > 0) {
898
+ this.formObj = this.createFormObj(this.formObj, validationRulesArray);
899
+ }
900
+ }
901
+ if (this.isFromAddDialog == true || this.isFromEditDialog) {
902
+ this.isAddingDialog = this.isFromAddDialog;
903
+ this.isEditingDialog = this.isFromEditDialog;
904
+ }
905
+ this.isFromAddDialog = false;
906
+ this.isFromEditDialog = false;
907
+ isCustomTab = false;
908
+ };
909
+ DialogEdit.prototype.getFilteredDialogFields = function () {
910
+ var dialogFields = this.isFromAddDialog
911
+ ? this.parent.addDialogFields
912
+ : this.parent.editDialogFields;
913
+ if (dialogFields.length !== 0) {
914
+ return dialogFields.filter(function (obj) { return obj.type === "General" || obj.type === "Custom"; });
915
+ }
916
+ return null;
917
+ };
918
+ DialogEdit.prototype.isSingleCustomTab = function () {
919
+ var dialogFields = this.isFromAddDialog
920
+ ? this.parent.addDialogFields
921
+ : this.parent.editDialogFields;
922
+ return this.isFromAddDialog || this.isFromEditDialog
923
+ ? dialogFields.length === 1 && dialogFields[0].type === 'Custom'
924
+ : false;
925
+ };
926
+ DialogEdit.prototype.validateColumn = function (storeColumn, taskfields, storeValidTab) {
927
+ var _this = this;
928
+ storeColumn.forEach(function (column) {
929
+ var field = column.field;
930
+ var isValueMatching = false;
931
+ var taskfieldValues = [];
932
+ if (_this.parent.customColumns.indexOf(field) === -1) {
933
+ isValueMatching = true;
934
+ }
935
+ if (isValueMatching) {
936
+ if ((_this.isFromAddDialog || _this.isFromEditDialog) && storeValidTab) {
937
+ if (storeValidTab.some(function (obj) { return obj.fields.includes(column.field); })) {
938
+ _this.taskFieldColumn.push(column);
939
+ }
940
+ }
941
+ else {
942
+ _this.taskFieldColumn.push(column);
943
+ }
944
+ }
945
+ else {
946
+ if ((_this.isFromAddDialog || _this.isFromEditDialog) && storeValidTab) {
947
+ if (storeValidTab.some(function (obj) { return obj.fields.includes(column.field); })) {
948
+ _this.customFieldColumn.push(column);
949
+ }
950
+ }
951
+ else {
952
+ _this.customFieldColumn.push(column);
953
+ }
954
+ }
955
+ });
956
+ };
957
+ DialogEdit.prototype.createFormObj = function (form, rules) {
958
+ var _this = this;
959
+ return new FormValidator(form, {
960
+ rules: rules,
961
+ locale: this.parent.locale,
962
+ validationComplete: function (args) {
963
+ _this.validationComplete(args);
964
+ },
965
+ customPlacement: function (inputElement, error) {
966
+ var nameAttribute = inputElement.getAttribute('name');
967
+ if (nameAttribute) {
968
+ var columnName = nameAttribute;
969
+ _this.valErrorPlacement(inputElement, error, columnName);
970
+ }
971
+ }
972
+ });
973
+ };
974
+ DialogEdit.prototype.valErrorPlacement = function (inputElement, error, columnName) {
975
+ var id = columnName + "-tooltip";
976
+ var elem = this.getElemTable(inputElement);
977
+ if (!elem) {
978
+ this.createTooltip(inputElement, error, id);
979
+ }
980
+ else {
981
+ var tooltipContent = elem.querySelector('.e-tip-content');
982
+ if (tooltipContent) {
983
+ tooltipContent.innerHTML = error.outerHTML;
984
+ }
985
+ }
986
+ };
987
+ DialogEdit.prototype.createTooltip = function (inputElement, errorMessage, id, display) {
988
+ if (display === void 0) { display = 'block'; }
989
+ var existingTooltip = document.getElementById(id);
990
+ if (existingTooltip) {
991
+ existingTooltip.remove();
992
+ }
993
+ var parentElement = inputElement.parentElement;
994
+ if (parentElement) {
995
+ parentElement.style.position = 'relative';
996
+ }
997
+ var tooltipContainer = document.createElement('div');
998
+ tooltipContainer.className = 'e-tooltip-wrap e-lib e-control e-popup e-griderror';
999
+ tooltipContainer.style.display = display;
1000
+ tooltipContainer.style.zIndex = '1000';
1001
+ var labelId = id + "-label";
1002
+ var tooltipLabel = document.createElement('div');
1003
+ tooltipLabel.id = labelId;
1004
+ tooltipLabel.className = 'sr-only';
1005
+ var tooltipContent = document.createElement('div');
1006
+ tooltipContent.className = 'e-tip-content';
1007
+ var errorMessageElement = document.createElement('div');
1008
+ errorMessageElement.className = 'error-message';
1009
+ errorMessageElement.appendChild(errorMessage.cloneNode(true));
1010
+ var arrow = document.createElement('div');
1011
+ arrow.className = 'e-arrow-tip e-tip-top';
1012
+ arrow.appendChild(document.createElement('div')).className = 'e-arrow-tip-outer e-tip-top';
1013
+ arrow.appendChild(document.createElement('div')).className = 'e-arrow-tip-inner e-tip-top';
1014
+ tooltipContainer.setAttribute('aria-labelledby', labelId);
1015
+ tooltipContent.appendChild(errorMessageElement);
1016
+ tooltipContainer.appendChild(tooltipContent);
1017
+ tooltipContainer.appendChild(arrow);
1018
+ tooltipContainer.style.top = '125%';
1019
+ tooltipContainer.style.left = '50%';
1020
+ tooltipContainer.style.transform = 'translateX(-50%)';
1021
+ if (parentElement) {
1022
+ parentElement.appendChild(tooltipLabel);
1023
+ parentElement.appendChild(tooltipContainer);
1024
+ }
1025
+ };
1026
+ DialogEdit.prototype.getElemTable = function (inputElement) {
1027
+ var parentElement = inputElement.parentElement;
1028
+ if (parentElement) {
1029
+ return parentElement.querySelector(".e-tooltip-wrap");
1030
+ }
1031
+ return null;
1032
+ };
1033
+ DialogEdit.prototype.validationComplete = function (args) {
1034
+ var elem = this.getElemTable(args.element);
1035
+ if (elem) {
1036
+ if (args.status === 'failure') {
1037
+ elem.style.display = '';
1038
+ }
1039
+ else {
1040
+ elem.style.display = 'none';
1041
+ }
1042
+ }
1043
+ };
682
1044
  DialogEdit.prototype.tabSelectedEvent = function (args) {
683
1045
  var ganttObj = this.parent;
684
1046
  var id = args.selectedContent.childNodes[0].id;
1047
+ if (id == ganttObj.element.id + 'DependencyTabContainer') {
1048
+ this.storeDependencyTab = args.selectedContent;
1049
+ }
1050
+ if (id == ganttObj.element.id + 'ResourcesTabContainer') {
1051
+ this.storeResourceTab = args.selectedContent;
1052
+ }
1053
+ if (id == ganttObj.element.id + 'Custom0TabContainer') {
1054
+ var columns = this.parent.treeGrid.grid.getColumns();
1055
+ var isValidateColumn = columns.some(function (obj) { return obj.validationRules; });
1056
+ if (isValidateColumn) {
1057
+ this.changeFormObj(args.selectedContent, true);
1058
+ }
1059
+ }
1060
+ if (id == ganttObj.element.id + 'GeneralTabContainer') {
1061
+ var columns = this.parent.treeGrid.grid.getColumns();
1062
+ var isValidateColumn = columns.some(function (obj) { return obj.validationRules; });
1063
+ if (isValidateColumn) {
1064
+ this.changeFormObj(args.selectedContent, false);
1065
+ }
1066
+ }
685
1067
  if (this.parent.isAdaptive) {
686
1068
  this.responsiveTabContent(id, ganttObj);
687
1069
  }
@@ -985,7 +1367,7 @@ var DialogEdit = /** @class */ (function () {
985
1367
  DialogEdit.prototype.validateDuration = function (ganttData) {
986
1368
  var ganttProp = ganttData.ganttProperties;
987
1369
  if (!this.dialogEditValidationFlag) {
988
- if (isNullOrUndefined(ganttProp.duration)) {
1370
+ if (isNullOrUndefined(ganttProp.duration) && !isScheduledTask(ganttProp) && !isNullOrUndefined(ganttProp.startDate)) {
989
1371
  this.parent.setRecordValue('endDate', null, ganttProp, true);
990
1372
  this.parent.setRecordValue('isMilestone', false, ganttProp, true);
991
1373
  }
@@ -913,9 +913,12 @@ var Edit = /** @class */ (function () {
913
913
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
914
914
  }
915
915
  var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
916
- if (!parentData.ganttProperties.predecessorsName) {
917
- this.parent.predecessorModule.validatePredecessor(parentData, [], '');
918
- this.updateParentItemOnEditing();
916
+ if (!isNullOrUndefined(parentData)) {
917
+ if (!parentData.ganttProperties.predecessorsName) {
918
+ this.parent.predecessorModule.validatePredecessor(parentData, [], '');
919
+ this.updateParentItemOnEditing();
920
+ this.parent.ganttChartModule.reRenderConnectorLines();
921
+ }
919
922
  }
920
923
  }
921
924
  if (this.parent.UpdateOffsetOnTaskbarEdit && this.parent.connectorLineEditModule && args.data) {
@@ -1241,12 +1244,18 @@ var Edit = /** @class */ (function () {
1241
1244
  var ganttObj = this.parent;
1242
1245
  var currentBaselineStart = __assign({}, eventArgs.data.ganttProperties.baselineStartDate);
1243
1246
  var currentBaselineEnd = __assign({}, eventArgs.data.ganttProperties.baselineEndDate);
1247
+ var currentProgress = eventArgs.data.ganttProperties.progress;
1244
1248
  this.parent.trigger('actionBegin', eventArgs, function (eventArg) {
1245
1249
  if (currentBaselineStart != eventArg.data["ganttProperties"].baselineStartDate
1246
1250
  || currentBaselineEnd != eventArg.data["ganttProperties"].baselineEndDate) {
1247
1251
  ganttObj.setRecordValue('baselineLeft', ganttObj.dataOperation.calculateBaselineLeft(eventArg.data['ganttProperties']), eventArg.data['ganttProperties'], true);
1248
1252
  ganttObj.setRecordValue('baselineWidth', ganttObj.dataOperation.calculateBaselineWidth(eventArg.data['ganttProperties']), eventArg.data['ganttProperties'], true);
1249
1253
  }
1254
+ if (!isNullOrUndefined(_this.parent.taskFields.progress) && currentProgress != eventArg.data["ganttProperties"].progress) {
1255
+ var width = eventArg.data['ganttProperties'].isAutoSchedule ? eventArg.data['ganttProperties'].width :
1256
+ eventArg.data['ganttProperties'].autoWidth;
1257
+ _this.parent.setRecordValue('progressWidth', _this.parent.dataOperation.getProgressWidth(width, eventArg.data['ganttProperties'].progress), eventArg.data['ganttProperties'], true);
1258
+ }
1250
1259
  if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
1251
1260
  _this.parent.showMaskRow();
1252
1261
  }
@@ -1422,9 +1431,10 @@ var Edit = /** @class */ (function () {
1422
1431
  }
1423
1432
  }
1424
1433
  if (this.parent.isConnectorLineUpdate && !isNullOrUndefined(this.parent.connectorLineEditModule)) {
1425
- // this.parent.updatedConnectorLineCollection = [];
1426
- // this.parent.connectorLineIds = [];
1434
+ this.parent.updatedConnectorLineCollection = [];
1435
+ this.parent.connectorLineIds = [];
1427
1436
  this.parent.connectorLineEditModule.refreshEditedRecordConnectorLine(this.parent.editedRecords);
1437
+ this.parent.ganttChartModule.reRenderConnectorLines();
1428
1438
  this.updateScheduleDatesOnEditing(args);
1429
1439
  }
1430
1440
  }
@@ -1447,6 +1457,9 @@ var Edit = /** @class */ (function () {
1447
1457
  }
1448
1458
  this.endEditAction(args);
1449
1459
  this.parent.trigger('actionComplete', eventArgs);
1460
+ if (this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule && this.parent.rowDragAndDropModule['draggedRecord']) {
1461
+ this.parent.rowDragAndDropModule['draggedRecord'] = null;
1462
+ }
1450
1463
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
1451
1464
  this.parent.hideMaskRow();
1452
1465
  }
@@ -2559,8 +2572,8 @@ var Edit = /** @class */ (function () {
2559
2572
  var predecessorCollection = parentRecordTaskData.predecessor;
2560
2573
  var childRecord;
2561
2574
  var predecessorIndex;
2562
- var validPredecessor;
2563
2575
  var updatedPredecessor = [];
2576
+ var validPredecessor;
2564
2577
  for (var count = 0; count < len; count++) {
2565
2578
  var fromRecord = this.parent.getRecordByID(predecessorCollection[count].from);
2566
2579
  var toRecord = this.parent.getRecordByID(predecessorCollection[count].to);
@@ -2906,11 +2919,30 @@ var Edit = /** @class */ (function () {
2906
2919
  }
2907
2920
  if (getValue(this.parent.taskFields.id, dataCollection[i]).toString() ===
2908
2921
  this.addRowSelectedItem.ganttProperties.rowUniqueID.toString()) {
2922
+ var index = void 0;
2923
+ if (this.parent.rowDragAndDropModule && this.parent.rowDragAndDropModule['droppedRecord'] && this.parent.viewType === 'ResourceView') {
2924
+ for (var i_1 = 0; i_1 < dataCollection.length; i_1++) {
2925
+ if (dataCollection[i_1][this.parent.taskFields.id] == this.parent.rowDragAndDropModule['droppedRecord'].ganttProperties.taskId) {
2926
+ index = i_1;
2927
+ break;
2928
+ }
2929
+ }
2930
+ }
2909
2931
  if (rowPosition === 'Above') {
2910
- dataCollection.splice(i, 0, record);
2932
+ if (index) {
2933
+ dataCollection.splice(index, 0, record);
2934
+ }
2935
+ else {
2936
+ dataCollection.splice(i, 0, record);
2937
+ }
2911
2938
  }
2912
2939
  else if (rowPosition === 'Below') {
2913
- dataCollection.splice(i + 1, 0, record);
2940
+ if (index) {
2941
+ dataCollection.splice(index + 1, 0, record);
2942
+ }
2943
+ else {
2944
+ dataCollection.splice(i + 1, 0, record);
2945
+ }
2914
2946
  }
2915
2947
  else if (rowPosition === 'Child') {
2916
2948
  if (dataCollection[i][child] && dataCollection[i][child].length > 0) {
@@ -3112,6 +3144,9 @@ var Edit = /** @class */ (function () {
3112
3144
  }
3113
3145
  _this.updateTreeGridUniqueID(cAddedRecord_1, 'add');
3114
3146
  _this.refreshNewlyAddedRecord(args, cAddedRecord_1);
3147
+ if (_this.parent.viewType === 'ResourceView' && _this.parent.taskFields.work) {
3148
+ _this.parent.dataOperation.updateParentItems(ganttData, true);
3149
+ }
3115
3150
  _this._resetProperties();
3116
3151
  }
3117
3152
  }
@@ -3483,6 +3518,7 @@ var Edit = /** @class */ (function () {
3483
3518
  }
3484
3519
  };
3485
3520
  Edit.prototype.reArrangeRows = function (args, isByMethod) {
3521
+ var _this = this;
3486
3522
  this.dropPosition = args.dropPosition;
3487
3523
  if (args.dropPosition !== 'Invalid' && this.parent.editModule) {
3488
3524
  var obj = this.parent;
@@ -3560,18 +3596,20 @@ var Edit = /** @class */ (function () {
3560
3596
  this.refreshDataSource();
3561
3597
  }
3562
3598
  if (this.dropPosition === 'middleSegment') {
3563
- if (droppedRec.ganttProperties.predecessor) {
3599
+ if (!isNullOrUndefined(droppedRec.ganttProperties.predecessor)) {
3564
3600
  var len = droppedRec.ganttProperties.predecessor.length;
3565
3601
  for (var count = 0; count < len; count++) {
3566
- var fromRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].from);
3567
- var toRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].to);
3568
- var validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
3569
- if (droppedRec.ganttProperties.predecessor && !validPredecessor) {
3570
- this.parent.editModule.removePredecessorOnDelete(droppedRec);
3571
- droppedRec.ganttProperties.predecessor = null;
3572
- droppedRec.ganttProperties.predecessorsName = null;
3573
- droppedRec[this.parent.taskFields.dependency] = null;
3574
- droppedRec.taskData[this.parent.taskFields.dependency] = null;
3602
+ if (!isNullOrUndefined(droppedRec.ganttProperties.predecessor)) {
3603
+ var fromRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].from);
3604
+ var toRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].to);
3605
+ var validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
3606
+ if (droppedRec.ganttProperties.predecessor && !validPredecessor) {
3607
+ this.parent.editModule.removePredecessorOnDelete(droppedRec);
3608
+ droppedRec.ganttProperties.predecessor = null;
3609
+ droppedRec.ganttProperties.predecessorsName = null;
3610
+ droppedRec[this.parent.taskFields.dependency] = null;
3611
+ droppedRec.taskData[this.parent.taskFields.dependency] = null;
3612
+ }
3575
3613
  }
3576
3614
  }
3577
3615
  }
@@ -3587,6 +3625,12 @@ var Edit = /** @class */ (function () {
3587
3625
  for (var k = 0; k < this.updateParentRecords.length; k++) {
3588
3626
  this.parent.dataOperation.updateParentItems(this.updateParentRecords[k]);
3589
3627
  }
3628
+ this.parent.editedRecords.forEach(function (record) {
3629
+ _this.parent.predecessorModule.validatePredecessor(record, [], '');
3630
+ });
3631
+ for (var k = 0; k < this.updateParentRecords.length; k++) {
3632
+ this.parent.dataOperation.updateParentItems(this.updateParentRecords[k]);
3633
+ }
3590
3634
  this.updateParentRecords = [];
3591
3635
  this.parent.isOnEdit = false;
3592
3636
  }
@@ -3656,6 +3700,9 @@ var Edit = /** @class */ (function () {
3656
3700
  else {
3657
3701
  this.parent.hideSpinner();
3658
3702
  }
3703
+ if (this.parent.rowDragAndDropModule) {
3704
+ this.parent.rowDragAndDropModule['draggedRecord'] = null;
3705
+ }
3659
3706
  this.parent.editedRecords = [];
3660
3707
  };
3661
3708
  Edit.prototype.refreshDataSource = function () {
@@ -3919,9 +3966,9 @@ var Edit = /** @class */ (function () {
3919
3966
  data.splice(indx, 1);
3920
3967
  }
3921
3968
  var gridIndx = void 0;
3922
- for (var i_1 = 0; i_1 < this.treeGridData.length; i_1++) {
3923
- if (this.treeGridData[i_1][this.parent.taskFields.id] === currentRec.taskData[this.parent.taskFields.id]) {
3924
- gridIndx = i_1;
3969
+ for (var i_2 = 0; i_2 < this.treeGridData.length; i_2++) {
3970
+ if (this.treeGridData[i_2][this.parent.taskFields.id] === currentRec.taskData[this.parent.taskFields.id]) {
3971
+ gridIndx = i_2;
3925
3972
  }
3926
3973
  }
3927
3974
  this.treeGridData.splice(gridIndx, 1);
@@ -1,4 +1,4 @@
1
- import { isNullOrUndefined, getValue } from '@syncfusion/ej2-base';
1
+ import { isNullOrUndefined, getValue, removeClass } from '@syncfusion/ej2-base';
2
2
  /**
3
3
  * Focus module is used to handle certain action on focus elements in keyboard navigations.
4
4
  */
@@ -256,6 +256,10 @@ var FocusModule = /** @class */ (function () {
256
256
  if (ganttObj.selectionModule) {
257
257
  if (ganttObj.selectionSettings.mode !== 'Cell' && ganttObj.selectedRowIndex !== -1) {
258
258
  var selectedItem = ganttObj.currentViewData[ganttObj.selectedRowIndex];
259
+ var focussedElement = ganttObj.element.querySelector('.e-focused');
260
+ if (focussedElement) {
261
+ removeClass([focussedElement], 'e-focused');
262
+ }
259
263
  var focusedRowIndex = this.parent.ganttChartModule.focusedRowIndex;
260
264
  var selectingRowIndex = expandedRecords.indexOf(selectedItem);
261
265
  var currentSelectingRecord = e.action === 'downArrow' ? expandedRecords[selectingRowIndex + 1] :
@@ -81,18 +81,26 @@ var PdfExport = /** @class */ (function () {
81
81
  if (pdfExportProperties.exportType === 'CurrentViewData') {
82
82
  this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.currentViewData, null, true);
83
83
  }
84
- else {
84
+ else if (pdfExportProperties.exportType === 'AllData') {
85
85
  this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.flatData, null, true);
86
86
  }
87
+ else {
88
+ this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.updatedRecords, null, true);
89
+ }
87
90
  this.helper.beforeSinglePageExport['cloneCurrentViewData'] = extend([], this.parent.currentViewData, null, true);
88
91
  data = this.helper.beforeSinglePageExport['cloneFlatData'];
89
92
  }
90
93
  else {
91
- if (pdfExportProperties.exportType === 'CurrentViewData') {
92
- data = this.parent.currentViewData;
94
+ if (!isNullOrUndefined(pdfExportProperties.exportType)) {
95
+ if (pdfExportProperties.exportType === 'CurrentViewData') {
96
+ data = this.parent.currentViewData;
97
+ }
98
+ else {
99
+ data = this.parent.flatData;
100
+ }
93
101
  }
94
102
  else {
95
- data = this.parent.flatData;
103
+ data = this.parent.updatedRecords;
96
104
  }
97
105
  }
98
106
  this.initGantt();