@syncfusion/ej2-schedule 19.4.42 → 19.4.50

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 (55) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/ej2-schedule.umd.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-schedule.es2015.js +85 -30
  5. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  6. package/dist/es6/ej2-schedule.es5.js +85 -30
  7. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  8. package/dist/global/ej2-schedule.min.js +2 -2
  9. package/dist/global/ej2-schedule.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +15 -15
  12. package/src/schedule/actions/drag.js +9 -7
  13. package/src/schedule/actions/keyboard.d.ts +1 -0
  14. package/src/schedule/actions/keyboard.js +23 -0
  15. package/src/schedule/base/interface.d.ts +1 -0
  16. package/src/schedule/base/schedule.js +16 -2
  17. package/src/schedule/event-renderer/agenda-base.js +1 -1
  18. package/src/schedule/event-renderer/event-base.js +4 -2
  19. package/src/schedule/event-renderer/month.js +2 -1
  20. package/src/schedule/event-renderer/timeline-view.d.ts +1 -0
  21. package/src/schedule/event-renderer/timeline-view.js +7 -5
  22. package/src/schedule/event-renderer/vertical-view.js +10 -2
  23. package/src/schedule/event-renderer/year.js +4 -1
  24. package/src/schedule/popups/event-window.js +1 -1
  25. package/src/schedule/popups/quick-popups.js +5 -5
  26. package/src/schedule/renderer/month.js +1 -1
  27. package/src/schedule/renderer/vertical-view.js +1 -1
  28. package/src/schedule/renderer/year.js +1 -1
  29. package/styles/bootstrap-dark.css +6 -2
  30. package/styles/bootstrap.css +6 -2
  31. package/styles/bootstrap4.css +6 -2
  32. package/styles/bootstrap5-dark.css +6 -2
  33. package/styles/bootstrap5.css +6 -2
  34. package/styles/fabric-dark.css +6 -2
  35. package/styles/fabric.css +6 -2
  36. package/styles/highcontrast-light.css +6 -2
  37. package/styles/highcontrast.css +6 -2
  38. package/styles/material-dark.css +6 -2
  39. package/styles/material.css +6 -2
  40. package/styles/schedule/_layout.scss +6 -2
  41. package/styles/schedule/bootstrap-dark.css +6 -2
  42. package/styles/schedule/bootstrap.css +6 -2
  43. package/styles/schedule/bootstrap4.css +6 -2
  44. package/styles/schedule/bootstrap5-dark.css +6 -2
  45. package/styles/schedule/bootstrap5.css +6 -2
  46. package/styles/schedule/fabric-dark.css +6 -2
  47. package/styles/schedule/fabric.css +6 -2
  48. package/styles/schedule/highcontrast-light.css +6 -2
  49. package/styles/schedule/highcontrast.css +6 -2
  50. package/styles/schedule/material-dark.css +6 -2
  51. package/styles/schedule/material.css +6 -2
  52. package/styles/schedule/tailwind-dark.css +6 -2
  53. package/styles/schedule/tailwind.css +6 -2
  54. package/styles/tailwind-dark.css +6 -2
  55. package/styles/tailwind.css +6 -2
@@ -1897,6 +1897,29 @@ class KeyboardInteraction {
1897
1897
  break;
1898
1898
  case 'escape':
1899
1899
  this.processEscape(e);
1900
+ break;
1901
+ case 'fTwelve':
1902
+ if (this.parent.allowInline && this.parent.inlineModule) {
1903
+ e.preventDefault();
1904
+ this.processFTwelve(e);
1905
+ }
1906
+ break;
1907
+ }
1908
+ }
1909
+ processFTwelve(e) {
1910
+ const target = e.target;
1911
+ if (target.classList.contains(WORK_CELLS_CLASS) || target.classList.contains(ALLDAY_CELLS_CLASS)) {
1912
+ this.parent.activeCellsData = this.getSelectedElements(target);
1913
+ const args = extend(this.parent.activeCellsData, { cancel: false, event: e });
1914
+ const inlineArgs = {
1915
+ element: args.element,
1916
+ groupIndex: args.groupIndex, type: 'Cell'
1917
+ };
1918
+ this.parent.notify(inlineClick, inlineArgs);
1919
+ }
1920
+ if (target.classList.contains(APPOINTMENT_CLASS)) {
1921
+ target.click();
1922
+ return;
1900
1923
  }
1901
1924
  }
