@syncfusion/ej2-schedule 19.3.55 → 19.4.42

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 (121) 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 +50 -1
  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 +489 -145
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +493 -152
  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/recurrence-editor.js +2 -2
  15. package/src/schedule/actions/drag.js +12 -4
  16. package/src/schedule/actions/keyboard.d.ts +7 -0
  17. package/src/schedule/actions/keyboard.js +197 -28
  18. package/src/schedule/actions/resize.js +44 -37
  19. package/src/schedule/base/css-constant.d.ts +6 -0
  20. package/src/schedule/base/css-constant.js +6 -0
  21. package/src/schedule/base/interface.d.ts +12 -0
  22. package/src/schedule/base/resource.js +1 -0
  23. package/src/schedule/base/schedule-model.d.ts +89 -20
  24. package/src/schedule/base/schedule.d.ts +88 -19
  25. package/src/schedule/base/schedule.js +15 -4
  26. package/src/schedule/base/util.d.ts +1 -0
  27. package/src/schedule/base/util.js +1 -0
  28. package/src/schedule/event-renderer/event-base.d.ts +2 -1
  29. package/src/schedule/event-renderer/event-base.js +19 -4
  30. package/src/schedule/event-renderer/inline-edit.js +8 -5
  31. package/src/schedule/event-renderer/month.js +3 -2
  32. package/src/schedule/event-renderer/timeline-view.js +4 -0
  33. package/src/schedule/event-renderer/vertical-view.js +9 -6
  34. package/src/schedule/event-renderer/year.js +1 -1
  35. package/src/schedule/exports/excel-export.d.ts +2 -1
  36. package/src/schedule/exports/excel-export.js +21 -18
  37. package/src/schedule/models/event-settings-model.d.ts +17 -9
  38. package/src/schedule/models/event-settings.d.ts +15 -8
  39. package/src/schedule/models/event-settings.js +6 -3
  40. package/src/schedule/models/views-model.d.ts +19 -0
  41. package/src/schedule/models/views.d.ts +17 -0
  42. package/src/schedule/models/views.js +6 -0
  43. package/src/schedule/popups/quick-popups.js +3 -0
  44. package/src/schedule/renderer/agenda.js +2 -1
  45. package/src/schedule/renderer/header-renderer.d.ts +1 -0
  46. package/src/schedule/renderer/header-renderer.js +23 -8
  47. package/src/schedule/renderer/month.d.ts +4 -0
  48. package/src/schedule/renderer/month.js +69 -19
  49. package/src/schedule/renderer/renderer.js +6 -1
  50. package/src/schedule/renderer/timeline-year.js +4 -1
  51. package/src/schedule/renderer/view-base.js +12 -1
  52. package/src/schedule/renderer/year.d.ts +2 -2
  53. package/src/schedule/renderer/year.js +24 -6
  54. package/styles/bootstrap-dark.css +108 -27
  55. package/styles/bootstrap.css +105 -27
  56. package/styles/bootstrap4.css +117 -62
  57. package/styles/bootstrap5-dark.css +118 -67
  58. package/styles/bootstrap5.css +118 -67
  59. package/styles/fabric-dark.css +108 -26
  60. package/styles/fabric.css +109 -26
  61. package/styles/highcontrast-light.css +104 -26
  62. package/styles/highcontrast.css +109 -28
  63. package/styles/material-dark.css +110 -32
  64. package/styles/material.css +103 -25
  65. package/styles/recurrence-editor/_bootstrap-dark-definition.scss +7 -0
  66. package/styles/recurrence-editor/_bootstrap-definition.scss +7 -0
  67. package/styles/recurrence-editor/_bootstrap4-definition.scss +7 -0
  68. package/styles/recurrence-editor/_bootstrap5-definition.scss +7 -0
  69. package/styles/recurrence-editor/_fabric-dark-definition.scss +8 -0
  70. package/styles/recurrence-editor/_fabric-definition.scss +7 -0
  71. package/styles/recurrence-editor/_fluent-definition.scss +15 -0
  72. package/styles/recurrence-editor/_highcontrast-definition.scss +7 -0
  73. package/styles/recurrence-editor/_highcontrast-light-definition.scss +7 -0
  74. package/styles/recurrence-editor/_layout.scss +20 -4
  75. package/styles/recurrence-editor/_material-dark-definition.scss +7 -0
  76. package/styles/recurrence-editor/_material-definition.scss +7 -0
  77. package/styles/recurrence-editor/_tailwind-definition.scss +15 -8
  78. package/styles/recurrence-editor/bootstrap-dark.css +20 -4
  79. package/styles/recurrence-editor/bootstrap.css +20 -4
  80. package/styles/recurrence-editor/bootstrap4.css +20 -4
  81. package/styles/recurrence-editor/bootstrap5-dark.css +20 -4
  82. package/styles/recurrence-editor/bootstrap5.css +20 -4
  83. package/styles/recurrence-editor/fabric-dark.css +20 -4
  84. package/styles/recurrence-editor/fabric.css +20 -4
  85. package/styles/recurrence-editor/highcontrast-light.css +20 -4
  86. package/styles/recurrence-editor/highcontrast.css +20 -4
  87. package/styles/recurrence-editor/material-dark.css +20 -4
  88. package/styles/recurrence-editor/material.css +20 -4
  89. package/styles/recurrence-editor/tailwind-dark.css +20 -4
  90. package/styles/recurrence-editor/tailwind.css +20 -4
  91. package/styles/schedule/_bootstrap-dark-definition.scss +22 -1
  92. package/styles/schedule/_bootstrap-definition.scss +22 -1
  93. package/styles/schedule/_bootstrap4-definition.scss +23 -1
  94. package/styles/schedule/_bootstrap5-definition.scss +145 -119
  95. package/styles/schedule/_fabric-dark-definition.scss +22 -1
  96. package/styles/schedule/_fabric-definition.scss +22 -1
  97. package/styles/schedule/_fluent-definition.scss +218 -0
  98. package/styles/schedule/_highcontrast-definition.scss +22 -1
  99. package/styles/schedule/_highcontrast-light-definition.scss +22 -1
  100. package/styles/schedule/_layout.scss +95 -158
  101. package/styles/schedule/_material-dark-definition.scss +22 -1
  102. package/styles/schedule/_material-definition.scss +21 -0
  103. package/styles/schedule/_tailwind-definition.scss +216 -195
  104. package/styles/schedule/_theme.scss +1 -1
  105. package/styles/schedule/bootstrap-dark.css +88 -23
  106. package/styles/schedule/bootstrap.css +85 -23
  107. package/styles/schedule/bootstrap4.css +97 -58
  108. package/styles/schedule/bootstrap5-dark.css +98 -63
  109. package/styles/schedule/bootstrap5.css +98 -63
  110. package/styles/schedule/fabric-dark.css +88 -22
  111. package/styles/schedule/fabric.css +89 -22
  112. package/styles/schedule/highcontrast-light.css +84 -22
  113. package/styles/schedule/highcontrast.css +89 -24
  114. package/styles/schedule/icons/_fluent.scss +231 -0
  115. package/styles/schedule/icons/_tailwind.scss +231 -231
  116. package/styles/schedule/material-dark.css +90 -28
  117. package/styles/schedule/material.css +83 -21
  118. package/styles/schedule/tailwind-dark.css +94 -52
  119. package/styles/schedule/tailwind.css +94 -52
  120. package/styles/tailwind-dark.css +114 -56
  121. 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
  /**
@@ -513,6 +514,12 @@ const DATE_HEADER_CONTAINER_CLASS = 'e-date-header-container';
513
514
  /** @private */
514
515
  const HEADER_CELLS_CLASS = 'e-header-cells';
515
516
  /** @private */
517
+ const HEADER_WEEK_CELLS_CLASS = 'e-header-week-cell';
518
+ /** @private */
519
+ const HEADER_MONTH_CELLS_CLASS = 'e-header-month-cell';
520
+ /** @private */
521
+ const HEADER_YEAR_CELLS_CLASS = 'e-header-year-cell';
522
+ /** @private */
516
523
  const WORKDAY_CLASS = 'e-work-days';
517
524
  /** @private */
518
525
  const OTHERMONTH_CLASS = 'e-other-month';
@@ -1243,8 +1250,10 @@ class HeaderRenderer {
1243
1250
  enableRtl: this.parent.enableRtl
1244
1251
  });
1245
1252
  const calendarView = this.getCalendarView();
