@syncfusion/ej2-schedule 19.3.48 → 19.4.40

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 (124) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +63 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +39 -0
  3. package/CHANGELOG.md +47 -10
  4. package/dist/ej2-schedule.umd.min.js +2 -2
  5. package/dist/ej2-schedule.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-schedule.es2015.js +457 -120
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +460 -126
  9. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  10. package/dist/global/ej2-schedule.min.js +2 -2
  11. package/dist/global/ej2-schedule.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +15 -15
  14. package/src/recurrence-editor/date-generator.js +3 -3
  15. package/src/recurrence-editor/recurrence-editor.js +2 -2
  16. package/src/schedule/actions/drag.js +14 -5
  17. package/src/schedule/actions/keyboard.d.ts +7 -0
  18. package/src/schedule/actions/keyboard.js +197 -28
  19. package/src/schedule/base/interface.d.ts +19 -0
  20. package/src/schedule/base/resource.js +1 -0
  21. package/src/schedule/base/schedule-model.d.ts +97 -20
  22. package/src/schedule/base/schedule.d.ts +96 -20
  23. package/src/schedule/base/schedule.js +27 -6
  24. package/src/schedule/base/util.d.ts +1 -0
  25. package/src/schedule/base/util.js +1 -0
  26. package/src/schedule/event-renderer/event-base.d.ts +2 -1
  27. package/src/schedule/event-renderer/event-base.js +20 -5
  28. package/src/schedule/event-renderer/inline-edit.js +8 -5
  29. package/src/schedule/event-renderer/month.js +1 -1
  30. package/src/schedule/event-renderer/timeline-view.js +4 -0
  31. package/src/schedule/event-renderer/vertical-view.js +9 -6
  32. package/src/schedule/event-renderer/year.js +1 -1
  33. package/src/schedule/exports/excel-export.d.ts +2 -1
  34. package/src/schedule/exports/excel-export.js +21 -18
  35. package/src/schedule/models/event-settings-model.d.ts +17 -9
  36. package/src/schedule/models/event-settings.d.ts +15 -8
  37. package/src/schedule/models/event-settings.js +6 -3
  38. package/src/schedule/models/views-model.d.ts +19 -0
  39. package/src/schedule/models/views.d.ts +17 -0
  40. package/src/schedule/models/views.js +6 -0
  41. package/src/schedule/popups/event-window.d.ts +0 -1
  42. package/src/schedule/popups/event-window.js +4 -5
  43. package/src/schedule/popups/form-validator.js +1 -1
  44. package/src/schedule/popups/quick-popups.js +3 -0
  45. package/src/schedule/renderer/agenda.js +2 -1
  46. package/src/schedule/renderer/header-renderer.d.ts +1 -0
  47. package/src/schedule/renderer/header-renderer.js +23 -8
  48. package/src/schedule/renderer/month.d.ts +4 -0
  49. package/src/schedule/renderer/month.js +69 -19
  50. package/src/schedule/renderer/renderer.js +6 -1
  51. package/src/schedule/renderer/timeline-year.js +4 -1
  52. package/src/schedule/renderer/view-base.js +9 -0
  53. package/src/schedule/renderer/year.d.ts +2 -2
  54. package/src/schedule/renderer/year.js +24 -6
  55. package/src/schedule/timezone/timezone.d.ts +3 -2
  56. package/src/schedule/timezone/timezone.js +0 -1
  57. package/styles/bootstrap-dark.css +108 -27
  58. package/styles/bootstrap.css +105 -27
  59. package/styles/bootstrap4.css +117 -62
  60. package/styles/bootstrap5-dark.css +118 -67
  61. package/styles/bootstrap5.css +118 -67
  62. package/styles/fabric-dark.css +108 -26
  63. package/styles/fabric.css +109 -26
  64. package/styles/highcontrast-light.css +104 -26
  65. package/styles/highcontrast.css +109 -28
  66. package/styles/material-dark.css +110 -32
  67. package/styles/material.css +103 -25
  68. package/styles/recurrence-editor/_bootstrap-dark-definition.scss +7 -0
  69. package/styles/recurrence-editor/_bootstrap-definition.scss +7 -0
  70. package/styles/recurrence-editor/_bootstrap4-definition.scss +7 -0
  71. package/styles/recurrence-editor/_bootstrap5-definition.scss +7 -0
  72. package/styles/recurrence-editor/_fabric-dark-definition.scss +8 -0
  73. package/styles/recurrence-editor/_fabric-definition.scss +7 -0
  74. package/styles/recurrence-editor/_fluent-definition.scss +15 -0
  75. package/styles/recurrence-editor/_highcontrast-definition.scss +7 -0
  76. package/styles/recurrence-editor/_highcontrast-light-definition.scss +7 -0
  77. package/styles/recurrence-editor/_layout.scss +20 -4
  78. package/styles/recurrence-editor/_material-dark-definition.scss +7 -0
  79. package/styles/recurrence-editor/_material-definition.scss +7 -0
  80. package/styles/recurrence-editor/_tailwind-definition.scss +15 -8
  81. package/styles/recurrence-editor/bootstrap-dark.css +20 -4
  82. package/styles/recurrence-editor/bootstrap.css +20 -4
  83. package/styles/recurrence-editor/bootstrap4.css +20 -4
  84. package/styles/recurrence-editor/bootstrap5-dark.css +20 -4
  85. package/styles/recurrence-editor/bootstrap5.css +20 -4
  86. package/styles/recurrence-editor/fabric-dark.css +20 -4
  87. package/styles/recurrence-editor/fabric.css +20 -4
  88. package/styles/recurrence-editor/highcontrast-light.css +20 -4
  89. package/styles/recurrence-editor/highcontrast.css +20 -4
  90. package/styles/recurrence-editor/material-dark.css +20 -4
  91. package/styles/recurrence-editor/material.css +20 -4
  92. package/styles/recurrence-editor/tailwind-dark.css +20 -4
  93. package/styles/recurrence-editor/tailwind.css +20 -4
  94. package/styles/schedule/_bootstrap-dark-definition.scss +22 -1
  95. package/styles/schedule/_bootstrap-definition.scss +22 -1
  96. package/styles/schedule/_bootstrap4-definition.scss +23 -1
  97. package/styles/schedule/_bootstrap5-definition.scss +145 -119
  98. package/styles/schedule/_fabric-dark-definition.scss +22 -1
  99. package/styles/schedule/_fabric-definition.scss +22 -1
  100. package/styles/schedule/_fluent-definition.scss +218 -0
  101. package/styles/schedule/_highcontrast-definition.scss +22 -1
  102. package/styles/schedule/_highcontrast-light-definition.scss +22 -1
  103. package/styles/schedule/_layout.scss +95 -158
  104. package/styles/schedule/_material-dark-definition.scss +22 -1
  105. package/styles/schedule/_material-definition.scss +21 -0
  106. package/styles/schedule/_tailwind-definition.scss +216 -195
  107. package/styles/schedule/_theme.scss +1 -1
  108. package/styles/schedule/bootstrap-dark.css +88 -23
  109. package/styles/schedule/bootstrap.css +85 -23
  110. package/styles/schedule/bootstrap4.css +97 -58
  111. package/styles/schedule/bootstrap5-dark.css +98 -63
  112. package/styles/schedule/bootstrap5.css +98 -63
  113. package/styles/schedule/fabric-dark.css +88 -22
  114. package/styles/schedule/fabric.css +89 -22
  115. package/styles/schedule/highcontrast-light.css +84 -22
  116. package/styles/schedule/highcontrast.css +89 -24
  117. package/styles/schedule/icons/_fluent.scss +231 -0
  118. package/styles/schedule/icons/_tailwind.scss +231 -231
  119. package/styles/schedule/material-dark.css +90 -28
  120. package/styles/schedule/material.css +83 -21
  121. package/styles/schedule/tailwind-dark.css +94 -52
  122. package/styles/schedule/tailwind.css +94 -52
  123. package/styles/tailwind-dark.css +114 -56
  124. package/styles/tailwind.css +114 -56
@@ -91,6 +91,7 @@ const cellMouseDown = 'cell-mouse-down';
91
91
  * Schedule common utilities
92
92
  */
93
93
  const WEEK_LENGTH = 7;
94
+ const DEFAULT_WEEKS = 6;
94
95
  const MS_PER_DAY = 86400000;
95
96
  const MS_PER_MINUTE = 60000;
