@syncfusion/ej2-gantt 24.1.41 → 24.1.44

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.
@@ -2824,7 +2824,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2824
2824
  }
2825
2825
  else {
2826
2826
  if (isValid) {
2827
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2827
+ return ((this.getTimeDifference(sDate, eDate, true) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2828
2828
  }
2829
2829
  else {
2830
2830
  return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
@@ -6568,8 +6568,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
6568
6568
  }
6569
6569
  };
6570
6570
  Timeline.prototype.calculateNumberOfTimelineCells = function (newTimeline) {
6571
- var numberOfDays = Math.abs((this.parent.cloneProjectEndDate.getTime() -
6572
- this.parent.cloneProjectStartDate.getTime()) / (24 * 60 * 60 * 1000));
6571
+ var sDate = new Date(this.parent.cloneProjectStartDate.getTime());
6572
+ var eDate = new Date(this.parent.cloneProjectEndDate.getTime());
6573
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
6574
+ var numberOfDays = Math.abs((eDate.getTime() - sDate.getTime()) / (24 * 60 * 60 * 1000));
6573
6575
  var count = newTimeline.bottomTier.count;
6574
6576
  var unit = newTimeline.bottomTier.unit;
6575
6577
  if (unit === 'Day') {
@@ -7411,24 +7413,35 @@ var Timeline = /** @__PURE__ @class */ (function () {
7411
7413
  case 'Day':
7412
7414
  lastDay.setHours(24, 0, 0, 0);
7413
7415
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
7416
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7414
7417
  break;
7415
7418
  case 'Hour':
7416
7419
  lastDay.setMinutes(60);
7417
7420
  lastDay.setSeconds(0);
7418
7421
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
7419
- increment = this.checkDate(firstDay, lastDay, increment, count);
7422
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7420
7423
  break;
7421
7424
  case 'Minutes':
7422
7425
  lastDay.setSeconds(60);
7423
7426
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * (count - 1));
7427
+ increment = this.checkDate(firstDay, lastDay, increment, count, mode);
7424
7428
  break;
7425
7429
  }
7426
7430
  return increment;
7427
7431
  };
7428
- Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count) {
7432
+ Timeline.prototype.checkDate = function (firstDay, lastDay, increment, count, mode) {
7429
7433
  var date = new Date(firstDay.getTime());
7430
7434
  date.setTime(date.getTime() + increment);
7431
- if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7435
+ if (mode === "Day" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7436
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24);
7437
+ if (!this.parent.isInDst(date)) {
7438
+ increment += (1000 * 60 * 60 * diffCount);
7439
+ }
7440
+ else if (this.parent.isInDst(date) && count !== 2) {
7441
+ increment -= (1000 * 60 * 60 * diffCount);
7442
+ }
7443
+ }
7444
+ else if (mode === "Hour" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7432
7445
  var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
7433
7446
  if (!this.parent.isInDst(date)) {
7434
7447
  increment += (1000 * 60 * 60 * diffCount);
@@ -7437,6 +7450,15 @@ var Timeline = /** @__PURE__ @class */ (function () {
7437
7450
  increment -= (1000 * 60 * 60 * diffCount);
7438
7451
  }
7439
7452
  }
7453
+ else if (mode === "Minutes" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
7454
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60);
7455
+ if (!this.parent.isInDst(date)) {
7456
+ increment += (1000 * 60 * 60 * diffCount);
7457
+ }
7458
+ else if (this.parent.isInDst(date) && count !== 2) {
7459
+ increment -= (1000 * 60 * 60 * diffCount);
7460
+ }
7461
+ }
7440
7462
  return increment;
7441
7463
  };
7442
7464
  /**
@@ -7504,6 +7526,18 @@ var Timeline = /** @__PURE__ @class */ (function () {
7504
7526
  this.parent.globalize.formatDate(scheduleWeeks, { format: this.parent.getDateFormat() }) :
7505
7527
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
7506
7528
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7529
+ var newDate = new Date(scheduleWeeks.getTime() + this.getIncrement(scheduleWeeks, count, mode));
7530
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks)) ||
7531
+ (this.parent.isInDst(newDate) && !this.parent.isInDst(scheduleWeeks))) {
7532
+ var temp = void 0;
7533
+ if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks))) {
7534
+ temp = this.getIncrement(scheduleWeeks, count, mode) - (1000 * 60 * 60);
7535
+ }
7536
+ else {
7537
+ temp = this.getIncrement(scheduleWeeks, count, mode) + (1000 * 60 * 60);
7538
+ }
7539
+ thWidth = (temp / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
7540
+ }
7507
7541
  var cellWidth = thWidth;
