@syncfusion/ej2-schedule 24.2.8 → 25.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 (73) hide show
  1. package/CHANGELOG.md +17 -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 +145 -39
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +146 -36
  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 +16 -16
  13. package/src/recurrence-editor/recurrence-editor.js +1 -2
  14. package/src/schedule/actions/crud.js +9 -0
  15. package/src/schedule/actions/keyboard.d.ts +1 -0
  16. package/src/schedule/actions/keyboard.js +11 -4
  17. package/src/schedule/base/css-constant.d.ts +2 -0
  18. package/src/schedule/base/css-constant.js +2 -0
  19. package/src/schedule/base/interface.d.ts +1 -0
  20. package/src/schedule/base/schedule.d.ts +4 -1
  21. package/src/schedule/base/schedule.js +16 -1
  22. package/src/schedule/base/type.d.ts +1 -0
  23. package/src/schedule/event-renderer/agenda-base.d.ts +1 -1
  24. package/src/schedule/event-renderer/agenda-base.js +36 -14
  25. package/src/schedule/event-renderer/event-base.js +4 -2
  26. package/src/schedule/event-renderer/vertical-view.js +7 -1
  27. package/src/schedule/popups/quick-popups.js +11 -0
  28. package/src/schedule/renderer/agenda.d.ts +1 -0
  29. package/src/schedule/renderer/agenda.js +38 -9
  30. package/src/schedule/renderer/renderer.js +11 -3
  31. package/styles/bootstrap-dark.css +12 -2
  32. package/styles/bootstrap.css +12 -2
  33. package/styles/bootstrap4.css +9 -3
  34. package/styles/bootstrap5-dark.css +9 -3
  35. package/styles/bootstrap5.css +9 -3
  36. package/styles/fabric-dark.css +8 -2
  37. package/styles/fabric.css +8 -2
  38. package/styles/fluent-dark.css +13 -2
  39. package/styles/fluent.css +13 -2
  40. package/styles/highcontrast-light.css +8 -2
  41. package/styles/highcontrast.css +8 -2
  42. package/styles/material-dark.css +17 -2
  43. package/styles/material.css +17 -2
  44. package/styles/material3-dark.css +9 -3
  45. package/styles/material3.css +9 -3
  46. package/styles/recurrence-editor/_bds-definition.scss +15 -0
  47. package/styles/schedule/_bds-definition.scss +287 -0
  48. package/styles/schedule/_bootstrap4-definition.scss +1 -1
  49. package/styles/schedule/_bootstrap5-definition.scss +1 -1
  50. package/styles/schedule/_fusionnew-definition.scss +1 -1
  51. package/styles/schedule/_layout.scss +6 -1
  52. package/styles/schedule/_material3-definition.scss +1 -1
  53. package/styles/schedule/_tailwind-definition.scss +1 -1
  54. package/styles/schedule/bootstrap-dark.css +12 -2
  55. package/styles/schedule/bootstrap.css +12 -2
  56. package/styles/schedule/bootstrap4.css +9 -3
  57. package/styles/schedule/bootstrap5-dark.css +9 -3
  58. package/styles/schedule/bootstrap5.css +9 -3
  59. package/styles/schedule/fabric-dark.css +8 -2
  60. package/styles/schedule/fabric.css +8 -2
  61. package/styles/schedule/fluent-dark.css +13 -2
  62. package/styles/schedule/fluent.css +13 -2
  63. package/styles/schedule/highcontrast-light.css +8 -2
  64. package/styles/schedule/highcontrast.css +8 -2
  65. package/styles/schedule/icons/_bds.scss +235 -0
  66. package/styles/schedule/material-dark.css +17 -2
  67. package/styles/schedule/material.css +17 -2
  68. package/styles/schedule/material3-dark.css +9 -3
  69. package/styles/schedule/material3.css +9 -3
  70. package/styles/schedule/tailwind-dark.css +9 -3
  71. package/styles/schedule/tailwind.css +9 -3
  72. package/styles/tailwind-dark.css +9 -3
  73. package/styles/tailwind.css +9 -3
@@ -671,6 +671,8 @@ const TIMELINE_WRAPPER_CLASS = 'e-timeline-wrapper';
671
671
  /** @private */
