@syncfusion/ej2-schedule 20.2.45 → 20.3.47

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/CHANGELOG.md +22 -0
  2. package/dist/ej2-schedule.min.js +10 -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 +603 -218
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +621 -230
  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 +16 -16
  13. package/src/recurrence-editor/recurrence-editor-model.d.ts +1 -1
  14. package/src/recurrence-editor/recurrence-editor.d.ts +1 -0
  15. package/src/recurrence-editor/recurrence-editor.js +37 -10
  16. package/src/schedule/actions/action-base.js +5 -3
  17. package/src/schedule/actions/crud.js +1 -2
  18. package/src/schedule/actions/drag.js +17 -14
  19. package/src/schedule/actions/resize.js +1 -3
  20. package/src/schedule/actions/touch.js +2 -2
  21. package/src/schedule/actions/virtual-scroll.d.ts +12 -3
  22. package/src/schedule/actions/virtual-scroll.js +206 -54
  23. package/src/schedule/base/interface.d.ts +2 -1
  24. package/src/schedule/base/schedule-model.d.ts +7 -0
  25. package/src/schedule/base/schedule.d.ts +13 -0
  26. package/src/schedule/base/schedule.js +13 -4
  27. package/src/schedule/base/util.d.ts +15 -0
  28. package/src/schedule/base/util.js +29 -3
  29. package/src/schedule/event-renderer/agenda-base.js +3 -5
  30. package/src/schedule/event-renderer/event-base.d.ts +2 -1
  31. package/src/schedule/event-renderer/event-base.js +30 -3
  32. package/src/schedule/event-renderer/month.d.ts +1 -0
  33. package/src/schedule/event-renderer/month.js +8 -6
  34. package/src/schedule/event-renderer/vertical-view.d.ts +3 -0
  35. package/src/schedule/event-renderer/vertical-view.js +32 -12
  36. package/src/schedule/event-renderer/year.js +1 -1
  37. package/src/schedule/popups/event-window.d.ts +1 -0
  38. package/src/schedule/popups/event-window.js +35 -7
  39. package/src/schedule/popups/quick-popups.js +18 -5
  40. package/src/schedule/renderer/agenda.js +1 -0
  41. package/src/schedule/renderer/header-renderer.js +3 -3
  42. package/src/schedule/renderer/month.js +25 -6
  43. package/src/schedule/renderer/renderer.js +8 -2
  44. package/src/schedule/renderer/timeline-view.js +2 -2
  45. package/src/schedule/renderer/timeline-year.d.ts +1 -0
  46. package/src/schedule/renderer/timeline-year.js +20 -12
  47. package/src/schedule/renderer/vertical-view.d.ts +1 -1
  48. package/src/schedule/renderer/vertical-view.js +48 -44
  49. package/src/schedule/renderer/view-base.d.ts +2 -0
  50. package/src/schedule/renderer/view-base.js +31 -1
  51. package/src/schedule/renderer/year.d.ts +1 -1
  52. package/src/schedule/renderer/year.js +49 -30
  53. package/styles/bootstrap-dark.css +50 -33
  54. package/styles/bootstrap.css +50 -33
  55. package/styles/bootstrap4.css +50 -33
  56. package/styles/bootstrap5-dark.css +51 -38
  57. package/styles/bootstrap5.css +51 -38
  58. package/styles/fabric-dark.css +50 -33
  59. package/styles/fabric.css +50 -33
  60. package/styles/fluent-dark.css +52 -39
  61. package/styles/fluent.css +52 -39
  62. package/styles/highcontrast-light.css +50 -33
  63. package/styles/highcontrast.css +50 -33
  64. package/styles/material-dark.css +50 -33
  65. package/styles/material.css +50 -33
  66. package/styles/recurrence-editor/_all.scss +1 -1
  67. package/styles/recurrence-editor/_bootstrap-dark-definition.scss +1 -3
  68. package/styles/recurrence-editor/_bootstrap-definition.scss +1 -3
  69. package/styles/recurrence-editor/_bootstrap4-definition.scss +1 -3
  70. package/styles/recurrence-editor/_bootstrap5-definition.scss +1 -3
  71. package/styles/recurrence-editor/_fabric-dark-definition.scss +1 -4
  72. package/styles/recurrence-editor/_fabric-definition.scss +1 -3
  73. package/styles/recurrence-editor/_fluent-definition.scss +1 -3
  74. package/styles/recurrence-editor/_fusionnew-definition.scss +1 -3
  75. package/styles/recurrence-editor/_highcontrast-definition.scss +1 -3
  76. package/styles/recurrence-editor/_highcontrast-light-definition.scss +1 -3
  77. package/styles/recurrence-editor/_layout.scss +28 -38
  78. package/styles/recurrence-editor/_material-dark-definition.scss +1 -3
  79. package/styles/recurrence-editor/_material-definition.scss +1 -3
  80. package/styles/recurrence-editor/_material3-definition.scss +1 -3
  81. package/styles/recurrence-editor/_tailwind-definition.scss +1 -3
  82. package/styles/recurrence-editor/bootstrap-dark.css +21 -27
  83. package/styles/recurrence-editor/bootstrap.css +21 -27
  84. package/styles/recurrence-editor/bootstrap4.css +21 -27
  85. package/styles/recurrence-editor/bootstrap5-dark.css +21 -27
  86. package/styles/recurrence-editor/bootstrap5.css +21 -27
  87. package/styles/recurrence-editor/fabric-dark.css +21 -27
  88. package/styles/recurrence-editor/fabric.css +21 -27
  89. package/styles/recurrence-editor/fluent-dark.css +21 -27
  90. package/styles/recurrence-editor/fluent.css +21 -27
  91. package/styles/recurrence-editor/highcontrast-light.css +21 -27
  92. package/styles/recurrence-editor/highcontrast.css +21 -27
  93. package/styles/recurrence-editor/material-dark.css +21 -27
  94. package/styles/recurrence-editor/material.css +21 -27
  95. package/styles/recurrence-editor/tailwind-dark.css +21 -27
  96. package/styles/recurrence-editor/tailwind.css +21 -27
  97. package/styles/schedule/_all.scss +1 -1
  98. package/styles/schedule/_bootstrap4-definition.scss +0 -1
  99. package/styles/schedule/_bootstrap5-definition.scss +1 -1
  100. package/styles/schedule/_fusionnew-definition.scss +1 -1
  101. package/styles/schedule/_layout.scss +57 -32
  102. package/styles/schedule/_material3-definition.scss +1 -1
  103. package/styles/schedule/_theme.scss +12 -10
  104. package/styles/schedule/bootstrap-dark.css +29 -6
  105. package/styles/schedule/bootstrap.css +29 -6
  106. package/styles/schedule/bootstrap4.css +29 -6
  107. package/styles/schedule/bootstrap5-dark.css +30 -11
  108. package/styles/schedule/bootstrap5.css +30 -11
  109. package/styles/schedule/fabric-dark.css +29 -6
  110. package/styles/schedule/fabric.css +29 -6
  111. package/styles/schedule/fluent-dark.css +31 -12
  112. package/styles/schedule/fluent.css +31 -12
  113. package/styles/schedule/highcontrast-light.css +29 -6
  114. package/styles/schedule/highcontrast.css +29 -6
  115. package/styles/schedule/icons/_bootstrap5.scss +0 -1
  116. package/styles/schedule/icons/_fluent.scss +0 -1
  117. package/styles/schedule/icons/_fusionnew.scss +0 -1
  118. package/styles/schedule/icons/_material3.scss +0 -1
  119. package/styles/schedule/icons/_tailwind.scss +0 -1
  120. package/styles/schedule/material-dark.css +29 -6
  121. package/styles/schedule/material.css +29 -6
  122. package/styles/schedule/tailwind-dark.css +29 -6
  123. package/styles/schedule/tailwind.css +29 -6
  124. package/styles/tailwind-dark.css +50 -33
  125. package/styles/tailwind.css +50 -33
