@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.
@@ -6670,6 +6670,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6670
6670
  removeClass(this.allDayElement, ALLDAY_ROW_ANIMATE_CLASS);
6671
6671
  this.slots.push(this.parent.activeView.renderDates.map(function (date) { return +date; }));
6672
6672
  this.renderEvents('allDayEvents');
6673
+ this.animation.animate(this.allDayElement[0]);
6673
6674
  }
6674
6675
  this.parent.notify(contentReady, {});
6675
6676
  addClass(this.allDayElement, ALLDAY_ROW_ANIMATE_CLASS);
@@ -6772,6 +6773,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6772
6773
  var resources = this.getResourceList();
6773
6774
  var dateCount = this.getStartCount();
6774
6775
  var isRender;
6776
+ var appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
6777
+ var allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
6775
6778
  var _loop_1 = function (resource) {
6776
6779
  isRender = true;
6777
6780
  if (this_1.parent.crudModule && this_1.parent.crudModule.crudObj.isCrudAction && eventType !== 'allDayEvents'
@@ -6798,7 +6801,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6798
6801
  this_1.setValues(event_2, resource);
6799
6802
  }
6800
6803
  if (eventType === 'allDayEvents') {
6801
- this_1.renderAllDayEvents(event_2, day, resource, dateCount);
6804
+ this_1.renderAllDayEvents(event_2, day, resource, dateCount, false, allDayRowTop, appHeight);
6802
6805
  }
6803
6806
  else {
6804
6807
  if (this_1.isAllDayAppointment(event_2)) {
@@ -7034,7 +7037,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7034
7037
  }
7035
7038
  return true;
7036
7039
  };
7037
- VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline) {
7040
+ // eslint-disable-next-line max-len
7041
+ VerticalEvent.prototype.renderAllDayEvents = function (eventObj, dayIndex, resource, dayCount, inline, cellTop, eventHeight) {
7038
7042
  var _this = this;
7039
7043
  var currentDates = this.getRenderedDates(this.dateRender[parseInt(resource.toString(), 10)]) ||
7040
7044
  this.dateRender[parseInt(resource.toString(), 10)];
@@ -7043,8 +7047,6 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7043
7047
  currentDates = [this.dateRender[parseInt(resource.toString(), 10)][parseInt(dayIndex.toString(), 10)]];
7044
7048
  }
7045
7049
  var record = this.splitEvent(eventObj, currentDates)[0];
7046
- var allDayRowCell = this.element.querySelector('.' + ALLDAY_CELLS_CLASS + ':first-child');
7047
- var cellTop = allDayRowCell.offsetTop;
7048
7050
  var eStart = new Date(record[this.parent.eventFields.startTime].getTime());
7049
7051
  var eEnd = new Date(record[this.parent.eventFields.endTime].getTime());
7050
7052
  var appWidth = 0;
@@ -7097,8 +7099,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7097
7099
  this.parent.trigger(eventRendered, args, function (eventArgs) {
7098
7100
  if (!eventArgs.cancel) {
7099
7101
  eventWrapper_1.appendChild(appointmentElement_1);
7100
- var appHeight = appointmentElement_1.offsetHeight;
7101
- topValue += (allDayIndex_1 === 0 ? cellTop : (cellTop + (allDayIndex_1 * appHeight))) + 1;
7102
+ topValue += (allDayIndex_1 === 0 ? cellTop : (cellTop + (allDayIndex_1 * eventHeight))) + 1;
7102
7103
  setStyleAttribute(appointmentElement_1, { 'width': appWidth + '%', 'top': formatUnit(topValue) });
7103
7104
  if (allDayIndex_1 > 1) {
7104
7105
  _this.moreEvents.push(appointmentElement_1);
@@ -7106,9 +7107,9 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7106
7107
  _this.createMoreIndicator(allDayRow_1, count, wIndex_1);
7107
7108
  }
7108
7109
  }
7109
- allDayRowCell.setAttribute('data-count', _this.allDayLevel.toString());
7110
+ _this.allDayElement[0].setAttribute('data-count', _this.allDayLevel.toString());
7110
7111
  var allDayRowHeight = ((!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) ?
7111
- (3 * appHeight) : ((_this.allDayLevel + 1) * appHeight)) + 4;
7112
+ (3 * eventHeight) : ((_this.allDayLevel + 1) * eventHeight)) + 4;
7112
7113
  _this.setAllDayRowHeight(allDayRowHeight);
7113
7114
  _this.addOrRemoveClass();
7114
7115
  _this.wireAppointmentEvents(appointmentElement_1, eventObj);
@@ -7338,14 +7339,12 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7338
7339
  this.parent.eventBase.allDayExpandScroll(dateHeader);
7339
7340
  }
7340
7341
  else {
7341
- dateHeader.scrollTop = 0;
7342
7342
  for (var _i = 0, _a = this.allDayElement; _i < _a.length; _i++) {
7343
7343
  var element = _a[_i];
7344
7344
  element.style.height = (height / 12) + 'em';
7345
7345
  }
7346
7346
  removeClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
7347
7347
  }
7348
- this.animation.animate(this.allDayElement[0]);
7349
7348
  };
