@syncfusion/ej2-schedule 29.2.10 → 30.1.38

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 (94) hide show
  1. package/.eslintrc.json +2 -0
  2. package/README.md +1 -0
  3. package/dist/ej2-schedule.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js +2 -2
  5. package/dist/ej2-schedule.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-schedule.es2015.js +58 -19
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +58 -18
  9. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  10. package/dist/global/ej2-schedule.min.js +2 -2
  11. package/dist/global/ej2-schedule.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +11 -11
  14. package/src/schedule/actions/crud.js +2 -2
  15. package/src/schedule/actions/keyboard.js +3 -0
  16. package/src/schedule/actions/resize.js +1 -1
  17. package/src/schedule/actions/touch.d.ts +1 -0
  18. package/src/schedule/actions/touch.js +27 -0
  19. package/src/schedule/actions/virtual-scroll.js +2 -1
  20. package/src/schedule/actions/work-cells.js +3 -0
  21. package/src/schedule/event-renderer/agenda-base.js +2 -8
  22. package/src/schedule/event-renderer/month.js +4 -2
  23. package/src/schedule/event-renderer/timeline-view.js +1 -1
  24. package/src/schedule/event-renderer/vertical-view.js +7 -2
  25. package/src/schedule/popups/event-window.js +3 -0
  26. package/src/schedule/renderer/header-renderer.js +2 -1
  27. package/src/schedule/renderer/timeline-view.js +1 -1
  28. package/src/schedule/renderer/vertical-view.js +1 -0
  29. package/styles/bds-lite.css +5 -1
  30. package/styles/bds.css +10 -2
  31. package/styles/bootstrap-dark-lite.css +5 -1
  32. package/styles/bootstrap-dark.css +10 -2
  33. package/styles/bootstrap-lite.css +5 -1
  34. package/styles/bootstrap.css +10 -2
  35. package/styles/bootstrap4-lite.css +5 -1
  36. package/styles/bootstrap4.css +10 -2
  37. package/styles/bootstrap5-dark-lite.css +5 -1
  38. package/styles/bootstrap5-dark.css +10 -2
  39. package/styles/bootstrap5-lite.css +5 -1
  40. package/styles/bootstrap5.3-lite.css +5 -1
  41. package/styles/bootstrap5.3.css +10 -2
  42. package/styles/bootstrap5.css +10 -2
  43. package/styles/fabric-dark-lite.css +5 -1
  44. package/styles/fabric-dark.css +10 -2
  45. package/styles/fabric-lite.css +5 -1
  46. package/styles/fabric.css +10 -2
  47. package/styles/fluent-dark-lite.css +5 -1
  48. package/styles/fluent-dark.css +10 -2
  49. package/styles/fluent-lite.css +5 -1
  50. package/styles/fluent.css +10 -2
  51. package/styles/fluent2-lite.css +8 -4
  52. package/styles/fluent2.css +14 -6
  53. package/styles/highcontrast-light-lite.css +5 -1
  54. package/styles/highcontrast-light.css +10 -2
  55. package/styles/highcontrast-lite.css +5 -1
  56. package/styles/highcontrast.css +10 -2
  57. package/styles/material-dark-lite.css +5 -1
  58. package/styles/material-dark.css +10 -2
  59. package/styles/material-lite.css +5 -1
  60. package/styles/material.css +10 -2
  61. package/styles/material3-dark-lite.css +5 -1
  62. package/styles/material3-dark.css +10 -2
  63. package/styles/material3-lite.css +5 -1
  64. package/styles/material3.css +10 -2
  65. package/styles/schedule/_bigger.scss +8 -2
  66. package/styles/schedule/_fluent2-definition.scss +1 -1
  67. package/styles/schedule/_layout.scss +6 -2
  68. package/styles/schedule/bds.css +10 -2
  69. package/styles/schedule/bootstrap-dark.css +10 -2
  70. package/styles/schedule/bootstrap.css +10 -2
  71. package/styles/schedule/bootstrap4.css +10 -2
  72. package/styles/schedule/bootstrap5-dark.css +10 -2
  73. package/styles/schedule/bootstrap5.3.css +10 -2
  74. package/styles/schedule/bootstrap5.css +10 -2
  75. package/styles/schedule/fabric-dark.css +10 -2
  76. package/styles/schedule/fabric.css +10 -2
  77. package/styles/schedule/fluent-dark.css +10 -2
  78. package/styles/schedule/fluent.css +10 -2
  79. package/styles/schedule/fluent2.css +14 -6
  80. package/styles/schedule/highcontrast-light.css +10 -2
  81. package/styles/schedule/highcontrast.css +10 -2
  82. package/styles/schedule/material-dark.css +10 -2
  83. package/styles/schedule/material.css +10 -2
  84. package/styles/schedule/material3-dark.css +10 -2
  85. package/styles/schedule/material3.css +10 -2
  86. package/styles/schedule/tailwind-dark.css +10 -2
  87. package/styles/schedule/tailwind.css +10 -2
  88. package/styles/schedule/tailwind3.css +10 -2
  89. package/styles/tailwind-dark-lite.css +5 -1
  90. package/styles/tailwind-dark.css +10 -2
  91. package/styles/tailwind-lite.css +5 -1
  92. package/styles/tailwind.css +10 -2
  93. package/styles/tailwind3-lite.css +5 -1
  94. package/styles/tailwind3.css +10 -2