@@ -1,4 +1,4 @@
1
- import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, extend, formatUnit, getDefaultDateObject, getElement, getValue, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
1
+ import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, detach, extend, formatUnit, getDefaultDateObject, getElement, getValue, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
2
2
  import { Dialog, Popup, Tooltip, createSpinner, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
3
3
  import { Toolbar, TreeView } from '@syncfusion/ej2-navigations';
4
4
  import { Calendar, DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars';
@@ -111,6 +111,23 @@ function getElementHeightFromClass(container, elementClass) {
111
111
  remove(el);
112
112
  return height;
113
113
  }
114
+ /**
115
+ * Method to get width from element
116
+ *
117
+ * @param {Element} container Accepts the DOM element
118
+ * @param {string} elementClass Accepts the element class
119
+ * @returns {number} Returns the width of the element
120
+ */
121
+ function getElementWidthFromClass(container, elementClass) {
122
+ let width = 0;
123
+ const el = createElement('div', { className: elementClass }).cloneNode();
124
+ el.style.visibility = 'hidden';
125
+ el.style.position = 'absolute';
126
+ container.appendChild(el);
127
+ width = el.getBoundingClientRect().width;
128
+ remove(el);
129
+ return width;
130
+ }
114
131
  /**
115
132
  * Method to get translateY value
116
133
  *
@@ -122,6 +139,17 @@ function getTranslateY(element) {
122
139
  return window.WebKitCSSMatrix ?
123
140
  new WebKitCSSMatrix(style.webkitTransform).m42 : 0;
124
141
  }
142
+ /**
143
+ * Method to get translateX value
144
+ *
145
+ * @param {HTMLElement | Element} element Accepts the DOM element
146
+ * @returns {number} Returns the translateX value of given element
147
+ */
148
+ function getTranslateX(element) {
149
+ const style = getComputedStyle(element);
150
+ return window.WebKitCSSMatrix ?
151
+ new WebKitCSSMatrix(style.webkitTransform).m41 : 0;
152
+ }
125
153
  /**
126
154
  * Method to get week first date
127
155
  *
@@ -398,9 +426,7 @@ function getOuterHeight(element) {
398
426
  function removeChildren(element) {
399
427
  const elementChildren = [].slice.call(element.children);
400
428
  for (const elementChild of elementChildren) {
401
- if (!elementChild.classList.contains('blazor-template')) {
402
- element.removeChild(elementChild);
403
- }
429
+ element.removeChild(elementChild);
404
430
  }
405
431
  }
406
432
  /**
@@ -1431,7 +1457,7 @@ class HeaderRenderer {
1431
1457
  firstDate = getWeekFirstDate(resetTime(this.parent.selectedDate), this.parent.firstDayOfWeek);
1432
1458
  lastDate = addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
1433
1459
  }
1434
- if (this.parent.currentView === 'Month') {
1460
+ else if (this.parent.currentView === 'Month') {
1435
1461
  const isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
1436
1462
  this.parent.activeViewOptions.numberOfWeeks > 0;
1437
1463
  firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : firstDateOfMonth(this.parent.selectedDate);
@@ -1439,10 +1465,10 @@ class HeaderRenderer {
1439
1465
  lastDateOfMonth(addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
1440
1466
  }
1441
1467
  if (!isNullOrUndefined(prevNavEle)) {
1442
- this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
1468
+ this.toolbarObj.enableItems(prevNavEle, firstDate > resetTime(this.parent.minDate));
1443
1469
  }
1444
1470
  if (!isNullOrUndefined(nextNavEle)) {
1445
- this.toolbarObj.enableItems(nextNavEle, lastDate < this.parent.maxDate);
1471
+ this.toolbarObj.enableItems(nextNavEle, lastDate < resetTime(this.parent.maxDate));
1446
1472
  }
1447
1473
  this.setCalendarMinMaxDate();
1448
1474
  }
@@ -1580,7 +1606,7 @@ class ScheduleTouch {
1580
1606
  this.touchRightDirection = this.parent.enableRtl ? 'Left' : 'Right';
1581
1607
  }
1582
1608
  scrollHandler(e) {
1583
- if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action ||
1609
+ if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action || !this.parent.allowSwiping ||
1584
1610
  (e.originalEvent && (e.originalEvent.target.classList.contains(APPOINTMENT_CLASS) ||
1585
1611
  closest(e.originalEvent.target, '.' + APPOINTMENT_CLASS)))) {
1586
1612
  return;
@@ -1635,7 +1661,7 @@ class ScheduleTouch {
1635
1661
  }
1636
1662
  }
1637
1663
  swipeHandler(e) {
1638
- if (!this.isScrollTriggered || this.parent.uiStateValues.action) {
1664
+ if (!this.isScrollTriggered || this.parent.uiStateValues.action || !this.parent.allowSwiping) {
1639
1665
  return;
1640
1666
  }
1641
1667
  this.isScrollTriggered = false;
@@ -5941,7 +5967,8 @@ class EventBase {
5941
5967
  const startDate = event[this.parent.eventFields.startTime];
5942
5968
  const endDate = event[this.parent.eventFields.endTime];
5943
5969
  const eventRule = event[this.parent.eventFields.recurrenceRule];
5944
- const duration = endDate.getTime() - startDate.getTime();
5970
+ const timeZoneDiff = endDate.getTimezoneOffset() - startDate.getTimezoneOffset();
5971
+ const duration = (endDate.getTime() - startDate.getTime()) - (timeZoneDiff * 60000);
5945
5972
  viewDate = new Date((viewDate || this.parent.activeView.startDate()).getTime() - duration);
5946
5973
  const exception = event[this.parent.eventFields.recurrenceException];
5947
5974
  let maxCount;
@@ -6133,7 +6160,7 @@ class EventBase {
6133
6160
  element.style[type] = !isNullOrUndefined(alpha) ? alphaColor(color, alpha) : color;
6134
6161
  }
6135
6162
  }
6136
- createBlockAppointmentElement(record, resIndex) {
6163
+ createBlockAppointmentElement(record, resIndex, isResourceEventTemplate) {
6137
6164
  const eventSubject = (record[this.parent.eventFields.subject] || this.parent.eventSettings.fields.subject.default);
6138
6165
  const appointmentWrapper = createElement('div', {
6139
6166
  className: BLOCK_APPOINTMENT_CLASS,
@@ -6147,7 +6174,7 @@ class EventBase {
6147
6174
  const scheduleId = this.parent.element.id + '_';
6148
6175
  const viewName = this.parent.activeViewOptions.eventTemplateName;
6149
6176
  const templateId = scheduleId + viewName + 'eventTemplate';
6150
- const templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 &&
6177
+ const templateName = 'eventTemplate' + (isResourceEventTemplate &&
6151
6178
  this.parent.currentView.indexOf('Year') === -1 ? '_' + resIndex : '');
6152
6179
  templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6153
6180
  }
@@ -6300,6 +6327,30 @@ class EventBase {
6300
6327
  }
6301
6328
  return { startDate: startTime, endDate: endTime };
6302
6329
  }
6330
+ createEventWrapper(type = '', index = 0) {
6331
+ const tr = createElement('tr');
6332
+ const levels = this.parent.activeView.colLevels.slice(-1)[0];
6333
+ for (let i = 0, len = levels.length; i < len; i++) {
6334
+ const col = levels[i];
6335
+ const appointmentWrap = createElement('td', {
6336
+ className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
6337
+ TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
6338
+ });
6339
+ if (!isNullOrUndefined(col.groupIndex)) {
6340
+ appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
6341
+ }
6342
+ if (type === '') {
6343
+ const innerWrapper = createElement('div', {
6344
+ id: APPOINTMENT_WRAPPER_CLASS + '-' + index.toString(),
6345
+ className: APPOINTMENT_WRAPPER_CLASS
6346
+ });
6347
+ appointmentWrap.appendChild(innerWrapper);
6348
+ }
6349
+ tr.appendChild(appointmentWrap);
6350
+ index = index + 1;
6351
+ }
6352
+ return tr;
6353
+ }
6303
6354
  unWireEvents() {
6304
6355
  const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6305
6356
  for (const element of appElements) {
@@ -6343,6 +6394,7 @@ class VerticalEvent extends EventBase {
6343
6394
  if (this.parent.dragAndDropModule) {
6344
6395
  this.parent.dragAndDropModule.setDragArea();
6345
6396
  }
6397
+ this.isResourceEventTemplate = this.parent.isSpecificResourceEvents();
6346
6398
  const wrapperElements = [].slice.call(this.parent.element.querySelectorAll('.' + BLOCK_APPOINTMENT_CLASS +
6347
6399
  ',.' + APPOINTMENT_CLASS + ',.' + ROW_COUNT_WRAPPER_CLASS));
6348
6400
  const isDragging = (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) ? true : false;
@@ -6364,6 +6416,9 @@ class VerticalEvent extends EventBase {
6364
6416
  if (!this.element.querySelector('.' + WORK_CELLS_CLASS)) {
6365
6417
  return;
6366
6418
  }
6419
+ if (this.parent.virtualScrollModule) {
6420
+ this.parent.virtualScrollModule.updateFocusedWorkCell();
6421
+ }
6367
6422
  this.allDayElement = [].slice.call(this.element.querySelectorAll('.' + ALLDAY_CELLS_CLASS));
6368
6423
  this.setAllDayRowHeight(0);
6369
6424
  if (this.parent.eventsProcessed.length === 0 && this.parent.blockProcessed.length === 0) {
@@ -6394,6 +6449,9 @@ class VerticalEvent extends EventBase {
6394
6449
  this.resources = (this.parent.activeViewOptions.group.resources.length > 0) ? this.parent.uiStateValues.isGroupAdaptive ?
6395
6450
  [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
6396
6451
  this.parent.resourceBase.lastResourceLevel : [];
6452
+ if (this.resources.length > 0 && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.virtualScrollModule) {
6453
+ this.resources = this.parent.resourceBase.renderedResources;
6454
+ }
6397
6455
  this.cellHeight =
6398
6456
  parseFloat(this.parent.element.querySelector('.e-content-wrap tbody tr').getBoundingClientRect().height.toFixed(2));
6399
6457
  this.dateRender[0] = this.parent.activeView.renderDates;
@@ -6410,7 +6468,7 @@ class VerticalEvent extends EventBase {
6410
6468
  return appHeight;
6411
6469
  }
6412
6470
  appendEvent(eventObj, appointmentElement, index, appLeft) {
6413
- const appointmentWrap = [].slice.call(this.element.querySelectorAll('.' + APPOINTMENT_WRAPPER_CLASS));
6471
+ const appointmentWrap = this.element.querySelector('.' + APPOINTMENT_WRAPPER_CLASS + '[id="' + APPOINTMENT_WRAPPER_CLASS + '-' + index + '"]');
6414
6472
  if (this.parent.enableRtl) {
6415
6473
  setStyleAttribute(appointmentElement, { 'right': appLeft });
6416
6474
  }
@@ -6424,13 +6482,13 @@ class VerticalEvent extends EventBase {
6424
6482
  };
6425
6483
  this.parent.trigger(eventRendered, args, (eventArgs) => {
6426
6484
  if (!eventArgs.cancel) {
6427
- appointmentWrap[index].appendChild(appointmentElement);
6485
+ appointmentWrap.appendChild(appointmentElement);
6428
6486
  }
6429
6487
  });
6430
6488
  }
6431
6489
  processBlockEvents() {
6432
6490
  const resources = this.getResourceList();
6433
- let dateCount = 0;
6491
+ let dateCount = this.getStartCount();
6434
6492
  for (const resource of resources) {
6435
6493
  const renderDates = this.dateRender[resource];
6436
6494
  for (let day = 0, length = renderDates.length; day < length; day++) {
@@ -6467,9 +6525,11 @@ class VerticalEvent extends EventBase {
6467
6525
  blockHeight = formatUnit(this.getHeight(eStart, eEnd));
6468
6526
  blockTop = formatUnit(this.getTopValue(eStart, dayIndex, resource));
6469
6527
  }
6470
- const appointmentElement = this.createBlockAppointmentElement(eventObj, resource);
6528
+ const appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
6471
6529
  setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
6472
- const index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
6530
+ const renderedIndex = this.getDayIndex(dayIndex, resource);
6531
+ const index = this.parent.activeViewOptions.group.byDate ?
6532
+ (this.resources.length * renderedIndex) + resource : dayCount;
6473
6533
  this.appendEvent(eventObj, appointmentElement, index, '0px');
6474
6534
  }
6475
6535
  }
@@ -6477,7 +6537,7 @@ class VerticalEvent extends EventBase {
6477
6537
  removeClass(this.allDayElement, ALLDAY_ROW_ANIMATE_CLASS);
6478
6538
  const eventCollection = (eventType === 'allDayEvents') ? this.sortByDateTime(this.allDayEvents) : undefined;
6479
6539
  const resources = this.getResourceList();
6480
- let dateCount = 0;
6540
+ let dateCount = this.getStartCount();
6481
6541
  let isRender;
6482
6542
  for (const resource of resources) {
6483
6543
  isRender = true;
@@ -6534,6 +6594,15 @@ class VerticalEvent extends EventBase {
6534
6594
  }
6535
6595
  }
6536
6596
  }
6597
+ getStartCount() {
6598
+ return this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.timeScale.enable ?
6599
+ parseInt(this.element.querySelector('.' + APPOINTMENT_WRAPPER_CLASS).getAttribute('id').split('-').slice(-1)[0], 10) : 0;
6600
+ }
6601
+ getDayIndex(dayIndex, resource) {
6602
+ return this.parent.activeViewOptions.group.byDate ?
6603
+ this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[resource][dayIndex]) :
6604
+ dayIndex;
6605
+ }
6537
6606
  setValues(event, resourceIndex) {
6538
6607
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6539
6608
  this.cssClass = this.resources[resourceIndex].cssClass;
@@ -6565,7 +6634,6 @@ class VerticalEvent extends EventBase {
6565
6634
  'tabindex': '0',
6566
6635
  'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record),
6567
6636
  'aria-pressed': 'false',
6568
- 'aria-grabbed': 'true',
6569
6637
  'aria-label': this.parent.getAnnouncementString(record)
6570
6638
  }
6571
6639
  });
@@ -6585,7 +6653,7 @@ class VerticalEvent extends EventBase {
6585
6653
  const viewName = this.parent.activeViewOptions.eventTemplateName;
6586
6654
  const templateId = elementId + viewName + 'eventTemplate';
6587
6655
  const resIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : resource;
6588
- const templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
6656
+ const templateName = 'eventTemplate' + (this.isResourceEventTemplate ? '_' + resIndex : '');
6589
6657
  templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6590
6658
  }
6591
6659
  else {
@@ -6757,10 +6825,11 @@ class VerticalEvent extends EventBase {
6757
6825
  if (isNullOrUndefined(this.renderedAllDayEvents[resource])) {
6758
6826
  this.renderedAllDayEvents[resource] = [];
6759
6827
  }
6828
+ const renderedIndex = this.getDayIndex(dayIndex, resource);
6760
6829
  this.renderedAllDayEvents[resource].push(extend({}, record, null, true));
6761
6830
  const allDayRow = [].slice.call(this.element.querySelector('.' + ALLDAY_ROW_CLASS).children);
6762
6831
  const wIndex = this.parent.activeViewOptions.group.byDate ?
6763
- (this.resources.length * dayIndex) + resource : dayCount;
6832
+ (this.resources.length * renderedIndex) + resource : dayCount;
6764
6833
  const eventWrapper = this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS +
6765
6834
  ':nth-child(' + (wIndex + 1) + ')');
6766
6835
  let appointmentElement;
@@ -6829,9 +6898,10 @@ class VerticalEvent extends EventBase {
6829
6898
  this.overlapEvents.push([record]);
6830
6899
  }
6831
6900
  appWidth = this.getEventWidth();
6901
+ const renderedIndex = this.getDayIndex(dayIndex, resource);
6832
6902
  const argsData = {
6833
6903
  index: appIndex, left: appLeft, width: appWidth,
6834
- day: dayIndex, dayIndex: dayCount, record: record, resource: resource
6904
+ day: renderedIndex, dayIndex: dayCount, record: record, resource: resource
6835
6905
  };
6836
6906
  const tempData = this.adjustOverlapElements(argsData);
6837
6907
  appWidth = (tempData.appWidth);
@@ -6856,7 +6926,8 @@ class VerticalEvent extends EventBase {
6856
6926
  if (!this.parent.isAdaptive && subjectElement) {
6857
6927
  subjectElement.style.maxHeight = formatUnit(maxHeight);
6858
6928
  }
6859
- const index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
6929
+ const index = this.parent.activeViewOptions.group.byDate ?
6930
+ (this.resources.length * renderedIndex) + resource : dayCount;
6860
6931
  const eventData = {};
6861
6932
  eventData[this.fields.startTime] = eventObj[this.fields.startTime];
6862
6933
  eventData[this.fields.endTime] = eventObj[this.fields.endTime];
@@ -6970,7 +7041,7 @@ class VerticalEvent extends EventBase {
6970
7041
  const dayCount = this.parent.activeViewOptions.group.byDate ?
6971
7042
  (this.resources.length * args.day) + args.resource : args.dayIndex;
6972
7043
  const element = this.element.querySelector('#e-appointment-wrapper-' + dayCount);
6973
- if (element.childElementCount > 0) {
7044
+ if (element && element.childElementCount > 0) {
6974
7045
  const eleGuid = this.overlapEvents[i][j].Guid;
6975
7046
  if (element.querySelectorAll('div[data-guid="' + eleGuid + '"]').length > 0 && eleGuid !== args.record.Guid) {
6976
7047
  const apps = element.querySelector('div[data-guid="' + eleGuid + '"]');
@@ -7143,6 +7214,7 @@ class MonthEvent extends EventBase {
7143
7214
  if (this.parent.dragAndDropModule) {
7144
7215
  this.parent.dragAndDropModule.setDragArea();
7145
7216
  }
7217
+ this.isResourceEventTemplate = this.parent.isSpecificResourceEvents();
7146
7218
  const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
7147
7219
  if (this.parent.rowAutoHeight) {
7148
7220
  this.parent.uiStateValues.top = conWrap.scrollTop;
@@ -7180,7 +7252,8 @@ class MonthEvent extends EventBase {
7180
7252
  }
7181
7253
  this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
7182
7254
  const scrollTop = conWrap.scrollTop;
7183
- if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !isNullOrUndefined(this.parent.currentAction)) {
7255
+ if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll
7256
+ && !isNullOrUndefined(this.parent.currentAction)) {
7184
7257
  conWrap.scrollTop = conWrap.scrollTop - 1;
7185
7258
  }
7186
7259
  if (this.parent.activeViewOptions.group.resources.length > 0) {
@@ -7200,7 +7273,7 @@ class MonthEvent extends EventBase {
7200
7273
  isPreventScrollUpdate: true,
7201
7274
  scrollPosition: { left: this.parent.uiStateValues.left, top: this.parent.uiStateValues.top }
7202
7275
  };
7203
- if (this.parent.virtualScrollModule) {
7276
+ if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll) {
7204
7277
  if (this.parent.currentAction) {
7205
7278
  conWrap.scrollTop = scrollTop;
7206
7279
  this.parent.currentAction = null;
@@ -7347,7 +7420,7 @@ class MonthEvent extends EventBase {
7347
7420
  const appRight = (this.parent.enableRtl) ? position : 0;
7348
7421
  const appHeight = this.cellHeight - this.monthHeaderHeight;
7349
7422
  const appTop = this.getRowTop(resIndex);
7350
- const blockElement = this.createBlockAppointmentElement(event, resIndex);
7423
+ const blockElement = this.createBlockAppointmentElement(event, resIndex, this.isResourceEventTemplate);
7351
7424
  setStyleAttribute(blockElement, {
7352
7425
  'width': appWidth + 'px', 'height': appHeight + 'px', 'left': appLeft + 'px',
7353
7426
  'right': appRight + 'px', 'top': appTop + 'px'
@@ -7418,7 +7491,7 @@ class MonthEvent extends EventBase {
7418
7491
  renderResourceEvents() {
7419
7492
  const resources = this.parent.uiStateValues.isGroupAdaptive ?
7420
7493
  [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
7421
- this.parent.resourceBase.lastResourceLevel;
7494
+ this.parent.resourceBase.renderedResources;
7422
7495
  if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
7423
7496
  for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
7424
7497
  const sourceRes = this.parent.crudModule.crudObj.sourceEvent[i];
@@ -7452,7 +7525,7 @@ class MonthEvent extends EventBase {
7452
7525
  const attrs = {
7453
7526
  'data-id': 'Appointment_' + record[this.fields.id],
7454
7527
  'role': 'button', 'tabindex': '0',
7455
- 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false', 'aria-grabbed': 'true',
7528
+ 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
7456
7529
  'aria-label': this.parent.getAnnouncementString(newRecord, eventSubject)
7457
7530
  };
7458
7531
  if (!isCloneElement) {
@@ -7477,7 +7550,7 @@ class MonthEvent extends EventBase {
7477
7550
  const scheduleId = this.parent.element.id + '_';
7478
7551
  const viewName = this.parent.activeViewOptions.eventTemplateName;
7479
7552
  const templateId = scheduleId + viewName + 'eventTemplate';
7480
- const eventTemplate = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
7553
+ const eventTemplate = 'eventTemplate' + (this.isResourceEventTemplate ? '_' + resIndex : '');
7481
7554
  templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, eventTemplate, templateId, false);
7482
7555
  }
7483
7556
  else {
@@ -8909,7 +8982,7 @@ class QuickPopups {
8909
8982
  'data-id': '' + eventData[fields.id],
8910
8983
  'data-guid': eventData.Guid, 'role': 'button', 'tabindex': '0',
8911
8984
  'aria-disabled': this.parent.eventBase.getReadonlyAttribute(eventData),
8912
- 'aria-pressed': 'false', 'aria-grabbed': 'true', 'aria-label': this.parent.getAnnouncementString(eventData)
8985
+ 'aria-pressed': 'false', 'aria-label': this.parent.getAnnouncementString(eventData)
8913
8986
  }
8914
8987
  });
8915
8988
  let templateElement;
@@ -9029,6 +9102,9 @@ class QuickPopups {
9029
9102
  }
9030
9103
  return;
9031
9104
  }
9105
+ else if (this.quickPopup.element) {
9106
+ this.destroyPopupButtons('quickPopup');
9107
+ }
9032
9108
  const temp = {};
9033
9109
  temp[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;
9034
9110
  temp[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;
@@ -9100,6 +9176,9 @@ class QuickPopups {
9100
9176
  if (isSameTarget) {
9101
9177
  return;
9102
9178
  }
9179
+ else if (this.quickPopup.element) {
9180
+ this.destroyPopupButtons('quickPopup');
9181
+ }
9103
9182
  const eventData = events.event;
9104
9183
  const quickEventPopup = createElement('div', { className: EVENT_POPUP_CLASS });
9105
9184
  quickEventPopup.appendChild(this.getPopupHeader('Event', eventData));
@@ -9635,7 +9714,10 @@ class QuickPopups {
9635
9714
  this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
9636
9715
  }
9637
9716
  else {
9638
- this.quickPopup.offsetX = 10;
9717
+ const isVirtualScroll = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll
9718
+ && !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
9719
+ const conTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
9720
+ this.quickPopup.offsetX = isVirtualScroll && !this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
9639
9721
  this.quickPopup.collision = { X: this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
9640
9722
  this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: this.parent.enableRtl ? 'bottom' : 'top' };
9641
9723
  this.quickPopup.dataBind();
@@ -9643,7 +9725,11 @@ class QuickPopups {
9643
9725
  const collide = isCollide(this.quickPopup.element, this.parent.element);
9644
9726
  if (collide.indexOf(this.parent.enableRtl ? 'left' : 'right') > -1) {
9645
9727
  this.quickPopup.offsetX = -target.offsetWidth - 10 - this.quickPopup.element.offsetWidth;
9728
+ if (isVirtualScroll && !this.parent.enableRtl) {
9729
+ this.quickPopup.offsetX = getTranslateX(conTable) + this.quickPopup.offsetX;
9730
+ }
9646
9731
  this.quickPopup.dataBind();
9732
+ this.quickPopup.refreshPosition(null, true);
9647
9733
  const leftCollide = isCollide(this.quickPopup.element, this.parent.element);
9648
9734
  if (leftCollide.indexOf('left') > -1) {
9649
9735
  this.quickPopup.position = { X: 'center', Y: 'center' };
@@ -9652,9 +9738,8 @@ class QuickPopups {
9652
9738
  this.quickPopup.dataBind();
9653
9739
  }
9654
9740
  }
9655
- if (this.parent.virtualScrollModule && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
9656
- const element = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
9657
- const translateY = getTranslateY(element);
9741
+ if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
9742
+ const translateY = getTranslateY(conTable);
9658
9743
  this.quickPopup.offsetY = translateY;
9659
9744
  this.quickPopup.dataBind();
9660
9745
  }
@@ -9907,6 +9992,7 @@ class QuickPopups {
9907
9992
  this.destroyQuickPopup();
9908
9993
  this.destroyMorePopup();
9909
9994
  this.destroyQuickDialog();
9995
+ this.dialogEvent = null;
9910
9996
  this.parent = null;
9911
9997
  this.l10n = null;
9912
9998
  this.isCrudAction = null;
@@ -10890,30 +10976,47 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10890
10976
  destroyComponents() {
10891
10977
  if (!this.recurrenceCount.isDestroyed) {
10892
10978
  this.recurrenceCount.destroy();
10979
+ this.recurrenceCount = null;
10893
10980
  }
10894
10981
  if (!this.monthDate.isDestroyed) {
10895
10982
  this.monthDate.destroy();
10983
+ this.monthDate = null;
10896
10984
  }
10897
10985
  if (!this.repeatInterval.isDestroyed) {
10898
10986
  this.repeatInterval.destroy();
10987
+ this.repeatInterval = null;
10899
10988
  }
10900
10989
  if (!this.untilDateObj.isDestroyed) {
10901
10990
  this.untilDateObj.destroy();
10991
+ this.untilDateObj = null;
10902
10992
  }
10903
10993
  if (!this.repeatType.isDestroyed) {
10904
10994
  this.repeatType.destroy();
10995
+ this.repeatType = null;
10905
10996
  }
10906
10997
  if (!this.endType.isDestroyed) {
10907
10998
  this.endType.destroy();
10999
+ this.endType = null;
10908
11000
  }
10909
11001
  if (!this.monthWeekPos.isDestroyed) {
10910
11002
  this.monthWeekPos.destroy();
11003
+ this.monthWeekPos = null;
10911
11004
  }
10912
11005
  if (!this.monthWeekDays.isDestroyed) {
10913
11006
  this.monthWeekDays.destroy();
11007
+ this.monthWeekDays = null;
10914
11008
  }
10915
11009
  if (!this.monthValue.isDestroyed) {
10916
11010
  this.monthValue.destroy();
11011
+ this.monthValue = null;
11012
+ }
11013
+ if (!this.onMonthDay.isDestroyed) {
11014
+ this.onMonthDay.destroy();
11015
+ this.onMonthDay = null;
11016
+ }
11017
+ if (!this.onWeekDay.isDestroyed) {
11018
+ this.onWeekDay.destroy();
11019
+ this.onWeekDay = null;
10917
11020
  }
10918
11021
  this.dayButtons.forEach((element) => {
10919
11022
  if (!element.isDestroyed) {
@@ -11007,21 +11110,30 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
11007
11110
  this.renderStatus = true;
11008
11111
  this.triggerChangeEvent();
11009
11112
  }
11113
+ detachInputs() {
11114
+ const inputElements = [].slice.call(this.element.querySelectorAll('input'));
11115
+ for (const element of inputElements) {
11116
+ detach(element);
11117
+ }
11118
+ }
11010
11119
  /**
11011
11120
  * Destroys the widget.
11012
11121
  *
11013
11122
  * @returns {void}
11014
11123
  */
11015
11124
  destroy() {
11016
- this.destroyComponents();
11017
- super.destroy();
11018
- let removeClasses = ['e-' + this.getModuleName()];
11019
- if (this.cssClass) {
11020
- removeClasses = removeClasses.concat(this.cssClass.split(' '));
11021
- }
11022
- removeClass([this.element], removeClasses);
11023
- while (this.element.firstElementChild) {
11024
- this.element.removeChild(this.element.firstElementChild);
11125
+ if (!this.isDestroyed) {
11126
+ this.destroyComponents();
11127
+ super.destroy();
11128
+ let removeClasses = ['e-' + this.getModuleName()];
11129
+ if (this.cssClass) {
11130
+ removeClasses = removeClasses.concat(this.cssClass.split(' '));
11131
+ }
11132
+ removeClass([this.element], removeClasses);
11133
+ this.detachInputs();
11134
+ while (this.element.firstElementChild) {
11135
+ this.element.removeChild(this.element.firstElementChild);
11136
+ }
11025
11137
  }
11026
11138
  }
11027
11139
  /**
@@ -11394,6 +11506,7 @@ class EventWindow {
11394
11506
  const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
11395
11507
  append(tempEle, form);
11396
11508
  this.parent.renderTemplates();
11509
+ this.applyFormValidation();
11397
11510
  }
11398
11511
  else {
11399
11512
  form.appendChild(this.getDefaultEventWindowContent());
@@ -11934,12 +12047,26 @@ class EventWindow {
11934
12047
  const getValidationRule = (rules) => (rules && Object.keys(rules).length > 0) ? rules : undefined;
11935
12048
  const form = this.element.querySelector('.' + FORM_CLASS);
11936
12049
  const rules = {};
11937
- rules[this.parent.eventSettings.fields.subject.name] = getValidationRule(this.parent.eventSettings.fields.subject.validation);
11938
- rules[this.parent.eventSettings.fields.location.name] = getValidationRule(this.parent.eventSettings.fields.location.validation);
11939
- rules[this.parent.eventSettings.fields.startTime.name] = getValidationRule(this.parent.eventSettings.fields.startTime.validation);
11940
- rules[this.parent.eventSettings.fields.endTime.name] = getValidationRule(this.parent.eventSettings.fields.endTime.validation);
11941
- rules[this.parent.eventSettings.fields.description.name] =
11942
- getValidationRule(this.parent.eventSettings.fields.description.validation);
12050
+ const subjectRule = getValidationRule(this.parent.eventSettings.fields.subject.validation);
12051
+ if (!isNullOrUndefined(subjectRule)) {
12052
+ rules[this.parent.eventSettings.fields.subject.name] = subjectRule;
12053
+ }
12054
+ const locationRule = getValidationRule(this.parent.eventSettings.fields.location.validation);
12055
+ if (!isNullOrUndefined(locationRule)) {
12056
+ rules[this.parent.eventSettings.fields.location.name] = locationRule;
12057
+ }
12058
+ const startTimeRule = getValidationRule(this.parent.eventSettings.fields.startTime.validation);
12059
+ if (!isNullOrUndefined(startTimeRule)) {
12060
+ rules[this.parent.eventSettings.fields.startTime.name] = startTimeRule;
12061
+ }
12062
+ const endTimeRule = getValidationRule(this.parent.eventSettings.fields.endTime.validation);
12063
+ if (!isNullOrUndefined(endTimeRule)) {
12064
+ rules[this.parent.eventSettings.fields.endTime.name] = endTimeRule;
12065
+ }
12066
+ const descriptionRule = getValidationRule(this.parent.eventSettings.fields.description.validation);
12067
+ if (!isNullOrUndefined(descriptionRule)) {
12068
+ rules[this.parent.eventSettings.fields.description.name] = descriptionRule;
12069
+ }
11943
12070
  this.fieldValidator = new FieldValidator();
11944
12071
  this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
11945
12072
  }
@@ -12866,6 +12993,12 @@ class EventWindow {
12866
12993
  this.buttonObj.destroy();
12867
12994
  }
12868
12995
  }
12996
+ detachComponents() {
12997
+ const formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
12998
+ for (const element of formElements) {
12999
+ detach(element);
13000
+ }
13001
+ }
12869
13002
  destroy(isIgnore) {
12870
13003
  if (this.parent && !this.parent.isDestroyed) {
12871
13004
  this.parent.resetTemplates(['editorTemplate']);
@@ -12873,6 +13006,7 @@ class EventWindow {
12873
13006
  this.destroyComponents();
12874
13007
  if (this.recurrenceEditor) {
12875
13008
  this.recurrenceEditor.destroy();
13009
+ detach(this.recurrenceEditor.element);
12876
13010
  this.recurrenceEditor = null;
12877
13011
  }
12878
13012
  if (this.fieldValidator) {
@@ -12883,8 +13017,12 @@ class EventWindow {
12883
13017
  this.repeatDialogObject.destroy();
12884
13018
  this.repeatDialogObject = null;
12885
13019
  }
13020
+ this.detachComponents();
12886
13021
  if (this.dialogObject) {
12887
13022
  if (this.dialogObject.element) {
13023
+ const form = this.dialogObject.element.querySelector('form');
13024
+ removeChildren(form);
13025
+ detach(form);
12888
13026
  EventHandler.remove(this.dialogObject.element, 'keydown', this.preventEventSave);
12889
13027
  }
12890
13028
  this.dialogObject.destroy();
@@ -12901,6 +13039,7 @@ class EventWindow {
12901
13039
  this.buttonObj = null;
12902
13040
  this.repeatStatus = null;
12903
13041
  this.eventWindowTime = null;
13042
+ this.dialogEvent = null;
12904
13043
  }
12905
13044
  }
12906
13045
  }
@@ -12915,7 +13054,7 @@ class VirtualScroll {
12915
13054
  this.bufferCount = 3;
12916
13055
  this.renderedLength = 0;
12917
13056
  this.averageRowHeight = 0;
12918
- this.isScrollHeightNull = true;
13057
+ this.startIndex = 0;
12919
13058
  this.parent = parent;
12920
13059
  this.addEventListener();
12921
13060
  }
@@ -12933,37 +13072,19 @@ class VirtualScroll {
12933
13072
  }
12934
13073
  getRenderedCount() {
12935
13074
  this.setItemSize();
12936
- return Math.ceil(this.parent.element.clientHeight / this.itemSize) + this.bufferCount;
12937
- }
12938
- setTranslateValue() {
12939
- const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
12940
- const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
12941
- const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
12942
- const timeIndicator = this.parent.element.querySelector('.' + CURRENT_TIMELINE_CLASS);
12943
- this.renderVirtualTrackHeight(conWrap, resWrap);
12944
- this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
12945
- }
12946
- renderVirtualTrackHeight(contentWrap, resourceWrap) {
12947
- this.parent.resourceBase.setExpandedResources();
12948
- if (this.isScrollHeightNull) {
12949
- const wrap = createElement('div', { className: VIRTUAL_TRACK_CLASS });
12950
- const resWrap = [].slice.call((resourceWrap).querySelectorAll('table td'));
12951
- const startIndex = parseInt(resWrap[0].getAttribute('data-group-index'), 10);
12952
- const endIndex = parseInt(resWrap[resWrap.length - 1].getAttribute('data-group-index'), 10);
12953
- this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources.filter((resource) => (resource.groupIndex >= startIndex && resource.groupIndex <= endIndex));
12954
- this.setItemSize();
12955
- wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
12956
- this.isScrollHeightNull = false;
12957
- const virtual = this.parent.element.querySelector('.' + VIRTUAL_TRACK_CLASS);
12958
- if (!isNullOrUndefined(virtual)) {
12959
- remove(virtual);
12960
- }
12961
- contentWrap.appendChild(wrap);
12962
- }
13075
+ const containerSize = this.isHorizontalScroll ? this.parent.element.clientWidth : this.parent.element.clientHeight;
13076
+ this.renderedLength = Math.ceil(containerSize / this.itemSize) + this.bufferCount;
13077
+ return this.renderedLength;
12963
13078
  }
12964
13079
  renderVirtualTrack(contentWrap) {
12965
13080
  const wrap = createElement('div', { className: VIRTUAL_TRACK_CLASS });
12966
- wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
13081
+ if (this.isHorizontalScroll) {
13082
+ const colCount = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1].length;
13083
+ wrap.style.width = (colCount * this.itemSize) + 'px';
13084
+ }
13085
+ else {
13086
+ wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
13087
+ }
12967
13088
  contentWrap.appendChild(wrap);
12968
13089
  }
12969
13090
  updateVirtualScrollHeight() {
@@ -13001,12 +13122,19 @@ class VirtualScroll {
13001
13122
  }
13002
13123
  }
13003
13124
  setItemSize() {
13004
- this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13125
+ if (this.isHorizontalScroll) {
13126
+ this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13127
+ }
13128
+ else {
13129
+ this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13130
+ }
13005
13131
  }
13006
13132
  renderEvents() {
13007
13133
  this.setTabIndex();
13008
13134
  this.parent.refreshEvents(false);
13009
- this.parent.notify(contentReady, {});
13135
+ if (this.parent.currentView !== 'Month') {
13136
+ this.parent.notify(contentReady, {});
13137
+ }
13010
13138
  this.parent.hideSpinner();
13011
13139
  }
13012
13140
  virtualScrolling() {
@@ -13014,31 +13142,63 @@ class VirtualScroll {
13014
13142
  this.parent.quickPopup.quickPopupHide();
13015
13143
  this.parent.quickPopup.morePopup.hide();
13016
13144
  }
13017
- const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
13018
13145
  const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
13019
- const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
13020
- const timeIndicator = this.parent.element.querySelector('.' + CURRENT_TIMELINE_CLASS);
13021
- const conTable = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
13022
- this.renderedLength = resWrap.querySelector('tbody').children.length;
13023
- const firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);
13024
- const scrollHeight = this.parent.rowAutoHeight ?
13025
- (conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;
13026
- addClass([conWrap], 'e-transition');
13146
+ if (this.isHorizontalScroll) {
13147
+ this.horizontalScrolling(conWrap);
13148
+ }
13149
+ else {
13150
+ const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
13151
+ const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
13152
+ const timeIndicator = this.parent.element.querySelector('.' + CURRENT_TIMELINE_CLASS);
13153
+ const conTable = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
13154
+ addClass([conWrap], 'e-transition');
13155
+ this.renderedLength = resWrap.querySelector('tbody').children.length;
13156
+ const firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);
13157
+ const scrollHeight = this.parent.rowAutoHeight ?
13158
+ (conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;
13159
+ let resCollection = [];
13160
+ if ((conWrap.scrollTop) - this.translateY < 0) {
13161
+ resCollection = this.upScroll(conWrap, firstTDIndex);
13162
+ }
13163
+ else if (conWrap.scrollTop - this.translateY > scrollHeight) {
13164
+ resCollection = this.downScroll(conWrap, firstTDIndex);
13165
+ }
13166
+ if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
13167
+ this.parent.showSpinner();
13168
+ const selectedEle = this.parent.getSelectedElements();
13169
+ this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13170
+ this.updateContent(resWrap, conWrap, eventWrap, resCollection);
13171
+ this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
13172
+ if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
13173
+ this.parent.dragAndDropModule.navigationWrapper();
13174
+ }
13175
+ window.clearTimeout(this.timeValue);
13176
+ this.timeValue = window.setTimeout(() => { this.renderEvents(); }, 250);
13177
+ }
13178
+ }
13179
+ }
13180
+ horizontalScrolling(conWrap) {
13027
13181
  let resCollection = [];
13028
- if ((conWrap.scrollTop) - this.translateY < 0) {
13029
- resCollection = this.upScroll(conWrap, firstTDIndex);
13182
+ const scrollWidth = this.bufferCount * this.itemSize;
13183
+ if (Math.abs(conWrap.scrollLeft) - Math.abs(this.translateY) < 0) {
13184
+ resCollection = this.leftScroll(conWrap);
13030
13185
  }
13031
- else if (conWrap.scrollTop - this.translateY > scrollHeight) {
13032
- resCollection = this.downScroll(conWrap, firstTDIndex);
13186
+ else if (Math.abs(conWrap.scrollLeft) - Math.abs(this.translateY) > scrollWidth) {
13187
+ resCollection = this.rightScroll(conWrap);
13033
13188
  }
13034
13189
  if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
13035
- this.parent.showSpinner();
13036
- const selectedEle = this.parent.getSelectedElements();
13037
- this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13038
- this.updateContent(resWrap, conWrap, eventWrap, resCollection);
13039
- this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
13040
- if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
13041
- this.parent.dragAndDropModule.navigationWrapper();
13190
+ if (this.parent.resourceBase.expandedResources.length !== resCollection.length ||
13191
+ this.parent.resourceBase.expandedResources[0] !== resCollection[0] ||
13192
+ this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1] !==
13193
+ resCollection[resCollection.length - 1]) {
13194
+ this.parent.showSpinner();
13195
+ const colLevels = this.parent.activeView.colLevels.slice(0);
13196
+ this.updateHorizontalContent(conWrap, resCollection);
13197
+ setStyleAttribute(conWrap.querySelector('table'), { transform: `translateX(${this.translateY}px)` });
13198
+ this.parent.activeView.colLevels = colLevels;
13199
+ if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
13200
+ this.parent.dragAndDropModule.navigationWrapper();
13201
+ }
13042
13202
  }
13043
13203
  window.clearTimeout(this.timeValue);
13044
13204
  this.timeValue = window.setTimeout(() => { this.renderEvents(); }, 250);
@@ -13084,6 +13244,83 @@ class VirtualScroll {
13084
13244
  this.translateY = conWrap.scrollTop;
13085
13245
  return nextSetCollection;
13086
13246
  }
13247
+ leftScroll(conWrap) {
13248
+ let index = 0;
13249
+ index = (~~(Math.abs(conWrap.scrollLeft) / this.itemSize) + Math.ceil(conWrap.clientWidth / this.itemSize)) - this.renderedLength;
13250
+ index = (index > 0) ? index : 0;
13251
+ return this.getCollection(index, index + this.renderedLength);
13252
+ }
13253
+ rightScroll(conWrap) {
13254
+ const lastLevel = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1];
13255
+ let nextSetIndex = 0;
13256
+ nextSetIndex = ~~(Math.abs(conWrap.scrollLeft) / this.itemSize);
13257
+ let lastIndex = nextSetIndex + this.renderedLength;
13258
+ lastIndex = (lastIndex > lastLevel.length - 1) ? lastLevel.length - 1 : lastIndex;
13259
+ return this.getCollection(lastIndex - this.renderedLength, lastIndex);
13260
+ }
13261
+ getCollection(startIndex, endIndex) {
13262
+ this.translateY = startIndex * this.itemSize;
13263
+ const lastLevel = this.getResCollection(startIndex, endIndex);
13264
+ if (this.parent.enableRtl) {
13265
+ this.translateY = -this.translateY;
13266
+ }
13267
+ return lastLevel;
13268
+ }
13269
+ getResCollection(startIndex, endIndex) {
13270
+ const lastLevel = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1];
13271
+ let resCollection = [];
13272
+ const index = { startIndex: 0, endIndex: 0 };
13273
+ if (this.parent.activeViewOptions.group.byDate) {
13274
+ if (lastLevel[startIndex].date.getTime() === this.parent.resourceBase.expandedResources[0].date.getTime() &&
13275
+ lastLevel[endIndex].date.getTime() ===
13276
+ this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].date.getTime()) {
13277
+ return this.parent.resourceBase.expandedResources;
13278
+ }
13279
+ resCollection = this.getByDateCollection(lastLevel[startIndex], lastLevel[endIndex], index);
13280
+ this.setRenderedDates(resCollection);
13281
+ }
13282
+ else {
13283
+ if (lastLevel[startIndex].groupIndex === this.parent.resourceBase.expandedResources[0].groupIndex &&
13284
+ lastLevel[endIndex].groupIndex ===
13285
+ this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex) {
13286
+ return this.parent.resourceBase.expandedResources;
13287
+ }
13288
+ resCollection = this.getByIdCollection(lastLevel[startIndex], lastLevel[endIndex], index);
13289
+ }
13290
+ if (this.parent.currentView !== 'Month') {
13291
+ this.startIndex = index.startIndex;
13292
+ resCollection = lastLevel.slice(index.startIndex, index.endIndex);
13293
+ }
13294
+ this.translateY = index.startIndex * this.itemSize;
13295
+ return resCollection;
13296
+ }
13297
+ getByDateCollection(firstItem, lastItem, index) {
13298
+ const resCollection = this.parent.activeView.colLevels[0].filter((data) => firstItem.date.getTime() <= data.date.getTime() &&
13299
+ data.date.getTime() <= lastItem.date.getTime());
13300
+ this.setStartEndIndex(this.parent.activeView.colLevels[0], resCollection[0], resCollection[resCollection.length - 1], index);
13301
+ return resCollection;
13302
+ }
13303
+ getByIdCollection(firstItem, lastItem, index) {
13304
+ const resCollection = this.parent.resourceBase.lastResourceLevel.filter((data) => firstItem.groupIndex <= data.groupIndex && data.groupIndex <= lastItem.groupIndex);
13305
+ this.parent.resourceBase.renderedResources = resCollection;
13306
+ this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel, resCollection[0], resCollection[resCollection.length - 1], index);
13307
+ return resCollection;
13308
+ }
13309
+ setStartEndIndex(data, firstItem, lastItem, colIndex) {
13310
+ let index = 0;
13311
+ data.filter((data) => {
13312
+ if (firstItem === data) {
13313
+ colIndex.startIndex = index;
13314
+ }
13315
+ else if (lastItem === data) {
13316
+ colIndex.endIndex = index + data.colSpan;
13317
+ }
13318
+ index += data.colSpan;
13319
+ });
13320
+ if (firstItem === lastItem) {
13321
+ colIndex.endIndex = colIndex.startIndex + lastItem.colSpan;
13322
+ }
13323
+ }
13087
13324
  updateContent(resWrap, conWrap, eventWrap, resCollection) {
13088
13325
  const renderedLength = resWrap.querySelector('tbody').children.length;
13089
13326
  if (document.activeElement && document.activeElement.classList.contains(RESOURCE_CELLS_CLASS)) {
@@ -13103,6 +13340,45 @@ class VirtualScroll {
13103
13340
  append(contentRows, conWrap.querySelector('tbody'));
13104
13341
  append(eventRows, eventWrap);
13105
13342
  }
13343
+ updateHorizontalContent(conWrap, resCollection) {
13344
+ this.parent.resourceBase.expandedResources = resCollection;
13345
+ const selectedEle = this.parent.getSelectedElements();
13346
+ this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13347
+ const renderedLength = conWrap.querySelectorAll('tbody tr').length;
13348
+ for (let i = 0; i < renderedLength; i++) {
13349
+ remove(conWrap.querySelector('tbody tr'));
13350
+ }
13351
+ if (this.parent.currentView === 'Month') {
13352
+ if (this.parent.activeViewOptions.group.byDate) {
13353
+ this.parent.activeView.colLevels[0] = resCollection;
13354
+ }
13355
+ else {
13356
+ this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
13357
+ }
13358
+ const contentRows = this.parent.activeView.getContentRows();
13359
+ append(contentRows, conWrap.querySelector('tbody'));
13360
+ }
13361
+ else {
13362
+ const col = [].slice.call(conWrap.querySelector('colgroup').children);
13363
+ for (let i = 0; i < col.length; i++) {
13364
+ remove(col[i]);
13365
+ }
13366
+ this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
13367
+ const contentRows = this.parent.activeView.getContentRows();
13368
+ const table = conWrap.querySelector('table');
13369
+ const thead = conWrap.querySelector('thead');
13370
+ const colGroupEle = conWrap.querySelector('colgroup');
13371
+ resCollection.forEach(() => {
13372
+ colGroupEle.appendChild(createElement('col'));
13373
+ });
13374
+ thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
13375
+ if (this.parent.activeViewOptions.timeScale.enable) {
13376
+ thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
13377
+ }
13378
+ prepend([thead], table);
13379
+ append(contentRows, conWrap.querySelector('tbody'));
13380
+ }
13381
+ }
13106
13382
  getBufferCollection(startIndex, endIndex) {
13107
13383
  return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
13108
13384
  }
@@ -13125,6 +13401,17 @@ class VirtualScroll {
13125
13401
  this.focusedEle = null;
13126
13402
  }
13127
13403
  }
13404
+ setRenderedDates(resCollection) {
13405
+ if (this.parent.currentView !== 'Month') {
13406
+ const dateCol = resCollection.map((x) => x.date);
13407
+ this.parent.resourceBase.renderedResources.forEach((x) => x.renderDates = dateCol);
13408
+ }
13409
+ else {
13410
+ const dateCol = resCollection.map((x) => x.date.getDay());
13411
+ const renderDates = this.parent.activeView.renderDates.filter((x) => dateCol.indexOf(x.getDay()) >= 0);
13412
+ this.parent.resourceBase.renderedResources.forEach((x) => x.renderDates = renderDates);
13413
+ }
13414
+ }
13128
13415
  setTabIndex() {
13129
13416
  const resColWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
13130
13417
  const resCells = [].slice.call(this.parent.element.querySelectorAll('.' + RESOURCE_CELLS_CLASS));
@@ -13143,6 +13430,7 @@ class VirtualScroll {
13143
13430
  }
13144
13431
  destroy() {
13145
13432
  this.removeEventListener();
13433
+ this.focusedEle = null;
13146
13434
  }
13147
13435
  }
13148
13436
 
@@ -13234,12 +13522,18 @@ class Render {
13234
13522
  this.parent.virtualScrollModule.destroy();
13235
13523
  this.parent.virtualScrollModule = null;
13236
13524
  }
13237
- if (this.parent.currentView.indexOf('Timeline') !== -1 && (this.parent.currentView.indexOf('Year') === -1 ||
13525
+ if ((['Agenda', 'Year'].indexOf(this.parent.currentView) === -1 ||
13238
13526
  (this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
13239
13527
  && this.parent.activeViewOptions.allowVirtualScrolling
13240
13528
  && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
13241
13529
  this.parent.virtualScrollModule = new VirtualScroll(this.parent);
13242
- this.parent.uiStateValues.top = 0;
13530
+ if (this.parent.activeView.isTimelineView()) {
13531
+ this.parent.uiStateValues.top = 0;
13532
+ }
13533
+ else {
13534
+ this.parent.virtualScrollModule.isHorizontalScroll = true;
13535
+ this.parent.uiStateValues.left = 0;
13536
+ }
13243
13537
  }
13244
13538
  this.updateHeader();
13245
13539
  this.parent.activeView.renderLayout(CURRENT_PANEL_CLASS);
@@ -13457,8 +13751,7 @@ class Crud {
13457
13751
  if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element) {
13458
13752
  this.parent.resizeModule.actionObj.element.style.display = 'none';
13459
13753
  }
13460
- if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.activeViewOptions.group.allowGroupEdit
13461
- && !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {
13754
+ if (this.parent.isSpecificResourceEvents()) {
13462
13755
  if (args.requestType === 'eventCreated' || args.requestType === 'eventRemoved') {
13463
13756
  this.crudObj.isCrudAction = true;
13464
13757
  this.crudObj.sourceEvent = [];
@@ -16536,6 +16829,16 @@ let Schedule = class Schedule extends Component {
16536
16829
  append(indentTemplate, td);
16537
16830
  }
16538
16831
  }
16832
+ /**
16833
+ * Method to check for refreshing the targeted resource row events.
16834
+ *
16835
+ * @returns {boolean} Returns the boolean value
16836
+ * @private
16837
+ */
16838
+ isSpecificResourceEvents() {
16839
+ return this.activeViewOptions.group.resources.length > 0 && !this.activeViewOptions.group.allowGroupEdit &&
16840
+ !this.rowAutoHeight && !this.virtualScrollModule && this.activeViewOptions.group.byGroupID;
16841
+ }
16539
16842
  unWireEvents() {
16540
16843
  EventHandler.remove(window, 'resize', this.onScheduleResize);
16541
16844
  EventHandler.remove(window, 'orientationchange', this.onScheduleResize);
@@ -17795,10 +18098,6 @@ let Schedule = class Schedule extends Component {
17795
18098
  this.hideSpinner();
17796
18099
  this.unWireEvents();
17797
18100
  this.destroyHeaderModule();
17798
- if (this.eventTooltip) {
17799
- this.eventTooltip.destroy();
17800
- this.eventTooltip = null;
17801
- }
17802
18101
  if (this.eventBase) {
17803
18102
  this.eventBase.destroy();
17804
18103
  this.eventBase = null;
@@ -17872,6 +18171,9 @@ __decorate([
17872
18171
  __decorate([
17873
18172
  Property(true)
17874
18173
  ], Schedule.prototype, "showTimeIndicator", void 0);
18174
+ __decorate([
18175
+ Property(true)
18176
+ ], Schedule.prototype, "allowSwiping", void 0);
17875
18177
  __decorate([
17876
18178
  Property('Week')
17877
18179
  ], Schedule.prototype, "currentView", void 0);
@@ -18193,7 +18495,7 @@ class ActionBase {
18193
18495
  const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
18194
18496
  let trElement = [].slice.call(viewElement.querySelector('tr').children);
18195
18497
  if (!this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0 &&
18196
- !this.parent.isAdaptive && !this.parent.enableAdaptiveUI) {
18498
+ !this.parent.isAdaptive && !this.parent.enableAdaptiveUI && !this.parent.virtualScrollModule) {
18197
18499
  trElement = this.getResourceElements(trElement);
18198
18500
  }
18199
18501
  const leftOffset = trElement[0].getBoundingClientRect();
@@ -18285,7 +18587,7 @@ class ActionBase {
18285
18587
  let originalElement;
18286
18588
  const guid = element.getAttribute('data-guid');
18287
18589
  const isMorePopup = element.offsetParent && element.offsetParent.classList.contains(MORE_EVENT_POPUP_CLASS);
18288
- if (isMorePopup || this.parent.activeView.isTimelineView()) {
18590
+ if (isMorePopup || this.parent.activeView.isTimelineView() || (this.actionObj.action !== 'resize' && this.parent.virtualScrollModule)) {
18289
18591
  originalElement = [].slice.call(this.parent.element.querySelectorAll('[data-guid="' + guid + '"]'));
18290
18592
  }
18291
18593
  else {
@@ -18498,7 +18800,9 @@ class ActionBase {
18498
18800
  let workDays = this.parent.activeViewOptions.workDays;
18499
18801
  let groupOrder;
18500
18802
  if (this.parent.activeViewOptions.group.resources.length > 0) {
18501
- const resources = this.parent.resourceBase.lastResourceLevel.
18803
+ const renderedResource = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll ?
18804
+ this.parent.resourceBase.renderedResources : this.parent.resourceBase.lastResourceLevel;
18805
+ const resources = renderedResource.
18502
18806
  filter((res) => res.groupIndex === this.actionObj.groupIndex);
18503
18807
  dateRender = resources[0].renderDates;
18504
18808
  const elementSelector = `.${WORK_CELLS_CLASS}[data-group-index="${this.actionObj.groupIndex}"]`;
@@ -18821,9 +19125,7 @@ class Resize extends ActionBase {
18821
19125
  if (resizeEventArgs.cancel) {
18822
19126
  return;
18823
19127
  }
18824
- if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.rowAutoHeight
18825
- && !this.parent.activeViewOptions.group.allowGroupEdit && !this.parent.virtualScrollModule
18826
- && this.parent.activeViewOptions.group.byGroupID) {
19128
+ if (this.parent.isSpecificResourceEvents()) {
18827
19129
  this.parent.crudModule.crudObj.sourceEvent =
18828
19130
  [this.parent.resourceBase.lastResourceLevel[parseInt(resizeEventArgs.element.getAttribute('data-group-index'), 10)]];
18829
19131
  this.parent.crudModule.crudObj.targetEvent = this.parent.crudModule.crudObj.sourceEvent;
@@ -19433,7 +19735,7 @@ class YearEvent extends TimelineEvent {
19433
19735
  'data-id': 'Appointment_' + record[this.fields.id],
19434
19736
  'data-guid': record.Guid,
19435
19737
  'role': 'button', 'tabindex': '0',
19436
- 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false', 'aria-grabbed': 'true',
19738
+ 'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
19437
19739
  'aria-label': this.parent.getAnnouncementString(record)
19438
19740
  }
19439
19741
  });
@@ -19931,7 +20233,6 @@ class DragAndDrop extends ActionBase {
19931
20233
  this.actionObj.scrollInterval = null;
19932
20234
  this.actionClass('removeClass');
19933
20235
  this.parent.uiStateValues.action = false;
19934
- this.actionObj.action = null;
19935
20236
  if (this.isAllowDrop(e)) {
19936
20237
  return;
19937
20238
  }
@@ -19941,12 +20242,12 @@ class DragAndDrop extends ActionBase {
19941
20242
  cancel: false, data: this.getChangedData(this.updatedData), selectedData: this.updatedData,
19942
20243
  event: e, element: this.actionObj.element, target: target
19943
20244
  };
20245
+ this.actionObj.action = null;
19944
20246
  this.parent.trigger(dragStop, dragArgs, (dragEventArgs) => {
19945
20247
  if (dragEventArgs.cancel) {
19946
20248
  return;
19947
20249
  }
19948
- if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.activeViewOptions.group.allowGroupEdit
19949
- && !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {
20250
+ if (this.parent.isSpecificResourceEvents()) {
19950
20251
  this.parent.crudModule.crudObj.isCrudAction = true;
19951
20252
  this.parent.crudModule.crudObj.sourceEvent =
19952
20253
  [this.parent.resourceBase.lastResourceLevel[parseInt(dragArgs.element.getAttribute('data-group-index'), 10)]];
@@ -20183,7 +20484,9 @@ class DragAndDrop extends ActionBase {
20183
20484
  this.actionObj.clone.classList.contains(ALLDAY_APPOINTMENT_CLASS)) {
20184
20485
  dragEnd = addDays(resetTime(dragEnd), 1);
20185
20486
  }
20186
- this.updateAllDayEvents(dragStart$$1, dragEnd, this.parent.activeViewOptions.group.byDate ? colIndex : undefined);
20487
+ const index = this.parent.activeViewOptions.group.byDate || (this.parent.virtualScrollModule &&
20488
+ !this.parent.activeViewOptions.timeScale.enable) ? colIndex : undefined;
20489
+ this.updateAllDayEvents(dragStart$$1, dragEnd, index);
20187
20490
  }
20188
20491
  this.actionObj.start = new Date(+dragStart$$1);
20189
20492
  this.actionObj.end = new Date(+dragEnd);
@@ -20308,10 +20611,12 @@ class DragAndDrop extends ActionBase {
20308
20611
  }
20309
20612
  updateEventHeight(event, index, colIndex) {
20310
20613
  this.verticalEvent.initializeValues();
20311
- let datesCount = 0;
20614
+ let datesCount = this.verticalEvent.getStartCount();
20312
20615
  if (!this.parent.uiStateValues.isGroupAdaptive) {
20313
20616
  for (let i = 0; i < this.actionObj.groupIndex; i++) {
20314
- datesCount = datesCount + this.verticalEvent.dateRender[i].length;
20617
+ if (this.verticalEvent.dateRender[i]) {
20618
+ datesCount = datesCount + this.verticalEvent.dateRender[i].length;
20619
+ }
20315
20620
  }
20316
20621
  }
20317
20622
  const indexGroup = this.parent.uiStateValues.isGroupAdaptive ? datesCount : this.actionObj.groupIndex;
@@ -20924,11 +21229,15 @@ class ViewBase {
20924
21229
  }
20925
21230
  createTableLayout(className) {
20926
21231
  const clsName = className || '';
20927
- const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName, attrs: { role: 'table' } });
21232
+ const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName });
20928
21233
  const tbody = createElement('tbody');
20929
21234
  table.appendChild(tbody);
20930
21235
  return table;
20931
21236
  }
21237
+ setAriaAttributes(table) {
21238
+ table.setAttribute('role', 'grid');
21239
+ table.setAttribute('aria-label', this.getLabelText(this.parent.currentView));
21240
+ }
20932
21241
  createColGroup(table, lastRow) {
20933
21242
  let length = lastRow.length;
20934
21243
  if (lastRow[0] && lastRow[0].colSpan) {
@@ -21386,6 +21695,32 @@ class ViewBase {
21386
21695
  }
21387
21696
  return null;
21388
21697
  }
21698
+ resetColLevels() {
21699
+ this.parent.resourceBase.expandedResources = [];
21700
+ const renderedCount = this.parent.virtualScrollModule.getRenderedCount();
21701
+ const lastLevel = this.parent.activeViewOptions.group.byDate ? this.colLevels[0] :
21702
+ this.parent.resourceBase.renderedResources;
21703
+ let index = 0;
21704
+ for (let i = 0; i < lastLevel.length; i++) {
21705
+ if (index >= renderedCount) {
21706
+ break;
21707
+ }
21708
+ index += lastLevel[i].colSpan;
21709
+ this.parent.resourceBase.expandedResources.push(lastLevel[i]);
21710
+ }
21711
+ if (this.parent.activeViewOptions.group.byDate) {
21712
+ this.colLevels[0] = this.parent.resourceBase.expandedResources;
21713
+ this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources);
21714
+ }
21715
+ else {
21716
+ this.colLevels[this.colLevels.length - 2] = this.parent.resourceBase.expandedResources;
21717
+ this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources;
21718
+ }
21719
+ if (this.parent.currentView !== 'Month') {
21720
+ this.colLevels[this.colLevels.length - 1] = this.colLevels[this.colLevels.length - 1].slice(0, index);
21721
+ this.parent.resourceBase.expandedResources = this.colLevels[this.colLevels.length - 1];
21722
+ }
21723
+ }
21389
21724
  destroy() {
21390
21725
  if (this.element && this.element.parentNode) {
21391
21726
  remove(this.element);
@@ -21630,14 +21965,25 @@ class VerticalView extends ViewBase {
21630
21965
  if (!isNullOrUndefined(this.parent.resourceBase) && (this.parent.activeViewOptions.group.resources.length > 0) &&
21631
21966
  !this.parent.uiStateValues.isGroupAdaptive) {
21632
21967
  let count = 0;
21633
- for (const resource of this.parent.resourceBase.lastResourceLevel) {
21634
- const index = this.parent.getIndexOfDate(resource.renderDates, resetTime(this.parent.getCurrentTime()));
21635
- if (index >= 0) {
21636
- const resIndex = this.parent.activeViewOptions.group.byDate ?
21637
- (this.parent.resourceBase.lastResourceLevel.length * index) + count : count + index;
21638
- currentDateIndex.push(resIndex);
21968
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling &&
21969
+ this.parent.activeViewOptions.group.byDate) {
21970
+ for (const resource of this.parent.resourceBase.expandedResources) {
21971
+ if (resetTime(resource.date).getTime() === resetTime(this.parent.getCurrentTime()).getTime()) {
21972
+ currentDateIndex.push(count);
21973
+ }
21974
+ count += 1;
21975
+ }
21976
+ }
21977
+ else {
21978
+ for (const resource of this.parent.resourceBase.renderedResources) {
21979
+ const index = this.parent.getIndexOfDate(resource.renderDates, resetTime(this.parent.getCurrentTime()));
21980
+ if (index >= 0) {
21981
+ const resIndex = this.parent.activeViewOptions.group.byDate ?
21982
+ (this.parent.resourceBase.lastResourceLevel.length * index) + count : count + index;
21983
+ currentDateIndex.push(resIndex);
21984
+ }
21985
+ count += this.parent.activeViewOptions.group.byDate ? 1 : resource.renderDates.length;
21639
21986
  }
21640
- count += this.parent.activeViewOptions.group.byDate ? 1 : resource.renderDates.length;
21641
21987
  }
21642
21988
  }
21643
21989
  else {
@@ -21780,7 +22126,7 @@ class VerticalView extends ViewBase {
21780
22126
  if (!this.parent.activeViewOptions.timeScale.enable) {
21781
22127
  addClass([this.element], [TIMESCALE_DISABLE, this.viewClass]);
21782
22128
  }
21783
- if (this.parent.activeViewOptions.allowVirtualScrolling) {
22129
+ if (this.parent.activeViewOptions.allowVirtualScrolling && !this.parent.uiStateValues.isGroupAdaptive) {
21784
22130
  clsList.push(VIRTUAL_SCROLL_CLASS);
21785
22131
  }
21786
22132
  if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
@@ -21811,6 +22157,9 @@ class VerticalView extends ViewBase {
21811
22157
  prepend([tr], this.element.querySelector('tbody'));
21812
22158
  }
21813
22159
  renderContent() {
22160
+ if (this.parent.activeViewOptions.group.resources.length > 0) {
22161
+ this.parent.resourceBase.renderedResources = extend([], this.parent.resourceBase.lastResourceLevel, null, true);
22162
+ }
21814
22163
  const tr = createElement('tr');
21815
22164
  const workTd = createElement('td');
21816
22165
  if (this.parent.isAdaptive) {
@@ -21826,13 +22175,22 @@ class VerticalView extends ViewBase {
21826
22175
  tr.appendChild(workTd);
21827
22176
  }
21828
22177
  else {
21829
- workTd.appendChild(this.renderContentArea());
22178
+ const levels = this.colLevels.slice(0);
22179
+ if (this.parent.virtualScrollModule) {
22180
+ this.resetColLevels();
22181
+ }
22182
+ const wrap = this.renderContentArea();
22183
+ workTd.appendChild(wrap);
21830
22184
  if (this.parent.activeViewOptions.timeScale.enable) {
21831
22185
  const timesTd = createElement('td');
21832
22186
  timesTd.appendChild(this.renderTimeCells());
21833
22187
  tr.appendChild(timesTd);
21834
22188
  }
21835
22189
  tr.appendChild(workTd);
22190
+ if (this.parent.virtualScrollModule) {
22191
+ this.colLevels = levels;
22192
+ this.parent.virtualScrollModule.renderVirtualTrack(wrap);
22193
+ }
21836
22194
  }
21837
22195
  this.element.querySelector('tbody').appendChild(tr);
21838
22196
  }
@@ -21904,7 +22262,6 @@ class VerticalView extends ViewBase {
21904
22262
  td.className = [ALLDAY_CELLS_CLASS];
21905
22263
  td.type = 'alldayCells';
21906
22264
  const ntd = this.createTd(td);
21907
- ntd.setAttribute('role', 'gridcell');
21908
22265
  ntd.setAttribute('data-date', td.date.getTime().toString());
21909
22266
  if (!isNullOrUndefined(td.groupIndex)) {
21910
22267
  ntd.setAttribute('data-group-index', '' + td.groupIndex);
@@ -21917,7 +22274,7 @@ class VerticalView extends ViewBase {
21917
22274
  }
21918
22275
  table.querySelector('tbody').appendChild(ntr);
21919
22276
  const thead = createElement('thead');
21920
- thead.appendChild(this.createEventWrapper('allDay'));
22277
+ thead.appendChild(this.parent.eventBase.createEventWrapper('allDay'));
21921
22278
  prepend([thead], table);
21922
22279
  }
21923
22280
  createTd(td) {
@@ -21937,7 +22294,6 @@ class VerticalView extends ViewBase {
21937
22294
  }
21938
22295
  if (td.type === 'dateHeader' && td.className.indexOf(HEADER_CELLS_CLASS) >= 0) {
21939
22296
  tdEle.setAttribute('data-date', td.date.getTime().toString());
21940
- tdEle.setAttribute('role', 'gridcell');
21941
22297
  if (!isNullOrUndefined(td.groupIndex)) {
21942
22298
  tdEle.setAttribute('data-group-index', '' + td.groupIndex);
21943
22299
  }
@@ -21977,6 +22333,7 @@ class VerticalView extends ViewBase {
21977
22333
  renderContentArea() {
21978
22334
  const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
21979
22335
  const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
22336
+ this.setAriaAttributes(tbl);
21980
22337
  this.addAutoHeightClass(tbl);
21981
22338
  this.renderContentTable(tbl);
21982
22339
  this.createColGroup(tbl, this.colLevels.slice(-1)[0]);
@@ -21987,20 +22344,25 @@ class VerticalView extends ViewBase {
21987
22344
  return wrap;
21988
22345
  }
21989
22346
  renderContentTable(table) {
21990
- const tr = createElement('tr', { attrs: { role: 'row' } });
21991
- const td = createElement('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
21992
- const tbody = table.querySelector('tbody');
22347
+ const tBody = table.querySelector('tbody');
22348
+ append(this.getContentRows(), tBody);
22349
+ this.renderContentTableHeader(table);
22350
+ }
22351
+ getContentRows() {
22352
+ const rows = [];
22353
+ const tr = createElement('tr');
22354
+ const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
21993
22355
  const handler = (r) => {
21994
22356
  const ntr = tr.cloneNode();
21995
22357
  for (const tdData of this.colLevels[this.colLevels.length - 1]) {
21996
22358
  const ntd = this.createContentTd(tdData, r, td);
21997
22359
  ntr.appendChild(ntd);
21998
22360
  }
21999
- tbody.appendChild(ntr);
22361
+ rows.push(ntr);
22000
22362
  return r;
22001
22363
  };
22002
22364
  this.getTimeSlotRows(handler);
22003
- this.renderContentTableHeader(table);
22365
+ return rows;
22004
22366
  }
22005
22367
  createContentTd(tdData, r, td) {
22006
22368
  const ntd = td.cloneNode();
@@ -22047,35 +22409,12 @@ class VerticalView extends ViewBase {
22047
22409
  }
22048
22410
  renderContentTableHeader(table) {
22049
22411
  const thead = createElement('thead');
22050
- thead.appendChild(this.createEventWrapper());
22412
+ thead.appendChild(this.parent.eventBase.createEventWrapper());
22051
22413
  if (this.parent.activeViewOptions.timeScale.enable) {
22052
- thead.appendChild(this.createEventWrapper('timeIndicator'));
22414
+ thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
22053
22415
  }
22054
22416
  prepend([thead], table);
22055
22417
  }
22056
- createEventWrapper(type = '') {
22057
- const tr = createElement('tr');
22058
- const levels = this.colLevels.slice(-1)[0];
22059
- for (let i = 0, len = levels.length; i < len; i++) {
22060
- const col = levels[i];
22061
- const appointmentWrap = createElement('td', {
22062
- className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
22063
- TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
22064
- });
22065
- if (!isNullOrUndefined(col.groupIndex)) {
22066
- appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
22067
- }
22068
- if (type === '') {
22069
- const innerWrapper = createElement('div', {
22070
- id: APPOINTMENT_WRAPPER_CLASS + '-' + i.toString(),
22071
- className: APPOINTMENT_WRAPPER_CLASS
22072
- });
22073
- appointmentWrap.appendChild(innerWrapper);
22074
- }
22075
- tr.appendChild(appointmentWrap);
22076
- }
22077
- return tr;
22078
- }
22079
22418
  getScrollableElement() {
22080
22419
  if (this.parent.isAdaptive && !this.isTimelineView()) {
22081
22420
  return this.element.querySelector('.' + SCROLL_CONTAINER_CLASS);
@@ -22427,7 +22766,7 @@ class Month extends ViewBase {
22427
22766
  if (this.parent.activeViewOptions.group.byDate) {
22428
22767
  clsList.push('e-by-date');
22429
22768
  }
22430
- if (this.parent.activeViewOptions.allowVirtualScrolling) {
22769
+ if (this.parent.activeViewOptions.allowVirtualScrolling && !this.parent.uiStateValues.isGroupAdaptive) {
22431
22770
  clsList.push(VIRTUAL_SCROLL_CLASS);
22432
22771
  }
22433
22772
  if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
@@ -22475,11 +22814,18 @@ class Month extends ViewBase {
22475
22814
  }
22476
22815
  }
22477
22816
  renderContent() {
22817
+ if (this.parent.activeViewOptions.group.resources.length > 0) {
22818
+ this.parent.resourceBase.renderedResources = extend([], this.parent.resourceBase.lastResourceLevel, null, true);
22819
+ }
22478
22820
  const tr = createElement('tr');
22479
22821
  if (this.parent.activeViewOptions.showWeekNumber) {
22480
22822
  tr.appendChild(this.renderWeekNumberContent());
22481
22823
  }
22482
22824
  const workTd = createElement('td');
22825
+ const levels = this.colLevels.slice(0);
22826
+ if (this.parent.virtualScrollModule) {
22827
+ this.resetColLevels();
22828
+ }
22483
22829
  const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
22484
22830
  const contentArea = this.renderContentArea();
22485
22831
  if (this.parent.currentView === 'Month') {
@@ -22493,6 +22839,10 @@ class Month extends ViewBase {
22493
22839
  EventHandler.add(wrap, 'scroll', this.onContentScroll, this);
22494
22840
  workTd.appendChild(wrap);
22495
22841
  tr.appendChild(workTd);
22842
+ if (this.parent.virtualScrollModule) {
22843
+ this.colLevels = levels;
22844
+ this.parent.virtualScrollModule.renderVirtualTrack(wrap);
22845
+ }
22496
22846
  this.element.querySelector('tbody').appendChild(tr);
22497
22847
  this.renderAppointmentContainer();
22498
22848
  }
@@ -22520,6 +22870,11 @@ class Month extends ViewBase {
22520
22870
  const wrap = createElement('div', { className: DATE_HEADER_WRAP_CLASS });
22521
22871
  container.appendChild(wrap);
22522
22872
  const table = this.createTableLayout();
22873
+ if (this.parent.currentView === 'Month') {
22874
+ const thead = createElement('thead');
22875
+ thead.appendChild(createElement('tr'));
22876
+ prepend([thead], table);
22877
+ }
22523
22878
  this.createColGroup(table, this.colLevels[this.colLevels.length - 1]);
22524
22879
  const trEle = createElement('tr');
22525
22880
  for (let i = 0; i < this.colLevels.length; i++) {
@@ -22607,9 +22962,12 @@ class Month extends ViewBase {
22607
22962
  const dates = this.renderDates.map((date) => new Date(+date));
22608
22963
  const count = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH :
22609
22964
  this.parent.activeViewOptions.workDays.length;
22965
+ const level = this.colLevels.slice(0, 1)[0];
22966
+ const startIndex = this.renderDates.map(Number).indexOf(+level[0].date);
22610
22967
  for (let i = 0; i < (this.renderDates.length / count); i++) {
22611
22968
  const colDates = dates.splice(0, count);
22612
- for (const colDate of colDates) {
22969
+ for (let j = startIndex; j < (this.colLevels[0].length + startIndex) && j < colDates.length; j++) {
22970
+ const colDate = colDates[j];
22613
22971
  if (includeResource) {
22614
22972
  const lastRow = this.colLevels[(this.colLevels.length - 1)];
22615
22973
  const resourcesTd = lastRow.slice(0, lastRow.length / count);
@@ -22645,6 +23003,7 @@ class Month extends ViewBase {
22645
23003
  }
22646
23004
  renderContentArea() {
22647
23005
  const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
23006
+ this.setAriaAttributes(tbl);
22648
23007
  this.addAutoHeightClass(tbl);
22649
23008
  if (this.parent.currentView === 'TimelineMonth') {
22650
23009
  this.createColGroup(tbl, this.colLevels[this.colLevels.length - 1]);
@@ -22661,8 +23020,8 @@ class Month extends ViewBase {
22661
23020
  }
22662
23021
  getContentRows() {
22663
23022
  const trows = [];
22664
- const tr = createElement('tr', { attrs: { role: 'row' } });
22665
- const td = createElement('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
23023
+ const tr = createElement('tr');
23024
+ const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
22666
23025
  const slotDatas = this.getContentSlots();
22667
23026
  for (let row = 0; row < slotDatas.length; row++) {
22668
23027
  const ntr = tr.cloneNode();
@@ -22936,7 +23295,7 @@ class Year extends ViewBase {
22936
23295
  this.generateColumnLevels();
22937
23296
  this.renderResourceMobileLayout();
22938
23297
  }
22939
- this.wireEvents(this.element.querySelector('.' + CONTENT_WRAP_CLASS), 'scroll');
23298
+ EventHandler.add(this.element.querySelector('.' + CONTENT_WRAP_CLASS), 'scroll', this.onContentScroll, this);
22940
23299
  this.parent.notify(contentReady, {});
22941
23300
  }
22942
23301
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -22971,7 +23330,14 @@ class Year extends ViewBase {
22971
23330
  }
22972
23331
  renderCalendarHeader(currentDate) {
22973
23332
  const headerWrapper = createElement('div', { className: 'e-header e-month' });
22974
- const headerContent = createElement('div', { className: 'e-day e-title', innerHTML: this.getMonthName(currentDate) });
23333
+ const headerContent = createElement('div', { className: 'e-day e-title' });
23334
+ if (this.parent.monthHeaderTemplate) {
23335
+ const args = { date: currentDate, type: 'monthHeader' };
23336
+ this.renderTemplates(this.parent.getMonthHeaderTemplate(), args, 'monthHeaderTemplate', this.parent.activeViewOptions.monthHeaderTemplateName, headerContent);
23337
+ }
23338
+ else {
23339
+ headerContent.innerHTML = this.getMonthName(currentDate);
23340
+ }
22975
23341
  headerWrapper.appendChild(headerContent);
22976
23342
  this.parent.trigger(renderCell, { elementType: 'headerCells', element: headerContent, date: currentDate });
22977
23343
  return headerWrapper;
@@ -22981,6 +23347,7 @@ class Year extends ViewBase {
22981
23347
  const contentWrapper = createElement('div', { className: 'e-content e-month' });
22982
23348
  const contentTable = this.createTableLayout('e-calendar-table ' + CONTENT_TABLE_CLASS);
22983
23349
  contentWrapper.appendChild(contentTable);
23350
+ this.setAriaAttributes(contentTable);
22984
23351
  const thead = createElement('thead', { className: 'e-week-header' });
22985
23352
  const tr = createElement('tr');
22986
23353
  let currentWeek = getWeekFirstDate(firstDateOfMonth(currentDate), this.parent.firstDayOfWeek);
@@ -22988,7 +23355,15 @@ class Year extends ViewBase {
22988
23355
  tr.appendChild(createElement('th'));
22989
23356
  }
22990
23357
  for (let i = 0; i < WEEK_LENGTH; i++) {
22991
- tr.appendChild(createElement('th', { innerHTML: this.parent.getDayNames('narrow')[currentWeek.getDay()] }));
23358
+ if (this.parent.dayHeaderTemplate) {
23359
+ const th = createElement('th');
23360
+ const args = { date: currentWeek, type: 'dayHeader' };
23361
+ this.renderTemplates(this.parent.getDayHeaderTemplate(), args, 'dayHeaderTemplate', this.parent.activeViewOptions.dayHeaderTemplateName, th);
23362
+ tr.appendChild(th);
23363
+ }
23364
+ else {
23365
+ tr.appendChild(createElement('th', { innerHTML: this.parent.getDayNames('narrow')[currentWeek.getDay()] }));
23366
+ }
22992
23367
  currentWeek = new Date(currentWeek.getTime() + MS_PER_DAY);
22993
23368
  }
22994
23369
  thead.appendChild(tr);
@@ -22996,12 +23371,12 @@ class Year extends ViewBase {
22996
23371
  const tbody = contentTable.querySelector('tbody');
22997
23372
  while (dateCollection.length > 0) {
22998
23373
  const weekDates = dateCollection.splice(0, WEEK_LENGTH);
22999
- const tr = createElement('tr', { attrs: { 'role': 'row' } });
23374
+ const tr = createElement('tr');
23000
23375
  if (this.parent.activeViewOptions.showWeekNumber) {
23001
23376
  const weekNumber = this.parent.getWeekNumberContent(weekDates);
23002
23377
  const td = createElement('td', {
23003
23378
  className: 'e-week-number',
23004
- attrs: { 'role': 'gridcell', 'title': this.parent.localeObj.getConstant('week') + ' ' + weekNumber },
23379
+ attrs: { 'title': this.parent.localeObj.getConstant('week') + ' ' + weekNumber },
23005
23380
  innerHTML: weekNumber
23006
23381
  });
23007
23382
  tr.appendChild(td);
@@ -23010,13 +23385,23 @@ class Year extends ViewBase {
23010
23385
  for (const date of weekDates) {
23011
23386
  const td = createElement('td', {
23012
23387
  className: 'e-cell ' + WORK_CELLS_CLASS,
23013
- attrs: { 'role': 'gridcell', 'aria-selected': 'false', 'data-date': date.getTime().toString() }
23388
+ attrs: { 'aria-selected': 'false', 'data-date': date.getTime().toString() }
23014
23389
  });
23015
- const span = createElement('span', {
23016
- className: 'e-day', innerHTML: this.parent.globalize.formatDate(date, { skeleton: 'd', calendar: this.parent.getCalendarMode() }),
23017
- attrs: { title: this.parent.globalize.formatDate(date, { type: 'date', skeleton: 'full' }) }
23018
- });
23019
- td.appendChild(span);
23390
+ if (this.parent.activeViewOptions.cellHeaderTemplate) {
23391
+ const args = { date: date, type: 'monthCells' };
23392
+ this.renderTemplates(this.parent.getCellHeaderTemplate(), args, 'cellHeaderTemplate', this.parent.activeViewOptions.cellHeaderTemplateName, td);
23393
+ }
23394
+ else {
23395
+ const span = createElement('span', {
23396
+ className: 'e-day', innerHTML: this.parent.globalize.formatDate(date, { skeleton: 'd', calendar: this.parent.getCalendarMode() }),
23397
+ attrs: { title: this.parent.globalize.formatDate(date, { type: 'date', skeleton: 'full' }) }
23398
+ });
23399
+ td.appendChild(span);
23400
+ }
23401
+ if (this.parent.activeViewOptions.cellTemplate) {
23402
+ const args = { date: date, type: 'monthCells' };
23403
+ this.renderTemplates(this.parent.getCellTemplate(), args, 'cellTemplate', this.parent.activeViewOptions.cellTemplateName, td);
23404
+ }
23020
23405
  let classList$$1 = [];
23021
23406
  if (currentDate.getMonth() !== date.getMonth()) {
23022
23407
  classList$$1.push(OTHERMONTH_CLASS);
@@ -23028,7 +23413,10 @@ class Year extends ViewBase {
23028
23413
  addClass([td], classList$$1);
23029
23414
  }
23030
23415
  tr.appendChild(td);
23031
- this.wireEvents(td, 'cell');
23416
+ EventHandler.add(td, 'click', this.onCellClick, this);
23417
+ if (!this.parent.isAdaptive) {
23418
+ EventHandler.add(td, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
23419
+ }
23032
23420
  this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
23033
23421
  }
23034
23422
  tbody.appendChild(tr);
@@ -23108,6 +23496,11 @@ class Year extends ViewBase {
23108
23496
  // eslint-disable-next-line prefer-spread
23109
23497
  return Array.apply(null, { length: this.parent.activeViewOptions.monthsCount }).map((value, index) => this.parent.firstMonthOfYear + index);
23110
23498
  }
23499
+ renderTemplates(fn, args, tName, vName, ele) {
23500
+ const templateId = this.parent.element.id + '_' + vName + tName;
23501
+ const template = [].slice.call(fn(args, this.parent, tName, templateId, false));
23502
+ append(template, ele);
23503
+ }
23111
23504
  onCellClick(e) {
23112
23505
  let target = closest(e.target, '.' + WORK_CELLS_CLASS);
23113
23506
  const startDate = this.parent.getDateFromElement(target);
@@ -23130,6 +23523,8 @@ class Year extends ViewBase {
23130
23523
  target = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
23131
23524
  }
23132
23525
  this.parent.activeCellsData = this.parent.getCellDetails(target);
23526
+ const args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });
23527
+ this.parent.trigger(cellClick, args);
23133
23528
  this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
23134
23529
  }
23135
23530
  }
@@ -23241,23 +23636,6 @@ class Year extends ViewBase {
23241
23636
  this.yearEventModule.renderAppointments();
23242
23637
  this.parent.notify(eventsLoaded, args);
23243
23638
  }
23244
- wireEvents(element, type) {
23245
- if (type === 'cell') {
23246
- if (this.parent.currentView !== 'TimelineYear') {
23247
- EventHandler.add(element, 'click', this.onCellClick, this);
23248
- }
23249
- else {
23250
- EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
23251
- EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
23252
- if (!this.parent.isAdaptive) {
23253
- EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
23254
- }
23255
- }
23256
- }
23257
- else {
23258
- EventHandler.add(element, 'scroll', this.onContentScroll, this);
23259
- }
23260
- }
23261
23639
  scrollToDate(scrollDate) {
23262
23640
  const date = +new Date(resetTime(scrollDate));
23263
23641
  let element = this.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')[data-date="' + date + '"]');
@@ -23324,7 +23702,6 @@ class AgendaBase extends ViewBase {
23324
23702
  'tabindex': '0',
23325
23703
  'aria-disabled': this.parent.eventBase.getReadonlyAttribute(listData[li]),
23326
23704
  'aria-pressed': 'false',
23327
- 'aria-grabbed': 'true',
23328
23705
  'aria-label': this.parent.getAnnouncementString(listData[li])
23329
23706
  }
23330
23707
  });
@@ -23528,9 +23905,9 @@ class AgendaBase extends ViewBase {
23528
23905
  }
23529
23906
  }
23530
23907
  createResourceTableRow(tContent, tBody) {
23531
- const tr = createElement('tr', { attrs: { role: 'row' } });
23908
+ const tr = createElement('tr');
23532
23909
  let ntr;
23533
- const td = createElement('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
23910
+ const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
23534
23911
  let tempData;
23535
23912
  let rowSpan = 0;
23536
23913
  let level;
@@ -23625,11 +24002,10 @@ class AgendaBase extends ViewBase {
23625
24002
  }
23626
24003
  createTableRowElement(date, type) {
23627
24004
  const daysCount = getDaysCount(this.parent.selectedDate.getTime(), date.getTime());
23628
- const tr = createElement('tr', { attrs: { 'role': 'row', 'data-row-index': daysCount.toString() } });
24005
+ const tr = createElement('tr', { attrs: { 'data-row-index': daysCount.toString() } });
23629
24006
  const td = createElement('td', {
23630
24007
  attrs: {
23631
24008
  'class': (type === 'monthHeader') ? MONTH_HEADER_CLASS : AGENDA_CELLS_CLASS,
23632
- 'role': 'gridcell',
23633
24009
  'aria-selected': 'false',
23634
24010
  'data-column-index': daysCount.toString(),
23635
24011
  'data-date': date.getTime().toString()
@@ -23677,6 +24053,7 @@ class Agenda extends AgendaBase {
23677
24053
  const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
23678
24054
  workTd.appendChild(wrap);
23679
24055
  const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
24056
+ this.setAriaAttributes(tbl);
23680
24057
  wrap.appendChild(tbl);
23681
24058
  const tBody = tbl.querySelector('tbody');
23682
24059
  const agendaDate = resetTime(this.parent.selectedDate);
@@ -24560,8 +24937,8 @@ class TimelineViews extends VerticalView {
24560
24937
  }
24561
24938
  getContentRows() {
24562
24939
  const rows = [];
24563
- const tr = createElement('tr', { attrs: { role: 'row' } });
24564
- const td = createElement('td', { attrs: { role: 'gridcell', 'aria-selected': 'false' } });
24940
+ const tr = createElement('tr');
24941
+ const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
24565
24942
  const trCount = this.getRowCount();
24566
24943
  for (let i = 0; i < trCount; i++) {
24567
24944
  const ntr = tr.cloneNode();
@@ -24909,6 +25286,7 @@ class TimelineYear extends Year {
24909
25286
  const content = createElement('div', { className: CONTENT_WRAP_CLASS });
24910
25287
  lastTd.appendChild(content);
24911
25288
  const contentTable = this.createTableLayout(CONTENT_TABLE_CLASS);
25289
+ this.setAriaAttributes(contentTable);
24912
25290
  content.appendChild(contentTable);
24913
25291
  const eventWrapper = createElement('div', { className: EVENT_TABLE_CLASS });
24914
25292
  content.appendChild(eventWrapper);
@@ -24942,12 +25320,12 @@ class TimelineYear extends Year {
24942
25320
  let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
24943
25321
  let monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
24944
25322
  let monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
24945
- const tr = createElement('tr', { attrs: { 'role': 'row' } });
25323
+ const tr = createElement('tr');
24946
25324
  const monthTr = tr.cloneNode();
24947
25325
  monthBody.appendChild(monthTr);
24948
25326
  const contentTr = tr.cloneNode();
24949
25327
  contentBody.appendChild(contentTr);
24950
- const monthTd = createElement('td', { className: MONTH_HEADER_CLASS, attrs: { 'role': 'gridcell' } });
25328
+ const monthTd = createElement('td', { className: MONTH_HEADER_CLASS });
24951
25329
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
24952
25330
  if (this.parent.monthHeaderTemplate) {
24953
25331
  append(this.renderDayMonthHeaderTemplate(monthStart, month, 'monthHeaderTemplate'), monthTd);
@@ -24982,7 +25360,7 @@ class TimelineYear extends Year {
24982
25360
  isDateAvail = column >= monthStart.getDay() && date.getTime() < monthEnd.getTime();
24983
25361
  }
24984
25362
  const td = createElement('td', {
24985
- className: WORK_CELLS_CLASS, attrs: { 'role': 'gridcell', 'aria-selected': 'false' }
25363
+ className: WORK_CELLS_CLASS, attrs: { 'aria-selected': 'false' }
24986
25364
  });
24987
25365
  contentTr.appendChild(td);
24988
25366
  const dateHeader = createElement('div', {
@@ -25023,7 +25401,7 @@ class TimelineYear extends Year {
25023
25401
  td.appendChild(dateHeader);
25024
25402
  if (isDateAvail) {
25025
25403
  td.setAttribute('data-date', date.getTime().toString());
25026
- this.wireEvents(td, 'cell');
25404
+ this.wireEvents(td);
25027
25405
  }
25028
25406
  this.renderCellTemplate({ date: date, type: 'workCells' }, td);
25029
25407
  this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
@@ -25039,7 +25417,7 @@ class TimelineYear extends Year {
25039
25417
  const tRow = [];
25040
25418
  const monthCells = this.getMonths();
25041
25419
  for (let row = 0; row < this.parent.resourceBase.renderedResources.length; row++) {
25042
- const tr = createElement('tr', { attrs: { 'role': 'row' } });
25420
+ const tr = createElement('tr');
25043
25421
  tRow.push(tr);
25044
25422
  let resData;
25045
25423
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -25062,14 +25440,14 @@ class TimelineYear extends Year {
25062
25440
  const tdELe = createElement('td', {
25063
25441
  className: WORK_CELLS_CLASS,
25064
25442
  attrs: {
25065
- 'role': 'gridcell', 'aria-selected': 'false',
25443
+ 'aria-selected': 'false',
25066
25444
  'data-date': date.getTime().toString()
25067
25445
  }
25068
25446
  });
25069
25447
  addClass([tdELe], classList$$1);
25070
25448
  tdELe.setAttribute('data-group-index', groupIndex.toString());
25071
25449
  this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, tdELe);
25072
- this.wireEvents(tdELe, 'cell');
25450
+ this.wireEvents(tdELe);
25073
25451
  this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: tdELe, date: date });
25074
25452
  tr.appendChild(tdELe);
25075
25453
  }
@@ -25080,7 +25458,7 @@ class TimelineYear extends Year {
25080
25458
  const months = this.getMonths();
25081
25459
  for (let row = 0; row < this.rowCount; row++) {
25082
25460
  wrapper.appendChild(createElement('div', { className: APPOINTMENT_CONTAINER_CLASS }));
25083
- const tr = createElement('tr', { attrs: { 'role': 'row' } });
25461
+ const tr = createElement('tr');
25084
25462
  contentBody.appendChild(tr);
25085
25463
  let resData;
25086
25464
  if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -25093,7 +25471,7 @@ class TimelineYear extends Year {
25093
25471
  monthBody.appendChild(monthTr);
25094
25472
  const monthTd = createElement('td', {
25095
25473
  className: MONTH_HEADER_CLASS,
25096
- attrs: { 'role': 'gridcell', 'data-date': date.getTime().toString() }
25474
+ attrs: { 'data-date': date.getTime().toString() }
25097
25475
  });
25098
25476
  if (this.parent.monthHeaderTemplate) {
25099
25477
  append(this.renderDayMonthHeaderTemplate(monthDate, row, 'monthHeaderTemplate'), monthTd);
@@ -25125,14 +25503,14 @@ class TimelineYear extends Year {
25125
25503
  const td = createElement('td', {
25126
25504
  className: WORK_CELLS_CLASS,
25127
25505
  attrs: {
25128
- 'role': 'gridcell', 'aria-selected': 'false',
25506
+ 'aria-selected': 'false',
25129
25507
  'data-date': date.getTime().toString()
25130
25508
  }
25131
25509
  });
25132
25510
  addClass([td], classList$$1);
25133
25511
  td.setAttribute('data-group-index', groupIndex.toString());
25134
25512
  this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, td);
25135
- this.wireEvents(td, 'cell');
25513
+ this.wireEvents(td);
25136
25514
  tr.appendChild(td);
25137
25515
  this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: td, date: date });
25138
25516
  }
@@ -25197,6 +25575,13 @@ class TimelineYear extends Year {
25197
25575
  return this.getContentAreaElement();
25198
25576
  }
25199
25577
  }
25578
+ wireEvents(element) {
25579
+ EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
25580
+ EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
25581
+ if (!this.parent.isAdaptive) {
25582
+ EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
25583
+ }
25584
+ }
25200
25585
  }
25201
25586
 
25202
25587
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -25465,7 +25850,7 @@ class ICalendarImport {
25465
25850
  const appoint = [];
25466
25851
  const uId = 'UID';
25467
25852
  const fields = this.parent.eventFields;
25468
- let appointmentIds = [];
25853
+ const appointmentIds = [];
25469
25854
  this.parent.eventsData.forEach((eventObj) => {
25470
25855
  appointmentIds.push(eventObj[fields.id]);
25471
25856
  });
@@ -25744,5 +26129,5 @@ class Print {
25744
26129
  * Export Schedule components
25745
26130
  */
25746
26131
 
25747
- export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
26132
+ export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
25748
26133
  //# sourceMappingURL=ej2-schedule.es2015.js.map