@syncfusion/ej2-schedule 27.2.5 → 28.1.33

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 (143) hide show
  1. package/README.md +2 -2
  2. package/dist/ej2-schedule.min.js +3 -3
  3. package/dist/ej2-schedule.umd.min.js +3 -3
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +425 -46
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +454 -48
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +3 -3
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +2 -2
  12. package/package.json +16 -16
  13. package/src/schedule/actions/action-base.js +4 -3
  14. package/src/schedule/actions/drag.js +2 -2
  15. package/src/schedule/actions/keyboard.d.ts +16 -0
  16. package/src/schedule/actions/keyboard.js +254 -8
  17. package/src/schedule/actions/touch.js +7 -2
  18. package/src/schedule/base/constant.d.ts +4 -0
  19. package/src/schedule/base/constant.js +4 -0
  20. package/src/schedule/base/css-constant.d.ts +2 -0
  21. package/src/schedule/base/css-constant.js +2 -0
  22. package/src/schedule/base/interface.d.ts +14 -4
  23. package/src/schedule/base/schedule-model.d.ts +17 -1
  24. package/src/schedule/base/schedule.d.ts +67 -1
  25. package/src/schedule/base/schedule.js +131 -1
  26. package/src/schedule/base/type.d.ts +8 -0
  27. package/src/schedule/popups/event-tooltip.js +4 -0
  28. package/src/schedule/renderer/agenda.d.ts +2 -1
  29. package/src/schedule/renderer/agenda.js +1 -1
  30. package/src/schedule/renderer/header-renderer.js +4 -2
  31. package/src/schedule/renderer/month-agenda.d.ts +2 -1
  32. package/src/schedule/renderer/month-agenda.js +2 -2
  33. package/src/schedule/renderer/month.d.ts +4 -3
  34. package/src/schedule/renderer/month.js +16 -9
  35. package/src/schedule/renderer/view-base.d.ts +5 -4
  36. package/src/schedule/renderer/view-base.js +13 -10
  37. package/src/schedule/renderer/year.d.ts +3 -2
  38. package/src/schedule/renderer/year.js +10 -7
  39. package/styles/bds-lite.css +4400 -0
  40. package/styles/bds-lite.scss +18 -0
  41. package/styles/bds.css +5161 -0
  42. package/styles/bds.scss +20 -0
  43. package/styles/bootstrap-dark-lite.css +19 -6
  44. package/styles/bootstrap-dark.css +23 -10
  45. package/styles/bootstrap-lite.css +18 -5
  46. package/styles/bootstrap.css +22 -9
  47. package/styles/bootstrap4-lite.css +18 -5
  48. package/styles/bootstrap4.css +22 -9
  49. package/styles/bootstrap5-dark-lite.css +18 -5
  50. package/styles/bootstrap5-dark.css +23 -10
  51. package/styles/bootstrap5-lite.css +18 -5
  52. package/styles/bootstrap5.3-lite.css +18 -5
  53. package/styles/bootstrap5.3.css +23 -10
  54. package/styles/bootstrap5.css +23 -10
  55. package/styles/fabric-dark-lite.css +18 -5
  56. package/styles/fabric-dark.css +22 -9
  57. package/styles/fabric-lite.css +18 -5
  58. package/styles/fabric.css +22 -9
  59. package/styles/fluent-dark-lite.css +18 -5
  60. package/styles/fluent-dark.css +22 -9
  61. package/styles/fluent-lite.css +18 -5
  62. package/styles/fluent.css +22 -9
  63. package/styles/fluent2-lite.css +43 -6
  64. package/styles/fluent2.css +50 -13
  65. package/styles/highcontrast-light-lite.css +18 -5
  66. package/styles/highcontrast-light.css +22 -9
  67. package/styles/highcontrast-lite.css +19 -6
  68. package/styles/highcontrast.css +23 -10
  69. package/styles/material-dark-lite.css +18 -5
  70. package/styles/material-dark.css +22 -9
  71. package/styles/material-lite.css +18 -5
  72. package/styles/material.css +22 -9
  73. package/styles/material3-dark-lite.css +18 -5
  74. package/styles/material3-dark.css +23 -10
  75. package/styles/material3-lite.css +18 -5
  76. package/styles/material3.css +23 -10
  77. package/styles/recurrence-editor/_bigger.scss +2 -3
  78. package/styles/recurrence-editor/_fluent2-definition.scss +1 -1
  79. package/styles/recurrence-editor/_tailwind3-definition.scss +14 -0
  80. package/styles/recurrence-editor/bds.css +533 -0
  81. package/styles/recurrence-editor/bds.scss +9 -0
  82. package/styles/recurrence-editor/bootstrap-dark.css +2 -3
  83. package/styles/recurrence-editor/bootstrap.css +2 -3
  84. package/styles/recurrence-editor/bootstrap4.css +2 -3
  85. package/styles/recurrence-editor/bootstrap5-dark.css +2 -3
  86. package/styles/recurrence-editor/bootstrap5.3.css +2 -3
  87. package/styles/recurrence-editor/bootstrap5.css +2 -3
  88. package/styles/recurrence-editor/fabric-dark.css +2 -3
  89. package/styles/recurrence-editor/fabric.css +2 -3
  90. package/styles/recurrence-editor/fluent-dark.css +2 -3
  91. package/styles/recurrence-editor/fluent.css +2 -3
  92. package/styles/recurrence-editor/fluent2.css +3 -4
  93. package/styles/recurrence-editor/highcontrast-light.css +2 -3
  94. package/styles/recurrence-editor/highcontrast.css +3 -4
  95. package/styles/recurrence-editor/material-dark.css +2 -3
  96. package/styles/recurrence-editor/material.css +2 -3
  97. package/styles/recurrence-editor/material3-dark.css +2 -3
  98. package/styles/recurrence-editor/material3.css +2 -3
  99. package/styles/recurrence-editor/tailwind-dark.css +2 -3
  100. package/styles/recurrence-editor/tailwind.css +2 -3
  101. package/styles/recurrence-editor/tailwind3.css +500 -0
  102. package/styles/recurrence-editor/tailwind3.scss +9 -0
  103. package/styles/schedule/_bigger.scss +2 -1
  104. package/styles/schedule/_bootstrap5-definition.scss +1 -1
  105. package/styles/schedule/_bootstrap5.3-definition.scss +1 -1
  106. package/styles/schedule/_fluent2-definition.scss +3 -3
  107. package/styles/schedule/_layout.scss +43 -2
  108. package/styles/schedule/_material3-definition.scss +1 -1
  109. package/styles/schedule/_tailwind-definition.scss +1 -1
  110. package/styles/schedule/_tailwind3-definition.scss +276 -0
  111. package/styles/schedule/_theme.scss +0 -4
  112. package/styles/schedule/bds.css +4760 -0
  113. package/styles/schedule/bds.scss +17 -0
  114. package/styles/schedule/bootstrap-dark.css +21 -7
  115. package/styles/schedule/bootstrap.css +20 -6
  116. package/styles/schedule/bootstrap4.css +20 -6
  117. package/styles/schedule/bootstrap5-dark.css +21 -7
  118. package/styles/schedule/bootstrap5.3.css +21 -7
  119. package/styles/schedule/bootstrap5.css +21 -7
  120. package/styles/schedule/fabric-dark.css +20 -6
  121. package/styles/schedule/fabric.css +20 -6
  122. package/styles/schedule/fluent-dark.css +20 -6
  123. package/styles/schedule/fluent.css +20 -6
  124. package/styles/schedule/fluent2.css +47 -9
  125. package/styles/schedule/highcontrast-light.css +20 -6
  126. package/styles/schedule/highcontrast.css +21 -7
  127. package/styles/schedule/icons/_tailwind3.scss +220 -0
  128. package/styles/schedule/material-dark.css +20 -6
  129. package/styles/schedule/material.css +20 -6
  130. package/styles/schedule/material3-dark.css +21 -7
  131. package/styles/schedule/material3.css +21 -7
  132. package/styles/schedule/tailwind-dark.css +21 -7
  133. package/styles/schedule/tailwind.css +21 -7
  134. package/styles/schedule/tailwind3.css +4599 -0
  135. package/styles/schedule/tailwind3.scss +17 -0
  136. package/styles/tailwind-dark-lite.css +18 -5
  137. package/styles/tailwind-dark.css +23 -10
  138. package/styles/tailwind-lite.css +18 -5
  139. package/styles/tailwind.css +23 -10
  140. package/styles/tailwind3-lite.css +4239 -0
  141. package/styles/tailwind3-lite.scss +18 -0
  142. package/styles/tailwind3.css +5000 -0
  143. package/styles/tailwind3.scss +20 -0
