@syncfusion/ej2-schedule 24.2.3 → 24.2.8

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +128 -59
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +127 -58
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +14 -14
  13. package/src/schedule/actions/drag.js +14 -5
  14. package/src/schedule/actions/resize.js +41 -26
  15. package/src/schedule/actions/virtual-scroll.js +4 -0
  16. package/src/schedule/base/util.d.ts +21 -0
  17. package/src/schedule/base/util.js +29 -2
  18. package/src/schedule/event-renderer/inline-edit.js +1 -1
  19. package/src/schedule/event-renderer/month.js +3 -4
  20. package/src/schedule/event-renderer/timeline-view.d.ts +1 -0
  21. package/src/schedule/event-renderer/timeline-view.js +25 -7
  22. package/src/schedule/event-renderer/vertical-view.js +1 -1
  23. package/src/schedule/event-renderer/year.js +3 -3
  24. package/src/schedule/renderer/timeline-view.d.ts +0 -1
  25. package/src/schedule/renderer/timeline-view.js +3 -6
  26. package/src/schedule/renderer/vertical-view.js +1 -1
  27. package/src/schedule/renderer/view-base.js +1 -1
  28. package/styles/bootstrap-dark.css +42 -0
  29. package/styles/bootstrap.css +42 -0
  30. package/styles/bootstrap4.css +42 -0
  31. package/styles/bootstrap5-dark.css +42 -0
  32. package/styles/bootstrap5.css +42 -0
  33. package/styles/fabric-dark.css +42 -0
  34. package/styles/fabric.css +42 -0
  35. package/styles/fluent-dark.css +42 -0
  36. package/styles/fluent.css +42 -0
  37. package/styles/highcontrast-light.css +42 -0
  38. package/styles/highcontrast.css +42 -0
  39. package/styles/material-dark.css +42 -0
  40. package/styles/material.css +42 -0
  41. package/styles/material3-dark.css +42 -0
  42. package/styles/material3.css +42 -0
  43. package/styles/schedule/_bootstrap-dark-definition.scss +1 -0
  44. package/styles/schedule/_bootstrap-definition.scss +1 -0
  45. package/styles/schedule/_bootstrap4-definition.scss +1 -0
  46. package/styles/schedule/_bootstrap5-definition.scss +1 -0
  47. package/styles/schedule/_fabric-dark-definition.scss +1 -0
  48. package/styles/schedule/_fabric-definition.scss +1 -0
  49. package/styles/schedule/_fluent-definition.scss +1 -0
  50. package/styles/schedule/_fusionnew-definition.scss +1 -0
  51. package/styles/schedule/_highcontrast-definition.scss +1 -0
  52. package/styles/schedule/_highcontrast-light-definition.scss +1 -0
  53. package/styles/schedule/_layout.scss +58 -0
  54. package/styles/schedule/_material-dark-definition.scss +1 -0
  55. package/styles/schedule/_material-definition.scss +1 -0
  56. package/styles/schedule/_material3-definition.scss +1 -0
  57. package/styles/schedule/_tailwind-definition.scss +1 -0
  58. package/styles/schedule/bootstrap-dark.css +42 -0
  59. package/styles/schedule/bootstrap.css +42 -0
  60. package/styles/schedule/bootstrap4.css +42 -0
  61. package/styles/schedule/bootstrap5-dark.css +42 -0
  62. package/styles/schedule/bootstrap5.css +42 -0
  63. package/styles/schedule/fabric-dark.css +42 -0
  64. package/styles/schedule/fabric.css +42 -0
  65. package/styles/schedule/fluent-dark.css +42 -0
  66. package/styles/schedule/fluent.css +42 -0
  67. package/styles/schedule/highcontrast-light.css +42 -0
  68. package/styles/schedule/highcontrast.css +42 -0
  69. package/styles/schedule/material-dark.css +42 -0
  70. package/styles/schedule/material.css +42 -0
  71. package/styles/schedule/material3-dark.css +42 -0
  72. package/styles/schedule/material3.css +42 -0
  73. package/styles/schedule/tailwind-dark.css +42 -0
  74. package/styles/schedule/tailwind.css +42 -0
  75. package/styles/tailwind-dark.css +42 -0
  76. package/styles/tailwind.css +42 -0
  77. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -63
  78. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -39
