@syncfusion/ej2-schedule 22.2.11 → 23.1.36

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 (120) hide show
  1. package/CHANGELOG.md +25 -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 +445 -172
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +445 -173
  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/date-generator.d.ts +1 -2
  14. package/src/recurrence-editor/date-generator.js +3 -5
  15. package/src/recurrence-editor/recurrence-editor.d.ts +1 -1
  16. package/src/schedule/actions/crud.d.ts +1 -1
  17. package/src/schedule/actions/crud.js +19 -6
  18. package/src/schedule/actions/data.js +29 -8
  19. package/src/schedule/actions/keyboard.js +4 -1
  20. package/src/schedule/actions/virtual-scroll.d.ts +1 -0
  21. package/src/schedule/actions/virtual-scroll.js +37 -2
  22. package/src/schedule/base/constant.d.ts +4 -0
  23. package/src/schedule/base/constant.js +4 -0
  24. package/src/schedule/base/interface.d.ts +15 -0
  25. package/src/schedule/base/resource.js +1 -0
  26. package/src/schedule/base/schedule-model.d.ts +41 -35
  27. package/src/schedule/base/schedule.d.ts +54 -35
  28. package/src/schedule/base/schedule.js +71 -6
  29. package/src/schedule/base/util.d.ts +1 -0
  30. package/src/schedule/base/util.js +1 -0
  31. package/src/schedule/event-renderer/event-base.d.ts +1 -1
  32. package/src/schedule/event-renderer/event-base.js +4 -4
  33. package/src/schedule/exports/calendar-import.d.ts +2 -1
  34. package/src/schedule/exports/calendar-import.js +134 -106
  35. package/src/schedule/models/views-model.d.ts +10 -1
  36. package/src/schedule/models/views.d.ts +9 -1
  37. package/src/schedule/models/views.js +3 -0
  38. package/src/schedule/popups/event-tooltip.js +7 -3
  39. package/src/schedule/popups/event-window.d.ts +7 -0
  40. package/src/schedule/popups/event-window.js +123 -29
  41. package/src/schedule/popups/quick-popups.js +3 -0
  42. package/src/schedule/renderer/timeline-view.js +5 -2
  43. package/styles/bootstrap-dark.css +15 -0
  44. package/styles/bootstrap.css +15 -0
  45. package/styles/bootstrap4.css +15 -0
  46. package/styles/bootstrap5-dark.css +15 -0
  47. package/styles/bootstrap5.css +15 -0
  48. package/styles/fabric-dark.css +15 -0
  49. package/styles/fabric.css +15 -0
  50. package/styles/fluent-dark.css +15 -0
  51. package/styles/fluent.css +15 -0
  52. package/styles/highcontrast-light.css +15 -0
  53. package/styles/highcontrast.css +15 -0
  54. package/styles/material-dark.css +15 -1
  55. package/styles/material.css +15 -1
  56. package/styles/material3-dark.css +16 -2
  57. package/styles/material3-dark.scss +1 -1
  58. package/styles/material3.css +16 -2
  59. package/styles/material3.scss +1 -1
  60. package/styles/recurrence-editor/bootstrap-dark.scss +1 -1
  61. package/styles/recurrence-editor/bootstrap.scss +1 -1
  62. package/styles/recurrence-editor/bootstrap4.scss +1 -1
  63. package/styles/recurrence-editor/bootstrap5-dark.scss +1 -1
  64. package/styles/recurrence-editor/bootstrap5.scss +1 -1
  65. package/styles/recurrence-editor/fabric-dark.scss +1 -1
  66. package/styles/recurrence-editor/fabric.scss +1 -1
  67. package/styles/recurrence-editor/fluent-dark.scss +1 -1
  68. package/styles/recurrence-editor/fluent.scss +1 -1
  69. package/styles/recurrence-editor/highcontrast-light.scss +1 -1
  70. package/styles/recurrence-editor/highcontrast.scss +1 -1
  71. package/styles/recurrence-editor/material-dark.css +0 -1
  72. package/styles/recurrence-editor/material-dark.scss +1 -1
  73. package/styles/recurrence-editor/material.css +0 -1
  74. package/styles/recurrence-editor/material.scss +1 -1
  75. package/styles/recurrence-editor/material3-dark.css +0 -1
  76. package/styles/recurrence-editor/material3-dark.scss +1 -1
  77. package/styles/recurrence-editor/material3.css +0 -1
  78. package/styles/recurrence-editor/material3.scss +1 -1
  79. package/styles/recurrence-editor/tailwind-dark.css +0 -1
  80. package/styles/recurrence-editor/tailwind-dark.scss +1 -1
  81. package/styles/recurrence-editor/tailwind.css +0 -1
  82. package/styles/recurrence-editor/tailwind.scss +1 -1
  83. package/styles/schedule/_layout.scss +15 -0
  84. package/styles/schedule/_material3-definition.scss +1 -1
  85. package/styles/schedule/bootstrap-dark.css +15 -0
  86. package/styles/schedule/bootstrap-dark.scss +1 -1
  87. package/styles/schedule/bootstrap.css +15 -0
  88. package/styles/schedule/bootstrap.scss +1 -1
  89. package/styles/schedule/bootstrap4.css +15 -0
  90. package/styles/schedule/bootstrap4.scss +1 -1
  91. package/styles/schedule/bootstrap5-dark.css +15 -0
  92. package/styles/schedule/bootstrap5-dark.scss +1 -1
  93. package/styles/schedule/bootstrap5.css +15 -0
  94. package/styles/schedule/bootstrap5.scss +1 -1
  95. package/styles/schedule/fabric-dark.css +15 -0
  96. package/styles/schedule/fabric-dark.scss +1 -1
  97. package/styles/schedule/fabric.css +15 -0
  98. package/styles/schedule/fabric.scss +1 -1
  99. package/styles/schedule/fluent-dark.css +15 -0
  100. package/styles/schedule/fluent-dark.scss +1 -1
  101. package/styles/schedule/fluent.css +15 -0
  102. package/styles/schedule/fluent.scss +1 -1
  103. package/styles/schedule/highcontrast-light.css +15 -0
  104. package/styles/schedule/highcontrast-light.scss +1 -1
  105. package/styles/schedule/highcontrast.css +15 -0
  106. package/styles/schedule/highcontrast.scss +1 -1
  107. package/styles/schedule/material-dark.css +15 -1
  108. package/styles/schedule/material-dark.scss +1 -1
  109. package/styles/schedule/material.css +15 -1
  110. package/styles/schedule/material.scss +1 -1
  111. package/styles/schedule/material3-dark.css +16 -2
  112. package/styles/schedule/material3-dark.scss +1 -1
  113. package/styles/schedule/material3.css +16 -2
  114. package/styles/schedule/material3.scss +1 -1
  115. package/styles/schedule/tailwind-dark.css +15 -1
  116. package/styles/schedule/tailwind-dark.scss +1 -1
  117. package/styles/schedule/tailwind.css +15 -1
  118. package/styles/schedule/tailwind.scss +1 -1
  119. package/styles/tailwind-dark.css +15 -2
  120. package/styles/tailwind.css +15 -2
@@ -60,6 +60,10 @@ var resizeStop = 'resizeStop';
60
60
  var inlineClick = 'inlineClick';
61
61
  /** @private */
62
62
  var cellSelect = 'cellSelect';
63
+ /** @private */
64
+ var virtualScrollStart = 'virtualScrollStart';
65
+ /** @private */
66
+ var virtualScrollStop = 'virtualScrollStop';
63
67
  /**
64
68
  * Specifies schedule internal events
65
69
  */
