@syncfusion/ej2-schedule 28.2.3 → 28.2.5

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.
@@ -9360,8 +9360,8 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
9360
9360
  return slotTd;
9361
9361
  }
9362
9362
  else {
9363
- var daySlot = Math.round((((getUniversalTime(schedule.endHour) - getUniversalTime(schedule.startHour)) /
9364
- MS_PER_MINUTE) / this.getIntervalInMinutes(startTime)) * this.slotCount);
9363
+ var daySlot = Math.round(((getUniversalTime(schedule.endHour) - getUniversalTime(schedule.startHour)) /
9364
+ this.interval / MS_PER_MINUTE) * this.slotCount);
9365
9365
  return (daySlot * day) + slotTd;
9366
9366
  }
9367
9367
  };
@@ -11128,7 +11128,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
11128
11128
  QuickPopups.prototype.documentClick = function (e) {
11129
11129
  var target = e.event.target;
11130
11130
  var classNames = '.' + POPUP_WRAPPER_CLASS + ',.' + HEADER_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS +
11131
- ',.' + WORK_CELLS_CLASS + ',.' + APPOINTMENT_CLASS + ',.e-popup';
11131
+ ',.' + WORK_CELLS_CLASS + ',.' + APPOINTMENT_CLASS;
11132
11132
  var popupWrap = this.parent.element.querySelector('.' + POPUP_WRAPPER_CLASS);
11133
11133
  if ((popupWrap && popupWrap.childElementCount > 0 && !closest(target, classNames)) || !closest(target, classNames)) {
11134
11134
  this.quickPopupHide();
@@ -11143,7 +11143,8 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
11143
11143
  }
11144
11144
  if (!closest(target, '.' + MORE_POPUP_WRAPPER_CLASS) && (target.classList &&
11145
11145
  !target.classList.contains(MORE_INDICATOR_CLASS))
11146
- && (!closest(target, '.' + POPUP_OPEN)) && !closest(target, '.' + WORK_CELLS_CLASS)) {
11146
+ && (!closest(target, '.' + MORE_POPUP_WRAPPER_CLASS + '.' + POPUP_OPEN))
11147
+ && !closest(target, '.' + WORK_CELLS_CLASS)) {
11147
11148
  this.morePopup.hide();
11148
11149
  }
11149
11150
  };
@@ -15826,7 +15827,7 @@ var Crud = /** @__PURE__ @class */ (function () {
15826
15827
  editParams.changedRecords.push(_this.parent.eventBase.processTimezone(parentEvent, true));
15827
15828
  }
15828
15829
  if (childEvent[fields.id] !== parentEvent[fields.id]) {
15829
- editParams.deletedRecords.push(childEvent);
15830
+ editParams.deletedRecords.push(_this.parent.eventBase.processTimezone(childEvent, true));
15830
15831
  isDeletedRecords = true;
15831
15832
  }
15832
15833
  break;
@@ -15990,7 +15991,7 @@ var Crud = /** @__PURE__ @class */ (function () {
15990
15991
  _this.parent.uiStateValues.isIgnoreOccurrence = false;
15991
15992
  break;
15992
15993
  case 'DeleteSeries':
15993
- editParams.deletedRecords = editParams.deletedRecords.concat(deletedEvents.concat(parentEvent));
15994
+ editParams.deletedRecords = editParams.deletedRecords.concat(deletedEvents.concat(_this.parent.eventBase.processTimezone(parentEvent, true)));
15994
15995
  isDeletedRecords = true;
15995
15996
  break;
15996
15997
  }
@@ -16054,6 +16055,12 @@ var Crud = /** @__PURE__ @class */ (function () {
16054
16055
  isDelete = deleteArgs.deletedRecords[parseInt(a.toString(), 10)][fields_3.id] !== parentEvent_1[fields_3.id];
16055
16056
  }
16056
16057
  if (isDelete) {
16058
+ if (deleteArgs.deletedRecords instanceof Array) {
16059
+ for (var _i = 0, _a = deleteArgs.deletedRecords; _i < _a.length; _i++) {
16060
+ var event_8 = _a[_i];
16061
+ _this.parent.eventBase.processTimezone(event_8, true);
16062
+ }
16063
+ }
16057
16064
  editParams.deletedRecords.push(deleteArgs.deletedRecords[parseInt(a.toString(), 10)]);
16058
16065
  }
16059
16066
  };
@@ -16061,7 +16068,8 @@ var Crud = /** @__PURE__ @class */ (function () {
16061
16068
  _loop_5(a, count);
16062
16069
  }
16063
16070
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_3.id, _this.getTable(), _this.getQuery());
16064
- _this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);
16071
+ var cloneEvent = extend({}, deleteArgs.deletedRecords[deleteArgs.deletedRecords.length - 1], null, true);
16072
+ _this.parent.eventBase.selectWorkCellByTime([_this.parent.eventBase.processTimezone(cloneEvent)]);
16065
16073
  var crudArgs = {
16066
16074
  requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
16067
16075
  };
@@ -16182,8 +16190,8 @@ var Crud = /** @__PURE__ @class */ (function () {
16182
16190
  var eventCollection = (eventData instanceof Array) ? eventData : [eventData];
16183
16191
  var value = false;
16184
16192
  for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {
16185
- var event_8 = eventCollection_1[_i];
16186
- value = event_8[this.parent.eventFields.isBlock] || false;
16193
+ var event_9 = eventCollection_1[_i];
16194
+ value = event_9[this.parent.eventFields.isBlock] || false;
16187
16195
  }
16188
16196
  return value;
16189
16197
  };
@@ -21959,16 +21967,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21959
21967
  }
21960
21968
  else {
21961
21969
  var cellWidth = this.actionObj.cellWidth;
21962
- cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
21970
+ cellIndex = isLeft ? Math.round(offset / this.actionObj.cellWidth) :
21963
21971
  Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
21964
21972
  if (this.parent.enableRtl) {
21965
- var cellOffsetWidth = 0;
21966
- if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
21967
- !isTimelineMonth)) {
21968
- cellOffsetWidth = this.actionObj.cellWidth;
21969
- }
21970
- var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
21971
- this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
21973
+ var offsetWidth = (Math.round(offset / this.actionObj.cellWidth) *
21974
+ this.actionObj.cellWidth) + (isLeft ? 0 : (this.parent.getElementWidth(this.actionObj.clone) -
21975
+ this.actionObj.cellWidth));
21972
21976
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
21973
21977
  }
