@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
@@ -1696,7 +1696,7 @@ var ScheduleTouch = /** @__PURE__ @class */ (function () {
1696
1696
  if (offsetDist > time || (e.distanceX > (this.parent.element.offsetWidth / 2))) {
1697
1697
  this.swapPanels(e.swipeDirection);
1698
1698
  if (offsetDist > time && (e.distanceX > (this.parent.element.offsetWidth / 2))) {
1699
- this.element.style.transitionDuration = ((offsetDist / time) / 10) + 's';
1699
+ this.element.style.transitionDuration = (((Browser.isDevice ? e.distanceX : offsetDist) / time) / 10) + 's';
1700
1700
  }
1701
1701
  this.confirmSwipe(e.swipeDirection);
1702
1702
  }
@@ -1826,6 +1826,7 @@ var ScheduleTouch = /** @__PURE__ @class */ (function () {
1826
1826
  this.nextPanel = null;
1827
1827
  this.timeStampStart = null;
1828
1828
  this.element.style.transform = '';
1829
+ this.element.style.transitionDuration = '';
1829
1830
  removeChildren(this.element);
1830
1831
  removeClass([this.element], TRANSLATE_CLASS);
1831
1832
  };
@@ -5480,8 +5481,8 @@ var EventBase = /** @__PURE__ @class */ (function () {
5480
5481
  return filteredCollection;
5481
5482
  };
5482
5483
  EventBase.prototype.sortByTime = function (appointmentsCollection) {
5483
- if (this.parent.eventSettings.sortComparer) {
5484
- appointmentsCollection = this.parent.eventSettings.sortComparer.call(this.parent, appointmentsCollection);
5484
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
5485
+ appointmentsCollection = this.customSorting(appointmentsCollection);
5485
5486
  }
5486
5487
  else {
5487
5488
  var fieldMappings_1 = this.parent.eventFields;
@@ -5494,8 +5495,8 @@ var EventBase = /** @__PURE__ @class */ (function () {
5494
5495
  return appointmentsCollection;
5495
5496
  };
5496
5497
  EventBase.prototype.sortByDateTime = function (appointments) {
5497
- if (this.parent.eventSettings.sortComparer) {
5498
- appointments = this.parent.eventSettings.sortComparer.call(this.parent, appointments);
5498
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
5499
+ appointments = this.customSorting(appointments);
5499
5500
  }
5500
5501
  else {
5501
5502
  var fieldMapping_1 = this.parent.eventFields;
@@ -5511,6 +5512,22 @@ var EventBase = /** @__PURE__ @class */ (function () {
5511
5512
  }
5512
5513
  return appointments;
5513
5514
  };
5515
+ EventBase.prototype.customSorting = function (appointments) {
5516
+ if (typeof (this.parent.eventSettings.sortComparer) === 'function') {
5517
+ return this.parent.eventSettings.sortComparer.call(this.parent, appointments);
5518
+ }
5519
+ else if (typeof (this.parent.eventSettings.sortComparer) === 'string') {
5520
+ var splits = this.parent.eventSettings.sortComparer.split('.');
5521
+ var sortFn = void 0;
5522
+ if (!isNullOrUndefined(window)) {
5523
+ sortFn = window[splits[splits.length - 1]];
5524
+ }
5525
+ if (sortFn) {
5526
+ return sortFn(appointments);
5527
+ }
5528
+ }
5529
+ return appointments;
5530
+ };
5514
5531
  EventBase.prototype.getSmallestMissingNumber = function (array) {
5515
5532
  var large = Math.max.apply(Math, array);
5516
5533
  for (var i = 0; i < large; i++) {
@@ -6475,6 +6492,14 @@ var EventBase = /** @__PURE__ @class */ (function () {
6475
6492
  }
6476
6493
  return tr;
6477
6494
  };
6495
+ EventBase.prototype.getPageCoordinates = function (e) {
6496
+ if (isNullOrUndefined(e)) {
6497
+ return e;
6498
+ }
6499
+ var eventArgs = e.event;
6500
+ return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
6501
+ eventArgs || e;
6502
+ };
6478
6503
  EventBase.prototype.unWireEvents = function () {
6479
6504
  var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6480
6505
  for (var _i = 0, appElements_1 = appElements; _i < appElements_1.length; _i++) {
@@ -9347,7 +9372,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9347
9372
  if (deleteIcon) {
9348
9373
  this.renderButton('e-flat e-round e-small', ICON + ' ' + DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);
9349
9374
  }
9350
- this.beforeQuickPopupOpen(target);
9375
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(e));
9351
9376
  };
9352
9377
  QuickPopups.prototype.isCellBlocked = function (args) {
9353
9378
  var tempObj = {};
@@ -9434,7 +9459,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9434
9459
  this.quickPopup.content = quickCellPopup;
9435
9460
  this.quickPopup.relateTo = target;
9436
9461
  this.quickPopup.dataBind();
9437
- this.beforeQuickPopupOpen(target);
9462
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(args.event));
9438
9463
  };
9439
9464
  QuickPopups.prototype.isSameEventClick = function (events) {
9440
9465
  var isSameTarget = this.quickPopup.relateTo === closest(events.element, '.' + APPOINTMENT_CLASS);
@@ -9511,7 +9536,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9511
9536
  this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
9512
9537
  closest(events.element, '.' + APPOINTMENT_CLASS);
9513
9538
  this.quickPopup.dataBind();
9514
- this.beforeQuickPopupOpen(events.element);
9539
+ this.beforeQuickPopupOpen(events.element, this.parent.eventBase.getPageCoordinates(events.originalEvent));
9515
9540
  }
9516
9541
  };
9517
9542
  QuickPopups.prototype.getPopupHeader = function (headerType, headerData) {
@@ -9792,15 +9817,16 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9792
9817
  this.morePopup.relateTo = closest(target, '.' + WORK_CELLS_CLASS);
9793
9818
  }
9794
9819
  }
9795
- this.parent.renderTemplates();
9796
- var eventProp = {
9797
- type: 'EventContainer', cancel: false,
9798
- element: this.morePopup.element, data: data
9799
- };
9800
- this.parent.trigger(popupOpen, eventProp, function (popupArgs) {
9801
- if (!popupArgs.cancel) {
9802
- _this.morePopup.show();
9803
- }
9820
+ this.parent.renderTemplates(function () {
9821
+ var eventProp = {
9822
+ type: 'EventContainer', cancel: false,
9823
+ element: _this.morePopup.element, data: data
9824
+ };
9825
+ _this.parent.trigger(popupOpen, eventProp, function (popupArgs) {
9826
+ if (!popupArgs.cancel) {
9827
+ _this.morePopup.show();
9828
+ }
9829
+ });
9804
9830
  });
9805
9831
  };
9806
9832
  QuickPopups.prototype.saveClick = function (event) {
@@ -9991,71 +10017,103 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9991
10017
  }
9992
10018
  });
9993
10019
  };
9994
- QuickPopups.prototype.beforeQuickPopupOpen = function (target) {
10020
+ QuickPopups.prototype.beforeQuickPopupOpen = function (target, originalEvent) {
9995
10021
  var _this = this;
9996
- this.parent.renderTemplates();
9997
- var isEventPopup = this.quickPopup.element.querySelector('.' + EVENT_POPUP_CLASS);
9998
- var popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
9999
- var eventProp = {
10000
- type: popupType, cancel: false, data: extend({}, this.getDataFromTarget(target), null, true),
10001
- target: target, element: this.quickPopup.element
10002
- };
10003
- this.parent.trigger(popupOpen, eventProp, function (popupArgs) {
10004
- if (popupArgs.cancel) {
10005
- _this.quickPopupHide();
10006
- _this.destroyPopupButtons('quickPopup');
10007
- if (popupArgs.element.classList.contains(POPUP_OPEN)) {
10008
- _this.quickPopupClose();
10009
- }
10010
- removeChildren(_this.quickPopup.element);
10011
- _this.isMultipleEventSelect = false;
10012
- }
10013
- else {
10014
- var display = _this.quickPopup.element.style.display;
10015
- _this.quickPopup.element.style.display = 'block';
10016
- if (_this.parent.isAdaptive) {
10017
- _this.quickPopup.element.removeAttribute('style');
10018
- _this.quickPopup.element.style.display = 'block';
10019
- _this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
10022
+ this.parent.renderTemplates(function () {
10023
+ var isEventPopup = _this.quickPopup.element.querySelector('.' + EVENT_POPUP_CLASS);
10024
+ var popupType = _this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
10025
+ var eventProp = {
10026
+ type: popupType, cancel: false, data: extend({}, _this.getDataFromTarget(target), null, true),
10027
+ target: target, element: _this.quickPopup.element
10028
+ };
10029
+ _this.parent.trigger(popupOpen, eventProp, function (popupArgs) {
10030
+ if (popupArgs.cancel) {
10031
+ _this.quickPopupHide();
10032
+ _this.destroyPopupButtons('quickPopup');
10033
+ if (popupArgs.element.classList.contains(POPUP_OPEN)) {
10034
+ _this.quickPopupClose();
10035
+ }
10036
+ removeChildren(_this.quickPopup.element);
10037
+ _this.isMultipleEventSelect = false;
10020
10038
  }
10021
10039
  else {
10022
- var isVirtualScroll = _this.parent.virtualScrollModule && _this.parent.virtualScrollModule.isHorizontalScroll
10023
- && !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
10024
- var conTable = _this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
10025
- _this.quickPopup.offsetX = isVirtualScroll && !_this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
10026
- _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
10027
- _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: _this.parent.enableRtl ? 'bottom' : 'top' };
10028
- _this.quickPopup.dataBind();
10029
- _this.quickPopup.refreshPosition(null, true);
10030
- var collide = isCollide(_this.quickPopup.element, _this.parent.element);
10031
- if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {
10032
- _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;
10033
- if (isVirtualScroll && !_this.parent.enableRtl) {
10034
- _this.quickPopup.offsetX = getTranslateX(conTable) + _this.quickPopup.offsetX;
10035
- }
10040
+ var display = _this.quickPopup.element.style.display;
10041
+ _this.quickPopup.element.style.display = 'block';
10042
+ if (_this.parent.isAdaptive) {
10043
+ _this.quickPopup.element.removeAttribute('style');
10044
+ _this.quickPopup.element.style.display = 'block';
10045
+ _this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
10046
+ }
10047
+ else {
10048
+ var isVirtualScroll = _this.parent.virtualScrollModule && _this.parent.virtualScrollModule.isHorizontalScroll
10049
+ && !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
10050
+ var conTable = _this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
10051
+ _this.quickPopup.offsetX = isVirtualScroll && !_this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
10052
+ _this.quickPopup.offsetY = _this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll ?
10053
+ _this.quickPopup.offsetY : 0;
10054
+ _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
10055
+ _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: _this.parent.enableRtl ? 'bottom' : 'top' };
10036
10056
  _this.quickPopup.dataBind();
10037
10057
  _this.quickPopup.refreshPosition(null, true);
10038
- var leftCollide = isCollide(_this.quickPopup.element, _this.parent.element);
10039
- if (leftCollide.indexOf('left') > -1) {
10040
- _this.quickPopup.position = { X: 'center', Y: 'center' };
10041
- _this.quickPopup.collision = { X: 'fit', Y: 'fit' };
10042
- _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);
10058
+ var collide = isCollide(_this.quickPopup.element, _this.parent.element);
10059
+ if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {
10060
+ _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;
10061
+ if (isVirtualScroll && !_this.parent.enableRtl) {
10062
+ _this.quickPopup.offsetX = getTranslateX(conTable) + _this.quickPopup.offsetX;
10063
+ }
10043
10064
  _this.quickPopup.dataBind();
10065
+ _this.quickPopup.refreshPosition(null, true);
10066
+ var leftCollide = isCollide(_this.quickPopup.element, _this.parent.element);
10067
+ if (leftCollide.indexOf('left') > -1) {
10068
+ _this.quickPopup.position = { X: 'center', Y: 'center' };
10069
+ _this.quickPopup.collision = { X: 'fit', Y: 'fit' };
10070
+ _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);
10071
+ _this.quickPopup.dataBind();
10072
+ }
10073
+ }
10074
+ if (_this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
10075
+ var translateY = getTranslateY(conTable);
10076
+ _this.quickPopup.offsetY = translateY;
10077
+ _this.quickPopup.dataBind();
10078
+ _this.quickPopup.refreshPosition(null, true);
10079
+ }
10080
+ if (_this.quickPopup.position.X === 'center' && _this.quickPopup.position.Y === 'center' && !isNullOrUndefined(originalEvent) &&
10081
+ originalEvent.clientX && originalEvent.clientY) {
10082
+ var clientX = originalEvent.clientX;
10083
+ var clientY = originalEvent.clientY;
10084
+ var targetRect = target.getBoundingClientRect();
10085
+ var offsetY = originalEvent.offsetY || Math.ceil(clientY - targetRect.y);
10086
+ var previousOffset = _this.quickPopup.offsetY;
10087
+ var collision = isCollide(_this.quickPopup.element, target);
10088
+ var popupRect = _this.quickPopup.element.getBoundingClientRect();
10089
+ var targetEle = document.elementFromPoint(clientX, clientY);
10090
+ if (collision.indexOf('top') > -1 || collision.indexOf('bottom') > -1 || closest(targetEle, '.' + POPUP_WRAPPER_CLASS)) {
10091
+ if (popupRect.top <= clientY &&
10092
+ clientY <= popupRect.top + popupRect.height) {
10093
+ _this.quickPopup.offsetY = previousOffset - popupRect.height - 10;
10094
+ _this.quickPopup.dataBind();
10095
+ collision = isCollide(_this.quickPopup.element, _this.parent.element);
10096
+ if (collision.indexOf('top') > -1) {
10097
+ _this.quickPopup.offsetY = previousOffset + offsetY + 10;
10098
+ _this.quickPopup.dataBind();
10099
+ }
10100
+ }
10101
+ else if (isCollide(_this.quickPopup.element, _this.parent.element).indexOf('bottom') > -1) {
10102
+ _this.quickPopup.offsetY =
10103
+ previousOffset - offsetY - Math.ceil(popupRect.height) - 10;
10104
+ _this.quickPopup.dataBind();
10105
+ }
10106
+ }
10044
10107
  }
10045
10108
  }
10046
- if (_this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
10047
- var translateY = getTranslateY(conTable);
10048
- _this.quickPopup.offsetY = translateY;
10049
- _this.quickPopup.dataBind();
10109
+ if (isEventPopup) {
10110
+ _this.applyEventColor();
10050
10111
  }
10112
+ _this.quickPopup.element.style.display = display;
10113
+ _this.quickPopup.dataBind();
10114
+ _this.quickPopup.show();
10051
10115
  }
10052
- if (isEventPopup) {
10053
- _this.applyEventColor();
10054
- }
10055
- _this.quickPopup.element.style.display = display;
10056
- _this.quickPopup.dataBind();
10057
- _this.quickPopup.show();
10058
- }
10116
+ });
10059
10117
  });
10060
10118
  };
10061
10119
  QuickPopups.prototype.applyEventColor = function () {
@@ -11831,6 +11889,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11831
11889
  return container;
11832
11890
  };
11833
11891
  EventWindow.prototype.renderFormElements = function (form, args) {
11892
+ var _this = this;
11834
11893
  if (!isNullOrUndefined(this.parent.editorTemplate)) {
11835
11894
  if (args) {
11836
11895
  if (this.recurrenceEditor) {
@@ -11847,8 +11906,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11847
11906
  var templateId = this.parent.element.id + '_editorTemplate';
11848
11907
  var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
11849
11908
  append(tempEle, form);
11850
- this.parent.renderTemplates();
11851
- this.applyFormValidation();
11909
+ this.parent.renderTemplates(function () {
11910
+ _this.applyFormValidation();
11911
+ });
11852
11912
  }
11853
11913
  else {
11854
11914
  form.appendChild(this.getDefaultEventWindowContent());
@@ -12794,7 +12854,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12794
12854
  }
12795
12855
  }
12796
12856
  if (this.recurrenceEditor && this.recurrenceEditor.value && this.recurrenceEditor.value !== '') {
12797
- alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
12857
+ if (this.parent.currentAction !== 'EditOccurrence') {
12858
+ alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
12859
+ }
12798
12860
  var isShowAlert = true;
12799
12861
  if (alertType === 'seriesChangeAlert' && this.parent.uiStateValues.isIgnoreOccurrence) {
12800
12862
  isShowAlert = false;
@@ -13027,53 +13089,58 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13027
13089
  if (isNullOrUndefined(index)) {
13028
13090
  return false;
13029
13091
  }
13092
+ var currentStartTime = new Date(+currentData[this.fields.startTime]);
13093
+ var currentEndTime = new Date(+currentData[this.fields.endTime]);
13094
+ if (index !== recurColl.length - 1) {
13095
+ var nextStartTime = new Date(+recurColl[index + 1][this.fields.startTime]);
13096
+ var nextEndTime = new Date(+recurColl[index + 1][this.fields.endTime]);
13097
+ }
13098
+ var lastEndTime = new Date(+recurColl[recurColl.length - 1][this.fields.endTime]);
13030
13099
  if (index === 0) {
13031
13100
  if (!isNullOrUndefined(recurColl[index + 1])) {
13032
- if (!(resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
13033
- resetTime(new Date(+currentData[this.fields.endTime])).getTime()) &&
13034
- (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() >=
13035
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())) {
13036
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13101
+ if (!(nextStartTime.getTime() >= currentEndTime.getTime()) &&
13102
+ (resetTime(lastEndTime).getTime() >=
13103
+ resetTime(currentStartTime).getTime()) ||
13104
+ resetTime(lastEndTime).getTime() < resetTime(currentStartTime).getTime()) {
13105
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
13037
13106
  return true;
13038
13107
  }
13039
- else if (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
13040
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
13041
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
13108
+ else if (!(resetTime(currentStartTime).getTime() <
13109
+ resetTime(nextStartTime).getTime())) {
13110
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13042
13111
  return true;
13043
13112
  }
13044
13113
  }
13045
13114
  return false;
13046
13115
  }
13047
13116
  else {
13117
+ var previousStartTime = new Date(+recurColl[index - 1][this.fields.startTime]);
13118
+ var previousEndTime = new Date(+recurColl[index - 1][this.fields.endTime]);
13048
13119
  if (index === recurColl.length - 1) {
13049
- if (!(resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
13050
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) &&
13051
- (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() <=
13052
- resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
13053
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13120
+ if (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() >
13121
+ resetTime(currentStartTime).getTime()) {
13122
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
13054
13123
  return true;
13055
13124
  }
13056
- else if (resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.endTime])).getTime() >
13057
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
13058
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
13125
+ else if (!((previousEndTime.getTime() <= currentStartTime.getTime()) &&
13126
+ (resetTime(currentStartTime).getTime() > resetTime(previousStartTime).getTime()))) {
13127
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13059
13128
  return true;
13060
13129
  }
13061
13130
  }
13062
- else if (!(((resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
13063
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
13064
- (resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
13065
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())) &&
13066
- ((resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
13067
- resetTime(new Date(+currentData[this.fields.endTime])).getTime()) ||
13068
- (resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
13069
- resetTime(new Date(+currentData[this.fields.startTime])).getTime())))) {
13131
+ else if (!(((resetTime(previousStartTime).getTime() < resetTime(currentStartTime).getTime()) ||
13132
+ resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
13133
+ resetTime(currentStartTime).getTime()) &&
13134
+ ((resetTime(nextStartTime).getTime() > resetTime(currentStartTime).getTime()) ||
13135
+ (lastEndTime.getTime() < currentStartTime.getTime())))) {
13070
13136
  this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
13071
13137
  return true;
13072
13138
  }
13073
- else if ((resetTime(new Date(+recurColl[index + 1][this.fields.endTime])).getTime() <
13074
- resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
13075
- (resetTime(new Date(+recurColl[index - 1][this.fields.startTime])).getTime() >
13076
- resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
13139
+ else if (!(previousEndTime.getTime() <= currentStartTime.getTime() && nextStartTime.getTime() >
13140
+ currentEndTime.getTime()) || (resetTime(nextEndTime).getTime() <
13141
+ resetTime(currentStartTime).getTime()) ||
13142
+ (resetTime(previousStartTime).getTime() > resetTime(currentEndTime).getTime()) ||
13143
+ !(resetTime(currentStartTime).getTime() < resetTime(nextStartTime).getTime())) {
13077
13144
  this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
13078
13145
  return true;
13079
13146
  }
@@ -16511,12 +16578,16 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16511
16578
  /**
16512
16579
  * Method to render react templates
16513
16580
  *
16581
+ * @param {Function} callBack - specifies the callBack method
16514
16582
  * @returns {void}
16515
16583
  * @private
16516
16584
  */
16517
- Schedule.prototype.renderTemplates = function () {
16585
+ Schedule.prototype.renderTemplates = function (callback) {
16518
16586
  if (this.isReact) {
16519
- this.renderReactTemplates();
16587
+ this.renderReactTemplates(callback);
16588
+ }
16589
+ else if (callback) {
16590
+ callback();
16520
16591
  }
16521
16592
  };
16522
16593
  /**
@@ -19378,11 +19449,6 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19378
19449
  };
19379
19450
  return viewDimension;
19380
19451
  };
19381
- ActionBase.prototype.getPageCoordinates = function (e) {
19382
- var eventArgs = e.event;
19383
- return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
19384
- eventArgs || e;
19385
- };
19386
19452
  ActionBase.prototype.getIndex = function (index) {
19387
19453
  var contentElements = [].slice.call(this.parent.getContentTable().querySelector('tr').children);
19388
19454
  var indexes = { minIndex: 0, maxIndex: contentElements.length - 1 };
@@ -19519,7 +19585,7 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19519
19585
  }
19520
19586
  };
19521
19587
  ActionBase.prototype.getCursorElement = function (e) {
19522
- var pages = this.getPageCoordinates(e);
19588
+ var pages = this.parent.eventBase.getPageCoordinates(e);
19523
19589
  return document.elementFromPoint(pages.clientX, pages.clientY);
19524
19590
  };
19525
19591
  ActionBase.prototype.autoScroll = function () {
@@ -19820,7 +19886,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
19820
19886
  _this.actionObj.cellWidth = trRect.width / noOfDays;
19821
19887
  _this.actionObj.cellHeight = trRect.height;
19822
19888
  }
19823
- var pages = _this.getPageCoordinates(e);
19889
+ var pages = _this.parent.eventBase.getPageCoordinates(e);
19824
19890
  _this.actionObj.X = pages.pageX;
19825
19891
  _this.actionObj.Y = pages.pageY;
19826
19892
  _this.actionObj.groupIndex = parseInt(_this.actionObj.element.getAttribute('data-group-index') || '0', 10);
@@ -19849,7 +19915,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
19849
19915
  if ((!isNullOrUndefined(e.target)) && e.target.classList.contains(DISABLE_DATES)) {
19850
19916
  return;
19851
19917
  }
19852
- var pages = this.getPageCoordinates(e);
19918
+ var pages = this.parent.eventBase.getPageCoordinates(e);
19853
19919
  if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
19854
19920
  var doc = document.documentElement;
19855
19921
  var left = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
@@ -20282,7 +20348,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
20282
20348
  return styles;
20283
20349
  };
20284
20350
  Resize.prototype.resizeValidation = function (e) {
20285
- var pages = this.getPageCoordinates(e);
20351
+ var pages = this.parent.eventBase.getPageCoordinates(e);
20286
20352
  var viewDimension = this.getContentAreaDimension();
20287
20353
  var isTimeScale = this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.timeScale.enable;
20288
20354
  var cellWidth = this.actionObj.cellWidth;
@@ -21130,7 +21196,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
21130
21196
  return;
21131
21197
  }
21132
21198
  var eventObj = extend({}, this.actionObj.event, null, true);
21133
- var eventArgs = this.getPageCoordinates(e);
21199
+ var eventArgs = this.parent.eventBase.getPageCoordinates(e);
21134
21200
  this.actionObj.Y = this.actionObj.pageY = eventArgs.pageY;
21135
21201
  this.actionObj.X = this.actionObj.pageX = eventArgs.pageX;
21136
21202
  this.actionObj.target = e.target;
@@ -21273,7 +21339,8 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
21273
21339
  this.timelineEventModule.dateRender = this.parent.activeView.renderDates;
21274
21340
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
21275
21341
  this.timelineEventModule.getSlotDates();
21276
- this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth : this.actionObj.cellWidth;
21342
+ this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
21343
+ this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect().width;
21277
21344
  this.calculateTimelineTime(e);
21278
21345
  }
21279
21346
  else {
@@ -22026,7 +22093,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22026
22093
  return 0;
22027
22094
  };
22028
22095
  DragAndDrop.prototype.getColumnIndex = function (offsetLeft) {
22029
- var index = Math.floor(offsetLeft / this.actionObj.cellWidth);
22096
+ var index = Math.floor(offsetLeft / Math.trunc(this.actionObj.cellWidth));
22030
22097
  if (this.isHeaderRows) {
22031
22098
  return index;
22032
22099
  }