@syncfusion/ej2-schedule 21.2.6 → 21.2.10

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +30 -16
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +30 -16
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +15 -15
  13. package/src/schedule/actions/drag.js +3 -1
  14. package/src/schedule/event-renderer/timeline-view.js +5 -4
  15. package/src/schedule/popups/event-window.js +8 -1
  16. package/src/schedule/renderer/header-renderer.js +4 -4
  17. package/src/schedule/renderer/timeline-view.js +10 -6
  18. package/styles/bootstrap-dark.css +6 -0
  19. package/styles/bootstrap.css +6 -0
  20. package/styles/bootstrap4.css +6 -0
  21. package/styles/bootstrap5-dark.css +6 -0
  22. package/styles/bootstrap5.css +6 -0
  23. package/styles/fabric-dark.css +6 -0
  24. package/styles/fabric.css +6 -0
  25. package/styles/fluent-dark.css +6 -0
  26. package/styles/fluent.css +6 -0
  27. package/styles/highcontrast-light.css +6 -0
  28. package/styles/highcontrast.css +6 -0
  29. package/styles/material-dark.css +6 -0
  30. package/styles/material.css +6 -0
  31. package/styles/schedule/_layout.scss +5 -0
  32. package/styles/schedule/bootstrap-dark.css +6 -0
  33. package/styles/schedule/bootstrap.css +6 -0
  34. package/styles/schedule/bootstrap4.css +6 -0
  35. package/styles/schedule/bootstrap5-dark.css +6 -0
  36. package/styles/schedule/bootstrap5.css +6 -0
  37. package/styles/schedule/fabric-dark.css +6 -0
  38. package/styles/schedule/fabric.css +6 -0
  39. package/styles/schedule/fluent-dark.css +6 -0
  40. package/styles/schedule/fluent.css +6 -0
  41. package/styles/schedule/highcontrast-light.css +6 -0
  42. package/styles/schedule/highcontrast.css +6 -0
  43. package/styles/schedule/material-dark.css +6 -0
  44. package/styles/schedule/material.css +6 -0
  45. package/styles/schedule/tailwind-dark.css +6 -0
  46. package/styles/schedule/tailwind.css +6 -0
  47. package/styles/tailwind-dark.css +6 -0
  48. package/styles/tailwind.css +6 -0
@@ -1118,7 +1118,7 @@ class HeaderRenderer {
1118
1118
  }
1119
1119
  else {
1120
1120
  const text = this.parent.activeView.getDateRangeText(date);
1121
- selEle.setAttribute('aria-label', text);
1121
+ selEle.firstElementChild.setAttribute('aria-label', text);
1122
1122
  textEle.textContent = text;
1123
1123
  }
1124
1124
  this.refresh();
@@ -1149,16 +1149,16 @@ class HeaderRenderer {
1149
1149
  const items = [];
1150
1150
  items.push({
1151
1151
  align: 'Left', prefixIcon: 'e-icon-prev', tooltipText: 'Previous', overflow: 'Show',
1152
- cssClass: 'e-prev', htmlAttributes: { 'aria-label': 'previous period', 'role': 'navigation' }
1152
+ cssClass: 'e-prev', htmlAttributes: { 'role': 'navigation' }
1153
1153
  });
1154
1154
  items.push({
1155
1155
  align: 'Left', prefixIcon: 'e-icon-next', tooltipText: 'Next', overflow: 'Show',
1156
- cssClass: 'e-next', htmlAttributes: { 'aria-label': 'next period', 'role': 'navigation' }
1156
+ cssClass: 'e-next', htmlAttributes: { 'role': 'navigation' }
1157
1157
  });
1158
1158
  items.push({
1159
1159
  align: 'Left', text: this.getDateRangeText(), suffixIcon: 'e-icon-down-arrow', cssClass: 'e-date-range',
1160
1160
  overflow: 'Show',
1161
- htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title', 'role': 'navigation' }
1161
+ htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'role': 'navigation' }
1162
1162
  });
