@syncfusion/ej2-schedule 20.4.52 → 21.1.35

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 (114) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +374 -153
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +409 -174
  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/common/calendar-util.d.ts +7 -0
  14. package/src/recurrence-editor/recurrence-editor.d.ts +10 -0
  15. package/src/recurrence-editor/recurrence-editor.js +3 -3
  16. package/src/schedule/actions/action-base.js +5 -0
  17. package/src/schedule/actions/crud.js +14 -2
  18. package/src/schedule/actions/data.d.ts +14 -2
  19. package/src/schedule/actions/data.js +26 -2
  20. package/src/schedule/actions/drag.js +6 -1
  21. package/src/schedule/actions/keyboard.d.ts +1 -1
  22. package/src/schedule/actions/keyboard.js +17 -15
  23. package/src/schedule/actions/virtual-scroll.js +2 -2
  24. package/src/schedule/base/interface.d.ts +23 -23
  25. package/src/schedule/base/resource.js +8 -7
  26. package/src/schedule/base/schedule-model.d.ts +34 -27
  27. package/src/schedule/base/schedule.d.ts +57 -27
  28. package/src/schedule/base/schedule.js +56 -9
  29. package/src/schedule/base/type.d.ts +66 -1
  30. package/src/schedule/event-renderer/agenda-base.js +6 -2
  31. package/src/schedule/event-renderer/event-base.d.ts +1 -0
  32. package/src/schedule/event-renderer/event-base.js +27 -10
  33. package/src/schedule/event-renderer/month.js +4 -5
  34. package/src/schedule/event-renderer/vertical-view.d.ts +0 -1
  35. package/src/schedule/event-renderer/vertical-view.js +6 -30
  36. package/src/schedule/event-renderer/year.d.ts +1 -0
  37. package/src/schedule/event-renderer/year.js +135 -54
  38. package/src/schedule/models/event-settings-model.d.ts +11 -2
  39. package/src/schedule/models/event-settings.d.ts +10 -2
  40. package/src/schedule/models/event-settings.js +3 -0
  41. package/src/schedule/models/fields-model.d.ts +4 -2
  42. package/src/schedule/models/fields.d.ts +6 -4
  43. package/src/schedule/models/fields.js +2 -2
  44. package/src/schedule/models/header-rows-model.d.ts +5 -5
  45. package/src/schedule/models/header-rows.d.ts +5 -5
  46. package/src/schedule/models/quick-info-templates-model.d.ts +3 -3
  47. package/src/schedule/models/quick-info-templates.d.ts +3 -3
  48. package/src/schedule/models/views-model.d.ts +16 -15
  49. package/src/schedule/models/views.d.ts +16 -15
  50. package/src/schedule/popups/event-tooltip.js +2 -1
  51. package/src/schedule/popups/event-window.js +27 -6
  52. package/src/schedule/popups/quick-popups.js +32 -10
  53. package/src/schedule/renderer/header-renderer.js +1 -0
  54. package/src/schedule/renderer/month-agenda.d.ts +2 -1
  55. package/src/schedule/renderer/month-agenda.js +5 -0
  56. package/src/schedule/renderer/month.d.ts +1 -0
  57. package/src/schedule/renderer/month.js +5 -3
  58. package/src/schedule/renderer/timeline-year.js +12 -8
  59. package/src/schedule/renderer/vertical-view.js +1 -1
  60. package/src/schedule/renderer/view-base.js +3 -4
  61. package/src/schedule/renderer/year.js +5 -1
  62. package/styles/bootstrap-dark.css +99 -89
  63. package/styles/bootstrap.css +99 -89
  64. package/styles/bootstrap4.css +99 -89
  65. package/styles/bootstrap5-dark.css +110 -100
  66. package/styles/bootstrap5.css +110 -100
  67. package/styles/fabric-dark.css +98 -88
  68. package/styles/fabric.css +98 -88
  69. package/styles/fluent-dark.css +109 -99
  70. package/styles/fluent.css +109 -99
  71. package/styles/highcontrast-light.css +98 -88
  72. package/styles/highcontrast.css +98 -88
  73. package/styles/material-dark.css +98 -88
  74. package/styles/material.css +98 -88
  75. package/styles/recurrence-editor/_bootstrap5-definition.scss +1 -1
  76. package/styles/recurrence-editor/_fluent-definition.scss +1 -1
  77. package/styles/recurrence-editor/_tailwind-definition.scss +1 -1
  78. package/styles/schedule/_bootstrap-dark-definition.scss +8 -1
  79. package/styles/schedule/_bootstrap-definition.scss +8 -1
  80. package/styles/schedule/_bootstrap4-definition.scss +7 -0
  81. package/styles/schedule/_bootstrap5-definition.scss +17 -10
  82. package/styles/schedule/_fabric-dark-definition.scss +7 -0
  83. package/styles/schedule/_fabric-definition.scss +7 -0
  84. package/styles/schedule/_fluent-definition.scss +15 -8
  85. package/styles/schedule/_fusionnew-definition.scss +7 -0
  86. package/styles/schedule/_highcontrast-definition.scss +7 -0
  87. package/styles/schedule/_highcontrast-light-definition.scss +7 -0
  88. package/styles/schedule/_layout.scss +63 -48
  89. package/styles/schedule/_material-dark-definition.scss +7 -0
  90. package/styles/schedule/_material-definition.scss +7 -0
  91. package/styles/schedule/_tailwind-definition.scss +17 -10
  92. package/styles/schedule/_theme.scss +40 -41
  93. package/styles/schedule/bootstrap-dark.css +99 -89
  94. package/styles/schedule/bootstrap.css +99 -89
  95. package/styles/schedule/bootstrap4.css +99 -89
  96. package/styles/schedule/bootstrap5-dark.css +110 -100
  97. package/styles/schedule/bootstrap5.css +110 -100
  98. package/styles/schedule/fabric-dark.css +98 -88
  99. package/styles/schedule/fabric.css +98 -88
  100. package/styles/schedule/fluent-dark.css +109 -99
  101. package/styles/schedule/fluent.css +109 -99
  102. package/styles/schedule/highcontrast-light.css +98 -88
  103. package/styles/schedule/highcontrast.css +98 -88
  104. package/styles/schedule/material-dark.css +98 -88
  105. package/styles/schedule/material.css +98 -88
  106. package/styles/schedule/tailwind-dark.css +106 -96
  107. package/styles/schedule/tailwind.css +106 -96
  108. package/styles/tailwind-dark.css +106 -96
  109. package/styles/tailwind.css +106 -96
  110. package/GitLeaksReport.json +0 -1
  111. package/gitleaks-ci/gitleaks +0 -0
  112. package/gitleaks-ci.tar.gz +0 -0
  113. package/styles/recurrence-editor/_material3-definition.scss +0 -13
  114. package/styles/schedule/_material3-definition.scss +0 -283
@@ -1023,6 +1023,7 @@ var HeaderRenderer = /** @__PURE__ @class */ (function () {
1023
1023
  overflowMode: 'Popup',
1024
1024
  clicked: _this.toolbarClickHandler.bind(_this),
1025
1025
  enableRtl: _this.parent.enableRtl,
1026
+ enableHtmlSanitizer: _this.parent.enableHtmlSanitizer,
1026
1027
  locale: _this.parent.locale
1027
1028
  });
1028
1029
  _this.toolbarObj.appendTo(_this.parent.element.querySelector('.' + HEADER_TOOLBAR));
@@ -2058,7 +2059,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2058
2059
  if (this.parent.eventWindow) {
2059
2060
  this.parent.eventWindow.convertToEventData(this.parent.activeCellsData, cellData);
2060
2061
  }
2061
- var selectedCells = this.parent.getSelectedElements();
2062
+ var selectedCells = this.parent.getSelectedCells();
2062
2063
  var args = {
2063
2064
  data: cellData, element: this.parent.activeCellsData.element, event: e,
2064
2065
  requestType: cellSelect, showQuickPopup: false
@@ -2285,15 +2286,16 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2285
2286
  var args = {
2286
2287
  element: target, requestType: cellSelect
2287
2288
  };
2288
- var cellData = {};
2289
- var cellDetails = this.parent.getCellDetails(target);
2290
- if (this.parent.eventWindow && cellDetails) {
2291
- if (this.parent.activeCellsData.element !== cellDetails.element) {
2292
- this.parent.activeCellsData = cellDetails;
2293
- }
2294
- this.parent.eventWindow.convertToEventData(this.parent.activeCellsData, cellData);
2295
- args.data = cellData;
2296
- }
2289
+ // activeCellsData is not reset on schedule property changed(group properties)
2290
+ // const cellData: Record<string, any> = {};
2291
+ // const cellDetails: CellClickEventArgs = this.parent.getCellDetails(target);
2292
+ // if (this.parent.eventWindow && cellDetails) {
2293
+ // if (this.parent.activeCellsData.element !== cellDetails.element) {
2294
+ // this.parent.activeCellsData = cellDetails;
2295
+ // }
2296
+ // this.parent.eventWindow.convertToEventData(this.parent.activeCellsData as unknown as Record<string, any>, cellData);
2297
+ // args.data = cellData;
2298
+ // }
2297
2299
  this.parent.trigger(select, args, function () {
2298
2300
  _this.initialTarget = target;
2299
2301
  _this.selectedCells = [target];
@@ -2410,7 +2412,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2410
2412
  return;
2411
2413
  }
2412
2414
  var target = (e.target);
2413
- var selectedElements = this.parent.getSelectedElements();
2415
+ var selectedElements = this.parent.getSelectedCells();
2414
2416
  var selectedEventElements = this.parent.eventBase.getSelectedAppointments();
2415
2417
  var moreEventWrapper = this.parent.element.querySelector('.' + MORE_POPUP_WRAPPER_CLASS);
2416
2418
  var quickPopupWrapper = this.getQuickPopupElement();
@@ -2457,7 +2459,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2457
2459
  return;
2458
2460
  }
2459
2461
  var target = (e.target);
2460
- var selectedCells = this.parent.getSelectedElements();
2462
+ var selectedCells = this.parent.getSelectedCells();
2461
2463
  var selectedElements = this.parent.eventBase.getSelectedAppointments();
2462
2464
  var moreEventWrapper = this.parent.element.querySelector('.' + MORE_POPUP_WRAPPER_CLASS);
2463
2465
  var quickPopupWrapper = this.getQuickPopupElement();
@@ -2565,7 +2567,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2565
2567
  if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2566
2568
  return;
2567
2569
  }