@@ -74,6 +74,8 @@ const agendaCells = 'agendaCells';
74
74
  const resourceHeader = 'resourceHeader';
75
75
  /** @private */
76
76
  const dateHeader = 'dateHeader';
77
+ /** @private */
78
+ const beforePaste = 'beforePaste';
77
79
  /**
78
80
  * Specifies schedule internal events
79
81
  */
@@ -100,6 +102,8 @@ const uiUpdate = 'ui-update';
100
102
  /** @private */
101
103
  const documentClick = 'document-click';
102
104
  /** @private */
105
+ const documentPaste = 'document-paste';
106
+ /** @private */
103
107
  const cellMouseDown = 'cell-mouse-down';
104
108
 
105
109
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -1027,6 +1031,8 @@ const SCROLL_HIDDEN = 'e-scroll-hidden';
1027
1031
  const ALLDAY_APPOINTMENT_SCROLL = 'e-all-day-scroll';
1028
1032
  /** @private */
1029
1033
  const ALLDAY_APPOINTMENT_AUTO = 'e-all-day-auto';
1034
+ /** @private */
1035
+ const CLIPBOARD_CLASS = 'e-clipboard';
1030
1036
 
1031
1037
  /* eslint-disable @typescript-eslint/no-explicit-any */
1032
1038
  /**
@@ -1488,6 +1494,8 @@ class HeaderRenderer {
1488
1494
  targetType: 'relative',
1489
1495
  relateTo: this.getPopUpRelativeElement(),
1490
1496
  position: { X: 'left', Y: 'bottom' },
1497
+ collision: { X: 'fit' },
1498
+ viewPortElement: this.element,
1491
1499
  enableRtl: this.parent.enableRtl
1492
1500
  });
1493
1501
  const calendarView = this.getCalendarView();
@@ -1599,10 +1607,10 @@ class HeaderRenderer {
1599
1607
  }
1600
1608
  break;
1601
1609
  case 'e-prev':
1602
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), args.originalEvent);
1610
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Previous'), args.originalEvent);
1603
1611
  break;
1604
1612
  case 'e-next':
1605
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), args.originalEvent);
1613
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Next'), args.originalEvent);
1606
1614
  break;
1607
1615
  case 'e-add':
1608
1616
  isSameTime = this.parent.activeCellsData.startTime.getTime() === this.parent.activeCellsData.endTime.getTime();
@@ -1827,6 +1835,9 @@ class ScheduleTouch {
1827
1835
  this.touchRightDirection = this.parent.enableRtl ? 'Left' : 'Right';
1828
1836
  }
1829
1837
  scrollHandler(e) {
1838
+ if (!isNullOrUndefined(this.parent.eventTooltip)) {
1839
+ this.parent.eventTooltip.close();
1840
+ }
1830
1841
  const blockSwipe = !this.parent.isAdaptive && e.originalEvent && e.originalEvent.target &&
1831
1842
  !isNullOrUndefined(closest(e.originalEvent.target, '.' + APPOINTMENT_CLASS));
1832
1843
  this.parent.uiStateValues.isTouchScroll = blockSwipe && e.originalEvent.type === 'touchmove' && !this.parent.uiStateValues.action;
@@ -1834,6 +1845,7 @@ class ScheduleTouch {
1834
1845
  this.parent.uiStateValues.isTapHold) {
1835
1846
  return;
1836
1847
  }
1848
+ this.parent.uiStateValues.isSwipeScroll = true;
1837
1849
  if (!this.timeStampStart) {
1838
1850
  this.timeStampStart = Date.now();
1839
1851
  }
@@ -1858,7 +1870,7 @@ class ScheduleTouch {
1858
1870
  }
1859
1871
  if (e.scrollDirection === this.touchLeftDirection) {
1860
1872
  if (!this.nextPanel) {
1861
- this.renderPanel(NEXT_PANEL_CLASS, 'next');
1873
+ this.renderPanel(NEXT_PANEL_CLASS, 'Next');
1862
1874
  this.nextPanel = {
1863
1875
  element: this.parent.activeView.getPanel(),
1864
1876
  selectedDate: new Date(this.parent.selectedDate.getTime()),
@@ -1873,7 +1885,7 @@ class ScheduleTouch {
1873
1885
  else if (e.scrollDirection === this.touchRightDirection) {
1874
1886
  let prevWidth = 0;
1875
1887
  if (!this.previousPanel) {
1876
- this.renderPanel(PREVIOUS_PANEL_CLASS, 'previous');
1888
+ this.renderPanel(PREVIOUS_PANEL_CLASS, 'Previous');
1877
1889
  this.previousPanel = {
1878
1890
  element: this.parent.activeView.getPanel(),
1879
1891
  selectedDate: new Date(this.parent.selectedDate.getTime()),
@@ -2020,6 +2032,7 @@ class ScheduleTouch {
2020
2032
  if (!isNullOrUndefined(this.element) && !this.element.classList.contains(TRANSLATE_CLASS)) {
2021
2033
  return;
2022
2034
  }
2035
+ this.parent.uiStateValues.isSwipeScroll = false;
2023
2036
  removeClass([this.element], TRANSLATE_CLASS);
2024
2037
  this.element.style.transitionDuration = '';
2025
2038
  this.element.style.transform = '';
@@ -2072,6 +2085,8 @@ class ScheduleTouch {
2072
2085
  class KeyboardInteraction {
2073
2086
  constructor(parent) {
2074
2087
  this.selectedCells = [];
2088
+ this.isCutContentPasted = false;
2089
+ this.isCutAction = false;
2075
2090
  this.keyConfigs = {
2076
2091
  downArrow: 'downarrow',
2077
2092
  upArrow: 'uparrow',
@@ -2106,7 +2121,11 @@ class KeyboardInteraction {
2106
2121
  ctrlShiftLeftArrow: 'ctrl+shift+leftarrow',
2107
2122
  ctrlShiftRightArrow: 'ctrl+shift+rightarrow',
2108
2123
  shiftAltY: 'shift+alt+y',
2109
- shiftAltN: 'shift+alt+n'
2124
+ shiftAltN: 'shift+alt+n',
2125
+ cut: 'ctrl+x',
2126
+ copy: 'ctrl+c',
2127
+ cmdCut: 'cmd+x',
2128
+ cmdCopy: 'cmd+c'
2110
2129
  };
2111
2130
  this.parent = parent;
2112
2131
  this.parent.element.tabIndex = this.parent.element.tabIndex === -1 ? 0 : this.parent.element.tabIndex;
@@ -2116,6 +2135,7 @@ class KeyboardInteraction {
2116
2135
  eventName: 'keydown'
2117
2136
  });
2118
2137
  this.addEventListener();
2138
+ this.createClipboardElement();
2119
2139
  }
2120
2140
  keyActionHandler(e) {
2121
2141
  switch (e.action) {
@@ -2136,13 +2156,13 @@ class KeyboardInteraction {
2136
2156
  this.processRight(e, e.shiftKey);
2137
2157
  break;
2138
2158
  case 'ctrlLeftArrow':
2139
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
2159
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Previous'), e);
2140
2160
  if (this.parent.headerModule) {
2141
2161
  this.parent.headerModule.element.querySelector('.e-prev button').focus();
2142
2162
  }
2143
2163
  break;
2144
2164
  case 'ctrlRightArrow':
2145
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2165
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Next'), e);
2146
2166
  if (this.parent.headerModule) {
2147
2167
  this.parent.headerModule.element.querySelector('.e-next button').focus();
2148
2168
  }
@@ -2197,6 +2217,14 @@ class KeyboardInteraction {
2197
2217
  }
2198
2218
  this.processShiftAltN(e);
2199
2219
  break;
2220
+ case 'cut':
2221
+ case 'cmdCut':
2222
+ this.processClipboardAction(true, undefined, e);
2223
+ break;
2224
+ case 'copy':
2225
+ case 'cmdCopy':
2226
+ this.processClipboardAction(false, undefined, e);
2227
+ break;
2200
2228
  }
2201
2229
  }
2202
2230
  processShiftAltN(e) {
@@ -2244,9 +2272,13 @@ class KeyboardInteraction {
2244
2272
  }
2245
2273
  addEventListener() {
2246
2274
  this.parent.on(cellMouseDown, this.onCellMouseDown, this);
2275
+ if (this.parent.allowClipboard) {
2276
+ this.parent.on(documentPaste, this.pasteHandler, this);
2277
+ }
2247
2278
  }
2248
2279
  removeEventListener() {
2249
2280
  this.parent.off(cellMouseDown, this.onCellMouseDown);
2281
+ this.parent.off(documentPaste, this.pasteHandler);
2250
2282
  }
2251
2283
  onCellMouseDown(e) {
2252
2284
  if (e.event.shiftKey) {
@@ -2881,7 +2913,7 @@ class KeyboardInteraction {
2881
2913
  return;
2882
2914
  }
2883
2915
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
2884
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2916
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Next'), e);
2885
2917
  const tableEle = this.parent.getContentTable();
2886
2918
  const cell = isMonthEnd ? tableEle.rows[parseInt(rowIndex.toString(), 10)].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')')
2887
2919
  : tableEle.rows[parseInt(rowIndex.toString(), 10)].cells[0];
@@ -2897,7 +2929,7 @@ class KeyboardInteraction {
2897
2929
  this.selectCells(isMultiple, allDayRow.cells[curColIndex + 1]);
2898
2930
  }
2899
2931
  else if (curColIndex === maxColIndex - 1 && !isMultiple) {
2900
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2932
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Next'), e);
2901
2933
  const allDayRow = this.parent.getAllDayRow();
2902
2934
  this.selectCells(false, allDayRow.cells[0]);
2903
2935
  }
@@ -2951,7 +2983,7 @@ class KeyboardInteraction {
2951
2983
  this.selectCells(isMultiple, this.parent.element.querySelector('[data-date="' + (targetDate.getTime() - MS_PER_DAY) + '"]'));
2952
2984
  return;
2953
2985
  }
2954
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
2986
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Previous'), e);
2955
2987
  const tableEle = this.parent.getContentTable();
2956
2988
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
2957
2989
  let cell = tableEle.rows[parseInt(rowIndex.toString(), 10)].cells[key.maxIndex - 1];
@@ -2971,7 +3003,7 @@ class KeyboardInteraction {
2971
3003
  this.selectCells(isMultiple, allDayRow.cells[curColIndex - 1]);
2972
3004
  }
2973
3005
  else if (curColIndex === 0 && !isMultiple) {
2974
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
3006
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate('Previous'), e);
2975
3007
  const allDayRow = this.parent.getAllDayRow();
2976
3008
  this.selectCells(false, allDayRow.cells[maxColIndex - 1]);
2977
3009
  }
@@ -3236,6 +3268,215 @@ class KeyboardInteraction {
3236
3268
  this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS).scrollTop = workCell.offsetTop;
3237
3269
  }
3238
3270
  }
3271
+ createClipboardElement() {
3272
+ if (!this.parent.allowClipboard) {
3273
+ return;
3274
+ }
3275
+ this.clipBoardTextArea = this.parent.createElement('textarea', {
3276
+ className: CLIPBOARD_CLASS,
3277
+ attrs: {
3278
+ tabindex: '-1'
3279
+ }
3280
+ });
3281
+ this.parent.element.appendChild(this.clipBoardTextArea);
3282
+ }
3283
+ setCopy(copiedEventData, e) {
3284
+ if (window.getSelection().toString() !== '') {
3285
+ return;
3286
+ }
3287
+ this.clipBoardTextArea.value = '';
3288
+ let eventDetails = { elements: [], eventDatas: [] };
3289
+ if (copiedEventData) {
3290
+ const filteredContent = this.filterReadOnlyEvent(copiedEventData);
3291
+ eventDetails.eventDatas = filteredContent;
3292
+ }
3293
+ else {
3294
+ if (!this.parent || !this.parent.eventBase) {
3295
+ return;
3296
+ }
3297
+ const selectedEvents = this.parent.eventBase.getSelectedEvents();
3298
+ selectedEvents.event = selectedEvents && selectedEvents.event ? Array.isArray(selectedEvents.event)
3299
+ ? this.filterReadOnlyEvent(selectedEvents.event) :
3300
+ this.filterReadOnlyEvent([selectedEvents.event]) : undefined;
3301
+ if (selectedEvents.element && selectedEvents.event) {
3302
+ eventDetails = {
3303
+ elements: selectedEvents.element,
3304
+ eventDatas: selectedEvents.event
3305
+ };
3306
+ }
3307
+ else {
3308
+ eventDetails.element = [e.target];
3309
+ eventDetails.eventDatas = [this.parent.getEventDetails(e.target)];
3310
+ }
3311
+ }
3312
+ this.clipBoardTextArea.value = JSON.stringify(eventDetails.eventDatas, undefined, 2);
3313
+ if (!/ipad|ipod|iphone/i.test(Browser.userAgent)) {
3314
+ this.clipBoardTextArea.select();
3315
+ }
3316
+ else {
3317
+ this.clipBoardTextArea.setSelectionRange(0, this.clipBoardTextArea.value.length);
3318
+ }
3319
+ if (!isNullOrUndefined(navigator.clipboard)) {
3320
+ navigator.clipboard.writeText(this.clipBoardTextArea.value)
3321
+ .then(() => {
3322
+ this.clipBoardTextArea.blur();
3323
+ window.getSelection().removeAllRanges();
3324
+ if (e) {
3325
+ const closestAppointment = e.target.closest('.' + APPOINTMENT_CLASS);
3326
+ if (closestAppointment) {
3327
+ closestAppointment.focus();
3328
+ }
3329
+ }
3330
+ })
3331
+ .catch((err) => {
3332
+ throw err;
3333
+ });
3334
+ }
3335
+ }
3336
+ filterReadOnlyEvent(args) {
3337
+ return args.filter((event) => !event[this.parent.eventFields.isReadonly]);
3338
+ }
3339
+ processClipboardAction(isCut, copiedEventData, e) {
3340
+ if (!this.parent.allowClipboard) {
3341
+ return;
3342
+ }
3343
+ this.isCutAction = isCut;
3344
+ this.isCutContentPasted = false;
3345
+ this.parent.closeQuickInfoPopup();
3346
+ this.setCopy(copiedEventData ? copiedEventData : undefined, e);
3347
+ }
3348
+ pasteHandler(clipboardEvent, targetElement) {
3349
+ if (!this.parent.allowClipboard || this.isCutContentPasted) {
3350
+ return;
3351
+ }
3352
+ const target = this.parent.getSelectedCells().length > 0
3353
+ ? this.parent.getSelectedCells()
3354
+ : (targetElement ? [targetElement] : []);
3355
+ if (target.length === 0 || this.parent.eventWindow.dialogObject.visible ||
3356
+ this.parent.quickPopup.quickPopup.element.classList.contains(POPUP_OPEN)) {
3357
+ return;
3358
+ }
3359
+ const clipboardData = clipboardEvent.clipboardData || clipboardEvent.event.clipboardData
3360
+ || window.clipboardData;
3361
+ const pastedData = clipboardData.getData('text');
3362
+ if (pastedData === '[]' || pastedData === '') {
3363
+ return;
3364
+ }
3365
+ let parsedData;
3366
+ try {
3367
+ parsedData = JSON.parse(pastedData);
3368
+ }
3369
+ catch (_a) {
3370
+ parsedData = pastedData;
3371
+ }
3372
+ const args = { cancel: false, data: parsedData, element: target };
3373
+ this.parent.trigger(beforePaste, args, (pasteEventArgs) => {
3374
+ if (!pasteEventArgs.cancel) {
3375
+ if (!Array.isArray(pasteEventArgs.data) || !pasteEventArgs.data.every((item) => typeof item === 'object')) {
3376
+ this.clipBoardTextArea.value = '';
3377
+ return;
3378
+ }
3379
+ this.processPaste(pasteEventArgs.data, targetElement);
3380
+ if (this.isCutAction) {
3381
+ this.isCutContentPasted = true;
3382
+ }
3383
+ }
3384
+ else {
3385
+ this.parent.closeQuickInfoPopup();
3386
+ return;
3387
+ }
3388
+ });
3389
+ }
3390
+ processPaste(data, targetElement) {
3391
+ if (!this.parent || !this.parent.eventWindow || !this.parent.eventBase || !data || !data.length) {
3392
+ return;
3393
+ }
3394
+ const target = this.getTargetElements(targetElement);
3395
+ const cellDetails = this.parent.getCellDetails(target);
3396
+ const eventDetails = {};
3397
+ this.parent.eventWindow.convertToEventData(cellDetails, eventDetails);
3398
+ const isAllDay = this.isAllDayEvent(target);
3399
+ const resources = this.parent.getResourcesByIndex(cellDetails.groupIndex);
3400
+ const processedData = this.processEventData(data, isAllDay, cellDetails, resources);
3401
+ const selectedEventData = this.parent.eventBase.sortByDateTime(processedData);
3402
+ const saveData = this.prepareEventData(selectedEventData, eventDetails);
3403
+ removeClass(target, SELECTED_CELL_CLASS);
3404
+ if (saveData.length > 0) {
3405
+ if (this.isCutAction) {
3406
+ this.parent.saveEvent(saveData);
3407
+ }
3408
+ else {
3409
+ this.parent.addEvent(saveData);
3410
+ }
3411
+ }
3412
+ }
3413
+ getTargetElements(targetElement) {
3414
+ return this.parent.getSelectedCells().length > 0
3415
+ ? this.parent.getSelectedCells()
3416
+ : (targetElement ? [targetElement] : []);
3417
+ }
3418
+ isAllDayEvent(target) {
3419
+ return !target.some((cell) => cell.classList.contains(WORK_CELLS_CLASS));
3420
+ }
3421
+ processEventData(data, isAllDay, cellDetails, resources) {
3422
+ return data.map((item) => {
3423
+ const processedItem = Object.assign({}, item, { [this.parent.eventFields.startTime]: new Date(item[this.parent.eventFields.startTime]), [this.parent.eventFields.endTime]: new Date(item[this.parent.eventFields.endTime]), [this.parent.eventFields.recurrenceID]: null, [this.parent.eventFields.isAllDay]: isAllDay });
3424
+ this.adjustEventTime(processedItem, isAllDay, item.IsAllDay, cellDetails);
3425
+ if (resources && resources.groupData) {
3426
+ Object.assign(processedItem, resources.groupData);
3427
+ }
3428
+ return processedItem;
3429
+ });
3430
+ }
3431
+ adjustEventTime(processedItem, isAllDay, itemIsAllDay, cellDetails) {
3432
+ const isTimeScaleEnabled = this.parent.activeViewOptions.timeScale.enable;
3433
+ if ((['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) !== -1) && isTimeScaleEnabled) {
3434
+ if (isAllDay) {
3435
+ processedItem[this.parent.eventFields.endTime] = new Date(processedItem[this.parent.eventFields.startTime]);
3436
+ processedItem[this.parent.eventFields.endTime].setDate(processedItem[this.parent.eventFields.startTime].getDate() + 1);
3437
+ }
3438
+ else if (itemIsAllDay) {
3439
+ processedItem[this.parent.eventFields.startTime] = new Date(processedItem[this.parent.eventFields.startTime]
3440
+ .setHours(0, 0, 0, 0));
3441
+ processedItem[this.parent.eventFields.endTime] = new Date(processedItem[this.parent.eventFields.startTime].getTime() + (cellDetails.endTime.getTime() - cellDetails.startTime.getTime()));
3442
+ }
3443
+ }
3444
+ else if (itemIsAllDay) {
3445
+ processedItem[this.parent.eventFields.isAllDay] = true;
3446
+ processedItem[this.parent.eventFields.startTime] = new Date(processedItem[this.parent.eventFields.startTime]
3447
+ .setHours(0, 0, 0, 0));
3448
+ processedItem[this.parent.eventFields.endTime] = new Date(processedItem[this.parent.eventFields.startTime].getTime() +
3449
+ (processedItem[this.parent.eventFields.endTime].getTime() - processedItem[this.parent.eventFields.startTime].getTime()));
3450
+ }
3451
+ }
3452
+ prepareEventData(selectedEventData, eventDetails) {
3453
+ const initialEventTime = new Date(selectedEventData[0][this.parent.eventFields.startTime]);
3454
+ let uniqueId = this.parent.getEventMaxID();
3455
+ return selectedEventData.map((events) => {
3456
+ const totalDuration = this.calculateTotalDuration(events, eventDetails, initialEventTime);
3457
+ const cloneDetails = this.isCutAction ? events : Object.assign({}, events);
3458
+ if (!events[this.parent.eventFields.recurrenceRule]) {
3459
+ cloneDetails[this.parent.eventFields.startTime] =
3460
+ new Date(new Date(cloneDetails[this.parent.eventFields.startTime]).setMilliseconds(totalDuration));
3461
+ cloneDetails[this.parent.eventFields.endTime] =
3462
+ new Date(new Date(cloneDetails[this.parent.eventFields.endTime]).setMilliseconds(totalDuration));
3463
+ }
3464
+ if (!this.isCutAction) {
3465
+ cloneDetails[this.parent.eventFields.id] = uniqueId++;
3466
+ }
3467
+ return cloneDetails;
3468
+ });
3469
+ }
3470
+ calculateTotalDuration(events, eventDetails, initialEventTime) {
3471
+ if ((['Month', 'TimelineMonth', 'TimelineYear'].indexOf(this.parent.currentView) !== -1) || !this.parent.activeViewOptions.timeScale.enable) {
3472
+ const eventStartTime = new Date(events[this.parent.eventFields.startTime]);
3473
+ return eventDetails[this.parent.eventFields.startTime].getTime() - initialEventTime.getTime() +
3474
+ (eventStartTime.getHours() * 3600000 + eventStartTime.getMinutes() * 60000 + eventStartTime.getSeconds() * 1000);
3475
+ }
3476
+ else {
3477
+ return eventDetails[this.parent.eventFields.startTime].getTime() - initialEventTime.getTime();
3478
+ }
3479
+ }
3239
3480
  /**
3240
3481
  * Get module name.
3241
3482
  *
@@ -3253,6 +3494,7 @@ class KeyboardInteraction {
3253
3494
  destroy() {
3254
3495
  this.removeEventListener();
3255
3496
  this.selectedCells = [];
3497
+ this.clipBoardTextArea = null;
3256
3498
  this.keyboardModule.destroy();
3257
3499
  }
3258
3500
  }
@@ -10767,6 +11009,10 @@ class EventTooltip {
10767
11009
  return targets.join(',');
10768
11010
  }
10769
11011
  onBeforeRender(args) {
11012
+ if (this.parent.uiStateValues.isSwipeScroll) {
11013
+ args.cancel = true;
11014
+ return;
11015
+ }
10770
11016
  if (!isNullOrUndefined(args.target.getAttribute('data-tooltip-id'))) {
10771
11017
  return;
10772
11018
  }
@@ -17768,6 +18014,9 @@ let Schedule = class Schedule extends Component {
17768
18014
  EventHandler.add(window, 'resize', this.onScheduleResize, this);
17769
18015
  EventHandler.add(window, 'orientationchange', this.onScheduleResize, this);
17770
18016
  EventHandler.add(document, Browser.touchStartEvent, this.onDocumentClick, this);
18017
+ if (this.allowClipboard) {
18018
+ EventHandler.add(document, 'paste', this.onDocumentPaste, this);
18019
+ }
17771
18020
  }
17772
18021
  /**
17773
18022
  * Method to remove selected class
@@ -18141,6 +18390,9 @@ let Schedule = class Schedule extends Component {
18141
18390
  onDocumentClick(args) {
18142
18391
  this.notify(documentClick, { event: args });
18143
18392
  }
18393
+ onDocumentPaste(args) {
18394
+ this.notify(documentPaste, { event: args });
18395
+ }
18144
18396
  onScheduleResize() {
18145
18397
  if (isNullOrUndefined(this.activeView) || ((this.isAdaptive || isMobile()) && document.activeElement
18146
18398
  && (document.activeElement.classList.contains(SUBJECT_CLASS) ||
@@ -18338,6 +18590,7 @@ let Schedule = class Schedule extends Component {
18338
18590
  EventHandler.remove(window, 'resize', this.onScheduleResize);
18339
18591
  EventHandler.remove(window, 'orientationchange', this.onScheduleResize);
18340
18592
  EventHandler.remove(document, Browser.touchStartEvent, this.onDocumentClick);
18593
+ EventHandler.remove(document, 'paste', this.onDocumentPaste);
18341
18594
  }
18342
18595
  /**
18343
18596
  * Core method to return the component name.
@@ -18572,11 +18825,12 @@ let Schedule = class Schedule extends Component {
18572
18825
  this.onEventSettingsPropertyChanged(newProp.eventSettings, oldProp.eventSettings, state);
18573
18826
  break;
18574
18827
  case 'allowKeyboardInteraction':
18828
+ case 'allowClipboard':
18575
18829
  if (this.keyboardInteractionModule) {
18576
18830
  this.keyboardInteractionModule.destroy();
18577
18831
  this.keyboardInteractionModule = null;
18578
18832
  }
18579
- if (newProp.allowKeyboardInteraction) {
18833
+ if (newProp.allowKeyboardInteraction || newProp.allowClipboard) {
18580
18834
  this.keyboardInteractionModule = new KeyboardInteraction(this);
18581
18835
  }
18582
18836
  break;
@@ -19494,6 +19748,74 @@ let Schedule = class Schedule extends Component {
19494
19748
  }
19495
19749
  return (eventCollection.length > 0) ? false : true;
19496
19750
  }
19751
+ /**
19752
+ * Method to copy events from an HTMLElement or an array of HTMLElements.
19753
+ *
19754
+ * @param { HTMLElement[] } elements Accepts an array of HTMLElement
19755
+ * @returns {void} This method does not return a value.
19756
+ */
19757
+ copy(elements) {
19758
+ this.processCutCopyActions(elements, false);
19759
+ }
19760
+ /**
19761
+ * Method to cut events from an HTMLElement or an array of HTMLElements.
19762
+ *
19763
+ * @param { HTMLElement[] } elements Accepts an array of HTMLElement
19764
+ * @returns {void} This method does not return a value.
19765
+ */
19766
+ cut(elements) {
19767
+ this.processCutCopyActions(elements, true);
19768
+ }
19769
+ /**
19770
+ * Method to create a paste event with clipboard data
19771
+ *
19772
+ * @param { HTMLElement } targetElement Accepts HTMLElement
19773
+ * @returns {void}
19774
+ */
19775
+ paste(targetElement) {
19776
+ if (!this.allowClipboard || !this.allowKeyboardInteraction) {
19777
+ return;
19778
+ }
19779
+ if (!targetElement.classList.contains('e-work-cells') && !targetElement.classList.contains('e-all-day-cells')) {
19780
+ return;
19781
+ }
19782
+ const clipboardData = new DataTransfer();
19783
+ if (!isNullOrUndefined(navigator.clipboard)) {
19784
+ navigator.clipboard.readText()
19785
+ .then((text) => {
19786
+ clipboardData.setData('text/plain', text);
19787
+ const pasteEvent = new ClipboardEvent('paste', {
19788
+ bubbles: true,
19789
+ cancelable: true
19790
+ });
19791
+ Object.defineProperty(pasteEvent, 'clipboardData', {
19792
+ value: clipboardData
19793
+ });
19794
+ this.keyboardInteractionModule.pasteHandler(pasteEvent, targetElement);
19795
+ })
19796
+ .catch((err) => {
19797
+ throw err;
19798
+ });
19799
+ }
19800
+ }
19801
+ processCutCopyActions(elements, isCut) {
19802
+ if (!elements || !this.allowClipboard || !this.allowKeyboardInteraction) {
19803
+ return;
19804
+ }
19805
+ const elementArray = elements;
19806
+ const eventDetailsArray = [];
19807
+ elementArray.forEach((element) => {
19808
+ if (element.classList.contains(APPOINTMENT_CLASS)) {
19809
+ const eventDetail = this.getEventDetails(element);
19810
+ if (eventDetail) {
19811
+ eventDetailsArray.push(eventDetail);
19812
+ }
19813
+ }
19814
+ });
19815
+ if (eventDetailsArray.length > 0) {
19816
+ this.keyboardInteractionModule.processClipboardAction(isCut, eventDetailsArray);
19817
+ }
19818
+ }
19497
19819
  /**
19498
19820
  * To manually open the event editor on specific time or on certain events.
19499
19821
  *
@@ -19621,6 +19943,51 @@ let Schedule = class Schedule extends Component {
19621
19943
  this.eventTooltip.close();
19622
19944
  }
19623
19945
  }
19946
+ /**
19947
+ * Retrieves a formatted string representing the date range of the given date collection.
19948
+ *
19949
+ * @param {Date[]} dates - An array of Date objects representing the date range.
19950
+ * @returns {string} A formatted string describing the date range.
19951
+ * If the dates is empty, returns an empty string.
19952
+ * Otherwise, delegates to the active view to generate the appropriate date range text.
19953
+ *
19954
+ * @example
19955
+ * // Assuming dates contains dates from May 1, 2023 to May 7, 2023
19956
+ * const rangeText = schedule.getDateRangeText(schedule.getViewDates());
19957
+ * // rangeText might be "May 1 - 7, 2023" (actual format depends on the active view)
19958
+ *
19959
+ * @remarks
19960
+ * The actual format of the returned string depends on the implementation
19961
+ * of the getDateRangeText method in the active view.
19962
+ */
19963
+ getDateRangeText(dates) {
19964
+ if ((isNullOrUndefined(dates) && dates.length === 0) || !this.activeView) {
19965
+ return '';
19966
+ }
19967
+ return this.activeView.getDateRangeText(dates[0], dates);
19968
+ }
19969
+ /**
19970
+ * Retrieves an array of dates based on the specified date collection direction.
19971
+ *
19972
+ * @param {NavigationDirection} type - The direction for date collection. Options are:
19973
+ * - 'Previous': Returns the previous date range collection from the current rendered date.
19974
+ * - 'Next': Returns the next date range collection from the current rendered date.
19975
+ * - 'Current': Returns the current rendered date collection.
19976
+ *
19977
+ * @returns {Date[]} An array of Date objects representing the view dates.
19978
+ */
19979
+ getViewDates(type = 'Current') {
19980
+ if (!this.activeView) {
19981
+ return [];
19982
+ }
19983
+ switch (type) {
19984
+ case 'Previous':
19985
+ case 'Next':
19986
+ return this.activeView.getRenderDates(undefined, this.activeView.getNextPreviousDate(type));
19987
+ case 'Current':
19988
+ return this.getCurrentViewDates();
19989
+ }
19990
+ }
19624
19991
  /**
19625
19992
  * Select the resource based on group index in mobile mode.
19626
19993
  *
@@ -19925,6 +20292,9 @@ __decorate$b([
19925
20292
  __decorate$b([
19926
20293
  Property()
19927
20294
  ], Schedule.prototype, "cssClass", void 0);
20295
+ __decorate$b([
20296
+ Property(false)
20297
+ ], Schedule.prototype, "allowClipboard", void 0);
19928
20298
  __decorate$b([
19929
20299
  Property()
19930
20300
  ], Schedule.prototype, "eventDragArea", void 0);
@@ -20009,6 +20379,9 @@ __decorate$b([
20009
20379
  __decorate$b([
20010
20380
  Event()
20011
20381
  ], Schedule.prototype, "dataBound", void 0);
20382
+ __decorate$b([
20383
+ Event()
20384
+ ], Schedule.prototype, "beforePaste", void 0);
20012
20385
  Schedule = __decorate$b([
20013
20386
  NotifyPropertyChanges
20014
20387
  ], Schedule);
@@ -20095,9 +20468,10 @@ class ActionBase {
20095
20468
  }
20096
20469
  }
20097
20470
  calculateIntervalTime(date) {
20098
- const intervalTime = new Date(+date);
20099
- intervalTime.setMinutes(Math.floor(intervalTime.getMinutes() / this.actionObj.interval) * this.actionObj.interval);
20100
- return intervalTime;
20471
+ let dateInMS = resetTime(date).getTime();
20472
+ const intervalInMS = MS_PER_MINUTE * this.actionObj.interval;
20473
+ dateInMS = dateInMS + Math.floor((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
20474
+ return new Date(dateInMS);
20101
20475
  }
20102
20476
  getContentAreaDimension() {
20103
20477
  const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
@@ -22129,12 +22503,12 @@ class DragAndDrop extends ActionBase {
22129
22503
  if ((dragArea.scrollLeft === 0) &&
22130
22504
  (Math.round(this.actionObj.X) <=
22131
22505
  Math.round(dragArea.getBoundingClientRect().left + this.actionObj.cellWidth + window.pageXOffset))) {
22132
- navigationType = this.parent.enableRtl ? 'next' : 'previous';
22506
+ navigationType = this.parent.enableRtl ? 'Next' : 'Previous';
22133
22507
  }
22134
22508
  else if ((Math.round(dragArea.scrollLeft) + dragArea.clientWidth === dragArea.scrollWidth) &&
22135
22509
  (Math.round(this.actionObj.X) >=
22136
22510
  Math.round(dragArea.getBoundingClientRect().right - this.actionObj.cellWidth + window.pageXOffset))) {
22137
- navigationType = this.parent.enableRtl ? 'previous' : 'next';
22511
+ navigationType = this.parent.enableRtl ? 'Previous' : 'Next';
22138
22512
  }
22139
22513
  if (navigationType) {
22140
22514
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate(navigationType));
@@ -22987,7 +23361,7 @@ class ViewBase {
22987
23361
  * @param {Schedule} parent Accepts the schedule instance
22988
23362
  */
