@syncfusion/ej2-schedule 20.1.47 → 20.1.52

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.
@@ -3660,10 +3660,6 @@ function generate(startDate, rule, excludeDate, startDayOfWeek, maximumCount, vi
3660
3660
  }
3661
3661
  maxOccurrence = maximumCount;
3662
3662
  setFirstDayOfWeek(DAYINDEX[startDayOfWeek]);
3663
- if (ruleObject.until) {
3664
- var end = resetTime(ruleObject.until);
3665
- ruleObject.until = new Date(end.getFullYear(), end.getMonth(), end.getDate(), 23, 59, 59);
3666
- }
3667
3663
  switch (ruleObject.freq) {
3668
3664
  case 'DAILY':
3669
3665
  dailyType(modifiedDate, ruleObject.until, data, ruleObject);
@@ -7246,7 +7242,6 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7246
7242
  function MonthEvent(parent) {
7247
7243
  var _this = _super.call(this, parent) || this;
7248
7244
  _this.renderedEvents = [];
7249
- _this.eventsRendered = [];
7250
7245
  _this.monthHeaderHeight = 0;
7251
7246
  _this.moreIndicatorHeight = 19;
7252
7247
  _this.renderType = 'day';
@@ -7267,7 +7262,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7267
7262
  appElement = (this.parent.currentView === 'Month') ? appElement : [appElement[0]];
7268
7263
  for (var _i = 0, appElement_1 = appElement; _i < appElement_1.length; _i++) {
7269
7264
  var wrap = appElement_1[_i];
7270
- if (wrap.parentElement && wrap.parentElement.parentNode) {
7265
+ if (!wrap.classList.contains('e-more-indicator') && wrap.parentElement && wrap.parentElement.parentNode) {
7271
7266
  remove(wrap.parentElement);
7272
7267
  }
7273
7268
  }
@@ -7363,7 +7358,6 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7363
7358
  };
7364
7359
  MonthEvent.prototype.renderEventsHandler = function (dateRender, workDays, resData) {
7365
7360
  this.renderedEvents = [];
7366
- this.eventsRendered = [];
7367
7361
  var eventsList;
7368
7362
  var blockList;
7369
7363
  var resIndex = 0;
@@ -7714,16 +7708,16 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7714
7708
  }
7715
7709
  var overlapCount = this.getIndex(startTime);
7716
7710
  event.Index = overlapCount;
7711
+ var appHeight = this.eventHeight;
7717
7712
  this.renderedEvents.push(extend({}, event, null, true));
7718
7713
  var diffInDays = event.data.count;
7719
7714
  if (startTime.getTime() <= endTime.getTime()) {
7720
7715
  var appWidth = (diffInDays * this.cellWidth) - 5;
7721
7716
  var cellTd = this.workCells[day];
7722
- var appTop = (overlapCount * (this.eventHeight + EVENT_GAP));
7723
- var height = this.monthHeaderHeight + ((overlapCount + 1) * (this.eventHeight + EVENT_GAP)) + this.moreIndicatorHeight;
7717
+ var appTop = (overlapCount * (appHeight + EVENT_GAP));
7718
+ var height = this.monthHeaderHeight + ((overlapCount + 1) * (appHeight + EVENT_GAP)) + this.moreIndicatorHeight;
7724
7719
  var enableAppRender = this.maxOrIndicator ? overlapCount < 1 ? true : false : this.cellHeight > height;
7725
7720
  if (this.parent.rowAutoHeight || enableAppRender) {
7726
- this.eventsRendered.push(extend({}, event, null, true));
7727
7721
  var appointmentElement = void 0;
7728
7722
  if (this.inlineValue) {
7729
7723
  appointmentElement = this.parent.inlineModule.createInlineAppointmentElement();
@@ -7739,37 +7733,28 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7739
7733
  var firstChild = cellTd.parentElement.firstElementChild;
7740
7734
  this.updateCellHeight(firstChild, height);
7741
7735
  }
7742
- else if (cellTd.querySelector('.' + MORE_INDICATOR_CLASS)) {
7743
- this.renderMoreIndicators(diffInDays, day);
7744
- }
7745
7736
  }
7746
7737
  else {
7747
- this.renderMoreIndicators(diffInDays, day);
7748
- }
7749
- }
7750
- };
7751
- MonthEvent.prototype.renderMoreIndicators = function (diffInDays, day) {
7752
- for (var i = 0; i < diffInDays; i++) {
7753
- if (this.workCells[day + i]) {
7754
- var startDate = new Date(this.dateRender[day + i].getTime());
7755
- var endDate = addDays(this.dateRender[day + i], 1);
7756
- var groupIndex = this.workCells[day + i].getAttribute('data-group-index');
7757
- var filterEvents = this.getFilteredEvents(startDate, endDate, groupIndex);
7758
- var renderedAppCount = this.getOverlapEvents(startDate, this.eventsRendered).length;
7759
- var count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);
7760
- var indicator = this.workCells[day + i].querySelector('.' + MORE_INDICATOR_CLASS);
7761
- if (indicator) {
7762
- indicator.innerHTML = this.getMoreIndicatorText(count);
7763
- }
7764
- else {
7765
- var moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);
7766
- if (!isNullOrUndefined(groupIndex)) {
7767
- moreIndicatorElement.setAttribute('data-group-index', groupIndex);
7738
+ for (var i = 0; i < diffInDays; i++) {
7739
+ var cellTd_1 = this.workCells[day + i];
7740
+ if (cellTd_1 && isNullOrUndefined(cellTd_1.querySelector('.' + MORE_INDICATOR_CLASS))) {
7741
+ var startDate = new Date(this.dateRender[day + i].getTime());
7742
+ var endDate = addDays(this.dateRender[day + i], 1);
7743
+ var groupIndex = cellTd_1.getAttribute('data-group-index');
7744
+ var filterEvents = this.getFilteredEvents(startDate, endDate, groupIndex);
7745
+ var appArea = this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight;
7746
+ appHeight = this.withIndicator ? appArea : appHeight;
7747
+ var renderedAppCount = Math.floor(appArea / (appHeight + EVENT_GAP));
7748
+ var count = (filterEvents.length - renderedAppCount) <= 0 ? 1 : (filterEvents.length - renderedAppCount);
7749
+ var moreIndicatorElement = this.getMoreIndicatorElement(count, startDate, endDate);
7750
+ if (!isNullOrUndefined(groupIndex)) {
7751
+ moreIndicatorElement.setAttribute('data-group-index', groupIndex);
7752
+ }
7753
+ moreIndicatorElement.style.top = appArea + 'px';
7754
+ moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
7755
+ this.renderElement(cellTd_1, moreIndicatorElement);
7756
+ EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
7768
7757
  }
7769
- moreIndicatorElement.style.top = (this.cellHeight - this.monthHeaderHeight - this.moreIndicatorHeight) + 'px';
7770
- moreIndicatorElement.style.width = this.cellWidth - 2 + 'px';
7771
- this.renderElement(this.workCells[day + i], moreIndicatorElement);
7772
- EventHandler.add(moreIndicatorElement, 'click', this.moreIndicatorClick, this);
7773
7758
  }
7774
7759
  }
7775
7760
  }
@@ -7891,7 +7876,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7891
7876
  MonthEvent.prototype.getMoreIndicatorElement = function (count, startDate, endDate) {
7892
7877
  var moreIndicatorElement = createElement('div', {
7893
7878
  className: MORE_INDICATOR_CLASS,
7894
- innerHTML: this.getMoreIndicatorText(count),
7879
+ innerHTML: '+' + this.parent.globalize.formatNumber(count) + '&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more')),
7895
7880
  attrs: {
7896
7881
  'tabindex': '0',
7897
7882
  'data-start-date': startDate.getTime().toString(),
@@ -7901,9 +7886,6 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7901
7886
  });
7902
7887
  return moreIndicatorElement;
7903
7888
  };
7904
- MonthEvent.prototype.getMoreIndicatorText = function (count) {
7905
- return '+' + this.parent.globalize.formatNumber(count) + '&nbsp;' + (this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant('more'));
7906
- };
7907
7889
  MonthEvent.prototype.removeHeightProperty = function (selector) {
7908
7890
  var rows = [].slice.call(this.element.querySelectorAll('.' + selector + ' tbody tr'));
7909
7891
  for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
@@ -12026,8 +12008,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12026
12008
  return labelText;
12027
12009
  };
12028
12010
  EventWindow.prototype.onChange = function (args) {
12029
- var targetSelector = "." + EVENT_WINDOW_ALL_DAY_CLASS + ",." + TIME_ZONE_CLASS + ",." + EVENT_WINDOW_REPEAT_CLASS;
12030
- var target = closest(args.event.target, targetSelector);
12011
+ var target = args.event.currentTarget.querySelector('input');
12031
12012
  if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
12032
12013
  this.onAllDayChange(args.checked);
12033
12014
  }
@@ -12193,8 +12174,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12193
12174
  };
