@syncfusion/ej2-schedule 27.1.55 → 27.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/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 +68 -13
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +68 -13
- 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 +9 -9
- package/src/recurrence-editor/date-generator.js +4 -3
- package/src/schedule/base/constant.d.ts +8 -0
- package/src/schedule/base/constant.js +8 -0
- package/src/schedule/event-renderer/agenda-base.d.ts +1 -1
- package/src/schedule/event-renderer/agenda-base.js +16 -1
- package/src/schedule/event-renderer/event-base.d.ts +2 -0
- package/src/schedule/event-renderer/event-base.js +32 -5
- package/src/schedule/renderer/agenda.js +5 -1
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.57
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-schedule@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-schedule@27.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-schedule@27.1.56",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-YIlG9bJsGCuonDNYM09yocSiXcLknCUFzXopeuZ5GhZSnZmQyAMVwGViZW9BZxHVzlgbQ24Trg6Rzf1SO+3O6Q==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-schedule",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-schedule",
|
|
24
24
|
"/@syncfusion/ej2-vue-schedule"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-27.1.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-27.1.56.tgz",
|
|
27
|
+
"_shasum": "f1385b2a923b0dc507f2abd750598c7c31f22a94",
|
|
28
28
|
"_spec": "@syncfusion/ej2-schedule@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@syncfusion/ej2-base": "~27.1.55",
|
|
39
39
|
"@syncfusion/ej2-buttons": "~27.1.53",
|
|
40
|
-
"@syncfusion/ej2-calendars": "~27.1.
|
|
40
|
+
"@syncfusion/ej2-calendars": "~27.1.57",
|
|
41
41
|
"@syncfusion/ej2-data": "~27.1.52",
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~27.1.
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~27.1.57",
|
|
43
43
|
"@syncfusion/ej2-excel-export": "~27.1.50",
|
|
44
44
|
"@syncfusion/ej2-inputs": "~27.1.55",
|
|
45
45
|
"@syncfusion/ej2-lists": "~27.1.50",
|
|
46
|
-
"@syncfusion/ej2-navigations": "~27.1.
|
|
47
|
-
"@syncfusion/ej2-popups": "~27.1.
|
|
46
|
+
"@syncfusion/ej2-navigations": "~27.1.57",
|
|
47
|
+
"@syncfusion/ej2-popups": "~27.1.57"
|
|
48
48
|
},
|
|
49
49
|
"deprecated": false,
|
|
50
50
|
"description": "Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
|
|
74
74
|
},
|
|
75
75
|
"typings": "index.d.ts",
|
|
76
|
-
"version": "27.1.
|
|
76
|
+
"version": "27.1.57",
|
|
77
77
|
"sideEffects": false
|
|
78
78
|
}
|
|
@@ -153,7 +153,7 @@ export function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCo
|
|
|
153
153
|
dailyType(modifiedDate, ruleObject.until, data, ruleObject);
|
|
154
154
|
break;
|
|
155
155
|
case 'WEEKLY':
|
|
156
|
-
weeklyType(modifiedDate, ruleObject.until, data, ruleObject);
|
|
156
|
+
weeklyType(modifiedDate, ruleObject.until, data, ruleObject, startDayOfWeek);
|
|
157
157
|
break;
|
|
158
158
|
case 'MONTHLY':
|
|
159
159
|
monthlyType(modifiedDate, ruleObject.until, data, ruleObject);
|
|
@@ -256,10 +256,11 @@ function dailyType(startDate, endDate, data, ruleObject) {
|
|
|
256
256
|
* @param {Date} endDate Accepts the end date
|
|
257
257
|
* @param {number[]} data Accepts the collection of dates
|
|
258
258
|
* @param {RecRule} ruleObject Accepts the recurrence rule object
|
|
259
|
+
* @param {number} startDayOfWeek Accepts the start day index of week
|
|
259
260
|
* @returns {void}
|
|
260
261
|
* @private
|
|
261
262
|
*/
|
|
262
|
-
function weeklyType(startDate, endDate, data, ruleObject) {
|
|
263
|
+
function weeklyType(startDate, endDate, data, ruleObject, startDayOfWeek) {
|
|
263
264
|
var tempDate = new Date(startDate.getTime());
|
|
264
265
|
if (!ruleObject.day.length) {
|
|
265
266
|
ruleObject.day.push(DAYINDEX[startDate.getDay()]);
|
|
@@ -308,7 +309,7 @@ function weeklyType(startDate, endDate, data, ruleObject) {
|
|
|
308
309
|
}
|
|
309
310
|
else {
|
|
310
311
|
tempDate = getStartDateForWeek(startDate, ruleObject.day);
|
|
311
|
-
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < startDate.getDay()) {
|
|
312
|
+
if (interval > 1 && dayIndex.indexOf(ruleObject.day[0]) < (startDate.getDay() - startDayOfWeek)) {
|
|
312
313
|
tempDate.setDate(tempDate.getDate() + ((interval - 1) * 7));
|
|
313
314
|
}
|
|
314
315
|
while (compareDates(tempDate, endDate)) {
|
|
@@ -55,6 +55,14 @@ export declare const cellSelect: string;
|
|
|
55
55
|
export declare const virtualScrollStart: string;
|
|
56
56
|
/** @private */
|
|
57
57
|
export declare const virtualScrollStop: string;
|
|
58
|
+
/** @private */
|
|
59
|
+
export declare const noEvents: string;
|
|
60
|
+
/** @private */
|
|
61
|
+
export declare const agendaCells: string;
|
|
62
|
+
/** @private */
|
|
63
|
+
export declare const resourceHeader: string;
|
|
64
|
+
/** @private */
|
|
65
|
+
export declare const dateHeader: string;
|
|
58
66
|
/**
|
|
59
67
|
* Specifies schedule internal events
|
|
60
68
|
*/
|
|
@@ -55,6 +55,14 @@ export var cellSelect = 'cellSelect';
|
|
|
55
55
|
export var virtualScrollStart = 'virtualScrollStart';
|
|
56
56
|
/** @private */
|
|
57
57
|
export var virtualScrollStop = 'virtualScrollStop';
|
|
58
|
+
/** @private */
|
|
59
|
+
export var noEvents = 'noEvents';
|
|
60
|
+
/** @private */
|
|
61
|
+
export var agendaCells = 'agendaCells';
|
|
62
|
+
/** @private */
|
|
63
|
+
export var resourceHeader = 'resourceHeader';
|
|
64
|
+
/** @private */
|
|
65
|
+
export var dateHeader = 'dateHeader';
|
|
58
66
|
/**
|
|
59
67
|
* Specifies schedule internal events
|
|
60
68
|
*/
|
|
@@ -9,7 +9,7 @@ export declare class AgendaBase extends ViewBase {
|
|
|
9
9
|
calculateResourceTableElement(tBody: Element, noOfDays: number, agendaDate: Date, agendaEnd?: Date): void;
|
|
10
10
|
private createResourceTableRow;
|
|
11
11
|
createDateHeaderElement(date: Date): Element;
|
|
12
|
-
renderEmptyContent(tBody: Element, agendaDate: Date): void;
|
|
12
|
+
renderEmptyContent(tBody: Element, agendaDate: Date, hasNoEvents?: boolean): void;
|
|
13
13
|
createTableRowElement(date: Date, type: string): Element;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
}
|
|
@@ -335,12 +335,24 @@ var AgendaBase = /** @class */ (function (_super) {
|
|
|
335
335
|
}
|
|
336
336
|
else if (data.type === 'eventColumn') {
|
|
337
337
|
var elementType = (data.eventData.length === 0) ? 'noEvents' : 'data';
|
|
338
|
+
for (var i = 0; i < ntr.childNodes.length; i++) {
|
|
339
|
+
var currentElement = ntr.childNodes.item(i);
|
|
340
|
+
var renderCellElementType = currentElement.classList.contains('e-resource-column') ?
|
|
341
|
+
event.resourceHeader : event.dateHeader;
|
|
342
|
+
this.parent.trigger(event.renderCell, {
|
|
343
|
+
elementType: renderCellElementType, element: currentElement, date: data.date, groupIndex: data.groupIndex
|
|
344
|
+
});
|
|
345
|
+
}
|
|
338
346
|
ntd = this.createAgendaContentElement(elementType, data.eventData, ntd, data.groupOrder, data.groupIndex);
|
|
339
347
|
ntd.setAttribute('data-date', data.date.getTime().toString());
|
|
340
348
|
if (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') {
|
|
341
349
|
addClass([ntd], [cls.AGENDA_CELLS_CLASS, cls.AGENDA_DAY_PADDING_CLASS]);
|
|
342
350
|
}
|
|
343
351
|
ntr.appendChild(ntd);
|
|
352
|
+
var renderCellType = (data.eventData.length === 0) ? event.noEvents : event.agendaCells;
|
|
353
|
+
this.parent.trigger(event.renderCell, {
|
|
354
|
+
elementType: renderCellType, element: ntd, date: data.date, groupIndex: data.groupIndex
|
|
355
|
+
});
|
|
344
356
|
}
|
|
345
357
|
else {
|
|
346
358
|
ntd.setAttribute('rowspan', data.rowSpan.toString());
|
|
@@ -381,7 +393,7 @@ var AgendaBase = /** @class */ (function (_super) {
|
|
|
381
393
|
}
|
|
382
394
|
return dateHeader;
|
|
383
395
|
};
|
|
384
|
-
AgendaBase.prototype.renderEmptyContent = function (tBody, agendaDate) {
|
|
396
|
+
AgendaBase.prototype.renderEmptyContent = function (tBody, agendaDate, hasNoEvents) {
|
|
385
397
|
var eTr = this.createTableRowElement(agendaDate, 'noEvents');
|
|
386
398
|
var eTd = eTr.children[0];
|
|
387
399
|
var noEvents = createElement('div', {
|
|
@@ -390,6 +402,9 @@ var AgendaBase = /** @class */ (function (_super) {
|
|
|
390
402
|
});
|
|
391
403
|
eTd.appendChild(noEvents);
|
|
392
404
|
tBody.appendChild(eTr);
|
|
405
|
+
if (hasNoEvents) {
|
|
406
|
+
this.parent.trigger(event.renderCell, { elementType: event.noEvents, element: eTd, date: agendaDate });
|
|
407
|
+
}
|
|
393
408
|
};
|
|
394
409
|
AgendaBase.prototype.createTableRowElement = function (date, type) {
|
|
395
410
|
var daysCount = util.getDaysCount(this.parent.selectedDate.getTime(), date.getTime());
|
|
@@ -42,6 +42,7 @@ export declare class EventBase {
|
|
|
42
42
|
getSelectedAppointments(): Element[];
|
|
43
43
|
focusElement(isFocused?: boolean): void;
|
|
44
44
|
selectWorkCellByTime(eventsData: Record<string, any>[]): Element;
|
|
45
|
+
private findNearestSlot;
|
|
45
46
|
getGroupIndexFromEvent(eventData: Record<string, any>): number;
|
|
46
47
|
isAllDayAppointment(event: Record<string, any>): boolean;
|
|
47
48
|
addEventListener(): void;
|
|
@@ -59,6 +60,7 @@ export declare class EventBase {
|
|
|
59
60
|
getEventMaxID(resourceId?: number): number | string;
|
|
60
61
|
private activeEventData;
|
|
61
62
|
generateOccurrence(event: Record<string, any>, viewDate?: Date, isMaxCount?: boolean): Record<string, any>[];
|
|
63
|
+
private isDayBasedRecurrence;
|
|
62
64
|
private getDSTAdjustedTime;
|
|
63
65
|
private getDSTDiff;
|
|
64
66
|
getParentEvent(eventObj: Record<string, any>, isParent?: boolean): Record<string, any>;
|
|
@@ -584,11 +584,14 @@ var EventBase = /** @class */ (function () {
|
|
|
584
584
|
if (eventsData.length > 0) {
|
|
585
585
|
var selectedObject = eventsData[eventsData.length - 1];
|
|
586
586
|
var eventStartTime = selectedObject[this.parent.eventFields.startTime];
|
|
587
|
-
var nearestTime =
|
|
587
|
+
var nearestTime = void 0;
|
|
588
588
|
var isAllDay = this.isAllDayAppointment(selectedObject);
|
|
589
|
-
if (this.parent.currentView === 'Month' || isAllDay) {
|
|
589
|
+
if (this.parent.currentView === 'Month' || isAllDay || !this.parent.activeViewOptions.timeScale.enable) {
|
|
590
590
|
nearestTime = new Date(+eventStartTime).setHours(0, 0, 0, 0);
|
|
591
591
|
}
|
|
592
|
+
else {
|
|
593
|
+
nearestTime = this.findNearestSlot(eventStartTime);
|
|
594
|
+
}
|
|
592
595
|
var targetArea = void 0;
|
|
593
596
|
if (isAllDay && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) !== -1) {
|
|
594
597
|
targetArea = this.parent.getAllDayRow();
|
|
@@ -597,7 +600,8 @@ var EventBase = /** @class */ (function () {
|
|
|
597
600
|
targetArea = this.parent.getContentTable();
|
|
598
601
|
}
|
|
599
602
|
var queryString = '[data-date="' + new Date(nearestTime).getTime() + '"]';
|
|
600
|
-
if (this.parent.activeViewOptions.group.resources
|
|
603
|
+
if (!isNullOrUndefined(this.parent.activeViewOptions.group.resources) &&
|
|
604
|
+
this.parent.activeViewOptions.group.resources.length > 0) {
|
|
601
605
|
queryString += '[data-group-index="' + this.getGroupIndexFromEvent(selectedObject) + '"]';
|
|
602
606
|
}
|
|
603
607
|
target = targetArea.querySelector(queryString);
|
|
@@ -611,6 +615,25 @@ var EventBase = /** @class */ (function () {
|
|
|
611
615
|
}
|
|
612
616
|
return target;
|
|
613
617
|
};
|
|
618
|
+
EventBase.prototype.findNearestSlot = function (appointmentTime) {
|
|
619
|
+
var msMajorInterval = this.parent.activeViewOptions.timeScale.interval * util.MS_PER_MINUTE;
|
|
620
|
+
var msInterval = msMajorInterval / this.parent.activeViewOptions.timeScale.slotCount;
|
|
621
|
+
var numberOfSlots = Math.round(util.MS_PER_DAY / msInterval);
|
|
622
|
+
var startTime = new Date(appointmentTime);
|
|
623
|
+
startTime.setHours(0, 0, 0, 0);
|
|
624
|
+
var slots = Array.from({ length: numberOfSlots }, function (_, i) {
|
|
625
|
+
var slotTime = new Date(startTime.getTime() + i * msInterval);
|
|
626
|
+
return slotTime;
|
|
627
|
+
});
|
|
628
|
+
var nearestSlot = slots.reduce(function (nearest, slot) {
|
|
629
|
+
var difference = Math.abs(appointmentTime.getTime() - slot.getTime());
|
|
630
|
+
if (!nearest || difference < Math.abs(appointmentTime.getTime() - nearest.getTime())) {
|
|
631
|
+
return slot;
|
|
632
|
+
}
|
|
633
|
+
return nearest;
|
|
634
|
+
}, null);
|
|
635
|
+
return Math.trunc(nearestSlot.getTime() / 1000) * 1000;
|
|
636
|
+
};
|
|
614
637
|
EventBase.prototype.getGroupIndexFromEvent = function (eventData) {
|
|
615
638
|
var levelIndex;
|
|
616
639
|
var resource;
|
|
@@ -912,7 +935,7 @@ var EventBase = /** @class */ (function () {
|
|
|
912
935
|
var newTimezone = this.parent.timezone || this.parent.tzModule.getLocalTimezoneName();
|
|
913
936
|
var firstDay = this.parent.activeViewOptions.firstDayOfWeek;
|
|
914
937
|
var calendarMode = this.parent.calendarMode;
|
|
915
|
-
if (event[this.parent.eventFields.recurrenceRule] &&
|
|
938
|
+
if (event[this.parent.eventFields.recurrenceRule] && this.isDayBasedRecurrence(event) &&
|
|
916
939
|
this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
|
|
917
940
|
startDate = this.parent.tzModule.convert(event[this.parent.eventFields.startTime], this.parent.timezone, event[this.parent.eventFields.startTimezone]);
|
|
918
941
|
}
|
|
@@ -932,7 +955,7 @@ var EventBase = /** @class */ (function () {
|
|
|
932
955
|
}
|
|
933
956
|
var isDSTAdjusted = false;
|
|
934
957
|
var convertedDates = [];
|
|
935
|
-
if (event[this.parent.eventFields.recurrenceRule] &&
|
|
958
|
+
if (event[this.parent.eventFields.recurrenceRule] && this.isDayBasedRecurrence(event) &&
|
|
936
959
|
this.parent.timezone && event[this.parent.eventFields.startTimezone] && event[this.parent.eventFields.endTimezone]) {
|
|
937
960
|
isDSTAdjusted = true;
|
|
938
961
|
convertedDates.push.apply(convertedDates, dates.map(function (date) {
|
|
@@ -955,6 +978,10 @@ var EventBase = /** @class */ (function () {
|
|
|
955
978
|
}
|
|
956
979
|
return occurrenceCollection;
|
|
957
980
|
};
|
|
981
|
+
EventBase.prototype.isDayBasedRecurrence = function (event) {
|
|
982
|
+
return (event[this.parent.eventFields.recurrenceRule].includes('BYMONTHDAY')
|
|
983
|
+
|| event[this.parent.eventFields.recurrenceRule].includes('BYDAY'));
|
|
984
|
+
};
|
|
958
985
|
EventBase.prototype.getDSTAdjustedTime = function (date, event) {
|
|
959
986
|
var occurDate = date;
|
|
960
987
|
if (this.parent.timezone &&
|
|
@@ -142,7 +142,7 @@ var Agenda = /** @class */ (function (_super) {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
if (tBody.childNodes.length <= 0) {
|
|
145
|
-
this.renderEmptyContent(tBody, agendaDate);
|
|
145
|
+
this.renderEmptyContent(tBody, agendaDate, true);
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
Agenda.prototype.renderContent = function (tBody, agendaDate, lastDate) {
|
|
@@ -200,11 +200,15 @@ var Agenda = /** @class */ (function (_super) {
|
|
|
200
200
|
var elementType = (!this.parent.hideEmptyAgendaDays && filterData.length === 0) ? 'noEvents' : 'data';
|
|
201
201
|
dTd.appendChild(this.createDateHeaderElement(agendaDate));
|
|
202
202
|
nTr.appendChild(dTd);
|
|
203
|
+
this.parent.trigger(event.renderCell, { elementType: event.dateHeader, element: dTd, date: agendaDate });
|
|
203
204
|
var cTd = this.createAgendaContentElement(elementType, filterData, aTd);
|
|
204
205
|
nTr.appendChild(cTd);
|
|
205
206
|
if (cTd.querySelectorAll('li').length > 0) {
|
|
206
207
|
tBody.appendChild(nTr);
|
|
207
208
|
}
|
|
209
|
+
var renderCellElementType = (!this.parent.hideEmptyAgendaDays && filterData.length === 0) ?
|
|
210
|
+
event.noEvents : event.agendaCells;
|
|
211
|
+
this.parent.trigger(event.renderCell, { elementType: renderCellElementType, element: cTd, date: agendaDate });
|
|
208
212
|
}
|
|
209
213
|
else if (this.parent.activeViewOptions.allowVirtualScrolling) {
|
|
210
214
|
day--;
|