@syncfusion/ej2-gantt 20.4.53 → 21.1.35
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 +27 -0
- package/README.md +1 -1
- 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 +1104 -450
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1084 -430
- 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 +20 -20
- package/src/gantt/actions/cell-edit.js +8 -6
- package/src/gantt/actions/chart-scroll.d.ts +1 -0
- package/src/gantt/actions/chart-scroll.js +15 -4
- package/src/gantt/actions/connector-line-edit.js +39 -28
- package/src/gantt/actions/context-menu.js +5 -5
- package/src/gantt/actions/critical-path.js +10 -8
- package/src/gantt/actions/dependency.js +28 -12
- package/src/gantt/actions/dialog-edit.js +41 -21
- package/src/gantt/actions/edit.js +56 -55
- package/src/gantt/actions/filter.d.ts +2 -1
- package/src/gantt/actions/filter.js +88 -2
- package/src/gantt/actions/keyboard.js +0 -1
- package/src/gantt/actions/pdf-export.d.ts +3 -1
- package/src/gantt/actions/pdf-export.js +12 -6
- package/src/gantt/actions/rowdragdrop.js +2 -2
- package/src/gantt/actions/selection.js +5 -2
- package/src/gantt/actions/taskbar-edit.d.ts +5 -0
- package/src/gantt/actions/taskbar-edit.js +114 -10
- package/src/gantt/base/date-processor.js +78 -52
- package/src/gantt/base/gantt-chart.js +20 -4
- package/src/gantt/base/gantt-model.d.ts +43 -0
- package/src/gantt/base/gantt.d.ts +39 -1
- package/src/gantt/base/gantt.js +79 -33
- package/src/gantt/base/interface.d.ts +2 -0
- package/src/gantt/base/task-processor.js +133 -98
- package/src/gantt/base/tree-grid.js +31 -1
- package/src/gantt/base/utils.js +1 -1
- package/src/gantt/export/export-helper.js +6 -0
- package/src/gantt/renderer/chart-rows.d.ts +2 -0
- package/src/gantt/renderer/chart-rows.js +156 -24
- package/src/gantt/renderer/connector-line.js +50 -20
- package/src/gantt/renderer/edit-tooltip.js +0 -3
- package/src/gantt/renderer/event-marker.js +4 -1
- package/src/gantt/renderer/nonworking-day.js +4 -1
- package/src/gantt/renderer/timeline.js +3 -3
- package/src/gantt/renderer/tooltip.js +101 -33
- package/styles/bootstrap-dark.css +33 -10
- package/styles/bootstrap.css +31 -10
- package/styles/bootstrap4.css +28 -7
- package/styles/bootstrap5-dark.css +30 -9
- package/styles/bootstrap5.css +30 -9
- package/styles/fabric-dark.css +28 -7
- package/styles/fabric.css +28 -7
- package/styles/fluent-dark.css +56 -29
- package/styles/fluent.css +56 -29
- package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
- package/styles/gantt/_bootstrap-definition.scss +5 -4
- package/styles/gantt/_bootstrap4-definition.scss +3 -2
- package/styles/gantt/_bootstrap5-definition.scss +15 -14
- package/styles/gantt/_fabric-dark-definition.scss +3 -2
- package/styles/gantt/_fabric-definition.scss +3 -2
- package/styles/gantt/_fluent-definition.scss +18 -17
- package/styles/gantt/_fusionnew-definition.scss +5 -4
- package/styles/gantt/_highcontrast-definition.scss +3 -2
- package/styles/gantt/_highcontrast-light-definition.scss +3 -2
- package/styles/gantt/_layout.scss +45 -13
- package/styles/gantt/_material-dark-definition.scss +3 -2
- package/styles/gantt/_material-definition.scss +3 -2
- package/styles/gantt/_tailwind-definition.scss +9 -8
- package/styles/gantt/_theme.scss +25 -6
- package/styles/gantt/bootstrap-dark.css +33 -10
- package/styles/gantt/bootstrap.css +31 -10
- package/styles/gantt/bootstrap4.css +28 -7
- package/styles/gantt/bootstrap5-dark.css +30 -9
- package/styles/gantt/bootstrap5.css +30 -9
- package/styles/gantt/fabric-dark.css +28 -7
- package/styles/gantt/fabric.css +28 -7
- package/styles/gantt/fluent-dark.css +56 -29
- package/styles/gantt/fluent.css +56 -29
- package/styles/gantt/highcontrast-light.css +28 -9
- package/styles/gantt/highcontrast.css +28 -7
- package/styles/gantt/material-dark.css +31 -14
- package/styles/gantt/material.css +28 -7
- package/styles/gantt/tailwind-dark.css +28 -7
- package/styles/gantt/tailwind.css +28 -7
- package/styles/highcontrast-light.css +28 -9
- package/styles/highcontrast.css +28 -7
- package/styles/material-dark.css +31 -14
- package/styles/material.css +28 -7
- package/styles/tailwind-dark.css +28 -7
- package/styles/tailwind.css +28 -7
- package/styles/gantt/_material3-definition.scss +0 -218
|
@@ -404,7 +404,7 @@ var Edit = /** @class */ (function () {
|
|
|
404
404
|
for (var _i = 0, _b = Object.keys(data); _i < _b.length; _i++) {
|
|
405
405
|
var key = _b[_i];
|
|
406
406
|
if ([tasks.startDate, tasks.endDate, tasks.duration].indexOf(key) !== -1) {
|
|
407
|
-
if (isNullOrUndefined(data[key]) && !ganttObj.allowUnscheduledTasks) {
|
|
407
|
+
if (isNullOrUndefined(data["" + key]) && !ganttObj.allowUnscheduledTasks) {
|
|
408
408
|
continue;
|
|
409
409
|
}
|
|
410
410
|
if (isFromDialog) {
|
|
@@ -459,7 +459,7 @@ var Edit = /** @class */ (function () {
|
|
|
459
459
|
else if (key === tasks.name) {
|
|
460
460
|
ganttPropKey = 'taskName';
|
|
461
461
|
}
|
|
462
|
-
else if (key === tasks.segments) {
|
|
462
|
+
else if ((key === tasks.segments) && (!isNullOrUndefined(ganttData.ganttProperties.segments))) {
|
|
463
463
|
ganttPropKey = 'segments';
|
|
464
464
|
/* eslint-disable-next-line */
|
|
465
465
|
if (data && !isNullOrUndefined(data[this.parent.taskFields.segments]) && data[this.parent.taskFields.segments].length > 0) {
|
|
@@ -827,8 +827,10 @@ var Edit = /** @class */ (function () {
|
|
|
827
827
|
*/
|
|
828
828
|
Edit.prototype.updateEditedTask = function (args) {
|
|
829
829
|
var ganttRecord = args.data;
|
|
830
|
-
this.
|
|
831
|
-
|
|
830
|
+
if (this.parent.autoCalculateDateScheduling) {
|
|
831
|
+
this.updateParentChildRecord(ganttRecord);
|
|
832
|
+
}
|
|
833
|
+
if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
|
|
832
834
|
/* validating predecessor for updated child items */
|
|
833
835
|
for (var i = 0; i < this.validatedChildItems.length; i++) {
|
|
834
836
|
var child = this.validatedChildItems[i];
|
|
@@ -839,7 +841,7 @@ var Edit = /** @class */ (function () {
|
|
|
839
841
|
}
|
|
840
842
|
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
841
843
|
/** validating predecessor for current edited records */
|
|
842
|
-
if (ganttRecord.ganttProperties.
|
|
844
|
+
if (ganttRecord.ganttProperties.predecessor) {
|
|
843
845
|
this.parent.isMileStoneEdited = ganttRecord.ganttProperties.isMilestone;
|
|
844
846
|
if (this.taskbarMoved) {
|
|
845
847
|
this.parent.editedTaskBarItem = ganttRecord;
|
|
@@ -847,7 +849,7 @@ var Edit = /** @class */ (function () {
|
|
|
847
849
|
this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
|
|
848
850
|
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
849
851
|
}
|
|
850
|
-
if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
852
|
+
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
851
853
|
(args.action === "DrawConnectorLine")) {
|
|
852
854
|
this.updateChildItems(ganttRecord);
|
|
853
855
|
}
|
|
@@ -855,7 +857,9 @@ var Edit = /** @class */ (function () {
|
|
|
855
857
|
}
|
|
856
858
|
/** Update parent up-to zeroth level */
|
|
857
859
|
if (ganttRecord.parentItem) {
|
|
858
|
-
this.parent.
|
|
860
|
+
if (this.parent.autoCalculateDateScheduling) {
|
|
861
|
+
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
862
|
+
}
|
|
859
863
|
var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
|
|
860
864
|
if (!parentData.ganttProperties.predecessorsName) {
|
|
861
865
|
this.parent.predecessorModule.validatePredecessor(parentData, [], '');
|
|
@@ -1101,7 +1105,7 @@ var Edit = /** @class */ (function () {
|
|
|
1101
1105
|
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
1102
1106
|
}
|
|
1103
1107
|
for (var i = 0; i < childRecords.length; i++) {
|
|
1104
|
-
if (
|
|
1108
|
+
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
1105
1109
|
if (durationDiff > 0) {
|
|
1106
1110
|
var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
1107
1111
|
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
@@ -1219,52 +1223,52 @@ var Edit = /** @class */ (function () {
|
|
|
1219
1223
|
}
|
|
1220
1224
|
for (var i = 0; i < eLength; i++) {
|
|
1221
1225
|
if (e.changedRecords) {
|
|
1222
|
-
rec = e.changedRecords[i];
|
|
1226
|
+
rec = e.changedRecords[parseInt(i.toString(), 10)];
|
|
1223
1227
|
}
|
|
1224
1228
|
else {
|
|
1225
|
-
rec = e[i];
|
|
1229
|
+
rec = e[parseInt(i.toString(), 10)];
|
|
1226
1230
|
}
|
|
1227
1231
|
var _aLength = Object.keys(rec).length;
|
|
1228
1232
|
for (var j = 0, _a = Object.keys(rec); j < _aLength; j++) {
|
|
1229
|
-
var key = _a[j];
|
|
1230
|
-
this.parent.editedRecords[i][key] = rec[key];
|
|
1231
|
-
this.parent.editedRecords[i].taskData[key] = rec[key];
|
|
1233
|
+
var key = _a[parseInt(j.toString(), 10)];
|
|
1234
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)]["" + key] = rec["" + key];
|
|
1235
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].taskData["" + key] = rec["" + key];
|
|
1232
1236
|
}
|
|
1233
1237
|
if (this.parent.taskFields.id !== null) {
|
|
1234
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1238
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskId'] = rec[this.parent.taskFields.id];
|
|
1235
1239
|
}
|
|
1236
1240
|
if (this.parent.taskFields.name !== null) {
|
|
1237
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1241
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['taskName'] = rec[this.parent.taskFields.name];
|
|
1238
1242
|
}
|
|
1239
1243
|
if (this.parent.taskFields.startDate !== null) {
|
|
1240
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1244
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['startDate'] = rec[this.parent.taskFields.startDate];
|
|
1241
1245
|
}
|
|
1242
1246
|
if (this.parent.taskFields.endDate !== null) {
|
|
1243
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1247
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['endDate'] = rec[this.parent.taskFields.endDate];
|
|
1244
1248
|
}
|
|
1245
1249
|
if (this.parent.taskFields.duration !== null) {
|
|
1246
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1250
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['duration'] = parseInt(rec[this.parent.taskFields.duration]);
|
|
1247
1251
|
}
|
|
1248
1252
|
if (this.parent.taskFields.durationUnit !== null) {
|
|
1249
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1253
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['durationUnit'] = rec[this.parent.taskFields.durationUnit];
|
|
1250
1254
|
}
|
|
1251
1255
|
if (this.parent.taskFields.progress !== null) {
|
|
1252
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1256
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['progress'] = rec[this.parent.taskFields.progress];
|
|
1253
1257
|
}
|
|
1254
1258
|
if (this.parent.taskFields.dependency !== null) {
|
|
1255
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1259
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['dependency'] = rec[this.parent.taskFields.dependency];
|
|
1256
1260
|
}
|
|
1257
1261
|
if (this.parent.taskFields.parentID !== null) {
|
|
1258
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1262
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['parentID'] = rec[this.parent.taskFields.parentID];
|
|
1259
1263
|
}
|
|
1260
1264
|
if (this.parent.taskFields.baselineEndDate !== null) {
|
|
1261
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1265
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineEndDate'] = rec[this.parent.taskFields.baselineEndDate];
|
|
1262
1266
|
}
|
|
1263
1267
|
if (this.parent.taskFields.baselineStartDate !== null) {
|
|
1264
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1268
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['baselineStartDate'] = rec[this.parent.taskFields.baselineStartDate];
|
|
1265
1269
|
}
|
|
1266
1270
|
if (this.parent.taskFields.resourceInfo !== null) {
|
|
1267
|
-
this.parent.editedRecords[i].ganttProperties[
|
|
1271
|
+
this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['resources'] = rec[this.parent.taskFields.resourceInfo];
|
|
1268
1272
|
}
|
|
1269
1273
|
}
|
|
1270
1274
|
this.saveSuccess(args);
|
|
@@ -1333,6 +1337,14 @@ var Edit = /** @class */ (function () {
|
|
|
1333
1337
|
}
|
|
1334
1338
|
if (!this.isTreeGridRefresh) {
|
|
1335
1339
|
this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords);
|
|
1340
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
|
|
1341
|
+
this.parent.contentHeight = this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
1342
|
+
this.parent.ganttChartModule.chartBodyContent.style.height = this.parent.contentHeight + 'px';
|
|
1343
|
+
this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
|
|
1344
|
+
if (this.parent.taskFields.dependency) {
|
|
1345
|
+
this.parent.ganttChartModule.reRenderConnectorLines();
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1336
1348
|
if (this.parent.isConnectorLineUpdate && !isNullOrUndefined(this.parent.connectorLineEditModule)) {
|
|
1337
1349
|
this.parent.updatedConnectorLineCollection = [];
|
|
1338
1350
|
this.parent.connectorLineIds = [];
|
|
@@ -2248,15 +2260,24 @@ var Edit = /** @class */ (function () {
|
|
|
2248
2260
|
if (parentTask && parentTask.ganttProperties.taskName !==
|
|
2249
2261
|
this_2.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
|
|
2250
2262
|
this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
|
|
2251
|
-
if (parentTask) {
|
|
2252
|
-
this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
|
|
2253
|
-
}
|
|
2254
2263
|
}
|
|
2255
2264
|
else if (!parentTask && (!isDuplicate || isDuplicate.length === 0)) {
|
|
2256
2265
|
this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
|
|
2257
|
-
|
|
2258
|
-
|
|
2266
|
+
}
|
|
2267
|
+
unassignedTask = this_2.parent.flatData.filter(function (data) {
|
|
2268
|
+
return data.ganttProperties.taskName === _this.parent.localeObj.getConstant('unassignedTask');
|
|
2269
|
+
})[0];
|
|
2270
|
+
var parentItem = this_2.parent.currentViewData.filter(function (data) {
|
|
2271
|
+
if (data.ganttProperties.taskId == updateUnAssignedResources_1[i].ganttProperties.taskId && (!data.hasChildRecords && data.parentItem)
|
|
2272
|
+
&& unassignedTask.uniqueID === data.parentItem.uniqueID) {
|
|
2273
|
+
return data;
|
|
2274
|
+
}
|
|
2275
|
+
else {
|
|
2276
|
+
return null;
|
|
2259
2277
|
}
|
|
2278
|
+
});
|
|
2279
|
+
if (parentItem[0]) {
|
|
2280
|
+
this_2.parent.dataOperation.updateParentItems(parentItem[0]);
|
|
2260
2281
|
}
|
|
2261
2282
|
};
|
|
2262
2283
|
var this_2 = this;
|
|
@@ -2866,7 +2887,7 @@ var Edit = /** @class */ (function () {
|
|
|
2866
2887
|
if (!isNullOrUndefined(ganttData)) {
|
|
2867
2888
|
_this.validateUpdateValues(args.newTaskData, ganttData, true);
|
|
2868
2889
|
}
|
|
2869
|
-
if (!isNullOrUndefined(args.data[tempTaskID])) {
|
|
2890
|
+
if (!isNullOrUndefined(args.data["" + tempTaskID])) {
|
|
2870
2891
|
if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
|
|
2871
2892
|
args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
|
|
2872
2893
|
args.newTaskData[tempTaskID] = args.data[tempTaskID];
|
|
@@ -2881,11 +2902,11 @@ var Edit = /** @class */ (function () {
|
|
|
2881
2902
|
};
|
|
2882
2903
|
var prevID_1 = args.data.ganttProperties.taskId.toString();
|
|
2883
2904
|
/* tslint:disable-next-line */
|
|
2884
|
-
var
|
|
2905
|
+
var query = _this.parent.query instanceof Query ? _this.parent.query : new Query();
|
|
2885
2906
|
var adaptor = data_2.adaptor;
|
|
2886
2907
|
if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data_2.dataSource.batchUrl) {
|
|
2887
2908
|
/* tslint:disable-next-line */
|
|
2888
|
-
var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null,
|
|
2909
|
+
var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query);
|
|
2889
2910
|
crud.then(function (e) {
|
|
2890
2911
|
if (_this.parent.taskFields.id && !isNullOrUndefined(e.addedRecords[0][_this.parent.taskFields.id]) &&
|
|
2891
2912
|
e.addedRecords[0][_this.parent.taskFields.id].toString() == prevID_1) {
|
|
@@ -2907,9 +2928,8 @@ var Edit = /** @class */ (function () {
|
|
|
2907
2928
|
}
|
|
2908
2929
|
else {
|
|
2909
2930
|
var addedRecords = 'addedRecords';
|
|
2910
|
-
var insertCrud = data_2.insert(updatedData_2[addedRecords], null,
|
|
2931
|
+
var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query);
|
|
2911
2932
|
insertCrud.then(function (e) {
|
|
2912
|
-
var changedRecords = 'changedRecords';
|
|
2913
2933
|
var addedRecords;
|
|
2914
2934
|
if (!isNullOrUndefined(e[0])) {
|
|
2915
2935
|
addedRecords = e[0];
|
|
@@ -2917,26 +2937,7 @@ var Edit = /** @class */ (function () {
|
|
|
2917
2937
|
else {
|
|
2918
2938
|
addedRecords = updatedData_2['addedRecords'][0];
|
|
2919
2939
|
}
|
|
2920
|
-
|
|
2921
|
-
var updateCrud = data_2.update(_this.parent.taskFields.id, updatedData_2[changedRecords], null, query_2);
|
|
2922
|
-
updateCrud.then(function () {
|
|
2923
|
-
if (_this.parent.taskFields.id && !isNullOrUndefined(addedRecords[_this.parent.taskFields.id]) &&
|
|
2924
|
-
addedRecords[_this.parent.taskFields.id].toString() !== prevID_1) {
|
|
2925
|
-
_this.parent.setRecordValue('taskId', addedRecords[_this.parent.taskFields.id], args.data.ganttProperties, true);
|
|
2926
|
-
_this.parent.setRecordValue('taskData.' + _this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
|
|
2927
|
-
_this.parent.setRecordValue(_this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
|
|
2928
|
-
_this.parent.setRecordValue('rowUniqueID', addedRecords[_this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
|
|
2929
|
-
var idIndex = _this.parent.ids.indexOf(prevID_1);
|
|
2930
|
-
if (idIndex !== -1) {
|
|
2931
|
-
_this.parent.ids[idIndex] = addedRecords[_this.parent.taskFields.id].toString();
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
_this.updateNewRecord(cAddedRecord_1, args);
|
|
2935
|
-
}).catch(function (e) {
|
|
2936
|
-
_this.removeAddedRecord();
|
|
2937
|
-
_this.dmFailure(e, args);
|
|
2938
|
-
_this._resetProperties();
|
|
2939
|
-
});
|
|
2940
|
+
_this.updateNewRecord(cAddedRecord_1, args);
|
|
2940
2941
|
}).catch(function (e) {
|
|
2941
2942
|
_this.removeAddedRecord();
|
|
2942
2943
|
_this.dmFailure(e, args);
|
|
@@ -4,7 +4,7 @@ import { Gantt } from '../base/gantt';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class Filter {
|
|
6
6
|
parent: Gantt;
|
|
7
|
-
|
|
7
|
+
filterMenuElement: HTMLElement;
|
|
8
8
|
constructor(gantt: Gantt);
|
|
9
9
|
private getModuleName;
|
|
10
10
|
/**
|
|
@@ -39,6 +39,7 @@ export declare class Filter {
|
|
|
39
39
|
private actionBegin;
|
|
40
40
|
closeFilterOnContextClick(element: Element): void;
|
|
41
41
|
private actionComplete;
|
|
42
|
+
private setPosition;
|
|
42
43
|
private updateFilterMenuPosition;
|
|
43
44
|
private removeEventListener;
|
|
44
45
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TreeGrid, Filter as TreeGridFilter } from '@syncfusion/ej2-treegrid';
|
|
2
|
-
import { filterAfterOpen } from '@syncfusion/ej2-grids';
|
|
2
|
+
import { filterAfterOpen, getFilterMenuPostion } from '@syncfusion/ej2-grids';
|
|
3
3
|
import { getActualProperties, getCustomDateFormat } from '@syncfusion/ej2-grids';
|
|
4
4
|
import { getValue, isNullOrUndefined, remove, createElement, addClass, closest, EventHandler } from '@syncfusion/ej2-base';
|
|
5
5
|
import { TextBox } from '@syncfusion/ej2-inputs';
|
|
@@ -255,9 +255,95 @@ var Filter = /** @class */ (function () {
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
+
Filter.prototype.setPosition = function (li, ul) {
|
|
259
|
+
var gridPos = this.parent.element.getBoundingClientRect();
|
|
260
|
+
var gridPosTop = gridPos.top;
|
|
261
|
+
var gridPosLeft = gridPos.left;
|
|
262
|
+
var parentNode;
|
|
263
|
+
var parentNodeTop;
|
|
264
|
+
var parentNodeLeft;
|
|
265
|
+
var paddingTop;
|
|
266
|
+
var paddingLeft;
|
|
267
|
+
var marginTop;
|
|
268
|
+
var marginLeft;
|
|
269
|
+
if (!isNullOrUndefined(this.parent.element.parentNode) && this.parent.element.parentNode['tagName'] != 'BODY') {
|
|
270
|
+
parentNode = this.parent.element.parentNode;
|
|
271
|
+
parentNodeTop = parentNode.getBoundingClientRect().top;
|
|
272
|
+
marginTop = parentNode.style.marginTop;
|
|
273
|
+
while (true) {
|
|
274
|
+
if (Math.abs(gridPosTop) > Math.abs(parentNodeTop)) {
|
|
275
|
+
paddingTop = gridPosTop - parentNodeTop;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
if (!isNullOrUndefined(this.parent.element.parentNode)) {
|
|
279
|
+
parentNode = parentNode.parentNode;
|
|
280
|
+
marginTop = parentNode.parentNode.style.marginTop;
|
|
281
|
+
}
|
|
282
|
+
parentNodeTop = parentNode.getBoundingClientRect().top;
|
|
283
|
+
}
|
|
284
|
+
parentNodeLeft = parentNode.getBoundingClientRect().left;
|
|
285
|
+
marginLeft = parentNode.style.marginLeft;
|
|
286
|
+
while (true) {
|
|
287
|
+
if (Math.abs(gridPosLeft) > Math.abs(parentNodeLeft)) {
|
|
288
|
+
paddingLeft = gridPosLeft - parentNodeLeft;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (!isNullOrUndefined(this.parent.element.parentNode)) {
|
|
292
|
+
parentNode = parentNode.parentNode;
|
|
293
|
+
marginLeft = parentNode.style.marginLeft;
|
|
294
|
+
}
|
|
295
|
+
parentNodeLeft = parentNode.getBoundingClientRect().left;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
var liPos = li.getBoundingClientRect();
|
|
299
|
+
var left = liPos.right + window.scrollX;
|
|
300
|
+
var top = liPos.top + window.scrollY;
|
|
301
|
+
if (gridPos.right < (left + ul.offsetWidth)) {
|
|
302
|
+
if ((liPos.left - ul.offsetWidth) > gridPos.left) {
|
|
303
|
+
left = (liPos.left - ul.offsetWidth);
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
left -= (left + ul.offsetWidth) - gridPos.right;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
|
|
311
|
+
left = Math.abs(liPos.right - gridPos.left);
|
|
312
|
+
top = Math.abs(liPos.top - gridPos.top);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (!isNullOrUndefined(paddingTop) && !isNullOrUndefined(paddingLeft)) {
|
|
316
|
+
ul.style.top = typeof (parseInt(marginTop)) === "string" ? (top + paddingTop + parseInt(marginTop)) + 'px' : (top + paddingTop) + 'px';
|
|
317
|
+
ul.style.left = typeof (parseInt(marginLeft)) === "string" ? (left + paddingLeft + parseInt(marginLeft) + 8) + 'px' : (left + paddingLeft) + 'px';
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
ul.style.top = top + 'px';
|
|
321
|
+
ul.style.left = left + 'px';
|
|
322
|
+
}
|
|
323
|
+
};
|
|
258
324
|
Filter.prototype.updateFilterMenuPosition = function (element, args) {
|
|
259
325
|
addClass([element], 'e-gantt');
|
|
260
|
-
document.querySelector('#' + this.parent.
|
|
326
|
+
document.querySelector('#' + this.parent.controlId).appendChild(element);
|
|
327
|
+
var targetElement;
|
|
328
|
+
if (this.parent.showColumnMenu) {
|
|
329
|
+
targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
|
|
330
|
+
element.style.zIndex = targetElement.parentElement.style.zIndex;
|
|
331
|
+
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
332
|
+
this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
|
|
340
|
+
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
341
|
+
getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
261
347
|
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
262
348
|
element.querySelector('.e-valid-input').focus();
|
|
263
349
|
}
|
|
@@ -230,7 +230,6 @@ var FocusModule = /** @class */ (function () {
|
|
|
230
230
|
var top_1 = containerPosition.top + (containerPosition.height / 2);
|
|
231
231
|
var left = containerPosition.left + (containerPosition.width / 2);
|
|
232
232
|
this.setActiveElement(e.target);
|
|
233
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
234
233
|
contextMenu.open(top_1, left);
|
|
235
234
|
e.preventDefault();
|
|
236
235
|
break;
|
|
@@ -11,6 +11,8 @@ export declare class PdfExport {
|
|
|
11
11
|
private pdfDocument;
|
|
12
12
|
gantt: PdfGantt;
|
|
13
13
|
isPdfExport: boolean;
|
|
14
|
+
private isBlob;
|
|
15
|
+
private blobPromise;
|
|
14
16
|
/**
|
|
15
17
|
* @param {Gantt} parent .
|
|
16
18
|
* @hidden
|
|
@@ -34,7 +36,7 @@ export declare class PdfExport {
|
|
|
34
36
|
* @param {object} pdfDoc .
|
|
35
37
|
* @returns {Promise<Object>} .
|
|
36
38
|
*/
|
|
37
|
-
export(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object): Promise<Object>;
|
|
39
|
+
export(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object, isBlob?: boolean): Promise<Object>;
|
|
38
40
|
private exportWithData;
|
|
39
41
|
private processExport;
|
|
40
42
|
private processSectionExportProperties;
|
|
@@ -45,8 +45,9 @@ var PdfExport = /** @class */ (function () {
|
|
|
45
45
|
* @param {object} pdfDoc .
|
|
46
46
|
* @returns {Promise<Object>} .
|
|
47
47
|
*/
|
|
48
|
-
PdfExport.prototype.export = function (pdfExportProperties, isMultipleExport, pdfDoc) {
|
|
48
|
+
PdfExport.prototype.export = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
|
|
49
49
|
var _this = this;
|
|
50
|
+
this.isBlob = isBlob;
|
|
50
51
|
var args = {
|
|
51
52
|
requestType: 'beforePdfExport',
|
|
52
53
|
ganttObject: this.parent,
|
|
@@ -90,7 +91,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
90
91
|
this.pdfDocument = new PdfDocument();
|
|
91
92
|
}
|
|
92
93
|
this.processExport(data, pdfExportProperties, isMultipleExport).then(function () {
|
|
93
|
-
_this.parent.trigger('pdfExportComplete', {});
|
|
94
|
+
_this.parent.trigger('pdfExportComplete', _this.isBlob ? { promise: _this.blobPromise } : {});
|
|
94
95
|
if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
95
96
|
_this.parent.hideMaskRow();
|
|
96
97
|
}
|
|
@@ -116,12 +117,17 @@ var PdfExport = /** @class */ (function () {
|
|
|
116
117
|
var layouter = _this.gantt.drawGrid(pdfPage, 0, 0, format);
|
|
117
118
|
_this.gantt.drawChart(layouter);
|
|
118
119
|
if (!isMultipleExport) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
if (!_this.isBlob) {
|
|
121
|
+
// save the PDF
|
|
122
|
+
if (!isNullOrUndefined(pdfExportProperties) && pdfExportProperties.fileName) {
|
|
123
|
+
_this.pdfDocument.save(pdfExportProperties.fileName);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
_this.pdfDocument.save('Export.pdf');
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
129
|
else {
|
|
124
|
-
_this.pdfDocument.save(
|
|
130
|
+
_this.blobPromise = _this.pdfDocument.save();
|
|
125
131
|
}
|
|
126
132
|
_this.pdfDocument.destroy();
|
|
127
133
|
}
|
|
@@ -348,7 +348,7 @@ var RowDD = /** @class */ (function () {
|
|
|
348
348
|
parentUniqueID = this.droppedRecord.uniqueID;
|
|
349
349
|
}
|
|
350
350
|
else {
|
|
351
|
-
parentUniqueID = this.droppedRecord.parentItem.uniqueID;
|
|
351
|
+
parentUniqueID = this.droppedRecord.parentItem ? this.droppedRecord.parentItem.uniqueID : this.droppedRecord.uniqueID;
|
|
352
352
|
}
|
|
353
353
|
var droppedParentItem = this.parent.getTaskByUniqueID(parentUniqueID);
|
|
354
354
|
var editedObj = {};
|
|
@@ -375,7 +375,7 @@ var RowDD = /** @class */ (function () {
|
|
|
375
375
|
this.updateSharedResourceTask();
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
if (this.parent.taskFields.dependency) {
|
|
378
|
+
if (this.parent.taskFields.dependency && this.parent.allowParentDependency) {
|
|
379
379
|
var isValidPredecessor = true;
|
|
380
380
|
var draggedParent = void 0;
|
|
381
381
|
var toParent_1;
|
|
@@ -307,7 +307,10 @@ var Selection = /** @class */ (function () {
|
|
|
307
307
|
var rIndex = parseInt(selectedRow.getAttribute('aria-rowindex'), 10);
|
|
308
308
|
var isToggle = this.parent.selectionSettings.enableToggle;
|
|
309
309
|
if (this.parent.selectionSettings.type === 'Single' || (!this.isMultiCtrlRequest && !this.isMultiShiftRequest)) {
|
|
310
|
-
this.
|
|
310
|
+
if (!this.parent.allowTaskbarDragAndDrop || (this.parent.allowTaskbarDragAndDrop && (this.parent.rowDragAndDropModule &&
|
|
311
|
+
!this.parent.rowDragAndDropModule['draggedRecord']))) {
|
|
312
|
+
this.selectRow(rIndex, isToggle);
|
|
313
|
+
}
|
|
311
314
|
}
|
|
312
315
|
else {
|
|
313
316
|
if (this.isMultiShiftRequest) {
|
|
@@ -351,7 +354,7 @@ var Selection = /** @class */ (function () {
|
|
|
351
354
|
};
|
|
352
355
|
Selection.prototype.addRemoveClass = function (records) {
|
|
353
356
|
if (typeof (records) == "number") {
|
|
354
|
-
records =
|
|
357
|
+
records = [records];
|
|
355
358
|
}
|
|
356
359
|
var ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
|
|
357
360
|
var _loop_1 = function (i) {
|
|
@@ -47,6 +47,11 @@ export declare class TaskbarEdit extends DateProcessor {
|
|
|
47
47
|
private elementOffsetHeight;
|
|
48
48
|
segmentIndex: number;
|
|
49
49
|
private targetElement;
|
|
50
|
+
currentItemTop: number;
|
|
51
|
+
currentItemPrevTop: number;
|
|
52
|
+
topValue: number;
|
|
53
|
+
draggedRecordMarginTop: number;
|
|
54
|
+
dragMoveY: number;
|
|
50
55
|
constructor(ganttObj?: Gantt);
|
|
51
56
|
private wireEvents;
|
|
52
57
|
/**
|