12194
12175
  EventWindow.prototype.showDetails = function (eventData) {
12195
12176
  var eventObj = extend({}, eventData, null, true);
12196
- if ((!this.cellClickAction || this.cellClickAction && !isNullOrUndefined(this.parent.editorTemplate)) &&
12197
- eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
12177
+ if (eventObj[this.fields.endTime].getHours() === 0 && eventObj[this.fields.endTime].getMinutes() === 0) {
12198
12178
  this.trimAllDay(eventObj);
12199
12179
  }
12200
12180
  this.eventData = eventObj;
@@ -13509,8 +13489,7 @@ var Render = /** @__PURE__ @class */ (function () {
13509
13489
  this.parent.virtualScrollModule.destroy();
13510
13490
  this.parent.virtualScrollModule = null;
13511
13491
  }
13512
- if (this.parent.currentView.indexOf('Timeline') !== -1 && (this.parent.currentView.indexOf('Year') === -1 ||
13513
- (this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical'))
13492
+ if (this.parent.currentView.indexOf('Timeline') !== -1 && this.parent.currentView.indexOf('Year') === -1
13514
13493
  && this.parent.activeViewOptions.allowVirtualScrolling
13515
13494
  && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
13516
13495
  this.parent.virtualScrollModule = new VirtualScroll(this.parent);
@@ -16346,7 +16325,6 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16346
16325
  };
16347
16326
  _this.trigger(navigating, navArgs, function (navigationArgs) {
16348
16327
  if (!navigationArgs.cancel) {
16349
- _this.uiStateValues.isInitial = ['TimelineMonth', 'TimelineYear', 'Year'].indexOf(view) > -1 ? true : _this.uiStateValues.isInitial;
16350
16328
  _this.viewIndex = navigationArgs.viewIndex;
16351
16329
  _this.setProperties({ currentView: view }, true);
16352
16330
  if (_this.headerModule) {
@@ -16971,9 +16949,6 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16971
16949
  if (document.querySelectorAll(template).length) {
16972
16950
  return compile(document.querySelector(template).innerHTML.trim());
16973
16951
  }
16974
- else {
16975
- return compile(template);
16976
- }
16977
16952
  }
16978
16953
  catch (error) {
16979
16954
  return compile(template);
@@ -19859,9 +19834,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
19859
19834
  this.eventHeight = getElementHeightFromClass(eventTable, APPOINTMENT_CLASS);
19860
19835
  var wrapperCollection = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
19861
19836
  var resources = this.parent.uiStateValues.isGroupAdaptive ?
19862
- [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] :
19863
- this.parent.activeViewOptions.allowVirtualScrolling ? this.parent.resourceBase.renderedResources :
19864
- this.parent.resourceBase.lastResourceLevel;
19837
+ [this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex]] : this.parent.resourceBase.lastResourceLevel;
19865
19838
  var months = this.getMonths();
19866
19839
  if (this.parent.activeViewOptions.orientation === 'Horizontal') {
19867
19840
  for (var month = 0; month < months.length; month++) {
@@ -22987,16 +22960,16 @@ var Month = /** @__PURE__ @class */ (function (_super) {
22987
22960
  }
22988
22961
  this.setColWidth(content);
22989
22962
  if (args.scrollPosition || !args.isPreventScrollUpdate && this.parent.currentView === 'TimelineMonth') {
22990
- var top_1 = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.top : args.scrollPosition.top;
22991
- if (leftPanel) {
22992
- leftPanel.scrollTop = top_1;
22993
- }
22994
- content.scrollTop = top_1;
22995
22963
  if (this.parent.uiStateValues.isInitial) {
22996
22964
  this.scrollToSelectedDate();
22997
22965
  this.parent.uiStateValues.isInitial = false;
22998
22966
  }
22999
22967
  else {
22968
+ var top_1 = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.top : args.scrollPosition.top;
22969
+ if (leftPanel) {
22970
+ leftPanel.scrollTop = top_1;
22971
+ }
22972
+ content.scrollTop = top_1;
23000
22973
  content.scrollLeft = this.parent.currentView === 'TimelineMonth' ? this.parent.uiStateValues.left :
23001
22974
  args.scrollPosition.left;
23002
22975
  }
@@ -23017,9 +22990,6 @@ var Month = /** @__PURE__ @class */ (function (_super) {
23017
22990
  else {
23018
22991
  content.scrollLeft = 0;
23019
22992
  }
23020
- if (content.scrollLeft === 0 && this.parent.uiStateValues.isInitial) {
23021
- this.parent.uiStateValues.left = 0;
23022
- }
23023
22993
  };
23024
22994
  Month.prototype.setContentHeight = function (content, leftPanelElement, height) {
23025
22995
  content.style.height = 'auto';
@@ -23594,9 +23564,6 @@ var Year = /** @__PURE__ @class */ (function (_super) {
23594
23564
  var viewTypeClass = this.parent.activeViewOptions.orientation === 'Horizontal' ? 'e-horizontal' : 'e-vertical';
23595
23565
  addClass([this.element], [this.viewClass, viewTypeClass, className]);
23596
23566
  this.renderPanel(className);
23597
- if (this.parent.activeViewOptions.allowVirtualScrolling) {
23598
- addClass([this.element], [VIRTUAL_SCROLL_CLASS]);
23599
- }
23600
23567
  var calendarTable = this.createTableLayout(OUTER_TABLE_CLASS);
23601
23568
  this.element.appendChild(calendarTable);
23602
23569
  this.element.querySelector('table').setAttribute('role', 'presentation');
@@ -23817,7 +23784,6 @@ var Year = /** @__PURE__ @class */ (function (_super) {
23817
23784
  Year.prototype.onContentScroll = function (e) {
23818
23785
  var target = e.target;
23819
23786
  var headerWrapper = this.getDatesHeaderElement();
23820
- this.parent.notify(virtualScroll, e);
23821
23787
  if (headerWrapper) {
23822
23788
  headerWrapper.firstElementChild.scrollLeft = target.scrollLeft;
23823
23789
  }
@@ -23990,7 +23956,7 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
23990
23956
  moduleName: 'agenda',
23991
23957
  listClass: this.parent.activeView.viewClass,
23992
23958
  itemClass: this.parent.activeView.viewClass,
23993
- template: "<div class=\"" + AGENDA_NO_EVENT_CLASS + "\">" + this.parent.localeObj.getConstant('noEvents') + "</div>"
23959
+ template: '<div class=' + AGENDA_NO_EVENT_CLASS + '>${subject}</div>'
23994
23960
  });
23995
23961
  }
23996
23962
  else {
@@ -25642,7 +25608,7 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
25642
25608
  !this.parent.uiStateValues.isGroupAdaptive) {
25643
25609
  tdCollection.push(firstTd);
25644
25610
  firstTd.appendChild(this.parent.resourceBase.createResourceColumn());
25645
- this.rowCount = this.parent.resourceBase.renderedResources.length;
25611
+ this.rowCount = this.parent.resourceBase.lastResourceLevel.length;
25646
25612
  }
25647
25613
  else {
25648
25614
  tdCollection.push(firstTd);
@@ -25659,9 +25625,6 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
25659
25625
  content.appendChild(contentTable);
25660
25626
  var eventWrapper = createElement('div', { className: EVENT_TABLE_CLASS });
25661
25627
  content.appendChild(eventWrapper);
25662
- if (this.parent.virtualScrollModule) {
25663
- this.parent.virtualScrollModule.renderVirtualTrack(content);
25664
- }
25665
25628
  var contentTBody = contentTable.querySelector('tbody');
25666
25629
  if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25667
25630
  if (this.parent.rowAutoHeight) {
@@ -25779,47 +25742,6 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
25779
25742
  }
25780
25743
  }
25781
25744
  };
25782
- TimelineYear.prototype.getContentRows = function () {
25783
- var tRow = [];
25784
- var monthCells = this.getMonths();
25785
- for (var row = 0; row < this.parent.resourceBase.renderedResources.length; row++) {
25786
- var tr = createElement('tr', { attrs: { 'role': 'row' } });
25787
- tRow.push(tr);
25788
- var resData = void 0;
25789
- if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25790
- resData = this.parent.resourceBase.renderedResources[row];
25791
- }
25792
- var monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[row], 1);
25793
- var date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25794
- for (var month = 0; month < this.columnCount; month++) {
25795
- var classList$$1 = [];
25796
- var groupIndex = resData.groupIndex;
25797
- classList$$1 = classList$$1.concat(resData.className);
25798
- if (classList$$1.indexOf(RESOURCE_PARENT_CLASS) > -1) {
25799
- classList$$1.push(RESOURCE_GROUP_CELLS_CLASS);
25800
- }
25801
- else {
25802
- classList$$1.push(WORKDAY_CLASS);
25803
- }
25804
- monthDate = new Date(this.parent.selectedDate.getFullYear(), monthCells[month], 1);
25805
- date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
25806
- var tdELe = createElement('td', {
25807
- className: WORK_CELLS_CLASS,
25808
- attrs: {
25809
- 'role': 'gridcell', 'aria-selected': 'false',
25810
- 'data-date': date.getTime().toString()
25811
- }
25812
- });
25813
- addClass([tdELe], classList$$1);
25814
- tdELe.setAttribute('data-group-index', groupIndex.toString());
25815
- this.renderCellTemplate({ date: date, type: 'resourceGroupCells', groupIndex: groupIndex }, tdELe);
25816
- this.wireEvents(tdELe, 'cell');
25817
- this.parent.trigger(renderCell, { elementType: 'resourceGroupCells', element: tdELe, date: date });
25818
- tr.appendChild(tdELe);
25819
- }
25820
- }
25821
- return tRow;
25822
- };
25823
25745
  TimelineYear.prototype.renderResourceContent = function (wrapper, monthBody, contentBody) {
25824
25746
  var months = this.getMonths();
25825
25747
  for (var row = 0; row < this.rowCount; row++) {
@@ -25827,8 +25749,8 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
25827
25749
  var tr = createElement('tr', { attrs: { 'role': 'row' } });
25828
25750
  contentBody.appendChild(tr);
25829
25751
  var resData = void 0;
25830
- if (this.parent.activeViewOptions.orientation === 'Vertical' && this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25831
- resData = this.parent.resourceBase.renderedResources[row];
25752
+ if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
25753
+ resData = this.parent.resourceBase.lastResourceLevel[row];
25832
25754
  }
25833
25755
  var monthDate = new Date(this.parent.selectedDate.getFullYear(), months[row], 1);
25834
25756
  var date = this.parent.calendarUtil.getMonthStartDate(new Date(monthDate.getTime()));
@@ -25849,9 +25771,8 @@ var TimelineYear = /** @__PURE__ @class */ (function (_super) {
25849
25771
  }
25850
25772
  for (var month = 0; month < this.columnCount; month++) {
25851
25773
  var classList$$1 = [];
25852
- var groupIndex = void 0;
25774
+ var groupIndex = row;
25853
25775
  if (this.parent.activeViewOptions.orientation === 'Vertical') {
25854
- groupIndex = resData.groupIndex;
25855
25776
  classList$$1 = classList$$1.concat(resData.className);
25856
25777
  if (classList$$1.indexOf(RESOURCE_PARENT_CLASS) > -1) {
25857
25778
  classList$$1.push(RESOURCE_GROUP_CELLS_CLASS);