@syncfusion/ej2-gantt 20.2.49 → 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 (96) hide show
  1. package/CHANGELOG.md +20 -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 +970 -379
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +1019 -413
  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 +130 -15
  23. package/src/gantt/actions/edit.js +101 -26
  24. package/src/gantt/actions/filter.d.ts +3 -1
  25. package/src/gantt/actions/filter.js +32 -44
  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/actions/toolbar.js +1 -1
  30. package/src/gantt/base/enum.d.ts +3 -1
  31. package/src/gantt/base/gantt-chart.js +8 -6
  32. package/src/gantt/base/gantt.d.ts +6 -6
  33. package/src/gantt/base/gantt.js +10 -3
  34. package/src/gantt/base/interface.d.ts +4 -0
  35. package/src/gantt/base/splitter.d.ts +2 -2
  36. package/src/gantt/base/splitter.js +6 -7
  37. package/src/gantt/base/task-processor.js +13 -7
  38. package/src/gantt/base/tree-grid.js +21 -2
  39. package/src/gantt/export/pdf-connector-line.js +187 -185
  40. package/src/gantt/models/edit-settings-model.d.ts +2 -2
  41. package/src/gantt/models/edit-settings.d.ts +2 -2
  42. package/src/gantt/models/filter-settings-model.d.ts +1 -1
  43. package/src/gantt/models/filter-settings.d.ts +1 -1
  44. package/src/gantt/renderer/chart-rows.d.ts +1 -0
  45. package/src/gantt/renderer/chart-rows.js +47 -16
  46. package/src/gantt/renderer/connector-line.js +101 -33
  47. package/src/gantt/renderer/event-marker.js +1 -1
  48. package/src/gantt/renderer/nonworking-day.js +0 -1
  49. package/src/gantt/renderer/tooltip.js +2 -1
  50. package/styles/bootstrap-dark.css +115 -62
  51. package/styles/bootstrap.css +115 -62
  52. package/styles/bootstrap4.css +115 -62
  53. package/styles/bootstrap5-dark.css +119 -63
  54. package/styles/bootstrap5.css +119 -63
  55. package/styles/fabric-dark.css +115 -62
  56. package/styles/fabric.css +115 -62
  57. package/styles/fluent-dark.css +126 -66
  58. package/styles/fluent.css +124 -64
  59. package/styles/gantt/_all.scss +1 -1
  60. package/styles/gantt/_bootstrap-dark-definition.scss +4 -1
  61. package/styles/gantt/_bootstrap-definition.scss +4 -1
  62. package/styles/gantt/_bootstrap4-definition.scss +4 -1
  63. package/styles/gantt/_bootstrap5-definition.scss +4 -2
  64. package/styles/gantt/_fabric-dark-definition.scss +4 -1
  65. package/styles/gantt/_fabric-definition.scss +4 -1
  66. package/styles/gantt/_fluent-definition.scss +6 -4
  67. package/styles/gantt/_fusionnew-definition.scss +12 -10
  68. package/styles/gantt/_highcontrast-definition.scss +4 -1
  69. package/styles/gantt/_highcontrast-light-definition.scss +4 -1
  70. package/styles/gantt/_layout.scss +143 -51
  71. package/styles/gantt/_material-dark-definition.scss +4 -1
  72. package/styles/gantt/_material-definition.scss +4 -1
  73. package/styles/gantt/_material3-definition.scss +13 -11
  74. package/styles/gantt/_tailwind-definition.scss +4 -2
  75. package/styles/gantt/_theme.scss +29 -29
  76. package/styles/gantt/bootstrap-dark.css +115 -62
  77. package/styles/gantt/bootstrap.css +115 -62
  78. package/styles/gantt/bootstrap4.css +115 -62
  79. package/styles/gantt/bootstrap5-dark.css +119 -63
  80. package/styles/gantt/bootstrap5.css +119 -63
  81. package/styles/gantt/fabric-dark.css +115 -62
  82. package/styles/gantt/fabric.css +115 -62
  83. package/styles/gantt/fluent-dark.css +126 -66
  84. package/styles/gantt/fluent.css +124 -64
  85. package/styles/gantt/highcontrast-light.css +120 -62
  86. package/styles/gantt/highcontrast.css +120 -62
  87. package/styles/gantt/material-dark.css +120 -65
  88. package/styles/gantt/material.css +118 -65
  89. package/styles/gantt/tailwind-dark.css +117 -64
  90. package/styles/gantt/tailwind.css +117 -64
  91. package/styles/highcontrast-light.css +120 -62
  92. package/styles/highcontrast.css +120 -62
  93. package/styles/material-dark.css +120 -65
  94. package/styles/material.css +118 -65
  95. package/styles/tailwind-dark.css +117 -64
  96. 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;