672
672
  const APPOINTMENT_WRAPPER_CLASS = 'e-appointment-wrapper';
673
673
  /** @private */
674
+ const APPOINTMENT_WRAPPER_HIDDEN_CLASS = 'e-appointment-wrapper-hidden';
675
+ /** @private */
674
676
  const DAY_WRAPPER_CLASS = 'e-day-wrapper';
675
677
  /** @private */
676
678
  const TOOLBAR_CONTAINER = 'e-schedule-toolbar-container';
@@ -2566,6 +2568,13 @@ class KeyboardInteraction {
2566
2568
  }
2567
2569
  }
2568
2570
  }
2571
+ isCalendarTarget(e) {
2572
+ const keyTarget = e.currentTarget || e.target;
2573
+ if (keyTarget && !isNullOrUndefined(keyTarget.querySelector('.e-header-popup.e-popup-open'))) {
2574
+ return true;
2575
+ }
2576
+ return false;
2577
+ }
2569
2578
  cancelUpDownAction(isTimelineYear) {
2570
2579
  const isVerticalYear = isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical';
2571
2580
  const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
@@ -2579,7 +2588,7 @@ class KeyboardInteraction {
2579
2588
  }
2580
2589
  processUp(e, isMultiple) {
2581
2590
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2582
- if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2591
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear) || (this.isCalendarTarget(e))) {
2583
2592
  return;
2584
2593
  }
2585
2594
  let target = (e.target);
@@ -2627,7 +2636,7 @@ class KeyboardInteraction {
2627
2636
  }
2628
2637
  processDown(e, isMultiple) {
2629
2638
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2630
- if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
2639
+ if (isMultiple && this.cancelUpDownAction(isTimelineYear) || (this.isCalendarTarget(e))) {
2631
2640
  return;
2632
2641
  }
2633
2642
  let target = (e.target);
@@ -2737,7 +2746,7 @@ class KeyboardInteraction {
2737
2746
  }
2738
2747
  processRight(e, isMultiple) {
2739
2748
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2740
- if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2749
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear) || (this.isCalendarTarget(e))) {
2741
2750
  return;
2742
2751
  }
2743
2752
  const selectedCells = this.parent.getSelectedCells();
@@ -2808,7 +2817,7 @@ class KeyboardInteraction {
2808
2817
  }
2809
2818
  processLeft(e, isMultiple) {
2810
2819
  const isTimelineYear = this.parent.currentView === 'TimelineYear';
2811
- if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
2820
+ if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear) || (this.isCalendarTarget(e))) {
2812
2821
  return;
2813
2822
  }
2814
2823
  let target = (e.target);
