@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
@@ -45,7 +45,7 @@ import { Group } from '../models/group';
45
45
  import { Resources } from '../models/resources';
46
46
  import { Gregorian, Islamic } from '../../common/calendar-util';
47
47
  import { ResourceBase } from '../base/resource';
48
- import { Timezone } from '../timezone/timezone';
48
+ import { Timezone, timezoneData } from '../timezone/timezone';
49
49
  import * as events from '../base/constant';
50
50
  import * as cls from '../base/css-constant';
51
51
  import * as util from '../base/util';
@@ -331,13 +331,19 @@ var Schedule = /** @class */ (function (_super) {
331
331
  timeFormat: this.internalTimeFormat,
332
332
  group: group,
333
333
  headerRows: this.headerRows,
334
- orientation: 'Horizontal'
334
+ orientation: 'Horizontal',
335
+ numberOfWeeks: 0,
336
+ displayDate: null
335
337
  };
336
338
  var viewOptions = this.viewCollections[this.viewIndex];
337
339
  var viewsData = extend(scheduleOptions, viewOptions, undefined, true);
338
340
  if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {
339
341
  viewsData.firstDayOfWeek = this.firstDayOfWeek;
340
342
  }
343
+ if (viewsData.displayDate) {
344
+ viewsData.displayDate = viewsData.displayDate instanceof Date ? new Date(viewsData.displayDate.getTime()) :
345
+ new Date(viewsData.displayDate);
346
+ }
341
347
  return viewsData;
342
348
  };
