@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.
@@ -8330,10 +8330,21 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8330
8330
  'width': appWidth + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
8331
8331
  });
8332
8332
  this.wireAppointmentEvents(appointmentElement, event);
8333
- this.renderEventElement(event, appointmentElement, cellTd);
8334
8333
  if (this.parent.rowAutoHeight) {
8334
+ var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8335
+ var conWidth = conWrap.getBoundingClientRect().width;
8336
+ var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8337
+ conWrap.offsetWidth === conWrap.clientWidth;
8338
+ this.renderEventElement(event, appointmentElement, cellTd);
8335
8339
  var firstChild = this.getFirstChild(resIndex);
8336
8340
  this.updateCellHeight(firstChild, height);
8341
+ if (isWithoutScroll &&
8342
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== conWrap.getBoundingClientRect().width)) {
8343
+ this.adjustAppointments(conWidth);
8344
+ }
8345
+ }
8346
+ else {
8347
+ this.renderEventElement(event, appointmentElement, cellTd);
8337
8348
  }
8338
8349
  }
8339
8350
  else {
@@ -8425,6 +8436,22 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8425
8436
  }
8426
8437
  }
8427
8438
  };
8439
+ TimelineEvent.prototype.adjustAppointments = function (conWidth) {
8440
+ var _this = this;
8441
+ var tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8442
+ this.cellWidth = this.workCells[0].getBoundingClientRect().width;
8443
+ var currentPercentage = (this.cellWidth * tr.children.length) / (conWidth / 100);
8444
+ var apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
8445
+ apps.forEach(function (app) {
8446
+ if (_this.parent.enableRtl && app.style.right !== '0px') {
8447
+ app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
8448
+ }
8449
+ else if (app.style.left !== '0px') {
8450
+ app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
8451
+ }
8452
+ app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
8453
+ });
8454
+ };
8428
8455
  TimelineEvent.prototype.getFirstChild = function (index) {
8429
8456
  var query = '.' + CONTENT_TABLE_CLASS + ' tbody td';
8430
8457
  var groupIndex = '';
@@ -14069,7 +14096,7 @@ var Render = /** @__PURE__ @class */ (function () {
14069
14096
  this.parent.virtualScrollModule.destroy();
14070
14097
  this.parent.virtualScrollModule = null;
14071
14098
  }
14072
- if ((['Agenda', 'Year'].indexOf(this.parent.currentView) === -1 ||
14099
+ if ((['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.parent.currentView) === -1 ||
14073
14100
  (this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
14074
14101
  && this.parent.activeViewOptions.allowVirtualScrolling
14075
14102
  && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
@@ -19825,6 +19852,9 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19825
19852
  };
19826
19853
  ActionBase.prototype.dynamicYearlyEventsRendering = function (event, isResize) {
19827
19854
  if (isResize === void 0) { isResize = false; }
19855
+ if (!isNullOrUndefined(this.parent.eventDragArea)) {
19856
+ return;
19857
+ }
19828
19858
  var appWidth = this.actionObj.cellWidth - 7;
19829
19859
  if (isResize && (this.resizeEdges.left || this.resizeEdges.right)) {
19830
19860
  appWidth = this.actionObj.cellWidth * event.count;
@@ -19896,6 +19926,9 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19896
19926
  };
19897
19927
  ActionBase.prototype.dynamicEventsRendering = function (event) {
19898
19928
  var _this = this;
19929
+ if (!isNullOrUndefined(this.parent.eventDragArea)) {
19930
+ return;
19931
+ }
19899
19932
  var dateRender = this.parent.activeView.renderDates;
19900
19933
  var workCells = [].slice.call(this.parent.element.querySelectorAll('.' + WORK_CELLS_CLASS));
19901
19934
  var workDays = this.parent.activeViewOptions.workDays;
@@ -19932,7 +19965,7 @@ var ActionBase = /** @__PURE__ @class */ (function () {
19932
19965
  this.monthEvent.applyResourceColor(appointmentElement, event_1, 'backgroundColor', groupOrder);
19933
19966
  setStyleAttribute(appointmentElement, { 'width': appWidth + 'px', 'border': '0px', 'pointer-events': 'none' });
19934
19967
  var cellTd = workCells[parseInt(day.toString(), 10)];
19935
- if (cellTd && isNullOrUndefined(this.parent.eventDragArea)) {
19968
+ if (cellTd) {
19936
19969
  this.monthEvent.renderElement(cellTd, appointmentElement, true);
19937
19970
  this.actionObj.cloneElement.push(appointmentElement);
19938
19971
  }
@@ -22107,10 +22140,12 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22107
22140
  }
22108
22141
  }
22109
22142
  var event = this.getUpdatedEvent(this.actionObj.start, this.actionObj.end, this.actionObj.event);
22110
- var eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + CLONE_ELEMENT_CLASS));
22111
- for (var _i = 0, eventWrappers_1 = eventWrappers; _i < eventWrappers_1.length; _i++) {
22112
- var wrapper = eventWrappers_1[_i];
22113
- remove(wrapper);
22143
+ if (isNullOrUndefined(this.parent.eventDragArea)) {
22144
+ var eventWrappers = [].slice.call(this.parent.element.querySelectorAll('.' + CLONE_ELEMENT_CLASS));
22145
+ for (var _i = 0, eventWrappers_1 = eventWrappers; _i < eventWrappers_1.length; _i++) {
22146
+ var wrapper = eventWrappers_1[_i];
22147
+ remove(wrapper);
22148
+ }
22114
22149
  }
22115
22150
  if (this.multiData && this.multiData.length > 0) {
22116
22151
  var startTime = resetTime(new Date(event[this.parent.eventFields.startTime]));
@@ -22210,9 +22245,12 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22210
22245
  }
22211
22246
  else {
22212
22247
  if (this.isCursorAhead || cursorDrag) {
22213
- eventStart.setMinutes(eventStart.getMinutes() +
22214
- (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval));
22248
+ var minutes = this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval;
22249
+ eventStart.setMinutes(eventStart.getMinutes() + minutes);
22215
22250
  eventStart.setMilliseconds(-(eventDuration));
22251
+ if (eventStart.getTime() === resetTime(eventStart).getTime() && eventStart.getMinutes() === 0 && eventDuration === 0) {
22252
+ eventStart.setMinutes(-minutes);
22253
+ }
22216
22254
  }
22217
22255
  else {
22218
22256
  eventStart.setMinutes(eventStart.getMinutes() -