@syncfusion/ej2-schedule 32.1.19 → 32.1.20

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.
@@ -17424,14 +17424,16 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
17424
17424
  resourceId: levelId,
17425
17425
  resourceName: treeLevel.resourceData[resource.textField],
17426
17426
  resource: treeLevel.resource,
17427
- resourceData: treeLevel.resourceData
17427
+ resourceData: treeLevel.resourceData,
17428
+ date: _this.parent.selectedDate
17428
17429
  };
17429
17430
  }
17430
17431
  else {
17431
17432
  resObj = {
17432
17433
  type: 'resourceHeader', resource: treeLevel.resource,
17433
17434
  resourceData: treeLevel.resourceData, groupIndex: groupIndex,
17434
- groupOrder: treeLevel.groupOrder
17435
+ groupOrder: treeLevel.groupOrder,
17436
+ date: _this.parent.selectedDate
17435
17437
  };
17436
17438
  resTreeColl.push(resObj);
17437
17439
  groupIndex++;
@@ -17759,9 +17761,15 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
17759
17761
  }
17760
17762
  this.lastResourceLevel = headerLevels.slice(-1)[0] || [];
17761
17763
  if (!this.parent.activeViewOptions.group.byDate) {
17764
+ for (var levelIndex = 0; levelIndex < headerLevels.length; levelIndex++) {
17765
+ for (var _d = 0, _e = headerLevels[parseInt(levelIndex.toString(), 10)]; _d < _e.length; _d++) {
17766
+ var levelItem = _e[_d];
17767
+ levelItem.date = this.parent.selectedDate;
17768
+ }
17769
+ }
17762
17770
  var index = 0;
17763
- for (var _d = 0, _e = this.lastResourceLevel; _d < _e.length; _d++) {
17764
- var lastLevelResource = _e[_d];
17771
+ for (var _f = 0, _g = this.lastResourceLevel; _f < _g.length; _f++) {
17772
+ var lastLevelResource = _g[_f];
17765
17773
  for (var i = 0; i < lastLevelResource.colSpan; i++) {
17766
17774
  lastColumnDates[parseInt(index.toString(), 10)].groupIndex = lastLevelResource.groupIndex;
17767
17775
  index++;
@@ -17845,8 +17853,8 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
17845
17853
  dateIndex++;
17846
17854
  };
17847
17855
  var this_3 = this;
17848
- for (var _f = 0, headerDates_1 = headerDates; _f < headerDates_1.length; _f++) {
17849
- var headerDate = headerDates_1[_f];
17856
+ for (var _h = 0, headerDates_1 = headerDates; _h < headerDates_1.length; _h++) {
17857
+ var headerDate = headerDates_1[_h];
17850
17858
  _loop_3(headerDate);
17851
17859
  }
17852
17860
  this.resourceDateTree = this.resourceDateTree.filter(function (data) { return data.length > 0; });
@@ -17859,19 +17867,23 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
17859
17867
  return dateHeaderLevels;
17860
17868
  }
17861
17869
  var dateColSpan = 0;
17862
- for (var _g = 0, _h = levels[0]; _g < _h.length; _g++) {
17863
- var firstRowTd = _h[_g];
17870
+ for (var _j = 0, _k = levels[0]; _j < _k.length; _j++) {
17871
+ var firstRowTd = _k[_j];
17864
17872
  dateColSpan += firstRowTd.colSpan;
17865
17873
  }
17866
- for (var _j = 0, headerDates_2 = headerDates; _j < headerDates_2.length; _j++) {
17867
- var headerDate = headerDates_2[_j];
17874
+ for (var _l = 0, headerDates_2 = headerDates; _l < headerDates_2.length; _l++) {
17875
+ var headerDate = headerDates_2[_l];
17868
17876
  headerDate.colSpan = dateColSpan;
17869
17877
  datesColumn.push(headerDate);
17870
17878
  var resGroup = extend([], levels, null, true);
17871
17879
  for (var k = 0, length_2 = resGroup.length; k < length_2; k++) {
17880
+ for (var _m = 0, _o = resGroup[parseInt(k.toString(), 10)]; _m < _o.length; _m++) {
17881
+ var resTd = _o[_m];
17882
+ resTd.date = headerDate.date;
17883
+ }
17872
17884
  if (k === resGroup.length - 1) {
17873
- for (var _k = 0, _l = resGroup[parseInt(k.toString(), 10)]; _k < _l.length; _k++) {
17874
- var resTd = _l[_k];
17885
+ for (var _p = 0, _q = resGroup[parseInt(k.toString(), 10)]; _p < _q.length; _p++) {
17886
+ var resTd = _q[_p];
17875
17887
  resTd.date = headerDate.date;
17876
17888
  resTd.workDays = headerDate.workDays;
17877
17889
  resTd.startHour = this.parent.getStartEndTime(resTd.resourceData[resTd.resource.startHourField]) ||
@@ -21648,7 +21660,7 @@ var ActionBase = /** @__PURE__ @class */ (function () {
21648
21660
  var startHour = this.parent.activeView.getStartHour();
21649
21661
  var intervalInMS = MS_PER_MINUTE * this.actionObj.interval;
21650
21662
  dateInMS += (startHour.getHours() * 60 + startHour.getMinutes()) * MS_PER_MINUTE + startHour.getSeconds() * 1000;
21651
- dateInMS = dateInMS + Math.floor((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
21663
+ dateInMS = dateInMS + ((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
21652
21664
  return new Date(dateInMS);
21653
21665
  };
21654
21666
  ActionBase.prototype.getContentAreaDimension = function () {
@@ -22440,7 +22452,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22440
22452
  var offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
22441
22453
  this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
22442
22454
  this.actionObj.cellWidth));
22443
- cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
22455
+ cellIndex = Math.ceil(offsetWidth / this.actionObj.cellWidth);
22444
22456
  }
22445
22457
  isLastCell = cellIndex === tdCollections.length;
22446
22458
  cellIndex = this.getIndex(cellIndex);
@@ -22458,13 +22470,29 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22458
22470
  }
22459
22471
  else {
22460
22472
  if (!isLeft) {
22461
- offset += this.parent.getElementWidth(this.actionObj.clone);
22462
- }
22463
- var spanMinutes = Math.floor((this.actionObj.slotInterval / this.actionObj.cellWidth) *
22473
+ var cloneWidth = this.parent.getElementWidth(this.actionObj.clone);
22474
+ var pixelsPerInterval = this.actionObj.cellWidth /
22475
+ (this.actionObj.slotInterval / this.actionObj.interval);
22476
+ var numIntervals = Math.round(cloneWidth / pixelsPerInterval);
22477
+ cloneWidth = numIntervals * pixelsPerInterval;
22478
+ offset = offset + cloneWidth;
22479
+ }
22480
+ var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
22464
22481
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
22465
22482
  spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
22466
22483
  resizeTime = new Date(resizeDate.getTime());
22467
22484
  resizeTime = new Date(resizeDate.getTime() + (spanMinutes * MS_PER_MINUTE));
22485
+ var isCustomResizeInterval = this.actionObj.interval !== this.actionObj.slotInterval;
22486
+ var initialCellTime = new Date(resizeTime.getTime());
22487
+ var intervalInMS = this.actionObj.interval * 60000;
22488
+ if (intervalInMS > 0 && isCustomResizeInterval) {
22489
+ if (this.resizeEdges.right || this.resizeEdges.left) {
22490
+ var eventTime = this.resizeEdges.right ? eventEnd : eventStart;
22491
+ var timeDifferenceMs = initialCellTime.getTime() - eventTime.getTime();
22492
+ var intervalCount = Math.round(timeDifferenceMs / intervalInMS);
22493
+ resizeTime = new Date(eventTime.getTime() + intervalCount * intervalInMS);
22494
+ }
22495
+ }
22468
22496
  this.updateTimePosition(resizeTime);
22469
22497
  }
22470
22498
  }
@@ -24872,14 +24900,18 @@ var ViewBase = /** @__PURE__ @class */ (function () {
24872
24900
  }
24873
24901
  };
24874
24902
  ViewBase.prototype.getHeaderBarHeight = function () {
24875
- var headerBarHeight = 2;
24903
+ var computedStyle = getComputedStyle(this.parent.element);
24904
+ var borderTop = parseFloat(computedStyle.borderTopWidth) || 1;
24905
+ var borderBottom = parseFloat(computedStyle.borderBottomWidth) || 1;
24906
+ var border = Math.round(borderTop + borderBottom);
24907
+ var headerBarHeight = border;
24876
24908
  if (this.parent.headerModule) {
24877
24909
  headerBarHeight += getOuterHeight(this.parent.headerModule.getHeaderElement());
24878
24910
  }
24879
24911
  if (this.parent.uiStateValues.isGroupAdaptive) {
24880
24912
  var resHeader = this.parent.element.querySelector('.' + RESOURCE_HEADER_TOOLBAR);
24881
24913
  if (resHeader) {
24882
- headerBarHeight += resHeader.offsetHeight;
24914
+ headerBarHeight += getOuterHeight(resHeader);
24883
24915
  }
24884
24916
  }
24885
24917
  return headerBarHeight;
@@ -25167,7 +25199,7 @@ var ViewBase = /** @__PURE__ @class */ (function () {
25167
25199
  ViewBase.prototype.setResourceHeaderContent = function (tdElement, tdData, className) {
25168
25200
  if (className === void 0) { className = TEXT_ELLIPSIS; }
25169
25201
  if (this.parent.activeViewOptions.resourceHeaderTemplate) {
25170
- var data = { resource: tdData.resource, resourceData: tdData.resourceData };
25202
+ var data = { resource: tdData.resource, resourceData: tdData.resourceData, date: tdData.date };
25171
25203
  var scheduleId = this.parent.element.id + '_';
25172
25204
  var viewName = this.parent.activeViewOptions.resourceHeaderTemplateName;
25173
25205
  var templateId = scheduleId + viewName + 'resourceHeaderTemplate';
@@ -27814,7 +27846,7 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
27814
27846
  groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
27815
27847
  resourceData: resData[parseInt(res.toString(), 10)].resourceData,
27816
27848
  groupIndex: (lastLevelInfo.length - data.length), className: [RESOURCE_NAME],
27817
- date: agendaDate
27849
+ date: this.parent.activeViewOptions.group.byDate ? firstDate : agendaDate
27818
27850
  };
27819
27851
  lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
27820
27852
  tempLastLevelInfo.push(extend({}, tempObj, null, true));
@@ -27842,7 +27874,8 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
27842
27874
  tempGroupedData[0].type = 'parentColumnLevel_' + (y + 1);
27843
27875
  tempGroupedData[0].resource = topResources[topResources.length - (y + 1)];
27844
27876
  tempGroupedData[0].resourceData = data[parseInt(x.toString(), 10)];
27845
- tempGroupedData[0].date = agendaDate;
27877
+ tempGroupedData[0].date = this.parent.activeViewOptions.group.byDate ?
27878
+ tempLastLevelInfo[parseInt(u.toString(), 10)].date : agendaDate;
27846
27879
  lastLevelInfo[tempGroupedData[0].groupIndex].push(tempGroupedData[0]);
27847
27880
  tempGroupedData = [];
27848
27881
  totalRowSpan = 0;