@syncfusion/ej2-schedule 21.2.3 → 21.2.5

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.3
3
+ * version : 21.2.5
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@21.1.41",
3
+ "_id": "@syncfusion/ej2-schedule@21.2.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-3TzRE+vjuSqMo3rnt+t+iu5n2GtQPJ5H40YcVuZInxT3NkV7CmlY4wyIxw1oTF/bWCqiG9SQc9ShPxy9RkgkPg==",
5
+ "_integrity": "sha512-Cla0X2FzqLyZKXiuKq+zyVF1qZ8MX1VHc8jIYvkdtNbDHzwrS4e2YSpelZ5xoyWR2svYhZoOSZNL1Wu5f7bM2A==",
6
6
  "_location": "/@syncfusion/ej2-schedule",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -18,10 +18,13 @@
18
18
  },
19
19
  "_requiredBy": [
20
20
  "/",
21
- "/@syncfusion/ej2"
21
+ "/@syncfusion/ej2",
22
+ "/@syncfusion/ej2-angular-schedule",
23
+ "/@syncfusion/ej2-react-schedule",
24
+ "/@syncfusion/ej2-vue-schedule"
22
25
  ],
23
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-21.1.41.tgz",
24
- "_shasum": "50faf8c7a5144da5b93b743315134014912cc5d4",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-21.2.4.tgz",
27
+ "_shasum": "e7dcded313247a3cf0ffa986dd88c88b2c931d36",
25
28
  "_spec": "@syncfusion/ej2-schedule@*",
26
29
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
27
30
  "author": {
@@ -33,15 +36,15 @@
33
36
  "bundleDependencies": false,
34
37
  "dependencies": {
35
38
  "@syncfusion/ej2-base": "~21.2.3",
36
- "@syncfusion/ej2-buttons": "~21.2.3",
37
- "@syncfusion/ej2-calendars": "~21.2.3",
38
- "@syncfusion/ej2-data": "~21.2.3",
39
- "@syncfusion/ej2-dropdowns": "~21.2.3",
40
- "@syncfusion/ej2-excel-export": "~21.2.3",
41
- "@syncfusion/ej2-inputs": "~21.2.3",
39
+ "@syncfusion/ej2-buttons": "~21.2.5",
40
+ "@syncfusion/ej2-calendars": "~21.2.5",
41
+ "@syncfusion/ej2-data": "~21.2.4",
42
+ "@syncfusion/ej2-dropdowns": "~21.2.5",
43
+ "@syncfusion/ej2-excel-export": "~21.2.4",
44
+ "@syncfusion/ej2-inputs": "~21.2.4",
42
45
  "@syncfusion/ej2-lists": "~21.2.3",
43
- "@syncfusion/ej2-navigations": "~21.2.3",
44
- "@syncfusion/ej2-popups": "~21.2.3"
46
+ "@syncfusion/ej2-navigations": "~21.2.5",
47
+ "@syncfusion/ej2-popups": "~21.2.4"
45
48
  },
46
49
  "deprecated": false,
47
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.",
@@ -70,6 +73,6 @@
70
73
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
74
  },
72
75
  "typings": "index.d.ts",
73
- "version": "21.2.3",
76
+ "version": "21.2.5",
74
77
  "sideEffects": false
75
78
  }
