@syncfusion/ej2-schedule 21.1.41 → 21.2.4

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.
@@ -8130,10 +8130,21 @@ class TimelineEvent extends MonthEvent {
8130
8130
  'width': appWidth + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
8131
8131
  });
8132
8132
  this.wireAppointmentEvents(appointmentElement, event);
8133
- this.renderEventElement(event, appointmentElement, cellTd);
8134
8133
  if (this.parent.rowAutoHeight) {
8134
+ const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8135
+ const conWidth = conWrap.getBoundingClientRect().width;
8136
+ const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8137
+ conWrap.offsetWidth === conWrap.clientWidth;
8138
+ this.renderEventElement(event, appointmentElement, cellTd);
8135
8139
  const firstChild = this.getFirstChild(resIndex);
8136
8140
  this.updateCellHeight(firstChild, height);
8141
+ if (isWithoutScroll &&
8142
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
8143
+ this.adjustAppointments(conWidth);
8144
+ }
8145
+ }
8146
+ else {
8147
+ this.renderEventElement(event, appointmentElement, cellTd);
8137
8148
  }
8138
8149
  }
8139
8150
  else {
@@ -8225,6 +8236,21 @@ class TimelineEvent extends MonthEvent {
8225
8236
  }
8226
8237
  }
8227
8238
  }
8239
+ adjustAppointments(conWidth) {
8240
+ const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8241
+ this.cellWidth = this.workCells[0].getBoundingClientRect().width;
8242
+ const currentPercentage = (this.cellWidth * tr.children.length) / (conWidth / 100);
8243
+ const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
8244
+ apps.forEach((app) => {
8245
+ if (this.parent.enableRtl && app.style.right !== '0px') {
8246
+ app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
8247
+ }
8248
+ else if (app.style.left !== '0px') {
8249
+ app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
8250
+ }
8251
+ app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
8252
+ });
8253
+ }
8228
8254
  getFirstChild(index) {
8229
8255
  const query = '.' + CONTENT_TABLE_CLASS + ' tbody td';
8230
8256
  let groupIndex = '';
@@ -13756,7 +13782,7 @@ class Render {
13756
13782
  this.parent.virtualScrollModule.destroy();
13757
13783
  this.parent.virtualScrollModule = null;
13758
13784
  }
13759
- if ((['Agenda', 'Year'].indexOf(this.parent.currentView) === -1 ||
13785
+ if ((['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.parent.currentView) === -1 ||
13760
13786
  (this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
13761
13787
  && this.parent.activeViewOptions.allowVirtualScrolling
13762
13788
  && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -19173,6 +19199,9 @@ class ActionBase {
19173
19199
  return event;
19174
19200
  }
19175
19201
  dynamicYearlyEventsRendering(event, isResize = false) {
19202
+ if (!isNullOrUndefined(this.parent.eventDragArea)) {
19203
+ return;
19204
+ }
19176
19205
  let appWidth = this.actionObj.cellWidth - 7;
19177
19206
  if (isResize && (this.resizeEdges.left || this.resizeEdges.right)) {
19178
19207
  appWidth = this.actionObj.cellWidth * event.count;
@@ -19242,6 +19271,9 @@ class ActionBase {
19242
19271
  return appointmentWrapper;
19243
19272
  }
19244
19273
  dynamicEventsRendering(event) {
19274
+ if (!isNullOrUndefined(this.parent.eventDragArea)) {
19275
+ return;
19276
+ }
19245
19277
  let dateRender = this.parent.activeView.renderDates;
19246
19278
  let workCells = [].slice.call(this.parent.element.querySelectorAll('.' + WORK_CELLS_CLASS));
19247
19279
  let workDays = this.parent.activeViewOptions.workDays;
@@ -19276,7 +19308,7 @@ class ActionBase {
19276
19308
  this.monthEvent.applyResourceColor(appointmentElement, event, 'backgroundColor', groupOrder);
19277
19309
  setStyleAttribute(appointmentElement, { 'width': appWidth + 'px', 'border': '0px', 'pointer-events': 'none' });
19278
19310
  const cellTd = workCells[parseInt(day.toString(), 10)];
19279
- if (cellTd && isNullOrUndefined(this.parent.eventDragArea)) {
19311
+ if (cellTd) {
19280
19312
  this.monthEvent.renderElement(cellTd, appointmentElement, true);
19281
19313
  this.actionObj.cloneElement.push(appointmentElement);
19282
19314
  }
@@ -21350,9 +21382,11 @@ class DragAndDrop extends ActionBase {
21350
21382
  }
21351
21383
  }
21352
21384
  const event = this.getUpdatedEvent(this.actionObj.start, this.actionObj.end, this.actionObj.event);
21353
- const eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + CLONE_ELEMENT_CLASS));
21354
- for (const wrapper of eventWrappers) {
21355
- remove(wrapper);
21385
+ if (isNullOrUndefined(this.parent.eventDragArea)) {
21386
+ const eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + CLONE_ELEMENT_CLASS));
21387
+ for (const wrapper of eventWrappers) {
21388
+ remove(wrapper);
21389
+ }
21356
21390
  }
21357
21391
  if (this.multiData && this.multiData.length > 0) {
21358
21392
  const startTime = resetTime(new Date(event[this.parent.eventFields.startTime]));
@@ -21452,9 +21486,12 @@ class DragAndDrop extends ActionBase {
21452
21486
  }
21453
21487
  else {
21454
21488
  if (this.isCursorAhead || cursorDrag) {
21455
- eventStart.setMinutes(eventStart.getMinutes() +
21456
- (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval));
21489
+ const minutes = this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval;
21490
+ eventStart.setMinutes(eventStart.getMinutes() + minutes);
21457
21491
  eventStart.setMilliseconds(-(eventDuration));
21492
+ if (eventStart.getTime() === resetTime(eventStart).getTime() && eventStart.getMinutes() === 0 && eventDuration === 0) {
21493
+ eventStart.setMinutes(-minutes);
21494
+ }
21458
21495
  }
21459
21496
  else {
21460
21497
  eventStart.setMinutes(eventStart.getMinutes() -