@syncfusion/ej2-schedule 19.3.46 → 19.4.38

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 (125) 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 +49 -5
  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 +479 -133
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +480 -137
  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/crud.js +2 -0
  17. package/src/schedule/actions/drag.js +28 -18
  18. package/src/schedule/actions/keyboard.d.ts +7 -0
  19. package/src/schedule/actions/keyboard.js +197 -28
  20. package/src/schedule/base/interface.d.ts +19 -0
  21. package/src/schedule/base/resource.js +1 -0
  22. package/src/schedule/base/schedule-model.d.ts +97 -20
  23. package/src/schedule/base/schedule.d.ts +97 -21
  24. package/src/schedule/base/schedule.js +27 -5
  25. package/src/schedule/base/type.d.ts +4 -0
  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 -0
  29. package/src/schedule/event-renderer/event-base.js +29 -9
  30. package/src/schedule/event-renderer/inline-edit.js +8 -5
  31. package/src/schedule/event-renderer/month.js +2 -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 +20 -1
  38. package/src/schedule/models/event-settings.d.ts +18 -0
  39. package/src/schedule/models/event-settings.js +6 -0
  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/event-window.d.ts +0 -1
  44. package/src/schedule/popups/event-window.js +4 -5
  45. package/src/schedule/popups/form-validator.js +4 -1
  46. package/src/schedule/popups/quick-popups.js +3 -0
  47. package/src/schedule/renderer/agenda.js +3 -1
  48. package/src/schedule/renderer/header-renderer.d.ts +1 -0
  49. package/src/schedule/renderer/header-renderer.js +22 -8
  50. package/src/schedule/renderer/month.d.ts +4 -0
  51. package/src/schedule/renderer/month.js +68 -19
  52. package/src/schedule/renderer/timeline-year.js +3 -0
  53. package/src/schedule/renderer/view-base.js +9 -0
  54. package/src/schedule/renderer/year.d.ts +2 -2
  55. package/src/schedule/renderer/year.js +24 -6
  56. package/src/schedule/timezone/timezone.d.ts +3 -2
  57. package/src/schedule/timezone/timezone.js +0 -1
  58. package/styles/bootstrap-dark.css +108 -27
  59. package/styles/bootstrap.css +105 -27
  60. package/styles/bootstrap4.css +117 -62
  61. package/styles/bootstrap5-dark.css +118 -67
  62. package/styles/bootstrap5.css +118 -67
  63. package/styles/fabric-dark.css +108 -26
  64. package/styles/fabric.css +109 -26
  65. package/styles/highcontrast-light.css +104 -26
  66. package/styles/highcontrast.css +109 -28
  67. package/styles/material-dark.css +110 -32
  68. package/styles/material.css +103 -25
  69. package/styles/recurrence-editor/_bootstrap-dark-definition.scss +7 -0
  70. package/styles/recurrence-editor/_bootstrap-definition.scss +7 -0
  71. package/styles/recurrence-editor/_bootstrap4-definition.scss +7 -0
  72. package/styles/recurrence-editor/_bootstrap5-definition.scss +7 -0
  73. package/styles/recurrence-editor/_fabric-dark-definition.scss +8 -0
  74. package/styles/recurrence-editor/_fabric-definition.scss +7 -0
  75. package/styles/recurrence-editor/_fluent-definition.scss +15 -0
  76. package/styles/recurrence-editor/_highcontrast-definition.scss +7 -0
  77. package/styles/recurrence-editor/_highcontrast-light-definition.scss +7 -0
  78. package/styles/recurrence-editor/_layout.scss +20 -4
  79. package/styles/recurrence-editor/_material-dark-definition.scss +7 -0
  80. package/styles/recurrence-editor/_material-definition.scss +7 -0
  81. package/styles/recurrence-editor/_tailwind-definition.scss +15 -8
  82. package/styles/recurrence-editor/bootstrap-dark.css +20 -4
  83. package/styles/recurrence-editor/bootstrap.css +20 -4
  84. package/styles/recurrence-editor/bootstrap4.css +20 -4
  85. package/styles/recurrence-editor/bootstrap5-dark.css +20 -4
  86. package/styles/recurrence-editor/bootstrap5.css +20 -4
  87. package/styles/recurrence-editor/fabric-dark.css +20 -4
  88. package/styles/recurrence-editor/fabric.css +20 -4
  89. package/styles/recurrence-editor/highcontrast-light.css +20 -4
  90. package/styles/recurrence-editor/highcontrast.css +20 -4
  91. package/styles/recurrence-editor/material-dark.css +20 -4
  92. package/styles/recurrence-editor/material.css +20 -4
  93. package/styles/recurrence-editor/tailwind-dark.css +20 -4
  94. package/styles/recurrence-editor/tailwind.css +20 -4
  95. package/styles/schedule/_bootstrap-dark-definition.scss +22 -1
  96. package/styles/schedule/_bootstrap-definition.scss +22 -1
  97. package/styles/schedule/_bootstrap4-definition.scss +23 -1
  98. package/styles/schedule/_bootstrap5-definition.scss +145 -119
  99. package/styles/schedule/_fabric-dark-definition.scss +22 -1
  100. package/styles/schedule/_fabric-definition.scss +22 -1
  101. package/styles/schedule/_fluent-definition.scss +218 -0
  102. package/styles/schedule/_highcontrast-definition.scss +22 -1
  103. package/styles/schedule/_highcontrast-light-definition.scss +22 -1
  104. package/styles/schedule/_layout.scss +95 -158
  105. package/styles/schedule/_material-dark-definition.scss +22 -1
  106. package/styles/schedule/_material-definition.scss +21 -0
  107. package/styles/schedule/_tailwind-definition.scss +216 -195
  108. package/styles/schedule/_theme.scss +1 -1
  109. package/styles/schedule/bootstrap-dark.css +88 -23
  110. package/styles/schedule/bootstrap.css +85 -23
  111. package/styles/schedule/bootstrap4.css +97 -58
  112. package/styles/schedule/bootstrap5-dark.css +98 -63
  113. package/styles/schedule/bootstrap5.css +98 -63
  114. package/styles/schedule/fabric-dark.css +88 -22
  115. package/styles/schedule/fabric.css +89 -22
  116. package/styles/schedule/highcontrast-light.css +84 -22
  117. package/styles/schedule/highcontrast.css +89 -24
  118. package/styles/schedule/icons/_fluent.scss +231 -0
  119. package/styles/schedule/icons/_tailwind.scss +231 -231
  120. package/styles/schedule/material-dark.css +90 -28
  121. package/styles/schedule/material.css +83 -21
  122. package/styles/schedule/tailwind-dark.css +94 -52
  123. package/styles/schedule/tailwind.css +94 -52
  124. package/styles/tailwind-dark.css +114 -56
  125. 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 () {
@@ -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);
@@ -1611,6 +1624,8 @@ var Schedule = /** @class */ (function (_super) {
1611
1624
  this.eventWindow.refresh();
1612
1625
  }
1613
1626
  break;
1627
+ case 'spannedEventPlacement':
1628
+ case 'minimumEventDuration':
1614
1629
  case 'enableMaxHeight':
1615
1630
  case 'enableIndicator':
1616
1631
  this.refreshEvents(false);
@@ -1985,7 +2000,7 @@ var Schedule = /** @class */ (function (_super) {
1985
2000
  */
1986
2001
  Schedule.prototype.exportToExcel = function (excelExportOptions) {
1987
2002
  if (this.excelExportModule) {
1988
- this.excelExportModule.initializeExcelExport(excelExportOptions || {});
2003
+ this.excelExportModule.initializeExcelExport(excelExportOptions);
1989
2004
  }
1990
2005
  else {
1991
2006
  throw Error('Inject ExcelExport module');
@@ -2170,6 +2185,9 @@ var Schedule = /** @class */ (function (_super) {
2170
2185
  this.crudModule.refreshDataManager();
2171
2186
  }
2172
2187
  else {
2188
+ if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
2189
+ this.resetTemplates(['eventTemplate']);
2190
+ }
2173
2191
  var eventsData = this.eventsData || [];
2174
2192
  var blockData = this.blockData || [];
2175
2193
  var data = eventsData.concat(blockData);
@@ -2427,6 +2445,7 @@ var Schedule = /** @class */ (function (_super) {
2427
2445
  this.eventTooltip = null;
2428
2446
  }
2429
2447
  this.destroyPopups();
2448
+ this.hideSpinner();
2430
2449
  this.unWireEvents();
2431
2450
  this.destroyHeaderModule();
2432
2451
  if (this.eventTooltip) {
@@ -2638,6 +2657,9 @@ var Schedule = /** @class */ (function (_super) {
2638
2657
  __decorate([
2639
2658
  Complex({}, EventSettings)
2640
2659
  ], Schedule.prototype, "eventSettings", void 0);
2660
+ __decorate([
2661
+ Property(timezoneData)
2662
+ ], Schedule.prototype, "timezoneDataSource", void 0);
2641
2663
  __decorate([
2642
2664
  Property()
2643
2665
  ], Schedule.prototype, "resourceHeaderTemplate", void 0);
@@ -41,3 +41,7 @@ export declare type TemplateType = 'Both' | 'Cell' | 'Event';
41
41
  * An enum that holds the different type of week number options in the scheduler.
42
42
  */
43
43
  export declare type WeekRule = 'FirstDay' | 'FirstFourDayWeek' | 'FirstFullWeek';
44
+ /**
45
+ * An enum that holds the options to render the spanned events in all day row or time slot.
46
+ */
47
+ export declare type SpannedEventPlacement = 'AllDayRow' | 'TimeSlot';
@@ -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
  /**
@@ -17,6 +17,7 @@ export declare class EventBase {
17
17
  */
18
18
  constructor(parent: Schedule);
19
19
  processData(events: Record<string, any>[], timeZonePropChanged?: boolean, oldTimezone?: string): Record<string, any>[];
20
+ updateEventDateTime(eventData: Record<string, any>): Record<string, any>;
20
21
  getProcessedEvents(eventCollection?: Record<string, any>[]): Record<string, any>[];
21
22
  timezonePropertyChange(oldTimezone: string): void;
22
23
  timezoneConvert(eventData: Record<string, any>): void;
@@ -80,6 +81,7 @@ export declare class EventBase {
80
81
  [key: string]: Date;
81
82
  }): boolean;
82
83
  allDayExpandScroll(dateHeader: HTMLElement, heightPropChanged?: boolean): void;
84
+ updateEventMinimumDuration(startEndHours: Record<string, Date>, startTime: Date, endTime: Date): Record<string, Date>;
83
85
  private unWireEvents;
84
86
  destroy(): void;
85
87
  }
@@ -37,12 +37,7 @@ var EventBase = /** @class */ (function () {
37
37
  if (generateID) {
38
38
  event_1[fields.id] = temp++;
39
39
  }
40
- if (typeof event_1[fields.startTime] === 'string') {
41
- event_1[fields.startTime] = util.getDateFromString(event_1[fields.startTime]);
42
- }
43
- if (typeof event_1[fields.endTime] === 'string') {
44
- event_1[fields.endTime] = util.getDateFromString(event_1[fields.endTime]);
45
- }
40
+ event_1 = this_1.updateEventDateTime(event_1);
46
41
  if (timeZonePropChanged) {
47
42
  this_1.processTimezoneChange(event_1, oldTimezone);
48
43
  }
@@ -119,6 +114,15 @@ var EventBase = /** @class */ (function () {
119
114
  this.parent.blockProcessed = blockData;
120
115
  return eventData;
121
116
  };
117
+ EventBase.prototype.updateEventDateTime = function (eventData) {
118
+ if (typeof eventData[this.parent.eventFields.startTime] === 'string') {
119
+ eventData[this.parent.eventFields.startTime] = util.getDateFromString(eventData[this.parent.eventFields.startTime]);
120
+ }
121
+ if (typeof eventData[this.parent.eventFields.endTime] === 'string') {
122
+ eventData[this.parent.eventFields.endTime] = util.getDateFromString(eventData[this.parent.eventFields.endTime]);
123
+ }
124
+ return eventData;
125
+ };
122
126
  EventBase.prototype.getProcessedEvents = function (eventCollection) {
123
127
  if (eventCollection === void 0) { eventCollection = this.parent.eventsData; }
124
128
  var processed = [];
@@ -636,7 +640,7 @@ var EventBase = /** @class */ (function () {
636
640
  var isAllDay = event[fieldMapping.isAllDay];
637
641
  var isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
638
642
  / util.MS_PER_DAY) >= 1;
639
- return (isAllDay || isFullDay) ? true : false;
643
+ return (isAllDay || (this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' && isFullDay)) ? true : false;
640
644
  };
641
645
  EventBase.prototype.addEventListener = function () {
642
646
  this.parent.on(event.documentClick, this.appointmentBorderRemove, this);
@@ -726,7 +730,8 @@ var EventBase = /** @class */ (function () {
726
730
  EventBase.prototype.eventClick = function (eventData) {
727
731
  var _this = this;
728
732
  var target = eventData.target;
729
- 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)) {
730
735
  return;
731
736
  }
732
737
  if ((eventData.ctrlKey || eventData.metaKey) && eventData.which === 1 && this.parent.keyboardInteractionModule) {
@@ -1207,13 +1212,28 @@ var EventBase = /** @class */ (function () {
1207
1212
  indentHeight = dateHeader.offsetHeight - indentHeight;
1208
1213
  this.parent.element.querySelector('.' + cls.ALLDAY_CELLS_CLASS).style.height = (indentHeight / 12) + 'em';
1209
1214
  var content = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);
1210
- if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged)) {
1215
+ if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged || this.parent.element.classList.contains(cls.DEVICE_CLASS))) {
1211
1216
  addClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);
1212
1217
  }
1213
1218
  else {
1214
1219
  removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);
1215
1220
  }
1216
1221
  };
1222
+ EventBase.prototype.updateEventMinimumDuration = function (startEndHours, startTime, endTime) {
1223
+ var eventDuration = (util.getUniversalTime(endTime) - util.getUniversalTime(startTime)) / util.MS_PER_MINUTE;
1224
+ if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
1225
+ var tempEnd = new Date(startTime);
1226
+ tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
1227
+ endTime = tempEnd;
1228
+ if (endTime.getTime() > startEndHours.endHour.getTime()) {
1229
+ var tempStart = new Date(startEndHours.endHour.getTime());
1230
+ tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
1231
+ startTime = tempStart;
1232
+ endTime = startEndHours.endHour;
1233
+ }
1234
+ }
1235
+ return { startDate: startTime, endDate: endTime };
1236
+ };
1217
1237
  EventBase.prototype.unWireEvents = function () {
1218
1238
  var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));
1219
1239
  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)) {
@@ -124,10 +124,10 @@ var MonthEvent = /** @class */ (function (_super) {
124
124
  this.parent.virtualScrollModule.updateVirtualScrollHeight();
125
125
  }
126
126
  }
127
- this.parent.notify(events.scrollUiUpdate, data);
128
127
  if (!this.parent.enablePersistence) {
129
128
  this.parent.notify(events.contentReady, {});
130
129
  }
130
+ this.parent.notify(events.scrollUiUpdate, data);
131
131
  if (this.parent.currentView === 'Month' && this.parent.showWeekNumber) {
132
132
  var totalCells_1 = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
133
133
  var weekNumberCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.WEEK_NUMBER_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
  };
@@ -1,4 +1,4 @@
1
- import { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';import { Query, DataManager } from '@syncfusion/ej2-data';import { SortComparerFunction } from '../base/interface';import { Field } from './fields';import { FieldModel } from './fields-model';
1
+ import { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';import { Query, DataManager } from '@syncfusion/ej2-data';import { SortComparerFunction } from '../base/interface';import { SpannedEventPlacement } from '../base/type';import { Field } from './fields';import { FieldModel } from './fields-model';
2
2
 
3
3
  /**
4
4
  * Interface for a class EventSettings
@@ -48,6 +48,25 @@ export interface EventSettingsModel {
48
48
  */
49
49
  enableTooltip?: boolean;
50
50
 
51
+ /**
52
+ * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
53
+ * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
54
+ * * AllDayRow
55
+ * * TimeSlot
56
+ * {% codeBlock src='schedule/spannedEventPlacement/index.md' %}{% endcodeBlock %}
57
+ *
58
+ * @default 'AllDayRow'
59
+ */
60
+ spannedEventPlacement?: SpannedEventPlacement;
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
+
51
70
  /**
52
71
  * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
53
72
  * All the event fields mapped with Schedule dataSource can be accessed within this template code.
@@ -1,6 +1,7 @@
1
1
  import { ChildProperty } from '@syncfusion/ej2-base';
2
2
  import { Query, DataManager } from '@syncfusion/ej2-data';
3
3
  import { SortComparerFunction } from '../base/interface';
4
+ import { SpannedEventPlacement } from '../base/type';
4
5
  import { FieldModel } from './fields-model';
5
6
  /**
6
7
  * Holds the configuration of event related options and dataSource binding to Schedule.
@@ -44,6 +45,23 @@ export declare class EventSettings extends ChildProperty<EventSettings> {
44
45
  * @default false
45
46
  */
46
47
  enableTooltip: boolean;
48
+ /**
49
+ * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
50
+ * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
51
+ * * AllDayRow
52
+ * * TimeSlot
53
+ * {% codeBlock src='schedule/spannedEventPlacement/index.md' %}{% endcodeBlock %}
54
+ *
55
+ * @default 'AllDayRow'
56
+ */
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;
47
65
  /**
48
66
  * It accepts either the string or HTMLElement as template design content and parse it appropriately before displaying it onto tooltip.
49
67
  * All the event fields mapped with Schedule dataSource can be accessed within this template code.
@@ -43,6 +43,12 @@ var EventSettings = /** @class */ (function (_super) {
43
43
  __decorate([
44
44
  Property(false)
45
45
  ], EventSettings.prototype, "enableTooltip", void 0);
46
+ __decorate([
47
+ Property('AllDayRow')
48
+ ], EventSettings.prototype, "spannedEventPlacement", void 0);
49
+ __decorate([
50
+ Property(1)
51
+ ], EventSettings.prototype, "minimumEventDuration", void 0);
46
52
  __decorate([
47
53
  Property()
48
54
  ], EventSettings.prototype, "tooltipTemplate", 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
  };
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { createElement, remove } from '@syncfusion/ej2-base';
2
+ import { createElement, isNullOrUndefined, remove } from '@syncfusion/ej2-base';
3
3
  import { FormValidator } from '@syncfusion/ej2-inputs';
4
4
  import * as cls from '../base/css-constant';
5
5
  /**
@@ -49,6 +49,9 @@ var FieldValidator = /** @class */ (function () {
49
49
  if (!elem && !this.ignoreError) {
50
50
  this.createTooltip(inputElement, error, id, '');
51
51
  }
52
+ if (!isNullOrUndefined(elem)) {
53
+ elem.querySelector('.e-error').innerHTML = error.innerHTML;
54
+ }
52
55
  };
53
56
  FieldValidator.prototype.createTooltip = function (element, error, name, display) {
54
57
  var dlgContent;
@@ -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
  };