@syncfusion/ej2-gantt 23.2.5 → 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.
- package/CHANGELOG.md +3 -0
- 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 +2980 -336
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +3034 -370
- 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 +383 -1
- package/src/gantt/actions/edit.js +104 -41
- package/src/gantt/actions/keyboard.js +5 -1
- package/src/gantt/actions/pdf-export.js +12 -4
- package/src/gantt/actions/rowdragdrop.js +24 -5
- 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 +513 -78
- 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 +37 -9
- package/src/gantt/base/tree-grid.js +1 -1
- 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 +169 -21
- 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
|
/**
|
|
@@ -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
|
}
|