@syncfusion/ej2-schedule 26.1.40 → 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.
- package/dist/ej2-schedule.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +234 -107
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +235 -107
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/schedule/actions/drag.d.ts +2 -0
- package/src/schedule/actions/drag.js +43 -15
- package/src/schedule/actions/resize.js +20 -20
- package/src/schedule/actions/touch.js +1 -0
- package/src/schedule/actions/virtual-scroll.d.ts +4 -0
- package/src/schedule/actions/virtual-scroll.js +78 -29
- package/src/schedule/base/interface.d.ts +3 -0
- package/src/schedule/base/schedule.d.ts +25 -0
- package/src/schedule/base/schedule.js +36 -1
- package/src/schedule/base/util.d.ts +10 -5
- package/src/schedule/base/util.js +15 -10
- package/src/schedule/event-renderer/inline-edit.js +4 -4
- package/src/schedule/event-renderer/month.js +3 -3
- package/src/schedule/event-renderer/timeline-view.js +4 -4
- package/src/schedule/event-renderer/vertical-view.js +2 -2
- package/src/schedule/event-renderer/year.js +5 -5
- package/src/schedule/renderer/timeline-view.js +4 -4
- package/src/schedule/renderer/vertical-view.js +18 -8
- 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
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -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) {
|
|
@@ -13789,6 +13795,7 @@ class VirtualScroll {
|
|
|
13789
13795
|
this.renderedLength = 0;
|
|
13790
13796
|
this.averageRowHeight = 0;
|
|
13791
13797
|
this.startIndex = 0;
|
|
13798
|
+
this.existingDataCollection = [];
|
|
13792
13799
|
this.parent = parent;
|
|
13793
13800
|
this.addEventListener();
|
|
13794
13801
|
}
|
|
@@ -13861,10 +13868,10 @@ class VirtualScroll {
|
|
|
13861
13868
|
}
|
|
13862
13869
|
setItemSize() {
|
|
13863
13870
|
if (this.isHorizontalScroll) {
|
|
13864
|
-
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;
|
|
13865
13872
|
}
|
|
13866
13873
|
else {
|
|
13867
|
-
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;
|
|
13868
13875
|
}
|
|
13869
13876
|
}
|
|
13870
13877
|
refreshLayout() {
|
|
@@ -14141,43 +14148,90 @@ class VirtualScroll {
|
|
|
14141
14148
|
append(eventRows, eventWrap);
|
|
14142
14149
|
}
|
|
14143
14150
|
updateHorizontalContent(conWrap, resCollection) {
|
|
14151
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
14144
14152
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
14145
14153
|
const selectedEle = this.parent.getSelectedCells();
|
|
14146
14154
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
14147
|
-
const
|
|
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;
|
|
14148
14166
|
for (let i = 0; i < renderedLength; i++) {
|
|
14149
14167
|
remove(conWrap.querySelector('tbody tr'));
|
|
14150
14168
|
}
|
|
14151
|
-
if (this.parent.
|
|
14152
|
-
|
|
14153
|
-
this.parent.activeView.colLevels[0] = resCollection;
|
|
14154
|
-
}
|
|
14155
|
-
else {
|
|
14156
|
-
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14157
|
-
}
|
|
14158
|
-
const contentRows = this.parent.activeView.getContentRows();
|
|
14159
|
-
append(contentRows, conWrap.querySelector('tbody'));
|
|
14169
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
14170
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
14160
14171
|
}
|
|
14161
14172
|
else {
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
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
|
+
}
|
|
14173
14192
|
});
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
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'));
|
|
14180
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
|
+
});
|
|
14181
14235
|
}
|
|
14182
14236
|
getBufferCollection(startIndex, endIndex) {
|
|
14183
14237
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -16754,6 +16808,37 @@ let Schedule = class Schedule extends Component {
|
|
|
16754
16808
|
}
|
|
16755
16809
|
return templateName;
|
|
16756
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
|
+
}
|
|
16757
16842
|
/**
|
|
16758
16843
|
* Method to render react templates
|
|
16759
16844
|
*
|
|
@@ -16833,6 +16918,7 @@ let Schedule = class Schedule extends Component {
|
|
|
16833
16918
|
this.headerModule = new HeaderRenderer(this);
|
|
16834
16919
|
}
|
|
16835
16920
|
this.renderTableContainer();
|
|
16921
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
16836
16922
|
if (Browser.isDevice || Browser.isTouch) {
|
|
16837
16923
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
16838
16924
|
}
|
|
@@ -17327,7 +17413,7 @@ let Schedule = class Schedule extends Component {
|
|
|
17327
17413
|
this.uiStateValues = {
|
|
17328
17414
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
17329
17415
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
17330
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
17416
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
17331
17417
|
};
|
|
17332
17418
|
}
|
|
17333
17419
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -18712,6 +18798,9 @@ let Schedule = class Schedule extends Component {
|
|
|
18712
18798
|
* @returns {void}
|
|
18713
18799
|
*/
|
|
18714
18800
|
scrollTo(hour, scrollDate) {
|
|
18801
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
18802
|
+
return;
|
|
18803
|
+
}
|
|
18715
18804
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
18716
18805
|
this.activeView.scrollToDate(scrollDate);
|
|
18717
18806
|
}
|
|
@@ -20187,8 +20276,8 @@ class Resize extends ActionBase {
|
|
|
20187
20276
|
};
|
|
20188
20277
|
this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
|
|
20189
20278
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20190
|
-
this.actionObj.cellWidth = getElementWidth(workCell);
|
|
20191
|
-
this.actionObj.cellHeight = getElementHeight(workCell);
|
|
20279
|
+
this.actionObj.cellWidth = this.parent.getElementWidth(workCell);
|
|
20280
|
+
this.actionObj.cellHeight = this.parent.getElementHeight(workCell);
|
|
20192
20281
|
const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
|
|
20193
20282
|
if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
20194
20283
|
const tr = this.parent.getContentTable().querySelector('tr');
|
|
@@ -20490,10 +20579,10 @@ class Resize extends ActionBase {
|
|
|
20490
20579
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
20491
20580
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20492
20581
|
if (!isLeft) {
|
|
20493
|
-
offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20582
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20494
20583
|
}
|
|
20495
|
-
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (getElementWidth(tr) / noOfDays)) :
|
|
20496
|
-
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));
|
|
20497
20586
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
20498
20587
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
20499
20588
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20502,7 +20591,7 @@ class Resize extends ActionBase {
|
|
|
20502
20591
|
else {
|
|
20503
20592
|
const cellWidth = this.actionObj.cellWidth;
|
|
20504
20593
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
20505
|
-
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);
|
|
20506
20595
|
if (this.parent.enableRtl) {
|
|
20507
20596
|
let cellOffsetWidth = 0;
|
|
20508
20597
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -20510,7 +20599,7 @@ class Resize extends ActionBase {
|
|
|
20510
20599
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
20511
20600
|
}
|
|
20512
20601
|
const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
20513
|
-
this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20602
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20514
20603
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
20515
20604
|
}
|
|
20516
20605
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20529,7 +20618,7 @@ class Resize extends ActionBase {
|
|
|
20529
20618
|
}
|
|
20530
20619
|
else {
|
|
20531
20620
|
if (!isLeft) {
|
|
20532
|
-
offset += getElementWidth(this.actionObj.clone);
|
|
20621
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
20533
20622
|
}
|
|
20534
20623
|
let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
20535
20624
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -20541,9 +20630,9 @@ class Resize extends ActionBase {
|
|
|
20541
20630
|
}
|
|
20542
20631
|
else {
|
|
20543
20632
|
const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
20544
|
-
const originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
|
|
20633
|
+
const originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
20545
20634
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20546
|
-
const noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20635
|
+
const noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20547
20636
|
this.actionObj.cellWidth);
|
|
20548
20637
|
const tr = closest(this.actionObj.clone, 'tr');
|
|
20549
20638
|
let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -20606,9 +20695,9 @@ class Resize extends ActionBase {
|
|
|
20606
20695
|
const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
20607
20696
|
const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
20608
20697
|
const targetWidth = isTimelineView ?
|
|
20609
|
-
(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
20610
|
-
this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
|
|
20611
|
-
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;
|
|
20612
20701
|
let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
20613
20702
|
const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
20614
20703
|
if (isTimeViews) {
|
|
@@ -20623,7 +20712,7 @@ class Resize extends ActionBase {
|
|
|
20623
20712
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
20624
20713
|
}
|
|
20625
20714
|
let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
20626
|
-
getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20715
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20627
20716
|
if (this.parent.enableRtl) {
|
|
20628
20717
|
let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
20629
20718
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -20637,7 +20726,7 @@ class Resize extends ActionBase {
|
|
|
20637
20726
|
}
|
|
20638
20727
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
20639
20728
|
styles.right = formatUnit(rightValue);
|
|
20640
|
-
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;
|
|
20641
20730
|
}
|
|
20642
20731
|
else {
|
|
20643
20732
|
let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -20645,12 +20734,12 @@ class Resize extends ActionBase {
|
|
|
20645
20734
|
if (isTimelineView) {
|
|
20646
20735
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
20647
20736
|
if (this.parent.enableRtl) {
|
|
20648
|
-
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))
|
|
20649
20738
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
20650
20739
|
}
|
|
20651
20740
|
else {
|
|
20652
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
|
|
20653
|
-
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) ?
|
|
20654
20743
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
20655
20744
|
}
|
|
20656
20745
|
}
|
|
@@ -20666,10 +20755,10 @@ class Resize extends ActionBase {
|
|
|
20666
20755
|
}
|
|
20667
20756
|
else {
|
|
20668
20757
|
offsetLeft = 0;
|
|
20669
|
-
width = getElementWidth(this.actionObj.clone);
|
|
20758
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
20670
20759
|
}
|
|
20671
20760
|
}
|
|
20672
|
-
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) *
|
|
20673
20762
|
this.actionObj.cellWidth;
|
|
20674
20763
|
if (isLeft) {
|
|
20675
20764
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -20782,10 +20871,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20782
20871
|
}
|
|
20783
20872
|
timelineYearViewEvents() {
|
|
20784
20873
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
20785
|
-
this.cellWidth = getElementWidth(workCell);
|
|
20874
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20786
20875
|
this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
|
|
20787
20876
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20788
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20877
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20789
20878
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20790
20879
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20791
20880
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20932,10 +21021,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20932
21021
|
const contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
20933
21022
|
const isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
|
|
20934
21023
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20935
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21024
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20936
21025
|
this.cellHeader = 0;
|
|
20937
21026
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20938
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21027
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20939
21028
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20940
21029
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20941
21030
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20977,7 +21066,7 @@ class YearEvent extends TimelineEvent {
|
|
|
20977
21066
|
appWrapper.forEach((appWrap, cellIndex) => {
|
|
20978
21067
|
const td = row.querySelector(`td:nth-child(${cellIndex + 1})`);
|
|
20979
21068
|
const app = [].slice.call(appWrap.children);
|
|
20980
|
-
const width = getElementWidth(td);
|
|
21069
|
+
const width = this.parent.getElementWidth(td);
|
|
20981
21070
|
const left = td.offsetLeft;
|
|
20982
21071
|
if (this.parent.enableRtl) {
|
|
20983
21072
|
const right = conTable.offsetWidth - left - td.offsetWidth;
|
|
@@ -21320,6 +21409,8 @@ class DragAndDrop extends ActionBase {
|
|
|
21320
21409
|
this.isAllDayTarget = false;
|
|
21321
21410
|
this.targetTd = null;
|
|
21322
21411
|
this.isCursorAhead = false;
|
|
21412
|
+
this.enableCurrentViewDrag = false;
|
|
21413
|
+
this.isPreventMultiDrag = false;
|
|
21323
21414
|
}
|
|
21324
21415
|
wireDragEvent(element) {
|
|
21325
21416
|
new Draggable(element, {
|
|
@@ -21433,6 +21524,9 @@ class DragAndDrop extends ActionBase {
|
|
|
21433
21524
|
if (cloneBottom > scrollHeight) {
|
|
21434
21525
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
21435
21526
|
}
|
|
21527
|
+
if (this.isPreventMultiDrag) {
|
|
21528
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
21529
|
+
}
|
|
21436
21530
|
}
|
|
21437
21531
|
return { left: leftValue, top: topValue };
|
|
21438
21532
|
}
|
|
@@ -21483,6 +21577,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21483
21577
|
this.actionObj.interval = dragEventArgs.interval;
|
|
21484
21578
|
this.actionObj.navigation = dragEventArgs.navigation;
|
|
21485
21579
|
this.actionObj.scroll = dragEventArgs.scroll;
|
|
21580
|
+
this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && this.parent.allowMultiDrag;
|
|
21486
21581
|
this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
21487
21582
|
const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
21488
21583
|
this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -21641,6 +21736,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21641
21736
|
}
|
|
21642
21737
|
dragStop(e) {
|
|
21643
21738
|
this.isCursorAhead = false;
|
|
21739
|
+
this.isPreventMultiDrag = false;
|
|
21644
21740
|
this.removeCloneElementClasses();
|
|
21645
21741
|
this.removeCloneElement();
|
|
21646
21742
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -21708,7 +21804,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21708
21804
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
21709
21805
|
this.timelineEventModule.getSlotDates();
|
|
21710
21806
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
21711
|
-
getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21807
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21712
21808
|
this.calculateTimelineTime(e);
|
|
21713
21809
|
}
|
|
21714
21810
|
else {
|
|
@@ -21883,7 +21979,9 @@ class DragAndDrop extends ActionBase {
|
|
|
21883
21979
|
let dragStart;
|
|
21884
21980
|
let dragEnd;
|
|
21885
21981
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
21886
|
-
this.
|
|
21982
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
21983
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
21984
|
+
}
|
|
21887
21985
|
dragStart = this.parent.getDateFromElement(td);
|
|
21888
21986
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
21889
21987
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -21939,18 +22037,34 @@ class DragAndDrop extends ActionBase {
|
|
|
21939
22037
|
this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
|
|
21940
22038
|
}
|
|
21941
22039
|
const startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
21942
|
-
|
|
21943
|
-
this.
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
const
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
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
|
+
}
|
|
21954
22068
|
}
|
|
21955
22069
|
}
|
|
21956
22070
|
}
|
|
@@ -22166,6 +22280,9 @@ class DragAndDrop extends ActionBase {
|
|
|
22166
22280
|
}
|
|
22167
22281
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22168
22282
|
swapDragging(e) {
|
|
22283
|
+
if (this.isPreventMultiDrag) {
|
|
22284
|
+
return;
|
|
22285
|
+
}
|
|
22169
22286
|
const colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
22170
22287
|
if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
|
|
22171
22288
|
!closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -22520,7 +22637,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22520
22637
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
22521
22638
|
let rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
22522
22639
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
22523
|
-
getElementTop(dragArea)) / rowHeight);
|
|
22640
|
+
getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
22524
22641
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
22525
22642
|
this.actionObj.index = rowIndex;
|
|
22526
22643
|
const eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -22536,7 +22653,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22536
22653
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
22537
22654
|
return;
|
|
22538
22655
|
}
|
|
22539
|
-
let top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22656
|
+
let top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22540
22657
|
if (this.parent.rowAutoHeight) {
|
|
22541
22658
|
const cursorElement = this.getCursorElement(e);
|
|
22542
22659
|
if (cursorElement) {
|
|
@@ -23093,7 +23210,7 @@ class ViewBase {
|
|
|
23093
23210
|
if (this.isTimelineView()) {
|
|
23094
23211
|
const colElements = this.getColElements();
|
|
23095
23212
|
const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
23096
|
-
const colWidth = (getElementWidth(contentBody) / (colElements.length / 2));
|
|
23213
|
+
const colWidth = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
|
|
23097
23214
|
if (content.offsetHeight !== content.clientHeight) {
|
|
23098
23215
|
const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
23099
23216
|
if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
|
|
@@ -23453,11 +23570,8 @@ class VerticalView extends ViewBase {
|
|
|
23453
23570
|
const currentDate = this.parent.getCurrentTime();
|
|
23454
23571
|
if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
|
|
23455
23572
|
const currentDateIndex = this.getCurrentTimeIndicatorIndex();
|
|
23456
|
-
if (currentDateIndex.length > 0) {
|
|
23457
|
-
|
|
23458
|
-
if (workCells.length > 0) {
|
|
23459
|
-
this.changeCurrentTimePosition();
|
|
23460
|
-
}
|
|
23573
|
+
if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
|
|
23574
|
+
this.changeCurrentTimePosition();
|
|
23461
23575
|
if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
|
|
23462
23576
|
const interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
|
|
23463
23577
|
if (interval <= (MS_PER_MINUTE - 1000)) {
|
|
@@ -23577,7 +23691,7 @@ class VerticalView extends ViewBase {
|
|
|
23577
23691
|
this.parent.activeViewOptions.timeScale.interval;
|
|
23578
23692
|
}
|
|
23579
23693
|
getWorkCellHeight() {
|
|
23580
|
-
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));
|
|
23581
23695
|
}
|
|
23582
23696
|
getTdContent(date, type, groupIndex) {
|
|
23583
23697
|
let cntEle;
|
|
@@ -23878,11 +23992,24 @@ class VerticalView extends ViewBase {
|
|
|
23878
23992
|
const rows = [];
|
|
23879
23993
|
const tr = createElement('tr');
|
|
23880
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
|
+
}
|
|
23881
24000
|
const handler = (r) => {
|
|
23882
24001
|
const ntr = tr.cloneNode();
|
|
23883
24002
|
for (const tdData of this.colLevels[this.colLevels.length - 1]) {
|
|
23884
|
-
|
|
23885
|
-
|
|
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
|
+
}
|
|
23886
24013
|
}
|
|
23887
24014
|
rows.push(ntr);
|
|
23888
24015
|
return r;
|
|
@@ -26452,7 +26579,7 @@ class TimelineViews extends VerticalView {
|
|
|
26452
26579
|
}
|
|
26453
26580
|
let scrollLeft;
|
|
26454
26581
|
if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
|
|
26455
|
-
scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26582
|
+
scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26456
26583
|
}
|
|
26457
26584
|
else {
|
|
26458
26585
|
scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
|
|
@@ -26536,7 +26663,7 @@ class TimelineViews extends VerticalView {
|
|
|
26536
26663
|
if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
|
|
26537
26664
|
this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
|
|
26538
26665
|
diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
|
|
26539
|
-
getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26666
|
+
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26540
26667
|
}
|
|
26541
26668
|
else {
|
|
26542
26669
|
const endHour = this.getEndHour();
|
|
@@ -26546,8 +26673,8 @@ class TimelineViews extends VerticalView {
|
|
|
26546
26673
|
}
|
|
26547
26674
|
}
|
|
26548
26675
|
}
|
|
26549
|
-
return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
26550
|
-
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);
|
|
26551
26678
|
}
|
|
26552
26679
|
renderHeader() {
|
|
26553
26680
|
const tr = createElement('tr');
|