@syncfusion/ej2-schedule 27.1.48 → 27.1.51

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.
@@ -2028,6 +2028,9 @@ var ScheduleTouch = /** @__PURE__ @class */ (function () {
2028
2028
  this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';
2029
2029
  };
2030
2030
  ScheduleTouch.prototype.onTransitionEnd = function () {
2031
+ if (!isNullOrUndefined(this.element) && !this.element.classList.contains(TRANSLATE_CLASS)) {
2032
+ return;
2033
+ }
2031
2034
  removeClass([this.element], TRANSLATE_CLASS);
2032
2035
  this.element.style.transitionDuration = '';
2033
2036
  this.element.style.transform = '';
@@ -6442,6 +6445,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
6442
6445
  this.parent.activeEventData = { event: eventObject, element: target };
6443
6446
  };
6444
6447
  EventBase.prototype.generateOccurrence = function (event, viewDate, isMaxCount) {
6448
+ var _this = this;
6445
6449
  var startDate = event[this.parent.eventFields.startTime];
6446
6450
  var endDate = event[this.parent.eventFields.endTime];
6447
6451
  var eventRule = event[this.parent.eventFields.recurrenceRule];
@@ -6456,6 +6460,10 @@ var EventBase = /** @__PURE__ @class */ (function () {
6456
6460
  var newTimezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
6457
6461
  var firstDay = this.parent.activeViewOptions.firstDayOfWeek;
6458
6462
  var calendarMode = this.parent.calendarMode;
6463
+ if (event[this.parent.eventFields.recurrenceRule] && event[this.parent.eventFields.recurrenceRule].includes('BYMONTHDAY') &&
6464
+ this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
6465
+ startDate = this.parent.tzModule.convert(event[this.parent.eventFields.startTime], this.parent.timezone, event[this.parent.eventFields.startTimezone]);
6466
+ }
6459
6467
  var dates = generate(startDate, eventRule, exception, firstDay, maxCount, viewDate, calendarMode, newTimezone);
6460
6468
  if (this.parent.currentView === 'Agenda' && eventRule.indexOf('COUNT') === -1 && eventRule.indexOf('UNTIL') === -1) {
6461
6469
  if (isNullOrUndefined(event.generatedDates)) {
@@ -6470,11 +6478,21 @@ var EventBase = /** @__PURE__ @class */ (function () {
6470
6478
  }
6471
6479
  }
6472
6480
  }
6481
+ var isDSTAdjusted = false;
6482
+ var convertedDates = [];
6483
+ if (event[this.parent.eventFields.recurrenceRule] && event[this.parent.eventFields.recurrenceRule].includes('BYMONTHDAY') &&
6484
+ this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
6485
+ isDSTAdjusted = true;
6486
+ convertedDates.push.apply(convertedDates, dates.map(function (date) {
6487
+ return _this.parent.tzModule.convert(new Date(date), event[_this.parent.eventFields.startTimezone], _this.parent.timezone).getTime();
6488
+ }));
6489
+ }
6490
+ convertedDates = convertedDates.length > 0 ? convertedDates : dates;
6473
6491
  var occurrenceCollection = [];
6474
- for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
6475
- var date = dates_1[_i];
6492
+ for (var _i = 0, convertedDates_1 = convertedDates; _i < convertedDates_1.length; _i++) {
6493
+ var date = convertedDates_1[_i];
6476
6494
  var clonedObject = extend({}, event, null, true);
6477
- date = this.getDSTAdjustedTime(date, clonedObject);
6495
+ date = !isDSTAdjusted ? this.getDSTAdjustedTime(date, clonedObject) : date;
6478
6496
  clonedObject[this.parent.eventFields.startTime] = new Date(date);
6479
6497
  clonedObject[this.parent.eventFields.endTime] = new Date(new Date(date).setMilliseconds(duration));
6480
6498
  clonedObject[this.parent.eventFields.recurrenceID] = clonedObject[this.parent.eventFields.id];
@@ -6957,8 +6975,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6957
6975
  _this.slotCount = _this.parent.activeViewOptions.timeScale.slotCount;
6958
6976
  _this.interval = _this.parent.activeViewOptions.timeScale.interval;
6959
6977
  _this.allDayLevel = 0;
6960
- _this.startHour = _this.parent.activeView.getStartHour();
6961
- _this.endHour = _this.parent.activeView.getEndHour();
6978
+ _this.startHour = _this.getStartEndHours(_this.parent.activeViewOptions.startHour);
6979
+ _this.endHour = _this.getStartEndHours(_this.parent.activeViewOptions.endHour);
6962
6980
  _this.element = _this.parent.activeView.getPanel();
6963
6981
  _this.fields = _this.parent.eventFields;
6964
6982
  _this.animation = new Animation({ progress: _this.animationUiUpdate.bind(_this) });
@@ -7092,7 +7110,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7092
7110
  var renderDates = this.dateRender[parseInt(resource.toString(), 10)];
7093
7111
  for (var day = 0, length_1 = renderDates.length; day < length_1; day++) {
7094
7112
  var startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
7095
- var endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
7113
+ var endDate = resetTime(addDays(renderDates[parseInt(day.toString(), 10)], 1));
7096
7114
  var filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[parseInt(resource.toString(), 10)]);
7097
7115
  for (var _a = 0, filterEvents_1 = filterEvents; _a < filterEvents_1.length; _a++) {
7098
7116
  var event_1 = filterEvents_1[_a];
@@ -7123,7 +7141,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7123
7141
  }
7124
7142
  else {
7125
7143
  blockHeight = formatUnit(this.getHeight(eStart, eEnd));
7126
- blockTop = formatUnit(this.getTopValue(eStart, dayIndex, resource));
7144
+ blockTop = formatUnit(this.getTopValue(eStart));
7127
7145
  }
7128
7146
  var appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
7129
7147
  setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
@@ -7156,7 +7174,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7156
7174
  renderDates[parseInt(day.toString(), 10)] <= renderedDate[renderedDate.length - 1]; day++) {
7157
7175
  this_1.renderedEvents = [];
7158
7176
  var startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
7159
- var endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
7177
+ var endDate = resetTime(addDays(renderDates[parseInt(day.toString(), 10)], 1));
7160
7178
  var filterEvents = this_1.filterEvents(startDate, endDate, eventCollection, this_1.resources[parseInt(resource.toString(), 10)]);
7161
7179
  if (isRender) {
7162
7180
  for (var _i = 0, filterEvents_2 = filterEvents; _i < filterEvents_2.length; _i++) {
@@ -7501,7 +7519,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7501
7519
  if (eStart <= eEnd && isValidEvent && this.isWorkDayAvailable(resource, eStart)) {
7502
7520
  var appHeight = record.isSpanned.isSameDuration ? this.cellHeight : this.getHeight(eStart, eEnd);
7503
7521
  if (eStart.getTime() >= schedule.startHour.getTime()) {
7504
- topValue = this.getTopValue(eStart, dayIndex, resource);
7522
+ topValue = this.getTopValue(eStart);
7505
7523
  }
7506
7524
  var appIndex = this.getOverlapIndex(record, dayIndex, false, resource);
7507
7525
  record.Index = appIndex;
@@ -7562,13 +7580,20 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7562
7580
  var tempLeft = (parseFloat(appWidth) + 1) * index;
7563
7581
  return (tempLeft > 99 ? 99 : tempLeft) + '%';
7564
7582
  };
7565
- VerticalEvent.prototype.getTopValue = function (date, day, resource) {
7566
- var viewDate = resetTime(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)]);
7567
- var startEndHours = getStartEndHours(viewDate, this.startHour, this.endHour);
7568
- var startHour = startEndHours.startHour;
7569
- var adjustedStartHour = isDaylightSavingTime(viewDate) && (startHour.getHours() !== this.startHour.getHours()) ?
7570
- this.startHour.getHours() : startHour.getHours();
7571
- var diffInMinutes = ((date.getHours() - adjustedStartHour) * 60) + (date.getMinutes() - startHour.getMinutes());
7583
+ VerticalEvent.prototype.getStartEndHours = function (startEndTime) {
7584
+ if (!isNullOrUndefined(startEndTime) && startEndTime !== '') {
7585
+ var startEndDate = new Date(2000, 0, 0, 0);
7586
+ var timeString = startEndTime.split(':');
7587
+ if (timeString.length === 2) {
7588
+ startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);
7589
+ }
7590
+ return startEndDate;
7591
+ }
7592
+ return null;
7593
+ };
7594
+ VerticalEvent.prototype.getTopValue = function (date) {
7595
+ var startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
7596
+ var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
7572
7597
  return (this.parent.activeViewOptions.timeScale.enable) ? ((diffInMinutes * this.cellHeight * this.slotCount) / this.interval) : 0;
7573
7598
  };
7574
7599
  VerticalEvent.prototype.getOverlapIndex = function (record, day, isAllDay, resource) {
@@ -22330,14 +22355,17 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22330
22355
  _this.isCursorAhead = false;
22331
22356
  _this.enableCurrentViewDrag = false;
22332
22357
  _this.isPreventMultiDrag = false;
22358
+ _this.slotsUptoCursor = -1;
22359
+ _this.eleTop = 0;
22333
22360
  return _this;
22334
22361
  }
22335
22362
  DragAndDrop.prototype.wireDragEvent = function (element) {
22363
+ var isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
22336
22364
  new Draggable(element, {
22337
22365
  abort: '.' + EVENT_RESIZE_CLASS,
22338
22366
  clone: true,
22339
22367
  isDragScroll: true,
22340
- enableTailMode: (this.parent.eventDragArea) ? true : false,
22368
+ enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
22341
22369
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
22342
22370
  dragArea: this.dragArea,
22343
22371
  dragStart: this.dragStart.bind(this),
@@ -22361,6 +22389,8 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22361
22389
  }
22362
22390
  this.setDragActionDefaultValues();
22363
22391
  this.actionObj.element = e.element;
22392
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
22393
+ this.slotsUptoCursor = -1;
22364
22394
  this.actionObj.action = 'drag';
22365
22395
  var elements = [];
22366
22396
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -22439,7 +22469,13 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22439
22469
  }
22440
22470
  var top_1 = parseInt(e.top, 10);
22441
22471
  top_1 = top_1 < 0 ? 0 : top_1;
22442
- topValue = formatUnit(Math.floor(top_1 / cellHeight) * cellHeight);
22472
+ if (this.slotsUptoCursor < 0) {
22473
+ var cellsCountUptoCursor = Math.floor(top_1 / cellHeight);
22474
+ var cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
22475
+ this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
22476
+ }
22477
+ top_1 = (Math.floor((top_1 + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22478
+ topValue = formatUnit(top_1 < 0 ? 0 : top_1);
22443
22479
  var scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
22444
22480
  var cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
22445
22481
  if (cloneBottom > scrollHeight) {
@@ -22874,7 +22910,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22874
22910
  (dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
22875
22911
  (this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
22876
22912
  offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
22877
- if (dragArea.scrollTop > 0) {
22913
+ if (dragArea.scrollTop > 0 && offsetTop < dragArea.scrollHeight) {
22878
22914
  this.actionObj.clone.style.top = formatUnit(offsetTop);
22879
22915
  }
22880
22916
  }
@@ -23122,7 +23158,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
23122
23158
  var appHeight = this.parent.activeViewOptions.timeScale.enable ? this.verticalEvent.getHeight(eStart, eEnd) :
23123
23159
  this.actionObj.element.offsetHeight;
23124
23160
  var topValue = this.parent.activeViewOptions.timeScale.enable ?
23125
- this.verticalEvent.getTopValue(eStart, dayIndex, indexGroup) : this.actionObj.element.offsetTop;
23161
+ this.verticalEvent.getTopValue(eStart) : this.actionObj.element.offsetTop;
23126
23162
  if (isNullOrUndefined(index)) {
23127
23163
  if (i === 0) {
23128
23164
  this.actionObj.clone.style.top = formatUnit(topValue);
@@ -23921,6 +23957,10 @@ var ViewBase = /** @__PURE__ @class */ (function () {
23921
23957
  }
23922
23958
  startHour.setMilliseconds(0);
23923
23959
  endHour.setMilliseconds(0);
23960
+ if (resetTime(date).getTime() !== resetTime(startHour).getTime()) {
23961
+ startHour = new Date(2000, 0, 0, startHour.getHours(), startHour.getMinutes(), startHour.getMilliseconds());
23962
+ endHour = new Date(2000, 0, 0, endHour.getHours(), endHour.getMinutes(), endHour.getMilliseconds());
23963
+ }
23924
23964
  return !(getDateInMs(date) < getDateInMs(startHour) || getDateInMs(date) >= getDateInMs(endHour) ||
23925
23965
  !this.isWorkDay(date, workDays));
23926
23966
  };
@@ -24665,7 +24705,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
24665
24705
  }
24666
24706
  };
24667
24707
  VerticalView.prototype.getTopFromDateTime = function (date) {
24668
- var startHour = this.getStartHour();
24708
+ var startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
24669
24709
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
24670
24710
  return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) /
24671
24711
  this.parent.activeViewOptions.timeScale.interval;