@syncfusion/ej2-gantt 23.2.7 → 24.1.43
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.
- package/CHANGELOG.md +2 -5
- package/dist/ej2-gantt.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +2993 -332
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +3047 -366
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +21 -21
- package/src/gantt/actions/cell-edit.js +7 -3
- package/src/gantt/actions/chart-scroll.d.ts +9 -1
- package/src/gantt/actions/chart-scroll.js +111 -3
- package/src/gantt/actions/connector-line-edit.js +8 -1
- package/src/gantt/actions/context-menu.js +2 -2
- package/src/gantt/actions/day-markers.d.ts +2 -1
- package/src/gantt/actions/dependency.js +2 -2
- package/src/gantt/actions/dialog-edit.d.ts +24 -0
- package/src/gantt/actions/dialog-edit.js +393 -2
- package/src/gantt/actions/edit.js +68 -21
- package/src/gantt/actions/keyboard.js +5 -1
- package/src/gantt/actions/pdf-export.js +12 -4
- package/src/gantt/actions/rowdragdrop.js +20 -9
- package/src/gantt/actions/selection.js +6 -3
- package/src/gantt/actions/taskbar-edit.d.ts +14 -0
- package/src/gantt/actions/taskbar-edit.js +517 -82
- package/src/gantt/actions/toolbar.js +4 -1
- package/src/gantt/base/css-constants.d.ts +2 -0
- package/src/gantt/base/css-constants.js +2 -0
- package/src/gantt/base/enum.d.ts +22 -0
- package/src/gantt/base/gantt-chart.js +63 -21
- package/src/gantt/base/gantt-model.d.ts +9 -1
- package/src/gantt/base/gantt.d.ts +11 -1
- package/src/gantt/base/gantt.js +46 -18
- package/src/gantt/base/interface.d.ts +135 -3
- package/src/gantt/base/splitter.js +6 -0
- package/src/gantt/base/task-processor.d.ts +1 -1
- package/src/gantt/base/task-processor.js +38 -10
- package/src/gantt/export/export-helper.d.ts +12 -0
- package/src/gantt/export/export-helper.js +316 -9
- package/src/gantt/export/pdf-base/pdf-grid-table.js +14 -1
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +36 -0
- package/src/gantt/export/pdf-connector-line.js +137 -32
- package/src/gantt/export/pdf-event-marker.d.ts +10 -0
- package/src/gantt/export/pdf-event-marker.js +57 -0
- package/src/gantt/export/pdf-gantt.d.ts +2 -0
- package/src/gantt/export/pdf-gantt.js +30 -10
- package/src/gantt/export/pdf-taskbar.d.ts +23 -2
- package/src/gantt/export/pdf-taskbar.js +771 -43
- package/src/gantt/export/pdf-timeline.d.ts +9 -0
- package/src/gantt/export/pdf-timeline.js +98 -20
- package/src/gantt/models/column.d.ts +12 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +29 -16
- package/src/gantt/renderer/connector-line.js +8 -5
- package/src/gantt/renderer/edit-tooltip.js +3 -0
- package/src/gantt/renderer/event-marker.js +4 -1
- package/src/gantt/renderer/nonworking-day.js +18 -5
- package/src/gantt/renderer/timeline.d.ts +9 -0
- package/src/gantt/renderer/timeline.js +207 -27
- package/styles/bootstrap-dark.css +77 -16
- package/styles/bootstrap.css +78 -17
- package/styles/bootstrap4.css +78 -17
- package/styles/bootstrap5-dark.css +78 -17
- package/styles/bootstrap5.css +78 -17
- package/styles/fabric-dark.css +78 -17
- package/styles/fabric.css +78 -17
- package/styles/fluent-dark.css +78 -17
- package/styles/fluent.css +78 -17
- package/styles/gantt/_bootstrap-dark-definition.scss +7 -2
- package/styles/gantt/_bootstrap-definition.scss +7 -2
- package/styles/gantt/_bootstrap4-definition.scss +7 -2
- package/styles/gantt/_bootstrap5-definition.scss +7 -2
- package/styles/gantt/_fabric-dark-definition.scss +7 -2
- package/styles/gantt/_fabric-definition.scss +7 -2
- package/styles/gantt/_fluent-definition.scss +7 -2
- package/styles/gantt/_fusionnew-definition.scss +6 -2
- package/styles/gantt/_highcontrast-definition.scss +7 -2
- package/styles/gantt/_highcontrast-light-definition.scss +7 -2
- package/styles/gantt/_layout.scss +92 -20
- package/styles/gantt/_material-dark-definition.scss +7 -2
- package/styles/gantt/_material-definition.scss +7 -2
- package/styles/gantt/_material3-definition.scss +7 -2
- package/styles/gantt/_tailwind-definition.scss +6 -1
- package/styles/gantt/_theme.scss +11 -0
- package/styles/gantt/bootstrap-dark.css +77 -16
- package/styles/gantt/bootstrap.css +78 -17
- package/styles/gantt/bootstrap4.css +78 -17
- package/styles/gantt/bootstrap5-dark.css +78 -17
- package/styles/gantt/bootstrap5.css +78 -17
- package/styles/gantt/fabric-dark.css +78 -17
- package/styles/gantt/fabric.css +78 -17
- package/styles/gantt/fluent-dark.css +78 -17
- package/styles/gantt/fluent.css +78 -17
- package/styles/gantt/highcontrast-light.css +78 -17
- package/styles/gantt/highcontrast.css +78 -17
- package/styles/gantt/material-dark.css +78 -17
- package/styles/gantt/material.css +78 -17
- package/styles/gantt/material3-dark.css +77 -16
- package/styles/gantt/material3.css +77 -16
- package/styles/gantt/tailwind-dark.css +78 -17
- package/styles/gantt/tailwind.css +78 -17
- package/styles/highcontrast-light.css +78 -17
- package/styles/highcontrast.css +78 -17
- package/styles/material-dark.css +78 -17
- package/styles/material.css +78 -17
- package/styles/material3-dark.css +77 -16
- package/styles/material3.css +77 -16
- package/styles/tailwind-dark.css +78 -17
- 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
|
/**
|
|
@@ -644,8 +754,8 @@ var DialogEdit = /** @class */ (function () {
|
|
|
644
754
|
else {
|
|
645
755
|
_this.parent.showSpinner();
|
|
646
756
|
}
|
|
647
|
-
_this.renderTabItems();
|
|
648
757
|
if (!arg.cancel) {
|
|
758
|
+
_this.renderTabItems();
|
|
649
759
|
tabModel.selected = _this.tabSelectedEvent.bind(_this);
|
|
650
760
|
tabModel.height = _this.parent.isAdaptive ? '100%' : 'auto';
|
|
651
761
|
tabModel.overflowMode = 'Scrollable';
|
|
@@ -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();
|
|
@@ -677,11 +792,287 @@ var DialogEdit = /** @class */ (function () {
|
|
|
677
792
|
}
|
|
678
793
|
});
|
|
679
794
|
}
|
|
795
|
+
else {
|
|
796
|
+
arg.cancel = false;
|
|
797
|
+
if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
798
|
+
_this.parent.hideMaskRow();
|
|
799
|
+
}
|
|
800
|
+
else {
|
|
801
|
+
_this.parent.hideSpinner();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
};
|
|
806
|
+
DialogEdit.prototype.changeFormObj = function (actionCompleteArgs, isCustomTab) {
|
|
807
|
+
if (!this.storeColumn) {
|
|
808
|
+
this.storeColumn = this.parent.treeGrid.grid.getColumns();
|
|
809
|
+
}
|
|
810
|
+
if (!this.taskfields) {
|
|
811
|
+
this.taskfields = this.parent.taskFields['properties'];
|
|
812
|
+
}
|
|
813
|
+
if (!this.storeValidTab) {
|
|
814
|
+
this.storeValidTab = this.getFilteredDialogFields();
|
|
815
|
+
}
|
|
816
|
+
var typeOrder = ['General', 'Resources', 'Dependency', 'Custom'];
|
|
817
|
+
// Custom comparator function to sort by type order
|
|
818
|
+
function customComparator(a, b) {
|
|
819
|
+
var typeA = a.type || ''; // Default to empty string if type is missing
|
|
820
|
+
var typeB = b.type || '';
|
|
821
|
+
var indexA = typeOrder.indexOf(typeA);
|
|
822
|
+
var indexB = typeOrder.indexOf(typeB);
|
|
823
|
+
return indexA - indexB;
|
|
824
|
+
}
|
|
825
|
+
// Sort the array based on the custom comparator
|
|
826
|
+
if (this.storeValidTab) {
|
|
827
|
+
this.storeValidTab.sort(customComparator);
|
|
828
|
+
}
|
|
829
|
+
if (this.customFieldColumn.length === 0 || this.taskFieldColumn.length === 0) {
|
|
830
|
+
this.validateColumn(this.storeColumn, this.taskfields, this.storeValidTab);
|
|
831
|
+
}
|
|
832
|
+
if ((this.isFromAddDialog || this.isFromEditDialog) && this.isSingleCustomTab()) {
|
|
833
|
+
isCustomTab = true;
|
|
834
|
+
this.singleTab = true;
|
|
835
|
+
}
|
|
836
|
+
if (this.isFromAddDialog) {
|
|
837
|
+
if (this.parent.addDialogFields.length > 1) {
|
|
838
|
+
if (this.parent.addDialogFields[0].type === 'Resources'
|
|
839
|
+
|| this.parent.addDialogFields[0].type === 'Dependency') {
|
|
840
|
+
this.firstOccuringTab = this.parent.addDialogFields[0].type;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (this.parent.addDialogFields.length == 1) {
|
|
844
|
+
this.firstOccuringTab = this.parent.addDialogFields[0].type;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
else if (this.isFromEditDialog) {
|
|
848
|
+
if (this.parent.editDialogFields.length > 1) {
|
|
849
|
+
if (this.parent.editDialogFields[0].type === 'Resources'
|
|
850
|
+
|| this.parent.editDialogFields[0].type === 'Dependency') {
|
|
851
|
+
this.firstOccuringTab = this.parent.editDialogFields[0].type;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (this.parent.editDialogFields.length == 1) {
|
|
855
|
+
this.firstOccuringTab = this.parent.editDialogFields[0].type;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
if (this.isFromEditDialog) {
|
|
859
|
+
if (this.parent.editDialogFields.length > 1) {
|
|
860
|
+
if (this.parent.editDialogFields[0].type == 'Custom') {
|
|
861
|
+
isCustomTab = true;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
if (this.isFromAddDialog) {
|
|
866
|
+
if (this.parent.addDialogFields.length > 1) {
|
|
867
|
+
if (this.parent.addDialogFields[0].type == 'Custom') {
|
|
868
|
+
isCustomTab = true;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (isCustomTab) {
|
|
873
|
+
this.CustomformObj = actionCompleteArgs.querySelector('.e-edit-form-row');
|
|
874
|
+
if (this.CustomformObj === null) {
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
var validationRulesArray = {};
|
|
878
|
+
for (var i = 0; i < this.customFieldColumn.length; i++) {
|
|
879
|
+
var column = this.customFieldColumn[parseInt(i.toString(), 10)];
|
|
880
|
+
if (!column.visible) {
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
if (column.validationRules) {
|
|
884
|
+
validationRulesArray[column.field] = column.validationRules;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
if (Object.keys(validationRulesArray).length > 0) {
|
|
888
|
+
this.CustomformObj = this.createFormObj(this.CustomformObj, validationRulesArray);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
this.formObj = actionCompleteArgs.querySelector('.e-edit-form-row');
|
|
893
|
+
if (this.formObj === null) {
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
var validationRulesArray = {};
|
|
897
|
+
for (var i = 0; i < this.taskFieldColumn.length; i++) {
|
|
898
|
+
var column = this.taskFieldColumn[parseInt(i.toString(), 10)];
|
|
899
|
+
if (!column.visible) {
|
|
900
|
+
continue;
|
|
901
|
+
}
|
|
902
|
+
if (column.validationRules) {
|
|
903
|
+
validationRulesArray[column.field] = column.validationRules;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (Object.keys(validationRulesArray).length > 0) {
|
|
907
|
+
this.formObj = this.createFormObj(this.formObj, validationRulesArray);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (this.isFromAddDialog == true || this.isFromEditDialog) {
|
|
911
|
+
this.isAddingDialog = this.isFromAddDialog;
|
|
912
|
+
this.isEditingDialog = this.isFromEditDialog;
|
|
913
|
+
}
|
|
914
|
+
this.isFromAddDialog = false;
|
|
915
|
+
this.isFromEditDialog = false;
|
|
916
|
+
isCustomTab = false;
|
|
917
|
+
};
|
|
918
|
+
DialogEdit.prototype.getFilteredDialogFields = function () {
|
|
919
|
+
var dialogFields = this.isFromAddDialog
|
|
920
|
+
? this.parent.addDialogFields
|
|
921
|
+
: this.parent.editDialogFields;
|
|
922
|
+
if (dialogFields.length !== 0) {
|
|
923
|
+
return dialogFields.filter(function (obj) { return obj.type === "General" || obj.type === "Custom"; });
|
|
924
|
+
}
|
|
925
|
+
return null;
|
|
926
|
+
};
|
|
927
|
+
DialogEdit.prototype.isSingleCustomTab = function () {
|
|
928
|
+
var dialogFields = this.isFromAddDialog
|
|
929
|
+
? this.parent.addDialogFields
|
|
930
|
+
: this.parent.editDialogFields;
|
|
931
|
+
return this.isFromAddDialog || this.isFromEditDialog
|
|
932
|
+
? dialogFields.length === 1 && dialogFields[0].type === 'Custom'
|
|
933
|
+
: false;
|
|
934
|
+
};
|
|
935
|
+
DialogEdit.prototype.validateColumn = function (storeColumn, taskfields, storeValidTab) {
|
|
936
|
+
var _this = this;
|
|
937
|
+
storeColumn.forEach(function (column) {
|
|
938
|
+
var field = column.field;
|
|
939
|
+
var isValueMatching = false;
|
|
940
|
+
var taskfieldValues = [];
|
|
941
|
+
if (_this.parent.customColumns.indexOf(field) === -1) {
|
|
942
|
+
isValueMatching = true;
|
|
943
|
+
}
|
|
944
|
+
if (isValueMatching) {
|
|
945
|
+
if ((_this.isFromAddDialog || _this.isFromEditDialog) && storeValidTab) {
|
|
946
|
+
if (storeValidTab.some(function (obj) { return obj.fields.includes(column.field); })) {
|
|
947
|
+
_this.taskFieldColumn.push(column);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
_this.taskFieldColumn.push(column);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
if ((_this.isFromAddDialog || _this.isFromEditDialog) && storeValidTab) {
|
|
956
|
+
if (storeValidTab.some(function (obj) { return obj.fields.includes(column.field); })) {
|
|
957
|
+
_this.customFieldColumn.push(column);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
_this.customFieldColumn.push(column);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
680
964
|
});
|
|
681
965
|
};
|
|
966
|
+
DialogEdit.prototype.createFormObj = function (form, rules) {
|
|
967
|
+
var _this = this;
|
|
968
|
+
return new FormValidator(form, {
|
|
969
|
+
rules: rules,
|
|
970
|
+
locale: this.parent.locale,
|
|
971
|
+
validationComplete: function (args) {
|
|
972
|
+
_this.validationComplete(args);
|
|
973
|
+
},
|
|
974
|
+
customPlacement: function (inputElement, error) {
|
|
975
|
+
var nameAttribute = inputElement.getAttribute('name');
|
|
976
|
+
if (nameAttribute) {
|
|
977
|
+
var columnName = nameAttribute;
|
|
978
|
+
_this.valErrorPlacement(inputElement, error, columnName);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
DialogEdit.prototype.valErrorPlacement = function (inputElement, error, columnName) {
|
|
984
|
+
var id = columnName + "-tooltip";
|
|
985
|
+
var elem = this.getElemTable(inputElement);
|
|
986
|
+
if (!elem) {
|
|
987
|
+
this.createTooltip(inputElement, error, id);
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
var tooltipContent = elem.querySelector('.e-tip-content');
|
|
991
|
+
if (tooltipContent) {
|
|
992
|
+
tooltipContent.innerHTML = error.outerHTML;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
DialogEdit.prototype.createTooltip = function (inputElement, errorMessage, id, display) {
|
|
997
|
+
if (display === void 0) { display = 'block'; }
|
|
998
|
+
var existingTooltip = document.getElementById(id);
|
|
999
|
+
if (existingTooltip) {
|
|
1000
|
+
existingTooltip.remove();
|
|
1001
|
+
}
|
|
1002
|
+
var parentElement = inputElement.parentElement;
|
|
1003
|
+
if (parentElement) {
|
|
1004
|
+
parentElement.style.position = 'relative';
|
|
1005
|
+
}
|
|
1006
|
+
var tooltipContainer = document.createElement('div');
|
|
1007
|
+
tooltipContainer.className = 'e-tooltip-wrap e-lib e-control e-popup e-griderror';
|
|
1008
|
+
tooltipContainer.style.display = display;
|
|
1009
|
+
tooltipContainer.style.zIndex = '1000';
|
|
1010
|
+
var labelId = id + "-label";
|
|
1011
|
+
var tooltipLabel = document.createElement('div');
|
|
1012
|
+
tooltipLabel.id = labelId;
|
|
1013
|
+
tooltipLabel.className = 'sr-only';
|
|
1014
|
+
var tooltipContent = document.createElement('div');
|
|
1015
|
+
tooltipContent.className = 'e-tip-content';
|
|
1016
|
+
var errorMessageElement = document.createElement('div');
|
|
1017
|
+
errorMessageElement.className = 'error-message';
|
|
1018
|
+
errorMessageElement.appendChild(errorMessage.cloneNode(true));
|
|
1019
|
+
var arrow = document.createElement('div');
|
|
1020
|
+
arrow.className = 'e-arrow-tip e-tip-top';
|
|
1021
|
+
arrow.appendChild(document.createElement('div')).className = 'e-arrow-tip-outer e-tip-top';
|
|
1022
|
+
arrow.appendChild(document.createElement('div')).className = 'e-arrow-tip-inner e-tip-top';
|
|
1023
|
+
tooltipContainer.setAttribute('aria-labelledby', labelId);
|
|
1024
|
+
tooltipContent.appendChild(errorMessageElement);
|
|
1025
|
+
tooltipContainer.appendChild(tooltipContent);
|
|
1026
|
+
tooltipContainer.appendChild(arrow);
|
|
1027
|
+
tooltipContainer.style.top = '125%';
|
|
1028
|
+
tooltipContainer.style.left = '50%';
|
|
1029
|
+
tooltipContainer.style.transform = 'translateX(-50%)';
|
|
1030
|
+
if (parentElement) {
|
|
1031
|
+
parentElement.appendChild(tooltipLabel);
|
|
1032
|
+
parentElement.appendChild(tooltipContainer);
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
DialogEdit.prototype.getElemTable = function (inputElement) {
|
|
1036
|
+
var parentElement = inputElement.parentElement;
|
|
1037
|
+
if (parentElement) {
|
|
1038
|
+
return parentElement.querySelector(".e-tooltip-wrap");
|
|
1039
|
+
}
|
|
1040
|
+
return null;
|
|
1041
|
+
};
|
|
1042
|
+
DialogEdit.prototype.validationComplete = function (args) {
|
|
1043
|
+
var elem = this.getElemTable(args.element);
|
|
1044
|
+
if (elem) {
|
|
1045
|
+
if (args.status === 'failure') {
|
|
1046
|
+
elem.style.display = '';
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
elem.style.display = 'none';
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
682
1053
|
DialogEdit.prototype.tabSelectedEvent = function (args) {
|
|
683
1054
|
var ganttObj = this.parent;
|
|
684
1055
|
var id = args.selectedContent.childNodes[0].id;
|
|
1056
|
+
if (id == ganttObj.element.id + 'DependencyTabContainer') {
|
|
1057
|
+
this.storeDependencyTab = args.selectedContent;
|
|
1058
|
+
}
|
|
1059
|
+
if (id == ganttObj.element.id + 'ResourcesTabContainer') {
|
|
1060
|
+
this.storeResourceTab = args.selectedContent;
|
|
1061
|
+
}
|
|
1062
|
+
if (id == ganttObj.element.id + 'Custom0TabContainer') {
|
|
1063
|
+
var columns = this.parent.treeGrid.grid.getColumns();
|
|
1064
|
+
var isValidateColumn = columns.some(function (obj) { return obj.validationRules; });
|
|
1065
|
+
if (isValidateColumn) {
|
|
1066
|
+
this.changeFormObj(args.selectedContent, true);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (id == ganttObj.element.id + 'GeneralTabContainer') {
|
|
1070
|
+
var columns = this.parent.treeGrid.grid.getColumns();
|
|
1071
|
+
var isValidateColumn = columns.some(function (obj) { return obj.validationRules; });
|
|
1072
|
+
if (isValidateColumn) {
|
|
1073
|
+
this.changeFormObj(args.selectedContent, false);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
685
1076
|
if (this.parent.isAdaptive) {
|
|
686
1077
|
this.responsiveTabContent(id, ganttObj);
|
|
687
1078
|
}
|
|
@@ -985,7 +1376,7 @@ var DialogEdit = /** @class */ (function () {
|
|
|
985
1376
|
DialogEdit.prototype.validateDuration = function (ganttData) {
|
|
986
1377
|
var ganttProp = ganttData.ganttProperties;
|
|
987
1378
|
if (!this.dialogEditValidationFlag) {
|
|
988
|
-
if (isNullOrUndefined(ganttProp.duration)) {
|
|
1379
|
+
if (isNullOrUndefined(ganttProp.duration) && !isScheduledTask(ganttProp) && !isNullOrUndefined(ganttProp.startDate)) {
|
|
989
1380
|
this.parent.setRecordValue('endDate', null, ganttProp, true);
|
|
990
1381
|
this.parent.setRecordValue('isMilestone', false, ganttProp, true);
|
|
991
1382
|
}
|
|
@@ -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
|
|
917
|
-
|
|
918
|
-
|
|
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
|
-
|
|
1426
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
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
|
|
3923
|
-
if (this.treeGridData[
|
|
3924
|
-
gridIndx =
|
|
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] :
|