@syncfusion/ej2-schedule 26.1.39 → 26.1.41-16103
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/.eslintrc.json +243 -260
- package/README.md +82 -82
- package/dist/ej2-schedule.umd.min.js +1 -10
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +605 -249
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +1072 -709
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/helpers/e2e/index.js +3 -3
- package/helpers/e2e/recurrence-editor.js +13 -13
- package/helpers/e2e/schedule.js +13 -13
- package/license +9 -9
- package/package.json +79 -79
- package/src/recurrence-editor/date-generator.js +3 -0
- package/src/recurrence-editor/recurrence-editor-model.d.ts +65 -65
- package/src/recurrence-editor/recurrence-editor.js +19 -19
- package/src/schedule/actions/crud.js +22 -6
- package/src/schedule/actions/drag.d.ts +4 -0
- package/src/schedule/actions/drag.js +73 -34
- package/src/schedule/actions/keyboard.d.ts +1 -0
- package/src/schedule/actions/keyboard.js +45 -3
- package/src/schedule/actions/resize.js +34 -32
- package/src/schedule/actions/touch.js +4 -0
- package/src/schedule/actions/virtual-scroll.d.ts +6 -0
- package/src/schedule/actions/virtual-scroll.js +119 -34
- package/src/schedule/base/interface.d.ts +6 -2
- package/src/schedule/base/resource.js +5 -0
- package/src/schedule/base/schedule-model.d.ts +805 -805
- package/src/schedule/base/schedule.d.ts +26 -0
- package/src/schedule/base/schedule.js +63 -21
- package/src/schedule/base/util.d.ts +10 -5
- package/src/schedule/base/util.js +15 -10
- package/src/schedule/event-renderer/agenda-base.js +15 -14
- package/src/schedule/event-renderer/event-base.js +18 -3
- package/src/schedule/event-renderer/inline-edit.js +13 -5
- package/src/schedule/event-renderer/month.js +20 -17
- package/src/schedule/event-renderer/timeline-view.js +21 -18
- package/src/schedule/event-renderer/vertical-view.d.ts +2 -1
- package/src/schedule/event-renderer/vertical-view.js +66 -34
- package/src/schedule/event-renderer/year.js +20 -20
- package/src/schedule/exports/print.js +1 -0
- package/src/schedule/models/event-settings-model.d.ts +155 -155
- package/src/schedule/models/event-settings.js +19 -19
- package/src/schedule/models/field-options-model.d.ts +22 -22
- package/src/schedule/models/field-options.js +19 -19
- package/src/schedule/models/fields-model.d.ts +92 -92
- package/src/schedule/models/fields.js +19 -19
- package/src/schedule/models/group-model.d.ts +48 -48
- package/src/schedule/models/group.js +19 -19
- package/src/schedule/models/header-rows-model.d.ts +22 -22
- package/src/schedule/models/header-rows.js +19 -19
- package/src/schedule/models/quick-info-templates-model.d.ts +37 -37
- package/src/schedule/models/quick-info-templates.js +19 -19
- package/src/schedule/models/resources-model.d.ts +85 -85
- package/src/schedule/models/resources.js +19 -19
- package/src/schedule/models/time-scale-model.d.ts +40 -40
- package/src/schedule/models/time-scale.js +19 -19
- package/src/schedule/models/toolbar-model.d.ts +187 -187
- package/src/schedule/models/toolbar.js +19 -19
- package/src/schedule/models/views-model.d.ts +329 -329
- package/src/schedule/models/views.js +19 -19
- package/src/schedule/models/work-hours-model.d.ts +16 -16
- package/src/schedule/models/work-hours.js +19 -19
- package/src/schedule/popups/event-tooltip.js +2 -1
- package/src/schedule/popups/event-window.d.ts +1 -0
- package/src/schedule/popups/event-window.js +25 -15
- package/src/schedule/renderer/agenda.js +13 -13
- package/src/schedule/renderer/day.js +13 -13
- package/src/schedule/renderer/header-renderer.d.ts +1 -0
- package/src/schedule/renderer/header-renderer.js +20 -12
- package/src/schedule/renderer/month-agenda.js +13 -13
- package/src/schedule/renderer/month.js +19 -13
- package/src/schedule/renderer/timeline-header-row.js +1 -1
- package/src/schedule/renderer/timeline-month.js +13 -13
- package/src/schedule/renderer/timeline-view.js +22 -17
- package/src/schedule/renderer/timeline-year.js +19 -15
- package/src/schedule/renderer/vertical-view.js +33 -23
- package/src/schedule/renderer/view-base.d.ts +1 -0
- package/src/schedule/renderer/view-base.js +14 -1
- package/src/schedule/renderer/week.js +13 -13
- package/src/schedule/renderer/work-week.js +13 -13
- package/src/schedule/renderer/year.js +17 -17
- package/styles/bootstrap-dark-lite.css +4174 -0
- package/styles/bootstrap-dark-lite.scss +18 -0
- package/styles/bootstrap-dark.css +823 -595
- package/styles/bootstrap-dark.scss +3 -2
- package/styles/bootstrap-lite.css +4169 -0
- package/styles/bootstrap-lite.scss +18 -0
- package/styles/bootstrap.css +823 -595
- package/styles/bootstrap.scss +3 -2
- package/styles/bootstrap4-lite.css +4216 -0
- package/styles/bootstrap4-lite.scss +18 -0
- package/styles/bootstrap4.css +809 -636
- package/styles/bootstrap4.scss +3 -2
- package/styles/bootstrap5-dark-lite.css +4215 -0
- package/styles/bootstrap5-dark-lite.scss +18 -0
- package/styles/bootstrap5-dark.css +824 -596
- package/styles/bootstrap5-dark.scss +3 -2
- package/styles/bootstrap5-lite.css +4215 -0
- package/styles/bootstrap5-lite.scss +18 -0
- package/styles/bootstrap5.3-lite.css +4261 -0
- package/styles/bootstrap5.3-lite.scss +18 -0
- package/styles/bootstrap5.3.css +5023 -0
- package/styles/bootstrap5.3.scss +20 -0
- package/styles/bootstrap5.css +824 -596
- package/styles/bootstrap5.scss +3 -2
- package/styles/fabric-dark-lite.css +4144 -0
- package/styles/fabric-dark-lite.scss +18 -0
- package/styles/fabric-dark.css +830 -594
- package/styles/fabric-dark.scss +3 -2
- package/styles/fabric-lite.css +4141 -0
- package/styles/fabric-lite.scss +18 -0
- package/styles/fabric.css +830 -587
- package/styles/fabric.scss +3 -2
- package/styles/fluent-dark-lite.css +4207 -0
- package/styles/fluent-dark-lite.scss +18 -0
- package/styles/fluent-dark.css +828 -592
- package/styles/fluent-dark.scss +3 -2
- package/styles/fluent-lite.css +4207 -0
- package/styles/fluent-lite.scss +18 -0
- package/styles/fluent.css +828 -592
- package/styles/fluent.scss +3 -2
- package/styles/fluent2-lite.css +4427 -0
- package/styles/fluent2-lite.scss +18 -0
- package/styles/fluent2.css +863 -1627
- package/styles/fluent2.scss +3 -2
- package/styles/highcontrast-light-lite.css +4233 -0
- package/styles/highcontrast-light-lite.scss +18 -0
- package/styles/highcontrast-light.css +833 -583
- package/styles/highcontrast-light.scss +3 -2
- package/styles/highcontrast-lite.css +4242 -0
- package/styles/highcontrast-lite.scss +18 -0
- package/styles/highcontrast.css +834 -584
- package/styles/highcontrast.scss +3 -2
- package/styles/material-dark-lite.css +4221 -0
- package/styles/material-dark-lite.scss +18 -0
- package/styles/material-dark.css +839 -581
- package/styles/material-dark.scss +3 -2
- package/styles/material-lite.css +4247 -0
- package/styles/material-lite.scss +18 -0
- package/styles/material.css +836 -599
- package/styles/material.scss +3 -2
- package/styles/material3-dark-lite.css +4238 -0
- package/styles/material3-dark-lite.scss +18 -0
- package/styles/material3-dark.css +832 -656
- package/styles/material3-dark.scss +4 -3
- package/styles/material3-lite.css +4240 -0
- package/styles/material3-lite.scss +18 -0
- package/styles/material3.css +831 -709
- package/styles/material3.scss +4 -3
- package/styles/recurrence-editor/_all.scss +2 -2
- package/styles/recurrence-editor/_bds-definition.scss +14 -14
- package/styles/recurrence-editor/_bigger.scss +134 -0
- package/styles/recurrence-editor/_bootstrap-dark-definition.scss +14 -14
- package/styles/recurrence-editor/_bootstrap-definition.scss +14 -14
- package/styles/recurrence-editor/_bootstrap4-definition.scss +14 -14
- package/styles/recurrence-editor/_bootstrap5-definition.scss +14 -14
- package/styles/recurrence-editor/_bootstrap5.3-definition.scss +14 -14
- package/styles/recurrence-editor/_fabric-dark-definition.scss +14 -14
- package/styles/recurrence-editor/_fabric-definition.scss +14 -14
- package/styles/recurrence-editor/_fluent-definition.scss +14 -14
- package/styles/recurrence-editor/_fluent2-definition.scss +14 -14
- package/styles/recurrence-editor/_fusionnew-definition.scss +14 -14
- package/styles/recurrence-editor/_highcontrast-definition.scss +14 -14
- package/styles/recurrence-editor/_highcontrast-light-definition.scss +14 -14
- package/styles/recurrence-editor/_layout.scss +415 -525
- package/styles/recurrence-editor/_material-dark-definition.scss +14 -14
- package/styles/recurrence-editor/_material-definition.scss +14 -14
- package/styles/recurrence-editor/_material3-definition.scss +14 -14
- package/styles/recurrence-editor/_tailwind-definition.scss +14 -14
- package/styles/recurrence-editor/_theme.scss +1 -1
- package/styles/recurrence-editor/bootstrap-dark.css +87 -131
- package/styles/recurrence-editor/bootstrap-dark.scss +1 -0
- package/styles/recurrence-editor/bootstrap.css +87 -131
- package/styles/recurrence-editor/bootstrap.scss +1 -0
- package/styles/recurrence-editor/bootstrap4.css +87 -149
- package/styles/recurrence-editor/bootstrap4.scss +1 -0
- package/styles/recurrence-editor/bootstrap5-dark.css +87 -135
- package/styles/recurrence-editor/bootstrap5-dark.scss +1 -0
- package/styles/recurrence-editor/bootstrap5.3.css +501 -0
- package/styles/recurrence-editor/bootstrap5.3.scss +9 -0
- package/styles/recurrence-editor/bootstrap5.css +87 -135
- package/styles/recurrence-editor/bootstrap5.scss +1 -0
- package/styles/recurrence-editor/fabric-dark.css +87 -130
- package/styles/recurrence-editor/fabric-dark.scss +1 -0
- package/styles/recurrence-editor/fabric.css +87 -123
- package/styles/recurrence-editor/fabric.scss +1 -0
- package/styles/recurrence-editor/fluent-dark.css +87 -122
- package/styles/recurrence-editor/fluent-dark.scss +1 -0
- package/styles/recurrence-editor/fluent.css +87 -122
- package/styles/recurrence-editor/fluent.scss +1 -0
- package/styles/recurrence-editor/fluent2.css +94 -1148
- package/styles/recurrence-editor/fluent2.scss +1 -0
- package/styles/recurrence-editor/highcontrast-light.css +87 -118
- package/styles/recurrence-editor/highcontrast-light.scss +1 -0
- package/styles/recurrence-editor/highcontrast.css +87 -118
- package/styles/recurrence-editor/highcontrast.scss +1 -0
- package/styles/recurrence-editor/material-dark.css +87 -115
- package/styles/recurrence-editor/material-dark.scss +1 -0
- package/styles/recurrence-editor/material.css +87 -136
- package/styles/recurrence-editor/material.scss +1 -0
- package/styles/recurrence-editor/material3-dark.css +88 -194
- package/styles/recurrence-editor/material3-dark.scss +2 -1
- package/styles/recurrence-editor/material3.css +89 -249
- package/styles/recurrence-editor/material3.scss +2 -1
- package/styles/recurrence-editor/tailwind-dark.css +87 -116
- package/styles/recurrence-editor/tailwind-dark.scss +1 -0
- package/styles/recurrence-editor/tailwind.css +87 -116
- package/styles/recurrence-editor/tailwind.scss +1 -0
- package/styles/schedule/_all.scss +2 -2
- package/styles/schedule/_bds-definition.scss +272 -272
- package/styles/schedule/_bigger.scss +810 -0
- package/styles/schedule/_bootstrap-dark-definition.scss +270 -270
- package/styles/schedule/_bootstrap-definition.scss +270 -270
- package/styles/schedule/_bootstrap4-definition.scss +273 -273
- package/styles/schedule/_bootstrap5-definition.scss +274 -274
- package/styles/schedule/_bootstrap5.3-definition.scss +276 -273
- package/styles/schedule/_fabric-dark-definition.scss +271 -271
- package/styles/schedule/_fabric-definition.scss +270 -270
- package/styles/schedule/_fluent-definition.scss +276 -276
- package/styles/schedule/_fluent2-definition.scss +273 -273
- package/styles/schedule/_fusionnew-definition.scss +273 -273
- package/styles/schedule/_highcontrast-definition.scss +271 -271
- package/styles/schedule/_highcontrast-light-definition.scss +271 -271
- package/styles/schedule/_layout.scss +3787 -4218
- package/styles/schedule/_material-dark-definition.scss +270 -270
- package/styles/schedule/_material-definition.scss +270 -270
- package/styles/schedule/_material3-definition.scss +275 -275
- package/styles/schedule/_tailwind-definition.scss +271 -271
- package/styles/schedule/_theme.scss +589 -567
- package/styles/schedule/bootstrap-dark.css +706 -484
- package/styles/schedule/bootstrap-dark.scss +1 -0
- package/styles/schedule/bootstrap.css +706 -484
- package/styles/schedule/bootstrap.scss +1 -0
- package/styles/schedule/bootstrap4.css +699 -532
- package/styles/schedule/bootstrap4.scss +1 -0
- package/styles/schedule/bootstrap5-dark.css +714 -492
- package/styles/schedule/bootstrap5-dark.scss +1 -0
- package/styles/schedule/bootstrap5.3.css +4621 -0
- package/styles/schedule/bootstrap5.3.scss +17 -0
- package/styles/schedule/bootstrap5.css +714 -492
- package/styles/schedule/bootstrap5.scss +1 -0
- package/styles/schedule/fabric-dark.css +713 -483
- package/styles/schedule/fabric-dark.scss +1 -0
- package/styles/schedule/fabric.css +713 -476
- package/styles/schedule/fabric.scss +1 -0
- package/styles/schedule/fluent-dark.css +723 -493
- package/styles/schedule/fluent-dark.scss +1 -0
- package/styles/schedule/fluent.css +723 -493
- package/styles/schedule/fluent.scss +1 -0
- package/styles/schedule/fluent2.css +752 -1525
- package/styles/schedule/fluent2.scss +1 -0
- package/styles/schedule/highcontrast-light.css +721 -477
- package/styles/schedule/highcontrast-light.scss +1 -0
- package/styles/schedule/highcontrast.css +721 -477
- package/styles/schedule/highcontrast.scss +1 -0
- package/styles/schedule/icons/_bds.scss +220 -220
- package/styles/schedule/icons/_bootstrap-dark.scss +223 -223
- package/styles/schedule/icons/_bootstrap.scss +223 -223
- package/styles/schedule/icons/_bootstrap4.scss +217 -217
- package/styles/schedule/icons/_bootstrap5.3.scss +220 -220
- package/styles/schedule/icons/_bootstrap5.scss +220 -220
- package/styles/schedule/icons/_fabric-dark.scss +223 -223
- package/styles/schedule/icons/_fabric.scss +223 -223
- package/styles/schedule/icons/_fluent.scss +220 -220
- package/styles/schedule/icons/_fluent2.scss +220 -220
- package/styles/schedule/icons/_fusionnew.scss +220 -220
- package/styles/schedule/icons/_highcontrast-light.scss +223 -223
- package/styles/schedule/icons/_highcontrast.scss +223 -223
- package/styles/schedule/icons/_material-dark.scss +223 -223
- package/styles/schedule/icons/_material.scss +223 -223
- package/styles/schedule/icons/_material3.scss +220 -220
- package/styles/schedule/icons/_tailwind.scss +220 -220
- package/styles/schedule/material-dark.css +732 -480
- package/styles/schedule/material-dark.scss +1 -0
- package/styles/schedule/material.css +729 -498
- package/styles/schedule/material.scss +1 -0
- package/styles/schedule/material3-dark.css +713 -543
- package/styles/schedule/material3-dark.scss +2 -1
- package/styles/schedule/material3.css +714 -598
- package/styles/schedule/material3.scss +2 -1
- package/styles/schedule/tailwind-dark.css +725 -484
- package/styles/schedule/tailwind-dark.scss +1 -0
- package/styles/schedule/tailwind.css +725 -484
- package/styles/schedule/tailwind.scss +1 -0
- package/styles/tailwind-dark-lite.css +4184 -0
- package/styles/tailwind-dark-lite.scss +18 -0
- package/styles/tailwind-dark.css +832 -585
- package/styles/tailwind-dark.scss +3 -2
- package/styles/tailwind-lite.css +4184 -0
- package/styles/tailwind-lite.scss +18 -0
- package/styles/tailwind.css +832 -585
- package/styles/tailwind.scss +3 -2
- package/dist/ej2-schedule.min.js +0 -10
- package/dist/global/ej2-schedule.min.js +0 -11
- package/dist/global/ej2-schedule.min.js.map +0 -1
- package/dist/global/index.d.ts +0 -14
- package/tslint.json +0 -111
|
@@ -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
|
/**
|
|
@@ -1079,10 +1084,12 @@ class HeaderRenderer {
|
|
|
1079
1084
|
items: args.items,
|
|
1080
1085
|
overflowMode: 'Popup',
|
|
1081
1086
|
clicked: this.toolbarClickHandler.bind(this),
|
|
1087
|
+
created: this.toolbarCreateHandler.bind(this),
|
|
1082
1088
|
enableRtl: this.parent.enableRtl,
|
|
1083
1089
|
enableHtmlSanitizer: this.parent.enableHtmlSanitizer,
|
|
1084
1090
|
locale: this.parent.locale
|
|
1085
1091
|
});
|
|
1092
|
+
this.toolbarObj.isStringTemplate = true;
|
|
1086
1093
|
this.toolbarObj.root = this.parent.root ? this.parent.root : this.parent;
|
|
1087
1094
|
this.toolbarObj.appendTo(this.parent.element.querySelector('.' + HEADER_TOOLBAR));
|
|
1088
1095
|
this.toolbarObj.element.setAttribute('aria-label', 'Scheduler');
|
|
@@ -1511,6 +1518,12 @@ class HeaderRenderer {
|
|
|
1511
1518
|
const views = [].slice.call(this.element.querySelectorAll('.e-views'));
|
|
1512
1519
|
return views.indexOf(target);
|
|
1513
1520
|
}
|
|
1521
|
+
toolbarCreateHandler() {
|
|
1522
|
+
if (this.parent && this.parent.portals && this.toolbarObj && this.toolbarObj.portals) {
|
|
1523
|
+
this.parent.portals = this.parent.portals.concat(this.toolbarObj.portals);
|
|
1524
|
+
this.parent['renderReactTemplates']();
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1514
1527
|
toolbarClickHandler(args) {
|
|
1515
1528
|
if (!args.item) {
|
|
1516
1529
|
return;
|
|
@@ -1654,7 +1667,7 @@ class HeaderRenderer {
|
|
|
1654
1667
|
let firstDate = new Date(dates[0].getTime());
|
|
1655
1668
|
let lastDate = new Date(dates[dates.length - 1].getTime());
|
|
1656
1669
|
if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'TimelineWorkWeek') {
|
|
1657
|
-
firstDate = getWeekFirstDate(resetTime(this.parent.selectedDate), this.parent.firstDayOfWeek);
|
|
1670
|
+
firstDate = getWeekFirstDate(resetTime(this.parent.selectedDate), this.parent.activeViewOptions.firstDayOfWeek);
|
|
1658
1671
|
lastDate = addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
|
|
1659
1672
|
}
|
|
1660
1673
|
else if (this.parent.currentView === 'Month') {
|
|
@@ -1910,6 +1923,7 @@ class ScheduleTouch {
|
|
|
1910
1923
|
this.parent.selectedElements = [];
|
|
1911
1924
|
this.parent.eventBase.getSelectedEventElements(target);
|
|
1912
1925
|
if (this.parent.resizeModule && closest(e.originalEvent.target, '.' + EVENT_RESIZE_CLASS)) {
|
|
1926
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1913
1927
|
this.parent.resizeModule.resizeStart(e.originalEvent);
|
|
1914
1928
|
}
|
|
1915
1929
|
}
|
|
@@ -1995,6 +2009,9 @@ class ScheduleTouch {
|
|
|
1995
2009
|
this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';
|
|
1996
2010
|
}
|
|
1997
2011
|
onTransitionEnd() {
|
|
2012
|
+
if (!isNullOrUndefined(this.element) && !this.element.classList.contains(TRANSLATE_CLASS)) {
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
1998
2015
|
removeClass([this.element], TRANSLATE_CLASS);
|
|
1999
2016
|
this.element.style.transitionDuration = '';
|
|
2000
2017
|
this.element.style.transform = '';
|
|
@@ -2079,7 +2096,9 @@ class KeyboardInteraction {
|
|
|
2079
2096
|
ctrlShiftUpArrow: 'ctrl+shift+uparrow',
|
|
2080
2097
|
ctrlShiftDownArrow: 'ctrl+shift+downarrow',
|
|
2081
2098
|
ctrlShiftLeftArrow: 'ctrl+shift+leftarrow',
|
|
2082
|
-
ctrlShiftRightArrow: 'ctrl+shift+rightarrow'
|
|
2099
|
+
ctrlShiftRightArrow: 'ctrl+shift+rightarrow',
|
|
2100
|
+
shiftAltY: 'shift+alt+y',
|
|
2101
|
+
shiftAltN: 'shift+alt+n'
|
|
2083
2102
|
};
|
|
2084
2103
|
this.parent = parent;
|
|
2085
2104
|
this.parent.element.tabIndex = this.parent.element.tabIndex === -1 ? 0 : this.parent.element.tabIndex;
|
|
@@ -2160,6 +2179,43 @@ class KeyboardInteraction {
|
|
|
2160
2179
|
this.processFTwelve(e);
|
|
2161
2180
|
}
|
|
2162
2181
|
break;
|
|
2182
|
+
case 'shiftAltY':
|
|
2183
|
+
this.parent.changeDate(new Date(), e);
|
|
2184
|
+
break;
|
|
2185
|
+
case 'shiftAltN':
|
|
2186
|
+
if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda' ||
|
|
2187
|
+
this.parent.currentView === 'Year') {
|
|
2188
|
+
return;
|
|
2189
|
+
}
|
|
2190
|
+
this.processShiftAltN(e);
|
|
2191
|
+
break;
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
processShiftAltN(e) {
|
|
2195
|
+
const selectedCells = this.parent.getSelectedCells();
|
|
2196
|
+
const target = e.target;
|
|
2197
|
+
let cellData = extend({}, null, true);
|
|
2198
|
+
if (selectedCells.length > 0 && (closest(target, '.' + WORK_CELLS_CLASS)
|
|
2199
|
+
|| closest(target, '.' + ALLDAY_CELLS_CLASS) || closest(target, '.' + HEADER_CELLS_CLASS))) {
|
|
2200
|
+
cellData = this.getSelectedElements(target);
|
|
2201
|
+
}
|
|
2202
|
+
else if (closest(target, '.' + APPOINTMENT_CLASS) && !isNullOrUndefined(this.parent.activeEventData.event)) {
|
|
2203
|
+
const event = this.parent.activeEventData.event;
|
|
2204
|
+
cellData.startTime = event.StartTime;
|
|
2205
|
+
cellData.endTime = event.EndTime;
|
|
2206
|
+
cellData.isAllDay = event.IsAllDay;
|
|
2207
|
+
}
|
|
2208
|
+
else {
|
|
2209
|
+
const workHour = this.parent.getStartEndTime(this.parent.workHours.start);
|
|
2210
|
+
const slotInterval = this.parent.activeViewOptions.timeScale.interval /
|
|
2211
|
+
this.parent.activeViewOptions.timeScale.slotCount;
|
|
2212
|
+
cellData.startTime = new Date(this.parent.selectedDate);
|
|
2213
|
+
cellData.startTime.setHours(workHour.getHours(), workHour.getMinutes(), 0, 0);
|
|
2214
|
+
cellData.endTime = new Date(cellData.startTime.getTime() + slotInterval * 60000);
|
|
2215
|
+
}
|
|
2216
|
+
const args = extend(cellData, { cancel: false, event: e });
|
|
2217
|
+
if (args != null) {
|
|
2218
|
+
this.parent.eventWindow.openEditor(args, 'Add');
|
|
2163
2219
|
}
|
|
2164
2220
|
}
|
|
2165
2221
|
processFTwelve(e) {
|
|
@@ -2580,8 +2636,11 @@ class KeyboardInteraction {
|
|
|
2580
2636
|
return this.parent.eventBase.selectWorkCellByTime([selectedObject]);
|
|
2581
2637
|
}
|
|
2582
2638
|
processViewNavigation(e) {
|
|
2583
|
-
|
|
2584
|
-
|
|
2639
|
+
if (isNullOrUndefined(e.code)) {
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
const index = parseInt(e.code.slice(e.code.length - 1), 10) - 1;
|
|
2643
|
+
if (!isNaN(index) && !isNullOrUndefined(this.parent.views) && index < this.parent.views.length) {
|
|
2585
2644
|
const view = this.parent.viewCollections[parseInt(index.toString(), 10)].option;
|
|
2586
2645
|
this.parent.changeView(view, e, undefined, index);
|
|
2587
2646
|
if (this.parent.headerModule) {
|
|
@@ -4127,6 +4186,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
4127
4186
|
}
|
|
4128
4187
|
else {
|
|
4129
4188
|
tempDate = getStartDateForWeek(startDate, ruleObject.day);
|
|
4189
|
+
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < startDate.getDay()) {
|
|
4190
|
+
tempDate.setDate(tempDate.getDate() + ((interval - 1) * 7));
|
|
4191
|
+
}
|
|
4130
4192
|
while (compareDates(tempDate, endDate)) {
|
|
4131
4193
|
weekState = validateRules(tempDate, ruleObject);
|
|
4132
4194
|
if (weekState && (expectedDays.indexOf(DAYINDEX[tempDate.getDay()]) > -1)) {
|
|
@@ -6295,7 +6357,7 @@ class EventBase {
|
|
|
6295
6357
|
this.parent.activeEventData = { event: eventObject, element: target };
|
|
6296
6358
|
}
|
|
6297
6359
|
generateOccurrence(event, viewDate, isMaxCount) {
|
|
6298
|
-
|
|
6360
|
+
let startDate = event[this.parent.eventFields.startTime];
|
|
6299
6361
|
const endDate = event[this.parent.eventFields.endTime];
|
|
6300
6362
|
const eventRule = event[this.parent.eventFields.recurrenceRule];
|
|
6301
6363
|
const timeZoneDiff = endDate.getTimezoneOffset() - startDate.getTimezoneOffset();
|
|
@@ -6309,6 +6371,10 @@ class EventBase {
|
|
|
6309
6371
|
const newTimezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
|
|
6310
6372
|
const firstDay = this.parent.activeViewOptions.firstDayOfWeek;
|
|
6311
6373
|
const calendarMode = this.parent.calendarMode;
|
|
6374
|
+
if (event[this.parent.eventFields.recurrenceRule] && event[this.parent.eventFields.recurrenceRule].includes('BYMONTHDAY') &&
|
|
6375
|
+
this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
|
|
6376
|
+
startDate = this.parent.tzModule.convert(event[this.parent.eventFields.startTime], this.parent.timezone, event[this.parent.eventFields.startTimezone]);
|
|
6377
|
+
}
|
|
6312
6378
|
const dates = generate(startDate, eventRule, exception, firstDay, maxCount, viewDate, calendarMode, newTimezone);
|
|
6313
6379
|
if (this.parent.currentView === 'Agenda' && eventRule.indexOf('COUNT') === -1 && eventRule.indexOf('UNTIL') === -1) {
|
|
6314
6380
|
if (isNullOrUndefined(event.generatedDates)) {
|
|
@@ -6323,10 +6389,18 @@ class EventBase {
|
|
|
6323
6389
|
}
|
|
6324
6390
|
}
|
|
6325
6391
|
}
|
|
6392
|
+
let isDSTAdjusted = false;
|
|
6393
|
+
let convertedDates = [];
|
|
6394
|
+
if (event[this.parent.eventFields.recurrenceRule] && event[this.parent.eventFields.recurrenceRule].includes('BYMONTHDAY') &&
|
|
6395
|
+
this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
|
|
6396
|
+
isDSTAdjusted = true;
|
|
6397
|
+
convertedDates.push(...dates.map((date) => this.parent.tzModule.convert(new Date(date), event[this.parent.eventFields.startTimezone], this.parent.timezone).getTime()));
|
|
6398
|
+
}
|
|
6399
|
+
convertedDates = convertedDates.length > 0 ? convertedDates : dates;
|
|
6326
6400
|
const occurrenceCollection = [];
|
|
6327
|
-
for (let date of
|
|
6401
|
+
for (let date of convertedDates) {
|
|
6328
6402
|
const clonedObject = extend({}, event, null, true);
|
|
6329
|
-
date = this.getDSTAdjustedTime(date, clonedObject);
|
|
6403
|
+
date = !isDSTAdjusted ? this.getDSTAdjustedTime(date, clonedObject) : date;
|
|
6330
6404
|
clonedObject[this.parent.eventFields.startTime] = new Date(date);
|
|
6331
6405
|
clonedObject[this.parent.eventFields.endTime] = new Date(new Date(date).setMilliseconds(duration));
|
|
6332
6406
|
clonedObject[this.parent.eventFields.recurrenceID] = clonedObject[this.parent.eventFields.id];
|
|
@@ -6766,8 +6840,8 @@ class VerticalEvent extends EventBase {
|
|
|
6766
6840
|
this.slotCount = this.parent.activeViewOptions.timeScale.slotCount;
|
|
6767
6841
|
this.interval = this.parent.activeViewOptions.timeScale.interval;
|
|
6768
6842
|
this.allDayLevel = 0;
|
|
6769
|
-
this.startHour = this.parent.
|
|
6770
|
-
this.endHour = this.parent.
|
|
6843
|
+
this.startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
|
|
6844
|
+
this.endHour = this.getStartEndHours(this.parent.activeViewOptions.endHour);
|
|
6771
6845
|
this.element = this.parent.activeView.getPanel();
|
|
6772
6846
|
this.fields = this.parent.eventFields;
|
|
6773
6847
|
this.animation = new Animation({ progress: this.animationUiUpdate.bind(this) });
|
|
@@ -6841,7 +6915,7 @@ class VerticalEvent extends EventBase {
|
|
|
6841
6915
|
this.parent.crudModule.crudObj.isCrudAction = false;
|
|
6842
6916
|
}
|
|
6843
6917
|
this.parent.renderTemplates(() => {
|
|
6844
|
-
if (this.parent.isReact && this.parent.activeViewOptions.eventTemplate) {
|
|
6918
|
+
if (this.parent && this.parent.isReact && this.parent.activeViewOptions.eventTemplate) {
|
|
6845
6919
|
const wraps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_WRAPPER_HIDDEN_CLASS));
|
|
6846
6920
|
removeClass(wraps, APPOINTMENT_WRAPPER_HIDDEN_CLASS);
|
|
6847
6921
|
}
|
|
@@ -6855,7 +6929,7 @@ class VerticalEvent extends EventBase {
|
|
|
6855
6929
|
this.resources = this.parent.resourceBase.renderedResources;
|
|
6856
6930
|
}
|
|
6857
6931
|
this.cellHeight =
|
|
6858
|
-
parseFloat(getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6932
|
+
parseFloat(this.parent.getElementHeight(this.parent.element.querySelector('.e-content-wrap tbody tr')).toFixed(2));
|
|
6859
6933
|
this.dateRender[0] = this.parent.activeView.renderDates;
|
|
6860
6934
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
6861
6935
|
for (let i = 0, len = this.resources.length; i < len; i++) {
|
|
@@ -6895,7 +6969,7 @@ class VerticalEvent extends EventBase {
|
|
|
6895
6969
|
const renderDates = this.dateRender[parseInt(resource.toString(), 10)];
|
|
6896
6970
|
for (let day = 0, length = renderDates.length; day < length; day++) {
|
|
6897
6971
|
const startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
|
|
6898
|
-
const endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
|
|
6972
|
+
const endDate = resetTime(addDays(renderDates[parseInt(day.toString(), 10)], 1));
|
|
6899
6973
|
const filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[parseInt(resource.toString(), 10)]);
|
|
6900
6974
|
for (const event of filterEvents) {
|
|
6901
6975
|
if (this.parent.resourceBase) {
|
|
@@ -6925,7 +6999,7 @@ class VerticalEvent extends EventBase {
|
|
|
6925
6999
|
}
|
|
6926
7000
|
else {
|
|
6927
7001
|
blockHeight = formatUnit(this.getHeight(eStart, eEnd));
|
|
6928
|
-
blockTop = formatUnit(this.getTopValue(eStart
|
|
7002
|
+
blockTop = formatUnit(this.getTopValue(eStart));
|
|
6929
7003
|
}
|
|
6930
7004
|
const appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
|
|
6931
7005
|
setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
|
|
@@ -6939,7 +7013,7 @@ class VerticalEvent extends EventBase {
|
|
|
6939
7013
|
const resources = this.getResourceList();
|
|
6940
7014
|
let dateCount = this.getStartCount();
|
|
6941
7015
|
let isRender;
|
|
6942
|
-
const appHeight = eventType === 'allDayEvents' ? getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
7016
|
+
const appHeight = eventType === 'allDayEvents' ? this.parent.getElementHeightFromClass(this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS) : 0;
|
|
6943
7017
|
const allDayRowTop = eventType === 'allDayEvents' && this.allDayElement.length > 0 ? this.allDayElement[0].offsetTop : 0;
|
|
6944
7018
|
for (const resource of resources) {
|
|
6945
7019
|
isRender = true;
|
|
@@ -6958,7 +7032,7 @@ class VerticalEvent extends EventBase {
|
|
|
6958
7032
|
renderDates[parseInt(day.toString(), 10)] <= renderedDate[renderedDate.length - 1]; day++) {
|
|
6959
7033
|
this.renderedEvents = [];
|
|
6960
7034
|
const startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
|
|
6961
|
-
const endDate = addDays(renderDates[parseInt(day.toString(), 10)], 1);
|
|
7035
|
+
const endDate = resetTime(addDays(renderDates[parseInt(day.toString(), 10)], 1));
|
|
6962
7036
|
const filterEvents = this.filterEvents(startDate, endDate, eventCollection, this.resources[parseInt(resource.toString(), 10)]);
|
|
6963
7037
|
if (isRender) {
|
|
6964
7038
|
for (const event of filterEvents) {
|
|
@@ -7172,7 +7246,10 @@ class VerticalEvent extends EventBase {
|
|
|
7172
7246
|
const field = this.parent.eventFields;
|
|
7173
7247
|
const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
|
|
7174
7248
|
const event = extend({}, record, null, true);
|
|
7175
|
-
event.isSpanned = {
|
|
7249
|
+
event.isSpanned = {
|
|
7250
|
+
isBottom: false, isTop: false,
|
|
7251
|
+
isSameDuration: event[field.startTime].getTime() === event[field.endTime].getTime()
|
|
7252
|
+
};
|
|
7176
7253
|
if (record[field.startTime].getTime() < schedule.startHour.getTime()) {
|
|
7177
7254
|
event[field.startTime] = schedule.startHour;
|
|
7178
7255
|
event.isSpanned.isTop = true;
|
|
@@ -7285,9 +7362,9 @@ class VerticalEvent extends EventBase {
|
|
|
7285
7362
|
return;
|
|
7286
7363
|
}
|
|
7287
7364
|
if (eStart <= eEnd && isValidEvent && this.isWorkDayAvailable(resource, eStart)) {
|
|
7288
|
-
const appHeight = this.getHeight(eStart, eEnd);
|
|
7365
|
+
const appHeight = record.isSpanned.isSameDuration ? this.cellHeight : this.getHeight(eStart, eEnd);
|
|
7289
7366
|
if (eStart.getTime() >= schedule.startHour.getTime()) {
|
|
7290
|
-
topValue = this.getTopValue(eStart
|
|
7367
|
+
topValue = this.getTopValue(eStart);
|
|
7291
7368
|
}
|
|
7292
7369
|
const appIndex = this.getOverlapIndex(record, dayIndex, false, resource);
|
|
7293
7370
|
record.Index = appIndex;
|
|
@@ -7348,13 +7425,20 @@ class VerticalEvent extends EventBase {
|
|
|
7348
7425
|
const tempLeft = (parseFloat(appWidth) + 1) * index;
|
|
7349
7426
|
return (tempLeft > 99 ? 99 : tempLeft) + '%';
|
|
7350
7427
|
}
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7428
|
+
getStartEndHours(startEndTime) {
|
|
7429
|
+
if (!isNullOrUndefined(startEndTime) && startEndTime !== '') {
|
|
7430
|
+
const startEndDate = new Date(2000, 0, 0, 0);
|
|
7431
|
+
const timeString = startEndTime.split(':');
|
|
7432
|
+
if (timeString.length === 2) {
|
|
7433
|
+
startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);
|
|
7434
|
+
}
|
|
7435
|
+
return startEndDate;
|
|
7436
|
+
}
|
|
7437
|
+
return null;
|
|
7438
|
+
}
|
|
7439
|
+
getTopValue(date) {
|
|
7440
|
+
const startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
|
|
7441
|
+
const diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
|
|
7358
7442
|
return (this.parent.activeViewOptions.timeScale.enable) ? ((diffInMinutes * this.cellHeight * this.slotCount) / this.interval) : 0;
|
|
7359
7443
|
}
|
|
7360
7444
|
getOverlapIndex(record, day, isAllDay, resource) {
|
|
@@ -7385,8 +7469,27 @@ class VerticalEvent extends EventBase {
|
|
|
7385
7469
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
7386
7470
|
this.overlapList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], this.overlapList);
|
|
7387
7471
|
}
|
|
7472
|
+
const queue = [];
|
|
7388
7473
|
this.overlapList.forEach((obj) => {
|
|
7389
|
-
|
|
7474
|
+
queue.push(obj);
|
|
7475
|
+
let filterList = [];
|
|
7476
|
+
const processedIds = new Set();
|
|
7477
|
+
while (queue.length > 0) {
|
|
7478
|
+
const currentObj = queue.shift();
|
|
7479
|
+
const overlaps = appointmentList.filter((data) => {
|
|
7480
|
+
return data[fieldMapping.endTime] > currentObj[fieldMapping.startTime] &&
|
|
7481
|
+
data[fieldMapping.startTime] <= currentObj[fieldMapping.endTime] &&
|
|
7482
|
+
!processedIds.has(data[fieldMapping.id]);
|
|
7483
|
+
});
|
|
7484
|
+
overlaps.forEach((overlap) => {
|
|
7485
|
+
filterList.push(overlap);
|
|
7486
|
+
processedIds.add(overlap[fieldMapping.id]);
|
|
7487
|
+
queue.push(overlap);
|
|
7488
|
+
});
|
|
7489
|
+
if (processedIds.size < appointmentList.length - 1) {
|
|
7490
|
+
break;
|
|
7491
|
+
}
|
|
7492
|
+
}
|
|
7390
7493
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
7391
7494
|
filterList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], filterList);
|
|
7392
7495
|
}
|
|
@@ -7652,7 +7755,7 @@ class MonthEvent extends EventBase {
|
|
|
7652
7755
|
this.monthHeaderHeight = wrapper.offsetTop - cellTd.offsetTop;
|
|
7653
7756
|
cellTd.removeChild(wrapper);
|
|
7654
7757
|
}
|
|
7655
|
-
this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7758
|
+
this.eventHeight = this.parent.getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7656
7759
|
const selector = '.' + CONTENT_TABLE_CLASS + ' tbody tr';
|
|
7657
7760
|
this.addCellHeight(selector, this.eventHeight, (this.parent.currentView === 'Month' ? EVENT_GAP : 2), this.monthHeaderHeight, this.moreIndicatorHeight);
|
|
7658
7761
|
const scrollTop = conWrap.scrollTop;
|
|
@@ -7731,8 +7834,8 @@ class MonthEvent extends EventBase {
|
|
|
7731
7834
|
});
|
|
7732
7835
|
}
|
|
7733
7836
|
const cellDetail = this.workCells[this.parent.activeView.isTimelineView() ? 0 : this.workCells.length - 1];
|
|
7734
|
-
this.cellWidth = getElementWidth(cellDetail);
|
|
7735
|
-
this.cellHeight = getElementHeight(cellDetail);
|
|
7837
|
+
this.cellWidth = this.parent.getElementWidth(cellDetail);
|
|
7838
|
+
this.cellHeight = this.parent.getElementHeight(cellDetail);
|
|
7736
7839
|
this.dateRender = dateRender;
|
|
7737
7840
|
const filteredDates = this.getRenderedDates(dateRender);
|
|
7738
7841
|
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
@@ -7898,7 +8001,10 @@ class MonthEvent extends EventBase {
|
|
|
7898
8001
|
if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
|
|
7899
8002
|
for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
|
|
7900
8003
|
const sourceRes = this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)];
|
|
7901
|
-
this.
|
|
8004
|
+
if (!this.parent.uiStateValues.isGroupAdaptive ||
|
|
8005
|
+
(this.parent.uiStateValues.groupIndex === sourceRes.groupIndex && this.parent.uiStateValues.isGroupAdaptive)) {
|
|
8006
|
+
this.renderEventsHandler(sourceRes.renderDates, sourceRes.workDays, sourceRes);
|
|
8007
|
+
}
|
|
7902
8008
|
if (this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
|
|
7903
8009
|
this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
|
|
7904
8010
|
const target = this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)];
|
|
@@ -8285,7 +8391,7 @@ class TimelineEvent extends MonthEvent {
|
|
|
8285
8391
|
this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
|
|
8286
8392
|
this.renderType = 'day';
|
|
8287
8393
|
const workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
|
|
8288
|
-
this.cellWidth = getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8394
|
+
this.cellWidth = this.parent.getElementWidth(workCell) / +(workCell.getAttribute('colspan') || 1);
|
|
8289
8395
|
this.slotsPerDay = 1;
|
|
8290
8396
|
}
|
|
8291
8397
|
else {
|
|
@@ -8363,7 +8469,10 @@ class TimelineEvent extends MonthEvent {
|
|
|
8363
8469
|
for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
|
|
8364
8470
|
const source = this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)];
|
|
8365
8471
|
this.rowIndex = source.groupIndex;
|
|
8366
|
-
|
|
8472
|
+
if (!this.parent.uiStateValues.isGroupAdaptive ||
|
|
8473
|
+
(this.parent.uiStateValues.groupIndex === source.groupIndex && this.parent.uiStateValues.isGroupAdaptive)) {
|
|
8474
|
+
this.renderEventsHandler(this.parent.activeView.renderDates, this.parent.activeViewOptions.workDays, source);
|
|
8475
|
+
}
|
|
8367
8476
|
if (this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)] && this.parent.crudModule.crudObj.sourceEvent[parseInt(i.toString(), 10)].groupIndex !==
|
|
8368
8477
|
this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)].groupIndex) {
|
|
8369
8478
|
const target = this.parent.crudModule.crudObj.targetEvent[parseInt(i.toString(), 10)];
|
|
@@ -8448,14 +8557,14 @@ class TimelineEvent extends MonthEvent {
|
|
|
8448
8557
|
this.wireAppointmentEvents(appointmentElement, event);
|
|
8449
8558
|
if (this.parent.rowAutoHeight) {
|
|
8450
8559
|
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
8451
|
-
const conWidth = getElementWidth(conWrap);
|
|
8560
|
+
const conWidth = this.parent.getElementWidth(conWrap);
|
|
8452
8561
|
const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
|
|
8453
8562
|
conWrap.offsetWidth === conWrap.clientWidth;
|
|
8454
8563
|
this.renderEventElement(event, appointmentElement, cellTd);
|
|
8455
8564
|
const firstChild = this.getFirstChild(resIndex);
|
|
8456
8565
|
this.updateCellHeight(firstChild, height);
|
|
8457
8566
|
if (isWithoutScroll &&
|
|
8458
|
-
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== getElementWidth(conWrap))) {
|
|
8567
|
+
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
|
|
8459
8568
|
this.adjustAppointments(conWidth);
|
|
8460
8569
|
}
|
|
8461
8570
|
}
|
|
@@ -8573,7 +8682,7 @@ class TimelineEvent extends MonthEvent {
|
|
|
8573
8682
|
}
|
|
8574
8683
|
adjustAppointments(conWidth) {
|
|
8575
8684
|
const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8576
|
-
const actualCellWidth = getElementWidth(this.workCells[0]);
|
|
8685
|
+
const actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8577
8686
|
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8578
8687
|
const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8579
8688
|
const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
@@ -8916,7 +9025,15 @@ class InlineEdit {
|
|
|
8916
9025
|
subjectWrap.insertBefore(inlineSubject, subjectWrap.firstChild);
|
|
8917
9026
|
}
|
|
8918
9027
|
else {
|
|
8919
|
-
|
|
9028
|
+
const elementSelector = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth'].indexOf(this.parent.currentView) > -1 ?
|
|
9029
|
+
'.e-inner-wrap' : '.e-appointment-details';
|
|
9030
|
+
const innerWrapElement = args.element.querySelector(elementSelector);
|
|
9031
|
+
if (isNullOrUndefined(innerWrapElement)) {
|
|
9032
|
+
args.element.querySelector('.e-appointment-details').prepend(inlineSubject);
|
|
9033
|
+
}
|
|
9034
|
+
else {
|
|
9035
|
+
innerWrapElement.prepend(inlineSubject);
|
|
9036
|
+
}
|
|
8920
9037
|
}
|
|
8921
9038
|
inlineSubject.focus();
|
|
8922
9039
|
}
|
|
@@ -8933,11 +9050,11 @@ class InlineEdit {
|
|
|
8933
9050
|
const allDayElements = [].slice.call(this.parent.element.querySelectorAll('.' + ALLDAY_APPOINTMENT_CLASS));
|
|
8934
9051
|
let allDayLevel = 0;
|
|
8935
9052
|
if (allDayElements.length > 0) {
|
|
8936
|
-
allDayLevel = Math.floor(getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
9053
|
+
allDayLevel = Math.floor(this.parent.getElementHeight(this.parent.element.querySelector('.' + ALLDAY_ROW_CLASS)) /
|
|
8937
9054
|
allDayElements[0].offsetHeight) - 1;
|
|
8938
9055
|
}
|
|
8939
9056
|
verticalEvent.allDayLevel = allDayLevel;
|
|
8940
|
-
const appHeight = getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
9057
|
+
const appHeight = this.parent.getElementHeightFromClass(this.parent.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS), APPOINTMENT_CLASS);
|
|
8941
9058
|
const cellTop = verticalEvent.allDayElement.length > 0 ? verticalEvent.allDayElement[0].offsetTop : 0;
|
|
8942
9059
|
verticalEvent.renderAllDayEvents(saveObj, index, resIndex, daysCount, this.parent.allowInline, cellTop, appHeight);
|
|
8943
9060
|
}
|
|
@@ -8965,7 +9082,7 @@ class InlineEdit {
|
|
|
8965
9082
|
monthEvent.cellWidth = monthEvent.workCells[0].offsetWidth;
|
|
8966
9083
|
monthEvent.cellHeight = monthEvent.workCells[0].offsetHeight;
|
|
8967
9084
|
monthEvent.eventHeight =
|
|
8968
|
-
getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
9085
|
+
this.parent.getElementHeightFromClass(this.parent.monthModule.element || monthEvent.element, APPOINTMENT_CLASS);
|
|
8969
9086
|
monthEvent.getSlotDates(workDays);
|
|
8970
9087
|
const filteredDates = monthEvent.getRenderedDates(renderDates);
|
|
8971
9088
|
const spannedEvents = monthEvent.splitEvent(saveObject, filteredDates || renderDates);
|
|
@@ -8988,7 +9105,7 @@ class InlineEdit {
|
|
|
8988
9105
|
const dayLength = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr').length === 0 ?
|
|
8989
9106
|
0 : this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr')[0].children.length;
|
|
8990
9107
|
timelineView.slotsPerDay = dayLength / timelineView.dateRender.length;
|
|
8991
|
-
timelineView.eventHeight = getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
9108
|
+
timelineView.eventHeight = this.parent.getElementHeightFromClass(timelineView.element, APPOINTMENT_CLASS);
|
|
8992
9109
|
timelineView.renderEvents(saveObject, resIndex);
|
|
8993
9110
|
}
|
|
8994
9111
|
getEventDaysCount(saveObj) {
|
|
@@ -10645,7 +10762,8 @@ class EventTooltip {
|
|
|
10645
10762
|
const fields = this.parent.eventFields;
|
|
10646
10763
|
const eventStart = new Date('' + record[fields.startTime]);
|
|
10647
10764
|
let eventEnd = new Date('' + record[fields.endTime]);
|
|
10648
|
-
eventEnd = (eventEnd.
|
|
10765
|
+
eventEnd = ((eventEnd.getTime() - eventStart.getTime() !== 0) && eventEnd.getHours() === 0 && eventEnd.getMinutes() === 0) ?
|
|
10766
|
+
new Date(eventEnd.setMilliseconds(-1000)) : eventEnd;
|
|
10649
10767
|
const startDate = resetTime(new Date('' + eventStart));
|
|
10650
10768
|
const endDate = resetTime(new Date('' + eventEnd));
|
|
10651
10769
|
const tooltipSubject = (record[fields.subject] || this.parent.eventSettings.fields.subject.default
|
|
@@ -10714,12 +10832,12 @@ class EventTooltip {
|
|
|
10714
10832
|
}
|
|
10715
10833
|
}
|
|
10716
10834
|
|
|
10717
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10718
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10719
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10720
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10721
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10722
|
-
};
|
|
10835
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10836
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10837
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10838
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10839
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10840
|
+
};
|
|
10723
10841
|
const HEADER = 'e-editor';
|
|
10724
10842
|
const INPUTWARAPPER = 'e-input-wrapper';
|
|
10725
10843
|
const INPUTWARAPPERSIDE = 'e-input-wrapper-side';
|
|
@@ -11978,8 +12096,13 @@ class EventWindow {
|
|
|
11978
12096
|
this.addEventHandlers();
|
|
11979
12097
|
}
|
|
11980
12098
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
11981
|
-
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data);
|
|
12099
|
+
this.renderFormElements(this.element.querySelector('.e-schedule-form'), data, type, repeatType);
|
|
12100
|
+
}
|
|
12101
|
+
else {
|
|
12102
|
+
this.setEditorContent(data, type, repeatType);
|
|
11982
12103
|
}
|
|
12104
|
+
}
|
|
12105
|
+
setEditorContent(data, type, repeatType) {
|
|
11983
12106
|
if (!this.parent.isAdaptive && isNullOrUndefined(this.parent.editorTemplate)) {
|
|
11984
12107
|
removeClass([this.dialogObject.element.querySelector('.e-recurrenceeditor')], DISABLE_CLASS);
|
|
11985
12108
|
}
|
|
@@ -12158,7 +12281,7 @@ class EventWindow {
|
|
|
12158
12281
|
container.appendChild(form);
|
|
12159
12282
|
return container;
|
|
12160
12283
|
}
|
|
12161
|
-
renderFormElements(form, args) {
|
|
12284
|
+
renderFormElements(form, args, type, repeatType) {
|
|
12162
12285
|
if (!isNullOrUndefined(this.parent.editorTemplate)) {
|
|
12163
12286
|
if (args) {
|
|
12164
12287
|
if (this.fieldValidator) {
|
|
@@ -12170,11 +12293,14 @@ class EventWindow {
|
|
|
12170
12293
|
this.recurrenceEditor = null;
|
|
12171
12294
|
}
|
|
12172
12295
|
this.destroyComponents();
|
|
12173
|
-
const formElements = [].slice.call(form.children);
|
|
12174
|
-
for (const element of formElements) {
|
|
12175
|
-
remove(element);
|
|
12176
|
-
}
|
|
12177
12296
|
this.parent.resetTemplates(['editorTemplate']);
|
|
12297
|
+
EventHandler.clearEvents(form);
|
|
12298
|
+
if (!this.parent.isReact) {
|
|
12299
|
+
const formElements = [].slice.call(form.children);
|
|
12300
|
+
for (const element of formElements) {
|
|
12301
|
+
remove(element);
|
|
12302
|
+
}
|
|
12303
|
+
}
|
|
12178
12304
|
}
|
|
12179
12305
|
const templateId = this.parent.element.id + '_editorTemplate';
|
|
12180
12306
|
const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
|
|
@@ -12182,15 +12308,17 @@ class EventWindow {
|
|
|
12182
12308
|
this.parent.renderTemplates(() => {
|
|
12183
12309
|
if (this.element) {
|
|
12184
12310
|
this.applyFormValidation();
|
|
12185
|
-
if (
|
|
12186
|
-
this.
|
|
12187
|
-
this.eventCrudData = null;
|
|
12311
|
+
if (args) {
|
|
12312
|
+
this.setEditorContent(args, type, repeatType);
|
|
12188
12313
|
}
|
|
12189
12314
|
}
|
|
12190
12315
|
});
|
|
12191
12316
|
}
|
|
12192
12317
|
else {
|
|
12193
12318
|
form.appendChild(this.getDefaultEventWindowContent());
|
|
12319
|
+
if (args) {
|
|
12320
|
+
this.setEditorContent(args, type, repeatType);
|
|
12321
|
+
}
|
|
12194
12322
|
}
|
|
12195
12323
|
}
|
|
12196
12324
|
getDefaultEventWindowContent() {
|
|
@@ -12768,17 +12896,17 @@ class EventWindow {
|
|
|
12768
12896
|
if (!isNullOrUndefined(descriptionRule)) {
|
|
12769
12897
|
rules[this.parent.eventSettings.fields.description.name] = descriptionRule;
|
|
12770
12898
|
}
|
|
12899
|
+
if (this.fieldValidator) {
|
|
12900
|
+
this.fieldValidator.destroy();
|
|
12901
|
+
this.fieldValidator = null;
|
|
12902
|
+
}
|
|
12771
12903
|
this.fieldValidator = new FieldValidator();
|
|
12772
12904
|
this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
|
|
12773
12905
|
}
|
|
12774
12906
|
showDetails(eventData) {
|
|
12775
|
-
this.eventData =
|
|
12907
|
+
this.eventData = eventData;
|
|
12776
12908
|
const eventObj = extend({}, eventData, null, true);
|
|
12777
12909
|
const formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
|
|
12778
|
-
if (this.parent.isReact && formElements.length < 1 && !this.cellClickAction) {
|
|
12779
|
-
this.eventCrudData = eventObj;
|
|
12780
|
-
return;
|
|
12781
|
-
}
|
|
12782
12910
|
if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
|
|
12783
12911
|
eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
|
|
12784
12912
|
this.trimAllDay(eventObj);
|
|
@@ -13782,6 +13910,8 @@ class VirtualScroll {
|
|
|
13782
13910
|
this.renderedLength = 0;
|
|
13783
13911
|
this.averageRowHeight = 0;
|
|
13784
13912
|
this.startIndex = 0;
|
|
13913
|
+
this.existingDataCollection = [];
|
|
13914
|
+
this.enableTransition = true;
|
|
13785
13915
|
this.parent = parent;
|
|
13786
13916
|
this.addEventListener();
|
|
13787
13917
|
}
|
|
@@ -13854,10 +13984,10 @@ class VirtualScroll {
|
|
|
13854
13984
|
}
|
|
13855
13985
|
setItemSize() {
|
|
13856
13986
|
if (this.isHorizontalScroll) {
|
|
13857
|
-
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13987
|
+
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS, this.parent.uiStateValues.isTransformed) || this.itemSize;
|
|
13858
13988
|
}
|
|
13859
13989
|
else {
|
|
13860
|
-
this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13990
|
+
this.itemSize = this.parent.getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13861
13991
|
}
|
|
13862
13992
|
}
|
|
13863
13993
|
refreshLayout() {
|
|
@@ -13871,11 +14001,16 @@ class VirtualScroll {
|
|
|
13871
14001
|
const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
13872
14002
|
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
13873
14003
|
const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
14004
|
+
if (!this.parent.rowAutoHeight) {
|
|
14005
|
+
this.enableTransition = false;
|
|
14006
|
+
removeClass([conWrap, resWrap], 'e-transition');
|
|
14007
|
+
}
|
|
13874
14008
|
let firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);
|
|
13875
14009
|
const endIndex = (firstTDIndex + this.renderedLength);
|
|
13876
14010
|
firstTDIndex = (endIndex > this.parent.resourceBase.expandedResources.length) ?
|
|
13877
14011
|
(this.parent.resourceBase.expandedResources.length - this.renderedLength) : firstTDIndex;
|
|
13878
14012
|
firstTDIndex = firstTDIndex < 0 ? 0 : firstTDIndex;
|
|
14013
|
+
this.existingDataCollection = this.parent.resourceBase.renderedResources;
|
|
13879
14014
|
this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources.slice(firstTDIndex, endIndex);
|
|
13880
14015
|
if (this.parent.resourceBase.renderedResources.length > 0) {
|
|
13881
14016
|
this.updateContent(resWrap, conWrap, eventWrap, this.parent.resourceBase.renderedResources);
|
|
@@ -13924,6 +14059,7 @@ class VirtualScroll {
|
|
|
13924
14059
|
const scrollHeight = this.parent.rowAutoHeight ?
|
|
13925
14060
|
(conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;
|
|
13926
14061
|
let resCollection = [];
|
|
14062
|
+
this.existingDataCollection = this.parent.resourceBase.renderedResources;
|
|
13927
14063
|
if ((conWrap.scrollTop) - this.translateY < 0) {
|
|
13928
14064
|
resCollection = this.upScroll(conWrap, firstTDIndex);
|
|
13929
14065
|
}
|
|
@@ -14121,56 +14257,132 @@ class VirtualScroll {
|
|
|
14121
14257
|
this.parent.element.focus();
|
|
14122
14258
|
}
|
|
14123
14259
|
for (let i = 0; i < renderedLength; i++) {
|
|
14124
|
-
remove(resWrap.querySelector('tbody tr'));
|
|
14125
|
-
remove(conWrap.querySelector('tbody tr'));
|
|
14126
14260
|
remove(eventWrap.querySelector('div'));
|
|
14127
14261
|
}
|
|
14128
14262
|
this.parent.resourceBase.renderedResources = resCollection;
|
|
14263
|
+
const currentGroupIndices = this.parent.activeView.getGroupIndices(resCollection);
|
|
14264
|
+
const previousGroupIndices = this.parent.activeView.getGroupIndices(this.existingDataCollection);
|
|
14265
|
+
const newGroupIndices = currentGroupIndices.filter((index) => previousGroupIndices.indexOf(index) < 0);
|
|
14266
|
+
const resWrapRows = Array.from(resWrap.querySelectorAll('tbody tr'));
|
|
14267
|
+
const conWrapRows = Array.from(conWrap.querySelectorAll('tbody tr'));
|
|
14268
|
+
const resWrapBody = resWrap.querySelector('tbody');
|
|
14269
|
+
const conWrapBody = conWrap.querySelector('tbody');
|
|
14270
|
+
this.removeObsoleteRows(resWrapRows, currentGroupIndices);
|
|
14271
|
+
this.removeObsoleteRows(conWrapRows, currentGroupIndices);
|
|
14129
14272
|
const resourceRows = this.parent.resourceBase.getContentRows(resCollection, true);
|
|
14130
14273
|
const contentRows = this.parent.activeView.getContentRows();
|
|
14131
14274
|
const eventRows = this.parent.activeView.getEventRows(resCollection.length);
|
|
14132
|
-
|
|
14133
|
-
|
|
14275
|
+
for (let i = 0; i < newGroupIndices.length; i++) {
|
|
14276
|
+
const index = currentGroupIndices.indexOf(newGroupIndices[parseInt(i.toString(), 10)]);
|
|
14277
|
+
if (index === 0) {
|
|
14278
|
+
prepend([resourceRows[parseInt(i.toString(), 10)]], resWrapBody);
|
|
14279
|
+
prepend([contentRows[parseInt(i.toString(), 10)]], conWrapBody);
|
|
14280
|
+
}
|
|
14281
|
+
else if (resWrapBody && conWrapBody && resWrapBody.children[parseInt(index.toString(), 10)] &&
|
|
14282
|
+
conWrapBody.children[parseInt(index.toString(), 10)]) {
|
|
14283
|
+
resWrapBody.insertBefore(resourceRows[parseInt(i.toString(), 10)], resWrapBody.children[parseInt(index.toString(), 10)]);
|
|
14284
|
+
conWrapBody.insertBefore(contentRows[parseInt(i.toString(), 10)], conWrapBody.children[parseInt(index.toString(), 10)]);
|
|
14285
|
+
}
|
|
14286
|
+
else {
|
|
14287
|
+
append([resourceRows[parseInt(i.toString(), 10)]], resWrapBody);
|
|
14288
|
+
append([contentRows[parseInt(i.toString(), 10)]], conWrapBody);
|
|
14289
|
+
}
|
|
14290
|
+
}
|
|
14134
14291
|
append(eventRows, eventWrap);
|
|
14135
14292
|
}
|
|
14293
|
+
removeObsoleteRows(elements, currentGroupIndices) {
|
|
14294
|
+
elements.forEach((element) => {
|
|
14295
|
+
const groupIndex = parseInt(element.firstElementChild.getAttribute('data-group-index'), 10);
|
|
14296
|
+
if (currentGroupIndices.indexOf(groupIndex) < 0) {
|
|
14297
|
+
remove(element);
|
|
14298
|
+
}
|
|
14299
|
+
});
|
|
14300
|
+
}
|
|
14136
14301
|
updateHorizontalContent(conWrap, resCollection) {
|
|
14302
|
+
this.existingDataCollection = this.parent.resourceBase.expandedResources;
|
|
14137
14303
|
this.parent.resourceBase.expandedResources = resCollection;
|
|
14138
14304
|
const selectedEle = this.parent.getSelectedCells();
|
|
14139
14305
|
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
14140
|
-
const
|
|
14306
|
+
const tbody = conWrap.querySelector('tbody');
|
|
14307
|
+
const renderedRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14308
|
+
if (this.parent.currentView === 'Month') {
|
|
14309
|
+
this.updateMonthViewContent(conWrap, resCollection);
|
|
14310
|
+
}
|
|
14311
|
+
else {
|
|
14312
|
+
this.updateOtherViewContent(conWrap, resCollection, renderedRows);
|
|
14313
|
+
}
|
|
14314
|
+
}
|
|
14315
|
+
updateMonthViewContent(conWrap, resCollection) {
|
|
14316
|
+
const renderedLength = conWrap.querySelectorAll(' tr').length;
|
|
14141
14317
|
for (let i = 0; i < renderedLength; i++) {
|
|
14142
14318
|
remove(conWrap.querySelector('tbody tr'));
|
|
14143
14319
|
}
|
|
14144
|
-
if (this.parent.
|
|
14145
|
-
|
|
14146
|
-
this.parent.activeView.colLevels[0] = resCollection;
|
|
14147
|
-
}
|
|
14148
|
-
else {
|
|
14149
|
-
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14150
|
-
}
|
|
14151
|
-
const contentRows = this.parent.activeView.getContentRows();
|
|
14152
|
-
append(contentRows, conWrap.querySelector('tbody'));
|
|
14320
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
14321
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
14153
14322
|
}
|
|
14154
14323
|
else {
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14324
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
14325
|
+
}
|
|
14326
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
14327
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
14328
|
+
}
|
|
14329
|
+
updateOtherViewContent(conWrap, resCollection, renderedRows) {
|
|
14330
|
+
const tbody = conWrap.querySelector('tbody');
|
|
14331
|
+
const colGroup = conWrap.querySelector('colgroup');
|
|
14332
|
+
const thead = conWrap.querySelector('thead');
|
|
14333
|
+
const table = conWrap.querySelector('table');
|
|
14334
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
14335
|
+
const newGroupIndices = new Set(resCollection.map((data) => data.groupIndex));
|
|
14336
|
+
renderedRows.forEach((row) => {
|
|
14337
|
+
const tdElements = row.querySelectorAll('td');
|
|
14338
|
+
tdElements.forEach((td) => {
|
|
14339
|
+
const groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
14340
|
+
if (!newGroupIndices.has(groupIndex)) {
|
|
14341
|
+
td.remove();
|
|
14342
|
+
}
|
|
14166
14343
|
});
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14344
|
+
});
|
|
14345
|
+
const col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
14346
|
+
for (let i = 0; i < col.length; i++) {
|
|
14347
|
+
remove(col[parseInt(i.toString(), 10)]);
|
|
14348
|
+
}
|
|
14349
|
+
resCollection.forEach(() => colGroup.appendChild(createElement('col')));
|
|
14350
|
+
const tHead = [].slice.call(conWrap.querySelector('thead').children);
|
|
14351
|
+
for (let i = 0; i < tHead.length; i++) {
|
|
14352
|
+
remove(tHead[parseInt(i.toString(), 10)]);
|
|
14353
|
+
}
|
|
14354
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
14355
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
14356
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
14173
14357
|
}
|
|
14358
|
+
prepend([thead], table);
|
|
14359
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
14360
|
+
this.mergeNewTdData(tbody, contentRows);
|
|
14361
|
+
}
|
|
14362
|
+
mergeNewTdData(tbody, contentRows) {
|
|
14363
|
+
const existingRows = Array.from(tbody.querySelectorAll('tr'));
|
|
14364
|
+
existingRows.forEach((existingRow, rowIndex) => {
|
|
14365
|
+
if (rowIndex < contentRows.length) {
|
|
14366
|
+
const newRow = contentRows[parseInt(rowIndex.toString(), 10)];
|
|
14367
|
+
const existingTds = Array.from(existingRow.querySelectorAll('td'));
|
|
14368
|
+
const newTds = Array.from(newRow.querySelectorAll('td'));
|
|
14369
|
+
newTds.forEach((newTd) => {
|
|
14370
|
+
const newGroupIndex = parseInt(newTd.getAttribute('data-group-index').toString(), 10);
|
|
14371
|
+
let inserted = false;
|
|
14372
|
+
for (const existingTd of existingTds) {
|
|
14373
|
+
const existingGroupIndex = parseInt(existingTd.getAttribute('data-group-index').toString(), 10);
|
|
14374
|
+
if (newGroupIndex < existingGroupIndex) {
|
|
14375
|
+
existingRow.insertBefore(newTd, existingTd);
|
|
14376
|
+
inserted = true;
|
|
14377
|
+
break;
|
|
14378
|
+
}
|
|
14379
|
+
}
|
|
14380
|
+
if (!inserted) {
|
|
14381
|
+
existingRow.appendChild(newTd);
|
|
14382
|
+
}
|
|
14383
|
+
});
|
|
14384
|
+
}
|
|
14385
|
+
});
|
|
14174
14386
|
}
|
|
14175
14387
|
getBufferCollection(startIndex, endIndex) {
|
|
14176
14388
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
@@ -14383,12 +14595,12 @@ class Render {
|
|
|
14383
14595
|
}
|
|
14384
14596
|
}
|
|
14385
14597
|
|
|
14386
|
-
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14387
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14388
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14389
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14390
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14391
|
-
};
|
|
14598
|
+
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14599
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14600
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14601
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14602
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14603
|
+
};
|
|
14392
14604
|
/**
|
|
14393
14605
|
* A class that represents the configuration of working hours related options of scheduler.
|
|
14394
14606
|
*/
|
|
@@ -14404,12 +14616,12 @@ __decorate$1([
|
|
|
14404
14616
|
Property('18:00')
|
|
14405
14617
|
], WorkHours.prototype, "end", void 0);
|
|
14406
14618
|
|
|
14407
|
-
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14408
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14409
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14410
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14411
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14412
|
-
};
|
|
14619
|
+
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14620
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14621
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14622
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14623
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14624
|
+
};
|
|
14413
14625
|
/**
|
|
14414
14626
|
* A class that represents the configuration of options related to timescale on scheduler.
|
|
14415
14627
|
*/
|
|
@@ -14431,12 +14643,12 @@ __decorate$2([
|
|
|
14431
14643
|
Property()
|
|
14432
14644
|
], TimeScale.prototype, "majorSlotTemplate", void 0);
|
|
14433
14645
|
|
|
14434
|
-
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14435
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14436
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14437
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14438
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14439
|
-
};
|
|
14646
|
+
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14647
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14648
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14649
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14650
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14651
|
+
};
|
|
14440
14652
|
/**
|
|
14441
14653
|
* A class that defines the template options available to customize the quick popup of scheduler.
|
|
14442
14654
|
*/
|
|
@@ -14455,12 +14667,12 @@ __decorate$3([
|
|
|
14455
14667
|
Property()
|
|
14456
14668
|
], QuickInfoTemplates.prototype, "footer", void 0);
|
|
14457
14669
|
|
|
14458
|
-
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14459
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14460
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14461
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14462
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14463
|
-
};
|
|
14670
|
+
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
14671
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14672
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14673
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14674
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14675
|
+
};
|
|
14464
14676
|
/**
|
|
14465
14677
|
* A class that represents the header rows related configurations on timeline views.
|
|
14466
14678
|
*/
|
|
@@ -14577,10 +14789,10 @@ class Crud {
|
|
|
14577
14789
|
addedRecords: args.editParams.addedRecords, changedRecords: args.editParams.changedRecords,
|
|
14578
14790
|
deletedRecords: args.editParams.deletedRecords
|
|
14579
14791
|
};
|
|
14580
|
-
if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj && this.parent.dragAndDropModule.actionObj.element) {
|
|
14792
|
+
if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj && this.parent.dragAndDropModule.actionObj.element && this.parent.dragAndDropModule.actionObj.action) {
|
|
14581
14793
|
this.parent.dragAndDropModule.actionObj.element.style.display = 'none';
|
|
14582
14794
|
}
|
|
14583
|
-
if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element) {
|
|
14795
|
+
if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element && this.parent.resizeModule.actionObj.action) {
|
|
14584
14796
|
this.parent.resizeModule.actionObj.element.style.display = 'none';
|
|
14585
14797
|
}
|
|
14586
14798
|
if (this.parent.isSpecificResourceEvents()) {
|
|
@@ -14943,16 +15155,32 @@ class Crud {
|
|
|
14943
15155
|
const updateSeriesEvents = (eventData instanceof Array) ? eventData : [eventData];
|
|
14944
15156
|
const args = {
|
|
14945
15157
|
requestType: action === 'EditSeries' ? 'eventChange' : 'eventRemove', cancel: false,
|
|
14946
|
-
addedRecords: [], changedRecords:
|
|
15158
|
+
addedRecords: [], changedRecords: [], deletedRecords: []
|
|
14947
15159
|
};
|
|
14948
15160
|
args.data = seriesData;
|
|
15161
|
+
if (action === 'EditSeries') {
|
|
15162
|
+
args.changedRecords = updateSeriesEvents;
|
|
15163
|
+
}
|
|
15164
|
+
else {
|
|
15165
|
+
args.deletedRecords = updateSeriesEvents;
|
|
15166
|
+
}
|
|
15167
|
+
if (action === 'EditSeries' && !this.parent.uiStateValues.isIgnoreOccurrence) {
|
|
15168
|
+
const seriesEvents = seriesData instanceof Array ? seriesData : [seriesData];
|
|
15169
|
+
for (let a = 0, count = args.changedRecords.length; a < count; a++) {
|
|
15170
|
+
const parentEvent = seriesEvents[parseInt(a.toString(), 10)];
|
|
15171
|
+
const eventCollections = this.parent.eventBase.getEventCollections(parentEvent);
|
|
15172
|
+
const deletedEvents = eventCollections.follow.concat(eventCollections.occurrence);
|
|
15173
|
+
args.deletedRecords = args.deletedRecords.concat(deletedEvents);
|
|
15174
|
+
}
|
|
15175
|
+
}
|
|
14949
15176
|
this.parent.trigger(actionBegin, args, (seriesArgs) => {
|
|
14950
15177
|
if (!seriesArgs.cancel) {
|
|
14951
15178
|
const fields = this.parent.eventFields;
|
|
14952
15179
|
const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
|
|
14953
15180
|
const seriesEvents = seriesData instanceof Array ? seriesData : [seriesData];
|
|
14954
|
-
|
|
14955
|
-
|
|
15181
|
+
const records = action === 'EditSeries' ? seriesArgs.changedRecords : seriesArgs.deletedRecords;
|
|
15182
|
+
for (let a = 0, count = records.length; a < count; a++) {
|
|
15183
|
+
const childEvent = records[parseInt(a.toString(), 10)];
|
|
14956
15184
|
const parentEvent = seriesEvents[parseInt(a.toString(), 10)];
|
|
14957
15185
|
const eventCollections = this.parent.eventBase.getEventCollections(parentEvent);
|
|
14958
15186
|
const deletedEvents = eventCollections.follow.concat(eventCollections.occurrence);
|
|
@@ -14981,7 +15209,7 @@ class Crud {
|
|
|
14981
15209
|
}
|
|
14982
15210
|
}
|
|
14983
15211
|
const promise = this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, this.getTable(), this.getQuery());
|
|
14984
|
-
const cloneEvent = extend({},
|
|
15212
|
+
const cloneEvent = extend({}, records[records.length - 1], null, true);
|
|
14985
15213
|
this.parent.eventBase.selectWorkCellByTime(action === 'EditSeries' ? [this.parent.eventBase.processTimezone(cloneEvent)] : [cloneEvent]);
|
|
14986
15214
|
const crudArgs = {
|
|
14987
15215
|
requestType: action === 'EditSeries' ? 'eventChanged' : 'eventRemoved',
|
|
@@ -15305,12 +15533,12 @@ class WorkCellInteraction {
|
|
|
15305
15533
|
}
|
|
15306
15534
|
}
|
|
15307
15535
|
|
|
15308
|
-
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15309
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15310
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15311
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15312
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15313
|
-
};
|
|
15536
|
+
var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15537
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15538
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15539
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15540
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15541
|
+
};
|
|
15314
15542
|
/**
|
|
15315
15543
|
* Configuration that applies on each appointment field options of scheduler.
|
|
15316
15544
|
*/
|
|
@@ -15329,12 +15557,12 @@ __decorate$5([
|
|
|
15329
15557
|
Property({})
|
|
15330
15558
|
], FieldOptions.prototype, "validation", void 0);
|
|
15331
15559
|
|
|
15332
|
-
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15333
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15334
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15335
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15336
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15337
|
-
};
|
|
15560
|
+
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15561
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15562
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15563
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15564
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15565
|
+
};
|
|
15338
15566
|
/**
|
|
15339
15567
|
* A class that holds the collection of event fields that requires to be mapped with the dataSource
|
|
15340
15568
|
* fields along with its available configuration settings. Each field in it accepts both string and object
|
|
@@ -15390,12 +15618,12 @@ __decorate$6([
|
|
|
15390
15618
|
Property('FollowingID')
|
|
15391
15619
|
], Field.prototype, "followingID", void 0);
|
|
15392
15620
|
|
|
15393
|
-
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15394
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15395
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15396
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15397
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15398
|
-
};
|
|
15621
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15622
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15623
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15624
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15625
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15626
|
+
};
|
|
15399
15627
|
/**
|
|
15400
15628
|
* Holds the configuration of event related options and dataSource binding to Schedule.
|
|
15401
15629
|
*/
|
|
@@ -15456,12 +15684,12 @@ __decorate$7([
|
|
|
15456
15684
|
Property()
|
|
15457
15685
|
], EventSettings.prototype, "includeFiltersInQuery", void 0);
|
|
15458
15686
|
|
|
15459
|
-
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15460
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15461
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15462
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15463
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15464
|
-
};
|
|
15687
|
+
var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15688
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15689
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15690
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15691
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15692
|
+
};
|
|
15465
15693
|
/**
|
|
15466
15694
|
* A class that holds the resource grouping related configurations on Schedule.
|
|
15467
15695
|
*/
|
|
@@ -15489,12 +15717,12 @@ __decorate$8([
|
|
|
15489
15717
|
Property(false)
|
|
15490
15718
|
], Group.prototype, "hideNonWorkingDays", void 0);
|
|
15491
15719
|
|
|
15492
|
-
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15493
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15494
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15495
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15496
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15497
|
-
};
|
|
15720
|
+
var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15721
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15722
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15723
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15724
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15725
|
+
};
|
|
15498
15726
|
/**
|
|
15499
15727
|
* A class that represents the resource related configurations and its data binding options.
|
|
15500
15728
|
*/
|
|
@@ -15635,7 +15863,11 @@ class ResourceBase {
|
|
|
15635
15863
|
const resColl = this.resourceCollection;
|
|
15636
15864
|
const tr = createElement('tr');
|
|
15637
15865
|
const td = createElement('td', { attrs: { tabindex: isVirtualScroll ? '-1' : '0' } });
|
|
15866
|
+
const existingGroupIndices = this.parent.activeView.getGroupIndices();
|
|
15638
15867
|
for (let i = 0; i < resData.length; i++) {
|
|
15868
|
+
if (existingGroupIndices.length > 0 && existingGroupIndices.indexOf(resData[parseInt(i.toString(), 10)].groupIndex) > -1) {
|
|
15869
|
+
continue;
|
|
15870
|
+
}
|
|
15639
15871
|
const ntd = td.cloneNode();
|
|
15640
15872
|
rIndex = findIndexInData(resColl, 'name', resData[parseInt(i.toString(), 10)].resource.name);
|
|
15641
15873
|
if (rIndex === resColl.length - 1) {
|
|
@@ -15814,6 +16046,7 @@ class ResourceBase {
|
|
|
15814
16046
|
this.setExpandedResources();
|
|
15815
16047
|
const resourceCount = this.parent.virtualScrollModule.getRenderedCount();
|
|
15816
16048
|
const startIndex = this.expandedResources.indexOf(this.renderedResources[0]);
|
|
16049
|
+
this.parent.virtualScrollModule.existingDataCollection = this.renderedResources;
|
|
15817
16050
|
this.renderedResources = this.expandedResources.slice(startIndex, startIndex + resourceCount);
|
|
15818
16051
|
if (this.renderedResources.length < resourceCount) {
|
|
15819
16052
|
let sIndex = this.expandedResources.length - resourceCount;
|
|
@@ -16580,12 +16813,12 @@ class ResourceBase {
|
|
|
16580
16813
|
}
|
|
16581
16814
|
}
|
|
16582
16815
|
|
|
16583
|
-
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16584
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16585
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16586
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16587
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16588
|
-
};
|
|
16816
|
+
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16817
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16818
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16819
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16820
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16821
|
+
};
|
|
16589
16822
|
class ToolbarItem extends ChildProperty {
|
|
16590
16823
|
}
|
|
16591
16824
|
__decorate$a([
|
|
@@ -16646,12 +16879,12 @@ __decorate$a([
|
|
|
16646
16879
|
Event()
|
|
16647
16880
|
], ToolbarItem.prototype, "click", void 0);
|
|
16648
16881
|
|
|
16649
|
-
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16650
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16651
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16652
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16653
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16654
|
-
};
|
|
16882
|
+
var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16883
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16884
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16885
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16886
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16887
|
+
};
|
|
16655
16888
|
/**
|
|
16656
16889
|
* Represents the Schedule component that displays a list of events scheduled against specific date and timings,
|
|
16657
16890
|
* thus helping us to plan and manage it properly.
|
|
@@ -16747,6 +16980,37 @@ let Schedule = class Schedule extends Component {
|
|
|
16747
16980
|
}
|
|
16748
16981
|
return templateName;
|
|
16749
16982
|
}
|
|
16983
|
+
/**
|
|
16984
|
+
* Method to get element width
|
|
16985
|
+
*
|
|
16986
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
16987
|
+
* @returns {number} Returns the width of the given element
|
|
16988
|
+
* @private
|
|
16989
|
+
*/
|
|
16990
|
+
getElementWidth(element) {
|
|
16991
|
+
return getElementWidth(element, this.uiStateValues.isTransformed);
|
|
16992
|
+
}
|
|
16993
|
+
/**
|
|
16994
|
+
* Method to get element height
|
|
16995
|
+
*
|
|
16996
|
+
* @param {HTMLElement} element Accepts the DOM element
|
|
16997
|
+
* @returns {number} Returns the Height of the given element
|
|
16998
|
+
* @private
|
|
16999
|
+
*/
|
|
17000
|
+
getElementHeight(element) {
|
|
17001
|
+
return getElementHeight(element, this.uiStateValues.isTransformed);
|
|
17002
|
+
}
|
|
17003
|
+
/**
|
|
17004
|
+
* Method to get height from element
|
|
17005
|
+
*
|
|
17006
|
+
* @param {Element} element Accepts the DOM element
|
|
17007
|
+
* @param {string} elementClass Accepts the element class
|
|
17008
|
+
* @returns {number} Returns the height of the element
|
|
17009
|
+
* @private
|
|
17010
|
+
*/
|
|
17011
|
+
getElementHeightFromClass(element, elementClass) {
|
|
17012
|
+
return getElementHeightFromClass(element, elementClass, this.uiStateValues.isTransformed);
|
|
17013
|
+
}
|
|
16750
17014
|
/**
|
|
16751
17015
|
* Method to render react templates
|
|
16752
17016
|
*
|
|
@@ -16826,6 +17090,7 @@ let Schedule = class Schedule extends Component {
|
|
|
16826
17090
|
this.headerModule = new HeaderRenderer(this);
|
|
16827
17091
|
}
|
|
16828
17092
|
this.renderTableContainer();
|
|
17093
|
+
this.uiStateValues.isTransformed = Math.round(this.element.getBoundingClientRect().width) !== this.element.offsetWidth;
|
|
16829
17094
|
if (Browser.isDevice || Browser.isTouch) {
|
|
16830
17095
|
this.scheduleTouchModule = new ScheduleTouch(this);
|
|
16831
17096
|
}
|
|
@@ -17320,7 +17585,7 @@ let Schedule = class Schedule extends Component {
|
|
|
17320
17585
|
this.uiStateValues = {
|
|
17321
17586
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
17322
17587
|
isIgnoreOccurrence: false, groupIndex: this.adaptiveGroupIndex, action: false,
|
|
17323
|
-
isBlock: false, isCustomMonth: true, isPreventTimezone: false
|
|
17588
|
+
isBlock: false, isCustomMonth: true, isPreventTimezone: false, isTransformed: false
|
|
17324
17589
|
};
|
|
17325
17590
|
}
|
|
17326
17591
|
this.currentTimezoneDate = this.getCurrentTime();
|
|
@@ -17812,7 +18077,8 @@ let Schedule = class Schedule extends Component {
|
|
|
17812
18077
|
}
|
|
17813
18078
|
onScheduleResize() {
|
|
17814
18079
|
if (isNullOrUndefined(this.activeView) || ((this.isAdaptive || isMobile()) && document.activeElement
|
|
17815
|
-
&& document.activeElement.classList.contains(SUBJECT_CLASS)
|
|
18080
|
+
&& (document.activeElement.classList.contains(SUBJECT_CLASS) ||
|
|
18081
|
+
document.activeElement.classList.contains(INLINE_SUBJECT_CLASS))) || this.uiStateValues.isTapHold) {
|
|
17816
18082
|
return;
|
|
17817
18083
|
}
|
|
17818
18084
|
if (this.virtualScrollModule && this.activeView.isTimelineView()) {
|
|
@@ -17835,6 +18101,12 @@ let Schedule = class Schedule extends Component {
|
|
|
17835
18101
|
this.virtualScrollModule.isRemoteRefresh = false;
|
|
17836
18102
|
}
|
|
17837
18103
|
this.refreshEvents(isRemoteRefresh);
|
|
18104
|
+
if (this.virtualScrollModule && !this.virtualScrollModule.enableTransition) {
|
|
18105
|
+
const resWrap = this.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
18106
|
+
const conWrap = this.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
18107
|
+
this.virtualScrollModule.enableTransition = true;
|
|
18108
|
+
addClass([conWrap, resWrap], 'e-transition');
|
|
18109
|
+
}
|
|
17838
18110
|
}
|
|
17839
18111
|
else {
|
|
17840
18112
|
this.notify(contentReady, {});
|
|
@@ -18705,6 +18977,9 @@ let Schedule = class Schedule extends Component {
|
|
|
18705
18977
|
* @returns {void}
|
|
18706
18978
|
*/
|
|
18707
18979
|
scrollTo(hour, scrollDate) {
|
|
18980
|
+
if (this.currentView.indexOf('Agenda') < 0 && isNullOrUndefined(this.element.querySelector('.e-work-cells'))) {
|
|
18981
|
+
return;
|
|
18982
|
+
}
|
|
18708
18983
|
if (this.activeView.scrollToDate && isNullOrUndefined(hour) && scrollDate) {
|
|
18709
18984
|
this.activeView.scrollToDate(scrollDate);
|
|
18710
18985
|
}
|
|
@@ -20180,8 +20455,8 @@ class Resize extends ActionBase {
|
|
|
20180
20455
|
};
|
|
20181
20456
|
this.actionObj.groupIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : 0;
|
|
20182
20457
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20183
|
-
this.actionObj.cellWidth = getElementWidth(workCell);
|
|
20184
|
-
this.actionObj.cellHeight = getElementHeight(workCell);
|
|
20458
|
+
this.actionObj.cellWidth = this.parent.getElementWidth(workCell);
|
|
20459
|
+
this.actionObj.cellHeight = this.parent.getElementHeight(workCell);
|
|
20185
20460
|
const hRows = this.parent.activeViewOptions.headerRows.map((row) => row.option);
|
|
20186
20461
|
if (this.parent.activeView.isTimelineView() && hRows.length > 0 && ['Date', 'Hour'].indexOf(hRows.slice(-1)[0]) < 0) {
|
|
20187
20462
|
const tr = this.parent.getContentTable().querySelector('tr');
|
|
@@ -20408,6 +20683,7 @@ class Resize extends ActionBase {
|
|
|
20408
20683
|
EventHandler.remove(document, Browser.touchEndEvent, this.resizeStop);
|
|
20409
20684
|
clearInterval(this.actionObj.scrollInterval);
|
|
20410
20685
|
this.actionObj.scrollInterval = null;
|
|
20686
|
+
this.actionObj.action = null;
|
|
20411
20687
|
this.removeCloneElementClasses();
|
|
20412
20688
|
this.removeCloneElement();
|
|
20413
20689
|
this.actionClass('removeClass');
|
|
@@ -20483,9 +20759,10 @@ class Resize extends ActionBase {
|
|
|
20483
20759
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
20484
20760
|
offsetValue = Math.round(offsetValue / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20485
20761
|
if (!isLeft) {
|
|
20486
|
-
offsetValue += (getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20762
|
+
offsetValue += (this.parent.getElementWidth(this.actionObj.clone) - this.actionObj.cellWidth);
|
|
20487
20763
|
}
|
|
20488
|
-
cellIndex = Math.
|
|
20764
|
+
cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
|
|
20765
|
+
Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
|
|
20489
20766
|
isDateHeader = isTimeViews && headerName === 'Date';
|
|
20490
20767
|
cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
|
|
20491
20768
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20494,7 +20771,7 @@ class Resize extends ActionBase {
|
|
|
20494
20771
|
else {
|
|
20495
20772
|
const cellWidth = this.actionObj.cellWidth;
|
|
20496
20773
|
cellIndex = isLeft ? Math.floor(offset / this.actionObj.cellWidth) :
|
|
20497
|
-
Math.ceil((offset + (getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
20774
|
+
Math.ceil((offset + (this.parent.getElementWidth(this.actionObj.clone) - cellWidth)) / this.actionObj.cellWidth);
|
|
20498
20775
|
if (this.parent.enableRtl) {
|
|
20499
20776
|
let cellOffsetWidth = 0;
|
|
20500
20777
|
if (headerName === 'TimelineMonth' || (!this.parent.activeViewOptions.timeScale.enable &&
|
|
@@ -20502,7 +20779,7 @@ class Resize extends ActionBase {
|
|
|
20502
20779
|
cellOffsetWidth = this.actionObj.cellWidth;
|
|
20503
20780
|
}
|
|
20504
20781
|
const offsetWidth = (Math.floor(offset / this.actionObj.cellWidth) *
|
|
20505
|
-
this.actionObj.cellWidth) + (isLeft ? 0 : getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20782
|
+
this.actionObj.cellWidth) + (isLeft ? 0 : this.parent.getElementWidth(this.actionObj.clone) - cellOffsetWidth);
|
|
20506
20783
|
cellIndex = Math.floor(offsetWidth / this.actionObj.cellWidth);
|
|
20507
20784
|
}
|
|
20508
20785
|
isLastCell = cellIndex === tdCollections.length;
|
|
@@ -20521,7 +20798,7 @@ class Resize extends ActionBase {
|
|
|
20521
20798
|
}
|
|
20522
20799
|
else {
|
|
20523
20800
|
if (!isLeft) {
|
|
20524
|
-
offset += getElementWidth(this.actionObj.clone);
|
|
20801
|
+
offset += this.parent.getElementWidth(this.actionObj.clone);
|
|
20525
20802
|
}
|
|
20526
20803
|
let spanMinutes = Math.ceil((this.actionObj.slotInterval / this.actionObj.cellWidth) *
|
|
20527
20804
|
(offset - Math.floor(offset / this.actionObj.cellWidth) * this.actionObj.cellWidth));
|
|
@@ -20533,9 +20810,9 @@ class Resize extends ActionBase {
|
|
|
20533
20810
|
}
|
|
20534
20811
|
else {
|
|
20535
20812
|
const cloneIndex = closest(this.actionObj.clone, 'td').cellIndex;
|
|
20536
|
-
const originalWidth = Math.ceil((isLeft ? getElementWidth(this.actionObj.element) : 0) /
|
|
20813
|
+
const originalWidth = Math.ceil((isLeft ? this.parent.getElementWidth(this.actionObj.element) : 0) /
|
|
20537
20814
|
this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20538
|
-
const noOfDays = Math.ceil((getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20815
|
+
const noOfDays = Math.ceil((this.parent.getElementWidth(this.actionObj.clone) - originalWidth) /
|
|
20539
20816
|
this.actionObj.cellWidth);
|
|
20540
20817
|
const tr = closest(this.actionObj.clone, 'tr');
|
|
20541
20818
|
let dayIndex = isLeft ? cloneIndex - noOfDays : cloneIndex + noOfDays - 1;
|
|
@@ -20598,9 +20875,9 @@ class Resize extends ActionBase {
|
|
|
20598
20875
|
const slotInterval = (this.actionObj.cellWidth / this.actionObj.slotInterval) * this.actionObj.interval;
|
|
20599
20876
|
const pageWidth = isLeft ? (this.actionObj.X - this.actionObj.pageX) : (this.actionObj.pageX - this.actionObj.X);
|
|
20600
20877
|
const targetWidth = isTimelineView ?
|
|
20601
|
-
(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
20602
|
-
this.parent.currentView === 'Month' ? getElementWidth(this.actionObj.element) :
|
|
20603
|
-
Math.ceil(getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20878
|
+
(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth :
|
|
20879
|
+
this.parent.currentView === 'Month' ? this.parent.getElementWidth(this.actionObj.element) :
|
|
20880
|
+
Math.ceil(this.parent.getElementWidth(this.actionObj.element) / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
20604
20881
|
let offsetWidth = targetWidth + (Math.ceil(pageWidth / this.actionObj.cellWidth) * this.actionObj.cellWidth);
|
|
20605
20882
|
const left = (this.parent.enableRtl) ? parseInt(this.actionObj.element.style.right, 10) : this.actionObj.clone.offsetLeft;
|
|
20606
20883
|
if (isTimeViews) {
|
|
@@ -20615,7 +20892,7 @@ class Resize extends ActionBase {
|
|
|
20615
20892
|
this.actionObj.event[this.parent.eventFields.isAllDay] = false;
|
|
20616
20893
|
}
|
|
20617
20894
|
let width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
|
|
20618
|
-
getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20895
|
+
this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
|
|
20619
20896
|
if (this.parent.enableRtl) {
|
|
20620
20897
|
let rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
|
|
20621
20898
|
-(offsetWidth - this.actionObj.cellWidth);
|
|
@@ -20629,7 +20906,7 @@ class Resize extends ActionBase {
|
|
|
20629
20906
|
}
|
|
20630
20907
|
rightValue = rightValue >= this.scrollArgs.width ? this.scrollArgs.width - this.actionObj.cellWidth : rightValue;
|
|
20631
20908
|
styles.right = formatUnit(rightValue);
|
|
20632
|
-
width = width + rightValue > this.scrollArgs.width ? getElementWidth(this.actionObj.clone) : width;
|
|
20909
|
+
width = width + rightValue > this.scrollArgs.width ? this.parent.getElementWidth(this.actionObj.clone) : width;
|
|
20633
20910
|
}
|
|
20634
20911
|
else {
|
|
20635
20912
|
let offsetLeft = isLeft ? this.actionObj.element.offsetLeft - (this.actionObj.X - this.actionObj.pageX) :
|
|
@@ -20637,12 +20914,12 @@ class Resize extends ActionBase {
|
|
|
20637
20914
|
if (isTimelineView) {
|
|
20638
20915
|
offsetLeft = isLeft ? offsetLeft : parseInt(this.actionObj.clone.style.left, 10);
|
|
20639
20916
|
if (this.parent.enableRtl) {
|
|
20640
|
-
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - getElementWidth(this.actionObj.clone))
|
|
20917
|
+
offsetLeft = !isLeft ? (this.actionObj.pageX < this.actionObj.X - this.parent.getElementWidth(this.actionObj.clone))
|
|
20641
20918
|
? parseInt(this.actionObj.clone.style.right, 10) : offsetLeft : offsetLeft;
|
|
20642
20919
|
}
|
|
20643
20920
|
else {
|
|
20644
|
-
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + getElementWidth(this.actionObj.clone) &&
|
|
20645
|
-
getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
20921
|
+
offsetLeft = isLeft ? (this.actionObj.pageX > this.actionObj.X + this.parent.getElementWidth(this.actionObj.clone) &&
|
|
20922
|
+
this.parent.getElementWidth(this.actionObj.clone) === this.actionObj.cellWidth) ?
|
|
20646
20923
|
parseInt(this.actionObj.clone.style.left, 10) : offsetLeft : offsetLeft;
|
|
20647
20924
|
}
|
|
20648
20925
|
}
|
|
@@ -20658,10 +20935,10 @@ class Resize extends ActionBase {
|
|
|
20658
20935
|
}
|
|
20659
20936
|
else {
|
|
20660
20937
|
offsetLeft = 0;
|
|
20661
|
-
width = getElementWidth(this.actionObj.clone);
|
|
20938
|
+
width = this.parent.getElementWidth(this.actionObj.clone);
|
|
20662
20939
|
}
|
|
20663
20940
|
}
|
|
20664
|
-
const cloneWidth = Math.ceil(getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
20941
|
+
const cloneWidth = Math.ceil(this.parent.getElementWidth(this.actionObj.clone) / this.actionObj.cellWidth) *
|
|
20665
20942
|
this.actionObj.cellWidth;
|
|
20666
20943
|
if (isLeft) {
|
|
20667
20944
|
styles.left = formatUnit(isTimelineView ? offsetLeft : isLeft ? leftValue < 0 ? -offsetLeft :
|
|
@@ -20753,8 +21030,8 @@ class YearEvent extends TimelineEvent {
|
|
|
20753
21030
|
const monthDate = new Date(this.parent.selectedDate.getFullYear(), month, 1);
|
|
20754
21031
|
const monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
20755
21032
|
const monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
|
|
20756
|
-
let startDate = getWeekFirstDate(monthStart, this.parent.firstDayOfWeek);
|
|
20757
|
-
const endDate = addDays(getWeekLastDate(monthEnd, this.parent.firstDayOfWeek), 1);
|
|
21033
|
+
let startDate = getWeekFirstDate(monthStart, this.parent.activeViewOptions.firstDayOfWeek);
|
|
21034
|
+
const endDate = addDays(getWeekLastDate(monthEnd, this.parent.activeViewOptions.firstDayOfWeek), 1);
|
|
20758
21035
|
for (let index = 0; startDate.getTime() < endDate.getTime(); index++) {
|
|
20759
21036
|
const start = resetTime(new Date(startDate.getTime()));
|
|
20760
21037
|
const end = addDays(new Date(start.getTime()), 1);
|
|
@@ -20774,10 +21051,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20774
21051
|
}
|
|
20775
21052
|
timelineYearViewEvents() {
|
|
20776
21053
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
20777
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21054
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20778
21055
|
this.cellHeader = getOuterHeight(workCell.querySelector('.' + DATE_HEADER_CLASS));
|
|
20779
21056
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20780
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21057
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20781
21058
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20782
21059
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20783
21060
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20924,10 +21201,10 @@ class YearEvent extends TimelineEvent {
|
|
|
20924
21201
|
const contentTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
20925
21202
|
const isVerticalScrollbarAvail = contentTable.offsetWidth > contentTable.clientWidth;
|
|
20926
21203
|
const workCell = this.parent.element.querySelector('.' + WORK_CELLS_CLASS);
|
|
20927
|
-
this.cellWidth = getElementWidth(workCell);
|
|
21204
|
+
this.cellWidth = this.parent.getElementWidth(workCell);
|
|
20928
21205
|
this.cellHeader = 0;
|
|
20929
21206
|
const eventTable = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
20930
|
-
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
21207
|
+
this.eventHeight = this.parent.getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
20931
21208
|
const selector = `.${MONTH_HEADER_WRAPPER} tbody tr,.${RESOURCE_COLUMN_TABLE_CLASS} tbody tr,.${CONTENT_TABLE_CLASS} tbody tr`;
|
|
20932
21209
|
this.addCellHeight(selector, this.eventHeight, EVENT_GAP$2, this.cellHeader, this.moreIndicatorHeight);
|
|
20933
21210
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
@@ -20969,7 +21246,7 @@ class YearEvent extends TimelineEvent {
|
|
|
20969
21246
|
appWrapper.forEach((appWrap, cellIndex) => {
|
|
20970
21247
|
const td = row.querySelector(`td:nth-child(${cellIndex + 1})`);
|
|
20971
21248
|
const app = [].slice.call(appWrap.children);
|
|
20972
|
-
const width = getElementWidth(td);
|
|
21249
|
+
const width = this.parent.getElementWidth(td);
|
|
20973
21250
|
const left = td.offsetLeft;
|
|
20974
21251
|
if (this.parent.enableRtl) {
|
|
20975
21252
|
const right = conTable.offsetWidth - left - td.offsetWidth;
|
|
@@ -21312,13 +21589,18 @@ class DragAndDrop extends ActionBase {
|
|
|
21312
21589
|
this.isAllDayTarget = false;
|
|
21313
21590
|
this.targetTd = null;
|
|
21314
21591
|
this.isCursorAhead = false;
|
|
21592
|
+
this.enableCurrentViewDrag = false;
|
|
21593
|
+
this.isPreventMultiDrag = false;
|
|
21594
|
+
this.slotsUptoCursor = -1;
|
|
21595
|
+
this.eleTop = 0;
|
|
21315
21596
|
}
|
|
21316
21597
|
wireDragEvent(element) {
|
|
21598
|
+
const isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
|
|
21317
21599
|
new Draggable(element, {
|
|
21318
21600
|
abort: '.' + EVENT_RESIZE_CLASS,
|
|
21319
21601
|
clone: true,
|
|
21320
21602
|
isDragScroll: true,
|
|
21321
|
-
enableTailMode: (this.parent.eventDragArea) ? true : false,
|
|
21603
|
+
enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
|
|
21322
21604
|
cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
|
|
21323
21605
|
dragArea: this.dragArea,
|
|
21324
21606
|
dragStart: this.dragStart.bind(this),
|
|
@@ -21341,6 +21623,8 @@ class DragAndDrop extends ActionBase {
|
|
|
21341
21623
|
}
|
|
21342
21624
|
this.setDragActionDefaultValues();
|
|
21343
21625
|
this.actionObj.element = e.element;
|
|
21626
|
+
this.eleTop = parseFloat(this.actionObj.element.style.top);
|
|
21627
|
+
this.slotsUptoCursor = -1;
|
|
21344
21628
|
this.actionObj.action = 'drag';
|
|
21345
21629
|
let elements = [];
|
|
21346
21630
|
if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
|
|
@@ -21419,12 +21703,21 @@ class DragAndDrop extends ActionBase {
|
|
|
21419
21703
|
}
|
|
21420
21704
|
let top = parseInt(e.top, 10);
|
|
21421
21705
|
top = top < 0 ? 0 : top;
|
|
21422
|
-
|
|
21706
|
+
if (this.slotsUptoCursor < 0) {
|
|
21707
|
+
const cellsCountUptoCursor = Math.floor(top / cellHeight);
|
|
21708
|
+
const cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
|
|
21709
|
+
this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
|
|
21710
|
+
}
|
|
21711
|
+
top = (Math.floor((top + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
|
|
21712
|
+
topValue = formatUnit(top < 0 ? 0 : top);
|
|
21423
21713
|
const scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
|
|
21424
21714
|
const cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
|
|
21425
21715
|
if (cloneBottom > scrollHeight) {
|
|
21426
21716
|
topValue = (parseInt(topValue, 10) - (cloneBottom - scrollHeight)) + 'px';
|
|
21427
21717
|
}
|
|
21718
|
+
if (this.isPreventMultiDrag) {
|
|
21719
|
+
topValue = formatUnit(this.actionObj.clone.offsetTop);
|
|
21720
|
+
}
|
|
21428
21721
|
}
|
|
21429
21722
|
return { left: leftValue, top: topValue };
|
|
21430
21723
|
}
|
|
@@ -21475,6 +21768,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21475
21768
|
this.actionObj.interval = dragEventArgs.interval;
|
|
21476
21769
|
this.actionObj.navigation = dragEventArgs.navigation;
|
|
21477
21770
|
this.actionObj.scroll = dragEventArgs.scroll;
|
|
21771
|
+
this.enableCurrentViewDrag = dragArgs.dragWithinRange && !dragArgs.navigation.enable && this.parent.allowMultiDrag;
|
|
21478
21772
|
this.actionObj.excludeSelectors = dragEventArgs.excludeSelectors;
|
|
21479
21773
|
const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
21480
21774
|
this.scrollArgs = { element: viewElement, width: viewElement.scrollWidth, height: viewElement.scrollHeight };
|
|
@@ -21633,6 +21927,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21633
21927
|
}
|
|
21634
21928
|
dragStop(e) {
|
|
21635
21929
|
this.isCursorAhead = false;
|
|
21930
|
+
this.isPreventMultiDrag = false;
|
|
21636
21931
|
this.removeCloneElementClasses();
|
|
21637
21932
|
this.removeCloneElement();
|
|
21638
21933
|
clearInterval(this.actionObj.navigationInterval);
|
|
@@ -21700,7 +21995,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21700
21995
|
this.timelineEventModule.cellWidth = this.actionObj.cellWidth;
|
|
21701
21996
|
this.timelineEventModule.getSlotDates();
|
|
21702
21997
|
this.actionObj.cellWidth = this.isHeaderRows ? this.timelineEventModule.cellWidth :
|
|
21703
|
-
getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21998
|
+
this.parent.getElementWidth(this.parent.element.querySelector('.' + WORK_CELLS_CLASS));
|
|
21704
21999
|
this.calculateTimelineTime(e);
|
|
21705
22000
|
}
|
|
21706
22001
|
else {
|
|
@@ -21843,7 +22138,7 @@ class DragAndDrop extends ActionBase {
|
|
|
21843
22138
|
(dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
|
|
21844
22139
|
(this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
|
|
21845
22140
|
offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
|
|
21846
|
-
if (dragArea.scrollTop > 0) {
|
|
22141
|
+
if (dragArea.scrollTop > 0 && offsetTop < dragArea.scrollHeight) {
|
|
21847
22142
|
this.actionObj.clone.style.top = formatUnit(offsetTop);
|
|
21848
22143
|
}
|
|
21849
22144
|
}
|
|
@@ -21875,7 +22170,9 @@ class DragAndDrop extends ActionBase {
|
|
|
21875
22170
|
let dragStart;
|
|
21876
22171
|
let dragEnd;
|
|
21877
22172
|
if (this.parent.activeViewOptions.timeScale.enable && !this.isAllDayDrag) {
|
|
21878
|
-
this.
|
|
22173
|
+
if (!this.enableCurrentViewDrag || this.multiData.length === 0) {
|
|
22174
|
+
this.appendCloneElement(this.getEventWrapper(colIndex));
|
|
22175
|
+
}
|
|
21879
22176
|
dragStart = this.parent.getDateFromElement(td);
|
|
21880
22177
|
dragStart.setMinutes(dragStart.getMinutes() + (diffInMinutes / heightPerMinute));
|
|
21881
22178
|
dragEnd = new Date(dragStart.getTime());
|
|
@@ -21931,18 +22228,34 @@ class DragAndDrop extends ActionBase {
|
|
|
21931
22228
|
this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
|
|
21932
22229
|
}
|
|
21933
22230
|
const startTimeDiff = event[this.parent.eventFields.startTime].getTime() - this.startTime;
|
|
21934
|
-
|
|
21935
|
-
this.
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21939
|
-
const
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
22231
|
+
if (this.enableCurrentViewDrag) {
|
|
22232
|
+
const renderDates = this.getRenderedDates();
|
|
22233
|
+
for (let i = 0; i < this.multiData.length; i++) {
|
|
22234
|
+
const eventObj = extend({}, this.multiData[parseInt(i.toString(), 10)], null, true);
|
|
22235
|
+
const startTime = new Date(eventObj[this.parent.eventFields.startTime].getTime() + startTimeDiff);
|
|
22236
|
+
const dayIndex = this.parent.getIndexOfDate(renderDates, resetTime(startTime));
|
|
22237
|
+
if (dayIndex < 0) {
|
|
22238
|
+
this.isPreventMultiDrag = true;
|
|
22239
|
+
break;
|
|
22240
|
+
}
|
|
22241
|
+
this.isPreventMultiDrag = false;
|
|
22242
|
+
}
|
|
22243
|
+
}
|
|
22244
|
+
if (!this.isPreventMultiDrag) {
|
|
22245
|
+
for (let index = 0; index < this.multiData.length; index++) {
|
|
22246
|
+
this.updatedData[parseInt(index.toString(), 10)] =
|
|
22247
|
+
this.updateMultipleData(this.multiData[parseInt(index.toString(), 10)], startTimeDiff);
|
|
22248
|
+
const dayIndex = this.getDayIndex(this.updatedData[parseInt(index.toString(), 10)]);
|
|
22249
|
+
if (dayIndex >= 0) {
|
|
22250
|
+
const isAllDay = this.updatedData[parseInt(index.toString(), 10)][this.parent.eventFields.isAllDay];
|
|
22251
|
+
const wrapper = this.getEventWrapper(dayIndex, isAllDay);
|
|
22252
|
+
this.appendCloneElement(wrapper, this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
|
|
22253
|
+
this.updateEventHeight(this.updatedData[parseInt(index.toString(), 10)], index, dayIndex);
|
|
22254
|
+
}
|
|
22255
|
+
else {
|
|
22256
|
+
if (!isNullOrUndefined(this.actionObj.cloneElement[parseInt(index.toString(), 10)].parentNode)) {
|
|
22257
|
+
remove(this.actionObj.cloneElement[parseInt(index.toString(), 10)]);
|
|
22258
|
+
}
|
|
21946
22259
|
}
|
|
21947
22260
|
}
|
|
21948
22261
|
}
|
|
@@ -22072,7 +22385,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22072
22385
|
let appHeight = this.parent.activeViewOptions.timeScale.enable ? this.verticalEvent.getHeight(eStart, eEnd) :
|
|
22073
22386
|
this.actionObj.element.offsetHeight;
|
|
22074
22387
|
let topValue = this.parent.activeViewOptions.timeScale.enable ?
|
|
22075
|
-
this.verticalEvent.getTopValue(eStart
|
|
22388
|
+
this.verticalEvent.getTopValue(eStart) : this.actionObj.element.offsetTop;
|
|
22076
22389
|
if (isNullOrUndefined(index)) {
|
|
22077
22390
|
if (i === 0) {
|
|
22078
22391
|
this.actionObj.clone.style.top = formatUnit(topValue);
|
|
@@ -22158,6 +22471,9 @@ class DragAndDrop extends ActionBase {
|
|
|
22158
22471
|
}
|
|
22159
22472
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22160
22473
|
swapDragging(e) {
|
|
22474
|
+
if (this.isPreventMultiDrag) {
|
|
22475
|
+
return;
|
|
22476
|
+
}
|
|
22161
22477
|
const colIndex = !isNullOrUndefined(closest(this.actionObj.target, 'td')) && closest(this.actionObj.target, 'td').cellIndex;
|
|
22162
22478
|
if (closest(this.actionObj.target, '.' + DATE_HEADER_WRAP_CLASS) &&
|
|
22163
22479
|
!closest(this.actionObj.clone, '.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS)) {
|
|
@@ -22281,7 +22597,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22281
22597
|
getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
22282
22598
|
let offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
|
|
22283
22599
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
22284
|
-
offsetLeft = Math.
|
|
22600
|
+
offsetLeft = Math.round(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
22285
22601
|
let rightOffset;
|
|
22286
22602
|
if (this.parent.enableRtl) {
|
|
22287
22603
|
rightOffset = Math.abs(parseInt(this.actionObj.clone.style.right, 10));
|
|
@@ -22467,7 +22783,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22467
22783
|
return 0;
|
|
22468
22784
|
}
|
|
22469
22785
|
getColumnIndex(offsetLeft) {
|
|
22470
|
-
const index = Math.
|
|
22786
|
+
const index = Math.round(offsetLeft / this.actionObj.cellWidth);
|
|
22471
22787
|
if (this.isHeaderRows) {
|
|
22472
22788
|
return index;
|
|
22473
22789
|
}
|
|
@@ -22512,7 +22828,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22512
22828
|
~~(dragArea.querySelector('table').offsetHeight / trCollection.length) : this.actionObj.cellHeight;
|
|
22513
22829
|
let rowIndex = Math.floor(Math.floor((this.actionObj.Y +
|
|
22514
22830
|
(dragArea.scrollTop - translateY - (window.scrollY || window.pageYOffset))) -
|
|
22515
|
-
getElementTop(dragArea)) / rowHeight);
|
|
22831
|
+
getElementTop(dragArea, this.parent.uiStateValues.isTransformed)) / rowHeight);
|
|
22516
22832
|
rowIndex = (rowIndex < 0) ? 0 : (rowIndex > trCollection.length - 1) ? trCollection.length - 1 : rowIndex;
|
|
22517
22833
|
this.actionObj.index = rowIndex;
|
|
22518
22834
|
const eventContainer = this.parent.element.querySelectorAll('.e-appointment-container:not(.e-hidden)').item(rowIndex);
|
|
@@ -22528,7 +22844,7 @@ class DragAndDrop extends ActionBase {
|
|
|
22528
22844
|
if (!isNullOrUndefined(this.parent.eventDragArea)) {
|
|
22529
22845
|
return;
|
|
22530
22846
|
}
|
|
22531
|
-
let top = getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22847
|
+
let top = this.parent.getElementHeight(trCollection[parseInt(rowIndex.toString(), 10)]) * rowIndex;
|
|
22532
22848
|
if (this.parent.rowAutoHeight) {
|
|
22533
22849
|
const cursorElement = this.getCursorElement(e);
|
|
22534
22850
|
if (cursorElement) {
|
|
@@ -22857,6 +23173,10 @@ class ViewBase {
|
|
|
22857
23173
|
}
|
|
22858
23174
|
startHour.setMilliseconds(0);
|
|
22859
23175
|
endHour.setMilliseconds(0);
|
|
23176
|
+
if (resetTime(date).getTime() !== resetTime(startHour).getTime()) {
|
|
23177
|
+
startHour = new Date(2000, 0, 0, startHour.getHours(), startHour.getMinutes(), startHour.getMilliseconds());
|
|
23178
|
+
endHour = new Date(2000, 0, 0, endHour.getHours(), endHour.getMinutes(), endHour.getMilliseconds());
|
|
23179
|
+
}
|
|
22860
23180
|
return !(getDateInMs(date) < getDateInMs(startHour) || getDateInMs(date) >= getDateInMs(endHour) ||
|
|
22861
23181
|
!this.isWorkDay(date, workDays));
|
|
22862
23182
|
}
|
|
@@ -23085,7 +23405,7 @@ class ViewBase {
|
|
|
23085
23405
|
if (this.isTimelineView()) {
|
|
23086
23406
|
const colElements = this.getColElements();
|
|
23087
23407
|
const contentBody = this.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
23088
|
-
const colWidth = (getElementWidth(contentBody) / (colElements.length / 2));
|
|
23408
|
+
const colWidth = (this.parent.getElementWidth(contentBody) / (colElements.length / 2));
|
|
23089
23409
|
if (content.offsetHeight !== content.clientHeight) {
|
|
23090
23410
|
const resourceColumn = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
23091
23411
|
if (!isNullOrUndefined(resourceColumn) && resourceColumn.offsetHeight !== content.clientHeight) {
|
|
@@ -23215,6 +23535,15 @@ class ViewBase {
|
|
|
23215
23535
|
this.parent.resourceBase.expandedResources = this.colLevels[this.colLevels.length - 1];
|
|
23216
23536
|
}
|
|
23217
23537
|
}
|
|
23538
|
+
getGroupIndices(dataCollection) {
|
|
23539
|
+
let groupIndices = [];
|
|
23540
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0 && (dataCollection ||
|
|
23541
|
+
this.parent.virtualScrollModule.existingDataCollection.length > 0) && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
23542
|
+
dataCollection = isNullOrUndefined(dataCollection) ? this.parent.virtualScrollModule.existingDataCollection : dataCollection;
|
|
23543
|
+
groupIndices = dataCollection.map((data) => data.groupIndex);
|
|
23544
|
+
}
|
|
23545
|
+
return groupIndices;
|
|
23546
|
+
}
|
|
23218
23547
|
destroy() {
|
|
23219
23548
|
if (this.element && this.element.parentNode) {
|
|
23220
23549
|
remove(this.element);
|
|
@@ -23445,11 +23774,8 @@ class VerticalView extends ViewBase {
|
|
|
23445
23774
|
const currentDate = this.parent.getCurrentTime();
|
|
23446
23775
|
if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
|
|
23447
23776
|
const currentDateIndex = this.getCurrentTimeIndicatorIndex();
|
|
23448
|
-
if (currentDateIndex.length > 0) {
|
|
23449
|
-
|
|
23450
|
-
if (workCells.length > 0) {
|
|
23451
|
-
this.changeCurrentTimePosition();
|
|
23452
|
-
}
|
|
23777
|
+
if (currentDateIndex.length > 0 && !isNullOrUndefined(this.element.querySelector('.' + WORK_CELLS_CLASS))) {
|
|
23778
|
+
this.changeCurrentTimePosition();
|
|
23453
23779
|
if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
|
|
23454
23780
|
const interval = MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
|
|
23455
23781
|
if (interval <= (MS_PER_MINUTE - 1000)) {
|
|
@@ -23546,7 +23872,11 @@ class VerticalView extends ViewBase {
|
|
|
23546
23872
|
curTimeWrap[parseInt(i.toString(), 10)].appendChild(createElement('div', { className: PREVIOUS_TIMELINE_CLASS, styles: 'top:' + topInPx }));
|
|
23547
23873
|
}
|
|
23548
23874
|
for (const day of currentDateIndex) {
|
|
23549
|
-
curTimeWrap
|
|
23875
|
+
if (curTimeWrap.length > day) {
|
|
23876
|
+
curTimeWrap[parseInt(day.toString(), 10)].appendChild(createElement('div', {
|
|
23877
|
+
className: CURRENT_TIMELINE_CLASS, styles: 'top:' + topInPx
|
|
23878
|
+
}));
|
|
23879
|
+
}
|
|
23550
23880
|
}
|
|
23551
23881
|
const currentTimeEle = createElement('div', {
|
|
23552
23882
|
innerHTML: this.parent.getTimeString(this.parent.getCurrentTime()),
|
|
@@ -23563,13 +23893,13 @@ class VerticalView extends ViewBase {
|
|
|
23563
23893
|
}
|
|
23564
23894
|
}
|
|
23565
23895
|
getTopFromDateTime(date) {
|
|
23566
|
-
const startHour = this.
|
|
23896
|
+
const startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
|
|
23567
23897
|
const diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
|
|
23568
23898
|
return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) /
|
|
23569
23899
|
this.parent.activeViewOptions.timeScale.interval;
|
|
23570
23900
|
}
|
|
23571
23901
|
getWorkCellHeight() {
|
|
23572
|
-
return parseFloat(getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
23902
|
+
return parseFloat(this.parent.getElementHeight(this.element.querySelector('.' + WORK_CELLS_CLASS)).toFixed(2));
|
|
23573
23903
|
}
|
|
23574
23904
|
getTdContent(date, type, groupIndex) {
|
|
23575
23905
|
let cntEle;
|
|
@@ -23870,11 +24200,20 @@ class VerticalView extends ViewBase {
|
|
|
23870
24200
|
const rows = [];
|
|
23871
24201
|
const tr = createElement('tr');
|
|
23872
24202
|
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24203
|
+
const existingGroupIndices = this.getGroupIndices();
|
|
23873
24204
|
const handler = (r) => {
|
|
23874
24205
|
const ntr = tr.cloneNode();
|
|
23875
24206
|
for (const tdData of this.colLevels[this.colLevels.length - 1]) {
|
|
23876
|
-
|
|
23877
|
-
|
|
24207
|
+
let isAllowTdCreation = true;
|
|
24208
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.group.resources.length > 0) {
|
|
24209
|
+
if (existingGroupIndices.indexOf(tdData.groupIndex) > -1) {
|
|
24210
|
+
isAllowTdCreation = false;
|
|
24211
|
+
}
|
|
24212
|
+
}
|
|
24213
|
+
if (isAllowTdCreation) {
|
|
24214
|
+
const ntd = this.createContentTd(tdData, r, td);
|
|
24215
|
+
ntr.appendChild(ntd);
|
|
24216
|
+
}
|
|
23878
24217
|
}
|
|
23879
24218
|
rows.push(ntr);
|
|
23880
24219
|
return r;
|
|
@@ -24596,7 +24935,13 @@ class Month extends ViewBase {
|
|
|
24596
24935
|
const tr = createElement('tr');
|
|
24597
24936
|
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24598
24937
|
const slotDatas = this.getContentSlots();
|
|
24938
|
+
const isTimeline = this.parent.currentView === 'TimelineMonth';
|
|
24939
|
+
const existingGroupIndices = isTimeline ? this.getGroupIndices() : [];
|
|
24599
24940
|
for (let row = 0; row < slotDatas.length; row++) {
|
|
24941
|
+
if (existingGroupIndices.length > 0 &&
|
|
24942
|
+
existingGroupIndices.indexOf(slotDatas[parseInt(row.toString(), 10)][0].groupIndex) > -1) {
|
|
24943
|
+
continue;
|
|
24944
|
+
}
|
|
24600
24945
|
const ntr = tr.cloneNode();
|
|
24601
24946
|
for (let col = 0; col < slotDatas[parseInt(row.toString(), 10)].length; col++) {
|
|
24602
24947
|
const ntd = this.createContentTd(slotDatas[parseInt(row.toString(), 10)][parseInt(col.toString(), 10)], td);
|
|
@@ -24925,7 +25270,7 @@ class Year extends ViewBase {
|
|
|
24925
25270
|
this.setAriaAttributes(contentTable);
|
|
24926
25271
|
const thead = createElement('thead', { className: 'e-week-header' });
|
|
24927
25272
|
const tr = createElement('tr');
|
|
24928
|
-
let currentWeek = getWeekFirstDate(firstDateOfMonth(currentDate), this.parent.firstDayOfWeek);
|
|
25273
|
+
let currentWeek = getWeekFirstDate(firstDateOfMonth(currentDate), this.parent.activeViewOptions.firstDayOfWeek);
|
|
24929
25274
|
if (this.parent.activeViewOptions.showWeekNumber) {
|
|
24930
25275
|
tr.appendChild(createElement('th'));
|
|
24931
25276
|
}
|
|
@@ -25051,7 +25396,7 @@ class Year extends ViewBase {
|
|
|
25051
25396
|
return dateCol;
|
|
25052
25397
|
}
|
|
25053
25398
|
getMonthDates(date) {
|
|
25054
|
-
const startDate = getWeekFirstDate(firstDateOfMonth(date), this.parent.firstDayOfWeek);
|
|
25399
|
+
const startDate = getWeekFirstDate(firstDateOfMonth(date), this.parent.activeViewOptions.firstDayOfWeek);
|
|
25055
25400
|
const endDate = addDays(new Date(+startDate), (6 * WEEK_LENGTH));
|
|
25056
25401
|
const dateCollection = [];
|
|
25057
25402
|
for (let start = startDate; start.getTime() < endDate.getTime(); start = addDays(start, 1)) {
|
|
@@ -25183,10 +25528,10 @@ class Year extends ViewBase {
|
|
|
25183
25528
|
return addDays(addMonths(this.getStartDate(), this.parent.monthsCount), -1);
|
|
25184
25529
|
}
|
|
25185
25530
|
startDate() {
|
|
25186
|
-
return this.parent.currentView === 'Year' ? getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
|
|
25531
|
+
return this.parent.currentView === 'Year' ? getWeekFirstDate(this.getStartDate(), this.parent.activeViewOptions.firstDayOfWeek) : this.getStartDate();
|
|
25187
25532
|
}
|
|
25188
25533
|
endDate() {
|
|
25189
|
-
return this.parent.currentView === 'Year' ? addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) :
|
|
25534
|
+
return this.parent.currentView === 'Year' ? addDays(getWeekLastDate(this.getEndDate(), this.parent.activeViewOptions.firstDayOfWeek), 1) :
|
|
25190
25535
|
addDays(this.getEndDate(), 1);
|
|
25191
25536
|
}
|
|
25192
25537
|
getEndDateFromStartDate(start) {
|
|
@@ -25302,7 +25647,8 @@ class AgendaBase extends ViewBase {
|
|
|
25302
25647
|
const scheduleId = this.parent.element.id + '_';
|
|
25303
25648
|
const viewName = this.parent.activeViewOptions.eventTemplateName;
|
|
25304
25649
|
const templateId = scheduleId + viewName + 'eventTemplate';
|
|
25305
|
-
templateEle =
|
|
25650
|
+
templateEle =
|
|
25651
|
+
this.parent.getAppointmentTemplate()(listData[parseInt(li.toString(), 10)], this.parent, 'eventTemplate', templateId, false, undefined, undefined, this.parent.root);
|
|
25306
25652
|
if (!isNullOrUndefined(listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceRule])) {
|
|
25307
25653
|
const iconClass = (listData[parseInt(li.toString(), 10)][fieldMapping.id] ===
|
|
25308
25654
|
listData[parseInt(li.toString(), 10)][fieldMapping.recurrenceID]) ?
|
|
@@ -26305,7 +26651,7 @@ class TimelineHeaderRow {
|
|
|
26305
26651
|
const jsDate = +new Date(1970, 0, 1);
|
|
26306
26652
|
const tzOffsetDiff = d.getTimezoneOffset() - new Date(1970, 0, 1).getTimezoneOffset();
|
|
26307
26653
|
let key = Math.ceil(((((+d - jsDate) - (tzOffsetDiff * 60 * 1000)) / MS_PER_DAY) + new Date(jsDate).getDay() + 1) / 7);
|
|
26308
|
-
if (this.parent.firstDayOfWeek && this.parent.firstDayOfWeek > new Date(+d).getDay()) {
|
|
26654
|
+
if (this.parent.activeViewOptions.firstDayOfWeek && this.parent.activeViewOptions.firstDayOfWeek > new Date(+d).getDay()) {
|
|
26309
26655
|
key = key - 1;
|
|
26310
26656
|
}
|
|
26311
26657
|
result[parseInt(key.toString(), 10)] = result[parseInt(key.toString(), 10)] || [];
|
|
@@ -26443,7 +26789,7 @@ class TimelineViews extends VerticalView {
|
|
|
26443
26789
|
}
|
|
26444
26790
|
let scrollLeft;
|
|
26445
26791
|
if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
|
|
26446
|
-
scrollLeft = index * getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26792
|
+
scrollLeft = index * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26447
26793
|
}
|
|
26448
26794
|
else {
|
|
26449
26795
|
scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
|
|
@@ -26527,7 +26873,7 @@ class TimelineViews extends VerticalView {
|
|
|
26527
26873
|
if (this.parent.activeView.colLevels[parseInt(index.toString(), 10)] &&
|
|
26528
26874
|
this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan) {
|
|
26529
26875
|
diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[parseInt(index.toString(), 10)][0].colSpan *
|
|
26530
|
-
getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26876
|
+
this.parent.getElementWidth(this.element.querySelector('.e-work-cells'));
|
|
26531
26877
|
}
|
|
26532
26878
|
else {
|
|
26533
26879
|
const endHour = this.getEndHour();
|
|
@@ -26537,8 +26883,8 @@ class TimelineViews extends VerticalView {
|
|
|
26537
26883
|
}
|
|
26538
26884
|
}
|
|
26539
26885
|
}
|
|
26540
|
-
return diffInDates + ((diffInMinutes * getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
26541
|
-
this.parent.activeViewOptions.timeScale.interval);
|
|
26886
|
+
return diffInDates + ((diffInMinutes * this.parent.getElementWidth(this.element.querySelector('.e-work-cells'))
|
|
26887
|
+
* this.parent.activeViewOptions.timeScale.slotCount) / this.parent.activeViewOptions.timeScale.interval);
|
|
26542
26888
|
}
|
|
26543
26889
|
renderHeader() {
|
|
26544
26890
|
const tr = createElement('tr');
|
|
@@ -26605,7 +26951,12 @@ class TimelineViews extends VerticalView {
|
|
|
26605
26951
|
const tr = createElement('tr');
|
|
26606
26952
|
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
26607
26953
|
const trCount = this.getRowCount();
|
|
26954
|
+
const existingGroupIndices = this.getGroupIndices();
|
|
26608
26955
|
for (let i = 0; i < trCount; i++) {
|
|
26956
|
+
if (existingGroupIndices.length > 0 &&
|
|
26957
|
+
existingGroupIndices.indexOf(this.parent.resourceBase.renderedResources[parseInt(i.toString(), 10)].groupIndex) > -1) {
|
|
26958
|
+
continue;
|
|
26959
|
+
}
|
|
26609
26960
|
const ntr = tr.cloneNode();
|
|
26610
26961
|
for (let tdData of this.colLevels[this.colLevels.length - 1]) {
|
|
26611
26962
|
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
@@ -27089,13 +27440,17 @@ class TimelineYear extends Year {
|
|
|
27089
27440
|
getContentRows() {
|
|
27090
27441
|
const tRow = [];
|
|
27091
27442
|
const monthCells = this.getMonths();
|
|
27443
|
+
const existingGroupIndices = this.getGroupIndices();
|
|
27092
27444
|
for (let row = 0; row < this.parent.resourceBase.renderedResources.length; row++) {
|
|
27093
|
-
const tr = createElement('tr');
|
|
27094
|
-
tRow.push(tr);
|
|
27095
27445
|
let resData;
|
|
27096
27446
|
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
27097
27447
|
resData = this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)];
|
|
27448
|
+
if (existingGroupIndices.length > 0 && existingGroupIndices.indexOf(resData.groupIndex) > -1) {
|
|
27449
|
+
continue;
|
|
27450
|
+
}
|
|
27098
27451
|
}
|
|
27452
|
+
const tr = createElement('tr');
|
|
27453
|
+
tRow.push(tr);
|
|
27099
27454
|
let monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[parseInt(row.toString(), 10)], 1);
|
|
27100
27455
|
let date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
27101
27456
|
for (let month = 0; month < this.columnCount; month++) {
|
|
@@ -27800,6 +28155,7 @@ class Print {
|
|
|
27800
28155
|
Schedule.Inject(Day, Week, WorkWeek, Month, Agenda, MonthAgenda, TimelineViews, TimelineMonth, Year, TimelineYear);
|
|
27801
28156
|
this.printInstance = new Schedule(this.getPrintScheduleModel(printOptions));
|
|
27802
28157
|
this.printInstance.isPrinting = true;
|
|
28158
|
+
this.printInstance.registeredTemplate = this.parent.registeredTemplate;
|
|
27803
28159
|
this.printInstance.root = this.parent.root ? this.parent.root : this.parent;
|
|
27804
28160
|
this.printInstance.appendTo(element);
|
|
27805
28161
|
this.printInstance.on(print, this.contentReady, this);
|