@syncfusion/ej2-schedule 20.1.52 → 20.1.57
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 +53 -11
- 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 +167 -71
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +165 -69
- 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 +15 -15
- package/src/recurrence-editor/date-generator.js +11 -1
- package/src/schedule/actions/drag.js +9 -9
- package/src/schedule/base/schedule.js +9 -1
- package/src/schedule/event-renderer/agenda-base.js +4 -1
- package/src/schedule/event-renderer/event-base.js +16 -11
- package/src/schedule/event-renderer/month.d.ts +1 -0
- package/src/schedule/event-renderer/month.js +38 -29
- package/src/schedule/event-renderer/vertical-view.js +3 -0
- package/src/schedule/event-renderer/year.js +3 -1
- package/src/schedule/exports/calendar-export.js +1 -1
- package/src/schedule/popups/event-window.js +4 -2
- package/src/schedule/popups/quick-popups.js +2 -2
- package/src/schedule/renderer/month.js +8 -5
- package/src/schedule/renderer/renderer.js +2 -1
- package/src/schedule/renderer/timeline-year.d.ts +2 -1
- package/src/schedule/renderer/timeline-year.js +49 -4
- package/src/schedule/renderer/vertical-view.js +2 -1
- package/src/schedule/renderer/year.js +4 -0
- package/styles/bootstrap-dark.css +83 -968
- package/styles/bootstrap.css +83 -967
- package/styles/bootstrap4.css +83 -990
- package/styles/bootstrap5-dark.css +83 -988
- package/styles/bootstrap5.css +83 -988
- package/styles/fabric-dark.css +83 -968
- package/styles/fabric.css +83 -970
- package/styles/fluent-dark.css +83 -968
- package/styles/fluent.css +83 -968
- package/styles/highcontrast-light.css +83 -967
- package/styles/highcontrast.css +83 -972
- package/styles/material-dark.css +83 -967
- package/styles/material.css +83 -967
- package/styles/recurrence-editor/bootstrap-dark.css +6 -94
- package/styles/recurrence-editor/bootstrap.css +6 -94
- package/styles/recurrence-editor/bootstrap4.css +6 -94
- package/styles/recurrence-editor/bootstrap5-dark.css +6 -94
- package/styles/recurrence-editor/bootstrap5.css +6 -94
- package/styles/recurrence-editor/fabric-dark.css +6 -94
- package/styles/recurrence-editor/fabric.css +6 -94
- package/styles/recurrence-editor/fluent-dark.css +6 -94
- package/styles/recurrence-editor/fluent.css +6 -94
- package/styles/recurrence-editor/highcontrast-light.css +6 -94
- package/styles/recurrence-editor/highcontrast.css +6 -94
- package/styles/recurrence-editor/material-dark.css +6 -94
- package/styles/recurrence-editor/material.css +6 -94
- package/styles/recurrence-editor/tailwind-dark.css +6 -94
- package/styles/recurrence-editor/tailwind.css +6 -94
- package/styles/schedule/bootstrap-dark.css +78 -875
- package/styles/schedule/bootstrap.css +78 -874
- package/styles/schedule/bootstrap4.css +78 -897
- package/styles/schedule/bootstrap5-dark.css +78 -895
- package/styles/schedule/bootstrap5.css +78 -895
- package/styles/schedule/fabric-dark.css +78 -875
- package/styles/schedule/fabric.css +78 -877
- package/styles/schedule/fluent-dark.css +78 -875
- package/styles/schedule/fluent.css +78 -875
- package/styles/schedule/highcontrast-light.css +78 -874
- package/styles/schedule/highcontrast.css +78 -879
- package/styles/schedule/material-dark.css +78 -874
- package/styles/schedule/material.css +78 -874
- package/styles/schedule/tailwind-dark.css +78 -895
- package/styles/schedule/tailwind.css +78 -895
- package/styles/tailwind-dark.css +83 -988
- package/styles/tailwind.css +83 -988
|
@@ -3631,6 +3631,10 @@ function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount = M
|
|
|
3631
3631
|
}
|
|
3632
3632
|
maxOccurrence = maximumCount;
|
|
3633
3633
|
setFirstDayOfWeek(DAYINDEX[startDayOfWeek]);
|
|
3634
|
+
if (ruleObject.until) {
|
|
3635
|
+
const end = resetTime(ruleObject.until);
|
|
3636
|
+
ruleObject.until = new Date(end.getFullYear(), end.getMonth(), end.getDate(), 23, 59, 59);
|
|
3637
|
+
}
|
|
3634
3638
|
switch (ruleObject.freq) {
|
|
3635
3639
|
case 'DAILY':
|
|
3636
3640
|
dailyType(modifiedDate, ruleObject.until, data, ruleObject);
|
|
@@ -3727,6 +3731,9 @@ function dailyType(startDate, endDate, data, ruleObject) {
|
|
|
3727
3731
|
}
|
|
3728
3732
|
}
|
|
3729
3733
|
tempDate.setDate(tempDate.getDate() + interval);
|
|
3734
|
+
if (tempDate.getHours() !== startDate.getHours()) {
|
|
3735
|
+
tempDate.setHours(startDate.getHours());
|
|
3736
|
+
}
|
|
3730
3737
|
}
|
|
3731
3738
|
}
|
|
3732
3739
|
/**
|
|
@@ -3771,6 +3778,9 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
3771
3778
|
break;
|
|
3772
3779
|
}
|
|
3773
3780
|
tempDate.setDate(tempDate.getDate() + 1);
|
|
3781
|
+
if (tempDate.getHours() !== startDate.getHours()) {
|
|
3782
|
+
tempDate.setHours(startDate.getHours());
|
|
3783
|
+
}
|
|
3774
3784
|
compareTempDate = new Date(tempDate.getTime());
|
|
3775
3785
|
compareTempDate = resetTime(compareTempDate);
|
|
3776
3786
|
}
|
|
@@ -4652,7 +4662,7 @@ function insertDateCollection(state, startDate, endDate, data, ruleObject, dayDa
|
|
|
4652
4662
|
function weekCount(year, startDayOfWeek, monthCollection, week, ruleObject) {
|
|
4653
4663
|
const firstDayOfWeek = startDayOfWeek || 0;
|
|
4654
4664
|
const firstOfMonth = new Date(year, ruleObject.month[0] - 1, 1);
|
|
4655
|
-
const lastOfMonth = new Date(year, ruleObject.month[0]
|
|
4665
|
+
const lastOfMonth = new Date(year, ruleObject.month[0], 0);
|
|
4656
4666
|
const numberOfDaysInMonth = lastOfMonth.getDate();
|
|
4657
4667
|
const firstWeekDay = (firstOfMonth.getDay() - firstDayOfWeek + 7) % 7;
|
|
4658
4668
|
const used = firstWeekDay + numberOfDaysInMonth;
|
|
@@ -5605,6 +5615,9 @@ class EventBase {
|
|
|
5605
5615
|
this.parent.removeSelectedClass();
|
|
5606
5616
|
}
|
|
5607
5617
|
addClass(cells, APPOINTMENT_BORDER);
|
|
5618
|
+
if (cells.length > 0) {
|
|
5619
|
+
cells[cells.length - 1].focus();
|
|
5620
|
+
}
|
|
5608
5621
|
}
|
|
5609
5622
|
getSelectedAppointments() {
|
|
5610
5623
|
return [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_BORDER + ',.' + APPOINTMENT_CLASS + ':focus'));
|
|
@@ -5705,7 +5718,7 @@ class EventBase {
|
|
|
5705
5718
|
isAllDayAppointment(event) {
|
|
5706
5719
|
const fieldMapping = this.parent.eventFields;
|
|
5707
5720
|
const isAllDay = event[fieldMapping.isAllDay];
|
|
5708
|
-
const isFullDay = ((event[fieldMapping.endTime]
|
|
5721
|
+
const isFullDay = ((getUniversalTime(event[fieldMapping.endTime]) - getUniversalTime(event[fieldMapping.startTime]))
|
|
5709
5722
|
/ MS_PER_DAY) >= 1;
|
|
5710
5723
|
return (isAllDay || (this.parent.eventSettings.spannedEventPlacement !== 'TimeSlot' && isFullDay)) ? true : false;
|
|
5711
5724
|
}
|
|
@@ -6252,16 +6265,18 @@ class EventBase {
|
|
|
6252
6265
|
}
|
|
6253
6266
|
}
|
|
6254
6267
|
updateEventMinimumDuration(startEndHours, startTime, endTime) {
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6268
|
+
if (startTime.getTime() < endTime.getTime()) {
|
|
6269
|
+
const eventDuration = (getUniversalTime(endTime) - getUniversalTime(startTime)) / MS_PER_MINUTE;
|
|
6270
|
+
if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
|
|
6271
|
+
const tempEnd = new Date(startTime);
|
|
6272
|
+
tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
|
|
6273
|
+
endTime = tempEnd;
|
|
6274
|
+
if (endTime.getTime() > startEndHours.endHour.getTime()) {
|
|
6275
|
+
const tempStart = new Date(startEndHours.endHour.getTime());
|
|
6276
|
+
tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
|
|
6277
|
+
startTime = tempStart;
|
|
6278
|
+
endTime = startEndHours.endHour;
|
|
6279
|
+
}
|
|
6265
6280
|
}
|
|
6266
6281
|
}
|
|
6267
6282
|
return { startDate: startTime, endDate: endTime };
|
|
@@ -6773,6 +6788,9 @@ class VerticalEvent extends EventBase {
|
|
|
6773
6788
|
const currentDate = resetTime(new Date(this.dateRender[resource][dayIndex].getTime()));
|
|
6774
6789
|
const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
|
|
6775
6790
|
const isValidEvent = this.isValidEvent(eventObj, eStart, eEnd, schedule);
|
|
6791
|
+
if ((eStart.getTime() < this.parent.minDate.getTime()) || (eEnd.getTime() > this.parent.maxDate.getTime())) {
|
|
6792
|
+
return;
|
|
6793
|
+
}
|
|
6776
6794
|
if (eStart <= eEnd && isValidEvent) {
|
|
6777
6795
|
const appHeight = this.getHeight(eStart, eEnd);
|
|
6778
6796
|
if (eStart.getTime() > schedule.startHour.getTime()) {
|
|
@@ -7096,7 +7114,7 @@ class MonthEvent extends EventBase {
|
|
|
7096
7114
|
if (appElement.length > 0) {
|
|
7097
7115
|
appElement = (this.parent.currentView === 'Month') ? appElement : [appElement[0]];
|
|
7098
7116
|
for (const wrap of appElement) {
|
|
7099
|
-
if (
|
|
7117
|
+
if (wrap.parentElement && wrap.parentElement.parentNode) {
|
|
7100
7118
|
remove(wrap.parentElement);
|
|
7101
7119
|
}
|
|
7102
7120
|
}
|
|
@@ -7226,11 +7244,18 @@ class MonthEvent extends EventBase {
|
|
|
7226
7244
|
const filteredDates = this.getRenderedDates(dateRender);
|
|
7227
7245
|
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
7228
7246
|
this.processBlockEvents(blockList, resIndex, resData);
|
|
7247
|
+
let events = [];
|
|
7229
7248
|
for (const event of eventsList) {
|
|
7230
7249
|
if (this.parent.resourceBase && !resData) {
|
|
7231
7250
|
this.cssClass = this.parent.resourceBase.getCssClass(event);
|
|
7232
7251
|
}
|
|
7233
|
-
|
|
7252
|
+
events = events.concat(this.splitEvent(event, filteredDates || this.dateRender));
|
|
7253
|
+
}
|
|
7254
|
+
for (let level = 0; level < this.slots.length; level++) {
|
|
7255
|
+
this.renderedEvents = [];
|
|
7256
|
+
const slot = this.slots[level];
|
|
7257
|
+
const endDate = addDays(new Date(slot[slot.length - 1]), 1);
|
|
7258
|
+
const spannedEvents = this.filterEvents(new Date(slot[0]), endDate, events);
|
|
7234
7259
|
for (const event of spannedEvents) {
|
|
7235
7260
|
if (this.maxHeight) {
|
|
7236
7261
|
const sDate = this.parent.currentView === 'Month' ? event[this.fields.startTime] :
|
|
@@ -7526,24 +7551,20 @@ class MonthEvent extends EventBase {
|
|
|
7526
7551
|
const startTime = event[this.fields.startTime];
|
|
7527
7552
|
const endTime = event[this.fields.endTime];
|
|
7528
7553
|
const day = this.parent.getIndexOfDate(this.dateRender, resetTime(startTime));
|
|
7529
|
-
if (day < 0) {
|
|
7530
|
-
return;
|
|
7531
|
-
}
|
|
7532
|
-
if ((startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {
|
|
7554
|
+
if ((day < 0) || (startTime.getTime() < this.parent.minDate.getTime()) || (endTime.getTime() > this.parent.maxDate.getTime())) {
|
|
7533
7555
|
return;
|
|
7534
7556
|
}
|
|
7535
7557
|
const overlapCount = this.getIndex(startTime);
|
|
7536
7558
|
event.Index = overlapCount;
|
|
7537
|
-
let appHeight = this.eventHeight;
|
|
7538
|
-
this.renderedEvents.push(extend({}, event, null, true));
|
|
7539
7559
|
const diffInDays = event.data.count;
|
|
7540
7560
|
if (startTime.getTime() <= endTime.getTime()) {
|
|
7541
7561
|
const appWidth = (diffInDays * this.cellWidth) - 5;
|
|
7542
7562
|
const cellTd = this.workCells[day];
|
|
7543
|
-
const appTop = (overlapCount * (
|
|
7544
|
-
const height = this.monthHeaderHeight + ((overlapCount + 1) * (
|
|
7563
|
+
const appTop = (overlapCount * (this.eventHeight + EVENT_GAP));
|
|
7564
|
+
const height = this.monthHeaderHeight + ((overlapCount + 1) * (this.eventHeight + EVENT_GAP)) + this.moreIndicatorHeight;
|
|
7545
7565
|
const enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
|
|
7546
7566
|
if (this.parent.rowAutoHeight || enableAppRender) {
|
|
7567
|
+
this.renderedEvents.push(extend({}, event, null, true));
|
|
7547
7568
|
let appointmentElement;
|
|
7548
7569
|
if (this.inlineValue) {
|
|
7549
7570
|
appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();
|
|
@@ -7562,24 +7583,26 @@ class MonthEvent extends EventBase {
|
|
|
7562
7583
|
}
|
|
7563
7584
|
else {
|
|
7564
7585
|
for (let i = 0; i < diffInDays; i++) {
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7586
|
+
if (this.workCells[day + i]) {
|
|
7587
|
+
const indicator = this.workCells[day + i].querySelector('.' + MORE_INDICATOR_CLASS);
|
|
7588
|
+
if (indicator) {
|
|
7589
|
+
const count = parseInt(indicator.getAttribute('data-count'), 10) + 1;
|
|
7590
|
+
indicator.setAttribute('data-count', count.toString());
|
|
7591
|
+
indicator.innerHTML = this.getMoreIndicatorText(count);
|
|
7592
|
+
}
|
|
7593
|
+
else {
|
|
7594
|
+
const startDate = new Date(this.dateRender[day + i].getTime());
|
|
7595
|
+
const endDate = addDays(this.dateRender[day + i], 1);
|
|
7596
|
+
const groupIndex = this.workCells[day + i].getAttribute('data-group-index');
|
|
7597
|
+
const moreIndicatorElement = this.getMoreIndicatorElement(1, startDate, endDate);
|
|
7598
|
+
if (!isNullOrUndefined(groupIndex)) {
|
|
7599
|
+
moreIndicatorElement.setAttribute('data-group-index', groupIndex);
|
|
7600
|
+
}
|
|
7601
|
+
moreIndicatorElement.style.top = (this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight) + 'px';
|
|
7602
|
+
moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
|
|
7603
|
+
this.renderElement(this.workCells[day + i], moreIndicatorElement);
|
|
7604
|
+
EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
|
|
7578
7605
|
}
|
|
7579
|
-
moreIndicatorElement.style.top = appArea + 'px';
|
|
7580
|
-
moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
|
|
7581
|
-
this.renderElement(cellTd, moreIndicatorElement);
|
|
7582
|
-
EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
|
|
7583
7606
|
}
|
|
7584
7607
|
}
|
|
7585
7608
|
}
|
|
@@ -7615,8 +7638,8 @@ class MonthEvent extends EventBase {
|
|
|
7615
7638
|
}
|
|
7616
7639
|
getOverlapEvents(date, appointments) {
|
|
7617
7640
|
const appointmentsList = [];
|
|
7641
|
+
const dateTime = resetTime(date).getTime();
|
|
7618
7642
|
for (const app of appointments) {
|
|
7619
|
-
const dateTime = resetTime(date).getTime();
|
|
7620
7643
|
if ((resetTime(app[this.fields.startTime]).getTime() <= dateTime) &&
|
|
7621
7644
|
(resetTime(app[this.fields.endTime]).getTime() >= dateTime)) {
|
|
7622
7645
|
appointmentsList.push(app);
|
|
@@ -7697,9 +7720,10 @@ class MonthEvent extends EventBase {
|
|
|
7697
7720
|
getMoreIndicatorElement(count, startDate, endDate) {
|
|
7698
7721
|
const moreIndicatorElement = createElement('div', {
|
|
7699
7722
|
className: MORE_INDICATOR_CLASS,
|
|
7700
|
-
innerHTML:
|
|
7723
|
+
innerHTML: this.getMoreIndicatorText(count),
|
|
7701
7724
|
attrs: {
|
|
7702
7725
|
'tabindex': '0',
|
|
7726
|
+
'data-count': count.toString(),
|
|
7703
7727
|
'data-start-date': startDate.getTime().toString(),
|
|
7704
7728
|
'data-end-date': endDate.getTime().toString(),
|
|
7705
7729
|
'role': 'list'
|
|
@@ -7707,6 +7731,9 @@ class MonthEvent extends EventBase {
|
|
|
7707
7731
|
});
|
|
7708
7732
|
return moreIndicatorElement;
|
|
7709
7733
|
}
|
|
7734
|
+
getMoreIndicatorText(count) {
|
|
7735
|
+
return '+' + this.parent.globalize.formatNumber(count) + ' ' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more'));
|
|
7736
|
+
}
|
|
7710
7737
|
removeHeightProperty(selector) {
|
|
7711
7738
|
const rows = [].slice.call(this.element.querySelectorAll('.' + selector + ' tbody tr'));
|
|
7712
7739
|
for (const row of rows) {
|
|
@@ -9300,11 +9327,11 @@ class QuickPopups {
|
|
|
9300
9327
|
(endDate.getTime() - startDate.getTime()) / (60 * 60 * 1000) < 24 ? 1 : 0;
|
|
9301
9328
|
if (eventData[fields.isAllDay]) {
|
|
9302
9329
|
details = startDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';
|
|
9303
|
-
if (((endDate
|
|
9330
|
+
if (((getUniversalTime(endDate) - getUniversalTime(startDate)) / MS_PER_DAY) > 1) {
|
|
9304
9331
|
details += ' - ' + endDateDetails + ' (' + this.l10n.getConstant('allDay') + ')';
|
|
9305
9332
|
}
|
|
9306
9333
|
}
|
|
9307
|
-
else if ((((endDate
|
|
9334
|
+
else if ((((getUniversalTime(endDate) - getUniversalTime(startDate)) / MS_PER_DAY) >= 1) || spanLength > 0) {
|
|
9308
9335
|
details = startDateDetails + ' (' + startTimeDetail + ')' + ' - ' + endDateDetails + ' (' + endTimeDetail + ')';
|
|
9309
9336
|
}
|
|
9310
9337
|
else {
|
|
@@ -11731,7 +11758,8 @@ class EventWindow {
|
|
|
11731
11758
|
return labelText;
|
|
11732
11759
|
}
|
|
11733
11760
|
onChange(args) {
|
|
11734
|
-
const
|
|
11761
|
+
const targetSelector = `.${EVENT_WINDOW_ALL_DAY_CLASS},.${TIME_ZONE_CLASS},.${EVENT_WINDOW_REPEAT_CLASS}`;
|
|
11762
|
+
const target = closest(args.event.target, targetSelector);
|
|
11735
11763
|
if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
|
|
11736
11764
|
this.onAllDayChange(args.checked);
|
|
11737
11765
|
}
|
|
@@ -11895,7 +11923,8 @@ class EventWindow {
|
|
|
11895
11923
|
}
|
|
11896
11924
|
showDetails(eventData) {
|
|
11897
11925
|
const eventObj = extend({}, eventData, null, true);
|
|
11898
|
-
if (
|
|
11926
|
+
if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
|
|
11927
|
+
eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
|
|
11899
11928
|
this.trimAllDay(eventObj);
|
|
11900
11929
|
}
|
|
11901
11930
|
this.eventData = eventObj;
|
|
@@ -13183,7 +13212,8 @@ class Render {
|
|
|
13183
13212
|
this.parent.virtualScrollModule.destroy();
|
|
13184
13213
|
this.parent.virtualScrollModule = null;
|
|
13185
13214
|
}
|
|
13186
|
-
if (this.parent.currentView.indexOf('Timeline') !== -1 && this.parent.currentView.indexOf('Year') === -1
|
|
13215
|
+
if (this.parent.currentView.indexOf('Timeline') !== -1 && (this.parent.currentView.indexOf('Year') === -1 ||
|
|
13216
|
+
(this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
|
|
13187
13217
|
&& this.parent.activeViewOptions.allowVirtualScrolling
|
|
13188
13218
|
&& this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
13189
13219
|
this.parent.virtualScrollModule = new VirtualScroll(this.parent);
|
|
@@ -15729,6 +15759,7 @@ let Schedule = class Schedule extends Component {
|
|
|
15729
15759
|
};
|
|
15730
15760
|
this.trigger(navigating, navArgs, (navigationArgs) => {
|
|
15731
15761
|
if (!navigationArgs.cancel) {
|
|
15762
|
+
this.uiStateValues.isInitial = view.indexOf('Timeline') > -1 || this.currentView.indexOf('Timeline') > -1 ? true : this.uiStateValues.isInitial;
|
|
15732
15763
|
this.viewIndex = navigationArgs.viewIndex;
|
|
15733
15764
|
this.setProperties({ currentView: view }, true);
|
|
15734
15765
|
if (this.headerModule) {
|
|
@@ -16347,6 +16378,9 @@ let Schedule = class Schedule extends Component {
|
|
|
16347
16378
|
if (document.querySelectorAll(template).length) {
|
|
16348
16379
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
16349
16380
|
}
|
|
16381
|
+
else {
|
|
16382
|
+
return compile(template);
|
|
16383
|
+
}
|
|
16350
16384
|
}
|
|
16351
16385
|
catch (error) {
|
|
16352
16386
|
return compile(template);
|
|
@@ -16525,8 +16559,12 @@ let Schedule = class Schedule extends Component {
|
|
|
16525
16559
|
this.refreshEvents(false);
|
|
16526
16560
|
}
|
|
16527
16561
|
break;
|
|
16528
|
-
case 'showWeekend':
|
|
16529
16562
|
case 'workDays':
|
|
16563
|
+
if (JSON.stringify(oldProp.workDays) !== JSON.stringify(newProp.workDays)) {
|
|
16564
|
+
state.isLayout = true;
|
|
16565
|
+
}
|
|
16566
|
+
break;
|
|
16567
|
+
case 'showWeekend':
|
|
16530
16568
|
case 'startHour':
|
|
16531
16569
|
case 'endHour':
|
|
16532
16570
|
case 'workHours':
|
|
@@ -19152,7 +19190,9 @@ class YearEvent extends TimelineEvent {
|
|
|
19152
19190
|
this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
|
|
19153
19191
|
const wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
|
|
19154
19192
|
const resources = this.parent.uiStateValues.isGroupAdaptive ?
|
|
19155
|
-
[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
|
|
19193
|
+
[this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
|
|
19194
|
+
this.parent.activeViewOptions.allowVirtualScrolling ? this.parent.resourceBase.renderedResources :
|
|
19195
|
+
this.parent.resourceBase.lastResourceLevel;
|
|
19156
19196
|
const months = this.getMonths();
|
|
19157
19197
|
if (this.parent.activeViewOptions.orientation === 'Horizontal') {
|
|
19158
19198
|
for (let month = 0; month < months.length; month++) {
|
|
@@ -19983,7 +20023,7 @@ class DragAndDrop extends ActionBase {
|
|
|
19983
20023
|
const eventObj = extend({}, this.actionObj.event, null, true);
|
|
19984
20024
|
const eventStart = eventObj[this.parent.eventFields.startTime];
|
|
19985
20025
|
const eventEnd = eventObj[this.parent.eventFields.endTime];
|
|
19986
|
-
const eventDuration = eventEnd
|
|
20026
|
+
const eventDuration = getUniversalTime(eventEnd) - getUniversalTime(eventStart);
|
|
19987
20027
|
let offsetTop = Math.floor(parseInt(this.actionObj.clone.style.top, 10) / this.actionObj.cellHeight)
|
|
19988
20028
|
* this.actionObj.cellHeight;
|
|
19989
20029
|
offsetTop = offsetTop < 0 ? 0 : offsetTop;
|
|
@@ -20338,8 +20378,8 @@ class DragAndDrop extends ActionBase {
|
|
|
20338
20378
|
if (isNullOrUndefined(this.parent.eventDragArea)) {
|
|
20339
20379
|
this.removeCloneElement();
|
|
20340
20380
|
}
|
|
20341
|
-
const eventDuration = eventObj[this.parent.eventFields.endTime]
|
|
20342
|
-
eventObj[this.parent.eventFields.startTime]
|
|
20381
|
+
const eventDuration = getUniversalTime(eventObj[this.parent.eventFields.endTime]) -
|
|
20382
|
+
getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
20343
20383
|
let td = closest(this.actionObj.target, 'td');
|
|
20344
20384
|
if (!isNullOrUndefined(td)) {
|
|
20345
20385
|
const tr = td.parentElement;
|
|
@@ -20352,12 +20392,12 @@ class DragAndDrop extends ActionBase {
|
|
|
20352
20392
|
this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
20353
20393
|
}
|
|
20354
20394
|
const timeString = new Date(currentDate.setDate(currentDate.getDate() - this.daysVariation));
|
|
20355
|
-
|
|
20356
|
-
|
|
20357
|
-
|
|
20358
|
-
|
|
20359
|
-
|
|
20360
|
-
dragEnd
|
|
20395
|
+
const dragStart$$1 = new Date(timeString.getTime());
|
|
20396
|
+
const startTimeDiff = getUniversalTime(eventObj[this.parent.eventFields.startTime]) -
|
|
20397
|
+
getUniversalTime(resetTime(new Date(+eventObj[this.parent.eventFields.startTime])));
|
|
20398
|
+
dragStart$$1.setMilliseconds(startTimeDiff);
|
|
20399
|
+
const dragEnd = new Date(dragStart$$1.getTime());
|
|
20400
|
+
dragEnd.setMilliseconds(eventDuration);
|
|
20361
20401
|
this.actionObj.start = new Date(dragStart$$1.getTime());
|
|
20362
20402
|
this.actionObj.end = new Date(dragEnd.getTime());
|
|
20363
20403
|
}
|
|
@@ -20412,8 +20452,8 @@ class DragAndDrop extends ActionBase {
|
|
|
20412
20452
|
}
|
|
20413
20453
|
calculateTimelineTime(e) {
|
|
20414
20454
|
const eventObj = extend({}, this.actionObj.event, null, true);
|
|
20415
|
-
const eventDuration = eventObj[this.parent.eventFields.endTime]
|
|
20416
|
-
eventObj[this.parent.eventFields.startTime]
|
|
20455
|
+
const eventDuration = getUniversalTime(eventObj[this.parent.eventFields.endTime]) -
|
|
20456
|
+
getUniversalTime(eventObj[this.parent.eventFields.startTime]);
|
|
20417
20457
|
let offsetLeft = this.parent.enableRtl ? Math.abs(this.actionObj.clone.offsetLeft) - this.actionObj.clone.offsetWidth :
|
|
20418
20458
|
parseInt(this.actionObj.clone.style.left, 10);
|
|
20419
20459
|
offsetLeft = Math.floor(offsetLeft / this.actionObj.cellWidth) * this.actionObj.cellWidth;
|
|
@@ -21931,8 +21971,9 @@ class VerticalView extends ViewBase {
|
|
|
21931
21971
|
const msStartHour = startHour.getTime();
|
|
21932
21972
|
const msEndHour = endHour.getTime();
|
|
21933
21973
|
if (msStartHour !== msEndHour) {
|
|
21974
|
+
const duration = this.parent.activeViewOptions.timeScale.interval / this.parent.activeViewOptions.timeScale.slotCount;
|
|
21934
21975
|
length = (Math.abs(msEndHour - msStartHour) / msInterval) - ((new Date(msEndHour).getTimezoneOffset()
|
|
21935
|
-
- new Date(msStartHour).getTimezoneOffset()) /
|
|
21976
|
+
- new Date(msStartHour).getTimezoneOffset()) / duration);
|
|
21936
21977
|
}
|
|
21937
21978
|
if (!this.parent.activeViewOptions.timeScale.enable) {
|
|
21938
21979
|
length = 1;
|
|
@@ -22142,16 +22183,16 @@ class Month extends ViewBase {
|
|
|
22142
22183
|
}
|
|
22143
22184
|
this.setColWidth(content);
|
|
22144
22185
|
if (args.scrollPosition || !args.isPreventScrollUpdate && this.parent.currentView === 'TimelineMonth') {
|
|
22186
|
+
const top = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.top : args.scrollPosition.top;
|
|
22187
|
+
if (leftPanel) {
|
|
22188
|
+
leftPanel.scrollTop = top;
|
|
22189
|
+
}
|
|
22190
|
+
content.scrollTop = top;
|
|
22145
22191
|
if (this.parent.uiStateValues.isInitial) {
|
|
22146
22192
|
this.scrollToSelectedDate();
|
|
22147
22193
|
this.parent.uiStateValues.isInitial = false;
|
|
22148
22194
|
}
|
|
22149
22195
|
else {
|
|
22150
|
-
const top = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.top : args.scrollPosition.top;
|
|
22151
|
-
if (leftPanel) {
|
|
22152
|
-
leftPanel.scrollTop = top;
|
|
22153
|
-
}
|
|
22154
|
-
content.scrollTop = top;
|
|
22155
22196
|
content.scrollLeft = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.left :
|
|
22156
22197
|
args.scrollPosition.left;
|
|
22157
22198
|
}
|
|
@@ -22172,6 +22213,9 @@ class Month extends ViewBase {
|
|
|
22172
22213
|
else {
|
|
22173
22214
|
content.scrollLeft = 0;
|
|
22174
22215
|
}
|
|
22216
|
+
if (content.scrollLeft === 0 && this.parent.uiStateValues.isInitial) {
|
|
22217
|
+
this.parent.uiStateValues.left = 0;
|
|
22218
|
+
}
|
|
22175
22219
|
}
|
|
22176
22220
|
setContentHeight(content, leftPanelElement, height) {
|
|
22177
22221
|
content.style.height = 'auto';
|
|
@@ -22727,6 +22771,9 @@ class Year extends ViewBase {
|
|
|
22727
22771
|
const viewTypeClass = this.parent.activeViewOptions.orientation === 'Horizontal' ? 'e-horizontal' : 'e-vertical';
|
|
22728
22772
|
addClass([this.element], [this.viewClass, viewTypeClass, className]);
|
|
22729
22773
|
this.renderPanel(className);
|
|
22774
|
+
if (this.parent.activeViewOptions.allowVirtualScrolling) {
|
|
22775
|
+
addClass([this.element], [VIRTUAL_SCROLL_CLASS]);
|
|
22776
|
+
}
|
|
22730
22777
|
const calendarTable = this.createTableLayout(OUTER_TABLE_CLASS);
|
|
22731
22778
|
this.element.appendChild(calendarTable);
|
|
22732
22779
|
this.element.querySelector('table').setAttribute('role', 'presentation');
|
|
@@ -22939,6 +22986,7 @@ class Year extends ViewBase {
|
|
|
22939
22986
|
onContentScroll(e) {
|
|
22940
22987
|
const target = e.target;
|
|
22941
22988
|
const headerWrapper = this.getDatesHeaderElement();
|
|
22989
|
+
this.parent.notify(virtualScroll, e);
|
|
22942
22990
|
if (headerWrapper) {
|
|
22943
22991
|
headerWrapper.firstElementChild.scrollLeft = target.scrollLeft;
|
|
22944
22992
|
}
|
|
@@ -23095,8 +23143,11 @@ class AgendaBase extends ViewBase {
|
|
|
23095
23143
|
moduleName: 'agenda',
|
|
23096
23144
|
listClass: this.parent.activeView.viewClass,
|
|
23097
23145
|
itemClass: this.parent.activeView.viewClass,
|
|
23098
|
-
template:
|
|
23146
|
+
template: `<div class="${AGENDA_NO_EVENT_CLASS}">${this.parent.localeObj.getConstant('noEvents')}</div>`
|
|
23099
23147
|
});
|
|
23148
|
+
if (listElement.querySelector('.e-agenda-item').children.length === 0) {
|
|
23149
|
+
listElement.firstElementChild.appendChild(createElement('div', { className: AGENDA_NO_EVENT_CLASS, innerHTML: this.parent.localeObj.getConstant('noEvents') }));
|
|
23150
|
+
}
|
|
23100
23151
|
}
|
|
23101
23152
|
else {
|
|
23102
23153
|
listElement = ListBase.createList(this.parent.createElement, listData, {
|
|
@@ -24639,7 +24690,7 @@ class TimelineYear extends Year {
|
|
|
24639
24690
|
!this.parent.uiStateValues.isGroupAdaptive) {
|
|
24640
24691
|
tdCollection.push(firstTd);
|
|
24641
24692
|
firstTd.appendChild(this.parent.resourceBase.createResourceColumn());
|
|
24642
|
-
this.rowCount = this.parent.resourceBase.
|
|
24693
|
+
this.rowCount = this.parent.resourceBase.renderedResources.length;
|
|
24643
24694
|
}
|
|
24644
24695
|
else {
|
|
24645
24696
|
tdCollection.push(firstTd);
|
|
@@ -24656,6 +24707,9 @@ class TimelineYear extends Year {
|
|
|
24656
24707
|
content.appendChild(contentTable);
|
|
24657
24708
|
const eventWrapper = createElement('div', { className: EVENT_TABLE_CLASS });
|
|
24658
24709
|
content.appendChild(eventWrapper);
|
|
24710
|
+
if (this.parent.virtualScrollModule) {
|
|
24711
|
+
this.parent.virtualScrollModule.renderVirtualTrack(content);
|
|
24712
|
+
}
|
|
24659
24713
|
const contentTBody = contentTable.querySelector('tbody');
|
|
24660
24714
|
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
24661
24715
|
if (this.parent.rowAutoHeight) {
|
|
@@ -24773,6 +24827,47 @@ class TimelineYear extends Year {
|
|
|
24773
24827
|
}
|
|
24774
24828
|
}
|
|
24775
24829
|
}
|
|
24830
|
+
getContentRows() {
|
|
24831
|
+
const tRow = [];
|
|
24832
|
+
const monthCells = this.getMonths();
|
|
24833
|
+
for (let row = 0; row < this.parent.resourceBase.renderedResources.length; row++) {
|
|
24834
|
+
const tr = createElement('tr', { attrs: { 'role': 'row' } });
|
|
24835
|
+
tRow.push(tr);
|
|
24836
|
+
let resData;
|
|
24837
|
+
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
24838
|
+
resData = this.parent.resourceBase.renderedResources[row];
|
|
24839
|
+
}
|
|
24840
|
+
let monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[row], 1);
|
|
24841
|
+
let date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
24842
|
+
for (let month = 0; month < this.columnCount; month++) {
|
|
24843
|
+
let classList$$1 = [];
|
|
24844
|
+
const groupIndex = resData.groupIndex;
|
|
24845
|
+
classList$$1 = classList$$1.concat(resData.className);
|
|
24846
|
+
if (classList$$1.indexOf(RESOURCE_PARENT_CLASS) > -1) {
|
|
24847
|
+
classList$$1.push(RESOURCE_GROUP_CELLS_CLASS);
|
|
24848
|
+
}
|
|
24849
|
+
else {
|
|
24850
|
+
classList$$1.push(WORKDAY_CLASS);
|
|
24851
|
+
}
|
|
24852
|
+
monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[month], 1);
|
|
24853
|
+
date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
24854
|
+
const tdELe = createElement('td', {
|
|
24855
|
+
className: WORK_CELLS_CLASS,
|
|
24856
|
+
attrs: {
|
|
24857
|
+
'role': 'gridcell', 'aria-selected': 'false',
|
|
24858
|
+
'data-date': date.getTime().toString()
|
|
24859
|
+
}
|
|
24860
|
+
});
|
|
24861
|
+
addClass([tdELe], classList$$1);
|
|
24862
|
+
tdELe.setAttribute('data-group-index', groupIndex.toString());
|
|
24863
|
+
this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, tdELe);
|
|
24864
|
+
this.wireEvents(tdELe, 'cell');
|
|
24865
|
+
this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: tdELe, date: date });
|
|
24866
|
+
tr.appendChild(tdELe);
|
|
24867
|
+
}
|
|
24868
|
+
}
|
|
24869
|
+
return tRow;
|
|
24870
|
+
}
|
|
24776
24871
|
renderResourceContent(wrapper, monthBody, contentBody) {
|
|
24777
24872
|
const months = this.getMonths();
|
|
24778
24873
|
for (let row = 0; row < this.rowCount; row++) {
|
|
@@ -24780,8 +24875,8 @@ class TimelineYear extends Year {
|
|
|
24780
24875
|
const tr = createElement('tr', { attrs: { 'role': 'row' } });
|
|
24781
24876
|
contentBody.appendChild(tr);
|
|
24782
24877
|
let resData;
|
|
24783
|
-
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
24784
|
-
resData = this.parent.resourceBase.
|
|
24878
|
+
if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
24879
|
+
resData = this.parent.resourceBase.renderedResources[row];
|
|
24785
24880
|
}
|
|
24786
24881
|
let monthDate = new Date(this.parent.selectedDate.getFullYear(), months[row], 1);
|
|
24787
24882
|
let date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
|
|
@@ -24802,8 +24897,9 @@ class TimelineYear extends Year {
|
|
|
24802
24897
|
}
|
|
24803
24898
|
for (let month = 0; month < this.columnCount; month++) {
|
|
24804
24899
|
let classList$$1 = [];
|
|
24805
|
-
let groupIndex
|
|
24900
|
+
let groupIndex;
|
|
24806
24901
|
if (this.parent.activeViewOptions.orientation === 'Vertical') {
|
|
24902
|
+
groupIndex = resData.groupIndex;
|
|
24807
24903
|
classList$$1 = classList$$1.concat(resData.className);
|
|
24808
24904
|
if (classList$$1.indexOf(RESOURCE_PARENT_CLASS) > -1) {
|
|
24809
24905
|
classList$$1.push(RESOURCE_GROUP_CELLS_CLASS);
|
|
@@ -24905,7 +25001,7 @@ class ICalendarExport {
|
|
|
24905
25001
|
const editedExDate = [];
|
|
24906
25002
|
if (eventObj[fields.recurrenceID]) {
|
|
24907
25003
|
const filter = this.filterEvents(filterCollection, fields.id, eventObj[fields.recurrenceID]);
|
|
24908
|
-
uId = filter[0].UID;
|
|
25004
|
+
uId = filter.length > 0 ? filter[0].UID : uId;
|
|
24909
25005
|
}
|
|
24910
25006
|
if (!eventObj[fields.recurrenceID] && eventObj[fields.recurrenceRule] && eventObj[fields.recurrenceException]) {
|
|
24911
25007
|
const exDate = (eventObj[fields.recurrenceException]).split(',');
|