@syncfusion/ej2-schedule 20.4.43 → 20.4.48

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 (54) hide show
  1. package/CHANGELOG.md +21 -3
  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 +183 -117
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +184 -117
  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 +15 -15
  13. package/src/schedule/actions/action-base.d.ts +0 -1
  14. package/src/schedule/actions/action-base.js +1 -6
  15. package/src/schedule/actions/drag.js +4 -3
  16. package/src/schedule/actions/resize.js +3 -3
  17. package/src/schedule/actions/touch.js +2 -1
  18. package/src/schedule/base/schedule.d.ts +2 -1
  19. package/src/schedule/base/schedule.js +6 -2
  20. package/src/schedule/event-renderer/event-base.d.ts +2 -0
  21. package/src/schedule/event-renderer/event-base.js +28 -4
  22. package/src/schedule/popups/event-window.js +40 -31
  23. package/src/schedule/popups/quick-popups.js +100 -67
  24. package/styles/bootstrap-dark.css +1 -1
  25. package/styles/bootstrap.css +1 -1
  26. package/styles/bootstrap4.css +1 -1
  27. package/styles/bootstrap5-dark.css +1 -1
  28. package/styles/bootstrap5.css +1 -1
  29. package/styles/fabric-dark.css +1 -1
  30. package/styles/fabric.css +1 -1
  31. package/styles/fluent-dark.css +1 -1
  32. package/styles/fluent.css +1 -1
  33. package/styles/highcontrast-light.css +1 -1
  34. package/styles/highcontrast.css +1 -1
  35. package/styles/material-dark.css +1 -1
  36. package/styles/material.css +1 -1
  37. package/styles/schedule/_layout.scss +1 -1
  38. package/styles/schedule/bootstrap-dark.css +1 -1
  39. package/styles/schedule/bootstrap.css +1 -1
  40. package/styles/schedule/bootstrap4.css +1 -1
  41. package/styles/schedule/bootstrap5-dark.css +1 -1
  42. package/styles/schedule/bootstrap5.css +1 -1
  43. package/styles/schedule/fabric-dark.css +1 -1
  44. package/styles/schedule/fabric.css +1 -1
  45. package/styles/schedule/fluent-dark.css +1 -1
  46. package/styles/schedule/fluent.css +1 -1
  47. package/styles/schedule/highcontrast-light.css +1 -1
  48. package/styles/schedule/highcontrast.css +1 -1
  49. package/styles/schedule/material-dark.css +1 -1
  50. package/styles/schedule/material.css +1 -1
  51. package/styles/schedule/tailwind-dark.css +1 -1
  52. package/styles/schedule/tailwind.css +1 -1
  53. package/styles/tailwind-dark.css +1 -1
  54. package/styles/tailwind.css +1 -1
