@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
@@ -1121,7 +1121,7 @@ var HeaderRenderer = /** @__PURE__ @class */ (function () {
1121
1121
  }
1122
1122
  else {
1123
1123
  var text = this.parent.activeView.getDateRangeText(date);
1124
- selEle.setAttribute('aria-label', text);
1124
+ selEle.firstElementChild.setAttribute('aria-label', text);
1125
1125
  textEle.textContent = text;
1126
1126
  }
1127
1127
  this.refresh();
@@ -1152,16 +1152,16 @@ var HeaderRenderer = /** @__PURE__ @class */ (function () {
1152
1152
  var items = [];
1153
1153
  items.push({
1154
1154
  align: 'Left', prefixIcon: 'e-icon-prev', tooltipText: 'Previous', overflow: 'Show',
1155
- cssClass: 'e-prev', htmlAttributes: { 'aria-label': 'previous period', 'role': 'navigation' }
1155
+ cssClass: 'e-prev', htmlAttributes: { 'role': 'navigation' }
1156
1156
  });
1157
1157
  items.push({
1158
1158
  align: 'Left', prefixIcon: 'e-icon-next', tooltipText: 'Next', overflow: 'Show',
1159
- cssClass: 'e-next', htmlAttributes: { 'aria-label': 'next period', 'role': 'navigation' }
1159
+ cssClass: 'e-next', htmlAttributes: { 'role': 'navigation' }
1160
1160
  });
1161
1161
  items.push({
1162
1162
  align: 'Left', text: this.getDateRangeText(), suffixIcon: 'e-icon-down-arrow', cssClass: 'e-date-range',
1163
1163
  overflow: 'Show',
1164
- htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'aria-label': 'title', 'role': 'navigation' }
1164
+ htmlAttributes: { 'aria-atomic': 'true', 'aria-live': 'assertive', 'role': 'navigation' }
1165
1165
  });
1166
1166
  if (this.parent.isAdaptive || this.parent.enableAdaptiveUI) {
1167
1167
  items.push({
@@ -8181,7 +8181,8 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8181
8181
  if (this.parent.activeViewOptions.headerRows.length > 0 &&
8182
8182
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
8183
8183
  this.renderType = 'day';
8184
- this.cellWidth = this.content.offsetWidth / this.dateRender.length;
8184
+ var workCell = this.content.querySelector('.' + WORK_CELLS_CLASS);
8185
+ this.cellWidth = workCell.getBoundingClientRect().width / +(workCell.getAttribute('colspan') || 1);
8185
8186
  this.slotsPerDay = 1;
8186
8187
  }
8187
8188
  else {
@@ -8386,7 +8387,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8386
8387
  TimelineEvent.prototype.renderTimelineMoreIndicator = function (startTime, startDate, endDate, appHeight, interval, resIndex, appointmentsList, top, appLeft, appRight, cellTd, moreIndicator, appPos, position) {
8387
8388
  appLeft = (this.parent.enableRtl) ? appRight = position : position;
8388
8389
  appPos = (this.parent.enableRtl) ? appRight : appLeft;
8389
- appPos = (Math.round(appPos / this.cellWidth) * this.cellWidth);
8390
+ appPos = (Math.floor(appPos / this.cellWidth) * this.cellWidth);
8390
8391
  if ((cellTd && isNullOrUndefined(moreIndicator)) ||
8391
8392
  (!this.isAlreadyAvail(appPos, cellTd))) {
8392
8393
  var startDateTime = (this.parent.activeViewOptions.option === 'TimelineMonth' || this.renderType === 'day') ? new Date(+startTime) : startDate;
@@ -8413,8 +8414,8 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8413
8414
  }
8414
8415
  moreIndicatorElement.style.top = top + appArea + 'px';
8415
8416
  moreIndicatorElement.style.width = this.cellWidth + 'px';
8416
- moreIndicatorElement.style.left = ((appLeft / this.cellWidth) * this.cellWidth) + 'px';
8417
- moreIndicatorElement.style.right = ((appRight / this.cellWidth) * this.cellWidth) + 'px';
8417
+ moreIndicatorElement.style.left = (Math.floor(appLeft / this.cellWidth) * this.cellWidth) + 'px';
8418
+ moreIndicatorElement.style.right = (Math.floor(appRight / this.cellWidth) * this.cellWidth) + 'px';
8418
8419
  this.renderElement(cellTd, moreIndicatorElement);
8419
8420
  EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
8420
8421
  }
@@ -11881,6 +11882,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11881
11882
  };
11882
11883
  EventWindow.prototype.onBeforeOpen = function (args) {
11883
11884
  var _this = this;
11885
+ var endTime = this.eventData[this.fields.endTime].getTime();
11884
11886
  var eventProp = {
11885
11887
  type: 'Editor',
11886
11888
  data: this.eventData,
@@ -11905,6 +11907,12 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11905
11907
  this.parent.trigger(popupOpen, eventProp, function (popupArgs) {
11906
11908
  args.cancel = popupArgs.cancel;
11907
11909
  _this.duration = _this.cellClickAction ? popupArgs.duration : null;
11910
+ if (_this.eventData[_this.fields.endTime].getTime() === endTime && !_this.cellClickAction &&
11911
+ _this.eventData[_this.fields.endTime].getHours() === 0 &&
11912
+ _this.eventData[_this.fields.endTime].getMinutes() === 0) {
11913
+ _this.eventData = extend({}, _this.eventData, null, true);
11914
+ _this.trimAllDay(_this.eventData);
11915
+ }
11908
11916
  _this.refreshDateTimePicker(_this.duration);
11909
11917
  if (_this.cellClickAction && popupArgs.duration !== _this.getSlotDuration() && isNullOrUndefined(_this.parent.editorTemplate)) {
11910
11918
  var startObj = _this.getInstance(EVENT_WINDOW_START_CLASS);
@@ -12586,12 +12594,12 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12586
12594
  this.fieldValidator.renderFormValidator(form, rules, this.element, this.parent.locale);
12587
12595
  };
12588
12596
  EventWindow.prototype.showDetails = function (eventData) {
12597
+ this.eventData = eventData;
12589
12598
  var eventObj = extend({}, eventData, null, true);
12590
12599
  if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
12591
12600
  eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
12592
12601
  this.trimAllDay(eventObj);
12593
12602
  }
12594
- this.eventData = eventObj;
12595
12603
  var formElements = this.getFormElements(EVENT_WINDOW_DIALOG_CLASS);
12596
12604
  var keyNames = Object.keys(eventObj);
12597
12605
  for (var _i = 0, formElements_2 = formElements; _i < formElements_2.length; _i++) {
@@ -21752,7 +21760,9 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
21752
21760
  (dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
21753
21761
  (this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
21754
21762
  offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
21755
- this.actionObj.clone.style.top = formatUnit(offsetTop);
21763
+ if (dragArea.scrollTop > 0) {
21764
+ this.actionObj.clone.style.top = formatUnit(offsetTop);
21765
+ }
21756
21766
  }
21757
21767
  var rowIndex = (this.parent.activeViewOptions.timeScale.enable) ? (offsetTop / this.actionObj.cellHeight) : 0;
21758
21768
  var heightPerMinute = this.actionObj.cellHeight / this.actionObj.slotInterval;
@@ -26506,18 +26516,22 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
26506
26516
  };
26507
26517
  TimelineViews.prototype.getLeftFromDateTime = function (currentDateIndex, date) {
26508
26518
  var startHour = this.getStartHour();
26509
- var endHour = this.getEndHour();
26510
26519
  var diffInDates = 0;
26511
26520
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
26512
26521
  if (!isNullOrUndefined(currentDateIndex)) {
26513
- var end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
26514
26522
  if (currentDateIndex[0] !== 0) {
26515
- diffInDates = (currentDateIndex[0]) * ((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes());
26523
+ if (this.parent.activeView.colLevels[0] && this.parent.activeView.colLevels[0][0].colSpan) {
26524
+ diffInDates = currentDateIndex[0] * this.parent.activeView.colLevels[0][0].colSpan * this.getWorkCellWidth();
26525
+ }
26526
+ else {
26527
+ var endHour = this.getEndHour();
26528
+ var end = (endHour.getHours() === 0) ? 24 : endHour.getHours();
26529
+ diffInMinutes = diffInMinutes + ((currentDateIndex[0]) * (((end - startHour.getHours()) * 60) + (endHour.getMinutes() - startHour.getMinutes())));
26530
+ }
26516
26531
  }
26517
- diffInMinutes = diffInDates + diffInMinutes;
26518
26532
  }
26519
- return (diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
26520
- this.parent.activeViewOptions.timeScale.interval;
26533
+ return diffInDates + ((diffInMinutes * this.getWorkCellWidth() * this.parent.activeViewOptions.timeScale.slotCount) /
26534
+ this.parent.activeViewOptions.timeScale.interval);
26521
26535
  };
26522
26536
  TimelineViews.prototype.getWorkCellWidth = function () {
26523
26537
  return this.element.querySelector('.e-work-cells').getBoundingClientRect().width;