@syncfusion/ej2-gantt 19.4.43 → 19.4.52
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 +37 -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 +186 -29
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +186 -29
- 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/chart-scroll.js +1 -0
- package/src/gantt/actions/dialog-edit.js +18 -2
- package/src/gantt/actions/edit.d.ts +3 -1
- package/src/gantt/actions/edit.js +97 -10
- package/src/gantt/actions/filter.js +1 -1
- package/src/gantt/actions/keyboard.js +1 -1
- package/src/gantt/actions/rowdragdrop.js +1 -1
- package/src/gantt/actions/taskbar-edit.js +3 -1
- package/src/gantt/base/gantt-chart.js +6 -0
- package/src/gantt/base/gantt.js +17 -5
- package/src/gantt/base/tree-grid.js +4 -0
- package/src/gantt/renderer/chart-rows.js +3 -3
- package/src/gantt/renderer/edit-tooltip.js +1 -0
- package/src/gantt/renderer/timeline.d.ts +1 -0
- package/src/gantt/renderer/timeline.js +30 -5
- package/src/gantt/renderer/tooltip.js +1 -0
- package/styles/bootstrap-dark.css +15 -4
- package/styles/bootstrap.css +15 -4
- package/styles/bootstrap4.css +15 -4
- package/styles/bootstrap5-dark.css +13 -2
- package/styles/bootstrap5.css +13 -2
- package/styles/fabric-dark.css +12 -1
- package/styles/fabric.css +12 -1
- package/styles/gantt/_bootstrap-dark-definition.scss +3 -4
- package/styles/gantt/_bootstrap-definition.scss +3 -4
- package/styles/gantt/_bootstrap4-definition.scss +3 -4
- package/styles/gantt/_bootstrap5-definition.scss +1 -2
- package/styles/gantt/_fabric-dark-definition.scss +0 -1
- package/styles/gantt/_fabric-definition.scss +0 -1
- package/styles/gantt/_fluent-definition.scss +1 -2
- package/styles/gantt/_highcontrast-definition.scss +0 -1
- package/styles/gantt/_highcontrast-light-definition.scss +0 -1
- package/styles/gantt/_layout.scss +11 -1
- package/styles/gantt/_material-dark-definition.scss +0 -1
- package/styles/gantt/_material-definition.scss +0 -1
- package/styles/gantt/_tailwind-definition.scss +3 -4
- package/styles/gantt/bootstrap-dark.css +15 -4
- package/styles/gantt/bootstrap.css +15 -4
- package/styles/gantt/bootstrap4.css +15 -4
- package/styles/gantt/bootstrap5-dark.css +13 -2
- package/styles/gantt/bootstrap5.css +13 -2
- package/styles/gantt/fabric-dark.css +12 -1
- package/styles/gantt/fabric.css +12 -1
- package/styles/gantt/highcontrast-light.css +12 -1
- package/styles/gantt/highcontrast.css +12 -1
- package/styles/gantt/material-dark.css +12 -1
- package/styles/gantt/material.css +12 -1
- package/styles/gantt/tailwind-dark.css +15 -4
- package/styles/gantt/tailwind.css +15 -4
- package/styles/highcontrast-light.css +12 -1
- package/styles/highcontrast.css +12 -1
- package/styles/material-dark.css +12 -1
- package/styles/material.css +12 -1
- package/styles/tailwind-dark.css +15 -4
- package/styles/tailwind.css +15 -4
|
@@ -4049,6 +4049,7 @@ var ChartScroll = /** @__PURE__ @class */ (function () {
|
|
|
4049
4049
|
*/
|
|
4050
4050
|
ChartScroll.prototype.setScrollTop = function (scrollTop) {
|
|
4051
4051
|
this.element.scrollTop = scrollTop;
|
|
4052
|
+
this.parent.treeGrid.element.querySelector('.e-content').scrollTop = scrollTop;
|
|
4052
4053
|
};
|
|
4053
4054
|
/**
|
|
4054
4055
|
* To set scroll left for chart scroll container
|
|
@@ -4439,6 +4440,12 @@ var GanttChart = /** @__PURE__ @class */ (function () {
|
|
|
4439
4440
|
* @private
|
|
4440
4441
|
*/
|
|
4441
4442
|
GanttChart.prototype.mouseUp = function (e) {
|
|
4443
|
+
if (this.parent.allowRowDragAndDrop) {
|
|
4444
|
+
var ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
|
|
4445
|
+
if (ganttDragElemet) {
|
|
4446
|
+
ganttDragElemet.remove();
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4442
4449
|
if (!this.isGanttElement) {
|
|
4443
4450
|
this.parent.notify('chartMouseUp', e);
|
|
4444
4451
|
}
|
|
@@ -6100,6 +6107,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6100
6107
|
* @private
|
|
6101
6108
|
*/
|
|
6102
6109
|
Timeline.prototype.createTimelineTemplate = function (tier) {
|
|
6110
|
+
var isFirstCell = false;
|
|
6103
6111
|
var parent = this.parent;
|
|
6104
6112
|
var parentTh = '';
|
|
6105
6113
|
var parentTr = '';
|
|
@@ -6116,10 +6124,19 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6116
6124
|
// PDf export collection
|
|
6117
6125
|
var timelineCell = {};
|
|
6118
6126
|
timelineCell.startDate = new Date(startDate.getTime());
|
|
6119
|
-
|
|
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);
|
|
6120
6131
|
scheduleDateCollection.push(new Date(startDate.toString()));
|
|
6121
|
-
|
|
6122
|
-
|
|
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;
|
|
6123
6140
|
startDate.setTime(newTime);
|
|
6124
6141
|
if (startDate >= endDate) {
|
|
6125
6142
|
/* eslint-disable-next-line */
|
|
@@ -6229,6 +6246,21 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6229
6246
|
mode === 'Hour' || mode === 'Minutes') &&
|
|
6230
6247
|
this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
|
|
6231
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
|
+
};
|
|
6232
6264
|
/**
|
|
6233
6265
|
* To construct template string.
|
|
6234
6266
|
*
|
|
@@ -6242,7 +6274,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6242
6274
|
* @private
|
|
6243
6275
|
*/
|
|
6244
6276
|
/* eslint-disable-next-line */
|
|
6245
|
-
Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell) {
|
|
6277
|
+
Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell, isFirstCell) {
|
|
6246
6278
|
var parentTr = '';
|
|
6247
6279
|
var td = '';
|
|
6248
6280
|
var format = tier === 'topTier' ?
|
|
@@ -6257,7 +6289,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6257
6289
|
this.customFormat(scheduleWeeks, format, tier, mode, formatter);
|
|
6258
6290
|
thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
|
|
6259
6291
|
var cellWidth = thWidth;
|
|
6260
|
-
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))
|
|
6261
6293
|
: thWidth;
|
|
6262
6294
|
var isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
|
|
6263
6295
|
var textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
|
|
@@ -6928,6 +6960,10 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
|
|
|
6928
6960
|
};
|
|
6929
6961
|
GanttTreeGrid.prototype.actionBegin = function (args) {
|
|
6930
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
|
+
}
|
|
6931
6967
|
this.parent.trigger('actionBegin', args);
|
|
6932
6968
|
}; // eslint-disable-next-line
|
|
6933
6969
|
GanttTreeGrid.prototype.created = function (args) {
|
|
@@ -8333,9 +8369,9 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
|
|
|
8333
8369
|
}
|
|
8334
8370
|
if (labelString !== 'null') {
|
|
8335
8371
|
taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
|
|
8336
|
-
(this.taskBarHeight - 1) + 'px; text-align:
|
|
8337
|
-
'display:' +
|
|
8338
|
-
'width:' + (
|
|
8372
|
+
(this.taskBarHeight - 1) + 'px; text-align: left;' +
|
|
8373
|
+
'display:' + 'inline-block;' +
|
|
8374
|
+
'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
|
|
8339
8375
|
this.taskBarHeight + 'px;">' + labelString + '</span>';
|
|
8340
8376
|
}
|
|
8341
8377
|
var template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
|
|
@@ -11886,6 +11922,7 @@ var Tooltip$1 = /** @__PURE__ @class */ (function () {
|
|
|
11886
11922
|
tooltipPositionY = tooltipPositionY + 10;
|
|
11887
11923
|
}
|
|
11888
11924
|
args.element.style.top = tooltipPositionY + 'px';
|
|
11925
|
+
args.element.style.visibility = 'visible';
|
|
11889
11926
|
};
|
|
11890
11927
|
/**
|
|
11891
11928
|
* Method to get mouse pointor position
|
|
@@ -12251,7 +12288,7 @@ var FocusModule = /** @__PURE__ @class */ (function () {
|
|
|
12251
12288
|
{
|
|
12252
12289
|
if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
|
|
12253
12290
|
e.preventDefault();
|
|
12254
|
-
ganttObj.addRecord();
|
|
12291
|
+
ganttObj.addRecord(undefined, this.parent.editSettings.newRowPosition);
|
|
12255
12292
|
var focussedElement = ganttObj.element;
|
|
12256
12293
|
focussedElement.focus();
|
|
12257
12294
|
}
|
|
@@ -12674,7 +12711,13 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
12674
12711
|
var settingsHeight;
|
|
12675
12712
|
if (typeof (this.height) !== 'number' && this.height.indexOf('%') !== -1 && (this.element.parentElement &&
|
|
12676
12713
|
!this.element.parentElement.style.height || this.element.parentElement.style.height.indexOf('%') !== -1)) {
|
|
12677
|
-
var ganttHeight =
|
|
12714
|
+
var ganttHeight = void 0;
|
|
12715
|
+
if (this.element.parentElement.style.height.indexOf('%') == -1) {
|
|
12716
|
+
ganttHeight = Number(this.height.split("%")[0]);
|
|
12717
|
+
}
|
|
12718
|
+
else {
|
|
12719
|
+
ganttHeight = Number(this.element.parentElement.style.height.split("%")[0]);
|
|
12720
|
+
}
|
|
12678
12721
|
ganttHeight = (ganttHeight * window.innerHeight) / 100;
|
|
12679
12722
|
if (this.height === '100%') {
|
|
12680
12723
|
ganttHeight = ganttHeight - 16;
|
|
@@ -12829,10 +12872,16 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
12829
12872
|
var settingsHeight = void 0;
|
|
12830
12873
|
if (this.height.indexOf('%') !== -1) {
|
|
12831
12874
|
var ganttHeight = Number(this.height.split("%")[0]);
|
|
12832
|
-
if (this.element.parentElement && (this.element.parentElement.style.height
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12875
|
+
if (this.element.parentElement && (this.element.parentElement.style.height)) {
|
|
12876
|
+
var containerHeight = void 0;
|
|
12877
|
+
if (this.element.parentElement.style.height.indexOf('%') == -1) {
|
|
12878
|
+
containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
|
|
12879
|
+
ganttHeight = (ganttHeight * containerHeight) / 100;
|
|
12880
|
+
}
|
|
12881
|
+
else {
|
|
12882
|
+
containerHeight = Number(this.element.parentElement.style.height.split("%")[0]);
|
|
12883
|
+
ganttHeight = (window.innerHeight * containerHeight) / 100;
|
|
12884
|
+
}
|
|
12836
12885
|
}
|
|
12837
12886
|
else {
|
|
12838
12887
|
ganttHeight = Number(this.height.split("%")[0]);
|
|
@@ -15603,6 +15652,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
|
|
|
15603
15652
|
* @private
|
|
15604
15653
|
*/
|
|
15605
15654
|
this.isCellEdit = false;
|
|
15655
|
+
this.isResourceCellEdited = false;
|
|
15606
15656
|
this.parent = ganttObj;
|
|
15607
15657
|
this.bindTreeGridProperties();
|
|
15608
15658
|
}
|
|
@@ -16032,6 +16082,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
|
|
|
16032
16082
|
var resourceSettings = this.parent.resourceFields;
|
|
16033
16083
|
var editedResourceId = editedObj[this.parent.taskFields.resourceInfo];
|
|
16034
16084
|
if (editedResourceId) {
|
|
16085
|
+
this.isResourceCellEdited = true;
|
|
16035
16086
|
var tempResourceInfo = this.parent.dataOperation.setResourceInfo(editedObj);
|
|
16036
16087
|
var editedResouceLength = tempResourceInfo.length;
|
|
16037
16088
|
var previousResource = previousData.ganttProperties.resourceInfo;
|
|
@@ -16208,6 +16259,7 @@ var EditTooltip = /** @__PURE__ @class */ (function () {
|
|
|
16208
16259
|
tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
|
|
16209
16260
|
}
|
|
16210
16261
|
args.element.style.left = tooltipPositionX + 'px';
|
|
16262
|
+
args.element.style.visibility = 'visible';
|
|
16211
16263
|
};
|
|
16212
16264
|
/**
|
|
16213
16265
|
* To show/hide taskbar edit tooltip.
|
|
@@ -16855,7 +16907,9 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
16855
16907
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
16856
16908
|
var args = {
|
|
16857
16909
|
cancel: false,
|
|
16858
|
-
requestType: 'taskbarediting'
|
|
16910
|
+
requestType: 'taskbarediting',
|
|
16911
|
+
taskBarEditAction: this.taskBarEditAction,
|
|
16912
|
+
data: this.taskBarEditRecord
|
|
16859
16913
|
};
|
|
16860
16914
|
if (this.segmentIndex !== -1) {
|
|
16861
16915
|
args.requestType = 'mergeSegment';
|
|
@@ -19343,7 +19397,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
|
|
|
19343
19397
|
field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '200px',
|
|
19344
19398
|
edit: {
|
|
19345
19399
|
write: function (args) {
|
|
19346
|
-
var datePickerModel
|
|
19400
|
+
var datePickerModel;
|
|
19401
|
+
if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
|
|
19402
|
+
datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
|
|
19403
|
+
}
|
|
19404
|
+
else {
|
|
19405
|
+
var columnFields = _this.getGeneralColumnFields();
|
|
19406
|
+
var columnModel = _this.getFieldsModel(columnFields);
|
|
19407
|
+
datePickerModel = columnModel[_this.parent.taskFields[fields[i]]];
|
|
19408
|
+
}
|
|
19347
19409
|
var value = args.rowData[args.column.field];
|
|
19348
19410
|
setValue('value', value, datePickerModel);
|
|
19349
19411
|
var datePicker = new _this.inputs[_this.parent.columnByField[_this.parent.taskFields[fields[i]]].editType](datePickerModel);
|
|
@@ -19366,7 +19428,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
|
|
|
19366
19428
|
field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '100px',
|
|
19367
19429
|
edit: {
|
|
19368
19430
|
write: function (args) {
|
|
19369
|
-
var inputTextModel
|
|
19431
|
+
var inputTextModel;
|
|
19432
|
+
if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
|
|
19433
|
+
inputTextModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
|
|
19434
|
+
}
|
|
19435
|
+
else {
|
|
19436
|
+
var columnFields = _this.getGeneralColumnFields();
|
|
19437
|
+
var columnModel = _this.getFieldsModel(columnFields);
|
|
19438
|
+
inputTextModel = columnModel[_this.parent.taskFields[fields[i]]];
|
|
19439
|
+
}
|
|
19370
19440
|
inputTextModel.floatLabelType = 'Never';
|
|
19371
19441
|
var value = args.rowData[args.column.field];
|
|
19372
19442
|
if (!isNullOrUndefined(value)) {
|
|
@@ -22069,9 +22139,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
22069
22139
|
*/
|
|
22070
22140
|
Edit$$1.prototype.updateParentChildRecord = function (data) {
|
|
22071
22141
|
var ganttRecord = data;
|
|
22072
|
-
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto') {
|
|
22142
|
+
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
|
|
22073
22143
|
this.updateChildItems(ganttRecord);
|
|
22074
22144
|
}
|
|
22145
|
+
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
22146
|
+
this.parent.editModule.cellEditModule.isResourceCellEdited = false;
|
|
22147
|
+
}
|
|
22075
22148
|
};
|
|
22076
22149
|
/**
|
|
22077
22150
|
* To update records while changing schedule mode.
|
|
@@ -23523,7 +23596,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23523
23596
|
/*Record Updates*/
|
|
23524
23597
|
recordIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
23525
23598
|
updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem);
|
|
23526
|
-
this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23599
|
+
this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23527
23600
|
break;
|
|
23528
23601
|
case 'Below':
|
|
23529
23602
|
currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
@@ -23537,7 +23610,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23537
23610
|
recordIndex = currentItemIndex + 1;
|
|
23538
23611
|
updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) + 1;
|
|
23539
23612
|
}
|
|
23540
|
-
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23613
|
+
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23541
23614
|
break;
|
|
23542
23615
|
case 'Child':
|
|
23543
23616
|
currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
|
|
@@ -23565,7 +23638,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23565
23638
|
this.addRowSelectedItem.ganttProperties.segments = null;
|
|
23566
23639
|
}
|
|
23567
23640
|
}
|
|
23568
|
-
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
|
|
23641
|
+
this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
|
|
23569
23642
|
break;
|
|
23570
23643
|
}
|
|
23571
23644
|
this.newlyAddedRecordBackup = record;
|
|
@@ -23579,7 +23652,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23579
23652
|
* @returns {void} .
|
|
23580
23653
|
* @private
|
|
23581
23654
|
*/
|
|
23582
|
-
Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem) {
|
|
23655
|
+
Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition) {
|
|
23583
23656
|
var flatRecords = this.parent.flatData;
|
|
23584
23657
|
var currentViewData = this.parent.currentViewData;
|
|
23585
23658
|
var ids = this.parent.ids;
|
|
@@ -23601,7 +23674,15 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23601
23674
|
!isNullOrUndefined(this.parent.dataSource)) {
|
|
23602
23675
|
var child = this.parent.taskFields.child;
|
|
23603
23676
|
if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
|
|
23604
|
-
|
|
23677
|
+
if (rowPosition === 'Above') {
|
|
23678
|
+
parentItem.taskData[child].splice(childIndex, 0, record.taskData);
|
|
23679
|
+
}
|
|
23680
|
+
else if (rowPosition === 'Below') {
|
|
23681
|
+
parentItem.taskData[child].splice(childIndex + 1, 0, record.taskData);
|
|
23682
|
+
}
|
|
23683
|
+
else {
|
|
23684
|
+
parentItem.taskData[child].push(record.taskData);
|
|
23685
|
+
}
|
|
23605
23686
|
}
|
|
23606
23687
|
else {
|
|
23607
23688
|
parentItem.taskData[child] = [];
|
|
@@ -23686,13 +23767,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23686
23767
|
}
|
|
23687
23768
|
for (var i = 0; i < addedRecord.length; i++) {
|
|
23688
23769
|
if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
|
|
23689
|
-
rowPosition = 'Top';
|
|
23770
|
+
rowPosition = rowPosition === 'Bottom' ? 'Bottom' : 'Top';
|
|
23690
23771
|
}
|
|
23691
23772
|
if (rowPosition === 'Top') {
|
|
23692
23773
|
dataSource.splice(0, 0, addedRecord[i].taskData);
|
|
23693
23774
|
}
|
|
23694
23775
|
else if (rowPosition === 'Bottom') {
|
|
23695
|
-
dataSource.push(addedRecord[i]);
|
|
23776
|
+
dataSource.push(addedRecord[i].taskData);
|
|
23696
23777
|
}
|
|
23697
23778
|
else {
|
|
23698
23779
|
if (!isNullOrUndefined(taskFields.id) && !isNullOrUndefined(taskFields.parentID)) {
|
|
@@ -23845,7 +23926,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23845
23926
|
else {
|
|
23846
23927
|
if (_this.parent.viewType === 'ProjectView') {
|
|
23847
23928
|
if ((rowPosition === 'Top' || rowPosition === 'Bottom') ||
|
|
23848
|
-
((rowPosition === 'Above' || rowPosition === 'Below') && !args.data.parentItem)) {
|
|
23929
|
+
((rowPosition === 'Above' || rowPosition === 'Below' || rowPosition === 'Child') && !args.data.parentItem)) {
|
|
23849
23930
|
if (args.data instanceof Array) {
|
|
23850
23931
|
_this.updateRealDataSource(args.data, rowPosition);
|
|
23851
23932
|
}
|
|
@@ -23888,6 +23969,59 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23888
23969
|
* @returns {void} .
|
|
23889
23970
|
* @private
|
|
23890
23971
|
*/
|
|
23972
|
+
Edit$$1.prototype.createNewRecord = function () {
|
|
23973
|
+
var tempRecord = {};
|
|
23974
|
+
var ganttColumns = this.parent.ganttColumns;
|
|
23975
|
+
var taskSettingsFields = this.parent.taskFields;
|
|
23976
|
+
var taskId = this.parent.editModule.getNewTaskId();
|
|
23977
|
+
for (var i = 0; i < ganttColumns.length; i++) {
|
|
23978
|
+
var fieldName = ganttColumns[i].field;
|
|
23979
|
+
if (fieldName === taskSettingsFields.id) {
|
|
23980
|
+
tempRecord[fieldName] = taskId;
|
|
23981
|
+
}
|
|
23982
|
+
else if (ganttColumns[i].field === taskSettingsFields.startDate) {
|
|
23983
|
+
if (isNullOrUndefined(tempRecord[taskSettingsFields.endDate])) {
|
|
23984
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
|
|
23985
|
+
}
|
|
23986
|
+
else {
|
|
23987
|
+
tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.endDate]);
|
|
23988
|
+
}
|
|
23989
|
+
if (this.parent.timezone) {
|
|
23990
|
+
tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
|
|
23991
|
+
}
|
|
23992
|
+
}
|
|
23993
|
+
else if (ganttColumns[i].field === taskSettingsFields.endDate) {
|
|
23994
|
+
if (isNullOrUndefined(tempRecord[taskSettingsFields.startDate])) {
|
|
23995
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
|
|
23996
|
+
}
|
|
23997
|
+
else {
|
|
23998
|
+
tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.startDate]);
|
|
23999
|
+
}
|
|
24000
|
+
if (this.parent.timezone) {
|
|
24001
|
+
tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
|
|
24002
|
+
}
|
|
24003
|
+
}
|
|
24004
|
+
else if (ganttColumns[i].field === taskSettingsFields.duration) {
|
|
24005
|
+
tempRecord[fieldName] = 1;
|
|
24006
|
+
}
|
|
24007
|
+
else if (ganttColumns[i].field === taskSettingsFields.name) {
|
|
24008
|
+
tempRecord[fieldName] = this.parent.editModule.dialogModule['localeObj'].getConstant('addDialogTitle') + ' ' + taskId;
|
|
24009
|
+
}
|
|
24010
|
+
else if (ganttColumns[i].field === taskSettingsFields.progress) {
|
|
24011
|
+
tempRecord[fieldName] = 0;
|
|
24012
|
+
}
|
|
24013
|
+
else if (ganttColumns[i].field === taskSettingsFields.work) {
|
|
24014
|
+
tempRecord[fieldName] = 0;
|
|
24015
|
+
}
|
|
24016
|
+
else if (ganttColumns[i].field === 'taskType') {
|
|
24017
|
+
tempRecord[fieldName] = this.parent.taskType;
|
|
24018
|
+
}
|
|
24019
|
+
else {
|
|
24020
|
+
tempRecord[this.parent.ganttColumns[i].field] = '';
|
|
24021
|
+
}
|
|
24022
|
+
}
|
|
24023
|
+
return tempRecord;
|
|
24024
|
+
};
|
|
23891
24025
|
Edit$$1.prototype.validateTaskPosition = function (data, rowPosition, rowIndex, cAddedRecord) {
|
|
23892
24026
|
var selectedRowIndex = isNullOrUndefined(rowIndex) || isNaN(parseInt(rowIndex.toString(), 10)) ?
|
|
23893
24027
|
this.parent.selectionModule ?
|
|
@@ -23899,7 +24033,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23899
24033
|
this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex : null : null : rowIndex;
|
|
23900
24034
|
this.addRowSelectedItem = isNullOrUndefined(selectedRowIndex) ? null : this.parent.updatedRecords[selectedRowIndex];
|
|
23901
24035
|
rowPosition = isNullOrUndefined(rowPosition) ? this.parent.editSettings.newRowPosition : rowPosition;
|
|
23902
|
-
data = isNullOrUndefined(data) ? this.
|
|
24036
|
+
data = isNullOrUndefined(data) ? this.createNewRecord() : data;
|
|
23903
24037
|
if (((isNullOrUndefined(selectedRowIndex) || selectedRowIndex < 0 ||
|
|
23904
24038
|
isNullOrUndefined(this.addRowSelectedItem)) && (rowPosition === 'Above'
|
|
23905
24039
|
|| rowPosition === 'Below'
|
|
@@ -24394,6 +24528,25 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24394
24528
|
var delRow = this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);
|
|
24395
24529
|
this.removeRecords(delRow);
|
|
24396
24530
|
};
|
|
24531
|
+
Edit$$1.prototype.updateIndentedChildRecords = function (indentedRecord) {
|
|
24532
|
+
var createParentItem = {
|
|
24533
|
+
uniqueID: indentedRecord.uniqueID,
|
|
24534
|
+
expanded: indentedRecord.expanded,
|
|
24535
|
+
level: indentedRecord.level,
|
|
24536
|
+
index: indentedRecord.index,
|
|
24537
|
+
taskId: indentedRecord.ganttProperties.rowUniqueID
|
|
24538
|
+
};
|
|
24539
|
+
for (var i = 0; i < indentedRecord.childRecords.length; i++) {
|
|
24540
|
+
this.parent.setRecordValue('parentItem', createParentItem, indentedRecord.childRecords[i]);
|
|
24541
|
+
this.parent.setRecordValue('parentUniqueID', indentedRecord.uniqueID, indentedRecord.childRecords[i]);
|
|
24542
|
+
}
|
|
24543
|
+
if (indentedRecord.hasChildRecords) {
|
|
24544
|
+
indentedRecord = indentedRecord.childRecords;
|
|
24545
|
+
for (var j = 0; j < indentedRecord['length']; j++) {
|
|
24546
|
+
this.updateIndentedChildRecords(indentedRecord[j]);
|
|
24547
|
+
}
|
|
24548
|
+
}
|
|
24549
|
+
};
|
|
24397
24550
|
Edit$$1.prototype.dropMiddle = function (recordIndex1) {
|
|
24398
24551
|
var obj = this.parent;
|
|
24399
24552
|
var childRec = this.parent.editModule.getChildCount(this.droppedRecord, 0);
|
|
@@ -24409,6 +24562,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24409
24562
|
this.recordLevel();
|
|
24410
24563
|
if (this.draggedRecord.hasChildRecords) {
|
|
24411
24564
|
this.updateChildRecord(this.draggedRecord, childRecordsLength, this.droppedRecord.expanded);
|
|
24565
|
+
if (this.parent.enableImmutableMode) {
|
|
24566
|
+
var indentedRecord = this.draggedRecord;
|
|
24567
|
+
this.updateIndentedChildRecords(indentedRecord);
|
|
24568
|
+
}
|
|
24412
24569
|
}
|
|
24413
24570
|
if (isNullOrUndefined(this.draggedRecord.parentItem &&
|
|
24414
24571
|
this.updateParentRecords.indexOf(this.draggedRecord.parentItem) !== -1)) {
|
|
@@ -24897,7 +25054,7 @@ var Filter$1 = /** @__PURE__ @class */ (function () {
|
|
|
24897
25054
|
var ganttElement = closest(element, '#' + this.parent.element.id)
|
|
24898
25055
|
|| element.querySelector('#' + this.parent.element.id);
|
|
24899
25056
|
if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || element.nodeName === 'HTML'
|
|
24900
|
-
|| element.nodeName === 'DIV') {
|
|
25057
|
+
|| ((element.nodeName === 'DIV') && (!element.classList.contains('e-day')))) {
|
|
24901
25058
|
remove(this.filterMenuElement);
|
|
24902
25059
|
this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
|
|
24903
25060
|
this.filterMenuElement = null;
|
|
@@ -27678,7 +27835,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
|
|
|
27678
27835
|
if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
|
|
27679
27836
|
var rowPosition = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
|
|
27680
27837
|
this.parent.editModule.addRowSelectedItem = droppedRecord;
|
|
27681
|
-
this.parent.editModule.updateRealDataSource(draggedRecord, rowPosition);
|
|
27838
|
+
this.parent.editModule.updateRealDataSource([draggedRecord], rowPosition);
|
|
27682
27839
|
delete this.parent.editModule.addRowSelectedItem;
|
|
27683
27840
|
}
|
|
27684
27841
|
}
|