@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 @@ const MS_PER_MINUTE = 60000;
|
|
|
107
107
|
*
|
|
108
108
|
* @param {Element} container Accepts the DOM element
|
|
109
109
|
* @param {string} elementClass Accepts the element class
|
|
110
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
110
111
|
* @returns {number} Returns the height of the element
|
|
111
112
|
*/
|
|
112
|
-
function getElementHeightFromClass(container, elementClass) {
|
|
113
|
+
function getElementHeightFromClass(container, elementClass, isTransformed) {
|
|
113
114
|
let height = 0;
|
|
114
115
|
const el = createElement('div', { className: elementClass }).cloneNode();
|
|
115
116
|
el.style.visibility = 'hidden';
|
|
116
117
|
el.style.position = 'absolute';
|
|
117
118
|
container.appendChild(el);
|
|
118
|
-
height = getElementHeight(el);
|
|
119
|
+
height = getElementHeight(el, isTransformed);
|
|
119
120
|
remove(el);
|
|
120
121
|
return height;
|
|
121
122
|
}
|
|
@@ -124,15 +125,16 @@ function getElementHeightFromClass(container, elementClass) {
|
|
|
124
125
|
*
|
|
125
126
|
* @param {Element} container Accepts the DOM element
|
|
126
127
|
* @param {string} elementClass Accepts the element class
|
|
128
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
127
129
|
* @returns {number} Returns the width of the element
|
|
128
130
|
*/
|
|
129
|
-
function getElementWidthFromClass(container, elementClass) {
|
|
131
|
+
function getElementWidthFromClass(container, elementClass, isTransformed) {
|
|
130
132
|
let width = 0;
|
|
131
133
|
const el = createElement('div', { className: elementClass }).cloneNode();
|
|
132
134
|
el.style.visibility = 'hidden';
|
|
133
135
|
el.style.position = 'absolute';
|
|
134
136
|
container.appendChild(el);
|
|
135
|
-
width = getElementWidth(el);
|
|
137
|
+
width = getElementWidth(el, isTransformed);
|
|
136
138
|
remove(el);
|
|
137
139
|
return width;
|
|
138
140
|
}
|
|
@@ -523,28 +525,31 @@ function capitalizeFirstWord(inputString, type) {
|
|
|
523
525
|
* Method to get element cell width
|
|
524
526
|
*
|
|
525
527
|
* @param {HTMLElement} element Accepts the DOM element
|
|
528
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
526
529
|
* @returns {number} Returns the width of the given element
|
|
527
530
|
*/
|
|
528
|
-
function getElementWidth(element) {
|
|
529
|
-
return
|
|
531
|
+
function getElementWidth(element, isTransformed) {
|
|
532
|
+
return isTransformed ? element.offsetWidth : element.getBoundingClientRect().width;
|
|
530
533
|
}
|
|
531
534
|
/**
|
|
532
535
|
* Method to get element cell Height
|
|
533
536
|
*
|
|
534
537
|
* @param {HTMLElement} element Accepts the DOM element
|
|
538
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
535
539
|
* @returns {number} Returns the Height of the given element
|
|
536
540
|
*/
|
|
537
|
-
function getElementHeight(element) {
|
|
538
|
-
return
|
|
541
|
+
function getElementHeight(element, isTransformed) {
|
|
542
|
+
return isTransformed ? element.offsetHeight : element.getBoundingClientRect().height;
|
|
539
543
|
}
|
|
540
544
|
/**
|
|
541
545
|
* Method to get element cell Top
|
|
542
546
|
*
|
|
543
547
|
* @param {HTMLElement} element Accepts the DOM element
|
|
548
|
+
* @param {boolean} isTransformed Accepts the boolean value that indicates the status of the transform style applied to the element
|
|
544
549
|
* @returns {number} Returns the top value of the given element
|
|
545
550
|
*/
|
|
546
|
-
function getElementTop(element) {
|
|
547
|
-
return
|
|
551
|
+
function getElementTop(element, isTransformed) {
|
|
552
|
+
return isTransformed ? element.offsetTop : element.getBoundingClientRect().top;
|
|
548
553
|
}
|
|
549
554
|
|
|
550
555
|
/**
|
|
@@ -1910,6 +1915,7 @@ class ScheduleTouch {
|
|
|
1910
1915
|
this.parent.selectedElements = [];
|
|
1911
1916
|
this.parent.eventBase.getSelectedEventElements(target);
|
|
1912
1917
|
if (this.parent.resizeModule && closest(e.originalEvent.target, '.' + EVENT_RESIZE_CLASS)) {
|
|
1918
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1913
1919
|
this.parent.resizeModule.resizeStart(e.originalEvent);
|
|
1914
1920
|
}
|
|
1915
1921
|
}
|
|
@@ -4127,6 +4133,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
4127
4133
|
}
|
|
4128
4134
|
else {
|
|
4129
4135
|
tempDate = getStartDateForWeek(startDate, ruleObject.day);
|
|
4136
|
+
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < startDate.getDay()) {
|
|
4137
|
+
tempDate.setDate(tempDate.getDate() + ((interval - 1) * 7));
|
|
4138
|
+
}
|
|
4130
4139
|
while (compareDates(tempDate, endDate)) {
|
|
4131
4140
|
weekState = validateRules(tempDate, ruleObject);
|
|
4132
4141
|
if (weekState && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1)) {
|
|
@@ -6855,7 +6864,7 @@ class VerticalEvent extends EventBase {
|
|
|
6855
6864
|
this.resources = this.parent.resourceBase.renderedResources;
|
|
6856
6865
|
}
|
|
6857
6866
|
this.cellHeight =
|
|
6858
|
-
parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6867
|
+
parseFloat(this.parent.getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6859
6868
|
this.dateRender[0] = this.parent.activeView.renderDates;
|
|
6860
6869
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
6861
6870
|
for (let i = 0, len = this.resources.length; i < len; i++) {
|
|
@@ -6939,7 +6948,7 @@ class VerticalEvent extends EventBase {
|
|
|
6939
6948
|
const resources = this.getResourceList();
|
|
6940
6949
|
let dateCount = this.getStartCount();
|
|
6941
6950
|
let isRender;
|
|
6942
|
-
const appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
6951
|
+
const appHeight = eventType === 'allDayEvents' ? this.parent.getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
6943
6952
|
const allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
|
|
6944
6953
|
for (const resource of resources) {
|
|
6945
6954
|
isRender = true;
|
|
@@ -7652,7 +7661,7 @@ class MonthEvent extends EventBase {
|
|
|
7652
7661
|
this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
|
|
7653
7662
|
cellTd.removeChild(wrapper);
|
|
7654
7663
|
}
|
|
7655
|
-
this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7664
|
+
this.eventHeight = this.parent.getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7656
7665
|
const selector = '.' + CONTENT_TABLE_CLASS + ' tbody tr';
|
|
7657
7666
|
this.addCellHeight(selector, this.eventHeight, (this.parent.currentView === 'Month' ? EVENT_GAP : 2), this.monthHeaderHeight, this.moreIndicatorHeight);
|
|
7658
7667
|
const scrollTop = conWrap.scrollTop;
|
|
@@ -7731,8 +7740,8 @@ class MonthEvent extends EventBase {
|
|
|
7731
7740
|
});
|
|
7732
7741
|
}
|
|
7733
7742
|
const cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
|
|
7734
|
-
this.cellWidth = getElementWidth(cellDetail);
|
|
7735
|
-
this.cellHeight = getElementHeight(cellDetail);
|
|
7743
|
+
this.cellWidth = this.parent.getElementWidth(cellDetail);
|
|
7744
|
+
this.cellHeight = this.parent.getElementHeight(cellDetail);
|
|
7736
7745
|
this.dateRender = dateRender;
|
|
7737
7746
|
const filteredDates = this.getRenderedDates(dateRender);
|
|
7738
7747
|
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
@@ -8285,7 +8294,7 @@ class TimelineEvent extends MonthEvent {
|
|
|
8285
8294
|
this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
|
|
8286
8295
|
this.renderType = 'day';
|
|
8287
8296
|
const workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
|
|
8288
|
-
this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8297
|
+
this.cellWidth = this.parent.getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8289
8298
|
this.slotsPerDay = 1;
|
|
8290
8299
|
}
|
|
8291
8300
|
else {
|
|
@@ -8448,14 +8457,14 @@ class TimelineEvent extends MonthEvent {
|
|
|
8448
8457
|
this.wireAppointmentEvents(appointmentElement, event);
|
|
8449
8458
|
if (this.parent.rowAutoHeight) {
|
|
8450
8459
|
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
8451
|
-
const conWidth = getElementWidth(conWrap);
|
|
8460
|
+
const conWidth = this.parent.getElementWidth(conWrap);
|
|
8452
8461
|
const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
|
|
8453
8462
|
conWrap.offsetWidth === conWrap.clientWidth;
|
|
8454
8463
|
this.renderEventElement(event, appointmentElement, cellTd);
|
|
8455
8464
|
const firstChild = this.getFirstChild(resIndex);
|
|
8456
8465
|
this.updateCellHeight(firstChild, height);
|
|
8457
8466
|
if (isWithoutScroll &&
|
|
8458
|
-
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
|
|
8467
|
+
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
|
|
8459
8468
|
this.adjustAppointments(conWidth);
|
|
8460
8469
|
}
|
|
8461
8470
|
}
|
|
@@ -8573,7 +8582,7 @@ class TimelineEvent extends MonthEvent {
|
|
|
8573
8582
|
}
|
|
8574
8583
|
adjustAppointments(conWidth) {
|
|
8575
8584
|
const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8576
|
-
const actualCellWidth = getElementWidth(this.workCells[0]);
|
|
8585
|
+
const actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8577
8586
|
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8578
8587
|
const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8579
8588
|
const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
@@ -8933,11 +8942,11 @@ class InlineEdit {
|
|
|
8933
8942
|
const allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
|
|
8934
8943
|
let allDayLevel = 0;
|
|
8935
8944
|
if (allDayElements.length > 0) {
|
|
8936
|
-
allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
8945
|
+
allDayLevel = Math.floor(this.parent.getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
8937
8946
|
allDayElements[0].offsetHeight) - 1;
|
|
8938
8947
|
}
|
|
8939
8948
|
verticalEvent.allDayLevel = allDayLevel;
|
|
8940
|
-
const appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
8949
|
+
const appHeight = this.parent.getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
8941
8950
|
const cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
|
|
8942
8951
|
verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
|
|
8943
8952
|
}
|
|
@@ -8965,7 +8974,7 @@ class InlineEdit {
|
|
|
8965
8974
|
monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
|
|
8966
8975
|
monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
|
|
8967
8976
|
monthEvent.eventHeight =
|
|
8968
|
-
getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
8977
|
+
this.parent.getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
8969
8978
|
monthEvent.getSlotDates(workDays);
|
|
8970
8979
|
const filteredDates = monthEvent.getRenderedDates(renderDates);
|
|
8971
8980
|
const spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
|
|
@@ -8988,7 +8997,7 @@ class InlineEdit {
|
|
|
8988
8997
|
const dayLength = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?
|
|
8989
8998
|
0 : this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;
|
|
8990
8999
|
timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
|
|
8991
|
-
timelineView.eventHeight = getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9000
|
+
timelineView.eventHeight = this.parent.getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
8992
9001
|
timelineView.renderEvents(saveObject, resIndex);
|
|
8993
9002
|
}
|
|
8994
9003
|
getEventDaysCount(saveObj) {
|
|
@@ -11978,8 +11987,13 @@ class EventWindow {
|
|
|
11978
11987
|
this.addEventHandlers();
|
|
11979
11988
|
}
|
|
11980
11989
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
11981
|
-
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);
|
|
11990
|
+
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data, type, repeatType);
|
|
11991
|
+
}
|
|
11992
|
+
else {
|
|
11993
|
+
this.setEditorContent(data, type, repeatType);
|
|
11982
11994
|
}
|
|
11995
|
+
}
|
|
11996
|
+
setEditorContent(data, type, repeatType) {
|
|
11983
11997
|
if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {
|
|
11984
11998
|
removeClass([this.dialogObject.element.querySelector('.e-recurrenceeditor')], DISABLE_CLASS);
|
|
11985
11999
|
}
|
|
@@ -12158,7 +12172,7 @@ class EventWindow {
|
|
|
12158
12172
|
container.appendChild(form);
|
|
12159
12173
|
return container;
|
|
12160
12174
|
}
|
|
12161
|
-
renderFormElements(form, args) {
|
|
12175
|
+
renderFormElements(form, args, type, repeatType) {
|
|
12162
12176
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
12163
12177
|
if (args) {
|
|
12164
12178
|
if (this.fieldValidator) {
|
|
@@ -12185,15 +12199,17 @@ class EventWindow {
|
|
|
12185
12199
|
this.parent.renderTemplates(() => {
|
|
12186
12200
|
if (this.element) {
|
|
12187
12201
|
this.applyFormValidation();
|
|
12188
|
-
if (
|
|
12189
|
-
this.
|
|
12190
|
-
this.eventCrudData = null;
|
|
12202
|
+
if (args) {
|
|
12203
|
+
this.setEditorContent(args, type, repeatType);
|
|
12191
12204
|
}
|
|
12192
12205
|
}
|
|
12193
12206
|
});
|
|
12194
12207
|
}
|
|
12195
12208
|
else {
|
|
12196
12209
|
form.appendChild(this.getDefaultEventWindowContent());
|
|
12210
|
+
if (args) {
|
|
12211
|
+
this.setEditorContent(args, type, repeatType);
|
|
12212
|
+
}
|
|
12197
12213
|
}
|
|
12198
12214
|
}
|
|
12199
12215
|
getDefaultEventWindowContent() {
|
|
@@ -12779,13 +12795,9 @@ class EventWindow {
|
|
|
12779
12795
|
this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
|
|
12780
12796
|
}
|
|
12781
12797
|
showDetails(eventData) {
|
|
12782
|
-
this.eventData =
|
|
12798
|
+
this.eventData = eventData;
|
|
12783
12799
|
const eventObj = extend({}, eventData, null, true);
|
|
12784
12800
|
const formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
|
|
12785
|
-
if (this.parent.isReact && formElements.length < 1 && !this.cellClickAction) {
|
|
12786
|
-
this.eventCrudData = eventObj;
|
|
12787
|
-
return;
|
|
12788
|
-
}
|
|
12789
12801
|
if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
|
|
12790
12802
|
eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
|
|
12791
12803
|
this.trimAllDay(eventObj);
|
|
@@ -13789,6 +13801,7 @@ class VirtualScroll {
|
|
|
13789
13801
|
this.renderedLength = 0;
|
|
13790
13802
|
this.averageRowHeight = 0;
|
|
13791
13803
|
this.startIndex = 0;
|
|
13804
|
+
this.existingDataCollection = [];
|
|
13792
13805
|
this.parent = parent;
|
|
13793
13806
|
this.addEventListener();
|
|
13794
13807
|
}
|
|
@@ -13861,10 +13874,10 @@ class VirtualScroll {
|
|
|
13861
13874
|
}
|
|
13862
13875
|
setItemSize() {
|
|
13863
13876
|
if (this.isHorizontalScroll) {
|
|
13864
|
-
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13877
|
+
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
|
|
13865
13878
|
}
|
|
13866
13879
|
else {
|
|
13867
|
-
this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13880
|
+
this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13868
13881
|
}
|
|
13869
13882
|
}
|
|
13870
13883
|
refreshLayout() {
|
|
@@ -14141,43 +14154,90 @@ class VirtualScroll {
|
|
|
14141
14154
|
append(eventRows, eventWrap);
|
|
14142
14155
|
}
|
|
14143
14156
|
updateHorizontalContent(conWrap, resCollection) {
|
|
14157
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
14144
14158
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
14145
14159
|
const selectedEle = this.parent.getSelectedCells();
|
|
14146
14160
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
14147
|
-
const
|
|
14161
|
+
const tbody = conWrap.querySelector('tbody');
|
|
14162
|
+
const renderedRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14163
|
+
if (this.parent.currentView === 'Month') {
|
|
14164
|
+
this.updateMonthViewContent(conWrap, resCollection);
|
|
14165
|
+
}
|
|
14166
|
+
else {
|
|
14167
|
+
this.updateOtherViewContent(conWrap, resCollection, renderedRows);
|
|
14168
|
+
}
|
|
14169
|
+
}
|
|
14170
|
+
updateMonthViewContent(conWrap, resCollection) {
|
|
14171
|
+
const renderedLength = conWrap.querySelectorAll(' tr').length;
|
|
14148
14172
|
for (let i = 0; i < renderedLength; i++) {
|
|
14149
14173
|
remove(conWrap.querySelector('tbody tr'));
|
|
14150
14174
|
}
|
|
14151
|
-
if (this.parent.
|
|
14152
|
-
|
|
14153
|
-
this.parent.activeView.colLevels[0] = resCollection;
|
|
14154
|
-
}
|
|
14155
|
-
else {
|
|
14156
|
-
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14157
|
-
}
|
|
14158
|
-
const contentRows = this.parent.activeView.getContentRows();
|
|
14159
|
-
append(contentRows, conWrap.querySelector('tbody'));
|
|
14175
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
14176
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
14160
14177
|
}
|
|
14161
14178
|
else {
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14179
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14180
|
+
}
|
|
14181
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
14182
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
14183
|
+
}
|
|
14184
|
+
updateOtherViewContent(conWrap, resCollection, renderedRows) {
|
|
14185
|
+
const tbody = conWrap.querySelector('tbody');
|
|
14186
|
+
const colGroup = conWrap.querySelector('colgroup');
|
|
14187
|
+
const thead = conWrap.querySelector('thead');
|
|
14188
|
+
const table = conWrap.querySelector('table');
|
|
14189
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
14190
|
+
const newGroupIndices = new Set(resCollection.map((data) => data.groupIndex));
|
|
14191
|
+
renderedRows.forEach((row) => {
|
|
14192
|
+
const tdElements = row.querySelectorAll('td');
|
|
14193
|
+
tdElements.forEach((td) => {
|
|
14194
|
+
const groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
14195
|
+
if (!newGroupIndices.has(groupIndex)) {
|
|
14196
|
+
td.remove();
|
|
14197
|
+
}
|
|
14173
14198
|
});
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14199
|
+
});
|
|
14200
|
+
const col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
14201
|
+
for (let i = 0; i < col.length; i++) {
|
|
14202
|
+
remove(col[parseInt(i.toString(), 10)]);
|
|
14203
|
+
}
|
|
14204
|
+
resCollection.forEach(() => colGroup.appendChild(createElement('col')));
|
|
14205
|
+
const tHead = [].slice.call(conWrap.querySelector('thead').children);
|
|
14206
|
+
for (let i = 0; i < tHead.length; i++) {
|
|
14207
|
+
remove(tHead[parseInt(i.toString(), 10)]);
|
|
14208
|
+
}
|
|
14209
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
14210
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
14211
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
14180
14212
|
}
|
|
14213
|
+
prepend([thead], table);
|
|
14214
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
14215
|
+
this.mergeNewTdData(tbody, contentRows);
|
|
14216
|
+
}
|
|
14217
|
+
mergeNewTdData(tbody, contentRows) {
|
|
14218
|
+
const existingRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14219
|
+
existingRows.forEach((existingRow, rowIndex) => {
|
|
14220
|
+
if (rowIndex < contentRows.length) {
|
|
14221
|
+
const newRow = contentRows[parseInt(rowIndex.toString(), 10)];
|
|
14222
|
+
const existingTds = Array.from(existingRow.querySelectorAll('td'));
|
|
14223
|
+
const newTds = Array.from(newRow.querySelectorAll('td'));
|
|
14224
|
+
newTds.forEach((newTd) => {
|
|
14225
|
+
const newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
|
|
14226
|
+
let inserted = false;
|
|
14227
|
+
for (const existingTd of existingTds) {
|
|
14228
|
+
const existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
|
|
14229
|
+
if (newGroupIndex < existingGroupIndex) {
|
|
14230
|
+
existingRow.insertBefore(newTd, existingTd);
|
|
14231
|
+
inserted = true;
|
|
14232
|
+
break;
|
|
14233
|
+
}
|
|
14234
|
+
}
|
|
14235
|
+
if (!inserted) {
|
|
14236
|
+
existingRow.appendChild(newTd);
|
|
14237
|
+
}
|
|
14238
|
+
});
|
|
14239
|
+
}
|
|
14240
|
+
});
|
|
14181
14241
|
}
|
|
14182
14242
|
getBufferCollection(startIndex, endIndex) {
|
|
14183
14243
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -16754,6 +16814,37 @@ let Schedule = class Schedule extends Component {
|
|
|
16754
16814
|
}
|
|
16755
16815
|
return templateName;
|
|
16756
16816
|
}
|
|
16817
|
+
/**
|
|
16818
|
+
* Method to get element width
|
|
16819
|
+
*
|
|
16820
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
16821
|
+
* @returns {number} Returns the width of the given element
|
|
16822
|
+
* @private
|
|
16823
|
+
*/
|
|
16824
|
+
getElementWidth(element) {
|
|
16825
|
+
return getElementWidth(element, this.uiStateValues.isTransformed);
|
|
16826
|
+
}
|
|
16827
|
+
/**
|
|
16828
|
+
* Method to get element height
|
|
16829
|
+
*
|
|
16830
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
16831
|
+
* @returns {number} Returns the Height of the given element
|
|
16832
|
+
* @private
|
|
16833
|
+
*/
|
|
16834
|
+
getElementHeight(element) {
|
|
16835
|
+
return getElementHeight(element, this.uiStateValues.isTransformed);
|
|
16836
|
+
}
|
|
16837
|
+
/**
|
|
16838
|
+
* Method to get height from element
|
|
16839
|
+
*
|
|
16840
|
+
* @param {Element} element Accepts the DOM element
|
|
16841
|
+
* @param {string} elementClass Accepts the element class
|
|
16842
|
+
* @returns {number} Returns the height of the element
|
|
16843
|
+
* @private
|
|
16844
|
+
*/
|
|
16845
|
+
getElementHeightFromClass(element, elementClass) {
|
|
16846
|
+
return getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
|
|
16847
|
+
}
|
|
16757
16848
|
/**
|
|
16758
16849
|
* Method to render react templates
|
|
16759
16850
|
*
|
|
@@ -16833,6 +16924,7 @@ let Schedule = class Schedule extends Component {
|
|
|
16833
16924
|
this.headerModule = new HeaderRenderer(this);
|
|
16834
16925
|
}
|
|
16835
16926
|
this.renderTableContainer();
|
|
16927
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
16836
16928
|
if (Browser.isDevice || Browser.isTouch) {
|
|
16837
16929
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
16838
16930
|
}
|
|
@@ -17327,7 +17419,7 @@ let Schedule = class Schedule extends Component {
|
|
|
17327
17419
|
this.uiStateValues = {
|
|
17328
17420
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
17329
17421
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
17330
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
17422
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
17331
17423
|
};
|
|
17332
17424
|
}
|
|
17333
17425
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -18712,6 +18804,9 @@ let Schedule = class Schedule extends Component {
|
|
|
18712
18804
|
* @returns {void}
|
|
18713
18805
|
*/
|
|
18714
18806
|
scrollTo(hour, scrollDate) {
|
|
18807
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
18808
|
+
return;
|
|
18809
|
+
}
|
|
18715
18810
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
18716
18811
|
this.activeView.scrollToDate(scrollDate);
|
|
18717
18812
|
}
|
|
@@ -20187,8 +20282,8 @@ class Resize extends ActionBase {
|
|
|
20187
20282
|
};
|
|
20188
20283
|
this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
|
|
20189
20284
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20190
|
-
this.actionObj.cellWidth = getElementWidth(workCell);
|
|
20191
|
-
this.actionObj.cellHeight = getElementHeight(workCell);
|
|
20285
|
+
this.actionObj.cellWidth = this.parent.getElementWidth(workCell);
|
|
20286
|
+
this.actionObj.cellHeight = this.parent.getElementHeight(workCell);
|
|
20192
20287
|
const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
|
|
20193
20288
|
if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
20194
20289
|
const tr = this.parent.getContentTable().querySelector('tr');
|
|
@@ -20490,10 +20585,10 @@ class Resize extends ActionBase {
|
|
|
20490
20585
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
20491
20586
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20492
20587
|
if (!isLeft) {
|
|
20493
|
-
offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20588
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20494
20589
|
}
|
|
20495
|
-
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (getElementWidth(tr) / noOfDays)) :
|
|
20496
|
-
Math.floor(offsetValue / Math.floor(getElementWidth(tr) / noOfDays));
|
|
20590
|
+
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
|
|
20591
|
+
Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
|
|
20497
20592
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
20498
20593
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
20499
20594
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20502,7 +20597,7 @@ class Resize extends ActionBase {
|
|
|
20502
20597
|
else {
|
|
20503
20598
|
const cellWidth = this.actionObj.cellWidth;
|
|
20504
20599
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
20505
|
-
Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
20600
|
+
Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
20506
20601
|
if (this.parent.enableRtl) {
|
|
20507
20602
|
let cellOffsetWidth = 0;
|
|
20508
20603
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -20510,7 +20605,7 @@ class Resize extends ActionBase {
|
|
|
20510
20605
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
20511
20606
|
}
|
|
20512
20607
|
const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
20513
|
-
this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20608
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20514
20609
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
20515
20610
|
}
|
|
20516
20611
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20529,7 +20624,7 @@ class Resize extends ActionBase {
|
|
|
20529
20624
|
}
|
|
20530
20625
|
else {
|
|
20531
20626
|
if (!isLeft) {
|
|
20532
|
-
offset += getElementWidth(this.actionObj.clone);
|
|
20627
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
20533
20628
|
}
|
|
20534
20629
|
let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
20535
20630
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -20541,9 +20636,9 @@ class Resize extends ActionBase {
|
|
|
20541
20636
|
}
|
|
20542
20637
|
else {
|
|
20543
20638
|
const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
20544
|
-
const originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
|
|
20639
|
+
const originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
20545
20640
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20546
|
-
const noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20641
|
+
const noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20547
20642
|
this.actionObj.cellWidth);
|
|
20548
20643
|
const tr = closest(this.actionObj.clone, 'tr');
|
|
20549
20644
|
let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -20606,9 +20701,9 @@ class Resize extends ActionBase {
|
|
|
20606
20701
|
const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
20607
20702
|
const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
20608
20703
|
const targetWidth = isTimelineView ?
|
|
20609
|
-
(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
20610
|
-
this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
|
|
20611
|
-
Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20704
|
+
(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
20705
|
+
this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
|
|
20706
|
+
Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20612
20707
|
let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
20613
20708
|
const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
20614
20709
|
if (isTimeViews) {
|
|
@@ -20623,7 +20718,7 @@ class Resize extends ActionBase {
|
|
|
20623
20718
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
20624
20719
|
}
|
|
20625
20720
|
let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
20626
|
-
getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20721
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20627
20722
|
if (this.parent.enableRtl) {
|
|
20628
20723
|
let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
20629
20724
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -20637,7 +20732,7 @@ class Resize extends ActionBase {
|
|
|
20637
20732
|
}
|
|
20638
20733
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
20639
20734
|
styles.right = formatUnit(rightValue);
|
|
20640
|
-
width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
|
|
20735
|
+
width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
|
|
20641
20736
|
}
|
|
20642
20737
|
else {
|
|
20643
20738
|
let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -20645,12 +20740,12 @@ class Resize extends ActionBase {
|
|
|
20645
20740
|
if (isTimelineView) {
|
|
20646
20741
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
20647
20742
|
if (this.parent.enableRtl) {
|
|
20648
|
-
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
|
|
20743
|
+
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
|
|
20649
20744
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
20650
20745
|
}
|
|
20651
20746
|
else {
|
|
20652
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
|
|
20653
|
-
getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
20747
|
+
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
|
|
20748
|
+
this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
20654
20749
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
20655
20750
|
}
|
|
20656
20751
|
}
|
|
@@ -20666,10 +20761,10 @@ class Resize extends ActionBase {
|
|
|
20666
20761
|
}
|
|
20667
20762
|
else {
|
|
20668
20763
|
offsetLeft = 0;
|
|
20669
|
-
width = getElementWidth(this.actionObj.clone);
|
|
20764
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
20670
20765
|
}
|
|
20671
20766
|
}
|
|
20672
|
-
const cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
20767
|
+
const cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
20673
20768
|
this.actionObj.cellWidth;
|
|
20674
20769
|
if (isLeft) {
|
|
20675
20770
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -20782,10 +20877,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20782
20877
|
}
|
|
20783
20878
|
timelineYearViewEvents() {
|
|
20784
20879
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
20785
|
-
this.cellWidth = getElementWidth(workCell);
|
|
20880
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20786
20881
|
this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
|
|
20787
20882
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20788
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20883
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20789
20884
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20790
20885
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20791
20886
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20932,10 +21027,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20932
21027
|
const contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
20933
21028
|
const isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
|
|
20934
21029
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20935
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21030
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20936
21031
|
this.cellHeader = 0;
|
|
20937
21032
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20938
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21033
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20939
21034
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20940
21035
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20941
21036
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20977,7 +21072,7 @@ class YearEvent extends TimelineEvent {
|
|
|
20977
21072
|
appWrapper.forEach((appWrap, cellIndex) => {
|
|
20978
21073
|
const td = row.querySelector(`td:nth-child(${cellIndex + 1})`);
|
|
20979
21074
|
const app = [].slice.call(appWrap.children);
|
|
20980
|
-
const width = getElementWidth(td);
|
|
21075
|
+
const width = this.parent.getElementWidth(td);
|
|
20981
21076
|
const left = td.offsetLeft;
|
|
20982
21077
|
if (this.parent.enableRtl) {
|
|
20983
21078
|
const right = conTable.offsetWidth - left - td.offsetWidth;
|
|
@@ -21320,6 +21415,8 @@ class DragAndDrop extends ActionBase {
|
|
|
21320
21415
|
this.isAllDayTarget = false;
|
|
21321
21416
|
this.targetTd = null;
|
|
21322
21417
|
this.isCursorAhead = false;
|
|
21418
|
+
this.enableCurrentViewDrag = false;
|
|
21419
|
+
this.isPreventMultiDrag = false;
|
|
21323
21420
|
}
|
|
21324
21421
|
wireDragEvent(element) {
|
|
21325
21422
|
new Draggable(element, {
|
|
@@ -21433,6 +21530,9 @@ class DragAndDrop extends ActionBase {
|
|
|
21433
21530
|
if (cloneBottom > scrollHeight) {
|
|
21434
21531
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
21435
21532
|
}
|
|
21533
|
+
if (this.isPreventMultiDrag) {
|
|
21534
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
21535
|
+
}
|
|
21436
21536
|
}
|
|
21437
21537
|
return { left: leftValue, top: topValue };
|
|
21438
21538
|
}
|
|
@@ -21483,6 +21583,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21483
21583
|
this.actionObj.interval = dragEventArgs.interval;
|
|
21484
21584
|
this.actionObj.navigation = dragEventArgs.navigation;
|
|
21485
21585
|
this.actionObj.scroll = dragEventArgs.scroll;
|
|
21586
|
+
this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && this.parent.allowMultiDrag;
|
|
21486
21587
|
this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
21487
21588
|
const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
21488
21589
|
this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -21641,6 +21742,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21641
21742
|
}
|
|
21642
21743
|
dragStop(e) {
|
|
21643
21744
|
this.isCursorAhead = false;
|
|
21745
|
+
this.isPreventMultiDrag = false;
|
|
21644
21746
|
this.removeCloneElementClasses();
|
|
21645
21747
|
this.removeCloneElement();
|
|
21646
21748
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -21708,7 +21810,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21708
21810
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
21709
21811
|
this.timelineEventModule.getSlotDates();
|
|
21710
21812
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
21711
|
-
getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21813
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21712
21814
|
this.calculateTimelineTime(e);
|
|
21713
21815
|
}
|
|
21714
21816
|
else {
|
|
@@ -21883,7 +21985,9 @@ class DragAndDrop extends ActionBase {
|
|
|
21883
21985
|
let dragStart;
|
|
21884
21986
|
let dragEnd;
|
|
21885
21987
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
21886
|
-
this.
|
|
21988
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
21989
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
21990
|
+
}
|
|
21887
21991
|
dragStart = this.parent.getDateFromElement(td);
|
|
21888
21992
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
21889
21993
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -21939,18 +22043,34 @@ class DragAndDrop extends ActionBase {
|
|
|
21939
22043
|
this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
|
|
21940
22044
|
}
|
|
21941
22045
|
const startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
21942
|
-
|
|
21943
|
-
this.
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
const
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
|
|
21953
|
-
|
|
22046
|
+
if (this.enableCurrentViewDrag) {
|
|
22047
|
+
const renderDates = this.getRenderedDates();
|
|
22048
|
+
for (let i = 0; i < this.multiData.length; i++) {
|
|
22049
|
+
const eventObj = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
|
|
22050
|
+
const startTime = new Date(eventObj[this.parent.eventFields.startTime].getTime() + startTimeDiff);
|
|
22051
|
+
const dayIndex = this.parent.getIndexOfDate(renderDates, resetTime(startTime));
|
|
22052
|
+
if (dayIndex < 0) {
|
|
22053
|
+
this.isPreventMultiDrag = true;
|
|
22054
|
+
break;
|
|
22055
|
+
}
|
|
22056
|
+
this.isPreventMultiDrag = false;
|
|
22057
|
+
}
|
|
22058
|
+
}
|
|
22059
|
+
if (!this.isPreventMultiDrag) {
|
|
22060
|
+
for (let index = 0; index < this.multiData.length; index++) {
|
|
22061
|
+
this.updatedData[parseInt(index.toString(), 10)] =
|
|
22062
|
+
this.updateMultipleData(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
|
|
22063
|
+
const dayIndex = this.getDayIndex(this.updatedData[parseInt(index.toString(), 10)]);
|
|
22064
|
+
if (dayIndex >= 0) {
|
|
22065
|
+
const isAllDay = this.updatedData[parseInt(index.toString(), 10)][this.parent.eventFields.isAllDay];
|
|
22066
|
+
const wrapper = this.getEventWrapper(dayIndex, isAllDay);
|
|
22067
|
+
this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
|
|
22068
|
+
this.updateEventHeight(this.updatedData[parseInt(index.toString(), 10)], index, dayIndex);
|
|
22069
|
+
}
|
|
22070
|
+
else {
|
|
22071
|
+
if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index.toString(), 10)].parentNode)) {
|
|
22072
|
+
remove(this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
|
|
22073
|
+
}
|
|
21954
22074
|
}
|
|
21955
22075
|
}
|
|
21956
22076
|
}
|
|
@@ -22166,6 +22286,9 @@ class DragAndDrop extends ActionBase {
|
|
|
22166
22286
|
}
|
|
22167
22287
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22168
22288
|
swapDragging(e) {
|
|
22289
|
+
if (this.isPreventMultiDrag) {
|
|
22290
|
+
return;
|
|
22291
|
+
}
|
|
22169
22292
|
const colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
22170
22293
|
if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
|
|
22171
22294
|
!closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -22289,7 +22412,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22289
22412
|
getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
22290
22413
|
let offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
|
|
22291
22414
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
22292
|
-
offsetLeft = Math.
|
|
22415
|
+
offsetLeft = Math.round(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
22293
22416
|
let rightOffset;
|
|
22294
22417
|
if (this.parent.enableRtl) {
|
|
22295
22418
|
rightOffset = Math.abs(parseInt(this.actionObj.clone.style.right, 10));
|
|
@@ -22475,7 +22598,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22475
22598
|
return 0;
|
|
22476
22599
|
}
|
|
22477
22600
|
getColumnIndex(offsetLeft) {
|
|
22478
|
-
const index = Math.
|
|
22601
|
+
const index = Math.round(offsetLeft / this.actionObj.cellWidth);
|
|
22479
22602
|
if (this.isHeaderRows) {
|
|
22480
22603
|
return index;
|
|
22481
22604
|
}
|
|
@@ -22520,7 +22643,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22520
22643
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
22521
22644
|
let rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
22522
22645
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
22523
|
-
getElementTop(dragArea)) / rowHeight);
|
|
22646
|
+
getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
22524
22647
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
22525
22648
|
this.actionObj.index = rowIndex;
|
|
22526
22649
|
const eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -22536,7 +22659,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22536
22659
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
22537
22660
|
return;
|
|
22538
22661
|
}
|
|
22539
|
-
let top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22662
|
+
let top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22540
22663
|
if (this.parent.rowAutoHeight) {
|
|
22541
22664
|
const cursorElement = this.getCursorElement(e);
|
|
22542
22665
|
if (cursorElement) {
|
|
@@ -23093,7 +23216,7 @@ class ViewBase {
|
|
|
23093
23216
|
if (this.isTimelineView()) {
|
|
23094
23217
|
const colElements = this.getColElements();
|
|
23095
23218
|
const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
23096
|
-
const colWidth = (getElementWidth(contentBody) / (colElements.length / 2));
|
|
23219
|
+
const colWidth = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
|
|
23097
23220
|
if (content.offsetHeight !== content.clientHeight) {
|
|
23098
23221
|
const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
23099
23222
|
if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
|
|
@@ -23453,11 +23576,8 @@ class VerticalView extends ViewBase {
|
|
|
23453
23576
|
const currentDate = this.parent.getCurrentTime();
|
|
23454
23577
|
if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
|
|
23455
23578
|
const currentDateIndex = this.getCurrentTimeIndicatorIndex();
|
|
23456
|
-
if (currentDateIndex.length > 0) {
|
|
23457
|
-
|
|
23458
|
-
if (workCells.length > 0) {
|
|
23459
|
-
this.changeCurrentTimePosition();
|
|
23460
|
-
}
|
|
23579
|
+
if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
|
|
23580
|
+
this.changeCurrentTimePosition();
|
|
23461
23581
|
if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
|
|
23462
23582
|
const interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
|
|
23463
23583
|
if (interval <= (MS_PER_MINUTE - 1000)) {
|
|
@@ -23554,7 +23674,11 @@ class VerticalView extends ViewBase {
|
|
|
23554
23674
|
curTimeWrap[parseInt(i.toString(), 10)].appendChild(createElement('div', { className: PREVIOUS_TIMELINE_CLASS, styles: 'top:' + topInPx }));
|
|
23555
23675
|
}
|
|
23556
23676
|
for (const day of currentDateIndex) {
|
|
23557
|
-
curTimeWrap
|
|
23677
|
+
if (curTimeWrap.length > day) {
|
|
23678
|
+
curTimeWrap[parseInt(day.toString(), 10)].appendChild(createElement('div', {
|
|
23679
|
+
className: CURRENT_TIMELINE_CLASS, styles: 'top:' + topInPx
|
|
23680
|
+
}));
|
|
23681
|
+
}
|
|
23558
23682
|
}
|
|
23559
23683
|
const currentTimeEle = createElement('div', {
|
|
23560
23684
|
innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
|
|
@@ -23577,7 +23701,7 @@ class VerticalView extends ViewBase {
|
|
|
23577
23701
|
this.parent.activeViewOptions.timeScale.interval;
|
|
23578
23702
|
}
|
|
23579
23703
|
getWorkCellHeight() {
|
|
23580
|
-
return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
23704
|
+
return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
23581
23705
|
}
|
|
23582
23706
|
getTdContent(date, type, groupIndex) {
|
|
23583
23707
|
let cntEle;
|
|
@@ -23878,11 +24002,24 @@ class VerticalView extends ViewBase {
|
|
|
23878
24002
|
const rows = [];
|
|
23879
24003
|
const tr = createElement('tr');
|
|
23880
24004
|
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24005
|
+
let existingGroupIndices = new Set();
|
|
24006
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 &&
|
|
24007
|
+
this.parent.virtualScrollModule.existingDataCollection.length > 0) {
|
|
24008
|
+
existingGroupIndices = new Set(this.parent.virtualScrollModule.existingDataCollection.map((data) => data.groupIndex));
|
|
24009
|
+
}
|
|
23881
24010
|
const handler = (r) => {
|
|
23882
24011
|
const ntr = tr.cloneNode();
|
|
23883
24012
|
for (const tdData of this.colLevels[this.colLevels.length - 1]) {
|
|
23884
|
-
|
|
23885
|
-
|
|
24013
|
+
let isAllowTdCreation = true;
|
|
24014
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0) {
|
|
24015
|
+
if (existingGroupIndices.has(tdData.groupIndex)) {
|
|
24016
|
+
isAllowTdCreation = false;
|
|
24017
|
+
}
|
|
24018
|
+
}
|
|
24019
|
+
if (isAllowTdCreation) {
|
|
24020
|
+
const ntd = this.createContentTd(tdData, r, td);
|
|
24021
|
+
ntr.appendChild(ntd);
|
|
24022
|
+
}
|
|
23886
24023
|
}
|
|
23887
24024
|
rows.push(ntr);
|
|
23888
24025
|
return r;
|
|
@@ -26452,7 +26589,7 @@ class TimelineViews extends VerticalView {
|
|
|
26452
26589
|
}
|
|
26453
26590
|
let scrollLeft;
|
|
26454
26591
|
if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
|
|
26455
|
-
scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26592
|
+
scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26456
26593
|
}
|
|
26457
26594
|
else {
|
|
26458
26595
|
scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
|
|
@@ -26536,7 +26673,7 @@ class TimelineViews extends VerticalView {
|
|
|
26536
26673
|
if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
|
|
26537
26674
|
this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
|
|
26538
26675
|
diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
|
|
26539
|
-
getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26676
|
+
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26540
26677
|
}
|
|
26541
26678
|
else {
|
|
26542
26679
|
const endHour = this.getEndHour();
|
|
@@ -26546,8 +26683,8 @@ class TimelineViews extends VerticalView {
|
|
|
26546
26683
|
}
|
|
26547
26684
|
}
|
|
26548
26685
|
}
|
|
26549
|
-
return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
26550
|
-
this.parent.activeViewOptions.timeScale.interval);
|
|
26686
|
+
return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
26687
|
+
* this.parent.activeViewOptions.timeScale.slotCount) / this.parent.activeViewOptions.timeScale.interval);
|
|
26551
26688
|
}
|
|
26552
26689
|
renderHeader() {
|
|
26553
26690
|
const tr = createElement('tr');
|