343
349
  Schedule.prototype.initializeDataModule = function () {
@@ -650,7 +656,7 @@ var Schedule = /** @class */ (function (_super) {
650
656
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
651
657
  this.uiStateValues = {
652
658
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
653
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false
659
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
654
660
  };
655
661
  }
656
662
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -749,7 +755,9 @@ var Schedule = /** @class */ (function (_super) {
749
755
  beginFrom: 'Begin From',
750
756
  endAt: 'Ends At',
751
757
  expandAllDaySection: 'Expand-all-day-section',
752
- collapseAllDaySection: 'Collapse-all-day-section'
758
+ collapseAllDaySection: 'Collapse-all-day-section',
759
+ searchTimezone: 'Search Timezone',
760
+ noRecords: 'No records found'
753
761
  };
754
762
  };
755
763
  Schedule.prototype.wireEvents = function () {
@@ -1427,7 +1435,7 @@ var Schedule = /** @class */ (function (_super) {
1427
1435
  if (dateHeader.classList.contains(cls.ALLDAY_APPOINTMENT_AUTO)) {
1428
1436
  removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_AUTO);
1429
1437
  }
1430
- this.eventBase.allDayExpandScroll(dateHeader, true);
1438
+ this.eventBase.allDayExpandScroll(dateHeader);
1431
1439
  }
1432
1440
  if (!this.uiStateValues.expand) {
1433
1441
  allDayRow.style.height = '';
@@ -1468,6 +1476,11 @@ var Schedule = /** @class */ (function (_super) {
1468
1476
  this.keyboardInteractionModule = new KeyboardInteraction(this);
1469
1477
  }
1470
1478
  break;
1479
+ case 'timezoneDataSource':
1480
+ if (this.eventWindow) {
1481
+ this.eventWindow.refresh();
1482
+ }
1483
+ break;
1471
1484
  case 'editorTemplate':
1472
1485
  if (!isNullOrUndefined(this.editorTemplate)) {
1473
1486
  this.editorTemplateFn = this.templateParser(this.editorTemplate);
@@ -1612,6 +1625,7 @@ var Schedule = /** @class */ (function (_super) {
1612
1625
  }
1613
1626
  break;
1614
1627
  case 'spannedEventPlacement':
1628
+ case 'minimumEventDuration':
1615
1629
  case 'enableMaxHeight':
1616
1630
  case 'enableIndicator':
1617
1631
  this.refreshEvents(false);
@@ -1986,7 +2000,7 @@ var Schedule = /** @class */ (function (_super) {
1986
2000
  */
1987
2001
  Schedule.prototype.exportToExcel = function (excelExportOptions) {
1988
2002
  if (this.excelExportModule) {
1989
- this.excelExportModule.initializeExcelExport(excelExportOptions || {});
2003
+ this.excelExportModule.initializeExcelExport(excelExportOptions);
1990
2004
  }
1991
2005
  else {
1992
2006
  throw Error('Inject ExcelExport module');
@@ -2171,6 +2185,9 @@ var Schedule = /** @class */ (function (_super) {
2171
2185
  this.crudModule.refreshDataManager();
2172
2186
  }
2173
2187
  else {
2188
+ if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
2189
+ this.resetTemplates(['eventTemplate']);
2190
+ }
2174
2191
  var eventsData = this.eventsData || [];
2175
2192
  var blockData = this.blockData || [];
2176
2193
  var data = eventsData.concat(blockData);
@@ -2428,6 +2445,7 @@ var Schedule = /** @class */ (function (_super) {
2428
2445
  this.eventTooltip = null;
2429
2446
  }
2430
2447
  this.destroyPopups();
2448
+ this.hideSpinner();
2431
2449
  this.unWireEvents();
2432
2450
  this.destroyHeaderModule();
2433
2451
  if (this.eventTooltip) {
@@ -2639,6 +2657,9 @@ var Schedule = /** @class */ (function (_super) {
2639
2657
  __decorate([
2640
2658
  Complex({}, EventSettings)
2641
2659
  ], Schedule.prototype, "eventSettings", void 0);
2660
+ __decorate([
2661
+ Property(timezoneData)
2662
+ ], Schedule.prototype, "timezoneDataSource", void 0);
2642
2663
  __decorate([
2643
2664
  Property()
2644
2665
  ], Schedule.prototype, "resourceHeaderTemplate", void 0);
@@ -2,6 +2,7 @@
2
2
  * Schedule common utilities
3
3
  */
4
4
  export declare const WEEK_LENGTH: number;
5
+ export declare const DEFAULT_WEEKS: number;
5
6
  export declare const MS_PER_DAY: number;
6
7
  export declare const MS_PER_MINUTE: number;
7
8
  /**
@@ -4,6 +4,7 @@ import { createElement, remove, isNullOrUndefined } from '@syncfusion/ej2-base';
4
4
  * Schedule common utilities
5
5
  */
6
6
  export var WEEK_LENGTH = 7;
7
+ export var DEFAULT_WEEKS = 6;
7
8
  export var MS_PER_DAY = 86400000;
8
9
  export var MS_PER_MINUTE = 60000;
9
10
  /**
@@ -80,7 +80,8 @@ export declare class EventBase {
80
80
  isValidEvent(eventObj: Record<string, any>, start: Date, end: Date, schedule: {
81
81
  [key: string]: Date;
82
82
  }): boolean;
83
- allDayExpandScroll(dateHeader: HTMLElement, heightPropChanged?: boolean): void;
83
+ allDayExpandScroll(dateHeader: HTMLElement): void;
84
+ updateEventMinimumDuration(startEndHours: Record<string, Date>, startTime: Date, endTime: Date): Record<string, Date>;
84
85
  private unWireEvents;
85
86
  destroy(): void;
86
87
  }
@@ -640,7 +640,7 @@ var EventBase = /** @class */ (function () {
640
640
  var isAllDay = event[fieldMapping.isAllDay];
641
641
  var isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
642
642
  / util.MS_PER_DAY) >= 1;
643
- return (isAllDay || (!(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') && isFullDay)) ? true : false;
643
+ return (isAllDay || (this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' && isFullDay)) ? true : false;
644
644
  };
645
645
  EventBase.prototype.addEventListener = function () {
646
646
  this.parent.on(event.documentClick, this.appointmentBorderRemove, this);
@@ -730,7 +730,8 @@ var EventBase = /** @class */ (function () {
730
730
  EventBase.prototype.eventClick = function (eventData) {
731
731
  var _this = this;
732
732
  var target = eventData.target;
733
- if (target.classList.contains(cls.DRAG_CLONE_CLASS) || target.classList.contains(cls.RESIZE_CLONE_CLASS)) {
733
+ if (target.classList.contains(cls.DRAG_CLONE_CLASS) || target.classList.contains(cls.RESIZE_CLONE_CLASS) ||
734
+ target.classList.contains(cls.INLINE_SUBJECT_CLASS)) {
734
735
  return;
735
736
  }
736
737
  if ((eventData.ctrlKey || eventData.metaKey) && eventData.which === 1 && this.parent.keyboardInteractionModule) {
@@ -1200,7 +1201,7 @@ var EventBase = /** @class */ (function () {
1200
1201
  eventObj[this.parent.eventFields.endTime].getTime() < schedule.endHour.getTime() && start.getTime() === end.getTime();
1201
1202
  return isHourRange || isSameRange;
1202
1203
  };
1203
- EventBase.prototype.allDayExpandScroll = function (dateHeader, heightPropChanged) {
1204
+ EventBase.prototype.allDayExpandScroll = function (dateHeader) {
1204
1205
  var indentHeight = 0;
1205
1206
  var headerRows = [].slice.call(this.parent.element.querySelectorAll('.' + cls.HEADER_ROW_CLASS));
1206
1207
  headerRows.forEach(function (element) {
@@ -1210,14 +1211,28 @@ var EventBase = /** @class */ (function () {
1210
1211
  });
1211
1212
  indentHeight = dateHeader.offsetHeight - indentHeight;
1212
1213
  this.parent.element.querySelector('.' + cls.ALLDAY_CELLS_CLASS).style.height = (indentHeight / 12) + 'em';
1213
- var content = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);
1214
- if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged)) {
1214
+ if (this.parent.uiStateValues.expand) {
1215
1215
  addClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);
1216
1216
  }
1217
1217
  else {
1218
1218
  removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);
1219
1219
  }
1220
1220
  };
1221
+ EventBase.prototype.updateEventMinimumDuration = function (startEndHours, startTime, endTime) {
1222
+ var eventDuration = (util.getUniversalTime(endTime) - util.getUniversalTime(startTime)) / util.MS_PER_MINUTE;
1223
+ if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
1224
+ var tempEnd = new Date(startTime);
1225
+ tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
1226
+ endTime = tempEnd;
1227
+ if (endTime.getTime() > startEndHours.endHour.getTime()) {
1228
+ var tempStart = new Date(startEndHours.endHour.getTime());
1229
+ tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
1230
+ startTime = tempStart;
1231
+ endTime = startEndHours.endHour;
1232
+ }
1233
+ }
1234
+ return { startDate: startTime, endDate: endTime };
1235
+ };
1221
1236
  EventBase.prototype.unWireEvents = function () {
1222
1237
  var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));
1223
1238
  for (var _i = 0, appElements_1 = appElements; _i < appElements_1.length; _i++) {
@@ -18,11 +18,11 @@ var InlineEdit = /** @class */ (function () {
18
18
  if (this.parent.quickPopup) {
19
19
  this.parent.quickPopup.quickPopupHide();
20
20
  }
21
- var moreWrapper = this.parent.element.querySelector('.e-more-popup-wrapper ');
22
- if (moreWrapper && moreWrapper.classList.contains(cls.POPUP_OPEN)) {
23
- this.parent.quickPopup.morePopup.hide();
24
- }
25
21
  if (args.type === 'Cell') {
22
+ var moreWrapper = this.parent.element.querySelector('.' + cls.MORE_POPUP_WRAPPER_CLASS);
23
+ if (moreWrapper && moreWrapper.classList.contains(cls.POPUP_OPEN)) {
24
+ this.parent.quickPopup.morePopup.hide();
25
+ }
26
26
  this.removeInlineAppointmentElement();
27
27
  this.cellEdit(args);
28
28
  }
@@ -85,8 +85,8 @@ var InlineEdit = /** @class */ (function () {
85
85
  '.e-inner-wrap' : '.e-appointment-details';
86
86
  args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);
87
87
  }
88
+ inlineSubject.focus();
88
89
  }
89
- inlineSubject.focus();
90
90
  inlineSubject.setSelectionRange(subject.length, subject.length);
91
91
  };
92
92
  InlineEdit.prototype.createVerticalViewInline = function (saveObj, dayIndex, resIndex, daysCount) {
@@ -182,6 +182,9 @@ var InlineEdit = /** @class */ (function () {
182
182
  if (target && target.value !== '') {
183
183
  this.inlineCrudActions(target);
184
184
  }
185
+ else {
186
+ this.removeInlineAppointmentElement();
187
+ }
185
188
  };
186
189
  InlineEdit.prototype.inlineCrudActions = function (target) {
187
190
  if (closest(target, '.' + cls.INLINE_APPOINTMENT_CLASS)) {
@@ -175,7 +175,7 @@ var MonthEvent = /** @class */ (function (_super) {
175
175
  this.cellHeight = cellDetail.height;
176
176
  this.dateRender = dateRender;
177
177
  var filteredDates = this.getRenderedDates(dateRender);
178
- this.getSlotDates(workDays);
178
+ this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
179
179
  this.processBlockEvents(blockList, resIndex, resData);
180
180
  for (var _i = 0, eventsList_1 = eventsList; _i < eventsList_1.length; _i++) {
181
181
  var event_1 = eventsList_1[_i];
@@ -141,6 +141,10 @@ var TimelineEvent = /** @class */ (function (_super) {
141
141
  var eventData = event.data;
142
142
  startTime = this.getStartTime(event, eventData);
143
143
  endTime = this.getEndTime(event, eventData);
144
+ var startEndHours = util.getStartEndHours(event[this.fields.startTime], this.startHour, this.endHour);
145
+ var eventDates = this.updateEventMinimumDuration(startEndHours, startTime, endTime);
146
+ startTime = eventDates.startDate;
147
+ endTime = eventDates.endDate;
144
148
  this.day = this.parent.getIndexOfDate(this.dateRender, util.resetTime(new Date(startTime.getTime())));
145
149
  if (this.day < 0) {
146
150
  return;
@@ -420,18 +420,21 @@ var VerticalEvent = /** @class */ (function (_super) {
420
420
  if (currentDay.length === 0) {
421
421
  currentDate = util.resetTime(renderedDate[0]);
422
422
  }
423
- var fieldMapping = this.parent.eventFields;
424
- var startEndHours = util.getStartEndHours(currentDate, this.startHour, this.endHour);
423
+ var field = this.parent.eventFields;
424
+ var schedule = util.getStartEndHours(currentDate, this.startHour, this.endHour);
425
425
  var event = extend({}, record, null, true);
426
426
  event.isSpanned = { isBottom: false, isTop: false };
427
- if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) {
428
- event[fieldMapping.startTime] = startEndHours.startHour;
427
+ if (record[field.startTime].getTime() < schedule.startHour.getTime()) {
428
+ event[field.startTime] = schedule.startHour;
429
429
  event.isSpanned.isTop = true;
430
430
  }
431
- if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) {
432
- event[fieldMapping.endTime] = startEndHours.endHour;
431
+ if (record[field.endTime].getTime() > schedule.endHour.getTime()) {
432
+ event[field.endTime] = schedule.endHour;
433
433
  event.isSpanned.isBottom = true;
434
434
  }
435
+ var eventDates = this.updateEventMinimumDuration(schedule, event[field.startTime], event[field.endTime]);
436
+ event[field.startTime] = eventDates.startDate;
437
+ event[field.endTime] = eventDates.endDate;
435
438
  return event;
436
439
  };
437
440
  VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline) {
@@ -489,7 +489,7 @@ var YearEvent = /** @class */ (function (_super) {
489
489
  }
490
490
  }
491
491
  else {
492
- if (((util.resetTime(appStart).getTime() <= dateStart) && (util.resetTime(appEnd).getTime() > dateStart)) ||
492
+ if (((util.resetTime(appStart).getTime() <= dateStart) && (util.resetTime(appEnd).getTime() >= dateStart)) ||
493
493
  (util.resetTime(appStart).getTime() >= dateStart) && (util.resetTime(appEnd).getTime() <= dateEnd)) {
494
494
  appointmentsList.push(app);
495
495
  }
@@ -6,8 +6,9 @@ import { ExportOptions } from '../base/interface';
6
6
  export declare class ExcelExport {
7
7
  private parent;
8
8
  constructor(parent: Schedule);
9
- initializeExcelExport(excelExportOptions: ExportOptions): void;
9
+ initializeExcelExport(excelExportOptions?: ExportOptions): void;
10
10
  private processWorkbook;
11
+ private getExportColumns;
11
12
  protected getModuleName(): string;
12
13
  destroy(): void;
13
14
  }
@@ -9,10 +9,8 @@ var ExcelExport = /** @class */ (function () {
9
9
  this.parent = parent;
10
10
  }
11
11
  ExcelExport.prototype.initializeExcelExport = function (excelExportOptions) {
12
- var _this = this;
13
- var exportFields = excelExportOptions.fields || Object.keys(this.parent.eventFields).map(function (field) {
14
- return _this.parent.eventFields[field];
15
- });
12
+ if (excelExportOptions === void 0) { excelExportOptions = {}; }
13
+ var exportColumns = this.getExportColumns(excelExportOptions);
16
14
  var exportName = excelExportOptions.fileName || 'Schedule';
17
15
  var exportType = excelExportOptions.exportType || 'xlsx';
18
16
  var isIncludeOccurrences = excelExportOptions.includeOccurrences || false;
@@ -24,39 +22,44 @@ var ExcelExport = /** @class */ (function () {
24
22
  else {
25
23
  eventCollection = !isIncludeOccurrences ? this.parent.eventsData : this.parent.eventsProcessed;
26
24
  }
27
- this.processWorkbook(exportFields, exportName, exportType, eventCollection);
25
+ this.processWorkbook(exportColumns, exportName, exportType, eventCollection);
28
26
  };
29
27
  ExcelExport.prototype.processWorkbook = function (fields, name, type, eventCollection) {
30
28
  var _this = this;
31
29
  var columns = [];
32
30
  var rows = [];
33
31
  var columnHeader = [];
34
- fields.forEach(function (field, i) { return columns.push({ index: i + 1, width: (field === 'Id' ? 20 : 150) }); });
32
+ fields.forEach(function (field, i) { columns.push({ index: i + 1, width: (field.name === 'Id' ? 50 : 150) }); });
35
33
  var style = { fontSize: 12, borders: { color: '#E0E0E0' }, bold: true };
36
- fields.forEach(function (field, i) { return columnHeader.push({ index: i + 1, value: field, style: style }); });
34
+ fields.forEach(function (field, i) { columnHeader.push({ index: i + 1, value: field.text, style: style }); });
37
35
  rows.push({ index: 1, cells: columnHeader });
38
- var i = 2;
39
- var _loop_1 = function (event_1) {
36
+ eventCollection.forEach(function (event, i) {
40
37
  var columnData = [];
41
38
  fields.forEach(function (field, n) {
42
- var columnRule = { index: n + 1, value: event_1[field] || '' };
43
- if (field === _this.parent.eventFields.startTime || field === _this.parent.eventFields.endTime) {
39
+ var columnRule = { index: n + 1, value: event[field.name] || '' };
40
+ if (field.name === _this.parent.eventFields.startTime || field.name === _this.parent.eventFields.endTime) {
44
41
  var styleRule = { fontSize: 12, numberFormat: 'm/d/yyyy h:mm AM/PM' };
45
42
  columnRule = extend({}, columnRule, { style: styleRule }, true);
46
43
  }
47
44
  columnData.push(columnRule);
48
45
  });
49
- rows.push({ index: i, cells: columnData });
50
- i++;
51
- };
52
- for (var _i = 0, eventCollection_1 = eventCollection; _i < eventCollection_1.length; _i++) {
53
- var event_1 = eventCollection_1[_i];
54
- _loop_1(event_1);
55
- }
46
+ rows.push({ index: i + 2, cells: columnData });
47
+ });
56
48
  var workSheet = [{ columns: columns, rows: rows }];
57
49
  var book = new Workbook({ worksheets: workSheet }, type, this.parent.locale);
58
50
  book.save(name + '.' + type);
59
51
  };
52
+ ExcelExport.prototype.getExportColumns = function (exportOptions) {
53
+ var _this = this;
54
+ var exportColumns = exportOptions.fieldsInfo || [];
55
+ if (exportColumns.length === 0) {
56
+ var fields = exportOptions.fields || Object.keys(this.parent.eventFields).map(function (field) {
57
+ return _this.parent.eventFields[field];
58
+ });
59
+ fields.forEach(function (field) { exportColumns.push({ name: field, text: field }); });
60
+ }
61
+ return exportColumns;
62
+ };
60
63
  ExcelExport.prototype.getModuleName = function () {
61
64
  return 'excelExport';
62
65
  };
@@ -48,15 +48,6 @@ export interface EventSettingsModel {
48
48
  */
49
49
  enableTooltip?: boolean;
50
50
 
51
- /**
52
- * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
53
- * All the event fields mapped with Schedule dataSource can be accessed within this template code.
54
- * {% codeBlock src="schedule/tooltip-template-api/index.ts" %}{% endcodeBlock %}
55
- *
56
- * @default null
57
- */
58
- tooltipTemplate?: string;
59
-
60
51
  /**
61
52
  * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
62
53
  * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
@@ -68,6 +59,23 @@ export interface EventSettingsModel {
68
59
  */
69
60
  spannedEventPlacement?: SpannedEventPlacement;
70
61
 
62
+ /**
63
+ * Sets a minimum duration for an event where the events are rendered for this minimum duration when the duration of the event is lesser than this value.
64
+ * It accepts duration value in minutes. This property is only applicable when the event duration is lesser than this property duration.
65
+ *
66
+ * @default 1
67
+ */
68
+ minimumEventDuration?: number;
69
+
70
+ /**
71
+ * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
72
+ * All the event fields mapped with Schedule dataSource can be accessed within this template code.
73
+ * {% codeBlock src="schedule/tooltip-template-api/index.ts" %}{% endcodeBlock %}
74
+ *
75
+ * @default null
76
+ */
77
+ tooltipTemplate?: string;
78
+
71
79
  /**
72
80
  * Defines the resource name, to decides the color of which particular resource level is to be applied on appointments, when
73
81
  * grouping is enabled on scheduler.
@@ -45,14 +45,6 @@ export declare class EventSettings extends ChildProperty<EventSettings> {
45
45
  * @default false
46
46
  */
47
47
  enableTooltip: boolean;
48
- /**
49
- * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
50
- * All the event fields mapped with Schedule dataSource can be accessed within this template code.
51
- * {% codeBlock src="schedule/tooltip-template-api/index.ts" %}{% endcodeBlock %}
52
- *
53
- * @default null
54
- */
55
- tooltipTemplate: string;
56
48
  /**
57
49
  * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
58
50
  * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
@@ -63,6 +55,21 @@ export declare class EventSettings extends ChildProperty<EventSettings> {
63
55
  * @default 'AllDayRow'
64
56
  */
65
57
  spannedEventPlacement: SpannedEventPlacement;
58
+ /**
59
+ * Sets a minimum duration for an event where the events are rendered for this minimum duration when the duration of the event is lesser than this value.
60
+ * It accepts duration value in minutes. This property is only applicable when the event duration is lesser than this property duration.
61
+ *
62
+ * @default 1
63
+ */
64
+ minimumEventDuration: number;
65
+ /**
66
+ * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
67
+ * All the event fields mapped with Schedule dataSource can be accessed within this template code.
68
+ * {% codeBlock src="schedule/tooltip-template-api/index.ts" %}{% endcodeBlock %}
69
+ *
70
+ * @default null
71
+ */
72
+ tooltipTemplate: string;
66
73
  /**
67
74
  * Defines the resource name, to decides the color of which particular resource level is to be applied on appointments, when
68
75
  * grouping is enabled on scheduler.
@@ -43,12 +43,15 @@ var EventSettings = /** @class */ (function (_super) {
43
43
  __decorate([
44
44
  Property(false)
45
45
  ], EventSettings.prototype, "enableTooltip", void 0);
46
- __decorate([
47
- Property()
48
- ], EventSettings.prototype, "tooltipTemplate", void 0);
49
46
  __decorate([
50
47
  Property('AllDayRow')
51
48
  ], EventSettings.prototype, "spannedEventPlacement", void 0);
49
+ __decorate([
50
+ Property(1)
51
+ ], EventSettings.prototype, "minimumEventDuration", void 0);
52
+ __decorate([
53
+ Property()
54
+ ], EventSettings.prototype, "tooltipTemplate", void 0);
52
55
  __decorate([
53
56
  Property()
54
57
  ], EventSettings.prototype, "resourceColorField", void 0);
@@ -257,4 +257,23 @@ export interface ViewsModel {
257
257
  */
258
258
  headerRows?: HeaderRowsModel[];
259
259
 
260
+ /**
261
+ * This property customizes the number of weeks that are shown in month view. By default, it shows all weeks in the current month.
262
+ * Use displayDate property to customize the starting week of month.
263
+ * {% codeBlock src='schedule/numberOfWeeks/index.md' %}{% endcodeBlock %}
264
+ *
265
+ * @default 0
266
+ * @aspType int
267
+ */
268
+ numberOfWeeks?: number;
269
+
270
+ /**
271
+ * Specifies the starting week date at an initial rendering of month view. This property is only applicable for month view.
272
+ * If this property value is not set, then the month view will be rendered from the first week of the month.
273
+ * {% codeBlock src='schedule/displayDate/index.md' %}{% endcodeBlock %}
274
+ *
275
+ * @default null
276
+ */
277
+ displayDate?: Date;
278
+
260
279
  }
@@ -229,4 +229,21 @@ export declare class Views extends ChildProperty<Views> {
229
229
  * @default []
230
230
  */
231
231
  headerRows: HeaderRowsModel[];
232
+ /**
233
+ * This property customizes the number of weeks that are shown in month view. By default, it shows all weeks in the current month.
234
+ * Use displayDate property to customize the starting week of month.
235
+ * {% codeBlock src='schedule/numberOfWeeks/index.md' %}{% endcodeBlock %}
236
+ *
237
+ * @default 0
238
+ * @aspType int
239
+ */
240
+ numberOfWeeks: number;
241
+ /**
242
+ * Specifies the starting week date at an initial rendering of month view. This property is only applicable for month view.
243
+ * If this property value is not set, then the month view will be rendered from the first week of the month.
244
+ * {% codeBlock src='schedule/displayDate/index.md' %}{% endcodeBlock %}
245
+ *
246
+ * @default null
247
+ */
248
+ displayDate: Date;
232
249
  }
@@ -113,6 +113,12 @@ var Views = /** @class */ (function (_super) {
113
113
  __decorate([
114
114
  Collection([], HeaderRows)
115
115
  ], Views.prototype, "headerRows", void 0);
116
+ __decorate([
117
+ Property(0)
118
+ ], Views.prototype, "numberOfWeeks", void 0);
119
+ __decorate([
120
+ Property()
121
+ ], Views.prototype, "displayDate", void 0);
116
122
  return Views;
117
123
  }(ChildProperty));
118
124
  export { Views };
@@ -25,7 +25,6 @@ export declare class EventWindow {
25
25
  private duration;
26
26
  private isCrudAction;
27
27
  private eventWindowTime;
28
- private timezoneData;
29
28
  private isEnterKey;
30
29
  private dialogEvent;
31
30
  constructor(parent: Schedule);
@@ -26,7 +26,6 @@ var EventWindow = /** @class */ (function () {
26
26
  this.parent = parent;
27
27
  this.l10n = this.parent.localeObj;
28
28
  this.fields = this.parent.eventFields;
29
- this.timezoneData = this.parent.tzModule.timezoneData;
30
29
  this.eventWindowTime = { startTime: new Date(), endTime: new Date() };
31
30
  this.renderEventWindow();
32
31
  }
@@ -464,14 +463,15 @@ var EventWindow = /** @class */ (function () {
464
463
  allowFiltering: true,
465
464
  change: this.onTimezoneChange.bind(this),
466
465
  cssClass: this.parent.cssClass || '',
467
- dataSource: this.timezoneData,
466
+ dataSource: this.parent.timezoneDataSource,
468
467
  enableRtl: this.parent.enableRtl,
469
468
  fields: { text: 'Text', value: 'Value' },
470
- filterBarPlaceholder: 'Search Timezone',
469
+ filterBarPlaceholder: this.parent.localeObj.getConstant('searchTimezone'),
470
+ noRecordsTemplate: this.parent.localeObj.getConstant('noRecords'),
471
471
  filtering: function (e) {
472
472
  var query = new Query();
473
473
  query = (e.text !== '') ? query.where('Text', 'contains', e.text, true) : query;
474
- e.updateData(_this.timezoneData, query);
474
+ e.updateData(_this.parent.timezoneDataSource, query);
475
475
  },
476
476
  htmlAttributes: { 'title': this.getFieldLabel(value), 'name': fieldName },
477
477
  floatLabelType: 'Always',
@@ -1797,7 +1797,6 @@ var EventWindow = /** @class */ (function () {
1797
1797
  this.fields = null;
1798
1798
  this.buttonObj = null;
1799
1799
  this.repeatStatus = null;
1800
- this.timezoneData = null;
1801
1800
  this.eventWindowTime = null;
1802
1801
  }
1803
1802
  };
@@ -50,7 +50,7 @@ var FieldValidator = /** @class */ (function () {
50
50
  this.createTooltip(inputElement, error, id, '');
51
51
  }
52
52
  if (!isNullOrUndefined(elem)) {
53
- elem.querySelector(".e-error").innerHTML = error.innerHTML;
53
+ elem.querySelector('.e-error').innerHTML = error.innerHTML;
54
54
  }
55
55
  };
56
56
  FieldValidator.prototype.createTooltip = function (element, error, name, display) {
@@ -907,6 +907,9 @@ var QuickPopups = /** @class */ (function () {
907
907
  };
908
908
  QuickPopups.prototype.closeClick = function (event) {
909
909
  this.dialogEvent = event;
910
+ if (this.parent.currentView === 'Year' && this.parent.activeCellsData && this.parent.activeCellsData.element) {
911
+ this.parent.selectCell(this.parent.activeCellsData.element);
912
+ }
910
913
  this.quickPopupHide();
911
914
  this.morePopup.hide();
912
915
  };
@@ -67,7 +67,8 @@ var Agenda = /** @class */ (function (_super) {
67
67
  var event_1 = _a[_i];
68
68
  delete event_1.generatedDates;
69
69
  }
70
- var eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ? args.processedData : this.parent.eventsProcessed;
70
+ var eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
71
+ args.processedData : this.parent.eventsProcessed;
71
72
  if (this.parent.uiStateValues.isGroupAdaptive) {
72
73
  var resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
73
74
  this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
@@ -36,6 +36,7 @@ export declare class HeaderRenderer {
36
36
  setCalendarTimezone(): void;
37
37
  private calculateViewIndex;
38
38
  private toolbarClickHandler;
39
+ private hasSelectedDate;
39
40
  getHeaderElement(): HTMLElement;
40
41
  updateHeaderItems(classType: string): void;
41
42
  previousNextIconHandler(): void;