@syncfusion/ej2-schedule 28.1.33 → 28.1.36

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.
@@ -18027,9 +18027,6 @@ let Schedule = class Schedule extends Component {
18027
18027
  removeSelectedClass() {
18028
18028
  const selectedCells = this.getSelectedCells();
18029
18029
  for (const cell of selectedCells) {
18030
- if (this.currentView !== 'Year') {
18031
- cell.setAttribute('aria-selected', 'false');
18032
- }
18033
18030
  cell.removeAttribute('tabindex');
18034
18031
  }
18035
18032
  removeClass(selectedCells, SELECTED_CELL_CLASS);
@@ -18047,11 +18044,6 @@ let Schedule = class Schedule extends Component {
18047
18044
  * @private
18048
18045
  */
18049
18046
  addSelectedClass(cells, focusCell, isPreventScroll) {
18050
- if (this.currentView !== 'Year') {
18051
- for (const cell of cells) {
18052
- cell.setAttribute('aria-selected', 'true');
18053
- }
18054
- }
18055
18047
  addClass(cells, SELECTED_CELL_CLASS);
18056
18048
  if (focusCell) {
18057
18049
  focusCell.setAttribute('tabindex', '0');
@@ -22029,14 +22021,14 @@ class DragAndDrop extends ActionBase {
22029
22021
  this.isPreventMultiDrag = false;
22030
22022
  this.slotsUptoCursor = -1;
22031
22023
  this.eleTop = 0;
22024
+ this.distanceUptoCursor = 0;
22032
22025
  }
22033
22026
  wireDragEvent(element) {
22034
- const isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
22035
22027
  new Draggable(element, {
22036
22028
  abort: '.' + EVENT_RESIZE_CLASS,
22037
22029
  clone: true,
22038
22030
  isDragScroll: true,
22039
- enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
22031
+ enableTailMode: this.parent.eventDragArea ? true : false,
22040
22032
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
22041
22033
  dragArea: this.dragArea,
22042
22034
  dragStart: this.dragStart.bind(this),
@@ -22059,8 +22051,12 @@ class DragAndDrop extends ActionBase {
22059
22051
  }
22060
22052
  this.setDragActionDefaultValues();
22061
22053
  this.actionObj.element = e.element;
22062
- this.eleTop = parseFloat(this.actionObj.element.style.top);
22063
- this.slotsUptoCursor = -1;
22054
+ if (e.sender && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1) {
22055
+ const eventArgs = this.parent.eventBase.getPageCoordinates(e.sender);
22056
+ this.distanceUptoCursor = eventArgs.clientY - this.actionObj.element.getBoundingClientRect().top;
22057
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
22058
+ this.slotsUptoCursor = -1;
22059
+ }
22064
22060
  this.actionObj.action = 'drag';
22065
22061
  let elements = [];
22066
22062
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -22140,11 +22136,11 @@ class DragAndDrop extends ActionBase {
22140
22136
  let top = parseInt(e.top, 10);
22141
22137
  top = top < 0 ? 0 : top;
22142
22138
  if (this.slotsUptoCursor < 0) {
22143
- const cellsCountUptoCursor = Math.floor(top / cellHeight);
22139
+ const cellsCountUptoCursor = Math.floor((this.eleTop + this.distanceUptoCursor) / cellHeight);
22144
22140
  const cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
22145
22141
  this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
22146
22142
  }
22147
- top = (Math.floor((top + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22143
+ top = (Math.floor((top + this.distanceUptoCursor + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22148
22144
  topValue = formatUnit(top < 0 ? 0 : top);
22149
22145
  const scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
22150
22146
  const cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
@@ -22230,7 +22226,9 @@ class DragAndDrop extends ActionBase {
22230
22226
  rows[rows.length - 1].option !== 'Date';
22231
22227
  this.isTimelineDayProcess = !this.parent.activeViewOptions.timeScale.enable || this.isHeaderRows ||
22232
22228
  this.parent.currentView === 'TimelineMonth' || (rows.length > 0 && rows[rows.length - 1].option === 'Date');
22233
- this.isStepDragging = !this.isTimelineDayProcess && (this.actionObj.slotInterval !== this.actionObj.interval);
22229
+ this.isAllDayDrag = !this.isTimelineDayProcess && eventObj[this.parent.eventFields.isAllDay];
22230
+ this.isStepDragging = !this.isTimelineDayProcess && !this.isAllDayDrag &&
22231
+ (this.actionObj.slotInterval !== this.actionObj.interval);
22234
22232
  if (this.isTimelineDayProcess) {
22235
22233
  this.timelineEventModule = new TimelineEvent(this.parent, 'day');
22236
22234
  }
@@ -22299,9 +22297,11 @@ class DragAndDrop extends ActionBase {
22299
22297
  this.heightUptoCursorPoint = (this.heightUptoCursorPoint === 0) ?
22300
22298
  Math.ceil((Math.abs(this.actionObj.clone.getBoundingClientRect().top - this.actionObj.Y) / this.heightPerMinute)) *
22301
22299
  this.heightPerMinute : this.heightUptoCursorPoint;
22302
- this.isAllDayDrag = (this.parent.activeViewOptions.timeScale.enable) ?
22303
- this.actionObj.clone.classList.contains(ALLDAY_APPOINTMENT_CLASS) :
22304
- this.actionObj.event[this.parent.eventFields.isAllDay];
22300
+ if (['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1) {
22301
+ this.isAllDayDrag = (this.parent.activeViewOptions.timeScale.enable) ?
22302
+ this.actionObj.clone.classList.contains(ALLDAY_APPOINTMENT_CLASS) :
22303
+ this.actionObj.event[this.parent.eventFields.isAllDay];
22304
+ }
22305
22305
  if (this.isStepDragging && this.minDiff === 0) {
22306
22306
  this.calculateMinutesDiff(eventObj);
22307
22307
  }
@@ -23063,6 +23063,7 @@ class DragAndDrop extends ActionBase {
23063
23063
  index = index < 0 ? 0 : index;
23064
23064
  let eventStart = this.isHeaderRows ? new Date(this.timelineEventModule.dateRender[parseInt(index.toString(), 10)].getTime()) :
23065
23065
  this.parent.getDateFromElement(tr.children[parseInt(index.toString(), 10)]);
23066
+ eventStart = this.isAllDayDrag ? resetTime(eventStart) : eventStart;
23066
23067
  if (this.isStepDragging) {
23067
23068
  const widthDiff = this.getWidthDiff(tr, index);
23068
23069
  if (widthDiff !== 0) {
@@ -23087,8 +23088,8 @@ class DragAndDrop extends ActionBase {
23087
23088
  }
23088
23089
  }
23089
23090
  else {
23090
- if (this.isCursorAhead || cursorDrag) {
23091
- const minutes = this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval;
23091
+ if ((this.isCursorAhead || cursorDrag) && !this.isAllDayDrag) {
23092
+ const minutes = this.isTimelineDayProcess || this.isAllDayDrag ? MINUTES_PER_DAY : this.actionObj.slotInterval;
23092
23093
  eventStart.setMinutes(eventStart.getMinutes() + minutes);
23093
23094
  eventStart.setMilliseconds(-(eventDuration));
23094
23095
  if (eventStart.getTime() === resetTime(eventStart).getTime() && eventStart.getMinutes() === 0 && eventDuration === 0) {
@@ -23096,14 +23097,14 @@ class DragAndDrop extends ActionBase {
23096
23097
  }
23097
23098
  }
23098
23099
  else {
23099
- eventStart.setMinutes(eventStart.getMinutes() -
23100
- (this.cursorPointIndex * (this.isTimelineDayProcess ? MINUTES_PER_DAY : this.actionObj.slotInterval)));
23100
+ eventStart.setMinutes(eventStart.getMinutes() - (this.cursorPointIndex *
23101
+ (this.isTimelineDayProcess || this.isAllDayDrag ? MINUTES_PER_DAY : this.actionObj.slotInterval)));
23101
23102
  }
23102
23103
  }
23103
23104
  if (!this.isStepDragging) {
23104
23105
  eventStart = this.calculateIntervalTime(eventStart);
23105
23106
  }
23106
- if (this.isTimelineDayProcess) {
23107
+ if (this.isTimelineDayProcess || this.isAllDayDrag) {
23107
23108
  const eventSrt = eventObj[this.parent.eventFields.startTime];
23108
23109
  eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds());
23109
23110
  }
@@ -23237,12 +23238,13 @@ class DragAndDrop extends ActionBase {
23237
23238
  const td = closest(e.target, '.e-work-cells');
23238
23239
  if (!isNullOrUndefined(td) && !this.isMorePopupOpened) {
23239
23240
  let targetDate = this.parent.getDateFromElement(td);
23241
+ targetDate = this.isAllDayDrag ? resetTime(targetDate) : targetDate;
23240
23242
  if (this.isHeaderRows) {
23241
23243
  const currentIndex = Math.floor(left / this.actionObj.cellWidth);
23242
23244
  targetDate = new Date(this.timelineEventModule.dateRender[currentIndex + index].getTime());
23243
23245
  }
23244
23246
  const timeDiff = targetDate.getTime() - event[this.parent.eventFields.startTime].getTime();
23245
- if (this.isTimelineDayProcess) {
23247
+ if (this.isTimelineDayProcess || this.isAllDayDrag) {
23246
23248
  this.cursorPointIndex = Math.abs(Math.ceil(timeDiff / (MS_PER_DAY)));
23247
23249
  }
23248
23250
  else {
@@ -24506,7 +24508,7 @@ class VerticalView extends ViewBase {
24506
24508
  const ntr = trEle.cloneNode();
24507
24509
  const appointmentExpandCollapse = createElement('div', {
24508
24510
  attrs: {
24509
- 'tabindex': '0', 'role': 'list',
24511
+ 'tabindex': '0', 'role': 'button',
24510
24512
  title: this.parent.localeObj.getConstant('expandAllDaySection'), 'aria-disabled': 'false',
24511
24513
  'aria-label': this.parent.localeObj.getConstant('expandAllDaySection')
24512
24514
  },
@@ -24639,7 +24641,7 @@ class VerticalView extends ViewBase {
24639
24641
  getContentRows() {
24640
24642
  const rows = [];
24641
24643
  const tr = createElement('tr');
24642
- const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
24644
+ const td = createElement('td');
24643
24645
  const existingGroupIndices = this.getGroupIndices();
24644
24646
  const handler = (r) => {
24645
24647
  const ntr = tr.cloneNode();
@@ -25373,7 +25375,7 @@ class Month extends ViewBase {
25373
25375
  getContentRows() {
25374
25376
  const trows = [];
25375
25377
  const tr = createElement('tr');
25376
- const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
25378
+ const td = createElement('td');
25377
25379
  const slotDatas = this.getContentSlots();
25378
25380
  const isTimeline = this.parent.currentView === 'TimelineMonth';
25379
25381
  const existingGroupIndices = isTimeline ? this.getGroupIndices() : [];
@@ -27418,7 +27420,7 @@ class TimelineViews extends VerticalView {
27418
27420
  getContentRows() {
27419
27421
  const rows = [];
27420
27422
  const tr = createElement('tr');
27421
- const td = createElement('td', { attrs: { 'aria-selected': 'false' } });
27423
+ const td = createElement('td');
27422
27424
  const trCount = this.getRowCount();
27423
27425
  const existingGroupIndices = this.getGroupIndices();
27424
27426
  for (let i = 0; i < trCount; i++) {
@@ -27848,7 +27850,7 @@ class TimelineYear extends Year {
27848
27850
  skeleton: 'full', calendar: this.parent.getCalendarMode()
27849
27851
  });
27850
27852
  const td = createElement('td', {
27851
- className: WORK_CELLS_CLASS, attrs: { 'aria-selected': 'false', 'aria-label': announcementText }
27853
+ className: WORK_CELLS_CLASS, attrs: { 'aria-label': announcementText }
27852
27854
  });
27853
27855
  contentTr.appendChild(td);
27854
27856
  const dateHeader = createElement('div', {