96
97
  /**
@@ -1243,8 +1244,10 @@ class HeaderRenderer {
1243
1244
  enableRtl: this.parent.enableRtl
1244
1245
  });
1245
1246
  const calendarView = this.getCalendarView();
1247
+ const isDisplayDate = this.parent.currentView === 'Month' &&
1248
+ !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && !this.hasSelectedDate();
1246
1249
  this.headerCalendar = new Calendar({
1247
- value: this.parent.selectedDate,
1250
+ value: isDisplayDate ? this.parent.activeViewOptions.displayDate : this.parent.selectedDate,
1248
1251
  min: this.parent.minDate,
1249
1252
  max: this.parent.maxDate,
1250
1253
  firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
@@ -1283,6 +1286,7 @@ class HeaderRenderer {
1283
1286
  const strClass = args.item.cssClass.replace('e-views ', '');
1284
1287
  let data;
1285
1288
  let isSameTime;
1289
+ let currentTime;
1286
1290
  switch (strClass) {
1287
1291
  case 'e-date-range':
1288
1292
  if (!this.headerPopup) {
@@ -1332,8 +1336,13 @@ class HeaderRenderer {
1332
1336
  this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
1333
1337
  break;
1334
1338
  case 'e-today':
1335
- if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(resetTime(this.parent.getCurrentTime()))) {
1336
- this.parent.changeDate(resetTime(this.parent.getCurrentTime()), args.originalEvent);
1339
+ currentTime = resetTime(this.parent.getCurrentTime());
1340
+ if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(currentTime) ||
1341
+ this.parent.currentView === 'Month' && this.parent.activeViewOptions.displayDate && !this.hasSelectedDate() &&
1342
+ resetTime(this.parent.activeViewOptions.displayDate) !== currentTime || this.parent.currentView === 'Month' &&
1343
+ this.parent.activeViewOptions.numberOfWeeks > 0 && !this.hasSelectedDate()
1344
+ && resetTime(firstDateOfMonth(this.parent.selectedDate)) !== currentTime) {
1345
+ this.parent.changeDate(currentTime, args.originalEvent);
1337
1346
  }
1338
1347
  break;
1339
1348
  case 'e-prev':
@@ -1368,6 +1377,11 @@ class HeaderRenderer {
1368
1377
  toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
1369
1378
  }
1370
1379
  }
1380
+ hasSelectedDate() {
1381
+ const selectedTime = resetTime(this.parent.selectedDate).getTime();
1382
+ return selectedTime >= this.parent.activeView.getStartDate().getTime() &&
1383
+ selectedTime <= this.parent.activeView.getEndDate().getTime();
1384
+ }
1371
1385
  getHeaderElement() {
1372
1386
  return this.toolbarObj.element;
1373
1387
  }
@@ -1412,9 +1426,11 @@ class HeaderRenderer {
1412
1426
  lastDate = addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
1413
1427
  }
1414
1428
  if (this.parent.currentView === 'Month') {
1415
- firstDate = firstDateOfMonth(this.parent.selectedDate);
1416
- const lastMonthFirstDate = addMonths(firstDate, this.parent.activeViewOptions.interval - 1);
1417
- lastDate = lastDateOfMonth(lastMonthFirstDate);
1429
+ const isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
1430
+ this.parent.activeViewOptions.numberOfWeeks > 0;
1431
+ firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : firstDateOfMonth(this.parent.selectedDate);
1432
+ lastDate = isCustomMonth ? this.parent.activeView.getEndDate() :
1433
+ lastDateOfMonth(addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
1418
1434
  }
1419
1435
  if (!isNullOrUndefined(prevNavEle)) {
1420
1436
  this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
@@ -1945,6 +1961,9 @@ class KeyboardInteraction {
1945
1961
  }
1946
1962
  const queryStr = '.' + WORK_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS + ',.' + HEADER_CELLS_CLASS;
1947
1963
  const target = closest(e.target, queryStr);
1964
+ if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
1965
+ return;
1966
+ }
1948
1967
  this.parent.activeCellsData = this.getSelectedElements(target);
1949
1968
  const cellData = {};
1950
1969
  if (this.parent.eventWindow) {
@@ -1968,6 +1987,9 @@ class KeyboardInteraction {
1968
1987
  || this.isPreventAction(e)) {
1969
1988
  return;
1970
1989
  }
1990
+ if (this.parent.currentView === 'TimelineYear' && e.target.classList.contains(OTHERMONTH_CLASS)) {
1991
+ return;
1992
+ }
1971
1993
  const target = e.target;
1972
1994
  if (closest(target, '.' + POPUP_WRAPPER_CLASS)) {
1973
1995
  if (target.classList.contains(QUICK_POPUP_EVENT_DETAILS_CLASS) ||
@@ -2002,11 +2024,16 @@ class KeyboardInteraction {
2002
2024
  this.parent.notify(inlineClick, inlineArgs);
2003
2025
  }
2004
2026
  else {
2005
- this.parent.notify(cellClick, args);
2027
+ if (this.parent.currentView === 'Year') {
2028
+ target.click();
2029
+ }
2030
+ else {
2031
+ this.parent.notify(cellClick, args);
2032
+ }
2006
2033
  }
2007
2034
  return;
2008
2035
  }
2009
- if (target.classList.contains(INLINE_SUBJECT_CLASS)) {
2036
+ if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
2010
2037
  this.parent.inlineModule.inlineCrudActions(target);
2011
2038
  return;
2012
2039
  }
@@ -2038,7 +2065,9 @@ class KeyboardInteraction {
2038
2065
  }
2039
2066
  getCells(isInverseTable, start, end) {
2040
2067
  const tableEle = this.parent.getContentTable();
2041
- let cells = [].slice.call(tableEle.querySelectorAll('td'));
2068
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2069
+ const query = isTimelineYear && !isInverseTable ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' : 'td';
2070
+ let cells = [].slice.call(tableEle.querySelectorAll(query));
2042
2071
  let maxRow = tableEle.rows.length;
2043
2072
  let maxColumn = tableEle.rows[0].cells.length;
2044
2073
  if (start && start.classList.contains(ALLDAY_CELLS_CLASS)) {
@@ -2053,7 +2082,11 @@ class KeyboardInteraction {
2053
2082
  if (isInverseTable) {
2054
2083
  for (let i = 0; i < maxColumn; i++) {
2055
2084
  for (let j = 0; j < maxRow; j++) {
2056
- inverseCells.push(cells[maxColumn * j + i]);
2085
+ const cell = cells[maxColumn * j + i];
2086
+ if (isTimelineYear && cell.classList.contains(OTHERMONTH_CLASS)) {
2087
+ continue;
2088
+ }
2089
+ inverseCells.push(cell);
2057
2090
  }
2058
2091
  }
2059
2092
  startIndex = inverseCells.indexOf(start);
@@ -2075,11 +2108,17 @@ class KeyboardInteraction {
2075
2108
  return;
2076
2109
  }
2077
2110
  this.parent.eventBase.removeSelectedAppointmentClass();
2078
- if (this.parent.activeView.isTimelineView()) {
2111
+ if (this.parent.activeView.isTimelineView() && this.parent.currentView !== 'TimelineYear') {
2079
2112
  const cell = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS +
2080
2113
  ' tr:not(.' + HIDDEN_CLASS + ') .' + WORK_CELLS_CLASS + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')');
2081
2114
  this.selectCells(false, cell);
2082
2115
  }
2116
+ else if (this.parent.currentView.indexOf('Year') > -1) {
2117
+ let query = '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')';
2118
+ const isVerticalYear = this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical';
2119
+ query += isVerticalYear ? '[data-date="' + this.parent.activeView.startDate().getTime() + '"]' : '';
2120
+ this.selectCells(false, this.parent.element.querySelector(query));
2121
+ }
2083
2122
  else {
2084
2123
  this.selectCells(false, this.parent.getWorkCellElements()[0]);
2085
2124
  }
@@ -2100,13 +2139,21 @@ class KeyboardInteraction {
2100
2139
  let target = (targetCell instanceof Array) ? targetCell.slice(-1)[0] : targetCell;
2101
2140
  if (isMultiple) {
2102
2141
  let initialId;
2103
- const views = ['Day', 'Week', 'WorkWeek', 'Month', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'];
2142
+ const views = ['Day', 'Week', 'WorkWeek', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth', 'TimelineYear'];
2104
2143
  const args = { element: targetCell, requestType: 'mousemove', allowMultipleRow: true };
2105
2144
  this.parent.inlineModule.removeInlineAppointmentElement();
2106
2145
  this.parent.trigger(select, args, (selectArgs) => {
2107
2146
  const allowMultipleRow = (!selectArgs.allowMultipleRow) || (!this.parent.allowMultiRowSelection);
2108
- if (allowMultipleRow && (views.indexOf(this.parent.currentView) > -1)) {
2109
- target = target.parentElement.children[this.initialTarget.cellIndex];
2147
+ if (allowMultipleRow) {
2148
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2149
+ if (isTimelineYear && this.parent.activeViewOptions.orientation === 'Horizontal' || this.parent.currentView === 'Month') {
2150
+ const isGroupYear = isTimelineYear && this.parent.activeViewOptions.group.resources.length > 0;
2151
+ target = isGroupYear ? this.initialTarget :
2152
+ this.initialTarget.parentElement.children[target.cellIndex];
2153
+ }
2154
+ else if (views.indexOf(this.parent.currentView) > -1) {
2155
+ target = target.parentElement.children[this.initialTarget.cellIndex];
2156
+ }
2110
2157
  }
2111
2158
  let selectedCells = this.getCells(this.isInverseTableSelect(), this.initialTarget, target);
2112
2159
  if (this.parent.activeViewOptions.group.resources.length > 0) {
@@ -2239,8 +2286,20 @@ class KeyboardInteraction {
2239
2286
  }
2240
2287
  }
2241
2288
  }
2289
+ cancelUpDownAction(isTimelineYear) {
2290
+ const isVerticalYear = isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical';
2291
+ const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
2292
+ if (isVerticalYear && isGroup || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS)) {
2293
+ return true;
2294
+ }
2295
+ if (this.parent.activeView.isTimelineView() && !isTimelineYear || this.parent.currentView === 'MonthAgenda') {
2296
+ return true;
2297
+ }
2298
+ return false;
2299
+ }
2242
2300
  processUp(e, isMultiple) {
2243
- if ((isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda'))) {
2301
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2302
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2244
2303
  return;
2245
2304
  }
2246
2305
  let target = (e.target);
@@ -2263,8 +2322,22 @@ class KeyboardInteraction {
2263
2322
  if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
2264
2323
  const tableRows = this.parent.getTableRows();
2265
2324
  const curRowIndex = tableRows.indexOf(target.parentElement);
2266
- if (curRowIndex > 0 && curRowIndex < tableRows.length) {
2267
- this.selectCells(isMultiple, (tableRows[curRowIndex - 1]).cells[target.cellIndex]);
2325
+ let targetCell;
2326
+ if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
2327
+ targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, true) :
2328
+ this.getHorizontalUpDownCell(tableRows, target, curRowIndex, true);
2329
+ }
2330
+ if ((curRowIndex > 0 || targetCell) && curRowIndex < tableRows.length) {
2331
+ targetCell = targetCell ? targetCell : (tableRows[curRowIndex - 1]).cells[target.cellIndex];
2332
+ if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2333
+ if (this.parent.activeView.getStartDate().getTime() < +targetCell.getAttribute('data-date')) {
2334
+ targetCell = this.getYearUpDownCell(tableRows, curRowIndex - 1, target.cellIndex, true);
2335
+ }
2336
+ else {
2337
+ return;
2338
+ }
2339
+ }
2340
+ this.selectCells(isMultiple, targetCell);
2268
2341
  }
2269
2342
  }
2270
2343
  else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
@@ -2272,7 +2345,8 @@ class KeyboardInteraction {
2272
2345
  }
2273
2346
  }
2274
2347
  processDown(e, isMultiple) {
2275
- if (isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda')) {
2348
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2349
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2276
2350
  return;
2277
2351
  }
2278
2352
  let target = (e.target);
@@ -2295,16 +2369,62 @@ class KeyboardInteraction {
2295
2369
  }
2296
2370
  if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
2297
2371
  const curRowIndex = tableRows.indexOf(target.parentElement);
2298
- if (curRowIndex >= 0 && curRowIndex < tableRows.length - 1) {
2299
- this.selectCells(isMultiple, (tableRows[curRowIndex + 1]).cells[target.cellIndex]);
2372
+ let targetCell;
2373
+ if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
2374
+ targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, false)
2375
+ : this.getHorizontalUpDownCell(tableRows, target, curRowIndex, false);
2376
+ }
2377
+ if (curRowIndex >= 0 && ((curRowIndex < tableRows.length - 1) || targetCell)) {
2378
+ targetCell = targetCell ? targetCell : (tableRows[curRowIndex + 1]).cells[target.cellIndex];
2379
+ if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2380
+ if (this.parent.activeView.getEndDate().getTime() > +targetCell.getAttribute('data-date')) {
2381
+ targetCell = this.getYearUpDownCell(tableRows, curRowIndex + 1, target.cellIndex, false);
2382
+ }
2383
+ else {
2384
+ return;
2385
+ }
2386
+ }
2387
+ this.selectCells(isMultiple, targetCell);
2300
2388
  }
2301
2389
  }
2302
2390
  else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
2303
2391
  this.selectAppointment(false, target);
2304
2392
  }
2305
2393
  }
2394
+ getYearUpDownCell(tableRows, rowIndex, cellIndex, isUp) {
2395
+ while (tableRows[rowIndex] && tableRows[rowIndex].cells[cellIndex].classList.contains(OTHERMONTH_CLASS)) {
2396
+ rowIndex = rowIndex + (isUp ? -1 : 1);
2397
+ }
2398
+ return tableRows[rowIndex].cells[cellIndex];
2399
+ }
2400
+ // eslint-disable-next-line max-len
2401
+ getHorizontalUpDownCell(tableRows, target, curRowIndex, isUp) {
2402
+ const row = tableRows[curRowIndex + (isUp ? -1 : 1)];
2403
+ let cell = row ? row.cells[target.cellIndex] : target;
2404
+ if (cell.classList.contains(OTHERMONTH_CLASS)) {
2405
+ const workCell = row.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
2406
+ const date = new Date(+workCell.getAttribute('data-date'));
2407
+ const query = '[data-date="' + new Date(date.getFullYear(), date.getMonth() + 1, 0).getTime() + '"]';
2408
+ cell = cell.cellIndex < workCell.cellIndex ? workCell : row.querySelector(query);
2409
+ }
2410
+ return cell;
2411
+ }
2412
+ // eslint-disable-next-line max-len
2413
+ getVerticalUpDownCell(tableRows, target, curRowIndex, isUp) {
2414
+ const hasRow = isUp && curRowIndex > 0 || !isUp && curRowIndex < tableRows.length - 1;
2415
+ let targetCell = hasRow ? tableRows[curRowIndex + (isUp ? -1 : 1)].cells[target.cellIndex] : undefined;
2416
+ if (!targetCell || targetCell.classList.contains(OTHERMONTH_CLASS)) {
2417
+ const column = tableRows[curRowIndex].cells[target.cellIndex - (isUp ? 1 : -1)];
2418
+ if (column) {
2419
+ const dateAttr = +target.getAttribute('data-date') - (isUp ? MS_PER_DAY : -MS_PER_DAY);
2420
+ return this.parent.getContentTable().querySelector('.' + WORK_CELLS_CLASS + '[data-date="' + dateAttr + '"]');
2421
+ }
2422
+ targetCell = target;
2423
+ }
2424
+ return targetCell;
2425
+ }
2306
2426
  processLeftRight(target) {
2307
- const tableEle = this.parent.getContentTable();
2427
+ const tableEle = (this.parent.currentView === 'Year' ? target.closest('tbody') : this.parent.getContentTable());
2308
2428
  const curRowIndex = target.parentNode.sectionRowIndex;
2309
2429
  const key = {
2310
2430
  element: tableEle,
@@ -2317,8 +2437,9 @@ class KeyboardInteraction {
2317
2437
  getQuickPopupElement() {
2318
2438
  return (this.parent.isAdaptive ? document.body : this.parent.element).querySelector('.' + POPUP_WRAPPER_CLASS);
2319
2439
  }
2320
- isCancelLeftRightAction(e, isMultiple) {
2321
- if (this.parent.currentView === 'Agenda' || (isMultiple && this.parent.currentView === 'MonthAgenda')) {
2440
+ isCancelLeftRightAction(e, isMultiple, isTimelineYear) {
2441
+ const prevent = this.parent.currentView === 'MonthAgenda' || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS);
2442
+ if (this.parent.currentView === 'Agenda' || (isMultiple && prevent)) {
2322
2443
  return true;
2323
2444
  }
2324
2445
  if (this.isPreventAction(e) && isMultiple) {
@@ -2332,7 +2453,8 @@ class KeyboardInteraction {
2332
2453
  return false;
2333
2454
  }
2334
2455
  processRight(e, isMultiple) {
2335
- if (this.isCancelLeftRightAction(e, isMultiple)) {
2456
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2457
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2336
2458
  return;
2337
2459
  }
2338
2460
  const selectedCells = this.parent.getSelectedElements();
@@ -2353,24 +2475,36 @@ class KeyboardInteraction {
2353
2475
  if (target.classList.contains(WORK_CELLS_CLASS) &&
2354
2476
  (e.target).classList.contains(WORK_CELLS_CLASS)) {
2355
2477
  const key = this.processLeftRight(target);
2356
- if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1) {
2478
+ const targetDate = new Date(+target.getAttribute('data-date'));
2479
+ const isMonthEnd = this.parent.currentView === 'Year' && targetDate.getTime() === lastDateOfMonth(targetDate).getTime();
2480
+ if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1 && !isMonthEnd) {
2357
2481
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex + 1], 'right');
2482
+ if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2483
+ targetCell = this.getTimelineYearTargetCell(key, target, true);
2484
+ }
2358
2485
  if (!isNullOrUndefined(targetCell)) {
2359
2486
  this.selectCells(isMultiple, targetCell);
2360
2487
  }
2361
2488
  }
2362
- else if (key.columnIndex === key.maxIndex - 1) {
2363
- if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1) {
2489
+ else if (key.columnIndex === key.maxIndex - 1 || isMonthEnd) {
2490
+ if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1 && !isMonthEnd) {
2364
2491
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex + 1].cells[0], 'right');
2492
+ const changeTargetCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
2493
+ targetCell = changeTargetCell ? this.getHorizontalLeftRightCell(key, target, true) : targetCell;
2365
2494
  if (!isNullOrUndefined(targetCell)) {
2366
2495
  this.selectCells(isMultiple, targetCell);
2367
2496
  }
2368
2497
  }
2369
2498
  else if (!isMultiple) {
2499
+ if (isMonthEnd && targetDate.getTime() !== this.parent.activeView.getEndDate().getTime()) {
2500
+ this.selectCells(isMultiple, this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + (targetDate.getTime() + MS_PER_DAY) + '"]'));
2501
+ return;
2502
+ }
2370
2503
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
2371
2504
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2372
2505
  const tableEle = this.parent.getContentTable();
2373
- this.selectCells(false, tableEle.rows[rowIndex].cells[0]);
2506
+ const cell = isMonthEnd ? tableEle.rows[rowIndex].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')') : tableEle.rows[rowIndex].cells[0];
2507
+ this.selectCells(false, cell);
2374
2508
  }
2375
2509
  }
2376
2510
  }
@@ -2389,7 +2523,8 @@ class KeyboardInteraction {
2389
2523
  }
2390
2524
  }
2391
2525
  processLeft(e, isMultiple) {
2392
- if (this.isCancelLeftRightAction(e, isMultiple)) {
2526
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2527
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2393
2528
  return;
2394
2529
  }
2395
2530
  let target = (e.target);
@@ -2410,24 +2545,40 @@ class KeyboardInteraction {
2410
2545
  if ((e.target).classList.contains(WORK_CELLS_CLASS) &&
2411
2546
  target.classList.contains(WORK_CELLS_CLASS)) {
2412
2547
  const key = this.processLeftRight(target);
2413
- if (key.columnIndex > 0 && key.columnIndex < key.maxIndex) {
2548
+ const targetDate = new Date(+target.getAttribute('data-date'));
2549
+ const isMonthStart = this.parent.currentView === 'Year' && targetDate.getTime() === firstDateOfMonth(targetDate).getTime();
2550
+ if (key.columnIndex > 0 && key.columnIndex < key.maxIndex && !isMonthStart) {
2414
2551
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex - 1], 'left');
2552
+ if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2553
+ targetCell = this.getTimelineYearTargetCell(key, target, false);
2554
+ }
2415
2555
  if (!isNullOrUndefined(targetCell)) {
2416
2556
  this.selectCells(isMultiple, targetCell);
2417
2557
  }
2418
2558
  }
2419
- else if (key.columnIndex === 0) {
2559
+ else if (key.columnIndex === 0 || isMonthStart) {
2420
2560
  if (!this.isInverseTableSelect() && key.rowIndex > 0) {
2421
2561
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex - 1].cells[key.maxIndex - 1], 'left');
2562
+ const otherMonthCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
2563
+ targetCell = otherMonthCell ? this.getHorizontalLeftRightCell(key, target, false) : targetCell;
2422
2564
  if (!isNullOrUndefined(targetCell)) {
2423
2565
  this.selectCells(isMultiple, targetCell);
2424
2566
  }
2425
2567
  }
2426
2568
  else if (!isMultiple) {
2569
+ if (isMonthStart && targetDate.getTime() !== this.parent.activeView.getStartDate().getTime()) {
2570
+ this.selectCells(isMultiple, this.parent.element.querySelector('[data-date="' + (targetDate.getTime() - MS_PER_DAY) + '"]'));
2571
+ return;
2572
+ }
2427
2573
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
2428
2574
  const tableEle = this.parent.getContentTable();
2429
2575
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
2430
- this.selectCells(false, tableEle.rows[rowIndex].cells[key.maxIndex - 1]);
2576
+ let cell = tableEle.rows[rowIndex].cells[key.maxIndex - 1];
2577
+ if (isMonthStart) {
2578
+ const tbody = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody');
2579
+ cell = tbody.item(tbody.length - 1).querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + this.parent.activeView.getEndDate().getTime() + '"]');
2580
+ }
2581
+ this.selectCells(false, cell);
2431
2582
  }
2432
2583
  }
2433
2584
  }
@@ -2445,6 +2596,29 @@ class KeyboardInteraction {
2445
2596
  }
2446
2597
  }
2447
2598
  }
2599
+ getTimelineYearTargetCell(key, target, isRight) {
2600
+ return this.isInverseTableSelect() ? this.getVerticalLeftRightCell(target, isRight) :
2601
+ this.getHorizontalLeftRightCell(key, target, isRight);
2602
+ }
2603
+ getHorizontalLeftRightCell(key, target, isRight) {
2604
+ const row = key.element.rows[target.parentNode.sectionRowIndex + (isRight ? 1 : -1)];
2605
+ if (row) {
2606
+ const query = isRight ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')'
2607
+ : '[data-date="' + ((+target.getAttribute('data-date')) - MS_PER_DAY) + '"]';
2608
+ return row.querySelector(query);
2609
+ }
2610
+ return target;
2611
+ }
2612
+ getVerticalLeftRightCell(target, isRight) {
2613
+ const date = new Date(+target.getAttribute('data-date'));
2614
+ const start = new Date(date.getFullYear(), date.getMonth() + (isRight ? 1 : -1), 1);
2615
+ const tableEle = this.parent.getContentTable();
2616
+ const targetCell = tableEle.querySelector('[data-date="' + start.getTime() + '"]');
2617
+ if (targetCell.parentNode.sectionRowIndex > target.parentNode.sectionRowIndex) {
2618
+ return targetCell;
2619
+ }
2620
+ return tableEle.querySelector('[data-date="' + new Date(start.getFullYear(), start.getMonth() + 1, 0).getTime() + '"]');
2621
+ }
2448
2622
  calculateNextPrevDate(currentCell, target, type) {
2449
2623
  const initialId = this.initialTarget.getAttribute('data-group-index');
2450
2624
  if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.currentView === 'Month') {
@@ -2488,6 +2662,16 @@ class KeyboardInteraction {
2488
2662
  }
2489
2663
  processTab(e, isReverse) {
2490
2664
  let target = e.target;
2665
+ if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
2666
+ target = target.closest('.e-appointment');
2667
+ this.parent.inlineModule.inlineCrudActions(e.target);
2668
+ }
2669
+ if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
2670
+ if (target.classList.contains(SELECTED_CELL_CLASS)) {
2671
+ this.parent.removeSelectedClass();
2672
+ }
2673
+ return;
2674
+ }
2491
2675
  const popupWrapper = closest(target, '.' + POPUP_WRAPPER_CLASS + ',.' + MORE_POPUP_WRAPPER_CLASS);
2492
2676
  if (popupWrapper && popupWrapper.classList.contains(POPUP_OPEN)) {
2493
2677
  if (popupWrapper.classList.contains(MORE_POPUP_WRAPPER_CLASS)) {
@@ -2529,7 +2713,9 @@ class KeyboardInteraction {
2529
2713
  }
2530
2714
  if (target.classList.contains(APPOINTMENT_CLASS)) {
2531
2715
  let appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
2532
- if (this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0) {
2716
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2717
+ const isTimeline = this.parent.activeView.isTimelineView() && !isTimelineYear;
2718
+ if ((isTimeline || isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical') && this.parent.activeViewOptions.group.resources.length > 0) {
2533
2719
  const index = parseInt(target.getAttribute('data-group-index'), 10);
2534
2720
  appElements = [].slice.call(this.parent.element.querySelectorAll(`.${APPOINTMENT_CLASS}[data-group-index="${index}"]`));
2535
2721
  const resCellSelector = `.${RESOURCE_CELLS_CLASS}[data-group-index="${isReverse ? index : index + 1}"]`;
@@ -2578,7 +2764,6 @@ class KeyboardInteraction {
2578
2764
  this.processTabOnResourceCells(target, isReverse);
2579
2765
  }
2580
2766
  }
2581
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2582
2767
  processDelete(e) {
2583
2768
  let activeEle = document.activeElement;
2584
2769
  if (this.parent.currentView === 'MonthAgenda') {
@@ -2977,7 +3162,6 @@ class Islamic {
2977
3162
  }
2978
3163
  }
2979
3164
 
2980
- /* eslint-disable @typescript-eslint/no-explicit-any */
2981
3165
  /**
2982
3166
  * Time zone
2983
3167
  */