@@ -1074,10 +1074,11 @@ var HeaderRenderer = /** @__PURE__ @class */ (function () {
1074
1074
  var closestEle = closest(e.event.target, '.e-date-range,.e-header-popup,.e-day,.e-selected');
1075
1075
  var closestPop = closest(e.event.target, '.e-hor-nav,.e-toolbar-pop');
1076
1076
  var contentWrap = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
1077
+ var toolbarPop = this.parent.element.querySelector('.e-toolbar-pop');
1077
1078
  if (this.parent.isAdaptive) {
1078
1079
  if (!isNullOrUndefined(closestPop) && (closestPop.classList.contains('e-toolbar-pop') ||
1079
1080
  closestPop.classList.contains('e-hor-nav')) && !(closestPop.classList.contains('e-hor-nav') &&
1080
- this.element.querySelector('.e-toolbar-pop').classList.contains(POPUP_OPEN))) {
1081
+ toolbarPop && toolbarPop.classList.contains(POPUP_OPEN))) {
1081
1082
  addClass([contentWrap], SCROLL_HIDDEN);
1082
1083
  }
1083
1084
  else {
@@ -2052,14 +2053,41 @@ var ScheduleTouch = /** @__PURE__ @class */ (function () {
2052
2053
  });
2053
2054
  };
2054
2055
  ScheduleTouch.prototype.cancelSwipe = function () {
2056
+ var _this = this;
2055
2057
  this.parent.activeView.setPanel(this.currentPanel.element);
2056
2058
  this.parent.setProperties({ selectedDate: this.currentPanel.selectedDate }, true);
2057
2059
  this.parent.activeView.renderDates = this.currentPanel.renderDates;
2060
+ if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.resourceBase.lastResourceLevel.length > 0) {
2061
+ var workDaysField_1 = this.parent.resourceBase.resourceCollection[0].workDaysField;
2062
+ this.parent.resourceBase.lastResourceLevel.forEach(function (resource) {
2063
+ if (workDaysField_1) {
2064
+ var resourceWorkDays = resource[workDaysField_1];
2065
+ var hasCustomWorkDays = Array.isArray(resourceWorkDays) &&
2066
+ (!_this.parent.showWeekend || _this.parent.currentView === 'WorkWeek');
2067
+ resource.renderDates = hasCustomWorkDays
2068
+ ? _this.calculateResourceSpecificDates(resource, workDaysField_1)
2069
+ : _this.currentPanel.renderDates;
2070
+ }
2071
+ else {
2072
+ resource.renderDates = _this.currentPanel.renderDates;
2073
+ }
2074
+ });
2075
+ }
2058
2076
  this.parent.activeView.colLevels = this.currentPanel.colLevels;
2059
2077
  addClass([this.element], TRANSLATE_CLASS);
2060
2078
  var prevWidth = this.previousPanel ? this.previousPanel.element.offsetWidth : 0;
2061
2079
  this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';
2062
2080
  };
2081
+ ScheduleTouch.prototype.calculateResourceSpecificDates = function (resource, workDaysField) {
2082
+ var resourceDates = [];
2083
+ var resourceWorkDays = resource[workDaysField];
2084
+ this.currentPanel.renderDates.forEach(function (date) {
2085
+ if (Array.isArray(resourceWorkDays) && resourceWorkDays.indexOf(date.getDay()) !== -1) {
2086
+ resourceDates.push(date);
2087
+ }
2088
+ });
2089
+ return resourceDates;
2090
+ };
2063
2091
  ScheduleTouch.prototype.onTransitionEnd = function () {
2064
2092
  if (!isNullOrUndefined(this.element) && !this.element.classList.contains(TRANSLATE_CLASS)) {
2065
2093
  return;
@@ -2392,6 +2420,9 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
2392
2420
  }
2393
2421
  var queryStr = '.' + WORK_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS + ',.' + HEADER_CELLS_CLASS;
2394
2422
  var target = closest(e.target, queryStr);
2423
+ if (!target) {
2424
+ return;
2425
+ }
2395
2426
  var selectedCells = this.parent.getSelectedCells();
2396
2427
  if (selectedCells.length > 0 && selectedCells.indexOf(target) === -1) {
2397
2428
  target = selectedCells[selectedCells.length - 1];
@@ -7552,10 +7583,15 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
7552
7583
  blockHeight = formatUnit(this.getHeight(eStart, eEnd));
7553
7584
  blockTop = formatUnit(this.getTopValue(eStart));
7554
7585
  }
7586
+ if (eventObj.IsBlock) {
7587
+ blockHeight = formatUnit(parseInt(blockHeight, 10) - 1);
7588
+ }
7555
7589
  var appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
7556
- setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
7590
+ var appWidth = eventObj.IsBlock ? '99%' : '100%';
7591
+ setStyleAttribute(appointmentElement, { 'width': appWidth, 'height': blockHeight, 'top': blockTop });
7557
7592
  var index = this.getDayIndex(dayIndex, resource, dayCount);
7558
- this.appendEvent(eventObj, appointmentElement, index, '0px');
7593
+ var appLeft = eventObj.IsBlock ? '0.5px' : '0px';
7594
+ this.appendEvent(eventObj, appointmentElement, index, appLeft);
7559
7595
  }
7560
7596
  };
