@syncfusion/ej2-schedule 20.2.50 → 20.3.49
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/CHANGELOG.md +22 -0
- package/dist/ej2-schedule.min.js +10 -0
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +617 -217
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +636 -229
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +16 -16
- package/src/recurrence-editor/recurrence-editor-model.d.ts +1 -1
- package/src/recurrence-editor/recurrence-editor.d.ts +1 -0
- package/src/recurrence-editor/recurrence-editor.js +37 -10
- package/src/schedule/actions/action-base.js +5 -3
- package/src/schedule/actions/crud.js +1 -2
- package/src/schedule/actions/drag.js +18 -15
- package/src/schedule/actions/resize.js +1 -3
- package/src/schedule/actions/touch.js +2 -2
- package/src/schedule/actions/virtual-scroll.d.ts +12 -3
- package/src/schedule/actions/virtual-scroll.js +206 -54
- package/src/schedule/base/interface.d.ts +2 -1
- package/src/schedule/base/resource.d.ts +1 -0
- package/src/schedule/base/resource.js +12 -1
- package/src/schedule/base/schedule-model.d.ts +7 -0
- package/src/schedule/base/schedule.d.ts +13 -0
- package/src/schedule/base/schedule.js +13 -4
- package/src/schedule/base/util.d.ts +15 -0
- package/src/schedule/base/util.js +29 -3
- package/src/schedule/event-renderer/agenda-base.js +3 -5
- package/src/schedule/event-renderer/event-base.d.ts +2 -1
- package/src/schedule/event-renderer/event-base.js +30 -3
- package/src/schedule/event-renderer/month.d.ts +1 -0
- package/src/schedule/event-renderer/month.js +8 -6
- package/src/schedule/event-renderer/vertical-view.d.ts +3 -0
- package/src/schedule/event-renderer/vertical-view.js +32 -12
- package/src/schedule/event-renderer/year.js +1 -1
- package/src/schedule/exports/calendar-import.js +5 -0
- package/src/schedule/popups/event-window.d.ts +1 -0
- package/src/schedule/popups/event-window.js +35 -7
- package/src/schedule/popups/quick-popups.js +18 -5
- package/src/schedule/renderer/agenda.js +1 -0
- package/src/schedule/renderer/month.js +25 -6
- package/src/schedule/renderer/renderer.js +8 -2
- package/src/schedule/renderer/timeline-view.js +2 -2
- package/src/schedule/renderer/timeline-year.d.ts +1 -0
- package/src/schedule/renderer/timeline-year.js +20 -12
- package/src/schedule/renderer/vertical-view.d.ts +1 -1
- package/src/schedule/renderer/vertical-view.js +48 -44
- package/src/schedule/renderer/view-base.d.ts +2 -0
- package/src/schedule/renderer/view-base.js +31 -1
- package/src/schedule/renderer/year.d.ts +1 -1
- package/src/schedule/renderer/year.js +49 -30
- package/styles/bootstrap-dark.css +50 -33
- package/styles/bootstrap.css +50 -33
- package/styles/bootstrap4.css +50 -33
- package/styles/bootstrap5-dark.css +51 -38
- package/styles/bootstrap5.css +51 -38
- package/styles/fabric-dark.css +50 -33
- package/styles/fabric.css +50 -33
- package/styles/fluent-dark.css +52 -39
- package/styles/fluent.css +52 -39
- package/styles/highcontrast-light.css +50 -33
- package/styles/highcontrast.css +50 -33
- package/styles/material-dark.css +50 -33
- package/styles/material.css +50 -33
- package/styles/recurrence-editor/_all.scss +1 -1
- package/styles/recurrence-editor/_bootstrap-dark-definition.scss +1 -3
- package/styles/recurrence-editor/_bootstrap-definition.scss +1 -3
- package/styles/recurrence-editor/_bootstrap4-definition.scss +1 -3
- package/styles/recurrence-editor/_bootstrap5-definition.scss +1 -3
- package/styles/recurrence-editor/_fabric-dark-definition.scss +1 -4
- package/styles/recurrence-editor/_fabric-definition.scss +1 -3
- package/styles/recurrence-editor/_fluent-definition.scss +1 -3
- package/styles/recurrence-editor/_fusionnew-definition.scss +1 -3
- package/styles/recurrence-editor/_highcontrast-definition.scss +1 -3
- package/styles/recurrence-editor/_highcontrast-light-definition.scss +1 -3
- package/styles/recurrence-editor/_layout.scss +28 -38
- package/styles/recurrence-editor/_material-dark-definition.scss +1 -3
- package/styles/recurrence-editor/_material-definition.scss +1 -3
- package/styles/recurrence-editor/_material3-definition.scss +1 -3
- package/styles/recurrence-editor/_tailwind-definition.scss +1 -3
- package/styles/recurrence-editor/bootstrap-dark.css +21 -27
- package/styles/recurrence-editor/bootstrap.css +21 -27
- package/styles/recurrence-editor/bootstrap4.css +21 -27
- package/styles/recurrence-editor/bootstrap5-dark.css +21 -27
- package/styles/recurrence-editor/bootstrap5.css +21 -27
- package/styles/recurrence-editor/fabric-dark.css +21 -27
- package/styles/recurrence-editor/fabric.css +21 -27
- package/styles/recurrence-editor/fluent-dark.css +21 -27
- package/styles/recurrence-editor/fluent.css +21 -27
- package/styles/recurrence-editor/highcontrast-light.css +21 -27
- package/styles/recurrence-editor/highcontrast.css +21 -27
- package/styles/recurrence-editor/material-dark.css +21 -27
- package/styles/recurrence-editor/material.css +21 -27
- package/styles/recurrence-editor/tailwind-dark.css +21 -27
- package/styles/recurrence-editor/tailwind.css +21 -27
- package/styles/schedule/_all.scss +1 -1
- package/styles/schedule/_bootstrap4-definition.scss +0 -1
- package/styles/schedule/_bootstrap5-definition.scss +1 -1
- package/styles/schedule/_fusionnew-definition.scss +1 -1
- package/styles/schedule/_layout.scss +57 -32
- package/styles/schedule/_material3-definition.scss +1 -1
- package/styles/schedule/_theme.scss +12 -10
- package/styles/schedule/bootstrap-dark.css +29 -6
- package/styles/schedule/bootstrap.css +29 -6
- package/styles/schedule/bootstrap4.css +29 -6
- package/styles/schedule/bootstrap5-dark.css +30 -11
- package/styles/schedule/bootstrap5.css +30 -11
- package/styles/schedule/fabric-dark.css +29 -6
- package/styles/schedule/fabric.css +29 -6
- package/styles/schedule/fluent-dark.css +31 -12
- package/styles/schedule/fluent.css +31 -12
- package/styles/schedule/highcontrast-light.css +29 -6
- package/styles/schedule/highcontrast.css +29 -6
- package/styles/schedule/icons/_bootstrap5.scss +0 -1
- package/styles/schedule/icons/_fluent.scss +0 -1
- package/styles/schedule/icons/_fusionnew.scss +0 -1
- package/styles/schedule/icons/_material3.scss +0 -1
- package/styles/schedule/icons/_tailwind.scss +0 -1
- package/styles/schedule/material-dark.css +29 -6
- package/styles/schedule/material.css +29 -6
- package/styles/schedule/tailwind-dark.css +29 -6
- package/styles/schedule/tailwind.css +29 -6
- package/styles/tailwind-dark.css +50 -33
- package/styles/tailwind.css +50 -33
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, extend, formatUnit, getDefaultDateObject, getElement, getValue, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Event, EventHandler, HijriParser, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, append, classList, cldrData, closest, compile, createElement, detach, extend, formatUnit, getDefaultDateObject, getElement, getValue, isNullOrUndefined, prepend, print, remove, removeClass, setStyleAttribute } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Dialog, Popup, Tooltip, createSpinner, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
|
|
3
3
|
import { Toolbar, TreeView } from '@syncfusion/ej2-navigations';
|
|
4
4
|
import { Calendar, DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars';
|
|
@@ -111,6 +111,23 @@ function getElementHeightFromClass(container, elementClass) {
|
|
|
111
111
|
remove(el);
|
|
112
112
|
return height;
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Method to get width from element
|
|
116
|
+
*
|
|
117
|
+
* @param {Element} container Accepts the DOM element
|
|
118
|
+
* @param {string} elementClass Accepts the element class
|
|
119
|
+
* @returns {number} Returns the width of the element
|
|
120
|
+
*/
|
|
121
|
+
function getElementWidthFromClass(container, elementClass) {
|
|
122
|
+
let width = 0;
|
|
123
|
+
const el = createElement('div', { className: elementClass }).cloneNode();
|
|
124
|
+
el.style.visibility = 'hidden';
|
|
125
|
+
el.style.position = 'absolute';
|
|
126
|
+
container.appendChild(el);
|
|
127
|
+
width = el.getBoundingClientRect().width;
|
|
128
|
+
remove(el);
|
|
129
|
+
return width;
|
|
130
|
+
}
|
|
114
131
|
/**
|
|
115
132
|
* Method to get translateY value
|
|
116
133
|
*
|
|
@@ -122,6 +139,17 @@ function getTranslateY(element) {
|
|
|
122
139
|
return window.WebKitCSSMatrix ?
|
|
123
140
|
new WebKitCSSMatrix(style.webkitTransform).m42 : 0;
|
|
124
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Method to get translateX value
|
|
144
|
+
*
|
|
145
|
+
* @param {HTMLElement | Element} element Accepts the DOM element
|
|
146
|
+
* @returns {number} Returns the translateX value of given element
|
|
147
|
+
*/
|
|
148
|
+
function getTranslateX(element) {
|
|
149
|
+
const style = getComputedStyle(element);
|
|
150
|
+
return window.WebKitCSSMatrix ?
|
|
151
|
+
new WebKitCSSMatrix(style.webkitTransform).m41 : 0;
|
|
152
|
+
}
|
|
125
153
|
/**
|
|
126
154
|
* Method to get week first date
|
|
127
155
|
*
|
|
@@ -398,9 +426,7 @@ function getOuterHeight(element) {
|
|
|
398
426
|
function removeChildren(element) {
|
|
399
427
|
const elementChildren = [].slice.call(element.children);
|
|
400
428
|
for (const elementChild of elementChildren) {
|
|
401
|
-
|
|
402
|
-
element.removeChild(elementChild);
|
|
403
|
-
}
|
|
429
|
+
element.removeChild(elementChild);
|
|
404
430
|
}
|
|
405
431
|
}
|
|
406
432
|
/**
|
|
@@ -1580,7 +1606,7 @@ class ScheduleTouch {
|
|
|
1580
1606
|
this.touchRightDirection = this.parent.enableRtl ? 'Left' : 'Right';
|
|
1581
1607
|
}
|
|
1582
1608
|
scrollHandler(e) {
|
|
1583
|
-
if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action ||
|
|
1609
|
+
if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action || !this.parent.allowSwiping ||
|
|
1584
1610
|
(e.originalEvent && (e.originalEvent.target.classList.contains(APPOINTMENT_CLASS) ||
|
|
1585
1611
|
closest(e.originalEvent.target, '.' + APPOINTMENT_CLASS)))) {
|
|
1586
1612
|
return;
|
|
@@ -1635,7 +1661,7 @@ class ScheduleTouch {
|
|
|
1635
1661
|
}
|
|
1636
1662
|
}
|
|
1637
1663
|
swipeHandler(e) {
|
|
1638
|
-
if (!this.isScrollTriggered || this.parent.uiStateValues.action) {
|
|
1664
|
+
if (!this.isScrollTriggered || this.parent.uiStateValues.action || !this.parent.allowSwiping) {
|
|
1639
1665
|
return;
|
|
1640
1666
|
}
|
|
1641
1667
|
this.isScrollTriggered = false;
|
|
@@ -5941,7 +5967,8 @@ class EventBase {
|
|
|
5941
5967
|
const startDate = event[this.parent.eventFields.startTime];
|
|
5942
5968
|
const endDate = event[this.parent.eventFields.endTime];
|
|
5943
5969
|
const eventRule = event[this.parent.eventFields.recurrenceRule];
|
|
5944
|
-
const
|
|
5970
|
+
const timeZoneDiff = endDate.getTimezoneOffset() - startDate.getTimezoneOffset();
|
|
5971
|
+
const duration = (endDate.getTime() - startDate.getTime()) - (timeZoneDiff * 60000);
|
|
5945
5972
|
viewDate = new Date((viewDate || this.parent.activeView.startDate()).getTime() - duration);
|
|
5946
5973
|
const exception = event[this.parent.eventFields.recurrenceException];
|
|
5947
5974
|
let maxCount;
|
|
@@ -6133,7 +6160,7 @@ class EventBase {
|
|
|
6133
6160
|
element.style[type] = !isNullOrUndefined(alpha) ? alphaColor(color, alpha) : color;
|
|
6134
6161
|
}
|
|
6135
6162
|
}
|
|
6136
|
-
createBlockAppointmentElement(record, resIndex) {
|
|
6163
|
+
createBlockAppointmentElement(record, resIndex, isResourceEventTemplate) {
|
|
6137
6164
|
const eventSubject = (record[this.parent.eventFields.subject] || this.parent.eventSettings.fields.subject.default);
|
|
6138
6165
|
const appointmentWrapper = createElement('div', {
|
|
6139
6166
|
className: BLOCK_APPOINTMENT_CLASS,
|
|
@@ -6147,7 +6174,7 @@ class EventBase {
|
|
|
6147
6174
|
const scheduleId = this.parent.element.id + '_';
|
|
6148
6175
|
const viewName = this.parent.activeViewOptions.eventTemplateName;
|
|
6149
6176
|
const templateId = scheduleId + viewName + 'eventTemplate';
|
|
6150
|
-
const templateName = 'eventTemplate' + (
|
|
6177
|
+
const templateName = 'eventTemplate' + (isResourceEventTemplate &&
|
|
6151
6178
|
this.parent.currentView.indexOf('Year') === -1 ? '_' + resIndex : '');
|
|
6152
6179
|
templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
|
|
6153
6180
|
}
|
|
@@ -6300,6 +6327,30 @@ class EventBase {
|
|
|
6300
6327
|
}
|
|
6301
6328
|
return { startDate: startTime, endDate: endTime };
|
|
6302
6329
|
}
|
|
6330
|
+
createEventWrapper(type = '', index = 0) {
|
|
6331
|
+
const tr = createElement('tr');
|
|
6332
|
+
const levels = this.parent.activeView.colLevels.slice(-1)[0];
|
|
6333
|
+
for (let i = 0, len = levels.length; i < len; i++) {
|
|
6334
|
+
const col = levels[i];
|
|
6335
|
+
const appointmentWrap = createElement('td', {
|
|
6336
|
+
className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
|
|
6337
|
+
TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
|
|
6338
|
+
});
|
|
6339
|
+
if (!isNullOrUndefined(col.groupIndex)) {
|
|
6340
|
+
appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
|
|
6341
|
+
}
|
|
6342
|
+
if (type === '') {
|
|
6343
|
+
const innerWrapper = createElement('div', {
|
|
6344
|
+
id: APPOINTMENT_WRAPPER_CLASS + '-' + index.toString(),
|
|
6345
|
+
className: APPOINTMENT_WRAPPER_CLASS
|
|
6346
|
+
});
|
|
6347
|
+
appointmentWrap.appendChild(innerWrapper);
|
|
6348
|
+
}
|
|
6349
|
+
tr.appendChild(appointmentWrap);
|
|
6350
|
+
index = index + 1;
|
|
6351
|
+
}
|
|
6352
|
+
return tr;
|
|
6353
|
+
}
|
|
6303
6354
|
unWireEvents() {
|
|
6304
6355
|
const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
6305
6356
|
for (const element of appElements) {
|
|
@@ -6343,6 +6394,7 @@ class VerticalEvent extends EventBase {
|
|
|
6343
6394
|
if (this.parent.dragAndDropModule) {
|
|
6344
6395
|
this.parent.dragAndDropModule.setDragArea();
|
|
6345
6396
|
}
|
|
6397
|
+
this.isResourceEventTemplate = this.parent.isSpecificResourceEvents();
|
|
6346
6398
|
const wrapperElements = [].slice.call(this.parent.element.querySelectorAll('.' + BLOCK_APPOINTMENT_CLASS +
|
|
6347
6399
|
',.' + APPOINTMENT_CLASS + ',.' + ROW_COUNT_WRAPPER_CLASS));
|
|
6348
6400
|
const isDragging = (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) ? true : false;
|
|
@@ -6364,6 +6416,9 @@ class VerticalEvent extends EventBase {
|
|
|
6364
6416
|
if (!this.element.querySelector('.' + WORK_CELLS_CLASS)) {
|
|
6365
6417
|
return;
|
|
6366
6418
|
}
|
|
6419
|
+
if (this.parent.virtualScrollModule) {
|
|
6420
|
+
this.parent.virtualScrollModule.updateFocusedWorkCell();
|
|
6421
|
+
}
|
|
6367
6422
|
this.allDayElement = [].slice.call(this.element.querySelectorAll('.' + ALLDAY_CELLS_CLASS));
|
|
6368
6423
|
this.setAllDayRowHeight(0);
|
|
6369
6424
|
if (this.parent.eventsProcessed.length === 0 && this.parent.blockProcessed.length === 0) {
|
|
@@ -6394,6 +6449,9 @@ class VerticalEvent extends EventBase {
|
|
|
6394
6449
|
this.resources = (this.parent.activeViewOptions.group.resources.length > 0) ? this.parent.uiStateValues.isGroupAdaptive ?
|
|
6395
6450
|
[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
|
|
6396
6451
|
this.parent.resourceBase.lastResourceLevel : [];
|
|
6452
|
+
if (this.resources.length > 0 && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.virtualScrollModule) {
|
|
6453
|
+
this.resources = this.parent.resourceBase.renderedResources;
|
|
6454
|
+
}
|
|
6397
6455
|
this.cellHeight =
|
|
6398
6456
|
parseFloat(this.parent.element.querySelector('.e-content-wrap tbody tr').getBoundingClientRect().height.toFixed(2));
|
|
6399
6457
|
this.dateRender[0] = this.parent.activeView.renderDates;
|
|
@@ -6410,7 +6468,7 @@ class VerticalEvent extends EventBase {
|
|
|
6410
6468
|
return appHeight;
|
|
6411
6469
|
}
|
|
6412
6470
|
appendEvent(eventObj, appointmentElement, index, appLeft) {
|
|
6413
|
-
const appointmentWrap =
|
|
6471
|
+
const appointmentWrap = this.element.querySelector('.' + APPOINTMENT_WRAPPER_CLASS + '[id="' + APPOINTMENT_WRAPPER_CLASS + '-' + index + '"]');
|
|
6414
6472
|
if (this.parent.enableRtl) {
|
|
6415
6473
|
setStyleAttribute(appointmentElement, { 'right': appLeft });
|
|
6416
6474
|
}
|
|
@@ -6424,13 +6482,13 @@ class VerticalEvent extends EventBase {
|
|
|
6424
6482
|
};
|
|
6425
6483
|
this.parent.trigger(eventRendered, args, (eventArgs) => {
|
|
6426
6484
|
if (!eventArgs.cancel) {
|
|
6427
|
-
appointmentWrap
|
|
6485
|
+
appointmentWrap.appendChild(appointmentElement);
|
|
6428
6486
|
}
|
|
6429
6487
|
});
|
|
6430
6488
|
}
|
|
6431
6489
|
processBlockEvents() {
|
|
6432
6490
|
const resources = this.getResourceList();
|
|
6433
|
-
let dateCount =
|
|
6491
|
+
let dateCount = this.getStartCount();
|
|
6434
6492
|
for (const resource of resources) {
|
|
6435
6493
|
const renderDates = this.dateRender[resource];
|
|
6436
6494
|
for (let day = 0, length = renderDates.length; day < length; day++) {
|
|
@@ -6467,9 +6525,11 @@ class VerticalEvent extends EventBase {
|
|
|
6467
6525
|
blockHeight = formatUnit(this.getHeight(eStart, eEnd));
|
|
6468
6526
|
blockTop = formatUnit(this.getTopValue(eStart, dayIndex, resource));
|
|
6469
6527
|
}
|
|
6470
|
-
const appointmentElement = this.createBlockAppointmentElement(eventObj, resource);
|
|
6528
|
+
const appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
|
|
6471
6529
|
setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
|
|
6472
|
-
const
|
|
6530
|
+
const renderedIndex = this.getDayIndex(dayIndex, resource);
|
|
6531
|
+
const index = this.parent.activeViewOptions.group.byDate ?
|
|
6532
|
+
(this.resources.length * renderedIndex) + resource : dayCount;
|
|
6473
6533
|
this.appendEvent(eventObj, appointmentElement, index, '0px');
|
|
6474
6534
|
}
|
|
6475
6535
|
}
|
|
@@ -6477,7 +6537,7 @@ class VerticalEvent extends EventBase {
|
|
|
6477
6537
|
removeClass(this.allDayElement, ALLDAY_ROW_ANIMATE_CLASS);
|
|
6478
6538
|
const eventCollection = (eventType === 'allDayEvents') ? this.sortByDateTime(this.allDayEvents) : undefined;
|
|
6479
6539
|
const resources = this.getResourceList();
|
|
6480
|
-
let dateCount =
|
|
6540
|
+
let dateCount = this.getStartCount();
|
|
6481
6541
|
let isRender;
|
|
6482
6542
|
for (const resource of resources) {
|
|
6483
6543
|
isRender = true;
|
|
@@ -6534,6 +6594,15 @@ class VerticalEvent extends EventBase {
|
|
|
6534
6594
|
}
|
|
6535
6595
|
}
|
|
6536
6596
|
}
|
|
6597
|
+
getStartCount() {
|
|
6598
|
+
return this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.timeScale.enable ?
|
|
6599
|
+
parseInt(this.element.querySelector('.' + APPOINTMENT_WRAPPER_CLASS).getAttribute('id').split('-').slice(-1)[0], 10) : 0;
|
|
6600
|
+
}
|
|
6601
|
+
getDayIndex(dayIndex, resource) {
|
|
6602
|
+
return this.parent.activeViewOptions.group.byDate ?
|
|
6603
|
+
this.parent.resourceBase.lastResourceLevel[0].renderDates.indexOf(this.dateRender[resource][dayIndex]) :
|
|
6604
|
+
dayIndex;
|
|
6605
|
+
}
|
|
6537
6606
|
setValues(event, resourceIndex) {
|
|
6538
6607
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
6539
6608
|
this.cssClass = this.resources[resourceIndex].cssClass;
|
|
@@ -6565,7 +6634,6 @@ class VerticalEvent extends EventBase {
|
|
|
6565
6634
|
'tabindex': '0',
|
|
6566
6635
|
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record),
|
|
6567
6636
|
'aria-pressed': 'false',
|
|
6568
|
-
'aria-grabbed': 'true',
|
|
6569
6637
|
'aria-label': this.parent.getAnnouncementString(record)
|
|
6570
6638
|
}
|
|
6571
6639
|
});
|
|
@@ -6585,7 +6653,7 @@ class VerticalEvent extends EventBase {
|
|
|
6585
6653
|
const viewName = this.parent.activeViewOptions.eventTemplateName;
|
|
6586
6654
|
const templateId = elementId + viewName + 'eventTemplate';
|
|
6587
6655
|
const resIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : resource;
|
|
6588
|
-
const templateName = 'eventTemplate' + (this.
|
|
6656
|
+
const templateName = 'eventTemplate' + (this.isResourceEventTemplate ? '_' + resIndex : '');
|
|
6589
6657
|
templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
|
|
6590
6658
|
}
|
|
6591
6659
|
else {
|
|
@@ -6757,10 +6825,11 @@ class VerticalEvent extends EventBase {
|
|
|
6757
6825
|
if (isNullOrUndefined(this.renderedAllDayEvents[resource])) {
|
|
6758
6826
|
this.renderedAllDayEvents[resource] = [];
|
|
6759
6827
|
}
|
|
6828
|
+
const renderedIndex = this.getDayIndex(dayIndex, resource);
|
|
6760
6829
|
this.renderedAllDayEvents[resource].push(extend({}, record, null, true));
|
|
6761
6830
|
const allDayRow = [].slice.call(this.element.querySelector('.' + ALLDAY_ROW_CLASS).children);
|
|
6762
6831
|
const wIndex = this.parent.activeViewOptions.group.byDate ?
|
|
6763
|
-
(this.resources.length *
|
|
6832
|
+
(this.resources.length * renderedIndex) + resource : dayCount;
|
|
6764
6833
|
const eventWrapper = this.element.querySelector('.' + ALLDAY_APPOINTMENT_WRAPPER_CLASS +
|
|
6765
6834
|
':nth-child(' + (wIndex + 1) + ')');
|
|
6766
6835
|
let appointmentElement;
|
|
@@ -6829,9 +6898,10 @@ class VerticalEvent extends EventBase {
|
|
|
6829
6898
|
this.overlapEvents.push([record]);
|
|
6830
6899
|
}
|
|
6831
6900
|
appWidth = this.getEventWidth();
|
|
6901
|
+
const renderedIndex = this.getDayIndex(dayIndex, resource);
|
|
6832
6902
|
const argsData = {
|
|
6833
6903
|
index: appIndex, left: appLeft, width: appWidth,
|
|
6834
|
-
day:
|
|
6904
|
+
day: renderedIndex, dayIndex: dayCount, record: record, resource: resource
|
|
6835
6905
|
};
|
|
6836
6906
|
const tempData = this.adjustOverlapElements(argsData);
|
|
6837
6907
|
appWidth = (tempData.appWidth);
|
|
@@ -6856,7 +6926,8 @@ class VerticalEvent extends EventBase {
|
|
|
6856
6926
|
if (!this.parent.isAdaptive && subjectElement) {
|
|
6857
6927
|
subjectElement.style.maxHeight = formatUnit(maxHeight);
|
|
6858
6928
|
}
|
|
6859
|
-
const index = this.parent.activeViewOptions.group.byDate ?
|
|
6929
|
+
const index = this.parent.activeViewOptions.group.byDate ?
|
|
6930
|
+
(this.resources.length * renderedIndex) + resource : dayCount;
|
|
6860
6931
|
const eventData = {};
|
|
6861
6932
|
eventData[this.fields.startTime] = eventObj[this.fields.startTime];
|
|
6862
6933
|
eventData[this.fields.endTime] = eventObj[this.fields.endTime];
|
|
@@ -6970,7 +7041,7 @@ class VerticalEvent extends EventBase {
|
|
|
6970
7041
|
const dayCount = this.parent.activeViewOptions.group.byDate ?
|
|
6971
7042
|
(this.resources.length * args.day) + args.resource : args.dayIndex;
|
|
6972
7043
|
const element = this.element.querySelector('#e-appointment-wrapper-' + dayCount);
|
|
6973
|
-
if (element.childElementCount > 0) {
|
|
7044
|
+
if (element && element.childElementCount > 0) {
|
|
6974
7045
|
const eleGuid = this.overlapEvents[i][j].Guid;
|
|
6975
7046
|
if (element.querySelectorAll('div[data-guid="' + eleGuid + '"]').length > 0 && eleGuid !== args.record.Guid) {
|
|
6976
7047
|
const apps = element.querySelector('div[data-guid="' + eleGuid + '"]');
|
|
@@ -7143,6 +7214,7 @@ class MonthEvent extends EventBase {
|
|
|
7143
7214
|
if (this.parent.dragAndDropModule) {
|
|
7144
7215
|
this.parent.dragAndDropModule.setDragArea();
|
|
7145
7216
|
}
|
|
7217
|
+
this.isResourceEventTemplate = this.parent.isSpecificResourceEvents();
|
|
7146
7218
|
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
7147
7219
|
if (this.parent.rowAutoHeight) {
|
|
7148
7220
|
this.parent.uiStateValues.top = conWrap.scrollTop;
|
|
@@ -7180,7 +7252,8 @@ class MonthEvent extends EventBase {
|
|
|
7180
7252
|
}
|
|
7181
7253
|
this.eventHeight = getElementHeightFromClass(this.element, APPOINTMENT_CLASS);
|
|
7182
7254
|
const scrollTop = conWrap.scrollTop;
|
|
7183
|
-
if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !
|
|
7255
|
+
if (this.parent.rowAutoHeight && this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll
|
|
7256
|
+
&& !isNullOrUndefined(this.parent.currentAction)) {
|
|
7184
7257
|
conWrap.scrollTop = conWrap.scrollTop - 1;
|
|
7185
7258
|
}
|
|
7186
7259
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
@@ -7200,7 +7273,7 @@ class MonthEvent extends EventBase {
|
|
|
7200
7273
|
isPreventScrollUpdate: true,
|
|
7201
7274
|
scrollPosition: { left: this.parent.uiStateValues.left, top: this.parent.uiStateValues.top }
|
|
7202
7275
|
};
|
|
7203
|
-
if (this.parent.virtualScrollModule) {
|
|
7276
|
+
if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll) {
|
|
7204
7277
|
if (this.parent.currentAction) {
|
|
7205
7278
|
conWrap.scrollTop = scrollTop;
|
|
7206
7279
|
this.parent.currentAction = null;
|
|
@@ -7347,7 +7420,7 @@ class MonthEvent extends EventBase {
|
|
|
7347
7420
|
const appRight = (this.parent.enableRtl) ? position : 0;
|
|
7348
7421
|
const appHeight = this.cellHeight - this.monthHeaderHeight;
|
|
7349
7422
|
const appTop = this.getRowTop(resIndex);
|
|
7350
|
-
const blockElement = this.createBlockAppointmentElement(event, resIndex);
|
|
7423
|
+
const blockElement = this.createBlockAppointmentElement(event, resIndex, this.isResourceEventTemplate);
|
|
7351
7424
|
setStyleAttribute(blockElement, {
|
|
7352
7425
|
'width': appWidth + 'px', 'height': appHeight + 'px', 'left': appLeft + 'px',
|
|
7353
7426
|
'right': appRight + 'px', 'top': appTop + 'px'
|
|
@@ -7418,7 +7491,7 @@ class MonthEvent extends EventBase {
|
|
|
7418
7491
|
renderResourceEvents() {
|
|
7419
7492
|
const resources = this.parent.uiStateValues.isGroupAdaptive ?
|
|
7420
7493
|
[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
|
|
7421
|
-
this.parent.resourceBase.
|
|
7494
|
+
this.parent.resourceBase.renderedResources;
|
|
7422
7495
|
if (this.parent.crudModule && this.parent.crudModule.crudObj.isCrudAction) {
|
|
7423
7496
|
for (let i = 0, len = this.parent.crudModule.crudObj.sourceEvent.length; i < len; i++) {
|
|
7424
7497
|
const sourceRes = this.parent.crudModule.crudObj.sourceEvent[i];
|
|
@@ -7452,7 +7525,7 @@ class MonthEvent extends EventBase {
|
|
|
7452
7525
|
const attrs = {
|
|
7453
7526
|
'data-id': 'Appointment_' + record[this.fields.id],
|
|
7454
7527
|
'role': 'button', 'tabindex': '0',
|
|
7455
|
-
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
|
|
7528
|
+
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
|
|
7456
7529
|
'aria-label': this.parent.getAnnouncementString(newRecord, eventSubject)
|
|
7457
7530
|
};
|
|
7458
7531
|
if (!isCloneElement) {
|
|
@@ -7477,7 +7550,7 @@ class MonthEvent extends EventBase {
|
|
|
7477
7550
|
const scheduleId = this.parent.element.id + '_';
|
|
7478
7551
|
const viewName = this.parent.activeViewOptions.eventTemplateName;
|
|
7479
7552
|
const templateId = scheduleId + viewName + 'eventTemplate';
|
|
7480
|
-
const eventTemplate = 'eventTemplate' + (this.
|
|
7553
|
+
const eventTemplate = 'eventTemplate' + (this.isResourceEventTemplate ? '_' + resIndex : '');
|
|
7481
7554
|
templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, eventTemplate, templateId, false);
|
|
7482
7555
|
}
|
|
7483
7556
|
else {
|
|
@@ -8909,7 +8982,7 @@ class QuickPopups {
|
|
|
8909
8982
|
'data-id': '' + eventData[fields.id],
|
|
8910
8983
|
'data-guid': eventData.Guid, 'role': 'button', 'tabindex': '0',
|
|
8911
8984
|
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(eventData),
|
|
8912
|
-
'aria-pressed': 'false', 'aria-
|
|
8985
|
+
'aria-pressed': 'false', 'aria-label': this.parent.getAnnouncementString(eventData)
|
|
8913
8986
|
}
|
|
8914
8987
|
});
|
|
8915
8988
|
let templateElement;
|
|
@@ -9029,6 +9102,9 @@ class QuickPopups {
|
|
|
9029
9102
|
}
|
|
9030
9103
|
return;
|
|
9031
9104
|
}
|
|
9105
|
+
else if (this.quickPopup.element) {
|
|
9106
|
+
this.destroyPopupButtons('quickPopup');
|
|
9107
|
+
}
|
|
9032
9108
|
const temp = {};
|
|
9033
9109
|
temp[this.parent.eventFields.startTime] = this.parent.activeCellsData.startTime;
|
|
9034
9110
|
temp[this.parent.eventFields.endTime] = this.parent.activeCellsData.endTime;
|
|
@@ -9100,6 +9176,9 @@ class QuickPopups {
|
|
|
9100
9176
|
if (isSameTarget) {
|
|
9101
9177
|
return;
|
|
9102
9178
|
}
|
|
9179
|
+
else if (this.quickPopup.element) {
|
|
9180
|
+
this.destroyPopupButtons('quickPopup');
|
|
9181
|
+
}
|
|
9103
9182
|
const eventData = events.event;
|
|
9104
9183
|
const quickEventPopup = createElement('div', { className: EVENT_POPUP_CLASS });
|
|
9105
9184
|
quickEventPopup.appendChild(this.getPopupHeader('Event', eventData));
|
|
@@ -9635,7 +9714,10 @@ class QuickPopups {
|
|
|
9635
9714
|
this.quickPopup.element.style.height = formatUnit((popupType === 'EditEventInfo') ? 65 : window.innerHeight);
|
|
9636
9715
|
}
|
|
9637
9716
|
else {
|
|
9638
|
-
this.
|
|
9717
|
+
const isVirtualScroll = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll
|
|
9718
|
+
&& !isNullOrUndefined(closest(target, '.' + CONTENT_TABLE_CLASS));
|
|
9719
|
+
const conTable = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS + ' table');
|
|
9720
|
+
this.quickPopup.offsetX = isVirtualScroll && !this.parent.enableRtl ? (getTranslateX(conTable) + 10) : 10;
|
|
9639
9721
|
this.quickPopup.collision = { X: this.parent.enableRtl ? 'flip' : 'none', Y: 'fit' };
|
|
9640
9722
|
this.quickPopup.position = { X: this.parent.enableRtl ? 'left' : 'right', Y: this.parent.enableRtl ? 'bottom' : 'top' };
|
|
9641
9723
|
this.quickPopup.dataBind();
|
|
@@ -9643,7 +9725,11 @@ class QuickPopups {
|
|
|
9643
9725
|
const collide = isCollide(this.quickPopup.element, this.parent.element);
|
|
9644
9726
|
if (collide.indexOf(this.parent.enableRtl ? 'left' : 'right') > -1) {
|
|
9645
9727
|
this.quickPopup.offsetX = -target.offsetWidth - 10 - this.quickPopup.element.offsetWidth;
|
|
9728
|
+
if (isVirtualScroll && !this.parent.enableRtl) {
|
|
9729
|
+
this.quickPopup.offsetX = getTranslateX(conTable) + this.quickPopup.offsetX;
|
|
9730
|
+
}
|
|
9646
9731
|
this.quickPopup.dataBind();
|
|
9732
|
+
this.quickPopup.refreshPosition(null, true);
|
|
9647
9733
|
const leftCollide = isCollide(this.quickPopup.element, this.parent.element);
|
|
9648
9734
|
if (leftCollide.indexOf('left') > -1) {
|
|
9649
9735
|
this.quickPopup.position = { X: 'center', Y: 'center' };
|
|
@@ -9652,9 +9738,8 @@ class QuickPopups {
|
|
|
9652
9738
|
this.quickPopup.dataBind();
|
|
9653
9739
|
}
|
|
9654
9740
|
}
|
|
9655
|
-
if (this.parent.virtualScrollModule && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
|
|
9656
|
-
const
|
|
9657
|
-
const translateY = getTranslateY(element);
|
|
9741
|
+
if (this.parent.virtualScrollModule && !this.parent.virtualScrollModule.isHorizontalScroll && (collide.indexOf('top') > -1 || collide.indexOf('bottom') > -1)) {
|
|
9742
|
+
const translateY = getTranslateY(conTable);
|
|
9658
9743
|
this.quickPopup.offsetY = translateY;
|
|
9659
9744
|
this.quickPopup.dataBind();
|
|
9660
9745
|
}
|
|
@@ -9907,6 +9992,7 @@ class QuickPopups {
|
|
|
9907
9992
|
this.destroyQuickPopup();
|
|
9908
9993
|
this.destroyMorePopup();
|
|
9909
9994
|
this.destroyQuickDialog();
|
|
9995
|
+
this.dialogEvent = null;
|
|
9910
9996
|
this.parent = null;
|
|
9911
9997
|
this.l10n = null;
|
|
9912
9998
|
this.isCrudAction = null;
|
|
@@ -10890,30 +10976,47 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
|
|
|
10890
10976
|
destroyComponents() {
|
|
10891
10977
|
if (!this.recurrenceCount.isDestroyed) {
|
|
10892
10978
|
this.recurrenceCount.destroy();
|
|
10979
|
+
this.recurrenceCount = null;
|
|
10893
10980
|
}
|
|
10894
10981
|
if (!this.monthDate.isDestroyed) {
|
|
10895
10982
|
this.monthDate.destroy();
|
|
10983
|
+
this.monthDate = null;
|
|
10896
10984
|
}
|
|
10897
10985
|
if (!this.repeatInterval.isDestroyed) {
|
|
10898
10986
|
this.repeatInterval.destroy();
|
|
10987
|
+
this.repeatInterval = null;
|
|
10899
10988
|
}
|
|
10900
10989
|
if (!this.untilDateObj.isDestroyed) {
|
|
10901
10990
|
this.untilDateObj.destroy();
|
|
10991
|
+
this.untilDateObj = null;
|
|
10902
10992
|
}
|
|
10903
10993
|
if (!this.repeatType.isDestroyed) {
|
|
10904
10994
|
this.repeatType.destroy();
|
|
10995
|
+
this.repeatType = null;
|
|
10905
10996
|
}
|
|
10906
10997
|
if (!this.endType.isDestroyed) {
|
|
10907
10998
|
this.endType.destroy();
|
|
10999
|
+
this.endType = null;
|
|
10908
11000
|
}
|
|
10909
11001
|
if (!this.monthWeekPos.isDestroyed) {
|
|
10910
11002
|
this.monthWeekPos.destroy();
|
|
11003
|
+
this.monthWeekPos = null;
|
|
10911
11004
|
}
|
|
10912
11005
|
if (!this.monthWeekDays.isDestroyed) {
|
|
10913
11006
|
this.monthWeekDays.destroy();
|
|
11007
|
+
this.monthWeekDays = null;
|
|
10914
11008
|
}
|
|
10915
11009
|
if (!this.monthValue.isDestroyed) {
|
|
10916
11010
|
this.monthValue.destroy();
|
|
11011
|
+
this.monthValue = null;
|
|
11012
|
+
}
|
|
11013
|
+
if (!this.onMonthDay.isDestroyed) {
|
|
11014
|
+
this.onMonthDay.destroy();
|
|
11015
|
+
this.onMonthDay = null;
|
|
11016
|
+
}
|
|
11017
|
+
if (!this.onWeekDay.isDestroyed) {
|
|
11018
|
+
this.onWeekDay.destroy();
|
|
11019
|
+
this.onWeekDay = null;
|
|
10917
11020
|
}
|
|
10918
11021
|
this.dayButtons.forEach((element) => {
|
|
10919
11022
|
if (!element.isDestroyed) {
|
|
@@ -11007,21 +11110,30 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
|
|
|
11007
11110
|
this.renderStatus = true;
|
|
11008
11111
|
this.triggerChangeEvent();
|
|
11009
11112
|
}
|
|
11113
|
+
detachInputs() {
|
|
11114
|
+
const inputElements = [].slice.call(this.element.querySelectorAll('input'));
|
|
11115
|
+
for (const element of inputElements) {
|
|
11116
|
+
detach(element);
|
|
11117
|
+
}
|
|
11118
|
+
}
|
|
11010
11119
|
/**
|
|
11011
11120
|
* Destroys the widget.
|
|
11012
11121
|
*
|
|
11013
11122
|
* @returns {void}
|
|
11014
11123
|
*/
|
|
11015
11124
|
destroy() {
|
|
11016
|
-
this.
|
|
11017
|
-
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
this.
|
|
11125
|
+
if (!this.isDestroyed) {
|
|
11126
|
+
this.destroyComponents();
|
|
11127
|
+
super.destroy();
|
|
11128
|
+
let removeClasses = ['e-' + this.getModuleName()];
|
|
11129
|
+
if (this.cssClass) {
|
|
11130
|
+
removeClasses = removeClasses.concat(this.cssClass.split(' '));
|
|
11131
|
+
}
|
|
11132
|
+
removeClass([this.element], removeClasses);
|
|
11133
|
+
this.detachInputs();
|
|
11134
|
+
while (this.element.firstElementChild) {
|
|
11135
|
+
this.element.removeChild(this.element.firstElementChild);
|
|
11136
|
+
}
|
|
11025
11137
|
}
|
|
11026
11138
|
}
|
|
11027
11139
|
/**
|
|
@@ -11394,6 +11506,7 @@ class EventWindow {
|
|
|
11394
11506
|
const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
|
|
11395
11507
|
append(tempEle, form);
|
|
11396
11508
|
this.parent.renderTemplates();
|
|
11509
|
+
this.applyFormValidation();
|
|
11397
11510
|
}
|
|
11398
11511
|
else {
|
|
11399
11512
|
form.appendChild(this.getDefaultEventWindowContent());
|
|
@@ -11934,12 +12047,26 @@ class EventWindow {
|
|
|
11934
12047
|
const getValidationRule = (rules) => (rules && Object.keys(rules).length > 0) ? rules : undefined;
|
|
11935
12048
|
const form = this.element.querySelector('.' + FORM_CLASS);
|
|
11936
12049
|
const rules = {};
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
12050
|
+
const subjectRule = getValidationRule(this.parent.eventSettings.fields.subject.validation);
|
|
12051
|
+
if (!isNullOrUndefined(subjectRule)) {
|
|
12052
|
+
rules[this.parent.eventSettings.fields.subject.name] = subjectRule;
|
|
12053
|
+
}
|
|
12054
|
+
const locationRule = getValidationRule(this.parent.eventSettings.fields.location.validation);
|
|
12055
|
+
if (!isNullOrUndefined(locationRule)) {
|
|
12056
|
+
rules[this.parent.eventSettings.fields.location.name] = locationRule;
|
|
12057
|
+
}
|
|
12058
|
+
const startTimeRule = getValidationRule(this.parent.eventSettings.fields.startTime.validation);
|
|
12059
|
+
if (!isNullOrUndefined(startTimeRule)) {
|
|
12060
|
+
rules[this.parent.eventSettings.fields.startTime.name] = startTimeRule;
|
|
12061
|
+
}
|
|
12062
|
+
const endTimeRule = getValidationRule(this.parent.eventSettings.fields.endTime.validation);
|
|
12063
|
+
if (!isNullOrUndefined(endTimeRule)) {
|
|
12064
|
+
rules[this.parent.eventSettings.fields.endTime.name] = endTimeRule;
|
|
12065
|
+
}
|
|
12066
|
+
const descriptionRule = getValidationRule(this.parent.eventSettings.fields.description.validation);
|
|
12067
|
+
if (!isNullOrUndefined(descriptionRule)) {
|
|
12068
|
+
rules[this.parent.eventSettings.fields.description.name] = descriptionRule;
|
|
12069
|
+
}
|
|
11943
12070
|
this.fieldValidator = new FieldValidator();
|
|
11944
12071
|
this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
|
|
11945
12072
|
}
|
|
@@ -12866,6 +12993,12 @@ class EventWindow {
|
|
|
12866
12993
|
this.buttonObj.destroy();
|
|
12867
12994
|
}
|
|
12868
12995
|
}
|
|
12996
|
+
detachComponents() {
|
|
12997
|
+
const formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
|
|
12998
|
+
for (const element of formElements) {
|
|
12999
|
+
detach(element);
|
|
13000
|
+
}
|
|
13001
|
+
}
|
|
12869
13002
|
destroy(isIgnore) {
|
|
12870
13003
|
if (this.parent && !this.parent.isDestroyed) {
|
|
12871
13004
|
this.parent.resetTemplates(['editorTemplate']);
|
|
@@ -12873,6 +13006,7 @@ class EventWindow {
|
|
|
12873
13006
|
this.destroyComponents();
|
|
12874
13007
|
if (this.recurrenceEditor) {
|
|
12875
13008
|
this.recurrenceEditor.destroy();
|
|
13009
|
+
detach(this.recurrenceEditor.element);
|
|
12876
13010
|
this.recurrenceEditor = null;
|
|
12877
13011
|
}
|
|
12878
13012
|
if (this.fieldValidator) {
|
|
@@ -12883,8 +13017,12 @@ class EventWindow {
|
|
|
12883
13017
|
this.repeatDialogObject.destroy();
|
|
12884
13018
|
this.repeatDialogObject = null;
|
|
12885
13019
|
}
|
|
13020
|
+
this.detachComponents();
|
|
12886
13021
|
if (this.dialogObject) {
|
|
12887
13022
|
if (this.dialogObject.element) {
|
|
13023
|
+
const form = this.dialogObject.element.querySelector('form');
|
|
13024
|
+
removeChildren(form);
|
|
13025
|
+
detach(form);
|
|
12888
13026
|
EventHandler.remove(this.dialogObject.element, 'keydown', this.preventEventSave);
|
|
12889
13027
|
}
|
|
12890
13028
|
this.dialogObject.destroy();
|
|
@@ -12901,6 +13039,7 @@ class EventWindow {
|
|
|
12901
13039
|
this.buttonObj = null;
|
|
12902
13040
|
this.repeatStatus = null;
|
|
12903
13041
|
this.eventWindowTime = null;
|
|
13042
|
+
this.dialogEvent = null;
|
|
12904
13043
|
}
|
|
12905
13044
|
}
|
|
12906
13045
|
}
|
|
@@ -12915,7 +13054,7 @@ class VirtualScroll {
|
|
|
12915
13054
|
this.bufferCount = 3;
|
|
12916
13055
|
this.renderedLength = 0;
|
|
12917
13056
|
this.averageRowHeight = 0;
|
|
12918
|
-
this.
|
|
13057
|
+
this.startIndex = 0;
|
|
12919
13058
|
this.parent = parent;
|
|
12920
13059
|
this.addEventListener();
|
|
12921
13060
|
}
|
|
@@ -12933,37 +13072,19 @@ class VirtualScroll {
|
|
|
12933
13072
|
}
|
|
12934
13073
|
getRenderedCount() {
|
|
12935
13074
|
this.setItemSize();
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
12940
|
-
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
12941
|
-
const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
12942
|
-
const timeIndicator = this.parent.element.querySelector('.' + CURRENT_TIMELINE_CLASS);
|
|
12943
|
-
this.renderVirtualTrackHeight(conWrap, resWrap);
|
|
12944
|
-
this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
|
|
12945
|
-
}
|
|
12946
|
-
renderVirtualTrackHeight(contentWrap, resourceWrap) {
|
|
12947
|
-
this.parent.resourceBase.setExpandedResources();
|
|
12948
|
-
if (this.isScrollHeightNull) {
|
|
12949
|
-
const wrap = createElement('div', { className: VIRTUAL_TRACK_CLASS });
|
|
12950
|
-
const resWrap = [].slice.call((resourceWrap).querySelectorAll('table td'));
|
|
12951
|
-
const startIndex = parseInt(resWrap[0].getAttribute('data-group-index'), 10);
|
|
12952
|
-
const endIndex = parseInt(resWrap[resWrap.length - 1].getAttribute('data-group-index'), 10);
|
|
12953
|
-
this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources.filter((resource) => (resource.groupIndex >= startIndex && resource.groupIndex <= endIndex));
|
|
12954
|
-
this.setItemSize();
|
|
12955
|
-
wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
|
|
12956
|
-
this.isScrollHeightNull = false;
|
|
12957
|
-
const virtual = this.parent.element.querySelector('.' + VIRTUAL_TRACK_CLASS);
|
|
12958
|
-
if (!isNullOrUndefined(virtual)) {
|
|
12959
|
-
remove(virtual);
|
|
12960
|
-
}
|
|
12961
|
-
contentWrap.appendChild(wrap);
|
|
12962
|
-
}
|
|
13075
|
+
const containerSize = this.isHorizontalScroll ? this.parent.element.clientWidth : this.parent.element.clientHeight;
|
|
13076
|
+
this.renderedLength = Math.ceil(containerSize / this.itemSize) + this.bufferCount;
|
|
13077
|
+
return this.renderedLength;
|
|
12963
13078
|
}
|
|
12964
13079
|
renderVirtualTrack(contentWrap) {
|
|
12965
13080
|
const wrap = createElement('div', { className: VIRTUAL_TRACK_CLASS });
|
|
12966
|
-
|
|
13081
|
+
if (this.isHorizontalScroll) {
|
|
13082
|
+
const colCount = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1].length;
|
|
13083
|
+
wrap.style.width = (colCount * this.itemSize) + 'px';
|
|
13084
|
+
}
|
|
13085
|
+
else {
|
|
13086
|
+
wrap.style.height = (this.parent.resourceBase.expandedResources.length * this.itemSize) + 'px';
|
|
13087
|
+
}
|
|
12967
13088
|
contentWrap.appendChild(wrap);
|
|
12968
13089
|
}
|
|
12969
13090
|
updateVirtualScrollHeight() {
|
|
@@ -13001,12 +13122,19 @@ class VirtualScroll {
|
|
|
13001
13122
|
}
|
|
13002
13123
|
}
|
|
13003
13124
|
setItemSize() {
|
|
13004
|
-
|
|
13125
|
+
if (this.isHorizontalScroll) {
|
|
13126
|
+
this.itemSize = getElementWidthFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13127
|
+
}
|
|
13128
|
+
else {
|
|
13129
|
+
this.itemSize = getElementHeightFromClass(this.parent.activeView.element, WORK_CELLS_CLASS) || this.itemSize;
|
|
13130
|
+
}
|
|
13005
13131
|
}
|
|
13006
13132
|
renderEvents() {
|
|
13007
13133
|
this.setTabIndex();
|
|
13008
13134
|
this.parent.refreshEvents(false);
|
|
13009
|
-
this.parent.
|
|
13135
|
+
if (this.parent.currentView !== 'Month') {
|
|
13136
|
+
this.parent.notify(contentReady, {});
|
|
13137
|
+
}
|
|
13010
13138
|
this.parent.hideSpinner();
|
|
13011
13139
|
}
|
|
13012
13140
|
virtualScrolling() {
|
|
@@ -13014,31 +13142,63 @@ class VirtualScroll {
|
|
|
13014
13142
|
this.parent.quickPopup.quickPopupHide();
|
|
13015
13143
|
this.parent.quickPopup.morePopup.hide();
|
|
13016
13144
|
}
|
|
13017
|
-
const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
13018
13145
|
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13146
|
+
if (this.isHorizontalScroll) {
|
|
13147
|
+
this.horizontalScrolling(conWrap);
|
|
13148
|
+
}
|
|
13149
|
+
else {
|
|
13150
|
+
const resWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
13151
|
+
const eventWrap = this.parent.element.querySelector('.' + EVENT_TABLE_CLASS);
|
|
13152
|
+
const timeIndicator = this.parent.element.querySelector('.' + CURRENT_TIMELINE_CLASS);
|
|
13153
|
+
const conTable = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS);
|
|
13154
|
+
addClass([conWrap], 'e-transition');
|
|
13155
|
+
this.renderedLength = resWrap.querySelector('tbody').children.length;
|
|
13156
|
+
const firstTDIndex = parseInt(resWrap.querySelector('tbody td').getAttribute('data-group-index'), 10);
|
|
13157
|
+
const scrollHeight = this.parent.rowAutoHeight ?
|
|
13158
|
+
(conTable.offsetHeight - conWrap.offsetHeight) : this.bufferCount * this.itemSize;
|
|
13159
|
+
let resCollection = [];
|
|
13160
|
+
if ((conWrap.scrollTop) - this.translateY < 0) {
|
|
13161
|
+
resCollection = this.upScroll(conWrap, firstTDIndex);
|
|
13162
|
+
}
|
|
13163
|
+
else if (conWrap.scrollTop - this.translateY > scrollHeight) {
|
|
13164
|
+
resCollection = this.downScroll(conWrap, firstTDIndex);
|
|
13165
|
+
}
|
|
13166
|
+
if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
|
|
13167
|
+
this.parent.showSpinner();
|
|
13168
|
+
const selectedEle = this.parent.getSelectedElements();
|
|
13169
|
+
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
13170
|
+
this.updateContent(resWrap, conWrap, eventWrap, resCollection);
|
|
13171
|
+
this.setTranslate(resWrap, conWrap, eventWrap, timeIndicator);
|
|
13172
|
+
if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
|
|
13173
|
+
this.parent.dragAndDropModule.navigationWrapper();
|
|
13174
|
+
}
|
|
13175
|
+
window.clearTimeout(this.timeValue);
|
|
13176
|
+
this.timeValue = window.setTimeout(() => { this.renderEvents(); }, 250);
|
|
13177
|
+
}
|
|
13178
|
+
}
|
|
13179
|
+
}
|
|
13180
|
+
horizontalScrolling(conWrap) {
|
|
13027
13181
|
let resCollection = [];
|
|
13028
|
-
|
|
13029
|
-
|
|
13182
|
+
const scrollWidth = this.bufferCount * this.itemSize;
|
|
13183
|
+
if (Math.abs(conWrap.scrollLeft) - Math.abs(this.translateY) < 0) {
|
|
13184
|
+
resCollection = this.leftScroll(conWrap);
|
|
13030
13185
|
}
|
|
13031
|
-
else if (conWrap.
|
|
13032
|
-
resCollection = this.
|
|
13186
|
+
else if (Math.abs(conWrap.scrollLeft) - Math.abs(this.translateY) > scrollWidth) {
|
|
13187
|
+
resCollection = this.rightScroll(conWrap);
|
|
13033
13188
|
}
|
|
13034
13189
|
if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
|
|
13035
|
-
this.parent.
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
this.
|
|
13190
|
+
if (this.parent.resourceBase.expandedResources.length !== resCollection.length ||
|
|
13191
|
+
this.parent.resourceBase.expandedResources[0] !== resCollection[0] ||
|
|
13192
|
+
this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1] !==
|
|
13193
|
+
resCollection[resCollection.length - 1]) {
|
|
13194
|
+
this.parent.showSpinner();
|
|
13195
|
+
const colLevels = this.parent.activeView.colLevels.slice(0);
|
|
13196
|
+
this.updateHorizontalContent(conWrap, resCollection);
|
|
13197
|
+
setStyleAttribute(conWrap.querySelector('table'), { transform: `translateX(${this.translateY}px)` });
|
|
13198
|
+
this.parent.activeView.colLevels = colLevels;
|
|
13199
|
+
if (this.parent.dragAndDropModule && this.parent.dragAndDropModule.actionObj.action === 'drag') {
|
|
13200
|
+
this.parent.dragAndDropModule.navigationWrapper();
|
|
13201
|
+
}
|
|
13042
13202
|
}
|
|
13043
13203
|
window.clearTimeout(this.timeValue);
|
|
13044
13204
|
this.timeValue = window.setTimeout(() => { this.renderEvents(); }, 250);
|
|
@@ -13084,6 +13244,83 @@ class VirtualScroll {
|
|
|
13084
13244
|
this.translateY = conWrap.scrollTop;
|
|
13085
13245
|
return nextSetCollection;
|
|
13086
13246
|
}
|
|
13247
|
+
leftScroll(conWrap) {
|
|
13248
|
+
let index = 0;
|
|
13249
|
+
index = (~~(Math.abs(conWrap.scrollLeft) / this.itemSize) + Math.ceil(conWrap.clientWidth / this.itemSize)) - this.renderedLength;
|
|
13250
|
+
index = (index > 0) ? index : 0;
|
|
13251
|
+
return this.getCollection(index, index + this.renderedLength);
|
|
13252
|
+
}
|
|
13253
|
+
rightScroll(conWrap) {
|
|
13254
|
+
const lastLevel = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1];
|
|
13255
|
+
let nextSetIndex = 0;
|
|
13256
|
+
nextSetIndex = ~~(Math.abs(conWrap.scrollLeft) / this.itemSize);
|
|
13257
|
+
let lastIndex = nextSetIndex + this.renderedLength;
|
|
13258
|
+
lastIndex = (lastIndex > lastLevel.length - 1) ? lastLevel.length - 1 : lastIndex;
|
|
13259
|
+
return this.getCollection(lastIndex - this.renderedLength, lastIndex);
|
|
13260
|
+
}
|
|
13261
|
+
getCollection(startIndex, endIndex) {
|
|
13262
|
+
this.translateY = startIndex * this.itemSize;
|
|
13263
|
+
const lastLevel = this.getResCollection(startIndex, endIndex);
|
|
13264
|
+
if (this.parent.enableRtl) {
|
|
13265
|
+
this.translateY = -this.translateY;
|
|
13266
|
+
}
|
|
13267
|
+
return lastLevel;
|
|
13268
|
+
}
|
|
13269
|
+
getResCollection(startIndex, endIndex) {
|
|
13270
|
+
const lastLevel = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1];
|
|
13271
|
+
let resCollection = [];
|
|
13272
|
+
const index = { startIndex: 0, endIndex: 0 };
|
|
13273
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
13274
|
+
if (lastLevel[startIndex].date.getTime() === this.parent.resourceBase.expandedResources[0].date.getTime() &&
|
|
13275
|
+
lastLevel[endIndex].date.getTime() ===
|
|
13276
|
+
this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].date.getTime()) {
|
|
13277
|
+
return this.parent.resourceBase.expandedResources;
|
|
13278
|
+
}
|
|
13279
|
+
resCollection = this.getByDateCollection(lastLevel[startIndex], lastLevel[endIndex], index);
|
|
13280
|
+
this.setRenderedDates(resCollection);
|
|
13281
|
+
}
|
|
13282
|
+
else {
|
|
13283
|
+
if (lastLevel[startIndex].groupIndex === this.parent.resourceBase.expandedResources[0].groupIndex &&
|
|
13284
|
+
lastLevel[endIndex].groupIndex ===
|
|
13285
|
+
this.parent.resourceBase.expandedResources[this.parent.resourceBase.expandedResources.length - 1].groupIndex) {
|
|
13286
|
+
return this.parent.resourceBase.expandedResources;
|
|
13287
|
+
}
|
|
13288
|
+
resCollection = this.getByIdCollection(lastLevel[startIndex], lastLevel[endIndex], index);
|
|
13289
|
+
}
|
|
13290
|
+
if (this.parent.currentView !== 'Month') {
|
|
13291
|
+
this.startIndex = index.startIndex;
|
|
13292
|
+
resCollection = lastLevel.slice(index.startIndex, index.endIndex);
|
|
13293
|
+
}
|
|
13294
|
+
this.translateY = index.startIndex * this.itemSize;
|
|
13295
|
+
return resCollection;
|
|
13296
|
+
}
|
|
13297
|
+
getByDateCollection(firstItem, lastItem, index) {
|
|
13298
|
+
const resCollection = this.parent.activeView.colLevels[0].filter((data) => firstItem.date.getTime() <= data.date.getTime() &&
|
|
13299
|
+
data.date.getTime() <= lastItem.date.getTime());
|
|
13300
|
+
this.setStartEndIndex(this.parent.activeView.colLevels[0], resCollection[0], resCollection[resCollection.length - 1], index);
|
|
13301
|
+
return resCollection;
|
|
13302
|
+
}
|
|
13303
|
+
getByIdCollection(firstItem, lastItem, index) {
|
|
13304
|
+
const resCollection = this.parent.resourceBase.lastResourceLevel.filter((data) => firstItem.groupIndex <= data.groupIndex && data.groupIndex <= lastItem.groupIndex);
|
|
13305
|
+
this.parent.resourceBase.renderedResources = resCollection;
|
|
13306
|
+
this.setStartEndIndex(this.parent.resourceBase.lastResourceLevel, resCollection[0], resCollection[resCollection.length - 1], index);
|
|
13307
|
+
return resCollection;
|
|
13308
|
+
}
|
|
13309
|
+
setStartEndIndex(data, firstItem, lastItem, colIndex) {
|
|
13310
|
+
let index = 0;
|
|
13311
|
+
data.filter((data) => {
|
|
13312
|
+
if (firstItem === data) {
|
|
13313
|
+
colIndex.startIndex = index;
|
|
13314
|
+
}
|
|
13315
|
+
else if (lastItem === data) {
|
|
13316
|
+
colIndex.endIndex = index + data.colSpan;
|
|
13317
|
+
}
|
|
13318
|
+
index += data.colSpan;
|
|
13319
|
+
});
|
|
13320
|
+
if (firstItem === lastItem) {
|
|
13321
|
+
colIndex.endIndex = colIndex.startIndex + lastItem.colSpan;
|
|
13322
|
+
}
|
|
13323
|
+
}
|
|
13087
13324
|
updateContent(resWrap, conWrap, eventWrap, resCollection) {
|
|
13088
13325
|
const renderedLength = resWrap.querySelector('tbody').children.length;
|
|
13089
13326
|
if (document.activeElement && document.activeElement.classList.contains(RESOURCE_CELLS_CLASS)) {
|
|
@@ -13103,6 +13340,45 @@ class VirtualScroll {
|
|
|
13103
13340
|
append(contentRows, conWrap.querySelector('tbody'));
|
|
13104
13341
|
append(eventRows, eventWrap);
|
|
13105
13342
|
}
|
|
13343
|
+
updateHorizontalContent(conWrap, resCollection) {
|
|
13344
|
+
this.parent.resourceBase.expandedResources = resCollection;
|
|
13345
|
+
const selectedEle = this.parent.getSelectedElements();
|
|
13346
|
+
this.focusedEle = selectedEle[selectedEle.length - 1] || this.focusedEle;
|
|
13347
|
+
const renderedLength = conWrap.querySelectorAll('tbody tr').length;
|
|
13348
|
+
for (let i = 0; i < renderedLength; i++) {
|
|
13349
|
+
remove(conWrap.querySelector('tbody tr'));
|
|
13350
|
+
}
|
|
13351
|
+
if (this.parent.currentView === 'Month') {
|
|
13352
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
13353
|
+
this.parent.activeView.colLevels[0] = resCollection;
|
|
13354
|
+
}
|
|
13355
|
+
else {
|
|
13356
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 2] = resCollection;
|
|
13357
|
+
}
|
|
13358
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
13359
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
13360
|
+
}
|
|
13361
|
+
else {
|
|
13362
|
+
const col = [].slice.call(conWrap.querySelector('colgroup').children);
|
|
13363
|
+
for (let i = 0; i < col.length; i++) {
|
|
13364
|
+
remove(col[i]);
|
|
13365
|
+
}
|
|
13366
|
+
this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1] = resCollection;
|
|
13367
|
+
const contentRows = this.parent.activeView.getContentRows();
|
|
13368
|
+
const table = conWrap.querySelector('table');
|
|
13369
|
+
const thead = conWrap.querySelector('thead');
|
|
13370
|
+
const colGroupEle = conWrap.querySelector('colgroup');
|
|
13371
|
+
resCollection.forEach(() => {
|
|
13372
|
+
colGroupEle.appendChild(createElement('col'));
|
|
13373
|
+
});
|
|
13374
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('', this.startIndex > 0 ? this.startIndex : 0));
|
|
13375
|
+
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
13376
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
13377
|
+
}
|
|
13378
|
+
prepend([thead], table);
|
|
13379
|
+
append(contentRows, conWrap.querySelector('tbody'));
|
|
13380
|
+
}
|
|
13381
|
+
}
|
|
13106
13382
|
getBufferCollection(startIndex, endIndex) {
|
|
13107
13383
|
return this.parent.resourceBase.expandedResources.slice(startIndex, endIndex);
|
|
13108
13384
|
}
|
|
@@ -13125,6 +13401,17 @@ class VirtualScroll {
|
|
|
13125
13401
|
this.focusedEle = null;
|
|
13126
13402
|
}
|
|
13127
13403
|
}
|
|
13404
|
+
setRenderedDates(resCollection) {
|
|
13405
|
+
if (this.parent.currentView !== 'Month') {
|
|
13406
|
+
const dateCol = resCollection.map((x) => x.date);
|
|
13407
|
+
this.parent.resourceBase.renderedResources.forEach((x) => x.renderDates = dateCol);
|
|
13408
|
+
}
|
|
13409
|
+
else {
|
|
13410
|
+
const dateCol = resCollection.map((x) => x.date.getDay());
|
|
13411
|
+
const renderDates = this.parent.activeView.renderDates.filter((x) => dateCol.indexOf(x.getDay()) >= 0);
|
|
13412
|
+
this.parent.resourceBase.renderedResources.forEach((x) => x.renderDates = renderDates);
|
|
13413
|
+
}
|
|
13414
|
+
}
|
|
13128
13415
|
setTabIndex() {
|
|
13129
13416
|
const resColWrap = this.parent.element.querySelector('.' + RESOURCE_COLUMN_WRAP_CLASS);
|
|
13130
13417
|
const resCells = [].slice.call(this.parent.element.querySelectorAll('.' + RESOURCE_CELLS_CLASS));
|
|
@@ -13143,6 +13430,7 @@ class VirtualScroll {
|
|
|
13143
13430
|
}
|
|
13144
13431
|
destroy() {
|
|
13145
13432
|
this.removeEventListener();
|
|
13433
|
+
this.focusedEle = null;
|
|
13146
13434
|
}
|
|
13147
13435
|
}
|
|
13148
13436
|
|
|
@@ -13234,12 +13522,18 @@ class Render {
|
|
|
13234
13522
|
this.parent.virtualScrollModule.destroy();
|
|
13235
13523
|
this.parent.virtualScrollModule = null;
|
|
13236
13524
|
}
|
|
13237
|
-
if (
|
|
13525
|
+
if ((['Agenda', 'Year'].indexOf(this.parent.currentView) === -1 ||
|
|
13238
13526
|
(this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
|
|
13239
13527
|
&& this.parent.activeViewOptions.allowVirtualScrolling
|
|
13240
13528
|
&& this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
13241
13529
|
this.parent.virtualScrollModule = new VirtualScroll(this.parent);
|
|
13242
|
-
this.parent.
|
|
13530
|
+
if (this.parent.activeView.isTimelineView()) {
|
|
13531
|
+
this.parent.uiStateValues.top = 0;
|
|
13532
|
+
}
|
|
13533
|
+
else {
|
|
13534
|
+
this.parent.virtualScrollModule.isHorizontalScroll = true;
|
|
13535
|
+
this.parent.uiStateValues.left = 0;
|
|
13536
|
+
}
|
|
13243
13537
|
}
|
|
13244
13538
|
this.updateHeader();
|
|
13245
13539
|
this.parent.activeView.renderLayout(CURRENT_PANEL_CLASS);
|
|
@@ -13457,8 +13751,7 @@ class Crud {
|
|
|
13457
13751
|
if (this.parent.resizeModule && this.parent.resizeModule.actionObj && this.parent.resizeModule.actionObj.element) {
|
|
13458
13752
|
this.parent.resizeModule.actionObj.element.style.display = 'none';
|
|
13459
13753
|
}
|
|
13460
|
-
if (this.parent.
|
|
13461
|
-
&& !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {
|
|
13754
|
+
if (this.parent.isSpecificResourceEvents()) {
|
|
13462
13755
|
if (args.requestType === 'eventCreated' || args.requestType === 'eventRemoved') {
|
|
13463
13756
|
this.crudObj.isCrudAction = true;
|
|
13464
13757
|
this.crudObj.sourceEvent = [];
|
|
@@ -14717,7 +15010,8 @@ class ResourceBase {
|
|
|
14717
15010
|
child: 'resourceChild'
|
|
14718
15011
|
},
|
|
14719
15012
|
nodeTemplate: this.parent.resourceHeaderTemplate,
|
|
14720
|
-
nodeClicked: this.resourceClick.bind(this)
|
|
15013
|
+
nodeClicked: this.resourceClick.bind(this),
|
|
15014
|
+
created: this.resourceTreeCreated.bind(this)
|
|
14721
15015
|
});
|
|
14722
15016
|
this.treeViewObj.appendTo(resourceTree);
|
|
14723
15017
|
this.treeViewObj.expandAll();
|
|
@@ -14734,6 +15028,12 @@ class ResourceBase {
|
|
|
14734
15028
|
});
|
|
14735
15029
|
this.parent.on(documentClick, this.documentClick, this);
|
|
14736
15030
|
}
|
|
15031
|
+
resourceTreeCreated() {
|
|
15032
|
+
if (this.parent.portals) {
|
|
15033
|
+
this.parent.portals = this.parent.portals.concat(this.treeViewObj.portals);
|
|
15034
|
+
this.parent.renderTemplates();
|
|
15035
|
+
}
|
|
15036
|
+
}
|
|
14737
15037
|
generateTreeData(isTimeLine) {
|
|
14738
15038
|
const treeCollection = [];
|
|
14739
15039
|
const resTreeColl = [];
|
|
@@ -15325,6 +15625,10 @@ class ResourceBase {
|
|
|
15325
15625
|
destroy() {
|
|
15326
15626
|
this.parent.off(documentClick, this.documentClick);
|
|
15327
15627
|
if (this.treeViewObj) {
|
|
15628
|
+
if (this.treeViewObj.portals && this.treeViewObj.portals.length > 0) {
|
|
15629
|
+
const treeViewTemplates = this.treeViewObj.portals.map((x) => x.propName);
|
|
15630
|
+
this.parent.resetTemplates(treeViewTemplates);
|
|
15631
|
+
}
|
|
15328
15632
|
this.treeViewObj.destroy();
|
|
15329
15633
|
this.treeViewObj = null;
|
|
15330
15634
|
}
|
|
@@ -16536,6 +16840,16 @@ let Schedule = class Schedule extends Component {
|
|
|
16536
16840
|
append(indentTemplate, td);
|
|
16537
16841
|
}
|
|
16538
16842
|
}
|
|
16843
|
+
/**
|
|
16844
|
+
* Method to check for refreshing the targeted resource row events.
|
|
16845
|
+
*
|
|
16846
|
+
* @returns {boolean} Returns the boolean value
|
|
16847
|
+
* @private
|
|
16848
|
+
*/
|
|
16849
|
+
isSpecificResourceEvents() {
|
|
16850
|
+
return this.activeViewOptions.group.resources.length > 0 && !this.activeViewOptions.group.allowGroupEdit &&
|
|
16851
|
+
!this.rowAutoHeight && !this.virtualScrollModule && this.activeViewOptions.group.byGroupID;
|
|
16852
|
+
}
|
|
16539
16853
|
unWireEvents() {
|
|
16540
16854
|
EventHandler.remove(window, 'resize', this.onScheduleResize);
|
|
16541
16855
|
EventHandler.remove(window, 'orientationchange', this.onScheduleResize);
|
|
@@ -17795,10 +18109,6 @@ let Schedule = class Schedule extends Component {
|
|
|
17795
18109
|
this.hideSpinner();
|
|
17796
18110
|
this.unWireEvents();
|
|
17797
18111
|
this.destroyHeaderModule();
|
|
17798
|
-
if (this.eventTooltip) {
|
|
17799
|
-
this.eventTooltip.destroy();
|
|
17800
|
-
this.eventTooltip = null;
|
|
17801
|
-
}
|
|
17802
18112
|
if (this.eventBase) {
|
|
17803
18113
|
this.eventBase.destroy();
|
|
17804
18114
|
this.eventBase = null;
|
|
@@ -17872,6 +18182,9 @@ __decorate([
|
|
|
17872
18182
|
__decorate([
|
|
17873
18183
|
Property(true)
|
|
17874
18184
|
], Schedule.prototype, "showTimeIndicator", void 0);
|
|
18185
|
+
__decorate([
|
|
18186
|
+
Property(true)
|
|
18187
|
+
], Schedule.prototype, "allowSwiping", void 0);
|
|
17875
18188
|
__decorate([
|
|
17876
18189
|
Property('Week')
|
|
17877
18190
|
], Schedule.prototype, "currentView", void 0);
|
|
@@ -18193,7 +18506,7 @@ class ActionBase {
|
|
|
18193
18506
|
const viewElement = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
18194
18507
|
let trElement = [].slice.call(viewElement.querySelector('tr').children);
|
|
18195
18508
|
if (!this.parent.activeView.isTimelineView() && this.parent.activeViewOptions.group.resources.length > 0 &&
|
|
18196
|
-
!this.parent.isAdaptive && !this.parent.enableAdaptiveUI) {
|
|
18509
|
+
!this.parent.isAdaptive && !this.parent.enableAdaptiveUI && !this.parent.virtualScrollModule) {
|
|
18197
18510
|
trElement = this.getResourceElements(trElement);
|
|
18198
18511
|
}
|
|
18199
18512
|
const leftOffset = trElement[0].getBoundingClientRect();
|
|
@@ -18285,7 +18598,7 @@ class ActionBase {
|
|
|
18285
18598
|
let originalElement;
|
|
18286
18599
|
const guid = element.getAttribute('data-guid');
|
|
18287
18600
|
const isMorePopup = element.offsetParent && element.offsetParent.classList.contains(MORE_EVENT_POPUP_CLASS);
|
|
18288
|
-
if (isMorePopup || this.parent.activeView.isTimelineView()) {
|
|
18601
|
+
if (isMorePopup || this.parent.activeView.isTimelineView() || (this.actionObj.action !== 'resize' && this.parent.virtualScrollModule)) {
|
|
18289
18602
|
originalElement = [].slice.call(this.parent.element.querySelectorAll('[data-guid="' + guid + '"]'));
|
|
18290
18603
|
}
|
|
18291
18604
|
else {
|
|
@@ -18498,7 +18811,9 @@ class ActionBase {
|
|
|
18498
18811
|
let workDays = this.parent.activeViewOptions.workDays;
|
|
18499
18812
|
let groupOrder;
|
|
18500
18813
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
18501
|
-
const
|
|
18814
|
+
const renderedResource = this.parent.virtualScrollModule && this.parent.virtualScrollModule.isHorizontalScroll ?
|
|
18815
|
+
this.parent.resourceBase.renderedResources : this.parent.resourceBase.lastResourceLevel;
|
|
18816
|
+
const resources = renderedResource.
|
|
18502
18817
|
filter((res) => res.groupIndex === this.actionObj.groupIndex);
|
|
18503
18818
|
dateRender = resources[0].renderDates;
|
|
18504
18819
|
const elementSelector = `.${WORK_CELLS_CLASS}[data-group-index="${this.actionObj.groupIndex}"]`;
|
|
@@ -18821,9 +19136,7 @@ class Resize extends ActionBase {
|
|
|
18821
19136
|
if (resizeEventArgs.cancel) {
|
|
18822
19137
|
return;
|
|
18823
19138
|
}
|
|
18824
|
-
if (this.parent.
|
|
18825
|
-
&& !this.parent.activeViewOptions.group.allowGroupEdit && !this.parent.virtualScrollModule
|
|
18826
|
-
&& this.parent.activeViewOptions.group.byGroupID) {
|
|
19139
|
+
if (this.parent.isSpecificResourceEvents()) {
|
|
18827
19140
|
this.parent.crudModule.crudObj.sourceEvent =
|
|
18828
19141
|
[this.parent.resourceBase.lastResourceLevel[parseInt(resizeEventArgs.element.getAttribute('data-group-index'), 10)]];
|
|
18829
19142
|
this.parent.crudModule.crudObj.targetEvent = this.parent.crudModule.crudObj.sourceEvent;
|
|
@@ -19433,7 +19746,7 @@ class YearEvent extends TimelineEvent {
|
|
|
19433
19746
|
'data-id': 'Appointment_' + record[this.fields.id],
|
|
19434
19747
|
'data-guid': record.Guid,
|
|
19435
19748
|
'role': 'button', 'tabindex': '0',
|
|
19436
|
-
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
|
|
19749
|
+
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(record), 'aria-pressed': 'false',
|
|
19437
19750
|
'aria-label': this.parent.getAnnouncementString(record)
|
|
19438
19751
|
}
|
|
19439
19752
|
});
|
|
@@ -19931,7 +20244,6 @@ class DragAndDrop extends ActionBase {
|
|
|
19931
20244
|
this.actionObj.scrollInterval = null;
|
|
19932
20245
|
this.actionClass('removeClass');
|
|
19933
20246
|
this.parent.uiStateValues.action = false;
|
|
19934
|
-
this.actionObj.action = null;
|
|
19935
20247
|
if (this.isAllowDrop(e)) {
|
|
19936
20248
|
return;
|
|
19937
20249
|
}
|
|
@@ -19941,12 +20253,12 @@ class DragAndDrop extends ActionBase {
|
|
|
19941
20253
|
cancel: false, data: this.getChangedData(this.updatedData), selectedData: this.updatedData,
|
|
19942
20254
|
event: e, element: this.actionObj.element, target: target
|
|
19943
20255
|
};
|
|
20256
|
+
this.actionObj.action = null;
|
|
19944
20257
|
this.parent.trigger(dragStop, dragArgs, (dragEventArgs) => {
|
|
19945
20258
|
if (dragEventArgs.cancel) {
|
|
19946
20259
|
return;
|
|
19947
20260
|
}
|
|
19948
|
-
if (this.parent.
|
|
19949
|
-
&& !this.parent.rowAutoHeight && !this.parent.virtualScrollModule && this.parent.activeViewOptions.group.byGroupID) {
|
|
20261
|
+
if (this.parent.isSpecificResourceEvents()) {
|
|
19950
20262
|
this.parent.crudModule.crudObj.isCrudAction = true;
|
|
19951
20263
|
this.parent.crudModule.crudObj.sourceEvent =
|
|
19952
20264
|
[this.parent.resourceBase.lastResourceLevel[parseInt(dragArgs.element.getAttribute('data-group-index'), 10)]];
|
|
@@ -20081,7 +20393,7 @@ class DragAndDrop extends ActionBase {
|
|
|
20081
20393
|
const eventDuration = eventObj[this.parent.eventFields.endTime].getTime() -
|
|
20082
20394
|
eventObj[this.parent.eventFields.startTime].getTime();
|
|
20083
20395
|
const td = closest(e.target, 'td');
|
|
20084
|
-
if (this.parent.currentView === 'TimelineYear' && !td.classList.contains(
|
|
20396
|
+
if (this.parent.currentView === 'TimelineYear' && (!td.classList.contains(WORK_CELLS_CLASS) || td.classList.contains(OTHERMONTH_CLASS))) {
|
|
20085
20397
|
return;
|
|
20086
20398
|
}
|
|
20087
20399
|
const dragStart$$1 = this.parent.getDateFromElement(td);
|
|
@@ -20183,7 +20495,9 @@ class DragAndDrop extends ActionBase {
|
|
|
20183
20495
|
this.actionObj.clone.classList.contains(ALLDAY_APPOINTMENT_CLASS)) {
|
|
20184
20496
|
dragEnd = addDays(resetTime(dragEnd), 1);
|
|
20185
20497
|
}
|
|
20186
|
-
|
|
20498
|
+
const index = this.parent.activeViewOptions.group.byDate || (this.parent.virtualScrollModule &&
|
|
20499
|
+
!this.parent.activeViewOptions.timeScale.enable) ? colIndex : undefined;
|
|
20500
|
+
this.updateAllDayEvents(dragStart$$1, dragEnd, index);
|
|
20187
20501
|
}
|
|
20188
20502
|
this.actionObj.start = new Date(+dragStart$$1);
|
|
20189
20503
|
this.actionObj.end = new Date(+dragEnd);
|
|
@@ -20308,10 +20622,12 @@ class DragAndDrop extends ActionBase {
|
|
|
20308
20622
|
}
|
|
20309
20623
|
updateEventHeight(event, index, colIndex) {
|
|
20310
20624
|
this.verticalEvent.initializeValues();
|
|
20311
|
-
let datesCount =
|
|
20625
|
+
let datesCount = this.verticalEvent.getStartCount();
|
|
20312
20626
|
if (!this.parent.uiStateValues.isGroupAdaptive) {
|
|
20313
20627
|
for (let i = 0; i < this.actionObj.groupIndex; i++) {
|
|
20314
|
-
|
|
20628
|
+
if (this.verticalEvent.dateRender[i]) {
|
|
20629
|
+
datesCount = datesCount + this.verticalEvent.dateRender[i].length;
|
|
20630
|
+
}
|
|
20315
20631
|
}
|
|
20316
20632
|
}
|
|
20317
20633
|
const indexGroup = this.parent.uiStateValues.isGroupAdaptive ? datesCount : this.actionObj.groupIndex;
|
|
@@ -20924,11 +21240,15 @@ class ViewBase {
|
|
|
20924
21240
|
}
|
|
20925
21241
|
createTableLayout(className) {
|
|
20926
21242
|
const clsName = className || '';
|
|
20927
|
-
const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName
|
|
21243
|
+
const table = createElement('table', { className: SCHEDULE_TABLE_CLASS + ' ' + clsName });
|
|
20928
21244
|
const tbody = createElement('tbody');
|
|
20929
21245
|
table.appendChild(tbody);
|
|
20930
21246
|
return table;
|
|
20931
21247
|
}
|
|
21248
|
+
setAriaAttributes(table) {
|
|
21249
|
+
table.setAttribute('role', 'grid');
|
|
21250
|
+
table.setAttribute('aria-label', this.getLabelText(this.parent.currentView));
|
|
21251
|
+
}
|
|
20932
21252
|
createColGroup(table, lastRow) {
|
|
20933
21253
|
let length = lastRow.length;
|
|
20934
21254
|
if (lastRow[0] && lastRow[0].colSpan) {
|
|
@@ -21386,6 +21706,32 @@ class ViewBase {
|
|
|
21386
21706
|
}
|
|
21387
21707
|
return null;
|
|
21388
21708
|
}
|
|
21709
|
+
resetColLevels() {
|
|
21710
|
+
this.parent.resourceBase.expandedResources = [];
|
|
21711
|
+
const renderedCount = this.parent.virtualScrollModule.getRenderedCount();
|
|
21712
|
+
const lastLevel = this.parent.activeViewOptions.group.byDate ? this.colLevels[0] :
|
|
21713
|
+
this.parent.resourceBase.renderedResources;
|
|
21714
|
+
let index = 0;
|
|
21715
|
+
for (let i = 0; i < lastLevel.length; i++) {
|
|
21716
|
+
if (index >= renderedCount) {
|
|
21717
|
+
break;
|
|
21718
|
+
}
|
|
21719
|
+
index += lastLevel[i].colSpan;
|
|
21720
|
+
this.parent.resourceBase.expandedResources.push(lastLevel[i]);
|
|
21721
|
+
}
|
|
21722
|
+
if (this.parent.activeViewOptions.group.byDate) {
|
|
21723
|
+
this.colLevels[0] = this.parent.resourceBase.expandedResources;
|
|
21724
|
+
this.parent.virtualScrollModule.setRenderedDates(this.parent.resourceBase.expandedResources);
|
|
21725
|
+
}
|
|
21726
|
+
else {
|
|
21727
|
+
this.colLevels[this.colLevels.length - 2] = this.parent.resourceBase.expandedResources;
|
|
21728
|
+
this.parent.resourceBase.renderedResources = this.parent.resourceBase.expandedResources;
|
|
21729
|
+
}
|
|
21730
|
+
if (this.parent.currentView !== 'Month') {
|
|
21731
|
+
this.colLevels[this.colLevels.length - 1] = this.colLevels[this.colLevels.length - 1].slice(0, index);
|
|
21732
|
+
this.parent.resourceBase.expandedResources = this.colLevels[this.colLevels.length - 1];
|
|
21733
|
+
}
|
|
21734
|
+
}
|
|
21389
21735
|
destroy() {
|
|
21390
21736
|
if (this.element && this.element.parentNode) {
|
|
21391
21737
|
remove(this.element);
|
|
@@ -21630,14 +21976,25 @@ class VerticalView extends ViewBase {
|
|
|
21630
21976
|
if (!isNullOrUndefined(this.parent.resourceBase) && (this.parent.activeViewOptions.group.resources.length > 0) &&
|
|
21631
21977
|
!this.parent.uiStateValues.isGroupAdaptive) {
|
|
21632
21978
|
let count = 0;
|
|
21633
|
-
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
|
|
21637
|
-
(
|
|
21638
|
-
|
|
21979
|
+
if (this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling &&
|
|
21980
|
+
this.parent.activeViewOptions.group.byDate) {
|
|
21981
|
+
for (const resource of this.parent.resourceBase.expandedResources) {
|
|
21982
|
+
if (resetTime(resource.date).getTime() === resetTime(this.parent.getCurrentTime()).getTime()) {
|
|
21983
|
+
currentDateIndex.push(count);
|
|
21984
|
+
}
|
|
21985
|
+
count += 1;
|
|
21986
|
+
}
|
|
21987
|
+
}
|
|
21988
|
+
else {
|
|
21989
|
+
for (const resource of this.parent.resourceBase.renderedResources) {
|
|
21990
|
+
const index = this.parent.getIndexOfDate(resource.renderDates, resetTime(this.parent.getCurrentTime()));
|
|
21991
|
+
if (index >= 0) {
|
|
21992
|
+
const resIndex = this.parent.activeViewOptions.group.byDate ?
|
|
21993
|
+
(this.parent.resourceBase.lastResourceLevel.length * index) + count : count + index;
|
|
21994
|
+
currentDateIndex.push(resIndex);
|
|
21995
|
+
}
|
|
21996
|
+
count += this.parent.activeViewOptions.group.byDate ? 1 : resource.renderDates.length;
|
|
21639
21997
|
}
|
|
21640
|
-
count += this.parent.activeViewOptions.group.byDate ? 1 : resource.renderDates.length;
|
|
21641
21998
|
}
|
|
21642
21999
|
}
|
|
21643
22000
|
else {
|
|
@@ -21780,7 +22137,7 @@ class VerticalView extends ViewBase {
|
|
|
21780
22137
|
if (!this.parent.activeViewOptions.timeScale.enable) {
|
|
21781
22138
|
addClass([this.element], [TIMESCALE_DISABLE, this.viewClass]);
|
|
21782
22139
|
}
|
|
21783
|
-
if (this.parent.activeViewOptions.allowVirtualScrolling) {
|
|
22140
|
+
if (this.parent.activeViewOptions.allowVirtualScrolling && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
21784
22141
|
clsList.push(VIRTUAL_SCROLL_CLASS);
|
|
21785
22142
|
}
|
|
21786
22143
|
if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
|
|
@@ -21811,6 +22168,9 @@ class VerticalView extends ViewBase {
|
|
|
21811
22168
|
prepend([tr], this.element.querySelector('tbody'));
|
|
21812
22169
|
}
|
|
21813
22170
|
renderContent() {
|
|
22171
|
+
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
22172
|
+
this.parent.resourceBase.renderedResources = extend([], this.parent.resourceBase.lastResourceLevel, null, true);
|
|
22173
|
+
}
|
|
21814
22174
|
const tr = createElement('tr');
|
|
21815
22175
|
const workTd = createElement('td');
|
|
21816
22176
|
if (this.parent.isAdaptive) {
|
|
@@ -21826,13 +22186,22 @@ class VerticalView extends ViewBase {
|
|
|
21826
22186
|
tr.appendChild(workTd);
|
|
21827
22187
|
}
|
|
21828
22188
|
else {
|
|
21829
|
-
|
|
22189
|
+
const levels = this.colLevels.slice(0);
|
|
22190
|
+
if (this.parent.virtualScrollModule) {
|
|
22191
|
+
this.resetColLevels();
|
|
22192
|
+
}
|
|
22193
|
+
const wrap = this.renderContentArea();
|
|
22194
|
+
workTd.appendChild(wrap);
|
|
21830
22195
|
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
21831
22196
|
const timesTd = createElement('td');
|
|
21832
22197
|
timesTd.appendChild(this.renderTimeCells());
|
|
21833
22198
|
tr.appendChild(timesTd);
|
|
21834
22199
|
}
|
|
21835
22200
|
tr.appendChild(workTd);
|
|
22201
|
+
if (this.parent.virtualScrollModule) {
|
|
22202
|
+
this.colLevels = levels;
|
|
22203
|
+
this.parent.virtualScrollModule.renderVirtualTrack(wrap);
|
|
22204
|
+
}
|
|
21836
22205
|
}
|
|
21837
22206
|
this.element.querySelector('tbody').appendChild(tr);
|
|
21838
22207
|
}
|
|
@@ -21904,7 +22273,6 @@ class VerticalView extends ViewBase {
|
|
|
21904
22273
|
td.className = [ALLDAY_CELLS_CLASS];
|
|
21905
22274
|
td.type = 'alldayCells';
|
|
21906
22275
|
const ntd = this.createTd(td);
|
|
21907
|
-
ntd.setAttribute('role', 'gridcell');
|
|
21908
22276
|
ntd.setAttribute('data-date', td.date.getTime().toString());
|
|
21909
22277
|
if (!isNullOrUndefined(td.groupIndex)) {
|
|
21910
22278
|
ntd.setAttribute('data-group-index', '' + td.groupIndex);
|
|
@@ -21917,7 +22285,7 @@ class VerticalView extends ViewBase {
|
|
|
21917
22285
|
}
|
|
21918
22286
|
table.querySelector('tbody').appendChild(ntr);
|
|
21919
22287
|
const thead = createElement('thead');
|
|
21920
|
-
thead.appendChild(this.createEventWrapper('allDay'));
|
|
22288
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('allDay'));
|
|
21921
22289
|
prepend([thead], table);
|
|
21922
22290
|
}
|
|
21923
22291
|
createTd(td) {
|
|
@@ -21937,7 +22305,6 @@ class VerticalView extends ViewBase {
|
|
|
21937
22305
|
}
|
|
21938
22306
|
if (td.type === 'dateHeader' && td.className.indexOf(HEADER_CELLS_CLASS) >= 0) {
|
|
21939
22307
|
tdEle.setAttribute('data-date', td.date.getTime().toString());
|
|
21940
|
-
tdEle.setAttribute('role', 'gridcell');
|
|
21941
22308
|
if (!isNullOrUndefined(td.groupIndex)) {
|
|
21942
22309
|
tdEle.setAttribute('data-group-index', '' + td.groupIndex);
|
|
21943
22310
|
}
|
|
@@ -21977,6 +22344,7 @@ class VerticalView extends ViewBase {
|
|
|
21977
22344
|
renderContentArea() {
|
|
21978
22345
|
const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
|
|
21979
22346
|
const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
|
|
22347
|
+
this.setAriaAttributes(tbl);
|
|
21980
22348
|
this.addAutoHeightClass(tbl);
|
|
21981
22349
|
this.renderContentTable(tbl);
|
|
21982
22350
|
this.createColGroup(tbl, this.colLevels.slice(-1)[0]);
|
|
@@ -21987,20 +22355,25 @@ class VerticalView extends ViewBase {
|
|
|
21987
22355
|
return wrap;
|
|
21988
22356
|
}
|
|
21989
22357
|
renderContentTable(table) {
|
|
21990
|
-
const
|
|
21991
|
-
|
|
21992
|
-
|
|
22358
|
+
const tBody = table.querySelector('tbody');
|
|
22359
|
+
append(this.getContentRows(), tBody);
|
|
22360
|
+
this.renderContentTableHeader(table);
|
|
22361
|
+
}
|
|
22362
|
+
getContentRows() {
|
|
22363
|
+
const rows = [];
|
|
22364
|
+
const tr = createElement('tr');
|
|
22365
|
+
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
21993
22366
|
const handler = (r) => {
|
|
21994
22367
|
const ntr = tr.cloneNode();
|
|
21995
22368
|
for (const tdData of this.colLevels[this.colLevels.length - 1]) {
|
|
21996
22369
|
const ntd = this.createContentTd(tdData, r, td);
|
|
21997
22370
|
ntr.appendChild(ntd);
|
|
21998
22371
|
}
|
|
21999
|
-
|
|
22372
|
+
rows.push(ntr);
|
|
22000
22373
|
return r;
|
|
22001
22374
|
};
|
|
22002
22375
|
this.getTimeSlotRows(handler);
|
|
22003
|
-
|
|
22376
|
+
return rows;
|
|
22004
22377
|
}
|
|
22005
22378
|
createContentTd(tdData, r, td) {
|
|
22006
22379
|
const ntd = td.cloneNode();
|
|
@@ -22047,35 +22420,12 @@ class VerticalView extends ViewBase {
|
|
|
22047
22420
|
}
|
|
22048
22421
|
renderContentTableHeader(table) {
|
|
22049
22422
|
const thead = createElement('thead');
|
|
22050
|
-
thead.appendChild(this.createEventWrapper());
|
|
22423
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper());
|
|
22051
22424
|
if (this.parent.activeViewOptions.timeScale.enable) {
|
|
22052
|
-
thead.appendChild(this.createEventWrapper('timeIndicator'));
|
|
22425
|
+
thead.appendChild(this.parent.eventBase.createEventWrapper('timeIndicator'));
|
|
22053
22426
|
}
|
|
22054
22427
|
prepend([thead], table);
|
|
22055
22428
|
}
|
|
22056
|
-
createEventWrapper(type = '') {
|
|
22057
|
-
const tr = createElement('tr');
|
|
22058
|
-
const levels = this.colLevels.slice(-1)[0];
|
|
22059
|
-
for (let i = 0, len = levels.length; i < len; i++) {
|
|
22060
|
-
const col = levels[i];
|
|
22061
|
-
const appointmentWrap = createElement('td', {
|
|
22062
|
-
className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
|
|
22063
|
-
TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
|
|
22064
|
-
});
|
|
22065
|
-
if (!isNullOrUndefined(col.groupIndex)) {
|
|
22066
|
-
appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
|
|
22067
|
-
}
|
|
22068
|
-
if (type === '') {
|
|
22069
|
-
const innerWrapper = createElement('div', {
|
|
22070
|
-
id: APPOINTMENT_WRAPPER_CLASS + '-' + i.toString(),
|
|
22071
|
-
className: APPOINTMENT_WRAPPER_CLASS
|
|
22072
|
-
});
|
|
22073
|
-
appointmentWrap.appendChild(innerWrapper);
|
|
22074
|
-
}
|
|
22075
|
-
tr.appendChild(appointmentWrap);
|
|
22076
|
-
}
|
|
22077
|
-
return tr;
|
|
22078
|
-
}
|
|
22079
22429
|
getScrollableElement() {
|
|
22080
22430
|
if (this.parent.isAdaptive && !this.isTimelineView()) {
|
|
22081
22431
|
return this.element.querySelector('.' + SCROLL_CONTAINER_CLASS);
|
|
@@ -22427,7 +22777,7 @@ class Month extends ViewBase {
|
|
|
22427
22777
|
if (this.parent.activeViewOptions.group.byDate) {
|
|
22428
22778
|
clsList.push('e-by-date');
|
|
22429
22779
|
}
|
|
22430
|
-
if (this.parent.activeViewOptions.allowVirtualScrolling) {
|
|
22780
|
+
if (this.parent.activeViewOptions.allowVirtualScrolling && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
22431
22781
|
clsList.push(VIRTUAL_SCROLL_CLASS);
|
|
22432
22782
|
}
|
|
22433
22783
|
if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
|
|
@@ -22475,11 +22825,18 @@ class Month extends ViewBase {
|
|
|
22475
22825
|
}
|
|
22476
22826
|
}
|
|
22477
22827
|
renderContent() {
|
|
22828
|
+
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
22829
|
+
this.parent.resourceBase.renderedResources = extend([], this.parent.resourceBase.lastResourceLevel, null, true);
|
|
22830
|
+
}
|
|
22478
22831
|
const tr = createElement('tr');
|
|
22479
22832
|
if (this.parent.activeViewOptions.showWeekNumber) {
|
|
22480
22833
|
tr.appendChild(this.renderWeekNumberContent());
|
|
22481
22834
|
}
|
|
22482
22835
|
const workTd = createElement('td');
|
|
22836
|
+
const levels = this.colLevels.slice(0);
|
|
22837
|
+
if (this.parent.virtualScrollModule) {
|
|
22838
|
+
this.resetColLevels();
|
|
22839
|
+
}
|
|
22483
22840
|
const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
|
|
22484
22841
|
const contentArea = this.renderContentArea();
|
|
22485
22842
|
if (this.parent.currentView === 'Month') {
|
|
@@ -22493,6 +22850,10 @@ class Month extends ViewBase {
|
|
|
22493
22850
|
EventHandler.add(wrap, 'scroll', this.onContentScroll, this);
|
|
22494
22851
|
workTd.appendChild(wrap);
|
|
22495
22852
|
tr.appendChild(workTd);
|
|
22853
|
+
if (this.parent.virtualScrollModule) {
|
|
22854
|
+
this.colLevels = levels;
|
|
22855
|
+
this.parent.virtualScrollModule.renderVirtualTrack(wrap);
|
|
22856
|
+
}
|
|
22496
22857
|
this.element.querySelector('tbody').appendChild(tr);
|
|
22497
22858
|
this.renderAppointmentContainer();
|
|
22498
22859
|
}
|
|
@@ -22520,6 +22881,11 @@ class Month extends ViewBase {
|
|
|
22520
22881
|
const wrap = createElement('div', { className: DATE_HEADER_WRAP_CLASS });
|
|
22521
22882
|
container.appendChild(wrap);
|
|
22522
22883
|
const table = this.createTableLayout();
|
|
22884
|
+
if (this.parent.currentView === 'Month') {
|
|
22885
|
+
const thead = createElement('thead');
|
|
22886
|
+
thead.appendChild(createElement('tr'));
|
|
22887
|
+
prepend([thead], table);
|
|
22888
|
+
}
|
|
22523
22889
|
this.createColGroup(table, this.colLevels[this.colLevels.length - 1]);
|
|
22524
22890
|
const trEle = createElement('tr');
|
|
22525
22891
|
for (let i = 0; i < this.colLevels.length; i++) {
|
|
@@ -22607,9 +22973,12 @@ class Month extends ViewBase {
|
|
|
22607
22973
|
const dates = this.renderDates.map((date) => new Date(+date));
|
|
22608
22974
|
const count = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH :
|
|
22609
22975
|
this.parent.activeViewOptions.workDays.length;
|
|
22976
|
+
const level = this.colLevels.slice(0, 1)[0];
|
|
22977
|
+
const startIndex = this.renderDates.map(Number).indexOf(+level[0].date);
|
|
22610
22978
|
for (let i = 0; i < (this.renderDates.length / count); i++) {
|
|
22611
22979
|
const colDates = dates.splice(0, count);
|
|
22612
|
-
for (
|
|
22980
|
+
for (let j = startIndex; j < (this.colLevels[0].length + startIndex) && j < colDates.length; j++) {
|
|
22981
|
+
const colDate = colDates[j];
|
|
22613
22982
|
if (includeResource) {
|
|
22614
22983
|
const lastRow = this.colLevels[(this.colLevels.length - 1)];
|
|
22615
22984
|
const resourcesTd = lastRow.slice(0, lastRow.length / count);
|
|
@@ -22645,6 +23014,7 @@ class Month extends ViewBase {
|
|
|
22645
23014
|
}
|
|
22646
23015
|
renderContentArea() {
|
|
22647
23016
|
const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
|
|
23017
|
+
this.setAriaAttributes(tbl);
|
|
22648
23018
|
this.addAutoHeightClass(tbl);
|
|
22649
23019
|
if (this.parent.currentView === 'TimelineMonth') {
|
|
22650
23020
|
this.createColGroup(tbl, this.colLevels[this.colLevels.length - 1]);
|
|
@@ -22661,8 +23031,8 @@ class Month extends ViewBase {
|
|
|
22661
23031
|
}
|
|
22662
23032
|
getContentRows() {
|
|
22663
23033
|
const trows = [];
|
|
22664
|
-
const tr = createElement('tr'
|
|
22665
|
-
const td = createElement('td', { attrs: {
|
|
23034
|
+
const tr = createElement('tr');
|
|
23035
|
+
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
22666
23036
|
const slotDatas = this.getContentSlots();
|
|
22667
23037
|
for (let row = 0; row < slotDatas.length; row++) {
|
|
22668
23038
|
const ntr = tr.cloneNode();
|
|
@@ -22936,7 +23306,7 @@ class Year extends ViewBase {
|
|
|
22936
23306
|
this.generateColumnLevels();
|
|
22937
23307
|
this.renderResourceMobileLayout();
|
|
22938
23308
|
}
|
|
22939
|
-
|
|
23309
|
+
EventHandler.add(this.element.querySelector('.' + CONTENT_WRAP_CLASS), 'scroll', this.onContentScroll, this);
|
|
22940
23310
|
this.parent.notify(contentReady, {});
|
|
22941
23311
|
}
|
|
22942
23312
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -22971,7 +23341,14 @@ class Year extends ViewBase {
|
|
|
22971
23341
|
}
|
|
22972
23342
|
renderCalendarHeader(currentDate) {
|
|
22973
23343
|
const headerWrapper = createElement('div', { className: 'e-header e-month' });
|
|
22974
|
-
const headerContent = createElement('div', { className: 'e-day e-title'
|
|
23344
|
+
const headerContent = createElement('div', { className: 'e-day e-title' });
|
|
23345
|
+
if (this.parent.monthHeaderTemplate) {
|
|
23346
|
+
const args = { date: currentDate, type: 'monthHeader' };
|
|
23347
|
+
this.renderTemplates(this.parent.getMonthHeaderTemplate(), args, 'monthHeaderTemplate', this.parent.activeViewOptions.monthHeaderTemplateName, headerContent);
|
|
23348
|
+
}
|
|
23349
|
+
else {
|
|
23350
|
+
headerContent.innerHTML = this.getMonthName(currentDate);
|
|
23351
|
+
}
|
|
22975
23352
|
headerWrapper.appendChild(headerContent);
|
|
22976
23353
|
this.parent.trigger(renderCell, { elementType: 'headerCells', element: headerContent, date: currentDate });
|
|
22977
23354
|
return headerWrapper;
|
|
@@ -22981,6 +23358,7 @@ class Year extends ViewBase {
|
|
|
22981
23358
|
const contentWrapper = createElement('div', { className: 'e-content e-month' });
|
|
22982
23359
|
const contentTable = this.createTableLayout('e-calendar-table ' + CONTENT_TABLE_CLASS);
|
|
22983
23360
|
contentWrapper.appendChild(contentTable);
|
|
23361
|
+
this.setAriaAttributes(contentTable);
|
|
22984
23362
|
const thead = createElement('thead', { className: 'e-week-header' });
|
|
22985
23363
|
const tr = createElement('tr');
|
|
22986
23364
|
let currentWeek = getWeekFirstDate(firstDateOfMonth(currentDate), this.parent.firstDayOfWeek);
|
|
@@ -22988,7 +23366,15 @@ class Year extends ViewBase {
|
|
|
22988
23366
|
tr.appendChild(createElement('th'));
|
|
22989
23367
|
}
|
|
22990
23368
|
for (let i = 0; i < WEEK_LENGTH; i++) {
|
|
22991
|
-
|
|
23369
|
+
if (this.parent.dayHeaderTemplate) {
|
|
23370
|
+
const th = createElement('th');
|
|
23371
|
+
const args = { date: currentWeek, type: 'dayHeader' };
|
|
23372
|
+
this.renderTemplates(this.parent.getDayHeaderTemplate(), args, 'dayHeaderTemplate', this.parent.activeViewOptions.dayHeaderTemplateName, th);
|
|
23373
|
+
tr.appendChild(th);
|
|
23374
|
+
}
|
|
23375
|
+
else {
|
|
23376
|
+
tr.appendChild(createElement('th', { innerHTML: this.parent.getDayNames('narrow')[currentWeek.getDay()] }));
|
|
23377
|
+
}
|
|
22992
23378
|
currentWeek = new Date(currentWeek.getTime() + MS_PER_DAY);
|
|
22993
23379
|
}
|
|
22994
23380
|
thead.appendChild(tr);
|
|
@@ -22996,12 +23382,12 @@ class Year extends ViewBase {
|
|
|
22996
23382
|
const tbody = contentTable.querySelector('tbody');
|
|
22997
23383
|
while (dateCollection.length > 0) {
|
|
22998
23384
|
const weekDates = dateCollection.splice(0, WEEK_LENGTH);
|
|
22999
|
-
const tr = createElement('tr'
|
|
23385
|
+
const tr = createElement('tr');
|
|
23000
23386
|
if (this.parent.activeViewOptions.showWeekNumber) {
|
|
23001
23387
|
const weekNumber = this.parent.getWeekNumberContent(weekDates);
|
|
23002
23388
|
const td = createElement('td', {
|
|
23003
23389
|
className: 'e-week-number',
|
|
23004
|
-
attrs: { '
|
|
23390
|
+
attrs: { 'title': this.parent.localeObj.getConstant('week') + ' ' + weekNumber },
|
|
23005
23391
|
innerHTML: weekNumber
|
|
23006
23392
|
});
|
|
23007
23393
|
tr.appendChild(td);
|
|
@@ -23010,13 +23396,23 @@ class Year extends ViewBase {
|
|
|
23010
23396
|
for (const date of weekDates) {
|
|
23011
23397
|
const td = createElement('td', {
|
|
23012
23398
|
className: 'e-cell ' + WORK_CELLS_CLASS,
|
|
23013
|
-
attrs: { '
|
|
23399
|
+
attrs: { 'aria-selected': 'false', 'data-date': date.getTime().toString() }
|
|
23014
23400
|
});
|
|
23015
|
-
|
|
23016
|
-
|
|
23017
|
-
|
|
23018
|
-
}
|
|
23019
|
-
|
|
23401
|
+
if (this.parent.activeViewOptions.cellHeaderTemplate) {
|
|
23402
|
+
const args = { date: date, type: 'monthCells' };
|
|
23403
|
+
this.renderTemplates(this.parent.getCellHeaderTemplate(), args, 'cellHeaderTemplate', this.parent.activeViewOptions.cellHeaderTemplateName, td);
|
|
23404
|
+
}
|
|
23405
|
+
else {
|
|
23406
|
+
const span = createElement('span', {
|
|
23407
|
+
className: 'e-day', innerHTML: this.parent.globalize.formatDate(date, { skeleton: 'd', calendar: this.parent.getCalendarMode() }),
|
|
23408
|
+
attrs: { title: this.parent.globalize.formatDate(date, { type: 'date', skeleton: 'full' }) }
|
|
23409
|
+
});
|
|
23410
|
+
td.appendChild(span);
|
|
23411
|
+
}
|
|
23412
|
+
if (this.parent.activeViewOptions.cellTemplate) {
|
|
23413
|
+
const args = { date: date, type: 'monthCells' };
|
|
23414
|
+
this.renderTemplates(this.parent.getCellTemplate(), args, 'cellTemplate', this.parent.activeViewOptions.cellTemplateName, td);
|
|
23415
|
+
}
|
|
23020
23416
|
let classList$$1 = [];
|
|
23021
23417
|
if (currentDate.getMonth() !== date.getMonth()) {
|
|
23022
23418
|
classList$$1.push(OTHERMONTH_CLASS);
|
|
@@ -23028,7 +23424,10 @@ class Year extends ViewBase {
|
|
|
23028
23424
|
addClass([td], classList$$1);
|
|
23029
23425
|
}
|
|
23030
23426
|
tr.appendChild(td);
|
|
23031
|
-
|
|
23427
|
+
EventHandler.add(td, 'click', this.onCellClick, this);
|
|
23428
|
+
if (!this.parent.isAdaptive) {
|
|
23429
|
+
EventHandler.add(td, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|
|
23430
|
+
}
|
|
23032
23431
|
this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
|
|
23033
23432
|
}
|
|
23034
23433
|
tbody.appendChild(tr);
|
|
@@ -23108,6 +23507,11 @@ class Year extends ViewBase {
|
|
|
23108
23507
|
// eslint-disable-next-line prefer-spread
|
|
23109
23508
|
return Array.apply(null, { length: this.parent.activeViewOptions.monthsCount }).map((value, index) => this.parent.firstMonthOfYear + index);
|
|
23110
23509
|
}
|
|
23510
|
+
renderTemplates(fn, args, tName, vName, ele) {
|
|
23511
|
+
const templateId = this.parent.element.id + '_' + vName + tName;
|
|
23512
|
+
const template = [].slice.call(fn(args, this.parent, tName, templateId, false));
|
|
23513
|
+
append(template, ele);
|
|
23514
|
+
}
|
|
23111
23515
|
onCellClick(e) {
|
|
23112
23516
|
let target = closest(e.target, '.' + WORK_CELLS_CLASS);
|
|
23113
23517
|
const startDate = this.parent.getDateFromElement(target);
|
|
@@ -23130,6 +23534,8 @@ class Year extends ViewBase {
|
|
|
23130
23534
|
target = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
|
|
23131
23535
|
}
|
|
23132
23536
|
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
23537
|
+
const args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellClick' });
|
|
23538
|
+
this.parent.trigger(cellClick, args);
|
|
23133
23539
|
this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
|
|
23134
23540
|
}
|
|
23135
23541
|
}
|
|
@@ -23241,23 +23647,6 @@ class Year extends ViewBase {
|
|
|
23241
23647
|
this.yearEventModule.renderAppointments();
|
|
23242
23648
|
this.parent.notify(eventsLoaded, args);
|
|
23243
23649
|
}
|
|
23244
|
-
wireEvents(element, type) {
|
|
23245
|
-
if (type === 'cell') {
|
|
23246
|
-
if (this.parent.currentView !== 'TimelineYear') {
|
|
23247
|
-
EventHandler.add(element, 'click', this.onCellClick, this);
|
|
23248
|
-
}
|
|
23249
|
-
else {
|
|
23250
|
-
EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
|
|
23251
|
-
EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
|
|
23252
|
-
if (!this.parent.isAdaptive) {
|
|
23253
|
-
EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|
|
23254
|
-
}
|
|
23255
|
-
}
|
|
23256
|
-
}
|
|
23257
|
-
else {
|
|
23258
|
-
EventHandler.add(element, 'scroll', this.onContentScroll, this);
|
|
23259
|
-
}
|
|
23260
|
-
}
|
|
23261
23650
|
scrollToDate(scrollDate) {
|
|
23262
23651
|
const date = +new Date(resetTime(scrollDate));
|
|
23263
23652
|
let element = this.element.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')[data-date="' + date + '"]');
|
|
@@ -23324,7 +23713,6 @@ class AgendaBase extends ViewBase {
|
|
|
23324
23713
|
'tabindex': '0',
|
|
23325
23714
|
'aria-disabled': this.parent.eventBase.getReadonlyAttribute(listData[li]),
|
|
23326
23715
|
'aria-pressed': 'false',
|
|
23327
|
-
'aria-grabbed': 'true',
|
|
23328
23716
|
'aria-label': this.parent.getAnnouncementString(listData[li])
|
|
23329
23717
|
}
|
|
23330
23718
|
});
|
|
@@ -23528,9 +23916,9 @@ class AgendaBase extends ViewBase {
|
|
|
23528
23916
|
}
|
|
23529
23917
|
}
|
|
23530
23918
|
createResourceTableRow(tContent, tBody) {
|
|
23531
|
-
const tr = createElement('tr'
|
|
23919
|
+
const tr = createElement('tr');
|
|
23532
23920
|
let ntr;
|
|
23533
|
-
const td = createElement('td', { attrs: {
|
|
23921
|
+
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
23534
23922
|
let tempData;
|
|
23535
23923
|
let rowSpan = 0;
|
|
23536
23924
|
let level;
|
|
@@ -23625,11 +24013,10 @@ class AgendaBase extends ViewBase {
|
|
|
23625
24013
|
}
|
|
23626
24014
|
createTableRowElement(date, type) {
|
|
23627
24015
|
const daysCount = getDaysCount(this.parent.selectedDate.getTime(), date.getTime());
|
|
23628
|
-
const tr = createElement('tr', { attrs: { '
|
|
24016
|
+
const tr = createElement('tr', { attrs: { 'data-row-index': daysCount.toString() } });
|
|
23629
24017
|
const td = createElement('td', {
|
|
23630
24018
|
attrs: {
|
|
23631
24019
|
'class': (type === 'monthHeader') ? MONTH_HEADER_CLASS : AGENDA_CELLS_CLASS,
|
|
23632
|
-
'role': 'gridcell',
|
|
23633
24020
|
'aria-selected': 'false',
|
|
23634
24021
|
'data-column-index': daysCount.toString(),
|
|
23635
24022
|
'data-date': date.getTime().toString()
|
|
@@ -23677,6 +24064,7 @@ class Agenda extends AgendaBase {
|
|
|
23677
24064
|
const wrap = createElement('div', { className: CONTENT_WRAP_CLASS });
|
|
23678
24065
|
workTd.appendChild(wrap);
|
|
23679
24066
|
const tbl = this.createTableLayout(CONTENT_TABLE_CLASS);
|
|
24067
|
+
this.setAriaAttributes(tbl);
|
|
23680
24068
|
wrap.appendChild(tbl);
|
|
23681
24069
|
const tBody = tbl.querySelector('tbody');
|
|
23682
24070
|
const agendaDate = resetTime(this.parent.selectedDate);
|
|
@@ -24560,8 +24948,8 @@ class TimelineViews extends VerticalView {
|
|
|
24560
24948
|
}
|
|
24561
24949
|
getContentRows() {
|
|
24562
24950
|
const rows = [];
|
|
24563
|
-
const tr = createElement('tr'
|
|
24564
|
-
const td = createElement('td', { attrs: {
|
|
24951
|
+
const tr = createElement('tr');
|
|
24952
|
+
const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
|
|
24565
24953
|
const trCount = this.getRowCount();
|
|
24566
24954
|
for (let i = 0; i < trCount; i++) {
|
|
24567
24955
|
const ntr = tr.cloneNode();
|
|
@@ -24909,6 +25297,7 @@ class TimelineYear extends Year {
|
|
|
24909
25297
|
const content = createElement('div', { className: CONTENT_WRAP_CLASS });
|
|
24910
25298
|
lastTd.appendChild(content);
|
|
24911
25299
|
const contentTable = this.createTableLayout(CONTENT_TABLE_CLASS);
|
|
25300
|
+
this.setAriaAttributes(contentTable);
|
|
24912
25301
|
content.appendChild(contentTable);
|
|
24913
25302
|
const eventWrapper = createElement('div', { className: EVENT_TABLE_CLASS });
|
|
24914
25303
|
content.appendChild(eventWrapper);
|
|
@@ -24942,12 +25331,12 @@ class TimelineYear extends Year {
|
|
|
24942
25331
|
let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[month], 1);
|
|
24943
25332
|
let monthStart = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
24944
25333
|
let monthEnd = this.parent.calendarUtil.getMonthEndDate(new Date(monthDate.getTime()));
|
|
24945
|
-
const tr = createElement('tr'
|
|
25334
|
+
const tr = createElement('tr');
|
|
24946
25335
|
const monthTr = tr.cloneNode();
|
|
24947
25336
|
monthBody.appendChild(monthTr);
|
|
24948
25337
|
const contentTr = tr.cloneNode();
|
|
24949
25338
|
contentBody.appendChild(contentTr);
|
|
24950
|
-
const monthTd = createElement('td', { className: MONTH_HEADER_CLASS
|
|
25339
|
+
const monthTd = createElement('td', { className: MONTH_HEADER_CLASS });
|
|
24951
25340
|
if (this.parent.activeViewOptions.orientation === 'Horizontal') {
|
|
24952
25341
|
if (this.parent.monthHeaderTemplate) {
|
|
24953
25342
|
append(this.renderDayMonthHeaderTemplate(monthStart, month, 'monthHeaderTemplate'), monthTd);
|
|
@@ -24982,7 +25371,7 @@ class TimelineYear extends Year {
|
|
|
24982
25371
|
isDateAvail = column >= monthStart.getDay() && date.getTime() < monthEnd.getTime();
|
|
24983
25372
|
}
|
|
24984
25373
|
const td = createElement('td', {
|
|
24985
|
-
className: WORK_CELLS_CLASS, attrs: { '
|
|
25374
|
+
className: WORK_CELLS_CLASS, attrs: { 'aria-selected': 'false' }
|
|
24986
25375
|
});
|
|
24987
25376
|
contentTr.appendChild(td);
|
|
24988
25377
|
const dateHeader = createElement('div', {
|
|
@@ -25023,7 +25412,7 @@ class TimelineYear extends Year {
|
|
|
25023
25412
|
td.appendChild(dateHeader);
|
|
25024
25413
|
if (isDateAvail) {
|
|
25025
25414
|
td.setAttribute('data-date', date.getTime().toString());
|
|
25026
|
-
this.wireEvents(td
|
|
25415
|
+
this.wireEvents(td);
|
|
25027
25416
|
}
|
|
25028
25417
|
this.renderCellTemplate({ date: date, type: 'workCells' }, td);
|
|
25029
25418
|
this.parent.trigger(renderCell, { elementType: 'workCells', element: td, date: date });
|
|
@@ -25039,7 +25428,7 @@ class TimelineYear extends Year {
|
|
|
25039
25428
|
const tRow = [];
|
|
25040
25429
|
const monthCells = this.getMonths();
|
|
25041
25430
|
for (let row = 0; row < this.parent.resourceBase.renderedResources.length; row++) {
|
|
25042
|
-
const tr = createElement('tr'
|
|
25431
|
+
const tr = createElement('tr');
|
|
25043
25432
|
tRow.push(tr);
|
|
25044
25433
|
let resData;
|
|
25045
25434
|
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
@@ -25062,14 +25451,14 @@ class TimelineYear extends Year {
|
|
|
25062
25451
|
const tdELe = createElement('td', {
|
|
25063
25452
|
className: WORK_CELLS_CLASS,
|
|
25064
25453
|
attrs: {
|
|
25065
|
-
'
|
|
25454
|
+
'aria-selected': 'false',
|
|
25066
25455
|
'data-date': date.getTime().toString()
|
|
25067
25456
|
}
|
|
25068
25457
|
});
|
|
25069
25458
|
addClass([tdELe], classList$$1);
|
|
25070
25459
|
tdELe.setAttribute('data-group-index', groupIndex.toString());
|
|
25071
25460
|
this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, tdELe);
|
|
25072
|
-
this.wireEvents(tdELe
|
|
25461
|
+
this.wireEvents(tdELe);
|
|
25073
25462
|
this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: tdELe, date: date });
|
|
25074
25463
|
tr.appendChild(tdELe);
|
|
25075
25464
|
}
|
|
@@ -25080,7 +25469,7 @@ class TimelineYear extends Year {
|
|
|
25080
25469
|
const months = this.getMonths();
|
|
25081
25470
|
for (let row = 0; row < this.rowCount; row++) {
|
|
25082
25471
|
wrapper.appendChild(createElement('div', { className: APPOINTMENT_CONTAINER_CLASS }));
|
|
25083
|
-
const tr = createElement('tr'
|
|
25472
|
+
const tr = createElement('tr');
|
|
25084
25473
|
contentBody.appendChild(tr);
|
|
25085
25474
|
let resData;
|
|
25086
25475
|
if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
@@ -25093,7 +25482,7 @@ class TimelineYear extends Year {
|
|
|
25093
25482
|
monthBody.appendChild(monthTr);
|
|
25094
25483
|
const monthTd = createElement('td', {
|
|
25095
25484
|
className: MONTH_HEADER_CLASS,
|
|
25096
|
-
attrs: { '
|
|
25485
|
+
attrs: { 'data-date': date.getTime().toString() }
|
|
25097
25486
|
});
|
|
25098
25487
|
if (this.parent.monthHeaderTemplate) {
|
|
25099
25488
|
append(this.renderDayMonthHeaderTemplate(monthDate, row, 'monthHeaderTemplate'), monthTd);
|
|
@@ -25125,14 +25514,14 @@ class TimelineYear extends Year {
|
|
|
25125
25514
|
const td = createElement('td', {
|
|
25126
25515
|
className: WORK_CELLS_CLASS,
|
|
25127
25516
|
attrs: {
|
|
25128
|
-
'
|
|
25517
|
+
'aria-selected': 'false',
|
|
25129
25518
|
'data-date': date.getTime().toString()
|
|
25130
25519
|
}
|
|
25131
25520
|
});
|
|
25132
25521
|
addClass([td], classList$$1);
|
|
25133
25522
|
td.setAttribute('data-group-index', groupIndex.toString());
|
|
25134
25523
|
this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, td);
|
|
25135
|
-
this.wireEvents(td
|
|
25524
|
+
this.wireEvents(td);
|
|
25136
25525
|
tr.appendChild(td);
|
|
25137
25526
|
this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: td, date: date });
|
|
25138
25527
|
}
|
|
@@ -25197,6 +25586,13 @@ class TimelineYear extends Year {
|
|
|
25197
25586
|
return this.getContentAreaElement();
|
|
25198
25587
|
}
|
|
25199
25588
|
}
|
|
25589
|
+
wireEvents(element) {
|
|
25590
|
+
EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
|
|
25591
|
+
EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
|
|
25592
|
+
if (!this.parent.isAdaptive) {
|
|
25593
|
+
EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|
|
25594
|
+
}
|
|
25595
|
+
}
|
|
25200
25596
|
}
|
|
25201
25597
|
|
|
25202
25598
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -25465,7 +25861,7 @@ class ICalendarImport {
|
|
|
25465
25861
|
const appoint = [];
|
|
25466
25862
|
const uId = 'UID';
|
|
25467
25863
|
const fields = this.parent.eventFields;
|
|
25468
|
-
|
|
25864
|
+
const appointmentIds = [];
|
|
25469
25865
|
this.parent.eventsData.forEach((eventObj) => {
|
|
25470
25866
|
appointmentIds.push(eventObj[fields.id]);
|
|
25471
25867
|
});
|
|
@@ -25484,17 +25880,21 @@ class ICalendarImport {
|
|
|
25484
25880
|
// eslint-disable-next-line no-prototype-builtins
|
|
25485
25881
|
if (data[i].hasOwnProperty(fields.recurrenceID)) {
|
|
25486
25882
|
const exdate = data[i][fields.recurrenceID];
|
|
25883
|
+
data[i][fields.id] = this.parent.eventBase.generateGuid();
|
|
25487
25884
|
data[i][fields.recurrenceID] = id;
|
|
25488
25885
|
data[i][fields.recurrenceException] = null;
|
|
25489
25886
|
parentObj[fields.recurrenceException] = (isNullOrUndefined(parentObj[fields.recurrenceException])) ?
|
|
25490
25887
|
exdate : parentObj[fields.recurrenceException] + ',' + exdate;
|
|
25888
|
+
delete data[i][uId];
|
|
25491
25889
|
appoint.push(data[i]);
|
|
25492
25890
|
}
|
|
25493
25891
|
}
|
|
25892
|
+
delete parentObj[uId];
|
|
25494
25893
|
appoint.push(parentObj);
|
|
25495
25894
|
// eslint-disable-next-line no-prototype-builtins
|
|
25496
25895
|
}
|
|
25497
25896
|
else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
|
|
25897
|
+
delete eventObj[uId];
|
|
25498
25898
|
appoint.push(eventObj);
|
|
25499
25899
|
}
|
|
25500
25900
|
}
|
|
@@ -25744,5 +26144,5 @@ class Print {
|
|
|
25744
26144
|
* Export Schedule components
|
|
25745
26145
|
*/
|
|
25746
26146
|
|
|
25747
|
-
export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
|
|
26147
|
+
export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getElementWidthFromClass, getTranslateY, getTranslateX, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
|
|
25748
26148
|
//# sourceMappingURL=ej2-schedule.es2015.js.map
|