@@ -389,6 +393,7 @@ function getScrollBarWidth() {
389
393
  * Method to reset scrollbar width
390
394
  *
391
395
  * @private
396
+ * @returns {void}
392
397
  */
393
398
  function resetScrollbarWidth() {
394
399
  var zoomPixelRatio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth;
@@ -552,7 +557,7 @@ var WORK_HOURS_CLASS = 'e-work-hours';
552
557
  /** @private */
553
558
  var POPUP_OPEN = 'e-popup-open';
554
559
  /** @private */
555
-
560
+ var POPUP_CLOSE = 'e-popup-close';
556
561
  /** @private */
557
562
  var DATE_HEADER_WRAP_CLASS = 'e-date-header-wrap';
558
563
  /** @private */
@@ -2073,6 +2078,10 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2073
2078
  }
2074
2079
  var queryStr = '.' + WORK_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS + ',.' + HEADER_CELLS_CLASS;
2075
2080
  var target = closest(e.target, queryStr);
2081
+ var selectedCells = this.parent.getSelectedCells();
2082
+ if (selectedCells.length > 0 && selectedCells.indexOf(target) === -1) {
2083
+ target = selectedCells[selectedCells.length - 1];
2084
+ }
2076
2085
  if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
2077
2086
  return;
2078
2087
  }
@@ -2081,7 +2090,6 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2081
2090
  if (this.parent.eventWindow) {
2082
2091
  this.parent.eventWindow.convertToEventData(this.parent.activeCellsData, cellData);
2083
2092
  }
