@syncfusion/ej2-gantt 23.2.5 → 23.2.7
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 +13 -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 +69 -40
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +69 -40
- 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 +13 -13
- package/src/gantt/actions/edit.js +46 -30
- package/src/gantt/actions/rowdragdrop.js +13 -5
- package/src/gantt/actions/taskbar-edit.js +4 -4
- package/src/gantt/base/gantt-chart.js +1 -1
- package/src/gantt/base/tree-grid.js +1 -1
- package/src/gantt/renderer/timeline.js +5 -0
|
@@ -4839,7 +4839,7 @@ var GanttChart = /** @__PURE__ @class */ (function () {
|
|
|
4839
4839
|
if (this.parent.editSettings.allowTaskbarEditing && this.parent.element.querySelector('.e-left-resize-gripper')) {
|
|
4840
4840
|
isTaskbarEdited = true;
|
|
4841
4841
|
}
|
|
4842
|
-
if (!isTaskbarEdited) {
|
|
4842
|
+
if (!isTaskbarEdited || e.button == 2) {
|
|
4843
4843
|
if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
|
|
4844
4844
|
this.parent.treeGrid.endEdit();
|
|
4845
4845
|
}
|
|
@@ -6118,6 +6118,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6118
6118
|
if (!this.parent.isFromOnPropertyChange) {
|
|
6119
6119
|
this.parent.updateProjectDates(this.parent.cloneProjectStartDate, this.parent.cloneProjectEndDate, this.parent.isTimelineRoundOff);
|
|
6120
6120
|
}
|
|
6121
|
+
var timelineContainer = this.parent.element.getElementsByClassName('e-timeline-header-container')[0]['offsetHeight'];
|
|
6122
|
+
this.parent.element.getElementsByClassName('e-gridcontent')[0]['style'].height = 'calc(100% - ' + timelineContainer + 'px)';
|
|
6123
|
+
// eslint-disable-next-line
|
|
6124
|
+
this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0]['style'].height = 'calc(100% - ' + timelineContainer + 'px)';
|
|
6121
6125
|
};
|
|
6122
6126
|
/**
|
|
6123
6127
|
* Function used to refresh Gantt rows.
|
|
@@ -6332,6 +6336,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6332
6336
|
}
|
|
6333
6337
|
this.changeTimelineSettings(newTimeline);
|
|
6334
6338
|
this.parent.isTimelineRoundOff = isNullOrUndefined(this.parent.projectStartDate) ? true : false;
|
|
6339
|
+
this.isZoomToFit = false;
|
|
6335
6340
|
};
|
|
6336
6341
|
Timeline.prototype.bottomTierCellWidthCalc = function (mode, zoomLevel, date) {
|
|
6337
6342
|
var convertedMilliSeconds;
|
|
@@ -8304,7 +8309,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
|
|
|
8304
8309
|
else {
|
|
8305
8310
|
column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('duration');
|
|
8306
8311
|
}
|
|
8307
|
-
column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) ? null :
|
|
8312
|
+
column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) && !isNullOrUndefined(column.edit.read) ? null :
|
|
8308
8313
|
this.durationValueAccessor.bind(this);
|
|
8309
8314
|
column.editType = column.editType ? column.editType : 'stringedit';
|
|
8310
8315
|
column.type = column.type ? column.type : 'string';
|
|
@@ -20638,7 +20643,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
20638
20643
|
pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
|
|
20639
20644
|
/* To render the milestone in proper date while editing */
|
|
20640
20645
|
if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
|
|
20641
|
-
pStartDate.setDate(pStartDate.getDate()
|
|
20646
|
+
// pStartDate.setDate(pStartDate.getDate()-1);
|
|
20642
20647
|
this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
|
|
20643
20648
|
pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
|
|
20644
20649
|
}
|
|
@@ -20648,9 +20653,9 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
20648
20653
|
if (this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && !this.parent.isInDst(pStartDate)) {
|
|
20649
20654
|
pStartDate.setTime(pStartDate.getTime() + (60 * 60 * 1000));
|
|
20650
20655
|
}
|
|
20651
|
-
else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
|
|
20652
|
-
|
|
20653
|
-
}
|
|
20656
|
+
// else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
|
|
20657
|
+
// pStartDate.setTime(pStartDate.getTime() - (60 * 60 * 1000));
|
|
20658
|
+
// }
|
|
20654
20659
|
}
|
|
20655
20660
|
return pStartDate;
|
|
20656
20661
|
};
|
|
@@ -27324,34 +27329,42 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27324
27329
|
var predecessorCollection = parentRecordTaskData.predecessor;
|
|
27325
27330
|
var childRecord;
|
|
27326
27331
|
var predecessorIndex;
|
|
27332
|
+
var validPredecessor;
|
|
27327
27333
|
var updatedPredecessor = [];
|
|
27328
27334
|
for (var count = 0; count < len; count++) {
|
|
27329
|
-
|
|
27330
|
-
|
|
27331
|
-
|
|
27332
|
-
|
|
27333
|
-
|
|
27334
|
-
|
|
27335
|
-
|
|
27336
|
-
|
|
27337
|
-
|
|
27338
|
-
|
|
27339
|
-
|
|
27340
|
-
|
|
27341
|
-
|
|
27342
|
-
|
|
27343
|
-
|
|
27344
|
-
|
|
27345
|
-
|
|
27346
|
-
|
|
27347
|
-
|
|
27348
|
-
|
|
27349
|
-
|
|
27350
|
-
|
|
27335
|
+
var fromRecord = this.parent.getRecordByID(predecessorCollection[count].from);
|
|
27336
|
+
var toRecord = this.parent.getRecordByID(predecessorCollection[count].to);
|
|
27337
|
+
validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
|
|
27338
|
+
if (!validPredecessor) {
|
|
27339
|
+
if (predecessorCollection[count].to === parentRecordTaskData.rowUniqueID.toString()) {
|
|
27340
|
+
childRecord = this.parent.getRecordByID(predecessorCollection[count].from);
|
|
27341
|
+
predecessorIndex = getIndex(predecessorCollection[count], 'from', childRecord.ganttProperties.predecessor, 'to');
|
|
27342
|
+
// eslint-disable-next-line
|
|
27343
|
+
var predecessorCollections = (extend([], childRecord.ganttProperties.predecessor, [], true));
|
|
27344
|
+
predecessorCollections.splice(predecessorIndex, 1);
|
|
27345
|
+
this.parent.setRecordValue('predecessor', predecessorCollections, childRecord.ganttProperties, true);
|
|
27346
|
+
}
|
|
27347
|
+
else if (predecessorCollection[count].from === parentRecordTaskData.rowUniqueID.toString()) {
|
|
27348
|
+
childRecord = this.parent.getRecordByID(predecessorCollection[count].to);
|
|
27349
|
+
var prdcList = (childRecord.ganttProperties.predecessorsName.toString()).split(',');
|
|
27350
|
+
var str = predecessorCollection[count].from + predecessorCollection[count].type;
|
|
27351
|
+
var ind = prdcList.indexOf(str);
|
|
27352
|
+
prdcList.splice(ind, 1);
|
|
27353
|
+
this.parent.setRecordValue('predecessorsName', prdcList.join(','), childRecord.ganttProperties, true);
|
|
27354
|
+
this.parent.setRecordValue(this.parent.taskFields.dependency, prdcList.join(','), childRecord);
|
|
27355
|
+
predecessorIndex = getIndex(predecessorCollection[count], 'from', childRecord.ganttProperties.predecessor, 'to');
|
|
27356
|
+
// eslint-disable-next-line
|
|
27357
|
+
var temppredecessorCollection = (extend([], childRecord.ganttProperties.predecessor, [], true));
|
|
27358
|
+
temppredecessorCollection.splice(predecessorIndex, 1);
|
|
27359
|
+
this.parent.setRecordValue('predecessor', temppredecessorCollection, childRecord.ganttProperties, true);
|
|
27360
|
+
this.parent.predecessorModule.validatePredecessorDates(childRecord);
|
|
27361
|
+
}
|
|
27351
27362
|
}
|
|
27352
27363
|
}
|
|
27353
|
-
|
|
27354
|
-
|
|
27364
|
+
if (!validPredecessor) {
|
|
27365
|
+
this.parent.setRecordValue('predecessor', updatedPredecessor, parentRecord.ganttProperties, true);
|
|
27366
|
+
this.parent.setRecordValue('predecessorsName', '', parentRecord.ganttProperties, true);
|
|
27367
|
+
}
|
|
27355
27368
|
};
|
|
27356
27369
|
/**
|
|
27357
27370
|
* @param {IPredecessor[]} predecessorCollection .
|
|
@@ -28318,11 +28331,19 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
28318
28331
|
}
|
|
28319
28332
|
if (this.dropPosition === 'middleSegment') {
|
|
28320
28333
|
if (droppedRec.ganttProperties.predecessor) {
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
28324
|
-
|
|
28325
|
-
|
|
28334
|
+
var len = droppedRec.ganttProperties.predecessor.length;
|
|
28335
|
+
for (var count = 0; count < len; count++) {
|
|
28336
|
+
var fromRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].from);
|
|
28337
|
+
var toRecord = this.parent.getRecordByID(droppedRec.ganttProperties.predecessor[count].to);
|
|
28338
|
+
var validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
|
|
28339
|
+
if (droppedRec.ganttProperties.predecessor && !validPredecessor) {
|
|
28340
|
+
this.parent.editModule.removePredecessorOnDelete(droppedRec);
|
|
28341
|
+
droppedRec.ganttProperties.predecessor = null;
|
|
28342
|
+
droppedRec.ganttProperties.predecessorsName = null;
|
|
28343
|
+
droppedRec[this.parent.taskFields.dependency] = null;
|
|
28344
|
+
droppedRec.taskData[this.parent.taskFields.dependency] = null;
|
|
28345
|
+
}
|
|
28346
|
+
}
|
|
28326
28347
|
}
|
|
28327
28348
|
if (droppedRec.ganttProperties.isMilestone) {
|
|
28328
28349
|
this.parent.setRecordValue('isMilestone', false, droppedRec.ganttProperties, true);
|
|
@@ -32862,11 +32883,19 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
32862
32883
|
}
|
|
32863
32884
|
if (this.dropPosition === 'middleSegment') {
|
|
32864
32885
|
if (droppedRecord.ganttProperties.predecessor) {
|
|
32865
|
-
|
|
32866
|
-
|
|
32867
|
-
|
|
32868
|
-
|
|
32869
|
-
|
|
32886
|
+
var len = droppedRecord.ganttProperties.predecessor.length;
|
|
32887
|
+
for (var count_1 = 0; count_1 < len; count_1++) {
|
|
32888
|
+
var fromRecord = this.parent.getRecordByID(droppedRecord.ganttProperties.predecessor[count_1].from);
|
|
32889
|
+
var toRecord = this.parent.getRecordByID(droppedRecord.ganttProperties.predecessor[count_1].to);
|
|
32890
|
+
var validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
|
|
32891
|
+
if (droppedRecord.ganttProperties.predecessor && !validPredecessor) {
|
|
32892
|
+
this.parent.editModule.removePredecessorOnDelete(droppedRecord);
|
|
32893
|
+
droppedRecord.ganttProperties.predecessor = null;
|
|
32894
|
+
droppedRecord.ganttProperties.predecessorsName = null;
|
|
32895
|
+
droppedRecord[this.parent.taskFields.dependency] = null;
|
|
32896
|
+
droppedRecord.taskData[this.parent.taskFields.dependency] = null;
|
|
32897
|
+
}
|
|
32898
|
+
}
|
|
32870
32899
|
}
|
|
32871
32900
|
if (droppedRecord.ganttProperties.isMilestone) {
|
|
32872
32901
|
this.parent.setRecordValue('isMilestone', false, droppedRecord.ganttProperties, true);
|