@syncfusion/ej2-gantt 20.2.50 → 20.3.47

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/ej2-gantt.min.js +10 -0
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +940 -338
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +970 -357
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +19 -19
  13. package/src/gantt/actions/cell-edit.js +1 -2
  14. package/src/gantt/actions/connector-line-edit.d.ts +2 -0
  15. package/src/gantt/actions/connector-line-edit.js +104 -10
  16. package/src/gantt/actions/context-menu.js +6 -1
  17. package/src/gantt/actions/critical-path.d.ts +1 -1
  18. package/src/gantt/actions/critical-path.js +105 -30
  19. package/src/gantt/actions/dependency.d.ts +2 -0
  20. package/src/gantt/actions/dependency.js +68 -12
  21. package/src/gantt/actions/dialog-edit.d.ts +3 -0
  22. package/src/gantt/actions/dialog-edit.js +116 -14
  23. package/src/gantt/actions/edit.js +69 -10
  24. package/src/gantt/actions/filter.d.ts +3 -0
  25. package/src/gantt/actions/filter.js +30 -6
  26. package/src/gantt/actions/keyboard.js +1 -1
  27. package/src/gantt/actions/rowdragdrop.js +68 -8
  28. package/src/gantt/actions/taskbar-edit.js +15 -3
  29. package/src/gantt/base/enum.d.ts +3 -1
  30. package/src/gantt/base/gantt-chart.js +8 -6
  31. package/src/gantt/base/gantt.d.ts +6 -6
  32. package/src/gantt/base/gantt.js +10 -3
  33. package/src/gantt/base/interface.d.ts +4 -0
  34. package/src/gantt/base/splitter.d.ts +2 -2
  35. package/src/gantt/base/splitter.js +6 -7
  36. package/src/gantt/base/task-processor.js +13 -7
  37. package/src/gantt/base/tree-grid.js +21 -2
  38. package/src/gantt/export/pdf-connector-line.js +187 -185
  39. package/src/gantt/models/edit-settings-model.d.ts +2 -2
  40. package/src/gantt/models/edit-settings.d.ts +2 -2
  41. package/src/gantt/models/filter-settings-model.d.ts +1 -1
  42. package/src/gantt/models/filter-settings.d.ts +1 -1
  43. package/src/gantt/renderer/chart-rows.d.ts +1 -0
  44. package/src/gantt/renderer/chart-rows.js +47 -16
  45. package/src/gantt/renderer/connector-line.js +101 -33
  46. package/src/gantt/renderer/event-marker.js +1 -1
  47. package/src/gantt/renderer/nonworking-day.js +0 -1
  48. package/src/gantt/renderer/tooltip.js +2 -1
  49. package/styles/bootstrap-dark.css +115 -62
  50. package/styles/bootstrap.css +115 -62
  51. package/styles/bootstrap4.css +115 -62
  52. package/styles/bootstrap5-dark.css +119 -63
  53. package/styles/bootstrap5.css +119 -63
  54. package/styles/fabric-dark.css +115 -62
  55. package/styles/fabric.css +115 -62
  56. package/styles/fluent-dark.css +126 -66
  57. package/styles/fluent.css +124 -64
  58. package/styles/gantt/_all.scss +1 -1
  59. package/styles/gantt/_bootstrap-dark-definition.scss +4 -1
  60. package/styles/gantt/_bootstrap-definition.scss +4 -1
  61. package/styles/gantt/_bootstrap4-definition.scss +4 -1
  62. package/styles/gantt/_bootstrap5-definition.scss +4 -2
  63. package/styles/gantt/_fabric-dark-definition.scss +4 -1
  64. package/styles/gantt/_fabric-definition.scss +4 -1
  65. package/styles/gantt/_fluent-definition.scss +6 -4
  66. package/styles/gantt/_fusionnew-definition.scss +12 -10
  67. package/styles/gantt/_highcontrast-definition.scss +4 -1
  68. package/styles/gantt/_highcontrast-light-definition.scss +4 -1
  69. package/styles/gantt/_layout.scss +143 -51
  70. package/styles/gantt/_material-dark-definition.scss +4 -1
  71. package/styles/gantt/_material-definition.scss +4 -1
  72. package/styles/gantt/_material3-definition.scss +13 -11
  73. package/styles/gantt/_tailwind-definition.scss +4 -2
  74. package/styles/gantt/_theme.scss +29 -29
  75. package/styles/gantt/bootstrap-dark.css +115 -62
  76. package/styles/gantt/bootstrap.css +115 -62
  77. package/styles/gantt/bootstrap4.css +115 -62
  78. package/styles/gantt/bootstrap5-dark.css +119 -63
  79. package/styles/gantt/bootstrap5.css +119 -63
  80. package/styles/gantt/fabric-dark.css +115 -62
  81. package/styles/gantt/fabric.css +115 -62
  82. package/styles/gantt/fluent-dark.css +126 -66
  83. package/styles/gantt/fluent.css +124 -64
  84. package/styles/gantt/highcontrast-light.css +120 -62
  85. package/styles/gantt/highcontrast.css +120 -62
  86. package/styles/gantt/material-dark.css +120 -65
  87. package/styles/gantt/material.css +118 -65
  88. package/styles/gantt/tailwind-dark.css +117 -64
  89. package/styles/gantt/tailwind.css +117 -64
  90. package/styles/highcontrast-light.css +120 -62
  91. package/styles/highcontrast.css +120 -62
  92. package/styles/material-dark.css +120 -65
  93. package/styles/material.css +118 -65
  94. package/styles/tailwind-dark.css +117 -64
  95. package/styles/tailwind.css +117 -64
