@syncfusion/ej2-schedule 26.1.39 → 26.1.41

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 (32) hide show
  1. package/dist/ej2-schedule.min.js +2 -2
  2. package/dist/ej2-schedule.umd.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-schedule.es2015.js +248 -112
  5. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  6. package/dist/es6/ej2-schedule.es5.js +250 -113
  7. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  8. package/dist/global/ej2-schedule.min.js +2 -2
  9. package/dist/global/ej2-schedule.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/schedule/actions/drag.d.ts +2 -0
  13. package/src/schedule/actions/drag.js +43 -15
  14. package/src/schedule/actions/resize.js +20 -19
  15. package/src/schedule/actions/touch.js +1 -0
  16. package/src/schedule/actions/virtual-scroll.d.ts +4 -0
  17. package/src/schedule/actions/virtual-scroll.js +78 -29
  18. package/src/schedule/base/interface.d.ts +3 -0
  19. package/src/schedule/base/schedule.d.ts +25 -0
  20. package/src/schedule/base/schedule.js +36 -1
  21. package/src/schedule/base/util.d.ts +10 -5
  22. package/src/schedule/base/util.js +15 -10
  23. package/src/schedule/event-renderer/agenda-base.js +2 -1
  24. package/src/schedule/event-renderer/inline-edit.js +4 -4
  25. package/src/schedule/event-renderer/month.js +3 -3
  26. package/src/schedule/event-renderer/timeline-view.js +4 -4
  27. package/src/schedule/event-renderer/vertical-view.js +3 -3
  28. package/src/schedule/event-renderer/year.js +5 -5
  29. package/src/schedule/popups/event-window.js +12 -5
  30. package/src/schedule/renderer/timeline-view.js +4 -4
  31. package/src/schedule/renderer/vertical-view.js +18 -8
  32. package/src/schedule/renderer/view-base.js +1 -1
@@ -107,15 +107,16 @@ const MS_PER_MINUTE = 60000;
107
107
  *
108
108
  * @param {Element} container Accepts the DOM element
109
109
  * @param {string} elementClass Accepts the element class
110
+ * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
110
111
  * @returns {number} Returns the height of the element
111
112
  */
