@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
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 26.
|
|
3
|
+
* version : 26.2.4
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hotfix/26.1.35_Vol2
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-schedule@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-schedule@26.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-schedule@26.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-d/AIC7kbjZPi2FZ7YdqgrdwK77+BRk5TWDE05BqH4m8MrX6U5OmtQQM9DPbtNx/nhlXVVvxs9K5/ijcYyZTWLQ==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-schedule",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-schedule",
|
|
24
24
|
"/@syncfusion/ej2-vue-schedule"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-26.1.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-26.1.41.tgz",
|
|
27
|
+
"_shasum": "5bebf2b810f97ac7bb1854989afda8dd76826507",
|
|
28
28
|
"_spec": "@syncfusion/ej2-schedule@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~26.
|
|
39
|
-
"@syncfusion/ej2-buttons": "~26.
|
|
40
|
-
"@syncfusion/ej2-calendars": "~26.
|
|
41
|
-
"@syncfusion/ej2-data": "~26.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~26.
|
|
43
|
-
"@syncfusion/ej2-excel-export": "~26.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~26.
|
|
45
|
-
"@syncfusion/ej2-lists": "~26.
|
|
46
|
-
"@syncfusion/ej2-navigations": "~26.
|
|
47
|
-
"@syncfusion/ej2-popups": "~26.
|
|
38
|
+
"@syncfusion/ej2-base": "~26.2.4",
|
|
39
|
+
"@syncfusion/ej2-buttons": "~26.2.4",
|
|
40
|
+
"@syncfusion/ej2-calendars": "~26.2.4",
|
|
41
|
+
"@syncfusion/ej2-data": "~26.2.4",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~26.2.4",
|
|
43
|
+
"@syncfusion/ej2-excel-export": "~26.2.4",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~26.2.4",
|
|
45
|
+
"@syncfusion/ej2-lists": "~26.2.4",
|
|
46
|
+
"@syncfusion/ej2-navigations": "~26.2.4",
|
|
47
|
+
"@syncfusion/ej2-popups": "~26.2.4",
|
|
48
48
|
"@types/requirejs": "^2.1.37"
|
|
49
49
|
},
|
|
50
50
|
"deprecated": false,
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
75
75
|
},
|
|
76
76
|
"typings": "index.d.ts",
|
|
77
|
-
"version": "26.
|
|
77
|
+
"version": "26.2.4",
|
|
78
78
|
"sideEffects": false
|
|
79
79
|
}
|
|
@@ -308,6 +308,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
308
308
|
}
|
|
309
309
|
else {
|
|
310
310
|
tempDate = getStartDateForWeek(startDate, ruleObject.day);
|
|
311
|
+
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < startDate.getDay()) {
|
|
312
|
+
tempDate.setDate(tempDate.getDate() + ((interval - 1) * 7));
|
|
313
|
+
}
|
|
311
314
|
while (compareDates(tempDate, endDate)) {
|
|
312
315
|
weekState = validateRules(tempDate, ruleObject);
|
|
313
316
|
if (weekState && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1)) {
|
|
@@ -24,6 +24,8 @@ export declare class DragAndDrop extends ActionBase {
|
|
|
24
24
|
private targetTd;
|
|
25
25
|
private isCursorAhead;
|
|
26
26
|
private dragArea;
|
|
27
|
+
private enableCurrentViewDrag;
|
|
28
|
+
private isPreventMultiDrag;
|
|
27
29
|
wireDragEvent(element: HTMLElement): void;
|
|
28
30
|
setDragArea(): void;
|
|
29
31
|
private dragHelper;
|
|
@@ -49,6 +49,8 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
49
49
|
_this.isAllDayTarget = false;
|
|
50
50
|
_this.targetTd = null;
|
|
51
51
|
_this.isCursorAhead = false;
|
|
52
|
+
_this.enableCurrentViewDrag = false;
|
|
53
|
+
_this.isPreventMultiDrag = false;
|
|
52
54
|
return _this;
|
|
53
55
|
}
|
|
54
56
|
DragAndDrop.prototype.wireDragEvent = function (element) {
|
|
@@ -164,6 +166,9 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
164
166
|
if (cloneBottom > scrollHeight) {
|
|
165
167
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
166
168
|
}
|
|
169
|
+
if (this.isPreventMultiDrag) {
|
|
170
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
171
|
+
}
|
|
167
172
|
}
|
|
168
173
|
return { left: leftValue, top: topValue };
|
|
169
174
|
};
|
|
@@ -215,6 +220,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
215
220
|
_this.actionObj.interval = dragEventArgs.interval;
|
|
216
221
|
_this.actionObj.navigation = dragEventArgs.navigation;
|
|
217
222
|
_this.actionObj.scroll = dragEventArgs.scroll;
|
|
223
|
+
_this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && _this.parent.allowMultiDrag;
|
|
218
224
|
_this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
219
225
|
var viewElement = _this.parent.element.querySelector('.' + cls.CONTENT_WRAP_CLASS);
|
|
220
226
|
_this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -375,6 +381,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
375
381
|
DragAndDrop.prototype.dragStop = function (e) {
|
|
376
382
|
var _this = this;
|
|
377
383
|
this.isCursorAhead = false;
|
|
384
|
+
this.isPreventMultiDrag = false;
|
|
378
385
|
this.removeCloneElementClasses();
|
|
379
386
|
this.removeCloneElement();
|
|
380
387
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -443,7 +450,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
443
450
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
444
451
|
this.timelineEventModule.getSlotDates();
|
|
445
452
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
446
|
-
|
|
453
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + cls.WORK_CELLS_CLASS));
|
|
447
454
|
this.calculateTimelineTime(e);
|
|
448
455
|
}
|
|
449
456
|
else {
|
|
@@ -620,7 +627,9 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
620
627
|
var dragStart;
|
|
621
628
|
var dragEnd;
|
|
622
629
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
623
|
-
this.
|
|
630
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
631
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
632
|
+
}
|
|
624
633
|
dragStart = this.parent.getDateFromElement(td);
|
|
625
634
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
626
635
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -677,18 +686,34 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
677
686
|
this.startTime = eventObj_1[this.parent.eventFields.startTime].getTime();
|
|
678
687
|
}
|
|
679
688
|
var startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
680
|
-
|
|
681
|
-
this.
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
var
|
|
686
|
-
|
|
687
|
-
|
|
689
|
+
if (this.enableCurrentViewDrag) {
|
|
690
|
+
var renderDates = this.getRenderedDates();
|
|
691
|
+
for (var i = 0; i < this.multiData.length; i++) {
|
|
692
|
+
var eventObj_2 = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
|
|
693
|
+
var startTime = new Date(eventObj_2[this.parent.eventFields.startTime].getTime() + startTimeDiff);
|
|
694
|
+
var dayIndex = this.parent.getIndexOfDate(renderDates, util.resetTime(startTime));
|
|
695
|
+
if (dayIndex < 0) {
|
|
696
|
+
this.isPreventMultiDrag = true;
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
this.isPreventMultiDrag = false;
|
|
688
700
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
701
|
+
}
|
|
702
|
+
if (!this.isPreventMultiDrag) {
|
|
703
|
+
for (var index_2 = 0; index_2 < this.multiData.length; index_2++) {
|
|
704
|
+
this.updatedData[parseInt(index_2.toString(), 10)] =
|
|
705
|
+
this.updateMultipleData(this.multiData[parseInt(index_2.toString(), 10)], startTimeDiff);
|
|
706
|
+
var dayIndex = this.getDayIndex(this.updatedData[parseInt(index_2.toString(), 10)]);
|
|
707
|
+
if (dayIndex >= 0) {
|
|
708
|
+
var isAllDay = this.updatedData[parseInt(index_2.toString(), 10)][this.parent.eventFields.isAllDay];
|
|
709
|
+
var wrapper = this.getEventWrapper(dayIndex, isAllDay);
|
|
710
|
+
this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
711
|
+
this.updateEventHeight(this.updatedData[parseInt(index_2.toString(), 10)], index_2, dayIndex);
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)].parentNode)) {
|
|
715
|
+
remove(this.actionObj.cloneElement[parseInt(index_2.toString(), 10)]);
|
|
716
|
+
}
|
|
692
717
|
}
|
|
693
718
|
}
|
|
694
719
|
}
|
|
@@ -906,6 +931,9 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
906
931
|
};
|
|
907
932
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
908
933
|
DragAndDrop.prototype.swapDragging = function (e) {
|
|
934
|
+
if (this.isPreventMultiDrag) {
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
909
937
|
var colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
910
938
|
if (closest(this.actionObj.target, '.' + cls.DATE_HEADER_WRAP_CLASS) &&
|
|
911
939
|
!closest(this.actionObj.clone, '.' + cls.ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -1031,7 +1059,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
1031
1059
|
util.getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
1032
1060
|
var offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
|
|
1033
1061
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
1034
|
-
offsetLeft = Math.
|
|
1062
|
+
offsetLeft = Math.round(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
1035
1063
|
var rightOffset;
|
|
1036
1064
|
if (this.parent.enableRtl) {
|
|
1037
1065
|
rightOffset = Math.abs(parseInt(this.actionObj.clone.style.right, 10));
|
|
@@ -1217,7 +1245,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
1217
1245
|
return 0;
|
|
1218
1246
|
};
|
|
1219
1247
|
DragAndDrop.prototype.getColumnIndex = function (offsetLeft) {
|
|
1220
|
-
var index = Math.
|
|
1248
|
+
var index = Math.round(offsetLeft / this.actionObj.cellWidth);
|
|
1221
1249
|
if (this.isHeaderRows) {
|
|
1222
1250
|
return index;
|
|
1223
1251
|
}
|
|
@@ -1262,7 +1290,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
1262
1290
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
1263
1291
|
var rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
1264
1292
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
1265
|
-
util.getElementTop(dragArea)) / rowHeight);
|
|
1293
|
+
util.getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
1266
1294
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
1267
1295
|
this.actionObj.index = rowIndex;
|
|
1268
1296
|
var eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -1278,7 +1306,7 @@ var DragAndDrop = /** @class */ (function (_super) {
|
|
|
1278
1306
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
1279
1307
|
return;
|
|
1280
1308
|
}
|
|
1281
|
-
var top =
|
|
1309
|
+
var top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
1282
1310
|
if (this.parent.rowAutoHeight) {
|
|
1283
1311
|
var cursorElement = this.getCursorElement(e);
|
|
1284
1312
|
if (cursorElement) {
|
|
@@ -86,8 +86,8 @@ var Resize = /** @class */ (function (_super) {
|
|
|
86
86
|
};
|
|
87
87
|
_this.actionObj.groupIndex = _this.parent.uiStateValues.isGroupAdaptive ? _this.parent.uiStateValues.groupIndex : 0;
|
|
88
88
|
var workCell = _this.parent.element.querySelector('.' + cls.WORK_CELLS_CLASS);
|
|
89
|
-
_this.actionObj.cellWidth =
|
|
90
|
-
_this.actionObj.cellHeight =
|
|
89
|
+
_this.actionObj.cellWidth = _this.parent.getElementWidth(workCell);
|
|
90
|
+
_this.actionObj.cellHeight = _this.parent.getElementHeight(workCell);
|
|
91
91
|
var hRows = _this.parent.activeViewOptions.headerRows.map(function (row) { return row.option; });
|
|
92
92
|
if (_this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
93
93
|
var tr = _this.parent.getContentTable().querySelector('tr');
|
|
@@ -397,10 +397,10 @@ var Resize = /** @class */ (function (_super) {
|
|
|
397
397
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
398
398
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
399
399
|
if (!isLeft) {
|
|
400
|
-
offsetValue += (
|
|
400
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
401
401
|
}
|
|
402
|
-
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (
|
|
403
|
-
Math.floor(offsetValue / Math.floor(
|
|
402
|
+
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
|
|
403
|
+
Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
|
|
404
404
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
405
405
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
406
406
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -409,7 +409,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
409
409
|
else {
|
|
410
410
|
var cellWidth = this.actionObj.cellWidth;
|
|
411
411
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
412
|
-
Math.ceil((offset + (
|
|
412
|
+
Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
413
413
|
if (this.parent.enableRtl) {
|
|
414
414
|
var cellOffsetWidth = 0;
|
|
415
415
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -417,7 +417,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
417
417
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
418
418
|
}
|
|
419
419
|
var offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
420
|
-
this.actionObj.cellWidth) + (isLeft ? 0 :
|
|
420
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
421
421
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
422
422
|
}
|
|
423
423
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -436,7 +436,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
438
|
if (!isLeft) {
|
|
439
|
-
offset +=
|
|
439
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
440
440
|
}
|
|
441
441
|
var spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
442
442
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -448,9 +448,9 @@ var Resize = /** @class */ (function (_super) {
|
|
|
448
448
|
}
|
|
449
449
|
else {
|
|
450
450
|
var cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
451
|
-
var originalWidth = Math.ceil((isLeft ?
|
|
451
|
+
var originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
452
452
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
453
|
-
var noOfDays = Math.ceil((
|
|
453
|
+
var noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
454
454
|
this.actionObj.cellWidth);
|
|
455
455
|
var tr = closest(this.actionObj.clone, 'tr');
|
|
456
456
|
var dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -513,9 +513,9 @@ var Resize = /** @class */ (function (_super) {
|
|
|
513
513
|
var slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
514
514
|
var pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
515
515
|
var targetWidth = isTimelineView ?
|
|
516
|
-
(
|
|
517
|
-
this.parent.currentView === 'Month' ?
|
|
518
|
-
Math.ceil(
|
|
516
|
+
(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
517
|
+
this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
|
|
518
|
+
Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
519
519
|
var offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
520
520
|
var left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
521
521
|
if (isTimeViews) {
|
|
@@ -530,7 +530,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
530
530
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
531
531
|
}
|
|
532
532
|
var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
533
|
-
|
|
533
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
534
534
|
if (this.parent.enableRtl) {
|
|
535
535
|
var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
536
536
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -544,7 +544,7 @@ var Resize = /** @class */ (function (_super) {
|
|
|
544
544
|
}
|
|
545
545
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
546
546
|
styles.right = formatUnit(rightValue);
|
|
547
|
-
width = width + rightValue > this.scrollArgs.width ?
|
|
547
|
+
width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
|
|
548
548
|
}
|
|
549
549
|
else {
|
|
550
550
|
var offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -552,12 +552,12 @@ var Resize = /** @class */ (function (_super) {
|
|
|
552
552
|
if (isTimelineView) {
|
|
553
553
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
554
554
|
if (this.parent.enableRtl) {
|
|
555
|
-
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X -
|
|
555
|
+
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
|
|
556
556
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
557
557
|
}
|
|
558
558
|
else {
|
|
559
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X +
|
|
560
|
-
|
|
559
|
+
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
|
|
560
|
+
this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
561
561
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -573,10 +573,10 @@ var Resize = /** @class */ (function (_super) {
|
|
|
573
573
|
}
|
|
574
574
|
else {
|
|
575
575
|
offsetLeft = 0;
|
|
576
|
-
width =
|
|
576
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
var cloneWidth = Math.ceil(
|
|
579
|
+
var cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
580
580
|
this.actionObj.cellWidth;
|
|
581
581
|
if (isLeft) {
|
|
582
582
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -125,6 +125,7 @@ var ScheduleTouch = /** @class */ (function () {
|
|
|
125
125
|
this.parent.selectedElements = [];
|
|
126
126
|
this.parent.eventBase.getSelectedEventElements(target);
|
|
127
127
|
if (this.parent.resizeModule && closest(e.originalEvent.target, '.' + cls.EVENT_RESIZE_CLASS)) {
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
129
|
this.parent.resizeModule.resizeStart(e.originalEvent);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -16,6 +16,7 @@ export declare class VirtualScroll {
|
|
|
16
16
|
isHorizontalScroll: boolean;
|
|
17
17
|
isRemoteRefresh: boolean;
|
|
18
18
|
private startIndex;
|
|
19
|
+
existingDataCollection: TdData[];
|
|
19
20
|
constructor(parent: Schedule);
|
|
20
21
|
private addEventListener;
|
|
21
22
|
private removeEventListener;
|
|
@@ -40,6 +41,9 @@ export declare class VirtualScroll {
|
|
|
40
41
|
private setStartEndIndex;
|
|
41
42
|
updateContent(resWrap: HTMLElement, conWrap: HTMLElement, eventWrap: HTMLElement, resCollection: TdData[]): void;
|
|
42
43
|
private updateHorizontalContent;
|
|
44
|
+
private updateMonthViewContent;
|
|
45
|
+
private updateOtherViewContent;
|
|
46
|
+
private mergeNewTdData;
|
|
43
47
|
private getBufferCollection;
|
|
44
48
|
private setTranslate;
|
|
45
49
|
updateFocusedWorkCell(): void;
|
|
@@ -14,6 +14,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
14
14
|
this.renderedLength = 0;
|
|
15
15
|
this.averageRowHeight = 0;
|
|
16
16
|
this.startIndex = 0;
|
|
17
|
+
this.existingDataCollection = [];
|
|
17
18
|
this.parent = parent;
|
|
18
19
|
this.addEventListener();
|
|
19
20
|
}
|
|
@@ -86,10 +87,10 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
86
87
|
};
|
|
87
88
|
VirtualScroll.prototype.setItemSize = function () {
|
|
88
89
|
if (this.isHorizontalScroll) {
|
|
89
|
-
this.itemSize = util.getElementWidthFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS) || this.itemSize;
|
|
90
|
+
this.itemSize = util.getElementWidthFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
92
|
-
this.itemSize =
|
|
93
|
+
this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, cls.WORK_CELLS_CLASS) || this.itemSize;
|
|
93
94
|
}
|
|
94
95
|
};
|
|
95
96
|
VirtualScroll.prototype.refreshLayout = function () {
|
|
@@ -373,43 +374,91 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
373
374
|
append(eventRows, eventWrap);
|
|
374
375
|
};
|
|
375
376
|
VirtualScroll.prototype.updateHorizontalContent = function (conWrap, resCollection) {
|
|
377
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
376
378
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
377
379
|
var selectedEle = this.parent.getSelectedCells();
|
|
378
380
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
379
|
-
var
|
|
381
|
+
var tbody = conWrap.querySelector('tbody');
|
|
382
|
+
var renderedRows = Array.from(tbody.querySelectorAll('tr'));
|
|
383
|
+
if (this.parent.currentView === 'Month') {
|
|
384
|
+
this.updateMonthViewContent(conWrap, resCollection);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
this.updateOtherViewContent(conWrap, resCollection, renderedRows);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
VirtualScroll.prototype.updateMonthViewContent = function (conWrap, resCollection) {
|
|
391
|
+
var renderedLength = conWrap.querySelectorAll(' tr').length;
|
|
380
392
|
for (var i = 0; i < renderedLength; i++) {
|
|
381
393
|
remove(conWrap.querySelector('tbody tr'));
|
|
382
394
|
}
|
|
383
|
-
if (this.parent.
|
|
384
|
-
|
|
385
|
-
this.parent.activeView.colLevels[0] = resCollection;
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
389
|
-
}
|
|
390
|
-
var contentRows = this.parent.activeView.getContentRows();
|
|
391
|
-
append(contentRows, conWrap.querySelector('tbody'));
|
|
395
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
396
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
392
397
|
}
|
|
393
398
|
else {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
399
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
400
|
+
}
|
|
401
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
402
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
403
|
+
};
|
|
404
|
+
VirtualScroll.prototype.updateOtherViewContent = function (conWrap, resCollection, renderedRows) {
|
|
405
|
+
var tbody = conWrap.querySelector('tbody');
|
|
406
|
+
var colGroup = conWrap.querySelector('colgroup');
|
|
407
|
+
var thead = conWrap.querySelector('thead');
|
|
408
|
+
var table = conWrap.querySelector('table');
|
|
409
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
410
|
+
var newGroupIndices = new Set(resCollection.map(function (data) { return data.groupIndex; }));
|
|
411
|
+
renderedRows.forEach(function (row) {
|
|
412
|
+
var tdElements = row.querySelectorAll('td');
|
|
413
|
+
tdElements.forEach(function (td) {
|
|
414
|
+
var groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
415
|
+
if (!newGroupIndices.has(groupIndex)) {
|
|
416
|
+
td.remove();
|
|
417
|
+
}
|
|
405
418
|
});
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
419
|
+
});
|
|
420
|
+
var col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
421
|
+
for (var i = 0; i < col.length; i++) {
|
|
422
|
+
remove(col[parseInt(i.toString(), 10)]);
|
|
423
|
+
}
|
|
424
|
+
resCollection.forEach(function () { return colGroup.appendChild(createElement('col')); });
|
|
425
|
+
var tHead = [].slice.call(conWrap.querySelector('thead').children);
|
|
426
|
+
for (var i = 0; i < tHead.length; i++) {
|
|
427
|
+
remove(tHead[parseInt(i.toString(), 10)]);
|
|
412
428
|
}
|
|
429
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
430
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
431
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
432
|
+
}
|
|
433
|
+
prepend([thead], table);
|
|
434
|
+
var contentRows = this.parent.activeView.getContentRows();
|
|
435
|
+
this.mergeNewTdData(tbody, contentRows);
|
|
436
|
+
};
|
|
437
|
+
VirtualScroll.prototype.mergeNewTdData = function (tbody, contentRows) {
|
|
438
|
+
var existingRows = Array.from(tbody.querySelectorAll('tr'));
|
|
439
|
+
existingRows.forEach(function (existingRow, rowIndex) {
|
|
440
|
+
if (rowIndex < contentRows.length) {
|
|
441
|
+
var newRow = contentRows[parseInt(rowIndex.toString(), 10)];
|
|
442
|
+
var existingTds_1 = Array.from(existingRow.querySelectorAll('td'));
|
|
443
|
+
var newTds = Array.from(newRow.querySelectorAll('td'));
|
|
444
|
+
newTds.forEach(function (newTd) {
|
|
445
|
+
var newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
|
|
446
|
+
var inserted = false;
|
|
447
|
+
for (var _i = 0, existingTds_2 = existingTds_1; _i < existingTds_2.length; _i++) {
|
|
448
|
+
var existingTd = existingTds_2[_i];
|
|
449
|
+
var existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
|
|
450
|
+
if (newGroupIndex < existingGroupIndex) {
|
|
451
|
+
existingRow.insertBefore(newTd, existingTd);
|
|
452
|
+
inserted = true;
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (!inserted) {
|
|
457
|
+
existingRow.appendChild(newTd);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
});
|
|
413
462
|
};
|
|
414
463
|
VirtualScroll.prototype.getBufferCollection = function (startIndex, endIndex) {
|
|
415
464
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -247,6 +247,8 @@ export interface DragEventArgs extends BaseEventArgs {
|
|
|
247
247
|
scroll?: ScrollOptions;
|
|
248
248
|
/** Defines the date range navigation action while dragging. */
|
|
249
249
|
navigation?: NavigateOptions;
|
|
250
|
+
/** Allows to drag the events outside the currently rendered date range */
|
|
251
|
+
dragWithinRange?: boolean;
|
|
250
252
|
}
|
|
251
253
|
/** An interface that holds options of virtual scroll action. */
|
|
252
254
|
export interface ScrollEventArgs extends BaseEventArgs {
|
|
@@ -525,6 +527,7 @@ export interface UIStateArgs {
|
|
|
525
527
|
scheduleHeight?: number;
|
|
526
528
|
isTapHold?: boolean;
|
|
527
529
|
isTouchScroll?: boolean;
|
|
530
|
+
isTransformed?: boolean;
|
|
528
531
|
}
|
|
529
532
|
/**
|
|
530
533
|
* @private
|
|
@@ -918,6 +918,31 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
|
|
|
918
918
|
render(): void;
|
|
919
919
|
private renderTableContainer;
|
|
920
920
|
getEventTemplateName(resIndex: number): string;
|
|
921
|
+
/**
|
|
922
|
+
* Method to get element width
|
|
923
|
+
*
|
|
924
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
925
|
+
* @returns {number} Returns the width of the given element
|
|
926
|
+
* @private
|
|
927
|
+
*/
|
|
928
|
+
getElementWidth(element: HTMLElement): number;
|
|
929
|
+
/**
|
|
930
|
+
* Method to get element height
|
|
931
|
+
*
|
|
932
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
933
|
+
* @returns {number} Returns the Height of the given element
|
|
934
|
+
* @private
|
|
935
|
+
*/
|
|
936
|
+
getElementHeight(element: HTMLElement): number;
|
|
937
|
+
/**
|
|
938
|
+
* Method to get height from element
|
|
939
|
+
*
|
|
940
|
+
* @param {Element} element Accepts the DOM element
|
|
941
|
+
* @param {string} elementClass Accepts the element class
|
|
942
|
+
* @returns {number} Returns the height of the element
|
|
943
|
+
* @private
|
|
944
|
+
*/
|
|
945
|
+
getElementHeightFromClass(element: Element, elementClass: string): number;
|
|
921
946
|
/**
|
|
922
947
|
* Method to render react templates
|
|
923
948
|
*
|
|
@@ -148,6 +148,37 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
148
148
|
}
|
|
149
149
|
return templateName;
|
|
150
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* Method to get element width
|
|
153
|
+
*
|
|
154
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
155
|
+
* @returns {number} Returns the width of the given element
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
Schedule.prototype.getElementWidth = function (element) {
|
|
159
|
+
return util.getElementWidth(element, this.uiStateValues.isTransformed);
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Method to get element height
|
|
163
|
+
*
|
|
164
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
165
|
+
* @returns {number} Returns the Height of the given element
|
|
166
|
+
* @private
|
|
167
|
+
*/
|
|
168
|
+
Schedule.prototype.getElementHeight = function (element) {
|
|
169
|
+
return util.getElementHeight(element, this.uiStateValues.isTransformed);
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Method to get height from element
|
|
173
|
+
*
|
|
174
|
+
* @param {Element} element Accepts the DOM element
|
|
175
|
+
* @param {string} elementClass Accepts the element class
|
|
176
|
+
* @returns {number} Returns the height of the element
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
Schedule.prototype.getElementHeightFromClass = function (element, elementClass) {
|
|
180
|
+
return util.getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
|
|
181
|
+
};
|
|
151
182
|
/**
|
|
152
183
|
* Method to render react templates
|
|
153
184
|
*
|
|
@@ -228,6 +259,7 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
228
259
|
this.headerModule = new HeaderRenderer(this);
|
|
229
260
|
}
|
|
230
261
|
this.renderTableContainer();
|
|
262
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
231
263
|
if (Browser.isDevice || Browser.isTouch) {
|
|
232
264
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
233
265
|
}
|
|
@@ -731,7 +763,7 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
731
763
|
this.uiStateValues = {
|
|
732
764
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
733
765
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
734
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
766
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
735
767
|
};
|
|
736
768
|
}
|
|
737
769
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -2124,6 +2156,9 @@ var Schedule = /** @class */ (function (_super) {
|
|
|
2124
2156
|
* @returns {void}
|
|
2125
2157
|
*/
|
|
2126
2158
|
Schedule.prototype.scrollTo = function (hour, scrollDate) {
|
|
2159
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2127
2162
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
2128
2163
|
this.activeView.scrollToDate(scrollDate);
|
|
2129
2164
|
}
|