@syncfusion/ej2-schedule 29.2.8 → 30.1.37

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 (93) 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 +56 -12
  7. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  8. package/dist/es6/ej2-schedule.es5.js +56 -11
  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/work-cells.js +3 -0
  20. package/src/schedule/event-renderer/agenda-base.js +2 -2
  21. package/src/schedule/event-renderer/month.js +4 -2
  22. package/src/schedule/event-renderer/timeline-view.js +1 -1
  23. package/src/schedule/event-renderer/vertical-view.js +7 -2
  24. package/src/schedule/popups/event-window.js +3 -0
  25. package/src/schedule/renderer/header-renderer.js +2 -1
  26. package/src/schedule/renderer/timeline-view.js +1 -1
  27. package/src/schedule/renderer/vertical-view.js +1 -0
  28. package/styles/bds-lite.css +5 -1
  29. package/styles/bds.css +10 -2
  30. package/styles/bootstrap-dark-lite.css +5 -1
  31. package/styles/bootstrap-dark.css +10 -2
  32. package/styles/bootstrap-lite.css +5 -1
  33. package/styles/bootstrap.css +10 -2
  34. package/styles/bootstrap4-lite.css +5 -1
  35. package/styles/bootstrap4.css +10 -2
  36. package/styles/bootstrap5-dark-lite.css +5 -1
  37. package/styles/bootstrap5-dark.css +10 -2
  38. package/styles/bootstrap5-lite.css +5 -1
  39. package/styles/bootstrap5.3-lite.css +5 -1
  40. package/styles/bootstrap5.3.css +10 -2
  41. package/styles/bootstrap5.css +10 -2
  42. package/styles/fabric-dark-lite.css +5 -1
  43. package/styles/fabric-dark.css +10 -2
  44. package/styles/fabric-lite.css +5 -1
  45. package/styles/fabric.css +10 -2
  46. package/styles/fluent-dark-lite.css +5 -1
  47. package/styles/fluent-dark.css +10 -2
  48. package/styles/fluent-lite.css +5 -1
  49. package/styles/fluent.css +10 -2
  50. package/styles/fluent2-lite.css +8 -4
  51. package/styles/fluent2.css +14 -6
  52. package/styles/highcontrast-light-lite.css +5 -1
  53. package/styles/highcontrast-light.css +10 -2
  54. package/styles/highcontrast-lite.css +5 -1
  55. package/styles/highcontrast.css +10 -2
  56. package/styles/material-dark-lite.css +5 -1
  57. package/styles/material-dark.css +10 -2
  58. package/styles/material-lite.css +5 -1
  59. package/styles/material.css +10 -2
  60. package/styles/material3-dark-lite.css +5 -1
  61. package/styles/material3-dark.css +10 -2
  62. package/styles/material3-lite.css +5 -1
  63. package/styles/material3.css +10 -2
  64. package/styles/schedule/_bigger.scss +8 -2
  65. package/styles/schedule/_fluent2-definition.scss +1 -1
  66. package/styles/schedule/_layout.scss +6 -2
  67. package/styles/schedule/bds.css +10 -2
  68. package/styles/schedule/bootstrap-dark.css +10 -2
  69. package/styles/schedule/bootstrap.css +10 -2
  70. package/styles/schedule/bootstrap4.css +10 -2
  71. package/styles/schedule/bootstrap5-dark.css +10 -2
  72. package/styles/schedule/bootstrap5.3.css +10 -2
  73. package/styles/schedule/bootstrap5.css +10 -2
  74. package/styles/schedule/fabric-dark.css +10 -2
  75. package/styles/schedule/fabric.css +10 -2
  76. package/styles/schedule/fluent-dark.css +10 -2
  77. package/styles/schedule/fluent.css +10 -2
  78. package/styles/schedule/fluent2.css +14 -6
  79. package/styles/schedule/highcontrast-light.css +10 -2
  80. package/styles/schedule/highcontrast.css +10 -2
  81. package/styles/schedule/material-dark.css +10 -2
  82. package/styles/schedule/material.css +10 -2
  83. package/styles/schedule/material3-dark.css +10 -2
  84. package/styles/schedule/material3.css +10 -2
  85. package/styles/schedule/tailwind-dark.css +10 -2
  86. package/styles/schedule/tailwind.css +10 -2
  87. package/styles/schedule/tailwind3.css +10 -2
  88. package/styles/tailwind-dark-lite.css +5 -1
  89. package/styles/tailwind-dark.css +10 -2
  90. package/styles/tailwind-lite.css +5 -1
  91. package/styles/tailwind.css +10 -2
  92. package/styles/tailwind3-lite.css +5 -1
  93. 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
  }