7508
7542
  thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
7509
7543
  : thWidth;
@@ -7545,7 +7579,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
7545
7579
  * @private
7546
7580
  */
7547
7581
  Timeline.prototype.calculateWidthBetweenTwoDate = function (mode, scheduleWeeks, endDate) {
7548
- var timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
7582
+ var sDate = new Date(scheduleWeeks.getTime());
7583
+ var eDate = new Date(endDate.getTime());
7584
+ this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
7585
+ var timeDifference = (eDate.getTime() - sDate.getTime());
7549
7586
  var balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
7550
7587
  return balanceDay * this.parent.perDayWidth;
7551
7588
  };
@@ -14770,7 +14807,10 @@ var FocusModule = /** @__PURE__ @class */ (function () {
14770
14807
  var selectingRowIndex = expandedRecords.indexOf(selectedItem);
14771
14808
  var currentSelectingRecord = e.action === 'downArrow' ? expandedRecords[selectingRowIndex + 1] :
14772
14809
  expandedRecords[selectingRowIndex - 1];
14773
- ganttObj.selectionModule.selectRow(ganttObj.currentViewData.indexOf(currentSelectingRecord), false, true);
14810
+ var activeElement = this.parent['args'];
14811
+ if (document.activeElement != activeElement) {
14812
+ ganttObj.selectionModule.selectRow(ganttObj.currentViewData.indexOf(currentSelectingRecord), false, true);
14813
+ }
14774
14814
  }
14775
14815
  else if (ganttObj.selectionSettings.mode === 'Cell' && ganttObj.selectionModule.getSelectedRowCellIndexes().length > 0) {
14776
14816
  var selectCellIndex = ganttObj.selectionModule.getSelectedRowCellIndexes();
@@ -15648,6 +15688,12 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15648
15688
  }
15649
15689
  };
15650
15690
  Gantt.prototype.keyActionHandler = function (e) {
15691
+ if (this.enableContextMenu && this.contextMenuModule && (e.action === 'downArrow' || e.action === 'upArrow') && document.getElementById(this.element.id + '_contextmenu') && this['args']) {
15692
+ var firstMenuItem = this['args'];
15693
+ if (!isNullOrUndefined(firstMenuItem)) {
15694
+ (firstMenuItem).focus();
15695
+ }
15696
+ }
15651
15697
  if (e.target && (e.action === 'downArrow' || e.action === 'upArrow') && e.target === this.element.querySelector('.e-rowcell')) {
15652
15698
  this.treeGrid.grid.notify('key-pressed', e);
15653
15699
  }
@@ -22933,8 +22979,8 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22933
22979
  else {
22934
22980
  _this.parent.showSpinner();
22935
22981
  }
22936
- _this.renderTabItems();
22937
22982
  if (!arg.cancel) {
22983
+ _this.renderTabItems();
22938
22984
  tabModel.selected = _this.tabSelectedEvent.bind(_this);
22939
22985
  tabModel.height = _this.parent.isAdaptive ? '100%' : 'auto';
22940
22986
  tabModel.overflowMode = 'Scrollable';
@@ -22971,6 +23017,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
22971
23017
  }
22972
23018
  });
22973
23019
  }
23020
+ else {
23021
+ arg.cancel = false;
23022
+ if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
23023
+ _this.parent.hideMaskRow();
23024
+ }
23025
+ else {
23026
+ _this.parent.hideSpinner();
23027
+ }
23028
+ }
22974
23029
  });
22975
23030
  };
22976
23031
  DialogEdit.prototype.changeFormObj = function (actionCompleteArgs, isCustomTab) {
@@ -29041,6 +29096,8 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
29041
29096
  if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
29042
29097
  args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
29043
29098
  args.newTaskData[tempTaskID] = args.data[tempTaskID];
29099
+ args.data['ganttProperties']['rowUniqueID'] = args.data[tempTaskID].toString();
29100
+ _this.parent.ids.push(args.data[tempTaskID].toString());
29044
29101
  }
29045
29102
  }
29046
29103
  if (!args.cancel) {
@@ -33528,7 +33585,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
33528
33585
  };
33529
33586
  ContextMenu$$1.prototype.contextMenuOpen = function (args) {
33530
33587
  this.isOpen = true;
33531
- var firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
33588
+ var firstMenuItem = this.parent['args'] = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
33532
33589
  if (!isNullOrUndefined(firstMenuItem)) {
33533
33590
  addClass([firstMenuItem], 'e-focused');
33534
33591
  }