@syncfusion/ej2-schedule 28.2.11 → 29.1.34
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/.gitleaksignore +4 -0
- package/README.md +2 -2
- package/dist/ej2-schedule.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +518 -146
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +570 -186
- 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 +24 -26
- package/src/recurrence-editor/recurrence-editor-model.d.ts +14 -0
- package/src/recurrence-editor/recurrence-editor.d.ts +12 -0
- package/src/recurrence-editor/recurrence-editor.js +8 -1
- package/src/schedule/actions/action-base.js +4 -1
- package/src/schedule/actions/crud.d.ts +3 -0
- package/src/schedule/actions/crud.js +129 -63
- package/src/schedule/actions/drag.js +3 -0
- package/src/schedule/actions/resize.js +4 -1
- package/src/schedule/actions/virtual-scroll.js +3 -1
- package/src/schedule/base/constant.d.ts +6 -0
- package/src/schedule/base/constant.js +6 -0
- package/src/schedule/base/interface.d.ts +53 -0
- package/src/schedule/base/schedule-model.d.ts +54 -1
- package/src/schedule/base/schedule.d.ts +68 -2
- package/src/schedule/base/schedule.js +67 -0
- package/src/schedule/base/type.d.ts +2 -1
- package/src/schedule/event-renderer/event-base.d.ts +5 -0
- package/src/schedule/event-renderer/event-base.js +123 -27
- package/src/schedule/event-renderer/inline-edit.d.ts +3 -1
- package/src/schedule/event-renderer/inline-edit.js +18 -6
- package/src/schedule/event-renderer/month.d.ts +1 -0
- package/src/schedule/event-renderer/month.js +25 -0
- package/src/schedule/event-renderer/timeline-view.d.ts +1 -1
- package/src/schedule/event-renderer/timeline-view.js +12 -19
- package/src/schedule/event-renderer/vertical-view.js +2 -2
- package/src/schedule/event-renderer/year.js +1 -1
- package/src/schedule/exports/excel-export.js +9 -2
- package/src/schedule/exports/print.d.ts +2 -0
- package/src/schedule/exports/print.js +90 -52
- package/src/schedule/models/views-model.d.ts +32 -0
- package/src/schedule/models/views.d.ts +30 -0
- package/src/schedule/models/views.js +6 -0
- package/src/schedule/popups/event-tooltip.js +18 -0
- package/src/schedule/popups/event-window.d.ts +1 -0
- package/src/schedule/popups/event-window.js +35 -4
- package/src/schedule/popups/quick-popups.js +11 -4
- package/src/schedule/renderer/month.js +3 -1
- package/styles/bds-lite.css +35 -6
- package/styles/bds.css +37 -21
- package/styles/bootstrap-dark-lite.css +46 -17
- package/styles/bootstrap-dark.css +49 -33
- package/styles/bootstrap-lite.css +42 -13
- package/styles/bootstrap.css +44 -28
- package/styles/bootstrap4-lite.css +55 -26
- package/styles/bootstrap4.css +57 -41
- package/styles/bootstrap5-dark-lite.css +128 -99
- package/styles/bootstrap5-dark.css +131 -115
- package/styles/bootstrap5-lite.css +50 -21
- package/styles/bootstrap5.3-lite.css +35 -6
- package/styles/bootstrap5.3.css +37 -21
- package/styles/bootstrap5.css +52 -36
- package/styles/fabric-dark-lite.css +46 -17
- package/styles/fabric-dark.css +49 -33
- package/styles/fabric-lite.css +56 -27
- package/styles/fabric.css +58 -42
- package/styles/fluent-dark-lite.css +39 -10
- package/styles/fluent-dark.css +40 -24
- package/styles/fluent-lite.css +39 -10
- package/styles/fluent.css +40 -24
- package/styles/fluent2-lite.css +35 -6
- package/styles/fluent2.css +38 -22
- package/styles/highcontrast-light-lite.css +53 -24
- package/styles/highcontrast-light.css +56 -40
- package/styles/highcontrast-lite.css +53 -24
- package/styles/highcontrast.css +56 -40
- package/styles/material-dark-lite.css +34 -5
- package/styles/material-dark.css +35 -19
- package/styles/material-lite.css +34 -5
- package/styles/material.css +35 -19
- package/styles/material3-dark-lite.css +36 -7
- package/styles/material3-dark.css +39 -23
- package/styles/material3-lite.css +36 -7
- package/styles/material3.css +39 -23
- package/styles/recurrence-editor/_layout.scss +6 -1
- package/styles/recurrence-editor/bds.css +5 -1
- package/styles/recurrence-editor/bootstrap-dark.css +5 -1
- package/styles/recurrence-editor/bootstrap.css +5 -1
- package/styles/recurrence-editor/bootstrap4.css +5 -1
- package/styles/recurrence-editor/bootstrap5-dark.css +5 -1
- package/styles/recurrence-editor/bootstrap5.3.css +5 -1
- package/styles/recurrence-editor/bootstrap5.css +5 -1
- package/styles/recurrence-editor/fabric-dark.css +5 -1
- package/styles/recurrence-editor/fabric.css +5 -1
- package/styles/recurrence-editor/fluent-dark.css +5 -1
- package/styles/recurrence-editor/fluent.css +5 -1
- package/styles/recurrence-editor/fluent2.css +5 -1
- package/styles/recurrence-editor/highcontrast-light.css +5 -1
- package/styles/recurrence-editor/highcontrast.css +5 -1
- package/styles/recurrence-editor/material-dark.css +5 -1
- package/styles/recurrence-editor/material.css +5 -1
- package/styles/recurrence-editor/material3-dark.css +5 -1
- package/styles/recurrence-editor/material3.css +5 -1
- package/styles/recurrence-editor/tailwind-dark.css +5 -1
- package/styles/recurrence-editor/tailwind.css +5 -1
- package/styles/recurrence-editor/tailwind3.css +5 -1
- package/styles/schedule/_bds-definition.scss +2 -0
- package/styles/schedule/_bigger.scss +2 -17
- package/styles/schedule/_bootstrap-dark-definition.scss +5 -1
- package/styles/schedule/_bootstrap-definition.scss +5 -1
- package/styles/schedule/_bootstrap4-definition.scss +9 -5
- package/styles/schedule/_bootstrap5-definition.scss +5 -1
- package/styles/schedule/_bootstrap5.3-definition.scss +2 -0
- package/styles/schedule/_fabric-dark-definition.scss +2 -0
- package/styles/schedule/_fabric-definition.scss +5 -1
- package/styles/schedule/_fluent-definition.scss +3 -1
- package/styles/schedule/_fluent2-definition.scss +3 -1
- package/styles/schedule/_fusionnew-definition.scss +2 -0
- package/styles/schedule/_highcontrast-definition.scss +6 -2
- package/styles/schedule/_highcontrast-light-definition.scss +6 -2
- package/styles/schedule/_layout.scss +39 -9
- package/styles/schedule/_material-dark-definition.scss +2 -0
- package/styles/schedule/_material-definition.scss +2 -0
- package/styles/schedule/_material3-definition.scss +4 -2
- package/styles/schedule/_tailwind-definition.scss +2 -0
- package/styles/schedule/_tailwind3-definition.scss +4 -2
- package/styles/schedule/bds.css +32 -20
- package/styles/schedule/bootstrap-dark.css +44 -32
- package/styles/schedule/bootstrap.css +39 -27
- package/styles/schedule/bootstrap4.css +52 -40
- package/styles/schedule/bootstrap5-dark.css +126 -114
- package/styles/schedule/bootstrap5.3.css +32 -20
- package/styles/schedule/bootstrap5.css +47 -35
- package/styles/schedule/fabric-dark.css +44 -32
- package/styles/schedule/fabric.css +53 -41
- package/styles/schedule/fluent-dark.css +35 -23
- package/styles/schedule/fluent.css +35 -23
- package/styles/schedule/fluent2.css +33 -21
- package/styles/schedule/highcontrast-light.css +51 -39
- package/styles/schedule/highcontrast.css +51 -39
- package/styles/schedule/material-dark.css +30 -18
- package/styles/schedule/material.css +30 -18
- package/styles/schedule/material3-dark.css +34 -22
- package/styles/schedule/material3.css +34 -22
- package/styles/schedule/tailwind-dark.css +49 -37
- package/styles/schedule/tailwind.css +32 -20
- package/styles/schedule/tailwind3.css +34 -22
- package/styles/tailwind-dark-lite.css +52 -23
- package/styles/tailwind-dark.css +54 -38
- package/styles/tailwind-lite.css +35 -6
- package/styles/tailwind.css +37 -21
- package/styles/tailwind3-lite.css +36 -7
- package/styles/tailwind3.css +39 -23
|
@@ -76,6 +76,12 @@ const resourceHeader = 'resourceHeader';
|
|
|
76
76
|
const dateHeader = 'dateHeader';
|
|
77
77
|
/** @private */
|
|
78
78
|
const beforePaste = 'beforePaste';
|
|
79
|
+
/** @private */
|
|
80
|
+
const beforePrint = 'beforePrint';
|
|
81
|
+
/** @private */
|
|
82
|
+
const excelExport = 'excelExport';
|
|
83
|
+
/** @private */
|
|
84
|
+
const tooltipOpen = 'tooltipOpen';
|
|
79
85
|
/**
|
|
80
86
|
* Specifies schedule internal events
|
|
81
87
|
*/
|
|
@@ -5781,6 +5787,7 @@ class EventBase {
|
|
|
5781
5787
|
*/
|
|
5782
5788
|
constructor(parent) {
|
|
5783
5789
|
this.slots = [];
|
|
5790
|
+
this.processedData = [];
|
|
5784
5791
|
this.isDoubleTapped = false;
|
|
5785
5792
|
this.parent = parent;
|
|
5786
5793
|
}
|
|
@@ -5844,6 +5851,29 @@ class EventBase {
|
|
|
5844
5851
|
this.parent.eventsProcessed = [];
|
|
5845
5852
|
const eventData = processed.filter((data) => !data[this.parent.eventFields.isBlock]);
|
|
5846
5853
|
this.parent.eventsProcessed = this.filterEvents(start, end, eventData);
|
|
5854
|
+
if (!this.parent.activeViewOptions.allowOverlap && this.parent.eventsProcessed.length > 0) {
|
|
5855
|
+
this.processedData = this.parent.eventsProcessed;
|
|
5856
|
+
const nonOverlapList = [];
|
|
5857
|
+
const fields = this.parent.eventFields;
|
|
5858
|
+
for (const data of this.parent.eventsProcessed) {
|
|
5859
|
+
const overlappingData = this.findOverlappingData(data, nonOverlapList);
|
|
5860
|
+
if (!overlappingData) {
|
|
5861
|
+
nonOverlapList.push(data);
|
|
5862
|
+
}
|
|
5863
|
+
else if (!this.parent.eventSettings.sortComparer) {
|
|
5864
|
+
const dataDuration = new Date(data[fields.endTime]).getTime() - new Date(data[fields.startTime]).getTime();
|
|
5865
|
+
const duplicateDuration = new Date(overlappingData[fields.endTime]).getTime() - new Date(overlappingData[fields.startTime]).getTime();
|
|
5866
|
+
if ((dataDuration > duplicateDuration && data[fields.startTime] === overlappingData[fields.startTime]) || (data[fields.isAllDay] === true)) {
|
|
5867
|
+
const index = nonOverlapList.indexOf(overlappingData);
|
|
5868
|
+
if (index !== -1) {
|
|
5869
|
+
nonOverlapList.splice(index, 1);
|
|
5870
|
+
}
|
|
5871
|
+
nonOverlapList.push(data);
|
|
5872
|
+
}
|
|
5873
|
+
}
|
|
5874
|
+
}
|
|
5875
|
+
this.parent.eventsProcessed = nonOverlapList;
|
|
5876
|
+
}
|
|
5847
5877
|
const blockData = processed.filter((data) => data[this.parent.eventFields.isBlock]);
|
|
5848
5878
|
for (const eventObj of blockData) {
|
|
5849
5879
|
if (eventObj[fields.isAllDay]) {
|
|
@@ -5858,6 +5888,70 @@ class EventBase {
|
|
|
5858
5888
|
this.parent.blockProcessed = blockData;
|
|
5859
5889
|
return eventData;
|
|
5860
5890
|
}
|
|
5891
|
+
findOverlappingData(eventData, eventList) {
|
|
5892
|
+
const isResource = this.parent.activeViewOptions.group.resources.length > 0;
|
|
5893
|
+
const resourceCollection = isResource ? this.parent.resourceBase.resourceCollection : [];
|
|
5894
|
+
const lastLevelResource = isResource ? resourceCollection[resourceCollection.length - 1].field : null;
|
|
5895
|
+
const fields = this.parent.eventFields;
|
|
5896
|
+
const newStartTime = new Date(eventData[fields.startTime]);
|
|
5897
|
+
const newEndTime = new Date(eventData[fields.endTime]);
|
|
5898
|
+
for (const existingEvent of eventList) {
|
|
5899
|
+
if (newStartTime < existingEvent[fields.endTime] &&
|
|
5900
|
+
newEndTime > existingEvent[fields.startTime] &&
|
|
5901
|
+
existingEvent[fields.id] !== eventData[fields.id] &&
|
|
5902
|
+
(!isResource || isNullOrUndefined(lastLevelResource) ||
|
|
5903
|
+
this.compareResourceValues(existingEvent[`${lastLevelResource}`], eventData[`${lastLevelResource}`]))) {
|
|
5904
|
+
return existingEvent;
|
|
5905
|
+
}
|
|
5906
|
+
}
|
|
5907
|
+
return undefined;
|
|
5908
|
+
}
|
|
5909
|
+
isOverlapRange(eventData, currentAction = null) {
|
|
5910
|
+
const isResource = this.parent.activeViewOptions.group.resources.length > 0;
|
|
5911
|
+
const resourceCollection = isResource ? this.parent.resourceBase.resourceCollection : [];
|
|
5912
|
+
const lastLevelResource = isResource ? resourceCollection[resourceCollection.length - 1].field : null;
|
|
5913
|
+
const eventCollection = Array.isArray(eventData) ? eventData : [eventData];
|
|
5914
|
+
const fields = this.parent.eventFields;
|
|
5915
|
+
const processOverlappingEvents = (data) => {
|
|
5916
|
+
return this.processedData.filter((x) => data[fields.startTime] < x[fields.endTime] &&
|
|
5917
|
+
data[fields.endTime] > x[fields.startTime] &&
|
|
5918
|
+
x[fields.id] !== data[fields.id] &&
|
|
5919
|
+
(!isResource || isNullOrUndefined(lastLevelResource) || this.compareResourceValues(x[`${lastLevelResource}`], data[`${lastLevelResource}`])));
|
|
5920
|
+
};
|
|
5921
|
+
const overlappedEvents = [];
|
|
5922
|
+
let isOverlapAlert = false;
|
|
5923
|
+
for (const event of eventCollection) {
|
|
5924
|
+
const dataCol = !isNullOrUndefined(event[fields.recurrenceRule]) &&
|
|
5925
|
+
(isNullOrUndefined(event[fields.recurrenceID]) || event[fields.recurrenceID] === event[fields.id]) &&
|
|
5926
|
+
(isNullOrUndefined(event[fields.recurrenceID]) || currentAction === 'EditSeries')
|
|
5927
|
+
? this.generateOccurrence(event)
|
|
5928
|
+
: [event];
|
|
5929
|
+
for (const data of dataCol) {
|
|
5930
|
+
const overlappingEvents = processOverlappingEvents(data);
|
|
5931
|
+
if (overlappingEvents.length > 0) {
|
|
5932
|
+
overlappedEvents.push(...overlappingEvents);
|
|
5933
|
+
}
|
|
5934
|
+
if (this.findOverlappingData(data, this.parent.eventsProcessed)) {
|
|
5935
|
+
isOverlapAlert = true;
|
|
5936
|
+
}
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5939
|
+
this.parent.overlapAppointments = overlappedEvents;
|
|
5940
|
+
return isOverlapAlert;
|
|
5941
|
+
}
|
|
5942
|
+
compareResourceValues(a, b) {
|
|
5943
|
+
const getValue = (value) => Array.isArray(value) ? value[0] : value;
|
|
5944
|
+
return getValue(a) === getValue(b);
|
|
5945
|
+
}
|
|
5946
|
+
checkOverlap(eventData) {
|
|
5947
|
+
if (!this.parent.activeViewOptions.allowOverlap) {
|
|
5948
|
+
if (this.isOverlapRange(eventData)) {
|
|
5949
|
+
this.parent.quickPopup.openValidationError('overlapAlert', eventData);
|
|
5950
|
+
return true;
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
return false;
|
|
5954
|
+
}
|
|
5861
5955
|
updateEventDateTime(eventData) {
|
|
5862
5956
|
if (typeof eventData[this.parent.eventFields.startTime] === 'string') {
|
|
5863
5957
|
eventData[this.parent.eventFields.startTime] = getDateFromString(eventData[this.parent.eventFields.startTime]);
|
|
@@ -7588,7 +7682,7 @@ class VerticalEvent extends EventBase {
|
|
|
7588
7682
|
const widthAdjustment = record.data.isRight ? 0 :
|
|
7589
7683
|
this.parent.currentView === 'Day' ? 4 : 7;
|
|
7590
7684
|
if (allDayDifference >= 0) {
|
|
7591
|
-
appWidth = (allDayDifference * 100) - widthAdjustment;
|
|
7685
|
+
appWidth = (allDayDifference * 100) - (!this.parent.activeViewOptions.allowOverlap ? 0 : widthAdjustment);
|
|
7592
7686
|
}
|
|
7593
7687
|
if (isNullOrUndefined(this.renderedAllDayEvents[parseInt(resource.toString(), 10)])) {
|
|
7594
7688
|
this.renderedAllDayEvents[parseInt(resource.toString(), 10)] = [];
|
|
@@ -7681,7 +7775,7 @@ class VerticalEvent extends EventBase {
|
|
|
7681
7775
|
appointmentElement = this.createAppointmentElement(eventObj, false, record.isSpanned, resource);
|
|
7682
7776
|
}
|
|
7683
7777
|
setStyleAttribute(appointmentElement, {
|
|
7684
|
-
'width': (this.parent.eventSettings.enableMaxHeight ? '100%' : tempData.appWidth),
|
|
7778
|
+
'width': (this.parent.eventSettings.enableMaxHeight || !this.parent.activeViewOptions.allowOverlap ? '100%' : tempData.appWidth),
|
|
7685
7779
|
'height': appHeight + 'px', 'top': topValue + 'px'
|
|
7686
7780
|
});
|
|
7687
7781
|
const iconHeight = appointmentElement.querySelectorAll('.' + EVENT_INDICATOR_CLASS).length * 15;
|
|
@@ -8462,8 +8556,16 @@ class MonthEvent extends EventBase {
|
|
|
8462
8556
|
setStyleAttribute(appointmentElement, { 'width': appWidth + 'px', 'top': appTop + 'px' });
|
|
8463
8557
|
this.renderEventElement(event, appointmentElement, cellTd);
|
|
8464
8558
|
if (this.parent.rowAutoHeight) {
|
|
8559
|
+
const conWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
8560
|
+
const conWidth = this.parent.getElementWidth(conWrap);
|
|
8561
|
+
const isWithoutScroll = conWrap.offsetHeight === conWrap.clientHeight &&
|
|
8562
|
+
conWrap.offsetWidth === conWrap.clientWidth;
|
|
8465
8563
|
const firstChild = cellTd.parentElement.firstElementChild;
|
|
8466
8564
|
this.updateCellHeight(firstChild, height);
|
|
8565
|
+
if (isWithoutScroll &&
|
|
8566
|
+
(conWrap.offsetWidth > conWrap.clientWidth || conWidth !== this.parent.getElementWidth(conWrap))) {
|
|
8567
|
+
this.adjustAppointments(conWidth);
|
|
8568
|
+
}
|
|
8467
8569
|
}
|
|
8468
8570
|
}
|
|
8469
8571
|
else {
|
|
@@ -8494,6 +8596,22 @@ class MonthEvent extends EventBase {
|
|
|
8494
8596
|
}
|
|
8495
8597
|
}
|
|
8496
8598
|
}
|
|
8599
|
+
adjustAppointments(conWidth) {
|
|
8600
|
+
const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8601
|
+
const actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8602
|
+
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8603
|
+
const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8604
|
+
const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
8605
|
+
apps.forEach((app) => {
|
|
8606
|
+
if (this.parent.enableRtl && app.style.right !== '0px') {
|
|
8607
|
+
app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
|
|
8608
|
+
}
|
|
8609
|
+
else if (app.style.left !== '0px') {
|
|
8610
|
+
app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
|
|
8611
|
+
}
|
|
8612
|
+
app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
|
|
8613
|
+
});
|
|
8614
|
+
}
|
|
8497
8615
|
updateCellHeight(cell, height) {
|
|
8498
8616
|
if ((height > cell.offsetHeight)) {
|
|
8499
8617
|
setStyleAttribute(cell, { 'height': height + 'px' });
|
|
@@ -8973,22 +9091,6 @@ class TimelineEvent extends MonthEvent {
|
|
|
8973
9091
|
}
|
|
8974
9092
|
}
|
|
8975
9093
|
}
|
|
8976
|
-
adjustAppointments(conWidth) {
|
|
8977
|
-
const tr = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS + ' tbody tr');
|
|
8978
|
-
const actualCellWidth = this.parent.getElementWidth(this.workCells[0]);
|
|
8979
|
-
this.cellWidth = actualCellWidth / +(this.workCells[0].getAttribute('colspan') || 1);
|
|
8980
|
-
const currentPercentage = (actualCellWidth * tr.children.length) / (conWidth / 100);
|
|
8981
|
-
const apps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
8982
|
-
apps.forEach((app) => {
|
|
8983
|
-
if (this.parent.enableRtl && app.style.right !== '0px') {
|
|
8984
|
-
app.style.right = ((parseFloat(app.style.right) / 100) * currentPercentage) + 'px';
|
|
8985
|
-
}
|
|
8986
|
-
else if (app.style.left !== '0px') {
|
|
8987
|
-
app.style.left = ((parseFloat(app.style.left) / 100) * currentPercentage) + 'px';
|
|
8988
|
-
}
|
|
8989
|
-
app.style.width = ((parseFloat(app.style.width) / 100) * currentPercentage) + 'px';
|
|
8990
|
-
});
|
|
8991
|
-
}
|
|
8992
9094
|
getFirstChild(index) {
|
|
8993
9095
|
const query = '.' + CONTENT_TABLE_CLASS + ' tbody td';
|
|
8994
9096
|
let groupIndex = '';
|
|
@@ -9103,13 +9205,23 @@ class TimelineEvent extends MonthEvent {
|
|
|
9103
9205
|
endWidth = 0;
|
|
9104
9206
|
}
|
|
9105
9207
|
else {
|
|
9106
|
-
const
|
|
9107
|
-
|
|
9208
|
+
const { startHour, endHour } = getStartEndHours(resetTime(new Date(endDate.getTime())), this.startHour, this.endHour);
|
|
9209
|
+
const interval = this.interval / this.slotCount;
|
|
9210
|
+
const lastSlotEndTime = this.getEndTimeOfLastSlot(startHour, endHour, interval);
|
|
9211
|
+
const adjustedEndDate = endHour < lastSlotEndTime ? endHour : lastSlotEndTime;
|
|
9212
|
+
endWidth = this.getSameDayEventsWidth(endDate, adjustedEndDate);
|
|
9108
9213
|
endWidth = ((this.slotsPerDay * this.cellWidth) === endWidth) ? 0 : endWidth;
|
|
9109
9214
|
}
|
|
9110
9215
|
const spannedWidth = startWidth + endWidth;
|
|
9111
9216
|
return (width > spannedWidth) ? width - spannedWidth : width - startWidth;
|
|
9112
9217
|
}
|
|
9218
|
+
getEndTimeOfLastSlot(startHour, endHour, interval) {
|
|
9219
|
+
const minutesInDay = (endHour.getTime() - startHour.getTime()) / (1000 * 60);
|
|
9220
|
+
const lastSlotEndMinutes = Math.floor(minutesInDay / interval) * interval;
|
|
9221
|
+
const lastSlotEndTime = new Date(startHour);
|
|
9222
|
+
lastSlotEndTime.setMinutes(lastSlotEndMinutes);
|
|
9223
|
+
return lastSlotEndTime;
|
|
9224
|
+
}
|
|
9113
9225
|
isSameDay(startTime, endTime) {
|
|
9114
9226
|
const startDay = this.parent.getIndexOfDate(this.dateRender, resetTime(new Date(startTime.getTime())));
|
|
9115
9227
|
const endDay = this.parent.getIndexOfDate(this.dateRender, resetTime(new Date(endTime.getTime())));
|
|
@@ -9307,7 +9419,8 @@ class InlineEdit {
|
|
|
9307
9419
|
else {
|
|
9308
9420
|
subject = args.data[this.parent.eventFields.subject];
|
|
9309
9421
|
}
|
|
9310
|
-
inlineSubject =
|
|
9422
|
+
inlineSubject = this.inlineInputEle =
|
|
9423
|
+
createElement('input', { className: INLINE_SUBJECT_CLASS, attrs: { value: subject } });
|
|
9311
9424
|
if (closest(args.element, '.' + MORE_POPUP_WRAPPER_CLASS)) {
|
|
9312
9425
|
args.element.insertBefore(inlineSubject, subEle);
|
|
9313
9426
|
}
|
|
@@ -9424,8 +9537,7 @@ class InlineEdit {
|
|
|
9424
9537
|
}
|
|
9425
9538
|
return saveObj;
|
|
9426
9539
|
}
|
|
9427
|
-
documentClick() {
|
|
9428
|
-
const target = this.parent.element.querySelector('.' + INLINE_SUBJECT_CLASS);
|
|
9540
|
+
documentClick(target) {
|
|
9429
9541
|
if (target && target.value !== '') {
|
|
9430
9542
|
this.inlineCrudActions(target);
|
|
9431
9543
|
}
|
|
@@ -9457,7 +9569,8 @@ class InlineEdit {
|
|
|
9457
9569
|
});
|
|
9458
9570
|
const inlineDetails = createElement('div', { className: APPOINTMENT_DETAILS });
|
|
9459
9571
|
inlineAppointmentElement.appendChild(inlineDetails);
|
|
9460
|
-
const inline =
|
|
9572
|
+
const inline = this.inlineInputEle =
|
|
9573
|
+
createElement('input', { className: INLINE_SUBJECT_CLASS });
|
|
9461
9574
|
inlineDetails.appendChild(inline);
|
|
9462
9575
|
if (inlineData) {
|
|
9463
9576
|
this.parent.eventBase.applyResourceColor(inlineAppointmentElement, inlineData, 'backgroundColor');
|
|
@@ -9467,9 +9580,15 @@ class InlineEdit {
|
|
|
9467
9580
|
removeInlineAppointmentElement() {
|
|
9468
9581
|
const inlineAppointment = [].slice.call(this.parent.element.querySelectorAll('.' + INLINE_APPOINTMENT_CLASS));
|
|
9469
9582
|
if (inlineAppointment.length > 0) {
|
|
9470
|
-
inlineAppointment.forEach((node) =>
|
|
9583
|
+
inlineAppointment.forEach((node) => {
|
|
9584
|
+
const inlineSubject = node.querySelector('.' + INLINE_SUBJECT_CLASS);
|
|
9585
|
+
if (!isNullOrUndefined(inlineSubject)) {
|
|
9586
|
+
inlineSubject.blur();
|
|
9587
|
+
}
|
|
9588
|
+
remove(node);
|
|
9589
|
+
});
|
|
9471
9590
|
}
|
|
9472
|
-
const inlineSubject = this.
|
|
9591
|
+
const inlineSubject = this.getInlineElement();
|
|
9473
9592
|
if (inlineSubject) {
|
|
9474
9593
|
const appointmentSubject = closest(inlineSubject, '.' + APPOINTMENT_CLASS);
|
|
9475
9594
|
const subject = appointmentSubject.querySelector('.' + SUBJECT_CLASS);
|
|
@@ -9478,8 +9597,13 @@ class InlineEdit {
|
|
|
9478
9597
|
}
|
|
9479
9598
|
remove(inlineSubject);
|
|
9480
9599
|
}
|
|
9600
|
+
this.inlineInputEle = null;
|
|
9601
|
+
}
|
|
9602
|
+
getInlineElement() {
|
|
9603
|
+
return this.inlineInputEle;
|
|
9481
9604
|
}
|
|
9482
9605
|
destroy() {
|
|
9606
|
+
this.inlineInputEle = null;
|
|
9483
9607
|
this.parent.off(inlineClick, this.inlineEdit);
|
|
9484
9608
|
}
|
|
9485
9609
|
}
|
|
@@ -9855,7 +9979,7 @@ class QuickPopups {
|
|
|
9855
9979
|
okButton.setAttribute('aria-label', cancelButton.innerHTML);
|
|
9856
9980
|
}
|
|
9857
9981
|
this.quickDialogClass('Alert');
|
|
9858
|
-
this.showQuickDialog('ValidationAlert', eventData);
|
|
9982
|
+
this.showQuickDialog(type === 'overlapAlert' ? 'OverlapAlert' : 'ValidationAlert', eventData);
|
|
9859
9983
|
}
|
|
9860
9984
|
showQuickDialog(popupType, eventData) {
|
|
9861
9985
|
this.quickDialog.dataBind();
|
|
@@ -9863,6 +9987,9 @@ class QuickPopups {
|
|
|
9863
9987
|
type: popupType, cancel: false, element: this.quickDialog.element,
|
|
9864
9988
|
data: extend({}, (eventData || this.parent.activeEventData.event), null, true)
|
|
9865
9989
|
};
|
|
9990
|
+
if (!this.parent.activeViewOptions.allowOverlap) {
|
|
9991
|
+
eventProp.overlapEvents = this.parent.overlapAppointments;
|
|
9992
|
+
}
|
|
9866
9993
|
this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
|
|
9867
9994
|
if (!popupArgs.cancel) {
|
|
9868
9995
|
this.quickDialog.show();
|
|
@@ -10864,16 +10991,20 @@ class QuickPopups {
|
|
|
10864
10991
|
}
|
|
10865
10992
|
documentClick(e) {
|
|
10866
10993
|
const target = e.event.target;
|
|
10867
|
-
const
|
|
10994
|
+
const isInsideDialog = !!closest(target, '.e-dialog');
|
|
10995
|
+
let classNames = '.' + POPUP_WRAPPER_CLASS + ',.' + HEADER_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS +
|
|
10868
10996
|
',.' + WORK_CELLS_CLASS + ',.' + APPOINTMENT_CLASS;
|
|
10997
|
+
if (!isInsideDialog) {
|
|
10998
|
+
classNames += ',.e-popup';
|
|
10999
|
+
}
|
|
10869
11000
|
const popupWrap = this.parent.element.querySelector('.' + POPUP_WRAPPER_CLASS);
|
|
10870
11001
|
if ((popupWrap && popupWrap.childElementCount > 0 && !closest(target, classNames)) || !closest(target, classNames)) {
|
|
10871
11002
|
this.quickPopupHide();
|
|
10872
11003
|
this.parent.removeNewEventElement();
|
|
10873
11004
|
}
|
|
10874
|
-
const tar = this.parent.
|
|
10875
|
-
if (tar && tar !== target
|
|
10876
|
-
this.parent.inlineModule.documentClick();
|
|
11005
|
+
const tar = this.parent.allowInline ? this.parent.inlineModule.getInlineElement() : null;
|
|
11006
|
+
if (tar && tar !== target) {
|
|
11007
|
+
this.parent.inlineModule.documentClick(tar);
|
|
10877
11008
|
}
|
|
10878
11009
|
if (closest(target, '.' + APPOINTMENT_CLASS + ',.' + HEADER_CELLS_CLASS)) {
|
|
10879
11010
|
this.parent.removeNewEventElement();
|
|
@@ -11123,6 +11254,23 @@ class EventTooltip {
|
|
|
11123
11254
|
if (args.element && this.parent.isReact && !isNullOrUndefined(this.parent.eventSettings.tooltipTemplate)) {
|
|
11124
11255
|
addClass([args.element], TOOLTIP_HIDDEN_CLASS);
|
|
11125
11256
|
}
|
|
11257
|
+
const record = this.parent.eventBase.getEventByGuid(args.target.getAttribute('data-guid'));
|
|
11258
|
+
if (isNullOrUndefined(record)) {
|
|
11259
|
+
return;
|
|
11260
|
+
}
|
|
11261
|
+
const callbackArgs = {
|
|
11262
|
+
cancel: false,
|
|
11263
|
+
data: record,
|
|
11264
|
+
content: args.element,
|
|
11265
|
+
target: args.target
|
|
11266
|
+
};
|
|
11267
|
+
this.parent.trigger(tooltipOpen, callbackArgs, (callbackArgs) => {
|
|
11268
|
+
if (callbackArgs.cancel) {
|
|
11269
|
+
args.cancel = true;
|
|
11270
|
+
return;
|
|
11271
|
+
}
|
|
11272
|
+
args.element = callbackArgs.content;
|
|
11273
|
+
});
|
|
11126
11274
|
}
|
|
11127
11275
|
onTooltipClose(args) {
|
|
11128
11276
|
if (args.element) {
|
|
@@ -11169,6 +11317,7 @@ const MONETHEXPANDERWRAPPER = 'e-month-expander';
|
|
|
11169
11317
|
const MONETHEXPANDWRAPPER = 'e-month-expand-wrapper';
|
|
11170
11318
|
const MONTHEXPANDERELEMENT = 'e-month-expander-element';
|
|
11171
11319
|
const MONTHEXPANDERCHECKBOXWRAPPER = 'e-month-expander-checkbox-wrapper';
|
|
11320
|
+
const REPEATONWEEKSELECTOR = 'e-repeat-on-week-selector';
|
|
11172
11321
|
const FORMLEFT = 'e-form-left';
|
|
11173
11322
|
const FORMRIGHT = 'e-form-right';
|
|
11174
11323
|
const MONTHDAYWRAPPER = 'e-month-day';
|
|
@@ -11862,7 +12011,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
|
|
|
11862
12011
|
this.localeObj.getConstant('on') + '" />' +
|
|
11863
12012
|
'</div></td></tr>' +
|
|
11864
12013
|
'<tr><td>' +
|
|
11865
|
-
'<div class="' + INPUTWARAPPER + ' ' + MONTHEXPANDERCHECKBOXWRAPPER + '
|
|
12014
|
+
'<div class="' + INPUTWARAPPER + ' ' + MONTHEXPANDERCHECKBOXWRAPPER + ' ' + REPEATONWEEKSELECTOR + '">' +
|
|
11866
12015
|
'<input class="' + MONTHEXPANNDERELEM + '"title="' + this.localeObj.getConstant('monthExpander') + '" type="radio">' +
|
|
11867
12016
|
'</div></td>' +
|
|
11868
12017
|
'<td><div class="' + INPUTWARAPPER + ' ' + WEEKPOSITION + '" >' +
|
|
@@ -12259,6 +12408,12 @@ __decorate([
|
|
|
12259
12408
|
__decorate([
|
|
12260
12409
|
Event()
|
|
12261
12410
|
], RecurrenceEditor.prototype, "change", void 0);
|
|
12411
|
+
__decorate([
|
|
12412
|
+
Event()
|
|
12413
|
+
], RecurrenceEditor.prototype, "created", void 0);
|
|
12414
|
+
__decorate([
|
|
12415
|
+
Event()
|
|
12416
|
+
], RecurrenceEditor.prototype, "destroyed", void 0);
|
|
12262
12417
|
RecurrenceEditor = __decorate([
|
|
12263
12418
|
NotifyPropertyChanges
|
|
12264
12419
|
], RecurrenceEditor);
|
|
@@ -12534,6 +12689,7 @@ class EventWindow {
|
|
|
12534
12689
|
const callBackPromise = new Deferred();
|
|
12535
12690
|
this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
|
|
12536
12691
|
args.cancel = popupArgs.cancel;
|
|
12692
|
+
args.maxHeight = this.parent.isAdaptive ? 'max-content' : args.maxHeight;
|
|
12537
12693
|
this.duration = this.cellClickAction ? popupArgs.duration : null;
|
|
12538
12694
|
if (this.eventData[this.fields.endTime].getTime() === endTime && !this.cellClickAction &&
|
|
12539
12695
|
this.eventData[this.fields.endTime].getHours() === 0 &&
|
|
@@ -12683,7 +12839,8 @@ class EventWindow {
|
|
|
12683
12839
|
const description = this.createDivElement(DESCRIPTION_CLASS + '-row');
|
|
12684
12840
|
description.appendChild(this.renderTextBox(DESCRIPTION_CLASS));
|
|
12685
12841
|
parentDiv.appendChild(description);
|
|
12686
|
-
const submit = createElement('button', { attrs: { type: 'hidden', title: 'submit'
|
|
12842
|
+
const submit = createElement('button', { attrs: { type: 'hidden', title: 'submit' } });
|
|
12843
|
+
submit.style.display = 'none';
|
|
12687
12844
|
parentDiv.appendChild(submit);
|
|
12688
12845
|
return parentDiv;
|
|
12689
12846
|
}
|
|
@@ -12775,7 +12932,9 @@ class EventWindow {
|
|
|
12775
12932
|
const resourceInput = this.createInputElement(value + ' ' + EVENT_FIELD$1, fieldName);
|
|
12776
12933
|
resourceDiv.appendChild(resourceInput);
|
|
12777
12934
|
const resourceTemplate = function (data) {
|
|
12778
|
-
return SanitizeHtmlHelper.sanitize(`<div class="e-resource-template"
|
|
12935
|
+
return SanitizeHtmlHelper.sanitize(`<div class="e-resource-template">
|
|
12936
|
+
<div class="e-resource-color" data-resource-color="${data[resourceData.colorField]}"></div>
|
|
12937
|
+
<div class="e-resource-text">${data[resourceData.textField]}</div></div>`);
|
|
12779
12938
|
};
|
|
12780
12939
|
initializeCSPTemplate(resourceTemplate, resourceData);
|
|
12781
12940
|
if (resourceData.allowMultiple) {
|
|
@@ -12795,7 +12954,12 @@ class EventWindow {
|
|
|
12795
12954
|
placeholder: labelValue,
|
|
12796
12955
|
popupHeight: '230px',
|
|
12797
12956
|
popupWidth: '447px',
|
|
12798
|
-
mode: 'Box'
|
|
12957
|
+
mode: 'Box',
|
|
12958
|
+
open: (args) => {
|
|
12959
|
+
Promise.resolve().then(() => {
|
|
12960
|
+
this.applyStylesAfterRender(args);
|
|
12961
|
+
});
|
|
12962
|
+
}
|
|
12799
12963
|
});
|
|
12800
12964
|
listObj.appendTo(resourceInput);
|
|
12801
12965
|
}
|
|
@@ -12814,12 +12978,29 @@ class EventWindow {
|
|
|
12814
12978
|
placeholder: labelValue,
|
|
12815
12979
|
popupHeight: '230px',
|
|
12816
12980
|
popupWidth: '447px',
|
|
12817
|
-
itemTemplate: resourceTemplate
|
|
12981
|
+
itemTemplate: resourceTemplate,
|
|
12982
|
+
open: (args) => {
|
|
12983
|
+
Promise.resolve().then(() => {
|
|
12984
|
+
this.applyStylesAfterRender(args);
|
|
12985
|
+
});
|
|
12986
|
+
}
|
|
12818
12987
|
});
|
|
12819
12988
|
dropDownList.appendTo(resourceInput);
|
|
12820
12989
|
}
|
|
12821
12990
|
return resourceDiv;
|
|
12822
12991
|
}
|
|
12992
|
+
applyStylesAfterRender(args) {
|
|
12993
|
+
if (!args.popup || !args.popup.element) {
|
|
12994
|
+
return;
|
|
12995
|
+
}
|
|
12996
|
+
const resourceColors = args.popup.element.querySelectorAll('.e-resource-color[data-resource-color]');
|
|
12997
|
+
resourceColors.forEach((element) => {
|
|
12998
|
+
const color = element.getAttribute('data-resource-color');
|
|
12999
|
+
if (color) {
|
|
13000
|
+
element.style.backgroundColor = color;
|
|
13001
|
+
}
|
|
13002
|
+
});
|
|
13003
|
+
}
|
|
12823
13004
|
renderDropDown(value) {
|
|
12824
13005
|
const fieldName = this.getFieldName(value);
|
|
12825
13006
|
const timezoneDiv = this.createDivElement(value + '-container');
|
|
@@ -13619,6 +13800,9 @@ class EventWindow {
|
|
|
13619
13800
|
if (eventObj[this.fields.isReadonly]) {
|
|
13620
13801
|
return false;
|
|
13621
13802
|
}
|
|
13803
|
+
if (this.parent.eventBase.checkOverlap(eventObj)) {
|
|
13804
|
+
return true;
|
|
13805
|
+
}
|
|
13622
13806
|
let currentAction;
|
|
13623
13807
|
if (!isNullOrUndefined(editedData[this.fields.recurrenceRule])) {
|
|
13624
13808
|
currentAction = this.parent.currentAction;
|
|
@@ -13653,6 +13837,9 @@ class EventWindow {
|
|
|
13653
13837
|
}
|
|
13654
13838
|
else {
|
|
13655
13839
|
this.parent.currentAction = 'Add';
|
|
13840
|
+
if (this.parent.eventBase.checkOverlap(eventObj)) {
|
|
13841
|
+
return true;
|
|
13842
|
+
}
|
|
13656
13843
|
if (isResourceEventExpand) {
|
|
13657
13844
|
this.resourceSaveEvent(eventObj, this.parent.currentAction);
|
|
13658
13845
|
}
|
|
@@ -14237,13 +14424,13 @@ class VirtualScroll {
|
|
|
14237
14424
|
constructor(parent) {
|
|
14238
14425
|
this.translateY = 0;
|
|
14239
14426
|
this.itemSize = 60;
|
|
14240
|
-
this.bufferCount = 3;
|
|
14241
14427
|
this.renderedLength = 0;
|
|
14242
14428
|
this.averageRowHeight = 0;
|
|
14243
14429
|
this.startIndex = 0;
|
|
14244
14430
|
this.existingDataCollection = [];
|
|
14245
14431
|
this.enableTransition = true;
|
|
14246
14432
|
this.parent = parent;
|
|
14433
|
+
this.bufferCount = parent.activeViewOptions.overscanCount < 3 ? 3 : parent.activeViewOptions.overscanCount;
|
|
14247
14434
|
this.addEventListener();
|
|
14248
14435
|
}
|
|
14249
14436
|
addEventListener() {
|
|
@@ -14517,6 +14704,7 @@ class VirtualScroll {
|
|
|
14517
14704
|
}
|
|
14518
14705
|
getCollection(startIndex, endIndex) {
|
|
14519
14706
|
this.translateY = startIndex * this.itemSize;
|
|
14707
|
+
startIndex = (startIndex < 0) ? 0 : startIndex;
|
|
14520
14708
|
const lastLevel = this.getResCollection(startIndex, endIndex);
|
|
14521
14709
|
if (this.parent.enableRtl) {
|
|
14522
14710
|
this.translateY = -this.translateY;
|
|
@@ -14525,6 +14713,7 @@ class VirtualScroll {
|
|
|
14525
14713
|
}
|
|
14526
14714
|
getResCollection(startIndex, endIndex) {
|
|
14527
14715
|
const lastLevel = this.parent.activeView.colLevels[this.parent.activeView.colLevels.length - 1];
|
|
14716
|
+
endIndex = endIndex > lastLevel.length ? lastLevel.length - 1 : endIndex;
|
|
14528
14717
|
let resCollection = [];
|
|
14529
14718
|
const index = { startIndex: 0, endIndex: 0 };
|
|
14530
14719
|
if (this.parent.activeViewOptions.group.byDate) {
|
|
@@ -15170,12 +15359,81 @@ class Crud {
|
|
|
15170
15359
|
});
|
|
15171
15360
|
}
|
|
15172
15361
|
}
|
|
15362
|
+
processAddEvent(addArgs) {
|
|
15363
|
+
const fields = this.parent.eventFields;
|
|
15364
|
+
const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
|
|
15365
|
+
let promise;
|
|
15366
|
+
if (addArgs.addedRecords instanceof Array) {
|
|
15367
|
+
for (let event of addArgs.addedRecords) {
|
|
15368
|
+
event = this.parent.eventBase.updateEventDateTime(event);
|
|
15369
|
+
const eventData = extend({}, this.parent.eventBase.processTimezone(event, true), null, true);
|
|
15370
|
+
editParams.addedRecords.push(eventData);
|
|
15371
|
+
}
|
|
15372
|
+
promise = this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, this.getTable(), this.getQuery());
|
|
15373
|
+
}
|
|
15374
|
+
else {
|
|
15375
|
+
const event = this.parent.eventBase.processTimezone(addArgs.addedRecords, true);
|
|
15376
|
+
editParams.addedRecords.push(event);
|
|
15377
|
+
promise = this.parent.dataModule.dataManager.insert(event, this.getTable(), this.getQuery());
|
|
15378
|
+
}
|
|
15379
|
+
const crudArgs = {
|
|
15380
|
+
requestType: 'eventCreated', cancel: false, data: addArgs.addedRecords, promise: promise, editParams: editParams
|
|
15381
|
+
};
|
|
15382
|
+
this.refreshData(crudArgs);
|
|
15383
|
+
}
|
|
15384
|
+
processSaveEvent(saveArgs) {
|
|
15385
|
+
let promise;
|
|
15386
|
+
const fields = this.parent.eventFields;
|
|
15387
|
+
const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
|
|
15388
|
+
if (saveArgs.changedRecords instanceof Array) {
|
|
15389
|
+
for (let event of saveArgs.changedRecords) {
|
|
15390
|
+
event = this.parent.eventBase.updateEventDateTime(event);
|
|
15391
|
+
const eventData = extend({}, this.parent.eventBase.processTimezone(event, true), null, true);
|
|
15392
|
+
editParams.changedRecords.push(eventData);
|
|
15393
|
+
}
|
|
15394
|
+
promise = this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, this.getTable(), this.getQuery());
|
|
15395
|
+
}
|
|
15396
|
+
else {
|
|
15397
|
+
const event = this.parent.eventBase.processTimezone(saveArgs.changedRecords, true);
|
|
15398
|
+
editParams.changedRecords.push(event);
|
|
15399
|
+
promise = this.parent.dataModule.dataManager.update(fields.id, event, this.getTable(), this.getQuery());
|
|
15400
|
+
}
|
|
15401
|
+
const cloneEvent = extend({}, saveArgs.changedRecords[saveArgs.changedRecords.length - 1], null, true);
|
|
15402
|
+
this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(cloneEvent)]);
|
|
15403
|
+
const crudArgs = {
|
|
15404
|
+
requestType: 'eventChanged', cancel: false,
|
|
15405
|
+
data: saveArgs.changedRecords, promise: promise, editParams: editParams
|
|
15406
|
+
};
|
|
15407
|
+
this.refreshData(crudArgs);
|
|
15408
|
+
}
|
|
15409
|
+
processDeleteEvent(deleteArgs) {
|
|
15410
|
+
let promise;
|
|
15411
|
+
const fields = this.parent.eventFields;
|
|
15412
|
+
const editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
|
|
15413
|
+
if (deleteArgs.deletedRecords.length > 1) {
|
|
15414
|
+
editParams.deletedRecords = editParams.deletedRecords.concat(deleteArgs.deletedRecords);
|
|
15415
|
+
promise = this.parent.dataModule.dataManager.saveChanges(editParams, fields.id, this.getTable(), this.getQuery());
|
|
15416
|
+
}
|
|
15417
|
+
else {
|
|
15418
|
+
editParams.deletedRecords.push(deleteArgs.deletedRecords[0]);
|
|
15419
|
+
promise = this.parent.dataModule.dataManager.remove(fields.id, deleteArgs.deletedRecords[0], this.getTable(), this.getQuery());
|
|
15420
|
+
}
|
|
15421
|
+
this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);
|
|
15422
|
+
const crudArgs = {
|
|
15423
|
+
requestType: 'eventRemoved', cancel: false,
|
|
15424
|
+
data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
|
|
15425
|
+
};
|
|
15426
|
+
this.refreshData(crudArgs);
|
|
15427
|
+
}
|
|
15173
15428
|
addEvent(eventData) {
|
|
15174
15429
|
if (this.parent.eventSettings.allowAdding && !this.parent.activeViewOptions.readonly) {
|
|
15175
15430
|
if (!this.isBlockEvent(eventData) && this.parent.eventBase.isBlockRange(eventData)) {
|
|
15176
15431
|
this.parent.quickPopup.openValidationError('blockAlert', eventData);
|
|
15177
15432
|
return;
|
|
15178
15433
|
}
|
|
15434
|
+
if (this.parent.eventBase.checkOverlap(eventData)) {
|
|
15435
|
+
return;
|
|
15436
|
+
}
|
|
15179
15437
|
const addEvents = (eventData instanceof Array) ? eventData : [eventData];
|
|
15180
15438
|
if (addEvents.length === 0) {
|
|
15181
15439
|
return;
|
|
@@ -15186,26 +15444,24 @@ class Crud {
|
|
|
15186
15444
|
};
|
|
15187
15445
|
this.parent.trigger(actionBegin, args, (addArgs) => {
|
|
15188
15446
|
if (!addArgs.cancel) {
|
|
15189
|
-
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
}
|
|
15198
|
-
|
|
15447
|
+
if (addArgs.promise) {
|
|
15448
|
+
addArgs.promise.then((hasContinue) => {
|
|
15449
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15450
|
+
return;
|
|
15451
|
+
}
|
|
15452
|
+
if (hasContinue) {
|
|
15453
|
+
this.processAddEvent(addArgs);
|
|
15454
|
+
}
|
|
15455
|
+
}).catch((e) => {
|
|
15456
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15457
|
+
return;
|
|
15458
|
+
}
|
|
15459
|
+
this.parent.trigger(actionFailure, { error: e });
|
|
15460
|
+
});
|
|
15199
15461
|
}
|
|
15200
15462
|
else {
|
|
15201
|
-
|
|
15202
|
-
editParams.addedRecords.push(event);
|
|
15203
|
-
promise = this.parent.dataModule.dataManager.insert(event, this.getTable(), this.getQuery());
|
|
15463
|
+
this.processAddEvent(addArgs);
|
|
15204
15464
|
}
|
|
15205
|
-
const crudArgs = {
|
|
15206
|
-
requestType: 'eventCreated', cancel: false, data: addArgs.addedRecords, promise: promise, editParams: editParams
|
|
15207
|
-
};
|
|
15208
|
-
this.refreshData(crudArgs);
|
|
15209
15465
|
}
|
|
15210
15466
|
});
|
|
15211
15467
|
}
|
|
@@ -15240,35 +15496,33 @@ class Crud {
|
|
|
15240
15496
|
}
|
|
15241
15497
|
}
|
|
15242
15498
|
else {
|
|
15499
|
+
if (this.parent.eventBase.checkOverlap(eventData)) {
|
|
15500
|
+
return;
|
|
15501
|
+
}
|
|
15243
15502
|
const args = {
|
|
15244
15503
|
requestType: 'eventChange', cancel: false, data: eventData,
|
|
15245
15504
|
addedRecords: [], changedRecords: updateEvents, deletedRecords: []
|
|
15246
15505
|
};
|
|
15247
15506
|
this.parent.trigger(actionBegin, args, (saveArgs) => {
|
|
15248
15507
|
if (!saveArgs.cancel) {
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
}
|
|
15258
|
-
|
|
15508
|
+
if (saveArgs.promise) {
|
|
15509
|
+
saveArgs.promise.then((hasContinue) => {
|
|
15510
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15511
|
+
return;
|
|
15512
|
+
}
|
|
15513
|
+
if (hasContinue) {
|
|
15514
|
+
this.processSaveEvent(saveArgs);
|
|
15515
|
+
}
|
|
15516
|
+
}).catch((e) => {
|
|
15517
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15518
|
+
return;
|
|
15519
|
+
}
|
|
15520
|
+
this.parent.trigger(actionFailure, { error: e });
|
|
15521
|
+
});
|
|
15259
15522
|
}
|
|
15260
15523
|
else {
|
|
15261
|
-
|
|
15262
|
-
editParams.changedRecords.push(event);
|
|
15263
|
-
promise = this.parent.dataModule.dataManager.update(fields.id, event, this.getTable(), this.getQuery());
|
|
15524
|
+
this.processSaveEvent(saveArgs);
|
|
15264
15525
|
}
|
|
15265
|
-
const cloneEvent = extend({}, saveArgs.changedRecords[saveArgs.changedRecords.length - 1], null, true);
|
|
15266
|
-
this.parent.eventBase.selectWorkCellByTime([this.parent.eventBase.processTimezone(cloneEvent)]);
|
|
15267
|
-
const crudArgs = {
|
|
15268
|
-
requestType: 'eventChanged', cancel: false,
|
|
15269
|
-
data: saveArgs.changedRecords, promise: promise, editParams: editParams
|
|
15270
|
-
};
|
|
15271
|
-
this.refreshData(crudArgs);
|
|
15272
15526
|
}
|
|
15273
15527
|
});
|
|
15274
15528
|
}
|
|
@@ -15310,23 +15564,24 @@ class Crud {
|
|
|
15310
15564
|
};
|
|
15311
15565
|
this.parent.trigger(actionBegin, args, (deleteArgs) => {
|
|
15312
15566
|
if (!deleteArgs.cancel) {
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15567
|
+
if (deleteArgs.promise) {
|
|
15568
|
+
deleteArgs.promise.then((hasContinue) => {
|
|
15569
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15570
|
+
return;
|
|
15571
|
+
}
|
|
15572
|
+
if (hasContinue) {
|
|
15573
|
+
this.processDeleteEvent(deleteArgs);
|
|
15574
|
+
}
|
|
15575
|
+
}).catch((e) => {
|
|
15576
|
+
if (!this.parent || this.parent && this.parent.isDestroyed) {
|
|
15577
|
+
return;
|
|
15578
|
+
}
|
|
15579
|
+
this.parent.trigger(actionFailure, { error: e });
|
|
15580
|
+
});
|
|
15319
15581
|
}
|
|
15320
15582
|
else {
|
|
15321
|
-
|
|
15322
|
-
promise = this.parent.dataModule.dataManager.remove(fields.id, deleteArgs.deletedRecords[0], this.getTable(), this.getQuery());
|
|
15583
|
+
this.processDeleteEvent(deleteArgs);
|
|
15323
15584
|
}
|
|
15324
|
-
this.parent.eventBase.selectWorkCellByTime(deleteArgs.deletedRecords);
|
|
15325
|
-
const crudArgs = {
|
|
15326
|
-
requestType: 'eventRemoved', cancel: false,
|
|
15327
|
-
data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
|
|
15328
|
-
};
|
|
15329
|
-
this.refreshData(crudArgs);
|
|
15330
15585
|
}
|
|
15331
15586
|
});
|
|
15332
15587
|
}
|
|
@@ -17558,6 +17813,8 @@ let Schedule = class Schedule extends Component {
|
|
|
17558
17813
|
readonly: this.readonly,
|
|
17559
17814
|
startHour: this.startHour,
|
|
17560
17815
|
allowVirtualScrolling: false,
|
|
17816
|
+
allowOverlap: this.allowOverlap,
|
|
17817
|
+
overscanCount: this.overscanCount,
|
|
17561
17818
|
cellHeaderTemplate: this.cellHeaderTemplate,
|
|
17562
17819
|
dayHeaderTemplate: this.dayHeaderTemplate,
|
|
17563
17820
|
monthHeaderTemplate: this.monthHeaderTemplate,
|
|
@@ -18011,6 +18268,7 @@ let Schedule = class Schedule extends Component {
|
|
|
18011
18268
|
startEndError: 'The selected end date occurs before the start date.',
|
|
18012
18269
|
invalidDateError: 'The entered date value is invalid.',
|
|
18013
18270
|
blockAlert: 'Events cannot be scheduled within the blocked time range.',
|
|
18271
|
+
overlapAlert: 'Events cannot be scheduled during the chosen time as it overlaps with another event.',
|
|
18014
18272
|
ok: 'Ok',
|
|
18015
18273
|
yes: 'Yes',
|
|
18016
18274
|
no: 'No',
|
|
@@ -18908,6 +19166,7 @@ let Schedule = class Schedule extends Component {
|
|
|
18908
19166
|
case 'allowDragAndDrop':
|
|
18909
19167
|
case 'allowResizing':
|
|
18910
19168
|
case 'eventDragArea':
|
|
19169
|
+
case 'allowOverlap':
|
|
18911
19170
|
this.refreshEvents(false);
|
|
18912
19171
|
break;
|
|
18913
19172
|
case 'weekRule':
|
|
@@ -19947,6 +20206,52 @@ let Schedule = class Schedule extends Component {
|
|
|
19947
20206
|
this.quickPopup.quickPopupHide(true);
|
|
19948
20207
|
}
|
|
19949
20208
|
}
|
|
20209
|
+
/**
|
|
20210
|
+
* To manually open the overlap validation Alert.
|
|
20211
|
+
*
|
|
20212
|
+
* @param {PopupOpenEventArgs} args The arguments for opening the popup.
|
|
20213
|
+
* @param {string} args.type Defines the type of overlap alert (e.g., 'OverlapAlert').
|
|
20214
|
+
* @param {Record<string, any>} args.data The data associated with the popup.
|
|
20215
|
+
* @param {Record<string, any>[]} args.overlapEvents The overlap events.
|
|
20216
|
+
* @returns {void}
|
|
20217
|
+
*/
|
|
20218
|
+
openOverlapAlert(args) {
|
|
20219
|
+
if (this.quickPopup) {
|
|
20220
|
+
const eventProp = {
|
|
20221
|
+
type: 'OverlapAlert',
|
|
20222
|
+
cancel: false,
|
|
20223
|
+
element: this.quickPopup.quickDialog.element,
|
|
20224
|
+
data: args.data,
|
|
20225
|
+
overlapEvents: args.overlapEvents
|
|
20226
|
+
};
|
|
20227
|
+
this.trigger(popupOpen, eventProp, (popupArgs) => {
|
|
20228
|
+
if (!popupArgs.cancel) {
|
|
20229
|
+
this.quickPopup.openValidationError('overlapAlert', args.data);
|
|
20230
|
+
}
|
|
20231
|
+
});
|
|
20232
|
+
}
|
|
20233
|
+
}
|
|
20234
|
+
/**
|
|
20235
|
+
* To manually close the overlap validation Alert.
|
|
20236
|
+
*
|
|
20237
|
+
* @function closeOverlapValidationAlert
|
|
20238
|
+
* @returns {void}
|
|
20239
|
+
*/
|
|
20240
|
+
closeOverlapAlert() {
|
|
20241
|
+
if (this.quickPopup) {
|
|
20242
|
+
const args = {
|
|
20243
|
+
type: 'OverlapAlert',
|
|
20244
|
+
cancel: false,
|
|
20245
|
+
data: this.activeEventData.event,
|
|
20246
|
+
element: this.quickPopup.quickDialog.element
|
|
20247
|
+
};
|
|
20248
|
+
this.trigger(popupClose, args, (popupArgs) => {
|
|
20249
|
+
if (!popupArgs.cancel) {
|
|
20250
|
+
this.quickPopup.quickDialog.hide();
|
|
20251
|
+
}
|
|
20252
|
+
});
|
|
20253
|
+
}
|
|
20254
|
+
}
|
|
19950
20255
|
/**
|
|
19951
20256
|
* Closes the tooltip.
|
|
19952
20257
|
* For example, when the context menu is opened for an event,
|
|
@@ -20141,6 +20446,12 @@ __decorate$b([
|
|
|
20141
20446
|
__decorate$b([
|
|
20142
20447
|
Property(true)
|
|
20143
20448
|
], Schedule.prototype, "allowSwiping", void 0);
|
|
20449
|
+
__decorate$b([
|
|
20450
|
+
Property(true)
|
|
20451
|
+
], Schedule.prototype, "allowOverlap", void 0);
|
|
20452
|
+
__decorate$b([
|
|
20453
|
+
Property(3)
|
|
20454
|
+
], Schedule.prototype, "overscanCount", void 0);
|
|
20144
20455
|
__decorate$b([
|
|
20145
20456
|
Collection([], ToolbarItem)
|
|
20146
20457
|
], Schedule.prototype, "toolbarItems", void 0);
|
|
@@ -20399,6 +20710,15 @@ __decorate$b([
|
|
|
20399
20710
|
__decorate$b([
|
|
20400
20711
|
Event()
|
|
20401
20712
|
], Schedule.prototype, "beforePaste", void 0);
|
|
20713
|
+
__decorate$b([
|
|
20714
|
+
Event()
|
|
20715
|
+
], Schedule.prototype, "beforePrint", void 0);
|
|
20716
|
+
__decorate$b([
|
|
20717
|
+
Event()
|
|
20718
|
+
], Schedule.prototype, "excelExport", void 0);
|
|
20719
|
+
__decorate$b([
|
|
20720
|
+
Event()
|
|
20721
|
+
], Schedule.prototype, "tooltipOpen", void 0);
|
|
20402
20722
|
Schedule = __decorate$b([
|
|
20403
20723
|
NotifyPropertyChanges
|
|
20404
20724
|
], Schedule);
|
|
@@ -20486,7 +20806,9 @@ class ActionBase {
|
|
|
20486
20806
|
}
|
|
20487
20807
|
calculateIntervalTime(date) {
|
|
20488
20808
|
let dateInMS = resetTime(date).getTime();
|
|
20809
|
+
const startHour = this.parent.activeView.getStartHour();
|
|
20489
20810
|
const intervalInMS = MS_PER_MINUTE * this.actionObj.interval;
|
|
20811
|
+
dateInMS += (startHour.getHours() * 60 + startHour.getMinutes()) * MS_PER_MINUTE + startHour.getSeconds() * 1000;
|
|
20490
20812
|
dateInMS = dateInMS + Math.floor((date.getTime() - dateInMS) / intervalInMS) * intervalInMS;
|
|
20491
20813
|
return new Date(dateInMS);
|
|
20492
20814
|
}
|
|
@@ -20593,7 +20915,8 @@ class ActionBase {
|
|
|
20593
20915
|
return originalElement;
|
|
20594
20916
|
}
|
|
20595
20917
|
createCloneElement(element) {
|
|
20596
|
-
const cloneWrapper = createElement('div'
|
|
20918
|
+
const cloneWrapper = document.createElement('div');
|
|
20919
|
+
cloneWrapper.appendChild(element.cloneNode(true));
|
|
20597
20920
|
const cloneElement = cloneWrapper.children[0];
|
|
20598
20921
|
const cloneClassLists = [CLONE_ELEMENT_CLASS];
|
|
20599
20922
|
cloneClassLists.push((this.actionObj.action === 'drag') ? DRAG_CLONE_CLASS : RESIZE_CLONE_CLASS);
|
|
@@ -21152,6 +21475,9 @@ class Resize extends ActionBase {
|
|
|
21152
21475
|
if (resizeEventArgs.cancel) {
|
|
21153
21476
|
return;
|
|
21154
21477
|
}
|
|
21478
|
+
if (this.parent.eventBase.checkOverlap(resizeEventArgs.data)) {
|
|
21479
|
+
return;
|
|
21480
|
+
}
|
|
21155
21481
|
if (this.parent.isSpecificResourceEvents()) {
|
|
21156
21482
|
this.parent.crudModule.crudObj.sourceEvent =
|
|
21157
21483
|
[this.parent.resourceBase.lastResourceLevel[parseInt(resizeEventArgs.element.getAttribute('data-group-index'), 10)]];
|
|
@@ -21276,7 +21602,7 @@ class Resize extends ActionBase {
|
|
|
21276
21602
|
resizeTime.setHours(eventEnd.getHours(), eventEnd.getMinutes(), eventEnd.getSeconds());
|
|
21277
21603
|
}
|
|
21278
21604
|
}
|
|
21279
|
-
const isNotHourSlot = ['TimelineMonth', 'Year', 'Month', 'Week', 'Date'].indexOf(headerName) !== -1 ||
|
|
21605
|
+
const isNotHourSlot = ['TimelineMonth', 'Year', 'Month', 'Week', 'WorkWeek', 'Date', 'Day'].indexOf(headerName) !== -1 ||
|
|
21280
21606
|
!this.parent.activeViewOptions.timeScale.enable;
|
|
21281
21607
|
if (isLeft) {
|
|
21282
21608
|
if ((eventEnd.getTime() - resizeTime.getTime()) <= 0) {
|
|
@@ -21451,7 +21777,7 @@ class YearEvent extends TimelineEvent {
|
|
|
21451
21777
|
this.parent.dragAndDropModule.setDragArea();
|
|
21452
21778
|
}
|
|
21453
21779
|
this.fields = this.parent.eventFields;
|
|
21454
|
-
const elementSelector = (this.parent.currentView === 'Year') ? '.' + APPOINTMENT_CLASS :
|
|
21780
|
+
const elementSelector = (this.parent.currentView === 'Year') ? '.' + WORK_CELLS_CLASS + ' ' + '.' + APPOINTMENT_CLASS :
|
|
21455
21781
|
'.' + APPOINTMENT_WRAPPER_CLASS + ',.' + MORE_INDICATOR_CLASS;
|
|
21456
21782
|
const eventWrappers = [].slice.call(this.parent.element.querySelectorAll(elementSelector));
|
|
21457
21783
|
for (const wrapper of eventWrappers) {
|
|
@@ -22413,6 +22739,9 @@ class DragAndDrop extends ActionBase {
|
|
|
22413
22739
|
if (dragEventArgs.cancel) {
|
|
22414
22740
|
return;
|
|
22415
22741
|
}
|
|
22742
|
+
if (this.parent.eventBase.checkOverlap(dragEventArgs.data)) {
|
|
22743
|
+
return;
|
|
22744
|
+
}
|
|
22416
22745
|
if (this.parent.isSpecificResourceEvents()) {
|
|
22417
22746
|
this.parent.crudModule.crudObj.isCrudAction = true;
|
|
22418
22747
|
this.parent.crudModule.crudObj.sourceEvent =
|
|
@@ -25047,8 +25376,10 @@ class Month extends ViewBase {
|
|
|
25047
25376
|
this.retainScrollPosition();
|
|
25048
25377
|
}
|
|
25049
25378
|
scrollToSelectedDate() {
|
|
25379
|
+
const selectedDate = new Date(this.parent.selectedDate);
|
|
25380
|
+
selectedDate.setHours(0, 0, 0, 0);
|
|
25050
25381
|
const headerCell = this.element.querySelector('.' + HEADER_CELLS_CLASS + '[data-date="'
|
|
25051
|
-
+
|
|
25382
|
+
+ selectedDate.getTime().toString() + '"]');
|
|
25052
25383
|
const content = this.getContentAreaElement();
|
|
25053
25384
|
if (!isNullOrUndefined(headerCell)) {
|
|
25054
25385
|
content.scrollLeft = !this.parent.enableRtl ?
|
|
@@ -28582,8 +28913,14 @@ class ExcelExport {
|
|
|
28582
28913
|
rows.push({ index: i + 2, cells: columnData });
|
|
28583
28914
|
});
|
|
28584
28915
|
const workSheet = [{ columns: columns, rows: rows }];
|
|
28585
|
-
const
|
|
28586
|
-
|
|
28916
|
+
const args = { cancel: false, worksheets: workSheet };
|
|
28917
|
+
this.parent.trigger(excelExport, args, (args) => {
|
|
28918
|
+
if (args.cancel) {
|
|
28919
|
+
return;
|
|
28920
|
+
}
|
|
28921
|
+
const book = new Workbook({ worksheets: args.worksheets }, type, this.parent.locale, undefined, separator);
|
|
28922
|
+
book.save(name + '.' + type);
|
|
28923
|
+
});
|
|
28587
28924
|
}
|
|
28588
28925
|
getExportColumns(exportOptions) {
|
|
28589
28926
|
const exportColumns = exportOptions.fieldsInfo || [];
|
|
@@ -28620,46 +28957,52 @@ class Print {
|
|
|
28620
28957
|
printScheduler() {
|
|
28621
28958
|
const clone = this.parent.element.cloneNode(true);
|
|
28622
28959
|
clone.id = this.parent.element.id + '_print';
|
|
28623
|
-
|
|
28624
|
-
|
|
28625
|
-
|
|
28626
|
-
|
|
28627
|
-
|
|
28628
|
-
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
28635
|
-
|
|
28636
|
-
|
|
28637
|
-
|
|
28638
|
-
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28642
|
-
|
|
28643
|
-
|
|
28644
|
-
|
|
28645
|
-
|
|
28646
|
-
|
|
28647
|
-
|
|
28648
|
-
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28652
|
-
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
|
|
28660
|
-
|
|
28661
|
-
|
|
28662
|
-
|
|
28960
|
+
const args = { cancel: false, printElement: clone };
|
|
28961
|
+
this.parent.trigger(beforePrint, args, (printElement) => {
|
|
28962
|
+
if (printElement.cancel) {
|
|
28963
|
+
return;
|
|
28964
|
+
}
|
|
28965
|
+
document.body.appendChild(clone);
|
|
28966
|
+
const className = this.parent.currentView === 'MonthAgenda' ? '.e-appointment-wrap' : '.e-content-wrap';
|
|
28967
|
+
const scrollableEle = this.parent.element.querySelector(className);
|
|
28968
|
+
const links = [].slice.call(document.getElementsByTagName('head')[0].querySelectorAll('link, style'));
|
|
28969
|
+
let reference = '';
|
|
28970
|
+
for (const link of links) {
|
|
28971
|
+
reference += link.outerHTML;
|
|
28972
|
+
}
|
|
28973
|
+
const div = createElement('div');
|
|
28974
|
+
clone.style.width = this.parent.element.offsetWidth + 'px';
|
|
28975
|
+
const elementWidth = Math.round((parseInt(clone.style.width, 10)) / 100) * 100;
|
|
28976
|
+
div.appendChild(clone);
|
|
28977
|
+
const printWindow = window.open('', 'print', 'height=550,width=' + elementWidth + ',tabbar=no');
|
|
28978
|
+
printWindow.document.write('<!DOCTYPE html><html><head>' + reference + '</head><body>' + div.innerHTML +
|
|
28979
|
+
'<script>(function() { window.ready = true; })();</script></body></html>');
|
|
28980
|
+
printWindow.document.close();
|
|
28981
|
+
printWindow.focus();
|
|
28982
|
+
setTimeout(() => {
|
|
28983
|
+
if (printWindow.ready && scrollableEle) {
|
|
28984
|
+
// eslint-disable-next-line no-self-assign
|
|
28985
|
+
scrollableEle.scrollLeft = scrollableEle.scrollLeft;
|
|
28986
|
+
// eslint-disable-next-line no-self-assign
|
|
28987
|
+
scrollableEle.scrollTop = scrollableEle.scrollTop;
|
|
28988
|
+
const headerTimeCellsScroll = printWindow.document.querySelector('.e-date-header-wrap');
|
|
28989
|
+
if (headerTimeCellsScroll) {
|
|
28990
|
+
headerTimeCellsScroll.scrollLeft = scrollableEle.scrollLeft;
|
|
28991
|
+
}
|
|
28992
|
+
const timeCellsScroll = printWindow.document.querySelector('.e-time-cells-wrap');
|
|
28993
|
+
if (timeCellsScroll) {
|
|
28994
|
+
timeCellsScroll.scrollTop = scrollableEle.scrollTop;
|
|
28995
|
+
}
|
|
28996
|
+
const contentCellScroll = printWindow.document.querySelector(className);
|
|
28997
|
+
if (contentCellScroll) {
|
|
28998
|
+
contentCellScroll.scrollLeft = scrollableEle.scrollLeft;
|
|
28999
|
+
contentCellScroll.scrollTop = scrollableEle.scrollTop;
|
|
29000
|
+
}
|
|
29001
|
+
printWindow.print();
|
|
29002
|
+
printWindow.close();
|
|
29003
|
+
}
|
|
29004
|
+
}, 500);
|
|
29005
|
+
});
|
|
28663
29006
|
}
|
|
28664
29007
|
printSchedulerWithModel(printOptions) {
|
|
28665
29008
|
const element = createElement('div', { id: this.parent.element.id + '_print', className: 'e-print-schedule' });
|
|
@@ -28670,10 +29013,17 @@ class Print {
|
|
|
28670
29013
|
this.printInstance.registeredTemplate = this.parent.registeredTemplate;
|
|
28671
29014
|
this.printInstance.root = this.parent.root ? this.parent.root : this.parent;
|
|
28672
29015
|
this.printInstance.appendTo(element);
|
|
28673
|
-
|
|
28674
|
-
this.
|
|
28675
|
-
|
|
28676
|
-
|
|
29016
|
+
const args = { cancel: false, printElement: element };
|
|
29017
|
+
this.parent.trigger(beforePrint, args, (printElement) => {
|
|
29018
|
+
if (printElement.cancel) {
|
|
29019
|
+
this.printCleanup();
|
|
29020
|
+
return;
|
|
29021
|
+
}
|
|
29022
|
+
this.printInstance.on(print, this.contentReady, this);
|
|
29023
|
+
this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
|
|
29024
|
+
this.printWindow.moveTo(0, 0);
|
|
29025
|
+
this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
|
|
29026
|
+
});
|
|
28677
29027
|
}
|
|
28678
29028
|
getPrintScheduleModel(printOptions) {
|
|
28679
29029
|
const printModel = {};
|
|
@@ -28751,16 +29101,38 @@ class Print {
|
|
|
28751
29101
|
}
|
|
28752
29102
|
contentReady() {
|
|
28753
29103
|
this.printWindow = print$1(this.printInstance.element, this.printWindow);
|
|
29104
|
+
this.closePrintWindow(this.printWindow, true);
|
|
28754
29105
|
this.printWindow.onbeforeunload = () => {
|
|
28755
|
-
|
|
28756
|
-
this.printInstance.off(print, this.contentReady);
|
|
28757
|
-
this.printInstance.element.remove();
|
|
28758
|
-
this.printInstance.destroy();
|
|
28759
|
-
this.printInstance = null;
|
|
28760
|
-
}
|
|
28761
|
-
this.printWindow = null;
|
|
29106
|
+
this.printCleanup();
|
|
28762
29107
|
};
|
|
28763
29108
|
}
|
|
29109
|
+
closePrintWindow(printWindow, cleanupRequired) {
|
|
29110
|
+
if (Browser.isIos) {
|
|
29111
|
+
const printInterval = setInterval(() => {
|
|
29112
|
+
if (printWindow.opener) {
|
|
29113
|
+
printWindow.close();
|
|
29114
|
+
}
|
|
29115
|
+
else if (isNullOrUndefined(printWindow.opener)) {
|
|
29116
|
+
if (cleanupRequired) {
|
|
29117
|
+
this.printCleanup();
|
|
29118
|
+
}
|
|
29119
|
+
clearInterval(printInterval);
|
|
29120
|
+
}
|
|
29121
|
+
}, 500);
|
|
29122
|
+
}
|
|
29123
|
+
}
|
|
29124
|
+
printCleanup() {
|
|
29125
|
+
if (this.printInstance) {
|
|
29126
|
+
this.printInstance.off(print, this.contentReady);
|
|
29127
|
+
this.printInstance.element.remove();
|
|
29128
|
+
this.printInstance.destroy();
|
|
29129
|
+
this.printInstance = null;
|
|
29130
|
+
}
|
|
29131
|
+
if (this.printWindow) {
|
|
29132
|
+
this.printWindow.onbeforeunload = null;
|
|
29133
|
+
this.printWindow = null;
|
|
29134
|
+
}
|
|
29135
|
+
}
|
|
28764
29136
|
getModuleName() {
|
|
28765
29137
|
return 'print';
|
|
28766
29138
|
}
|
|
@@ -28769,5 +29141,5 @@ class Print {
|
|
|
28769
29141
|
}
|
|
28770
29142
|
}
|
|
28771
29143
|
|
|
28772
|
-
export { Agenda, DEFAULT_WEEKS, Day, DragAndDrop, ExcelExport, Gregorian, HeaderRenderer, ICalendarExport, ICalendarImport, Islamic, MS_PER_DAY, MS_PER_MINUTE, Month, MonthAgenda, Print, RecurrenceEditor, Resize, Schedule, TimelineMonth, TimelineViews, TimelineYear, Timezone, ViewBase, WEEK_LENGTH, Week, WorkWeek, Year, actionBegin, actionComplete, actionFailure, addDays, addMonths, addYears, agendaCells, beforePaste, capitalizeFirstWord, cellClick, cellDoubleClick, cellMouseDown, cellSelect, contentReady, dataBinding, dataBound, dataReady, dateHeader, documentClick, documentPaste, drag, dragStart, dragStop, eventClick, eventDoubleClick, eventRendered, eventsLoaded, extractObjectFromRule, findIndexInData, firstDateOfMonth, generate, generateSummary, getCalendarUtil, getDateCount, getDateFromRecurrenceDateString, getDateFromString, getDateInMs, getDaysCount, getElementHeight, getElementHeightFromClass, getElementTop, getElementWidth, getElementWidthFromClass, getMaxDays, getOuterHeight, getRecurrenceStringFromDate, getScrollBarWidth, getStartEndHours, getTranslateX, getTranslateY, getUniversalTime, getWeekFirstDate, getWeekLastDate, getWeekMiddleDate, getWeekNumber, hover, initialEnd, initialLoad, inlineClick, isDaylightSavingTime, isIPadDevice, isMobile, lastDateOfMonth, moreEventsClick, navigating, noEvents, popupClose, popupOpen, print, removeChildren, renderCell, resetScrollbarWidth, resetTime, resizeStart, resizeStop, resizing, resourceHeader, scroll, scrollUiUpdate, select, setTime, timezoneData, uiUpdate, virtualScroll, virtualScrollStart, virtualScrollStop };
|
|
29144
|
+
export { Agenda, DEFAULT_WEEKS, Day, DragAndDrop, ExcelExport, Gregorian, HeaderRenderer, ICalendarExport, ICalendarImport, Islamic, MS_PER_DAY, MS_PER_MINUTE, Month, MonthAgenda, Print, RecurrenceEditor, Resize, Schedule, TimelineMonth, TimelineViews, TimelineYear, Timezone, ViewBase, WEEK_LENGTH, Week, WorkWeek, Year, actionBegin, actionComplete, actionFailure, addDays, addMonths, addYears, agendaCells, beforePaste, beforePrint, capitalizeFirstWord, cellClick, cellDoubleClick, cellMouseDown, cellSelect, contentReady, dataBinding, dataBound, dataReady, dateHeader, documentClick, documentPaste, drag, dragStart, dragStop, eventClick, eventDoubleClick, eventRendered, eventsLoaded, excelExport, extractObjectFromRule, findIndexInData, firstDateOfMonth, generate, generateSummary, getCalendarUtil, getDateCount, getDateFromRecurrenceDateString, getDateFromString, getDateInMs, getDaysCount, getElementHeight, getElementHeightFromClass, getElementTop, getElementWidth, getElementWidthFromClass, getMaxDays, getOuterHeight, getRecurrenceStringFromDate, getScrollBarWidth, getStartEndHours, getTranslateX, getTranslateY, getUniversalTime, getWeekFirstDate, getWeekLastDate, getWeekMiddleDate, getWeekNumber, hover, initialEnd, initialLoad, inlineClick, isDaylightSavingTime, isIPadDevice, isMobile, lastDateOfMonth, moreEventsClick, navigating, noEvents, popupClose, popupOpen, print, removeChildren, renderCell, resetScrollbarWidth, resetTime, resizeStart, resizeStop, resizing, resourceHeader, scroll, scrollUiUpdate, select, setTime, timezoneData, tooltipOpen, uiUpdate, virtualScroll, virtualScrollStart, virtualScrollStop };
|
|
28773
29145
|
//# sourceMappingURL=ej2-schedule.es2015.js.map
|