@syncfusion/ej2-schedule 26.1.40 → 26.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +257 -120
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +258 -120
- 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/hotfix/26.1.35_Vol2.txt +1 -0
- package/package.json +15 -15
- package/src/recurrence-editor/date-generator.js +3 -0
- package/src/schedule/actions/drag.d.ts +2 -0
- package/src/schedule/actions/drag.js +45 -17
- 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/popups/event-window.d.ts +1 -0
- package/src/schedule/popups/event-window.js +13 -10
- package/src/schedule/renderer/timeline-view.js +4 -4
- package/src/schedule/renderer/vertical-view.js +23 -9
- package/src/schedule/renderer/view-base.js +1 -1
- package/styles/fluent2.css +11 -11
- package/styles/recurrence-editor/fluent2.css +10 -10
- package/styles/schedule/fluent2.css +11 -11
|
@@ -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
|
}
|
|
@@ -4167,6 +4173,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
4167
4173
|
}
|
|
4168
4174
|
else {
|
|
4169
4175
|
tempDate = getStartDateForWeek(startDate, ruleObject.day);
|
|
4176
|
+
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < startDate.getDay()) {
|
|
4177
|
+
tempDate.setDate(tempDate.getDate() + ((interval - 1) * 7));
|
|
4178
|
+
}
|
|
4170
4179
|
while (compareDates(tempDate, endDate)) {
|
|
4171
4180
|
weekState = validateRules(tempDate, ruleObject);
|
|
4172
4181
|
if (weekState && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1)) {
|
|
@@ -6992,7 +7001,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
6992
7001
|
this.resources = this.parent.resourceBase.renderedResources;
|
|
6993
7002
|
}
|
|
6994
7003
|
this.cellHeight =
|
|
6995
|
-
parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
7004
|
+
parseFloat(this.parent.getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6996
7005
|
this.dateRender[0] = this.parent.activeView.renderDates;
|
|
6997
7006
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
6998
7007
|
for (var i = 0, len = this.resources.length; i < len; i++) {
|
|
@@ -7078,7 +7087,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7078
7087
|
var resources = this.getResourceList();
|
|
7079
7088
|
var dateCount = this.getStartCount();
|
|
7080
7089
|
var isRender;
|
|
7081
|
-
var appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
7090
|
+
var appHeight = eventType === 'allDayEvents' ? this.parent.getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
7082
7091
|
var allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
|
|
7083
7092
|
var _loop_1 = function (resource) {
|
|
7084
7093
|
isRender = true;
|
|
@@ -7833,7 +7842,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7833
7842
|
this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
|
|
7834
7843
|
cellTd.removeChild(wrapper);
|
|
7835
7844
|
}
|
|
7836
|
-
this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7845
|
+
this.eventHeight = this.parent.getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7837
7846
|
var selector = '.' + CONTENT_TABLE_CLASS + ' tbody tr';
|
|
7838
7847
|
this.addCellHeight(selector, this.eventHeight, (this.parent.currentView === 'Month' ? EVENT_GAP : 2), this.monthHeaderHeight, this.moreIndicatorHeight);
|
|
7839
7848
|
var scrollTop = conWrap.scrollTop;
|
|
@@ -7912,8 +7921,8 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
7912
7921
|
});
|
|
7913
7922
|
}
|
|
7914
7923
|
var cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
|
|
7915
|
-
this.cellWidth = getElementWidth(cellDetail);
|
|
7916
|
-
this.cellHeight = getElementHeight(cellDetail);
|
|
7924
|
+
this.cellWidth = this.parent.getElementWidth(cellDetail);
|
|
7925
|
+
this.cellHeight = this.parent.getElementHeight(cellDetail);
|
|
7917
7926
|
this.dateRender = dateRender;
|
|
7918
7927
|
var filteredDates = this.getRenderedDates(dateRender);
|
|
7919
7928
|
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
@@ -8494,7 +8503,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8494
8503
|
this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
|
|
8495
8504
|
this.renderType = 'day';
|
|
8496
8505
|
var workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
|
|
8497
|
-
this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8506
|
+
this.cellWidth = this.parent.getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8498
8507
|
this.slotsPerDay = 1;
|
|
8499
8508
|
}
|
|
8500
8509
|
else {
|
|
@@ -8664,14 +8673,14 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8664
8673
|
this.wireAppointmentEvents(appointmentElement, event);
|
|
8665
8674
|
if (this.parent.rowAutoHeight) {
|
|
8666
8675
|
var conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
8667
|
-
var conWidth = getElementWidth(conWrap);
|
|
8676
|
+
var conWidth = this.parent.getElementWidth(conWrap);
|
|
8668
8677
|
var isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
|
|
8669
8678
|
conWrap.offsetWidth === conWrap.clientWidth;
|
|
8670
8679
|
this.renderEventElement(event, appointmentElement, cellTd);
|
|
8671
8680
|
var firstChild = this.getFirstChild(resIndex);
|
|
8672
8681
|
this.updateCellHeight(firstChild, height);
|
|
8673
8682
|
if (isWithoutScroll &&
|
|
8674
|
-
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
|
|
8683
|
+
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
|
|
8675
8684
|
this.adjustAppointments(conWidth);
|
|
8676
8685
|
}
|
|
8677
8686
|
}
|
|
@@ -8790,7 +8799,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
8790
8799
|
TimelineEvent.prototype.adjustAppointments = function (conWidth) {
|
|
8791
8800
|
var _this = this;
|
|
8792
8801
|
var tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8793
|
-
var actualCellWidth = getElementWidth(this.workCells[0]);
|
|
8802
|
+
var actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8794
8803
|
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8795
8804
|
var currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8796
8805
|
var apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
@@ -9154,11 +9163,11 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9154
9163
|
var allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
|
|
9155
9164
|
var allDayLevel = 0;
|
|
9156
9165
|
if (allDayElements.length > 0) {
|
|
9157
|
-
allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
9166
|
+
allDayLevel = Math.floor(this.parent.getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
9158
9167
|
allDayElements[0].offsetHeight) - 1;
|
|
9159
9168
|
}
|
|
9160
9169
|
verticalEvent.allDayLevel = allDayLevel;
|
|
9161
|
-
var appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
9170
|
+
var appHeight = this.parent.getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
9162
9171
|
var cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
|
|
9163
9172
|
verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
|
|
9164
9173
|
}
|
|
@@ -9186,7 +9195,7 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9186
9195
|
monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
|
|
9187
9196
|
monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
|
|
9188
9197
|
monthEvent.eventHeight =
|
|
9189
|
-
getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
9198
|
+
this.parent.getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
9190
9199
|
monthEvent.getSlotDates(workDays);
|
|
9191
9200
|
var filteredDates = monthEvent.getRenderedDates(renderDates);
|
|
9192
9201
|
var spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
|
|
@@ -9210,7 +9219,7 @@ var InlineEdit = /** @__PURE__ @class */ (function () {
|
|
|
9210
9219
|
var dayLength = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?
|
|
9211
9220
|
0 : this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;
|
|
9212
9221
|
timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
|
|
9213
|
-
timelineView.eventHeight = getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9222
|
+
timelineView.eventHeight = this.parent.getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9214
9223
|
timelineView.renderEvents(saveObject, resIndex);
|
|
9215
9224
|
};
|
|
9216
9225
|
InlineEdit.prototype.getEventDaysCount = function (saveObj) {
|
|
@@ -12260,8 +12269,13 @@ var EventWindow = /** @__PURE__ @class */ (function () {
|
|
|
12260
12269
|
this.addEventHandlers();
|
|
12261
12270
|
}
|
|
12262
12271
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
12263
|
-
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);
|
|
12272
|
+
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data, type, repeatType);
|
|
12273
|
+
}
|
|
12274
|
+
else {
|
|
12275
|
+
this.setEditorContent(data, type, repeatType);
|
|
12264
12276
|
}
|
|
12277
|
+
};
|
|
12278
|
+
EventWindow.prototype.setEditorContent = function (data, type, repeatType) {
|
|
12265
12279
|
if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {
|
|
12266
12280
|
removeClass([this.dialogObject.element.querySelector('.e-recurrenceeditor')], DISABLE_CLASS);
|
|
12267
12281
|
}
|
|
@@ -12442,7 +12456,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
|
|
|
12442
12456
|
container.appendChild(form);
|
|
12443
12457
|
return container;
|
|
12444
12458
|
};
|
|
12445
|
-
EventWindow.prototype.renderFormElements = function (form, args) {
|
|
12459
|
+
EventWindow.prototype.renderFormElements = function (form, args, type, repeatType) {
|
|
12446
12460
|
var _this = this;
|
|
12447
12461
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
12448
12462
|
if (args) {
|
|
@@ -12471,15 +12485,17 @@ var EventWindow = /** @__PURE__ @class */ (function () {
|
|
|
12471
12485
|
this.parent.renderTemplates(function () {
|
|
12472
12486
|
if (_this.element) {
|
|
12473
12487
|
_this.applyFormValidation();
|
|
12474
|
-
if (
|
|
12475
|
-
_this.
|
|
12476
|
-
_this.eventCrudData = null;
|
|
12488
|
+
if (args) {
|
|
12489
|
+
_this.setEditorContent(args, type, repeatType);
|
|
12477
12490
|
}
|
|
12478
12491
|
}
|
|
12479
12492
|
});
|
|
12480
12493
|
}
|
|
12481
12494
|
else {
|
|
12482
12495
|
form.appendChild(this.getDefaultEventWindowContent());
|
|
12496
|
+
if (args) {
|
|
12497
|
+
this.setEditorContent(args, type, repeatType);
|
|
12498
|
+
}
|
|
12483
12499
|
}
|
|
12484
12500
|
};
|
|
12485
12501
|
EventWindow.prototype.getDefaultEventWindowContent = function () {
|
|
@@ -13078,13 +13094,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
|
|
|
13078
13094
|
this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
|
|
13079
13095
|
};
|
|
13080
13096
|
EventWindow.prototype.showDetails = function (eventData) {
|
|
13081
|
-
this.eventData =
|
|
13097
|
+
this.eventData = eventData;
|
|
13082
13098
|
var eventObj = extend({}, eventData, null, true);
|
|
13083
13099
|
var formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
|
|
13084
|
-
if (this.parent.isReact && formElements.length < 1 && !this.cellClickAction) {
|
|
13085
|
-
this.eventCrudData = eventObj;
|
|
13086
|
-
return;
|
|
13087
|
-
}
|
|
13088
13100
|
if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
|
|
13089
13101
|
eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
|
|
13090
13102
|
this.trimAllDay(eventObj);
|
|
@@ -14111,6 +14123,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14111
14123
|
this.renderedLength = 0;
|
|
14112
14124
|
this.averageRowHeight = 0;
|
|
14113
14125
|
this.startIndex = 0;
|
|
14126
|
+
this.existingDataCollection = [];
|
|
14114
14127
|
this.parent = parent;
|
|
14115
14128
|
this.addEventListener();
|
|
14116
14129
|
}
|
|
@@ -14183,10 +14196,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14183
14196
|
};
|
|
14184
14197
|
VirtualScroll.prototype.setItemSize = function () {
|
|
14185
14198
|
if (this.isHorizontalScroll) {
|
|
14186
|
-
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14199
|
+
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
|
|
14187
14200
|
}
|
|
14188
14201
|
else {
|
|
14189
|
-
this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14202
|
+
this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
14190
14203
|
}
|
|
14191
14204
|
};
|
|
14192
14205
|
VirtualScroll.prototype.refreshLayout = function () {
|
|
@@ -14470,43 +14483,91 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
14470
14483
|
append(eventRows, eventWrap);
|
|
14471
14484
|
};
|
|
14472
14485
|
VirtualScroll.prototype.updateHorizontalContent = function (conWrap, resCollection) {
|
|
14486
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
14473
14487
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
14474
14488
|
var selectedEle = this.parent.getSelectedCells();
|
|
14475
14489
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
14476
|
-
var
|
|
14490
|
+
var tbody = conWrap.querySelector('tbody');
|
|
14491
|
+
var renderedRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14492
|
+
if (this.parent.currentView === 'Month') {
|
|
14493
|
+
this.updateMonthViewContent(conWrap, resCollection);
|
|
14494
|
+
}
|
|
14495
|
+
else {
|
|
14496
|
+
this.updateOtherViewContent(conWrap, resCollection, renderedRows);
|
|
14497
|
+
}
|
|
14498
|
+
};
|
|
14499
|
+
VirtualScroll.prototype.updateMonthViewContent = function (conWrap, resCollection) {
|
|
14500
|
+
var renderedLength = conWrap.querySelectorAll(' tr').length;
|
|
14477
14501
|
for (var i = 0; i < renderedLength; i++) {
|
|
14478
14502
|
remove(conWrap.querySelector('tbody tr'));
|
|
14479
14503
|
}
|
|
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'));
|
|
14504
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
14505
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
14489
14506
|
}
|
|
14490
14507
|
else {
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14508
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14509
|
+
}
|
|
14510
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
14511
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
14512
|
+
};
|
|
14513
|
+
VirtualScroll.prototype.updateOtherViewContent = function (conWrap, resCollection, renderedRows) {
|
|
14514
|
+
var tbody = conWrap.querySelector('tbody');
|
|
14515
|
+
var colGroup = conWrap.querySelector('colgroup');
|
|
14516
|
+
var thead = conWrap.querySelector('thead');
|
|
14517
|
+
var table = conWrap.querySelector('table');
|
|
14518
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
14519
|
+
var newGroupIndices = new Set(resCollection.map(function (data) { return data.groupIndex; }));
|
|
14520
|
+
renderedRows.forEach(function (row) {
|
|
14521
|
+
var tdElements = row.querySelectorAll('td');
|
|
14522
|
+
tdElements.forEach(function (td) {
|
|
14523
|
+
var groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
14524
|
+
if (!newGroupIndices.has(groupIndex)) {
|
|
14525
|
+
td.remove();
|
|
14526
|
+
}
|
|
14502
14527
|
});
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14528
|
+
});
|
|
14529
|
+
var col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
14530
|
+
for (var i = 0; i < col.length; i++) {
|
|
14531
|
+
remove(col[parseInt(i.toString(), 10)]);
|
|
14532
|
+
}
|
|
14533
|
+
resCollection.forEach(function () { return colGroup.appendChild(createElement('col')); });
|
|
14534
|
+
var tHead = [].slice.call(conWrap.querySelector('thead').children);
|
|
14535
|
+
for (var i = 0; i < tHead.length; i++) {
|
|
14536
|
+
remove(tHead[parseInt(i.toString(), 10)]);
|
|
14509
14537
|
}
|
|
14538
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
14539
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
14540
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
14541
|
+
}
|
|
14542
|
+
prepend([thead], table);
|
|
14543
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
14544
|
+
this.mergeNewTdData(tbody, contentRows);
|
|
14545
|
+
};
|
|
14546
|
+
VirtualScroll.prototype.mergeNewTdData = function (tbody, contentRows) {
|
|
14547
|
+
var existingRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14548
|
+
existingRows.forEach(function (existingRow, rowIndex) {
|
|
14549
|
+
if (rowIndex < contentRows.length) {
|
|
14550
|
+
var newRow = contentRows[parseInt(rowIndex.toString(), 10)];
|
|
14551
|
+
var existingTds_1 = Array.from(existingRow.querySelectorAll('td'));
|
|
14552
|
+
var newTds = Array.from(newRow.querySelectorAll('td'));
|
|
14553
|
+
newTds.forEach(function (newTd) {
|
|
14554
|
+
var newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
|
|
14555
|
+
var inserted = false;
|
|
14556
|
+
for (var _i = 0, existingTds_2 = existingTds_1; _i < existingTds_2.length; _i++) {
|
|
14557
|
+
var existingTd = existingTds_2[_i];
|
|
14558
|
+
var existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
|
|
14559
|
+
if (newGroupIndex < existingGroupIndex) {
|
|
14560
|
+
existingRow.insertBefore(newTd, existingTd);
|
|
14561
|
+
inserted = true;
|
|
14562
|
+
break;
|
|
14563
|
+
}
|
|
14564
|
+
}
|
|
14565
|
+
if (!inserted) {
|
|
14566
|
+
existingRow.appendChild(newTd);
|
|
14567
|
+
}
|
|
14568
|
+
});
|
|
14569
|
+
}
|
|
14570
|
+
});
|
|
14510
14571
|
};
|
|
14511
14572
|
VirtualScroll.prototype.getBufferCollection = function (startIndex, endIndex) {
|
|
14512
14573
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -17404,6 +17465,37 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17404
17465
|
}
|
|
17405
17466
|
return templateName;
|
|
17406
17467
|
};
|
|
17468
|
+
/**
|
|
17469
|
+
* Method to get element width
|
|
17470
|
+
*
|
|
17471
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
17472
|
+
* @returns {number} Returns the width of the given element
|
|
17473
|
+
* @private
|
|
17474
|
+
*/
|
|
17475
|
+
Schedule.prototype.getElementWidth = function (element) {
|
|
17476
|
+
return getElementWidth(element, this.uiStateValues.isTransformed);
|
|
17477
|
+
};
|
|
17478
|
+
/**
|
|
17479
|
+
* Method to get element height
|
|
17480
|
+
*
|
|
17481
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
17482
|
+
* @returns {number} Returns the Height of the given element
|
|
17483
|
+
* @private
|
|
17484
|
+
*/
|
|
17485
|
+
Schedule.prototype.getElementHeight = function (element) {
|
|
17486
|
+
return getElementHeight(element, this.uiStateValues.isTransformed);
|
|
17487
|
+
};
|
|
17488
|
+
/**
|
|
17489
|
+
* Method to get height from element
|
|
17490
|
+
*
|
|
17491
|
+
* @param {Element} element Accepts the DOM element
|
|
17492
|
+
* @param {string} elementClass Accepts the element class
|
|
17493
|
+
* @returns {number} Returns the height of the element
|
|
17494
|
+
* @private
|
|
17495
|
+
*/
|
|
17496
|
+
Schedule.prototype.getElementHeightFromClass = function (element, elementClass) {
|
|
17497
|
+
return getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
|
|
17498
|
+
};
|
|
17407
17499
|
/**
|
|
17408
17500
|
* Method to render react templates
|
|
17409
17501
|
*
|
|
@@ -17484,6 +17576,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17484
17576
|
this.headerModule = new HeaderRenderer(this);
|
|
17485
17577
|
}
|
|
17486
17578
|
this.renderTableContainer();
|
|
17579
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
17487
17580
|
if (Browser.isDevice || Browser.isTouch) {
|
|
17488
17581
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
17489
17582
|
}
|
|
@@ -17987,7 +18080,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
17987
18080
|
this.uiStateValues = {
|
|
17988
18081
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
17989
18082
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
17990
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
18083
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
17991
18084
|
};
|
|
17992
18085
|
}
|
|
17993
18086
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -19380,6 +19473,9 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
|
|
|
19380
19473
|
* @returns {void}
|
|
19381
19474
|
*/
|
|
19382
19475
|
Schedule.prototype.scrollTo = function (hour, scrollDate) {
|
|
19476
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
19477
|
+
return;
|
|
19478
|
+
}
|
|
19383
19479
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
19384
19480
|
this.activeView.scrollToDate(scrollDate);
|
|
19385
19481
|
}
|
|
@@ -20899,8 +20995,8 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
20899
20995
|
};
|
|
20900
20996
|
_this.actionObj.groupIndex = _this.parent.uiStateValues.isGroupAdaptive ? _this.parent.uiStateValues.groupIndex : 0;
|
|
20901
20997
|
var workCell = _this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20902
|
-
_this.actionObj.cellWidth = getElementWidth(workCell);
|
|
20903
|
-
_this.actionObj.cellHeight = getElementHeight(workCell);
|
|
20998
|
+
_this.actionObj.cellWidth = _this.parent.getElementWidth(workCell);
|
|
20999
|
+
_this.actionObj.cellHeight = _this.parent.getElementHeight(workCell);
|
|
20904
21000
|
var hRows = _this.parent.activeViewOptions.headerRows.map(function (row) { return row.option; });
|
|
20905
21001
|
if (_this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
20906
21002
|
var tr = _this.parent.getContentTable().querySelector('tr');
|
|
@@ -21210,10 +21306,10 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21210
21306
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
21211
21307
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21212
21308
|
if (!isLeft) {
|
|
21213
|
-
offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
21309
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
21214
21310
|
}
|
|
21215
|
-
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (getElementWidth(tr) / noOfDays)) :
|
|
21216
|
-
Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
|
|
21311
|
+
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
|
|
21312
|
+
Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
|
|
21217
21313
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
21218
21314
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
21219
21315
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -21222,7 +21318,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21222
21318
|
else {
|
|
21223
21319
|
var cellWidth = this.actionObj.cellWidth;
|
|
21224
21320
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
21225
|
-
Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
21321
|
+
Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
21226
21322
|
if (this.parent.enableRtl) {
|
|
21227
21323
|
var cellOffsetWidth = 0;
|
|
21228
21324
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -21230,7 +21326,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21230
21326
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
21231
21327
|
}
|
|
21232
21328
|
var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
21233
|
-
this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
21329
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
21234
21330
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
21235
21331
|
}
|
|
21236
21332
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -21249,7 +21345,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21249
21345
|
}
|
|
21250
21346
|
else {
|
|
21251
21347
|
if (!isLeft) {
|
|
21252
|
-
offset += getElementWidth(this.actionObj.clone);
|
|
21348
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
21253
21349
|
}
|
|
21254
21350
|
var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
21255
21351
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -21261,9 +21357,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21261
21357
|
}
|
|
21262
21358
|
else {
|
|
21263
21359
|
var cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
21264
|
-
var originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
|
|
21360
|
+
var originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
21265
21361
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21266
|
-
var noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
21362
|
+
var noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
21267
21363
|
this.actionObj.cellWidth);
|
|
21268
21364
|
var tr = closest(this.actionObj.clone, 'tr');
|
|
21269
21365
|
var dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -21326,9 +21422,9 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21326
21422
|
var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
21327
21423
|
var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
21328
21424
|
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;
|
|
21425
|
+
(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
21426
|
+
this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
|
|
21427
|
+
Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
21332
21428
|
var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
21333
21429
|
var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
21334
21430
|
if (isTimeViews) {
|
|
@@ -21343,7 +21439,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21343
21439
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
21344
21440
|
}
|
|
21345
21441
|
var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
21346
|
-
getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
21442
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
21347
21443
|
if (this.parent.enableRtl) {
|
|
21348
21444
|
var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
21349
21445
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -21357,7 +21453,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21357
21453
|
}
|
|
21358
21454
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
21359
21455
|
styles.right = formatUnit(rightValue);
|
|
21360
|
-
width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
|
|
21456
|
+
width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
|
|
21361
21457
|
}
|
|
21362
21458
|
else {
|
|
21363
21459
|
var offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -21365,12 +21461,12 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21365
21461
|
if (isTimelineView) {
|
|
21366
21462
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
21367
21463
|
if (this.parent.enableRtl) {
|
|
21368
|
-
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
|
|
21464
|
+
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
|
|
21369
21465
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
21370
21466
|
}
|
|
21371
21467
|
else {
|
|
21372
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
|
|
21373
|
-
getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
21468
|
+
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
|
|
21469
|
+
this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
21374
21470
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
21375
21471
|
}
|
|
21376
21472
|
}
|
|
@@ -21386,10 +21482,10 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
|
|
|
21386
21482
|
}
|
|
21387
21483
|
else {
|
|
21388
21484
|
offsetLeft = 0;
|
|
21389
|
-
width = getElementWidth(this.actionObj.clone);
|
|
21485
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
21390
21486
|
}
|
|
21391
21487
|
}
|
|
21392
|
-
var cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
21488
|
+
var cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
21393
21489
|
this.actionObj.cellWidth;
|
|
21394
21490
|
if (isLeft) {
|
|
21395
21491
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -21520,10 +21616,10 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21520
21616
|
YearEvent.prototype.timelineYearViewEvents = function () {
|
|
21521
21617
|
var _this = this;
|
|
21522
21618
|
var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
21523
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21619
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
21524
21620
|
this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
|
|
21525
21621
|
var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
21526
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21622
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21527
21623
|
var selector = "." + MONTH_HEADER_WRAPPER + " tbody tr,." + RESOURCE_COLUMN_TABLE_CLASS + " tbody tr,." + CONTENT_TABLE_CLASS + " tbody tr";
|
|
21528
21624
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
21529
21625
|
var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -21679,10 +21775,10 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21679
21775
|
var contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
21680
21776
|
var isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
|
|
21681
21777
|
var workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
21682
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21778
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
21683
21779
|
this.cellHeader = 0;
|
|
21684
21780
|
var eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
21685
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21781
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21686
21782
|
var selector = "." + MONTH_HEADER_WRAPPER + " tbody tr,." + RESOURCE_COLUMN_TABLE_CLASS + " tbody tr,." + CONTENT_TABLE_CLASS + " tbody tr";
|
|
21687
21783
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
21688
21784
|
var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -21724,7 +21820,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
|
|
|
21724
21820
|
appWrapper.forEach(function (appWrap, cellIndex) {
|
|
21725
21821
|
var td = row.querySelector("td:nth-child(" + (cellIndex + 1) + ")");
|
|
21726
21822
|
var app = [].slice.call(appWrap.children);
|
|
21727
|
-
var width = getElementWidth(td);
|
|
21823
|
+
var width = _this.parent.getElementWidth(td);
|
|
21728
21824
|
var left = td.offsetLeft;
|
|
21729
21825
|
if (_this.parent.enableRtl) {
|
|
21730
21826
|
var right_1 = conTable_1.offsetWidth - left - td.offsetWidth;
|
|
@@ -22099,6 +22195,8 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22099
22195
|
_this.isAllDayTarget = false;
|
|
22100
22196
|
_this.targetTd = null;
|
|
22101
22197
|
_this.isCursorAhead = false;
|
|
22198
|
+
_this.enableCurrentViewDrag = false;
|
|
22199
|
+
_this.isPreventMultiDrag = false;
|
|
22102
22200
|
return _this;
|
|
22103
22201
|
}
|
|
22104
22202
|
DragAndDrop.prototype.wireDragEvent = function (element) {
|
|
@@ -22214,6 +22312,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22214
22312
|
if (cloneBottom > scrollHeight) {
|
|
22215
22313
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
22216
22314
|
}
|
|
22315
|
+
if (this.isPreventMultiDrag) {
|
|
22316
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
22317
|
+
}
|
|
22217
22318
|
}
|
|
22218
22319
|
return { left: leftValue, top: topValue };
|
|
22219
22320
|
};
|
|
@@ -22265,6 +22366,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22265
22366
|
_this.actionObj.interval = dragEventArgs.interval;
|
|
22266
22367
|
_this.actionObj.navigation = dragEventArgs.navigation;
|
|
22267
22368
|
_this.actionObj.scroll = dragEventArgs.scroll;
|
|
22369
|
+
_this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && _this.parent.allowMultiDrag;
|
|
22268
22370
|
_this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
22269
22371
|
var viewElement = _this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
22270
22372
|
_this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -22425,6 +22527,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22425
22527
|
DragAndDrop.prototype.dragStop = function (e) {
|
|
22426
22528
|
var _this = this;
|
|
22427
22529
|
this.isCursorAhead = false;
|
|
22530
|
+
this.isPreventMultiDrag = false;
|
|
22428
22531
|
this.removeCloneElementClasses();
|
|
22429
22532
|
this.removeCloneElement();
|
|
22430
22533
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -22493,7 +22596,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22493
22596
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
22494
22597
|
this.timelineEventModule.getSlotDates();
|
|
22495
22598
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
22496
|
-
getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
22599
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
22497
22600
|
this.calculateTimelineTime(e);
|
|
22498
22601
|
}
|
|
22499
22602
|
else {
|
|
@@ -22670,7 +22773,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22670
22773
|
var dragStart;
|
|
22671
22774
|
var dragEnd;
|
|
22672
22775
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
22673
|
-
this.
|
|
22776
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
22777
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
22778
|
+
}
|
|
22674
22779
|
dragStart = this.parent.getDateFromElement(td);
|
|
22675
22780
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
22676
22781
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -22727,18 +22832,34 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22727
22832
|
this.startTime = eventObj_1[this.parent.eventFields.startTime].getTime();
|
|
22728
22833
|
}
|
|
22729
22834
|
var startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
22730
|
-
|
|
22731
|
-
this.
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
var
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
|
|
22741
|
-
|
|
22835
|
+
if (this.enableCurrentViewDrag) {
|
|
22836
|
+
var renderDates = this.getRenderedDates();
|
|
22837
|
+
for (var i = 0; i < this.multiData.length; i++) {
|
|
22838
|
+
var eventObj_2 = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
|
|
22839
|
+
var startTime = new Date(eventObj_2[this.parent.eventFields.startTime].getTime() + startTimeDiff);
|
|
22840
|
+
var dayIndex = this.parent.getIndexOfDate(renderDates, resetTime(startTime));
|
|
22841
|
+
if (dayIndex < 0) {
|
|
22842
|
+
this.isPreventMultiDrag = true;
|
|
22843
|
+
break;
|
|
22844
|
+
}
|
|
22845
|
+
this.isPreventMultiDrag = false;
|
|
22846
|
+
}
|
|
22847
|
+
}
|
|
22848
|
+
if (!this.isPreventMultiDrag) {
|
|
22849
|
+
for (var index_2 = 0; index_2 < this.multiData.length; index_2++) {
|
|
22850
|
+
this.updatedData[parseInt(index_2.toString(), 10)] =
|
|
22851
|
+
this.updateMultipleData(this.multiData[parseInt(index_2.toString(), 10)], startTimeDiff);
|
|
22852
|
+
var dayIndex = this.getDayIndex(this.updatedData[parseInt(index_2.toString(), 10)]);
|
|
22853
|
+
if (dayIndex >= 0) {
|
|
22854
|
+
var isAllDay = this.updatedData[parseInt(index_2.toString(), 10)][this.parent.eventFields.isAllDay];
|
|
22855
|
+
var wrapper = this.getEventWrapper(dayIndex, isAllDay);
|
|
22856
|
+
this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
22857
|
+
this.updateEventHeight(this.updatedData[parseInt(index_2.toString(), 10)], index_2, dayIndex);
|
|
22858
|
+
}
|
|
22859
|
+
else {
|
|
22860
|
+
if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)].parentNode)) {
|
|
22861
|
+
remove(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
22862
|
+
}
|
|
22742
22863
|
}
|
|
22743
22864
|
}
|
|
22744
22865
|
}
|
|
@@ -22956,6 +23077,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
22956
23077
|
};
|
|
22957
23078
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22958
23079
|
DragAndDrop.prototype.swapDragging = function (e) {
|
|
23080
|
+
if (this.isPreventMultiDrag) {
|
|
23081
|
+
return;
|
|
23082
|
+
}
|
|
22959
23083
|
var colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
22960
23084
|
if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
|
|
22961
23085
|
!closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -23081,7 +23205,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23081
23205
|
getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
23082
23206
|
var offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
|
|
23083
23207
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
23084
|
-
offsetLeft = Math.
|
|
23208
|
+
offsetLeft = Math.round(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
23085
23209
|
var rightOffset;
|
|
23086
23210
|
if (this.parent.enableRtl) {
|
|
23087
23211
|
rightOffset = Math.abs(parseInt(this.actionObj.clone.style.right, 10));
|
|
@@ -23267,7 +23391,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23267
23391
|
return 0;
|
|
23268
23392
|
};
|
|
23269
23393
|
DragAndDrop.prototype.getColumnIndex = function (offsetLeft) {
|
|
23270
|
-
var index = Math.
|
|
23394
|
+
var index = Math.round(offsetLeft / this.actionObj.cellWidth);
|
|
23271
23395
|
if (this.isHeaderRows) {
|
|
23272
23396
|
return index;
|
|
23273
23397
|
}
|
|
@@ -23312,7 +23436,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23312
23436
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
23313
23437
|
var rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
23314
23438
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
23315
|
-
getElementTop(dragArea)) / rowHeight);
|
|
23439
|
+
getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
23316
23440
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
23317
23441
|
this.actionObj.index = rowIndex;
|
|
23318
23442
|
var eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -23328,7 +23452,7 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
|
|
|
23328
23452
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
23329
23453
|
return;
|
|
23330
23454
|
}
|
|
23331
|
-
var top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
23455
|
+
var top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
23332
23456
|
if (this.parent.rowAutoHeight) {
|
|
23333
23457
|
var cursorElement = this.getCursorElement(e);
|
|
23334
23458
|
if (cursorElement) {
|
|
@@ -23893,7 +24017,7 @@ var ViewBase = /** @__PURE__ @class */ (function () {
|
|
|
23893
24017
|
if (this.isTimelineView()) {
|
|
23894
24018
|
var colElements = this.getColElements();
|
|
23895
24019
|
var contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
23896
|
-
var colWidth_1 = (getElementWidth(contentBody) / (colElements.length / 2));
|
|
24020
|
+
var colWidth_1 = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
|
|
23897
24021
|
if (content.offsetHeight !== content.clientHeight) {
|
|
23898
24022
|
var resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
23899
24023
|
if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
|
|
@@ -24275,11 +24399,8 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24275
24399
|
var currentDate = this.parent.getCurrentTime();
|
|
24276
24400
|
if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
|
|
24277
24401
|
var currentDateIndex = this.getCurrentTimeIndicatorIndex();
|
|
24278
|
-
if (currentDateIndex.length > 0) {
|
|
24279
|
-
|
|
24280
|
-
if (workCells.length > 0) {
|
|
24281
|
-
this.changeCurrentTimePosition();
|
|
24282
|
-
}
|
|
24402
|
+
if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
|
|
24403
|
+
this.changeCurrentTimePosition();
|
|
24283
24404
|
if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
|
|
24284
24405
|
var interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
|
|
24285
24406
|
if (interval <= (MS_PER_MINUTE - 1000)) {
|
|
@@ -24381,7 +24502,11 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24381
24502
|
}
|
|
24382
24503
|
for (var _i = 0, currentDateIndex_1 = currentDateIndex; _i < currentDateIndex_1.length; _i++) {
|
|
24383
24504
|
var day = currentDateIndex_1[_i];
|
|
24384
|
-
curTimeWrap
|
|
24505
|
+
if (curTimeWrap.length > day) {
|
|
24506
|
+
curTimeWrap[parseInt(day.toString(), 10)].appendChild(createElement('div', {
|
|
24507
|
+
className: CURRENT_TIMELINE_CLASS, styles: 'top:' + topInPx
|
|
24508
|
+
}));
|
|
24509
|
+
}
|
|
24385
24510
|
}
|
|
24386
24511
|
var currentTimeEle = createElement('div', {
|
|
24387
24512
|
innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
|
|
@@ -24404,7 +24529,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24404
24529
|
this.parent.activeViewOptions.timeScale.interval;
|
|
24405
24530
|
};
|
|
24406
24531
|
VerticalView.prototype.getWorkCellHeight = function () {
|
|
24407
|
-
return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
24532
|
+
return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
24408
24533
|
};
|
|
24409
24534
|
VerticalView.prototype.getTdContent = function (date, type, groupIndex) {
|
|
24410
24535
|
var cntEle;
|
|
@@ -24707,12 +24832,25 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
|
|
|
24707
24832
|
var rows = [];
|
|
24708
24833
|
var tr = createElement('tr');
|
|
24709
24834
|
var td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24835
|
+
var existingGroupIndices = new Set();
|
|
24836
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
|
|
24837
|
+
this.parent.virtualScrollModule.existingDataCollection.length > 0) {
|
|
24838
|
+
existingGroupIndices = new Set(this.parent.virtualScrollModule.existingDataCollection.map(function (data) { return data.groupIndex; }));
|
|
24839
|
+
}
|
|
24710
24840
|
var handler = function (r) {
|
|
24711
24841
|
var ntr = tr.cloneNode();
|
|
24712
24842
|
for (var _i = 0, _a = _this.colLevels[_this.colLevels.length - 1]; _i < _a.length; _i++) {
|
|
24713
24843
|
var tdData = _a[_i];
|
|
24714
|
-
var
|
|
24715
|
-
|
|
24844
|
+
var isAllowTdCreation = true;
|
|
24845
|
+
if (_this.parent.virtualScrollModule && _this.parent.activeViewOptions.group.resources.length > 0) {
|
|
24846
|
+
if (existingGroupIndices.has(tdData.groupIndex)) {
|
|
24847
|
+
isAllowTdCreation = false;
|
|
24848
|
+
}
|
|
24849
|
+
}
|
|
24850
|
+
if (isAllowTdCreation) {
|
|
24851
|
+
var ntd = _this.createContentTd(tdData, r, td);
|
|
24852
|
+
ntr.appendChild(ntd);
|
|
24853
|
+
}
|
|
24716
24854
|
}
|
|
24717
24855
|
rows.push(ntr);
|
|
24718
24856
|
return r;
|
|
@@ -27461,7 +27599,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27461
27599
|
}
|
|
27462
27600
|
var scrollLeft;
|
|
27463
27601
|
if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
|
|
27464
|
-
scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27602
|
+
scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27465
27603
|
}
|
|
27466
27604
|
else {
|
|
27467
27605
|
scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
|
|
@@ -27548,7 +27686,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27548
27686
|
if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
|
|
27549
27687
|
this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
|
|
27550
27688
|
diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
|
|
27551
|
-
getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27689
|
+
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
27552
27690
|
}
|
|
27553
27691
|
else {
|
|
27554
27692
|
var endHour = this.getEndHour();
|
|
@@ -27558,8 +27696,8 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
|
|
|
27558
27696
|
}
|
|
27559
27697
|
}
|
|
27560
27698
|
}
|
|
27561
|
-
return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
27562
|
-
this.parent.activeViewOptions.timeScale.interval);
|
|
27699
|
+
return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
27700
|
+
* this.parent.activeViewOptions.timeScale.slotCount) / this.parent.activeViewOptions.timeScale.interval);
|
|
27563
27701
|
};
|
|
27564
27702
|
TimelineViews.prototype.renderHeader = function () {
|
|
27565
27703
|
var tr = createElement('tr');
|