7561
7597
  VerticalEvent.prototype.renderEvents = function (eventType) {
@@ -8523,9 +8559,11 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
8523
8559
  var diffInDays = eventData.count;
8524
8560
  var appWidth = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
8525
8561
  appWidth = (appWidth <= 0) ? this.cellWidth : appWidth;
8526
- var appLeft = (this.parent.enableRtl) ? 0 : position;
8527
- var appRight = (this.parent.enableRtl) ? position : 0;
8562
+ appWidth = event.IsBlock ? appWidth - 1 : appWidth;
8563
+ var appLeft = (this.parent.enableRtl) ? 0 : event.IsBlock ? position + 1 : position;
8564
+ var appRight = (this.parent.enableRtl) ? event.IsBlock ? position + 1 : position : 0;
8528
8565
  var appHeight = this.cellHeight - this.monthHeaderHeight;
8566
+ appHeight = event.IsBlock ? appHeight - 1 : appHeight;
8529
8567
  var appTop = this.getRowTop(resIndex);
8530
8568
  var blockElement = this.createBlockAppointmentElement(event, resIndex, this.isResourceEventTemplate);
8531
8569
  setStyleAttribute(blockElement, {
@@ -9361,7 +9399,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
9361
9399
  var element = blockElement_1[_i];
9362
9400
  var resIndex = parseInt(element.getAttribute('data-group-index'), 10);
9363
9401
  var firstChild = this.getFirstChild(resIndex);
9364
- element.style.height = firstChild.offsetHeight + 'px';
9402
+ element.style.height = (firstChild.offsetHeight - 1) + 'px';
9365
9403
  var width = element.offsetWidth / firstChild.offsetWidth;
9366
9404
  element.style.width = (firstChild.offsetWidth * width) + 'px';
9367
9405
  }
@@ -13693,6 +13731,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13693
13731
  this.dialogObject.show();
13694
13732
  };
13695
13733
  EventWindow.prototype.convertToEventData = function (cellsData, eventObj) {
13734
+ if (!cellsData) {
13735
+ return;
13736
+ }
13696
13737
  if (cellsData.subject) {
13697
13738
  eventObj[this.fields.subject] = cellsData.subject;
13698
13739
  }
@@ -14951,7 +14992,8 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14951
14992
  if ((conWrap.scrollTop) - this.translateY < 0) {
14952
14993
  resCollection = this.upScroll(conWrap, firstTDIndex);
14953
14994
  }
14954
- else if (conWrap.scrollTop - this.translateY > scrollHeight) {
14995
+ else if ((conWrap.scrollTop + conWrap.clientHeight >= conWrap.scrollHeight - this.itemSize) ||
14996
+ (conWrap.scrollTop > (this.translateY + scrollHeight))) {
14955
14997
  resCollection = this.downScroll(conWrap, firstTDIndex);
14956
14998
  }
14957
14999
  if (!isNullOrUndefined(resCollection) && resCollection.length > 0) {
@@ -16315,6 +16357,7 @@ var Crud = /** @__PURE__ @class */ (function () {
16315
16357
  if (!deleteArgs.cancel) {
16316
16358
  var fields_3 = _this.parent.eventFields;
16317
16359
  var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
16360
+ var cloneEvents = extend([], deleteArgs.deletedRecords, null, true);
16318
16361
  var _loop_5 = function (a, count) {
16319
16362
  var isDelete = isNullOrUndefined(deleteArgs.deletedRecords[parseInt(a.toString(), 10)][_this.parent.eventFields.recurrenceRule]);
16320
16363
  if (!isDelete) {
@@ -16351,8 +16394,7 @@ var Crud = /** @__PURE__ @class */ (function () {
16351
16394
  _loop_5(a, count);
16352
16395
  }
16353
16396
  var promise = _this.parent.dataModule.dataManager.saveChanges(editParams, fields_3.id, _this.getTable(), _this.getQuery());
16354
- var cloneEvent = extend({}, deleteArgs.deletedRecords[deleteArgs.deletedRecords.length - 1], null, true);
16355
- _this.parent.eventBase.selectWorkCellByTime([_this.parent.eventBase.processTimezone(cloneEvent)]);
16397
+ _this.parent.eventBase.selectWorkCellByTime(cloneEvents);
16356
16398
  var crudArgs = {
16357
16399
  requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
16358
16400
  };
@@ -16588,6 +16630,9 @@ var WorkCellInteraction = /** @__PURE__ @class */ (function () {
16588
16630
  }
16589
16631
  var args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellDoubleClick' });
16590
16632
  this.parent.trigger(cellDoubleClick, args, function (clickArgs) {
16633
+ if (!clickArgs.startTime) {
16634
+ return;
16635
+ }
16591
16636
  var date = new Date(clickArgs.startTime.getTime());
16592
16637
  if (!_this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {
16593
16638
  return;
@@ -22441,7 +22486,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22441
22486
  }
22442
22487
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
22443
22488
  }
22444
- var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
22489
+ var width = !isLeft && (Math.floor(offsetWidth + this.actionObj.clone.offsetLeft) > this.scrollArgs.width) ?
22445
22490
  this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
22446
22491
  if (this.parent.enableRtl) {
22447
22492
  var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
@@ -25532,6 +25577,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
25532
25577
  };
25533
25578
  VerticalView.prototype.changeCurrentTimePosition = function () {
25534
25579
  if (!this.parent || this.parent && this.parent.isDestroyed) {
25580
+ this.parent = null;
25535
25581
  return;
25536
25582
  }
25537
25583
  this.removeCurrentTimeIndicatorElements();
@@ -27431,13 +27477,7 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
27431
27477
  moduleName: 'agenda',
27432
27478
  listClass: this.parent.activeView.viewClass,
27433
27479
  itemClass: this.parent.activeView.viewClass,
27434
- template: function (data) {
27435
- var div = createElement('div', {
27436
- className: AGENDA_NO_EVENT_CLASS,
27437
- innerHTML: data.subject
27438
- });
27439
- return div;
27440
- }
27480
+ template: initializeCSPTemplate(function () { return "<div class=\"" + AGENDA_NO_EVENT_CLASS + "\">" + _this.parent.localeObj.getConstant('noEvents') + "</div>"; })
27441
27481
  });
27442
27482
  if (listElement.querySelector('.e-agenda-item').children.length === 0) {
27443
27483
  listElement.firstElementChild.appendChild(createElement('div', { className: AGENDA_NO_EVENT_CLASS, innerHTML: this.parent.localeObj.getConstant('noEvents') }));
@@ -28753,7 +28793,6 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
28753
28793
  };
28754
28794
  TimelineViews.prototype.changeCurrentTimePosition = function () {
28755
28795
  if (!this.parent || this.parent && this.parent.isDestroyed) {
28756
- this.parent = null;
28757
28796
  return;
28758
28797
  }
28759
28798
  this.removeCurrentTimeIndicatorElements();
@@ -28924,6 +28963,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
28924
28963
  };
28925
28964
  TimelineViews.prototype.destroy = function () {
28926
28965
  if (!this.parent || this.parent && this.parent.isDestroyed) {
28966
+ this.parent = null;
28927
28967
  return;
28928
28968
  }
28929
28969
  if (this.timelineAppointment) {