@@ -1671,7 +1746,20 @@ var DialogEdit = /** @class */ (function () {
1671
1746
  var rowResource = ganttData.ganttProperties.resourceInfo;
1672
1747
  var inputModel = this.beforeOpenArgs[itemName];
1673
1748
  var resourceTreeGridId = ganttObj.element.id + '' + itemName + 'TabContainer';
1674
- var resourceData = extend([], [], ganttObj.resources, true);
1749
+ var resourceData = [];
1750
+ if (this.parent.viewType === 'ResourceView') {
1751
+ for (var i = 0; i < ganttObj.currentViewData.length; i++) {
1752
+ for (var j = 0; j < ganttObj.resources.length; j++) {
1753
+ if (ganttObj.currentViewData[i][ganttObj.taskFields.id] === ganttObj.resources[j][resourceSettings.id] &&
1754
+ (ganttObj.currentViewData[i].hasChildRecords || isNullOrUndefined(ganttObj.currentViewData[i].parentItem))) {
1755
+ resourceData.push(ganttObj.resources[j]);
1756
+ }
1757
+ }
1758
+ }
1759
+ }
1760
+ else {
1761
+ resourceData = extend([], [], ganttObj.resources, true);
1762
+ }
1675
1763
  this.parent.dataOperation.updateResourceUnit(resourceData);
1676
1764
  if (!isNullOrUndefined(rowResource)) {
1677
1765
  var count = void 0;
@@ -1840,7 +1928,26 @@ var DialogEdit = /** @class */ (function () {
1840
1928
  this.preTableCollection = [];
1841
1929
  for (var i = 0; i < flatData.length; i++) {
1842
1930
  var data = flatData[i];
1843
- 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;
1844
1951
  continue;
1845
1952
  }
1846
1953
  var taskId = this.parent.viewType === 'ResourceView' ? data.ganttProperties.taskId.toString()
@@ -2046,6 +2153,10 @@ var DialogEdit = /** @class */ (function () {
2046
2153
  if (inputElement) {
2047
2154
  var fieldName = inputElement.id.replace(ganttObj.element.id, '');
2048
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
+ }
2049
2160
  var column = ganttObj.columnByField[fieldName];
2050
2161
  if (!isNullOrUndefined(column.edit) && isNullOrUndefined(column.edit.params)) {
2051
2162
  var read = column.edit.read;
@@ -2081,6 +2192,7 @@ var DialogEdit = /** @class */ (function () {
2081
2192
  this.parent.setRecordValue('duration', fromRecord.ganttProperties.duration, toRecord.ganttProperties, true);
2082
2193
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, toRecord.ganttProperties, true);
2083
2194
  this.parent.setRecordValue('work', fromRecord.ganttProperties.work, toRecord.ganttProperties, true);
2195
+ this.parent.setRecordValue('type', fromRecord.ganttProperties.taskType, toRecord.ganttProperties, true);
2084
2196
  if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
2085
2197
  this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.startDate);
2086
2198
  }
@@ -2103,6 +2215,9 @@ var DialogEdit = /** @class */ (function () {
2103
2215
  if (!isNullOrUndefined(this.parent.taskFields.manual)) {
2104
2216
  this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.manual);
2105
2217
  }
2218
+ if (!isNullOrUndefined(this.parent.taskFields.type)) {
2219
+ this.parent.dataOperation.updateMappingData(this.rowData, "type");
2220
+ }
2106
2221
  };
2107
2222
  DialogEdit.prototype.updatePredecessorTab = function (preElement) {
2108
2223
  var gridObj = preElement.ej2_instances[0];