@syncfusion/ej2-gantt 19.4.47 → 19.4.53
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 +30 -0
- package/README.md +1 -1
- 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 +181 -33
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +181 -33
- 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 +18 -18
- package/src/gantt/actions/cell-edit.d.ts +1 -0
- package/src/gantt/actions/cell-edit.js +2 -0
- package/src/gantt/actions/dialog-edit.js +18 -2
- package/src/gantt/actions/edit.d.ts +2 -0
- package/src/gantt/actions/edit.js +97 -14
- package/src/gantt/actions/keyboard.js +1 -1
- package/src/gantt/base/tree-grid.js +4 -0
- package/src/gantt/renderer/chart-rows.js +28 -10
- package/src/gantt/renderer/timeline.d.ts +1 -0
- package/src/gantt/renderer/timeline.js +31 -6
- package/styles/bootstrap-dark.css +6 -3
- package/styles/bootstrap.css +6 -3
- package/styles/bootstrap4.css +6 -3
- package/styles/bootstrap5-dark.css +4 -1
- package/styles/bootstrap5.css +4 -1
- package/styles/fabric-dark.css +3 -0
- package/styles/fabric.css +3 -0
- package/styles/gantt/_bootstrap-dark-definition.scss +3 -3
- package/styles/gantt/_bootstrap-definition.scss +3 -3
- package/styles/gantt/_bootstrap4-definition.scss +3 -3
- package/styles/gantt/_bootstrap5-definition.scss +1 -1
- package/styles/gantt/_fluent-definition.scss +1 -1
- package/styles/gantt/_layout.scss +3 -0
- package/styles/gantt/_tailwind-definition.scss +3 -3
- package/styles/gantt/bootstrap-dark.css +6 -3
- package/styles/gantt/bootstrap.css +6 -3
- package/styles/gantt/bootstrap4.css +6 -3
- package/styles/gantt/bootstrap5-dark.css +4 -1
- package/styles/gantt/bootstrap5.css +4 -1
- package/styles/gantt/fabric-dark.css +3 -0
- package/styles/gantt/fabric.css +3 -0
- package/styles/gantt/highcontrast-light.css +3 -0
- package/styles/gantt/highcontrast.css +3 -0
- package/styles/gantt/material-dark.css +3 -0
- package/styles/gantt/material.css +3 -0
- package/styles/gantt/tailwind-dark.css +6 -3
- package/styles/gantt/tailwind.css +6 -3
- package/styles/highcontrast-light.css +3 -0
- package/styles/highcontrast.css +3 -0
- package/styles/material-dark.css +3 -0
- package/styles/material.css +3 -0
- package/styles/tailwind-dark.css +6 -3
- package/styles/tailwind.css +6 -3
|
@@ -6107,6 +6107,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6107
6107
|
* @private
|
|
6108
6108
|
*/
|
|
6109
6109
|
Timeline.prototype.createTimelineTemplate = function (tier) {
|
|
6110
|
+
var isFirstCell = false;
|
|
6110
6111
|
var parent = this.parent;
|
|
6111
6112
|
var parentTh = '';
|
|
6112
6113
|
var parentTr = '';
|
|
@@ -6123,10 +6124,19 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6123
6124
|
// PDf export collection
|
|
6124
6125
|
var timelineCell = {};
|
|
6125
6126
|
timelineCell.startDate = new Date(startDate.getTime());
|
|
6126
|
-
|
|
6127
|
+
if (mode === 'Month' && tier === 'bottomTier' && ((this.parent.currentZoomingLevel.level === 5) || (this.parent.currentZoomingLevel.level === 6)) && scheduleDateCollection.length === 0) {
|
|
6128
|
+
isFirstCell = true;
|
|
6129
|
+
}
|
|
6130
|
+
parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
|
|
6127
6131
|
scheduleDateCollection.push(new Date(startDate.toString()));
|
|
6128
|
-
|
|
6129
|
-
|
|
6132
|
+
if (isFirstCell) {
|
|
6133
|
+
newTime = this.calculateQuarterEndDate(startDate).getTime();
|
|
6134
|
+
}
|
|
6135
|
+
else {
|
|
6136
|
+
increment = this.getIncrement(startDate, count, mode);
|
|
6137
|
+
newTime = startDate.getTime() + increment;
|
|
6138
|
+
}
|
|
6139
|
+
isFirstCell = false;
|
|
6130
6140
|
startDate.setTime(newTime);
|
|
6131
6141
|
if (startDate >= endDate) {
|
|
6132
6142
|
/* eslint-disable-next-line */
|
|
@@ -6236,6 +6246,21 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6236
6246
|
mode === 'Hour' || mode === 'Minutes') &&
|
|
6237
6247
|
this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
|
|
6238
6248
|
};
|
|
6249
|
+
Timeline.prototype.calculateQuarterEndDate = function (date) {
|
|
6250
|
+
var month = date.getMonth();
|
|
6251
|
+
if (month >= 0 && month <= 2) {
|
|
6252
|
+
return new Date(date.getFullYear(), 3, 1);
|
|
6253
|
+
}
|
|
6254
|
+
else if (month >= 3 && month <= 5) {
|
|
6255
|
+
return new Date(date.getFullYear(), 6, 1);
|
|
6256
|
+
}
|
|
6257
|
+
else if (month >= 6 && month <= 8) {
|
|
6258
|
+
return new Date(date.getFullYear(), 9, 1);
|
|
6259
|
+
}
|
|
6260
|
+
else {
|
|
6261
|
+
return new Date(date.getFullYear() + 1, 0, 1);
|
|
6262
|
+
}
|
|
6263
|
+
};
|
|
6239
6264
|
/**
|
|
6240
6265
|
* To construct template string.
|
|
6241
6266
|
*
|
|
@@ -6249,7 +6274,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6249
6274
|
* @private
|
|
6250
6275
|
*/
|
|
6251
6276
|
/* eslint-disable-next-line */
|
|
6252
|
-
Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell) {
|
|
6277
|
+
Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell, isFirstCell) {
|
|
6253
6278
|
var parentTr = '';
|
|
6254
6279
|
var td = '';
|
|
6255
6280
|
var format = tier === 'topTier' ?
|
|
@@ -6264,7 +6289,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6264
6289
|
this.customFormat(scheduleWeeks, format, tier, mode, formatter);
|
|
6265
6290
|
thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
|
|
6266
6291
|
var cellWidth = thWidth;
|
|
6267
|
-
thWidth = isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate)
|
|
6292
|
+
thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks))
|
|
6268
6293
|
: thWidth;
|
|
6269
6294
|
var isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
|
|
6270
6295
|
var textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
|
|
@@ -6560,7 +6585,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6560
6585
|
var validStartLeft = this.parent.dataOperation.getTaskLeft(validStartDate, false);
|
|
6561
6586
|
var validEndLeft = this.parent.dataOperation.getTaskLeft(validEndDate, false);
|
|
6562
6587
|
var isChanged = void 0;
|
|
6563
|
-
if (!isNullOrUndefined(maxStartLeft) && (maxStartLeft
|
|
6588
|
+
if (!isNullOrUndefined(maxStartLeft) && (maxStartLeft < this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
|
|
6564
6589
|
isChanged = 'prevTimeSpan';
|
|
6565
6590
|
minStartDate = minStartDate > this.timelineStartDate ? this.timelineStartDate : minStartDate;
|
|
6566
6591
|
}
|
|
@@ -6935,6 +6960,10 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
|
|
|
6935
6960
|
};
|
|
6936
6961
|
GanttTreeGrid.prototype.actionBegin = function (args) {
|
|
6937
6962
|
this.parent.notify('actionBegin', args);
|
|
6963
|
+
var flag = getValue('doubleClickTarget', this.parent.treeGrid.editModule);
|
|
6964
|
+
if (flag !== null) {
|
|
6965
|
+
setValue('doubleClickTarget', null, this.parent.treeGrid.editModule);
|
|
6966
|
+
}
|
|
6938
6967
|
this.parent.trigger('actionBegin', args);
|
|
6939
6968
|
}; // eslint-disable-next-line
|
|
6940
6969
|
GanttTreeGrid.prototype.created = function (args) {
|
|
@@ -8339,11 +8368,20 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
|
|
|
8339
8368
|
labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
|
|
8340
8369
|
}
|
|
8341
8370
|
if (labelString !== 'null') {
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8371
|
+
if (isNaN(parseInt(labelString))) {
|
|
8372
|
+
taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
|
|
8373
|
+
(this.taskBarHeight - 1) + 'px; text-align: left;' +
|
|
8374
|
+
'display:' + 'inline-block;' +
|
|
8375
|
+
'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
|
|
8376
|
+
this.taskBarHeight + 'px;">' + labelString + '</span>';
|
|
8377
|
+
}
|
|
8378
|
+
else {
|
|
8379
|
+
taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
|
|
8380
|
+
(this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.viewType === 'ResourceView' ? 'left;' : ';') +
|
|
8381
|
+
'display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') +
|
|
8382
|
+
'width:' + (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
|
|
8383
|
+
this.taskBarHeight + 'px;">' + labelString + '</span>';
|
|
8384
|
+
}
|
|
8347
8385
|
}
|
|
8348
8386
|
var template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
|
|
8349
8387
|
this.splitTaskbar(data, labelString) : (data.ganttProperties.startDate && data.ganttProperties.endDate
|
|
@@ -8942,11 +8980,20 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
|
|
|
8942
8980
|
labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
|
|
8943
8981
|
}
|
|
8944
8982
|
if (labelString !== 'null') {
|
|
8945
|
-
|
|
8946
|
-
taskLabel + '" style="line-height:' +
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8983
|
+
if (isNaN(parseInt(labelString))) {
|
|
8984
|
+
labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
|
|
8985
|
+
(this.taskBarHeight - 1) + 'px; text-align: left;' +
|
|
8986
|
+
'display:' + 'inline-block;' +
|
|
8987
|
+
'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
|
|
8988
|
+
this.taskBarHeight + 'px;">' + labelString + '</span>');
|
|
8989
|
+
}
|
|
8990
|
+
else {
|
|
8991
|
+
labelDiv = this.createDivElement('<span class="' +
|
|
8992
|
+
taskLabel + '" style="line-height:' +
|
|
8993
|
+
(this.taskBarHeight - 1) + 'px; display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') + 'width:' +
|
|
8994
|
+
(this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : ';') + 'px; height:' +
|
|
8995
|
+
this.taskBarHeight + 'px;">' + labelString + '</span>');
|
|
8996
|
+
}
|
|
8950
8997
|
progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
|
|
8951
8998
|
}
|
|
8952
8999
|
var milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
|
|
@@ -12259,7 +12306,7 @@ var FocusModule = /** @__PURE__ @class */ (function () {
|
|
|
12259
12306
|
{
|
|
12260
12307
|
if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
|
|
12261
12308
|
e.preventDefault();
|
|
12262
|
-
ganttObj.addRecord();
|
|
12309
|
+
ganttObj.addRecord(undefined, this.parent.editSettings.newRowPosition);
|
|
12263
12310
|
var focussedElement = ganttObj.element;
|
|
12264
12311
|
focussedElement.focus();
|
|
12265
12312
|
}
|
|
@@ -15623,6 +15670,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
|
|
|
15623
15670
|
* @private
|
|
15624
15671
|
*/
|
|
15625
15672
|
this.isCellEdit = false;
|
|
15673
|
+
this.isResourceCellEdited = false;
|
|
15626
15674
|
this.parent = ganttObj;
|
|
15627
15675
|
this.bindTreeGridProperties();
|
|
15628
15676
|
}
|
|
@@ -16052,6 +16100,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
|
|
|
16052
16100
|
var resourceSettings = this.parent.resourceFields;
|
|
16053
16101
|
var editedResourceId = editedObj[this.parent.taskFields.resourceInfo];
|
|
16054
16102
|
if (editedResourceId) {
|
|
16103
|
+
this.isResourceCellEdited = true;
|
|
16055
16104
|
var tempResourceInfo = this.parent.dataOperation.setResourceInfo(editedObj);
|
|
16056
16105
|
var editedResouceLength = tempResourceInfo.length;
|
|
16057
16106
|
var previousResource = previousData.ganttProperties.resourceInfo;
|
|
@@ -19366,7 +19415,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
|
|
|
19366
19415
|
field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '200px',
|
|
19367
19416
|
edit: {
|
|
19368
19417
|
write: function (args) {
|
|
19369
|
-
var datePickerModel
|
|
19418
|
+
var datePickerModel;
|
|
19419
|
+
if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
|
|
19420
|
+
datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
|
|
19421
|
+
}
|
|
19422
|
+
else {
|
|
19423
|
+
var columnFields = _this.getGeneralColumnFields();
|
|
19424
|
+
var columnModel = _this.getFieldsModel(columnFields);
|
|
19425
|
+
datePickerModel = columnModel[_this.parent.taskFields[fields[i]]];
|
|
19426
|
+
}
|
|
19370
19427
|
var value = args.rowData[args.column.field];
|
|
19371
19428
|
setValue('value', value, datePickerModel);
|
|
19372
19429
|
var datePicker = new _this.inputs[_this.parent.columnByField[_this.parent.taskFields[fields[i]]].editType](datePickerModel);
|
|
@@ -19389,7 +19446,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
|
|
|
19389
19446
|
field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '100px',
|
|
19390
19447
|
edit: {
|
|
19391
19448
|
write: function (args) {
|
|
19392
|
-
var inputTextModel
|
|
19449
|
+
var inputTextModel;
|
|
19450
|
+
if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
|
|
19451
|
+
inputTextModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
|
|
19452
|
+
}
|
|
19453
|
+
else {
|
|
19454
|
+
var columnFields = _this.getGeneralColumnFields();
|
|
19455
|
+
var columnModel = _this.getFieldsModel(columnFields);
|
|
19456
|
+
inputTextModel = columnModel[_this.parent.taskFields[fields[i]]];
|
|
19457
|
+
}
|
|
19393
19458
|
inputTextModel.floatLabelType = 'Never';
|
|
19394
19459
|
var value = args.rowData[args.column.field];
|
|
19395
19460
|
if (!isNullOrUndefined(value)) {
|
|
@@ -22092,9 +22157,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
22092
22157
|
*/
|
|
22093
22158
|
Edit$$1.prototype.updateParentChildRecord = function (data) {
|
|
22094
22159
|
var ganttRecord = data;
|
|
22095
|
-
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && this.parent.
|
|
22160
|
+
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
|
|
22096
22161
|
this.updateChildItems(ganttRecord);
|
|
22097
22162
|
}
|
|
22163
|
+
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
22164
|
+
this.parent.editModule.cellEditModule.isResourceCellEdited = false;
|
|
22165
|
+
}
|
|
22098
22166
|
};
|
|
22099
22167
|
/**
|
|
22100
22168
|
* To update records while changing schedule mode.
|
|
@@ -23546,7 +23614,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23546
23614
|
/*Record Updates*/
|
|
23547
23615
|
recordIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
23548
23616
|
updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem);
|
|
23549
|
-
this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23617
|
+
this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23550
23618
|
break;
|
|
23551
23619
|
case 'Below':
|
|
23552
23620
|
currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
@@ -23560,7 +23628,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23560
23628
|
recordIndex = currentItemIndex + 1;
|
|
23561
23629
|
updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) + 1;
|
|
23562
23630
|
}
|
|
23563
|
-
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23631
|
+
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23564
23632
|
break;
|
|
23565
23633
|
case 'Child':
|
|
23566
23634
|
currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
@@ -23588,7 +23656,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23588
23656
|
this.addRowSelectedItem.ganttProperties.segments = null;
|
|
23589
23657
|
}
|
|
23590
23658
|
}
|
|
23591
|
-
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23659
|
+
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23592
23660
|
break;
|
|
23593
23661
|
}
|
|
23594
23662
|
this.newlyAddedRecordBackup = record;
|
|
@@ -23602,7 +23670,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23602
23670
|
* @returns {void} .
|
|
23603
23671
|
* @private
|
|
23604
23672
|
*/
|
|
23605
|
-
Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem) {
|
|
23673
|
+
Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition) {
|
|
23606
23674
|
var flatRecords = this.parent.flatData;
|
|
23607
23675
|
var currentViewData = this.parent.currentViewData;
|
|
23608
23676
|
var ids = this.parent.ids;
|
|
@@ -23624,7 +23692,15 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23624
23692
|
!isNullOrUndefined(this.parent.dataSource)) {
|
|
23625
23693
|
var child = this.parent.taskFields.child;
|
|
23626
23694
|
if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
|
|
23627
|
-
|
|
23695
|
+
if (rowPosition === 'Above') {
|
|
23696
|
+
parentItem.taskData[child].splice(childIndex, 0, record.taskData);
|
|
23697
|
+
}
|
|
23698
|
+
else if (rowPosition === 'Below') {
|
|
23699
|
+
parentItem.taskData[child].splice(childIndex + 1, 0, record.taskData);
|
|
23700
|
+
}
|
|
23701
|
+
else {
|
|
23702
|
+
parentItem.taskData[child].push(record.taskData);
|
|
23703
|
+
}
|
|
23628
23704
|
}
|
|
23629
23705
|
else {
|
|
23630
23706
|
parentItem.taskData[child] = [];
|
|
@@ -23709,13 +23785,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23709
23785
|
}
|
|
23710
23786
|
for (var i = 0; i < addedRecord.length; i++) {
|
|
23711
23787
|
if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
|
|
23712
|
-
rowPosition = 'Top';
|
|
23788
|
+
rowPosition = rowPosition === 'Bottom' ? 'Bottom' : 'Top';
|
|
23713
23789
|
}
|
|
23714
23790
|
if (rowPosition === 'Top') {
|
|
23715
23791
|
dataSource.splice(0, 0, addedRecord[i].taskData);
|
|
23716
23792
|
}
|
|
23717
23793
|
else if (rowPosition === 'Bottom') {
|
|
23718
|
-
dataSource.push(addedRecord[i]);
|
|
23794
|
+
dataSource.push(addedRecord[i].taskData);
|
|
23719
23795
|
}
|
|
23720
23796
|
else {
|
|
23721
23797
|
if (!isNullOrUndefined(taskFields.id) && !isNullOrUndefined(taskFields.parentID)) {
|
|
@@ -23868,7 +23944,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23868
23944
|
else {
|
|
23869
23945
|
if (_this.parent.viewType === 'ProjectView') {
|
|
23870
23946
|
if ((rowPosition === 'Top' || rowPosition === 'Bottom') ||
|
|
23871
|
-
((rowPosition === 'Above' || rowPosition === 'Below') && !args.data.parentItem)) {
|
|
23947
|
+
((rowPosition === 'Above' || rowPosition === 'Below' || rowPosition === 'Child') && !args.data.parentItem)) {
|
|
23872
23948
|
if (args.data instanceof Array) {
|
|
23873
23949
|
_this.updateRealDataSource(args.data, rowPosition);
|
|
23874
23950
|
}
|
|
@@ -23911,6 +23987,59 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23911
23987
|
* @returns {void} .
|
|
23912
23988
|
* @private
|
|
23913
23989
|
*/
|
|
23990
|
+
Edit$$1.prototype.createNewRecord = function () {
|
|
23991
|
+
var tempRecord = {};
|
|
23992
|
+
var ganttColumns = this.parent.ganttColumns;
|
|
23993
|
+
var taskSettingsFields = this.parent.taskFields;
|
|
23994
|
+
var taskId = this.parent.editModule.getNewTaskId();
|
|
23995
|
+
for (var i = 0; i < ganttColumns.length; i++) {
|
|
23996
|
+
var fieldName = ganttColumns[i].field;
|
|
23997
|
+
if (fieldName === taskSettingsFields.id) {
|
|
23998
|
+
tempRecord[fieldName] = taskId;
|
|
23999
|
+
}
|
|
24000
|
+
else if (ganttColumns[i].field === taskSettingsFields.startDate) {
|
|
24001
|
+
if (isNullOrUndefined(tempRecord[taskSettingsFields.endDate])) {
|
|
24002
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
|
|
24003
|
+
}
|
|
24004
|
+
else {
|
|
24005
|
+
tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.endDate]);
|
|
24006
|
+
}
|
|
24007
|
+
if (this.parent.timezone) {
|
|
24008
|
+
tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
|
|
24009
|
+
}
|
|
24010
|
+
}
|
|
24011
|
+
else if (ganttColumns[i].field === taskSettingsFields.endDate) {
|
|
24012
|
+
if (isNullOrUndefined(tempRecord[taskSettingsFields.startDate])) {
|
|
24013
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
|
|
24014
|
+
}
|
|
24015
|
+
else {
|
|
24016
|
+
tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.startDate]);
|
|
24017
|
+
}
|
|
24018
|
+
if (this.parent.timezone) {
|
|
24019
|
+
tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
|
|
24020
|
+
}
|
|
24021
|
+
}
|
|
24022
|
+
else if (ganttColumns[i].field === taskSettingsFields.duration) {
|
|
24023
|
+
tempRecord[fieldName] = 1;
|
|
24024
|
+
}
|
|
24025
|
+
else if (ganttColumns[i].field === taskSettingsFields.name) {
|
|
24026
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule['localeObj'].getConstant('addDialogTitle') + ' ' + taskId;
|
|
24027
|
+
}
|
|
24028
|
+
else if (ganttColumns[i].field === taskSettingsFields.progress) {
|
|
24029
|
+
tempRecord[fieldName] = 0;
|
|
24030
|
+
}
|
|
24031
|
+
else if (ganttColumns[i].field === taskSettingsFields.work) {
|
|
24032
|
+
tempRecord[fieldName] = 0;
|
|
24033
|
+
}
|
|
24034
|
+
else if (ganttColumns[i].field === 'taskType') {
|
|
24035
|
+
tempRecord[fieldName] = this.parent.taskType;
|
|
24036
|
+
}
|
|
24037
|
+
else {
|
|
24038
|
+
tempRecord[this.parent.ganttColumns[i].field] = '';
|
|
24039
|
+
}
|
|
24040
|
+
}
|
|
24041
|
+
return tempRecord;
|
|
24042
|
+
};
|
|
23914
24043
|
Edit$$1.prototype.validateTaskPosition = function (data, rowPosition, rowIndex, cAddedRecord) {
|
|
23915
24044
|
var selectedRowIndex = isNullOrUndefined(rowIndex) || isNaN(parseInt(rowIndex.toString(), 10)) ?
|
|
23916
24045
|
this.parent.selectionModule ?
|
|
@@ -23922,7 +24051,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23922
24051
|
this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex : null : null : rowIndex;
|
|
23923
24052
|
this.addRowSelectedItem = isNullOrUndefined(selectedRowIndex) ? null : this.parent.updatedRecords[selectedRowIndex];
|
|
23924
24053
|
rowPosition = isNullOrUndefined(rowPosition) ? this.parent.editSettings.newRowPosition : rowPosition;
|
|
23925
|
-
data = isNullOrUndefined(data) ? this.
|
|
24054
|
+
data = isNullOrUndefined(data) ? this.createNewRecord() : data;
|
|
23926
24055
|
if (((isNullOrUndefined(selectedRowIndex) || selectedRowIndex < 0 ||
|
|
23927
24056
|
isNullOrUndefined(this.addRowSelectedItem)) && (rowPosition === 'Above'
|
|
23928
24057
|
|| rowPosition === 'Below'
|
|
@@ -24014,10 +24143,6 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24014
24143
|
}
|
|
24015
24144
|
this.parent.timelineModule.updateTimeLineOnEditing([tempArray], args.action);
|
|
24016
24145
|
}
|
|
24017
|
-
var flag = getValue('doubleClickTarget', this.parent.treeGrid.editModule);
|
|
24018
|
-
if (flag !== null) {
|
|
24019
|
-
setValue('doubleClickTarget', null, this.parent.treeGrid.editModule);
|
|
24020
|
-
}
|
|
24021
24146
|
this.addSuccess(args);
|
|
24022
24147
|
args = this.constructTaskAddedEventArgs(cAddedRecord, args.modifiedRecords, 'add');
|
|
24023
24148
|
this.parent.trigger('actionComplete', args);
|
|
@@ -24421,6 +24546,25 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24421
24546
|
var delRow = this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);
|
|
24422
24547
|
this.removeRecords(delRow);
|
|
24423
24548
|
};
|
|
24549
|
+
Edit$$1.prototype.updateIndentedChildRecords = function (indentedRecord) {
|
|
24550
|
+
var createParentItem = {
|
|
24551
|
+
uniqueID: indentedRecord.uniqueID,
|
|
24552
|
+
expanded: indentedRecord.expanded,
|
|
24553
|
+
level: indentedRecord.level,
|
|
24554
|
+
index: indentedRecord.index,
|
|
24555
|
+
taskId: indentedRecord.ganttProperties.rowUniqueID
|
|
24556
|
+
};
|
|
24557
|
+
for (var i = 0; i < indentedRecord.childRecords.length; i++) {
|
|
24558
|
+
this.parent.setRecordValue('parentItem', createParentItem, indentedRecord.childRecords[i]);
|
|
24559
|
+
this.parent.setRecordValue('parentUniqueID', indentedRecord.uniqueID, indentedRecord.childRecords[i]);
|
|
24560
|
+
}
|
|
24561
|
+
if (indentedRecord.hasChildRecords) {
|
|
24562
|
+
indentedRecord = indentedRecord.childRecords;
|
|
24563
|
+
for (var j = 0; j < indentedRecord['length']; j++) {
|
|
24564
|
+
this.updateIndentedChildRecords(indentedRecord[j]);
|
|
24565
|
+
}
|
|
24566
|
+
}
|
|
24567
|
+
};
|
|
24424
24568
|
Edit$$1.prototype.dropMiddle = function (recordIndex1) {
|
|
24425
24569
|
var obj = this.parent;
|
|
24426
24570
|
var childRec = this.parent.editModule.getChildCount(this.droppedRecord, 0);
|
|
@@ -24436,6 +24580,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24436
24580
|
this.recordLevel();
|
|
24437
24581
|
if (this.draggedRecord.hasChildRecords) {
|
|
24438
24582
|
this.updateChildRecord(this.draggedRecord, childRecordsLength, this.droppedRecord.expanded);
|
|
24583
|
+
if (this.parent.enableImmutableMode) {
|
|
24584
|
+
var indentedRecord = this.draggedRecord;
|
|
24585
|
+
this.updateIndentedChildRecords(indentedRecord);
|
|
24586
|
+
}
|
|
24439
24587
|
}
|
|
24440
24588
|
if (isNullOrUndefined(this.draggedRecord.parentItem &&
|
|
24441
24589
|
this.updateParentRecords.indexOf(this.draggedRecord.parentItem) !== -1)) {
|