@syncfusion/ej2-schedule 20.4.43 → 20.4.48

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 (54) hide show
  1. package/CHANGELOG.md +21 -3
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +183 -117
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +184 -117
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +15 -15
  13. package/src/schedule/actions/action-base.d.ts +0 -1
  14. package/src/schedule/actions/action-base.js +1 -6
  15. package/src/schedule/actions/drag.js +4 -3
  16. package/src/schedule/actions/resize.js +3 -3
  17. package/src/schedule/actions/touch.js +2 -1
  18. package/src/schedule/base/schedule.d.ts +2 -1
  19. package/src/schedule/base/schedule.js +6 -2
  20. package/src/schedule/event-renderer/event-base.d.ts +2 -0
  21. package/src/schedule/event-renderer/event-base.js +28 -4
  22. package/src/schedule/popups/event-window.js +40 -31
  23. package/src/schedule/popups/quick-popups.js +100 -67
  24. package/styles/bootstrap-dark.css +1 -1
  25. package/styles/bootstrap.css +1 -1
  26. package/styles/bootstrap4.css +1 -1
  27. package/styles/bootstrap5-dark.css +1 -1
  28. package/styles/bootstrap5.css +1 -1
  29. package/styles/fabric-dark.css +1 -1
  30. package/styles/fabric.css +1 -1
  31. package/styles/fluent-dark.css +1 -1
  32. package/styles/fluent.css +1 -1
  33. package/styles/highcontrast-light.css +1 -1
  34. package/styles/highcontrast.css +1 -1
  35. package/styles/material-dark.css +1 -1
  36. package/styles/material.css +1 -1
  37. package/styles/schedule/_layout.scss +1 -1
  38. package/styles/schedule/bootstrap-dark.css +1 -1
  39. package/styles/schedule/bootstrap.css +1 -1
  40. package/styles/schedule/bootstrap4.css +1 -1
  41. package/styles/schedule/bootstrap5-dark.css +1 -1
  42. package/styles/schedule/bootstrap5.css +1 -1
  43. package/styles/schedule/fabric-dark.css +1 -1
  44. package/styles/schedule/fabric.css +1 -1
  45. package/styles/schedule/fluent-dark.css +1 -1
  46. package/styles/schedule/fluent.css +1 -1
  47. package/styles/schedule/highcontrast-light.css +1 -1
  48. package/styles/schedule/highcontrast.css +1 -1
  49. package/styles/schedule/material-dark.css +1 -1
  50. package/styles/schedule/material.css +1 -1
  51. package/styles/schedule/tailwind-dark.css +1 -1
  52. package/styles/schedule/tailwind.css +1 -1
  53. package/styles/tailwind-dark.css +1 -1
  54. package/styles/tailwind.css +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.43
3
+ * version : 20.4.48
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-schedule@*",
3
- "_id": "@syncfusion/ej2-schedule@20.4.42",
3
+ "_id": "@syncfusion/ej2-schedule@20.4.44",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-iU0AJbA+5bi3QKX3EYVX2ePvk7gyS1ZeeHjaqv+R9Hen3SFHEW+n2l7weUdUEQ47mhktq7gdzpmZIzTvH6oJtw==",
5
+ "_integrity": "sha512-Chq8toDzHoZudpLLXZJKy5ukF5rES4F/VFTDj6WA4uPjMKy9rjXd5yVDSy5qyZr5B9jr2rpBzaRALo6KlTaG3w==",
6
6
  "_location": "/@syncfusion/ej2-schedule",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-schedule",
24
24
  "/@syncfusion/ej2-vue-schedule"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-20.4.42.tgz",
27
- "_shasum": "45e142eebbff3bf1535bcf4ab4a35922d7c9d124",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-20.4.44.tgz",
27
+ "_shasum": "8b8beacb4ec2f56791c78378307c65f2c4da000b",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
29
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.4.42",
39
- "@syncfusion/ej2-buttons": "~20.4.42",
40
- "@syncfusion/ej2-calendars": "~20.4.42",
41
- "@syncfusion/ej2-data": "~20.4.42",
42
- "@syncfusion/ej2-dropdowns": "~20.4.43",
43
- "@syncfusion/ej2-excel-export": "~20.4.42",
44
- "@syncfusion/ej2-inputs": "~20.4.42",
45
- "@syncfusion/ej2-lists": "~20.4.42",
46
- "@syncfusion/ej2-navigations": "~20.4.43",
47
- "@syncfusion/ej2-popups": "~20.4.43"
38
+ "@syncfusion/ej2-base": "~20.4.48",
39
+ "@syncfusion/ej2-buttons": "~20.4.48",
40
+ "@syncfusion/ej2-calendars": "~20.4.48",
41
+ "@syncfusion/ej2-data": "~20.4.48",
42
+ "@syncfusion/ej2-dropdowns": "~20.4.48",
43
+ "@syncfusion/ej2-excel-export": "~20.4.48",
44
+ "@syncfusion/ej2-inputs": "~20.4.48",
45
+ "@syncfusion/ej2-lists": "~20.4.48",
46
+ "@syncfusion/ej2-navigations": "~20.4.48",
47
+ "@syncfusion/ej2-popups": "~20.4.48"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.",
@@ -73,6 +73,6 @@
73
73
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
74
74
  },