@@ -115,7 +115,7 @@ function getElementHeightFromClass(container, elementClass) {
115
115
  el.style.visibility = 'hidden';
116
116
  el.style.position = 'absolute';
117
117
  container.appendChild(el);
118
- height = el.getBoundingClientRect().height;
118
+ height = getElementHeight(el);
119
119
  remove(el);
120
120
  return height;
121
121
  }
@@ -132,7 +132,7 @@ function getElementWidthFromClass(container, elementClass) {
132
132
  el.style.visibility = 'hidden';
133
133
  el.style.position = 'absolute';
134
134
  container.appendChild(el);
135
- width = el.getBoundingClientRect().width;
135
+ width = getElementWidth(el);
136
136
  remove(el);
137
137
  return width;
138
138
  }
@@ -520,6 +520,33 @@ function capitalizeFirstWord(inputString, type) {
520
520
  }
521
521
  return inputString;
522
522
  }
523
+ /**
524
+ * Method to get element cell width
525
+ *
526
+ * @param {HTMLElement} element Accepts the DOM element
527
+ * @returns {number} Returns the width of the given element
528
+ */
529
+ function getElementWidth(element) {
530
+ return document.body.style.transform.includes('scale') ? element.offsetWidth : element.getBoundingClientRect().width;
531
+ }
532
+ /**
533
+ * Method to get element cell Height
534
+ *
535
+ * @param {HTMLElement} element Accepts the DOM element
536
+ * @returns {number} Returns the Height of the given element
537
+ */
538
+ function getElementHeight(element) {
539
+ return document.body.style.transform.includes('scale') ? element.offsetHeight : element.getBoundingClientRect().height;
540
+ }
541
+ /**
542
+ * Method to get element cell Top
543
+ *
544
+ * @param {HTMLElement} element Accepts the DOM element
545
+ * @returns {number} Returns the top value of the given element
546
+ */
547
+ function getElementTop(element) {
548
+ return document.body.style.transform.includes('scale') ? element.offsetTop : element.getBoundingClientRect().top;
549
+ }
523
550
 