@@ -6622,11 +6631,13 @@ class EventBase {
6622
6631
  createEventWrapper(type = '', index = 0) {
6623
6632
  const tr = createElement('tr');
6624
6633
  const levels = this.parent.activeView.colLevels.slice(-1)[0];
6634
+ const className = this.parent.isReact && this.parent.activeViewOptions.eventTemplate ?
6635
+ ' ' + APPOINTMENT_WRAPPER_HIDDEN_CLASS : '';
6625
6636
  for (let i = 0, len = levels.length; i < len; i++) {
6626
6637
  const col = levels[parseInt(i.toString(), 10)];
6627
6638
  const appointmentWrap = createElement('td', {
6628
- className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS : (type === 'timeIndicator') ?
6629
- TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS, attrs: { 'data-date': col.date.getTime().toString() }
6639
+ className: (type === 'allDay') ? ALLDAY_APPOINTMENT_WRAPPER_CLASS + className : (type === 'timeIndicator') ?
6640
+ TIMELINE_WRAPPER_CLASS : DAY_WRAPPER_CLASS + className, attrs: { 'data-date': col.date.getTime().toString() }
6630
6641
  });
6631
6642
  if (!isNullOrUndefined(col.groupIndex)) {
6632
6643
  appointmentWrap.setAttribute('data-group-index', col.groupIndex.toString());
@@ -6786,7 +6797,12 @@ class VerticalEvent extends EventBase {
6786
6797
  if (isDragging) {
6787
6798
  this.parent.crudModule.crudObj.isCrudAction = false;
6788
6799
  }
6789
- this.parent.renderTemplates();
6800
+ this.parent.renderTemplates(() => {
6801
+ if (this.parent.isReact && this.parent.activeViewOptions.eventTemplate) {
6802
+ const wraps = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_WRAPPER_HIDDEN_CLASS));
6803
+ removeClass(wraps, APPOINTMENT_WRAPPER_HIDDEN_CLASS);
6804
+ }
6805
+ });
6790
6806
  }
6791
6807
  initializeValues() {
6792
6808
  this.resources = (this.parent.activeViewOptions.group.resources.length > 0) ? this.parent.uiStateValues.isGroupAdaptive ?
@@ -10426,6 +10442,17 @@ class QuickPopups {
10426
10442
  instance.destroy();
10427
10443
  }
10428
10444
  }
10445
+ if (popupName === 'quickPopup') {
10446
+ const input = popup.element.querySelector('input.' + SUBJECT_CLASS);
10447
+ if (input) {
10448
+ input.remove();
10449
+ }
10450
+ const form = this.quickPopup.element.querySelector('form.' + FORM_CLASS);
10451
+ if (form) {
10452
+ removeChildren(form);
10453
+ form.remove();
10454
+ }
10455
+ }
10429
10456
  }
10430
10457
  refreshQuickDialog() {
10431
10458
  this.destroyQuickDialog();
@@ -11306,7 +11333,6 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
11306
11333
  setTemplate() {
11307
11334
  const dayData = this.getDayData('narrow');
11308
11335
  const fullDay = this.getDayData('wide');
11309
- const labelId = this.element.id + '_' + 'end_label';
11310
11336
  this.element.innerHTML = '<div class="' + HEADER + '">' +
11311
11337
  '<div class="' + INPUTWARAPPER + ' ' + FORMLEFT + '">' +
11312
11338
  '<input type="text" tabindex="0" class="' + REPEATELEMENT +
@@ -11353,7 +11379,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
11353
11379
  '</div></div>' +
11354
11380
  '<div class="' + INPUTWARAPPERSIDE + ' ' + ENDON + ' ' + FORMRIGHT + '">' +
11355
11381
  '<div class="' + INPUTWARAPPER + ' ' + ENDONLEFT + '">' +
11356
- '<input type="text" tabindex="0" class="' + ENDONELEMENT + '" aria-labelledby="' + labelId + '"title="' + this.localeObj.getConstant(END) + '" />' +
11382
+ '<input type="text" tabindex="0" class="' + ENDONELEMENT + '"title="' + this.localeObj.getConstant(END) + '" />' +
11357
11383
  '</div>' +
11358
11384
  '<div class="' + INPUTWARAPPER + ' ' + ENDONDATE + '" >' +
11359
11385
  '<input type="text" tabindex="0" class="' + UNTILDATE + '"title="' + this.localeObj.getConstant(UNTIL$1) + '" />' +
@@ -14163,15 +14189,21 @@ class Render {
14163
14189
  break;
14164
14190
  case 'TimelineDay':
14165
14191
  this.parent.activeView = this.parent.timelineViewsModule;
14166
- this.parent.activeView.viewClass = 'e-timeline-day-view';
14192
+ if (!isNullOrUndefined(this.parent.activeView)) {
14193
+ this.parent.activeView.viewClass = 'e-timeline-day-view';
14194
+ }
14167
14195
  break;
14168
14196
  case 'TimelineWorkWeek':
14169
14197
  this.parent.activeView = this.parent.timelineViewsModule;
14170
- this.parent.activeView.viewClass = 'e-timeline-work-week-view';
14198
+ if (!isNullOrUndefined(this.parent.activeView)) {
14199
+ this.parent.activeView.viewClass = 'e-timeline-work-week-view';
14200
+ }
14171
14201
  break;
14172
14202
  case 'TimelineWeek':
14173
14203
  this.parent.activeView = this.parent.timelineViewsModule;
14174
- this.parent.activeView.viewClass = 'e-timeline-week-view';
14204
+ if (!isNullOrUndefined(this.parent.activeView)) {
14205
+ this.parent.activeView.viewClass = 'e-timeline-week-view';
14206
+ }
14175
14207
  break;
14176
14208
  case 'TimelineMonth':
14177
14209
  this.parent.activeView = this.parent.timelineMonthModule;
@@ -14188,6 +14220,8 @@ class Render {
14188
14220
  this.parent.headerModule.updateActiveView();
14189
14221
  this.parent.headerModule.setCalendarView();
14190
14222
  }
14223
+ console.warn('[WARNING] :: Module "' + viewName + '" is not available in Schedule component!' +
14224
+ ' You either misspelled the module name or forgot to load it.');
14191
14225
  return this.initializeLayout(firstView);
14192
14226
  }
14193
14227
  throw Error('Inject required modules');
@@ -14365,6 +14399,12 @@ class Crud {
14365
14399
  if (!this.parent.activeView) {
14366
14400
  return;
14367
14401
  }
14402
+ if (this.parent.uiStateValues && this.parent.uiStateValues.isPreventEventRefresh) {
14403
+ this.parent.uiStateValues.isPreventEventRefresh = false;
14404
+ this.parent.refreshEvents(false);
14405
+ this.parent.hideSpinner();
14406
+ return;
14407
+ }
14368
14408
  const start = this.parent.activeView.startDate();
14369
14409
  const end = this.parent.activeView.endDate();
14370
14410
  const dataManager = this.parent.dataModule.getData(this.parent.dataModule.generateQuery(start, end));
@@ -14375,6 +14415,9 @@ class Crud {
14375
14415
  return;
14376
14416
  }
14377
14417
  this.parent.trigger(dataBinding, e, (args) => {
14418
+ if (args.cancel) {
14419
+ return;
14420
+ }
14378
14421
  const resultData = extend([], args.result, null, true);
14379
14422
  this.parent.eventsData = resultData.filter((data) => !data[this.parent.eventFields.isBlock]);
14380
14423
  this.parent.blockData = resultData.filter((data) => data[this.parent.eventFields.isBlock]);
@@ -18428,9 +18471,13 @@ let Schedule = class Schedule extends Component {
18428
18471
  *
18429
18472
  * @function setResourceCollections
18430
18473
  * @param {ResourcesModel[]} resourceCol Accepts the resource collections in ResourcesModel type
18474
+ * @param {boolean} isEventDataRefresh Accepts the boolean to refresh the appointment data source from remote or local
18431
18475
  * @returns {void}
18432
18476
  */
18433
- setResourceCollections(resourceCol) {
18477
+ setResourceCollections(resourceCol, isEventDataRefresh = true) {
18478
+ if (!isEventDataRefresh && this.uiStateValues) {
18479
+ this.uiStateValues.isPreventEventRefresh = true;
18480
+ }
18434
18481
  this.setProperties({ resources: resourceCol }, false);
18435
18482
  }
18436
18483
  /**
@@ -18550,6 +18597,8 @@ let Schedule = class Schedule extends Component {
18550
18597
  this.iCalendarExportModule.initializeCalendarExport(fileName, customData);
18551
18598
  }
18552
18599
  else {
18600
+ console.warn('[WARNING] :: Module "ICalendarExport" is not available in Schedule component!' +
18601
+ ' You either misspelled the module name or forgot to load it.');
18553
18602
  throw Error('Inject ICalendarExport module');
18554
18603
  }
18555
18604
  }
@@ -18566,6 +18615,8 @@ let Schedule = class Schedule extends Component {
18566
18615
  this.iCalendarImportModule.initializeCalendarImport(fileContent);
18567
18616
  }
18568
18617
  else {
18618
+ console.warn('[WARNING] :: Module "ICalendarImport" is not available in Schedule component!' +
18619
+ ' You either misspelled the module name or forgot to load it.');
18569
18620
  throw Error('Inject ICalendarImport module');
18570
18621
  }
18571
18622
  }
@@ -18611,6 +18662,8 @@ let Schedule = class Schedule extends Component {
18611
18662
  this.excelExportModule.initializeExcelExport(excelExportOptions);
18612
18663
  }
18613
18664
  else {
18665
+ console.warn('[WARNING] :: Module "ExcelExport" is not available in Schedule component!' +
18666
+ ' You either misspelled the module name or forgot to load it.');
18614
18667
  throw Error('Inject ExcelExport module');
18615
18668
  }
18616
18669
  }
@@ -18627,6 +18680,8 @@ let Schedule = class Schedule extends Component {
18627
18680
  this.printModule.print(printOptions);
18628
18681
  }
18629
18682
  else {
18683
+ console.warn('[WARNING] :: Module "Print" is not available in Schedule component!' +
18684
+ ' You either misspelled the module name or forgot to load it.');
18630
18685
  throw Error('Inject Print module');
18631
18686
  }
18632
18687
  }
@@ -18909,6 +18964,8 @@ let Schedule = class Schedule extends Component {
18909
18964
  }
18910
18965
  /**
18911
18966
  * To check whether the given time range slots are available for event creation or already occupied by other events.
18967
+ * This method currently focuses on validating appointments within the current view date range.
18968
+ * However, it does not extend this availability check to recurrence occurrences outside of the current date range.
18912
18969
  *
18913
18970
  * @function isSlotAvailable
18914
18971
  * @param {Date | Object} startTime Denotes the start time of the slot.
@@ -25088,23 +25145,40 @@ class AgendaBase extends ViewBase {
25088
25145
  EventHandler.add(element, 'click', this.parent.agendaModule.dayNavigationClick, this);
25089
25146
  }
25090
25147
  }
25091
- calculateResourceTableElement(tBody, noOfDays, agendaDate) {
25148
+ calculateResourceTableElement(tBody, noOfDays, agendaDate, agendaEnd = null) {
25092
25149
  if (isNullOrUndefined(this.parent.resourceBase.lastResourceLevel)) {
25093
25150
  const level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays);
25094
25151
  this.parent.resourceBase.generateResourceLevels(level);
25095
25152
  }
25096
- const agendaLastDate = addDays(new Date(agendaDate.getTime()), noOfDays);
25153
+ let agendaLastDate = addDays(new Date(agendaDate.getTime()), noOfDays);
25097
25154
  const days = (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda') ? noOfDays : 1;
25098
25155
  const resColl = this.parent.resourceBase.resourceCollection;
25099
25156
  const resData = this.parent.resourceBase.lastResourceLevel;
25100
- const initialDate = agendaDate;
25157
+ const agendaStart = agendaDate;
25158
+ let initialDate = agendaDate;
25159
+ const showWeekend = this.parent.activeViewOptions.showWeekend;
25101
25160
  for (let i = 0; i < days; i++) {
25102
25161
  const lastLevelInfo = [];
25103
25162
  const tempLastLevelInfo = [];
25104
25163
  let tempIndex = 0;
25105
25164
  let eventObj;
25106
25165
  let dateObj;
25107
- const firstDate = addDays(initialDate, i);
25166
+ let firstDate = addDays(initialDate, i);
25167
+ if (this.parent.currentView === 'Agenda' && this.parent.activeViewOptions.group.byDate &&
25168
+ this.parent.activeViewOptions.allowVirtualScrolling && !showWeekend && !this.isWorkDay(firstDate)) {
25169
+ do {
25170
+ firstDate = addDays(firstDate, 1);
25171
+ if (firstDate >= agendaEnd) {
25172
+ break;
25173
+ }
25174
+ } while (!this.isWorkDay(firstDate) ||
25175
+ this.parent.eventBase.filterEvents(firstDate, addDays(firstDate, 1)).length < 1);
25176
+ if (firstDate >= agendaEnd) {
25177
+ break;
25178
+ }
25179
+ initialDate = addDays(firstDate, -i);
25180
+ agendaLastDate = addDays(firstDate, 1);
25181
+ }
25108
25182
  const finalDate = (this.parent.activeViewOptions.group.byDate || this.parent.currentView === 'MonthAgenda')
25109
25183
  ? addDays(firstDate, 1) : agendaLastDate;
25110
25184
  const agendaCollection = this.parent.eventBase.filterEvents(firstDate, finalDate);
@@ -25119,7 +25193,9 @@ class AgendaBase extends ViewBase {
25119
25193
  for (let r = 0; r < noOfDays; r++) {
25120
25194
  // eslint-disable-next-line max-len
25121
25195
  const resDayCollection = this.parent.eventBase.filterEvents(agendaDate, addDays(agendaDate, 1), resDataCollection, undefined);
25122
- if (resDayCollection.length > 0 || !this.parent.hideEmptyAgendaDays ||
25196
+ if (((showWeekend || !showWeekend && (this.parent.group.byDate ? this.isWorkDay(agendaDate) :
25197
+ this.isWorkDay(agendaDate, resData[parseInt(res.toString(), 10)].workDays)))
25198
+ && (resDayCollection.length > 0 || !this.parent.hideEmptyAgendaDays)) ||
25123
25199
  this.parent.currentView === 'MonthAgenda') {
25124
25200
  data.push(resDayCollection[0]);
25125
25201
  eventObj = {
@@ -25145,16 +25221,18 @@ class AgendaBase extends ViewBase {
25145
25221
  agendaDate = addDays(agendaDate, 1);
25146
25222
  if (agendaDate.getTime() >= agendaLastDate.getTime() || this.parent.activeViewOptions.group.byDate
25147
25223
  || this.parent.currentView === 'MonthAgenda') {
25148
- lastLevelInfo[lastLevelInfo.length - 1][1].cssClass = AGENDA_DAY_BORDER_CLASS;
25149
- const tempObj = {
25150
- rowSpan: data.length, type: 'resourceColumn', resource: resColl[parseInt((resColl.length - 1).toString(), 10)],
25151
- groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
25152
- resourceData: resData[parseInt(res.toString(), 10)].resourceData,
25153
- groupIndex: (lastLevelInfo.length - data.length), className: [RESOURCE_NAME],
25154
- date: agendaDate
25155
- };
25156
- lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
25157
- tempLastLevelInfo.push(extend({}, tempObj, null, true));
25224
+ if (data.length > 0) {
25225
+ lastLevelInfo[lastLevelInfo.length - 1][1].cssClass = AGENDA_DAY_BORDER_CLASS;
25226
+ const tempObj = {
25227
+ rowSpan: data.length, type: 'resourceColumn', resource: resColl[parseInt((resColl.length - 1).toString(), 10)],
25228
+ groupOrder: resData[parseInt(res.toString(), 10)].groupOrder.slice(0, -1),
25229
+ resourceData: resData[parseInt(res.toString(), 10)].resourceData,
25230
+ groupIndex: (lastLevelInfo.length - data.length), className: [RESOURCE_NAME],
25231
+ date: agendaDate
25232
+ };
25233
+ lastLevelInfo[parseInt((lastLevelInfo.length - data.length).toString(), 10)].push(tempObj);
25234
+ tempLastLevelInfo.push(extend({}, tempObj, null, true));
25235
+ }
25158
25236
  break;
25159
25237
  }
25160
25238
  }
@@ -25189,9 +25267,9 @@ class AgendaBase extends ViewBase {
25189
25267
  this.createResourceTableRow(lastLevelInfo, tBody);
25190
25268
  }
25191
25269
  }
25192
- const totalCollection = this.parent.eventBase.filterEvents(initialDate, agendaLastDate);
25270
+ const totalCollection = this.parent.eventBase.filterEvents(agendaStart, agendaLastDate);
25193
25271
  if (totalCollection.length === 0 && !this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) {
25194
- this.renderEmptyContent(tBody, initialDate);
25272
+ this.renderEmptyContent(tBody, agendaStart);
25195
25273
  }
25196
25274
  }
25197
25275
  createResourceTableRow(tContent, tBody) {
@@ -25446,9 +25524,19 @@ class Agenda extends AgendaBase {
25446
25524
  const firstDate = new Date(agendaDate.getTime());
25447
25525
  const isObject = this.appointmentFiltering(firstDate, lastDate);
25448
25526
  if (isObject.length > 0 && this.parent.activeViewOptions.allowVirtualScrolling && this.parent.hideEmptyAgendaDays) {
25449
- agendaDate = isObject[0][fieldMapping.startTime];
25450
- agendaDate = new Date(new Date(agendaDate.getTime()).setHours(0, 0, 0, 0));
25451
- this.updateHeaderText(isObject[0][fieldMapping.startTime]);
25527
+ if (!this.parent.activeViewOptions.showWeekend && !this.isAgendaWorkDay(isObject[0][fieldMapping.startTime])) {
25528
+ for (const event of isObject) {
25529
+ if (this.isAgendaWorkDay(event[fieldMapping.startTime])) {
25530
+ agendaDate = new Date(new Date(event[fieldMapping.startTime].getTime()).setHours(0, 0, 0, 0));
25531
+ this.updateHeaderText(event[fieldMapping.startTime]);
25532
+ break;
25533
+ }
25534
+ }
25535
+ }
25536
+ else {
25537
+ agendaDate = new Date(new Date(isObject[0][fieldMapping.startTime].getTime()).setHours(0, 0, 0, 0));
25538
+ this.updateHeaderText(isObject[0][fieldMapping.startTime]);
25539
+ }
25452
25540
  }
25453
25541
  let endDate;
25454
25542
  if (!this.parent.hideEmptyAgendaDays || (this.parent.agendaDaysCount > 0 && isObject.length > 0)) {
@@ -25462,18 +25550,25 @@ class Agenda extends AgendaBase {
25462
25550
  this.parent.headerModule.updateHeaderItems('remove');
25463
25551
  }
25464
25552
  }
25465
- this.calculateResourceTableElement(tBody, this.parent.agendaDaysCount, date);
25553
+ this.calculateResourceTableElement(tBody, this.parent.agendaDaysCount, date, lastDate);
25466
25554
  }
25467
25555
  else {
25468
25556
  for (let day = 0; day < this.parent.agendaDaysCount; day++) {
25469
- const filterData = this.appointmentFiltering(agendaDate);
25470
25557
  const nTr = this.createTableRowElement(agendaDate, 'data');
25471
- if (this.element.querySelector('tr[data-row-index="' + parseInt(nTr.getAttribute('data-row-index'), 10) + '"]')) {
25558
+ const virtualContent = this.element.querySelector('tr[data-row-index="' + (+(nTr.dataset.rowIndex)) + '"]');
25559
+ if (virtualContent || !this.parent.activeViewOptions.showWeekend && !this.isAgendaWorkDay(agendaDate)) {
25472
25560
  agendaDate = addDays(agendaDate, 1);
25561
+ if (!virtualContent && this.parent.activeViewOptions.allowVirtualScrolling) {
25562
+ day--;
25563
+ }
25564
+ if (agendaDate.getTime() > lastDate.getTime()) {
25565
+ break;
25566
+ }
25473
25567
  continue;
25474
25568
  }
25475
25569
  const dTd = nTr.children[0];
25476
25570
  const aTd = nTr.children[1];
25571
+ const filterData = this.appointmentFiltering(agendaDate);
25477
25572
  if (filterData.length > 0 || (!this.parent.hideEmptyAgendaDays && filterData.length === 0)) {
25478
25573
  const elementType = (!this.parent.hideEmptyAgendaDays && filterData.length === 0) ? 'noEvents' : 'data';
25479
25574
  dTd.appendChild(this.createDateHeaderElement(agendaDate));
@@ -25500,6 +25595,14 @@ class Agenda extends AgendaBase {
25500
25595
  }
25501
25596
  this.agendaDates = { start: firstDate, end: endDate };
25502
25597
  }
25598
+ isAgendaWorkDay(date) {
25599
+ if (this.parent.uiStateValues.isGroupAdaptive && !this.parent.group.byDate) {
25600
+ return this.isWorkDay(date, this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex].workDays);
25601
+ }
25602
+ else {
25603
+ return this.isWorkDay(date);
25604
+ }
25605
+ }
25503
25606
  agendaScrolling(event) {
25504
25607
  if (this.parent.quickPopup) {
25505
25608
  this.parent.quickPopup.quickPopupHide();
@@ -25604,9 +25707,12 @@ class Agenda extends AgendaBase {
25604
25707
  const lastDate = this.getEndDateFromStartDate(date);
25605
25708
  let daysCount = 0;
25606
25709
  do {
25607
- const filterData = this.appointmentFiltering(currentDate);
25608
- if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
25609
- daysCount++;
25710
+ if (this.parent.activeViewOptions.showWeekend || !this.parent.activeViewOptions.showWeekend &&
25711
+ this.isAgendaWorkDay(currentDate)) {
25712
+ const filterData = this.appointmentFiltering(currentDate);
25713
+ if (filterData.length > 0 || !this.parent.hideEmptyAgendaDays) {
25714
+ daysCount++;
25715
+ }
25610
25716
  }
25611
25717
  currentDate = addDays(currentDate, (type === 'next') ? 1 : -1);
25612
25718
  if (currentDate < firstDate || currentDate > lastDate) {