2084
- var selectedCells = this.parent.getSelectedCells();
2085
2093
  var args = {
2086
2094
  data: cellData, element: this.parent.activeCellsData.element, event: e,
2087
2095
  requestType: cellSelect, showQuickPopup: false
@@ -3054,15 +3062,35 @@ var Data = /** @__PURE__ @class */ (function () {
3054
3062
  */
3055
3063
  Data.prototype.generateQuery = function (startDate, endDate) {
3056
3064
  var query = this.query.clone();
3057
- if (this.parent && this.parent.eventSettings.includeFiltersInQuery && startDate && endDate) {
3058
- var dateQuery = this.getStartEndQuery(startDate, endDate);
3059
- var recurrenceQuery = new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', null).and(new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', ''));
3060
- return query.where(dateQuery.or(recurrenceQuery));
3061
- }
3062
- if (startDate) {
3065
+ if (this.parent && startDate && endDate) {
3066
+ if (this.parent.activeViewOptions && this.parent.activeViewOptions.enableLazyLoading &&
3067
+ !isNullOrUndefined(this.parent.activeViewOptions.group.resources) &&
3068
+ this.parent.activeViewOptions.group.resources.length > 0 && this.parent.resourceBase &&
3069
+ this.parent.resourceBase.resourceCollection.length > 0 && this.parent.resourceBase.renderedResources.length > 0) {
3070
+ var resIdCollection_1 = [];
3071
+ this.parent.resourceBase.resourceCollection.forEach(function () { return resIdCollection_1.push([]); });
3072
+ this.parent.resourceBase.renderedResources.forEach(function (resource) {
3073
+ resIdCollection_1.forEach(function (resId, index) {
3074
+ var groupId = resource.groupOrder[parseInt(index.toString(), 10)];
3075
+ if (groupId && resId.indexOf(groupId) < 0) {
3076
+ resId.push(groupId);
3077
+ }
3078
+ });
3079
+ });
3080
+ this.parent.resourceBase.resourceCollection.forEach(function (resource, index) {
3081
+ query.addParams(resource.field, resIdCollection_1[parseInt(index.toString(), 10)].toString());
3082
+ });
3083
+ }
3084
+ if (this.parent.timezone) {
3085
+ startDate = this.parent.tzModule.remove(new Date(+startDate.getTime()), this.parent.timezone);
3086
+ endDate = this.parent.tzModule.remove(new Date(+endDate.getTime()), this.parent.timezone);
3087
+ }
3088
+ if (this.parent.eventSettings.includeFiltersInQuery) {
3089
+ var dateQuery = this.getStartEndQuery(startDate, endDate);
3090
+ var recurrenceQuery = new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', null).and(new Predicate(this.parent.eventFields.recurrenceRule, 'notequal', ''));
3091
+ return query.where(dateQuery.or(recurrenceQuery));
3092
+ }
3063
3093
  query.addParams('StartDate', startDate.toISOString());
3064
- }
3065
- if (endDate) {
3066
3094
  query.addParams('EndDate', endDate.toISOString());
3067
3095
  }
3068
3096
  return query;
@@ -3738,15 +3766,13 @@ function getMonthSummary(ruleObject, cldrObj, localeObj) {
3738
3766
  * @param {number} maximumCount Accepts the maximum number count to generate date collections
3739
3767
  * @param {Date} viewDate Accepts the current date instead of start date
3740
3768
  * @param {CalendarType} calendarMode Accepts the calendar type
3741
- * @param {string} oldTimezone Accepts the timezone name
3742
3769
  * @param {string} newTimezone Accepts the timezone name
3743
3770
  * @returns {number[]} Returns the collection of dates
3744
3771
  */
3745
- function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount, viewDate, calendarMode, oldTimezone, newTimezone) {
3772
+ function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount, viewDate, calendarMode, newTimezone) {
3746
3773
  if (maximumCount === void 0) { maximumCount = MAXOCCURRENCE; }
3747
3774
  if (viewDate === void 0) { viewDate = null; }
3748
3775
  if (calendarMode === void 0) { calendarMode = 'Gregorian'; }
3749
- if (oldTimezone === void 0) { oldTimezone = null; }
3750
3776
  if (newTimezone === void 0) { newTimezone = null; }
3751
3777
  var ruleObject = extractObjectFromRule(rule);
3752
3778
  var cacheDate;
@@ -3758,8 +3784,8 @@ function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount, vi
3758
3784
  var tz = new Timezone();
3759
3785
  tempDate.forEach(function (content) {
3760
3786
  var parsedDate = getDateFromRecurrenceDateString(content);
3761
- if (oldTimezone && newTimezone) {
3762
- parsedDate = tz.convert(new Date(parsedDate.getTime()), oldTimezone, newTimezone);
3787
+ if (newTimezone) {
3788
+ parsedDate = tz.add(new Date(parsedDate.getTime()), newTimezone);
3763
3789
  }
3764
3790
  tempExcludeDate.push(new Date(parsedDate.getTime()).setHours(0, 0, 0, 0));
3765
3791
  });
@@ -5318,12 +5344,12 @@ var EventBase = /** @__PURE__ @class */ (function () {
5318
5344
  }
5319
5345
  if (!isNullOrUndefined(event_1[fields.recurrenceRule]) && isNullOrUndefined(event_1[fields.recurrenceID]) &&
5320
5346
  !(this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction)) {
5321
- processed = processed.concat(this_1.generateOccurrence(event_1, null, oldTimezone, true));
5347
+ processed = processed.concat(this_1.generateOccurrence(event_1, null, true));
5322
5348
  }
5323
5349
  else {
5324
5350
  if (this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction) {
5325
5351
  if (!isNullOrUndefined(event_1[fields.recurrenceRule]) && isNullOrUndefined(event_1[fields.recurrenceID])) {
5326
- var recurrenceEvent = this_1.generateOccurrence(event_1, null, oldTimezone, true);
5352
+ var recurrenceEvent = this_1.generateOccurrence(event_1, null, true);
5327
5353
  var _loop_2 = function (occurrence) {
5328
5354
  var app = this_1.parent.eventsProcessed.filter(function (data) {
5329
5355
  return data[fields.startTime].getTime() - occurrence[fields.startTime].getTime() === 0 &&
@@ -6143,7 +6169,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
6143
6169
  }
6144
6170
  this.parent.activeEventData = { event: eventObject, element: target };
6145
6171
  };
6146
- EventBase.prototype.generateOccurrence = function (event, viewDate, oldTimezone, isMaxCount) {
6172
+ EventBase.prototype.generateOccurrence = function (event, viewDate, isMaxCount) {
6147
6173
  var startDate = event[this.parent.eventFields.startTime];
6148
6174
  var endDate = event[this.parent.eventFields.endTime];
6149
6175
  var eventRule = event[this.parent.eventFields.recurrenceRule];
@@ -6158,7 +6184,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
6158
6184
  var newTimezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
6159
6185
  var firstDay = this.parent.activeViewOptions.firstDayOfWeek;
6160
6186
  var calendarMode = this.parent.calendarMode;
6161
- var dates = generate(startDate, eventRule, exception, firstDay, maxCount, viewDate, calendarMode, oldTimezone, newTimezone);
6187
+ var dates = generate(startDate, eventRule, exception, firstDay, maxCount, viewDate, calendarMode, newTimezone);
6162
6188
  if (this.parent.currentView === 'Agenda' && eventRule.indexOf('COUNT') === -1 && eventRule.indexOf('UNTIL') === -1) {
6163
6189
  if (isNullOrUndefined(event.generatedDates)) {
6164
6190
  event.generatedDates = { start: new Date(dates[0]), end: new Date(dates[dates.length - 1]) };
@@ -9377,6 +9403,9 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9377
9403
  'aria-label': this_1.parent.getAnnouncementString(eventData)
9378
9404
  }
9379
9405
  });
9406
+ if (eventData[fields.isReadonly]) {
9407
+ addClass([appointmentElement], 'e-read-only');
9408
+ }
9380
9409
  var templateElement = void 0;
9381
9410
  if (!isNullOrUndefined(this_1.parent.activeViewOptions.eventTemplate)) {
9382
9411
  var tempId = this_1.parent.element.id + '_' + this_1.parent.activeViewOptions.eventTemplateName + 'eventTemplate';
@@ -10485,7 +10514,7 @@ var EventTooltip = /** @__PURE__ @class */ (function () {
10485
10514
  cssClass: this.parent.cssClass + ' ' + EVENT_TOOLTIP_ROOT_CLASS,
10486
10515
  target: this.getTargets(),
10487
10516
  beforeRender: this.onBeforeRender.bind(this),
10488
- afterClose: this.onTooltipClose.bind(this),
10517
+ beforeClose: this.onTooltipClose.bind(this),
10489
10518
  enableRtl: this.parent.enableRtl,
10490
10519
  enableHtmlSanitizer: this.parent.enableHtmlSanitizer
10491
10520
  });
@@ -10593,7 +10622,11 @@ var EventTooltip = /** @__PURE__ @class */ (function () {
10593
10622
  }
10594
10623
  this.parent.renderTemplates();
10595
10624
  };
10596
- EventTooltip.prototype.onTooltipClose = function () {
10625
+ EventTooltip.prototype.onTooltipClose = function (args) {
10626
+ if (args.element) {
10627
+ removeClass([args.element], POPUP_OPEN);
10628
+ addClass([args.element], POPUP_CLOSE);
10629
+ }
10597
10630
  this.parent.resetTemplates(['tooltipTemplate', 'headerTooltipTemplate']);
10598
10631
  };
10599
10632
  EventTooltip.prototype.setContent = function (content) {
@@ -11800,40 +11833,54 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11800
11833
  };
11801
11834
  if (this.parent.isAdaptive) {
11802
11835
  dialogModel.cssClass = EVENT_WINDOW_DIALOG_CLASS + ' ' + DEVICE_CLASS;
11803
- dialogModel.header = '<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">' +
11804
- this.l10n.getConstant('newEvent') + '</div><div class="e-save-icon e-icons"></div></div>';
11836
+ if (!this.parent.editorHeaderTemplate) {
11837
+ dialogModel.header = '<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">' +
11838
+ this.l10n.getConstant('newEvent') + '</div><div class="e-save-icon e-icons"></div></div>';
11839
+ }
11805
11840
  }
11806
11841
  else {
11807
- dialogModel.buttons = [{
11808
- buttonModel: {
11809
- content: this.l10n.getConstant('deleteButton'), cssClass: DELETE_EVENT_CLASS,
11810
- disabled: !this.parent.eventSettings.allowDeleting || this.parent.readonly
11811
- },
11812
- click: this.eventDelete.bind(this)
11813
- }, {
11814
- buttonModel: {
11815
- content: this.l10n.getConstant('saveButton'), cssClass: 'e-primary ' + EVENT_WINDOW_SAVE_BUTTON_CLASS,
11816
- isPrimary: true, disabled: !this.parent.eventSettings.allowAdding || this.parent.readonly
11817
- },
11818
- click: this.eventSave.bind(this)
11819
- }, {
11820
- buttonModel: { cssClass: EVENT_WINDOW_CANCEL_BUTTON_CLASS, content: this.l10n.getConstant('cancelButton') },
11821
- click: this.dialogClose.bind(this)
11822
- }];
11823
- dialogModel.header = '<div class="e-title-text">' + this.l10n.getConstant('newEvent') + '</div>';
11842
+ if (!this.parent.editorFooterTemplate) {
11843
+ this.renderDialogButtons(dialogModel);
11844
+ }
11845
+ if (!this.parent.editorHeaderTemplate) {
11846
+ dialogModel.header = '<div class="e-title-text">' + this.l10n.getConstant('newEvent') + '</div>';
11847
+ }
11824
11848
  }
11825
11849
  this.dialogObject = new Dialog(dialogModel, this.element);
11826
11850
  if (this.dialogObject.element.querySelector('.e-dlg-closeicon-btn')) {
11827
11851
  this.dialogObject.element.querySelector('.e-dlg-closeicon-btn').setAttribute('title', this.l10n.getConstant('close'));
11828
11852
  }
11853
+ this.addEventHandlers();
11829
11854
  addClass([this.element.parentElement], EVENT_WINDOW_DIALOG_CLASS + '-container');
11830
- if (this.parent.isAdaptive) {
11831
- EventHandler.add(this.element.querySelector('.' + EVENT_WINDOW_BACK_ICON_CLASS), 'click', this.dialogClose, this);
11832
- EventHandler.add(this.element.querySelector('.' + EVENT_WINDOW_SAVE_ICON_CLASS), 'click', this.eventSave, this);
11833
- }
11834
11855
  EventHandler.add(this.dialogObject.element, 'keydown', this.preventEventSave, this);
11835
11856
  this.applyFormValidation();
11836
11857
  };
11858
+ EventWindow.prototype.renderDialogButtons = function (dialogButton) {
11859
+ dialogButton.buttons = [{
11860
+ buttonModel: {
11861
+ content: this.l10n.getConstant('deleteButton'), cssClass: DELETE_EVENT_CLASS,
11862
+ disabled: !this.parent.eventSettings.allowDeleting || this.parent.readonly
11863
+ },
11864
+ click: this.eventDelete.bind(this)
11865
+ }, {
11866
+ buttonModel: {
11867
+ content: this.l10n.getConstant('saveButton'), cssClass: 'e-primary ' + EVENT_WINDOW_SAVE_BUTTON_CLASS,
11868
+ isPrimary: true, disabled: !this.parent.eventSettings.allowAdding || this.parent.readonly
11869
+ },
11870
+ click: this.eventSave.bind(this)
11871
+ }, {
11872
+ buttonModel: { cssClass: EVENT_WINDOW_CANCEL_BUTTON_CLASS, content: this.l10n.getConstant('cancelButton') },
11873
+ click: this.dialogClose.bind(this)
11874
+ }];
11875
+ };
11876
+ EventWindow.prototype.addEventHandlers = function () {
11877
+ var backIcon = this.element.querySelector('.' + EVENT_WINDOW_BACK_ICON_CLASS);
11878
+ var saveIcon = this.element.querySelector('.' + EVENT_WINDOW_SAVE_ICON_CLASS);
11879
+ if (this.parent.isAdaptive && !isNullOrUndefined(backIcon) && !isNullOrUndefined(saveIcon)) {
11880
+ EventHandler.add(backIcon, 'click', this.dialogClose, this);
11881
+ EventHandler.add(saveIcon, 'click', this.eventSave, this);
11882
+ }
11883
+ };
11837
11884
  EventWindow.prototype.refresh = function () {
11838
11885
  this.destroy(true);
11839
11886
  this.renderEventWindow();
@@ -11877,6 +11924,23 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11877
11924
  }
11878
11925
  data = eventObj;
11879
11926
  }
11927
+ if (!isNullOrUndefined(this.parent.editorHeaderTemplate)) {
11928
+ this.parent.resetTemplates(['editorHeaderTemplate']);
11929
+ if (this.parent.isAdaptive && !this.parent.editorFooterTemplate) {
11930
+ this.dialogObject.header = this.createAdaptiveHeaderElement(data);
11931
+ }
11932
+ else {
11933
+ this.dialogObject.header = this.getDialogHeader(data);
11934
+ }
11935
+ }
11936
+ if (!isNullOrUndefined(this.parent.editorFooterTemplate)) {
11937
+ this.parent.resetTemplates(['editorFooterTemplate']);
11938
+ this.dialogObject.footerTemplate = this.getDialogFooter(data);
11939
+ }
11940
+ if (!isNullOrUndefined(this.parent.editorHeaderTemplate) || !isNullOrUndefined(this.parent.editorFooterTemplate)) {
11941
+ this.dialogObject.dataBind();
11942
+ this.addEventHandlers();
11943
+ }
11880
11944
  if (!isNullOrUndefined(this.parent.editorTemplate)) {
11881
11945
  this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);
11882
11946
  }
@@ -11907,6 +11971,65 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11907
11971
  this.dialogObject.dataBind();
11908
11972
  this.applyFormValidation();
11909
11973
  };
11974
+ EventWindow.prototype.setDialogHeader = function () {
11975
+ if (!isNullOrUndefined(this.parent.editorHeaderTemplate)) {
11976
+ this.parent.resetTemplates(['editorHeaderTemplate']);
11977
+ if (this.parent.isAdaptive && !this.parent.editorFooterTemplate) {
11978
+ this.dialogObject.header = this.createAdaptiveHeaderElement();
11979
+ }
11980
+ else {
11981
+ this.dialogObject.header = this.getDialogHeader();
11982
+ }
11983
+ }
11984
+ else if (this.parent.isAdaptive) {
11985
+ this.dialogObject.header = '<div class="e-title-header"><div class="e-back-icon e-icons"></div><div class="e-title-text">' +
11986
+ this.l10n.getConstant('newEvent') + '</div><div class="e-save-icon e-icons"></div></div>';
11987
+ }
11988
+ else {
11989
+ this.dialogObject.header = '<div class="e-title-text">' + this.l10n.getConstant('newEvent') + '</div>';
11990
+ }
11991
+ this.dialogObject.dataBind();
11992
+ this.addEventHandlers();
11993
+ };
11994
+ EventWindow.prototype.setDialogFooter = function () {
11995
+ if (!isNullOrUndefined(this.parent.editorFooterTemplate)) {
11996
+ this.parent.resetTemplates(['editorFooterTemplate']);
11997
+ this.dialogObject.footerTemplate = this.getDialogFooter();
11998
+ }
11999
+ else if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorFooterTemplate)) {
12000
+ this.renderDialogButtons(this.dialogObject);
12001
+ }
12002
+ else if (this.parent.isAdaptive && isNullOrUndefined(this.parent.editorFooterTemplate)) {
12003
+ this.dialogObject.footerTemplate = null;
12004
+ }
12005
+ this.dialogObject.dataBind();
12006
+ };
12007
+ EventWindow.prototype.createAdaptiveHeaderElement = function (data) {
12008
+ var header = createElement('div', { className: 'e-title-header' });
12009
+ var headerBackIcon = createElement('div', { className: 'e-back-icon e-icons' });
12010
+ header.appendChild(headerBackIcon);
12011
+ var headerTemplate = this.getDialogHeader(data);
12012
+ header.appendChild(headerTemplate);
12013
+ var headerSaveIcon = createElement('div', { className: 'e-save-icon e-icons' });
12014
+ header.appendChild(headerSaveIcon);
12015
+ return header;
12016
+ };
12017
+ EventWindow.prototype.getDialogHeader = function (args) {
12018
+ var headerTemplate = [];
12019
+ var headerTemplateId = this.parent.element.id + '_editorHeaderTemplate';
12020
+ var temHeaderDiv = document.createElement('div');
12021
+ headerTemplate = [].slice.call(this.parent.getEditorHeaderTemplate()(args || {}, this.parent, 'editorHeaderTemplate', headerTemplateId, false));
12022
+ append(headerTemplate, temHeaderDiv);
12023
+ return temHeaderDiv;
12024
+ };
12025
+ EventWindow.prototype.getDialogFooter = function (args) {
12026
+ var footerTemplate = [];
12027
+ var footerTemplateId = this.parent.element.id + '_editorFooterTemplate';
12028
+ var temFooterDiv = document.createElement('div');
12029
+ footerTemplate = [].slice.call(this.parent.getEditorFooterTemplate()(args || {}, this.parent, 'editorFooterTemplate', footerTemplateId, false));
12030
+ append(footerTemplate, temFooterDiv);
12031
+ return temFooterDiv;
12032
+ };
11910
12033
  EventWindow.prototype.preventEventSave = function (e) {
11911
12034
  if (this.parent && !this.parent.allowKeyboardInteraction && e.code === 'Enter') {
11912
12035
  this.isEnterKey = true;
@@ -12180,9 +12303,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12180
12303
  var resourceDiv = this.createDivElement(value + '-container' + ' ' + 'e-resources');
12181
12304
  var resourceInput = this.createInputElement(value + ' ' + EVENT_FIELD$1, fieldName);
12182
12305
  resourceDiv.appendChild(resourceInput);
12183
- function resourceTemplate(data) {
12306
+ var resourceTemplate = function (data) {
12184
12307
  return "<div class=\"e-resource-template\"><div class=\"e-resource-color\" style=\"background-color:" + data[resourceData.colorField] + "\"></div><div class=\"e-resource-text\">" + data[resourceData.textField] + "</div></div>";
12185
- }
12308
+ };
12186
12309
  initializeCSPTemplate(resourceTemplate, resourceData);
12187
12310
  if (resourceData.allowMultiple) {
12188
12311
  var listObj = new MultiSelect({
@@ -12535,7 +12658,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12535
12658
  this.renderRepeatDialog();
12536
12659
  }
12537
12660
  this.element.querySelector('.' + FORM_CLASS).removeAttribute('data-id');
12538
- this.element.querySelector('.' + EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('newEvent');
12661
+ if (isNullOrUndefined(this.parent.editorHeaderTemplate)) {
12662
+ this.element.querySelector('.' + EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('newEvent');
12663
+ }
12539
12664
  eventObj.Timezone = false;
12540
12665
  this.repeatStartDate = eventObj[this.fields.startTime];
12541
12666
  this.repeatRule = '';
@@ -12775,10 +12900,12 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12775
12900
  if (!this.parent.eventSettings.allowEditing) {
12776
12901
  return;
12777
12902
  }
12778
- if (!this.parent.isAdaptive) {
12903
+ if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorFooterTemplate)) {
12779
12904
  removeClass([this.element.querySelector('.' + DELETE_EVENT_CLASS)], DISABLE_CLASS);
12780
12905
  }
12781
- this.element.querySelector('.' + EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('editEvent');
12906
+ if (isNullOrUndefined(this.parent.editorHeaderTemplate)) {
12907
+ this.element.querySelector('.' + EVENT_WINDOW_TITLE_TEXT_CLASS).innerHTML = this.l10n.getConstant('editEvent');
12908
+ }
12782
12909
  this.element.querySelector('.' + FORM_CLASS).setAttribute('data-id', eventObj[this.fields.id].toString());
12783
12910
  if (isNullOrUndefined(this.parent.editorTemplate)) {
12784
12911
  eventObj = extend({}, eventObj, null, true);
@@ -13601,7 +13728,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13601
13728
  };
13602
13729
  EventWindow.prototype.destroy = function (isIgnore) {
13603
13730
  if (this.parent && !this.parent.isDestroyed) {
13604
- this.parent.resetTemplates(['editorTemplate']);
13731
+ this.parent.resetTemplates(['editorTemplate', 'editorHeaderTemplate', 'editorFooterTemplate']);
13605
13732
  }
13606
13733
  this.destroyComponents();
13607
13734
  if (this.recurrenceEditor) {
@@ -13645,6 +13772,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13645
13772
  return EventWindow;
13646
13773
  }());
13647
13774
 
13775
+ /* eslint-disable @typescript-eslint/no-explicit-any */
13648
13776
  /**
13649
13777
  * Virtual Scroll
13650
13778
  */
@@ -13732,6 +13860,16 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13732
13860
  };
13733
13861
  VirtualScroll.prototype.renderEvents = function () {
13734
13862
  this.setTabIndex();
13863
+ var dynamicData = this.triggerScrollEvent(virtualScrollStop);
13864
+ if (this.parent.activeViewOptions && this.parent.activeViewOptions.enableLazyLoading && this.parent.crudModule) {
13865
+ if (dynamicData.length > 0) {
13866
+ this.parent.crudModule.refreshProcessedData(true, dynamicData);
13867
+ this.parent.hideSpinner();
13868
+ return;
13869
+ }
13870
+ this.parent.crudModule.refreshDataManager();
13871
+ return;
13872
+ }
13735
13873
  if (this.parent.crudModule) {
13736
13874
  this.parent.crudModule.refreshProcessedData(true);
13737
13875
  }
@@ -13768,7 +13906,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13768
13906
  resCollection = this.downScroll(conWrap, firstTDIndex);
13769
13907
  }
13770
13908
  if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
13771
- this.parent.showSpinner();
13909
+ this.triggerScrollEvent(virtualScrollStart);
13772
13910
  var selectedEle = this.parent.getSelectedCells();
13773
13911
  this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
13774
13912
  this.updateContent(resWrap, conWrap, eventWrap, resCollection);
@@ -13796,7 +13934,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13796
13934
  this.parent.resourceBase.expandedResources[0] !== resCollection[0] ||
13797
13935
  this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1] !==
13798
13936
  resCollection[resCollection.length - 1]) {
13799
- this.parent.showSpinner();
13937
+ this.triggerScrollEvent(virtualScrollStart);
13800
13938
  var colLevels = this.parent.activeView.colLevels.slice(0);
13801
13939
  this.updateHorizontalContent(conWrap, resCollection);
13802
13940
  setStyleAttribute(conWrap.querySelector('table'), { transform: "translateX(" + this.translateY + "px)" });
@@ -13809,6 +13947,30 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
13809
13947
  this.timeValue = window.setTimeout(function () { _this.renderEvents(); }, 250);
13810
13948
  }
13811
13949
  };
13950
+ VirtualScroll.prototype.triggerScrollEvent = function (action) {
13951
+ var _this = this;
13952
+ var dynamicData = [];
13953
+ if (!this.parent.activeView) {
13954
+ return dynamicData;
13955
+ }
13956
+ var eventArgs = {
13957
+ startDate: this.parent.activeView.startDate(),
13958
+ endDate: this.parent.activeView.endDate(),
13959
+ startIndex: this.parent.resourceBase.renderedResources[0].groupIndex,
13960
+ endIndex: this.parent.resourceBase.renderedResources[this.parent.resourceBase.renderedResources.length - 1].groupIndex,
13961
+ resourceData: this.parent.resourceBase.renderedResources.map(function (x) { return x.resourceData; }),
13962
+ name: action
13963
+ };
13964
+ this.parent.trigger(action, eventArgs, function (args) {
13965
+ if (action === virtualScrollStart) {
13966
+ _this.parent.showSpinner();
13967
+ }
13968
+ else if (action === virtualScrollStop && !isNullOrUndefined(args.eventData) && args.eventData.length > 0) {
13969
+ dynamicData = args.eventData;
13970
+ }
13971
+ });
13972
+ return dynamicData;
13973
+ };
13812
13974
  VirtualScroll.prototype.upScroll = function (conWrap, firstTDIndex) {
13813
13975
  var index = 0;
13814
13976
  index = (~~(conWrap.scrollTop / this.itemSize) + Math.ceil(conWrap.clientHeight / this.itemSize)) - this.renderedLength;
@@ -14405,7 +14567,7 @@ var Crud = /** @__PURE__ @class */ (function () {
14405
14567
  }
14406
14568
  this.parent.trigger(actionFailure, { error: e }, function () { return _this.parent.hideSpinner(); });
14407
14569
  };
14408
- Crud.prototype.refreshProcessedData = function (isVirtualScrollAction) {
14570
+ Crud.prototype.refreshProcessedData = function (isVirtualScrollAction, dynamicEvents) {
14409
14571
  if (isVirtualScrollAction === void 0) { isVirtualScrollAction = false; }
14410
14572
  if (this.parent.dragAndDropModule) {
14411
14573
  this.parent.dragAndDropModule.actionObj.action = '';
@@ -14429,7 +14591,7 @@ var Crud = /** @__PURE__ @class */ (function () {
14429
14591
  }
14430
14592
  }
14431
14593
  if (isVirtualScrollAction) {
14432
- this.parent.notify(dataReady, { processedData: this.parent.eventsProcessed });
14594
+ this.parent.notify(dataReady, { processedData: dynamicEvents ? this.parent.eventBase.processData(dynamicEvents) : this.parent.eventsProcessed });
14433
14595
  return;
14434
14596
  }
14435
14597
  var eventsData = this.parent.eventsData || [];
@@ -14595,6 +14757,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14595
14757
  editParams.changedRecords.push(event_4);
14596
14758
  promise = _this.parent.dataModule.dataManager.update(fields.id, event_4, _this.getTable(), _this.getQuery());
14597
14759
  }
14760
+ var cloneEvent = extend({}, saveArgs.changedRecords[saveArgs.changedRecords.length - 1], null, true);
14761
+ _this.parent.eventBase.selectWorkCellByTime([_this.parent.eventBase.processTimezone(cloneEvent)]);
14598
14762
  var crudArgs = {
14599
14763
  requestType: 'eventChanged', cancel: false,
14600
14764
  data: saveArgs.changedRecords, promise: promise, editParams: editParams
@@ -14681,7 +14845,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14681
14845
  }
14682
14846
  var updateEvents = (eventData instanceof Array) ? eventData : [eventData];
14683
14847
  var args = {
14684
- requestType: action === 'EditOccurrence' ? 'eventChange' : 'eventRemove', cancel: false,
14848
+ requestType: action === 'EditOccurrence' ? 'eventChange' : 'eventRemove',
14849
+ cancel: false,
14685
14850
  addedRecords: [], changedRecords: updateEvents, deletedRecords: []
14686
14851
  };
14687
14852
  args.data = occurrenceData;
@@ -14729,7 +14894,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14729
14894
  _loop_2(a, count);
14730
14895
  }
14731
14896
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());
14732
- _this.parent.eventBase.selectWorkCellByTime(occurrenceArgs.changedRecords);
14897
+ var cloneEvent = extend({}, occurrenceArgs.changedRecords[occurrenceArgs.changedRecords.length - 1], null, true);
14898
+ _this.parent.eventBase.selectWorkCellByTime(action === 'EditOccurrence' ? [_this.parent.eventBase.processTimezone(cloneEvent)] : [cloneEvent]);
14733
14899
  var crudArgs = {
14734
14900
  requestType: action === 'EditOccurrence' ? 'eventChanged' : 'eventRemoved',
14735
14901
  cancel: false, data: isDeletedRecords ? occurrenceArgs.deletedRecords : occurrenceArgs.changedRecords,
@@ -14806,7 +14972,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14806
14972
  _loop_3(a, count);
14807
14973
  }
14808
14974
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_1.id, _this.getTable(), _this.getQuery());
14809
- _this.parent.eventBase.selectWorkCellByTime(followArgs.changedRecords);
14975
+ var cloneEvent = extend({}, followArgs.changedRecords[followArgs.changedRecords.length - 1], null, true);
14976
+ _this.parent.eventBase.selectWorkCellByTime(action === 'EditFollowingEvents' ? [_this.parent.eventBase.processTimezone(cloneEvent)] : [cloneEvent]);
14810
14977
  var crudArgs = {
14811
14978
  requestType: action === 'EditFollowingEvents' ? 'eventChanged' : 'eventRemoved',
14812
14979
  cancel: false, data: followArgs.changedRecords, promise: promise, editParams: editParams
@@ -14874,7 +15041,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14874
15041
  _loop_4(a, count);
14875
15042
  }
14876
15043
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_2.id, _this.getTable(), _this.getQuery());
14877
- _this.parent.eventBase.selectWorkCellByTime(seriesArgs.changedRecords);
15044
+ var cloneEvent = extend({}, seriesArgs.changedRecords[seriesArgs.changedRecords.length - 1], null, true);
15045
+ _this.parent.eventBase.selectWorkCellByTime(action === 'EditSeries' ? [_this.parent.eventBase.processTimezone(cloneEvent)] : [cloneEvent]);
14878
15046
  var crudArgs = {
14879
15047
  requestType: action === 'EditSeries' ? 'eventChanged' : 'eventRemoved',
14880
15048
  cancel: false, data: isDeletedRecords ? seriesArgs.deletedRecords : seriesArgs.changedRecords,
@@ -14935,6 +15103,7 @@ var Crud = /** @__PURE__ @class */ (function () {
14935
15103
  _loop_5(a, count);
14936
15104
  }
14937
15105
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_3.id, _this.getTable(), _this.getQuery());
15106
+ _this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);
14938
15107
  var crudArgs = {
14939
15108
  requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
14940
15109
  };
@@ -14978,6 +15147,8 @@ var Crud = /** @__PURE__ @class */ (function () {
14978
15147
  }
14979
15148
  }
14980
15149
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, _this.getTable(), _this.getQuery());
15150
+ var cloneEvent = extend({}, editArgs.changedRecords[editArgs.changedRecords.length - 1], null, true);
15151
+ _this.parent.eventBase.selectWorkCellByTime([_this.parent.eventBase.processTimezone(cloneEvent)]);
14981
15152
  var crudArgs = { requestType: 'eventChanged', cancel: false, data: editArgs.changedRecords, promise: promise, editParams: editParams };
14982
15153
  _this.refreshData(crudArgs);
14983
15154
  }
@@ -14992,6 +15163,10 @@ var Crud = /** @__PURE__ @class */ (function () {
14992
15163
  return parentEvent;
14993
15164
  };
14994
15165
  Crud.prototype.excludeDateCheck = function (eventStartTime, exceptionDateList) {
15166
+ var timezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
15167
+ if (timezone) {
15168
+ eventStartTime = this.parent.tzModule.remove(new Date(+eventStartTime.getTime()), timezone);
15169
+ }
14995
15170
  var exDate = getRecurrenceStringFromDate(eventStartTime);
14996
15171
  if (!isNullOrUndefined(exceptionDateList)) {
14997
15172
  if (exceptionDateList.indexOf(exDate) === -1) {
@@ -15867,6 +16042,7 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15867
16042
  nodeClicked: this.resourceClick.bind(this),
15868
16043
  created: this.resourceTreeCreated.bind(this)
15869
16044
  });
16045
+ this.treeViewObj.root = this.parent.root ? this.parent.root : this.parent;
15870
16046
  this.treeViewObj.appendTo(resourceTree);
15871
16047
  this.treeViewObj.expandAll();
15872
16048
  this.treePopup = new Popup(treeWrapper, {
@@ -16794,6 +16970,13 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16794
16970
  this.renderElements(isSetModel);
16795
16971
  }
16796
16972
  };
16973
+ Schedule.prototype.destroyEditorWindow = function () {
16974
+ if (this.eventWindow) {
16975
+ this.eventWindow.destroy();
16976
+ this.eventWindow = null;
16977
+ }
16978
+ this.eventWindow = new EventWindow(this);
16979
+ };
16797
16980
  /**
16798
16981
  * Method to render the layout elements
16799
16982
  *
@@ -16963,7 +17146,8 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16963
17146
  headerRows: this.headerRows,
16964
17147
  orientation: 'Horizontal',
16965
17148
  numberOfWeeks: 0,
16966
- displayDate: null
17149
+ displayDate: null,
17150
+ enableLazyLoading: false
16967
17151
  };
16968
17152
  var viewOptions = this.viewCollections[this.viewIndex];
16969
17153
  var viewsData = extend(scheduleOptions, viewOptions, undefined, true);
@@ -16974,6 +17158,11 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16974
17158
  viewsData.displayDate = viewsData.displayDate instanceof Date ? new Date(viewsData.displayDate.getTime()) :
16975
17159
  new Date(viewsData.displayDate);
16976
17160
  }
17161
+ if (viewsData.enableLazyLoading && !isNullOrUndefined(viewsData.group.resources) && viewsData.group.resources.length > 0 &&
17162
+ (['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(viewsData.option) === -1 ||
17163
+ (viewsData.option === 'TimelineYear' && viewsData.orientation === 'Vertical'))) {
17164
+ viewsData.allowVirtualScrolling = true;
17165
+ }
16977
17166
  return viewsData;
16978
17167
  };
16979
17168
  Schedule.prototype.initializeDataModule = function () {
@@ -17035,6 +17224,8 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17035
17224
  this.headerTooltipTemplateFn = this.templateParser(this.activeViewOptions.group.headerTooltipTemplate);
17036
17225
  this.eventTooltipTemplateFn = this.templateParser(this.eventSettings.tooltipTemplate);
17037
17226
  this.editorTemplateFn = this.templateParser(this.editorTemplate);
17227
+ this.editorHeaderTemplateFn = this.templateParser(this.editorHeaderTemplate);
17228
+ this.editorFooterTemplateFn = this.templateParser(this.editorFooterTemplate);
17038
17229
  this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
17039
17230
  this.quickInfoTemplatesContentFn = this.templateParser(this.quickInfoTemplates.content);
17040
17231
  this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
@@ -17676,6 +17867,24 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17676
17867
  Schedule.prototype.getEditorTemplate = function () {
17677
17868
  return this.editorTemplateFn;
17678
17869
  };
17870
+ /**
17871
+ * Method to process editor header template
17872
+ *
17873
+ * @returns {CallbackFunction} Returns the callback function
17874
+ * @private
17875
+ */
17876
+ Schedule.prototype.getEditorHeaderTemplate = function () {
17877
+ return this.editorHeaderTemplateFn;
17878
+ };
17879
+ /**
17880
+ * Method to process editor footer template
17881
+ *
17882
+ * @returns {CallbackFunction} Returns the callback function
17883
+ * @private
17884
+ */
17885
+ Schedule.prototype.getEditorFooterTemplate = function () {
17886
+ return this.editorFooterTemplateFn;
17887
+ };
17679
17888
  /**
17680
17889
  * Method to process quick info header template
17681
17890
  *
@@ -18193,6 +18402,22 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
18193
18402
  this.eventWindow.setDialogContent();
18194
18403
  }
18195
18404
  break;
18405
+ case 'editorHeaderTemplate':
18406
+ if (!isNullOrUndefined(this.editorHeaderTemplate)) {
18407
+ this.editorHeaderTemplateFn = this.templateParser(this.editorHeaderTemplate);
18408
+ }
18409
+ if (this.eventWindow) {
18410
+ this.eventWindow.setDialogHeader();
18411
+ }
18412
+ break;
18413
+ case 'editorFooterTemplate':
18414
+ if (!isNullOrUndefined(this.editorFooterTemplate)) {
18415
+ this.editorFooterTemplateFn = this.templateParser(this.editorFooterTemplate);
18416
+ }
18417
+ if (this.eventWindow) {
18418
+ this.eventWindow.setDialogFooter();
18419
+ }
18420
+ break;
18196
18421
  case 'quickInfoTemplates':
18197
18422
  if (this.quickInfoTemplates.header) {
18198
18423
  this.quickInfoTemplatesHeaderFn = this.templateParser(this.quickInfoTemplates.header);
@@ -18963,13 +19188,17 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
18963
19188
  this.quickInfoTemplatesFooterFn = this.templateParser(this.quickInfoTemplates.footer);
18964
19189
  break;
18965
19190
  case 'editorTemplate':
18966
- if (this.eventWindow) {
18967
- this.eventWindow.destroy();
18968
- this.eventWindow = null;
18969
- }
18970
- this.eventWindow = new EventWindow(this);
19191
+ this.destroyEditorWindow();
18971
19192
  this.editorTemplateFn = this.templateParser(this.editorTemplate);
18972
19193
  break;
19194
+ case 'editorHeaderTemplate':
19195
+ this.destroyEditorWindow();
19196
+ this.editorHeaderTemplateFn = this.templateParser(this.editorHeaderTemplate);
19197
+ break;
19198
+ case 'editorFooterTemplate':
19199
+ this.destroyEditorWindow();
19200
+ this.editorFooterTemplateFn = this.templateParser(this.editorFooterTemplate);
19201
+ break;
18973
19202
  case 'tooltipTemplate':
18974
19203
  case 'headerTooltipTemplate':
18975
19204
  if (this.eventTooltip) {
@@ -19451,6 +19680,12 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
19451
19680
  __decorate([
19452
19681
  Property()
19453
19682
  ], Schedule.prototype, "editorTemplate", void 0);
19683
+ __decorate([
19684
+ Property()
19685
+ ], Schedule.prototype, "editorHeaderTemplate", void 0);
19686
+ __decorate([
19687
+ Property()
19688
+ ], Schedule.prototype, "editorFooterTemplate", void 0);
19454
19689
  __decorate([
19455
19690
  Complex({}, QuickInfoTemplates)
19456
19691
  ], Schedule.prototype, "quickInfoTemplates", void 0);
@@ -19562,6 +19797,12 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
19562
19797
  __decorate([
19563
19798
  Event()
19564
19799
  ], Schedule.prototype, "resizeStop", void 0);
19800
+ __decorate([
19801
+ Event()
19802
+ ], Schedule.prototype, "virtualScrollStart", void 0);
19803
+ __decorate([
19804
+ Event()
19805
+ ], Schedule.prototype, "virtualScrollStop", void 0);
19565
19806
  __decorate([
19566
19807
  Event()
19567
19808
  ], Schedule.prototype, "dataBound", void 0);
@@ -26566,8 +26807,11 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
26566
26807
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
26567
26808
  if (!isNullOrUndefined(currentDateIndex)) {
26568
26809
  if (currentDateIndex[0] !== 0) {
26569
- if (this.parent.activeView.colLevels[0] && this.parent.activeView.colLevels[0][0].colSpan) {
26570
- diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[0][0].colSpan * this.getWorkCellWidth();
26810
+ var index = this.parent.activeView.colLevels.findIndex(function (level) { return level[0].type === 'dateHeader'; });
26811
+ if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
26812
+ this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
26813
+ diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
26814
+ this.getWorkCellWidth();
26571
26815
  }
26572
26816
  else {
26573
26817
  var endHour = this.getEndHour();
@@ -27511,116 +27755,144 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
27511
27755
  }
27512
27756
  };
27513
27757
  ICalendarImport.prototype.iCalendarParser = function (iCalString) {
27514
- var _this = this;
27515
- var fields = this.parent.eventFields;
27516
- var events = [];
27517
- var uId = 'UID';
27518
- var calArray = iCalString.replace(new RegExp('\\r', 'g'), '').split('\n');
27519
- var descriptionIndex = calArray.findIndex(function (line) { return line.startsWith('DESCRIPTION:'); });
27520
- if (descriptionIndex !== -1) {
27521
- var description = calArray[descriptionIndex].substring('DESCRIPTION:'.length);
27522
- for (var i = descriptionIndex + 1; i < calArray.length; i++) {
27523
- if (calArray[i].startsWith(' ') || !(/[A-Z]{3}:/.test(calArray[i]))) {
27524
- description += calArray[i];
27525
- }
27526
- else {
27527
- calArray[descriptionIndex] = 'DESCRIPTION:' + description;
27528
- break;
27758
+ var iCalData = {
27759
+ isEvent: false,
27760
+ curEvent: null,
27761
+ id: this.parent.eventBase.getEventMaxID(),
27762
+ count: 0,
27763
+ events: [],
27764
+ key: null
27765
+ };
27766
+ var iStringLength = iCalString.length;
27767
+ var lastPosition = iCalString.search(/[^ \t]/);
27768
+ var position = lastPosition;
27769
+ var iString;
27770
+ var newlineOffset;
27771
+ do {
27772
+ position = iCalString.indexOf('\n', lastPosition) + 1;
27773
+ if (position === 0) {
27774
+ position = iStringLength;
27775
+ newlineOffset = 0;
27776
+ }
27777
+ else if (position > 1 && iCalString[position - 2] === '\r') {
27778
+ newlineOffset = 2;
27779
+ }
27780
+ else {
27781
+ newlineOffset = 1;
27782
+ }
27783
+ // eslint-disable-next-line security/detect-object-injection
27784
+ var firstChar = iCalString[lastPosition];
27785
+ if (firstChar === ' ' || firstChar === '\n' || firstChar === '\t') {
27786
+ iString += iCalString.slice(lastPosition + 1, position - newlineOffset);
27787
+ }
27788
+ else {
27789
+ if (iString) {
27790
+ iCalData = this.updateEventData(iString, iCalData);
27529
27791
  }
27792
+ iString = iCalString.slice(lastPosition, position - newlineOffset);
27530
27793
  }
27794
+ lastPosition = position;
27795
+ } while (position !== iStringLength);
27796
+ iString = iString.trim();
27797
+ if (iString.length) {
27798
+ iCalData = this.updateEventData(iString, iCalData);
27531
27799
  }
27532
- var isEvent = false;
27533
- var curEvent;
27534
- // eslint-disable-next-line prefer-const
27535
- var id = this.parent.eventBase.getEventMaxID();
27536
- var count = 0;
27537
- calArray.forEach(function (element) {
27538
- var index;
27539
- var type;
27540
- var value;
27541
- if (!isEvent && element === 'BEGIN:VEVENT') {
27542
- isEvent = true;
27543
- curEvent = {};
27544
- }
27545
- if (isEvent && element === 'END:VEVENT') {
27546
- isEvent = false;
27547
- events.push(curEvent);
27548
- curEvent = null;
27549
- }
27550
- if (isEvent) {
27551
- index = element.indexOf(':');
27552
- type = element.substr(0, index).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
27553
- value = element.substr(index + 1, element.length - (index + 1)).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
27554
- if (element.indexOf('SUMMARY') !== -1) {
27555
- type = 'SUMMARY';
27556
- }
27557
- if (element.indexOf('DTSTART') !== -1) {
27558
- curEvent[fields.startTime] = _this.dateParsing(element);
27559
- curEvent[fields.isAllDay] = _this.allDay;
27560
- _this.allDay = false;
27561
- }
27562
- else if (element.indexOf('DTEND') !== -1) {
27563
- curEvent[fields.endTime] = _this.dateParsing(element);
27564
- }
27565
- else if (element.indexOf('EXDATE') !== -1) {
27566
- value = getRecurrenceStringFromDate(_this.dateParsing(element));
27567
- curEvent[fields.recurrenceException] = (isNullOrUndefined(curEvent[fields.recurrenceException])) ?
27568
- value : curEvent[fields.recurrenceException] + ',' + value;
27569
- }
27570
- else if (element.indexOf('RECURRENCE-ID') !== -1) {
27571
- value = getRecurrenceStringFromDate(_this.dateParsing(element));
27572
- curEvent[fields.recurrenceException] = value;
27573
- curEvent[fields.recurrenceID] = value;
27574
- }
27575
- else {
27576
- switch (type) {
27577
- case 'BEGIN':
27578
- break;
27579
- case 'UID':
27580
- curEvent["" + uId] = value;
27581
- if (typeof (id) == 'number') {
27582
- curEvent[fields.id] = parseInt(value, 10);
27583
- if (isNaN(curEvent[fields.id])) {
27584
- curEvent[fields.id] = id + count;
27585
- count++;
27586
- }
27587
- }
27588
- else {
27589
- curEvent[fields.id] = value;
27590
- }
27591
- break;
27592
- case 'SUMMARY':
27593
- curEvent[fields.subject] = value;
27594
- break;
27595
- case 'LOCATION':
27596
- curEvent[fields.location] = value;
27597
- break;
27598
- case 'DESCRIPTION':
27599
- if (!(curEvent[fields.description])) {
27600
- curEvent[fields.description] = value.replace(/\\,/g, ',')
27601
- .replace(/\\n/g, '\n');
27602
- }
27603
- break;
27604
- case 'ISREADONLY':
27605
- curEvent[fields.isReadonly] = (value.indexOf('true') > -1);
27606
- break;
27607
- case 'RRULE':
27608
- curEvent[fields.recurrenceRule] = value;
27609
- break;
27610
- default:
27611
- if (_this.parent.resourceCollection.length > 0) {
27612
- var resData = _this.parent.resourceCollection.filter(function (data) { return data.field === type; });
27613
- curEvent["" + type] = (resData.length > 0 && (typeof (resData[0].dataSource[0][resData[0].idField]) == 'number')) ? parseInt(value, 10) : value;
27614
- }
27615
- else {
27616
- curEvent["" + type] = value;
27800
+ var app = extend([], iCalData.events, null, true);
27801
+ this.parent.addEvent(this.processOccurrence(app, iCalData.id));
27802
+ };
27803
+ ICalendarImport.prototype.updateEventData = function (iString, iCalData) {
27804
+ var fields = this.parent.eventFields;
27805
+ var SEPARATOR = '\r\n';
27806
+ var id = iCalData.id;
27807
+ var events = iCalData.events;
27808
+ var isEvent = iCalData.isEvent;
27809
+ var count = iCalData.count;
27810
+ var curEvent = iCalData.curEvent;
27811
+ var key = iCalData.key;
27812
+ if (!isEvent && iString === 'BEGIN:VEVENT') {
27813
+ isEvent = true;
27814
+ curEvent = {};
27815
+ }
27816
+ if (isEvent && iString === 'END:VEVENT') {
27817
+ isEvent = false;
27818
+ events.push(curEvent);
27819
+ curEvent = null;
27820
+ }
27821
+ if (isEvent) {
27822
+ var index = iString.indexOf(':');
27823
+ var type_1 = iString.substring(0, index).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
27824
+ var value = iString.substring(index + 1, iString.length).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
27825
+ if (iString.indexOf('SUMMARY') !== -1) {
27826
+ type_1 = 'SUMMARY';
27827
+ }
27828
+ if (iString.indexOf('DTSTART') !== -1) {
27829
+ curEvent[fields.startTime] = this.dateParsing(iString);
27830
+ curEvent[fields.isAllDay] = this.allDay;
27831
+ this.allDay = false;
27832
+ }
27833
+ else if (iString.indexOf('DTEND') !== -1) {
27834
+ curEvent[fields.endTime] = this.dateParsing(iString);
27835
+ }
27836
+ else if (iString.indexOf('EXDATE') !== -1) {
27837
+ value = getRecurrenceStringFromDate(this.dateParsing(iString));
27838
+ curEvent[fields.recurrenceException] = isNullOrUndefined(curEvent[fields.recurrenceException]) ?
27839
+ value : curEvent[fields.recurrenceException] + ',' + value;
27840
+ }
27841
+ else if (iString.indexOf('RECURRENCE-ID') !== -1) {
27842
+ value = getRecurrenceStringFromDate(this.dateParsing(iString));
27843
+ curEvent[fields.recurrenceException] = value;
27844
+ curEvent[fields.recurrenceID] = value;
27845
+ }
27846
+ else {
27847
+ key = type_1 || key;
27848
+ switch (key) {
27849
+ case 'BEGIN':
27850
+ break;
27851
+ case 'UID':
27852
+ curEvent["" + type_1] = value;
27853
+ if (typeof (id) == 'number') {
27854
+ curEvent[fields.id] = parseInt(value, 10);
27855
+ if (isNaN(curEvent[fields.id])) {
27856
+ curEvent[fields.id] = id + count;
27857
+ count++;
27617
27858
  }
27618
- }
27859
+ }
27860
+ else {
27861
+ curEvent[fields.id] = value;
27862
+ }
27863
+ break;
27864
+ case 'SUMMARY':
27865
+ curEvent[fields.subject] = this.getFormattedString(value);
27866
+ break;
27867
+ case 'LOCATION':
27868
+ curEvent[fields.location] = this.getFormattedString(value);
27869
+ break;
27870
+ case 'DESCRIPTION':
27871
+ if (curEvent[fields.description]) {
27872
+ curEvent[fields.description] = this.getFormattedString(curEvent[fields.description] + SEPARATOR + value);
27873
+ }
27874
+ else {
27875
+ curEvent[fields.description] = this.getFormattedString(value);
27876
+ }
27877
+ break;
27878
+ case 'ISREADONLY':
27879
+ curEvent[fields.isReadonly] = (value.indexOf('true') > -1);
27880
+ break;
27881
+ case 'RRULE':
27882
+ curEvent[fields.recurrenceRule] = value;
27883
+ break;
27884
+ default:
27885
+ if (this.parent.resourceCollection.length > 0) {
27886
+ var resData = this.parent.resourceCollection.filter(function (data) { return data.field === type_1; });
27887
+ curEvent["" + type_1] = (resData.length > 0 && (typeof (resData[0].dataSource[0][resData[0].idField]) == 'number')) ? parseInt(value, 10) : value;
27888
+ }
27889
+ else {
27890
+ curEvent["" + type_1] = value;
27891
+ }
27619
27892
  }
27620
27893
  }
27621
- });
27622
- var app = extend([], events, null, true);
27623
- this.parent.addEvent(this.processOccurrence(app, id));
27894
+ }
27895
+ return { isEvent: isEvent, curEvent: curEvent, id: id, count: count, events: events, key: key };
27624
27896
  };
27625
27897
  ICalendarImport.prototype.processOccurrence = function (app, maxId) {
27626
27898
  var _this = this;
@@ -27685,7 +27957,7 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
27685
27957
  }
27686
27958
  return parentException + ',' + occurrenceException;
27687
27959
  };
27688
- ICalendarImport.prototype.getDateString = function (value) {
27960
+ ICalendarImport.prototype.getFormattedString = function (value) {
27689
27961
  value = value || '';
27690
27962
  // eslint-disable-next-line no-useless-escape
27691
27963
  return (value.replace(/\\\,/g, ',').replace(/\\\;/g, ';').replace(/\\[nN]/g, '\n').replace(/\\\\/g, '\\'));
@@ -27693,7 +27965,7 @@ var ICalendarImport = /** @__PURE__ @class */ (function () {
27693
27965
  ICalendarImport.prototype.dateParsing = function (element) {
27694
27966
  var split = element.split(':');
27695
27967
  var value = split[split.length - 1];
27696
- var newDate = new Date(this.getDateString(value));
27968
+ var newDate = new Date(this.getFormattedString(value));
27697
27969
  if (element && (element.indexOf('VALUE=DATE') > -1 || element.indexOf('RECURRENCE-ID;TZID') > -1)) {
27698
27970
  var data_1 = /^(\d{4})(\d{2})(\d{2})$/.exec(value);
27699
27971
  if (data_1 !== null) {
@@ -27983,5 +28255,5 @@ var Print = /** @__PURE__ @class */ (function () {
27983
28255
  * Export Schedule components
27984
28256
  */
27985
28257
 
27986
- 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, cellSelect, 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, resetScrollbarWidth, 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 };
28258
+ 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, cellSelect, virtualScrollStart, virtualScrollStop, 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, resetScrollbarWidth, 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 };
27987
28259
  //# sourceMappingURL=ej2-schedule.es5.js.map