22989
23363
  constructor(parent) {
22990
- this.previousNextAction = 'next';
23364
+ this.previousNextAction = 'Next';
22991
23365
  this.parent = parent;
22992
23366
  }
22993
23367
  isTimelineView() {
@@ -23242,11 +23616,11 @@ class ViewBase {
23242
23616
  return !(getDateInMs(date) < getDateInMs(startHour) || getDateInMs(date) >= getDateInMs(endHour) ||
23243
23617
  !this.isWorkDay(date, workDays));
23244
23618
  }
23245
- getRenderDates(workDays) {
23619
+ getRenderDates(workDays, date = this.parent.selectedDate) {
23246
23620
  const renderDates = [];
23247
23621
  // Due to same code for vertical and time line, week & work week views, if condition has used
23248
23622
  if (this.parent.currentView === 'Week' || this.parent.currentView === 'TimelineWeek') {
23249
- const selectedDate = resetTime(this.parent.selectedDate);
23623
+ const selectedDate = resetTime(date);
23250
23624
  let start = getWeekFirstDate(selectedDate, this.parent.activeViewOptions.firstDayOfWeek);
23251
23625
  for (let i = 0, length = WEEK_LENGTH * this.parent.activeViewOptions.interval; i < length; i++) {
23252
23626
  if (this.parent.activeViewOptions.showWeekend) {
@@ -23261,7 +23635,7 @@ class ViewBase {
23261
23635
  }
23262
23636
  }
23263
23637
  else if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {
23264
- let start = getWeekFirstDate(resetTime(this.parent.selectedDate), this.parent.activeViewOptions.firstDayOfWeek);
23638
+ let start = getWeekFirstDate(resetTime(date), this.parent.activeViewOptions.firstDayOfWeek);
23265
23639
  for (let i = 0, length = WEEK_LENGTH * this.parent.activeViewOptions.interval; i < length; i++) {
23266
23640
  if (this.isWorkDay(start, workDays)) {
23267
23641
  renderDates.push(start);
@@ -23272,7 +23646,7 @@ class ViewBase {
23272
23646
  else {
23273
23647
  const dayCount = this.parent.currentView === 'Agenda' ? this.parent.agendaDaysCount :
23274
23648
  this.parent.activeViewOptions.interval;
23275
- let start = resetTime(this.parent.selectedDate);
23649
+ let start = resetTime(date);
23276
23650
  do {
23277
23651
  if (this.parent.activeViewOptions.showWeekend) {
23278
23652
  renderDates.push(start);
@@ -23298,11 +23672,11 @@ class ViewBase {
23298
23672
  if (this.parent.currentView === 'Day' || this.parent.currentView === 'TimelineDay') {
23299
23673
  if (this.parent.activeViewOptions.showWeekend) {
23300
23674
  const daysCount = this.parent.activeViewOptions.interval;
23301
- return addDays(this.parent.selectedDate, type === 'next' ? daysCount : -daysCount);
23675
+ return addDays(this.parent.selectedDate, type === 'Next' ? daysCount : -daysCount);
23302
23676
  }
23303
23677
  else {
23304
23678
  let date;
23305
- if (type === 'next') {
23679
+ if (type === 'Next') {
23306
23680
  date = addDays(this.renderDates.slice(-1)[0], 1);
23307
23681
  while (!this.isWorkDay(date)) {
23308
23682
  date = addDays(date, 1);
@@ -23323,7 +23697,7 @@ class ViewBase {
23323
23697
  return date;
23324
23698
  }
23325
23699
  }
23326
- const weekLength = type === 'next' ? WEEK_LENGTH : -WEEK_LENGTH;
23700
+ const weekLength = type === 'Next' ? WEEK_LENGTH : -WEEK_LENGTH;
23327
23701
  return addDays(this.parent.selectedDate, weekLength * this.parent.activeViewOptions.interval);
23328
23702
  }
23329
23703
  formatViewLabel(view, startDate, endDate) {
@@ -23350,12 +23724,12 @@ class ViewBase {
23350
23724
  }
23351
23725
  }
23352
23726
  }
23353
- getDateRangeText() {
23727
+ getDateRangeText(date = this.renderDates[0], dateCollection = this.renderDates) {
23354
23728
  if (this.parent.isAdaptive) {
23355
23729
  const formatDate = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
23356
23730
  return capitalizeFirstWord(this.parent.globalize.formatDate(this.parent.selectedDate, { format: formatDate, calendar: this.parent.getCalendarMode() }), 'single');
23357
23731
  }
23358
- return this.formatDateRange(this.renderDates[0], this.renderDates[this.renderDates.length - 1]);
23732
+ return this.formatDateRange(date, dateCollection[dateCollection.length - 1]);
23359
23733
  }
23360
23734
  formatDateRange(startDate, endDate) {
23361
23735
  const globalize = this.parent.globalize;
@@ -25111,9 +25485,9 @@ class Month extends ViewBase {
25111
25485
  }
25112
25486
  return false;
25113
25487
  }
25114
- getRenderDates(workDays) {
25488
+ getRenderDates(workDays, selectedDate = this.parent.selectedDate) {
25115
25489
  const renderDates = [];
25116
- const currentDate = resetTime(this.parent.selectedDate);
25490
+ const currentDate = resetTime(selectedDate);
25117
25491
  let start = this.getMonthStart(currentDate);
25118
25492
  const monthEnd = this.getMonthEnd(currentDate);
25119
25493
  do {
@@ -25141,13 +25515,13 @@ class Month extends ViewBase {
25141
25515
  getNextPreviousDate(type) {
25142
25516
  if (this.isCustomMonth()) {
25143
25517
  const dates = this.parent.getCurrentViewDates();
25144
- const date = getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
25518
+ const date = getWeekFirstDate(type === 'Next' ? dates[dates.length - 1]
25145
25519
  : dates[0], this.parent.activeViewOptions.firstDayOfWeek);
25146
- return addDays(date, type === 'next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
25520
+ return addDays(date, type === 'Next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
25147
25521
  this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS) * WEEK_LENGTH);
25148
25522
  }
25149
25523
  else {
25150
- return addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
25524
+ return addMonths(this.parent.selectedDate, ((type === 'Next' ? 1 : -1) * this.parent.activeViewOptions.interval));
25151
25525
  }
25152
25526
  }
25153
25527
  getStartDate() {
@@ -25159,13 +25533,16 @@ class Month extends ViewBase {
25159
25533
  getEndDateFromStartDate(start) {
25160
25534
  return addDays(new Date(start.getTime()), 1);
25161
25535
  }
25162
- getDateRangeText() {
25536
+ getDateRangeText(startDate = this.parent.selectedDate, dateCollection = null) {
25163
25537
  if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
25164
- let startDate = this.parent.selectedDate;
25538
+ const maxNumberOfDaysPerWeek = 7;
25539
+ startDate = !isNullOrUndefined(dateCollection) && dateCollection.length > maxNumberOfDaysPerWeek - 1
25540
+ ? dateCollection[maxNumberOfDaysPerWeek - 1] : startDate;
25165
25541
  let endDate;
25166
25542
  let updateCustomRange = false;
25167
25543
  if (this.isCustomMonth()) {
25168
- const dates = this.parent.getCurrentViewDates();
25544
+ const dates = !isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection :
25545
+ this.parent.getCurrentViewDates();
25169
25546
  updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
25170
25547
  dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
25171
25548
  if (updateCustomRange) {
@@ -25191,7 +25568,8 @@ class Month extends ViewBase {
25191
25568
  const format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
25192
25569
  return capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
25193
25570
  }
25194
- return this.formatDateRange(this.parent.selectedDate);
25571
+ return this.formatDateRange(!isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection[0] :
25572
+ this.parent.selectedDate);
25195
25573
  }
25196
25574
  getLabelText(view) {
25197
25575
  const viewStr = view.charAt(0).toLowerCase() + view.substring(1);
@@ -25505,7 +25883,7 @@ class Year extends ViewBase {
25505
25883
  this.parent.activeCellsData = this.parent.getCellDetails(target);
25506
25884
  const isPrevious = startDate.getTime() < this.getStartDate().getTime();
25507
25885
  if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
25508
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
25886
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'Previous' : 'Next'), e);
25509
25887
  const activeDate = this.parent.activeCellsData.startTime.getTime();
25510
25888
  const inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
25511
25889
  const dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
@@ -25608,16 +25986,17 @@ class Year extends ViewBase {
25608
25986
  return addDays(new Date(date.getTime()), 1);
25609
25987
  }
25610
25988
  getNextPreviousDate(type) {
25611
- return addYears(this.parent.selectedDate, ((type === 'next') ? 1 : -1));
25989
+ return addYears(this.parent.selectedDate, ((type === 'Next') ? 1 : -1));
25612
25990
  }
25613
- getDateRangeText() {
25614
- const startDate = this.getStartDate();
25615
- const endDate = this.getEndDate();
25991
+ getDateRangeText(date = this.parent.selectedDate, dateCollection = null) {
25992
+ const isDateColAvail = !isNullOrUndefined(dateCollection) && dateCollection.length > 0;
25993
+ const startDate = isDateColAvail ? dateCollection[0] : this.getStartDate();
25994
+ const endDate = isDateColAvail ? dateCollection[dateCollection.length - 1] : this.getEndDate();
25616
25995
  if (startDate.getFullYear() !== endDate.getFullYear()) {
25617
25996
  return this.parent.globalize.formatDate(startDate, { skeleton: 'yMMM' }) + ' - ' + this.parent.globalize.formatDate(endDate, { skeleton: 'yMMM' });
25618
25997
  }
25619
25998
  else {
25620
- return this.parent.globalize.formatDate(this.parent.selectedDate, { skeleton: 'y' });
25999
+ return this.parent.globalize.formatDate(isDateColAvail ? dateCollection[0] : date, { skeleton: 'y' });
25621
26000
  }
25622
26001
  }
25623
26002
  addEventListener() {
@@ -26445,7 +26824,7 @@ class Agenda extends AgendaBase {
26445
26824
  return resetTime(addDays(filterDate, 1));
26446
26825
  }
26447
26826
  getNextPreviousDate(type) {
26448
- const noOfDays = (type === 'next') ? 1 : -1;
26827
+ const noOfDays = (type === 'Next') ? 1 : -1;
26449
26828
  return addDays(this.parent.selectedDate, noOfDays);
26450
26829
  }
26451
26830
  startDate() {
@@ -26684,9 +27063,9 @@ class MonthAgenda extends Month {
26684
27063
  }
26685
27064
  getNextPreviousDate(type) {
26686
27065
  const selectedDate = this.parent.selectedDate;
26687
- const interval = (type === 'next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
27066
+ const interval = (type === 'Next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
26688
27067
  const navigateDate = addMonths(this.parent.selectedDate, interval);
26689
- const month = (type === 'next') ? 2 : 0;
27068
+ const month = (type === 'Next') ? 2 : 0;
26690
27069
  const lastDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + month, 0).getDate();
26691
27070
  const date = (lastDate >= this.monthAgendaDate.getDate()) ? this.monthAgendaDate.getDate() : lastDate;
26692
27071
  this.monthAgendaDate = new Date(navigateDate.getFullYear(), navigateDate.getMonth(), date);
@@ -28347,5 +28726,5 @@ class Print {
28347
28726
  }
28348
28727
  }
28349
28728
 
28350
- export { Agenda, DEFAULT_WEEKS, Day, DragAndDrop, ExcelExport, Gregorian, HeaderRenderer, ICalendarExport, ICalendarImport, Islamic, MS_PER_DAY, MS_PER_MINUTE, Month, MonthAgenda, Print, RecurrenceEditor, Resize, Schedule, TimelineMonth, TimelineViews, TimelineYear, Timezone, ViewBase, WEEK_LENGTH, Week, WorkWeek, Year, actionBegin, actionComplete, actionFailure, addDays, addMonths, addYears, agendaCells, capitalizeFirstWord, cellClick, cellDoubleClick, cellMouseDown, cellSelect, contentReady, dataBinding, dataBound, dataReady, dateHeader, documentClick, drag, dragStart, dragStop, eventClick, eventDoubleClick, eventRendered, eventsLoaded, extractObjectFromRule, findIndexInData, firstDateOfMonth, generate, generateSummary, getCalendarUtil, getDateCount, getDateFromRecurrenceDateString, getDateFromString, getDateInMs, getDaysCount, getElementHeight, getElementHeightFromClass, getElementTop, getElementWidth, getElementWidthFromClass, getMaxDays, getOuterHeight, getRecurrenceStringFromDate, getScrollBarWidth, getStartEndHours, getTranslateX, getTranslateY, getUniversalTime, getWeekFirstDate, getWeekLastDate, getWeekMiddleDate, getWeekNumber, hover, initialEnd, initialLoad, inlineClick, isDaylightSavingTime, isIPadDevice, isMobile, lastDateOfMonth, moreEventsClick, navigating, noEvents, popupClose, popupOpen, print, removeChildren, renderCell, resetScrollbarWidth, resetTime, resizeStart, resizeStop, resizing, resourceHeader, scroll, scrollUiUpdate, select, setTime, timezoneData, uiUpdate, virtualScroll, virtualScrollStart, virtualScrollStop };
28729
+ export { Agenda, DEFAULT_WEEKS, Day, DragAndDrop, ExcelExport, Gregorian, HeaderRenderer, ICalendarExport, ICalendarImport, Islamic, MS_PER_DAY, MS_PER_MINUTE, Month, MonthAgenda, Print, RecurrenceEditor, Resize, Schedule, TimelineMonth, TimelineViews, TimelineYear, Timezone, ViewBase, WEEK_LENGTH, Week, WorkWeek, Year, actionBegin, actionComplete, actionFailure, addDays, addMonths, addYears, agendaCells, beforePaste, capitalizeFirstWord, cellClick, cellDoubleClick, cellMouseDown, cellSelect, contentReady, dataBinding, dataBound, dataReady, dateHeader, documentClick, documentPaste, drag, dragStart, dragStop, eventClick, eventDoubleClick, eventRendered, eventsLoaded, extractObjectFromRule, findIndexInData, firstDateOfMonth, generate, generateSummary, getCalendarUtil, getDateCount, getDateFromRecurrenceDateString, getDateFromString, getDateInMs, getDaysCount, getElementHeight, getElementHeightFromClass, getElementTop, getElementWidth, getElementWidthFromClass, getMaxDays, getOuterHeight, getRecurrenceStringFromDate, getScrollBarWidth, getStartEndHours, getTranslateX, getTranslateY, getUniversalTime, getWeekFirstDate, getWeekLastDate, getWeekMiddleDate, getWeekNumber, hover, initialEnd, initialLoad, inlineClick, isDaylightSavingTime, isIPadDevice, isMobile, lastDateOfMonth, moreEventsClick, navigating, noEvents, popupClose, popupOpen, print, removeChildren, renderCell, resetScrollbarWidth, resetTime, resizeStart, resizeStop, resizing, resourceHeader, scroll, scrollUiUpdate, select, setTime, timezoneData, uiUpdate, virtualScroll, virtualScrollStart, virtualScrollStop };
28351
28730
  //# sourceMappingURL=ej2-schedule.es2015.js.map