7350
7349
  VerticalEvent.prototype.addOrRemoveClass = function () {
7351
7350
  var _this = this;
@@ -7405,8 +7404,10 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7405
7404
  target.setAttribute('title', this.parent.localeObj.getConstant('expandAllDaySection'));
7406
7405
  target.setAttribute('aria-label', 'Expand section');
7407
7406
  rowHeight = (3 * this.getEventHeight()) + 4;
7407
+ this.parent.element.querySelector('.' + DATE_HEADER_WRAP_CLASS).scrollTop = 0;
7408
7408
  }
7409
7409
  this.setAllDayRowHeight(rowHeight);
7410
+ this.animation.animate(this.allDayElement[0]);
7410
7411
  this.addOrRemoveClass();
7411
7412
  this.animation.animate(target);
7412
7413
  };
@@ -8330,10 +8331,21 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8330
8331
  'width': appWidth + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
8331
8332
  });
8332
8333
  this.wireAppointmentEvents(appointmentElement, event);
8333
- this.renderEventElement(event, appointmentElement, cellTd);
8334
8334
  if (this.parent.rowAutoHeight) {
8335
+ var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8336
+ var conWidth = conWrap.getBoundingClientRect().width;
8337
+ var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8338
+ conWrap.offsetWidth === conWrap.clientWidth;
8339
+ this.renderEventElement(event, appointmentElement, cellTd);
8335
8340
  var firstChild = this.getFirstChild(resIndex);
8336
8341
  this.updateCellHeight(firstChild, height);
8342
+ if (isWithoutScroll &&
8343
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
8344
+ this.adjustAppointments(conWidth);
8345
+ }
8346
+ }
8347
+ else {
8348
+ this.renderEventElement(event, appointmentElement, cellTd);
8337
8349
  }
8338
8350
  }
8339
8351
  else {
@@ -8425,6 +8437,22 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8425
8437
  }
8426
8438
  }
8427
8439
  };
8440
+ TimelineEvent.prototype.adjustAppointments = function (conWidth) {
8441
+ var _this = this;
8442
+ var tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8443
+ this.cellWidth = this.workCells[0].getBoundingClientRect().width;
8444
+ var currentPercentage = (this.cellWidth * tr.children.length) / (conWidth / 100);
8445
+ var apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
8446
+ apps.forEach(function (app) {
8447
+ if (_this.parent.enableRtl && app.style.right !== '0px') {
8448
+ app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
8449
+ }
8450
+ else if (app.style.left !== '0px') {
8451
+ app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
8452
+ }
8453
+ app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
8454
+ });
8455
+ };
8428
8456
  TimelineEvent.prototype.getFirstChild = function (index) {
8429
8457
  var query = '.' + CONTENT_TABLE_CLASS + ' tbody td';
8430
8458
  var groupIndex = '';
@@ -8774,7 +8802,9 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
8774
8802
  allDayElements[0].offsetHeight) - 1;
8775
8803
  }
8776
8804
  verticalEvent.allDayLevel = allDayLevel;
8777
- verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
8805
+ var appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
8806
+ var cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
8807
+ verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
8778
8808
  }
8779
8809
  else {
8780
8810
  verticalEvent.renderNormalEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline);
@@ -22218,9 +22248,12 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22218
22248
  }
22219
22249
  else {
22220
22250
  if (this.isCursorAhead || cursorDrag) {
22221
- eventStart.setMinutes(eventStart.getMinutes() +
22222
- (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval));
22251
+ var minutes = this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval;
22252
+ eventStart.setMinutes(eventStart.getMinutes() + minutes);
22223
22253
  eventStart.setMilliseconds(-(eventDuration));
22254
+ if (eventStart.getTime() === resetTime(eventStart).getTime() && eventStart.getMinutes() === 0 && eventDuration === 0) {
22255
+ eventStart.setMinutes(-minutes);
22256
+ }
22224
22257
  }
22225
22258
  else {
22226
22259
  eventStart.setMinutes(eventStart.getMinutes() -