@syncfusion/ej2-schedule 27.2.5 → 28.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) 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 +435 -52
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +464 -54
  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.d.ts +1 -0
  15. package/src/schedule/actions/drag.js +12 -8
  16. package/src/schedule/actions/keyboard.d.ts +16 -0
  17. package/src/schedule/actions/keyboard.js +254 -8
  18. package/src/schedule/actions/touch.js +7 -2
  19. package/src/schedule/base/constant.d.ts +4 -0
  20. package/src/schedule/base/constant.js +4 -0
  21. package/src/schedule/base/css-constant.d.ts +2 -0
  22. package/src/schedule/base/css-constant.js +2 -0
  23. package/src/schedule/base/interface.d.ts +14 -4
  24. package/src/schedule/base/schedule-model.d.ts +17 -1
  25. package/src/schedule/base/schedule.d.ts +67 -1
  26. package/src/schedule/base/schedule.js +131 -1
  27. package/src/schedule/base/type.d.ts +8 -0
  28. package/src/schedule/popups/event-tooltip.js +4 -0
  29. package/src/schedule/renderer/agenda.d.ts +2 -1
  30. package/src/schedule/renderer/agenda.js +1 -1
  31. package/src/schedule/renderer/header-renderer.js +4 -2
  32. package/src/schedule/renderer/month-agenda.d.ts +2 -1
  33. package/src/schedule/renderer/month-agenda.js +2 -2
  34. package/src/schedule/renderer/month.d.ts +4 -3
  35. package/src/schedule/renderer/month.js +16 -9
  36. package/src/schedule/renderer/view-base.d.ts +5 -4
  37. package/src/schedule/renderer/view-base.js +13 -10
  38. package/src/schedule/renderer/year.d.ts +3 -2
  39. package/src/schedule/renderer/year.js +10 -7
  40. package/styles/bds-lite.css +4400 -0
  41. package/styles/bds-lite.scss +18 -0
  42. package/styles/bds.css +5161 -0
  43. package/styles/bds.scss +20 -0
  44. package/styles/bootstrap-dark-lite.css +19 -6
  45. package/styles/bootstrap-dark.css +23 -10
  46. package/styles/bootstrap-lite.css +18 -5
  47. package/styles/bootstrap.css +22 -9
  48. package/styles/bootstrap4-lite.css +18 -5
  49. package/styles/bootstrap4.css +22 -9
  50. package/styles/bootstrap5-dark-lite.css +18 -5
  51. package/styles/bootstrap5-dark.css +23 -10
  52. package/styles/bootstrap5-lite.css +18 -5
  53. package/styles/bootstrap5.3-lite.css +18 -5
  54. package/styles/bootstrap5.3.css +23 -10
  55. package/styles/bootstrap5.css +23 -10
  56. package/styles/fabric-dark-lite.css +18 -5
  57. package/styles/fabric-dark.css +22 -9
  58. package/styles/fabric-lite.css +18 -5
  59. package/styles/fabric.css +22 -9
  60. package/styles/fluent-dark-lite.css +18 -5
  61. package/styles/fluent-dark.css +22 -9
  62. package/styles/fluent-lite.css +18 -5
  63. package/styles/fluent.css +22 -9
  64. package/styles/fluent2-lite.css +43 -6
  65. package/styles/fluent2.css +50 -13
  66. package/styles/highcontrast-light-lite.css +18 -5
  67. package/styles/highcontrast-light.css +22 -9
  68. package/styles/highcontrast-lite.css +19 -6
  69. package/styles/highcontrast.css +23 -10
  70. package/styles/material-dark-lite.css +18 -5
  71. package/styles/material-dark.css +22 -9
  72. package/styles/material-lite.css +18 -5
  73. package/styles/material.css +22 -9
  74. package/styles/material3-dark-lite.css +18 -5
  75. package/styles/material3-dark.css +23 -10
  76. package/styles/material3-lite.css +18 -5
  77. package/styles/material3.css +23 -10
  78. package/styles/recurrence-editor/_bigger.scss +2 -3
  79. package/styles/recurrence-editor/_fluent2-definition.scss +1 -1
  80. package/styles/recurrence-editor/_tailwind3-definition.scss +14 -0
  81. package/styles/recurrence-editor/bds.css +533 -0
  82. package/styles/recurrence-editor/bds.scss +9 -0
  83. package/styles/recurrence-editor/bootstrap-dark.css +2 -3
  84. package/styles/recurrence-editor/bootstrap.css +2 -3
  85. package/styles/recurrence-editor/bootstrap4.css +2 -3
  86. package/styles/recurrence-editor/bootstrap5-dark.css +2 -3
  87. package/styles/recurrence-editor/bootstrap5.3.css +2 -3
  88. package/styles/recurrence-editor/bootstrap5.css +2 -3
  89. package/styles/recurrence-editor/fabric-dark.css +2 -3
  90. package/styles/recurrence-editor/fabric.css +2 -3
  91. package/styles/recurrence-editor/fluent-dark.css +2 -3
  92. package/styles/recurrence-editor/fluent.css +2 -3
  93. package/styles/recurrence-editor/fluent2.css +3 -4
  94. package/styles/recurrence-editor/highcontrast-light.css +2 -3
  95. package/styles/recurrence-editor/highcontrast.css +3 -4
  96. package/styles/recurrence-editor/material-dark.css +2 -3
  97. package/styles/recurrence-editor/material.css +2 -3
  98. package/styles/recurrence-editor/material3-dark.css +2 -3
  99. package/styles/recurrence-editor/material3.css +2 -3
  100. package/styles/recurrence-editor/tailwind-dark.css +2 -3
  101. package/styles/recurrence-editor/tailwind.css +2 -3
  102. package/styles/recurrence-editor/tailwind3.css +500 -0
  103. package/styles/recurrence-editor/tailwind3.scss +9 -0
  104. package/styles/schedule/_bigger.scss +2 -1
  105. package/styles/schedule/_bootstrap5-definition.scss +1 -1
  106. package/styles/schedule/_bootstrap5.3-definition.scss +1 -1
  107. package/styles/schedule/_fluent2-definition.scss +3 -3
  108. package/styles/schedule/_layout.scss +43 -2
  109. package/styles/schedule/_material3-definition.scss +1 -1
  110. package/styles/schedule/_tailwind-definition.scss +1 -1
  111. package/styles/schedule/_tailwind3-definition.scss +276 -0
  112. package/styles/schedule/_theme.scss +0 -4
  113. package/styles/schedule/bds.css +4760 -0
  114. package/styles/schedule/bds.scss +17 -0
  115. package/styles/schedule/bootstrap-dark.css +21 -7
  116. package/styles/schedule/bootstrap.css +20 -6
  117. package/styles/schedule/bootstrap4.css +20 -6
  118. package/styles/schedule/bootstrap5-dark.css +21 -7
  119. package/styles/schedule/bootstrap5.3.css +21 -7
  120. package/styles/schedule/bootstrap5.css +21 -7
  121. package/styles/schedule/fabric-dark.css +20 -6
  122. package/styles/schedule/fabric.css +20 -6
  123. package/styles/schedule/fluent-dark.css +20 -6
  124. package/styles/schedule/fluent.css +20 -6
  125. package/styles/schedule/fluent2.css +47 -9
  126. package/styles/schedule/highcontrast-light.css +20 -6
  127. package/styles/schedule/highcontrast.css +21 -7
  128. package/styles/schedule/icons/_tailwind3.scss +220 -0
  129. package/styles/schedule/material-dark.css +20 -6
  130. package/styles/schedule/material.css +20 -6
  131. package/styles/schedule/material3-dark.css +21 -7
  132. package/styles/schedule/material3.css +21 -7
  133. package/styles/schedule/tailwind-dark.css +21 -7
  134. package/styles/schedule/tailwind.css +21 -7
  135. package/styles/schedule/tailwind3.css +4599 -0
  136. package/styles/schedule/tailwind3.scss +17 -0
  137. package/styles/tailwind-dark-lite.css +18 -5
  138. package/styles/tailwind-dark.css +23 -10
  139. package/styles/tailwind-lite.css +18 -5
  140. package/styles/tailwind.css +23 -10
  141. package/styles/tailwind3-lite.css +4239 -0
  142. package/styles/tailwind3-lite.scss +18 -0
  143. package/styles/tailwind3.css +5000 -0
  144. 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);