112
- function getElementHeightFromClass(container, elementClass) {
113
+ function getElementHeightFromClass(container, elementClass, isTransformed) {
113
114
  let height = 0;
114
115
  const el = createElement('div', { className: elementClass }).cloneNode();
115
116
  el.style.visibility = 'hidden';
116
117
  el.style.position = 'absolute';
117
118
  container.appendChild(el);
118
- height = getElementHeight(el);
119
+ height = getElementHeight(el, isTransformed);
119
120
  remove(el);
120
121
  return height;
121
122
  }
@@ -124,15 +125,16 @@ function getElementHeightFromClass(container, elementClass) {
124
125
  *
125
126
  * @param {Element} container Accepts the DOM element
126
127
  * @param {string} elementClass Accepts the element class
128
+ * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
127
129
  * @returns {number} Returns the width of the element
128
130
  */
129
- function getElementWidthFromClass(container, elementClass) {
131
+ function getElementWidthFromClass(container, elementClass, isTransformed) {
130
132
  let width = 0;
131
133
  const el = createElement('div', { className: elementClass }).cloneNode();
132
134
  el.style.visibility = 'hidden';
133
135
  el.style.position = 'absolute';
134
136
  container.appendChild(el);
135
- width = getElementWidth(el);
137
+ width = getElementWidth(el, isTransformed);
136
138
  remove(el);
137
139
  return width;
138
140
  }
@@ -523,28 +525,31 @@ function capitalizeFirstWord(inputString, type) {
523
525
  * Method to get element cell width
524
526
  *
525
527
  * @param {HTMLElement} element Accepts the DOM element
528
+ * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
526
529
  * @returns {number} Returns the width of the given element
527
530
  */
528
- function getElementWidth(element) {
529
- return document.body.style.transform.includes('scale') ? element.offsetWidth : element.getBoundingClientRect().width;
531
+ function getElementWidth(element, isTransformed) {
532
+ return isTransformed ? element.offsetWidth : element.getBoundingClientRect().width;
530
533
  }
531
534
  /**
532
535
  * Method to get element cell Height
533
536
  *
534
537
  * @param {HTMLElement} element Accepts the DOM element
538
+ * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
535
539
  * @returns {number} Returns the Height of the given element
536
540
  */
537
- function getElementHeight(element) {
538
- return document.body.style.transform.includes('scale') ? element.offsetHeight : element.getBoundingClientRect().height;
541
+ function getElementHeight(element, isTransformed) {
542
+ return isTransformed ? element.offsetHeight : element.getBoundingClientRect().height;
539
543
  }
540
544
  /**
541
545
  * Method to get element cell Top
542
546
  *
543
547
  * @param {HTMLElement} element Accepts the DOM element
548
+ * @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
544
549
  * @returns {number} Returns the top value of the given element
545
550
  */
546
- function getElementTop(element) {
547
- return document.body.style.transform.includes('scale') ? element.offsetTop : element.getBoundingClientRect().top;
551
+ function getElementTop(element, isTransformed) {
552
+ return isTransformed ? element.offsetTop : element.getBoundingClientRect().top;
548
553
  }
549
554
 
550
555
  /**
@@ -1910,6 +1915,7 @@ class ScheduleTouch {
1910
1915
  this.parent.selectedElements = [];
1911
1916
  this.parent.eventBase.getSelectedEventElements(target);
1912
1917
  if (this.parent.resizeModule && closest(e.originalEvent.target, '.' + EVENT_RESIZE_CLASS)) {
1918
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1913
1919
  this.parent.resizeModule.resizeStart(e.originalEvent);
1914
1920
  }
1915
1921
  }
@@ -6841,7 +6847,7 @@ class VerticalEvent extends EventBase {
6841
6847
  this.parent.crudModule.crudObj.isCrudAction = false;
6842
6848
  }
6843
6849
  this.parent.renderTemplates(() => {
6844
- if (this.parent.isReact && this.parent.activeViewOptions.eventTemplate) {
6850
+ if (this.parent && this.parent.isReact && this.parent.activeViewOptions.eventTemplate) {
6845
6851
  const wraps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_WRAPPER_HIDDEN_CLASS));
6846
6852
  removeClass(wraps, APPOINTMENT_WRAPPER_HIDDEN_CLASS);
6847
6853
  }
@@ -6855,7 +6861,7 @@ class VerticalEvent extends EventBase {
6855
6861
  this.resources = this.parent.resourceBase.renderedResources;
6856
6862
  }
6857
6863
  this.cellHeight =
6858
- parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
6864
+ parseFloat(this.parent.getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
6859
6865
  this.dateRender[0] = this.parent.activeView.renderDates;
6860
6866
  if (this.parent.activeViewOptions.group.resources.length > 0) {
6861
6867
  for (let i = 0, len = this.resources.length; i < len; i++) {
@@ -6939,7 +6945,7 @@ class VerticalEvent extends EventBase {
6939
6945
  const resources = this.getResourceList();
6940
6946
  let dateCount = this.getStartCount();
6941
6947
  let isRender;
6942
- const appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
6948
+ const appHeight = eventType === 'allDayEvents' ? this.parent.getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
6943
6949
  const allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
6944
6950
  for (const resource of resources) {
6945
6951
  isRender = true;
@@ -7652,7 +7658,7 @@ class MonthEvent extends EventBase {
7652
7658
  this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
7653
7659
  cellTd.removeChild(wrapper);
7654
7660
  }
7655
- this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
7661
+ this.eventHeight = this.parent.getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
7656
7662
  const selector = '.' + CONTENT_TABLE_CLASS + ' tbody tr';
7657
7663
  this.addCellHeight(selector, this.eventHeight, (this.parent.currentView === 'Month' ? EVENT_GAP : 2), this.monthHeaderHeight, this.moreIndicatorHeight);
7658
7664
  const scrollTop = conWrap.scrollTop;
@@ -7731,8 +7737,8 @@ class MonthEvent extends EventBase {
7731
7737
  });
7732
7738
  }
7733
7739
  const cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
7734
- this.cellWidth = getElementWidth(cellDetail);
7735
- this.cellHeight = getElementHeight(cellDetail);
7740
+ this.cellWidth = this.parent.getElementWidth(cellDetail);
7741
+ this.cellHeight = this.parent.getElementHeight(cellDetail);
7736
7742
  this.dateRender = dateRender;
7737
7743
  const filteredDates = this.getRenderedDates(dateRender);
7738
7744
  this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
@@ -8285,7 +8291,7 @@ class TimelineEvent extends MonthEvent {
8285
8291
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
8286
8292
  this.renderType = 'day';
8287
8293
  const workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
8288
- this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
8294
+ this.cellWidth = this.parent.getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
8289
8295
  this.slotsPerDay = 1;
8290
8296
  }
8291
8297
  else {
@@ -8448,14 +8454,14 @@ class TimelineEvent extends MonthEvent {
8448
8454
  this.wireAppointmentEvents(appointmentElement, event);
8449
8455
  if (this.parent.rowAutoHeight) {
8450
8456
  const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
8451
- const conWidth = getElementWidth(conWrap);
8457
+ const conWidth = this.parent.getElementWidth(conWrap);
8452
8458
  const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
8453
8459
  conWrap.offsetWidth === conWrap.clientWidth;
8454
8460
  this.renderEventElement(event, appointmentElement, cellTd);
8455
8461
  const firstChild = this.getFirstChild(resIndex);
8456
8462
  this.updateCellHeight(firstChild, height);
8457
8463
  if (isWithoutScroll &&
8458
- (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
8464
+ (conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
8459
8465
  this.adjustAppointments(conWidth);
8460
8466
  }
8461
8467
  }
@@ -8573,7 +8579,7 @@ class TimelineEvent extends MonthEvent {
8573
8579
  }
8574
8580
  adjustAppointments(conWidth) {
8575
8581
  const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
8576
- const actualCellWidth = getElementWidth(this.workCells[0]);
8582
+ const actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
8577
8583
  this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
8578
8584
  const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
8579
8585
  const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
@@ -8933,11 +8939,11 @@ class InlineEdit {
8933
8939
  const allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
8934
8940
  let allDayLevel = 0;
8935
8941
  if (allDayElements.length > 0) {
8936
- allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
8942
+ allDayLevel = Math.floor(this.parent.getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
8937
8943
  allDayElements[0].offsetHeight) - 1;
8938
8944
  }
8939
8945
  verticalEvent.allDayLevel = allDayLevel;
8940
- const appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
8946
+ const appHeight = this.parent.getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
8941
8947
  const cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
8942
8948
  verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
8943
8949
  }
@@ -8965,7 +8971,7 @@ class InlineEdit {
8965
8971
  monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
8966
8972
  monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
8967
8973
  monthEvent.eventHeight =
8968
- getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
8974
+ this.parent.getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
8969
8975
  monthEvent.getSlotDates(workDays);
8970
8976
  const filteredDates = monthEvent.getRenderedDates(renderDates);
8971
8977
  const spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
@@ -8988,7 +8994,7 @@ class InlineEdit {
8988
8994
  const dayLength = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?
8989
8995
  0 : this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;
8990
8996
  timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
8991
- timelineView.eventHeight = getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
8997
+ timelineView.eventHeight = this.parent.getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
8992
8998
  timelineView.renderEvents(saveObject, resIndex);
8993
8999
  }
8994
9000
  getEventDaysCount(saveObj) {
@@ -12170,11 +12176,14 @@ class EventWindow {
12170
12176
  this.recurrenceEditor = null;
12171
12177
  }
12172
12178
  this.destroyComponents();
12173
- const formElements = [].slice.call(form.children);
12174
- for (const element of formElements) {
12175
- remove(element);
12176
- }
12177
12179
  this.parent.resetTemplates(['editorTemplate']);
12180
+ EventHandler.clearEvents(form);
12181
+ if (!this.parent.isReact) {
12182
+ const formElements = [].slice.call(form.children);
12183
+ for (const element of formElements) {
12184
+ remove(element);
12185
+ }
12186
+ }
12178
12187
  }
12179
12188
  const templateId = this.parent.element.id + '_editorTemplate';
12180
12189
  const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
@@ -12768,6 +12777,10 @@ class EventWindow {
12768
12777
  if (!isNullOrUndefined(descriptionRule)) {
12769
12778
  rules[this.parent.eventSettings.fields.description.name] = descriptionRule;
12770
12779
  }
12780
+ if (this.fieldValidator) {
12781
+ this.fieldValidator.destroy();
12782
+ this.fieldValidator = null;
12783
+ }
12771
12784
  this.fieldValidator = new FieldValidator();
12772
12785
  this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
12773
12786
  }
@@ -13782,6 +13795,7 @@ class VirtualScroll {
13782
13795
  this.renderedLength = 0;
13783
13796
  this.averageRowHeight = 0;
13784
13797
  this.startIndex = 0;
13798
+ this.existingDataCollection = [];
13785
13799
  this.parent = parent;
13786
13800
  this.addEventListener();
13787
13801
  }
@@ -13854,10 +13868,10 @@ class VirtualScroll {
13854
13868
  }
13855
13869
  setItemSize() {
13856
13870
  if (this.isHorizontalScroll) {
13857
- this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13871
+ this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
13858
13872
  }
13859
13873
  else {
13860
- this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13874
+ this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
13861
13875
  }
13862
13876
  }
13863
13877
  refreshLayout() {
@@ -14134,43 +14148,90 @@ class VirtualScroll {
14134
14148
  append(eventRows, eventWrap);
14135
14149
  }
14136
14150
  updateHorizontalContent(conWrap, resCollection) {
14151
+ this.existingDataCollection = this.parent.resourceBase.expandedResources;
14137
14152
  this.parent.resourceBase.expandedResources = resCollection;
14138
14153
  const selectedEle = this.parent.getSelectedCells();
14139
14154
  this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
14140
- const renderedLength = conWrap.querySelectorAll('tbody tr').length;
14155
+ const tbody = conWrap.querySelector('tbody');
14156
+ const renderedRows = Array.from(tbody.querySelectorAll('tr'));
14157
+ if (this.parent.currentView === 'Month') {
14158
+ this.updateMonthViewContent(conWrap, resCollection);
14159
+ }
14160
+ else {
14161
+ this.updateOtherViewContent(conWrap, resCollection, renderedRows);
14162
+ }
14163
+ }
14164
+ updateMonthViewContent(conWrap, resCollection) {
14165
+ const renderedLength = conWrap.querySelectorAll(' tr').length;
14141
14166
  for (let i = 0; i < renderedLength; i++) {
14142
14167
  remove(conWrap.querySelector('tbody tr'));
14143
14168
  }
14144
- if (this.parent.currentView === 'Month') {
14145
- if (this.parent.activeViewOptions.group.byDate) {
14146
- this.parent.activeView.colLevels[0] = resCollection;
14147
- }
14148
- else {
14149
- this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
14150
- }
14151
- const contentRows = this.parent.activeView.getContentRows();
14152
- append(contentRows, conWrap.querySelector('tbody'));
14169
+ if (this.parent.activeViewOptions.group.byDate) {
14170
+ this.parent.activeView.colLevels[0] = resCollection;
14153
14171
  }
14154
14172
  else {
14155
- const col = [].slice.call(conWrap.querySelector('colgroup').children);
14156
- for (let i = 0; i < col.length; i++) {
14157
- remove(col[parseInt(i.toString(), 10)]);
14158
- }
14159
- this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
14160
- const contentRows = this.parent.activeView.getContentRows();
14161
- const table = conWrap.querySelector('table');
14162
- const thead = conWrap.querySelector('thead');
14163
- const colGroupEle = conWrap.querySelector('colgroup');
14164
- resCollection.forEach(() => {
14165
- colGroupEle.appendChild(createElement('col'));
14173
+ this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
14174
+ }
14175
+ const contentRows = this.parent.activeView.getContentRows();
14176
+ append(contentRows, conWrap.querySelector('tbody'));
14177
+ }
14178
+ updateOtherViewContent(conWrap, resCollection, renderedRows) {
14179
+ const tbody = conWrap.querySelector('tbody');
14180
+ const colGroup = conWrap.querySelector('colgroup');
14181
+ const thead = conWrap.querySelector('thead');
14182
+ const table = conWrap.querySelector('table');
14183
+ this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
14184
+ const newGroupIndices = new Set(resCollection.map((data) => data.groupIndex));
14185
+ renderedRows.forEach((row) => {
14186
+ const tdElements = row.querySelectorAll('td');
14187
+ tdElements.forEach((td) => {
14188
+ const groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
14189
+ if (!newGroupIndices.has(groupIndex)) {
14190
+ td.remove();
14191
+ }
14166
14192
  });
14167
- thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
14168
- if (this.parent.activeViewOptions.timeScale.enable) {
14169
- thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
14170
- }
14171
- prepend([thead], table);
14172
- append(contentRows, conWrap.querySelector('tbody'));
14193
+ });
14194
+ const col = [].slice.call(conWrap.querySelector('colgroup').children);
14195
+ for (let i = 0; i < col.length; i++) {
14196
+ remove(col[parseInt(i.toString(), 10)]);
14197
+ }
14198
+ resCollection.forEach(() => colGroup.appendChild(createElement('col')));
14199
+ const tHead = [].slice.call(conWrap.querySelector('thead').children);
14200
+ for (let i = 0; i < tHead.length; i++) {
14201
+ remove(tHead[parseInt(i.toString(), 10)]);
14202
+ }
14203
+ thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
14204
+ if (this.parent.activeViewOptions.timeScale.enable) {
14205
+ thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
14173
14206
  }
14207
+ prepend([thead], table);
14208
+ const contentRows = this.parent.activeView.getContentRows();
14209
+ this.mergeNewTdData(tbody, contentRows);
14210
+ }
14211
+ mergeNewTdData(tbody, contentRows) {
14212
+ const existingRows = Array.from(tbody.querySelectorAll('tr'));
14213
+ existingRows.forEach((existingRow, rowIndex) => {
14214
+ if (rowIndex < contentRows.length) {
14215
+ const newRow = contentRows[parseInt(rowIndex.toString(), 10)];
14216
+ const existingTds = Array.from(existingRow.querySelectorAll('td'));
14217
+ const newTds = Array.from(newRow.querySelectorAll('td'));
14218
+ newTds.forEach((newTd) => {
14219
+ const newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
14220
+ let inserted = false;
14221
+ for (const existingTd of existingTds) {
14222
+ const existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
14223
+ if (newGroupIndex < existingGroupIndex) {
14224
+ existingRow.insertBefore(newTd, existingTd);
14225
+ inserted = true;
14226
+ break;
14227
+ }
14228
+ }
14229
+ if (!inserted) {
14230
+ existingRow.appendChild(newTd);
14231
+ }
14232
+ });
14233
+ }
14234
+ });
14174
14235
  }
14175
14236
  getBufferCollection(startIndex, endIndex) {
14176
14237
  return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
@@ -16747,6 +16808,37 @@ let Schedule = class Schedule extends Component {
16747
16808
  }
16748
16809
  return templateName;
16749
16810
  }
16811
+ /**
16812
+ * Method to get element width
16813
+ *
16814
+ * @param {HTMLElement} element Accepts the DOM element
16815
+ * @returns {number} Returns the width of the given element
16816
+ * @private
16817
+ */
16818
+ getElementWidth(element) {
16819
+ return getElementWidth(element, this.uiStateValues.isTransformed);
16820
+ }
16821
+ /**
16822
+ * Method to get element height
16823
+ *
16824
+ * @param {HTMLElement} element Accepts the DOM element
16825
+ * @returns {number} Returns the Height of the given element
16826
+ * @private
16827
+ */
16828
+ getElementHeight(element) {
16829
+ return getElementHeight(element, this.uiStateValues.isTransformed);
16830
+ }
16831
+ /**
16832
+ * Method to get height from element
16833
+ *
16834
+ * @param {Element} element Accepts the DOM element
16835
+ * @param {string} elementClass Accepts the element class
16836
+ * @returns {number} Returns the height of the element
16837
+ * @private
16838
+ */
16839
+ getElementHeightFromClass(element, elementClass) {
16840
+ return getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
16841
+ }
16750
16842
  /**
16751
16843
  * Method to render react templates
16752
16844
  *
@@ -16826,6 +16918,7 @@ let Schedule = class Schedule extends Component {
16826
16918
  this.headerModule = new HeaderRenderer(this);
16827
16919
  }
16828
16920
  this.renderTableContainer();
16921
+ this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
16829
16922
  if (Browser.isDevice || Browser.isTouch) {
16830
16923
  this.scheduleTouchModule = new ScheduleTouch(this);
16831
16924
  }
@@ -17320,7 +17413,7 @@ let Schedule = class Schedule extends Component {
17320
17413
  this.uiStateValues = {
17321
17414
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
17322
17415
  isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
17323
- isBlock: false, isCustomMonth: true, isPreventTimezone: false
17416
+ isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
17324
17417
  };
17325
17418
  }
17326
17419
  this.currentTimezoneDate = this.getCurrentTime();
@@ -18705,6 +18798,9 @@ let Schedule = class Schedule extends Component {
18705
18798
  * @returns {void}
18706
18799
  */
18707
18800
  scrollTo(hour, scrollDate) {
18801
+ if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
18802
+ return;
18803
+ }
18708
18804
  if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
18709
18805
  this.activeView.scrollToDate(scrollDate);
18710
18806
  }
@@ -20180,8 +20276,8 @@ class Resize extends ActionBase {
20180
20276
  };
20181
20277
  this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
20182
20278
  const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20183
- this.actionObj.cellWidth = getElementWidth(workCell);
20184
- this.actionObj.cellHeight = getElementHeight(workCell);
20279
+ this.actionObj.cellWidth = this.parent.getElementWidth(workCell);
20280
+ this.actionObj.cellHeight = this.parent.getElementHeight(workCell);
20185
20281
  const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
20186
20282
  if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
20187
20283
  const tr = this.parent.getContentTable().querySelector('tr');
@@ -20483,9 +20579,10 @@ class Resize extends ActionBase {
20483
20579
  parseInt(this.actionObj.clone.style.left, 10);
20484
20580
  offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20485
20581
  if (!isLeft) {
20486
- offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
20582
+ offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
20487
20583
  }
20488
- cellIndex = Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
20584
+ cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
20585
+ Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
20489
20586
  isDateHeader = isTimeViews && headerName === 'Date';
20490
20587
  cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
20491
20588
  isLastCell = cellIndex === tdCollections.length;
@@ -20494,7 +20591,7 @@ class Resize extends ActionBase {
20494
20591
  else {
20495
20592
  const cellWidth = this.actionObj.cellWidth;
20496
20593
  cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
20497
- Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
20594
+ Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
20498
20595
  if (this.parent.enableRtl) {
20499
20596
  let cellOffsetWidth = 0;
20500
20597
  if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
@@ -20502,7 +20599,7 @@ class Resize extends ActionBase {
20502
20599
  cellOffsetWidth = this.actionObj.cellWidth;
20503
20600
  }
20504
20601
  const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
20505
- this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
20602
+ this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
20506
20603
  cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
20507
20604
  }
20508
20605
  isLastCell = cellIndex === tdCollections.length;
@@ -20521,7 +20618,7 @@ class Resize extends ActionBase {
20521
20618
  }
20522
20619
  else {
20523
20620
  if (!isLeft) {
20524
- offset += getElementWidth(this.actionObj.clone);
20621
+ offset += this.parent.getElementWidth(this.actionObj.clone);
20525
20622
  }
20526
20623
  let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
20527
20624
  (offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
@@ -20533,9 +20630,9 @@ class Resize extends ActionBase {
20533
20630
  }
20534
20631
  else {
20535
20632
  const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
20536
- const originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
20633
+ const originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
20537
20634
  this.actionObj.cellWidth) * this.actionObj.cellWidth;
20538
- const noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
20635
+ const noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
20539
20636
  this.actionObj.cellWidth);
20540
20637
  const tr = closest(this.actionObj.clone, 'tr');
20541
20638
  let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
@@ -20598,9 +20695,9 @@ class Resize extends ActionBase {
20598
20695
  const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
20599
20696
  const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
20600
20697
  const targetWidth = isTimelineView ?
20601
- (getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
20602
- this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
20603
- Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20698
+ (this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
20699
+ this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
20700
+ Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
20604
20701
  let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
20605
20702
  const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
20606
20703
  if (isTimeViews) {
@@ -20615,7 +20712,7 @@ class Resize extends ActionBase {
20615
20712
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
20616
20713
  }
20617
20714
  let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
20618
- getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
20715
+ this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
20619
20716
  if (this.parent.enableRtl) {
20620
20717
  let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
20621
20718
  -(offsetWidth - this.actionObj.cellWidth);
@@ -20629,7 +20726,7 @@ class Resize extends ActionBase {
20629
20726
  }
20630
20727
  rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
20631
20728
  styles.right = formatUnit(rightValue);
20632
- width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
20729
+ width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
20633
20730
  }
20634
20731
  else {
20635
20732
  let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
@@ -20637,12 +20734,12 @@ class Resize extends ActionBase {
20637
20734
  if (isTimelineView) {
20638
20735
  offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
20639
20736
  if (this.parent.enableRtl) {
20640
- offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
20737
+ offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
20641
20738
  ? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
20642
20739
  }
20643
20740
  else {
20644
- offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
20645
- getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
20741
+ offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
20742
+ this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
20646
20743
  parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
20647
20744
  }
20648
20745
  }
@@ -20658,10 +20755,10 @@ class Resize extends ActionBase {
20658
20755
  }
20659
20756
  else {
20660
20757
  offsetLeft = 0;
20661
- width = getElementWidth(this.actionObj.clone);
20758
+ width = this.parent.getElementWidth(this.actionObj.clone);
20662
20759
  }
20663
20760
  }
20664
- const cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
20761
+ const cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
20665
20762
  this.actionObj.cellWidth;
20666
20763
  if (isLeft) {
20667
20764
  styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
@@ -20774,10 +20871,10 @@ class YearEvent extends TimelineEvent {
20774
20871
  }
20775
20872
  timelineYearViewEvents() {
20776
20873
  const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
20777
- this.cellWidth = getElementWidth(workCell);
20874
+ this.cellWidth = this.parent.getElementWidth(workCell);
20778
20875
  this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
20779
20876
  const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20780
- this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
20877
+ this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
20781
20878
  const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
20782
20879
  this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
20783
20880
  const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
@@ -20924,10 +21021,10 @@ class YearEvent extends TimelineEvent {
20924
21021
  const contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
20925
21022
  const isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
20926
21023
  const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
20927
- this.cellWidth = getElementWidth(workCell);
21024
+ this.cellWidth = this.parent.getElementWidth(workCell);
20928
21025
  this.cellHeader = 0;
20929
21026
  const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
20930
- this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
21027
+ this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
20931
21028
  const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
20932
21029
  this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
20933
21030
  const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
@@ -20969,7 +21066,7 @@ class YearEvent extends TimelineEvent {
20969
21066
  appWrapper.forEach((appWrap, cellIndex) => {
20970
21067
  const td = row.querySelector(`td:nth-child(${cellIndex + 1})`);
20971
21068
  const app = [].slice.call(appWrap.children);
20972
- const width = getElementWidth(td);
21069
+ const width = this.parent.getElementWidth(td);
20973
21070
  const left = td.offsetLeft;
20974
21071
  if (this.parent.enableRtl) {
20975
21072
  const right = conTable.offsetWidth - left - td.offsetWidth;
@@ -21312,6 +21409,8 @@ class DragAndDrop extends ActionBase {
21312
21409
  this.isAllDayTarget = false;
21313
21410
  this.targetTd = null;
21314
21411
  this.isCursorAhead = false;
21412
+ this.enableCurrentViewDrag = false;
21413
+ this.isPreventMultiDrag = false;
21315
21414
  }
21316
21415
  wireDragEvent(element) {
21317
21416
  new Draggable(element, {
@@ -21425,6 +21524,9 @@ class DragAndDrop extends ActionBase {
21425
21524
  if (cloneBottom > scrollHeight) {
21426
21525
  topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
21427
21526
  }
21527
+ if (this.isPreventMultiDrag) {
21528
+ topValue = formatUnit(this.actionObj.clone.offsetTop);
21529
+ }
21428
21530
  }
21429
21531
  return { left: leftValue, top: topValue };
21430
21532
  }
@@ -21475,6 +21577,7 @@ class DragAndDrop extends ActionBase {
21475
21577
  this.actionObj.interval = dragEventArgs.interval;
21476
21578
  this.actionObj.navigation = dragEventArgs.navigation;
21477
21579
  this.actionObj.scroll = dragEventArgs.scroll;
21580
+ this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && this.parent.allowMultiDrag;
21478
21581
  this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
21479
21582
  const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
21480
21583
  this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
@@ -21633,6 +21736,7 @@ class DragAndDrop extends ActionBase {
21633
21736
  }
21634
21737
  dragStop(e) {
21635
21738
  this.isCursorAhead = false;
21739
+ this.isPreventMultiDrag = false;
21636
21740
  this.removeCloneElementClasses();
21637
21741
  this.removeCloneElement();
21638
21742
  clearInterval(this.actionObj.navigationInterval);
@@ -21700,7 +21804,7 @@ class DragAndDrop extends ActionBase {
21700
21804
  this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
21701
21805
  this.timelineEventModule.getSlotDates();
21702
21806
  this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
21703
- getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
21807
+ this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
21704
21808
  this.calculateTimelineTime(e);
21705
21809
  }
21706
21810
  else {
@@ -21875,7 +21979,9 @@ class DragAndDrop extends ActionBase {
21875
21979
  let dragStart;
21876
21980
  let dragEnd;
21877
21981
  if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
21878
- this.appendCloneElement(this.getEventWrapper(colIndex));
21982
+ if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
21983
+ this.appendCloneElement(this.getEventWrapper(colIndex));
21984
+ }
21879
21985
  dragStart = this.parent.getDateFromElement(td);
21880
21986
  dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
21881
21987
  dragEnd = new Date(dragStart.getTime());
@@ -21931,18 +22037,34 @@ class DragAndDrop extends ActionBase {
21931
22037
  this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
21932
22038
  }
21933
22039
  const startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
21934
- for (let index = 0; index < this.multiData.length; index++) {
21935
- this.updatedData[parseInt(index.toString(), 10)] =
21936
- this.updateMultipleData(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
21937
- const dayIndex = this.getDayIndex(this.updatedData[parseInt(index.toString(), 10)]);
21938
- if (dayIndex >= 0) {
21939
- const wrapper = this.getEventWrapper(dayIndex, this.updatedData[parseInt(index.toString(), 10)][this.parent.eventFields.isAllDay]);
21940
- this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
21941
- this.updateEventHeight(this.updatedData[parseInt(index.toString(), 10)], index, dayIndex);
21942
- }
21943
- else {
21944
- if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index.toString(), 10)].parentNode)) {
21945
- remove(this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
22040
+ if (this.enableCurrentViewDrag) {
22041
+ const renderDates = this.getRenderedDates();
22042
+ for (let i = 0; i < this.multiData.length; i++) {
22043
+ const eventObj = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
22044
+ const startTime = new Date(eventObj[this.parent.eventFields.startTime].getTime() + startTimeDiff);
22045
+ const dayIndex = this.parent.getIndexOfDate(renderDates, resetTime(startTime));
22046
+ if (dayIndex < 0) {
22047
+ this.isPreventMultiDrag = true;
22048
+ break;
22049
+ }
22050
+ this.isPreventMultiDrag = false;
22051
+ }
22052
+ }
22053
+ if (!this.isPreventMultiDrag) {
22054
+ for (let index = 0; index < this.multiData.length; index++) {
22055
+ this.updatedData[parseInt(index.toString(), 10)] =
22056
+ this.updateMultipleData(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
22057
+ const dayIndex = this.getDayIndex(this.updatedData[parseInt(index.toString(), 10)]);
22058
+ if (dayIndex >= 0) {
22059
+ const isAllDay = this.updatedData[parseInt(index.toString(), 10)][this.parent.eventFields.isAllDay];
22060
+ const wrapper = this.getEventWrapper(dayIndex, isAllDay);
22061
+ this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
22062
+ this.updateEventHeight(this.updatedData[parseInt(index.toString(), 10)], index, dayIndex);
22063
+ }
22064
+ else {
22065
+ if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index.toString(), 10)].parentNode)) {
22066
+ remove(this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
22067
+ }
21946
22068
  }
21947
22069
  }
21948
22070
  }
@@ -22158,6 +22280,9 @@ class DragAndDrop extends ActionBase {
22158
22280
  }
22159
22281
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
22160
22282
  swapDragging(e) {
22283
+ if (this.isPreventMultiDrag) {
22284
+ return;
22285
+ }
22161
22286
  const colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
22162
22287
  if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
22163
22288
  !closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
@@ -22512,7 +22637,7 @@ class DragAndDrop extends ActionBase {
22512
22637
  ~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
22513
22638
  let rowIndex = Math.floor(Math.floor((this.actionObj.Y +
22514
22639
  (dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
22515
- getElementTop(dragArea)) / rowHeight);
22640
+ getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
22516
22641
  rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
22517
22642
  this.actionObj.index = rowIndex;
22518
22643
  const eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
@@ -22528,7 +22653,7 @@ class DragAndDrop extends ActionBase {
22528
22653
  if (!isNullOrUndefined(this.parent.eventDragArea)) {
22529
22654
  return;
22530
22655
  }
22531
- let top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
22656
+ let top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
22532
22657
  if (this.parent.rowAutoHeight) {
22533
22658
  const cursorElement = this.getCursorElement(e);
22534
22659
  if (cursorElement) {
@@ -23085,7 +23210,7 @@ class ViewBase {
23085
23210
  if (this.isTimelineView()) {
23086
23211
  const colElements = this.getColElements();
23087
23212
  const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
23088
- const colWidth = (getElementWidth(contentBody) / (colElements.length / 2));
23213
+ const colWidth = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
23089
23214
  if (content.offsetHeight !== content.clientHeight) {
23090
23215
  const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
23091
23216
  if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
@@ -23445,11 +23570,8 @@ class VerticalView extends ViewBase {
23445
23570
  const currentDate = this.parent.getCurrentTime();
23446
23571
  if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
23447
23572
  const currentDateIndex = this.getCurrentTimeIndicatorIndex();
23448
- if (currentDateIndex.length > 0) {
23449
- const workCells = [].slice.call(this.element.querySelectorAll('.' + WORK_CELLS_CLASS));
23450
- if (workCells.length > 0) {
23451
- this.changeCurrentTimePosition();
23452
- }
23573
+ if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
23574
+ this.changeCurrentTimePosition();
23453
23575
  if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
23454
23576
  const interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
23455
23577
  if (interval <= (MS_PER_MINUTE - 1000)) {
@@ -23569,7 +23691,7 @@ class VerticalView extends ViewBase {
23569
23691
  this.parent.activeViewOptions.timeScale.interval;
23570
23692
  }
23571
23693
  getWorkCellHeight() {
23572
- return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
23694
+ return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
23573
23695
  }
23574
23696
  getTdContent(date, type, groupIndex) {
23575
23697
  let cntEle;
@@ -23870,11 +23992,24 @@ class VerticalView extends ViewBase {
23870
23992
  const rows = [];
23871
23993
  const tr = createElement('tr');
23872
23994
  const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
23995
+ let existingGroupIndices = new Set();
23996
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
23997
+ this.parent.virtualScrollModule.existingDataCollection.length > 0) {
23998
+ existingGroupIndices = new Set(this.parent.virtualScrollModule.existingDataCollection.map((data) => data.groupIndex));
23999
+ }
23873
24000
  const handler = (r) => {
23874
24001
  const ntr = tr.cloneNode();
23875
24002
  for (const tdData of this.colLevels[this.colLevels.length - 1]) {
23876
- const ntd = this.createContentTd(tdData, r, td);
23877
- ntr.appendChild(ntd);
24003
+ let isAllowTdCreation = true;
24004
+ if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0) {
24005
+ if (existingGroupIndices.has(tdData.groupIndex)) {
24006
+ isAllowTdCreation = false;
24007
+ }
24008
+ }
24009
+ if (isAllowTdCreation) {
24010
+ const ntd = this.createContentTd(tdData, r, td);
24011
+ ntr.appendChild(ntd);
24012
+ }
23878
24013
  }
23879
24014
  rows.push(ntr);
23880
24015
  return r;
@@ -25302,7 +25437,8 @@ class AgendaBase extends ViewBase {
25302
25437
  const scheduleId = this.parent.element.id + '_';
25303
25438
  const viewName = this.parent.activeViewOptions.eventTemplateName;
25304
25439
  const templateId = scheduleId + viewName + 'eventTemplate';
25305
- templateEle = this.parent.getAppointmentTemplate()(listData[parseInt(li.toString(), 10)], this.parent, 'eventTemplate', templateId, false, undefined, undefined, this.parent.root);
25440
+ templateEle =
25441
+ this.parent.getAppointmentTemplate()(listData[parseInt(li.toString(), 10)], this.parent, 'eventTemplate', templateId, false, undefined, undefined, this.parent.root);
25306
25442
  if (!isNullOrUndefined(listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceRule])) {
25307
25443
  const iconClass = (listData[parseInt(li.toString(), 10)][fieldMapping.id] ===
25308
25444
  listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceID]) ?
@@ -26443,7 +26579,7 @@ class TimelineViews extends VerticalView {
26443
26579
  }
26444
26580
  let scrollLeft;
26445
26581
  if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
26446
- scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
26582
+ scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
26447
26583
  }
26448
26584
  else {
26449
26585
  scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
@@ -26527,7 +26663,7 @@ class TimelineViews extends VerticalView {
26527
26663
  if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
26528
26664
  this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
26529
26665
  diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
26530
- getElementWidth(this.element.querySelector('.e-work-cells'));
26666
+ this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
26531
26667
  }
26532
26668
  else {
26533
26669
  const endHour = this.getEndHour();
@@ -26537,8 +26673,8 @@ class TimelineViews extends VerticalView {
26537
26673
  }
26538
26674
  }
26539
26675
  }
26540
- return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells')) * this.parent.activeViewOptions.timeScale.slotCount) /
26541
- this.parent.activeViewOptions.timeScale.interval);
26676
+ return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
26677
+ * this.parent.activeViewOptions.timeScale.slotCount) / this.parent.activeViewOptions.timeScale.interval);
26542
26678
  }
26543
26679
  renderHeader() {
26544
26680
  const tr = createElement('tr');