1253
+ const isDisplayDate = this.parent.currentView === 'Month' &&
1254
+ !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && !this.hasSelectedDate();
1246
1255
  this.headerCalendar = new Calendar({
1247
- value: this.parent.selectedDate,
1256
+ value: isDisplayDate ? this.parent.activeViewOptions.displayDate : this.parent.selectedDate,
1248
1257
  min: this.parent.minDate,
1249
1258
  max: this.parent.maxDate,
1250
1259
  firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
@@ -1283,6 +1292,7 @@ class HeaderRenderer {
1283
1292
  const strClass = args.item.cssClass.replace('e-views ', '');
1284
1293
  let data;
1285
1294
  let isSameTime;
1295
+ let currentTime;
1286
1296
  switch (strClass) {
1287
1297
  case 'e-date-range':
1288
1298
  if (!this.headerPopup) {
@@ -1332,8 +1342,13 @@ class HeaderRenderer {
1332
1342
  this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
1333
1343
  break;
1334
1344
  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);
1345
+ currentTime = resetTime(this.parent.getCurrentTime());
1346
+ if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda' || !this.parent.isSelectedDate(currentTime) ||
1347
+ this.parent.currentView === 'Month' && this.parent.activeViewOptions.displayDate && !this.hasSelectedDate() &&
1348
+ resetTime(this.parent.activeViewOptions.displayDate) !== currentTime || this.parent.currentView === 'Month' &&
1349
+ this.parent.activeViewOptions.numberOfWeeks > 0 && !this.hasSelectedDate()
1350
+ && resetTime(firstDateOfMonth(this.parent.selectedDate)) !== currentTime) {
1351
+ this.parent.changeDate(currentTime, args.originalEvent);
1337
1352
  }
1338
1353
  break;
1339
1354
  case 'e-prev':
@@ -1368,6 +1383,11 @@ class HeaderRenderer {
1368
1383
  toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
1369
1384
  }
1370
1385
  }
1386
+ hasSelectedDate() {
1387
+ const selectedTime = resetTime(this.parent.selectedDate).getTime();
1388
+ return selectedTime >= this.parent.activeView.getStartDate().getTime() &&
1389
+ selectedTime <= this.parent.activeView.getEndDate().getTime();
1390
+ }
1371
1391
  getHeaderElement() {
1372
1392
  return this.toolbarObj.element;
1373
1393
  }
@@ -1412,9 +1432,11 @@ class HeaderRenderer {
1412
1432
  lastDate = addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
1413
1433
  }
1414
1434
  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);
1435
+ const isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
1436
+ this.parent.activeViewOptions.numberOfWeeks > 0;
1437
+ firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : firstDateOfMonth(this.parent.selectedDate);
1438
+ lastDate = isCustomMonth ? this.parent.activeView.getEndDate() :
1439
+ lastDateOfMonth(addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
1418
1440
  }
1419
1441
  if (!isNullOrUndefined(prevNavEle)) {
1420
1442
  this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
@@ -1945,6 +1967,9 @@ class KeyboardInteraction {
1945
1967
  }
1946
1968
  const queryStr = '.' + WORK_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS + ',.' + HEADER_CELLS_CLASS;
1947
1969
  const target = closest(e.target, queryStr);
1970
+ if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
1971
+ return;
1972
+ }
1948
1973
  this.parent.activeCellsData = this.getSelectedElements(target);
1949
1974
  const cellData = {};
1950
1975
  if (this.parent.eventWindow) {
@@ -1968,6 +1993,9 @@ class KeyboardInteraction {
1968
1993
  || this.isPreventAction(e)) {
1969
1994
  return;
1970
1995
  }
1996
+ if (this.parent.currentView === 'TimelineYear' && e.target.classList.contains(OTHERMONTH_CLASS)) {
1997
+ return;
1998
+ }
1971
1999
  const target = e.target;
1972
2000
  if (closest(target, '.' + POPUP_WRAPPER_CLASS)) {
1973
2001
  if (target.classList.contains(QUICK_POPUP_EVENT_DETAILS_CLASS) ||
@@ -2002,11 +2030,16 @@ class KeyboardInteraction {
2002
2030
  this.parent.notify(inlineClick, inlineArgs);
2003
2031
  }
2004
2032
  else {
2005
- this.parent.notify(cellClick, args);
2033
+ if (this.parent.currentView === 'Year') {
2034
+ target.click();
2035
+ }
2036
+ else {
2037
+ this.parent.notify(cellClick, args);
2038
+ }
2006
2039
  }
2007
2040
  return;
2008
2041
  }
2009
- if (target.classList.contains(INLINE_SUBJECT_CLASS)) {
2042
+ if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
2010
2043
  this.parent.inlineModule.inlineCrudActions(target);
2011
2044
  return;
2012
2045
  }
@@ -2038,7 +2071,9 @@ class KeyboardInteraction {
2038
2071
  }
2039
2072
  getCells(isInverseTable, start, end) {
2040
2073
  const tableEle = this.parent.getContentTable();
2041
- let cells = [].slice.call(tableEle.querySelectorAll('td'));
2074
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2075
+ const query = isTimelineYear && !isInverseTable ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' : 'td';
2076
+ let cells = [].slice.call(tableEle.querySelectorAll(query));
2042
2077
  let maxRow = tableEle.rows.length;
2043
2078
  let maxColumn = tableEle.rows[0].cells.length;
2044
2079
  if (start && start.classList.contains(ALLDAY_CELLS_CLASS)) {
@@ -2053,7 +2088,11 @@ class KeyboardInteraction {
2053
2088
  if (isInverseTable) {
2054
2089
  for (let i = 0; i < maxColumn; i++) {
2055
2090
  for (let j = 0; j < maxRow; j++) {
2056
- inverseCells.push(cells[maxColumn * j + i]);
2091
+ const cell = cells[maxColumn * j + i];
2092
+ if (isTimelineYear && cell.classList.contains(OTHERMONTH_CLASS)) {
2093
+ continue;
2094
+ }
2095
+ inverseCells.push(cell);
2057
2096
  }
2058
2097
  }
2059
2098
  startIndex = inverseCells.indexOf(start);
@@ -2075,11 +2114,17 @@ class KeyboardInteraction {
2075
2114
  return;
2076
2115
  }
2077
2116
  this.parent.eventBase.removeSelectedAppointmentClass();
2078
- if (this.parent.activeView.isTimelineView()) {
2117
+ if (this.parent.activeView.isTimelineView() && this.parent.currentView !== 'TimelineYear') {
2079
2118
  const cell = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS +
2080
2119
  ' tr:not(.' + HIDDEN_CLASS + ') .' + WORK_CELLS_CLASS + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')');
2081
2120
  this.selectCells(false, cell);
2082
2121
  }
2122
+ else if (this.parent.currentView.indexOf('Year') > -1) {
2123
+ let query = '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')';
2124
+ const isVerticalYear = this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical';
2125
+ query += isVerticalYear ? '[data-date="' + this.parent.activeView.startDate().getTime() + '"]' : '';
2126
+ this.selectCells(false, this.parent.element.querySelector(query));
2127
+ }
2083
2128
  else {
2084
2129
  this.selectCells(false, this.parent.getWorkCellElements()[0]);
2085
2130
  }
@@ -2100,13 +2145,21 @@ class KeyboardInteraction {
2100
2145
  let target = (targetCell instanceof Array) ? targetCell.slice(-1)[0] : targetCell;
2101
2146
  if (isMultiple) {
2102
2147
  let initialId;
2103
- const views = ['Day', 'Week', 'WorkWeek', 'Month', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'];
2148
+ const views = ['Day', 'Week', 'WorkWeek', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth', 'TimelineYear'];
2104
2149
  const args = { element: targetCell, requestType: 'mousemove', allowMultipleRow: true };
2105
2150
  this.parent.inlineModule.removeInlineAppointmentElement();
2106
2151
  this.parent.trigger(select, args, (selectArgs) => {
2107
2152
  const allowMultipleRow = (!selectArgs.allowMultipleRow) || (!this.parent.allowMultiRowSelection);
2108
- if (allowMultipleRow && (views.indexOf(this.parent.currentView) > -1)) {
2109
- target = target.parentElement.children[this.initialTarget.cellIndex];
2153
+ if (allowMultipleRow) {
2154
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2155
+ if (isTimelineYear && this.parent.activeViewOptions.orientation === 'Horizontal' || this.parent.currentView === 'Month') {
2156
+ const isGroupYear = isTimelineYear && this.parent.activeViewOptions.group.resources.length > 0;
2157
+ target = isGroupYear ? this.initialTarget :
2158
+ this.initialTarget.parentElement.children[target.cellIndex];
2159
+ }
2160
+ else if (views.indexOf(this.parent.currentView) > -1) {
2161
+ target = target.parentElement.children[this.initialTarget.cellIndex];
2162
+ }
2110
2163
  }
2111
2164
  let selectedCells = this.getCells(this.isInverseTableSelect(), this.initialTarget, target);
2112
2165
  if (this.parent.activeViewOptions.group.resources.length > 0) {
@@ -2239,8 +2292,20 @@ class KeyboardInteraction {
2239
2292
  }
2240
2293
  }
2241
2294
  }
2295
+ cancelUpDownAction(isTimelineYear) {
2296
+ const isVerticalYear = isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical';
2297
+ const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
2298
+ if (isVerticalYear && isGroup || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS)) {
2299
+ return true;
2300
+ }
2301
+ if (this.parent.activeView.isTimelineView() && !isTimelineYear || this.parent.currentView === 'MonthAgenda') {
2302
+ return true;
2303
+ }
2304
+ return false;
2305
+ }
2242
2306
  processUp(e, isMultiple) {
2243
- if ((isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda'))) {
2307
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2308
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2244
2309
  return;
2245
2310
  }
2246
2311
  let target = (e.target);
@@ -2263,8 +2328,22 @@ class KeyboardInteraction {
2263
2328
  if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
2264
2329
  const tableRows = this.parent.getTableRows();
2265
2330
  const curRowIndex = tableRows.indexOf(target.parentElement);
2266
- if (curRowIndex > 0 && curRowIndex < tableRows.length) {
2267
- this.selectCells(isMultiple, (tableRows[curRowIndex - 1]).cells[target.cellIndex]);
2331
+ let targetCell;
2332
+ if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
2333
+ targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, true) :
2334
+ this.getHorizontalUpDownCell(tableRows, target, curRowIndex, true);
2335
+ }
2336
+ if ((curRowIndex > 0 || targetCell) && curRowIndex < tableRows.length) {
2337
+ targetCell = targetCell ? targetCell : (tableRows[curRowIndex - 1]).cells[target.cellIndex];
2338
+ if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2339
+ if (this.parent.activeView.getStartDate().getTime() < +targetCell.getAttribute('data-date')) {
2340
+ targetCell = this.getYearUpDownCell(tableRows, curRowIndex - 1, target.cellIndex, true);
2341
+ }
2342
+ else {
2343
+ return;
2344
+ }
2345
+ }
2346
+ this.selectCells(isMultiple, targetCell);
2268
2347
  }
2269
2348
  }
2270
2349
  else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
@@ -2272,7 +2351,8 @@ class KeyboardInteraction {
2272
2351
  }
2273
2352
  }
2274
2353
  processDown(e, isMultiple) {
2275
- if (isMultiple && (this.parent.activeView.isTimelineView() || this.parent.currentView === 'MonthAgenda')) {
2354
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2355
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2276
2356
  return;
2277
2357
  }
2278
2358
  let target = (e.target);
@@ -2295,16 +2375,62 @@ class KeyboardInteraction {
2295
2375
  }
2296
2376
  if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
2297
2377
  const curRowIndex = tableRows.indexOf(target.parentElement);
2298
- if (curRowIndex >= 0 && curRowIndex < tableRows.length - 1) {
2299
- this.selectCells(isMultiple, (tableRows[curRowIndex + 1]).cells[target.cellIndex]);
2378
+ let targetCell;
2379
+ if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
2380
+ targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, false)
2381
+ : this.getHorizontalUpDownCell(tableRows, target, curRowIndex, false);
2382
+ }
2383
+ if (curRowIndex >= 0 && ((curRowIndex < tableRows.length - 1) || targetCell)) {
2384
+ targetCell = targetCell ? targetCell : (tableRows[curRowIndex + 1]).cells[target.cellIndex];
2385
+ if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2386
+ if (this.parent.activeView.getEndDate().getTime() > +targetCell.getAttribute('data-date')) {
2387
+ targetCell = this.getYearUpDownCell(tableRows, curRowIndex + 1, target.cellIndex, false);
2388
+ }
2389
+ else {
2390
+ return;
2391
+ }
2392
+ }
2393
+ this.selectCells(isMultiple, targetCell);
2300
2394
  }
2301
2395
  }
2302
2396
  else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
2303
2397
  this.selectAppointment(false, target);
2304
2398
  }
2305
2399
  }
2400
+ getYearUpDownCell(tableRows, rowIndex, cellIndex, isUp) {
2401
+ while (tableRows[rowIndex] && tableRows[rowIndex].cells[cellIndex].classList.contains(OTHERMONTH_CLASS)) {
2402
+ rowIndex = rowIndex + (isUp ? -1 : 1);
2403
+ }
2404
+ return tableRows[rowIndex].cells[cellIndex];
2405
+ }
2406
+ // eslint-disable-next-line max-len
2407
+ getHorizontalUpDownCell(tableRows, target, curRowIndex, isUp) {
2408
+ const row = tableRows[curRowIndex + (isUp ? -1 : 1)];
2409
+ let cell = row ? row.cells[target.cellIndex] : target;
2410
+ if (cell.classList.contains(OTHERMONTH_CLASS)) {
2411
+ const workCell = row.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
2412
+ const date = new Date(+workCell.getAttribute('data-date'));
2413
+ const query = '[data-date="' + new Date(date.getFullYear(), date.getMonth() + 1, 0).getTime() + '"]';
2414
+ cell = cell.cellIndex < workCell.cellIndex ? workCell : row.querySelector(query);
2415
+ }
2416
+ return cell;
2417
+ }
2418
+ // eslint-disable-next-line max-len
2419
+ getVerticalUpDownCell(tableRows, target, curRowIndex, isUp) {
2420
+ const hasRow = isUp && curRowIndex > 0 || !isUp && curRowIndex < tableRows.length - 1;
2421
+ let targetCell = hasRow ? tableRows[curRowIndex + (isUp ? -1 : 1)].cells[target.cellIndex] : undefined;
2422
+ if (!targetCell || targetCell.classList.contains(OTHERMONTH_CLASS)) {
2423
+ const column = tableRows[curRowIndex].cells[target.cellIndex - (isUp ? 1 : -1)];
2424
+ if (column) {
2425
+ const dateAttr = +target.getAttribute('data-date') - (isUp ? MS_PER_DAY : -MS_PER_DAY);
2426
+ return this.parent.getContentTable().querySelector('.' + WORK_CELLS_CLASS + '[data-date="' + dateAttr + '"]');
2427
+ }
2428
+ targetCell = target;
2429
+ }
2430
+ return targetCell;
2431
+ }
2306
2432
  processLeftRight(target) {
2307
- const tableEle = this.parent.getContentTable();
2433
+ const tableEle = (this.parent.currentView === 'Year' ? target.closest('tbody') : this.parent.getContentTable());
2308
2434
  const curRowIndex = target.parentNode.sectionRowIndex;
2309
2435
  const key = {
2310
2436
  element: tableEle,
@@ -2317,8 +2443,9 @@ class KeyboardInteraction {
2317
2443
  getQuickPopupElement() {
2318
2444
  return (this.parent.isAdaptive ? document.body : this.parent.element).querySelector('.' + POPUP_WRAPPER_CLASS);
2319
2445
  }
2320
- isCancelLeftRightAction(e, isMultiple) {
2321
- if (this.parent.currentView === 'Agenda' || (isMultiple && this.parent.currentView === 'MonthAgenda')) {
2446
+ isCancelLeftRightAction(e, isMultiple, isTimelineYear) {
2447
+ const prevent = this.parent.currentView === 'MonthAgenda' || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS);
2448
+ if (this.parent.currentView === 'Agenda' || (isMultiple && prevent)) {
2322
2449
  return true;
2323
2450
  }
2324
2451
  if (this.isPreventAction(e) && isMultiple) {
@@ -2332,7 +2459,8 @@ class KeyboardInteraction {
2332
2459
  return false;
2333
2460
  }
2334
2461
  processRight(e, isMultiple) {
2335
- if (this.isCancelLeftRightAction(e, isMultiple)) {
2462
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2463
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2336
2464
  return;
2337
2465
  }
2338
2466
  const selectedCells = this.parent.getSelectedElements();
@@ -2353,24 +2481,36 @@ class KeyboardInteraction {
2353
2481
  if (target.classList.contains(WORK_CELLS_CLASS) &&
2354
2482
  (e.target).classList.contains(WORK_CELLS_CLASS)) {
2355
2483
  const key = this.processLeftRight(target);
2356
- if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1) {
2484
+ const targetDate = new Date(+target.getAttribute('data-date'));
2485
+ const isMonthEnd = this.parent.currentView === 'Year' && targetDate.getTime() === lastDateOfMonth(targetDate).getTime();
2486
+ if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1 && !isMonthEnd) {
2357
2487
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex + 1], 'right');
2488
+ if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2489
+ targetCell = this.getTimelineYearTargetCell(key, target, true);
2490
+ }
2358
2491
  if (!isNullOrUndefined(targetCell)) {
2359
2492
  this.selectCells(isMultiple, targetCell);
2360
2493
  }
2361
2494
  }
2362
- else if (key.columnIndex === key.maxIndex - 1) {
2363
- if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1) {
2495
+ else if (key.columnIndex === key.maxIndex - 1 || isMonthEnd) {
2496
+ if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1 && !isMonthEnd) {
2364
2497
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex + 1].cells[0], 'right');
2498
+ const changeTargetCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
2499
+ targetCell = changeTargetCell ? this.getHorizontalLeftRightCell(key, target, true) : targetCell;
2365
2500
  if (!isNullOrUndefined(targetCell)) {
2366
2501
  this.selectCells(isMultiple, targetCell);
2367
2502
  }
2368
2503
  }
2369
2504
  else if (!isMultiple) {
2505
+ if (isMonthEnd && targetDate.getTime() !== this.parent.activeView.getEndDate().getTime()) {
2506
+ this.selectCells(isMultiple, this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + (targetDate.getTime() + MS_PER_DAY) + '"]'));
2507
+ return;
2508
+ }
2370
2509
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
2371
2510
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
2372
2511
  const tableEle = this.parent.getContentTable();
2373
- this.selectCells(false, tableEle.rows[rowIndex].cells[0]);
2512
+ const cell = isMonthEnd ? tableEle.rows[rowIndex].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')') : tableEle.rows[rowIndex].cells[0];
2513
+ this.selectCells(false, cell);
2374
2514
  }
2375
2515
  }
2376
2516
  }
@@ -2389,7 +2529,8 @@ class KeyboardInteraction {
2389
2529
  }
2390
2530
  }
2391
2531
  processLeft(e, isMultiple) {
2392
- if (this.isCancelLeftRightAction(e, isMultiple)) {
2532
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2533
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2393
2534
  return;
2394
2535
  }
2395
2536
  let target = (e.target);
@@ -2410,24 +2551,40 @@ class KeyboardInteraction {
2410
2551
  if ((e.target).classList.contains(WORK_CELLS_CLASS) &&
2411
2552
  target.classList.contains(WORK_CELLS_CLASS)) {
2412
2553
  const key = this.processLeftRight(target);
2413
- if (key.columnIndex > 0 && key.columnIndex < key.maxIndex) {
2554
+ const targetDate = new Date(+target.getAttribute('data-date'));
2555
+ const isMonthStart = this.parent.currentView === 'Year' && targetDate.getTime() === firstDateOfMonth(targetDate).getTime();
2556
+ if (key.columnIndex > 0 && key.columnIndex < key.maxIndex && !isMonthStart) {
2414
2557
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex - 1], 'left');
2558
+ if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
2559
+ targetCell = this.getTimelineYearTargetCell(key, target, false);
2560
+ }
2415
2561
  if (!isNullOrUndefined(targetCell)) {
2416
2562
  this.selectCells(isMultiple, targetCell);
2417
2563
  }
2418
2564
  }
2419
- else if (key.columnIndex === 0) {
2565
+ else if (key.columnIndex === 0 || isMonthStart) {
2420
2566
  if (!this.isInverseTableSelect() && key.rowIndex > 0) {
2421
2567
  targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex - 1].cells[key.maxIndex - 1], 'left');
2568
+ const otherMonthCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
2569
+ targetCell = otherMonthCell ? this.getHorizontalLeftRightCell(key, target, false) : targetCell;
2422
2570
  if (!isNullOrUndefined(targetCell)) {
2423
2571
  this.selectCells(isMultiple, targetCell);
2424
2572
  }
2425
2573
  }
2426
2574
  else if (!isMultiple) {
2575
+ if (isMonthStart && targetDate.getTime() !== this.parent.activeView.getStartDate().getTime()) {
2576
+ this.selectCells(isMultiple, this.parent.element.querySelector('[data-date="' + (targetDate.getTime() - MS_PER_DAY) + '"]'));
2577
+ return;
2578
+ }
2427
2579
  this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
2428
2580
  const tableEle = this.parent.getContentTable();
2429
2581
  const rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
2430
- this.selectCells(false, tableEle.rows[rowIndex].cells[key.maxIndex - 1]);
2582
+ let cell = tableEle.rows[rowIndex].cells[key.maxIndex - 1];
2583
+ if (isMonthStart) {
2584
+ const tbody = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody');
2585
+ cell = tbody.item(tbody.length - 1).querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + this.parent.activeView.getEndDate().getTime() + '"]');
2586
+ }
2587
+ this.selectCells(false, cell);
2431
2588
  }
2432
2589
  }
2433
2590
  }
@@ -2445,6 +2602,29 @@ class KeyboardInteraction {
2445
2602
  }
2446
2603
  }
2447
2604
  }
2605
+ getTimelineYearTargetCell(key, target, isRight) {
2606
+ return this.isInverseTableSelect() ? this.getVerticalLeftRightCell(target, isRight) :
2607
+ this.getHorizontalLeftRightCell(key, target, isRight);
2608
+ }
2609
+ getHorizontalLeftRightCell(key, target, isRight) {
2610
+ const row = key.element.rows[target.parentNode.sectionRowIndex + (isRight ? 1 : -1)];
2611
+ if (row) {
2612
+ const query = isRight ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')'
2613
+ : '[data-date="' + ((+target.getAttribute('data-date')) - MS_PER_DAY) + '"]';
2614
+ return row.querySelector(query);
2615
+ }
2616
+ return target;
2617
+ }
2618
+ getVerticalLeftRightCell(target, isRight) {
2619
+ const date = new Date(+target.getAttribute('data-date'));
2620
+ const start = new Date(date.getFullYear(), date.getMonth() + (isRight ? 1 : -1), 1);
2621
+ const tableEle = this.parent.getContentTable();
2622
+ const targetCell = tableEle.querySelector('[data-date="' + start.getTime() + '"]');
2623
+ if (targetCell.parentNode.sectionRowIndex > target.parentNode.sectionRowIndex) {
2624
+ return targetCell;
2625
+ }
2626
+ return tableEle.querySelector('[data-date="' + new Date(start.getFullYear(), start.getMonth() + 1, 0).getTime() + '"]');
2627
+ }
2448
2628
  calculateNextPrevDate(currentCell, target, type) {
2449
2629
  const initialId = this.initialTarget.getAttribute('data-group-index');
2450
2630
  if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.currentView === 'Month') {
@@ -2488,6 +2668,16 @@ class KeyboardInteraction {
2488
2668
  }
2489
2669
  processTab(e, isReverse) {
2490
2670
  let target = e.target;
2671
+ if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
2672
+ target = target.closest('.e-appointment');
2673
+ this.parent.inlineModule.inlineCrudActions(e.target);
2674
+ }
2675
+ if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
2676
+ if (target.classList.contains(SELECTED_CELL_CLASS)) {
2677
+ this.parent.removeSelectedClass();
2678
+ }
2679
+ return;
2680
+ }
2491
2681
  const popupWrapper = closest(target, '.' + POPUP_WRAPPER_CLASS + ',.' + MORE_POPUP_WRAPPER_CLASS);
2492
2682
  if (popupWrapper && popupWrapper.classList.contains(POPUP_OPEN)) {
2493
2683
  if (popupWrapper.classList.contains(MORE_POPUP_WRAPPER_CLASS)) {
@@ -2529,7 +2719,9 @@ class KeyboardInteraction {
2529
2719
  }
2530
2720
  if (target.classList.contains(APPOINTMENT_CLASS)) {
2531
2721
  let appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
2532
- if (this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0) {
2722
+ const isTimelineYear = this.parent.currentView === 'TimelineYear';
2723
+ const isTimeline = this.parent.activeView.isTimelineView() && !isTimelineYear;
2724
+ if ((isTimeline || isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical') && this.parent.activeViewOptions.group.resources.length > 0) {
2533
2725
  const index = parseInt(target.getAttribute('data-group-index'), 10);
2534
2726
  appElements = [].slice.call(this.parent.element.querySelectorAll(`.${APPOINTMENT_CLASS}[data-group-index="${index}"]`));
2535
2727
  const resCellSelector = `.${RESOURCE_CELLS_CLASS}[data-group-index="${isReverse ? index : index + 1}"]`;
@@ -2578,7 +2770,6 @@ class KeyboardInteraction {
2578
2770
  this.processTabOnResourceCells(target, isReverse);
2579
2771
  }
2580
2772
  }
2581
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2582
2773
  processDelete(e) {
2583
2774
  let activeEle = document.activeElement;
2584
2775
  if (this.parent.currentView === 'MonthAgenda') {
@@ -5579,7 +5770,8 @@ class EventBase {
5579
5770
  }
5580
5771
  eventClick(eventData) {
5581
5772
  const target = eventData.target;
5582
- if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS)) {
5773
+ if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS) ||
5774
+ target.classList.contains(INLINE_SUBJECT_CLASS)) {
5583
5775
  return;
5584
5776
  }
5585
5777
  if ((eventData.ctrlKey || eventData.metaKey) && eventData.which === 1 && this.parent.keyboardInteractionModule) {
@@ -6017,7 +6209,7 @@ class EventBase {
6017
6209
  eventObj[this.parent.eventFields.endTime].getTime() < schedule.endHour.getTime() && start.getTime() === end.getTime();
6018
6210
  return isHourRange || isSameRange;
6019
6211
  }
6020
- allDayExpandScroll(dateHeader, heightPropChanged) {
6212
+ allDayExpandScroll(dateHeader) {
6021
6213
  let indentHeight = 0;
6022
6214
  const headerRows = [].slice.call(this.parent.element.querySelectorAll('.' + HEADER_ROW_CLASS));
6023
6215
  headerRows.forEach((element) => {
@@ -6027,14 +6219,28 @@ class EventBase {
6027
6219
  });
6028
6220
  indentHeight = dateHeader.offsetHeight - indentHeight;
6029
6221
  this.parent.element.querySelector('.' + ALLDAY_CELLS_CLASS).style.height = (indentHeight / 12) + 'em';
6030
- const content = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
6031
- if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged)) {
6222
+ if (this.parent.uiStateValues.expand) {
6032
6223
  addClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
6033
6224
  }
6034
6225
  else {
6035
6226
  removeClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
6036
6227
  }
6037
6228
  }
6229
+ updateEventMinimumDuration(startEndHours, startTime, endTime) {
6230
+ const eventDuration = (getUniversalTime(endTime) - getUniversalTime(startTime)) / MS_PER_MINUTE;
6231
+ if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
6232
+ const tempEnd = new Date(startTime);
6233
+ tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
6234
+ endTime = tempEnd;
6235
+ if (endTime.getTime() > startEndHours.endHour.getTime()) {
6236
+ const tempStart = new Date(startEndHours.endHour.getTime());
6237
+ tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
6238
+ startTime = tempStart;
6239
+ endTime = startEndHours.endHour;
6240
+ }
6241
+ }
6242
+ return { startDate: startTime, endDate: endTime };
6243
+ }
6038
6244
  unWireEvents() {
6039
6245
  const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
6040
6246
  for (const element of appElements) {
@@ -6436,18 +6642,21 @@ class VerticalEvent extends EventBase {
6436
6642
  if (currentDay.length === 0) {
6437
6643
  currentDate = resetTime(renderedDate[0]);
6438
6644
  }
6439
- const fieldMapping = this.parent.eventFields;
6440
- const startEndHours = getStartEndHours(currentDate, this.startHour, this.endHour);
6645
+ const field = this.parent.eventFields;
6646
+ const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
6441
6647
  const event = extend({}, record, null, true);
6442
6648
  event.isSpanned = { isBottom: false, isTop: false };
6443
- if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) {
6444
- event[fieldMapping.startTime] = startEndHours.startHour;
6649
+ if (record[field.startTime].getTime() < schedule.startHour.getTime()) {
6650
+ event[field.startTime] = schedule.startHour;
6445
6651
  event.isSpanned.isTop = true;
6446
6652
  }
6447
- if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) {
6448
- event[fieldMapping.endTime] = startEndHours.endHour;
6653
+ if (record[field.endTime].getTime() > schedule.endHour.getTime()) {
6654
+ event[field.endTime] = schedule.endHour;
6449
6655
  event.isSpanned.isBottom = true;
6450
6656
  }
6657
+ const eventDates = this.updateEventMinimumDuration(schedule, event[field.startTime], event[field.endTime]);
6658
+ event[field.startTime] = eventDates.startDate;
6659
+ event[field.endTime] = eventDates.endDate;
6451
6660
  return event;
6452
6661
  }
6453
6662
  renderAllDayEvents(eventObj, dayIndex, resource, dayCount, inline) {
@@ -6976,12 +7185,13 @@ class MonthEvent extends EventBase {
6976
7185
  setStyleAttribute(cell, { 'height': height + 'px' });
6977
7186
  });
6978
7187
  }
6979
- const cellDetail = this.workCells.slice(-1)[0].getBoundingClientRect();
7188
+ const cellDetail = this.workCells[this.parent.activeView.isTimelineView() ?
7189
+ 0 : this.workCells.length - 1].getBoundingClientRect();
6980
7190
  this.cellWidth = cellDetail.width;
6981
7191
  this.cellHeight = cellDetail.height;
6982
7192
  this.dateRender = dateRender;
6983
7193
  const filteredDates = this.getRenderedDates(dateRender);
6984
- this.getSlotDates(workDays);
7194
+ this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
6985
7195
  this.processBlockEvents(blockList, resIndex, resData);
6986
7196
  for (const event of eventsList) {
6987
7197
  if (this.parent.resourceBase && !resData) {
@@ -7607,6 +7817,10 @@ class TimelineEvent extends MonthEvent {
7607
7817
  const eventData = event.data;
7608
7818
  startTime = this.getStartTime(event, eventData);
7609
7819
  endTime = this.getEndTime(event, eventData);
7820
+ const startEndHours = getStartEndHours(event[this.fields.startTime], this.startHour, this.endHour);
7821
+ const eventDates = this.updateEventMinimumDuration(startEndHours, startTime, endTime);
7822
+ startTime = eventDates.startDate;
7823
+ endTime = eventDates.endDate;
7610
7824
  this.day = this.parent.getIndexOfDate(this.dateRender, resetTime(new Date(startTime.getTime())));
7611
7825
  if (this.day < 0) {
7612
7826
  return;
@@ -7993,11 +8207,11 @@ class InlineEdit {
7993
8207
  if (this.parent.quickPopup) {
7994
8208
  this.parent.quickPopup.quickPopupHide();
7995
8209
  }
7996
- const moreWrapper = this.parent.element.querySelector('.e-more-popup-wrapper ');
7997
- if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
7998
- this.parent.quickPopup.morePopup.hide();
7999
- }
8000
8210
  if (args.type === 'Cell') {
8211
+ const moreWrapper = this.parent.element.querySelector('.' + MORE_POPUP_WRAPPER_CLASS);
8212
+ if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
8213
+ this.parent.quickPopup.morePopup.hide();
8214
+ }
8001
8215
  this.removeInlineAppointmentElement();
8002
8216
  this.cellEdit(args);
8003
8217
  }
@@ -8060,8 +8274,8 @@ class InlineEdit {
8060
8274
  '.e-inner-wrap' : '.e-appointment-details';
8061
8275
  args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);
8062
8276
  }
8277
+ inlineSubject.focus();
8063
8278
  }
8064
- inlineSubject.focus();
8065
8279
  inlineSubject.setSelectionRange(subject.length, subject.length);
8066
8280
  }
8067
8281
  createVerticalViewInline(saveObj, dayIndex, resIndex, daysCount) {
@@ -8155,6 +8369,9 @@ class InlineEdit {
8155
8369
  if (target && target.value !== '') {
8156
8370
  this.inlineCrudActions(target);
8157
8371
  }
8372
+ else {
8373
+ this.removeInlineAppointmentElement();
8374
+ }
8158
8375
  }
8159
8376
  inlineCrudActions(target) {
8160
8377
  if (closest(target, '.' + INLINE_APPOINTMENT_CLASS)) {
@@ -9188,6 +9405,9 @@ class QuickPopups {
9188
9405
  }
9189
9406
  closeClick(event) {
9190
9407
  this.dialogEvent = event;
9408
+ if (this.parent.currentView === 'Year' && this.parent.activeCellsData && this.parent.activeCellsData.element) {
9409
+ this.parent.selectCell(this.parent.activeCellsData.element);
9410
+ }
9191
9411
  this.quickPopupHide();
9192
9412
  this.morePopup.hide();
9193
9413
  }
@@ -9771,6 +9991,7 @@ const INTERVALCLASS = 'e-interval';
9771
9991
  const DAYWRAPPER = 'e-days';
9772
9992
  const WEEKWRAPPER = 'e-non-week';
9773
9993
  const WEEKPOSITION = 'e-week-position';
9994
+ const DAYPOSITION = 'e-day-position';
9774
9995
  const YEAREXPANDERWRAPPER = 'e-year-expander';
9775
9996
  const YEAREXPANDERELEMENT = 'e-year-expander-element';
9776
9997
  const MONETHEXPANDERWRAPPER = 'e-month-expander';
@@ -10115,7 +10336,6 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10115
10336
  }
10116
10337
  });
10117
10338
  this.endType.appendTo(this.element.querySelector('.' + ENDONELEMENT));
10118
- // eslint-disable-next-line @typescript-eslint/ban-types
10119
10339
  const renderDropDownList = (dropDownData) => {
10120
10340
  return new DropDownList({
10121
10341
  dataSource: dropDownData,
@@ -10477,7 +10697,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
10477
10697
  '<td><div class="' + INPUTWARAPPER + ' ' + WEEKPOSITION + '" >' +
10478
10698
  '<input type="text" tabindex="0" class="' + MONTHPOS + '"title="' + this.localeObj.getConstant('monthPosition') + '" />' +
10479
10699
  '</div></td>' +
10480
- '<td><div class="' + INPUTWARAPPER + '" style="min-width: 120px;">' +
10700
+ '<td><div class="' + INPUTWARAPPER + ' ' + DAYPOSITION + '">' +
10481
10701
  '<input type="text" tabindex="0" class="' + MONTHWEEK + '"title="' + this.localeObj.getConstant('monthWeek') + '" />' +
10482
10702
  '</div></td></tr></table>' +
10483
10703
  '</div></div>' +
@@ -12853,7 +13073,12 @@ class Render {
12853
13073
  }
12854
13074
  initializeLayout(viewName) {
12855
13075
  if (this.parent.activeView) {
12856
- this.parent.resetTemplates();
13076
+ const templates = [
13077
+ 'cellTemplate', 'eventTemplate', 'tooltipTemplate', 'majorSlotTemplate', 'minorSlotTemplate',
13078
+ 'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'mothHeaderTemplate',
13079
+ 'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate'
13080
+ ];
13081
+ this.parent.resetTemplates(templates);
12857
13082
  this.parent.activeView.removeEventListener();
12858
13083
  this.parent.activeView.destroy();
12859
13084
  }
@@ -13927,12 +14152,15 @@ __decorate$6([
13927
14152
  __decorate$6([
13928
14153
  Property(false)
13929
14154
  ], EventSettings.prototype, "enableTooltip", void 0);
13930
- __decorate$6([
13931
- Property()
13932
- ], EventSettings.prototype, "tooltipTemplate", void 0);
13933
14155
  __decorate$6([
13934
14156
  Property('AllDayRow')
13935
14157
  ], EventSettings.prototype, "spannedEventPlacement", void 0);
14158
+ __decorate$6([
14159
+ Property(1)
14160
+ ], EventSettings.prototype, "minimumEventDuration", void 0);
14161
+ __decorate$6([
14162
+ Property()
14163
+ ], EventSettings.prototype, "tooltipTemplate", void 0);
13936
14164
  __decorate$6([
13937
14165
  Property()
13938
14166
  ], EventSettings.prototype, "resourceColorField", void 0);
@@ -14381,6 +14609,7 @@ class ResourceBase {
14381
14609
  targetType: 'relative',
14382
14610
  actionOnScroll: 'none',
14383
14611
  content: this.treeViewObj.element,
14612
+ relateTo: this.parent.element.querySelector('.' + TABLE_CONTAINER_CLASS),
14384
14613
  enableRtl: this.parent.enableRtl,
14385
14614
  hideAnimation: { name: 'SlideLeftOut', duration: 500 },
14386
14615
  showAnimation: { name: 'SlideLeftIn', duration: 500 },
@@ -15279,13 +15508,19 @@ let Schedule = class Schedule extends Component {
15279
15508
  timeFormat: this.internalTimeFormat,
15280
15509
  group: group,
15281
15510
  headerRows: this.headerRows,
15282
- orientation: 'Horizontal'
15511
+ orientation: 'Horizontal',
15512
+ numberOfWeeks: 0,
15513
+ displayDate: null
15283
15514
  };
15284
15515
  const viewOptions = this.viewCollections[this.viewIndex];
15285
15516
  const viewsData = extend(scheduleOptions, viewOptions, undefined, true);
15286
15517
  if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {
15287
15518
  viewsData.firstDayOfWeek = this.firstDayOfWeek;
15288
15519
  }
15520
+ if (viewsData.displayDate) {
15521
+ viewsData.displayDate = viewsData.displayDate instanceof Date ? new Date(viewsData.displayDate.getTime()) :
15522
+ new Date(viewsData.displayDate);
15523
+ }
15289
15524
  return viewsData;
15290
15525
  }
15291
15526
  initializeDataModule() {
@@ -15592,7 +15827,7 @@ let Schedule = class Schedule extends Component {
15592
15827
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
15593
15828
  this.uiStateValues = {
15594
15829
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
15595
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false
15830
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
15596
15831
  };
15597
15832
  }
15598
15833
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -16368,7 +16603,7 @@ let Schedule = class Schedule extends Component {
16368
16603
  if (dateHeader.classList.contains(ALLDAY_APPOINTMENT_AUTO)) {
16369
16604
  removeClass([dateHeader], ALLDAY_APPOINTMENT_AUTO);
16370
16605
  }
16371
- this.eventBase.allDayExpandScroll(dateHeader, true);
16606
+ this.eventBase.allDayExpandScroll(dateHeader);
16372
16607
  }
16373
16608
  if (!this.uiStateValues.expand) {
16374
16609
  allDayRow.style.height = '';
@@ -16556,6 +16791,7 @@ let Schedule = class Schedule extends Component {
16556
16791
  }
16557
16792
  break;
16558
16793
  case 'spannedEventPlacement':
16794
+ case 'minimumEventDuration':
16559
16795
  case 'enableMaxHeight':
16560
16796
  case 'enableIndicator':
16561
16797
  this.refreshEvents(false);
@@ -16928,7 +17164,7 @@ let Schedule = class Schedule extends Component {
16928
17164
  */
16929
17165
  exportToExcel(excelExportOptions) {
16930
17166
  if (this.excelExportModule) {
16931
- this.excelExportModule.initializeExcelExport(excelExportOptions || {});
17167
+ this.excelExportModule.initializeExcelExport(excelExportOptions);
16932
17168
  }
16933
17169
  else {
16934
17170
  throw Error('Inject ExcelExport module');
@@ -17112,6 +17348,9 @@ let Schedule = class Schedule extends Component {
17112
17348
  this.crudModule.refreshDataManager();
17113
17349
  }
17114
17350
  else {
17351
+ if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
17352
+ this.resetTemplates(['eventTemplate']);
17353
+ }
17115
17354
  const eventsData = this.eventsData || [];
17116
17355
  const blockData = this.blockData || [];
17117
17356
  const data = eventsData.concat(blockData);
@@ -17366,6 +17605,7 @@ let Schedule = class Schedule extends Component {
17366
17605
  this.eventTooltip = null;
17367
17606
  }
17368
17607
  this.destroyPopups();
17608
+ this.hideSpinner();
17369
17609
  this.unWireEvents();
17370
17610
  this.destroyHeaderModule();
17371
17611
  if (this.eventTooltip) {
@@ -18172,9 +18412,9 @@ class Resize extends ActionBase {
18172
18412
  bottom: resizeTarget.classList.contains(BOTTOM_RESIZE_HANDLER)
18173
18413
  };
18174
18414
  this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
18175
- const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
18176
- this.actionObj.cellWidth = workCell.offsetWidth;
18177
- this.actionObj.cellHeight = workCell.offsetHeight;
18415
+ const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS).getBoundingClientRect();
18416
+ this.actionObj.cellWidth = workCell.width;
18417
+ this.actionObj.cellHeight = workCell.height;
18178
18418
  const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
18179
18419
  if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
18180
18420
  const tr = this.parent.getContentTable().querySelector('tr');
@@ -18183,8 +18423,9 @@ class Resize extends ActionBase {
18183
18423
  for (const td of tdCollections) {
18184
18424
  noOfDays += parseInt(td.getAttribute('colspan'), 10);
18185
18425
  }
18186
- this.actionObj.cellWidth = tr.offsetWidth / noOfDays;
18187
- this.actionObj.cellHeight = tr.offsetHeight;
18426
+ const trRect = tr.getBoundingClientRect();
18427
+ this.actionObj.cellWidth = trRect.width / noOfDays;
18428
+ this.actionObj.cellHeight = trRect.height;
18188
18429
  }
18189
18430
  const pages = this.getPageCoordinates(e);
18190
18431
  this.actionObj.X = pages.pageX;
@@ -18429,12 +18670,12 @@ class Resize extends ActionBase {
18429
18670
  const eventEnd = new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());
18430
18671
  let resizeTime;
18431
18672
  let isDateHeader = false;
18673
+ let headerName = this.parent.currentView;
18432
18674
  const isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1;
18433
18675
  const isTimelineMonth = this.parent.currentView === 'TimelineMonth';
18434
18676
  const isWithoutScale = isTimelineMonth || isTimeViews && !this.parent.activeViewOptions.timeScale.enable;
18435
18677
  if (this.parent.activeView.isTimelineView()) {
18436
18678
  const tr = this.parent.getContentTable().querySelector('tr');
18437
- let headerName = this.parent.currentView;
18438
18679
  if (this.parent.activeViewOptions.headerRows.length > 0) {
18439
18680
  const rows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
18440
18681
  headerName = rows.slice(-1)[0];
@@ -18446,6 +18687,11 @@ class Resize extends ActionBase {
18446
18687
  let cellIndex = 0;
18447
18688
  const tdCollections = [].slice.call(tr.children);
18448
18689
  let isLastCell = false;
18690
+ const pixelsPerMinute = this.actionObj.cellWidth / (this.parent.activeViewOptions.timeScale.interval /
18691
+ this.parent.activeViewOptions.timeScale.slotCount);
18692
+ let offset = parseFloat(this.parent.enableRtl ? this.actionObj.clone.style.right :
18693
+ this.actionObj.clone.style.left);
18694
+ offset = Math.round(offset / pixelsPerMinute) * pixelsPerMinute;
18449
18695
  if (['Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1) {
18450
18696
  let noOfDays = 0;
18451
18697
  for (const td of tdCollections) {
@@ -18453,28 +18699,28 @@ class Resize extends ActionBase {
18453
18699
  }
18454
18700
  let offsetValue = this.parent.enableRtl ? parseInt(this.actionObj.clone.style.right, 10) :
18455
18701
  parseInt(this.actionObj.clone.style.left, 10);
18702
+ offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
18456
18703
  if (!isLeft) {
18457
- offsetValue += (this.actionObj.clone.offsetWidth - this.actionObj.cellWidth);
18704
+ offsetValue += (this.actionObj.clone.getBoundingClientRect().width - this.actionObj.cellWidth);
18458
18705
  }
18459
- cellIndex = Math.floor(offsetValue / Math.floor(tr.offsetWidth / noOfDays));
18706
+ cellIndex = Math.floor(offsetValue / Math.floor(tr.getBoundingClientRect().width / noOfDays));
18460
18707
  isDateHeader = isTimeViews && headerName === 'Date';
18461
- cellIndex = isLeft ? cellIndex : (isTimelineMonth || isDateHeader) ? cellIndex + 1 : cellIndex;
18708
+ cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
18462
18709
  isLastCell = cellIndex === tdCollections.length;
18463
18710
  cellIndex = (cellIndex < 0) ? 0 : (cellIndex >= noOfDays) ? noOfDays - 1 : cellIndex;
18464
18711
  }
18465
18712
  else {
18466
18713
  const cellWidth = this.actionObj.cellWidth;
18467
- cellIndex = isLeft ? Math.floor(this.actionObj.clone.offsetLeft / this.actionObj.cellWidth) :
18468
- Math.ceil((this.actionObj.clone.offsetLeft + (this.actionObj.clone.offsetWidth - cellWidth)) /
18469
- this.actionObj.cellWidth);
18714
+ cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
18715
+ Math.ceil((offset + (this.actionObj.clone.getBoundingClientRect().width - cellWidth)) / this.actionObj.cellWidth);
18470
18716
  if (this.parent.enableRtl) {
18471
18717
  let cellOffsetWidth = 0;
18472
18718
  if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
18473
18719
  !isTimelineMonth)) {
18474
18720
  cellOffsetWidth = this.actionObj.cellWidth;
18475
18721
  }
18476
- const offsetWidth = (Math.floor(parseInt(this.actionObj.clone.style.right, 10) / this.actionObj.cellWidth) *
18477
- this.actionObj.cellWidth) + (isLeft ? 0 : this.actionObj.clone.offsetWidth - cellOffsetWidth);
18722
+ const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
18723
+ this.actionObj.cellWidth) + (isLeft ? 0 : this.actionObj.clone.getBoundingClientRect().width - cellOffsetWidth);
18478
18724
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
18479
18725
  }
18480
18726
  isLastCell = cellIndex === tdCollections.length;
@@ -18492,13 +18738,11 @@ class Resize extends ActionBase {
18492
18738
  resizeTime = new Date(resizeDate.setHours(resizeTime.getHours(), resizeTime.getMinutes(), resizeTime.getSeconds()));
18493
18739
  }
18494
18740
  else {
18495
- let offsetValue = this.parent.enableRtl ? parseFloat(this.actionObj.clone.style.right) :
18496
- parseFloat(this.actionObj.clone.style.left);
18497
18741
  if (!isLeft) {
18498
- offsetValue += this.actionObj.clone.offsetWidth;
18742
+ offset += this.actionObj.clone.getBoundingClientRect().width;
18499
18743
  }
18500
18744
  let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
18501
- (offsetValue - Math.floor(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth));
18745
+ (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
18502
18746
  spanMinutes = (isLastCell || (!isLeft && spanMinutes === 0)) ? this.actionObj.slotInterval : spanMinutes;
18503
18747
  resizeTime = new Date(resizeDate.getTime());
18504
18748
  resizeTime.setMinutes(resizeTime.getMinutes() + spanMinutes);
@@ -18507,9 +18751,10 @@ class Resize extends ActionBase {
18507
18751
  }
18508
18752
  else {
18509
18753
  const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
18510
- const originalWidth = Math.ceil((isLeft ? this.actionObj.element.offsetWidth : 0) / this.actionObj.cellWidth) *
18511
- this.actionObj.cellWidth;
18512
- const noOfDays = Math.ceil((this.actionObj.clone.offsetWidth - originalWidth) / this.actionObj.cellWidth);
18754
+ const originalWidth = Math.ceil((isLeft ? this.actionObj.element.getBoundingClientRect().width : 0) /
18755
+ this.actionObj.cellWidth) * this.actionObj.cellWidth;
18756
+ const noOfDays = Math.ceil((this.actionObj.clone.getBoundingClientRect().width - originalWidth) /
18757
+ this.actionObj.cellWidth);
18513
18758
  const tr = closest(this.actionObj.clone, 'tr');
18514
18759
  let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
18515
18760
  dayIndex = this.getIndex(dayIndex);
@@ -18529,8 +18774,8 @@ class Resize extends ActionBase {
18529
18774
  }
18530
18775
  else {
18531
18776
  const isTimeScaleViews = isTimeViews && this.parent.activeViewOptions.timeScale.enable;
18532
- let resizeEnd = ((!isTimeScaleViews || isDateHeader) && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ?
18533
- addDays(resizeTime, 1) : resizeTime;
18777
+ let resizeEnd = ((!isTimeScaleViews || isDateHeader || isTimeViews && ['Week', 'Month', 'Year'].indexOf(headerName) > -1)
18778
+ && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ? addDays(resizeTime, 1) : resizeTime;
18534
18779
  if (isWithoutScale && (resizeEnd.getTime() - eventStart.getTime()) <= 0) {
18535
18780
  resizeEnd = addDays(resetTime(eventStart), 1);
18536
18781
  }
@@ -18567,29 +18812,30 @@ class Resize extends ActionBase {
18567
18812
  const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
18568
18813
  const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
18569
18814
  const targetWidth = isTimelineView ?
18570
- (this.actionObj.element.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth :
18571
- this.parent.currentView === 'Month' ? this.actionObj.element.offsetWidth :
18572
- Math.ceil(this.actionObj.element.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth;
18815
+ (this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth :
18816
+ this.parent.currentView === 'Month' ? this.actionObj.element.getBoundingClientRect().width :
18817
+ Math.ceil(this.actionObj.element.getBoundingClientRect().width / this.actionObj.cellWidth) * this.actionObj.cellWidth;
18573
18818
  let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
18819
+ const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
18574
18820
  if (isTimeViews) {
18575
- offsetWidth = targetWidth + (isLeft ? (Math.ceil(pageWidth / slotInterval) * slotInterval) :
18576
- (Math.floor(pageWidth / slotInterval) * slotInterval));
18821
+ offsetWidth = targetWidth + (Math.ceil(pageWidth / slotInterval) * slotInterval);
18822
+ offsetWidth = (Math.round((left + offsetWidth) / slotInterval) * slotInterval) - left;
18577
18823
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
18578
18824
  }
18579
18825
  let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
18580
- this.actionObj.clone.offsetWidth : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
18826
+ this.actionObj.clone.getBoundingClientRect().width : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
18581
18827
  if (this.parent.enableRtl) {
18582
18828
  let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
18583
18829
  -(offsetWidth - this.actionObj.cellWidth);
18584
18830
  rightValue = isTimelineView ? rightValue : isLeft ? 0 : rightValue > 0 ? 0 : rightValue;
18585
18831
  if (isTimelineView && !isLeft) {
18586
- rightValue = Math.ceil((this.actionObj.element.offsetLeft + (this.actionObj.element.offsetWidth +
18832
+ rightValue = Math.ceil((this.actionObj.element.offsetLeft + (this.actionObj.element.getBoundingClientRect().width +
18587
18833
  (this.actionObj.pageX - this.actionObj.X))) / slotInterval) * slotInterval;
18588
18834
  rightValue = rightValue < 0 ? Math.abs(rightValue) : -rightValue;
18589
18835
  }
18590
18836
  rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
18591
18837
  styles.right = formatUnit(rightValue);
18592
- width = width + rightValue > this.scrollArgs.width ? this.actionObj.clone.offsetWidth : width;
18838
+ width = width + rightValue > this.scrollArgs.width ? this.actionObj.clone.getBoundingClientRect().width : width;
18593
18839
  }
18594
18840
  else {
18595
18841
  let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
@@ -18597,12 +18843,12 @@ class Resize extends ActionBase {
18597
18843
  if (isTimelineView) {
18598
18844
  offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
18599
18845
  if (this.parent.enableRtl) {
18600
- offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.actionObj.clone.offsetWidth) ?
18601
- parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
18846
+ offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.actionObj.clone.getBoundingClientRect().width)
18847
+ ? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
18602
18848
  }
18603
18849
  else {
18604
- offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.actionObj.clone.offsetWidth &&
18605
- this.actionObj.clone.offsetWidth === this.actionObj.cellWidth) ?
18850
+ offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.actionObj.clone.getBoundingClientRect().width &&
18851
+ this.actionObj.clone.getBoundingClientRect().width === this.actionObj.cellWidth) ?
18606
18852
  parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
18607
18853
  }
18608
18854
  }
@@ -18612,9 +18858,10 @@ class Resize extends ActionBase {
18612
18858
  Math.ceil(Math.abs(offsetLeft) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
18613
18859
  if (offsetLeft < 0) {
18614
18860
  offsetLeft = 0;
18615
- width = this.actionObj.clone.offsetWidth;
18861
+ width = this.actionObj.clone.getBoundingClientRect().width;
18616
18862
  }
18617
- const cloneWidth = Math.ceil(this.actionObj.clone.offsetWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth;
18863
+ const cloneWidth = Math.ceil(this.actionObj.clone.getBoundingClientRect().width / this.actionObj.cellWidth) *
18864
+ this.actionObj.cellWidth;
18618
18865
  if (isLeft) {
18619
18866
  styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
18620
18867
  (Math.ceil((targetWidth - cloneWidth) / this.actionObj.cellWidth) * this.actionObj.cellWidth) : offsetLeft);
@@ -19117,7 +19364,7 @@ class YearEvent extends TimelineEvent {
19117
19364
  }
19118
19365
  }
19119
19366
  else {
19120
- if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() > dateStart)) ||
19367
+ if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() >= dateStart)) ||
19121
19368
  (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
19122
19369
  appointmentsList.push(app);
19123
19370
  }
@@ -19295,7 +19542,9 @@ class DragAndDrop extends ActionBase {
19295
19542
  const eventGuid = this.actionObj.element.getAttribute('data-guid');
19296
19543
  this.actionObj.event = this.parent.eventBase.getEventByGuid(eventGuid);
19297
19544
  const eventObj = extend({}, this.actionObj.event, null, true);
19298
- this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
19545
+ if (!isNullOrUndefined(eventObj)) {
19546
+ this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
19547
+ }
19299
19548
  const dragArgs = {
19300
19549
  cancel: false,
19301
19550
  data: eventObj,
@@ -19712,7 +19961,7 @@ class DragAndDrop extends ActionBase {
19712
19961
  return;
19713
19962
  }
19714
19963
  const td = tr.children[colIndex];
19715
- if (this.parent.activeViewOptions.group.resources.length > 0) {
19964
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19716
19965
  this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
19717
19966
  }
19718
19967
  let dragStart$$1;
@@ -19978,7 +20227,7 @@ class DragAndDrop extends ActionBase {
19978
20227
  const renderDates = this.getRenderedDates();
19979
20228
  const events = this.parent.eventBase.splitEvent(event, renderDates);
19980
20229
  let query = `.e-all-day-cells[data-date="${events[0][this.parent.eventFields.startTime].getTime()}"]`;
19981
- if (this.parent.activeViewOptions.group.resources.length > 0) {
20230
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
19982
20231
  query = query.concat('[data-group-index = "' + this.actionObj.groupIndex + '"]');
19983
20232
  }
19984
20233
  const cell = [].slice.call(this.parent.element.querySelectorAll(query));
@@ -20176,7 +20425,13 @@ class DragAndDrop extends ActionBase {
20176
20425
  if (this.parent.eventDragArea) {
20177
20426
  const targetDate = this.parent.getDateFromElement(e.target);
20178
20427
  if (!isNullOrUndefined(targetDate)) {
20179
- eventStart = targetDate;
20428
+ if (!this.parent.activeViewOptions.timeScale.enable || (this.parent.currentView === 'TimelineMonth')) {
20429
+ const eventSrt = eventObj[this.parent.eventFields.startTime];
20430
+ eventStart = new Date(targetDate.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds()));
20431
+ }
20432
+ else {
20433
+ eventStart = targetDate;
20434
+ }
20180
20435
  }
20181
20436
  }
20182
20437
  const eventEnd = new Date(eventStart.getTime());
@@ -20605,6 +20860,10 @@ class ViewBase {
20605
20860
  return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
20606
20861
  }
20607
20862
  isCurrentMonth(date) {
20863
+ if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
20864
+ return this.parent.activeView.getStartDate().getTime() <= this.parent.getCurrentTime().getTime() &&
20865
+ this.parent.activeView.getEndDate().getTime() >= this.parent.getCurrentTime().getTime();
20866
+ }
20608
20867
  return date.getFullYear() ===
20609
20868
  this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
20610
20869
  }
@@ -20827,7 +21086,7 @@ class ViewBase {
20827
21086
  if (this.isTimelineView()) {
20828
21087
  const colElements = this.getColElements();
20829
21088
  const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
20830
- const colWidth = Math.ceil(contentBody.offsetWidth / (colElements.length / 2));
21089
+ const colWidth = (contentBody.getBoundingClientRect().width / (colElements.length / 2));
20831
21090
  colElements.forEach((col) => setStyleAttribute(col, { 'width': formatUnit(colWidth) }));
20832
21091
  if (content.offsetHeight !== content.clientHeight) {
20833
21092
  const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
@@ -20835,6 +21094,13 @@ class ViewBase {
20835
21094
  setStyleAttribute(resourceColumn, { 'height': formatUnit(content.clientHeight) });
20836
21095
  }
20837
21096
  }
21097
+ const cssClass = `.${HEADER_CELLS_CLASS},.${TIME_SLOT_CLASS},.${HEADER_WEEK_CELLS_CLASS},.${HEADER_MONTH_CELLS_CLASS},.${HEADER_YEAR_CELLS_CLASS}`;
21098
+ const headerCellElements = [].slice.call(this.element.querySelectorAll(cssClass));
21099
+ headerCellElements.forEach((ele) => {
21100
+ const colSpan = isNullOrUndefined(ele.getAttribute('colspan')) ? '1' : ele.getAttribute('colspan');
21101
+ const headerCellColSpan = parseInt(colSpan, 10);
21102
+ setStyleAttribute(ele, { 'width': formatUnit(colWidth * headerCellColSpan) });
21103
+ });
20838
21104
  }
20839
21105
  }
20840
21106
  resetColWidth() {
@@ -21872,10 +22138,11 @@ class Month extends ViewBase {
21872
22138
  getDateSlots(renderDates, workDays) {
21873
22139
  const count = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH : workDays.length;
21874
22140
  const dateSlots = [];
22141
+ const isCurrentMonth = this.isCurrentMonth(this.parent.selectedDate);
21875
22142
  for (let col = 0; col < count; col++) {
21876
22143
  const classList$$1 = [HEADER_CELLS_CLASS];
21877
22144
  const currentDateIndex = renderDates.slice(0, count).map((date) => date.getDay());
21878
- if (this.isCurrentMonth(this.parent.selectedDate) && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
22145
+ if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
21879
22146
  classList$$1.push(CURRENT_DAY_CLASS);
21880
22147
  }
21881
22148
  dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList$$1, colSpan: 1, workDays: workDays });
@@ -21914,6 +22181,9 @@ class Month extends ViewBase {
21914
22181
  this.renderResourceMobileLayout();
21915
22182
  }
21916
22183
  this.parent.notify(contentReady, {});
22184
+ if (this.parent.uiStateValues.isCustomMonth) {
22185
+ this.parent.uiStateValues.isCustomMonth = false;
22186
+ }
21917
22187
  }
21918
22188
  refreshHeader() {
21919
22189
  remove(this.element.querySelector('tbody tr'));
@@ -22096,7 +22366,7 @@ class Month extends ViewBase {
22096
22366
  return slotDatas;
22097
22367
  }
22098
22368
  updateClassList(data) {
22099
- if (this.isOtherMonth(data.date)) {
22369
+ if (!this.isCustomMonth() && this.isOtherMonth(data.date)) {
22100
22370
  data.className.push(OTHERMONTH_CLASS);
22101
22371
  }
22102
22372
  if (!this.parent.isMinMaxDate(data.date)) {
@@ -22205,15 +22475,34 @@ class Month extends ViewBase {
22205
22475
  }
22206
22476
  }
22207
22477
  getMonthStart(currentDate) {
22208
- const monthStart = getWeekFirstDate(this.parent.calendarUtil.firstDateOfMonth(currentDate), this.parent.activeViewOptions.firstDayOfWeek);
22209
- const start = new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
22210
- return start;
22478
+ const useDisplayDate = this.parent.currentView === 'Month' && !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && (this.parent.uiStateValues.isCustomMonth || this.isCustomRange());
22479
+ const date = useDisplayDate ? this.parent.activeViewOptions.displayDate : !(this.parent.uiStateValues.isCustomMonth ||
22480
+ this.isCustomRange()) && this.isCustomMonth() ? currentDate : this.parent.calendarUtil.firstDateOfMonth(currentDate);
22481
+ const monthStart = getWeekFirstDate(date, this.parent.activeViewOptions.firstDayOfWeek);
22482
+ return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
22211
22483
  }
22212
22484
  getMonthEnd(currentDate) {
22213
- const endDate = addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
22214
- const lastWeekOfMonth = getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
22215
- const monthEnd = addDays(lastWeekOfMonth, WEEK_LENGTH - 1);
22216
- return monthEnd;
22485
+ if (this.isCustomMonth()) {
22486
+ const start = this.getMonthStart(currentDate);
22487
+ const numberOfDays = WEEK_LENGTH * (this.parent.activeViewOptions.numberOfWeeks > 0 ?
22488
+ this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS);
22489
+ return addDays(start, (numberOfDays - 1));
22490
+ }
22491
+ else {
22492
+ const endDate = addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
22493
+ const lastWeekOfMonth = getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
22494
+ return addDays(lastWeekOfMonth, WEEK_LENGTH - 1);
22495
+ }
22496
+ }
22497
+ isCustomRange() {
22498
+ const dates = this.parent.getCurrentViewDates();
22499
+ if (dates && dates.length > 0) {
22500
+ const selectedTime = resetTime(this.parent.selectedDate).getTime();
22501
+ const weekFirstDate = getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek);
22502
+ return !(selectedTime >= getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
22503
+ selectedTime <= addDays(weekFirstDate, 6).getTime());
22504
+ }
22505
+ return false;
22217
22506
  }
22218
22507
  getRenderDates(workDays) {
22219
22508
  const renderDates = [];
@@ -22243,34 +22532,57 @@ class Month extends ViewBase {
22243
22532
  return renderDates;
22244
22533
  }
22245
22534
  getNextPreviousDate(type) {
22246
- if (type === 'next') {
22247
- return addMonths(this.parent.selectedDate, this.parent.activeViewOptions.interval);
22535
+ if (this.isCustomMonth()) {
22536
+ const dates = this.parent.getCurrentViewDates();
22537
+ const date = getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
22538
+ : dates[0], this.parent.activeViewOptions.firstDayOfWeek);
22539
+ return addDays(date, type === 'next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
22540
+ this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS) * WEEK_LENGTH);
22248
22541
  }
22249
22542
  else {
22250
- return addMonths(this.parent.selectedDate, -(this.parent.activeViewOptions.interval));
22543
+ return addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
22251
22544
  }
22252
22545
  }
22546
+ getStartDate() {
22547
+ return this.getMonthStart(this.parent.selectedDate);
22548
+ }
22549
+ getEndDate() {
22550
+ return this.getMonthEnd(this.parent.selectedDate);
22551
+ }
22253
22552
  getEndDateFromStartDate(start) {
22254
22553
  return addDays(new Date(start.getTime()), 1);
22255
22554
  }
22256
22555
  getDateRangeText() {
22257
22556
  if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
22258
- if (this.parent.activeViewOptions.interval > 1) {
22259
- const endDate = addMonths(lastDateOfMonth(this.parent.selectedDate), this.parent.activeViewOptions.interval - 1);
22260
- if (this.parent.selectedDate.getFullYear() === endDate.getFullYear()) {
22261
- const monthNames = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
22557
+ let startDate = this.parent.selectedDate;
22558
+ let endDate;
22559
+ let updateCustomRange = false;
22560
+ if (this.isCustomMonth()) {
22561
+ const dates = this.parent.getCurrentViewDates();
22562
+ updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
22563
+ dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
22564
+ if (updateCustomRange) {
22565
+ startDate = dates[0];
22566
+ endDate = dates[dates.length - 1];
22567
+ }
22568
+ }
22569
+ const isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
22570
+ if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
22571
+ endDate = endDate ? endDate : addMonths(lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
22572
+ if (startDate.getFullYear() === endDate.getFullYear()) {
22573
+ const monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
22262
22574
  (this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
22263
22575
  this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
22264
22576
  return capitalizeFirstWord(monthNames, 'single');
22265
22577
  }
22266
- const text = (this.parent.globalize.formatDate(this.parent.selectedDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
22267
- this.parent.selectedDate.getFullYear() + ' - ' +
22578
+ const text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
22579
+ startDate.getFullYear() + ' - ' +
22268
22580
  this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
22269
22581
  this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
22270
22582
  return capitalizeFirstWord(text, 'single');
22271
22583
  }
22272
22584
  const format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
22273
- return capitalizeFirstWord(this.parent.globalize.formatDate(this.parent.selectedDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
22585
+ return capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
22274
22586
  }
22275
22587
  return this.formatDateRange(this.parent.selectedDate);
22276
22588
  }
@@ -22295,6 +22607,10 @@ class Month extends ViewBase {
22295
22607
  EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
22296
22608
  }
22297
22609
  }
22610
+ isCustomMonth() {
22611
+ return this.parent.currentView === 'Month' &&
22612
+ (!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
22613
+ }
22298
22614
  getModuleName() {
22299
22615
  return 'month';
22300
22616
  }
@@ -22526,12 +22842,29 @@ class Year extends ViewBase {
22526
22842
  return Array.apply(null, { length: this.parent.activeViewOptions.monthsCount }).map((value, index) => this.parent.firstMonthOfYear + index);
22527
22843
  }
22528
22844
  onCellClick(e) {
22529
- const target = closest(e.target, '.' + WORK_CELLS_CLASS);
22845
+ let target = closest(e.target, '.' + WORK_CELLS_CLASS);
22530
22846
  const startDate = this.parent.getDateFromElement(target);
22531
- const endDate = addDays(new Date(startDate.getTime()), 1);
22532
- const filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
22533
- const moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
22534
- this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
22847
+ this.parent.activeCellsData = this.parent.getCellDetails(target);
22848
+ const isPrevious = startDate.getTime() < this.getStartDate().getTime();
22849
+ if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
22850
+ this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
22851
+ const activeDate = this.parent.activeCellsData.startTime.getTime();
22852
+ const inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
22853
+ const dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
22854
+ const selectedCell = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + dateAttr + '"]');
22855
+ this.parent.selectCell(selectedCell);
22856
+ this.parent.activeCellsData = this.parent.getCellDetails(selectedCell);
22857
+ }
22858
+ else {
22859
+ const endDate = addDays(new Date(startDate.getTime()), 1);
22860
+ const filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
22861
+ const moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
22862
+ if (target.classList.contains(OTHERMONTH_CLASS)) {
22863
+ target = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
22864
+ }
22865
+ this.parent.activeCellsData = this.parent.getCellDetails(target);
22866
+ this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
22867
+ }
22535
22868
  }
22536
22869
  onContentScroll(e) {
22537
22870
  const target = e.target;
@@ -22583,10 +22916,10 @@ class Year extends ViewBase {
22583
22916
  return addDays(addMonths(this.getStartDate(), this.parent.monthsCount), -1);
22584
22917
  }
22585
22918
  startDate() {
22586
- return getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek);
22919
+ return this.parent.currentView === 'Year' ? getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
22587
22920
  }
22588
22921
  endDate() {
22589
- return addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1);
22922
+ return this.parent.currentView === 'Year' ? addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) : this.getEndDate();
22590
22923
  }
22591
22924
  getEndDateFromStartDate(start) {
22592
22925
  let date = new Date(start.getTime());
@@ -22629,6 +22962,7 @@ class Year extends ViewBase {
22629
22962
  EventHandler.add(element, 'click', this.onCellClick, this);
22630
22963
  }
22631
22964
  else {
22965
+ EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
22632
22966
  EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
22633
22967
  if (!this.parent.isAdaptive) {
22634
22968
  EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
@@ -23065,7 +23399,8 @@ class Agenda extends AgendaBase {
23065
23399
  for (const event of this.parent.eventsData) {
23066
23400
  delete event.generatedDates;
23067
23401
  }
23068
- let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ? args.processedData : this.parent.eventsProcessed;
23402
+ let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
23403
+ args.processedData : this.parent.eventsProcessed;
23069
23404
  if (this.parent.uiStateValues.isGroupAdaptive) {
23070
23405
  const resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
23071
23406
  this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
@@ -24114,6 +24449,9 @@ class TimelineYear extends Year {
24114
24449
  tr.appendChild(leftHeaderCells);
24115
24450
  leftHeaderCells.appendChild(this.renderResourceHeader(LEFT_INDENT_WRAP_CLASS));
24116
24451
  }
24452
+ const isHorizontal = this.parent.activeViewOptions.orientation === 'Horizontal';
24453
+ const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
24454
+ this.isInverseTableSelect = isHorizontal && !isGroup ? false : true;
24117
24455
  const td = createElement('td');
24118
24456
  tr.appendChild(td);
24119
24457
  const container = createElement('div', { className: DATE_HEADER_CONTAINER_CLASS });
@@ -24146,7 +24484,7 @@ class TimelineYear extends Year {
24146
24484
  }
24147
24485
  else {
24148
24486
  if (this.parent.monthHeaderTemplate) {
24149
- append(this.renderDayMonthHeaderTemplate(date, months[column], 'mothHeaderTemplate'), innerTd);
24487
+ append(this.renderDayMonthHeaderTemplate(date, months[column], 'monthHeaderTemplate'), innerTd);
24150
24488
  }
24151
24489
  else {
24152
24490
  innerTd.innerHTML = `<span>${this.getMonthName(date)}</span>`;
@@ -24791,8 +25129,8 @@ class ExcelExport {
24791
25129
  constructor(parent) {
24792
25130
  this.parent = parent;
24793
25131
  }
24794
- initializeExcelExport(excelExportOptions) {
24795
- const exportFields = excelExportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
25132
+ initializeExcelExport(excelExportOptions = {}) {
25133
+ const exportColumns = this.getExportColumns(excelExportOptions);
24796
25134
  const exportName = excelExportOptions.fileName || 'Schedule';
24797
25135
  const exportType = excelExportOptions.exportType || 'xlsx';
24798
25136
  const isIncludeOccurrences = excelExportOptions.includeOccurrences || false;
@@ -24804,34 +25142,40 @@ class ExcelExport {
24804
25142
  else {
24805
25143
  eventCollection = !isIncludeOccurrences ? this.parent.eventsData : this.parent.eventsProcessed;
24806
25144
  }
24807
- this.processWorkbook(exportFields, exportName, exportType, eventCollection);
25145
+ this.processWorkbook(exportColumns, exportName, exportType, eventCollection);
24808
25146
  }
24809
25147
  processWorkbook(fields, name, type, eventCollection) {
24810
25148
  const columns = [];
24811
25149
  const rows = [];
24812
25150
  const columnHeader = [];
24813
- fields.forEach((field, i) => columns.push({ index: i + 1, width: (field === 'Id' ? 20 : 150) }));
25151
+ fields.forEach((field, i) => { columns.push({ index: i + 1, width: (field.name === 'Id' ? 50 : 150) }); });
24814
25152
  const style = { fontSize: 12, borders: { color: '#E0E0E0' }, bold: true };
24815
- fields.forEach((field, i) => columnHeader.push({ index: i + 1, value: field, style: style }));
25153
+ fields.forEach((field, i) => { columnHeader.push({ index: i + 1, value: field.text, style: style }); });
24816
25154
  rows.push({ index: 1, cells: columnHeader });
24817
- let i = 2;
24818
- for (const event of eventCollection) {
25155
+ eventCollection.forEach((event, i) => {
24819
25156
  const columnData = [];
24820
25157
  fields.forEach((field, n) => {
24821
- let columnRule = { index: n + 1, value: event[field] || '' };
24822
- if (field === this.parent.eventFields.startTime || field === this.parent.eventFields.endTime) {
25158
+ let columnRule = { index: n + 1, value: event[field.name] || '' };
25159
+ if (field.name === this.parent.eventFields.startTime || field.name === this.parent.eventFields.endTime) {
24823
25160
  const styleRule = { fontSize: 12, numberFormat: 'm/d/yyyy h:mm AM/PM' };
24824
25161
  columnRule = extend({}, columnRule, { style: styleRule }, true);
24825
25162
  }
24826
25163
  columnData.push(columnRule);
24827
25164
  });
24828
- rows.push({ index: i, cells: columnData });
24829
- i++;
24830
- }
25165
+ rows.push({ index: i + 2, cells: columnData });
25166
+ });
24831
25167
  const workSheet = [{ columns: columns, rows: rows }];
24832
25168
  const book = new Workbook({ worksheets: workSheet }, type, this.parent.locale);
24833
25169
  book.save(name + '.' + type);
24834
25170
  }
25171
+ getExportColumns(exportOptions) {
25172
+ const exportColumns = exportOptions.fieldsInfo || [];
25173
+ if (exportColumns.length === 0) {
25174
+ const fields = exportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
25175
+ fields.forEach((field) => { exportColumns.push({ name: field, text: field }); });
25176
+ }
25177
+ return exportColumns;
25178
+ }
24835
25179
  getModuleName() {
24836
25180
  return 'excelExport';
24837
25181
  }
@@ -24976,5 +25320,5 @@ class Print {
24976
25320
  * Export Schedule components
24977
25321
  */
24978
25322
 
24979
- 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 };
25323
+ 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 };
24980
25324
  //# sourceMappingURL=ej2-schedule.es2015.js.map