devexpress-gantt 2.0.14 → 2.0.18

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/dist/dx-gantt.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 2.0.14
4
- * Build date: Mon Dec 21 2020
3
+ * Version: 2.0.18
4
+ * Build date: Fri Dec 25 2020
5
5
  *
6
6
  * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
package/dist/dx-gantt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 2.0.14
4
- * Build date: Mon Dec 21 2020
3
+ * Version: 2.0.18
4
+ * Build date: Fri Dec 25 2020
5
5
  *
6
6
  * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -3370,15 +3370,16 @@ var tslib_1 = __webpack_require__(0);
3370
3370
  var HistoryItem_1 = __webpack_require__(12);
3371
3371
  var CreateResourceHistoryItem = (function (_super) {
3372
3372
  tslib_1.__extends(CreateResourceHistoryItem, _super);
3373
- function CreateResourceHistoryItem(modelManipulator, text, color) {
3373
+ function CreateResourceHistoryItem(modelManipulator, text, color, callback) {
3374
3374
  if (color === void 0) { color = ""; }
3375
3375
  var _this = _super.call(this, modelManipulator) || this;
3376
3376
  _this.text = text;
3377
3377
  _this.color = color;
3378
+ _this.createCallback = callback;
3378
3379
  return _this;
3379
3380
  }
3380
3381
  CreateResourceHistoryItem.prototype.redo = function () {
3381
- this.resource = this.modelManipulator.resource.create(this.text, this.color, this.resource ? this.resource.internalId : null);
3382
+ this.resource = this.modelManipulator.resource.create(this.text, this.color, this.resource ? this.resource.internalId : null, this.createCallback);
3382
3383
  };
3383
3384
  CreateResourceHistoryItem.prototype.undo = function () {
3384
3385
  this.modelManipulator.resource.remove(this.resource.internalId);
@@ -5469,8 +5470,8 @@ var TaskEditTooltip = (function () {
5469
5470
  progressElement.appendChild(progressTitle);
5470
5471
  progressElement.appendChild(progressValue);
5471
5472
  this.defaultTooltip.appendChild(progressElement);
5472
- progressTitle.innerHTML = (this.cultureInfo.progress ? this.cultureInfo.progress : "Progress") + ": ";
5473
- progressValue.innerHTML = task.progress + "%";
5473
+ progressTitle.innerText = (this.cultureInfo.progress ? this.cultureInfo.progress : "Progress") + ": ";
5474
+ progressValue.innerText = task.progress + "%";
5474
5475
  }
5475
5476
  this.baseElement.appendChild(this.defaultTooltip);
5476
5477
  };
@@ -5498,7 +5499,7 @@ var TaskEditTooltip = (function () {
5498
5499
  this.owner.destroyTemplate(this.baseElement);
5499
5500
  this.defaultTooltip = document.createElement("DIV");
5500
5501
  this.defaultTooltip.className = TaskEditTooltip.CLASSNAMES.TASK_EDIT_TOOLTIP_DEFAULT;
5501
- this.defaultTooltip.innerHTML = progress + "%";
5502
+ this.defaultTooltip.innerText = progress + "%";
5502
5503
  this.baseElement.appendChild(this.defaultTooltip);
5503
5504
  this.show(posX);
5504
5505
  };
@@ -5562,10 +5563,10 @@ var TaskEditTooltip = (function () {
5562
5563
  endEl.appendChild(endValue);
5563
5564
  body.appendChild(startEl);
5564
5565
  body.appendChild(endEl);
5565
- startTitle.innerHTML = (this.cultureInfo.start ? this.cultureInfo.start : "Start") + ": ";
5566
- startValue.innerHTML = this.formatDate(start);
5567
- endTitle.innerHTML = (this.cultureInfo.end ? this.cultureInfo.end : "End") + ": ";
5568
- endValue.innerHTML = this.formatDate(end);
5566
+ startTitle.innerText = (this.cultureInfo.start ? this.cultureInfo.start : "Start") + ": ";
5567
+ startValue.innerText = this.formatDate(start);
5568
+ endTitle.innerText = (this.cultureInfo.end ? this.cultureInfo.end : "End") + ": ";
5569
+ endValue.innerText = this.formatDate(end);
5569
5570
  return timeElement;
5570
5571
  };
5571
5572
  TaskEditTooltip.prototype.formatDate = function (date) {
@@ -6842,10 +6843,14 @@ var GanttView = (function () {
6842
6843
  return this.viewModel.getDependencyObjectForDataSource(key);
6843
6844
  };
6844
6845
  GanttView.prototype.insertResource = function (data, taskKeys) {
6845
- if (data && this.commandManager.createResourceCommand.execute(String(data.text), data.color && String(data.color)) && common_1.isDefined(taskKeys)) {
6846
- var resource = this.getLastInsertedResource();
6847
- for (var i = 0; i < taskKeys.length; i++)
6848
- this.assignResourceToTask(resource.id, taskKeys[i]);
6846
+ var _this = this;
6847
+ if (data) {
6848
+ var callback = function (id) {
6849
+ if (common_1.isDefined(taskKeys))
6850
+ for (var i = 0; i < taskKeys.length; i++)
6851
+ _this.assignResourceToTask(id, taskKeys[i]);
6852
+ };
6853
+ this.commandManager.createResourceCommand.execute(String(data.text), data.color && String(data.color), callback);
6849
6854
  }
6850
6855
  };
6851
6856
  GanttView.prototype.deleteResource = function (key) {
@@ -7990,7 +7995,7 @@ var Task = (function (_super) {
7990
7995
  if (common_1.isDefined(sourceObj)) {
7991
7996
  _super.prototype.assignFromObject.call(this, sourceObj);
7992
7997
  this.owner = sourceObj.owner;
7993
- this.parentId = sourceObj.parentId ? String(sourceObj.parentId) : sourceObj.parentId;
7998
+ this.parentId = common_1.isDefined(sourceObj.parentId) ? String(sourceObj.parentId) : "";
7994
7999
  this.description = sourceObj.description;
7995
8000
  this.title = sourceObj.title;
7996
8001
  this.start = sourceObj.start;
@@ -8957,7 +8962,7 @@ var ResourcesManipulator = (function (_super) {
8957
8962
  this.dispatcher.notifyResourceCreated(this.getResourceObjectForDataSource(resource), function (id) {
8958
8963
  resource.id = id;
8959
8964
  if (callback)
8960
- callback();
8965
+ callback(id);
8961
8966
  }, this.getErrorCallback());
8962
8967
  return resource;
8963
8968
  };
@@ -11515,16 +11520,16 @@ var CreateResourceCommand = (function (_super) {
11515
11520
  function CreateResourceCommand() {
11516
11521
  return _super !== null && _super.apply(this, arguments) || this;
11517
11522
  }
11518
- CreateResourceCommand.prototype.execute = function (text, color) {
11523
+ CreateResourceCommand.prototype.execute = function (text, color, callback) {
11519
11524
  if (color === void 0) { color = ""; }
11520
- return _super.prototype.execute.call(this, text, color);
11525
+ return _super.prototype.execute.call(this, text, color, callback);
11521
11526
  };
11522
- CreateResourceCommand.prototype.executeInternal = function (text, color) {
11527
+ CreateResourceCommand.prototype.executeInternal = function (text, color, callback) {
11523
11528
  if (color === void 0) { color = ""; }
11524
11529
  var args = new ResourceArguments_1.ResourceInsertingArguments(text, color);
11525
11530
  this.modelManipulator.dispatcher.notifyResourceCreating(args);
11526
11531
  if (!args.cancel)
11527
- this.history.addAndRedo(new ResourceHistoryItem_1.CreateResourceHistoryItem(this.modelManipulator, args.text, args.color));
11532
+ this.history.addAndRedo(new ResourceHistoryItem_1.CreateResourceHistoryItem(this.modelManipulator, args.text, args.color, callback));
11528
11533
  return !args.cancel;
11529
11534
  };
11530
11535
  CreateResourceCommand.prototype.isEnabled = function () {
@@ -11577,10 +11582,11 @@ var AssignResourceCommand = (function (_super) {
11577
11582
  AssignResourceCommand.prototype.executeInternal = function (resourceId, taskId) {
11578
11583
  var assignment = this.control.viewModel.assignments.items.filter(function (r) { return r.resourceId == resourceId && r.taskId == taskId; })[0];
11579
11584
  if (!assignment) {
11580
- var args = new AssignmentArguments_1.ResourceAssigningArguments(resourceId, taskId);
11585
+ var converter = this.control.viewModel;
11586
+ var args = new AssignmentArguments_1.ResourceAssigningArguments(converter.convertInternalToPublicKey("resource", resourceId), converter.convertInternalToPublicKey("task", taskId));
11581
11587
  this.modelManipulator.dispatcher.notifyResourceAssigning(args);
11582
11588
  if (!args.cancel) {
11583
- this.history.addAndRedo(new ResourceHistoryItem_1.AssignResourceHistoryItem(this.modelManipulator, args.resourceId, args.taskId));
11589
+ this.history.addAndRedo(new ResourceHistoryItem_1.AssignResourceHistoryItem(this.modelManipulator, converter.convertPublicToInternalKey("resource", args.resourceId), converter.convertPublicToInternalKey("task", args.taskId)));
11584
11590
  return true;
11585
11591
  }
11586
11592
  }
@@ -12355,8 +12361,10 @@ var ValidationController = (function () {
12355
12361
  validRange.end.setTime(validRange.start.getTime() + (successorTask.end.getTime() - successorTask.start.getTime()));
12356
12362
  _this.correctMoving(successorTask.internalId, validRange);
12357
12363
  _this.history.addAndRedo(new TaskPropertiesHistoryItem_1.TaskMoveHistoryItem(_this.gantt.modelManipulator, dep.successorId, validRange));
12358
- if (_this._parentAutoCalc)
12359
- _this.updateParentsRangeByChild(successorTask.internalId);
12364
+ if (_this._parentAutoCalc) {
12365
+ var delta = validRange.start.getTime() - rangeBeforeMove.start.getTime();
12366
+ _this.correctOnMoving(successorTask.internalId, delta);
12367
+ }
12360
12368
  _this.moveStartDependTasks(dep.successorId, rangeBeforeMove.start);
12361
12369
  _this.moveEndDependTasks(dep.successorId, rangeBeforeMove.end);
12362
12370
  }
@@ -12365,8 +12373,10 @@ var ValidationController = (function () {
12365
12373
  validRange.end.setTime(task.end.getTime());
12366
12374
  _this.correctMoving(successorTask.internalId, validRange);
12367
12375
  _this.history.addAndRedo(new TaskPropertiesHistoryItem_1.TaskMoveHistoryItem(_this.gantt.modelManipulator, dep.successorId, validRange));
12368
- if (_this._parentAutoCalc)
12369
- _this.updateParentsRangeByChild(successorTask.internalId);
12376
+ if (_this._parentAutoCalc) {
12377
+ var delta = validRange.start.getTime() - rangeBeforeMove.start.getTime();
12378
+ _this.correctOnMoving(successorTask.internalId, delta);
12379
+ }
12370
12380
  _this.moveStartDependTasks(dep.successorId, rangeBeforeMove.start);
12371
12381
  _this.moveEndDependTasks(dep.successorId, rangeBeforeMove.end);
12372
12382
  }
@@ -12385,8 +12395,10 @@ var ValidationController = (function () {
12385
12395
  validRange.end.setTime(task.start.getTime());
12386
12396
  _this.correctMoving(successorTask.internalId, validRange);
12387
12397
  _this.history.addAndRedo(new TaskPropertiesHistoryItem_1.TaskMoveHistoryItem(_this.gantt.modelManipulator, dep.successorId, validRange));
12388
- if (_this._parentAutoCalc)
12389
- _this.updateParentsRangeByChild(successorTask.internalId);
12398
+ if (_this._parentAutoCalc) {
12399
+ var delta = validRange.start.getTime() - rangeBeforeMove.start.getTime();
12400
+ _this.correctOnMoving(successorTask.internalId, delta);
12401
+ }
12390
12402
  _this.moveStartDependTasks(dep.successorId, rangeBeforeMove.start);
12391
12403
  _this.moveEndDependTasks(dep.successorId, rangeBeforeMove.end);
12392
12404
  }
@@ -12395,8 +12407,10 @@ var ValidationController = (function () {
12395
12407
  validRange.end.setTime(task.start.getTime() + (successorTask.end.getTime() - successorTask.start.getTime()));
12396
12408
  _this.correctMoving(successorTask.internalId, validRange);
12397
12409
  _this.history.addAndRedo(new TaskPropertiesHistoryItem_1.TaskMoveHistoryItem(_this.gantt.modelManipulator, dep.successorId, validRange));
12398
- if (_this._parentAutoCalc)
12399
- _this.updateParentsRangeByChild(successorTask.internalId);
12410
+ if (_this._parentAutoCalc) {
12411
+ var delta = validRange.start.getTime() - rangeBeforeMove.start.getTime();
12412
+ _this.correctOnMoving(successorTask.internalId, delta);
12413
+ }
12400
12414
  _this.moveStartDependTasks(dep.successorId, rangeBeforeMove.start);
12401
12415
  _this.moveEndDependTasks(dep.successorId, rangeBeforeMove.end);
12402
12416
  }
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 2.0.14
4
- * Build date: Mon Dec 21 2020
3
+ * Version: 2.0.18
4
+ * Build date: Fri Dec 25 2020
5
5
  *
6
6
  * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs