@syncfusion/ej2-schedule 19.2.60 → 19.3.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 (125) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.md +65 -0
  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 +445 -164
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +456 -172
  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.js +1 -1
  14. package/src/schedule/actions/crud.js +3 -2
  15. package/src/schedule/actions/drag.d.ts +2 -0
  16. package/src/schedule/actions/drag.js +27 -17
  17. package/src/schedule/actions/keyboard.js +5 -5
  18. package/src/schedule/actions/resize.js +17 -10
  19. package/src/schedule/actions/virtual-scroll.js +2 -1
  20. package/src/schedule/base/interface.d.ts +9 -0
  21. package/src/schedule/base/resource.js +12 -3
  22. package/src/schedule/base/schedule-model.d.ts +13 -1
  23. package/src/schedule/base/schedule.d.ts +45 -2
  24. package/src/schedule/base/schedule.js +139 -14
  25. package/src/schedule/base/type.d.ts +4 -0
  26. package/src/schedule/event-renderer/event-base.d.ts +2 -1
  27. package/src/schedule/event-renderer/event-base.js +42 -28
  28. package/src/schedule/event-renderer/month.d.ts +0 -1
  29. package/src/schedule/event-renderer/month.js +32 -33
  30. package/src/schedule/event-renderer/timeline-view.d.ts +2 -0
  31. package/src/schedule/event-renderer/timeline-view.js +31 -1
  32. package/src/schedule/event-renderer/vertical-view.js +26 -19
  33. package/src/schedule/event-renderer/year.js +4 -1
  34. package/src/schedule/models/event-settings-model.d.ts +21 -1
  35. package/src/schedule/models/event-settings.d.ts +20 -0
  36. package/src/schedule/models/event-settings.js +6 -0
  37. package/src/schedule/models/views-model.d.ts +9 -0
  38. package/src/schedule/models/views.d.ts +8 -0
  39. package/src/schedule/models/views.js +3 -0
  40. package/src/schedule/popups/event-window.d.ts +3 -2
  41. package/src/schedule/popups/event-window.js +7 -3
  42. package/src/schedule/popups/form-validator.js +4 -1
  43. package/src/schedule/popups/quick-popups.d.ts +3 -2
  44. package/src/schedule/popups/quick-popups.js +32 -13
  45. package/src/schedule/renderer/agenda.d.ts +1 -0
  46. package/src/schedule/renderer/agenda.js +20 -3
  47. package/src/schedule/renderer/header-renderer.d.ts +1 -0
  48. package/src/schedule/renderer/header-renderer.js +6 -1
  49. package/src/schedule/renderer/month.d.ts +1 -0
  50. package/src/schedule/renderer/month.js +7 -7
  51. package/src/schedule/renderer/timeline-year.js +8 -2
  52. package/src/schedule/renderer/vertical-view.d.ts +2 -0
  53. package/src/schedule/renderer/vertical-view.js +19 -8
  54. package/src/schedule/renderer/view-base.d.ts +2 -1
  55. package/src/schedule/renderer/view-base.js +11 -3
  56. package/styles/bootstrap-dark.css +48 -66
  57. package/styles/bootstrap.css +28 -45
  58. package/styles/bootstrap4.css +28 -44
  59. package/styles/bootstrap5-dark.css +5172 -0
  60. package/styles/bootstrap5-dark.scss +2 -0
  61. package/styles/bootstrap5.css +5173 -0
  62. package/styles/bootstrap5.scss +2 -0
  63. package/styles/fabric-dark.css +29 -61
  64. package/styles/fabric.css +28 -45
  65. package/styles/highcontrast-light.css +28 -76
  66. package/styles/highcontrast.css +30 -49
  67. package/styles/material-dark.css +72 -79
  68. package/styles/material.css +32 -45
  69. package/styles/recurrence-editor/_bootstrap5-dark-definition.scss +1 -0
  70. package/styles/recurrence-editor/_bootstrap5-definition.scss +8 -0
  71. package/styles/recurrence-editor/_layout.scss +0 -4
  72. package/styles/recurrence-editor/_tailwind-dark-definition.scss +1 -8
  73. package/styles/recurrence-editor/_tailwind-definition.scss +8 -8
  74. package/styles/recurrence-editor/bootstrap-dark.css +0 -4
  75. package/styles/recurrence-editor/bootstrap.css +0 -4
  76. package/styles/recurrence-editor/bootstrap4.css +0 -4
  77. package/styles/recurrence-editor/bootstrap5-dark.css +479 -0
  78. package/styles/recurrence-editor/bootstrap5-dark.scss +3 -0
  79. package/styles/recurrence-editor/bootstrap5.css +479 -0
  80. package/styles/recurrence-editor/bootstrap5.scss +3 -0
  81. package/styles/recurrence-editor/fabric-dark.css +0 -4
  82. package/styles/recurrence-editor/fabric.css +0 -4
  83. package/styles/recurrence-editor/highcontrast-light.css +0 -4
  84. package/styles/recurrence-editor/highcontrast.css +0 -4
  85. package/styles/recurrence-editor/material-dark.css +0 -4
  86. package/styles/recurrence-editor/material.css +0 -4
  87. package/styles/recurrence-editor/tailwind-dark.css +0 -4
  88. package/styles/recurrence-editor/tailwind.css +0 -4
  89. package/styles/schedule/_bootstrap-dark-definition.scss +6 -6
  90. package/styles/schedule/_bootstrap-definition.scss +2 -2
  91. package/styles/schedule/_bootstrap4-definition.scss +6 -5
  92. package/styles/schedule/_bootstrap5-dark-definition.scss +1 -0
  93. package/styles/schedule/_bootstrap5-definition.scss +198 -0
  94. package/styles/schedule/_fabric-dark-definition.scss +3 -3
  95. package/styles/schedule/_fabric-definition.scss +2 -2
  96. package/styles/schedule/_highcontrast-definition.scss +3 -3
  97. package/styles/schedule/_highcontrast-light-definition.scss +2 -2
  98. package/styles/schedule/_layout.scss +97 -120
  99. package/styles/schedule/_material-dark-definition.scss +2 -2
  100. package/styles/schedule/_material-definition.scss +2 -2
  101. package/styles/schedule/_tailwind-dark-definition.scss +1 -196
  102. package/styles/schedule/_tailwind-definition.scss +195 -196
  103. package/styles/schedule/_theme.scss +33 -7
  104. package/styles/schedule/bootstrap-dark.css +48 -62
  105. package/styles/schedule/bootstrap.css +28 -41
  106. package/styles/schedule/bootstrap4.css +28 -40
  107. package/styles/schedule/bootstrap5-dark.css +4692 -0
  108. package/styles/schedule/bootstrap5-dark.scss +4 -0
  109. package/styles/schedule/bootstrap5.css +4693 -0
  110. package/styles/schedule/bootstrap5.scss +5 -0
  111. package/styles/schedule/fabric-dark.css +29 -57
  112. package/styles/schedule/fabric.css +28 -41
  113. package/styles/schedule/highcontrast-light.css +28 -72
  114. package/styles/schedule/highcontrast.css +30 -45
  115. package/styles/schedule/icons/_bootstrap5-dark.scss +1 -0
  116. package/styles/schedule/icons/_bootstrap5.scss +232 -0
  117. package/styles/schedule/icons/_tailwind-dark.scss +1 -231
  118. package/styles/schedule/icons/_tailwind.scss +231 -231
  119. package/styles/schedule/material-dark.css +72 -75
  120. package/styles/schedule/material.css +32 -41
  121. package/styles/schedule/tailwind-dark.css +53 -71
  122. package/styles/schedule/tailwind-dark.scss +0 -1
  123. package/styles/schedule/tailwind.css +53 -70
  124. package/styles/tailwind-dark.css +53 -75
  125. package/styles/tailwind.css +53 -74
@@ -1073,6 +1073,11 @@ class HeaderRenderer {
1073
1073
  if (selEle) {
1074
1074
  selEle.setAttribute('aria-label', text);
1075
1075
  selEle.querySelector('.e-tbar-btn-text').innerHTML = text;
1076
+ this.refresh();
1077
+ }
1078
+ }
1079
+ refresh() {
1080
+ if (this.toolbarObj) {
1076
1081
  this.toolbarObj.refreshOverflow();
1077
1082
  }
1078
1083
  }
@@ -1327,7 +1332,7 @@ class HeaderRenderer {
1327
1332
  this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
1328
1333
  break;
1329
1334
  case 'e-today':
1330
- if (!this.parent.isSelectedDate(resetTime(this.parent.getCurrentTime()))) {
1335
+ if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(resetTime(this.parent.getCurrentTime()))) {
1331
1336
  this.parent.changeDate(resetTime(this.parent.getCurrentTime()), args.originalEvent);
1332
1337
  }
1333
1338
  break;
@@ -1869,7 +1874,7 @@ class KeyboardInteraction {
1869
1874
  this.processCtrlShiftNavigationArrows(e);
1870
1875
  break;
1871
1876
  case 'escape':
1872
- this.processEscape();
1877
+ this.processEscape(e);
1873
1878
  }
1874
1879
  }
1875
1880
  addEventListener() {
@@ -2013,7 +2018,7 @@ class KeyboardInteraction {
2013
2018
  if (target.classList.contains(MORE_EVENT_HEADER_DATE_CLASS)) {
2014
2019
  this.parent.setProperties({ selectedDate: this.parent.getDateFromElement(target) }, true);
2015
2020
  this.parent.changeView(this.parent.getNavigateView(), e);
2016
- this.processEscape();
2021
+ this.processEscape(e);
2017
2022
  return;
2018
2023
  }
2019
2024
  }
@@ -2587,7 +2592,7 @@ class KeyboardInteraction {
2587
2592
  !this.parent.eventSettings.allowDeleting) {
2588
2593
  return;
2589
2594
  }
2590
- this.parent.quickPopup.deleteClick();
2595
+ this.parent.quickPopup.deleteClick(e);
2591
2596
  }
2592
2597
  }
2593
2598
  processCtrlShiftNavigationArrows(e) {
@@ -2622,8 +2627,8 @@ class KeyboardInteraction {
2622
2627
  }
2623
2628
  }
2624
2629
  }
2625
- processEscape() {
2626
- this.parent.quickPopup.onClosePopup();
2630
+ processEscape(event) {
2631
+ this.parent.quickPopup.onClosePopup(event);
2627
2632
  this.parent.quickPopup.morePopup.hide();
2628
2633
  if (this.parent.headerModule) {
2629
2634
  this.parent.headerModule.hideHeaderPopup();
@@ -4922,12 +4927,7 @@ class EventBase {
4922
4927
  if (generateID) {
4923
4928
  event[fields.id] = temp++;
4924
4929
  }
4925
- if (typeof event[fields.startTime] === 'string') {
4926
- event[fields.startTime] = getDateFromString(event[fields.startTime]);
4927
- }
4928
- if (typeof event[fields.endTime] === 'string') {
4929
- event[fields.endTime] = getDateFromString(event[fields.endTime]);
4930
- }
4930
+ event = this.updateEventDateTime(event);
4931
4931
  if (timeZonePropChanged) {
4932
4932
  this.processTimezoneChange(event, oldTimezone);
4933
4933
  }
@@ -4986,6 +4986,15 @@ class EventBase {
4986
4986
  this.parent.blockProcessed = blockData;
4987
4987
  return eventData;
4988
4988
  }
4989
+ updateEventDateTime(eventData) {
4990
+ if (typeof eventData[this.parent.eventFields.startTime] === 'string') {
4991
+ eventData[this.parent.eventFields.startTime] = getDateFromString(eventData[this.parent.eventFields.startTime]);
4992
+ }
4993
+ if (typeof eventData[this.parent.eventFields.endTime] === 'string') {
4994
+ eventData[this.parent.eventFields.endTime] = getDateFromString(eventData[this.parent.eventFields.endTime]);
4995
+ }
4996
+ return eventData;
4997
+ }
4989
4998
  getProcessedEvents(eventCollection = this.parent.eventsData) {
4990
4999
  let processed = [];
4991
5000
  for (const event of eventCollection) {
@@ -5080,7 +5089,7 @@ class EventBase {
5080
5089
  const data = this.getGroupIndexFromEvent(eventObj);
5081
5090
  resourceData = this.parent.resourceBase.lastResourceLevel[data];
5082
5091
  }
5083
- let blockEvents = extend([], this.parent.blockProcessed, null, true);
5092
+ const blockEvents = extend([], this.parent.blockProcessed, null, true);
5084
5093
  for (const eventObj of blockEvents) {
5085
5094
  if (eventObj[fields.isAllDay]) {
5086
5095
  const isDifferentTime = eventObj[fields.endTime].getTime() >
@@ -5139,26 +5148,36 @@ class EventBase {
5139
5148
  }));
5140
5149
  return filteredCollection;
5141
5150
  }
5142
- sortByTime(appointments) {
5143
- const fieldMapping = this.parent.eventFields;
5144
- appointments.sort((a, b) => {
5145
- const d1 = a[fieldMapping.startTime];
5146
- const d2 = b[fieldMapping.startTime];
5147
- return d1.getTime() - d2.getTime();
5148
- });
5149
- return appointments;
5151
+ sortByTime(appointmentsCollection) {
5152
+ if (this.parent.eventSettings.sortComparer) {
5153
+ appointmentsCollection = this.parent.eventSettings.sortComparer.call(this.parent, appointmentsCollection);
5154
+ }
5155
+ else {
5156
+ const fieldMappings = this.parent.eventFields;
5157
+ appointmentsCollection.sort((a, b) => {
5158
+ const d1 = a[fieldMappings.startTime];
5159
+ const d2 = b[fieldMappings.startTime];
5160
+ return d1.getTime() - d2.getTime();
5161
+ });
5162
+ }
5163
+ return appointmentsCollection;
5150
5164
  }
5151
5165
  sortByDateTime(appointments) {
5152
- const fieldMapping = this.parent.eventFields;
5153
- appointments.sort((object1, object2) => {
5154
- const d3 = object1[fieldMapping.startTime];
5155
- const d4 = object2[fieldMapping.startTime];
5156
- const d5 = object1[fieldMapping.endTime];
5157
- const d6 = object2[fieldMapping.endTime];
5158
- const d1 = d5.getTime() - d3.getTime();
5159
- const d2 = d6.getTime() - d4.getTime();
5160
- return (d3.getTime() - d4.getTime() || d2 - d1);
5161
- });
5166
+ if (this.parent.eventSettings.sortComparer) {
5167
+ appointments = this.parent.eventSettings.sortComparer.call(this.parent, appointments);
5168
+ }
5169
+ else {
5170
+ const fieldMapping = this.parent.eventFields;
5171
+ appointments.sort((object1, object2) => {
5172
+ const d3 = object1[fieldMapping.startTime];
5173
+ const d4 = object2[fieldMapping.startTime];
5174
+ const d5 = object1[fieldMapping.endTime];
5175
+ const d6 = object2[fieldMapping.endTime];
5176
+ const d1 = d5.getTime() - d3.getTime();
5177
+ const d2 = d6.getTime() - d4.getTime();
5178
+ return (d3.getTime() - d4.getTime() || d2 - d1);
5179
+ });
5180
+ }
5162
5181
  return appointments;
5163
5182
  }
5164
5183
  getSmallestMissingNumber(array) {
@@ -5211,10 +5230,10 @@ class EventBase {
5211
5230
  }
5212
5231
  splitEvent(event, dateRender) {
5213
5232
  const fields = this.parent.eventFields;
5214
- let start = resetTime(new Date(event[fields.startTime] + '')).getTime();
5215
- let end = resetTime(new Date(event[fields.endTime] + '')).getTime();
5233
+ let start = resetTime(event[fields.startTime]).getTime();
5234
+ let end = resetTime(event[fields.endTime]).getTime();
5216
5235
  if (getDateInMs(event[fields.endTime]) <= 0) {
5217
- const temp = addDays(resetTime(new Date(event[fields.endTime] + '')), -1).getTime();
5236
+ const temp = addDays(resetTime(event[fields.endTime]), -1).getTime();
5218
5237
  end = start > temp ? start : temp;
5219
5238
  }
5220
5239
  const orgStart = start;
@@ -5475,7 +5494,7 @@ class EventBase {
5475
5494
  const isAllDay = event[fieldMapping.isAllDay];
5476
5495
  const isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
5477
5496
  / MS_PER_DAY) >= 1;
5478
- return (isAllDay || isFullDay) ? true : false;
5497
+ return (isAllDay || (!(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') && isFullDay)) ? true : false;
5479
5498
  }
5480
5499
  addEventListener() {
5481
5500
  this.parent.on(documentClick, this.appointmentBorderRemove, this);
@@ -6054,6 +6073,12 @@ class VerticalEvent extends EventBase {
6054
6073
  this.addEventListener();
6055
6074
  }
6056
6075
  renderAppointments() {
6076
+ if (isNullOrUndefined(this.parent)) {
6077
+ return;
6078
+ }
6079
+ if (this.parent.dragAndDropModule) {
6080
+ this.parent.dragAndDropModule.setDragArea();
6081
+ }
6057
6082
  const wrapperElements = [].slice.call(this.parent.element.querySelectorAll('.' + BLOCK_APPOINTMENT_CLASS +
6058
6083
  ',.' + APPOINTMENT_CLASS + ',.' + ROW_COUNT_WRAPPER_CLASS));
6059
6084
  const isDragging = (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) ? true : false;
@@ -6560,10 +6585,10 @@ class VerticalEvent extends EventBase {
6560
6585
  const index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
6561
6586
  this.appendEvent(eventObj, appointmentElement, index, tempData.appLeft);
6562
6587
  this.wireAppointmentEvents(appointmentElement, eventObj);
6563
- if (appointmentElement.offsetHeight < this.cellHeight) {
6588
+ if (appHeight < this.cellHeight) {
6564
6589
  const resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + EVENT_RESIZE_CLASS));
6565
6590
  resizeHandlers.forEach((resizeHandler) => {
6566
- resizeHandler.style.height = Math.ceil(appointmentElement.offsetHeight / resizeHandler.offsetHeight) + 'px';
6591
+ resizeHandler.style.height = Math.ceil(appHeight / resizeHandler.offsetHeight) + 'px';
6567
6592
  });
6568
6593
  }
6569
6594
  }
@@ -6646,11 +6671,12 @@ class VerticalEvent extends EventBase {
6646
6671
  eventsList = eventsList.filter((obj) => (obj[fieldMapping.startTime] === record[fieldMapping.startTime] &&
6647
6672
  obj[fieldMapping.endTime] > record[fieldMapping.endTime] || obj[fieldMapping.endTime] > record[fieldMapping.startTime] &&
6648
6673
  obj[fieldMapping.startTime] < record[fieldMapping.endTime] || obj[fieldMapping.endTime] === record[fieldMapping.startTime]
6649
- && obj[fieldMapping.startTime] === record[fieldMapping.endTime]) || ((obj[fieldMapping.startTime].getTime() ===
6650
- record[fieldMapping.startTime].getTime() && obj[fieldMapping.endTime].getTime() === record[fieldMapping.endTime].getTime())
6651
- || (obj[fieldMapping.startTime].getTime() === record[fieldMapping.startTime].getTime() &&
6652
- obj[fieldMapping.endTime].getTime() < record[fieldMapping.endTime].getTime() ||
6653
- obj[fieldMapping.endTime].getTime() > record[fieldMapping.endTime].getTime())));
6674
+ && obj[fieldMapping.startTime] === record[fieldMapping.endTime]) ||
6675
+ ((obj[fieldMapping.startTime].getTime() === record[fieldMapping.startTime].getTime() &&
6676
+ obj[fieldMapping.endTime].getTime() === record[fieldMapping.endTime].getTime())
6677
+ || (obj[fieldMapping.startTime].getTime() === record[fieldMapping.startTime].getTime() &&
6678
+ obj[fieldMapping.endTime].getTime() < record[fieldMapping.endTime].getTime() ||
6679
+ obj[fieldMapping.endTime].getTime() > record[fieldMapping.endTime].getTime())));
6654
6680
  }
6655
6681
  if (eventsList.length > 0) {
6656
6682
  const appLevel = eventsList.map((obj) => obj.Index);
@@ -6836,6 +6862,9 @@ class MonthEvent extends EventBase {
6836
6862
  }
6837
6863
  }
6838
6864
  renderAppointments() {
6865
+ if (this.parent.dragAndDropModule) {
6866
+ this.parent.dragAndDropModule.setDragArea();
6867
+ }
6839
6868
  const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
6840
6869
  if (this.parent.rowAutoHeight) {
6841
6870
  this.parent.uiStateValues.top = conWrap.scrollTop;
@@ -6864,6 +6893,13 @@ class MonthEvent extends EventBase {
6864
6893
  if (!this.element.querySelector('.' + WORK_CELLS_CLASS)) {
6865
6894
  return;
6866
6895
  }
6896
+ if (this.parent.currentView === 'Month') {
6897
+ const wrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
6898
+ const cellTd = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
6899
+ cellTd.appendChild(wrapper);
6900
+ this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
6901
+ cellTd.removeChild(wrapper);
6902
+ }
6867
6903
  this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
6868
6904
  const scrollTop = conWrap.scrollTop;
6869
6905
  if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !isNullOrUndefined(this.parent.currentAction)) {
@@ -6895,10 +6931,10 @@ class MonthEvent extends EventBase {
6895
6931
  this.parent.virtualScrollModule.updateVirtualScrollHeight();
6896
6932
  }
6897
6933
  }
6898
- this.parent.notify(scrollUiUpdate, data);
6899
6934
  if (!this.parent.enablePersistence) {
6900
6935
  this.parent.notify(contentReady, {});
6901
6936
  }
6937
+ this.parent.notify(scrollUiUpdate, data);
6902
6938
  if (this.parent.currentView === 'Month' && this.parent.showWeekNumber) {
6903
6939
  const totalCells = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
6904
6940
  const weekNumberCells = [].slice.call(this.parent.element.querySelectorAll('.' + WEEK_NUMBER_CLASS));
@@ -6934,7 +6970,9 @@ class MonthEvent extends EventBase {
6934
6970
  this.sortByDateTime(blockList);
6935
6971
  if (this.parent.currentView === 'Month' && this.parent.rowAutoHeight && this.parent.activeViewOptions.group.resources.length === 0) {
6936
6972
  const totalCells = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
6937
- const height = this.parent.element.querySelector('.e-schedule-table').clientHeight / totalCells.length;
6973
+ const height = this.parent.height === 'auto' ? (this.parent.element.querySelector('.e-content-wrap').clientHeight +
6974
+ this.parent.element.querySelector('.e-date-header-wrap').clientHeight) / totalCells.length
6975
+ : this.parent.element.querySelector('.e-schedule-table').clientHeight / totalCells.length;
6938
6976
  totalCells.forEach((cell) => {
6939
6977
  setStyleAttribute(cell, { 'height': height + 'px' });
6940
6978
  });
@@ -7023,7 +7061,6 @@ class MonthEvent extends EventBase {
7023
7061
  appWidth = (appWidth <= 0) ? this.cellWidth : appWidth;
7024
7062
  const appLeft = (this.parent.enableRtl) ? 0 : position;
7025
7063
  const appRight = (this.parent.enableRtl) ? position : 0;
7026
- this.renderWrapperElement(cellTd);
7027
7064
  const appHeight = this.cellHeight - this.monthHeaderHeight;
7028
7065
  const appTop = this.getRowTop(resIndex);
7029
7066
  const blockElement = this.createBlockAppointmentElement(event, resIndex);
@@ -7128,18 +7165,19 @@ class MonthEvent extends EventBase {
7128
7165
  const eventSubject = (record[this.fields.subject] || this.parent.eventSettings.fields.subject.default ||
7129
7166
  this.parent.localeObj.getConstant('addTitle'));
7130
7167
  const newRecord = extend({}, record, record.data, true);
7131
- const appointmentWrapper = createElement('div', {
7132
- className: APPOINTMENT_CLASS,
7133
- attrs: {
7134
- 'data-id': 'Appointment_' + record[this.fields.id],
7135
- 'role': 'button', 'tabindex': '0',
7136
- 'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record), 'aria-selected': 'false', 'aria-grabbed': 'true',
7137
- 'aria-label': this.parent.getAnnouncementString(newRecord, eventSubject)
7138
- }
7139
- });
7168
+ const attrs = {
7169
+ 'data-id': 'Appointment_' + record[this.fields.id],
7170
+ 'role': 'button', 'tabindex': '0',
7171
+ 'aria-readonly': this.parent.eventBase.getReadonlyAttribute(record), 'aria-selected': 'false', 'aria-grabbed': 'true',
7172
+ 'aria-label': this.parent.getAnnouncementString(newRecord, eventSubject)
7173
+ };
7140
7174
  if (!isCloneElement) {
7141
- appointmentWrapper.setAttribute('data-guid', record.Guid);
7175
+ attrs['data-guid'] = record.Guid;
7176
+ }
7177
+ if (this.parent.activeViewOptions.group.resources.length > 0) {
7178
+ attrs['data-group-index'] = resIndex.toString();
7142
7179
  }
7180
+ const appointmentWrapper = createElement('div', { className: APPOINTMENT_CLASS, attrs: attrs });
7143
7181
  if (!isNullOrUndefined(this.cssClass)) {
7144
7182
  addClass([appointmentWrapper], this.cssClass);
7145
7183
  }
@@ -7148,9 +7186,6 @@ class MonthEvent extends EventBase {
7148
7186
  }
7149
7187
  const appointmentDetails = createElement('div', { className: APPOINTMENT_DETAILS });
7150
7188
  appointmentWrapper.appendChild(appointmentDetails);
7151
- if (this.parent.activeViewOptions.group.resources.length > 0) {
7152
- appointmentWrapper.setAttribute('data-group-index', resIndex.toString());
7153
- }
7154
7189
  let templateElement;
7155
7190
  const eventData = record.data;
7156
7191
  const eventObj = this.getEventData(record);
@@ -7263,7 +7298,6 @@ class MonthEvent extends EventBase {
7263
7298
  const appWidth = (diffInDays * this.cellWidth) - 5;
7264
7299
  const cellTd = this.workCells[day];
7265
7300
  const appTop = (overlapCount * (appHeight + EVENT_GAP));
7266
- this.renderWrapperElement(cellTd);
7267
7301
  const height = this.monthHeaderHeight + ((overlapCount + 1) * (appHeight + EVENT_GAP)) + this.moreIndicatorHeight;
7268
7302
  const enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
7269
7303
  if (this.parent.rowAutoHeight || enableAppRender) {
@@ -7300,7 +7334,7 @@ class MonthEvent extends EventBase {
7300
7334
  moreIndicatorElement.setAttribute('data-group-index', groupIndex);
7301
7335
  }
7302
7336
  moreIndicatorElement.style.top = appArea + 'px';
7303
- moreIndicatorElement.style.width = cellTd.offsetWidth - 2 + 'px';
7337
+ moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
7304
7338
  this.renderElement(cellTd, moreIndicatorElement);
7305
7339
  EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
7306
7340
  }
@@ -7339,8 +7373,9 @@ class MonthEvent extends EventBase {
7339
7373
  getOverlapEvents(date, appointments) {
7340
7374
  const appointmentsList = [];
7341
7375
  for (const app of appointments) {
7342
- if ((resetTime(app[this.fields.startTime]).getTime() <= resetTime(date).getTime()) &&
7343
- (resetTime(app[this.fields.endTime]).getTime() >= resetTime(date).getTime())) {
7376
+ const dateTime = resetTime(date).getTime();
7377
+ if ((resetTime(app[this.fields.startTime]).getTime() <= dateTime) &&
7378
+ (resetTime(app[this.fields.endTime]).getTime() >= dateTime)) {
7344
7379
  appointmentsList.push(app);
7345
7380
  }
7346
7381
  }
@@ -7406,8 +7441,9 @@ class MonthEvent extends EventBase {
7406
7441
  if (this.maxOrIndicator && isAppointment) {
7407
7442
  this.setMaxEventHeight(element, cellTd);
7408
7443
  }
7409
- if (cellTd.querySelector('.' + APPOINTMENT_WRAPPER_CLASS)) {
7410
- cellTd.querySelector('.' + APPOINTMENT_WRAPPER_CLASS).appendChild(element);
7444
+ const wrapperEle = cellTd.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
7445
+ if (wrapperEle) {
7446
+ wrapperEle.appendChild(element);
7411
7447
  }
7412
7448
  else {
7413
7449
  const wrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
@@ -7415,17 +7451,6 @@ class MonthEvent extends EventBase {
7415
7451
  cellTd.appendChild(wrapper);
7416
7452
  }
7417
7453
  }
7418
- renderWrapperElement(cellTd) {
7419
- const element = cellTd.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
7420
- if (!isNullOrUndefined(element)) {
7421
- this.monthHeaderHeight = element.offsetTop - cellTd.offsetTop;
7422
- }
7423
- else {
7424
- const wrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
7425
- cellTd.appendChild(wrapper);
7426
- this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
7427
- }
7428
- }
7429
7454
  getMoreIndicatorElement(count, startDate, endDate) {
7430
7455
  const moreIndicatorElement = createElement('div', {
7431
7456
  className: MORE_INDICATOR_CLASS,
@@ -7519,6 +7544,35 @@ class TimelineEvent extends MonthEvent {
7519
7544
  }
7520
7545
  return appointmentsList;
7521
7546
  }
7547
+ getSortComparerIndex(startDate, endDate) {
7548
+ let appIndex = -1;
7549
+ const appointments = this.renderedEvents;
7550
+ if (appointments.length > 0) {
7551
+ const appointmentsList = this.getOverlapSortComparerEvents(startDate, endDate, appointments);
7552
+ const appLevel = appointmentsList.map((obj) => obj.Index);
7553
+ appIndex = (appLevel.length > 0) ? this.getSmallestMissingNumber(appLevel) : 0;
7554
+ }
7555
+ return (appIndex === -1) ? 0 : appIndex;
7556
+ }
7557
+ getOverlapSortComparerEvents(startDate, endDate, appointmentsCollection) {
7558
+ const appointments = [];
7559
+ for (const app of appointmentsCollection) {
7560
+ if (this.renderType === 'day') {
7561
+ if ((resetTime(app[this.fields.startTime]).getTime() <= resetTime(new Date(startDate.getTime())).getTime()) &&
7562
+ (resetTime(app[this.fields.endTime]).getTime() >= resetTime(new Date(startDate.getTime())).getTime())) {
7563
+ appointments.push(app);
7564
+ }
7565
+ }
7566
+ else {
7567
+ const eventData = app.data;
7568
+ if (((eventData.trimStartTime.getTime() <= startDate.getTime()) && (startDate.getTime() < eventData.trimEndTime.getTime())) ||
7569
+ ((startDate.getTime() <= eventData.trimStartTime.getTime()) && (eventData.trimStartTime.getTime() < endDate.getTime()))) {
7570
+ appointments.push(app);
7571
+ }
7572
+ }
7573
+ }
7574
+ return appointments;
7575
+ }
7522
7576
  renderResourceEvents() {
7523
7577
  this.removeHeightProperty(RESOURCE_COLUMN_TABLE_CLASS);
7524
7578
  const resources = this.parent.uiStateValues.isGroupAdaptive ?
@@ -7559,7 +7613,7 @@ class TimelineEvent extends MonthEvent {
7559
7613
  return;
7560
7614
  }
7561
7615
  const cellTd = this.getCellTd();
7562
- const overlapCount = this.getIndex(startTime);
7616
+ const overlapCount = (isNullOrUndefined(this.parent.eventSettings.sortComparer)) ? this.getIndex(startTime) : this.getSortComparerIndex(startTime, endTime);
7563
7617
  event.Index = overlapCount;
7564
7618
  const elem = this.element.querySelector('.' + APPOINTMENT_CLASS);
7565
7619
  const eleHeight = (elem) ? elem.getBoundingClientRect().height : 0;
@@ -8196,6 +8250,9 @@ class FieldValidator {
8196
8250
  if (!elem && !this.ignoreError) {
8197
8251
  this.createTooltip(inputElement, error, id, '');
8198
8252
  }
8253
+ if (!isNullOrUndefined(elem)) {
8254
+ elem.querySelector(".e-error").innerHTML = error.innerHTML;
8255
+ }
8199
8256
  }
8200
8257
  createTooltip(element, error, name, display) {
8201
8258
  let dlgContent;
@@ -8377,6 +8434,7 @@ class QuickPopups {
8377
8434
  });
8378
8435
  buttonObj.appendTo(element);
8379
8436
  EventHandler.add(element, 'click', clickEvent, this);
8437
+ removeClass([element], ICON);
8380
8438
  }
8381
8439
  quickDialogClass(action) {
8382
8440
  const classList$$1 = [
@@ -8614,10 +8672,16 @@ class QuickPopups {
8614
8672
  const closeIcon = this.quickPopup.element.querySelector('.' + CLOSE_CLASS);
8615
8673
  this.renderButton('e-flat e-round e-small', ICON + ' ' + CLOSE_ICON_CLASS, false, closeIcon, this.closeClick);
8616
8674
  const readonly = this.parent.activeViewOptions.readonly || eventObj[this.parent.eventFields.isReadonly];
8675
+ const editAction = !this.parent.eventSettings.allowEditing || readonly;
8676
+ const deleteAction = !this.parent.eventSettings.allowDeleting || readonly;
8617
8677
  const editIcon = this.quickPopup.element.querySelector('.' + EDIT_CLASS);
8618
- this.renderButton('e-flat e-round e-small', ICON + ' ' + EDIT_ICON_CLASS, readonly, editIcon, this.editClick);
8678
+ if (editIcon) {
8679
+ this.renderButton('e-flat e-round e-small', ICON + ' ' + EDIT_ICON_CLASS, editAction, editIcon, this.editClick);
8680
+ }
8619
8681
  const deleteIcon = this.quickPopup.element.querySelector('.' + DELETE_CLASS);
8620
- this.renderButton('e-flat e-round e-small', ICON + ' ' + DELETE_ICON_CLASS, readonly, deleteIcon, this.deleteClick);
8682
+ if (deleteIcon) {
8683
+ this.renderButton('e-flat e-round e-small', ICON + ' ' + DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);
8684
+ }
8621
8685
  this.beforeQuickPopupOpen(target);
8622
8686
  }
8623
8687
  isCellBlocked(args) {
@@ -9061,21 +9125,24 @@ class QuickPopups {
9061
9125
  }
9062
9126
  });
9063
9127
  }
9064
- saveClick() {
9128
+ saveClick(event) {
9129
+ this.dialogEvent = event;
9065
9130
  this.isCrudAction = true;
9066
9131
  this.quickPopupHide();
9067
9132
  }
9068
- detailsClick() {
9133
+ detailsClick(event) {
9069
9134
  const subjectEle = this.quickPopup.element.querySelector('.' + SUBJECT_CLASS);
9070
9135
  if (subjectEle && subjectEle.value !== '') {
9071
9136
  extend(this.parent.activeCellsData, { subject: subjectEle.value });
9072
9137
  }
9138
+ this.dialogEvent = event;
9073
9139
  this.isCrudAction = false;
9074
9140
  this.fieldValidator.destroyToolTip();
9075
9141
  this.quickPopupHide();
9076
9142
  this.parent.eventWindow.openEditor(this.parent.activeCellsData, 'Add');
9077
9143
  }
9078
- editClick() {
9144
+ editClick(event) {
9145
+ this.dialogEvent = event;
9079
9146
  this.quickPopupHide(true);
9080
9147
  const data = this.parent.activeEventData.event;
9081
9148
  this.parent.currentAction = 'EditSeries';
@@ -9087,7 +9154,8 @@ class QuickPopups {
9087
9154
  this.parent.eventWindow.openEditor(data, this.parent.currentAction);
9088
9155
  }
9089
9156
  }
9090
- deleteClick() {
9157
+ deleteClick(event) {
9158
+ this.dialogEvent = event;
9091
9159
  this.quickPopupHide(true);
9092
9160
  this.parent.currentAction = 'Delete';
9093
9161
  if (this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule]) {
@@ -9119,11 +9187,13 @@ class QuickPopups {
9119
9187
  const moreElement = this.createMoreEventList(events, groupOrder, groupIndex);
9120
9188
  this.morePopup.element.querySelector('.' + MORE_EVENT_POPUP_CLASS).appendChild(moreElement);
9121
9189
  }
9122
- closeClick() {
9190
+ closeClick(event) {
9191
+ this.dialogEvent = event;
9123
9192
  this.quickPopupHide();
9124
9193
  this.morePopup.hide();
9125
9194
  }
9126
9195
  dialogButtonClick(event) {
9196
+ this.dialogEvent = event;
9127
9197
  this.quickDialog.hide();
9128
9198
  const target = event.target;
9129
9199
  const cancelBtn = this.quickDialog.element.querySelector('.' + QUICK_DIALOG_ALERT_CANCEL);
@@ -9167,7 +9237,7 @@ class QuickPopups {
9167
9237
  else if (!cancelBtn.classList.contains(DISABLE_CLASS) && (target.classList.contains(QUICK_DIALOG_ALERT_OK) ||
9168
9238
  (target.classList.contains(QUICK_DIALOG_ALERT_CANCEL) && !cancelBtn.classList.contains(QUICK_DIALOG_CANCEL_CLASS)))) {
9169
9239
  this.parent.uiStateValues.isIgnoreOccurrence = target.classList.contains(QUICK_DIALOG_ALERT_CANCEL);
9170
- this.parent.eventWindow.eventSave(this.l10n.getConstant('ok'));
9240
+ this.parent.eventWindow.eventSave(event, this.l10n.getConstant('ok'));
9171
9241
  }
9172
9242
  }
9173
9243
  updateTapHoldEventPopup(target) {
@@ -9224,8 +9294,9 @@ class QuickPopups {
9224
9294
  this.parent.eventWindow.convertToEventData(cellsData, eventObj);
9225
9295
  return eventObj;
9226
9296
  }
9227
- beforeQuickDialogClose() {
9297
+ beforeQuickDialogClose(e) {
9228
9298
  const args = {
9299
+ event: e.event || this.dialogEvent,
9229
9300
  type: (isNullOrUndefined(this.parent.activeEventData.event)) ? 'ValidationAlert' :
9230
9301
  !isNullOrUndefined(this.parent.activeEventData.event[this.parent.eventFields.recurrenceRule])
9231
9302
  ? 'RecurrenceAlert' : 'DeleteAlert', cancel: false, data: this.parent.activeEventData.event,
@@ -9266,7 +9337,7 @@ class QuickPopups {
9266
9337
  else {
9267
9338
  this.quickPopup.offsetX = 10;
9268
9339
  this.quickPopup.collision = { X: this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
9269
- this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: 'top' };
9340
+ this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: this.parent.enableRtl ? 'bottom' : 'top' };
9270
9341
  this.quickPopup.dataBind();
9271
9342
  this.quickPopup.refreshPosition(null, true);
9272
9343
  const collide = isCollide(this.quickPopup.element, this.parent.element);
@@ -9370,7 +9441,8 @@ class QuickPopups {
9370
9441
  remove(moreWrapper);
9371
9442
  }
9372
9443
  }
9373
- popupClose() {
9444
+ popupClose(event) {
9445
+ this.dialogEvent = event;
9374
9446
  this.isCrudAction = false;
9375
9447
  this.quickPopupHide(true);
9376
9448
  }
@@ -9403,6 +9475,7 @@ class QuickPopups {
9403
9475
  }
9404
9476
  const isEventPopup = this.quickPopup.element.querySelector('.' + EVENT_POPUP_CLASS);
9405
9477
  const args = {
9478
+ event: this.dialogEvent,
9406
9479
  type: this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo',
9407
9480
  cancel: false, data: popupData, element: this.quickPopup.element,
9408
9481
  target: (isCellPopup ? this.parent.activeCellsData.element : this.parent.activeEventData.element)
@@ -9434,7 +9507,7 @@ class QuickPopups {
9434
9507
  if (!isNullOrUndefined(navigateEle)) {
9435
9508
  const date = this.parent.getDateFromElement(e.currentTarget);
9436
9509
  if (!isNullOrUndefined(date)) {
9437
- this.closeClick();
9510
+ this.closeClick(e);
9438
9511
  this.parent.setProperties({ selectedDate: date }, true);
9439
9512
  this.parent.changeView(this.parent.getNavigateView(), e);
9440
9513
  }
@@ -9462,7 +9535,10 @@ class QuickPopups {
9462
9535
  this.morePopup.hide();
9463
9536
  }
9464
9537
  }
9465
- onClosePopup() {
9538
+ onClosePopup(event) {
9539
+ if (!isNullOrUndefined(event)) {
9540
+ this.dialogEvent = event;
9541
+ }
9466
9542
  this.quickPopupHide();
9467
9543
  this.parent.eventBase.focusElement();
9468
9544
  }
@@ -10963,6 +11039,7 @@ class EventWindow {
10963
11039
  }
10964
11040
  const eventProp = {
10965
11041
  type: 'Editor',
11042
+ event: args.event || this.dialogEvent,
10966
11043
  data: this.eventCrudData,
10967
11044
  cancel: false,
10968
11045
  element: this.element,
@@ -11818,11 +11895,12 @@ class EventWindow {
11818
11895
  (this.l10n.getConstant('repeats') + ' ' + this.recurrenceEditor.getRuleSummary(repeatRule)) : this.l10n.getConstant('repeat');
11819
11896
  this.repeatStatus.setProperties({ label: data });
11820
11897
  }
11821
- dialogClose() {
11898
+ dialogClose(event) {
11822
11899
  if (this.isEnterKey) {
11823
11900
  this.isEnterKey = false;
11824
11901
  return;
11825
11902
  }
11903
+ this.dialogEvent = event;
11826
11904
  this.isCrudAction = false;
11827
11905
  this.parent.activeEventData = { event: undefined, element: undefined };
11828
11906
  this.parent.currentAction = null;
@@ -11871,7 +11949,7 @@ class EventWindow {
11871
11949
  }
11872
11950
  }
11873
11951
  }
11874
- eventSave(alert) {
11952
+ eventSave(event, alert) {
11875
11953
  if (this.isEnterKey) {
11876
11954
  this.isEnterKey = false;
11877
11955
  return;
@@ -11886,6 +11964,7 @@ class EventWindow {
11886
11964
  return;
11887
11965
  }
11888
11966
  this.eventCrudData = dataCollection.eventData;
11967
+ this.dialogEvent = event;
11889
11968
  this.isCrudAction = true;
11890
11969
  this.dialogObject.hide();
11891
11970
  }
@@ -12416,7 +12495,7 @@ class EventWindow {
12416
12495
  const element = this.element.querySelector('.' + className);
12417
12496
  return element ? element.ej2_instances[0] : null;
12418
12497
  }
12419
- eventDelete() {
12498
+ eventDelete(event) {
12420
12499
  if (this.isEnterKey) {
12421
12500
  this.isEnterKey = false;
12422
12501
  return;
@@ -12442,6 +12521,7 @@ class EventWindow {
12442
12521
  }
12443
12522
  break;
12444
12523
  }
12524
+ this.dialogEvent = event;
12445
12525
  this.isCrudAction = false;
12446
12526
  this.dialogObject.hide();
12447
12527
  this.parent.quickPopup.openDeleteAlert();
@@ -12619,7 +12699,7 @@ class VirtualScroll {
12619
12699
  }
12620
12700
  renderEvents() {
12621
12701
  this.setTabIndex();
12622
- this.parent.notify(dataReady, {});
12702
+ this.parent.refreshEvents(false);
12623
12703
  this.parent.notify(contentReady, {});
12624
12704
  this.parent.hideSpinner();
12625
12705
  }
@@ -12671,7 +12751,8 @@ class VirtualScroll {
12671
12751
  this.translateY = conWrap.scrollTop;
12672
12752
  }
12673
12753
  else {
12674
- const height = (this.parent.rowAutoHeight) ? this.averageRowHeight : this.itemSize;
12754
+ let height = (this.parent.rowAutoHeight) ? this.averageRowHeight : this.itemSize;
12755
+ height = (height > 0) ? height : this.itemSize;
12675
12756
  this.translateY = (conWrap.scrollTop - (this.bufferCount * height) > 0) ?
12676
12757
  conWrap.scrollTop - (this.bufferCount * height) : 0;
12677
12758
  }
@@ -13009,8 +13090,7 @@ class Crud {
13009
13090
  const resultData = extend([], args.result, null, true);
13010
13091
  this.parent.eventsData = resultData.filter((data) => !data[this.parent.eventFields.isBlock]);
13011
13092
  this.parent.blockData = resultData.filter((data) => data[this.parent.eventFields.isBlock]);
13012
- const processed = this.parent.eventBase.processData(resultData);
13013
- this.parent.notify(dataReady, { processedData: processed });
13093
+ this.parent.refreshEvents(false);
13014
13094
  if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
13015
13095
  this.parent.dragAndDropModule.navigationWrapper();
13016
13096
  }
@@ -13102,7 +13182,8 @@ class Crud {
13102
13182
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
13103
13183
  let promise;
13104
13184
  if (addArgs.addedRecords instanceof Array) {
13105
- for (const event of addArgs.addedRecords) {
13185
+ for (let event of addArgs.addedRecords) {
13186
+ event = this.parent.eventBase.updateEventDateTime(event);
13106
13187
  const eventData = extend({}, this.parent.eventBase.processTimezone(event, true), null, true);
13107
13188
  editParams.addedRecords.push(eventData);
13108
13189
  }
@@ -13157,7 +13238,8 @@ class Crud {
13157
13238
  const fields = this.parent.eventFields;
13158
13239
  const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
13159
13240
  if (saveArgs.changedRecords instanceof Array) {
13160
- for (const event of saveArgs.changedRecords) {
13241
+ for (let event of saveArgs.changedRecords) {
13242
+ event = this.parent.eventBase.updateEventDateTime(event);
13161
13243
  const eventData = extend({}, this.parent.eventBase.processTimezone(event, true), null, true);
13162
13244
  editParams.changedRecords.push(eventData);
13163
13245
  }
@@ -13850,6 +13932,9 @@ __decorate$6([
13850
13932
  __decorate$6([
13851
13933
  Property()
13852
13934
  ], EventSettings.prototype, "tooltipTemplate", void 0);
13935
+ __decorate$6([
13936
+ Property('AllDayRow')
13937
+ ], EventSettings.prototype, "spannedEventPlacement", void 0);
13853
13938
  __decorate$6([
13854
13939
  Property()
13855
13940
  ], EventSettings.prototype, "resourceColorField", void 0);
@@ -13874,6 +13959,9 @@ __decorate$6([
13874
13959
  __decorate$6([
13875
13960
  Property(false)
13876
13961
  ], EventSettings.prototype, "ignoreWhitespace", void 0);
13962
+ __decorate$6([
13963
+ Property()
13964
+ ], EventSettings.prototype, "sortComparer", void 0);
13877
13965
 
13878
13966
  var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
13879
13967
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -13974,7 +14062,13 @@ class ResourceBase {
13974
14062
  renderResourceHeaderIndent(tr) {
13975
14063
  const resColTd = createElement('td', { className: RESOURCE_LEFT_TD_CLASS });
13976
14064
  const resColDiv = createElement('div', { className: RESOURCE_TEXT_CLASS });
13977
- resColTd.appendChild(resColDiv);
14065
+ if (this.parent.activeViewOptions.headerIndentTemplate) {
14066
+ const data = { className: [resColTd.className], type: 'emptyCells' };
14067
+ this.parent.renderHeaderIndentTemplate(data, resColTd);
14068
+ }
14069
+ else {
14070
+ resColTd.appendChild(resColDiv);
14071
+ }
13978
14072
  const args = { elementType: 'emptyCells', element: resColTd };
13979
14073
  this.parent.trigger(renderCell, args);
13980
14074
  tr.appendChild(resColTd);
@@ -14161,7 +14255,7 @@ class ResourceBase {
14161
14255
  cancel: false, event: e, groupIndex: index,
14162
14256
  requestType: target.classList.contains(RESOURCE_COLLAPSE_CLASS) ? 'resourceExpanded' : 'resourceCollapsed'
14163
14257
  };
14164
- this.parent.notify(dataReady, {});
14258
+ this.parent.refreshEvents(false);
14165
14259
  this.parent.trigger(actionComplete, args);
14166
14260
  }
14167
14261
  });
@@ -14599,8 +14693,11 @@ class ResourceBase {
14599
14693
  let temp = 0;
14600
14694
  for (const currentLevelChilds of resTreeGroup[i]) {
14601
14695
  for (const currentLevelChild of currentLevelChilds) {
14602
- if (resTreeGroup[i + 1]) {
14696
+ if (resTreeGroup[i + 1] && resTreeGroup[i + 1].length > 0) {
14603
14697
  const nextLevelChilds = resTreeGroup[i + 1][temp];
14698
+ if (!nextLevelChilds) {
14699
+ continue;
14700
+ }
14604
14701
  let colSpan = 0;
14605
14702
  for (const nextLevelChild of nextLevelChilds) {
14606
14703
  if (!this.parent.activeViewOptions.group.byGroupID || (this.parent.activeViewOptions.group.byGroupID &&
@@ -14967,11 +15064,6 @@ let Schedule = class Schedule extends Component {
14967
15064
  }
14968
15065
  classList(this.element, addClasses, removeClasses);
14969
15066
  this.validateDate();
14970
- this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
14971
- this.editorTemplateFn = this.templateParser(this.editorTemplate);
14972
- this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
14973
- this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
14974
- this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
14975
15067
  createSpinner({ target: this.element });
14976
15068
  this.scrollModule = new Scroll(this);
14977
15069
  this.scrollModule.setWidth();
@@ -15117,6 +15209,7 @@ let Schedule = class Schedule extends Component {
15117
15209
  obj.dayHeaderTemplateName = obj.dayHeaderTemplate ? obj.option : '';
15118
15210
  obj.monthHeaderTemplateName = obj.monthHeaderTemplate ? obj.option : '';
15119
15211
  obj.resourceHeaderTemplateName = obj.resourceHeaderTemplate ? obj.option : '';
15212
+ obj.headerIndentTemplateName = obj.headerIndentTemplate ? obj.option : '';
15120
15213
  obj.eventTemplateName = obj.eventTemplate ? obj.option : '';
15121
15214
  if (!isNullOrUndefined(obj.firstDayOfWeek) && obj.firstDayOfWeek === 0) {
15122
15215
  delete obj.firstDayOfWeek;
@@ -15175,6 +15268,7 @@ let Schedule = class Schedule extends Component {
15175
15268
  eventTemplate: this.eventSettings.template,
15176
15269
  dateHeaderTemplate: this.dateHeaderTemplate,
15177
15270
  resourceHeaderTemplate: this.resourceHeaderTemplate,
15271
+ headerIndentTemplate: this.headerIndentTemplate,
15178
15272
  firstMonthOfYear: this.firstMonthOfYear,
15179
15273
  firstDayOfWeek: this.firstDayOfWeek,
15180
15274
  workDays: workDays,
@@ -15250,7 +15344,13 @@ let Schedule = class Schedule extends Component {
15250
15344
  this.minorSlotTemplateFn = this.templateParser(this.activeViewOptions.timeScale.minorSlotTemplate);
15251
15345
  this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);
15252
15346
  this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);
15347
+ this.headerIndentTemplateFn = this.templateParser(this.activeViewOptions.headerIndentTemplate);
15253
15348
  this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);
15349
+ this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
15350
+ this.editorTemplateFn = this.templateParser(this.editorTemplate);
15351
+ this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
15352
+ this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
15353
+ this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
15254
15354
  }
15255
15355
  initializePopups() {
15256
15356
  this.eventWindow = new EventWindow(this);
@@ -15882,6 +15982,15 @@ let Schedule = class Schedule extends Component {
15882
15982
  getResourceHeaderTemplate() {
15883
15983
  return this.resourceHeaderTemplateFn;
15884
15984
  }
15985
+ /**
15986
+ * Method to process indent template
15987
+ *
15988
+ * @returns {CallbackFunction} Returns the callback function
15989
+ * @private
15990
+ */
15991
+ getHeaderIndentTemplate() {
15992
+ return this.headerIndentTemplateFn;
15993
+ }
15885
15994
  /**
15886
15995
  * Method to get dynamic CSS properties
15887
15996
  *
@@ -15945,7 +16054,7 @@ let Schedule = class Schedule extends Component {
15945
16054
  && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {
15946
16055
  this.activeView.resetColWidth();
15947
16056
  this.notify(scrollUiUpdate, { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });
15948
- this.notify(dataReady, {});
16057
+ this.refreshEvents(false);
15949
16058
  }
15950
16059
  else {
15951
16060
  this.notify(contentReady, {});
@@ -16055,6 +16164,23 @@ let Schedule = class Schedule extends Component {
16055
16164
  }
16056
16165
  return weekNumber;
16057
16166
  }
16167
+ /**
16168
+ * Method to render the header indent template.
16169
+ *
16170
+ * @param {TdData} data Accepts the td data
16171
+ * @param {Element} td Accepts the td element
16172
+ * @returns {void}
16173
+ * @private
16174
+ */
16175
+ renderHeaderIndentTemplate(data, td) {
16176
+ if (this.activeViewOptions.headerIndentTemplate) {
16177
+ const scheduleId = this.element.id + '_';
16178
+ const viewName = this.activeViewOptions.headerIndentTemplateName;
16179
+ const templateId = scheduleId + viewName + 'headerIndentTemplate';
16180
+ const indentTemplate = [].slice.call(this.getHeaderIndentTemplate()(data, this, 'headerIndentTemplate', templateId, false));
16181
+ append(indentTemplate, td);
16182
+ }
16183
+ }
16058
16184
  unWireEvents() {
16059
16185
  EventHandler.remove(window, 'resize', this.onScheduleResize);
16060
16186
  EventHandler.remove(window, 'orientationchange', this.onScheduleResize);
@@ -16122,7 +16248,7 @@ let Schedule = class Schedule extends Component {
16122
16248
  }
16123
16249
  this.notify(scrollUiUpdate, { cssProperties: this.getCssProperties() });
16124
16250
  if (this.activeView.isTimelineView()) {
16125
- this.notify(dataReady, {});
16251
+ this.refreshEvents(false);
16126
16252
  }
16127
16253
  break;
16128
16254
  case 'showWeekend':
@@ -16318,10 +16444,8 @@ let Schedule = class Schedule extends Component {
16318
16444
  break;
16319
16445
  case 'allowDragAndDrop':
16320
16446
  case 'allowResizing':
16321
- this.notify(dataReady, { processedData: this.eventBase.processData(this.eventsData) });
16322
- break;
16323
16447
  case 'eventDragArea':
16324
- this.notify(dataReady, {});
16448
+ this.refreshEvents(false);
16325
16449
  break;
16326
16450
  case 'weekRule':
16327
16451
  state.isLayout = true;
@@ -16351,6 +16475,11 @@ let Schedule = class Schedule extends Component {
16351
16475
  }
16352
16476
  state.isLayout = true;
16353
16477
  break;
16478
+ case 'headerIndentTemplate':
16479
+ this.activeViewOptions.headerIndentTemplate = newProp.headerIndentTemplate;
16480
+ this.headerIndentTemplateFn = this.templateParser(this.activeViewOptions.headerIndentTemplate);
16481
+ state.isLayout = true;
16482
+ break;
16354
16483
  }
16355
16484
  }
16356
16485
  setRtlClass() {
@@ -16421,9 +16550,10 @@ let Schedule = class Schedule extends Component {
16421
16550
  this.eventWindow.refresh();
16422
16551
  }
16423
16552
  break;
16553
+ case 'spannedEventPlacement':
16424
16554
  case 'enableMaxHeight':
16425
16555
  case 'enableIndicator':
16426
- this.notify(dataReady, { processedData: this.eventBase.processData(this.eventsData) });
16556
+ this.refreshEvents(false);
16427
16557
  break;
16428
16558
  case 'ignoreWhitespace':
16429
16559
  state.isLayout = true;
@@ -16965,14 +17095,102 @@ let Schedule = class Schedule extends Component {
16965
17095
  * Refreshes the event dataSource. This method may be useful when the events alone in the schedule needs to be re-rendered.
16966
17096
  *
16967
17097
  * @function refreshEvents
17098
+ * @param {boolean} isRemoteRefresh Accepts the boolean to refresh data from remote or local
16968
17099
  * @returns {void}
16969
17100
  */
16970
- refreshEvents() {
17101
+ refreshEvents(isRemoteRefresh = true) {
16971
17102
  if (this.dragAndDropModule) {
16972
17103
  this.dragAndDropModule.actionObj.action = '';
16973
17104
  removeClass([this.element], EVENT_ACTION_CLASS);
16974
17105
  }
16975
- this.crudModule.refreshDataManager();
17106
+ if (isRemoteRefresh) {
17107
+ this.crudModule.refreshDataManager();
17108
+ }
17109
+ else {
17110
+ const eventsData = this.eventsData || [];
17111
+ const blockData = this.blockData || [];
17112
+ const data = eventsData.concat(blockData);
17113
+ this.notify(dataReady, { processedData: this.eventBase ? this.eventBase.processData(data) : [] });
17114
+ }
17115
+ }
17116
+ /**
17117
+ * Method to refresh the given Schedule templates
17118
+ *
17119
+ * @param {string} templateName Accepts the template name
17120
+ * @returns {void}
17121
+ */
17122
+ refreshTemplates(templateName) {
17123
+ if (templateName) {
17124
+ this.resetTemplates([templateName]);
17125
+ }
17126
+ else {
17127
+ this.resetTemplates();
17128
+ }
17129
+ switch (templateName) {
17130
+ case 'eventTemplate':
17131
+ this.appointmentTemplateFn = this.templateParser(this.activeViewOptions.eventTemplate);
17132
+ this.refreshEvents(false);
17133
+ break;
17134
+ case 'dateHeaderTemplate':
17135
+ this.dateHeaderTemplateFn = this.templateParser(this.activeViewOptions.dateHeaderTemplate);
17136
+ this.activeView.refreshHeader();
17137
+ break;
17138
+ case 'resourceHeaderTemplate':
17139
+ this.resourceHeaderTemplateFn = this.templateParser(this.activeViewOptions.resourceHeaderTemplate);
17140
+ if (this.activeView.isTimelineView()) {
17141
+ this.activeView.refreshResourceHeader();
17142
+ }
17143
+ else {
17144
+ this.activeView.refreshHeader();
17145
+ }
17146
+ break;
17147
+ case 'quickInfoTemplates':
17148
+ if (this.quickPopup) {
17149
+ this.quickPopup.destroy();
17150
+ this.quickPopup = null;
17151
+ }
17152
+ this.quickPopup = new QuickPopups(this);
17153
+ this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
17154
+ this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
17155
+ this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
17156
+ break;
17157
+ case 'editorTemplate':
17158
+ if (this.eventWindow) {
17159
+ this.eventWindow.destroy();
17160
+ this.eventWindow = null;
17161
+ }
17162
+ this.eventWindow = new EventWindow(this);
17163
+ this.editorTemplateFn = this.templateParser(this.editorTemplate);
17164
+ break;
17165
+ case 'tooltipTemplate':
17166
+ case 'headerTooltipTemplate':
17167
+ if (this.eventTooltip) {
17168
+ this.eventTooltip.destroy();
17169
+ this.eventTooltip = null;
17170
+ }
17171
+ this.eventTooltip = new EventTooltip(this);
17172
+ this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
17173
+ this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);
17174
+ break;
17175
+ default:
17176
+ this.initializeView(this.currentView);
17177
+ break;
17178
+ }
17179
+ }
17180
+ /**
17181
+ * Refreshes the Schedule layout without re-render.
17182
+ *
17183
+ * @function refreshLayout
17184
+ * @returns {void}
17185
+ */
17186
+ refreshLayout() {
17187
+ this.onScheduleResize();
17188
+ if (this.headerModule) {
17189
+ this.headerModule.refresh();
17190
+ }
17191
+ if (this.eventWindow) {
17192
+ this.eventWindow.refresh();
17193
+ }
16976
17194
  }
16977
17195
  /**
16978
17196
  * To retrieve the appointment object from element.
@@ -17357,6 +17575,9 @@ __decorate([
17357
17575
  __decorate([
17358
17576
  Property()
17359
17577
  ], Schedule.prototype, "resourceHeaderTemplate", void 0);
17578
+ __decorate([
17579
+ Property()
17580
+ ], Schedule.prototype, "headerIndentTemplate", void 0);
17360
17581
  __decorate([
17361
17582
  Complex({}, Group)
17362
17583
  ], Schedule.prototype, "group", void 0);
@@ -17537,7 +17758,7 @@ class ActionBase {
17537
17758
  const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
17538
17759
  let trElement = [].slice.call(viewElement.querySelector('tr').children);
17539
17760
  if (!this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0 &&
17540
- !this.parent.isAdaptive) {
17761
+ !this.parent.isAdaptive && !this.parent.enableAdaptiveUI) {
17541
17762
  trElement = this.getResourceElements(trElement);
17542
17763
  }
17543
17764
  const leftOffset = trElement[0].getBoundingClientRect();
@@ -18066,6 +18287,9 @@ class Resize extends ActionBase {
18066
18287
  }
18067
18288
  monthResizing() {
18068
18289
  this.removeCloneElement();
18290
+ if (isNullOrUndefined(this.actionObj.pageX) || isNullOrUndefined(this.actionObj.pageY)) {
18291
+ return;
18292
+ }
18069
18293
  const td = document.elementFromPoint(this.actionObj.pageX, this.actionObj.pageY);
18070
18294
  if (isNullOrUndefined(td)) {
18071
18295
  return;
@@ -18197,13 +18421,16 @@ class Resize extends ActionBase {
18197
18421
  const eventEnd = new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());
18198
18422
  let resizeTime;
18199
18423
  let isDateHeader = false;
18424
+ const isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1;
18425
+ const isTimelineMonth = this.parent.currentView === 'TimelineMonth';
18426
+ const isWithoutScale = isTimelineMonth || isTimeViews && !this.parent.activeViewOptions.timeScale.enable;
18200
18427
  if (this.parent.activeView.isTimelineView()) {
18201
18428
  const tr = this.parent.getContentTable().querySelector('tr');
18202
18429
  let headerName = this.parent.currentView;
18203
18430
  if (this.parent.activeViewOptions.headerRows.length > 0) {
18204
18431
  const rows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
18205
18432
  headerName = rows.slice(-1)[0];
18206
- if (this.parent.currentView === 'TimelineMonth' && headerName === 'Hour') {
18433
+ if (isTimelineMonth && headerName === 'Hour') {
18207
18434
  headerName = rows.slice(-2)[0] || 'Month';
18208
18435
  }
18209
18436
  }
@@ -18222,9 +18449,8 @@ class Resize extends ActionBase {
18222
18449
  offsetValue += (this.actionObj.clone.offsetWidth - this.actionObj.cellWidth);
18223
18450
  }
18224
18451
  cellIndex = Math.floor(offsetValue / Math.floor(tr.offsetWidth / noOfDays));
18225
- isDateHeader =
18226
- ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1 && headerName === 'Date';
18227
- cellIndex = isLeft ? cellIndex : (this.parent.currentView === 'TimelineMonth' || isDateHeader) ? cellIndex + 1 : cellIndex;
18452
+ isDateHeader = isTimeViews && headerName === 'Date';
18453
+ cellIndex = isLeft ? cellIndex : (isTimelineMonth || isDateHeader) ? cellIndex + 1 : cellIndex;
18228
18454
  isLastCell = cellIndex === tdCollections.length;
18229
18455
  cellIndex = (cellIndex < 0) ? 0 : (cellIndex >= noOfDays) ? noOfDays - 1 : cellIndex;
18230
18456
  }
@@ -18236,7 +18462,7 @@ class Resize extends ActionBase {
18236
18462
  if (this.parent.enableRtl) {
18237
18463
  let cellOffsetWidth = 0;
18238
18464
  if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
18239
- this.parent.currentView !== 'TimelineMonth')) {
18465
+ !isTimelineMonth)) {
18240
18466
  cellOffsetWidth = this.actionObj.cellWidth;
18241
18467
  }
18242
18468
  const offsetWidth = (Math.floor(parseInt(this.actionObj.clone.style.right, 10) / this.actionObj.cellWidth) *
@@ -18288,16 +18514,18 @@ class Resize extends ActionBase {
18288
18514
  }
18289
18515
  }
18290
18516
  if (isLeft) {
18291
- if ((this.actionObj.event[this.parent.eventFields.endTime].getTime() - resizeTime.getTime()) <= 0) {
18292
- resizeTime = new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime());
18517
+ if ((eventEnd.getTime() - resizeTime.getTime()) <= 0) {
18518
+ resizeTime = isWithoutScale ? resetTime(eventEnd) : eventStart;
18293
18519
  }
18294
18520
  this.actionObj.start = this.parent.activeViewOptions.timeScale.enable ? this.calculateIntervalTime(resizeTime) : resizeTime;
18295
18521
  }
18296
18522
  else {
18297
- const isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1 &&
18298
- this.parent.activeViewOptions.timeScale.enable;
18299
- const resizeEnd = ((!isTimeViews || isDateHeader) && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ?
18523
+ const isTimeScaleViews = isTimeViews && this.parent.activeViewOptions.timeScale.enable;
18524
+ let resizeEnd = ((!isTimeScaleViews || isDateHeader) && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ?
18300
18525
  addDays(resizeTime, 1) : resizeTime;
18526
+ if (isWithoutScale && (resizeEnd.getTime() - eventStart.getTime()) <= 0) {
18527
+ resizeEnd = addDays(resetTime(eventStart), 1);
18528
+ }
18301
18529
  this.actionObj.end = this.parent.activeViewOptions.timeScale.enable && this.parent.currentView !== 'Month' ?
18302
18530
  this.calculateIntervalTime(resizeEnd) : resizeEnd;
18303
18531
  }
@@ -18434,6 +18662,9 @@ class YearEvent extends TimelineEvent {
18434
18662
  this.isResource = false;
18435
18663
  }
18436
18664
  renderAppointments() {
18665
+ if (this.parent.dragAndDropModule) {
18666
+ this.parent.dragAndDropModule.setDragArea();
18667
+ }
18437
18668
  this.fields = this.parent.eventFields;
18438
18669
  const elementSelector = (this.parent.currentView === 'Year') ? '.' + APPOINTMENT_CLASS :
18439
18670
  '.' + APPOINTMENT_WRAPPER_CLASS + ',.' + MORE_INDICATOR_CLASS;
@@ -18622,7 +18853,7 @@ class YearEvent extends TimelineEvent {
18622
18853
  const monthStart = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
18623
18854
  for (let i = 0, len = resources.length; i < len; i++) {
18624
18855
  this.renderedEvents = [];
18625
- this.renderResourceEvent(wrapperCollection[i], resources[i], month, i, monthStart);
18856
+ this.renderResourceEvent(wrapperCollection[month], resources[i], month, i, monthStart);
18626
18857
  }
18627
18858
  }
18628
18859
  }
@@ -18932,7 +19163,6 @@ class DragAndDrop extends ActionBase {
18932
19163
  this.isCursorAhead = false;
18933
19164
  }
18934
19165
  wireDragEvent(element) {
18935
- const dragElement = document.querySelector(this.parent.eventDragArea);
18936
19166
  new Draggable(element, {
18937
19167
  abort: '.' + EVENT_RESIZE_CLASS,
18938
19168
  clone: true,
@@ -18940,8 +19170,7 @@ class DragAndDrop extends ActionBase {
18940
19170
  enableTapHold: this.parent.isAdaptive,
18941
19171
  enableTailMode: (this.parent.eventDragArea) ? true : false,
18942
19172
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
18943
- dragArea: (this.parent.eventDragArea && dragElement) ?
18944
- dragElement : this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS),
19173
+ dragArea: this.dragArea,
18945
19174
  dragStart: this.dragStart.bind(this),
18946
19175
  drag: this.drag.bind(this),
18947
19176
  dragStop: this.dragStop.bind(this),
@@ -18950,6 +19179,11 @@ class DragAndDrop extends ActionBase {
18950
19179
  queryPositionInfo: this.dragPosition.bind(this)
18951
19180
  });
18952
19181
  }
19182
+ setDragArea() {
19183
+ const dragElement = document.querySelector(this.parent.eventDragArea);
19184
+ this.dragArea = this.parent.eventDragArea && dragElement ? dragElement :
19185
+ this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
19186
+ }
18953
19187
  dragHelper(e) {
18954
19188
  this.setDragActionDefaultValues();
18955
19189
  this.actionObj.element = e.element;
@@ -19555,18 +19789,20 @@ class DragAndDrop extends ActionBase {
19555
19789
  const eventData = [];
19556
19790
  const startTime = event[eventFields.startTime];
19557
19791
  const endTime = event[eventFields.endTime];
19558
- const isDifferentDate = resetTime(new Date(startTime.getTime())) < resetTime(new Date(endTime.getTime()));
19559
- if (isDifferentDate) {
19560
- const scheduleStartHour = this.parent.activeView.getStartHour();
19561
- const scheduleEndHour = this.parent.activeView.getEndHour();
19562
- const startDate = getStartEndHours(resetTime(startTime), scheduleStartHour, scheduleEndHour);
19563
- const endDate = getStartEndHours(resetTime(endTime), scheduleStartHour, scheduleEndHour);
19564
- const firstEventObj = extend({}, event, null, true);
19565
- firstEventObj[eventFields.endTime] = startDate.endHour;
19566
- eventData.push(firstEventObj);
19567
- const secondEventObj = extend({}, event, null, true);
19568
- secondEventObj[eventFields.startTime] = endDate.startHour;
19569
- eventData.push(secondEventObj);
19792
+ if (resetTime(new Date(startTime.getTime())) < resetTime(new Date(endTime.getTime()))) {
19793
+ let startReferenceDate = resetTime(new Date(startTime.getTime()));
19794
+ let endReferenceDate = new Date(startReferenceDate.getTime());
19795
+ for (let i = 0; startReferenceDate < new Date(endTime.getTime()); i++) {
19796
+ endReferenceDate = new Date(endReferenceDate.setDate(startReferenceDate.getDate() + 1));
19797
+ const eventObj = extend({}, event, null, true);
19798
+ eventObj[eventFields.startTime] = new Date(startReferenceDate);
19799
+ eventObj[eventFields.endTime] = new Date(endReferenceDate);
19800
+ startReferenceDate = new Date(startReferenceDate.setDate(startReferenceDate.getDate() + 1));
19801
+ eventData.push(eventObj);
19802
+ }
19803
+ const index = eventData.length - 1;
19804
+ eventData[0][eventFields.startTime] = startTime;
19805
+ eventData[index][eventFields.endTime] = endTime;
19570
19806
  }
19571
19807
  else {
19572
19808
  eventData.push(event);
@@ -19637,8 +19873,7 @@ class DragAndDrop extends ActionBase {
19637
19873
  // eslint-disable-next-line max-len
19638
19874
  this.parent.getDateFromElement(isNullOrUndefined(index) ? this.actionObj.target : this.targetTd)));
19639
19875
  const splitEvents = this.splitEvent(event);
19640
- const events = event[this.parent.eventFields.isAllDay] ||
19641
- this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 ? [event] : splitEvents;
19876
+ let events = this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 || !(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') ? [event] : splitEvents;
19642
19877
  for (let i = 0; i < events.length; i++) {
19643
19878
  if (i > 0) {
19644
19879
  let filterQuery = `.e-day-wrapper[data-date="${resetTime(events[i][this.parent.eventFields.startTime]).getTime()}"]`;
@@ -19929,6 +20164,12 @@ class DragAndDrop extends ActionBase {
19929
20164
  const eventSrt = eventObj[this.parent.eventFields.startTime];
19930
20165
  eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds());
19931
20166
  }
20167
+ if (this.parent.eventDragArea) {
20168
+ const targetDate = this.parent.getDateFromElement(e.target);
20169
+ if (!isNullOrUndefined(targetDate)) {
20170
+ eventStart = targetDate;
20171
+ }
20172
+ }
19932
20173
  const eventEnd = new Date(eventStart.getTime());
19933
20174
  eventEnd.setMilliseconds(eventDuration);
19934
20175
  let eventsData = [this.getUpdatedEvent(eventStart, eventEnd, this.actionObj.event)];
@@ -20169,8 +20410,15 @@ class ViewBase {
20169
20410
  getContentRows() {
20170
20411
  return [];
20171
20412
  }
20172
- serverRenderLayout() {
20173
- // Need only for layout server rendering
20413
+ refreshHeader() {
20414
+ // Method to refresh the date header
20415
+ }
20416
+ refreshResourceHeader() {
20417
+ remove(this.element.querySelector('tbody').lastElementChild.firstElementChild);
20418
+ const resTd = createElement('td');
20419
+ resTd.appendChild(this.parent.resourceBase.createResourceColumn());
20420
+ prepend([resTd], this.element.querySelector('tbody').lastElementChild);
20421
+ this.parent.notify(contentReady, {});
20174
20422
  }
20175
20423
  getDayName(date) {
20176
20424
  return this.parent.getDayNames('abbreviated')[date.getDay()];
@@ -20217,7 +20465,7 @@ class ViewBase {
20217
20465
  }
20218
20466
  createTableLayout(className) {
20219
20467
  const clsName = className || '';
20220
- const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName });
20468
+ const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName, attrs: { role: 'table' } });
20221
20469
  const tbody = createElement('tbody');
20222
20470
  table.appendChild(tbody);
20223
20471
  return table;
@@ -20858,12 +21106,11 @@ class VerticalView extends ViewBase {
20858
21106
  if (!isNullOrUndefined(this.currentTimeIndicatorTimer)) {
20859
21107
  this.clearCurrentTimeIndicatorTimer();
20860
21108
  this.changeCurrentTimePosition();
20861
- this.currentTimeIndicatorTimer =
20862
- window.setInterval(() => { this.changeCurrentTimePosition(); }, MS_PER_MINUTE);
21109
+ this.updateCurrentTimeIndicatorTimer();
20863
21110
  }
20864
21111
  }, interval);
20865
21112
  }
20866
- this.currentTimeIndicatorTimer = window.setInterval(() => { this.changeCurrentTimePosition(); }, MS_PER_MINUTE);
21113
+ this.updateCurrentTimeIndicatorTimer();
20867
21114
  }
20868
21115
  }
20869
21116
  else {
@@ -20906,6 +21153,9 @@ class VerticalView extends ViewBase {
20906
21153
  this.removeCurrentTimeIndicatorElements();
20907
21154
  }
20908
21155
  }
21156
+ updateCurrentTimeIndicatorTimer() {
21157
+ this.currentTimeIndicatorTimer = window.setInterval(() => { this.changeCurrentTimePosition(); }, MS_PER_MINUTE);
21158
+ }
20909
21159
  removeCurrentTimeIndicatorElements() {
20910
21160
  const queryString = '.' + PREVIOUS_TIMELINE_CLASS + ',.' + CURRENT_TIMELINE_CLASS + ',.' + CURRENT_TIME_CLASS;
20911
21161
  const timeIndicator = [].slice.call(this.element.querySelectorAll(queryString));
@@ -20997,7 +21247,6 @@ class VerticalView extends ViewBase {
20997
21247
  cntEle = [].slice.call(this.parent.getMinorSlotTemplate()(args, this.parent, templateName, templateId + templateName, false));
20998
21248
  }
20999
21249
  else {
21000
- wrapper.innerHTML = '&nbsp;';
21001
21250
  cntEle = [].slice.call(wrapper.childNodes);
21002
21251
  }
21003
21252
  break;
@@ -21012,6 +21261,11 @@ class VerticalView extends ViewBase {
21012
21261
  }
21013
21262
  return cntEle;
21014
21263
  }
21264
+ refreshHeader() {
21265
+ remove(this.element.querySelector('tbody tr'));
21266
+ this.renderHeader();
21267
+ this.parent.notify(contentReady, {});
21268
+ }
21015
21269
  renderLayout(type) {
21016
21270
  this.setPanel(createElement('div', { className: TABLE_WRAP_CLASS }));
21017
21271
  const clsList = [this.baseCssClass, this.viewClass];
@@ -21083,6 +21337,7 @@ class VerticalView extends ViewBase {
21083
21337
  const tbl = this.createTableLayout();
21084
21338
  const trEle = createElement('tr');
21085
21339
  const rowCount = this.colLevels.length;
21340
+ let nth;
21086
21341
  for (let i = 0; i < rowCount; i++) {
21087
21342
  const ntr = trEle.cloneNode();
21088
21343
  const data = { className: [(this.colLevels[i][0] && this.colLevels[i][0].className[0])], type: 'emptyCells' };
@@ -21094,7 +21349,9 @@ class VerticalView extends ViewBase {
21094
21349
  attrs: { title: this.parent.localeObj.getConstant('week') + ' ' + weekNo }
21095
21350
  })];
21096
21351
  }
21097
- ntr.appendChild(this.createTd(data));
21352
+ nth = this.createTd(data);
21353
+ this.parent.renderHeaderIndentTemplate(data, nth);
21354
+ ntr.appendChild(nth);
21098
21355
  tbl.querySelector('tbody').appendChild(ntr);
21099
21356
  }
21100
21357
  const ntr = trEle.cloneNode();
@@ -21107,8 +21364,9 @@ class VerticalView extends ViewBase {
21107
21364
  ICON + ' ' + DISABLE_CLASS
21108
21365
  });
21109
21366
  const data = { className: [ALLDAY_CELLS_CLASS], type: 'emptyCells' };
21110
- const nth = this.createTd(data);
21367
+ nth = this.createTd(data);
21111
21368
  nth.appendChild(appointmentExpandCollapse);
21369
+ this.parent.renderHeaderIndentTemplate(data, nth);
21112
21370
  ntr.appendChild(nth);
21113
21371
  tbl.querySelector('tbody').appendChild(ntr);
21114
21372
  wrap.appendChild(tbl);
@@ -21246,10 +21504,10 @@ class VerticalView extends ViewBase {
21246
21504
  ntd.setAttribute('colspan', tdData.colSpan.toString());
21247
21505
  }
21248
21506
  const clsName = this.getContentTdClass(r);
21249
- if (!this.parent.isMinMaxDate(resetTime(new Date('' + tdData.date)))) {
21507
+ const cellDate = resetTime(tdData.date);
21508
+ if (!this.parent.isMinMaxDate(cellDate)) {
21250
21509
  clsName.push(DISABLE_DATES);
21251
21510
  }
21252
- const cellDate = resetTime(new Date('' + tdData.date));
21253
21511
  setTime(cellDate, getDateInMs(r.date));
21254
21512
  let type = 'workCells';
21255
21513
  if (tdData.className.indexOf(RESOURCE_PARENT_CLASS) !== -1) {
@@ -21480,6 +21738,7 @@ class WorkWeek extends VerticalView {
21480
21738
  }
21481
21739
  }
21482
21740
 
21741
+ /* eslint-disable @typescript-eslint/no-explicit-any */
21483
21742
  /**
21484
21743
  * month view
21485
21744
  */
@@ -21538,20 +21797,14 @@ class Month extends ViewBase {
21538
21797
  this.setContentHeight(content, leftPanel, height);
21539
21798
  }
21540
21799
  const scrollBarWidth = getScrollBarWidth();
21541
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21542
21800
  header.firstElementChild.style[args.cssProperties.rtlBorder] = '';
21543
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21544
21801
  header.style[args.cssProperties.rtlPadding] = '';
21545
21802
  if (content.offsetWidth - content.clientWidth > 0) {
21546
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21547
21803
  header.firstElementChild.style[args.cssProperties.border] = scrollBarWidth > 0 ? '1px' : '0px';
21548
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21549
21804
  header.style[args.cssProperties.padding] = scrollBarWidth > 0 ? scrollBarWidth - 1 + 'px' : '0px';
21550
21805
  }
21551
21806
  else {
21552
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21553
21807
  header.firstElementChild.style[args.cssProperties.border] = '';
21554
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21555
21808
  header.style[args.cssProperties.padding] = '';
21556
21809
  }
21557
21810
  this.setColWidth(content);
@@ -21653,6 +21906,11 @@ class Month extends ViewBase {
21653
21906
  }
21654
21907
  this.parent.notify(contentReady, {});
21655
21908
  }
21909
+ refreshHeader() {
21910
+ remove(this.element.querySelector('tbody tr'));
21911
+ this.renderHeader();
21912
+ this.parent.notify(contentReady, {});
21913
+ }
21656
21914
  wireCellEvents(element) {
21657
21915
  EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
21658
21916
  EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
@@ -22798,7 +23056,7 @@ class Agenda extends AgendaBase {
22798
23056
  for (const event of this.parent.eventsData) {
22799
23057
  delete event.generatedDates;
22800
23058
  }
22801
- let eventCollection = args.processedData;
23059
+ let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ? args.processedData : this.parent.eventsProcessed;
22802
23060
  if (this.parent.uiStateValues.isGroupAdaptive) {
22803
23061
  const resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
22804
23062
  this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
@@ -22828,6 +23086,22 @@ class Agenda extends AgendaBase {
22828
23086
  }
22829
23087
  this.parent.eventsProcessed = this.parent.eventsProcessed.concat(this.processAgendaEvents(processedData));
22830
23088
  }
23089
+ refreshHeader() {
23090
+ const tBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
23091
+ if (this.parent.activeViewOptions.group.byDate) {
23092
+ removeChildren(tBody);
23093
+ }
23094
+ else {
23095
+ remove(tBody.firstElementChild);
23096
+ }
23097
+ const agendaDate = resetTime(this.parent.selectedDate);
23098
+ const emptyTBody = createElement('tbody');
23099
+ const firstDate = new Date(agendaDate.getTime());
23100
+ const lastDate = (this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) ?
23101
+ this.getEndDateFromStartDate(firstDate) : addDays(firstDate, this.parent.agendaDaysCount);
23102
+ this.renderContent(emptyTBody, firstDate, lastDate);
23103
+ append([].slice.call(emptyTBody.childNodes), tBody);
23104
+ }
22831
23105
  renderInitialContent(tBody, agendaDate) {
22832
23106
  const emptyTBody = createElement('tbody');
22833
23107
  let firstDate = new Date(agendaDate.getTime());
@@ -22885,6 +23159,7 @@ class Agenda extends AgendaBase {
22885
23159
  const filterData = this.appointmentFiltering(agendaDate);
22886
23160
  const nTr = this.createTableRowElement(agendaDate, 'data');
22887
23161
  if (this.element.querySelector('tr[aria-rowindex="' + parseInt(nTr.getAttribute('aria-rowindex'), 10) + '"]')) {
23162
+ agendaDate = addDays(agendaDate, 1);
22888
23163
  continue;
22889
23164
  }
22890
23165
  const dTd = nTr.children[0];
@@ -22957,7 +23232,7 @@ class Agenda extends AgendaBase {
22957
23232
  this.updateHeaderText(scrollDate);
22958
23233
  }
22959
23234
  }
22960
- else if (totalHeight === scrollHeight) {
23235
+ else if (totalHeight >= (scrollHeight - 5)) {
22961
23236
  filterDate = this.getPreviousNextDate(addDays(scrollDate, 1), direction);
22962
23237
  filterData = this.appointmentFiltering(filterDate.start, filterDate.end);
22963
23238
  if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
@@ -23901,8 +24176,14 @@ class TimelineYear extends Year {
23901
24176
  if (c.colSpan) {
23902
24177
  tdEle.setAttribute('colspan', c.colSpan.toString());
23903
24178
  }
24179
+ if (c.groupIndex > -1) {
24180
+ tdEle.setAttribute('data-group-index', c.groupIndex.toString());
24181
+ }
23904
24182
  this.setResourceHeaderContent(tdEle, c);
23905
24183
  }
24184
+ if (className === LEFT_INDENT_WRAP_CLASS) {
24185
+ this.parent.renderHeaderIndentTemplate(c, tdEle);
24186
+ }
23906
24187
  const args = { elementType: c.type, element: tdEle, date: c.date, groupIndex: c.groupIndex };
23907
24188
  this.parent.trigger(renderCell, args);
23908
24189
  ntr.appendChild(tdEle);
@@ -24113,10 +24394,10 @@ class TimelineYear extends Year {
24113
24394
  });
24114
24395
  addClass([td], classList$$1);
24115
24396
  td.setAttribute('data-group-index', groupIndex.toString());
24116
- this.renderCellTemplate({ date: date, type: 'workCells', groupIndex: groupIndex }, td);
24397
+ this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, td);
24117
24398
  this.wireEvents(td, 'cell');
24118
24399
  tr.appendChild(td);
24119
- this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
24400
+ this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: td, date: date });
24120
24401
  }
24121
24402
  }
24122
24403
  if (this.parent.activeViewOptions.orientation === 'Vertical') {