@syncfusion/ej2-schedule
Advanced tools
Comparing version 16.1.26 to 16.1.28
@@ -7,2 +7,11 @@ # Changelog | ||
#### Bug Fixes | ||
- Problem with all-day appointments that are created for spanned timeline in work week view is fixed. | ||
- Traversing order of appointments while pressing `Tab` key and `Shift+Tab` combination keys is corrected. | ||
## 16.1.24 (2018-02-22) | ||
### Schedule | ||
Schedule is an event calendar which facilitates user with the common Outlook-calendar features, thus allowing the users to plan and manage their appointments and its time in an efficient way. | ||
@@ -9,0 +18,0 @@ |
/*! | ||
* filename: index.d.ts | ||
* version : 0.31.0 | ||
* version : 16.1.26 | ||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. | ||
@@ -18,2 +18,5 @@ * Use of this code is subject to the terms of our license. | ||
import * as _dropdowns from '@syncfusion/ej2-dropdowns'; | ||
import * as _buttons from '@syncfusion/ej2-buttons'; | ||
import * as _inputs from '@syncfusion/ej2-inputs'; | ||
import * as _lists from '@syncfusion/ej2-lists'; | ||
@@ -28,2 +31,5 @@ export declare namespace ej { | ||
const dropdowns: typeof _dropdowns; | ||
const buttons: typeof _buttons; | ||
const inputs: typeof _inputs; | ||
const lists: typeof _lists; | ||
} |
{ | ||
"name": "@syncfusion/ej2-schedule", | ||
"version": "16.1.26", | ||
"version": "16.1.28", | ||
"description": "Essential JS 2 Schedule Component", | ||
@@ -11,8 +11,11 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "^16.1.26", | ||
"@syncfusion/ej2-data": "^16.1.26", | ||
"@syncfusion/ej2-popups": "^16.1.26", | ||
"@syncfusion/ej2-calendars": "^16.1.26", | ||
"@syncfusion/ej2-navigations": "^16.1.26", | ||
"@syncfusion/ej2-dropdowns": "^16.1.26" | ||
"@syncfusion/ej2-base": "~16.1.28", | ||
"@syncfusion/ej2-data": "~16.1.28", | ||
"@syncfusion/ej2-popups": "~16.1.28", | ||
"@syncfusion/ej2-calendars": "~16.1.28", | ||
"@syncfusion/ej2-navigations": "~16.1.28", | ||
"@syncfusion/ej2-dropdowns": "~16.1.28", | ||
"@syncfusion/ej2-buttons": "~16.1.28", | ||
"@syncfusion/ej2-inputs": "~16.1.28", | ||
"@syncfusion/ej2-lists": "~16.1.28" | ||
}, | ||
@@ -19,0 +22,0 @@ "devDependencies": { |
@@ -12,3 +12,2 @@ import { Schedule } from '../base/schedule'; | ||
private selectedCells; | ||
private selectedEvents; | ||
private keyConfigs; | ||
@@ -30,8 +29,9 @@ private keyboardModule; | ||
selectCells(isMultiple: boolean, target: HTMLTableCellElement): void; | ||
private selectAppointments(isReverse, target, isMoreEvent); | ||
private getNextAppointment(isReverse, target, isMoreEvent); | ||
private getAppointmentSeriesElements(isMoreEvent); | ||
private getSelectedSeriesElement(target, isReverse, isMoreEvent); | ||
private getSelectedSeriesCell(target); | ||
private selectAppointment(isReverse, target, isMoreEvent?); | ||
private selectAppointmentElementFromWorkCell(isReverse, target); | ||
private getAllDayCells(cells); | ||
private getAppointmentElements(); | ||
private getAppointmentElementsByGuid(guid); | ||
private getUniqueAppointmentElements(); | ||
private getWorkCellFromAppointmentElement(target); | ||
private processViewNavigation(e); | ||
@@ -38,0 +38,0 @@ private processUp(e, isMultiple); |
@@ -7,3 +7,2 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../base/constant", "../base/util", "../base/css-constant"], function (require, exports, ej2_base_1, ej2_base_2, event, util, cls) { | ||
this.selectedCells = []; | ||
this.selectedEvents = []; | ||
this.keyConfigs = { | ||
@@ -166,3 +165,3 @@ downArrow: 'downarrow', | ||
if (target.classList.contains(cls.APPOINTMENT_CLASS) || target.classList.contains(cls.MORE_EVENT_CLOSE_CLASS) || | ||
target.classList.contains(cls.ALLDAY_APPOINTMENT_SECTION_CLASS)) { | ||
target.classList.contains(cls.ALLDAY_APPOINTMENT_SECTION_CLASS) || target.classList.contains(cls.MORE_INDICATOR_CLASS)) { | ||
target.click(); | ||
@@ -238,129 +237,55 @@ return; | ||
}; | ||
KeyboardInteraction.prototype.selectAppointments = function (isReverse, target, isMoreEvent) { | ||
KeyboardInteraction.prototype.selectAppointment = function (isReverse, target, isMoreEvent) { | ||
if (isMoreEvent === void 0) { isMoreEvent = false; } | ||
var appointments; | ||
if (isMoreEvent) { | ||
var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_EVENT_WRAPPER_CLASS); | ||
appointments = [].slice.call(moreEventWrapper.children); | ||
} | ||
else { | ||
appointments = this.getAppointmentElements(); | ||
} | ||
if (appointments.length < 0) { | ||
return; | ||
} | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
if (!isMoreEvent) { | ||
this.parent.removeSelectedClass(); | ||
} | ||
this.selectedEvents = []; | ||
var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_EVENT_WRAPPER_CLASS); | ||
var nextAppEle; | ||
if (target.classList.contains(cls.APPOINTMENT_CLASS)) { | ||
var selectedElement = this.getNextAppointment(isReverse, target, isMoreEvent); | ||
if (!ej2_base_2.isNullOrUndefined(selectedElement)) { | ||
this.selectedEvents.push({ | ||
event: this.parent.eventBase.getEventByGuid(selectedElement.getAttribute('data-guid')), | ||
element: selectedElement | ||
}); | ||
var focusElements = isMoreEvent ? [].slice.call(moreEventWrapper. | ||
querySelectorAll('div[data-guid="' + selectedElement.getAttribute('data-guid') + '"]')) : | ||
[].slice.call(this.parent.element. | ||
querySelectorAll('div[data-guid="' + selectedElement.getAttribute('data-guid') + '"]')); | ||
this.parent.eventBase.addSelectedAppointments(focusElements, focusElements[focusElements.length - 1]); | ||
if (selectedElement.classList.contains(cls.EVENT_COUNT_CLASS)) { | ||
this.parent.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_SECTION_CLASS).click(); | ||
} | ||
(focusElements[focusElements.length - 1]).focus(); | ||
} | ||
else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') { | ||
this.parent.eventBase.addSelectedAppointments([target], target); | ||
target.focus(); | ||
} | ||
var targetIndex = appointments.indexOf(target); | ||
nextAppEle = appointments[(isReverse ? targetIndex - 1 : targetIndex + 1)]; | ||
} | ||
else { | ||
var focusFirstElement = (target.classList.contains(cls.WORK_CELLS_CLASS) || | ||
target.classList.contains(cls.ALLDAY_CELLS_CLASS)) ? | ||
this.getSelectedSeriesElement(target, isReverse, isMoreEvent) : this.getAppointmentSeriesElements(isMoreEvent); | ||
if (focusFirstElement.length > 0) { | ||
var focusElement = isReverse ? focusFirstElement[focusFirstElement.length - 1] : focusFirstElement[0]; | ||
this.selectedEvents.push({ | ||
event: this.parent.eventBase.getEventByGuid(focusElement.getAttribute('data-guid')), | ||
element: focusElement | ||
}); | ||
var focusElements = isMoreEvent ? [].slice.call(moreEventWrapper. | ||
querySelectorAll('div[data-guid="' + focusElement.getAttribute('data-guid') + '"]')) : | ||
[].slice.call(this.parent.element. | ||
querySelectorAll('div[data-guid="' + focusElement.getAttribute('data-guid') + '"]')); | ||
this.parent.eventBase.addSelectedAppointments(focusElements, focusElements[focusElements.length - 1]); | ||
(focusElements[focusElements.length - 1]).focus(); | ||
} | ||
nextAppEle = isReverse ? appointments[appointments.length - 1] : appointments[0]; | ||
} | ||
if (nextAppEle) { | ||
this.parent.eventBase.addSelectedAppointments([nextAppEle], nextAppEle); | ||
nextAppEle.focus(); | ||
} | ||
}; | ||
KeyboardInteraction.prototype.getNextAppointment = function (isReverse, target, isMoreEvent) { | ||
KeyboardInteraction.prototype.selectAppointmentElementFromWorkCell = function (isReverse, target) { | ||
var _this = this; | ||
var appointmentElements = this.getAppointmentSeriesElements(isMoreEvent); | ||
var moreEventWrapper = this.parent.element.querySelector('.' + cls.MORE_EVENT_WRAPPER_CLASS); | ||
var nextElement = null; | ||
appointmentElements.filter(function (element, index) { | ||
if (element.getAttribute('data-guid') === target.getAttribute('data-guid')) { | ||
var focusElements = isMoreEvent ? [].slice.call(moreEventWrapper. | ||
querySelectorAll('div[data-guid="' + element.getAttribute('data-guid') + '"]')) : | ||
[].slice.call(_this.parent.element. | ||
querySelectorAll('div[data-guid="' + element.getAttribute('data-guid') + '"]')); | ||
if (isReverse) { | ||
nextElement = (!ej2_base_2.isNullOrUndefined(appointmentElements[index - 1]) && | ||
appointmentElements[index - 1].getAttribute('data-guid') === target.getAttribute('data-guid')) ? | ||
appointmentElements[index - focusElements.length] : appointmentElements[index - 1]; | ||
} | ||
else { | ||
nextElement = (!ej2_base_2.isNullOrUndefined(appointmentElements[index + 1]) && | ||
appointmentElements[index + 1].getAttribute('data-guid') === target.getAttribute('data-guid')) ? | ||
appointmentElements[index + (focusElements.length - 1)] : appointmentElements[index + 1]; | ||
} | ||
return; | ||
} | ||
}); | ||
return nextElement; | ||
}; | ||
KeyboardInteraction.prototype.getAppointmentSeriesElements = function (isMoreEvent) { | ||
var appointmentElements = []; | ||
var moreEventList = []; | ||
var appointments = [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS)); | ||
if (isMoreEvent) { | ||
moreEventList = [].slice.call(this.parent.element. | ||
querySelector('.' + cls.MORE_EVENT_WRAPPER_CLASS).children); | ||
} | ||
this.parent.eventsProcessed.filter(function (eventObject) { | ||
appointments.filter(function (element) { | ||
if (JSON.stringify(eventObject.Guid) === JSON.stringify(element.getAttribute('data-guid'))) { | ||
appointmentElements.push(element); | ||
} | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
this.parent.removeSelectedClass(); | ||
if (target.classList.contains(cls.WORK_CELLS_CLASS) || target.classList.contains(cls.ALLDAY_CELLS_CLASS)) { | ||
var appointmentElements_1 = this.getUniqueAppointmentElements(); | ||
var filteredElements_1 = []; | ||
var selectedDate_1 = parseInt(target.getAttribute('data-date'), 10); | ||
var selectedSeriesEvents = this.parent.eventsProcessed.filter(function (eventObject) { | ||
return (!isReverse ? (eventObject[_this.parent.eventFields.startTime].getTime() >= selectedDate_1) : | ||
(eventObject[_this.parent.eventFields.startTime].getTime() <= selectedDate_1)); | ||
}); | ||
}); | ||
return (this.parent.currentView === 'Agenda' || | ||
this.parent.currentView === 'MonthAgenda') ? appointments : isMoreEvent ? moreEventList : appointmentElements; | ||
}; | ||
KeyboardInteraction.prototype.getSelectedSeriesElement = function (target, isReverse, isMoreEvent) { | ||
var fields = this.parent.eventFields; | ||
var appointmentElements = []; | ||
var selectedSeriedElements = this.getAppointmentSeriesElements(isMoreEvent); | ||
var selectedDate = parseInt(target.getAttribute('data-date'), 10); | ||
var selectedSeriesEvents = this.parent.eventsProcessed.filter(function (eventObject) { | ||
return (!isReverse ? (eventObject[fields.startTime].getTime() >= selectedDate) : | ||
(eventObject[fields.startTime].getTime() <= selectedDate)); | ||
}); | ||
selectedSeriesEvents.filter(function (event) { | ||
selectedSeriedElements.filter(function (element) { | ||
if (JSON.stringify(event.Guid) === JSON.stringify(element.getAttribute('data-guid'))) { | ||
appointmentElements.push(element); | ||
} | ||
selectedSeriesEvents.filter(function (event) { | ||
appointmentElements_1.filter(function (element) { | ||
if (JSON.stringify(event.Guid) === JSON.stringify(element.getAttribute('data-guid'))) { | ||
filteredElements_1.push(element); | ||
} | ||
}); | ||
}); | ||
}); | ||
return appointmentElements; | ||
}; | ||
KeyboardInteraction.prototype.getSelectedSeriesCell = function (target) { | ||
var fields = this.parent.eventFields; | ||
var rowCells = []; | ||
var selectedObject = this.parent.eventBase.getEventByGuid(target.getAttribute('data-guid')); | ||
var eventTime = selectedObject[fields.startTime]; | ||
var isAllDay = target.classList.contains(cls.ALLDAY_APPOINTMENT_CLASS) ? true : false; | ||
var allDayCells = isAllDay ? ([].slice.call(this.parent.element. | ||
querySelector('.' + cls.ALLDAY_ROW_CLASS).children)) : | ||
([].slice.call(this.parent.element. | ||
querySelectorAll('.' + cls.WORK_CELLS_CLASS))); | ||
allDayCells.filter(function (element) { | ||
if (((eventTime).getDate() === new Date(parseInt(element.getAttribute('data-date'), 10)).getDate()) && | ||
(eventTime).getTime() >= parseInt(element.getAttribute('data-date'), 10)) { | ||
rowCells.push(element); | ||
if (filteredElements_1.length > 0) { | ||
var selectedElement = isReverse ? filteredElements_1[filteredElements_1.length - 1] : filteredElements_1[0]; | ||
var focusElements = this.getAppointmentElementsByGuid(selectedElement.getAttribute('data-guid')); | ||
this.parent.eventBase.addSelectedAppointments(focusElements, focusElements[focusElements.length - 1]); | ||
(focusElements[focusElements.length - 1]).focus(); | ||
} | ||
}); | ||
return rowCells[rowCells.length - 1]; | ||
} | ||
}; | ||
@@ -382,2 +307,24 @@ KeyboardInteraction.prototype.getAllDayCells = function (cells) { | ||
}; | ||
KeyboardInteraction.prototype.getAppointmentElements = function () { | ||
return [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_CLASS)); | ||
}; | ||
KeyboardInteraction.prototype.getAppointmentElementsByGuid = function (guid) { | ||
return [].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]')); | ||
}; | ||
KeyboardInteraction.prototype.getUniqueAppointmentElements = function () { | ||
var appointments = this.getAppointmentElements(); | ||
var appointmentElements = []; | ||
appointments.map(function (value) { | ||
return value.getAttribute('data-guid'); | ||
}).filter(function (value, index, self) { | ||
if (self.indexOf(value) === index) { | ||
appointmentElements.push(appointments[index]); | ||
} | ||
}); | ||
return appointmentElements; | ||
}; | ||
KeyboardInteraction.prototype.getWorkCellFromAppointmentElement = function (target) { | ||
var selectedObject = this.parent.eventBase.getEventByGuid(target.getAttribute('data-guid')); | ||
return this.parent.eventBase.selectWorkCellByTime([selectedObject]); | ||
}; | ||
KeyboardInteraction.prototype.processViewNavigation = function (e) { | ||
@@ -406,3 +353,3 @@ var index = parseInt(e.key, 10) - 1; | ||
['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) { | ||
target = this.getSelectedSeriesCell(selectedEventElements[selectedEventElements.length - 1]); | ||
target = this.getWorkCellFromAppointmentElement(selectedEventElements[selectedEventElements.length - 1]); | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
@@ -418,3 +365,3 @@ } | ||
else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') { | ||
this.selectAppointments(true, target, false); | ||
this.selectAppointment(true, target); | ||
} | ||
@@ -435,3 +382,3 @@ }; | ||
['Day', 'Week', 'WorkWeek', 'Month'].indexOf(this.parent.currentView) !== -1) { | ||
target = this.getSelectedSeriesCell(selectedElements[selectedElements.length - 1]); | ||
target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]); | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
@@ -447,3 +394,3 @@ } | ||
else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') { | ||
this.selectAppointments(false, target, false); | ||
this.selectAppointment(false, target); | ||
} | ||
@@ -454,5 +401,8 @@ }; | ||
var curRowIndex = target.parentNode.rowIndex; | ||
var curColIndex = target.cellIndex; | ||
var maxColIndex = tableEle.rows[curRowIndex].cells.length; | ||
var key = { element: tableEle, rowIndex: curRowIndex, columnIndex: curColIndex, maxIndex: maxColIndex }; | ||
var key = { | ||
element: tableEle, | ||
rowIndex: curRowIndex, | ||
columnIndex: target.cellIndex, | ||
maxIndex: tableEle.rows[curRowIndex].cells.length | ||
}; | ||
return key; | ||
@@ -482,3 +432,3 @@ }; | ||
if (selectedAppointments.length > 0) { | ||
target = this.getSelectedSeriesCell(selectedAppointments[selectedAppointments.length - 1]); | ||
target = this.getWorkCellFromAppointmentElement(selectedAppointments[selectedAppointments.length - 1]); | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
@@ -529,3 +479,3 @@ } | ||
if (selectedElements.length > 0) { | ||
target = this.getSelectedSeriesCell(selectedElements[selectedElements.length - 1]); | ||
target = this.getWorkCellFromAppointmentElement(selectedElements[selectedElements.length - 1]); | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
@@ -574,3 +524,2 @@ } | ||
var focusElement = moreEventList[moreEventList.length - 1]; | ||
this.selectedEvents = []; | ||
if (selectedAppointments.length > 0) { | ||
@@ -583,3 +532,3 @@ target = selectedAppointments[selectedAppointments.length - 1]; | ||
else if (target.classList.contains(cls.MORE_EVENT_HEADER_DATE_CLASS) && !isReverse) { | ||
this.selectAppointments(isReverse, target, true); | ||
this.selectAppointment(isReverse, target, true); | ||
} | ||
@@ -604,3 +553,3 @@ else if (target.classList.contains(cls.MORE_EVENT_HEADER_DATE_CLASS) && isReverse) { | ||
else { | ||
this.selectAppointments(isReverse, target, true); | ||
this.selectAppointment(isReverse, target, true); | ||
} | ||
@@ -620,12 +569,11 @@ } | ||
} | ||
if (!isReverse && target.getAttribute('data-guid') === appointments[appointments.length - 1].getAttribute('data-guid')) { | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
if (!isReverse && target.getAttribute('data-guid') === appointments[appointments.length - 1].getAttribute('data-guid') || | ||
isReverse && target.getAttribute('data-guid') === appointments[0].getAttribute('data-guid')) { | ||
return; | ||
} | ||
if (isReverse && target.getAttribute('data-guid') === appointments[0].getAttribute('data-guid')) { | ||
this.parent.eventBase.removeSelectedAppointmentClass(); | ||
return; | ||
if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') { | ||
this.selectAppointment(isReverse, target); | ||
e.preventDefault(); | ||
} | ||
this.selectAppointments(isReverse, target, false); | ||
e.preventDefault(); | ||
return; | ||
@@ -636,3 +584,3 @@ } | ||
target = selectedCells[selectedCells.length - 1]; | ||
this.selectAppointments(isReverse, target, false); | ||
this.selectAppointmentElementFromWorkCell(isReverse, target); | ||
e.preventDefault(); | ||
@@ -639,0 +587,0 @@ return; |
@@ -175,4 +175,2 @@ /** | ||
/** @hidden */ | ||
export declare const APPOINTMENT_COUNT_CLASS: string; | ||
/** @hidden */ | ||
export declare const ALLDAY_APPOINTMENT_SECTION_CLASS: string; | ||
@@ -179,0 +177,0 @@ /** @hidden */ |
@@ -89,3 +89,2 @@ define(["require", "exports"], function (require, exports) { | ||
exports.ROW_COUNT_WRAPPER_CLASS = 'e-row-count-wrapper'; | ||
exports.APPOINTMENT_COUNT_CLASS = 'e-appointment-count'; | ||
exports.ALLDAY_APPOINTMENT_SECTION_CLASS = 'e-all-day-appointment-section'; | ||
@@ -92,0 +91,0 @@ exports.APPOINTMENT_ROW_EXPAND_CLASS = 'e-appointment-expand'; |
@@ -82,7 +82,6 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-lists", "../base/util", "../base/css-constant", "../base/constant"], function (require, exports, ej2_base_1, ej2_lists_1, util, cls, event) { | ||
var endDate = event[fieldMapping.endTime]; | ||
var instance = new ej2_base_1.Internationalization(); | ||
var isAllDay = event[fieldMapping.isAllDay]; | ||
var allDayStr = this.l10n.getConstant('allDay'); | ||
var timeStr = instance.formatDate(strDate, { skeleton: 'hm' }) + ' - ' + | ||
instance.formatDate(endDate, { skeleton: 'hm' }); | ||
var timeStr = this.parent.globalize.formatDate(strDate, { skeleton: 'hm' }) + ' - ' + | ||
this.parent.globalize.formatDate(endDate, { skeleton: 'hm' }); | ||
if (!ej2_base_1.isNullOrUndefined(event.data)) { | ||
@@ -89,0 +88,0 @@ var eventString = (endDate.getTime() - strDate.getTime()) / util.MS_PER_DAY >= 1 ? allDayStr : timeStr; |
@@ -10,2 +10,3 @@ import { EventClickArgs } from '../base/interface'; | ||
timezone: Timezone; | ||
slots: Object[]; | ||
/** | ||
@@ -28,9 +29,16 @@ * Constructor for EventBase | ||
}): Object[]; | ||
splitEvent(event: { | ||
[key: string]: Object; | ||
}, dateRender: Date[]): { | ||
[key: string]: Object; | ||
}[]; | ||
private cloneEventObject(event, start, end, count, isLeft, isRight); | ||
private dateInRange(date, start, end); | ||
getSelectedEventElements(target: Element): Element[]; | ||
getSelectedEvents(): EventClickArgs; | ||
removeSelectedAppointmentClass(): void; | ||
addSelectedAppointments(cells: Element[], focusCell: Element): void; | ||
addSelectedAppointments(cells: Element[], focusCell?: Element): void; | ||
getSelectedAppointments(): Element[]; | ||
focusElement(): void; | ||
selectWorkCellByTime(eventsData: Object[]): void; | ||
selectWorkCellByTime(eventsData: Object[]): Element; | ||
isAllDayAppointment(event: { | ||
@@ -37,0 +45,0 @@ [key: string]: Object; |
@@ -6,2 +6,3 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-data", "../timezone/timezone", "../../recurrence-editor/date-generator", "../base/util", "../base/css-constant", "../base/constant"], function (require, exports, ej2_base_1, ej2_data_1, timezone_1, date_generator_1, util, cls, event) { | ||
function EventBase(parent) { | ||
this.slots = []; | ||
this.parent = parent; | ||
@@ -160,2 +161,80 @@ this.timezone = new timezone_1.Timezone(); | ||
}; | ||
EventBase.prototype.splitEvent = function (event, dateRender) { | ||
var fields = this.parent.eventFields; | ||
var start = util.resetTime(new Date(event[fields.startTime] + '')).getTime(); | ||
var end = util.resetTime(new Date(event[fields.endTime] + '')).getTime(); | ||
if (util.getDateInMs(event[fields.endTime]) <= 0) { | ||
var temp = util.addDays(util.resetTime(new Date(event[fields.endTime] + '')), -1).getTime(); | ||
end = start > temp ? start : temp; | ||
} | ||
var orgStart = start; | ||
var orgEnd = end; | ||
var ranges = []; | ||
if (start !== end) { | ||
if (start < dateRender[0].getTime()) { | ||
start = dateRender[0].getTime(); | ||
} | ||
if (end > dateRender[dateRender.length - 1].getTime()) { | ||
end = dateRender[dateRender.length - 1].getTime(); | ||
} | ||
var cStart = start; | ||
for (var level = 0; level < this.slots.length; level++) { | ||
var slot = this.slots[level]; | ||
var firstSlot = slot[0]; | ||
cStart = (cStart <= firstSlot && end >= firstSlot) ? firstSlot : cStart; | ||
if (cStart > end || firstSlot > end) { | ||
break; | ||
} | ||
if (this.parent.activeViewOptions.showWeekend && this.parent.currentView !== 'WorkWeek') { | ||
var startIndex = slot.indexOf(cStart); | ||
if (startIndex !== -1) { | ||
var endIndex = slot.indexOf(end); | ||
var hasBreak = endIndex !== -1; | ||
endIndex = hasBreak ? endIndex : slot.length - 1; | ||
var count = ((endIndex - startIndex) + 1); | ||
var isLeft = (slot[startIndex] !== orgStart); | ||
var isRight = (slot[endIndex] !== orgEnd); | ||
ranges.push(this.cloneEventObject(event, slot[startIndex], slot[endIndex], count, isLeft, isRight)); | ||
if (hasBreak) { | ||
break; | ||
} | ||
} | ||
} | ||
else { | ||
if (this.dateInRange(cStart, slot[0], slot[slot.length - 1])) { | ||
var availSlot = []; | ||
for (var i = 0; i < slot.length; i++) { | ||
if (this.dateInRange(slot[i], orgStart, orgEnd)) { | ||
availSlot.push(slot[i]); | ||
} | ||
} | ||
if (availSlot.length > 0) { | ||
var cnt = availSlot.length; | ||
var isLeft = (availSlot[0] !== orgStart); | ||
var isRight = (availSlot[availSlot.length - 1] !== orgEnd); | ||
ranges.push(this.cloneEventObject(event, availSlot[0], availSlot[availSlot.length - 1], cnt, isLeft, isRight)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
else { | ||
ranges.push(this.cloneEventObject(event, start, end, 1, false, false)); | ||
} | ||
return ranges; | ||
}; | ||
EventBase.prototype.cloneEventObject = function (event, start, end, count, isLeft, isRight) { | ||
var fields = this.parent.eventFields; | ||
var e = ej2_base_1.extend({}, event, null, true); | ||
var data = { count: count, isLeft: isLeft, isRight: isRight }; | ||
data[fields.startTime] = event[fields.startTime]; | ||
data[fields.endTime] = event[fields.endTime]; | ||
e.data = data; | ||
e[fields.startTime] = new Date(start); | ||
e[fields.endTime] = new Date(end); | ||
return e; | ||
}; | ||
EventBase.prototype.dateInRange = function (date, start, end) { | ||
return start <= date && date <= end; | ||
}; | ||
EventBase.prototype.getSelectedEventElements = function (target) { | ||
@@ -220,3 +299,3 @@ this.removeSelectedAppointmentClass(); | ||
EventBase.prototype.getSelectedAppointments = function () { | ||
return [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_BORDER)); | ||
return [].slice.call(this.parent.element.querySelectorAll('.' + cls.APPOINTMENT_BORDER + ',.' + cls.APPOINTMENT_CLASS + ':focus')); | ||
}; | ||
@@ -240,4 +319,5 @@ EventBase.prototype.focusElement = function () { | ||
EventBase.prototype.selectWorkCellByTime = function (eventsData) { | ||
var target; | ||
if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') { | ||
return; | ||
return target; | ||
} | ||
@@ -259,3 +339,3 @@ if (eventsData.length > 0) { | ||
} | ||
var target = targetArea.querySelector('[data-date="' + nearestTime + '"]'); | ||
target = targetArea.querySelector('[data-date="' + nearestTime + '"]'); | ||
if (target) { | ||
@@ -266,4 +346,6 @@ this.parent.activeCellsData = this.parent.getCellDetails(target); | ||
} | ||
return target; | ||
} | ||
} | ||
return target; | ||
}; | ||
@@ -348,3 +430,3 @@ EventBase.prototype.isAllDayAppointment = function (event) { | ||
var guid = target.getAttribute('data-guid'); | ||
ej2_base_1.addClass([].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]')), cls.APPOINTMENT_BORDER); | ||
this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]'))); | ||
var eventObject = this.getEventByGuid(guid); | ||
@@ -351,0 +433,0 @@ if (eventObject.isSpanned) { |
@@ -13,3 +13,2 @@ import { Schedule } from '../base/schedule'; | ||
private monthHeaderHeight; | ||
private slots; | ||
private workCells; | ||
@@ -23,5 +22,2 @@ private cellWidth; | ||
renderAppointments(): void; | ||
private splitEvent(event); | ||
private cloneEventObject(event, start, end, count, isLeft, isRight); | ||
private dateInRange(date, start, end); | ||
private getElementHeightFromClass(container, elementClass); | ||
@@ -28,0 +24,0 @@ private getOuterHeight(element); |
@@ -20,3 +20,2 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.renderedEvents = []; | ||
_this.slots = []; | ||
_this.element = _this.parent.activeView.getPanel(); | ||
@@ -50,3 +49,3 @@ _this.fields = _this.parent.eventFields; | ||
var event_1 = eventsList_1[_a]; | ||
var splittedEvents = this.splitEvent(event_1); | ||
var splittedEvents = this.splitEvent(event_1, this.dateRender); | ||
for (var _b = 0, splittedEvents_1 = splittedEvents; _b < splittedEvents_1.length; _b++) { | ||
@@ -58,78 +57,2 @@ var event_2 = splittedEvents_1[_b]; | ||
}; | ||
MonthEvent.prototype.splitEvent = function (event) { | ||
var start = util.resetTime(new Date(event[this.fields.startTime] + '')).getTime(); | ||
var end = util.resetTime(new Date(event[this.fields.endTime] + '')).getTime(); | ||
if (util.getDateInMs(event[this.fields.endTime]) <= 0) { | ||
var temp = util.addDays(util.resetTime(new Date(event[this.fields.endTime] + '')), -1).getTime(); | ||
end = start > temp ? start : temp; | ||
} | ||
var orgStart = start; | ||
var orgEnd = end; | ||
var ranges = []; | ||
if (start !== end) { | ||
if (start < this.dateRender[0].getTime()) { | ||
start = this.dateRender[0].getTime(); | ||
} | ||
if (end > this.dateRender[this.dateRender.length - 1].getTime()) { | ||
end = this.dateRender[this.dateRender.length - 1].getTime(); | ||
} | ||
var cStart = start; | ||
for (var level = 0; level < this.slots.length; level++) { | ||
var slot = this.slots[level]; | ||
var firstSlot = slot[0]; | ||
cStart = (cStart <= firstSlot && end >= firstSlot) ? firstSlot : cStart; | ||
if (cStart > end || firstSlot > end) { | ||
break; | ||
} | ||
if (this.parent.activeViewOptions.showWeekend) { | ||
var startIndex = slot.indexOf(cStart); | ||
if (startIndex !== -1) { | ||
var endIndex = slot.indexOf(end); | ||
var hasBreak = endIndex !== -1; | ||
endIndex = hasBreak ? endIndex : slot.length - 1; | ||
var count = ((endIndex - startIndex) + 1); | ||
var isLeft = (slot[startIndex] !== orgStart); | ||
var isRight = (slot[endIndex] !== orgEnd); | ||
ranges.push(this.cloneEventObject(event, slot[startIndex], slot[endIndex], count, isLeft, isRight)); | ||
if (hasBreak) { | ||
break; | ||
} | ||
} | ||
} | ||
else { | ||
if (this.dateInRange(cStart, slot[0], slot[slot.length - 1])) { | ||
var availSlot = []; | ||
for (var i = 0; i < slot.length; i++) { | ||
if (this.dateInRange(slot[i], orgStart, orgEnd)) { | ||
availSlot.push(slot[i]); | ||
} | ||
} | ||
if (availSlot.length > 0) { | ||
var cnt = availSlot.length; | ||
var isLeft = (availSlot[0] !== orgStart); | ||
var isRight = (availSlot[availSlot.length - 1] !== orgEnd); | ||
ranges.push(this.cloneEventObject(event, availSlot[0], availSlot[availSlot.length - 1], cnt, isLeft, isRight)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
else { | ||
ranges.push(this.cloneEventObject(event, start, end, 1, false, false)); | ||
} | ||
return ranges; | ||
}; | ||
MonthEvent.prototype.cloneEventObject = function (event, start, end, count, isLeft, isRight) { | ||
var e = ej2_base_1.extend({}, event, null, true); | ||
var data = { count: count, isLeft: isLeft, isRight: isRight }; | ||
data[this.fields.startTime] = event[this.fields.startTime]; | ||
data[this.fields.endTime] = event[this.fields.endTime]; | ||
e.data = data; | ||
e[this.fields.startTime] = new Date(start); | ||
e[this.fields.endTime] = new Date(end); | ||
return e; | ||
}; | ||
MonthEvent.prototype.dateInRange = function (date, start, end) { | ||
return start <= date && date <= end; | ||
}; | ||
MonthEvent.prototype.getElementHeightFromClass = function (container, elementClass) { | ||
@@ -278,7 +201,10 @@ var height = 0; | ||
className: cls.MORE_INDICATOR_CLASS, | ||
innerHTML: '+' + count + ' ' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')) | ||
innerHTML: '+' + count + ' ' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')), | ||
attrs: { | ||
'tabindex': '0', | ||
'data-start-date': startDateTime.getTime().toString(), | ||
'data-end-date': endDateTime.getTime().toString() | ||
} | ||
}); | ||
moreIndicatorElement.style.top = appArea + 'px'; | ||
moreIndicatorElement.setAttribute('data-start-date', startDateTime.getTime().toString()); | ||
moreIndicatorElement.setAttribute('data-end-date', endDateTime.getTime().toString()); | ||
if (cellTd_1.querySelector('.' + cls.APPOINTMENT_WRAPPER_CLASS)) { | ||
@@ -285,0 +211,0 @@ cellTd_1.querySelector('.' + cls.APPOINTMENT_WRAPPER_CLASS).appendChild(moreIndicatorElement); |
@@ -21,2 +21,4 @@ import { Schedule } from '../base/schedule'; | ||
private animation; | ||
private fields; | ||
private cellHeight; | ||
/** | ||
@@ -30,4 +32,3 @@ * Constructor for vertical view | ||
private renderSpannedIcon(element, spanEvent, isAllDay); | ||
private isSpannedEvent(record, day, isAllDay); | ||
private getAllDayCounts(record, eStart, eEnd, day); | ||
private isSpannedEvent(record, day); | ||
private renderAllDayEvents(event); | ||
@@ -42,6 +43,4 @@ private renderVerticalEvents(eventObj, day); | ||
private getEventHeight(); | ||
private isRowExpand(); | ||
private isRowCollapse(); | ||
private rowExpandCollapse(event); | ||
private animationUiUpdate(); | ||
} |
@@ -28,2 +28,3 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.element = _this.parent.activeView.getPanel(); | ||
_this.fields = _this.parent.eventFields; | ||
_this.animation = new ej2_base_1.Animation({ progress: _this.animationUiUpdate.bind(_this) }); | ||
@@ -53,8 +54,9 @@ _this.addEventListener(); | ||
this.dateRender = this.parent.activeView.renderDates; | ||
this.cellHeight = this.element.querySelector('.' + cls.WORK_CELLS_CLASS).offsetHeight; | ||
var eventsList = this.parent.eventsProcessed; | ||
if (eventsList.length > 0) { | ||
for (var day = 0, length_1 = this.dateRender.length; day < length_1; day++) { | ||
this.renderedEvents = []; | ||
var startDateTime = new Date(this.dateRender[day].getTime()); | ||
var endDateTime = util.addDays(this.dateRender[day], 1); | ||
var fieldMapping = this.parent.eventFields; | ||
var filterEvents = this.filterEvents(startDateTime, endDateTime); | ||
@@ -173,10 +175,10 @@ for (var count = 0, length1 = filterEvents.length; count < length1; count++) { | ||
}); | ||
var appointmentCount = ej2_base_1.createElement('div', { | ||
className: cls.APPOINTMENT_COUNT_CLASS, | ||
attrs: { 'data-index': (currentDay + count).toString(), 'data-count': '1' }, | ||
var moreIndicatorElement = ej2_base_1.createElement('div', { | ||
className: cls.MORE_INDICATOR_CLASS, | ||
attrs: { 'tabindex': '0', 'data-index': (currentDay + count).toString(), 'data-count': '1' }, | ||
innerHTML: '+1 ' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')) | ||
}); | ||
innerCountWrap.appendChild(appointmentCount); | ||
innerCountWrap.appendChild(moreIndicatorElement); | ||
countWrapper.appendChild(innerCountWrap); | ||
ej2_base_1.EventHandler.add(appointmentCount, 'click', this.rowExpandCollapse, this); | ||
ej2_base_1.EventHandler.add(moreIndicatorElement, 'click', this.rowExpandCollapse, this); | ||
} | ||
@@ -221,3 +223,3 @@ else { | ||
}; | ||
AppointmentRendering.prototype.isSpannedEvent = function (record, day, isAllDay) { | ||
AppointmentRendering.prototype.isSpannedEvent = function (record, day) { | ||
var currentDate = util.resetTime(this.dateRender[day]); | ||
@@ -227,60 +229,13 @@ var fieldMapping = this.parent.eventFields; | ||
var event = ej2_base_1.extend({}, record, null, true); | ||
if (isAllDay) { | ||
var viewEndDate = util.addDays(this.dateRender[this.dateRender.length - 1], 1); | ||
event.isSpanned = { isLeft: false, isRight: false }; | ||
if (record[fieldMapping.startTime] < currentDate) { | ||
event[fieldMapping.startTime] = currentDate; | ||
event.isSpanned.isLeft = true; | ||
} | ||
if (viewEndDate < record[fieldMapping.endTime]) { | ||
event[fieldMapping.endTime] = viewEndDate; | ||
event.isSpanned.isRight = true; | ||
} | ||
event.isSpanned = { isBottom: false, isTop: false }; | ||
if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) { | ||
event[fieldMapping.startTime] = startEndHours.startHour; | ||
event.isSpanned.isTop = true; | ||
} | ||
else { | ||
event.isSpanned = { isBottom: false, isTop: false }; | ||
if (record[fieldMapping.startTime].getTime() < startEndHours.startHour.getTime()) { | ||
event[fieldMapping.startTime] = startEndHours.startHour; | ||
event.isSpanned.isTop = true; | ||
} | ||
if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) { | ||
event[fieldMapping.endTime] = startEndHours.endHour; | ||
event.isSpanned.isBottom = true; | ||
} | ||
if (record[fieldMapping.endTime].getTime() > startEndHours.endHour.getTime()) { | ||
event[fieldMapping.endTime] = startEndHours.endHour; | ||
event.isSpanned.isBottom = true; | ||
} | ||
return event; | ||
}; | ||
AppointmentRendering.prototype.getAllDayCounts = function (record, eStart, eEnd, day) { | ||
var datesRender = this.dateRender; | ||
var fieldMapping = this.parent.eventFields; | ||
var objectSpan = record.isSpanned; | ||
var daysCount = 0; | ||
if (this.parent.currentView === 'WorkWeek' || this.parent.currentView === 'Week' && !this.parent.activeViewOptions.showWeekend) { | ||
for (var day1 = day, length_2 = datesRender.length; day1 < length_2; day1++) { | ||
if (datesRender[day1].getTime() === (objectSpan.isRight ? | ||
util.addDays(new Date(new Date(eEnd.getFullYear(), eEnd.getMonth(), eEnd.getDate()).getTime()), -1).setHours(0, 0, 0) : | ||
new Date(eEnd.getFullYear(), eEnd.getMonth(), eEnd.getDate()).getTime())) { | ||
daysCount = record[fieldMapping.isAllDay] ? (day1 - day) : (day1 - day) + 1; | ||
break; | ||
} | ||
else if (datesRender[day1].getTime() > new Date(eEnd.getFullYear(), eEnd.getMonth(), eEnd.getDate()).getTime()) { | ||
record[fieldMapping.endTime] = datesRender[day1 - 1]; | ||
daysCount = record[fieldMapping.isAllDay] ? ((day1 - 1) - day) : ((day1 - 1) - day) + 1; | ||
break; | ||
} | ||
} | ||
} | ||
if (daysCount <= 0) { | ||
if (eEnd.getHours() === 0 && eEnd.getMinutes() === 0) { | ||
daysCount = (Math.ceil((record[fieldMapping.endTime].getTime() - | ||
record[fieldMapping.startTime].getTime()) / util.MS_PER_DAY)); | ||
} | ||
else { | ||
daysCount = Math.ceil((util.addDays(new Date(eEnd.getTime()), 1).setHours(0, 0, 0) - | ||
new Date(eStart.setHours(0, 0, 0)).getTime()) / util.MS_PER_DAY); | ||
record[fieldMapping.endTime] = util.addDays(util.resetTime(new Date(record[fieldMapping.endTime].getTime())), 1); | ||
} | ||
} | ||
return daysCount; | ||
}; | ||
AppointmentRendering.prototype.renderAllDayEvents = function (event) { | ||
@@ -290,3 +245,5 @@ this.moreEvents = []; | ||
this.allDayLevel = 0; | ||
for (var day = 0, length_3 = this.dateRender.length; day < length_3; day++) { | ||
this.slots = []; | ||
this.slots.push(this.dateRender.map(function (date) { return +date; })); | ||
for (var day = 0, length_2 = this.dateRender.length; day < length_2; day++) { | ||
var fieldMapping = this.parent.eventFields; | ||
@@ -298,3 +255,3 @@ var filterEvents = this.filterEvents(new Date(this.dateRender[day].getTime()), util.addDays(this.dateRender[day], 1), event); | ||
var eventObj = filterEvents[count]; | ||
var record = this_1.isSpannedEvent(eventObj, day, true); | ||
var record = this_1.splitEvent(eventObj, this_1.dateRender)[0]; | ||
var cellTop = allDayRowCell.offsetTop; | ||
@@ -315,7 +272,7 @@ var eStart = new Date(record[fieldMapping.startTime].getTime()); | ||
if (isAlreadyRendered.length === 0) { | ||
var allDayDifference = this_1.getAllDayCounts(record, eStart, eEnd, day); | ||
var allDayDifference = record.data.count; | ||
var allDayIndex = this_1.getOverlapIndex(record, day, true); | ||
record.Index = allDayIndex; | ||
this_1.allDayLevel = (this_1.allDayLevel < allDayIndex) ? allDayIndex : this_1.allDayLevel; | ||
var widthAdjustment = record.isSpanned.isRight ? 0 : | ||
var widthAdjustment = record.data.isRight ? 0 : | ||
this_1.parent.currentView === 'Day' ? 4 : 7; | ||
@@ -327,3 +284,3 @@ if (allDayDifference >= 0) { | ||
var allDayRow = [].slice.call(this_1.element.querySelector('.' + cls.ALLDAY_ROW_CLASS).children); | ||
var appointmentElement = this_1.createAppointmentElement(eventObj, true, record.isSpanned); | ||
var appointmentElement = this_1.createAppointmentElement(eventObj, true, record.data); | ||
ej2_base_2.addClass([appointmentElement], cls.ALLDAY_APPOINTMENT_CLASS); | ||
@@ -338,3 +295,3 @@ eventWrapper.appendChild(appointmentElement); | ||
this_1.moreEvents.push(appointmentElement); | ||
for (var count_1 = 0, length_4 = allDayDifference; count_1 < length_4; count_1++) { | ||
for (var count_1 = 0, length_3 = allDayDifference; count_1 < length_3; count_1++) { | ||
this_1.createMoreIndicator(allDayRow, count_1, day); | ||
@@ -359,9 +316,5 @@ } | ||
AppointmentRendering.prototype.renderVerticalEvents = function (eventObj, day) { | ||
var record = this.isSpannedEvent(eventObj, day, false); | ||
var fieldMapping = this.parent.eventFields; | ||
var cellWidth = this.element.querySelector('.' + cls.WORK_CELLS_CLASS).offsetWidth; | ||
var cellHeight = this.element.querySelector('.' + cls.WORK_CELLS_CLASS).offsetHeight; | ||
var eStart = record[fieldMapping.startTime]; | ||
var eEnd = record[fieldMapping.endTime]; | ||
var dates = this.dateRender; | ||
var record = this.isSpannedEvent(eventObj, day); | ||
var eStart = record[this.fields.startTime]; | ||
var eEnd = record[this.fields.endTime]; | ||
var appWidth = '0%'; | ||
@@ -371,4 +324,4 @@ var appLeft = '0%'; | ||
var appLevel = 0; | ||
var isDateRange = dates[0].getTime() <= eStart.getTime() && | ||
util.addDays(dates[dates.length - 1], 1).getTime() >= eStart.getTime(); | ||
var isDateRange = this.dateRender[0].getTime() <= eStart.getTime() && | ||
util.addDays(this.dateRender[this.dateRender.length - 1], 1).getTime() >= eStart.getTime(); | ||
if (eStart < eEnd && isDateRange) { | ||
@@ -378,14 +331,14 @@ var appHeight = 0; | ||
if (startEndHours.endHour.getTime() <= eEnd.getTime() && startEndHours.startHour.getTime() >= eStart.getTime()) { | ||
appHeight = this.getAppointmentHeight(cellHeight, startEndHours.startHour, startEndHours.endHour); | ||
appHeight = this.getAppointmentHeight(this.cellHeight, startEndHours.startHour, startEndHours.endHour); | ||
} | ||
else if (startEndHours.endHour.getTime() <= eEnd.getTime()) { | ||
appHeight = this.getAppointmentHeight(cellHeight, eStart, startEndHours.endHour); | ||
appHeight = this.getAppointmentHeight(this.cellHeight, eStart, startEndHours.endHour); | ||
} | ||
else if (startEndHours.startHour.getTime() >= eStart.getTime()) { | ||
appHeight = this.getAppointmentHeight(cellHeight, startEndHours.startHour, eEnd); | ||
appHeight = this.getAppointmentHeight(this.cellHeight, startEndHours.startHour, eEnd); | ||
} | ||
else { | ||
appHeight = (eEnd.getTime() - eStart.getTime()) / (60 * 1000) * (cellHeight * this.minorSlotCount) / this.majorSlot; | ||
appHeight = (eEnd.getTime() - eStart.getTime()) / (60 * 1000) * (this.cellHeight * this.minorSlotCount) / this.majorSlot; | ||
} | ||
appHeight = (appHeight < cellHeight) ? cellHeight : appHeight; | ||
appHeight = (appHeight < this.cellHeight) ? this.cellHeight : appHeight; | ||
if (eStart.getTime() > startEndHours.startHour.getTime()) { | ||
@@ -432,7 +385,6 @@ topValue = this.getTopValue(eStart, day); | ||
AppointmentRendering.prototype.getTopValue = function (date, day) { | ||
var cellHeight = this.element.querySelector('.' + cls.WORK_CELLS_CLASS).offsetHeight; | ||
var startEndHours = util.getStartEndHours(util.resetTime(this.dateRender[day]), this.startHour, this.endHour); | ||
var startHour = startEndHours.startHour; | ||
var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes()); | ||
return (diffInMinutes * cellHeight * this.minorSlotCount) / this.majorSlot; | ||
return (diffInMinutes * this.cellHeight * this.minorSlotCount) / this.majorSlot; | ||
}; | ||
@@ -448,7 +400,6 @@ AppointmentRendering.prototype.getAppointmentHeight = function (cellHeight, startDate, endDate) { | ||
if (isAllDay) { | ||
var dates_1 = new Date(this.dateRender[day].getTime()); | ||
var eStart_1 = util.resetTime(util.addDays(new Date(this.dateRender[day].getTime()), 1)); | ||
eventsList = this.renderedAllDayEvents.filter(function (obj) { | ||
return ((obj[fieldMapping.endTime] > dates_1 && obj[fieldMapping.startTime] <= eStart_1) || | ||
(obj[fieldMapping.startTime] >= dates_1 && obj[fieldMapping.startTime] <= eStart_1)); | ||
var date_1 = new Date(this.dateRender[day].getTime()); | ||
eventsList = this.renderedAllDayEvents.filter(function (app) { | ||
return ((util.resetTime(app[fieldMapping.startTime]).getTime() <= util.resetTime(date_1).getTime()) && | ||
(util.resetTime(app[fieldMapping.endTime]).getTime() >= util.resetTime(date_1).getTime())); | ||
}); | ||
@@ -537,4 +488,10 @@ } | ||
this.moreEvents.filter(function (element) { | ||
(!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) ? ej2_base_2.addClass([element], cls.EVENT_COUNT_CLASS) : | ||
if (!_this.parent.uiStateValues.expand && _this.allDayLevel > 2) { | ||
ej2_base_2.addClass([element], cls.EVENT_COUNT_CLASS); | ||
element.setAttribute('tabindex', '-1'); | ||
} | ||
else { | ||
ej2_base_2.removeClass([element], cls.EVENT_COUNT_CLASS); | ||
element.setAttribute('tabindex', '0'); | ||
} | ||
}); | ||
@@ -565,27 +522,18 @@ var moreEventCount = this.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_SECTION_CLASS); | ||
}; | ||
AppointmentRendering.prototype.isRowExpand = function () { | ||
var target = this.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_SECTION_CLASS); | ||
target.setAttribute('title', 'Collapse-all-day-section'); | ||
target.setAttribute('aria-label', 'Collapse section'); | ||
var rowHeight = ((this.allDayLevel + 1) * this.getEventHeight()) + 4; | ||
this.setAllDayRowHeight(rowHeight); | ||
this.addOrRemoveClass(); | ||
}; | ||
AppointmentRendering.prototype.isRowCollapse = function () { | ||
var target = this.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_SECTION_CLASS); | ||
target.setAttribute('title', 'Expand-all-day-section'); | ||
target.setAttribute('aria-label', 'Expand section'); | ||
var rowHeight = (3 * this.getEventHeight()) + 4; | ||
this.setAllDayRowHeight(rowHeight); | ||
this.addOrRemoveClass(); | ||
}; | ||
AppointmentRendering.prototype.rowExpandCollapse = function (event) { | ||
var target = this.element.querySelector('.' + cls.ALLDAY_APPOINTMENT_SECTION_CLASS); | ||
this.parent.uiStateValues.expand = target.classList.contains(cls.APPOINTMENT_ROW_EXPAND_CLASS); | ||
var rowHeight; | ||
if (this.parent.uiStateValues.expand) { | ||
this.isRowExpand(); | ||
target.setAttribute('title', 'Collapse-all-day-section'); | ||
target.setAttribute('aria-label', 'Collapse section'); | ||
rowHeight = ((this.allDayLevel + 1) * this.getEventHeight()) + 4; | ||
} | ||
else { | ||
this.isRowCollapse(); | ||
target.setAttribute('title', 'Expand-all-day-section'); | ||
target.setAttribute('aria-label', 'Expand section'); | ||
rowHeight = (3 * this.getEventHeight()) + 4; | ||
} | ||
this.setAllDayRowHeight(rowHeight); | ||
this.addOrRemoveClass(); | ||
this.animation.animate(target); | ||
@@ -592,0 +540,0 @@ }; |
@@ -38,3 +38,3 @@ import { Dialog } from '@syncfusion/ej2-popups'; | ||
private createInputElement(className, fieldName, type?); | ||
private renderDateTimePicker(value); | ||
private renderDateTimePicker(value, changeEvent?); | ||
private onTimeChange(args); | ||
@@ -41,0 +41,0 @@ private renderDropDown(value); |
@@ -135,3 +135,3 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-data", "@syncfusion/ej2-buttons", "@syncfusion/ej2-popups", "@syncfusion/ej2-dropdowns", "@syncfusion/ej2-inputs", "@syncfusion/ej2-calendars", "../timezone/timezone", "./form-validator", "../../recurrence-editor/recurrence-editor", "../base/css-constant", "../base/constant", "../base/util"], function (require, exports, ej2_base_1, ej2_base_2, ej2_data_1, ej2_buttons_1, ej2_popups_1, ej2_dropdowns_1, ej2_inputs_1, ej2_calendars_1, timezone_1, form_validator_1, recurrence_editor_1, cls, event, util) { | ||
var startEndDateTimeDiv = this.createDivElement(cls.EVENT_WINDOW_START_END_DIV_CLASS); | ||
var startDateTimeDiv = this.renderDateTimePicker(cls.EVENT_WINDOW_START_CLASS); | ||
var startDateTimeDiv = this.renderDateTimePicker(cls.EVENT_WINDOW_START_CLASS, this.onTimeChange.bind(this)); | ||
var endDateTimeDiv = this.renderDateTimePicker(cls.EVENT_WINDOW_END_CLASS); | ||
@@ -197,3 +197,3 @@ startEndDateTimeDiv.appendChild(startDateTimeDiv); | ||
}; | ||
EventWindow.prototype.renderDateTimePicker = function (value) { | ||
EventWindow.prototype.renderDateTimePicker = function (value, changeEvent) { | ||
var dateTimeDiv = this.createDivElement(value + '-container'); | ||
@@ -204,3 +204,3 @@ var fieldName = this.getFieldName(value); | ||
var dateTimePicker = new ej2_calendars_1.DateTimePicker({ | ||
change: this.onTimeChange.bind(this), enableRtl: this.parent.enableRtl, floatLabelType: 'Always', | ||
change: changeEvent, enableRtl: this.parent.enableRtl, floatLabelType: 'Always', | ||
format: (ej2_base_1.isNullOrUndefined(this.parent.dateFormat) ? | ||
@@ -466,4 +466,5 @@ this.getFormat('dateFormats') : this.parent.dateFormat) + ' ' + this.getFormat('timeFormats'), | ||
var eventObj = ej2_base_1.extend({}, eventData, null, true); | ||
if (eventObj[this.fields.isAllDay] && this.cellClickAction) { | ||
eventObj[this.fields.endTime] = util.addDays(new Date(eventObj[this.fields.endTime].getTime()), -1); | ||
if (eventObj[this.fields.isAllDay]) { | ||
var temp = util.addDays(new Date(+eventObj[this.fields.endTime]), -1).getTime(); | ||
eventObj[this.fields.endTime] = (+eventObj[this.fields.startTime] > temp) ? eventObj[this.fields.endTime] : new Date(temp); | ||
} | ||
@@ -713,4 +714,5 @@ this.eventData = eventObj; | ||
} | ||
if (eventObj[this.fields.isAllDay] && this.cellClickAction) { | ||
eventObj[this.fields.endTime] = util.addDays(new Date(eventObj[this.fields.endTime].getTime()), 1); | ||
if (eventObj[this.fields.isAllDay]) { | ||
eventObj[this.fields.startTime] = util.resetTime(eventObj[this.fields.startTime]); | ||
eventObj[this.fields.endTime] = util.addDays(util.resetTime(eventObj[this.fields.endTime]), 1); | ||
} | ||
@@ -829,3 +831,3 @@ var ruleData = this.recurrenceEditor ? this.recurrenceEditor.getRecurrenceRule() : null; | ||
else { | ||
element.value = null; | ||
element.value = ''; | ||
} | ||
@@ -832,0 +834,0 @@ } |
@@ -30,3 +30,3 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-popups", "@syncfusion/ej2-buttons", "@syncfusion/ej2-inputs", "../actions/crud", "../timezone/timezone", "./form-validator", "../base/constant", "../base/css-constant", "../base/util"], function (require, exports, ej2_base_1, ej2_base_2, ej2_popups_1, ej2_buttons_1, ej2_inputs_1, crud_1, timezone_1, form_validator_1, event, cls, util) { | ||
enableRtl: this.parent.enableRtl, isSticky: true, | ||
opensOn: 'custom', | ||
opensOn: 'Custom', | ||
showTipPointer: false | ||
@@ -272,4 +272,3 @@ }); | ||
cls.ALLDAY_CELLS_CLASS + ',.' + cls.HEADER_CELLS_CLASS); | ||
if (ej2_base_1.isNullOrUndefined(target) || args.event.target.classList.contains(cls.MORE_INDICATOR_CLASS) || | ||
args.event.target.classList.contains(cls.APPOINTMENT_COUNT_CLASS)) { | ||
if (ej2_base_1.isNullOrUndefined(target) || args.event.target.classList.contains(cls.MORE_INDICATOR_CLASS)) { | ||
return; | ||
@@ -467,3 +466,3 @@ } | ||
details = startDateDetails + ' (' + | ||
((startDate.getHours() === 0 && startDate.getMinutes() === 0) ? this.l10n.getConstant('allDay') : startTimeDetail) + ')'; | ||
(eventData[fields.isAllDay] ? this.l10n.getConstant('allDay') : startTimeDetail) + ')'; | ||
if (allDayLength > 1 || spanLength > 0) { | ||
@@ -470,0 +469,0 @@ details += ' - ' + endDateDetails + ' (' + |
@@ -58,3 +58,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var contentArea = ej2_base_1.closest(tBody, '.' + cls.CONTENT_WRAP_CLASS); | ||
contentArea.scrollTo(0, 1); | ||
contentArea.scrollTop = 1; | ||
}; | ||
@@ -193,3 +193,3 @@ Agenda.prototype.renderContent = function (tBody, agendaDate) { | ||
this.element.querySelector('.e-agenda-item').offsetHeight; | ||
target.scrollTo(0, scrollToValue); | ||
target.scrollTop = scrollToValue; | ||
break; | ||
@@ -196,0 +196,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18037837
9
227290
+ Added@syncfusion/ej2-base@16.1.38(transitive)
+ Added@syncfusion/ej2-buttons@16.1.48(transitive)
+ Added@syncfusion/ej2-calendars@16.1.49(transitive)
+ Added@syncfusion/ej2-data@16.1.42(transitive)
+ Added@syncfusion/ej2-dropdowns@16.1.46(transitive)
+ Added@syncfusion/ej2-inputs@16.1.48(transitive)
+ Added@syncfusion/ej2-lists@16.1.42(transitive)
+ Added@syncfusion/ej2-navigations@16.1.42(transitive)
+ Added@syncfusion/ej2-popups@16.1.47(transitive)
- Removed@syncfusion/ej2-base@16.4.52(transitive)
- Removed@syncfusion/ej2-buttons@16.4.55(transitive)
- Removed@syncfusion/ej2-calendars@16.4.55(transitive)
- Removed@syncfusion/ej2-data@16.4.52(transitive)
- Removed@syncfusion/ej2-dropdowns@16.4.55(transitive)
- Removed@syncfusion/ej2-inputs@16.4.55(transitive)
- Removed@syncfusion/ej2-lists@16.4.52(transitive)
- Removed@syncfusion/ej2-navigations@16.4.54(transitive)
- Removed@syncfusion/ej2-popups@16.4.54(transitive)
- Removed@syncfusion/ej2-splitbuttons@16.4.53(transitive)