@@ -1070,9 +1070,12 @@ var DragAndDrop = /** @class */ (function (_super) {
1070
1070
  }
1071
1071
  else {
1072
1072
  if (this.isCursorAhead || cursorDrag) {
1073
- eventStart.setMinutes(eventStart.getMinutes() +
1074
- (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval));
1073
+ var minutes = this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval;
1074
+ eventStart.setMinutes(eventStart.getMinutes() + minutes);
1075
1075
  eventStart.setMilliseconds(-(eventDuration));
1076
+ if (eventStart.getTime() === util.resetTime(eventStart).getTime() && eventStart.getMinutes() === 0 && eventDuration === 0) {
1077
+ eventStart.setMinutes(-minutes);
1078
+ }
1076
1079
  }
1077
1080
  else {
1078
1081
  eventStart.setMinutes(eventStart.getMinutes() -
@@ -112,7 +112,9 @@ var InlineEdit = /** @class */ (function () {
112
112
  allDayElements[0].offsetHeight) - 1;
113
113
  }
114
114
  verticalEvent.allDayLevel = allDayLevel;
115
- verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
115
+ var appHeight = util.getElementHeightFromClass(this.parent.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_WRAPPER_CLASS), cls.APPOINTMENT_CLASS);
116
+ var cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
117
+ verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
116
118
  }
117
119
  else {
118
120
  verticalEvent.renderNormalEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
@@ -25,6 +25,7 @@ export declare class TimelineEvent extends MonthEvent {
25
25
  renderEvents(event: Record<string, any>, resIndex: number, appointmentsList?: Record<string, any>[]): void;
26
26
  private renderTimelineMoreIndicator;
27
27
  updateCellHeight(cell: HTMLElement, height: number): void;
28
+ private adjustAppointments;
28
29
  private getFirstChild;
29
30
  updateBlockElements(): void;
30
31
  getStartTime(event: Record<string, any>, eventData: Record<string, any>): Date;
@@ -197,10 +197,21 @@ var TimelineEvent = /** @class */ (function (_super) {
197
197
  'width': appWidth + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
198
198
  });
199
199
  this.wireAppointmentEvents(appointmentElement, event);
200
- this.renderEventElement(event, appointmentElement, cellTd);
201
200
  if (this.parent.rowAutoHeight) {
201
+ var conWrap = this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);
202
+ var conWidth = conWrap.getBoundingClientRect().width;
203
+ var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
204
+ conWrap.offsetWidth === conWrap.clientWidth;
205
+ this.renderEventElement(event, appointmentElement, cellTd);
202
206
  var firstChild = this.getFirstChild(resIndex);
203
207
  this.updateCellHeight(firstChild, height);
208
+ if (isWithoutScroll &&
209
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
210
+ this.adjustAppointments(conWidth);
211
+ }
212
+ }
213
+ else {
214
+ this.renderEventElement(event, appointmentElement, cellTd);
204
215
  }
205
216
  }
206
217
  else {
@@ -292,6 +303,22 @@ var TimelineEvent = /** @class */ (function (_super) {
292
303
  }
293
304
  }
294
305
  };
306
+ TimelineEvent.prototype.adjustAppointments = function (conWidth) {
307
+ var _this = this;
308
+ var tr = this.parent.element.querySelector('.' + cls.CONTENT_TABLE_CLASS + ' tbody tr');
309
+ this.cellWidth = this.workCells[0].getBoundingClientRect().width;
310
+ var currentPercentage = (this.cellWidth * tr.children.length) / (conWidth / 100);
311
+ var apps = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS));
312
+ apps.forEach(function (app) {
313
+ if (_this.parent.enableRtl && app.style.right !== '0px') {
314
+ app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
315
+ }
316
+ else if (app.style.left !== '0px') {
317
+ app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
318
+ }
319
+ app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
320
+ });
321
+ };
295
322
  TimelineEvent.prototype.getFirstChild = function (index) {
296
323
  var query = '.' + cls.CONTENT_TABLE_CLASS + ' tbody td';
297
324
  var groupIndex = '';
@@ -40,7 +40,7 @@ export declare class VerticalEvent extends EventBase {
40
40
  private createMoreIndicator;
41
41
  isSpannedEvent(record: Record<string, any>, day: number, resource: number): Record<string, any>;
42
42
  private isWorkDayAvailable;
43
- renderAllDayEvents(eventObj: Record<string, any>, dayIndex: number, resource: number, dayCount: number, inline?: boolean): void;
43
+ renderAllDayEvents(eventObj: Record<string, any>, dayIndex: number, resource: number, dayCount: number, inline: boolean, cellTop: number, eventHeight: number): void;
44
44
  renderNormalEvents(eventObj: Record<string, any>, dayIndex: number, resource: number, dayCount: number, inline?: boolean): void;
45
45
  private getEventWidth;
46
46
  private getEventLeft;
@@ -96,6 +96,7 @@ var VerticalEvent = /** @class */ (function (_super) {
96
96
  removeClass(this.allDayElement, cls.ALLDAY_ROW_ANIMATE_CLASS);
97
97
  this.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
98
98
  this.renderEvents('allDayEvents');
99
+ this.animation.animate(this.allDayElement[0]);
99
100
  }
100
101
  this.parent.notify(events.contentReady, {});
101
102
  addClass(this.allDayElement, cls.ALLDAY_ROW_ANIMATE_CLASS);
@@ -198,6 +199,8 @@ var VerticalEvent = /** @class */ (function (_super) {
198
199
  var resources = this.getResourceList();
199
200
  var dateCount = this.getStartCount();
200
201
  var isRender;
202
+ var appHeight = eventType === 'allDayEvents' ? util.getElementHeightFromClass(this.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_WRAPPER_CLASS), cls.APPOINTMENT_CLASS) : 0;
203
+ var allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
201
204
  var _loop_1 = function (resource) {
202
205
  isRender = true;
203
206
  if (this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction && eventType !== 'allDayEvents'
@@ -224,7 +227,7 @@ var VerticalEvent = /** @class */ (function (_super) {
224
227
  this_1.setValues(event_2, resource);
225
228
  }
226
229
  if (eventType === 'allDayEvents') {
227
- this_1.renderAllDayEvents(event_2, day, resource, dateCount);
230
+ this_1.renderAllDayEvents(event_2, day, resource, dateCount, false, allDayRowTop, appHeight);
228
231
  }
229
232
  else {
230
233
  if (this_1.isAllDayAppointment(event_2)) {
@@ -460,7 +463,8 @@ var VerticalEvent = /** @class */ (function (_super) {
460
463
  }
461
464
  return true;
462
465
  };
463
- VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline) {
466
+ // eslint-disable-next-line max-len
467
+ VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline, cellTop, eventHeight) {
464
468
  var _this = this;
465
469
  var currentDates = this.getRenderedDates(this.dateRender[parseInt(resource.toString(), 10)]) ||
466
470
  this.dateRender[parseInt(resource.toString(), 10)];
@@ -469,8 +473,6 @@ var VerticalEvent = /** @class */ (function (_super) {
469
473
  currentDates = [this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)]];
470
474
  }
471
475
  var record = this.splitEvent(eventObj, currentDates)[0];
472
- var allDayRowCell = this.element.querySelector('.' + cls.ALLDAY_CELLS_CLASS + ':first-child');
473
- var cellTop = allDayRowCell.offsetTop;
474
476
  var eStart = new Date(record[this.parent.eventFields.startTime].getTime());
475
477
  var eEnd = new Date(record[this.parent.eventFields.endTime].getTime());
476
478
  var appWidth = 0;
@@ -523,8 +525,7 @@ var VerticalEvent = /** @class */ (function (_super) {
523
525
  this.parent.trigger(events.eventRendered, args, function (eventArgs) {
524
526
  if (!eventArgs.cancel) {
525
527
  eventWrapper_1.appendChild(appointmentElement_1);
526
- var appHeight = appointmentElement_1.offsetHeight;
527
- topValue += (allDayIndex_1 === 0 ? cellTop : (cellTop + (allDayIndex_1 * appHeight))) + 1;
528
+ topValue += (allDayIndex_1 === 0 ? cellTop : (cellTop + (allDayIndex_1 * eventHeight))) + 1;
528
529
  setStyleAttribute(appointmentElement_1, { 'width': appWidth + '%', 'top': formatUnit(topValue) });
529
530
  if (allDayIndex_1 > 1) {
530
531
  _this.moreEvents.push(appointmentElement_1);
@@ -532,9 +533,9 @@ var VerticalEvent = /** @class */ (function (_super) {
532
533
  _this.createMoreIndicator(allDayRow_1, count, wIndex_1);
533
534
  }
534
535
  }
535
- allDayRowCell.setAttribute('data-count', _this.allDayLevel.toString());
536
+ _this.allDayElement[0].setAttribute('data-count', _this.allDayLevel.toString());
536
537
  var allDayRowHeight = ((!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) ?
537
- (3 * appHeight) : ((_this.allDayLevel + 1) * appHeight)) + 4;
538
+ (3 * eventHeight) : ((_this.allDayLevel + 1) * eventHeight)) + 4;
538
539
  _this.setAllDayRowHeight(allDayRowHeight);
539
540
  _this.addOrRemoveClass();
540
541
  _this.wireAppointmentEvents(appointmentElement_1, eventObj);
@@ -764,14 +765,12 @@ var VerticalEvent = /** @class */ (function (_super) {
764
765
  this.parent.eventBase.allDayExpandScroll(dateHeader);
765
766
  }
766
767
  else {
767
- dateHeader.scrollTop = 0;
768
768
  for (var _i = 0, _a = this.allDayElement; _i < _a.length; _i++) {
769
769
  var element = _a[_i];
770
770
  element.style.height = (height / 12) + 'em';
771
771
  }
772
772
  removeClass([dateHeader], cls.ALLDAY_APPOINTMENT_SCROLL);
773
773
  }
774
- this.animation.animate(this.allDayElement[0]);
775
774
  };
776
775
  VerticalEvent.prototype.addOrRemoveClass = function () {
777
776
  var _this = this;
@@ -831,8 +830,10 @@ var VerticalEvent = /** @class */ (function (_super) {
831
830
  target.setAttribute('title', this.parent.localeObj.getConstant('expandAllDaySection'));
832
831
  target.setAttribute('aria-label', 'Expand section');
833
832
  rowHeight = (3 * this.getEventHeight()) + 4;
833
+ this.parent.element.querySelector('.' + cls.DATE_HEADER_WRAP_CLASS).scrollTop = 0;
834
834
  }
835
835
  this.setAllDayRowHeight(rowHeight);
836
+ this.animation.animate(this.allDayElement[0]);
836
837
  this.addOrRemoveClass();
837
838
  this.animation.animate(target);
838
839
  };