1902
1925
  addEventListener() {
@@ -5121,7 +5144,7 @@ class EventBase {
5121
5144
  if (timeZonePropChanged) {
5122
5145
  this.processTimezoneChange(event, oldTimezone);
5123
5146
  }
5124
- else if (!this.parent.isPrinting) {
5147
+ else if (!this.parent.isPrinting && !this.parent.uiStateValues.isResize) {
5125
5148
  event = this.processTimezone(event);
5126
5149
  }
5127
5150
  for (let level = 0; level < resourceCollection.length; level++) {
@@ -6092,7 +6115,9 @@ class EventBase {
6092
6115
  const scheduleId = this.parent.element.id + '_';
6093
6116
  const viewName = this.parent.activeViewOptions.eventTemplateName;
6094
6117
  const templateId = scheduleId + viewName + 'eventTemplate';
6095
- templateElement = this.parent.getAppointmentTemplate()(record, this.parent, 'eventTemplate', templateId, false);
6118
+ const templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 &&
6119
+ this.parent.currentView.indexOf('Year') === -1 ? '_' + resIndex : '');
6120
+ templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6096
6121
  }
6097
6122
  else {
6098
6123
  const appointmentSubject = createElement('div', {
@@ -6525,7 +6550,9 @@ class VerticalEvent extends EventBase {
6525
6550
  const elementId = this.parent.element.id + '_';
6526
6551
  const viewName = this.parent.activeViewOptions.eventTemplateName;
6527
6552
  const templateId = elementId + viewName + 'eventTemplate';
6528
- templateElement = this.parent.getAppointmentTemplate()(record, this.parent, 'eventTemplate', templateId, false);
6553
+ const resIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : resource;
6554
+ const templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
6555
+ templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6529
6556
  }
6530
6557
  else {
6531
6558
  const appointmentSubject = createElement('div', { className: SUBJECT_CLASS, innerHTML: recordSubject });
@@ -6710,6 +6737,8 @@ class VerticalEvent extends EventBase {
6710
6737
  appointmentElement = this.createAppointmentElement(eventObj, true, record.data, resource);
6711
6738
  }
6712
6739
  addClass([appointmentElement], ALLDAY_APPOINTMENT_CLASS);
6740
+ const eventData = extend({}, record.data, null, true);
6741
+ eventObj.data = eventData;
6713
6742
  const args = { data: eventObj, element: appointmentElement, cancel: false };
6714
6743
  this.parent.trigger(eventRendered, args, (eventArgs) => {
6715
6744
  if (!eventArgs.cancel) {
@@ -6791,7 +6820,11 @@ class VerticalEvent extends EventBase {
6791
6820
  subjectElement.style.maxHeight = formatUnit(maxHeight);
6792
6821
  }
6793
6822
  const index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
6794
- this.appendEvent(eventObj, appointmentElement, index, tempData.appLeft);
6823
+ const eventData = {};
6824
+ eventData[this.fields.startTime] = eventObj[this.fields.startTime];
6825
+ eventData[this.fields.endTime] = eventObj[this.fields.endTime];
6826
+ record.data = eventData;
6827
+ this.appendEvent(record, appointmentElement, index, tempData.appLeft);
6795
6828
  this.wireAppointmentEvents(appointmentElement, eventObj);
6796
6829
  if (appHeight < this.cellHeight) {
6797
6830
  const resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + EVENT_RESIZE_CLASS));
@@ -7402,7 +7435,8 @@ class MonthEvent extends EventBase {
7402
7435
  const scheduleId = this.parent.element.id + '_';
7403
7436
  const viewName = this.parent.activeViewOptions.eventTemplateName;
7404
7437
  const templateId = scheduleId + viewName + 'eventTemplate';
7405
- templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, 'eventTemplate', templateId, false);
7438
+ const eventTemplate = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
7439
+ templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, eventTemplate, templateId, false);
7406
7440
  }
7407
7441
  else {
7408
7442
  const eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
@@ -7713,6 +7747,7 @@ class TimelineEvent extends MonthEvent {
7713
7747
  this.interval = this.parent.activeViewOptions.timeScale.interval;
7714
7748
  this.day = 0;
7715
7749
  this.rowIndex = 0;
7750
+ this.cellTops = [];
7716
7751
  this.renderType = type;
7717
7752
  this.eventContainers = [].slice.call(this.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
7718
7753
  const tr = [].slice.call(this.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr'));
@@ -7828,9 +7863,7 @@ class TimelineEvent extends MonthEvent {
7828
7863
  const cellTd = this.getCellTd();
7829
7864
  const overlapCount = (isNullOrUndefined(this.parent.eventSettings.sortComparer)) ? this.getIndex(startTime) : this.getSortComparerIndex(startTime, endTime);
7830
7865
  event.Index = overlapCount;
7831
- const elem = this.element.querySelector('.' + APPOINTMENT_CLASS);
7832
- const eleHeight = (elem) ? elem.getBoundingClientRect().height : 0;
7833
- const appHeight = (elem && eleHeight > 0) ? eleHeight : this.eventHeight;
7866
+ const appHeight = this.eventHeight;
7834
7867
  const diffInDays = eventData.count;
7835
7868
  const eventObj = extend({}, event, null, true);
7836
7869
  eventObj[this.fields.startTime] = eventData[this.fields.startTime];
@@ -7846,7 +7879,10 @@ class TimelineEvent extends MonthEvent {
7846
7879
  const position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], this.day);
7847
7880
  appWidth = (appWidth <= 0) ? this.cellWidth : appWidth; // appWidth 0 when start and end time as same
7848
7881
  this.renderedEvents.push(extend({}, event, null, true));
7849
- const top = this.getRowTop(resIndex);
7882
+ if (isNullOrUndefined(this.cellTops[resIndex])) {
7883
+ this.cellTops[resIndex] = this.getRowTop(resIndex);
7884
+ }
7885
+ const top = this.cellTops[resIndex];
7850
7886
  const appTop = (top + (this.maxHeight ? 0 : EVENT_GAP$1)) + (overlapCount * (appHeight + EVENT_GAP$1));
7851
7887
  appLeft = (this.parent.enableRtl) ? 0 : position;
7852
7888
  appRight = (this.parent.enableRtl) ? position : 0;
@@ -7950,7 +7986,7 @@ class TimelineEvent extends MonthEvent {
7950
7986
  }
7951
7987
  }
7952
7988
  updateCellHeight(cell, height) {
7953
- if ((height > cell.getBoundingClientRect().height)) {
7989
+ if ((height > this.cellHeight)) {
7954
7990
  setStyleAttribute(cell, { 'height': height + 'px' });
7955
7991
  if (this.parent.activeViewOptions.group.resources.length > 0) {
7956
7992
  const resourceCell = this.parent.element.querySelector('.' + RESOURCE_COLUMN_TABLE_CLASS + ' ' + 'tbody td[data-group-index="' +
@@ -8976,13 +9012,12 @@ class QuickPopups {
8976
9012
  if (saveButton) {
8977
9013
  this.renderButton('e-flat e-primary', '', this.parent.activeViewOptions.readonly, saveButton, this.saveClick);
8978
9014
  }
8979
- this.quickPopup.content = quickCellPopup;
8980
- this.quickPopup.dataBind();
8981
- this.applyFormValidation();
8982
9015
  if (this.morePopup) {
8983
9016
  this.morePopup.hide();
8984
9017
  }
9018
+ this.quickPopup.content = quickCellPopup;
8985
9019
  this.quickPopup.relateTo = target;
9020
+ this.quickPopup.dataBind();
8986
9021
  this.beforeQuickPopupOpen(target);
8987
9022
  }
8988
9023
  isSameEventClick(events) {
@@ -9049,13 +9084,13 @@ class QuickPopups {
9049
9084
  if (deleteButton) {
9050
9085
  this.renderButton('e-flat', '', deleteAction, deleteButton, this.deleteClick);
9051
9086
  }
9052
- this.quickPopup.content = quickEventPopup;
9053
- this.quickPopup.dataBind();
9054
9087
  if (this.morePopup && !closest(events.element, '.' + MORE_EVENT_WRAPPER_CLASS)) {
9055
9088
  this.morePopup.hide();
9056
9089
  }
9090
+ this.quickPopup.content = quickEventPopup;
9057
9091
  this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
9058
9092
  closest(events.element, '.' + APPOINTMENT_CLASS);
9093
+ this.quickPopup.dataBind();
9059
9094
  this.beforeQuickPopupOpen(events.element);
9060
9095
  }
9061
9096
  }
@@ -9342,6 +9377,7 @@ class QuickPopups {
9342
9377
  });
9343
9378
  }
9344
9379
  saveClick(event) {
9380
+ this.applyFormValidation();
9345
9381
  this.dialogEvent = event;
9346
9382
  this.isCrudAction = true;
9347
9383
  this.quickPopupHide();
@@ -11694,7 +11730,7 @@ class EventWindow {
11694
11730
  return labelText;
11695
11731
  }
11696
11732
  onChange(args) {
11697
- const target = (args.event.target);
11733
+ const target = args.event.currentTarget.querySelector('input');
11698
11734
  if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
11699
11735
  this.onAllDayChange(args.checked);
11700
11736
  }
@@ -15827,7 +15863,7 @@ let Schedule = class Schedule extends Component {
15827
15863
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
15828
15864
  this.uiStateValues = {
15829
15865
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
15830
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
15866
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true, isResize: false
15831
15867
  };
15832
15868
  }
15833
15869
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -16287,9 +16323,11 @@ let Schedule = class Schedule extends Component {
16287
16323
  }
16288
16324
  if (this.currentView === 'Month' || ((this.currentView !== 'Agenda' && this.currentView !== 'MonthAgenda')
16289
16325
  && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {
16326
+ this.uiStateValues.isResize = true;
16290
16327
  this.activeView.resetColWidth();
16291
16328
  this.notify(scrollUiUpdate, { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });
16292
16329
  this.refreshEvents(false);
16330
+ this.uiStateValues.isResize = false;
16293
16331
  }
16294
16332
  else {
16295
16333
  this.notify(contentReady, {});
@@ -17349,7 +17387,19 @@ let Schedule = class Schedule extends Component {
17349
17387
  }
17350
17388
  else {
17351
17389
  if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
17352
- this.resetTemplates(['eventTemplate']);
17390
+ let templateNames = ['eventTemplate'];
17391
+ if (this.crudModule && this.crudModule.crudObj.isCrudAction &&
17392
+ ['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.currentView) === -1) {
17393
+ templateNames = [];
17394
+ for (let i = 0, len = this.crudModule.crudObj.sourceEvent.length; i < len; i++) {
17395
+ templateNames.push('eventTemplate_' + this.crudModule.crudObj.sourceEvent[i].groupIndex);
17396
+ if (this.crudModule.crudObj.targetEvent[i] && this.crudModule.crudObj.sourceEvent[i].groupIndex !==
17397
+ this.crudModule.crudObj.targetEvent[i].groupIndex) {
17398
+ templateNames.push('eventTemplate_' + this.crudModule.crudObj.targetEvent[i].groupIndex);
17399
+ }
17400
+ }
17401
+ }
17402
+ this.resetTemplates(templateNames);
17353
17403
  }
17354
17404
  const eventsData = this.eventsData || [];
17355
17405
  const blockData = this.blockData || [];
@@ -19130,6 +19180,7 @@ class YearEvent extends TimelineEvent {
19130
19180
  const rowIndex = this.parent.activeViewOptions.orientation === 'Vertical' ? index : month;
19131
19181
  const td = this.parent.element.querySelector(`.e-content-wrap tr:nth-child(${rowIndex + 1}) td`);
19132
19182
  this.cellHeight = td.offsetHeight;
19183
+ this.groupOrder = resource.groupOrder;
19133
19184
  for (let a = 0; a < eventDatas.length; a++) {
19134
19185
  const data = eventDatas[a];
19135
19186
  let overlapIndex;
@@ -19364,7 +19415,9 @@ class YearEvent extends TimelineEvent {
19364
19415
  }
19365
19416
  }
19366
19417
  else {
19367
- if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() >= dateStart)) ||
19418
+ const timeCondition = app[this.fields.isAllDay] ? resetTime(appEnd).getTime() > dateStart :
19419
+ resetTime(appEnd).getTime() >= dateStart;
19420
+ if (((resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
19368
19421
  (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
19369
19422
  appointmentsList.push(app);
19370
19423
  }
@@ -19847,14 +19900,16 @@ class DragAndDrop extends ActionBase {
19847
19900
  else {
19848
19901
  outWrapper = this.parent.element.querySelector('.' + APPOINTMENT_CONTAINER_CLASS);
19849
19902
  }
19850
- let tarWrapper = outWrapper.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
19851
- if (!tarWrapper) {
19852
- tarWrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
19853
- outWrapper.appendChild(tarWrapper);
19903
+ if (!isNullOrUndefined(outWrapper)) {
19904
+ let tarWrapper = outWrapper.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
19905
+ if (!tarWrapper) {
19906
+ tarWrapper = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
19907
+ outWrapper.appendChild(tarWrapper);
19908
+ }
19909
+ this.actionObj.cloneElement.forEach((ele) => {
19910
+ tarWrapper.appendChild(ele);
19911
+ });
19854
19912
  }
19855
- this.actionObj.cloneElement.forEach((ele) => {
19856
- tarWrapper.appendChild(ele);
19857
- });
19858
19913
  }
19859
19914
  }
19860
19915
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -21554,7 +21609,7 @@ class VerticalView extends ViewBase {
21554
21609
  if (this.parent.activeViewOptions.allowVirtualScrolling) {
21555
21610
  clsList.push(VIRTUAL_SCROLL_CLASS);
21556
21611
  }
21557
- if (this.parent.eventSettings.ignoreWhitespace) {
21612
+ if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
21558
21613
  clsList.push(IGNORE_WHITESPACE);
21559
21614
  }
21560
21615
  this.renderPanel(type);
@@ -22166,7 +22221,7 @@ class Month extends ViewBase {
22166
22221
  if (this.parent.activeViewOptions.allowVirtualScrolling) {
22167
22222
  clsList.push(VIRTUAL_SCROLL_CLASS);
22168
22223
  }
22169
- if (this.parent.eventSettings.ignoreWhitespace) {
22224
+ if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
22170
22225
  clsList.push(IGNORE_WHITESPACE);
22171
22226
  }
22172
22227
  addClass([this.element], clsList);
@@ -22734,7 +22789,7 @@ class Year extends ViewBase {
22734
22789
  const weekNumber = this.parent.getWeekNumberContent(weekDates);
22735
22790
  const td = createElement('td', {
22736
22791
  className: 'e-week-number',
22737
- attrs: { 'role': 'gridcell', 'title': 'Week ' + weekNumber },
22792
+ attrs: { 'role': 'gridcell', 'title': this.parent.localeObj.getConstant('week') + ' ' + weekNumber },
22738
22793
  innerHTML: weekNumber
22739
22794
  });
22740
22795
  tr.appendChild(td);
@@ -23122,7 +23177,7 @@ class AgendaBase extends ViewBase {
23122
23177
  wireEventActions() {
23123
23178
  const eventElement = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
23124
23179
  for (const element of eventElement) {
23125
- this.parent.eventBase.wireAppointmentEvents(element, null, true);
23180
+ this.parent.eventBase.wireAppointmentEvents(element, this.parent.getEventDetails(element), true);
23126
23181
  }
23127
23182
  const dateHeaderElement = [].slice.call(this.parent.element.querySelectorAll('.e-m-date'));
23128
23183
  for (const element of dateHeaderElement) {