@@ -3546,10 +3730,10 @@ function weeklyType(startDate, endDate, data, ruleObject) {
3546
3730
  let startDateDiff = DAYINDEX.indexOf(DAYINDEX[tempDate.getDay()]) - wkstIndex;
3547
3731
  startDateDiff = startDateDiff === -1 ? 6 : startDateDiff;
3548
3732
  const weekstartDate = addDays(tempDate, -startDateDiff);
3549
- const weekendDate = addDays(weekstartDate, 6);
3733
+ let weekendDate = addDays(weekstartDate, 6);
3550
3734
  let compareTempDate = new Date(tempDate.getTime());
3551
- resetTime(weekendDate);
3552
- resetTime(compareTempDate);
3735
+ weekendDate = resetTime(weekendDate);
3736
+ compareTempDate = resetTime(compareTempDate);
3553
3737
  while (weekendDate >= compareTempDate) {
3554
3738
  if (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1) {
3555
3739
  weekCollection.push([tempDate.getTime()]);
@@ -3559,7 +3743,7 @@ function weeklyType(startDate, endDate, data, ruleObject) {
3559
3743
  }
3560
3744
  tempDate.setDate(tempDate.getDate() + 1);
3561
3745
  compareTempDate = new Date(tempDate.getTime());
3562
- resetTime(compareTempDate);
3746
+ compareTempDate = resetTime(compareTempDate);
3563
3747
  }
3564
3748
  tempDate.setDate(tempDate.getDate() - 1);
3565
3749
  if (expectedCount && (data.length + ruleObject.recExceptionCount) >= expectedCount) {
@@ -5494,7 +5678,7 @@ class EventBase {
5494
5678
  const isAllDay = event[fieldMapping.isAllDay];
5495
5679
  const isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
5496
5680
  / MS_PER_DAY) >= 1;
5497
- return (isAllDay || (!(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') && isFullDay)) ? true : false;
5681
+ return (isAllDay || (this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' && isFullDay)) ? true : false;
5498
5682
  }
5499
5683
  addEventListener() {
5500
5684
  this.parent.on(documentClick, this.appointmentBorderRemove, this);
@@ -5580,7 +5764,8 @@ class EventBase {
5580
5764
  }
5581
5765
  eventClick(eventData) {
5582
5766
  const target = eventData.target;
5583
- if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS)) {
5767
+ if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS) ||
5768
+ target.classList.contains(INLINE_SUBJECT_CLASS)) {
5584
5769
  return;
5585
5770
  }
5586
5771
  if ((eventData.ctrlKey || eventData.metaKey) && eventData.which === 1 && this.parent.keyboardInteractionModule) {
@@ -6018,7 +6203,7 @@ class EventBase {
6018
6203
  eventObj[this.parent.eventFields.endTime].getTime() < schedule.endHour.getTime() && start.getTime() === end.getTime();
6019
6204
  return isHourRange || isSameRange;
6020
6205
  }
6021
- allDayExpandScroll(dateHeader, heightPropChanged) {
6206
+ allDayExpandScroll(dateHeader) {
6022
6207
  let indentHeight = 0;
6023
6208
  const headerRows = [].slice.call(this.parent.element.querySelectorAll('.' + HEADER_ROW_CLASS));
6024
6209
  headerRows.forEach((element) => {
@@ -6028,14 +6213,28 @@ class EventBase {
6028
6213
  });
6029
6214
  indentHeight = dateHeader.offsetHeight - indentHeight;
6030
6215
  this.parent.element.querySelector('.' + ALLDAY_CELLS_CLASS).style.height = (indentHeight / 12) + 'em';
6031
- const content = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
6032
- if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged)) {
6216
+ if (this.parent.uiStateValues.expand) {
6033
6217
  addClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
6034
6218
  }
6035
6219
  else {
6036
6220
  removeClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
6037
6221
  }
6038
6222
  }
6223
+ updateEventMinimumDuration(startEndHours, startTime, endTime) {
6224
+ const eventDuration = (getUniversalTime(endTime) - getUniversalTime(startTime)) / MS_PER_MINUTE;
6225
+ if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
6226
+ const tempEnd = new Date(startTime);
6227
+ tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
6228
+ endTime = tempEnd;
6229
+ if (endTime.getTime() > startEndHours.endHour.getTime()) {
6230
+ const tempStart = new Date(startEndHours.endHour.getTime());
6231
+ tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
6232
+ startTime = tempStart;
6233
+ endTime = startEndHours.endHour;
6234
+ }
6235
+ }
6236
+ return { startDate: startTime, endDate: endTime };
6237
+ }
6039
6238
  unWireEvents() {
6040
6239
  const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6041
6240
  for (const element of appElements) {
@@ -6437,18 +6636,21 @@ class VerticalEvent extends EventBase {
6437
6636
  if (currentDay.length === 0) {
6438
6637
  currentDate = resetTime(renderedDate[0]);
6439
6638
  }
6440
- const fieldMapping = this.parent.eventFields;
6441
- const startEndHours = getStartEndHours(currentDate, this.startHour, this.endHour);
6639
+ const field = this.parent.eventFields;
6640
+ const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
6442
6641
  const event = extend({}, record, null, true);
6443
6642
  event.isSpanned = { isBottom: false, isTop: false };
6444
- if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) {
6445
- event[fieldMapping.startTime] = startEndHours.startHour;
6643
+ if (record[field.startTime].getTime() < schedule.startHour.getTime()) {
6644
+ event[field.startTime] = schedule.startHour;
6446
6645
  event.isSpanned.isTop = true;
6447
6646
  }
6448
- if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) {
6449
- event[fieldMapping.endTime] = startEndHours.endHour;
6647
+ if (record[field.endTime].getTime() > schedule.endHour.getTime()) {
6648
+ event[field.endTime] = schedule.endHour;
6450
6649
  event.isSpanned.isBottom = true;
6451
6650
  }
6651
+ const eventDates = this.updateEventMinimumDuration(schedule, event[field.startTime], event[field.endTime]);
6652
+ event[field.startTime] = eventDates.startDate;
6653
+ event[field.endTime] = eventDates.endDate;
6452
6654
  return event;
6453
6655
  }
6454
6656
  renderAllDayEvents(eventObj, dayIndex, resource, dayCount, inline) {
@@ -6982,7 +7184,7 @@ class MonthEvent extends EventBase {
6982
7184
  this.cellHeight = cellDetail.height;
6983
7185
  this.dateRender = dateRender;
6984
7186
  const filteredDates = this.getRenderedDates(dateRender);
6985
- this.getSlotDates(workDays);
7187
+ this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
6986
7188
  this.processBlockEvents(blockList, resIndex, resData);
6987
7189
  for (const event of eventsList) {
6988
7190
  if (this.parent.resourceBase && !resData) {
@@ -7608,6 +7810,10 @@ class TimelineEvent extends MonthEvent {
7608
7810
  const eventData = event.data;
7609
7811
  startTime = this.getStartTime(event, eventData);
7610
7812
  endTime = this.getEndTime(event, eventData);
7813
+ const startEndHours = getStartEndHours(event[this.fields.startTime], this.startHour, this.endHour);
7814
+ const eventDates = this.updateEventMinimumDuration(startEndHours, startTime, endTime);
7815
+ startTime = eventDates.startDate;
7816
+ endTime = eventDates.endDate;
7611
7817
  this.day = this.parent.getIndexOfDate(this.dateRender, resetTime(new Date(startTime.getTime())));
7612
7818
  if (this.day < 0) {
7613
7819
  return;
@@ -7994,11 +8200,11 @@ class InlineEdit {
7994
8200
  if (this.parent.quickPopup) {
7995
8201
  this.parent.quickPopup.quickPopupHide();
7996
8202
  }
7997
- const moreWrapper = this.parent.element.querySelector('.e-more-popup-wrapper ');
7998
- if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
7999
- this.parent.quickPopup.morePopup.hide();
8000
- }
8001
8203
  if (args.type === 'Cell') {
8204
+ const moreWrapper = this.parent.element.querySelector('.' + MORE_POPUP_WRAPPER_CLASS);
8205
+ if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
8206
+ this.parent.quickPopup.morePopup.hide();
8207
+ }
8002
8208
  this.removeInlineAppointmentElement();
8003
8209
  this.cellEdit(args);
8004
8210
  }
@@ -8061,8 +8267,8 @@ class InlineEdit {
8061
8267
  '.e-inner-wrap' : '.e-appointment-details';
8062
8268
  args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);
8063
8269
  }
8270
+ inlineSubject.focus();
8064
8271
  }
8065
- inlineSubject.focus();
8066
8272
  inlineSubject.setSelectionRange(subject.length, subject.length);
8067
8273
  }
8068
8274
  createVerticalViewInline(saveObj, dayIndex, resIndex, daysCount) {
@@ -8156,6 +8362,9 @@ class InlineEdit {
8156
8362
  if (target && target.value !== '') {
8157
8363
  this.inlineCrudActions(target);
8158
8364
  }
8365
+ else {
8366
+ this.removeInlineAppointmentElement();
8367
+ }
8159
8368
  }
8160
8369
  inlineCrudActions(target) {
8161
8370
  if (closest(target, '.' + INLINE_APPOINTMENT_CLASS)) {
@@ -8251,7 +8460,7 @@ class FieldValidator {
8251
8460
  this.createTooltip(inputElement, error, id, '');
8252
8461
  }
8253
8462
  if (!isNullOrUndefined(elem)) {
8254
- elem.querySelector(".e-error").innerHTML = error.innerHTML;
8463
+ elem.querySelector('.e-error').innerHTML = error.innerHTML;
8255
8464
  }
8256
8465
  }
8257
8466
  createTooltip(element, error, name, display) {
@@ -9189,6 +9398,9 @@ class QuickPopups {
9189
9398
  }
9190
9399
  closeClick(event) {
9191
9400
  this.dialogEvent = event;
9401
+ if (this.parent.currentView === 'Year' && this.parent.activeCellsData && this.parent.activeCellsData.element) {
9402
+ this.parent.selectCell(this.parent.activeCellsData.element);
9403
+ }
9192
9404
  this.quickPopupHide();
9193
9405
  this.morePopup.hide();
9194
9406
  }
@@ -9772,6 +9984,7 @@ const INTERVALCLASS = 'e-interval';
9772
9984
  const DAYWRAPPER = 'e-days';
9773
9985
  const WEEKWRAPPER = 'e-non-week';
9774
9986
  const WEEKPOSITION = 'e-week-position';
9987
+ const DAYPOSITION = 'e-day-position';
9775
9988
  const YEAREXPANDERWRAPPER = 'e-year-expander';
9776
9989
  const YEAREXPANDERELEMENT = 'e-year-expander-element';
9777
9990
  const MONETHEXPANDERWRAPPER = 'e-month-expander';
@@ -10116,7 +10329,6 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10116
10329
  }
10117
10330
  });
10118
10331
  this.endType.appendTo(this.element.querySelector('.' + ENDONELEMENT));
10119
- // eslint-disable-next-line @typescript-eslint/ban-types
10120
10332
  const renderDropDownList = (dropDownData) => {
10121
10333
  return new DropDownList({
10122
10334
  dataSource: dropDownData,
@@ -10478,7 +10690,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10478
10690
  '<td><div class="' + INPUTWARAPPER + ' ' + WEEKPOSITION + '" >' +
10479
10691
  '<input type="text" tabindex="0" class="' + MONTHPOS + '"title="' + this.localeObj.getConstant('monthPosition') + '" />' +
10480
10692
  '</div></td>' +
10481
- '<td><div class="' + INPUTWARAPPER + '" style="min-width: 120px;">' +
10693
+ '<td><div class="' + INPUTWARAPPER + ' ' + DAYPOSITION + '">' +
10482
10694
  '<input type="text" tabindex="0" class="' + MONTHWEEK + '"title="' + this.localeObj.getConstant('monthWeek') + '" />' +
10483
10695
  '</div></td></tr></table>' +
10484
10696
  '</div></div>' +
@@ -10859,7 +11071,6 @@ class EventWindow {
10859
11071
  this.parent = parent;
10860
11072
  this.l10n = this.parent.localeObj;
10861
11073
  this.fields = this.parent.eventFields;
10862
- this.timezoneData = this.parent.tzModule.timezoneData;
10863
11074
  this.eventWindowTime = { startTime: new Date(), endTime: new Date() };
10864
11075
  this.renderEventWindow();
10865
11076
  }
@@ -11291,14 +11502,15 @@ class EventWindow {
11291
11502
  allowFiltering: true,
11292
11503
  change: this.onTimezoneChange.bind(this),
11293
11504
  cssClass: this.parent.cssClass || '',
11294
- dataSource: this.timezoneData,
11505
+ dataSource: this.parent.timezoneDataSource,
11295
11506
  enableRtl: this.parent.enableRtl,
11296
11507
  fields: { text: 'Text', value: 'Value' },
11297
- filterBarPlaceholder: 'Search Timezone',
11508
+ filterBarPlaceholder: this.parent.localeObj.getConstant('searchTimezone'),
11509
+ noRecordsTemplate: this.parent.localeObj.getConstant('noRecords'),
11298
11510
  filtering: (e) => {
11299
11511
  let query = new Query();
11300
11512
  query = (e.text !== '') ? query.where('Text', 'contains', e.text, true) : query;
11301
- e.updateData(this.timezoneData, query);
11513
+ e.updateData(this.parent.timezoneDataSource, query);
11302
11514
  },
11303
11515
  htmlAttributes: { 'title': this.getFieldLabel(value), 'name': fieldName },
11304
11516
  floatLabelType: 'Always',
@@ -12593,7 +12805,6 @@ class EventWindow {
12593
12805
  this.fields = null;
12594
12806
  this.buttonObj = null;
12595
12807
  this.repeatStatus = null;
12596
- this.timezoneData = null;
12597
12808
  this.eventWindowTime = null;
12598
12809
  }
12599
12810
  }
@@ -12855,7 +13066,12 @@ class Render {
12855
13066
  }
12856
13067
  initializeLayout(viewName) {
12857
13068
  if (this.parent.activeView) {
12858
- this.parent.resetTemplates();
13069
+ const templates = [
13070
+ 'cellTemplate', 'eventTemplate', 'tooltipTemplate', 'majorSlotTemplate', 'minorSlotTemplate',
13071
+ 'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'mothHeaderTemplate',
13072
+ 'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate'
13073
+ ];
13074
+ this.parent.resetTemplates(templates);
12859
13075
  this.parent.activeView.removeEventListener();
12860
13076
  this.parent.activeView.destroy();
12861
13077
  }
@@ -13929,12 +14145,15 @@ __decorate$6([
13929
14145
  __decorate$6([
13930
14146
  Property(false)
13931
14147
  ], EventSettings.prototype, "enableTooltip", void 0);
13932
- __decorate$6([
13933
- Property()
13934
- ], EventSettings.prototype, "tooltipTemplate", void 0);
13935
14148
  __decorate$6([
13936
14149
  Property('AllDayRow')
13937
14150
  ], EventSettings.prototype, "spannedEventPlacement", void 0);
14151
+ __decorate$6([
14152
+ Property(1)
14153
+ ], EventSettings.prototype, "minimumEventDuration", void 0);
14154
+ __decorate$6([
14155
+ Property()
14156
+ ], EventSettings.prototype, "tooltipTemplate", void 0);
13938
14157
  __decorate$6([
13939
14158
  Property()
13940
14159
  ], EventSettings.prototype, "resourceColorField", void 0);
@@ -14383,6 +14602,7 @@ class ResourceBase {
14383
14602
  targetType: 'relative',
14384
14603
  actionOnScroll: 'none',
14385
14604
  content: this.treeViewObj.element,
14605
+ relateTo: this.parent.element.querySelector('.' + TABLE_CONTAINER_CLASS),
14386
14606
  enableRtl: this.parent.enableRtl,
14387
14607
  hideAnimation: { name: 'SlideLeftOut', duration: 500 },
14388
14608
  showAnimation: { name: 'SlideLeftIn', duration: 500 },
@@ -15281,13 +15501,19 @@ let Schedule = class Schedule extends Component {
15281
15501
  timeFormat: this.internalTimeFormat,
15282
15502
  group: group,
15283
15503
  headerRows: this.headerRows,
15284
- orientation: 'Horizontal'
15504
+ orientation: 'Horizontal',
15505
+ numberOfWeeks: 0,
15506
+ displayDate: null
15285
15507
  };
15286
15508
  const viewOptions = this.viewCollections[this.viewIndex];
15287
15509
  const viewsData = extend(scheduleOptions, viewOptions, undefined, true);
15288
15510
  if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {
15289
15511
  viewsData.firstDayOfWeek = this.firstDayOfWeek;
15290
15512
  }
15513
+ if (viewsData.displayDate) {
15514
+ viewsData.displayDate = viewsData.displayDate instanceof Date ? new Date(viewsData.displayDate.getTime()) :
15515
+ new Date(viewsData.displayDate);
15516
+ }
15291
15517
  return viewsData;
15292
15518
  }
15293
15519
  initializeDataModule() {
@@ -15594,7 +15820,7 @@ let Schedule = class Schedule extends Component {
15594
15820
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
15595
15821
  this.uiStateValues = {
15596
15822
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
15597
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false
15823
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
15598
15824
  };
15599
15825
  }
15600
15826
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -15693,7 +15919,9 @@ let Schedule = class Schedule extends Component {
15693
15919
  beginFrom: 'Begin From',
15694
15920
  endAt: 'Ends At',
15695
15921
  expandAllDaySection: 'Expand-all-day-section',
15696
- collapseAllDaySection: 'Collapse-all-day-section'
15922
+ collapseAllDaySection: 'Collapse-all-day-section',
15923
+ searchTimezone: 'Search Timezone',
15924
+ noRecords: 'No records found'
15697
15925
  };
15698
15926
  }
15699
15927
  wireEvents() {
@@ -16368,7 +16596,7 @@ let Schedule = class Schedule extends Component {
16368
16596
  if (dateHeader.classList.contains(ALLDAY_APPOINTMENT_AUTO)) {
16369
16597
  removeClass([dateHeader], ALLDAY_APPOINTMENT_AUTO);
16370
16598
  }
16371
- this.eventBase.allDayExpandScroll(dateHeader, true);
16599
+ this.eventBase.allDayExpandScroll(dateHeader);
16372
16600
  }
16373
16601
  if (!this.uiStateValues.expand) {
16374
16602
  allDayRow.style.height = '';
@@ -16409,6 +16637,11 @@ let Schedule = class Schedule extends Component {
16409
16637
  this.keyboardInteractionModule = new KeyboardInteraction(this);
16410
16638
  }
16411
16639
  break;
16640
+ case 'timezoneDataSource':
16641
+ if (this.eventWindow) {
16642
+ this.eventWindow.refresh();
16643
+ }
16644
+ break;
16412
16645
  case 'editorTemplate':
16413
16646
  if (!isNullOrUndefined(this.editorTemplate)) {
16414
16647
  this.editorTemplateFn = this.templateParser(this.editorTemplate);
@@ -16551,6 +16784,7 @@ let Schedule = class Schedule extends Component {
16551
16784
  }
16552
16785
  break;
16553
16786
  case 'spannedEventPlacement':
16787
+ case 'minimumEventDuration':
16554
16788
  case 'enableMaxHeight':
16555
16789
  case 'enableIndicator':
16556
16790
  this.refreshEvents(false);
@@ -16923,7 +17157,7 @@ let Schedule = class Schedule extends Component {
16923
17157
  */
16924
17158
  exportToExcel(excelExportOptions) {
16925
17159
  if (this.excelExportModule) {
16926
- this.excelExportModule.initializeExcelExport(excelExportOptions || {});
17160
+ this.excelExportModule.initializeExcelExport(excelExportOptions);
16927
17161
  }
16928
17162
  else {
16929
17163
  throw Error('Inject ExcelExport module');
@@ -17107,6 +17341,9 @@ let Schedule = class Schedule extends Component {
17107
17341
  this.crudModule.refreshDataManager();
17108
17342
  }
17109
17343
  else {
17344
+ if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
17345
+ this.resetTemplates(['eventTemplate']);
17346
+ }
17110
17347
  const eventsData = this.eventsData || [];
17111
17348
  const blockData = this.blockData || [];
17112
17349
  const data = eventsData.concat(blockData);
@@ -17361,6 +17598,7 @@ let Schedule = class Schedule extends Component {
17361
17598
  this.eventTooltip = null;
17362
17599
  }
17363
17600
  this.destroyPopups();
17601
+ this.hideSpinner();
17364
17602
  this.unWireEvents();
17365
17603
  this.destroyHeaderModule();
17366
17604
  if (this.eventTooltip) {
@@ -17572,6 +17810,9 @@ __decorate([
17572
17810
  __decorate([
17573
17811
  Complex({}, EventSettings)
17574
17812
  ], Schedule.prototype, "eventSettings", void 0);
17813
+ __decorate([
17814
+ Property(timezoneData)
17815
+ ], Schedule.prototype, "timezoneDataSource", void 0);
17575
17816
  __decorate([
17576
17817
  Property()
17577
17818
  ], Schedule.prototype, "resourceHeaderTemplate", void 0);
@@ -19109,7 +19350,7 @@ class YearEvent extends TimelineEvent {
19109
19350
  }
19110
19351
  }
19111
19352
  else {
19112
- if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() > dateStart)) ||
19353
+ if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() >= dateStart)) ||
19113
19354
  (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
19114
19355
  appointmentsList.push(app);
19115
19356
  }
@@ -19287,7 +19528,9 @@ class DragAndDrop extends ActionBase {
19287
19528
  const eventGuid = this.actionObj.element.getAttribute('data-guid');
19288
19529
  this.actionObj.event = this.parent.eventBase.getEventByGuid(eventGuid);
19289
19530
  const eventObj = extend({}, this.actionObj.event, null, true);
19290
- this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
19531
+ if (!isNullOrUndefined(eventObj)) {
19532
+ this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
19533
+ }
19291
19534
  const dragArgs = {
19292
19535
  cancel: false,
19293
19536
  data: eventObj,
@@ -19704,7 +19947,7 @@ class DragAndDrop extends ActionBase {
19704
19947
  return;
19705
19948
  }
19706
19949
  const td = tr.children[colIndex];
19707
- if (this.parent.activeViewOptions.group.resources.length > 0) {
19950
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19708
19951
  this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
19709
19952
  }
19710
19953
  let dragStart$$1;
@@ -19873,7 +20116,8 @@ class DragAndDrop extends ActionBase {
19873
20116
  // eslint-disable-next-line max-len
19874
20117
  this.parent.getDateFromElement(isNullOrUndefined(index) ? this.actionObj.target : this.targetTd)));
19875
20118
  const splitEvents = this.splitEvent(event);
19876
- let events = this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 || !(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') ? [event] : splitEvents;
20119
+ const events = this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 ||
20120
+ this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' ? [event] : splitEvents;
19877
20121
  for (let i = 0; i < events.length; i++) {
19878
20122
  if (i > 0) {
19879
20123
  let filterQuery = `.e-day-wrapper[data-date="${resetTime(events[i][this.parent.eventFields.startTime]).getTime()}"]`;
@@ -19969,7 +20213,7 @@ class DragAndDrop extends ActionBase {
19969
20213
  const renderDates = this.getRenderedDates();
19970
20214
  const events = this.parent.eventBase.splitEvent(event, renderDates);
19971
20215
  let query = `.e-all-day-cells[data-date="${events[0][this.parent.eventFields.startTime].getTime()}"]`;
19972
- if (this.parent.activeViewOptions.group.resources.length > 0) {
20216
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19973
20217
  query = query.concat('[data-group-index = "' + this.actionObj.groupIndex + '"]');
19974
20218
  }
19975
20219
  const cell = [].slice.call(this.parent.element.querySelectorAll(query));
@@ -20167,7 +20411,13 @@ class DragAndDrop extends ActionBase {
20167
20411
  if (this.parent.eventDragArea) {
20168
20412
  const targetDate = this.parent.getDateFromElement(e.target);
20169
20413
  if (!isNullOrUndefined(targetDate)) {
20170
- eventStart = targetDate;
20414
+ if (!this.parent.activeViewOptions.timeScale.enable || (this.parent.currentView === 'TimelineMonth')) {
20415
+ const eventSrt = eventObj[this.parent.eventFields.startTime];
20416
+ eventStart = new Date(eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds()));
20417
+ }
20418
+ else {
20419
+ eventStart = targetDate;
20420
+ }
20171
20421
  }
20172
20422
  }
20173
20423
  const eventEnd = new Date(eventStart.getTime());
@@ -20596,6 +20846,10 @@ class ViewBase {
20596
20846
  return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
20597
20847
  }
20598
20848
  isCurrentMonth(date) {
20849
+ if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
20850
+ return this.parent.activeView.getStartDate().getTime() <= this.parent.getCurrentTime().getTime() &&
20851
+ this.parent.activeView.getEndDate().getTime() >= this.parent.getCurrentTime().getTime();
20852
+ }
20599
20853
  return date.getFullYear() ===
20600
20854
  this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
20601
20855
  }
@@ -20826,6 +21080,11 @@ class ViewBase {
20826
21080
  setStyleAttribute(resourceColumn, { 'height': formatUnit(content.clientHeight) });
20827
21081
  }
20828
21082
  }
21083
+ const headerCellElements = [].slice.call(this.element.querySelectorAll('.' + HEADER_CELLS_CLASS));
21084
+ headerCellElements.forEach((ele) => {
21085
+ const headerCellColSpan = parseInt(ele.getAttribute('colspan'), 10);
21086
+ setStyleAttribute(ele, { 'width': formatUnit(colWidth * headerCellColSpan) });
21087
+ });
20829
21088
  }
20830
21089
  }
20831
21090
  resetColWidth() {
@@ -21863,10 +22122,11 @@ class Month extends ViewBase {
21863
22122
  getDateSlots(renderDates, workDays) {
21864
22123
  const count = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH : workDays.length;
21865
22124
  const dateSlots = [];
22125
+ const isCurrentMonth = this.isCurrentMonth(this.parent.selectedDate);
21866
22126
  for (let col = 0; col < count; col++) {
21867
22127
  const classList$$1 = [HEADER_CELLS_CLASS];
21868
22128
  const currentDateIndex = renderDates.slice(0, count).map((date) => date.getDay());
21869
- if (this.isCurrentMonth(this.parent.selectedDate) && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
22129
+ if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
21870
22130
  classList$$1.push(CURRENT_DAY_CLASS);
21871
22131
  }
21872
22132
  dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList$$1, colSpan: 1, workDays: workDays });
@@ -21905,6 +22165,9 @@ class Month extends ViewBase {
21905
22165
  this.renderResourceMobileLayout();
21906
22166
  }
21907
22167
  this.parent.notify(contentReady, {});
22168
+ if (this.parent.uiStateValues.isCustomMonth) {
22169
+ this.parent.uiStateValues.isCustomMonth = false;
22170
+ }
21908
22171
  }
21909
22172
  refreshHeader() {
21910
22173
  remove(this.element.querySelector('tbody tr'));
@@ -22087,7 +22350,7 @@ class Month extends ViewBase {
22087
22350
  return slotDatas;
22088
22351
  }
22089
22352
  updateClassList(data) {
22090
- if (this.isOtherMonth(data.date)) {
22353
+ if (!this.isCustomMonth() && this.isOtherMonth(data.date)) {
22091
22354
  data.className.push(OTHERMONTH_CLASS);
22092
22355
  }
22093
22356
  if (!this.parent.isMinMaxDate(data.date)) {
@@ -22196,15 +22459,34 @@ class Month extends ViewBase {
22196
22459
  }
22197
22460
  }
22198
22461
  getMonthStart(currentDate) {
22199
- const monthStart = getWeekFirstDate(this.parent.calendarUtil.firstDateOfMonth(currentDate), this.parent.activeViewOptions.firstDayOfWeek);
22200
- const start = new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
22201
- return start;
22462
+ const useDisplayDate = this.parent.currentView === 'Month' && !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && (this.parent.uiStateValues.isCustomMonth || this.isCustomRange());
22463
+ const date = useDisplayDate ? this.parent.activeViewOptions.displayDate : !(this.parent.uiStateValues.isCustomMonth ||
22464
+ this.isCustomRange()) && this.isCustomMonth() ? currentDate : this.parent.calendarUtil.firstDateOfMonth(currentDate);
22465
+ const monthStart = getWeekFirstDate(date, this.parent.activeViewOptions.firstDayOfWeek);
22466
+ return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
22202
22467
  }
22203
22468
  getMonthEnd(currentDate) {
22204
- const endDate = addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
22205
- const lastWeekOfMonth = getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
22206
- const monthEnd = addDays(lastWeekOfMonth, WEEK_LENGTH - 1);
22207
- return monthEnd;
22469
+ if (this.isCustomMonth()) {
22470
+ const start = this.getMonthStart(currentDate);
22471
+ const numberOfDays = WEEK_LENGTH * (this.parent.activeViewOptions.numberOfWeeks > 0 ?
22472
+ this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS);
22473
+ return addDays(start, (numberOfDays - 1));
22474
+ }
22475
+ else {
22476
+ const endDate = addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
22477
+ const lastWeekOfMonth = getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
22478
+ return addDays(lastWeekOfMonth, WEEK_LENGTH - 1);
22479
+ }
22480
+ }
22481
+ isCustomRange() {
22482
+ const dates = this.parent.getCurrentViewDates();
22483
+ if (dates && dates.length > 0) {
22484
+ const selectedTime = resetTime(this.parent.selectedDate).getTime();
22485
+ const weekFirstDate = getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek);
22486
+ return !(selectedTime >= getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
22487
+ selectedTime <= addDays(weekFirstDate, 6).getTime());
22488
+ }
22489
+ return false;
22208
22490
  }
22209
22491
  getRenderDates(workDays) {
22210
22492
  const renderDates = [];
@@ -22234,34 +22516,57 @@ class Month extends ViewBase {
22234
22516
  return renderDates;
22235
22517
  }
22236
22518
  getNextPreviousDate(type) {
22237
- if (type === 'next') {
22238
- return addMonths(this.parent.selectedDate, this.parent.activeViewOptions.interval);
22519
+ if (this.isCustomMonth()) {
22520
+ const dates = this.parent.getCurrentViewDates();
22521
+ const date = getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
22522
+ : dates[0], this.parent.activeViewOptions.firstDayOfWeek);
22523
+ return addDays(date, type === 'next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
22524
+ this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS) * WEEK_LENGTH);
22239
22525
  }
22240
22526
  else {
22241
- return addMonths(this.parent.selectedDate, -(this.parent.activeViewOptions.interval));
22527
+ return addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
22242
22528
  }
22243
22529
  }
22530
+ getStartDate() {
22531
+ return this.getMonthStart(this.parent.selectedDate);
22532
+ }
22533
+ getEndDate() {
22534
+ return this.getMonthEnd(this.parent.selectedDate);
22535
+ }
22244
22536
  getEndDateFromStartDate(start) {
22245
22537
  return addDays(new Date(start.getTime()), 1);
22246
22538
  }
22247
22539
  getDateRangeText() {
22248
22540
  if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
22249
- if (this.parent.activeViewOptions.interval > 1) {
22250
- const endDate = addMonths(lastDateOfMonth(this.parent.selectedDate), this.parent.activeViewOptions.interval - 1);
22251
- if (this.parent.selectedDate.getFullYear() === endDate.getFullYear()) {
22252
- const monthNames = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
22541
+ let startDate = this.parent.selectedDate;
22542
+ let endDate;
22543
+ let updateCustomRange = false;
22544
+ if (this.isCustomMonth()) {
22545
+ const dates = this.parent.getCurrentViewDates();
22546
+ updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
22547
+ dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
22548
+ if (updateCustomRange) {
22549
+ startDate = dates[0];
22550
+ endDate = dates[dates.length - 1];
22551
+ }
22552
+ }
22553
+ const isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
22554
+ if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
22555
+ endDate = endDate ? endDate : addMonths(lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
22556
+ if (startDate.getFullYear() === endDate.getFullYear()) {
22557
+ const monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
22253
22558
  (this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
22254
22559
  this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
22255
22560
  return capitalizeFirstWord(monthNames, 'single');
22256
22561
  }
22257
- const text = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
22258
- this.parent.selectedDate.getFullYear() + ' - ' +
22562
+ const text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
22563
+ startDate.getFullYear() + ' - ' +
22259
22564
  this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
22260
22565
  this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
22261
22566
  return capitalizeFirstWord(text, 'single');
22262
22567
  }
22263
22568
  const format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
22264
- return capitalizeFirstWord(this.parent.globalize.formatDate(this.parent.selectedDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
22569
+ return capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
22265
22570
  }
22266
22571
  return this.formatDateRange(this.parent.selectedDate);
22267
22572
  }
@@ -22286,6 +22591,10 @@ class Month extends ViewBase {
22286
22591
  EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
22287
22592
  }
22288
22593
  }
22594
+ isCustomMonth() {
22595
+ return this.parent.currentView === 'Month' &&
22596
+ (!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
22597
+ }
22289
22598
  getModuleName() {
22290
22599
  return 'month';
22291
22600
  }
@@ -22517,12 +22826,29 @@ class Year extends ViewBase {
22517
22826
  return Array.apply(null, { length: this.parent.activeViewOptions.monthsCount }).map((value, index) => this.parent.firstMonthOfYear + index);
22518
22827
  }
22519
22828
  onCellClick(e) {
22520
- const target = closest(e.target, '.' + WORK_CELLS_CLASS);
22829
+ let target = closest(e.target, '.' + WORK_CELLS_CLASS);
22521
22830
  const startDate = this.parent.getDateFromElement(target);
22522
- const endDate = addDays(new Date(startDate.getTime()), 1);
22523
- const filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
22524
- const moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
22525
- this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
22831
+ this.parent.activeCellsData = this.parent.getCellDetails(target);
22832
+ const isPrevious = startDate.getTime() < this.getStartDate().getTime();
22833
+ if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
22834
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
22835
+ const activeDate = this.parent.activeCellsData.startTime.getTime();
22836
+ const inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
22837
+ const dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
22838
+ const selectedCell = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + dateAttr + '"]');
22839
+ this.parent.selectCell(selectedCell);
22840
+ this.parent.activeCellsData = this.parent.getCellDetails(selectedCell);
22841
+ }
22842
+ else {
22843
+ const endDate = addDays(new Date(startDate.getTime()), 1);
22844
+ const filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
22845
+ const moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
22846
+ if (target.classList.contains(OTHERMONTH_CLASS)) {
22847
+ target = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
22848
+ }
22849
+ this.parent.activeCellsData = this.parent.getCellDetails(target);
22850
+ this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
22851
+ }
22526
22852
  }
22527
22853
  onContentScroll(e) {
22528
22854
  const target = e.target;
@@ -22574,10 +22900,10 @@ class Year extends ViewBase {
22574
22900
  return addDays(addMonths(this.getStartDate(), this.parent.monthsCount), -1);
22575
22901
  }
22576
22902
  startDate() {
22577
- return getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek);
22903
+ return this.parent.currentView === 'Year' ? getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
22578
22904
  }
22579
22905
  endDate() {
22580
- return addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1);
22906
+ return this.parent.currentView === 'Year' ? addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) : this.getEndDate();
22581
22907
  }
22582
22908
  getEndDateFromStartDate(start) {
22583
22909
  let date = new Date(start.getTime());
@@ -22620,6 +22946,7 @@ class Year extends ViewBase {
22620
22946
  EventHandler.add(element, 'click', this.onCellClick, this);
22621
22947
  }
22622
22948
  else {
22949
+ EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
22623
22950
  EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
22624
22951
  if (!this.parent.isAdaptive) {
22625
22952
  EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
@@ -23056,7 +23383,8 @@ class Agenda extends AgendaBase {
23056
23383
  for (const event of this.parent.eventsData) {
23057
23384
  delete event.generatedDates;
23058
23385
  }
23059
- let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ? args.processedData : this.parent.eventsProcessed;
23386
+ let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
23387
+ args.processedData : this.parent.eventsProcessed;
23060
23388
  if (this.parent.uiStateValues.isGroupAdaptive) {
23061
23389
  const resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
23062
23390
  this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
@@ -24105,6 +24433,9 @@ class TimelineYear extends Year {
24105
24433
  tr.appendChild(leftHeaderCells);
24106
24434
  leftHeaderCells.appendChild(this.renderResourceHeader(LEFT_INDENT_WRAP_CLASS));
24107
24435
  }
24436
+ const isHorizontal = this.parent.activeViewOptions.orientation === 'Horizontal';
24437
+ const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
24438
+ this.isInverseTableSelect = isHorizontal && !isGroup ? false : true;
24108
24439
  const td = createElement('td');
24109
24440
  tr.appendChild(td);
24110
24441
  const container = createElement('div', { className: DATE_HEADER_CONTAINER_CLASS });
@@ -24137,7 +24468,7 @@ class TimelineYear extends Year {
24137
24468
  }
24138
24469
  else {
24139
24470
  if (this.parent.monthHeaderTemplate) {
24140
- append(this.renderDayMonthHeaderTemplate(date, months[column], 'mothHeaderTemplate'), innerTd);
24471
+ append(this.renderDayMonthHeaderTemplate(date, months[column], 'monthHeaderTemplate'), innerTd);
24141
24472
  }
24142
24473
  else {
24143
24474
  innerTd.innerHTML = `<span>${this.getMonthName(date)}</span>`;
@@ -24782,8 +25113,8 @@ class ExcelExport {
24782
25113
  constructor(parent) {
24783
25114
  this.parent = parent;
24784
25115
  }
24785
- initializeExcelExport(excelExportOptions) {
24786
- const exportFields = excelExportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
25116
+ initializeExcelExport(excelExportOptions = {}) {
25117
+ const exportColumns = this.getExportColumns(excelExportOptions);
24787
25118
  const exportName = excelExportOptions.fileName || 'Schedule';
24788
25119
  const exportType = excelExportOptions.exportType || 'xlsx';
24789
25120
  const isIncludeOccurrences = excelExportOptions.includeOccurrences || false;
@@ -24795,34 +25126,40 @@ class ExcelExport {
24795
25126
  else {
24796
25127
  eventCollection = !isIncludeOccurrences ? this.parent.eventsData : this.parent.eventsProcessed;
24797
25128
  }
24798
- this.processWorkbook(exportFields, exportName, exportType, eventCollection);
25129
+ this.processWorkbook(exportColumns, exportName, exportType, eventCollection);
24799
25130
  }
24800
25131
  processWorkbook(fields, name, type, eventCollection) {
24801
25132
  const columns = [];
24802
25133
  const rows = [];
24803
25134
  const columnHeader = [];
24804
- fields.forEach((field, i) => columns.push({ index: i + 1, width: (field === 'Id' ? 20 : 150) }));
25135
+ fields.forEach((field, i) => { columns.push({ index: i + 1, width: (field.name === 'Id' ? 50 : 150) }); });
24805
25136
  const style = { fontSize: 12, borders: { color: '#E0E0E0' }, bold: true };
24806
- fields.forEach((field, i) => columnHeader.push({ index: i + 1, value: field, style: style }));
25137
+ fields.forEach((field, i) => { columnHeader.push({ index: i + 1, value: field.text, style: style }); });
24807
25138
  rows.push({ index: 1, cells: columnHeader });
24808
- let i = 2;
24809
- for (const event of eventCollection) {
25139
+ eventCollection.forEach((event, i) => {
24810
25140
  const columnData = [];
24811
25141
  fields.forEach((field, n) => {
24812
- let columnRule = { index: n + 1, value: event[field] || '' };
24813
- if (field === this.parent.eventFields.startTime || field === this.parent.eventFields.endTime) {
25142
+ let columnRule = { index: n + 1, value: event[field.name] || '' };
25143
+ if (field.name === this.parent.eventFields.startTime || field.name === this.parent.eventFields.endTime) {
24814
25144
  const styleRule = { fontSize: 12, numberFormat: 'm/d/yyyy h:mm AM/PM' };
24815
25145
  columnRule = extend({}, columnRule, { style: styleRule }, true);
24816
25146
  }
24817
25147
  columnData.push(columnRule);
24818
25148
  });
24819
- rows.push({ index: i, cells: columnData });
24820
- i++;
24821
- }
25149
+ rows.push({ index: i + 2, cells: columnData });
25150
+ });
24822
25151
  const workSheet = [{ columns: columns, rows: rows }];
24823
25152
  const book = new Workbook({ worksheets: workSheet }, type, this.parent.locale);
24824
25153
  book.save(name + '.' + type);
24825
25154
  }
25155
+ getExportColumns(exportOptions) {
25156
+ const exportColumns = exportOptions.fieldsInfo || [];
25157
+ if (exportColumns.length === 0) {
25158
+ const fields = exportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
25159
+ fields.forEach((field) => { exportColumns.push({ name: field, text: field }); });
25160
+ }
25161
+ return exportColumns;
25162
+ }
24826
25163
  getModuleName() {
24827
25164
  return 'excelExport';
24828
25165
  }
@@ -24967,5 +25304,5 @@ class Print {
24967
25304
  * Export Schedule components
24968
25305
  */
24969
25306
 
24970
- export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
25307
+ export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
24971
25308
  //# sourceMappingURL=ej2-schedule.es2015.js.map