@syncfusion/ej2-schedule 21.1.35 → 21.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.
@@ -2306,7 +2306,7 @@ class KeyboardInteraction {
2306
2306
  nextAppEle = isReverse ? appointments[appointments.length - 1] : appointments[0];
2307
2307
  }
2308
2308
  if (nextAppEle) {
2309
- this.parent.eventBase.addSelectedAppointments([nextAppEle]);
2309
+ this.parent.eventBase.addSelectedAppointments([nextAppEle], true);
2310
2310
  nextAppEle.focus();
2311
2311
  addClass([nextAppEle], AGENDA_SELECTED_CELL);
2312
2312
  }
@@ -2332,7 +2332,7 @@ class KeyboardInteraction {
2332
2332
  if (filteredElements.length > 0) {
2333
2333
  const selectedElement = isReverse ? filteredElements[filteredElements.length - 1] : filteredElements[0];
2334
2334
  const focusElements = this.getAppointmentElementsByGuid(selectedElement.getAttribute('data-guid'));
2335
- this.parent.eventBase.addSelectedAppointments(focusElements);
2335
+ this.parent.eventBase.addSelectedAppointments(focusElements, true);
2336
2336
  (focusElements[focusElements.length - 1]).focus();
2337
2337
  }
2338
2338
  }
@@ -2790,7 +2790,7 @@ class KeyboardInteraction {
2790
2790
  if (appElements.length > 0) {
2791
2791
  this.parent.eventBase.removeSelectedAppointmentClass();
2792
2792
  const focusAppointment = isReverse ? appElements.slice(-1)[0] : appElements[0];
2793
- this.parent.eventBase.addSelectedAppointments([focusAppointment]);
2793
+ this.parent.eventBase.addSelectedAppointments([focusAppointment], true);
2794
2794
  focusAppointment.focus();
2795
2795
  e.preventDefault();
2796
2796
  }
@@ -2892,7 +2892,7 @@ class KeyboardInteraction {
2892
2892
  const nextAppEle = eventEle[0];
2893
2893
  if (nextAppEle) {
2894
2894
  this.parent.eventBase.removeSelectedAppointmentClass();
2895
- this.parent.eventBase.addSelectedAppointments([nextAppEle]);
2895
+ this.parent.eventBase.addSelectedAppointments([nextAppEle], true);
2896
2896
  nextAppEle.focus();
2897
2897
  }
2898
2898
  }
@@ -2904,7 +2904,7 @@ class KeyboardInteraction {
2904
2904
  if (appElements.length > 0) {
2905
2905
  this.parent.eventBase.removeSelectedAppointmentClass();
2906
2906
  const focusAppointment = appElements[0];
2907
- this.parent.eventBase.addSelectedAppointments([focusAppointment]);
2907
+ this.parent.eventBase.addSelectedAppointments([focusAppointment], true);
2908
2908
  focusAppointment.focus();
2909
2909
  e.preventDefault();
2910
2910
  }
@@ -5682,7 +5682,7 @@ class EventBase {
5682
5682
  }
5683
5683
  }
5684
5684
  if (target && this.parent.selectedElements.length > 0) {
5685
- this.addSelectedAppointments(this.parent.selectedElements);
5685
+ this.addSelectedAppointments(this.parent.selectedElements, false);
5686
5686
  }
5687
5687
  return this.parent.selectedElements;
5688
5688
  }
@@ -5711,12 +5711,12 @@ class EventBase {
5711
5711
  removeClass(selectedAppointments, AGENDA_SELECTED_CELL);
5712
5712
  }
5713
5713
  }
5714
- addSelectedAppointments(cells) {
5714
+ addSelectedAppointments(cells, preventFocus) {
5715
5715
  if (this.parent.currentView !== 'MonthAgenda') {
5716
5716
  this.parent.removeSelectedClass();
5717
5717
  }
5718
5718
  addClass(cells, APPOINTMENT_BORDER);
5719
- if (cells.length > 0) {
5719
+ if (cells.length > 0 && !preventFocus) {
5720
5720
  cells[cells.length - 1].focus();
5721
5721
  }
5722
5722
  }
@@ -5740,6 +5740,10 @@ class EventBase {
5740
5740
  }
5741
5741
  const selectedAppointments = this.getSelectedAppointments();
5742
5742
  if (selectedAppointments.length > 0) {
5743
+ if (this.parent.activeEventData && this.parent.activeEventData.element && selectedAppointments.indexOf(this.parent.activeEventData.element) > -1) {
5744
+ this.parent.activeEventData.element.focus();
5745
+ return;
5746
+ }
5743
5747
  selectedAppointments[selectedAppointments.length - 1].focus();
5744
5748
  return;
5745
5749
  }
@@ -6030,7 +6034,7 @@ class EventBase {
6030
6034
  const target = closest(eventData.target, '.' + APPOINTMENT_CLASS);
6031
6035
  const guid = target.getAttribute('data-guid');
6032
6036
  if (isMultiple) {
6033
- this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]')));
6037
+ this.addSelectedAppointments([].slice.call(this.parent.element.querySelectorAll('div[data-guid="' + guid + '"]')), true);
6034
6038
  target.focus();
6035
6039
  }
6036
6040
  let eventObject = this.getEventByGuid(guid);
@@ -16506,6 +16510,9 @@ let Schedule = class Schedule extends Component {
16506
16510
  if (this.headerModule) {
16507
16511
  this.headerModule.setCalendarDate(navigationArgs.currentDate);
16508
16512
  }
16513
+ if (this.currentView === 'MonthAgenda' && this.monthAgendaModule) {
16514
+ this.monthAgendaModule.monthAgendaDate = new Date('' + this.selectedDate);
16515
+ }
16509
16516
  this.initializeView(this.currentView);
16510
16517
  this.animateLayout();
16511
16518
  args = { requestType: 'dateNavigate', cancel: false, event: event };
@@ -17401,6 +17408,7 @@ let Schedule = class Schedule extends Component {
17401
17408
  this.changeDate(this.selectedDate);
17402
17409
  }
17403
17410
  else if (state.isLayout) {
17411
+ this.activeCellsData = null;
17404
17412
  this.initializeView(this.currentView);
17405
17413
  }
17406
17414
  else if (state.isDataManager && this.crudModule) {
@@ -18438,7 +18446,7 @@ let Schedule = class Schedule extends Component {
18438
18446
  const element = this.element.querySelector('div[data-guid="' + selectEvent.Guid + '"]');
18439
18447
  if (element) {
18440
18448
  this.eventBase.removeSelectedAppointmentClass();
18441
- this.eventBase.addSelectedAppointments([element]);
18449
+ this.eventBase.addSelectedAppointments([element], false);
18442
18450
  this.activeEventData = { event: selectEvent, element: element };
18443
18451
  if (this.currentView === 'Agenda' || this.currentView === 'MonthAgenda') {
18444
18452
  addClass([this.activeEventData.element], AGENDA_SELECTED_CELL);