21974
21978
  isLastCell = cellIndex === tdCollections.length;
@@ -21989,11 +21993,11 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21989
21993
  if (!isLeft) {
21990
21994
  offset += this.parent.getElementWidth(this.actionObj.clone);
21991
21995
  }
21992
- var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
21996
+ var spanMinutes = Math.floor((this.actionObj.slotInterval / this.actionObj.cellWidth) *
21993
21997
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
21994
21998
  spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
21995
21999
  resizeTime = new Date(resizeDate.getTime());
21996
- resizeTime.setMinutes(resizeTime.getMinutes() + spanMinutes);
22000
+ resizeTime = new Date(resizeDate.getTime() + (spanMinutes * MS_PER_MINUTE));
21997
22001
  this.updateTimePosition(resizeTime);
21998
22002
  }
21999
22003
  }
@@ -22063,11 +22067,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22063
22067
  var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
22064
22068
  var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
22065
22069
  var targetWidth = isTimelineView ?
22066
- (this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
22070
+ Math.round(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
22067
22071
  this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
22068
22072
  Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
22069
22073
  var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
22070
22074
  var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
22075
+ left = Math.round(left / slotInterval) * slotInterval;
22071
22076
  if (isTimeViews) {
22072
22077
  offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
22073
22078
  if (!isLeft) {
@@ -22086,6 +22091,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22086
22091
  -(offsetWidth - this.actionObj.cellWidth);
22087
22092
  rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
22088
22093
  if (isTimelineView && !isLeft) {
22094
+ rightValue = Math.round(rightValue / slotInterval) * slotInterval;
22089
22095
  rightValue = rightValue - (Math.ceil((this.actionObj.pageX - this.actionObj.X) / slotInterval) * slotInterval);
22090
22096
  if (rightValue < 0) {
22091
22097
  rightValue = parseInt(this.actionObj.clone.style.right, 10);
@@ -25205,9 +25211,16 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
25205
25211
  var endHour = this.getStartEndHours(this.parent.activeViewOptions.endHour);
25206
25212
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
25207
25213
  var hoursRange = getStartEndHours(resetTime(new Date(date.getTime())), startHour, endHour);
25208
- var interval = this.parent.activeViewOptions.timeScale.slotCount !== 1 ?
25209
- this.parent.activeViewOptions.timeScale.interval :
25210
- (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
25214
+ var totalMinutes = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / MS_PER_MINUTE;
25215
+ var timescaleInterval = this.parent.activeViewOptions.timeScale.interval;
25216
+ var interval = 0;
25217
+ if (startHour.getHours() === 0 && startHour.getMinutes() === 0 && endHour.getHours() === 0 && endHour.getMinutes() === 0) {
25218
+ interval = timescaleInterval;
25219
+ }
25220
+ else {
25221
+ interval = (this.parent.activeViewOptions.timeScale.slotCount !== 1) ? timescaleInterval :
25222
+ (timescaleInterval > totalMinutes ? totalMinutes : timescaleInterval);
25223
+ }
25211
25224
  return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) / interval;
25212
25225
  };
25213
25226
  VerticalView.prototype.getWorkCellHeight = function () {
@@ -27986,7 +27999,7 @@ var MonthAgenda = /** @__PURE__ @class */ (function (_super) {
27986
27999
  return 'abbreviated';
27987
28000
  };
27988
28001
  MonthAgenda.prototype.updateSelectedCellClass = function (data) {
27989
- if (resetTime(data.date).getTime() === resetTime(this.monthAgendaDate).getTime()) {
28002
+ if (resetTime(data.date).getTime() === resetTime(new Date('' + this.parent.selectedDate)).getTime()) {
27990
28003
  data.className.push(SELECTED_CELL_CLASS);
27991
28004
  }
27992
28005
  };