2568
- var selectedCells = this.parent.getSelectedElements();
2570
+ var selectedCells = this.parent.getSelectedCells();
2569
2571
  var targetCell;
2570
2572
  var selectedAppointments = this.parent.eventBase.getSelectedAppointments();
2571
2573
  var target = (e.target);
@@ -2637,7 +2639,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2637
2639
  return;
2638
2640
  }
2639
2641
  var target = (e.target);
2640
- var selectedCells = this.parent.getSelectedElements();
2642
+ var selectedCells = this.parent.getSelectedCells();
2641
2643
  var targetCell;
2642
2644
  if (selectedCells.length > 0 && !target.classList.contains(WORK_CELLS_CLASS) &&
2643
2645
  !target.classList.contains(ALLDAY_CELLS_CLASS)) {
@@ -2862,7 +2864,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2862
2864
  }
2863
2865
  return;
2864
2866
  }
2865
- var selectedCells = this.parent.getSelectedElements();
2867
+ var selectedCells = this.parent.getSelectedCells();
2866
2868
  if (selectedCells.length > 0 && !target.classList.contains(APPOINTMENT_CLASS)) {
2867
2869
  target = selectedCells[selectedCells.length - 1];
2868
2870
  this.selectAppointmentElementFromWorkCell(isReverse, target);
@@ -2981,6 +2983,7 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2981
2983
  */
2982
2984
  KeyboardInteraction.prototype.destroy = function () {
2983
2985
  this.removeEventListener();
2986
+ this.selectedCells = [];
2984
2987
  this.keyboardModule.destroy();
2985
2988
  };
2986
2989
  return KeyboardInteraction;
@@ -2996,11 +2999,13 @@ var Data = /** @__PURE__ @class */ (function () {
2996
2999
  /**
2997
3000
  * Constructor for data module
2998
3001
  *
3002
+ * @param {Schedule} parent Accepts the schedule element instance
2999
3003
  * @param {Object | DataManager} dataSource Accepts the datasource as JSON objects or DataManager
3000
3004
  * @param {Query} query Accepts the query to process the data
3001
3005
  * @private
3002
3006
  */
3003
- function Data(dataSource, query) {
3007
+ function Data(parent, dataSource, query) {
3008
+ this.parent = parent;
3004
3009
  this.initDataManager(dataSource, query);
3005
3010
  }
3006
3011
  /**
@@ -3025,6 +3030,11 @@ var Data = /** @__PURE__ @class */ (function () {
3025
3030
  */
3026
3031
  Data.prototype.generateQuery = function (startDate, endDate) {
3027
3032
  var query = this.query.clone();
3033
+ if (this.parent && this.parent.eventSettings.includeFiltersInQuery && startDate && endDate) {
3034
+ var dateQuery = this.getStartEndQuery(startDate, endDate);
3035
+ var recurrenceQuery = new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', null).and(new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', ''));
3036
+ return query.where(dateQuery.or(recurrenceQuery));
3037
+ }
3028
3038
  if (startDate) {
3029
3039
  query.addParams('StartDate', startDate.toISOString());
3030
3040
  }
@@ -3033,6 +3043,23 @@ var Data = /** @__PURE__ @class */ (function () {
3033
3043
  }
3034
3044
  return query;
3035
3045
  };
3046
+ /**
3047
+ * The function used to generate updated Query from schedule model
3048
+ *
3049
+ * @param {Date} startDate Accepts the start date
3050
+ * @param {Date} endDate Accepts the end date
3051
+ * @returns {void}
3052
+ * @private
3053
+ */
3054
+ Data.prototype.getStartEndQuery = function (startDate, endDate) {
3055
+ var fieldMapping = this.parent.eventFields;
3056
+ var dateQuery = new Predicate(fieldMapping.startTime, 'greaterthanorequal', startDate)
3057
+ .and(new Predicate(fieldMapping.endTime, 'greaterthanorequal', startDate))
3058
+ .and(new Predicate(fieldMapping.startTime, 'lessthan', endDate))
3059
+ .or(new Predicate(fieldMapping.startTime, 'lessthanorequal', startDate)
3060
+ .and(new Predicate(fieldMapping.endTime, 'greaterthan', startDate)));
3061
+ return dateQuery;
3062
+ };
3036
3063
  /**
3037
3064
  * The function used to get dataSource by executing given Query
3038
3065
  *
@@ -5449,12 +5476,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
5449
5476
  };
5450
5477
  EventBase.prototype.filterEvents = function (startDate, endDate, appointments, resourceTdData) {
5451
5478
  if (appointments === void 0) { appointments = this.parent.eventsProcessed; }
5452
- var fieldMapping = this.parent.eventFields;
5453
- var predicate = new Predicate(fieldMapping.startTime, 'greaterthanorequal', startDate).
5454
- and(new Predicate(fieldMapping.endTime, 'greaterthanorequal', startDate)).
5455
- and(new Predicate(fieldMapping.startTime, 'lessthan', endDate)).
5456
- or(new Predicate(fieldMapping.startTime, 'lessthanorequal', startDate).
5457
- and(new Predicate(fieldMapping.endTime, 'greaterthan', startDate)));
5479
+ var predicate = this.parent.dataModule.getStartEndQuery(startDate, endDate);
5458
5480
  var filter = new DataManager({ json: appointments }).executeLocal(new Query().where(predicate));
5459
5481
  if (resourceTdData) {
5460
5482
  filter = this.filterEventsByResource(resourceTdData, filter);
@@ -5771,7 +5793,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
5771
5793
  return;
5772
5794
  }
5773
5795
  var activeEle = document.activeElement;
5774
- var selectedCell = this.parent.getSelectedElements();
5796
+ var selectedCell = this.parent.getSelectedCells();
5775
5797
  if (selectedCell.length > 0 && ((activeEle && (this.parent.element.contains(activeEle) ||
5776
5798
  selectedCell.indexOf(activeEle) !== -1)) || isFocused)) {
5777
5799
  if (this.parent.keyboardInteractionModule) {
@@ -6331,9 +6353,8 @@ var EventBase = /** @__PURE__ @class */ (function () {
6331
6353
  templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6332
6354
  }
6333
6355
  else {
6334
- var appointmentSubject = createElement('div', {
6335
- className: SUBJECT_CLASS, innerHTML: eventSubject
6336
- });
6356
+ var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6357
+ appointmentSubject.innerText = this.parent.sanitize(eventSubject);
6337
6358
  templateElement = [appointmentSubject];
6338
6359
  }
6339
6360
  append(templateElement, appointmentWrapper);
@@ -6516,6 +6537,29 @@ var EventBase = /** @__PURE__ @class */ (function () {
6516
6537
  return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
6517
6538
  eventArgs || e;
6518
6539
  };
6540
+ EventBase.prototype.renderSpannedIcon = function (element, spanEvent) {
6541
+ var iconElement = createElement('div', { className: EVENT_INDICATOR_CLASS + ' ' + ICON });
6542
+ if (spanEvent.isLeft) {
6543
+ var iconLeft = iconElement.cloneNode();
6544
+ addClass([iconLeft], EVENT_ICON_LEFT_CLASS);
6545
+ prepend([iconLeft], element);
6546
+ }
6547
+ if (spanEvent.isRight) {
6548
+ var iconRight = iconElement.cloneNode();
6549
+ addClass([iconRight], EVENT_ICON_RIGHT_CLASS);
6550
+ append([iconRight], element);
6551
+ }
6552
+ if (spanEvent.isTop) {
6553
+ var iconTop = iconElement.cloneNode();
6554
+ addClass([iconTop], EVENT_ICON_UP_CLASS);
6555
+ prepend([iconTop], element);
6556
+ }
6557
+ if (spanEvent.isBottom) {
6558
+ var iconBottom = iconElement.cloneNode();
6559
+ addClass([iconBottom], EVENT_ICON_DOWN_CLASS);
6560
+ append([iconBottom], element);
6561
+ }
6562
+ };
6519
6563
  EventBase.prototype.unWireEvents = function () {
6520
6564
  var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6521
6565
  for (var _i = 0, appElements_1 = appElements; _i < appElements_1.length; _i++) {
@@ -6870,7 +6914,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6870
6914
  templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6871
6915
  }
6872
6916
  else {
6873
- var appointmentSubject = createElement('div', { className: SUBJECT_CLASS, innerHTML: recordSubject });
6917
+ var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6918
+ appointmentSubject.innerText = this.parent.sanitize(recordSubject);
6874
6919
  if (isAllDay) {
6875
6920
  if (record[fieldMapping.isAllDay]) {
6876
6921
  templateElement = [appointmentSubject];
@@ -6902,10 +6947,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6902
6947
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''),
6903
6948
  innerHTML: timeStr
6904
6949
  });
6905
- var appointmentLocation = createElement('div', {
6906
- className: LOCATION_CLASS,
6907
- innerHTML: (record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || '')
6908
- });
6950
+ var appointmentLocation = createElement('div', { className: LOCATION_CLASS });
6951
+ appointmentLocation.innerText = this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''));
6909
6952
  templateElement = [appointmentSubject, appointmentTime, appointmentLocation];
6910
6953
  }
6911
6954
  }
@@ -6922,7 +6965,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6922
6965
  appointmentWrapper.appendChild(recurrenceIcon);
6923
6966
  }
6924
6967
  }
6925
- this.renderSpannedIcon(isAllDay ? appointmentDetails : appointmentWrapper, eventData);
6968
+ this.parent.eventBase.renderSpannedIcon(isAllDay ? appointmentDetails : appointmentWrapper, eventData);
6926
6969
  if (!isNullOrUndefined(this.cssClass)) {
6927
6970
  addClass([appointmentWrapper], this.cssClass);
6928
6971
  }
@@ -6954,29 +6997,6 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6954
6997
  countCell.innerHTML = '+' + this.parent.globalize.formatNumber(moreCount) + '&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more'));
6955
6998
  }
6956
6999
  };