@@ -4,6 +4,7 @@ var Dependency = /** @class */ (function () {
4
4
  function Dependency(gantt) {
5
5
  this.parentRecord = [];
6
6
  this.parentIds = [];
7
+ this.parentPredecessors = [];
7
8
  this.parent = gantt;
8
9
  this.dateValidateModule = this.parent.dateValidationModule;
9
10
  }
@@ -19,9 +20,7 @@ var Dependency = /** @class */ (function () {
19
20
  for (var count = length; count >= 0; count--) {
20
21
  var ganttData = predecessorTasks[count];
21
22
  var ganttProp = ganttData.ganttProperties;
22
- if (!ganttData.hasChildRecords) {
23
- this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
24
- }
23
+ this.ensurePredecessorCollectionHelper(ganttData, ganttProp);
25
24
  }
26
25
  };
27
26
  /**
@@ -121,6 +120,7 @@ var Dependency = /** @class */ (function () {
121
120
  var predecessor = predecessorValue.toString();
122
121
  var collection = [];
123
122
  var match;
123
+ var isrelationship;
124
124
  var values;
125
125
  var offsetValue;
126
126
  var predecessorText;
@@ -131,8 +131,29 @@ var Dependency = /** @class */ (function () {
131
131
  values = el.split('-');
132
132
  offsetValue = '-';
133
133
  }
134
- match = values[0].match(/(\d+|[A-z]+)/g);
134
+ match = [];
135
135
  var ids = _this.parent.viewType === 'ResourceView' ? _this.parent.getTaskIds() : _this.parent.ids;
136
+ var isExist1 = _this.parent.viewType === 'ResourceView' ? ids.indexOf('T' + values[0]) : ids.indexOf(values[0]);
137
+ if (isExist1 !== -1) {
138
+ match[0] = values[0];
139
+ }
140
+ else {
141
+ if (ids.indexOf(values[0]) === -1) {
142
+ match = values[0].split(" ");
143
+ if (match.length === 1) {
144
+ if (match[0].indexOf(" ") != -1) {
145
+ match = values[0].match(/(\d+|[A-z]+)/g);
146
+ }
147
+ else {
148
+ match[0] = values[0].slice(0, -2);
149
+ match[1] = values[0].slice(-2);
150
+ }
151
+ }
152
+ }
153
+ else {
154
+ match[0] = values[0];
155
+ }
156
+ }
136
157
  var isExist = _this.parent.viewType === 'ResourceView' ? ids.indexOf('T' + match[0]) : ids.indexOf(match[0]);
137
158
  /*Validate for appropriate predecessor*/
138
159
  if (match[0] && isExist !== -1) {
@@ -163,10 +184,18 @@ var Dependency = /** @class */ (function () {
163
184
  offsetUnit: offsetUnits.durationUnit,
164
185
  offset: offsetUnits.duration
165
186
  };
166
- var isOwnParent = _this.checkIsParent(match[0]);
167
- if (!isOwnParent) {
187
+ var fromData = _this.parent.connectorLineModule.getRecordByID(obj.to);
188
+ var toData = _this.parent.connectorLineModule.getRecordByID(obj.from);
189
+ var isValid;
190
+ if (_this.parent.connectorLineEditModule && toData && fromData) {
191
+ isValid = _this.parent.connectorLineEditModule.validateParentPredecessor(toData, fromData);
192
+ if (isValid)
193
+ collection.push(obj);
194
+ }
195
+ else {
168
196
  collection.push(obj);
169
197
  }
198
+ match.splice(0);
170
199
  });
171
200
  return collection;
172
201
  };
@@ -181,6 +210,9 @@ var Dependency = /** @class */ (function () {
181
210
  var predecessors = data.ganttProperties.predecessor;
182
211
  var durationUnitTexts = this.parent.durationUnitTexts;
183
212
  var resultString = '';
213
+ var temp1;
214
+ var match;
215
+ match = [];
184
216
  if (predecessors) {
185
217
  var length_1 = predecessors.length;
186
218
  for (var i = 0; i < length_1; i++) {
@@ -190,6 +222,15 @@ var Dependency = /** @class */ (function () {
190
222
  : data.ganttProperties.rowUniqueID;
191
223
  if (currentValue.from !== id.toString()) {
192
224
  temp = currentValue.from + currentValue.type;
225
+ if (typeof (data.ganttProperties.taskId) === "string") {
226
+ match[0] = temp.slice(0, -2);
227
+ match[1] = temp.slice(-2);
228
+ temp1 = match[0] + " " + match[1];
229
+ }
230
+ else {
231
+ temp1 = temp;
232
+ }
233
+ temp = temp1;
193
234
  if (currentValue.offset !== 0) {
194
235
  temp += currentValue.offset > 0 ? ('+' + currentValue.offset + ' ') : (currentValue.offset + ' ');
195
236
  var multiple = currentValue.offset !== 1;
@@ -277,9 +318,7 @@ var Dependency = /** @class */ (function () {
277
318
  var length = predecessorsCollection.length;
278
319
  for (var count = 0; count < length; count++) {
279
320
  ganttRecord = predecessorsCollection[count];
280
- if (!ganttRecord.hasChildRecords) {
281
- this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
282
- }
321
+ this.updatePredecessorHelper(ganttRecord, predecessorsCollection);
283
322
  }
284
323
  };
285
324
  /**
@@ -329,9 +368,22 @@ var Dependency = /** @class */ (function () {
329
368
  */
330
369
  Dependency.prototype.updatedRecordsDateByPredecessor = function () {
331
370
  var flatData = this.parent.flatData;
332
- for (var count = 0; count < flatData.length; count++) {
371
+ var totLength = this.parent.flatData.length;
372
+ for (var count = 0; count < totLength; count++) {
333
373
  if (flatData[count].ganttProperties.predecessor) {
334
374
  this.validatePredecessorDates(flatData[count]);
375
+ if (flatData[count].hasChildRecords && this.parent.editModule) {
376
+ this.parent.editModule['updateChildItems'](flatData[count]);
377
+ }
378
+ }
379
+ }
380
+ };
381
+ Dependency.prototype.updateParentPredecessor = function () {
382
+ if (this.parent.enablePredecessorValidation) {
383
+ var parentPredecessorLength = this.parentPredecessors.length;
384
+ for (var i = parentPredecessorLength - 1; i >= 0; i--) {
385
+ var item = this.parentPredecessors[i];
386
+ this.validatePredecessorDates(item);
335
387
  }
336
388
  }
337
389
  };
@@ -362,6 +414,10 @@ var Dependency = /** @class */ (function () {
362
414
  var predecessor = predecessors[count];
363
415
  parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor.from);
364
416
  record = this.parent.connectorLineModule.getRecordByID(predecessor.to);
417
+ if (this.parent.isLoad && this.parentPredecessors.indexOf(ganttRecord) == -1
418
+ && (ganttRecord.hasChildRecords || record.hasChildRecords)) {
419
+ this.parentPredecessors.push(ganttRecord);
420
+ }
365
421
  if (record.ganttProperties.isAutoSchedule || this.parent.validateManualTasksOnLinking) {
366
422
  this.validateChildGanttRecord(parentGanttRecord, record);
367
423
  }
@@ -402,8 +458,8 @@ var Dependency = /** @class */ (function () {
402
458
  this.dateValidateModule.calculateEndDate(childGanttRecord);
403
459
  }
404
460
  this.parent.dataOperation.updateWidthLeft(childGanttRecord);
405
- if (childGanttRecord.parentItem && this.parent.getParentTask(childGanttRecord.parentItem).ganttProperties.isAutoSchedule
406
- && this.parent.isInPredecessorValidation && !this.parent.isLoad) {
461
+ if (!this.parent.isLoad && childGanttRecord.parentItem && this.parent.isInPredecessorValidation &&
462
+ this.parent.getParentTask(childGanttRecord.parentItem).ganttProperties.isAutoSchedule) {
407
463
  if (this.parentIds.indexOf(childGanttRecord.parentItem.uniqueID) === -1) {
408
464
  this.parentIds.push(childGanttRecord.parentItem.uniqueID);
409
465
  this.parentRecord.push(childGanttRecord.parentItem);
@@ -26,6 +26,7 @@ export declare class DialogEdit {
26
26
  private localeObj;
27
27
  private parent;
28
28
  private rowIndex;
29
+ private numericOrString;
29
30
  private types;
30
31
  private editedRecord;
31
32
  private rowData;
@@ -42,6 +43,7 @@ export declare class DialogEdit {
42
43
  private tabObj;
43
44
  private selectedSegment;
44
45
  ganttResources: Object[];
46
+ private isValidData;
45
47
  /**
46
48
  * @private
47
49
  */
@@ -171,6 +173,7 @@ export declare class DialogEdit {
171
173
  private renderSegmentsTab;
172
174
  private renderGeneralTab;
173
175
  private isCheckIsDisabled;
176
+ private isParentValid;
174
177
  private renderPredecessorTab;
175
178
  private gridActionBegin;
176
179
  private updateResourceCollection;
@@ -5,7 +5,7 @@ import { Tab } from '@syncfusion/ej2-navigations';
5
5
  import { Grid, Edit, Toolbar as GridToolbar, Page, getObject } from '@syncfusion/ej2-grids';
6
6
  import { ForeignKey, getActualProperties } from '@syncfusion/ej2-grids';
7
7
  import { RichTextEditor, Toolbar as RTEToolbar, Link, HtmlEditor, QuickToolbar, Count } from '@syncfusion/ej2-richtexteditor';
8
- import { TextBox, NumericTextBox, MaskedTextBox } from '@syncfusion/ej2-inputs';
8
+ import { TextBox, NumericTextBox, MaskedTextBox, FormValidator } from '@syncfusion/ej2-inputs';
9
9
  import { CheckBox } from '@syncfusion/ej2-buttons';
10
10
  import { DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars';
11
11
  import { DropDownList, ComboBox } from '@syncfusion/ej2-dropdowns';
@@ -32,6 +32,7 @@ var DialogEdit = /** @class */ (function () {
32
32
  this.addedRecord = null;
33
33
  this.dialogEditValidationFlag = false;
34
34
  this.ganttResources = [];
35
+ this.isValidData = true;
35
36
  /**
36
37
  * @private
37
38
  */
@@ -273,7 +274,7 @@ var DialogEdit = /** @class */ (function () {
273
274
  tempData[field] = 0;
274
275
  tempData.ganttProperties.work = tempData[field];
275
276
  }
276
- else if (columns[i].field === 'taskType') {
277
+ else if (columns[i].field === taskSettings.type) {
277
278
  tempData[field] = this.parent.taskType;
278
279
  tempData.ganttProperties.taskType = tempData[field];
279
280
  }
@@ -316,6 +317,24 @@ var DialogEdit = /** @class */ (function () {
316
317
  */
317
318
  DialogEdit.prototype.openEditDialog = function (taskId) {
318
319
  var ganttObj = this.parent;
320
+ if (!isNullOrUndefined(taskId)) {
321
+ if (!isNullOrUndefined(taskId['ganttProperties'])) {
322
+ if (typeof taskId['ganttProperties']['taskId'] === 'string') {
323
+ this.numericOrString = "stringedit";
324
+ }
325
+ else {
326
+ this.numericOrString = "numericedit";
327
+ }
328
+ }
329
+ if (isNullOrUndefined(taskId['ganttProperties']) && !isNullOrUndefined(taskId)) {
330
+ if (isNaN(Number(taskId)) || this.parent.columnByField[this.parent.taskFields.id].editType === "stringedit") {
331
+ this.numericOrString = "stringedit";
332
+ }
333
+ else {
334
+ this.numericOrString = "numericedit";
335
+ }
336
+ }
337
+ }
319
338
  if (typeof taskId === 'object' && !isNullOrUndefined(taskId)) {
320
339
  this.rowIndex = this.parent.currentViewData.indexOf(taskId);
321
340
  if (this.rowIndex > -1) {
@@ -350,11 +369,11 @@ var DialogEdit = /** @class */ (function () {
350
369
  this.beforeOpenArgs.rowIndex = this.rowIndex;
351
370
  var dialogMaxWidth = this.parent.isAdaptive ? '' : '600px';
352
371
  var dialog = this.parent.createElement('div', { id: ganttObj.element.id + '_dialog', styles: 'max-width:' + dialogMaxWidth });
372
+ dialog.classList.add('e-gantt-dialog');
353
373
  ganttObj.element.appendChild(dialog);
354
374
  dialogModel.animationSettings = { effect: 'None' };
355
375
  dialogModel.header = this.localeObj.getConstant(this.isEdit ? 'editDialogTitle' : 'addDialogTitle');
356
376
  dialogModel.isModal = true;
357
- dialogModel.cssClass = 'e-gantt-dialog';
358
377
  dialogModel.allowDragging = this.parent.isAdaptive ? false : true;
359
378
  dialogModel.showCloseIcon = true;
360
379
  var position = this.parent.isAdaptive ? { X: 'top', Y: 'left' } : { X: 'center', Y: 'center' };
@@ -710,6 +729,13 @@ var DialogEdit = /** @class */ (function () {
710
729
  placeholder: column.headerText,
711
730
  floatLabelType: 'Auto'
712
731
  };
732
+ if (!isNullOrUndefined(this.parent.taskFields.id) && !isNullOrUndefined(this.parent.columnMapping.id)
733
+ && !isNullOrUndefined(this.numericOrString)) {
734
+ if (taskSettings.id === column.field) {
735
+ column.editType = this.numericOrString;
736
+ }
737
+ }
738
+ ;
713
739
  switch (column.editType) {
714
740
  case 'booleanedit':
715
741
  {
@@ -724,7 +750,7 @@ var DialogEdit = /** @class */ (function () {
724
750
  case 'stringedit':
725
751
  {
726
752
  var textBox = common;
727
- if (column.field === ganttObj.columnMapping.duration || column.field === ganttObj.columnMapping.startDate ||
753
+ if (column.field === ganttObj.columnMapping.duration || column.field === ganttObj.columnMapping.id || column.field === ganttObj.columnMapping.startDate ||
728
754
  column.field === ganttObj.columnMapping.endDate) {
729
755
  textBox.change = function (args) {
730
756
  _this.validateScheduleFields(args, column, ganttObj);
@@ -781,7 +807,7 @@ var DialogEdit = /** @class */ (function () {
781
807
  break;
782
808
  }
783
809
  case 'dropdownedit':
784
- if (column.field === 'taskType' || column.field === ganttObj.columnMapping.manual) {
810
+ if (column.field === ganttObj.columnMapping.type || column.field === ganttObj.columnMapping.manual) {
785
811
  var dataKey = 'dataSource';
786
812
  var fieldsKey = 'fields';
787
813
  var types = [
@@ -809,12 +835,19 @@ var DialogEdit = /** @class */ (function () {
809
835
  return fieldsModel;
810
836
  };
811
837
  DialogEdit.prototype.validateScheduleFields = function (args, column, ganttObj) {
812
- var dialog = ganttObj.editModule.dialogModule.dialog;
838
+ var _a;
839
+ var dialog;
840
+ if (!isNullOrUndefined(ganttObj.editModule.dialogModule.dialog)) {
841
+ dialog = ganttObj.editModule.dialogModule.dialog;
842
+ }
813
843
  var targetId = null;
814
844
  var inputElement;
815
845
  var currentData = ganttObj.editModule.dialogModule.editedRecord;
816
846
  var cellValue = null;
817
847
  var colName = null;
848
+ var formObject;
849
+ var ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
850
+ var strViewType = this.parent.viewType;
818
851
  if (!isNullOrUndefined(args.element)) {
819
852
  inputElement = args.element;
820
853
  targetId = inputElement.getAttribute('id');
@@ -836,6 +869,22 @@ var DialogEdit = /** @class */ (function () {
836
869
  else {
837
870
  cellValue = inputElement.value;
838
871
  colName = targetId.replace(ganttObj.element.id, '');
872
+ if (this.parent.columnByField[this.parent.taskFields.id].editType === "stringedit") {
873
+ var customFn = function (args) {
874
+ if (strViewType === 'ResourceView') {
875
+ return ids.indexOf('T' + args['value']) === -1 && ids.indexOf('R' + args['value']) === -1;
876
+ }
877
+ else {
878
+ return ids.indexOf(args['value']) === -1;
879
+ }
880
+ };
881
+ var options = {
882
+ rules: (_a = {},
883
+ _a[this.parent.taskFields.id] = { required: true, minLength: [customFn, 'ID is already present, please enter new value'] },
884
+ _a)
885
+ };
886
+ formObject = new FormValidator('#' + this.parent.element.id + 'GeneralTabContainer', options);
887
+ }
839
888
  }
840
889
  if (colName.search('Segments') === 0) {
841
890
  colName = colName.replace('SegmentsTabContainer', '');
@@ -1059,7 +1108,7 @@ var DialogEdit = /** @class */ (function () {
1059
1108
  this.validateDuration(currentData);
1060
1109
  }
1061
1110
  }
1062
- if (columnName === 'taskType') {
1111
+ if (columnName === taskSettings.type) {
1063
1112
  this.parent.setRecordValue('taskType', value, ganttProp, true);
1064
1113
  }
1065
1114
  if (taskSettings.manual === columnName) {
@@ -1419,9 +1468,6 @@ var DialogEdit = /** @class */ (function () {
1419
1468
  item.content = this.renderGeneralTab(item.content);
1420
1469
  }
1421
1470
  else if (item.content === 'Dependency') {
1422
- if (this.editedRecord.hasChildRecords) {
1423
- item.disabled = true;
1424
- }
1425
1471
  item.content = this.renderPredecessorTab(item.content);
1426
1472
  }
1427
1473
  else if (item.content === 'Resources') {
@@ -1527,6 +1573,7 @@ var DialogEdit = /** @class */ (function () {
1527
1573
  };
1528
1574
  DialogEdit.prototype.isCheckIsDisabled = function (column) {
1529
1575
  var disabled = false;
1576
+ var stringOrNumber;
1530
1577
  if (column.allowEditing === false || column.isPrimaryKey || this.parent.readOnly) {
1531
1578
  if (this.parent.customColumns.indexOf(column.field) !== -1) {
1532
1579
  disabled = true;
@@ -1536,8 +1583,19 @@ var DialogEdit = /** @class */ (function () {
1536
1583
  column.field === this.parent.taskFields.duration || column.field === this.parent.taskFields.progress ||
1537
1584
  column.field === this.parent.taskFields.startDate || column.field === this.parent.taskFields.endDate ||
1538
1585
  column.field === this.parent.taskFields.baselineStartDate || column.field === this.parent.taskFields.baselineEndDate ||
1539
- column.field === this.parent.taskFields.work || column.field === 'taskType') {
1540
- disabled = true;
1586
+ column.field === this.parent.taskFields.work || column.field === this.parent.taskFields.type) {
1587
+ for (var i = 0; i < this.parent.currentViewData['length']; i++) {
1588
+ if (!isNullOrUndefined(this.parent.currentViewData[i].ganttProperties.taskId)) {
1589
+ stringOrNumber = this.parent.currentViewData[i].ganttProperties.taskId;
1590
+ break;
1591
+ }
1592
+ }
1593
+ if (typeof (stringOrNumber) === "string") {
1594
+ disabled = false;
1595
+ }
1596
+ else {
1597
+ disabled = true;
1598
+ }
1541
1599
  }
1542
1600
  }
1543
1601
  }
@@ -1549,13 +1607,30 @@ var DialogEdit = /** @class */ (function () {
1549
1607
  if ((column.field === this.parent.taskFields.endDate && ((!isNullOrUndefined(this.editedRecord['isManual']) &&
1550
1608
  this.editedRecord['isManual'] == false) || this.parent.taskMode == 'Auto')) || column.field === this.parent.taskFields.duration ||
1551
1609
  column.field === this.parent.taskFields.progress || column.field === this.parent.taskFields.work ||
1552
- column.field === 'taskType') {
1610
+ column.field === this.parent.taskFields.type) {
1553
1611
  disabled = true;
1554
1612
  }
1555
1613
  }
1556
1614
  }
1557
1615
  return disabled;
1558
1616
  };
1617
+ DialogEdit.prototype.isParentValid = function (data) {
1618
+ if (data.length > 0) {
1619
+ for (var i = 0; i < data.length; i++) {
1620
+ if (data[i].uniqueID == this.beforeOpenArgs.rowData['uniqueID']) {
1621
+ this.isValidData = false;
1622
+ break;
1623
+ }
1624
+ if (data[i].hasChildRecords) {
1625
+ this.isParentValid(data[i].childRecords);
1626
+ }
1627
+ if (!this.isValidData) {
1628
+ break;
1629
+ }
1630
+ }
1631
+ }
1632
+ return this.isValidData;
1633
+ };
1559
1634
  DialogEdit.prototype.renderPredecessorTab = function (itemName) {
1560
1635
  var _this = this;
1561
1636
  var ganttObj = this.parent;
@@ -1853,7 +1928,26 @@ var DialogEdit = /** @class */ (function () {
1853
1928
  this.preTableCollection = [];
1854
1929
  for (var i = 0; i < flatData.length; i++) {
1855
1930
  var data = flatData[i];
1856
- if (data.hasChildRecords) {
1931
+ var currentFlatData = data;
1932
+ if (data.parentUniqueID === this.beforeOpenArgs.rowData['uniqueID']) {
1933
+ this.isValidData = false;
1934
+ }
1935
+ else {
1936
+ do {
1937
+ if (currentFlatData.parentItem) {
1938
+ currentFlatData = this.parent.flatData[this.parent.ids.indexOf(currentFlatData.parentItem.taskId)];
1939
+ if (currentFlatData.uniqueID == this.beforeOpenArgs.rowData['uniqueID']) {
1940
+ this.isValidData = false;
1941
+ break;
1942
+ }
1943
+ }
1944
+ } while (currentFlatData.parentItem);
1945
+ }
1946
+ if (data.hasChildRecords && this.isValidData) {
1947
+ this.isValidData = this.isParentValid(data.childRecords);
1948
+ }
1949
+ if (!this.isValidData) {
1950
+ this.isValidData = true;
1857
1951
  continue;
1858
1952
  }
1859
1953
  var taskId = this.parent.viewType === 'ResourceView' ? data.ganttProperties.taskId.toString()
@@ -2059,6 +2153,10 @@ var DialogEdit = /** @class */ (function () {
2059
2153
  if (inputElement) {
2060
2154
  var fieldName = inputElement.id.replace(ganttObj.element.id, '');
2061
2155
  var controlObj = div.querySelector('#' + ganttObj.element.id + fieldName).ej2_instances[0];
2156
+ if (this.parent.columnByField[this.parent.taskFields.id].editType === "stringedit" && fieldName === this.parent.taskFields.id) {
2157
+ var valueString = controlObj.value.toString();
2158
+ controlObj.value = valueString;
2159
+ }
2062
2160
  var column = ganttObj.columnByField[fieldName];
2063
2161
  if (!isNullOrUndefined(column.edit) && isNullOrUndefined(column.edit.params)) {
2064
2162
  var read = column.edit.read;
@@ -2094,6 +2192,7 @@ var DialogEdit = /** @class */ (function () {
2094
2192
  this.parent.setRecordValue('duration', fromRecord.ganttProperties.duration, toRecord.ganttProperties, true);
2095
2193
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, toRecord.ganttProperties, true);
2096
2194
  this.parent.setRecordValue('work', fromRecord.ganttProperties.work, toRecord.ganttProperties, true);
2195
+ this.parent.setRecordValue('type', fromRecord.ganttProperties.taskType, toRecord.ganttProperties, true);
2097
2196
  if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
2098
2197
  this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.startDate);
2099
2198
  }
@@ -2116,6 +2215,9 @@ var DialogEdit = /** @class */ (function () {
2116
2215
  if (!isNullOrUndefined(this.parent.taskFields.manual)) {
2117
2216
  this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.manual);
2118
2217
  }
2218
+ if (!isNullOrUndefined(this.parent.taskFields.type)) {
2219
+ this.parent.dataOperation.updateMappingData(this.rowData, "type");
2220
+ }
2119
2221
  };
2120
2222
  DialogEdit.prototype.updatePredecessorTab = function (preElement) {
2121
2223
  var gridObj = preElement.ej2_instances[0];
@@ -1,5 +1,5 @@
1
1
  import { isNullOrUndefined, isUndefined, extend, setValue, getValue, deleteObject, createElement } from '@syncfusion/ej2-base';
2
- import { DataManager, DataUtil, Query, ODataAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data';
2
+ import { DataManager, Query, ODataAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data';
3
3
  import { getUid } from '@syncfusion/ej2-grids';
4
4
  import { getSwapKey, isScheduledTask, getTaskData, isRemoteData, getIndex, isCountRequired, updateDates } from '../base/utils';
5
5
  import { CellEdit } from './cell-edit';
@@ -806,6 +806,10 @@ var Edit = /** @class */ (function () {
806
806
  }
807
807
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
808
808
  }
809
+ if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
810
+ (args.action === "DrawConnectorLine" || args.action === "DialogEditing")) {
811
+ this.updateChildItems(ganttRecord);
812
+ }
809
813
  this.updateParentItemOnEditing();
810
814
  }
811
815
  /** Update parent up-to zeroth level */
@@ -1263,9 +1267,16 @@ var Edit = /** @class */ (function () {
1263
1267
  }
1264
1268
  for (var index = 0; index < currentLength; index++) {
1265
1269
  var recordIndex = [];
1266
- var resourceID = parseInt(currentResource[index][this.parent.resourceFields.id], 10);
1270
+ var resourceID = parseInt(currentResource[index][this.parent.resourceFields.id], 10).toString();
1271
+ if (resourceID === "NaN") {
1272
+ resourceID = currentResource[index][this.parent.resourceFields.id];
1273
+ }
1267
1274
  for (var i = 0; i < prevResource.length; i++) {
1268
- if (parseInt(prevResource[i][this.parent.resourceFields.id], 10) === resourceID) {
1275
+ var prevResourceID = parseInt(prevResource[i][this.parent.resourceFields.id], 10).toString();
1276
+ if (prevResourceID === "NaN") {
1277
+ prevResourceID = prevResource[i][this.parent.resourceFields.id];
1278
+ }
1279
+ if (prevResourceID === resourceID) {
1269
1280
  recordIndex.push(i);
1270
1281
  break;
1271
1282
  }
@@ -1277,7 +1288,11 @@ var Edit = /** @class */ (function () {
1277
1288
  }
1278
1289
  }
1279
1290
  else {
1280
- prevResource.splice(parseInt(recordIndex[0].toString(), 10), 1);
1291
+ var record1 = parseInt(recordIndex[0].toString(), 10);
1292
+ if (record1.toString() === "NaN") {
1293
+ record1 = recordIndex[0].toString();
1294
+ }
1295
+ prevResource.splice(record1, 1);
1281
1296
  }
1282
1297
  }
1283
1298
  var prevLength = prevResource ? prevResource.length : 0;
@@ -1592,6 +1607,10 @@ var Edit = /** @class */ (function () {
1592
1607
  var _loop_1 = function (i) {
1593
1608
  if (selectedRecords[i].parentItem) {
1594
1609
  var data = selectedRecords[i];
1610
+ var ids = data.ganttProperties.sharedTaskUniqueIds;
1611
+ for (var j = 0; j < ids.length; j++) {
1612
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
1613
+ }
1595
1614
  deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
1596
1615
  }
1597
1616
  else {
@@ -2070,12 +2089,34 @@ var Edit = /** @class */ (function () {
2070
2089
  * @private
2071
2090
  */
2072
2091
  Edit.prototype.getNewTaskId = function () {
2073
- var maxId = DataUtil.aggregates.max(this.parent.flatData, this.parent.taskFields.id);
2074
- if (!isNullOrUndefined(maxId)) {
2075
- return parseInt(maxId.toString(), 10) + 1;
2092
+ var ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
2093
+ var maxId = ids.length;
2094
+ var newTaskId = maxId + 1;
2095
+ if (this.parent.viewType === 'ResourceView') {
2096
+ if (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1) {
2097
+ newTaskId = newTaskId + 1;
2098
+ if (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1) {
2099
+ do {
2100
+ newTaskId = newTaskId + 1;
2101
+ } while (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1);
2102
+ }
2103
+ }
2076
2104
  }
2077
2105
  else {
2078
- return 1;
2106
+ if (ids.indexOf(newTaskId.toString()) != -1) {
2107
+ newTaskId = newTaskId + 1;
2108
+ if (ids.indexOf(newTaskId.toString()) != -1) {
2109
+ do {
2110
+ newTaskId = newTaskId + 1;
2111
+ } while (ids.indexOf(newTaskId.toString()) != -1);
2112
+ }
2113
+ }
2114
+ }
2115
+ if (this.parent.columnByField[this.parent.taskFields.id].editType === "stringedit") {
2116
+ return newTaskId = newTaskId.toString();
2117
+ }
2118
+ else {
2119
+ return newTaskId;
2079
2120
  }
2080
2121
  };
2081
2122
  /**
@@ -2088,6 +2129,7 @@ var Edit = /** @class */ (function () {
2088
2129
  Edit.prototype.prepareNewlyAddedData = function (obj, rowPosition) {
2089
2130
  var taskModel = this.parent.taskFields;
2090
2131
  var id;
2132
+ var newTaskIDmd;
2091
2133
  var ids = this.parent.ids;
2092
2134
  /*Validate Task Id of data*/
2093
2135
  if (obj[taskModel.id]) {
@@ -2095,7 +2137,13 @@ var Edit = /** @class */ (function () {
2095
2137
  obj[taskModel.id] = null;
2096
2138
  }
2097
2139
  else {
2098
- obj[taskModel.id] = isNullOrUndefined(obj[taskModel.id]) ? null : parseInt(obj[taskModel.id], 10);
2140
+ if (typeof (obj[taskModel.id]) === "string") {
2141
+ newTaskIDmd = obj[taskModel.id];
2142
+ }
2143
+ else {
2144
+ newTaskIDmd = parseInt(obj[taskModel.id], 10);
2145
+ }
2146
+ obj[taskModel.id] = isNullOrUndefined(newTaskIDmd) ? null : newTaskIDmd;
2099
2147
  }
2100
2148
  }
2101
2149
  if (!obj[taskModel.id]) {
@@ -2335,7 +2383,7 @@ var Edit = /** @class */ (function () {
2335
2383
  recordIndex = currentItemIndex + dataChildCount + 1;
2336
2384
  //Expand Add record's parent item for project view
2337
2385
  if (!this.addRowSelectedItem.expanded && !this.parent.enableMultiTaskbar) {
2338
- this.parent.expandByID(Number(this.addRowSelectedItem.ganttProperties.rowUniqueID));
2386
+ this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID);
2339
2387
  }
2340
2388
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) +
2341
2389
  this.getVisibleChildRecordCount(this.addRowSelectedItem, 0, currentViewData) + 1;
@@ -2375,6 +2423,10 @@ var Edit = /** @class */ (function () {
2375
2423
  /* Record collection update */
2376
2424
  flatRecords.splice(recordIndex, 0, record);
2377
2425
  currentViewData.splice(updatedCollectionIndex, 0, record);
2426
+ if (this.parent.viewType === 'ResourceView' && typeof (record.ganttProperties.taskId) === "number") {
2427
+ var taskString = record.ganttProperties.taskId;
2428
+ ids.push(taskString.toString());
2429
+ }
2378
2430
  ids.splice(recordIndex, 0, record.ganttProperties.rowUniqueID.toString());
2379
2431
  if (this.parent.viewType === 'ResourceView') {
2380
2432
  var taskId = record.level === 0 ? 'R' + record.ganttProperties.taskId : 'T' + record.ganttProperties.taskId;
@@ -2583,6 +2635,7 @@ var Edit = /** @class */ (function () {
2583
2635
  */
2584
2636
  Edit.prototype.addRecord = function (data, rowPosition, rowIndex) {
2585
2637
  var _this = this;
2638
+ var tempTaskID = this.parent.taskFields.id;
2586
2639
  if (this.parent.editModule && this.parent.editSettings.allowAdding) {
2587
2640
  this.parent.isDynamicData = true;
2588
2641
  var cAddedRecord_1 = [];
@@ -2604,6 +2657,12 @@ var Edit = /** @class */ (function () {
2604
2657
  args = this.constructTaskAddedEventArgs(cAddedRecord_1, this.parent.editedRecords, 'beforeAdd');
2605
2658
  this.parent.showSpinner();
2606
2659
  this.parent.trigger('actionBegin', args, function (args) {
2660
+ if (!isNullOrUndefined(args.data[tempTaskID])) {
2661
+ if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
2662
+ args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
2663
+ args.newTaskData[tempTaskID] = args.data[tempTaskID];
2664
+ }
2665
+ }
2607
2666
  if (!args.cancel) {
2608
2667
  if (isRemoteData(_this.parent.dataSource)) {
2609
2668
  var data_2 = _this.parent.dataSource;
@@ -15,6 +15,7 @@ export declare class Filter {
15
15
  private updateCustomFilters;
16
16
  private updateModel;
17
17
  private addEventListener;
18
+ private wireEvents;
18
19
  private initiateFiltering;
19
20
  /**
20
21
  * To get filter menu UI
@@ -23,6 +24,8 @@ export declare class Filter {
23
24
  * @returns {IFilterMUI} .
24
25
  */
25
26
  private getCustomFilterUi;
27
+ private mouseClickHandler;
28
+ private unWireEvents;
26
29
  private getDatePickerFilter;
27
30
  private getDateTimePickerFilter;
28
31
  private getDurationFilter;