@syncfusion/ej2-gantt 19.3.55 → 19.4.40
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 +31 -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 +131 -54
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +128 -51
- 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/context-menu.js +36 -15
- package/src/gantt/actions/dialog-edit.js +5 -2
- package/src/gantt/actions/edit.js +5 -1
- package/src/gantt/actions/keyboard.js +2 -2
- package/src/gantt/actions/rowdragdrop.js +2 -0
- package/src/gantt/actions/taskbar-edit.d.ts +0 -15
- package/src/gantt/actions/taskbar-edit.js +6 -24
- package/src/gantt/base/gantt.d.ts +17 -0
- package/src/gantt/base/gantt.js +32 -3
- package/src/gantt/base/task-processor.js +20 -3
- package/src/gantt/base/tree-grid.js +3 -0
- package/src/gantt/renderer/timeline.js +17 -1
- package/styles/bootstrap5-dark.css +6 -4
- package/styles/bootstrap5.css +6 -4
- package/styles/fabric-dark.css +1 -1
- package/styles/gantt/_bootstrap4-definition.scss +1 -0
- package/styles/gantt/_bootstrap5-definition.scss +1 -1
- package/styles/gantt/_fabric-dark-definition.scss +2 -1
- package/styles/gantt/_fluent-definition.scss +163 -0
- package/styles/gantt/_layout.scss +7 -7
- package/styles/gantt/_material-dark-definition.scss +2 -1
- package/styles/gantt/_theme.scss +2 -1
- package/styles/gantt/bootstrap5-dark.css +6 -4
- package/styles/gantt/bootstrap5.css +6 -4
- package/styles/gantt/fabric-dark.css +1 -1
- package/styles/gantt/icons/_fluent.scss +112 -0
- package/styles/gantt/icons/_tailwind-dark.scss +112 -112
- package/styles/gantt/material-dark.css +1 -1
- package/styles/gantt/tailwind-dark.css +1 -1
- package/styles/gantt/tailwind.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -2190,8 +2190,16 @@ class TaskProcessor extends DateProcessor {
|
|
|
2190
2190
|
const ganttProperties = ganttData.ganttProperties;
|
|
2191
2191
|
let duration = data[taskSettings.duration];
|
|
2192
2192
|
duration = isNullOrUndefined(duration) || duration === '' ? null : duration;
|
|
2193
|
-
|
|
2194
|
-
|
|
2193
|
+
let startDate;
|
|
2194
|
+
let endDate;
|
|
2195
|
+
if (ganttProperties.startDate && ganttProperties.endDate) {
|
|
2196
|
+
startDate = this.getDateFromFormat(ganttProperties.startDate, true);
|
|
2197
|
+
endDate = this.getDateFromFormat(ganttProperties.endDate, true);
|
|
2198
|
+
}
|
|
2199
|
+
else {
|
|
2200
|
+
startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
|
|
2201
|
+
endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
|
|
2202
|
+
}
|
|
2195
2203
|
const segments = taskSettings.segments ? (data[taskSettings.segments] ||
|
|
2196
2204
|
ganttData.taskData[taskSettings.segments]) : null;
|
|
2197
2205
|
const isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
|
|
@@ -2790,7 +2798,10 @@ class TaskProcessor extends DateProcessor {
|
|
|
2790
2798
|
if (!isNullOrUndefined(value)) {
|
|
2791
2799
|
value = new Date(tempDate.getTime());
|
|
2792
2800
|
}
|
|
2793
|
-
this.parent.
|
|
2801
|
+
if (!this.parent.isLoad && !this.parent.isDynamicData) {
|
|
2802
|
+
this.parent.setRecordValue('taskData.' + mapping, value, task);
|
|
2803
|
+
}
|
|
2804
|
+
this.parent.isDynamicData = false;
|
|
2794
2805
|
}
|
|
2795
2806
|
getDurationInDay(duration, durationUnit) {
|
|
2796
2807
|
if (durationUnit === 'day') {
|
|
@@ -3608,8 +3619,14 @@ class TaskProcessor extends DateProcessor {
|
|
|
3608
3619
|
}
|
|
3609
3620
|
continue;
|
|
3610
3621
|
}
|
|
3611
|
-
|
|
3612
|
-
|
|
3622
|
+
let startDate = this.getValidStartDate(childData.ganttProperties);
|
|
3623
|
+
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
|
|
3624
|
+
startDate = childData.ganttProperties.autoStartDate;
|
|
3625
|
+
}
|
|
3626
|
+
let endDate = this.getValidEndDate(childData.ganttProperties);
|
|
3627
|
+
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
|
|
3628
|
+
endDate = childData.ganttProperties.autoEndDate;
|
|
3629
|
+
}
|
|
3613
3630
|
if (isNullOrUndefined(minStartDate)) {
|
|
3614
3631
|
minStartDate = this.getDateFromFormat(startDate);
|
|
3615
3632
|
}
|
|
@@ -6024,6 +6041,9 @@ class Timeline {
|
|
|
6024
6041
|
parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell);
|
|
6025
6042
|
scheduleDateCollection.push(new Date(startDate.toString()));
|
|
6026
6043
|
increment = this.getIncrement(startDate, count, mode);
|
|
6044
|
+
if (this.parent.isInDst(startDate)) {
|
|
6045
|
+
increment = increment + (1000 * 60 * 60);
|
|
6046
|
+
}
|
|
6027
6047
|
newTime = startDate.getTime() + increment;
|
|
6028
6048
|
startDate.setTime(newTime);
|
|
6029
6049
|
if (startDate >= endDate) {
|
|
@@ -6087,11 +6107,19 @@ class Timeline {
|
|
|
6087
6107
|
dayIntervel - 1 : dayIntervel : dayIntervel;
|
|
6088
6108
|
lastDay.setDate(lastDay.getDate() + (dayIntervel + (7 * count)));
|
|
6089
6109
|
increment = lastDay.getTime() - firstDay.getTime();
|
|
6110
|
+
if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
|
|
6111
|
+
(!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
|
|
6112
|
+
increment = increment - (1000 * 60 * 60);
|
|
6113
|
+
}
|
|
6090
6114
|
break;
|
|
6091
6115
|
}
|
|
6092
6116
|
case 'Day':
|
|
6093
6117
|
lastDay.setHours(24, 0, 0, 0);
|
|
6094
6118
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
|
|
6119
|
+
if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
|
|
6120
|
+
(!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
|
|
6121
|
+
increment -= (1000 * 60 * 60);
|
|
6122
|
+
}
|
|
6095
6123
|
break;
|
|
6096
6124
|
case 'Hour':
|
|
6097
6125
|
lastDay.setMinutes(60);
|
|
@@ -6186,7 +6214,12 @@ class Timeline {
|
|
|
6186
6214
|
* @private
|
|
6187
6215
|
*/
|
|
6188
6216
|
calculateWidthBetweenTwoDate(mode, scheduleWeeks, endDate) {
|
|
6189
|
-
|
|
6217
|
+
let timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
|
|
6218
|
+
if ((this.parent.isInDst(scheduleWeeks) && !this.parent.isInDst(endDate)) ||
|
|
6219
|
+
(!this.parent.isInDst(scheduleWeeks) && this.parent.isInDst(endDate))) {
|
|
6220
|
+
timeDifference = timeDifference - (1000 * 60 * 60);
|
|
6221
|
+
}
|
|
6222
|
+
const balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
|
|
6190
6223
|
return balanceDay * this.parent.perDayWidth;
|
|
6191
6224
|
}
|
|
6192
6225
|
/**
|
|
@@ -6872,6 +6905,9 @@ class GanttTreeGrid {
|
|
|
6872
6905
|
if (getValue('requestType', args) === 'refresh' && isNullOrUndefined(getValue('type', args)) && this.parent.addDeleteRecord) {
|
|
6873
6906
|
if (this.parent.selectedRowIndex != -1) {
|
|
6874
6907
|
this.parent.selectRow(this.parent.selectedRowIndex);
|
|
6908
|
+
if (this.parent.selectedRowIndex > this.parent.currentViewData.length - 1) {
|
|
6909
|
+
this.parent.selectedRowIndex = -1;
|
|
6910
|
+
}
|
|
6875
6911
|
}
|
|
6876
6912
|
else {
|
|
6877
6913
|
this.parent.selectRow(0);
|
|
@@ -11798,9 +11834,9 @@ class FocusModule {
|
|
|
11798
11834
|
{
|
|
11799
11835
|
if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
|
|
11800
11836
|
e.preventDefault();
|
|
11801
|
-
const focussedElement = ganttObj.element.querySelector('.e-gantt-chart');
|
|
11802
|
-
focussedElement.focus();
|
|
11803
11837
|
ganttObj.addRecord();
|
|
11838
|
+
const focussedElement = ganttObj.element;
|
|
11839
|
+
focussedElement.focus();
|
|
11804
11840
|
}
|
|
11805
11841
|
break;
|
|
11806
11842
|
}
|
|
@@ -11985,6 +12021,8 @@ let Gantt = class Gantt extends Component {
|
|
|
11985
12021
|
/** @hidden */
|
|
11986
12022
|
this.isExpandCollapseLevelMethod = false;
|
|
11987
12023
|
/** @hidden */
|
|
12024
|
+
this.isDynamicData = false;
|
|
12025
|
+
/** @hidden */
|
|
11988
12026
|
this.isConnectorLineUpdate = false;
|
|
11989
12027
|
/** @hidden */
|
|
11990
12028
|
this.staticSelectedRowIndex = -1;
|
|
@@ -12141,6 +12179,27 @@ let Gantt = class Gantt extends Component {
|
|
|
12141
12179
|
return ganttDateFormat;
|
|
12142
12180
|
}
|
|
12143
12181
|
}
|
|
12182
|
+
/**
|
|
12183
|
+
* To get timezone offset.
|
|
12184
|
+
*
|
|
12185
|
+
* @returns {number} .
|
|
12186
|
+
* @private
|
|
12187
|
+
*/
|
|
12188
|
+
getDefaultTZOffset() {
|
|
12189
|
+
const janMonth = new Date(new Date().getFullYear(), 0, 1);
|
|
12190
|
+
const julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
|
|
12191
|
+
return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
|
|
12192
|
+
}
|
|
12193
|
+
/**
|
|
12194
|
+
* To check whether the date is in DST.
|
|
12195
|
+
*
|
|
12196
|
+
* @param {Date} date .
|
|
12197
|
+
* @returns {boolean} .
|
|
12198
|
+
* @private
|
|
12199
|
+
*/
|
|
12200
|
+
isInDst(date) {
|
|
12201
|
+
return date.getTimezoneOffset() < this.getDefaultTZOffset();
|
|
12202
|
+
}
|
|
12144
12203
|
/**
|
|
12145
12204
|
* Method to map resource fields.
|
|
12146
12205
|
*
|
|
@@ -12272,6 +12331,8 @@ let Gantt = class Gantt extends Component {
|
|
|
12272
12331
|
renderGantt(isChange) {
|
|
12273
12332
|
// predecessor calculation
|
|
12274
12333
|
if (this.predecessorModule && this.taskFields.dependency) {
|
|
12334
|
+
this.predecessorModule['parentIds'] = [];
|
|
12335
|
+
this.predecessorModule['parentRecord'] = [];
|
|
12275
12336
|
this.predecessorModule.updatePredecessors();
|
|
12276
12337
|
if (this.isInPredecessorValidation && this.enableValidation) {
|
|
12277
12338
|
this.predecessorModule.updatedRecordsDateByPredecessor();
|
|
@@ -12291,7 +12352,7 @@ let Gantt = class Gantt extends Component {
|
|
|
12291
12352
|
this.treeGrid.dataSource = { result: this.flatData, count: count };
|
|
12292
12353
|
}
|
|
12293
12354
|
else {
|
|
12294
|
-
this.treeGrid.dataSource = this.flatData
|
|
12355
|
+
this.treeGrid.dataSource = this.flatData;
|
|
12295
12356
|
}
|
|
12296
12357
|
}
|
|
12297
12358
|
else {
|
|
@@ -14337,6 +14398,7 @@ let Gantt = class Gantt extends Component {
|
|
|
14337
14398
|
* @public
|
|
14338
14399
|
*/
|
|
14339
14400
|
updateDataSource(dataSource, args) {
|
|
14401
|
+
this.isDynamicData = true;
|
|
14340
14402
|
if (!isNullOrUndefined(args)) {
|
|
14341
14403
|
for (let prop of Object.keys(args)) { // eslint-disable-line
|
|
14342
14404
|
switch (prop) {
|
|
@@ -14539,12 +14601,15 @@ let Gantt = class Gantt extends Component {
|
|
|
14539
14601
|
if (!isNullOrUndefined(rowData)) {
|
|
14540
14602
|
const data = extend({}, {}, rowData.taskData, true);
|
|
14541
14603
|
const taskfields = this.taskFields;
|
|
14604
|
+
if (data[taskfields.startDate]) {
|
|
14605
|
+
this.setRecordValue(taskfields.startDate, rowData.ganttProperties.startDate, data, true);
|
|
14606
|
+
}
|
|
14542
14607
|
if (!isNullOrUndefined(taskfields.duration)) {
|
|
14543
14608
|
data[taskfields.duration] = 0;
|
|
14544
14609
|
}
|
|
14545
14610
|
else {
|
|
14546
|
-
data[taskfields.startDate] = new Date(rowData.
|
|
14547
|
-
data[taskfields.endDate] = new Date(rowData.
|
|
14611
|
+
data[taskfields.startDate] = new Date(rowData.ganttProperties.startDate);
|
|
14612
|
+
data[taskfields.endDate] = new Date(rowData.ganttProperties.endDate);
|
|
14548
14613
|
}
|
|
14549
14614
|
if (!isNullOrUndefined(taskfields.milestone)) {
|
|
14550
14615
|
if (data[taskfields.milestone] === false) {
|
|
@@ -16320,8 +16385,11 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16320
16385
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
16321
16386
|
const args = {
|
|
16322
16387
|
cancel: false,
|
|
16323
|
-
requestType: '
|
|
16388
|
+
requestType: 'taskbarediting'
|
|
16324
16389
|
};
|
|
16390
|
+
if (this.segmentIndex !== -1) {
|
|
16391
|
+
args.requestType = 'mergeSegment';
|
|
16392
|
+
}
|
|
16325
16393
|
this.parent.trigger('actionBegin', args, (arg) => {
|
|
16326
16394
|
if (arg.cancel === false) {
|
|
16327
16395
|
this.taskBarEditingAction(event, false);
|
|
@@ -17146,36 +17214,15 @@ class TaskbarEdit extends DateProcessor {
|
|
|
17146
17214
|
const tierMode = this.parent.timelineModule.bottomTier !== 'None' ? this.parent.timelineModule.topTier :
|
|
17147
17215
|
this.parent.timelineModule.bottomTier;
|
|
17148
17216
|
if (tierMode !== 'Hour' && tierMode !== 'Minutes') {
|
|
17149
|
-
if (this.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && !this.isInDst(pStartDate)) {
|
|
17217
|
+
if (this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && !this.parent.isInDst(pStartDate)) {
|
|
17150
17218
|
pStartDate.setTime(pStartDate.getTime() + (60 * 60 * 1000));
|
|
17151
17219
|
}
|
|
17152
|
-
else if (!this.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.isInDst(pStartDate)) {
|
|
17220
|
+
else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
|
|
17153
17221
|
pStartDate.setTime(pStartDate.getTime() - (60 * 60 * 1000));
|
|
17154
17222
|
}
|
|
17155
17223
|
}
|
|
17156
17224
|
return pStartDate;
|
|
17157
17225
|
}
|
|
17158
|
-
/**
|
|
17159
|
-
* To get timezone offset.
|
|
17160
|
-
*
|
|
17161
|
-
* @returns {number} .
|
|
17162
|
-
* @private
|
|
17163
|
-
*/
|
|
17164
|
-
getDefaultTZOffset() {
|
|
17165
|
-
const janMonth = new Date(new Date().getFullYear(), 0, 1);
|
|
17166
|
-
const julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
|
|
17167
|
-
return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
|
|
17168
|
-
}
|
|
17169
|
-
/**
|
|
17170
|
-
* To check whether the date is in DST.
|
|
17171
|
-
*
|
|
17172
|
-
* @param {Date} date .
|
|
17173
|
-
* @returns {boolean} .
|
|
17174
|
-
* @private
|
|
17175
|
-
*/
|
|
17176
|
-
isInDst(date) {
|
|
17177
|
-
return date.getTimezoneOffset() < this.getDefaultTZOffset();
|
|
17178
|
-
}
|
|
17179
17226
|
/**
|
|
17180
17227
|
* To set item position.
|
|
17181
17228
|
*
|
|
@@ -18820,7 +18867,7 @@ class DialogEdit {
|
|
|
18820
18867
|
const datePickerModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
|
|
18821
18868
|
const value = args.rowData[args.column.field];
|
|
18822
18869
|
setValue('value', value, datePickerModel);
|
|
18823
|
-
const datePicker = new
|
|
18870
|
+
const datePicker = new this.inputs[this.parent.columnByField[this.parent.taskFields[fields[i]]].editType](datePickerModel);
|
|
18824
18871
|
datePicker.appendTo(args.element);
|
|
18825
18872
|
},
|
|
18826
18873
|
read: (args) => {
|
|
@@ -18891,7 +18938,7 @@ class DialogEdit {
|
|
|
18891
18938
|
inputValue = dialog.querySelector('#' + ganttId + 'SegmentsTabContainer' + columnName)
|
|
18892
18939
|
.ej2_instances[0];
|
|
18893
18940
|
}
|
|
18894
|
-
if (inputValue.value !== tempValue.toString()) {
|
|
18941
|
+
if (inputValue.value.toString() !== tempValue.toString()) {
|
|
18895
18942
|
inputValue.value = tempValue;
|
|
18896
18943
|
inputValue.dataBind();
|
|
18897
18944
|
}
|
|
@@ -19692,6 +19739,9 @@ class DialogEdit {
|
|
|
19692
19739
|
this.rowData.ganttProperties.segments = dataSource;
|
|
19693
19740
|
this.parent.setRecordValue('segments', this.parent.dataOperation.setSegmentsInfo(this.rowData, false), this.rowData.ganttProperties, true);
|
|
19694
19741
|
this.parent.setRecordValue('taskData.' + this.parent.taskFields.segments, userData, this.rowData);
|
|
19742
|
+
if (dataSource.length <= 0) {
|
|
19743
|
+
this.validateDuration(this.rowData);
|
|
19744
|
+
}
|
|
19695
19745
|
}
|
|
19696
19746
|
}
|
|
19697
19747
|
// eslint-disable-next-line
|
|
@@ -21474,7 +21524,7 @@ class Edit$2 {
|
|
|
21474
21524
|
this.updateParentItemOnEditing();
|
|
21475
21525
|
}
|
|
21476
21526
|
/** Update parent up-to zeroth level */
|
|
21477
|
-
if (ganttRecord.parentItem
|
|
21527
|
+
if (ganttRecord.parentItem) {
|
|
21478
21528
|
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
21479
21529
|
}
|
|
21480
21530
|
this.initiateSaveAction(args);
|
|
@@ -23104,8 +23154,11 @@ class Edit$2 {
|
|
|
23104
23154
|
*/
|
|
23105
23155
|
updateRealDataSource(addedRecord, rowPosition) {
|
|
23106
23156
|
const taskFields = this.parent.taskFields;
|
|
23107
|
-
|
|
23157
|
+
let dataSource = isCountRequired(this.parent) ? getValue('result', this.parent.dataSource) :
|
|
23108
23158
|
this.parent.dataSource;
|
|
23159
|
+
if (this.parent.dataSource instanceof DataManager) {
|
|
23160
|
+
dataSource = this.parent.dataSource.dataSource.json;
|
|
23161
|
+
}
|
|
23109
23162
|
for (let i = 0; i < addedRecord.length; i++) {
|
|
23110
23163
|
if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
|
|
23111
23164
|
rowPosition = 'Top';
|
|
@@ -23177,6 +23230,7 @@ class Edit$2 {
|
|
|
23177
23230
|
*/
|
|
23178
23231
|
addRecord(data, rowPosition, rowIndex) {
|
|
23179
23232
|
if (this.parent.editModule && this.parent.editSettings.allowAdding) {
|
|
23233
|
+
this.parent.isDynamicData = true;
|
|
23180
23234
|
const cAddedRecord = [];
|
|
23181
23235
|
if (isNullOrUndefined(data)) {
|
|
23182
23236
|
this.validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord);
|
|
@@ -25926,6 +25980,12 @@ class ContextMenu$2 {
|
|
|
25926
25980
|
position = this.item;
|
|
25927
25981
|
data = extend({}, {}, this.rowData.taskData, true);
|
|
25928
25982
|
taskfields = this.parent.taskFields;
|
|
25983
|
+
if (data[taskfields.startDate]) {
|
|
25984
|
+
this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
|
|
25985
|
+
}
|
|
25986
|
+
if (data[taskfields.endDate]) {
|
|
25987
|
+
this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
|
|
25988
|
+
}
|
|
25929
25989
|
if (!isNullOrUndefined(taskfields.dependency)) {
|
|
25930
25990
|
data[taskfields.dependency] = null;
|
|
25931
25991
|
}
|
|
@@ -26115,7 +26175,12 @@ class ContextMenu$2 {
|
|
|
26115
26175
|
for (const item of args.items) {
|
|
26116
26176
|
// let target: EventTarget = target;
|
|
26117
26177
|
if (!item.separator) {
|
|
26118
|
-
this.
|
|
26178
|
+
if ((target.classList.contains('e-gantt-unscheduled-taskbar')) && ((item.text === this.getLocale('splitTask')) || (item.text === this.getLocale('mergeTask')))) {
|
|
26179
|
+
this.hideItems.push(item.text);
|
|
26180
|
+
}
|
|
26181
|
+
else {
|
|
26182
|
+
this.updateItemStatus(item, target, rowIndex);
|
|
26183
|
+
}
|
|
26119
26184
|
}
|
|
26120
26185
|
}
|
|
26121
26186
|
args.rowData = this.rowData;
|
|
@@ -26227,24 +26292,34 @@ class ContextMenu$2 {
|
|
|
26227
26292
|
break;
|
|
26228
26293
|
case 'Indent':
|
|
26229
26294
|
{
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
this.parent.
|
|
26236
|
-
|
|
26295
|
+
if (!this.parent.allowSelection) {
|
|
26296
|
+
this.hideItems.push(item.text);
|
|
26297
|
+
}
|
|
26298
|
+
else {
|
|
26299
|
+
const index = this.parent.selectedRowIndex;
|
|
26300
|
+
const isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
|
|
26301
|
+
this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
26302
|
+
const prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
|
|
26303
|
+
if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
|
|
26304
|
+
this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
|
|
26305
|
+
this.updateItemVisibility(item.text);
|
|
26306
|
+
}
|
|
26237
26307
|
}
|
|
26238
26308
|
break;
|
|
26239
26309
|
}
|
|
26240
26310
|
case 'Outdent':
|
|
26241
26311
|
{
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26247
|
-
this.
|
|
26312
|
+
if (!this.parent.allowSelection) {
|
|
26313
|
+
this.hideItems.push(item.text);
|
|
26314
|
+
}
|
|
26315
|
+
else {
|
|
26316
|
+
const ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
|
|
26317
|
+
const isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
|
|
26318
|
+
this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
26319
|
+
if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
|
|
26320
|
+
this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
|
|
26321
|
+
this.updateItemVisibility(item.text);
|
|
26322
|
+
}
|
|
26248
26323
|
}
|
|
26249
26324
|
break;
|
|
26250
26325
|
}
|
|
@@ -26307,7 +26382,7 @@ class ContextMenu$2 {
|
|
|
26307
26382
|
}
|
|
26308
26383
|
contextMenuOpen(args) {
|
|
26309
26384
|
this.isOpen = true;
|
|
26310
|
-
const firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide)')[0];
|
|
26385
|
+
const firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
|
|
26311
26386
|
addClass([firstMenuItem], 'e-focused');
|
|
26312
26387
|
}
|
|
26313
26388
|
getMenuItems() {
|
|
@@ -27114,6 +27189,7 @@ class RowDD$1 {
|
|
|
27114
27189
|
else {
|
|
27115
27190
|
const level = 1;
|
|
27116
27191
|
draggedRecord.level = droppedRecord.level + 1;
|
|
27192
|
+
this.parent.setRecordValue('level', this.draggedRecord.level, this.draggedRecord);
|
|
27117
27193
|
this.updateChildRecordLevel(draggedRecord, level);
|
|
27118
27194
|
}
|
|
27119
27195
|
droppedRecord.expanded = true;
|
|
@@ -27198,6 +27274,7 @@ class RowDD$1 {
|
|
|
27198
27274
|
parentData = this.parent.treeGrid[id][record.parentItem.uniqueID];
|
|
27199
27275
|
}
|
|
27200
27276
|
currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;
|
|
27277
|
+
this.parent.setRecordValue('level', currentRecord.level, currentRecord);
|
|
27201
27278
|
if (currentRecord.hasChildRecords) {
|
|
27202
27279
|
level--;
|
|
27203
27280
|
level = this.updateChildRecordLevel(currentRecord, level);
|