@syncfusion/ej2-gantt 20.4.53 → 20.4.54

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.
@@ -3752,7 +3752,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3752
3752
  }
3753
3753
  if (childGanttRecord.hasChildRecords) {
3754
3754
  setValue('totalProgress', childGanttRecord.ganttProperties.totalProgress, progressValues);
3755
- setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration, progressValues);
3755
+ setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration ? childGanttRecord.ganttProperties.totalDuration : 0, progressValues);
3756
3756
  }
3757
3757
  else {
3758
3758
  setValue('totalProgress', childGanttRecord.ganttProperties.progress * durationInDay, progressValues);
@@ -3826,10 +3826,8 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3826
3826
  progressValues = this.getParentProgress(childData);
3827
3827
  totalProgress += getValue('totalProgress', progressValues);
3828
3828
  if (childData[this.parent.taskFields.duration] < 1) {
3829
- if (typeof (getValue('totalDuration', progressValues)) != 'object') {
3830
- totalDuration += getValue('totalDuration', progressValues);
3831
- totalDuration = Number(totalDuration.toFixed(4));
3832
- }
3829
+ totalDuration += getValue('totalDuration', progressValues);
3830
+ totalDuration = Number(totalDuration.toFixed(4));
3833
3831
  }
3834
3832
  else {
3835
3833
  totalDuration += getValue('totalDuration', progressValues);
@@ -14973,6 +14971,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14973
14971
  case 'enableRtl':
14974
14972
  case 'readOnly':
14975
14973
  case 'viewType':
14974
+ case 'taskFields':
14976
14975
  if (prop === 'locale') {
14977
14976
  this.isLocaleChanged = true;
14978
14977
  }
@@ -24181,7 +24180,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24181
24180
  }
24182
24181
  this.parent.predecessorModule.isValidatedParentTaskID = '';
24183
24182
  /** validating predecessor for current edited records */
24184
- if (ganttRecord.ganttProperties.predecessorsName) {
24183
+ if (ganttRecord.ganttProperties.predecessor) {
24185
24184
  this.parent.isMileStoneEdited = ganttRecord.ganttProperties.isMilestone;
24186
24185
  if (this.taskbarMoved) {
24187
24186
  this.parent.editedTaskBarItem = ganttRecord;
@@ -26223,11 +26222,11 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26223
26222
  };
26224
26223
  var prevID_1 = args.data.ganttProperties.taskId.toString();
26225
26224
  /* tslint:disable-next-line */
26226
- var query_2 = _this.parent.query instanceof Query ? _this.parent.query : new Query();
26225
+ var query = _this.parent.query instanceof Query ? _this.parent.query : new Query();
26227
26226
  var adaptor = data_2.adaptor;
26228
26227
  if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data_2.dataSource.batchUrl) {
26229
26228
  /* tslint:disable-next-line */
26230
- var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query_2);
26229
+ var crud = data_2.saveChanges(updatedData_2, _this.parent.taskFields.id, null, query);
26231
26230
  crud.then(function (e) {
26232
26231
  if (_this.parent.taskFields.id && !isNullOrUndefined(e.addedRecords[0][_this.parent.taskFields.id]) &&
26233
26232
  e.addedRecords[0][_this.parent.taskFields.id].toString() == prevID_1) {
@@ -26249,9 +26248,8 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26249
26248
  }
26250
26249
  else {
26251
26250
  var addedRecords = 'addedRecords';
26252
- var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query_2);
26251
+ var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query);
26253
26252
  insertCrud.then(function (e) {
26254
- var changedRecords = 'changedRecords';
26255
26253
  var addedRecords;
26256
26254
  if (!isNullOrUndefined(e[0])) {
26257
26255
  addedRecords = e[0];
@@ -26259,26 +26257,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26259
26257
  else {
26260
26258
  addedRecords = updatedData_2['addedRecords'][0];
26261
26259
  }
26262
- /* tslint:disable-next-line */
26263
- var updateCrud = data_2.update(_this.parent.taskFields.id, updatedData_2[changedRecords], null, query_2);
26264
- updateCrud.then(function () {
26265
- if (_this.parent.taskFields.id && !isNullOrUndefined(addedRecords[_this.parent.taskFields.id]) &&
26266
- addedRecords[_this.parent.taskFields.id].toString() !== prevID_1) {
26267
- _this.parent.setRecordValue('taskId', addedRecords[_this.parent.taskFields.id], args.data.ganttProperties, true);
26268
- _this.parent.setRecordValue('taskData.' + _this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
26269
- _this.parent.setRecordValue(_this.parent.taskFields.id, addedRecords[_this.parent.taskFields.id], args.data);
26270
- _this.parent.setRecordValue('rowUniqueID', addedRecords[_this.parent.taskFields.id].toString(), args.data.ganttProperties, true);
26271
- var idIndex = _this.parent.ids.indexOf(prevID_1);
26272
- if (idIndex !== -1) {
26273
- _this.parent.ids[idIndex] = addedRecords[_this.parent.taskFields.id].toString();
26274
- }
26275
- }
26276
- _this.updateNewRecord(cAddedRecord_1, args);
26277
- }).catch(function (e) {
26278
- _this.removeAddedRecord();
26279
- _this.dmFailure(e, args);
26280
- _this._resetProperties();
26281
- });
26260
+ _this.updateNewRecord(cAddedRecord_1, args);
26282
26261
  }).catch(function (e) {
26283
26262
  _this.removeAddedRecord();
26284
26263
  _this.dmFailure(e, args);
@@ -29751,10 +29730,10 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
29751
29730
  var _loop_2 = function (i) {
29752
29731
  var criticalData;
29753
29732
  if (this_2.parent.viewType === 'ProjectView') {
29754
- criticalData = this_2.parent.currentViewData[this_2.parent.ids.indexOf(criticalPathIds[i].toString())];
29733
+ criticalData = this_2.parent.flatData[this_2.parent.ids.indexOf(criticalPathIds[i].toString())];
29755
29734
  }
29756
29735
  else {
29757
- var currentRecords = this_2.parent.currentViewData.filter(function (data) {
29736
+ var currentRecords = this_2.parent.flatData.filter(function (data) {
29758
29737
  return (data.ganttProperties.taskId).toString() === criticalPathIds[i].toString();
29759
29738
  });
29760
29739
  for (var i_1 = 0; i_1 < currentRecords.length; i_1++) {
@@ -29767,16 +29746,18 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
29767
29746
  var element = this_2.parent.getRowByIndex(index);
29768
29747
  var taskClass = void 0;
29769
29748
  var columnFields = this_2.parent.taskFields;
29770
- if (criticalData.parentItem) {
29749
+ if (criticalData && criticalData.parentItem) {
29771
29750
  var parentRecord = this_2.parent.currentViewData.filter(function (data) {
29772
29751
  return criticalData.parentItem.uniqueID === data.uniqueID;
29773
29752
  });
29774
- var parentIndex = this_2.parent.currentViewData.indexOf(parentRecord[0]);
29753
+ var parentIndex = this_2.parent.flatData.indexOf(parentRecord[0]);
29775
29754
  var parentElement = this_2.parent.getRowByIndex(parentIndex);
29776
- var parentTaskbarElement = parentElement.querySelectorAll('.e-taskbar-main-container');
29777
- for (var i_2 = 0; i_2 < parentTaskbarElement.length; i_2++) {
29778
- if (parentTaskbarElement[i_2].getAttribute('rowuniqueid') === criticalData['rowUniqueID']) {
29779
- addClass(parentTaskbarElement[i_2].querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
29755
+ if (parentElement) {
29756
+ var parentTaskbarElement = parentElement.querySelectorAll('.e-taskbar-main-container');
29757
+ for (var i_2 = 0; i_2 < parentTaskbarElement.length; i_2++) {
29758
+ if (parentTaskbarElement[i_2].getAttribute('rowuniqueid') === criticalData['rowUniqueID']) {
29759
+ addClass(parentTaskbarElement[i_2].querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
29760
+ }
29780
29761
  }
29781
29762
  }
29782
29763
  }
@@ -34380,6 +34361,12 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
34380
34361
  cell.style.padding.bottom = padding - style.fontSize;
34381
34362
  cell.style.padding.left = 10;
34382
34363
  cell.style.padding.right = 10;
34364
+ if (style.padding) {
34365
+ cell.style.padding = style.padding;
34366
+ }
34367
+ if (style.borders) {
34368
+ cell.style.borders = style.borders;
34369
+ }
34383
34370
  };
34384
34371
  /**
34385
34372
  * @param {PdfDocument} pdfDoc .