6957
- VerticalEvent.prototype.renderSpannedIcon = function (element, spanEvent) {
6958
- var iconElement = createElement('div', { className: EVENT_INDICATOR_CLASS + ' ' + ICON });
6959
- if (spanEvent.isLeft) {
6960
- var iconLeft = iconElement.cloneNode();
6961
- addClass([iconLeft], EVENT_ICON_LEFT_CLASS);
6962
- prepend([iconLeft], element);
6963
- }
6964
- if (spanEvent.isRight) {
6965
- var iconRight = iconElement.cloneNode();
6966
- addClass([iconRight], EVENT_ICON_RIGHT_CLASS);
6967
- append([iconRight], element);
6968
- }
6969
- if (spanEvent.isTop) {
6970
- var iconTop = iconElement.cloneNode();
6971
- addClass([iconTop], EVENT_ICON_UP_CLASS);
6972
- prepend([iconTop], element);
6973
- }
6974
- if (spanEvent.isBottom) {
6975
- var iconBottom = iconElement.cloneNode();
6976
- addClass([iconBottom], EVENT_ICON_DOWN_CLASS);
6977
- append([iconBottom], element);
6978
- }
6979
- };
6980
7000
  VerticalEvent.prototype.isSpannedEvent = function (record, day, resource) {
6981
7001
  var currentDate = resetTime(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)]);
6982
7002
  var renderedDate = this.getRenderedDates(this.dateRender[parseInt(resource.toString(), 10)]) || [currentDate];
@@ -7820,10 +7840,8 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7820
7840
  }
7821
7841
  else {
7822
7842
  var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
7823
- var appointmentSubject = createElement('div', {
7824
- className: SUBJECT_CLASS,
7825
- innerHTML: (eventSubject + (eventLocation ? ';&nbsp' + eventLocation : ''))
7826
- });
7843
+ var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
7844
+ appointmentSubject.innerText = this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')));
7827
7845
  var appointmentStartTime = createElement('div', {
7828
7846
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''),
7829
7847
  innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])
@@ -7866,7 +7884,8 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7866
7884
  var appTime = createElement('div', {
7867
7885
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''), innerHTML: timeString
7868
7886
  });
7869
- var appLocation = createElement('div', { className: LOCATION_CLASS, innerHTML: eventLocation });
7887
+ var appLocation = createElement('div', { className: LOCATION_CLASS });
7888
+ appLocation.innerText = this.parent.sanitize(eventLocation);
7870
7889
  innerElement = [appointmentSubject, appTime, appLocation];
7871
7890
  }
7872
7891
  var wrap = createElement('div', { className: 'e-inner-wrap' });
@@ -9098,6 +9117,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9098
9117
  cssClass: QUICK_DIALOG_CLASS,
9099
9118
  closeOnEscape: true,
9100
9119
  enableRtl: this.parent.enableRtl,
9120
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
9101
9121
  beforeClose: this.beforeQuickDialogClose.bind(this),
9102
9122
  isModal: true,
9103
9123
  position: { X: 'center', Y: 'center' },
@@ -9129,6 +9149,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9129
9149
  cssClass: className,
9130
9150
  disabled: isDisabled,
9131
9151
  enableRtl: this.parent.enableRtl,
9152
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
9132
9153
  iconCss: iconName
9133
9154
  });
9134
9155
  buttonObj.appendTo(element);
@@ -9324,7 +9345,8 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9324
9345
  append(templateElement, appointmentElement);
9325
9346
  }
9326
9347
  else {
9327
- appointmentElement.appendChild(createElement('div', { className: SUBJECT_CLASS, innerHTML: eventText }));
9348
+ appointmentElement.appendChild(createElement('div', { className: SUBJECT_CLASS }));
9349
+ appointmentElement.firstElementChild.innerText = this_1.parent.sanitize(eventText);
9328
9350
  }
9329
9351
  if (!isNullOrUndefined(groupIndex)) {
9330
9352
  appointmentElement.setAttribute('data-group-index', groupIndex);
@@ -9578,10 +9600,14 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9578
9600
  ("<button class=\"" + (DELETE_CLASS + ' ' + ICON) + "\" title=\"" + this.l10n.getConstant('delete') + "\"></button>") +
9579
9601
  ("<button class=\"" + CLOSE_CLASS + "\" title=\"" + this.l10n.getConstant('close') + "\"></button></div>") +
9580
9602
  ("<div class=\"" + SUBJECT_WRAP + "\"><div class=\"" + SUBJECT_CLASS + " " + TEXT_ELLIPSIS + "\" ") +
9581
- ("title=\"" + (args.eventSubject ? args.eventSubject.replaceAll('"', '\'') : args.eventSubject) + "\">" + args.eventSubject + "</div></div >");
9603
+ ("title=\"" + (args.eventSubject ? args.eventSubject.replaceAll('"', '\'') : args.eventSubject) + "\"></div></div >");
9582
9604
  break;
9583
9605
  }
9584
9606
  var templateWrapper = createElement('div', { innerHTML: header });
9607
+ if (headerType === 'Event') {
9608
+ var subjectText = templateWrapper.querySelector('.' + SUBJECT_CLASS);
9609
+ subjectText.innerText = this.parent.sanitize(args.eventSubject);
9610
+ }
9585
9611
  append([].slice.call(templateWrapper.childNodes), headerTemplate);
9586
9612
  }
9587
9613
  return headerTemplate;
@@ -9609,7 +9635,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9609
9635
  (TEXT_ELLIPSIS + "\">" + cellDetails.details + "</div></div>") +
9610
9636
  ((this.parent.activeViewOptions.group.resources.length > 0 ? "<div class=\"" + RESOURCE_CLASS + "\">" +
9611
9637
  ("<div class=\"" + RESOURCE_ICON_CLASS + " " + ICON + " \"></div><div class=\"" + RESOURCE_DETAILS_CLASS + " ") +
9612
- (TEXT_ELLIPSIS + "\">" + resourceText + "</div></div>") : '') + "</td></tr></tbody></table>");
9638
+ (TEXT_ELLIPSIS + "\"></div></div>") : '') + "</td></tr></tbody></table>");
9613
9639
  break;
9614
9640
  case 'Event':
9615
9641
  argsData = this.getFormattedString(data);
@@ -9623,8 +9649,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9623
9649
  content += '</div></div>';
9624
9650
  if (data[this.parent.eventFields.location]) {
9625
9651
  content += '<div class="' + LOCATION_CLASS + '"><div class="' + LOCATION_ICON_CLASS + ' ' +
9626
- ICON + '"></div><div class="' + LOCATION_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '">' +
9627
- data[this.parent.eventFields.location] + '</div></div>';
9652
+ ICON + '"></div><div class="' + LOCATION_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '"></div></div>';
9628
9653
  }
9629
9654
  if (data[this.parent.eventFields.startTimezone] || data[this.parent.eventFields.endTimezone]) {
9630
9655
  content += '<div class="' + TIME_ZONE_CLASS + '"><div class="' + TIME_ZONE_ICON_CLASS + ' ' + ICON +
@@ -9633,17 +9658,33 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9633
9658
  }
9634
9659
  if (data[this.parent.eventFields.description]) {
9635
9660
  content += '<div class="' + DESCRIPTION_CLASS + '"><div class="' + DESCRIPTION_ICON_CLASS + ' ' + ICON +
9636
- '"></div><div class="' + DESCRIPTION_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '">' +
9637
- data[this.parent.eventFields.description] + '</div></div>';
9661
+ '"></div><div class="' + DESCRIPTION_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '"></div></div>';
9638
9662
  }
9639
9663
  if (this.parent.resourceCollection.length > 0) {
9640
9664
  content += '<div class="' + RESOURCE_CLASS + '"><div class="' + RESOURCE_ICON_CLASS + ' ' + ICON +
9641
- '"></div><div class="' + RESOURCE_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '">' +
9642
- resourceText + '</div></div>';
9665
+ '"></div><div class="' + RESOURCE_DETAILS_CLASS + ' ' + TEXT_ELLIPSIS + '"></div></div>';
9643
9666
  }
9644
9667
  break;
9645
9668
  }
9646
9669
  var templateWrapper = createElement('div', { innerHTML: content });
9670
+ if (data[this.parent.eventFields.location]) {
9671
+ var locationDetails = templateWrapper.querySelector('.' + LOCATION_DETAILS_CLASS);
9672
+ if (!isNullOrUndefined(locationDetails)) {
9673
+ locationDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.location]);
9674
+ }
9675
+ }
9676
+ if (data[this.parent.eventFields.description]) {
9677
+ var descriptionDetails = templateWrapper.querySelector('.' + DESCRIPTION_DETAILS_CLASS);
9678
+ if (!isNullOrUndefined(descriptionDetails)) {
9679
+ descriptionDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.description]);
9680
+ }
9681
+ }
9682
+ if (resourceText) {
9683
+ var resourceDetails = templateWrapper.querySelector('.' + RESOURCE_DETAILS_CLASS);
9684
+ if (!isNullOrUndefined(resourceDetails)) {
9685
+ resourceDetails.innerText = this.parent.sanitize(resourceText);
9686
+ }
9687
+ }
9647
9688
  append([].slice.call(templateWrapper.childNodes), contentTemplate);
9648
9689
  }
9649
9690
  return contentTemplate;
@@ -10181,7 +10222,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
10181
10222
  };