@@ -1690,7 +1690,7 @@ class ScheduleTouch {
1690
1690
  if (offsetDist > time || (e.distanceX > (this.parent.element.offsetWidth / 2))) {
1691
1691
  this.swapPanels(e.swipeDirection);
1692
1692
  if (offsetDist > time && (e.distanceX > (this.parent.element.offsetWidth / 2))) {
1693
- this.element.style.transitionDuration = ((offsetDist / time) / 10) + 's';
1693
+ this.element.style.transitionDuration = (((Browser.isDevice ? e.distanceX : offsetDist) / time) / 10) + 's';
1694
1694
  }
1695
1695
  this.confirmSwipe(e.swipeDirection);
1696
1696
  }
@@ -1819,6 +1819,7 @@ class ScheduleTouch {
1819
1819
  this.nextPanel = null;
1820
1820
  this.timeStampStart = null;
1821
1821
  this.element.style.transform = '';
1822
+ this.element.style.transitionDuration = '';
1822
1823
  removeChildren(this.element);
1823
1824
  removeClass([this.element], TRANSLATE_CLASS);
1824
1825
  }
@@ -5424,8 +5425,8 @@ class EventBase {
5424
5425
  return filteredCollection;
5425
5426
  }
5426
5427
  sortByTime(appointmentsCollection) {
5427
- if (this.parent.eventSettings.sortComparer) {
5428
- appointmentsCollection = this.parent.eventSettings.sortComparer.call(this.parent, appointmentsCollection);
5428
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
5429
+ appointmentsCollection = this.customSorting(appointmentsCollection);
5429
5430
  }
5430
5431
  else {
5431
5432
  const fieldMappings = this.parent.eventFields;
@@ -5438,8 +5439,8 @@ class EventBase {
5438
5439
  return appointmentsCollection;
5439
5440
  }
5440
5441
  sortByDateTime(appointments) {
5441
- if (this.parent.eventSettings.sortComparer) {
5442
- appointments = this.parent.eventSettings.sortComparer.call(this.parent, appointments);
5442
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
5443
+ appointments = this.customSorting(appointments);
5443
5444
  }
5444
5445
  else {
5445
5446
  const fieldMapping = this.parent.eventFields;
@@ -5455,6 +5456,22 @@ class EventBase {
5455
5456
  }
5456
5457
  return appointments;
5457
5458
  }
5459
+ customSorting(appointments) {
5460
+ if (typeof (this.parent.eventSettings.sortComparer) === 'function') {
5461
+ return this.parent.eventSettings.sortComparer.call(this.parent, appointments);
5462
+ }
5463
+ else if (typeof (this.parent.eventSettings.sortComparer) === 'string') {
5464
+ const splits = this.parent.eventSettings.sortComparer.split('.');
5465
+ let sortFn;
5466
+ if (!isNullOrUndefined(window)) {
5467
+ sortFn = window[splits[splits.length - 1]];
5468
+ }
5469
+ if (sortFn) {
5470
+ return sortFn(appointments);
5471
+ }
5472
+ }
5473
+ return appointments;
5474
+ }
5458
5475
  getSmallestMissingNumber(array) {
5459
5476
  const large = Math.max(...array);
5460
5477
  for (let i = 0; i < large; i++) {
@@ -6372,6 +6389,14 @@ class EventBase {
6372
6389
  }
6373
6390
  return tr;
6374
6391
  }
6392
+ getPageCoordinates(e) {
6393
+ if (isNullOrUndefined(e)) {
6394
+ return e;
6395
+ }
6396
+ const eventArgs = e.event;
6397
+ return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
6398
+ eventArgs || e;
6399
+ }
6375
6400
  unWireEvents() {
6376
6401
  const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6377
6402
  for (const element of appElements) {
@@ -9129,7 +9154,7 @@ class QuickPopups {
9129
9154
  if (deleteIcon) {
9130
9155
  this.renderButton('e-flat e-round e-small', ICON + ' ' + DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);
9131
9156
  }
9132
- this.beforeQuickPopupOpen(target);
9157
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(e));
9133
9158
  }
9134
9159
  isCellBlocked(args) {
9135
9160
  const tempObj = {};
@@ -9216,7 +9241,7 @@ class QuickPopups {
9216
9241
  this.quickPopup.content = quickCellPopup;
9217
9242
  this.quickPopup.relateTo = target;
9218
9243
  this.quickPopup.dataBind();
9219
- this.beforeQuickPopupOpen(target);
9244
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(args.event));
9220
9245
  }
9221
9246
  isSameEventClick(events) {
9222
9247
  const isSameTarget = this.quickPopup.relateTo === closest(events.element, '.' + APPOINTMENT_CLASS);
@@ -9293,7 +9318,7 @@ class QuickPopups {
9293
9318
  this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
9294
9319
  closest(events.element, '.' + APPOINTMENT_CLASS);
9295
9320
  this.quickPopup.dataBind();
9296
- this.beforeQuickPopupOpen(events.element);
9321
+ this.beforeQuickPopupOpen(events.element, this.parent.eventBase.getPageCoordinates(events.originalEvent));
9297
9322
  }
9298
9323
  }
9299
9324
  getPopupHeader(headerType, headerData) {
@@ -9567,15 +9592,16 @@ class QuickPopups {
9567
9592
  this.morePopup.relateTo = closest(target, '.' + WORK_CELLS_CLASS);
9568
9593
  }
9569
9594
  }
9570
- this.parent.renderTemplates();
9571
- const eventProp = {
9572
- type: 'EventContainer', cancel: false,
9573
- element: this.morePopup.element, data: data
9574
- };
9575
- this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
9576
- if (!popupArgs.cancel) {
9577
- this.morePopup.show();
9578
- }
9595
+ this.parent.renderTemplates(() => {
9596
+ const eventProp = {
9597
+ type: 'EventContainer', cancel: false,
9598
+ element: this.morePopup.element, data: data
9599
+ };
9600
+ this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
9601
+ if (!popupArgs.cancel) {
9602
+ this.morePopup.show();
9603
+ }
9604
+ });
9579
9605
  });
9580
9606
  }
9581
9607
  saveClick(event) {
@@ -9765,70 +9791,102 @@ class QuickPopups {
9765
9791
  }
9766
9792
  });
9767
9793
  }
9768
- beforeQuickPopupOpen(target) {
9769
- this.parent.renderTemplates();
9770
- const isEventPopup = this.quickPopup.element.querySelector('.' + EVENT_POPUP_CLASS);
9771
- const popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
9772
- const eventProp = {
9773
- type: popupType, cancel: false, data: extend({}, this.getDataFromTarget(target), null, true),
9774
- target: target, element: this.quickPopup.element
9775
- };
9776
- this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
9777
- if (popupArgs.cancel) {
9778
- this.quickPopupHide();
9779
- this.destroyPopupButtons('quickPopup');
9780
- if (popupArgs.element.classList.contains(POPUP_OPEN)) {
9781
- this.quickPopupClose();
9782
- }
9783
- removeChildren(this.quickPopup.element);
9784
- this.isMultipleEventSelect = false;
9785
- }
9786
- else {
9787
- const display = this.quickPopup.element.style.display;
9788
- this.quickPopup.element.style.display = 'block';
9789
- if (this.parent.isAdaptive) {
9790
- this.quickPopup.element.removeAttribute('style');
9791
- this.quickPopup.element.style.display = 'block';
9792
- this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
9794
+ beforeQuickPopupOpen(target, originalEvent) {
9795
+ this.parent.renderTemplates(() => {
9796
+ const isEventPopup = this.quickPopup.element.querySelector('.' + EVENT_POPUP_CLASS);
9797
+ const popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
9798
+ const eventProp = {
9799
+ type: popupType, cancel: false, data: extend({}, this.getDataFromTarget(target), null, true),
9800
+ target: target, element: this.quickPopup.element
9801
+ };
9802
+ this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
9803
+ if (popupArgs.cancel) {
9804
+ this.quickPopupHide();
9805
+ this.destroyPopupButtons('quickPopup');
9806
+ if (popupArgs.element.classList.contains(POPUP_OPEN)) {
9807
+ this.quickPopupClose();
9808
+ }
9809
+ removeChildren(this.quickPopup.element);
9810
+ this.isMultipleEventSelect = false;
9793
9811
  }
9794
9812
  else {
9795
- const isVirtualScroll = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll
9796
- && !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
9797
- const conTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
9798
- this.quickPopup.offsetX = isVirtualScroll && !this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
9799
- this.quickPopup.collision = { X: this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
9800
- this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: this.parent.enableRtl ? 'bottom' : 'top' };
9801
- this.quickPopup.dataBind();
9802
- this.quickPopup.refreshPosition(null, true);
9803
- const collide = isCollide(this.quickPopup.element, this.parent.element);
9804
- if (collide.indexOf(this.parent.enableRtl ? 'left' : 'right') > -1) {
9805
- this.quickPopup.offsetX = -target.offsetWidth - 10 - this.quickPopup.element.offsetWidth;
9806
- if (isVirtualScroll && !this.parent.enableRtl) {
9807
- this.quickPopup.offsetX = getTranslateX(conTable) + this.quickPopup.offsetX;
9808
- }
9813
+ const display = this.quickPopup.element.style.display;
9814
+ this.quickPopup.element.style.display = 'block';
9815
+ if (this.parent.isAdaptive) {
9816
+ this.quickPopup.element.removeAttribute('style');
9817
+ this.quickPopup.element.style.display = 'block';
9818
+ this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
9819
+ }
9820
+ else {
9821
+ const isVirtualScroll = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll
9822
+ && !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
9823
+ const conTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
9824
+ this.quickPopup.offsetX = isVirtualScroll && !this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
9825
+ this.quickPopup.offsetY = this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll ?
9826
+ this.quickPopup.offsetY : 0;
9827
+ this.quickPopup.collision = { X: this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
9828
+ this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: this.parent.enableRtl ? 'bottom' : 'top' };
9809
9829
  this.quickPopup.dataBind();
9810
9830
  this.quickPopup.refreshPosition(null, true);
9811
- const leftCollide = isCollide(this.quickPopup.element, this.parent.element);
9812
- if (leftCollide.indexOf('left') > -1) {
9813
- this.quickPopup.position = { X: 'center', Y: 'center' };
9814
- this.quickPopup.collision = { X: 'fit', Y: 'fit' };
9815
- this.quickPopup.offsetX = -(this.quickPopup.element.offsetWidth / 2);
9831
+ const collide = isCollide(this.quickPopup.element, this.parent.element);
9832
+ if (collide.indexOf(this.parent.enableRtl ? 'left' : 'right') > -1) {
9833
+ this.quickPopup.offsetX = -target.offsetWidth - 10 - this.quickPopup.element.offsetWidth;
9834
+ if (isVirtualScroll && !this.parent.enableRtl) {
9835
+ this.quickPopup.offsetX = getTranslateX(conTable) + this.quickPopup.offsetX;
9836
+ }
9816
9837
  this.quickPopup.dataBind();
9838
+ this.quickPopup.refreshPosition(null, true);
9839
+ const leftCollide = isCollide(this.quickPopup.element, this.parent.element);
9840
+ if (leftCollide.indexOf('left') > -1) {
9841
+ this.quickPopup.position = { X: 'center', Y: 'center' };
9842
+ this.quickPopup.collision = { X: 'fit', Y: 'fit' };
9843
+ this.quickPopup.offsetX = -(this.quickPopup.element.offsetWidth / 2);
9844
+ this.quickPopup.dataBind();
9845
+ }
9846
+ }
9847
+ if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
9848
+ const translateY = getTranslateY(conTable);
9849
+ this.quickPopup.offsetY = translateY;
9850
+ this.quickPopup.dataBind();
9851
+ this.quickPopup.refreshPosition(null, true);
9852
+ }
9853
+ if (this.quickPopup.position.X === 'center' && this.quickPopup.position.Y === 'center' && !isNullOrUndefined(originalEvent) &&
9854
+ originalEvent.clientX && originalEvent.clientY) {
9855
+ const clientX = originalEvent.clientX;
9856
+ const clientY = originalEvent.clientY;
9857
+ const targetRect = target.getBoundingClientRect();
9858
+ const offsetY = originalEvent.offsetY || Math.ceil(clientY - targetRect.y);
9859
+ const previousOffset = this.quickPopup.offsetY;
9860
+ let collision = isCollide(this.quickPopup.element, target);
9861
+ const popupRect = this.quickPopup.element.getBoundingClientRect();
9862
+ const targetEle = document.elementFromPoint(clientX, clientY);
9863
+ if (collision.indexOf('top') > -1 || collision.indexOf('bottom') > -1 || closest(targetEle, '.' + POPUP_WRAPPER_CLASS)) {
9864
+ if (popupRect.top <= clientY &&
9865
+ clientY <= popupRect.top + popupRect.height) {
9866
+ this.quickPopup.offsetY = previousOffset - popupRect.height - 10;
9867
+ this.quickPopup.dataBind();
9868
+ collision = isCollide(this.quickPopup.element, this.parent.element);
9869
+ if (collision.indexOf('top') > -1) {
9870
+ this.quickPopup.offsetY = previousOffset + offsetY + 10;
9871
+ this.quickPopup.dataBind();
9872
+ }
9873
+ }
9874
+ else if (isCollide(this.quickPopup.element, this.parent.element).indexOf('bottom') > -1) {
9875
+ this.quickPopup.offsetY =
9876
+ previousOffset - offsetY - Math.ceil(popupRect.height) - 10;
9877
+ this.quickPopup.dataBind();
9878
+ }
9879
+ }
9817
9880
  }
9818
9881
  }
9819
- if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
9820
- const translateY = getTranslateY(conTable);
9821
- this.quickPopup.offsetY = translateY;
9822
- this.quickPopup.dataBind();
9882
+ if (isEventPopup) {
9883
+ this.applyEventColor();
9823
9884
  }
9885
+ this.quickPopup.element.style.display = display;
9886
+ this.quickPopup.dataBind();
9887
+ this.quickPopup.show();
9824
9888
  }
9825
- if (isEventPopup) {
9826
- this.applyEventColor();
9827
- }
9828
- this.quickPopup.element.style.display = display;
9829
- this.quickPopup.dataBind();
9830
- this.quickPopup.show();
9831
- }
9889
+ });
9832
9890
  });
9833
9891
  }
9834
9892
  applyEventColor() {
@@ -11579,8 +11637,9 @@ class EventWindow {
11579
11637
  const templateId = this.parent.element.id + '_editorTemplate';
11580
11638
  const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
11581
11639
  append(tempEle, form);
11582
- this.parent.renderTemplates();
11583
- this.applyFormValidation();
11640
+ this.parent.renderTemplates(() => {
11641
+ this.applyFormValidation();
11642
+ });
11584
11643
  }
11585
11644
  else {
11586
11645
  form.appendChild(this.getDefaultEventWindowContent());
@@ -12511,7 +12570,9 @@ class EventWindow {
12511
12570
  }
12512
12571
  }
12513
12572
  if (this.recurrenceEditor && this.recurrenceEditor.value && this.recurrenceEditor.value !== '') {
12514
- alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
12573
+ if (this.parent.currentAction !== 'EditOccurrence') {
12574
+ alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
12575
+ }
12515
12576
  let isShowAlert = true;
12516
12577
  if (alertType === 'seriesChangeAlert' && this.parent.uiStateValues.isIgnoreOccurrence) {
12517
12578
  isShowAlert = false;
@@ -12734,53 +12795,58 @@ class EventWindow {
12734
12795
  if (isNullOrUndefined(index)) {
12735
12796
  return false;
12736
12797
  }
12798
+ const currentStartTime = new Date(+currentData[this.fields.startTime]);
12799
+ const currentEndTime = new Date(+currentData[this.fields.endTime]);
12800
+ if (index !== recurColl.length - 1) {
12801
+ var nextStartTime = new Date(+recurColl[index + 1][this.fields.startTime]);
12802
+ var nextEndTime = new Date(+recurColl[index + 1][this.fields.endTime]);
12803
+ }
12804
+ const lastEndTime = new Date(+recurColl[recurColl.length - 1][this.fields.endTime]);
12737
12805
  if (index === 0) {
12738
12806
  if (!isNullOrUndefined(recurColl[index + 1])) {
12739
- if (!(resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
12740
- resetTime(new Date(+currentData[this.fields.endTime])).getTime()) &&
12741
- (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() >=
12742
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())) {
12743
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
12807
+ if (!(nextStartTime.getTime() >= currentEndTime.getTime()) &&
12808
+ (resetTime(lastEndTime).getTime() >=
12809
+ resetTime(currentStartTime).getTime()) ||
12810
+ resetTime(lastEndTime).getTime() < resetTime(currentStartTime).getTime()) {
12811
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
12744
12812
  return true;
12745
12813
  }
12746
- else if (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
12747
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
12748
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
12814
+ else if (!(resetTime(currentStartTime).getTime() <
12815
+ resetTime(nextStartTime).getTime())) {
12816
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
12749
12817
  return true;
12750
12818
  }
12751
12819
  }
12752
12820
  return false;
12753
12821
  }
12754
12822
  else {
12823
+ const previousStartTime = new Date(+recurColl[index - 1][this.fields.startTime]);
12824
+ const previousEndTime = new Date(+recurColl[index - 1][this.fields.endTime]);
12755
12825
  if (index === recurColl.length - 1) {
12756
- if (!(resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
12757
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) &&
12758
- (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() <=
12759
- resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
12760
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
12826
+ if (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() >
12827
+ resetTime(currentStartTime).getTime()) {
12828
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
12761
12829
  return true;
12762
12830
  }
12763
- else if (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.endTime])).getTime() >
12764
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
12765
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
12831
+ else if (!((previousEndTime.getTime() <= currentStartTime.getTime()) &&
12832
+ (resetTime(currentStartTime).getTime() > resetTime(previousStartTime).getTime()))) {
12833
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
12766
12834
  return true;
12767
12835
  }
12768
12836
  }
12769
- else if (!(((resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
12770
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
12771
- (resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
12772
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())) &&
12773
- ((resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
12774
- resetTime(new Date(+currentData[this.fields.endTime])).getTime()) ||
12775
- (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
12776
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())))) {
12837
+ else if (!(((resetTime(previousStartTime).getTime() < resetTime(currentStartTime).getTime()) ||
12838
+ resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
12839
+ resetTime(currentStartTime).getTime()) &&
12840
+ ((resetTime(nextStartTime).getTime() > resetTime(currentStartTime).getTime()) ||
12841
+ (lastEndTime.getTime() < currentStartTime.getTime())))) {
12777
12842
  this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
12778
12843
  return true;
12779
12844
  }
12780
- else if ((resetTime(new Date(+recurColl[index + 1][this.fields.endTime])).getTime() <
12781
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
12782
- (resetTime(new Date(+recurColl[index - 1][this.fields.startTime])).getTime() >
12783
- resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
12845
+ else if (!(previousEndTime.getTime() <= currentStartTime.getTime() && nextStartTime.getTime() >
12846
+ currentEndTime.getTime()) || (resetTime(nextEndTime).getTime() <
12847
+ resetTime(currentStartTime).getTime()) ||
12848
+ (resetTime(previousStartTime).getTime() > resetTime(currentEndTime).getTime()) ||
12849
+ !(resetTime(currentStartTime).getTime() < resetTime(nextStartTime).getTime())) {
12784
12850
  this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
12785
12851
  return true;
12786
12852
  }
@@ -15899,12 +15965,16 @@ let Schedule = class Schedule extends Component {
15899
15965
  /**
15900
15966
  * Method to render react templates
15901
15967
  *
15968
+ * @param {Function} callBack - specifies the callBack method
15902
15969
  * @returns {void}
15903
15970
  * @private
15904
15971
  */
15905
- renderTemplates() {
15972
+ renderTemplates(callback) {
15906
15973
  if (this.isReact) {
15907
- this.renderReactTemplates();
15974
+ this.renderReactTemplates(callback);
15975
+ }
15976
+ else if (callback) {
15977
+ callback();
15908
15978
  }
15909
15979
  }
15910
15980
  /**
@@ -18735,11 +18805,6 @@ class ActionBase {
18735
18805
  };
18736
18806
  return viewDimension;
18737
18807
  }
18738
- getPageCoordinates(e) {
18739
- const eventArgs = e.event;
18740
- return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
18741
- eventArgs || e;
18742
- }
18743
18808
  getIndex(index) {
18744
18809
  const contentElements = [].slice.call(this.parent.getContentTable().querySelector('tr').children);
18745
18810
  const indexes = { minIndex: 0, maxIndex: contentElements.length - 1 };
@@ -18870,7 +18935,7 @@ class ActionBase {
18870
18935
  }
18871
18936
  }
18872
18937
  getCursorElement(e) {
18873
- const pages = this.getPageCoordinates(e);
18938
+ const pages = this.parent.eventBase.getPageCoordinates(e);
18874
18939
  return document.elementFromPoint(pages.clientX, pages.clientY);
18875
18940
  }
18876
18941
  autoScroll() {
@@ -19144,7 +19209,7 @@ class Resize extends ActionBase {
19144
19209
  this.actionObj.cellWidth = trRect.width / noOfDays;
19145
19210
  this.actionObj.cellHeight = trRect.height;
19146
19211
  }
19147
- const pages = this.getPageCoordinates(e);
19212
+ const pages = this.parent.eventBase.getPageCoordinates(e);
19148
19213
  this.actionObj.X = pages.pageX;
19149
19214
  this.actionObj.Y = pages.pageY;
19150
19215
  this.actionObj.groupIndex = parseInt(this.actionObj.element.getAttribute('data-group-index') || '0', 10);
@@ -19173,7 +19238,7 @@ class Resize extends ActionBase {
19173
19238
  if ((!isNullOrUndefined(e.target)) && e.target.classList.contains(DISABLE_DATES)) {
19174
19239
  return;
19175
19240
  }
19176
- const pages = this.getPageCoordinates(e);
19241
+ const pages = this.parent.eventBase.getPageCoordinates(e);
19177
19242
  if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
19178
19243
  const doc = document.documentElement;
19179
19244
  const left = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
@@ -19599,7 +19664,7 @@ class Resize extends ActionBase {
19599
19664
  return styles;
19600
19665
  }
19601
19666
  resizeValidation(e) {
19602
- const pages = this.getPageCoordinates(e);
19667
+ const pages = this.parent.eventBase.getPageCoordinates(e);
19603
19668
  const viewDimension = this.getContentAreaDimension();
19604
19669
  const isTimeScale = this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.timeScale.enable;
19605
19670
  let cellWidth = this.actionObj.cellWidth;
@@ -20396,7 +20461,7 @@ class DragAndDrop extends ActionBase {
20396
20461
  return;
20397
20462
  }
20398
20463
  const eventObj = extend({}, this.actionObj.event, null, true);
20399
- const eventArgs = this.getPageCoordinates(e);
20464
+ const eventArgs = this.parent.eventBase.getPageCoordinates(e);
20400
20465
  this.actionObj.Y = this.actionObj.pageY = eventArgs.pageY;
20401
20466
  this.actionObj.X = this.actionObj.pageX = eventArgs.pageX;
20402
20467
  this.actionObj.target = e.target;
@@ -20537,7 +20602,8 @@ class DragAndDrop extends ActionBase {
20537
20602
  this.timelineEventModule.dateRender = this.parent.activeView.renderDates;
20538
20603
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
20539
20604
  this.timelineEventModule.getSlotDates();
20540
- this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth : this.actionObj.cellWidth;
20605
+ this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
20606
+ this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().width;
20541
20607
  this.calculateTimelineTime(e);
20542
20608
  }
20543
20609
  else {
@@ -21283,7 +21349,7 @@ class DragAndDrop extends ActionBase {
21283
21349
  return 0;
21284
21350
  }
21285
21351
  getColumnIndex(offsetLeft) {
21286
- const index = Math.floor(offsetLeft / this.actionObj.cellWidth);
21352
+ const index = Math.floor(offsetLeft / Math.trunc(this.actionObj.cellWidth));
21287
21353
  if (this.isHeaderRows) {
21288
21354
  return index;
21289
21355
  }