@@ -21655,14 +22029,14 @@ class DragAndDrop extends ActionBase {
21655
22029
  this.isPreventMultiDrag = false;
21656
22030
  this.slotsUptoCursor = -1;
21657
22031
  this.eleTop = 0;
22032
+ this.distanceUptoCursor = 0;
21658
22033
  }
21659
22034
  wireDragEvent(element) {
21660
- const isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
21661
22035
  new Draggable(element, {
21662
22036
  abort: '.' + EVENT_RESIZE_CLASS,
21663
22037
  clone: true,
21664
22038
  isDragScroll: true,
21665
- enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
22039
+ enableTailMode: this.parent.eventDragArea ? true : false,
21666
22040
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
21667
22041
  dragArea: this.dragArea,
21668
22042
  dragStart: this.dragStart.bind(this),
@@ -21685,8 +22059,12 @@ class DragAndDrop extends ActionBase {
21685
22059
  }
21686
22060
  this.setDragActionDefaultValues();
21687
22061
  this.actionObj.element = e.element;
21688
- this.eleTop = parseFloat(this.actionObj.element.style.top);
21689
- this.slotsUptoCursor = -1;
22062
+ if (e.sender && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1) {
22063
+ const eventArgs = this.parent.eventBase.getPageCoordinates(e.sender);
22064
+ this.distanceUptoCursor = eventArgs.clientY - this.actionObj.element.getBoundingClientRect().top;
22065
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
22066
+ this.slotsUptoCursor = -1;
22067
+ }
21690
22068
  this.actionObj.action = 'drag';
21691
22069
  let elements = [];
21692
22070
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -21766,11 +22144,11 @@ class DragAndDrop extends ActionBase {
21766
22144
  let top = parseInt(e.top, 10);
21767
22145
  top = top < 0 ? 0 : top;
21768
22146
  if (this.slotsUptoCursor < 0) {
21769
- const cellsCountUptoCursor = Math.floor(top / cellHeight);
22147
+ const cellsCountUptoCursor = Math.floor((this.eleTop + this.distanceUptoCursor) / cellHeight);
21770
22148
  const cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
21771
22149
  this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
21772
22150
  }
21773
- top = (Math.floor((top + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22151
+ top = (Math.floor((top + this.distanceUptoCursor + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
21774
22152
  topValue = formatUnit(top < 0 ? 0 : top);
21775
22153
  const scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
21776
22154
  const cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
@@ -22129,12 +22507,12 @@ class DragAndDrop extends ActionBase {
22129
22507
  if ((dragArea.scrollLeft === 0) &&
22130
22508
  (Math.round(this.actionObj.X) <=
22131
22509
  Math.round(dragArea.getBoundingClientRect().left + this.actionObj.cellWidth + window.pageXOffset))) {
22132
- navigationType = this.parent.enableRtl ? 'next' : 'previous';
22510
+ navigationType = this.parent.enableRtl ? 'Next' : 'Previous';
22133
22511
  }
22134
22512
  else if ((Math.round(dragArea.scrollLeft) + dragArea.clientWidth === dragArea.scrollWidth) &&
22135
22513
  (Math.round(this.actionObj.X) >=
22136
22514
  Math.round(dragArea.getBoundingClientRect().right - this.actionObj.cellWidth + window.pageXOffset))) {
22137
- navigationType = this.parent.enableRtl ? 'previous' : 'next';
22515
+ navigationType = this.parent.enableRtl ? 'Previous' : 'Next';
22138
22516
  }
22139
22517
  if (navigationType) {
22140
22518
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate(navigationType));
@@ -22987,7 +23365,7 @@ class ViewBase {
22987
23365
  * @param {Schedule} parent Accepts the schedule instance
22988
23366
  */
22989
23367
  constructor(parent) {
22990
- this.previousNextAction = 'next';
23368
+ this.previousNextAction = 'Next';
22991
23369
  this.parent = parent;
22992
23370
  }
22993
23371
  isTimelineView() {
@@ -23242,11 +23620,11 @@ class ViewBase {
23242
23620
  return !(getDateInMs(date) < getDateInMs(startHour) || getDateInMs(date) >= getDateInMs(endHour) ||
23243
23621
  !this.isWorkDay(date, workDays));
23244
23622
  }
23245
- getRenderDates(workDays) {
23623
+ getRenderDates(workDays, date = this.parent.selectedDate) {
23246
23624
  const renderDates = [];
23247
23625
  // Due to same code for vertical and time line, week & work week views, if condition has used
23248
23626
  if (this.parent.currentView === 'Week' || this.parent.currentView === 'TimelineWeek') {
23249
- const selectedDate = resetTime(this.parent.selectedDate);
23627
+ const selectedDate = resetTime(date);
23250
23628
  let start = getWeekFirstDate(selectedDate, this.parent.activeViewOptions.firstDayOfWeek);
23251
23629
  for (let i = 0, length = WEEK_LENGTH * this.parent.activeViewOptions.interval; i < length; i++) {
23252
23630
  if (this.parent.activeViewOptions.showWeekend) {
@@ -23261,7 +23639,7 @@ class ViewBase {
23261
23639
  }
23262
23640
  }
23263
23641
  else if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {
23264
- let start = getWeekFirstDate(resetTime(this.parent.selectedDate), this.parent.activeViewOptions.firstDayOfWeek);
23642
+ let start = getWeekFirstDate(resetTime(date), this.parent.activeViewOptions.firstDayOfWeek);
23265
23643
  for (let i = 0, length = WEEK_LENGTH * this.parent.activeViewOptions.interval; i < length; i++) {
23266
23644
  if (this.isWorkDay(start, workDays)) {
23267
23645
  renderDates.push(start);
@@ -23272,7 +23650,7 @@ class ViewBase {
23272
23650
  else {
23273
23651
  const dayCount = this.parent.currentView === 'Agenda' ? this.parent.agendaDaysCount :
23274
23652
  this.parent.activeViewOptions.interval;
23275
- let start = resetTime(this.parent.selectedDate);
23653
+ let start = resetTime(date);
23276
23654
  do {
23277
23655
  if (this.parent.activeViewOptions.showWeekend) {
23278
23656
  renderDates.push(start);
@@ -23298,11 +23676,11 @@ class ViewBase {
23298
23676
  if (this.parent.currentView === 'Day' || this.parent.currentView === 'TimelineDay') {
23299
23677
  if (this.parent.activeViewOptions.showWeekend) {
23300
23678
  const daysCount = this.parent.activeViewOptions.interval;
23301
- return addDays(this.parent.selectedDate, type === 'next' ? daysCount : -daysCount);
23679
+ return addDays(this.parent.selectedDate, type === 'Next' ? daysCount : -daysCount);
23302
23680
  }
23303
23681
  else {
23304
23682
  let date;
23305
- if (type === 'next') {
23683
+ if (type === 'Next') {
23306
23684
  date = addDays(this.renderDates.slice(-1)[0], 1);
23307
23685
  while (!this.isWorkDay(date)) {
23308
23686
  date = addDays(date, 1);
@@ -23323,7 +23701,7 @@ class ViewBase {
23323
23701
  return date;
23324
23702
  }
23325
23703
  }
23326
- const weekLength = type === 'next' ? WEEK_LENGTH : -WEEK_LENGTH;
23704
+ const weekLength = type === 'Next' ? WEEK_LENGTH : -WEEK_LENGTH;
23327
23705
  return addDays(this.parent.selectedDate, weekLength * this.parent.activeViewOptions.interval);
23328
23706
  }
23329
23707
  formatViewLabel(view, startDate, endDate) {
@@ -23350,12 +23728,12 @@ class ViewBase {
23350
23728
  }
23351
23729
  }
23352
23730
  }
23353
- getDateRangeText() {
23731
+ getDateRangeText(date = this.renderDates[0], dateCollection = this.renderDates) {
23354
23732
  if (this.parent.isAdaptive) {
23355
23733
  const formatDate = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
23356
23734
  return capitalizeFirstWord(this.parent.globalize.formatDate(this.parent.selectedDate, { format: formatDate, calendar: this.parent.getCalendarMode() }), 'single');
23357
23735
  }
23358
- return this.formatDateRange(this.renderDates[0], this.renderDates[this.renderDates.length - 1]);
23736
+ return this.formatDateRange(date, dateCollection[dateCollection.length - 1]);
23359
23737
  }
23360
23738
  formatDateRange(startDate, endDate) {
23361
23739
  const globalize = this.parent.globalize;
@@ -25111,9 +25489,9 @@ class Month extends ViewBase {
25111
25489
  }
25112
25490
  return false;
25113
25491
  }
25114
- getRenderDates(workDays) {
25492
+ getRenderDates(workDays, selectedDate = this.parent.selectedDate) {
25115
25493
  const renderDates = [];
25116
- const currentDate = resetTime(this.parent.selectedDate);
25494
+ const currentDate = resetTime(selectedDate);
25117
25495
  let start = this.getMonthStart(currentDate);
25118
25496
  const monthEnd = this.getMonthEnd(currentDate);
25119
25497
  do {
@@ -25141,13 +25519,13 @@ class Month extends ViewBase {
25141
25519
  getNextPreviousDate(type) {
25142
25520
  if (this.isCustomMonth()) {
25143
25521
  const dates = this.parent.getCurrentViewDates();
25144
- const date = getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
25522
+ const date = getWeekFirstDate(type === 'Next' ? dates[dates.length - 1]
25145
25523
  : dates[0], this.parent.activeViewOptions.firstDayOfWeek);
25146
- return addDays(date, type === 'next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
25524
+ return addDays(date, type === 'Next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
25147
25525
  this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS) * WEEK_LENGTH);
25148
25526
  }
25149
25527
  else {
25150
- return addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
25528
+ return addMonths(this.parent.selectedDate, ((type === 'Next' ? 1 : -1) * this.parent.activeViewOptions.interval));
25151
25529
  }
25152
25530
  }
25153
25531
  getStartDate() {
@@ -25159,13 +25537,16 @@ class Month extends ViewBase {
25159
25537
  getEndDateFromStartDate(start) {
25160
25538
  return addDays(new Date(start.getTime()), 1);
25161
25539
  }
25162
- getDateRangeText() {
25540
+ getDateRangeText(startDate = this.parent.selectedDate, dateCollection = null) {
25163
25541
  if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
25164
- let startDate = this.parent.selectedDate;
25542
+ const maxNumberOfDaysPerWeek = 7;
25543
+ startDate = !isNullOrUndefined(dateCollection) && dateCollection.length > maxNumberOfDaysPerWeek - 1
25544
+ ? dateCollection[maxNumberOfDaysPerWeek - 1] : startDate;
25165
25545
  let endDate;
25166
25546
  let updateCustomRange = false;
25167
25547
  if (this.isCustomMonth()) {
25168
- const dates = this.parent.getCurrentViewDates();
25548
+ const dates = !isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection :
25549
+ this.parent.getCurrentViewDates();
25169
25550
  updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
25170
25551
  dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
25171
25552
  if (updateCustomRange) {
@@ -25191,7 +25572,8 @@ class Month extends ViewBase {
25191
25572
  const format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
25192
25573
  return capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
25193
25574
  }
25194
- return this.formatDateRange(this.parent.selectedDate);
25575
+ return this.formatDateRange(!isNullOrUndefined(dateCollection) && dateCollection.length > 0 ? dateCollection[0] :
25576
+ this.parent.selectedDate);
25195
25577
  }
25196
25578
  getLabelText(view) {
25197
25579
  const viewStr = view.charAt(0).toLowerCase() + view.substring(1);
@@ -25505,7 +25887,7 @@ class Year extends ViewBase {
25505
25887
  this.parent.activeCellsData = this.parent.getCellDetails(target);
25506
25888
  const isPrevious = startDate.getTime() < this.getStartDate().getTime();
25507
25889
  if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
25508
- this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
25890
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'Previous' : 'Next'), e);
25509
25891
  const activeDate = this.parent.activeCellsData.startTime.getTime();
25510
25892
  const inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
25511
25893
  const dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
@@ -25608,16 +25990,17 @@ class Year extends ViewBase {
25608
25990
  return addDays(new Date(date.getTime()), 1);
25609
25991
  }
25610
25992
  getNextPreviousDate(type) {
25611
- return addYears(this.parent.selectedDate, ((type === 'next') ? 1 : -1));
25993
+ return addYears(this.parent.selectedDate, ((type === 'Next') ? 1 : -1));
25612
25994
  }
25613
- getDateRangeText() {
25614
- const startDate = this.getStartDate();
25615
- const endDate = this.getEndDate();
25995
+ getDateRangeText(date = this.parent.selectedDate, dateCollection = null) {
25996
+ const isDateColAvail = !isNullOrUndefined(dateCollection) && dateCollection.length > 0;
25997
+ const startDate = isDateColAvail ? dateCollection[0] : this.getStartDate();
25998
+ const endDate = isDateColAvail ? dateCollection[dateCollection.length - 1] : this.getEndDate();
25616
25999
  if (startDate.getFullYear() !== endDate.getFullYear()) {
25617
26000
  return this.parent.globalize.formatDate(startDate, { skeleton: 'yMMM' }) + ' - ' + this.parent.globalize.formatDate(endDate, { skeleton: 'yMMM' });
25618
26001
  }
25619
26002
  else {
25620
- return this.parent.globalize.formatDate(this.parent.selectedDate, { skeleton: 'y' });
26003
+ return this.parent.globalize.formatDate(isDateColAvail ? dateCollection[0] : date, { skeleton: 'y' });
25621
26004
  }
25622
26005
  }
25623
26006
  addEventListener() {
@@ -26445,7 +26828,7 @@ class Agenda extends AgendaBase {
26445
26828
  return resetTime(addDays(filterDate, 1));
26446
26829
  }
26447
26830
  getNextPreviousDate(type) {
26448
- const noOfDays = (type === 'next') ? 1 : -1;
26831
+ const noOfDays = (type === 'Next') ? 1 : -1;
26449
26832
  return addDays(this.parent.selectedDate, noOfDays);
26450
26833
  }
26451
26834
  startDate() {
@@ -26684,9 +27067,9 @@ class MonthAgenda extends Month {
26684
27067
  }
26685
27068
  getNextPreviousDate(type) {
26686
27069
  const selectedDate = this.parent.selectedDate;
26687
- const interval = (type === 'next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
27070
+ const interval = (type === 'Next') ? this.parent.activeViewOptions.interval : -this.parent.activeViewOptions.interval;
26688
27071
  const navigateDate = addMonths(this.parent.selectedDate, interval);
26689
- const month = (type === 'next') ? 2 : 0;
27072
+ const month = (type === 'Next') ? 2 : 0;
26690
27073
  const lastDate = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + month, 0).getDate();
26691
27074
  const date = (lastDate >= this.monthAgendaDate.getDate()) ? this.monthAgendaDate.getDate() : lastDate;
26692
27075
  this.monthAgendaDate = new Date(navigateDate.getFullYear(), navigateDate.getMonth(), date);
@@ -28347,5 +28730,5 @@ class Print {
28347
28730
  }
28348
28731
  }
28349
28732
 
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 };
28733
+ 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
28734
  //# sourceMappingURL=ej2-schedule.es2015.js.map