@@ -16315,6 +16356,7 @@ var Crud = /** @__PURE__ @class */ (function () {
16315
16356
  if (!deleteArgs.cancel) {
16316
16357
  var fields_3 = _this.parent.eventFields;
16317
16358
  var editParams = { addedRecords: [], changedRecords: [], deletedRecords: [] };
16359
+ var cloneEvents = extend([], deleteArgs.deletedRecords, null, true);
16318
16360
  var _loop_5 = function (a, count) {
16319
16361
  var isDelete = isNullOrUndefined(deleteArgs.deletedRecords[parseInt(a.toString(), 10)][_this.parent.eventFields.recurrenceRule]);
16320
16362
  if (!isDelete) {
@@ -16351,8 +16393,7 @@ var Crud = /** @__PURE__ @class */ (function () {
16351
16393
  _loop_5(a, count);
16352
16394
  }
16353
16395
  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)]);
16396
+ _this.parent.eventBase.selectWorkCellByTime(cloneEvents);
16356
16397
  var crudArgs = {
16357
16398
  requestType: 'eventRemoved', cancel: false, data: deleteArgs.deletedRecords, promise: promise, editParams: editParams
16358
16399
  };
@@ -16588,6 +16629,9 @@ var WorkCellInteraction = /** @__PURE__ @class */ (function () {
16588
16629
  }
16589
16630
  var args = extend(this.parent.activeCellsData, { cancel: false, event: e, name: 'cellDoubleClick' });
16590
16631
  this.parent.trigger(cellDoubleClick, args, function (clickArgs) {
16632
+ if (!clickArgs.startTime) {
16633
+ return;
16634
+ }
16591
16635
  var date = new Date(clickArgs.startTime.getTime());
16592
16636
  if (!_this.parent.isMinMaxDate(new Date(date.setHours(0, 0, 0, 0)))) {
16593
16637
  return;
@@ -22441,7 +22485,7 @@ var Resize = /** @__PURE__ @class */ (function (_super) {
22441
22485
  }
22442
22486
  this.actionObj.event[this.parent.eventFields.isAllDay] = false;
22443
22487
  }
22444
- var width = !isLeft && ((offsetWidth + this.actionObj.clone.offsetLeft > this.scrollArgs.width)) ?
22488
+ var width = !isLeft && (Math.floor(offsetWidth + this.actionObj.clone.offsetLeft) > this.scrollArgs.width) ?
22445
22489
  this.parent.getElementWidth(this.actionObj.clone) : (offsetWidth < this.actionObj.cellWidth) ? offsetWidth : offsetWidth;
22446
22490
  if (this.parent.enableRtl) {
22447
22491
  var rightValue = isTimelineView ? parseInt(this.actionObj.element.style.right, 10) :
@@ -25532,6 +25576,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
25532
25576
  };
25533
25577
  VerticalView.prototype.changeCurrentTimePosition = function () {
25534
25578
  if (!this.parent || this.parent && this.parent.isDestroyed) {
25579
+ this.parent = null;
25535
25580
  return;
25536
25581
  }
25537
25582
  this.removeCurrentTimeIndicatorElements();
@@ -27431,7 +27476,7 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
27431
27476
  moduleName: 'agenda',
27432
27477
  listClass: this.parent.activeView.viewClass,
27433
27478
  itemClass: this.parent.activeView.viewClass,
27434
- template: "<div class=\"" + AGENDA_NO_EVENT_CLASS + "\">" + this.parent.localeObj.getConstant('noEvents') + "</div>"
27479
+ template: initializeCSPTemplate(function () { return "<div class=\"" + AGENDA_NO_EVENT_CLASS + "\">" + _this.parent.localeObj.getConstant('noEvents') + "</div>"; })
27435
27480
  });
27436
27481
  if (listElement.querySelector('.e-agenda-item').children.length === 0) {
27437
27482
  listElement.firstElementChild.appendChild(createElement('div', { className: AGENDA_NO_EVENT_CLASS, innerHTML: this.parent.localeObj.getConstant('noEvents') }));
@@ -28747,7 +28792,6 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
28747
28792
  };
28748
28793
  TimelineViews.prototype.changeCurrentTimePosition = function () {
28749
28794
  if (!this.parent || this.parent && this.parent.isDestroyed) {
28750
- this.parent = null;
28751
28795
  return;
28752
28796
  }
28753
28797
  this.removeCurrentTimeIndicatorElements();
@@ -28918,6 +28962,7 @@ var TimelineViews = /** @__PURE__ @class */ (function (_super) {
28918
28962
  };
28919
28963
  TimelineViews.prototype.destroy = function () {
28920
28964
  if (!this.parent || this.parent && this.parent.isDestroyed) {
28965
+ this.parent = null;
28921
28966
  return;
28922
28967
  }
28923
28968
  if (this.timelineAppointment) {