10182
10223
  QuickPopups.prototype.quickPopupClose = function () {
10183
10224
  this.parent.eventBase.focusElement();
10184
- this.quickPopup.relateTo = WORK_CELLS_CLASS;
10225
+ this.quickPopup.relateTo = '.' + WORK_CELLS_CLASS;
10185
10226
  this.fieldValidator.destroyToolTip();
10186
10227
  if (this.quickPopup.element.querySelectorAll('.e-formvalidator').length) {
10187
10228
  this.fieldValidator.destroy();
@@ -10401,7 +10442,8 @@ var EventTooltip = /** @__PURE__ @class */ (function () {
10401
10442
  target: this.getTargets(),
10402
10443
  beforeRender: this.onBeforeRender.bind(this),
10403
10444
  beforeClose: this.onBeforeClose.bind(this),
10404
- enableRtl: this.parent.enableRtl
10445
+ enableRtl: this.parent.enableRtl,
10446
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer
10405
10447
  });
10406
10448
  this.tooltipObj.appendTo(this.parent.element);
10407
10449
  }
@@ -11239,7 +11281,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11239
11281
  '"label="' + REPEATELEMENT.substr(2) + '" />' +
11240
11282
  '</div><div class="' + INPUTWARAPPER + ' ' +
11241
11283
  INTERVALCLASS + ' ' + FORMRIGHT + '"><table class="' + RECURRENCETABLE + ' ' + REPEATCONTENTWRAPPER + '"><tr>' +
11242
- '<td><input type="text" tabindex="0" class="' + REPEATINTERVAL +
11284
+ '<td><input type="text" tabindex="0" id="' + this.element.id + '_' + REPEATINTERVAL + '" class="' + REPEATINTERVAL +
11243
11285
  '"title="' + this.localeObj.getConstant('repeatEvery') + '" /></td>' +
11244
11286
  '<td><span class="' + REPEATCONTENT + '"></span></td>' +
11245
11287
  '</tr></table></div><div class="' + INPUTWARAPPERSIDE + ' ' + DAYWRAPPER + ' ' + FORMLEFT + '">' +
@@ -11263,7 +11305,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11263
11305
  '<input class="' + MONTHEXPANDERELEMENT + '"title="' + this.localeObj.getConstant('monthExpander') + '" type="radio">' +
11264
11306
  '</div></td>' +
11265
11307
  '<td colspan="2"><div class="' + INPUTWARAPPER + ' ' + MONTHDAYELEMENT + '">' +
11266
- '<input type="text" tabindex="0" class="' + MONTHDAYWRAPPER + '"title="' +
11308
+ '<input type="text" tabindex="0" id="' + this.element.id + '_' + MONTHDAYWRAPPER + '" class="' + MONTHDAYWRAPPER + '"title="' +
11267
11309
  this.localeObj.getConstant('on') + '" />' +
11268
11310
  '</div></td></tr>' +
11269
11311
  '<tr><td>' +
@@ -11286,7 +11328,7 @@ var RecurrenceEditor = /** @__PURE__ @class */ (function (_super) {
11286
11328
  '<input type="text" tabindex="0" class="' + UNTILDATE + '"title="' + this.localeObj.getConstant(UNTIL$1) + '" />' +
11287
11329
  '</div>' +
11288
11330
  '<div class="' + INPUTWARAPPER + ' ' + ENDONCOUNTWRAPPER + '">' +
11289
- '<input type="text" tabindex="0" class="' + ENDONCOUNT + '"title="' + this.localeObj.getConstant(COUNT) + '" />' +
11331
+ '<input type="text" tabindex="0" id="' + this.element.id + '_' + ENDONCOUNT + '" class="' + ENDONCOUNT + '"title="' + this.localeObj.getConstant(COUNT) + '" />' +
11290
11332
  '</div></div>' +
11291
11333
  '</div></div>';
11292
11334
  };
@@ -11698,6 +11740,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11698
11740
  content: this.getEventWindowContent(),
11699
11741
  cssClass: EVENT_WINDOW_DIALOG_CLASS,
11700
11742
  enableRtl: this.parent.enableRtl,
11743
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
11701
11744
  height: this.parent.isAdaptive ? '100%' : 'auto',
11702
11745
  minHeight: '300px',
11703
11746
  isModal: true,
@@ -11908,6 +11951,10 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11908
11951
  var _this = this;
11909
11952
  if (!isNullOrUndefined(this.parent.editorTemplate)) {
11910
11953
  if (args) {
11954
+ if (this.fieldValidator) {
11955
+ this.fieldValidator.destroy();
11956
+ this.fieldValidator = null;
11957
+ }
11911
11958
  if (this.recurrenceEditor) {
11912
11959
  this.recurrenceEditor.destroy();
11913
11960
  this.recurrenceEditor = null;
@@ -11990,7 +12037,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11990
12037
  return parentDiv;
11991
12038
  };
11992
12039
  EventWindow.prototype.createRecurrenceEditor = function (parentDiv) {
11993
- var recurrenceEditor = this.createDivElement();
12040
+ var recurrenceEditor = createElement('div', { id: this.parent.element.id + '_recurrence_editor' });
11994
12041
  parentDiv.appendChild(recurrenceEditor);
11995
12042
  this.recurrenceEditor = this.renderRecurrenceEditor();
11996
12043
  this.recurrenceEditor.appendTo(recurrenceEditor);
@@ -12083,6 +12130,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12083
12130
  if (resourceData.allowMultiple) {
12084
12131
  var listObj = new MultiSelect({
12085
12132
  enableRtl: this.parent.enableRtl,
12133
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
12086
12134
  cssClass: this.parent.cssClass || '',
12087
12135
  dataSource: resourceData.dataSource,
12088
12136
  change: this.onMultiselectResourceChange.bind(this),
@@ -12229,6 +12277,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12229
12277
  change: this.onChange.bind(this),
12230
12278
  cssClass: value + ' ' + this.parent.cssClass,
12231
12279
  enableRtl: this.parent.enableRtl,
12280
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
12232
12281
  label: this.getFieldLabel(value)
12233
12282
  });
12234
12283
  checkBox.appendTo(checkBoxInput);
@@ -12355,6 +12404,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12355
12404
  target: this.element,
12356
12405
  animationSettings: { effect: 'Zoom' },
12357
12406
  enableRtl: this.parent.enableRtl,
12407
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
12358
12408
  isModal: true,
12359
12409
  cssClass: REPEAT_DIALOG_CLASS,
12360
12410
  open: this.repeatOpenDialog.bind(this)
@@ -12422,6 +12472,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12422
12472
  if (!this.parent.eventSettings.allowAdding) {
12423
12473
  return;
12424
12474
  }
12475
+ if (this.parent.isAdaptive && repeatType && !this.repeatDialogObject) {
12476
+ this.renderRepeatDialog();
12477
+ }
12425
12478
  this.element.querySelector('.' + FORM_CLASS).removeAttribute('data-id');
12426
12479
  this.element.querySelector('.' + EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('newEvent');
12427
12480
  eventObj.Timezone = false;
@@ -12451,10 +12504,18 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12451
12504
  selectedType: !isNullOrUndefined(repeatType) ? repeatType : !isNullOrUndefined(eventObj[this.fields.recurrenceRule]) ?
12452
12505
  this.recurrenceEditor.selectedType : 0
12453
12506
  });
12507
+ this.repeatRule = this.recurrenceEditor.value;
12454
12508
  }
12455
12509
  if (this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {
12456
12510
  var element = this.element.querySelector('.' + REPEAT_CONTAINER_CLASS);
12457
- addClass([element], HIDE_STYLE_CLASS);
12511
+ if (eventObj[this.fields.recurrenceRule] || repeatType) {
12512
+ removeClass([element], HIDE_STYLE_CLASS);
12513
+ this.repeatStatus.setProperties({ checked: true });
12514
+ }
12515
+ else {
12516
+ addClass([element], HIDE_STYLE_CLASS);
12517
+ this.repeatStatus.setProperties({ checked: false });
12518
+ }
12458
12519
  this.updateRepeatLabel(this.repeatRule);
12459
12520
  }
12460
12521
  else {
@@ -13109,9 +13170,11 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13109
13170
  }
13110
13171
  var currentStartTime = new Date(+currentData[this.fields.startTime]);
13111
13172
  var currentEndTime = new Date(+currentData[this.fields.endTime]);
13173
+ var nextStartTime;
13174
+ var nextEndTime;
13112
13175
  if (index !== recurColl.length - 1) {
13113
- var nextStartTime = new Date(+recurColl[index + 1][this.fields.startTime]);
13114
- var nextEndTime = new Date(+recurColl[index + 1][this.fields.endTime]);
13176
+ nextStartTime = new Date(+recurColl[index + 1][this.fields.startTime]);
13177
+ nextEndTime = new Date(+recurColl[index + 1][this.fields.endTime]);
13115
13178
  }
13116
13179
  var lastEndTime = new Date(+recurColl[recurColl.length - 1][this.fields.endTime]);
13117
13180
  if (index === 0) {
@@ -13310,7 +13373,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13310
13373
  value = element.checked;
13311
13374
  }
13312
13375
  else {
13313
- value = SanitizeHtmlHelper.sanitize(element.value);
13376
+ value = this.parent.sanitize(element.value);
13314
13377
  }
13315
13378
  }
13316
13379
  return value;
@@ -13640,7 +13703,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13640
13703
  }
13641
13704
  if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
13642
13705
  this.parent.showSpinner();
13643
- var selectedEle = this.parent.getSelectedElements();
13706
+ var selectedEle = this.parent.getSelectedCells();
13644
13707
  this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13645
13708
  this.updateContent(resWrap, conWrap, eventWrap, resCollection);
13646
13709
  this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
@@ -13825,7 +13888,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13825
13888
  };
13826
13889
  VirtualScroll.prototype.updateHorizontalContent = function (conWrap, resCollection) {
13827
13890
  this.parent.resourceBase.expandedResources = resCollection;
13828
- var selectedEle = this.parent.getSelectedElements();
13891
+ var selectedEle = this.parent.getSelectedCells();
13829
13892
  this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13830
13893
  var renderedLength = conWrap.querySelectorAll('tbody tr').length;
13831
13894
  for (var i = 0; i < renderedLength; i++) {
@@ -14294,7 +14357,9 @@ var Crud = /** @__PURE__ @class */ (function () {
14294
14357
  }
14295
14358
  }
14296
14359
  }
14297
- this.parent.resetTemplates(templateNames);
14360
+ if (templateNames.length > 0) {
14361
+ this.parent.resetTemplates(templateNames);
14362
+ }
14298
14363
  }
14299
14364
  if (isVirtualScrollAction) {
14300
14365
  this.parent.notify(dataReady, { processedData: this.parent.eventsProcessed });
@@ -14375,6 +14440,9 @@ var Crud = /** @__PURE__ @class */ (function () {
14375
14440
  return;
14376
14441
  }
14377
14442
  var addEvents = (eventData instanceof Array) ? eventData : [eventData];
14443
+ if (addEvents.length === 0) {
14444
+ return;
14445
+ }
14378
14446
  var args = {
14379
14447
  requestType: 'eventCreate', cancel: false, data: addEvents,
14380
14448
  addedRecords: addEvents, changedRecords: [], deletedRecords: []
@@ -14412,6 +14480,11 @@ var Crud = /** @__PURE__ @class */ (function () {
14412
14480
  if (this.parent.currentAction !== 'EditFollowingEvents' && !this.isBlockEvent(eventData)
14413
14481
  && this.parent.eventBase.isBlockRange(eventData)) {
14414
14482
  this.parent.quickPopup.openValidationError('blockAlert', eventData);
14483
+ this.parent.crudModule.crudObj.isCrudAction = false;
14484
+ return;
14485
+ }
14486
+ var updateEvents = (eventData instanceof Array) ? eventData : [eventData];
14487
+ if (updateEvents.length === 0) {
14415
14488
  return;
14416
14489
  }
14417
14490
  this.parent.currentAction = action;
@@ -14432,7 +14505,6 @@ var Crud = /** @__PURE__ @class */ (function () {
14432
14505
  }
14433
14506
  }
14434
14507
  else {
14435
- var updateEvents = (eventData instanceof Array) ? eventData : [eventData];
14436
14508
  var args = {
14437
14509
  requestType: 'eventChange', cancel: false, data: eventData,
14438
14510
  addedRecords: [], changedRecords: updateEvents, deletedRecords: []
@@ -14479,6 +14551,9 @@ var Crud = /** @__PURE__ @class */ (function () {
14479
14551
  else {
14480
14552
  deleteEvents = (eventData instanceof Array ? eventData : [eventData]);
14481
14553
  }
14554
+ if (deleteEvents.length === 0) {
14555
+ return;
14556
+ }
14482
14557
  if (action) {
14483
14558
  switch (action) {
14484
14559
  case 'Delete':
@@ -15123,8 +15198,8 @@ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators,
15123
15198
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15124
15199
  };
15125
15200
  /**
15126
- * A Class that holds the collection of event fields that requires to be mapped with the dataSource
15127
- * fields along with its available configuration settings. Each field in it accepts both string and Object
15201
+ * A class that holds the collection of event fields that requires to be mapped with the dataSource
15202
+ * fields along with its available configuration settings. Each field in it accepts both string and object
15128
15203
  * data type. When each of the field is assigned with simple `string` value, it is assumed that the dataSource field
15129
15204
  * name is mapped with it. If the `object` type is defined on each fields, then the validation related settings and mapping of
15130
15205
  * those fields with dataSource can be given altogether within it.
@@ -15261,6 +15336,9 @@ var EventSettings = /** @__PURE__ @class */ (function (_super) {
15261
15336
  __decorate$6([
15262
15337
  Property()
15263
15338
  ], EventSettings.prototype, "sortComparer", void 0);
15339
+ __decorate$6([
15340
+ Property()
15341
+ ], EventSettings.prototype, "includeFiltersInQuery", void 0);
15264
15342
  return EventSettings;
15265
15343
  }(ChildProperty));
15266
15344
 
@@ -15581,7 +15659,7 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15581
15659
  classList(target, [RESOURCE_COLLAPSE_CLASS], [RESOURCE_EXPAND_CLASS]);
15582
15660
  hide = false;
15583
15661
  }
15584
- var eventElements = [].slice.call(_this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
15662
+ var eventElements = [].slice.call(_this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS + ',.' + MORE_INDICATOR_CLASS));
15585
15663
  for (var _i = 0, eventElements_1 = eventElements; _i < eventElements_1.length; _i++) {
15586
15664
  var element = eventElements_1[_i];
15587
15665
  remove(element);
@@ -15711,6 +15789,7 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15711
15789
  this.treeViewObj = new TreeView({
15712
15790
  cssClass: this.parent.cssClass,
15713
15791
  enableRtl: this.parent.enableRtl,
15792
+ enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
15714
15793
  fields: {
15715
15794
  dataSource: [].slice.call(this.generateTreeData()),
15716
15795
  id: 'resourceId',
@@ -15815,10 +15894,8 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15815
15894
  var resourceText = resourceLevel.dataSource.filter(function (resData) {
15816
15895
  return resData[resourceLevel.idField] === resource.groupOrder[parseInt(i.toString(), 10)];
15817
15896
  });
15818
- var resourceName = createElement('div', {
15819
- className: RESOURCE_NAME,
15820
- innerHTML: resourceText[0][resourceLevel.textField]
15821
- });
15897
+ var resourceName = createElement('div', { className: RESOURCE_NAME });
15898
+ resourceName.innerText = this_2.parent.sanitize(resourceText[0][resourceLevel.textField]);
15822
15899
  headerCollection.push(resourceName);
15823
15900
  var levelIcon = createElement('div', { className: 'e-icons e-icon-next' });
15824
15901
  headerCollection.push(levelIcon);
@@ -15898,7 +15975,7 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15898
15975
  var promises = [];
15899
15976
  for (var _i = 0, _a = this.parent.resources; _i < _a.length; _i++) {
15900
15977
  var resource = _a[_i];
15901
- var dataModule = new Data(resource.dataSource, resource.query);
15978
+ var dataModule = new Data(this.parent, resource.dataSource, resource.query);
15902
15979
  promises.push(dataModule.getData(dataModule.generateQuery()));
15903
15980
  }
15904
15981
  Promise.all(promises).then(function (e) { return _this.dataManagerSuccess(e, isSetModel); })
@@ -16471,7 +16548,9 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
16471
16548
  if (this.treeViewObj) {
16472
16549
  if (this.treeViewObj.portals && this.treeViewObj.portals.length > 0) {
16473
16550
  var treeViewTemplates = this.treeViewObj.portals.map(function (x) { return x.propName; });
16474
- this.parent.resetTemplates(treeViewTemplates);
16551
+ if (treeViewTemplates.length > 0) {
16552
+ this.parent.resetTemplates(treeViewTemplates);
16553
+ }
16475
16554
  }
16476
16555
  this.treeViewObj.destroy();
16477
16556
  this.treeViewObj = null;
@@ -16596,7 +16675,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16596
16675
  /**
16597
16676
  * Method to render react templates
16598
16677
  *
16599
- * @param {Function} callBack - specifies the callBack method
16678
+ * @param {Function} callback - Specifies the callBack method
16600
16679
  * @returns {void}
16601
16680
  * @private
16602
16681
  */
@@ -16620,6 +16699,19 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16620
16699
  this.clearTemplate(templates);
16621
16700
  }
16622
16701
  };
16702
+ /**
16703
+ * Method to sanitize any suspected untrusted strings and scripts before rendering them.
16704
+ *
16705
+ * @param {string} value - A string value representing the HTML string value to be sanitized.
16706
+ * @returns {string} A sanitized Html string.
16707
+ * @private
16708
+ */
16709
+ Schedule.prototype.sanitize = function (value) {
16710
+ if (this.enableHtmlSanitizer) {
16711
+ return SanitizeHtmlHelper.sanitize(value);
16712
+ }
16713
+ return value;
16714
+ };
16623
16715
  Schedule.prototype.initializeResources = function (isSetModel) {
16624
16716
  if (isSetModel === void 0) { isSetModel = false; }
16625
16717
  if (this.resources.length > 0) {
@@ -16833,7 +16925,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16833
16925
  followingID: this.eventSettings.fields.followingID
16834
16926
  };
16835
16927
  this.setEditorTitles();
16836
- this.dataModule = new Data(this.eventSettings.dataSource, this.eventSettings.query);
16928
+ this.dataModule = new Data(this, this.eventSettings.dataSource, this.eventSettings.query);
16837
16929
  this.crudModule = new Crud(this);
16838
16930
  };
16839
16931
  Schedule.prototype.setEditorTitles = function () {
@@ -17250,13 +17342,18 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17250
17342
  * @private
17251
17343
  */
17252
17344
  Schedule.prototype.removeSelectedClass = function () {
17253
- var selectedCells = this.getSelectedElements();
17345
+ var selectedCells = this.getSelectedCells();
17254
17346
  for (var _i = 0, selectedCells_1 = selectedCells; _i < selectedCells_1.length; _i++) {
17255
17347
  var cell = selectedCells_1[_i];
17256
- cell.setAttribute('aria-selected', 'false');
17348
+ if (this.currentView !== 'Year') {
17349
+ cell.setAttribute('aria-selected', 'false');
17350
+ }
17257
17351
  cell.removeAttribute('tabindex');
17258
17352
  }
17259
17353
  removeClass(selectedCells, SELECTED_CELL_CLASS);
17354
+ if (this.keyboardInteractionModule && this.keyboardInteractionModule.selectedCells.length > 0) {
17355
+ this.keyboardInteractionModule.selectedCells = [];
17356
+ }
17260
17357
  };
17261
17358
  /**
17262
17359
  * Method to add selected class
@@ -17268,9 +17365,11 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17268
17365
  * @private
17269
17366
  */
17270
17367
  Schedule.prototype.addSelectedClass = function (cells, focusCell, isPreventScroll) {
17271
- for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
17272
- var cell = cells_1[_i];
17273
- cell.setAttribute('aria-selected', 'true');
17368
+ if (this.currentView !== 'Year') {
17369
+ for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
17370
+ var cell = cells_1[_i];
17371
+ cell.setAttribute('aria-selected', 'true');
17372
+ }
17274
17373
  }
17275
17374
  addClass(cells, SELECTED_CELL_CLASS);
17276
17375
  if (focusCell) {
@@ -17636,6 +17735,15 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17636
17735
  }
17637
17736
  return undefined;
17638
17737
  };
17738
+ /**
17739
+ * Retrieves the selected cells.
17740
+ *
17741
+ * @returns {Element[]} The elements of currently selected cells will be returned.
17742
+ * @private
17743
+ */
17744
+ Schedule.prototype.getSelectedCells = function () {
17745
+ return [].slice.call(this.element.querySelectorAll('.' + SELECTED_CELL_CLASS));
17746
+ };
17639
17747
  /**
17640
17748
  * Method to generate the announcement string
17641
17749
  *
@@ -18094,6 +18202,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
18094
18202
  case 'dataSource':
18095
18203
  case 'query':
18096
18204
  case 'fields':
18205
+ case 'includeFiltersInQuery':
18097
18206
  this.initializeDataModule();
18098
18207
  state.isDataManager = true;
18099
18208
  break;
@@ -18326,7 +18435,10 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
18326
18435
  * @returns {Element[]} The elements of currently selected cells will be returned.
18327
18436
  */
18328
18437
  Schedule.prototype.getSelectedElements = function () {
18329
- return [].slice.call(this.element.querySelectorAll('.' + SELECTED_CELL_CLASS));
18438
+ if (this.keyboardInteractionModule && this.keyboardInteractionModule.selectedCells.length > 0) {
18439
+ return this.keyboardInteractionModule.selectedCells;
18440
+ }
18441
+ return this.getSelectedCells();
18330
18442
  };
18331
18443
  /**
18332
18444
  * To get the resource collection
@@ -18493,6 +18605,17 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
18493
18605
  Schedule.prototype.addEvent = function (data) {
18494
18606
  this.crudModule.addEvent(data);
18495
18607
  };
18608
+ /**
18609
+ * Generates the occurrences of a single recurrence event based on the provided event.
18610
+ *
18611
+ * @function generateEventOccurrences
18612
+ * @param {Object} event Accepts the parent recurrence event from which the occurrences are generated.
18613
+ * @param {Date} startDate Accepts the start date for the event occurrences. If not provided, the event's start date will be used.
18614
+ * @returns {Object[]} Returns the collection of occurrence event objects.
18615
+ */
18616
+ Schedule.prototype.generateEventOccurrences = function (event, startDate) {
18617
+ return (this.eventBase) ? this.eventBase.generateOccurrence(event, startDate) : [];
18618
+ };
18496
18619
  /**
18497
18620
  * Allows the Scheduler events data to be exported as an Excel file either in .xlsx or .csv file formats.
18498
18621
  * By default, the whole event collection bound to the Scheduler gets exported as an Excel file.
@@ -19168,6 +19291,9 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
19168
19291
  __decorate([
19169
19292
  Property(null)
19170
19293
  ], Schedule.prototype, "timeFormat", void 0);
19294
+ __decorate([
19295
+ Property(true)
19296
+ ], Schedule.prototype, "enableHtmlSanitizer", void 0);
19171
19297
  __decorate([
19172
19298
  Property(false)
19173
19299
  ], Schedule.prototype, "enableAllDayScroll", void 0);
@@ -19421,6 +19547,7 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19421
19547
  parseInt(this.actionObj.element.getAttribute('data-group-index'), 10) === this.actionObj.groupIndex : true;
19422
19548
  if (+eventObj[this.parent.eventFields.startTime] === +this.actionObj.event[this.parent.eventFields.startTime] &&
19423
19549
  +eventObj[this.parent.eventFields.endTime] === +this.actionObj.event[this.parent.eventFields.endTime] && isSameResource) {
19550
+ this.parent.crudModule.crudObj.isCrudAction = false;
19424
19551
  return;
19425
19552
  }
19426
19553
  if (eventObj[this.parent.eventFields.recurrenceRule]) {
@@ -19702,6 +19829,10 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19702
19829
  }
19703
19830
  appWidth = eventObj.isSpanned.count * this.actionObj.cellWidth;
19704
19831
  }
19832
+ if (!isResize && this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length !== 0) {
19833
+ var eventObj = this.yearEvent.isSpannedEvent(event, event[this.parent.eventFields.startTime]);
19834
+ appWidth = eventObj.isSpanned.count * this.actionObj.cellWidth;
19835
+ }
19705
19836
  var appointmentElement = this.createAppointmentElement(this.actionObj.groupIndex, event[this.parent.eventFields.subject]);
19706
19837
  appointmentElement.setAttribute('drag', 'true');
19707
19838
  addClass([appointmentElement], CLONE_ELEMENT_CLASS);
@@ -20485,8 +20616,9 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20485
20616
  }
20486
20617
  };
20487
20618
  YearEvent.prototype.timelineYearViewEvents = function () {
20619
+ var _this = this;
20488
20620
  var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
20489
- this.cellWidth = workCell.offsetWidth;
20621
+ this.cellWidth = workCell.getBoundingClientRect().width;
20490
20622
  this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
20491
20623
  var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20492
20624
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -20512,10 +20644,10 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20512
20644
  if (this.parent.activeViewOptions.orientation === 'Vertical') {
20513
20645
  var wrapper_1 = wrapperCollection[parseInt(dayIndex.toString(), 10)];
20514
20646
  td = dayIndex + 1;
20515
- var eventWrapper_1 = wrapper_1.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
20516
- if (!eventWrapper_1) {
20517
- eventWrapper_1 = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
20518
- wrapper_1.appendChild(eventWrapper_1);
20647
+ eventWrapper = wrapper_1.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
20648
+ if (!eventWrapper) {
20649
+ eventWrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
20650
+ wrapper_1.appendChild(eventWrapper);
20519
20651
  }
20520
20652
  if (this.parent.enableRtl) {
20521
20653
  rightValue = row * this.cellWidth;
@@ -20568,8 +20700,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20568
20700
  return "continue";
20569
20701
  }
20570
20702
  }
20571
- var isRowAutoHeight = this_1.parent.rowAutoHeight && this_1.parent.activeViewOptions.orientation === 'Horizontal';
20572
- if (isRowAutoHeight || this_1.cellHeight > availedHeight) {
20703
+ if (this_1.parent.rowAutoHeight || this_1.cellHeight > availedHeight) {
20573
20704
  this_1.renderEvent(eventWrapper, eventData, row, leftValue, rightValue, monthStart, dayIndex);
20574
20705
  this_1.updateCellHeight(rowTd, availedHeight);
20575
20706
  isSpannedCollection.push(eventData);
@@ -20595,6 +20726,19 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20595
20726
  }
20596
20727
  }
20597
20728
  }
20729
+ if (this.parent.rowAutoHeight && this.parent.activeViewOptions.orientation === 'Vertical') {
20730
+ var appContainer = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
20731
+ var tr_1 = [].slice.call(this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr'));
20732
+ appContainer.forEach(function (ele, index) {
20733
+ var app = [].slice.call(ele.querySelectorAll('.' + APPOINTMENT_CLASS));
20734
+ var appTop = tr_1[parseInt(index.toString(), 10)].offsetTop + _this.cellHeader + EVENT_GAP$2;
20735
+ app.forEach(function (app) {
20736
+ var overlap = parseInt(app.getAttribute('data-index'), 10);
20737
+ app.style.top = appTop + (overlap * _this.eventHeight) + 'px';
20738
+ app.removeAttribute('data-index');
20739
+ });
20740
+ });
20741
+ }
20598
20742
  };
20599
20743
  YearEvent.prototype.updateSpannedEvents = function (eventObj, dayStart, dayEnd) {
20600
20744
  var isLeftRightResize = (this.isResource && this.parent.activeViewOptions.orientation === 'Vertical') ||
@@ -20609,7 +20753,8 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20609
20753
  }
20610
20754
  }
20611
20755
  if ((dayEnd.getTime() >= eventObj[this.fields.endTime].getTime()) || (isLeftRightResize && !this.isResource &&
20612
- addDays(dayEnd, -1).getMonth() === eventObj[this.fields.endTime].getMonth())) {
20756
+ addDays(dayEnd, -1).getMonth() === eventObj[this.fields.endTime].getMonth()) ||
20757
+ (isLeftRightResize && this.isResource && (dayEnd.getTime() <= eventObj[this.fields.endTime].getTime()))) {
20613
20758
  if (isLeftRightResize) {
20614
20759
  data.isRight = false;
20615
20760
  }
@@ -20620,8 +20765,11 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20620
20765
  eventObj.data = data;
20621
20766
  };
20622
20767
  YearEvent.prototype.timelineResourceEvents = function () {
20768
+ var _this = this;
20769
+ var contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
20770
+ var isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
20623
20771
  var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20624
- this.cellWidth = workCell.offsetWidth;
20772
+ this.cellWidth = workCell.getBoundingClientRect().width;
20625
20773
  this.cellHeader = 0;
20626
20774
  var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20627
20775
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
@@ -20649,6 +20797,39 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20649
20797
  }
20650
20798
  }
20651
20799
  }
20800
+ if (this.parent.rowAutoHeight && !isVerticalScrollbarAvail && contentTable.offsetWidth > contentTable.clientWidth) {
20801
+ var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
20802
+ appointments.forEach(function (ele) {
20803
+ ele.style.removeProperty('left');
20804
+ ele.style.removeProperty('right');
20805
+ });
20806
+ var appContainer = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
20807
+ var conTable_1 = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
20808
+ var tr_2 = [].slice.call(conTable_1.querySelectorAll('tbody tr'));
20809
+ appContainer.forEach(function (ele, index) {
20810
+ var appWrapper = [].slice.call(ele.children);
20811
+ var row = tr_2[parseInt(index.toString(), 10)];
20812
+ appWrapper.forEach(function (appWrap, cellIndex) {
20813
+ var td = row.querySelector("td:nth-child(" + (cellIndex + 1) + ")");
20814
+ var app = [].slice.call(appWrap.children);
20815
+ var width = td.getBoundingClientRect().width;
20816
+ var left = td.offsetLeft;
20817
+ if (_this.parent.enableRtl) {
20818
+ var right_1 = conTable_1.offsetWidth - left - td.offsetWidth;
20819
+ app.forEach(function (app) {
20820
+ app.style.width = Math.floor(parseInt(app.style.width, 10) / width) * width + 'px';
20821
+ app.style.right = right_1 + 'px';
20822
+ });
20823
+ }
20824
+ else {
20825
+ app.forEach(function (app) {
20826
+ app.style.width = Math.floor(parseInt(app.style.width, 10) / width) * width + 'px';
20827
+ app.style.left = left + 'px';
20828
+ });
20829
+ }
20830
+ });
20831
+ });
20832
+ }
20652
20833
  };
20653
20834
  YearEvent.prototype.renderResourceEvent = function (wrapper, resource, month, index, monthStart) {
20654
20835
  var eventWrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
@@ -20659,39 +20840,60 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20659
20840
  var td = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + (rowIndex + 1) + ") td");
20660
20841
  this.cellHeight = td.offsetHeight;
20661
20842
  this.groupOrder = resource.groupOrder;
20662
- for (var a = 0; a < eventDatas.length; a++) {
20843
+ var isSpannedCollection = [];
20844
+ var _loop_2 = function (a) {
20663
20845
  var data = eventDatas[parseInt(a.toString(), 10)];
20664
20846
  var overlapIndex = void 0;
20665
20847
  var eventData = extend({}, data, null, true);
20666
- if (this.parent.activeViewOptions.group.resources.length > 0) {
20667
- var eventObj = this.isSpannedEvent(eventData, monthStart);
20668
- overlapIndex = this.getIndex(eventObj[this.fields.startTime]);
20848
+ if (this_2.parent.activeViewOptions.group.resources.length > 0) {
20849
+ var eventObj = this_2.isSpannedEvent(eventData, monthStart);
20850
+ overlapIndex = this_2.getIndex(eventObj[this_2.fields.startTime]);
20669
20851
  eventData.Index = overlapIndex;
20670
20852
  }
20671
20853
  else {
20672
- overlapIndex = this.getIndex(eventData[this.fields.startTime]);
20854
+ overlapIndex = this_2.getIndex(eventData[this_2.fields.startTime]);
20673
20855
  eventData.Index = overlapIndex;
20674
20856
  }
20675
- var availedHeight = this.cellHeader + (this.eventHeight * (a + 1)) + EVENT_GAP$2 + this.moreIndicatorHeight;
20676
- var leftValue = (this.parent.activeViewOptions.orientation === 'Vertical') ?
20677
- month * this.cellWidth : index * this.cellWidth;
20678
- if (!this.parent.isMinMaxDate(eventData[this.fields.startTime])) {
20679
- return;
20857
+ var availedHeight = this_2.cellHeader + (this_2.eventHeight * (a + 1)) + EVENT_GAP$2 + this_2.moreIndicatorHeight;
20858
+ var leftValue = (this_2.parent.activeViewOptions.orientation === 'Vertical') ?
20859
+ month * this_2.cellWidth : index * this_2.cellWidth;
20860
+ if (!this_2.parent.isMinMaxDate(eventData[this_2.fields.startTime])) {
20861
+ return { value: void 0 };
20862
+ }
20863
+ if (this_2.parent.activeViewOptions.orientation === 'Vertical' && this_2.parent.activeViewOptions.group.resources.length > 0) {
20864
+ var isRendered = this_2.renderedEvents.filter(function (eventObj) {
20865
+ return eventObj.Guid === eventData.Guid;
20866
+ });
20867
+ var isSpanned = isSpannedCollection.filter(function (eventObj) {
20868
+ return eventObj.Guid === eventData.Guid;
20869
+ });
20870
+ if (isRendered.length > 0 || isSpanned.length > 0) {
20871
+ return "continue";
20872
+ }
20680
20873
  }
20681
- if (this.parent.rowAutoHeight || this.cellHeight > availedHeight) {
20682
- this.renderEvent(eventWrapper, eventData, month, leftValue, leftValue, monthStart, index);
20683
- this.updateCellHeight(td, availedHeight);
20874
+ if (this_2.parent.rowAutoHeight || this_2.cellHeight > availedHeight) {
20875
+ this_2.renderEvent(eventWrapper, eventData, month, leftValue, leftValue, monthStart, index);
20876
+ this_2.updateCellHeight(td, availedHeight);
20877
+ isSpannedCollection.push(eventData);
20684
20878
  }
20685
20879
  else {
20686
- var moreIndex = this.parent.activeViewOptions.orientation === 'Horizontal' ? month : index;
20687
- this.renderMoreIndicator(eventWrapper, eventDatas.length - a, monthStart, moreIndex, leftValue, leftValue, index);
20688
- if (this.parent.activeViewOptions.orientation === 'Horizontal') {
20880
+ var moreIndex = this_2.parent.activeViewOptions.orientation === 'Horizontal' ? month : index;
20881
+ this_2.renderMoreIndicator(eventWrapper, eventDatas.length - a, monthStart, moreIndex, leftValue, leftValue, index);
20882
+ if (this_2.parent.activeViewOptions.orientation === 'Horizontal') {
20689
20883
  for (var i = index; i < eventDatas.length; i++) {
20690
- this.renderedEvents.push(extend({}, eventDatas[parseInt(i.toString(), 10)], { Index: overlapIndex + i }, true));
20884
+ this_2.renderedEvents.push(extend({}, eventDatas[parseInt(i.toString(), 10)], { Index: overlapIndex + i }, true));
20691
20885
  }
20692
20886
  }
20693
- break;
20887
+ return "break";
20694
20888
  }
20889
+ };
20890
+ var this_2 = this;
20891
+ for (var a = 0; a < eventDatas.length; a++) {
20892
+ var state_1 = _loop_2(a);
20893
+ if (typeof state_1 === "object")
20894
+ return state_1.value;
20895
+ if (state_1 === "break")
20896
+ break;
20695
20897
  }
20696
20898
  };
20697
20899
  // eslint-disable-next-line max-len
@@ -20717,13 +20919,16 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20717
20919
  }
20718
20920
  else {
20719
20921
  index = rowIndex + 1;
20720
- width = this.cellWidth;
20922
+ width = this.isResource ? eventObj.isSpanned.count * this.cellWidth : this.cellWidth;
20721
20923
  }
20722
20924
  var rowTd = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + index + ") td");
20723
20925
  var top = rowTd.offsetTop + this.cellHeader + (this.eventHeight * eventObj.Index) + EVENT_GAP$2;
20724
20926
  setStyleAttribute(wrap, {
20725
20927
  'width': width + 'px', 'height': this.eventHeight + 'px', 'left': left + 'px', 'right': right + 'px', 'top': top + 'px'
20726
20928
  });
20929
+ if (!this.isResource && this.parent.rowAutoHeight && this.parent.activeViewOptions.orientation === 'Vertical') {
20930
+ wrap.setAttribute('data-index', eventObj.Index.toString());
20931
+ }
20727
20932
  var args = { data: eventObj, element: wrap, cancel: false, type: 'event' };
20728
20933
  this.parent.trigger(eventRendered, args, function (eventArgs) {
20729
20934
  if (!eventArgs.cancel) {
@@ -20829,6 +21034,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20829
21034
  var appointmentDetails = createElement('div', { className: APPOINTMENT_DETAILS });
20830
21035
  append(templateElement, appointmentDetails);
20831
21036
  eventWrapper.appendChild(appointmentDetails);
21037
+ this.parent.eventBase.renderSpannedIcon(eventWrapper, record.isSpanned);
20832
21038
  this.renderResizeHandler(eventWrapper, record.data, record[this.fields.isReadonly]);
20833
21039
  this.applyResourceColor(eventWrapper, eventObj, 'backgroundColor', this.groupOrder);
20834
21040
  return eventWrapper;
@@ -20840,24 +21046,28 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20840
21046
  var eventStart = eventData[this.fields.startTime];
20841
21047
  var eventEnd = eventData[this.fields.endTime];
20842
21048
  var isSpanned = { isLeft: false, isRight: false, count: 1 };
21049
+ var yearStart = new Date(this.parent.selectedDate.getFullYear(), this.parent.firstMonthOfYear, 1);
21050
+ var yearEnd = addMonths(yearStart, this.parent.monthsCount);
20843
21051
  if (this.isResource) {
20844
21052
  this.updateSpannedEvents(eventObj, monthStart, monthEnd);
20845
21053
  }
20846
- if (eventStart.getTime() < monthStart.getTime()) {
20847
- eventData[this.fields.startTime] = monthStart;
20848
- isSpanned.isLeft = true;
20849
- }
20850
- if (eventEnd.getTime() > monthEnd.getTime()) {
20851
- eventData[this.fields.endTime] = monthEnd;
20852
- isSpanned.isRight = true;
21054
+ if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0) {
21055
+ this.updateSpannedEventDetails(eventStart, eventEnd, yearStart, yearEnd, eventData, isSpanned);
21056
+ var originalStartTime = eventData[this.fields.startTime];
21057
+ var originalEndTime = new Date(eventData[this.fields.endTime] - 1);
21058
+ isSpanned.count = (originalEndTime.getMonth() - originalStartTime.getMonth()) +
21059
+ (this.parent.monthsCount * (originalEndTime.getFullYear() - originalStartTime.getFullYear())) + 1;
20853
21060
  }
20854
- if (this.parent.activeViewOptions.group.resources.length === 0 || this.parent.uiStateValues.isGroupAdaptive) {
20855
- var end = resetTime(eventData[this.fields.endTime]).getTime();
20856
- var start = resetTime(eventData[this.fields.startTime]).getTime();
20857
- if (eventObj[this.fields.isAllDay] && end === eventObj[this.fields.endTime].getTime() || isSpanned.isRight) {
20858
- end = addDays(new Date(end), -1).getTime();
21061
+ else {
21062
+ this.updateSpannedEventDetails(eventStart, eventEnd, monthStart, monthEnd, eventData, isSpanned);
21063
+ if (this.parent.activeViewOptions.group.resources.length === 0 || this.parent.uiStateValues.isGroupAdaptive) {
21064
+ var end = resetTime(eventData[this.fields.endTime]).getTime();
21065
+ var start = resetTime(eventData[this.fields.startTime]).getTime();
21066
+ if (eventObj[this.fields.isAllDay] && end === eventObj[this.fields.endTime].getTime() || isSpanned.isRight) {
21067
+ end = addDays(new Date(end), -1).getTime();
21068
+ }
21069
+ isSpanned.count = Math.ceil((end - start) / MS_PER_DAY) + 1;
20859
21070
  }
20860
- isSpanned.count = Math.ceil((end - start) / MS_PER_DAY) + 1;
20861
21071
  }
20862
21072
  eventData.isSpanned = isSpanned;
20863
21073
  if (resetTime(eventStart).getTime() < resetTime(this.parent.minDate).getTime()) {
@@ -20868,6 +21078,16 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20868
21078
  }
20869
21079
  return eventData;
20870
21080
  };
21081
+ YearEvent.prototype.updateSpannedEventDetails = function (eventStart, eventEnd, viewStart, viewEnd, eventObj, isSpanned) {
21082
+ if (eventStart.getTime() < viewStart.getTime()) {
21083
+ eventObj[this.fields.startTime] = viewStart;
21084
+ isSpanned.isLeft = true;
21085
+ }
21086
+ if (eventEnd.getTime() > viewEnd.getTime()) {
21087
+ eventObj[this.fields.endTime] = viewEnd;
21088
+ isSpanned.isRight = true;
21089
+ }
21090
+ };
20871
21091
  YearEvent.prototype.getOverlapEvents = function (date, appointments) {
20872
21092
  var appointmentsList = [];
20873
21093
  var dateStart;
@@ -20891,19 +21111,11 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20891
21111
  var app = appointments_1[_i];
20892
21112
  var appStart = new Date(app[this.fields.startTime].getTime());
20893
21113
  var appEnd = new Date(app[this.fields.endTime].getTime());
20894
- if (this.parent.activeViewOptions.orientation === 'Vertical' &&
20895
- this.parent.activeViewOptions.group.resources.length > 0) {
20896
- if ((resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
20897
- appointmentsList.push(app);
20898
- }
20899
- }
20900
- else {
20901
- var timeCondition = app[this.fields.isAllDay] ? resetTime(appEnd).getTime() > dateStart :
20902
- resetTime(appEnd).getTime() >= dateStart;
20903
- if (((resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
20904
- (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
20905
- appointmentsList.push(app);
20906
- }
21114
+ var timeCondition = app[this.fields.isAllDay] ? resetTime(appEnd).getTime() > dateStart :
21115
+ resetTime(appEnd).getTime() >= dateStart;
21116
+ if (((resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
21117
+ (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
21118
+ appointmentsList.push(app);
20907
21119
  }
20908
21120
  }
20909
21121
  return appointmentsList;
@@ -21662,7 +21874,12 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
21662
21874
  };
21663
21875
  DragAndDrop.prototype.getDayIndex = function (event) {
21664
21876
  var eventObj = extend({}, event, null, true);
21665
- var startTime = resetTime(eventObj[this.parent.eventFields.startTime]).getTime();
21877
+ var startDate = resetTime(eventObj[this.parent.eventFields.startTime]);
21878
+ if (this.parent.activeViewOptions.timeScale.enable && !eventObj[this.parent.eventFields.isAllDay]) {
21879
+ var startHour = this.parent.activeView.getStartHour();
21880
+ startDate.setMilliseconds(startHour.getTime() - resetTime(startHour).getTime());
21881
+ }
21882
+ var startTime = startDate.getTime();
21666
21883
  var query = '';
21667
21884
  var wrapper = DAY_WRAPPER_CLASS;
21668
21885
  if (this.parent.activeViewOptions.timeScale.enable && (eventObj[this.parent.eventFields.isAllDay])) {
@@ -22668,9 +22885,9 @@ var ViewBase = /** @__PURE__ @class */ (function () {
22668
22885
  append(quickTemplate, tdElement);
22669
22886
  }
22670
22887
  else {
22671
- tdElement.appendChild(createElement('div', {
22672
- className: className, innerHTML: tdData.resourceData[tdData.resource.textField]
22673
- }));
22888
+ var resourceText = createElement('div', { className: className });
22889
+ resourceText.innerText = this.parent.sanitize(tdData.resourceData[tdData.resource.textField]);
22890
+ tdElement.appendChild(resourceText);
22674
22891
  }
22675
22892
  };
22676
22893
  ViewBase.prototype.renderResourceMobileLayout = function () {
@@ -22694,7 +22911,6 @@ var ViewBase = /** @__PURE__ @class */ (function () {
22694
22911
  var colElements = this.getColElements();
22695
22912
  var contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
22696
22913
  var colWidth_1 = (contentBody.getBoundingClientRect().width / (colElements.length / 2));
22697
- colElements.forEach(function (col) { return setStyleAttribute(col, { 'width': formatUnit(colWidth_1) }); });
22698
22914
  if (content.offsetHeight !== content.clientHeight) {
22699
22915
  var resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
22700
22916
  if (!isNullOrUndefined(resourceColumn)) {
@@ -22924,8 +23140,8 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
22924
23140
  var content = this.getScrollableElement();
22925
23141
  var header = this.getDatesHeaderElement();
22926
23142
  var scrollerHeight = this.parent.element.offsetHeight - headerBarHeight - header.offsetHeight;
22927
- this.setColWidth(content);
22928
23143
  this.setContentHeight(content, timeCells, scrollerHeight);
23144
+ this.setColWidth(content);
22929
23145
  var scrollBarWidth = getScrollBarWidth();
22930
23146
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
22931
23147
  header.firstElementChild.style[args.cssProperties.rtlBorder] = '';
@@ -24236,9 +24452,11 @@ var Month = /** @__PURE__ @class */ (function (_super) {
24236
24452
  if (!this.parent.isMinMaxDate(data.date)) {
24237
24453
  data.className.push(DISABLE_DATES);
24238
24454
  }
24239
- if (this.parent.currentView === 'MonthAgenda' && this.parent.isSelectedDate(data.date)) {
24240
- data.className.push(SELECTED_CELL_CLASS);
24241
- }
24455
+ this.updateSelectedCellClass(data);
24456
+ };
24457
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
24458
+ Month.prototype.updateSelectedCellClass = function (data) {
24459
+ return;
24242
24460
  };
24243
24461
  Month.prototype.isOtherMonth = function (date) {
24244
24462
  return date.getTime() < this.monthDates.start.getTime() || date.getTime() > this.monthDates.end.getTime();
@@ -24586,6 +24804,7 @@ var Year = /** @__PURE__ @class */ (function (_super) {
24586
24804
  calendarElement.appendChild(this.renderCalendarContent(currentMonth));
24587
24805
  calendarWrapper.appendChild(calendarElement);
24588
24806
  }
24807
+ this.renderDates.splice(0, 1);
24589
24808
  };
24590
24809
  Year.prototype.renderCalendarHeader = function (currentDate) {
24591
24810
  var headerWrapper = createElement('div', { className: 'e-header e-month' });
@@ -24645,7 +24864,7 @@ var Year = /** @__PURE__ @class */ (function (_super) {
24645
24864
  var date = weekDates_1[_i];
24646
24865
  var td = createElement('td', {
24647
24866
  className: 'e-cell ' + WORK_CELLS_CLASS,
24648
- attrs: { 'aria-selected': 'false', 'data-date': date.getTime().toString() }
24867
+ attrs: { 'data-date': date.getTime().toString() }
24649
24868
  });
24650
24869
  if (this.parent.activeViewOptions.cellHeaderTemplate) {
24651
24870
  var args = { date: date, type: 'monthCells' };
@@ -24673,6 +24892,9 @@ var Year = /** @__PURE__ @class */ (function (_super) {
24673
24892
  addClass([td], classList$$1);
24674
24893
  }
24675
24894
  tr_1.appendChild(td);
24895
+ if (currentDate.getMonth() === date.getMonth()) {
24896
+ this.renderDates.push(new Date(date));
24897
+ }
24676
24898
  if (!this.parent.isMinMaxDate(date)) {
24677
24899
  addClass([td], DISABLE_DATES);
24678
24900
  }
@@ -25044,9 +25266,13 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
25044
25266
  if (!isNullOrUndefined(eventLocation) && eventLocation !== '') {
25045
25267
  eventSubject += ',';
25046
25268
  }
25047
- appSubjectWrap.appendChild(createElement('div', { className: SUBJECT_CLASS, innerHTML: eventSubject }));
25269
+ var appSubjectText = createElement('div', { className: SUBJECT_CLASS });
25270
+ appSubjectText.innerText = this.parent.sanitize(eventSubject);
25271
+ appSubjectWrap.appendChild(appSubjectText);
25048
25272
  if (!isNullOrUndefined(eventLocation) && eventLocation !== '') {
25049
- appSubjectWrap.appendChild(createElement('div', { className: LOCATION_CLASS, innerHTML: eventLocation }));
25273
+ var appLocation = createElement('div', { className: LOCATION_CLASS });
25274
+ appLocation.innerText = this.parent.sanitize(eventLocation);
25275
+ appSubjectWrap.appendChild(appLocation);
25050
25276
  }
25051
25277
  if (!isNullOrUndefined(event[fieldMapping.recurrenceRule])) {
25052
25278
  var iconClass = (event[fieldMapping.id] === event[fieldMapping.recurrenceID]) ?
@@ -25829,6 +26055,11 @@ var MonthAgenda = /** @__PURE__ @class */ (function (_super) {
25829
26055
  }
25830
26056
  return 'abbreviated';
25831
26057
  };
26058
+ MonthAgenda.prototype.updateSelectedCellClass = function (data) {
26059
+ if (resetTime(data.date).getTime() === resetTime(this.monthAgendaDate).getTime()) {
26060
+ data.className.push(SELECTED_CELL_CLASS);
26061
+ }
26062
+ };
25832
26063
  MonthAgenda.prototype.setEventWrapperHeight = function () {
25833
26064
  var headerHeight = (this.parent.headerModule ? this.parent.headerModule.getHeaderElement().offsetHeight : 0) + 2;
25834
26065
  var resourceWrapper = this.parent.element.querySelector('.' + RESOURCE_HEADER_TOOLBAR);
@@ -26701,15 +26932,15 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
26701
26932
  this.parent.virtualScrollModule.renderVirtualTrack(content);
26702
26933
  }
26703
26934
  var contentTBody = contentTable.querySelector('tbody');
26704
- if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
26705
- if (this.parent.rowAutoHeight) {
26706
- var addClassTable = [contentTable];
26707
- var monthHeader = this.parent.element.querySelector('.' + MONTH_HEADER_WRAPPER + ' .' + SCHEDULE_TABLE_CLASS);
26708
- if (monthHeader) {
26709
- addClassTable.push(monthHeader);
26710
- }
26711
- addClass(addClassTable, AUTO_HEIGHT);
26935
+ if (this.parent.rowAutoHeight) {
26936
+ var addClassTable = [contentTable];
26937
+ var monthHeader = this.parent.element.querySelector('.' + MONTH_HEADER_WRAPPER + ' .' + SCHEDULE_TABLE_CLASS);
26938
+ if (monthHeader) {
26939
+ addClassTable.push(monthHeader);
26712
26940
  }
26941
+ addClass(addClassTable, AUTO_HEIGHT);
26942
+ }
26943
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
26713
26944
  var colCount = this.parent.activeViewOptions.orientation === 'Horizontal' ? this.colLevels.slice(-1)[0].length : this.columnCount;
26714
26945
  contentTable.appendChild(this.createTableColGroup(colCount));
26715
26946
  this.renderResourceContent(eventWrapper, monthTBody, contentTBody);
@@ -26811,6 +27042,9 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
26811
27042
  if (td.classList.contains(OTHERMONTH_CLASS)) {
26812
27043
  continue;
26813
27044
  }
27045
+ else {
27046
+ this.renderDates.push(new Date(date));
27047
+ }
26814
27048
  td.appendChild(dateHeader);
26815
27049
  if (isDateAvail) {
26816
27050
  td.setAttribute('data-date', date.getTime().toString());
@@ -26825,6 +27059,7 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
26825
27059
  }
26826
27060
  }
26827
27061
  }
27062
+ this.renderDates.splice(0, 1);
26828
27063
  };
26829
27064
  TimelineYear.prototype.getContentRows = function () {
26830
27065
  var tRow = [];