@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 @@ var 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
|
var height = 0;
|
|
114
115
|
var 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
|
var width = 0;
|
|
131
133
|
var 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
|
}
|
|
@@ -524,28 +526,31 @@ function capitalizeFirstWord(inputString, type) {
|
|
|
524
526
|
* Method to get element cell width
|
|
525
527
|
*
|
|
526
528
|
* @param {HTMLElement} element Accepts the DOM element
|
|
529
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
527
530
|
* @returns {number} Returns the width of the given element
|
|
528
531
|
*/
|
|
529
|
-
function getElementWidth(element) {
|
|
530
|
-
return
|
|
532
|
+
function getElementWidth(element, isTransformed) {
|
|
533
|
+
return isTransformed ? element.offsetWidth : element.getBoundingClientRect().width;
|
|
531
534
|
}
|
|
532
535
|
/**
|
|
533
536
|
* Method to get element cell Height
|
|
534
537
|
*
|
|
535
538
|
* @param {HTMLElement} element Accepts the DOM element
|
|
539
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
536
540
|
* @returns {number} Returns the Height of the given element
|
|
537
541
|
*/
|
|
538
|
-
function getElementHeight(element) {
|
|
539
|
-
return
|
|
542
|
+
function getElementHeight(element, isTransformed) {
|
|
543
|
+
return isTransformed ? element.offsetHeight : element.getBoundingClientRect().height;
|
|
540
544
|
}
|
|
541
545
|
/**
|
|
542
546
|
* Method to get element cell Top
|
|
543
547
|
*
|
|
544
548
|
* @param {HTMLElement} element Accepts the DOM element
|
|
549
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
545
550
|
* @returns {number} Returns the top value of the given element
|
|
546
551
|
*/
|
|
547
|
-
function getElementTop(element) {
|
|
548
|
-
return
|
|
552
|
+
function getElementTop(element, isTransformed) {
|
|
553
|
+
return isTransformed ? element.offsetTop : element.getBoundingClientRect().top;
|
|
549
554
|
}
|
|
550
555
|
|
|
551
556
|
/**
|
|
@@ -1928,6 +1933,7 @@ var ScheduleTouch = /** @__PURE__ @class */ (function () {
|
|
|
1928
1933
|
this.parent.selectedElements = [];
|
|
1929
1934
|
this.parent.eventBase.getSelectedEventElements(target);
|
|
1930
1935
|
if (this.parent.resizeModule && closest(e.originalEvent.target, '.' + EVENT_RESIZE_CLASS)) {
|
|
1936
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1931
1937
|
this.parent.resizeModule.resizeStart(e.originalEvent);
|
|
1932
1938
|
}
|
|
1933
1939
|
}
|
|
@@ -6992,7 +6998,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
6992
6998
|
this.resources = this.parent.resourceBase.renderedResources;
|
|
6993
6999
|
}
|
|
6994
7000
|
this.cellHeight =
|
|
6995
|
-
parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
7001
|
+
parseFloat(this.parent.getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6996
7002
|
this.dateRender[0] = this.parent.activeView.renderDates;
|
|
6997
7003
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
6998
7004
|
for (var i = 0, len = this.resources.length; i < len; i++) {
|
|
@@ -7078,7 +7084,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7078
7084
|
var resources = this.getResourceList();
|
|
7079
7085
|
var dateCount = this.getStartCount();
|
|
7080
7086
|
var isRender;
|
|
7081
|
-
var appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
7087
|
+
var appHeight = eventType === 'allDayEvents' ? this.parent.getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
7082
7088
|
var allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
|
|
7083
7089
|
var _loop_1 = function (resource) {
|
|
7084
7090
|
isRender = true;
|
|
@@ -7833,7 +7839,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7833
7839
|
this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
|
|
7834
7840
|
cellTd.removeChild(wrapper);
|
|
7835
7841
|
}
|
|
7836
|
-
this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7842
|
+
this.eventHeight = this.parent.getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7837
7843
|
var selector = '.' + CONTENT_TABLE_CLASS + ' tbody tr';
|
|
7838
7844
|
this.addCellHeight(selector, this.eventHeight, (this.parent.currentView === 'Month' ? EVENT_GAP : 2), this.monthHeaderHeight, this.moreIndicatorHeight);
|
|
7839
7845
|
var scrollTop = conWrap.scrollTop;
|
|
@@ -7912,8 +7918,8 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7912
7918
|
});
|
|
7913
7919
|
}
|
|
7914
7920
|
var cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
|
|
7915
|
-
this.cellWidth = getElementWidth(cellDetail);
|
|
7916
|
-
this.cellHeight = getElementHeight(cellDetail);
|
|
7921
|
+
this.cellWidth = this.parent.getElementWidth(cellDetail);
|
|
7922
|
+
this.cellHeight = this.parent.getElementHeight(cellDetail);
|
|
7917
7923
|
this.dateRender = dateRender;
|
|
7918
7924
|
var filteredDates = this.getRenderedDates(dateRender);
|
|
7919
7925
|
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
@@ -8494,7 +8500,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8494
8500
|
this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
|
|
8495
8501
|
this.renderType = 'day';
|
|
8496
8502
|
var workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
|
|
8497
|
-
this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8503
|
+
this.cellWidth = this.parent.getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8498
8504
|
this.slotsPerDay = 1;
|
|
8499
8505
|
}
|
|
8500
8506
|
else {
|
|
@@ -8664,14 +8670,14 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8664
8670
|
this.wireAppointmentEvents(appointmentElement, event);
|
|
8665
8671
|
if (this.parent.rowAutoHeight) {
|
|
8666
8672
|
var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
8667
|
-
var conWidth = getElementWidth(conWrap);
|
|
8673
|
+
var conWidth = this.parent.getElementWidth(conWrap);
|
|
8668
8674
|
var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
|
|
8669
8675
|
conWrap.offsetWidth === conWrap.clientWidth;
|
|
8670
8676
|
this.renderEventElement(event, appointmentElement, cellTd);
|
|
8671
8677
|
var firstChild = this.getFirstChild(resIndex);
|
|
8672
8678
|
this.updateCellHeight(firstChild, height);
|
|
8673
8679
|
if (isWithoutScroll &&
|
|
8674
|
-
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
|
|
8680
|
+
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
|
|
8675
8681
|
this.adjustAppointments(conWidth);
|
|
8676
8682
|
}
|
|
8677
8683
|
}
|
|
@@ -8790,7 +8796,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8790
8796
|
TimelineEvent.prototype.adjustAppointments = function (conWidth) {
|
|
8791
8797
|
var _this = this;
|
|
8792
8798
|
var tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8793
|
-
var actualCellWidth = getElementWidth(this.workCells[0]);
|
|
8799
|
+
var actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8794
8800
|
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8795
8801
|
var currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8796
8802
|
var apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
@@ -9154,11 +9160,11 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9154
9160
|
var allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
|
|
9155
9161
|
var allDayLevel = 0;
|
|
9156
9162
|
if (allDayElements.length > 0) {
|
|
9157
|
-
allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
9163
|
+
allDayLevel = Math.floor(this.parent.getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
9158
9164
|
allDayElements[0].offsetHeight) - 1;
|
|
9159
9165
|
}
|
|
9160
9166
|
verticalEvent.allDayLevel = allDayLevel;
|
|
9161
|
-
var appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
9167
|
+
var appHeight = this.parent.getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
9162
9168
|
var cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
|
|
9163
9169
|
verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
|
|
9164
9170
|
}
|
|
@@ -9186,7 +9192,7 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9186
9192
|
monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
|
|
9187
9193
|
monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
|
|
9188
9194
|
monthEvent.eventHeight =
|
|
9189
|
-
getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
9195
|
+
this.parent.getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
9190
9196
|
monthEvent.getSlotDates(workDays);
|
|
9191
9197
|
var filteredDates = monthEvent.getRenderedDates(renderDates);
|
|
9192
9198
|
var spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
|
|
@@ -9210,7 +9216,7 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9210
9216
|
var dayLength = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?
|
|
9211
9217
|
0 : this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;
|
|
9212
9218
|
timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
|
|
9213
|
-
timelineView.eventHeight = getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9219
|
+
timelineView.eventHeight = this.parent.getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9214
9220
|
timelineView.renderEvents(saveObject, resIndex);
|
|
9215
9221
|
};
|
|
9216
9222
|
InlineEdit.prototype.getEventDaysCount = function (saveObj) {
|
|
@@ -14111,6 +14117,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14111
14117
|
this.renderedLength = 0;
|
|
14112
14118
|
this.averageRowHeight = 0;
|
|
14113
14119
|
this.startIndex = 0;
|
|
14120
|
+
this.existingDataCollection = [];
|
|
14114
14121
|
this.parent = parent;
|
|
14115
14122
|
this.addEventListener();
|
|
14116
14123
|
}
|
|
@@ -14183,10 +14190,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14183
14190
|
};
|
|
14184
14191
|
VirtualScroll.prototype.setItemSize = function () {
|
|
14185
14192
|
if (this.isHorizontalScroll) {
|
|
14186
|
-
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14193
|
+
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
|
|
14187
14194
|
}
|
|
14188
14195
|
else {
|
|
14189
|
-
this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14196
|
+
this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14190
14197
|
}
|
|
14191
14198
|
};
|
|
14192
14199
|
VirtualScroll.prototype.refreshLayout = function () {
|
|
@@ -14470,43 +14477,91 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14470
14477
|
append(eventRows, eventWrap);
|
|
14471
14478
|
};
|
|
14472
14479
|
VirtualScroll.prototype.updateHorizontalContent = function (conWrap, resCollection) {
|
|
14480
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
14473
14481
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
14474
14482
|
var selectedEle = this.parent.getSelectedCells();
|
|
14475
14483
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
14476
|
-
var
|
|
14484
|
+
var tbody = conWrap.querySelector('tbody');
|
|
14485
|
+
var renderedRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14486
|
+
if (this.parent.currentView === 'Month') {
|
|
14487
|
+
this.updateMonthViewContent(conWrap, resCollection);
|
|
14488
|
+
}
|
|
14489
|
+
else {
|
|
14490
|
+
this.updateOtherViewContent(conWrap, resCollection, renderedRows);
|
|
14491
|
+
}
|
|
14492
|
+
};
|
|
14493
|
+
VirtualScroll.prototype.updateMonthViewContent = function (conWrap, resCollection) {
|
|
14494
|
+
var renderedLength = conWrap.querySelectorAll(' tr').length;
|
|
14477
14495
|
for (var i = 0; i < renderedLength; i++) {
|
|
14478
14496
|
remove(conWrap.querySelector('tbody tr'));
|
|
14479
14497
|
}
|
|
14480
|
-
if (this.parent.
|
|
14481
|
-
|
|
14482
|
-
this.parent.activeView.colLevels[0] = resCollection;
|
|
14483
|
-
}
|
|
14484
|
-
else {
|
|
14485
|
-
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14486
|
-
}
|
|
14487
|
-
var contentRows = this.parent.activeView.getContentRows();
|
|
14488
|
-
append(contentRows, conWrap.querySelector('tbody'));
|
|
14498
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
14499
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
14489
14500
|
}
|
|
14490
14501
|
else {
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14503
|
+
}
|
|
14504
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
14505
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
14506
|
+
};
|
|
14507
|
+
VirtualScroll.prototype.updateOtherViewContent = function (conWrap, resCollection, renderedRows) {
|
|
14508
|
+
var tbody = conWrap.querySelector('tbody');
|
|
14509
|
+
var colGroup = conWrap.querySelector('colgroup');
|
|
14510
|
+
var thead = conWrap.querySelector('thead');
|
|
14511
|
+
var table = conWrap.querySelector('table');
|
|
14512
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
14513
|
+
var newGroupIndices = new Set(resCollection.map(function (data) { return data.groupIndex; }));
|
|
14514
|
+
renderedRows.forEach(function (row) {
|
|
14515
|
+
var tdElements = row.querySelectorAll('td');
|
|
14516
|
+
tdElements.forEach(function (td) {
|
|
14517
|
+
var groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
14518
|
+
if (!newGroupIndices.has(groupIndex)) {
|
|
14519
|
+
td.remove();
|
|
14520
|
+
}
|
|
14502
14521
|
});
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14522
|
+
});
|
|
14523
|
+
var col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
14524
|
+
for (var i = 0; i < col.length; i++) {
|
|
14525
|
+
remove(col[parseInt(i.toString(), 10)]);
|
|
14526
|
+
}
|
|
14527
|
+
resCollection.forEach(function () { return colGroup.appendChild(createElement('col')); });
|
|
14528
|
+
var tHead = [].slice.call(conWrap.querySelector('thead').children);
|
|
14529
|
+
for (var i = 0; i < tHead.length; i++) {
|
|
14530
|
+
remove(tHead[parseInt(i.toString(), 10)]);
|
|
14531
|
+
}
|
|
14532
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
14533
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
14534
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
14509
14535
|
}
|
|
14536
|
+
prepend([thead], table);
|
|
14537
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
14538
|
+
this.mergeNewTdData(tbody, contentRows);
|
|
14539
|
+
};
|
|
14540
|
+
VirtualScroll.prototype.mergeNewTdData = function (tbody, contentRows) {
|
|
14541
|
+
var existingRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14542
|
+
existingRows.forEach(function (existingRow, rowIndex) {
|
|
14543
|
+
if (rowIndex < contentRows.length) {
|
|
14544
|
+
var newRow = contentRows[parseInt(rowIndex.toString(), 10)];
|
|
14545
|
+
var existingTds_1 = Array.from(existingRow.querySelectorAll('td'));
|
|
14546
|
+
var newTds = Array.from(newRow.querySelectorAll('td'));
|
|
14547
|
+
newTds.forEach(function (newTd) {
|
|
14548
|
+
var newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
|
|
14549
|
+
var inserted = false;
|
|
14550
|
+
for (var _i = 0, existingTds_2 = existingTds_1; _i < existingTds_2.length; _i++) {
|
|
14551
|
+
var existingTd = existingTds_2[_i];
|
|
14552
|
+
var existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
|
|
14553
|
+
if (newGroupIndex < existingGroupIndex) {
|
|
14554
|
+
existingRow.insertBefore(newTd, existingTd);
|
|
14555
|
+
inserted = true;
|
|
14556
|
+
break;
|
|
14557
|
+
}
|
|
14558
|
+
}
|
|
14559
|
+
if (!inserted) {
|
|
14560
|
+
existingRow.appendChild(newTd);
|
|
14561
|
+
}
|
|
14562
|
+
});
|
|
14563
|
+
}
|
|
14564
|
+
});
|
|
14510
14565
|
};
|
|
14511
14566
|
VirtualScroll.prototype.getBufferCollection = function (startIndex, endIndex) {
|
|
14512
14567
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -17404,6 +17459,37 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17404
17459
|
}
|
|
17405
17460
|
return templateName;
|
|
17406
17461
|
};
|
|
17462
|
+
/**
|
|
17463
|
+
* Method to get element width
|
|
17464
|
+
*
|
|
17465
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
17466
|
+
* @returns {number} Returns the width of the given element
|
|
17467
|
+
* @private
|
|
17468
|
+
*/
|
|
17469
|
+
Schedule.prototype.getElementWidth = function (element) {
|
|
17470
|
+
return getElementWidth(element, this.uiStateValues.isTransformed);
|
|
17471
|
+
};
|
|
17472
|
+
/**
|
|
17473
|
+
* Method to get element height
|
|
17474
|
+
*
|
|
17475
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
17476
|
+
* @returns {number} Returns the Height of the given element
|
|
17477
|
+
* @private
|
|
17478
|
+
*/
|
|
17479
|
+
Schedule.prototype.getElementHeight = function (element) {
|
|
17480
|
+
return getElementHeight(element, this.uiStateValues.isTransformed);
|
|
17481
|
+
};
|
|
17482
|
+
/**
|
|
17483
|
+
* Method to get height from element
|
|
17484
|
+
*
|
|
17485
|
+
* @param {Element} element Accepts the DOM element
|
|
17486
|
+
* @param {string} elementClass Accepts the element class
|
|
17487
|
+
* @returns {number} Returns the height of the element
|
|
17488
|
+
* @private
|
|
17489
|
+
*/
|
|
17490
|
+
Schedule.prototype.getElementHeightFromClass = function (element, elementClass) {
|
|
17491
|
+
return getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
|
|
17492
|
+
};
|
|
17407
17493
|
/**
|
|
17408
17494
|
* Method to render react templates
|
|
17409
17495
|
*
|
|
@@ -17484,6 +17570,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17484
17570
|
this.headerModule = new HeaderRenderer(this);
|
|
17485
17571
|
}
|
|
17486
17572
|
this.renderTableContainer();
|
|
17573
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
17487
17574
|
if (Browser.isDevice || Browser.isTouch) {
|
|
17488
17575
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
17489
17576
|
}
|
|
@@ -17987,7 +18074,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17987
18074
|
this.uiStateValues = {
|
|
17988
18075
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
17989
18076
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
17990
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
18077
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
17991
18078
|
};
|
|
17992
18079
|
}
|
|
17993
18080
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -19380,6 +19467,9 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
19380
19467
|
* @returns {void}
|
|
19381
19468
|
*/
|
|
19382
19469
|
Schedule.prototype.scrollTo = function (hour, scrollDate) {
|
|
19470
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
19471
|
+
return;
|
|
19472
|
+
}
|
|
19383
19473
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
19384
19474
|
this.activeView.scrollToDate(scrollDate);
|
|
19385
19475
|
}
|
|
@@ -20899,8 +20989,8 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
20899
20989
|
};
|
|
20900
20990
|
_this.actionObj.groupIndex = _this.parent.uiStateValues.isGroupAdaptive ? _this.parent.uiStateValues.groupIndex : 0;
|
|
20901
20991
|
var workCell = _this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20902
|
-
_this.actionObj.cellWidth = getElementWidth(workCell);
|
|
20903
|
-
_this.actionObj.cellHeight = getElementHeight(workCell);
|
|
20992
|
+
_this.actionObj.cellWidth = _this.parent.getElementWidth(workCell);
|
|
20993
|
+
_this.actionObj.cellHeight = _this.parent.getElementHeight(workCell);
|
|
20904
20994
|
var hRows = _this.parent.activeViewOptions.headerRows.map(function (row) { return row.option; });
|
|
20905
20995
|
if (_this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
20906
20996
|
var tr = _this.parent.getContentTable().querySelector('tr');
|
|
@@ -21210,10 +21300,10 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21210
21300
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
21211
21301
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21212
21302
|
if (!isLeft) {
|
|
21213
|
-
offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
21303
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
21214
21304
|
}
|
|
21215
|
-
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (getElementWidth(tr) / noOfDays)) :
|
|
21216
|
-
Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
|
|
21305
|
+
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
|
|
21306
|
+
Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
|
|
21217
21307
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
21218
21308
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
21219
21309
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -21222,7 +21312,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21222
21312
|
else {
|
|
21223
21313
|
var cellWidth = this.actionObj.cellWidth;
|
|
21224
21314
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
21225
|
-
Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
21315
|
+
Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
21226
21316
|
if (this.parent.enableRtl) {
|
|
21227
21317
|
var cellOffsetWidth = 0;
|
|
21228
21318
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -21230,7 +21320,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21230
21320
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
21231
21321
|
}
|
|
21232
21322
|
var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
21233
|
-
this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
21323
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
21234
21324
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
21235
21325
|
}
|
|
21236
21326
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -21249,7 +21339,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21249
21339
|
}
|
|
21250
21340
|
else {
|
|
21251
21341
|
if (!isLeft) {
|
|
21252
|
-
offset += getElementWidth(this.actionObj.clone);
|
|
21342
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
21253
21343
|
}
|
|
21254
21344
|
var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
21255
21345
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -21261,9 +21351,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21261
21351
|
}
|
|
21262
21352
|
else {
|
|
21263
21353
|
var cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
21264
|
-
var originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
|
|
21354
|
+
var originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
21265
21355
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21266
|
-
var noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
21356
|
+
var noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
21267
21357
|
this.actionObj.cellWidth);
|
|
21268
21358
|
var tr = closest(this.actionObj.clone, 'tr');
|
|
21269
21359
|
var dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -21326,9 +21416,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21326
21416
|
var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
21327
21417
|
var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
21328
21418
|
var targetWidth = isTimelineView ?
|
|
21329
|
-
(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
21330
|
-
this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
|
|
21331
|
-
Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21419
|
+
(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
21420
|
+
this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
|
|
21421
|
+
Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21332
21422
|
var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
21333
21423
|
var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
21334
21424
|
if (isTimeViews) {
|
|
@@ -21343,7 +21433,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21343
21433
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
21344
21434
|
}
|
|
21345
21435
|
var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
21346
|
-
getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
21436
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
21347
21437
|
if (this.parent.enableRtl) {
|
|
21348
21438
|
var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
21349
21439
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -21357,7 +21447,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21357
21447
|
}
|
|
21358
21448
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
21359
21449
|
styles.right = formatUnit(rightValue);
|
|
21360
|
-
width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
|
|
21450
|
+
width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
|
|
21361
21451
|
}
|
|
21362
21452
|
else {
|
|
21363
21453
|
var offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -21365,12 +21455,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21365
21455
|
if (isTimelineView) {
|
|
21366
21456
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
21367
21457
|
if (this.parent.enableRtl) {
|
|
21368
|
-
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
|
|
21458
|
+
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
|
|
21369
21459
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
21370
21460
|
}
|
|
21371
21461
|
else {
|
|
21372
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
|
|
21373
|
-
getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
21462
|
+
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
|
|
21463
|
+
this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
21374
21464
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
21375
21465
|
}
|
|
21376
21466
|
}
|
|
@@ -21386,10 +21476,10 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21386
21476
|
}
|
|
21387
21477
|
else {
|
|
21388
21478
|
offsetLeft = 0;
|
|
21389
|
-
width = getElementWidth(this.actionObj.clone);
|
|
21479
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
21390
21480
|
}
|
|
21391
21481
|
}
|
|
21392
|
-
var cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
21482
|
+
var cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
21393
21483
|
this.actionObj.cellWidth;
|
|
21394
21484
|
if (isLeft) {
|
|
21395
21485
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -21520,10 +21610,10 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21520
21610
|
YearEvent.prototype.timelineYearViewEvents = function () {
|
|
21521
21611
|
var _this = this;
|
|
21522
21612
|
var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
21523
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21613
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
21524
21614
|
this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
|
|
21525
21615
|
var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
21526
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21616
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21527
21617
|
var selector = "." + MONTH_HEADER_WRAPPER + " tbody tr,." + RESOURCE_COLUMN_TABLE_CLASS + " tbody tr,." + CONTENT_TABLE_CLASS + " tbody tr";
|
|
21528
21618
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
21529
21619
|
var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -21679,10 +21769,10 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21679
21769
|
var contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
21680
21770
|
var isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
|
|
21681
21771
|
var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
21682
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21772
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
21683
21773
|
this.cellHeader = 0;
|
|
21684
21774
|
var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
21685
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21775
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21686
21776
|
var selector = "." + MONTH_HEADER_WRAPPER + " tbody tr,." + RESOURCE_COLUMN_TABLE_CLASS + " tbody tr,." + CONTENT_TABLE_CLASS + " tbody tr";
|
|
21687
21777
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
21688
21778
|
var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -21724,7 +21814,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21724
21814
|
appWrapper.forEach(function (appWrap, cellIndex) {
|
|
21725
21815
|
var td = row.querySelector("td:nth-child(" + (cellIndex + 1) + ")");
|
|
21726
21816
|
var app = [].slice.call(appWrap.children);
|
|
21727
|
-
var width = getElementWidth(td);
|
|
21817
|
+
var width = _this.parent.getElementWidth(td);
|
|
21728
21818
|
var left = td.offsetLeft;
|
|
21729
21819
|
if (_this.parent.enableRtl) {
|
|
21730
21820
|
var right_1 = conTable_1.offsetWidth - left - td.offsetWidth;
|
|
@@ -22099,6 +22189,8 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22099
22189
|
_this.isAllDayTarget = false;
|
|
22100
22190
|
_this.targetTd = null;
|
|
22101
22191
|
_this.isCursorAhead = false;
|
|
22192
|
+
_this.enableCurrentViewDrag = false;
|
|
22193
|
+
_this.isPreventMultiDrag = false;
|
|
22102
22194
|
return _this;
|
|
22103
22195
|
}
|
|
22104
22196
|
DragAndDrop.prototype.wireDragEvent = function (element) {
|
|
@@ -22214,6 +22306,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22214
22306
|
if (cloneBottom > scrollHeight) {
|
|
22215
22307
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
22216
22308
|
}
|
|
22309
|
+
if (this.isPreventMultiDrag) {
|
|
22310
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
22311
|
+
}
|
|
22217
22312
|
}
|
|
22218
22313
|
return { left: leftValue, top: topValue };
|
|
22219
22314
|
};
|
|
@@ -22265,6 +22360,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22265
22360
|
_this.actionObj.interval = dragEventArgs.interval;
|
|
22266
22361
|
_this.actionObj.navigation = dragEventArgs.navigation;
|
|
22267
22362
|
_this.actionObj.scroll = dragEventArgs.scroll;
|
|
22363
|
+
_this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && _this.parent.allowMultiDrag;
|
|
22268
22364
|
_this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
22269
22365
|
var viewElement = _this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
22270
22366
|
_this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -22425,6 +22521,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22425
22521
|
DragAndDrop.prototype.dragStop = function (e) {
|
|
22426
22522
|
var _this = this;
|
|
22427
22523
|
this.isCursorAhead = false;
|
|
22524
|
+
this.isPreventMultiDrag = false;
|
|
22428
22525
|
this.removeCloneElementClasses();
|
|
22429
22526
|
this.removeCloneElement();
|
|
22430
22527
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -22493,7 +22590,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22493
22590
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
22494
22591
|
this.timelineEventModule.getSlotDates();
|
|
22495
22592
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
22496
|
-
getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
22593
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
22497
22594
|
this.calculateTimelineTime(e);
|
|
22498
22595
|
}
|
|
22499
22596
|
else {
|
|
@@ -22670,7 +22767,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22670
22767
|
var dragStart;
|
|
22671
22768
|
var dragEnd;
|
|
22672
22769
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
22673
|
-
this.
|
|
22770
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
22771
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
22772
|
+
}
|
|
22674
22773
|
dragStart = this.parent.getDateFromElement(td);
|
|
22675
22774
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
22676
22775
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -22727,18 +22826,34 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22727
22826
|
this.startTime = eventObj_1[this.parent.eventFields.startTime].getTime();
|
|
22728
22827
|
}
|
|
22729
22828
|
var startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
22730
|
-
|
|
22731
|
-
this.
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
var
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22829
|
+
if (this.enableCurrentViewDrag) {
|
|
22830
|
+
var renderDates = this.getRenderedDates();
|
|
22831
|
+
for (var i = 0; i < this.multiData.length; i++) {
|
|
22832
|
+
var eventObj_2 = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
|
|
22833
|
+
var startTime = new Date(eventObj_2[this.parent.eventFields.startTime].getTime() + startTimeDiff);
|
|
22834
|
+
var dayIndex = this.parent.getIndexOfDate(renderDates, resetTime(startTime));
|
|
22835
|
+
if (dayIndex < 0) {
|
|
22836
|
+
this.isPreventMultiDrag = true;
|
|
22837
|
+
break;
|
|
22838
|
+
}
|
|
22839
|
+
this.isPreventMultiDrag = false;
|
|
22840
|
+
}
|
|
22841
|
+
}
|
|
22842
|
+
if (!this.isPreventMultiDrag) {
|
|
22843
|
+
for (var index_2 = 0; index_2 < this.multiData.length; index_2++) {
|
|
22844
|
+
this.updatedData[parseInt(index_2.toString(), 10)] =
|
|
22845
|
+
this.updateMultipleData(this.multiData[parseInt(index_2.toString(), 10)], startTimeDiff);
|
|
22846
|
+
var dayIndex = this.getDayIndex(this.updatedData[parseInt(index_2.toString(), 10)]);
|
|
22847
|
+
if (dayIndex >= 0) {
|
|
22848
|
+
var isAllDay = this.updatedData[parseInt(index_2.toString(), 10)][this.parent.eventFields.isAllDay];
|
|
22849
|
+
var wrapper = this.getEventWrapper(dayIndex, isAllDay);
|
|
22850
|
+
this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
22851
|
+
this.updateEventHeight(this.updatedData[parseInt(index_2.toString(), 10)], index_2, dayIndex);
|
|
22852
|
+
}
|
|
22853
|
+
else {
|
|
22854
|
+
if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)].parentNode)) {
|
|
22855
|
+
remove(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
22856
|
+
}
|
|
22742
22857
|
}
|
|
22743
22858
|
}
|
|
22744
22859
|
}
|
|
@@ -22956,6 +23071,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22956
23071
|
};
|
|
22957
23072
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22958
23073
|
DragAndDrop.prototype.swapDragging = function (e) {
|
|
23074
|
+
if (this.isPreventMultiDrag) {
|
|
23075
|
+
return;
|
|
23076
|
+
}
|
|
22959
23077
|
var colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
22960
23078
|
if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
|
|
22961
23079
|
!closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -23312,7 +23430,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23312
23430
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
23313
23431
|
var rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
23314
23432
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
23315
|
-
getElementTop(dragArea)) / rowHeight);
|
|
23433
|
+
getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
23316
23434
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
23317
23435
|
this.actionObj.index = rowIndex;
|
|
23318
23436
|
var eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -23328,7 +23446,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23328
23446
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
23329
23447
|
return;
|
|
23330
23448
|
}
|
|
23331
|
-
var top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
23449
|
+
var top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
23332
23450
|
if (this.parent.rowAutoHeight) {
|
|
23333
23451
|
var cursorElement = this.getCursorElement(e);
|
|
23334
23452
|
if (cursorElement) {
|
|
@@ -23893,7 +24011,7 @@ var ViewBase = /** @__PURE__ @class */ (function () {
|
|
|
23893
24011
|
if (this.isTimelineView()) {
|
|
23894
24012
|
var colElements = this.getColElements();
|
|
23895
24013
|
var contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
23896
|
-
var colWidth_1 = (getElementWidth(contentBody) / (colElements.length / 2));
|
|
24014
|
+
var colWidth_1 = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
|
|
23897
24015
|
if (content.offsetHeight !== content.clientHeight) {
|
|
23898
24016
|
var resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
23899
24017
|
if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
|
|
@@ -24275,11 +24393,8 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24275
24393
|
var currentDate = this.parent.getCurrentTime();
|
|
24276
24394
|
if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
|
|
24277
24395
|
var currentDateIndex = this.getCurrentTimeIndicatorIndex();
|
|
24278
|
-
if (currentDateIndex.length > 0) {
|
|
24279
|
-
|
|
24280
|
-
if (workCells.length > 0) {
|
|
24281
|
-
this.changeCurrentTimePosition();
|
|
24282
|
-
}
|
|
24396
|
+
if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
|
|
24397
|
+
this.changeCurrentTimePosition();
|
|
24283
24398
|
if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
|
|
24284
24399
|
var interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
|
|
24285
24400
|
if (interval <= (MS_PER_MINUTE - 1000)) {
|
|
@@ -24404,7 +24519,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24404
24519
|
this.parent.activeViewOptions.timeScale.interval;
|
|
24405
24520
|
};
|
|
24406
24521
|
VerticalView.prototype.getWorkCellHeight = function () {
|
|
24407
|
-
return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
24522
|
+
return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
24408
24523
|
};
|
|
24409
24524
|
VerticalView.prototype.getTdContent = function (date, type, groupIndex) {
|
|
24410
24525
|
var cntEle;
|
|
@@ -24707,12 +24822,25 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24707
24822
|
var rows = [];
|
|
24708
24823
|
var tr = createElement('tr');
|
|
24709
24824
|
var td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24825
|
+
var existingGroupIndices = new Set();
|
|
24826
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
|
|
24827
|
+
this.parent.virtualScrollModule.existingDataCollection.length > 0) {
|
|
24828
|
+
existingGroupIndices = new Set(this.parent.virtualScrollModule.existingDataCollection.map(function (data) { return data.groupIndex; }));
|
|
24829
|
+
}
|
|
24710
24830
|
var handler = function (r) {
|
|
24711
24831
|
var ntr = tr.cloneNode();
|
|
24712
24832
|
for (var _i = 0, _a = _this.colLevels[_this.colLevels.length - 1]; _i < _a.length; _i++) {
|
|
24713
24833
|
var tdData = _a[_i];
|
|
24714
|
-
var
|
|
24715
|
-
|
|
24834
|
+
var isAllowTdCreation = true;
|
|
24835
|
+
if (_this.parent.virtualScrollModule && _this.parent.activeViewOptions.group.resources.length > 0) {
|
|
24836
|
+
if (existingGroupIndices.has(tdData.groupIndex)) {
|
|
24837
|
+
isAllowTdCreation = false;
|
|
24838
|
+
}
|
|
24839
|
+
}
|
|
24840
|
+
if (isAllowTdCreation) {
|
|
24841
|
+
var ntd = _this.createContentTd(tdData, r, td);
|
|
24842
|
+
ntr.appendChild(ntd);
|
|
24843
|
+
}
|
|
24716
24844
|
}
|
|
24717
24845
|
rows.push(ntr);
|
|
24718
24846
|
return r;
|
|
@@ -27461,7 +27589,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27461
27589
|
}
|
|
27462
27590
|
var scrollLeft;
|
|
27463
27591
|
if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
|
|
27464
|
-
scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27592
|
+
scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27465
27593
|
}
|
|
27466
27594
|
else {
|
|
27467
27595
|
scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
|
|
@@ -27548,7 +27676,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27548
27676
|
if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
|
|
27549
27677
|
this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
|
|
27550
27678
|
diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
|
|
27551
|
-
getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27679
|
+
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27552
27680
|
}
|
|
27553
27681
|
else {
|
|
27554
27682
|
var endHour = this.getEndHour();
|
|
@@ -27558,8 +27686,8 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27558
27686
|
}
|
|
27559
27687
|
}
|
|
27560
27688
|
}
|
|
27561
|
-
return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
27562
|
-
this.parent.activeViewOptions.timeScale.interval);
|
|
27689
|
+
return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
27690
|
+
* this.parent.activeViewOptions.timeScale.slotCount) / this.parent.activeViewOptions.timeScale.interval);
|
|
27563
27691
|
};
|
|
27564
27692
|
TimelineViews.prototype.renderHeader = function () {
|
|
27565
27693
|
var tr = createElement('tr');
|