75
75
  "typings": "index.d.ts",
76
- "version": "20.4.43",
76
+ "version": "20.4.48",
77
77
  "sideEffects": false
78
78
  }
@@ -22,7 +22,6 @@ export declare class ActionBase {
22
22
  saveChangedData(eventArgs: DragEventArgs | ResizeEventArgs, isMultiSelect?: boolean): void;
23
23
  calculateIntervalTime(date: Date): Date;
24
24
  getContentAreaDimension(): Record<string, any>;
25
- getPageCoordinates(e: MouseEvent & TouchEvent): (MouseEvent & TouchEvent) | Touch;
26
25
  getIndex(index: number): number;
27
26
  updateTimePosition(date: Date, multiData?: Record<string, any>[]): void;
28
27
  getResourceElements(table: HTMLTableCellElement[]): HTMLTableCellElement[];
@@ -109,11 +109,6 @@ var ActionBase = /** @class */ (function () {
109
109
  };
110
110
  return viewDimension;
111
111
  };
112
- ActionBase.prototype.getPageCoordinates = function (e) {
113
- var eventArgs = e.event;
114
- return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
115
- eventArgs || e;
116
- };
117
112
  ActionBase.prototype.getIndex = function (index) {
118
113
  var contentElements = [].slice.call(this.parent.getContentTable().querySelector('tr').children);
119
114
  var indexes = { minIndex: 0, maxIndex: contentElements.length - 1 };
@@ -250,7 +245,7 @@ var ActionBase = /** @class */ (function () {
250
245
  }
251
246
  };
252
247
  ActionBase.prototype.getCursorElement = function (e) {
253
- var pages = this.getPageCoordinates(e);
248
+ var pages = this.parent.eventBase.getPageCoordinates(e);
254
249
  return document.elementFromPoint(pages.clientX, pages.clientY);
255
250
  };
256
251
  ActionBase.prototype.autoScroll = function () {
@@ -292,7 +292,7 @@ var DragAndDrop = /** @class */ (function (_super) {
292
292
  return;
293
293
  }
294
294
  var eventObj = extend({}, this.actionObj.event, null, true);
295
- var eventArgs = this.getPageCoordinates(e);
295
+ var eventArgs = this.parent.eventBase.getPageCoordinates(e);
296
296
  this.actionObj.Y = this.actionObj.pageY = eventArgs.pageY;
297
297
  this.actionObj.X = this.actionObj.pageX = eventArgs.pageX;
298
298
  this.actionObj.target = e.target;
@@ -435,7 +435,8 @@ var DragAndDrop = /** @class */ (function (_super) {
435
435
  this.timelineEventModule.dateRender = this.parent.activeView.renderDates;
436
436
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
437
437
  this.timelineEventModule.getSlotDates();
438
- this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth : this.actionObj.cellWidth;
438
+ this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
439
+ this.parent.element.querySelector('.' + cls.WORK_CELLS_CLASS).getBoundingClientRect().width;
439
440
  this.calculateTimelineTime(e);
440
441
  }
441
442
  else {
@@ -1188,7 +1189,7 @@ var DragAndDrop = /** @class */ (function (_super) {
1188
1189
  return 0;
1189
1190
  };
1190
1191
  DragAndDrop.prototype.getColumnIndex = function (offsetLeft) {
1191
- var index = Math.floor(offsetLeft / this.actionObj.cellWidth);
1192
+ var index = Math.floor(offsetLeft / Math.trunc(this.actionObj.cellWidth));
1192
1193
  if (this.isHeaderRows) {
1193
1194
  return index;
1194
1195
  }
@@ -97,7 +97,7 @@ var Resize = /** @class */ (function (_super) {
97
97
  _this.actionObj.cellWidth = trRect.width / noOfDays;
98
98
  _this.actionObj.cellHeight = trRect.height;
99
99
  }
100
- var pages = _this.getPageCoordinates(e);
100
+ var pages = _this.parent.eventBase.getPageCoordinates(e);
101
101
  _this.actionObj.X = pages.pageX;
102
102
  _this.actionObj.Y = pages.pageY;
103
103
  _this.actionObj.groupIndex = parseInt(_this.actionObj.element.getAttribute('data-group-index') || '0', 10);
@@ -126,7 +126,7 @@ var Resize = /** @class */ (function (_super) {
126
126
  if ((!isNullOrUndefined(e.target)) && e.target.classList.contains(cls.DISABLE_DATES)) {
127
127
  return;
128
128
  }
129
- var pages = this.getPageCoordinates(e);
129
+ var pages = this.parent.eventBase.getPageCoordinates(e);
130
130
  if (this.parent.currentView === 'Month' || this.parent.currentView === 'TimelineYear') {
131
131
  var doc = document.documentElement;
132
132
  var left = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
@@ -559,7 +559,7 @@ var Resize = /** @class */ (function (_super) {
559
559
  return styles;
560
560
  };
561
561
  Resize.prototype.resizeValidation = function (e) {
562
- var pages = this.getPageCoordinates(e);
562
+ var pages = this.parent.eventBase.getPageCoordinates(e);
563
563
  var viewDimension = this.getContentAreaDimension();
564
564
  var isTimeScale = this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.timeScale.enable;
565
565
  var cellWidth = this.actionObj.cellWidth;
@@ -94,7 +94,7 @@ var ScheduleTouch = /** @class */ (function () {
94
94
  if (offsetDist > time || (e.distanceX > (this.parent.element.offsetWidth / 2))) {
95
95
  this.swapPanels(e.swipeDirection);
96
96
  if (offsetDist > time && (e.distanceX > (this.parent.element.offsetWidth / 2))) {
97
- this.element.style.transitionDuration = ((offsetDist / time) / 10) + 's';
97
+ this.element.style.transitionDuration = (((Browser.isDevice ? e.distanceX : offsetDist) / time) / 10) + 's';
98
98
  }
99
99
  this.confirmSwipe(e.swipeDirection);
100
100
  }
@@ -224,6 +224,7 @@ var ScheduleTouch = /** @class */ (function () {
224
224
  this.nextPanel = null;
225
225
  this.timeStampStart = null;
226
226
  this.element.style.transform = '';
227
+ this.element.style.transitionDuration = '';
227
228
  util.removeChildren(this.element);
228
229
  removeClass([this.element], cls.TRANSLATE_CLASS);
229
230
  };
@@ -890,10 +890,11 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
890
890
  /**
891
891
  * Method to render react templates
892
892
  *
893
+ * @param {Function} callBack - specifies the callBack method
893
894
  * @returns {void}
894
895
  * @private
895
896
  */
896
- renderTemplates(): void;
897
+ renderTemplates(callback?: Function): void;
897
898
  /**
898
899
  * Method to reset react templates
899
900
  *
@@ -135,12 +135,16 @@ var Schedule = /** @class */ (function (_super) {
135
135
  /**
136
136
  * Method to render react templates
137
137
  *
138
+ * @param {Function} callBack - specifies the callBack method
138
139
  * @returns {void}
139
140
  * @private
140
141
  */
141
- Schedule.prototype.renderTemplates = function () {
142
+ Schedule.prototype.renderTemplates = function (callback) {
142
143
  if (this.isReact) {
143
- this.renderReactTemplates();
144
+ this.renderReactTemplates(callback);
145
+ }
146
+ else if (callback) {
147
+ callback();
144
148
  }
145
149
  };
146
150
  /**
@@ -29,6 +29,7 @@ export declare class EventBase {
29
29
  filterEventsByResource(resourceTdData: TdData, appointments?: Record<string, any>[]): Record<string, any>[];
30
30
  sortByTime(appointmentsCollection: Record<string, any>[]): Record<string, any>[];
31
31
  sortByDateTime(appointments: Record<string, any>[]): Record<string, any>[];
32
+ private customSorting;
32
33
  getSmallestMissingNumber(array: number[]): number;
33
34
  splitEventByDay(event: Record<string, any>): Record<string, any>[];
34
35
  splitEvent(event: Record<string, any>, dateRender: Date[]): Record<string, any>[];
@@ -85,6 +86,7 @@ export declare class EventBase {
85
86
  allDayExpandScroll(dateHeader: HTMLElement): void;
86
87
  updateEventMinimumDuration(startEndHours: Record<string, Date>, startTime: Date, endTime: Date): Record<string, Date>;
87
88
  createEventWrapper(type?: string, index?: number): HTMLElement;
89
+ getPageCoordinates(e: MouseEvent & TouchEvent): (MouseEvent & TouchEvent) | Touch;
88
90
  private unWireEvents;
89
91
  destroy(): void;
90
92
  }
@@ -284,8 +284,8 @@ var EventBase = /** @class */ (function () {
284
284
  return filteredCollection;
285
285
  };
286
286
  EventBase.prototype.sortByTime = function (appointmentsCollection) {
287
- if (this.parent.eventSettings.sortComparer) {
288
- appointmentsCollection = this.parent.eventSettings.sortComparer.call(this.parent, appointmentsCollection);
287
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
288
+ appointmentsCollection = this.customSorting(appointmentsCollection);
289
289
  }
290
290
  else {
291
291
  var fieldMappings_1 = this.parent.eventFields;
@@ -298,8 +298,8 @@ var EventBase = /** @class */ (function () {
298
298
  return appointmentsCollection;
299
299
  };
300
300
  EventBase.prototype.sortByDateTime = function (appointments) {
301
- if (this.parent.eventSettings.sortComparer) {
302
- appointments = this.parent.eventSettings.sortComparer.call(this.parent, appointments);
301
+ if (this.parent.eventSettings.sortComparer && (typeof (this.parent.eventSettings.sortComparer) === 'function' || typeof (this.parent.eventSettings.sortComparer) === 'string')) {
302
+ appointments = this.customSorting(appointments);
303
303
  }
304
304
  else {
305
305
  var fieldMapping_1 = this.parent.eventFields;
@@ -315,6 +315,22 @@ var EventBase = /** @class */ (function () {
315
315
  }
316
316
  return appointments;
317
317
  };
318
+ EventBase.prototype.customSorting = function (appointments) {
319
+ if (typeof (this.parent.eventSettings.sortComparer) === 'function') {
320
+ return this.parent.eventSettings.sortComparer.call(this.parent, appointments);
321
+ }
322
+ else if (typeof (this.parent.eventSettings.sortComparer) === 'string') {
323
+ var splits = this.parent.eventSettings.sortComparer.split('.');
324
+ var sortFn = void 0;
325
+ if (!isNullOrUndefined(window)) {
326
+ sortFn = window[splits[splits.length - 1]];
327
+ }
328
+ if (sortFn) {
329
+ return sortFn(appointments);
330
+ }
331
+ }
332
+ return appointments;
333
+ };
318
334
  EventBase.prototype.getSmallestMissingNumber = function (array) {
319
335
  var large = Math.max.apply(Math, array);
320
336
  for (var i = 0; i < large; i++) {
@@ -1279,6 +1295,14 @@ var EventBase = /** @class */ (function () {
1279
1295
  }
1280
1296
  return tr;
1281
1297
  };
1298
+ EventBase.prototype.getPageCoordinates = function (e) {
1299
+ if (isNullOrUndefined(e)) {
1300
+ return e;
1301
+ }
1302
+ var eventArgs = e.event;
1303
+ return eventArgs && eventArgs.changedTouches ? eventArgs.changedTouches[0] : e.changedTouches ? e.changedTouches[0] :
1304
+ eventArgs || e;
1305
+ };
1282
1306
  EventBase.prototype.unWireEvents = function () {
1283
1307
  var appElements = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));
1284
1308
  for (var _i = 0, appElements_1 = appElements; _i < appElements_1.length; _i++) {
@@ -244,6 +244,7 @@ var EventWindow = /** @class */ (function () {
244
244
  return container;
245
245
  };
246
246
  EventWindow.prototype.renderFormElements = function (form, args) {
247
+ var _this = this;
247
248
  if (!isNullOrUndefined(this.parent.editorTemplate)) {
248
249
  if (args) {
249
250
  if (this.recurrenceEditor) {
@@ -260,8 +261,9 @@ var EventWindow = /** @class */ (function () {
260
261
  var templateId = this.parent.element.id + '_editorTemplate';
261
262
  var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
262
263
  append(tempEle, form);
263
- this.parent.renderTemplates();
264
- this.applyFormValidation();
264
+ this.parent.renderTemplates(function () {
265
+ _this.applyFormValidation();
266
+ });
265
267
  }
266
268
  else {
267
269
  form.appendChild(this.getDefaultEventWindowContent());
@@ -1207,7 +1209,9 @@ var EventWindow = /** @class */ (function () {
1207
1209
  }
1208
1210
  }
1209
1211
  if (this.recurrenceEditor && this.recurrenceEditor.value && this.recurrenceEditor.value !== '') {
1210
- alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
1212
+ if (this.parent.currentAction !== 'EditOccurrence') {
1213
+ alertType = this.recurrenceValidation(eventObj[this.fields.startTime], eventObj[this.fields.endTime], alert);
1214
+ }
1211
1215
  var isShowAlert = true;
1212
1216
  if (alertType === 'seriesChangeAlert' && this.parent.uiStateValues.isIgnoreOccurrence) {
1213
1217
  isShowAlert = false;
@@ -1440,53 +1444,58 @@ var EventWindow = /** @class */ (function () {
1440
1444
  if (isNullOrUndefined(index)) {
1441
1445
  return false;
1442
1446
  }
1447
+ var currentStartTime = new Date(+currentData[this.fields.startTime]);
1448
+ var currentEndTime = new Date(+currentData[this.fields.endTime]);
1449
+ if (index !== recurColl.length - 1) {
1450
+ var nextStartTime = new Date(+recurColl[index + 1][this.fields.startTime]);
1451
+ var nextEndTime = new Date(+recurColl[index + 1][this.fields.endTime]);
1452
+ }
1453
+ var lastEndTime = new Date(+recurColl[recurColl.length - 1][this.fields.endTime]);
1443
1454
  if (index === 0) {
1444
1455
  if (!isNullOrUndefined(recurColl[index + 1])) {
1445
- if (!(util.resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
1446
- util.resetTime(new Date(+currentData[this.fields.endTime])).getTime()) &&
1447
- (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() >=
1448
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())) {
1449
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
1456
+ if (!(nextStartTime.getTime() >= currentEndTime.getTime()) &&
1457
+ (util.resetTime(lastEndTime).getTime() >=
1458
+ util.resetTime(currentStartTime).getTime()) ||
1459
+ util.resetTime(lastEndTime).getTime() < util.resetTime(currentStartTime).getTime()) {
1460
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
1450
1461
  return true;
1451
1462
  }
1452
- else if (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
1453
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
1454
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
1463
+ else if (!(util.resetTime(currentStartTime).getTime() <
1464
+ util.resetTime(nextStartTime).getTime())) {
1465
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
1455
1466
  return true;
1456
1467
  }
1457
1468
  }
1458
1469
  return false;
1459
1470
  }
1460
1471
  else {
1472
+ var previousStartTime = new Date(+recurColl[index - 1][this.fields.startTime]);
1473
+ var previousEndTime = new Date(+recurColl[index - 1][this.fields.endTime]);
1461
1474
  if (index === recurColl.length - 1) {
1462
- if (!(util.resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
1463
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) &&
1464
- (util.resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() <=
1465
- util.resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
1466
- this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
1475
+ if (util.resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.startTime])).getTime() >
1476
+ util.resetTime(currentStartTime).getTime()) {
1477
+ this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
1467
1478
  return true;
1468
1479
  }
1469
- else if (util.resetTime(new Date(+recurColl[(recurColl.length - 1) - index][this.fields.endTime])).getTime() >
1470
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) {
1471
- this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
1480
+ else if (!((previousEndTime.getTime() <= currentStartTime.getTime()) &&
1481
+ (util.resetTime(currentStartTime).getTime() > util.resetTime(previousStartTime).getTime()))) {
1482
+ this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
1472
1483
  return true;
1473
1484
  }
1474
1485
  }
1475
- else if (!(((util.resetTime(new Date(+recurColl[index - 1][this.fields.endTime])).getTime() <
1476
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
1477
- (util.resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
1478
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())) &&
1479
- ((util.resetTime(new Date(+recurColl[index + 1][this.fields.startTime])).getTime() >
1480
- util.resetTime(new Date(+currentData[this.fields.endTime])).getTime()) ||
1481
- (util.resetTime(new Date(+recurColl[recurColl.length - 1][this.fields.endTime])).getTime() <
1482
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime())))) {
1486
+ else if (!(((util.resetTime(previousStartTime).getTime() < util.resetTime(currentStartTime).getTime()) ||
1487
+ util.resetTime(new Date(+recurColl[0][this.fields.startTime])).getTime() >
1488
+ util.resetTime(currentStartTime).getTime()) &&
1489
+ ((util.resetTime(nextStartTime).getTime() > util.resetTime(currentStartTime).getTime()) ||
1490
+ (lastEndTime.getTime() < currentStartTime.getTime())))) {
1483
1491
  this.parent.quickPopup.openRecurrenceValidationAlert('sameDayAlert');
1484
1492
  return true;
1485
1493
  }
1486
- else if ((util.resetTime(new Date(+recurColl[index + 1][this.fields.endTime])).getTime() <
1487
- util.resetTime(new Date(+currentData[this.fields.startTime])).getTime()) ||
1488
- (util.resetTime(new Date(+recurColl[index - 1][this.fields.startTime])).getTime() >
1489
- util.resetTime(new Date(+currentData[this.fields.endTime])).getTime())) {
1494
+ else if (!(previousEndTime.getTime() <= currentStartTime.getTime() && nextStartTime.getTime() >
1495
+ currentEndTime.getTime()) || (util.resetTime(nextEndTime).getTime() <
1496
+ util.resetTime(currentStartTime).getTime()) ||
1497
+ (util.resetTime(previousStartTime).getTime() > util.resetTime(currentEndTime).getTime()) ||
1498
+ !(util.resetTime(currentStartTime).getTime() < util.resetTime(nextStartTime).getTime())) {
1490
1499
  this.parent.quickPopup.openRecurrenceValidationAlert('occurrenceAlert');
1491
1500
  return true;
1492
1501
  }
@@ -393,7 +393,7 @@ var QuickPopups = /** @class */ (function () {
393
393
  if (deleteIcon) {
394
394
  this.renderButton('e-flat e-round e-small', cls.ICON + ' ' + cls.DELETE_ICON_CLASS, deleteAction, deleteIcon, this.deleteClick);
395
395
  }
396
- this.beforeQuickPopupOpen(target);
396
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(e));
397
397
  };
398
398
  QuickPopups.prototype.isCellBlocked = function (args) {
399
399
  var tempObj = {};
@@ -480,7 +480,7 @@ var QuickPopups = /** @class */ (function () {
480
480
  this.quickPopup.content = quickCellPopup;
481
481
  this.quickPopup.relateTo = target;
482
482
  this.quickPopup.dataBind();
483
- this.beforeQuickPopupOpen(target);
483
+ this.beforeQuickPopupOpen(target, this.parent.eventBase.getPageCoordinates(args.event));
484
484
  };
485
485
  QuickPopups.prototype.isSameEventClick = function (events) {
486
486
  var isSameTarget = this.quickPopup.relateTo === closest(events.element, '.' + cls.APPOINTMENT_CLASS);
@@ -557,7 +557,7 @@ var QuickPopups = /** @class */ (function () {
557
557
  this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
558
558
  closest(events.element, '.' + cls.APPOINTMENT_CLASS);
559
559
  this.quickPopup.dataBind();
560
- this.beforeQuickPopupOpen(events.element);
560
+ this.beforeQuickPopupOpen(events.element, this.parent.eventBase.getPageCoordinates(events.originalEvent));
561
561
  }
562
562
  };
563
563
  QuickPopups.prototype.getPopupHeader = function (headerType, headerData) {
@@ -838,15 +838,16 @@ var QuickPopups = /** @class */ (function () {
838
838
  this.morePopup.relateTo = closest(target, '.' + cls.WORK_CELLS_CLASS);
839
839
  }
840
840
  }
841
- this.parent.renderTemplates();
842
- var eventProp = {
843
- type: 'EventContainer', cancel: false,
844
- element: this.morePopup.element, data: data
845
- };
846
- this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {
847
- if (!popupArgs.cancel) {
848
- _this.morePopup.show();
849
- }
841
+ this.parent.renderTemplates(function () {
842
+ var eventProp = {
843
+ type: 'EventContainer', cancel: false,
844
+ element: _this.morePopup.element, data: data
845
+ };
846
+ _this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {
847
+ if (!popupArgs.cancel) {
848
+ _this.morePopup.show();
849
+ }
850
+ });
850
851
  });
851
852
  };
852
853
  QuickPopups.prototype.saveClick = function (event) {
@@ -1037,71 +1038,103 @@ var QuickPopups = /** @class */ (function () {
1037
1038
  }
1038
1039
  });
1039
1040
  };
1040
- QuickPopups.prototype.beforeQuickPopupOpen = function (target) {
1041
+ QuickPopups.prototype.beforeQuickPopupOpen = function (target, originalEvent) {
1041
1042
  var _this = this;
1042
- this.parent.renderTemplates();
1043
- var isEventPopup = this.quickPopup.element.querySelector('.' + cls.EVENT_POPUP_CLASS);
1044
- var popupType = this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
1045
- var eventProp = {
1046
- type: popupType, cancel: false, data: extend({}, this.getDataFromTarget(target), null, true),
1047
- target: target, element: this.quickPopup.element
1048
- };
1049
- this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {
1050
- if (popupArgs.cancel) {
1051
- _this.quickPopupHide();
1052
- _this.destroyPopupButtons('quickPopup');
1053
- if (popupArgs.element.classList.contains(cls.POPUP_OPEN)) {
1054
- _this.quickPopupClose();
1055
- }
1056
- util.removeChildren(_this.quickPopup.element);
1057
- _this.isMultipleEventSelect = false;
1058
- }
1059
- else {
1060
- var display = _this.quickPopup.element.style.display;
1061
- _this.quickPopup.element.style.display = 'block';
1062
- if (_this.parent.isAdaptive) {
1063
- _this.quickPopup.element.removeAttribute('style');
1064
- _this.quickPopup.element.style.display = 'block';
1065
- _this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
1043
+ this.parent.renderTemplates(function () {
1044
+ var isEventPopup = _this.quickPopup.element.querySelector('.' + cls.EVENT_POPUP_CLASS);
1045
+ var popupType = _this.parent.isAdaptive ? isEventPopup ? 'ViewEventInfo' : 'EditEventInfo' : 'QuickInfo';
1046
+ var eventProp = {
1047
+ type: popupType, cancel: false, data: extend({}, _this.getDataFromTarget(target), null, true),
1048
+ target: target, element: _this.quickPopup.element
1049
+ };
1050
+ _this.parent.trigger(event.popupOpen, eventProp, function (popupArgs) {
1051
+ if (popupArgs.cancel) {
1052
+ _this.quickPopupHide();
1053
+ _this.destroyPopupButtons('quickPopup');
1054
+ if (popupArgs.element.classList.contains(cls.POPUP_OPEN)) {
1055
+ _this.quickPopupClose();
1056
+ }
1057
+ util.removeChildren(_this.quickPopup.element);
1058
+ _this.isMultipleEventSelect = false;
1066
1059
  }
1067
1060
  else {
1068
- var isVirtualScroll = _this.parent.virtualScrollModule && _this.parent.virtualScrollModule.isHorizontalScroll
1069
- && !isNullOrUndefined(closest(target, '.' + cls.CONTENT_TABLE_CLASS));
1070
- var conTable = _this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS + ' table');
1071
- _this.quickPopup.offsetX = isVirtualScroll && !_this.parent.enableRtl ? (util.getTranslateX(conTable) + 10) : 10;
1072
- _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
1073
- _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: _this.parent.enableRtl ? 'bottom' : 'top' };
1074
- _this.quickPopup.dataBind();
1075
- _this.quickPopup.refreshPosition(null, true);
1076
- var collide = isCollide(_this.quickPopup.element, _this.parent.element);
1077
- if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {
1078
- _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;
1079
- if (isVirtualScroll && !_this.parent.enableRtl) {
1080
- _this.quickPopup.offsetX = util.getTranslateX(conTable) + _this.quickPopup.offsetX;
1081
- }
1061
+ var display = _this.quickPopup.element.style.display;
1062
+ _this.quickPopup.element.style.display = 'block';
1063
+ if (_this.parent.isAdaptive) {
1064
+ _this.quickPopup.element.removeAttribute('style');
1065
+ _this.quickPopup.element.style.display = 'block';
1066
+ _this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
1067
+ }
1068
+ else {
1069
+ var isVirtualScroll = _this.parent.virtualScrollModule && _this.parent.virtualScrollModule.isHorizontalScroll
1070
+ && !isNullOrUndefined(closest(target, '.' + cls.CONTENT_TABLE_CLASS));
1071
+ var conTable = _this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS + ' table');
1072
+ _this.quickPopup.offsetX = isVirtualScroll && !_this.parent.enableRtl ? (util.getTranslateX(conTable) + 10) : 10;
1073
+ _this.quickPopup.offsetY = _this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll ?
1074
+ _this.quickPopup.offsetY : 0;
1075
+ _this.quickPopup.collision = { X: _this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
1076
+ _this.quickPopup.position = { X: _this.parent.enableRtl ? 'left' : 'right', Y: _this.parent.enableRtl ? 'bottom' : 'top' };
1082
1077
  _this.quickPopup.dataBind();
1083
1078
  _this.quickPopup.refreshPosition(null, true);
1084
- var leftCollide = isCollide(_this.quickPopup.element, _this.parent.element);
1085
- if (leftCollide.indexOf('left') > -1) {
1086
- _this.quickPopup.position = { X: 'center', Y: 'center' };
1087
- _this.quickPopup.collision = { X: 'fit', Y: 'fit' };
1088
- _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);
1079
+ var collide = isCollide(_this.quickPopup.element, _this.parent.element);
1080
+ if (collide.indexOf(_this.parent.enableRtl ? 'left' : 'right') > -1) {
1081
+ _this.quickPopup.offsetX = -target.offsetWidth - 10 - _this.quickPopup.element.offsetWidth;
1082
+ if (isVirtualScroll && !_this.parent.enableRtl) {
1083
+ _this.quickPopup.offsetX = util.getTranslateX(conTable) + _this.quickPopup.offsetX;
1084
+ }
1089
1085
  _this.quickPopup.dataBind();
1086
+ _this.quickPopup.refreshPosition(null, true);
1087
+ var leftCollide = isCollide(_this.quickPopup.element, _this.parent.element);
1088
+ if (leftCollide.indexOf('left') > -1) {
1089
+ _this.quickPopup.position = { X: 'center', Y: 'center' };
1090
+ _this.quickPopup.collision = { X: 'fit', Y: 'fit' };
1091
+ _this.quickPopup.offsetX = -(_this.quickPopup.element.offsetWidth / 2);
1092
+ _this.quickPopup.dataBind();
1093
+ }
1094
+ }
1095
+ if (_this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
1096
+ var translateY = util.getTranslateY(conTable);
1097
+ _this.quickPopup.offsetY = translateY;
1098
+ _this.quickPopup.dataBind();
1099
+ _this.quickPopup.refreshPosition(null, true);
1100
+ }
1101
+ if (_this.quickPopup.position.X === 'center' && _this.quickPopup.position.Y === 'center' && !isNullOrUndefined(originalEvent) &&
1102
+ originalEvent.clientX && originalEvent.clientY) {
1103
+ var clientX = originalEvent.clientX;
1104
+ var clientY = originalEvent.clientY;
1105
+ var targetRect = target.getBoundingClientRect();
1106
+ var offsetY = originalEvent.offsetY || Math.ceil(clientY - targetRect.y);
1107
+ var previousOffset = _this.quickPopup.offsetY;
1108
+ var collision = isCollide(_this.quickPopup.element, target);
1109
+ var popupRect = _this.quickPopup.element.getBoundingClientRect();
1110
+ var targetEle = document.elementFromPoint(clientX, clientY);
1111
+ if (collision.indexOf('top') > -1 || collision.indexOf('bottom') > -1 || closest(targetEle, '.' + cls.POPUP_WRAPPER_CLASS)) {
1112
+ if (popupRect.top <= clientY &&
1113
+ clientY <= popupRect.top + popupRect.height) {
1114
+ _this.quickPopup.offsetY = previousOffset - popupRect.height - 10;
1115
+ _this.quickPopup.dataBind();
1116
+ collision = isCollide(_this.quickPopup.element, _this.parent.element);
1117
+ if (collision.indexOf('top') > -1) {
1118
+ _this.quickPopup.offsetY = previousOffset + offsetY + 10;
1119
+ _this.quickPopup.dataBind();
1120
+ }
1121
+ }
1122
+ else if (isCollide(_this.quickPopup.element, _this.parent.element).indexOf('bottom') > -1) {
1123
+ _this.quickPopup.offsetY =
1124
+ previousOffset - offsetY - Math.ceil(popupRect.height) - 10;
1125
+ _this.quickPopup.dataBind();
1126
+ }
1127
+ }
1090
1128
  }
1091
1129
  }
1092
- if (_this.parent.virtualScrollModule && !_this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
1093
- var translateY = util.getTranslateY(conTable);
1094
- _this.quickPopup.offsetY = translateY;
1095
- _this.quickPopup.dataBind();
1130
+ if (isEventPopup) {
1131
+ _this.applyEventColor();
1096
1132
  }
1133
+ _this.quickPopup.element.style.display = display;
1134
+ _this.quickPopup.dataBind();
1135
+ _this.quickPopup.show();
1097
1136
  }
1098
- if (isEventPopup) {
1099
- _this.applyEventColor();
1100
- }
1101
- _this.quickPopup.element.style.display = display;
1102
- _this.quickPopup.dataBind();
1103
- _this.quickPopup.show();
1104
- }
1137
+ });
1105
1138
  });
1106
1139
  };
1107
1140
  QuickPopups.prototype.applyEventColor = function () {
@@ -465,7 +465,7 @@
465
465
  vertical-align: top;
466
466
  }
467
467
  .e-schedule .e-table-container.e-translate {
468
- transition: transform 0.3s ease 0s;
468
+ transition: transform 0.1s ease 0s;
469
469
  }
470
470
  .e-schedule .e-resource-tree-popup {
471
471
  background: #6e6e6e;