1163
1163
  if (this.parent.isAdaptive || this.parent.enableAdaptiveUI) {
1164
1164
  items.push({
@@ -7984,7 +7984,8 @@ class TimelineEvent extends MonthEvent {
7984
7984
  if (this.parent.activeViewOptions.headerRows.length > 0 &&
7985
7985
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
7986
7986
  this.renderType = 'day';
7987
- this.cellWidth = this.content.offsetWidth / this.dateRender.length;
7987
+ const workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
7988
+ this.cellWidth = workCell.getBoundingClientRect().width / +(workCell.getAttribute('colspan') || 1);
7988
7989
  this.slotsPerDay = 1;
7989
7990
  }
7990
7991
  else {
@@ -8186,7 +8187,7 @@ class TimelineEvent extends MonthEvent {
8186
8187
  renderTimelineMoreIndicator(startTime, startDate, endDate, appHeight, interval, resIndex, appointmentsList, top, appLeft, appRight, cellTd, moreIndicator, appPos, position) {
8187
8188
  appLeft = (this.parent.enableRtl) ? appRight = position : position;
8188
8189
  appPos = (this.parent.enableRtl) ? appRight : appLeft;
8189
- appPos = (Math.round(appPos / this.cellWidth) * this.cellWidth);
8190
+ appPos = (Math.floor(appPos / this.cellWidth) * this.cellWidth);
8190
8191
  if ((cellTd && isNullOrUndefined(moreIndicator)) ||
8191
8192
  (!this.isAlreadyAvail(appPos, cellTd))) {
8192
8193
  const startDateTime = (this.parent.activeViewOptions.option === 'TimelineMonth' || this.renderType === 'day') ? new Date(+startTime) : startDate;
@@ -8213,8 +8214,8 @@ class TimelineEvent extends MonthEvent {
8213
8214
  }
8214
8215
  moreIndicatorElement.style.top = top + appArea + 'px';
8215
8216
  moreIndicatorElement.style.width = this.cellWidth + 'px';
8216
- moreIndicatorElement.style.left = ((appLeft / this.cellWidth) * this.cellWidth) + 'px';
8217
- moreIndicatorElement.style.right = ((appRight / this.cellWidth) * this.cellWidth) + 'px';
8217
+ moreIndicatorElement.style.left = (Math.floor(appLeft / this.cellWidth) * this.cellWidth) + 'px';
8218
+ moreIndicatorElement.style.right = (Math.floor(appRight / this.cellWidth) * this.cellWidth) + 'px';
8218
8219
  this.renderElement(cellTd, moreIndicatorElement);
8219
8220
  EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
8220
8221
  }
@@ -11614,6 +11615,7 @@ class EventWindow {
11614
11615
  }
11615
11616
  }
11616
11617
  onBeforeOpen(args) {
11618
+ const endTime = this.eventData[this.fields.endTime].getTime();
11617
11619
  const eventProp = {
11618
11620
  type: 'Editor',
11619
11621
  data: this.eventData,
@@ -11638,6 +11640,12 @@ class EventWindow {
11638
11640
  this.parent.trigger(popupOpen, eventProp, (popupArgs) => {
11639
11641
  args.cancel = popupArgs.cancel;
11640
11642
  this.duration = this.cellClickAction ? popupArgs.duration : null;
11643
+ if (this.eventData[this.fields.endTime].getTime() === endTime && !this.cellClickAction &&
11644
+ this.eventData[this.fields.endTime].getHours() === 0 &&
11645
+ this.eventData[this.fields.endTime].getMinutes() === 0) {
11646
+ this.eventData = extend({}, this.eventData, null, true);
11647
+ this.trimAllDay(this.eventData);
11648
+ }
11641
11649
  this.refreshDateTimePicker(this.duration);
11642
11650
  if (this.cellClickAction && popupArgs.duration !== this.getSlotDuration() && isNullOrUndefined(this.parent.editorTemplate)) {
11643
11651
  const startObj = this.getInstance(EVENT_WINDOW_START_CLASS);
@@ -12303,12 +12311,12 @@ class EventWindow {
12303
12311
  this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
12304
12312
  }
12305
12313
  showDetails(eventData) {
12314
+ this.eventData = eventData;
12306
12315
  const eventObj = extend({}, eventData, null, true);
12307
12316
  if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
12308
12317
  eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
12309
12318
  this.trimAllDay(eventObj);
12310
12319
  }
12311
- this.eventData = eventObj;
12312
12320
  const formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
12313
12321
  const keyNames = Object.keys(eventObj);
12314
12322
  for (const curElement of formElements) {
@@ -20998,7 +21006,9 @@ class DragAndDrop extends ActionBase {
20998
21006
  (dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
20999
21007
  (this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
21000
21008
  offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
21001
- this.actionObj.clone.style.top = formatUnit(offsetTop);
21009
+ if (dragArea.scrollTop > 0) {
21010
+ this.actionObj.clone.style.top = formatUnit(offsetTop);
21011
+ }
21002
21012
  }
21003
21013
  const rowIndex = (this.parent.activeViewOptions.timeScale.enable) ? (offsetTop / this.actionObj.cellHeight) : 0;
21004
21014
  const heightPerMinute = this.actionObj.cellHeight / this.actionObj.slotInterval;
@@ -25524,18 +25534,22 @@ class TimelineViews extends VerticalView {
25524
25534
  }
25525
25535
  getLeftFromDateTime(currentDateIndex, date) {
25526
25536
  const startHour = this.getStartHour();
25527
- const endHour = this.getEndHour();
25528
25537
  let diffInDates = 0;
25529
25538
  let diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
25530
25539
  if (!isNullOrUndefined(currentDateIndex)) {
25531
- const end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
25532
25540
  if (currentDateIndex[0] !== 0) {
25533
- diffInDates = (currentDateIndex[0]) * ((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes());
25541
+ if (this.parent.activeView.colLevels[0] && this.parent.activeView.colLevels[0][0].colSpan) {
25542
+ diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[0][0].colSpan * this.getWorkCellWidth();
25543
+ }
25544
+ else {
25545
+ const endHour = this.getEndHour();
25546
+ const end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
25547
+ diffInMinutes = diffInMinutes + ((currentDateIndex[0]) * (((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes())));
25548
+ }
25534
25549
  }
25535
- diffInMinutes = diffInDates + diffInMinutes;
25536
25550
  }
25537
- return (diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
25538
- this.parent.activeViewOptions.timeScale.interval;
25551
+ return diffInDates + ((diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
25552
+ this.parent.activeViewOptions.timeScale.interval);
25539
25553
  }
25540
25554
  getWorkCellWidth() {
25541
25555
  return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;