524
551
  /**
525
552
  * CSS Constants
@@ -6907,7 +6934,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6907
6934
  this.resources = this.parent.resourceBase.renderedResources;
6908
6935
  }
6909
6936
  this.cellHeight =
6910
- parseFloat(this.parent.element.querySelector('.e-content-wrap tbody tr').getBoundingClientRect().height.toFixed(2));
6937
+ parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
6911
6938
  this.dateRender[0] = this.parent.activeView.renderDates;
6912
6939
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6913
6940
  for (var i = 0, len = this.resources.length; i < len; i++) {
@@ -7824,10 +7851,9 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7824
7851
  setStyleAttribute(cell, { 'height': height_1 + 'px' });
7825
7852
  });
7826
7853
  }
7827
- var cellDetail = this.workCells[this.parent.activeView.isTimelineView() ?
7828
- 0 : this.workCells.length - 1].getBoundingClientRect();
7829
- this.cellWidth = cellDetail.width;
7830
- this.cellHeight = cellDetail.height;
7854
+ var cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
7855
+ this.cellWidth = getElementWidth(cellDetail);
7856
+ this.cellHeight = getElementHeight(cellDetail);
7831
7857
  this.dateRender = dateRender;
7832
7858
  var filteredDates = this.getRenderedDates(dateRender);
7833
7859
  this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
@@ -8400,7 +8426,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8400
8426
  _this.eventContainers = [].slice.call(_this.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
8401
8427
  var tr = [].slice.call(_this.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr'));
8402
8428
  _this.dayLength = tr.length === 0 ? 0 : tr[0].children.length;
8403
- _this.content = _this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
8429
+ _this.content = _this.parent.element.querySelector('.' + SCHEDULE_TABLE_CLASS + '.' + CONTENT_TABLE_CLASS);
8404
8430
  return _this;
8405
8431
  }
8406
8432
  TimelineEvent.prototype.getSlotDates = function () {
@@ -8410,7 +8436,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8410
8436
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
8411
8437
  this.renderType = 'day';
8412
8438
  var workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
8413
- this.cellWidth = workCell.getBoundingClientRect().width / +(workCell.getAttribute('colspan') || 1);
8439
+ this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
8414
8440
  this.slotsPerDay = 1;
8415
8441
  }
8416
8442
  else {
@@ -8566,14 +8592,14 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8566
8592
  this.wireAppointmentEvents(appointmentElement, event);
8567
8593
  if (this.parent.rowAutoHeight) {
8568
8594
  var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8569
- var conWidth = conWrap.getBoundingClientRect().width;
8595
+ var conWidth = getElementWidth(conWrap);
8570
8596
  var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8571
8597
  conWrap.offsetWidth === conWrap.clientWidth;
8572
8598
  this.renderEventElement(event, appointmentElement, cellTd);
8573
8599
  var firstChild = this.getFirstChild(resIndex);
8574
8600
  this.updateCellHeight(firstChild, height);
8575
8601
  if (isWithoutScroll &&
8576
- (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
8602
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
8577
8603
  this.adjustAppointments(conWidth);
8578
8604
  }
8579
8605
  }
@@ -8599,8 +8625,11 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8599
8625
  this.slotCount / this.interval;
8600
8626
  for (var k = 0; k < slotCount; k++) {
8601
8627
  startDate = (k === 0) ? new Date(startDate.getTime()) : new Date(startDate.getTime() + (60000 * interval));
8628
+ if (slotCount < 1) {
8629
+ startDate = this.adjustToNearestTimeSlot(startDate, interval);
8630
+ }
8602
8631
  endDate = new Date(startDate.getTime() + (60000 * interval));
8603
- if (endDate.getTime() > endTime.getTime()) {
8632
+ if (slotCount >= 1 && endDate.getTime() > endTime.getTime()) {
8604
8633
  break;
8605
8634
  }
8606
8635
  var position_2 = this.getPosition(startDate, endDate, false, (this.day + i));
@@ -8616,6 +8645,20 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8616
8645
  }
8617
8646
  this.parent.renderTemplates();
8618
8647
  };
8648
+ TimelineEvent.prototype.adjustToNearestTimeSlot = function (inputTime, interval) {
8649
+ // Parse the input time
8650
+ var parsedTime = new Date(inputTime);
8651
+ // Get the minutes of the input time in milliseconds
8652
+ var minutesInMilliseconds = parsedTime.getHours() * 60 * 60 * 1000 + parsedTime.getMinutes() * 60 * 1000;
8653
+ // Calculate the adjusted time in milliseconds (nearest time slot)
8654
+ var adjustedMinutesInMilliseconds = Math.floor(minutesInMilliseconds / (interval * 60 * 1000)) * (interval * 60 * 1000);
8655
+ // Create a new Date object with the adjusted time
8656
+ var adjustedTime = new Date(parsedTime.getTime());
8657
+ adjustedTime.setHours(adjustedMinutesInMilliseconds / (60 * 60 * 1000) % 24);
8658
+ adjustedTime.setMinutes((adjustedMinutesInMilliseconds % (60 * 60 * 1000)) / (60 * 1000));
8659
+ // Return the adjusted time in string format
8660
+ return adjustedTime;
8661
+ };
8619
8662
  TimelineEvent.prototype.renderTimelineMoreIndicator = function (startTime, startDate, endDate, appHeight, interval, resIndex, appointmentsList, top, appLeft, appRight, cellTd, moreIndicator, appPos, position) {
8620
8663
  appLeft = (this.parent.enableRtl) ? appRight = position : position;
8621
8664
  appPos = (this.parent.enableRtl) ? appRight : appLeft;
@@ -8675,8 +8718,9 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8675
8718
  TimelineEvent.prototype.adjustAppointments = function (conWidth) {
8676
8719
  var _this = this;
8677
8720
  var tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8678
- this.cellWidth = this.workCells[0].getBoundingClientRect().width;
8679
- var currentPercentage = (this.cellWidth * tr.children.length) / (conWidth / 100);
8721
+ var actualCellWidth = getElementWidth(this.workCells[0]);
8722
+ this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
8723
+ var currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
8680
8724
  var apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
8681
8725
  apps.forEach(function (app) {
8682
8726
  if (_this.parent.enableRtl && app.style.right !== '0px') {
@@ -9033,7 +9077,7 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
9033
9077
  var allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
9034
9078
  var allDayLevel = 0;
9035
9079
  if (allDayElements.length > 0) {
9036
- allDayLevel = Math.floor(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS).getBoundingClientRect().height /
9080
+ allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
9037
9081
  allDayElements[0].offsetHeight) - 1;
9038
9082
  }
9039
9083
  verticalEvent.allDayLevel = allDayLevel;
@@ -14012,6 +14056,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14012
14056
  this.renderedLength = conTable.querySelector('tbody').children.length;
14013
14057
  virtual.style.height = (conTable.offsetHeight + (this.parent.resourceBase.expandedResources.length - (this.renderedLength)) *
14014
14058
  conTable.offsetHeight / this.renderedLength) + 'px';
14059
+ var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
14060
+ if ((conWrap.scrollHeight - conWrap.scrollTop) < conWrap.offsetHeight * this.bufferCount) {
14061
+ virtual.style.height = parseInt(virtual.style.height) + (conWrap.offsetHeight * this.bufferCount) + 'px';
14062
+ }
14015
14063
  }
14016
14064
  else {
14017
14065
  virtual.style.height = '';
@@ -20638,9 +20686,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20638
20686
  bottom: resizeTarget.classList.contains(BOTTOM_RESIZE_HANDLER)
20639
20687
  };
20640
20688
  _this.actionObj.groupIndex = _this.parent.uiStateValues.isGroupAdaptive ? _this.parent.uiStateValues.groupIndex : 0;
20641
- var workCell = _this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect();
20642
- _this.actionObj.cellWidth = workCell.width;
20643
- _this.actionObj.cellHeight = workCell.height;
20689
+ var workCell = _this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20690
+ _this.actionObj.cellWidth = getElementWidth(workCell);
20691
+ _this.actionObj.cellHeight = getElementHeight(workCell);
20644
20692
  var hRows = _this.parent.activeViewOptions.headerRows.map(function (row) { return row.option; });
20645
20693
  if (_this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
20646
20694
  var tr = _this.parent.getContentTable().querySelector('tr');
@@ -20942,9 +20990,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20942
20990
  parseInt(this.actionObj.clone.style.left, 10);
20943
20991
  offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20944
20992
  if (!isLeft) {
20945
- offsetValue += (this.actionObj.clone.getBoundingClientRect().width - this.actionObj.cellWidth);
20993
+ offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
20946
20994
  }
20947
- cellIndex = Math.floor(offsetValue / Math.floor(tr.getBoundingClientRect().width / noOfDays));
20995
+ cellIndex = Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
20948
20996
  isDateHeader = isTimeViews && headerName === 'Date';
20949
20997
  cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
20950
20998
  isLastCell = cellIndex === tdCollections.length;
@@ -20953,7 +21001,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20953
21001
  else {
20954
21002
  var cellWidth = this.actionObj.cellWidth;
20955
21003
  cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
20956
- Math.ceil((offset + (this.actionObj.clone.getBoundingClientRect().width - cellWidth)) / this.actionObj.cellWidth);
21004
+ Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
20957
21005
  if (this.parent.enableRtl) {
20958
21006
  var cellOffsetWidth = 0;
20959
21007
  if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
@@ -20961,7 +21009,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20961
21009
  cellOffsetWidth = this.actionObj.cellWidth;
20962
21010
  }
20963
21011
  var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
20964
- this.actionObj.cellWidth) + (isLeft ? 0 : this.actionObj.clone.getBoundingClientRect().width - cellOffsetWidth);
21012
+ this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
20965
21013
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
20966
21014
  }
20967
21015
  isLastCell = cellIndex === tdCollections.length;
@@ -20980,7 +21028,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20980
21028
  }
20981
21029
  else {
20982
21030
  if (!isLeft) {
20983
- offset += this.actionObj.clone.getBoundingClientRect().width;
21031
+ offset += getElementWidth(this.actionObj.clone);
20984
21032
  }
20985
21033
  var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
20986
21034
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
@@ -20992,9 +21040,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20992
21040
  }
20993
21041
  else {
20994
21042
  var cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
20995
- var originalWidth = Math.ceil((isLeft ? this.actionObj.element.getBoundingClientRect().width : 0) /
21043
+ var originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
20996
21044
  this.actionObj.cellWidth) * this.actionObj.cellWidth;
20997
- var noOfDays = Math.ceil((this.actionObj.clone.getBoundingClientRect().width - originalWidth) /
21045
+ var noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
20998
21046
  this.actionObj.cellWidth);
20999
21047
  var tr = closest(this.actionObj.clone, 'tr');
21000
21048
  var dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
@@ -21057,30 +21105,38 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21057
21105
  var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
21058
21106
  var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
21059
21107
  var targetWidth = isTimelineView ?
21060
- (this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth :
21061
- this.parent.currentView === 'Month' ? this.actionObj.element.getBoundingClientRect().width :
21062
- Math.ceil(this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth;
21108
+ (getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
21109
+ this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
21110
+ Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
21063
21111
  var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
21064
21112
  var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
21065
21113
  if (isTimeViews) {
21066
21114
  offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
21067
- offsetWidth = (Math.round((left + offsetWidth) / slotInterval) * slotInterval) - left;
21115
+ if (!isLeft) {
21116
+ var roundedLeft = (+parseFloat(this.actionObj.element.style[this.parent.enableRtl ? 'right' : 'left'])).toFixed(1);
21117
+ var roundedWidth = Math.round(targetWidth / slotInterval) * slotInterval;
21118
+ if (roundedLeft !== left.toFixed(1) || roundedWidth !== targetWidth) {
21119
+ offsetWidth = (Math.round((left + offsetWidth) / slotInterval) * slotInterval) - left;
21120
+ }
21121
+ }
21068
21122
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
21069
21123
  }
21070
21124
  var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
21071
- this.actionObj.clone.getBoundingClientRect().width : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
21125
+ getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
21072
21126
  if (this.parent.enableRtl) {
21073
21127
  var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
21074
21128
  -(offsetWidth - this.actionObj.cellWidth);
21075
21129
  rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
21076
21130
  if (isTimelineView && !isLeft) {
21077
- rightValue = Math.ceil((this.actionObj.element.offsetLeft + (this.actionObj.element.getBoundingClientRect().width +
21078
- (this.actionObj.pageX - this.actionObj.X))) / slotInterval) * slotInterval;
21079
- rightValue = rightValue < 0 ? Math.abs(rightValue) : -rightValue;
21131
+ rightValue = rightValue - (Math.ceil((this.actionObj.pageX - this.actionObj.X) / slotInterval) * slotInterval);
21132
+ if (rightValue < 0) {
21133
+ rightValue = parseInt(this.actionObj.clone.style.right, 10);
21134
+ width = parseInt(this.actionObj.clone.style.width, 10);
21135
+ }
21080
21136
  }
21081
21137
  rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
21082
21138
  styles.right = formatUnit(rightValue);
21083
- width = width + rightValue > this.scrollArgs.width ? this.actionObj.clone.getBoundingClientRect().width : width;
21139
+ width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
21084
21140
  }
21085
21141
  else {
21086
21142
  var offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
@@ -21088,24 +21144,31 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
21088
21144
  if (isTimelineView) {
21089
21145
  offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
21090
21146
  if (this.parent.enableRtl) {
21091
- offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.actionObj.clone.getBoundingClientRect().width)
21147
+ offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
21092
21148
  ? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
21093
21149
  }
21094
21150
  else {
21095
- offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.actionObj.clone.getBoundingClientRect().width &&
21096
- this.actionObj.clone.getBoundingClientRect().width === this.actionObj.cellWidth) ?
21151
+ offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
21152
+ getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
21097
21153
  parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
21098
21154
  }
21099
21155
  }
21100
21156
  var leftValue = offsetLeft;
21101
- offsetLeft = isTimelineView ? isTimeViews ? isLeft ? Math.floor(offsetLeft / slotInterval) * slotInterval : offsetLeft :
21157
+ offsetLeft = isTimelineView ? isTimeViews ? isLeft ? this.actionObj.element.offsetLeft -
21158
+ (Math.ceil((this.actionObj.element.offsetLeft - offsetLeft) / slotInterval) * slotInterval) : offsetLeft :
21102
21159
  Math.floor(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth :
21103
21160
  Math.ceil(Math.abs(offsetLeft) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
21104
21161
  if (offsetLeft < 0) {
21105
- offsetLeft = 0;
21106
- width = this.actionObj.clone.getBoundingClientRect().width;
21162
+ if (isTimelineView && isLeft && (offsetLeft % slotInterval)) {
21163
+ offsetLeft = parseInt(this.actionObj.clone.style.left, 10);
21164
+ width = parseInt(this.actionObj.clone.style.width, 10);
21165
+ }
21166
+ else {
21167
+ offsetLeft = 0;
21168
+ width = getElementWidth(this.actionObj.clone);
21169
+ }
21107
21170
  }
21108
- var cloneWidth = Math.ceil(this.actionObj.clone.getBoundingClientRect().width / this.actionObj.cellWidth) *
21171
+ var cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
21109
21172
  this.actionObj.cellWidth;
21110
21173
  if (isLeft) {
21111
21174
  styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
@@ -21237,7 +21300,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
21237
21300
  YearEvent.prototype.timelineYearViewEvents = function () {
21238
21301
  var _this = this;
21239
21302
  var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
21240
- this.cellWidth = workCell.getBoundingClientRect().width;
21303
+ this.cellWidth = getElementWidth(workCell);
21241
21304
  this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
21242
21305
  var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
21243
21306
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -21395,7 +21458,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
21395
21458
  var contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
21396
21459
  var isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
21397
21460
  var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
21398
- this.cellWidth = workCell.getBoundingClientRect().width;
21461
+ this.cellWidth = getElementWidth(workCell);
21399
21462
  this.cellHeader = 0;
21400
21463
  var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
21401
21464
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -21440,7 +21503,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
21440
21503
  appWrapper.forEach(function (appWrap, cellIndex) {
21441
21504
  var td = row.querySelector("td:nth-child(" + (cellIndex + 1) + ")");
21442
21505
  var app = [].slice.call(appWrap.children);
21443
- var width = td.getBoundingClientRect().width;
21506
+ var width = getElementWidth(td);
21444
21507
  var left = td.offsetLeft;
21445
21508
  if (_this.parent.enableRtl) {
21446
21509
  var right_1 = conTable_1.offsetWidth - left - td.offsetWidth;
@@ -22203,7 +22266,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22203
22266
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
22204
22267
  this.timelineEventModule.getSlotDates();
22205
22268
  this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
22206
- this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().width;
22269
+ getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
22207
22270
  this.calculateTimelineTime(e);
22208
22271
  }
22209
22272
  else {
@@ -22824,13 +22887,20 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22824
22887
  if (this.isStepDragging) {
22825
22888
  var widthDiff = this.getWidthDiff(tr, index);
22826
22889
  if (widthDiff !== 0) {
22827
- var timeDiff = Math.round(widthDiff / this.widthPerMinute);
22890
+ var timeDiff = Math.ceil(widthDiff / this.widthPerMinute);
22828
22891
  eventStart.setMinutes(eventStart.getMinutes() + (timeDiff * this.actionObj.interval));
22829
22892
  if (this.isCursorAhead || cursorDrag) {
22830
22893
  eventStart.setMilliseconds(-(eventDuration));
22831
22894
  }
22832
22895
  else {
22833
22896
  eventStart.setMinutes(eventStart.getMinutes() - this.minDiff);
22897
+ var intervalInMS = this.actionObj.interval * MS_PER_MINUTE;
22898
+ timeDiff = Math.abs(eventStart.getTime() - this.actionObj.start.getTime()) / intervalInMS;
22899
+ var roundTimeDiff = Math.trunc(timeDiff);
22900
+ if (roundTimeDiff !== timeDiff) {
22901
+ timeDiff = (roundTimeDiff * intervalInMS) * (eventStart > this.actionObj.start ? 1 : -1);
22902
+ eventStart = new Date(this.actionObj.start.getTime() + timeDiff);
22903
+ }
22834
22904
  }
22835
22905
  }
22836
22906
  else {
@@ -22851,7 +22921,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22851
22921
  (this.cursorPointIndex * (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval)));
22852
22922
  }
22853
22923
  }
22854
- eventStart = this.calculateIntervalTime(eventStart);
22924
+ if (!this.isStepDragging) {
22925
+ eventStart = this.calculateIntervalTime(eventStart);
22926
+ }
22855
22927
  if (this.isTimelineDayProcess) {
22856
22928
  var eventSrt = eventObj[this.parent.eventFields.startTime];
22857
22929
  eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds());
@@ -23013,7 +23085,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
23013
23085
  ~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
23014
23086
  var rowIndex = Math.floor(Math.floor((this.actionObj.Y +
23015
23087
  (dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
23016
- dragArea.getBoundingClientRect().top) / rowHeight);
23088
+ getElementTop(dragArea)) / rowHeight);
23017
23089
  rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
23018
23090
  this.actionObj.index = rowIndex;
23019
23091
  var eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
@@ -23029,7 +23101,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
23029
23101
  if (!isNullOrUndefined(this.parent.eventDragArea)) {
23030
23102
  return;
23031
23103
  }
23032
- var top = trCollection[parseInt(rowIndex.toString(), 10)].getBoundingClientRect().height * rowIndex;
23104
+ var top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
23033
23105
  if (this.parent.rowAutoHeight) {
23034
23106
  var cursorElement = this.getCursorElement(e);
23035
23107
  if (cursorElement) {
@@ -23550,7 +23622,7 @@ var ViewBase = /** @__PURE__ @class */ (function () {
23550
23622
  if (this.isTimelineView()) {
23551
23623
  var colElements = this.getColElements();
23552
23624
  var contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
23553
- var colWidth_1 = (contentBody.getBoundingClientRect().width / (colElements.length / 2));
23625
+ var colWidth_1 = (getElementWidth(contentBody) / (colElements.length / 2));
23554
23626
  if (content.offsetHeight !== content.clientHeight) {
23555
23627
  var resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
23556
23628
  if (!isNullOrUndefined(resourceColumn)) {
@@ -24058,7 +24130,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
24058
24130
  this.parent.activeViewOptions.timeScale.interval;
24059
24131
  };
24060
24132
  VerticalView.prototype.getWorkCellHeight = function () {
24061
- return parseFloat(this.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().height.toFixed(2));
24133
+ return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
24062
24134
  };
24063
24135
  VerticalView.prototype.getTdContent = function (date, type, groupIndex) {
24064
24136
  var cntEle;
@@ -27029,7 +27101,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
27029
27101
  }
27030
27102
  var scrollLeft;
27031
27103
  if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
27032
- scrollLeft = index * this.getWorkCellWidth();
27104
+ scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
27033
27105
  }
27034
27106
  else {
27035
27107
  scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
@@ -27116,7 +27188,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
27116
27188
  if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
27117
27189
  this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
27118
27190
  diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
27119
- this.getWorkCellWidth();
27191
+ getElementWidth(this.element.querySelector('.e-work-cells'));
27120
27192
  }
27121
27193
  else {
27122
27194
  var endHour = this.getEndHour();
@@ -27126,12 +27198,9 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
27126
27198
  }
27127
27199
  }
27128
27200
  }
27129
- return diffInDates + ((diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
27201
+ return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells')) * this.parent.activeViewOptions.timeScale.slotCount) /
27130
27202
  this.parent.activeViewOptions.timeScale.interval);
27131
27203
  };
27132
- TimelineViews.prototype.getWorkCellWidth = function () {
27133
- return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;
27134
- };
27135
27204
  TimelineViews.prototype.renderHeader = function () {
27136
27205
  var tr = createElement('tr');
27137
27206
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -28565,5 +28634,5 @@ var Print = /** @__PURE__ @class */ (function () {
28565
28634
  * Export Schedule components
28566
28635
  */
28567
28636
 
28568
- export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventDoubleClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, cellSelect, virtualScrollStart, virtualScrollStop, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, resetScrollbarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
28637
+ export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventDoubleClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, cellSelect, virtualScrollStart, virtualScrollStop, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, resetScrollbarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, getElementWidth, getElementHeight, getElementTop, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
28569
28638
  //# sourceMappingURL=ej2-schedule.es5.js.map